summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/Makefile5
-rw-r--r--sys/alpha/alpha/alpha-gdbstub.c10
-rw-r--r--sys/alpha/alpha/autoconf.c18
-rw-r--r--sys/alpha/alpha/clock.c10
-rw-r--r--sys/alpha/alpha/clock_if.m4
-rw-r--r--sys/alpha/alpha/cons.c4
-rw-r--r--sys/alpha/alpha/db_disasm.c16
-rw-r--r--sys/alpha/alpha/dec_2100_a50.c4
-rw-r--r--sys/alpha/alpha/dec_eb164.c10
-rw-r--r--sys/alpha/alpha/dec_eb64plus.c187
-rw-r--r--sys/alpha/alpha/dec_kn20aa.c6
-rw-r--r--sys/alpha/alpha/dec_st550.c3
-rw-r--r--sys/alpha/alpha/diskslice_machdep.c4
-rw-r--r--sys/alpha/alpha/elf_machdep.c6
-rw-r--r--sys/alpha/alpha/fp_emulate.c411
-rw-r--r--sys/alpha/alpha/genassym.c8
-rw-r--r--sys/alpha/alpha/ieee_float.c1515
-rw-r--r--sys/alpha/alpha/ieee_float.h102
-rw-r--r--sys/alpha/alpha/interrupt.c68
-rw-r--r--sys/alpha/alpha/ipl_funcs.c6
-rw-r--r--sys/alpha/alpha/locore.s24
-rw-r--r--sys/alpha/alpha/machdep.c122
-rw-r--r--sys/alpha/alpha/mem.c18
-rw-r--r--sys/alpha/alpha/pal.s21
-rw-r--r--sys/alpha/alpha/pmap.c9
-rw-r--r--sys/alpha/alpha/support.s7
-rw-r--r--sys/alpha/alpha/swtch.s13
-rw-r--r--sys/alpha/alpha/sys_machdep.c79
-rw-r--r--sys/alpha/alpha/trap.c27
-rw-r--r--sys/alpha/alpha/vm_machdep.c20
-rw-r--r--sys/alpha/conf/GENERIC4
-rw-r--r--sys/alpha/conf/Makefile.alpha18
-rw-r--r--sys/alpha/conf/files.alpha26
-rw-r--r--sys/alpha/conf/majors.alpha7
-rw-r--r--sys/alpha/conf/options.alpha3
-rw-r--r--sys/alpha/include/alpha_cpu.h9
-rw-r--r--sys/alpha/include/ansi.h21
-rw-r--r--sys/alpha/include/chipset.h25
-rw-r--r--sys/alpha/include/console.h4
-rw-r--r--sys/alpha/include/fpu.h124
-rw-r--r--sys/alpha/include/frame.h62
-rw-r--r--sys/alpha/include/ieeefp.h16
-rw-r--r--sys/alpha/include/inst.h462
-rw-r--r--sys/alpha/include/intr.h17
-rw-r--r--sys/alpha/include/intrcnt.h79
-rw-r--r--sys/alpha/include/md_var.h3
-rw-r--r--sys/alpha/include/mouse.h4
-rw-r--r--sys/alpha/include/pcb.h3
-rw-r--r--sys/alpha/include/proc.h11
-rw-r--r--sys/alpha/include/resource.h44
-rw-r--r--sys/alpha/include/signal.h8
-rw-r--r--sys/alpha/include/types.h24
-rw-r--r--sys/alpha/include/vmparam.h12
-rw-r--r--sys/alpha/isa/isa.c469
-rw-r--r--sys/alpha/pci/apecs.c84
-rw-r--r--sys/alpha/pci/cia.c145
-rw-r--r--sys/alpha/pci/lca.c31
-rw-r--r--sys/alpha/pci/pci_eb64plus_intr.s63
-rw-r--r--sys/alpha/pci/pcibus.c130
-rw-r--r--sys/alpha/pci/pcibus.h26
-rw-r--r--sys/alpha/tc/am7990.c5
-rw-r--r--sys/alpha/tc/espvar.h5
-rw-r--r--sys/alpha/tlsb/dwlpx.c8
-rw-r--r--sys/alpha/tlsb/gbus.c6
-rw-r--r--sys/alpha/tlsb/kftxx.c6
-rw-r--r--sys/alpha/tlsb/tlsb.c35
-rw-r--r--sys/alpha/tlsb/zs_tlsb.c14
-rw-r--r--sys/boot/Makefile7
-rw-r--r--sys/boot/alpha/Makefile.inc8
-rw-r--r--sys/boot/alpha/boot1/Makefile10
-rw-r--r--sys/boot/alpha/boot1/boot1.c4
-rw-r--r--sys/boot/alpha/boot2/Makefile22
-rw-r--r--sys/boot/alpha/boot2/help.alpha0
-rw-r--r--sys/boot/alpha/boot2/newvers.sh1
-rw-r--r--sys/boot/alpha/common/main.c76
-rw-r--r--sys/boot/alpha/libalpha/Makefile4
-rw-r--r--sys/boot/alpha/libalpha/srmdisk.c41
-rw-r--r--sys/boot/alpha/libalpha/start.S15
-rw-r--r--sys/boot/alpha/netboot/Makefile6
-rw-r--r--sys/boot/common/Makefile.inc12
-rw-r--r--sys/boot/common/bcache.c262
-rw-r--r--sys/boot/common/boot.c12
-rw-r--r--sys/boot/common/bootstrap.h134
-rw-r--r--sys/boot/common/commands.c216
-rw-r--r--sys/boot/common/console.c10
-rw-r--r--sys/boot/common/help.common262
-rw-r--r--sys/boot/common/interp.c61
-rw-r--r--sys/boot/common/interp_backslash.c5
-rw-r--r--sys/boot/common/interp_forth.c142
-rw-r--r--sys/boot/common/interp_parse.c8
-rw-r--r--sys/boot/common/isapnp.c236
-rw-r--r--sys/boot/common/isapnp.h8
-rw-r--r--sys/boot/common/load_aout.c48
-rw-r--r--sys/boot/common/load_elf.c113
-rw-r--r--sys/boot/common/ls.c3
-rw-r--r--sys/boot/common/merge_help.awk101
-rw-r--r--sys/boot/common/module.c4
-rw-r--r--sys/boot/common/pnp.c173
-rw-r--r--sys/boot/common/pnpdata183
-rw-r--r--sys/boot/ficl/Makefile30
-rw-r--r--sys/boot/ficl/dict.c779
-rw-r--r--sys/boot/ficl/ficl.c432
-rw-r--r--sys/boot/ficl/ficl.h773
-rw-r--r--sys/boot/ficl/math64.c296
-rw-r--r--sys/boot/ficl/math64.h60
-rw-r--r--sys/boot/ficl/softwords/classes.fr140
-rw-r--r--sys/boot/ficl/softwords/jhlocal.fr77
-rw-r--r--sys/boot/ficl/softwords/marker.fr25
-rw-r--r--sys/boot/ficl/softwords/oo.fr464
-rw-r--r--sys/boot/ficl/softwords/softcore.awk96
-rw-r--r--sys/boot/ficl/softwords/softcore.fr125
-rw-r--r--sys/boot/ficl/stack.c305
-rw-r--r--sys/boot/ficl/sysdep.c126
-rw-r--r--sys/boot/ficl/sysdep.h251
-rw-r--r--sys/boot/ficl/testmain.c275
-rw-r--r--sys/boot/ficl/vm.c565
-rw-r--r--sys/boot/ficl/words.c4544
-rw-r--r--sys/boot/i386/boot0/Makefile10
-rw-r--r--sys/boot/i386/boot0/boot0.m417
-rw-r--r--sys/boot/i386/boot0/boot0.s224
-rw-r--r--sys/boot/i386/boot2/Makefile11
-rw-r--r--sys/boot/i386/boot2/boot1.m44
-rw-r--r--sys/boot/i386/boot2/boot1.s176
-rw-r--r--sys/boot/i386/boot2/boot2.c74
-rw-r--r--sys/boot/i386/boot2/sio.s8
-rw-r--r--sys/boot/i386/btx/btx/btx.s32
-rw-r--r--sys/boot/i386/btx/btxldr/Makefile5
-rw-r--r--sys/boot/i386/btx/btxldr/btxldr.s68
-rw-r--r--sys/boot/i386/btx/lib/btxv86.s7
-rw-r--r--sys/boot/i386/libi386/Makefile27
-rw-r--r--sys/boot/i386/libi386/biosdisk.c130
-rw-r--r--sys/boot/i386/libi386/biospci.c294
-rw-r--r--sys/boot/i386/libi386/biospnp.c289
-rw-r--r--sys/boot/i386/libi386/bootinfo.c6
-rw-r--r--sys/boot/i386/libi386/comconsole.c89
-rw-r--r--sys/boot/i386/libi386/vidconsole.c403
-rw-r--r--sys/boot/i386/loader/Makefile72
-rw-r--r--sys/boot/i386/loader/conf.c10
-rw-r--r--sys/boot/i386/loader/help.i38634
-rw-r--r--sys/boot/i386/loader/main.c46
-rwxr-xr-xsys/boot/i386/loader/newvers.sh1
-rw-r--r--sys/boot/i386/loader/setdef0.c (renamed from sys/i4b/include/i4b_mbuf.h)46
-rw-r--r--sys/boot/i386/loader/setdef1.c (renamed from sys/pci/bt848_i2c.h)21
-rw-r--r--sys/cam/cam_ccb.h5
-rw-r--r--sys/cam/cam_debug.h10
-rw-r--r--sys/cam/cam_periph.c109
-rw-r--r--sys/cam/cam_periph.h10
-rw-r--r--sys/cam/cam_queue.h8
-rw-r--r--sys/cam/cam_xpt.c365
-rw-r--r--sys/cam/scsi/scsi_all.c31
-rw-r--r--sys/cam/scsi/scsi_all.h9
-rw-r--r--sys/cam/scsi/scsi_cd.c190
-rw-r--r--sys/cam/scsi/scsi_ch.c113
-rw-r--r--sys/cam/scsi/scsi_ch.h2
-rw-r--r--sys/cam/scsi/scsi_da.c215
-rw-r--r--sys/cam/scsi/scsi_pass.c152
-rw-r--r--sys/cam/scsi/scsi_pt.c125
-rw-r--r--sys/cam/scsi/scsi_sa.c1320
-rw-r--r--sys/cam/scsi/scsi_sa.h68
-rw-r--r--sys/cam/scsi/scsi_targ_bh.c715
-rw-r--r--sys/cam/scsi/scsi_target.c387
-rw-r--r--sys/coda/00READ11
-rw-r--r--sys/coda/cnode.h20
-rw-r--r--sys/coda/coda.h194
-rw-r--r--sys/coda/coda_fbsd.c137
-rw-r--r--sys/coda/coda_namecache.c7
-rw-r--r--sys/coda/coda_psdev.c112
-rw-r--r--sys/coda/coda_subr.c33
-rw-r--r--sys/coda/coda_venus.c15
-rw-r--r--sys/coda/coda_vfsops.c51
-rw-r--r--sys/coda/coda_vnops.c58
-rw-r--r--sys/conf/files168
-rw-r--r--sys/conf/newvers.sh7
-rw-r--r--sys/conf/options39
-rw-r--r--sys/conf/param.c10
-rw-r--r--sys/contrib/softupdates/README320
-rw-r--r--sys/ddb/db_command.c4
-rw-r--r--sys/ddb/db_sym.c6
-rw-r--r--sys/dev/advansys/advansys.c19
-rw-r--r--sys/dev/advansys/advlib.c8
-rw-r--r--sys/dev/advansys/adwlib.c5
-rw-r--r--sys/dev/aha/aha.c470
-rw-r--r--sys/dev/aha/ahareg.h125
-rw-r--r--sys/dev/aic7xxx/Makefile4
-rw-r--r--sys/dev/aic7xxx/aic7xxx.c2253
-rw-r--r--sys/dev/aic7xxx/aic7xxx.h75
-rw-r--r--sys/dev/aic7xxx/aic7xxx.reg97
-rw-r--r--sys/dev/aic7xxx/aic7xxx.seq404
-rw-r--r--sys/dev/aic7xxx/aicasm_gram.y6
-rw-r--r--sys/dev/buslogic/bt.c144
-rw-r--r--sys/dev/buslogic/btreg.h11
-rw-r--r--sys/dev/dec/mcclock_if.m4
-rw-r--r--sys/dev/dpt/dpt_control.c5
-rw-r--r--sys/dev/dpt/dpt_scsi.c14
-rw-r--r--sys/dev/en/midway.c8
-rw-r--r--sys/dev/fb/fb.c421
-rw-r--r--sys/dev/fb/fbreg.h154
-rw-r--r--sys/dev/fb/splash.c208
-rw-r--r--sys/dev/fb/splashreg.h102
-rw-r--r--sys/dev/fb/vgareg.h67
-rw-r--r--sys/dev/hea/eni.c22
-rw-r--r--sys/dev/hea/eni_buffer.c10
-rw-r--r--sys/dev/hea/eni_globals.c10
-rw-r--r--sys/dev/hea/eni_if.c13
-rw-r--r--sys/dev/hea/eni_init.c10
-rw-r--r--sys/dev/hea/eni_intr.c10
-rw-r--r--sys/dev/hea/eni_receive.c10
-rw-r--r--sys/dev/hea/eni_transmit.c12
-rw-r--r--sys/dev/hea/eni_vcm.c10
-rw-r--r--sys/dev/hfa/fore_buffer.c8
-rw-r--r--sys/dev/hfa/fore_command.c11
-rw-r--r--sys/dev/hfa/fore_globals.c8
-rw-r--r--sys/dev/hfa/fore_if.c11
-rw-r--r--sys/dev/hfa/fore_init.c11
-rw-r--r--sys/dev/hfa/fore_intr.c8
-rw-r--r--sys/dev/hfa/fore_load.c28
-rw-r--r--sys/dev/hfa/fore_output.c8
-rw-r--r--sys/dev/hfa/fore_receive.c8
-rw-r--r--sys/dev/hfa/fore_stats.c8
-rw-r--r--sys/dev/hfa/fore_timer.c8
-rw-r--r--sys/dev/hfa/fore_transmit.c8
-rw-r--r--sys/dev/hfa/fore_vcm.c8
-rw-r--r--sys/dev/iicbus/if_ic.c5
-rw-r--r--sys/dev/iicbus/iic.c20
-rw-r--r--sys/dev/iicbus/iicbb.c323
-rw-r--r--sys/dev/iicbus/iicbb_if.m65
-rw-r--r--sys/dev/iicbus/iicbus.c147
-rw-r--r--sys/dev/iicbus/iicbus.h5
-rw-r--r--sys/dev/iicbus/iicbus_if.m22
-rw-r--r--sys/dev/iicbus/iiconf.c170
-rw-r--r--sys/dev/iicbus/iiconf.h40
-rw-r--r--sys/dev/iicbus/iicsmb.c128
-rw-r--r--sys/dev/isp/asm_pci.h22380
-rw-r--r--sys/dev/isp/asm_sbus.h1205
-rw-r--r--sys/dev/isp/isp.c813
-rw-r--r--sys/dev/isp/isp_freebsd.c179
-rw-r--r--sys/dev/isp/isp_freebsd.h17
-rw-r--r--sys/dev/isp/isp_freebsd_cam.h48
-rw-r--r--sys/dev/isp/ispmbox.h607
-rw-r--r--sys/dev/isp/ispreg.h5
-rw-r--r--sys/dev/isp/ispvar.h80
-rw-r--r--sys/dev/kbd/atkbd.c1313
-rw-r--r--sys/dev/kbd/atkbdreg.h61
-rw-r--r--sys/dev/kbd/kbd.c1198
-rw-r--r--sys/dev/kbd/kbdreg.h270
-rw-r--r--sys/dev/kbd/kbdtables.h1332
-rw-r--r--sys/dev/pci/ohci_pci.c200
-rw-r--r--sys/dev/pci/uhci_pci.c228
-rw-r--r--sys/dev/ppbus/if_plip.c24
-rw-r--r--sys/dev/ppbus/immio.c24
-rw-r--r--sys/dev/ppbus/lpbb.c319
-rw-r--r--sys/dev/ppbus/nlpt.c171
-rw-r--r--sys/dev/ppbus/nlpt.h6
-rw-r--r--sys/dev/ppbus/ppb_1284.c777
-rw-r--r--sys/dev/ppbus/ppb_1284.h65
-rw-r--r--sys/dev/ppbus/ppb_base.c49
-rw-r--r--sys/dev/ppbus/ppb_msq.c22
-rw-r--r--sys/dev/ppbus/ppb_msq.h4
-rw-r--r--sys/dev/ppbus/ppbconf.c216
-rw-r--r--sys/dev/ppbus/ppbconf.h37
-rw-r--r--sys/dev/ppbus/ppi.c324
-rw-r--r--sys/dev/ppbus/pps.c5
-rw-r--r--sys/dev/ppbus/vpo.c15
-rw-r--r--sys/dev/ppbus/vpoio.c23
-rw-r--r--sys/dev/smbus/smb.c50
-rw-r--r--sys/dev/smbus/smbconf.c60
-rw-r--r--sys/dev/smbus/smbconf.h10
-rw-r--r--sys/dev/smbus/smbus.c49
-rw-r--r--sys/dev/smbus/smbus_if.m19
-rw-r--r--sys/dev/syscons/scvidctl.c583
-rw-r--r--sys/dev/usb/hid.c471
-rw-r--r--sys/dev/usb/hid.h91
-rw-r--r--sys/dev/usb/ohci.c2228
-rw-r--r--sys/dev/usb/ohcireg.h208
-rw-r--r--sys/dev/usb/ohcivar.h115
-rw-r--r--sys/dev/usb/ucom.c139
-rw-r--r--sys/dev/usb/ugen.c985
-rw-r--r--sys/dev/usb/uhci.c2620
-rw-r--r--sys/dev/usb/uhcireg.h191
-rw-r--r--sys/dev/usb/uhcivar.h180
-rw-r--r--sys/dev/usb/uhid.c546
-rw-r--r--sys/dev/usb/uhub.c521
-rw-r--r--sys/dev/usb/ukbd.c680
-rw-r--r--sys/dev/usb/ulpt.c451
-rw-r--r--sys/dev/usb/umodem.c142
-rw-r--r--sys/dev/usb/ums.c720
-rw-r--r--sys/dev/usb/usb.c418
-rw-r--r--sys/dev/usb/usb.h493
-rw-r--r--sys/dev/usb/usb_if.m41
-rw-r--r--sys/dev/usb/usb_mem.h92
-rw-r--r--sys/dev/usb/usb_port.h217
-rw-r--r--sys/dev/usb/usb_quirks.c94
-rw-r--r--sys/dev/usb/usb_quirks.h53
-rw-r--r--sys/dev/usb/usb_subr.c1127
-rw-r--r--sys/dev/usb/usbcdc.h141
-rw-r--r--sys/dev/usb/usbdevs.h176
-rw-r--r--sys/dev/usb/usbdevs_data.h439
-rw-r--r--sys/dev/usb/usbdi.c1294
-rw-r--r--sys/dev/usb/usbdi.h343
-rw-r--r--sys/dev/usb/usbdi_util.c511
-rw-r--r--sys/dev/usb/usbdi_util.h92
-rw-r--r--sys/dev/usb/usbdivar.h227
-rw-r--r--sys/dev/usb/usbhid.h135
-rw-r--r--sys/dev/vinum/Makefile26
-rwxr-xr-xsys/dev/vinum/makestatetext78
-rw-r--r--sys/dev/vinum/vinumdaemon.c202
-rw-r--r--sys/dev/vinum/vinumrevive.c181
-rw-r--r--sys/dev/vinum/vinumstate.c843
-rw-r--r--sys/dev/vx/if_vx.c8
-rw-r--r--sys/dev/vx/if_vxreg.h2
-rw-r--r--sys/gnu/ext2fs/ext2_alloc.c7
-rw-r--r--sys/gnu/ext2fs/ext2_extern.h2
-rw-r--r--sys/gnu/ext2fs/ext2_inode.c27
-rw-r--r--sys/gnu/ext2fs/ext2_readwrite.c7
-rw-r--r--sys/gnu/ext2fs/ext2_subr.c9
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c9
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c32
-rw-r--r--sys/gnu/i386/fpemul/fpu_entry.c48
-rw-r--r--sys/gnu/i386/isa/dgb.c13
-rw-r--r--sys/gnu/i386/isa/dgm.c17
-rw-r--r--sys/gnu/i386/isa/sound/awe_wave.c112
-rw-r--r--sys/i386/apm/apm.c15
-rw-r--r--sys/i386/boot/Makefile4
-rw-r--r--sys/i386/boot/Makefile.inc4
-rw-r--r--sys/i386/boot/biosboot/Makefile21
-rw-r--r--sys/i386/boot/biosboot/README.serial6
-rw-r--r--sys/i386/boot/biosboot/probe_keyboard.c5
-rw-r--r--sys/i386/boot/cdboot/Makefile11
-rw-r--r--sys/i386/boot/dosboot/Makefile3
-rw-r--r--sys/i386/boot/dosboot/disklabe.h4
-rw-r--r--sys/i386/boot/kzipboot/Makefile6
-rw-r--r--sys/i386/boot/kzipboot/malloc.c6
-rw-r--r--sys/i386/boot/netboot/Makefile23
-rw-r--r--sys/i386/boot/rawboot/Makefile7
-rw-r--r--sys/i386/conf/GENERIC115
-rw-r--r--sys/i386/conf/GENERICupgrade176
-rw-r--r--sys/i386/conf/LINT507
-rw-r--r--sys/i386/conf/LKM10
-rw-r--r--sys/i386/conf/Makefile.i38662
-rw-r--r--sys/i386/conf/PCCARD114
-rw-r--r--sys/i386/conf/SMP-GENERIC201
-rw-r--r--sys/i386/conf/devices.i3864
-rw-r--r--sys/i386/conf/files.i38661
-rw-r--r--sys/i386/conf/majors.i38622
-rw-r--r--sys/i386/conf/options.i38678
-rw-r--r--sys/i386/eisa/adv_eisa.c8
-rw-r--r--sys/i386/eisa/ahc_eisa.c3
-rw-r--r--sys/i386/eisa/eisaconf.c8
-rw-r--r--sys/i386/eisa/if_fea.c6
-rw-r--r--sys/i386/eisa/if_vx_eisa.c4
-rw-r--r--sys/i386/i386/autoconf.c53
-rw-r--r--sys/i386/i386/busdma_machdep.c67
-rw-r--r--sys/i386/i386/cons.c29
-rw-r--r--sys/i386/i386/cons.h33
-rw-r--r--sys/i386/i386/db_interface.c7
-rw-r--r--sys/i386/i386/elf_machdep.c4
-rw-r--r--sys/i386/i386/gensetdefs.c313
-rw-r--r--sys/i386/i386/i386-gdbstub.c3
-rw-r--r--sys/i386/i386/identcpu.c62
-rw-r--r--sys/i386/i386/initcpu.c85
-rw-r--r--sys/i386/i386/locore.s15
-rw-r--r--sys/i386/i386/machdep.c46
-rw-r--r--sys/i386/i386/math_emulate.c56
-rw-r--r--sys/i386/i386/mem.c4
-rw-r--r--sys/i386/i386/mp_machdep.c34
-rw-r--r--sys/i386/i386/perfmon.c8
-rw-r--r--sys/i386/i386/pmap.c75
-rw-r--r--sys/i386/i386/setdef0.c (renamed from sys/i386/include/i4b_tel_ioctl.h)47
-rw-r--r--sys/i386/i386/setdef1.c (renamed from sys/i386/isa/atkbdc_isa.c)66
-rw-r--r--sys/i386/i386/support.s3
-rw-r--r--sys/i386/i386/swapgeneric.c5
-rw-r--r--sys/i386/i386/sys_machdep.c3
-rw-r--r--sys/i386/i386/trap.c139
-rw-r--r--sys/i386/i386/userconfig.c227
-rw-r--r--sys/i386/i386/vm86.c3
-rw-r--r--sys/i386/i386/vm_machdep.c28
-rw-r--r--sys/i386/ibcs2/ibcs2_errno.c6
-rw-r--r--sys/i386/ibcs2/ibcs2_socksys.c4
-rw-r--r--sys/i386/ibcs2/ibcs2_stat.c21
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c23
-rw-r--r--sys/i386/ibcs2/ibcs2_util.h2
-rw-r--r--sys/i386/ibcs2/ibcs2_xenix.c26
-rw-r--r--sys/i386/ibcs2/imgact_coff.c6
-rw-r--r--sys/i386/include/ansi.h18
-rw-r--r--sys/i386/include/apm_bios.h3
-rw-r--r--sys/i386/include/console.h77
-rw-r--r--sys/i386/include/cpufunc.h74
-rw-r--r--sys/i386/include/elf.h4
-rw-r--r--sys/i386/include/i4b_cause.h144
-rw-r--r--sys/i386/include/i4b_debug.h219
-rw-r--r--sys/i386/include/i4b_ioctl.h606
-rw-r--r--sys/i386/include/i4b_trace.h91
-rw-r--r--sys/i386/include/iic.h19
-rw-r--r--sys/i386/include/md_var.h15
-rw-r--r--sys/i386/include/mouse.h4
-rw-r--r--sys/i386/include/param.h6
-rw-r--r--sys/i386/include/pc/vesa.h6
-rw-r--r--sys/i386/include/pmap.h7
-rw-r--r--sys/i386/include/resource.h43
-rw-r--r--sys/i386/include/smb.h7
-rw-r--r--sys/i386/include/types.h23
-rw-r--r--sys/i386/isa/README.le4
-rw-r--r--sys/i386/isa/README.stl2
-rw-r--r--sys/i386/isa/adv_isa.c10
-rw-r--r--sys/i386/isa/aha_isa.c133
-rw-r--r--sys/i386/isa/aic6360.c18
-rw-r--r--sys/i386/isa/alog.c663
-rw-r--r--sys/i386/isa/asc.c7
-rw-r--r--sys/i386/isa/atapi-cd.c18
-rw-r--r--sys/i386/isa/atapi.c20
-rw-r--r--sys/i386/isa/atapi.h4
-rw-r--r--sys/i386/isa/atkbd_isa.c100
-rw-r--r--sys/i386/isa/b004.c669
-rw-r--r--sys/i386/isa/b004.h154
-rw-r--r--sys/i386/isa/bs/bs.c341
-rw-r--r--sys/i386/isa/bs/bs_isa.c3
-rw-r--r--sys/i386/isa/bs/bsfunc.c70
-rw-r--r--sys/i386/isa/bs/bsfunc.h34
-rw-r--r--sys/i386/isa/bs/bshw.c2
-rw-r--r--sys/i386/isa/bs/bshw.h2
-rw-r--r--sys/i386/isa/bs/bshw_dma.c2
-rw-r--r--sys/i386/isa/bs/bsif.c79
-rw-r--r--sys/i386/isa/bs/bsif.h23
-rw-r--r--sys/i386/isa/bs/bsvar.h97
-rw-r--r--sys/i386/isa/bt_isa.c29
-rw-r--r--sys/i386/isa/ccbque.h14
-rw-r--r--sys/i386/isa/clock.c64
-rw-r--r--sys/i386/isa/ctx.c4
-rw-r--r--sys/i386/isa/cx.c5
-rw-r--r--sys/i386/isa/cy.c587
-rw-r--r--sys/i386/isa/cyreg.h46
-rw-r--r--sys/i386/isa/diskslice_machdep.c4
-rw-r--r--sys/i386/isa/fd.c467
-rw-r--r--sys/i386/isa/fdc.h9
-rw-r--r--sys/i386/isa/ft.c2580
-rw-r--r--sys/i386/isa/ftreg.h90
-rw-r--r--sys/i386/isa/gsc.c166
-rw-r--r--sys/i386/isa/ic/cd1400.h7
-rw-r--r--sys/i386/isa/ic/esp.h5
-rw-r--r--sys/i386/isa/ic/ncr53400.h49
-rw-r--r--sys/i386/isa/ic/ncr5380.h90
-rw-r--r--sys/i386/isa/ic/ns16550.h16
-rw-r--r--sys/i386/isa/ic/rsa.h128
-rw-r--r--sys/i386/isa/if_ar.c13
-rw-r--r--sys/i386/isa/if_cs.c24
-rw-r--r--sys/i386/isa/if_cx.c11
-rw-r--r--sys/i386/isa/if_ed.c21
-rw-r--r--sys/i386/isa/if_eg.c789
-rw-r--r--sys/i386/isa/if_egreg.h103
-rw-r--r--sys/i386/isa/if_el.c144
-rw-r--r--sys/i386/isa/if_ep.c18
-rw-r--r--sys/i386/isa/if_ex.c7
-rw-r--r--sys/i386/isa/if_fe.c3640
-rw-r--r--sys/i386/isa/if_fereg.h16
-rw-r--r--sys/i386/isa/if_ie.c9
-rw-r--r--sys/i386/isa/if_le.c8
-rw-r--r--sys/i386/isa/if_lnc.c25
-rw-r--r--sys/i386/isa/if_lnc.h39
-rw-r--r--sys/i386/isa/if_rdp.c1456
-rw-r--r--sys/i386/isa/if_rdpreg.h187
-rw-r--r--sys/i386/isa/if_sr.c39
-rw-r--r--sys/i386/isa/if_wl.c59
-rw-r--r--sys/i386/isa/if_wl.h2
-rw-r--r--sys/i386/isa/if_ze.c9
-rw-r--r--sys/i386/isa/if_zp.c7
-rw-r--r--sys/i386/isa/intr_machdep.c7
-rw-r--r--sys/i386/isa/ipl_funcs.c7
-rw-r--r--sys/i386/isa/isa.c11
-rw-r--r--sys/i386/isa/isa.h7
-rw-r--r--sys/i386/isa/isa_device.h81
-rw-r--r--sys/i386/isa/istallion.c5
-rw-r--r--sys/i386/isa/kbdio.c (renamed from sys/dev/kbd/atkbdc.c)264
-rw-r--r--sys/i386/isa/kbdio.h (renamed from sys/dev/kbd/atkbdcreg.h)151
-rw-r--r--sys/i386/isa/kbdtables.h6
-rw-r--r--sys/i386/isa/labpc.c12
-rw-r--r--sys/i386/isa/loran.c361
-rw-r--r--sys/i386/isa/lpt.c73
-rw-r--r--sys/i386/isa/matcd/audio.c2
-rw-r--r--sys/i386/isa/matcd/matcd.c6
-rw-r--r--sys/i386/isa/mcd.c6
-rw-r--r--sys/i386/isa/mse.c6
-rw-r--r--sys/i386/isa/ncr5380.c1536
-rw-r--r--sys/i386/isa/npx.c30
-rw-r--r--sys/i386/isa/pcaudio.c48
-rw-r--r--sys/i386/isa/pcf.c145
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c186
-rw-r--r--sys/i386/isa/pcvt/pcvt_hdr.h33
-rw-r--r--sys/i386/isa/pcvt/pcvt_kbd.c286
-rw-r--r--sys/i386/isa/pcvt/pcvt_sup.c2
-rw-r--r--sys/i386/isa/pnp.c12
-rw-r--r--sys/i386/isa/ppc.c801
-rw-r--r--sys/i386/isa/ppcreg.h91
-rw-r--r--sys/i386/isa/prof_machdep.c9
-rw-r--r--sys/i386/isa/psm.c160
-rw-r--r--sys/i386/isa/rc.c6
-rw-r--r--sys/i386/isa/rp.c52
-rw-r--r--sys/i386/isa/scd.c19
-rw-r--r--sys/i386/isa/scvesactl.c (renamed from sys/dev/syscons/scvesactl.c)32
-rw-r--r--sys/i386/isa/scvidctl.c (renamed from sys/pc98/pc98/scvidctl.c)162
-rw-r--r--sys/i386/isa/seagate.c1506
-rw-r--r--sys/i386/isa/si.c6
-rw-r--r--sys/i386/isa/sio.c250
-rw-r--r--sys/i386/isa/sioreg.h15
-rw-r--r--sys/i386/isa/snd/CARDS144
-rw-r--r--sys/i386/isa/snd/README25
-rw-r--r--sys/i386/isa/snd/ad1848.c574
-rw-r--r--sys/i386/isa/snd/dmabuf.c63
-rw-r--r--sys/i386/isa/snd/mss.h55
-rw-r--r--sys/i386/isa/snd/sb_dsp.c145
-rw-r--r--sys/i386/isa/snd/sbcard.h30
-rw-r--r--sys/i386/isa/snd/sound.c242
-rw-r--r--sys/i386/isa/snd/sound.h16
-rw-r--r--sys/i386/isa/snd/ulaw.h74
-rw-r--r--sys/i386/isa/sound/README.FREEBSD6
-rw-r--r--sys/i386/isa/sound/ad1848.c11
-rw-r--r--sys/i386/isa/sound/audio.c27
-rw-r--r--sys/i386/isa/sound/dmabuf.c3
-rw-r--r--sys/i386/isa/sound/gus_wave.c6
-rw-r--r--sys/i386/isa/sound/mmap_test.c2
-rw-r--r--sys/i386/isa/sound/mpu401.c6
-rw-r--r--sys/i386/isa/sound/pas2_card.c2
-rw-r--r--sys/i386/isa/sound/patmgr.c4
-rw-r--r--sys/i386/isa/sound/pcm86.c5
-rw-r--r--sys/i386/isa/sound/pss.c2
-rw-r--r--sys/i386/isa/sound/sb16_dsp.c6
-rw-r--r--sys/i386/isa/sound/sb_dsp.c5
-rw-r--r--sys/i386/isa/sound/sequencer.c2
-rw-r--r--sys/i386/isa/sound/sound.doc14
-rw-r--r--sys/i386/isa/sound/sound_calls.h7
-rw-r--r--sys/i386/isa/sound/sound_timer.c2
-rw-r--r--sys/i386/isa/sound/soundcard.c56
-rw-r--r--sys/i386/isa/sound/sscape.c11
-rw-r--r--sys/i386/isa/spigot.c7
-rw-r--r--sys/i386/isa/stallion.c11
-rw-r--r--sys/i386/isa/syscons.c (renamed from sys/dev/syscons/syscons.c)1915
-rw-r--r--sys/i386/isa/syscons.h (renamed from sys/dev/syscons/syscons.h)46
-rw-r--r--sys/i386/isa/tw.c6
-rw-r--r--sys/i386/isa/ultra14f.c1362
-rw-r--r--sys/i386/isa/vesa.c459
-rw-r--r--sys/i386/isa/videoio.c (renamed from sys/i386/isa/vga_isa.c)1366
-rw-r--r--sys/i386/isa/videoio.h104
-rw-r--r--sys/i386/isa/wcd.c1399
-rw-r--r--sys/i386/isa/wd.c54
-rw-r--r--sys/i386/isa/wd7000.c725
-rw-r--r--sys/i386/isa/wdreg.h6
-rw-r--r--sys/i386/isa/wfd.c5
-rw-r--r--sys/i386/isa/wst.c16
-rw-r--r--sys/i386/isa/wt.c30
-rw-r--r--sys/i386/linux/imgact_linux.c6
-rw-r--r--sys/i386/linux/linux.h20
-rw-r--r--sys/i386/linux/linux_dummy.c9
-rw-r--r--sys/i386/linux/linux_file.c6
-rw-r--r--sys/i386/linux/linux_ioctl.c62
-rw-r--r--sys/i386/linux/linux_misc.c271
-rw-r--r--sys/i386/linux/linux_proto.h15
-rw-r--r--sys/i386/linux/linux_signal.c4
-rw-r--r--sys/i386/linux/linux_socket.c40
-rw-r--r--sys/i386/linux/linux_syscall.h7
-rw-r--r--sys/i386/linux/linux_sysent.c10
-rw-r--r--sys/i386/linux/linux_sysvec.c27
-rw-r--r--sys/i386/linux/linux_util.h4
-rw-r--r--sys/i386/linux/syscalls.master13
-rw-r--r--sys/i4b/driver/i4b_ctl.c303
-rw-r--r--sys/i4b/driver/i4b_ipr.c1115
-rw-r--r--sys/i4b/driver/i4b_isppp.c710
-rw-r--r--sys/i4b/driver/i4b_rbch.c820
-rw-r--r--sys/i4b/driver/i4b_tel.c713
-rw-r--r--sys/i4b/driver/i4b_trace.c508
-rw-r--r--sys/i4b/include/i4b_global.h95
-rw-r--r--sys/i4b/include/i4b_isdnq931.h166
-rw-r--r--sys/i4b/include/i4b_l1l2.h99
-rw-r--r--sys/i4b/include/i4b_l2l3.h116
-rw-r--r--sys/i4b/include/i4b_l3l4.h260
-rw-r--r--sys/i4b/layer1/i4b_avm_a1.c508
-rw-r--r--sys/i4b/layer1/i4b_avm_fritz_pcmcia.c504
-rw-r--r--sys/i4b/layer1/i4b_bchan.c484
-rw-r--r--sys/i4b/layer1/i4b_ctx_s0P.c366
-rw-r--r--sys/i4b/layer1/i4b_drn_ngo.c542
-rw-r--r--sys/i4b/layer1/i4b_dynalink.c438
-rw-r--r--sys/i4b/layer1/i4b_elsa_isdnmc.c305
-rw-r--r--sys/i4b/layer1/i4b_elsa_mcall.c251
-rw-r--r--sys/i4b/layer1/i4b_elsa_qs1i.c512
-rw-r--r--sys/i4b/layer1/i4b_elsa_qs1p.c458
-rw-r--r--sys/i4b/layer1/i4b_hscx.c672
-rw-r--r--sys/i4b/layer1/i4b_hscx.h301
-rw-r--r--sys/i4b/layer1/i4b_ipac.h199
-rw-r--r--sys/i4b/layer1/i4b_isac.c679
-rw-r--r--sys/i4b/layer1/i4b_isac.h391
-rw-r--r--sys/i4b/layer1/i4b_isic.c345
-rw-r--r--sys/i4b/layer1/i4b_isic_isa.c591
-rw-r--r--sys/i4b/layer1/i4b_isic_pci.c424
-rw-r--r--sys/i4b/layer1/i4b_isic_pcmcia.c158
-rw-r--r--sys/i4b/layer1/i4b_isic_pnp.c296
-rw-r--r--sys/i4b/layer1/i4b_itk_ix1.c431
-rw-r--r--sys/i4b/layer1/i4b_l1.c315
-rw-r--r--sys/i4b/layer1/i4b_l1.h438
-rw-r--r--sys/i4b/layer1/i4b_l1fsm.c546
-rw-r--r--sys/i4b/layer1/i4b_sws.c392
-rw-r--r--sys/i4b/layer1/i4b_tel_s016.c455
-rw-r--r--sys/i4b/layer1/i4b_tel_s0163.c432
-rw-r--r--sys/i4b/layer1/i4b_tel_s08.c389
-rw-r--r--sys/i4b/layer1/i4b_tel_s0P.c378
-rw-r--r--sys/i4b/layer1/i4b_usr_sti.c440
-rw-r--r--sys/i4b/layer1/isa_isic.c828
-rw-r--r--sys/i4b/layer1/isapnp_isic.c386
-rw-r--r--sys/i4b/layer1/isic_supio.c374
-rw-r--r--sys/i4b/layer1/pci_isic.c327
-rw-r--r--sys/i4b/layer1/pcmcia_isic.c358
-rw-r--r--sys/i4b/layer1/pcmcia_isic.h60
-rw-r--r--sys/i4b/layer2/i4b_iframe.c275
-rw-r--r--sys/i4b/layer2/i4b_l2.c390
-rw-r--r--sys/i4b/layer2/i4b_l2.h339
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.c1593
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.h82
-rw-r--r--sys/i4b/layer2/i4b_l2timer.c263
-rw-r--r--sys/i4b/layer2/i4b_lme.c160
-rw-r--r--sys/i4b/layer2/i4b_mbuf.c245
-rw-r--r--sys/i4b/layer2/i4b_sframe.c215
-rw-r--r--sys/i4b/layer2/i4b_tei.c322
-rw-r--r--sys/i4b/layer2/i4b_uframe.c308
-rw-r--r--sys/i4b/layer2/i4b_util.c312
-rw-r--r--sys/i4b/layer3/i4b_l2if.c642
-rw-r--r--sys/i4b/layer3/i4b_l3.h80
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.c1034
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.h105
-rw-r--r--sys/i4b/layer3/i4b_l3timer.c347
-rw-r--r--sys/i4b/layer3/i4b_l4if.c339
-rw-r--r--sys/i4b/layer3/i4b_q931.c624
-rw-r--r--sys/i4b/layer3/i4b_q931.h116
-rw-r--r--sys/i4b/layer3/i4b_q932fac.c569
-rw-r--r--sys/i4b/layer3/i4b_q932fac.h167
-rw-r--r--sys/i4b/layer4/i4b_i4bdrv.c832
-rw-r--r--sys/i4b/layer4/i4b_l4.c897
-rw-r--r--sys/i4b/layer4/i4b_l4.h69
-rw-r--r--sys/i4b/layer4/i4b_l4mgmt.c467
-rw-r--r--sys/i4b/layer4/i4b_l4timer.c110
-rw-r--r--sys/i4b/tina-dd/README20
-rw-r--r--sys/i4b/tina-dd/i4b_tina_dd.c328
-rw-r--r--sys/i4b/tina-dd/i4b_tina_ioctl.h138
-rw-r--r--sys/isa/isareg.h7
-rw-r--r--sys/isa/isavar.h30
-rw-r--r--sys/isa/kbdio.c4
-rw-r--r--sys/isa/kbdio.h11
-rw-r--r--sys/isa/psm.c2222
-rw-r--r--sys/isa/sio.c31
-rw-r--r--sys/isa/syscons.c23
-rw-r--r--sys/isofs/cd9660/cd9660_node.c4
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c14
-rw-r--r--sys/kern/bus_if.m86
-rw-r--r--sys/kern/device_if.m18
-rw-r--r--sys/kern/imgact_aout.c8
-rw-r--r--sys/kern/imgact_elf.c283
-rw-r--r--sys/kern/inflate.c11
-rw-r--r--sys/kern/init_main.c13
-rw-r--r--sys/kern/init_sysent.c4
-rw-r--r--sys/kern/kern_clock.c189
-rw-r--r--sys/kern/kern_conf.c7
-rw-r--r--sys/kern/kern_descrip.c147
-rw-r--r--sys/kern/kern_environment.c21
-rw-r--r--sys/kern/kern_exec.c42
-rw-r--r--sys/kern/kern_exit.c56
-rw-r--r--sys/kern/kern_fork.c50
-rw-r--r--sys/kern/kern_intr.c6
-rw-r--r--sys/kern/kern_ktrace.c5
-rw-r--r--sys/kern/kern_linker.c244
-rw-r--r--sys/kern/kern_lkm.c209
-rw-r--r--sys/kern/kern_lock.c38
-rw-r--r--sys/kern/kern_lockf.c3
-rw-r--r--sys/kern/kern_malloc.c88
-rw-r--r--sys/kern/kern_module.c30
-rw-r--r--sys/kern/kern_physio.c3
-rw-r--r--sys/kern/kern_proc.c39
-rw-r--r--sys/kern/kern_prot.c17
-rw-r--r--sys/kern/kern_shutdown.c60
-rw-r--r--sys/kern/kern_sig.c131
-rw-r--r--sys/kern/kern_subr.c24
-rw-r--r--sys/kern/kern_synch.c211
-rw-r--r--sys/kern/kern_syscalls.c109
-rw-r--r--sys/kern/kern_sysctl.c43
-rw-r--r--sys/kern/kern_threads.c6
-rw-r--r--sys/kern/kern_time.c3
-rw-r--r--sys/kern/link_aout.c18
-rw-r--r--sys/kern/link_elf.c94
-rw-r--r--sys/kern/makedevops.pl394
-rw-r--r--sys/kern/subr_autoconf.c10
-rw-r--r--sys/kern/subr_bus.c715
-rw-r--r--sys/kern/subr_devstat.c17
-rw-r--r--sys/kern/subr_diskslice.c13
-rw-r--r--sys/kern/subr_log.c32
-rw-r--r--sys/kern/subr_prf.c57
-rw-r--r--sys/kern/subr_rlist.c16
-rw-r--r--sys/kern/subr_rman.c591
-rw-r--r--sys/kern/subr_scanf.c793
-rw-r--r--sys/kern/subr_xxx.c4
-rw-r--r--sys/kern/sys_generic.c37
-rw-r--r--sys/kern/sys_pipe.c32
-rw-r--r--sys/kern/sys_process.c7
-rw-r--r--sys/kern/sys_socket.c15
-rw-r--r--sys/kern/syscalls.c4
-rw-r--r--sys/kern/syscalls.master5
-rw-r--r--sys/kern/sysv_sem.c4
-rw-r--r--sys/kern/tty.c66
-rw-r--r--sys/kern/tty_snoop.c10
-rw-r--r--sys/kern/uipc_domain.c95
-rw-r--r--sys/kern/uipc_socket.c32
-rw-r--r--sys/kern/uipc_socket2.c33
-rw-r--r--sys/kern/uipc_syscalls.c430
-rw-r--r--sys/kern/uipc_usrreq.c4
-rw-r--r--sys/kern/vfs_aio.c11
-rw-r--r--sys/kern/vfs_bio.c356
-rw-r--r--sys/kern/vfs_cluster.c69
-rw-r--r--sys/kern/vfs_default.c19
-rw-r--r--sys/kern/vfs_init.c413
-rw-r--r--sys/kern/vfs_lookup.c39
-rw-r--r--sys/kern/vfs_subr.c268
-rw-r--r--sys/kern/vfs_syscalls.c168
-rw-r--r--sys/kern/vfs_vnops.c34
-rw-r--r--sys/kern/vnode_if.sh40
-rw-r--r--sys/libkern/moddi3.c4
-rw-r--r--sys/miscfs/deadfs/dead_vnops.c4
-rw-r--r--sys/miscfs/devfs/devfs_tree.c6
-rw-r--r--sys/miscfs/devfs/devfs_vfsops.c7
-rw-r--r--sys/miscfs/devfs/devfs_vnops.c35
-rw-r--r--sys/miscfs/devfs/devfsdefs.h3
-rw-r--r--sys/miscfs/fdesc/fdesc_vfsops.c10
-rw-r--r--sys/miscfs/fdesc/fdesc_vnops.c6
-rw-r--r--sys/miscfs/kernfs/kernfs_vfsops.c3
-rw-r--r--sys/miscfs/kernfs/kernfs_vnops.c13
-rw-r--r--sys/miscfs/nullfs/null_vnops.c6
-rw-r--r--sys/miscfs/portal/portal_vnops.c14
-rw-r--r--sys/miscfs/procfs/procfs.h6
-rw-r--r--sys/miscfs/procfs/procfs_map.c5
-rw-r--r--sys/miscfs/procfs/procfs_mem.c4
-rw-r--r--sys/miscfs/procfs/procfs_status.c39
-rw-r--r--sys/miscfs/procfs/procfs_subr.c7
-rw-r--r--sys/miscfs/procfs/procfs_vnops.c8
-rw-r--r--sys/miscfs/specfs/spec_vnops.c16
-rw-r--r--sys/miscfs/umapfs/umap_subr.c23
-rw-r--r--sys/miscfs/umapfs/umap_vnops.c4
-rw-r--r--sys/miscfs/union/union.h5
-rw-r--r--sys/miscfs/union/union_subr.c86
-rw-r--r--sys/miscfs/union/union_vnops.c4
-rw-r--r--sys/modules/Makefile19
-rw-r--r--sys/modules/coda/Makefile12
-rw-r--r--sys/modules/coff/Makefile8
-rw-r--r--sys/modules/ibcs2/Makefile6
-rwxr-xr-x[-rw-r--r--]sys/modules/ibcs2/ibcs2 (renamed from sys/modules/ibcs2/ibcs2.sh)15
-rw-r--r--sys/modules/ibcs2/ibcs2.c (renamed from sys/i386/isa/syscons_isa.c)70
-rw-r--r--sys/modules/if_ppp/Makefile5
-rw-r--r--sys/modules/if_tun/Makefile5
-rw-r--r--sys/modules/joy/Makefile4
-rw-r--r--sys/modules/joy/joy4
-rw-r--r--sys/modules/joy/joy.sh4
-rw-r--r--sys/modules/linux/Makefile6
-rw-r--r--sys/modules/linux/linux10
-rw-r--r--sys/modules/linux/linux.sh12
-rw-r--r--sys/modules/lkm/Makefile12
-rw-r--r--sys/modules/mfs/Makefile6
-rw-r--r--sys/modules/pcic/Makefile3
-rw-r--r--sys/modules/splash/Makefile5
-rw-r--r--sys/modules/splash/Makefile.inc3
-rw-r--r--sys/modules/splash/bmp/Makefile8
-rw-r--r--sys/modules/splash/bmp/splash_bmp.c494
-rw-r--r--sys/modules/syscons/Makefile4
-rw-r--r--sys/modules/syscons/blank/blank_saver.c53
-rw-r--r--sys/modules/syscons/daemon/daemon_saver.c67
-rw-r--r--sys/modules/syscons/fade/fade_saver.c61
-rw-r--r--sys/modules/syscons/green/green_saver.c48
-rw-r--r--sys/modules/syscons/logo/Makefile9
-rw-r--r--sys/modules/syscons/logo/logo.c352
-rw-r--r--sys/modules/syscons/logo/logo_saver.c148
-rw-r--r--sys/modules/syscons/rain/Makefile10
-rw-r--r--sys/modules/syscons/rain/rain_saver.c123
-rw-r--r--sys/modules/syscons/saver.h26
-rw-r--r--sys/modules/syscons/snake/snake_saver.c80
-rw-r--r--sys/modules/syscons/star/star_saver.c57
-rw-r--r--sys/modules/syscons/warp/Makefile10
-rw-r--r--sys/modules/syscons/warp/warp_saver.c132
-rw-r--r--sys/modules/vesa/Makefile23
-rw-r--r--sys/modules/vinum/COPYRIGHT (renamed from sys/dev/vinum/COPYRIGHT)2
-rw-r--r--sys/modules/vinum/Makefile25
-rw-r--r--sys/modules/vinum/config.c (renamed from sys/dev/vinum/vinumconfig.c)252
-rw-r--r--sys/modules/vinum/interrupt.c (renamed from sys/dev/vinum/vinuminterrupt.c)54
-rw-r--r--sys/modules/vinum/io.c (renamed from sys/dev/vinum/vinumio.c)780
-rw-r--r--sys/modules/vinum/lock.c (renamed from sys/dev/vinum/vinumlock.c)40
-rwxr-xr-xsys/modules/vinum/makestatetext40
-rw-r--r--sys/modules/vinum/memory.c (renamed from sys/dev/vinum/vinummemory.c)56
-rw-r--r--sys/modules/vinum/parser.c (renamed from sys/dev/vinum/vinumparser.c)24
-rw-r--r--sys/modules/vinum/request.c (renamed from sys/dev/vinum/vinumrequest.c)159
-rw-r--r--sys/modules/vinum/request.h (renamed from sys/dev/vinum/request.h)85
-rw-r--r--sys/modules/vinum/revive.c128
-rw-r--r--sys/modules/vinum/state.c755
-rw-r--r--sys/modules/vinum/statetexts.h (renamed from sys/dev/vinum/statetexts.h)9
-rw-r--r--sys/modules/vinum/util.c (renamed from sys/dev/vinum/vinumutil.c)75
-rw-r--r--sys/modules/vinum/vinum.c (renamed from sys/dev/vinum/vinum.c)132
-rw-r--r--sys/modules/vinum/vinumext.h (renamed from sys/dev/vinum/vinumext.h)76
-rw-r--r--sys/modules/vinum/vinumhdr.h (renamed from sys/dev/vinum/vinumhdr.h)32
-rw-r--r--sys/modules/vinum/vinumio.h (renamed from sys/dev/vinum/vinumio.h)21
-rw-r--r--sys/modules/vinum/vinumioctl.c (renamed from sys/dev/vinum/vinumioctl.c)130
-rw-r--r--sys/modules/vinum/vinumkw.h (renamed from sys/dev/vinum/vinumkw.h)15
-rw-r--r--sys/modules/vinum/vinumstate.h (renamed from sys/dev/vinum/vinumstate.h)49
-rw-r--r--sys/modules/vinum/vinumvar.h (renamed from sys/dev/vinum/vinumvar.h)132
-rw-r--r--sys/modules/wcd/Makefile29
-rw-r--r--sys/msdosfs/denode.h52
-rw-r--r--sys/msdosfs/direntry.h6
-rw-r--r--sys/msdosfs/msdosfs_conv.c8
-rw-r--r--sys/msdosfs/msdosfs_denode.c22
-rw-r--r--sys/msdosfs/msdosfs_lookup.c16
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c15
-rw-r--r--sys/msdosfs/msdosfs_vnops.c20
-rw-r--r--sys/net/bpf.c33
-rw-r--r--sys/net/bpf_filter.c94
-rw-r--r--sys/net/bpfdesc.h4
-rw-r--r--sys/net/bridge.c23
-rw-r--r--sys/net/bridge.h2
-rw-r--r--sys/net/if.c56
-rw-r--r--sys/net/if_atmsubr.c6
-rw-r--r--sys/net/if_disc.c30
-rw-r--r--sys/net/if_ethersubr.c23
-rw-r--r--sys/net/if_mib.c5
-rw-r--r--sys/net/if_sppp.h21
-rw-r--r--sys/net/if_spppsubr.c333
-rw-r--r--sys/net/if_tun.c36
-rw-r--r--sys/net/if_tunvar.h4
-rw-r--r--sys/net/if_var.h7
-rw-r--r--sys/net/if_vlan.c6
-rw-r--r--sys/net/ppp_tty.c11
-rw-r--r--sys/netatalk/aarp.c1
-rw-r--r--sys/netatalk/at_rmx.c5
-rw-r--r--sys/netatalk/ddp_input.c1
-rw-r--r--sys/netatalk/ddp_usrreq.c10
-rw-r--r--sys/netatm/atm_aal5.c33
-rw-r--r--sys/netatm/atm_cm.c8
-rw-r--r--sys/netatm/atm_device.c10
-rw-r--r--sys/netatm/atm_if.c27
-rw-r--r--sys/netatm/atm_proto.c8
-rw-r--r--sys/netatm/atm_signal.c8
-rw-r--r--sys/netatm/atm_socket.c12
-rw-r--r--sys/netatm/atm_subr.c8
-rw-r--r--sys/netatm/atm_usrreq.c26
-rw-r--r--sys/netatm/ipatm/ipatm_event.c10
-rw-r--r--sys/netatm/ipatm/ipatm_if.c10
-rw-r--r--sys/netatm/ipatm/ipatm_input.c15
-rw-r--r--sys/netatm/ipatm/ipatm_load.c10
-rw-r--r--sys/netatm/ipatm/ipatm_output.c10
-rw-r--r--sys/netatm/ipatm/ipatm_usrreq.c13
-rw-r--r--sys/netatm/ipatm/ipatm_vcm.c10
-rw-r--r--sys/netatm/sigpvc/sigpvc_if.c16
-rw-r--r--sys/netatm/sigpvc/sigpvc_subr.c10
-rw-r--r--sys/netatm/spans/spans_arp.c20
-rw-r--r--sys/netatm/spans/spans_cls.c12
-rw-r--r--sys/netatm/spans/spans_if.c13
-rw-r--r--sys/netatm/spans/spans_kxdr.c8
-rw-r--r--sys/netatm/spans/spans_msg.c10
-rw-r--r--sys/netatm/spans/spans_print.c108
-rw-r--r--sys/netatm/spans/spans_proto.c10
-rw-r--r--sys/netatm/spans/spans_subr.c10
-rw-r--r--sys/netatm/spans/spans_util.c10
-rw-r--r--sys/netatm/uni/Makefile93
-rw-r--r--sys/netatm/uni/q2110_sigaa.c10
-rw-r--r--sys/netatm/uni/q2110_sigcpcs.c10
-rw-r--r--sys/netatm/uni/q2110_subr.c10
-rw-r--r--sys/netatm/uni/qsaal1_sigaa.c10
-rw-r--r--sys/netatm/uni/qsaal1_sigcpcs.c10
-rw-r--r--sys/netatm/uni/qsaal1_subr.c10
-rw-r--r--sys/netatm/uni/sscf_uni.c12
-rw-r--r--sys/netatm/uni/sscf_uni_lower.c10
-rw-r--r--sys/netatm/uni/sscf_uni_upper.c10
-rw-r--r--sys/netatm/uni/sscop.c11
-rw-r--r--sys/netatm/uni/sscop_lower.c10
-rw-r--r--sys/netatm/uni/sscop_pdu.c13
-rw-r--r--sys/netatm/uni/sscop_sigaa.c10
-rw-r--r--sys/netatm/uni/sscop_sigcpcs.c10
-rw-r--r--sys/netatm/uni/sscop_subr.c10
-rw-r--r--sys/netatm/uni/sscop_timer.c10
-rw-r--r--sys/netatm/uni/sscop_upper.c10
-rw-r--r--sys/netatm/uni/uni_load.c10
-rw-r--r--sys/netatm/uni/uniarp.c25
-rw-r--r--sys/netatm/uni/uniarp_cache.c14
-rw-r--r--sys/netatm/uni/uniarp_input.c14
-rw-r--r--sys/netatm/uni/uniarp_output.c10
-rw-r--r--sys/netatm/uni/uniarp_timer.c10
-rw-r--r--sys/netatm/uni/uniarp_vcm.c10
-rw-r--r--sys/netatm/uni/uniip.c10
-rw-r--r--sys/netatm/uni/unisig_decode.c10
-rw-r--r--sys/netatm/uni/unisig_encode.c10
-rw-r--r--sys/netatm/uni/unisig_if.c15
-rw-r--r--sys/netatm/uni/unisig_mbuf.c10
-rw-r--r--sys/netatm/uni/unisig_msg.c13
-rw-r--r--sys/netatm/uni/unisig_print.c10
-rw-r--r--sys/netatm/uni/unisig_proto.c10
-rw-r--r--sys/netatm/uni/unisig_sigmgr_state.c27
-rw-r--r--sys/netatm/uni/unisig_subr.c50
-rw-r--r--sys/netatm/uni/unisig_util.c18
-rw-r--r--sys/netatm/uni/unisig_var.h6
-rw-r--r--sys/netatm/uni/unisig_vc_state.c83
-rw-r--r--sys/netinet/fil.c8
-rw-r--r--sys/netinet/icmp_var.h16
-rw-r--r--sys/netinet/if_ether.c18
-rw-r--r--sys/netinet/igmp.c8
-rw-r--r--sys/netinet/in.c6
-rw-r--r--sys/netinet/in.h7
-rw-r--r--sys/netinet/in_pcb.c4
-rw-r--r--sys/netinet/ip_auth.c8
-rw-r--r--sys/netinet/ip_divert.c10
-rw-r--r--sys/netinet/ip_dummynet.c155
-rw-r--r--sys/netinet/ip_dummynet.h10
-rw-r--r--sys/netinet/ip_fil.c14
-rw-r--r--sys/netinet/ip_flow.c3
-rw-r--r--sys/netinet/ip_frag.c12
-rw-r--r--sys/netinet/ip_ftp_pxy.c2
-rw-r--r--sys/netinet/ip_fw.c230
-rw-r--r--sys/netinet/ip_fw.h11
-rw-r--r--sys/netinet/ip_icmp.c91
-rw-r--r--sys/netinet/ip_input.c128
-rw-r--r--sys/netinet/ip_log.c17
-rw-r--r--sys/netinet/ip_mroute.c193
-rw-r--r--sys/netinet/ip_mroute.h5
-rw-r--r--sys/netinet/ip_nat.c8
-rw-r--r--sys/netinet/ip_output.c109
-rw-r--r--sys/netinet/ip_state.c8
-rw-r--r--sys/netinet/mlf_ipl.c46
-rw-r--r--sys/netinet/raw_ip.c24
-rw-r--r--sys/netinet/tcp_input.c10
-rw-r--r--sys/netinet/tcp_output.c5
-rw-r--r--sys/netinet/tcp_subr.c6
-rw-r--r--sys/netinet/tcp_usrreq.c10
-rw-r--r--sys/netinet/tcp_var.h35
-rw-r--r--sys/netinet/udp_usrreq.c8
-rw-r--r--sys/netinet/udp_var.h4
-rw-r--r--sys/netipx/ipx.c10
-rw-r--r--sys/netipx/ipx_usrreq.c3
-rw-r--r--sys/netipx/spx_usrreq.c26
-rw-r--r--sys/netkey/key.c33
-rw-r--r--sys/netkey/key_debug.c1
-rw-r--r--sys/netnatm/natm.c12
-rw-r--r--sys/nfs/bootp_subr.c14
-rw-r--r--sys/nfs/nfs_bio.c30
-rw-r--r--sys/nfs/nfs_nqlease.c5
-rw-r--r--sys/nfs/nfs_serv.c7
-rw-r--r--sys/nfs/nfs_socket.c13
-rw-r--r--sys/nfs/nfs_subs.c16
-rw-r--r--sys/nfs/nfs_syscalls.c3
-rw-r--r--sys/nfs/nfs_vfsops.c8
-rw-r--r--sys/nfs/nfs_vnops.c202
-rw-r--r--sys/nfs/nfsm_subs.h73
-rw-r--r--sys/nfs/nfsnode.h5
-rw-r--r--sys/pc98/boot/Makefile.inc4
-rw-r--r--sys/pc98/boot/biosboot/Makefile28
-rw-r--r--sys/pc98/boot/biosboot/README.serial6
-rw-r--r--sys/pc98/boot/biosboot/serial.S10
-rw-r--r--sys/pc98/boot/kzipboot/Makefile6
-rw-r--r--sys/pc98/boot/kzipboot/malloc.c6
-rw-r--r--sys/pc98/boot/netboot/Makefile21
-rw-r--r--sys/pc98/boot/rawboot/Makefile7
-rw-r--r--sys/pc98/conf/GENERIC98135
-rw-r--r--sys/pc98/conf/GENERICupgrade204
-rw-r--r--sys/pc98/conf/Makefile.pc9862
-rw-r--r--sys/pc98/conf/SMP-GENERIC98230
-rw-r--r--sys/pc98/conf/devices.pc984
-rw-r--r--sys/pc98/conf/files.pc9876
-rw-r--r--sys/pc98/conf/majors.pc9822
-rw-r--r--sys/pc98/conf/options.pc9868
-rw-r--r--sys/pc98/i386/machdep.c44
-rw-r--r--sys/pc98/i386/trap.c1159
-rw-r--r--sys/pc98/i386/userconfig.c227
-rw-r--r--sys/pc98/pc98/atcompat_diskslice.c4
-rw-r--r--sys/pc98/pc98/clock.c64
-rw-r--r--sys/pc98/pc98/diskslice_machdep.c8
-rw-r--r--sys/pc98/pc98/fd.c467
-rw-r--r--sys/pc98/pc98/if_ed.c33
-rw-r--r--sys/pc98/pc98/if_ed98.h114
-rw-r--r--sys/pc98/pc98/if_fe.c3824
-rw-r--r--sys/pc98/pc98/lpt.c73
-rw-r--r--sys/pc98/pc98/mse.c6
-rw-r--r--sys/pc98/pc98/npx.c30
-rw-r--r--sys/pc98/pc98/pc98.c11
-rw-r--r--sys/pc98/pc98/pc98gdc.c887
-rw-r--r--sys/pc98/pc98/pc98kbd.c1009
-rw-r--r--sys/pc98/pc98/pcaudio.c48
-rw-r--r--sys/pc98/pc98/sio.c1638
-rw-r--r--sys/pc98/pc98/sioreg.h119
-rw-r--r--sys/pc98/pc98/syscons.c4151
-rw-r--r--sys/pc98/pc98/syscons.h136
-rw-r--r--sys/pc98/pc98/wd.c76
-rw-r--r--sys/pccard/driver.h3
-rw-r--r--sys/pccard/pccard.c45
-rw-r--r--sys/pccard/pcic.c93
-rw-r--r--sys/pccard/skel.c84
-rw-r--r--sys/pccard/slot.h18
-rw-r--r--sys/pci/adv_pci.c23
-rw-r--r--sys/pci/adw_pci.c8
-rw-r--r--sys/pci/ahc_pci.c8
-rw-r--r--sys/pci/brktree_reg.h11
-rw-r--r--sys/pci/brooktree848.c84
-rw-r--r--sys/pci/bt848_i2c.c412
-rw-r--r--sys/pci/bt_pci.c27
-rw-r--r--sys/pci/cy_pci.c37
-rw-r--r--sys/pci/cy_pcireg.h17
-rw-r--r--sys/pci/dpt_pci.c11
-rw-r--r--sys/pci/es1370.c1127
-rw-r--r--sys/pci/es1370_reg.h134
-rw-r--r--sys/pci/ide_pci.c339
-rw-r--r--sys/pci/if_ax.c2175
-rw-r--r--sys/pci/if_axreg.h559
-rw-r--r--sys/pci/if_de.c35
-rw-r--r--sys/pci/if_devar.h14
-rw-r--r--sys/pci/if_ed_p.c6
-rw-r--r--sys/pci/if_en_pci.c170
-rw-r--r--sys/pci/if_fpa.c4
-rw-r--r--sys/pci/if_fxp.c27
-rw-r--r--sys/pci/if_lnc_p.c6
-rw-r--r--sys/pci/if_mx.c2436
-rw-r--r--sys/pci/if_mxreg.h697
-rw-r--r--sys/pci/if_pn.c1986
-rw-r--r--sys/pci/if_pnreg.h652
-rw-r--r--sys/pci/if_rl.c1992
-rw-r--r--sys/pci/if_rlreg.h554
-rw-r--r--sys/pci/if_sr_p.c6
-rw-r--r--sys/pci/if_tl.c126
-rw-r--r--sys/pci/if_tlreg.h8
-rw-r--r--sys/pci/if_tx.c1373
-rw-r--r--sys/pci/if_vr.c1957
-rw-r--r--sys/pci/if_vrreg.h616
-rw-r--r--sys/pci/if_vx_pci.c8
-rw-r--r--sys/pci/if_wb.c2151
-rw-r--r--sys/pci/if_wbreg.h583
-rw-r--r--sys/pci/if_xl.c53
-rw-r--r--sys/pci/if_xlreg.h3
-rw-r--r--sys/pci/isp_pci.c93
-rw-r--r--sys/pci/meteor.c6
-rw-r--r--sys/pci/ncr.c19
-rw-r--r--sys/pci/pci.c55
-rw-r--r--sys/pci/pci_compat.c57
-rw-r--r--sys/pci/pcic_p.c6
-rw-r--r--sys/pci/pcisupport.c154
-rw-r--r--sys/pci/pcivar.h11
-rw-r--r--sys/pci/simos.c6
-rw-r--r--sys/pci/smc83c170.h (renamed from sys/pci/if_txvar.h)161
-rw-r--r--sys/pci/tek390.c1709
-rw-r--r--sys/pci/tek390.h667
-rw-r--r--sys/pci/wdc_p.c6
-rw-r--r--sys/pci/xrpu.c216
-rw-r--r--sys/sys/aio.h37
-rw-r--r--sys/sys/alogio.h62
-rw-r--r--sys/sys/buf.h30
-rw-r--r--sys/sys/bus.h220
-rw-r--r--sys/sys/bus_private.h6
-rw-r--r--sys/sys/cdefs.h13
-rw-r--r--sys/sys/conf.h38
-rw-r--r--sys/sys/copyright.h4
-rw-r--r--sys/sys/devfsext.h4
-rw-r--r--sys/sys/devicestat.h4
-rw-r--r--sys/sys/dirent.h12
-rw-r--r--sys/sys/disklabel.h4
-rw-r--r--sys/sys/domain.h3
-rw-r--r--sys/sys/errno.h11
-rw-r--r--sys/sys/exec.h8
-rw-r--r--sys/sys/filedesc.h32
-rw-r--r--sys/sys/imgact.h3
-rw-r--r--sys/sys/imgact_elf.h18
-rw-r--r--sys/sys/inttypes.h24
-rw-r--r--sys/sys/kernel.h75
-rw-r--r--sys/sys/linker.h16
-rw-r--r--sys/sys/linker_set.h89
-rw-r--r--sys/sys/lock.h19
-rw-r--r--sys/sys/malloc.h14
-rw-r--r--sys/sys/mbuf.h5
-rw-r--r--sys/sys/mman.h5
-rw-r--r--sys/sys/module.h31
-rw-r--r--sys/sys/mount.h64
-rw-r--r--sys/sys/mtio.h55
-rw-r--r--sys/sys/param.h4
-rw-r--r--sys/sys/pipe.h4
-rw-r--r--sys/sys/proc.h55
-rw-r--r--sys/sys/protosw.h3
-rw-r--r--sys/sys/queue.h16
-rw-r--r--sys/sys/rman.h97
-rw-r--r--sys/sys/sem.h13
-rw-r--r--sys/sys/signalvar.h12
-rw-r--r--sys/sys/socket.h13
-rw-r--r--sys/sys/socketvar.h12
-rw-r--r--sys/sys/syscall-hide.h4
-rw-r--r--sys/sys/syscall.h6
-rw-r--r--sys/sys/syscall.mk6
-rw-r--r--sys/sys/sysctl.h14
-rw-r--r--sys/sys/sysent.h34
-rw-r--r--sys/sys/sysproto.h18
-rw-r--r--sys/sys/systm.h21
-rw-r--r--sys/sys/time.h21
-rw-r--r--sys/sys/tty.h3
-rw-r--r--sys/sys/ttycom.h4
-rw-r--r--sys/sys/types.h26
-rw-r--r--sys/sys/unistd.h4
-rw-r--r--sys/sys/user.h12
-rw-r--r--sys/sys/vnode.h24
-rw-r--r--sys/sys/xrpuio.h37
-rw-r--r--sys/ufs/ffs/README320
-rw-r--r--sys/ufs/ffs/README.softupdates4
-rw-r--r--sys/ufs/ffs/ffs_alloc.c25
-rw-r--r--sys/ufs/ffs/ffs_extern.h4
-rw-r--r--sys/ufs/ffs/ffs_inode.c29
-rw-r--r--sys/ufs/ffs/ffs_subr.c10
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c35
-rw-r--r--sys/ufs/ffs/ffs_vnops.c12
-rw-r--r--sys/ufs/mfs/mfs_vfsops.c14
-rw-r--r--sys/ufs/mfs/mfsiom.h (renamed from sys/alpha/include/sysarch.h)33
-rw-r--r--sys/ufs/ufs/ufs_bmap.c7
-rw-r--r--sys/ufs/ufs/ufs_disksubr.c4
-rw-r--r--sys/ufs/ufs/ufs_ihash.c5
-rw-r--r--sys/ufs/ufs/ufs_inode.c13
-rw-r--r--sys/ufs/ufs/ufs_lookup.c6
-rw-r--r--sys/ufs/ufs/ufs_quota.c3
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c119
-rw-r--r--sys/ufs/ufs/ufs_vfsops.c3
-rw-r--r--sys/ufs/ufs/ufs_vnops.c59
-rw-r--r--sys/ufs/ufs/ufsmount.h6
-rw-r--r--sys/vm/device_pager.c36
-rw-r--r--sys/vm/swap_pager.c50
-rw-r--r--sys/vm/vm_extern.h6
-rw-r--r--sys/vm/vm_fault.c20
-rw-r--r--sys/vm/vm_glue.c20
-rw-r--r--sys/vm/vm_map.c217
-rw-r--r--sys/vm/vm_map.h9
-rw-r--r--sys/vm/vm_meter.c104
-rw-r--r--sys/vm/vm_mmap.c20
-rw-r--r--sys/vm/vm_object.c115
-rw-r--r--sys/vm/vm_page.c203
-rw-r--r--sys/vm/vm_page.h11
-rw-r--r--sys/vm/vm_pageout.c24
-rw-r--r--sys/vm/vm_pager.c7
-rw-r--r--sys/vm/vm_swap.c11
-rw-r--r--sys/vm/vm_zone.c21
-rw-r--r--sys/vm/vm_zone.h12
-rw-r--r--sys/vm/vnode_pager.c4
1135 files changed, 53852 insertions, 151228 deletions
diff --git a/sys/Makefile b/sys/Makefile
index bca5eded3e541..470207db82015 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.15 1998/12/30 11:17:09 bde Exp $
+# $Id: Makefile,v 1.12 1998/10/04 00:42:08 gpalmer Exp $
# This is the old aout only boot loader.
.if exists(${MACHINE}/boot) && ${OBJFORMAT} == "aout"
@@ -11,9 +11,6 @@ SUBDIR= boot
SUBDIR= boot
.endif
-# KLD modules build for both a.out and ELF
-SUBDIR+=modules
-
HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh`
.include <bsd.subdir.mk>
diff --git a/sys/alpha/alpha/alpha-gdbstub.c b/sys/alpha/alpha/alpha-gdbstub.c
index 0f8e963e4cb8f..d57230dabf3a8 100644
--- a/sys/alpha/alpha/alpha-gdbstub.c
+++ b/sys/alpha/alpha/alpha-gdbstub.c
@@ -538,11 +538,11 @@ clear_single_step(db_regs_t* regs)
* Entries not in integer register set are set to -1.
*/
static int tf2gdb[FRAME_SIZE] = {
-/*0*/ R_V0, R_T0, R_T1, R_T2, R_T3, R_T4, R_T5, R_T6,
-/*8*/ R_T7, R_S0, R_S1, R_S2, R_S3, R_S4, R_S5, R_S6,
-/*16*/ R_A3, R_A4, R_A5, R_T8, R_T9, R_T10, R_T11, R_RA,
-/*24*/ R_T12, R_AT, R_SP, -1, -1, -1, -1, -1,
-/*32*/ R_GP, R_A0, R_A1, R_A2,
+ R_V0, R_T0, R_T1, R_T2, R_T3, R_T4, R_T5, R_T6,
+ R_T7, R_S0, R_S1, R_S2, R_S3, R_S4, R_S5, R_S6,
+ R_A3, R_A4, R_A5, R_T8, R_T9, R_T10, R_T11, R_RA,
+ R_T12, R_AT, R_SP, -1, -1, R_GP, R_A0, R_A1,
+ R_A2,
};
/*
diff --git a/sys/alpha/alpha/autoconf.c b/sys/alpha/alpha/autoconf.c
index 46aeb3ffb709e..205404f54d7e5 100644
--- a/sys/alpha/alpha/autoconf.c
+++ b/sys/alpha/alpha/autoconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: autoconf.c,v 1.12 1998/10/30 01:36:40 jkh Exp $
+ * $Id: autoconf.c,v 1.10 1998/09/26 14:48:19 dfr Exp $
*/
#include "opt_bootp.h"
@@ -58,17 +58,24 @@
#include <cam/cam_xpt_sim.h>
#include <cam/cam_debug.h>
+#include "scbus.h"
+
static void configure __P((void *));
-SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL)
+SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure, NULL)
static void configure_finish __P((void));
static void configure_start __P((void));
device_t isa_bus_device = 0;
struct cam_sim *boot_sim = 0;
+extern void xpt_init __P((void));
+
static void
configure_start()
{
+#if NSCBUS > 0
+ xpt_init();
+#endif
}
static void
@@ -210,14 +217,9 @@ cpu_rootconf()
{
#ifdef MFS_ROOT
if (!mountrootfsname) {
- extern u_char *mfs_getimage __P((void));
-
if (bootverbose)
printf("Considering MFS root f/s.\n");
- if (mfs_getimage())
- mountrootfsname = "mfs";
- else if (bootverbose)
- printf("No MFS image available as root f/s.\n");
+ mountrootfsname = "mfs";
}
#endif
diff --git a/sys/alpha/alpha/clock.c b/sys/alpha/alpha/clock.c
index 649b8caeddd46..ef32268fa8cca 100644
--- a/sys/alpha/alpha/clock.c
+++ b/sys/alpha/alpha/clock.c
@@ -1,4 +1,4 @@
-/* $Id: clock.c,v 1.4 1998/10/06 08:40:18 dfr Exp $ */
+/* $Id: clock.c,v 1.3 1998/07/22 08:16:34 dfr Exp $ */
/* $NetBSD: clock.c,v 1.20 1998/01/31 10:32:47 ross Exp $ */
/*
@@ -77,7 +77,7 @@ extern int cycles_per_sec;
static timecounter_get_t alpha_get_timecount;
static timecounter_pps_t alpha_poll_pps;
-static struct timecounter alpha_timecounter = {
+static struct timecounter alpha_timecounter[3] = {
alpha_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -86,7 +86,7 @@ static struct timecounter alpha_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, alpha_timecounter, CTLFLAG_RD,
- &alpha_timecounter, sizeof(alpha_timecounter), "S,timecounter", "");
+ alpha_timecounter, sizeof(alpha_timecounter), "S,timecounter", "");
/* Values for timerX_state: */
#define RELEASED 0
@@ -178,8 +178,8 @@ cpu_initclocks()
scaled_ticks_per_cycle = ((u_int64_t)hz << FIX_SHIFT) / cycles_per_sec;
max_cycles_per_tick = 2*cycles_per_sec / hz;
- alpha_timecounter.tc_frequency = cycles_per_sec;
- init_timecounter(&alpha_timecounter);
+ alpha_timecounter[0].tc_frequency = cycles_per_sec;
+ init_timecounter(alpha_timecounter);
platform.clockintr = (void (*) __P((void *))) handleclock;
diff --git a/sys/alpha/alpha/clock_if.m b/sys/alpha/alpha/clock_if.m
index 75cb78fbf1e6b..cc0d265aea671 100644
--- a/sys/alpha/alpha/clock_if.m
+++ b/sys/alpha/alpha/clock_if.m
@@ -23,12 +23,12 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: clock_if.m,v 1.1 1998/06/14 13:52:33 dfr Exp $
+# $Id$
#
#include <machine/clockvar.h>
-INTERFACE clock;
+INTERFACE clock
METHOD void init {
device_t dev;
diff --git a/sys/alpha/alpha/cons.c b/sys/alpha/alpha/cons.c
index ad8465ac3903c..78d114987faa9 100644
--- a/sys/alpha/alpha/cons.c
+++ b/sys/alpha/alpha/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.2 1998/06/14 13:44:40 dfr Exp $
+ * $Id: cons.c,v 1.1 1998/06/10 10:52:15 dfr Exp $
*/
#include "opt_devfs.h"
@@ -90,7 +90,7 @@ static struct cdevsw cn_cdevsw =
cnpoll, nommap, NULL, "console", NULL, -1 };
static dev_t cn_dev_t; /* seems to be never really used */
-SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
+SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
&cn_dev_t, sizeof cn_dev_t, "T,dev_t", "");
static int cn_mute;
diff --git a/sys/alpha/alpha/db_disasm.c b/sys/alpha/alpha/db_disasm.c
index 9fc3b1e8b0d73..bec614526a4ad 100644
--- a/sys/alpha/alpha/db_disasm.c
+++ b/sys/alpha/alpha/db_disasm.c
@@ -201,7 +201,7 @@ pal_opname(op)
return (pal_op_tbl[i].name);
}
- snprintf(unk, sizeof(unk), "0x%x", op);
+ sprintf(unk, "0x%x", op);
return (unk);
}
@@ -257,7 +257,7 @@ arit_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?arit 0x%x?", op);
+ sprintf(unk, "?arit 0x%x?", op);
return (unk);
}
@@ -307,7 +307,7 @@ logical_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?logical 0x%x?", op);
+ sprintf(unk, "?logical 0x%x?", op);
return (unk);
}
@@ -352,7 +352,7 @@ bitop_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?bit 0x%x?", op);
+ sprintf(unk, "?bit 0x%x?", op);
return (unk);
}
@@ -376,7 +376,7 @@ mul_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?mul 0x%x?", op);
+ sprintf(unk, "?mul 0x%x?", op);
return (unk);
}
@@ -401,7 +401,7 @@ special_name(op)
if (name != NULL)
return (name);
- snprintf(unk, sizeof(unk), "?special 0x%x?", op);
+ sprintf(unk, "?special 0x%x?", op);
return (unk);
}
@@ -440,7 +440,7 @@ intmisc_name(op)
case op_ftois: return ("ftois");
}
- snprintf(unk, sizeof(unk), "?intmisc 0x%x?", op);
+ sprintf(unk, "?intmisc 0x%x?", op);
return (unk);
}
@@ -460,7 +460,7 @@ float_name(tbl, op, type)
return (tbl[i].name);
}
- snprintf(unk, sizeof(unk), "?%s 0x%x?", type, op);
+ sprintf(unk, "?%s 0x%x?", type, op);
return (unk);
}
diff --git a/sys/alpha/alpha/dec_2100_a50.c b/sys/alpha/alpha/dec_2100_a50.c
index 3d5a74908f447..f7bb8c7841ecd 100644
--- a/sys/alpha/alpha/dec_2100_a50.c
+++ b/sys/alpha/alpha/dec_2100_a50.c
@@ -58,6 +58,7 @@ static int comcnrate = CONSPEED;
void dec_2100_a50_init __P((void));
static void dec_2100_a50_cons_init __P((void));
+static void dec_2100_a50_device_register __P((struct device *, void *));
static void dec_2100_a50_intr_map __P((void *));
void sio_intr_establish __P((int));
void sio_intr_disestablish __P((int));
@@ -148,7 +149,7 @@ dec_2100_a50_cons_init()
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
- panic("consinit: unknown console type %ld\n",
+ panic("consinit: unknown console type %d\n",
ctb->ctb_term_type);
}
}
@@ -162,6 +163,7 @@ dec_2100_a50_intr_map(void *arg)
u_int32_t pirqreg;
int pirq=0; /* gcc -Wuninitialized XXX */
pcicfgregs *cfg = (pcicfgregs *)arg;
+ static int intr_setup_done=0;
/*
* Slot->interrupt translation. Taken from NetBSD
diff --git a/sys/alpha/alpha/dec_eb164.c b/sys/alpha/alpha/dec_eb164.c
index d2a78f491e499..c0553878288b9 100644
--- a/sys/alpha/alpha/dec_eb164.c
+++ b/sys/alpha/alpha/dec_eb164.c
@@ -1,4 +1,4 @@
-/* $Id: dec_eb164.c,v 1.5 1998/12/05 22:36:31 mjacob Exp $ */
+/* $Id: dec_eb164.c,v 1.3 1998/07/22 08:18:34 dfr Exp $ */
/* $NetBSD: dec_eb164.c,v 1.26 1998/04/17 02:45:19 mjacob Exp $ */
/*
@@ -80,7 +80,6 @@ dec_eb164_init()
platform.pci_intr_enable = eb164_intr_enable;
}
-extern int comconsole; /* XXX for forcing comconsole when srm serial console is used */
static void
dec_eb164_cons_init()
{
@@ -106,11 +105,6 @@ dec_eb164_cons_init()
*/
DELAY(160000000 / comcnrate);
- /*
- * force a comconsole on com1 if the SRM has a serial
- * console
- */
- comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
@@ -132,7 +126,7 @@ dec_eb164_cons_init()
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
panic("consinit: unknown console type %d\n",
- (int) ctb->ctb_term_type);
+ ctb->ctb_term_type);
}
}
diff --git a/sys/alpha/alpha/dec_eb64plus.c b/sys/alpha/alpha/dec_eb64plus.c
deleted file mode 100644
index 597415c90769b..0000000000000
--- a/sys/alpha/alpha/dec_eb64plus.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* $Id$ */
-
-/*
- * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-/*
- * Additional Copyright (c) 1997 by Matthew Jacob for NASA/Ames Research Center
- */
-
-/*
- * Port to based on NetBSD/axp by Wilko Bulte <wilko@freebsd.org>
- * FreeBSD version based on:
- * NetBSD: dec_eb64plus.c,v 1.15 1998/11/19 02:20:07 ross Exp
- *
- * Some info on the Aspen Alpine as this might be hard to come by:
- * - Hardware is close enough to the DEC EB64+ design to allow it to run
- * the EB64+ SRM console f/w
- * - 3 PCI slots, closest to the SIMMs: Alpine calls this slot C
- * the middle one Alpine calls this slot B
- * the 3rd one is Alpine calls this slot A
- * (A, B, C is silkscreened on the PCB)
- * - embedded NCR810, located at PCI slot 5
- * - 3 ISA slots, hanging off an Intel 82378IB PCI-ISA bridge at PCI slot 8
- * - embedded floppy, PC keyboard interface, PS/2 mouse interface, 2x serial
- * ports and a parallel port. All of this hiding after the ISA bridge
- */
-
-#include "opt_ddb.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/termios.h>
-
-#include <machine/rpb.h>
-#include <machine/cpuconf.h>
-#include <machine/clock.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#include <pci/pci_ioctl.h>
-
-#include <alpha/pci/apecsreg.h>
-#include <alpha/pci/apecsvar.h>
-
-#include "sio.h"
-#include "sc.h"
-
-#ifndef CONSPEED
-#define CONSPEED TTYDEF_SPEED
-#endif
-static int comcnrate = CONSPEED;
-
-void dec_eb64plus_init __P((void));
-static void dec_eb64plus_cons_init __P((void));
-static void dec_eb64plus_intr_init __P((void));
-
-extern void eb64plus_intr_enable(int irq); /* ../pci/pci_eb64plus_intr.s */
-extern void eb64plus_intr_disable(int irq); /* ../pci/pci_eb64plus_intr.s */
-
-extern const char * bootdev_protocol(void);
-extern int bootdev_boot_dev_type(void);
-
-extern int siocnattach __P((int, int));
-extern int sccnattach __P((void));
-
-const struct alpha_variation_table dec_eb64plus_variations[] = {
- { 0, "DEC EB64-plus" },
- { 0, NULL },
-};
-
-void
-dec_eb64plus_init()
-{
- u_int64_t variation;
-
- platform.family = "EB64+";
-
- if ((platform.model = alpha_dsr_sysname()) == NULL) {
- variation = hwrpb->rpb_variation & SV_ST_MASK;
- if ((platform.model = alpha_variation_name(variation,
- dec_eb64plus_variations)) == NULL)
- platform.model = alpha_unknown_sysname();
- }
-
- platform.iobus = "apecs";
- platform.cons_init = dec_eb64plus_cons_init;
- platform.pci_intr_init = dec_eb64plus_intr_init;
- /* SRM handles PCI interrupt mapping */
- platform.pci_intr_map = NULL;
- /* see ../pci/pci_eb64plus_intr.s for intr. dis/enable */
- platform.pci_intr_disable = eb64plus_intr_disable;
- platform.pci_intr_enable = eb64plus_intr_enable;
-
-}
-
-extern int comconsole; /* XXX for forcing comconsole when srm serial console is used */
-/* init the console, serial or graphics */
-static void
-dec_eb64plus_cons_init()
-{
- struct ctb *ctb;
-
- apecs_init();
-
- ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
-
- switch (ctb->ctb_term_type) {
- case 2:
- /* serial console ... */
- /* XXX */
- {
- /*
- * Delay to allow PROM putchars to complete.
- * FIFO depth * character time,
- * character time = (1000000 / (defaultrate / 10))
- */
- DELAY(160000000 / comcnrate);
-
- /*
- * force a comconsole on com1 if the SRM has a serial
- * console
- */
- comconsole = 0;
- if (siocnattach(0x3f8, comcnrate))
- panic("can't init serial console");
-
- break;
- }
-
- case 3:
-#if NSC > 0
- /* graphics adapter console */
- sccnattach();
-#else
- panic("not configured to use display && keyboard console");
-#endif
- break;
-
- default:
- printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
- printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
-
- panic("consinit: unknown console type %d\n",
- (int)ctb->ctb_term_type);
- }
-}
-
-/*
- * The SRM console may have left some some interrupts enabled.
- */
-static void
-dec_eb64plus_intr_init()
-{
- int i;
-
- /* disable all PCI interrupts */
- for(i = 0; i <= 32; i++) /* 32 ?? NetBSD sez so */
- eb64plus_intr_disable(i);
-
- /* Enable ISA-PCI cascade interrupt */
- eb64plus_intr_enable(4);
-
-}
diff --git a/sys/alpha/alpha/dec_kn20aa.c b/sys/alpha/alpha/dec_kn20aa.c
index 1f4e6720a9571..2f018fb20691c 100644
--- a/sys/alpha/alpha/dec_kn20aa.c
+++ b/sys/alpha/alpha/dec_kn20aa.c
@@ -130,20 +130,20 @@ dec_kn20aa_cons_init()
case 3:
/* display console ... */
/* XXX */
-#if NSC > 0
+#if NPCKBD > 0
sccnattach();
#else
panic("not configured to use display && keyboard console");
break;
-#endif
default:
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
panic("consinit: unknown console type %d\n",
- (int)ctb->ctb_term_type);
+ ctb->ctb_term_type);
}
+#endif
}
#if 0
static void
diff --git a/sys/alpha/alpha/dec_st550.c b/sys/alpha/alpha/dec_st550.c
index b7e186a86e879..758b611907cb5 100644
--- a/sys/alpha/alpha/dec_st550.c
+++ b/sys/alpha/alpha/dec_st550.c
@@ -78,6 +78,7 @@ extern int sccnattach __P((void));
void
st550_init()
{
+ int i;
platform.family = "Digital Personal Workstation (Miata)";
if ((platform.model = alpha_dsr_sysname()) == NULL) {
@@ -140,7 +141,7 @@ st550_cons_init()
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
- panic("consinit: unknown console type %ld\n",
+ panic("consinit: unknown console type %d\n",
ctb->ctb_term_type);
}
}
diff --git a/sys/alpha/alpha/diskslice_machdep.c b/sys/alpha/alpha/diskslice_machdep.c
index 426df40a32e87..e58dfd5928706 100644
--- a/sys/alpha/alpha/diskslice_machdep.c
+++ b/sys/alpha/alpha/diskslice_machdep.c
@@ -36,7 +36,7 @@
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
* from: i386/isa Id: diskslice_machdep.c,v 1.31 1998/08/10 07:22:14 phk Exp
- * $Id: diskslice_machdep.c,v 1.5 1998/10/16 10:13:09 jkh Exp $
+ * $Id: diskslice_machdep.c,v 1.4 1998/10/06 08:38:58 dfr Exp $
*/
#include <sys/param.h>
@@ -421,7 +421,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
diff --git a/sys/alpha/alpha/elf_machdep.c b/sys/alpha/alpha/elf_machdep.c
index 785e2edcfccc8..847ab2a8af88e 100644
--- a/sys/alpha/alpha/elf_machdep.c
+++ b/sys/alpha/alpha/elf_machdep.c
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: elf_machdep.c,v 1.2 1998/10/16 03:54:59 peter Exp $
+ * $Id: elf_machdep.c,v 1.1 1998/09/11 08:47:02 dfr Exp $
*/
#include <sys/param.h>
@@ -97,7 +97,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
break;
case R_ALPHA_RELATIVE:
- addr = relocbase + addend + *where;
+ addr = relocbase + addend;
if (*where != addr)
*where = addr;
break;
@@ -112,7 +112,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
default:
printf("kldload: unexpected relocation type %d\n",
- (int) rtype);
+ rtype);
return -1;
}
return(0);
diff --git a/sys/alpha/alpha/fp_emulate.c b/sys/alpha/alpha/fp_emulate.c
deleted file mode 100644
index d6dc1653e3837..0000000000000
--- a/sys/alpha/alpha/fp_emulate.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: fp_emulate.c,v 1.1 1998/12/04 10:52:47 dfr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sysproto.h>
-#include <sys/sysent.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-#include <vm/vm.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_prot.h>
-#include <vm/vm_page.h>
-#include <vm/vm_map.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_object.h>
-#include <vm/vm_pager.h>
-#include <sys/user.h>
-#include <machine/inst.h>
-#include <machine/fpu.h>
-#include <machine/reg.h>
-#include <alpha/alpha/ieee_float.h>
-
-#define GETREG(regs, i) (*(fp_register_t*) &regs->fpr_regs[i])
-#define PUTREG(regs, i, v) (*(fp_register_t*) &regs->fpr_regs[i] = v)
-
-typedef fp_register_t fp_opcode_handler(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t fp_control,
- u_int64_t *status,
- struct fpreg *fpregs);
-
-static fp_register_t fp_add(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_add(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_sub(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_sub(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_mul(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_mul(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_div(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_div(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- src, rnd, control, status);
-}
-
-static fp_register_t fp_cmpun(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmpun(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cmpeq(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmpeq(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cmplt(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmplt(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cmple(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- return ieee_cmple(GETREG(fpregs, ins.f_format.fa),
- GETREG(fpregs, ins.f_format.fb),
- status);
-}
-
-static fp_register_t fp_cvts(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- switch (src) {
- case T_FORMAT:
- return ieee_convert_T_S(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
-
- case Q_FORMAT:
- return ieee_convert_Q_S(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
-
- default:
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
- }
-}
-
-static fp_register_t fp_cvtt(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- switch (src) {
- case S_FORMAT:
- return ieee_convert_S_T(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- case Q_FORMAT:
- return ieee_convert_Q_T(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- default:
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
- }
-}
-
-static fp_register_t fp_cvtq(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- switch (src) {
- case S_FORMAT:
- return ieee_convert_S_Q(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- case T_FORMAT:
- return ieee_convert_T_Q(GETREG(fpregs, ins.f_format.fb),
- rnd, control, status);
- break;
-
- default:
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
- }
-}
-
-static fp_register_t fp_reserved(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-{
- *status |= FPCR_INV;
- return GETREG(fpregs, ins.f_format.fc);
-}
-
-static fp_register_t fp_cvtql(union alpha_instruction ins,
- int src, int rnd,
- u_int64_t control, u_int64_t *status,
- struct fpreg *fpregs)
-
-{
- fp_register_t fb = GETREG(fpregs, ins.f_format.fb);
- *status |= FPCR_INV;
- return ((fb.q & 0xc0000000) << 32 | (fb.q & 0x3fffffff) << 29);
-}
-
-static int fp_emulate(union alpha_instruction ins, struct proc *p)
-{
- u_int64_t control = p->p_addr->u_pcb.pcb_fp_control;
- struct fpreg *fpregs = &p->p_addr->u_pcb.pcb_fp;
- static fp_opcode_handler *ops[16] = {
- fp_add, /* 0 */
- fp_sub, /* 1 */
- fp_mul, /* 2 */
- fp_div, /* 3 */
- fp_cmpun, /* 4 */
- fp_cmpeq, /* 5 */
- fp_cmplt, /* 6 */
- fp_cmple, /* 7 */
- fp_reserved, /* 8 */
- fp_reserved, /* 9 */
- fp_reserved, /* 10 */
- fp_reserved, /* 11 */
- fp_cvts, /* 12 */
- fp_reserved, /* 13 */
- fp_cvtt, /* 14 */
- fp_cvtq, /* 15 */
- };
- int src, rnd;
- fp_register_t result;
- u_int64_t status;
-
- /*
- * Only attempt to emulate ieee instructions & integer overflow
- */
- if ((ins.common.opcode != op_flti) &&
- (ins.f_format.function != fltl_cvtqlsv)){
- printf("fp_emulate: unhandled opcode = 0x%x, fun = 0x%x\n",ins.common.opcode,ins.f_format.function);
- return 0;
- }
- /*
- * Dump the float registers into the pcb so we can get at
- * them.
- */
- if (p == fpcurproc) {
- alpha_pal_wrfen(1);
- savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp);
- alpha_pal_wrfen(0);
- fpcurproc = NULL;
- }
-
- /*
- * Decode and execute the instruction.
- */
- src = (ins.f_format.function >> 4) & 3;
- rnd = (ins.f_format.function >> 6) & 3;
- if (rnd == 3)
- rnd = (fpregs->fpr_cr >> FPCR_DYN_SHIFT) & 3;
- status = 0;
- if (ins.common.opcode == op_fltl
- && ins.f_format.function == fltl_cvtqlsv)
- result = fp_cvtql(ins, src, rnd, control, &status,
- fpregs);
- else
- result = ops[ins.f_format.function & 0xf](ins, src, rnd,
- control, &status,
- fpregs);
-
- /*
- * Handle exceptions.
- */
- if (status) {
- u_int64_t fpcr;
-
- /* Record the exception in the software control word. */
- control |= (status >> IEEE_STATUS_TO_FPCR_SHIFT);
- p->p_addr->u_pcb.pcb_fp_control = control;
-
- /* Regenerate the control register */
- fpcr = fpregs->fpr_cr & FPCR_DYN_MASK;
- fpcr |= ((control & IEEE_STATUS_MASK)
- << IEEE_STATUS_TO_FPCR_SHIFT);
- if (!(control & IEEE_TRAP_ENABLE_INV))
- fpcr |= FPCR_INVD;
- if (!(control & IEEE_TRAP_ENABLE_DZE))
- fpcr |= FPCR_DZED;
- if (!(control & IEEE_TRAP_ENABLE_OVF))
- fpcr |= FPCR_OVFD;
- if (!(control & IEEE_TRAP_ENABLE_UNF))
- fpcr |= FPCR_UNFD;
- if (!(control & IEEE_TRAP_ENABLE_INE))
- fpcr |= FPCR_INED;
- if (control & IEEE_STATUS_MASK)
- fpcr |= FPCR_SUM;
- fpregs->fpr_cr = fpcr;
-
- /* Check the trap enable */
- if ((control >> IEEE_STATUS_TO_EXCSUM_SHIFT)
- & (control & IEEE_TRAP_ENABLE_MASK))
- return 0;
- }
-
- PUTREG(fpregs, ins.f_format.fc, result);
- return 1;
-}
-
-/*
- * Attempt to complete a floating point instruction which trapped by
- * emulating it in software. Return non-zero if the completion was
- * successful, otherwise zero.
- */
-int fp_software_completion(u_int64_t regmask, struct proc *p)
-{
- struct trapframe *frame = p->p_md.md_tf;
- u_int64_t pc = frame->tf_regs[FRAME_PC];
- int error;
-
- /*
- * First we must search back through the trap shadow to find which
- * instruction was responsible for generating the trap.
- */
- pc -= 4;
- while (regmask) {
- union alpha_instruction ins;
-
- /*
- * Read the instruction and figure out the destination
- * register and opcode.
- */
- error = copyin((caddr_t) pc, &ins, sizeof(ins));
- if (error)
- return 0;
-
- switch (ins.common.opcode) {
- case op_call_pal:
- case op_jsr:
- case op_br ... op_bgt:
- /*
- * Condition 6: the trap shadow may not
- * include any branch instructions. Also,
- * the trap shadow is bounded by EXCB, TRAPB
- * and CALL_PAL.
- */
- return 0;
-
- case op_misc:
- switch (ins.memory_format.function) {
- case misc_trapb:
- case misc_excb:
- return 0;
- }
- break;
-
- case op_inta:
- case op_intl:
- case op_ints:
- /*
- * The first 32 bits of the register mask
- * represents integer registers which were
- * modified in the trap shadow.
- */
- regmask &= ~(1LL << ins.o_format.rc);
- break;
-
- case op_fltv:
- case op_flti:
- case op_fltl:
- /*
- * The second 32 bits of the register mask
- * represents float registers which were
- * modified in the trap shadow.
- */
- regmask &= ~(1LL << (ins.f_format.fc + 32));
- break;
- }
-
- if (regmask == 0) {
- /*
- * We have traced back through all the
- * instructions in the trap shadow, so this
- * must be the one which generated the trap.
- */
- if (fp_emulate(ins, p)) {
- /*
- * Restore pc to the first instruction
- * in the trap shadow.
- */
- frame->tf_regs[FRAME_PC] = pc + 4;
- return 1;
- } else
- return 0;
- }
- pc -= 4;
- }
- return 0;
-}
diff --git a/sys/alpha/alpha/genassym.c b/sys/alpha/alpha/genassym.c
index 33febfcfeb611..ca99b6a1b84fe 100644
--- a/sys/alpha/alpha/genassym.c
+++ b/sys/alpha/alpha/genassym.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
- * $Id: genassym.c,v 1.3 1998/07/12 16:08:15 dfr Exp $
+ * $Id: genassym.c,v 1.2 1998/06/14 13:44:43 dfr Exp $
*/
#include <sys/param.h>
@@ -46,7 +46,6 @@
#include <sys/resource.h>
#include <sys/resourcevar.h>
#include <machine/frame.h>
-#include <machine/chipset.h>
#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -96,12 +95,7 @@ main()
OFF(P_PID, struct proc, p_pid);
OFF(P_SWITCHTIME, struct proc, p_switchtime);
OFF(P_RUNTIME, struct proc, p_runtime);
- OFF(P_MD_FLAGS, struct proc, p_md.md_flags);
OFF(P_MD_PCBPADDR, struct proc, p_md.md_pcbpaddr);
- OFF(P_MD_HAE, struct proc, p_md.md_hae);
- CONST1(MDP_HAEUSED);
-
- OFF(CHIPSET_WRITE_HAE, struct alpha_chipset, write_hae);
OFF(PH_LINK, struct prochd, ph_link);
OFF(PH_RLINK, struct prochd, ph_rlink);
diff --git a/sys/alpha/alpha/ieee_float.c b/sys/alpha/alpha/ieee_float.c
deleted file mode 100644
index 9e9846cb9153c..0000000000000
--- a/sys/alpha/alpha/ieee_float.c
+++ /dev/null
@@ -1,1515 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-/*
- * An implementation of IEEE 754 floating point arithmetic supporting
- * multiply, divide, addition, subtraction and conversion to and from
- * integer. Probably not the fastest floating point code in the world
- * but it should be pretty accurate.
- *
- * A special thanks to John Polstra for pointing out some problems
- * with an earlier version of this code and for educating me as to the
- * correct use of sticky bits.
- */
-
-#include <sys/types.h>
-#ifdef TEST
-#include "../include/fpu.h"
-#include "ieee_float.h"
-#else
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sysproto.h>
-#include <sys/sysent.h>
-#include <sys/proc.h>
-#include <machine/fpu.h>
-#include <alpha/alpha/ieee_float.h>
-#endif
-
-/*
- * The number of fraction bits in a T format float.
- */
-#define T_FRACBITS 52
-
-/*
- * The number of fraction bits in a S format float.
- */
-#define S_FRACBITS 23
-
-/*
- * Mask the fraction part of a float to contain only those bits which
- * should be in single precision number.
- */
-#define S_FRACMASK ((1ULL << 52) - (1ULL << 29))
-
-/*
- * The number of extra zero bits we shift into the fraction part
- * to gain accuracy. Two guard bits and one sticky bit are required
- * to ensure accurate rounding.
- */
-#define FRAC_SHIFT 3
-
-/*
- * Values for 1.0 and 2.0 fractions (including the extra FRAC_SHIFT
- * bits).
- */
-#define ONE (1ULL << (T_FRACBITS + FRAC_SHIFT))
-#define TWO (ONE + ONE)
-
-/*
- * The maximum and minimum values for S and T format exponents.
- */
-#define T_MAXEXP 0x3ff
-#define T_MINEXP -0x3fe
-#define S_MAXEXP 0x7f
-#define S_MINEXP -0x7e
-
-/*
- * Exponent values in registers are biased by adding this value.
- */
-#define BIAS_EXP 0x3ff
-
-/*
- * Exponent value for INF and NaN.
- */
-#define NAN_EXP 0x7ff
-
-/*
- * If this bit is set in the fraction part of a NaN, then the number
- * is a quiet NaN, i.e. no traps are generated.
- */
-#define QNAN_BIT (1ULL << 51)
-
-/*
- * Return true if the number is any kind of NaN.
- */
-static __inline int
-isNaN(fp_register_t f)
-{
- return f.t.exponent == NAN_EXP && f.t.fraction != 0;
-}
-
-/*
- * Return true if the number is a quiet NaN.
- */
-static __inline int
-isQNaN(fp_register_t f)
-{
- return f.t.exponent == NAN_EXP && (f.t.fraction & QNAN_BIT);
-}
-
-/*
- * Return true if the number is a signalling NaN.
- */
-static __inline int
-isSNaN(fp_register_t f)
-{
- return isNaN(f) && !isQNaN(f);
-}
-
-/*
- * Return true if the number is +/- INF.
- */
-static __inline int
-isINF(fp_register_t f)
-{
- return f.t.exponent == NAN_EXP && f.t.fraction == 0;
-}
-
-/*
- * Return true if the number is +/- 0.
- */
-static __inline int
-isZERO(fp_register_t f)
-{
- return f.t.exponent == 0 && f.t.fraction == 0;
-}
-
-/*
- * Return true if the number is denormalised.
- */
-static __inline int
-isDENORM(fp_register_t f)
-{
- return f.t.exponent == 0 && f.t.fraction != 0;
-}
-
-/*
- * Extract the exponent part of a float register. If the exponent is
- * zero, the number may be denormalised (if the fraction is nonzero).
- * If so, return the minimum exponent for the source datatype.
- */
-static __inline int
-getexp(fp_register_t f, int src)
-{
- int minexp[] = { S_MINEXP, 0, T_MINEXP, 0 };
- if (f.t.exponent == 0)
- if (f.t.fraction)
- return minexp[src];
- else
- return 0;
- return f.t.exponent - BIAS_EXP;
-}
-
-/*
- * Extract the fraction part of a float register, shift it up a bit
- * to give extra accuracy and add in the implicit 1 bit. Must be
- * careful to handle denormalised numbers and zero correctly.
- */
-static __inline u_int64_t
-getfrac(fp_register_t f)
-{
- if (f.t.exponent == 0)
- return f.t.fraction << FRAC_SHIFT;
- else
- return (f.t.fraction << FRAC_SHIFT) | ONE;
-}
-
-/*
- * Make a float (in register format) from a sign, exponent and
- * fraction, normalising and rounding as necessary.
- * Return the float and set *status if any traps are generated.
- */
-static fp_register_t
-makefloat(int sign, int exp, u_int64_t frac,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- fp_register_t f;
- int minexp = 0, maxexp = 0, alpha = 0;
- u_int64_t epsilon = 0, max = 0;
-
- if (frac == 0) {
- f.t.sign = sign;
- f.t.exponent = 0;
- f.t.fraction = 0;
- return f;
- }
-
- if (frac >= TWO) {
- /*
- * Fraction is >= 2.0.
- * Shift the fraction down, preserving the 'sticky'
- * bit.
- */
- while (frac >= TWO) {
- frac = (frac >> 1) | (frac & 1);
- exp++;
- }
- } else if (frac < ONE) {
- /*
- * Fraction is < 1.0. Shift it up.
- */
- while (frac < ONE) {
- frac = (frac << 1) | (frac & 1);
- exp--;
- }
- }
-
- switch (src) {
- case S_FORMAT:
- minexp = S_MINEXP;
- maxexp = S_MAXEXP;
- alpha = 0xc0;
- epsilon = (1ULL << (T_FRACBITS - S_FRACBITS + FRAC_SHIFT));
- max = TWO - epsilon;
- break;
-
- case T_FORMAT:
- minexp = T_MINEXP;
- maxexp = T_MAXEXP;
- alpha = 0x600;
- epsilon = (1ULL << FRAC_SHIFT);
- max = TWO - epsilon;
- break;
- }
-
- /*
- * Handle underflow before rounding so that denormalised
- * numbers are rounded correctly.
- */
- if (exp < minexp) {
- *status |= FPCR_INE;
- if (control & IEEE_TRAP_ENABLE_UNF) {
- *status |= FPCR_UNF;
- exp += alpha;
- } else {
- /* denormalise */
- while (exp < minexp) {
- exp++;
- frac = (frac >> 1) | (frac & 1);
- }
- exp = minexp - 1;
- }
- }
-
- /*
- * Round the fraction according to the rounding mode.
- */
- if (frac & (epsilon - 1)) {
- u_int64_t fraclo, frachi;
- u_int64_t difflo, diffhi;
-
- fraclo = frac & max;
- frachi = fraclo + epsilon;
- switch (rnd) {
- case ROUND_CHOP:
- frac = fraclo;
- break;
- case ROUND_MINUS_INF:
- if (f.t.sign)
- frac = frachi;
- else
- frac = fraclo;
- break;
- case ROUND_NORMAL:
- difflo = frac - fraclo;
- diffhi = frachi - frac;
- if (difflo < diffhi)
- frac = fraclo;
- else if (diffhi < difflo)
- frac = frachi;
- else
- /* round to even */
- if (fraclo & epsilon)
- frac = frachi;
- else
- frac = fraclo;
- break;
- case ROUND_PLUS_INF:
- if (f.t.sign)
- frac = fraclo;
- else
- frac = frachi;
- break;
- }
-
- /*
- * Rounding up may take us to TWO if
- * fraclo == (TWO - epsilon). Also If fraclo has been
- * denormalised to (ONE - epsilon) then there is a
- * possibility that we will round to ONE exactly.
- */
- if (frac >= TWO) {
- frac = (frac >> 1) & ~(epsilon - 1);
- exp++;
- } else if (exp == minexp - 1 && frac == ONE) {
- /* Renormalise to ONE * 2^minexp */
- exp = minexp;
- }
-
- *status |= FPCR_INE;
- }
-
- /*
- * Check for overflow and round to the correct INF as needed.
- */
- if (exp > maxexp) {
- *status |= FPCR_OVF | FPCR_INE;
- if (control & IEEE_TRAP_ENABLE_OVF) {
- exp -= alpha;
- } else {
- switch (rnd) {
- case ROUND_CHOP:
- exp = maxexp;
- frac = max;
- break;
- case ROUND_MINUS_INF:
- if (sign) {
- exp = maxexp + 1; /* INF */
- frac = 0;
- } else {
- exp = maxexp;
- frac = max;
- }
- break;
- case ROUND_NORMAL:
- exp = maxexp + 1; /* INF */
- frac = 0;
- break;
- case ROUND_PLUS_INF:
- if (sign) {
- exp = maxexp;
- frac = max;
- } else {
- exp = maxexp + 1; /* INF */
- frac = 0;
- }
- break;
- }
- }
- }
-
- f.t.sign = sign;
- if (exp > maxexp) /* NaN, INF */
- f.t.exponent = NAN_EXP;
- else if (exp < minexp) /* denorm, zero */
- f.t.exponent = 0;
- else
- f.t.exponent = exp + BIAS_EXP;
- f.t.fraction = (frac & ~ONE) >> FRAC_SHIFT;
- return f;
-}
-
-/*
- * Return the canonical quiet NaN in register format.
- */
-static fp_register_t
-makeQNaN(void)
-{
- fp_register_t f;
- f.t.sign = 0;
- f.t.exponent = NAN_EXP;
- f.t.fraction = QNAN_BIT;
- return f;
-}
-
-/*
- * Return +/- INF.
- */
-static fp_register_t
-makeINF(int sign)
-{
- fp_register_t f;
- f.t.sign = sign;
- f.t.exponent = NAN_EXP;
- f.t.fraction = 0;
- return f;
-}
-
-/*
- * Return +/- 0.
- */
-static fp_register_t
-makeZERO(int sign)
-{
- fp_register_t f;
- f.t.sign = sign;
- f.t.exponent = 0;
- f.t.fraction = 0;
- return f;
-}
-
-fp_register_t
-ieee_add(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- int shift;
- int expa, expb, exp;
- u_int64_t fraca, fracb, frac;
- int sign, sticky;
-
- /* First handle NaNs */
- if (isNaN(fa) || isNaN(fb)) {
- fp_register_t result;
-
- /* Instructions Descriptions (I) section 4.7.10.4 */
- if (isQNaN(fb))
- result = fb;
- else if (isSNaN(fb)) {
- result = fb;
- result.t.fraction |= QNAN_BIT;
- } else if (isQNaN(fa))
- result = fa;
- else if (isSNaN(fa))
- result = fa;
-
- /* If either operand is a signalling NaN, trap. */
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
-
- return result;
- }
-
- /* Handle +/- INF */
- if (isINF(fa))
- if (isINF(fb))
- if (fa.t.sign != fb.t.sign) {
- /* If adding -INF to +INF, generate a trap. */
- *status |= FPCR_INV;
- return makeQNaN();
- } else
- return fa;
- else
- return fa;
- else if (isINF(fb))
- return fb;
-
- /*
- * Unpack the registers.
- */
- expa = getexp(fa, src);
- expb = getexp(fb, src);
- fraca = getfrac(fa);
- fracb = getfrac(fb);
- shift = expa - expb;
- if (shift < 0) {
- shift = -shift;
- exp = expb;
- sticky = (fraca & ((1ULL << shift) - 1)) != 0;
- if (shift >= 64)
- fraca = sticky;
- else
- fraca = (fraca >> shift) | sticky;
- } else if (shift > 0) {
- exp = expa;
- sticky = (fracb & ((1ULL << shift) - 1)) != 0;
- if (shift >= 64)
- fracb = sticky;
- else
- fracb = (fracb >> shift) | sticky;
- } else
- exp = expa;
- if (fa.t.sign) fraca = -fraca;
- if (fb.t.sign) fracb = -fracb;
- frac = fraca + fracb;
- if (frac >> 63) {
- sign = 1;
- frac = -frac;
- } else
- sign = 0;
-
- /* -0 + -0 = -0 */
- if (fa.t.exponent == 0 && fa.t.fraction == 0
- && fb.t.exponent == 0 && fb.t.fraction == 0)
- sign = fa.t.sign && fb.t.sign;
-
- return makefloat(sign, exp, frac, src, rnd, control, status);
-}
-
-fp_register_t
-ieee_sub(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- fb.t.sign = !fb.t.sign;
- return ieee_add(fa, fb, src, rnd, control, status);
-}
-
-typedef struct {
- u_int64_t lo;
- u_int64_t hi;
-} u_int128_t;
-
-#define SRL128(x, b) \
-do { \
- x.lo >>= b; \
- x.lo |= x.hi << (64 - b); \
- x.hi >>= b; \
-} while (0)
-
-#define SLL128(x, b) \
-do { \
- if (b >= 64) { \
- x.hi = x.lo << (b - 64); \
- x.lo = 0; \
- } else { \
- x.hi <<= b; \
- x.hi |= x.lo >> (64 - b); \
- x.lo <<= b; \
- } \
-} while (0)
-
-#define SUB128(a, b) \
-do { \
- int borrow = a.lo < b.lo; \
- a.lo = a.lo - b.lo; \
- a.hi = a.hi - b.hi - borrow; \
-} while (0)
-
-#define LESS128(a, b) (a.hi < b.hi || (a.hi == b.hi && a.lo < b.lo))
-
-fp_register_t
-ieee_mul(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- int shift;
- int expa, expb, exp;
- u_int64_t fraca, fracb, tmp;
- u_int128_t frac;
- int sign;
-
- /* First handle NaNs */
- if (isNaN(fa) || isNaN(fb)) {
- fp_register_t result;
-
- /* Instructions Descriptions (I) section 4.7.10.4 */
- if (isQNaN(fb))
- result = fb;
- else if (isSNaN(fb)) {
- result = fb;
- result.t.fraction |= QNAN_BIT;
- } else if (isQNaN(fa))
- result = fa;
- else if (isSNaN(fa))
- result = fa;
-
- /* If either operand is a signalling NaN, trap. */
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
-
- return result;
- }
-
- /* Handle INF and 0 */
- if ((isINF(fa) && isZERO(fb)) || (isINF(fa) && isZERO(fb))) {
- /* INF * 0 = NaN */
- *status |= FPCR_INV;
- return makeQNaN();
- } else
- /* If either is INF or zero, get the sign right */
- if (isINF(fa) || isINF(fb))
- return makeINF(fa.t.sign ^ fb.t.sign);
- else if (isZERO(fa) || isZERO(fb))
- return makeZERO(fa.t.sign ^ fb.t.sign);
-
- /*
- * Unpack the registers.
- */
- expa = getexp(fa, src);
- expb = getexp(fb, src);
- fraca = getfrac(fa);
- fracb = getfrac(fb);
- sign = fa.t.sign ^ fb.t.sign;
-
-#define LO32(x) ((x) & ((1ULL << 32) - 1))
-#define HI32(x) ((x) >> 32)
-
- /*
- * Calculate the 128bit result of multiplying fraca and fracb.
- */
- frac.lo = fraca * fracb;
-#ifdef __alpha__
- /*
- * The alpha has a handy instruction to find the high word.
- */
- __asm__ __volatile__ ("umulh %1,%2,%0"
- : "=r"(tmp)
- : "r"(fraca), "r"(fracb));
- frac.hi = tmp;
-#else
- /*
- * Do the multiply longhand otherwise.
- */
- frac.hi = HI32(LO32(fraca) * HI32(fracb)
- + HI32(fraca) * LO32(fracb)
- + HI32(LO32(fraca) * LO32(fracb)))
- + HI32(fraca) * HI32(fracb);
-#endif
- exp = expa + expb - (T_FRACBITS + FRAC_SHIFT);
-
- while (frac.hi > 0) {
- int sticky;
- exp++;
- sticky = frac.lo & 1;
- SRL128(frac, 1);
- frac.lo |= sticky;
- }
-
- return makefloat(sign, exp, frac.lo, src, rnd, control, status);
-}
-
-static u_int128_t
-divide_128(u_int128_t a, u_int128_t b)
-{
- u_int128_t result;
- u_int64_t bit;
- int i;
-
- /*
- * Make a couple of assumptions on the numbers passed in. The
- * value in 'a' will have bits set in the upper 64 bits only
- * and the number in 'b' will have zeros in the upper 64 bits.
- * Also, 'b' will not be zero.
- */
-#ifdef TEST
- if (a.hi == 0 || b.hi != 0 || b.lo == 0)
- abort();
-#endif
-
- /*
- * Find out how many bits of zeros are at the beginning of the divisor.
- */
- i = 64;
- bit = 1ULL << 63;
- while (i < 127) {
- if (b.lo & bit)
- break;
- i++;
- bit >>= 1;
- }
-
- /*
- * Find out how much to shift the divisor so that its msb
- * matches the msb of the dividend.
- */
- bit = 1ULL << 63;
- while (i) {
- if (a.hi & bit)
- break;
- i--;
- bit >>= 1;
- }
-
- result.lo = 0;
- result.hi = 0;
- SLL128(b, i);
-
- /*
- * Calculate the result in two parts to avoid keeping a 128bit
- * value for the result bit.
- */
- if (i >= 64) {
- bit = 1ULL << (i - 64);
- while (bit) {
- if (!LESS128(a, b)) {
- result.hi |= bit;
- SUB128(a, b);
- if (!a.lo && !a.hi)
- return result;
- }
- bit >>= 1;
- SRL128(b, 1);
- }
- i = 63;
- }
- bit = 1ULL << i;
- while (bit) {
- if (!LESS128(a, b)) {
- result.lo |= bit;
- SUB128(a, b);
- if (!a.lo && !a.hi)
- return result;
- }
- bit >>= 1;
- SRL128(b, 1);
- }
-
- return result;
-}
-
-fp_register_t
-ieee_div(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- int shift;
- int expa, expb, exp;
- u_int128_t fraca, fracb, frac;
- int sign;
-
- /* First handle NaNs, INFs and ZEROs */
- if (isNaN(fa) || isNaN(fb)) {
- fp_register_t result;
-
- /* Instructions Descriptions (I) section 4.7.10.4 */
- if (isQNaN(fb))
- result = fb;
- else if (isSNaN(fb)) {
- result = fb;
- result.t.fraction |= QNAN_BIT;
- } else if (isQNaN(fa))
- result = fa;
- else if (isSNaN(fa))
- result = fa;
-
- /* If either operand is a signalling NaN, trap. */
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
-
- return result;
- }
-
- /* Handle INF and 0 */
- if (isINF(fa) && isINF(fb)) {
- *status |= FPCR_INV;
- return makeQNaN();
- } else if (isZERO(fb))
- if (isZERO(fa)) {
- *status |= FPCR_INV;
- return makeQNaN();
- } else {
- *status |= FPCR_DZE;
- return makeINF(fa.t.sign ^ fb.t.sign);
- }
- else if (isZERO(fa))
- return makeZERO(fa.t.sign ^ fb.t.sign);
-
- /*
- * Unpack the registers.
- */
- expa = getexp(fa, src);
- expb = getexp(fb, src);
- fraca.hi = getfrac(fa);
- fraca.lo = 0;
- fracb.lo = getfrac(fb);
- fracb.hi = 0;
- sign = fa.t.sign ^ fb.t.sign;
-
- frac = divide_128(fraca, fracb);
-
- exp = expa - expb - (64 - T_FRACBITS - FRAC_SHIFT);
- while (frac.hi > 0) {
- int sticky;
- exp++;
- sticky = frac.lo & 1;
- SRL128(frac, 1);
- frac.lo |= sticky;
- }
- frac.lo |= 1;
-
- return makefloat(sign, exp, frac.lo, src, rnd, control, status);
-}
-
-#define IEEE_TRUE 0x4000000000000000ULL
-#define IEEE_FALSE 0
-
-fp_register_t
-ieee_cmpun(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_TRUE;
- } else
- result.q = IEEE_FALSE;
-
- return result;
-}
-
-fp_register_t
-ieee_cmpeq(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_FALSE;
- } else {
- if (isZERO(fa) && isZERO(fb))
- result.q = IEEE_TRUE;
- else if (fa.q == fb.q)
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- }
-
- return result;
-}
-
-fp_register_t
-ieee_cmplt(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_FALSE;
- } else {
- if (isZERO(fa) && isZERO(fb))
- result.q = IEEE_FALSE;
- else if (fa.t.sign) {
- /* fa is negative */
- if (!fb.t.sign)
- /* fb is positive, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent > fb.t.exponent)
- /* fa has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent == fb.t.exponent
- && fa.t.fraction > fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- } else {
- /* fa is positive */
- if (fb.t.sign)
- /* fb is negative, return false */
- result.q = IEEE_FALSE;
- else if (fb.t.exponent > fa.t.exponent)
- /* fb has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fb.t.exponent == fb.t.exponent
- && fa.t.fraction < fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- }
- }
-
- return result;
-}
-
-fp_register_t
-ieee_cmple(fp_register_t fa, fp_register_t fb, u_int64_t *status)
-{
- fp_register_t result;
- if (isNaN(fa) || isNaN(fb)) {
- if (isSNaN(fa) || isSNaN(fb))
- *status |= FPCR_INV;
- result.q = IEEE_FALSE;
- } else {
- if (isZERO(fa) && isZERO(fb))
- result.q = IEEE_TRUE;
- else if (fa.t.sign) {
- /* fa is negative */
- if (!fb.t.sign)
- /* fb is positive, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent > fb.t.exponent)
- /* fa has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fa.t.exponent == fb.t.exponent
- && fa.t.fraction >= fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- } else {
- /* fa is positive */
- if (fb.t.sign)
- /* fb is negative, return false */
- result.q = IEEE_FALSE;
- else if (fb.t.exponent > fa.t.exponent)
- /* fb has a larger exponent, return true */
- result.q = IEEE_TRUE;
- else if (fb.t.exponent == fb.t.exponent
- && fa.t.fraction <= fb.t.fraction)
- /* compare fractions */
- result.q = IEEE_TRUE;
- else
- result.q = IEEE_FALSE;
- }
- }
-
- return result;
-}
-
-fp_register_t
-ieee_convert_S_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- /*
- * Handle exceptional values.
- */
- if (isNaN(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- f.t.fraction |= QNAN_BIT;
- *status |= FPCR_INV;
- }
- if (isQNaN(f) || isINF(f))
- return f;
-
- /*
- * If the number is a denormalised float, renormalise.
- */
- if (isDENORM(f))
- return makefloat(f.t.sign,
- getexp(f, S_FORMAT),
- getfrac(f),
- T_FORMAT, rnd, control, status);
- else
- return f;
-}
-
-fp_register_t
-ieee_convert_T_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- /*
- * Handle exceptional values.
- */
- if (isNaN(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- f.t.fraction |= QNAN_BIT;
- f.t.fraction &= ~S_FRACMASK;
- *status |= FPCR_INV;
- }
- if (isQNaN(f) || isINF(f))
- return f;
-
- return makefloat(f.t.sign,
- getexp(f, T_FORMAT),
- getfrac(f),
- S_FORMAT, rnd, control, status);
-}
-
-fp_register_t
-ieee_convert_Q_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- u_int64_t frac = f.q;
- int sign, exponent;
-
- if (frac >> 63) {
- sign = 1;
- frac = -frac;
- } else
- sign = 0;
-
- /*
- * We shift up one bit to leave the sticky bit clear. This is
- * possible unless frac == (1<<63), in which case the sticky
- * bit is already clear.
- */
- exponent = T_FRACBITS + FRAC_SHIFT;
- if (frac < (1ULL << 63)) {
- frac <<= 1;
- exponent--;
- }
-
- return makefloat(sign, exponent, frac, S_FORMAT, rnd,
- control, status);
-}
-
-fp_register_t
-ieee_convert_Q_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- u_int64_t frac = f.q;
- int sign, exponent;
-
- if (frac >> 63) {
- sign = 1;
- frac = -frac;
- } else
- sign = 0;
-
- /*
- * We shift up one bit to leave the sticky bit clear. This is
- * possible unless frac == (1<<63), in which case the sticky
- * bit is already clear.
- */
- exponent = T_FRACBITS + FRAC_SHIFT;
- if (frac < (1ULL << 63)) {
- frac <<= 1;
- exponent--;
- }
-
- return makefloat(sign, exponent, frac, T_FORMAT, rnd,
- control, status);
-}
-
-fp_register_t
-ieee_convert_T_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- u_int64_t frac;
- int exp;
-
- /*
- * Handle exceptional values.
- */
- if (isNaN(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- if (isSNaN(f))
- *status |= FPCR_INV;
- f.q = 0;
- return f;
- }
- if (isINF(f)) {
- /* Instructions Descriptions (I) section 4.7.10.1 */
- *status |= FPCR_INV;
- f.q = 0;
- return f;
- }
-
- exp = getexp(f, T_FORMAT) - (T_FRACBITS + FRAC_SHIFT);
- frac = getfrac(f);
-
- if (exp > 0) {
- if (exp > 64 || frac >= (1 << (64 - exp)))
- *status |= FPCR_IOV | FPCR_INE;
- if (exp < 64)
- frac <<= exp;
- else
- frac = 0;
- } else if (exp < 0) {
- u_int64_t mask;
- u_int64_t fraclo, frachi;
- u_int64_t diffhi, difflo;
- exp = -exp;
- if (exp > 64) {
- fraclo = 0;
- diffhi = 0;
- difflo = 0;
- if (frac) {
- frachi = 1;
- *status |= FPCR_INE;
- } else
- frachi = 0;
- } else if (exp == 64) {
- fraclo = 0;
- if (frac) {
- frachi = 1;
- difflo = frac;
- diffhi = -frac;
- *status |= FPCR_INE;
- } else {
- frachi = 0;
- difflo = 0;
- diffhi = 0;
- }
- } else {
- mask = (1 << exp) - 1;
- fraclo = frac >> exp;
- if (frac & mask) {
- frachi = fraclo + 1;
- difflo = frac - (fraclo << exp);
- diffhi = (frachi << exp) - frac;
- *status |= FPCR_INE;
- } else {
- frachi = fraclo;
- difflo = 0;
- diffhi = 0;
- }
- }
- switch (rnd) {
- case ROUND_CHOP:
- frac = fraclo;
- break;
- case ROUND_MINUS_INF:
- if (f.t.sign)
- frac = frachi;
- else
- frac = fraclo;
- break;
- case ROUND_NORMAL:
-#if 0
- /*
- * Round to nearest.
- */
- if (difflo < diffhi)
- frac = fraclo;
- else if (diffhi > difflo)
- frac = frachi;
- else if (fraclo & 1)
- frac = frachi;
- else
- frac = fraclo;
-#else
- /*
- * Round to zero.
- */
- frac = fraclo;
-#endif
- break;
- case ROUND_PLUS_INF:
- if (f.t.sign)
- frac = fraclo;
- else
- frac = frachi;
- break;
- }
- }
-
- if (f.t.sign) {
- if (frac > (1ULL << 63))
- *status |= FPCR_IOV | FPCR_INE;
- frac = -frac;
- } else {
- if (frac > (1ULL << 63) - 1)
- *status |= FPCR_IOV | FPCR_INE;
- }
-
- f.q = frac;
- return f;
-}
-
-fp_register_t
-ieee_convert_S_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status)
-{
- f = ieee_convert_S_T(f, rnd, control, status);
- return ieee_convert_T_Q(f, rnd, control, status);
-}
-
-#ifndef KERNEL
-
-#include <stdio.h>
-#include <math.h>
-#include <stdlib.h>
-
-union value {
- double d;
- fp_register_t r;
-};
-
-
-static double
-random_double()
-{
- union value a;
- int exp;
-
- a.r.t.fraction = ((long long)random() & (1ULL << 20) - 1) << 32
- | random();
- exp = random() & 0x7ff;
-#if 1
- if (exp == 0)
- exp = 1; /* no denorms */
- else if (exp == 0x7ff)
- exp = 0x7fe; /* no NaNs and INFs */
-#endif
-
- a.r.t.exponent = exp;
- a.r.t.sign = random() & 1;
- return a.d;
-}
-
-static float
-random_float()
-{
- union value a;
- int exp;
-
- a.r.t.fraction = ((long)random() & (1ULL << 23) - 1) << 29;
- exp = random() & 0xff;
-#if 1
- if (exp == 0)
- exp = 1; /* no denorms */
- else if (exp == 0xff)
- exp = 0xfe; /* no NaNs and INFs */
-#endif
-
- /* map exponent from S to T format */
- if (exp == 255)
- a.r.t.exponent = 0x7ff;
- else if (exp & 0x80)
- a.r.t.exponent = 0x400 + (exp & 0x7f);
- else if (exp)
- a.r.t.exponent = 0x380 + exp;
- else
- a.r.t.exponent = 0;
- a.r.t.sign = random() & 1;
-
- return a.d;
-}
-
-/*
- * Ignore epsilon errors
- */
-int
-equal_T(union value a, union value b)
-{
- if (isZERO(a.r) && isZERO(b.r))
- return 1;
- if (a.r.t.sign != b.r.t.sign)
- return 0;
- if (a.r.t.exponent != b.r.t.exponent)
- return 0;
-
- return a.r.t.fraction == b.r.t.fraction;
-}
-
-int
-equal_S(union value a, union value b)
-{
- int64_t epsilon = 1ULL << 29;
-
- if (isZERO(a.r) && isZERO(b.r))
- return 1;
- if (a.r.t.sign != b.r.t.sign)
- return 0;
- if (a.r.t.exponent != b.r.t.exponent)
- return 0;
-
- return ((a.r.t.fraction & ~(epsilon-1))
- == (b.r.t.fraction & ~(epsilon-1)));
-}
-
-#define ITER 1000000
-
-static void
-test_double_add()
-{
- union value a, b, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_add(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- x.d = a.d + b.d;
- if (!equal_T(c, x)) {
- printf("bad double add, %g + %g = %g (should be %g)\n",
- a.d, b.d, c.d, x.d);
- c.r = ieee_add(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_single_add()
-{
- union value a, b, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
-#if 0
- if (i == 0) {
- a.r.q = 0xb33acf292ca49700ULL;
- b.r.q = 0xcad3191058a693aeULL;
- }
-#endif
- a.d = random_float();
- b.d = random_float();
- status = 0;
- c.r = ieee_add(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- xf = a.d + b.d;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (!equal_S(t, x)) {
- printf("bad single add, %g + %g = %g (should be %g)\n",
- a.d, b.d, t.d, x.d);
- c.r = ieee_add(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_double_mul()
-{
- union value a, b, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- x.d = a.d * b.d;
- if (!equal_T(c, x)) {
- printf("bad double mul, %g * %g = %g (should be %g)\n",
- a.d, b.d, c.d, x.d);
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_single_mul()
-{
- union value a, b, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_mul(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- xf = a.d * b.d;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (!equal_S(t, x)) {
- printf("bad single mul, %g * %g = %g (should be %g)\n",
- a.d, b.d, t.d, x.d);
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_double_div()
-{
- union value a, b, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_div(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- x.d = a.d / b.d;
- if (!equal_T(c, x) && !isZERO(x.r)) {
- printf("bad double div, %g / %g = %g (should be %g)\n",
- a.d, b.d, c.d, x.d);
- c.r = ieee_div(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_single_div()
-{
- union value a, b, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- b.d = random_double();
- status = 0;
- c.r = ieee_div(a.r, b.r, S_FORMAT, ROUND_NORMAL,
- 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r) || isDENORM(c.r))
- continue;
- xf = a.d / b.d;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (!equal_S(t, x)) {
- printf("bad single div, %g / %g = %g (should be %g)\n",
- a.d, b.d, t.d, x.d);
- c.r = ieee_mul(a.r, b.r, T_FORMAT, ROUND_NORMAL,
- 0, &status);
- }
- }
-}
-
-static void
-test_convert_int_to_double()
-{
- union value a, c, x;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.r.q = (u_int64_t)random() << 32
- | random();
- status = 0;
- c.r = ieee_convert_Q_T(a.r, ROUND_NORMAL, 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r))
- continue;
- x.d = (double) a.r.q;
- if (c.d != x.d) {
- printf("bad convert double, (double)%qx = %g (should be %g)\n",
- a.r.q, c.d, x.d);
- c.r = ieee_convert_Q_T(a.r, ROUND_NORMAL, 0, &status);
- }
- }
-}
-
-static void
-test_convert_int_to_single()
-{
- union value a, c, x, t;
- float xf;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.r.q = (unsigned long long)random() << 32
- | random();
- status = 0;
- c.r = ieee_convert_Q_S(a.r, ROUND_NORMAL, 0, &status);
- /* ignore NaN and INF */
- if (isNaN(c.r) || isINF(c.r))
- continue;
- xf = (float) a.r.q;
- x.d = xf;
- t.r = ieee_convert_S_T(c.r, ROUND_NORMAL, 0, &status);
- if (t.d != x.d) {
- printf("bad convert single, (double)%qx = %g (should be %g)\n",
- a.r.q, c.d, x.d);
- c.r = ieee_convert_Q_S(a.r, ROUND_NORMAL, 0, &status);
- }
- }
-}
-
-static void
-test_convert_double_to_int()
-{
- union value a, c;
- u_int64_t status = 0;
- int i;
-
- for (i = 0; i < ITER; i++) {
- a.d = random_double();
- status = 0;
- c.r = ieee_convert_T_Q(a.r, ROUND_NORMAL, 0, &status);
- if ((int)c.r.q != (int)a.d) {
- printf("bad convert double, (int)%g = %d (should be %d)\n",
- a.d, (int)c.r.q, (int)a.d);
- c.r = ieee_convert_T_Q(a.r, ROUND_NORMAL, 0, &status);
- }
- }
-}
-
-int
-main(int argc, char* argv[])
-{
- srandom(0);
-
- test_double_div();
- test_single_div();
- test_double_add();
- test_single_add();
- test_double_mul();
- test_single_mul();
- test_convert_int_to_double();
- test_convert_int_to_single();
-#if 0
- /* x86 generates SIGFPE on overflows. */
- test_convert_double_to_int();
-#endif
-
- return 0;
-}
-
-#endif
diff --git a/sys/alpha/alpha/ieee_float.h b/sys/alpha/alpha/ieee_float.h
deleted file mode 100644
index 1977e910a0e19..0000000000000
--- a/sys/alpha/alpha/ieee_float.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-#define S_FORMAT 0 /* IEEE single */
-#define T_FORMAT 2 /* IEEE double */
-#define Q_FORMAT 3 /* 64 bit fixed */
-
-#define ROUND_CHOP 0 /* truncate fraction */
-#define ROUND_MINUS_INF 1 /* round to -INF */
-#define ROUND_NORMAL 2 /* round to nearest */
-#define ROUND_PLUS_INF 3 /* round to +INF */
-
-typedef union fp_register {
- struct {
- u_int64_t fraction: 52;
- u_int64_t exponent: 11;
- u_int64_t sign: 1;
- } t;
- u_int64_t q;
-} fp_register_t;
-
-fp_register_t
-ieee_add(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_sub(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_mul(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_div(fp_register_t fa, fp_register_t fb,
- int src, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_cmpun(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_cmpeq(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_cmplt(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_cmple(fp_register_t fa, fp_register_t fb, u_int64_t *status);
-
-fp_register_t
-ieee_convert_S_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_T_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_Q_T(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_Q_S(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_T_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
-fp_register_t
-ieee_convert_S_Q(fp_register_t f, int rnd,
- u_int64_t control, u_int64_t *status);
-
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c
index 6010e745d8de9..9390f8fb6b680 100644
--- a/sys/alpha/alpha/interrupt.c
+++ b/sys/alpha/alpha/interrupt.c
@@ -1,4 +1,4 @@
-/* $Id: interrupt.c,v 1.8 1998/11/28 09:55:15 dfr Exp $ */
+/* $Id: interrupt.c,v 1.4 1998/07/12 16:09:27 dfr Exp $ */
/* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */
/*
@@ -50,24 +50,17 @@
#include <machine/bwx.h>
#include <machine/intr.h>
+#if 0
#ifdef EVCNT_COUNTERS
#include <sys/device.h>
struct evcnt clock_intr_evcnt; /* event counter for clock intrs. */
#else
#include <machine/intrcnt.h>
#endif
+#endif
volatile int mc_expected, mc_received;
-static void
-dummy_perf(unsigned long vector, struct trapframe *framep)
-{
- printf("performance interrupt!\n");
-}
-
-void (*perf_irq)(unsigned long, struct trapframe *) = dummy_perf;
-
-
void
interrupt(a0, a1, a2, framep)
unsigned long a0, a1, a2;
@@ -81,9 +74,6 @@ interrupt(a0, a1, a2, framep)
panic("possible stack overflow\n");
}
- framep->tf_regs[FRAME_TRAPARG_A0] = a0;
- framep->tf_regs[FRAME_TRAPARG_A1] = a1;
- framep->tf_regs[FRAME_TRAPARG_A2] = a2;
switch (a0) {
case ALPHA_INTR_XPROC: /* interprocessor interrupt */
printf("interprocessor interrupt!\n");
@@ -91,11 +81,13 @@ interrupt(a0, a1, a2, framep)
case ALPHA_INTR_CLOCK: /* clock interrupt */
cnt.v_intr++;
+#if 0
#ifdef EVCNT_COUNTERS
clock_intr_evcnt.ev_count++;
#else
intrcnt[INTRCNT_CLOCK]++;
#endif
+#endif
if (platform.clockintr)
(*platform.clockintr)(framep);
break;
@@ -115,7 +107,7 @@ interrupt(a0, a1, a2, framep)
break;
case ALPHA_INTR_PERF: /* interprocessor interrupt */
- perf_irq(a1, framep);
+ printf("performance interrupt!\n");
break;
case ALPHA_INTR_PASSIVE:
@@ -285,55 +277,32 @@ badaddr_read(addr, size, rptr)
#define HASHVEC(vector) ((vector) % 31)
-LIST_HEAD(alpha_intr_list, alpha_intr);
-
-struct alpha_intr {
- LIST_ENTRY(alpha_intr) list; /* chain handlers in this hash bucket */
- int vector; /* vector to match */
- driver_intr_t *intr; /* handler function */
- void *arg; /* argument to handler */
- volatile long *cntp; /* interrupt counter */
-};
-
static struct alpha_intr_list alpha_intr_hash[31];
-int alpha_setup_intr(int vector, driver_intr_t *intr, void *arg,
- void **cookiep, volatile long *cntp)
+struct alpha_intr *
+alpha_create_intr(int vector, driver_intr_t *intr, void *arg)
{
- int h = HASHVEC(vector);
struct alpha_intr *i;
- int s;
i = malloc(sizeof(struct alpha_intr), M_DEVBUF, M_NOWAIT);
if (!i)
- return ENOMEM;
+ return NULL;
i->vector = vector;
i->intr = intr;
i->arg = arg;
- if (cntp)
- i->cntp = cntp;
- else
- i->cntp = NULL;
-
- s = splhigh();
- LIST_INSERT_HEAD(&alpha_intr_hash[h], i, list);
- splx(s);
-
- *cookiep = i;
- return 0;
-
+ return i;
}
-int alpha_teardown_intr(void *cookie)
+int
+alpha_connect_intr(struct alpha_intr *i)
{
- struct alpha_intr *i = cookie;
+ int h = HASHVEC(i->vector);
int s;
s = splhigh();
- LIST_REMOVE(i, list);
+ LIST_INSERT_HEAD(&alpha_intr_hash[h], i, list);
splx(s);
-
- free(i, M_DEVBUF);
+
return 0;
}
@@ -341,13 +310,8 @@ void
alpha_dispatch_intr(void *frame, unsigned long vector)
{
struct alpha_intr *i;
- volatile long *cntp;
-
int h = HASHVEC(vector);
for (i = LIST_FIRST(&alpha_intr_hash[h]); i; i = LIST_NEXT(i, list))
- if (i->vector == vector) {
- if (cntp = i->cntp)
- (*cntp) ++;
+ if (i->vector == vector)
i->intr(i->arg);
- }
}
diff --git a/sys/alpha/alpha/ipl_funcs.c b/sys/alpha/alpha/ipl_funcs.c
index 815f7f7edfe1c..ad6670ecbbef7 100644
--- a/sys/alpha/alpha/ipl_funcs.c
+++ b/sys/alpha/alpha/ipl_funcs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ipl_funcs.c,v 1.8 1998/09/26 14:25:32 dfr Exp $
+ * $Id: ipl_funcs.c,v 1.7 1998/09/19 09:29:40 dfr Exp $
*/
#include <sys/types.h>
@@ -40,10 +40,12 @@ unsigned int cam_imask; /* XXX */
unsigned int net_imask; /* XXX */
static void swi_net(void);
+extern void swi_camnet(void);
+extern void swi_cambio(void);
void (*netisrs[32]) __P((void));
swihand_t *ihandlers[32] = { /* software interrupts */
- swi_null, swi_net, swi_null, swi_null,
+ swi_null, swi_net, swi_camnet, swi_cambio,
swi_null, softclock, swi_null, swi_null,
swi_null, swi_null, swi_null, swi_null,
swi_null, swi_null, swi_null, swi_null,
diff --git a/sys/alpha/alpha/locore.s b/sys/alpha/alpha/locore.s
index 9a3acd6b79a78..1a97de23c5313 100644
--- a/sys/alpha/alpha/locore.s
+++ b/sys/alpha/alpha/locore.s
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locore.s,v 1.5 1998/11/15 00:50:59 dima Exp $
+ * $Id: locore.s,v 1.2 1998/06/10 19:59:40 dfr Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -56,11 +56,6 @@
#include <sys/syscall.h>
#include <assym.s>
-#ifndef EVCNT_COUNTERS
-#define _LOCORE
-#include <machine/intrcnt.h>
-#endif
-
/*
* PTmap is recursive pagemap at top of virtual address space.
* Within PTmap, the lev1 and lev0 page tables can be found.
@@ -298,20 +293,3 @@ LEAF(restorefpstate, 1)
.text
-/* XXX: make systat/vmstat happy */
- .data
-EXPORT(intrnames)
- .asciz "clock"
-intr_n = 0
-.rept INTRCNT_COUNT
- .ascii "intr "
- .byte intr_n / 10 + '0, intr_n % 10 + '0
- .asciz " " # space for platform-specific rewrite
- intr_n = intr_n + 1
-.endr
-EXPORT(eintrnames)
- .align 3
-EXPORT(intrcnt)
- .fill INTRCNT_COUNT + 1, 8, 0
-EXPORT(eintrcnt)
- .text
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index 5211879cf128e..6d35e8a4f3713 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: machdep.c,v 1.29 1998/12/30 10:38:58 dfr Exp $
+ * $Id: machdep.c,v 1.17 1998/10/14 10:08:35 peter Exp $
*/
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -124,7 +124,6 @@
#include <machine/clock.h>
#include <machine/md_var.h>
#include <machine/reg.h>
-#include <machine/fpu.h>
#include <machine/pal.h>
#include <machine/cpuconf.h>
#include <machine/bootinfo.h>
@@ -199,8 +198,6 @@ int ncpus; /* number of cpus */
vm_offset_t phys_avail[10];
-SYSCTL_INT(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, "");
-
/* must be 2 less so 0 0 can signal end of chunks */
#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2)
@@ -214,17 +211,6 @@ extern struct linker_set netisr_set;
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-/*
- * Hooked into the shutdown chain; if the system is to be halted,
- * unconditionally drop back to the SRM console.
- */
-static void
-alpha_srm_shutdown(int howto, void *junk)
-{
- if (howto & RB_HALT)
- alpha_pal_halt();
-}
-
static void
cpu_startup(dummy)
void *dummy;
@@ -366,12 +352,6 @@ again:
*/
{
vm_offset_t mb_map_size;
- int xclusters;
-
- /* Allow override of NMBCLUSTERS from the kernel environment */
- if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
- xclusters > nmbclusters)
- nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
@@ -414,8 +394,7 @@ again:
*/
bufinit();
vm_pager_bufferinit();
- at_shutdown_pri(alpha_srm_shutdown, 0, SHUTDOWN_FINAL,
- SHUTDOWN_PRI_LAST);
+
}
int
@@ -490,7 +469,7 @@ alpha_unknown_sysname()
{
static char s[128]; /* safe size */
- snprintf(s, sizeof(s), "%s family, unknown model variation 0x%lx",
+ sprintf(s, "%s family, unknown model variation 0x%lx",
platform.family, hwrpb->rpb_variation & SV_ST_MASK);
return ((const char *)s);
}
@@ -498,21 +477,6 @@ alpha_unknown_sysname()
static void
identifycpu(void)
{
- u_int64_t type, major, minor;
- u_int64_t amask;
- struct pcs *pcsp;
- char *cpuname[] = {
- "unknown", /* 0 */
- "EV3", /* 1 */
- "EV4 (21064)", /* 2 */
- "Simulation", /* 3 */
- "LCA Family", /* 4 */
- "EV5 (21164)", /* 5 */
- "EV45 (21064A)", /* 6 */
- "EV56 (21164A)", /* 7 */
- "EV6 (21264)", /* 8 */
- "PCA56 (21164PC)" /* 9 */
- };
/*
* print out CPU identification information.
@@ -530,32 +494,6 @@ identifycpu(void)
printf("variation: 0x%lx, revision 0x%lx\n",
hwrpb->rpb_variation, *(long *)hwrpb->rpb_revision);
#endif
- pcsp = LOCATE_PCS(hwrpb, hwrpb->rpb_primary_cpu_id);
- /* cpu type */
- type = pcsp->pcs_proc_type;
- major = (type & PCS_PROC_MAJOR) >> PCS_PROC_MAJORSHIFT;
- minor = (type & PCS_PROC_MINOR) >> PCS_PROC_MINORSHIFT;
- if (major < sizeof(cpuname)/sizeof(char *))
- printf("CPU: %s major=%lu minor=%lu",
- cpuname[major], major, minor);
- else
- printf("CPU: major=%lu minor=%lu\n", major, minor);
- /* amask */
- if (major >= PCS_PROC_EV56) {
- amask = 0xffffffff; /* 32 bit for printf */
- amask = (~alpha_amask(amask)) & amask;
- printf(" extensions=0x%b\n", (u_int32_t) amask,
- "\020"
- "\001BWX"
- "\002FIX"
- "\003CIX"
- "\011MVI"
- "\012PRECISE"
- );
- } else
- printf("\n");
- /* PAL code */
- printf("OSF PAL rev: 0x%lx\n", pcsp->pcs_palrevisions[PALvar_OSF1]);
}
extern char kernel_text[], _end[];
@@ -723,7 +661,7 @@ alpha_init(pfn, ptb, bim, bip, biv)
/* NOTREACHED */
}
cpuinit[cputype].init(cputype);
- snprintf(cpu_model, sizeof(cpu_model), "%s", platform.model);
+ strcpy(cpu_model, platform.model);
/*
* Initalize the real console, so the the bootstrap console is
@@ -1091,22 +1029,10 @@ bzero(void *buf, size_t len)
*p++ = 0;
len--;
}
- while (len >= sizeof(u_long) * 8) {
- *(u_long*) p = 0;
- *((u_long*) p + 1) = 0;
- *((u_long*) p + 2) = 0;
- *((u_long*) p + 3) = 0;
- len -= sizeof(u_long) * 8;
- *((u_long*) p + 4) = 0;
- *((u_long*) p + 5) = 0;
- *((u_long*) p + 6) = 0;
- *((u_long*) p + 7) = 0;
- p += sizeof(u_long) * 8;
- }
while (len >= sizeof(u_long)) {
*(u_long*) p = 0;
- len -= sizeof(u_long);
p += sizeof(u_long);
+ len -= sizeof(u_long);
}
while (len) {
*p++ = 0;
@@ -1329,16 +1255,9 @@ sendsig(sig_t catcher, int sig, int mask, u_long code)
ksc.sc_ownedfp = p->p_md.md_flags & MDP_FPUSED;
bcopy(&p->p_addr->u_pcb.pcb_fp, (struct fpreg *)ksc.sc_fpregs,
sizeof(struct fpreg));
- ksc.sc_fp_control = p->p_addr->u_pcb.pcb_fp_control;
+ ksc.sc_fp_control = 0; /* XXX ? */
bzero(ksc.sc_reserved, sizeof ksc.sc_reserved); /* XXX */
- ksc.sc_xxx1[0] = 0; /* XXX */
- ksc.sc_xxx1[1] = 0; /* XXX */
- ksc.sc_traparg_a0 = frame->tf_regs[FRAME_TRAPARG_A0];
- ksc.sc_traparg_a1 = frame->tf_regs[FRAME_TRAPARG_A1];
- ksc.sc_traparg_a2 = frame->tf_regs[FRAME_TRAPARG_A2];
- ksc.sc_xxx2[0] = 0; /* XXX */
- ksc.sc_xxx2[1] = 0; /* XXX */
- ksc.sc_xxx2[2] = 0; /* XXX */
+ bzero(ksc.sc_xxx, sizeof ksc.sc_xxx); /* XXX */
#ifdef COMPAT_OSF1
@@ -1360,7 +1279,8 @@ sendsig(sig_t catcher, int sig, int mask, u_long code)
/*
* Set up the registers to return to sigcode.
*/
- frame->tf_regs[FRAME_PC] = PS_STRINGS - (esigcode - sigcode);
+ frame->tf_regs[FRAME_PC] =
+ (u_int64_t)PS_STRINGS - (esigcode - sigcode);
frame->tf_regs[FRAME_A0] = sig;
frame->tf_regs[FRAME_A1] = code;
frame->tf_regs[FRAME_A2] = (u_int64_t)scp;
@@ -1440,7 +1360,7 @@ sigreturn(struct proc *p,
fpcurproc = NULL;
bcopy((struct fpreg *)ksc.sc_fpregs, &p->p_addr->u_pcb.pcb_fp,
sizeof(struct fpreg));
- p->p_addr->u_pcb.pcb_fp_control = ksc.sc_fp_control;
+ /* XXX ksc.sc_fp_control ? */
#ifdef DEBUG
if (sigdebug & SDB_FOLLOW)
@@ -1466,8 +1386,16 @@ cpu_boot(int howto)
void
cpu_halt(void)
{
- /*alpha_pal_halt(); */
- prom_halt(1);
+ alpha_pal_halt();
+}
+
+/*
+ * Turn the power off.
+ */
+void
+cpu_power_down(void)
+{
+ alpha_pal_halt(); /* XXX */
}
/*
@@ -1480,12 +1408,8 @@ setregs(struct proc *p, u_long entry, u_long stack)
bzero(tfp->tf_regs, FRAME_SIZE * sizeof tfp->tf_regs[0]);
bzero(&p->p_addr->u_pcb.pcb_fp, sizeof p->p_addr->u_pcb.pcb_fp);
- p->p_addr->u_pcb.pcb_fp_control = 0;
- p->p_addr->u_pcb.pcb_fp.fpr_cr = (FPCR_DYN_NORMAL
- | FPCR_INVD | FPCR_DZED
- | FPCR_OVFD | FPCR_INED
- | FPCR_UNFD);
-
+#define FP_RN 2 /* XXX */
+ p->p_addr->u_pcb.pcb_fp.fpr_cr = (long)FP_RN << 58;
alpha_pal_wrusp(stack);
tfp->tf_regs[FRAME_PS] = ALPHA_PSL_USERSET;
tfp->tf_regs[FRAME_PC] = entry & ~3;
@@ -1493,7 +1417,7 @@ setregs(struct proc *p, u_long entry, u_long stack)
tfp->tf_regs[FRAME_A0] = stack; /* a0 = sp */
tfp->tf_regs[FRAME_A1] = 0; /* a1 = rtld cleanup */
tfp->tf_regs[FRAME_A2] = 0; /* a2 = rtld object */
- tfp->tf_regs[FRAME_A3] = PS_STRINGS; /* a3 = ps_strings */
+ tfp->tf_regs[FRAME_A3] = (u_int64_t)PS_STRINGS; /* a3 = ps_strings */
tfp->tf_regs[FRAME_T12] = tfp->tf_regs[FRAME_PC]; /* a.k.a. PV */
p->p_md.md_flags &= ~MDP_FPUSED;
diff --git a/sys/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c
index aa3fcae97094b..f08e7d5b2fc52 100644
--- a/sys/alpha/alpha/mem.c
+++ b/sys/alpha/alpha/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.3 1998/11/08 12:39:01 dfr Exp $
+ * $Id: mem.c,v 1.1 1998/06/10 10:52:54 dfr Exp $
*/
/*
@@ -271,7 +271,7 @@ kmemphys:
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, int prot)
+memmmap(dev_t dev, int offset, int prot)
{
/*
* /dev/mem is the only one that makes sense through this
@@ -400,22 +400,16 @@ iskmemdev(dev)
dev_t dev;
{
- return (((major(dev) == mem_cdevsw.d_maj)
- && (minor(dev) == 0 || minor(dev) == 1))
-/* or the osf/1 mem device */
- ||((major(dev) == 0)
- && (minor(dev) == 0x00200002)));
+ return ((major(dev) == mem_cdevsw.d_maj)
+ && (minor(dev) == 0 || minor(dev) == 1));
}
int
iszerodev(dev)
dev_t dev;
{
- return (((major(dev) == mem_cdevsw.d_maj)
- && minor(dev) == 12)
-/* or the osf/1 zero device */
- ||((major(dev) == 0)
- && (minor(dev) == 0x02600000)));
+ return ((major(dev) == mem_cdevsw.d_maj)
+ && minor(dev) == 12);
}
diff --git a/sys/alpha/alpha/pal.s b/sys/alpha/alpha/pal.s
index 3d179a53042af..36ecdfb22e1c6 100644
--- a/sys/alpha/alpha/pal.s
+++ b/sys/alpha/alpha/pal.s
@@ -348,24 +348,3 @@ LEAF(alpha_pal_swpctx,1)
call_pal PAL_OSF1_swpctx
RET
END(alpha_pal_swpctx)
-
-
-/*
- * alpha_pal_wrperfmon: Write perf monitor [PRIVILEGED]
- *
- * Enables / disables performance monitoring hardware
- *
- * Arguments:
- * a0 function type
- *
- * a1 function parameter
- *
- * Returns:
- * v0 0 (failure) or 1 (success)
- */
-LEAF(alpha_pal_wrperfmon,2)
- call_pal PAL_OSF1_wrperfmon
- RET
- END(alpha_pal_wrperfmon)
-
-
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c
index 0e7aa738c64fc..2f5b4e6bbe056 100644
--- a/sys/alpha/alpha/pmap.c
+++ b/sys/alpha/alpha/pmap.c
@@ -43,7 +43,7 @@
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp
* with some ideas from NetBSD's alpha pmap
- * $Id: pmap.c,v 1.11 1998/10/21 11:38:06 dg Exp $
+ * $Id: pmap.c,v 1.9 1998/08/23 16:05:55 dfr Exp $
*/
/*
@@ -1045,7 +1045,7 @@ pmap_dispose_proc(p)
*(ptek + i) = 0;
pmap_invalidate_page(kernel_pmap,
(vm_offset_t)p->p_addr + i * PAGE_SIZE);
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
vm_page_free(m);
}
}
@@ -1069,7 +1069,8 @@ pmap_swapout_proc(p)
if ((m = vm_page_lookup(upobj, i)) == NULL)
panic("pmap_swapout_proc: upage already missing???");
m->dirty = VM_PAGE_BITS_ALL;
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
+ vm_page_deactivate(m);
pmap_kremove( (vm_offset_t) p->p_addr + PAGE_SIZE * i);
}
}
@@ -1352,8 +1353,6 @@ pmap_release_free_page(pmap_t pmap, vm_page_t p)
}
#endif
- p->wire_count--;
- cnt.v_wire_count--;
vm_page_free_zero(p);
return 1;
}
diff --git a/sys/alpha/alpha/support.s b/sys/alpha/alpha/support.s
index 5b45b49b9501a..1bf8b45156ad6 100644
--- a/sys/alpha/alpha/support.s
+++ b/sys/alpha/alpha/support.s
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: support.s,v 1.2 1998/12/20 13:21:55 dfr Exp $
+ * $Id$
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -64,7 +64,6 @@
*/
LEAF(suword, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -84,7 +83,6 @@
END(suword)
LEAF(subyte, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -109,7 +107,6 @@
END(subyte)
LEAF(fuword, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -128,7 +125,6 @@
END(fuword)
LEAF(fubyte, 1)
- LDGP(pv)
ldiq t0, VM_MAXUSER_ADDRESS /* verify address validity */
cmpult a0, t0, t1
@@ -144,6 +140,7 @@
stq zero, U_PCB_ONFAULT(t2) /* clean up */
+ mov zero, v0
RET
END(fubyte)
diff --git a/sys/alpha/alpha/swtch.s b/sys/alpha/alpha/swtch.s
index ab3f996d6f1ee..90d1bcf6ee873 100644
--- a/sys/alpha/alpha/swtch.s
+++ b/sys/alpha/alpha/swtch.s
@@ -1,4 +1,4 @@
-/* $Id: swtch.s,v 1.6 1998/11/15 18:25:15 dfr Exp $ */
+/* $Id: swtch.s,v 1.4 1998/07/12 16:32:03 dfr Exp $ */
/* $NetBSD: locore.s,v 1.47 1998/03/22 07:26:32 thorpej Exp $ */
/*
@@ -325,17 +325,6 @@ Lsetfpenable:
call_pal PAL_OSF1_wrfen
Lrestoreregs:
- /* set the hae register if this process has specified a value */
- ldq t0, curproc
- beq t0, Lnohae
- ldq t1, P_MD_FLAGS(t0)
- and t1, MDP_HAEUSED
- beq t1, Lnohae
- ldq a0, P_MD_HAE(t0)
- ldq pv, chipset + CHIPSET_WRITE_HAE
- CALL((pv))
-Lnohae:
-
/* restore the registers, and return */
bsr ra, exception_restore_regs /* jmp/CALL trashes pv/t12 */
ldq ra,(FRAME_RA*8)(sp)
diff --git a/sys/alpha/alpha/sys_machdep.c b/sys/alpha/alpha/sys_machdep.c
index 0d89b8fbba967..e0c55dd9df72e 100644
--- a/sys/alpha/alpha/sys_machdep.c
+++ b/sys/alpha/alpha/sys_machdep.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
- * $Id: sys_machdep.c,v 1.2 1998/11/15 18:25:15 dfr Exp $
+ * $Id: sys_machdep.c,v 1.34 1998/03/23 19:52:34 jlemon Exp $
*
*/
@@ -50,12 +50,9 @@
#include <sys/user.h>
#include <machine/cpu.h>
-#include <machine/sysarch.h>
#include <vm/vm_kern.h> /* for kernel_map */
-#include <machine/fpu.h>
-
#ifndef _SYS_SYSPROTO_H_
struct sysarch_args {
int op;
@@ -63,10 +60,6 @@ struct sysarch_args {
};
#endif
-static int alpha_sethae(struct proc *p, char *args);
-static int alpha_get_fpmask(struct proc *p, char *args);
-static int alpha_set_fpmask(struct proc *p, char *args);
-
int
sysarch(p, uap)
struct proc *p;
@@ -75,79 +68,9 @@ sysarch(p, uap)
int error = 0;
switch(SCARG(uap,op)) {
- case ALPHA_SETHAE:
- error = alpha_sethae(p, uap->parms);
- break;
- case ALPHA_GET_FPMASK:
- error = alpha_get_fpmask(p, uap->parms);
- break;
- case ALPHA_SET_FPMASK:
- error = alpha_set_fpmask(p, uap->parms);
- break;
-
default:
error = EINVAL;
break;
}
return (error);
}
-
-struct alpha_sethae_args {
- u_int64_t hae;
-};
-
-static int
-alpha_sethae(struct proc *p, char *args)
-{
- int error;
- struct alpha_sethae_args ua;
-
- if (error = copyin(args, &ua, sizeof(struct alpha_sethae_args)))
- return (error);
-
- if (securelevel > 0)
- return (EPERM);
-
- if (error = suser(p->p_ucred, &p->p_acflag))
- return error;
-
- p->p_md.md_flags |= MDP_HAEUSED;
- p->p_md.md_hae = ua.hae;
-
- return (0);
-}
-
-struct alpha_fpmask_args {
- u_int64_t mask;
-};
-
-static int
-alpha_get_fpmask(struct proc *p, char *args)
-{
- int error;
- struct alpha_fpmask_args ua;
-
- ua.mask = p->p_addr->u_pcb.pcb_fp_control;
- error = copyout(&ua, args, sizeof(struct alpha_fpmask_args));
-
- return (error);
-}
-
-static int
-alpha_set_fpmask(struct proc *p, char *args)
-{
- int error;
- u_int64_t oldmask, *fp_control;
- struct alpha_fpmask_args ua;
-
- if (error = copyin(args, &ua, sizeof(struct alpha_fpmask_args)))
- return (error);
-
- fp_control = &p->p_addr->u_pcb.pcb_fp_control;
- oldmask = *fp_control;
- *fp_control = ua.mask & IEEE_TRAP_ENABLE_MASK;
- ua.mask = oldmask;
-
- error = copyout(&ua, args, sizeof(struct alpha_fpmask_args));
- return (error);
-}
diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c
index 107f1b06a6de9..69442a0cd2e99 100644
--- a/sys/alpha/alpha/trap.c
+++ b/sys/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $Id: trap.c,v 1.9 1998/12/16 15:21:50 bde Exp $ */
+/* $Id: trap.c,v 1.4 1998/07/05 12:24:17 dfr Exp $ */
/* $NetBSD: trap.c,v 1.31 1998/03/26 02:21:46 thorpej Exp $ */
/*
@@ -57,7 +57,6 @@
#include <machine/md_var.h>
#include <machine/reg.h>
#include <machine/pal.h>
-#include <machine/fpu.h>
#ifdef DDB
#include <ddb/ddb.h>
@@ -154,7 +153,7 @@ printtrap(a0, a1, a2, entry, framep, isfatal, user)
entryname = "system call";
break;
default:
- snprintf(ubuf, sizeof(ubuf), "type %lx", entry);
+ sprintf(ubuf, "type %lx", entry);
entryname = (const char *) ubuf;
break;
}
@@ -243,13 +242,11 @@ trap(a0, a1, a2, entry, framep)
case ALPHA_KENTRY_ARITH:
/*
- * If user-land, give a SIGFPE if software completion
- * is not requested or if the completion fails.
+ * If user-land, just give a SIGFPE. Should do
+ * software completion and IEEE handling, if the
+ * user has requested that.
*/
if (user) {
- if (a0 & EXCSUM_SWC)
- if (fp_software_completion(a1, p))
- goto out;
i = SIGFPE;
ucode = a0; /* exception summary */
break;
@@ -419,7 +416,7 @@ trap(a0, a1, a2, entry, framep)
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
- && va < USRSTACK) {
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@@ -450,8 +447,7 @@ trap(a0, a1, a2, entry, framep)
* we need to reflect that as an access error.
*/
if (map != kernel_map &&
- (caddr_t)va >= vm->vm_maxsaddr
- && (caddr_t)va < (caddr_t)USRSTACK) {
+ (caddr_t)va >= vm->vm_maxsaddr) {
if (rv == KERN_SUCCESS) {
unsigned nss;
@@ -497,9 +493,6 @@ trap(a0, a1, a2, entry, framep)
#ifdef DEBUG
printtrap(a0, a1, a2, entry, framep, 1, user);
#endif
- framep->tf_regs[FRAME_TRAPARG_A0] = a0;
- framep->tf_regs[FRAME_TRAPARG_A1] = a1;
- framep->tf_regs[FRAME_TRAPARG_A2] = a2;
trapsignal(p, i, ucode);
out:
if (user) {
@@ -546,14 +539,10 @@ syscall(code, framep)
u_int64_t args[10]; /* XXX */
u_int hidden = 0, nargs;
- framep->tf_regs[FRAME_TRAPARG_A0] = 0;
- framep->tf_regs[FRAME_TRAPARG_A1] = 0;
- framep->tf_regs[FRAME_TRAPARG_A2] = 0;
#if notdef /* can't happen, ever. */
- if ((framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) == 0)
+ if ((framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) == 0) {
panic("syscall");
#endif
-
cnt.v_syscall++;
p = curproc;
p->p_md.md_tf = framep;
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c
index 592a089d11c70..95a41d83feeb9 100644
--- a/sys/alpha/alpha/vm_machdep.c
+++ b/sys/alpha/alpha/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.6 1998/12/16 15:21:50 bde Exp $
+ * $Id: vm_machdep.c,v 1.3 1998/07/12 16:30:58 dfr Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -79,7 +79,6 @@
#include <machine/clock.h>
#include <machine/cpu.h>
-#include <machine/fpu.h>
#include <machine/md_var.h>
#include <machine/prom.h>
@@ -148,17 +147,6 @@ cpu_fork(p1, p2)
p2->p_addr->u_pcb.pcb_hw.apcb_usp = alpha_pal_rdusp();
/*
- * Set the floating point state.
- */
- if ((p2->p_addr->u_pcb.pcb_fp_control & IEEE_INHERIT) == 0) {
- p2->p_addr->u_pcb.pcb_fp_control = 0;
- p2->p_addr->u_pcb.pcb_fp.fpr_cr = (FPCR_DYN_NORMAL
- | FPCR_INVD | FPCR_DZED
- | FPCR_OVFD | FPCR_INED
- | FPCR_UNFD);
- }
-
- /*
* Arrange for a non-local goto when the new process
* is started, to resume here, returning nonzero from setjmp.
*/
@@ -378,10 +366,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
- if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
- return (1);
+ if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= (size_t) USRSTACK)
+ return (1);
- nss = roundup(USRSTACK - sp, PAGE_SIZE);
+ nss = roundup(USRSTACK - (vm_offset_t)sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);
diff --git a/sys/alpha/conf/GENERIC b/sys/alpha/conf/GENERIC
index 6c84ce866ba61..e09424cc1f9c2 100644
--- a/sys/alpha/conf/GENERIC
+++ b/sys/alpha/conf/GENERIC
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC,v 1.13 1998/12/29 03:59:49 gpalmer Exp $
+# $Id: GENERIC,v 1.9 1998/10/13 21:38:46 jkh Exp $
machine "alpha"
cpu "EV4"
@@ -22,7 +22,6 @@ maxusers 10
# Platforms supported
options "DEC_AXPPCI_33" # UDB, Multia, AXPpci33, Noname
options "DEC_EB164" # EB164, PC164, PC164LX, PC164SX
-options "DEC_EB64PLUS" # EB64+, Aspen Alpine, etc
options "DEC_2100_A50" # AlphaStation 200, 250, 255, 400
options "DEC_KN20AA" # AlphaStation 500, 600
options "DEC_ST550" # Personal Workstation 433, 500, 600
@@ -89,7 +88,6 @@ device sio1 at isa0 port "IO_COM2" irq 3 flags 0x50
# Right now it appears that the ie0 must be probed before ep0. See
# revision 1.20 of this file.
device de0
-device fxp0
device le0
pseudo-device loop
diff --git a/sys/alpha/conf/Makefile.alpha b/sys/alpha/conf/Makefile.alpha
index 99f61697f914a..d9b783c910603 100644
--- a/sys/alpha/conf/Makefile.alpha
+++ b/sys/alpha/conf/Makefile.alpha
@@ -1,7 +1,7 @@
# Makefile.alpha -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.alpha 7.1 5/10/91
-# $Id: Makefile.alpha,v 1.15 1998/12/17 22:36:21 dfr Exp $
+# $Id: Makefile.alpha,v 1.9 1998/09/16 08:22:09 dfr Exp $
#
# Makefile for FreeBSD
#
@@ -17,7 +17,7 @@
#
# Which version of config(8) is required.
-%VERSREQ= 300009
+%VERSREQ= 300007
BINFORMAT?= elf
@@ -41,8 +41,8 @@ INCLUDES+= -I$S/../include
.else
INCLUDES+= -I/usr/include
.endif
-COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h
-CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
+COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h -U__NetBSD__
+CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} -mno-fp-regs -Wa,-mev56
LOAD_ADDRESS?= 0xfffffc0000300000
DEFINED_PROF= ${PROF}
.if defined(PROF)
@@ -78,7 +78,7 @@ SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
.if ${BINFORMAT} == elf
SYSTEM_OBJS= locore.o setdef0.o vnode_if.o \
${OBJS} ioconf.o param.o config.o \
- setdef1.o hack.So
+ setdef1.o hack.so
SYSTEM_LD= @${LD} --export-dynamic -T$S/alpha/conf/kernel.script -e locorestart \
-o $@ -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
@@ -98,10 +98,6 @@ SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
%CLEAN
-.if !exists(.depend)
-${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h}
-.endif
-
clean:
rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \
makelinks param.c setdefs.h symbols.exclude symbols.sort tags \
@@ -124,9 +120,9 @@ symbols.sort: ${ALPHA}/alpha/symbols.raw
locore.o: ${ALPHA}/alpha/locore.s assym.s
${NORMAL_S}
-hack.So: Makefile
+hack.so: Makefile
echo "void __elf_kld_hack() {}" > hack.c
- ${CC} -shared -nostdlib hack.c -o hack.So
+ ${CC} -shared -nostdlib hack.c -o hack.so
rm -f hack.c
setdef0.o: ${ALPHA}/alpha/setdef0.c setdefs.h
diff --git a/sys/alpha/conf/files.alpha b/sys/alpha/conf/files.alpha
index 6c6d2b598bb8c..d38c396d9a2fb 100644
--- a/sys/alpha/conf/files.alpha
+++ b/sys/alpha/conf/files.alpha
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $Id: files.alpha,v 1.14 1998/12/04 10:52:47 dfr Exp $
+# $Id: files.alpha,v 1.10 1998/09/17 09:38:36 dfr Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -19,7 +19,6 @@ alpha/alpha/cpuconf.c standard
alpha/alpha/atomic.s standard
alpha/alpha/dec_kn8ae.c optional dec_kn8ae
alpha/alpha/dec_eb164.c optional dec_eb164
-alpha/alpha/dec_eb64plus.c optional dec_eb64plus
alpha/alpha/dec_kn20aa.c optional dec_kn20aa
alpha/alpha/dec_2100_a50.c optional dec_2100_a50
alpha/alpha/dec_st550.c optional dec_st550
@@ -44,8 +43,7 @@ alpha/alpha/in_cksum.c optional inet
# now normal.
# alpha/alpha/locore.s standard
alpha/alpha/machdep.c standard
-alpha/alpha/fp_emulate.c standard
-alpha/alpha/ieee_float.c standard
+alpha/alpha/math_emulate.c optional math_emulate
alpha/alpha/mem.c standard
alpha/alpha/mp_machdep.c optional smp
alpha/alpha/perfmon.c optional perfmon profiling-routine
@@ -66,13 +64,13 @@ clock_if.o standard \
compile-with "${NORMAL_C}" \
no-implicit-rule local
clock_if.c standard \
- dependency "$S/kern/makedevops.pl $S/alpha/alpha/clock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -c $S/alpha/alpha/clock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/alpha/alpha/clock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/alpha/alpha/clock_if.m" \
no-obj no-implicit-rule before-depend local \
clean "clock_if.c"
clock_if.h standard \
- dependency "$S/kern/makedevops.pl $S/alpha/alpha/clock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -h $S/alpha/alpha/clock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/alpha/alpha/clock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/alpha/alpha/clock_if.m" \
no-obj no-implicit-rule before-depend \
clean "clock_if.h"
alpha/alpha/diskslice_machdep.c standard
@@ -98,23 +96,23 @@ mcclock_if.o standard \
compile-with "${NORMAL_C}" \
no-implicit-rule local
mcclock_if.c standard \
- dependency "$S/kern/makedevops.pl $S/dev/dec/mcclock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -c $S/dev/dec/mcclock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/dec/mcclock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/dev/dec/mcclock_if.m" \
no-obj no-implicit-rule before-depend local \
clean "mcclock_if.c"
mcclock_if.h standard \
- dependency "$S/kern/makedevops.pl $S/dev/dec/mcclock_if.m" \
- compile-with "perl $S/kern/makedevops.pl -h $S/dev/dec/mcclock_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/dec/mcclock_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/dev/dec/mcclock_if.m" \
no-obj no-implicit-rule before-depend \
clean "mcclock_if.h"
alpha/pci/cia.c optional cia
alpha/pci/pci_eb164_intr.s optional cia
+alpha/isa/mcclock_isa.c optional cia
alpha/pci/apecs.c optional apecs
-alpha/pci/pci_eb64plus_intr.s optional apecs
alpha/pci/lca.c optional lca
alpha/pci/pcibus.c optional pci
alpha/isa/isa.c optional isa
-alpha/isa/mcclock_isa.c optional isa
+kern/link_elf.c standard
alpha/alpha/elf_machdep.c standard
libkern/bcd.c standard
libkern/bcmp.c standard
diff --git a/sys/alpha/conf/majors.alpha b/sys/alpha/conf/majors.alpha
index adecadb7ad6ed..7766f077b5262 100644
--- a/sys/alpha/conf/majors.alpha
+++ b/sys/alpha/conf/majors.alpha
@@ -1,4 +1,4 @@
-$Id: majors.alpha,v 1.6 1999/01/14 03:47:52 msmith Exp $
+$Id: majors.alpha,v 1.1 1998/06/10 10:54:12 dfr Exp $
Hopefully, this list will one day be obsoleted by DEVFS, but for now
this is the current allocation of device major numbers.
@@ -125,7 +125,7 @@ chrdev name comments
81 rp RocketPort/Steve Gericke <steveg@comtrol.com>
82 ppi Generic Parallel I/O <Nicolas.Souchu@prism.uvsq.fr>
83 can CAN16-2 CAN-PC Interface
-84 dtfp Datum Time and Frequency processor (louie@UU.NET)
+84 ttxt Unitext teletext decoder (arg@arg1.demon.co.uk)
85 vesa VESA support device (j_mini@efn.org)
86 alog Industrial Computer Source AIO8-P driver
87 wfd ATAPI floppy client of "ata"
@@ -140,6 +140,3 @@ chrdev name comments
96 altq alternate queueing (including cbq, red, wfq)
97 prom Alpha PROM console
98 zsc TurboLaser console uart
-99 ipr Iprobe on-chip perf. counters (gallatin@freebsd.org)
-110 ses SCSI Environmental Services driver (mjacob@feral.com)
-112 kbd keyboard
diff --git a/sys/alpha/conf/options.alpha b/sys/alpha/conf/options.alpha
index 44add990c1fe5..a0a559057dac1 100644
--- a/sys/alpha/conf/options.alpha
+++ b/sys/alpha/conf/options.alpha
@@ -1,10 +1,9 @@
-# $Id: options.alpha,v 1.7 1998/09/16 08:22:09 dfr Exp $
+# $Id: options.alpha,v 1.6 1998/08/21 23:43:15 gpalmer Exp $
EV5 opt_global.h
EV4 opt_global.h
DEC_KN8AE opt_cpu.h
DEC_EB164 opt_cpu.h
-DEC_EB64PLUS opt_cpu.h
DEC_KN20AA opt_cpu.h
DEC_2100_A50 opt_cpu.h
DEC_ST550 opt_cpu.h
diff --git a/sys/alpha/include/alpha_cpu.h b/sys/alpha/include/alpha_cpu.h
index 80eb3078a309c..5107274ff18b3 100644
--- a/sys/alpha/include/alpha_cpu.h
+++ b/sys/alpha/include/alpha_cpu.h
@@ -1,4 +1,4 @@
-/* $Id: alpha_cpu.h,v 1.4 1998/12/23 11:50:50 dfr Exp $ */
+/* $Id: alpha_cpu.h,v 1.2 1998/06/10 10:54:21 dfr Exp $ */
/* From: NetBSD: alpha_cpu.h,v 1.15 1997/09/20 19:02:34 mjacob Exp */
/*
@@ -273,10 +273,8 @@ typedef unsigned long alpha_pt_entry_t;
*/
#define ALPHA_AMASK_BWX 0x0001 /* byte/word extension */
-#define ALPHA_AMASK_FIX 0x0002 /* sqrt and f <-> i conversion extension */
-#define ALPHA_AMASK_CIX 0x0004 /* count extension */
-#define ALPHA_AMASK_MVI 0x0100 /* multimedia extension */
-#define ALPHA_AMASK_PRECISE 0x0200 /* Precise arithmetic traps */
+#define ALPHA_AMASK_CIX 0x0002 /* count extension */
+#define ALPHA_AMASK_MAX 0x0100 /* multimedia extension */
/*
* Chip family IDs returned by implver instruction
@@ -326,6 +324,5 @@ void alpha_pal_wrusp __P((unsigned long));
void alpha_pal_wrvptptr __P((unsigned long));
void alpha_pal_wrmces __P((unsigned long));
void alpha_pal_wrval __P((unsigned long));
-unsigned long alpha_pal_wrperfmon __P((unsigned long, unsigned long));
#endif /* __ALPHA_ALPHA_CPU_H__ */
diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h
index 09413e7d49f04..aeaba523e6853 100644
--- a/sys/alpha/include/ansi.h
+++ b/sys/alpha/include/ansi.h
@@ -1,4 +1,4 @@
-/* $Id: ansi.h,v 1.3 1998/10/12 23:57:58 alex Exp $ */
+/* $Id: ansi.h,v 1.2 1998/03/09 05:53:07 jb Exp $ */
/* From: NetBSD: ansi.h,v 1.9 1997/11/23 20:20:53 kleink Exp */
/*-
@@ -63,6 +63,9 @@ typedef struct {
#define _BSD_TIMER_T_ int /* timer_t */
#define _BSD_SUSECONDS_T_ int /* suseconds_t */
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
+#define _BSD_UINT8_T_ unsigned char /* uint8_t */
+#define _BSD_UINT16_T_ unsigned short /* uint16_t */
+#define _BSD_UINT32_T_ unsigned int /* uint32_t */
/*
* Types which are fundamental to the implementation and must be used
@@ -105,20 +108,4 @@ typedef struct {
#define _BSD_CLK_TCK_ 100
#define _BSD_CLOCKS_PER_SEC_ 100
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-typedef long __int64_t;
-typedef unsigned long __uint64_t;
-
-typedef long __intptr_t;
-typedef unsigned long __uintptr_t;
-
#endif /* _ANSI_H_ */
diff --git a/sys/alpha/include/chipset.h b/sys/alpha/include/chipset.h
index f7a61be4c1f28..74698c5c5a9ab 100644
--- a/sys/alpha/include/chipset.h
+++ b/sys/alpha/include/chipset.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: chipset.h,v 1.5 1998/10/06 14:18:39 dfr Exp $
+ * $Id: chipset.h,v 1.4 1998/08/10 07:53:58 dfr Exp $
*/
#ifndef _MACHINE_CHIPSET_H_
@@ -54,8 +54,7 @@ typedef void alpha_chipset_cfgwritew_t(u_int, u_int, u_int, u_int,
typedef void alpha_chipset_cfgwritel_t(u_int, u_int, u_int, u_int,
u_int32_t);
typedef vm_offset_t alpha_chipset_addrcvt_t(vm_offset_t);
-typedef u_int64_t alpha_chipset_read_hae_t(void);
-typedef void alpha_chipset_write_hae_t(u_int64_t);
+
typedef struct alpha_chipset {
/*
@@ -92,14 +91,8 @@ typedef struct alpha_chipset {
/*
* PCI address space translation functions
*/
- alpha_chipset_addrcvt_t* cvt_to_dense;
- alpha_chipset_addrcvt_t* cvt_to_bwx;
-
- /*
- * Access the HAE register
- */
- alpha_chipset_read_hae_t* read_hae;
- alpha_chipset_write_hae_t* write_hae;
+ alpha_chipset_addrcvt_t* cvt_to_dense;
+ alpha_chipset_addrcvt_t* cvt_to_bwx;
/*
* PCI interrupt device.
@@ -111,14 +104,4 @@ typedef struct alpha_chipset {
extern alpha_chipset_t chipset;
-/*
- * Exported sysctl variables describing the PCI chipset.
- */
-extern char chipset_type[10];
-extern int chipset_bwx;
-extern long chipset_ports;
-extern long chipset_memory;
-extern long chipset_dense;
-extern long chipset_hae_mask;
-
#endif /* !_MACHINE_CHIPSET_H_ */
diff --git a/sys/alpha/include/console.h b/sys/alpha/include/console.h
index 52ef8d1649df8..d74797622648f 100644
--- a/sys/alpha/include/console.h
+++ b/sys/alpha/include/console.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: console.h,v 1.40 1998/09/17 09:38:36 dfr Exp $
+ * $Id: console.h,v 1.39 1998/08/06 09:15:52 dfr Exp $
* from: i386/include console.h,v 1.39
*/
@@ -304,7 +304,7 @@ struct video_info {
int vi_flags;
#define V_INFO_COLOR (1<<0)
#define V_INFO_GRAPHICS (1<<1)
-#define V_INFO_LINEAR (1<<2)
+#define V_INFO_LENEAR (1<<2)
#define V_INFO_VESA (1<<3)
int vi_width;
int vi_height;
diff --git a/sys/alpha/include/fpu.h b/sys/alpha/include/fpu.h
deleted file mode 100644
index c9efceed02930..0000000000000
--- a/sys/alpha/include/fpu.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: fpu.h,v 1.1 1998/12/04 10:52:48 dfr Exp $
- */
-
-#ifndef _MACHINE_FPU_H_
-#define _MACHINE_FPU_H_
-
-/*
- * Floating point control register bits.
- *
- * From Alpha AXP Architecture Reference Manual, Instruction
- * Descriptions (I) PP 4-69.
- */
-
-#define FPCR_INVD (1LL << 49) /* Invalid Operation DIsable */
-#define FPCR_DZED (1LL << 50) /* Division by Zero Disable */
-#define FPCR_OVFD (1LL << 51) /* Overflow Disable */
-#define FPCR_INV (1LL << 52) /* Invalid Operation */
-#define FPCR_DZE (1LL << 53) /* Division by Zero */
-#define FPCR_OVF (1LL << 54) /* Overflow */
-#define FPCR_UNF (1LL << 55) /* Underflow */
-#define FPCR_INE (1LL << 56) /* Inexact Result */
-#define FPCR_IOV (1LL << 57) /* Integer Overflow */
-#define FPCR_DYN_CHOPPED (0LL << 58) /* Chopped rounding mode */
-#define FPCR_DYN_MINUS (1LL << 58) /* Minus infinity */
-#define FPCR_DYN_NORMAL (2LL << 58) /* Normal rounding */
-#define FPCR_DYN_PLUS (3LL << 58) /* Plus infinity */
-#define FPCR_DYN_MASK (3LL << 58) /* Rounding mode mask */
-#define FPCR_DYN_SHIFT 58
-#define FPCR_UNDZ (1LL << 60) /* Underflow to Zero */
-#define FPCR_UNFD (1LL << 61) /* Underflow Disable */
-#define FPCR_INED (1LL << 62) /* Inexact Disable */
-#define FPCR_SUM (1LL << 63) /* Summary Bit */
-#define FPCR_MASK (~0LL << 49)
-
-/*
- * Exception summary bits.
- *
- * From Alpha AXP Architecture Reference Manual, DEC OSF/1 Exceptions
- * and Interrupts (II-B) PP 5-5.
- */
-
-#define EXCSUM_SWC (1LL << 0) /* Software completion */
-#define EXCSUM_INV (1LL << 1) /* Invalid operation */
-#define EXCSUM_DZE (1LL << 2) /* Division by zero */
-#define EXCSUM_OVF (1LL << 3) /* Overflow */
-#define EXCSUM_UNF (1LL << 4) /* Underflow */
-#define EXCSUM_INE (1LL << 5) /* Inexact result */
-#define EXCSUM_IOV (1LL << 6) /* Integer overflow */
-
-/*
- * Definitions for IEEE trap enables. These are implemented in
- * software and should be compatible with OSF/1 and Linux.
- */
-
-/* read/write flags */
-#define IEEE_TRAP_ENABLE_INV (1LL << 1) /* Invalid operation */
-#define IEEE_TRAP_ENABLE_DZE (1LL << 2) /* Division by zero */
-#define IEEE_TRAP_ENABLE_OVF (1LL << 3) /* Overflow */
-#define IEEE_TRAP_ENABLE_UNF (1LL << 4) /* Underflow */
-#define IEEE_TRAP_ENABLE_INE (1LL << 5) /* Inexact result */
-#define IEEE_TRAP_ENABLE_MASK (IEEE_TRAP_ENABLE_INV \
- | IEEE_TRAP_ENABLE_DZE \
- | IEEE_TRAP_ENABLE_OVF \
- | IEEE_TRAP_ENABLE_UNF \
- | IEEE_TRAP_ENABLE_INE)
-
-/* read only flags */
-#define IEEE_STATUS_INV (1LL << 17) /* Invalid operation */
-#define IEEE_STATUS_DZE (1LL << 18) /* Division by zero */
-#define IEEE_STATUS_OVF (1LL << 19) /* Overflow */
-#define IEEE_STATUS_UNF (1LL << 20) /* Underflow */
-#define IEEE_STATUS_INE (1LL << 21) /* Inexact result */
-#define IEEE_STATUS_MASK (IEEE_STATUS_INV \
- | IEEE_STATUS_DZE \
- | IEEE_STATUS_OVF \
- | IEEE_STATUS_UNF \
- | IEEE_STATUS_INE)
-#define IEEE_STATUS_TO_EXCSUM_SHIFT 16 /* convert to excsum */
-#define IEEE_STATUS_TO_FPCR_SHIFT 35 /* convert to fpcr */
-
-#define IEEE_INHERIT (1LL << 63) /* inherit on fork */
-
-/* read and write floating point control register */
-#define GET_FPCR(x) \
- __asm__("trapb"); \
- __asm__("mf_fpcr %0" : "=f" (x)); \
- __asm__("trapb")
-#define SET_FPCR(x) \
- __asm__("trapb"); \
- __asm__("mt_fpcr %0" : : "f" (x)); \
- __asm__("trapb")
-
-#ifdef KERNEL
-
-extern int fp_software_completion(u_int64_t regmask, struct proc *p);
-
-#endif
-
-#endif /* ! _MACHINE_FPU_H_ */
diff --git a/sys/alpha/include/frame.h b/sys/alpha/include/frame.h
index 8af1d71625176..19aaef68ea8db 100644
--- a/sys/alpha/include/frame.h
+++ b/sys/alpha/include/frame.h
@@ -1,4 +1,4 @@
-/* $Id: frame.h,v 1.1 1998/01/10 10:13:14 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: frame.h,v 1.4 1997/04/06 08:47:27 cgd Exp */
/*
@@ -47,39 +47,35 @@
*/
/* Quadword offsets of the registers to be saved. */
-#define FRAME_V0 0
-#define FRAME_T0 1
-#define FRAME_T1 2
-#define FRAME_T2 3
-#define FRAME_T3 4
-#define FRAME_T4 5
-#define FRAME_T5 6
-#define FRAME_T6 7
-#define FRAME_T7 8
-#define FRAME_S0 9
-#define FRAME_S1 10
-#define FRAME_S2 11
-#define FRAME_S3 12
-#define FRAME_S4 13
-#define FRAME_S5 14
-#define FRAME_S6 15
-#define FRAME_A3 16
-#define FRAME_A4 17
-#define FRAME_A5 18
-#define FRAME_T8 19
-#define FRAME_T9 20
-#define FRAME_T10 21
-#define FRAME_T11 22
-#define FRAME_RA 23
-#define FRAME_T12 24
-#define FRAME_AT 25
-#define FRAME_SP 26
-/* The following are set only when a signal is to be delivered to a process. */
-#define FRAME_TRAPARG_A0 27
-#define FRAME_TRAPARG_A1 28
-#define FRAME_TRAPARG_A2 29
+#define FRAME_V0 0
+#define FRAME_T0 1
+#define FRAME_T1 2
+#define FRAME_T2 3
+#define FRAME_T3 4
+#define FRAME_T4 5
+#define FRAME_T5 6
+#define FRAME_T6 7
+#define FRAME_T7 8
+#define FRAME_S0 9
+#define FRAME_S1 10
+#define FRAME_S2 11
+#define FRAME_S3 12
+#define FRAME_S4 13
+#define FRAME_S5 14
+#define FRAME_S6 15
+#define FRAME_A3 16
+#define FRAME_A4 17
+#define FRAME_A5 18
+#define FRAME_T8 19
+#define FRAME_T9 20
+#define FRAME_T10 21
+#define FRAME_T11 22
+#define FRAME_RA 23
+#define FRAME_T12 24
+#define FRAME_AT 25
+#define FRAME_SP 26
-#define FRAME_SW_SIZE (FRAME_TRAPARG_A2 + 1)
+#define FRAME_SW_SIZE (FRAME_SP + 1)
#define FRAME_HW_OFFSET FRAME_SW_SIZE
#define FRAME_PS (FRAME_HW_OFFSET + ALPHA_HWFRAME_PS)
diff --git a/sys/alpha/include/ieeefp.h b/sys/alpha/include/ieeefp.h
index a838e98919553..c0f4c2f4035c8 100644
--- a/sys/alpha/include/ieeefp.h
+++ b/sys/alpha/include/ieeefp.h
@@ -1,4 +1,4 @@
-/* $Id: ieeefp.h,v 1.1.1.1 1998/03/09 05:43:16 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: ieeefp.h,v 1.2 1997/04/06 08:47:28 cgd Exp */
/*
@@ -10,14 +10,12 @@
#define _ALPHA_IEEEFP_H_
typedef int fp_except;
-#define FP_X_INV (1LL << 1) /* invalid operation exception */
-#define FP_X_DZ (1LL << 2) /* divide-by-zero exception */
-#define FP_X_OFL (1LL << 3) /* overflow exception */
-#define FP_X_UFL (1LL << 4) /* underflow exception */
-#define FP_X_IMP (1LL << 5) /* imprecise(inexact) exception */
-#if 0
-#define FP_X_IOV (1LL << 6) /* integer overflow XXX? */
-#endif
+#define FP_X_INV 0x01 /* invalid operation exception */
+#define FP_X_DZ 0x02 /* divide-by-zero exception */
+#define FP_X_OFL 0x04 /* overflow exception */
+#define FP_X_UFL 0x08 /* underflow exception */
+#define FP_X_IMP 0x10 /* imprecise (loss of precision; "inexact") */
+#define FP_X_IOV 0x20 /* integer overflow XXX? */
typedef enum {
FP_RZ=0, /* round to zero (truncate) */
diff --git a/sys/alpha/include/inst.h b/sys/alpha/include/inst.h
deleted file mode 100644
index 27011848b1757..0000000000000
--- a/sys/alpha/include/inst.h
+++ /dev/null
@@ -1,462 +0,0 @@
-/*-
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-#ifndef _MACHINE_INST_H_
-#define _MACHINE_INST_H_
-
-union alpha_instruction {
- u_int32_t word;
- struct {
- u_int32_t argument : 26;
- u_int32_t opcode : 6;
-#define op_call_pal 0x00
-#define op_lda 0x08
-#define op_ldah 0x09
-#define op_ldbu 0x0a
-#define op_unop 0x0b
-#define op_ldq_u 0x0b
-#define op_ldwu 0x0c
-#define op_stw 0x0d
-#define op_stb 0x0e
-#define op_stq_u 0x0f
-#define op_inta 0x10
-#define inta_addl 0x00
-#define inta_s4addl 0x02
-#define inta_subl 0x09
-#define inta_s4subl 0x0b
-#define inta_cmpbge 0x0f
-#define inta_s8addl 0x12
-#define inta_s8subl 0x1b
-#define inta_cmpult 0x1d
-#define inta_addq 0x20
-#define inta_s4addq 0x22
-#define inta_subq 0x29
-#define inta_s4subq 0x2b
-#define inta_cmpeq 0x2d
-#define inta_s8addq 0x32
-#define inta_s8subq 0x3b
-#define inta_cmpule 0x3d
-#define inta_addlv 0x40
-#define inta_sublv 0x49
-#define inta_cmplt 0x4d
-#define inta_addqv 0x60
-#define inta_subqv 0x69
-#define inta_cmple 0x6d
-#define op_intl 0x11
-#define intl_and 0x00
-#define intl_andnot 0x08
-#define intl_bic 0x08
-#define intl_cmovlbs 0x14
-#define intl_cmovlbc 0x16
-#define intl_or 0x20
-#define intl_bis 0x20
-#define intl_cmoveq 0x24
-#define intl_cmovne 0x26
-#define intl_ornot 0x28
-#define intl_xor 0x40
-#define intl_cmovlt 0x44
-#define intl_cmovge 0x46
-#define intl_eqv 0x48
-#define intl_amask 0x61
-#define intl_cmovle 0x64
-#define intl_cmovgt 0x66
-#define intl_implver 0x6c
-#define op_ints 0x12
-#define ints_mskbl 0x02
-#define ints_extbl 0x06
-#define ints_insbl 0x0b
-#define ints_mskwl 0x12
-#define ints_extwl 0x16
-#define ints_inswl 0x1b
-#define ints_mskll 0x22
-#define ints_extll 0x26
-#define ints_insll 0x2b
-#define ints_zap 0x30
-#define ints_zapnot 0x31
-#define ints_mskql 0x32
-#define ints_srl 0x34
-#define ints_extql 0x36
-#define ints_sll 0x39
-#define ints_insql 0x3b
-#define ints_sra 0x3c
-#define ints_mskwh 0x52
-#define ints_inswh 0x57
-#define ints_extwh 0x5a
-#define ints_msklh 0x62
-#define ints_inslh 0x67
-#define ints_extlh 0x6a
-#define ints_mskqh 0x72
-#define ints_insqh 0x77
-#define ints_extqh 0x7a
-#define op_intm 0x13
-#define intm_mull 0x00
-#define intm_mulq 0x20
-#define intm_umulh 0x30
-#define intm_mullv 0x40
-#define intm_mulqv 0x60
-#define op_opc14 0x14
-#define op_fltv 0x15
-#define op_flti 0x16
-#define flti_addsc 0x000
-#define flti_subsc 0x001
-#define flti_mulsc 0x002
-#define flti_divsc 0x003
-#define flti_addtc 0x020
-#define flti_subtc 0x021
-#define flti_multc 0x022
-#define flti_divtc 0x023
-#define flti_cvttsc 0x02c
-#define flti_cvttqc 0x02f
-#define flti_cvtqsc 0x03c
-#define flti_cvtqtc 0x03e
-
-#define flti_addsm 0x040
-#define flti_subsm 0x041
-#define flti_mulsm 0x042
-#define flti_divsm 0x043
-#define flti_addtm 0x060
-#define flti_subtm 0x061
-#define flti_multm 0x062
-#define flti_divtm 0x063
-#define flti_cvttsm 0x06c
-#define flti_cvttqm 0x06f
-#define flti_cvtqsm 0x07c
-#define flti_cvtqtm 0x07e
-
-#define flti_adds 0x080
-#define flti_subs 0x081
-#define flti_muls 0x082
-#define flti_divs 0x083
-
-#define flti_addt 0x0a0
-#define flti_subt 0x0a1
-#define flti_mult 0x0a2
-#define flti_divt 0x0a3
-#define flti_cmptun 0x0a4
-#define flti_cmpteq 0x0a5
-#define flti_cmptlt 0x0a6
-#define flti_cmptle 0x0a7
-#define flti_cvtts 0x0ac
-#define flti_cvttq 0x0af
-#define flti_cvtqs 0x0bc
-#define flti_cvtqt 0x0be
-
-#define flti_addsd 0x0c0
-#define flti_subsd 0x0c1
-#define flti_mulsd 0x0c2
-#define flti_divsd 0x0c3
-#define flti_addtd 0x0e0
-#define flti_subtd 0x0e1
-#define flti_multd 0x0e2
-#define flti_divtd 0x0e3
-#define flti_cvttsd 0x0ec
-#define flti_cvttqd 0x0ef
-#define flti_cvtqsd 0x0fc
-#define flti_cvtqtd 0x0fe
-
-#define flti_addsuc 0x100
-#define flti_subsuc 0x101
-#define flti_mulsuc 0x102
-#define flti_divsuc 0x103
-#define flti_addtuc 0x120
-#define flti_subtuc 0x121
-#define flti_multuc 0x122
-#define flti_divtuc 0x123
-#define flti_cvttsuc 0x12c
-#define flti_cvttqvc 0x12f
-
-#define flti_addsum 0x140
-#define flti_subsum 0x141
-#define flti_mulsum 0x142
-#define flti_divsum 0x143
-#define flti_addtum 0x160
-#define flti_subtum 0x161
-#define flti_multum 0x162
-#define flti_divtum 0x163
-#define flti_cvttsum 0x16c
-#define flti_cvttqvm 0x16f
-
-#define flti_addsu 0x180
-#define flti_subsu 0x181
-#define flti_mulsu 0x182
-#define flti_divsu 0x183
-#define flti_addtu 0x1a0
-#define flti_subtu 0x1a1
-#define flti_multu 0x1a2
-#define flti_divtu 0x1a3
-#define flti_cvttsu 0x1ac
-#define flti_cvttqv 0x1af
-
-#define flti_addsud 0x1c0
-#define flti_subsud 0x1c1
-#define flti_mulsud 0x1c2
-#define flti_divsud 0x1c3
-#define flti_addtud 0x1e0
-#define flti_subtud 0x1e1
-#define flti_multud 0x1e2
-#define flti_divtud 0x1e3
-#define flti_cvttsud 0x1ec
-#define flti_cvttqvd 0x1ef
-
-#define flti_cvtst 0x2ac
-
-#define flti_addssuc 0x500
-#define flti_subssuc 0x501
-#define flti_mulssuc 0x502
-#define flti_divssuc 0x503
-#define flti_addtsuc 0x520
-#define flti_subtsuc 0x521
-#define flti_multsuc 0x522
-#define flti_divtsuc 0x523
-#define flti_cvttssuc 0x52c
-#define flti_cvttqsvc 0x52f
-
-#define flti_addssum 0x540
-#define flti_subssum 0x541
-#define flti_mulssum 0x542
-#define flti_divssum 0x543
-#define flti_addtsum 0x560
-#define flti_subtsum 0x561
-#define flti_multsum 0x562
-#define flti_divtsum 0x563
-#define flti_cvttssum 0x56c
-#define flti_cvttqsvm 0x56f
-
-#define flti_addssu 0x580
-#define flti_subssu 0x581
-#define flti_mulssu 0x582
-#define flti_divssu 0x583
-#define flti_addtsu 0x5a0
-#define flti_subtsu 0x5a1
-#define flti_multsu 0x5a2
-#define flti_divtsu 0x5a3
-#define flti_cmptunsu 0x5a4
-#define flti_cmpteqsu 0x5a5
-#define flti_cmptltsu 0x5a6
-#define flti_cmptlesu 0x5a7
-#define flti_cvttssu 0x5ac
-#define flti_cvttqsv 0x5af
-
-#define flti_addssud 0x5c0
-#define flti_subssud 0x5c1
-#define flti_mulssud 0x5c2
-#define flti_divssud 0x5c3
-#define flti_addtsud 0x5e0
-#define flti_subtsud 0x5e1
-#define flti_multsud 0x5e2
-#define flti_divtsud 0x5e3
-#define flti_cvttssud 0x5ec
-#define flti_cvttqsvd 0x5ef
-
-#define flti_cvtsts 0x6ac
-
-#define flti_addssuic 0x700
-#define flti_subssuic 0x701
-#define flti_mulssuic 0x702
-#define flti_divssuic 0x703
-#define flti_addtsuic 0x720
-#define flti_subtsuic 0x721
-#define flti_multsuic 0x722
-#define flti_divtsuic 0x723
-#define flti_cvttssuic 0x72c
-#define flti_cvttqsvic 0x72f
-#define flti_cvtqssuic 0x73c
-#define flti_cvtqtsuic 0x73e
-
-#define flti_addssuim 0x740
-#define flti_subssuim 0x741
-#define flti_mulssuim 0x742
-#define flti_divssuim 0x743
-#define flti_addtsuim 0x760
-#define flti_subtsuim 0x761
-#define flti_multsuim 0x762
-#define flti_divtsuim 0x763
-#define flti_cvttssuim 0x76c
-#define flti_cvttqsvim 0x76f
-#define flti_cvtqssuim 0x77c
-#define flti_cvtqtsuim 0x77e
-
-#define flti_addssui 0x780
-#define flti_subssui 0x781
-#define flti_mulssui 0x782
-#define flti_divssui 0x783
-#define flti_addtsui 0x7a0
-#define flti_subtsui 0x7a1
-#define flti_multsui 0x7a2
-#define flti_divtsui 0x7a3
-#define flti_cmptunsui 0x7a4
-#define flti_cmpteqsui 0x7a5
-#define flti_cmptltsui 0x7a6
-#define flti_cmptlesui 0x7a7
-#define flti_cvttssui 0x7ac
-#define flti_cvttqsvi 0x7af
-#define flti_cvtqssui 0x7bc
-#define flti_cvtqtsui 0x7bc
-
-#define flti_addssuid 0x7c0
-#define flti_subssuid 0x7c1
-#define flti_mulssuid 0x7c2
-#define flti_divssuid 0x7c3
-#define flti_addtsuid 0x7e0
-#define flti_subtsuid 0x7e1
-#define flti_multsuid 0x7e2
-#define flti_divtsuid 0x7e3
-#define flti_cvttssuid 0x7ec
-#define flti_cvttqsvid 0x7ef
-#define flti_cvtqssuid 0x7fc
-#define flti_cvtqtsuid 0x7fc
-
-#define op_fltl 0x17
-#define fltl_cvtlq 0x010
-#define fltl_cpys 0x020
-#define fltl_cpysn 0x021
-#define fltl_cpyse 0x022
-#define fltl_mt_fpcr 0x024
-#define fltl_mf_fpcr 0x025
-#define fltl_fcmoveq 0x02a
-#define fltl_fcmovne 0x02b
-#define fltl_fcmovlt 0x02c
-#define fltl_fcmovge 0x02d
-#define fltl_fcmovle 0x02e
-#define fltl_fcmovgt 0x02f
-#define fltl_cvtql 0x030
-#define fltl_cvtqlv 0x130
-#define fltl_cvtqlsv 0x530
-
-#define op_misc 0x18
-#define misc_trapb 0x0000
-#define misc_excb 0x0400
-#define misc_mb 0x4000
-#define misc_wmb 0x4400
-#define misc_fetch 0x8000
-#define misc_fetch_m 0xa000
-#define misc_rpcc 0xc000
-#define misc_rc 0xe000
-#define misc_ecb 0xe800
-#define misc_rs 0xf000
-#define misc_wh64 0xf800
-
-#define op_pal19 0x19
-#define op_jsr 0x1a
-#define op_pal1b 0x1b
-#define op_pal1c 0x1c
-#define op_pal1d 0x1d
-#define op_pal1e 0x1e
-#define op_pal1f 0x1f
-#define op_ldf 0x20
-#define op_ldg 0x21
-#define op_lds 0x22
-#define op_ldt 0x23
-#define op_stf 0x24
-#define op_stg 0x25
-#define op_sts 0x26
-#define op_stt 0x27
-#define op_ldl 0x28
-#define op_ldq 0x29
-#define op_ldl_l 0x2a
-#define op_ldq_l 0x2b
-#define op_stl 0x2c
-#define op_stq 0x2d
-#define op_stl_c 0x2e
-#define op_stq_c 0x2f
-#define op_br 0x30
-#define op_fbeq 0x31
-#define op_fblt 0x32
-#define op_fble 0x33
-#define op_bsr 0x34
-#define op_fbne 0x35
-#define op_fbge 0x36
-#define op_fbgt 0x37
-#define op_blbc 0x38
-#define op_beq 0x39
-#define op_blt 0x3a
-#define op_ble 0x3b
-#define op_blbs 0x3c
-#define op_bne 0x3d
-#define op_bge 0x3e
-#define op_bgt 0x3f
- } common;
- struct {
- u_int32_t function : 16;
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } memory_format;
- struct {
- u_int32_t hint : 14;
- u_int32_t function : 2;
-#define jsr_jmp 0
-#define jsr_jsr 1
-#define jsr_ret 2
-#define jsr_jsr_coroutine 3
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } j_format;
- struct {
- int32_t memory_displacement : 16;
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } m_format;
- struct {
- u_int32_t rc : 5;
- u_int32_t function : 7;
- u_int32_t form : 1;
- u_int32_t sbz : 3;
- u_int32_t rb : 5;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } o_format;
- struct {
- u_int32_t rc : 5;
- u_int32_t function : 7;
- u_int32_t form : 1;
- u_int32_t literal : 8;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } l_format;
- struct {
- u_int32_t fc : 5;
- u_int32_t function : 11;
- u_int32_t fb : 5;
- u_int32_t fa : 5;
- u_int32_t opcode : 6;
- } f_format;
- struct {
- u_int32_t function : 26;
- u_int32_t opcode : 6;
- } pal_format;
- struct {
- int32_t branch_displacement : 21;
- u_int32_t ra : 5;
- u_int32_t opcode : 6;
- } b_format;
-};
-
-#endif /* _MACHINE_INST_H_ */
diff --git a/sys/alpha/include/intr.h b/sys/alpha/include/intr.h
index ea5408920b881..79af6fd9fa6dd 100644
--- a/sys/alpha/include/intr.h
+++ b/sys/alpha/include/intr.h
@@ -23,15 +23,24 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: intr.h,v 1.4 1998/11/15 18:25:16 dfr Exp $
+ * $Id: intr.h,v 1.2 1998/07/12 16:09:30 dfr Exp $
*/
#ifndef _MACHINE_INTR_H_
#define _MACHINE_INTR_H_
-int alpha_setup_intr(int vector, driver_intr_t *intr, void *arg,
- void **cookiep, volatile long *cntp);
-int alpha_teardown_intr(void *cookie);
+LIST_HEAD(alpha_intr_list, alpha_intr);
+
+struct alpha_intr {
+ LIST_ENTRY(alpha_intr) list; /* chain handlers in this hash bucket */
+ int vector; /* vector to match */
+ driver_intr_t *intr; /* handler function */
+ void *arg; /* argument to handler */
+};
+
+struct alpha_intr *alpha_create_intr(int vector,
+ driver_intr_t *intr, void *arg);
+int alpha_connect_intr(struct alpha_intr *i);
void alpha_dispatch_intr(void *frame, unsigned long vector);
#endif /* !_MACHINE_INTR_H_ */
diff --git a/sys/alpha/include/intrcnt.h b/sys/alpha/include/intrcnt.h
deleted file mode 100644
index cd9e70173156d..0000000000000
--- a/sys/alpha/include/intrcnt.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* $Id$ */
-/* $NetBSD: intrcnt.h,v 1.17 1998/11/19 01:48:04 ross Exp $ */
-
-/*
- * Copyright (c) 1995, 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#define INTRCNT_CLOCK 0
-#define INTRCNT_ISA_IRQ (INTRCNT_CLOCK + 1)
-#define INTRCNT_ISA_IRQ_LEN 16
-#define INTRCNT_OTHER_BASE (INTRCNT_ISA_IRQ + INTRCNT_ISA_IRQ_LEN)
-#define INTRCNT_OTHER_LEN 48
-#define INTRCNT_COUNT (INTRCNT_OTHER_BASE + INTRCNT_OTHER_LEN)
-
-#define INTRCNT_A12_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_1000A_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_1000_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_2100_A500_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_DEC_550_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_EB164_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_EB64PLUS_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_EB66_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_IOASIC INTRCNT_OTHER_BASE
-#define INTRCNT_KN15 INTRCNT_OTHER_BASE
-#define INTRCNT_KN16 INTRCNT_OTHER_BASE
-#define INTRCNT_KN20AA_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_KN300_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_KN8AE_IRQ INTRCNT_OTHER_BASE
-#define INTRCNT_TCDS INTRCNT_OTHER_BASE
-
-#define INTRCNT_A12_IRQ_LEN 10
-#define INTRCNT_DEC_1000A_IRQ_LEN 32
-#define INTRCNT_DEC_1000_IRQ_LEN 16
-#define INTRCNT_DEC_2100_A500_IRQ_LEN 16
-#define INTRCNT_DEC_550_IRQ_LEN 48
-#define INTRCNT_EB164_IRQ_LEN 24
-#define INTRCNT_EB64PLUS_IRQ_LEN 32
-#define INTRCNT_EB66_IRQ_LEN 32
-#define INTRCNT_IOASIC_LEN 4
-#define INTRCNT_ISA_IRQ_LEN 16
-#define INTRCNT_KN15_LEN 9
-#define INTRCNT_KN16_LEN 5
-#define INTRCNT_KN20AA_IRQ_LEN 32
-#define INTRCNT_KN300_LEN 19
-#define INTRCNT_KN8AE_IRQ_LEN 2
-#define INTRCNT_TCDS_LEN 2
-
-# define INTRCNT_KN300_NCR810 INTRCNT_KN300_IRQ + 16
-# define INTRCNT_KN300_I2C_CTRL INTRCNT_KN300_IRQ + 17
-# define INTRCNT_KN300_I2C_BUS INTRCNT_KN300_IRQ + 18
-
-#ifdef KERNEL
-#ifndef _LOCORE
-extern volatile long intrcnt[];
-#endif
-#endif
diff --git a/sys/alpha/include/md_var.h b/sys/alpha/include/md_var.h
index c8db0523ed918..b3925f7474c4c 100644
--- a/sys/alpha/include/md_var.h
+++ b/sys/alpha/include/md_var.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: md_var.h,v 1.4 1998/09/26 12:22:53 dfr Exp $
+ * $Id: md_var.h,v 1.3 1998/09/14 22:43:24 jdp Exp $
*/
#ifndef _MACHINE_MD_VAR_H_
@@ -44,6 +44,7 @@ struct proc;
struct reg;
struct cam_sim;
+void cpu_power_down __P((void));
void cpu_halt __P((void));
void cpu_reset __P((void));
int is_physical_memory __P((vm_offset_t addr));
diff --git a/sys/alpha/include/mouse.h b/sys/alpha/include/mouse.h
index 2abce2cd01c92..3e63ba760f129 100644
--- a/sys/alpha/include/mouse.h
+++ b/sys/alpha/include/mouse.h
@@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mouse.h,v 1.11 1998/08/06 09:15:52 dfr Exp $
+ * $Id$
* from: i386/include mouse.h,v 1.10
*/
@@ -114,7 +114,6 @@ typedef struct mousehw {
#define MOUSE_MODEL_THINK 5
#define MOUSE_MODEL_EASYSCROLL 6
#define MOUSE_MODEL_MOUSEMANPLUS 7
-#define MOUSE_MODEL_KIDSPAD 8
typedef struct mousemode {
int protocol; /* MOUSE_PROTO_XXX */
@@ -142,7 +141,6 @@ typedef struct mousemode {
#define MOUSE_PROTO_THINK 11 /* Kensignton Thinking Mouse, 3/4 bytes */
#define MOUSE_PROTO_SYSMOUSE 12 /* /dev/sysmouse */
#define MOUSE_PROTO_X10MOUSEREM 13 /* X10 MouseRemote, 3 bytes */
-#define MOUSE_PROTO_KIDSPAD 14 /* Genius Kidspad */
#define MOUSE_RES_UNKNOWN (-1)
#define MOUSE_RES_DEFAULT 0
diff --git a/sys/alpha/include/pcb.h b/sys/alpha/include/pcb.h
index a6d4a18bde20a..445617ea71dcc 100644
--- a/sys/alpha/include/pcb.h
+++ b/sys/alpha/include/pcb.h
@@ -1,4 +1,4 @@
-/* $Id: pcb.h,v 1.1.1.1 1998/03/09 05:43:16 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: pcb.h,v 1.6 1997/04/06 08:47:33 cgd Exp */
/*
@@ -50,7 +50,6 @@ struct pcb {
struct alpha_pcb pcb_hw; /* PALcode defined */
unsigned long pcb_context[9]; /* s[0-6], ra, ps [SW] */
struct fpreg pcb_fp; /* FP registers [SW] */
- u_int64_t pcb_fp_control; /* IEEE control word [SW] */
unsigned long pcb_onfault; /* for copy faults [SW] */
unsigned long pcb_accessaddr; /* for [fs]uswintr [SW] */
};
diff --git a/sys/alpha/include/proc.h b/sys/alpha/include/proc.h
index 68add90c72556..6a1af705706e3 100644
--- a/sys/alpha/include/proc.h
+++ b/sys/alpha/include/proc.h
@@ -1,4 +1,4 @@
-/* $Id: proc.h,v 1.4 1998/11/15 18:25:16 dfr Exp $ */
+/* $Id: proc.h,v 1.2 1998/06/10 10:55:17 dfr Exp $ */
/* From: NetBSD: proc.h,v 1.3 1997/04/06 08:47:36 cgd Exp */
/*
@@ -38,15 +38,12 @@ struct mdbpt {
};
struct mdproc {
- u_long md_flags;
+ u_long md_flags;
struct trapframe *md_tf; /* trap/syscall registers */
- struct pcb *md_pcbpaddr; /* phys addr of the pcb */
- struct mdbpt md_sstep[2]; /* two single step breakpoints */
- u_int64_t md_hae; /* user HAE register value */
- void *osf_sigtramp; /* user-level signal trampoline */
+ struct pcb *md_pcbpaddr; /* phys addr of the pcb */
+ struct mdbpt md_sstep[2]; /* two single step breakpoints */
};
#define MDP_FPUSED 0x0001 /* Process used the FPU */
#define MDP_STEP1 0x0002 /* Single step normal instruction */
#define MDP_STEP2 0x0004 /* Single step branch instruction */
-#define MDP_HAEUSED 0x0008 /* Process used the HAE */
diff --git a/sys/alpha/include/resource.h b/sys/alpha/include/resource.h
deleted file mode 100644
index 44763783d9ab4..0000000000000
--- a/sys/alpha/include/resource.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $Id$ */
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _MACHINE_RESOURCE_H_
-#define _MACHINE_RESOURCE_H_ 1
-
-/*
- * Definitions of resource types for Intel Architecture machines
- * with support for legacy ISA devices and drivers.
- */
-
-#define SYS_RES_IRQ 1
-#define SYS_RES_DRQ 2
-#define SYS_RES_MEMORY 3
-#define SYS_RES_IOPORT 4
-
-#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/alpha/include/signal.h b/sys/alpha/include/signal.h
index eb335c0639811..32f14c210aa4f 100644
--- a/sys/alpha/include/signal.h
+++ b/sys/alpha/include/signal.h
@@ -1,4 +1,4 @@
-/* $Id: signal.h,v 1.1 1998/01/10 10:13:16 jb Exp $ */
+/* $Id$ */
/* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */
/*
@@ -56,11 +56,7 @@ struct sigcontext {
unsigned long sc_fpcr; /* FP control register (see above) */
unsigned long sc_fp_control; /* FP software control word */
long sc_reserved[2]; /* XXX */
- long sc_xxx1[2]; /* sc_ssize, sc_sbase on DUX */
- unsigned long sc_traparg_a0; /* a0 argument to trap at exception */
- unsigned long sc_traparg_a1; /* a1 argument to trap at exception */
- unsigned long sc_traparg_a2; /* a2 argument to trap at exception */
- long sc_xxx2[3]; /* sc_fp_trap_pc, sc_fp_trigger_sum, sc_fp_trigger_inst */
+ long sc_xxx[8]; /* XXX */
};
#endif /* !_ANSI_SOURCE */
diff --git a/sys/alpha/include/types.h b/sys/alpha/include/types.h
index f293bc5268dad..1bf185c651937 100644
--- a/sys/alpha/include/types.h
+++ b/sys/alpha/include/types.h
@@ -1,4 +1,4 @@
-/* $Id: types.h,v 1.8 1998/07/14 05:09:42 bde Exp $ */
+/* $Id: types.h,v 1.7 1998/07/10 02:34:50 bde Exp $ */
/* From: NetBSD: types.h,v 1.8 1997/04/06 08:47:45 cgd Exp */
/*-
@@ -56,16 +56,34 @@ typedef long vm_ooffset_t;
typedef unsigned long vm_pindex_t;
typedef unsigned long vm_size_t;
+/*
+ * Basic integral types. Omit the typedef if
+ * not possible for a machine/compiler combination.
+ */
+#define __BIT_TYPES_DEFINED__
+typedef __signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+typedef long int64_t;
+typedef unsigned long u_int64_t;
+
+typedef int64_t register_t;
-typedef __int64_t register_t;
+typedef int32_t ufs_daddr_t;
#ifdef KERNEL
typedef long intfptr_t;
typedef unsigned long uintfptr_t;
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+typedef unsigned long uoff_t;
#endif
/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
+typedef u_int32_t intrmask_t;
/* Interrupt handler function type - arg should be "void *" one day */
typedef void inthand2_t(int _unit);
diff --git a/sys/alpha/include/vmparam.h b/sys/alpha/include/vmparam.h
index 04c62a65a5460..fead056e3d0c4 100644
--- a/sys/alpha/include/vmparam.h
+++ b/sys/alpha/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $Id: vmparam.h,v 1.3 1998/06/14 13:45:15 dfr Exp $ */
+/* $Id: vmparam.h,v 1.2 1998/06/10 10:55:30 dfr Exp $ */
/* From: NetBSD: vmparam.h,v 1.6 1997/09/23 23:23:23 mjacob Exp */
#ifndef _ALPHA_VMPARAM_H
#define _ALPHA_VMPARAM_H
@@ -54,15 +54,7 @@
* kernel stack.
*/
#define USRTEXT CLBYTES
-/* #define USRSTACK VM_MAXUSER_ADDRESS */
-
-/*
- * This stack location is suitable for OSF1 emulation. Some OSF
- * programs are built as 32bit and assume that the stack is reachable
- * with a 32bit value. OSF1 manages to have a variable location for
- * the user stack which we should probably also support.
- */
-#define USRSTACK (0x12000000LL - (UPAGES*PAGE_SIZE))
+#define USRSTACK VM_MAXUSER_ADDRESS
/*
* Virtual memory related constants, all in bytes
diff --git a/sys/alpha/isa/isa.c b/sys/alpha/isa/isa.c
index 32894e6144489..1437a2a879791 100644
--- a/sys/alpha/isa/isa.c
+++ b/sys/alpha/isa/isa.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isa.c,v 1.7 1998/11/18 23:53:11 dfr Exp $
+ * $Id: isa.c,v 1.3 1998/08/10 07:53:59 dfr Exp $
*/
#include <sys/param.h>
@@ -32,37 +32,24 @@
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
-#include <sys/rman.h>
#include <isa/isareg.h>
#include <isa/isavar.h>
#include <machine/intr.h>
-#include <machine/intrcnt.h>
-#include <machine/resource.h>
-
-MALLOC_DEFINE(M_ISADEV, "isadev", "ISA device");
/*
* The structure used to attach devices to the Isa.
*/
struct isa_device {
- u_short id_port[ISA_NPORT_IVARS];
- u_short id_portsize[ISA_NPORT_IVARS];
- vm_offset_t id_maddr[ISA_NMEM_IVARS];
- vm_size_t id_msize[ISA_NMEM_IVARS];
- int id_irq[ISA_NIRQ_IVARS];
- int id_drq[ISA_NDRQ_IVARS];
+ int id_port;
+ int id_portsize;
int id_flags;
- struct resource *id_portres[ISA_NPORT_IVARS];
- struct resource *id_memres[ISA_NMEM_IVARS];
- struct resource *id_irqres[ISA_NIRQ_IVARS];
- struct resource *id_drqres[ISA_NDRQ_IVARS];
+ int id_irq;
};
#define DEVTOISA(dev) ((struct isa_device*) device_get_ivars(dev))
static devclass_t isa_devclass;
-static struct rman isa_irq_rman;
/*
* Device methods
@@ -72,16 +59,9 @@ static int isa_attach(device_t dev);
static void isa_print_child(device_t dev, device_t child);
static int isa_read_ivar(device_t dev, device_t child, int which, u_long *result);
static int isa_write_ivar(device_t dev, device_t child, int which, u_long result);
-static struct resource *isa_alloc_resource(device_t bus, device_t child,
- int type, int *rid,
- u_long start, u_long end,
- u_long count, u_int flags);
-static int isa_release_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int isa_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int isa_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *isa_create_intr(device_t dev, device_t child, int irq,
+ driver_intr_t *intr, void *arg);
+static int isa_connect_intr(device_t dev, void *ih);
static device_method_t isa_methods[] = {
/* Device interface */
@@ -94,12 +74,8 @@ static device_method_t isa_methods[] = {
DEVMETHOD(bus_print_child, isa_print_child),
DEVMETHOD(bus_read_ivar, isa_read_ivar),
DEVMETHOD(bus_write_ivar, isa_write_ivar),
- DEVMETHOD(bus_alloc_resource, isa_alloc_resource),
- DEVMETHOD(bus_release_resource, isa_release_resource),
- DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
- DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
- DEVMETHOD(bus_setup_intr, isa_setup_intr),
- DEVMETHOD(bus_teardown_intr, isa_teardown_intr),
+ DEVMETHOD(bus_create_intr, isa_create_intr),
+ DEVMETHOD(bus_connect_intr, isa_connect_intr),
{ 0, 0 }
};
@@ -114,69 +90,34 @@ static driver_t isa_driver = {
static void
isa_add_device(device_t dev, const char *name, int unit)
{
- struct isa_device *idev;
- device_t child;
- int sensitive, t;
- static device_t last_sensitive;
-
- if (resource_int_value(name, unit, "sensitive", &sensitive) != 0)
- sensitive = 0;
+ struct isa_device *idev;
+ device_t child;
+ int t;
- idev = malloc(sizeof(struct isa_device), M_ISADEV, M_NOWAIT);
+ idev = malloc(sizeof(struct isa_device), M_DEVBUF, M_NOWAIT);
if (!idev)
return;
- bzero(idev, sizeof *idev);
if (resource_int_value(name, unit, "port", &t) == 0)
- idev->id_port[0] = t;
+ idev->id_port = t;
else
- idev->id_port[0] = 0;
- idev->id_port[1] = 0;
-
+ idev->id_port = 0;
if (resource_int_value(name, unit, "portsize", &t) == 0)
- idev->id_portsize[0] = t;
- else
- idev->id_portsize[0] = 0;
- idev->id_portsize[1] = 0;
-
- if (resource_int_value(name, unit, "iomem", &t) == 0)
- idev->id_maddr[0] = t;
+ idev->id_portsize = t;
else
- idev->id_maddr[0] = 0;
- idev->id_maddr[1] = 0;
-
- if (resource_int_value(name, unit, "msize", &t) == 0)
- idev->id_msize[0] = t;
- else
- idev->id_msize[0] = 0;
- idev->id_msize[1] = 0;
-
+ idev->id_portsize = 0;
if (resource_int_value(name, unit, "flags", &t) == 0)
idev->id_flags = t;
else
idev->id_flags = 0;
-
if (resource_int_value(name, unit, "irq", &t) == 0)
- idev->id_irq[0] = t;
+ idev->id_irq = t;
else
- idev->id_irq[0] = -1;
- idev->id_irq[1] = -1;
+ idev->id_irq = -1;
- if (resource_int_value(name, unit, "drq", &t) == 0)
- idev->id_drq[0] = t;
- else
- idev->id_drq[0] = -1;
- idev->id_drq[1] = -1;
-
- if (sensitive)
- child = device_add_child_after(dev, last_sensitive, name,
- unit, idev);
- else
- child = device_add_child(dev, name, unit, idev);
- if (child == 0)
+ child = device_add_child(dev, name, unit, idev);
+ if (!child)
return;
- else if (sensitive)
- last_sensitive = child;
if (resource_int_value(name, unit, "disabled", &t) == 0 && t != 0)
device_disable(child);
@@ -189,7 +130,7 @@ isa_intr_enable(int irq)
if (irq < 8)
outb(IO_ICU1+1, inb(IO_ICU1+1) & ~(1 << irq));
else
- outb(IO_ICU2+1, inb(IO_ICU2+1) & ~(1 << (irq - 8)));
+ outb(IO_ICU2+1, inb(IO_ICU2+1) & ~(1 << irq));
splx(s);
}
@@ -200,7 +141,7 @@ isa_intr_disable(int irq)
if (irq < 8)
outb(IO_ICU1+1, inb(IO_ICU1+1) | (1 << irq));
else
- outb(IO_ICU2+1, inb(IO_ICU2+1) | (1 << (irq - 8)));
+ outb(IO_ICU2+1, inb(IO_ICU2+1) | (1 << irq));
splx(s);
}
@@ -246,15 +187,6 @@ isa_probe(device_t dev)
resource_query_unit(i));
}
- isa_irq_rman.rm_start = 0;
- isa_irq_rman.rm_end = 15;
- isa_irq_rman.rm_type = RMAN_ARRAY;
- isa_irq_rman.rm_descr = "ISA Interrupt request lines";
- if (rman_init(&isa_irq_rman)
- || rman_manage_region(&isa_irq_rman, 0, 1)
- || rman_manage_region(&isa_irq_rman, 3, 15))
- panic("isa_probe isa_irq_rman");
-
return 0;
}
@@ -283,69 +215,15 @@ isa_attach(device_t dev)
static void
isa_print_child(device_t bus, device_t dev)
{
- struct isa_device *id = DEVTOISA(dev);
-
- if (id->id_port[0] > 0 || id->id_port[1]
- || id->id_maddr[0] > 0 || id->id_maddr[1]
- || id->id_irq[0] >= 0 || id->id_irq[1] >= 0
- || id->id_drq[0] >= 0 || id->id_drq[1] >= 0)
- printf(" at");
- if (id->id_port[0] && id->id_port[1]) {
- printf(" ports %#x", (u_int)id->id_port[0]);
- if (id->id_portsize[0])
- printf("-%#x", (u_int)(id->id_port[0]
- + id->id_portsize[0] - 1));
- printf(" and %#x", (u_int)id->id_port[1]);
- if (id->id_portsize[1])
- printf("-%#x", (u_int)(id->id_port[1]
- + id->id_portsize[1] - 1));
- } else if (id->id_port[0]) {
- printf(" port %#x", (u_int)id->id_port[0]);
- if (id->id_portsize[0])
- printf("-%#x", (u_int)(id->id_port[0]
- + id->id_portsize[0] - 1));
- } else if (id->id_port[1]) {
- printf(" port %#x", (u_int)id->id_port[1]);
- if (id->id_portsize[1])
- printf("-%#x", (u_int)(id->id_port[1]
- + id->id_portsize[1] - 1));
- }
- if (id->id_maddr[0] && id->id_maddr[1]) {
- printf(" iomem %#x", (u_int)id->id_maddr[0]);
- if (id->id_msize[0])
- printf("-%#x", (u_int)(id->id_maddr[0]
- + id->id_msize[0] - 1));
- printf(" and %#x", (u_int)id->id_maddr[1]);
- if (id->id_msize[1])
- printf("-%#x", (u_int)(id->id_maddr[1]
- + id->id_msize[1] - 1));
- } else if (id->id_maddr[0]) {
- printf(" iomem %#x", (u_int)id->id_maddr[0]);
- if (id->id_msize[0])
- printf("-%#x", (u_int)(id->id_maddr[0]
- + id->id_msize[0] - 1));
- } else if (id->id_maddr[1]) {
- printf(" iomem %#x", (u_int)id->id_maddr[1]);
- if (id->id_msize[1])
- printf("-%#x", (u_int)(id->id_maddr[1]
- + id->id_msize[1] - 1));
- }
- if (id->id_irq[0] >= 0 && id->id_irq[1] >= 0)
- printf(" irqs %d and %d", id->id_irq[0], id->id_irq[1]);
- else if (id->id_irq[0] >= 0)
- printf(" irq %d", id->id_irq[0]);
- else if (id->id_irq[1] >= 0)
- printf(" irq %d", id->id_irq[1]);
- if (id->id_drq[0] >= 0 && id->id_drq[1] >= 0)
- printf(" drqs %d and %d", id->id_drq[0], id->id_drq[1]);
- else if (id->id_drq[0] >= 0)
- printf(" drq %d", id->id_drq[0]);
- else if (id->id_drq[1] >= 0)
- printf(" drq %d", id->id_drq[1]);
-
- if (id->id_flags)
- printf(" flags %#x", id->id_flags);
+ struct isa_device* idev = DEVTOISA(dev);
+ printf(" at");
+ if (idev->id_port)
+ printf(" 0x%x", idev->id_port);
+ if (idev->id_portsize > 0)
+ printf("-0x%x", idev->id_port + idev->id_portsize - 1);
+ if (idev->id_irq >= 0)
+ printf(" irq %d", idev->id_irq);
printf(" on %s%d",
device_get_name(bus), device_get_unit(bus));
}
@@ -357,45 +235,18 @@ isa_read_ivar(device_t bus, device_t dev,
struct isa_device* idev = DEVTOISA(dev);
switch (index) {
- case ISA_IVAR_PORT_0:
- *result = idev->id_port[0];
- break;
- case ISA_IVAR_PORT_1:
- *result = idev->id_port[1];
- break;
- case ISA_IVAR_PORTSIZE_0:
- *result = idev->id_portsize[0];
+ case ISA_IVAR_PORT:
+ *result = idev->id_port;
break;
- case ISA_IVAR_PORTSIZE_1:
- *result = idev->id_portsize[1];
- break;
- case ISA_IVAR_MADDR_0:
- *result = idev->id_maddr[0];
- break;
- case ISA_IVAR_MADDR_1:
- *result = idev->id_maddr[1];
- break;
- case ISA_IVAR_MSIZE_0:
- *result = idev->id_msize[0];
- break;
- case ISA_IVAR_MSIZE_1:
- *result = idev->id_msize[1];
- break;
- case ISA_IVAR_IRQ_0:
- *result = idev->id_irq[0];
- break;
- case ISA_IVAR_IRQ_1:
- *result = idev->id_irq[1];
- break;
- case ISA_IVAR_DRQ_0:
- *result = idev->id_drq[0];
- break;
- case ISA_IVAR_DRQ_1:
- *result = idev->id_drq[1];
+ case ISA_IVAR_PORTSIZE:
+ *result = idev->id_portsize;
break;
case ISA_IVAR_FLAGS:
*result = idev->id_flags;
break;
+ case ISA_IVAR_IRQ:
+ *result = idev->id_irq;
+ break;
}
return ENOENT;
}
@@ -407,207 +258,20 @@ isa_write_ivar(device_t bus, device_t dev,
struct isa_device* idev = DEVTOISA(dev);
switch (index) {
- case ISA_IVAR_PORT_0:
- idev->id_port[0] = value;
- break;
- case ISA_IVAR_PORT_1:
- idev->id_port[1] = value;
- break;
- case ISA_IVAR_PORTSIZE_0:
- idev->id_portsize[0] = value;
- break;
- case ISA_IVAR_PORTSIZE_1:
- idev->id_portsize[1] = value;
- break;
- case ISA_IVAR_MADDR_0:
- idev->id_maddr[0] = value;
- break;
- case ISA_IVAR_MADDR_1:
- idev->id_maddr[1] = value;
- break;
- case ISA_IVAR_MSIZE_0:
- idev->id_msize[0] = value;
- break;
- case ISA_IVAR_MSIZE_1:
- idev->id_msize[1] = value;
- break;
- case ISA_IVAR_IRQ_0:
- idev->id_irq[0] = value;
- break;
- case ISA_IVAR_IRQ_1:
- idev->id_irq[1] = value;
+ case ISA_IVAR_PORT:
+ idev->id_port = value;
break;
- case ISA_IVAR_DRQ_0:
- idev->id_drq[0] = value;
- break;
- case ISA_IVAR_DRQ_1:
- idev->id_drq[1] = value;
+ case ISA_IVAR_PORTSIZE:
+ idev->id_portsize = value;
break;
case ISA_IVAR_FLAGS:
idev->id_flags = value;
break;
- default:
- return (ENOENT);
- }
- return (0);
-}
-
-/*
- * This implementation simply passes the request up to the parent
- * bus, which in our case is the pci chipset device, substituting any
- * configured values if the caller defaulted. We can get away with
- * this because there is no special mapping for ISA resources on this
- * platform. When porting this code to another architecture, it may be
- * necessary to interpose a mapping layer here.
- *
- * We manage our own interrupt resources since ISA interrupts go through
- * the ISA PIC, not the PCI interrupt controller.
- */
-static struct resource *
-isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
-{
- int isdefault;
- struct resource *rv, **rvp;
- struct isa_device *id;
-
- if (child)
- id = DEVTOISA(child);
- else
- id = NULL;
- isdefault = (start == 0UL && end == ~0UL && *rid == 0);
- if (*rid > 1)
- return 0;
-
- switch (type) {
- case SYS_RES_IRQ:
- /*
- * The hack implementation of intr_create() passes a
- * NULL child device.
- */
- if (isdefault && (id == NULL || id->id_irq[0] >= 0)) {
- start = id->id_irq[0];
- end = id->id_irq[0];
- count = 1;
- }
- rv = rman_reserve_resource(&isa_irq_rman,
- start, end, count,
- 0, child);
- if (!rv)
- return 0;
- if (id) {
- id->id_irqres[*rid] = rv;
- id->id_irq[*rid] = rv->r_start;
- }
- return rv;
-
- case SYS_RES_MEMORY:
- if (isdefault && id->id_maddr[0]) {
- start = id->id_maddr[0];
- count = max(count, (u_long)id->id_msize[0]);
- end = id->id_maddr[0] + count;
- }
- rvp = &id->id_memres[*rid];
- break;
-
- case SYS_RES_IOPORT:
- if (isdefault && id->id_port[0]) {
- start = id->id_port[0];
- count = max(count, (u_long)id->id_portsize[0]);
- end = id->id_port[0] + count;
- }
- rvp = &id->id_portres[*rid];
+ case ISA_IVAR_IRQ:
+ idev->id_irq = value;
break;
-
- default:
- return 0;
}
-
- /*
- * If the client attempts to reallocate a resource without
- * releasing what was there previously, die horribly so that
- * he knows how he !@#$ed up.
- */
- if (*rvp != 0)
- panic("%s%d: (%d, %d) not free for %s%d\n",
- device_get_name(bus), device_get_unit(bus),
- type, *rid,
- device_get_name(child), device_get_unit(child));
-
- /*
- * nexus_alloc_resource had better not change *rid...
- */
- rv = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid,
- start, end, count, flags);
- if ((*rvp = rv) != 0) {
- switch (type) {
- case SYS_RES_MEMORY:
- id->id_maddr[*rid] = rv->r_start;
- id->id_msize[*rid] = count;
- break;
- case SYS_RES_IOPORT:
- id->id_port[*rid] = rv->r_start;
- id->id_portsize[*rid] = count;
- break;
- }
- }
- return rv;
-}
-
-static int
-isa_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- int rv;
- struct resource **rp;
- struct isa_device *id = DEVTOISA(child);
-
- if (rid > 1)
- return EINVAL;
-
- switch (type) {
- case SYS_RES_IRQ:
- return (rman_release_resource(r));
- case SYS_RES_DRQ:
- case SYS_RES_IOPORT:
- case SYS_RES_MEMORY:
- break;
- default:
- return (ENOENT);
- }
-
- rv = BUS_RELEASE_RESOURCE(device_get_parent(bus), child, type, rid, r);
-
- if (rv) {
- switch (type) {
- case SYS_RES_IRQ:
- id->id_irqres[rid] = 0;
- id->id_irq[rid] = -1;
- break;
-
- case SYS_RES_DRQ:
- id->id_drqres[rid] = 0;
- id->id_drq[rid] = -1;
- break;
-
- case SYS_RES_MEMORY:
- id->id_memres[rid] = 0;
- id->id_maddr[rid] = 0;
- id->id_msize[rid] = 0;
- break;
-
- case SYS_RES_IOPORT:
- id->id_portres[rid] = 0;
- id->id_port[rid] = 0;
- id->id_portsize[rid] = 0;
- break;
-
- default:
- return ENOENT;
- }
- }
-
- return rv;
+ return ENOENT;
}
struct isa_intr {
@@ -635,48 +299,37 @@ isa_handle_intr(void *arg)
outb(IO_ICU1, 0x20 | (irq > 7 ? 2 : irq));
}
-static int
-isa_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
+static void *
+isa_create_intr(device_t dev, device_t child, int irq,
+ driver_intr_t *intr, void *arg)
{
struct isa_intr *ii;
- int error;
-
- error = rman_activate_resource(irq);
- if (error)
- return error;
+ if (irq == 2) irq = 9;
ii = malloc(sizeof(struct isa_intr), M_DEVBUF, M_NOWAIT);
if (!ii)
- return ENOMEM;
+ return NULL;
ii->intr = intr;
ii->arg = arg;
- ii->irq = irq->r_start;
-
- error = alpha_setup_intr(0x800 + (irq->r_start << 4),
- isa_handle_intr, ii, &ii->ih,
- &intrcnt[INTRCNT_ISA_IRQ + irq->r_start]);
- if (error) {
+ ii->irq = irq;
+ ii->ih = alpha_create_intr(0x800 + (irq << 4), isa_handle_intr, ii);
+
+ if (!ii->ih) {
free(ii, M_DEVBUF);
- return error;
+ return NULL;
}
- isa_intr_enable(irq->r_start);
- *cookiep = ii;
- return 0;
+ return ii;
}
static int
-isa_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
+isa_connect_intr(device_t dev, void *ih)
{
- struct isa_intr *ii = cookie;
+ struct isa_intr *ii = ih;
+ struct alpha_intr *i = ii->ih;
- alpha_teardown_intr(ii->ih);
- isa_intr_disable(irq->r_start);
-
- return 0;
+ isa_intr_enable(ii->irq);
+ return alpha_connect_intr(i);
}
DRIVER_MODULE(isa, cia, isa_driver, isa_devclass, 0, 0);
diff --git a/sys/alpha/pci/apecs.c b/sys/alpha/pci/apecs.c
index 66bedcfcf03d7..433410225271f 100644
--- a/sys/alpha/pci/apecs.c
+++ b/sys/alpha/pci/apecs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: apecs.c,v 1.4 1998/12/04 22:54:42 archie Exp $
+ * $Id: apecs.c,v 1.1 1998/08/10 07:53:59 dfr Exp $
*/
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -60,16 +60,12 @@
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
-#include <sys/rman.h>
#include <alpha/pci/apecsreg.h>
#include <alpha/pci/apecsvar.h>
-#include <alpha/pci/pcibus.h>
#include <machine/intr.h>
-#include <machine/intrcnt.h>
#include <machine/cpuconf.h>
#include <machine/swiz.h>
-#include <machine/rpb.h>
#define KV(pa) ALPHA_PHYS_TO_K0SEG(pa)
@@ -107,8 +103,6 @@ static alpha_chipset_cfgwriteb_t apecs_swiz_cfgwriteb;
static alpha_chipset_cfgwritew_t apecs_swiz_cfgwritew;
static alpha_chipset_cfgwritel_t apecs_swiz_cfgwritel;
static alpha_chipset_addrcvt_t apecs_cvt_dense;
-static alpha_chipset_read_hae_t apecs_read_hae;
-static alpha_chipset_write_hae_t apecs_write_hae;
static alpha_chipset_t apecs_swiz_chipset = {
apecs_swiz_inb,
@@ -132,8 +126,6 @@ static alpha_chipset_t apecs_swiz_chipset = {
apecs_swiz_cfgwritel,
apecs_cvt_dense,
NULL,
- apecs_read_hae,
- apecs_write_hae,
};
static int
@@ -427,37 +419,18 @@ apecs_cvt_dense(vm_offset_t addr)
}
-static u_int64_t
-apecs_read_hae(void)
-{
- return apecs_hae_mem & 0xf8000000;
-}
-
-static void
-apecs_write_hae(u_int64_t hae)
-{
- u_int32_t pa = hae;
- apecs_swiz_set_hae_mem(&pa);
-}
static int apecs_probe(device_t dev);
static int apecs_attach(device_t dev);
-static int apecs_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int apecs_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *apecs_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+static int apecs_connect_intr(device_t dev, void* ih);
+
static device_method_t apecs_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, apecs_probe),
DEVMETHOD(device_attach, apecs_attach),
/* Bus interface */
- DEVMETHOD(bus_alloc_resource, pci_alloc_resource),
- DEVMETHOD(bus_release_resource, pci_release_resource),
- DEVMETHOD(bus_activate_resource, pci_activate_resource),
- DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
- DEVMETHOD(bus_setup_intr, apecs_setup_intr),
- DEVMETHOD(bus_teardown_intr, apecs_teardown_intr),
{ 0, 0 }
};
@@ -498,8 +471,6 @@ apecs_probe(device_t dev)
}
apecs_hae_mem = REGVAL(EPIC_HAXR1);
- pci_init_resources();
-
isa0 = device_add_child(dev, "isa", 0, 0);
return 0;
@@ -512,15 +483,7 @@ apecs_attach(device_t dev)
{
struct apecs_softc* sc = APECS_SOFTC(dev);
apecs_init();
-
- /*
- * the avanti routes interrupts through the isa interrupt
- * controller, so we need to special case it
- */
- if(hwrpb->rpb_type == ST_DEC_2100_A50)
- chipset.intrdev = isa0;
- else
- chipset.intrdev = apecs0;
+ chipset.intrdev = isa0;
sc->dmem_base = APECS_PCI_DENSE;
sc->smem_base = APECS_PCI_SPARSE;
@@ -530,46 +493,9 @@ apecs_attach(device_t dev)
set_iointr(alpha_dispatch_intr);
- snprintf(chipset_type, sizeof(chipset_type), "apecs");
- chipset_bwx = 0;
- chipset_ports = APECS_PCI_SIO;
- chipset_memory = APECS_PCI_SPARSE;
- chipset_dense = APECS_PCI_DENSE;
- chipset_hae_mask = EPIC_HAXR1_EADDR;
-
bus_generic_attach(dev);
return 0;
}
-static int
-apecs_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
-{
- int error;
-
- error = rman_activate_resource(irq);
- if (error)
- return error;
-
- error = alpha_setup_intr(0x900 + (irq->r_start << 4),
- intr, arg, cookiep,
- &intrcnt[INTRCNT_EB64PLUS_IRQ + irq->r_start]);
- if (error)
- return error;
-
- /* Enable PCI interrupt */
- platform.pci_intr_enable(irq->r_start);
- return 0;
-}
-
-static int
-apecs_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
-{
- alpha_teardown_intr(cookie);
- return rman_deactivate_resource(irq);
-}
-
DRIVER_MODULE(apecs, root, apecs_driver, apecs_devclass, 0, 0);
diff --git a/sys/alpha/pci/cia.c b/sys/alpha/pci/cia.c
index c68ef57720ffc..065c42065954e 100644
--- a/sys/alpha/pci/cia.c
+++ b/sys/alpha/pci/cia.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cia.c,v 1.13 1998/12/02 09:33:27 dfr Exp $
+ * $Id: cia.c,v 1.9 1998/09/16 08:24:30 dfr Exp $
*/
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -96,18 +96,14 @@
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
-#include <sys/rman.h>
#include <alpha/pci/ciareg.h>
#include <alpha/pci/ciavar.h>
-#include <alpha/pci/pcibus.h>
#include <machine/bwx.h>
#include <machine/swiz.h>
#include <machine/intr.h>
-#include <machine/intrcnt.h>
#include <machine/cpuconf.h>
#include <machine/rpb.h>
-#include <machine/resource.h>
#define KV(pa) ALPHA_PHYS_TO_K0SEG(pa)
@@ -142,8 +138,6 @@ static alpha_chipset_cfgwriteb_t cia_bwx_cfgwriteb, cia_swiz_cfgwriteb;
static alpha_chipset_cfgwritew_t cia_bwx_cfgwritew, cia_swiz_cfgwritew;
static alpha_chipset_cfgwritel_t cia_bwx_cfgwritel, cia_swiz_cfgwritel;
static alpha_chipset_addrcvt_t cia_cvt_dense, cia_cvt_bwx;
-static alpha_chipset_read_hae_t cia_read_hae;
-static alpha_chipset_write_hae_t cia_write_hae;
static alpha_chipset_t cia_bwx_chipset = {
cia_bwx_inb,
@@ -167,8 +161,6 @@ static alpha_chipset_t cia_bwx_chipset = {
cia_bwx_cfgwritel,
cia_cvt_dense,
cia_cvt_bwx,
- cia_read_hae,
- cia_write_hae,
};
static alpha_chipset_t cia_swiz_chipset = {
cia_swiz_inb,
@@ -192,8 +184,6 @@ static alpha_chipset_t cia_swiz_chipset = {
cia_swiz_cfgwritel,
cia_cvt_dense,
NULL,
- cia_read_hae,
- cia_write_hae,
};
static u_int8_t
@@ -449,30 +439,28 @@ cia_swiz_outl(u_int32_t port, u_int32_t data)
}
static __inline void
-cia_swiz_set_hae_mem(u_int32_t *pa)
+cia_swiz_set_hae_mem(u_int32_t pa)
{
- /* Only bother with region 1 */
+ /* Only bother with region 1 */
#define REG1 (7 << 29)
- if ((cia_hae_mem & REG1) != (*pa & REG1)) {
- /*
- * Seems fairly paranoid but this is what Linux does...
- */
- u_int32_t msb = *pa & REG1;
- int s = splhigh();
- cia_hae_mem = (cia_hae_mem & ~REG1) | msb;
- REGVAL(CIA_CSR_HAE_MEM) = cia_hae_mem;
- alpha_mb();
- cia_hae_mem = REGVAL(CIA_CSR_HAE_MEM);
- splx(s);
- *pa -= msb;
- }
+ if ((cia_hae_mem & REG1) != (pa & REG1)) {
+ /*
+ * Seems fairly paranoid but this is what Linux does...
+ */
+ int s = splhigh();
+ cia_hae_mem = (cia_hae_mem & ~REG1) | (pa & REG1);
+ REGVAL(CIA_CSR_HAE_MEM) = cia_hae_mem;
+ alpha_mb();
+ cia_hae_mem = REGVAL(CIA_CSR_HAE_MEM);
+ splx(s);
+ }
}
static u_int8_t
cia_swiz_readb(u_int32_t pa)
{
alpha_mb();
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
return SPARSE_READ_BYTE(KV(CIA_PCI_SMEM1), pa);
}
@@ -480,7 +468,7 @@ static u_int16_t
cia_swiz_readw(u_int32_t pa)
{
alpha_mb();
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
return SPARSE_READ_WORD(KV(CIA_PCI_SMEM1), pa);
}
@@ -488,14 +476,14 @@ static u_int32_t
cia_swiz_readl(u_int32_t pa)
{
alpha_mb();
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
return SPARSE_READ_LONG(KV(CIA_PCI_SMEM1), pa);
}
static void
cia_swiz_writeb(u_int32_t pa, u_int8_t data)
{
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
SPARSE_WRITE_BYTE(KV(CIA_PCI_SMEM1), pa, data);
alpha_wmb();
}
@@ -503,7 +491,7 @@ cia_swiz_writeb(u_int32_t pa, u_int8_t data)
static void
cia_swiz_writew(u_int32_t pa, u_int16_t data)
{
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
SPARSE_WRITE_WORD(KV(CIA_PCI_SMEM1), pa, data);
alpha_wmb();
}
@@ -511,7 +499,7 @@ cia_swiz_writew(u_int32_t pa, u_int16_t data)
static void
cia_swiz_writel(u_int32_t pa, u_int32_t data)
{
- cia_swiz_set_hae_mem(&pa);
+ cia_swiz_set_hae_mem(pa);
SPARSE_WRITE_LONG(KV(CIA_PCI_SMEM1), pa, data);
alpha_wmb();
}
@@ -628,35 +616,12 @@ cia_cvt_bwx(vm_offset_t addr)
return (addr |= CIA_EV56_BWMEM);
}
-static u_int64_t
-cia_read_hae(void)
-{
- return cia_hae_mem & REG1;
-}
-static void
-cia_write_hae(u_int64_t hae)
-{
- u_int32_t pa = hae;
- cia_swiz_set_hae_mem(&pa);
-}
static int cia_probe(device_t dev);
static int cia_attach(device_t dev);
-static struct resource *cia_alloc_resource(device_t bus, device_t child,
- int type, int *rid,
- u_long start, u_long end,
- u_long count, u_int flags);
-static int cia_activate_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int cia_deactivate_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int cia_release_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-static int cia_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int cia_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *cia_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+static int cia_connect_intr(device_t dev, void* ih);
static device_method_t cia_methods[] = {
/* Device interface */
@@ -664,12 +629,8 @@ static device_method_t cia_methods[] = {
DEVMETHOD(device_attach, cia_attach),
/* Bus interface */
- DEVMETHOD(bus_alloc_resource, pci_alloc_resource),
- DEVMETHOD(bus_release_resource, pci_release_resource),
- DEVMETHOD(bus_activate_resource, pci_activate_resource),
- DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
- DEVMETHOD(bus_setup_intr, cia_setup_intr),
- DEVMETHOD(bus_teardown_intr, cia_teardown_intr),
+ DEVMETHOD(bus_create_intr, cia_create_intr),
+ DEVMETHOD(bus_connect_intr, cia_connect_intr),
{ 0, 0 }
};
@@ -721,7 +682,6 @@ cia_init()
#if 0
chipset = cia_swiz_chipset; /* XXX */
- cia_ispyxis = 0;
#endif
if (platform.pci_intr_init)
@@ -736,8 +696,6 @@ cia_probe(device_t dev)
cia0 = dev;
device_set_desc(dev, "2117x PCI adapter"); /* XXX */
- pci_init_resources();
-
device_add_child(dev, "isa", 0, 0);
return 0;
@@ -803,54 +761,29 @@ cia_attach(device_t dev)
if (!platform.iointr) /* XXX */
set_iointr(alpha_dispatch_intr);
- if (cia_ispyxis) {
- snprintf(chipset_type, sizeof(chipset_type), "pyxis");
- chipset_bwx = 1;
- chipset_ports = CIA_EV56_BWIO;
- chipset_memory = CIA_EV56_BWMEM;
- chipset_dense = CIA_PCI_DENSE;
- } else {
- snprintf(chipset_type, sizeof(chipset_type), "cia");
- chipset_bwx = 0;
- chipset_ports = CIA_PCI_SIO1;
- chipset_memory = CIA_PCI_SMEM1;
- chipset_dense = CIA_PCI_DENSE;
- chipset_hae_mask = 7L << 29;
- }
-
bus_generic_attach(dev);
return 0;
}
-static int
-cia_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
+static void *
+cia_create_intr(device_t dev, device_t child,
+ int irq, driver_intr_t *intr, void *arg)
{
- int error;
-
- error = rman_activate_resource(irq);
- if (error)
- return error;
-
- error = alpha_setup_intr(0x900 + (irq->r_start << 4),
- intr, arg, cookiep,
- &intrcnt[INTRCNT_EB164_IRQ + irq->r_start]);
- if (error)
- return error;
-
- /* Enable PCI interrupt */
- platform.pci_intr_enable(irq->r_start);
-
- return 0;
+ return alpha_create_intr(0x900 + (irq << 4), intr, arg);
}
static int
-cia_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
-{
- alpha_teardown_intr(cookie);
- return rman_deactivate_resource(irq);
+cia_connect_intr(device_t dev, void* ih)
+{
+ struct alpha_intr *i = ih;
+ int s = splhigh();
+ int error = alpha_connect_intr(i);
+ if (!error) {
+ /* Enable PCI interrupt */
+ platform.pci_intr_enable((i->vector - 0x900) >> 4);
+ }
+ splx(s);
+ return error;
}
DRIVER_MODULE(cia, root, cia_driver, cia_devclass, 0, 0);
diff --git a/sys/alpha/pci/lca.c b/sys/alpha/pci/lca.c
index f3b194da6332a..58f873f3ff74f 100644
--- a/sys/alpha/pci/lca.c
+++ b/sys/alpha/pci/lca.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: lca.c,v 1.4 1998/11/15 18:25:16 dfr Exp $
+ * $Id: lca.c,v 1.2 1998/09/23 21:23:51 msmith Exp $
*/
#include <sys/param.h>
@@ -34,7 +34,6 @@
#include <alpha/pci/lcareg.h>
#include <alpha/pci/lcavar.h>
-#include <alpha/pci/pcibus.h>
#include <machine/swiz.h>
#include <machine/intr.h>
#include <machine/cpuconf.h>
@@ -71,8 +70,6 @@ static alpha_chipset_cfgwriteb_t lca_cfgwriteb;
static alpha_chipset_cfgwritew_t lca_cfgwritew;
static alpha_chipset_cfgwritel_t lca_cfgwritel;
static alpha_chipset_addrcvt_t lca_cvt_dense;
-static alpha_chipset_read_hae_t lca_read_hae;
-static alpha_chipset_write_hae_t lca_write_hae;
static alpha_chipset_t lca_chipset = {
lca_inb,
@@ -95,9 +92,6 @@ static alpha_chipset_t lca_chipset = {
lca_cfgwritew,
lca_cfgwritel,
lca_cvt_dense,
- NULL,
- lca_read_hae,
- lca_write_hae,
};
static u_int8_t
@@ -318,18 +312,6 @@ lca_cvt_dense(vm_offset_t addr)
}
-static u_int64_t
-lca_read_hae(void)
-{
- return lca_hae_mem & 0xf8000000;
-}
-
-static void
-lca_write_hae(u_int64_t hae)
-{
- u_int32_t pa = hae;
- lca_set_hae_mem(&pa);
-}
static int lca_probe(device_t dev);
static int lca_attach(device_t dev);
@@ -342,10 +324,6 @@ static device_method_t lca_methods[] = {
DEVMETHOD(device_attach, lca_attach),
/* Bus interface */
- DEVMETHOD(bus_alloc_resource, pci_alloc_resource),
- DEVMETHOD(bus_release_resource, pci_release_resource),
- DEVMETHOD(bus_activate_resource, pci_activate_resource),
- DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
{ 0, 0 }
};
@@ -397,13 +375,6 @@ lca_attach(device_t dev)
set_iointr(alpha_dispatch_intr);
- snprintf(chipset_type, sizeof(chipset_type), "lca");
- chipset_bwx = 0;
- chipset_ports = LCA_PCI_SIO;
- chipset_memory = LCA_PCI_SPARSE;
- chipset_dense = LCA_PCI_DENSE;
- chipset_hae_mask = IOC_HAE_ADDREXT;
-
bus_generic_attach(dev);
return 0;
}
diff --git a/sys/alpha/pci/pci_eb64plus_intr.s b/sys/alpha/pci/pci_eb64plus_intr.s
deleted file mode 100644
index 472d741631aa3..0000000000000
--- a/sys/alpha/pci/pci_eb64plus_intr.s
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $NetBSD: pci_eb64plus_intr.s,v 1.2 1997/09/02 13:19:43 thorpej Exp $ */
-
-/*
- * Copyright (c) 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-/*
- * This file hacked from pci_eb164_intr.s
- *
- * These functions were written by disassembling a Digital UNIX kernel's
- * eb64p_intrdsabl and eb64p_intrenabl functions (because they had
- * interesting names, and looked like the eb164 versions which were
- * known to already work), and then playing with them to see how to call
- * them correctly.
- *
- * It looks like the right thing to do is to call them with the interrupt
- * request that you want to enable or disable (presumably in the range
- * 0 -> 23, since there are 3 8-bit interrupt-enable bits in the
- * interrupt mask PLD).
- */
-
-#include <machine/asm.h>
-
-__KERNEL_RCSID(0, "$NetBSD: pci_eb64plus_intr.s,v 1.2 1997/09/02 13:19:43 thorpej Exp $");
-
- .text
-LEAF(eb64plus_intr_enable,1)
- mov a0, a1
- ldiq a0, 0x34
- call_pal PAL_cserve
- RET
- END(eb64plus_intr_enable)
-
- .text
-LEAF(eb64plus_intr_disable,1)
- mov a0, a1
- ldiq a0, 0x35
- call_pal PAL_cserve
- RET
- END(eb64plus_intr_enable)
diff --git a/sys/alpha/pci/pcibus.c b/sys/alpha/pci/pcibus.c
index 697373cec37d5..0cafff2d77387 100644
--- a/sys/alpha/pci/pcibus.c
+++ b/sys/alpha/pci/pcibus.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcibus.c,v 1.7 1998/11/18 23:53:12 dfr Exp $
+ * $Id: pcibus.c,v 1.4 1998/08/10 07:53:59 dfr Exp $
*
*/
@@ -33,34 +33,13 @@
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/interrupt.h>
-#include <sys/sysctl.h>
-#include <sys/rman.h>
#include <pci/pcivar.h>
#include <machine/chipset.h>
#include <machine/cpuconf.h>
-#include <machine/resource.h>
-char chipset_type[10];
-int chipset_bwx = 0;
-long chipset_ports = 0;
-long chipset_memory = 0;
-long chipset_dense = 0;
-long chipset_hae_mask = 0;
-
-SYSCTL_NODE(_hw, OID_AUTO, chipset, CTLFLAG_RW, 0, "PCI chipset information");
-SYSCTL_STRING(_hw_chipset, OID_AUTO, type, CTLFLAG_RD, chipset_type, 0,
- "PCI chipset type");
-SYSCTL_INT(_hw_chipset, OID_AUTO, bwx, CTLFLAG_RD, &chipset_bwx, 0,
- "PCI chipset supports BWX access");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, ports, CTLFLAG_RD, &chipset_ports,
- "PCI chipset port address");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, memory, CTLFLAG_RD, &chipset_memory,
- "PCI chipset memory address");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, dense, CTLFLAG_RD, &chipset_dense,
- "PCI chipset dense memory address");
-SYSCTL_LONG(_hw_chipset, OID_AUTO, hae_mask, CTLFLAG_RD, &chipset_hae_mask,
- "PCI chipset mask for HAE register");
+static int cfgmech;
+static int devmax;
#ifdef notyet
@@ -137,27 +116,22 @@ struct intrec *
intr_create(void *dev_instance, int irq, inthand2_t handler, void *arg,
intrmask_t *maskptr, int flags)
{
- struct resource *res;
device_t pcib = chipset.intrdev;
- int zero = 0;
- void *cookie;
-
- res = BUS_ALLOC_RESOURCE(pcib, NULL, SYS_RES_IRQ, &zero,
- irq, irq, 1, RF_SHAREABLE | RF_ACTIVE);
- if (BUS_SETUP_INTR(pcib, pcib, res, (driver_intr_t *)handler, arg, &cookie))
+ if (pcib)
+ return BUS_CREATE_INTR(pcib, pcib, irq,
+ (driver_intr_t*) handler, arg);
+ else
return 0;
-
- return (struct intrec *)cookie;
}
int
intr_connect(struct intrec *idesc)
{
- /*
- * intr_create has already connected it (doesn't matter for the
- * only consumer of this interface (pci).
- */
- return 0;
+ device_t pcib = chipset.intrdev;
+ if (pcib)
+ return BUS_CONNECT_INTR(pcib, idesc);
+ else
+ return EINVAL;
}
void
@@ -167,86 +141,6 @@ alpha_platform_assign_pciintr(pcicfgregs *cfg)
platform.pci_intr_map((void *)cfg);
}
-static struct rman irq_rman, port_rman, mem_rman;
-
-void pci_init_resources()
-{
- irq_rman.rm_start = 0;
- irq_rman.rm_end = 32;
- irq_rman.rm_type = RMAN_ARRAY;
- irq_rman.rm_descr = "PCI Interrupt request lines";
- if (rman_init(&irq_rman)
- || rman_manage_region(&irq_rman, 0, 31))
- panic("cia_probe irq_rman");
-
- port_rman.rm_start = 0;
- port_rman.rm_end = 0xffff;
- port_rman.rm_type = RMAN_ARRAY;
- port_rman.rm_descr = "I/O ports";
- if (rman_init(&port_rman)
- || rman_manage_region(&port_rman, 0, 0xffff))
- panic("cia_probe port_rman");
-
- mem_rman.rm_start = 0;
- mem_rman.rm_end = ~0u;
- mem_rman.rm_type = RMAN_ARRAY;
- mem_rman.rm_descr = "I/O memory addresses";
- if (rman_init(&mem_rman)
- || rman_manage_region(&mem_rman, 0x0, (1L << 32)))
- panic("cia_probe mem_rman");
-}
-
-/*
- * Allocate a resource on behalf of child. NB: child is usually going to be a
- * child of one of our descendants, not a direct child of the pci chipset.
- */
-struct resource *
-pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
-{
- struct rman *rm;
-
- switch (type) {
- case SYS_RES_IRQ:
- rm = &irq_rman;
- break;
-
- case SYS_RES_IOPORT:
- rm = &port_rman;
- break;
-
- case SYS_RES_MEMORY:
- rm = &mem_rman;
- break;
-
- default:
- return 0;
- }
-
- return rman_reserve_resource(rm, start, end, count, flags, child);
-}
-
-int
-pci_activate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- return (rman_activate_resource(r));
-}
-
-int
-pci_deactivate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- return (rman_deactivate_resource(r));
-}
-
-int
-pci_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
-{
- return (rman_release_resource(r));
-}
-
void
memcpy_fromio(void *d, u_int32_t s, size_t size)
{
diff --git a/sys/alpha/pci/pcibus.h b/sys/alpha/pci/pcibus.h
index 38b51b772e9cf..eb56cec1e2d86 100644
--- a/sys/alpha/pci/pcibus.h
+++ b/sys/alpha/pci/pcibus.h
@@ -23,17 +23,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pcibus.h,v 1.1 1998/06/10 10:55:38 dfr Exp $
+ * $Id$
*/
-void pci_init_resources(void);
-struct resource *pci_alloc_resource(device_t bus, device_t child,
- int type, int *rid,
- u_long start, u_long end, u_long count,
- u_int flags);
-int pci_activate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r);
-int pci_deactivate_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r);
-int pci_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r);
+typedef int alpha_pci_maxdevs_t(pcicfgregs*);
+typedef int alpha_pci_cfgread_t(pcicfgregs*, int, int);
+typedef void alpha_pci_cfgwrite_t(pcicfgregs*, int, int, int);
+
+struct alpha_pci_ops {
+ alpha_pci_maxdevs_t* maxdevs;
+ alpha_pci_cfgread_t* cfgread;
+ alpha_pci_cfgwrite_t* cfgwrite;
+};
+
+struct alpha_pci_softc {
+ struct alpha_pci_ops* ops;
+};
diff --git a/sys/alpha/tc/am7990.c b/sys/alpha/tc/am7990.c
index d734c155c3223..6c65f8248d467 100644
--- a/sys/alpha/tc/am7990.c
+++ b/sys/alpha/tc/am7990.c
@@ -1,4 +1,4 @@
-/* $Id: am7990.c,v 1.1 1998/08/20 08:27:10 dfr Exp $ */
+/* $Id$ */
/* $NetBSD: am7990.c,v 1.43 1998/03/29 22:36:42 mycroft Exp $ */
/*-
@@ -194,8 +194,7 @@ am7990_config(sc)
/* Make sure the chip is stopped. */
am7990_stop(sc);
/* Initialize ifnet structure. */
- snprintf(sc->sc_dev.dv_xname,
- sizeof(sc->sc_dev.dv_xname), "le%d", sc->unit);
+ sprintf(sc->sc_dev.dv_xname, "le%d", sc->unit);
ifp->if_unit = sc->unit;
ifp->if_name = "le";
ifp->if_softc = sc;
diff --git a/sys/alpha/tc/espvar.h b/sys/alpha/tc/espvar.h
index b64b774026855..ad5d139ff6584 100644
--- a/sys/alpha/tc/espvar.h
+++ b/sys/alpha/tc/espvar.h
@@ -1,4 +1,4 @@
-/* $Id: espvar.h,v 1.1 1998/08/20 08:27:10 dfr Exp $ */
+/* $Id$ */
/* $NetBSD: espvar.h,v 1.3.4.1 1996/09/10 17:28:18 cgd Exp $ */
/*
@@ -74,7 +74,8 @@ struct ecb {
#define ECB_TRACE(ecb, msg, a, b) do { \
const char *f = "[" msg "]"; \
int n = strlen((ecb)->trace); \
- snprintf((ecb)->trace + n, sizeof((ecb)->trace) - n, f, a, b); \
+ if (n < (sizeof((ecb)->trace)-100)) \
+ sprintf((ecb)->trace + n, f, a, b); \
} while(0)
#else
#define ECB_TRACE(ecb, msg, a, b)
diff --git a/sys/alpha/tlsb/dwlpx.c b/sys/alpha/tlsb/dwlpx.c
index bb80abf255766..7db56ce21960a 100644
--- a/sys/alpha/tlsb/dwlpx.c
+++ b/sys/alpha/tlsb/dwlpx.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: dwlpx.c,v 1.6 1998/09/04 08:01:26 dfr Exp $
+ * $Id: dwlpx.c,v 1.5 1998/08/10 07:53:59 dfr Exp $
*/
#include "opt_simos.h"
@@ -288,8 +288,6 @@ dwlpx_attach(device_t dev)
struct dwlpx_softc* sc = DWLPX_SOFTC(dev);
device_t parent = device_get_parent(dev);
vm_offset_t regs;
- void *intr;
-
dwlpx0 = dev;
chipset = dwlpx_chipset;
@@ -303,7 +301,9 @@ dwlpx_attach(device_t dev)
*(u_int32_t*) (regs + PCIA_CTL(0)) = 1; /* Type1 config cycles */
- return BUS_SETUP_INTR(parent, dev, NULL, dwlpx_intr, 0, &intr);
+ BUS_CONNECT_INTR(parent,
+ BUS_CREATE_INTR(parent, dev,
+ 0, dwlpx_intr, 0));
return 0;
}
diff --git a/sys/alpha/tlsb/gbus.c b/sys/alpha/tlsb/gbus.c
index f98a3bd4f24f4..9894889cc1d06 100644
--- a/sys/alpha/tlsb/gbus.c
+++ b/sys/alpha/tlsb/gbus.c
@@ -92,8 +92,8 @@ static device_method_t gbus_methods[] = {
DEVMETHOD(bus_print_child, gbus_print_child),
DEVMETHOD(bus_read_ivar, gbus_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -134,7 +134,7 @@ gbus_print_child(device_t bus, device_t dev)
{
struct gbus_device* gdev = DEVTOGBUS(dev);
- printf(" at %s%d offset 0x%x",
+ printf(" at %s%d offset 0x%lx",
device_get_name(bus), device_get_unit(bus),
gdev->gd_offset);
}
diff --git a/sys/alpha/tlsb/kftxx.c b/sys/alpha/tlsb/kftxx.c
index d85b202a4a1e9..6f9f89a903ce4 100644
--- a/sys/alpha/tlsb/kftxx.c
+++ b/sys/alpha/tlsb/kftxx.c
@@ -1,4 +1,4 @@
-/* $Id: kftxx.c,v 1.3 1998/07/12 16:23:17 dfr Exp $ */
+/* $Id: kftxx.c,v 1.2 1998/06/14 13:45:24 dfr Exp $ */
/* $NetBSD: kftxx.c,v 1.9 1998/05/14 00:01:32 thorpej Exp $ */
/*
@@ -89,8 +89,8 @@ static device_method_t kft_methods[] = {
DEVMETHOD(bus_print_child, kft_print_child),
DEVMETHOD(bus_read_ivar, kft_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
diff --git a/sys/alpha/tlsb/tlsb.c b/sys/alpha/tlsb/tlsb.c
index 00aff9adf87ae..6e618a3a11e14 100644
--- a/sys/alpha/tlsb/tlsb.c
+++ b/sys/alpha/tlsb/tlsb.c
@@ -95,11 +95,8 @@ static devclass_t tlsb_devclass;
static int tlsb_probe(device_t dev);
static void tlsb_print_child(device_t dev, device_t child);
static int tlsb_read_ivar(device_t dev, device_t child, int which, u_long* result);
-static int tlsb_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-static int tlsb_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
+static void *tlsb_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+static int tlsb_connect_intr(device_t dev, void* ih);
static device_method_t tlsb_methods[] = {
/* Device interface */
@@ -112,8 +109,8 @@ static device_method_t tlsb_methods[] = {
DEVMETHOD(bus_print_child, tlsb_print_child),
DEVMETHOD(bus_read_ivar, tlsb_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, tlsb_setup_intr),
- DEVMETHOD(bus_teardown_intr, tlsb_teardown_intr),
+ DEVMETHOD(bus_create_intr, tlsb_create_intr),
+ DEVMETHOD(bus_connect_intr, tlsb_connect_intr),
{ 0, 0 }
};
@@ -268,32 +265,27 @@ tlsb_read_ivar(device_t dev, device_t child,
return ENOENT;
}
-static int
-tlsb_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
+static void *
+tlsb_create_intr(device_t dev, device_t child,
+ int irq, driver_intr_t *intr, void *arg)
{
struct tlsb_softc* sc = device_get_softc(dev);
struct intr_mapping* i;
i = malloc(sizeof(struct intr_mapping), M_DEVBUF, M_NOWAIT);
if (!i)
- return ENOMEM;
+ return NULL;
i->intr = intr;
i->arg = arg;
- STAILQ_INSERT_TAIL(&sc->intr_handlers, i, queue);
- *cookiep = i;
- return 0;
+ return i;
}
static int
-tlsb_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie)
+tlsb_connect_intr(device_t dev, void *ih)
{
struct tlsb_softc* sc = device_get_softc(dev);
- struct intr_mapping* i = cookie;
+ struct intr_mapping* i = ih;
- STAILQ_REMOVE(&sc->intr_handlers, i, intr_mapping, queue);
- free(i, M_DEVBUF);
+ STAILQ_INSERT_TAIL(&sc->intr_handlers, i, queue);
return 0;
}
@@ -343,8 +335,7 @@ tlsb_node_type_str(u_int32_t dtype)
default:
bzero(tlsb_line, sizeof(tlsb_line));
- snprintf(tlsb_line, sizeof(tlsb_line),
- "unknown, dtype 0x%x", dtype);
+ sprintf(tlsb_line, "unknown, dtype 0x%x", dtype);
return (tlsb_line);
}
/* NOTREACHED */
diff --git a/sys/alpha/tlsb/zs_tlsb.c b/sys/alpha/tlsb/zs_tlsb.c
index e88b8b104cc80..f5e7032b176d2 100644
--- a/sys/alpha/tlsb/zs_tlsb.c
+++ b/sys/alpha/tlsb/zs_tlsb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: zs_tlsb.c,v 1.5 1998/07/31 09:20:01 dfr Exp $
+ * $Id: zs_tlsb.c,v 1.4 1998/07/12 16:23:19 dfr Exp $
*/
/*
* This driver is a hopeless hack to get the SimOS console working. A real
@@ -385,7 +385,6 @@ struct zsc_softc {
caddr_t base;
struct zs_softc* sc_a;
struct zs_softc* sc_b;
- void *intr;
};
static int zsc_tlsb_probe(device_t dev);
@@ -405,8 +404,8 @@ static device_method_t zsc_tlsb_methods[] = {
DEVMETHOD(bus_print_child, zsc_tlsb_print_child),
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -456,7 +455,6 @@ zsc_tlsb_attach(device_t dev)
{
struct zsc_softc* sc = device_get_softc(dev);
device_t parent = device_get_parent(dev);
- void *ih;
bus_generic_attach(dev);
@@ -464,9 +462,9 @@ zsc_tlsb_attach(device_t dev)
sc->sc_a = ZS_SOFTC(0);
sc->sc_b = ZS_SOFTC(1);
- /* XXX should use resource argument to communicate vector */
- return BUS_SETUP_INTR(parent, dev, NULL, zsc_tlsb_intr, sc,
- &sc->intr);
+ BUS_CONNECT_INTR(parent,
+ BUS_CREATE_INTR(parent, dev,
+ 1, zsc_tlsb_intr, sc));
return 0;
}
diff --git a/sys/boot/Makefile b/sys/boot/Makefile
index cd271859639ff..1de5941692118 100644
--- a/sys/boot/Makefile
+++ b/sys/boot/Makefile
@@ -1,7 +1,4 @@
-# Build the add-in FORTH interpreter
-SUBDIR+= ficl
-
-# Pick the machine-dependant subdir based on the target architecture.
-SUBDIR+= ${MACHINE_ARCH}
+# Pick the subdir based on the target architecture.
+SUBDIR= ${MACHINE_ARCH}
.include <bsd.subdir.mk>
diff --git a/sys/boot/alpha/Makefile.inc b/sys/boot/alpha/Makefile.inc
index abb4f65cbc898..bbbea75f1efed 100644
--- a/sys/boot/alpha/Makefile.inc
+++ b/sys/boot/alpha/Makefile.inc
@@ -1,8 +1,10 @@
# Options used when building app-specific libalpha components
-PRIMARY_LOAD_ADDRESS= 0x20000000 # "Region 1 start"
-SECONDARY_LOAD_ADDRESS= 0x2000c000 # "Region 1 start" + 48k
-HEAP_LIMIT= 0x20040000 # "Region 1 start" + 256k
+PRIMARY_LOAD_ADDRESS= 20000000 # "Region 1 start"
+SECONDARY_LOAD_ADDRESS= 2000c000 # "Region 1 start" + 48k
+HEAP_LIMIT= 20040000 # "Region 1 start" + 256k
DPADD+= ${DESTDIR}/${LIBDIR}/libstand.a
LIBSTANDDIR= ${.CURDIR}/../../../../lib/libstand
LIBSTAND= -lstand
LIBALPHA= ${.OBJDIR}/../libalpha/libalpha.a
+
+BINDIR= /usr/mdec
diff --git a/sys/boot/alpha/boot1/Makefile b/sys/boot/alpha/boot1/Makefile
index bfbcb7a88114c..e163c03345a4c 100644
--- a/sys/boot/alpha/boot1/Makefile
+++ b/sys/boot/alpha/boot1/Makefile
@@ -12,10 +12,9 @@ CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
-CFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} -DMINIMAL
+CFLAGS+= -DSECONDARY_LOAD_ADDRESS=0x${SECONDARY_LOAD_ADDRESS} -DMINIMAL
NOMAN=1
STRIP=
-BINDIR?= /boot
BOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}
@@ -23,6 +22,10 @@ CLEANFILES+= ${PROG}.sym ${PROG}.nosym ${PROG}.list
all: ${PROG}
+afterinstall:
+ ln -sf boot1 /usr/mdec/daboot
+ ln -sf boot1 /usr/mdec/fdboot
+
${PROG}.nosym: ${PROG}.sym
cp ${PROG}.sym ${PROG}.nosym
strip ${PROG}.nosym
@@ -33,9 +36,10 @@ ${PROG}: ${PROG}.nosym
.include <bsd.prog.mk>
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c -DPRIMARY_BOOTBLOCK $<
${PROG}.sym: ${OBJS} ${LIBKERN}
${LD} -M -Ttext ${BOOT_RELOC} -N -e start -o ${PROG}.sym ${OBJS} \
${LIBSTAND} ${LIBALPHA} ${LIBSTAND} > ${.OBJDIR}/${PROG}.list
size ${PROG}.sym
+
diff --git a/sys/boot/alpha/boot1/boot1.c b/sys/boot/alpha/boot1/boot1.c
index 9eac7ec64c714..a3fbfc2bf3976 100644
--- a/sys/boot/alpha/boot1/boot1.c
+++ b/sys/boot/alpha/boot1/boot1.c
@@ -1,5 +1,5 @@
/*
- * $Id: boot1.c,v 1.2 1998/09/26 10:51:36 dfr Exp $
+ * $Id: boot1.c,v 1.1.1.1 1998/08/21 03:17:41 msmith Exp $
* From $NetBSD: bootxx.c,v 1.4 1997/09/06 14:08:29 drochner Exp $
*/
@@ -181,7 +181,7 @@ main()
init_prom_calls();
- loadfile("/boot/loader", loadaddr);
+ loadfile("/boot/boot2", loadaddr);
entry = (void (*)())loadaddr;
(*entry)();
diff --git a/sys/boot/alpha/boot2/Makefile b/sys/boot/alpha/boot2/Makefile
index 956944d255c82..dfc8e58121eb1 100644
--- a/sys/boot/alpha/boot2/Makefile
+++ b/sys/boot/alpha/boot2/Makefile
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $
-BASE= loader
+BASE= boot2
PROG= ${BASE}
NOMAN=
NEWVERSWHAT= "SRM disk boot"
@@ -16,9 +16,6 @@ SRCS+= main.c conf.c
CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/../../.. -I.
-CFLAGS+= -DLOADER
-CFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} \
- -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
CLEANFILES+= vers.c vers.o gensetdefs.o gensetdefs setdef0.o setdef1.o \
setdefs.h start.o
@@ -30,7 +27,6 @@ CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
CRT= start.o
STRIP=
-BINDIR?= /boot
all: ${BASE}
@@ -38,7 +34,7 @@ vers.o: ${.CURDIR}/newvers.sh ${.CURDIR}/Makefile
sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
-${BASE}: ${BASE}.sym ${BASE}.help
+${BASE}: ${BASE}.sym
objcopy -O binary ${BASE}.sym ${BASE}
${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
@@ -46,21 +42,9 @@ ${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
${CRT} setdef0.o ${OBJS} setdef1.o \
vers.o ${LIBSTAND} ${LIBALPHA} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
-${BASE}.help: help.common help.alpha
- cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
-
-beforeinstall:
-.if exists(${.OBJDIR}/loader.help)
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
-.else
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
-.endif
-
# Other fragments still to be brought in from ../Makfile.booters?
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c $<
setdef0.o: setdefs.h
diff --git a/sys/boot/alpha/boot2/help.alpha b/sys/boot/alpha/boot2/help.alpha
deleted file mode 100644
index e69de29bb2d1d..0000000000000
--- a/sys/boot/alpha/boot2/help.alpha
+++ /dev/null
diff --git a/sys/boot/alpha/boot2/newvers.sh b/sys/boot/alpha/boot2/newvers.sh
index 978c164898675..88cc010175bb3 100644
--- a/sys/boot/alpha/boot2/newvers.sh
+++ b/sys/boot/alpha/boot2/newvers.sh
@@ -35,7 +35,6 @@
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
-LC_TIME=C; export LC_TIME
u=${USER-root} h=`hostname` t=`date`
r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '`
diff --git a/sys/boot/alpha/common/main.c b/sys/boot/alpha/common/main.c
index 41400240b26eb..365e5c4cd98c6 100644
--- a/sys/boot/alpha/common/main.c
+++ b/sys/boot/alpha/common/main.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: main.c,v 1.8 1998/10/31 17:12:32 dfr Exp $
+ * $Id: main.c,v 1.4 1998/09/03 02:10:02 msmith Exp $
*/
@@ -63,50 +63,6 @@ memsize()
return total;
}
-static void
-extend_heap()
-{
- struct rpb *hwrpb = (struct rpb *)HWRPB_ADDR;
- struct mddt *mddtp;
- struct mddt_cluster *memc;
- int i;
- unsigned long total = 0;
- unsigned long startpfn;
- vm_offset_t startva;
- vm_offset_t startpte;
-
- /*
- * Find the last usable memory cluster and add some of its pages
- * to our address space. The 256k allowed by the firmware isn't quite
- * adequate for our needs.
- */
- mddtp = (struct mddt *)(((caddr_t)hwrpb) + hwrpb->rpb_memdat_off);
- for (i = mddtp->mddt_cluster_cnt - 1; i >= 0; i--) {
- memc = &mddtp->mddt_clusters[i];
- if (!(memc->mddt_usage & (MDDT_NONVOLATILE | MDDT_PALCODE)))
- break;
- }
-
- /*
- * We want to extend the heap from 256k to 512k. With 8k pages
- * (assumed), we need 32 pages. We take pages from the end of the
- * last usable memory region, taking care to avoid the memory used
- * by the kernel's message buffer. We allow 4 pages for the
- * message buffer.
- */
- startpfn = memc->mddt_pfn + memc->mddt_pg_cnt - 4 - 32;
- startva = 0x20040000;
- startpte = 0x40000000
- + (((startva >> 23) & 0x3ff) << PAGE_SHIFT)
- + (((startva >> 13) & 0x3ff) << 3);
-
- for (i = 0; i < 32; i++) {
- u_int64_t pte;
- pte = ((startpfn + i) << 32) | 0x1101;
- *(u_int64_t *) (startpte + 8 * i) = pte;
- }
-}
-
void
main(void)
{
@@ -114,27 +70,18 @@ main(void)
char bootfile[128];
/*
- * Initialise the heap as early as possible. Once this is done,
- * alloc() is usable. The stack is buried inside us, so this is
- * safe.
+ * Initialise the heap as early as possible. Once this is done, alloc() is usable.
+ * The stack is buried inside us, so this is safe
*/
- extend_heap();
- setheap((void *)end, (void *)0x20080000);
+ setheap((void *)end, (void *)0x20040000);
-#ifdef LOADER
- /*
- * If this is the two stage disk loader, add the memory used by
- * the first stage to the heap.
- */
- free_region((void *)PRIMARY_LOAD_ADDRESS,
- (void *)SECONDARY_LOAD_ADDRESS);
-#endif
/*
- * XXX Chicken-and-egg problem; we want to have console output
- * early, but some console attributes may depend on reading from
- * eg. the boot device, which we can't do yet. We can use
- * printf() etc. once this is done.
+ * XXX Chicken-and-egg problem; we want to have console output early, but some
+ * console attributes may depend on reading from eg. the boot device, which we
+ * can't do yet.
+ *
+ * We can use printf() etc. once this is done.
*/
cons_probe();
@@ -142,11 +89,6 @@ main(void)
OSFpal();
/*
- * Initialise the block cache
- */
- bcache_init(32, 512); /* 16k XXX tune this */
-
- /*
* March through the device switch probing for things.
*/
for (i = 0; devsw[i] != NULL; i++)
diff --git a/sys/boot/alpha/libalpha/Makefile b/sys/boot/alpha/libalpha/Makefile
index 4928647b75489..a82febf2e2a32 100644
--- a/sys/boot/alpha/libalpha/Makefile
+++ b/sys/boot/alpha/libalpha/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 1998/10/14 09:53:25 peter Exp $
+# $Id: Makefile,v 1.4 1998/09/26 10:51:37 dfr Exp $
LIB= alpha
NOPIC= true
@@ -14,7 +14,7 @@ CFLAGS+= -DDEBUG
CFLAGS+= -I${.CURDIR}/../../common -mno-fp-regs \
-I${.CURDIR}/../../.. -I.
-#CFLAGS+= -DDISK_DEBUG
+CFLAGS+= -DDISK_DEBUG
#CPPFLAGS+= -DNO_DISKLABEL
#CPPFLAGS+= -DSAVE_MEMORY
diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c
index 6b7d17b8e76d8..f7427bdb493f7 100644
--- a/sys/boot/alpha/libalpha/srmdisk.c
+++ b/sys/boot/alpha/libalpha/srmdisk.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: srmdisk.c,v 1.3 1998/11/02 23:28:10 msmith Exp $
+ * $Id$
*/
/*
@@ -46,7 +46,6 @@
#include <machine/stdarg.h>
#include <machine/prom.h>
-#include "bootstrap.h"
#include "libalpha.h"
#define SRMDISK_SECSIZE 512
@@ -62,16 +61,18 @@
static int bd_init(void);
static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
static int bd_open(struct open_file *f, void *vdev);
static int bd_close(struct open_file *f);
-static void bd_print(int verbose);
struct open_disk {
int od_fd;
int od_unit; /* our unit number */
int od_boff; /* block offset from beginning of SRM disk */
int od_flags;
+#define BD_MODEMASK 0x3
+#define BD_MODEINT13 0x0
+#define BD_MODEEDD1 0x1
+#define BD_MODEEDD3 0x2
#define BD_FLOPPY (1<<2)
u_char od_buf[BUFSIZE]; /* transfer buffer (do we want/need this?) */
};
@@ -83,8 +84,7 @@ struct devsw srmdisk = {
bd_strategy,
bd_open,
bd_close,
- noioctl,
- bd_print
+ noioctl
};
/*
@@ -120,23 +120,6 @@ bd_init(void)
}
/*
- * Print information about disks
- */
-static void
-bd_print(int verbose)
-{
- int i;
- char line[80];
-
- for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: SRM drive %s", i, bdinfo[i].bd_name);
- pager_output(line);
- /* XXX more detail? */
- pager_output("\n");
- }
-}
-
-/*
* Attempt to open the disk described by (dev) for use by (f).
*
* Note that the philosophy here is "give them exactly what
@@ -324,17 +307,7 @@ bd_close(struct open_file *f)
}
static int
-bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
-{
- struct bcache_devdata bcd;
-
- bcd.dv_strategy = bd_realstrategy;
- bcd.dv_devdata = devdata;
- return(bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
-}
-
-static int
-bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize)
+bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize)
{
prom_return_t ret;
struct open_disk *od = (struct open_disk *)devdata;
diff --git a/sys/boot/alpha/libalpha/start.S b/sys/boot/alpha/libalpha/start.S
index 39c3e48952c62..53063aba11ee6 100644
--- a/sys/boot/alpha/libalpha/start.S
+++ b/sys/boot/alpha/libalpha/start.S
@@ -1,5 +1,5 @@
/*
- * $Id: start.S,v 1.1.1.1 1998/08/21 03:17:42 msmith Exp $
+ * $Id$
* From: $NetBSD: start.S,v 1.4 1998/03/28 00:54:15 cgd Exp $
*/
@@ -51,15 +51,16 @@ NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
Lstartgp:
LDGP(pv)
+#ifndef PRIMARY_BOOTBLOCK
+ lda sp,start /* start stack below text */
+ lda sp,-ENTRY_FRAME(sp)
+#endif
+
lda a0,_edata
lda a1,_end
subq a1,a0,a1
CALL(bzero)
-#if defined(NETBOOT) || defined(LOADER)
- lda sp,stack + 8192 - ENTRY_FRAME
-#endif
-
CALL(main) /* transfer to C */
XLEAF(_rtt, 0)
@@ -82,7 +83,3 @@ LEAF(cpu_number, 0)
call_pal PAL_VMS_mfpr_whami
RET
END(cpu_number)
-
-#if defined(NETBOOT) || defined(LOADER)
-BSS(stack, 8192)
-#endif
diff --git a/sys/boot/alpha/netboot/Makefile b/sys/boot/alpha/netboot/Makefile
index 927522c4b638f..bb4a77ea046d4 100644
--- a/sys/boot/alpha/netboot/Makefile
+++ b/sys/boot/alpha/netboot/Makefile
@@ -16,7 +16,8 @@ SRCS+= main.c conf.c dev_net.c
CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.OBJDIR}
-CFLAGS+= -DNETBOOT
+# Verbose ls causes extra heap usage
+CFLAGS+= -DVERBOSE_LS
CLEANFILES+= vers.c vers.o gensetdefs.o gensetdefs setdef0.o setdef1.o \
setdefs.h start.o
@@ -28,7 +29,6 @@ CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
CRT= start.o
STRIP=
-BINDIR?= /boot
all: ${BASE}
@@ -49,7 +49,7 @@ ${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
vers.o ${LIBSTAND} ${LIBALPHA} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c -DPRIMARY_BOOTBLOCK $<
setdef0.o: setdefs.h
diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc
index c29494ba6aef9..805b0094eaa2e 100644
--- a/sys/boot/common/Makefile.inc
+++ b/sys/boot/common/Makefile.inc
@@ -1,8 +1,7 @@
-# $Id: Makefile.inc,v 1.7 1998/11/02 23:28:10 msmith Exp $
+# $Id: Makefile.inc,v 1.5 1998/09/14 18:27:04 msmith Exp $
-SRCS+= bcache.c boot.c commands.c console.c devopen.c interp.c
-SRCS+= interp_backslash.c interp_parse.c load_aout.c load_elf.c ls.c misc.c
-SRCS+= module.c panic.c
+SRCS+= boot.c commands.c console.c devopen.c interp.c interp_backslash.c
+SRCS+= interp_parse.c load_aout.c load_elf.c ls.c misc.c module.c panic.c
# Machine-independant ISA PnP
.if HAVE_ISABUS
@@ -11,8 +10,3 @@ SRCS+= isapnp.c
.if HAVE_PNP
SRCS+= pnp.c
.endif
-
-# Forth interpreter
-.if BOOT_FORTH
-SRCS+= interp_forth.c
-.endif
diff --git a/sys/boot/common/bcache.c b/sys/boot/common/bcache.c
deleted file mode 100644
index fc12f578f9fa6..0000000000000
--- a/sys/boot/common/bcache.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: bcache.c,v 1.3 1998/11/04 00:29:01 msmith Exp $
- */
-
-/*
- * Simple LRU block cache
- */
-
-#include <stand.h>
-#include <string.h>
-#include <bitstring.h>
-
-#include "bootstrap.h"
-
-/* #define BCACHE_DEBUG */
-
-#ifdef BCACHE_DEBUG
-#define BCACHE_TIMEOUT 10
-# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __FUNCTION__ , ## args)
-#else
-#define BCACHE_TIMEOUT 2
-# define DEBUG(fmt, args...)
-#endif
-
-
-struct bcachectl
-{
- daddr_t bc_blkno;
- time_t bc_stamp;
- int bc_count;
-};
-
-static struct bcachectl *bcache_ctl;
-static caddr_t bcache_data;
-static bitstr_t *bcache_miss;
-static int bcache_nblks;
-static int bcache_blksize;
-static int bcache_hits, bcache_misses, bcache_ops, bcache_bypasses;
-static int bcache_bcount;
-
-static void bcache_insert(caddr_t buf, daddr_t blkno);
-static int bcache_lookup(caddr_t buf, daddr_t blkno);
-
-/*
- * Initialise the cache for (nblks) of (bsize).
- */
-int
-bcache_init(int nblks, size_t bsize)
-{
- int i;
-
- /* discard any old contents */
- if (bcache_data != NULL) {
- free(bcache_data);
- bcache_data = NULL;
- free(bcache_ctl);
- }
-
- /* Allocate control structures */
- bcache_nblks = nblks;
- bcache_blksize = bsize;
- bcache_data = malloc(bcache_nblks * bcache_blksize);
- bcache_ctl = (struct bcachectl *)malloc(bcache_nblks * sizeof(struct bcachectl));
- bcache_miss = bit_alloc((bcache_nblks + 1) / 2);
- if ((bcache_data == NULL) || (bcache_ctl == NULL) || (bcache_miss == NULL)) {
- if (bcache_miss)
- free(bcache_miss);
- if (bcache_ctl)
- free(bcache_ctl);
- if (bcache_data)
- free(bcache_data);
- bcache_data = NULL;
- return(ENOMEM);
- }
-
- /* Invalidate the cache */
- for (i = 0; i < bcache_nblks; i++) {
- bcache_ctl[i].bc_count = -1;
- bcache_ctl[i].bc_blkno = -1;
- }
-
- return(0);
-}
-
-/*
- * Handle a transfer request; fill in parts of the request that can
- * be satisfied by the cache, use the supplied strategy routine to do
- * device I/O and then use the I/O results to populate the cache.
- *
- * Requests larger than 1/2 the cache size will be bypassed and go
- * directly to the disk. XXX tune this.
- */
-int
-bcache_strategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf, size_t *rsize)
-{
- struct bcache_devdata *dd = (struct bcache_devdata *)devdata;
- int nblk, p_size;
- daddr_t p_blk;
- caddr_t p_buf;
- int i, j, result;
-
- bcache_ops++;
-
- /* bypass large requests, or when the cache is inactive */
- if ((bcache_data == NULL) || ((size * 2 / bcache_blksize) > bcache_nblks)) {
- DEBUG("bypass %d from %d", size / bcache_blksize, blk);
- bcache_bypasses++;
- return(dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize));
- }
-
- nblk = size / bcache_blksize;
- result = 0;
-
- /* Satisfy any cache hits up front */
- for (i = 0; i < nblk; i++) {
- if (bcache_lookup(buf + (bcache_blksize * i), blk + i)) {
- bit_set(bcache_miss, i); /* cache miss */
- bcache_misses++;
- } else {
- bit_clear(bcache_miss, i); /* cache hit */
- bcache_hits++;
- }
- }
-
- /* Go back and fill in any misses XXX optimise */
- p_blk = -1;
- p_buf = NULL;
- p_size = 0;
- for (i = 0; i < nblk; i++) {
- if (bit_test(bcache_miss, i)) {
- /* miss, add to pending transfer */
- if (p_blk == -1) {
- p_blk = blk + i;
- p_buf = buf + (bcache_blksize * i);
- p_size = 1;
- } else {
- p_size++;
- }
- } else if (p_blk != -1) {
- /* hit, complete pending transfer */
- result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL);
- if (result != 0)
- goto done;
- for (j = 0; j < p_size; j++)
- bcache_insert(p_buf + (j * bcache_blksize), p_blk + j);
- p_blk = -1;
- }
- }
- if (p_blk != -1) {
- /* pending transfer left */
- result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, p_size * bcache_blksize, p_buf, NULL);
- if (result != 0)
- goto done;
- for (j = 0; j < p_size; j++)
- bcache_insert(p_buf + (j * bcache_blksize), p_blk + j);
- }
-
- done:
- if ((result == 0) && (rsize != NULL))
- *rsize = size;
- return(result);
-}
-
-
-/*
- * Insert a block into the cache. Retire the oldest block to do so, if required.
- *
- * XXX the LRU algorithm will fail after 2^31 blocks have been transferred.
- */
-static void
-bcache_insert(caddr_t buf, daddr_t blkno)
-{
- time_t now;
- int i, cand, ocount;
-
- time(&now);
- cand = 0; /* assume the first block */
- ocount = bcache_ctl[0].bc_count;
-
- /* find the oldest block */
- for (i = 1; i < bcache_nblks; i++) {
- if (bcache_ctl[i].bc_blkno == blkno) {
- /* reuse old entry */
- cand = i;
- break;
- }
- if (bcache_ctl[i].bc_count < ocount) {
- ocount = bcache_ctl[i].bc_count;
- cand = i;
- }
- }
-
- DEBUG("insert blk %d -> %d @ %d # %d", blkno, cand, now, bcache_bcount);
- bcopy(buf, bcache_data + (bcache_blksize * cand), bcache_blksize);
- bcache_ctl[cand].bc_blkno = blkno;
- bcache_ctl[cand].bc_stamp = now;
- bcache_ctl[cand].bc_count = bcache_bcount++;
-}
-
-/*
- * Look for a block in the cache. Blocks more than BCACHE_TIMEOUT seconds old
- * may be stale (removable media) and thus are discarded. Copy the block out
- * if successful and return zero, or return nonzero on failure.
- */
-static int
-bcache_lookup(caddr_t buf, daddr_t blkno)
-{
- time_t now;
- int i;
-
- time(&now);
-
- for (i = 0; i < bcache_nblks; i++)
- /* cache hit? */
- if ((bcache_ctl[i].bc_blkno == blkno) && ((bcache_ctl[i].bc_stamp + BCACHE_TIMEOUT) >= now)) {
- bcopy(bcache_data + (bcache_blksize * i), buf, bcache_blksize);
- DEBUG("hit blk %d <- %d (now %d then %d)", blkno, i, now, bcache_ctl[i].bc_stamp);
- return(0);
- }
- return(ENOENT);
-}
-
-COMMAND_SET(bcachestat, "bcachestat", "get disk block cache stats", command_bcache);
-
-static int
-command_bcache(int argc, char *argv[])
-{
- int i;
-
- for (i = 0; i < bcache_nblks; i++) {
- printf("%08x %04x %04x|", bcache_ctl[i].bc_blkno, bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);
- if (((i + 1) % 4) == 0)
- printf("\n");
- }
- printf("\n%d ops %d bypasses %d hits %d misses\n", bcache_ops, bcache_bypasses, bcache_hits, bcache_misses);
- return(CMD_OK);
-}
-
diff --git a/sys/boot/common/boot.c b/sys/boot/common/boot.c
index 2de8603e881ee..608c9d02a9213 100644
--- a/sys/boot/common/boot.c
+++ b/sys/boot/common/boot.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: boot.c,v 1.9 1998/10/31 17:12:32 dfr Exp $
+ * $Id: boot.c,v 1.6 1998/10/11 10:10:41 peter Exp $
*/
/*
@@ -38,7 +38,7 @@
static char *getbootfile(int try);
/* List of kernel names to try (may be overwritten by boot.config) XXX should move from here? */
-static char *default_bootfiles = "kernel;kernel.old";
+static char *default_bootfiles = "kernel,kernel.old";
static int autoboot_tried;
@@ -203,13 +203,11 @@ autoboot(int delay, char *prompt)
break;
}
if (ntime != otime) {
- printf("\rBooting [%s] in %d seconds... ", getbootfile(0), (int)(when - ntime));
+ printf("\rBooting [%s] in %d seconds...", getbootfile(0), (int)(when - ntime));
otime = ntime;
cr = 1;
}
}
- if (yes)
- printf("\rBooting [%s]... ", getbootfile(0));
if (cr)
putchar('\n');
if (yes) {
@@ -243,11 +241,11 @@ getbootfile(int try)
spec = default_bootfiles;
while ((try > 0) && (spec != NULL)) {
- spec = strchr(spec, ';');
+ spec = strchr(spec, ',');
try--;
}
if (spec != NULL) {
- if ((ep = strchr(spec, ';')) != NULL) {
+ if ((ep = strchr(spec, ',')) != NULL) {
len = ep - spec;
} else {
len = strlen(spec);
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index ed450d91602e4..84f6d48097642 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -23,11 +23,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootstrap.h,v 1.17 1999/01/15 00:31:45 abial Exp $
+ * $Id: bootstrap.h,v 1.12 1998/10/09 07:09:22 msmith Exp $
*/
#include <sys/types.h>
-#include <sys/queue.h>
/* XXX debugging */
extern struct console vidconsole;
@@ -56,7 +55,7 @@ extern char command_errbuf[]; /* XXX blah, length */
/* interp.c */
extern void interact(void);
-extern int source(char *filename);
+extern void source(char *filename);
/* interp_parse.c */
extern int parse(int *argc, char ***argv, char *str);
@@ -72,15 +71,6 @@ extern size_t strlenout(vm_offset_t str);
extern char *strdupout(vm_offset_t str);
/*
- * Disk block cache
- */
-struct bcache_devdata
-{
- int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, void *buf, size_t *rsize);
- void *dv_devdata;
-};
-
-/*
* Modular console support.
*/
struct console
@@ -104,44 +94,33 @@ extern void cons_probe(void);
/*
* Plug-and-play enumerator/configurator interface.
*/
-struct pnphandler
+struct pnpident
{
- char *pp_name; /* handler/bus name */
- void (* pp_enumerate)(void); /* enumerate PnP devices, add to chain */
+ char *id_ident; /* ASCII identifier, actual format varies with bus/handler */
+ struct pnpident *id_next; /* the next identifier */
};
-struct pnpident
+struct pnphandler;
+struct pnpinfo
{
- char *id_ident; /* ASCII identifier, actual format varies with bus/handler */
- STAILQ_ENTRY(pnpident) id_link;
+ struct pnpident *pi_ident; /* list of identifiers */
+ int pi_revision; /* optional revision (or -1) if not supported */
+ char *pi_module; /* module/args nominated to handle device */
+ int pi_argc; /* module arguments */
+ char **pi_argv;
+ struct pnphandler *pi_handler; /* handler which detected this device */
+ struct pnpinfo *pi_next;
};
-struct pnpinfo
+struct pnphandler
{
- char *pi_desc; /* ASCII description, optional */
- int pi_revision; /* optional revision (or -1) if not supported */
- char *pi_module; /* module/args nominated to handle device */
- int pi_argc; /* module arguments */
- char **pi_argv;
- struct pnphandler *pi_handler; /* handler which detected this device */
- STAILQ_HEAD(,pnpident) pi_ident; /* list of identifiers */
- STAILQ_ENTRY(pnpinfo) pi_link;
+ char *pp_name; /* handler/bus name */
+ void (* pp_enumerate)(struct pnpinfo **); /* add detected devices to chain */
};
extern struct pnphandler *pnphandlers[]; /* provided by MD code */
extern void pnp_addident(struct pnpinfo *pi, char *ident);
-extern struct pnpinfo *pnp_allocinfo(void);
-extern void pnp_freeinfo(struct pnpinfo *pi);
-extern void pnp_addinfo(struct pnpinfo *pi);
-extern char *pnp_eisaformat(u_int8_t *data);
-
-/*
- * < 0 - No ISA in system
- * == 0 - Maybe ISA, search for read data port
- * > 0 - ISA in system, value is read data port address
- */
-extern int isapnp_readport;
/*
* Module metadata header.
@@ -201,53 +180,58 @@ extern vm_offset_t aout_findsym(char *name, struct loaded_module *mp);
extern int elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result);
-#ifndef NEW_LINKER_SET
-#include <sys/linker_set.h>
-
-/* XXX just for conversion's sake, until we move to the new linker set code */
-
-#define SET_FOREACH(pvar, set) \
- for (pvar = set.ls_items; \
- pvar < set.ls_items + set.ls_length; \
- pvar++)
-
-#else /* NEW_LINKER_SET */
+#if defined(__ELF__)
/*
- * Private macros, not to be used outside this header file.
+ * Alpha GAS needs an align before the section change. It seems to assume
+ * that after the .previous, it is aligned, so the following .align 3 is
+ * ignored. Since the previous instructions often contain strings, this is
+ * a problem.
*/
-#define __MAKE_SET(set, sym) \
- static void *__CONCAT(__setentry,__LINE__) \
- __attribute__((__section__("set_" #set),__unused__)) = &sym
-#define __SET_BEGIN(set) \
- ({ extern void *__CONCAT(__start_set_,set); \
- &__CONCAT(__start_set_,set); })
-#define __SET_END(set) \
- ({ extern void *__CONCAT(__stop_set_,set); \
- &__CONCAT(__stop_set_,set); })
-/*
- * Public macros.
- */
+#ifdef __alpha__
+#define MAKE_SET(set, sym) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".align 3"); \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".quad " #sym); \
+ __asm(".previous")
+#else
+#define MAKE_SET(set, sym) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".long " #sym); \
+ __asm(".previous")
+#endif
+#define TEXT_SET(set, sym) MAKE_SET(set, sym)
+#define DATA_SET(set, sym) MAKE_SET(set, sym)
+#define BSS_SET(set, sym) MAKE_SET(set, sym)
+#define ABS_SET(set, sym) MAKE_SET(set, sym)
-/* Add an entry to a set. */
-#define TEXT_SET(set, sym) __MAKE_SET(set, sym)
-#define DATA_SET(set, sym) __MAKE_SET(set, sym)
-#define BSS_SET(set, sym) __MAKE_SET(set, sym)
-#define ABS_SET(set, sym) __MAKE_SET(set, sym)
+#else
/*
- * Iterate over all the elements of a set.
- *
- * Sets always contain addresses of things, and "pvar" points to words
- * containing those addresses. Thus is must be declared as "type **pvar",
- * and the address of each set item is obtained inside the loop by "*pvar".
+ * Linker set support, directly from <sys/kernel.h>
+ *
+ * NB: the constants defined below must match those defined in
+ * ld/ld.h. Since their calculation requires arithmetic, we
+ * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
*/
-#define SET_FOREACH(pvar, set) \
- for (pvar = (__typeof__(pvar))__SET_BEGIN(set); \
- pvar < (__typeof__(pvar))__SET_END(set); pvar++)
+#define MAKE_SET(set, sym, type) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
+#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
+#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
+#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
+#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
+
#endif
+struct linker_set {
+ int ls_length;
+ const void *ls_items[1]; /* really ls_length of them, trailing NULL */
+};
+
/*
* Support for commands
*/
diff --git a/sys/boot/common/commands.c b/sys/boot/common/commands.c
index fe0eb54d77077..77cc43ca0e716 100644
--- a/sys/boot/common/commands.c
+++ b/sys/boot/common/commands.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: commands.c,v 1.8 1999/01/09 02:34:48 msmith Exp $
+ * $Id: commands.c,v 1.4 1998/10/07 02:38:26 msmith Exp $
*/
#include <stand.h>
@@ -34,181 +34,35 @@
char *command_errmsg;
char command_errbuf[256]; /* XXX should have procedural interface for setting, size limit? */
-
-
-/*
- * Help is read from a formatted text file.
- *
- * Entries in the file are formatted as
-
-# Ttopic [Ssubtopic] Ddescription
-help
-text
-here
-#
-
- *
- * Note that for code simplicity's sake, the above format must be followed
- * exactly.
- *
- * Subtopic entries must immediately follow the topic (this is used to
- * produce the listing of subtopics).
- *
- * If no argument(s) are supplied by the user, the help for 'help' is displayed.
- */
-COMMAND_SET(help, "help", "detailed help", command_help);
-
-static int
-help_getnext(int fd, char **topic, char **subtopic, char **desc)
-{
- char line[81], *cp, *ep;
-
- for (;;) {
- if (fgetstr(line, 80, fd) < 0)
- return(0);
-
- if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' '))
- continue;
-
- *topic = *subtopic = *desc = NULL;
- cp = line + 2;
- while((cp != NULL) && (*cp != 0)) {
- ep = strchr(cp, ' ');
- if ((*cp == 'T') && (*topic == NULL)) {
- if (ep != NULL)
- *ep++ = 0;
- *topic = strdup(cp + 1);
- } else if ((*cp == 'S') && (*subtopic == NULL)) {
- if (ep != NULL)
- *ep++ = 0;
- *subtopic = strdup(cp + 1);
- } else if (*cp == 'D') {
- *desc = strdup(cp + 1);
- ep = NULL;
- }
- cp = ep;
- }
- if (*topic == NULL) {
- if (*subtopic != NULL)
- free(*subtopic);
- if (*desc != NULL)
- free(*desc);
- continue;
- }
- return(1);
- }
-}
-
-static void
-help_emitsummary(char *topic, char *subtopic, char *desc)
-{
- int i;
- pager_output(" ");
- pager_output(topic);
- i = strlen(topic);
- if (subtopic != NULL) {
- pager_output(" ");
- pager_output(subtopic);
- i += strlen(subtopic) + 1;
- }
- if (desc != NULL) {
- do {
- pager_output(" ");
- } while (i++ < 30);
- pager_output(desc);
- }
- pager_output("\n");
-}
+COMMAND_SET(help, "help", "detailed help", command_help);
-
static int
-command_help(int argc, char *argv[])
+command_help(int argc, char *argv[])
{
- char buf[81]; /* XXX buffer size? */
- int hfd, matched, doindex;
- char *topic, *subtopic, *t, *s, *d;
+ char helppath[80]; /* XXX buffer size? */
/* page the help text from our load path */
- sprintf(buf, "%s/boot/loader.help", getenv("loaddev"));
- if ((hfd = open(buf, O_RDONLY)) < 0) {
+ sprintf(helppath, "%s/boot/boot.help", getenv("loaddev"));
+ printf("%s\n", helppath);
+ if (pager_file(helppath) == -1)
printf("Verbose help not available, use '?' to list commands\n");
- return(CMD_OK);
- }
-
- /* pick up request from arguments */
- topic = subtopic = NULL;
- switch(argc) {
- case 3:
- subtopic = strdup(argv[2]);
- case 2:
- topic = strdup(argv[1]);
- break;
- case 1:
- topic = strdup("help");
- break;
- default:
- command_errmsg = "usage is 'help <topic> [<subtopic>]";
- return(CMD_ERROR);
- }
-
- /* magic "index" keyword */
- doindex = !strcmp(topic, "index");
- matched = doindex;
-
- /* Scan the helpfile looking for help matching the request */
- pager_open();
- while(help_getnext(hfd, &t, &s, &d)) {
-
- if (doindex) { /* dink around formatting */
- help_emitsummary(t, s, d);
-
- } else if (strcmp(topic, t)) {
- /* topic mismatch */
- if(matched) /* nothing more on this topic, stop scanning */
- break;
-
- } else {
- /* topic matched */
- matched = 1;
- if (((subtopic == NULL) && (s == NULL)) ||
- ((subtopic != NULL) && (s != NULL) && !strcmp(subtopic, s))) {
- /* exact match, print text */
- while((fgetstr(buf, 80, hfd) >= 0) && (buf[0] != '#')) {
- pager_output(buf);
- pager_output("\n");
- }
- } else if ((subtopic == NULL) && (s != NULL)) {
- /* topic match, list subtopics */
- help_emitsummary(t, s, d);
- }
- }
- free(t);
- free(s);
- free(d);
- }
- pager_close();
- close(hfd);
- if (!matched) {
- sprintf(command_errbuf, "no help available for '%s'", topic);
- return(CMD_ERROR);
- }
return(CMD_OK);
}
-
COMMAND_SET(commandlist, "?", "list commands", command_commandlist);
static int
command_commandlist(int argc, char *argv[])
{
struct bootblk_command **cmdp;
+ int i;
printf("Available commands:\n");
- SET_FOREACH(cmdp, Xcommand_set) {
- if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL))
- printf(" %-15s %s\n", (*cmdp)->c_name, (*cmdp)->c_desc);
- }
+ cmdp = (struct bootblk_command **)Xcommand_set.ls_items;
+ for (i = 0; i < Xcommand_set.ls_length; i++)
+ if ((cmdp[i]->c_name != NULL) && (cmdp[i]->c_desc != NULL))
+ printf(" %-15s %s\n", cmdp[i]->c_name, cmdp[i]->c_desc);
return(CMD_OK);
}
@@ -299,7 +153,6 @@ command_echo(int argc, char *argv[])
nl = 0;
optind = 1;
- optreset = 1;
while ((ch = getopt(argc, argv, "n")) != -1) {
switch(ch) {
case 'n':
@@ -344,7 +197,6 @@ command_read(int argc, char *argv[])
timeout = -1;
prompt = NULL;
optind = 1;
- optreset = 1;
while ((c = getopt(argc, argv, "p:t:")) != -1) {
switch(c) {
@@ -382,47 +234,3 @@ command_read(int argc, char *argv[])
setenv(name, buf, 1);
return(CMD_OK);
}
-
-/*
- * List all disk-like devices
- */
-COMMAND_SET(lsdev, "lsdev", "list all devices", command_lsdev);
-
-static int
-command_lsdev(int argc, char *argv[])
-{
- int verbose, ch, i;
- char line[80];
-
- verbose = 0;
- optind = 1;
- optreset = 1;
- while ((ch = getopt(argc, argv, "v")) != -1) {
- switch(ch) {
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- /* getopt has already reported an error */
- return(CMD_OK);
- }
- }
- argv += (optind);
- argc -= (optind);
-
- pager_open();
- for (i = 0; devsw[i] != NULL; i++) {
- if (devsw[i]->dv_print != NULL){
- sprintf(line, "%s @ %p\n", devsw[i]->dv_name, devsw[i]->dv_print);
- pager_output(line);
- devsw[i]->dv_print(verbose);
- } else {
- sprintf(line, "%s: (unknown)\n", devsw[i]->dv_name);
- pager_output(line);
- }
- }
- pager_close();
- return(CMD_OK);
-}
-
diff --git a/sys/boot/common/console.c b/sys/boot/common/console.c
index 8c4377f2bcd4f..b9534d304030b 100644
--- a/sys/boot/common/console.c
+++ b/sys/boot/common/console.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: console.c,v 1.3 1998/10/11 10:19:11 peter Exp $
+ * $Id: console.c,v 1.2 1998/09/26 01:29:13 msmith Exp $
*/
#include <stand.h>
@@ -150,12 +150,8 @@ cons_set(struct env_var *ev, int flags, void *value)
{
int cons, active;
- if ((value == NULL) || ((active = cons_find(value)) == -1)) {
- if (value != NULL)
- printf("no such console '%s'\n", (char *)value);
- printf("Available consoles:\n");
- for (cons = 0; consoles[cons] != NULL; cons++)
- printf(" %s\n", consoles[cons]->c_name);
+ if ((active = cons_find(value)) == -1) {
+ printf("no such console '%s'\n", (char *)value);
return(CMD_ERROR);
}
diff --git a/sys/boot/common/help.common b/sys/boot/common/help.common
deleted file mode 100644
index e467b1ca70925..0000000000000
--- a/sys/boot/common/help.common
+++ /dev/null
@@ -1,262 +0,0 @@
-################################################################################
-# Thelp DDisplay command help
-
- help [topic [subtopic]]
- ?
-
- The help command displays help on commands and their usage.
-
- In command help, a term enclosed with <...> indicates a value as
- described by the term. A term enclosed with [...] is optional,
- and may not be required by all forms of the command.
-
- Some commands may not be availalble. Use the '?' command to list
- most available commands.
-
-################################################################################
-# Tautoboot DBoot after a delay
-
- autoboot [<delay> [<prompt>]]
-
- Displays <prompt> or a default prompt, and counts down <delay> seconds
- before attempting to boot. If <delay> is not specified, the default
- value is 10.
-
-################################################################################
-# Tboot DBoot immediately
-
- boot [-<arg> ...] [<kernelname>]
-
- Boot the system. If arguments are specified, they are added to the
- arguments for the kernel. If <kernelname> is specified, and a kernel
- has not already been loaded, it will be booted instead of the default
- kernel.
-
-################################################################################
-# Techo DEcho arguments
-
- echo [-n] [<message>]
-
- Emits <message>, with no trailing newline if -n is specified. This is
- most useful in conjunction with scripts and the '@' line prefix.
-
- Variables are substituted by prefixing them with $, eg.
-
- echo Current device is $currdev
-
- will print the current device.
-
-################################################################################
-# Tload DLoad a kernel or module
-
- load [-t <type>] <filename>
-
- Loads the module contained in <filename> into memory. If no other
- modules are loaded, <filename> must be a kernel or the command will
- fail.
-
- If -t is specified, the module is loaded as raw data of <type>, for
- later use by the kernel or other modules. <type> may be any string.
-
-################################################################################
-# Tls DList files
-
- ls [-l] [<path>]
-
- Displays a listing of files in the directory <path>, or the root
- directory of the current device if <path> is not specified.
-
- The -l argument displays file sizes as well; the process of obtaining
- file sizes on some media may be very slow.
-
-################################################################################
-# Tlsdev DList devices
-
- lsdev [-v]
-
- List all of the devices from which it may be possible to load modules.
- If -v is specified, print more details.
-
-################################################################################
-# Tlsmod DList modules
-
- lsmod [-v]
-
- List loaded modules. If [-v] is specified, print more details.
-
-################################################################################
-# Tpnpscan DScan for PnP devices
-
- pnpscan [-v]
-
- Scan for Plug-and-Play devices. This command is normally automatically
- run as part of the boot process, in order to dynamically load modules
- required for system operation.
-
- If the -v argument is specified, details on the devices found will
- be printed.
-
-################################################################################
-# Tset DSet a variable
-
- set <variable name>
- set <variable name>=<value>
-
- The set command is used to set variables.
-
-################################################################################
-# Tset Sautoboot_delay DSet the default autoboot delay
-
- set autoboot_delay=<value>
-
- Sets the default delay for the autoboot command to <value> seconds.
-
-################################################################################
-# Tset Sbootfile DSet the default boot file set
-
- set bootfile=<filename>[,<filename>...]
-
- The default search path for bootable kernels is /kernel,/kernel.old.
- It may be overridden by setting the bootfile variable to a
- semicolon-separated list of paths, which will be searched for in turn.
-
-################################################################################
-# Tset Sboot_askname DPrompt for root device
-
- set boot_askname
-
- Instructs the kernel to prompt the user for the name of the root device
- when the kernel is booted.
-
-################################################################################
-# Tset Sboot_ddb DDrop to the kernel debugger (DDB)
-
- set boot_ddb
-
- Instructs the kernel to start in the DDB debugger, rather than
- proceeding to initialise when booted.
-
-################################################################################
-# Tset Sboot_gdb DSelect gdb-remote mode
-
- set boot_gdb
-
- Selects gdb-remote mode for the kernel debugger by default.
-
-################################################################################
-# Tset Sboot_single DStart system in single-user mode
-
- set boot_single
-
- Prevents the kernel from initiating a multi-user startup, single-user
- mode will be entered when the kernel has finished device probes.
-
-################################################################################
-# Tset Sboot_verbose DVerbose boot messages
-
- set boot_verbose
-
- Setting this variable causes extra debugging information to be printed
- by the kernel during the boot phase.
-
-################################################################################
-# Tset Sconsole DSet the current console
-
- set console[=<value>]
-
- Sets the current console. If <value> is omitted, a list of valid
- consoles will be displayed.
-
-################################################################################
-# Tset Scurrdev DSet the current device
-
- set currdev=<device>
-
- Selects the default device. Syntax for devices is odd.
-
-################################################################################
-# Tset Smodule_path DSet the module search path
-
- set module_path=<path>[,<path>...]
-
- Sets the list of directories which will be searched in for modules
- named in a load command or implicitly required by a dependancy.
-
-################################################################################
-# Tset Sprompt DSet the command prompt
-
- set prompt=<value>
-
- The command prompt is displayed when the loader is waiting for input.
- Variable substitution is performed on the prompt. The default
- prompt can be set with:
-
- set prompt=\$currdev>
-
-################################################################################
-# Tset Srootdev DSet the root filesystem
-
- set rootdev=<path>
-
- By default the value of $currdev is used to set the root filesystem
- when the kernel is booted. This can be overridden by setting
- $rootdev explicitly.
-
-################################################################################
-# Tshow DShow the values of variables
-
- show [<variable>]
-
- Displays the value of <variable>, or all variables if not specified.
- Multiple paths can be separated with a semicolon.
-
- See the set command for a list of some variables.
-
-################################################################################
-# Tsource DRead commands from a script file
-
- source <filename>
-
- The entire contents of <filename> are read into memory before executing
- commands, so it is safe to source a file from removable media.
-
- A number of modifiers may be prefixed to commands within a script file
- to alter their behaviour:
-
- @ Suppresses the printing of the command when executed.
-
- - Prevents the script from terminating if the command returns
- an error.
-
-################################################################################
-# Tread DRead input from the terminal
-
- read [-t <value>] [-p <prompt>] [<variable name>]
-
- The read command reads a line of input from the terminal. If the
- -t argument is specified, it will return nothing if no input has been
- received after <value> seconds. (Any keypress will cancel the
- timeout).
-
- If -p is specified, <prompt> is printed before reading input. No
- newline is emitted after the prompt.
-
- If a variable name is supplied, the variable is set to the value read,
- less any terminating newline.
-
-################################################################################
-# Tunload DRemove all modules from memory
-
- unload
-
- This command removes any kernel and all loaded modules from memory.
-
-################################################################################
-# Tunset DUnset a variable
-
- unset <variable name>
-
- If allowed, the named variable's value is discarded and the variable
- is removed.
-
-################################################################################
diff --git a/sys/boot/common/interp.c b/sys/boot/common/interp.c
index 22d2199beebcc..d24ed6e3182a6 100644
--- a/sys/boot/common/interp.c
+++ b/sys/boot/common/interp.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: interp.c,v 1.11 1999/01/13 21:59:58 abial Exp $
+ * $Id: interp.c,v 1.5 1998/10/07 02:38:26 msmith Exp $
*/
/*
* Simple commandline interpreter, toplevel and misc.
@@ -35,15 +35,6 @@
#include <string.h>
#include "bootstrap.h"
-#ifdef BOOT_FORTH
-#include "ficl.h"
-#define RETURN(x) stackPushINT32(bf_vm->pStack,!x); return(x)
-
-extern FICL_VM *bf_vm;
-#else
-#define RETURN(x) return(x)
-#endif
-
#define MAXARGS 20 /* maximum number of arguments allowed */
static void prompt(void);
@@ -51,10 +42,10 @@ static void prompt(void);
/*
* Perform the command
*/
-int
+static int
perform(int argc, char *argv[])
{
- int result;
+ int i, result;
struct bootblk_command **cmdp;
bootblk_cmd_t *cmd;
@@ -67,17 +58,17 @@ perform(int argc, char *argv[])
cmd = NULL;
result = CMD_ERROR;
- /* search the command set for the command */
- SET_FOREACH(cmdp, Xcommand_set) {
- if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name))
- cmd = (*cmdp)->c_fn;
+ cmdp = (struct bootblk_command **)Xcommand_set.ls_items;
+ for (i = 0; i < Xcommand_set.ls_length; i++) {
+ if ((cmdp[i]->c_name != NULL) && !strcmp(argv[0], cmdp[i]->c_name))
+ cmd = cmdp[i]->c_fn;
}
if (cmd != NULL) {
result = (cmd)(argc, argv);
} else {
command_errmsg = "unknown command";
}
- RETURN(result);
+ return(result);
}
/*
@@ -87,20 +78,13 @@ void
interact(void)
{
char input[256]; /* big enough? */
-#ifndef BOOT_FORTH
int argc;
char **argv;
-#endif
-
-#ifdef BOOT_FORTH
- bf_init();
-#endif
/*
* Read our default configuration
*/
- if(source("/boot/loader.rc")!=CMD_OK)
- source("/boot/boot.conf");
+ source("/boot/boot.conf");
printf("\n");
/*
* Before interacting, we might want to autoboot.
@@ -118,9 +102,6 @@ interact(void)
input[0] = '\0';
prompt();
ngets(input, sizeof(input));
-#ifdef BOOT_FORTH
- bf_run(input);
-#else
if (!parse(&argc, &argv, input)) {
if (perform(argc, argv))
printf("%s: %s\n", argv[0], command_errmsg);
@@ -128,7 +109,6 @@ interact(void)
} else {
printf("parse error\n");
}
-#endif
}
}
@@ -147,12 +127,10 @@ static int
command_source(int argc, char *argv[])
{
int i;
- int res;
- res=CMD_OK;
- for (i = 1; (i < argc) && (res == CMD_OK); i++)
- res=source(argv[i]);
- return(res);
+ for (i = 1; i < argc; i++)
+ source(argv[i]);
+ return(CMD_OK);
}
struct sourceline
@@ -165,18 +143,18 @@ struct sourceline
struct sourceline *next;
};
-int
+void
source(char *filename)
{
struct sourceline *script, *se, *sp;
char input[256]; /* big enough? */
- int argc,res;
+ int argc;
char **argv, *cp;
int fd, flags, line;
if (((fd = open(filename, O_RDONLY)) == -1)) {
- sprintf(command_errbuf,"can't open '%s': %s\n", filename, strerror(errno));
- return(CMD_ERROR);
+ printf("can't open '%s': %s\n", filename, strerror(errno));
+ return;
}
/*
@@ -223,7 +201,6 @@ source(char *filename)
* Execute the script
*/
argv = NULL;
- res = CMD_OK;
for (sp = script; sp != NULL; sp = sp->next) {
/* print if not being quiet */
@@ -237,16 +214,13 @@ source(char *filename)
if ((argc > 0) && (perform(argc, argv) != 0)) {
/* normal command */
printf("%s: %s\n", argv[0], command_errmsg);
- if (!(sp->flags & SL_IGNOREERR)) {
- res=CMD_ERROR;
+ if (!(sp->flags & SL_IGNOREERR))
break;
- }
}
free(argv);
argv = NULL;
} else {
printf("%s line %d: parse error\n", filename, sp->line);
- res=CMD_ERROR;
break;
}
}
@@ -257,7 +231,6 @@ source(char *filename)
script = script->next;
free(se);
}
- return(res);
}
/*
diff --git a/sys/boot/common/interp_backslash.c b/sys/boot/common/interp_backslash.c
index 6de118ec63fc6..8807fdaa9645b 100644
--- a/sys/boot/common/interp_backslash.c
+++ b/sys/boot/common/interp_backslash.c
@@ -11,7 +11,7 @@
* Jordan K. Hubbard
* 29 August 1998
*
- * $Id: interp_backslash.c,v 1.2 1998/09/03 06:14:41 jkh Exp $
+ * $Id: interp_backslash.c,v 1.1 1998/09/01 00:41:24 msmith Exp $
*
* Routine for doing backslash elimination.
*/
@@ -52,10 +52,9 @@ backslash(char *str)
str++;
break;
- /* preserve backslashed quotes, dollar signs */
+ /* preserve backslashed quotes */
case '\'':
case '"':
- case '$':
new_str[i++] = '\\';
new_str[i++] = *str++;
break;
diff --git a/sys/boot/common/interp_forth.c b/sys/boot/common/interp_forth.c
deleted file mode 100644
index 68e09340b0add..0000000000000
--- a/sys/boot/common/interp_forth.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: interp_forth.c,v 1.8 1998/12/22 11:41:51 abial Exp $
- */
-
-#include <string.h>
-#include <stand.h>
-#include "bootstrap.h"
-#include "ficl.h"
-
-/* #define BFORTH_DEBUG */
-
-#ifdef BFORTH_DEBUG
-# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __FUNCTION__ , ## args)
-#else
-# define DEBUG(fmt, args...)
-#endif
-
-/*
- * BootForth Interface to Ficl Forth interpreter.
- */
-
-FICL_VM *bf_vm;
-
-/*
- * Shim for taking commands from BF and passing them out to 'standard'
- * argv/argc command functions.
- */
-static void
-bf_command(FICL_VM *vm)
-{
- char *name, *line, *tail, *cp;
- int len;
- struct bootblk_command **cmdp;
- bootblk_cmd_t *cmd;
- int argc, result;
- char **argv;
-
- /* Get the name of the current word */
- name = vm->runningWord->name;
-
- /* Find our command structure */
- cmd = NULL;
- SET_FOREACH(cmdp, Xcommand_set) {
- if (((*cmdp)->c_name != NULL) && !strcmp(name, (*cmdp)->c_name))
- cmd = (*cmdp)->c_fn;
- }
- if (cmd == NULL)
- panic("callout for unknown command '%s'", name);
-
- /* Get remainder of invocation */
- tail = vmGetInBuf(vm);
- for (cp = tail, len = 0; *cp != 0 && *cp != '\n'; cp++, len++)
- ;
-
- line = malloc(strlen(name) + len + 2);
- strcpy(line, name);
- if (len > 0) {
- strcat(line, " ");
- strncat(line, tail, len);
- vmUpdateTib(vm, tail + len);
- }
- DEBUG("cmd '%s'", line);
-
- command_errmsg = command_errbuf;
- command_errbuf[0] = 0;
- if (!parse(&argc, &argv, line)) {
- result = (cmd)(argc, argv);
- free(argv);
- if(result != 0) {
- vmTextOut(vm,argv[0],0);
- vmTextOut(vm,": ",0);
- vmTextOut(vm,command_errmsg,1);
- }
- } else {
- vmTextOut(vm, "parse error\n", 1);
- result=1;
- }
- free(line);
- stackPushINT32(vm->pStack,!result);
-}
-
-/*
- * Initialise the Forth interpreter, create all our commands as words.
- */
-void
-bf_init(void)
-{
- struct bootblk_command **cmdp;
- int fd;
-
- ficlInitSystem(4000); /* Default dictionary ~4000 cells */
- bf_vm = ficlNewVM();
-
- /* make all commands appear as Forth words */
- SET_FOREACH(cmdp, Xcommand_set)
- ficlBuild((*cmdp)->c_name, bf_command, FW_DEFAULT);
-
- /* try to load and run init file if present */
- if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) {
- (void)ficlExecFD(bf_vm, fd);
- close(fd);
- }
-}
-
-/*
- * Feed a line of user input to the Forth interpreter
- */
-void
-bf_run(char *line)
-{
- int result;
-
- result = ficlExec(bf_vm, line);
- DEBUG("ficlExec '%s' = %d", line, result);
-
- if (result == VM_USEREXIT)
- panic("interpreter exit");
-}
diff --git a/sys/boot/common/interp_parse.c b/sys/boot/common/interp_parse.c
index 865c8cbc05011..ef235632bd664 100644
--- a/sys/boot/common/interp_parse.c
+++ b/sys/boot/common/interp_parse.c
@@ -11,7 +11,7 @@
* Jordan K. Hubbard
* 29 August 1998
*
- * $Id: interp_parse.c,v 1.5 1999/01/10 05:08:12 msmith Exp $
+ * $Id: interp_parse.c,v 1.3 1998/09/04 02:43:26 msmith Exp $
*
* The meat of the simple parser.
*/
@@ -100,11 +100,7 @@ parse(int *argc, char ***argv, char *str)
while (*p) {
switch (state) {
case STR:
- if ((*p == '\\') && p[1]) {
- p++;
- PARSE_FAIL(i == (PARSE_BUFSIZE - 1));
- buf[i++] = *p++;
- } else if (isquote(*p)) {
+ if (isquote(*p)) {
quote = quote ? 0 : *p;
++p;
}
diff --git a/sys/boot/common/isapnp.c b/sys/boot/common/isapnp.c
index 865e8f683e153..cc28da6c954f6 100644
--- a/sys/boot/common/isapnp.c
+++ b/sys/boot/common/isapnp.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isapnp.c,v 1.3 1998/10/21 20:07:04 msmith Exp $
+ * $Id: isapnp.c,v 1.1 1998/09/18 00:24:25 msmith Exp $
*/
/*
@@ -43,17 +43,17 @@ static void isapnp_write(int d, u_char r);
static u_char isapnp_read(int d);
static void isapnp_send_Initiation_LFSR();
static int isapnp_get_serial(u_int8_t *p);
-static int isapnp_isolation_protocol(void);
-static void isapnp_enumerate(void);
+static int isapnp_isolation_protocol(struct pnpinfo **pnplist);
+static void isapnp_enumerate(struct pnpinfo **pnplist);
/* PnP read data port */
-int isapnp_readport = 0;
+static int pnp_rd_port;
#define _PNP_ID_LEN 9
struct pnphandler isapnphandler =
{
- "ISA bus",
+ "isapnp",
isapnp_enumerate
};
@@ -68,7 +68,7 @@ static u_char
isapnp_read(int d)
{
outb (_PNP_ADDRESS, d);
- return (inb(isapnp_readport));
+ return (inb(3 | (pnp_rd_port <<2)));
}
/*
@@ -104,11 +104,11 @@ isapnp_get_serial(u_int8_t *data)
bzero(data, _PNP_ID_LEN);
outb(_PNP_ADDRESS, SERIAL_ISOLATION);
for (i = 0; i < 72; i++) {
- bit = inb(isapnp_readport) == 0x55;
+ bit = inb((pnp_rd_port << 2) | 0x3) == 0x55;
delay(250); /* Delay 250 usec */
/* Can't Short Circuit the next evaluation, so 'and' is last */
- bit = (inb(isapnp_readport) == 0xaa) && bit;
+ bit = (inb((pnp_rd_port << 2) | 0x3) == 0xaa) && bit;
delay(250); /* Delay 250 usec */
valid = valid || bit;
@@ -126,112 +126,87 @@ isapnp_get_serial(u_int8_t *data)
}
/*
- * Fills the buffer with resource info from the device.
- * Returns nonzero if the device fails to report
+ * Format a pnp id as a string in standard ISA PnP format, AAAIIRR
+ * where 'AAA' is the EISA ID, II is the product ID and RR the revision ID.
*/
-static int
-isapnp_get_resource_info(u_int8_t *buffer, int len)
+static char *
+isapnp_format(u_int8_t *data)
{
- int i, j;
- u_char temp;
-
- for (i = 0; i < len; i++) {
- outb(_PNP_ADDRESS, STATUS);
- for (j = 0; j < 100; j++) {
- if ((inb(isapnp_readport)) & 0x1)
- break;
- delay(1);
- }
- if (j == 100) {
- printf("PnP device failed to report resource data\n");
- return(1);
- }
- outb(_PNP_ADDRESS, RESOURCE_DATA);
- temp = inb(isapnp_readport);
- if (buffer != NULL)
- buffer[i] = temp;
- }
- return(0);
+ static char idbuf[8];
+ const char hextoascii[] = "0123456789abcdef";
+
+ idbuf[0] = '@' + ((data[0] & 0x7c) >> 2);
+ idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5));
+ idbuf[2] = '@' + (data[1] & 0x1f);
+ idbuf[3] = hextoascii[(data[2] >> 4)];
+ idbuf[4] = hextoascii[(data[2] & 0xf)];
+ idbuf[5] = hextoascii[(data[3] >> 4)];
+ idbuf[6] = hextoascii[(data[3] & 0xf)];
+ idbuf[7] = 0;
}
/*
- * Scan Resource Data for useful information.
- *
- * We scan the resource data for compatible device IDs and
- * identifier strings; we only take the first identifier string
- * and assume it's for the card as a whole.
- *
- * Returns 0 if the scan completed OK, nonzero on error.
+ * Try to read a compatible device ID from the current device, return
+ * 1 if we found one.
*/
+#define READ_RSC(c) {while ((isapnp_read(STATUS) & 1) == 0); (c) = isapnp_read(RESOURCE_DATA);}
static int
-isapnp_scan_resdata(struct pnpinfo *pi)
+isapnp_getid(u_int8_t *data)
{
- u_char tag, resinfo[8];
- int large_len, limit;
- char *str;
-
- limit = 1000;
- while ((limit-- > 0) && !isapnp_get_resource_info(&tag, 1)) {
- if (PNP_RES_TYPE(tag) == 0) {
- /* Small resource */
- switch (PNP_SRES_NUM(tag)) {
-
- case COMP_DEVICE_ID:
- /* Got a compatible device id resource */
- if (isapnp_get_resource_info(resinfo, PNP_SRES_LEN(tag)))
- return(1);
- pnp_addident(pi, pnp_eisaformat(resinfo));
-
- case END_TAG:
- return(0);
- break;
-
- default:
- /* Skip this resource */
- if (isapnp_get_resource_info(NULL, PNP_SRES_LEN(tag)))
- return(1);
- break;
- }
- } else {
- /* Large resource */
- if (isapnp_get_resource_info(resinfo, 2))
+ int discard, pos, len;
+ u_int8_t c, t;
+
+ discard = 0;
+ len = 0;
+ pos = 0;
+
+ for (;;) {
+ READ_RSC(c);
+ /* skipping junk? */
+ if (discard > 0) {
+ discard--;
+ continue;
+ }
+ /* copying data? */
+ if (len > 0) {
+ data[pos++] = c;
+ /* got all data? */
+ if (pos >= len)
return(1);
-
- large_len = resinfo[1];
- large_len = (large_len << 8) + resinfo[0];
-
- switch(PNP_LRES_NUM(tag)) {
-
- case ID_STRING_ANSI:
- str = malloc(large_len + 1);
- if (isapnp_get_resource_info(str, large_len)) {
- free(str);
- return(1);
- }
- str[large_len] = 0;
- if (pi->pi_desc == NULL) {
- pi->pi_desc = str;
- } else {
- free(str);
- }
- break;
-
- default:
- /* Large resource, skip it */
- if (isapnp_get_resource_info(NULL, large_len))
- return(1);
- }
}
+ /* resource type */
+ if (c & 0x80) { /* large resource, throw it away */
+ if (c == 0xff)
+ return(0); /* end of resources */
+ READ_RSC(c);
+ discard = c;
+ READ_RSC(c);
+ discard += ((int)c << 8);
+ continue;
+ }
+ /* small resource */
+ t = (c >> 3) & 0xf;
+ if (t == 0xf)
+ return(0); /* end of resources */
+ if ((t == LOG_DEVICE_ID) || (t == COMP_DEVICE_ID)) {
+ len = c & 7;
+ pos = 0;
+ continue;
+ }
+ discard = c & 7; /* unwanted small resource */
}
- return(1);
+
}
+
/*
- * Run the isolation protocol. Upon exiting, all cards are aware that
- * they should use isapnp_readport as the READ_DATA port.
+ * Run the isolation protocol. Use pnp_rd_port as the READ_DATA port
+ * value (caller should try multiple READ_DATA locations before giving
+ * up). Upon exiting, all cards are aware that they should use
+ * pnp_rd_port as the READ_DATA port.
*/
static int
-isapnp_isolation_protocol(void)
+isapnp_isolation_protocol(struct pnpinfo **pilist)
{
int csn;
struct pnpinfo *pi;
@@ -246,32 +221,30 @@ isapnp_isolation_protocol(void)
for (csn = 1; ; csn++) {
/* Wake up cards without a CSN (ie. all of them) */
isapnp_write(WAKE, 0);
- isapnp_write(SET_RD_DATA, (isapnp_readport >> 2));
+ isapnp_write(SET_RD_DATA, pnp_rd_port);
outb(_PNP_ADDRESS, SERIAL_ISOLATION);
delay(1000); /* Delay 1 msec */
if (isapnp_get_serial(cardid)) {
isapnp_write(SET_CSN, csn);
- pi = pnp_allocinfo();
+ pi = malloc(sizeof(struct pnpinfo));
+ pi->pi_next = *pilist;
+ *pilist = pi;
ndevs++;
- pnp_addident(pi, pnp_eisaformat(cardid));
/* scan the card obtaining all the identifiers it holds */
- if (isapnp_scan_resdata(pi)) {
- pnp_freeinfo(pi); /* error getting data, ignore */
- } else {
- pnp_addinfo(pi);
+ while (isapnp_getid(cardid)) {
+ printf(" %s\n", isapnp_format(cardid));
+ pnp_addident(pi, isapnp_format(cardid));
}
- } else {
+ } else
break;
- }
}
/* Move all cards to wait-for-key state */
- while (--csn > 0) {
+ while (csn >= 0) {
isapnp_send_Initiation_LFSR();
isapnp_write(WAKE, csn);
isapnp_write(CONFIG_CONTROL, 0x02);
delay(1000); /* XXX is it really necessary ? */
- csn--;
}
return(ndevs);
}
@@ -280,40 +253,17 @@ isapnp_isolation_protocol(void)
* Locate ISA-PnP devices and populate the supplied list.
*/
static void
-isapnp_enumerate(void)
+isapnp_enumerate(struct pnpinfo **pnplist)
{
- int pnp_rd_port;
-
- /* Check for I/O port access */
- if ((archsw.arch_isainb == NULL) || (archsw.arch_isaoutb == NULL))
- return;
-
- /*
- * Validate a possibly-suggested read port value. If the autoscan failed
- * last time, this will return us to autoscan mode again.
- */
- if ((isapnp_readport > 0) &&
- (((isapnp_readport < 0x203) ||
- (isapnp_readport > 0x3ff) ||
- (isapnp_readport & 0x3) != 0x3)))
- /* invalid, go look for ourselves */
- isapnp_readport = 0;
-
- if (isapnp_readport < 0) {
- /* someone is telling us there is no ISA in the system */
- return;
-
- } else if (isapnp_readport > 0) {
- /* Someone has told us where the port is/should be, or we found one last time */
- isapnp_isolation_protocol();
-
- } else {
- /* No clues, look for it ourselves */
- for (pnp_rd_port = 0x80; pnp_rd_port < 0xff; pnp_rd_port += 0x10) {
- /* Look for something, quit when we find it */
- isapnp_readport = (pnp_rd_port << 2) | 0x3;
- if (isapnp_isolation_protocol() > 0)
- break;
- }
+ int devs;
+
+ for (pnp_rd_port = 0x80; pnp_rd_port < 0xff; pnp_rd_port += 0x10) {
+
+ /* Look for something, quit when we find it */
+ if ((devs = isapnp_isolation_protocol(pnplist)) > 0)
+ break;
}
+ printf("Found %d ISA PnP devices\n", devs);
}
+
+
diff --git a/sys/boot/common/isapnp.h b/sys/boot/common/isapnp.h
index 0b3b9ec885271..6c072824867eb 100644
--- a/sys/boot/common/isapnp.h
+++ b/sys/boot/common/isapnp.h
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isapnp.h,v 1.1 1998/09/18 00:24:25 msmith Exp $
+ * $Id: pnp.h,v 1.6 1998/01/10 07:41:43 kato Exp $
*/
#ifndef _I386_ISA_PNP_H_
@@ -210,12 +210,6 @@
/*** 32-bit memory accesses are at 0x76 ***/
-/* Macros to parse Resource IDs */
-#define PNP_RES_TYPE(a) (a >> 7)
-#define PNP_SRES_NUM(a) (a >> 3)
-#define PNP_SRES_LEN(a) (a & 0x07)
-#define PNP_LRES_NUM(a) (a & 0x7f)
-
/* Small Resource Item names */
#define PNP_VERSION 0x1
#define LOG_DEVICE_ID 0x2
diff --git a/sys/boot/common/load_aout.c b/sys/boot/common/load_aout.c
index 6d33ad49f3672..3a5d34d15a6ba 100644
--- a/sys/boot/common/load_aout.c
+++ b/sys/boot/common/load_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: load_aout.c,v 1.10 1998/10/12 09:05:12 peter Exp $
+ * $Id: load_aout.c,v 1.9 1998/10/09 23:15:39 peter Exp $
*/
#include <sys/param.h>
@@ -223,34 +223,30 @@ aout_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, struct ex
/* symbol table size */
ssym = addr;
- if(ehdr->a_syms!=NULL) {
- archsw.arch_copyin(&ehdr->a_syms, addr, sizeof(ehdr->a_syms));
- addr += sizeof(ehdr->a_syms);
+ archsw.arch_copyin(&ehdr->a_syms, addr, sizeof(ehdr->a_syms));
+ addr += sizeof(ehdr->a_syms);
- /* symbol table */
- printf("symbols=[0x%x+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
- if (archsw.arch_readin(fd, addr, ehdr->a_syms) != ehdr->a_syms)
- return(0);
- addr += ehdr->a_syms;
-
- /* string table */
- read(fd, &ss, sizeof(ss));
- archsw.arch_copyin(&ss, addr, sizeof(ss));
- addr += sizeof(ss);
- ss -= sizeof(ss);
- printf("+0x%x+0x%x]", sizeof(ss), ss);
- if (archsw.arch_readin(fd, addr, ss) != ss)
- return(0);
- addr += ss;
-
- mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym);
- mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym);
- } else {
- printf("symbols=[none]");
- }
- printf("\n");
+ /* symbol table */
+ printf("symbols=[0x%x+0x%lx", sizeof(ehdr->a_syms), ehdr->a_syms);
+ if (archsw.arch_readin(fd, addr, ehdr->a_syms) != ehdr->a_syms)
+ return(0);
+ addr += ehdr->a_syms;
+
+ /* string table */
+ read(fd, &ss, sizeof(ss));
+ archsw.arch_copyin(&ss, addr, sizeof(ss));
+ addr += sizeof(ss);
+ ss -= sizeof(ss);
+ printf("+0x%x+0x%x]", sizeof(ss), ss);
+ if (archsw.arch_readin(fd, addr, ss) != ss)
+ return(0);
+ printf(" \n");
+ addr += ss;
esym = addr;
+ mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym);
+ mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym);
+
return(addr - loadaddr);
}
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index ff1f50638ac8a..b2b38c7800b65 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: load_elf.c,v 1.9 1998/10/17 03:06:38 peter Exp $
+ * $Id: load_elf.c,v 1.7 1998/10/15 21:56:47 dfr Exp $
*/
#include <sys/param.h>
@@ -40,7 +40,7 @@
#include "bootstrap.h"
-static int elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, Elf_Ehdr *ehdr, int kernel, caddr_t firstpage, int firstlen);
+static int elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t loadaddr, Elf_Ehdr *ehdr, Elf_Phdr *phdr, int kernel);
char *elf_kerneltype = "elf kernel";
char *elf_moduletype = "elf module";
@@ -54,15 +54,15 @@ int
elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
{
struct loaded_module *mp, *kmp;
- Elf_Ehdr *ehdr;
+ Elf_Ehdr ehdr;
+ Elf_Phdr *phdr;
int fd;
int err, kernel;
u_int pad;
char *s;
- caddr_t firstpage;
- int firstlen;
mp = NULL;
+ phdr = NULL;
/*
* Open the image, read and validate the ELF header
@@ -71,26 +71,21 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
return(EFTYPE);
if ((fd = open(filename, O_RDONLY)) == -1)
return(errno);
- firstpage = malloc(PAGE_SIZE);
- if (firstpage == NULL)
- return(ENOMEM);
- firstlen = read(fd, firstpage, PAGE_SIZE);
- if (firstlen <= sizeof(ehdr)) {
+ if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr)) {
err = EFTYPE; /* could be EIO, but may be small file */
goto oerr;
}
- ehdr = (Elf_Ehdr *)firstpage;
/* Is it ELF? */
- if (!IS_ELF(*ehdr)) {
+ if (!IS_ELF(ehdr)) {
err = EFTYPE;
goto oerr;
}
- if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */
- ehdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
- ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */
- ehdr->e_version != EV_CURRENT ||
- ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */
+ if (ehdr.e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */
+ ehdr.e_ident[EI_DATA] != ELF_TARG_DATA ||
+ ehdr.e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */
+ ehdr.e_version != EV_CURRENT ||
+ ehdr.e_machine != ELF_TARG_MACH) { /* Machine ? */
err = EFTYPE;
goto oerr;
}
@@ -100,7 +95,7 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
* Check to see what sort of module we are.
*/
kmp = mod_findmodule(NULL, NULL);
- if (ehdr->e_type == ET_DYN) {
+ if (ehdr.e_type == ET_DYN) {
/* Looks like a kld module */
if (kmp == NULL) {
printf("elf_loadmodule: can't load module before kernel\n");
@@ -121,7 +116,7 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
pad = PAGE_SIZE - pad;
dest += pad;
}
- } else if (ehdr->e_type == ET_EXEC) {
+ } else if (ehdr.e_type == ET_EXEC) {
/* Looks like a kernel */
if (kmp != NULL) {
printf("elf_loadmodule: kernel already loaded\n");
@@ -131,7 +126,7 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
/*
* Calculate destination address based on kernel entrypoint
*/
- dest = (vm_offset_t) ehdr->e_entry;
+ dest = (vm_offset_t) ehdr.e_entry;
if (dest == 0) {
printf("elf_loadmodule: not a kernel (maybe static binary?)\n");
err = EPERM;
@@ -169,12 +164,36 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
printf("%s ", filename);
#endif
- mp->m_size = elf_loadimage(mp, fd, dest, ehdr, kernel, firstpage, firstlen);
+ phdr = malloc(ehdr.e_phnum * sizeof(*phdr));
+ if (phdr == NULL) {
+ err = ENOMEM;
+ goto out;
+ }
+
+ if (lseek(fd, ehdr.e_phoff, SEEK_SET) == -1) {
+ printf("elf_loadexec: lseek for phdr failed\n");
+ goto ioerr;
+ }
+ if (read(fd, phdr, ehdr.e_phnum * sizeof(*phdr)) !=
+ ehdr.e_phnum * sizeof(*phdr)) {
+ printf("elf_loadmodule: cannot read program header\n");
+ goto ioerr;
+ }
+ if (lseek(fd, 0, SEEK_SET) == -1) {
+ close(fd);
+ if ((fd = open(filename, O_RDONLY)) == -1) {
+ printf("elf_loadmodule: cannot reset file position\n");
+ mod_discard(mp);
+ return errno;
+ }
+ }
+
+ mp->m_size = elf_loadimage(mp, fd, dest, &ehdr, phdr, kernel);
if (mp->m_size == 0 || mp->m_addr == 0)
goto ioerr;
/* save exec header as metadata */
- mod_addmetadata(mp, MODINFOMD_ELFHDR, sizeof(*ehdr), ehdr);
+ mod_addmetadata(mp, MODINFOMD_ELFHDR, sizeof(ehdr), &ehdr);
/* Load OK, return module pointer */
*result = (struct loaded_module *)mp;
@@ -186,8 +205,8 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
oerr:
mod_discard(mp);
out:
- if (firstpage)
- free(firstpage);
+ if (phdr)
+ free(phdr);
close(fd);
return(err);
}
@@ -198,10 +217,9 @@ elf_loadmodule(char *filename, vm_offset_t dest, struct loaded_module **result)
*/
static int
elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
- Elf_Ehdr *ehdr, int kernel, caddr_t firstpage, int firstlen)
+ Elf_Ehdr *ehdr, Elf_Phdr *phdr, int kernel)
{
int i, j;
- Elf_Phdr *phdr;
Elf_Shdr *shdr;
int ret;
vm_offset_t firstaddr;
@@ -221,7 +239,6 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
int symstrindex;
int symtabindex;
long size;
- int fpcopy;
dp = NULL;
shdr = NULL;
@@ -235,12 +252,6 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
#endif
}
- if ((ehdr->e_phoff + ehdr->e_phnum * sizeof(*phdr)) > firstlen) {
- printf("elf_loadimage: program header not within first page\n");
- goto out;
- }
- phdr = (Elf_Phdr *)(firstpage + ehdr->e_phoff);
-
for (i = 0; i < ehdr->e_phnum; i++) {
/* We want to load PT_LOAD segments only.. */
if (phdr[i].p_type != PT_LOAD)
@@ -261,22 +272,15 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
printf(" ");
}
#endif
- fpcopy = 0;
- if (firstlen > phdr[i].p_offset) {
- fpcopy = firstlen - phdr[i].p_offset;
- archsw.arch_copyin(firstpage + phdr[i].p_offset,
- phdr[i].p_vaddr + off, fpcopy);
+
+ if (lseek(fd, phdr[i].p_offset, SEEK_SET) == -1) {
+ printf("\nelf_loadexec: cannot seek\n");
+ goto out;
}
- if (phdr[i].p_filesz > fpcopy) {
- if (lseek(fd, phdr[i].p_offset + fpcopy, SEEK_SET) == -1) {
- printf("\nelf_loadexec: cannot seek\n");
- goto out;
- }
- if (archsw.arch_readin(fd, phdr[i].p_vaddr + off + fpcopy,
- phdr[i].p_filesz - fpcopy) != phdr[i].p_filesz - fpcopy) {
- printf("\nelf_loadexec: archsw.readin failed\n");
- goto out;
- }
+ if (archsw.arch_readin(fd, phdr[i].p_vaddr + off, phdr[i].p_filesz) !=
+ phdr[i].p_filesz) {
+ printf("\nelf_loadexec: archsw.readin failed\n");
+ goto out;
}
/* clear space from oversized segments; eg: bss */
if (phdr[i].p_filesz < phdr[i].p_memsz) {
@@ -323,11 +327,11 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
if (shdr == NULL)
goto nosyms;
if (lseek(fd, ehdr->e_shoff, SEEK_SET) == -1) {
- printf("\nelf_loadimage: cannot lseek() to section headers");
+ printf("\nelf_loadimage: cannot lseek() to section headers\n");
goto nosyms;
}
if (read(fd, shdr, chunk) != chunk) {
- printf("\nelf_loadimage: read section headers failed");
+ printf("\nelf_loadimage: read section headers failed\n");
goto nosyms;
}
symtabindex = -1;
@@ -382,7 +386,7 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
lastaddr += sizeof(long);
#ifdef ELF_VERBOSE
- printf("\n%s: 0x%lx@0x%lx -> 0x%lx-0x%lx", secname,
+ printf("%s: 0x%lx@0x%lx -> 0x%lx-0x%lx\n", secname,
shdr[i].sh_size, shdr[i].sh_offset,
lastaddr, lastaddr + shdr[i].sh_size);
#else
@@ -392,14 +396,14 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
#endif
if (lseek(fd, shdr[i].sh_offset, SEEK_SET) == -1) {
- printf("\nelf_loadimage: could not seek for symbols - skipped!");
+ printf("\nelf_loadimage: could not seek for symbols - skipped!\n");
lastaddr = ssym;
ssym = 0;
goto nosyms;
}
if (archsw.arch_readin(fd, lastaddr, shdr[i].sh_size) !=
shdr[i].sh_size) {
- printf("\nelf_loadimage: could not read symbols - skipped!");
+ printf("\nelf_loadimage: could not read symbols - skipped!\n");
lastaddr = ssym;
ssym = 0;
goto nosyms;
@@ -414,14 +418,13 @@ elf_loadimage(struct loaded_module *mp, int fd, vm_offset_t off,
}
esym = lastaddr;
#ifndef ELF_VERBOSE
- printf("]");
+ printf("]\n");
#endif
mod_addmetadata(mp, MODINFOMD_SSYM, sizeof(ssym), &ssym);
mod_addmetadata(mp, MODINFOMD_ESYM, sizeof(esym), &esym);
nosyms:
- printf("\n");
ret = lastaddr - firstaddr;
mp->m_addr = firstaddr;
diff --git a/sys/boot/common/ls.c b/sys/boot/common/ls.c
index 73f805700bf89..493482a7b3005 100644
--- a/sys/boot/common/ls.c
+++ b/sys/boot/common/ls.c
@@ -1,5 +1,5 @@
/*
- * $Id: ls.c,v 1.6 1998/10/11 10:28:51 peter Exp $
+ * $Id: ls.c,v 1.5 1998/10/09 07:09:22 msmith Exp $
* From: $NetBSD: ls.c,v 1.3 1997/06/13 13:48:47 drochner Exp $
*/
@@ -70,7 +70,6 @@ command_ls(int argc, char *argv[])
fd = -1;
verbose = 0;
optind = 1;
- optreset = 1;
while ((ch = getopt(argc, argv, "l")) != -1) {
switch(ch) {
case 'l':
diff --git a/sys/boot/common/merge_help.awk b/sys/boot/common/merge_help.awk
deleted file mode 100644
index 1376c53aee3cf..0000000000000
--- a/sys/boot/common/merge_help.awk
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/awk -f
-#
-# $Id: mergehelp.awk,v 1.3 1999/01/13 20:06:52 jabley Exp $
-#
-# Merge two boot loader help files for FreeBSD 3.0
-# Joe Abley <jabley@patho.gen.nz>
-
-BEGIN \
-{
- state = 0;
- first = 0;
- ind = 0;
-}
-
-# beginning of first command
-/^###/ && (state == 0) \
-{
- state = 1;
- next;
-}
-
-# entry header
-/^# T[[:graph:]]+ (S[[:graph:]]+ )*D[[:graph:]][[:print:]]*$/ && (state == 1) \
-{
- match($0, " T[[:graph:]]+");
- T = substr($0, RSTART + 2, RLENGTH - 2);
- match($0, " S[[:graph:]]+");
- S = (RLENGTH == -1) ? "" : substr($0, RSTART + 2, RLENGTH - 2);
- match($0, " D[[:graph:]][[:print:]]*$");
- D = substr($0, RSTART + 2);
-
- # find a suitable place to store this one...
- ind++;
- if (ind == 1)
- {
- first = ind;
- help[ind, "T"] = T;
- help[ind, "S"] = S;
- help[ind, "link"] = -1;
- } else {
- i = first; j = -1;
- while (help[i, "T"] help[i, "S"] < T S)
- {
- j = i;
- i = help[i, "link"];
- if (i == -1) break;
- }
-
- if (i == -1)
- {
- help[j, "link"] = ind;
- help[ind, "link"] = -1;
- } else {
- help[ind, "link"] = i;
- if (j == -1)
- first = ind;
- else
- help[j, "link"] = ind;
- }
- }
- help[ind, "T"] = T;
- help[ind, "S"] = S;
- help[ind, "D"] = D;
-
- # set our state
- state = 2;
- help[ind, "text"] = 0;
- next;
-}
-
-# end of last command, beginning of next one
-/^###/ && (state == 2) \
-{
- state = 1;
-}
-
-(state == 2) \
-{
- sub("[[:blank:]]+$", "");
- if (help[ind, "text"] == 0 && $0 ~ /^[[:blank:]]*$/) next;
- help[ind, "text", help[ind, "text"]] = $0;
- help[ind, "text"]++;
- next;
-}
-
-# show them what we have (it's already sorted in help[])
-END \
-{
- node = first;
- while (node != -1)
- {
- printf "################################################################################\n";
- printf "# T%s ", help[node, "T"];
- if (help[node, "S"] != "") printf "S%s ", help[node, "S"];
- printf "D%s\n\n", help[node, "D"];
- for (i = 0; i < help[node, "text"]; i++)
- printf "%s\n", help[node, "text", i];
- node = help[node, "link"];
- }
- printf "################################################################################\n";
-}
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c
index 141a8ed32f664..5b0d547af069f 100644
--- a/sys/boot/common/module.c
+++ b/sys/boot/common/module.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: module.c,v 1.6 1998/10/09 23:12:34 peter Exp $
+ * $Id: module.c,v 1.5 1998/09/26 10:51:38 dfr Exp $
*/
/*
@@ -72,7 +72,6 @@ command_load(int argc, char *argv[])
dofile = 0;
optind = 1;
- optreset = 1;
typestr = NULL;
while ((ch = getopt(argc, argv, "t:")) != -1) {
switch(ch) {
@@ -134,7 +133,6 @@ command_lsmod(int argc, char *argv[])
verbose = 0;
optind = 1;
- optreset = 1;
while ((ch = getopt(argc, argv, "v")) != -1) {
switch(ch) {
case 'v':
diff --git a/sys/boot/common/pnp.c b/sys/boot/common/pnp.c
index 74853154ffe74..4a8ee48d5bd45 100644
--- a/sys/boot/common/pnp.c
+++ b/sys/boot/common/pnp.c
@@ -13,10 +13,9 @@
#include <string.h>
#include <bootstrap.h>
-STAILQ_HEAD(,pnpinfo) pnp_devices;
-static int pnp_devices_initted = 0;
+static struct pnpinfo *pnp_devices = NULL;
-static void pnp_discard(void);
+static void pnp_discard(struct pnpinfo **list);
static int pnp_readconf(char *path);
static int pnp_scankernel(void);
@@ -29,56 +28,15 @@ COMMAND_SET(pnpscan, "pnpscan", "scan for PnP devices", pnp_scan);
int
pnp_scan(int argc, char *argv[])
{
- struct pnpinfo *pi;
int hdlr;
- int verbose;
- int ch;
-
- if (pnp_devices_initted == 0) {
- STAILQ_INIT(&pnp_devices);
- pnp_devices_initted = 1;
- }
-
- verbose = 0;
- optind = 1;
- optreset = 1;
- while ((ch = getopt(argc, argv, "v")) != -1) {
- switch(ch) {
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- /* getopt has already reported an error */
- return(CMD_OK);
- }
- }
/* forget anything we think we knew */
- pnp_discard();
-
- if (verbose)
- pager_open();
+ pnp_discard(&pnp_devices);
/* iterate over all of the handlers */
for (hdlr = 0; pnphandlers[hdlr] != NULL; hdlr++) {
- if (verbose) {
- pager_output("Probing ");
- pager_output(pnphandlers[hdlr]->pp_name);
- pager_output("...\n");
- }
- pnphandlers[hdlr]->pp_enumerate();
- }
- if (verbose) {
- for (pi = pnp_devices.stqh_first; pi != NULL; pi = pi->pi_link.stqe_next) {
- pager_output(pi->pi_ident.stqh_first->id_ident); /* first ident should be canonical */
- if (pi->pi_desc != NULL) {
- pager_output(" : ");
- pager_output(pi->pi_desc);
- }
- pager_output("\n");
- }
- pager_close();
+ printf("Probing bus '%s'...\n", pnphandlers[hdlr]->pp_name);
+ pnphandlers[hdlr]->pp_enumerate(&pnp_devices);
}
return(CMD_OK);
}
@@ -93,7 +51,7 @@ pnp_reload(char *fname)
char *modfname;
/* find anything? */
- if (pnp_devices.stqh_first != NULL) {
+ if (pnp_devices != NULL) {
/* check for kernel, assign modules handled by static drivers there */
if (pnp_scankernel()) {
@@ -112,13 +70,13 @@ pnp_reload(char *fname)
}
/* try to load any modules that have been nominated */
- for (pi = pnp_devices.stqh_first; pi != NULL; pi = pi->pi_link.stqe_next) {
+ for (pi = pnp_devices; pi != NULL; pi = pi->pi_next) {
/* Already loaded? */
if ((pi->pi_module != NULL) && (mod_findmodule(pi->pi_module, NULL) == NULL)) {
- modfname = malloc(strlen(pi->pi_module) + 4);
+ modfname = malloc(strlen(pi->pi_module + 3));
sprintf(modfname, "%s.ko", pi->pi_module); /* XXX implicit knowledge of KLD module filenames */
if (mod_load(pi->pi_module, pi->pi_argc, pi->pi_argv))
- printf("Could not load module '%s' for device '%s'\n", modfname, pi->pi_ident.stqh_first->id_ident);
+ printf("Could not load module '%s' for device '%s'\n", modfname, pi->pi_ident->id_ident);
free(modfname);
}
}
@@ -130,14 +88,24 @@ pnp_reload(char *fname)
* Throw away anything we think we know about PnP devices on (list)
*/
static void
-pnp_discard(void)
+pnp_discard(struct pnpinfo **list)
{
struct pnpinfo *pi;
-
- while (pnp_devices.stqh_first != NULL) {
- pi = pnp_devices.stqh_first;
- STAILQ_REMOVE_HEAD(&pnp_devices, pi_link);
- pnp_freeinfo(pi);
+ struct pnpident *id;
+
+ while (*list != NULL) {
+ pi = *list;
+ *list = (*list)->pi_next;
+ while (pi->pi_ident) {
+ id = pi->pi_ident;
+ pi->pi_ident = pi->pi_ident->id_next;
+ free(id);
+ }
+ if (pi->pi_module)
+ free(pi->pi_module);
+ if (pi->pi_argv)
+ free(pi->pi_argv);
+ free(pi);
}
}
@@ -258,14 +226,14 @@ pnp_readconf(char *path)
* assigned.
* XXX no revision parse/test here yet.
*/
- for (pi = pnp_devices.stqh_first; pi != NULL; pi = pi->pi_link.stqe_next) {
+ for (pi = pnp_devices; pi != NULL; pi = pi->pi_next) {
/* no driver assigned, bus matches OK */
if ((pi->pi_module == NULL) &&
!strcmp(pi->pi_handler->pp_name, currbus)) {
/* scan idents, take first match */
- for (id = pi->pi_ident.stqh_first; id != NULL; id = id->id_link.stqe_next)
+ for (id = pi->pi_ident; id != NULL; id = id->id_next)
if (!strcmp(id->id_ident, ident))
break;
@@ -299,82 +267,19 @@ pnp_scankernel(void)
void
pnp_addident(struct pnpinfo *pi, char *ident)
{
- struct pnpident *id;
-
- for (id = pi->pi_ident.stqh_first; id != NULL; id = id->id_link.stqe_next)
- if (!strcmp(id->id_ident, ident))
- return; /* already have this one */
-
- id = malloc(sizeof(struct pnpident));
- id->id_ident = strdup(ident);
- STAILQ_INSERT_TAIL(&pi->pi_ident, id, id_link);
-}
-
-/*
- * Allocate a new pnpinfo struct
- */
-struct pnpinfo *
-pnp_allocinfo(void)
-{
- struct pnpinfo *pi;
+ struct pnpident *id, **idp;
- pi = malloc(sizeof(struct pnpinfo));
- bzero(pi, sizeof(struct pnpinfo));
- STAILQ_INIT(&pi->pi_ident);
- return(pi);
-}
-
-/*
- * Release storage held by a pnpinfo struct
- */
-void
-pnp_freeinfo(struct pnpinfo *pi)
-{
- struct pnpident *id;
-
- while (pi->pi_ident.stqh_first != NULL) {
- id = pi->pi_ident.stqh_first;
- STAILQ_REMOVE_HEAD(&pi->pi_ident, id_link);
- free(id->id_ident);
- free(id);
+ if (pi->pi_ident == NULL) {
+ idp = &(pi->pi_ident);
+ } else {
+ for (id = pi->pi_ident; id->id_next != NULL; id = id->id_next)
+ if (!strcmp(id->id_ident, ident))
+ return; /* already have this one */
+ ;
+ idp = &(id->id_next);
}
- if (pi->pi_desc)
- free(pi->pi_desc);
- if (pi->pi_module)
- free(pi->pi_module);
- if (pi->pi_argv)
- free(pi->pi_argv);
- free(pi);
-}
-
-/*
- * Add a new pnpinfo struct to the list.
- */
-void
-pnp_addinfo(struct pnpinfo *pi)
-{
- STAILQ_INSERT_TAIL(&pnp_devices, pi, pi_link);
-}
-
-
-/*
- * Format an EISA id as a string in standard ISA PnP format, AAAIIRR
- * where 'AAA' is the EISA vendor ID, II is the product ID and RR the revision ID.
- */
-char *
-pnp_eisaformat(u_int8_t *data)
-{
- static char idbuf[8];
- const char hextoascii[] = "0123456789abcdef";
-
- idbuf[0] = '@' + ((data[0] & 0x7c) >> 2);
- idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5));
- idbuf[2] = '@' + (data[1] & 0x1f);
- idbuf[3] = hextoascii[(data[2] >> 4)];
- idbuf[4] = hextoascii[(data[2] & 0xf)];
- idbuf[5] = hextoascii[(data[3] >> 4)];
- idbuf[6] = hextoascii[(data[3] & 0xf)];
- idbuf[7] = 0;
- return(idbuf);
+ *idp = malloc(sizeof(struct pnpident));
+ (*idp)->id_next = NULL;
+ (*idp)->id_ident = strdup(ident);
}
diff --git a/sys/boot/common/pnpdata b/sys/boot/common/pnpdata
deleted file mode 100644
index 62d35a8193860..0000000000000
--- a/sys/boot/common/pnpdata
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-# $Id$
-#
-# This file contains the system default Plug-and-Play data. It is
-# derived from a number of sources, including:
-#
-# - The Microsoft "Windows Generic Device IDs" document
-#
-
-[pci]
-######################################################################
-# PCI devices.
-#
-# Required attributes:
-#
-# ident= PCI identifier in the form 0xDDDDVVVV where
-# 'VVVV' is the 4-digit hex form of the vendor ID and
-# 'DDDD' is the 4-digit hex form of the device ID.
-# or
-#
-# vendor= 0xVVVV where 'VVVV' is above
-# name= Vendor name
-
-vendor=0x8086 name=Intel
-
-
-[isa]
-######################################################################
-# ISA PnP devices
-#
-# Required attributes:
-#
-# ident= ISA PnP identifier in the form AAAIIRR where
-# 'AAA' is the EISA vendor ID, 'II' is the device ID
-# and 'RR' is the revision ID.
-# or
-#
-# vendor= AAA to register just a vendor name.
-# name= Vendor name
-#
-# Optional attributes:
-#
-# module= Support module identifier.
-#
-# args= Arguments to pass to the support module.
-#
-
-vendor=CSC name=Crystal Semiconductor
-vendor=CTL name=Creative Labs
-vendor=PNP name=Generic
-
-# From "Windows Generic Device IDs"
-#
-# --Parallel Devices--
-ident=PNP0400 module=lpt # Standard LPT printer port
-ident=PNP0401 module=lpt # ECP printer port
-
-# --Serial Devices--
-ident=PNP0500 module=sio # Standard PC COM port
-ident=PNP0501 module=sio # 16550A-compatible COM port
-ident=PNP0502 module=sio # Multiport serial device (non-intelligent 16550)
-
-# --Disk Controllers--
-ident=PNP0600 module=wd # Generic ESDI/IDE/ATA compatible hard disk controller
-ident=PNP0603 module=wd # Generic IDE supporting Microsoft Device Bay Specification
-ident=PNP0700 module=fd # PC standard floppy disk controller
-ident=PNP0701 module=fd # Standard floppy controller supporting MS Device Bay Spec
-
-# --Peripheral Buses--
-ident=PNP0A00 module=isa # ISA Bus
-ident=PNP0A01 module=eisa # EISA Bus
-ident=PNP0A03 module=pci # PCI Bus
-ident=PNP0A04 module=isa # VESA/VL Bus
-
-# -- Real Time Clock, BIOS, System board devices--
-ident=PNP0C04 module=npx # Math Coprocessor
-ident=PNP0C05 module=apm # APM BIOS (Version independent)
-
-# --PCMCIA Controller Chipsets--
-ident=PNP0E00 module=pcic # Intel 82365-Compatible PCMCIA Controller
-ident=PNP0E01 module=pcic # Cirrus Logic CL-PD6720 PCMCIA Controller
-ident=PNP0E02 module=pcic # VLSI VL82C146 PCMCIA Controller
-ident=PNP0E03 module=pcic # Intel 82365-compatible CardBus controller
-
-# --Network Adapters--
-ident=PNP8001 module=ed # Novell/Anthem NE3200
-ident=PNP8004 # Compaq NE3200
-ident=PNP80d3 module=ed # Novell/Anthem NE1000
-ident=PNP80d4 module=ed # Novell/Anthem NE2000
-ident=PNP80d5 module=ed # NE1000 Compatible
-ident=PNP80d6 module=ed # NE2000 Compatible
-ident=PNP80d8 module=lnc # Novell/Anthem NE2100
-ident=PNP80e9 module=le # DEC (DE200) EtherWorks Turbo
-ident=PNP80eb module=le # DEC (DE201) EtherWorks Turbo/TP
-ident=PNP80ec module=le # DEC (DE202) EtherWorks Turbo/TP_BNC
-ident=PNP80f1 module=eg # 3Com EtherLink Plus
-ident=PNP80f3 module=ed # 3Com EtherLink II or IITP (8 or 16-bit)
-ident=PNP80f6 module=ed # 3Com EtherLink 16
-ident=PNP80f7 module=ep # 3Com EtherLink III
-ident=PNP80f8 module=ep # 3Com Generic Etherlink Plug and Play Device
-ident=PNP8123 module=ed # SMC StarCard PLUS (WD/8003S)
-ident=PNP8124 module=ed # SMC StarCard PLUS With On Board Hub (WD/8003SH)
-ident=PNP8125 module=ed # SMC EtherCard PLUS (WD/8003E)
-ident=PNP8126 module=ed # SMC EtherCard PLUS With Boot ROM Socket (WD/8003EBT)
-ident=PNP8127 module=ed # SMC EtherCard PLUS With Boot ROM Socket (WD/8003EB)
-ident=PNP8128 module=ed # SMC EtherCard PLUS TP (WD/8003WT)
-ident=PNP812a module=ed # SMC EtherCard PLUS 16 With Boot ROM Socket (WD/8013EBT)
-ident=PNP812d module=ie # Intel EtherExpress 16 or 16TP
-ident=PNP8137 module=ed # Artisoft AE-1
-ident=PNP8138 module=ed # Artisoft AE-2 or AE-3
-ident=PNP8158 module=ed # HP PC LAN Adapter/16 TP Plus (HP27247B)
-ident=PNP8159 module=ed # HP PC LAN Adapter/16 TL Plus (HP27252)
-ident=PNP81c3 module=ed # SMC EtherCard PLUS Elite (WD/8003EP)
-ident=PNP81c4 module=ed # SMC EtherCard PLUS 10T (WD/8003W)
-ident=PNP81c5 module=ed # SMC EtherCard PLUS Elite 16 (WD/8013EP)
-ident=PNP81c6 module=ed # SMC EtherCard PLUS Elite 16T (WD/8013W)
-ident=PNP81c7 module=ed # SMC EtherCard PLUS Elite 16 Combo (WD/8013EW or 8013EWC)
-ident=PNP81c8 module=ed # SMC EtherElite Ultra 16
-ident=PNP820a module=ed # Zenith Data Systems NE2000-Compatible
-ident=PNP8231 module=lnc # Advanced Micro Devices AM2100/AM1500T
-ident=PNP828C module=lnc # AMD PCNet Family cards
-ident=PNP828D module=lnc # AMD PCNet32 (VL version)
-ident=PNP8323 module=ed # SMC EtherCard (All Types except 8013/A)
-ident=PNP8390 module=ed # Generic network adapter
-
-# --SCSI, Proprietary CD Adapters--
-ident=PNPA003 module=matcd # Panasonic proprietary CD-ROM adapter (SBPro/SB16)
-ident=PNPA02B module=scd # Sony proprietary CD-ROM controller
-ident=PNPA030 module=mcd # Mitsumi LU-005 Single Speed CD-ROM controller + drive
-ident=PNPA031 module=mcd # Mitsumi FX-001 Single Speed CD-ROM controller + drive
-ident=PNPA032 module=mcd # Mitsumi FX-001 Double Speed CD-ROM controller + drive
-
-# --Sound/Video-capture, multimedia--
-ident=PNPB000 module=pcm # Sound Blaster 1.5 sound device
-ident=PNPB001 module=pcm # Sound Blaster 2.0 sound device
-ident=PNPB002 module=pcm # Sound Blaster Pro sound device
-ident=PNPB003 module=pcm # Sound Blaster 16 sound device
-ident=PNPB007 module=pcm # Microsoft Windows Sound System-compatible sound device
-ident=PNPB009 module=pcm # Plug and Play Microsoft Windows Sound System Device
-ident=PNPB020 module=pcm # Yamaha OPL3-compatible FM synthesizer device
-ident=PNPB02F module=joy # Joystick/Game port
-
-# --Compatibility with early device ID list--
-ident=PNP0802 module=pcm # Microsoft Sound System compatible device (obsolete, use PNPB0xx instead)
-
-# --Modems--
-ident=PNPC000 module=sio # Compaq 14400 Modem (TBD)
-ident=PNPC001 module=sio # Compaq 2400/9600 Modem (TBD)
-
-# Vendor supplied IDs.
-
-# --Parallel Devices--
-
-# --Serial Devices--
-
-# --Disk Controllers--
-
-# --Peripheral Buses--
-
-# --Real Time Clock, BIOS, System board devices--
-
-# --PCMCIA Controller Chipsets--
-
-# --Network Adapters--
-ident=CSC6040 module=cs # Crystal Semiconductor CS8920
-
-# --SCSI, Proprietary CD Adapters--
-
-# --Sound/Video-capture, multimedia--
-
-# --Modems--
-
-
-
-[com]
-######################################################################
-# COM PnP devices
-#
-
-[lpt]
-######################################################################
-# LPT PnP devices
-#
diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
deleted file mode 100644
index 260254e316a17..0000000000000
--- a/sys/boot/ficl/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# $Id: Makefile,v 1.6 1998/11/05 08:39:42 jkh Exp $
-#
-LIB= ficl
-NOPROFILE= yes
-INTERNALLIB= yes
-INTERNALSTATICLIB= yes
-BASE_SRCS= dict.c ficl.c math64.c stack.c sysdep.c vm.c words.c
-SRCS= ${BASE_SRCS} softcore.c
-CLEANFILES= softcore.c testmain
-
-# Standard softwords
-SOFTWORDS= softcore.fr jhlocal.fr marker.fr
-# Optional OO extension softwords
-#SOFTWORDS+= oo.fr classes.fr
-
-.PATH: ${.CURDIR}/softwords
-CFLAGS+= -I${.CURDIR}
-
-softcore.c: ${SOFTWORDS} softcore.awk
- (cd ${.CURDIR}/softwords; cat ${SOFTWORDS} | awk -f softcore.awk) > ${.TARGET}
-
-.include <bsd.lib.mk>
-
-testmain: ${.CURDIR}/testmain.c ${SRCS}
- @for i in ${BASE_SRCS}; do echo $${i}... ; \
- ${CC} -c ${CFLAGS} -DTESTMAIN ${.CURDIR}/$${i}; done
- @echo softdep.c...
- @${CC} -c ${CFLAGS} -D_TESTMAIN softcore.c
- cc -o ${.TARGET} ${.CURDIR}/testmain.c ${OBJS}
-
diff --git a/sys/boot/ficl/dict.c b/sys/boot/ficl/dict.c
deleted file mode 100644
index 640a2fddc1ad3..0000000000000
--- a/sys/boot/ficl/dict.c
+++ /dev/null
@@ -1,779 +0,0 @@
-/*******************************************************************
-** d i c t . c
-** Forth Inspired Command Language - dictionary methods
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** This file implements the dictionary -- FICL's model of
-** memory management. All FICL words are stored in the
-** dictionary. A word is a named chunk of data with its
-** associated code. FICL treats all words the same, even
-** precompiled ones, so your words become first-class
-** extensions of the language. You can even define new
-** control structures.
-**
-** 29 jun 1998 (sadler) added variable sized hash table support
-*/
-
-#ifdef TESTMAIN
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#else
-#include <stand.h>
-#endif
-#include <string.h>
-#include "ficl.h"
-
-static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si);
-
-/**************************************************************************
- d i c t A b o r t D e f i n i t i o n
-** Abort a definition in process: reclaim its memory and unlink it
-** from the dictionary list. Assumes that there is a smudged
-** definition in process...otherwise does nothing.
-** NOTE: this function is not smart enough to unlink a word that
-** has been successfully defined (ie linked into a hash). It
-** only works for defs in process. If the def has been unsmudged,
-** nothing happens.
-**************************************************************************/
-void dictAbortDefinition(FICL_DICT *pDict)
-{
- FICL_WORD *pFW;
- ficlLockDictionary(TRUE);
- pFW = pDict->smudge;
-
- if (pFW->flags & FW_SMUDGE)
- pDict->here = (CELL *)pFW->name;
-
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- a l i g n P t r
-** Aligns the given pointer to FICL_ALIGN address units.
-** Returns the aligned pointer value.
-**************************************************************************/
-void *alignPtr(void *ptr)
-{
-#if FICL_ALIGN > 0
- char *cp;
- CELL c;
- cp = (char *)ptr + FICL_ALIGN_ADD;
- c.p = (void *)cp;
- c.u = c.u & (~FICL_ALIGN_ADD);
- ptr = (CELL *)c.p;
-#endif
- return ptr;
-}
-
-
-/**************************************************************************
- d i c t A l i g n
-** Align the dictionary's free space pointer
-**************************************************************************/
-void dictAlign(FICL_DICT *pDict)
-{
- pDict->here = alignPtr(pDict->here);
-}
-
-
-/**************************************************************************
- d i c t A l l o t
-** Allocate or remove n chars of dictionary space, with
-** checks for underrun and overrun
-**************************************************************************/
-int dictAllot(FICL_DICT *pDict, int n)
-{
- char *cp = (char *)pDict->here;
-#if FICL_ROBUST
- if (n > 0)
- {
- if ((unsigned)n <= dictCellsAvail(pDict) * sizeof (CELL))
- cp += n;
- else
- return 1; /* dict is full */
- }
- else
- {
- n = -n;
- if ((unsigned)n <= dictCellsUsed(pDict) * sizeof (CELL))
- cp -= n;
- else /* prevent underflow */
- cp -= dictCellsUsed(pDict) * sizeof (CELL);
- }
-#else
- cp += n;
-#endif
- pDict->here = PTRtoCELL cp;
- return 0;
-}
-
-
-/**************************************************************************
- d i c t A l l o t C e l l s
-** Reserve space for the requested number of cells in the
-** dictionary. If nCells < 0 , removes space from the dictionary.
-**************************************************************************/
-int dictAllotCells(FICL_DICT *pDict, int nCells)
-{
-#if FICL_ROBUST
- if (nCells > 0)
- {
- if (nCells <= dictCellsAvail(pDict))
- pDict->here += nCells;
- else
- return 1; /* dict is full */
- }
- else
- {
- nCells = -nCells;
- if (nCells <= dictCellsUsed(pDict))
- pDict->here -= nCells;
- else /* prevent underflow */
- pDict->here -= dictCellsUsed(pDict);
- }
-#else
- pDict->here += nCells;
-#endif
- return 0;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d C e l l
-** Append the specified cell to the dictionary
-**************************************************************************/
-void dictAppendCell(FICL_DICT *pDict, CELL c)
-{
- *pDict->here++ = c;
- return;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d C h a r
-** Append the specified char to the dictionary
-**************************************************************************/
-void dictAppendChar(FICL_DICT *pDict, char c)
-{
- char *cp = (char *)pDict->here;
- *cp++ = c;
- pDict->here = PTRtoCELL cp;
- return;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d W o r d
-** Create a new word in the dictionary with the specified
-** name, code, and flags. Name must be NULL-terminated.
-**************************************************************************/
-FICL_WORD *dictAppendWord(FICL_DICT *pDict,
- char *name,
- FICL_CODE pCode,
- UNS8 flags)
-{
- STRINGINFO si;
- SI_SETLEN(si, strlen(name));
- SI_SETPTR(si, name);
- return dictAppendWord2(pDict, si, pCode, flags);
-}
-
-
-/**************************************************************************
- d i c t A p p e n d W o r d 2
-** Create a new word in the dictionary with the specified
-** STRINGINFO, code, and flags. Does not require a NULL-terminated
-** name.
-**************************************************************************/
-FICL_WORD *dictAppendWord2(FICL_DICT *pDict,
- STRINGINFO si,
- FICL_CODE pCode,
- UNS8 flags)
-{
- FICL_COUNT len = (FICL_COUNT)SI_COUNT(si);
- char *name = SI_PTR(si);
- char *pName;
- FICL_WORD *pFW;
-
- ficlLockDictionary(TRUE);
-
- /*
- ** NOTE: dictCopyName advances "here" as a side-effect.
- ** It must execute before pFW is initialized.
- */
- pName = dictCopyName(pDict, si);
- pFW = (FICL_WORD *)pDict->here;
- pDict->smudge = pFW;
- pFW->hash = hashHashCode(si);
- pFW->code = pCode;
- pFW->flags = (UNS8)(flags | FW_SMUDGE);
- pFW->nName = (char)len;
- pFW->name = pName;
- /*
- ** Point "here" to first cell of new word's param area...
- */
- pDict->here = pFW->param;
-
- if (!(flags & FW_SMUDGE))
- dictUnsmudge(pDict);
-
- ficlLockDictionary(FALSE);
- return pFW;
-}
-
-
-/**************************************************************************
- d i c t A p p e n d U N S 3 2
-** Append the specified UNS32 to the dictionary
-**************************************************************************/
-void dictAppendUNS32(FICL_DICT *pDict, UNS32 u)
-{
- *pDict->here++ = LVALUEtoCELL(u);
- return;
-}
-
-
-/**************************************************************************
- d i c t C e l l s A v a i l
-** Returns the number of empty cells left in the dictionary
-**************************************************************************/
-int dictCellsAvail(FICL_DICT *pDict)
-{
- return pDict->size - dictCellsUsed(pDict);
-}
-
-
-/**************************************************************************
- d i c t C e l l s U s e d
-** Returns the number of cells consumed in the dicionary
-**************************************************************************/
-int dictCellsUsed(FICL_DICT *pDict)
-{
- return pDict->here - pDict->dict;
-}
-
-
-/**************************************************************************
- d i c t C h e c k
-** Checks the dictionary for corruption and throws appropriate
-** errors
-**************************************************************************/
-void dictCheck(FICL_DICT *pDict, FICL_VM *pVM, int nCells)
-{
- if ((nCells >= 0) && (dictCellsAvail(pDict) < nCells))
- {
- vmThrowErr(pVM, "Error: dictionary full");
- }
-
- if ((nCells <= 0) && (dictCellsUsed(pDict) < -nCells))
- {
- vmThrowErr(pVM, "Error: dictionary underflow");
- }
-
- if (pDict->nLists > FICL_DEFAULT_VOCS)
- {
- dictResetSearchOrder(pDict);
- vmThrowErr(pVM, "Error: search order overflow");
- }
- else if (pDict->nLists < 0)
- {
- dictResetSearchOrder(pDict);
- vmThrowErr(pVM, "Error: search order underflow");
- }
-
- return;
-}
-
-
-/**************************************************************************
- d i c t C o p y N a m e
-** Copy up to nFICLNAME characters of the name specified by si into
-** the dictionary starting at "here", then NULL-terminate the name,
-** point "here" to the next available byte, and return the address of
-** the beginning of the name. Used by dictAppendWord.
-** N O T E S :
-** 1. "here" is guaranteed to be aligned after this operation.
-** 2. If the string has zero length, align and return "here"
-**************************************************************************/
-static char *dictCopyName(FICL_DICT *pDict, STRINGINFO si)
-{
- char *oldCP = (char *)pDict->here;
- char *cp = oldCP;
- char *name = SI_PTR(si);
- int i = SI_COUNT(si);
-
- if (i == 0)
- {
- dictAlign(pDict);
- return (char *)pDict->here;
- }
-
- if (i > nFICLNAME)
- i = nFICLNAME;
-
- for (; i > 0; --i)
- {
- *cp++ = *name++;
- }
-
- *cp++ = '\0';
-
- pDict->here = PTRtoCELL cp;
- dictAlign(pDict);
- return oldCP;
-}
-
-
-/**************************************************************************
- d i c t C r e a t e
-** Create and initialize a dictionary with the specified number
-** of cells capacity, and no hashing (hash size == 1).
-**************************************************************************/
-FICL_DICT *dictCreate(unsigned nCells)
-{
- return dictCreateHashed(nCells, 1);
-}
-
-
-FICL_DICT *dictCreateHashed(unsigned nCells, unsigned nHash)
-{
- FICL_DICT *pDict;
- size_t nAlloc;
-
- nAlloc = sizeof (FICL_DICT) + nCells * sizeof (CELL)
- + sizeof (FICL_HASH) + (nHash - 1) * sizeof (FICL_WORD *);
-
- pDict = ficlMalloc(nAlloc);
- assert(pDict);
- pDict->size = nCells;
- dictEmpty(pDict, nHash);
- return pDict;
-}
-
-
-/**************************************************************************
- d i c t D e l e t e
-** Free all memory allocated for the given dictionary
-**************************************************************************/
-void dictDelete(FICL_DICT *pDict)
-{
- assert(pDict);
- ficlFree(pDict);
- return;
-}
-
-
-/**************************************************************************
- d i c t E m p t y
-** Empty the dictionary, reset its hash table, and reset its search order.
-** Clears and (re-)creates the main hash table (pForthWords) with the
-** size specified by nHash.
-**************************************************************************/
-void dictEmpty(FICL_DICT *pDict, unsigned nHash)
-{
- FICL_HASH *pHash;
-
- pDict->here = pDict->dict;
-
- dictAlign(pDict);
- pHash = (FICL_HASH *)pDict->here;
- dictAllot(pDict,
- sizeof (FICL_HASH) + (nHash - 1) * sizeof (FICL_WORD *));
-
- pHash->size = nHash;
- hashReset(pHash);
-
- pDict->pForthWords = pHash;
- pDict->smudge = NULL;
- dictResetSearchOrder(pDict);
- return;
-}
-
-
-/**************************************************************************
- d i c t H a s h S u m m a r y
-** Calculate a figure of merit for the dictionary hash table based
-** on the average search depth for all the words in the dictionary,
-** assuming uniform distribution of target keys. The figure of merit
-** is the ratio of the total search depth for all keys in the table
-** versus a theoretical optimum that would be achieved if the keys
-** were distributed into the table as evenly as possible.
-** The figure would be worse if the hash table used an open
-** addressing scheme (i.e. collisions resolved by searching the
-** table for an empty slot) for a given size table.
-**************************************************************************/
-void dictHashSummary(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_HASH *pFHash;
- FICL_WORD **pHash;
- unsigned size;
- FICL_WORD *pFW;
- unsigned i;
- int nMax = 0;
- int nWords = 0;
- int nFilled;
- double avg = 0.0;
- double best;
- int nAvg, nRem, nDepth;
-
- dictCheck(dp, pVM, 0);
-
- pFHash = dp->pSearch[dp->nLists - 1];
- pHash = pFHash->table;
- size = pFHash->size;
- nFilled = size;
-
- for (i = 0; i < size; i++)
- {
- int n = 0;
- pFW = pHash[i];
-
- while (pFW)
- {
- ++n;
- ++nWords;
- pFW = pFW->link;
- }
-
- avg += (double)(n * (n+1)) / 2.0;
-
- if (n > nMax)
- nMax = n;
- if (n == 0)
- --nFilled;
- }
-
- /* Calc actual avg search depth for this hash */
- avg = avg / nWords;
-
- /* Calc best possible performance with this size hash */
- nAvg = nWords / size;
- nRem = nWords % size;
- nDepth = size * (nAvg * (nAvg+1))/2 + (nAvg+1)*nRem;
- best = (double)nDepth/nWords;
-
- sprintf(pVM->pad,
- "%d bins, %2.0f%% filled, Depth: Max=%d, Avg=%2.1f, Best=%2.1f, Score: %2.0f%%",
- size,
- (double)nFilled * 100.0 / size, nMax,
- avg,
- best,
- 100.0 * best / avg);
-
- ficlTextOut(pVM, pVM->pad, 1);
-
- return;
-}
-
-
-/**************************************************************************
- d i c t I n c l u d e s
-** Returns TRUE iff the given pointer is within the address range of
-** the dictionary.
-**************************************************************************/
-int dictIncludes(FICL_DICT *pDict, void *p)
-{
- return ((p >= (void *) &pDict->dict)
- && (p < (void *)(&pDict->dict + pDict->size))
- );
-}
-
-
-/**************************************************************************
- d i c t L o o k u p
-** Find the FICL_WORD that matches the given name and length.
-** If found, returns the word's address. Otherwise returns NULL.
-** Uses the search order list to search multiple wordlists.
-**************************************************************************/
-FICL_WORD *dictLookup(FICL_DICT *pDict, STRINGINFO si)
-{
- FICL_WORD *pFW = NULL;
- FICL_HASH *pHash;
- int i;
- UNS16 hashCode = hashHashCode(si);
-
- assert(pDict);
-
- ficlLockDictionary(1);
-
- for (i = (int)pDict->nLists - 1; (i >= 0) && (!pFW); --i)
- {
- pHash = pDict->pSearch[i];
- pFW = hashLookup(pHash, si, hashCode);
- }
-
- ficlLockDictionary(0);
- return pFW;
-}
-
-
-/**************************************************************************
- d i c t L o o k u p L o c
-** Same as dictLookup, but looks in system locals dictionary first...
-** Assumes locals dictionary has only one wordlist...
-**************************************************************************/
-#if FICL_WANT_LOCALS
-FICL_WORD *dictLookupLoc(FICL_DICT *pDict, STRINGINFO si)
-{
- FICL_WORD *pFW = NULL;
- FICL_HASH *pHash = ficlGetLoc()->pForthWords;
- int i;
- UNS16 hashCode = hashHashCode(si);
-
- assert(pHash);
- assert(pDict);
-
- ficlLockDictionary(1);
- /*
- ** check the locals dict first...
- */
- pFW = hashLookup(pHash, si, hashCode);
-
- /*
- ** If no joy, (!pFW) --------------------------v
- ** iterate over the search list in the main dict
- */
- for (i = (int)pDict->nLists - 1; (i >= 0) && (!pFW); --i)
- {
- pHash = pDict->pSearch[i];
- pFW = hashLookup(pHash, si, hashCode);
- }
-
- ficlLockDictionary(0);
- return pFW;
-}
-#endif
-
-
-/**************************************************************************
- d i c t R e s e t S e a r c h O r d e r
-** Initialize the dictionary search order list to sane state
-**************************************************************************/
-void dictResetSearchOrder(FICL_DICT *pDict)
-{
- assert(pDict);
- pDict->pCompile = pDict->pForthWords;
- pDict->nLists = 1;
- pDict->pSearch[0] = pDict->pForthWords;
- return;
-}
-
-
-/**************************************************************************
- d i c t S e t F l a g s
-** Changes the flags field of the most recently defined word:
-** Set all bits that are ones in the set parameter, clear all bits
-** that are ones in the clr parameter. Clear wins in case the same bit
-** is set in both parameters.
-**************************************************************************/
-void dictSetFlags(FICL_DICT *pDict, UNS8 set, UNS8 clr)
-{
- assert(pDict->smudge);
- pDict->smudge->flags |= set;
- pDict->smudge->flags &= ~clr;
- return;
-}
-
-
-/**************************************************************************
- d i c t S e t I m m e d i a t e
-** Set the most recently defined word as IMMEDIATE
-**************************************************************************/
-void dictSetImmediate(FICL_DICT *pDict)
-{
- assert(pDict->smudge);
- pDict->smudge->flags |= FW_IMMEDIATE;
- return;
-}
-
-
-/**************************************************************************
- d i c t U n s m u d g e
-** Completes the definition of a word by linking it
-** into the main list
-**************************************************************************/
-void dictUnsmudge(FICL_DICT *pDict)
-{
- FICL_WORD *pFW = pDict->smudge;
- FICL_HASH *pHash = pDict->pCompile;
-
- assert(pHash);
- assert(pFW);
- /*
- ** :noname words never get linked into the list...
- */
- if (pFW->nName > 0)
- hashInsertWord(pHash, pFW);
- pFW->flags &= ~(FW_SMUDGE);
- return;
-}
-
-
-/**************************************************************************
- d i c t W h e r e
-** Returns the value of the HERE pointer -- the address
-** of the next free cell in the dictionary
-**************************************************************************/
-CELL *dictWhere(FICL_DICT *pDict)
-{
- return pDict->here;
-}
-
-
-/**************************************************************************
- h a s h F o r g e t
-** Unlink all words in the hash that have addresses greater than or
-** equal to the address supplied. Implementation factor for FORGET
-** and MARKER.
-**************************************************************************/
-void hashForget(FICL_HASH *pHash, void *where)
-{
- FICL_WORD *pWord;
- unsigned i;
-
- assert(pHash);
- assert(where);
-
- for (i = 0; i < pHash->size; i++)
- {
- pWord = pHash->table[i];
-
- while ((void *)pWord >= where)
- {
- pWord = pWord->link;
- }
-
- pHash->table[i] = pWord;
- }
-
- return;
-}
-
-
-/**************************************************************************
- h a s h H a s h C o d e
-**
-** Generate a 16 bit hashcode from a character string using a rolling
-** shift and add stolen from PJ Weinberger of Bell Labs fame. Case folds
-** the name before hashing it...
-** N O T E : If string has zero length, returns zero.
-**************************************************************************/
-UNS16 hashHashCode(STRINGINFO si)
-{
- /* hashPJW */
- UNS8 *cp;
- UNS16 code = (UNS16)si.count;
- UNS16 shift = 0;
-
- if (si.count == 0)
- return 0;
-
- for (cp = (UNS8 *)si.cp; *cp && si.count; cp++, si.count--)
- {
- code = (UNS16)((code << 4) + tolower(*cp));
- shift = (UNS16)(code & 0xf000);
- if (shift)
- {
- code ^= (UNS16)(shift >> 8);
- code ^= (UNS16)shift;
- }
- }
-
- return (UNS16)code;
-}
-
-
-/**************************************************************************
- h a s h I n s e r t W o r d
-** Put a word into the hash table using the word's hashcode as
-** an index (modulo the table size).
-**************************************************************************/
-void hashInsertWord(FICL_HASH *pHash, FICL_WORD *pFW)
-{
- FICL_WORD **pList;
-
- assert(pHash);
- assert(pFW);
-
- if (pHash->size == 1)
- {
- pList = pHash->table;
- }
- else
- {
- pList = pHash->table + (pFW->hash % pHash->size);
- }
-
- pFW->link = *pList;
- *pList = pFW;
- return;
-}
-
-
-/**************************************************************************
- h a s h L o o k u p
-** Find a name in the hash table given the hashcode and text of the name.
-** Returns the address of the corresponding FICL_WORD if found,
-** otherwise NULL.
-** Note: outer loop on link field supports inheritance in wordlists.
-** It's not part of ANS Forth - ficl only. hashReset creates wordlists
-** with NULL link fields.
-**************************************************************************/
-FICL_WORD *hashLookup(FICL_HASH *pHash, STRINGINFO si, UNS16 hashCode)
-{
- FICL_COUNT nCmp = (FICL_COUNT)si.count;
- FICL_WORD *pFW;
- UNS16 hashIdx;
-
- if (nCmp > nFICLNAME)
- nCmp = nFICLNAME;
-
- for (; pHash != NULL; pHash = pHash->link)
- {
- if (pHash->size > 1)
- hashIdx = (UNS16)(hashCode % pHash->size);
- else /* avoid the modulo op for single threaded lists */
- hashIdx = 0;
-
- for (pFW = pHash->table[hashIdx]; pFW; pFW = pFW->link)
- {
- if ( (pFW->nName == si.count)
- && (!strincmp(si.cp, pFW->name, nCmp)) )
- return pFW;
-#if FICL_ROBUST
- assert(pFW != pFW->link);
-#endif
- }
- }
-
- return NULL;
-}
-
-
-/**************************************************************************
- h a s h R e s e t
-** Initialize a FICL_HASH to empty state.
-**************************************************************************/
-void hashReset(FICL_HASH *pHash)
-{
- unsigned i;
-
- assert(pHash);
-
- for (i = 0; i < pHash->size; i++)
- {
- pHash->table[i] = NULL;
- }
-
- pHash->link = NULL;
- return;
-}
-
-
diff --git a/sys/boot/ficl/ficl.c b/sys/boot/ficl/ficl.c
deleted file mode 100644
index 3b5885f06e2b2..0000000000000
--- a/sys/boot/ficl/ficl.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*******************************************************************
-** f i c l . c
-** Forth Inspired Command Language - external interface
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** This is an ANS Forth interpreter written in C.
-** Ficl uses Forth syntax for its commands, but turns the Forth
-** model on its head in other respects.
-** Ficl provides facilities for interoperating
-** with programs written in C: C functions can be exported to Ficl,
-** and Ficl commands can be executed via a C calling interface. The
-** interpreter is re-entrant, so it can be used in multiple instances
-** in a multitasking system. Unlike Forth, Ficl's outer interpreter
-** expects a text block as input, and returns to the caller after each
-** text block, so the data pump is somewhere in external code. This
-** is more like TCL than Forth.
-**
-** Code is written in ANSI C for portability.
-*/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#else
-#include <stand.h>
-#endif
-#include <string.h>
-#include "ficl.h"
-
-
-/*
-** Local prototypes
-*/
-
-
-/*
-** System statics
-** The system builds a global dictionary during its start
-** sequence. This is shared by all interpreter instances.
-** Therefore only one instance can update the dictionary
-** at a time. The system imports a locking function that
-** you can override in order to control update access to
-** the dictionary. The function is stubbed out by default,
-** but you can insert one: #define FICL_MULTITHREAD 1
-** and supply your own version of ficlLockDictionary.
-*/
-static FICL_DICT *dp = NULL;
-static FICL_DICT *envp = NULL;
-#if FICL_WANT_LOCALS
-static FICL_DICT *localp = NULL;
-#endif
-static FICL_VM *vmList = NULL;
-
-static int defaultStack = FICL_DEFAULT_STACK;
-static int defaultDict = FICL_DEFAULT_DICT;
-
-
-/**************************************************************************
- f i c l I n i t S y s t e m
-** Binds a global dictionary to the interpreter system.
-** You specify the address and size of the allocated area.
-** After that, ficl manages it.
-** First step is to set up the static pointers to the area.
-** Then write the "precompiled" portion of the dictionary in.
-** The dictionary needs to be at least large enough to hold the
-** precompiled part. Try 1K cells minimum. Use "words" to find
-** out how much of the dictionary is used at any time.
-**************************************************************************/
-void ficlInitSystem(int nDictCells)
-{
- if (dp)
- dictDelete(dp);
-
- if (envp)
- dictDelete(envp);
-
-#if FICL_WANT_LOCALS
- if (localp)
- dictDelete(localp);
-#endif
-
- if (nDictCells <= 0)
- nDictCells = defaultDict;
-
- dp = dictCreateHashed((unsigned)nDictCells, HASHSIZE);
- envp = dictCreate( (unsigned)FICL_DEFAULT_ENV);
-#if FICL_WANT_LOCALS
- /*
- ** The locals dictionary is only searched while compiling,
- ** but this is where speed is most important. On the other
- ** hand, the dictionary gets emptied after each use of locals
- ** The need to balance search speed with the cost of the empty
- ** operation led me to select a single-threaded list...
- */
- localp = dictCreate( (unsigned)FICL_MAX_LOCALS * CELLS_PER_WORD);
-#endif
-
- ficlCompileCore(dp);
-
- return;
-}
-
-
-/**************************************************************************
- f i c l N e w V M
-** Create a new virtual machine and link it into the system list
-** of VMs for later cleanup by ficlTermSystem. If this is the first
-** VM to be created, use it to compile the words in softcore.c
-**************************************************************************/
-FICL_VM *ficlNewVM(void)
-{
- FICL_VM *pVM = vmCreate(NULL, defaultStack, defaultStack);
- pVM->link = vmList;
-
- /*
- ** Borrow the first vm to build the soft words in softcore.c
- */
- if (vmList == NULL)
- ficlCompileSoftCore(pVM);
-
- vmList = pVM;
- return pVM;
-}
-
-
-/**************************************************************************
- f i c l B u i l d
-** Builds a word into the dictionary.
-** Preconditions: system must be initialized, and there must
-** be enough space for the new word's header! Operation is
-** controlled by ficlLockDictionary, so any initialization
-** required by your version of the function (if you overrode
-** it) must be complete at this point.
-** Parameters:
-** name -- duh, the name of the word
-** code -- code to execute when the word is invoked - must take a single param
-** pointer to a FICL_VM
-** flags -- 0 or more of F_IMMEDIATE, F_COMPILE, use bitwise OR!
-**
-**************************************************************************/
-int ficlBuild(char *name, FICL_CODE code, char flags)
-{
- int err = ficlLockDictionary(TRUE);
- if (err) return err;
-
- dictAppendWord(dp, name, code, flags);
-
- ficlLockDictionary(FALSE);
- return 0;
-}
-
-
-/**************************************************************************
- f i c l E x e c
-** Evaluates a block of input text in the context of the
-** specified interpreter. Emits any requested output to the
-** interpreter's output function.
-**
-** Contains the "inner interpreter" code in a tight loop
-**
-** Returns one of the VM_XXXX codes defined in ficl.h:
-** VM_OUTOFTEXT is the normal exit condition
-** VM_ERREXIT means that the interp encountered a syntax error
-** and the vm has been reset to recover (some or all
-** of the text block got ignored
-** VM_USEREXIT means that the user executed the "bye" command
-** to shut down the interpreter. This would be a good
-** time to delete the vm, etc -- or you can ignore this
-** signal.
-**************************************************************************/
-int ficlExec(FICL_VM *pVM, char *pText)
-{
- int except;
- FICL_WORD *tempFW;
- jmp_buf vmState;
- jmp_buf *oldState;
- TIB saveTib;
-
- assert(pVM);
-
- vmPushTib(pVM, pText, &saveTib);
-
- /*
- ** Save and restore VM's jmp_buf to enable nested calls to ficlExec
- */
- oldState = pVM->pState;
- pVM->pState = &vmState; /* This has to come before the setjmp! */
- except = setjmp(vmState);
-
- switch (except)
- {
- case 0:
- if (pVM->fRestart)
- {
- pVM->fRestart = 0;
- pVM->runningWord->code(pVM);
- }
-
- /*
- ** the mysterious inner interpreter...
- ** vmThrow gets you out of this loop with a longjmp()
- */
- for (;;)
- {
- tempFW = *pVM->ip++;
- /*
- ** inline code for
- ** vmExecute(pVM, tempFW);
- */
- pVM->runningWord = tempFW;
- tempFW->code(pVM);
- }
-
- break;
-
- case VM_RESTART:
- pVM->fRestart = 1;
- except = VM_OUTOFTEXT;
- break;
-
- case VM_OUTOFTEXT:
-#ifdef TESTMAIN
- if ((pVM->state != COMPILE) && (pVM->sourceID.i == 0))
- ficlTextOut(pVM, FICL_PROMPT, 0);
-#endif
- break;
-
- case VM_USEREXIT:
- break;
-
- case VM_QUIT:
- if (pVM->state == COMPILE)
- dictAbortDefinition(dp);
- vmQuit(pVM);
- break;
-
- case VM_ERREXIT:
- default: /* user defined exit code?? */
- if (pVM->state == COMPILE)
- {
- dictAbortDefinition(dp);
-#if FICL_WANT_LOCALS
- dictEmpty(localp, localp->pForthWords->size);
-#endif
- }
- dictResetSearchOrder(dp);
- vmReset(pVM);
- break;
- }
-
- pVM->pState = oldState;
- vmPopTib(pVM, &saveTib);
- return (except);
-}
-
-/**************************************************************************
- f i c l E x e c F D
-** reads in text from file fd and passes it to ficlExec()
- * returns VM_OUTOFTEXT on success or the ficlExec() error code on
- * failure.
- */
-#define nLINEBUF 256
-int ficlExecFD(FICL_VM *pVM, int fd)
-{
- char cp[nLINEBUF];
- int i, nLine = 0, rval = VM_OUTOFTEXT;
- char ch;
- CELL id;
-
- id = pVM->sourceID;
- pVM->sourceID.i = fd;
-
- /* feed each line to ficlExec */
- while (1) {
- int status, i;
-
- i = 0;
- while ((status = read(fd, &ch, 1)) > 0 && ch != '\n')
- cp[i++] = ch;
- nLine++;
- if (!i) {
- if (status < 1)
- break;
- continue;
- }
- cp[i] = '\0';
- if ((rval = ficlExec(pVM, cp)) >= VM_ERREXIT)
- {
- pVM->sourceID = id;
- vmThrowErr(pVM, "ficlExecFD: Error at line %d", nLine);
- break;
- }
- }
- /*
- ** Pass an empty line with SOURCE-ID == 0 to flush
- ** any pending REFILLs (as required by FILE wordset)
- */
- pVM->sourceID.i = -1;
- ficlExec(pVM, "");
-
- pVM->sourceID = id;
- return rval;
-}
-
-/**************************************************************************
- f i c l L o o k u p
-** Look in the system dictionary for a match to the given name. If
-** found, return the address of the corresponding FICL_WORD. Otherwise
-** return NULL.
-**************************************************************************/
-FICL_WORD *ficlLookup(char *name)
-{
- STRINGINFO si;
- SI_PSZ(si, name);
- return dictLookup(dp, si);
-}
-
-
-/**************************************************************************
- f i c l G e t D i c t
-** Returns the address of the system dictionary
-**************************************************************************/
-FICL_DICT *ficlGetDict(void)
-{
- return dp;
-}
-
-
-/**************************************************************************
- f i c l G e t E n v
-** Returns the address of the system environment space
-**************************************************************************/
-FICL_DICT *ficlGetEnv(void)
-{
- return envp;
-}
-
-
-/**************************************************************************
- f i c l S e t E n v
-** Create an environment variable with a one-CELL payload. ficlSetEnvD
-** makes one with a two-CELL payload.
-**************************************************************************/
-void ficlSetEnv(char *name, UNS32 value)
-{
- STRINGINFO si;
- FICL_WORD *pFW;
-
- SI_PSZ(si, name);
- pFW = dictLookup(envp, si);
-
- if (pFW == NULL)
- {
- dictAppendWord(envp, name, constantParen, FW_DEFAULT);
- dictAppendCell(envp, LVALUEtoCELL(value));
- }
- else
- {
- pFW->param[0] = LVALUEtoCELL(value);
- }
-
- return;
-}
-
-void ficlSetEnvD(char *name, UNS32 hi, UNS32 lo)
-{
- FICL_WORD *pFW;
- STRINGINFO si;
- SI_PSZ(si, name);
- pFW = dictLookup(envp, si);
-
- if (pFW == NULL)
- {
- dictAppendWord(envp, name, twoConstParen, FW_DEFAULT);
- dictAppendCell(envp, LVALUEtoCELL(lo));
- dictAppendCell(envp, LVALUEtoCELL(hi));
- }
- else
- {
- pFW->param[0] = LVALUEtoCELL(lo);
- pFW->param[1] = LVALUEtoCELL(hi);
- }
-
- return;
-}
-
-
-/**************************************************************************
- f i c l G e t L o c
-** Returns the address of the system locals dictionary. This dict is
-** only used during compilation, and is shared by all VMs.
-**************************************************************************/
-#if FICL_WANT_LOCALS
-FICL_DICT *ficlGetLoc(void)
-{
- return localp;
-}
-#endif
-
-
-/**************************************************************************
- f i c l T e r m S y s t e m
-** Tear the system down by deleting the dictionaries and all VMs.
-** This saves you from having to keep track of all that stuff.
-**************************************************************************/
-void ficlTermSystem(void)
-{
- if (dp)
- dictDelete(dp);
- dp = NULL;
-
- if (envp)
- dictDelete(envp);
- envp = NULL;
-
-#if FICL_WANT_LOCALS
- if (localp)
- dictDelete(localp);
- localp = NULL;
-#endif
-
- while (vmList != NULL)
- {
- FICL_VM *pVM = vmList;
- vmList = vmList->link;
- vmDelete(pVM);
- }
-
- return;
-}
diff --git a/sys/boot/ficl/ficl.h b/sys/boot/ficl/ficl.h
deleted file mode 100644
index 3fcb32efbb813..0000000000000
--- a/sys/boot/ficl/ficl.h
+++ /dev/null
@@ -1,773 +0,0 @@
-/*******************************************************************
-** f i c l . h
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** N O T I C E -- DISCLAIMER OF WARRANTY
-**
-** Ficl is freeware. Use it in any way that you like, with
-** the understanding that the code is supported on a "best effort"
-** basis only.
-**
-** Any third party may reproduce, distribute, or modify the ficl
-** software code or any derivative works thereof without any
-** compensation or license, provided that the author information
-** and this disclaimer text are retained in the source code files.
-** The ficl software code is provided on an "as is" basis without
-** warranty of any kind, including, without limitation, the implied
-** warranties of merchantability and fitness for a particular purpose
-** and their equivalents under the laws of any jurisdiction.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release (yay!), please
-** send me email at the address above.
-*/
-
-#if !defined (__FICL_H__)
-#define __FICL_H__
-/*
-** Ficl (Forth-inspired command language) is an ANS Forth
-** interpreter written in C. Unlike traditional Forths, this
-** interpreter is designed to be embedded into other systems
-** as a command/macro/development prototype language.
-**
-** Where Forths usually view themselves as the center of the system
-** and expect the rest of the system to be coded in Forth, Ficl
-** acts as a component of the system. It is easy to export
-** code written in C or ASM to Ficl in the style of TCL, or to invoke
-** Ficl code from a compiled module. This allows you to do incremental
-** development in a way that combines the best features of threaded
-** languages (rapid development, quick code/test/debug cycle,
-** reasonably fast) with the best features of C (everyone knows it,
-** easier to support large blocks of code, efficient, type checking).
-**
-** Ficl provides facilities for interoperating
-** with programs written in C: C functions can be exported to Ficl,
-** and Ficl commands can be executed via a C calling interface. The
-** interpreter is re-entrant, so it can be used in multiple instances
-** in a multitasking system. Unlike Forth, Ficl's outer interpreter
-** expects a text block as input, and returns to the caller after each
-** text block, so the "data pump" is somewhere in external code. This
-** is more like TCL than Forth, which usually expcets to be at the center
-** of the system, requesting input at its convenience. Each Ficl virtual
-** machine can be bound to a different I/O channel, and is independent
-** of all others in in the same address space except that all virtual
-** machines share a common dictionary (a sort or open symbol table that
-** defines all of the elements of the language).
-**
-** Code is written in ANSI C for portability.
-**
-** Summary of Ficl features and constraints:
-** - Standard: Implements the ANSI Forth CORE word set and part
-** of the CORE EXT word-set, SEARCH and SEARCH EXT, TOOLS and
-** TOOLS EXT, LOCAL and LOCAL ext and various extras.
-** - Extensible: you can export code written in Forth, C,
-** or asm in a straightforward way. Ficl provides open
-** facilities for extending the language in an application
-** specific way. You can even add new control structures!
-** - Ficl and C can interact in two ways: Ficl can encapsulate
-** C code, or C code can invoke Ficl code.
-** - Thread-safe, re-entrant: The shared system dictionary
-** uses a locking mechanism that you can either supply
-** or stub out to provide exclusive access. Each Ficl
-** virtual machine has an otherwise complete state, and
-** each can be bound to a separate I/O channel (or none at all).
-** - Simple encapsulation into existing systems: a basic implementation
-** requires three function calls (see the example program in testmain.c).
-** - ROMable: Ficl is designed to work in RAM-based and ROM code / RAM data
-** environments. It does require somewhat more memory than a pure
-** ROM implementation because it builds its system dictionary in
-** RAM at startup time.
-** - Written an ANSI C to be as simple as I can make it to understand,
-** support, debug, and port. Compiles without complaint at /Az /W4
-** (require ANSI C, max warnings) under Microsoft VC++ 5.
-** - Does full 32 bit math (but you need to implement
-** two mixed precision math primitives (see sysdep.c))
-** - Indirect threaded interpreter is not the fastest kind of
-** Forth there is (see pForth 68K for a really fast subroutine
-** threaded interpreter), but it's the cleanest match to a
-** pure C implementation.
-**
-** P O R T I N G F i c l
-**
-** To install Ficl on your target system, you need an ANSI C compiler
-** and its runtime library. Inspect the system dependent macros and
-** functions in sysdep.h and sysdep.c and edit them to suit your
-** system. For example, INT16 is a short on some compilers and an
-** int on others. Check the default CELL alignment controlled by
-** FICL_ALIGN. If necessary, add new definitions of ficlMalloc, ficlFree,
-** ficlLockDictionary, and ficlTextOut to work with your operating system.
-** Finally, use testmain.c as a guide to installing the Ficl system and
-** one or more virtual machines into your code. You do not need to include
-** testmain.c in your build.
-**
-** T o D o L i s t
-**
-** 1. Unimplemented system dependent CORE word: key
-** 2. Kludged CORE word: ACCEPT
-** 3. Dictionary locking is full of holes - only one vm at a time
-** can alter the dict.
-** 4. Ficl uses the pad in CORE words - this violates the standard,
-** but it's cleaner for a multithreaded system. I'll have to make a
-** second pad for reference by the word PAD to fix this.
-**
-** F o r M o r e I n f o r m a t i o n
-**
-** Web home of ficl
-** http://www.taygeta.com/forth/compilers
-** Check this website for Forth literature (including the ANSI standard)
-** http://www.taygeta.com/forthlit.html
-** and here for software and more links
-** http://www.taygeta.com/forth.html
-**
-** Obvious Performance enhancement opportunities
-** Compile speed
-** - work on interpret speed
-** - turn off locals (FICL_WANT_LOCALS)
-** Interpret speed
-** - Change inner interpreter (and everything else)
-** so that a definition is a list of pointers to functions
-** and inline data rather than pointers to words. This gets
-** rid of vm->runningWord and a level of indirection in the
-** inner loop. I'll look at it for ficl 3.0
-** - Make the main hash table a bigger prime (HASHSIZE)
-** - FORGET about twiddling the hash function - my experience is
-** that that is a waste of time.
-** - eliminate the need to pass the pVM parameter on the stack
-** by dedicating a register to it. Most words need access to the
-** vm, but the parameter passing overhead can be reduced. One way
-** requires that the host OS have a task switch callout. Create
-** a global variable for the running VM and refer to it in words
-** that need VM access. Alternative: use thread local storage.
-** For single threaded implementations, you can just use a global.
-** The first two solutions create portability problems, so I
-** haven't considered doing them. Another possibility is to
-** declare the pVm parameter to be "register", and hope the compiler
-** pays attention.
-**
-*/
-
-/*
-** Revision History:
-** 27 Aug 1998 (sadler) testing and corrections for LOCALS, LOCALS EXT,
-** SEARCH / SEARCH EXT, TOOLS / TOOLS EXT.
-** Added .X to display in hex, PARSE and PARSE-WORD to supplement WORD,
-** EMPTY to clear stack.
-**
-** 29 jun 1998 (sadler) added variable sized hash table support
-** and ANS Forth optional SEARCH & SEARCH EXT word set.
-** 26 May 1998 (sadler)
-** FICL_PROMPT macro
-** 14 April 1998 (sadler) V1.04
-** Ficlwin: Windows version, Skip Carter's Linux port
-** 5 March 1998 (sadler) V1.03
-** Bug fixes -- passes John Ryan's ANS test suite "core.fr"
-**
-** 24 February 1998 (sadler) V1.02
-** -Fixed bugs in <# # #>
-** -Changed FICL_WORD so that storage for the name characters
-** can be allocated from the dictionary as needed rather than
-** reserving 32 bytes in each word whether needed or not -
-** this saved 50% of the dictionary storage requirement.
-** -Added words in testmain for Win32 functions system,chdir,cwd,
-** also added a word that loads and evaluates a file.
-**
-** December 1997 (sadler)
-** -Added VM_RESTART exception handling in ficlExec -- this lets words
-** that require additional text to succeed (like :, create, variable...)
-** recover gracefully from an empty input buffer rather than emitting
-** an error message. Definitions can span multiple input blocks with
-** no restrictions.
-** -Changed #include order so that <assert.h> is included in sysdep.h,
-** and sysdep is included in all other files. This lets you define
-** NDEBUG in sysdep.h to disable assertions if you want to.
-** -Make PC specific system dependent code conditional on _M_IX86
-** defined so that ports can coexist in sysdep.h/sysdep.c
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "sysdep.h"
-#include <limits.h> /* UCHAR_MAX */
-
-/*
-** Forward declarations... read on.
-*/
-struct ficl_word;
-struct vm;
-struct ficl_dict;
-
-/*
-** the Good Stuff starts here...
-*/
-#define FICL_VER "2.02"
-#ifndef FICL_PROMPT
-# define FICL_PROMPT "ok> "
-#endif
-
-/*
-** ANS Forth requires false to be zero, and true to be the ones
-** complement of false... that unifies logical and bitwise operations
-** nicely.
-*/
-#define FICL_TRUE (0xffffffffL)
-#define FICL_FALSE (0)
-#define FICL_BOOL(x) ((x) ? FICL_TRUE : FICL_FALSE)
-
-
-/*
-** A CELL is the main storage type. It must be large enough
-** to contain a pointer or a scalar. Let's be picky and make
-** a 32 bit cell explicitly...
-*/
-typedef union _cell
-{
- INT32 i;
- UNS32 u;
- void *p;
-} CELL;
-
-/*
-** LVALUEtoCELL does a little pointer trickery to cast any 32 bit
-** lvalue (informal definition: an expression whose result has an
-** address) to CELL. Remember that constants and casts are NOT
-** themselves lvalues!
-*/
-#define LVALUEtoCELL(v) (*(CELL *)&v)
-
-/*
-** PTRtoCELL is a cast through void * intended to satisfy the
-** most outrageously pedantic compiler... (I won't mention
-** its name)
-*/
-#define PTRtoCELL (CELL *)(void *)
-#define PTRtoSTRING (FICL_STRING *)(void *)
-
-/*
-** Strings in FICL are stored in Pascal style - with a count
-** preceding the text. We'll also NULL-terminate them so that
-** they work with the usual C lib string functions. (Belt &
-** suspenders? You decide.)
-** STRINGINFO hides the implementation with a couple of
-** macros for use in internal routines.
-*/
-
-typedef unsigned char FICL_COUNT;
-#define FICL_STRING_MAX UCHAR_MAX
-typedef struct _ficl_string
-{
- FICL_COUNT count;
- char text[1];
-} FICL_STRING;
-
-typedef struct
-{
- UNS32 count;
- char *cp;
-} STRINGINFO;
-
-#define SI_COUNT(si) (si.count)
-#define SI_PTR(si) (si.cp)
-#define SI_SETLEN(si, len) (si.count = (UNS32)(len))
-#define SI_SETPTR(si, ptr) (si.cp = (char *)(ptr))
-/*
-** Init a STRINGINFO from a pointer to NULL-terminated string
-*/
-#define SI_PSZ(si, psz) \
- {si.cp = psz; si.count = (FICL_COUNT)strlen(psz);}
-/*
-** Init a STRINGINFO from a pointer to FICL_STRING
-*/
-#define SI_PFS(si, pfs) \
- {si.cp = pfs->text; si.count = pfs->count;}
-
-/*
-** Ficl uses a this little structure to hold the address of
-** the block of text it's working on and an index to the next
-** unconsumed character in the string. Traditionally, this is
-** done by a Text Input Buffer, so I've called this struct TIB.
-*/
-typedef struct
-{
- INT32 index;
- char *cp;
-} TIB;
-
-
-/*
-** Stacks get heavy use in Ficl and Forth...
-** Each virtual machine implements two of them:
-** one holds parameters (data), and the other holds return
-** addresses and control flow information for the virtual
-** machine. (Note: C's automatic stack is implicitly used,
-** but not modeled because it doesn't need to be...)
-** Here's an abstract type for a stack
-*/
-typedef struct _ficlStack
-{
- UNS32 nCells; /* size of the stack */
- CELL *pFrame; /* link reg for stack frame */
- CELL *sp; /* stack pointer */
- CELL base[1]; /* Bottom of the stack */
-} FICL_STACK;
-
-/*
-** Stack methods... many map closely to required Forth words.
-*/
-FICL_STACK *stackCreate(unsigned nCells);
-void stackDelete(FICL_STACK *pStack);
-int stackDepth (FICL_STACK *pStack);
-void stackDrop (FICL_STACK *pStack, int n);
-CELL stackFetch (FICL_STACK *pStack, int n);
-CELL stackGetTop(FICL_STACK *pStack);
-void stackLink (FICL_STACK *pStack, int nCells);
-void stackPick (FICL_STACK *pStack, int n);
-CELL stackPop (FICL_STACK *pStack);
-void *stackPopPtr (FICL_STACK *pStack);
-UNS32 stackPopUNS32 (FICL_STACK *pStack);
-INT32 stackPopINT32 (FICL_STACK *pStack);
-void stackPush (FICL_STACK *pStack, CELL c);
-void stackPushPtr (FICL_STACK *pStack, void *ptr);
-void stackPushUNS32(FICL_STACK *pStack, UNS32 u);
-void stackPushINT32(FICL_STACK *pStack, INT32 i);
-void stackReset (FICL_STACK *pStack);
-void stackRoll (FICL_STACK *pStack, int n);
-void stackSetTop(FICL_STACK *pStack, CELL c);
-void stackStore (FICL_STACK *pStack, int n, CELL c);
-void stackUnlink(FICL_STACK *pStack);
-
-/*
-** The virtual machine (VM) contains the state for one interpreter.
-** Defined operations include:
-** Create & initialize
-** Delete
-** Execute a block of text
-** Parse a word out of the input stream
-** Call return, and branch
-** Text output
-** Throw an exception
-*/
-
-typedef struct ficl_word ** IPTYPE; /* the VM's instruction pointer */
-
-/*
-** Each VM has a placeholder for an output function -
-** this makes it possible to have each VM do I/O
-** through a different device. If you specify no
-** OUTFUNC, it defaults to ficlTextOut.
-*/
-typedef void (*OUTFUNC)(struct vm *pVM, char *text, int fNewline);
-
-/*
-** Each VM operates in one of two non-error states: interpreting
-** or compiling. When interpreting, words are simply executed.
-** When compiling, most words in the input stream have their
-** addresses inserted into the word under construction. Some words
-** (known as IMMEDIATE) are executed in the compile state, too.
-*/
-/* values of STATE */
-#define INTERPRET 0
-#define COMPILE 1
-
-/*
-** The pad is a small scratch area for text manipulation. ANS Forth
-** requires it to hold at least 84 characters.
-*/
-#if !defined nPAD
-#define nPAD 256
-#endif
-
-/*
-** ANS Forth requires that a word's name contain {1..31} characters.
-*/
-#if !defined nFICLNAME
-#define nFICLNAME 31
-#endif
-
-/*
-** OK - now we can really define the VM...
-*/
-typedef struct vm
-{
- struct vm *link; /* Ficl keeps a VM list for simple teardown */
- jmp_buf *pState; /* crude exception mechanism... */
- OUTFUNC textOut; /* Output callback - see sysdep.c */
- void * pExtend; /* vm extension pointer */
- short fRestart; /* Set TRUE to restart runningWord */
- IPTYPE ip; /* instruction pointer */
- struct ficl_word
- *runningWord;/* address of currently running word (often just *(ip-1) ) */
- UNS32 state; /* compiling or interpreting */
- UNS32 base; /* number conversion base */
- FICL_STACK *pStack; /* param stack */
- FICL_STACK *rStack; /* return stack */
- CELL sourceID; /* -1 if string, 0 if normal input */
- TIB tib; /* address of incoming text string */
-#if FICL_WANT_USER
- CELL user[FICL_USER_CELLS];
-#endif
- char pad[nPAD]; /* the scratch area (see above) */
-} FICL_VM;
-
-/*
-** A FICL_CODE points to a function that gets called to help execute
-** a word in the dictionary. It always gets passed a pointer to the
-** running virtual machine, and from there it can get the address
-** of the parameter area of the word it's supposed to operate on.
-** For precompiled words, the code is all there is. For user defined
-** words, the code assumes that the word's parameter area is a list
-** of pointers to the code fields of other words to execute, and
-** may also contain inline data. The first parameter is always
-** a pointer to a code field.
-*/
-typedef void (*FICL_CODE)(FICL_VM *pVm);
-
-/*
-** Ficl models memory as a contiguous space divided into
-** words in a linked list called the dictionary.
-** A FICL_WORD starts each entry in the list.
-** Version 1.02: space for the name characters is allotted from
-** the dictionary ahead of the word struct - this saves about half
-** the storage on average with very little runtime cost.
-*/
-typedef struct ficl_word
-{
- struct ficl_word *link; /* Previous word in the dictionary */
- UNS16 hash;
- UNS8 flags; /* Immediate, Smudge, Compile-only */
- FICL_COUNT nName; /* Number of chars in word name */
- char *name; /* First nFICLNAME chars of word name */
- FICL_CODE code; /* Native code to execute the word */
- CELL param[1]; /* First data cell of the word */
-} FICL_WORD;
-
-/*
-** Worst-case size of a word header: nFICLNAME chars in name
-*/
-#define CELLS_PER_WORD \
- ( (sizeof (FICL_WORD) + nFICLNAME + sizeof (CELL)) \
- / (sizeof (CELL)) )
-
-int wordIsImmediate(FICL_WORD *pFW);
-int wordIsCompileOnly(FICL_WORD *pFW);
-
-/* flag values for word header */
-#define FW_IMMEDIATE 1 /* execute me even if compiling */
-#define FW_COMPILE 2 /* error if executed when not compiling */
-#define FW_SMUDGE 4 /* definition in progress - hide me */
-#define FW_CLASS 8 /* Word defines a class */
-
-#define FW_COMPIMMED (FW_IMMEDIATE | FW_COMPILE)
-#define FW_DEFAULT 0
-
-
-/*
-** Exit codes for vmThrow
-*/
-#define VM_OUTOFTEXT 1 /* hungry - normal exit */
-#define VM_RESTART 2 /* word needs more text to suxcceed - re-run it */
-#define VM_USEREXIT 3 /* user wants to quit */
-#define VM_ERREXIT 4 /* interp found an error */
-#define VM_QUIT 5 /* like errexit, but leave pStack & base alone */
-
-
-void vmBranchRelative(FICL_VM *pVM, int offset);
-FICL_VM * vmCreate (FICL_VM *pVM, unsigned nPStack, unsigned nRStack);
-void vmDelete (FICL_VM *pVM);
-void vmExecute(FICL_VM *pVM, FICL_WORD *pWord);
-char * vmGetString(FICL_VM *pVM, FICL_STRING *spDest, char delimiter);
-STRINGINFO vmGetWord(FICL_VM *pVM);
-STRINGINFO vmGetWord0(FICL_VM *pVM);
-int vmGetWordToPad(FICL_VM *pVM);
-STRINGINFO vmParseString(FICL_VM *pVM, char delimiter);
-void vmPopIP (FICL_VM *pVM);
-void vmPushIP (FICL_VM *pVM, IPTYPE newIP);
-void vmQuit (FICL_VM *pVM);
-void vmReset (FICL_VM *pVM);
-void vmSetTextOut(FICL_VM *pVM, OUTFUNC textOut);
-void vmTextOut(FICL_VM *pVM, char *text, int fNewline);
-void vmThrow (FICL_VM *pVM, int except);
-void vmThrowErr(FICL_VM *pVM, char *fmt, ...);
-
-/*
-** vmCheckStack needs a vm pointer because it might have to say
-** something if it finds a problem. Parms popCells and pushCells
-** correspond to the number of parameters on the left and right of
-** a word's stack effect comment.
-*/
-void vmCheckStack(FICL_VM *pVM, int popCells, int pushCells);
-
-/*
-** TIB access routines...
-** ANS forth seems to require the input buffer to be represented
-** as a pointer to the start of the buffer, and an index to the
-** next character to read.
-** PushTib points the VM to a new input string and optionally
-** returns a copy of the current state
-** PopTib restores the TIB state given a saved TIB from PushTib
-** GetInBuf returns a pointer to the next unused char of the TIB
-*/
-void vmPushTib(FICL_VM *pVM, char *text, TIB *pSaveTib);
-void vmPopTib(FICL_VM *pVM, TIB *pTib);
-#define vmGetInBuf(pVM) ((pVM)->tib.cp + (pVM)->tib.index)
-#define vmSetTibIndex(pVM, i) (pVM)->tib.index = i
-#define vmUpdateTib(pVM, str) (pVM)->tib.index = (str) - (pVM)->tib.cp
-
-/*
-** Generally useful string manipulators omitted by ANSI C...
-** ltoa complements strtol
-*/
-#if defined(_WIN32) && !FICL_MAIN
-/* #SHEESH
-** Why do Microsoft Meatballs insist on contaminating
-** my namespace with their string functions???
-*/
-#pragma warning(disable: 4273)
-#endif
-
-char *ltoa( INT32 value, char *string, int radix );
-char *ultoa(UNS32 value, char *string, int radix );
-char digit_to_char(int value);
-char *strrev( char *string );
-char *skipSpace(char *cp);
-char *caseFold(char *cp);
-int strincmp(char *cp1, char *cp2, FICL_COUNT count);
-
-#if defined(_WIN32) && !FICL_MAIN
-#pragma warning(default: 4273)
-#endif
-
-/*
-** Ficl hash table - variable size.
-** assert(size > 0)
-** If size is 1, the table degenerates into a linked list.
-** A WORDLIST (see the search order word set in DPANS) is
-** just a pointer to a FICL_HASH in this implementation.
-*/
-#if !defined HASHSIZE /* Default size of hash table. For best */
-#define HASHSIZE 127 /* performance, use a prime number! */
-#endif
-
-typedef struct ficl_hash
-{
- struct ficl_hash *link; /* eventual inheritance support */
- unsigned size;
- FICL_WORD *table[1];
-} FICL_HASH;
-
-void hashForget(FICL_HASH *pHash, void *where);
-UNS16 hashHashCode(STRINGINFO si);
-void hashInsertWord(FICL_HASH *pHash, FICL_WORD *pFW);
-FICL_WORD *hashLookup(struct ficl_hash *pHash,
- STRINGINFO si,
- UNS16 hashCode);
-void hashReset(FICL_HASH *pHash);
-
-/*
-** A Dictionary is a linked list of FICL_WORDs. It is also Ficl's
-** memory model. Description of fields:
-**
-** here -- points to the next free byte in the dictionary. This
-** pointer is forced to be CELL-aligned before a definition is added.
-** Do not assume any specific alignment otherwise - Use dictAlign().
-**
-** smudge -- pointer to word currently being defined (or last defined word)
-** If the definition completes successfully, the word will be
-** linked into the hash table. If unsuccessful, dictUnsmudge
-** uses this pointer to restore the previous state of the dictionary.
-** Smudge prevents unintentional recursion as a side-effect: the
-** dictionary search algo examines only completed definitions, so a
-** word cannot invoke itself by name. See the ficl word "recurse".
-** NOTE: smudge always points to the last word defined. IMMEDIATE
-** makes use of this fact. Smudge is initially NULL.
-**
-** pForthWords -- pointer to the default wordlist (FICL_HASH).
-** This is the initial compilation list, and contains all
-** ficl's precompiled words.
-**
-** pCompile -- compilation wordlist - initially equal to pForthWords
-** pSearch -- array of pointers to wordlists. Managed as a stack.
-** Highest index is the first list in the search order.
-** nLists -- number of lists in pSearch. nLists-1 is the highest
-** filled slot in pSearch, and points to the first wordlist
-** in the search order
-** size -- number of cells in the dictionary (total)
-** dict -- start of data area. Must be at the end of the struct.
-*/
-typedef struct ficl_dict
-{
- CELL *here;
- FICL_WORD *smudge;
- FICL_HASH *pForthWords;
- FICL_HASH *pCompile;
- FICL_HASH *pSearch[FICL_DEFAULT_VOCS];
- int nLists;
- unsigned size; /* Number of cells in dict (total)*/
- CELL dict[1]; /* Base of dictionary memory */
-} FICL_DICT;
-
-void *alignPtr(void *ptr);
-void dictAbortDefinition(FICL_DICT *pDict);
-void dictAlign(FICL_DICT *pDict);
-int dictAllot(FICL_DICT *pDict, int n);
-int dictAllotCells(FICL_DICT *pDict, int nCells);
-void dictAppendCell(FICL_DICT *pDict, CELL c);
-void dictAppendChar(FICL_DICT *pDict, char c);
-FICL_WORD *dictAppendWord(FICL_DICT *pDict,
- char *name,
- FICL_CODE pCode,
- UNS8 flags);
-FICL_WORD *dictAppendWord2(FICL_DICT *pDict,
- STRINGINFO si,
- FICL_CODE pCode,
- UNS8 flags);
-void dictAppendUNS32(FICL_DICT *pDict, UNS32 u);
-int dictCellsAvail(FICL_DICT *pDict);
-int dictCellsUsed (FICL_DICT *pDict);
-void dictCheck(FICL_DICT *pDict, FICL_VM *pVM, int nCells);
-FICL_DICT *dictCreate(unsigned nCELLS);
-FICL_DICT *dictCreateHashed(unsigned nCells, unsigned nHash);
-void dictDelete(FICL_DICT *pDict);
-void dictEmpty(FICL_DICT *pDict, unsigned nHash);
-void dictHashSummary(FICL_VM *pVM);
-int dictIncludes(FICL_DICT *pDict, void *p);
-FICL_WORD *dictLookup(FICL_DICT *pDict, STRINGINFO si);
-#if FICL_WANT_LOCALS
-FICL_WORD *dictLookupLoc(FICL_DICT *pDict, STRINGINFO si);
-#endif
-void dictResetSearchOrder(FICL_DICT *pDict);
-void dictSetFlags(FICL_DICT *pDict, UNS8 set, UNS8 clr);
-void dictSetImmediate(FICL_DICT *pDict);
-void dictUnsmudge(FICL_DICT *pDict);
-CELL *dictWhere(FICL_DICT *pDict);
-
-
-/*
-** External interface to FICL...
-*/
-/*
-** f i c l I n i t S y s t e m
-** Binds a global dictionary to the interpreter system and initializes
-** the dict to contain the ANSI CORE wordset.
-** You specify the address and size of the allocated area.
-** After that, ficl manages it.
-** First step is to set up the static pointers to the area.
-** Then write the "precompiled" portion of the dictionary in.
-** The dictionary needs to be at least large enough to hold the
-** precompiled part. Try 1K cells minimum. Use "words" to find
-** out how much of the dictionary is used at any time.
-*/
-void ficlInitSystem(int nDictCells);
-
-/*
-** f i c l T e r m S y s t e m
-** Deletes the system dictionary and all virtual machines that
-** were created with ficlNewVM (see below). Call this function to
-** reclaim all memory used by the dictionary and VMs.
-*/
-void ficlTermSystem(void);
-
-/*
-** f i c l E x e c
-** Evaluates a block of input text in the context of the
-** specified interpreter. Emits any requested output to the
-** interpreter's output function
-** Execution returns when the text block has been executed,
-** or an error occurs.
-** Returns one of the VM_XXXX codes defined in ficl.h:
-** VM_OUTOFTEXT is the normal exit condition
-** VM_ERREXIT means that the interp encountered a syntax error
-** and the vm has been reset to recover (some or all
-** of the text block got ignored
-** VM_USEREXIT means that the user executed the "bye" command
-** to shut down the interpreter. This would be a good
-** time to delete the vm, etc -- or you can ignore this
-** signal.
-** Preconditions: successful execution of ficlInitSystem,
-** Successful creation and init of the VM by ficlNewVM (or equiv)
-*/
-int ficlExec(FICL_VM *pVM, char *pText);
-
-/*
-** ficlExecFD(FICL_VM *pVM, int fd);
- * Evaluates text from file passed in via fd.
- * Execution returns when all of file has been executed or an
- * error occurs.
- */
-int ficlExecFD(FICL_VM *pVM, int fd);
-
-/*
-** Create a new VM from the heap, and link it into the system VM list.
-** Initializes the VM and binds default sized stacks to it. Returns the
-** address of the VM, or NULL if an error occurs.
-** Precondition: successful execution of ficlInitSystem
-*/
-FICL_VM *ficlNewVM(void);
-
-/*
-** Returns the address of the most recently defined word in the system
-** dictionary with the given name, or NULL if no match.
-** Precondition: successful execution of ficlInitSystem
-*/
-FICL_WORD *ficlLookup(char *name);
-
-/*
-** f i c l G e t D i c t
-** Utility function - returns the address of the system dictionary.
-** Precondition: successful execution of ficlInitSystem
-*/
-FICL_DICT *ficlGetDict(void);
-FICL_DICT *ficlGetEnv(void);
-void ficlSetEnv(char *name, UNS32 value);
-void ficlSetEnvD(char *name, UNS32 hi, UNS32 lo);
-#if FICL_WANT_LOCALS
-FICL_DICT *ficlGetLoc(void);
-#endif
-/*
-** f i c l B u i l d
-** Builds a word into the system default dictionary in a thread-safe way.
-** Preconditions: system must be initialized, and there must
-** be enough space for the new word's header! Operation is
-** controlled by ficlLockDictionary, so any initialization
-** required by your version of the function (if you "overrode"
-** it) must be complete at this point.
-** Parameters:
-** name -- the name of the word to be built
-** code -- code to execute when the word is invoked - must take a single param
-** pointer to a FICL_VM
-** flags -- 0 or more of FW_IMMEDIATE, FW_COMPILE, use bitwise OR!
-** Most words can use FW_DEFAULT.
-** nAllot - number of extra cells to allocate in the parameter area (usually zero)
-*/
-int ficlBuild(char *name, FICL_CODE code, char flags);
-
-/*
-** f i c l C o m p i l e C o r e
-** Builds the ANS CORE wordset into the dictionary - called by
-** ficlInitSystem - no need to waste dict space by doing it again.
-*/
-void ficlCompileCore(FICL_DICT *dp);
-void ficlCompileSoftCore(FICL_VM *pVM);
-
-/*
-** from words.c...
-*/
-void constantParen(FICL_VM *pVM);
-void twoConstParen(FICL_VM *pVM);
-
-#if defined(__i386__) && !defined(TESTMAIN)
-extern void ficlOutb(FICL_VM *pVM);
-extern void ficlInb(FICL_VM *pVM);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __FICL_H__ */
diff --git a/sys/boot/ficl/math64.c b/sys/boot/ficl/math64.c
deleted file mode 100644
index e83000a8b4a2c..0000000000000
--- a/sys/boot/ficl/math64.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************
-** m a t h 6 4 . c
-** Forth Inspired Command Language - 64 bit math support routines
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 25 January 1998
-**
-*******************************************************************/
-
-#include "ficl.h"
-#include "math64.h"
-
-
-/**************************************************************************
- m 6 4 A b s
-** Returns the absolute value of an INT64
-**************************************************************************/
-INT64 m64Abs(INT64 x)
-{
- if (m64IsNegative(x))
- x = m64Negate(x);
-
- return x;
-}
-
-
-/**************************************************************************
- m 6 4 F l o o r e d D i v I
-**
-** FROM THE FORTH ANS...
-** Floored division is integer division in which the remainder carries
-** the sign of the divisor or is zero, and the quotient is rounded to
-** its arithmetic floor. Symmetric division is integer division in which
-** the remainder carries the sign of the dividend or is zero and the
-** quotient is the mathematical quotient rounded towards zero or
-** truncated. Examples of each are shown in tables 3.3 and 3.4.
-**
-** Table 3.3 - Floored Division Example
-** Dividend Divisor Remainder Quotient
-** -------- ------- --------- --------
-** 10 7 3 1
-** -10 7 4 -2
-** 10 -7 -4 -2
-** -10 -7 -3 1
-**
-**
-** Table 3.4 - Symmetric Division Example
-** Dividend Divisor Remainder Quotient
-** -------- ------- --------- --------
-** 10 7 3 1
-** -10 7 -3 -1
-** 10 -7 3 -1
-** -10 -7 -3 1
-**************************************************************************/
-INTQR m64FlooredDivI(INT64 num, INT32 den)
-{
- INTQR qr;
- UNSQR uqr;
- int signRem = 1;
- int signQuot = 1;
-
- if (m64IsNegative(num))
- {
- num = m64Negate(num);
- signQuot = -signQuot;
- }
-
- if (den < 0)
- {
- den = -den;
- signRem = -signRem;
- signQuot = -signQuot;
- }
-
- uqr = ficlLongDiv(m64CastIU(num), (UNS32)den);
- qr = m64CastQRUI(uqr);
- if (signQuot < 0)
- {
- qr.quot = -qr.quot;
- if (qr.rem != 0)
- {
- qr.quot--;
- qr.rem = den - qr.rem;
- }
- }
-
- if (signRem < 0)
- qr.rem = -qr.rem;
-
- return qr;
-}
-
-
-/**************************************************************************
- m 6 4 I s N e g a t i v e
-** Returns TRUE if the specified INT64 has its sign bit set.
-**************************************************************************/
-int m64IsNegative(INT64 x)
-{
- return (x.hi < 0);
-}
-
-
-/**************************************************************************
- m 6 4 M a c
-** Mixed precision multiply and accumulate primitive for number building.
-** Multiplies UNS64 u by UNS32 mul and adds UNS32 add. Mul is typically
-** the numeric base, and add represents a digit to be appended to the
-** growing number.
-** Returns the result of the operation
-**************************************************************************/
-UNS64 m64Mac(UNS64 u, UNS32 mul, UNS32 add)
-{
- UNS64 resultLo = ficlLongMul(u.lo, mul);
- UNS64 resultHi = ficlLongMul(u.hi, mul);
- resultLo.hi += resultHi.lo;
- resultHi.lo = resultLo.lo + add;
-
- if (resultHi.lo < resultLo.lo)
- resultLo.hi++;
-
- resultLo.lo = resultHi.lo;
-
- return resultLo;
-}
-
-
-/**************************************************************************
- m 6 4 M u l I
-** Multiplies a pair of INT32s and returns an INT64 result.
-**************************************************************************/
-INT64 m64MulI(INT32 x, INT32 y)
-{
- UNS64 prod;
- int sign = 1;
-
- if (x < 0)
- {
- sign = -sign;
- x = -x;
- }
-
- if (y < 0)
- {
- sign = -sign;
- y = -y;
- }
-
- prod = ficlLongMul(x, y);
- if (sign > 0)
- return m64CastUI(prod);
- else
- return m64Negate(m64CastUI(prod));
-}
-
-
-/**************************************************************************
- m 6 4 N e g a t e
-** Negates an INT64 by complementing and incrementing.
-**************************************************************************/
-INT64 m64Negate(INT64 x)
-{
- x.hi = ~x.hi;
- x.lo = ~x.lo;
- x.lo ++;
- if (x.lo == 0)
- x.hi++;
-
- return x;
-}
-
-
-/**************************************************************************
- m 6 4 P u s h
-** Push an INT64 onto the specified stack in the order required
-** by ANS Forth (most significant cell on top)
-** These should probably be macros...
-**************************************************************************/
-void i64Push(FICL_STACK *pStack, INT64 i64)
-{
- stackPushINT32(pStack, i64.lo);
- stackPushINT32(pStack, i64.hi);
- return;
-}
-
-void u64Push(FICL_STACK *pStack, UNS64 u64)
-{
- stackPushINT32(pStack, u64.lo);
- stackPushINT32(pStack, u64.hi);
- return;
-}
-
-
-/**************************************************************************
- m 6 4 P o p
-** Pops an INT64 off the stack in the order required by ANS Forth
-** (most significant cell on top)
-** These should probably be macros...
-**************************************************************************/
-INT64 i64Pop(FICL_STACK *pStack)
-{
- INT64 ret;
- ret.hi = stackPopINT32(pStack);
- ret.lo = stackPopINT32(pStack);
- return ret;
-}
-
-UNS64 u64Pop(FICL_STACK *pStack)
-{
- UNS64 ret;
- ret.hi = stackPopINT32(pStack);
- ret.lo = stackPopINT32(pStack);
- return ret;
-}
-
-
-/**************************************************************************
- m 6 4 S y m m e t r i c D i v
-** Divide an INT64 by an INT32 and return an INT32 quotient and an INT32
-** remainder. The absolute values of quotient and remainder are not
-** affected by the signs of the numerator and denominator (the operation
-** is symmetric on the number line)
-**************************************************************************/
-INTQR m64SymmetricDivI(INT64 num, INT32 den)
-{
- INTQR qr;
- UNSQR uqr;
- int signRem = 1;
- int signQuot = 1;
-
- if (m64IsNegative(num))
- {
- num = m64Negate(num);
- signRem = -signRem;
- signQuot = -signQuot;
- }
-
- if (den < 0)
- {
- den = -den;
- signQuot = -signQuot;
- }
-
- uqr = ficlLongDiv(m64CastIU(num), (UNS32)den);
- qr = m64CastQRUI(uqr);
- if (signRem < 0)
- qr.rem = -qr.rem;
-
- if (signQuot < 0)
- qr.quot = -qr.quot;
-
- return qr;
-}
-
-
-/**************************************************************************
- m 6 4 U M o d
-** Divides an UNS64 by base (an UNS16) and returns an UNS16 remainder.
-** Writes the quotient back to the original UNS64 as a side effect.
-** This operation is typically used to convert an UNS64 to a text string
-** in any base. See words.c:numberSignS, for example.
-** Mechanics: performs 4 ficlLongDivs, each of which produces 16 bits
-** of the quotient. C does not provide a way to divide an UNS32 by an
-** UNS16 and get an UNS32 quotient (ldiv is closest, but it's signed,
-** unfortunately), so I've used ficlLongDiv.
-**************************************************************************/
-UNS16 m64UMod(UNS64 *pUD, UNS16 base)
-{
- UNS64 ud;
- UNSQR qr;
- UNS64 result;
-
- result.hi = result.lo = 0;
-
- ud.hi = 0;
- ud.lo = pUD->hi >> 16;
- qr = ficlLongDiv(ud, (UNS32)base);
- result.hi = qr.quot << 16;
-
- ud.lo = (qr.rem << 16) | (pUD->hi & 0x0000ffff);
- qr = ficlLongDiv(ud, (UNS32)base);
- result.hi |= qr.quot & 0x0000ffff;
-
- ud.lo = (qr.rem << 16) | (pUD->lo >> 16);
- qr = ficlLongDiv(ud, (UNS32)base);
- result.lo = qr.quot << 16;
-
- ud.lo = (qr.rem << 16) | (pUD->lo & 0x0000ffff);
- qr = ficlLongDiv(ud, (UNS32)base);
- result.lo |= qr.quot & 0x0000ffff;
-
- *pUD = result;
-
- return (UNS16)(qr.rem);
-}
-
-
diff --git a/sys/boot/ficl/math64.h b/sys/boot/ficl/math64.h
deleted file mode 100644
index 2b7df37006bd6..0000000000000
--- a/sys/boot/ficl/math64.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************
-** m a t h 6 4 . h
-** Forth Inspired Command Language - 64 bit math support routines
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 25 January 1998
-**
-*******************************************************************/
-/*
-** N O T I C E -- DISCLAIMER OF WARRANTY
-**
-** Ficl is freeware. Use it in any way that you like, with
-** the understanding that the code is not supported.
-**
-** Any third party may reproduce, distribute, or modify the ficl
-** software code or any derivative works thereof without any
-** compensation or license, provided that the author information
-** and this disclaimer text are retained in the source code files.
-** The ficl software code is provided on an "as is" basis without
-** warranty of any kind, including, without limitation, the implied
-** warranties of merchantability and fitness for a particular purpose
-** and their equivalents under the laws of any jurisdiction.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release (yay!), please
-** send me email at the address above.
-*/
-
-#if !defined (__MATH64_H__)
-#define __MATH64_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-INT64 m64Abs(INT64 x);
-int m64IsNegative(INT64 x);
-UNS64 m64Mac(UNS64 u, UNS32 mul, UNS32 add);
-INT64 m64MulI(INT32 x, INT32 y);
-INT64 m64Negate(INT64 x);
-INTQR m64FlooredDivI(INT64 num, INT32 den);
-void i64Push(FICL_STACK *pStack, INT64 i64);
-INT64 i64Pop(FICL_STACK *pStack);
-void u64Push(FICL_STACK *pStack, UNS64 u64);
-UNS64 u64Pop(FICL_STACK *pStack);
-INTQR m64SymmetricDivI(INT64 num, INT32 den);
-UNS16 m64UMod(UNS64 *pUD, UNS16 base);
-
-#define i64Extend(i64) (i64).hi = ((i64).lo < 0) ? -1L : 0
-#define m64CastIU(i64) (*(UNS64 *)(&(i64)))
-#define m64CastUI(u64) (*(INT64 *)(&(u64)))
-#define m64CastQRIU(iqr) (*(UNSQR *)(&(iqr)))
-#define m64CastQRUI(uqr) (*(INTQR *)(&(uqr)))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/sys/boot/ficl/softwords/classes.fr b/sys/boot/ficl/softwords/classes.fr
deleted file mode 100644
index 75dc35ae0da2b..0000000000000
--- a/sys/boot/ficl/softwords/classes.fr
+++ /dev/null
@@ -1,140 +0,0 @@
-\ ** ficl/softwords/classes.fr
-\ ** F I C L 2 . 0 C L A S S E S
-\ john sadler 1 sep 98
-\ Needs oop.fr
-
-.( loading ficl utility classes ) cr
-also oop definitions
-
-\ REF subclass holds a pointer to an object. It's
-\ mainly for aggregation to help in making data structures.
-\
-object subclass c-ref
- cell: .class
- cell: .instance
-
- : get ( inst class -- refinst refclass )
- drop 2@ ;
- : set ( refinst refclass inst class -- )
- drop 2! ;
-end-class
-
-object subclass c-byte
- char: .payload
-
- : get drop c@ ;
- : set drop c! ;
-end-class
-
-object subclass c-2byte
- 2 chars: .payload
-
- : get drop w@ ;
- : set drop w! ;
-end-class
-
-object subclass c-4byte
- cell: .payload
-
- : get drop @ ;
- : set drop ! ;
-end-class
-
-
-\ ** C - P T R
-\ Base class for pointers to scalars (not objects).
-\ Note: use c-ref to make references to objects. C-ptr
-\ subclasses refer to untyped quantities of various sizes.
-
-\ Derived classes must specify the size of the thing
-\ they point to, and supply get and set methods.
-
-\ All derived classes must define the @size method:
-\ @size ( inst class -- addr-units )
-\ Returns the size in address units of the thing the pointer
-\ refers to.
-object subclass c-ptr
- c-4byte obj: .addr
-
- \ get the value of the pointer
- : get-ptr ( inst class -- addr )
- c-ptr => .addr
- c-4byte => get
- ;
-
- \ set the pointer to address supplied
- : set-ptr ( addr inst class -- )
- c-ptr => .addr
- c-4byte => set
- ;
-
- \ increment the pointer in place
- : inc-ptr ( inst class -- )
- 2dup 2dup ( i c i c i c )
- c-ptr => get-ptr -rot ( i c addr i c )
- --> @size + -rot ( addr' i c )
- c-ptr => set-ptr
- ;
-
- \ decrement the pointer in place
- : dec-ptr ( inst class -- )
- 2dup 2dup ( i c i c i c )
- c-ptr => get-ptr -rot ( i c addr i c )
- --> @size - -rot ( addr' i c )
- c-ptr => set-ptr
- ;
-
- \ index the pointer in place
- : index-ptr ( index inst class -- )
- locals| class inst index |
- inst class c-ptr => get-ptr ( addr )
- inst class --> @size index * + ( addr' )
- inst class c-ptr => set-ptr
- ;
-
-end-class
-
-
-\ ** C - C E L L P T R
-\ Models a pointer to cell (a 32 bit scalar).
-c-ptr subclass c-cellPtr
- : @size 2drop 4 ;
- \ fetch and store through the pointer
- : get ( inst class -- cell )
- c-ptr => get-ptr @
- ;
- : set ( value inst class -- )
- c-ptr => get-ptr !
- ;
-end-class
-
-
-\ ** C - 2 B Y T E P T R
-\ Models a pointer to a 16 bit scalar
-c-ptr subclass c-2bytePtr
- : @size 2drop 2 ;
- \ fetch and store through the pointer
- : get ( inst class -- value )
- c-ptr => get-ptr w@
- ;
- : set ( value inst class -- )
- c-ptr => get-ptr w!
- ;
-end-class
-
-
-\ ** C - B Y T E P T R
-\ Models a pointer to an 8 bit scalar
-c-ptr subclass c-bytePtr
- : @size 2drop 1 ;
- \ fetch and store through the pointer
- : get ( inst class -- value )
- c-ptr => get-ptr c@
- ;
- : set ( value inst class -- )
- c-ptr => get-ptr c!
- ;
-end-class
-
-
-previous definitions
diff --git a/sys/boot/ficl/softwords/jhlocal.fr b/sys/boot/ficl/softwords/jhlocal.fr
deleted file mode 100644
index 034ada5197112..0000000000000
--- a/sys/boot/ficl/softwords/jhlocal.fr
+++ /dev/null
@@ -1,77 +0,0 @@
-\ #if FICL_WANT_LOCALS
-\ ** ficl/softwords/jhlocal.fr
-\ ** stack comment style local syntax...
-\ { a b c | cleared -- d e }
-\ variables before the "|" are initialized in reverse order
-\ from the stack. Those after the "|" are zero initialized.
-\ Anything between "--" and "}" is treated as comment
-\ Uses locals...
-\ locstate: 0 = looking for | or -- or }}
-\ 1 = found |
-\ 2 = found --
-hide
-0 constant zero
-
-: ?-- ( c-addr u -- c-addr u flag )
- 2dup s" --" compare 0= ;
-: ?} ( c-addr u -- c-addr u flag )
- 2dup s" }" compare 0= ;
-: ?| ( c-addr u -- c-addr u flag )
- 2dup s" |" compare 0= ;
-
-: ?delim ( c-addr u -- state | c-addr u 0 )
- ?| if
- 2drop 1
- else
- ?-- if
- 2drop 2
- else
- ?} if 2drop 3 else 0 endif
- endif
- endif
-;
-
-set-current
-
-: {
- 0 dup locals| locstate |
-
- \ stack locals until we hit a delimiter
- begin
- parse-word \ ( nLocals c-addr u )
- ?delim dup to locstate
- 0= while
- rot 1+ \ ( c-addr u ... c-addr u nLocals )
- repeat
-
- \ now unstack the locals
- 0 do (local) loop \ ( )
-
- \ zero locals until -- or }
- locstate 1 = if
- begin
- parse-word
- ?delim dup to locstate
- 0= while
- postpone zero (local)
- repeat
- endif
-
- 0 0 (local)
-
- \ toss words until }
- locstate 2 = if
- begin
- parse-word
- ?delim dup to locstate
- 0= while
- 2drop
- repeat
- endif
-
- locstate 3 <> abort" syntax error in { } local line"
-; immediate compile-only
-
-previous
-\ #endif
-
diff --git a/sys/boot/ficl/softwords/marker.fr b/sys/boot/ficl/softwords/marker.fr
deleted file mode 100644
index c80c2cf3f2cec..0000000000000
--- a/sys/boot/ficl/softwords/marker.fr
+++ /dev/null
@@ -1,25 +0,0 @@
-\ ** ficl/softwords/marker.fr
-\ ** Ficl implementation of CORE EXT MARKER
-\ John Sadler, 4 Oct 98
-\ Requires ficl 2.02 FORGET-WID !!
-
-: marker ( "name" -- )
- create
- get-current ,
- get-order dup ,
- 0 ?do , loop
- does>
- 0 set-order \ clear search order
- dup body> >name drop
- here - allot \ reset HERE to my xt-addr
- dup @ ( pfa current-wid )
- dup set-current forget-wid ( pfa )
- cell+ dup @ swap ( count count-addr )
- over cells + swap ( last-wid-addr count )
- 0 ?do
- dup @ dup ( wid-addr wid wid )
- >search forget-wid ( wid-addr )
- cell-
- loop
- drop
-;
diff --git a/sys/boot/ficl/softwords/oo.fr b/sys/boot/ficl/softwords/oo.fr
deleted file mode 100644
index cd16c77b28b04..0000000000000
--- a/sys/boot/ficl/softwords/oo.fr
+++ /dev/null
@@ -1,464 +0,0 @@
-\ ** ficl/softwords/oo.fr
-\ ** F I C L O - O E X T E N S I O N S
-\ ** john sadler aug 1998
-
-.( loading ficl O-O extensions ) cr
-7 ficl-vocabulary oop
-also oop definitions
-
-\ Design goals:
-\ 0. Traditional OOP: late binding by default for safety.
-\ Early binding if you ask for it.
-\ 1. Single inheritance
-\ 2. Object aggregation (has-a relationship)
-\ 3. Support objects in the dictionary and as proxies for
-\ existing structures (by reference):
-\ *** A ficl object can wrap a C struct ***
-\ 4. Separate name-spaces for methods - methods are
-\ only visible in the context of a class / object
-\ 5. Methods can be overridden, and subclasses can add methods.
-\ No limit on number of methods.
-
-\ General info:
-\ Classes are objects, too: all classes are instances of METACLASS
-\ All classes are derived (by convention) from OBJECT. This
-\ base class provides a default initializer and superclass
-\ access method
-
-\ A ficl object binds instance storage (payload) to a class.
-\ object ( -- instance class )
-\ All objects push their payload address and class address when
-\ executed. All objects have this footprint:
-\ cell 0: first payload cell
-
-\ A ficl class consists of a parent class pointer, a wordlist
-\ ID for the methods of the class, and a size for the payload
-\ of objects created by the class. A class is an object.
-\ The NEW method creates and initializes an instance of a class.
-\ Classes have this footprint:
-\ cell 0: parent class address
-\ cell 1: wordlist ID
-\ cell 2: size of instance's payload
-
-\ Methods expect an object couple ( instance class )
-\ on the stack.
-\ Overridden methods must maintain the same stack signature as
-\ their predecessors. Ficl has no way of enforcing this, though.
-
-user current-class
-0 current-class !
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** L A T E B I N D I N G
-\ Compile the method name, and code to find and
-\ execute it at run-time...
-\ parse-method compiles the method name so that it pushes
-\ the string base address and count at run-time.
-\
-: parse-method \ name run: ( -- c-addr u )
- parse-word
- postpone sliteral
-; compile-only
-
-: lookup-method ( class c-addr u -- class xt )
- 2dup
- local u
- local c-addr
- end-locals
- 2 pick cell+ @ ( -- class c-addr u wid )
- search-wordlist ( -- class 0 | xt 1 | xt -1 )
- 0= if
- c-addr u type ." not found in "
- body> >name type
- cr abort
- endif
-;
-
-: exec-method ( instance class c-addr u -- <method-signature> )
- lookup-method execute
-;
-
-: find-method-xt \ name ( class -- class xt )
- parse-word lookup-method
-;
-
-
-\ Method lookup operator takes a class-addr and instance-addr
-\ and executes the method from the class's wordlist if
-\ interpreting. If compiling, bind late.
-\
-: --> ( instance class -- ??? )
- state @ 0= if
- find-method-xt execute
- else
- parse-method postpone exec-method
- endif
-; immediate
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** E A R L Y B I N D I N G
-\ Early binding operator compiles code to execute a method
-\ given its class at compile time. Classes are immediate,
-\ so they leave their cell-pair on the stack when compiling.
-\ Example:
-\ : get-wid metaclass => .wid @ ;
-\ Usage
-\ my-class get-wid ( -- wid-of-my-class )
-\
-: => \ c:( class meta -- ) run: ( -- ??? ) invokes compiled method
- drop find-method-xt compile, drop
-; immediate compile-only
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** I N S T A N C E V A R I A B L E S
-\ Instance variables (IV) are represented by words in the class's
-\ private wordlist. Each IV word contains the offset
-\ of the IV it represents, and runs code to add that offset
-\ to the base address of an instance when executed.
-\ The metaclass SUB method, defined below, leaves the address
-\ of the new class's offset field and its initial size on the
-\ stack for these words to update. When a class definition is
-\ complete, END-CLASS saves the final size in the class's size
-\ field, and restores the search order and compile wordlist to
-\ prior state. Note that these words are hidden in their own
-\ wordlist to prevent accidental use outside a SUB END-CLASS pair.
-\
-wordlist
-dup constant instance-vars
-dup >search ficl-set-current
-: do-instance-var
- does> ( instance class addr[offset] -- addr[field] )
- nip @ +
-;
-
-: addr-units: ( offset size "name" -- offset' )
- create over , +
- do-instance-var
-;
-
-: chars: \ ( offset nCells "name" -- offset' ) Create n char member.
- chars addr-units: ;
-
-: char: \ ( offset nCells "name" -- offset' ) Create 1 char member.
- 1 chars: ;
-
-: cells: ( offset nCells "name" -- offset' )
- cells >r aligned r> addr-units:
-;
-
-: cell: ( offset nCells "name" -- offset' )
- 1 cells: ;
-
-\ Aggregate an object into the class...
-\ Needs the class of the instance to create
-\ Example: object obj: m_obj
-\
-: do-aggregate
- does> ( instance class pfa -- a-instance a-class )
- 2@ ( inst class a-class a-offset )
- 2swap drop ( a-class a-offset inst )
- + swap ( a-inst a-class )
-;
-
-: obj: ( offset class meta "name" -- offset' )
- locals| meta class offset |
- create offset , class ,
- class meta --> get-size offset +
- do-aggregate
-;
-
-\ Aggregate an array of objects into a class
-\ Usage example:
-\ 3 my-class array: my-array
-\ Makes an instance variable array of 3 instances of my-class
-\ named my-array.
-\
-: array: ( offset n class meta "name" -- offset' )
- locals| meta class nobjs offset |
- create offset , class ,
- class meta --> get-size nobjs * offset +
- do-aggregate
-;
-
-\ Aggregate a pointer to an object: REF is a member variable
-\ whose class is set at compile time. This is useful for wrapping
-\ data structures in C, where there is only a pointer and the type
-\ it refers to is known. If you want polymorphism, see c_ref
-\ in classes.fr. REF is only useful for pre-initialized structures,
-\ since there's no supported way to set one.
-: ref: ( offset class meta "name" -- offset' )
- locals| meta class offset |
- create offset , class ,
- offset cell+
- does> ( inst class pfa -- ptr-inst ptr-class )
- 2@ ( inst class ptr-class ptr-offset )
- 2swap drop + @ swap
-;
-
-\ END-CLASS terminates construction of a class by storing
-\ the size of its instance variables in the class's size field
-\ ( -- old-wid addr[size] 0 )
-\
-: end-class ( old-wid addr[size] size -- )
- swap ! set-current
- search> drop \ pop struct builder wordlist
-;
-
-set-current previous
-\ E N D I N S T A N C E V A R I A B L E S
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ D O - D O - I N S T A N C E
-\ Makes a class method that contains the code for an
-\ instance of the class. This word gets compiled into
-\ the wordlist of every class by the SUB method.
-\ PRECONDITION: current-class contains the class address
-\
-: do-do-instance ( -- )
- s" : .do-instance does> [ current-class @ ] literal ;"
- evaluate
-;
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** M E T A C L A S S
-\ Every class is an instance of metaclass. This lets
-\ classes have methods that are different from those
-\ of their instances.
-\ Classes are IMMEDIATE to make early binding simpler
-\ See above...
-\
-:noname
- wordlist
- create immediate
- 0 , \ NULL parent class
- dup , \ wid
- 3 cells , \ instance size
- ficl-set-current
- does> dup
-; execute metaclass
-
-metaclass drop current-class !
-do-do-instance
-
-\
-\ C L A S S M E T H O D S
-\
-instance-vars >search
-
-create .super ( class metaclass -- parent-class )
- 0 cells , do-instance-var
-
-create .wid ( class metaclass -- wid ) \ return wid of class
- 1 cells , do-instance-var
-
-create .size ( class metaclass -- size ) \ return class's payload size
- 2 cells , do-instance-var
-
-previous
-
-: get-size metaclass => .size @ ;
-: get-wid metaclass => .wid @ ;
-: get-super metaclass => .super @ ;
-
-\ create an uninitialized instance of a class, leaving
-\ the address of the new instance and its class
-\
-: instance ( class metaclass "name" -- instance class )
- locals| meta parent |
- create
- here parent --> .do-instance \ ( inst class )
- parent meta metaclass => get-size
- allot \ allocate payload space
-;
-
-\ create an uninitialized array
-: array ( n class metaclass "name" -- n instance class )
- locals| meta parent nobj |
- create nobj
- here parent --> .do-instance \ ( nobj inst class )
- parent meta metaclass => get-size
- nobj * allot \ allocate payload space
-;
-
-\ create an initialized instance
-\
-: new \ ( class metaclass "name" -- )
- metaclass => instance --> init
-;
-
-\ create an initialized array of instances
-: new-array ( n class metaclass "name" -- )
- metaclass => array
- --> array-init
-;
-
-\ create a proxy object with initialized payload address given
-: ref ( instance-addr class metaclass "name" -- )
- drop create , ,
- does> 2@
-;
-
-\ create a subclass
-: sub ( class metaclass "name" -- old-wid addr[size] size )
- wordlist
- locals| wid meta parent |
- parent meta metaclass => get-wid
- wid wid-set-super
- create immediate
- here current-class ! \ prep for do-do-instance
- parent , \ save parent class
- wid , \ save wid
- here parent meta --> get-size dup , ( addr[size] size )
- metaclass => .do-instance
- wid ficl-set-current -rot
- do-do-instance
- instance-vars >search \ push struct builder wordlist
-;
-
-\ OFFSET-OF returns the offset of an instance variable
-\ from the instance base address. If the next token is not
-\ the name of in instance variable method, you get garbage
-\ results -- there is no way at present to check for this error.
-: offset-of ( class metaclass "name" -- offset )
- drop find-method-xt nip >body @ ;
-
-\ ID returns the string name cell-pair of its class
-: id ( class metaclass -- c-addr u )
- drop body> >name ;
-
-\ list methods of the class
-: methods \ ( class meta -- )
- locals| meta class |
- begin
- class body> >name type ." methods:" cr
- class meta --> get-wid >search words cr previous
- class meta metaclass => get-super
- dup to class
- 0= until cr
-;
-
-\ list class's ancestors
-: pedigree ( class meta -- )
- locals| meta class |
- begin
- class body> >name type space
- class meta metaclass => get-super
- dup to class
- 0= until cr
-;
-
-\ decompile a method
-: see ( class meta -- )
- metaclass => get-wid >search see previous ;
-
-set-current
-\ E N D M E T A C L A S S
-
-\ META is a nickname for the address of METACLASS...
-metaclass drop
-constant meta
-
-\ SUBCLASS is a nickname for a class's SUB method...
-\ Subclass compilation ends when you invoke end-class
-\ This method is late bound for safety...
-: subclass --> sub ;
-
-
-\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-\ ** O B J E C T
-\ Root of all classes
-:noname
- wordlist
- create immediate
- 0 , \ NULL parent class
- dup , \ wid
- 0 , \ instance size
- ficl-set-current
- does> meta
-; execute object
-
-object drop current-class !
-do-do-instance
-
-\ O B J E C T M E T H O D S
-\ Convert instance cell-pair to class cell-pair
-\ Useful for binding class methods from an instance
-: class ( instance class -- class metaclass )
- nip meta ;
-
-\ default INIT method zero fills an instance
-: init ( instance class -- )
- meta
- metaclass => get-size ( inst size )
- erase ;
-
-\ Apply INIT to an array of NOBJ objects...
-\
-: array-init ( nobj inst class -- )
- 0 dup locals| &init &next class inst |
- \
- \ bind methods outside the loop to save time
- \
- class s" init" lookup-method to &init
- s" next" lookup-method to &next
- drop
- 0 ?do
- inst class 2dup
- &init execute
- &next execute drop to inst
- loop
-;
-
-\ Instance aliases for common class methods
-\ Upcast to parent class
-: super ( instance class -- instance parent-class )
- meta metaclass => get-super ;
-
-: pedigree ( instance class -- )
- object => class
- metaclass => pedigree ;
-
-: size ( instance class -- sizeof-instance )
- object => class
- metaclass => get-size ;
-
-: methods ( instance class -- )
- object => class
- metaclass => methods ;
-
-\ Array indexing methods...
-\ Usage examples:
-\ 10 object-array --> index
-\ obj --> next
-\
-: index ( n instance class -- instance[n] class )
- locals| class inst |
- inst class
- object => class
- metaclass => get-size * ( n*size )
- inst + class ;
-
-: next ( instance[n] class -- instance[n+1] class )
- locals| class inst |
- inst class
- object => class
- metaclass => get-size
- inst +
- class ;
-
-: prev ( instance[n] class -- instance[n-1] class )
- locals| class inst |
- inst class
- object => class
- metaclass => get-size
- inst swap -
- class ;
-
-set-current
-\ E N D O B J E C T
-
-
-previous definitions
diff --git a/sys/boot/ficl/softwords/softcore.awk b/sys/boot/ficl/softwords/softcore.awk
deleted file mode 100644
index b182b99508977..0000000000000
--- a/sys/boot/ficl/softwords/softcore.awk
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/awk -f
-# Convert forth source files to a giant C string
-# Joe Abley <jabley@patho.gen.nz>, 12 January 1999
-
-BEGIN \
-{
- printf "/***************************************************************\n";
- printf "** s o f t c o r e . c\n";
- printf "** Forth Inspired Command Language -\n";
- printf "** Words from CORE set written in FICL\n";
- printf "** Author: John Sadler (john_sadler@alum.mit.edu)\n";
- printf "** Created: 27 December 1997\n";
- printf "** Last update: %s\n", strftime();
- printf "***************************************************************/\n";
- printf "\n/*\n";
- printf "** This file contains definitions that are compiled into the\n";
- printf "** system dictionary by the first virtual machine to be created.\n";
- printf "** Created automagically by ficl/softwords/softcore.awk\n";
- printf "*/\n";
- printf "\n#include \"ficl.h\"\n";
- printf "\nstatic char softWords[] =\n";
-
- commenting = 0;
-}
-
-# some general early substitutions
-{
- gsub("\t", " "); # replace each tab with 4 spaces
- gsub("\"", "\\\""); # escape quotes
- gsub("\\\\[[:space:]]+$", ""); # toss empty comments
-}
-
-# strip out empty lines
-/^ *$/ \
-{
- next;
-}
-
-# emit / ** lines as multi-line C comments
-/^\\[[:space:]]\*\*/ && (commenting == 0) \
-{
- sub("^\\\\[[:space:]]", "");
- printf "/*\n%s\n", $0;
- commenting = 1;
- next;
-}
-
-/^\\[[:space:]]\*\*/ \
-{
- sub("^\\\\[[:space:]]", "");
- printf "%s\n", $0;
- next;
-}
-
-# function to close a comment, used later
-function end_comments()
-{
- commenting = 0;
- printf "*/\n";
-}
-
-# pass commented preprocessor directives
-/^\\[[:space:]]#/ \
-{
- if (commenting) end_comments();
- sub("^\\\\[[:space:]]", "");
- printf "%s\n", $0;
- next;
-}
-
-# toss all other full-line comments
-/^\\/ \
-{
- if (commenting) end_comments();
- next;
-}
-
-# emit all other lines as quoted string fragments
-{
- if (commenting) end_comments();
-
- sub("\\\\[[:space:]]+.*$", ""); # lop off trailing \ comments
- sub("[[:space:]]+$", ""); # remove trailing spaces
- printf " \"%s \\n\"\n", $0;
- next;
-}
-
-END \
-{
- if (commenting) end_comments();
- printf " \"quit \";\n";
- printf "\n\nvoid ficlCompileSoftCore(FICL_VM *pVM)\n";
- printf "{\n";
- printf " assert(ficlExec(pVM, softWords) != VM_ERREXIT);\n";
- printf "}\n";
-}
diff --git a/sys/boot/ficl/softwords/softcore.fr b/sys/boot/ficl/softwords/softcore.fr
deleted file mode 100644
index bcc2696b6efd0..0000000000000
--- a/sys/boot/ficl/softwords/softcore.fr
+++ /dev/null
@@ -1,125 +0,0 @@
-\ ** ficl/softwords/softcore.fr
-\ ** FICL soft extensions
-\ ** John Sadler (john_sadler@alum.mit.edu)
-\ ** September, 1998
-
-\ ** Ficl USER variables
-\ ** See words.c for primitive def'n of USER
-\ #if FICL_WANT_USER
-
-variable nUser 0 nUser !
-: user \ name ( -- )
- nUser dup @ user 1 swap +! ;
-
-\ #endif
-
-\ ** ficl extras
-\ EMPTY cleans the parameter stack
-: empty ( xn..x1 -- ) depth 0 ?do drop loop ;
-\ CELL- undoes CELL+
-: cell- ( addr -- addr ) [ 1 cells ] literal - ;
-: -rot ( a b c -- c a b ) 2 -roll ;
-
-\ ** CORE
-: abs ( x -- x )
- dup 0< if negate endif ;
-decimal 32 constant bl
-
-: space ( -- ) bl emit ;
-
-: spaces ( n -- ) 0 ?do space loop ;
-
-: abort"
- postpone if
- postpone ."
- postpone cr
- postpone abort
- postpone endif
-; immediate
-
-
-\ ** CORE EXT
-0 constant false
--1 constant true
-: <> = invert ;
-: 0<> 0= invert ;
-: compile, , ;
-: erase ( addr u -- ) 0 fill ;
-: nip ( y x -- x ) swap drop ;
-: tuck ( y x -- x y x) swap over ;
-
-\ ** LOCAL EXT word set
-\ #if FICL_WANT_LOCALS
-: locals| ( name...name | -- )
- begin
- bl word count
- dup 0= abort" where's the delimiter??"
- over c@
- [char] | - over 1- or
- while
- (local)
- repeat 2drop 0 0 (local)
-; immediate
-
-: local ( name -- ) bl word count (local) ; immediate
-
-: end-locals ( -- ) 0 0 (local) ; immediate
-
-\ #endif
-
-\ ** TOOLS word set...
-: ? ( addr -- ) @ . ;
-: dump ( addr u -- )
- 0 ?do
- dup c@ . 1+
- i 7 and 7 = if cr endif
- loop drop
-;
-
-\ ** SEARCH+EXT words and ficl helpers
-\
-: wordlist ( -- )
- 1 ficl-wordlist ;
-
-\ DO_VOCABULARY handles the DOES> part of a VOCABULARY
-\ When executed, new voc replaces top of search stack
-: do-vocabulary ( -- )
- does> @ search> drop >search ;
-
-: vocabulary ( name -- )
- wordlist create , do-vocabulary ;
-
-: ficl-vocabulary ( nBuckets name -- )
- ficl-wordlist create , do-vocabulary ;
-
-\ ALSO dups the search stack...
-: also ( -- )
- search> dup >search >search ;
-
-\ FORTH drops the top of the search stack and pushes FORTH-WORDLIST
-: forth ( -- )
- search> drop
- forth-wordlist >search ;
-
-\ ONLY sets the search order to a default state
-: only ( -- )
- -1 set-order ;
-
-\ ORDER displays the compile wid and the search order list
-: order ( -- )
- ." Search: "
- get-order 0 ?do x. loop cr
- ." Compile: " get-current x. cr ;
-
-\ PREVIOUS drops the search order stack
-: previous ( -- ) search> drop ;
-
-\ FICL-SET-CURRENT sets the compile wordlist and pushes the previous value
-: ficl-set-current ( wid -- old-wid )
- get-current swap set-current ;
-
-wordlist constant hidden
-: hide hidden dup >search ficl-set-current ;
-
-\ ** E N D S O F T C O R E . F R
-
diff --git a/sys/boot/ficl/stack.c b/sys/boot/ficl/stack.c
deleted file mode 100644
index aee9f8f5ff565..0000000000000
--- a/sys/boot/ficl/stack.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************
-** s t a c k . c
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-**
-*******************************************************************/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#else
-#include <stand.h>
-#endif
-#include "ficl.h"
-
-#define STKDEPTH(s) ((s)->sp - (s)->base)
-
-/*
-** N O T E: Stack convention:
-**
-** sp points to the first available cell
-** push: store value at sp, increment sp
-** pop: decrement sp, fetch value at sp
-** Stack grows from low to high memory
-*/
-
-/*******************************************************************
- v m C h e c k S t a c k
-** Check the parameter stack for underflow or overflow.
-** nCells controls the type of check: if nCells is zero,
-** the function checks the stack state for underflow and overflow.
-** If nCells > 0, checks to see that the stack has room to push
-** that many cells. If less than zero, checks to see that the
-** stack has room to pop that many cells. If any test fails,
-** the function throws (via vmThrow) a VM_ERREXIT exception.
-*******************************************************************/
-void vmCheckStack(FICL_VM *pVM, int popCells, int pushCells)
-{
- FICL_STACK *pStack = pVM->pStack;
- int nFree = pStack->base + pStack->nCells - pStack->sp;
-
- if (popCells > STKDEPTH(pStack))
- {
- vmThrowErr(pVM, "Error: stack underflow");
- }
-
- if (nFree < pushCells - popCells)
- {
- vmThrowErr(pVM, "Error: stack overflow");
- }
-
- return;
-}
-
-/*******************************************************************
- s t a c k C r e a t e
-**
-*******************************************************************/
-
-FICL_STACK *stackCreate(unsigned nCells)
-{
- size_t size = sizeof (FICL_STACK) + nCells * sizeof (CELL);
- FICL_STACK *pStack = ficlMalloc(size);
-
-#if FICL_ROBUST
- assert (nCells != 0);
- assert (pStack != NULL);
-#endif
-
- pStack->nCells = nCells;
- pStack->sp = pStack->base;
- pStack->pFrame = NULL;
- return pStack;
-}
-
-
-/*******************************************************************
- s t a c k D e l e t e
-**
-*******************************************************************/
-
-void stackDelete(FICL_STACK *pStack)
-{
- if (pStack)
- ficlFree(pStack);
- return;
-}
-
-
-/*******************************************************************
- s t a c k D e p t h
-**
-*******************************************************************/
-
-int stackDepth(FICL_STACK *pStack)
-{
- return STKDEPTH(pStack);
-}
-
-/*******************************************************************
- s t a c k D r o p
-**
-*******************************************************************/
-
-void stackDrop(FICL_STACK *pStack, int n)
-{
-#if FICL_ROBUST
- assert(n > 0);
-#endif
- pStack->sp -= n;
- return;
-}
-
-
-/*******************************************************************
- s t a c k F e t c h
-**
-*******************************************************************/
-
-CELL stackFetch(FICL_STACK *pStack, int n)
-{
- return pStack->sp[-n-1];
-}
-
-void stackStore(FICL_STACK *pStack, int n, CELL c)
-{
- pStack->sp[-n-1] = c;
- return;
-}
-
-
-/*******************************************************************
- s t a c k G e t T o p
-**
-*******************************************************************/
-
-CELL stackGetTop(FICL_STACK *pStack)
-{
- return pStack->sp[-1];
-}
-
-
-/*******************************************************************
- s t a c k L i n k
-** Link a frame using the stack's frame pointer. Allot space for
-** nCells cells in the frame
-** 1) Push pFrame
-** 2) pFrame = sp
-** 3) sp += nCells
-*******************************************************************/
-
-void stackLink(FICL_STACK *pStack, int nCells)
-{
- stackPushPtr(pStack, pStack->pFrame);
- pStack->pFrame = pStack->sp;
- pStack->sp += nCells;
- return;
-}
-
-
-/*******************************************************************
- s t a c k U n l i n k
-** Unink a stack frame previously created by stackLink
-** 1) sp = pFrame
-** 2) pFrame = pop()
-*******************************************************************/
-
-void stackUnlink(FICL_STACK *pStack)
-{
- pStack->sp = pStack->pFrame;
- pStack->pFrame = stackPopPtr(pStack);
- return;
-}
-
-
-/*******************************************************************
- s t a c k P i c k
-**
-*******************************************************************/
-
-void stackPick(FICL_STACK *pStack, int n)
-{
- stackPush(pStack, stackFetch(pStack, n));
- return;
-}
-
-
-/*******************************************************************
- s t a c k P o p
-**
-*******************************************************************/
-
-CELL stackPop(FICL_STACK *pStack)
-{
- return *--pStack->sp;
-}
-
-void *stackPopPtr(FICL_STACK *pStack)
-{
- return (*--pStack->sp).p;
-}
-
-UNS32 stackPopUNS32(FICL_STACK *pStack)
-{
- return (*--pStack->sp).u;
-}
-
-INT32 stackPopINT32(FICL_STACK *pStack)
-{
- return (*--pStack->sp).i;
-}
-
-
-/*******************************************************************
- s t a c k P u s h
-**
-*******************************************************************/
-
-void stackPush(FICL_STACK *pStack, CELL c)
-{
- *pStack->sp++ = c;
-}
-
-void stackPushPtr(FICL_STACK *pStack, void *ptr)
-{
- *pStack->sp++ = LVALUEtoCELL(ptr);
-}
-
-void stackPushUNS32(FICL_STACK *pStack, UNS32 u)
-{
- *pStack->sp++ = LVALUEtoCELL(u);
-}
-
-void stackPushINT32(FICL_STACK *pStack, INT32 i)
-{
- *pStack->sp++ = LVALUEtoCELL(i);
-}
-
-/*******************************************************************
- s t a c k R e s e t
-**
-*******************************************************************/
-
-void stackReset(FICL_STACK *pStack)
-{
- pStack->sp = pStack->base;
- return;
-}
-
-
-/*******************************************************************
- s t a c k R o l l
-** Roll nth stack entry to the top (counting from zero), if n is
-** >= 0. Drop other entries as needed to fill the hole.
-** If n < 0, roll top-of-stack to nth entry, pushing others
-** upward as needed to fill the hole.
-*******************************************************************/
-
-void stackRoll(FICL_STACK *pStack, int n)
-{
- CELL c;
- CELL *pCell;
-
- if (n == 0)
- return;
- else if (n > 0)
- {
- pCell = pStack->sp - n - 1;
- c = *pCell;
-
- for (;n > 0; --n, pCell++)
- {
- *pCell = pCell[1];
- }
-
- *pCell = c;
- }
- else
- {
- pCell = pStack->sp - 1;
- c = *pCell;
-
- for (; n < 0; ++n, pCell--)
- {
- *pCell = pCell[-1];
- }
-
- *pCell = c;
- }
- return;
-}
-
-
-/*******************************************************************
- s t a c k S e t T o p
-**
-*******************************************************************/
-
-void stackSetTop(FICL_STACK *pStack, CELL c)
-{
- pStack->sp[-1] = c;
- return;
-}
-
-
diff --git a/sys/boot/ficl/sysdep.c b/sys/boot/ficl/sysdep.c
deleted file mode 100644
index 84a704dabdd84..0000000000000
--- a/sys/boot/ficl/sysdep.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************
-** s y s d e p . c
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-** Implementations of FICL external interface functions...
-**
-*******************************************************************/
-
-#ifdef TESTMAIN
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include <stand.h>
-#ifdef __i386__
-#include <machine/cpufunc.h>
-#endif
-#endif
-#include "ficl.h"
-
-/*
-******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
-*/
-
-UNS64 ficlLongMul(UNS32 x, UNS32 y)
-{
- UNS64 q;
- u_int64_t qx;
-
- qx = (u_int64_t)x * (u_int64_t) y;
-
- q.hi = (u_int32_t)( qx >> 32 );
- q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
-
- return q;
-}
-
-UNSQR ficlLongDiv(UNS64 q, UNS32 y)
-{
- UNSQR result;
- u_int64_t qx, qh;
-
- qh = q.hi;
- qx = (qh << 32) | q.lo;
-
- result.quot = qx / y;
- result.rem = qx % y;
-
- return result;
-}
-
-void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
-{
- IGNORE(pVM);
-
- while(*msg != 0)
- putchar(*(msg++));
- if (fNewline)
- putchar('\n');
-
- return;
-}
-
-void *ficlMalloc (size_t size)
-{
- return malloc(size);
-}
-
-void ficlFree (void *p)
-{
- free(p);
-}
-
-#ifdef __i386__
-/*
- * outb ( port# c -- )
- * Store a byte to I/O port number port#
- */
-void
-ficlOutb(FICL_VM *pVM)
-{
- u_char c;
- u_int32_t port;
-
- port=stackPopUNS32(pVM->pStack);
- c=(u_char)stackPopINT32(pVM->pStack);
- outb(port,c);
-}
-
-/*
- * inb ( port# -- c )
- * Fetch a byte from I/O port number port#
- */
-void
-ficlInb(FICL_VM *pVM)
-{
- u_char c;
- u_int32_t port;
-
- port=stackPopUNS32(pVM->pStack);
- c=inb(port);
- stackPushINT32(pVM->pStack,c);
-}
-#endif
-
-/*
-** Stub function for dictionary access control - does nothing
-** by default, user can redefine to guarantee exclusive dict
-** access to a single thread for updates. All dict update code
-** is guaranteed to be bracketed as follows:
-** ficlLockDictionary(TRUE);
-** <code that updates dictionary>
-** ficlLockDictionary(FALSE);
-**
-** Returns zero if successful, nonzero if unable to acquire lock
-** befor timeout (optional - could also block forever)
-*/
-#if FICL_MULTITHREAD
-int ficlLockDictionary(short fLock)
-{
- IGNORE(fLock);
- return 0;
-}
-#endif /* FICL_MULTITHREAD */
-
-
diff --git a/sys/boot/ficl/sysdep.h b/sys/boot/ficl/sysdep.h
deleted file mode 100644
index 4095701cad2a4..0000000000000
--- a/sys/boot/ficl/sysdep.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************
- s y s d e p . h
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-** Ficl system dependent types and prototypes...
-**
-** Note: Ficl also depends on the use of "assert" when
-** FICL_ROBUST is enabled. This may require some consideration
-** in firmware systems since assert often
-** assumes stderr/stdout.
-**
-*******************************************************************/
-/*
-** N O T I C E -- DISCLAIMER OF WARRANTY
-**
-** Ficl is freeware. Use it in any way that you like, with
-** the understanding that the code is not supported.
-**
-** Any third party may reproduce, distribute, or modify the ficl
-** software code or any derivative works thereof without any
-** compensation or license, provided that the author information
-** and this disclaimer text are retained in the source code files.
-** The ficl software code is provided on an "as is" basis without
-** warranty of any kind, including, without limitation, the implied
-** warranties of merchantability and fitness for a particular purpose
-** and their equivalents under the laws of any jurisdiction.
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release (yay!), please
-** send me email at the address above.
-*/
-
-#if !defined (__SYSDEP_H__)
-#define __SYSDEP_H__
-
-#include <sys/types.h>
-
-#include <stddef.h> /* size_t, NULL */
-#include <setjmp.h>
-
-#include <assert.h>
-
-#if !defined IGNORE /* Macro to silence unused param warnings */
-#define IGNORE(x) &x
-#endif
-
-
-/*
-** TRUE and FALSE for C boolean operations, and
-** portable 32 bit types for CELLs
-**
-*/
-#if !defined TRUE
-#define TRUE 1
-#endif
-#if !defined FALSE
-#define FALSE 0
-#endif
-
-
-#if !defined INT32
-#define INT32 int32_t
-#endif
-
-#if !defined UNS32
-#define UNS32 u_int32_t
-#endif
-
-#if !defined UNS16
-#define UNS16 u_int16_t
-#endif
-
-#if !defined UNS8
-#define UNS8 u_int8_t
-#endif
-
-#if !defined NULL
-#define NULL ((void *)0)
-#endif
-
-typedef struct
-{
- UNS32 hi;
- UNS32 lo;
-} UNS64;
-
-typedef struct
-{
- UNS32 quot;
- UNS32 rem;
-} UNSQR;
-
-typedef struct
-{
- INT32 hi;
- INT32 lo;
-} INT64;
-
-typedef struct
-{
- INT32 quot;
- INT32 rem;
-} INTQR;
-
-
-/*
-** Build controls
-** FICL_MULTITHREAD enables dictionary mutual exclusion
-** wia the ficlLockDictionary system dependent function.
-*/
-#if !defined FICL_MULTITHREAD
-#define FICL_MULTITHREAD 0
-#endif
-
-/*
-** FICL_ROBUST enables bounds checking of stacks and the dictionary.
-** This will detect stack over and underflows and dictionary overflows.
-** Any exceptional condition will result in an assertion failure.
-** (As generated by the ANSI assert macro)
-** FICL_ROBUST == 1 --> stack checking in the outer interpreter
-** FICL_ROBUST == 2 also enables checking in many primitives
-*/
-
-#if !defined FICL_ROBUST
-#define FICL_ROBUST 2
-#endif
-
-/*
-** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of
-** a new virtual machine's stacks, unless overridden at
-** create time.
-*/
-#if !defined FICL_DEFAULT_STACK
-#define FICL_DEFAULT_STACK 128
-#endif
-
-/*
-** FICL_DEFAULT_DICT specifies the number of CELLs to allocate
-** for the system dictionary by default. The value
-** can be overridden at startup time as well.
-** FICL_DEFAULT_ENV specifies the number of cells to allot
-** for the environment-query dictionary.
-*/
-#if !defined FICL_DEFAULT_DICT
-#define FICL_DEFAULT_DICT 12288
-#endif
-
-#if !defined FICL_DEFAULT_ENV
-#define FICL_DEFAULT_ENV 260
-#endif
-
-/*
-** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in
-** the dictionary search order. See Forth DPANS sec 16.3.3
-** (file://dpans16.htm#16.3.3)
-*/
-#if !defined FICL_DEFAULT_VOCS
-#define FICL_DEFAULT_VOCS 16
-#endif
-
-/*
-** User variables: per-instance variables bound to the VM.
-** Kinda like thread-local storage. Could be implemented in a
-** VM private dictionary, but I've chosen the lower overhead
-** approach of an array of CELLs instead.
-*/
-#if !defined FICL_WANT_USER
-#define FICL_WANT_USER 1
-#endif
-
-#if !defined FICL_USER_CELLS
-#define FICL_USER_CELLS 16
-#endif
-
-/*
-** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and
-** a private dictionary for local variable compilation.
-*/
-#if !defined FICL_WANT_LOCALS
-#define FICL_WANT_LOCALS 1
-#endif
-
-/* Max number of local variables per definition */
-#if !defined FICL_MAX_LOCALS
-#define FICL_MAX_LOCALS 16
-#endif
-
-/*
-** FICL_ALIGN is the power of two to which the dictionary
-** pointer address must be aligned. This value is usually
-** either 1 or 2, depending on the memory architecture
-** of the target system; 2 is safe on any 16 or 32 bit
-** machine.
-*/
-#if !defined FICL_ALIGN
-#define FICL_ALIGN 2
-#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
-#endif
-
-/*
-** System dependent routines --
-** edit the implementations in sysdep.c to be compatible
-** with your runtime environment...
-** ficlTextOut sends a NULL terminated string to the
-** default output device - used for system error messages
-** ficlMalloc and ficlFree have the same semantics as malloc and free
-** in standard C
-** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned
-** product
-** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient
-** and remainder
-*/
-struct vm;
-void ficlTextOut(struct vm *pVM, char *msg, int fNewline);
-void *ficlMalloc (size_t size);
-void ficlFree (void *p);
-
-/*
-** Stub function for dictionary access control - does nothing
-** by default, user can redefine to guarantee exclusive dict
-** access to a single thread for updates. All dict update code
-** must be bracketed as follows:
-** ficlLockDictionary(TRUE);
-** <code that updates dictionary>
-** ficlLockDictionary(FALSE);
-**
-** Returns zero if successful, nonzero if unable to acquire lock
-** before timeout (optional - could also block forever)
-**
-** NOTE: this function must be implemented with lock counting
-** semantics: nested calls must behave properly.
-*/
-#if FICL_MULTITHREAD
-int ficlLockDictionary(short fLock);
-#else
-#define ficlLockDictionary(x) 0 /* ignore */
-#endif
-
-/*
-** 64 bit integer math support routines: multiply two UNS32s
-** to get a 64 bit prodict, & divide the product by an UNS32
-** to get an UNS32 quotient and remainder. Much easier in asm
-** on a 32 bit CPU than in C, which usually doesn't support
-** the double length result (but it should).
-*/
-UNS64 ficlLongMul(UNS32 x, UNS32 y);
-UNSQR ficlLongDiv(UNS64 q, UNS32 y);
-
-#endif /*__SYSDEP_H__*/
diff --git a/sys/boot/ficl/testmain.c b/sys/boot/ficl/testmain.c
deleted file mode 100644
index f7cdc4440a833..0000000000000
--- a/sys/boot/ficl/testmain.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
-** stub main for testing FICL
-**
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "ficl.h"
-
-/*
-** Ficl interface to getcwd
-** Prints the current working directory using the VM's
-** textOut method...
-*/
-static void ficlGetCWD(FICL_VM *pVM)
-{
- char *cp;
-
- cp = getcwd(NULL, 80);
- vmTextOut(pVM, cp, 1);
- free(cp);
- return;
-}
-
-/*
-** Ficl interface to chdir
-** Gets a newline (or NULL) delimited string from the input
-** and feeds it to chdir()
-** Example:
-** cd c:\tmp
-*/
-static void ficlChDir(FICL_VM *pVM)
-{
- FICL_STRING *pFS = (FICL_STRING *)pVM->pad;
- vmGetString(pVM, pFS, '\n');
- if (pFS->count > 0)
- {
- int err = chdir(pFS->text);
- if (err)
- {
- vmTextOut(pVM, "Error: path not found", 1);
- vmThrow(pVM, VM_QUIT);
- }
- }
- else
- {
- vmTextOut(pVM, "Warning (chdir): nothing happened", 1);
- }
- return;
-}
-
-/*
-** Ficl interface to system (ANSI)
-** Gets a newline (or NULL) delimited string from the input
-** and feeds it to system()
-** Example:
-** system del *.*
-** \ ouch!
-*/
-static void ficlSystem(FICL_VM *pVM)
-{
- FICL_STRING *pFS = (FICL_STRING *)pVM->pad;
-
- vmGetString(pVM, pFS, '\n');
- if (pFS->count > 0)
- {
- int err = system(pFS->text);
- if (err)
- {
- sprintf(pVM->pad, "System call returned %d", err);
- vmTextOut(pVM, pVM->pad, 1);
- vmThrow(pVM, VM_QUIT);
- }
- }
- else
- {
- vmTextOut(pVM, "Warning (system): nothing happened", 1);
- }
- return;
-}
-
-/*
-** Ficl add-in to load a text file and execute it...
-** Cheesy, but illustrative.
-** Line oriented... filename is newline (or NULL) delimited.
-** Example:
-** load test.ficl
-*/
-#define nLINEBUF 256
-static void ficlLoad(FICL_VM *pVM)
-{
- char cp[nLINEBUF];
- char filename[nLINEBUF];
- FICL_STRING *pFilename = (FICL_STRING *)filename;
- int nLine = 0;
- FILE *fp;
- int result;
- CELL id;
- struct stat buf;
-
-
- vmGetString(pVM, pFilename, '\n');
-
- if (pFilename->count <= 0)
- {
- vmTextOut(pVM, "Warning (load): nothing happened", 1);
- return;
- }
-
- /*
- ** get the file's size and make sure it exists
- */
- result = stat( pFilename->text, &buf );
-
- if (result != 0)
- {
- vmTextOut(pVM, "Unable to stat file: ", 0);
- vmTextOut(pVM, pFilename->text, 1);
- vmThrow(pVM, VM_QUIT);
- }
-
- fp = fopen(pFilename->text, "r");
- if (!fp)
- {
- vmTextOut(pVM, "Unable to open file ", 0);
- vmTextOut(pVM, pFilename->text, 1);
- vmThrow(pVM, VM_QUIT);
- }
-
- id = pVM->sourceID;
- pVM->sourceID.p = (void *)fp;
-
- /* feed each line to ficlExec */
- while (fgets(cp, nLINEBUF, fp))
- {
- int len = strlen(cp) - 1;
-
- nLine++;
- if (len <= 0)
- continue;
-
- if (cp[len] == '\n')
- cp[len] = '\0';
-
- result = ficlExec(pVM, cp);
- if (result >= VM_ERREXIT)
- {
- pVM->sourceID = id;
- fclose(fp);
- vmThrowErr(pVM, "Error loading file <%s> line %d", pFilename->text, nLine);
- break;
- }
- }
- /*
- ** Pass an empty line with SOURCE-ID == 0 to flush
- ** any pending REFILLs (as required by FILE wordset)
- */
- pVM->sourceID.i = -1;
- ficlExec(pVM, "");
-
- pVM->sourceID = id;
- fclose(fp);
-
- return;
-}
-
-/*
-** Dump a tab delimited file that summarizes the contents of the
-** dictionary hash table by hashcode...
-*/
-static void spewHash(FICL_VM *pVM)
-{
- FICL_HASH *pHash = ficlGetDict()->pForthWords;
- FICL_WORD *pFW;
- FILE *pOut;
- unsigned i;
- unsigned nHash = pHash->size;
-
- if (!vmGetWordToPad(pVM))
- vmThrow(pVM, VM_OUTOFTEXT);
-
- pOut = fopen(pVM->pad, "w");
- if (!pOut)
- {
- vmTextOut(pVM, "unable to open file", 1);
- return;
- }
-
- for (i=0; i < nHash; i++)
- {
- int n = 0;
-
- pFW = pHash->table[i];
- while (pFW)
- {
- n++;
- pFW = pFW->link;
- }
-
- fprintf(pOut, "%d\t%d", i, n);
-
- pFW = pHash->table[i];
- while (pFW)
- {
- fprintf(pOut, "\t%s", pFW->name);
- pFW = pFW->link;
- }
-
- fprintf(pOut, "\n");
- }
-
- fclose(pOut);
- return;
-}
-
-static void ficlBreak(FICL_VM *pVM)
-{
- pVM->state = pVM->state;
- return;
-}
-
-void buildTestInterface(void)
-{
- ficlBuild("break", ficlBreak, FW_DEFAULT);
- ficlBuild("cd", ficlChDir, FW_DEFAULT);
- ficlBuild("load", ficlLoad, FW_DEFAULT);
- ficlBuild("pwd", ficlGetCWD, FW_DEFAULT);
- ficlBuild("system", ficlSystem, FW_DEFAULT);
- ficlBuild("spewhash", spewHash, FW_DEFAULT);
-
- return;
-}
-
-
-int main(int argc, char **argv)
-{
- char in[256];
- FICL_VM *pVM;
-
- ficlInitSystem(10000);
- buildTestInterface();
- pVM = ficlNewVM();
-
- ficlExec(pVM, ".ver .( " __DATE__ " ) cr quit");
-
- /*
- ** load file from cmd line...
- */
- if (argc > 1)
- {
- sprintf(in, ".( loading %s ) cr load %s\n cr", argv[1], argv[1]);
- ficlExec(pVM, in);
- }
-
- for (;;)
- {
- int ret;
- if (fgets(in, sizeof(in) - 1, stdin) == NULL)
- break;
- ret = ficlExec(pVM, in);
- if (ret == VM_USEREXIT)
- {
- ficlTermSystem();
- break;
- }
- }
-
- return 0;
-}
-
diff --git a/sys/boot/ficl/vm.c b/sys/boot/ficl/vm.c
deleted file mode 100644
index 6852c62bd663c..0000000000000
--- a/sys/boot/ficl/vm.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/*******************************************************************
-** v m . c
-** Forth Inspired Command Language - virtual machine methods
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-/*
-** This file implements the virtual machine of FICL. Each virtual
-** machine retains the state of an interpreter. A virtual machine
-** owns a pair of stacks for parameters and return addresses, as
-** well as a pile of state variables and the two dedicated registers
-** of the interp.
-*/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#else
-#include <stand.h>
-#endif
-#include <stdarg.h>
-#include <string.h>
-#include "ficl.h"
-
-static char digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
-
-/**************************************************************************
- v m B r a n c h R e l a t i v e
-**
-**************************************************************************/
-void vmBranchRelative(FICL_VM *pVM, int offset)
-{
- pVM->ip += offset;
- return;
-}
-
-
-/**************************************************************************
- v m C r e a t e
-**
-**************************************************************************/
-FICL_VM *vmCreate(FICL_VM *pVM, unsigned nPStack, unsigned nRStack)
-{
- if (pVM == NULL)
- {
- pVM = (FICL_VM *)ficlMalloc(sizeof (FICL_VM));
- pVM->pStack = NULL;
- pVM->rStack = NULL;
- pVM->link = NULL;
- }
- assert (pVM);
-
- if (pVM->pStack)
- stackDelete(pVM->pStack);
- pVM->pStack = stackCreate(nPStack);
-
- if (pVM->rStack)
- stackDelete(pVM->rStack);
- pVM->rStack = stackCreate(nRStack);
-
- pVM->textOut = ficlTextOut;
-
- vmReset(pVM);
- return pVM;
-}
-
-
-/**************************************************************************
- v m D e l e t e
-**
-**************************************************************************/
-void vmDelete (FICL_VM *pVM)
-{
- if (pVM)
- {
- ficlFree(pVM->pStack);
- ficlFree(pVM->rStack);
- ficlFree(pVM);
- }
-
- return;
-}
-
-
-/**************************************************************************
- v m E x e c u t e
-**
-**************************************************************************/
-void vmExecute(FICL_VM *pVM, FICL_WORD *pWord)
-{
- pVM->runningWord = pWord;
- pWord->code(pVM);
- return;
-}
-
-
-/**************************************************************************
- v m G e t S t r i n g
-** Parses a string out of the VM input buffer and copies up to the first
-** FICL_STRING_MAX characters to the supplied destination buffer, a
-** FICL_STRING. The destination string is NULL terminated.
-**
-** Returns the address of the first unused character in the dest buffer.
-**************************************************************************/
-char *vmGetString(FICL_VM *pVM, FICL_STRING *spDest, char delimiter)
-{
- STRINGINFO si = vmParseString(pVM, delimiter);
-
- if (SI_COUNT(si) > FICL_STRING_MAX)
- {
- SI_SETLEN(si, FICL_STRING_MAX);
- }
-
- strncpy(spDest->text, SI_PTR(si), SI_COUNT(si));
- spDest->text[SI_COUNT(si)] = '\0';
- spDest->count = (FICL_COUNT)SI_COUNT(si);
-
- return spDest->text + SI_COUNT(si) + 1;
-}
-
-
-/**************************************************************************
- v m G e t W o r d
-** vmGetWord calls vmGetWord0 repeatedly until it gets a string with
-** non-zero length.
-**************************************************************************/
-STRINGINFO vmGetWord(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord0(pVM);
-
- if (SI_COUNT(si) == 0)
- {
- vmThrow(pVM, VM_RESTART);
- }
-
- return si;
-}
-
-
-/**************************************************************************
- v m G e t W o r d 0
-** Skip leading whitespace and parse a space delimited word from the tib.
-** Returns the start address and length of the word. Updates the tib
-** to reflect characters consumed, including the trailing delimiter.
-** If there's nothing of interest in the tib, returns zero. This function
-** does not use vmParseString because it uses isspace() rather than a
-** single delimiter character.
-**************************************************************************/
-STRINGINFO vmGetWord0(FICL_VM *pVM)
-{
- char *pSrc = vmGetInBuf(pVM);
- STRINGINFO si;
- UNS32 count = 0;
- char ch;
-
- pSrc = skipSpace(pSrc);
- SI_SETPTR(si, pSrc);
-
- for (ch = *pSrc; ch != '\0' && !isspace(ch); ch = *++pSrc)
- {
- count++;
- }
-
- SI_SETLEN(si, count);
-
- if (isspace(ch)) /* skip one trailing delimiter */
- pSrc++;
-
- vmUpdateTib(pVM, pSrc);
-
- return si;
-}
-
-
-/**************************************************************************
- v m G e t W o r d T o P a d
-** Does vmGetWord0 and copies the result to the pad as a NULL terminated
-** string. Returns the length of the string. If the string is too long
-** to fit in the pad, it is truncated.
-**************************************************************************/
-int vmGetWordToPad(FICL_VM *pVM)
-{
- STRINGINFO si;
- char *cp = (char *)pVM->pad;
- si = vmGetWord0(pVM);
-
- if (SI_COUNT(si) > nPAD)
- SI_SETLEN(si, nPAD);
-
- strncpy(cp, SI_PTR(si), SI_COUNT(si));
- cp[SI_COUNT(si)] = '\0';
- return (int)(SI_COUNT(si));
-}
-
-
-/**************************************************************************
- v m P a r s e S t r i n g
-** Parses a string out of the input buffer using the delimiter
-** specified. Skips leading delimiters, marks the start of the string,
-** and counts characters to the next delimiter it encounters. It then
-** updates the vm input buffer to consume all these chars, including the
-** trailing delimiter.
-** Returns the address and length of the parsed string, not including the
-** trailing delimiter.
-**************************************************************************/
-STRINGINFO vmParseString(FICL_VM *pVM, char delim)
-{
- STRINGINFO si;
- char *pSrc = vmGetInBuf(pVM);
- char ch;
-
- while (*pSrc == delim) /* skip lead delimiters */
- pSrc++;
-
- SI_SETPTR(si, pSrc); /* mark start of text */
-
- for (ch = *pSrc; (ch != delim)
- && (ch != '\0')
- && (ch != '\r')
- && (ch != '\n'); ch = *++pSrc)
- {
- ; /* find next delimiter or end of line */
- }
-
- /* set length of result */
- SI_SETLEN(si, pSrc - SI_PTR(si));
-
- if (*pSrc == delim) /* gobble trailing delimiter */
- pSrc++;
-
- vmUpdateTib(pVM, pSrc);
- return si;
-}
-
-
-/**************************************************************************
- v m P o p I P
-**
-**************************************************************************/
-void vmPopIP(FICL_VM *pVM)
-{
- pVM->ip = (IPTYPE)(stackPopPtr(pVM->rStack));
- return;
-}
-
-
-/**************************************************************************
- v m P u s h I P
-**
-**************************************************************************/
-void vmPushIP(FICL_VM *pVM, IPTYPE newIP)
-{
- stackPushPtr(pVM->rStack, (void *)pVM->ip);
- pVM->ip = newIP;
- return;
-}
-
-
-/**************************************************************************
- v m P u s h T i b
-** Binds the specified input string to the VM and clears >IN (the index)
-**************************************************************************/
-void vmPushTib(FICL_VM *pVM, char *text, TIB *pSaveTib)
-{
- if (pSaveTib)
- {
- *pSaveTib = pVM->tib;
- }
-
- pVM->tib.cp = text;
- pVM->tib.index = 0;
-}
-
-
-void vmPopTib(FICL_VM *pVM, TIB *pTib)
-{
- if (pTib)
- {
- pVM->tib = *pTib;
- }
- return;
-}
-
-
-/**************************************************************************
- v m Q u i t
-**
-**************************************************************************/
-void vmQuit(FICL_VM *pVM)
-{
- static FICL_WORD *pInterp = NULL;
- if (!pInterp)
- pInterp = ficlLookup("interpret");
- assert(pInterp);
-
- stackReset(pVM->rStack);
- pVM->fRestart = 0;
- pVM->ip = &pInterp;
- pVM->runningWord = pInterp;
- pVM->state = INTERPRET;
- pVM->tib.cp = NULL;
- pVM->tib.index = 0;
- pVM->pad[0] = '\0';
- pVM->sourceID.i = 0;
- return;
-}
-
-
-/**************************************************************************
- v m R e s e t
-**
-**************************************************************************/
-void vmReset(FICL_VM *pVM)
-{
- vmQuit(pVM);
- stackReset(pVM->pStack);
- pVM->base = 10;
- return;
-}
-
-
-/**************************************************************************
- v m S e t T e x t O u t
-** Binds the specified output callback to the vm. If you pass NULL,
-** binds the default output function (ficlTextOut)
-**************************************************************************/
-void vmSetTextOut(FICL_VM *pVM, OUTFUNC textOut)
-{
- if (textOut)
- pVM->textOut = textOut;
- else
- pVM->textOut = ficlTextOut;
-
- return;
-}
-
-
-/**************************************************************************
- v m T e x t O u t
-** Feeds text to the vm's output callback
-**************************************************************************/
-void vmTextOut(FICL_VM *pVM, char *text, int fNewline)
-{
- assert(pVM);
- assert(pVM->textOut);
- (pVM->textOut)(pVM, text, fNewline);
-
- return;
-}
-
-
-/**************************************************************************
- v m T h r o w
-**
-**************************************************************************/
-void vmThrow(FICL_VM *pVM, int except)
-{
- longjmp(*(pVM->pState), except);
-}
-
-
-void vmThrowErr(FICL_VM *pVM, char *fmt, ...)
-{
- va_list va;
- va_start(va, fmt);
- vsprintf(pVM->pad, fmt, va);
- vmTextOut(pVM, pVM->pad, 1);
- va_end(va);
- longjmp(*(pVM->pState), VM_ERREXIT);
-}
-
-
-/**************************************************************************
- w o r d I s I m m e d i a t e
-**
-**************************************************************************/
-int wordIsImmediate(FICL_WORD *pFW)
-{
- return ((pFW != NULL) && (pFW->flags & FW_IMMEDIATE));
-}
-
-
-/**************************************************************************
- w o r d I s C o m p i l e O n l y
-**
-**************************************************************************/
-int wordIsCompileOnly(FICL_WORD *pFW)
-{
- return ((pFW != NULL) && (pFW->flags & FW_COMPILE));
-}
-
-
-/**************************************************************************
- s t r r e v
-**
-**************************************************************************/
-char *strrev( char *string )
-{ /* reverse a string in-place */
- int i = strlen(string);
- char *p1 = string; /* first char of string */
- char *p2 = string + i - 1; /* last non-NULL char of string */
- char c;
-
- if (i > 1)
- {
- while (p1 < p2)
- {
- c = *p2;
- *p2 = *p1;
- *p1 = c;
- p1++; p2--;
- }
- }
-
- return string;
-}
-
-
-/**************************************************************************
- d i g i t _ t o _ c h a r
-**
-**************************************************************************/
-char digit_to_char(int value)
-{
- return digits[value];
-}
-
-
-/**************************************************************************
- l t o a
-**
-**************************************************************************/
-char *ltoa( INT32 value, char *string, int radix )
-{ /* convert long to string, any base */
- char *cp = string;
- int sign = ((radix == 10) && (value < 0));
- UNSQR result;
- UNS64 v;
-
- assert(radix > 1);
- assert(radix < 37);
- assert(string);
-
- if (sign)
- value = -value;
-
- if (value == 0)
- *cp++ = '0';
- else
- {
- v.hi = 0;
- v.lo = (UNS32)value;
- while (v.lo)
- {
- result = ficlLongDiv(v, (UNS32)radix);
- *cp++ = digits[result.rem];
- v.lo = result.quot;
- }
- }
-
- if (sign)
- *cp++ = '-';
-
- *cp++ = '\0';
-
- return strrev(string);
-}
-
-
-/**************************************************************************
- u l t o a
-**
-**************************************************************************/
-char *ultoa(UNS32 value, char *string, int radix )
-{ /* convert long to string, any base */
- char *cp = string;
- UNS64 ud;
- UNSQR result;
-
- assert(radix > 1);
- assert(radix < 37);
- assert(string);
-
- if (value == 0)
- *cp++ = '0';
- else
- {
- ud.hi = 0;
- ud.lo = value;
- result.quot = value;
-
- while (ud.lo)
- {
- result = ficlLongDiv(ud, (UNS32)radix);
- ud.lo = result.quot;
- *cp++ = digits[result.rem];
- }
- }
-
- *cp++ = '\0';
-
- return strrev(string);
-}
-
-
-/**************************************************************************
- c a s e F o l d
-** Case folds a NULL terminated string in place. All characters
-** get converted to lower case.
-**************************************************************************/
-char *caseFold(char *cp)
-{
- char *oldCp = cp;
-
- while (*cp)
- {
- if (isupper(*cp))
- *cp = (char)tolower(*cp);
- cp++;
- }
-
- return oldCp;
-}
-
-
-/**************************************************************************
- s t r i n c m p
-**
-**************************************************************************/
-int strincmp(char *cp1, char *cp2, FICL_COUNT count)
-{
- int i = 0;
- char c1, c2;
-
- for (c1 = *cp1, c2 = *cp2;
- ((i == 0) && count && c1 && c2);
- c1 = *++cp1, c2 = *++cp2, count--)
- {
- i = tolower(c1) - tolower(c2);
- }
-
- return i;
-}
-
-
-
-/**************************************************************************
- s k i p S p a c e
-** Given a string pointer, returns a pointer to the first non-space
-** char of the string, or to the NULL terminator if no such char found.
-**************************************************************************/
-char *skipSpace(char *cp)
-{
- assert(cp);
-
- while (isspace(*cp))
- cp++;
-
- return cp;
-}
-
-
diff --git a/sys/boot/ficl/words.c b/sys/boot/ficl/words.c
deleted file mode 100644
index c76c169a83d38..0000000000000
--- a/sys/boot/ficl/words.c
+++ /dev/null
@@ -1,4544 +0,0 @@
-/*******************************************************************
-** w o r d s . c
-** Forth Inspired Command Language
-** ANS Forth CORE word-set written in C
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 19 July 1997
-**
-*******************************************************************/
-
-#ifdef TESTMAIN
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <fcntl.h>
-#else
-#include <stand.h>
-#endif
-#include <string.h>
-#include "ficl.h"
-#include "math64.h"
-
-static void colonParen(FICL_VM *pVM);
-static void literalIm(FICL_VM *pVM);
-static void interpWord(FICL_VM *pVM, STRINGINFO si);
-
-/*
-** Control structure building words use these
-** strings' addresses as markers on the stack to
-** check for structure completion.
-*/
-static char doTag[] = "do";
-static char ifTag[] = "if";
-static char colonTag[] = "colon";
-static char leaveTag[] = "leave";
-static char beginTag[] = "begin";
-static char whileTag[] = "while";
-
-/*
-** Pointers to various words in the dictionary
-** -- initialized by ficlCompileCore, below --
-** for use by compiling words. Colon definitions
-** in ficl are lists of pointers to words. A bit
-** simple-minded...
-*/
-static FICL_WORD *pBranchParen = NULL;
-static FICL_WORD *pComma = NULL;
-static FICL_WORD *pDoParen = NULL;
-static FICL_WORD *pDoesParen = NULL;
-static FICL_WORD *pExitParen = NULL;
-static FICL_WORD *pIfParen = NULL;
-static FICL_WORD *pInterpret = NULL;
-static FICL_WORD *pLitParen = NULL;
-static FICL_WORD *pLoopParen = NULL;
-static FICL_WORD *pPLoopParen = NULL;
-static FICL_WORD *pQDoParen = NULL;
-static FICL_WORD *pSemiParen = NULL;
-static FICL_WORD *pStore = NULL;
-static FICL_WORD *pStringLit = NULL;
-static FICL_WORD *pType = NULL;
-
-#if FICL_WANT_LOCALS
-static FICL_WORD *pGetLocalParen= NULL;
-static FICL_WORD *pGetLocal0 = NULL;
-static FICL_WORD *pGetLocal1 = NULL;
-static FICL_WORD *pToLocalParen = NULL;
-static FICL_WORD *pToLocal0 = NULL;
-static FICL_WORD *pToLocal1 = NULL;
-static FICL_WORD *pLinkParen = NULL;
-static FICL_WORD *pUnLinkParen = NULL;
-static int nLocals = 0;
-#endif
-
-
-/*
-** C O N T R O L S T R U C T U R E B U I L D E R S
-**
-** Push current dict location for later branch resolution.
-** The location may be either a branch target or a patch address...
-*/
-static void markBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- stackPushPtr(pVM->pStack, dp->here);
- stackPushPtr(pVM->pStack, tag);
- return;
-}
-
-static void markControlTag(FICL_VM *pVM, char *tag)
-{
- stackPushPtr(pVM->pStack, tag);
- return;
-}
-
-static void matchControlTag(FICL_VM *pVM, char *tag)
-{
- char *cp = (char *)stackPopPtr(pVM->pStack);
- if ( strcmp(cp, tag) )
- {
- vmTextOut(pVM, "Warning -- unmatched control word: ", 0);
- vmTextOut(pVM, tag, 1);
- }
-
- return;
-}
-
-/*
-** Expect a branch target address on the param stack,
-** compile a literal offset from the current dict location
-** to the target address
-*/
-static void resolveBackBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- long offset;
- CELL *patchAddr;
-
- matchControlTag(pVM, tag);
-
- patchAddr = (CELL *)stackPopPtr(pVM->pStack);
- offset = patchAddr - dp->here;
- dictAppendCell(dp, LVALUEtoCELL(offset));
-
- return;
-}
-
-
-/*
-** Expect a branch patch address on the param stack,
-** compile a literal offset from the patch location
-** to the current dict location
-*/
-static void resolveForwardBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- long offset;
- CELL *patchAddr;
-
- matchControlTag(pVM, tag);
-
- patchAddr = (CELL *)stackPopPtr(pVM->pStack);
- offset = dp->here - patchAddr;
- *patchAddr = LVALUEtoCELL(offset);
-
- return;
-}
-
-/*
-** Match the tag to the top of the stack. If success,
-** sopy "here" address into the cell whose address is next
-** on the stack. Used by do..leave..loop.
-*/
-static void resolveAbsBranch(FICL_DICT *dp, FICL_VM *pVM, char *tag)
-{
- CELL *patchAddr;
- char *cp;
-
- cp = stackPopPtr(pVM->pStack);
- if (strcmp(cp, tag))
- {
- vmTextOut(pVM, "Warning -- Unmatched control word: ", 0);
- vmTextOut(pVM, tag, 1);
- }
-
- patchAddr = (CELL *)stackPopPtr(pVM->pStack);
- *patchAddr = LVALUEtoCELL(dp->here);
-
- return;
-}
-
-
-/**************************************************************************
- i s N u m b e r
-** Attempts to convert the NULL terminated string in the VM's pad to
-** a number using the VM's current base. If successful, pushes the number
-** onto the param stack and returns TRUE. Otherwise, returns FALSE.
-**************************************************************************/
-
-static int isNumber(FICL_VM *pVM, STRINGINFO si)
-{
- INT32 accum = 0;
- char isNeg = FALSE;
- unsigned base = pVM->base;
- char *cp = SI_PTR(si);
- FICL_COUNT count= (FICL_COUNT)SI_COUNT(si);
- unsigned ch;
- unsigned digit;
-
- if (*cp == '-')
- {
- cp++;
- count--;
- isNeg = TRUE;
- }
- else if ((cp[0] == '0') && (cp[1] == 'x'))
- { /* detect 0xNNNN format for hex numbers */
- cp += 2;
- count -= 2;
- base = 16;
- }
-
- if (count == 0)
- return FALSE;
-
- while (count-- && ((ch = *cp++) != '\0'))
- {
- if (ch < '0')
- return FALSE;
-
- digit = ch - '0';
-
- if (digit > 9)
- digit = tolower(ch) - 'a' + 10;
- /*
- ** Note: following test also catches chars between 9 and a
- ** because 'digit' is unsigned!
- */
- if (digit >= base)
- return FALSE;
-
- accum = accum * base + digit;
- }
-
- if (isNeg)
- accum = -accum;
-
- stackPushINT32(pVM->pStack, accum);
-
- return TRUE;
-}
-
-
-/**************************************************************************
- a d d & f r i e n d s
-**
-**************************************************************************/
-
-static void add(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i += stackGetTop(pVM->pStack).i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void sub(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i = stackGetTop(pVM->pStack).i - i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void mul(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i *= stackGetTop(pVM->pStack).i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void negate(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = -stackPopINT32(pVM->pStack);
- stackPushINT32(pVM->pStack, i);
- return;
-}
-
-static void ficlDiv(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- i = stackPopINT32(pVM->pStack);
- i = stackGetTop(pVM->pStack).i / i;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-/*
-** slash-mod CORE ( n1 n2 -- n3 n4 )
-** Divide n1 by n2, giving the single-cell remainder n3 and the single-cell
-** quotient n4. An ambiguous condition exists if n2 is zero. If n1 and n2
-** differ in sign, the implementation-defined result returned will be the
-** same as that returned by either the phrase
-** >R S>D R> FM/MOD or the phrase >R S>D R> SM/REM .
-** NOTE: Ficl complies with the second phrase (symmetric division)
-*/
-static void slashMod(FICL_VM *pVM)
-{
- INT64 n1;
- INT32 n2;
- INTQR qr;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 2);
-#endif
- n2 = stackPopINT32(pVM->pStack);
- n1.lo = stackPopINT32(pVM->pStack);
- i64Extend(n1);
-
- qr = m64SymmetricDivI(n1, n2);
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-static void onePlus(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i += 1;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void oneMinus(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i -= 1;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void twoMul(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i *= 2;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void twoDiv(FICL_VM *pVM)
-{
- INT32 i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- i = stackGetTop(pVM->pStack).i;
- i >>= 1;
- stackSetTop(pVM->pStack, LVALUEtoCELL(i));
- return;
-}
-
-static void mulDiv(FICL_VM *pVM)
-{
- INT32 x, y, z;
- INT64 prod;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 1);
-#endif
- z = stackPopINT32(pVM->pStack);
- y = stackPopINT32(pVM->pStack);
- x = stackPopINT32(pVM->pStack);
-
- prod = m64MulI(x,y);
- x = m64SymmetricDivI(prod, z).quot;
-
- stackPushINT32(pVM->pStack, x);
- return;
-}
-
-
-static void mulDivRem(FICL_VM *pVM)
-{
- INT32 x, y, z;
- INT64 prod;
- INTQR qr;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 2);
-#endif
- z = stackPopINT32(pVM->pStack);
- y = stackPopINT32(pVM->pStack);
- x = stackPopINT32(pVM->pStack);
-
- prod = m64MulI(x,y);
- qr = m64SymmetricDivI(prod, z);
-
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-
-/**************************************************************************
- b y e
-** TOOLS
-** Signal the system to shut down - this causes ficlExec to return
-** VM_USEREXIT. The rest is up to you.
-**************************************************************************/
-
-static void bye(FICL_VM *pVM)
-{
- vmThrow(pVM, VM_USEREXIT);
- return;
-}
-
-
-/**************************************************************************
- c o l o n d e f i n i t i o n s
-** Code to begin compiling a colon definition
-** This function sets the state to COMPILE, then creates a
-** new word whose name is the next word in the input stream
-** and whose code is colonParen.
-**************************************************************************/
-
-static void colon(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
- pVM->state = COMPILE;
- markControlTag(pVM, colonTag);
- dictAppendWord2(dp, si, colonParen, FW_DEFAULT | FW_SMUDGE);
-#if FICL_WANT_LOCALS
- nLocals = 0;
-#endif
- return;
-}
-
-
-/**************************************************************************
- c o l o n P a r e n
-** This is the code that executes a colon definition. It assumes that the
-** virtual machine is running a "next" loop (See the vm.c
-** for its implementation of member function vmExecute()). The colon
-** code simply copies the address of the first word in the list of words
-** to interpret into IP after saving its old value. When we return to the
-** "next" loop, the virtual machine will call the code for each word in
-** turn.
-**
-**************************************************************************/
-
-static void colonParen(FICL_VM *pVM)
-{
- IPTYPE tempIP = (IPTYPE) (pVM->runningWord->param);
- vmPushIP(pVM, tempIP);
-
- return;
-}
-
-
-/**************************************************************************
- s e m i c o l o n C o I m
-**
-** IMMEDIATE code for ";". This function sets the state to INTERPRET and
-** terminates a word under compilation by appending code for "(;)" to
-** the definition. TO DO: checks for leftover branch target tags on the
-** return stack and complains if any are found.
-**************************************************************************/
-static void semiParen(FICL_VM *pVM)
-{
- vmPopIP(pVM);
- return;
-}
-
-
-static void semicolonCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pSemiParen);
- matchControlTag(pVM, colonTag);
-
-#if FICL_WANT_LOCALS
- assert(pUnLinkParen);
- if (nLocals > 0)
- {
- FICL_DICT *pLoc = ficlGetLoc();
- dictEmpty(pLoc, pLoc->pForthWords->size);
- dictAppendCell(dp, LVALUEtoCELL(pUnLinkParen));
- }
- nLocals = 0;
-#endif
-
- dictAppendCell(dp, LVALUEtoCELL(pSemiParen));
- pVM->state = INTERPRET;
- dictUnsmudge(dp);
- return;
-}
-
-
-/**************************************************************************
- e x i t
-** CORE
-** This function simply pops the previous instruction
-** pointer and returns to the "next" loop. Used for exiting from within
-** a definition. Note that exitParen is identical to semiParen - they
-** are in two different functions so that "see" can correctly identify
-** the end of a colon definition, even if it uses "exit".
-**************************************************************************/
-static void exitParen(FICL_VM *pVM)
-{
- vmPopIP(pVM);
- return;
-}
-
-static void exitCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- assert(pExitParen);
- IGNORE(pVM);
-
-#if FICL_WANT_LOCALS
- if (nLocals > 0)
- {
- dictAppendCell(dp, LVALUEtoCELL(pUnLinkParen));
- }
-#endif
- dictAppendCell(dp, LVALUEtoCELL(pExitParen));
- return;
-}
-
-
-/**************************************************************************
- c o n s t a n t P a r e n
-** This is the run-time code for "constant". It simply returns the
-** contents of its word's first data cell.
-**
-**************************************************************************/
-
-void constantParen(FICL_VM *pVM)
-{
- FICL_WORD *pFW = pVM->runningWord;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- stackPush(pVM->pStack, pFW->param[0]);
- return;
-}
-
-void twoConstParen(FICL_VM *pVM)
-{
- FICL_WORD *pFW = pVM->runningWord;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 2);
-#endif
- stackPush(pVM->pStack, pFW->param[0]); /* lo */
- stackPush(pVM->pStack, pFW->param[1]); /* hi */
- return;
-}
-
-
-/**************************************************************************
- c o n s t a n t
-** IMMEDIATE
-** Compiles a constant into the dictionary. Constants return their
-** value when invoked. Expects a value on top of the parm stack.
-**************************************************************************/
-
-static void constant(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- dictAppendWord2(dp, si, constantParen, FW_DEFAULT);
- dictAppendCell(dp, stackPop(pVM->pStack));
- return;
-}
-
-
-static void twoConstant(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
- CELL c;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- c = stackPop(pVM->pStack);
- dictAppendWord2(dp, si, twoConstParen, FW_DEFAULT);
- dictAppendCell(dp, stackPop(pVM->pStack));
- dictAppendCell(dp, c);
- return;
-}
-
-
-/**************************************************************************
- d i s p l a y C e l l
-** Drop and print the contents of the cell at the top of the param
-** stack
-**************************************************************************/
-
-static void displayCell(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- c = stackPop(pVM->pStack);
- ltoa((c).i, pVM->pad, pVM->base);
- strcat(pVM->pad, " ");
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-static void displayCellNoPad(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- c = stackPop(pVM->pStack);
- ltoa((c).i, pVM->pad, pVM->base);
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-static void uDot(FICL_VM *pVM)
-{
- UNS32 u;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- u = stackPopUNS32(pVM->pStack);
- ultoa(u, pVM->pad, pVM->base);
- strcat(pVM->pad, " ");
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-
-static void hexDot(FICL_VM *pVM)
-{
- UNS32 u;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- u = stackPopUNS32(pVM->pStack);
- ultoa(u, pVM->pad, 16);
- strcat(pVM->pad, " ");
- vmTextOut(pVM, pVM->pad, 0);
- return;
-}
-
-
-/**************************************************************************
- d i s p l a y S t a c k
-** Display the parameter stack (code for ".s")
-**************************************************************************/
-
-static void displayStack(FICL_VM *pVM)
-{
- int d = stackDepth(pVM->pStack);
- int i;
- CELL *pCell;
-
- vmCheckStack(pVM, 0, 0);
-
- if (d == 0)
- vmTextOut(pVM, "(Stack Empty)", 1);
- else
- {
- pCell = pVM->pStack->sp;
- for (i = 0; i < d; i++)
- {
- vmTextOut(pVM, ltoa((*--pCell).i, pVM->pad, pVM->base), 1);
- }
- }
-}
-
-
-/**************************************************************************
- d u p & f r i e n d s
-**
-**************************************************************************/
-
-static void depth(FICL_VM *pVM)
-{
- int i;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- i = stackDepth(pVM->pStack);
- stackPushINT32(pVM->pStack, i);
- return;
-}
-
-
-static void drop(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- stackDrop(pVM->pStack, 1);
- return;
-}
-
-
-static void twoDrop(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- stackDrop(pVM->pStack, 2);
- return;
-}
-
-
-static void dup(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 2);
-#endif
- stackPick(pVM->pStack, 0);
- return;
-}
-
-
-static void twoDup(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 4);
-#endif
- stackPick(pVM->pStack, 1);
- stackPick(pVM->pStack, 1);
- return;
-}
-
-
-static void over(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 3);
-#endif
- stackPick(pVM->pStack, 1);
- return;
-}
-
-static void twoOver(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 4, 6);
-#endif
- stackPick(pVM->pStack, 3);
- stackPick(pVM->pStack, 3);
- return;
-}
-
-
-static void pick(FICL_VM *pVM)
-{
- CELL c = stackPop(pVM->pStack);
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, c.i+1, c.i+2);
-#endif
- stackPick(pVM->pStack, c.i);
- return;
-}
-
-
-static void questionDup(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 2);
-#endif
- c = stackGetTop(pVM->pStack);
-
- if (c.i != 0)
- stackPick(pVM->pStack, 0);
-
- return;
-}
-
-
-static void roll(FICL_VM *pVM)
-{
- int i = stackPop(pVM->pStack).i;
- i = (i > 0) ? i : 0;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, i+1, i+1);
-#endif
- stackRoll(pVM->pStack, i);
- return;
-}
-
-
-static void minusRoll(FICL_VM *pVM)
-{
- int i = stackPop(pVM->pStack).i;
- i = (i > 0) ? i : 0;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, i+1, i+1);
-#endif
- stackRoll(pVM->pStack, -i);
- return;
-}
-
-
-static void rot(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 3);
-#endif
- stackRoll(pVM->pStack, 2);
- return;
-}
-
-
-static void swap(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 2);
-#endif
- stackRoll(pVM->pStack, 1);
- return;
-}
-
-
-static void twoSwap(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 4, 4);
-#endif
- stackRoll(pVM->pStack, 3);
- stackRoll(pVM->pStack, 3);
- return;
-}
-
-
-/**************************************************************************
- e m i t & f r i e n d s
-**
-**************************************************************************/
-
-static void emit(FICL_VM *pVM)
-{
- char *cp = pVM->pad;
- int i;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- i = stackPopINT32(pVM->pStack);
- cp[0] = (char)i;
- cp[1] = '\0';
- vmTextOut(pVM, cp, 0);
- return;
-}
-
-
-static void cr(FICL_VM *pVM)
-{
- vmTextOut(pVM, "", 1);
- return;
-}
-
-
-static void commentLine(FICL_VM *pVM)
-{
- char *cp = vmGetInBuf(pVM);
- char ch = *cp;
-
- while ((ch != '\0') && (ch != '\r') && (ch != '\n'))
- {
- ch = *++cp;
- }
-
- /*
- ** Cope with DOS or UNIX-style EOLs -
- ** Check for /r, /n, /r/n, or /n/r end-of-line sequences,
- ** and point cp to next char. If EOL is \0, we're done.
- */
- if (ch != '\0')
- {
- cp++;
-
- if ( (ch != *cp)
- && ((*cp == '\r') || (*cp == '\n')) )
- cp++;
- }
-
- vmUpdateTib(pVM, cp);
- return;
-}
-
-
-/*
-** paren CORE
-** Compilation: Perform the execution semantics given below.
-** Execution: ( "ccc<paren>" -- )
-** Parse ccc delimited by ) (right parenthesis). ( is an immediate word.
-** The number of characters in ccc may be zero to the number of characters
-** in the parse area.
-**
-*/
-static void commentHang(FICL_VM *pVM)
-{
- vmParseString(pVM, ')');
- return;
-}
-
-
-/**************************************************************************
- F E T C H & S T O R E
-**
-**************************************************************************/
-
-static void fetch(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- stackPush(pVM->pStack, *pCell);
- return;
-}
-
-/*
-** two-fetch CORE ( a-addr -- x1 x2 )
-** Fetch the cell pair x1 x2 stored at a-addr. x2 is stored at a-addr and
-** x1 at the next consecutive cell. It is equivalent to the sequence
-** DUP CELL+ @ SWAP @ .
-*/
-static void twoFetch(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 2);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- stackPush(pVM->pStack, *pCell++);
- stackPush(pVM->pStack, *pCell);
- swap(pVM);
- return;
-}
-
-/*
-** store CORE ( x a-addr -- )
-** Store x at a-addr.
-*/
-static void store(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- *pCell = stackPop(pVM->pStack);
-}
-
-/*
-** two-store CORE ( x1 x2 a-addr -- )
-** Store the cell pair x1 x2 at a-addr, with x2 at a-addr and x1 at the
-** next consecutive cell. It is equivalent to the sequence
-** SWAP OVER ! CELL+ ! .
-*/
-static void twoStore(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 0);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- *pCell++ = stackPop(pVM->pStack);
- *pCell = stackPop(pVM->pStack);
-}
-
-static void plusStore(FICL_VM *pVM)
-{
- CELL *pCell;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pCell = (CELL *)stackPopPtr(pVM->pStack);
- pCell->i += stackPop(pVM->pStack).i;
-}
-
-
-static void wFetch(FICL_VM *pVM)
-{
- UNS16 *pw;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- pw = (UNS16 *)stackPopPtr(pVM->pStack);
- stackPushUNS32(pVM->pStack, (UNS32)*pw);
- return;
-}
-
-static void wStore(FICL_VM *pVM)
-{
- UNS16 *pw;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pw = (UNS16 *)stackPopPtr(pVM->pStack);
- *pw = (UNS16)(stackPop(pVM->pStack).u);
-}
-
-static void cFetch(FICL_VM *pVM)
-{
- UNS8 *pc;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- pc = (UNS8 *)stackPopPtr(pVM->pStack);
- stackPushUNS32(pVM->pStack, (UNS32)*pc);
- return;
-}
-
-static void cStore(FICL_VM *pVM)
-{
- UNS8 *pc;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- pc = (UNS8 *)stackPopPtr(pVM->pStack);
- *pc = (UNS8)(stackPop(pVM->pStack).u);
-}
-
-
-/**************************************************************************
- i f C o I m
-** IMMEDIATE
-** Compiles code for a conditional branch into the dictionary
-** and pushes the branch patch address on the stack for later
-** patching by ELSE or THEN/ENDIF.
-**************************************************************************/
-
-static void ifCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pIfParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pIfParen));
- markBranch(dp, pVM, ifTag);
- dictAppendUNS32(dp, 1);
- return;
-}
-
-
-/**************************************************************************
- i f P a r e n
-** Runtime code to do "if" or "until": pop a flag from the stack,
-** fall through if true, branch if false. Probably ought to be
-** called (not?branch) since it does "branch if false".
-**************************************************************************/
-
-static void ifParen(FICL_VM *pVM)
-{
- UNS32 flag;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- flag = stackPopUNS32(pVM->pStack);
-
- if (flag)
- { /* fall through */
- vmBranchRelative(pVM, 1);
- }
- else
- { /* take branch (to else/endif/begin) */
- vmBranchRelative(pVM, (int)(*pVM->ip));
- }
-
- return;
-}
-
-
-/**************************************************************************
- e l s e C o I m
-**
-** IMMEDIATE -- compiles an "else"...
-** 1) Compile a branch and a patch address; the address gets patched
-** by "endif" to point past the "else" code.
-** 2) Pop the the "if" patch address
-** 3) Patch the "if" branch to point to the current compile address.
-** 4) Push the "else" patch address. ("endif" patches this to jump past
-** the "else" code.
-**************************************************************************/
-
-static void elseCoIm(FICL_VM *pVM)
-{
- CELL *patchAddr;
- int offset;
- FICL_DICT *dp = ficlGetDict();
-
- assert(pBranchParen);
- /* (1) compile branch runtime */
- dictAppendCell(dp, LVALUEtoCELL(pBranchParen));
- matchControlTag(pVM, ifTag);
- patchAddr =
- (CELL *)stackPopPtr(pVM->pStack); /* (2) pop "if" patch addr */
- markBranch(dp, pVM, ifTag); /* (4) push "else" patch addr */
- dictAppendUNS32(dp, 1); /* (1) compile patch placeholder */
- offset = dp->here - patchAddr;
- *patchAddr = LVALUEtoCELL(offset); /* (3) Patch "if" */
-
- return;
-}
-
-
-/**************************************************************************
- b r a n c h P a r e n
-**
-** Runtime for "(branch)" -- expects a literal offset in the next
-** compilation address, and branches to that location.
-**************************************************************************/
-
-static void branchParen(FICL_VM *pVM)
-{
- vmBranchRelative(pVM, *(int *)(pVM->ip));
- return;
-}
-
-
-/**************************************************************************
- e n d i f C o I m
-**
-**************************************************************************/
-
-static void endifCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- resolveForwardBranch(dp, pVM, ifTag);
- return;
-}
-
-
-/**************************************************************************
- i n t e r p r e t
-** This is the "user interface" of a Forth. It does the following:
-** while there are words in the VM's Text Input Buffer
-** Copy next word into the pad (vmGetWord)
-** Attempt to find the word in the dictionary (dictLookup)
-** If successful, execute the word.
-** Otherwise, attempt to convert the word to a number (isNumber)
-** If successful, push the number onto the parameter stack.
-** Otherwise, print an error message and exit loop...
-** End Loop
-**
-** From the standard, section 3.4
-** Text interpretation (see 6.1.1360 EVALUATE and 6.1.2050 QUIT) shall
-** repeat the following steps until either the parse area is empty or an
-** ambiguous condition exists:
-** a) Skip leading spaces and parse a name (see 3.4.1);
-**************************************************************************/
-
-static void interpret(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord0(pVM);
- assert(pVM);
-
- vmBranchRelative(pVM, -1);
-
- /*
- // Get next word...if out of text, we're done.
- */
- if (si.count == 0)
- {
- vmThrow(pVM, VM_OUTOFTEXT);
- }
-
- interpWord(pVM, si);
-
-
- return; /* back to inner interpreter */
-}
-
-/**************************************************************************
-** From the standard, section 3.4
-** b) Search the dictionary name space (see 3.4.2). If a definition name
-** matching the string is found:
-** 1.if interpreting, perform the interpretation semantics of the definition
-** (see 3.4.3.2), and continue at a);
-** 2.if compiling, perform the compilation semantics of the definition
-** (see 3.4.3.3), and continue at a).
-**
-** c) If a definition name matching the string is not found, attempt to
-** convert the string to a number (see 3.4.1.3). If successful:
-** 1.if interpreting, place the number on the data stack, and continue at a);
-** 2.if compiling, compile code that when executed will place the number on
-** the stack (see 6.1.1780 LITERAL), and continue at a);
-**
-** d) If unsuccessful, an ambiguous condition exists (see 3.4.4).
-**************************************************************************/
-static void interpWord(FICL_VM *pVM, STRINGINFO si)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *tempFW;
-
-#if FICL_ROBUST
- dictCheck(dp, pVM, 0);
- vmCheckStack(pVM, 0, 0);
-#endif
-
-#if FICL_WANT_LOCALS
- if (nLocals > 0)
- {
- tempFW = dictLookupLoc(dp, si);
- }
- else
-#endif
- tempFW = dictLookup(dp, si);
-
- if (pVM->state == INTERPRET)
- {
- if (tempFW != NULL)
- {
- if (wordIsCompileOnly(tempFW))
- {
- vmThrowErr(pVM, "Error: Compile only!");
- }
-
- vmExecute(pVM, tempFW);
- }
-
- else if (!isNumber(pVM, si))
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
- }
-
- else /* (pVM->state == COMPILE) */
- {
- if (tempFW != NULL)
- {
- if (wordIsImmediate(tempFW))
- {
- vmExecute(pVM, tempFW);
- }
- else
- {
- dictAppendCell(dp, LVALUEtoCELL(tempFW));
- }
- }
- else if (isNumber(pVM, si))
- {
- literalIm(pVM);
- }
- else
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
- }
-
- return;
-}
-
-
-/**************************************************************************
- l i t e r a l P a r e n
-**
-** This is the runtime for (literal). It assumes that it is part of a colon
-** definition, and that the next CELL contains a value to be pushed on the
-** parameter stack at runtime. This code is compiled by "literal".
-**
-**************************************************************************/
-
-static void literalParen(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- stackPushINT32(pVM->pStack, *(INT32 *)(pVM->ip));
- vmBranchRelative(pVM, 1);
- return;
-}
-
-
-/**************************************************************************
- l i t e r a l I m
-**
-** IMMEDIATE code for "literal". This function gets a value from the stack
-** and compiles it into the dictionary preceded by the code for "(literal)".
-** IMMEDIATE
-**************************************************************************/
-
-static void literalIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- assert(pLitParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pLitParen));
- dictAppendCell(dp, stackPop(pVM->pStack));
-
- return;
-}
-
-
-/**************************************************************************
- l i s t W o r d s
-**
-**************************************************************************/
-#define nCOLWIDTH 8
-static void listWords(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_HASH *pHash = dp->pSearch[dp->nLists - 1];
- FICL_WORD *wp;
- int nChars = 0;
- int len;
- int y = 0;
- unsigned i;
- int nWords = 0;
- char *cp;
- char *pPad = pVM->pad;
-
- for (i = 0; i < pHash->size; i++)
- {
- for (wp = pHash->table[i]; wp != NULL; wp = wp->link, nWords++)
- {
- if (wp->nName == 0) /* ignore :noname defs */
- continue;
-
- cp = wp->name;
- nChars += sprintf(pPad + nChars, "%s", cp);
-
- if (nChars > 70)
- {
- pPad[nChars] = '\0';
- nChars = 0;
- y++;
- if(y>23) {
- y=0;
- vmTextOut(pVM, "--- Press Enter to continue ---",0);
- getchar();
- vmTextOut(pVM,"\r",0);
- }
- vmTextOut(pVM, pPad, 1);
- }
- else
- {
- len = nCOLWIDTH - nChars % nCOLWIDTH;
- while (len-- > 0)
- pPad[nChars++] = ' ';
- }
-
- if (nChars > 70)
- {
- pPad[nChars] = '\0';
- nChars = 0;
- y++;
- if(y>23) {
- y=0;
- vmTextOut(pVM, "--- Press Enter to continue ---",0);
- getchar();
- vmTextOut(pVM,"\r",0);
- }
- vmTextOut(pVM, pPad, 1);
- }
- }
- }
-
- if (nChars > 0)
- {
- pPad[nChars] = '\0';
- nChars = 0;
- vmTextOut(pVM, pPad, 1);
- }
-
- sprintf(pVM->pad, "Dictionary: %d words, %ld cells used of %lu total",
- nWords, dp->here - dp->dict, dp->size);
- vmTextOut(pVM, pVM->pad, 1);
- return;
-}
-
-
-static void listEnv(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetEnv();
- FICL_HASH *pHash = dp->pForthWords;
- FICL_WORD *wp;
- unsigned i;
- int nWords = 0;
-
- for (i = 0; i < pHash->size; i++)
- {
- for (wp = pHash->table[i]; wp != NULL; wp = wp->link, nWords++)
- {
- vmTextOut(pVM, wp->name, 1);
- }
- }
-
- sprintf(pVM->pad, "Environment: %d words, %ld cells used of %lu total",
- nWords, dp->here - dp->dict, dp->size);
- vmTextOut(pVM, pVM->pad, 1);
- return;
-}
-
-
-/**************************************************************************
- l o g i c a n d c o m p a r i s o n s
-**
-**************************************************************************/
-
-static void zeroEquals(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- c.i = FICL_BOOL(stackPopINT32(pVM->pStack) == 0);
- stackPush(pVM->pStack, c);
- return;
-}
-
-static void zeroLess(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- c.i = FICL_BOOL(stackPopINT32(pVM->pStack) < 0);
- stackPush(pVM->pStack, c);
- return;
-}
-
-static void zeroGreater(FICL_VM *pVM)
-{
- CELL c;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- c.i = FICL_BOOL(stackPopINT32(pVM->pStack) > 0);
- stackPush(pVM->pStack, c);
- return;
-}
-
-static void isEqual(FICL_VM *pVM)
-{
- CELL x, y;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(x.i == y.i));
- return;
-}
-
-static void isLess(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- y = stackPop(pVM->pStack);
- x = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(x.i < y.i));
- return;
-}
-
-static void uIsLess(FICL_VM *pVM)
-{
- UNS32 u1, u2;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- u2 = stackPopUNS32(pVM->pStack);
- u1 = stackPopUNS32(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(u1 < u2));
- return;
-}
-
-static void isGreater(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- y = stackPop(pVM->pStack);
- x = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, FICL_BOOL(x.i > y.i));
- return;
-}
-
-static void bitwiseAnd(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, x.i & y.i);
- return;
-}
-
-static void bitwiseOr(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, x.i | y.i);
- return;
-}
-
-static void bitwiseXor(FICL_VM *pVM)
-{
- CELL x, y;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- x = stackPop(pVM->pStack);
- y = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, x.i ^ y.i);
- return;
-}
-
-static void bitwiseNot(FICL_VM *pVM)
-{
- CELL x;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- x = stackPop(pVM->pStack);
- stackPushINT32(pVM->pStack, ~x.i);
- return;
-}
-
-
-/**************************************************************************
- D o / L o o p
-** do -- IMMEDIATE COMPILE ONLY
-** Compiles code to initialize a loop: compile (do),
-** allot space to hold the "leave" address, push a branch
-** target address for the loop.
-** (do) -- runtime for "do"
-** pops index and limit from the p stack and moves them
-** to the r stack, then skips to the loop body.
-** loop -- IMMEDIATE COMPILE ONLY
-** +loop
-** Compiles code for the test part of a loop:
-** compile (loop), resolve forward branch from "do", and
-** copy "here" address to the "leave" address allotted by "do"
-** i,j,k -- COMPILE ONLY
-** Runtime: Push loop indices on param stack (i is innermost loop...)
-** Note: each loop has three values on the return stack:
-** ( R: leave limit index )
-** "leave" is the absolute address of the next cell after the loop
-** limit and index are the loop control variables.
-** leave -- COMPILE ONLY
-** Runtime: pop the loop control variables, then pop the
-** "leave" address and jump (absolute) there.
-**************************************************************************/
-
-static void doCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pDoParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pDoParen));
- /*
- ** Allot space for a pointer to the end
- ** of the loop - "leave" uses this...
- */
- markBranch(dp, pVM, leaveTag);
- dictAppendUNS32(dp, 0);
- /*
- ** Mark location of head of loop...
- */
- markBranch(dp, pVM, doTag);
-
- return;
-}
-
-
-static void doParen(FICL_VM *pVM)
-{
- CELL index, limit;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- index = stackPop(pVM->pStack);
- limit = stackPop(pVM->pStack);
-
- /* copy "leave" target addr to stack */
- stackPushPtr(pVM->rStack, *(pVM->ip++));
- stackPush(pVM->rStack, limit);
- stackPush(pVM->rStack, index);
-
- return;
-}
-
-
-static void qDoCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pQDoParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pQDoParen));
- /*
- ** Allot space for a pointer to the end
- ** of the loop - "leave" uses this...
- */
- markBranch(dp, pVM, leaveTag);
- dictAppendUNS32(dp, 0);
- /*
- ** Mark location of head of loop...
- */
- markBranch(dp, pVM, doTag);
-
- return;
-}
-
-
-static void qDoParen(FICL_VM *pVM)
-{
- CELL index, limit;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- index = stackPop(pVM->pStack);
- limit = stackPop(pVM->pStack);
-
- /* copy "leave" target addr to stack */
- stackPushPtr(pVM->rStack, *(pVM->ip++));
-
- if (limit.u == index.u)
- {
- vmPopIP(pVM);
- }
- else
- {
- stackPush(pVM->rStack, limit);
- stackPush(pVM->rStack, index);
- }
-
- return;
-}
-
-
-/*
-** Runtime code to break out of a do..loop construct
-** Drop the loop control variables; the branch address
-** past "loop" is next on the return stack.
-*/
-static void leaveCo(FICL_VM *pVM)
-{
- /* almost unloop */
- stackDrop(pVM->rStack, 2);
- /* exit */
- vmPopIP(pVM);
- return;
-}
-
-
-static void unloopCo(FICL_VM *pVM)
-{
- stackDrop(pVM->rStack, 3);
- return;
-}
-
-
-static void loopCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pLoopParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pLoopParen));
- resolveBackBranch(dp, pVM, doTag);
- resolveAbsBranch(dp, pVM, leaveTag);
- return;
-}
-
-
-static void plusLoopCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pPLoopParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pPLoopParen));
- resolveBackBranch(dp, pVM, doTag);
- resolveAbsBranch(dp, pVM, leaveTag);
- return;
-}
-
-
-static void loopParen(FICL_VM *pVM)
-{
- INT32 index = stackGetTop(pVM->rStack).i;
- INT32 limit = stackFetch(pVM->rStack, 1).i;
-
- index++;
-
- if (index >= limit)
- {
- stackDrop(pVM->rStack, 3); /* nuke the loop indices & "leave" addr */
- vmBranchRelative(pVM, 1); /* fall through the loop */
- }
- else
- { /* update index, branch to loop head */
- stackSetTop(pVM->rStack, LVALUEtoCELL(index));
- vmBranchRelative(pVM, *(int *)(pVM->ip));
- }
-
- return;
-}
-
-
-static void plusLoopParen(FICL_VM *pVM)
-{
- INT32 index = stackGetTop(pVM->rStack).i;
- INT32 limit = stackFetch(pVM->rStack, 1).i;
- INT32 increment = stackPop(pVM->pStack).i;
- int flag;
-
- index += increment;
-
- if (increment < 0)
- flag = (index < limit);
- else
- flag = (index >= limit);
-
- if (flag)
- {
- stackDrop(pVM->rStack, 3); /* nuke the loop indices & "leave" addr */
- vmBranchRelative(pVM, 1); /* fall through the loop */
- }
- else
- { /* update index, branch to loop head */
- stackSetTop(pVM->rStack, LVALUEtoCELL(index));
- vmBranchRelative(pVM, *(int *)(pVM->ip));
- }
-
- return;
-}
-
-
-static void loopICo(FICL_VM *pVM)
-{
- CELL index = stackGetTop(pVM->rStack);
- stackPush(pVM->pStack, index);
-
- return;
-}
-
-
-static void loopJCo(FICL_VM *pVM)
-{
- CELL index = stackFetch(pVM->rStack, 3);
- stackPush(pVM->pStack, index);
-
- return;
-}
-
-
-static void loopKCo(FICL_VM *pVM)
-{
- CELL index = stackFetch(pVM->rStack, 6);
- stackPush(pVM->pStack, index);
-
- return;
-}
-
-
-/**************************************************************************
- r e t u r n s t a c k
-**
-**************************************************************************/
-
-static void toRStack(FICL_VM *pVM)
-{
- stackPush(pVM->rStack, stackPop(pVM->pStack));
- return;
-}
-
-static void fromRStack(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, stackPop(pVM->rStack));
- return;
-}
-
-static void fetchRStack(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, stackGetTop(pVM->rStack));
- return;
-}
-
-
-/**************************************************************************
- v a r i a b l e
-**
-**************************************************************************/
-
-static void variableParen(FICL_VM *pVM)
-{
- FICL_WORD *fw = pVM->runningWord;
- stackPushPtr(pVM->pStack, fw->param);
- return;
-}
-
-
-static void variable(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
- dictAppendWord2(dp, si, variableParen, FW_DEFAULT);
- dictAllotCells(dp, 1);
- return;
-}
-
-
-
-/**************************************************************************
- b a s e & f r i e n d s
-**
-**************************************************************************/
-
-static void base(FICL_VM *pVM)
-{
- CELL *pBase = (CELL *)(&pVM->base);
- stackPush(pVM->pStack, LVALUEtoCELL(pBase));
- return;
-}
-
-
-static void decimal(FICL_VM *pVM)
-{
- pVM->base = 10;
- return;
-}
-
-
-static void hex(FICL_VM *pVM)
-{
- pVM->base = 16;
- return;
-}
-
-
-/**************************************************************************
- a l l o t & f r i e n d s
-**
-**************************************************************************/
-
-static void allot(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- INT32 i = stackPopINT32(pVM->pStack);
-#if FICL_ROBUST
- dictCheck(dp, pVM, i);
-#endif
- dictAllot(dp, i);
- return;
-}
-
-
-static void here(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- stackPushPtr(pVM->pStack, dp->here);
- return;
-}
-
-
-static void comma(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- CELL c = stackPop(pVM->pStack);
- dictAppendCell(dp, c);
- return;
-}
-
-
-static void cComma(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- char c = (char)stackPopINT32(pVM->pStack);
- dictAppendChar(dp, c);
- return;
-}
-
-
-static void cells(FICL_VM *pVM)
-{
- INT32 i = stackPopINT32(pVM->pStack);
- stackPushINT32(pVM->pStack, i * (INT32)sizeof (CELL));
- return;
-}
-
-
-static void cellPlus(FICL_VM *pVM)
-{
- char *cp = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, cp + sizeof (CELL));
- return;
-}
-
-
-/**************************************************************************
- t i c k
-** tick CORE ( "<spaces>name" -- xt )
-** Skip leading space delimiters. Parse name delimited by a space. Find
-** name and return xt, the execution token for name. An ambiguous condition
-** exists if name is not found.
-**************************************************************************/
-static void tick(FICL_VM *pVM)
-{
- FICL_WORD *pFW = NULL;
- STRINGINFO si = vmGetWord(pVM);
-
- pFW = dictLookup(ficlGetDict(), si);
- if (!pFW)
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
- stackPushPtr(pVM->pStack, pFW);
- return;
-}
-
-
-static void bracketTickCoIm(FICL_VM *pVM)
-{
- tick(pVM);
- literalIm(pVM);
-
- return;
-}
-
-
-/**************************************************************************
- p o s t p o n e
-** Lookup the next word in the input stream and compile code to
-** insert it into definitions created by the resulting word
-** (defers compilation, even of immediate words)
-**************************************************************************/
-
-static void postponeCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *pFW;
- assert(pComma);
-
- tick(pVM);
- pFW = stackGetTop(pVM->pStack).p;
- if (wordIsImmediate(pFW))
- {
- dictAppendCell(dp, stackPop(pVM->pStack));
- }
- else
- {
- literalIm(pVM);
- dictAppendCell(dp, LVALUEtoCELL(pComma));
- }
-
- return;
-}
-
-
-
-/**************************************************************************
- e x e c u t e
-** Pop an execution token (pointer to a word) off the stack and
-** run it
-**************************************************************************/
-
-static void execute(FICL_VM *pVM)
-{
- FICL_WORD *pFW;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
-
- pFW = stackPopPtr(pVM->pStack);
- vmExecute(pVM, pFW);
-
- return;
-}
-
-
-/**************************************************************************
- i m m e d i a t e
-** Make the most recently compiled word IMMEDIATE -- it executes even
-** in compile state (most often used for control compiling words
-** such as IF, THEN, etc)
-**************************************************************************/
-
-static void immediate(FICL_VM *pVM)
-{
- IGNORE(pVM);
- dictSetImmediate(ficlGetDict());
- return;
-}
-
-
-static void compileOnly(FICL_VM *pVM)
-{
- IGNORE(pVM);
- dictSetFlags(ficlGetDict(), FW_COMPILE, 0);
- return;
-}
-
-
-/**************************************************************************
- d o t Q u o t e
-** IMMEDIATE word that compiles a string literal for later display
-** Compile stringLit, then copy the bytes of the string from the TIB
-** to the dictionary. Backpatch the count byte and align the dictionary.
-**
-** stringlit: Fetch the count from the dictionary, then push the address
-** and count on the stack. Finally, update ip to point to the first
-** aligned address after the string text.
-**************************************************************************/
-
-static void stringLit(FICL_VM *pVM)
-{
- FICL_STRING *sp = (FICL_STRING *)(pVM->ip);
- FICL_COUNT count = sp->count;
- char *cp = sp->text;
- stackPushPtr(pVM->pStack, cp);
- stackPushUNS32(pVM->pStack, count);
- cp += count + 1;
- cp = alignPtr(cp);
- pVM->ip = (IPTYPE)(void *)cp;
- return;
-}
-
-static void dotQuoteCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- dictAppendCell(dp, LVALUEtoCELL(pStringLit));
- dp->here = PTRtoCELL vmGetString(pVM, (FICL_STRING *)dp->here, '\"');
- dictAlign(dp);
- dictAppendCell(dp, LVALUEtoCELL(pType));
- return;
-}
-
-
-static void dotParen(FICL_VM *pVM)
-{
- char *pSrc = vmGetInBuf(pVM);
- char *pDest = pVM->pad;
- char ch;
-
- pSrc = skipSpace(pSrc);
-
- for (ch = *pSrc; (ch != '\0') && (ch != ')'); ch = *++pSrc)
- *pDest++ = ch;
-
- *pDest = '\0';
- if (ch == ')')
- pSrc++;
-
- vmTextOut(pVM, pVM->pad, 0);
- vmUpdateTib(pVM, pSrc);
-
- return;
-}
-
-
-/**************************************************************************
- s l i t e r a l
-** STRING
-** Interpretation: Interpretation semantics for this word are undefined.
-** Compilation: ( c-addr1 u -- )
-** Append the run-time semantics given below to the current definition.
-** Run-time: ( -- c-addr2 u )
-** Return c-addr2 u describing a string consisting of the characters
-** specified by c-addr1 u during compilation. A program shall not alter
-** the returned string.
-**************************************************************************/
-static void sLiteralCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- char *cp, *cpDest;
- UNS32 u;
- u = stackPopUNS32(pVM->pStack);
- cp = stackPopPtr(pVM->pStack);
-
- dictAppendCell(dp, LVALUEtoCELL(pStringLit));
- cpDest = (char *) dp->here;
- *cpDest++ = (char) u;
-
- for (; u > 0; --u)
- {
- *cpDest++ = *cp++;
- }
-
- *cpDest++ = 0;
- dp->here = PTRtoCELL alignPtr(cpDest);
- return;
-}
-
-
-/**************************************************************************
- s t a t e
-** Return the address of the VM's state member (must be sized the
-** same as a CELL for this reason)
-**************************************************************************/
-static void state(FICL_VM *pVM)
-{
- stackPushPtr(pVM->pStack, &pVM->state);
- return;
-}
-
-
-/**************************************************************************
- c r e a t e . . . d o e s >
-** Make a new word in the dictionary with the run-time effect of
-** a variable (push my address), but with extra space allotted
-** for use by does> .
-**************************************************************************/
-
-static void createParen(FICL_VM *pVM)
-{
- CELL *pCell = pVM->runningWord->param;
- stackPushPtr(pVM->pStack, pCell+1);
- return;
-}
-
-
-static void create(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
-
- dictAppendWord2(dp, si, createParen, FW_DEFAULT);
- dictAllotCells(dp, 1);
- return;
-}
-
-
-static void doDoes(FICL_VM *pVM)
-{
- CELL *pCell = pVM->runningWord->param;
- IPTYPE tempIP = (IPTYPE)((*pCell).p);
- stackPushPtr(pVM->pStack, pCell+1);
- vmPushIP(pVM, tempIP);
- return;
-}
-
-
-static void doesParen(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- dp->smudge->code = doDoes;
- dp->smudge->param[0] = LVALUEtoCELL(pVM->ip);
- vmPopIP(pVM);
- return;
-}
-
-
-static void doesCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-#if FICL_WANT_LOCALS
- assert(pUnLinkParen);
- if (nLocals > 0)
- {
- FICL_DICT *pLoc = ficlGetLoc();
- dictEmpty(pLoc, pLoc->pForthWords->size);
- dictAppendCell(dp, LVALUEtoCELL(pUnLinkParen));
- }
-
- nLocals = 0;
-#endif
- IGNORE(pVM);
-
- dictAppendCell(dp, LVALUEtoCELL(pDoesParen));
- return;
-}
-
-
-/**************************************************************************
- t o b o d y
-** to-body CORE ( xt -- a-addr )
-** a-addr is the data-field address corresponding to xt. An ambiguous
-** condition exists if xt is not for a word defined via CREATE.
-**************************************************************************/
-static void toBody(FICL_VM *pVM)
-{
- FICL_WORD *pFW = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, pFW->param + 1);
- return;
-}
-
-
-/*
-** from-body ficl ( a-addr -- xt )
-** Reverse effect of >body
-*/
-static void fromBody(FICL_VM *pVM)
-{
- char *ptr = (char *) stackPopPtr(pVM->pStack) - sizeof (FICL_WORD);
- stackPushPtr(pVM->pStack, ptr);
- return;
-}
-
-
-/*
-** >name ficl ( xt -- c-addr u )
-** Push the address and length of a word's name given its address
-** xt.
-*/
-static void toName(FICL_VM *pVM)
-{
- FICL_WORD *pFW = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, pFW->name);
- stackPushUNS32(pVM->pStack, pFW->nName);
- return;
-}
-
-
-/**************************************************************************
- l b r a c k e t e t c
-**
-**************************************************************************/
-
-static void lbracketCoIm(FICL_VM *pVM)
-{
- pVM->state = INTERPRET;
- return;
-}
-
-
-static void rbracket(FICL_VM *pVM)
-{
- pVM->state = COMPILE;
- return;
-}
-
-
-/**************************************************************************
- p i c t u r e d n u m e r i c w o r d s
-**
-** less-number-sign CORE ( -- )
-** Initialize the pictured numeric output conversion process.
-** (clear the pad)
-**************************************************************************/
-static void lessNumberSign(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- sp->count = 0;
- return;
-}
-
-/*
-** number-sign CORE ( ud1 -- ud2 )
-** Divide ud1 by the number in BASE giving the quotient ud2 and the remainder
-** n. (n is the least-significant digit of ud1.) Convert n to external form
-** and add the resulting character to the beginning of the pictured numeric
-** output string. An ambiguous condition exists if # executes outside of a
-** <# #> delimited number conversion.
-*/
-static void numberSign(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- UNS64 u;
- UNS16 rem;
-
- u = u64Pop(pVM->pStack);
- rem = m64UMod(&u, (UNS16)(pVM->base));
- sp->text[sp->count++] = digit_to_char(rem);
- u64Push(pVM->pStack, u);
- return;
-}
-
-/*
-** number-sign-greater CORE ( xd -- c-addr u )
-** Drop xd. Make the pictured numeric output string available as a character
-** string. c-addr and u specify the resulting character string. A program
-** may replace characters within the string.
-*/
-static void numberSignGreater(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- sp->text[sp->count] = '\0';
- strrev(sp->text);
- stackDrop(pVM->pStack, 2);
- stackPushPtr(pVM->pStack, sp->text);
- stackPushUNS32(pVM->pStack, sp->count);
- return;
-}
-
-/*
-** number-sign-s CORE ( ud1 -- ud2 )
-** Convert one digit of ud1 according to the rule for #. Continue conversion
-** until the quotient is zero. ud2 is zero. An ambiguous condition exists if
-** #S executes outside of a <# #> delimited number conversion.
-** TO DO: presently does not use ud1 hi cell - use it!
-*/
-static void numberSignS(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- UNS64 u;
- UNS16 rem;
-
- u = u64Pop(pVM->pStack);
-
- do
- {
- rem = m64UMod(&u, (UNS16)(pVM->base));
- sp->text[sp->count++] = digit_to_char(rem);
- }
- while (u.hi || u.lo);
-
- u64Push(pVM->pStack, u);
- return;
-}
-
-/*
-** HOLD CORE ( char -- )
-** Add char to the beginning of the pictured numeric output string. An ambiguous
-** condition exists if HOLD executes outside of a <# #> delimited number conversion.
-*/
-static void hold(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- int i = stackPopINT32(pVM->pStack);
- sp->text[sp->count++] = (char) i;
- return;
-}
-
-/*
-** SIGN CORE ( n -- )
-** If n is negative, add a minus sign to the beginning of the pictured
-** numeric output string. An ambiguous condition exists if SIGN
-** executes outside of a <# #> delimited number conversion.
-*/
-static void sign(FICL_VM *pVM)
-{
- FICL_STRING *sp = PTRtoSTRING pVM->pad;
- int i = stackPopINT32(pVM->pStack);
- if (i < 0)
- sp->text[sp->count++] = '-';
- return;
-}
-
-
-/**************************************************************************
- t o N u m b e r
-** to-number CORE ( ud1 c-addr1 u1 -- ud2 c-addr2 u2 )
-** ud2 is the unsigned result of converting the characters within the
-** string specified by c-addr1 u1 into digits, using the number in BASE,
-** and adding each into ud1 after multiplying ud1 by the number in BASE.
-** Conversion continues left-to-right until a character that is not
-** convertible, including any + or -, is encountered or the string is
-** entirely converted. c-addr2 is the location of the first unconverted
-** character or the first character past the end of the string if the string
-** was entirely converted. u2 is the number of unconverted characters in the
-** string. An ambiguous condition exists if ud2 overflows during the
-** conversion.
-** TO DO: presently does not use ud1 hi cell - use it!
-**************************************************************************/
-static void toNumber(FICL_VM *pVM)
-{
- UNS32 count = stackPopUNS32(pVM->pStack);
- char *cp = (char *)stackPopPtr(pVM->pStack);
- UNS64 accum;
- UNS32 base = pVM->base;
- UNS32 ch;
- UNS32 digit;
-
- accum = u64Pop(pVM->pStack);
-
- for (ch = *cp; count > 0; ch = *++cp, count--)
- {
- if (ch < '0')
- break;
-
- digit = ch - '0';
-
- if (digit > 9)
- digit = tolower(ch) - 'a' + 10;
- /*
- ** Note: following test also catches chars between 9 and a
- ** because 'digit' is unsigned!
- */
- if (digit >= base)
- break;
-
- accum = m64Mac(accum, base, digit);
- }
-
- u64Push(pVM->pStack, accum);
- stackPushPtr (pVM->pStack, cp);
- stackPushUNS32(pVM->pStack, count);
-
- return;
-}
-
-
-
-/**************************************************************************
- q u i t & a b o r t
-** quit CORE ( -- ) ( R: i*x -- )
-** Empty the return stack, store zero in SOURCE-ID if it is present, make
-** the user input device the input source, and enter interpretation state.
-** Do not display a message. Repeat the following:
-**
-** Accept a line from the input source into the input buffer, set >IN to
-** zero, and interpret.
-** Display the implementation-defined system prompt if in
-** interpretation state, all processing has been completed, and no
-** ambiguous condition exists.
-**************************************************************************/
-
-static void quit(FICL_VM *pVM)
-{
- vmThrow(pVM, VM_QUIT);
- return;
-}
-
-
-static void ficlAbort(FICL_VM *pVM)
-{
- vmThrow(pVM, VM_ERREXIT);
- return;
-}
-
-
-/**************************************************************************
- a c c e p t
-** accept CORE ( c-addr +n1 -- +n2 )
-** Receive a string of at most +n1 characters. An ambiguous condition
-** exists if +n1 is zero or greater than 32,767. Display graphic characters
-** as they are received. A program that depends on the presence or absence
-** of non-graphic characters in the string has an environmental dependency.
-** The editing functions, if any, that the system performs in order to
-** construct the string are implementation-defined.
-**
-** (Although the standard text doesn't say so, I assume that the intent
-** of 'accept' is to store the string at the address specified on
-** the stack.)
-** Implementation: if there's more text in the TIB, use it. Otherwise
-** throw out for more text. Copy characters up to the max count into the
-** address given, and return the number of actual characters copied.
-**************************************************************************/
-static void accept(FICL_VM *pVM)
-{
- UNS32 count, len;
- char *cp;
- char *pBuf = vmGetInBuf(pVM);
-
- len = strlen(pBuf);
- if (len == 0)
- vmThrow(pVM, VM_RESTART);
- /* OK - now we have something in the text buffer - use it */
- count = stackPopUNS32(pVM->pStack);
- cp = stackPopPtr(pVM->pStack);
-
- strncpy(cp, vmGetInBuf(pVM), count);
- len = (count < len) ? count : len;
- pBuf += len;
- vmUpdateTib(pVM, pBuf);
- stackPushUNS32(pVM->pStack, len);
-
- return;
-}
-
-
-/**************************************************************************
- a l i g n
-** 6.1.0705 ALIGN CORE ( -- )
-** If the data-space pointer is not aligned, reserve enough space to
-** align it.
-**************************************************************************/
-static void align(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- IGNORE(pVM);
- dictAlign(dp);
- return;
-}
-
-
-/**************************************************************************
- a l i g n e d
-**
-**************************************************************************/
-static void aligned(FICL_VM *pVM)
-{
- void *addr = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, alignPtr(addr));
- return;
-}
-
-
-/**************************************************************************
- b e g i n & f r i e n d s
-** Indefinite loop control structures
-** A.6.1.0760 BEGIN
-** Typical use:
-** : X ... BEGIN ... test UNTIL ;
-** or
-** : X ... BEGIN ... test WHILE ... REPEAT ;
-**************************************************************************/
-static void beginCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- markBranch(dp, pVM, beginTag);
- return;
-}
-
-static void untilCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pIfParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pIfParen));
- resolveBackBranch(dp, pVM, beginTag);
- return;
-}
-
-static void whileCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pIfParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pIfParen));
- markBranch(dp, pVM, whileTag);
- twoSwap(pVM);
- dictAppendUNS32(dp, 1);
- return;
-}
-
-static void repeatCoIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- assert(pBranchParen);
- dictAppendCell(dp, LVALUEtoCELL(pBranchParen));
-
- /* expect "begin" branch marker */
- resolveBackBranch(dp, pVM, beginTag);
- /* expect "while" branch marker */
- resolveForwardBranch(dp, pVM, whileTag);
- return;
-}
-
-
-/**************************************************************************
- c h a r & f r i e n d s
-** 6.1.0895 CHAR CORE ( "<spaces>name" -- char )
-** Skip leading space delimiters. Parse name delimited by a space.
-** Put the value of its first character onto the stack.
-**
-** bracket-char CORE
-** Interpretation: Interpretation semantics for this word are undefined.
-** Compilation: ( "<spaces>name" -- )
-** Skip leading space delimiters. Parse name delimited by a space.
-** Append the run-time semantics given below to the current definition.
-** Run-time: ( -- char )
-** Place char, the value of the first character of name, on the stack.
-**************************************************************************/
-static void ficlChar(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord(pVM);
- stackPushUNS32(pVM->pStack, (UNS32)(si.cp[0]));
-
- return;
-}
-
-static void charCoIm(FICL_VM *pVM)
-{
- ficlChar(pVM);
- literalIm(pVM);
- return;
-}
-
-/**************************************************************************
- c h a r P l u s
-** char-plus CORE ( c-addr1 -- c-addr2 )
-** Add the size in address units of a character to c-addr1, giving c-addr2.
-**************************************************************************/
-static void charPlus(FICL_VM *pVM)
-{
- char *cp = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, cp + 1);
- return;
-}
-
-/**************************************************************************
- c h a r s
-** chars CORE ( n1 -- n2 )
-** n2 is the size in address units of n1 characters.
-** For most processors, this function can be a no-op. To guarantee
-** portability, we'll multiply by sizeof (char).
-**************************************************************************/
-#if defined (_M_IX86)
-#pragma warning(disable: 4127)
-#endif
-static void ficlChars(FICL_VM *pVM)
-{
- if (sizeof (char) > 1)
- {
- INT32 i = stackPopINT32(pVM->pStack);
- stackPushINT32(pVM->pStack, i * sizeof (char));
- }
- /* otherwise no-op! */
- return;
-}
-#if defined (_M_IX86)
-#pragma warning(default: 4127)
-#endif
-
-
-/**************************************************************************
- c o u n t
-** COUNT CORE ( c-addr1 -- c-addr2 u )
-** Return the character string specification for the counted string stored
-** at c-addr1. c-addr2 is the address of the first character after c-addr1.
-** u is the contents of the character at c-addr1, which is the length in
-** characters of the string at c-addr2.
-**************************************************************************/
-static void count(FICL_VM *pVM)
-{
- FICL_STRING *sp = stackPopPtr(pVM->pStack);
- stackPushPtr(pVM->pStack, sp->text);
- stackPushUNS32(pVM->pStack, sp->count);
- return;
-}
-
-/**************************************************************************
- e n v i r o n m e n t ?
-** environment-query CORE ( c-addr u -- false | i*x true )
-** c-addr is the address of a character string and u is the string's
-** character count. u may have a value in the range from zero to an
-** implementation-defined maximum which shall not be less than 31. The
-** character string should contain a keyword from 3.2.6 Environmental
-** queries or the optional word sets to be checked for correspondence
-** with an attribute of the present environment. If the system treats the
-** attribute as unknown, the returned flag is false; otherwise, the flag
-** is true and the i*x returned is of the type specified in the table for
-** the attribute queried.
-**************************************************************************/
-static void environmentQ(FICL_VM *pVM)
-{
- FICL_DICT *envp = ficlGetEnv();
- FICL_COUNT len = (FICL_COUNT)stackPopUNS32(pVM->pStack);
- char *cp = stackPopPtr(pVM->pStack);
- FICL_WORD *pFW;
- STRINGINFO si;
-
- SI_PSZ(si, cp);
- pFW = dictLookup(envp, si);
-
- if (pFW != NULL)
- {
- vmExecute(pVM, pFW);
- stackPushINT32(pVM->pStack, FICL_TRUE);
- }
- else
- {
- stackPushINT32(pVM->pStack, FICL_FALSE);
- }
-
- return;
-}
-
-/**************************************************************************
- e v a l u a t e
-** EVALUATE CORE ( i*x c-addr u -- j*x )
-** Save the current input source specification. Store minus-one (-1) in
-** SOURCE-ID if it is present. Make the string described by c-addr and u
-** both the input source and input buffer, set >IN to zero, and interpret.
-** When the parse area is empty, restore the prior input source
-** specification. Other stack effects are due to the words EVALUATEd.
-**
-** DEFICIENCY: this version does not handle errors or restarts.
-**************************************************************************/
-static void evaluate(FICL_VM *pVM)
-{
- UNS32 count = stackPopUNS32(pVM->pStack);
- char *cp = stackPopPtr(pVM->pStack);
- CELL id;
-
- IGNORE(count);
- id = pVM->sourceID;
- pVM->sourceID.i = -1;
- vmPushIP(pVM, &pInterpret);
- ficlExec(pVM, cp);
- vmPopIP(pVM);
- pVM->sourceID = id;
- return;
-}
-
-
-/**************************************************************************
- s t r i n g q u o t e
-** Intrpreting: get string delimited by a quote from the input stream,
-** copy to a scratch area, and put its count and address on the stack.
-** Compiling: compile code to push the address and count of a string
-** literal, compile the string from the input stream, and align the dict
-** pointer.
-**************************************************************************/
-static void stringQuoteIm(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- if (pVM->state == INTERPRET)
- {
- FICL_STRING *sp = (FICL_STRING *) dp->here;
- vmGetString(pVM, sp, '\"');
- stackPushPtr(pVM->pStack, sp->text);
- stackPushUNS32(pVM->pStack, sp->count);
- }
- else /* COMPILE state */
- {
- dictAppendCell(dp, LVALUEtoCELL(pStringLit));
- dp->here = PTRtoCELL vmGetString(pVM, (FICL_STRING *)dp->here, '\"');
- dictAlign(dp);
- }
-
- return;
-}
-
-/**************************************************************************
- t y p e
-** Pop count and char address from stack and print the designated string.
-**************************************************************************/
-static void type(FICL_VM *pVM)
-{
- UNS32 count = stackPopUNS32(pVM->pStack);
- char *cp = stackPopPtr(pVM->pStack);
-
- /*
- ** Since we don't have an output primitive for a counted string
- ** (oops), make sure the string is null terminated. If not, copy
- ** and terminate it.
- */
- /* XXX Uses free space on top of dictionary. Is it guaranteed
- * XXX to always fit? (abial)
- */
- if (cp[count] != '\0')
- {
- char *pDest = (char *)ficlGetDict()->here;
- if (cp != pDest)
- strncpy(pDest, cp, count);
-
- pDest[count] = '\0';
- cp = pDest;
- }
-
- vmTextOut(pVM, cp, 0);
- return;
-}
-
-/**************************************************************************
- w o r d
-** word CORE ( char "<chars>ccc<char>" -- c-addr )
-** Skip leading delimiters. Parse characters ccc delimited by char. An
-** ambiguous condition exists if the length of the parsed string is greater
-** than the implementation-defined length of a counted string.
-**
-** c-addr is the address of a transient region containing the parsed word
-** as a counted string. If the parse area was empty or contained no
-** characters other than the delimiter, the resulting string has a zero
-** length. A space, not included in the length, follows the string. A
-** program may replace characters within the string.
-** NOTE! Ficl also NULL-terminates the dest string.
-**************************************************************************/
-static void ficlWord(FICL_VM *pVM)
-{
- FICL_STRING *sp = (FICL_STRING *)pVM->pad;
- char delim = (char)stackPopINT32(pVM->pStack);
- STRINGINFO si;
-
- si = vmParseString(pVM, delim);
-
- if (SI_COUNT(si) > nPAD-1)
- SI_SETLEN(si, nPAD-1);
-
- sp->count = (FICL_COUNT)SI_COUNT(si);
- strncpy(sp->text, SI_PTR(si), SI_COUNT(si));
- strcat(sp->text, " ");
-
- stackPushPtr(pVM->pStack, sp);
- return;
-}
-
-
-/**************************************************************************
- p a r s e - w o r d
-** ficl PARSE-WORD ( <spaces>name -- c-addr u )
-** Skip leading spaces and parse name delimited by a space. c-addr is the
-** address within the input buffer and u is the length of the selected
-** string. If the parse area is empty, the resulting string has a zero length.
-**************************************************************************/
-static void parseNoCopy(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord0(pVM);
- stackPushPtr(pVM->pStack, SI_PTR(si));
- stackPushUNS32(pVM->pStack, SI_COUNT(si));
- return;
-}
-
-
-/**************************************************************************
- p a r s e
-** CORE EXT ( char "ccc<char>" -- c-addr u )
-** Parse ccc delimited by the delimiter char.
-** c-addr is the address (within the input buffer) and u is the length of
-** the parsed string. If the parse area was empty, the resulting string has
-** a zero length.
-** NOTE! PARSE differs from WORD: it does not skip leading delimiters.
-**************************************************************************/
-static void parse(FICL_VM *pVM)
-{
- char *pSrc = vmGetInBuf(pVM);
- char *cp;
- UNS32 count;
- char delim = (char)stackPopINT32(pVM->pStack);
-
- cp = pSrc; /* mark start of text */
-
- while ((*pSrc != delim) && (*pSrc != '\0'))
- pSrc++; /* find next delimiter or end */
-
- count = pSrc - cp; /* set length of result */
-
- if (*pSrc == delim) /* gobble trailing delimiter */
- pSrc++;
-
- vmUpdateTib(pVM, pSrc);
- stackPushPtr(pVM->pStack, cp);
- stackPushUNS32(pVM->pStack, count);
- return;
-}
-
-
-/**************************************************************************
- f i l l
-** CORE ( c-addr u char -- )
-** If u is greater than zero, store char in each of u consecutive
-** characters of memory beginning at c-addr.
-**************************************************************************/
-static void fill(FICL_VM *pVM)
-{
- char ch = (char)stackPopINT32(pVM->pStack);
- UNS32 u = stackPopUNS32(pVM->pStack);
- char *cp = (char *)stackPopPtr(pVM->pStack);
-
- while (u > 0)
- {
- *cp++ = ch;
- u--;
- }
-
- return;
-}
-
-
-/**************************************************************************
- f i n d
-** FIND CORE ( c-addr -- c-addr 0 | xt 1 | xt -1 )
-** Find the definition named in the counted string at c-addr. If the
-** definition is not found, return c-addr and zero. If the definition is
-** found, return its execution token xt. If the definition is immediate,
-** also return one (1), otherwise also return minus-one (-1). For a given
-** string, the values returned by FIND while compiling may differ from
-** those returned while not compiling.
-**************************************************************************/
-static void find(FICL_VM *pVM)
-{
- FICL_STRING *sp = stackPopPtr(pVM->pStack);
- FICL_WORD *pFW;
- STRINGINFO si;
-
- SI_PFS(si, sp);
- pFW = dictLookup(ficlGetDict(), si);
- if (pFW)
- {
- stackPushPtr(pVM->pStack, pFW);
- stackPushINT32(pVM->pStack, (wordIsImmediate(pFW) ? 1 : -1));
- }
- else
- {
- stackPushPtr(pVM->pStack, sp);
- stackPushUNS32(pVM->pStack, 0);
- }
- return;
-}
-
-
-/**************************************************************************
- f m S l a s h M o d
-** f-m-slash-mod CORE ( d1 n1 -- n2 n3 )
-** Divide d1 by n1, giving the floored quotient n3 and the remainder n2.
-** Input and output stack arguments are signed. An ambiguous condition
-** exists if n1 is zero or if the quotient lies outside the range of a
-** single-cell signed integer.
-**************************************************************************/
-static void fmSlashMod(FICL_VM *pVM)
-{
- INT64 d1;
- INT32 n1;
- INTQR qr;
-
- n1 = stackPopINT32(pVM->pStack);
- d1 = i64Pop(pVM->pStack);
- qr = m64FlooredDivI(d1, n1);
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-
-/**************************************************************************
- s m S l a s h R e m
-** s-m-slash-rem CORE ( d1 n1 -- n2 n3 )
-** Divide d1 by n1, giving the symmetric quotient n3 and the remainder n2.
-** Input and output stack arguments are signed. An ambiguous condition
-** exists if n1 is zero or if the quotient lies outside the range of a
-** single-cell signed integer.
-**************************************************************************/
-static void smSlashRem(FICL_VM *pVM)
-{
- INT64 d1;
- INT32 n1;
- INTQR qr;
-
- n1 = stackPopINT32(pVM->pStack);
- d1 = i64Pop(pVM->pStack);
- qr = m64SymmetricDivI(d1, n1);
- stackPushINT32(pVM->pStack, qr.rem);
- stackPushINT32(pVM->pStack, qr.quot);
- return;
-}
-
-
-static void ficlMod(FICL_VM *pVM)
-{
- INT64 d1;
- INT32 n1;
- INTQR qr;
-
- n1 = stackPopINT32(pVM->pStack);
- d1.lo = stackPopINT32(pVM->pStack);
- i64Extend(d1);
- qr = m64SymmetricDivI(d1, n1);
- stackPushINT32(pVM->pStack, qr.rem);
- return;
-}
-
-
-/**************************************************************************
- u m S l a s h M o d
-** u-m-slash-mod CORE ( ud u1 -- u2 u3 )
-** Divide ud by u1, giving the quotient u3 and the remainder u2.
-** All values and arithmetic are unsigned. An ambiguous condition
-** exists if u1 is zero or if the quotient lies outside the range of a
-** single-cell unsigned integer.
-*************************************************************************/
-static void umSlashMod(FICL_VM *pVM)
-{
- UNS64 ud;
- UNS32 u1;
- UNSQR qr;
-
- u1 = stackPopUNS32(pVM->pStack);
- ud = u64Pop(pVM->pStack);
- qr = ficlLongDiv(ud, u1);
- stackPushUNS32(pVM->pStack, qr.rem);
- stackPushUNS32(pVM->pStack, qr.quot);
- return;
-}
-
-
-/**************************************************************************
- l s h i f t
-** l-shift CORE ( x1 u -- x2 )
-** Perform a logical left shift of u bit-places on x1, giving x2.
-** Put zeroes into the least significant bits vacated by the shift.
-** An ambiguous condition exists if u is greater than or equal to the
-** number of bits in a cell.
-**
-** r-shift CORE ( x1 u -- x2 )
-** Perform a logical right shift of u bit-places on x1, giving x2.
-** Put zeroes into the most significant bits vacated by the shift. An
-** ambiguous condition exists if u is greater than or equal to the
-** number of bits in a cell.
-**************************************************************************/
-static void lshift(FICL_VM *pVM)
-{
- UNS32 nBits = stackPopUNS32(pVM->pStack);
- UNS32 x1 = stackPopUNS32(pVM->pStack);
-
- stackPushUNS32(pVM->pStack, x1 << nBits);
- return;
-}
-
-
-static void rshift(FICL_VM *pVM)
-{
- UNS32 nBits = stackPopUNS32(pVM->pStack);
- UNS32 x1 = stackPopUNS32(pVM->pStack);
-
- stackPushUNS32(pVM->pStack, x1 >> nBits);
- return;
-}
-
-
-/**************************************************************************
- m S t a r
-** m-star CORE ( n1 n2 -- d )
-** d is the signed product of n1 times n2.
-**************************************************************************/
-static void mStar(FICL_VM *pVM)
-{
- INT32 n2 = stackPopINT32(pVM->pStack);
- INT32 n1 = stackPopINT32(pVM->pStack);
- INT64 d;
-
- d = m64MulI(n1, n2);
- i64Push(pVM->pStack, d);
- return;
-}
-
-
-static void umStar(FICL_VM *pVM)
-{
- UNS32 u2 = stackPopUNS32(pVM->pStack);
- UNS32 u1 = stackPopUNS32(pVM->pStack);
- UNS64 ud;
-
- ud = ficlLongMul(u1, u2);
- u64Push(pVM->pStack, ud);
- return;
-}
-
-
-/**************************************************************************
- m a x & m i n
-**
-**************************************************************************/
-static void ficlMax(FICL_VM *pVM)
-{
- INT32 n2 = stackPopINT32(pVM->pStack);
- INT32 n1 = stackPopINT32(pVM->pStack);
-
- stackPushINT32(pVM->pStack, (n1 > n2) ? n1 : n2);
- return;
-}
-
-static void ficlMin(FICL_VM *pVM)
-{
- INT32 n2 = stackPopINT32(pVM->pStack);
- INT32 n1 = stackPopINT32(pVM->pStack);
-
- stackPushINT32(pVM->pStack, (n1 < n2) ? n1 : n2);
- return;
-}
-
-
-/**************************************************************************
- m o v e
-** CORE ( addr1 addr2 u -- )
-** If u is greater than zero, copy the contents of u consecutive address
-** units at addr1 to the u consecutive address units at addr2. After MOVE
-** completes, the u consecutive address units at addr2 contain exactly
-** what the u consecutive address units at addr1 contained before the move.
-** NOTE! This implementation assumes that a char is the same size as
-** an address unit.
-**************************************************************************/
-static void move(FICL_VM *pVM)
-{
- UNS32 u = stackPopUNS32(pVM->pStack);
- char *addr2 = stackPopPtr(pVM->pStack);
- char *addr1 = stackPopPtr(pVM->pStack);
-
- if (u == 0)
- return;
- /*
- ** Do the copy carefully, so as to be
- ** correct even if the two ranges overlap
- */
- if (addr1 >= addr2)
- {
- for (; u > 0; u--)
- *addr2++ = *addr1++;
- }
- else
- {
- addr2 += u-1;
- addr1 += u-1;
- for (; u > 0; u--)
- *addr2-- = *addr1--;
- }
-
- return;
-}
-
-
-/**************************************************************************
- r e c u r s e
-**
-**************************************************************************/
-static void recurseCoIm(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
-
- IGNORE(pVM);
- dictAppendCell(pDict, LVALUEtoCELL(pDict->smudge));
- return;
-}
-
-
-/**************************************************************************
- s t o d
-** s-to-d CORE ( n -- d )
-** Convert the number n to the double-cell number d with the same
-** numerical value.
-**************************************************************************/
-static void sToD(FICL_VM *pVM)
-{
- INT32 s = stackPopINT32(pVM->pStack);
-
- /* sign extend to 64 bits.. */
- stackPushINT32(pVM->pStack, s);
- stackPushINT32(pVM->pStack, (s < 0) ? -1 : 0);
- return;
-}
-
-
-/**************************************************************************
- s o u r c e
-** CORE ( -- c-addr u )
-** c-addr is the address of, and u is the number of characters in, the
-** input buffer.
-**************************************************************************/
-static void source(FICL_VM *pVM)
-{
- stackPushPtr(pVM->pStack, pVM->tib.cp);
- stackPushINT32(pVM->pStack, strlen(pVM->tib.cp));
- return;
-}
-
-
-/**************************************************************************
- v e r s i o n
-** non-standard...
-**************************************************************************/
-static void ficlVersion(FICL_VM *pVM)
-{
- vmTextOut(pVM, "ficl Version " FICL_VER, 1);
- return;
-}
-
-
-/**************************************************************************
- t o I n
-** to-in CORE
-**************************************************************************/
-static void toIn(FICL_VM *pVM)
-{
- stackPushPtr(pVM->pStack, &pVM->tib.index);
- return;
-}
-
-
-/**************************************************************************
- d e f i n i t i o n s
-** SEARCH ( -- )
-** Make the compilation word list the same as the first word list in the
-** search order. Specifies that the names of subsequent definitions will
-** be placed in the compilation word list. Subsequent changes in the search
-** order will not affect the compilation word list.
-**************************************************************************/
-static void definitions(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
-
- assert(pDict);
- if (pDict->nLists < 1)
- {
- vmThrowErr(pVM, "DEFINITIONS error - empty search order");
- }
-
- pDict->pCompile = pDict->pSearch[pDict->nLists-1];
- return;
-}
-
-
-/**************************************************************************
- f o r t h - w o r d l i s t
-** SEARCH ( -- wid )
-** Return wid, the identifier of the word list that includes all standard
-** words provided by the implementation. This word list is initially the
-** compilation word list and is part of the initial search order.
-**************************************************************************/
-static void forthWordlist(FICL_VM *pVM)
-{
- FICL_HASH *pHash = ficlGetDict()->pForthWords;
- stackPushPtr(pVM->pStack, pHash);
- return;
-}
-
-
-/**************************************************************************
- g e t - c u r r e n t
-** SEARCH ( -- wid )
-** Return wid, the identifier of the compilation word list.
-**************************************************************************/
-static void getCurrent(FICL_VM *pVM)
-{
- ficlLockDictionary(TRUE);
- stackPushPtr(pVM->pStack, ficlGetDict()->pCompile);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- g e t - o r d e r
-** SEARCH ( -- widn ... wid1 n )
-** Returns the number of word lists n in the search order and the word list
-** identifiers widn ... wid1 identifying these word lists. wid1 identifies
-** the word list that is searched first, and widn the word list that is
-** searched last. The search order is unaffected.
-**************************************************************************/
-static void getOrder(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
- int nLists = pDict->nLists;
- int i;
-
- ficlLockDictionary(TRUE);
- for (i = 0; i < nLists; i++)
- {
- stackPushPtr(pVM->pStack, pDict->pSearch[i]);
- }
-
- stackPushUNS32(pVM->pStack, nLists);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- s e a r c h - w o r d l i s t
-** SEARCH ( c-addr u wid -- 0 | xt 1 | xt -1 )
-** Find the definition identified by the string c-addr u in the word list
-** identified by wid. If the definition is not found, return zero. If the
-** definition is found, return its execution token xt and one (1) if the
-** definition is immediate, minus-one (-1) otherwise.
-**************************************************************************/
-static void searchWordlist(FICL_VM *pVM)
-{
- STRINGINFO si;
- UNS16 hashCode;
- FICL_WORD *pFW;
- FICL_HASH *pHash = stackPopPtr(pVM->pStack);
-
- si.count = (FICL_COUNT)stackPopUNS32(pVM->pStack);
- si.cp = stackPopPtr(pVM->pStack);
- hashCode = hashHashCode(si);
-
- ficlLockDictionary(TRUE);
- pFW = hashLookup(pHash, si, hashCode);
- ficlLockDictionary(FALSE);
-
- if (pFW)
- {
- stackPushPtr(pVM->pStack, pFW);
- stackPushINT32(pVM->pStack, (wordIsImmediate(pFW) ? 1 : -1));
- }
- else
- {
- stackPushUNS32(pVM->pStack, 0);
- }
-
- return;
-}
-
-
-/**************************************************************************
- s e t - c u r r e n t
-** SEARCH ( wid -- )
-** Set the compilation word list to the word list identified by wid.
-**************************************************************************/
-static void setCurrent(FICL_VM *pVM)
-{
- FICL_HASH *pHash = stackPopPtr(pVM->pStack);
- FICL_DICT *pDict = ficlGetDict();
- ficlLockDictionary(TRUE);
- pDict->pCompile = pHash;
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- s e t - o r d e r
-** SEARCH ( widn ... wid1 n -- )
-** Set the search order to the word lists identified by widn ... wid1.
-** Subsequently, word list wid1 will be searched first, and word list
-** widn searched last. If n is zero, empty the search order. If n is minus
-** one, set the search order to the implementation-defined minimum
-** search order. The minimum search order shall include the words
-** FORTH-WORDLIST and SET-ORDER. A system shall allow n to
-** be at least eight.
-**************************************************************************/
-static void setOrder(FICL_VM *pVM)
-{
- int i;
- int nLists = stackPopINT32(pVM->pStack);
- FICL_DICT *dp = ficlGetDict();
-
- if (nLists > FICL_DEFAULT_VOCS)
- {
- vmThrowErr(pVM, "set-order error: list would be too large");
- }
-
- ficlLockDictionary(TRUE);
-
- if (nLists >= 0)
- {
- dp->nLists = nLists;
- for (i = nLists-1; i >= 0; --i)
- {
- dp->pSearch[i] = stackPopPtr(pVM->pStack);
- }
- }
- else
- {
- dictResetSearchOrder(dp);
- }
-
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- w o r d l i s t
-** SEARCH ( -- wid )
-** Create a new empty word list, returning its word list identifier wid.
-** The new word list may be returned from a pool of preallocated word
-** lists or may be dynamically allocated in data space. A system shall
-** allow the creation of at least 8 new word lists in addition to any
-** provided as part of the system.
-** Notes:
-** 1. ficl creates a new single-list hash in the dictionary and returns
-** its address.
-** 2. ficl-wordlist takes an arg off the stack indicating the number of
-** hash entries in the wordlist. Ficl 2.02 and later define WORDLIST as
-** : wordlist 1 ficl-wordlist ;
-**************************************************************************/
-static void wordlist(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_HASH *pHash;
- UNS32 nBuckets;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- nBuckets = stackPopUNS32(pVM->pStack);
-
- dictAlign(dp);
- pHash = (FICL_HASH *)dp->here;
- dictAllot(dp, sizeof (FICL_HASH)
- + (nBuckets-1) * sizeof (FICL_WORD *));
-
- pHash->size = nBuckets;
- hashReset(pHash);
-
- stackPushPtr(pVM->pStack, pHash);
- return;
-}
-
-
-/**************************************************************************
- S E A R C H >
-** ficl ( -- wid )
-** Pop wid off the search order. Error if the search order is empty
-**************************************************************************/
-static void searchPop(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- int nLists;
-
- ficlLockDictionary(TRUE);
- nLists = dp->nLists;
- if (nLists == 0)
- {
- vmThrowErr(pVM, "search> error: empty search order");
- }
- stackPushPtr(pVM->pStack, dp->pSearch[--dp->nLists]);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- > S E A R C H
-** ficl ( wid -- )
-** Push wid onto the search order. Error if the search order is full.
-**************************************************************************/
-static void searchPush(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
-
- ficlLockDictionary(TRUE);
- if (dp->nLists > FICL_DEFAULT_VOCS)
- {
- vmThrowErr(pVM, ">search error: search order overflow");
- }
- dp->pSearch[dp->nLists++] = stackPopPtr(pVM->pStack);
- ficlLockDictionary(FALSE);
- return;
-}
-
-
-/**************************************************************************
- c o l o n N o N a m e
-** CORE EXT ( C: -- colon-sys ) ( S: -- xt )
-** Create an unnamed colon definition and push its address.
-** Change state to compile.
-**************************************************************************/
-static void colonNoName(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *pFW;
- STRINGINFO si;
-
- SI_SETLEN(si, 0);
- SI_SETPTR(si, NULL);
-
- pVM->state = COMPILE;
- pFW = dictAppendWord2(dp, si, colonParen, FW_DEFAULT | FW_SMUDGE);
- stackPushPtr(pVM->pStack, pFW);
- markControlTag(pVM, colonTag);
- return;
-}
-
-
-/**************************************************************************
- u s e r V a r i a b l e
-** user ( u -- ) "<spaces>name"
-** Get a name from the input stream and create a user variable
-** with the name and the index supplied. The run-time effect
-** of a user variable is to push the address of the indexed cell
-** in the running vm's user array.
-**
-** User variables are vm local cells. Each vm has an array of
-** FICL_USER_CELLS of them when FICL_WANT_USER is nonzero.
-** Ficl's user facility is implemented with two primitives,
-** "user" and "(user)", a variable ("nUser") (in softcore.c) that
-** holds the index of the next free user cell, and a redefinition
-** (also in softcore) of "user" that defines a user word and increments
-** nUser.
-**************************************************************************/
-#if FICL_WANT_USER
-static void userParen(FICL_VM *pVM)
-{
- INT32 i = pVM->runningWord->param[0].i;
- stackPushPtr(pVM->pStack, &pVM->user[i]);
- return;
-}
-
-
-static void userVariable(FICL_VM *pVM)
-{
- FICL_DICT *dp = ficlGetDict();
- STRINGINFO si = vmGetWord(pVM);
- CELL c;
-
- c = stackPop(pVM->pStack);
- if (c.i >= FICL_USER_CELLS)
- {
- vmThrowErr(pVM, "Error - out of user space");
- }
-
- dictAppendWord2(dp, si, userParen, FW_DEFAULT);
- dictAppendCell(dp, c);
- return;
-}
-#endif
-
-
-/**************************************************************************
- t o V a l u e
-** CORE EXT
-** Interpretation: ( x "<spaces>name" -- )
-** Skip leading spaces and parse name delimited by a space. Store x in
-** name. An ambiguous condition exists if name was not defined by VALUE.
-** NOTE: In ficl, VALUE is an alias of CONSTANT
-**************************************************************************/
-static void toValue(FICL_VM *pVM)
-{
- STRINGINFO si = vmGetWord(pVM);
- FICL_DICT *dp = ficlGetDict();
- FICL_WORD *pFW;
-
-#if FICL_WANT_LOCALS
- FICL_DICT *pLoc = ficlGetLoc();
- if ((nLocals > 0) && (pVM->state == COMPILE))
- {
- pFW = dictLookup(pLoc, si);
- if (pFW)
- {
- dictAppendCell(dp, LVALUEtoCELL(pToLocalParen));
- dictAppendCell(dp, LVALUEtoCELL(pFW->param[0]));
- return;
- }
- }
-#endif
-
- assert(pStore);
-
- pFW = dictLookup(dp, si);
- if (!pFW)
- {
- int i = SI_COUNT(si);
- vmThrowErr(pVM, "%.*s not found", i, SI_PTR(si));
- }
-
- if (pVM->state == INTERPRET)
- pFW->param[0] = stackPop(pVM->pStack);
- else /* compile code to store to word's param */
- {
- stackPushPtr(pVM->pStack, &pFW->param[0]);
- literalIm(pVM);
- dictAppendCell(dp, LVALUEtoCELL(pStore));
- }
- return;
-}
-
-
-#if FICL_WANT_LOCALS
-/**************************************************************************
- l i n k P a r e n
-** ( -- )
-** Link a frame on the return stack, reserving nCells of space for
-** locals - the value of nCells is the next cell in the instruction
-** stream.
-**************************************************************************/
-static void linkParen(FICL_VM *pVM)
-{
- INT32 nLink = *(INT32 *)(pVM->ip);
- vmBranchRelative(pVM, 1);
- stackLink(pVM->rStack, nLink);
- return;
-}
-
-
-static void unlinkParen(FICL_VM *pVM)
-{
- stackUnlink(pVM->rStack);
- return;
-}
-
-
-/**************************************************************************
- d o L o c a l I m
-** Immediate - cfa of a local while compiling - when executed, compiles
-** code to fetch the value of a local given the local's index in the
-** word's pfa
-**************************************************************************/
-static void getLocalParen(FICL_VM *pVM)
-{
- INT32 nLocal = *(INT32 *)(pVM->ip++);
- stackPush(pVM->pStack, pVM->rStack->pFrame[nLocal]);
- return;
-}
-
-
-static void toLocalParen(FICL_VM *pVM)
-{
- INT32 nLocal = *(INT32 *)(pVM->ip++);
- pVM->rStack->pFrame[nLocal] = stackPop(pVM->pStack);
- return;
-}
-
-
-static void getLocal0(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, pVM->rStack->pFrame[0]);
- return;
-}
-
-
-static void toLocal0(FICL_VM *pVM)
-{
- pVM->rStack->pFrame[0] = stackPop(pVM->pStack);
- return;
-}
-
-
-static void getLocal1(FICL_VM *pVM)
-{
- stackPush(pVM->pStack, pVM->rStack->pFrame[1]);
- return;
-}
-
-
-static void toLocal1(FICL_VM *pVM)
-{
- pVM->rStack->pFrame[1] = stackPop(pVM->pStack);
- return;
-}
-
-
-/*
-** Each local is recorded in a private locals dictionary as a
-** word that does doLocalIm at runtime. DoLocalIm compiles code
-** into the client definition to fetch the value of the
-** corresponding local variable from the return stack.
-** The private dictionary gets initialized at the end of each block
-** that uses locals (in ; and does> for example).
-*/
-static void doLocalIm(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
- int nLocal = pVM->runningWord->param[0].i;
-
- if (pVM->state == INTERPRET)
- {
- stackPush(pVM->pStack, pVM->rStack->pFrame[nLocal]);
- }
- else
- {
-
- if (nLocal == 0)
- {
- dictAppendCell(pDict, LVALUEtoCELL(pGetLocal0));
- }
- else if (nLocal == 1)
- {
- dictAppendCell(pDict, LVALUEtoCELL(pGetLocal1));
- }
- else
- {
- dictAppendCell(pDict, LVALUEtoCELL(pGetLocalParen));
- dictAppendCell(pDict, LVALUEtoCELL(nLocal));
- }
- }
- return;
-}
-
-
-/**************************************************************************
- l o c a l P a r e n
-** paren-local-paren LOCAL
-** Interpretation: Interpretation semantics for this word are undefined.
-** Execution: ( c-addr u -- )
-** When executed during compilation, (LOCAL) passes a message to the
-** system that has one of two meanings. If u is non-zero,
-** the message identifies a new local whose definition name is given by
-** the string of characters identified by c-addr u. If u is zero,
-** the message is last local and c-addr has no significance.
-**
-** The result of executing (LOCAL) during compilation of a definition is
-** to create a set of named local identifiers, each of which is
-** a definition name, that only have execution semantics within the scope
-** of that definition's source.
-**
-** local Execution: ( -- x )
-**
-** Push the local's value, x, onto the stack. The local's value is
-** initialized as described in 13.3.3 Processing locals and may be
-** changed by preceding the local's name with TO. An ambiguous condition
-** exists when local is executed while in interpretation state.
-**************************************************************************/
-static void localParen(FICL_VM *pVM)
-{
- static CELL *pMark = NULL;
- FICL_DICT *pDict = ficlGetDict();
- STRINGINFO si;
- SI_SETLEN(si, stackPopUNS32(pVM->pStack));
- SI_SETPTR(si, (char *)stackPopPtr(pVM->pStack));
-
- if (SI_COUNT(si) > 0)
- { /* add a local to the dict and update nLocals */
- FICL_DICT *pLoc = ficlGetLoc();
- if (nLocals >= FICL_MAX_LOCALS)
- {
- vmThrowErr(pVM, "Error: out of local space");
- }
-
- dictAppendWord2(pLoc, si, doLocalIm, FW_COMPIMMED);
- dictAppendCell(pLoc, LVALUEtoCELL(nLocals));
-
- if (nLocals == 0)
- { /* compile code to create a local stack frame */
- dictAppendCell(pDict, LVALUEtoCELL(pLinkParen));
- /* save location in dictionary for #locals */
- pMark = pDict->here;
- dictAppendCell(pDict, LVALUEtoCELL(nLocals));
- /* compile code to initialize first local */
- dictAppendCell(pDict, LVALUEtoCELL(pToLocal0));
- }
- else if (nLocals == 1)
- {
- dictAppendCell(pDict, LVALUEtoCELL(pToLocal1));
- }
- else
- {
- dictAppendCell(pDict, LVALUEtoCELL(pToLocalParen));
- dictAppendCell(pDict, LVALUEtoCELL(nLocals));
- }
-
- nLocals++;
- }
- else if (nLocals > 0)
- { /* write nLocals to (link) param area in dictionary */
- *(INT32 *)pMark = nLocals;
- }
-
- return;
-}
-
-
-#endif
-/**************************************************************************
- setParentWid
-** FICL
-** setparentwid ( parent-wid wid -- )
-** Set WID's link field to the parent-wid. search-wordlist will
-** iterate through all the links when finding words in the child wid.
-**************************************************************************/
-static void setParentWid(FICL_VM *pVM)
-{
- FICL_HASH *parent, *child;
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 0);
-#endif
- child = (FICL_HASH *)stackPopPtr(pVM->pStack);
- parent = (FICL_HASH *)stackPopPtr(pVM->pStack);
-
- child->link = parent;
- return;
-}
-
-
-/**************************************************************************
- s e e
-** TOOLS ( "<spaces>name" -- )
-** Display a human-readable representation of the named word's definition.
-** The source of the representation (object-code decompilation, source
-** block, etc.) and the particular form of the display is implementation
-** defined.
-** NOTE: these funcs come late in the file because they reference all
-** of the word-builder funcs without declaring them again. Call me lazy.
-**************************************************************************/
-/*
-** isAFiclWord
-** Vet a candidate pointer carefully to make sure
-** it's not some chunk o' inline data...
-** It has to have a name, and it has to look
-** like it's in the dictionary address range.
-** NOTE: this excludes :noname words!
-*/
-static int isAFiclWord(FICL_WORD *pFW)
-{
- void *pv = (void *)pFW;
- FICL_DICT *pd = ficlGetDict();
-
- if (!dictIncludes(pd, pFW))
- return 0;
-
- if (!dictIncludes(pd, pFW->name))
- return 0;
-
- return ((pFW->nName > 0) && (pFW->name[pFW->nName] == '\0'));
-}
-
-/*
-** seeColon (for proctologists only)
-** Walks a colon definition, decompiling
-** on the fly. Knows about primitive control structures.
-*/
-static void seeColon(FICL_VM *pVM, CELL *pc)
-{
- for (; pc->p != pSemiParen; pc++)
- {
- FICL_WORD *pFW = (FICL_WORD *)(pc->p);
-
- if (isAFiclWord(pFW))
- {
- if (pFW->code == literalParen)
- {
- CELL v = *++pc;
- if (isAFiclWord(v.p))
- {
- FICL_WORD *pLit = (FICL_WORD *)v.p;
- sprintf(pVM->pad, " literal %.*s (%#lx)",
- pLit->nName, pLit->name, v.u);
- }
- else
- sprintf(pVM->pad, " literal %ld (%#lx)", v.i, v.u);
- }
- else if (pFW->code == stringLit)
- {
- FICL_STRING *sp = (FICL_STRING *)(void *)++pc;
- pc = (CELL *)alignPtr(sp->text + sp->count + 1) - 1;
- sprintf(pVM->pad, " s\" %.*s\"", sp->count, sp->text);
- }
- else if (pFW->code == ifParen)
- {
- CELL c = *++pc;
- if (c.i > 0)
- sprintf(pVM->pad, " if / while (branch rel %ld)", c.i);
- else
- sprintf(pVM->pad, " until (branch rel %ld)", c.i);
- }
- else if (pFW->code == branchParen)
- {
- CELL c = *++pc;
- if (c.i > 0)
- sprintf(pVM->pad, " else (branch rel %ld)", c.i);
- else
- sprintf(pVM->pad, " repeat (branch rel %ld)", c.i);
- }
- else if (pFW->code == qDoParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " ?do (leave abs %#lx)", c.u);
- }
- else if (pFW->code == doParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " do (leave abs %#lx)", c.u);
- }
- else if (pFW->code == loopParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " loop (branch rel %#ld)", c.i);
- }
- else if (pFW->code == plusLoopParen)
- {
- CELL c = *++pc;
- sprintf(pVM->pad, " +loop (branch rel %#ld)", c.i);
- }
- else /* default: print word's name */
- {
- sprintf(pVM->pad, " %.*s", pFW->nName, pFW->name);
- }
-
- vmTextOut(pVM, pVM->pad, 1);
- }
- else /* probably not a word - punt and print value */
- {
- sprintf(pVM->pad, " %ld (%#lx)", pc->i, pc->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- }
-
- vmTextOut(pVM, ";", 1);
-}
-
-/*
-** Here's the outer part of the decompiler. It's
-** just a big nested conditional that checks the
-** CFA of the word to decompile for each kind of
-** known word-builder code, and tries to do
-** something appropriate. If the CFA is not recognized,
-** just indicate that it is a primitive.
-*/
-static void see(FICL_VM *pVM)
-{
- FICL_DICT *pd = ficlGetDict();
- FICL_WORD *pFW;
-
- tick(pVM);
- pFW = (FICL_WORD *)stackPopPtr(pVM->pStack);
-
- if (pFW->code == colonParen)
- {
- sprintf(pVM->pad, ": %.*s", pFW->nName, pFW->name);
- vmTextOut(pVM, pVM->pad, 1);
- seeColon(pVM, pFW->param);
- }
- else if (pFW->code == doDoes)
- {
- vmTextOut(pVM, "does>", 1);
- seeColon(pVM, (CELL *)pFW->param->p);
- }
- else if (pFW->code == createParen)
- {
- vmTextOut(pVM, "create", 1);
- }
- else if (pFW->code == variableParen)
- {
- sprintf(pVM->pad, "variable = %ld (%#lx)",
- pFW->param->i, pFW->param->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- else if (pFW->code == userParen)
- {
- sprintf(pVM->pad, "user variable %ld (%#lx)",
- pFW->param->i, pFW->param->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- else if (pFW->code == constantParen)
- {
- sprintf(pVM->pad, "constant = %ld (%#lx)",
- pFW->param->i, pFW->param->u);
- vmTextOut(pVM, pVM->pad, 1);
- }
- else
- {
- vmTextOut(pVM, "primitive", 1);
- }
-
- if (pFW->flags & FW_IMMEDIATE)
- {
- vmTextOut(pVM, "immediate", 1);
- }
-
- return;
-}
-
-
-/**************************************************************************
- c o m p a r e
-** STRING ( c-addr1 u1 c-addr2 u2 -- n )
-** Compare the string specified by c-addr1 u1 to the string specified by
-** c-addr2 u2. The strings are compared, beginning at the given addresses,
-** character by character, up to the length of the shorter string or until a
-** difference is found. If the two strings are identical, n is zero. If the two
-** strings are identical up to the length of the shorter string, n is minus-one
-** (-1) if u1 is less than u2 and one (1) otherwise. If the two strings are not
-** identical up to the length of the shorter string, n is minus-one (-1) if the
-** first non-matching character in the string specified by c-addr1 u1 has a
-** lesser numeric value than the corresponding character in the string specified
-** by c-addr2 u2 and one (1) otherwise.
-**************************************************************************/
-static void compareString(FICL_VM *pVM)
-{
- char *cp1, *cp2;
- UNS32 u1, u2, uMin;
- int n = 0;
-
- vmCheckStack(pVM, 4, 1);
- u2 = stackPopUNS32(pVM->pStack);
- cp2 = (char *)stackPopPtr(pVM->pStack);
- u1 = stackPopUNS32(pVM->pStack);
- cp1 = (char *)stackPopPtr(pVM->pStack);
-
- uMin = (u1 < u2)? u1 : u2;
- for ( ; (uMin > 0) && (n == 0); uMin--)
- {
- n = (int)(*cp1++ - *cp2++);
- }
-
- if (n == 0)
- n = (int)(u1 - u2);
-
- if (n < 0)
- n = -1;
- else if (n > 0)
- n = 1;
-
- stackPushINT32(pVM->pStack, n);
- return;
-}
-
-
-/**************************************************************************
- r e f i l l
-** CORE EXT ( -- flag )
-** Attempt to fill the input buffer from the input source, returning a true
-** flag if successful.
-** When the input source is the user input device, attempt to receive input
-** into the terminal input buffer. If successful, make the result the input
-** buffer, set >IN to zero, and return true. Receipt of a line containing no
-** characters is considered successful. If there is no input available from
-** the current input source, return false.
-** When the input source is a string from EVALUATE, return false and
-** perform no other action.
-**************************************************************************/
-static void refill(FICL_VM *pVM)
-{
- INT32 ret = (pVM->sourceID.i == -1) ? FICL_FALSE : FICL_TRUE;
- stackPushINT32(pVM->pStack, ret);
- if (ret)
- vmThrow(pVM, VM_OUTOFTEXT);
- return;
-}
-
-
-/**************************************************************************
- f o r g e t
-** TOOLS EXT ( "<spaces>name" -- )
-** Skip leading space delimiters. Parse name delimited by a space.
-** Find name, then delete name from the dictionary along with all
-** words added to the dictionary after name. An ambiguous
-** condition exists if name cannot be found.
-**
-** If the Search-Order word set is present, FORGET searches the
-** compilation word list. An ambiguous condition exists if the
-** compilation word list is deleted.
-**************************************************************************/
-static void forgetWid(FICL_VM *pVM)
-{
- FICL_DICT *pDict = ficlGetDict();
- FICL_HASH *pHash;
-
- pHash = (FICL_HASH *)stackPopPtr(pVM->pStack);
- hashForget(pHash, pDict->here);
-
- return;
-}
-
-
-static void forget(FICL_VM *pVM)
-{
- void *where;
- FICL_DICT *pDict = ficlGetDict();
- FICL_HASH *pHash = pDict->pCompile;
-
- tick(pVM);
- where = ((FICL_WORD *)stackPopPtr(pVM->pStack))->name;
- hashForget(pHash, where);
- pDict->here = PTRtoCELL where;
-
- return;
-}
-
-/************************* freebsd added I/O words **************************/
-
-/* fopen - open a file and return new fd on stack.
- *
- * fopen ( count ptr -- fd )
- */
-static void pfopen(FICL_VM *pVM)
-{
- int fd;
- char *p;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 2, 1);
-#endif
- (void)stackPopINT32(pVM->pStack); /* don't need count value */
- p = stackPopPtr(pVM->pStack);
- fd = open(p, O_RDONLY);
- stackPushINT32(pVM->pStack, fd);
- return;
-}
-
-/* fclose - close a file who's fd is on stack.
- *
- * fclose ( fd -- )
- */
-static void pfclose(FICL_VM *pVM)
-{
- int fd;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- fd = stackPopINT32(pVM->pStack); /* get fd */
- if (fd != -1)
- close(fd);
- return;
-}
-
-/* fread - read file contents
- *
- * fread ( fd buf nbytes -- nread )
- */
-static void pfread(FICL_VM *pVM)
-{
- int fd, len;
- char *buf;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 3, 1);
-#endif
- len = stackPopINT32(pVM->pStack); /* get number of bytes to read */
- buf = stackPopPtr(pVM->pStack); /* get buffer */
- fd = stackPopINT32(pVM->pStack); /* get fd */
- if (len > 0 && buf && fd != -1)
- stackPushINT32(pVM->pStack, read(fd, buf, len));
- else
- stackPushINT32(pVM->pStack, -1);
- return;
-}
-
-/* fload - interpret file contents
- *
- * fload ( fd -- )
- */
-static void pfload(FICL_VM *pVM)
-{
- int fd;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 0);
-#endif
- fd = stackPopINT32(pVM->pStack); /* get fd */
- if (fd != -1)
- ficlExecFD(pVM, fd);
- return;
-}
-
-/* key - get a character from stdin
- *
- * key ( -- char )
- */
-static void key(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
- stackPushINT32(pVM->pStack, getchar());
- return;
-}
-
-/* key? - check for a character from stdin (FACILITY)
- *
- * key? ( -- flag )
- */
-static void keyQuestion(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 0, 1);
-#endif
-#ifdef TESTMAIN
- /* XXX Since we don't fiddle with termios, let it always succeed... */
- stackPushINT32(pVM->pStack, FICL_TRUE);
-#else
- /* But here do the right thing. */
- stackPushINT32(pVM->pStack, ischar()? FICL_TRUE : FICL_FALSE);
-#endif
- return;
-}
-
-/* seconds - gives number of seconds since beginning of time
- *
- * beginning of time is defined as:
- *
- * BTX - number of seconds since midnight
- * FreeBSD - number of seconds since Jan 1 1970
- *
- * seconds ( -- u )
- */
-static void pseconds(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM,0,1);
-#endif
- stackPushUNS32(pVM->pStack, (u_int32_t) time(NULL));
- return;
-}
-
-/* ms - wait at least that many milliseconds (FACILITY)
- *
- * ms ( u -- )
- *
- */
-static void ms(FICL_VM *pVM)
-{
-#if FICL_ROBUST > 1
- vmCheckStack(pVM,1,0);
-#endif
-#ifdef TESTMAIN
- usleep(stackPopUNS32(pVM->pStack)*1000);
-#else
- delay(stackPopUNS32(pVM->pStack)*1000);
-#endif
- return;
-}
-
-/* fkey - get a character from a file
- *
- * fkey ( file -- char )
- */
-static void fkey(FICL_VM *pVM)
-{
- int i, fd;
- char ch;
-
-#if FICL_ROBUST > 1
- vmCheckStack(pVM, 1, 1);
-#endif
- fd = stackPopINT32(pVM->pStack);
- i = read(fd, &ch, 1);
- stackPushINT32(pVM->pStack, i > 0 ? ch : -1);
- return;
-}
-
-
-/**************************************************************************
- f i c l C o m p i l e C o r e
-** Builds the primitive wordset and the environment-query namespace.
-**************************************************************************/
-
-void ficlCompileCore(FICL_DICT *dp)
-{
- assert (dp);
-
- /*
- ** CORE word set
- ** see softcore.c for definitions of: abs bl space spaces abort"
- */
- pStore =
- dictAppendWord(dp, "!", store, FW_DEFAULT);
- dictAppendWord(dp, "#", numberSign, FW_DEFAULT);
- dictAppendWord(dp, "#>", numberSignGreater,FW_DEFAULT);
- dictAppendWord(dp, "#s", numberSignS, FW_DEFAULT);
- dictAppendWord(dp, "\'", tick, FW_DEFAULT);
- dictAppendWord(dp, "(", commentHang, FW_IMMEDIATE);
- dictAppendWord(dp, "*", mul, FW_DEFAULT);
- dictAppendWord(dp, "*/", mulDiv, FW_DEFAULT);
- dictAppendWord(dp, "*/mod", mulDivRem, FW_DEFAULT);
- dictAppendWord(dp, "+", add, FW_DEFAULT);
- dictAppendWord(dp, "+!", plusStore, FW_DEFAULT);
- dictAppendWord(dp, "+loop", plusLoopCoIm, FW_COMPIMMED);
- pComma =
- dictAppendWord(dp, ",", comma, FW_DEFAULT);
- dictAppendWord(dp, "-", sub, FW_DEFAULT);
- dictAppendWord(dp, ".", displayCell, FW_DEFAULT);
- dictAppendWord(dp, ".#", displayCellNoPad, FW_DEFAULT);
- dictAppendWord(dp, ".\"", dotQuoteCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "/", ficlDiv, FW_DEFAULT);
- dictAppendWord(dp, "/mod", slashMod, FW_DEFAULT);
- dictAppendWord(dp, "0<", zeroLess, FW_DEFAULT);
- dictAppendWord(dp, "0=", zeroEquals, FW_DEFAULT);
- dictAppendWord(dp, "0>", zeroGreater, FW_DEFAULT);
- dictAppendWord(dp, "1+", onePlus, FW_DEFAULT);
- dictAppendWord(dp, "1-", oneMinus, FW_DEFAULT);
- dictAppendWord(dp, "2!", twoStore, FW_DEFAULT);
- dictAppendWord(dp, "2*", twoMul, FW_DEFAULT);
- dictAppendWord(dp, "2/", twoDiv, FW_DEFAULT);
- dictAppendWord(dp, "2@", twoFetch, FW_DEFAULT);
- dictAppendWord(dp, "2drop", twoDrop, FW_DEFAULT);
- dictAppendWord(dp, "2dup", twoDup, FW_DEFAULT);
- dictAppendWord(dp, "2over", twoOver, FW_DEFAULT);
- dictAppendWord(dp, "2swap", twoSwap, FW_DEFAULT);
- dictAppendWord(dp, ":", colon, FW_DEFAULT);
- dictAppendWord(dp, ";", semicolonCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "<", isLess, FW_DEFAULT);
- dictAppendWord(dp, "<#", lessNumberSign, FW_DEFAULT);
- dictAppendWord(dp, "=", isEqual, FW_DEFAULT);
- dictAppendWord(dp, ">", isGreater, FW_DEFAULT);
- dictAppendWord(dp, ">body", toBody, FW_DEFAULT);
- dictAppendWord(dp, ">in", toIn, FW_DEFAULT);
- dictAppendWord(dp, ">number", toNumber, FW_DEFAULT);
- dictAppendWord(dp, ">r", toRStack, FW_DEFAULT);
- dictAppendWord(dp, "?dup", questionDup, FW_DEFAULT);
- dictAppendWord(dp, "@", fetch, FW_DEFAULT);
- dictAppendWord(dp, "abort", ficlAbort, FW_DEFAULT);
- dictAppendWord(dp, "accept", accept, FW_DEFAULT);
- dictAppendWord(dp, "align", align, FW_DEFAULT);
- dictAppendWord(dp, "aligned", aligned, FW_DEFAULT);
- dictAppendWord(dp, "allot", allot, FW_DEFAULT);
- dictAppendWord(dp, "and", bitwiseAnd, FW_DEFAULT);
- dictAppendWord(dp, "base", base, FW_DEFAULT);
- dictAppendWord(dp, "begin", beginCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "c!", cStore, FW_DEFAULT);
- dictAppendWord(dp, "c,", cComma, FW_DEFAULT);
- dictAppendWord(dp, "c@", cFetch, FW_DEFAULT);
- dictAppendWord(dp, "cell+", cellPlus, FW_DEFAULT);
- dictAppendWord(dp, "cells", cells, FW_DEFAULT);
- dictAppendWord(dp, "char", ficlChar, FW_DEFAULT);
- dictAppendWord(dp, "char+", charPlus, FW_DEFAULT);
- dictAppendWord(dp, "chars", ficlChars, FW_DEFAULT);
- dictAppendWord(dp, "constant", constant, FW_DEFAULT);
- dictAppendWord(dp, "count", count, FW_DEFAULT);
- dictAppendWord(dp, "cr", cr, FW_DEFAULT);
- dictAppendWord(dp, "create", create, FW_DEFAULT);
- dictAppendWord(dp, "decimal", decimal, FW_DEFAULT);
- dictAppendWord(dp, "depth", depth, FW_DEFAULT);
- dictAppendWord(dp, "do", doCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "does>", doesCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "drop", drop, FW_DEFAULT);
- dictAppendWord(dp, "dup", dup, FW_DEFAULT);
- dictAppendWord(dp, "else", elseCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "emit", emit, FW_DEFAULT);
- dictAppendWord(dp, "environment?", environmentQ,FW_DEFAULT);
- dictAppendWord(dp, "evaluate", evaluate, FW_DEFAULT);
- dictAppendWord(dp, "execute", execute, FW_DEFAULT);
- dictAppendWord(dp, "exit", exitCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "fill", fill, FW_DEFAULT);
- dictAppendWord(dp, "find", find, FW_DEFAULT);
- dictAppendWord(dp, "fm/mod", fmSlashMod, FW_DEFAULT);
- dictAppendWord(dp, "here", here, FW_DEFAULT);
- dictAppendWord(dp, "hex", hex, FW_DEFAULT);
- dictAppendWord(dp, "hold", hold, FW_DEFAULT);
- dictAppendWord(dp, "i", loopICo, FW_COMPILE);
- dictAppendWord(dp, "if", ifCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "immediate", immediate, FW_DEFAULT);
- dictAppendWord(dp, "invert", bitwiseNot, FW_DEFAULT);
- dictAppendWord(dp, "j", loopJCo, FW_COMPILE);
- dictAppendWord(dp, "k", loopKCo, FW_COMPILE);
- dictAppendWord(dp, "leave", leaveCo, FW_COMPILE);
- dictAppendWord(dp, "literal", literalIm, FW_IMMEDIATE);
- dictAppendWord(dp, "loop", loopCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "lshift", lshift, FW_DEFAULT);
- dictAppendWord(dp, "m*", mStar, FW_DEFAULT);
- dictAppendWord(dp, "max", ficlMax, FW_DEFAULT);
- dictAppendWord(dp, "min", ficlMin, FW_DEFAULT);
- dictAppendWord(dp, "mod", ficlMod, FW_DEFAULT);
- dictAppendWord(dp, "move", move, FW_DEFAULT);
- dictAppendWord(dp, "negate", negate, FW_DEFAULT);
- dictAppendWord(dp, "or", bitwiseOr, FW_DEFAULT);
- dictAppendWord(dp, "over", over, FW_DEFAULT);
- dictAppendWord(dp, "postpone", postponeCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "quit", quit, FW_DEFAULT);
- dictAppendWord(dp, "r>", fromRStack, FW_DEFAULT);
- dictAppendWord(dp, "r@", fetchRStack, FW_DEFAULT);
- dictAppendWord(dp, "recurse", recurseCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "repeat", repeatCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "rot", rot, FW_DEFAULT);
- dictAppendWord(dp, "rshift", rshift, FW_DEFAULT);
- dictAppendWord(dp, "s\"", stringQuoteIm, FW_IMMEDIATE);
- dictAppendWord(dp, "s>d", sToD, FW_DEFAULT);
- dictAppendWord(dp, "sign", sign, FW_DEFAULT);
- dictAppendWord(dp, "sm/rem", smSlashRem, FW_DEFAULT);
- dictAppendWord(dp, "source", source, FW_DEFAULT);
- dictAppendWord(dp, "state", state, FW_DEFAULT);
- dictAppendWord(dp, "swap", swap, FW_DEFAULT);
- dictAppendWord(dp, "then", endifCoIm, FW_COMPIMMED);
- pType =
- dictAppendWord(dp, "type", type, FW_DEFAULT);
- dictAppendWord(dp, "u.", uDot, FW_DEFAULT);
- dictAppendWord(dp, "u<", uIsLess, FW_DEFAULT);
- dictAppendWord(dp, "um*", umStar, FW_DEFAULT);
- dictAppendWord(dp, "um/mod", umSlashMod, FW_DEFAULT);
- dictAppendWord(dp, "unloop", unloopCo, FW_COMPILE);
- dictAppendWord(dp, "until", untilCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "variable", variable, FW_DEFAULT);
- dictAppendWord(dp, "while", whileCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "word", ficlWord, FW_DEFAULT);
- dictAppendWord(dp, "xor", bitwiseXor, FW_DEFAULT);
- dictAppendWord(dp, "[", lbracketCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "[\']", bracketTickCoIm,FW_COMPIMMED);
- dictAppendWord(dp, "[char]", charCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "]", rbracket, FW_DEFAULT);
- /*
- ** CORE EXT word set...
- ** see softcore.c for other definitions
- */
- dictAppendWord(dp, ".(", dotParen, FW_DEFAULT);
- dictAppendWord(dp, ":noname", colonNoName, FW_DEFAULT);
- dictAppendWord(dp, "?do", qDoCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "parse", parse, FW_DEFAULT);
- dictAppendWord(dp, "pick", pick, FW_DEFAULT);
- dictAppendWord(dp, "roll", roll, FW_DEFAULT);
- dictAppendWord(dp, "refill", refill, FW_DEFAULT);
- dictAppendWord(dp, "to", toValue, FW_IMMEDIATE);
- dictAppendWord(dp, "value", constant, FW_DEFAULT);
- dictAppendWord(dp, "\\", commentLine, FW_IMMEDIATE);
-
- /* FreeBSD extension words */
- dictAppendWord(dp, "fopen", pfopen, FW_DEFAULT);
- dictAppendWord(dp, "fclose", pfclose, FW_DEFAULT);
- dictAppendWord(dp, "fread", pfread, FW_DEFAULT);
- dictAppendWord(dp, "fload", pfload, FW_DEFAULT);
- dictAppendWord(dp, "fkey", fkey, FW_DEFAULT);
- dictAppendWord(dp, "key", key, FW_DEFAULT);
- dictAppendWord(dp, "key?", keyQuestion, FW_DEFAULT);
- dictAppendWord(dp, "ms", ms, FW_DEFAULT);
- dictAppendWord(dp, "seconds", pseconds, FW_DEFAULT);
-#ifdef __i386__
-#ifndef TESTMAIN
- dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT);
- dictAppendWord(dp, "inb", ficlInb, FW_DEFAULT);
-#endif
- ficlSetEnv("arch-i386", FICL_TRUE);
-#else
- ficlSetEnv("arch-i386", FICL_FALSE);
-#endif
-
- /*
- ** Set CORE environment query values
- */
- ficlSetEnv("/counted-string", FICL_STRING_MAX);
- ficlSetEnv("/hold", nPAD);
- ficlSetEnv("/pad", nPAD);
- ficlSetEnv("address-unit-bits", 8);
- ficlSetEnv("core", FICL_TRUE);
- ficlSetEnv("core-ext", FICL_FALSE);
- ficlSetEnv("floored", FICL_FALSE);
- ficlSetEnv("max-char", UCHAR_MAX);
- ficlSetEnvD("max-d", 0x7fffffff, 0xffffffff );
- ficlSetEnv("max-n", 0x7fffffff);
- ficlSetEnv("max-u", 0xffffffff);
- ficlSetEnvD("max-ud", 0xffffffff, 0xffffffff);
- ficlSetEnv("return-stack-cells",FICL_DEFAULT_STACK);
- ficlSetEnv("stack-cells", FICL_DEFAULT_STACK);
-
- /*
- ** LOCAL and LOCAL EXT
- ** see softcore.c for implementation of locals|
- */
-#if FICL_WANT_LOCALS
- pLinkParen =
- dictAppendWord(dp, "(link)", linkParen, FW_COMPILE);
- pUnLinkParen =
- dictAppendWord(dp, "(unlink)", unlinkParen, FW_COMPILE);
- dictAppendWord(dp, "doLocal", doLocalIm, FW_COMPIMMED);
- pGetLocalParen =
- dictAppendWord(dp, "(@local)", getLocalParen, FW_COMPILE);
- pToLocalParen =
- dictAppendWord(dp, "(toLocal)", toLocalParen, FW_COMPILE);
- pGetLocal0 =
- dictAppendWord(dp, "(@local0)", getLocal0, FW_COMPILE);
- pToLocal0 =
- dictAppendWord(dp, "(toLocal0)",toLocal0, FW_COMPILE);
- pGetLocal1 =
- dictAppendWord(dp, "(@local1)", getLocal1, FW_COMPILE);
- pToLocal1 =
- dictAppendWord(dp, "(toLocal1)",toLocal1, FW_COMPILE);
- dictAppendWord(dp, "(local)", localParen, FW_COMPILE);
-
- ficlSetEnv("locals", FICL_TRUE);
- ficlSetEnv("locals-ext", FICL_TRUE);
- ficlSetEnv("#locals", FICL_MAX_LOCALS);
-#endif
-
- /*
- ** optional SEARCH-ORDER word set
- */
- dictAppendWord(dp, ">search", searchPush, FW_DEFAULT);
- dictAppendWord(dp, "search>", searchPop, FW_DEFAULT);
- dictAppendWord(dp, "definitions",
- definitions, FW_DEFAULT);
- dictAppendWord(dp, "forth-wordlist",
- forthWordlist, FW_DEFAULT);
- dictAppendWord(dp, "get-current",
- getCurrent, FW_DEFAULT);
- dictAppendWord(dp, "get-order", getOrder, FW_DEFAULT);
- dictAppendWord(dp, "search-wordlist",
- searchWordlist, FW_DEFAULT);
- dictAppendWord(dp, "set-current",
- setCurrent, FW_DEFAULT);
- dictAppendWord(dp, "set-order", setOrder, FW_DEFAULT);
- dictAppendWord(dp, "ficl-wordlist", wordlist, FW_DEFAULT);
-
- /*
- ** Set SEARCH environment query values
- */
- ficlSetEnv("search-order", FICL_TRUE);
- ficlSetEnv("search-order-ext", FICL_TRUE);
- ficlSetEnv("wordlists", FICL_DEFAULT_VOCS);
-
- /*
- ** TOOLS and TOOLS EXT
- */
- dictAppendWord(dp, ".s", displayStack, FW_DEFAULT);
- dictAppendWord(dp, "bye", bye, FW_DEFAULT);
- dictAppendWord(dp, "forget", forget, FW_DEFAULT);
- dictAppendWord(dp, "see", see, FW_DEFAULT);
- dictAppendWord(dp, "words", listWords, FW_DEFAULT);
-
- /*
- ** Set TOOLS environment query values
- */
- ficlSetEnv("tools", FICL_TRUE);
- ficlSetEnv("tools-ext", FICL_FALSE);
-
- /*
- ** Ficl extras
- */
- dictAppendWord(dp, ".env", listEnv, FW_DEFAULT);
- dictAppendWord(dp, ".hash", dictHashSummary,FW_DEFAULT);
- dictAppendWord(dp, ".ver", ficlVersion, FW_DEFAULT);
- dictAppendWord(dp, "-roll", minusRoll, FW_DEFAULT);
- dictAppendWord(dp, "2constant", twoConstant, FW_IMMEDIATE); /* DOUBLE */
- dictAppendWord(dp, ">name", toName, FW_DEFAULT);
- dictAppendWord(dp, "body>", fromBody, FW_DEFAULT);
- dictAppendWord(dp, "compare", compareString, FW_DEFAULT); /* STRING */
- dictAppendWord(dp, "compile-only",
- compileOnly, FW_DEFAULT);
- dictAppendWord(dp, "endif", endifCoIm, FW_COMPIMMED);
- dictAppendWord(dp, "forget-wid",forgetWid, FW_DEFAULT);
- dictAppendWord(dp, "parse-word",parseNoCopy, FW_DEFAULT);
- dictAppendWord(dp, "sliteral", sLiteralCoIm, FW_COMPIMMED); /* STRING */
- dictAppendWord(dp, "wid-set-super",
- setParentWid, FW_DEFAULT);
- dictAppendWord(dp, "w@", wFetch, FW_DEFAULT);
- dictAppendWord(dp, "w!", wStore, FW_DEFAULT);
- dictAppendWord(dp, "x.", hexDot, FW_DEFAULT);
-#if FICL_WANT_USER
- dictAppendWord(dp, "(user)", userParen, FW_DEFAULT);
- dictAppendWord(dp, "user", userVariable, FW_DEFAULT);
-#endif
- /*
- ** internal support words
- */
- pExitParen =
- dictAppendWord(dp, "(exit)", exitParen, FW_COMPILE);
- pSemiParen =
- dictAppendWord(dp, "(;)", semiParen, FW_COMPILE);
- pLitParen =
- dictAppendWord(dp, "(literal)", literalParen, FW_COMPILE);
- pStringLit =
- dictAppendWord(dp, "(.\")", stringLit, FW_COMPILE);
- pIfParen =
- dictAppendWord(dp, "(if)", ifParen, FW_COMPILE);
- pBranchParen =
- dictAppendWord(dp, "(branch)", branchParen, FW_COMPILE);
- pDoParen =
- dictAppendWord(dp, "(do)", doParen, FW_COMPILE);
- pDoesParen =
- dictAppendWord(dp, "(does>)", doesParen, FW_COMPILE);
- pQDoParen =
- dictAppendWord(dp, "(?do)", qDoParen, FW_COMPILE);
- pLoopParen =
- dictAppendWord(dp, "(loop)", loopParen, FW_COMPILE);
- pPLoopParen =
- dictAppendWord(dp, "(+loop)", plusLoopParen, FW_COMPILE);
- pInterpret =
- dictAppendWord(dp, "interpret", interpret, FW_DEFAULT);
- dictAppendWord(dp, "(variable)",variableParen, FW_COMPILE);
- dictAppendWord(dp, "(constant)",constantParen, FW_COMPILE);
-
- return;
-}
-
diff --git a/sys/boot/i386/boot0/Makefile b/sys/boot/i386/boot0/Makefile
index 4e890da32565c..d6c407a0cc478 100644
--- a/sys/boot/i386/boot0/Makefile
+++ b/sys/boot/i386/boot0/Makefile
@@ -1,16 +1,12 @@
-# $Id: Makefile,v 1.5 1998/10/17 14:20:25 rnordier Exp $
+# $Id: Makefile,v 1.3 1998/10/09 17:19:51 rnordier Exp $
PROG= boot0
NOMAN=
STRIP=
BINDIR?= /boot
-BINMODE= 444
M4?= m4
-B0FLAGS=0x0
-B0TICKS=0xb6
-
ORG= 0x600
boot0: boot0.o
@@ -23,8 +19,8 @@ boot0: boot0.o
.endif
boot0.o: boot0.m4 boot0.s
- (cd ${.CURDIR}; ${M4} -DFLAGS=${B0FLAGS} -DTICKS=${B0TICKS} \
- boot0.m4 boot0.s) | ${AS} ${AFLAGS} -o ${.TARGET}
+ (cd ${.CURDIR}; ${M4} boot0.m4 boot0.s) | \
+ ${AS} ${AFLAGS} -o ${.TARGET}
CLEANFILES+= boot0.out boot0.o
diff --git a/sys/boot/i386/boot0/boot0.m4 b/sys/boot/i386/boot0/boot0.m4
index f0912a8882439..c0a38b76911e7 100644
--- a/sys/boot/i386/boot0/boot0.m4
+++ b/sys/boot/i386/boot0/boot0.m4
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: boot0.m4,v 1.2 1998/10/19 19:13:53 rnordier Exp $
+# $Id:$
define(_al,0x0)dnl
define(_cl,0x1)dnl
@@ -52,22 +52,25 @@ define(_bx_,0x7)dnl
define(o16,`.byte 0x66')dnl
define(addwia,`.byte 0x5; .word $1')dnl
-define(btwr1,`.word 0xa30f; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
-define(btswr1,`.word 0xab0f; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
-define(cmpbmr,`.byte 0x3a; .byte 0x6 | ($2 << 0x3); .word $1')dnl
-define(cmpw1r,`.byte 0x3b; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
+define(btwrm,`.byte 0xf; .byte 0xa3; .byte 0x6 | ($1 << 0x3); .word $2')dnl
+define(btswrm,`.byte 0xf; .byte 0xab; .byte 0x6 | ($1 << 0x3); .word $2')dnl
+define(cmpwmr,`.byte 0x3b; .byte ($2 << 0x3) | 0x6; .word $1')dnl
define(cmpwi2,`.byte 0x81; .byte 0xb8 | $3; .word $2; .word $1')dnl
-define(addwir,`.byte 0x83; .byte 0xc0 | $2; .byte $1')dnl
+define(cmpwir,`.byte 0x81; .byte 0xf8 | $2; .word $1')dnl
define(movbr0,`.byte 0x88; .byte ($1 << 0x3) | $2')dnl
+define(movbrm,`.byte 0x88; .byte 0x6 | ($1 << 0x3); .word $2')dnl
define(movbr1,`.byte 0x88; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
define(movwr1,`.byte 0x89; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
define(movb0r,`.byte 0x8a; .byte ($2 << 0x3) | $1')dnl
+define(movbmr,`.byte 0x8a; .byte 0x6 | ($2 << 0x3); .word $1')dnl
define(movb1r,`.byte 0x8a; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
define(movw1r,`.byte 0x8b; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
define(movws1,`.byte 0x8c; .byte 0x40 | ($1 << 0x3) | $3; .byte $2')dnl
+define(leaw1r,`.byte 0x8d; .byte 0x40 | ($3 << 0x3) | $2; .byte $1')dnl
+define(movbma,`.byte 0xa0; .word $1')dnl
+define(movbam,`.byte 0xa2; .word $1')dnl
define(movwir,`.byte 0xb8 | $2; .word $1')dnl
define(movbi0,`.byte 0xc6; .byte $2; .byte $1')dnl
define(callwi,`.byte 0xe8; .word $1 - . - 0x2')dnl
define(jmpnwi,`.byte 0xe9; .word $1 - . - 0x2')dnl
-define(tstbi1,`.byte 0xf6; .byte 0x40 | $3; .byte $2; .byte $1')dnl
define(incb1,`.byte 0xfe; .byte 0x40 | $2; .byte $1')dnl
diff --git a/sys/boot/i386/boot0/boot0.s b/sys/boot/i386/boot0/boot0.s
index 08a8d6be21b2f..ae7fa5db8893a 100644
--- a/sys/boot/i386/boot0/boot0.s
+++ b/sys/boot/i386/boot0/boot0.s
@@ -13,36 +13,19 @@
# purpose.
#
-# $Id: boot0.s,v 1.5 1998/11/29 14:09:00 rnordier Exp $
+# $Id: boot0.s,v 1.2 1998/10/09 17:19:51 rnordier Exp $
# A 512-byte boot manager.
- .set NHRDRV,0x475 # Number of hard drives
- .set ORIGIN,0x600 # Execution address
- .set DSKPKT,0x800 # Disk packet
- .set FAKE,0x810 # Partition entry
.set LOAD,0x7c00 # Load address
-
+ .set ORIGIN,0x600 # Relocation address
.set PRT_OFF,0x1be # Partition table
-
- .set TBL0SZ,0x3 # Table 0 size
- .set TBL1SZ,0xa # Table 1 size
-
- .set MAGIC,0xaa55 # Magic: bootable
-
- .set KEY_ENTER,0x1c # Enter key scan code
- .set KEY_F1,0x3b # F1 key scan code
-
- .set _NXTDRV,-0x47 # Drive number
- .set _OPT,-0x46 # Default option
- .set _FLAGS,-0x45 # Flags
- .set _TICKS,-0x44 # Timeout ticks
- .set _FAKE,0x10 # Fake partition entry
- .set _MNUOPT,0x1c # Menu options
+ .set FAKE,0x810 # Partition entry
+ .set MNUOPT,0x81c # Menu options
.globl start # Entry point
-start: cld # String ops inc
+start: cld # String ops inc
xorl %eax,%eax # Zero
movl %eax,%es # Address
movl %eax,%ds # data
@@ -53,185 +36,183 @@ start: cld # String ops inc
movwir(0x100,_cx) # Word count
rep # Relocate
movsl # code
- movl %edi,%ebp # Address variables
movb $0x10,%cl # Words to clear
rep # Zero
stosl # them
incb1(-0xe,_di_) # Sector number
jmpnwi(main-LOAD+ORIGIN) # To relocated code
-main: movbr1(_dl,_FAKE,_bp_) # Save drive number
+main: movbrm(_dl,FAKE) # Save drive number
callwi(putn) # To new line
movwir(partbl,_bx) # Partition table
xorl %edx,%edx # Item
-main.1: movbr0(_dh,_bx_) # Mark inactive
+main.1: movbr0(_dh,_bx_) # Mark inactive
movb1r(0x4,_bx_,_al) # Load type
- movwir(tables,_di) # Lookup tables
- movb $TBL0SZ,%cl # Entries
+ movwir(table0,_di) # Exclusion table
+ movb $0x3,%cl # Entries
repne # Exclude
scasb # partition?
je main.3 # Yes
- movb $TBL1SZ,%cl # Entries
+ movb $0xa,%cl # Entries
repne # Known
scasb # type?
jne main.2 # No
- addwir(TBL1SZ,_di) # Adjust
-main.2: movb0r(_di_,_cl) # Partition
- addl %ecx,%edi # description
- callwi(putx) # Display it
-main.3: addwir(0x10,_bx) # Next entry
+ leaw1r(0xa,_di_,_di) # Name table
+main.2: movwir(item,_si) # Display start
+ callwi(putkey) # of menu item
+ movl %edi,%esi # Set pointer
+ lodsb # to
+ cwde # partition
+ add %eax,%esi # description
+ callwi(puts) # Display it
+ btswrm(_dx,MNUOPT) # Flag option enabled
+main.3: addb $0x10,%bl # Next entry
incl %edx # Next item
cmpb $0x4,%dl # Done?
jb main.1 # No
- movb1r(_FAKE,_bp_,_al) # Drive number
- subb $0x80-0x1,%al # Does next
- cmpbmr(NHRDRV,_al) # drive exist?
- jb main.4 # Yes
- decb %al # Already drive 0?
- jz main.5 # Yes
- xorb %al,%al # Drive 0
-main.4: addb $'0'|0x80,%al # Save
- movbr1(_al,_NXTDRV,_bp_) # it
- movwir(drive,_di) # Display
- callwi(putx) # item
-main.5: movwir(prompt,_si) # Display
+ movwir(prompt,_si) # Display
callwi(putstr) # prompt
- movb1r(_OPT,_bp_,_dl) # Display
+ movbmr(opt,_dl) # Display
decl %esi # default
callwi(putkey) # key
xorb %ah,%ah # BIOS: Get
int $0x1a # system time
- movl %edx,%edi # Save ticks
-main.6: movb $0x1,%ah # BIOS: Check
+ movl %edx,%edi # Save
+main.4: movb $0x1,%ah # BIOS: Check
int $0x16 # for keypress
- jnz main.9 # Have one
+ jnz main.6 # Have one
xorb %ah,%ah # BIOS: Get
int $0x1a # system time
subl %edi,%edx # Elapsed time
- cmpw1r(_TICKS,_bp_,_dx) # Timeout?
- jb main.6 # No
-main.7: movb1r(_OPT,_bp_,_al) # Load default
- jmp main.10 # Join common code
-main.8: movb $0x7,%al # Signal
+ cmpwmr(ticks,_dx) # Timeout?
+ jb main.4 # No
+ jmp main.7 # Join common code
+main.5: movb $0x7,%al # Signal
callwi(putchr) # error
-main.9: xorb %ah,%ah # BIOS: Get
+main.6: xorb %ah,%ah # BIOS: Get
int $0x16 # keypress
movb %ah,%al # Scan code
- cmpb $KEY_ENTER,%al # Enter pressed?
- je main.7 # No
- subb $KEY_F1,%al # Less F1 scan code
- cmpb $0x4,%al # F1..F5?
- ja main.8 # No
-main.10: cwtl # Option
- btwr1(_ax,_MNUOPT,_bp_) # enabled?
- jnc main.8 # No
+ cmpb $0x1c,%al # Enter pressed?
+ jne main.8 # No
+main.7: movbma(opt) # Load
+ jmp main.9 # default
+main.8: subb $0x3b,%al # Less F1 scan code
+ jb main.5 # Not a function key
+main.9: cmpb $0x4,%al # F1..F5?
+ ja main.5 # No
movwir(FAKE,_si) # Partition entry
- movb1r(_NXTDRV,_bp_,_dl) # Next drive
- subb $'0',%dl # number
- cmpb $0x4,%al # F5 pressed?
- je main.11 # Yes
- movb0r(_si_,_dl) # Drive number
- movbr1(_al,_OPT,_bp_) # Save option
+ movb0r(_si_,_dl) # Load drive number
+ jne main.10 # If not F5
+ xorb $0x1,%dl # Toggle drive
+ jmp main.11 # number
+main.10: cwtl # Option
+ btwrm(_ax,MNUOPT) # enabled?
+ jnc main.5 # No
+ movbam(opt) # Save option
shlb $0x4,%al # Point to
addwia(partbl) # partition
- xchgl %esi,%eax # entry
- tstbi1(0x40,_FLAGS,_bp_) # No updates?
- jnz main.11 # Yes
+ xchgl %esi,%eax # entry
movbi0(0x80,_si_) # Flag active
pushl %esi # Save
- xchgl %esi,%eax # Fake partition entry
+ movl %eax,%esi # Fake partition entry
movwir(start,_bx) # Data to write
movwir(0x301,_ax) # Write sector
callwi(intx13) # to disk
popl %esi # Restore
+ jc main.5 # If error
main.11: movwir(LOAD,_bx) # Address for read
movwir(0x201,_ax) # Read sector
callwi(intx13) # from disk
- jc main.8 # If error
- cmpwi2(MAGIC,0x1fe,_bx_) # Bootable?
- jne main.8 # No
+ jc main.5 # If error
+ cmpwi2(0xaa55,0x1fe,_bx_) # Bootable?
+ jne main.5 # No
movwir(crlf,_si) # Leave some
callwi(puts) # space
jmp *%ebx # Invoke bootstrap
# Display routines
-putkey: movb $'F',%al # Display
+putkey: movb $'F',%al # Display
callwi(putchr) # 'F'
movb $'1',%al # Prepare
addb %dl,%al # digit
jmp putstr.1 # Display the rest
-putx: btswr1(_dx,_MNUOPT,_bp_) # Enable menu option
- movwir(item,_si) # Display
- callwi(putkey) # key
- movl %edi,%esi # Display the rest
-
puts: callwi(putstr) # Display string
putn: movwir(crlf,_si) # To next line
-putstr: lodsb # Get byte
- testb $0x80,%al # End of string?
+putstr: lodsb # Get byte
+ testb $0x80,%al # End of string?
jnz putstr.2 # Yes
putstr.1: callwi(putchr) # Display char
jmp putstr # Continue
-putstr.2: andb $~0x80,%al # Clear MSB
+putstr.2: andb $~0x80,%al # Clear MSB
-putchr: pushl %ebx # Save
- movwir(0x7,_bx) # Page:attribute
+putchr: pushl %ebx # Save
+ movwir(0x7,_bx) # Page:attribute
movb $0xe,%ah # BIOS: Display
int $0x10 # character
popl %ebx # Restore
ret # To caller
-# Disk I/O routine
+# Disk I/O
-intx13: cli # Disable interrupts
- movb1r(0x1,_si_,_dh) # Load head
+intx13: movb1r(0x1,_si_,_dh) # Load head
movw1r(0x2,_si_,_cx) # Load cylinder:sector
o16 # Load
movw1r(0x8,_si_,_di) # offset
- movwir(DSKPKT,_si) # Packet pointer
+ pushl %ecx # Save
+ pushl %ebx # caller's
+ movwir(0x55aa,_bx) # Magic
+ pushl %eax # Save
+ movb $0x41,%ah # BIOS: EDD extensions
+ int $0x13 # present?
+ popl %eax # Restore
+ jc intx13.1 # No
+ cmpwir(0xaa55,_bx) # Magic?
+ jne intx13.1 # No
+ testb $0x1,%cl # Use packet?
+ jz intx13.1 # No
+ orb $0x40,%ah # Use EDD
+intx13.1: popl %ebx # Restore
+ popl %ecx # caller's
+ testb $0x40,%ah # Use EDD?
+ jz intx13.2 # No
+ movwir(break,_si) # Packet pointer
movbi0(0x10,_si_) # Packet size
movbr1(_al,0x2,_si_) # Block count
movwr1(_bx,0x4,_si_) # Transfer
movws1(_es,0x6,_si_) # buffer
o16 # LBA
movwr1(_di,0x8,_si_) # address
- sti # Enable interrupts
- tstbi1(0x80,_FLAGS,_bp_) # Use packet interface?
- jz intx13.1 # No
- orb $0x40,%ah # Use disk packet
- decl %eax # Verify off
-intx13.1: int $0x13 # BIOS: Disk I/O
+ xorb %al,%al # Verify off
+intx13.2: int $0x13 # BIOS: Disk I/O
ret # To caller
# Menu strings
-item: .ascii " "; .byte ' '|0x80
+crlf: .ascii "\r"; .byte '\n'|0x80
+item: .ascii " "; .byte ' '|0x80
prompt: .ascii "\nDefault:"; .byte ' '|0x80
-crlf: .ascii "\r"; .byte '\n'|0x80
# Partition type tables
-tables:
- .byte 0x0, 0x5, 0xf
-
- .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x63, 0x83
+table0: .byte 0x0, 0x5, 0xf
+table1: .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x63, 0x83
.byte 0xa5, 0xa6
- .byte os_misc-. # Unknown
- .byte os_dos-. # DOS
- .byte os_dos-. # DOS
- .byte os_dos-. # DOS
- .byte os_dos-. # Windows
- .byte os_dos-. # Windows
- .byte os_dos-. # Windows
- .byte os_unix-. # UNIX
- .byte os_linux-. # Linux
- .byte os_freebsd-. # FreeBSD
- .byte os_bsd-. # OpenBSD
+ .byte os_misc-.-1 # Unknown
+ .byte os_dos-.-1 # DOS
+ .byte os_dos-.-1 # DOS
+ .byte os_dos-.-1 # DOS
+ .byte os_dos-.-1 # Windows
+ .byte os_dos-.-1 # Windows
+ .byte os_dos-.-1 # Windows
+ .byte os_unix-.-1 # UNIX
+ .byte os_linux-.-1 # Linux
+ .byte os_freebsd-.-1 # FreeBSD
+ .byte os_bsd-.-1 # OpenBSD
os_misc: .ascii "?"; .byte '?'|0x80
os_dos: .ascii "DO"; .byte 'S'|0x80
@@ -240,13 +221,12 @@ os_linux: .ascii "Linu"; .byte 'x'|0x80
os_freebsd: .ascii "Free"
os_bsd: .ascii "BS"; .byte 'D'|0x80
- .org PRT_OFF-0xb,0x90
+ .org PRT_OFF-0x3,0x90
+
+opt: .byte 0x1 # Option
+ticks: .word 0xb6 # Delay
-drive: .ascii "Drive "
-nxtdrv: .byte 0x0 # Next drive number
-opt: .byte 0x0 # Option
-flags: .byte FLAGS # Flags
-ticks: .word TICKS # Delay
+partbl: .fill 0x40,0x1,0x0 # Partition table
+ .word 0xaa55 # Magic number
-partbl: .fill 0x40,0x1,0x0 # Partition table
- .word MAGIC # Magic number
+break: # Uninitialized data
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 2b581ec521cd5..e36df60f2a9bb 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 1998/11/08 15:36:34 rnordier Exp $
+# $Id: Makefile,v 1.6 1998/10/15 20:04:21 rnordier Exp $
PROG= boot2
NOMAN=
@@ -11,10 +11,6 @@ CLEANFILES+= boot1 boot1.out boot1.o \
M4?= m4
-BOOT_COMCONSOLE_PORT?= 0x3f8
-BOOT_COMCONSOLE_SPEED?= 9600
-B2SIOFMT?= 0x3
-
.if exists(${.OBJDIR}/../btx)
BTX= ${.OBJDIR}/../btx
.else
@@ -62,10 +58,7 @@ boot2.out: boot2.o sio.o
${BTX}/lib/crt0.o boot2.o sio.o
sio.o: sio.s
- (cd ${.CURDIR}; ${M4} -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
- -DSIOFMT=${B2SIOFMT} \
- -DSIOSPD=${BOOT_COMCONSOLE_SPEED} sio.s) | \
- ${AS} ${AFLAGS} -o ${.TARGET}
+ ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
diff --git a/sys/boot/i386/boot2/boot1.m4 b/sys/boot/i386/boot2/boot1.m4
index 06bdc9789331d..fc221a1854c1d 100644
--- a/sys/boot/i386/boot2/boot1.m4
+++ b/sys/boot/i386/boot2/boot1.m4
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: boot1.m4,v 1.2 1998/11/05 20:52:25 rnordier Exp $
+# $Id:$
define(_al,0x0)dnl
define(_cl,0x1)dnl
@@ -60,5 +60,3 @@ define(movbi1,`.byte 0xc6; .byte 0x40 | $3; .byte $2; .byte $1')dnl
define(callwi,`.byte 0xe8; .word $1 - . - 0x2')dnl
define(jmpnwi,`.byte 0xe9; .word $1 - . - 0x2')dnl
define(tstbi0,`.byte 0xf6; .byte $2; .byte $1')dnl
-define(tstbim,`.byte 0xf6; .byte 0x6; .word $2; .byte $1')dnl
-define(incw1,`.byte 0xff; .byte 0x40 | $2; .byte $1')dnl
diff --git a/sys/boot/i386/boot2/boot1.s b/sys/boot/i386/boot2/boot1.s
index 3161b748b8e92..8b408cebeff47 100644
--- a/sys/boot/i386/boot2/boot1.s
+++ b/sys/boot/i386/boot2/boot1.s
@@ -13,10 +13,11 @@
# purpose.
#
-# $Id: boot1.s,v 1.7 1999/01/10 13:29:51 peter Exp $
+# $Id: boot1.s,v 1.1.1.1 1998/10/12 21:16:26 rnordier Exp $
- .set MEM_REL,0x700 # Relocation address
- .set MEM_ARG,0x900 # Arguments
+ .set MEM_REL,0x600 # Relocation address
+ .set MEM_ARG,0x800 # Arguments
+ .set MEM_PKT,0x810 # Disk packet
.set MEM_ORG,0x7c00 # Origin
.set MEM_BUF,0x8c00 # Load area
.set MEM_BTX,0x9000 # BTX start
@@ -37,58 +38,59 @@ start: jmp main # Start recognizably
.org 0x4,0x90
-# External read from disk
-
-xread: pushl %ecx # Set
- pushl %eax # LBA
- pushl %es # Set transfer
- pushl %ebx # buffer
- pushl %edx # Set count:drive
+xread: pushl %cs # Address
+ popl %ds # data
+xread.1: movwir(MEM_PKT,_si) # Packet
+ movbr1(_al,0x2,_si_) # Blocks to read
+ o16 # Transfer
+ movwr1(_bx,0x4,_si_) # buffer
+ o16 # LBA
+ movwr1(_cx,0x8,_si_) # address
callwi(read) # Read from disk
- popl %edx # Pop all
- popl %ebx # registers
- popl %es # pushed, but
- popl %ecx # preserve
- popl %ecx # AX
- lret # To far caller
-
-# Bootstrap
+ lret # To caller
main: cld # String ops inc
- xorl %ecx,%ecx # Zero
- movl %cx,%es # Address
- movl %cx,%ds # data
- movl %cx,%ss # Set up
+ xorl %eax,%eax # Zero
+ movl %ax,%es # Address
+ movl %ax,%ds # data
+ movl %ax,%ss # Set up
movwir(start,_sp) # stack
movl %esp,%esi # Source
movwir(MEM_REL,_di) # Destination
- incb %ch # Word count
+ movwir(0x100,_cx) # Word count
rep # Copy
movsl # code
- movwir(part4,_si) # Partition
+ movb $0x10,%cl # Words to clear
+ rep # Zero
+ stosl # them
+ movbi1(0x10,-0x10,_di_) # Set packet size
cmpb $0x80,%dl # Hard drive?
jb main.4 # No
- movb $0x1,%dh # Block count
- callwi(nread) # Read MBR
- movwir(0x1,_cx) # Two passes
+ movwir(part4,_si) # Read master
+ movb $0x1,%al # boot
+ callwi(nread) # record
+ xorl %eax,%eax # Pass number
main.1: movwir(MEM_BUF+PRT_OFF,_si) # Partition table
movb $0x1,%dh # Partition
main.2: cmpbi1(PRT_BSD,0x4,_si_) # Our partition type?
jne main.3 # No
- jecxz main.5 # If second pass
tstbi0(0x80,_si_) # Active?
jnz main.5 # Yes
+ testb %al,%al # Second pass?
+ jnz main.5 # Yes
main.3: addl $0x10,%esi # Next entry
incb %dh # Partition
- cmpb $0x1+PRT_NUM,%dh # In table?
- jb main.2 # Yes
- decl %ecx # Do two
- jecxz main.1 # passes
+ cmpb $0x1+PRT_NUM,%dh # Done?
+ jb main.2 # No
+ incl %eax # Pass
+ cmpb $0x2,%al # Done?
+ jb main.1 # No
movwir(msg_part,_si) # Message
jmp error # Error
main.4: xorl %edx,%edx # Partition:drive
+ movwir(part4,_si) # Partition pointer
main.5: movwrm(_dx,MEM_ARG) # Save args
- movb $0x10,%dh # Sector count
+ movb $0x10,%al # Sector count
callwi(nread) # Read disk
movwir(MEM_BTX,_bx) # BTX
movw1r(0xa,_bx_,_si) # Point past
@@ -107,34 +109,33 @@ main.5: movwrm(_dx,MEM_ARG) # Save args
# Enable A20
-seta20: cli # Disable interrupts
-seta20.1: inb $0x64,%al # Get status
+seta20: inb $0x64,%al # Get status
testb $0x2,%al # Busy?
- jnz seta20.1 # Yes
+ jnz seta20 # Yes
movb $0xd1,%al # Command: Write
outb %al,$0x64 # output port
-seta20.2: inb $0x64,%al # Get status
+seta20.1: inb $0x64,%al # Get status
testb $0x2,%al # Busy?
- jnz seta20.2 # Yes
+ jnz seta20.1 # Yes
movb $0xdf,%al # Enable
outb %al,$0x60 # A20
- sti # Enable interrupts
ret # To caller
-# Local read from disk
+# Read from disk
-nread: movwir(MEM_BUF,_bx) # Transfer buffer
- movw1r(0x8,_si_,_ax) # Get
- movw1r(0xa,_si_,_cx) # LBA
+nread: xorw %bx,%bx # Transfer
+ movb $MEM_BUF>>0x8,%bh # buffer
+ o16 # LBA
+ movw1r(0x8,_si_,_cx) # address
pushl %cs # Read from
- callwi(xread) # disk
+ callwi(xread.1) # disk
jnc return # If success
movwir(msg_read,_si) # Message
# Error exit
error: callwi(putstr) # Display message
- movwir(prompt,_si) # Display
+ movwir(msg_boot,_si) # Display
callwi(putstr) # prompt
xorb %ah,%ah # BIOS: Get
int $0x16 # keypress
@@ -149,24 +150,40 @@ putstr: lodsb # Get char
testb %al,%al # End of string?
jne putstr.0 # No
-ereturn: movb $0x1,%ah # Invalid
- stc # argument
-return: ret # To caller
+return: ret # Generic return
# Read from disk
-read: movl %esp,%ebp # Address stack frame
+read: testb %dh,%dh # Try for extensions?
+ jz read.3 # No
+ movwir(0x55aa,_bx) # Magic
pushl %edx # Save
+ movb $0x41,%ah # BIOS: Check
+ int $0x13 # extensions present
+ popl %edx # Restore
+ jc read.3 # If error
+ cmpwir(0xaa55,_bx) # Magic?
+ jne read.3 # No
+ testb $0x1,%cl # Packet interface?
+ jz read.3 # No
+ movb $0x42,%ah # BIOS: Extended
+ int $0x13 # read
+ ret # To caller
+
+read.1: movb $0x1,%ah # Invalid
+ stc # parameter
+read.2: ret # To caller
+
+read.3: pushl %edx # Save
movb $0x8,%ah # BIOS: Get drive
int $0x13 # parameters
movb %dh,%ch # Max head number
popl %edx # Restore
- jc return # If error
+ jc read.2 # If error
andb $0x3f,%cl # Sectors per track
- jz ereturn # If zero
- cli # Disable interrupts
+ jz read.1 # If zero
o16 # Get
- movw1r(0x8,_bp_,_ax) # LBA
+ movw1r(0x8,_si_,_ax) # LBA
pushl %edx # Save
movzbw %cl,%bx # Divide by
xorw %dx,%dx # sectors
@@ -174,14 +191,13 @@ read: movl %esp,%ebp # Address stack frame
movb %ch,%bl # Max head number
movb %dl,%ch # Sector number
incl %ebx # Divide by
- xorb %dl,%dl # number
- divw %bx,%ax # of heads
+ xorb %dl,%dl # number of
+ divw %bx,%ax # heads
movb %dl,%bh # Head number
popl %edx # Restore
o16 # Cylinder number
cmpl $0x3ff,%eax # supportable?
- sti # Enable interrupts
- ja ereturn # No
+ ja read.1 # No
xchgb %al,%ah # Set up cylinder
rorb $0x2,%al # number
orb %ch,%al # Merge
@@ -189,39 +205,37 @@ read: movl %esp,%ebp # Address stack frame
xchgl %eax,%ecx # number
movb %bh,%dh # Head number
subb %ah,%al # Sectors this track
- movb1r(0x3,_bp_,_ah) # Blocks to read
+ movb1r(0x2,_si_,_ah) # Blocks to read
cmpb %ah,%al # To read
- jb read.1 # this
+ jb read.4 # this
movb %ah,%al # track
-read.1: movwir(0x5,_di) # Try count
-read.2: lesw1r(0x4,_bp_,_bx) # Transfer buffer
+read.4: movwir(0x5,_bp) # Try count
+read.5: lesw1r(0x4,_si_,_bx) # Transfer buffer
pushl %eax # Save
- movb $0x2,%ah # BIOS: Read
- int $0x13 # from disk
+ movb $0x2,%ah # BIOS: Conventional
+ int $0x13 # read
popl %ebx # Restore
- jnc read.3 # If success
- decl %edi # Retry?
- jz read.5 # No
+ jnc read.6 # If success
+ decl %ebp # Retry?
+ jz read.7 # No
xorb %ah,%ah # BIOS: Reset
int $0x13 # disk system
- xchgl %ebx,%eax # Block count
- jmp read.2 # Continue
-read.3: movzbl %bl,%eax # Sectors read
- addwr1(_ax,0x8,_bp_) # Adjust
- jnc read.4 # LBA,
- incw1(0xa,_bp_) # transfer
-read.4: shlb %bl # buffer
- addbr1(_bl,0x5,_bp_) # pointer,
- subbr1(_al,0x3,_bp_) # block count
- ja read # If not done
-read.5: ret # To caller
+ movl %ebx,%eax # Block count
+ jmp read.5 # Continue
+read.6: movzbw %bl,%ax # Sectors read
+ o16 # Adjust
+ addwr1(_ax,0x8,_si_) # LBA,
+ shlb %bl # buffer
+ addbr1(_bl,0x5,_si_) # pointer,
+ subbr1(_al,0x2,_si_) # block count
+ ja read.3 # If not done
+read.7: ret # To caller
# Messages
-msg_read: .asciz "Read"
-msg_part: .asciz "Boot"
-
-prompt: .asciz " error\r\n"
+msg_read: .asciz "Read error"
+msg_part: .asciz "No bootable partition"
+msg_boot: .asciz "\r\nHit return to reboot: "
.org PRT_OFF,0x90
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c
index fa6058bcccb76..bf9ed8c61f54b 100644
--- a/sys/boot/i386/boot2/boot2.c
+++ b/sys/boot/i386/boot2/boot2.c
@@ -14,7 +14,7 @@
*/
/*
- * $Id: boot2.c,v 1.17 1999/01/10 13:29:52 peter Exp $
+ * $Id: boot2.c,v 1.6 1998/10/13 23:43:38 rnordier Exp $
*/
#include <sys/param.h>
@@ -53,9 +53,11 @@
#define PATH_CONFIG "/boot.config"
#define PATH_BOOT3 "/boot/loader"
#define PATH_KERNEL "/kernel"
+#define PATH_HELP "boot.help"
-#define ARGS 0x900
+#define ARGS 0x800
#define NOPT 11
+#define XOPT 2
#define BSIZEMAX 8192
#define NDEV 5
#define MEM_BASE 0x12
@@ -102,6 +104,7 @@ static struct dsk {
} dsk;
static char cmd[512];
static char kname[1024];
+static char help[2048];
static uint32_t opts;
static struct bootinfo bootinfo;
static int ls;
@@ -136,7 +139,7 @@ static int getc(int);
int
main(void)
{
- int autoboot, i;
+ int autoboot, helpon, i;
v86.ctl = V86_FLAGS;
dsk.drive = *(uint8_t *)PTOV(ARGS);
@@ -151,14 +154,11 @@ main(void)
for (i = 0; i < N_BIOS_GEOM; i++)
bootinfo.bi_bios_geom[i] = drvinfo(i);
autoboot = 2;
+ helpon = 1;
readfile(PATH_CONFIG, cmd, sizeof(cmd));
- if (*cmd) {
- printf("%s: %s", PATH_CONFIG, cmd);
- if (parse(cmd))
- autoboot = 0;
- *cmd = 0;
- }
- if (autoboot && !*kname) {
+ if (parse(cmd))
+ autoboot = 0;
+ else if (!*kname) {
if (autoboot == 2) {
memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
if (!keyhit(0x37)) {
@@ -169,21 +169,21 @@ main(void)
if (autoboot == 1)
memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));
}
+ readfile(PATH_HELP, help, sizeof(help));
for (;;) {
printf(" \n>> FreeBSD/i386 BOOT\n"
"Default: %u:%s(%u,%c)%s\n"
+ "%s"
"boot: ",
dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,
- 'a' + dsk.part, kname);
+ 'a' + dsk.part, kname, helpon ? help : "");
if (ioctrl & 0x2)
sio_flush();
if (!autoboot || keyhit(0x5a))
getstr(cmd, sizeof(cmd));
- else
- putchar('\n');
- autoboot = 0;
+ autoboot = helpon = 0;
if (parse(cmd))
- putchar('\a');
+ helpon = 1;
else
load(kname);
}
@@ -226,16 +226,22 @@ load(const char *fname)
if (fmt == 0) {
addr = hdr.ex.a_entry & 0xffffff;
p = PTOV(addr);
+ printf("%s=0x%x ", "text", (unsigned)hdr.ex.a_text);
fs_off = PAGE_SIZE;
if (xfsread(ino, p, hdr.ex.a_text))
return;
p += roundup2(hdr.ex.a_text, PAGE_SIZE);
+ printf("%s=0x%x ", "data", (unsigned)hdr.ex.a_data);
if (xfsread(ino, p, hdr.ex.a_data))
return;
- p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE);
+ p += hdr.ex.a_data;
+ printf("%s=0x%x ", "bss", (unsigned)hdr.ex.a_bss);
+ p += roundup2(hdr.ex.a_bss, PAGE_SIZE);
bootinfo.bi_symtab = VTOP(p);
memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms));
p += sizeof(hdr.ex.a_syms);
+ printf("symbols=[");
+ printf("+0x%x", (unsigned)hdr.ex.a_syms);
if (hdr.ex.a_syms) {
if (xfsread(ino, p, hdr.ex.a_syms))
return;
@@ -245,6 +251,7 @@ load(const char *fname)
x = *(uint32_t *)p;
p += sizeof(int);
x -= sizeof(int);
+ printf("+0x%x", x);
if (xfsread(ino, p, x))
return;
p += x;
@@ -259,12 +266,15 @@ load(const char *fname)
}
for (i = 0; i < 2; i++) {
p = PTOV(ep[i].p_paddr & 0xffffff);
+ printf("%s=0x%x ", !i ? "text" : "data", ep[i].p_filesz);
fs_off = ep[i].p_offset;
if (xfsread(ino, p, ep[i].p_filesz))
return;
}
+ printf("%s=0x%x ", "bss", ep[1].p_memsz - ep[1].p_filesz);
p += roundup2(ep[1].p_memsz, PAGE_SIZE);
bootinfo.bi_symtab = VTOP(p);
+ printf("symbols=[");
if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) {
fs_off = hdr.eh.e_shoff + sizeof(es[0]) *
(hdr.eh.e_shstrndx + 1);
@@ -273,6 +283,7 @@ load(const char *fname)
for (i = 0; i < 2; i++) {
memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size));
p += sizeof(es[i].sh_size);
+ printf("+0x%x", es[i].sh_size);
fs_off = es[i].sh_offset;
if (xfsread(ino, p, es[i].sh_size))
return;
@@ -282,6 +293,7 @@ load(const char *fname)
addr = hdr.eh.e_entry & 0xffffff;
}
bootinfo.bi_esymtab = VTOP(p);
+ printf("]\nentry=0x%x\n", addr);
bootinfo.bi_kernelname = VTOP(fname);
__exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
MAKEBOOTDEV(dsk.type, 0, dsk.slice, dsk.unit, dsk.part),
@@ -305,14 +317,16 @@ parse(char *arg)
for (i = 0; c != optstr[i]; i++)
if (i == NOPT - 1)
return -1;
- opts ^= 1 << flags[i];
+ if (i < XOPT)
+ opts ^= 1 << flags[i];
+ else
+ opts |= 1 << flags[i];
}
if (opts & 1 << RBX_PROBEKBD) {
i = *(uint8_t *)PTOV(0x496) & 0x10;
printf("Keyboard: %s\n", i ? "yes" : "no");
if (!i)
opts |= 1 << RBX_DUAL | 1 << RBX_SERIAL;
- opts &= ~(1 << RBX_PROBEKBD);
}
ioctrl = opts & 1 << RBX_DUAL ? 0x3 :
opts & 1 << RBX_SERIAL ? 0x2 : 0x1;
@@ -469,7 +483,7 @@ fsread(ino_t inode, void *buf, size_t nbyte)
return -1;
}
fsblks = fs.fs_bsize >> DEV_BSHIFT;
- dsk.meta++;
+ dsk.meta = 1;
}
if (!inode)
return 0;
@@ -630,15 +644,9 @@ getstr(char *str, int size)
s = str;
do {
switch (c = getchar()) {
- case 0:
- break;
case '\b':
- if (s > str) {
+ if (s > str)
s--;
- putchar(c);
- putchar(' ');
- } else
- c = 0;
break;
case '\n':
*s = 0;
@@ -647,8 +655,7 @@ getstr(char *str, int size)
if (s - str < size - 1)
*s++ = c;
}
- if (c)
- putchar(c);
+ putchar(c);
} while (c != '\n');
}
@@ -731,12 +738,11 @@ drvread(void *buf, unsigned lba, unsigned nblk)
printf("%c\b", c = c << 8 | c >> 24);
v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS;
- v86.addr = 0x704; /* call to xread in boot1 */
- v86.es = VTOPSEG(buf);
- v86.eax = lba;
- v86.ebx = VTOPOFF(buf);
- v86.ecx = lba >> 16;
- v86.edx = nblk << 8 | dsk.drive;
+ v86.addr = 0x604;
+ v86.eax = nblk;
+ v86.ebx = VTOPSEG(buf) << 16 | VTOPOFF(buf);
+ v86.ecx = lba;
+ v86.edx = 0x100 | dsk.drive;
v86int();
v86.ctl = V86_FLAGS;
if (V86_CY(v86.efl)) {
diff --git a/sys/boot/i386/boot2/sio.s b/sys/boot/i386/boot2/sio.s
index 92237b852b729..985ac04ef469e 100644
--- a/sys/boot/i386/boot2/sio.s
+++ b/sys/boot/i386/boot2/sio.s
@@ -13,11 +13,11 @@
# purpose.
#
-# $Id: sio.s,v 1.2 1998/10/20 20:20:48 rnordier Exp $
+# $Id:$
- .set SIO_PRT,SIOPRT # Base port
- .set SIO_FMT,SIOFMT # 8N1
- .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD
+ .set SIO_PRT,0x3f8 # Base port
+ .set SIO_FMT,0x3 # 8N1
+ .set SIO_DIV,0xc # 115200 / 9600
.globl sio_init
.globl sio_flush
diff --git a/sys/boot/i386/btx/btx/btx.s b/sys/boot/i386/btx/btx/btx.s
index 92842626d00ff..d94fa2c11a27a 100644
--- a/sys/boot/i386/btx/btx/btx.s
+++ b/sys/boot/i386/btx/btx/btx.s
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: btx.s,v 1.7 1998/11/01 13:52:52 rnordier Exp $
+# $Id: btx.s,v 1.5 1998/10/03 18:05:12 rnordier Exp $
#
# Memory layout.
@@ -340,7 +340,7 @@ intx00: pushb $0x0 # Int 0x0: #DE
intx10: pushb $0x10 # Int 0x10: #MF
jmp ex_noc # Floating-point error
#
-# Handle #GP exception.
+#
#
ex_v86: testb $0x2,0x12(%esp,1) # V86 mode?
jz except # No
@@ -459,7 +459,7 @@ v86mon.1: lodsb # Get opcode
v86mon.2: cmpb $0xf4,%al # HLT?
jne v86mon.3 # No
cmpl $inthlt+0x1,%esi # Is inthlt?
- jne v86mon.6 # No (ignore)
+ jne v86mon.4 # No
jmp intrtn # Return to user mode
v86mon.3: cmpb $0xfa,%al # CLI?
je v86cli # Yes
@@ -479,13 +479,13 @@ v86mon.3: cmpb $0xfa,%al # CLI?
cmpb $0xcf,%al # IRET/IRETD?
je v86iret # Yes
popl %ebx # Restore
- popa # Restore
+v86mon.4: popa # Restore
jmp except # Handle exception
-v86mon.4: movl %edx,0x30(%ebp) # Save V86 flags
-v86mon.5: popl %edx # V86 SS adjustment
+v86mon.5: movl %edx,0x30(%ebp) # Save V86 flags
+v86mon.6: popl %edx # V86 SS adjustment
subl %edx,%ebx # Save V86
movl %ebx,0x34(%ebp) # SP
-v86mon.6: subl %edi,%esi # From linear
+v86mon.7: subl %edi,%esi # From linear
movl %esi,0x28(%ebp) # Save V86 IP
popa # Restore
leal 0x8(%esp,1),%esp # Discard int no, error
@@ -494,12 +494,12 @@ v86mon.6: subl %edi,%esi # From linear
# Emulate CLI.
#
v86cli: andb $~0x2,0x31(%ebp) # Clear IF
- jmp v86mon.6 # Finish up
+ jmp v86mon.7 # Finish up
#
# Emulate STI.
#
v86sti: orb $0x2,0x31(%ebp) # Set IF
- jmp v86mon.6 # Finish up
+ jmp v86mon.7 # Finish up
#
# Emulate PUSHF/PUSHFD.
#
@@ -508,7 +508,7 @@ v86pushf: subl %ecx,%ebx # Adjust SP
je v86pushf.1 # Yes
o16 # 16-bit
v86pushf.1: movl %edx,(%ebx) # Save flags
- jmp v86mon.5 # Finish up
+ jmp v86mon.6 # Finish up
#
# Emulate IRET/IRETD.
#
@@ -529,7 +529,7 @@ v86popf.1: movl (%ebx),%eax # Load flags
andl $V86_FLG,%eax # Merge
andl $~V86_FLG,%edx # the
orl %eax,%edx # flags
- jmp v86mon.4 # Finish up
+ jmp v86mon.5 # Finish up
#
# Emulate INT imm8.
#
@@ -546,7 +546,7 @@ v86intn: lodsb # Get int no
movl %edi,0x2c(%ebp) # Save CS
xorl %edi,%edi # No ESI adjustment
andb $~0x3,%dh # Clear IF and TF
- jmp v86mon.4 # Finish up
+ jmp v86mon.5 # Finish up
#
# Hardware interrupt jump table.
#
@@ -693,12 +693,12 @@ intusr.4: shrl $0x4,%eax # Gives segment
xchgl %eax,%ebp # Get int no/address
testb $0x1,%dl # Address?
jnz intusr.5 # Yes
- shll $0x2,%eax # Scale
+ shll $0x2,%eax # XXX Scale
movl (%eax),%eax # Load int vector
-intusr.5: movl %eax,%ecx # Save
+intusr.5: movl %eax,%ecx # XXX Save
shrl $0x10,%eax # Gives segment
stosl # Set CS
- movw %cx,%ax # Restore
+ movw %cx,%ax # XXX Restore
stosl # Set EIP
leal 0x10(%esp,1),%esp # Discard seg regs
popa # Restore
@@ -755,7 +755,7 @@ dump.1: testb $DMP_X32,%ch # Dump long?
dump.2: testb $DMP_MEM,%ch # Dump memory?
jz dump.8 # No
pushl %ds # Save
- testb $0x2,0x52(%ebx) # V86 mode?
+ testb $0x2,0x52(%ebx) # XXX V86 mode?
jnz dump.3 # Yes
verrl 0x4(%esi) # Readable selector?
jnz dump.3 # No
diff --git a/sys/boot/i386/btx/btxldr/Makefile b/sys/boot/i386/btx/btxldr/Makefile
index 32cb4adb0b8e1..9df9681867ec7 100644
--- a/sys/boot/i386/btx/btxldr/Makefile
+++ b/sys/boot/i386/btx/btxldr/Makefile
@@ -1,7 +1,6 @@
-# $Id: Makefile,v 1.5 1998/10/13 18:29:18 rnordier Exp $
+# $Id: Makefile,v 1.4 1998/09/25 17:14:15 peter Exp $
ORG=0x100000
-AFLAGS+= --assembler-with-cpp
all: btxldr
@@ -15,7 +14,7 @@ btxldr: btxldr.o
.endif
btxldr.o: btxldr.s
- ${CC} ${AFLAGS} -c -o ${.TARGET} ${.CURDIR}/btxldr.s
+ ${AS} ${AFLAGS} -o ${.TARGET} ${.CURDIR}/btxldr.s
CLEANFILES+= btxldr btxldr.out btxldr.o
diff --git a/sys/boot/i386/btx/btxldr/btxldr.s b/sys/boot/i386/btx/btxldr/btxldr.s
index a3172e3e3cb5d..7a6bd50b1a152 100644
--- a/sys/boot/i386/btx/btxldr/btxldr.s
+++ b/sys/boot/i386/btx/btxldr/btxldr.s
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: btxldr.s,v 1.3 1998/10/06 07:15:35 rnordier Exp $
+# $Id: btxldr.s,v 1.2 1998/10/06 06:13:36 msmith Exp $
#
# Prototype BTX loader program, written in a couple of hours. The
@@ -70,24 +70,24 @@ start: cld # String ops inc
shll $0xa,%eax # in bytes
movl %eax,%ebp # Base of user stack
movl $m_mem,%esi # Display
- call dhexout # amount of
- call dputstr # base memory
+ call hexout # amount of
+ call putstr # base memory
lgdt gdtdesc # Load new GDT
#
# Relocate caller's arguments.
#
movl $m_esp,%esi # Display
movl %esp,%eax # caller's
- call dhexout # stack
- call dputstr # pointer
+ call hexout # stack
+ call putstr # pointer
movl $m_args,%esi # Format string
leal 0x4(%esp,1),%ebx # First argument
movl $0x6,%ecx # Count
start.1: movl (%ebx),%eax # Get argument and
addl $0x4,%ebx # bump pointer
- call dhexout # Display it
+ call hexout # Display it
loop start.1 # Till done
- call dputstr # End message
+ call putstr # End message
movl $0x48,%ecx # Allocate space
subl %ecx,%ebp # for bootinfo
movl 0x18(%esp,1),%esi # Source
@@ -97,8 +97,8 @@ start.1: movl (%ebx),%eax # Get argument and
movl %ebp,0x18(%esp,1) # Update pointer
movl $m_rel_bi,%esi # Display
movl %ebp,%eax # bootinfo
- call dhexout # relocation
- call dputstr # message
+ call hexout # relocation
+ call putstr # message
movl $0x18,%ecx # Allocate space
subl %ecx,%ebp # for arguments
leal 0x4(%esp,1),%esi # Source
@@ -107,8 +107,8 @@ start.1: movl (%ebx),%eax # Get argument and
movsb # them
movl $m_rel_args,%esi # Display
movl %ebp,%eax # argument
- call dhexout # relocation
- call dputstr # message
+ call hexout # relocation
+ call putstr # message
#
# Set up BTX kernel.
#
@@ -145,16 +145,16 @@ start.1: movl (%ebx),%eax # Get argument and
movl %esi,%ebx # Keep place
movl $m_rel_btx,%esi # Restore
popl %eax # parameters
- call dhexout # and
+ call hexout # and
popl %ebp # display
movl %ebp,%eax # the
- call dhexout # relocation
- call dputstr # message
+ call hexout # relocation
+ call putstr # message
addl $PAG_SIZ,%ebp # Display
movl $m_base,%esi # the
movl %ebp,%eax # user
- call dhexout # base
- call dputstr # address
+ call hexout # base
+ call putstr # address
#
# Set up ELF-format client program.
#
@@ -164,7 +164,7 @@ start.1: movl (%ebx),%eax # Get argument and
call putstr # message
start.2: jmp start.2 # Hang
start.3: movl $m_elf,%esi # Display ELF
- call dputstr # message
+ call putstr # message
movl $m_segs,%esi # Format string
movl $0x2,%edi # Segment count
movl 0x1c(%ebx),%edx # Get e_phoff
@@ -173,14 +173,14 @@ start.3: movl $m_elf,%esi # Display ELF
start.4: cmpl $0x1,(%edx) # Is p_type PT_LOAD?
jne start.6 # No
movl 0x4(%edx),%eax # Display
- call dhexout # p_offset
+ call hexout # p_offset
movl 0x8(%edx),%eax # Display
- call dhexout # p_vaddr
+ call hexout # p_vaddr
movl 0x10(%edx),%eax # Display
- call dhexout # p_filesz
+ call hexout # p_filesz
movl 0x14(%edx),%eax # Display
- call dhexout # p_memsz
- call dputstr # End message
+ call hexout # p_memsz
+ call putstr # End message
pushl %esi # Save
pushl %edi # working
pushl %ecx # registers
@@ -205,7 +205,7 @@ start.5: popl %ecx # Restore
start.6: addl $0x20,%edx # To next entry
loop start.4 # Till done
start.7: movl $m_done,%esi # Display done
- call dputstr # message
+ call putstr # message
movl $start.8,%esi # Real mode stub
movl $MEM_STUB,%edi # Destination
movl $SIZ_STUB,%ecx # Size
@@ -229,10 +229,6 @@ start.9:
#
# Output message [ESI] followed by EAX in hex.
#
-dhexout:
-#ifndef BTXLDR_VERBOSE
- ret
-#endif
hexout: pushl %eax # Save
call putstr # Display message
popl %eax # Restore
@@ -258,12 +254,6 @@ hexout.2: decl %esi # Adjust for inc
#
# Output zero-terminated string [ESI] to the console.
#
-dputstr:
-#ifndef BTXLDR_VERBOSE
- ret
-#else
- jmp putstr
-#endif
putstr.0: call putchr # Output char
putstr: lodsb # Load char
testb %al,%al # End of string?
@@ -272,10 +262,6 @@ putstr: lodsb # Load char
#
# Output character AL to the console.
#
-dputchr:
-#ifndef BTXLDR_VERBOSE
- ret
-#endif
putchr: pusha # Save
xorl %ecx,%ecx # Zero for loops
movb $SCR_MAT,%ah # Mode/attribute
@@ -351,10 +337,7 @@ gdtdesc: .word gdt.1-gdt-1 # Limit
#
# Messages.
#
-m_logo: .asciz "\nBTX loader 0.01 "
-m_vers: .asciz "BTX version is \0\n"
-e_fmt: .asciz "Error: Client format not supported\n"
-#ifdef BTXLDR_VERBOSE
+m_logo: .asciz "\nBTX loader 0.01\n"
m_mem: .asciz "Starting in protected mode (base mem=\0)\n"
m_esp: .asciz "Arguments passed (esp=\0):\n"
m_args: .asciz"<howto="
@@ -365,8 +348,10 @@ m_args: .asciz"<howto="
.asciz" bootinfo=\0>\n"
m_rel_bi: .asciz "Relocated bootinfo (size=48) to \0\n"
m_rel_args: .asciz "Relocated arguments (size=18) to \0\n"
+m_vers: .asciz "BTX version is \0\n"
m_rel_btx: .asciz "Relocated kernel (size=\0) to \0\n"
m_base: .asciz "Client base address is \0\n"
+e_fmt: .asciz "Error: Client format not supported\n"
m_elf: .asciz "Client format is ELF\n"
m_segs: .asciz "text segment: offset="
.asciz " vaddr="
@@ -377,7 +362,6 @@ m_segs: .asciz "text segment: offset="
.asciz " filesz="
.asciz " memsz=\0\n"
m_done: .asciz "Loading complete\n"
-#endif
#
# Uninitialized data area.
#
diff --git a/sys/boot/i386/btx/lib/btxv86.s b/sys/boot/i386/btx/lib/btxv86.s
index 46709a39540c8..b67e873510e58 100644
--- a/sys/boot/i386/btx/lib/btxv86.s
+++ b/sys/boot/i386/btx/lib/btxv86.s
@@ -13,7 +13,7 @@
# purpose.
#
-# $Id: btxv86.s,v 1.1 1998/09/14 10:37:00 rnordier Exp $
+# $Id:$
#
# BTX V86 interface.
@@ -48,13 +48,11 @@
#
# V86 interface function.
#
-__v86int: popl __v86ret # Save return address
- pushl $__v86 # Push pointer
+__v86int: pushl $__v86 # Push pointer
call __v86_swap # Load V86 registers
int $INT_V86 # To BTX
call __v86_swap # Load user registers
addl $0x4,%esp # Discard pointer
- pushl __v86ret # Restore return address
ret # To user
#
# Swap V86 and user registers.
@@ -82,4 +80,3 @@ __v86_swap: xchgl %ebp,0x4(%esp,1) # Swap pointer, EBP
# V86 interface structure.
#
.comm __v86,SIZ_V86
- .comm __v86ret,4
diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile
index 2cfd2e345956a..ec22662921de5 100644
--- a/sys/boot/i386/libi386/Makefile
+++ b/sys/boot/i386/libi386/Makefile
@@ -1,39 +1,26 @@
-# $Id: Makefile,v 1.12 1998/12/22 11:51:25 abial Exp $
+# $Id: Makefile,v 1.7 1998/09/30 22:36:45 peter Exp $
#
-LIB= i386
+LIB= i386
NOPIC=
NOPROFILE=
-INTERNALLIB= true
+INTERNALLIB= true
INTERNALSTATICLIB= true
-SRCS= aout_freebsd.c biosdisk.c biosmem.c biospnp.c biospci.c \
- bootinfo.c comconsole.c devicename.c elf_freebsd.c gatea20.c \
- i386_copy.c i386_module.c time.c vidconsole.c
+SRCS= aout_freebsd.c biosdisk.c biosmem.c bootinfo.c comconsole.c \
+ devicename.c elf_freebsd.c gatea20.c i386_copy.c i386_module.c time.c vidconsole.c
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \
-I${.CURDIR}/../../.. -I.
-BOOT_COMCONSOLE_PORT?= 0x3f8
-CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT}
-
-BOOT_COMCONSOLE_SPEED?= 9600
-CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
-
# Make the disk code more talkative
#CFLAGS+= -DDISK_DEBUG
-# Include simple terminal emulation (cons25-compatible)
-CFLAGS+= -DTERM_EMU
-
-# If it's not there, don't consider it a target
-.if exists(${.CURDIR}/../../../i386/include)
-beforedepend ${OBJS}: machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
-.endif
-
CLEANFILES+= machine
.include <bsd.lib.mk>
+
+beforedepend ${OBJS}: machine
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c
index 8b102aefbd5d6..1337a92ac0d95 100644
--- a/sys/boot/i386/libi386/biosdisk.c
+++ b/sys/boot/i386/libi386/biosdisk.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: biosdisk.c,v 1.19 1999/01/09 02:36:19 msmith Exp $
+ * $Id: biosdisk.c,v 1.13 1998/10/11 10:01:55 peter Exp $
*/
/*
@@ -101,14 +101,10 @@ static int bd_read(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest);
static int bd_int13probe(struct bdinfo *bd);
-static void bd_printslice(struct open_disk *od, int offset, char *prefix);
-
static int bd_init(void);
static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
static int bd_open(struct open_file *f, ...);
static int bd_close(struct open_file *f);
-static void bd_print(int verbose);
struct devsw biosdisk = {
"disk",
@@ -117,8 +113,7 @@ struct devsw biosdisk = {
bd_strategy,
bd_open,
bd_close,
- noioctl,
- bd_print
+ noioctl
};
static int bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev);
@@ -174,6 +169,7 @@ bd_init(void)
/* XXX we need "disk aliases" to make this simpler */
printf("BIOS drive %c: is disk%d\n",
(unit < 0x80) ? ('A' + unit) : ('C' + unit - 0x80), nbdinfo);
+ bdinfo[nbdinfo].bd_unit = unit;
nbdinfo++;
}
}
@@ -204,91 +200,6 @@ bd_int13probe(struct bdinfo *bd)
}
/*
- * Print information about disks
- */
-static void
-bd_print(int verbose)
-{
- int i, j;
- char line[80];
- struct i386_devdesc dev;
- struct open_disk *od;
- struct dos_partition *dptr;
-
- for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: BIOS drive %c:\n", i,
- (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit) : ('C' + bdinfo[i].bd_unit - 0x80));
- pager_output(line);
-
- /* try to open the whole disk */
- dev.d_kind.biosdisk.unit = i;
- dev.d_kind.biosdisk.slice = -1;
- dev.d_kind.biosdisk.partition = -1;
-
- if (!bd_opendisk(&od, &dev)) {
-
- /* Do we have a partition table? */
- if (od->od_flags & BD_PARTTABOK) {
- dptr = &od->od_parttab[0];
-
- /* Check for a "truly dedicated" disk */
- if ((dptr[3].dp_typ == DOSPTYP_386BSD) &&
- (dptr[3].dp_start == 0) &&
- (dptr[3].dp_size == 50000)) {
- sprintf(line, " disk%d", i);
- bd_printslice(od, 0, line);
- } else {
- for (j = 0; j < NDOSPART; j++) {
- switch(dptr[j].dp_typ) {
- case DOSPTYP_386BSD:
- sprintf(line, " disk%ds%d", i, j + 1);
- bd_printslice(od, dptr[j].dp_start, line);
- break;
- default:
- }
- }
-
- }
- }
- bd_closedisk(od);
- }
- }
-}
-
-static void
-bd_printslice(struct open_disk *od, int offset, char *prefix)
-{
- char line[80];
- u_char buf[BIOSDISK_SECSIZE];
- struct disklabel *lp;
- int i;
-
- /* read disklabel */
- if (bd_read(od, offset + LABELSECTOR, 1, buf))
- return;
- lp =(struct disklabel *)(&buf[0]);
- if (lp->d_magic != DISKMAGIC) {
- sprintf(line, "%s: bad disklabel\n");
- pager_output(line);
- return;
- }
-
- /* Print partitions */
- for (i = 0; i < lp->d_npartitions; i++) {
- if ((lp->d_partitions[i].p_fstype == FS_BSDFFS) || (lp->d_partitions[i].p_fstype == FS_SWAP) ||
- ((lp->d_partitions[i].p_fstype == FS_UNUSED) &&
- (od->od_flags & BD_FLOPPY) && (i == 0))) { /* Floppies often have bogus fstype, print 'a' */
- sprintf(line, " %s%c: %s %.6dMB (%d - %d)\n", prefix, 'a' + i,
- (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap" : "FFS",
- lp->d_partitions[i].p_size / 2048, /* 512-byte sector assumption */
- lp->d_partitions[i].p_offset, lp->d_partitions[i].p_offset + lp->d_partitions[i].p_size);
- pager_output(line);
- }
- }
-}
-
-
-/*
* Attempt to open the disk described by (dev) for use by (f).
*
* Note that the philosophy here is "give them exactly what
@@ -391,14 +302,8 @@ bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev)
dptr = &od->od_parttab[0];
od->od_flags |= BD_PARTTABOK;
- /* Is this a request for the whole disk? */
- if (dev->d_kind.biosdisk.slice == -1) {
- sector == 0;
- goto unsliced;
- }
-
/* Try to auto-detect the best slice; this should always give a slice number */
- if (dev->d_kind.biosdisk.slice == 0)
+ if (dev->d_kind.biosdisk.slice < 1)
dev->d_kind.biosdisk.slice = bd_bestslice(dptr);
switch (dev->d_kind.biosdisk.slice) {
@@ -406,7 +311,6 @@ bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev)
error = ENOENT;
goto out;
case 0:
- sector = 0;
goto unsliced;
default:
break;
@@ -570,16 +474,6 @@ bd_closedisk(struct open_disk *od)
static int
bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
{
- struct bcache_devdata bcd;
-
- bcd.dv_strategy = bd_realstrategy;
- bcd.dv_devdata = devdata;
- return(bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
-}
-
-static int
-bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
-{
struct open_disk *od = (struct open_disk *)(((struct i386_devdesc *)devdata)->d_kind.biosdisk.data);
int blks;
#ifdef BD_SUPPORT_FRAGS
@@ -747,10 +641,7 @@ bd_getgeom(struct open_disk *od)
}
/*
- * Return a suitable dev_t value for (dev).
- *
- * In the case where it looks like (dev) is a SCSI disk, we allow the number of
- * IDE disks to be specified in $num_ide_disks. There should be a Better Way.
+ * Return a suitable dev_t value for (dev)
*/
int
bd_getdev(struct i386_devdesc *dev)
@@ -759,8 +650,6 @@ bd_getdev(struct i386_devdesc *dev)
int biosdev;
int major;
int rootdev;
- char *nip, *cp;
- int unitofs = 0;
biosdev = bd_unit2bios(dev->d_kind.biosdisk.unit);
DEBUG("unit %d BIOS device %d", dev->d_kind.biosdisk.unit, biosdev);
@@ -783,13 +672,6 @@ bd_getdev(struct i386_devdesc *dev)
if ((od->od_flags & BD_LABELOK) && (od->od_disklabel.d_type == DTYPE_SCSI)) {
/* label OK, disk labelled as SCSI */
major = DAMAJOR;
- /* check for unit number correction hint */
- if ((nip = getenv("num_ide_disks")) != NULL) {
- unitofs = strtol(nip, &cp, 0);
- /* check for parse error */
- if ((cp == nip) || (*cp != 0))
- unitofs = 0;
- }
} else {
/* assume an IDE disk */
major = WDMAJOR;
@@ -798,7 +680,7 @@ bd_getdev(struct i386_devdesc *dev)
rootdev = MAKEBOOTDEV(major,
(dev->d_kind.biosdisk.slice + 1) >> 4, /* XXX slices may be wrong here */
(dev->d_kind.biosdisk.slice + 1) & 0xf,
- (biosdev & 0x7f) - unitofs, /* allow for #wd compenstation in da case */
+ biosdev & 0x7f, /* XXX allow/compute shift for da when wd present */
dev->d_kind.biosdisk.partition);
DEBUG("dev is 0x%x\n", rootdev);
return(rootdev);
diff --git a/sys/boot/i386/libi386/biospci.c b/sys/boot/i386/libi386/biospci.c
deleted file mode 100644
index 92f4fd28c2972..0000000000000
--- a/sys/boot/i386/libi386/biospci.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-/*
- * PnP enumerator using the PCI BIOS.
- */
-
-#include <stand.h>
-#include <string.h>
-#include <machine/stdarg.h>
-#include <bootstrap.h>
-#include <isapnp.h>
-#include <btxv86.h>
-
-/*
- * Stupid PCI BIOS interface doesn't let you simply enumerate everything
- * that's there, instead you have to ask it if it has something.
- *
- * So we have to scan by class code, subclass code and sometimes programming
- * interface.
- */
-
-struct pci_progif
-{
- int pi_code;
- char *pi_name;
-};
-
-static struct pci_progif progif_null[] = {
- {0x0, NULL},
- {-1, NULL}
-};
-
-static struct pci_progif progif_display[] = {
- {0x0, "VGA"},
- {0x1, "8514"},
- {-1, NULL}
-};
-
-static struct pci_progif progif_ide[] = {
- {0x00, NULL},
- {0x01, NULL},
- {0x02, NULL},
- {0x03, NULL},
- {0x04, NULL},
- {0x05, NULL},
- {0x06, NULL},
- {0x07, NULL},
- {0x08, NULL},
- {0x09, NULL},
- {0x0a, NULL},
- {0x0b, NULL},
- {0x0c, NULL},
- {0x0d, NULL},
- {0x0e, NULL},
- {0x0f, NULL},
- {0x80, NULL},
- {0x81, NULL},
- {0x82, NULL},
- {0x83, NULL},
- {0x84, NULL},
- {0x85, NULL},
- {0x86, NULL},
- {0x87, NULL},
- {0x88, NULL},
- {0x89, NULL},
- {0x8a, NULL},
- {0x8b, NULL},
- {0x8c, NULL},
- {0x8d, NULL},
- {0x8e, NULL},
- {0x8f, NULL},
- {-1, NULL}
-};
-
-static struct pci_progif progif_serial[] = {
- {0x0, "8250"},
- {0x1, "16450"},
- {0x2, "16550"},
- {-1, NULL}
-};
-
-static struct pci_progif progif_parallel[] = {
- {0x0, "Standard"},
- {0x1, "Bidirectional"},
- {0x2, "ECP"},
- {-1, NULL}
-};
-
-
-struct pci_subclass
-{
- int ps_subclass;
- char *ps_name;
- struct pci_progif *ps_progif; /* if set, use for programming interface value(s) */
-};
-
-static struct pci_subclass subclass_old[] = {
- {0x0, "Old non-VGA", progif_null},
- {0x1, "Old VGA", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_mass[] = {
- {0x0, "SCSI", progif_null},
- {0x1, "IDE", progif_ide},
- {0x2, "Floppy disk", progif_null},
- {0x3, "IPI", progif_null},
- {0x4, "RAID", progif_null},
- {0x80, "mass storage", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_net[] = {
- {0x0, "Ethernet", progif_null},
- {0x1, "Token ring", progif_null},
- {0x2, "FDDI", progif_null},
- {0x3, "ATM", progif_null},
- {0x80, "network", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_display[] = {
- {0x0, NULL, progif_display},
- {0x1, "XGA", progif_null},
- {0x80, "other", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_comms[] = {
- {0x0, "serial", progif_serial},
- {0x1, "parallel", progif_parallel},
- {0x80, "communications", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_subclass subclass_serial[] = {
- {0x0, "Firewire", progif_null},
- {0x1, "ACCESS.bus", progif_null},
- {0x2, "SSA", progif_null},
- {0x3, "USB", progif_null},
- {0x4, "Fibrechannel", progif_null},
- {-1, NULL, NULL}
-};
-
-static struct pci_class
-{
- int pc_class;
- char *pc_name;
- struct pci_subclass *pc_subclass;
-} pci_classes[] = {
- {0x0, "device", subclass_old},
- {0x1, "controller", subclass_mass},
- {0x2, "controller", subclass_net},
- {0x3, "display", subclass_display},
- {0x7, "controller", subclass_comms},
- {0xc, "controller", subclass_serial},
- {-1, NULL, NULL}
-};
-
-
-static void biospci_enumerate(void);
-static void biospci_addinfo(int devid, struct pci_class *pc, struct pci_subclass *psc, struct pci_progif *ppi);
-
-static int biospci_version;
-static int biospci_hwcap;
-
-struct pnphandler biospcihandler =
-{
- "PCI BIOS",
- biospci_enumerate
-};
-
-static void
-biospci_enumerate(void)
-{
- int index, locator, devid;
- struct pci_class *pc;
- struct pci_subclass *psc;
- struct pci_progif *ppi;
-
- /* Find the PCI BIOS */
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1a;
- v86.eax = 0xb101;
- v86.edi = 0x0;
- v86int();
-
- /* Check for OK response */
- if ((v86.efl & 1) || ((v86.eax & 0xff00) != 0) || (v86.edx != 0x20494350))
- return;
-
- biospci_version = v86.ebx & 0xffff;
- biospci_hwcap = v86.eax & 0xff;
-#if 0
- printf("PCI BIOS %d.%d%s%s\n",
- bcd2bin((biospci_version >> 8) & 0xf), bcd2bin(biospci_version & 0xf),
- (biospci_hwcap & 1) ? " config1" : "", (biospci_hwcap & 2) ? " config2" : "");
-#endif
- /* Iterate over known classes */
- for (pc = pci_classes; pc->pc_class >= 0; pc++) {
- /* Iterate over subclasses */
- for (psc = pc->pc_subclass; psc->ps_subclass >= 0; psc++) {
- /* Iterate over programming interfaces */
- for (ppi = psc->ps_progif; ppi->pi_code >= 0; ppi++) {
-
- /* Scan for matches */
- for (index = 0; ; index++) {
-
- /* Look for a match */
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1a;
- v86.eax = 0xb103;
- v86.ecx = (pc->pc_class << 16) + (psc->ps_subclass << 8) + ppi->pi_code;
- v86.esi = index;
- v86int();
- /* error/end of matches */
- if ((v86.efl & 1) || (v86.eax & 0xff00))
- break;
-
- /* Got something */
- locator = v86.ebx;
-
- /* Read the device identifier from the nominated device */
- v86.ctl = V86_FLAGS;
- v86.addr = 0x1a;
- v86.eax = 0xb10a;
- v86.ebx = locator;
- v86.edi = 0x0;
- v86int();
- /* error */
- if ((v86.efl & 1) || (v86.eax & 0xff00))
- break;
-
- /* We have the device ID, create a PnP object and save everything */
- devid = v86.ecx;
- biospci_addinfo(devid, pc, psc, ppi);
- }
- }
- }
- }
-}
-
-static void
-biospci_addinfo(int devid, struct pci_class *pc, struct pci_subclass *psc, struct pci_progif *ppi)
-{
- struct pnpinfo *pi;
- char desc[80];
-
-
- /* build the description */
- desc[0] = 0;
- if (ppi->pi_name != NULL) {
- strcat(desc, ppi->pi_name);
- strcat(desc, " ");
- }
- if (psc->ps_name != NULL) {
- strcat(desc, psc->ps_name);
- strcat(desc, " ");
- }
- if (pc->pc_name != NULL)
- strcat(desc, pc->pc_name);
-
- pi = pnp_allocinfo();
- pi->pi_desc = strdup(desc);
- sprintf(desc,"0x%08x", devid);
- pnp_addident(pi, desc);
- pnp_addinfo(pi);
-}
diff --git a/sys/boot/i386/libi386/biospnp.c b/sys/boot/i386/libi386/biospnp.c
deleted file mode 100644
index a6064ba27462c..0000000000000
--- a/sys/boot/i386/libi386/biospnp.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: biospnp.c,v 1.2 1998/10/23 22:29:08 msmith Exp $
- */
-
-/*
- * PnP BIOS enumerator.
- */
-
-#include <stand.h>
-#include <string.h>
-#include <machine/stdarg.h>
-#include <bootstrap.h>
-#include <isapnp.h>
-#include <btxv86.h>
-
-
-static int biospnp_init(void);
-static void biospnp_enumerate(void);
-
-struct pnphandler biospnphandler =
-{
- "PnP BIOS",
- biospnp_enumerate
-};
-
-struct pnp_ICstructure
-{
- u_int8_t pnp_signature[4] __attribute__ ((packed));
- u_int8_t pnp_version __attribute__ ((packed));
- u_int8_t pnp_length __attribute__ ((packed));
- u_int16_t pnp_BIOScontrol __attribute__ ((packed));
- u_int8_t pnp_checksum __attribute__ ((packed));
- u_int32_t pnp_eventflag __attribute__ ((packed));
- u_int16_t pnp_rmip __attribute__ ((packed));
- u_int16_t pnp_rmcs __attribute__ ((packed));
- u_int16_t pnp_pmip __attribute__ ((packed));
- u_int32_t pnp_pmcs __attribute__ ((packed));
- u_int8_t pnp_OEMdev[4] __attribute__ ((packed));
- u_int16_t pnp_rmds __attribute__ ((packed));
- u_int32_t pnp_pmds __attribute__ ((packed));
-};
-
-struct pnp_devNode
-{
- u_int16_t dn_size __attribute__ ((packed));
- u_int8_t dn_handle __attribute__ ((packed));
- u_int8_t dn_id[4] __attribute__ ((packed));
- u_int8_t dn_type[3] __attribute__ ((packed));
- u_int16_t dn_attrib __attribute__ ((packed));
- u_int8_t dn_data[0] __attribute__ ((packed));
-};
-
-struct pnp_isaConfiguration
-{
- u_int8_t ic_revision __attribute__ ((packed));
- u_int8_t ic_nCSN __attribute__ ((packed));
- u_int16_t ic_rdport __attribute__ ((packed));
- u_int16_t ic_reserved __attribute__ ((packed));
-};
-
-static struct pnp_ICstructure *pnp_Icheck = NULL;
-static u_int16_t pnp_NumNodes;
-static u_int16_t pnp_NodeSize;
-
-static void biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn);
-static int biospnp_call(int func, char *fmt, ...);
-
-#define vsegofs(vptr) (((u_int32_t)VTOPSEG(vptr) << 16) + VTOPOFF(vptr))
-void (* v86bios)(u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) = (void *)v86int;
-
-#define biospnp_f00(NumNodes, NodeSize) biospnp_call(0x00, "ll", NumNodes, NodeSize)
-#define biospnp_f01(Node, devNodeBuffer, Control) biospnp_call(0x01, "llw", Node, devNodeBuffer, Control)
-#define biospnp_f40(Configuration) biospnp_call(0x40, "l", Configuration)
-
-/* PnP BIOS return codes */
-#define PNP_SUCCESS 0x00
-#define PNP_FUNCTION_NOT_SUPPORTED 0x80
-
-/*
- * Initialisation: locate the PnP BIOS, test that we can call it.
- * Returns nonzero if the PnP BIOS is not usable on this system.
- */
-static int
-biospnp_init(void)
-{
- struct pnp_isaConfiguration icfg;
- char *sigptr;
- int result;
-
- /* Search for the $PnP signature */
- pnp_Icheck = NULL;
- for (sigptr = PTOV(0xf0000); sigptr < PTOV(0xfffff); sigptr += 16)
- if (!bcmp(sigptr, "$PnP", 4)) {
- pnp_Icheck = (struct pnp_ICstructure *)sigptr;
- break;
- }
-
- /* No signature, no BIOS */
- if (pnp_Icheck == NULL)
- return(1);
-
- /*
- * Fetch the system table parameters as a test of the BIOS
- */
- result = biospnp_f00(vsegofs(&pnp_NumNodes), vsegofs(&pnp_NodeSize));
- if (result != PNP_SUCCESS) {
- return(1);
- }
-
- /*
- * Look for the PnP ISA configuration table
- */
- result = biospnp_f40(vsegofs(&icfg));
- switch (result) {
- case PNP_SUCCESS:
- /* If the BIOS found some PnP devices, take its hint for the read port */
- if ((icfg.ic_revision == 1) && (icfg.ic_nCSN > 0))
- isapnp_readport = icfg.ic_rdport;
- break;
- case PNP_FUNCTION_NOT_SUPPORTED:
- /* The BIOS says there is no ISA bus (should we trust that this works?) */
- printf("PnP BIOS claims no ISA bus\n");
- isapnp_readport = -1;
- break;
- }
- return(0);
-}
-
-static void
-biospnp_enumerate(void)
-{
- u_int8_t Node;
- struct pnp_devNode *devNodeBuffer;
- int result;
- struct pnpinfo *pi;
- int count;
-
- /* Init/check state */
- if (biospnp_init())
- return;
-
- devNodeBuffer = (struct pnp_devNode *)malloc(pnp_NodeSize);
- Node = 0;
- count = 1000;
- while((Node != 0xff) && (count-- > 0)) {
- result = biospnp_f01(vsegofs(&Node), vsegofs(devNodeBuffer), 0x1);
- if (result != PNP_SUCCESS) {
- printf("PnP BIOS node %d: error 0x%x\n", Node, result);
- } else {
- pi = pnp_allocinfo();
- pnp_addident(pi, pnp_eisaformat(devNodeBuffer->dn_id));
- biospnp_scanresdata(pi, devNodeBuffer);
- pnp_addinfo(pi);
- }
- }
-}
-
-/*
- * Scan the resource data in the node's data area for compatible device IDs
- * and descriptions.
- */
-static void
-biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn)
-{
- int tag, i, rlen, dlen;
- u_int8_t *p;
- char *str;
-
- p = dn->dn_data; /* point to resource data */
- dlen = dn->dn_size - (p - (u_int8_t *)dn); /* length of resource data */
-
- for (i = 0; i < dlen; i+= rlen) {
- tag = p[i];
- i++;
- if (PNP_RES_TYPE(tag) == 0) {
- rlen = PNP_SRES_LEN(tag);
- /* small resource */
- switch (PNP_SRES_NUM(tag)) {
-
- case COMP_DEVICE_ID:
- /* got a compatible device ID */
- pnp_addident(pi, pnp_eisaformat(p + i));
- break;
-
- case END_TAG:
- return;
- }
- } else {
- /* large resource */
- rlen = *(u_int16_t *)(p + i);
- i += sizeof(u_int16_t);
-
- switch(PNP_LRES_NUM(tag)) {
-
- case ID_STRING_ANSI:
- str = malloc(rlen + 1);
- bcopy(p + i, str, rlen);
- str[rlen] = 0;
- if (pi->pi_desc == NULL) {
- pi->pi_desc = str;
- } else {
- free(str);
- }
- break;
- }
- }
- }
-}
-
-
-/*
- * Make a 16-bit realmode PnP BIOS call.
- *
- * The first argument passed is the function number, the last is the
- * BIOS data segment selector. Intermediate arguments may be 16 or
- * 32 bytes in length, and are described by the format string.
- *
- * Arguments to the BIOS functions must be packed on the stack, hence
- * this evil.
- */
-static int
-biospnp_call(int func, char *fmt, ...)
-{
- va_list ap;
- char *p;
- u_int8_t *argp;
- u_int32_t args[4];
- u_int32_t i;
-
- /* function number first */
- argp = (u_int8_t *)args;
- *(u_int16_t *)argp = func;
- argp += sizeof(u_int16_t);
-
- /* take args according to format */
- va_start(ap, fmt);
- for (p = fmt; *p != 0; p++) {
- switch(*p) {
-
- case 'w':
- i = va_arg(ap, u_int16_t);
- *(u_int16_t *)argp = i;
- argp += sizeof(u_int16_t);
- break;
-
- case 'l':
- i = va_arg(ap, u_int32_t);
- *(u_int32_t *)argp = i;
- argp += sizeof(u_int32_t);
- break;
- }
- }
-
- /* BIOS segment last */
- *(u_int16_t *)argp = pnp_Icheck->pnp_rmds;
- argp += sizeof(u_int16_t);
-
- /* prepare for call */
- v86.ctl = V86_ADDR | V86_CALLF;
- v86.addr = ((u_int32_t)pnp_Icheck->pnp_rmcs << 16) + pnp_Icheck->pnp_rmip;
-
- /* call with packed stack and return */
- v86bios(args[0], args[1], args[2], args[3]);
- return(v86.eax & 0xffff);
-}
diff --git a/sys/boot/i386/libi386/bootinfo.c b/sys/boot/i386/libi386/bootinfo.c
index 77ba8b75a83a6..5b479cd3446e5 100644
--- a/sys/boot/i386/libi386/bootinfo.c
+++ b/sys/boot/i386/libi386/bootinfo.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bootinfo.c,v 1.14 1998/10/15 17:06:36 peter Exp $
+ * $Id: bootinfo.c,v 1.13 1998/10/14 05:07:23 peter Exp $
*/
#include <stand.h>
@@ -249,7 +249,9 @@ bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip)
printf("can't determine root device\n");
return(EINVAL);
}
-
+
+ /* Boot from whatever the current device is */
+ i386_getdev((void **)(&rootdev), NULL, NULL);
switch(rootdev->d_type) {
case DEVT_DISK:
/* pass in the BIOS device number of the current disk */
diff --git a/sys/boot/i386/libi386/comconsole.c b/sys/boot/i386/libi386/comconsole.c
index 7b35d1dce8c97..261e909d225b8 100644
--- a/sys/boot/i386/libi386/comconsole.c
+++ b/sys/boot/i386/libi386/comconsole.c
@@ -22,45 +22,16 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: comconsole.c,v 1.5 1998/11/22 07:59:16 rnordier Exp $
+ * From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp
+ *
+ * $Id: comconsole.c,v 1.3 1998/10/02 16:32:45 msmith Exp $
*/
#include <stand.h>
#include <bootstrap.h>
-#include <machine/cpufunc.h>
+#include <btxv86.h>
#include "libi386.h"
-/* selected defines from ns16550.h */
-#define com_data 0 /* data register (R/W) */
-#define com_dlbl 0 /* divisor latch low (W) */
-#define com_dlbh 1 /* divisor latch high (W) */
-#define com_ier 1 /* interrupt enable (W) */
-#define com_iir 2 /* interrupt identification (R) */
-#define com_fifo 2 /* FIFO control (W) */
-#define com_lctl 3 /* line control register (R/W) */
-#define com_cfcr 3 /* line control register (R/W) */
-#define com_mcr 4 /* modem control register (R/W) */
-#define com_lsr 5 /* line status register (R/W) */
-#define com_msr 6 /* modem status register (R/W) */
-
-/* selected defines from sioreg.h */
-#define CFCR_DLAB 0x80
-#define MCR_RTS 0x02
-#define MCR_DTR 0x01
-#define LSR_TXRDY 0x20
-#define LSR_RXRDY 0x01
-
-#define COMC_FMT 0x3 /* 8N1 */
-#define COMC_TXWAIT 0x40000 /* transmit timeout */
-#define COMC_BPS(x) (115200 / (x)) /* speed to DLAB divisor */
-
-#ifndef COMPORT
-#define COMPORT 0x3f8
-#endif
-#ifndef COMSPEED
-#define COMSPEED 9600
-#endif
-
static void comc_probe(struct console *cp);
static int comc_init(int arg);
static void comc_putchar(int c);
@@ -71,7 +42,7 @@ static int comc_started;
struct console comconsole = {
"comconsole",
- "serial port",
+ "BIOS serial port",
0,
comc_probe,
comc_init,
@@ -80,6 +51,8 @@ struct console comconsole = {
comc_ischar
};
+#define BIOS_COMPORT 0
+
static void
comc_probe(struct console *cp)
{
@@ -90,19 +63,19 @@ comc_probe(struct console *cp)
static int
comc_init(int arg)
{
+ int i;
+
if (comc_started && arg == 0)
return 0;
comc_started = 1;
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0xe3; /* 9600N81 */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
- outb(COMPORT + com_cfcr, CFCR_DLAB | COMC_FMT);
- outb(COMPORT + com_dlbl, COMC_BPS(COMSPEED) & 0xff);
- outb(COMPORT + com_dlbh, COMC_BPS(COMSPEED) >> 8);
- outb(COMPORT + com_cfcr, COMC_FMT);
- outb(COMPORT + com_mcr, MCR_RTS | MCR_DTR);
-
- do
- inb(COMPORT + com_data);
- while (inb(COMPORT + com_lsr) & LSR_RXRDY);
+ for(i = 0; i < 10 && comc_ischar(); i++)
+ (void)comc_getchar();
return(0);
}
@@ -110,23 +83,35 @@ comc_init(int arg)
static void
comc_putchar(int c)
{
- int wait;
-
- for (wait = COMC_TXWAIT; wait > 0; wait--)
- if (inb(COMPORT + com_lsr) & LSR_TXRDY) {
- outb(COMPORT + com_data, c);
- break;
- }
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0x100 | c; /* Function 1 = write */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
}
static int
comc_getchar(void)
{
- return(comc_ischar() ? inb(COMPORT + com_data) : -1);
+ if (comc_ischar()) {
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0x200; /* Function 2 = read */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
+ return(v86.eax & 0xff);
+ } else {
+ return(-1);
+ }
}
static int
comc_ischar(void)
{
- return(inb(COMPORT + com_lsr) & LSR_RXRDY);
+ v86.ctl = 0;
+ v86.addr = 0x14;
+ v86.eax = 0x300; /* Function 3 = status */
+ v86.edx = BIOS_COMPORT; /* XXX take as arg, or use env var? */
+ v86int();
+ return(v86.eax & 0x100); /* AH bit 1 is "receive data ready" */
}
diff --git a/sys/boot/i386/libi386/vidconsole.c b/sys/boot/i386/libi386/vidconsole.c
index 05e77110c2efa..c67cd72061b52 100644
--- a/sys/boot/i386/libi386/vidconsole.c
+++ b/sys/boot/i386/libi386/vidconsole.c
@@ -26,7 +26,7 @@
*
* From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp
*
- * $Id: vidconsole.c,v 1.10 1998/12/31 13:44:04 abial Exp $
+ * $Id: vidconsole.c,v 1.5 1998/10/07 07:34:31 msmith Exp $
*/
#include <stand.h>
@@ -48,28 +48,6 @@ static int vidc_ischar(void);
static int vidc_started;
-#ifdef TERM_EMU
-void end_term();
-void bail_out(int c);
-void vidc_term_emu(int c);
-void get_pos(void);
-void curs_move(int x, int y);
-void write_char(int c, int fg, int bg);
-void scroll_up(int rows, int fg, int bg);
-void AB(void);
-void AF(void);
-void CD(void);
-void CM(void);
-void HO(void);
-void ME(void);
-
-static int args[2],argc,br;
-static int fg,bg,dig;
-static int fg_c,bg_c,curx,cury;
-static int esc;
-#endif
-
-
struct console vidconsole = {
"vidconsole",
"internal video/keyboard",
@@ -106,390 +84,21 @@ vidc_init(int arg)
if (vidc_started && arg == 0)
return;
vidc_started = 1;
-#ifdef TERM_EMU
- /* Init terminal emulator */
- end_term();
- get_pos();
- curs_move(curx,cury);
- fg_c=7;
- bg_c=0;
-#endif
for(i = 0; i < 10 && vidc_ischar(); i++)
(void)vidc_getchar();
return(0); /* XXX reinit? */
}
static void
-vidc_biosputchar(int c)
+vidc_putchar(int c)
{
v86.ctl = 0;
v86.addr = 0x10;
- v86.eax = 0xe00 | (c & 0xff);
+ v86.eax = 0xe00 | c;
v86.ebx = 0x7;
v86int();
}
-static void
-vidc_rawputchar(int c)
-{
- int i;
-
- if(c == '\t')
- /* lame tab expansion */
- for (i = 0; i < 8; i++)
- vidc_rawputchar(' ');
- else {
-#ifndef TERM_EMU
- vidc_biosputchar(c);
-#else
- /* Emulate AH=0eh (teletype output) */
- switch(c) {
- case '\a':
- vidc_biosputchar(c);
- return;
- case '\r':
- curx=0;
- curs_move(curx,cury);
- return;
- case '\n':
- cury++;
- if(cury>24) {
- scroll_up(1,fg_c,bg_c);
- cury--;
- } else {
- curs_move(curx,cury);
- }
- return;
- case '\b':
- if(curx>0) {
- curx--;
- curs_move(curx,cury);
- /* write_char(' ',fg_c,bg_c); XXX destructive(!) */
- return;
- }
- return;
- default:
- write_char(c,fg_c,bg_c);
- curx++;
- if(curx>79) {
- curx=0;
- cury++;
- }
- if(cury>24) {
- curx=0;
- scroll_up(1,fg_c,bg_c);
- cury--;
- }
- }
- curs_move(curx,cury);
-#endif
- }
-}
-
-#ifdef TERM_EMU
-
-/* Get cursor position on the screen. Result is in edx. Sets
- * curx and cury appropriately.
- */
-void
-get_pos(void)
-{
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0300;
- v86.ebx = 0x0;
- v86int();
- curx=v86.edx & 0x00ff;
- cury=(v86.edx & 0xff00)>>8;
-}
-
-/* Move cursor to x rows and y cols (0-based). */
-void
-curs_move(int x, int y)
-{
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0200;
- v86.ebx = 0x0;
- v86.edx = ((0x00ff & y)<<8)+(0x00ff & x);
- v86int();
- curx=x;
- cury=y;
- /* If there is ctrl char at this position, cursor would be invisible.
- * Make it a space instead.
- */
- v86.ctl=0;
- v86.addr = 0x10;
- v86.eax = 0x0800;
- v86.ebx= 0x0;
- v86int();
-#define isvisible(c) (((c)>32) && ((c)<255))
- if(!isvisible(v86.eax & 0x00ff)) {
- write_char(' ',fg_c,bg_c);
- }
-}
-
-/* Scroll up the whole window by a number of rows. If rows==0,
- * clear the window. fg and bg are attributes for the new lines
- * inserted in the window.
- */
-void
-scroll_up(int rows, int fg, int bg)
-{
- if(rows==0) rows=25;
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0600+(0x00ff & rows);
- v86.ebx = (bg<<12)+(fg<<8);
- v86.ecx = 0x0;
- v86.edx = 0x184f;
- v86int();
-}
-
-/* Write character and attribute at cursor position. */
-void
-write_char(int c, int fg, int bg)
-{
- v86.ctl=0;
- v86.addr = 0x10;
- v86.eax = 0x0900+(0x00ff & c);
- v86.ebx = (bg<<4)+fg;
- v86.ecx = 0x1;
- v86int();
-}
-
-/* Calculate power of 10 */
-int
-pow10(int i)
-{
- int res=1;
-
- while(i-->0) {
- res*=10;
- }
- return res;
-}
-
-/**************************************************************/
-/*
- * Screen manipulation functions. They use accumulated data in
- * args[] and argc variables.
- *
- */
-
-/* Set background color */
-void
-AB(void){
- bg_c=args[0];
- end_term();
-}
-
-/* Set foreground color */
-void
-AF(void)
-{
- fg_c=args[0];
- end_term();
-}
-
-/* Clear display from current position to end of screen */
-void
-CD(void)
-{
- get_pos();
- v86.ctl = 0;
- v86.addr = 0x10;
- v86.eax = 0x0600;
- v86.ebx = (bg_c<<4)+fg_c;
- v86.ecx = v86.edx;
- v86.edx = 0x184f;
- v86int();
- curx=0;
- curs_move(curx,cury);
- end_term();
-}
-
-/* Absolute cursor move to args[0] rows and args[1] columns
- * (the coordinates are 1-based).
- */
-void
-CM(void)
-{
- if(args[0]>0) args[0]--;
- if(args[1]>0) args[1]--;
- curs_move(args[1],args[0]);
- end_term();
-}
-
-/* Home cursor (left top corner) */
-void
-HO(void)
-{
- argc=1;
- args[0]=args[1]=1;
- CM();
-}
-
-/* Exit attribute mode (reset fore/back-ground colors to defaults) */
-void
-ME(void)
-{
- fg_c=7;
- bg_c=0;
- end_term();
-}
-
-/* Clear internal state of the terminal emulation code */
-void
-end_term(void)
-{
- esc=0;
- argc=-1;
- fg=bg=br=0;
- args[0]=args[1]=0;
- dig=0;
-}
-
-/* Gracefully exit ESC-sequence processing in case of misunderstanding */
-void
-bail_out(int c)
-{
- char buf[6],*ch;
-
- if(esc) vidc_rawputchar('\033');
- if(br) vidc_rawputchar('[');
- if(argc>-1) {
- sprintf(buf,"%d",args[0]);
- ch=buf;
- while(*ch) vidc_rawputchar(*ch++);
-
- if(argc>0) {
- vidc_rawputchar(';');
- sprintf(buf,"%d",args[1]);
- ch=buf;
- while(*ch) vidc_rawputchar(*ch++);
- }
- }
- vidc_rawputchar(c);
- end_term();
-}
-
-/* Emulate basic capabilities of cons25 terminal */
-void
-vidc_term_emu(int c)
-{
-
- if(!esc) {
- if(c=='\033') {
- esc=1;
- } else {
- vidc_rawputchar(c);
- }
- return;
- }
-
- /* Do ESC sequences processing */
- switch(c) {
- case '\033':
- /* ESC in ESC sequence - error */
- bail_out(c);
- break;
- case '[':
- /* Check if it's first char after ESC */
- if(argc<0) {
- br=1;
- } else {
- bail_out(c);
- }
- break;
- case 'H':
- /* Emulate \E[H (cursor home) and
- * \E%d;%dH (cursor absolute move) */
- if(br) {
- switch(argc) {
- case -1:
- HO();
- break;
- case 1:
- if(fg) args[0]+=pow10(dig)*3;
- if(bg) args[0]+=pow10(dig)*4;
- CM();
- break;
- default:
- bail_out(c);
- }
- } else bail_out(c);
- break;
- case 'J':
- /* Emulate \EJ (clear to end of screen) */
- if(br && argc<0) {
- CD();
- } else bail_out(c);
- break;
- case ';':
- /* perhaps args separator */
- if(br && (argc>-1)) {
- argc++;
- } else bail_out(c);
- break;
- case 'm':
- /* Change char attributes */
- if(br) {
- switch(argc) {
- case -1:
- ME();
- break;
- case 0:
- if(fg) AF();
- else AB();
- break;
- default:
- bail_out(c);
- }
- } else bail_out(c);
- break;
- default:
- if(isdigit(c)) {
- /* Carefully collect numeric arguments */
- /* XXX this is ugly. */
- if(br) {
- if(argc==-1) {
- argc=0;
- args[argc]=0;
- dig=0;
- /* in case we're in error... */
- if(c=='3') {
- fg=1;
- return;
- }
- if(c=='4') {
- bg=1;
- return;
- }
- args[argc]=(int)(c-'0');
- dig=1;
- args[argc+1]=0;
- } else {
- args[argc]=args[argc]*10+(int)(c-'0');
- if(argc==0) dig++;
- }
- } else bail_out(c);
- } else bail_out(c);
- break;
- }
-}
-#endif
-
-static void
-vidc_putchar(int c)
-{
-#ifdef TERM_EMU
- vidc_term_emu(c);
-#else
- vidc_rawputchar(c);
-#endif
-}
-
static int
vidc_getchar(void)
{
@@ -511,7 +120,9 @@ vidc_ischar(void)
v86.addr = 0x16;
v86.eax = 0x100;
v86int();
- return(!(v86.efl & PSL_Z));
+ if (!(v86.efl & PSL_Z))
+ return(v86.eax & 0xff);
+ return(0);
}
#if KEYBOARD_PROBE
@@ -537,7 +148,7 @@ static void
delay7(void)
{
/*
- * I know this is broken, but no timer is available yet at this stage...
+ * I know this is broken, but no timer is avaiable yet at this stage...
* See also comments in `delay1ms()'.
*/
inb(IO_DUMMY); inb(IO_DUMMY);
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 053fbd3488620..02fd2d005a1a8 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.27 1999/01/11 05:52:28 msmith Exp $
+# $Id: Makefile,v 1.11 1998/10/12 01:03:00 rnordier Exp $
BASE= loader
PROG= ${BASE}
@@ -11,17 +11,8 @@ BINDIR?= /boot
SRCS= main.c conf.c
# Enable PnP and ISA-PnP code.
-HAVE_PNP= yes
-HAVE_ISABUS= yes
-
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-.if exists(${.OBJDIR}/../../ficl/libficl.a)
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.else
-LIBFICL= ${.CURDIR}/../../ficl/libficl.a
-.endif
+#HAVE_PNP= yes
+#HAVE_ISABUS= yes
# Always add MI sources
.PATH: ${.CURDIR}/../../common
@@ -29,7 +20,8 @@ LIBFICL= ${.CURDIR}/../../ficl/libficl.a
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../../.. -I.
-CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
+CLEANFILES+= vers.c vers.o ${BASE}.list setdef0.o setdef1.o setdefs.h \
+ gensetdefs.o gensetdefs ${BASE}.bin
CFLAGS+= -Wall
LDFLAGS= -nostdlib -static -Ttext 0x1000
@@ -57,9 +49,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib
# BTX is expecting ELF components
CFLAGS+= -elf
-# New linker set code
-CFLAGS+= -DNEW_LINKER_SET
-
# Debug me!
#CFLAGS+= -g
#LDFLAGS+= -g
@@ -68,47 +57,34 @@ vers.o:
sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
-${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT} ${BASE}.help
+${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN}
btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \
${BASE}.bin
-# /usr/bin/kzip ${.TARGET}
-# mv ${.TARGET}.kz ${.TARGET}
-
-${BASE}.bin: ${BASE}.sym
- cp ${.ALLSRC} ${.TARGET}
- strip ${.TARGET}
-
-${BASE}.help: help.common help.i386
- cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
-
-beforeinstall:
-.if exists(${DESTDIR}/boot/loader)
- mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old
-.endif
-.if exists(${.OBJDIR}/loader.help)
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
-.else
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
-.endif
-# Cannot use ${OBJS} above this line
-.include <bsd.prog.mk>
+${BASE}.bin: ${OBJS} ${LIBI386} vers.o setdef0.o setdef1.o
+ ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} setdef0.o ${OBJS} vers.o setdef1.o \
+ ${LIBSTAND} ${LIBI386} ${LIBSTAND}
-${BASE}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o
- ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
- ${LIBFICL} ${LIBSTAND} ${LIBI386} ${LIBSTAND}
+setdef0.o: setdefs.h
-# If it's not there, don't consider it a target
-.if exists(${.CURDIR}/../../../i386/include)
-beforedepend ${OBJS}: machine
+setdef1.o: setdefs.h
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
-.endif
-
CLEANFILES+= machine
+.include <bsd.prog.mk>
+# Linker set gymnastics
+setdefs.h: gensetdefs ${OBJS}
+ @echo Generating linker sets
+ @./gensetdefs ${OBJS} >setdefs.h
+
+gensetdefs: gensetdefs.o
+ ${CC} -static gensetdefs.o -o $@
+
+gensetdefs.o: gensetdefs.c
+ ${CC} -c $<
+
+beforedepend ${OBJS}: machine
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index 9b4d554bc1a03..d39d67f33873d 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: conf.c,v 1.9 1998/10/22 20:23:58 msmith Exp $
+ * $Id: conf.c,v 1.6 1998/09/30 19:48:42 peter Exp $
*/
#include <stand.h>
@@ -85,12 +85,10 @@ struct console *consoles[] = {
};
extern struct pnphandler isapnphandler;
-extern struct pnphandler biospnphandler;
-extern struct pnphandler biospcihandler;
+/* extern struct pnphandler pcipnphandler;*/
struct pnphandler *pnphandlers[] = {
- &biospnphandler, /* should go first, as it may set isapnp_readport */
- &isapnphandler,
- &biospcihandler,
+/* &isapnphandler, */
+/* &pcipnphandler, */
NULL
};
diff --git a/sys/boot/i386/loader/help.i386 b/sys/boot/i386/loader/help.i386
deleted file mode 100644
index 81288250ade0e..0000000000000
--- a/sys/boot/i386/loader/help.i386
+++ /dev/null
@@ -1,34 +0,0 @@
-################################################################################
-# Treboot DReboot the system
-
- reboot
-
- Causes the system to immediately reboot.
-
-################################################################################
-# Theap DDisplay memory management statistics
-
- heap
-
- Requests debugging output from the heap manager. For debugging use
- only.
-
-################################################################################
-# Tset Snum_ide_disks DSet the number of IDE disks
-
- set num_ide_disks=<value>
-
- When booting from a SCSI disk on a system with one or more IDE disks,
- and where the IDE disks are the default boot device, it is necessary
- to tell the kernel how many IDE disks there are in order to have it
- correctly locate the SCSI disk you are booting from.
-
-################################################################################
-# Tset Sboot_userconfig DStart Userconfig
-
- set boot_userconfig
-
- Requests that the kernel's interactive device configuration program
- be run when the kernel is booted.
-
-################################################################################
diff --git a/sys/boot/i386/loader/main.c b/sys/boot/i386/loader/main.c
index dfd1bfffbb98c..b9e93f49b357e 100644
--- a/sys/boot/i386/loader/main.c
+++ b/sys/boot/i386/loader/main.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: main.c,v 1.13 1998/10/22 20:23:58 msmith Exp $
+ * $Id: main.c,v 1.10 1998/10/03 18:27:50 rnordier Exp $
*/
/*
@@ -58,8 +58,6 @@ static struct bootinfo *initial_bootinfo;
struct arch_switch archsw; /* MI/MD interface boundary */
static void extract_currdev(void);
-static int isa_inb(int port);
-static void isa_outb(int port, int value);
/* from vers.c */
extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[];
@@ -98,11 +96,6 @@ main(void)
cons_probe();
/*
- * Initialise the block cache
- */
- bcache_init(32, 512); /* 16k cache XXX tune this */
-
- /*
* March through the device switch probing for things.
*/
for (i = 0; devsw[i] != NULL; i++)
@@ -112,6 +105,10 @@ main(void)
printf("\n");
printf("%s, Revision %s %d/%dkB\n", bootprog_name, bootprog_rev, getbasemem(), getextmem());
printf("(%s, %s)\n", bootprog_maker, bootprog_date);
+#if 0
+ printf("recovered args howto = 0x%x bootdev = 0x%x bootinfo = %p\n",
+ initial_howto, initial_bootdev, initial_bootinfo);
+#endif
extract_currdev(); /* set $currdev and $loaddev */
setenv("LINES", "24", 1); /* optional */
@@ -121,8 +118,6 @@ main(void)
archsw.arch_copyin = i386_copyin;
archsw.arch_copyout = i386_copyout;
archsw.arch_readin = i386_readin;
- archsw.arch_isainb = isa_inb;
- archsw.arch_isaoutb = isa_outb;
interact(); /* doesn't return */
}
@@ -200,34 +195,3 @@ command_heap(int argc, char *argv[])
printf("heap base at %p, top at %p\n", end, sbrk(0));
return(CMD_OK);
}
-
-/* ISA bus access functions for PnP, derived from <machine/cpufunc.h> */
-static int
-isa_inb(int port)
-{
- u_char data;
-
- if (__builtin_constant_p(port) &&
- (((port) & 0xffff) < 0x100) &&
- ((port) < 0x10000)) {
- __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port)));
- } else {
- __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port));
- }
- return(data);
-}
-
-static void
-isa_outb(int port, int value)
-{
- u_char al = value;
-
- if (__builtin_constant_p(port) &&
- (((port) & 0xffff) < 0x100) &&
- ((port) < 0x10000)) {
- __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port)));
- } else {
- __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
- }
-}
-
diff --git a/sys/boot/i386/loader/newvers.sh b/sys/boot/i386/loader/newvers.sh
index 476913be37a0d..34b0e7e674d9e 100755
--- a/sys/boot/i386/loader/newvers.sh
+++ b/sys/boot/i386/loader/newvers.sh
@@ -35,7 +35,6 @@
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
-LC_TIME=C; export LC_TIME
u=${USER-root} h=`hostname` t=`date`
#r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '`
r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1`
diff --git a/sys/i4b/include/i4b_mbuf.h b/sys/boot/i386/loader/setdef0.c
index 49ee26d6162d7..e2af74e843938 100644
--- a/sys/i4b/include/i4b_mbuf.h
+++ b/sys/boot/i386/loader/setdef0.c
@@ -1,5 +1,6 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
+/*-
+ * Copyright (c) 1997 John D. Polstra
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -22,30 +23,27 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- *---------------------------------------------------------------------------
- *
- * i4b - mbuf handling support routines
- * --------------------------------------
- *
- * $Id: i4b_mbuf.h,v 1.6 1998/12/05 18:03:00 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:05:12 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_MBUF_H_
-#define _I4B_MBUF_H_
+ * $Id: setdef0.c,v 1.2 1997/05/21 23:21:30 jdp Exp $
+ */
-#define IF_QEMPTY(ifq) ((ifq)->ifq_len == 0)
+#ifdef __ELF__
-struct mbuf *i4b_Dgetmbuf( int );
-void i4b_Dfreembuf( struct mbuf *m );
-void i4b_Dcleanifq( struct ifqueue * );
+#include <sys/param.h>
+#include <sys/kernel.h>
-struct mbuf *i4b_Bgetmbuf( int );
-void i4b_Bfreembuf( struct mbuf *m );
-void i4b_Bcleanifq( struct ifqueue * );
+/*
+ * DEFINE_SET creates the section and label for a set, and emits the
+ * count word at the front of it.
+ */
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".globl " #set); \
+ __asm__(".type " #set ",@object"); \
+ __asm__(".p2align 2"); \
+ __asm__(#set ":"); \
+ __asm__(".long " #count); \
+ __asm__(".previous")
-#endif /* _I4B_MBUF_H_ */
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
-/* EOF */
+#endif /* __ELF__ */
diff --git a/sys/pci/bt848_i2c.h b/sys/boot/i386/loader/setdef1.c
index c7d22c50484e7..3f2011920526a 100644
--- a/sys/pci/bt848_i2c.h
+++ b/sys/boot/i386/loader/setdef1.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1998 Nicolas Souchu
+ * Copyright (c) 1997 John D. Polstra
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,12 +23,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
- *
+ * $Id: setdef1.c,v 1.2 1997/05/21 23:21:30 jdp Exp $
+ */
+
+#ifdef __ELF__
+
+/*
+ * DEFINE_SET emits the NULL terminator for a set.
*/
-#ifndef _BT848_I2C_H
-#define _BT848_I2C_H
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".long 0"); \
+ __asm__(".previous")
-extern int bt848_i2c_attach(int, bt848_ptr_t, struct bktr_i2c_softc *);
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
-#endif
+#endif /* __ELF__ */
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h
index aaf267056b9f4..f2732b49a384e 100644
--- a/sys/cam/cam_ccb.h
+++ b/sys/cam/cam_ccb.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_ccb.h,v 1.2 1998/10/15 23:17:35 gibbs Exp $
+ * $Id: cam_ccb.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
*/
#ifndef _CAM_CAM_CCB_H
@@ -412,8 +412,7 @@ typedef enum {
typedef enum {
PIM_SCANHILO = 0x80, /* Bus scans from high ID to low ID */
PIM_NOREMOVE = 0x40, /* Removeable devices not included in scan */
- PIM_NOINITIATOR = 0x20, /* Initiator role not supported. */
- PIM_NOBUSRESET = 0x10, /* User has disabled initial BUS RESET */
+ PIM_NOINQUIRY = 0x20, /* Inquiry data not kept by XPT */
} pi_miscflag;
/* Path Inquiry CCB */
diff --git a/sys/cam/cam_debug.h b/sys/cam/cam_debug.h
index ab07980fc57f8..198650ec7c0b7 100644
--- a/sys/cam/cam_debug.h
+++ b/sys/cam/cam_debug.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_debug.h,v 1.2 1998/10/02 21:00:50 ken Exp $
+ * $Id: cam_debug.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
*/
#ifndef _CAM_CAM_DEBUG_H
#define _CAM_CAM_DEBUG_H 1
@@ -42,8 +42,7 @@ typedef enum {
CAM_DEBUG_INFO = 0x01, /* scsi commands, errors, data */
CAM_DEBUG_TRACE = 0x02, /* routine flow tracking */
CAM_DEBUG_SUBTRACE = 0x04, /* internal to routine flows */
- CAM_DEBUG_CDB = 0x08, /* print out SCSI CDBs only */
- CAM_DEBUG_XPT = 0x10 /* print out xpt scheduling */
+ CAM_DEBUG_CDB = 0x08 /* print out SCSI CDBs only */
} cam_debug_flags;
#if defined(CAMDEBUG) && defined(KERNEL)
@@ -54,10 +53,6 @@ extern struct cam_path *cam_dpath;
extern u_int32_t cam_dflags;
/* Debugging macros. */
-#define CAM_DEBUGGED(path, flag) \
- ((cam_dflags & (flag)) \
- && (cam_dpath != NULL) \
- && (xpt_path_comp(path, cam_dpath) >= 0))
#define CAM_DEBUG(path, flag, printfargs) \
if ((cam_dflags & (flag)) \
&& (cam_dpath != NULL) \
@@ -75,7 +70,6 @@ extern u_int32_t cam_dflags;
#else /* !CAMDEBUG || !KERNEL */
-#define CAM_DEBUGGED(A, B) 0
#define CAM_DEBUG(A, B, C)
#define CAM_DEBUG_PRINT(A, B)
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 57ac5338e28b8..6d6fe291cf1f3 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -26,14 +26,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_periph.c,v 1.8 1998/12/16 21:00:06 ken Exp $
+ * $Id: cam_periph.c,v 1.4 1998/10/13 21:41:32 ken Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/malloc.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/devicestat.h>
@@ -62,11 +62,10 @@ static void camperiphdone(struct cam_periph *periph,
static void camperiphfree(struct cam_periph *periph);
cam_status
-cam_periph_alloc(periph_ctor_t *periph_ctor,
- periph_oninv_t *periph_oninvalidate,
- periph_dtor_t *periph_dtor, periph_start_t *periph_start,
- char *name, cam_periph_type type, struct cam_path *path,
- ac_callback_t *ac_callback, ac_code code, void *arg)
+cam_periph_alloc(periph_ctor_t *periph_ctor, periph_dtor_t *periph_dtor,
+ periph_start_t *periph_start, char *name, cam_periph_type type,
+ struct cam_path *path, ac_callback_t *ac_callback,
+ ac_code code, void *arg)
{
struct periph_driver **p_drv;
struct cam_periph *periph;
@@ -123,7 +122,6 @@ cam_periph_alloc(periph_ctor_t *periph_ctor,
cam_init_pinfo(&periph->pinfo);
periph->periph_start = periph_start;
periph->periph_dtor = periph_dtor;
- periph->periph_oninval = periph_oninvalidate;
periph->type = type;
periph->periph_name = name;
periph->unit_number = camperiphunit(*p_drv, path_id, target_id, lun_id);
@@ -374,19 +372,10 @@ cam_periph_invalidate(struct cam_periph *periph)
{
int s;
- s = splsoftcam();
- /*
- * We only call this routine the first time a peripheral is
- * invalidated. The oninvalidate() routine is always called at
- * splsoftcam().
- */
- if (((periph->flags & CAM_PERIPH_INVALID) == 0)
- && (periph->periph_oninval != NULL))
- periph->periph_oninval(periph);
-
periph->flags |= CAM_PERIPH_INVALID;
periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND;
+ s = splsoftcam();
if (periph->refcount == 0)
camperiphfree(periph);
else if (periph->refcount < 0)
@@ -490,14 +479,24 @@ cam_periph_unlock(struct cam_periph *periph)
int
cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
{
- int numbufs, i;
- int flags[CAM_PERIPH_MAXMAPS];
+ int flags, numbufs, i;
u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS];
u_int32_t lengths[CAM_PERIPH_MAXMAPS];
u_int32_t dirs[CAM_PERIPH_MAXMAPS];
switch(ccb->ccb_h.func_code) {
case XPT_DEV_MATCH:
+ if (ccb->cdm.pattern_buf_len > MAXPHYS) {
+ printf("cam_periph_mapmem: attempt to map %u bytes, "
+ "which is greater than MAXPHYS(%d)\n",
+ ccb->cdm.pattern_buf_len, MAXPHYS);
+ return(E2BIG);
+ } else if (ccb->cdm.match_buf_len > MAXPHYS) {
+ printf("cam_periph_mapmem: attempt to map %u bytes, "
+ "which is greater than MAXPHYS(%d)\n",
+ ccb->cdm.match_buf_len, MAXPHYS);
+ return(E2BIG);
+ }
if (ccb->cdm.match_buf_len == 0) {
printf("cam_periph_mapmem: invalid match buffer "
"length 0\n");
@@ -519,11 +518,18 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
}
break;
case XPT_SCSI_IO:
+ if (ccb->csio.dxfer_len > MAXPHYS) {
+ printf("cam_periph_mapmem: attempt to map %u bytes, "
+ "which is greater than MAXPHYS(%d)\n",
+ ccb->csio.dxfer_len, MAXPHYS);
+ return(E2BIG);
+ }
+
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
return(0);
data_ptrs[0] = &ccb->csio.data_ptr;
- lengths[0] = ccb->csio.dxfer_len;
+ lengths[0] = ccb->csio.dxfer_len;;
dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
numbufs = 1;
break;
@@ -532,40 +538,32 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
break; /* NOTREACHED */
}
+ /* this keeps the current process from getting swapped */
/*
- * Check the transfer length and permissions first, so we don't
- * have to unmap any previously mapped buffers.
+ * XXX KDM should I use P_NOSWAP instead?
*/
- for (i = 0; i < numbufs; i++) {
-
- flags[i] = 0;
+ curproc->p_flag |= P_PHYSIO;
- /*
- * The userland data pointer passed in may not be page
- * aligned. vmapbuf() truncates the address to a page
- * boundary, so if the address isn't page aligned, we'll
- * need enough space for the given transfer length, plus
- * whatever extra space is necessary to make it to the page
- * boundary.
- */
- if ((lengths[i] +
- (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK)) > DFLTPHYS){
- printf("cam_periph_mapmem: attempt to map %u bytes, "
- "which is greater than DFLTPHYS(%d)\n",
- lengths[i] +
- (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK),
- DFLTPHYS);
- return(E2BIG);
- }
+ for (i = 0; i < numbufs; i++) {
+ flags = 0;
if (dirs[i] & CAM_DIR_IN) {
- flags[i] = B_READ;
+ flags = B_READ;
if (useracc(*data_ptrs[i], lengths[i], B_READ) == 0){
printf("cam_periph_mapmem: error, "
"address %p, length %lu isn't "
"user accessible for READ\n",
(void *)*data_ptrs[i],
(u_long)lengths[i]);
+ /*
+ * If we've already mapped one or more
+ * buffers for this CCB, unmap it (them).
+ */
+ if (i > 0)
+ cam_periph_unmapmem(ccb, mapinfo);
+ else
+ curproc->p_flag &= ~P_PHYSIO;
+
return(EACCES);
}
}
@@ -575,27 +573,26 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
* is all 0's, and so it is "set" all the time.
*/
if (dirs[i] & CAM_DIR_OUT) {
- flags[i] |= B_WRITE;
+ flags |= B_WRITE;
if (useracc(*data_ptrs[i], lengths[i], B_WRITE) == 0){
printf("cam_periph_mapmem: error, "
"address %p, length %lu isn't "
"user accessible for WRITE\n",
(void *)*data_ptrs[i],
(u_long)lengths[i]);
+ /*
+ * If we've already mapped one or more
+ * buffers for this CCB, unmap it (them).
+ */
+ if (i > 0)
+ cam_periph_unmapmem(ccb, mapinfo);
+ else
+ curproc->p_flag &= ~P_PHYSIO;
return(EACCES);
}
}
- }
-
- /* this keeps the current process from getting swapped */
- /*
- * XXX KDM should I use P_NOSWAP instead?
- */
- curproc->p_flag |= P_PHYSIO;
-
- for (i = 0; i < numbufs; i++) {
/*
* Get the buffer.
*/
@@ -607,11 +604,11 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
/* put our pointer in the data slot */
mapinfo->bp[i]->b_data = *data_ptrs[i];
- /* set the transfer length, we know it's < DFLTPHYS */
+ /* set the transfer length, we know it's < 64K */
mapinfo->bp[i]->b_bufsize = lengths[i];
/* set the flags */
- mapinfo->bp[i]->b_flags = flags[i] | B_PHYS | B_BUSY;
+ mapinfo->bp[i]->b_flags = flags | B_PHYS | B_BUSY;
/* map the buffer into kernel memory */
vmapbuf(mapinfo->bp[i]);
diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h
index 9bad491f14a18..8e81526d53fd1 100644
--- a/sys/cam/cam_periph.h
+++ b/sys/cam/cam_periph.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_periph.h,v 1.2 1998/10/13 21:41:32 ken Exp $
+ * $Id: cam_periph.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
*/
#ifndef _CAM_CAM_PERIPH_H
@@ -66,12 +66,11 @@ typedef void periph_start_t (struct cam_periph *periph,
union ccb *start_ccb);
typedef cam_status periph_ctor_t (struct cam_periph *periph,
void *arg);
-typedef void periph_oninv_t (struct cam_periph *periph);
typedef void periph_dtor_t (struct cam_periph *periph);
+
struct cam_periph {
cam_pinfo pinfo;
periph_start_t *periph_start;
- periph_oninv_t *periph_oninval;
periph_dtor_t *periph_dtor;
char *periph_name;
struct cam_path *path; /* Compiled path to device */
@@ -101,10 +100,7 @@ struct cam_periph_map_info {
struct buf *bp[CAM_PERIPH_MAXMAPS];
};
-cam_status cam_periph_alloc(periph_ctor_t *periph_ctor,
- periph_oninv_t *periph_oninvalidate,
- periph_dtor_t *periph_dtor,
- periph_start_t *periph_start,
+cam_status cam_periph_alloc(periph_ctor_t*, periph_dtor_t*, periph_start_t*,
char *name, cam_periph_type type, struct cam_path *, ac_callback_t *, ac_code, void *arg);
struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
int cam_periph_lock(struct cam_periph *periph, int priority);
diff --git a/sys/cam/cam_queue.h b/sys/cam/cam_queue.h
index 7e3d0df2ce053..8123222f577c2 100644
--- a/sys/cam/cam_queue.h
+++ b/sys/cam/cam_queue.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_queue.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $
+ * $Id$
*/
#ifndef _CAM_CAM_QUEUE_H
@@ -50,9 +50,7 @@ struct camq {
u_int32_t qfrozen_cnt;
};
-TAILQ_HEAD(ccb_hdr_tailq, ccb_hdr);
-LIST_HEAD(ccb_hdr_list, ccb_hdr);
-SLIST_HEAD(ccb_hdr_slist, ccb_hdr);
+TAILQ_HEAD(ccb_hdr_list, ccb_hdr);
struct cam_ccbq {
struct camq queue;
@@ -60,7 +58,7 @@ struct cam_ccbq {
int dev_openings;
int dev_active;
int held;
- struct ccb_hdr_tailq active_ccbs;
+ struct ccb_hdr_list active_ccbs;
};
struct cam_ed;
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index bd25e744f0156..fdd0de518a462 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1,8 +1,8 @@
/*
* Implementation of the Common Access Method Transport (XPT) layer.
*
- * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
- * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
+ * Copyright (c) 1997, 1998 Justin T. Gibbs.
+ * Copyright (c) 1997, 1998 Kenneth D. Merry.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_xpt.c,v 1.41 1999/01/20 19:08:45 mjacob Exp $
+ * $Id: cam_xpt.c,v 1.23 1998/10/15 17:46:18 ken Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -38,7 +38,6 @@
#include <sys/fcntl.h>
#include <sys/md5.h>
#include <sys/devicestat.h>
-#include <sys/interrupt.h>
#ifdef PC98
#include <pc98/pc98/pc98_machdep.h> /* geometry translation */
@@ -81,7 +80,7 @@ struct async_node {
SLIST_HEAD(async_list, async_node);
SLIST_HEAD(periph_list, cam_periph);
-static STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
+STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
/*
* This is the maximum number of high powered commands (e.g. start unit)
@@ -197,6 +196,7 @@ struct cam_et {
struct cam_eb {
TAILQ_HEAD(, cam_et) et_entries;
TAILQ_ENTRY(cam_eb) links;
+ struct async_list asyncs; /* Async callback info for this B/T/L */
path_id_t path_id;
struct cam_sim *sim;
u_int32_t flags;
@@ -236,7 +236,6 @@ struct xpt_softc {
static const char quantum[] = "QUANTUM";
static const char sony[] = "SONY";
static const char west_digital[] = "WDIGTL";
-static const char samsung[] = "SAMSUNG";
static struct xpt_quirk_entry xpt_quirk_table[] =
{
@@ -267,27 +266,6 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
},
{
/*
- * Unfortunately, the Quantum Atlas III has the same
- * problem as the Atlas II drives above.
- * Reported by: "Johan Granlund" <johan@granlund.nu>
- *
- * For future reference, the drive with the problem was:
- * QUANTUM QM39100TD-SW N1B0
- *
- * It's possible that Quantum will fix the problem in later
- * firmware revisions. If that happens, the quirk entry
- * will need to be made specific to the firmware revisions
- * with the problem.
- *
- * XXX need to add a quirk for the 18G version of this
- * drive, once inquiry information is known.
- */
- /* Reports QUEUE FULL for temporary resource shortages */
- { T_DIRECT, SIP_MEDIA_FIXED, quantum, "QM39100*", "*" },
- /*quirks*/0, /*mintags*/24, /*maxtags*/32
- },
- {
- /*
* Broken tagged queuing drive
* Reported by: Bret Ford <bford@uop.cs.uop.edu>
* and: Martin Renters <martin@tdc.on.ca>
@@ -302,17 +280,7 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
},
{
/* Broken tagged queuing drive */
- { T_DIRECT, SIP_MEDIA_FIXED, "CONNER", "CFP2107*", "*" },
- /*quirks*/0, /*mintags*/0, /*maxtags*/0
- },
- {
- /*
- * Broken tagged queuing drive.
- * Submitted by:
- * NAKAJI Hiroyuki <nakaji@zeisei.dpri.kyoto-u.ac.jp>
- * in PR kern/9535
- */
- { T_DIRECT, SIP_MEDIA_FIXED, samsung, "WN34324U*", "*" },
+ { T_DIRECT, SIP_MEDIA_REMOVABLE, "CONNER", "CFP2107*", "*" },
/*quirks*/0, /*mintags*/0, /*maxtags*/0
},
{
@@ -339,9 +307,20 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
* so we need to limit maxtags to what the device
* can handle instead of determining this automatically.
*/
- { T_DIRECT, SIP_MEDIA_FIXED, samsung, "WN321010S*", "*" },
+ { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "WN321010S*", "*" },
/*quirks*/0, /*mintags*/2, /*maxtags*/32
},
+ {
+ /*
+ * Hack until multiple-luns are supported by
+ * the target mode code.
+ */
+ {
+ T_PROCESSOR, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
+ "FreeBSD", "TM-PT", "*"
+ },
+ CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0
+ },
{
/* Really only one LUN */
{
@@ -360,11 +339,12 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
},
{
/*
- * Many Sony CDROM drives don't like multi-LUN probing.
+ * This drive doesn't like multiple LUN probing.
+ * Verified by: Jean-Marc Zucconi <jmz@FreeBSD.ORG>
*/
{
T_CDROM, SIP_MEDIA_REMOVABLE, sony,
- "CD-ROM CDU*", "*"
+ "CD-ROM CDU-80*", "*"
},
CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0
},
@@ -391,17 +371,6 @@ static struct xpt_quirk_entry xpt_quirk_table[] =
CAM_QUIRK_NOSERIAL|CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0
},
{
- /*
- * This old revision of the TDC3600 is also SCSI-1, and
- * hangs upon serial number probing.
- */
- {
- T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG",
- " TDC 3600", "U07:"
- },
- CAM_QUIRK_NOSERIAL, /*mintags*/0, /*maxtags*/0
- },
- {
/* Default tagged queuing parameters for all devices */
{
T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
@@ -449,7 +418,7 @@ static cam_isrq_t cam_bioq;
static cam_isrq_t cam_netq;
/* "Pool" of inactive ccbs managed by xpt_alloc_ccb and xpt_free_ccb */
-static SLIST_HEAD(,ccb_hdr) ccb_freeq;
+SLIST_HEAD(,ccb_hdr) ccb_freeq;
static u_int xpt_max_ccbs; /*
* Maximum size of ccb pool. Modified as
* devices are added/removed or have their
@@ -510,7 +479,7 @@ static struct cdevsw xpt_cdevsw =
static struct intr_config_hook *xpt_config_hook;
/* Registered busses */
-static TAILQ_HEAD(,cam_eb) xpt_busses;
+TAILQ_HEAD(,cam_eb) xpt_busses;
static u_int bus_generation;
/* Storage for debugging datastructures */
@@ -541,9 +510,8 @@ u_int32_t cam_dflags;
#endif /* CAMDEBUG */
#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */
-/* Our boot-time initialization hook */
-static void xpt_init(void *);
-SYSINIT(cam, SI_SUB_CONFIGURE, SI_ORDER_SECOND, xpt_init, NULL);
+/* Forward declarations for private functions */
+void xpt_init(void);
static cam_status xpt_compile_path(struct cam_path *new_path,
struct cam_periph *perph,
@@ -590,11 +558,12 @@ static void xptscandone(struct cam_periph *periph, union ccb *done_ccb);
static xpt_busfunc_t xptconfigbuscountfunc;
static xpt_busfunc_t xptconfigfunc;
static void xpt_config(void *arg);
+static xpt_devicefunc_t xptfinishconfigfunc;
static xpt_devicefunc_t xptpassannouncefunc;
static void xpt_finishconfig(struct cam_periph *periph, union ccb *ccb);
static void xptaction(struct cam_sim *sim, union ccb *work_ccb);
-static swihand_t swi_camnet;
-static swihand_t swi_cambio;
+ void swi_camnet(void);
+ void swi_cambio(void);
static void camisr(cam_isrq_t *queue);
#if 0
static void xptstart(struct cam_periph *periph, union ccb *work_ccb);
@@ -638,16 +607,12 @@ static xpt_targetfunc_t xptdeftargetfunc;
static xpt_devicefunc_t xptdefdevicefunc;
static xpt_periphfunc_t xptdefperiphfunc;
static int xpt_for_all_busses(xpt_busfunc_t *tr_func, void *arg);
-#ifdef notusedyet
static int xpt_for_all_targets(xpt_targetfunc_t *tr_func,
void *arg);
-#endif
static int xpt_for_all_devices(xpt_devicefunc_t *tr_func,
void *arg);
-#ifdef notusedyet
static int xpt_for_all_periphs(xpt_periphfunc_t *tr_func,
void *arg);
-#endif
static xpt_devicefunc_t xptsetasyncfunc;
static xpt_busfunc_t xptsetasyncbusfunc;
static cam_status xptregister(struct cam_periph *periph,
@@ -896,7 +861,7 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
union ccb ccb;
/*
- * This is an immediate CCB, so it's okay to
+ * This is an immedaite CCB, so it's okay to
* allocate it on the stack.
*/
@@ -925,7 +890,6 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
}
case XPT_DEV_MATCH: {
struct cam_periph_map_info mapinfo;
- struct cam_path *old_path;
/*
* We can't deal with physical addresses for this
@@ -935,21 +899,6 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
error = EINVAL;
break;
}
-
- /*
- * Save this in case the caller had it set to
- * something in particular.
- */
- old_path = inccb->ccb_h.path;
-
- /*
- * We really don't need a path for the matching
- * code. The path is needed because of the
- * debugging statements in xpt_action(). They
- * assume that the CCB has a valid path.
- */
- inccb->ccb_h.path = xpt_periph->path;
-
bzero(&mapinfo, sizeof(mapinfo));
/*
@@ -958,10 +907,8 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
*/
error = cam_periph_mapmem(inccb, &mapinfo);
- if (error) {
- inccb->ccb_h.path = old_path;
+ if (error)
break;
- }
/*
* This is an immediate CCB, we can send it on directly.
@@ -973,8 +920,6 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
*/
cam_periph_unmapmem(inccb, &mapinfo);
- inccb->ccb_h.path = old_path;
-
error = 0;
break;
}
@@ -1170,9 +1115,8 @@ ptstartover:
}
/* Functions accessed by the peripheral drivers */
-static void
-xpt_init(dummy)
- void *dummy;
+void
+xpt_init()
{
struct cam_sim *xpt_sim;
struct cam_path *path;
@@ -1217,7 +1161,7 @@ xpt_init(dummy)
return;
}
- cam_periph_alloc(xptregister, NULL, NULL, NULL, "xpt", CAM_PERIPH_BIO,
+ cam_periph_alloc(xptregister, NULL, NULL, "xpt", CAM_PERIPH_BIO,
path, NULL, 0, NULL);
xpt_free_path(path);
@@ -1244,8 +1188,11 @@ xpt_init(dummy)
}
/* Install our software interrupt handlers */
- register_swi(SWI_CAMNET, swi_camnet);
- register_swi(SWI_CAMBIO, swi_cambio);
+ /* XXX Should call some MI function to do this */
+#ifdef __i386__
+ ihandlers[SWI_CAMNET] = swi_camnet;
+ ihandlers[SWI_CAMBIO] = swi_cambio;
+#endif
}
static cam_status
@@ -2509,7 +2456,6 @@ xpt_for_all_busses(xpt_busfunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#ifdef notusedyet
/*
* Execute the given function for every target in the EDT.
*/
@@ -2524,7 +2470,6 @@ xpt_for_all_targets(xpt_targetfunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#endif /* notusedyet */
/*
* Execute the given function for every device in the EDT.
@@ -2541,7 +2486,6 @@ xpt_for_all_devices(xpt_devicefunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#ifdef notusedyet
/*
* Execute the given function for every peripheral in the EDT.
*/
@@ -2556,7 +2500,6 @@ xpt_for_all_periphs(xpt_periphfunc_t *tr_func, void *arg)
return(xptbustraverse(NULL, xptdefbusfunc, &tr_config));
}
-#endif /* notusedyet */
static int
xptsetasyncfunc(struct cam_ed *device, void *arg)
@@ -2567,15 +2510,6 @@ xptsetasyncfunc(struct cam_ed *device, void *arg)
cur_entry = (struct async_node *)arg;
- /*
- * Don't report unconfigured devices (Wildcard devs,
- * devices only for target mode, device instances
- * that have been invalidated but are waiting for
- * their last reference count to be released).
- */
- if ((device->flags & CAM_DEV_UNCONFIGURED) != 0)
- return (1);
-
xpt_compile_path(&path,
NULL,
device->target->bus->path_id,
@@ -2591,7 +2525,6 @@ xptsetasyncfunc(struct cam_ed *device, void *arg)
return(1);
}
-
static int
xptsetasyncbusfunc(struct cam_eb *bus, void *arg)
{
@@ -2720,8 +2653,6 @@ xpt_action(union ccb *start_ccb)
}
/* FALLTHROUGH */
#endif
- case XPT_ABORT:
- case XPT_RESET_DEV:
case XPT_ACCEPT_TARGET_IO:
case XPT_EN_LUN:
case XPT_IMMED_NOTIFY:
@@ -2905,6 +2836,10 @@ xpt_action(union ccb *start_ccb)
}
case XPT_SASYNC_CB:
{
+ /*
+ * First off, determine the list we want to
+ * be insterted into.
+ */
struct ccb_setasync *csa;
struct async_node *cur_entry;
struct async_list *async_head;
@@ -2913,7 +2848,11 @@ xpt_action(union ccb *start_ccb)
csa = &start_ccb->csa;
added = csa->event_enable;
- async_head = &csa->ccb_h.path->device->asyncs;
+ if (csa->ccb_h.path->device != NULL) {
+ async_head = &csa->ccb_h.path->device->asyncs;
+ } else {
+ async_head = &csa->ccb_h.path->bus->asyncs;
+ }
/*
* If there is already an entry for us, simply
@@ -2937,7 +2876,6 @@ xpt_action(union ccb *start_ccb)
if (csa->event_enable == 0) {
SLIST_REMOVE(async_head, cur_entry,
async_node, links);
- csa->ccb_h.path->device->refcount--;
free(cur_entry, M_DEVBUF);
} else {
cur_entry->event_enable = csa->event_enable;
@@ -2954,7 +2892,6 @@ xpt_action(union ccb *start_ccb)
cur_entry->callback = csa->callback;
cur_entry->event_enable = csa->event_enable;
SLIST_INSERT_HEAD(async_head, cur_entry, links);
- csa->ccb_h.path->device->refcount++;
}
if ((added & AC_FOUND_DEVICE) != 0) {
@@ -3102,11 +3039,8 @@ xpt_action(union ccb *start_ccb)
CAM_REQ_CMP) {
start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
cam_dflags = CAM_DEBUG_NONE;
- } else {
+ } else
start_ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_print_path(cam_dpath);
- printf("debugging flags now %x\n", cam_dflags);
- }
} else {
cam_dpath = NULL;
start_ccb->ccb_h.status = CAM_REQ_CMP;
@@ -3122,6 +3056,8 @@ xpt_action(union ccb *start_ccb)
break;
default:
case XPT_SDEV_TYPE:
+ case XPT_ABORT:
+ case XPT_RESET_DEV:
case XPT_TERM_IO:
case XPT_ENG_INQ:
/* XXX Implement */
@@ -3252,7 +3188,7 @@ xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo,
int retval;
u_int32_t old_priority;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_schedule_dev\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_schedule_dev\n"));
old_priority = pinfo->priority;
@@ -3264,7 +3200,7 @@ xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo,
if (new_priority < old_priority) {
camq_change_priority(queue, pinfo->index,
new_priority);
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("changed priority to %d\n",
new_priority));
}
@@ -3274,7 +3210,7 @@ xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo,
if (new_priority < old_priority)
pinfo->priority = new_priority;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("Inserting onto queue\n"));
if (queue->generation++ == 0) {
/* Generation wrap, regen all entries */
@@ -3293,10 +3229,10 @@ xpt_run_dev_allocq(struct cam_eb *bus)
struct cam_devq *devq;
int s;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_run_dev_allocq\n"));
devq = bus->sim->devq;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
(" qfrozen_cnt == 0x%x, entries == %d, "
"openings == %d, active == %d\n",
devq->alloc_queue.qfrozen_cnt,
@@ -3319,7 +3255,7 @@ xpt_run_dev_allocq(struct cam_eb *bus)
/*position*/0);
device = qinfo->device;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("running device %p\n", device));
drvq = &device->drvq;
@@ -3344,7 +3280,7 @@ xpt_run_dev_allocq(struct cam_eb *bus)
splx(s);
xpt_setup_ccb(&work_ccb->ccb_h, drv->path,
drv->pinfo.priority);
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("calling periph start\n"));
drv->periph_start(drv, work_ccb);
} else {
@@ -3378,7 +3314,7 @@ xpt_run_dev_sendq(struct cam_eb *bus)
struct cam_devq *devq;
int s;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_run_dev_sendq\n"));
devq = bus->sim->devq;
@@ -3413,7 +3349,7 @@ xpt_run_dev_sendq(struct cam_eb *bus)
continue;
}
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT,
+ CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("running device %p\n", device));
work_ccb = cam_ccbq_peek_ccb(&device->ccbq, 0);
@@ -3590,35 +3526,49 @@ xpt_compile_path(struct cam_path *new_path, struct cam_periph *perph,
bus = xpt_find_bus(path_id);
if (bus == NULL) {
status = CAM_PATH_INVALID;
- } else {
+ } else if (target_id != CAM_TARGET_WILDCARD) {
target = xpt_find_target(bus, target_id);
if (target == NULL) {
- /* Create one */
- struct cam_et *new_target;
-
- new_target = xpt_alloc_target(bus, target_id);
- if (new_target == NULL) {
- status = CAM_RESRC_UNAVAIL;
+ if (path_id == CAM_XPT_PATH_ID) {
+ status = CAM_TID_INVALID;
} else {
- target = new_target;
+ /* Create one */
+ struct cam_et *new_target;
+
+ new_target = xpt_alloc_target(bus, target_id);
+ if (new_target == NULL) {
+ status = CAM_RESRC_UNAVAIL;
+ } else {
+ target = new_target;
+ }
}
}
- if (target != NULL) {
+ if (target != NULL && lun_id != CAM_LUN_WILDCARD) {
device = xpt_find_device(target, lun_id);
if (device == NULL) {
- /* Create one */
- struct cam_ed *new_device;
-
- new_device = xpt_alloc_device(bus,
- target,
- lun_id);
- if (new_device == NULL) {
- status = CAM_RESRC_UNAVAIL;
+ if (path_id == CAM_XPT_PATH_ID) {
+ status = CAM_LUN_INVALID;
} else {
- device = new_device;
+ /* Create one */
+ struct cam_ed *new_device;
+
+ new_device = xpt_alloc_device(bus,
+ target,
+ lun_id);
+ if (new_device == NULL) {
+ status = CAM_RESRC_UNAVAIL;
+ } else {
+ device = new_device;
+ }
}
}
}
+ } else if (lun_id != CAM_LUN_WILDCARD) {
+ /*
+ * Specific luns are not allowed if the
+ * target is wildcarded
+ */
+ status = CAM_LUN_INVALID;
}
/*
@@ -3772,7 +3722,7 @@ xpt_release_ccb(union ccb *free_ccb)
struct cam_ed *device;
struct cam_eb *bus;
- CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_release_ccb\n"));
+ CAM_DEBUG_PRINT(CAM_DEBUG_TRACE, ("xpt_release_ccb\n"));
path = free_ccb->ccb_h.path;
device = path->device;
bus = path->bus;
@@ -3833,6 +3783,7 @@ xpt_bus_register(struct cam_sim *sim, u_int32_t bus)
new_bus->path_id = sim->path_id;
new_bus->sim = sim;
+ SLIST_INIT(&new_bus->asyncs);
TAILQ_INIT(&new_bus->et_entries);
s = splsoftcam();
TAILQ_INSERT_TAIL(&xpt_busses, new_bus, links);
@@ -4068,20 +4019,15 @@ xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg)
/*async_update*/TRUE);
}
+
xpt_async_bcast(&device->asyncs,
async_code,
path,
async_arg);
}
}
-
- /*
- * If this wasn't a fully wildcarded async, tell all
- * clients that want all async events.
- */
- if (bus != xpt_periph->path->bus)
- xpt_async_bcast(&xpt_periph->path->device->asyncs, async_code,
- path, async_arg);
+ xpt_async_bcast(&bus->asyncs, async_code,
+ path, async_arg);
splx(s);
}
@@ -4131,7 +4077,7 @@ xpt_freeze_devq(struct cam_path *path, u_int count)
* the CCB. See ahc_action/ahc_freeze_devq for
* an example.
*/
- ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_tailq);
+ ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_list);
if (ccbh && ccbh->status == CAM_REQ_INPROG)
ccbh->status = CAM_REQUEUE_REQ;
splx(s);
@@ -4146,7 +4092,7 @@ xpt_freeze_simq(struct cam_sim *sim, u_int count)
struct ccb_hdr *ccbh;
ccbh = TAILQ_LAST(&sim->devq->active_dev->ccbq.active_ccbs,
- ccb_hdr_tailq);
+ ccb_hdr_list);
if (ccbh && ccbh->status == CAM_REQ_INPROG)
ccbh->status = CAM_REQUEUE_REQ;
}
@@ -4593,17 +4539,6 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
return;
}
- if ((work_ccb->cpi.hba_misc & PIM_NOINITIATOR) != 0) {
- /*
- * Can't scan the bus on an adapter that
- * cannot perform the initiator role.
- */
- request_ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_free_ccb(work_ccb);
- xpt_done(request_ccb);
- return;
- }
-
/* Save some state for use while we probe for devices */
scan_info = (xpt_scan_bus_info *)
malloc(sizeof(xpt_scan_bus_info), M_TEMP, M_WAITOK);
@@ -4791,7 +4726,6 @@ static void
xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
cam_flags flags, union ccb *request_ccb)
{
- struct ccb_pathinq cpi;
cam_status status;
struct cam_path *new_path;
struct cam_periph *old_periph;
@@ -4799,30 +4733,6 @@ xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE,
("xpt_scan_lun\n"));
-
- xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
- cpi.ccb_h.func_code = XPT_PATH_INQ;
- xpt_action((union ccb *)&cpi);
-
- if (cpi.ccb_h.status != CAM_REQ_CMP) {
- if (request_ccb != NULL) {
- request_ccb->ccb_h.status = cpi.ccb_h.status;
- xpt_done(request_ccb);
- }
- return;
- }
-
- if ((cpi.hba_misc & PIM_NOINITIATOR) != 0) {
- /*
- * Can't scan the bus on an adapter that
- * cannot perform the initiator role.
- */
- if (request_ccb != NULL) {
- request_ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_done(request_ccb);
- }
- return;
- }
if (request_ccb == NULL) {
request_ccb = malloc(sizeof(union ccb), M_TEMP, M_NOWAIT);
@@ -4867,7 +4777,7 @@ xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
TAILQ_INSERT_TAIL(&softc->request_ccbs, &request_ccb->ccb_h,
periph_links.tqe);
} else {
- status = cam_periph_alloc(proberegister, NULL, probecleanup,
+ status = cam_periph_alloc(proberegister, probecleanup,
probestart, "probe",
CAM_PERIPH_BIO,
request_ccb->ccb_h.path, NULL, 0,
@@ -4948,7 +4858,7 @@ probeschedule(struct cam_periph *periph)
* lun 0. This will insure that any bogus transfer settings are
* invalidated.
*/
- if (((ccb->ccb_h.path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
+ if (((ccb->ccb_h.path->device->flags & CAM_DEV_UNCONFIGURED)==0)
&& (ccb->ccb_h.target_lun == 0))
softc->action = PROBE_TUR;
else
@@ -5605,37 +5515,19 @@ xptconfigfunc(struct cam_eb *bus, void *arg)
"status %#x for bus %d\n", status, bus->path_id);
printf("xptconfigfunc: halting bus configuration\n");
xpt_free_ccb(work_ccb);
- busses_to_config--;
- xpt_finishconfig(xpt_periph, NULL);
return(0);
}
xpt_setup_ccb(&work_ccb->ccb_h, path, /*priority*/1);
- work_ccb->ccb_h.func_code = XPT_PATH_INQ;
+ work_ccb->ccb_h.func_code = XPT_RESET_BUS;
+ work_ccb->ccb_h.cbfcnp = NULL;
+ CAM_DEBUG(path, CAM_DEBUG_SUBTRACE,
+ ("Resetting Bus\n"));
xpt_action(work_ccb);
- if (work_ccb->ccb_h.status != CAM_REQ_CMP) {
- printf("xptconfigfunc: CPI failed on bus %d "
- "with status %d\n", bus->path_id,
- work_ccb->ccb_h.status);
- xpt_finishconfig(xpt_periph, work_ccb);
- return(1);
- }
-
- if ((work_ccb->cpi.hba_misc & PIM_NOBUSRESET) == 0) {
- xpt_setup_ccb(&work_ccb->ccb_h, path, /*priority*/1);
- work_ccb->ccb_h.func_code = XPT_RESET_BUS;
- work_ccb->ccb_h.cbfcnp = NULL;
- CAM_DEBUG(path, CAM_DEBUG_SUBTRACE,
- ("Resetting Bus\n"));
- xpt_action(work_ccb);
- xpt_finishconfig(xpt_periph, work_ccb);
- } else {
- /* Act as though we performed a successful BUS RESET */
- work_ccb->ccb_h.func_code = XPT_RESET_BUS;
- xpt_finishconfig(xpt_periph, work_ccb);
- }
+ xpt_finishconfig(xpt_periph, work_ccb);
}
return(1);
+
}
static void
@@ -5682,6 +5574,32 @@ xpt_config(void *arg)
}
}
+static int
+xptfinishconfigfunc(struct cam_ed *device, void *arg)
+{
+ union ccb work_ccb;
+ struct cam_path path;
+ cam_status status;
+
+ if ((status = xpt_compile_path(&path, xpt_periph,
+ device->target->bus->path_id,
+ device->target->target_id,
+ device->lun_id)) != CAM_REQ_CMP) {
+ printf("xptfinishconfig: xpt_compile_path failed with status"
+ " %#x, halting device registration\n", status);
+ return(0);
+ }
+
+ xpt_setup_ccb(&work_ccb.ccb_h, &path, /*priority*/1);
+
+ work_ccb.ccb_h.func_code = XPT_GDEV_TYPE;
+ xpt_action(&work_ccb);
+ xpt_async(AC_FOUND_DEVICE, &path, &work_ccb);
+
+ xpt_release_path(&path);
+ return(1);
+}
+
/*
* If the given device only has one peripheral attached to it, and if that
* peripheral is the passthrough driver, announce it. This insures that the
@@ -5723,10 +5641,11 @@ xpt_finishconfig(struct cam_periph *periph, union ccb *done_ccb)
}
/* FALLTHROUGH */
case XPT_SCAN_BUS:
- default:
xpt_free_path(done_ccb->ccb_h.path);
busses_to_config--;
break;
+ default:
+ break;
}
}
@@ -5739,6 +5658,12 @@ xpt_finishconfig(struct cam_periph *periph, union ccb *done_ccb)
}
/*
+ * Itterate through our devices announcing
+ * them in probed bus order.
+ */
+ xpt_for_all_devices(xptfinishconfigfunc, NULL);
+
+ /*
* Check for devices with no "standard" peripheral driver
* attached. For any devices like that, announce the
* passthrough driver so the user will see something.
@@ -5791,16 +5716,18 @@ xptaction(struct cam_sim *sim, union ccb *work_ccb)
/*
* Should only be called by the machine interrupt dispatch routines,
* so put these prototypes here instead of in the header.
+ *
+ * XXX we should really have a way to dynamically register SWI handlers.
*/
-static void
-swi_camnet(void)
+void
+swi_camnet()
{
camisr(&cam_netq);
}
-static void
-swi_cambio(void)
+void
+swi_cambio()
{
camisr(&cam_bioq);
}
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c
index 1203699e78d54..c87b1eb781a99 100644
--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_all.c,v 1.8 1998/12/06 00:05:47 mjacob Exp $
+ * $Id: scsi_all.c,v 1.5 1998/10/02 21:00:54 ken Exp $
*/
#include <sys/param.h>
@@ -1563,6 +1563,7 @@ char *
scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, size_t len)
{
u_int8_t cdb_len;
+ char holdstr[8];
int i;
if (cdb_ptr == NULL)
@@ -1607,9 +1608,17 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, size_t len)
break;
}
*cdb_string = '\0';
- for (i = 0; i < cdb_len; i++)
- snprintf(cdb_string + strlen(cdb_string),
- len - strlen(cdb_string), "%x ", cdb_ptr[i]);
+ for (i = 0; i < cdb_len; i++) {
+ sprintf(holdstr, "%x ", cdb_ptr[i]);
+ /*
+ * If we're about to exceed the length of the string,
+ * just return what we've already printed.
+ */
+ if (strlen(holdstr) + strlen(cdb_string) > len)
+ break;
+
+ strcat(cdb_string, holdstr);
+ }
return(cdb_string);
}
@@ -2201,8 +2210,8 @@ scsi_interpret_sense(struct cam_device *device, union ccb *ccb,
if (((sense_flags & SF_QUIET_IR) != 0)
&& ((sense_flags & SF_PRINT_ALWAYS) == 0))
print_sense = FALSE;
- error = EINVAL;
- break;
+
+ /* FALLTHROUGH */
case SSD_KEY_NOT_READY:
case SSD_KEY_DATA_PROTECT:
case SSD_KEY_VOLUME_OVERFLOW:
@@ -2295,7 +2304,7 @@ scsi_print_inquiry(struct scsi_inquiry_data *inq_data)
{
u_int8_t type;
char *dtype, *qtype;
- char vendor[16], product[48], revision[16], rstr[4];
+ char vendor[16], product[48], revision[16];
type = SID_TYPE(inq_data);
@@ -2375,14 +2384,10 @@ scsi_print_inquiry(struct scsi_inquiry_data *inq_data)
cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision),
sizeof(revision));
- if (SID_ANSI_REV(inq_data) == SCSI_REV_CCS)
- bcopy("CCS", rstr, 4);
- else
- snprintf(rstr, sizeof (rstr), "%d", SID_ANSI_REV(inq_data));
- printf("<%s %s %s> %s %s SCSI-%s device %s\n",
+ printf("<%s %s %s> %s %s SCSI%d device %s\n",
vendor, product, revision,
SID_IS_REMOVABLE(inq_data) ? "Removable" : "Fixed",
- dtype, rstr, qtype);
+ dtype, SID_ANSI_REV(inq_data), qtype);
}
/*
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index ccbab9d7863ce..53696071f4e70 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: scsi_all.h,v 1.5 1998/10/15 19:08:58 ken Exp $
+ * $Id: scsi_all.h,v 1.4 1998/10/02 05:25:49 ken Exp $
*/
/*
@@ -486,11 +486,6 @@ struct scsi_inquiry_data
#define SID_IS_REMOVABLE(inq_data) (((inq_data)->dev_qual2 & 0x80) != 0)
u_int8_t version;
#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07)
-#define SCSI_REV_0 0
-#define SCSI_REV_CCS 1
-#define SCSI_REV_2 2
-#define SCSI_REV_3 3
-
#define SID_ECMA 0x38
#define SID_ISO 0xC0
u_int8_t response_format;
@@ -610,8 +605,6 @@ struct scsi_mode_blk_desc
u_int8_t blklen[3];
};
-#define SCSI_DEFAULT_DENSITY 0x00 /* use 'default' density */
-#define SCSI_SAME_DENSITY 0x7f /* use 'same' density- >= SCSI-2 only */
/*
* Status Byte
*/
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 0ebc685471917..d1f0a4c52896f 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_cd.c,v 1.13 1999/01/11 17:45:22 eivind Exp $
+ * $Id: scsi_cd.c,v 1.6 1998/10/12 17:02:37 ken Exp $
*/
/*
* Portions of this driver taken from the original FreeBSD cd driver.
@@ -187,7 +187,6 @@ static periph_init_t cdinit;
static periph_ctor_t cdregister;
static periph_dtor_t cdcleanup;
static periph_start_t cdstart;
-static periph_oninv_t cdoninvalidate;
static void cdasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
static void cdshorttimeout(void *arg);
@@ -199,7 +198,7 @@ static int cdrunccb(union ccb *ccb,
u_int32_t cam_flags,
u_int32_t sense_flags),
u_int32_t cam_flags, u_int32_t sense_flags);
-static union ccb *cdgetccb(struct cam_periph *periph,
+union ccb *cdgetccb(struct cam_periph *periph,
u_int32_t priority);
static void cddone(struct cam_periph *periph,
union ccb *start_ccb);
@@ -306,7 +305,7 @@ struct cdchanger {
STAILQ_HEAD(chdevlist, cd_softc) chluns;
};
-static STAILQ_HEAD(changerlist, cdchanger) changerq;
+STAILQ_HEAD(changerlist, cdchanger) changerq;
void
cdinit(void)
@@ -353,74 +352,14 @@ cdinit(void)
}
static void
-cdoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct cd_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct cd_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = cdasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= CD_FLAG_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- /*
- * If this device is part of a changer, and it was scheduled
- * to run, remove it from the run queue since we just nuked
- * all of its scheduled I/O.
- */
- if ((softc->flags & CD_FLAG_CHANGER)
- && (softc->pinfo.index != CAM_UNQUEUED_INDEX))
- camq_remove(&softc->changer->devq, softc->pinfo.index);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-}
-
-static void
cdcleanup(struct cam_periph *periph)
{
struct cd_softc *softc;
- int s;
softc = (struct cd_softc *)periph->softc;
xpt_print_path(periph->path);
printf("removing device entry\n");
-
- s = splsoftcam();
/*
* In the queued, non-active case, the device in question
* has already been removed from the changer run queue. Since this
@@ -490,10 +429,8 @@ cdcleanup(struct cam_periph *periph)
free(softc->changer, M_DEVBUF);
num_changers--;
}
- devstat_remove_entry(&softc->device_stats);
cam_extend_release(cdperiphs, periph->unit_number);
- free(softc, M_DEVBUF);
- splx(s);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -519,11 +456,9 @@ cdasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(cdregister, cdoninvalidate,
- cdcleanup, cdstart,
- "cd", CAM_PERIPH_BIO,
- cgd->ccb_h.path, cdasync,
- AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(cdregister, cdcleanup, cdstart,
+ "cd", CAM_PERIPH_BIO, cgd->ccb_h.path,
+ cdasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -533,8 +468,65 @@ cdasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct cd_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct cd_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = cdasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= CD_FLAG_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+
+ /*
+ * If this device is part of a changer, and it was scheduled
+ * to run, remove it from the run queue since we just nuked
+ * all of its scheduled I/O.
+ */
+ if ((softc->flags & CD_FLAG_CHANGER)
+ && (softc->pinfo.index != CAM_UNQUEUED_INDEX))
+ camq_remove(&softc->changer->devq, softc->pinfo.index);
+
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_SENT_BDR:
case AC_BUS_RESET:
{
@@ -880,7 +872,6 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p)
struct ccb_getdev cgd;
u_int32_t size;
int unit, error;
- int s;
unit = dkunit(dev);
periph = cam_extend_get(cdperiphs, unit);
@@ -890,21 +881,11 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct cd_softc *)periph->softc;
- /*
- * Grab splsoftcam and hold it until we lock the peripheral.
- */
- s = splsoftcam();
- if (softc->flags & CD_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & CD_FLAG_INVALID)
return(ENXIO);
- }
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0)
return (error);
- }
-
- splx(s);
if ((softc->flags & CD_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
@@ -964,7 +945,7 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p)
/* Initialize slice tables. */
error = dsopen("cd", dev, fmt, DSO_NOLABELS | DSO_ONESLICE,
- &softc->cd_slices, &label, cdstrategy1,
+ &softc->cd_slices, &label, cdstrategy,
(ds_setgeom_t *)NULL, &cd_cdevsw);
if (error == 0) {
@@ -1330,7 +1311,7 @@ cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb,
return(error);
}
-static union ccb *
+union ccb *
cdgetccb(struct cam_periph *periph, u_int32_t priority)
{
struct cd_softc *softc;
@@ -1691,7 +1672,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
- snprintf(announce_buf, sizeof(announce_buf),
+ sprintf(announce_buf,
"cd present [%lu x %lu byte records]",
cdp->disksize, (u_long)cdp->blksize);
@@ -1759,8 +1740,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
if ((have_sense)
&& ((asc == 0x3a) || (asc == 0x04))
&& (error_code == SSD_CURRENT_ERROR))
- snprintf(announce_buf,
- sizeof(announce_buf),
+ sprintf(announce_buf,
"Attempt to query device "
"size failed: %s, %s",
scsi_sense_key_text[sense_key],
@@ -1794,18 +1774,17 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
}
xpt_print_path(periph->path);
printf("fatal error, failed"
- " to attach to device\n");
+ " to attach to device");
/*
- * Invalidate this peripheral.
+ * Free up resources.
*/
cam_periph_invalidate(periph);
announce_buf[0] = '\0';
} else {
-
/*
- * Invalidate this peripheral.
+ * Free up resources.
*/
cam_periph_invalidate(periph);
announce_buf[0] = '\0';
@@ -1813,23 +1792,14 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
}
}
free(rdcap, M_TEMP);
- if (announce_buf[0] != '\0') {
+ if (announce_buf[0] != '\0')
xpt_announce_periph(periph, announce_buf);
- if (softc->flags & CD_FLAG_CHANGER)
- cdchangerschedule(softc);
- }
softc->state = CD_STATE_NORMAL;
- /*
- * Since our peripheral may be invalidated by an error
- * above or an external event, we must release our CCB
- * before releasing the probe lock on the peripheral.
- * The peripheral will only go away once the last lock
- * is removed, and we need it around for the CCB release
- * operation.
- */
- xpt_release_ccb(done_ccb);
+ if (softc->flags & CD_FLAG_CHANGER)
+ cdchangerschedule(softc);
cam_periph_unlock(periph);
- return;
+
+ break;
}
case CD_CCB_WAITING:
{
@@ -1840,8 +1810,6 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
wakeup(&done_ccb->ccb_h.cbfcnp);
return;
}
- default:
- break;
}
xpt_release_ccb(done_ccb);
}
@@ -2486,7 +2454,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
* don't, dsioctl will pass back an error code of ENOIOCTL.
*/
error = dsioctl("cd", dev, cmd, addr, flag, &softc->cd_slices,
- cdstrategy1, (ds_setgeom_t *)NULL);
+ cdstrategy, (ds_setgeom_t *)NULL);
if (error != ENOIOCTL)
break;
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 17f6fb965966f..1f16eb389ec2c 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_ch.c,v 1.8 1998/12/12 23:52:46 gibbs Exp $
+ * $Id: scsi_ch.c,v 1.3 1998/10/02 21:20:21 ken Exp $
*/
/*
* Derived from the NetBSD SCSI changer driver.
@@ -101,13 +101,13 @@
* ELEMENT STATUS).
*/
-static const u_int32_t CH_TIMEOUT_MODE_SENSE = 6000;
-static const u_int32_t CH_TIMEOUT_MOVE_MEDIUM = 100000;
-static const u_int32_t CH_TIMEOUT_EXCHANGE_MEDIUM = 100000;
-static const u_int32_t CH_TIMEOUT_POSITION_TO_ELEMENT = 100000;
-static const u_int32_t CH_TIMEOUT_READ_ELEMENT_STATUS = 10000;
-static const u_int32_t CH_TIMEOUT_SEND_VOLTAG = 10000;
-static const u_int32_t CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
+const u_int32_t CH_TIMEOUT_MODE_SENSE = 6000;
+const u_int32_t CH_TIMEOUT_MOVE_MEDIUM = 100000;
+const u_int32_t CH_TIMEOUT_EXCHANGE_MEDIUM = 100000;
+const u_int32_t CH_TIMEOUT_POSITION_TO_ELEMENT = 100000;
+const u_int32_t CH_TIMEOUT_READ_ELEMENT_STATUS = 10000;
+const u_int32_t CH_TIMEOUT_SEND_VOLTAG = 10000;
+const u_int32_t CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
typedef enum {
CH_FLAG_INVALID = 0x001,
@@ -183,7 +183,6 @@ static d_close_t chclose;
static d_ioctl_t chioctl;
static periph_init_t chinit;
static periph_ctor_t chregister;
-static periph_oninv_t choninvalidate;
static periph_dtor_t chcleanup;
static periph_start_t chstart;
static void chasync(void *callback_arg, u_int32_t code,
@@ -287,43 +286,13 @@ chinit(void)
}
static void
-choninvalidate(struct cam_periph *periph)
-{
- struct ch_softc *softc;
- struct ccb_setasync csa;
-
- softc = (struct ch_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = chasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= CH_FLAG_INVALID;
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-
-}
-
-static void
chcleanup(struct cam_periph *periph)
{
- struct ch_softc *softc;
-
- softc = (struct ch_softc *)periph->softc;
- devstat_remove_entry(&softc->device_stats);
- cam_extend_release(chperiphs, periph->unit_number);
- xpt_print_path(periph->path);
- printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ cam_extend_release(chperiphs, periph->unit_number);
+ xpt_print_path(periph->path);
+ printf("removing device entry\n");
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -349,9 +318,8 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(chregister, choninvalidate,
- chcleanup, chstart, "ch",
- CAM_PERIPH_BIO, cgd->ccb_h.path,
+ status = cam_periph_alloc(chregister, chcleanup, chstart,
+ "ch", CAM_PERIPH_BIO, cgd->ccb_h.path,
chasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
@@ -363,8 +331,42 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct ch_softc *softc;
+ struct ccb_setasync csa;
+
+ softc = (struct ch_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = chasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= CH_FLAG_INVALID;
+
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_TRANSFER_NEG:
case AC_SENT_BDR:
case AC_SCSI_AEN:
@@ -443,7 +445,6 @@ chopen(dev_t dev, int flags, int fmt, struct proc *p)
struct cam_periph *periph;
struct ch_softc *softc;
int unit, error;
- int s;
unit = CHUNIT(dev);
periph = cam_extend_get(chperiphs, unit);
@@ -453,19 +454,12 @@ chopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct ch_softc *)periph->softc;
- s = splsoftcam();
- if (softc->flags & CH_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & CH_FLAG_INVALID)
return(ENXIO);
- }
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0)
return (error);
- }
- splx(s);
-
if ((softc->flags & CH_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
return(ENXIO);
@@ -618,8 +612,7 @@ chdone(struct cam_periph *periph, union ccb *done_ccb)
softc->sc_picker = softc->sc_firsts[CHET_MT];
#define PLURAL(c) (c) == 1 ? "" : "s"
- snprintf(announce_buf, sizeof(announce_buf),
- "%d slot%s, %d drive%s, "
+ sprintf(announce_buf, "%d slot%s, %d drive%s, "
"%d picker%s, %d portal%s",
softc->sc_counts[CHET_ST],
PLURAL(softc->sc_counts[CHET_ST]),
@@ -851,7 +844,7 @@ chmove(struct cam_periph *periph, struct changer_move *cm)
* Check the request against the changer's capabilities.
*/
if ((softc->sc_movemask[cm->cm_fromtype] & (1 << cm->cm_totype)) == 0)
- return (ENODEV);
+ return (EINVAL);
/*
* Calculate the source and destination elements.
@@ -909,7 +902,7 @@ chexchange(struct cam_periph *periph, struct changer_exchange *ce)
(1 << ce->ce_fdsttype)) == 0) ||
((softc->sc_exchangemask[ce->ce_fdsttype] &
(1 << ce->ce_sdsttype)) == 0))
- return (ENODEV);
+ return (EINVAL);
/*
* Calculate the source and destination elements.
diff --git a/sys/cam/scsi/scsi_ch.h b/sys/cam/scsi/scsi_ch.h
index 0f53c93f177a8..97c6c699c8f5c 100644
--- a/sys/cam/scsi/scsi_ch.h
+++ b/sys/cam/scsi/scsi_ch.h
@@ -347,7 +347,7 @@ struct page_device_capabilities {
#define MOVE_TO_IE 0x04
#define MOVE_TO_DT 0x08
- u_int8_t reserved1[4];
+ u_int8_t reserved1[2];
/*
* Similar to above, but for EXCHANGE MEDIUM.
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 3463bbf21c283..30f88ddc5e946 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_da.c,v 1.18 1999/01/05 20:43:41 mjacob Exp $
+ * $Id: scsi_da.c,v 1.10 1998/10/13 08:24:29 dg Exp $
*/
#include "opt_hw_wdog.h"
@@ -75,8 +75,7 @@ typedef enum {
typedef enum {
DA_Q_NONE = 0x00,
- DA_Q_NO_SYNC_CACHE = 0x01,
- DA_Q_NO_6_BYTE = 0x02
+ DA_Q_NO_SYNC_CACHE = 0x01
} da_quirks;
typedef enum {
@@ -108,7 +107,6 @@ struct da_softc {
da_state state;
da_flags flags;
da_quirks quirks;
- int minimum_cmd_size;
int ordered_tag_count;
struct disk_params params;
struct diskslices *dk_slices; /* virtual drives */
@@ -143,37 +141,11 @@ static struct da_quirk_entry da_quirk_table[] =
},
{
/*
- * This drive doesn't like the synchronize cache command
- * either. Reported by: Hellmuth Michaelis (hm@kts.org)
- * (PR 8882).
- */
- {T_DIRECT, SIP_MEDIA_FIXED, "MICROP", "2112*", "*"},
- /*quirks*/ DA_Q_NO_SYNC_CACHE
- },
- {
- /*
* Doesn't like the synchronize cache command.
* Reported by: Blaz Zupan <blaz@gold.amis.net>
*/
{T_DIRECT, SIP_MEDIA_FIXED, "NEC", "D3847*", "*"},
/*quirks*/ DA_Q_NO_SYNC_CACHE
- },
- {
- /*
- * Doesn't work correctly with 6 byte reads/writes.
- * Returns illegal request, and points to byte 9 of the
- * 6-byte CDB.
- * Reported by: Adam McDougall <bsdx@spawnet.com>
- */
- {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "VIKING 4*", "*"},
- /*quirks*/ DA_Q_NO_6_BYTE
- },
- {
- /*
- * See above.
- */
- {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "VIKING 2*", "*"},
- /*quirks*/ DA_Q_NO_6_BYTE
}
};
@@ -191,7 +163,6 @@ static void daasync(void *callback_arg, u_int32_t code,
static periph_ctor_t daregister;
static periph_dtor_t dacleanup;
static periph_start_t dastart;
-static periph_oninv_t daoninvalidate;
static void dadone(struct cam_periph *periph,
union ccb *done_ccb);
static int daerror(union ccb *ccb, u_int32_t cam_flags,
@@ -273,7 +244,6 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p)
int unit;
int part;
int error;
- int s;
unit = dkunit(dev);
part = dkpart(dev);
@@ -297,14 +267,12 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p)
softc->flags |= DA_FLAG_OPEN;
}
- s = splsoftcam();
if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) {
/*
* If any partition is open, although the disk has
* been invalidated, disallow further opens.
*/
if (dsisopen(softc->dk_slices)) {
- splx(s);
cam_periph_unlock(periph);
return (ENXIO);
}
@@ -313,7 +281,6 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p)
dsgone(&softc->dk_slices);
softc->flags &= ~DA_FLAG_PACK_INVALID;
}
- splx(s);
/* Do a read capacity */
{
@@ -447,8 +414,7 @@ daclose(dev_t dev, int flag, int fmt, struct proc *p)
/* Ignore any errors */
cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
- /*sense_flags*/SF_RETRY_UA,
- &softc->device_stats);
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
cam_release_devq(ccb->ccb_h.path,
@@ -608,18 +574,18 @@ daioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
static int
dadump(dev_t dev)
{
- struct cam_periph *periph;
- struct da_softc *softc;
- struct disklabel *lp;
- u_int unit;
- u_int part;
- long num; /* number of sectors to write */
- long blkoff;
- long blknum;
- long blkcnt;
- vm_offset_t addr;
+ struct cam_periph *periph;
+ struct da_softc *softc;
+ struct disklabel *lp;
+ u_int unit;
+ u_int part;
+ long num; /* number of sectors to write */
+ long blkoff;
+ long blknum;
+ long blkcnt;
+ char *addr;
static int dadoingadump = 0;
- struct ccb_scsiio csio;
+ struct ccb_scsiio csio;
/* toss any characters present prior to dump */
while (cncheckc() != -1)
@@ -657,13 +623,13 @@ dadump(dev_t dev)
blknum = dumplo + blkoff;
blkcnt = PAGE_SIZE / softc->params.secsize;
- addr = 0; /* starting address */
+ addr = (char *)0; /* starting address */
while (num > 0) {
- if (is_physical_memory(addr)) {
+ if (is_physical_memory((vm_offset_t)addr)) {
pmap_enter(kernel_pmap, (vm_offset_t)CADDR1,
- trunc_page(addr), VM_PROT_READ, TRUE);
+ trunc_page((vm_offset_t)addr), VM_PROT_READ, TRUE);
} else {
pmap_enter(kernel_pmap, (vm_offset_t)CADDR1,
trunc_page(0), VM_PROT_READ, TRUE);
@@ -677,7 +643,7 @@ dadump(dev_t dev)
MSG_ORDERED_Q_TAG,
/*read*/FALSE,
/*byte2*/0,
- /*minimum_cmd_size*/ softc->minimum_cmd_size,
+ /*minimum_cmd_size*/ 6,
blknum,
blkcnt,
/*data_ptr*/CADDR1,
@@ -697,7 +663,7 @@ dadump(dev_t dev)
return(EIO);
}
- if (addr % (1024 * 1024) == 0) {
+ if ((intptr_t)addr % (1024 * 1024) == 0) {
#ifdef HW_WDOG
if (wdog_tickler)
(*wdog_tickler)();
@@ -710,7 +676,7 @@ dadump(dev_t dev)
/* update block count */
num -= blkcnt;
blknum += blkcnt;
- addr += blkcnt * softc->params.secsize;
+ (long)addr += blkcnt * softc->params.secsize;
/* operator aborting dump? */
if (cncheckc() != -1)
@@ -823,67 +789,12 @@ dainit(void)
}
static void
-daoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct da_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct da_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = daasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= DA_FLAG_PACK_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- SLIST_REMOVE(&softc_list, softc, da_softc, links);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-}
-
-static void
dacleanup(struct cam_periph *periph)
{
- struct da_softc *softc;
-
- softc = (struct da_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
cam_extend_release(daperiphs, periph->unit_number);
xpt_print_path(periph->path);
printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -909,11 +820,9 @@ daasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(daregister, daoninvalidate,
- dacleanup, dastart,
- "da", CAM_PERIPH_BIO,
- cgd->ccb_h.path, daasync,
- AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(daregister, dacleanup, dastart,
+ "da", CAM_PERIPH_BIO, cgd->ccb_h.path,
+ daasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -922,8 +831,57 @@ daasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct da_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct da_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = daasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= DA_FLAG_PACK_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ SLIST_REMOVE(&softc_list, softc, da_softc, links);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_SENT_BDR:
case AC_BUS_RESET:
{
@@ -1006,11 +964,6 @@ daregister(struct cam_periph *periph, void *arg)
else
softc->quirks = DA_Q_NONE;
- if (softc->quirks & DA_Q_NO_6_BYTE)
- softc->minimum_cmd_size = 10;
- else
- softc->minimum_cmd_size = 6;
-
/*
* Block our timeout handler while we
* add this softc to the dev list.
@@ -1110,7 +1063,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
tag_code,
bp->b_flags & B_READ,
/*byte2*/0,
- softc->minimum_cmd_size,
+ /*minimum_cmd_size*/ 6,
bp->b_pblkno,
bp->b_bcount / softc->params.secsize,
bp->b_data,
@@ -1296,7 +1249,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
dasetgeom(periph, rdcap);
dp = &softc->params;
- snprintf(announce_buf, sizeof(announce_buf),
+ sprintf(announce_buf,
"%ldMB (%d %d byte sectors: %dH %dS/T %dC)",
dp->sectors / ((1024L * 1024L) / dp->secsize),
dp->sectors, dp->secsize, dp->heads,
@@ -1360,8 +1313,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
*/
if ((have_sense) && (asc == 0x3a)
&& (error_code == SSD_CURRENT_ERROR))
- snprintf(announce_buf,
- sizeof(announce_buf),
+ sprintf(announce_buf,
"Attempt to query device "
"size failed: %s, %s",
scsi_sense_key_text[sense_key],
@@ -1379,7 +1331,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
xpt_print_path(periph->path);
printf("fatal error, failed"
- " to attach to device\n");
+ " to attach to device");
/*
* Free up resources.
@@ -1393,17 +1345,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
if (announce_buf[0] != '\0')
xpt_announce_periph(periph, announce_buf);
softc->state = DA_STATE_NORMAL;
- /*
- * Since our peripheral may be invalidated by an error
- * above or an external event, we must release our CCB
- * before releasing the probe lock on the peripheral.
- * The peripheral will only go away once the last lock
- * is removed, and we need it around for the CCB release
- * operation.
- */
- xpt_release_ccb(done_ccb);
cam_periph_unlock(periph);
- return;
+ break;
}
case DA_CCB_WAITING:
{
@@ -1414,8 +1357,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
case DA_CCB_DUMP:
/* No-op. We're polling */
return;
- default:
- break;
}
xpt_release_ccb(done_ccb);
}
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 40e63762226a8..8d861c276d4fc 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pass.c,v 1.4 1998/10/22 22:16:56 ken Exp $
+ * $Id: scsi_pass.c,v 1.2 1998/09/16 00:11:53 ken Exp $
*/
#include <sys/param.h>
@@ -42,6 +42,7 @@
#include <sys/conf.h>
#include <sys/buf.h>
#include <sys/proc.h>
+#include <sys/cdio.h>
#include <sys/errno.h>
#include <sys/devicestat.h>
@@ -103,7 +104,6 @@ static d_strategy_t passstrategy;
static periph_init_t passinit;
static periph_ctor_t passregister;
-static periph_oninv_t passoninvalidate;
static periph_dtor_t passcleanup;
static periph_start_t passstart;
static void passasync(void *callback_arg, u_int32_t code,
@@ -197,72 +197,15 @@ passinit(void)
}
static void
-passoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct pass_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct pass_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = passasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= PASS_FLAG_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- if (bootverbose) {
- xpt_print_path(periph->path);
- printf("lost device\n");
- }
-
-}
-
-static void
passcleanup(struct cam_periph *periph)
{
- struct pass_softc *softc;
-
- softc = (struct pass_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
-
cam_extend_release(passperiphs, periph->unit_number);
if (bootverbose) {
xpt_print_path(periph->path);
printf("removing device entry\n");
}
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -286,10 +229,10 @@ passasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(passregister, passoninvalidate,
- passcleanup, passstart, "pass",
- CAM_PERIPH_BIO, cgd->ccb_h.path,
- passasync, AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(passregister, passcleanup, passstart,
+ "pass", CAM_PERIPH_BIO,
+ cgd->ccb_h.path, passasync,
+ AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -299,8 +242,57 @@ passasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct pass_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct pass_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = passasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= PASS_FLAG_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ if (bootverbose) {
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+ }
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
+ }
case AC_TRANSFER_NEG:
case AC_SENT_BDR:
case AC_SCSI_AEN:
@@ -379,7 +371,6 @@ passopen(dev_t dev, int flags, int fmt, struct proc *p)
struct cam_periph *periph;
struct pass_softc *softc;
int unit, error;
- int s;
error = 0; /* default to no error */
@@ -394,44 +385,27 @@ passopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct pass_softc *)periph->softc;
- s = splsoftcam();
- if (softc->flags & PASS_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & PASS_FLAG_INVALID)
return(ENXIO);
- }
-
- /*
- * Don't allow access when we're running at a high securelvel.
- */
- if (securelevel > 1) {
- splx(s);
- return(EPERM);
- }
/*
* Only allow read-write access.
*/
- if (((flags & FWRITE) == 0) || ((flags & FREAD) == 0)) {
- splx(s);
+ if (((flags & FWRITE) == 0) || ((flags & FREAD) == 0))
return(EPERM);
- }
/*
* We don't allow nonblocking access.
*/
if ((flags & O_NONBLOCK) != 0) {
- xpt_print_path(periph->path);
- printf("can't do nonblocking accesss\n");
- splx(s);
- return(EINVAL);
+ printf("%s%d: can't do nonblocking accesss\n",
+ periph->periph_name,
+ periph->unit_number);
+ return(ENODEV);
}
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0)
return (error);
- }
-
- splx(s);
if ((softc->flags & PASS_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index b937ad4202213..b225d76a8e931 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pt.c,v 1.3 1998/10/22 22:16:56 ken Exp $
+ * $Id: scsi_pt.c,v 1.1 1998/09/15 06:36:34 gibbs Exp $
*/
#include <sys/param.h>
@@ -90,7 +90,6 @@ static periph_init_t ptinit;
static void ptasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
static periph_ctor_t ptctor;
-static periph_oninv_t ptoninvalidate;
static periph_dtor_t ptdtor;
static periph_start_t ptstart;
static void ptdone(struct cam_periph *periph,
@@ -146,7 +145,6 @@ ptopen(dev_t dev, int flags, int fmt, struct proc *p)
struct pt_softc *softc;
int unit;
int error;
- int s;
unit = minor(dev);
periph = cam_extend_get(ptperiphs, unit);
@@ -155,21 +153,11 @@ ptopen(dev_t dev, int flags, int fmt, struct proc *p)
softc = (struct pt_softc *)periph->softc;
- s = splsoftcam();
- if (softc->flags & PT_FLAG_DEVICE_INVALID) {
- splx(s);
- return(ENXIO);
- }
-
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
("ptopen: dev=0x%x (unit %d)\n", dev, unit));
- if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0) {
- splx(s);
+ if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0)
return (error); /* error code from tsleep */
- }
-
- splx(s);
if ((softc->flags & PT_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
@@ -396,67 +384,12 @@ ptctor(struct cam_periph *periph, void *arg)
}
static void
-ptoninvalidate(struct cam_periph *periph)
-{
- int s;
- struct pt_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
-
- softc = (struct pt_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = ptasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= PT_FLAG_DEVICE_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
-
- splx(s);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-}
-
-static void
ptdtor(struct cam_periph *periph)
{
- struct pt_softc *softc;
-
- softc = (struct pt_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
-
cam_extend_release(ptperiphs, periph->unit_number);
xpt_print_path(periph->path);
printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -481,10 +414,9 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(ptctor, ptoninvalidate, ptdtor,
- ptstart, "pt", CAM_PERIPH_BIO,
- cgd->ccb_h.path, ptasync,
- AC_FOUND_DEVICE, cgd);
+ status = cam_periph_alloc(ptctor, ptdtor, ptstart,
+ "pt", CAM_PERIPH_BIO, cgd->ccb_h.path,
+ ptasync, AC_FOUND_DEVICE, cgd);
if (status != CAM_REQ_CMP
&& status != CAM_REQ_INPROG)
@@ -494,6 +426,51 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
}
case AC_LOST_DEVICE:
{
+ int s;
+ struct pt_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct pt_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = ptasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= PT_FLAG_DEVICE_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
break;
}
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index f28b07ef47241..59b213f4659c9 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_sa.c,v 1.15 1999/01/16 04:02:31 mjacob Exp $
+ * $Id: scsi_sa.c,v 1.2 1998/10/02 05:15:27 ken Exp $
*/
#include <sys/param.h>
@@ -76,10 +76,6 @@
#define SAUNIT(DEV) ((minor(DEV)&0xF0) >> 4) /* 4 bit unit. */
#define SASETUNIT(DEV, U) makedev(major(DEV), ((U) << 4))
-#ifndef UNUSED_PARAMETER
-#define UNUSED_PARAMETER(x) x = x
-#endif
-
typedef enum {
SA_STATE_NORMAL
} sa_state;
@@ -99,14 +95,15 @@ typedef enum {
SA_FLAG_TAPE_MOUNTED = 0x0008,
SA_FLAG_TAPE_WP = 0x0010,
SA_FLAG_TAPE_WRITTEN = 0x0020,
- SA_FLAG_EOM_PENDING = 0x0040,
- SA_FLAG_EIO_PENDING = 0x0080,
- SA_FLAG_EOF_PENDING = 0x0100,
+ SA_FLAG_2FM_AT_EOD = 0x0040,
+ SA_FLAG_EOM_PENDING = 0x0080,
+ SA_FLAG_EIO_PENDING = 0x0100,
+ SA_FLAG_EOF_PENDING = 0x0200,
SA_FLAG_ERR_PENDING = (SA_FLAG_EOM_PENDING|SA_FLAG_EIO_PENDING|
SA_FLAG_EOF_PENDING),
- SA_FLAG_INVALID = 0x0200,
- SA_FLAG_COMP_ENABLED = 0x0400,
- SA_FLAG_COMP_UNSUPP = 0x0800
+ SA_FLAG_INVALID = 0x0400,
+ SA_FLAG_COMP_ENABLED = 0x0800,
+ SA_FLAG_COMP_UNSUPP = 0x1000
} sa_flags;
typedef enum {
@@ -129,10 +126,7 @@ typedef enum {
typedef enum {
SA_QUIRK_NONE = 0x00,
- SA_QUIRK_NOCOMP = 0x01, /* can't deal with compression at all */
- SA_QUIRK_FIXED = 0x02, /* force fixed mode */
- SA_QUIRK_VARIABLE = 0x04, /* force variable mode */
- SA_QUIRK_2FM = 0x08 /* Two File Marks at EOD */
+ SA_QUIRK_NOCOMP = 0x01
} sa_quirks;
struct sa_softc {
@@ -146,83 +140,27 @@ struct sa_softc {
int blk_shift;
u_int32_t max_blk;
u_int32_t min_blk;
- u_int32_t comp_algorithm;
- u_int32_t saved_comp_algorithm;
+ u_int8_t media_density;
u_int32_t media_blksize;
- u_int32_t last_media_blksize;
u_int32_t media_numblks;
- u_int8_t media_density;
+ u_int32_t comp_algorithm;
+ u_int32_t saved_comp_algorithm;
u_int8_t speed;
- u_int8_t scsi_rev;
int buffer_mode;
int filemarks;
union ccb saved_ccb;
- /*
- * Latched Error Info
- */
- struct {
- struct scsi_sense_data _last_io_sense;
- u_int32_t _last_io_resid;
- u_int8_t _last_io_cdb[CAM_MAX_CDBLEN];
- struct scsi_sense_data _last_ctl_sense;
- u_int32_t _last_ctl_resid;
- u_int8_t _last_ctl_cdb[CAM_MAX_CDBLEN];
-#define last_io_sense errinfo._last_io_sense
-#define last_io_resid errinfo._last_io_resid
-#define last_io_cdb errinfo._last_io_cdb
-#define last_ctl_sense errinfo._last_ctl_sense
-#define last_ctl_resid errinfo._last_ctl_resid
-#define last_ctl_cdb errinfo._last_ctl_cdb
- } errinfo;
};
struct sa_quirk_entry {
- struct scsi_inquiry_pattern inq_pat; /* matching pattern */
- sa_quirks quirks; /* specific quirk type */
- u_int32_t prefblk; /* preferred blocksize when in fixed mode */
+ struct scsi_inquiry_pattern inq_pat;
+ sa_quirks quirks;
};
static struct sa_quirk_entry sa_quirk_table[] =
{
{
{ T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "ARCHIVE",
- "Python 25601*", "*"}, SA_QUIRK_NOCOMP, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "ARCHIVE",
- "VIPER 150*", "*"}, SA_QUIRK_FIXED, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "ARCHIVE",
- "VIPER 2525*", "*"}, SA_QUIRK_FIXED, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "HP",
- "T4000S*", "*"}, SA_QUIRK_FIXED, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "HP",
- "HP-88780*", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "KENNEDY",
- "*", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "M4 DATA",
- "123107 SCSI*", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG",
- " TDC 3600", "U07:"}, SA_QUIRK_NOCOMP, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG",
- " TDC 4200", "*"}, SA_QUIRK_NOCOMP, 512
- },
- {
- { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "WANGTEK",
- "5525ES*", "*"}, SA_QUIRK_FIXED, 512
+ "Python 25601*", "*"}, /*quirks*/SA_QUIRK_NOCOMP
}
};
@@ -234,7 +172,6 @@ static d_strategy_t sastrategy;
static d_ioctl_t saioctl;
static periph_init_t sainit;
static periph_ctor_t saregister;
-static periph_oninv_t saoninvalidate;
static periph_dtor_t sacleanup;
static periph_start_t sastart;
static void saasync(void *callback_arg, u_int32_t code,
@@ -255,13 +192,12 @@ static int sagetparams(struct cam_periph *periph,
static int sasetparams(struct cam_periph *periph,
sa_params params_to_set,
u_int32_t blocksize, u_int8_t density,
- u_int32_t comp_algorithm,
- u_int32_t sense_flags);
+ u_int32_t comp_algorithm);
static void saprevent(struct cam_periph *periph, int action);
static int sarewind(struct cam_periph *periph);
static int saspace(struct cam_periph *periph, int count,
scsi_space_code code);
-static int samount(struct cam_periph *, int, dev_t);
+static int samount(struct cam_periph *periph);
static int saretension(struct cam_periph *periph);
static int sareservereleaseunit(struct cam_periph *periph,
int reserve);
@@ -269,9 +205,6 @@ static int saloadunload(struct cam_periph *periph, int load);
static int saerase(struct cam_periph *periph, int longerase);
static int sawritefilemarks(struct cam_periph *periph,
int nmarks, int setmarks);
-static int sardpos(struct cam_periph *periph, int, u_int32_t *);
-static int sasetpos(struct cam_periph *periph, int, u_int32_t *);
-
static struct periph_driver sadriver =
{
@@ -330,7 +263,6 @@ saopen(dev_t dev, int flags, int fmt, struct proc *p)
int mode;
int density;
int error;
- int s;
unit = SAUNIT(dev);
mode = SAMODE(dev);
@@ -346,19 +278,13 @@ saopen(dev_t dev, int flags, int fmt, struct proc *p)
("saaopen: dev=0x%x (unit %d , mode %d, density %d)\n", dev,
unit, mode, density));
- s = splsoftcam();
- if (softc->flags & SA_FLAG_INVALID) {
- splx(s);
+ if (softc->flags & SA_FLAG_INVALID)
return(ENXIO);
- }
if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0) {
- splx(s);
return (error); /* error code from tsleep */
}
- splx(s);
-
if ((softc->flags & SA_FLAG_OPEN) == 0) {
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
return(ENXIO);
@@ -375,8 +301,9 @@ saopen(dev_t dev, int flags, int fmt, struct proc *p)
error = EBUSY;
}
- if (error == 0)
- error = samount(periph, flags, dev);
+ if (error == 0) {
+ error = samount(periph);
+ }
/* Perform other checking... */
}
@@ -397,7 +324,6 @@ saclose(dev_t dev, int flag, int fmt, struct proc *p)
int unit;
int mode;
int error;
- int closedbits = SA_FLAG_OPEN;
unit = SAUNIT(dev);
mode = SAMODE(dev);
@@ -411,71 +337,24 @@ saclose(dev_t dev, int flag, int fmt, struct proc *p)
return (error); /* error code from tsleep */
}
- /*
- * See whether or not we need to write filemarks...
- */
- error = sacheckeod(periph);
- if (error) {
- xpt_print_path(periph->path);
- printf("failure at writing filemarks - opting for safety\n");
- mode = SA_MODE_OFFLINE;
- }
+ sacheckeod(periph);
- /*
- * Whatever we end up doing, allow users to eject tapes from here on.
- */
saprevent(periph, PR_ALLOW);
- /*
- * Decide how to end...
- */
switch (mode) {
- default:
- xpt_print_path(periph->path);
- printf("unknown close mode %x- opting for safety\n", mode);
- /* FALLTHROUGH */
- case SA_MODE_OFFLINE:
+ case SA_MODE_REWIND:
sarewind(periph);
- saloadunload(periph, FALSE);
- closedbits |= SA_FLAG_TAPE_MOUNTED; /* not mounted now */
break;
- case SA_MODE_REWIND:
+ case SA_MODE_OFFLINE:
sarewind(periph);
- closedbits |= SA_FLAG_TAPE_MOUNTED; /* not mounted now */
+ saloadunload(periph, /*load*/FALSE);
break;
case SA_MODE_NOREWIND:
- /*
- * If we're not rewinding/unloading the tape, find out
- * whether we need to back up over one of two filemarks
- * we wrote (if we wrote two filemarks) so that appends
- * from this point on will be sane.
- */
- if ((softc->quirks & SA_QUIRK_2FM) &&
- (softc->flags & SA_FLAG_TAPE_WRITTEN)) {
- error = saspace(periph, -1, SS_FILEMARKS);
- if (error) {
- xpt_print_path(periph->path);
- printf("unable to backspace over one of double"
- " filemarks at EOD- opting for safety\n");
- sarewind(periph);
- saloadunload(periph, FALSE);
- closedbits |= SA_FLAG_TAPE_MOUNTED;
- }
- }
+ default:
break;
}
- /*
- * We wish to note here that there are no more filemarks to be written.
- */
- softc->filemarks = 0;
- softc->flags &= ~SA_FLAG_TAPE_WRITTEN;
-
- /*
- * And we are no longer open for business.
- */
-
- softc->flags &= ~closedbits;
+ softc->flags &= ~SA_FLAG_OPEN;
/* release the device */
sareservereleaseunit(periph, FALSE);
@@ -519,16 +398,6 @@ sastrategy(struct buf *bp)
}
softc = (struct sa_softc *)periph->softc;
- s = splsoftcam();
-
- if (softc->flags & SA_FLAG_INVALID) {
- splx(s);
- bp->b_error = ENXIO;
- goto bad;
- }
-
- splx(s);
-
/*
* If it's a null transfer, return immediatly
*/
@@ -541,10 +410,10 @@ sastrategy(struct buf *bp)
* Fixed block device. The byte count must
* be a multiple of our block size.
*/
- if (((softc->blk_mask != ~0) &&
- ((bp->b_bcount & softc->blk_mask) != 0)) ||
- ((softc->blk_mask == ~0) &&
- ((bp->b_bcount % softc->min_blk) != 0))) {
+ if (((softc->blk_mask != ~0)
+ && ((bp->b_bcount & softc->blk_mask) != 0))
+ || ((softc->blk_mask == ~0)
+ && ((bp->b_bcount % softc->min_blk) != 0))) {
xpt_print_path(periph->path);
printf("Invalid request. Fixed block device "
"requests must be a multiple "
@@ -552,31 +421,32 @@ sastrategy(struct buf *bp)
bp->b_error = EINVAL;
goto bad;
}
- } else if ((bp->b_bcount > softc->max_blk) ||
- (bp->b_bcount < softc->min_blk) ||
- (bp->b_bcount & softc->blk_mask) != 0) {
+ } else if ((bp->b_bcount > softc->max_blk)
+ || (bp->b_bcount < softc->min_blk)
+ || (bp->b_bcount & softc->blk_mask) != 0) {
xpt_print_path(periph->path);
printf("Invalid request. Variable block device "
- "requests must be ");
+ "requests must be ");
if (softc->blk_mask != 0) {
- printf("a multiple of %d ", (0x1 << softc->blk_gran));
+ printf("a multiple of %d ",
+ (0x1 << softc->blk_gran));
}
- printf("between %d and %d bytes\n", softc->min_blk,
- softc->max_blk);
+ printf("between %d and %d bytes\n",
+ softc->min_blk, softc->max_blk);
bp->b_error = EINVAL;
goto bad;
}
/*
- * Mask interrupts so that the device cannot be invalidated until
+ * Mask interrupts so that the pack cannot be invalidated until
* after we are in the queue. Otherwise, we might not properly
* clean up one of the buffers.
*/
s = splbio();
/*
- * Place it at the end of the queue.
+ * Place it in the queue of disk activities for this disk
*/
bufq_insert_tail(&softc->buf_queue, bp);
@@ -585,7 +455,7 @@ sastrategy(struct buf *bp)
/*
* Schedule ourselves for performing the work.
*/
- xpt_schedule(periph, 1);
+ xpt_schedule(periph, /* XXX priority */1);
return;
bad:
@@ -628,10 +498,10 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
struct mtget *g = (struct mtget *)arg;
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
- ("saioctl: MTIOGET\n"));
+ ("saioctl: MTIOGET\n"));
bzero(g, sizeof(struct mtget));
- g->mt_type = MT_ISAR;
+ g->mt_type = 0x7; /* Ultrix compat *//*? */
g->mt_density = softc->media_density;
g->mt_blksiz = softc->media_blksize;
if (softc->flags & SA_FLAG_COMP_UNSUPP) {
@@ -664,29 +534,6 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
error = 0;
break;
}
- case MTIOCERRSTAT:
- {
- struct scsi_tape_errors *sep =
- &((union mterrstat *)arg)->scsi_errstat;
-
- CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
- ("saioctl: MTIOCERRSTAT\n"));
-
- bzero(sep, sizeof(*sep));
- sep->io_resid = softc->last_io_resid;
- bcopy((caddr_t) &softc->last_io_sense, sep->io_sense,
- sizeof (sep->io_sense));
- bcopy((caddr_t) &softc->last_io_cdb, sep->io_cdb,
- sizeof (sep->io_cdb));
- sep->ctl_resid = softc->last_ctl_resid;
- bcopy((caddr_t) &softc->last_ctl_sense, sep->ctl_sense,
- sizeof (sep->ctl_sense));
- bcopy((caddr_t) &softc->last_ctl_cdb, sep->ctl_cdb,
- sizeof (sep->ctl_cdb));
- bzero((caddr_t) &softc->errinfo, sizeof (softc->errinfo));
- error = 0;
- break;
- }
case MTIOCTOP:
{
struct mtop *mt;
@@ -700,91 +547,46 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
count = mt->mt_count;
switch (mt->mt_op) {
- case MTWEOF: /* write an end-of-file marker */
- error = sawritefilemarks(periph, count, FALSE);
- break;
- case MTWSS: /* write a setmark */
- error = sawritefilemarks(periph, count, TRUE);
+ case MTWEOF: /* write an end-of-file record */
+ error = sawritefilemarks(periph, count,
+ /*setmarks*/FALSE);
break;
case MTBSR: /* backward space record */
case MTFSR: /* forward space record */
case MTBSF: /* backward space file */
case MTFSF: /* forward space file */
- case MTBSS: /* backward space setmark */
- case MTFSS: /* forward space setmark */
case MTEOD: /* space to end of recorded medium */
{
int nmarks;
- scsi_space_code spaceop = SS_FILEMARKS;
+ scsi_space_code spaceop;
nmarks = softc->filemarks;
error = sacheckeod(periph);
- if (error) {
- xpt_print_path(periph->path);
- printf("EOD check prior to spacing failed\n");
- softc->flags |= SA_FLAG_EIO_PENDING;
- break;
- }
nmarks -= softc->filemarks;
- switch(mt->mt_op) {
- case MTBSR:
+
+ if ((mt->mt_op == MTBSR) || (mt->mt_op == MTBSF))
count = -count;
- /* FALLTHROUGH */
- case MTFSR:
+
+ if ((mt->mt_op == MTBSF) || (mt->mt_op == MTFSF))
+ spaceop = SS_FILEMARKS;
+ else if ((mt->mt_op == MTBSR) || (mt->mt_op == MTFSR))
spaceop = SS_BLOCKS;
- break;
- case MTBSF:
- count = -count;
- /* FALLTHROUGH */
- case MTFSF:
- break;
- case MTBSS:
- count = -count;
- /* FALLTHROUGH */
- case MTFSS:
- spaceop = SS_SETMARKS;
- break;
- case MTEOD:
+ else {
spaceop = SS_EOD;
count = 0;
nmarks = 0;
- break;
- default:
- error = EINVAL;
- break;
}
- if (error)
- break;
nmarks = softc->filemarks;
- /*
- * XXX: Why are we checking again?
- */
error = sacheckeod(periph);
- if (error)
- break;
nmarks -= softc->filemarks;
- error = saspace(periph, count - nmarks, spaceop);
- /*
- * At this point, clear that we've written the tape
- * and that we've written any filemarks. We really
- * don't know what the applications wishes to do next-
- * the sacheckeod's will make sure we terminated the
- * tape correctly if we'd been writing, but the next
- * action the user application takes will set again
- * whether we need to write filemarks.
- */
- softc->flags &= ~SA_FLAG_TAPE_WRITTEN;
- softc->filemarks = 0;
+ if (error == 0)
+ error = saspace(periph, count - nmarks,
+ spaceop);
break;
}
case MTREW: /* rewind */
- (void) sacheckeod(periph);
error = sarewind(periph);
- /* see above */
- softc->flags &=
- ~SA_FLAG_TAPE_WRITTEN|SA_FLAG_TAPE_MOUNTED;
- softc->filemarks = 0;
break;
case MTERASE: /* erase */
error = saerase(periph, count);
@@ -793,12 +595,6 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
error = saretension(periph);
break;
case MTOFFL: /* rewind and put the drive offline */
-
- (void) sacheckeod(periph);
- /* see above */
- softc->flags &= ~SA_FLAG_TAPE_WRITTEN;
- softc->filemarks = 0;
-
/*
* Be sure to allow media removal before
* attempting the eject.
@@ -811,6 +607,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
else
break;
+ /* XXX KDM */
softc->flags &= ~SA_FLAG_TAPE_LOCKED;
softc->flags &= ~SA_FLAG_TAPE_MOUNTED;
break;
@@ -822,45 +619,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
case MTSETBSIZ: /* Set block size for device */
error = sasetparams(periph, SA_PARAM_BLOCKSIZE, count,
- 0, 0, 0);
- if (error == 0) {
- softc->last_media_blksize =
- softc->media_blksize;
- softc->media_blksize = count;
- if (count) {
- softc->flags |= SA_FLAG_FIXED;
- if (powerof2(count)) {
- softc->blk_shift =
- ffs(count) - 1;
- softc->blk_mask = count - 1;
- } else {
- softc->blk_mask = ~0;
- softc->blk_shift = 0;
- }
- /*
- * Make the user's desire 'persistent'.
- */
- softc->quirks &= ~SA_QUIRK_VARIABLE;
- softc->quirks |= SA_QUIRK_FIXED;
- } else {
- softc->flags &= ~SA_FLAG_FIXED;
- if (softc->max_blk == 0) {
- softc->max_blk = ~0;
- }
- softc->blk_shift = 0;
- if (softc->blk_gran != 0) {
- softc->blk_mask =
- softc->blk_gran - 1;
- } else {
- softc->blk_mask = 0;
- }
- /*
- * Make the user's desire 'persistent'.
- */
- softc->quirks |= SA_QUIRK_VARIABLE;
- softc->quirks &= ~SA_QUIRK_FIXED;
- }
- }
+ 0, 0);
break;
case MTSETDNSTY: /* Set density for device and mode */
if (count > UCHAR_MAX) {
@@ -868,7 +627,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
break;
} else {
error = sasetparams(periph, SA_PARAM_DENSITY,
- 0, count, 0, 0);
+ 0, count, 0);
}
break;
case MTCOMP: /* enable compression */
@@ -883,7 +642,7 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
break;
}
error = sasetparams(periph, SA_PARAM_COMPRESSION,
- 0, 0, count, 0);
+ 0, 0, count);
break;
default:
error = EINVAL;
@@ -894,18 +653,6 @@ saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
case MTIOCEEOT:
error = 0;
break;
- case MTIOCRDSPOS:
- error = sardpos(periph, 0, (u_int32_t *) arg);
- break;
- case MTIOCRDHPOS:
- error = sardpos(periph, 1, (u_int32_t *) arg);
- break;
- case MTIOCSLOCATE:
- error = sasetpos(periph, 0, (u_int32_t *) arg);
- break;
- case MTIOCHLOCATE:
- error = sasetpos(periph, 1, (u_int32_t *) arg);
- break;
default:
error = cam_periph_ioctl(periph, cmd, arg, saerror);
break;
@@ -960,66 +707,12 @@ sainit(void)
}
static void
-saoninvalidate(struct cam_periph *periph)
-{
- struct sa_softc *softc;
- struct buf *q_bp;
- struct ccb_setasync csa;
- int s;
-
- softc = (struct sa_softc *)periph->softc;
-
- /*
- * De-register any async callbacks.
- */
- xpt_setup_ccb(&csa.ccb_h, periph->path,
- /* priority */ 5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = 0;
- csa.callback = saasync;
- csa.callback_arg = periph;
- xpt_action((union ccb *)&csa);
-
- softc->flags |= SA_FLAG_INVALID;
-
- /*
- * Although the oninvalidate() routines are always called at
- * splsoftcam, we need to be at splbio() here to keep the buffer
- * queue from being modified while we traverse it.
- */
- s = splbio();
-
- /*
- * Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
- while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
- bufq_remove(&softc->buf_queue, q_bp);
- q_bp->b_resid = q_bp->b_bcount;
- q_bp->b_error = ENXIO;
- q_bp->b_flags |= B_ERROR;
- biodone(q_bp);
- }
- splx(s);
-
- xpt_print_path(periph->path);
- printf("lost device\n");
-
-}
-
-static void
sacleanup(struct cam_periph *periph)
{
- struct sa_softc *softc;
-
- softc = (struct sa_softc *)periph->softc;
-
- devstat_remove_entry(&softc->device_stats);
cam_extend_release(saperiphs, periph->unit_number);
xpt_print_path(periph->path);
printf("removing device entry\n");
- free(softc, M_DEVBUF);
+ free(periph->softc, M_DEVBUF);
}
static void
@@ -1045,8 +738,7 @@ saasync(void *callback_arg, u_int32_t code,
* this device and start the probe
* process.
*/
- status = cam_periph_alloc(saregister, saoninvalidate,
- sacleanup, sastart,
+ status = cam_periph_alloc(saregister, sacleanup, sastart,
"sa", CAM_PERIPH_BIO, cgd->ccb_h.path,
saasync, AC_FOUND_DEVICE, cgd);
@@ -1057,8 +749,54 @@ saasync(void *callback_arg, u_int32_t code,
break;
}
case AC_LOST_DEVICE:
+ {
+ int s;
+ struct sa_softc *softc;
+ struct buf *q_bp;
+ struct ccb_setasync csa;
+
+ softc = (struct sa_softc *)periph->softc;
+
+ /*
+ * Insure that no other async callbacks that
+ * might affect this peripheral can come through.
+ */
+ s = splcam();
+
+ /*
+ * De-register any async callbacks.
+ */
+ xpt_setup_ccb(&csa.ccb_h, periph->path,
+ /* priority */ 5);
+ csa.ccb_h.func_code = XPT_SASYNC_CB;
+ csa.event_enable = 0;
+ csa.callback = saasync;
+ csa.callback_arg = periph;
+ xpt_action((union ccb *)&csa);
+
+ softc->flags |= SA_FLAG_INVALID;
+
+ /*
+ * Return all queued I/O with ENXIO.
+ * XXX Handle any transactions queued to the card
+ * with XPT_ABORT_CCB.
+ */
+ while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){
+ bufq_remove(&softc->buf_queue, q_bp);
+ q_bp->b_resid = q_bp->b_bcount;
+ q_bp->b_error = ENXIO;
+ q_bp->b_flags |= B_ERROR;
+ biodone(q_bp);
+ }
+ devstat_remove_entry(&softc->device_stats);
+
+ xpt_print_path(periph->path);
+ printf("lost device\n");
+
+ splx(s);
+
cam_periph_invalidate(periph);
- break;
+ }
case AC_TRANSFER_NEG:
case AC_SENT_BDR:
case AC_SCSI_AEN:
@@ -1097,7 +835,6 @@ saregister(struct cam_periph *periph, void *arg)
}
bzero(softc, sizeof(*softc));
- softc->scsi_rev = SID_ANSI_REV(&cgd->inq_data);
softc->state = SA_STATE_NORMAL;
bufq_init(&softc->buf_queue);
periph->softc = softc;
@@ -1111,16 +848,9 @@ saregister(struct cam_periph *periph, void *arg)
sizeof(sa_quirk_table)/sizeof(*sa_quirk_table),
sizeof(*sa_quirk_table), scsi_inquiry_match);
- if (match != NULL) {
+ if (match != NULL)
softc->quirks = ((struct sa_quirk_entry *)match)->quirks;
- softc->last_media_blksize =
- ((struct sa_quirk_entry *)match)->prefblk;
-#ifdef CAMDEBUG
- xpt_print_path(periph->path);
- printf("found quirk entry %d\n",
- ((struct sa_quirk_entry *) match) - sa_quirk_table);
-#endif
- } else
+ else
softc->quirks = SA_QUIRK_NONE;
/*
@@ -1157,7 +887,6 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
softc = (struct sa_softc *)periph->softc;
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("sastart"));
switch (softc->state) {
case SA_STATE_NORMAL:
@@ -1184,10 +913,7 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
splx(s);
xpt_release_ccb(start_ccb);
} else if ((softc->flags & SA_FLAG_ERR_PENDING) != 0) {
- struct buf *done_bp;
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("sastart- coping with pending error %x\n",
- softc->flags & SA_FLAG_ERR_PENDING));
+
bufq_remove(&softc->buf_queue, bp);
bp->b_resid = bp->b_bcount;
bp->b_flags |= B_ERROR;
@@ -1195,17 +921,13 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
if ((bp->b_flags & B_READ) == 0)
bp->b_error = ENOSPC;
}
- if ((softc->flags & SA_FLAG_EOF_PENDING) != 0) {
- bp->b_error = EIO;
- }
if ((softc->flags & SA_FLAG_EIO_PENDING) != 0) {
bp->b_error = EIO;
}
softc->flags &= ~SA_FLAG_ERR_PENDING;
- done_bp = bp;
bp = bufq_first(&softc->buf_queue);
splx(s);
- biodone(done_bp);
+ biodone(bp);
} else {
u_int32_t length;
@@ -1216,30 +938,17 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
length =
bp->b_bcount >> softc->blk_shift;
} else {
- if (softc->media_blksize == 0) {
- bp->b_error = EIO;
- xpt_print_path(periph->path);
- printf("zero blocksize for "
- "FIXED length writes?\n");
- splx(s);
- biodone(bp);
- break;
- }
length =
- bp->b_bcount / softc->media_blksize;
+ bp->b_bcount / softc->min_blk;
}
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("Fixed Record Count is %d\n", length));
} else {
length = bp->b_bcount;
- CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO,
- ("Variable Record Count is %d\n", length));
}
devstat_start_transaction(&softc->device_stats);
/*
- * Some people have theorized that we should
+ * XXX - Perhaps we should...
* suppress illegal length indication if we are
* running in variable block mode so that we don't
* have to request sense every time our requested
@@ -1250,16 +959,9 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
* information about blocks that are larger than
* our read buffer unless we set the block size
* in the mode page to something other than 0.
- *
- * I believe that this is a non-issue. If user apps
- * don't adjust their read size to match our record
- * size, that's just life. Anyway, the typical usage
- * would be to issue, e.g., 64KB reads and occasionally
- * have to do deal with 512 byte or 1KB intermediate
- * records.
*/
scsi_sa_read_write(&start_ccb->csio,
- /* No Retries */0,
+ /*retries*/4,
sadone,
MSG_SIMPLE_Q_TAG,
bp->b_flags & B_READ,
@@ -1274,6 +976,7 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
start_ccb->ccb_h.ccb_bp = bp;
bp = bufq_first(&softc->buf_queue);
splx(s);
+
xpt_action(start_ccb);
}
@@ -1304,9 +1007,11 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
bp = (struct buf *)done_ccb->ccb_h.ccb_bp;
error = 0;
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+
if ((error = saerror(done_ccb, 0, 0)) == ERESTART) {
/*
- * A retry was scheduled, so just return.
+ * A retry was scheuled, so
+ * just return.
*/
return;
}
@@ -1357,13 +1062,7 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
softc->filemarks = 0;
}
}
-#ifdef CAMDEBUG
- if (error || bp->b_resid) {
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("error %d resid %ld count %ld\n", error,
- bp->b_resid, bp->b_bcount));
- }
-#endif
+
devstat_end_transaction(&softc->device_stats,
bp->b_bcount - bp->b_resid,
done_ccb->csio.tag_action & 0xf,
@@ -1382,26 +1081,14 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
xpt_release_ccb(done_ccb);
}
-
-/*
- * Mount the tape (make sure it's ready for I/O).
- */
static int
-samount(struct cam_periph *periph, int oflags, dev_t dev)
+samount(struct cam_periph *periph)
{
struct sa_softc *softc;
union ccb *ccb;
struct ccb_scsiio *csio;
int error;
- /*
- * oflags can be checked for 'kind' of open (read-only check) - later
- * dev can be checked for a control-mode or compression open - later
- */
- UNUSED_PARAMETER(oflags);
- UNUSED_PARAMETER(dev);
-
-
softc = (struct sa_softc *)periph->softc;
ccb = cam_periph_getccb(periph, /* priority */1);
csio = &ccb->csio;
@@ -1412,20 +1099,29 @@ samount(struct cam_periph *periph, int oflags, dev_t dev)
* open/mount that would invalidate a mount. This
* will also eat any pending UAs.
*/
- scsi_test_unit_ready(csio, 1, sadone,
- MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, 5000);
+ scsi_test_unit_ready(csio,
+ /*retries*/1,
+ sadone,
+ MSG_SIMPLE_Q_TAG,
+ SSD_FULL_SIZE,
+ /*timeout*/5000);
- cam_periph_runccb(ccb, NULL, 0, 0, &softc->device_stats);
+ cam_periph_runccb(ccb, /*error handler*/NULL, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
softc->flags &= ~SA_FLAG_TAPE_MOUNTED;
}
if ((softc->flags & SA_FLAG_TAPE_MOUNTED) == 0) {
struct scsi_read_block_limits_data *rblim;
int comp_enabled, comp_supported;
- u_int8_t write_protect, guessing = 0;
+ u_int8_t write_protect;
/*
* Clear out old state.
@@ -1441,201 +1137,40 @@ samount(struct cam_periph *periph, int oflags, dev_t dev)
rblim = (struct scsi_read_block_limits_data *)
malloc(sizeof(*rblim), M_TEMP, M_WAITOK);
- /* it is safe to retry this */
- scsi_read_block_limits(csio, 5, sadone, MSG_SIMPLE_Q_TAG,
- rblim, SSD_FULL_SIZE, 5000);
+ scsi_read_block_limits(csio,
+ /*retries*/1,
+ sadone,
+ MSG_SIMPLE_Q_TAG,
+ rblim,
+ SSD_FULL_SIZE,
+ /*timeout*/5000);
- error = cam_periph_runccb(ccb, saerror, 0,
- SF_RETRY_UA, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/SF_RETRY_UA,
+ &softc->device_stats);
xpt_release_ccb(ccb);
- if (error != 0) {
- /*
- * If it's less than SCSI-2, READ BLOCK LIMITS is not
- * a MANDATORY command. Anyway- it doesn't matter-
- * we can proceed anyway.
- */
- softc->blk_gran = 0;
- softc->max_blk = ~0;
- softc->min_blk = 0;
- } else {
- if (softc->scsi_rev >= SCSI_REV_3) {
- softc->blk_gran = RBL_GRAN(rblim);
- } else {
- softc->blk_gran = 0;
- }
- /*
- * We take max_blk == min_blk to mean a default to
- * fixed mode- but note that whatever we get out of
- * sagetparams below will actually determine whether
- * we are actually *in* fixed mode.
- */
- softc->max_blk = scsi_3btoul(rblim->maximum);
- softc->min_blk = scsi_2btoul(rblim->minimum);
-
-
- }
- /*
- * Next, perform a mode sense to determine
- * current density, blocksize, compression etc.
- */
- error = sagetparams(periph, SA_PARAM_ALL,
- &softc->media_blksize,
- &softc->media_density,
- &softc->media_numblks,
- &softc->buffer_mode, &write_protect,
- &softc->speed, &comp_supported,
- &comp_enabled, &softc->comp_algorithm,
- NULL);
-
- if (error != 0) {
- /*
- * We could work a little harder here. We could
- * adjust our attempts to get information. It
- * might be an ancient tape drive. If someone
- * nudges us, we'll do that.
- */
+ if (error != 0)
goto exit;
- }
- /*
- * If no quirk has determined that this is a device that is
- * preferred to be in fixed or variable mode, now is the time
- * to find out.
- */
- if ((softc->quirks & (SA_QUIRK_FIXED|SA_QUIRK_VARIABLE)) == 0) {
- guessing = 1;
- switch (softc->media_density) {
- case SCSI_DENSITY_QIC_11_4TRK:
- case SCSI_DENSITY_QIC_11_9TRK:
- case SCSI_DENSITY_QIC_24:
- case SCSI_DENSITY_QIC_120:
- case SCSI_DENSITY_QIC_150:
- softc->quirks |= SA_QUIRK_FIXED;
- softc->last_media_blksize = 512;
- break;
- default:
- softc->last_media_blksize =
- softc->media_blksize;
- softc->quirks |= SA_QUIRK_VARIABLE;
- break;
- }
- }
-
- /*
- * If no quirk has determined that this is a device that needs
- * to have 2 Filemarks at EOD, now is the time to find out.
- */
-
- if ((softc->quirks & SA_QUIRK_2FM) == 0) {
- switch (softc->media_density) {
- case SCSI_DENSITY_HALFINCH_800:
- case SCSI_DENSITY_HALFINCH_1600:
- case SCSI_DENSITY_HALFINCH_6250:
- case SCSI_DENSITY_HALFINCH_6250C:
- case SCSI_DENSITY_HALFINCH_PE:
- softc->quirks |= SA_QUIRK_2FM;
- break;
- default:
- break;
- }
- }
-
- /*
- * Now validate that some info we got makes sense.
- */
-
- if ((softc->max_blk < softc->media_blksize) ||
- (softc->min_blk > softc->media_blksize &&
- softc->media_blksize)) {
- xpt_print_path(ccb->ccb_h.path);
- printf("BLOCK LIMITS (%d..%d) could not match current "
- "block settings (%d)- adjusting\n", softc->min_blk,
- softc->max_blk, softc->media_blksize);
- softc->max_blk = softc->min_blk =
- softc->media_blksize;
- }
-
- /*
- * Now put ourselves into the right frame of mind based
- * upon quirks...
- */
-tryagain:
- /*
- * If we want to be in FIXED mode and our current blocksize
- * is not equal to our last blocksize (if nonzero), try and
- * set ourselves to this last blocksize (as the 'preferred'
- * block size). The initial quirkmatch at registry sets the
- * initial 'last' blocksize. If, for whatever reason, this
- * 'last' blocksize is zero, set the blocksize to 512,
- * or min_blk if that's larger.
- */
- if ((softc->quirks & SA_QUIRK_FIXED) &&
- (softc->media_blksize != softc->last_media_blksize)) {
- softc->media_blksize = softc->last_media_blksize;
- if (softc->media_blksize == 0) {
- softc->media_blksize = 512;
- if (softc->media_blksize < softc->min_blk) {
- softc->media_blksize = softc->min_blk;
- }
- }
- error = sasetparams(periph, SA_PARAM_BLOCKSIZE,
- softc->media_blksize, 0, 0, SF_NO_PRINT);
- if (error) {
- xpt_print_path(ccb->ccb_h.path);
- printf("unable to set fixed blocksize to %d\n",
- softc->media_blksize);
- goto exit;
- }
- }
-
- if ((softc->quirks & SA_QUIRK_VARIABLE) &&
- (softc->media_blksize != 0)) {
- softc->last_media_blksize = softc->media_blksize;
- softc->media_blksize = 0;
- error = sasetparams(periph, SA_PARAM_BLOCKSIZE,
- 0, 0, 0, SF_NO_PRINT);
- if (error) {
- /*
- * If this fails and we were guessing, just
- * assume that we got it wrong and go try
- * fixed block mode. Don't even check against
- * density code at this point.
- */
- if (guessing) {
- softc->quirks &= ~SA_QUIRK_VARIABLE;
- softc->quirks |= SA_QUIRK_FIXED;
- if (softc->last_media_blksize == 0)
- softc->last_media_blksize = 512;
- goto tryagain;
- }
- xpt_print_path(ccb->ccb_h.path);
- printf("unable to set variable blocksize\n");
- goto exit;
- }
- }
-
- /*
- * Now that we have the current block size,
- * set up some parameters for sastart's usage.
- */
- if (softc->media_blksize) {
+ softc->blk_gran = RBL_GRAN(rblim);
+ softc->max_blk = scsi_3btoul(rblim->maximum);
+ softc->min_blk = scsi_2btoul(rblim->minimum);
+ if (softc->max_blk == softc->min_blk) {
softc->flags |= SA_FLAG_FIXED;
- if (powerof2(softc->media_blksize)) {
- softc->blk_shift =
- ffs(softc->media_blksize) - 1;
- softc->blk_mask = softc->media_blksize - 1;
+ if (powerof2(softc->min_blk)) {
+ softc->blk_mask = softc->min_blk - 1;
+ softc->blk_shift = 0;
+ softc->blk_shift = ffs(softc->min_blk) - 1;
} else {
softc->blk_mask = ~0;
softc->blk_shift = 0;
}
} else {
/*
- * The SCSI-3 spec allows 0 to mean "unspecified".
- * The SCSI-1 spec allows 0 to mean 'infinite'.
- *
- * Either works here.
+ * SCSI-III spec allows 0
+ * to mean "unspecified"
*/
if (softc->max_blk == 0) {
softc->max_blk = ~0;
@@ -1648,6 +1183,22 @@ tryagain:
}
}
+ /*
+ * Next, perform a mode sense to determine
+ * current density, blocksize, compression etc.
+ */
+ error = sagetparams(periph, SA_PARAM_ALL,
+ &softc->media_blksize,
+ &softc->media_density,
+ &softc->media_numblks,
+ &softc->buffer_mode, &write_protect,
+ &softc->speed, &comp_supported,
+ &comp_enabled, &softc->comp_algorithm,
+ NULL);
+
+ if (error != 0)
+ goto exit;
+
if (write_protect)
softc->flags |= SA_FLAG_TAPE_WP;
@@ -1662,22 +1213,24 @@ tryagain:
} else
softc->flags |= SA_FLAG_COMP_UNSUPP;
- if (softc->buffer_mode == SMH_SA_BUF_MODE_NOBUF) {
- error = sasetparams(periph, SA_PARAM_BUFF_MODE, 0,
- 0, 0, SF_NO_PRINT);
- if (error == 0)
- softc->buffer_mode = SMH_SA_BUF_MODE_SIBUF;
- }
+ if (softc->buffer_mode != SMH_SA_BUF_MODE_NOBUF)
+ goto exit;
+ error = sasetparams(periph, SA_PARAM_BUFF_MODE, 0, 0, 0);
if (error == 0)
- softc->flags |= SA_FLAG_TAPE_MOUNTED;
+ softc->buffer_mode = SMH_SA_BUF_MODE_SIBUF;
exit:
if (rblim != NULL)
free(rblim, M_TEMP);
- if (error != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ if (error != 0) {
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+ }
} else
xpt_release_ccb(ccb);
@@ -1696,13 +1249,15 @@ sacheckeod(struct cam_periph *periph)
if ((softc->flags & SA_FLAG_TAPE_WRITTEN) != 0) {
markswanted++;
- if ((softc->quirks & SA_QUIRK_2FM) != 0)
+
+ if ((softc->flags & SA_FLAG_2FM_AT_EOD) != 0)
markswanted++;
}
if (softc->filemarks < markswanted) {
markswanted -= softc->filemarks;
- error = sawritefilemarks(periph, markswanted, FALSE);
+ error = sawritefilemarks(periph, markswanted,
+ /*setmarks*/FALSE);
} else {
error = 0;
}
@@ -1716,7 +1271,6 @@ saerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
struct sa_softc *softc;
struct ccb_scsiio *csio;
struct scsi_sense_data *sense;
- u_int32_t info, resid;
int error_code, sense_key, asc, ascq;
int error;
@@ -1726,7 +1280,18 @@ saerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
sense = &csio->sense_data;
scsi_extract_sense(sense, &error_code, &sense_key, &asc, &ascq);
error = 0;
- if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR) {
+
+ if (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR)
+ && ((sense->flags & (SSD_EOM|SSD_FILEMARK|SSD_ILI)) != 0)
+ && ((sense_key == SSD_KEY_NO_SENSE)
+ || (sense_key == SSD_KEY_BLANK_CHECK))) {
+ u_int32_t info;
+ u_int32_t resid;
+ int defer_action;
+
+ /*
+ * Filter out some sense codes of interest.
+ */
if ((sense->error_code & SSD_ERRCODE_VALID) != 0) {
info = scsi_4btoul(sense->info);
resid = info;
@@ -1735,40 +1300,11 @@ saerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
} else {
resid = csio->dxfer_len;
info = resid;
- if ((softc->flags & SA_FLAG_FIXED) != 0) {
- if (softc->media_blksize)
- info /= softc->media_blksize;
- }
- }
- if (csio->ccb_h.ccb_type == SA_CCB_BUFFER_IO) {
- bcopy((caddr_t) sense, (caddr_t) &softc->last_io_sense,
- sizeof (struct scsi_sense_data));
- bcopy(csio->cdb_io.cdb_bytes, softc->last_io_cdb,
- (int) csio->cdb_len);
- softc->last_io_resid = resid;
- } else {
- bcopy((caddr_t) sense, (caddr_t) &softc->last_ctl_sense,
- sizeof (struct scsi_sense_data));
- bcopy(csio->cdb_io.cdb_bytes, softc->last_ctl_cdb,
- (int) csio->cdb_len);
- softc->last_ctl_resid = resid;
+ if ((softc->flags & SA_FLAG_FIXED) != 0)
+ info /= softc->media_blksize;
}
- }
-
- if (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR)
- && ((sense->flags & (SSD_EOM|SSD_FILEMARK|SSD_ILI)) != 0)
- && ((sense_key == SSD_KEY_NO_SENSE)
- || (sense_key == SSD_KEY_BLANK_CHECK))) {
- int defer_action;
-
- CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
- ("Key 0x%x ASC/ASCQ 0x%x 0x%x flags 0x%x resid %d "
- "dxfer_len %d\n", sense_key, asc, ascq,
- sense->flags & ~SSD_KEY_RESERVED, resid,
- csio->dxfer_len));
-
- if (resid > 0 && resid < csio->dxfer_len &&
- (softc->flags & SA_FLAG_FIXED) != 0)
+ if ((resid > 0 && resid < csio->dxfer_len)
+ && (softc->flags & SA_FLAG_FIXED) != 0)
defer_action = TRUE;
else
defer_action = FALSE;
@@ -1863,24 +1399,38 @@ retry:
else
ncomp_page = NULL;
- /* it is safe to retry this */
- scsi_mode_sense(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- SMS_PAGE_CTRL_CURRENT, (params_to_get & SA_PARAM_COMPRESSION) ?
- SA_DATA_COMPRESSION_PAGE : SMS_VENDOR_SPECIFIC_PAGE,
- mode_buffer, mode_buffer_len, SSD_FULL_SIZE, 5000);
+ scsi_mode_sense(&ccb->csio,
+ /*retries*/ 1,
+ /*cbfcnp*/ sadone,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*dbd*/ FALSE,
+ /*page_code*/ SMS_PAGE_CTRL_CURRENT,
+ /*page*/ (params_to_get & SA_PARAM_COMPRESSION) ?
+ SA_DATA_COMPRESSION_PAGE :
+ SMS_VENDOR_SPECIFIC_PAGE,
+ /*param_buf*/ mode_buffer,
+ /*param_len*/ mode_buffer_len,
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ 5000);
- error = cam_periph_runccb(ccb, saerror, 0,
- SF_NO_PRINT, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/ 0,
+ /*sense_flags*/SF_NO_PRINT,
+ &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /* relsim_flags */0,
+ /* opening_reduction */0,
+ /* timeout */0,
+ /* getcount_only */ FALSE);
status = ccb->ccb_h.status & CAM_STATUS_MASK;
- if (error == EINVAL && (params_to_get & SA_PARAM_COMPRESSION) != 0) {
+ if (error == EINVAL
+ && (params_to_get & SA_PARAM_COMPRESSION) != 0) {
/*
* Most likely doesn't support the compression
- * page. Remember this for the future and attempt
+ * page. Remeber this for the future and attempt
* the request without asking for compression info.
*/
softc->quirks |= SA_QUIRK_NOCOMP;
@@ -1973,15 +1523,6 @@ retry:
bcopy(ncomp_page, comp_page,sizeof(*comp_page));
}
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) {
- int idx;
- char *xyz = mode_buffer;
- xpt_print_path(periph->path);
- printf("Mode Sense Data=");
- for (idx = 0; idx < mode_buffer_len; idx++)
- printf(" 0x%02x", xyz[idx] & 0xff);
- printf("\n");
- }
} else if (status == CAM_SCSI_STATUS_ERROR) {
/* Tell the user about the fatal error. */
scsi_sense_print(&ccb->csio);
@@ -2012,8 +1553,7 @@ sagetparamsexit:
*/
static int
sasetparams(struct cam_periph *periph, sa_params params_to_set,
- u_int32_t blocksize, u_int8_t density, u_int32_t comp_algorithm,
- u_int32_t sense_flags)
+ u_int32_t blocksize, u_int8_t density, u_int32_t comp_algorithm)
{
struct sa_softc *softc;
u_int32_t current_blocksize;
@@ -2083,17 +1623,12 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
scsi_ulto3b(current_blocksize, mode_blk->blklen);
/*
- * Set density if requested, else preserve old density.
- * SCSI_SAME_DENSITY only applies to SCSI-2 or better
- * devices, else density we've latched up in our softc.
+ * 0x7f means "same as before"
*/
- if (params_to_set & SA_PARAM_DENSITY) {
+ if (params_to_set & SA_PARAM_DENSITY)
mode_blk->density = density;
- } else if (softc->scsi_rev > SCSI_REV_CCS) {
- mode_blk->density = SCSI_SAME_DENSITY;
- } else {
- mode_blk->density = softc->media_density;
- }
+ else
+ mode_blk->density = 0x7f;
/*
* For mode selects, these two fields must be zero.
@@ -2157,7 +1692,6 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
*/
params_to_set &= ~SA_PARAM_COMPRESSION;
-
/*
* Should probably do something other than a printf...like
* set a flag in the softc saying that this drive doesn't
@@ -2186,7 +1720,6 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
ccb = cam_periph_getccb(periph, /*priority*/ 1);
-
scsi_mode_select(&ccb->csio,
/*retries*/1,
/*cbfcnp*/ sadone,
@@ -2200,26 +1733,17 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
/*timeout*/ 5000);
error = cam_periph_runccb(ccb, saerror, /*cam_flags*/ 0,
- sense_flags, &softc->device_stats);
-
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO) ||
- params_to_set == SA_PARAM_BUFF_MODE) {
- int idx;
- char *xyz = mode_buffer;
- xpt_print_path(periph->path);
- printf("Err%d, Mode Select Data=", error);
- for (idx = 0; idx < mode_buffer_len; idx++)
- printf(" 0x%02x", xyz[idx] & 0xff);
- printf("\n");
- }
-
+ /*sense_flags*/ 0, &softc->device_stats);
if (error == 0) {
xpt_release_ccb(ccb);
} else {
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
-
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
/*
* If we were setting the blocksize, and that failed, we
* want to set it to its original value. If we weren't
@@ -2228,17 +1752,12 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
scsi_ulto3b(current_blocksize, mode_blk->blklen);
/*
- * Set density if requested, else preserve old density.
- * SCSI_SAME_DENSITY only applies to SCSI-2 or better
- * devices, else density we've latched up in our softc.
+ * 0x7f means "same as before".
*/
- if (params_to_set & SA_PARAM_DENSITY) {
+ if (params_to_set & SA_PARAM_DENSITY)
mode_blk->density = current_density;
- } else if (softc->scsi_rev > SCSI_REV_CCS) {
- mode_blk->density = SCSI_SAME_DENSITY;
- } else {
- mode_blk->density = softc->media_density;
- }
+ else
+ mode_blk->density = 0x7f;
if (params_to_set & SA_PARAM_COMPRESSION)
bcopy(current_comp_page, comp_page,
@@ -2249,28 +1768,22 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set,
* changed that we care about, so reset it back to 1.
*/
ccb->ccb_h.retry_count = 1;
- cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ cam_periph_runccb(ccb, saerror, /*cam_flags*/ 0,
+ /*sense_flags*/ 0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
}
- if (current_comp_page != NULL)
+ if (params_to_set & SA_PARAM_COMPRESSION)
free(current_comp_page, M_TEMP);
- if (params_to_set & SA_PARAM_COMPRESSION) {
- if (error) {
- softc->flags &= ~SA_FLAG_COMP_ENABLED;
- softc->saved_comp_algorithm = softc->comp_algorithm;
- softc->comp_algorithm = 0;
- } else {
- softc->flags |= SA_FLAG_COMP_ENABLED;
- softc->comp_algorithm = comp_algorithm;
- }
- }
-
free(mode_buffer, M_TEMP);
return(error);
}
@@ -2280,33 +1793,37 @@ saprevent(struct cam_periph *periph, int action)
{
struct sa_softc *softc;
union ccb *ccb;
- int error, sf;
+ int error;
softc = (struct sa_softc *)periph->softc;
- if ((action == PR_ALLOW) && (softc->flags & SA_FLAG_TAPE_LOCKED) == 0)
- return;
- if ((action == PR_PREVENT) && (softc->flags & SA_FLAG_TAPE_LOCKED) != 0)
+ if (((action == PR_ALLOW)
+ && (softc->flags & SA_FLAG_TAPE_LOCKED) == 0)
+ || ((action == PR_PREVENT)
+ && (softc->flags & SA_FLAG_TAPE_LOCKED) != 0)) {
return;
+ }
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO))
- sf = 0;
- else
- sf = SF_QUIET_IR;
-
- ccb = cam_periph_getccb(periph, 1);
+ ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_prevent(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, action,
- SSD_FULL_SIZE, 60000);
+ scsi_prevent(&ccb->csio,
+ /*retries*/0,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ action,
+ SSD_FULL_SIZE,
+ 60000);
- /*
- * We can be quiet about illegal requests.
- */
- error = cam_periph_runccb(ccb, saerror, sf, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+
if (error == 0) {
if (action == PR_ALLOW)
@@ -2329,16 +1846,26 @@ sarewind(struct cam_periph *periph)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_rewind(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- SSD_FULL_SIZE, (SA_REWIND_TIMEOUT) * 60 * 1000);
+ scsi_rewind(&ccb->csio,
+ /*retries*/1,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/FALSE,
+ SSD_FULL_SIZE,
+ (SA_REWIND_TIMEOUT) * 60 * 1000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
+
return (error);
}
@@ -2353,21 +1880,26 @@ saspace(struct cam_periph *periph, int count, scsi_space_code code)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* This cannot be retried */
+ scsi_space(&ccb->csio,
+ /*retries*/1,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ code, count,
+ SSD_FULL_SIZE,
+ (SA_SPACE_TIMEOUT) * 60 * 1000);
- scsi_space(&ccb->csio, 0, sadone, MSG_SIMPLE_Q_TAG, code, count,
- SSD_FULL_SIZE, (SA_SPACE_TIMEOUT) * 60 * 1000);
-
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
- /*
- * XXX: If a spacing operation has failed, we need to invalidate
- * XXX: this mount.
- */
+
return (error);
}
@@ -2382,106 +1914,38 @@ sawritefilemarks(struct cam_periph *periph, int nmarks, int setmarks)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* this *must* not be retried */
- scsi_write_filemarks(&ccb->csio, 0, sadone, MSG_SIMPLE_Q_TAG,
- FALSE, setmarks, nmarks, SSD_FULL_SIZE, 60000);
-
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
-
- if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
-
- /*
- * XXXXX: Get back the actual number of filemarks written
- * (there can be a residual).
- */
- if (error == 0 && nmarks) {
- struct sa_softc *softc = (struct sa_softc *)periph->softc;
- softc->filemarks += nmarks;
- }
- xpt_release_ccb(ccb);
- return (error);
-}
-
-static int
-sardpos(struct cam_periph *periph, int hard, u_int32_t *blkptr)
-{
- struct scsi_tape_position_data loc;
- union ccb *ccb;
- struct sa_softc *softc;
- int error;
+ scsi_write_filemarks(&ccb->csio,
+ /*retries*/1,
+ /*cbcfp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/FALSE,
+ setmarks,
+ nmarks,
+ SSD_FULL_SIZE,
+ 60000);
- /*
- * First flush any pending writes...
- */
- error = sawritefilemarks(periph, 0, 0);
-
- /*
- * The latter case is for 'write protected' tapes
- * which are too stupid to recognize a zero count
- * for writing filemarks as a no-op.
- */
- if (error != 0 && error != EACCES)
- return (error);
-
- softc = (struct sa_softc *)periph->softc;
- ccb = cam_periph_getccb(periph, /*priority*/1);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
- scsi_read_position(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG,
- hard, &loc, SSD_FULL_SIZE, 5000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
if (error == 0) {
- if (loc.flags & SA_RPOS_UNCERTAIN) {
- error = EINVAL; /* nothing is certain */
- } else {
- *blkptr = scsi_4btoul(loc.firstblk);
- }
+ struct sa_softc *softc;
+
+ softc = (struct sa_softc *)periph->softc;
+ softc->filemarks += nmarks;
}
xpt_release_ccb(ccb);
- return (error);
-}
-static int
-sasetpos(struct cam_periph *periph, int hard, u_int32_t *blkptr)
-{
- union ccb *ccb;
- struct sa_softc *softc;
- int error;
-
- /*
- * First flush any pending writes...
- */
- error = sawritefilemarks(periph, 0, 0);
-
- /*
- * The latter case is for 'write protected' tapes
- * which are too stupid to recognize a zero count
- * for writing filemarks as a no-op.
- */
- if (error != 0 && error != EACCES)
- return (error);
-
- softc = (struct sa_softc *)periph->softc;
- ccb = cam_periph_getccb(periph, /*priority*/1);
-
- scsi_set_position(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG,
- hard, *blkptr, SSD_FULL_SIZE, 60 * 60 * 1000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
- if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
- xpt_release_ccb(ccb);
- /*
- * XXX: Note relative file && block number position now unknown (if
- * XXX: these things ever start being maintained in this driver).
- */
return (error);
}
-
static int
saretension(struct cam_periph *periph)
{
@@ -2493,15 +1957,29 @@ saretension(struct cam_periph *periph)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_load_unload(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- FALSE, TRUE, TRUE, SSD_FULL_SIZE, (SA_ERASE_TIMEOUT) * 60 * 1000);
+ scsi_load_unload(&ccb->csio,
+ /*retries*/ 1,
+ /*cbfcnp*/ sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/ FALSE,
+ /*eot*/ FALSE,
+ /*reten*/ TRUE,
+ /*load*/ TRUE,
+ SSD_FULL_SIZE,
+ 60000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+
xpt_release_ccb(ccb);
+
return(error);
}
@@ -2510,41 +1988,40 @@ sareservereleaseunit(struct cam_periph *periph, int reserve)
{
union ccb *ccb;
struct sa_softc *softc;
- int error, sflag;
+ int error;
softc = (struct sa_softc *)periph->softc;
+ ccb = cam_periph_getccb(periph, /*priority*/ 1);
+
+ scsi_reserve_release_unit(&ccb->csio,
+ /*retries*/ 1,
+ /*cbfcnp*/ sadone,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*third_party*/ FALSE,
+ /*third_party_id*/ 0,
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ 5000,
+ reserve);
+
/*
* We set SF_RETRY_UA, since this is often the first command run
* when a tape device is opened, and there may be a unit attention
* condition pending.
*/
- if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO))
- sflag = SF_RETRY_UA;
- else
- sflag = SF_RETRY_UA|SF_QUIET_IR;
-
- ccb = cam_periph_getccb(periph, 1);
-
- /* It is safe to retry this operation */
- scsi_reserve_release_unit(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG,
- FALSE, 0, SSD_FULL_SIZE, 5000, reserve);
-
- error = cam_periph_runccb(ccb, saerror, 0, sflag, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/SF_RETRY_UA,
+ &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
xpt_release_ccb(ccb);
- /*
- * If the error was Illegal Request, then the device doesn't support
- * RESERVE/RELEASE. This is not an error.
- */
- if (error == EINVAL) {
- error = 0;
- }
-
return (error);
}
@@ -2559,15 +2036,29 @@ saloadunload(struct cam_periph *periph, int load)
ccb = cam_periph_getccb(periph, /*priority*/1);
- /* It is safe to retry this operation */
- scsi_load_unload(&ccb->csio, 5, sadone, MSG_SIMPLE_Q_TAG, FALSE,
- FALSE, FALSE, load, SSD_FULL_SIZE, 60000);
+ scsi_load_unload(&ccb->csio,
+ /*retries*/1,
+ /*cbfcnp*/sadone,
+ MSG_SIMPLE_Q_TAG,
+ /*immediate*/FALSE,
+ /*eot*/FALSE,
+ /*reten*/FALSE,
+ load,
+ SSD_FULL_SIZE,
+ 60000);
- error = cam_periph_runccb(ccb, saerror, 0, 0, &softc->device_stats);
+ error = cam_periph_runccb(ccb, saerror, /*cam_flags*/0,
+ /*sense_flags*/0, &softc->device_stats);
if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
- cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
+ cam_release_devq(ccb->ccb_h.path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+
xpt_release_ccb(ccb);
+
return (error);
}
@@ -2601,7 +2092,9 @@ saerase(struct cam_periph *periph, int longerase)
/*reduction*/0,
/*timeout*/0,
/*getcount_only*/0);
+
xpt_release_ccb(ccb);
+
return (error);
}
@@ -2850,44 +2343,3 @@ scsi_erase(struct ccb_scsiio *csio, u_int32_t retries,
sizeof(*scsi_cmd),
timeout);
}
-
-/*
- * Read Tape Position command.
- */
-void
-scsi_read_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft,
- struct scsi_tape_position_data *sbp,
- u_int8_t sense_len, u_int32_t timeout)
-{
- struct scsi_tape_read_position *scmd;
-
- cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_IN, tag_action,
- (u_int8_t *)sbp, sizeof (*sbp), sense_len, sizeof(*scmd), timeout);
- scmd = (struct scsi_tape_read_position *)&csio->cdb_io.cdb_bytes;
- bzero(scmd, sizeof(*scmd));
- scmd->opcode = READ_POSITION;
- scmd->byte1 = hardsoft;
-}
-
-/*
- * Set Tape Position command.
- */
-void
-scsi_set_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft, u_int32_t blkno,
- u_int8_t sense_len, u_int32_t timeout)
-{
- struct scsi_tape_locate *scmd;
-
- cam_fill_csio(csio, retries, cbfcnp, CAM_DIR_NONE, tag_action,
- (u_int8_t *)NULL, 0, sense_len, sizeof(*scmd), timeout);
- scmd = (struct scsi_tape_locate *)&csio->cdb_io.cdb_bytes;
- bzero(scmd, sizeof(*scmd));
- scmd->opcode = LOCATE;
- if (hardsoft)
- scmd->byte1 |= SA_SPOS_BT;
- scsi_ulto4b(blkno, scmd->blkaddr);
-}
diff --git a/sys/cam/scsi/scsi_sa.h b/sys/cam/scsi/scsi_sa.h
index e4ea14fc9845f..cc5f14d1f4a89 100644
--- a/sys/cam/scsi/scsi_sa.h
+++ b/sys/cam/scsi/scsi_sa.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_sa.h,v 1.2 1998/12/17 19:04:18 mjacob Exp $
+ * $Id$
*/
#ifndef _SCSI_SCSI_SA_H
@@ -184,43 +184,6 @@ struct scsi_data_compression_page {
u_int8_t reserved[4];
};
-struct scsi_tape_read_position {
- u_int8_t opcode; /* READ_POSITION */
- u_int8_t byte1; /* set LSB to read hardware block pos */
- u_int8_t reserved[8];
-};
-
-struct scsi_tape_position_data { /* Short Form */
- u_int8_t flags;
-#define SA_RPOS_BOP 0x80 /* Beginning of Partition */
-#define SA_RPOS_EOP 0x40 /* End of Partition */
-#define SA_RPOS_BCU 0x20 /* Block Count Unknown (SCSI3) */
-#define SA_RPOS_BYCU 0x10 /* Byte Count Unknown (SCSI3) */
-#define SA_RPOS_BPU 0x04 /* Block Position Unknown */
-#define SA_RPOS_PERR 0x02 /* Position Error (SCSI3) */
-#define SA_RPOS_UNCERTAIN SA_RPOS_BPU
- u_int8_t partition;
- u_int8_t reserved[2];
- u_int8_t firstblk[4];
- u_int8_t lastblk[4];
- u_int8_t reserved2;
- u_int8_t nbufblk[3];
- u_int8_t nbufbyte[4];
-};
-
-struct scsi_tape_locate {
- u_int8_t opcode;
- u_int8_t byte1;
-#define SA_SPOS_IMMED 0x01
-#define SA_SPOS_CP 0x02
-#define SA_SPOS_BT 0x04
- u_int8_t reserved1;
- u_int8_t blkaddr[4];
- u_int8_t reserved2;
- u_int8_t partition;
- u_int8_t control;
-};
-
/*
* Opcodes
*/
@@ -234,24 +197,6 @@ struct scsi_tape_locate {
#define RELEASE_UNIT 0x17
#define ERASE 0x19
#define LOAD_UNLOAD 0x1B
-#define LOCATE 0x2B
-#define READ_POSITION 0x34
-
-/*
- * Tape specific density codes- only enough of them here to recognize
- * some specific older units so we can choose 2FM@EOD or FIXED blocksize
- * quirks.
- */
-#define SCSI_DENSITY_HALFINCH_800 0x01
-#define SCSI_DENSITY_HALFINCH_1600 0x02
-#define SCSI_DENSITY_HALFINCH_6250 0x03
-#define SCSI_DENSITY_HALFINCH_6250C 0xC3 /* HP Compressed 6250 */
-#define SCSI_DENSITY_QIC_11_4TRK 0x04
-#define SCSI_DENSITY_QIC_11_9TRK 0x84 /* Vendor Unique Emulex */
-#define SCSI_DENSITY_QIC_24 0x05
-#define SCSI_DENSITY_HALFINCH_PE 0x06
-#define SCSI_DENSITY_QIC_120 0x0f
-#define SCSI_DENSITY_QIC_150 0x10
__BEGIN_DECLS
void scsi_read_block_limits(struct ccb_scsiio *, u_int32_t,
@@ -304,17 +249,6 @@ void scsi_data_comp_page(struct scsi_data_compression_page *page,
u_int8_t dce, u_int8_t dde, u_int8_t red,
u_int32_t comp_algorithm,
u_int32_t decomp_algorithm);
-
-void scsi_read_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft,
- struct scsi_tape_position_data *sbp,
- u_int8_t sense_len, u_int32_t timeout);
-
-void scsi_set_position(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, int hardsoft, u_int32_t blkno,
- u_int8_t sense_len, u_int32_t timeout);
__END_DECLS
#endif /* _SCSI_SCSI_SA_H */
diff --git a/sys/cam/scsi/scsi_targ_bh.c b/sys/cam/scsi/scsi_targ_bh.c
deleted file mode 100644
index ceddcbe65c60e..0000000000000
--- a/sys/cam/scsi/scsi_targ_bh.c
+++ /dev/null
@@ -1,715 +0,0 @@
-/*
- * Implementation of the Target Mode 'Black Hole device' for CAM.
- *
- * Copyright (c) 1999 Justin T. Gibbs.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions, and the following disclaimer,
- * without modification, immediately at the beginning of the file.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-#include <stddef.h> /* For offsetof */
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/types.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#include <sys/devicestat.h>
-#include <sys/malloc.h>
-#include <sys/uio.h>
-
-#include <cam/cam.h>
-#include <cam/cam_ccb.h>
-#include <cam/cam_extend.h>
-#include <cam/cam_periph.h>
-#include <cam/cam_queue.h>
-#include <cam/cam_xpt_periph.h>
-#include <cam/cam_debug.h>
-
-#include <cam/scsi/scsi_all.h>
-#include <cam/scsi/scsi_message.h>
-
-typedef enum {
- TARGBH_STATE_NORMAL,
- TARGBH_STATE_EXCEPTION,
- TARGBH_STATE_TEARDOWN
-} targbh_state;
-
-typedef enum {
- TARGBH_FLAG_NONE = 0x00,
- TARGBH_FLAG_LUN_ENABLED = 0x01
-} targbh_flags;
-
-typedef enum {
- TARGBH_CCB_WORKQ,
- TARGBH_CCB_WAITING
-} targbh_ccb_types;
-
-#define MAX_ACCEPT 16
-#define MAX_IMMEDIATE 16
-#define MAX_BUF_SIZE 256 /* Max inquiry/sense/mode page transfer */
-
-#define MIN(a, b) ((a > b) ? b : a)
-
-/* Offsets into our private CCB area for storing accept information */
-#define ccb_type ppriv_field0
-#define ccb_descr ppriv_ptr1
-
-/* We stick a pointer to the originating accept TIO in each continue I/O CCB */
-#define ccb_atio ppriv_ptr1
-
-TAILQ_HEAD(ccb_queue, ccb_hdr);
-
-struct targbh_softc {
- struct ccb_queue pending_queue;
- struct ccb_queue work_queue;
- struct ccb_queue unknown_atio_queue;
- struct devstat device_stats;
- targbh_state state;
- targbh_flags flags;
- u_int init_level;
- u_int inq_data_len;
- struct ccb_accept_tio *accept_tio_list;
- struct ccb_hdr_slist immed_notify_slist;
-};
-
-struct targbh_cmd_desc {
- struct ccb_accept_tio* atio_link;
- u_int data_resid; /* How much left to transfer */
- u_int data_increment;/* Amount to send before next disconnect */
- void* data; /* The data. Can be from backing_store or not */
- void* backing_store;/* Backing store allocated for this descriptor*/
- u_int max_size; /* Size of backing_store */
- u_int32_t timeout;
- u_int8_t status; /* Status to return to initiator */
-};
-
-static struct scsi_inquiry_data no_lun_inq_data =
-{
- T_NODEVICE | (SID_QUAL_BAD_LU << 5), 0,
- /* version */2, /* format version */2
-};
-
-static struct scsi_sense_data no_lun_sense_data =
-{
- SSD_CURRENT_ERROR|SSD_ERRCODE_VALID,
- 0,
- SSD_KEY_NOT_READY,
- 0, 0, 0, 0,
- /*extra_len*/offsetof(struct scsi_sense_data, fru)
- - offsetof(struct scsi_sense_data, extra_len),
- 0, 0, 0, 0,
- /* Logical Unit Not Supported */
- /*ASC*/0x25, /*ASCQ*/0
-};
-
-static const int request_sense_size = offsetof(struct scsi_sense_data, fru);
-
-static periph_init_t targbhinit;
-static void targbhasync(void *callback_arg, u_int32_t code,
- struct cam_path *path, void *arg);
-static cam_status targbhenlun(struct cam_periph *periph);
-static cam_status targbhdislun(struct cam_periph *periph);
-static periph_ctor_t targbhctor;
-static periph_dtor_t targbhdtor;
-static periph_start_t targbhstart;
-static void targbhdone(struct cam_periph *periph,
- union ccb *done_ccb);
-static int targbherror(union ccb *ccb, u_int32_t cam_flags,
- u_int32_t sense_flags);
-static struct targbh_cmd_desc* targbhallocdescr(void);
-static void targbhfreedescr(struct targbh_cmd_desc *buf);
-
-static struct periph_driver targbhdriver =
-{
- targbhinit, "targbh",
- TAILQ_HEAD_INITIALIZER(targbhdriver.units), /* generation */ 0
-};
-
-DATA_SET(periphdriver_set, targbhdriver);
-
-static void
-targbhinit(void)
-{
- cam_status status;
- struct cam_path *path;
-
- /*
- * Install a global async callback. This callback will
- * receive async callbacks like "new path registered".
- */
- status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID,
- CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
-
- if (status == CAM_REQ_CMP) {
- struct ccb_setasync csa;
-
- xpt_setup_ccb(&csa.ccb_h, path, /*priority*/5);
- csa.ccb_h.func_code = XPT_SASYNC_CB;
- csa.event_enable = AC_PATH_REGISTERED;
- csa.callback = targbhasync;
- csa.callback_arg = NULL;
- xpt_action((union ccb *)&csa);
- status = csa.ccb_h.status;
- xpt_free_path(path);
- }
-
- if (status != CAM_REQ_CMP) {
- printf("targbh: Failed to attach master async callback "
- "due to status 0x%x!\n", status);
- }
-}
-
-static void
-targbhasync(void *callback_arg, u_int32_t code,
- struct cam_path *path, void *arg)
-{
- struct cam_periph *periph;
-
- periph = (struct cam_periph *)callback_arg;
- switch (code) {
- case AC_PATH_REGISTERED:
- {
- struct ccb_pathinq *cpi;
- struct cam_path *new_path;
- cam_status status;
-
- cpi = (struct ccb_pathinq *)arg;
-
- /* Only attach to controllers that support target mode */
- if ((cpi->target_sprt & PIT_PROCESSOR) == 0)
- break;
-
- /*
- * Allocate a peripheral instance for
- * this target instance.
- */
- status = xpt_create_path(&new_path, NULL,
- xpt_path_path_id(path),
- CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
- if (status != CAM_REQ_CMP) {
- printf("targbhasync: Unable to create path "
- "due to status 0x%x\n", status);
- break;
- }
- status = cam_periph_alloc(targbhctor, NULL, targbhdtor,
- targbhstart,
- "targbh", CAM_PERIPH_BIO,
- new_path, targbhasync,
- AC_PATH_REGISTERED,
- cpi);
- xpt_free_path(new_path);
- if (status != CAM_REQ_CMP
- && status != CAM_REQ_INPROG)
- printf("targbhasync: Unable to allocate new periph "
- "due to status 0x%x\n", status);
- break;
- }
- case AC_PATH_DEREGISTERED:
- {
- targbhdislun(periph);
- break;
- }
- default:
- break;
- }
-}
-
-/* Attempt to enable our lun */
-static cam_status
-targbhenlun(struct cam_periph *periph)
-{
- union ccb immed_ccb;
- struct targbh_softc *softc;
- cam_status status;
- int i;
-
- softc = (struct targbh_softc *)periph->softc;
-
- if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) != 0)
- return (CAM_REQ_CMP);
-
- xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, /*priority*/1);
- immed_ccb.ccb_h.func_code = XPT_EN_LUN;
-
- /* Don't need support for any vendor specific commands */
- immed_ccb.cel.grp6_len = 0;
- immed_ccb.cel.grp7_len = 0;
- immed_ccb.cel.enable = 1;
- xpt_action(&immed_ccb);
- status = immed_ccb.ccb_h.status;
- if (status != CAM_REQ_CMP) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Enable Lun Rejected for status 0x%x\n",
- status);
- return (status);
- }
-
- softc->flags |= TARGBH_FLAG_LUN_ENABLED;
-
- /*
- * Build up a buffer of accept target I/O
- * operations for incoming selections.
- */
- for (i = 0; i < MAX_ACCEPT; i++) {
- struct ccb_accept_tio *atio;
-
- atio = (struct ccb_accept_tio*)malloc(sizeof(*atio), M_DEVBUF,
- M_NOWAIT);
- if (atio == NULL) {
- status = CAM_RESRC_UNAVAIL;
- break;
- }
-
- atio->ccb_h.ccb_descr = targbhallocdescr();
-
- if (atio->ccb_h.ccb_descr == NULL) {
- free(atio, M_DEVBUF);
- status = CAM_RESRC_UNAVAIL;
- break;
- }
-
- xpt_setup_ccb(&atio->ccb_h, periph->path, /*priority*/1);
- atio->ccb_h.func_code = XPT_ACCEPT_TARGET_IO;
- atio->ccb_h.cbfcnp = targbhdone;
- xpt_action((union ccb *)atio);
- status = atio->ccb_h.status;
- if (status != CAM_REQ_INPROG) {
- targbhfreedescr(atio->ccb_h.ccb_descr);
- free(atio, M_DEVBUF);
- break;
- }
- ((struct targbh_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link =
- softc->accept_tio_list;
- softc->accept_tio_list = atio;
- }
-
- if (i == 0) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Could not allocate accept tio CCBs: "
- "status = 0x%x\n", status);
- targbhdislun(periph);
- return (CAM_REQ_CMP_ERR);
- }
-
- /*
- * Build up a buffer of immediate notify CCBs
- * so the SIM can tell us of asynchronous target mode events.
- */
- for (i = 0; i < MAX_ACCEPT; i++) {
- struct ccb_immed_notify *inot;
-
- inot = (struct ccb_immed_notify*)malloc(sizeof(*inot), M_DEVBUF,
- M_NOWAIT);
-
- if (inot == NULL) {
- status = CAM_RESRC_UNAVAIL;
- break;
- }
-
- xpt_setup_ccb(&inot->ccb_h, periph->path, /*priority*/1);
- inot->ccb_h.func_code = XPT_IMMED_NOTIFY;
- inot->ccb_h.cbfcnp = targbhdone;
- xpt_action((union ccb *)inot);
- status = inot->ccb_h.status;
- if (status != CAM_REQ_INPROG) {
- free(inot, M_DEVBUF);
- break;
- }
- SLIST_INSERT_HEAD(&softc->immed_notify_slist, &inot->ccb_h,
- periph_links.sle);
- }
-
- if (i == 0) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Could not allocate immediate notify "
- "CCBs: status = 0x%x\n", status);
- targbhdislun(periph);
- return (CAM_REQ_CMP_ERR);
- }
-
- return (CAM_REQ_CMP);
-}
-
-static cam_status
-targbhdislun(struct cam_periph *periph)
-{
- union ccb ccb;
- struct targbh_softc *softc;
- struct ccb_accept_tio* atio;
- struct ccb_hdr *ccb_h;
-
- softc = (struct targbh_softc *)periph->softc;
- if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) == 0)
- return CAM_REQ_CMP;
-
- /* XXX Block for Continue I/O completion */
-
- /* Kill off all ACCECPT and IMMEDIATE CCBs */
- while ((atio = softc->accept_tio_list) != NULL) {
-
- softc->accept_tio_list =
- ((struct targbh_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link;
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)atio;
- xpt_action(&ccb);
- }
-
- while ((ccb_h = SLIST_FIRST(&softc->immed_notify_slist)) != NULL) {
- SLIST_REMOVE_HEAD(&softc->immed_notify_slist, periph_links.sle);
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)ccb_h;
- xpt_action(&ccb);
- }
-
- /*
- * Dissable this lun.
- */
- xpt_setup_ccb(&ccb.cel.ccb_h, periph->path, /*priority*/1);
- ccb.cel.ccb_h.func_code = XPT_EN_LUN;
- ccb.cel.enable = 0;
- xpt_action(&ccb);
-
- if (ccb.cel.ccb_h.status != CAM_REQ_CMP)
- printf("targbhdislun - Disabling lun on controller failed "
- "with status 0x%x\n", ccb.cel.ccb_h.status);
- else
- softc->flags &= ~TARGBH_FLAG_LUN_ENABLED;
- return (ccb.cel.ccb_h.status);
-}
-
-static cam_status
-targbhctor(struct cam_periph *periph, void *arg)
-{
- struct ccb_pathinq *cpi;
- struct targbh_softc *softc;
-
- cpi = (struct ccb_pathinq *)arg;
-
- /* Allocate our per-instance private storage */
- softc = (struct targbh_softc *)malloc(sizeof(*softc),
- M_DEVBUF, M_NOWAIT);
- if (softc == NULL) {
- printf("targctor: unable to malloc softc\n");
- return (CAM_REQ_CMP_ERR);
- }
-
- bzero(softc, sizeof(softc));
- TAILQ_INIT(&softc->pending_queue);
- TAILQ_INIT(&softc->work_queue);
- softc->accept_tio_list = NULL;
- SLIST_INIT(&softc->immed_notify_slist);
- softc->state = TARGBH_STATE_NORMAL;
- periph->softc = softc;
- softc->init_level++;
-
- return (targbhenlun(periph));
-}
-
-static void
-targbhdtor(struct cam_periph *periph)
-{
- struct targbh_softc *softc;
-
- softc = (struct targbh_softc *)periph->softc;
-
- softc->state = TARGBH_STATE_TEARDOWN;
-
- targbhdislun(periph);
-
- switch (softc->init_level) {
- default:
- /* FALLTHROUGH */
- case 1:
- free(softc, M_DEVBUF);
- break;
- case 0:
- panic("targdtor - impossible init level");;
- }
-}
-
-static void
-targbhstart(struct cam_periph *periph, union ccb *start_ccb)
-{
- struct targbh_softc *softc;
- struct ccb_hdr *ccbh;
- struct ccb_accept_tio *atio;
- struct targbh_cmd_desc *desc;
- struct ccb_scsiio *csio;
- ccb_flags flags;
- int s;
-
- softc = (struct targbh_softc *)periph->softc;
-
- s = splbio();
- ccbh = TAILQ_FIRST(&softc->work_queue);
- if (periph->immediate_priority <= periph->pinfo.priority) {
- start_ccb->ccb_h.ccb_type = TARGBH_CCB_WAITING;
- SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h,
- periph_links.sle);
- periph->immediate_priority = CAM_PRIORITY_NONE;
- splx(s);
- wakeup(&periph->ccb_list);
- } else if (ccbh == NULL) {
- splx(s);
- xpt_release_ccb(start_ccb);
- } else {
- TAILQ_REMOVE(&softc->work_queue, ccbh, periph_links.tqe);
- TAILQ_INSERT_HEAD(&softc->pending_queue, ccbh,
- periph_links.tqe);
- splx(s);
- atio = (struct ccb_accept_tio*)ccbh;
- desc = (struct targbh_cmd_desc *)atio->ccb_h.ccb_descr;
-
- /* Is this a tagged request? */
- flags = atio->ccb_h.flags & (CAM_TAG_ACTION_VALID|CAM_DIR_MASK);
-
- /*
- * If we are done with the transaction, tell the
- * controller to send status and perform a CMD_CMPLT.
- */
- if (desc->data_resid == desc->data_increment)
- flags |= CAM_SEND_STATUS;
-
- csio = &start_ccb->csio;
- cam_fill_ctio(csio,
- /*retries*/2,
- targbhdone,
- flags,
- /*tag_action*/MSG_SIMPLE_Q_TAG,
- atio->tag_id,
- atio->init_id,
- desc->status,
- /*data_ptr*/desc->data_increment == 0
- ? NULL : desc->data,
- /*dxfer_len*/desc->data_increment,
- /*timeout*/desc->timeout);
-
- /* Override our wildcard attachment */
- start_ccb->ccb_h.target_id = atio->ccb_h.target_id;
- start_ccb->ccb_h.target_lun = atio->ccb_h.target_lun;
-
- start_ccb->ccb_h.ccb_type = TARGBH_CCB_WORKQ;
- start_ccb->ccb_h.ccb_atio = atio;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Sending a CTIO\n"));
- xpt_action(start_ccb);
- s = splbio();
- ccbh = TAILQ_FIRST(&softc->work_queue);
- splx(s);
- }
- if (ccbh != NULL)
- xpt_schedule(periph, /*priority*/1);
-}
-
-static void
-targbhdone(struct cam_periph *periph, union ccb *done_ccb)
-{
- struct targbh_softc *softc;
-
- softc = (struct targbh_softc *)periph->softc;
-
- if (done_ccb->ccb_h.ccb_type == TARGBH_CCB_WAITING) {
- /* Caller will release the CCB */
- wakeup(&done_ccb->ccb_h.cbfcnp);
- return;
- }
-
- switch (done_ccb->ccb_h.func_code) {
- case XPT_ACCEPT_TARGET_IO:
- {
- struct ccb_accept_tio *atio;
- struct targbh_cmd_desc *descr;
- u_int8_t *cdb;
-
- atio = &done_ccb->atio;
- descr = (struct targbh_cmd_desc*)atio->ccb_h.ccb_descr;
- cdb = atio->cdb_io.cdb_bytes;
- if (softc->state == TARGBH_STATE_TEARDOWN
- || atio->ccb_h.status == CAM_REQ_ABORTED) {
- targbhfreedescr(descr);
- free(done_ccb, M_DEVBUF);
- return;
- }
-
- /*
- * Determine the type of incoming command and
- * setup our buffer for a response.
- */
- switch (cdb[0]) {
- case INQUIRY:
- {
- struct scsi_inquiry *inq;
-
- inq = (struct scsi_inquiry *)cdb;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Saw an inquiry!\n"));
- /*
- * Validate the command. We don't
- * support any VPD pages, so complain
- * if EVPD is set.
- */
- if ((inq->byte2 & SI_EVPD) != 0
- || inq->page_code != 0) {
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_NONE;
- descr->data_resid = 0;
- descr->data_increment = 0;
- descr->status = SCSI_STATUS_CHECK_COND;
- break;
- }
- /*
- * Direction is always relative
- * to the initator.
- */
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_IN;
- descr->data = &no_lun_inq_data;
- descr->data_resid = MIN(sizeof(no_lun_inq_data),
- inq->length);
- descr->data_increment = descr->data_resid;
- descr->timeout = 5 * 1000;
- descr->status = SCSI_STATUS_OK;
- break;
- }
- case REQUEST_SENSE:
- {
- struct scsi_request_sense *rsense;
-
- rsense = (struct scsi_request_sense *)cdb;
- /* Refer to static sense data */
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_IN;
- descr->data = &no_lun_sense_data;
- descr->data_resid = request_sense_size;
- descr->data_resid = MIN(descr->data_resid,
- rsense->length);
- descr->data_increment = descr->data_resid;
- descr->timeout = 5 * 1000;
- descr->status = SCSI_STATUS_OK;
- break;
- }
- default:
- /* Constant CA, tell initiator */
- /* Direction is always relative to the initator */
- atio->ccb_h.flags &= ~CAM_DIR_MASK;
- atio->ccb_h.flags |= CAM_DIR_NONE;
- descr->data_resid = 0;
- descr->data_increment = 0;
- descr->timeout = 5 * 1000;
- descr->status = SCSI_STATUS_CHECK_COND;
- break;
- }
-
- /* Queue us up to receive a Continue Target I/O ccb. */
- TAILQ_INSERT_TAIL(&softc->work_queue, &atio->ccb_h,
- periph_links.tqe);
- xpt_schedule(periph, /*priority*/1);
- break;
- }
- case XPT_CONT_TARGET_IO:
- {
- struct ccb_accept_tio *atio;
- struct targbh_cmd_desc *desc;
-
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Received completed CTIO\n"));
- atio = (struct ccb_accept_tio*)done_ccb->ccb_h.ccb_atio;
- desc = (struct targbh_cmd_desc *)atio->ccb_h.ccb_descr;
-
- TAILQ_REMOVE(&softc->pending_queue, &atio->ccb_h,
- periph_links.tqe);
-
- /* XXX Check for errors */
- desc->data_resid -= desc->data_increment;
- xpt_release_ccb(done_ccb);
- if (softc->state != TARGBH_STATE_TEARDOWN) {
-
- /*
- * Send the original accept TIO back to the
- * controller to handle more work.
- */
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Returning ATIO to target\n"));
- /* Restore wildcards */
- atio->ccb_h.target_id = CAM_TARGET_WILDCARD;
- atio->ccb_h.target_lun = CAM_LUN_WILDCARD;
- xpt_action((union ccb *)atio);
- break;
- } else {
- targbhfreedescr(desc);
- free(atio, M_DEVBUF);
- }
- break;
- }
- case XPT_IMMED_NOTIFY:
- {
- if (softc->state == TARGBH_STATE_TEARDOWN
- || done_ccb->ccb_h.status == CAM_REQ_ABORTED) {
- printf("Freed an immediate notify\n");
- free(done_ccb, M_DEVBUF);
- }
- break;
- }
- }
-}
-
-static int
-targbherror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
-{
- return 0;
-}
-
-static struct targbh_cmd_desc*
-targbhallocdescr()
-{
- struct targbh_cmd_desc* descr;
-
- /* Allocate the targbh_descr structure */
- descr = (struct targbh_cmd_desc *)malloc(sizeof(*descr),
- M_DEVBUF, M_NOWAIT);
- if (descr == NULL)
- return (NULL);
-
- bzero(descr, sizeof(*descr));
-
- /* Allocate buffer backing store */
- descr->backing_store = malloc(MAX_BUF_SIZE, M_DEVBUF, M_NOWAIT);
- if (descr->backing_store == NULL) {
- free(descr, M_DEVBUF);
- return (NULL);
- }
- descr->max_size = MAX_BUF_SIZE;
- return (descr);
-}
-
-static void
-targbhfreedescr(struct targbh_cmd_desc *descr)
-{
- free(descr->backing_store, M_DEVBUF);
- free(descr, M_DEVBUF);
-}
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index 109582997d30c..4c50f140e1602 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -1,7 +1,7 @@
/*
* Implementation of a simple Target Mode SCSI Proccessor Target driver for CAM.
*
- * Copyright (c) 1998, 1999 Justin T. Gibbs.
+ * Copyright (c) 1998 Justin T. Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_target.c,v 1.6 1998/12/17 00:03:14 gibbs Exp $
+ * $Id: scsi_target.c,v 1.1 1998/09/15 06:36:34 gibbs Exp $
*/
#include <stddef.h> /* For offsetof */
@@ -46,7 +46,6 @@
#include <cam/cam_ccb.h>
#include <cam/cam_extend.h>
#include <cam/cam_periph.h>
-#include <cam/cam_queue.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_debug.h>
@@ -64,8 +63,7 @@ typedef enum {
typedef enum {
TARG_FLAG_NONE = 0x00,
TARG_FLAG_SEND_EOF = 0x01,
- TARG_FLAG_RECEIVE_EOF = 0x02,
- TARG_FLAG_LUN_ENABLED = 0x04
+ TARG_FLAG_RECEIVE_EOF = 0x02
} targ_flags;
typedef enum {
@@ -106,13 +104,11 @@ struct targ_softc {
u_int init_level;
u_int inq_data_len;
struct scsi_inquiry_data *inq_data;
- struct ccb_accept_tio *accept_tio_list;
- struct ccb_hdr_slist immed_notify_slist;
struct initiator_state istate[MAX_INITIATORS];
};
struct targ_cmd_desc {
- struct ccb_accept_tio* atio_link;
+ SLIST_ENTRY(targ_cmd_desc) links;
u_int data_resid; /* How much left to transfer */
u_int data_increment;/* Amount to send before next disconnect */
void* data; /* The data. Can be from backing_store or not */
@@ -159,8 +155,6 @@ static int targsendccb(struct cam_periph *periph, union ccb *ccb,
static periph_init_t targinit;
static void targasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
-static cam_status targenlun(struct cam_periph *periph);
-static cam_status targdislun(struct cam_periph *periph);
static periph_ctor_t targctor;
static periph_dtor_t targdtor;
static void targrunqueue(struct cam_periph *periph,
@@ -267,7 +261,7 @@ targasync(void *callback_arg, u_int32_t code,
"due to status 0x%x\n", status);
break;
}
- status = cam_periph_alloc(targctor, NULL, targdtor, targstart,
+ status = cam_periph_alloc(targctor, targdtor, targstart,
"targ", CAM_PERIPH_BIO,
new_path, targasync,
AC_PATH_REGISTERED,
@@ -293,20 +287,62 @@ targasync(void *callback_arg, u_int32_t code,
}
}
-/* Attempt to enable our lun */
static cam_status
-targenlun(struct cam_periph *periph)
+targctor(struct cam_periph *periph, void *arg)
{
union ccb immed_ccb;
struct targ_softc *softc;
cam_status status;
int i;
- softc = (struct targ_softc *)periph->softc;
+ /* Allocate our per-instance private storage */
+ softc = (struct targ_softc *)malloc(sizeof(*softc), M_DEVBUF, M_NOWAIT);
+ if (softc == NULL) {
+ printf("targctor: unable to malloc softc\n");
+ return (CAM_REQ_CMP_ERR);
+ }
+
+ bzero(softc, sizeof(softc));
+ TAILQ_INIT(&softc->pending_queue);
+ TAILQ_INIT(&softc->work_queue);
+ TAILQ_INIT(&softc->snd_ccb_queue);
+ TAILQ_INIT(&softc->rcv_ccb_queue);
+ TAILQ_INIT(&softc->unknown_atio_queue);
+ bufq_init(&softc->snd_buf_queue);
+ bufq_init(&softc->rcv_buf_queue);
+ softc->state = TARG_STATE_NORMAL;
+ periph->softc = softc;
+ softc->init_level++;
+
+ cam_extend_set(targperiphs, periph->unit_number, periph);
- if ((softc->flags & TARG_FLAG_LUN_ENABLED) != 0)
- return (CAM_REQ_CMP);
+ /*
+ * We start out life with a UA to indicate power-on/reset.
+ */
+ for (i = 0; i < MAX_INITIATORS; i++)
+ softc->istate[i].pending_ua = UA_POWER_ON;
+
+ /*
+ * Allocate an initial inquiry data buffer. We might allow the
+ * user to override this later via an ioctl.
+ */
+ softc->inq_data_len = sizeof(*softc->inq_data);
+ softc->inq_data = malloc(softc->inq_data_len, M_DEVBUF, M_NOWAIT);
+ if (softc->inq_data == NULL) {
+ printf("targctor - Unable to malloc inquiry data\n");
+ targdtor(periph);
+ }
+ bzero(softc->inq_data, softc->inq_data_len);
+ softc->inq_data->device = T_PROCESSOR | (SID_QUAL_LU_CONNECTED << 5);
+ softc->inq_data->version = 2;
+ softc->inq_data->response_format = 2; /* SCSI2 Inquiry Format */
+ softc->inq_data->additional_length = softc->inq_data_len - 4;
+ strncpy(softc->inq_data->vendor, "FreeBSD ", SID_VENDOR_SIZE);
+ strncpy(softc->inq_data->product, "TM-PT ", SID_PRODUCT_SIZE);
+ strncpy(softc->inq_data->revision, "0.0 ", SID_REVISION_SIZE);
+ softc->init_level++;
+ /* Attempt to enable the lun of interrest */
xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, /*priority*/1);
immed_ccb.ccb_h.func_code = XPT_EN_LUN;
@@ -316,15 +352,17 @@ targenlun(struct cam_periph *periph)
immed_ccb.cel.enable = 1;
xpt_action(&immed_ccb);
status = immed_ccb.ccb_h.status;
+
if (status != CAM_REQ_CMP) {
xpt_print_path(periph->path);
- printf("targenlun - Enable Lun Rejected for status 0x%x\n",
+ printf("targctor - Enable Lun Rejected for status 0x%x\n",
status);
+ targdtor(periph);
return (status);
}
-
- softc->flags |= TARG_FLAG_LUN_ENABLED;
+ softc->init_level++;
+
/*
* Build up a buffer of accept target I/O
* operations for incoming selections.
@@ -353,20 +391,16 @@ targenlun(struct cam_periph *periph)
xpt_action((union ccb *)atio);
status = atio->ccb_h.status;
if (status != CAM_REQ_INPROG) {
- freedescr(atio->ccb_h.ccb_descr);
free(atio, M_DEVBUF);
break;
}
- ((struct targ_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link =
- softc->accept_tio_list;
- softc->accept_tio_list = atio;
}
if (i == 0) {
xpt_print_path(periph->path);
- printf("targenlun - Could not allocate accept tio CCBs: "
+ printf("targctor - Could not allocate accept tio CCBs: "
"status = 0x%x\n", status);
- targdislun(periph);
+ targdtor(periph);
return (CAM_REQ_CMP_ERR);
}
@@ -394,129 +428,15 @@ targenlun(struct cam_periph *periph)
free(inot, M_DEVBUF);
break;
}
- SLIST_INSERT_HEAD(&softc->immed_notify_slist, &inot->ccb_h,
- periph_links.sle);
}
if (i == 0) {
xpt_print_path(periph->path);
- printf("targenlun - Could not allocate immediate notify CCBs: "
+ printf("targctor - Could not allocate immediate notify CCBs: "
"status = 0x%x\n", status);
- targdislun(periph);
- return (CAM_REQ_CMP_ERR);
- }
-
- return (CAM_REQ_CMP);
-}
-
-static cam_status
-targdislun(struct cam_periph *periph)
-{
- union ccb ccb;
- struct targ_softc *softc;
- struct ccb_accept_tio* atio;
- struct ccb_hdr *ccb_h;
-
- softc = (struct targ_softc *)periph->softc;
- if ((softc->flags & TARG_FLAG_LUN_ENABLED) == 0)
- return CAM_REQ_CMP;
-
- /* XXX Block for Continue I/O completion */
-
- /* Kill off all ACCECPT and IMMEDIATE CCBs */
- while ((atio = softc->accept_tio_list) != NULL) {
-
- softc->accept_tio_list =
- ((struct targ_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link;
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)atio;
- xpt_action(&ccb);
- }
-
- while ((ccb_h = SLIST_FIRST(&softc->immed_notify_slist)) != NULL) {
- SLIST_REMOVE_HEAD(&softc->immed_notify_slist, periph_links.sle);
- xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
- ccb.cab.ccb_h.func_code = XPT_ABORT;
- ccb.cab.abort_ccb = (union ccb *)ccb_h;
- xpt_action(&ccb);
- }
-
- /*
- * Dissable this lun.
- */
- xpt_setup_ccb(&ccb.cel.ccb_h, periph->path, /*priority*/1);
- ccb.cel.ccb_h.func_code = XPT_EN_LUN;
- ccb.cel.enable = 0;
- xpt_action(&ccb);
-
- if (ccb.cel.ccb_h.status != CAM_REQ_CMP)
- printf("targdislun - Disabling lun on controller failed "
- "with status 0x%x\n", ccb.cel.ccb_h.status);
- else
- softc->flags &= ~TARG_FLAG_LUN_ENABLED;
- return (ccb.cel.ccb_h.status);
-}
-
-static cam_status
-targctor(struct cam_periph *periph, void *arg)
-{
- struct ccb_pathinq *cpi;
- struct targ_softc *softc;
- int i;
-
- cpi = (struct ccb_pathinq *)arg;
-
- /* Allocate our per-instance private storage */
- softc = (struct targ_softc *)malloc(sizeof(*softc), M_DEVBUF, M_NOWAIT);
- if (softc == NULL) {
- printf("targctor: unable to malloc softc\n");
- return (CAM_REQ_CMP_ERR);
- }
-
- bzero(softc, sizeof(softc));
- TAILQ_INIT(&softc->pending_queue);
- TAILQ_INIT(&softc->work_queue);
- TAILQ_INIT(&softc->snd_ccb_queue);
- TAILQ_INIT(&softc->rcv_ccb_queue);
- TAILQ_INIT(&softc->unknown_atio_queue);
- bufq_init(&softc->snd_buf_queue);
- bufq_init(&softc->rcv_buf_queue);
- softc->accept_tio_list = NULL;
- SLIST_INIT(&softc->immed_notify_slist);
- softc->state = TARG_STATE_NORMAL;
- periph->softc = softc;
- softc->init_level++;
-
- cam_extend_set(targperiphs, periph->unit_number, periph);
-
- /*
- * We start out life with a UA to indicate power-on/reset.
- */
- for (i = 0; i < MAX_INITIATORS; i++)
- softc->istate[i].pending_ua = UA_POWER_ON;
-
- /*
- * Allocate an initial inquiry data buffer. We might allow the
- * user to override this later via an ioctl.
- */
- softc->inq_data_len = sizeof(*softc->inq_data);
- softc->inq_data = malloc(softc->inq_data_len, M_DEVBUF, M_NOWAIT);
- if (softc->inq_data == NULL) {
- printf("targctor - Unable to malloc inquiry data\n");
targdtor(periph);
+ return (CAM_REQ_CMP_ERR);
}
- bzero(softc->inq_data, softc->inq_data_len);
- softc->inq_data->device = T_PROCESSOR | (SID_QUAL_LU_CONNECTED << 5);
- softc->inq_data->version = 2;
- softc->inq_data->response_format = 2; /* SCSI2 Inquiry Format */
- softc->inq_data->flags =
- cpi->hba_inquiry & (PI_SDTR_ABLE|PI_WIDE_16|PI_WIDE_32);
- softc->inq_data->additional_length = softc->inq_data_len - 4;
- strncpy(softc->inq_data->vendor, "FreeBSD ", SID_VENDOR_SIZE);
- strncpy(softc->inq_data->product, "TM-PT ", SID_PRODUCT_SIZE);
- strncpy(softc->inq_data->revision, "0.0 ", SID_REVISION_SIZE);
- softc->init_level++;
return (CAM_REQ_CMP);
}
@@ -530,11 +450,25 @@ targdtor(struct cam_periph *periph)
softc->state = TARG_STATE_TEARDOWN;
- targdislun(periph);
-
switch (softc->init_level) {
default:
/* FALLTHROUGH */
+ case 3:
+ {
+ struct ccb_en_lun cel;
+ /*
+ * XXX Spec requires abort of all ACCEPT and
+ * IMMEDIATE CCBS first. Act accordingly.
+ */
+ /*
+ * Dissable this lun.
+ */
+ xpt_setup_ccb(&cel.ccb_h, periph->path, /*priority*/1);
+ cel.ccb_h.func_code = XPT_EN_LUN;
+ cel.enable = 0;
+ xpt_action((union ccb *)&cel);
+ /* FALLTHROUGH */
+ }
case 2:
free(softc->inq_data, M_DEVBUF);
/* FALLTHROUGH */
@@ -550,68 +484,32 @@ static int
targopen(dev_t dev, int flags, int fmt, struct proc *p)
{
struct cam_periph *periph;
- u_int unit;
- cam_status status;
- int error;
- int s;
+ struct targ_softc *softc;
+ u_int unit;
+ int s;
unit = minor(dev);
-
- s = splsoftcam();
periph = cam_extend_get(targperiphs, unit);
- if (periph == NULL) {
+ if (periph == NULL)
return (ENXIO);
- splx(s);
- }
- if ((error = cam_periph_lock(periph, PRIBIO | PCATCH)) != 0) {
- splx(s);
- return (error);
- }
- splx(s);
-
- status = targenlun(periph);
- switch (status) {
- case CAM_REQ_CMP:
- error = 0;
- break;
- case CAM_RESRC_UNAVAIL:
- error = ENOMEM;
- break;
- case CAM_LUN_ALRDY_ENA:
- error = EADDRINUSE;
- break;
- default:
- error = ENXIO;
- break;
- }
- cam_periph_unlock(periph);
- return (error);
+ softc = (struct targ_softc *)periph->softc;
+
+ return (0);
}
static int
targclose(dev_t dev, int flag, int fmt, struct proc *p)
{
- struct cam_periph *periph;
- struct targ_softc *softc;
- u_int unit;
- int s;
- int error;
+ struct cam_periph *periph;
+ struct targ_softc *softc;
+ u_int unit;
+ int s;
unit = minor(dev);
- s = splsoftcam();
periph = cam_extend_get(targperiphs, unit);
- if (periph == NULL) {
- splx(s);
+ if (periph == NULL)
return (ENXIO);
- }
- if ((error = cam_periph_lock(periph, PRIBIO)) != 0)
- return (error);
softc = (struct targ_softc *)periph->softc;
- splx(s);
-
- targdislun(periph);
-
- cam_periph_unlock(periph);
return (0);
}
@@ -623,6 +521,7 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
struct targ_softc *softc;
u_int unit;
int error;
+ int s;
unit = minor(dev);
periph = cam_extend_get(targperiphs, unit);
@@ -700,8 +599,8 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
error = EINVAL;
break;
}
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("GET/SETISTATE for %d\n", ioc_istate->initiator_id));
+ xpt_print_path(periph->path);
+ printf("GET/SETISTATE for %d\n", ioc_istate->initiator_id);
if (cmd == TARGIOCGETISTATE) {
bcopy(&softc->istate[ioc_istate->initiator_id],
&ioc_istate->istate, sizeof(ioc_istate->istate));
@@ -709,9 +608,9 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
bcopy(&ioc_istate->istate,
&softc->istate[ioc_istate->initiator_id],
sizeof(ioc_istate->istate));
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("pending_ca now %x\n",
- softc->istate[ioc_istate->initiator_id].pending_ca));
+ xpt_print_path(periph->path);
+ printf("pending_ca now %x\n",
+ softc->istate[ioc_istate->initiator_id].pending_ca);
}
break;
}
@@ -730,6 +629,7 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
static int
targsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb)
{
+ struct buf *bp[2];
struct targ_softc *softc;
struct cam_periph_map_info mapinfo;
int error, need_unmap;
@@ -946,12 +846,12 @@ targstrategy(struct buf *bp)
*/
bp->b_resid = bp->b_bcount;
if ((bp->b_flags & B_READ) != 0) {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Queued a SEND buffer\n"));
+ xpt_print_path(periph->path);
+ printf("Queued a SEND buffer\n");
bufq_insert_tail(&softc->snd_buf_queue, bp);
} else {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Queued a RECEIVE buffer\n"));
+ xpt_print_path(periph->path);
+ printf("Queued a RECEIVE buffer\n");
bufq_insert_tail(&softc->rcv_buf_queue, bp);
}
@@ -983,6 +883,7 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
struct buf *bp;
struct targ_cmd_desc *desc;
struct ccb_hdr *ccbh;
+ int added;
int s;
s = splbio();
@@ -1004,9 +905,9 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
if (bp == NULL)
softc->flags &= ~TARG_FLAG_SEND_EOF;
else {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("De-Queued a SEND buffer %ld\n",
- bp->b_bcount));
+ xpt_print_path(periph->path);
+ printf("De-Queued a SEND buffer %ld\n",
+ bp->b_bcount);
}
bufq = &softc->snd_buf_queue;
pending_queue = &softc->snd_ccb_queue;
@@ -1017,9 +918,9 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
if (bp == NULL)
softc->flags &= ~TARG_FLAG_RECEIVE_EOF;
else {
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("De-Queued a RECEIVE buffer %ld\n",
- bp->b_bcount));
+ xpt_print_path(periph->path);
+ printf("De-Queued a RECEIVE buffer %ld\n",
+ bp->b_bcount);
}
bufq = &softc->rcv_buf_queue;
pending_queue = &softc->rcv_ccb_queue;
@@ -1044,9 +945,9 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
desc->data_increment =
MIN(desc->data_resid, bp->b_resid);
}
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Buffer command: data %x: datacnt %d\n",
- (intptr_t)desc->data, desc->data_increment));
+ xpt_print_path(periph->path);
+ printf("Buffer command: data %x: datacnt %d\n",
+ (intptr_t)desc->data, desc->data_increment);
TAILQ_INSERT_TAIL(&softc->work_queue, &atio->ccb_h,
periph_links.tqe);
}
@@ -1116,8 +1017,8 @@ targstart(struct cam_periph *periph, union ccb *start_ccb)
start_ccb->ccb_h.ccb_type = TARG_CCB_WORKQ;
start_ccb->ccb_h.ccb_atio = atio;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Sending a CTIO\n"));
+ xpt_print_path(periph->path);
+ printf("Sending a CTIO\n");
xpt_action(start_ccb);
s = splbio();
ccbh = TAILQ_FIRST(&softc->work_queue);
@@ -1152,9 +1053,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
descr = (struct targ_cmd_desc*)atio->ccb_h.ccb_descr;
istate = &softc->istate[atio->init_id];
cdb = atio->cdb_io.cdb_bytes;
- if (softc->state == TARG_STATE_TEARDOWN
- || atio->ccb_h.status == CAM_REQ_ABORTED) {
- printf("Freed an accept tio\n");
+ if (softc->state == TARG_STATE_TEARDOWN) {
freedescr(descr);
free(done_ccb, M_DEVBUF);
return;
@@ -1209,8 +1108,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
inq = (struct scsi_inquiry *)cdb;
sense = &istate->sense_data;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Saw an inquiry!\n"));
+ xpt_print_path(periph->path);
+ printf("Saw an inquiry!\n");
/*
* Validate the command. We don't
* support any VPD pages, so complain
@@ -1285,9 +1184,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
fill_sense(sense, SSD_CURRENT_ERROR,
SSD_KEY_NO_SENSE, 0x00,
0x00);
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("No pending CA!\n"));
+ xpt_print_path(periph->path);
+ printf("No pending CA!\n");
} else if (pending_ca == CA_UNIT_ATTN) {
u_int ascq;
@@ -1298,9 +1196,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
fill_sense(sense, SSD_CURRENT_ERROR,
SSD_KEY_UNIT_ATTENTION,
0x29, ascq);
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("Pending UA!\n"));
+ xpt_print_path(periph->path);
+ printf("Pending UA!\n");
}
/*
* Direction is always relative
@@ -1334,9 +1231,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
atio->ccb_h.flags &= ~CAM_DIR_MASK;
if (cdb[0] == SEND) {
atio->ccb_h.flags |= CAM_DIR_OUT;
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("Saw a SEND!\n"));
+ xpt_print_path(periph->path);
+ printf("Saw a SEND!\n");
atio->ccb_h.flags |= CAM_DIR_OUT;
TAILQ_INSERT_TAIL(&softc->snd_ccb_queue,
&atio->ccb_h,
@@ -1344,9 +1240,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
selwakeup(&softc->snd_select);
} else {
atio->ccb_h.flags |= CAM_DIR_IN;
- CAM_DEBUG(periph->path,
- CAM_DEBUG_SUBTRACE,
- ("Saw a RECEIVE!\n"));
+ xpt_print_path(periph->path);
+ printf("Saw a RECEIVE!\n");
TAILQ_INSERT_TAIL(&softc->rcv_ccb_queue,
&atio->ccb_h,
periph_links.tqe);
@@ -1389,8 +1284,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
struct targ_cmd_desc *desc;
struct buf *bp;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Received completed CTIO\n"));
+ xpt_print_path(done_ccb->ccb_h.path);
+ printf("Received completed CTIO\n");
atio = (struct ccb_accept_tio*)done_ccb->ccb_h.ccb_atio;
desc = (struct targ_cmd_desc *)atio->ccb_h.ccb_descr;
@@ -1404,9 +1299,9 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
bp->b_resid -= desc->data_increment;
bp->b_error = 0;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Buffer I/O Completed - Resid %ld:%d\n",
- bp->b_resid, desc->data_resid));
+ xpt_print_path(done_ccb->ccb_h.path);
+ printf("Buffer I/O Completed - Resid %ld:%d\n",
+ bp->b_resid, desc->data_resid);
/*
* Send the buffer back to the client if
* either the command has completed or all
@@ -1418,8 +1313,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
/* Short transfer */
bp->b_flags |= B_ERROR;
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Completing a buffer\n"));
+ xpt_print_path(done_ccb->ccb_h.path);
+ printf("Completing a buffer\n");
biodone(bp);
desc->bp = NULL;
}
@@ -1433,26 +1328,22 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
* Send the original accept TIO back to the
* controller to handle more work.
*/
- CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE,
- ("Returning ATIO to target\n"));
+ xpt_print_path(atio->ccb_h.path);
+ printf("Returning ATIO to target\n");
xpt_action((union ccb *)atio);
break;
}
+ if (desc->bp != NULL)
+ panic("targ%d: desc->bp should be NULL",
+ periph->unit_number);
+
/* Queue us up for another buffer */
if (atio->cdb_io.cdb_bytes[0] == SEND) {
- if (desc->bp != NULL)
- TAILQ_INSERT_HEAD(
- &softc->snd_buf_queue.queue,
- bp, b_act);
TAILQ_INSERT_HEAD(&softc->snd_ccb_queue,
&atio->ccb_h,
periph_links.tqe);
} else {
- if (desc->bp != NULL)
- TAILQ_INSERT_HEAD(
- &softc->rcv_buf_queue.queue,
- bp, b_act);
TAILQ_INSERT_HEAD(&softc->rcv_ccb_queue,
&atio->ccb_h,
periph_links.tqe);
@@ -1472,9 +1363,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
}
case XPT_IMMED_NOTIFY:
{
- if (softc->state == TARG_STATE_TEARDOWN
- || done_ccb->ccb_h.status == CAM_REQ_ABORTED) {
- printf("Freed an immediate notify\n");
+ if (softc->state == TARG_STATE_TEARDOWN) {
free(done_ccb, M_DEVBUF);
}
break;
@@ -1552,7 +1441,7 @@ allocdescr()
static void
freedescr(struct targ_cmd_desc *descr)
{
- free(descr->backing_store, M_DEVBUF);
+ free(descr->data, M_DEVBUF);
free(descr, M_DEVBUF);
}
diff --git a/sys/coda/00READ b/sys/coda/00READ
index ef554177daf07..29e45b1a008f5 100644
--- a/sys/coda/00READ
+++ b/sys/coda/00READ
@@ -1,3 +1,14 @@
+NOTE: The matching user level code has not been released
+ yet. It will be available soon. The existing released
+ Coda code is not quite ready for current. We'll
+ have some patches out soon.
+
+BUG: There is a bug in file mapping/executing. When a file is
+ first created in Coda, it can not be executed. But after
+ you restart Coda (unmount/mount -- actually vutil -shutdown),
+ you can run the file just fine. I haven't had time to look
+ for this problem yet.
+
WARNING:
A version of this code has run on stable for a while now.
The code has been recently ported to current. It is mostly
diff --git a/sys/coda/cnode.h b/sys/coda/cnode.h
index bf6f632b8b7c2..bd93389c7502a 100644
--- a/sys/coda/cnode.h
+++ b/sys/coda/cnode.h
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/cnode.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: cnode.h,v 1.4 1998/09/13 13:57:59 rvb Exp $
+ * $Id: cnode.h,v 1.3 1998/09/11 18:50:17 rvb Exp $
*
*/
@@ -47,9 +47,6 @@
/*
* HISTORY
* $Log: cnode.h,v $
- * Revision 1.4 1998/09/13 13:57:59 rvb
- * Finish conversion of cfs -> coda
- *
* Revision 1.3 1998/09/11 18:50:17 rvb
* All the references to cfs, in symbols, structs, and strings
* have been changed to coda. (Same for CFS.)
@@ -297,20 +294,19 @@ enum dc_status {
};
/* cfs_psdev.h */
-extern int coda_call(struct coda_mntinfo *mntinfo, int inSize, int *outSize, caddr_t buffer);
-extern int coda_kernel_version;
+int coda_call(struct coda_mntinfo *mntinfo, int inSize, int *outSize, caddr_t buffer);
/* cfs_subr.h */
-extern int handleDownCall(int opcode, union outputArgs *out);
-extern void coda_unmounting(struct mount *whoIam);
-extern int coda_vmflush(struct cnode *cp);
+int handleDownCall(int opcode, union outputArgs *out);
+void coda_unmounting(struct mount *whoIam);
+int coda_vmflush(struct cnode *cp);
/* cfs_vnodeops.h */
-extern struct cnode *make_coda_node(ViceFid *fid, struct mount *vfsp, short type);
-extern int coda_vnodeopstats_init(void);
+struct cnode *make_coda_node(ViceFid *fid, struct mount *vfsp, short type);
+int coda_vnodeopstats_init(void);
/* coda_vfsops.h */
-extern struct mount *devtomp(dev_t dev);
+struct mount *devtomp(dev_t dev);
/* sigh */
#define CODA_RDWR ((u_long) 31)
diff --git a/sys/coda/coda.h b/sys/coda/coda.h
index 7b67ea9245bd7..8e77c20d230f9 100644
--- a/sys/coda/coda.h
+++ b/sys/coda/coda.h
@@ -27,11 +27,10 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda.h,v 1.5 1998/10/28 19:33:49 rvb Exp $
+ * $Id: coda.h,v 1.3 1998/09/11 18:50:17 rvb Exp $
*
*/
-
/*
*
* Based on cfs.h from Mach, but revamped for increased simplicity.
@@ -41,51 +40,17 @@
#ifndef _CODA_HEADER_
#define _CODA_HEADER_
-
-
/* Catch new _KERNEL defn for NetBSD */
#ifdef __NetBSD__
#include <sys/types.h>
#endif
-#ifndef CODA_MAXSYMLINKS
-#define CODA_MAXSYMLINKS 10
-#endif
-
-#if defined(DJGPP) || defined(__CYGWIN32__)
-#ifdef KERNEL
-typedef unsigned long u_long;
-typedef unsigned int u_int;
-typedef unsigned short u_short;
-typedef u_long ino_t;
-typedef u_long dev_t;
-typedef void * caddr_t;
-#ifdef DOS
-typedef unsigned __int64 u_quad_t;
-#else
-typedef unsigned long long u_quad_t;
-#endif
-
-#define inline
-
-struct timespec {
- long ts_sec;
- long ts_nsec;
-};
-#else /* DJGPP but not KERNEL */
-#include <sys/types.h>
-#include <sys/time.h>
-typedef unsigned long long u_quad_t;
-#endif /* !KERNEL */
-#endif /* !DJGPP */
-
-
-#if defined(__linux__)
+#if defined(__linux__) || defined(__CYGWIN32__)
#define cdev_t u_quad_t
#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
#define _UQUAD_T_ 1
typedef unsigned long long u_quad_t;
-#endif
+#endif
#else
#define cdev_t dev_t
#endif
@@ -100,7 +65,7 @@ struct timespec {
/*
- * Cfs constants
+ * Coda constants
*/
#define CODA_MAXNAMLEN 255
#define CODA_MAXPATHLEN 1024
@@ -113,14 +78,12 @@ struct timespec {
#define C_O_WRITE 0x002
#define C_O_TRUNC 0x010
#define C_O_EXCL 0x100
-#define C_O_CREAT 0x200
/* these are to find mode bits in Venus */
#define C_M_READ 00400
#define C_M_WRITE 00200
/* for access Venus will use */
-#define C_A_C_OK 8 /* Test for writing upon create. */
#define C_A_R_OK 4 /* Test for read permission. */
#define C_A_W_OK 2 /* Test for write permission. */
#define C_A_X_OK 1 /* Test for execute permission. */
@@ -145,13 +108,13 @@ struct venus_dirent {
* File types
*/
#define CDT_UNKNOWN 0
-#define CDT_FIFO 1
+#define CDT_FIFO 1
#define CDT_CHR 2
#define CDT_DIR 4
#define CDT_BLK 6
#define CDT_REG 8
#define CDT_LNK 10
-#define CDT_SOCK 12
+#define CDT_SOCK 12
#define CDT_WHT 14
/*
@@ -179,40 +142,32 @@ typedef struct ViceFid {
} ViceFid;
#endif /* VICEFID */
-
-#ifdef __linux__
-static __inline__ ino_t coda_f2i(struct ViceFid *fid)
+#ifdef __linux__
+static inline ino_t coda_f2i(struct ViceFid *fid)
{
- if ( ! fid )
- return 0;
- if (fid->Vnode == 0xfffffffe || fid->Vnode == 0xffffffff)
- return ((fid->Volume << 20) | (fid->Unique & 0xfffff));
- else
- return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20));
+ if ( fid ) {
+ return (fid->Unique + (fid->Vnode << 10) + (fid->Volume << 20));
+ } else {
+ return 0;
+ }
}
-
-#else
-#define coda_f2i(fid)\
- ((fid) ? ((fid)->Unique + ((fid)->Vnode<<10) + ((fid)->Volume<<20)) : 0)
-#endif
-
-
-#ifndef __BIT_TYPES_DEFINED__
-#define u_int32_t unsigned int
#endif
-
#ifndef _VUID_T_
#define _VUID_T_
-typedef u_int32_t vuid_t;
-typedef u_int32_t vgid_t;
+typedef u_long vuid_t;
+typedef u_long vgid_t;
#endif /*_VUID_T_ */
#ifndef _CODACRED_T_
#define _CODACRED_T_
struct coda_cred {
vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
- vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#if defined(__NetBSD__) || defined(__FreeBSD__)
+ vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#else
+ vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#endif
};
#endif
@@ -224,7 +179,7 @@ struct coda_cred {
enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
struct coda_vattr {
- int va_type; /* vnode type (for create) */
+ enum coda_vtype va_type; /* vnode type (for create) */
u_short va_mode; /* files access mode and type */
short va_nlink; /* number of references to file */
vuid_t va_uid; /* owner user id */
@@ -248,38 +203,36 @@ struct coda_vattr {
* Kernel <--> Venus communications.
*/
-#define CODA_ROOT 2
-#define CODA_SYNC 3
-#define CODA_OPEN 4
-#define CODA_CLOSE 5
-#define CODA_IOCTL 6
-#define CODA_GETATTR 7
-#define CODA_SETATTR 8
-#define CODA_ACCESS 9
-#define CODA_LOOKUP 10
-#define CODA_CREATE 11
-#define CODA_REMOVE 12
-#define CODA_LINK 13
-#define CODA_RENAME 14
-#define CODA_MKDIR 15
-#define CODA_RMDIR 16
-#define CODA_READDIR 17
-#define CODA_SYMLINK 18
-#define CODA_READLINK 19
-#define CODA_FSYNC 20
-#define CODA_INACTIVE 21
-#define CODA_VGET 22
-#define CODA_SIGNAL 23
-#define CODA_REPLACE 24
-#define CODA_FLUSH 25
-#define CODA_PURGEUSER 26
-#define CODA_ZAPFILE 27
-#define CODA_ZAPDIR 28
-#define CODA_PURGEFID 30
-#define CODA_OPEN_BY_PATH 31
-#define CODA_RESOLVE 32
-#define CODA_REINTEGRATE 33
-#define CODA_NCALLS 34
+#define CODA_ROOT ((u_long) 2)
+#define CODA_SYNC ((u_long) 3)
+#define CODA_OPEN ((u_long) 4)
+#define CODA_CLOSE ((u_long) 5)
+#define CODA_IOCTL ((u_long) 6)
+#define CODA_GETATTR ((u_long) 7)
+#define CODA_SETATTR ((u_long) 8)
+#define CODA_ACCESS ((u_long) 9)
+#define CODA_LOOKUP ((u_long) 10)
+#define CODA_CREATE ((u_long) 11)
+#define CODA_REMOVE ((u_long) 12)
+#define CODA_LINK ((u_long) 13)
+#define CODA_RENAME ((u_long) 14)
+#define CODA_MKDIR ((u_long) 15)
+#define CODA_RMDIR ((u_long) 16)
+#define CODA_READDIR ((u_long) 17)
+#define CODA_SYMLINK ((u_long) 18)
+#define CODA_READLINK ((u_long) 19)
+#define CODA_FSYNC ((u_long) 20)
+#define CODA_INACTIVE ((u_long) 21)
+#define CODA_VGET ((u_long) 22)
+#define CODA_SIGNAL ((u_long) 23)
+#define CODA_REPLACE ((u_long) 24)
+#define CODA_FLUSH ((u_long) 25)
+#define CODA_PURGEUSER ((u_long) 26)
+#define CODA_ZAPFILE ((u_long) 27)
+#define CODA_ZAPDIR ((u_long) 28)
+#define CODA_ZAPVNODE ((u_long) 29)
+#define CODA_PURGEFID ((u_long) 30)
+#define CODA_NCALLS 31
#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
@@ -287,15 +240,7 @@ struct coda_vattr {
#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
VC_MAXDATASIZE
-#define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int))
-#if 0
- /* don't care about kernel version number */
-#define CODA_KERNEL_VERSION 0
- /* The old venus 4.6 compatible interface */
-#define CODA_KERNEL_VERSION 1
-#endif
- /* venus_lookup gets an extra parameter to aid windows.*/
-#define CODA_KERNEL_VERSION 2
+
/*
* Venus <-> Coda RPC arguments
@@ -405,17 +350,11 @@ struct coda_access_out {
struct coda_out_hdr out;
};
-
-/* lookup flags */
-#define CLU_CASE_SENSITIVE 0x01
-#define CLU_CASE_INSENSITIVE 0x02
-
/* coda_lookup: */
struct coda_lookup_in {
struct coda_in_hdr ih;
ViceFid VFid;
int name; /* Place holder for data. */
- int flags;
};
struct coda_lookup_out {
@@ -641,22 +580,10 @@ struct coda_replace_out { /* coda_replace is a venus->kernel call */
ViceFid OldFid;
};
-/* coda_open_by_path: */
-struct coda_open_by_path_in {
- struct coda_in_hdr ih;
- ViceFid VFid;
- int flags;
-};
-
-struct coda_open_by_path_out {
- struct coda_out_hdr oh;
- int path;
-};
-
/*
- * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
- * For instance, if the fid is inconsistent.
- * This case is handled by setting the top bit of the type result parameter.
+ * Occasionally, don't cache the fid returned by CODA_LOOKUP. For instance, if
+ * the fid is inconsistent. This case is handled by setting the top bit of the
+ * return result parameter.
*/
#define CODA_NOCACHE 0x80000000
@@ -682,7 +609,6 @@ union inputArgs {
struct coda_inactive_in coda_inactive;
struct coda_vget_in coda_vget;
struct coda_rdwr_in coda_rdwr;
- struct coda_open_by_path_in coda_open_by_path;
};
union outputArgs {
@@ -704,7 +630,6 @@ union outputArgs {
struct coda_purgefid_out coda_purgefid;
struct coda_rdwr_out coda_rdwr;
struct coda_replace_out coda_replace;
- struct coda_open_by_path_out coda_open_by_path;
};
union coda_downcalls {
@@ -730,20 +655,11 @@ struct ViceIoctl {
short out_size; /* Maximum size of output buffer, <= 2K */
};
-#if defined(__CYGWIN32__) || defined(DJGPP)
struct PioctlData {
- unsigned long cmd;
const char *path;
int follow;
struct ViceIoctl vi;
};
-#else
-struct PioctlData {
- const char *path;
- int follow;
- struct ViceIoctl vi;
-};
-#endif
#define CODA_CONTROL ".CONTROL"
#define CODA_CONTROLLEN 8
diff --git a/sys/coda/coda_fbsd.c b/sys/coda/coda_fbsd.c
index 66bfe07f6299d..8d407ae5e6968 100644
--- a/sys/coda/coda_fbsd.c
+++ b/sys/coda/coda_fbsd.c
@@ -27,12 +27,16 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_fbsd.cr,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_fbsd.c,v 1.10 1999/01/05 18:49:49 eivind Exp $
+ * $Id: coda_fbsd.c,v 1.6 1998/09/28 20:52:57 rvb Exp $
*
*/
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include "vcoda.h"
#include "opt_devfs.h"
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -80,58 +84,59 @@ static struct cdevsw codadevsw =
vc_nb_poll, nommap, NULL, "Coda", NULL, -1
};
+void vcattach __P((void));
+static dev_t codadev;
+
int vcdebug = 1;
#define VCDEBUG if (vcdebug) printf
-static int
-codadev_modevent(module_t mod, int type, void *data)
+void
+vcattach(void)
+{
+ /*
+ * In case we are an LKM, set up device switch.
+ */
+ if (0 == (codadev = makedev(VC_DEV_NO, 0)))
+ VCDEBUG("makedev returned null\n");
+ else
+ VCDEBUG("makedev OK.\n");
+
+ cdevsw_add(&codadev, &codadevsw, NULL);
+ VCDEBUG("coda: codadevsw entry installed at %d.\n", major(codadev));
+}
+
+static vc_devsw_installed = 0;
+static void vc_drvinit __P((void *unused));
+
+static void
+vc_drvinit(void *unused)
{
dev_t dev;
#ifdef DEVFS
int i;
#endif
- static struct cdevsw *oldcdevsw;
- switch (type) {
- case MOD_LOAD:
+ if( ! vc_devsw_installed ) {
dev = makedev(VC_DEV_NO, 0);
- cdevsw_add(&dev,&codadevsw, &oldcdevsw);
+ cdevsw_add(&dev,&codadevsw, NULL);
+ vc_devsw_installed = 1;
+ }
#ifdef DEVFS
- /* tmp */
+ /* tmp */
#undef NVCODA
#define NVCODA 1
- for (i = 0; i < NVCODA; i++) {
- cfs_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "cfs%d", i);
- coda_devfs_token[i] =
- devfs_add_devswf(&codadevsw, i,
- DV_CHR, UID_ROOT, GID_WHEEL, 0666,
- "coda%d", i);
- }
-#endif
- break;
- case MOD_UNLOAD:
-#ifdef DEVFS
- for (i = 0; i < NVCODA; i++) {
- devfs_remove_dev(cfs_devfs_token[i]);
- devfs_remove_dev(coda_devfs_token[i]);
- }
-#endif
- cdevsw_add(&dev, oldcdevsw, NULL);
- break;
- default:
- break;
+ for (i = 0; i < NVCODA; i++) {
+ cfs_devfs_token[i] =
+ devfs_add_devswf(&codadevsw, i,
+ DV_CHR, UID_ROOT, GID_WHEEL, 0666,
+ "cfs%d", i);
+ coda_devfs_token[i] =
+ devfs_add_devswf(&codadevsw, i,
+ DV_CHR, UID_ROOT, GID_WHEEL, 0666,
+ "coda%d", i);
}
- return 0;
+#endif
}
-static moduledata_t codadev_mod = {
- "codadev",
- codadev_modevent,
- NULL
-};
-DECLARE_MODULE(codadev, codadev_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+VC_DEV_NO);
int
coda_fbsd_getpages(v)
@@ -172,7 +177,7 @@ printf("coda_getp: Internally Opening %p\n", vp);
return (error);
}
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_getpage: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -214,3 +219,57 @@ coda_fbsd_putpages(v)
return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count,
ap->a_sync, ap->a_rtvals);
}
+
+
+SYSINIT(codadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+VC_DEV_NO,vc_drvinit,NULL)
+
+#ifdef VFS_LKM
+
+#include <sys/mount.h>
+#include <sys/lkm.h>
+
+extern struct vfsops coda_vfsops;
+
+static struct vfsconf _fs_vfsconf = { &coda_vfsops, "coda", -1, 0, 0 };
+
+extern struct linker_set coda_modvnops ;
+
+static struct lkm_vfs coda_mod_vfs = {
+ LM_VFS, LKM_VERSION, "coda", 0, &coda_modvnops, &_fs_vfsconf };
+
+static struct lkm_dev coda_mod_dev = {
+ LM_DEV, LKM_VERSION, "codadev", VC_DEV_NO, LM_DT_CHAR, (void *) &codadevsw};
+
+int coda_mod(struct lkm_table *, int, int);
+int
+coda_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ int error = 0;
+
+ if (ver != LKM_VERSION)
+ return EINVAL;
+
+ switch (cmd) {
+ case LKM_E_LOAD:
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_dev;
+ error = lkmdispatch(lkmtp, cmd);
+ if (error)
+ break;
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_vfs ;
+ error = lkmdispatch(lkmtp, cmd);
+ break;
+ case LKM_E_UNLOAD:
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_vfs ;
+ error = lkmdispatch(lkmtp, cmd);
+ if (error)
+ break;
+ lkmtp->private.lkm_any = (struct lkm_any *) &coda_mod_dev;
+ error = lkmdispatch(lkmtp, cmd);
+ break;
+ case LKM_E_STAT:
+ error = lkmdispatch(lkmtp, cmd);
+ break;
+ }
+ return error;
+}
+#endif
diff --git a/sys/coda/coda_namecache.c b/sys/coda/coda_namecache.c
index 2da7b096896de..d66f1151a63d9 100644
--- a/sys/coda/coda_namecache.c
+++ b/sys/coda/coda_namecache.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_namecache.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_namecache.c,v 1.7 1998/09/28 20:52:58 rvb Exp $
+ * $Id: coda_namecache.c,v 1.6 1998/09/25 17:38:31 rvb Exp $
*
*/
@@ -47,9 +47,6 @@
/*
* HISTORY
* $Log: coda_namecache.c,v $
- * Revision 1.7 1998/09/28 20:52:58 rvb
- * Cleanup and fix THE bug
- *
* Revision 1.6 1998/09/25 17:38:31 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -705,7 +702,7 @@ coda_nc_purge_user(uid, dcstat)
return;
CODA_NC_DEBUG(CODA_NC_PURGEUSER,
- myprintf(("ZapDude: uid %x\n", uid)); )
+ myprintf(("ZapDude: uid %lx\n", uid)); )
coda_nc_stat.zapUsers++;
for (cncp = CODA_NC_LRUGET(coda_nc_lru);
diff --git a/sys/coda/coda_psdev.c b/sys/coda/coda_psdev.c
index 0d29f6e1d7371..3abbff04878af 100644
--- a/sys/coda/coda_psdev.c
+++ b/sys/coda/coda_psdev.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_psdev.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_psdev.c,v 1.9 1998/11/11 20:32:20 rvb Exp $
+ * $Id: coda_psdev.c,v 1.6 1998/09/28 20:52:58 rvb Exp $
*
*/
@@ -53,25 +53,6 @@
/*
* HISTORY
* $Log: coda_psdev.c,v $
- * Revision 1.9 1998/11/11 20:32:20 rvb
- * coda_lookup now passes up an extra flag. But old veni will
- * be ok; new veni will check /dev/cfs0 to make sure that a new
- * kernel is running.
- * Also, a bug in vc_nb_close iff CODA_SIGNAL's were seen has been
- * fixed.
- *
- * Revision 1.8 1998/10/28 20:31:13 rvb
- * Change the way unmounting happens to guarantee that the
- * client programs are allowed to finish up (coda_call is
- * forced to complete) and release their locks. Thus there
- * is a reasonable chance that the vflush implicit in the
- * unmount will not get hung on held locks.
- *
- * Revision 1.7 1998/09/29 20:19:45 rvb
- * Fixes for lkm:
- * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL
- * 2. don't pass -DCODA to lkm build
- *
* Revision 1.6 1998/09/28 20:52:58 rvb
* Cleanup and fix THE bug
*
@@ -188,7 +169,11 @@
extern int coda_nc_initialized; /* Set if cache has been initialized */
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include <vcoda.h>
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -210,13 +195,6 @@ extern int coda_nc_initialized; /* Set if cache has been initialized */
#define CTL_C
int coda_psdev_print_entry = 0;
-static
-int outstanding_upcalls = 0;
-int coda_call_sleep = PZERO - 1;
-#ifdef CTL_C
-int coda_pcatch = PCATCH;
-#else
-#endif
#define ENTRY if(coda_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
@@ -284,7 +262,7 @@ vc_nb_close (dev, flag, mode, p)
struct proc *p;
{
register struct vcomm *vcp;
- register struct vmsg *vmp, *nvmp = NULL;
+ register struct vmsg *vmp;
struct coda_mntinfo *mi;
int err;
@@ -305,23 +283,21 @@ vc_nb_close (dev, flag, mode, p)
* Put this before WAKEUPs to avoid queuing new messages between
* the WAKEUP and the unmount (which can happen if we're unlucky)
*/
- if (!mi->mi_rootvp) {
- /* just a simple open/close w no mount */
- MARK_VC_CLOSED(vcp);
- return 0;
+ if (mi->mi_rootvp) {
+ /* Let unmount know this is for real */
+ VTOC(mi->mi_rootvp)->c_flags |= C_UNMOUNTING;
+ coda_unmounting(mi->mi_vfsp);
+ err = dounmount(mi->mi_vfsp, flag, p);
+ if (err)
+ myprintf(("Error %d unmounting vfs in vcclose(%d)\n",
+ err, minor(dev)));
}
-
- /* Let unmount know this is for real */
- VTOC(mi->mi_rootvp)->c_flags |= C_UNMOUNTING;
- coda_unmounting(mi->mi_vfsp);
-
- outstanding_upcalls = 0;
+
/* Wakeup clients so they can return. */
for (vmp = (struct vmsg *)GETNEXT(vcp->vc_requests);
!EOQ(vmp, vcp->vc_requests);
- vmp = nvmp)
- {
- nvmp = (struct vmsg *)GETNEXT(vmp->vm_chain);
+ vmp = (struct vmsg *)GETNEXT(vmp->vm_chain))
+ {
/* Free signal request messages and don't wakeup cause
no one is waiting. */
if (vmp->vm_opcode == CODA_SIGNAL) {
@@ -329,34 +305,18 @@ vc_nb_close (dev, flag, mode, p)
CODA_FREE((caddr_t)vmp, (u_int)sizeof(struct vmsg));
continue;
}
- outstanding_upcalls++;
+
wakeup(&vmp->vm_sleep);
}
-
+
for (vmp = (struct vmsg *)GETNEXT(vcp->vc_replys);
!EOQ(vmp, vcp->vc_replys);
vmp = (struct vmsg *)GETNEXT(vmp->vm_chain))
{
- outstanding_upcalls++;
wakeup(&vmp->vm_sleep);
}
-
+
MARK_VC_CLOSED(vcp);
-
- if (outstanding_upcalls) {
-#ifdef CODA_VERBOSE
- printf("presleep: outstanding_upcalls = %d\n", outstanding_upcalls);
- (void) tsleep(&outstanding_upcalls, coda_call_sleep, "coda_umount", 0);
- printf("postsleep: outstanding_upcalls = %d\n", outstanding_upcalls);
-#else
- (void) tsleep(&outstanding_upcalls, coda_call_sleep, "coda_umount", 0);
-#endif
- }
-
- err = dounmount(mi->mi_vfsp, flag, p);
- if (err)
- myprintf(("Error %d unmounting vfs in vcclose(%d)\n",
- err, minor(dev)));
return 0;
}
@@ -546,22 +506,6 @@ vc_nb_ioctl(dev, cmd, addr, flag, p)
return(ENODEV);
}
break;
- case CIOC_KERNEL_VERSION:
- switch (*(u_int *)addr) {
- case 0:
- *(u_int *)addr = coda_kernel_version;
- return 0;
- break;
- case 1:
- case 2:
- if (coda_kernel_version != *(u_int *)addr)
- return ENOENT;
- else
- return 0;
- default:
- return ENOENT;
- }
- break;
default :
return(EINVAL);
break;
@@ -610,6 +554,12 @@ struct coda_clstat coda_clstat;
* (e.g. kill -9).
*/
+int coda_call_sleep = PZERO - 1;
+#ifdef CTL_C
+int coda_pcatch = PCATCH;
+#else
+#endif
+
int
coda_call(mntinfo, inSize, outSize, buffer)
struct coda_mntinfo *mntinfo; int inSize; int *outSize; caddr_t buffer;
@@ -687,11 +637,6 @@ coda_call(mntinfo, inSize, outSize, buffer)
#ifdef CODA_VERBOSE
printf("coda_call: tsleep returns %d SIGIO, cnt %d\n", error, i);
#endif
- } else if (p->p_siglist == sigmask(SIGALRM)) {
- p->p_sigmask |= p->p_siglist;
-#ifdef CODA_VERBOSE
- printf("coda_call: tsleep returns %d SIGALRM, cnt %d\n", error, i);
-#endif
} else {
printf("coda_call: tsleep returns %d, cnt %d\n", error, i);
printf("coda_call: siglist = %x, sigmask = %x, mask %x\n",
@@ -705,7 +650,7 @@ coda_call(mntinfo, inSize, outSize, buffer)
p->p_siglist & ~p->p_sigmask);
#endif
}
- } while (error && i++ < 128 && VC_OPEN(vcp));
+ } while (error && i++ < 128);
p->p_sigmask = psig_omask;
#else
(void) tsleep(&vmp->vm_sleep, coda_call_sleep, "coda_call", 0);
@@ -779,9 +724,6 @@ coda_call(mntinfo, inSize, outSize, buffer)
CODA_FREE(vmp, sizeof(struct vmsg));
- if (outstanding_upcalls > 0 && (--outstanding_upcalls == 0))
- wakeup(&outstanding_upcalls);
-
if (!error)
error = ((struct coda_out_hdr *)buffer)->result;
return(error);
diff --git a/sys/coda/coda_subr.c b/sys/coda/coda_subr.c
index 40d2d0b0b1a46..d24b5d602e2e9 100644
--- a/sys/coda/coda_subr.c
+++ b/sys/coda/coda_subr.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_subr.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_subr.c,v 1.8 1998/10/28 19:33:50 rvb Exp $
+ * $Id: coda_subr.c,v 1.6 1998/09/25 17:38:31 rvb Exp $
*
*/
@@ -46,17 +46,6 @@
/*
* HISTORY
* $Log: coda_subr.c,v $
- * Revision 1.8 1998/10/28 19:33:50 rvb
- * Venus must be passed O_CREAT flag on VOP_OPEN iff this is
- * a creat so that we can will allow a mode 444 file to be
- * written into. Sync with the latest coda.h and deal with
- * collateral damage.
- *
- * Revision 1.7 1998/09/29 20:19:45 rvb
- * Fixes for lkm:
- * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL
- * 2. don't pass -DCODA to lkm build
- *
* Revision 1.6 1998/09/25 17:38:31 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -229,7 +218,11 @@
* 4. coda_cacheprint (under DEBUG) prints names with vnode/cnode address
*/
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include <vcoda.h>
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -632,6 +625,22 @@ int handleDownCall(opcode, out)
return(0);
}
+ case CODA_ZAPVNODE : {
+ coda_clstat.ncalls++;
+ coda_clstat.reqs[CODA_ZAPVNODE]++;
+
+ myprintf(("CODA_ZAPVNODE: Called, but uniplemented\n"));
+ /*
+ * Not that below we must really translate the returned coda_cred to
+ * a netbsd cred. This is a bit muddled at present and the cfsnc_zapnode
+ * is further unimplemented, so punt!
+ * I suppose we could use just the uid.
+ */
+ /* coda_nc_zapvnode(&out->coda_zapvnode.VFid, &out->coda_zapvnode.cred,
+ IS_DOWNCALL); */
+ return(0);
+ }
+
case CODA_PURGEFID : {
struct cnode *cp;
diff --git a/sys/coda/coda_venus.c b/sys/coda/coda_venus.c
index 96228f1737aad..25dceeb1af761 100644
--- a/sys/coda/coda_venus.c
+++ b/sys/coda/coda_venus.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/cfs/coda_venus.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_venus.c,v 1.5 1998/10/28 19:33:50 rvb Exp $
+ * $Id: coda_venus.c,v 1.3 1998/09/11 18:50:17 rvb Exp $
*
*/
@@ -112,7 +112,6 @@
if (from & FWRITE) to |= C_O_WRITE; \
if (from & O_TRUNC) to |= C_O_TRUNC; \
if (from & O_EXCL) to |= C_O_EXCL; \
- if (from & O_CREAT) to |= C_O_CREAT; \
} while (0)
#define CNV_VV2V_ATTR(top, fromp) \
@@ -159,8 +158,6 @@
} while (0)
-int coda_kernel_version = CODA_KERNEL_VERSION;
-
int
venus_root(void *mdp,
struct ucred *cred, struct proc *p,
@@ -410,17 +407,7 @@ venus_lookup(void *mdp, ViceFid *fid,
INIT_IN(&inp->ih, CODA_LOOKUP, cred, p);
inp->VFid = *fid;
- /* NOTE:
- * Between version 1 and version 2 we have added an extra flag field
- * to this structure. But because the string was at the end and because
- * of the wierd way we represent strings by having the slot point to
- * where the string characters are in the "heap", we can just slip the
- * flag parameter in after the string slot pointer and veni that don't
- * know better won't see this new flag field ...
- * Otherwise we'd need two different venus_lookup functions.
- */
inp->name = Isize;
- inp->flags = CLU_CASE_SENSITIVE; /* doesn't really matter for BSD */
STRCPY(name, nm, len); /* increments Isize */
error = coda_call(mdp, Isize, &Osize, (char *)inp);
diff --git a/sys/coda/coda_vfsops.c b/sys/coda/coda_vfsops.c
index 8f6befec3e938..835af3763e2fb 100644
--- a/sys/coda/coda_vfsops.c
+++ b/sys/coda/coda_vfsops.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_vfsops.c,v 1.10 1998/12/04 22:54:43 archie Exp $
+ * $Id: coda_vfsops.c,v 1.6 1998/09/25 17:38:32 rvb Exp $
*
*/
@@ -47,37 +47,6 @@
/*
* HISTORY
* $Log: coda_vfsops.c,v $
- * Revision 1.10 1998/12/04 22:54:43 archie
- * Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
- * for possible buffer overflow problems. Replaced most sprintf()'s
- * with snprintf(); for others cases, added terminating NUL bytes where
- * appropriate, replaced constants like "16" with sizeof(), etc.
- *
- * These changes include several bug fixes, but most changes are for
- * maintainability's sake. Any instance where it wasn't "immediately
- * obvious" that a buffer overflow could not occur was made safer.
- *
- * Reviewed by: Bruce Evans <bde@zeta.org.au>
- * Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>
- * Reviewed by: Mike Spengler <mks@networkcs.com>
- *
- * Revision 1.9 1998/11/16 19:48:26 rvb
- * A few bug fixes for Robert Watson
- *
- * Revision 1.8 1998/11/03 08:55:06 peter
- * Support KLD. We register and unregister two modules. "coda" (the vfs)
- * via VFS_SET(), and "codadev" for the cdevsw entry. From kldstat -v:
- * 3 1 0xf02c5000 115d8 coda.ko
- * Contains modules:
- * Id Name
- * 2 codadev
- * 3 coda
- *
- * Revision 1.7 1998/09/29 20:19:45 rvb
- * Fixes for lkm:
- * 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL
- * 2. don't pass -DCODA to lkm build
- *
* Revision 1.6 1998/09/25 17:38:32 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -221,7 +190,11 @@
*
*/
+#ifdef VFS_LKM
+#define NVCODA 4
+#else
#include <vcoda.h>
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -449,7 +422,6 @@ coda_unmount(vfsp, mntflags, p)
vrele(mi->mi_rootvp);
active = coda_kill(vfsp, NOT_DOWNCALL);
- mi->mi_rootvp->v_flag &= ~VROOT;
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
printf("coda_unmount: active = %d, vflush active %d\n", active, error);
error = 0;
@@ -529,7 +501,7 @@ coda_root(vfsp, vpp)
MARK_INT_SAT(CODA_ROOT_STATS);
goto exit;
- } else if (error == ENODEV || error == EINTR) {
+ } else if (error == ENODEV) {
/* Gross hack here! */
/*
* If Venus fails to respond to the CODA_ROOT call, coda_call returns
@@ -605,8 +577,8 @@ coda_nb_statfs(vfsp, sbp, p)
sbp->f_files = NB_SFS_SIZ;
sbp->f_ffree = NB_SFS_SIZ;
bcopy((caddr_t)&(vfsp->mnt_stat.f_fsid), (caddr_t)&(sbp->f_fsid), sizeof (fsid_t));
- snprintf(sbp->f_mntonname, sizeof(sbp->f_mntonname), "/coda");
- snprintf(sbp->f_mntfromname, sizeof(sbp->f_mntfromname), "CODA");
+ strcpy(sbp->f_mntonname, "/coda");
+ strcpy(sbp->f_mntfromname, "CODA");
/* MARK_INT_SAT(CODA_STATFS_STATS); */
return(0);
}
@@ -767,4 +739,11 @@ struct vfsops coda_vfsops = {
coda_init,
};
+#ifdef VFS_LKM
+/*
+ * This case is being handled in coda_fbsd.c
+ * What we want is too hairy for VFS_SET to get right!
+ */
+#else
VFS_SET(coda_vfsops, coda, VFCF_NETWORK);
+#endif
diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c
index c0cfa5e00f921..420ef3c515b86 100644
--- a/sys/coda/coda_vnops.c
+++ b/sys/coda/coda_vnops.c
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $Id: coda_vnops.c,v 1.12 1999/01/07 16:14:12 bde Exp $
+ * $Id: coda_vnops.c,v 1.5 1998/09/25 17:38:32 rvb Exp $
*
*/
@@ -48,34 +48,6 @@
/*
* HISTORY
* $Log: coda_vnops.c,v $
- * Revision 1.12 1999/01/07 16:14:12 bde
- * Don't pass unused unused timestamp args to UFS_UPDATE() or waste
- * time initializing them. This almost finishes centralizing (in-core)
- * timestamp updates in ufs_itimes().
- *
- * Revision 1.11 1999/01/05 18:49:51 eivind
- * Remove the 'waslocked' parameter to vfs_object_create().
- *
- * Revision 1.10 1998/12/04 18:44:21 rvb
- * Don't print diagnostic anymore
- *
- * Revision 1.9 1998/11/16 19:48:26 rvb
- * A few bug fixes for Robert Watson
- *
- * Revision 1.8 1998/10/28 20:31:13 rvb
- * Change the way unmounting happens to guarantee that the
- * client programs are allowed to finish up (coda_call is
- * forced to complete) and release their locks. Thus there
- * is a reasonable chance that the vflush implicit in the
- * unmount will not get hung on held locks.
- *
- * Revision 1.7 1998/10/25 17:44:41 phk
- * Nitpicking and dusting performed on a train. Removes trivial warnings
- * about unused variables, labels and other lint.
- *
- * Revision 1.6 1998/09/28 20:52:58 rvb
- * Cleanup and fix THE bug
- *
* Revision 1.5 1998/09/25 17:38:32 rvb
* Put "stray" printouts under DIAGNOSTIC. Make everything build
* with DEBUG on. Add support for lkm. (The macro's don't work
@@ -370,7 +342,7 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = {
#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd)
#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)
#define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee)
-#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb)
+#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd)
missing
{ &vop_reallocblks_desc, (vop_t *) ufs_missingop },
@@ -390,12 +362,10 @@ int
coda_vop_error(void *anon) {
struct vnodeop_desc **desc = (struct vnodeop_desc **)anon;
- myprintf(("coda_vop_error: Vnode operation %s called, but not defined.\n",
+ myprintf(("Vnode operation %s called, but not defined\n",
(*desc)->vdesc_name));
- /*
panic("coda_vop_error");
- */
- return EIO;
+ return 0;
}
/* A generic do-nothing. For lease_check, advlock */
@@ -513,7 +483,7 @@ coda_open(v)
}
/* grab (above) does this when it calls newvnode unless it's in the cache*/
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_open: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -554,12 +524,7 @@ coda_close(v)
printf("coda_close: destroying container ref %d, ufs vp %p of vp %p/cp %p\n",
vp->v_usecount, cp->c_ovp, vp, cp);
#endif
-#ifdef hmm
vgone(cp->c_ovp);
-#else
- VOP_CLOSE(cp->c_ovp, flag, cred, p); /* Do errors matter here? */
- vrele(cp->c_ovp);
-#endif
} else {
#ifdef CODA_VERBOSE
printf("coda_close: NO container vp %p/cp %p\n", vp, cp);
@@ -673,7 +638,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp);
return (error);
}
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_rdwr: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -1547,6 +1512,8 @@ coda_link(v)
CODADEBUG(CODA_LINK, myprintf(("in link result %d\n",error)); )
+exit:
+
/* Drop the name buffer if we don't need to SAVESTART */
if ((cnp->cn_flags & SAVESTART) == 0) {
zfree(namei_zone, cnp->cn_pnbuf);
@@ -1896,7 +1863,7 @@ printf("coda_readdir: Internally Opening %p\n", vp);
return (error);
}
if (vp->v_type == VREG) {
- error = vfs_object_create(vp, p, cred);
+ error = vfs_object_create(vp, p, cred, 1);
if (error != 0) {
printf("coda_readdir: vfs_object_create() returns %d\n", error);
vput(vp);
@@ -1956,9 +1923,7 @@ coda_bmap(v)
#endif
return ret;
} else {
-#if 0
printf("coda_bmap: no container\n");
-#endif
return(EOPNOTSUPP);
}
}
@@ -2042,12 +2007,7 @@ coda_lock(v)
cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
}
-#ifndef DEBUG_LOCKS
return (lockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, p));
-#else
- return (debuglockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, p,
- "coda_lock", vp->filename, vp->line));
-#endif
}
int
diff --git a/sys/conf/files b/sys/conf/files
index 795f6f833e8eb..69c78b92d12df 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -13,30 +13,34 @@ aic7xxx_{seq,reg}.h optional ahc device-driver \
no-obj no-implicit-rule before-depend \
clean "aic7xxx_seq.h aic7xxx_reg.h" \
dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm"
+kern/subr_bus.c standard \
+ dependency "device_if.h bus_if.h"
device_if.o standard \
+ dependency "device_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
device_if.c standard \
- dependency "$S/kern/makedevops.pl $S/kern/device_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/kern/device_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/device_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/kern/device_if.m" \
no-obj no-implicit-rule before-depend local \
clean "device_if.c"
device_if.h standard \
- dependency "$S/kern/makedevops.pl $S/kern/device_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/kern/device_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/device_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/kern/device_if.m" \
no-obj no-implicit-rule before-depend \
clean "device_if.h"
bus_if.o standard \
+ dependency "bus_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
bus_if.c standard \
- dependency "$S/kern/makedevops.pl $S/kern/bus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/kern/bus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/bus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/kern/bus_if.m" \
no-obj no-implicit-rule before-depend local \
clean "bus_if.c"
bus_if.h standard \
- dependency "$S/kern/makedevops.pl $S/kern/bus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/kern/bus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/kern/bus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/kern/bus_if.m" \
no-obj no-implicit-rule before-depend \
clean "bus_if.h"
coda/coda_namecache.c optional vcoda
@@ -61,7 +65,6 @@ cam/scsi/scsi_ch.c optional ch
cam/scsi/scsi_pass.c optional pass
cam/scsi/scsi_scan.c optional scan
cam/scsi/scsi_target.c optional targ
-cam/scsi/scsi_targ_bh.c optional targbh
ddb/db_access.c optional ddb
ddb/db_kld.c optional ddb
ddb/db_aout.c optional ddb
@@ -135,73 +138,44 @@ dev/ppbus/vpo.c optional vpo
dev/ppbus/vpoio.c optional vpo
dev/ppbus/immio.c optional vpo
dev/ppbus/if_plip.c optional plip
-dev/ppbus/lpbb.c optional lpbb
smbus_if.o optional smbus \
- dependency "smbus_if.c smbus_if.h" \
+ dependency "smbus_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
smbus_if.c optional smbus \
- dependency "$S/kern/makedevops.pl $S/dev/smbus/smbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/smbus/smbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/smbus/smbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/dev/smbus/smbus_if.m" \
no-obj no-implicit-rule before-depend local \
clean "smbus_if.c"
smbus_if.h optional smbus \
- dependency "$S/kern/makedevops.pl $S/dev/smbus/smbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/smbus/smbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/smbus/smbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/dev/smbus/smbus_if.m" \
no-obj no-implicit-rule before-depend \
clean "smbus_if.h"
dev/smbus/smbconf.c optional smbus
dev/smbus/smbus.c optional smbus
dev/smbus/smb.c optional smb
-dev/iicbus/iicbb.c optional iicbb
-iicbb_if.o optional iicbb \
- dependency "iicbb_if.c" \
- compile-with "${NORMAL_C}" \
- no-implicit-rule local
-iicbb_if.c optional iicbb \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/iicbus/iicbb_if.m" \
- no-obj no-implicit-rule before-depend local \
- clean "iicbb_if.c"
-iicbb_if.h optional iicbb \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/iicbus/iicbb_if.m" \
- no-obj no-implicit-rule before-depend \
- clean "iicbb_if.h"
-dev/iicbus/iicsmb.c optional iicsmb \
- dependency "iicbus_if.h"
+dev/iicbus/iicsmb.c optional iicsmb
iicbus_if.o optional iicbus \
- dependency "iicbus_if.c iicbus_if.h" \
+ dependency "iicbus_if.c" \
compile-with "${NORMAL_C}" \
no-implicit-rule local
iicbus_if.c optional iicbus \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/iicbus/iicbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/iicbus/iicbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -c $S/dev/iicbus/iicbus_if.m" \
no-obj no-implicit-rule before-depend local \
clean "iicbus_if.c"
iicbus_if.h optional iicbus \
- dependency "$S/kern/makedevops.pl $S/dev/iicbus/iicbus_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/iicbus/iicbus_if.m" \
+ dependency "$S/kern/makedevops.sh $S/dev/iicbus/iicbus_if.m" \
+ compile-with "sh $S/kern/makedevops.sh -h $S/dev/iicbus/iicbus_if.m" \
no-obj no-implicit-rule before-depend \
clean "iicbus_if.h"
dev/iicbus/iiconf.c optional iicbus
dev/iicbus/iicbus.c optional iicbus
dev/iicbus/if_ic.c optional ic
dev/iicbus/iic.c optional iic
-dev/vinum/vinum.c optional vinum device-driver
-dev/vinum/vinumparser.c optional vinum device-driver
-dev/vinum/vinumconfig.c optional vinum device-driver
-dev/vinum/vinumio.c optional vinum device-driver
-dev/vinum/vinumutil.c optional vinum device-driver
-dev/vinum/vinumstate.c optional vinum device-driver
-dev/vinum/vinummemory.c optional vinum device-driver
-dev/vinum/vinumrequest.c optional vinum device-driver
-dev/vinum/vinumlock.c optional vinum device-driver
-dev/vinum/vinumrevive.c optional vinum device-driver
-dev/vinum/vinumioctl.c optional vinum device-driver
-dev/vinum/vinuminterrupt.c optional vinum device-driver
-dev/vn/vn.c optional vn
-dev/vx/if_vx.c optional vx device-driver
+dev/vn/vn.c optional vn
+dev/vx/if_vx.c optional vx device-driver
gnu/ext2fs/ext2_alloc.c optional ext2fs
gnu/ext2fs/ext2_balloc.c optional ext2fs
gnu/ext2fs/ext2_inode.c optional ext2fs
@@ -212,42 +186,6 @@ gnu/ext2fs/ext2_lookup.c optional ext2fs
gnu/ext2fs/ext2_subr.c optional ext2fs
gnu/ext2fs/ext2_vfsops.c optional ext2fs
gnu/ext2fs/ext2_vnops.c optional ext2fs
-# device drivers
-i4b/driver/i4b_trace.c optional i4btrc device-driver
-i4b/driver/i4b_rbch.c optional i4brbch device-driver
-i4b/driver/i4b_tel.c optional i4btel device-driver
-i4b/driver/i4b_ipr.c optional i4bipr
-i4b/driver/i4b_ctl.c optional i4bctl device-driver
-i4b/driver/i4b_isppp.c optional i4bisppp device-driver
-net/if_spppsubr.c optional sppp
-# needed by i4bipr
-net/slcompress.c optional i4bipr
-# tina-dd control driver
-i4b/tina-dd/i4b_tina_dd.c optional tina device-driver
-# support
-i4b/layer2/i4b_mbuf.c optional i4btrc device-driver
-# Q.921 handler
-i4b/layer2/i4b_l2.c optional i4bq921
-i4b/layer2/i4b_l2fsm.c optional i4bq921
-i4b/layer2/i4b_uframe.c optional i4bq921
-i4b/layer2/i4b_tei.c optional i4bq921
-i4b/layer2/i4b_sframe.c optional i4bq921
-i4b/layer2/i4b_iframe.c optional i4bq921
-i4b/layer2/i4b_l2timer.c optional i4bq921
-i4b/layer2/i4b_util.c optional i4bq921
-i4b/layer2/i4b_lme.c optional i4bq921
-# Q.931 handler
-i4b/layer3/i4b_q931.c optional i4bq931
-i4b/layer3/i4b_l3fsm.c optional i4bq931
-i4b/layer3/i4b_l3timer.c optional i4bq931
-i4b/layer3/i4b_l2if.c optional i4bq931
-i4b/layer3/i4b_l4if.c optional i4bq931
-i4b/layer3/i4b_q932fac.c optional i4bq931
-# isdn device driver, interface to i4bd
-i4b/layer4/i4b_i4bdrv.c optional i4b device-driver
-i4b/layer4/i4b_l4.c optional i4b device-driver
-i4b/layer4/i4b_l4mgmt.c optional i4b device-driver
-i4b/layer4/i4b_l4timer.c optional i4b device-driver
isofs/cd9660/cd9660_bmap.c optional cd9660
isofs/cd9660/cd9660_lookup.c optional cd9660
isofs/cd9660/cd9660_node.c optional cd9660
@@ -276,7 +214,7 @@ kern/kern_exec.c standard
kern/kern_exit.c standard
kern/kern_fork.c standard
kern/kern_ktrace.c standard
-kern/kern_lkm.c optional lkm
+kern/kern_lkm.c standard
kern/kern_lock.c standard
kern/kern_lockf.c standard
kern/kern_malloc.c standard
@@ -290,14 +228,12 @@ kern/kern_shutdown.c standard
kern/kern_sig.c standard
kern/kern_subr.c standard
kern/kern_synch.c standard
-kern/kern_syscalls.c standard
kern/kern_sysctl.c standard
kern/kern_time.c standard
kern/kern_timeout.c standard
kern/kern_xxx.c standard
kern/md5c.c standard
kern/subr_autoconf.c standard
-kern/subr_bus.c standard
kern/subr_devstat.c standard
kern/subr_diskslice.c standard
kern/subr_dkbad.c standard
@@ -306,12 +242,10 @@ kern/subr_module.c standard
kern/subr_prf.c standard
kern/subr_prof.c standard
kern/subr_rlist.c standard
-kern/subr_scanf.c standard
kern/subr_xxx.c standard
kern/sys_generic.c standard
kern/sys_pipe.c standard
kern/sys_process.c standard
-kern/subr_rman.c standard
kern/sys_socket.c standard
kern/sysv_ipc.c standard
kern/sysv_msg.c optional sysvmsg
@@ -384,7 +318,6 @@ msdosfs/msdosfs_vfsops.c optional msdosfs
msdosfs/msdosfs_vnops.c optional msdosfs
net/bpf.c optional bpfilter
net/bpf_filter.c optional bpfilter
-net/bridge.c optional bridge
net/bsd_comp.c optional ppp_bsdcomp
#net/hostcache.c standard
net/if.c standard
@@ -435,8 +368,7 @@ netatm/ipatm/ipatm_usrreq.c optional atm_ip atm_core
netatm/ipatm/ipatm_vcm.c optional atm_ip atm_core
netatm/sigpvc/sigpvc_if.c optional atm_sigpvc atm_core
netatm/sigpvc/sigpvc_subr.c optional atm_sigpvc atm_core
-netatm/spans/spans_arp.c optional atm_spans atm_core \
- dependency "spans_xdr.h"
+netatm/spans/spans_arp.c optional atm_spans atm_core
netatm/spans/spans_cls.c optional atm_spans atm_core
netatm/spans/spans_if.c optional atm_spans atm_core
netatm/spans/spans_kxdr.c optional atm_spans atm_core
@@ -508,7 +440,6 @@ netinet/in_proto.c optional inet
netinet/in_rmx.c optional inet
netinet/ip_auth.c optional ipfilter inet
netinet/ip_divert.c optional ipdivert
-netinet/ip_dummynet.c optional dummynet
netinet/ip_fil.c optional ipfilter inet
netinet/ip_flow.c optional inet
netinet/ip_frag.c optional ipfilter inet
@@ -577,26 +508,19 @@ pci/adw_pci.c optional adw device-driver
pci/ahc_pci.c optional ahc device-driver \
dependency "aic7xxx_reg.h $S/pci/ahc_pci.c"
pci/brooktree848.c optional bktr device-driver
-pci/bt848_i2c.c optional bktr device-driver
pci/bt_pci.c optional bt device-driver
pci/dpt_pci.c optional pci dpt device-driver
pci/cy_pci.c optional cy device-driver
-pci/if_ax.c optional ax device-driver
pci/if_de.c optional de device-driver
pci/if_ed_p.c optional ed device-driver
pci/if_en_pci.c optional en device-driver
pci/if_fxp.c optional fxp device-driver
pci/if_lnc_p.c optional lnc device-driver
-pci/if_mx.c optional mx device-driver
-pci/if_pn.c optional pn device-driver
pci/if_fpa.c optional fpa device-driver
-pci/if_rl.c optional rl device-driver
pci/if_sr_p.c optional sr device-driver
pci/if_tl.c optional tl device-driver
pci/if_tx.c optional tx device-driver
-pci/if_vr.c optional vr device-driver
pci/if_vx_pci.c optional vx device-driver
-pci/if_wb.c optional wb device-driver
pci/if_xl.c optional xl device-driver
pci/isp_pci.c optional isp device-driver
pci/meteor.c optional meteor device-driver
@@ -604,6 +528,7 @@ pci/ncr.c optional ncr device-driver
pci/pci.c optional pci device-driver
pci/pci_compat.c optional pci
pci/pcisupport.c optional pci
+pci/tek390.c optional amd device-driver
pci/wdc_p.c optional wdc device-driver
pci/simos.c optional simos device-driver
pci/xrpu.c optional xrpu device-driver
@@ -654,40 +579,3 @@ vm/vm_swap.c standard
vm/vm_unix.c standard
vm/vnode_pager.c standard
vm/vm_zone.c standard
-#
-# USB support
-dev/pci/uhci_pci.c optional uhci device-driver
-dev/pci/ohci_pci.c optional ohci device-driver
-usb_if.o optional usb device-driver \
- dependency "usb_if.c" \
- compile-with "${NORMAL_C}" \
- no-implicit-rule local
-usb_if.c optional usb device-driver \
- dependency "$S/kern/makedevops.pl $S/dev/usb/usb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/usb/usb_if.m" \
- no-obj no-implicit-rule before-depend local \
- clean "usb_if.c"
-usb_if.h optional usb device-driver \
- dependency "$S/kern/makedevops.pl $S/dev/usb/usb_if.m" \
- compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/usb/usb_if.m" \
- no-obj no-implicit-rule before-depend \
- clean "usb_if.h"
-dev/usb/uhci.c optional uhci device-driver
-dev/usb/ohci.c optional ohci device-driver
-dev/usb/usb.c optional usb device-driver
-dev/usb/usbdi.c optional usb device-driver
-dev/usb/usbdi_util.c optional usb device-driver
-#dev/usb/usb_mem.c optional usb device-driver
-dev/usb/usb_subr.c optional usb device-driver
-dev/usb/usb_quirks.c optional usb device-driver
-dev/usb/hid.c optional usb device-driver
-# ordering in the list of drivers below is important and should
-# be the inverse of the wanted one (MAKE_SET)
-dev/usb/ugen.c optional ugen device-driver
-dev/usb/uhid.c optional hid device-driver
-dev/usb/umodem.c optional umodem device-driver
-dev/usb/ucom.c optional ucom device-driver
-dev/usb/ums.c optional ums device-driver
-dev/usb/ulpt.c optional ulpt device-driver
-dev/usb/ukbd.c optional ukbd device-driver
-dev/usb/uhub.c optional uhub device-driver
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 0e07eb0d41786..90198060837a5 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -32,11 +32,11 @@
# SUCH DAMAGE.
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
-# $Id: newvers.sh,v 1.40 1998/10/16 06:55:36 jkh Exp $
+# $Id: newvers.sh,v 1.38 1998/09/19 11:45:37 jkh Exp $
TYPE="FreeBSD"
REVISION="3.0"
-BRANCH="CURRENT"
+BRANCH="RELEASE"
RELEASE="${REVISION}-${BRANCH}"
SNAPDATE=""
if [ "X${SNAPDATE}" != "X" ]; then
@@ -90,7 +90,8 @@ fi
touch version
v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date`
-echo "$COPYRIGHT" > vers.c
+cat /dev/null > vers.c
+echo "$COPYRIGHT" >> vers.c
echo "char ostype[] = \"${TYPE}\";" >> vers.c
echo "char osrelease[] = \"${RELEASE}\";" >> vers.c
echo "int osreldate = ${RELDATE};" >> vers.c
diff --git a/sys/conf/options b/sys/conf/options
index 35ceb1a53ffa8..c922510bdd56c 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -1,4 +1,4 @@
-# $Id: options,v 1.120 1999/01/17 19:02:39 peter Exp $
+# $Id: options,v 1.104 1998/10/09 23:26:26 peter Exp $
#
# On the handling of kernel options
#
@@ -44,7 +44,6 @@ ADW_ALLOW_MEMIO opt_adw.h # Allow PCI devices to use memory
COMPAT_43 opt_compat.h
COMPAT_SUNOS opt_compat.h
COMPILING_LINT opt_lint.h
-CY_PCI_FASTINTR
DDB
DDB_UNATTENDED opt_ddb.h
GDB_REMOTE_CHAT opt_ddb.h
@@ -55,7 +54,6 @@ KTRACE
MD5
MFS_ROOT opt_mfs.h
MFS_ROOT_SIZE opt_mfs.h
-NTIMECOUNTER opt_ntp.h
EXPORTMFS opt_mfs.h
NO_LKM
NSWAPDEV opt_swap.h
@@ -67,7 +65,6 @@ SYSVMSG opt_sysvipc.h
SYSVSEM opt_sysvipc.h
SYSVSHM opt_sysvipc.h
UCONSOLE
-ICMP_BANDLIM
# POSIX kernel options
P1003_1B opt_posix.h
@@ -125,7 +122,6 @@ CD9660_ROOTDELAY opt_cd9660.h
UNION
# Options used only in param.c.
-HZ opt_param.h
MAXUSERS opt_param.h
MSGMNB opt_param.h
MSGMNI opt_param.h
@@ -134,7 +130,6 @@ MSGSSZ opt_param.h
MSGTQL opt_param.h
NBUF opt_param.h
NMBCLUSTERS opt_param.h
-NSFBUFS opt_param.h
SEMMAP opt_param.h
SEMMNI opt_param.h
SEMMNS opt_param.h
@@ -187,11 +182,9 @@ BOOTP_COMPAT opt_bootp.h
BOOTP_NFSROOT opt_bootp.h
BOOTP_NFSV3 opt_bootp.h
BOOTP_WIRED_TO opt_bootp.h
-BRIDGE opt_bdg.h
MROUTING opt_mrouting.h
INET opt_inet.h
IPDIVERT
-DUMMYNET opt_ipdn.h
IPFIREWALL opt_ipfw.h
IPFIREWALL_VERBOSE opt_ipfw.h
IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h
@@ -240,11 +233,7 @@ DPT_RESET_HBA opt_dpt.h
# 'DEBUG', and then let people recompile just the interesting modules
# with 'make CC="cc -DDEBUG'.
CLUSTERDEBUG opt_debug_cluster.h
-DEBUG_1284 opt_ppb_1284.h
-PERIPH_1284 opt_ppb_1284.h
-DONTPROBE_1284 opt_ppb_1284.h
-VP0_DEBUG opt_vpo.h
-NLPT_DEBUG opt_nlpt.h
+DEBUG_1284 opt_debug_1284.h
LOCKF_DEBUG opt_debug_lockf.h
LOUTB opt_debug_outb.h
NPX_DEBUG opt_debug_npx.h
@@ -255,14 +244,9 @@ SI_DEBUG opt_debug_si.h
# These cause changes all over the kernel
DEBUG opt_global.h
-DEBUG_LOCKS opt_global.h
-DEBUG_VFS_LOCKS opt_global.h
DIAGNOSTIC opt_global.h
-ENABLE_VFS_IOOPT opt_global.h
-INVARIANT_SUPPORT opt_global.h
-INVARIANTS opt_global.h
SIMPLELOCK_DEBUG opt_global.h
-VFS_BIO_DEBUG opt_global.h
+ENABLE_VFS_IOOPT opt_global.h
# These are VM related options
VM_KMEM_SIZE opt_vm.h
@@ -275,10 +259,6 @@ PQ_MEDIUMCACHE opt_vmpage.h
PQ_LARGECACHE opt_vmpage.h
PQ_HUGECACHE opt_vmpage.h
-# Standard SMP options
-SMP opt_global.h
-NCPU opt_smp.h
-NBUS opt_smp.h
# sys/netkey
KEY
@@ -320,16 +300,3 @@ METEOR_DEALLOC_ABOVE opt_meteor.h
# Include tweaks for running under the SimOS machine simulator.
SIMOS opt_simos.h
-
-# options for bus/device framework
-BUS_DEBUG opt_bus.h
-
-# options for USB support
-USB_DEBUG opt_usb.h
-USBVERBOSE opt_usb.h
-
-# Vinum options
-VINUMDEBUG opt_vinum.h
-
-# Include LKM compatability module
-LKM
diff --git a/sys/conf/param.c b/sys/conf/param.c
index ef98c59c6e253..454298416c6fd 100644
--- a/sys/conf/param.c
+++ b/sys/conf/param.c
@@ -36,11 +36,9 @@
* SUCH DAMAGE.
*
* @(#)param.c 8.3 (Berkeley) 8/20/94
- * $Id: param.c,v 1.31 1998/11/05 14:28:17 dg Exp $
+ * $Id: param.c,v 1.29 1998/06/30 21:25:35 phk Exp $
*/
-#include <stddef.h>
-
#include "opt_sysvipc.h"
#include "opt_param.h"
@@ -97,12 +95,6 @@ int maxsockets = MAXSOCKETS;
/* allocate 1/4th amount of virtual address space for mbufs XXX */
int nmbufs = NMBCLUSTERS * 4;
-/* maximum # of sf_bufs (sendfile(2) zero-copy virtual buffers) */
-#ifndef NSFBUFS
-#define NSFBUFS (512 + MAXUSERS * 16)
-#endif
-int nsfbufs = NSFBUFS;
-
/*
* Values in support of System V compatible shared memory. XXX
*/
diff --git a/sys/contrib/softupdates/README b/sys/contrib/softupdates/README
deleted file mode 100644
index 8a7433b61e9eb..0000000000000
--- a/sys/contrib/softupdates/README
+++ /dev/null
@@ -1,320 +0,0 @@
-Introduction
-
-This package constitutes the alpha distribution of the soft update
-code updates for the fast filesystem.
-
-For More information on what Soft Updates is, see:
-http://www.ece.cmu.edu/~ganger/papers/CSE-TR-254-95/
-
-Status
-
-My `filesystem torture tests' (described below) run for days without
-a hitch (no panic's, hangs, filesystem corruption, or memory leaks).
-However, I have had several panic's reported to me by folks that
-are field testing the code which I have not yet been able to
-reproduce or fix. Although these panic's are rare and do not cause
-filesystem corruption, the code should only be put into production
-on systems where the system administrator is aware that it is being
-run, and knows how to turn it off if problems arise. Thus, you may
-hand out this code to others, but please ensure that this status
-message is included with any distributions. Please also include
-the file ffs_softdep.stub.c in any distributions so that folks that
-cannot abide by the need to redistribute source will not be left
-with a kernel that will not link. It will resolve all the calls
-into the soft update code and simply ignores the request to enable
-them. Thus you will be able to ensure that your other hooks have
-not broken anything and that your kernel is softdep-ready for those
-that wish to use them. Please report problems back to me with
-kernel backtraces of panics if possible. This is massively complex
-code, and people only have to have their filesystems hosed once or
-twice to avoid future changes like the plague. I want to find and
-fix as many bugs as soon as possible so as to get the code rock
-solid before it gets widely released. Please report any bugs that
-you uncover to mckusick@mckusick.com.
-
-Performance
-
-Running the Andrew Benchmarks yields the following raw data:
-
- Phase Normal Softdep What it does
- 1 3s <1s Creating directories
- 2 8s 4s Copying files
- 3 6s 6s Recursive directory stats
- 4 8s 9s Scanning each file
- 5 25s 25s Compilation
-
- Normal: 19.9u 29.2s 0:52.8 135+630io
- Softdep: 20.3u 28.5s 0:47.8 103+363io
-
-Another interesting datapoint are my `filesystem torture tests'.
-They consist of 1000 runs of the andrew benchmarks, 1000 copy and
-removes of /etc with randomly selected pauses of 0-60 seconds
-between each copy and remove, and 500 find from / with randomly
-selected pauses of 100 seconds between each run). The run of the
-torture test compares as follows:
-
-With soft updates: writes: 6 sync, 1,113,686 async; run time 19hr, 50min
-Normal filesystem: writes: 1,459,147 sync, 487,031 async; run time 27hr, 15min
-
-The upshot is 42% less I/O and 28% shorter running time.
-
-Another interesting test point is a full MAKEDEV. Because it runs
-as a shell script, it becomes mostly limited by the execution speed
-of the machine on which it runs. Here are the numbers:
-
-With soft updates:
-
- labrat# time ./MAKEDEV std
- 2.2u 32.6s 0:34.82 100.0% 0+0k 11+36io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Without soft updates:
-
- labrat# time ./MAKEDEV std
- 2.0u 40.5s 0:42.53 100.0% 0+0k 11+1221io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Of course, some of the system time is being pushed
-to the syncer process, but that is a different story.
-
-To show a benchmark designed to highlight the soft update code
-consider a tar of zero-sized files and an rm -rf of a directory tree
-that has at least 50 files or so at each level. Running a test with
-a directory tree containing 28 directories holding 202 empty files
-produces the following numbers:
-
-With soft updates:
-tar: 0.0u 0.5s 0:00.65 76.9% 0+0k 0+44io 0pf+0w (0 sync, 33 async writes)
-rm: 0.0u 0.2s 0:00.20 100.0% 0+0k 0+37io 0pf+0w (0 sync, 72 async writes)
-
-Normal filesystem:
-tar: 0.0u 1.1s 0:07.27 16.5% 0+0k 60+586io 0pf+0w (523 sync, 0 async writes)
-rm: 0.0u 0.5s 0:01.84 29.3% 0+0k 0+318io 0pf+0w (258 sync, 65 async writes)
-
-The large reduction in writes is because inodes are clustered, so
-most of a block gets allocated, then the whole block is written
-out once rather than having the same block written once for each
-inode allocated from it. Similarly each directory block is written
-once rather than once for each new directory entry. Effectively
-what the update code is doing is allocating a bunch of inodes
-and directory entries without writing anything, then ensuring that
-the block containing the inodes is written first followed by the
-directory block that references them. If there were data in the
-files it would further ensure that the data blocks were written
-before their inodes claimed them.
-
-Copyright Restrictions
-
-Please familiarize yourself with the copyright restrictions
-contained at the top of either the sys/ufs/ffs/softdep.h or
-sys/ufs/ffs/ffs_softdep.c file. The key provision is similar
-to the one used by the DB 2.0 package and goes as follows:
-
- Redistributions in any form must be accompanied by information
- on how to obtain complete source code for any accompanying
- software that uses the this software. This source code must
- either be included in the distribution or be available for
- no more than the cost of distribution plus a nominal fee,
- and must be freely redistributable under reasonable
- conditions. For an executable file, complete source code
- means the source code for all modules it contains. It does
- not mean source code for modules or files that typically
- accompany the operating system on which the executable file
- runs, e.g., standard library modules or system header files.
-
-The idea is to allow those of you freely redistributing your source
-to use it while retaining for myself the right to peddle it for
-money to the commercial UNIX vendors. Note that I have included a
-stub file ffs_softdep.c.stub that is freely redistributable so that
-you can put in all the necessary hooks to run the full soft updates
-code, but still allow vendors that want to maintain proprietary
-source to have a working system. I do plan to release the code with
-a `Berkeley style' copyright once I have peddled it around to the
-commercial vendors. If you have concerns about this copyright,
-feel free to contact me with them and we can try to resolve any
-difficulties.
-
-Soft Dependency Operation
-
-The soft update implementation does NOT require ANY changes
-to the on-disk format of your filesystems. Furthermore it is
-not used by default for any filesystems. It must be enabled on
-a filesystem by filesystem basis by running tunefs to set a
-bit in the superblock indicating that the filesystem should be
-managed using soft updates. If you wish to stop using
-soft updates due to performance or reliability reasons,
-you can simply run tunefs on it again to turn off the bit and
-revert to normal operation. The additional dynamic memory load
-placed on the kernel malloc arena is approximately equal to
-the amount of memory used by vnodes plus inodes (for a system
-with 1000 vnodes, the additional peak memory load is about 300K).
-
-Kernel Changes
-
-There are two new changes to the kernel functionality that are not
-contained in in the soft update files. The first is a `trickle
-sync' facility running in the kernel as process 3. This trickle
-sync process replaces the traditional `update' program (which should
-be commented out of the /etc/rc startup script). When a vnode is
-first written it is placed 30 seconds down on the trickle sync
-queue. If it still exists and has dirty data when it reaches the
-top of the queue, it is sync'ed. This approach evens out the load
-on the underlying I/O system and avoids writing short-lived files.
-The papers on trickle-sync tend to favor aging based on buffers
-rather than files. However, I sync on file age rather than buffer
-age because the data structures are much smaller as there are
-typically far fewer files than buffers. Although this can make the
-I/O spikey when a big file times out, it is still much better than
-the wholesale sync's that were happening before. It also adapts
-much better to the soft update code where I want to control
-aging to improve performance (inodes age in 10 seconds, directories
-in 15 seconds, files in 30 seconds). This ensures that most
-dependencies are gone (e.g., inodes are written when directory
-entries want to go to disk) reducing the amount of rollback that
-is needed.
-
-The other main kernel change is to split the vnode freelist into
-two separate lists. One for vnodes that are still being used to
-identify buffers and the other for those vnodes no longer identifying
-any buffers. The latter list is used by getnewvnode in preference
-to the former.
-
-Packaging of Kernel Changes
-
-The sys subdirectory contains the changes and additions to the
-kernel. My goal in writing this code was to minimize the changes
-that need to be made to the kernel. Thus, most of the new code
-is contained in the two new files softdep.h and ffs_softdep.c.
-The rest of the kernel changes are simply inserting hooks to
-call into these two new files. Although there has been some
-structural reorganization of the filesystem code to accommodate
-gathering the information required by the soft update code,
-the actual ordering of filesystem operations when soft updates
-are disabled is unchanged.
-
-The kernel changes are packaged as a set of diffs. As I am
-doing my development in BSD/OS, the diffs are relative to the
-BSD/OS versions of the files. Because BSD/OS recently had
-4.4BSD-Lite2 merged into it, the Lite2 files are a good starting
-point for figuring out the changes. There are 40 files that
-require change plus the two new files. Most of these files have
-only a few lines of changes in them. However, four files have
-fairly extensive changes: kern/vfs_subr.c, ufs/ufs/ufs_lookup.c,
-ufs/ufs/ufs_vnops.c, and ufs/ffs/ffs_alloc.c. For these four
-files, I have provided the original Lite2 version, the Lite2
-version with the diffs merged in, and the diffs between the
-BSD/OS and merged version. Even so, I expect that there will
-be some difficulty in doing the merge; I am certainly willing
-to assist in helping get the code merged into your system.
-
-Packaging of Utility Changes
-
-The utilities subdirectory contains the changes and additions
-to the utilities. There are diffs to three utilities enclosed:
-
- tunefs - add a flag to enable and disable soft updates
-
- mount - print out whether soft updates are enabled and
- also statistics on number of sync and async writes
-
- fsck - tighter checks on acceptable errors and a slightly
- different policy for what to put in lost+found on
- filesystems using soft updates
-
-In addition you should recompile vmstat so as to get reports
-on the 13 new memory types used by the soft update code.
-It is not necessary to use the new version of fsck, however it
-would aid in my debugging if you do. Also, because of the time
-lag between deleting a directory entry and the inode it
-references, you will find a lot more files showing up in your
-lost+found if you do not use the new version. Note that the
-new version checks for the soft update flag in the superblock
-and only uses the new algorithms if it is set. So, it will run
-unchanged on the filesystems that are not using soft updates.
-
-Operation
-
-Once you have booted a kernel that incorporates the soft update
-code and installed the updated utilities, do the following:
-
-1) Comment out the update program in /etc/rc.
-
-2) Run `tunefs -n enable' on one or more test filesystems.
-
-3) Mount these filesystems and then type `mount' to ensure that
- they have been enabled for soft updates.
-
-4) Copy the test directory to a softdep filesystem, chdir into
- it and run `./doit'. You may want to check out each of the
- three subtests individually first: doit1 - andrew benchmarks,
- doit2 - copy and removal of /etc, doit3 - find from /.
-
-====
-Additional notes from Feb 13
-
-hen removing huge directories of files, it is possible to get
-the incore state arbitrarily far ahead of the disk. Maintaining
-all the associated depedency information can exhaust the kernel
-malloc arena. To avoid this senario, I have put some limits on
-the soft update code so that it will not be allowed to rampage
-through all of the kernel memory. I enclose below the relevant
-patches to vnode.h and vfs_subr.c (which allow the soft update
-code to speed up the filesystem syncer process). I have also
-included the diffs for ffs_softdep.c. I hope to make a pass over
-ffs_softdep.c to isolate the differences with my standard version
-so that these diffs are less painful to incorporate.
-
-Since I know you like to play with tuning, I have put the relevant
-knobs on sysctl debug variables. The tuning knobs can be viewed
-with `sysctl debug' and set with `sysctl -w debug.<name>=value'.
-The knobs are as follows:
-
- debug.max_softdeps - limit on any given resource
- debug.tickdelay - ticks to delay before allocating
- debug.max_limit_hit - number of times tickdelay imposed
- debug.rush_requests - number of rush requests to filesystem syncer
-
-The max_softdeps limit is derived from vnodesdesired which in
-turn is sized based on the amount of memory on the machine.
-When the limit is hit, a process requesting a resource first
-tries to speed up the filesystem syncer process. Such a
-request is recorded as a rush_request. After syncdelay / 2
-unserviced rush requests (typically 15) are in the filesystem
-syncers queue (i.e., it is more than 15 seconds behind in its
-work), the process requesting the memory is put to sleep for
-tickdelay seconds. Such a delay is recorded in max_limit_hit.
-Following this delay it is granted its memory without further
-delay. I have tried the following experiments in which I
-delete an MH directory containing 16,703 files:
-
-Run # 1 2 3
-
-max_softdeps 4496 4496 4496
-tickdelay 100 == 1 sec 20 == 0.2 sec 2 == 0.02 sec
-max_limit_hit 16 == 16 sec 27 == 5.4 sec 203 == 4.1 sec
-rush_requests 147 102 93
-run time 57 sec 46 sec 45 sec
-I/O's 781 859 936
-
-When run with no limits, it completes in 40 seconds. So, the
-time spent in delay is directly added to the bottom line.
-Shortening the tick delay does cut down the total running time,
-but at the expense of generating more total I/O operations
-due to the rush orders being sent to the filesystem syncer.
-Although the number of rush orders decreases with a shorter
-tick delay, there are more requests in each order, hence the
-increase in I/O count. Also, although the I/O count does rise
-with a shorter delay, it is still at least an order of magnitude
-less than without soft updates. Anyway, you may want to play
-around with these value to see what works best and to see if
-you can get an insight into how best to tune them. If you get
-out of memory panic's, then you have max_softdeps set too high.
-The max_limit_hit and rush_requests show be reset to zero
-before each run. The minimum legal value for tickdelay is 2
-(if you set it below that, the code will use 2).
-
-
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index cb41d85694f34..1a44450cdfc7c 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_command.c,v 1.28 1998/07/08 10:53:45 bde Exp $
+ * $Id: db_command.c,v 1.27 1998/05/19 18:42:03 phk Exp $
*/
/*
@@ -35,7 +35,7 @@
* Command dispatcher.
*/
#include <sys/param.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/reboot.h>
#include <sys/systm.h>
diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c
index 8c5f91e979273..60d48ec0c9603 100644
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_sym.c,v 1.26 1998/07/08 10:53:51 bde Exp $
+ * $Id: db_sym.c,v 1.25 1998/07/08 09:11:38 bde Exp $
*/
/*
@@ -91,7 +91,9 @@ db_qualify(sym, symtabname)
static char tmp[256];
db_symbol_values(sym, &symname, 0);
- snprintf(tmp, sizeof(tmp), "%s:%s", symtabname, symname);
+ strcpy(tmp,symtabname);
+ strcat(tmp,":");
+ strcat(tmp,symname);
return tmp;
}
diff --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c
index f0588f8916372..ac47f8d7bac4e 100644
--- a/sys/dev/advansys/advansys.c
+++ b/sys/dev/advansys/advansys.c
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: advansys.c,v 1.6 1998/12/04 22:54:44 archie Exp $
+ * $Id: advansys.c,v 1.3 1998/10/07 03:32:56 gibbs Exp $
*/
/*
* Ported from:
@@ -134,7 +134,7 @@ adv_name(struct adv_softc *adv)
{
static char name[10];
- snprintf(name, sizeof(name), "adv%d", adv->unit);
+ sprintf(name, "adv%d", adv->unit);
return (name);
}
@@ -554,10 +554,8 @@ adv_alloc_ccb_info(struct adv_softc *adv)
struct adv_ccb_info *cinfo;
cinfo = malloc(sizeof(*cinfo), M_DEVBUF, M_NOWAIT);
- if (cinfo == NULL) {
+ if (cinfo == NULL)
printf("%s: Can't malloc CCB info\n", adv_name(adv));
- return (NULL);
- }
cinfo->state = ACCB_FREE;
error = bus_dmamap_create(adv->buffer_dmat, /*flags*/0,
&cinfo->dmamap);
@@ -1050,9 +1048,7 @@ adv_done(struct adv_softc *adv, union ccb *ccb, u_int done_stat,
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
break;
default:
- xpt_print_path(ccb->ccb_h.path);
- printf("adv_done - queue done without error, "
- "unknown host status %x\n", host_stat);
+ /* QHSTA error occurred */
/* XXX Can I get more explicit information here? */
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
break;
@@ -1088,9 +1084,6 @@ adv_done(struct adv_softc *adv, union ccb *ccb, u_int done_stat,
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
break;
default:
- xpt_print_path(ccb->ccb_h.path);
- printf("adv_done - queue done with error, "
- "unknown host status %x\n", host_stat);
/* XXX Can I get more explicit information here? */
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
break;
@@ -1104,9 +1097,7 @@ adv_done(struct adv_softc *adv, union ccb *ccb, u_int done_stat,
break;
default:
- xpt_print_path(ccb->ccb_h.path);
- printf("adv_done - queue done with unknown status %x:%x\n",
- done_stat, host_stat);
+ printf("adv_done: Unknown done status 0x%x\n", done_stat);
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
break;
}
diff --git a/sys/dev/advansys/advlib.c b/sys/dev/advansys/advlib.c
index e612974c44aa4..617266a6aa876 100644
--- a/sys/dev/advansys/advlib.c
+++ b/sys/dev/advansys/advlib.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: advlib.c,v 1.9 1998/10/29 17:41:34 gibbs Exp $
+ * $Id: advlib.c,v 1.7 1998/10/07 03:32:57 gibbs Exp $
*/
/*
* Ported from:
@@ -1031,8 +1031,7 @@ adv_isr_chip_halted(struct adv_softc *adv)
ccb = (union ccb *) adv_read_lram_32(adv, halt_q_addr
+ ADV_SCSIQ_D_CCBPTR);
xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
- ccb->ccb_h.status |= CAM_DEV_QFRZN|CAM_SCSI_STATUS_ERROR;
- ccb->csio.scsi_status = SCSI_STATUS_QUEUE_FULL;
+ ccb->ccb_h.status |= CAM_DEV_QFRZN;
adv_abort_ccb(adv, tid_no, ADV_TIX_TO_LUN(target_ix),
/*ccb*/NULL, CAM_REQUEUE_REQ,
/*queued_only*/TRUE);
@@ -1971,6 +1970,7 @@ adv_abort_ccb(struct adv_softc *adv, int target, int lun, union ccb *ccb,
struct adv_ccb_info *cinfo;
scsiq->q_status |= QS_ABORTED;
+ scsiq->d3.done_stat = QD_ABORTED_BY_HOST;
adv_write_lram_8(adv, q_addr + ADV_SCSIQ_B_STATUS,
scsiq->q_status);
aborted_ccb = (union ccb *)scsiq->d2.ccb_ptr;
@@ -2009,6 +2009,8 @@ adv_reset_bus(struct adv_softc *adv)
count = 0;
while ((ccb = (union ccb *)LIST_FIRST(&adv->pending_ccbs)) != NULL) {
+ struct adv_ccb_info *cinfo;
+
if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG)
ccb->ccb_h.status |= CAM_SCSI_BUS_RESET;
adv_done(adv, ccb, QD_ABORTED_BY_HOST, 0, 0, 0);
diff --git a/sys/dev/advansys/adwlib.c b/sys/dev/advansys/adwlib.c
index c727ca633b751..e2b93ac0fc2ce 100644
--- a/sys/dev/advansys/adwlib.c
+++ b/sys/dev/advansys/adwlib.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adwlib.c,v 1.1 1998/10/07 03:20:46 gibbs Exp $
+ * $Id$
*/
/*
* Ported from:
@@ -43,8 +43,7 @@
* code retain the above copyright notice and this comment without
* modification.
*/
-
-#include <sys/types.h>
+#include <sys/queue.h>
#include <sys/systm.h>
#include <machine/bus_pio.h>
diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c
index dcabdeaa71ad7..9109c6d4cfe3d 100644
--- a/sys/dev/aha/aha.c
+++ b/sys/dev/aha/aha.c
@@ -55,11 +55,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aha.c,v 1.18 1998/12/22 22:31:06 imp Exp $
+ * $Id: aha.c,v 1.9 1998/10/15 19:53:30 imp Exp $
*/
-#include "pnp.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@@ -81,15 +79,10 @@
#include <vm/vm.h>
#include <vm/pmap.h>
-
-#if NPNP > 0
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h> /* XXX pnp isn't x86 only */
-#endif
#include <dev/aha/ahareg.h>
-struct aha_softc *aha_softcs[NAHATOT];
+struct aha_softc *aha_softcs[NAHA];
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define PRVERB(x) if (bootverbose) printf x
@@ -132,15 +125,15 @@ ahanextoutbox(struct aha_softc *aha)
/* CCB Mangement functions */
static __inline u_int32_t ahaccbvtop(struct aha_softc *aha,
- struct aha_ccb *accb);
+ struct aha_ccb *bccb);
static __inline struct aha_ccb* ahaccbptov(struct aha_softc *aha,
u_int32_t ccb_addr);
static __inline u_int32_t
-ahaccbvtop(struct aha_softc *aha, struct aha_ccb *accb)
+ahaccbvtop(struct aha_softc *aha, struct aha_ccb *bccb)
{
return (aha->aha_ccb_physbase
- + (u_int32_t)((caddr_t)accb - (caddr_t)aha->aha_ccb_array));
+ + (u_int32_t)((caddr_t)bccb - (caddr_t)aha->aha_ccb_array));
}
static __inline struct aha_ccb *
ahaccbptov(struct aha_softc *aha, u_int32_t ccb_addr)
@@ -150,10 +143,10 @@ ahaccbptov(struct aha_softc *aha, u_int32_t ccb_addr)
}
static struct aha_ccb* ahagetccb(struct aha_softc *aha);
-static __inline void ahafreeccb(struct aha_softc *aha, struct aha_ccb *accb);
+static __inline void ahafreeccb(struct aha_softc *aha, struct aha_ccb *bccb);
static void ahaallocccbs(struct aha_softc *aha);
static bus_dmamap_callback_t ahaexecuteccb;
-static void ahadone(struct aha_softc *aha, struct aha_ccb *accb,
+static void ahadone(struct aha_softc *aha, struct aha_ccb *bccb,
aha_mbi_comp_code_t comp_code);
/* Host adapter command functions */
@@ -170,7 +163,7 @@ static void ahafetchtransinfo(struct aha_softc *aha,
struct ccb_trans_settings *cts);
/* CAM SIM entry points */
-#define ccb_accb_ptr spriv_ptr0
+#define ccb_bccb_ptr spriv_ptr0
#define ccb_aha_ptr spriv_ptr1
static void ahaaction(struct cam_sim *sim, union ccb *ccb);
static void ahapoll(struct cam_sim *sim);
@@ -187,26 +180,12 @@ u_long aha_unit = 0;
*/
struct aha_isa_port aha_isa_ports[] =
{
- { 0x130, 0, 4 },
- { 0x134, 0, 5 },
- { 0x230, 0, 2 },
- { 0x234, 0, 3 },
- { 0x330, 0, 0 },
- { 0x334, 0, 1 }
-};
-
-/*
- * I/O ports listed in the order enumerated by the
- * card for certain op codes.
- */
-u_int16_t aha_board_ports[] =
-{
- 0x330,
- 0x334,
- 0x230,
- 0x234,
- 0x130,
- 0x134
+ { 0x330, 0 },
+ { 0x334, 0 },
+ { 0x230, 0 },
+ { 0x234, 0 },
+ { 0x130, 0 },
+ { 0x134, 0 }
};
/* Exported functions */
@@ -216,7 +195,7 @@ aha_alloc(int unit, bus_space_tag_t tag, bus_space_handle_t bsh)
struct aha_softc *aha;
if (unit != AHA_TEMP_UNIT) {
- if (unit >= NAHATOT) {
+ if (unit >= NAHA) {
printf("aha: unit number (%d) too high\n", unit);
return NULL;
}
@@ -242,8 +221,6 @@ aha_alloc(int unit, bus_space_tag_t tag, bus_space_handle_t bsh)
aha->unit = unit;
aha->tag = tag;
aha->bsh = bsh;
- aha->ccb_sg_opcode = INITIATOR_SG_CCB_WRESID;
- aha->ccb_ccb_opcode = INITIATOR_CCB_WRESID;
if (aha->unit != AHA_TEMP_UNIT) {
aha_softcs[unit] = aha;
@@ -315,26 +292,13 @@ aha_probe(struct aha_softc* aha)
status = aha_inb(aha, STATUS_REG);
if ((status == 0)
|| (status & (DIAG_ACTIVE|CMD_REG_BUSY|
- STATUS_REG_RSVD)) != 0) {
- PRVERB(("%s: status reg test failed %x\n", aha_name(aha),
- status));
+ STATUS_REG_RSVD|CMD_INVALID)) != 0) {
return (ENXIO);
}
intstat = aha_inb(aha, INTSTAT_REG);
if ((intstat & INTSTAT_REG_RSVD) != 0) {
- PRVERB(("%s: Failed Intstat Reg Test\n", aha_name(aha)));
- return (ENXIO);
- }
-
- /*
- * Looking good so far. Final test is to reset the
- * adapter and fetch the board ID and ensure we aren't
- * looking at a BusLogic.
- */
- if ((error = ahareset(aha, /*hard_reset*/TRUE)) != 0) {
- if (bootverbose)
- printf("%s: Failed Reset\n", aha_name(aha));
+ printf("%s: Failed Intstat Reg Test\n", aha_name(aha));
return (ENXIO);
}
@@ -342,7 +306,7 @@ aha_probe(struct aha_softc* aha)
* Get the board ID. We use this to see if we're dealing with
* a buslogic card or a aha card (or clone).
*/
- error = aha_cmd(aha, AOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0,
+ error = aha_cmd(aha, BOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0,
(u_int8_t*)&board_id, sizeof(board_id),
DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -360,29 +324,12 @@ aha_probe(struct aha_softc* aha)
* this register, and return 0xff, while buslogic cards will return
* something different.
*
- * It appears that for reasons unknow, for the for the
- * aha-1542B cards, we need to wait a little bit before trying
- * to read the geometry register. I picked 10ms since we have
- * reports that a for loop to 1000 did the trick, and this
- * errs on the side of conservatism. Besides, no one will
- * notice a 10mS delay here, even the 1542B card users :-)
- *
- * Some compatible cards return 0 here.
- *
- * XXX I'm not sure how this will impact other cloned cards
- *
- * This really should be replaced with the esetup command, since
- * that appears to be more reliable.
+ * XXX I'm not sure how this will impact other cloned cards.
*/
if (aha->boardid <= 0x42) {
- /* Wait 10ms before reading */
- DELAY(10000);
status = aha_inb(aha, GEOMETRY_REG);
- if (status != 0xff && status != 0x00) {
- PRVERB(("%s: Geometry Register test failed\n",
- aha_name(aha)));
+ if (status != 0xff)
return (ENXIO);
- }
}
return (0);
@@ -402,31 +349,31 @@ aha_fetch_adapter_info(struct aha_softc *aha)
switch (aha->boardid) {
case BOARD_1540_16HEAD_BIOS:
- snprintf(aha->model, sizeof(aha->model), "1540 16 head BIOS");
+ strcpy(aha->model, "1540 16 head BIOS");
break;
case BOARD_1540_64HEAD_BIOS:
- snprintf(aha->model, sizeof(aha->model), "1540 64 head BIOS");
+ strcpy(aha->model, "1540 64 head BIOS");
break;
case BOARD_1542:
- snprintf(aha->model, sizeof(aha->model), "1540/1542 64 head BIOS");
+ strcpy(aha->model, "1540/1542 64 head BIOS");
break;
case BOARD_1640:
- snprintf(aha->model, sizeof(aha->model), "1640");
+ strcpy(aha->model, "1640");
break;
case BOARD_1740:
- snprintf(aha->model, sizeof(aha->model), "1740A/1742A/1744");
+ strcpy(aha->model, "1740A/1742A/1744");
break;
case BOARD_1542C:
- snprintf(aha->model, sizeof(aha->model), "1542C");
+ strcpy(aha->model, "1542C");
break;
case BOARD_1542CF:
- snprintf(aha->model, sizeof(aha->model), "1542CF");
+ strcpy(aha->model, "1542CF");
break;
case BOARD_1542CP:
- snprintf(aha->model, sizeof(aha->model), "1542CP");
+ strcpy(aha->model, "1542CP");
break;
default:
- snprintf(aha->model, sizeof(aha->model), "Unknown");
+ strcpy(aha->model, "Unknown");
break;
}
/*
@@ -442,24 +389,24 @@ aha_fetch_adapter_info(struct aha_softc *aha)
(aha->boardid == 0x41
&& aha->fw_major == 0x31 &&
aha->fw_minor >= 0x34)) {
- error = aha_cmd(aha, AOP_RETURN_EXT_BIOS_INFO, NULL,
+ error = aha_cmd(aha, BOP_RETURN_EXT_BIOS_INFO, NULL,
/*paramlen*/0, (u_char *)&extbios, sizeof(extbios),
DEFAULT_CMD_TIMEOUT);
- error = aha_cmd(aha, AOP_MBOX_IF_ENABLE, (u_int8_t *)&extbios,
+ error = aha_cmd(aha, BOP_MBOX_IF_ENABLE, (u_int8_t *)&extbios,
/*paramlen*/2, NULL, 0, DEFAULT_CMD_TIMEOUT);
}
if (aha->boardid < 0x41)
- printf("%s: Warning: aha-1542A won't likely work.\n",
+ printf("%s: Likely aha 1542A, which might not work properly\n",
aha_name(aha));
- aha->max_sg = 17; /* Need >= 17 to do 64k I/O */
+ aha->max_sg = 17; /* Need 17 to do 64k I/O */
aha->diff_bus = 0;
aha->extended_lun = 0;
aha->extended_trans = 0;
aha->max_ccbs = 16;
/* Determine Sync/Wide/Disc settings */
length_param = sizeof(setup_info);
- error = aha_cmd(aha, AOP_INQUIRE_SETUP_INFO, &length_param,
+ error = aha_cmd(aha, BOP_INQUIRE_SETUP_INFO, &length_param,
/*paramlen*/1, (u_int8_t*)&setup_info,
sizeof(setup_info), DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -477,7 +424,7 @@ aha_fetch_adapter_info(struct aha_softc *aha)
/* Determine our SCSI ID */
- error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
+ error = aha_cmd(aha, BOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
(u_int8_t*)&config_data, sizeof(config_data),
DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -634,8 +581,8 @@ aha_attach(struct aha_softc *aha)
struct cam_devq *devq;
/*
- * We don't do tagged queueing, since the aha cards don't
- * support it.
+ * We reserve 1 ccb for error recovery, so don't
+ * tell the XPT about it.
*/
tagged_dev_openings = 0;
@@ -677,7 +624,7 @@ aha_name(struct aha_softc *aha)
{
static char name[10];
- snprintf(name, sizeof(name), "aha%d", aha->unit);
+ sprintf(name, "aha%d", aha->unit);
return (name);
}
@@ -702,7 +649,7 @@ void
aha_mark_probed_bio(isa_compat_io_t port)
{
if (port < BIO_DISABLED)
- aha_mark_probed_iop(aha_board_ports[port]);
+ aha_isa_ports[port].probed = 1;
}
void
@@ -718,43 +665,6 @@ aha_mark_probed_iop(u_int ioport)
}
}
-void
-aha_find_probe_range(int ioport, int *port_index, int *max_port_index)
-{
- if (ioport > 0) {
- int i;
-
- for (i = 0;i < AHA_NUM_ISAPORTS; i++)
- if (ioport <= aha_isa_ports[i].addr)
- break;
- if ((i >= AHA_NUM_ISAPORTS)
- || (ioport != aha_isa_ports[i].addr)) {
- printf("\n"
-"aha_isa_probe: Invalid baseport of 0x%x specified.\n"
-"aha_isa_probe: Nearest valid baseport is 0x%x.\n"
-"aha_isa_probe: Failing probe.\n",
- ioport,
- (i < AHA_NUM_ISAPORTS)
- ? aha_isa_ports[i].addr
- : aha_isa_ports[AHA_NUM_ISAPORTS - 1].addr);
- *port_index = *max_port_index = -1;
- return;
- }
- *port_index = *max_port_index = aha_isa_ports[i].bio;
- } else {
- *port_index = 0;
- *max_port_index = AHA_NUM_ISAPORTS - 1;
- }
-}
-
-int
-aha_iop_from_bio(isa_compat_io_t bio_index)
-{
- if (bio_index >= 0 && bio_index < AHA_NUM_ISAPORTS)
- return (aha_board_ports[bio_index]);
- return (-1);
-}
-
static void
ahaallocccbs(struct aha_softc *aha)
{
@@ -793,7 +703,7 @@ ahaallocccbs(struct aha_softc *aha)
next_ccb->sg_list = segs;
next_ccb->sg_list_phys = physaddr;
- next_ccb->flags = ACCB_FREE;
+ next_ccb->flags = BCCB_FREE;
error = bus_dmamap_create(aha->buffer_dmat, /*flags*/0,
&next_ccb->dmamap);
if (error != 0)
@@ -806,54 +716,50 @@ ahaallocccbs(struct aha_softc *aha)
}
/* Reserve a CCB for error recovery */
- if (aha->recovery_accb == NULL) {
- aha->recovery_accb = SLIST_FIRST(&aha->free_aha_ccbs);
+ if (aha->recovery_bccb == NULL) {
+ aha->recovery_bccb = SLIST_FIRST(&aha->free_aha_ccbs);
SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links);
}
}
static __inline void
-ahafreeccb(struct aha_softc *aha, struct aha_ccb *accb)
+ahafreeccb(struct aha_softc *aha, struct aha_ccb *bccb)
{
int s;
s = splcam();
- if ((accb->flags & ACCB_ACTIVE) != 0)
- LIST_REMOVE(&accb->ccb->ccb_h, sim_links.le);
+ if ((bccb->flags & BCCB_ACTIVE) != 0)
+ LIST_REMOVE(&bccb->ccb->ccb_h, sim_links.le);
if (aha->resource_shortage != 0
- && (accb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) {
- accb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
+ && (bccb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) {
+ bccb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
aha->resource_shortage = FALSE;
}
- accb->flags = ACCB_FREE;
- SLIST_INSERT_HEAD(&aha->free_aha_ccbs, accb, links);
- aha->active_ccbs--;
+ bccb->flags = BCCB_FREE;
+ SLIST_INSERT_HEAD(&aha->free_aha_ccbs, bccb, links);
splx(s);
}
static struct aha_ccb*
ahagetccb(struct aha_softc *aha)
{
- struct aha_ccb* accb;
+ struct aha_ccb* bccb;
int s;
s = splcam();
- if ((accb = SLIST_FIRST(&aha->free_aha_ccbs)) != NULL) {
+ if ((bccb = SLIST_FIRST(&aha->free_aha_ccbs)) != NULL) {
SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links);
- aha->active_ccbs++;
} else if (aha->num_ccbs < aha->max_ccbs) {
ahaallocccbs(aha);
- accb = SLIST_FIRST(&aha->free_aha_ccbs);
- if (accb == NULL)
- printf("%s: Can't malloc ACCB\n", aha_name(aha));
- else {
+ bccb = SLIST_FIRST(&aha->free_aha_ccbs);
+ if (bccb == NULL)
+ printf("%s: Can't malloc BCCB\n", aha_name(aha));
+ else
SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links);
- aha->active_ccbs++;
- }
}
splx(s);
- return (accb);
+ return (bccb);
}
static void
@@ -870,13 +776,13 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
case XPT_SCSI_IO: /* Execute the requested I/O operation */
case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */
{
- struct aha_ccb *accb;
+ struct aha_ccb *bccb;
struct aha_hccb *hccb;
/*
- * get a accb to use.
+ * get a bccb to use.
*/
- if ((accb = ahagetccb(aha)) == NULL) {
+ if ((bccb = ahagetccb(aha)) == NULL) {
int s;
s = splcam();
@@ -888,17 +794,17 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
return;
}
- hccb = &accb->hccb;
+ hccb = &bccb->hccb;
/*
- * So we can find the ACCB when an abort is requested
+ * So we can find the BCCB when an abort is requested
*/
- accb->ccb = ccb;
- ccb->ccb_h.ccb_accb_ptr = accb;
+ bccb->ccb = ccb;
+ ccb->ccb_h.ccb_bccb_ptr = bccb;
ccb->ccb_h.ccb_aha_ptr = aha;
/*
- * Put all the arguments for the xfer in the accb
+ * Put all the arguments for the xfer in the bccb
*/
hccb->target = ccb->ccb_h.target_id;
hccb->lun = ccb->ccb_h.target_lun;
@@ -911,13 +817,13 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
csio = &ccb->csio;
ccbh = &csio->ccb_h;
- hccb->opcode = aha->ccb_ccb_opcode;
+ hccb->opcode = INITIATOR_CCB_WRESID;
hccb->datain = (ccb->ccb_h.flags & CAM_DIR_IN) != 0;
hccb->dataout = (ccb->ccb_h.flags & CAM_DIR_OUT) != 0;
hccb->cmd_len = csio->cdb_len;
if (hccb->cmd_len > sizeof(hccb->scsi_cdb)) {
ccb->ccb_h.status = CAM_REQ_INVALID;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
return;
}
@@ -929,7 +835,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
} else {
/* I guess I could map it in... */
ccbh->status = CAM_REQ_INVALID;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
return;
}
@@ -955,11 +861,11 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
s = splsoftvm();
error = bus_dmamap_load(
aha->buffer_dmat,
- accb->dmamap,
+ bccb->dmamap,
csio->data_ptr,
csio->dxfer_len,
ahaexecuteccb,
- accb,
+ bccb,
/*flags*/0);
if (error == EINPROGRESS) {
/*
@@ -982,7 +888,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
seg.ds_addr =
(bus_addr_t)csio->data_ptr;
seg.ds_len = csio->dxfer_len;
- ahaexecuteccb(accb, &seg, 1, 0);
+ ahaexecuteccb(bccb, &seg, 1, 0);
}
} else {
struct bus_dma_segment *segs;
@@ -1000,11 +906,11 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
/* Just use the segments provided */
segs = (struct bus_dma_segment *)
csio->data_ptr;
- ahaexecuteccb(accb, segs,
+ ahaexecuteccb(bccb, segs,
csio->sglist_cnt, 0);
}
} else {
- ahaexecuteccb(accb, NULL, 0, 0);
+ ahaexecuteccb(bccb, NULL, 0, 0);
}
} else {
hccb->opcode = INITIATOR_BUS_DEV_RESET;
@@ -1013,7 +919,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
hccb->dataout = TRUE;
hccb->cmd_len = 0;
hccb->sense_len = 0;
- ahaexecuteccb(accb, NULL, 0, 0);
+ ahaexecuteccb(bccb, NULL, 0, 0);
}
break;
}
@@ -1138,14 +1044,14 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
static void
ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
{
- struct aha_ccb *accb;
+ struct aha_ccb *bccb;
union ccb *ccb;
struct aha_softc *aha;
int s;
u_int32_t paddr;
- accb = (struct aha_ccb *)arg;
- ccb = accb->ccb;
+ bccb = (struct aha_ccb *)arg;
+ ccb = bccb->ccb;
aha = (struct aha_softc *)ccb->ccb_h.ccb_aha_ptr;
if (error != 0) {
@@ -1156,7 +1062,7 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
ccb->ccb_h.status = CAM_REQ_TOO_BIG|CAM_DEV_QFRZN;
}
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
return;
}
@@ -1169,7 +1075,7 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
end_seg = dm_segs + nseg;
/* Copy the segments into our SG list */
- sg = accb->sg_list;
+ sg = bccb->sg_list;
while (dm_segs < end_seg) {
ahautoa24(dm_segs->ds_len, sg->len);
ahautoa24(dm_segs->ds_addr, sg->addr);
@@ -1178,13 +1084,13 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
if (nseg > 1) {
- accb->hccb.opcode = aha->ccb_sg_opcode;
+ bccb->hccb.opcode = INITIATOR_SG_CCB_WRESID;
ahautoa24((sizeof(aha_sg_t) * nseg),
- accb->hccb.data_len);
- ahautoa24(accb->sg_list_phys, accb->hccb.data_addr);
+ bccb->hccb.data_len);
+ ahautoa24(bccb->sg_list_phys, bccb->hccb.data_addr);
} else {
- bcopy(accb->sg_list->len, accb->hccb.data_len, 3);
- bcopy(accb->sg_list->addr, accb->hccb.data_addr, 3);
+ bcopy(bccb->sg_list->len, bccb->hccb.data_len, 3);
+ bcopy(bccb->sg_list->addr, bccb->hccb.data_addr, 3);
}
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN)
@@ -1192,12 +1098,12 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
else
op = BUS_DMASYNC_PREWRITE;
- bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op);
+ bus_dmamap_sync(aha->buffer_dmat, bccb->dmamap, op);
} else {
- accb->hccb.opcode = INITIATOR_CCB;
- ahautoa24(0, accb->hccb.data_len);
- ahautoa24(0, accb->hccb.data_addr);
+ bccb->hccb.opcode = INITIATOR_CCB_WRESID;
+ ahautoa24(0, bccb->hccb.data_len);
+ ahautoa24(0, bccb->hccb.data_addr);
}
s = splcam();
@@ -1208,47 +1114,28 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
*/
if (ccb->ccb_h.status != CAM_REQ_INPROG) {
if (nseg != 0)
- bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
- ahafreeccb(aha, accb);
+ bus_dmamap_unload(aha->buffer_dmat, bccb->dmamap);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
splx(s);
return;
}
- accb->flags = ACCB_ACTIVE;
+ bccb->flags = BCCB_ACTIVE;
ccb->ccb_h.status |= CAM_SIM_QUEUED;
LIST_INSERT_HEAD(&aha->pending_ccbs, &ccb->ccb_h, sim_links.le);
ccb->ccb_h.timeout_ch =
- timeout(ahatimeout, (caddr_t)accb,
+ timeout(ahatimeout, (caddr_t)bccb,
(ccb->ccb_h.timeout * hz) / 1000);
/* Tell the adapter about this command */
- if (aha->cur_outbox->action_code != AMBO_FREE) {
- /*
- * We should never encounter a busy mailbox.
- * If we do, warn the user, and treat it as
- * a resource shortage. If the controller is
- * hung, one of the pending transactions will
- * timeout causing us to start recovery operations.
- */
- printf("%s: Encountered busy mailbox with %d out of %d "
- "commands active!!!", aha_name(aha), aha->active_ccbs,
- aha->max_ccbs);
- untimeout(ahatimeout, accb, ccb->ccb_h.timeout_ch);
- if (nseg != 0)
- bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
- ahafreeccb(aha, accb);
- aha->resource_shortage = TRUE;
- xpt_freeze_simq(aha->sim, /*count*/1);
- ccb->ccb_h.status = CAM_REQUEUE_REQ;
- xpt_done(ccb);
- return;
- }
- paddr = ahaccbvtop(aha, accb);
+ paddr = ahaccbvtop(aha, bccb);
ahautoa24(paddr, aha->cur_outbox->ccb_addr);
- aha->cur_outbox->action_code = AMBO_START;
- aha_outb(aha, COMMAND_REG, AOP_START_MBOX);
+ if (aha->cur_outbox->action_code != BMBO_FREE)
+ panic("%s: Too few mailboxes or to many ccbs???", aha_name(aha));
+ aha->cur_outbox->action_code = BMBO_START;
+ aha_outb(aha, COMMAND_REG, BOP_START_MBOX);
ahanextoutbox(aha);
splx(s);
@@ -1270,13 +1157,13 @@ aha_intr(void *arg)
aha_outb(aha, CONTROL_REG, RESET_INTR);
if ((intstat & IMB_LOADED) != 0) {
- while (aha->cur_inbox->comp_code != AMBI_FREE) {
+ while (aha->cur_inbox->comp_code != BMBI_FREE) {
u_int32_t paddr;
paddr = aha_a24tou(aha->cur_inbox->ccb_addr);
ahadone(aha,
ahaccbptov(aha, paddr),
aha->cur_inbox->comp_code);
- aha->cur_inbox->comp_code = AMBI_FREE;
+ aha->cur_inbox->comp_code = BMBI_FREE;
ahanextinbox(aha);
}
}
@@ -1288,17 +1175,17 @@ aha_intr(void *arg)
}
static void
-ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_code)
+ahadone(struct aha_softc *aha, struct aha_ccb *bccb, aha_mbi_comp_code_t comp_code)
{
union ccb *ccb;
struct ccb_scsiio *csio;
- ccb = accb->ccb;
- csio = &accb->ccb->csio;
+ ccb = bccb->ccb;
+ csio = &bccb->ccb->csio;
- if ((accb->flags & ACCB_ACTIVE) == 0) {
- printf("%s: ahadone - Attempt to free non-active ACCB %p\n",
- aha_name(aha), (void *)accb);
+ if ((bccb->flags & BCCB_ACTIVE) == 0) {
+ printf("%s: ahadone - Attempt to free non-active BCCB %p\n",
+ aha_name(aha), (void *)bccb);
return;
}
@@ -1309,13 +1196,13 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
op = BUS_DMASYNC_POSTREAD;
else
op = BUS_DMASYNC_POSTWRITE;
- bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op);
- bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
+ bus_dmamap_sync(aha->buffer_dmat, bccb->dmamap, op);
+ bus_dmamap_unload(aha->buffer_dmat, bccb->dmamap);
}
- if (accb == aha->recovery_accb) {
+ if (bccb == aha->recovery_bccb) {
/*
- * The recovery ACCB does not have a CCB associated
+ * The recovery BCCB does not have a CCB associated
* with it, so short circuit the normal error handling.
* We now traverse our list of pending CCBs and process
* any that were terminated by the recovery CCBs action.
@@ -1329,7 +1216,7 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
/* Notify all clients that a BDR occured */
error = xpt_create_path(&path, /*periph*/NULL,
cam_sim_path(aha->sim),
- accb->hccb.target,
+ bccb->hccb.target,
CAM_LUN_WILDCARD);
if (error == CAM_REQ_CMP)
@@ -1337,16 +1224,16 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
ccb_h = LIST_FIRST(&aha->pending_ccbs);
while (ccb_h != NULL) {
- struct aha_ccb *pending_accb;
+ struct aha_ccb *pending_bccb;
- pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr;
- if (pending_accb->hccb.target == accb->hccb.target) {
- pending_accb->hccb.ahastat = AHASTAT_HA_BDR;
+ pending_bccb = (struct aha_ccb *)ccb_h->ccb_bccb_ptr;
+ if (pending_bccb->hccb.target == bccb->hccb.target) {
+ pending_bccb->hccb.ahastat = AHASTAT_HA_BDR;
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
- ahadone(aha, pending_accb, AMBI_ERROR);
+ ahadone(aha, pending_bccb, BMBI_ERROR);
} else {
ccb_h->timeout_ch =
- timeout(ahatimeout, (caddr_t)pending_accb,
+ timeout(ahatimeout, (caddr_t)pending_bccb,
(ccb_h->timeout * hz) / 1000);
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
}
@@ -1355,35 +1242,29 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
return;
}
- untimeout(ahatimeout, accb, ccb->ccb_h.timeout_ch);
+ untimeout(ahatimeout, bccb, ccb->ccb_h.timeout_ch);
switch (comp_code) {
- case AMBI_FREE:
+ case BMBI_FREE:
printf("%s: ahadone - CCB completed with free status!\n",
aha_name(aha));
break;
- case AMBI_NOT_FOUND:
+ case BMBI_NOT_FOUND:
printf("%s: ahadone - CCB Abort failed to find CCB\n",
aha_name(aha));
break;
- case AMBI_ABORT:
- case AMBI_ERROR:
+ case BMBI_ABORT:
+ case BMBI_ERROR:
/* An error occured */
- if (accb->hccb.opcode < INITIATOR_CCB_WRESID)
- csio->resid = 0;
- else
- csio->resid = aha_a24tou(accb->hccb.data_len);
- switch(accb->hccb.ahastat) {
+ switch(bccb->hccb.ahastat) {
case AHASTAT_DATARUN_ERROR:
- {
- if (csio->resid <= 0) {
+ if (bccb->hccb.data_len <= 0) {
csio->ccb_h.status = CAM_DATA_RUN_ERR;
break;
}
/* FALLTHROUGH */
- }
case AHASTAT_NOERROR:
- csio->scsi_status = accb->hccb.sdstat;
+ csio->scsi_status = bccb->hccb.sdstat;
csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
switch(csio->scsi_status) {
case SCSI_STATUS_CHECK_COND:
@@ -1393,10 +1274,10 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
* The aha writes the sense data at different
* offsets based on the scsi cmd len
*/
- bcopy((caddr_t) &accb->hccb.scsi_cdb +
- accb->hccb.cmd_len,
+ bcopy((caddr_t) &bccb->hccb.scsi_cdb +
+ bccb->hccb.cmd_len,
(caddr_t) &csio->sense_data,
- accb->hccb.sense_len);
+ bccb->hccb.sense_len);
break;
default:
break;
@@ -1404,6 +1285,7 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
csio->ccb_h.status = CAM_REQ_CMP;
break;
}
+ csio->resid = aha_a24tou(bccb->hccb.data_len);
break;
case AHASTAT_SELTIMEOUT:
csio->ccb_h.status = CAM_SEL_TIMEOUT;
@@ -1418,16 +1300,8 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
panic("%s: Inavlid Action code", aha_name(aha));
break;
case AHASTAT_INVALID_OPCODE:
- if (accb->hccb.opcode < INITIATOR_CCB_WRESID)
- panic("%s: Invalid CCB Opcode %x hccb = %p",
- aha_name(aha), accb->hccb.opcode,
- &accb->hccb);
- printf("%s: AHA-1540A detected, compensating\n",
- aha_name(aha));
- aha->ccb_sg_opcode = INITIATOR_SG_CCB;
- aha->ccb_ccb_opcode = INITIATOR_CCB;
- xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
- csio->ccb_h.status = CAM_REQUEUE_REQ;
+ panic("%s: Inavlid CCB Opcode code %x hccb = %p",
+ aha_name(aha), bccb->hccb.opcode, &bccb->hccb);
break;
case AHASTAT_LINKED_CCB_LUN_MISMATCH:
/* We don't even support linked commands... */
@@ -1438,11 +1312,11 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
break;
case AHASTAT_HA_SCSI_BUS_RESET:
if ((csio->ccb_h.status & CAM_STATUS_MASK)
- != CAM_CMD_TIMEOUT)
+ != CAM_CMD_TIMEOUT)
csio->ccb_h.status = CAM_SCSI_BUS_RESET;
break;
case AHASTAT_HA_BDR:
- if ((accb->flags & ACCB_DEVICE_RESET) == 0)
+ if ((bccb->flags & BCCB_DEVICE_RESET) == 0)
csio->ccb_h.status = CAM_BDR_SENT;
else
csio->ccb_h.status = CAM_CMD_TIMEOUT;
@@ -1452,19 +1326,18 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
xpt_freeze_devq(csio->ccb_h.path, /*count*/1);
csio->ccb_h.status |= CAM_DEV_QFRZN;
}
- if ((accb->flags & ACCB_RELEASE_SIMQ) != 0)
+ if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0)
ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
break;
- case AMBI_OK:
+ case BMBI_OK:
/* All completed without incident */
/* XXX DO WE NEED TO COPY SENSE BYTES HERE???? XXX */
- /* I don't think so since it works???? */
ccb->ccb_h.status |= CAM_REQ_CMP;
- if ((accb->flags & ACCB_RELEASE_SIMQ) != 0)
+ if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0)
ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
- ahafreeccb(aha, accb);
+ ahafreeccb(aha, bccb);
xpt_done(ccb);
break;
}
@@ -1552,11 +1425,11 @@ ahareset(struct aha_softc* aha, int hard_reset)
* Perform completion processing for all outstanding CCBs.
*/
while ((ccb_h = LIST_FIRST(&aha->pending_ccbs)) != NULL) {
- struct aha_ccb *pending_accb;
+ struct aha_ccb *pending_bccb;
- pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr;
- pending_accb->hccb.ahastat = AHASTAT_HA_SCSI_BUS_RESET;
- ahadone(aha, pending_accb, AMBI_ERROR);
+ pending_bccb = (struct aha_ccb *)ccb_h->ccb_bccb_ptr;
+ pending_bccb->hccb.ahastat = AHASTAT_HA_SCSI_BUS_RESET;
+ ahadone(aha, pending_bccb, BMBI_ERROR);
}
return (0);
@@ -1575,13 +1448,11 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
u_int intstat;
u_int reply_buf_size;
int s;
- int cmd_complete;
/* No data returned to start */
reply_buf_size = reply_len;
reply_len = 0;
intstat = 0;
- cmd_complete = 0;
aha->command_cmp = 0;
/*
@@ -1617,13 +1488,10 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
status = aha_inb(aha, STATUS_REG);
intstat = aha_inb(aha, INTSTAT_REG);
if ((intstat & (INTR_PENDING|CMD_COMPLETE))
- == (INTR_PENDING|CMD_COMPLETE)) {
- cmd_complete = 1;
+ == (INTR_PENDING|CMD_COMPLETE))
break;
- }
if (aha->command_cmp != 0) {
status = aha->latched_status;
- cmd_complete = 1;
break;
}
if ((status & DATAIN_REG_READY) != 0)
@@ -1643,7 +1511,7 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
* For all other commands, we wait for any output data
* and the final comand completion interrupt.
*/
- while (cmd_complete == 0 && --cmd_timeout) {
+ while (--cmd_timeout) {
status = aha_inb(aha, STATUS_REG);
intstat = aha_inb(aha, INTSTAT_REG);
@@ -1741,7 +1609,7 @@ ahainitmboxes(struct aha_softc *aha)
/* Tell the adapter about them */
init_mbox.num_mboxes = aha->num_boxes;
ahautoa24(aha->mailbox_physbase, init_mbox.base_addr);
- error = aha_cmd(aha, AOP_INITIALIZE_MBOX, (u_int8_t *)&init_mbox,
+ error = aha_cmd(aha, BOP_INITIALIZE_MBOX, (u_int8_t *)&init_mbox,
/*parmlen*/sizeof(init_mbox), /*reply_buf*/NULL,
/*reply_len*/0, DEFAULT_CMD_TIMEOUT);
@@ -1774,7 +1642,7 @@ ahafetchtransinfo(struct aha_softc *aha, struct ccb_trans_settings* cts)
* the sync info for older models.
*/
param = sizeof(setup_info);
- error = aha_cmd(aha, AOP_INQUIRE_SETUP_INFO, &param, /*paramlen*/1,
+ error = aha_cmd(aha, BOP_INQUIRE_SETUP_INFO, &param, /*paramlen*/1,
(u_int8_t*)&setup_info, sizeof(setup_info),
DEFAULT_CMD_TIMEOUT);
@@ -1844,24 +1712,24 @@ ahapoll(struct cam_sim *sim)
void
ahatimeout(void *arg)
{
- struct aha_ccb *accb;
+ struct aha_ccb *bccb;
union ccb *ccb;
struct aha_softc *aha;
int s;
u_int32_t paddr;
- accb = (struct aha_ccb *)arg;
- ccb = accb->ccb;
+ bccb = (struct aha_ccb *)arg;
+ ccb = bccb->ccb;
aha = (struct aha_softc *)ccb->ccb_h.ccb_aha_ptr;
xpt_print_path(ccb->ccb_h.path);
- printf("CCB %p - timed out\n", (void *)accb);
+ printf("CCB %p - timed out\n", (void *)bccb);
s = splcam();
- if ((accb->flags & ACCB_ACTIVE) == 0) {
+ if ((bccb->flags & BCCB_ACTIVE) == 0) {
xpt_print_path(ccb->ccb_h.path);
printf("CCB %p - timed out CCB already completed\n",
- (void *)accb);
+ (void *)bccb);
splx(s);
return;
}
@@ -1876,26 +1744,26 @@ ahatimeout(void *arg)
* in attempting to handle errors in parrallel. Timeouts will
* be reinstated when the recovery process ends.
*/
- if ((accb->flags & ACCB_DEVICE_RESET) == 0) {
+ if ((bccb->flags & BCCB_DEVICE_RESET) == 0) {
struct ccb_hdr *ccb_h;
- if ((accb->flags & ACCB_RELEASE_SIMQ) == 0) {
+ if ((bccb->flags & BCCB_RELEASE_SIMQ) == 0) {
xpt_freeze_simq(aha->sim, /*count*/1);
- accb->flags |= ACCB_RELEASE_SIMQ;
+ bccb->flags |= BCCB_RELEASE_SIMQ;
}
ccb_h = LIST_FIRST(&aha->pending_ccbs);
while (ccb_h != NULL) {
- struct aha_ccb *pending_accb;
+ struct aha_ccb *pending_bccb;
- pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr;
- untimeout(ahatimeout, pending_accb, ccb_h->timeout_ch);
+ pending_bccb = (struct aha_ccb *)ccb_h->ccb_bccb_ptr;
+ untimeout(ahatimeout, pending_bccb, ccb_h->timeout_ch);
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
}
}
- if ((accb->flags & ACCB_DEVICE_RESET) != 0
- || aha->cur_outbox->action_code != AMBO_FREE) {
+ if ((bccb->flags & BCCB_DEVICE_RESET) != 0
+ || aha->cur_outbox->action_code != BMBO_FREE) {
/*
* Try a full host adapter/SCSI bus reset.
* We do this only if we have already attempted
@@ -1917,22 +1785,22 @@ ahatimeout(void *arg)
* If this fails, we'll get another timeout 2 seconds
* later which will attempt a bus reset.
*/
- accb->flags |= ACCB_DEVICE_RESET;
- ccb->ccb_h.timeout_ch = timeout(ahatimeout, (caddr_t)accb, 2 * hz);
- aha->recovery_accb->hccb.opcode = INITIATOR_BUS_DEV_RESET;
+ bccb->flags |= BCCB_DEVICE_RESET;
+ ccb->ccb_h.timeout_ch = timeout(ahatimeout, (caddr_t)bccb, 2 * hz);
+ aha->recovery_bccb->hccb.opcode = INITIATOR_BUS_DEV_RESET;
/* No Data Transfer */
- aha->recovery_accb->hccb.datain = TRUE;
- aha->recovery_accb->hccb.dataout = TRUE;
- aha->recovery_accb->hccb.ahastat = 0;
- aha->recovery_accb->hccb.sdstat = 0;
- aha->recovery_accb->hccb.target = ccb->ccb_h.target_id;
+ aha->recovery_bccb->hccb.datain = TRUE;
+ aha->recovery_bccb->hccb.dataout = TRUE;
+ aha->recovery_bccb->hccb.ahastat = 0;
+ aha->recovery_bccb->hccb.sdstat = 0;
+ aha->recovery_bccb->hccb.target = ccb->ccb_h.target_id;
/* Tell the adapter about this command */
- paddr = ahaccbvtop(aha, aha->recovery_accb);
+ paddr = ahaccbvtop(aha, aha->recovery_bccb);
ahautoa24(paddr, aha->cur_outbox->ccb_addr);
- aha->cur_outbox->action_code = AMBO_START;
- aha_outb(aha, COMMAND_REG, AOP_START_MBOX);
+ aha->cur_outbox->action_code = BMBO_START;
+ aha_outb(aha, COMMAND_REG, BOP_START_MBOX);
ahanextoutbox(aha);
}
diff --git a/sys/dev/aha/ahareg.h b/sys/dev/aha/ahareg.h
index 82f3f4a49bd4b..7af8b537d40d0 100644
--- a/sys/dev/aha/ahareg.h
+++ b/sys/dev/aha/ahareg.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahareg.h,v 1.4 1998/11/10 06:44:42 gibbs Exp $
+ * $Id: ahareg.h,v 1.2 1998/10/01 04:53:55 imp Exp $
*/
#ifndef _AHAREG_H_
@@ -101,41 +101,41 @@
* Opcodes for Adapter commands.
*/
typedef enum {
- AOP_NOP = 0x00,
- AOP_INITIALIZE_MBOX = 0x01,
- AOP_START_MBOX = 0x02,
- AOP_EXECUTE_BIOS_CMD = 0x03,
- AOP_INQUIRE_BOARD_ID = 0x04,
- AOP_ENABLE_OMBR_INT = 0x05,
- AOP_SET_SEL_TIMOUT = 0x06,
- AOP_SET_TIME_ON_BUS = 0x07,
- AOP_SET_TIME_OFF_BUS = 0x08,
- AOP_SET_BUS_TRANS_RATE = 0x09,
- AOP_INQUIRE_INST_LDEVS = 0x0A,
- AOP_INQUIRE_CONFIG = 0x0B,
- AOP_ENABLE_TARGET_MODE = 0x0C,
- AOP_INQUIRE_SETUP_INFO = 0x0D,
- AOP_WRITE_LRAM = 0x1A,
- AOP_READ_LRAM = 0x1B,
- AOP_WRITE_CHIP_FIFO = 0x1C,
- AOP_READ_CHIP_FIFO = 0x1D,
- AOP_ECHO_DATA_BYTE = 0x1F,
- AOP_ADAPTER_DIAGNOSTICS = 0x20,
- AOP_SET_ADAPTER_OPTIONS = 0x21,
- AOP_SET_EEPROM = 0x22,
- AOP_RETURN_EEPROM = 0x23,
- AOP_ENABLE_SHADOW_RAM = 0x24,
- AOP_INIT_BIOS_MBOX = 0x25,
- AOP_SET_BIOS_BANK_1 = 0x26,
- AOP_SET_BIOS_BANK_2 = 0x27,
- AOP_RETURN_EXT_BIOS_INFO= 0x28,
- AOP_MBOX_IF_ENABLE = 0x29,
- AOP_SCSI_TERM_STATUS = 0x2C,
- AOP_INQUIRE_SCAM_DEV = 0x2D,
- AOP_SCSI_DEV_TABLE = 0x2E,
- AOP_SCAM_OP = 0x2F,
- AOP_START_BIOS_CMD = 0x82,
- AOP_INQUIRE_ESETUP_INFO = 0x8D
+ BOP_NOP = 0x00,
+ BOP_INITIALIZE_MBOX = 0x01,
+ BOP_START_MBOX = 0x02,
+ BOP_EXECUTE_BIOS_CMD = 0x03,
+ BOP_INQUIRE_BOARD_ID = 0x04,
+ BOP_ENABLE_OMBR_INT = 0x05,
+ BOP_SET_SEL_TIMOUT = 0x06,
+ BOP_SET_TIME_ON_BUS = 0x07,
+ BOP_SET_TIME_OFF_BUS = 0x08,
+ BOP_SET_BUS_TRANS_RATE = 0x09,
+ BOP_INQUIRE_INST_LDEVS = 0x0A,
+ BOP_INQUIRE_CONFIG = 0x0B,
+ BOP_ENABLE_TARGET_MODE = 0x0C,
+ BOP_INQUIRE_SETUP_INFO = 0x0D,
+ BOP_WRITE_LRAM = 0x1A,
+ BOP_READ_LRAM = 0x1B,
+ BOP_WRITE_CHIP_FIFO = 0x1C,
+ BOP_READ_CHIP_FIFO = 0x1D,
+ BOP_ECHO_DATA_BYTE = 0x1F,
+ BOP_ADAPTER_DIAGNOSTICS = 0x20,
+ BOP_SET_ADAPTER_OPTIONS = 0x21,
+ BOP_SET_EEPROM = 0x22,
+ BOP_RETURN_EEPROM = 0x23,
+ BOP_ENABLE_SHADOW_RAM = 0x24,
+ BOP_INIT_BIOS_MBOX = 0x25,
+ BOP_SET_BIOS_BANK_1 = 0x26,
+ BOP_SET_BIOS_BANK_2 = 0x27,
+ BOP_RETURN_EXT_BIOS_INFO= 0x28,
+ BOP_MBOX_IF_ENABLE = 0x29,
+ BOP_SCSI_TERM_STATUS = 0x2C,
+ BOP_INQUIRE_SCAM_DEV = 0x2D,
+ BOP_SCSI_DEV_TABLE = 0x2E,
+ BOP_SCAM_OP = 0x2F,
+ BOP_START_BIOS_CMD = 0x82,
+ BOP_INQUIRE_ESETUP_INFO = 0x8D
} aha_op_t;
/************** Definitions of Multi-byte commands and responses ************/
@@ -217,9 +217,10 @@ typedef struct {
struct aha_isa_port {
u_int16_t addr;
u_int8_t probed;
- u_int8_t bio; /* board IO offset */
};
+extern struct aha_isa_port aha_isa_ports[];
+
#define AHA_NUM_ISAPORTS 6
typedef enum {
@@ -245,9 +246,9 @@ typedef struct {
/********************** Mail Box definitions *******************************/
typedef enum {
- AMBO_FREE = 0x0, /* MBO intry is free */
- AMBO_START = 0x1, /* MBO activate entry */
- AMBO_ABORT = 0x2 /* MBO abort entry */
+ BMBO_FREE = 0x0, /* MBO intry is free */
+ BMBO_START = 0x1, /* MBO activate entry */
+ BMBO_ABORT = 0x2 /* MBO abort entry */
} aha_mbo_action_code_t;
typedef struct aha_mbox_out {
@@ -256,11 +257,11 @@ typedef struct aha_mbox_out {
} aha_mbox_out_t;
typedef enum {
- AMBI_FREE = 0x0, /* MBI entry is free */
- AMBI_OK = 0x1, /* completed without error */
- AMBI_ABORT = 0x2, /* aborted ccb */
- AMBI_NOT_FOUND = 0x3, /* Tried to abort invalid CCB */
- AMBI_ERROR = 0x4 /* Completed with error */
+ BMBI_FREE = 0x0, /* MBI entry is free */
+ BMBI_OK = 0x1, /* completed without error */
+ BMBI_ABORT = 0x2, /* aborted ccb */
+ BMBI_NOT_FOUND = 0x3, /* Tried to abort invalid CCB */
+ BMBI_ERROR = 0x4 /* Completed with error */
} aha_mbi_comp_code_t;
typedef struct aha_mbox_in {
@@ -312,11 +313,11 @@ struct aha_hccb {
};
typedef enum {
- ACCB_FREE = 0x0,
- ACCB_ACTIVE = 0x1,
- ACCB_DEVICE_RESET = 0x2,
- ACCB_RELEASE_SIMQ = 0x4
-} accb_flags_t;
+ BCCB_FREE = 0x0,
+ BCCB_ACTIVE = 0x1,
+ BCCB_DEVICE_RESET = 0x2,
+ BCCB_RELEASE_SIMQ = 0x4
+} bccb_flags_t;
struct aha_ccb {
struct aha_hccb hccb; /* hccb assumed to be at 0 */
@@ -347,15 +348,12 @@ struct aha_softc {
struct aha_ccb *aha_ccb_array;
SLIST_HEAD(,aha_ccb) free_aha_ccbs;
LIST_HEAD(,ccb_hdr) pending_ccbs;
- u_int active_ccbs;
u_int32_t aha_ccb_physbase;
- aha_ccb_opcode_t ccb_sg_opcode;
- aha_ccb_opcode_t ccb_ccb_opcode;
aha_mbox_in_t *in_boxes;
aha_mbox_out_t *out_boxes;
struct scsi_sense_data *sense_buffers;
u_int32_t sense_buffers_physbase;
- struct aha_ccb *recovery_accb;
+ struct aha_ccb *recovery_bccb;
u_int num_boxes;
bus_dma_tag_t parent_dmat; /*
* All dmat's derive from
@@ -412,11 +410,6 @@ char * aha_name(struct aha_softc *aha);
int aha_check_probed_iop(u_int ioport);
void aha_mark_probed_bio(isa_compat_io_t port);
void aha_mark_probed_iop(u_int ioport);
-void aha_find_probe_range(int ioport,
- int *port_index,
- int *max_port_index);
-
-int aha_iop_from_bio(isa_compat_io_t bio_index);
#define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */
int aha_cmd(struct aha_softc *aha, aha_op_t opcode,
@@ -430,18 +423,4 @@ int aha_cmd(struct aha_softc *aha, aha_op_t opcode,
#define aha_outb(aha, port, value) \
bus_space_write_1((aha)->tag, (aha)->bsh, port, value)
-
-#ifndef EXTRA_AHA
-#if NPNP > 0
-#define EXTRA_AHA MAX_PNP_CARDS
-#else
-#define EXTRA_AHA 0
-#endif
-#endif
-
-#define NAHATOT (NAHA + EXTRA_AHA)
-
-#define AHA1542_PNP 0x42159004 /* ADP1542 */
-#define AHA1542_PNPCOMPAT 0xA000D040 /* PNP00A0 */
-
#endif /* _AHA_H_ */
diff --git a/sys/dev/aic7xxx/Makefile b/sys/dev/aic7xxx/Makefile
index b47dab3520815..0a74ca9c8c474 100644
--- a/sys/dev/aic7xxx/Makefile
+++ b/sys/dev/aic7xxx/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 1997/09/27 19:37:22 gibbs Exp $
+# $Id: Makefile,v 1.3 1997/09/03 03:44:32 gibbs Exp $
PROG= aicasm
@@ -19,7 +19,7 @@ LDADD+= -ll
DEPENDFILE=
.endif
-CFLAGS+= -I/usr/include -I.
+CFLAGS+= -I.
NOMAN= noman
.ifdef DEBUG
diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c
index e442be536b9e6..48014aef3e1a2 100644
--- a/sys/dev/aic7xxx/aic7xxx.c
+++ b/sys/dev/aic7xxx/aic7xxx.c
@@ -5,7 +5,7 @@
* pci/ahc_pci.c 3985, 3980, 3940, 2940, aic7895, aic7890,
* aic7880, aic7870, aic7860, and aic7850 controllers
*
- * Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999 Justin T. Gibbs.
+ * Copyright (c) 1994, 1995, 1996, 1997, 1998 Justin T. Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.c,v 1.15 1999/01/14 06:14:14 gibbs Exp $
+ * $Id: aic7xxx.c,v 1.8 1998/10/15 18:21:47 gibbs Exp $
*/
/*
* A few notes on features of the driver.
@@ -133,8 +133,9 @@
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define ALL_TARGETS (~0)
+#define ALL_LUNS (~0)
#define ALL_CHANNELS '\0'
-#define ALL_TARGETS_MASK 0xFFFF
#define SIM_IS_SCSIBUS_B(ahc, sim) \
(sim == ahc->sim_b)
@@ -154,22 +155,11 @@
#define ccb_scb_ptr spriv_ptr0
#define ccb_ahc_ptr spriv_ptr1
-typedef enum {
- ROLE_UNKNOWN,
- ROLE_INITIATOR,
- ROLE_TARGET,
-} role_t;
-
struct ahc_devinfo {
int target_offset;
u_int16_t target_mask;
u_int8_t target;
- u_int8_t lun;
char channel;
- role_t role; /*
- * Only guaranteed to be correct if not
- * in the busfree state.
- */
};
typedef enum {
@@ -188,10 +178,9 @@ static int ahc_debug = AHC_DEBUG;
void ahc_pci_intr(struct ahc_softc *ahc);
#endif
-#if UNUSED
static void ahc_dump_targcmd(struct target_cmd *cmd);
-#endif
static void ahc_shutdown(int howto, void *arg);
+static void ahcminphys(struct buf *bp);
static cam_status
ahc_find_tmode_devs(struct ahc_softc *ahc,
struct cam_sim *sim, union ccb *ccb,
@@ -215,33 +204,16 @@ static struct scb *
static void ahc_fetch_devinfo(struct ahc_softc *ahc,
struct ahc_devinfo *devinfo);
static void ahc_compile_devinfo(struct ahc_devinfo *devinfo,
- u_int target, u_int lun, char channel,
- role_t role);
+ u_int target, char channel);
static u_int ahc_abort_wscb(struct ahc_softc *ahc, u_int scbpos, u_int prev);
static void ahc_done(struct ahc_softc *ahc, struct scb *scbp);
-static void ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim,
- union ccb *ccb);
-static int ahc_handle_target_cmd(struct ahc_softc *ahc,
- struct target_cmd *cmd);
+static void ahc_handle_target_cmd(struct ahc_softc *ahc);
static void ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat);
static void ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat);
-static void ahc_build_transfer_msg(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
-static void ahc_setup_initiator_msgout(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct scb *scb);
-static void ahc_setup_target_msgin(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
-static int ahc_handle_msg_reject(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
-static void ahc_clear_msg_state(struct ahc_softc *ahc);
-static void ahc_handle_message_phase(struct ahc_softc *ahc,
- struct cam_path *path);
-static int ahc_sent_msg(struct ahc_softc *ahc, u_int msgtype, int full);
-static int ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
+static void ahc_handle_reqinit(struct ahc_softc *ahc,
+ struct scb *scb);
+static int ahc_parse_msg(struct ahc_softc *ahc, struct scb *scb,
struct ahc_devinfo *devinfo);
-static void ahc_handle_ign_wide_residue(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo);
static void ahc_handle_devreset(struct ahc_softc *ahc, int target,
char channel, cam_status status,
ac_code acode, char *message,
@@ -260,8 +232,6 @@ static void ahc_print_scb(struct scb *scb);
static int ahc_search_qinfifo(struct ahc_softc *ahc, int target,
char channel, int lun, u_int tag,
u_int32_t status, ahc_search_action action);
-static void ahc_abort_ccb(struct ahc_softc *ahc, struct cam_sim *sim,
- union ccb *ccb);
static int ahc_reset_channel(struct ahc_softc *ahc, char channel,
int initiate_reset);
static int ahc_abort_scbs(struct ahc_softc *ahc, int target,
@@ -275,8 +245,6 @@ static void ahc_add_curscb_to_free_list(struct ahc_softc *ahc);
static void ahc_clear_intstat(struct ahc_softc *ahc);
static void ahc_reset_current_bus(struct ahc_softc *ahc);
static struct ahc_syncrate *
- ahc_devlimited_syncrate(struct ahc_softc *ahc, u_int *period);
-static struct ahc_syncrate *
ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,
u_int maxsync);
static u_int ahc_find_period(struct ahc_softc *ahc, u_int scsirate,
@@ -284,13 +252,6 @@ static u_int ahc_find_period(struct ahc_softc *ahc, u_int scsirate,
static void ahc_validate_offset(struct ahc_softc *ahc,
struct ahc_syncrate *syncrate,
u_int *offset, int wide);
-static void ahc_update_target_msg_request(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct ahc_target_tinfo *tinfo,
- int force);
-static int ahc_create_path(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct cam_path **path);
static void ahc_set_syncrate(struct ahc_softc *ahc,
struct ahc_devinfo *devinfo,
struct cam_path *path,
@@ -312,7 +273,6 @@ static void ahc_set_recoveryscb(struct ahc_softc *ahc, struct scb *scb);
static timeout_t
ahc_timeout;
-static __inline int sequencer_paused(struct ahc_softc *ahc);
static __inline void pause_sequencer(struct ahc_softc *ahc);
static __inline void unpause_sequencer(struct ahc_softc *ahc,
int unpause_always);
@@ -335,12 +295,6 @@ ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index)
#define AHC_BUSRESET_DELAY 25 /* Reset delay in us */
-static __inline int
-sequencer_paused(struct ahc_softc *ahc)
-{
- return ((ahc_inb(ahc, HCNTRL) & PAUSE) != 0);
-}
-
static __inline void
pause_sequencer(struct ahc_softc *ahc)
{
@@ -350,15 +304,16 @@ pause_sequencer(struct ahc_softc *ahc)
* Since the sequencer can disable pausing in a critical section, we
* must loop until it actually stops.
*/
- while (sequencer_paused(ahc) == 0)
+ while ((ahc_inb(ahc, HCNTRL) & PAUSE) == 0)
;
}
static __inline void
unpause_sequencer(struct ahc_softc *ahc, int unpause_always)
{
- if (unpause_always
- || (ahc_inb(ahc, INTSTAT) & (SCSIINT | SEQINT | BRKADRINT)) == 0)
+ if ((ahc->flags & AHC_HANDLING_REQINITS) == 0
+ && (unpause_always
+ || (ahc_inb(ahc, INTSTAT) & (SCSIINT | SEQINT | BRKADRINT)) == 0))
ahc_outb(ahc, HCNTRL, ahc->unpause);
}
@@ -418,7 +373,7 @@ ahc_name(struct ahc_softc *ahc)
{
static char name[10];
- snprintf(name, sizeof(name), "ahc%d", ahc->unit);
+ sprintf(name, "ahc%d", ahc->unit);
return (name);
}
@@ -604,30 +559,6 @@ ahc_reset(struct ahc_softc *ahc)
}
/*
- * Called when we have an active connection to a target on the bus,
- * this function finds the nearest syncrate to the input period limited
- * by the capabilities of the bus connectivity of the target.
- */
-static struct ahc_syncrate *
-ahc_devlimited_syncrate(struct ahc_softc *ahc, u_int *period) {
- u_int maxsync;
-
- if ((ahc->features & AHC_ULTRA2) != 0) {
- if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
- && (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
- maxsync = AHC_SYNCRATE_ULTRA2;
- } else {
- maxsync = AHC_SYNCRATE_ULTRA;
- }
- } else if ((ahc->features & AHC_ULTRA) != 0) {
- maxsync = AHC_SYNCRATE_ULTRA;
- } else {
- maxsync = AHC_SYNCRATE_FAST;
- }
- return (ahc_find_syncrate(ahc, period, maxsync));
-}
-
-/*
* Look up the valid period to SCSIRATE conversion in our table.
* Return the period and offset that should be sent to the target
* if this was the beginning of an SDTR.
@@ -721,62 +652,10 @@ ahc_validate_offset(struct ahc_softc *ahc, struct ahc_syncrate *syncrate,
}
static void
-ahc_update_target_msg_request(struct ahc_softc *ahc,
- struct ahc_devinfo *devinfo,
- struct ahc_target_tinfo *tinfo,
- int force)
-{
- int paused;
- u_int targ_msg_req_orig;
-
- targ_msg_req_orig = ahc->targ_msg_req;
- if (tinfo->current.period != tinfo->goal.period
- || tinfo->current.width != tinfo->goal.width
- || (force
- && (tinfo->goal.period != 0
- || tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT)))
- ahc->targ_msg_req |= devinfo->target_mask;
- else
- ahc->targ_msg_req &= ~devinfo->target_mask;
-
- if (ahc->targ_msg_req != targ_msg_req_orig) {
- /* Update the message request bit for this target */
- paused = sequencer_paused(ahc);
-
- if (!paused)
- pause_sequencer(ahc);
-
- ahc_outb(ahc, TARGET_MSG_REQUEST, ahc->targ_msg_req & 0xFF);
- ahc_outb(ahc, TARGET_MSG_REQUEST + 1,
- (ahc->targ_msg_req >> 8) & 0xFF);
-
- if (!paused)
- unpause_sequencer(ahc, /*unpause always*/FALSE);
- }
-}
-
-static int
-ahc_create_path(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
- struct cam_path **path)
-{
- path_id_t path_id;
-
- if (devinfo->channel == 'B')
- path_id = cam_sim_path(ahc->sim_b);
- else
- path_id = cam_sim_path(ahc->sim);
-
- return (xpt_create_path(path, /*periph*/NULL,
- path_id, devinfo->target,
- devinfo->lun));
-}
-
-static void
ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
struct cam_path *path, struct ahc_syncrate *syncrate,
u_int period, u_int offset, u_int type)
{
- struct ahc_target_tinfo *tinfo;
u_int old_period;
u_int old_offset;
@@ -785,16 +664,15 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
offset = 0;
}
- tinfo = &ahc->transinfo[devinfo->target_offset];
- old_period = tinfo->current.period;
- old_offset = tinfo->current.offset;
+ old_period = ahc->transinfo[devinfo->target_offset].current.period;
+ old_offset = ahc->transinfo[devinfo->target_offset].current.offset;
if ((type & AHC_TRANS_CUR) != 0
&& (old_period != period || old_offset != offset)) {
- struct cam_path *path2;
+ struct ccb_trans_settings neg;
u_int scsirate;
- scsirate = tinfo->scsirate;
+ scsirate = ahc->transinfo[devinfo->target_offset].scsirate;
if ((ahc->features & AHC_ULTRA2) != 0) {
scsirate &= ~SXFR_ULTRA2;
@@ -803,8 +681,11 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
scsirate |= syncrate->sxfr_ultra2;
}
- if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE)
+ if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE) {
ahc_outb(ahc, SCSIOFFSET, offset);
+ }
+ ahc_outb(ahc, TARG_OFFSET + devinfo->target_offset,
+ offset);
} else {
scsirate &= ~(SXFR|SOFS);
@@ -833,45 +714,25 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE)
ahc_outb(ahc, SCSIRATE, scsirate);
- tinfo->scsirate = scsirate;
- tinfo->current.period = period;
- tinfo->current.offset = offset;
+ ahc->transinfo[devinfo->target_offset].scsirate = scsirate;
+ ahc->transinfo[devinfo->target_offset].current.period = period;
+ ahc->transinfo[devinfo->target_offset].current.offset = offset;
/* Update the syncrates in any pending scbs */
ahc_update_pending_syncrates(ahc);
/*
- * If possible, tell the SCSI layer about the
+ * Tell the SCSI layer about the
* new transfer parameters.
*/
- /* If possible, update the XPT's notion of our transfer rate */
- path2 = NULL;
- if (path == NULL) {
- int error;
-
- error = ahc_create_path(ahc, devinfo, &path2);
- if (error == CAM_REQ_CMP)
- path = path2;
- else
- path2 = NULL;
- }
-
- if (path != NULL) {
- struct ccb_trans_settings neg;
-
- neg.sync_period = period;
- neg.sync_offset = offset;
- neg.valid = CCB_TRANS_SYNC_RATE_VALID
- | CCB_TRANS_SYNC_OFFSET_VALID;
- xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
- xpt_async(AC_TRANSFER_NEG, path, &neg);
- }
-
- if (path2 != NULL)
- xpt_free_path(path2);
-
+ neg.sync_period = period;
+ neg.sync_offset = offset;
+ neg.valid = CCB_TRANS_SYNC_RATE_VALID
+ | CCB_TRANS_SYNC_OFFSET_VALID;
+ xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
+ xpt_async(AC_TRANSFER_NEG, path, &neg);
if (bootverbose) {
- if (offset != 0) {
+ if (neg.sync_offset != 0) {
printf("%s: target %d synchronous at %sMHz, "
"offset = 0x%x\n", ahc_name(ahc),
devinfo->target, syncrate->rate, offset);
@@ -884,80 +745,57 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
}
if ((type & AHC_TRANS_GOAL) != 0) {
- tinfo->goal.period = period;
- tinfo->goal.offset = offset;
+ ahc->transinfo[devinfo->target_offset].goal.period = period;
+ ahc->transinfo[devinfo->target_offset].goal.offset = offset;
}
if ((type & AHC_TRANS_USER) != 0) {
- tinfo->user.period = period;
- tinfo->user.offset = offset;
+ ahc->transinfo[devinfo->target_offset].user.period = period;
+ ahc->transinfo[devinfo->target_offset].user.offset = offset;
}
-
- ahc_update_target_msg_request(ahc, devinfo, tinfo, /*force*/FALSE);
}
static void
ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
struct cam_path *path, u_int width, u_int type)
{
- struct ahc_target_tinfo *tinfo;
- u_int oldwidth;
+ u_int oldwidth;
- tinfo = &ahc->transinfo[devinfo->target_offset];
- oldwidth = tinfo->current.width;
+ oldwidth = ahc->transinfo[devinfo->target_offset].current.width;
if ((type & AHC_TRANS_CUR) != 0 && oldwidth != width) {
- struct cam_path *path2;
+ struct ccb_trans_settings neg;
u_int scsirate;
- scsirate = tinfo->scsirate;
+ scsirate = ahc->transinfo[devinfo->target_offset].scsirate;
scsirate &= ~WIDEXFER;
if (width == MSG_EXT_WDTR_BUS_16_BIT)
scsirate |= WIDEXFER;
- tinfo->scsirate = scsirate;
+ ahc->transinfo[devinfo->target_offset].scsirate = scsirate;
if ((type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE)
ahc_outb(ahc, SCSIRATE, scsirate);
- tinfo->current.width = width;
-
- /* If possible, update the XPT's notion of our transfer rate */
- path2 = NULL;
- if (path == NULL) {
- int error;
-
- error = ahc_create_path(ahc, devinfo, &path2);
- if (error == CAM_REQ_CMP)
- path = path2;
- else
- path2 = NULL;
- }
-
- if (path != NULL) {
- struct ccb_trans_settings neg;
-
- neg.bus_width = width;
- neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
- xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
- xpt_async(AC_TRANSFER_NEG, path, &neg);
- }
-
- if (path2 != NULL)
- xpt_free_path(path2);
+ ahc->transinfo[devinfo->target_offset].current.width = width;
+ /* Tell the SCSI layer about the new transfer params */
+ neg.bus_width = width;
+ neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
+ xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
+ xpt_async(AC_TRANSFER_NEG, path, &neg);
if (bootverbose) {
printf("%s: target %d using %dbit transfers\n",
ahc_name(ahc), devinfo->target,
- 8 * (0x01 << width));
+ 8 * (0x01 << neg.bus_width));
}
}
- if ((type & AHC_TRANS_GOAL) != 0)
- tinfo->goal.width = width;
- if ((type & AHC_TRANS_USER) != 0)
- tinfo->user.width = width;
-
- ahc_update_target_msg_request(ahc, devinfo, tinfo, /*force*/FALSE);
+ if ((type & AHC_TRANS_GOAL) != 0) {
+ ahc->transinfo[devinfo->target_offset].goal.width = width;
+ }
+ if ((type & AHC_TRANS_USER) != 0) {
+ ahc->transinfo[devinfo->target_offset].user.width = width;
+ }
}
/*
@@ -1089,29 +927,19 @@ fail:
static void
ahc_fetch_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
{
- u_int saved_tcl;
- role_t role;
-
- if (ahc_inb(ahc, SSTAT0) & TARGET)
- role = ROLE_TARGET;
- else
- role = ROLE_INITIATOR;
+ u_int saved_tcl;
saved_tcl = ahc_inb(ahc, SAVED_TCL);
ahc_compile_devinfo(devinfo, (saved_tcl >> 4) & 0x0f,
- saved_tcl & 0x3, (saved_tcl & SELBUSB) ? 'B': 'A',
- role);
+ (saved_tcl & SELBUSB) ? 'B': 'A');
}
static void
-ahc_compile_devinfo(struct ahc_devinfo *devinfo, u_int target, u_int lun,
- char channel, role_t role)
+ahc_compile_devinfo(struct ahc_devinfo *devinfo, u_int target, char channel)
{
devinfo->target = target;
- devinfo->lun = lun;
devinfo->target_offset = target;
devinfo->channel = channel;
- devinfo->role = role;
if (channel == 'B')
devinfo->target_offset += 8;
devinfo->target_mask = (0x01 << devinfo->target_offset);
@@ -1161,6 +989,12 @@ ahc_intr(void *arg)
scb_index = ahc->qoutfifo[ahc->qoutfifonext];
ahc->qoutfifo[ahc->qoutfifonext++] = SCB_LIST_NULL;
+ if (scb_index == TARGET_CMD_CMPLT
+ && (ahc->flags & AHC_TARGETMODE) != 0) {
+ ahc_handle_target_cmd(ahc);
+ continue;
+ }
+
scb = ahc->scb_data->scbarray[scb_index];
if (!scb || !(scb->flags & SCB_ACTIVE)) {
printf("%s: WARNING no command for scb %d "
@@ -1178,23 +1012,6 @@ ahc_intr(void *arg)
ahc_calc_residual(scb);
ahc_done(ahc, scb);
}
-
- if ((ahc->flags & AHC_TARGETMODE) != 0) {
- while (ahc->targetcmds[ahc->tqinfifonext].cmd_valid) {
- struct target_cmd *cmd;
-
- cmd = &ahc->targetcmds[ahc->tqinfifonext];
-
- /*
- * Only advance through the queue if we
- * had the resources to process the command.
- */
- if (ahc_handle_target_cmd(ahc, cmd) != 0)
- break;
- ahc->tqinfifonext++;
- cmd->cmd_valid = 0;
- }
- }
}
if (intstat & BRKADRINT) {
/*
@@ -1213,8 +1030,8 @@ ahc_intr(void *arg)
(ahc_inb(ahc, SEQADDR1) << 8));
/* Tell everyone that this HBA is no longer availible */
- ahc_abort_scbs(ahc, CAM_TARGET_WILDCARD, ALL_CHANNELS,
- CAM_LUN_WILDCARD, SCB_LIST_NULL, CAM_NO_HBA);
+ ahc_abort_scbs(ahc, ALL_TARGETS, ALL_CHANNELS,
+ ALL_LUNS, SCB_LIST_NULL, CAM_NO_HBA);
}
if (intstat & SEQINT)
ahc_handle_seqint(ahc, intstat);
@@ -1224,207 +1041,31 @@ ahc_intr(void *arg)
}
static void
-ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
-{
- struct tmode_tstate *tstate;
- struct tmode_lstate *lstate;
- struct ccb_en_lun *cel;
- cam_status status;
- int target;
- int lun;
-
- status = ahc_find_tmode_devs(ahc, sim, ccb, &tstate, &lstate,
- /* notfound_failure*/FALSE);
-
- if (status != CAM_REQ_CMP) {
- ccb->ccb_h.status = status;
- return;
- }
-
- cel = &ccb->cel;
- target = ccb->ccb_h.target_id;
- lun = ccb->ccb_h.target_lun;
- if (cel->enable != 0) {
- u_int scsiseq;
-
- /* Are we already enabled?? */
- if (lstate != NULL) {
- ccb->ccb_h.status = CAM_LUN_ALRDY_ENA;
- return;
- }
-
- if (cel->grp6_len != 0
- || cel->grp7_len != 0) {
- /*
- * Don't (yet?) support vendor
- * specific commands.
- */
- ccb->ccb_h.status = CAM_REQ_INVALID;
- return;
- }
-
- /*
- * Seems to be okay.
- * Setup our data structures.
- */
- if (target != CAM_TARGET_WILDCARD && tstate == NULL) {
- tstate = malloc(sizeof(*tstate), M_DEVBUF, M_NOWAIT);
- if (tstate == NULL) {
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
- return;
- }
- bzero(tstate, sizeof(*tstate));
- ahc->enabled_targets[target] = tstate;
- }
- lstate = malloc(sizeof(*lstate), M_DEVBUF, M_NOWAIT);
- if (lstate == NULL) {
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
- return;
- }
- bzero(lstate, sizeof(*lstate));
- SLIST_INIT(&lstate->accept_tios);
- SLIST_INIT(&lstate->immed_notifies);
- if (target != CAM_TARGET_WILDCARD) {
- tstate->enabled_luns[lun] = lstate;
- ahc->enabled_luns++;
- } else
- ahc->black_hole = lstate;
- pause_sequencer(ahc);
- if ((ahc->features & AHC_MULTI_TID) != 0) {
- u_int16_t targid_mask;
-
- targid_mask = ahc_inb(ahc, TARGID)
- | (ahc_inb(ahc, TARGID + 1) << 8);
-
- targid_mask |= (0x01 << target);
- ahc_outb(ahc, TARGID, targid_mask);
- ahc_outb(ahc, TARGID+1, (targid_mask >> 8));
- }
- /* Allow select-in operations */
- if (ahc->black_hole != NULL && ahc->enabled_luns > 0) {
- scsiseq = ahc_inb(ahc, SCSISEQ_TEMPLATE);
- scsiseq |= ENSELI;
- ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq);
- scsiseq = ahc_inb(ahc, SCSISEQ);
- scsiseq |= ENSELI;
- ahc_outb(ahc, SCSISEQ, scsiseq);
- }
- unpause_sequencer(ahc, /*always?*/FALSE);
- ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_print_path(ccb->ccb_h.path);
- printf("Lun now enabled for target mode\n");
- xpt_done(ccb);
- } else {
- struct ccb_hdr *elm;
-
- if (lstate == NULL) {
- ccb->ccb_h.status = CAM_LUN_INVALID;
- return;
- }
-
- ccb->ccb_h.status = CAM_REQ_CMP;
- LIST_FOREACH(elm, &ahc->pending_ccbs, sim_links.le) {
- if (elm->func_code == XPT_CONT_TARGET_IO
- && !xpt_path_comp(elm->path, ccb->ccb_h.path)){
- printf("CTIO pending\n");
- ccb->ccb_h.status = CAM_REQ_INVALID;
- return;
- }
- }
-
- if (SLIST_FIRST(&lstate->accept_tios) != NULL) {
- printf("ATIOs pending\n");
- ccb->ccb_h.status = CAM_REQ_INVALID;
- }
-
- if (SLIST_FIRST(&lstate->immed_notifies) != NULL) {
- printf("INOTs pending\n");
- ccb->ccb_h.status = CAM_REQ_INVALID;
- }
-
- if (ccb->ccb_h.status == CAM_REQ_CMP) {
- int i, empty;
-
- xpt_print_path(ccb->ccb_h.path);
- printf("Target mode disabled\n");
- free(lstate, M_DEVBUF);
-
- pause_sequencer(ahc);
- /* Can we clean up the target too? */
- if (target != CAM_TARGET_WILDCARD) {
- tstate->enabled_luns[lun] = NULL;
- ahc->enabled_luns--;
- for (empty = 1, i = 0; i < 8; i++)
- if (tstate->enabled_luns[i] != NULL) {
- empty = 0;
- break;
- }
- if (empty) {
- free(tstate, M_DEVBUF);
- ahc->enabled_targets[target] = NULL;
- if (ahc->features & AHC_MULTI_TID) {
- u_int16_t targid_mask;
-
- targid_mask =
- ahc_inb(ahc, TARGID)
- | (ahc_inb(ahc, TARGID + 1)
- << 8);
-
- targid_mask &= (0x01 << target);
- ahc_outb(ahc, TARGID,
- targid_mask);
- ahc_outb(ahc, TARGID+1,
- (targid_mask >> 8));
- }
-
- for (empty = 1, i = 0; i < 16; i++)
- if (ahc->enabled_targets[i]
- != NULL) {
- empty = 0;
- break;
- }
- }
- } else {
-
- ahc->black_hole = NULL;
-
- /*
- * We can't allow selections without
- * our black hole device.
- */
- empty = TRUE;
- }
- if (empty) {
- /* Disallow select-in */
- u_int scsiseq;
-
- scsiseq = ahc_inb(ahc, SCSISEQ_TEMPLATE);
- scsiseq &= ~ENSELI;
- ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq);
- scsiseq = ahc_inb(ahc, SCSISEQ);
- scsiseq &= ~ENSELI;
- ahc_outb(ahc, SCSISEQ, scsiseq);
- }
- unpause_sequencer(ahc, /*always?*/FALSE);
- }
- }
-}
-
-static int
-ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
+ahc_handle_target_cmd(struct ahc_softc *ahc)
{
struct tmode_tstate *tstate;
struct tmode_lstate *lstate;
struct ccb_accept_tio *atio;
+ struct target_cmd *cmd;
u_int8_t *byte;
int initiator;
int target;
int lun;
- initiator = cmd->initiator_channel >> 4;
+ cmd = &ahc->targetcmds[ahc->next_targetcmd];
+ ahc->next_targetcmd++;
+ if (ahc->next_targetcmd >= ahc->num_targetcmds)
+ ahc->next_targetcmd = 0;
+
+ initiator = cmd->icl >> 4;
target = cmd->targ_id;
lun = (cmd->identify & MSG_IDENTIFY_LUNMASK);
+ xpt_print_path(ahc->path);
+ printf("Received Target Command (%d:%d:%d)\n",
+ initiator, target, lun);
+ ahc_dump_targcmd(cmd);
+
byte = cmd->bytes;
tstate = ahc->enabled_targets[target];
lstate = NULL;
@@ -1432,28 +1073,23 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
lstate = tstate->enabled_luns[lun];
/*
- * Commands for disabled luns go to the black hole driver.
+ * XXX Need to have a default TMODE devce that attaches to luns
+ * that wouldn't otherwise be enabled and returns the proper
+ * inquiry information. After all, we don't want to duplicate
+ * this code in each driver. For now, simply drop it on the
+ * floor.
*/
if (lstate == NULL) {
printf("Incoming Command on disabled lun\n");
- lstate = ahc->black_hole;
- atio =
- (struct ccb_accept_tio*)SLIST_FIRST(&lstate->accept_tios);
- /* Fill in the wildcards */
- atio->ccb_h.target_id = target;
- atio->ccb_h.target_lun = lun;
- } else {
- atio =
- (struct ccb_accept_tio*)SLIST_FIRST(&lstate->accept_tios);
+ return;
}
+
+ atio = (struct ccb_accept_tio*)SLIST_FIRST(&lstate->accept_tios);
+ /* XXX Should reconnect and return BUSY status */
if (atio == NULL) {
printf("No ATIOs for incoming command\n");
- /*
- * Wait for more ATIOs from the peripheral driver for this lun.
- */
- return (1);
+ return;
}
- SLIST_REMOVE_HEAD(&lstate->accept_tios, sim_links.sle);
/*
* Package it up and send it off to
@@ -1494,6 +1130,7 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
}
bcopy(byte, atio->cdb_io.cdb_bytes, atio->cdb_len);
+ SLIST_REMOVE_HEAD(&lstate->accept_tios, sim_links.sle);
atio->ccb_h.status |= CAM_CDB_RECVD;
if ((cmd->identify & MSG_IDENTIFY_DISCFLAG) == 0) {
@@ -1503,10 +1140,11 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
* continue target I/O comes in response
* to this accept tio.
*/
+ xpt_print_path(atio->ccb_h.path);
+ printf("Incoming Command did not disconnect %p\n", lstate);
ahc->pending_device = lstate;
}
xpt_done((union ccb*)atio);
- return (0);
}
static void
@@ -1581,6 +1219,130 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
devinfo.target);
}
break;
+ case EXTENDED_MSG:
+ {
+ ahc->msg_type = MSG_TYPE_INITIATOR_MSGIN;
+ ahc->msg_len = 0;
+ ahc->msg_index = 0;
+
+ /*
+ * To actually receive the message, simply turn on
+ * REQINIT interrupts and let our interrupt handler
+ * do the rest (REQINIT should already be true).
+ */
+ ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) | ENREQINIT);
+ ahc->flags |= AHC_HANDLING_REQINITS;
+ return;
+ }
+ case REJECT_MSG:
+ {
+ /*
+ * What we care about here is if we had an
+ * outstanding SDTR or WDTR message for this
+ * target. If we did, this is a signal that
+ * the target is refusing negotiation.
+ */
+ u_int scb_index;
+ u_int last_msg;
+
+ scb_index = ahc_inb(ahc, SCB_TAG);
+ scb = ahc->scb_data->scbarray[scb_index];
+
+ last_msg = ahc_inb(ahc, LAST_MSG);
+
+ if ((last_msg == MSG_IDENTIFYFLAG
+ || last_msg == HOST_MSG)
+ && (scb->flags & SCB_MSGOUT_WDTR) != 0
+ && (scb->flags & SCB_MSGOUT_SENT) != 0) {
+ struct ahc_target_tinfo *tinfo;
+
+ /* note 8bit xfers and clear flag */
+ printf("%s:%c:%d: refuses WIDE negotiation. Using "
+ "8bit transfers\n", ahc_name(ahc),
+ devinfo.channel, devinfo.target);
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ ahc->wdtrpending &= ~devinfo.target_mask;
+ ahc_set_width(ahc, &devinfo, scb->ccb->ccb_h.path,
+ MSG_EXT_WDTR_BUS_8_BIT,
+ AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
+ ahc_set_syncrate(ahc, &devinfo, scb->ccb->ccb_h.path,
+ /*syncrate*/NULL, /*period*/0,
+ /*offset*/0, AHC_TRANS_ACTIVE);
+ tinfo = &ahc->transinfo[devinfo.target_offset];
+ if (tinfo->goal.period) {
+ /* Start the sync negotiation */
+ ahc->sdtrpending |= devinfo.target_mask;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
+ }
+ } else if ((last_msg == MSG_IDENTIFYFLAG
+ || last_msg == HOST_MSG)
+ && (scb->flags & SCB_MSGOUT_SDTR) != 0
+ && (scb->flags & SCB_MSGOUT_SENT) != 0) {
+
+ /* note asynch xfers and clear flag */
+ ahc_set_syncrate(ahc, &devinfo, scb->ccb->ccb_h.path,
+ /*syncrate*/NULL, /*period*/0,
+ /*offset*/0,
+ AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ ahc->sdtrpending &= ~devinfo.target_mask;
+ printf("%s:%c:%d: refuses synchronous negotiation. "
+ "Using asynchronous transfers\n",
+ ahc_name(ahc),
+ devinfo.channel, devinfo.target);
+ } else if ((last_msg == MSG_IDENTIFYFLAG)
+ && (scb->hscb->control & MSG_SIMPLE_Q_TAG) != 0) {
+ struct ccb_trans_settings neg;
+
+ printf("%s:%c:%d: refuses tagged commands. Performing "
+ "non-tagged I/O\n", ahc_name(ahc),
+ devinfo.channel, devinfo.target);
+
+ ahc->tagenable &= ~devinfo.target_mask;
+ neg.flags = 0;
+ neg.valid = CCB_TRANS_TQ_VALID;
+ xpt_setup_ccb(&neg.ccb_h, scb->ccb->ccb_h.path,
+ /*priority*/1);
+ xpt_async(AC_TRANSFER_NEG, scb->ccb->ccb_h.path, &neg);
+ /*
+ * Resend the identify for this CCB as the target
+ * may believe that the selection is invalid otherwise.
+ */
+ ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc, SCB_CONTROL)
+ & ~MSG_SIMPLE_Q_TAG);
+ scb->hscb->control &= ~MSG_SIMPLE_Q_TAG;
+ scb->ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
+ ahc_outb(ahc, MSG_OUT, MSG_IDENTIFYFLAG);
+ ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
+
+ /*
+ * Requeue all tagged commands for this target
+ * currently in our posession so they can be
+ * converted to untagged commands.
+ */
+ ahc_search_qinfifo(ahc, SCB_TARGET(scb),
+ SCB_CHANNEL(scb),
+ SCB_LUN(scb),
+ /*tag*/SCB_LIST_NULL,
+ CAM_REQUEUE_REQ,
+ SEARCH_COMPLETE);
+ } else {
+ /*
+ * Otherwise, we ignore it.
+ */
+#ifdef AHC_DEBUG
+ if (ahc_debug & AHC_SHOWMISC)
+ printf("%s:%c:%d: Message reject -- ignored\n",
+ ahc_name(ahc), devinfo.channel,
+ devinfo.target);
+#endif
+ break;
+ }
+ break;
+ }
case BAD_STATUS:
{
u_int scb_index;
@@ -1683,17 +1445,31 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
* but due to the way we page SCBs, we can't.
*/
hscb->control = 0;
-
/*
* This request sense could be because the
* the device lost power or in some other
* way has lost our transfer negotiations.
* Renegotiate if appropriate.
*/
+ ahc_set_width(ahc, &devinfo,
+ scb->ccb->ccb_h.path,
+ MSG_EXT_WDTR_BUS_8_BIT,
+ AHC_TRANS_CUR);
+ ahc_set_syncrate(ahc, &devinfo,
+ scb->ccb->ccb_h.path,
+ /*syncrate*/NULL, /*period*/0,
+ /*offset*/0, AHC_TRANS_CUR);
+ scb->flags &= ~SCB_MSGOUT_BITS;
tinfo = &ahc->transinfo[devinfo.target_offset];
- ahc_update_target_msg_request(ahc, &devinfo,
- tinfo,
- /*force*/TRUE);
+ if (tinfo->goal.width) {
+ ahc->wdtrpending |= devinfo.target_mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_WDTR;
+ } else if (tinfo->goal.period) {
+ ahc->sdtrpending |= devinfo.target_mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ }
hscb->status = 0;
hscb->SG_count = 1;
hscb->SG_pointer = scb->ahc_dmaphys;
@@ -1736,15 +1512,19 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
}
break;
}
- case TRACE_POINT:
+ case TARGET_SYNC_CMD:
{
- printf("SSTAT2 = 0x%x DFCNTRL = 0x%x\n", ahc_inb(ahc, SSTAT2),
- ahc_inb(ahc, DFCNTRL));
- printf("SSTAT3 = 0x%x DSTATUS = 0x%x\n", ahc_inb(ahc, SSTAT3),
- ahc_inb(ahc, DFSTATUS));
- printf("SSTAT0 = 0x%x, SCB_DATACNT = 0x%x\n",
- ahc_inb(ahc, SSTAT0),
- ahc_inb(ahc, SCB_DATACNT));
+ /*
+ * We've already processed the command. If the command
+ * is still pending, don't unpause the sequencer until
+ * it returns.
+ */
+ xpt_print_path(ahc->path);
+ printf("Saw a target sync cmd\n");
+ if (ahc->pending_device != NULL) {
+ printf(" Pending device too.\n");
+ return;
+ }
break;
}
case TARGET_MSG_HELP:
@@ -1755,56 +1535,105 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
restart_sequencer(ahc);
return;
}
- case HOST_MSG_LOOP:
+ case AWAITING_MSG:
{
+ u_int scb_index;
+
+ scb_index = ahc_inb(ahc, SCB_TAG);
+ scb = ahc->scb_data->scbarray[scb_index];
+
+ /*
+ * To facilitate adding multiple messages together,
+ * each routine should increment the index and len
+ * variables instead of setting them explicitly.
+ */
+ ahc->msg_index = 0;
+ ahc->msg_len = 0;
+
/*
- * The sequencer has encountered a message phase
- * that requires host assistance for completion.
- * While handling the message phase(s), we will be
- * notified by the sequencer after each byte is
- * transfered so we can track bus phases.
- *
- * If this is the first time we've seen a HOST_MSG_LOOP,
- * initialize the state of the host message loop.
+ * This SCB had MK_MESSAGE set in its control byte or
+ * we have explicitly set HOST_MSG in MSG_OUT,
+ * informing the sequencer that we want to send a
+ * special message to this target.
*/
- if (ahc->msg_type == MSG_TYPE_NONE) {
- u_int bus_phase;
-
- bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
- if (bus_phase != P_MESGIN && bus_phase != P_MESGOUT)
- panic("ahc_intr: HOST_MSG_LOOP bad phase 0x%x",
- bus_phase);
-
- if (devinfo.role == ROLE_INITIATOR) {
- struct scb *scb;
- u_int scb_index;
-
- scb_index = ahc_inb(ahc, SCB_TAG);
- scb = ahc->scb_data->scbarray[scb_index];
-
- if (bus_phase == P_MESGOUT)
- ahc_setup_initiator_msgout(ahc,
- &devinfo,
- scb);
- else {
- ahc->msg_type =
- MSG_TYPE_INITIATOR_MSGIN;
- ahc->msgin_index = 0;
+ if ((scb->flags & SCB_DEVICE_RESET) == 0
+ && ahc_inb(ahc, MSG_OUT) == MSG_IDENTIFYFLAG
+ && (scb->hscb->control & TAG_ENB) != 0) {
+ ahc->msg_buf[ahc->msg_index++] =
+ scb->ccb->csio.tag_action;
+ ahc->msg_buf[ahc->msg_index++] =
+ scb->hscb->tag;
+ ahc->msg_len += 2;
+ }
+
+ if (scb->flags & SCB_DEVICE_RESET) {
+ ahc->msg_buf[ahc->msg_index++] = MSG_BUS_DEV_RESET;
+ ahc->msg_len++;
+ xpt_print_path(scb->ccb->ccb_h.path);
+ printf("Bus Device Reset Message Sent\n");
+ } else if (scb->flags & SCB_ABORT) {
+ if ((scb->hscb->control & TAG_ENB) != 0)
+ ahc->msg_buf[ahc->msg_index++] = MSG_ABORT_TAG;
+ else
+ ahc->msg_buf[ahc->msg_index++] = MSG_ABORT;
+ ahc->msg_len++;
+ xpt_print_path(scb->ccb->ccb_h.path);
+ printf("Abort Message Sent\n");
+ } else if (scb->flags & SCB_MSGOUT_WDTR) {
+ struct ahc_target_tinfo *tinfo;
+
+ tinfo = &ahc->transinfo[devinfo.target_offset];
+ ahc_construct_wdtr(ahc, tinfo->goal.width);
+ } else if (scb->flags & SCB_MSGOUT_SDTR) {
+ struct ahc_target_tinfo *tinfo;
+ u_int period;
+ u_int maxsync;
+
+ /*
+ * Now that the target is actually selected, we
+ * can further refine our sync rate based on the
+ * output transceiver mode.
+ */
+ if ((ahc->features & AHC_ULTRA2) != 0) {
+ if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
+ && (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
+ maxsync = AHC_SYNCRATE_ULTRA2;
+ } else {
+ maxsync = AHC_SYNCRATE_ULTRA;
}
+ } else if ((ahc->features & AHC_ULTRA) != 0) {
+ maxsync = AHC_SYNCRATE_ULTRA;
} else {
- if (bus_phase == P_MESGOUT) {
- ahc->msg_type =
- MSG_TYPE_TARGET_MSGOUT;
- ahc->msgin_index = 0;
- } else
- /* XXX Ever executed??? */
- ahc_setup_target_msgin(ahc, &devinfo);
+ maxsync = AHC_SYNCRATE_FAST;
}
+ tinfo = &ahc->transinfo[devinfo.target_offset];
+ period = tinfo->goal.period;
+ ahc_find_syncrate(ahc, &period, maxsync);
+ ahc_construct_sdtr(ahc, period, tinfo->goal.offset);
+ } else {
+ printf("ahc_intr: AWAITING_MSG for an SCB that "
+ "does not have a waiting message");
+ panic("SCB = %d, SCB Control = %x, MSG_OUT = %x "
+ "SCB flags = %x", scb_index, scb->hscb->control,
+ ahc_inb(ahc, MSG_OUT), scb->flags);
}
- /* Pass a NULL path so that handlers generate their own */
- ahc_handle_message_phase(ahc, /*path*/NULL);
- break;
+ /*
+ * Record the fact that we attempted to send a message.
+ */
+ scb->flags |= SCB_MSGOUT_SENT;
+
+ /*
+ * To actually send the message, simply turn on
+ * REQINIT interrupts and let our interrupt handler
+ * do the rest (REQINIT should already be true).
+ */
+ ahc->msg_index = 0;
+ ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
+ ahc->flags |= AHC_HANDLING_REQINITS;
+ ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) | ENREQINIT);
+
+ return;
}
case DATA_OVERRUN:
{
@@ -1997,7 +1826,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
CAM_UNEXP_BUSFREE);
} else {
ahc_abort_scbs(ahc, target, channel,
- CAM_LUN_WILDCARD, SCB_LIST_NULL,
+ ALL_LUNS, SCB_LIST_NULL,
CAM_UNEXP_BUSFREE);
printf("%s: ", ahc_name(ahc));
}
@@ -2006,8 +1835,10 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
lastphase, ahc_inb(ahc, SEQADDR0)
| (ahc_inb(ahc, SEQADDR1) << 8));
}
- ahc_clear_msg_state(ahc);
- ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
+ ahc_outb(ahc, MSG_OUT, MSG_NOOP);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENREQINIT));
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
ahc_outb(ahc, CLRSINT1, CLRBUSFREE);
ahc_outb(ahc, CLRINT, CLRSCSIINT);
restart_sequencer(ahc);
@@ -2030,6 +1861,11 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
"valid during SELTO scb(%d, %d)\n",
ahc_name(ahc), scbptr, scb_index);
} else {
+ /*
+ * Clear any pending messages for the timed out
+ * target.
+ */
+ ahc_outb(ahc, MSG_OUT, MSG_NOOP);
ahc_handle_devreset(ahc, SCB_TARGET(scb),
SCB_CHANNEL(scb), CAM_SEL_TIMEOUT,
/*ac_code*/0, "Selection Timeout",
@@ -2038,7 +1874,9 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
/* Stop the selection */
ahc_outb(ahc, SCSISEQ, 0);
- ahc_clear_msg_state(ahc);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~ENREQINIT);
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
ahc_outb(ahc, CLRSINT1, CLRSELTIMEO|CLRBUSFREE);
@@ -2109,14 +1947,14 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
* mesg_out to something other than MSG_NOP.
*/
if (mesg_out != MSG_NOOP) {
- if (ahc->msg_type != MSG_TYPE_NONE)
- ahc->send_msg_perror = TRUE;
- else
- ahc_outb(ahc, MSG_OUT, mesg_out);
+ ahc_outb(ahc, MSG_OUT, mesg_out);
}
ahc_outb(ahc, CLRSINT1, CLRSCSIPERR);
ahc_outb(ahc, CLRINT, CLRSCSIINT);
unpause_sequencer(ahc, /*unpause_always*/TRUE);
+ } else if ((status & REQINIT) != 0
+ && (ahc->flags & AHC_HANDLING_REQINITS) != 0) {
+ ahc_handle_reqinit(ahc, scb);
} else {
xpt_print_path(scb->ccb->ccb_h.path);
printf("Unknown SCSIINT. Status = 0x%x\n", status);
@@ -2127,529 +1965,101 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
}
static void
-ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- /*
- * We need to initiate transfer negotiations.
- * If our current and goal settings are identical,
- * we want to renegotiate due to a check condition.
- */
- struct ahc_target_tinfo *tinfo;
- int dowide;
- int dosync;
-
- tinfo = &ahc->transinfo[devinfo->target_offset];
- dowide = tinfo->current.width != tinfo->goal.width;
- dosync = tinfo->current.period != tinfo->goal.period;
-
- if (!dowide && !dosync) {
- dowide = tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT;
- dosync = tinfo->goal.period != 0;
- }
-
- if (dowide)
- ahc_construct_wdtr(ahc, tinfo->goal.width);
- else if (dosync) {
- struct ahc_syncrate *rate;
- u_int period;
- u_int offset;
-
- period = tinfo->goal.period;
- rate = ahc_devlimited_syncrate(ahc, &period);
- offset = tinfo->goal.offset;
- ahc_validate_offset(ahc, rate, &offset,
- tinfo->current.width);
- ahc_construct_sdtr(ahc, period, offset);
- } else {
- panic("ahc_intr: AWAITING_MSG for negotiation, "
- "but no negotiation needed\n");
- }
-}
-
-static void
-ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
- struct scb *scb)
-{
- /*
- * To facilitate adding multiple messages together,
- * each routine should increment the index and len
- * variables instead of setting them explicitly.
- */
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
-
- if ((scb->flags & SCB_DEVICE_RESET) == 0
- && ahc_inb(ahc, MSG_OUT) == MSG_IDENTIFYFLAG) {
- u_int identify_msg;
-
- identify_msg = MSG_IDENTIFYFLAG | SCB_LUN(scb);
- if ((scb->hscb->control & DISCENB) != 0)
- identify_msg |= MSG_IDENTIFY_DISCFLAG;
- ahc->msgout_buf[ahc->msgout_index++] = identify_msg;
- ahc->msgout_len++;
-
- if ((scb->hscb->control & TAG_ENB) != 0) {
- ahc->msgout_buf[ahc->msgout_index++] =
- scb->ccb->csio.tag_action;
- ahc->msgout_buf[ahc->msgout_index++] = scb->hscb->tag;
- ahc->msgout_len += 2;
- }
- }
-
- if (scb->flags & SCB_DEVICE_RESET) {
- ahc->msgout_buf[ahc->msgout_index++] = MSG_BUS_DEV_RESET;
- ahc->msgout_len++;
- xpt_print_path(scb->ccb->ccb_h.path);
- printf("Bus Device Reset Message Sent\n");
- } else if (scb->flags & SCB_ABORT) {
- if ((scb->hscb->control & TAG_ENB) != 0)
- ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT_TAG;
- else
- ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT;
- ahc->msgout_len++;
- xpt_print_path(scb->ccb->ccb_h.path);
- printf("Abort Message Sent\n");
- } else if ((ahc->targ_msg_req & devinfo->target_mask) != 0) {
- ahc_build_transfer_msg(ahc, devinfo);
- } else {
- printf("ahc_intr: AWAITING_MSG for an SCB that "
- "does not have a waiting message");
- panic("SCB = %d, SCB Control = %x, MSG_OUT = %x "
- "SCB flags = %x", scb->hscb->tag, scb->hscb->control,
- ahc_inb(ahc, MSG_OUT), scb->flags);
- }
-
- /*
- * Clear the MK_MESSAGE flag from the SCB so we aren't
- * asked to send this message again.
- */
- ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc, SCB_CONTROL) & ~MK_MESSAGE);
- ahc->msgout_index = 0;
- ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
-}
-
-static void
-ahc_setup_target_msgin(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- /*
- * To facilitate adding multiple messages together,
- * each routine should increment the index and len
- * variables instead of setting them explicitly.
- */
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
-
- if ((ahc->targ_msg_req & devinfo->target_mask) != 0)
- ahc_build_transfer_msg(ahc, devinfo);
- else
- panic("ahc_intr: AWAITING target message with no message");
-
- ahc->msgout_index = 0;
- ahc->msg_type = MSG_TYPE_TARGET_MSGIN;
-}
-
-static int
-ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- /*
- * What we care about here is if we had an
- * outstanding SDTR or WDTR message for this
- * target. If we did, this is a signal that
- * the target is refusing negotiation.
- */
- struct scb *scb;
- u_int scb_index;
- u_int last_msg;
- int response = 0;
-
- scb_index = ahc_inb(ahc, SCB_TAG);
- scb = ahc->scb_data->scbarray[scb_index];
-
- /* Might be necessary */
- last_msg = ahc_inb(ahc, LAST_MSG);
-
- if (ahc_sent_msg(ahc, MSG_EXT_WDTR, /*full*/FALSE)) {
- struct ahc_target_tinfo *tinfo;
-
- /* note 8bit xfers and clear flag */
- printf("%s:%c:%d: refuses WIDE negotiation. Using "
- "8bit transfers\n", ahc_name(ahc),
- devinfo->channel, devinfo->target);
- ahc_set_width(ahc, devinfo, scb->ccb->ccb_h.path,
- MSG_EXT_WDTR_BUS_8_BIT,
- AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
- ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
- /*syncrate*/NULL, /*period*/0,
- /*offset*/0, AHC_TRANS_ACTIVE);
- tinfo = &ahc->transinfo[devinfo->target_offset];
- if (tinfo->goal.period) {
- u_int period;
-
- /* Start the sync negotiation */
- period = tinfo->goal.period;
- ahc_devlimited_syncrate(ahc, &period);
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_sdtr(ahc, period, tinfo->goal.offset);
- ahc->msgout_index = 0;
- response = 1;
- }
- } else if (ahc_sent_msg(ahc, MSG_EXT_SDTR, /*full*/FALSE)) {
- /* note asynch xfers and clear flag */
- ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
- /*syncrate*/NULL, /*period*/0,
- /*offset*/0,
- AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
- printf("%s:%c:%d: refuses synchronous negotiation. "
- "Using asynchronous transfers\n",
- ahc_name(ahc),
- devinfo->channel, devinfo->target);
- } else if ((scb->hscb->control & MSG_SIMPLE_Q_TAG) != 0) {
- struct ccb_trans_settings neg;
-
- printf("%s:%c:%d: refuses tagged commands. Performing "
- "non-tagged I/O\n", ahc_name(ahc),
- devinfo->channel, devinfo->target);
-
- ahc->tagenable &= ~devinfo->target_mask;
- neg.flags = 0;
- neg.valid = CCB_TRANS_TQ_VALID;
- xpt_setup_ccb(&neg.ccb_h, scb->ccb->ccb_h.path, /*priority*/1);
- xpt_async(AC_TRANSFER_NEG, scb->ccb->ccb_h.path, &neg);
-
- /*
- * Resend the identify for this CCB as the target
- * may believe that the selection is invalid otherwise.
- */
- ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc, SCB_CONTROL)
- & ~MSG_SIMPLE_Q_TAG);
- scb->hscb->control &= ~MSG_SIMPLE_Q_TAG;
- scb->ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID;
- ahc_outb(ahc, MSG_OUT, MSG_IDENTIFYFLAG);
- ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
-
- /*
- * Requeue all tagged commands for this target
- * currently in our posession so they can be
- * converted to untagged commands.
- */
- ahc_search_qinfifo(ahc, SCB_TARGET(scb), SCB_CHANNEL(scb),
- SCB_LUN(scb), /*tag*/SCB_LIST_NULL,
- CAM_REQUEUE_REQ, SEARCH_COMPLETE);
- } else {
- /*
- * Otherwise, we ignore it.
- */
- printf("%s:%c:%d: Message reject for %x -- ignored\n",
- ahc_name(ahc), devinfo->channel, devinfo->target,
- last_msg);
- }
- return (response);
-}
-
-static void
-ahc_clear_msg_state(struct ahc_softc *ahc)
-{
- ahc->msgout_len = 0;
- ahc->msgin_index = 0;
- ahc->msg_type = MSG_TYPE_NONE;
- ahc_outb(ahc, MSG_OUT, MSG_NOOP);
-}
-
-static void
-ahc_handle_message_phase(struct ahc_softc *ahc, struct cam_path *path)
+ahc_handle_reqinit(struct ahc_softc *ahc, struct scb *scb)
{
struct ahc_devinfo devinfo;
- u_int bus_phase;
- int end_session;
+ u_int simode1;
ahc_fetch_devinfo(ahc, &devinfo);
-
- end_session = FALSE;
- bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
-
-reswitch:
switch (ahc->msg_type) {
case MSG_TYPE_INITIATOR_MSGOUT:
{
- int lastbyte;
- int phasemis;
- int msgdone;
+ int lastbyte;
+ int phasemis;
+ u_int bus_phase;
- if (ahc->msgout_len == 0)
+ if (ahc->msg_len == 0)
panic("REQINIT interrupt with no active message");
+ lastbyte = (ahc->msg_index == ahc->msg_len - 1);
+ bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
phasemis = bus_phase != P_MESGOUT;
- if (phasemis) {
- if (bus_phase == P_MESGIN) {
- /*
- * Change gears and see if
- * this messages is of interest to
- * us or should be passed back to
- * the sequencer.
- */
- ahc_outb(ahc, CLRSINT1, CLRATNO);
- ahc->send_msg_perror = FALSE;
- ahc->msg_type = MSG_TYPE_INITIATOR_MSGIN;
- ahc->msgin_index = 0;
- goto reswitch;
- }
- end_session = TRUE;
- break;
- }
-
- if (ahc->send_msg_perror) {
- ahc_outb(ahc, CLRSINT1, CLRATNO);
- ahc_outb(ahc, CLRSINT1, CLRREQINIT);
- ahc_outb(ahc, SCSIDATL, MSG_PARITY_ERROR);
- break;
- }
-
- msgdone = ahc->msgout_index == ahc->msgout_len;
- if (msgdone) {
- /*
- * The target has requested a retry.
- * Re-assert ATN, reset our message index to
- * 0, and try again.
- */
- ahc->msgout_index = 0;
- ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
- }
-
- lastbyte = ahc->msgout_index == (ahc->msgout_len - 1);
- if (lastbyte) {
- /* Last byte is signified by dropping ATN */
- ahc_outb(ahc, CLRSINT1, CLRATNO);
- }
- /*
- * Clear our interrupt status and present
- * the next byte on the bus.
- */
- ahc_outb(ahc, CLRSINT1, CLRREQINIT);
- ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]);
- break;
- }
- case MSG_TYPE_INITIATOR_MSGIN:
- {
- int phasemis;
- int message_done;
-
- phasemis = bus_phase != P_MESGIN;
-
- if (phasemis) {
- ahc->msgin_index = 0;
- if (bus_phase == P_MESGOUT
- && (ahc->send_msg_perror == TRUE
- || (ahc->msgout_len != 0
- && ahc->msgout_index == 0))) {
- ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
- goto reswitch;
+ if (lastbyte || phasemis) {
+ /* Time to end our message session */
+ ahc->msg_len = 0;
+ ahc->msg_type = MSG_TYPE_NONE;
+ simode1 = ahc_inb(ahc, SIMODE1) & ~ENREQINIT;
+ ahc_outb(ahc, SIMODE1, simode1);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
+
+ if (phasemis == 0) {
+ ahc_outb(ahc, SINDEX,
+ ahc->msg_buf[ahc->msg_index]);
+ ahc_outb(ahc, RETURN_1, 0);
+ } else {
+ ahc_outb(ahc, RETURN_1, MSGOUT_PHASEMIS);
}
- end_session = TRUE;
- break;
- }
-
- /* Pull the byte in without acking it */
- ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIBUSL);
-
- message_done = ahc_parse_msg(ahc, path, &devinfo);
-
- if (message_done) {
- /*
- * Clear our incoming message buffer in case there
- * is another message following this one.
- */
- ahc->msgin_index = 0;
+ unpause_sequencer(ahc, /* unpause_always */TRUE);
+ } else {
/*
- * If this message illicited a response,
- * assert ATN so the target takes us to the
- * message out phase.
+ * Clear our interrupt status and present the byte
+ * on the bus, but don't unpause the sequencer.
*/
- if (ahc->msgout_len != 0)
- ahc_outb(ahc, SCSISIGO,
- ahc_inb(ahc, SCSISIGO) | ATNO);
+ ahc_outb(ahc, CLRSINT1, CLRREQINIT);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
+ ahc_outb(ahc, SCSIDATL, ahc->msg_buf[ahc->msg_index++]);
}
-
- /* Ack the byte */
- ahc_outb(ahc, CLRSINT1, CLRREQINIT);
- ahc_inb(ahc, SCSIDATL);
- ahc->msgin_index++;
break;
}
- case MSG_TYPE_TARGET_MSGIN:
+ case MSG_TYPE_INITIATOR_MSGIN:
{
- int msgdone;
- int msgout_request;
+ int phasemis;
+ int done;
- if (ahc->msgout_len == 0)
- panic("Target MSGIN with no active message");
+ phasemis = (ahc_inb(ahc, SCSISIGI) & PHASE_MASK) != P_MESGIN;
- /*
- * If we interrupted a mesgout session, the initiator
- * will not know this until our first REQ. So, we
- * only honor mesgout requests after we've sent our
- * first byte.
- */
- if ((ahc_inb(ahc, SCSISIGI) & ATNI) != 0
- && ahc->msgout_index > 0)
- msgout_request = TRUE;
- else
- msgout_request = FALSE;
+ if (phasemis == 0) {
- if (msgout_request) {
-
- /*
- * Change gears and see if
- * this messages is of interest to
- * us or should be passed back to
- * the sequencer.
- */
- ahc->msg_type = MSG_TYPE_TARGET_MSGOUT;
- ahc_outb(ahc, SCSISIGO, P_MESGOUT | BSYO);
- ahc->msgin_index = 0;
- /* Dummy read to REQ for first byte */
+ ahc->msg_len++;
+ /* Pull the byte in without acking it */
+ ahc->msg_buf[ahc->msg_index] = ahc_inb(ahc, SCSIBUSL);
+ done = ahc_parse_msg(ahc, scb, &devinfo);
+ /* Ack the byte */
+ ahc_outb(ahc, CLRSINT1, CLRREQINIT);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc_inb(ahc, SCSIDATL);
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- break;
+ ahc->msg_index++;
}
-
- msgdone = ahc->msgout_index == ahc->msgout_len;
- if (msgdone) {
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
- end_session = TRUE;
- break;
+ if (phasemis || done) {
+ /* Time to end our message session */
+ ahc->msg_len = 0;
+ ahc->msg_type = MSG_TYPE_NONE;
+ simode1 = ahc_inb(ahc, SIMODE1) & ~ENREQINIT;
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
+ ahc_outb(ahc, SIMODE1, simode1);
+ ahc_outb(ahc, CLRINT, CLRSCSIINT);
+ unpause_sequencer(ahc, /* unpause_always */TRUE);
}
-
- /*
- * Present the next byte on the bus.
- */
- ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]);
- break;
- }
- case MSG_TYPE_TARGET_MSGOUT:
- {
- int lastbyte;
- int msgdone;
-
- /*
- * The initiator signals that this is
- * the last byte by dropping ATN.
- */
- lastbyte = (ahc_inb(ahc, SCSISIGI) & ATNI) == 0;
-
- /*
- * Read the latched byte, but turn off SPIOEN first
- * so that we don't inadvertantly cause a REQ for the
- * next byte.
- */
- ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
- ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIDATL);
- msgdone = ahc_parse_msg(ahc, path, &devinfo);
- ahc->msgin_index++;
-
- /*
- * XXX Read spec about initiator dropping ATN too soon
- * and use msgdone to detect it.
- */
- if (msgdone) {
- ahc->msgin_index = 0;
-
- /*
- * If this message illicited a response, transition
- * to the Message in phase and send it.
- */
- if (ahc->msgout_len != 0) {
- ahc_outb(ahc, SCSISIGO, P_MESGIN | BSYO);
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- ahc->msg_type = MSG_TYPE_TARGET_MSGIN;
- ahc->msgin_index = 0;
- break;
- }
- }
-
- if (lastbyte)
- end_session = TRUE;
- else {
- /* Ask for the next byte. */
- ahc_outb(ahc, SXFRCTL0,
- ahc_inb(ahc, SXFRCTL0) | SPIOEN);
- }
-
break;
}
default:
panic("Unknown REQINIT message type");
}
-
- if (end_session) {
- ahc_clear_msg_state(ahc);
- ahc_outb(ahc, RETURN_1, EXIT_MSG_LOOP);
- } else
- ahc_outb(ahc, RETURN_1, CONT_MSG_LOOP);
}
-/*
- * See if we sent a particular extended message to the target.
- * If "full" is true, the target saw the full message.
- * If "full" is false, the target saw at least the first
- * byte of the message.
- */
static int
-ahc_sent_msg(struct ahc_softc *ahc, u_int msgtype, int full)
-{
- int found;
- int index;
-
- found = FALSE;
- index = 0;
-
- while (index < ahc->msgout_len) {
- if ((ahc->msgout_buf[index] & MSG_IDENTIFYFLAG) != 0
- || ahc->msgout_buf[index] == MSG_MESSAGE_REJECT)
- index++;
- else if (ahc->msgout_buf[index] >= MSG_SIMPLE_Q_TAG
- && ahc->msgout_buf[index] < MSG_IGN_WIDE_RESIDUE) {
- /* Skip tag type and tag id */
- index += 2;
- } else if (ahc->msgout_buf[index] == MSG_EXTENDED) {
- /* Found a candidate */
- if (ahc->msgout_buf[index+2] == msgtype) {
- u_int end_index;
-
- end_index = index + 1
- + ahc->msgout_buf[index + 1];
- if (full) {
- if (ahc->msgout_index > end_index)
- found = TRUE;
- } else if (ahc->msgout_index > index)
- found = TRUE;
- }
- break;
- } else {
- panic("ahc_sent_msg: Inconsistent msg buffer");
- }
- }
- return (found);
-}
-
-static int
-ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
+ahc_parse_msg(struct ahc_softc *ahc, struct scb *scb,
struct ahc_devinfo *devinfo)
{
int reject;
int done;
- int response;
u_int targ_scsirate;
done = FALSE;
- response = FALSE;
reject = FALSE;
targ_scsirate = ahc->transinfo[devinfo->target_offset].scsirate;
/*
@@ -2658,48 +2068,26 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
* the entire message is availible and has been
* handled, return TRUE indicating that we have
* parsed an entire message.
- *
- * In the case of extended messages, we accept the length
- * byte outright and perform more checking once we know the
- * extended message type.
*/
- switch (ahc->msgin_buf[0]) {
- case MSG_MESSAGE_REJECT:
- response = ahc_handle_msg_reject(ahc, devinfo);
- /* FALLTHROUGH */
- case MSG_NOOP:
- done = TRUE;
- break;
- case MSG_IGN_WIDE_RESIDUE:
- {
- struct ahc_target_tinfo *tinfo;
-
- tinfo = &ahc->transinfo[devinfo->target_offset];
- /* Wait for the whole message */
- if (ahc->msgin_index >= 1) {
- if (ahc->msgin_buf[1] != 1
- || tinfo->current.width == MSG_EXT_WDTR_BUS_8_BIT) {
- reject = TRUE;
- done = TRUE;
- } else
- ahc_handle_ign_wide_residue(ahc, devinfo);
- }
- break;
+ if (ahc->msg_buf[0] != MSG_EXTENDED) {
+ reject = TRUE;
}
- case MSG_EXTENDED:
- {
- /* Wait for enough of the message to begin validation */
- if (ahc->msgin_index < 2)
- break;
- switch (ahc->msgin_buf[2]) {
+
+ /*
+ * Just accept the length byte outright and perform
+ * more checking once we know the message type.
+ */
+ if (!reject && (ahc->msg_len > 2)) {
+ switch (ahc->msg_buf[2]) {
case MSG_EXT_SDTR:
{
struct ahc_syncrate *syncrate;
u_int period;
u_int offset;
u_int saved_offset;
+ u_int maxsync;
- if (ahc->msgin_buf[1] != MSG_EXT_SDTR_LEN) {
+ if (ahc->msg_buf[1] != MSG_EXT_SDTR_LEN) {
reject = TRUE;
break;
}
@@ -2707,19 +2095,28 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
/*
* Wait until we have both args before validating
* and acting on this message.
- *
- * Add one to MSG_EXT_SDTR_LEN to account for
- * the extended message preamble.
*/
- if (ahc->msgin_index < (MSG_EXT_SDTR_LEN + 1))
+ if (ahc->msg_len < (MSG_EXT_SDTR_LEN + /*preamble*/2))
break;
- period = ahc->msgin_buf[3];
- saved_offset = offset = ahc->msgin_buf[4];
- syncrate = ahc_devlimited_syncrate(ahc, &period);
+ period = ahc->msg_buf[3];
+ saved_offset = offset = ahc->msg_buf[4];
+ if ((ahc->features & AHC_ULTRA2) != 0) {
+ if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
+ && (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
+ maxsync = AHC_SYNCRATE_ULTRA2;
+ } else {
+ maxsync = AHC_SYNCRATE_ULTRA;
+ }
+ } else if ((ahc->features & AHC_ULTRA) != 0) {
+ maxsync = AHC_SYNCRATE_ULTRA;
+ } else {
+ maxsync = AHC_SYNCRATE_FAST;
+ }
+ syncrate = ahc_find_syncrate(ahc, &period, maxsync);
ahc_validate_offset(ahc, syncrate, &offset,
targ_scsirate & WIDEXFER);
- ahc_set_syncrate(ahc, devinfo, path,
+ ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
syncrate, period, offset,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
@@ -2728,23 +2125,27 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
* and didn't have to fall down to async
* transfers.
*/
- if (ahc_sent_msg(ahc, MSG_EXT_SDTR, /*full*/TRUE)) {
+ if ((scb->flags & (SCB_MSGOUT_SDTR|SCB_MSGOUT_SENT))
+ == (SCB_MSGOUT_SDTR|SCB_MSGOUT_SENT)) {
/* We started it */
if (saved_offset != offset) {
/* Went too low - force async */
reject = TRUE;
}
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ ahc->sdtrpending &= ~devinfo->target_mask;
} else {
/*
* Send our own SDTR in reply
*/
- if (bootverbose)
- printf("Sending SDTR!\n");
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_sdtr(ahc, period, offset);
- ahc->msgout_index = 0;
- response = TRUE;
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ ahc->sdtrpending |= devinfo->target_mask;
+ xpt_print_path(scb->ccb->ccb_h.path);
+ printf("Sending SDTR!!\n");
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
}
done = TRUE;
break;
@@ -2752,10 +2153,8 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
case MSG_EXT_WDTR:
{
u_int bus_width;
- u_int sending_reply;
- sending_reply = FALSE;
- if (ahc->msgin_buf[1] != MSG_EXT_WDTR_LEN) {
+ if (ahc->msg_buf[1] != MSG_EXT_WDTR_LEN) {
reject = TRUE;
break;
}
@@ -2763,26 +2162,13 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
/*
* Wait until we have our arg before validating
* and acting on this message.
- *
- * Add one to MSG_EXT_WDTR_LEN to account for
- * the extended message preamble.
- */
- if (ahc->msgin_index < (MSG_EXT_WDTR_LEN + 1))
- break;
-
- /*
- * Due to a problem with sync/wide transfers
- * on the aic7880 only allow this on Ultra2
- * controllers for the moment.
*/
- if (devinfo->role == ROLE_TARGET
- && (ahc->features & AHC_ULTRA2) == 0) {
- reject = TRUE;
+ if (ahc->msg_len < (MSG_EXT_WDTR_LEN + /*preamble*/2))
break;
- }
- bus_width = ahc->msgin_buf[3];
- if (ahc_sent_msg(ahc, MSG_EXT_WDTR, /*full*/TRUE)) {
+ bus_width = ahc->msg_buf[3];
+ if ((scb->flags & (SCB_MSGOUT_WDTR|SCB_MSGOUT_SENT))
+ == (SCB_MSGOUT_WDTR|SCB_MSGOUT_SENT)) {
/*
* Don't send a WDTR back to the
* target, since we asked first.
@@ -2806,12 +2192,15 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
case MSG_EXT_WDTR_BUS_16_BIT:
break;
}
+ scb->flags &= ~SCB_MSGOUT_WDTR;
+ ahc->wdtrpending &= ~devinfo->target_mask;
} else {
/*
* Send our own WDTR in reply
*/
- if (bootverbose)
- printf("Sending WDTR!\n");
+ printf("Sending WDTR!\n");
+ scb->flags &= ~SCB_MSGOUT_BITS;
+ scb->flags |= SCB_MSGOUT_WDTR;
switch (bus_width) {
default:
if (ahc->features & AHC_WIDE) {
@@ -2825,41 +2214,33 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
bus_width = MSG_EXT_WDTR_BUS_8_BIT;
break;
}
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_wdtr(ahc, bus_width);
- ahc->msgout_index = 0;
- response = TRUE;
- sending_reply = TRUE;
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
+ ahc->wdtrpending |= devinfo->target_mask;
}
- ahc_set_width(ahc, devinfo, path, bus_width,
+ ahc_set_width(ahc, devinfo, scb->ccb->ccb_h.path,
+ bus_width,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL);
/* After a wide message, we are async */
- ahc_set_syncrate(ahc, devinfo, path,
+ ahc_set_syncrate(ahc, devinfo, scb->ccb->ccb_h.path,
/*syncrate*/NULL, /*period*/0,
/*offset*/0, AHC_TRANS_ACTIVE);
- if (sending_reply == FALSE && reject == FALSE) {
+ if ((ahc->wdtrpending & devinfo->target_mask) == 0
+ && (reject == 0)) {
struct ahc_target_tinfo *tinfo;
+ scb->flags &= ~SCB_MSGOUT_WDTR;
tinfo = &ahc->transinfo[devinfo->target_offset];
if (tinfo->goal.period) {
- struct ahc_syncrate *rate;
- u_int period;
- u_int offset;
-
/* Start the sync negotiation */
- period = tinfo->goal.period;
- rate = ahc_devlimited_syncrate(ahc,
- &period);
- offset = tinfo->goal.offset;
- ahc_validate_offset(ahc, rate, &offset,
- tinfo->current.width);
- ahc->msgout_index = 0;
- ahc->msgout_len = 0;
- ahc_construct_sdtr(ahc, period, offset);
- ahc->msgout_index = 0;
- response = TRUE;
+ ahc->sdtrpending |=
+ devinfo->target_mask;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ ahc_outb(ahc, MSG_OUT, HOST_MSG);
+ ahc_outb(ahc, SCSISIGO,
+ ahc_inb(ahc, SCSISIGO) | ATNO);
}
}
done = TRUE;
@@ -2870,20 +2251,6 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
reject = TRUE;
break;
}
- break;
- }
- case MSG_ABORT:
- case MSG_ABORT_TAG:
- case MSG_BUS_DEV_RESET:
- case MSG_CLEAR_QUEUE:
- case MSG_TERM_IO_PROC:
- /* Target mode messages */
- if (devinfo->role != ROLE_TARGET)
- reject = TRUE;
- break;
- default:
- reject = TRUE;
- break;
}
if (reject) {
@@ -2891,128 +2258,43 @@ ahc_parse_msg(struct ahc_softc *ahc, struct cam_path *path,
* Assert attention and setup to
* reject the message.
*/
- ahc->msgout_index = 0;
- ahc->msgout_len = 1;
- ahc->msgout_buf[0] = MSG_MESSAGE_REJECT;
+ ahc_outb(ahc, MSG_OUT, MSG_MESSAGE_REJECT);
+ ahc_outb(ahc, SCSISIGO, ahc_inb(ahc, SCSISIGO) | ATNO);
done = TRUE;
- response = TRUE;
}
-
- if (done && !response)
- /* Clear the outgoing message buffer */
- ahc->msgout_len = 0;
-
return (done);
}
static void
-ahc_handle_ign_wide_residue(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
-{
- u_int scb_index;
- struct scb *scb;
-
- scb_index = ahc_inb(ahc, SCB_TAG);
- scb = ahc->scb_data->scbarray[scb_index];
- if ((ahc_inb(ahc, SEQ_FLAGS) & DPHASE) == 0
- || (scb->ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_IN) {
- /*
- * Ignore the message if we haven't
- * seen an appropriate data phase yet.
- */
- } else {
- /*
- * If the residual occurred on the last
- * transfer and the transfer request was
- * expected to end on an odd count, do
- * nothing. Otherwise, subtract a byte
- * and update the residual count accordingly.
- */
- u_int resid_sgcnt;
-
- resid_sgcnt = ahc_inb(ahc, SCB_RESID_SGCNT);
- if (resid_sgcnt == 0
- && ahc_inb(ahc, DATA_COUNT_ODD) == 1) {
- /*
- * If the residual occurred on the last
- * transfer and the transfer request was
- * expected to end on an odd count, do
- * nothing.
- */
- } else {
- u_int data_cnt;
- u_int data_addr;
- u_int sg_index;
-
- data_cnt = (ahc_inb(ahc, SCB_RESID_DCNT + 2) << 16)
- | (ahc_inb(ahc, SCB_RESID_DCNT + 1) << 8)
- | (ahc_inb(ahc, SCB_RESID_DCNT));
-
- data_addr = (ahc_inb(ahc, SHADDR + 3) << 24)
- | (ahc_inb(ahc, SHADDR + 2) << 16)
- | (ahc_inb(ahc, SHADDR + 1) << 8)
- | (ahc_inb(ahc, SHADDR));
-
- data_cnt += 1;
- data_addr -= 1;
-
- sg_index = scb->sg_count - resid_sgcnt;
-
- /*
- * scb->ahc_dma starts with the second S/G entry.
- */
- if (sg_index-- != 0
- && (scb->ahc_dma[sg_index].len < data_cnt)) {
- u_int sg_addr;
-
- data_cnt = 1;
- data_addr = scb->ahc_dma[sg_index - 1].addr
- + scb->ahc_dma[sg_index - 1].len - 1;
-
- sg_addr = scb->ahc_dmaphys
- + (sg_index * sizeof(*scb->ahc_dma));
- ahc_outb(ahc, SG_NEXT + 3, sg_addr >> 24);
- ahc_outb(ahc, SG_NEXT + 2, sg_addr >> 16);
- ahc_outb(ahc, SG_NEXT + 1, sg_addr >> 8);
- ahc_outb(ahc, SG_NEXT, sg_addr);
- }
-
- ahc_outb(ahc, SCB_RESID_DCNT + 2, data_cnt >> 16);
- ahc_outb(ahc, SCB_RESID_DCNT + 1, data_cnt >> 8);
- ahc_outb(ahc, SCB_RESID_DCNT, data_cnt);
-
- ahc_outb(ahc, SHADDR + 3, data_addr >> 24);
- ahc_outb(ahc, SHADDR + 2, data_addr >> 16);
- ahc_outb(ahc, SHADDR + 1, data_addr >> 8);
- ahc_outb(ahc, SHADDR, data_addr);
- }
- }
-}
-
-static void
ahc_handle_devreset(struct ahc_softc *ahc, int target, char channel,
cam_status status, ac_code acode, char *message,
int verbose_only)
{
struct ahc_devinfo devinfo;
struct cam_path *path;
+ path_id_t path_id;
int found;
int error;
- ahc_compile_devinfo(&devinfo, target, CAM_LUN_WILDCARD, channel,
- ROLE_UNKNOWN);
+ ahc_compile_devinfo(&devinfo, target, channel);
- error = ahc_create_path(ahc, &devinfo, &path);
+ if (channel == 'B')
+ path_id = cam_sim_path(ahc->sim_b);
+ else
+ path_id = cam_sim_path(ahc->sim);
+ error = xpt_create_path(&path, /*periph*/NULL, path_id, target,
+ CAM_LUN_WILDCARD);
/*
* Go back to async/narrow transfers and renegotiate.
- * ahc_set_width and ahc_set_syncrate can cope with NULL
- * paths.
*/
- ahc_set_width(ahc, &devinfo, path, MSG_EXT_WDTR_BUS_8_BIT,
- AHC_TRANS_CUR);
- ahc_set_syncrate(ahc, &devinfo, path, /*syncrate*/NULL,
- /*period*/0, /*offset*/0, AHC_TRANS_CUR);
- found = ahc_abort_scbs(ahc, target, channel, CAM_LUN_WILDCARD,
+ if (error == CAM_REQ_CMP) {
+ ahc_set_width(ahc, &devinfo, path, MSG_EXT_WDTR_BUS_8_BIT,
+ AHC_TRANS_CUR);
+ ahc_set_syncrate(ahc, &devinfo, path, /*syncrate*/NULL,
+ /*period*/0, /*offset*/0, AHC_TRANS_CUR);
+ }
+ found = ahc_abort_scbs(ahc, target, channel, ALL_LUNS,
SCB_LIST_NULL, status);
if (error == CAM_REQ_CMP && acode != 0)
@@ -3064,6 +2346,8 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
ahc_index_busy_tcl(ahc, scb->hscb->tcl, /*unbusy*/TRUE);
if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) {
+ xpt_print_path(ccb->ccb_h.path);
+ printf("CONT_TARGET_IO complete\n");
ccb->ccb_h.status = CAM_REQ_CMP;
ahc_free_scb(ahc, scb);
xpt_done(ccb);
@@ -3108,6 +2392,22 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
ccb->ccb_h.status);
}
+ if ((scb->flags & (SCB_MSGOUT_WDTR|SCB_MSGOUT_SDTR)) != 0) {
+ /*
+ * Turn off the pending flags for any DTR messages
+ * regardless of whether they completed successfully
+ * or not. This ensures that we don't have lingering
+ * state after we abort an SCB.
+ */
+ u_int16_t mask;
+
+ mask = (0x01 << (SCB_TARGET(scb)
+ | (SCB_IS_SCSIBUS_B(scb) ? SELBUSB : 0)));
+ if (scb->flags & SCB_MSGOUT_WDTR)
+ ahc->wdtrpending &= ~mask;
+ if (scb->flags & SCB_MSGOUT_SDTR)
+ ahc->sdtrpending &= ~mask;
+ }
/* Don't clobber any existing error state */
if (ahc_ccb_status(ccb) == CAM_REQ_INPROG) {
ccb->ccb_h.status |= CAM_REQ_CMP;
@@ -3150,7 +2450,6 @@ ahc_init(struct ahc_softc *ahc)
int i;
int term;
u_int scsi_conf;
- u_int scsiseq_template;
#ifdef AHC_PRINT_SRAM
printf("Scratch Ram:");
@@ -3179,21 +2478,11 @@ ahc_init(struct ahc_softc *ahc)
}
/*
- * Default to allowing initiator operations.
- */
- ahc->flags |= AHC_INITIATORMODE;
-
- /*
* XXX Would be better to use a per device flag, but PCI and EISA
* devices don't have them yet.
*/
- if ((AHC_TMODE_ENABLE & (0x01 << ahc->unit)) != 0) {
+ if ((AHC_TMODE_ENABLE & (0x01 << ahc->unit)) != 0)
ahc->flags |= AHC_TARGETMODE;
- if ((ahc->features & AHC_ULTRA2) == 0)
- /* Only have space for both on the Ultra2 chips */
- ahc->flags &= ~AHC_INITIATORMODE;
- }
-
if ((ahc->features & AHC_TWIN) != 0) {
printf("Twin Channel, A SCSI Id=%d, B SCSI Id=%d, primary %c, ",
@@ -3246,10 +2535,18 @@ ahc_init(struct ahc_softc *ahc)
if (ahc->scb_data->maxhscbs < AHC_SCB_MAX) {
ahc->flags |= AHC_PAGESCBS;
ahc->scb_data->maxscbs = AHC_SCB_MAX;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ /* Steal one slot for TMODE commands */
+ ahc->scb_data->maxscbs--;
+ }
printf("%d/%d SCBs\n", ahc->scb_data->maxhscbs,
ahc->scb_data->maxscbs);
} else {
ahc->scb_data->maxscbs = ahc->scb_data->maxhscbs;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ /* Steal one slot for TMODE commands */
+ ahc->scb_data->maxscbs--;
+ }
ahc->flags &= ~AHC_PAGESCBS;
printf("%d SCBs\n", ahc->scb_data->maxhscbs);
}
@@ -3283,14 +2580,13 @@ ahc_init(struct ahc_softc *ahc)
ahc_outb(ahc, SIMODE1, ENSELTIMO|ENSCSIRST|ENSCSIPERR);
ahc_outb(ahc, SXFRCTL0, DFON|SPIOEN);
-#if 0
- if ((scsi_conf & RESET_SCSI) != 0
- && (ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_B;
-#else
- if ((ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_B;
-#endif
+ if (scsi_conf & RESET_SCSI) {
+ /* Reset the bus */
+ if (bootverbose)
+ printf("%s: Resetting Channel B\n",
+ ahc_name(ahc));
+ ahc_reset_current_bus(ahc);
+ }
/* Select Channel A */
ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~SELBUSB);
@@ -3318,14 +2614,14 @@ ahc_init(struct ahc_softc *ahc)
ahc_name(ahc));
}
-#if 0
- if ((scsi_conf & RESET_SCSI) != 0
- && (ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_A;
-#else
- if ((ahc->flags & AHC_INITIATORMODE) != 0)
- ahc->flags |= AHC_RESET_BUS_A;
-#endif
+ if (scsi_conf & RESET_SCSI) {
+ /* Reset the bus */
+ if (bootverbose)
+ printf("%s: Resetting Channel %c\n", ahc_name(ahc),
+ ahc->channel);
+
+ ahc_reset_current_bus(ahc);
+ }
/*
* Look at the information that board initialization or
@@ -3337,7 +2633,7 @@ ahc_init(struct ahc_softc *ahc)
* flag.
*/
ahc->ultraenb = 0;
- ahc->tagenable = ALL_TARGETS_MASK;
+ ahc->tagenable = ALL_TARGETS;
/* Grab the disconnection disable table and invert it for our needs */
if (ahc->flags & AHC_USEDEFAULTS) {
@@ -3345,7 +2641,7 @@ ahc_init(struct ahc_softc *ahc)
"device parameters\n", ahc_name(ahc));
ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B|
AHC_TERM_ENB_A|AHC_TERM_ENB_B;
- ahc->discenable = ALL_TARGETS_MASK;
+ ahc->discenable = ALL_TARGETS;
if ((ahc->features & AHC_ULTRA) != 0)
ahc->ultraenb = 0xffff;
} else {
@@ -3421,6 +2717,8 @@ ahc_init(struct ahc_softc *ahc)
}
}
+ ahc->sdtrpending = 0;
+ ahc->wdtrpending = 0;
#ifdef AHC_DEBUG
if (ahc_debug & AHC_SHOWMISC)
@@ -3463,10 +2761,9 @@ ahc_init(struct ahc_softc *ahc)
if ((ahc->flags & AHC_TARGETMODE) != 0) {
size_t array_size;
- array_size = AHC_TMODE_CMDS * sizeof(struct target_cmd);
- ahc->targetcmds = contigmalloc(array_size, M_DEVBUF,
- M_NOWAIT, 0ul, 0xffffffff,
- PAGE_SIZE, 0x10000);
+ ahc->num_targetcmds = 32;
+ array_size = ahc->num_targetcmds * sizeof(struct target_cmd);
+ ahc->targetcmds = malloc(array_size, M_DEVBUF, M_NOWAIT);
if (ahc->targetcmds == NULL) {
printf("%s: unable to allocate targetcmd array. "
@@ -3474,11 +2771,8 @@ ahc_init(struct ahc_softc *ahc)
return (-1);
}
- /* All target command blocks start out invalid. */
- for (i = 0; i < AHC_TMODE_CMDS; i++)
- ahc->targetcmds[i].cmd_valid = 0;
- ahc_outb(ahc, KERNEL_TQINPOS, 0);
- ahc_outb(ahc, TQINPOS, 0);
+ bzero(ahc->targetcmds, array_size);
+ ahc_outb(ahc, TMODE_CMDADDR_NEXT, 0);
}
/*
@@ -3535,10 +2829,6 @@ ahc_init(struct ahc_softc *ahc)
ahc_outb(ahc, QINPOS, 0);
ahc_outb(ahc, QOUTPOS, 0);
- /* Don't have any special messages to send to targets */
- ahc_outb(ahc, TARGET_MSG_REQUEST, 0);
- ahc_outb(ahc, TARGET_MSG_REQUEST + 1, 0);
-
/*
* Use the built in queue management registers
* if they are available.
@@ -3561,16 +2851,6 @@ ahc_init(struct ahc_softc *ahc)
ahc_outb(ahc, MSG_OUT, MSG_NOOP);
/*
- * Setup the allowed SCSI Sequences based on operational mode.
- * If we are a target, we'll enalbe select in operations once
- * we've had a lun enabled.
- */
- scsiseq_template = ENSELO|ENAUTOATNO|ENAUTOATNP;
- if ((ahc->flags & AHC_INITIATORMODE) != 0)
- scsiseq_template |= ENRSELI;
- ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq_template);
-
- /*
* Load the Sequencer program and Enable the adapter
* in "fast" mode.
*/
@@ -3586,6 +2866,21 @@ ahc_init(struct ahc_softc *ahc)
return (0);
}
+static void
+ahcminphys(struct buf *bp)
+{
+/*
+ * Even though the card can transfer up to 16megs per command
+ * we are limited by the number of segments in the dma segment
+ * list that we can hold. The worst case is that all pages are
+ * discontinuous physically, hense the "page per segment" limit
+ * enforced here.
+ */
+ if (bp->b_bcount > ((AHC_NSEG - 1) * PAGE_SIZE)) {
+ bp->b_bcount = ((AHC_NSEG - 1) * PAGE_SIZE);
+ }
+}
+
static cam_status
ahc_find_tmode_devs(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb,
struct tmode_tstate **tstate, struct tmode_lstate **lstate,
@@ -3601,34 +2896,22 @@ ahc_find_tmode_devs(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb,
return (CAM_REQ_INVALID);
/* Range check target and lun */
+ if (cam_sim_bus(sim) == 0)
+ our_id = ahc->our_id;
+ else
+ our_id = ahc->our_id_b;
+ if (ccb->ccb_h.target_id > ((ahc->features & AHC_WIDE) ? 15 : 7)
+ || ((ahc->features & AHC_MULTI_TID) == 0
+ && (ccb->ccb_h.target_id != our_id)))
+ return (CAM_TID_INVALID);
- /*
- * Handle the 'black hole' device that sucks up
- * requests to unattached luns on enabled targets.
- */
- if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD
- && ccb->ccb_h.target_lun == CAM_LUN_WILDCARD) {
- *tstate = NULL;
- *lstate = ahc->black_hole;
- } else {
- if (cam_sim_bus(sim) == 0)
- our_id = ahc->our_id;
- else
- our_id = ahc->our_id_b;
- if (ccb->ccb_h.target_id > ((ahc->features & AHC_WIDE) ? 15 : 7)
- || ((ahc->features & AHC_MULTI_TID) == 0
- && (ccb->ccb_h.target_id != our_id)))
- return (CAM_TID_INVALID);
-
- if (ccb->ccb_h.target_lun > 8)
- return (CAM_LUN_INVALID);
-
- *tstate = ahc->enabled_targets[ccb->ccb_h.target_id];
- *lstate = NULL;
- if (*tstate != NULL)
- *lstate =
- (*tstate)->enabled_luns[ccb->ccb_h.target_lun];
- }
+ if (ccb->ccb_h.target_lun > 8)
+ return (CAM_LUN_INVALID);
+
+ *tstate = ahc->enabled_targets[ccb->ccb_h.target_id];
+ *lstate = NULL;
+ if (*tstate != NULL)
+ *lstate = (*tstate)->enabled_luns[ccb->ccb_h.target_lun];
if (notfound_failure != 0 && *lstate == NULL)
return (CAM_PATH_INVALID);
@@ -3662,15 +2945,9 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
&lstate, TRUE);
if (status != CAM_REQ_CMP) {
- if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) {
- /* Response from the black hole device */
- tstate = NULL;
- lstate = ahc->black_hole;
- } else {
- ccb->ccb_h.status = status;
- xpt_done(ccb);
- break;
- }
+ ccb->ccb_h.status = status;
+ xpt_done(ccb);
+ break;
}
if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) {
SLIST_INSERT_HEAD(&lstate->accept_tios, &ccb->ccb_h,
@@ -3685,6 +2962,8 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
* the original command.
*/
target_id = ccb->csio.init_id;
+ xpt_print_path(ccb->ccb_h.path);
+ printf("Sending a continue TIO\n");
/* FALLTHROUGH */
}
case XPT_SCSI_IO: /* Execute the requested I/O operation */
@@ -3746,7 +3025,21 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
hscb->control |= MK_MESSAGE;
ahc_execute_scb(scb, NULL, 0, 0);
} else {
- if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) {
+ if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
+ if (tinfo->current.width != tinfo->goal.width) {
+ if ((ahc->wdtrpending & mask) == 0) {
+ ahc->wdtrpending |= mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_WDTR;
+ }
+ } else if ((tinfo->current.period
+ != tinfo->goal.period)
+ && (ahc->sdtrpending & mask) == 0) {
+ ahc->sdtrpending |= mask;
+ hscb->control |= MK_MESSAGE;
+ scb->flags |= SCB_MSGOUT_SDTR;
+ }
+ } else {
if (ahc->pending_device == lstate) {
scb->flags |= SCB_TARGET_IMMEDIATE;
ahc->pending_device = NULL;
@@ -3797,14 +3090,105 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
break;
}
case XPT_EN_LUN: /* Enable LUN as a target */
- ahc_handle_en_lun(ahc, sim, ccb);
- xpt_done(ccb);
- break;
- case XPT_ABORT: /* Abort the specified CCB */
{
- ahc_abort_ccb(ahc, sim, ccb);
+ struct tmode_tstate *tstate;
+ struct tmode_lstate *lstate;
+ struct ccb_en_lun *cel;
+ cam_status status;
+ int target;
+ int lun;
+
+ status = ahc_find_tmode_devs(ahc, sim, ccb, &tstate, &lstate,
+ /* notfound_failure*/FALSE);
+
+ if (status != CAM_REQ_CMP) {
+ ccb->ccb_h.status = status;
+ xpt_done(ccb);
+ break;
+ }
+
+ cel = &ccb->cel;
+ target = ccb->ccb_h.target_id;
+ lun = ccb->ccb_h.target_lun;
+ if (cel->enable != 0) {
+ /* Are we already enabled?? */
+ if (lstate != NULL) {
+ ccb->ccb_h.status = CAM_LUN_ALRDY_ENA;
+ xpt_done(ccb);
+ break;
+ }
+
+ if (cel->grp6_len != 0
+ || cel->grp7_len != 0) {
+ /*
+ * Don't (yet?) support vendor
+ * specific commands.
+ */
+ ccb->ccb_h.status = CAM_REQ_INVALID;
+ xpt_done(ccb);
+ break;
+ }
+
+ /*
+ * Seems to be okay.
+ * Setup our data structures.
+ */
+ if (tstate == NULL) {
+ tstate = malloc(sizeof(*tstate),
+ M_DEVBUF, M_NOWAIT);
+ if (tstate == NULL) {
+ ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ xpt_done(ccb);
+ break;
+ }
+ bzero(tstate, sizeof(*tstate));
+ ahc->enabled_targets[target] = tstate;
+ }
+ lstate = malloc(sizeof(*lstate), M_DEVBUF, M_NOWAIT);
+ if (lstate == NULL) {
+ ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ xpt_done(ccb);
+ break;
+ }
+ bzero(lstate, sizeof(*lstate));
+ SLIST_INIT(&lstate->accept_tios);
+ SLIST_INIT(&lstate->immed_notifies);
+ tstate->enabled_luns[lun] = lstate;
+ if ((ahc->features & AHC_MULTI_TID) != 0) {
+ u_int16_t targid_mask;
+
+ pause_sequencer(ahc);
+ targid_mask = ahc_inb(ahc, TARGID)
+ | (ahc_inb(ahc, TARGID + 1) << 8);
+
+ targid_mask |= (0x01 << target);
+ ahc_outb(ahc, TARGID, targid_mask);
+ ahc_outb(ahc, TARGID+1, (targid_mask >> 8));
+ unpause_sequencer(ahc, /*always?*/FALSE);
+ }
+ ccb->ccb_h.status = CAM_REQ_CMP;
+ xpt_print_path(ccb->ccb_h.path);
+ printf("Lun now enabled for target mode\n");
+ xpt_done(ccb);
+ break;
+ } else {
+ /* XXX Fully Implement Disable */
+ if (lstate == NULL) {
+ ccb->ccb_h.status = CAM_LUN_INVALID;
+ xpt_done(ccb);
+ break;
+ }
+ ccb->ccb_h.status = CAM_REQ_CMP;
+ xpt_done(ccb);
+ break;
+ }
break;
}
+ case XPT_ABORT: /* Abort the specified CCB */
+ /* XXX Implement */
+ ccb->ccb_h.status = CAM_REQ_INVALID;
+ xpt_done(ccb);
+ break;
case XPT_SET_TRAN_SETTINGS:
{
struct ahc_devinfo devinfo;
@@ -3815,9 +3199,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
cts = &ccb->cts;
ahc_compile_devinfo(&devinfo, cts->ccb_h.target_id,
- cts->ccb_h.target_lun,
- SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A',
- ROLE_UNKNOWN);
+ SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A');
tinfo = &ahc->transinfo[devinfo.target_offset];
update_type = 0;
if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
@@ -3853,8 +3235,10 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
break;
}
- ahc_set_width(ahc, &devinfo, cts->ccb_h.path,
- cts->bus_width, update_type);
+ if ((update_type & AHC_TRANS_GOAL) != 0)
+ tinfo->goal.width = cts->bus_width;
+ if ((update_type & AHC_TRANS_USER) != 0)
+ tinfo->user.width = cts->bus_width;
}
if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
@@ -3868,21 +3252,30 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
else
maxsync = AHC_SYNCRATE_FAST;
- if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0)
+ if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
+ if (cts->sync_offset != 0)
+ cts->sync_offset = ~0;
+ } else {
cts->sync_offset = 0;
+ }
syncrate = ahc_find_syncrate(ahc, &cts->sync_period,
maxsync);
ahc_validate_offset(ahc, syncrate, &cts->sync_offset,
- MSG_EXT_WDTR_BUS_8_BIT);
+ tinfo->goal.width);
/* We use a period of 0 to represent async */
if (cts->sync_offset == 0)
cts->sync_period = 0;
- ahc_set_syncrate(ahc, &devinfo, cts->ccb_h.path,
- syncrate, cts->sync_period,
- cts->sync_offset, update_type);
+ if ((update_type & AHC_TRANS_GOAL) != 0) {
+ tinfo->goal.period = cts->sync_period;
+ tinfo->goal.offset = cts->sync_offset;
+ }
+ if ((update_type & AHC_TRANS_USER) != 0) {
+ tinfo->user.period = cts->sync_period;
+ tinfo->user.offset = cts->sync_offset;
+ }
}
splx(s);
ccb->ccb_h.status = CAM_REQ_CMP;
@@ -3900,9 +3293,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
cts = &ccb->cts;
ahc_compile_devinfo(&devinfo, cts->ccb_h.target_id,
- cts->ccb_h.target_lun,
- SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A',
- ROLE_UNKNOWN);
+ SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A');
targ_info = &ahc->transinfo[devinfo.target_offset];
if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
@@ -4007,20 +3398,14 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
} else {
cpi->target_sprt = 0;
}
- cpi->hba_misc = (ahc->flags & AHC_INITIATORMODE)
- ? 0 : PIM_NOINITIATOR;
+ cpi->hba_misc = 0;
cpi->hba_eng_cnt = 0;
cpi->max_target = (ahc->features & AHC_WIDE) ? 15 : 7;
cpi->max_lun = 7;
- if (SIM_IS_SCSIBUS_B(ahc, sim)) {
+ if (SIM_IS_SCSIBUS_B(ahc, sim))
cpi->initiator_id = ahc->our_id_b;
- if ((ahc->flags & AHC_RESET_BUS_B) == 0)
- cpi->hba_misc |= PIM_NOBUSRESET;
- } else {
+ else
cpi->initiator_id = ahc->our_id;
- if ((ahc->flags & AHC_RESET_BUS_A) == 0)
- cpi->hba_misc |= PIM_NOBUSRESET;
- }
cpi->bus_id = cam_sim_bus(sim);
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
@@ -4051,9 +3436,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
struct ahc_devinfo devinfo;
ahc_compile_devinfo(&devinfo, xpt_path_target_id(path),
- xpt_path_lun_id(path),
- SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A',
- ROLE_UNKNOWN);
+ SIM_IS_SCSIBUS_B(ahc, sim) ? 'B' : 'A');
/*
* Revert to async/narrow transfers
@@ -4152,12 +3535,12 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
(ccb->ccb_h.timeout * hz) / 1000);
if ((scb->flags & SCB_TARGET_IMMEDIATE) != 0) {
+ xpt_print_path(ccb->ccb_h.path);
+ printf("Returning an immediate CTIO\n");
if ((ahc->flags & AHC_PAGESCBS) == 0)
ahc_outb(ahc, SCBPTR, scb->hscb->tag);
- pause_sequencer(ahc);
ahc_outb(ahc, SCB_TAG, scb->hscb->tag);
- ahc_outb(ahc, RETURN_1, CONT_MSG_LOOP);
- unpause_sequencer(ahc, /*unpause_always*/FALSE);
+ unpause_sequencer(ahc, /*unpause_always*/TRUE);
} else {
ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag;
@@ -4428,10 +3811,7 @@ ahc_loadseq(struct ahc_softc *ahc)
u_int8_t download_consts[4];
/* Setup downloadable constant table */
-#if 0
- /* No downloaded constants are currently defined. */
download_consts[TMODE_NUMCMDS] = ahc->num_targetcmds;
-#endif
cur_patch = patches;
downloaded = 0;
@@ -4716,14 +4096,12 @@ ahc_timeout(void *arg)
break;
}
- printf(", SEQADDR == 0x%x\n",
- ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
-
-#if 0
printf(", SCSISIGI == 0x%x\n", ahc_inb(ahc, SCSISIGI));
- printf("SIMODE1 = 0x%x\n", ahc_inb(ahc, SIMODE1));
- printf("INTSTAT = 0x%x\n", ahc_inb(ahc, INTSTAT));
+
+ printf("SEQADDR == 0x%x\n", ahc_inb(ahc, SEQADDR0)
+ | (ahc_inb(ahc, SEQADDR1) << 8));
printf("SSTAT1 == 0x%x\n", ahc_inb(ahc, SSTAT1));
+#if 0
printf("SCSIRATE == 0x%x\n", ahc_inb(ahc, SCSIRATE));
printf("CCSCBCTL == 0x%x\n", ahc_inb(ahc, CCSCBCTL));
printf("CCSCBCNT == 0x%x\n", ahc_inb(ahc, CCSCBCNT));
@@ -4731,6 +4109,7 @@ ahc_timeout(void *arg)
printf("DFSTATUS == 0x%x\n", ahc_inb(ahc, DFSTATUS));
printf("CCHCNT == 0x%x\n", ahc_inb(ahc, CCHCNT));
#endif
+ /* Decide our course of action */
if (scb->flags & SCB_DEVICE_RESET) {
/*
* Been down this road before.
@@ -4743,26 +4122,18 @@ bus_reset:
"%d SCBs aborted\n", ahc_name(ahc), channel, found);
} else {
/*
- * If we are a target, transition to bus free and report
- * the timeout.
- *
- * The target/initiator that is holding up the bus may not
+ * Send a Bus Device Reset message:
+ * The target that is holding up the bus may not
* be the same as the one that triggered this timeout
* (different commands have different timeout lengths).
- * If the bus is idle and we are actiing as the initiator
- * for this request, queue a BDR message to the timed out
- * target. Otherwise, if the timed out transaction is
- * active:
- * Initiator transaction:
- * Stuff the message buffer with a BDR message and assert
- * ATN in the hopes that the target will let go of the bus
- * and go to the mesgout phase. If this fails, we'll
- * get another timeout 2 seconds later which will attempt
- * a bus reset.
- *
- * Target transaction:
- * Transition to BUS FREE and report the error.
- * It's good to be the target!
+ * Our strategy here is to queue a BDR message
+ * to the timed out target if the bus is idle.
+ * Otherwise, if we have an active target we stuff the
+ * message buffer with a BDR message and assert ATN
+ * in the hopes that the target will let go of the bus
+ * and go to the mesgout phase. If this fails, we'll
+ * get another timeout 2 seconds later which will attempt
+ * a bus reset.
*/
u_int active_scb_index;
@@ -4793,25 +4164,7 @@ bus_reset:
(newtimeout * hz) / 1000);
splx(s);
return;
- }
-
- /* It's us */
- if ((scb->hscb->control & TARGET_SCB) != 0) {
-
- /*
- * Send back any queued up transactions
- * and properly record the error condition.
- */
- ahc_freeze_devq(ahc, scb->ccb->ccb_h.path);
- ahc_set_ccb_status(scb->ccb, CAM_CMD_TIMEOUT);
- ahc_freeze_ccb(scb->ccb);
- ahc_done(ahc, scb);
-
- /* Will clear us from the bus */
- restart_sequencer(ahc);
- return;
}
-
ahc_set_recoveryscb(ahc, active_scb);
ahc_outb(ahc, MSG_OUT, MSG_BUS_DEV_RESET);
ahc_outb(ahc, SCSISIGO, bus_state|ATNO);
@@ -4824,15 +4177,6 @@ bus_reset:
} else {
int disconnected;
- if (bus_state != P_BUSFREE
- && (ahc_inb(ahc, SSTAT0) & TARGET) != 0) {
- /* Hung target selection. Goto busfree */
- printf("%s: Hung target selection\n",
- ahc_name(ahc));
- restart_sequencer(ahc);
- return;
- }
-
if (ahc_search_qinfifo(ahc, target, channel, lun,
scb->hscb->tag, /*status*/0,
SEARCH_COUNT) > 0) {
@@ -4959,86 +4303,6 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel,
}
-static void
-ahc_abort_ccb(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
-{
- union ccb *abort_ccb;
-
- abort_ccb = ccb->cab.abort_ccb;
- switch (abort_ccb->ccb_h.func_code) {
- case XPT_ACCEPT_TARGET_IO:
- case XPT_IMMED_NOTIFY:
- case XPT_CONT_TARGET_IO:
- {
- struct tmode_tstate *tstate;
- struct tmode_lstate *lstate;
- struct ccb_hdr_slist *list;
- cam_status status;
-
- status = ahc_find_tmode_devs(ahc, sim, abort_ccb, &tstate,
- &lstate, TRUE);
-
- if (status != CAM_REQ_CMP) {
- ccb->ccb_h.status = status;
- break;
- }
-
- if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO)
- list = &lstate->accept_tios;
- else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY)
- list = &lstate->immed_notifies;
- else
- list = NULL;
-
- if (list != NULL) {
- struct ccb_hdr *curelm;
- int found;
-
- curelm = SLIST_FIRST(list);
- found = 0;
- if (curelm == &abort_ccb->ccb_h) {
- found = 1;
- SLIST_REMOVE_HEAD(list, sim_links.sle);
- } else {
- while(curelm != NULL) {
- struct ccb_hdr *nextelm;
-
- nextelm =
- SLIST_NEXT(curelm, sim_links.sle);
-
- if (nextelm == &abort_ccb->ccb_h) {
- found = 1;
- SLIST_NEXT(curelm,
- sim_links.sle) =
- SLIST_NEXT(nextelm,
- sim_links.sle);
- break;
- }
- curelm = nextelm;
- }
- }
-
- if (found)
- abort_ccb->ccb_h.status = CAM_REQ_ABORTED;
- else {
- printf("Not found\n");
- ccb->ccb_h.status = CAM_PATH_INVALID;
- }
- break;
- }
- /* FALLTHROUGH */
- }
- case XPT_SCSI_IO:
- /* XXX Fully implement the hard ones */
- ccb->ccb_h.status = CAM_UA_ABORT;
- break;
- default:
- ccb->ccb_h.status = CAM_REQ_INVALID;
- break;
- }
- xpt_done(ccb);
-}
-
/*
* Abort all SCBs that match the given description (target/channel/lun/tag),
* setting their status to the passed in status if the status has not already
@@ -5303,9 +4567,8 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
* Clean up all the state information for the
* pending transactions on this bus.
*/
- found = ahc_abort_scbs(ahc, CAM_TARGET_WILDCARD, channel,
- CAM_LUN_WILDCARD, SCB_LIST_NULL,
- CAM_SCSI_BUS_RESET);
+ found = ahc_abort_scbs(ahc, ALL_TARGETS, channel, ALL_LUNS,
+ SCB_LIST_NULL, CAM_SCSI_BUS_RESET);
path = channel == 'B' ? ahc->path_b : ahc->path;
/* Notify the XPT that a bus reset occurred */
@@ -5318,8 +4581,7 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
for (target = 0; target <= max_target; target++) {
struct ahc_devinfo devinfo;
- ahc_compile_devinfo(&devinfo, target, CAM_LUN_WILDCARD,
- channel, ROLE_UNKNOWN);
+ ahc_compile_devinfo(&devinfo, target, channel);
ahc_set_width(ahc, &devinfo, path, MSG_EXT_WDTR_BUS_8_BIT,
AHC_TRANS_CUR);
ahc_set_syncrate(ahc, &devinfo, path, /*syncrate*/NULL,
@@ -5341,7 +4603,8 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
* upsetting the current bus.
*/
ahc_outb(ahc, SBLKCTL, sblkctl ^ SELBUSB);
- ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENREQINIT));
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP));
if (initiate_reset)
@@ -5351,8 +4614,10 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
unpause_sequencer(ahc, /*unpause_always*/FALSE);
} else {
/* Case 2: A command from this bus is active or we're idle */
- ahc_clear_msg_state(ahc);
- ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
+ ahc_outb(ahc, SIMODE1,
+ ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENREQINIT));
+ ahc->flags &= ~AHC_HANDLING_REQINITS;
+ ahc->msg_type = MSG_TYPE_NONE;
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP));
if (initiate_reset)
@@ -5373,9 +4638,9 @@ ahc_match_scb (struct scb *scb, int target, char channel, int lun, u_int tag)
match = ((chan == channel) || (channel == ALL_CHANNELS));
if (match != 0)
- match = ((targ == target) || (target == CAM_TARGET_WILDCARD));
+ match = ((targ == target) || (target == ALL_TARGETS));
if (match != 0)
- match = ((lun == slun) || (lun == CAM_LUN_WILDCARD));
+ match = ((lun == slun) || (lun == ALL_LUNS));
if (match != 0)
match = ((tag == scb->hscb->tag) || (tag == SCB_LIST_NULL));
@@ -5385,22 +4650,22 @@ ahc_match_scb (struct scb *scb, int target, char channel, int lun, u_int tag)
static void
ahc_construct_sdtr(struct ahc_softc *ahc, u_int period, u_int offset)
{
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXTENDED;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_SDTR_LEN;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_SDTR;
- ahc->msgout_buf[ahc->msgout_index++] = period;
- ahc->msgout_buf[ahc->msgout_index++] = offset;
- ahc->msgout_len += 5;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXTENDED;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_SDTR_LEN;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_SDTR;
+ ahc->msg_buf[ahc->msg_index++] = period;
+ ahc->msg_buf[ahc->msg_index++] = offset;
+ ahc->msg_len += 5;
}
static void
ahc_construct_wdtr(struct ahc_softc *ahc, u_int bus_width)
{
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXTENDED;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_WDTR_LEN;
- ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_WDTR;
- ahc->msgout_buf[ahc->msgout_index++] = bus_width;
- ahc->msgout_len += 4;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXTENDED;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_WDTR_LEN;
+ ahc->msg_buf[ahc->msg_index++] = MSG_EXT_WDTR;
+ ahc->msg_buf[ahc->msg_index++] = bus_width;
+ ahc->msg_len += 4;
}
static void
@@ -5495,9 +4760,7 @@ ahc_update_pending_syncrates(struct ahc_softc *ahc)
pending_scb = (struct scb *)ccbh->ccb_scb_ptr;
pending_hscb = pending_scb->hscb;
ahc_compile_devinfo(&devinfo, SCB_TARGET(pending_scb),
- SCB_LUN(pending_scb),
- SCB_CHANNEL(pending_scb),
- ROLE_UNKNOWN);
+ SCB_CHANNEL(pending_scb));
tinfo = &ahc->transinfo[devinfo.target_offset];
pending_hscb->control &= ~ULTRAENB;
if ((ahc->ultraenb & devinfo.target_mask) != 0)
@@ -5528,9 +4791,7 @@ ahc_update_pending_syncrates(struct ahc_softc *ahc)
pending_scb = ahc->scb_data->scbarray[scb_tag];
pending_hscb = pending_scb->hscb;
ahc_compile_devinfo(&devinfo, SCB_TARGET(pending_scb),
- SCB_LUN(pending_scb),
- SCB_CHANNEL(pending_scb),
- ROLE_UNKNOWN);
+ SCB_CHANNEL(pending_scb));
tinfo = &ahc->transinfo[devinfo.target_offset];
control = ahc_inb(ahc, SCB_CONTROL);
control &= ~ULTRAENB;
@@ -5544,7 +4805,6 @@ ahc_update_pending_syncrates(struct ahc_softc *ahc)
ahc_outb(ahc, SCBPTR, saved_scbptr);
}
-#if UNUSED
static void
ahc_dump_targcmd(struct target_cmd *cmd)
{
@@ -5552,9 +4812,9 @@ ahc_dump_targcmd(struct target_cmd *cmd)
u_int8_t *last_byte;
int i;
- byte = &cmd->initiator_channel;
+ byte = &cmd->icl;
/* Debugging info for received commands */
- last_byte = &cmd[1].initiator_channel;
+ last_byte = &cmd[1].icl;
i = 0;
while (byte < last_byte) {
@@ -5570,7 +4830,6 @@ ahc_dump_targcmd(struct target_cmd *cmd)
}
}
}
-#endif
static void
ahc_shutdown(int howto, void *arg)
diff --git a/sys/dev/aic7xxx/aic7xxx.h b/sys/dev/aic7xxx/aic7xxx.h
index e46d277e8d585..06f7d4abd4e1e 100644
--- a/sys/dev/aic7xxx/aic7xxx.h
+++ b/sys/dev/aic7xxx/aic7xxx.h
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.h,v 1.4 1998/12/15 08:22:41 gibbs Exp $
+ * $Id: aic7xxx.h,v 1.40 1997/02/25 03:05:35 gibbs Exp $
*/
#ifndef _AIC7XXX_H_
@@ -68,12 +68,6 @@
* aic7850 has only 3.
*/
-#define AHC_TMODE_CMDS 256 /*
- * Ring Buffer of incoming target commands.
- * We allocate 256 to simplify the logic
- * in the sequencer by using the natural
- * wrap point of an 8bit counter.
- */
#if defined(__FreeBSD__)
extern u_long ahc_unit;
@@ -117,11 +111,9 @@ typedef enum {
AHC_AIC7860_FE = AHC_ULTRA|AHC_SPIOCAP,
AHC_AIC7870_FE = AHC_FENONE,
AHC_AIC7880_FE = AHC_ULTRA,
- AHC_AIC7890_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS
- |AHC_SG_PRELOAD|AHC_MULTI_TID,
+ AHC_AIC7890_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS|AHC_SG_PRELOAD|AHC_MULTI_TID,
AHC_AIC7895_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA,
- AHC_AIC7896_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS
- |AHC_SG_PRELOAD|AHC_MULTI_TID,
+ AHC_AIC7896_FE = AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS|AHC_SG_PRELOAD|AHC_MULTI_TID,
} ahc_feature;
typedef enum {
@@ -141,16 +133,11 @@ typedef enum {
AHC_INDIRECT_PAGING = 0x008,
AHC_SHARED_SRAM = 0x010,
AHC_LARGE_SEEPROM = 0x020,/* Uses C56_66 not C46 */
- AHC_RESET_BUS_A = 0x040,
- AHC_RESET_BUS_B = 0x080,
AHC_EXTENDED_TRANS_A = 0x100,
AHC_EXTENDED_TRANS_B = 0x200,
AHC_TERM_ENB_A = 0x400,
AHC_TERM_ENB_B = 0x800,
- AHC_INITIATORMODE = 0x1000,/*
- * Allow initiator operations on
- * this controller.
- */
+ AHC_HANDLING_REQINITS = 0x1000,
AHC_TARGETMODE = 0x2000,/*
* Allow target operations on this
* controller.
@@ -172,6 +159,11 @@ typedef enum {
SCB_DEVICE_RESET = 0x0004,
SCB_SENSE = 0x0008,
SCB_RECOVERY_SCB = 0x0040,
+ SCB_MSGOUT_SENT = 0x0200,
+ SCB_MSGOUT_SDTR = 0x0400,
+ SCB_MSGOUT_WDTR = 0x0800,
+ SCB_MSGOUT_BITS = (SCB_MSGOUT_SDTR|SCB_MSGOUT_WDTR
+ |SCB_MSGOUT_SENT),
SCB_ABORT = 0x1000,
SCB_QUEUED_MSG = 0x2000,
SCB_ACTIVE = 0x4000,
@@ -255,17 +247,13 @@ struct scb_data {
* Connection desciptor for select-in requests in target mode.
* The first byte is the connecting target, followed by identify
* message and optional tag information, terminated by 0xFF. The
- * remainder is the command to execute. The cmd_valid byte is on
- * an 8 byte boundary to simplify setting it on aic7880 hardware
- * which only has limited direct access to the DMA FIFO.
+ * remainder is the command to execute.
*/
struct target_cmd {
- u_int8_t initiator_channel;
- u_int8_t targ_id; /* Target ID we were selected at */
- u_int8_t identify; /* Identify message */
- u_int8_t bytes[21];
- u_int8_t cmd_valid;
- u_int8_t pad[7];
+ u_int8_t icl; /* Really only holds Initiator ID */
+ u_int8_t targ_id; /* Target ID we were selected at */
+ u_int8_t identify; /* Identify message */
+ u_int8_t bytes[29];
};
/*
@@ -273,8 +261,8 @@ struct target_cmd {
* and immediate notify CCB pools.
*/
struct tmode_lstate {
- struct ccb_hdr_slist accept_tios;
- struct ccb_hdr_slist immed_notifies;
+ SLIST_HEAD(, ccb_hdr) accept_tios;
+ SLIST_HEAD(, ccb_hdr) immed_notifies;
};
/*
@@ -386,9 +374,7 @@ struct ahc_syncrate {
typedef enum {
MSG_TYPE_NONE = 0x00,
MSG_TYPE_INITIATOR_MSGOUT = 0x01,
- MSG_TYPE_INITIATOR_MSGIN = 0x02,
- MSG_TYPE_TARGET_MSGOUT = 0x03,
- MSG_TYPE_TARGET_MSGIN = 0x04
+ MSG_TYPE_INITIATOR_MSGIN = 0x02
} ahc_msg_type;
struct ahc_softc {
@@ -409,12 +395,6 @@ struct ahc_softc {
struct tmode_tstate* enabled_targets[16];
/*
- * The black hole device responsible for handling requests for
- * disabled luns on enabled targets.
- */
- struct tmode_lstate* black_hole;
-
- /*
* Device instance currently on the bus awaiting a continue TIO
* for a command that was not given the disconnect priveledge.
*/
@@ -452,9 +432,10 @@ struct ahc_softc {
* Per target state bitmasks.
*/
u_int16_t ultraenb; /* Using ultra sync rate */
+ u_int16_t sdtrpending; /* Pending SDTR request */
+ u_int16_t wdtrpending; /* Pending WDTR request */
u_int16_t discenable; /* Disconnection allowed */
u_int16_t tagenable; /* Tagged Queuing allowed */
- u_int16_t targ_msg_req; /* Need negotiation messages */
/*
* Hooks into the XPT.
@@ -481,24 +462,18 @@ struct ahc_softc {
int unsolicited_ints;
pcici_t pci_config_id;
- /*
- * Target incoming command FIFO.
- */
+ /* Hmmm. */
struct target_cmd *targetcmds;
- u_int8_t tqinfifonext;
+ int next_targetcmd;
+ int num_targetcmds;
/*
* Incoming and outgoing message handling.
*/
- u_int8_t send_msg_perror;
ahc_msg_type msg_type;
- u_int8_t msgout_buf[8]; /* Message we are sending */
- u_int8_t msgin_buf[8]; /* Message we are receiving */
- u_int msgout_len; /* Length of message to send */
- u_int msgout_index; /* Current index in msgout */
- u_int msgin_index; /* Current index in msgin */
-
- u_int enabled_luns;
+ u_int8_t msg_buf[8]; /* Message we are sending */
+ u_int msg_len; /* Length of message to send */
+ u_int msg_index; /* Current index in message */
/*
* "Bus" addresses of our data structures.
diff --git a/sys/dev/aic7xxx/aic7xxx.reg b/sys/dev/aic7xxx/aic7xxx.reg
index 775c0e31086f4..fff2b6f26fc14 100644
--- a/sys/dev/aic7xxx/aic7xxx.reg
+++ b/sys/dev/aic7xxx/aic7xxx.reg
@@ -1,7 +1,7 @@
/*
* Aic7xxx register and scratch ram definitions.
*
- * Copyright (c) 1994-1999 Justin Gibbs.
+ * Copyright (c) 1994-1998 Justin Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.reg,v 1.11 1998/12/17 00:06:52 gibbs Exp $
+ * $Id: aic7xxx.reg,v 1.4 1997/06/27 19:38:39 gibbs Exp $
*/
/*
@@ -471,7 +471,7 @@ register SEQCTL {
* Sequencer RAM Data (p. 3-34)
* Single byte window into the Scratch Ram area starting at the address
* specified by SEQADDR0 and SEQADDR1. To write a full word, simply write
- * four bytes in succession. The SEQADDRs will increment after the most
+ * four bytes in sucessesion. The SEQADDRs will increment after the most
* significant byte is written
*/
register SEQRAM {
@@ -675,20 +675,20 @@ register INTSTAT {
mask SEND_REJECT 0x10|SEQINT /* sending a message reject */
mask NO_IDENT 0x20|SEQINT /* no IDENTIFY after reconnect*/
mask NO_MATCH 0x30|SEQINT /* no cmd match for reconnect */
+ mask EXTENDED_MSG 0x40|SEQINT /* Extended message received */
mask ABORT_REQUESTED 0x50|SEQINT /* Reconect of aborted SCB */
+ mask REJECT_MSG 0x60|SEQINT /* Reject message received */
mask BAD_STATUS 0x70|SEQINT /* Bad status from target */
mask RESIDUAL 0x80|SEQINT /* Residual byte count != 0 */
- mask TRACE_POINT 0x90|SEQINT
- mask HOST_MSG_LOOP 0xa0|SEQINT /*
- * The bus is ready for the
- * host to perform another
- * message transaction. This
- * mechanism is used for things
- * like sync/wide negotiation
- * that require a kernel based
- * message state engine.
+ mask AWAITING_MSG 0xa0|SEQINT /*
+ * Kernel requested to specify
+ * a message to this target
+ * (command was null), so tell
+ * it that it can fill the
+ * message buffer.
*/
mask TARGET_MSG_HELP 0xb0|SEQINT
+ mask TARGET_SYNC_CMD 0xc0|SEQINT
mask TRACEPOINT 0xd0|SEQINT
mask MSGIN_PHASEMIS 0xe0|SEQINT /*
* Target changed phase on us
@@ -763,16 +763,6 @@ register DFSTATUS {
bit FIFOEMP 0x01
}
-register DFWADDR {
- address 0x95
- access_mode RW
-}
-
-register DFRADDR {
- address 0x97
- access_mode RW
-}
-
register DFDAT {
address 0x099
access_mode RW
@@ -1265,25 +1255,18 @@ scratch_ram {
size 1
}
/*
- * Kernel and sequencer offsets into the queue of
- * incoming target mode command descriptors. The
- * queue is full when the ((KERNEL_TQINPOS - TQINPOS) == 1)
+ * Offset into the command descriptor array for the next
+ * available desciptor to use.
*/
- KERNEL_TQINPOS {
- size 1
- }
- TQINPOS {
+ TMODE_CMDADDR_NEXT {
size 1
}
ARG_1 {
size 1
- mask SEND_MSG 0x80
- mask SEND_SENSE 0x40
- mask SEND_REJ 0x20
- mask MSGOUT_PHASEMIS 0x10
- mask EXIT_MSG_LOOP 0x08
- mask CONT_MSG_LOOP 0x04
- mask CONT_TARG_SESSION 0x02
+ mask SEND_MSG 0x80
+ mask SEND_SENSE 0x40
+ mask SEND_REJ 0x20
+ mask MSGOUT_PHASEMIS 0x10
alias RETURN_1
}
ARG_2 {
@@ -1306,44 +1289,6 @@ scratch_ram {
size 1
}
- /*
- * Interrupt kernel for a message to this target on
- * the next transaction. This is usually used for
- * negotiation requests.
- */
- TARGET_MSG_REQUEST {
- size 2
- }
-
- /*
- * Sequences the kernel driver has okayed for us. This allows
- * the driver to do things like prevent initiator or target
- * operations.
- */
- SCSISEQ_TEMPLATE {
- size 1
- bit ENSELO 0x40
- bit ENSELI 0x20
- bit ENRSELI 0x10
- bit ENAUTOATNO 0x08
- bit ENAUTOATNI 0x04
- bit ENAUTOATNP 0x02
- }
-
- /*
- * Track whether the transfer byte count for
- * the current data phase is odd.
- */
- DATA_COUNT_ODD {
- size 1
- }
-
- /*
- * The initiator specified tag for this target mode transaction.
- */
- INITIATOR_TAG {
- size 1
- }
/*
* These are reserved registers in the card's scratch ram. Some of
@@ -1415,7 +1360,5 @@ const CMD_GROUP5_BYTE_DELTA 11
/*
* Number of command descriptors in the command descriptor array.
- * No longer used, but left here as an example for how downloaded
- * constantants can be defined.
-const TMODE_NUMCMDS download
*/
+const TMODE_NUMCMDS download
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq
index 3377449cd302b..c1ab64df4193e 100644
--- a/sys/dev/aic7xxx/aic7xxx.seq
+++ b/sys/dev/aic7xxx/aic7xxx.seq
@@ -1,7 +1,7 @@
/*
* Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
*
- * Copyright (c) 1994-1999 Justin Gibbs.
+ * Copyright (c) 1994-1998 Justin Gibbs.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.seq,v 1.83 1998/12/17 00:06:52 gibbs Exp $
+ * $Id: aic7xxx.seq,v 1.78 1998/09/15 07:24:16 gibbs Exp $
*/
#include <dev/aic7xxx/aic7xxx.reg>
@@ -58,9 +58,12 @@
reset:
clr SCSISIGO; /* De-assert BSY */
- and SXFRCTL1, ~BITBUCKET;
/* Always allow reselection */
- and SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ_TEMPLATE;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ mvi SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP;
+ } else {
+ mvi SCSISEQ, ENRSELI|ENAUTOATNP;
+ }
if ((ahc->features & AHC_CMD_CHAN) != 0) {
/* Ensure that no DMA operations are in progress */
@@ -178,12 +181,13 @@ initialize_scsiid:
and SCSIID, OID; /* Clear old target */
or SCSIID, A;
}
- mov SINDEX, SCSISEQ_TEMPLATE;
if ((ahc->flags & AHC_TARGETMODE) != 0) {
- test SCB_CONTROL, TARGET_SCB jz . + 2;
- or SINDEX, TEMODE;
+ and SINDEX, TARGET_SCB, SCB_CONTROL;
+ or SCSISEQ, ENSELO|ENAUTOATNO|ENSELI
+ |ENRSELI|ENAUTOATNP, SINDEX ret ;
+ } else {
+ mvi SCSISEQ, ENSELO|ENAUTOATNO|ENRSELI|ENAUTOATNP ret;
}
- mov SCSISEQ, SINDEX ret;
/*
* Initialize transfer settings and clear the SCSI channel.
@@ -212,26 +216,29 @@ selection:
mvi CLRSINT0, CLRSELDI;
select_in:
if ((ahc->flags & AHC_TARGETMODE) != 0) {
- if ((ahc->flags & AHC_INITIATORMODE) != 0) {
- test SSTAT0, TARGET jz initiator_reselect;
- }
-
+ test SSTAT0, TARGET jz initiator_reselect;
/*
* We've just been selected. Assert BSY and
* setup the phase for receiving messages
* from the target.
*/
mvi SCSISIGO, P_MESGOUT|BSYO;
- mvi CLRSINT1, CLRBUSFREE;
+
+ /*
+ * LAST_MSG gives an indication to the host of what
+ * went wrong should we need to terminate this selection
+ * before doing real work. Initialize it to SCB_LIST_NULL to
+ * indicate an improper initiator selection.
+ */
+ mvi LAST_MSG, SCB_LIST_NULL;
/*
* Setup the DMA for sending the identify and
- * command information.
+ * command information. We keep a count of the
+ * number of bytes to send to the host in ARG_2.
*/
or SEQ_FLAGS, CMDPHASE_PENDING;
-
- /* XXX If ring buffer is full, return busy or queue full */
- mov A, TQINPOS;
+ mov A, TMODE_CMDADDR_NEXT;
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mvi DINDEX, CCHADDR;
mvi TMODE_CMDADDR call set_32byte_addr;
@@ -265,9 +272,6 @@ select_in:
}
}
- /* No tag yet */
- mvi INITIATOR_TAG, SCB_LIST_NULL;
-
/*
* If ATN isn't asserted, the target isn't interested
* in talking to us. Go directly to bus free.
@@ -279,20 +283,20 @@ select_in:
* initiator. We follow the guidlines from section 6.5
* of the SCSI-2 spec for what messages are allowed when.
*/
- call target_inb;
+ call targ_inb;
/*
* Our first message must be one of IDENTIFY, ABORT, or
* BUS_DEVICE_RESET.
*/
- /* XXX May need to be more lax here for older initiators... */
- test DINDEX, MSG_IDENTIFYFLAG jz host_target_message_loop;
+ test DINDEX, MSG_IDENTIFYFLAG jz more_first_messages;
/* Store for host */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mov CCSCBRAM, DINDEX;
} else {
mov DFDAT, DINDEX;
}
+ mvi ARG_2, 3;
/* Remember for disconnection decision */
test DINDEX, MSG_IDENTIFY_DISCFLAG jnz . + 2;
@@ -300,7 +304,7 @@ select_in:
or SEQ_FLAGS, NO_DISCONNECT;
test SCSISIGI, ATNI jz ident_messages_done;
- call target_inb;
+ call targ_inb;
/*
* If this is a tagged request, the tagged message must
* immediately follow the identify. We test for a valid
@@ -324,39 +328,39 @@ select_in:
* free.
*/
test SCSISIGI, ATNI jz target_busfree;
-
/*
* Store the tag for the host.
*/
- call target_inb;
+ call targ_inb;
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mov CCSCBRAM, DINDEX;
} else {
mov DFDAT, DINDEX;
}
- mov INITIATOR_TAG, DINDEX;
+ add ARG_2, 2;
jmp ident_messages_done;
+more_first_messages:
/*
- * Pushed message loop to allow the kernel to
- * run it's own target mode message state engine.
+ * Hmm. Now we're down to only accepting
+ * either an ABORT or BDR.
*/
-host_target_message_loop:
- mvi INTSTAT, HOST_MSG_LOOP;
- nop;
- cmp RETURN_1, EXIT_MSG_LOOP je target_ITloop;
- test SSTAT0, SPIORDY jz .;
- jmp host_target_message_loop;
+ cmp DINDEX, MSG_ABORT je . + 2;
+ cmp DINDEX, MSG_BUS_DEV_RESET jne target_busfree;
+
+ /* Record the event and notify the host */
+ mov LAST_MSG, DINDEX;
+ jmp target_busfree;
ident_messages_done:
+ mvi LAST_MSG, MSG_NOOP; /* We are so far successful */
/* Terminate the ident list */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
mvi CCSCBRAM, SCB_LIST_NULL;
} else {
mvi DFDAT, SCB_LIST_NULL;
}
- or SEQ_FLAGS, TARG_CMD_PENDING|IDENTIFY_SEEN;
- test SCSISIGI, ATNI jnz target_mesgout_pending_msg;
+ or SEQ_FLAGS, TARG_CMD_PENDING;
jmp target_ITloop;
/*
@@ -364,20 +368,16 @@ ident_messages_done:
* message byte we receive so it can be checked prior to
* driving REQ on the bus for the next byte.
*/
-target_inb:
- /*
- * Drive REQ on the bus by enabling SCSI PIO.
- */
+targ_inb:
+ /* Drive REQ on the bus by enabling SCSI PIO */
or SXFRCTL0, SPIOEN;
/* Wait for the byte */
test SSTAT0, SPIORDY jz .;
/* Prevent our read from triggering another REQ */
and SXFRCTL0, ~SPIOEN;
- /* Save latched contents */
mov DINDEX, SCSIDATL ret;
}
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
/*
* Reselection has been initiated by a target. Make a note that we've been
* reselected, but haven't seen an IDENTIFY message from the target yet.
@@ -389,7 +389,7 @@ initiator_reselect:
test SBLKCTL, SELBUSB jz . + 2;
or SAVED_TCL, SELBUSB;
}
- or SXFRCTL0, SPIOEN|CLRSTCNT|CLRCHN;
+ or SXFRCTL0, SPIOEN|CLRCHN;
mvi CLRSINT1,CLRBUSFREE;
or SIMODE1, ENBUSFREE; /*
* We aren't expecting a
@@ -399,7 +399,6 @@ initiator_reselect:
*/
mvi MSG_OUT, MSG_NOOP; /* No message to send */
jmp ITloop;
-}
/*
* After the selection, remove this SCB from the "waiting SCB"
@@ -409,7 +408,11 @@ initiator_reselect:
*/
select_out:
/* Turn off the selection hardware */
- and SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ_TEMPLATE;
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ mvi SCSISEQ, ENSELI|ENRSELI|ENAUTOATNP;
+ } else {
+ mvi SCSISEQ, ENRSELI|ENAUTOATNP;
+ }
mvi CLRSINT0, CLRSELDO;
mov SCBPTR, WAITING_SCBH;
mov WAITING_SCBH,SCB_NEXT;
@@ -422,8 +425,7 @@ select_out:
* Assert BSY and setup the phase for
* sending our identify messages.
*/
- mvi P_MESGIN|BSYO call change_phase;
- mvi CLRSINT1,CLRBUSFREE;
+ mvi SCSISIGO, P_MESGIN|BSYO;
/*
* Start out with a simple identify message.
@@ -437,22 +439,19 @@ select_out:
*/
test SCB_CONTROL, TAG_ENB jz . + 3;
mvi MSG_SIMPLE_Q_TAG call target_outb;
- mov SCB_INITIATOR_TAG call target_outb;
- mov INITIATOR_TAG, SCB_INITIATOR_TAG;
+ mov SCB_TAG call target_outb;
target_synccmd:
/*
* Now determine what phases the host wants us
* to go through.
*/
mov SEQ_FLAGS, SCB_TARGET_PHASES;
-
target_ITloop:
/*
- * Start honoring ATN signals now that
- * we properly identified ourself.
+ * XXX Start honoring ATN signals now that
+ * we properly identified ourself.
*/
- test SCSISIGI, ATNI jnz target_mesgout;
test SEQ_FLAGS, CMDPHASE_PENDING jnz target_cmdphase;
test SEQ_FLAGS, DPHASE_PENDING jnz target_dphase;
test SEQ_FLAGS, SPHASE_PENDING jnz target_sphase;
@@ -465,35 +464,38 @@ target_ITloop:
if ((ahc->flags & AHC_PAGESCBS) != 0) {
mov ALLZEROS call get_free_or_disc_scb;
}
- mov RETURN_1, ALLZEROS;
call complete_target_cmd;
- cmp RETURN_1, CONT_MSG_LOOP jne .;
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
mov SCB_TAG call dma_scb;
jmp target_synccmd;
-target_mesgout:
- mvi SCSISIGO, P_MESGOUT|BSYO;
- call target_inb;
- /* Local Processing goes here... */
-target_mesgout_pending_msg:
- jmp host_target_message_loop;
-
target_disconnect:
- mvi P_MESGIN|BSYO call change_phase;
- test SEQ_FLAGS, DPHASE jz . + 2;
- mvi MSG_SAVEDATAPOINTER call target_outb;
+ mvi SCSISIGO, P_MESGIN|BSYO;
mvi MSG_DISCONNECT call target_outb;
target_busfree:
+ and SXFRCTL0, ~SPIOEN;
clr SCSISIGO;
call complete_target_cmd;
+ cmp LAST_MSG, MSG_NOOP je . + 2;
+ mvi INTSTAT, TARGET_MSG_HELP;
call clear_target_state;
jmp poll_for_work;
target_cmdphase:
- mvi P_COMMAND|BSYO call change_phase;
- call target_inb;
+ /*
+ * Add one for the terminating byte
+ * and one for the command code.
+ */
+ if ((ahc->features & AHC_CMD_CHAN) != 0) {
+ add CCHCNT, 2, ARG_2;
+ } else {
+ add HCNT[0], 2, ARG_2;
+ clr HCNT[1];
+ clr HCNT[2];
+ }
+ mvi SCSISIGO, P_COMMAND|BSYO;
+ call targ_inb;
mov A, DINDEX;
/* Store for host */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
@@ -504,16 +506,20 @@ target_cmdphase:
/*
* Determine the number of bytes to read
- * based on the command group code via table lookup.
- * We reuse the first 8 bytes of the TARG_SCSIRATE
- * BIOS array for this table. Count is one less than
- * the total for the command since we've already fetched
- * the first byte.
+ * based on the command group code using an adding
+ * jump table. Count is one less than the total
+ * since we've already fetched the first byte.
*/
shr A, CMD_GROUP_CODE_SHIFT;
add SINDEX, TARG_SCSIRATE, A;
mov A, SINDIR;
+ if ((ahc->features & AHC_CMD_CHAN) != 0) {
+ add CCHCNT, A;
+ } else {
+ add HCNT[0], A;
+ }
+
test A, 0xFF jz command_phase_done;
command_loop:
or SXFRCTL0, SPIOEN;
@@ -537,20 +543,20 @@ target_dphase:
* Data direction flags are from the
* perspective of the initiator.
*/
+ and SXFRCTL0, ~SPIOEN;
+ or SXFRCTL0, CLRCHN;
test SCB_TARGET_PHASES[1], TARGET_DATA_IN jz . + 4;
+ mvi SCSISIGO, P_DATAIN|BSYO;
mvi LASTPHASE, P_DATAOUT;
- mvi P_DATAIN|BSYO call change_phase;
- jmp . + 3;
+ jmp p_data;
+ mvi SCSISIGO, P_DATAOUT|BSYO;
mvi LASTPHASE, P_DATAIN;
- mvi P_DATAOUT|BSYO call change_phase;
- mov ALLZEROS call initialize_channel;
jmp p_data;
target_sphase:
- mvi P_STATUS|BSYO call change_phase;
- mvi LASTPHASE, P_STATUS;
+ mvi SCSISIGO, P_STATUS|BSYO;
mov SCB_TARGET_STATUS call target_outb;
- /* XXX Watch for ATN or parity errors??? */
+ /* XXX Watch for ATN for parity errors??? */
mvi SCSISIGO, P_MESGIN|BSYO;
/* MSG_CMDCMPLT is 0, but we can't do an immediate of 0 */
mov ALLZEROS call target_outb;
@@ -560,52 +566,37 @@ complete_target_cmd:
test SEQ_FLAGS, TARG_CMD_PENDING jnz . + 2;
mov SCB_TAG jmp complete_post;
if ((ahc->features & AHC_CMD_CHAN) != 0) {
- /* Set the valid byte */
- mvi CCSCBADDR, 24;
- mov CCSCBRAM, ALLONES;
- mvi CCHCNT, 28;
or CCSCBCTL, CCSCBEN|CCSCBRESET;
test CCSCBCTL, CCSCBDONE jz .;
clr CCSCBCTL;
} else {
- /* Set the valid byte */
- or DFCNTRL, FIFORESET;
- mvi DFWADDR, 3; /* Third 64bit word or byte 24 */
- mov DFDAT, ALLONES;
- mvi HCNT[0], 28;
- clr HCNT[1];
- clr HCNT[2];
or DFCNTRL, HDMAEN|FIFOFLUSH;
call dma_finish;
}
- inc TQINPOS;
- mvi INTSTAT,CMDCMPLT ret;
+ inc TMODE_CMDADDR_NEXT;
+ cmp TMODE_CMDADDR_NEXT, TMODE_NUMCMDS jne . + 2;
+ clr TMODE_CMDADDR_NEXT;
+ mvi TARGET_CMD_CMPLT jmp complete_post;
}
-
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
initiator_select:
mvi SPIOEN call initialize_channel;
-
- /*
- * We aren't expecting a bus free, so interrupt
- * the kernel driver if it happens.
- */
+/*
+ * We aren't expecting a bus free, so interrupt
+ * the kernel driver if it happens.
+ */
mvi CLRSINT1,CLRBUSFREE;
or SIMODE1, ENBUSFREE;
-
- /*
- * As soon as we get a successful selection, the target
- * should go into the message out phase since we have ATN
- * asserted.
- */
+/*
+ * As soon as we get a successful selection, the target should go
+ * into the message out phase since we have ATN asserted.
+ */
mvi MSG_OUT, MSG_IDENTIFYFLAG;
or SEQ_FLAGS, IDENTIFY_SEEN;
- /*
- * Main loop for information transfer phases. Wait for the
- * target to assert REQ before checking MSG, C/D and I/O for
- * the bus phase.
- */
+/*
+ * Main loop for information transfer phases. Wait for the target
+ * to assert REQ before checking MSG, C/D and I/O for the bus phase.
+ */
ITloop:
call phase_lock;
@@ -617,7 +608,7 @@ ITloop:
cmp A,P_STATUS je p_status;
cmp A,P_MESGIN je p_mesgin;
- mvi INTSTAT,BAD_PHASE;
+ mvi INTSTAT,BAD_PHASE; /* unknown phase - signal driver */
jmp ITloop; /* Try reading the bus again. */
await_busfree:
@@ -628,27 +619,20 @@ await_busfree:
test SSTAT1,REQINIT|BUSFREE jz .;
test SSTAT1, BUSFREE jnz poll_for_work;
mvi INTSTAT, BAD_PHASE;
-}
clear_target_state:
- /*
- * We assume that the kernel driver may reset us
- * at any time, even in the middle of a DMA, so
- * clear DFCNTRL too.
- */
- clr DFCNTRL;
-
- /*
- * We don't know the target we will connect to,
- * so default to narrow transfers to avoid
- * parity problems.
- */
- if ((ahc->features & AHC_ULTRA2) != 0) {
- bmov SCSIRATE, ALLZEROS, 2;
- } else {
- clr SCSIRATE;
- and SXFRCTL0, ~(FAST20);
- }
+ clr DFCNTRL; /*
+ * We assume that the kernel driver
+ * may reset us at any time, even
+ * in the middle of a DMA, so clear
+ * DFCNTRL too.
+ */
+ clr SCSIRATE; /*
+ * We don't know the target we will
+ * connect to, so default to narrow
+ * transfers to avoid parity problems.
+ */
+ and SXFRCTL0, ~(FAST20);
mvi LASTPHASE, P_BUSFREE;
/* clear target specific flags */
clr SEQ_FLAGS ret;
@@ -664,7 +648,6 @@ data_phase_reinit:
mvi DINDEX, STCNT;
mvi SCB_RESID_DCNT call bcopy_3;
}
- and DATA_COUNT_ODD, 0x1, SCB_RESID_DCNT[0];
jmp data_phase_loop;
p_data:
@@ -699,7 +682,6 @@ p_data:
mvi DINDEX, HADDR;
mvi SCB_DATAPTR call bcopy_7;
}
- and DATA_COUNT_ODD, 0x1, SCB_DATACNT[0];
if ((ahc->features & AHC_ULTRA2) == 0) {
if ((ahc->features & AHC_CMD_CHAN) != 0) {
@@ -826,10 +808,6 @@ prefetched_segs_avail:
mvi HADDR call dfdat_in_7;
}
- /* Track odd'ness */
- test HCNT[0], 0x1 jz . + 2;
- xor DATA_COUNT_ODD, 0x1;
-
if ((ahc->features & AHC_ULTRA2) == 0) {
/* Load STCNT as well. It is a mirror of HCNT */
if ((ahc->features & AHC_CMD_CHAN) != 0) {
@@ -844,12 +822,7 @@ prefetched_segs_avail:
add SG_NEXT[0],SG_SIZEOF;
adc SG_NEXT[1],A;
- if ((ahc->flags & AHC_TARGETMODE) != 0) {
- test SSTAT0, TARGET jnz data_phase_loop;
- }
- test SSTAT1, REQINIT jz .;
test SSTAT1,PHASEMIS jz data_phase_loop;
-
/* Ensure the last seg is visable at the shaddow layer */
if ((ahc->features & AHC_ULTRA2) != 0) {
or DFCNTRL, PRELOADEN;
@@ -878,14 +851,8 @@ data_phase_finish:
}
if ((ahc->flags & AHC_TARGETMODE) != 0) {
- test SEQ_FLAGS, DPHASE_PENDING jz ITloop;
+ test SEQ_FLAGS, DPHASE_PENDING jz . + 3;
and SEQ_FLAGS, ~DPHASE_PENDING;
- /*
- * For data-in phases, wait for any pending acks from the
- * initiator before changing phase.
- */
- test DFCNTRL, DIRECTION jz target_ITloop;
- test SSTAT1, REQINIT jnz .;
jmp target_ITloop;
}
jmp ITloop;
@@ -915,7 +882,6 @@ ultra2_dmahalt:
ret;
}
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
/*
* Command phase. Set up the DMA registers and let 'er rip.
*/
@@ -972,22 +938,17 @@ p_status:
jmp ITloop;
/*
- * Message out phase. If MSG_OUT is MSG_IDENTIFYFLAG, build a full
- * indentify message sequence and send it to the target. The host may
- * override this behavior by setting the MK_MESSAGE bit in the SCB
- * control byte. This will cause us to interrupt the host and allow
- * it to handle the message phase completely on its own. If the bit
- * associated with this target is set, we will also interrupt the host,
- * thereby allowing it to send a message on the next selection regardless
- * of the transaction being sent.
+ * Message out phase. If MSG_OUT is 0x80, build I full indentify message
+ * sequence and send it to the target. In addition, if the MK_MESSAGE bit
+ * is set in the SCB_CONTROL byte, interrupt the host and allow it to send
+ * it's own message.
*
* If MSG_OUT is == HOST_MSG, also interrupt the host and take a message.
- * This is done to allow the host to send messages outside of an identify
+ * This is done to allow the hsot to send messages outside of an identify
* sequence while protecting the seqencer from testing the MK_MESSAGE bit
* on an SCB that might not be for the current nexus. (For example, a
* BDR message in responce to a bad reselection would leave us pointed to
* an SCB that doesn't have anything to do with the current target).
- *
* Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag,
* bus device reset).
*
@@ -995,29 +956,22 @@ p_status:
* in case the target decides to put us in this phase for some strange
* reason.
*/
-p_mesgout_retry:
- or SCSISIGO,ATNO,LASTPHASE;/* turn on ATN for the retry */
p_mesgout:
mov SINDEX, MSG_OUT;
cmp SINDEX, MSG_IDENTIFYFLAG jne p_mesgout_from_host;
- test SCB_CONTROL,MK_MESSAGE jnz host_message_loop;
- mov FUNCTION1, SCB_TCL;
- mov A, FUNCTION1;
- mov SINDEX, TARGET_MSG_REQUEST[0];
- if ((ahc->features & AHC_TWIN) != 0) {
- /* Second Channel uses high byte bits */
- test SCB_TCL, SELBUSB jz . + 2;
- mov SINDEX, TARGET_MSG_REQUEST[1];
- } else if ((ahc->features & AHC_WIDE) != 0) {
- test SCB_TCL, 0x80 jz . + 2; /* target > 7 */
- mov SINDEX, TARGET_MSG_REQUEST[1];
- }
- test SINDEX, A jnz host_message_loop;
p_mesgout_identify:
- and SINDEX,LID,SCB_TCL; /* lun */
+ if ((ahc->features & AHC_WIDE) != 0) {
+ and SINDEX,0xf,SCB_TCL; /* lun */
+ } else {
+ and SINDEX,0x7,SCB_TCL; /* lun */
+ }
and A,DISCENB,SCB_CONTROL; /* mask off disconnect privledge */
or SINDEX,A; /* or in disconnect privledge */
or SINDEX,MSG_IDENTIFYFLAG;
+p_mesgout_mk_message:
+ test SCB_CONTROL,MK_MESSAGE jz p_mesgout_tag;
+ mov SCSIDATL, SINDEX; /* Send the last byte */
+ jmp p_mesgout_from_host + 1;/* Skip HOST_MSG test */
/*
* Send a tag message if TAG_ENB is set in the SCB control block.
* Use SCB_TAG (the position in the kernel's SCB array) as the tag value.
@@ -1032,27 +986,36 @@ p_mesgout_tag:
cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
mov SCB_TAG jmp p_mesgout_onebyte;
/*
- * Interrupt the driver, and allow it to handle this message
- * phase and any required retries.
+ * Interrupt the driver, and allow it to send a message
+ * if it asks.
*/
p_mesgout_from_host:
cmp SINDEX, HOST_MSG jne p_mesgout_onebyte;
- jmp host_message_loop;
+ mvi INTSTAT,AWAITING_MSG;
+ nop;
+ /*
+ * Did the host detect a phase change?
+ */
+ cmp RETURN_1, MSGOUT_PHASEMIS je p_mesgout_done;
p_mesgout_onebyte:
mvi CLRSINT1, CLRATNO;
mov SCSIDATL, SINDEX;
/*
- * If the next bus phase after ATN drops is message out, it means
+ * If the next bus phase after ATN drops is a message out, it means
* that the target is requesting that the last message(s) be resent.
*/
call phase_lock;
- cmp LASTPHASE, P_MESGOUT je p_mesgout_retry;
+ cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
+ or SCSISIGO,ATNO,LASTPHASE;/* turn on ATN for the retry */
+ jmp p_mesgout;
p_mesgout_done:
mvi CLRSINT1,CLRATNO; /* Be sure to turn ATNO off */
mov LAST_MSG, MSG_OUT;
+ cmp MSG_OUT, MSG_IDENTIFYFLAG jne . + 2;
+ and SCB_CONTROL, ~MK_MESSAGE;
mvi MSG_OUT, MSG_NOOP; /* No message left */
jmp ITloop;
@@ -1067,22 +1030,19 @@ p_mesgin:
cmp A,MSG_SAVEDATAPOINTER je mesgin_sdptrs;
cmp ALLZEROS,A je mesgin_complete;
cmp A,MSG_RESTOREPOINTERS je mesgin_rdptrs;
+ cmp A,MSG_EXTENDED je mesgin_extended;
+ cmp A,MSG_MESSAGE_REJECT je mesgin_reject;
cmp A,MSG_NOOP je mesgin_done;
+rej_mesgin:
/*
- * Pushed message loop to allow the kernel to
- * RUN IT's own message state engine. To avoid an
- * extra nop instruction after signaling the kernel,
- * we perform the phase_lock before checking to see
- * if we should exit the loop and skip the phase_lock
- * in the ITloop. Performing back to back phase_locks
- * shouldn't hurt, but why do it twice...
+ * We have no idea what this message in is, so we issue a message reject
+ * and hope for the best. In any case, rejection should be a rare
+ * occurrence - signal the driver when it happens.
*/
-host_message_loop:
- mvi INTSTAT, HOST_MSG_LOOP;
- call phase_lock;
- cmp RETURN_1, EXIT_MSG_LOOP je ITloop + 1;
- jmp host_message_loop;
+ mvi INTSTAT,SEND_REJECT; /* let driver know */
+
+ mvi MSG_MESSAGE_REJECT call mk_mesg;
mesgin_done:
mov NONE,SCSIDATL; /*dummy read from latch to ACK*/
@@ -1147,7 +1107,6 @@ complete_queue:
add_to_free_list:
call add_scb_to_free_list;
jmp await_busfree;
-}
complete_post:
/* Post the SCBID in SINDEX and issue an interrupt */
@@ -1162,9 +1121,23 @@ complete_post:
if ((ahc->features & AHC_QUEUE_REGS) == 0) {
inc QOUTPOS;
}
+ if ((ahc->flags & AHC_TARGETMODE) != 0) {
+ test SEQ_FLAGS, NO_DISCONNECT jz . + 3;
+ mvi INTSTAT,TARGET_SYNC_CMD|CMDCMPLT;
+ ret;
+ }
mvi INTSTAT,CMDCMPLT ret;
-if ((ahc->flags & AHC_INITIATORMODE) != 0) {
+/*
+ * Is it an extended message? Copy the message to our message buffer and
+ * notify the host. The host will tell us whether to reject this message,
+ * respond to it with the message that the host placed in our message buffer,
+ * or simply to do nothing.
+ */
+mesgin_extended:
+ mvi INTSTAT,EXTENDED_MSG; /* let driver know */
+ jmp ITloop;
+
/*
* Is it a disconnect message? Set a flag in the SCB to remind us
* and await the bus going free.
@@ -1293,6 +1266,16 @@ not_found:
jmp mesgin_done;
/*
+ * Message reject? Let the kernel driver handle this. If we have an
+ * outstanding WDTR or SDTR negotiation, assume that it's a response from
+ * the target selecting 8bit or asynchronous transfer, otherwise just ignore
+ * it since we have no clue what it pertains to.
+ */
+mesgin_reject:
+ mvi INTSTAT, REJECT_MSG;
+ jmp mesgin_done;
+
+/*
* [ ADD MORE MESSAGE HANDLING HERE ]
*/
@@ -1337,35 +1320,18 @@ inb_first:
mov DINDIR,SCSIBUSL ret; /*read byte directly from bus*/
inb_last:
mov NONE,SCSIDATL ret; /*dummy read from latch to ACK*/
-}
if ((ahc->flags & AHC_TARGETMODE) != 0) {
-/*
- * Change to a new phase. If we are changing the state of the I/O signal,
- * from out to in, wait an additional data release delay before continuing.
- */
-change_phase:
- and DINDEX, IOI, SCSISIGI;
- mov SCSISIGO, SINDEX;
- and A, IOI, SINDEX;
- cmp DINDEX, A je change_phase_wait;
- test SINDEX, IOI jz change_phase_wait;
- call change_phase_wait;
-change_phase_wait:
- nop;
- nop;
- nop;
- nop ret;
-
-/*
- * Send a byte to an initiator in Automatic PIO mode.
- */
+ /*
+ * Send a byte to an initiator in Automatic PIO mode.
+ * SPIOEN must be on prior to calling this routine.
+ */
target_outb:
or SXFRCTL0, SPIOEN;
test SSTAT0, SPIORDY jz .;
mov SCSIDATL, SINDEX;
test SSTAT0, SPIORDY jz .;
- and SXFRCTL0, ~SPIOEN ret;
+ ret;
}
mesgin_phasemis:
@@ -1584,8 +1550,8 @@ get_SCBID_from_host:
phase_lock:
test SSTAT1, REQINIT jz phase_lock;
test SSTAT1, SCSIPERR jnz phase_lock;
- and SCSISIGO, PHASE_MASK, SCSISIGI;
- and LASTPHASE, PHASE_MASK, SCSISIGI ret;
+ and LASTPHASE, PHASE_MASK, SCSISIGI;
+ mov SCSISIGO, LASTPHASE ret;
if ((ahc->features & AHC_CMD_CHAN) == 0) {
set_stcnt_from_hcnt:
diff --git a/sys/dev/aic7xxx/aicasm_gram.y b/sys/dev/aic7xxx/aicasm_gram.y
index fdf352249ab8f..09a62b936d279 100644
--- a/sys/dev/aic7xxx/aicasm_gram.y
+++ b/sys/dev/aic7xxx/aicasm_gram.y
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aicasm_gram.y,v 1.5 1998/09/15 07:24:17 gibbs Exp $
+ * $Id: aicasm_gram.y,v 1.4 1997/09/27 19:37:28 gibbs Exp $
*/
#include <stdio.h>
@@ -861,12 +861,12 @@ code:
;
code:
- T_NOP ret ';'
+ T_NOP ';'
{
expression_t immed;
make_expression(&immed, 0xff);
- format_1_instr(AIC_OP_AND, &none, &immed, &allzeros, $2);
+ format_1_instr(AIC_OP_AND, &none, &immed, &allzeros, FALSE);
}
;
diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c
index 33ca81f6b2a6c..7196844368833 100644
--- a/sys/dev/buslogic/bt.c
+++ b/sys/dev/buslogic/bt.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt.c,v 1.12 1998/12/04 22:54:44 archie Exp $
+ * $Id: bt.c,v 1.6 1998/10/15 23:17:58 gibbs Exp $
*/
/*
@@ -181,26 +181,12 @@ u_long bt_unit = 0;
*/
struct bt_isa_port bt_isa_ports[] =
{
- { 0x130, 0, 4 },
- { 0x134, 0, 5 },
- { 0x230, 0, 2 },
- { 0x234, 0, 3 },
- { 0x330, 0, 0 },
- { 0x334, 0, 1 }
-};
-
-/*
- * I/O ports listed in the order enumerated by the
- * card for certain op codes.
- */
-u_int16_t bt_board_ports[] =
-{
- 0x330,
- 0x334,
- 0x230,
- 0x234,
- 0x130,
- 0x134
+ { 0x330, 0 },
+ { 0x334, 0 },
+ { 0x230, 0 },
+ { 0x234, 0 },
+ { 0x130, 0 },
+ { 0x134, 0 }
};
/* Exported functions */
@@ -449,15 +435,15 @@ bt_fetch_adapter_info(struct bt_softc *bt)
if (esetup_info.bus_type == 'A'
&& bt->firmware_ver[0] == '2') {
- snprintf(bt->model, sizeof(bt->model), "542B");
+ strcpy(bt->model, "542B");
} else if (esetup_info.bus_type == 'E'
&& (strncmp(bt->firmware_ver, "2.1", 3) == 0
|| strncmp(bt->firmware_ver, "2.20", 4) == 0)) {
- snprintf(bt->model, sizeof(bt->model), "742A");
+ strcpy(bt->model, "742A");
} else if (esetup_info.bus_type == 'E'
&& bt->firmware_ver[0] == '0') {
/* AMI FastDisk EISA Series 441 0.x */
- snprintf(bt->model, sizeof(bt->model), "747A");
+ strcpy(bt->model, "747A");
} else {
ha_model_data_t model_data;
int i;
@@ -819,7 +805,7 @@ bt_name(struct bt_softc *bt)
{
static char name[10];
- snprintf(name, sizeof(name), "bt%d", bt->unit);
+ sprintf(name, "bt%d", bt->unit);
return (name);
}
@@ -828,7 +814,7 @@ bt_check_probed_iop(u_int ioport)
{
u_int i;
- for (i = 0; i < BT_NUM_ISAPORTS; i++) {
+ for (i=0; i < BT_NUM_ISAPORTS; i++) {
if (bt_isa_ports[i].addr == ioport) {
if (bt_isa_ports[i].probed != 0)
return (1);
@@ -844,7 +830,7 @@ void
bt_mark_probed_bio(isa_compat_io_t port)
{
if (port < BIO_DISABLED)
- bt_mark_probed_iop(bt_board_ports[port]);
+ bt_isa_ports[port].probed = 1;
}
void
@@ -860,44 +846,6 @@ bt_mark_probed_iop(u_int ioport)
}
}
-void
-bt_find_probe_range(int ioport, int *port_index, int *max_port_index)
-{
- if (ioport > 0) {
- int i;
-
- for (i = 0;i < BT_NUM_ISAPORTS; i++)
- if (ioport <= bt_isa_ports[i].addr)
- break;
- if ((i >= BT_NUM_ISAPORTS)
- || (ioport != bt_isa_ports[i].addr)) {
- printf("
-bt_isa_probe: Invalid baseport of 0x%x specified.
-bt_isa_probe: Nearest valid baseport is 0x%x.
-bt_isa_probe: Failing probe.\n",
- ioport,
- (i < BT_NUM_ISAPORTS)
- ? bt_isa_ports[i].addr
- : bt_isa_ports[BT_NUM_ISAPORTS - 1].addr);
- *port_index = *max_port_index = -1;
- return;
- }
- *port_index = *max_port_index = bt_isa_ports[i].bio;
- } else {
- *port_index = 0;
- *max_port_index = BT_NUM_ISAPORTS - 1;
- }
-}
-
-int
-bt_iop_from_bio(isa_compat_io_t bio_index)
-{
- if (bio_index >= 0 && bio_index < BT_NUM_ISAPORTS)
- return (bt_board_ports[bio_index]);
- return (-1);
-}
-
-
static void
btallocccbs(struct bt_softc *bt)
{
@@ -970,7 +918,6 @@ btfreeccb(struct bt_softc *bt, struct bt_ccb *bccb)
}
bccb->flags = BCCB_FREE;
SLIST_INSERT_HEAD(&bt->free_bt_ccbs, bccb, links);
- bt->active_ccbs--;
splx(s);
}
@@ -983,16 +930,13 @@ btgetccb(struct bt_softc *bt)
s = splcam();
if ((bccb = SLIST_FIRST(&bt->free_bt_ccbs)) != NULL) {
SLIST_REMOVE_HEAD(&bt->free_bt_ccbs, links);
- bt->active_ccbs++;
} else if (bt->num_ccbs < bt->max_ccbs) {
btallocccbs(bt);
bccb = SLIST_FIRST(&bt->free_bt_ccbs);
if (bccb == NULL)
printf("%s: Can't malloc BCCB\n", bt_name(bt));
- else {
+ else
SLIST_REMOVE_HEAD(&bt->free_bt_ccbs, links);
- bt->active_ccbs++;
- }
}
splx(s);
@@ -1015,6 +959,7 @@ btaction(struct cam_sim *sim, union ccb *ccb)
{
struct bt_ccb *bccb;
struct bt_hccb *hccb;
+ u_int16_t targ_mask;
/*
* get a bccb to use.
@@ -1047,6 +992,7 @@ btaction(struct cam_sim *sim, union ccb *ccb)
hccb->target_lun = ccb->ccb_h.target_lun;
hccb->btstat = 0;
hccb->sdstat = 0;
+ targ_mask = (0x01 << hccb->target_id);
if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
struct ccb_scsiio *csio;
@@ -1055,8 +1001,8 @@ btaction(struct cam_sim *sim, union ccb *ccb)
csio = &ccb->csio;
ccbh = &csio->ccb_h;
hccb->opcode = INITIATOR_CCB_WRESID;
- hccb->datain = (ccb->ccb_h.flags & CAM_DIR_IN) ? 1 : 0;
- hccb->dataout =(ccb->ccb_h.flags & CAM_DIR_OUT) ? 1 : 0;
+ hccb->datain = (ccb->ccb_h.flags & CAM_DIR_IN) != 0;
+ hccb->dataout = (ccb->ccb_h.flags & CAM_DIR_OUT) != 0;
hccb->cmd_len = csio->cdb_len;
if (hccb->cmd_len > sizeof(hccb->scsi_cdb)) {
ccb->ccb_h.status = CAM_REQ_INVALID;
@@ -1365,7 +1311,7 @@ btexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
bus_dmamap_sync(bt->buffer_dmat, bccb->dmamap, op);
} else {
- bccb->hccb.opcode = INITIATOR_CCB;
+ bccb->hccb.opcode = INITIATOR_SG_CCB;
bccb->hccb.data_len = 0;
bccb->hccb.data_addr = 0;
}
@@ -1395,27 +1341,8 @@ btexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
/* Tell the adapter about this command */
bt->cur_outbox->ccb_addr = btccbvtop(bt, bccb);
- if (bt->cur_outbox->action_code != BMBO_FREE) {
- /*
- * We should never encounter a busy mailbox.
- * If we do, warn the user, and treat it as
- * a resource shortage. If the controller is
- * hung, one of the pending transactions will
- * timeout causing us to start recovery operations.
- */
- printf("%s: Encountered busy mailbox with %d out of %d "
- "commands active!!!", bt_name(bt), bt->active_ccbs,
- bt->max_ccbs);
- untimeout(bttimeout, bccb, ccb->ccb_h.timeout_ch);
- if (nseg != 0)
- bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap);
- btfreeccb(bt, bccb);
- bt->resource_shortage = TRUE;
- xpt_freeze_simq(bt->sim, /*count*/1);
- ccb->ccb_h.status = CAM_REQUEUE_REQ;
- xpt_done(ccb);
- return;
- }
+ if (bt->cur_outbox->action_code != BMBO_FREE)
+ panic("%s: Too few mailboxes or to many ccbs???", bt_name(bt));
bt->cur_outbox->action_code = BMBO_START;
bt_outb(bt, COMMAND_REG, BOP_START_MBOX);
btnextoutbox(bt);
@@ -1536,22 +1463,14 @@ btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code)
break;
case BMBI_ABORT:
case BMBI_ERROR:
- if (bootverbose) {
- printf("bt: ccb %p - error %x occured. "
- "btstat = %x, sdstat = %x\n",
- (void *)bccb, comp_code, bccb->hccb.btstat,
- bccb->hccb.sdstat);
- }
+#if 0
+ printf("bt: ccb %x - error %x occured. btstat = %x, sdstat = %x\n",
+ bccb, comp_code, bccb->hccb.btstat, bccb->hccb.sdstat);
+#endif
/* An error occured */
switch(bccb->hccb.btstat) {
case BTSTAT_DATARUN_ERROR:
- if (bccb->hccb.data_len == 0) {
- /*
- * At least firmware 4.22, does this
- * for a QUEUE FULL condition.
- */
- bccb->hccb.sdstat = SCSI_STATUS_QUEUE_FULL;
- } else if (bccb->hccb.data_len < 0) {
+ if (bccb->hccb.data_len <= 0) {
csio->ccb_h.status = CAM_DATA_RUN_ERR;
break;
}
@@ -1779,13 +1698,11 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
u_int intstat;
u_int reply_buf_size;
int s;
- int cmd_complete;
/* No data returned to start */
reply_buf_size = reply_len;
reply_len = 0;
intstat = 0;
- cmd_complete = 0;
bt->command_cmp = 0;
/*
@@ -1821,13 +1738,10 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
status = bt_inb(bt, STATUS_REG);
intstat = bt_inb(bt, INTSTAT_REG);
if ((intstat & (INTR_PENDING|CMD_COMPLETE))
- == (INTR_PENDING|CMD_COMPLETE)) {
- cmd_complete = 1;
+ == (INTR_PENDING|CMD_COMPLETE))
break;
- }
if (bt->command_cmp != 0) {
status = bt->latched_status;
- cmd_complete = 1;
break;
}
if ((status & DATAIN_REG_READY) != 0)
@@ -1849,7 +1763,7 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
* the CMD_REG_BUSY status to clear and check for a command
* failure.
*/
- if (cmd_complete == 0 && opcode == BOP_MODIFY_IO_ADDR) {
+ if (opcode == BOP_MODIFY_IO_ADDR) {
while (--cmd_timeout) {
status = bt_inb(bt, STATUS_REG);
@@ -1874,7 +1788,7 @@ bt_cmd(struct bt_softc *bt, bt_op_t opcode, u_int8_t *params, u_int param_len,
* For all other commands, we wait for any output data
* and the final comand completion interrupt.
*/
- while (cmd_complete == 0 && --cmd_timeout) {
+ while (--cmd_timeout) {
status = bt_inb(bt, STATUS_REG);
intstat = bt_inb(bt, INTSTAT_REG);
diff --git a/sys/dev/buslogic/btreg.h b/sys/dev/buslogic/btreg.h
index fa049bcfc3e2b..d31db883fc3d6 100644
--- a/sys/dev/buslogic/btreg.h
+++ b/sys/dev/buslogic/btreg.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: btreg.h,v 1.2 1998/10/30 02:06:44 gibbs Exp $
+ * $Id$
*/
#ifndef _BTREG_H_
@@ -408,7 +408,6 @@ typedef struct {
struct bt_isa_port {
u_int16_t addr;
u_int8_t probed;
- u_int8_t bio;
};
extern struct bt_isa_port bt_isa_ports[];
@@ -550,7 +549,7 @@ struct bt_hccb {
wide_tag_type :2; /* Wide Lun CCB format */
u_int8_t cmd_len;
u_int8_t sense_len;
- int32_t data_len; /* residuals can be negative */
+ u_int32_t data_len;
u_int32_t data_addr;
u_int8_t reserved[2];
u_int8_t btstat;
@@ -600,7 +599,6 @@ struct bt_softc {
struct bt_ccb *bt_ccb_array;
SLIST_HEAD(,bt_ccb) free_bt_ccbs;
LIST_HEAD(,ccb_hdr) pending_ccbs;
- u_int active_ccbs;
u_int32_t bt_ccb_physbase;
bt_mbox_in_t *in_boxes;
bt_mbox_out_t *out_boxes;
@@ -668,11 +666,6 @@ char * bt_name(struct bt_softc *bt);
int bt_check_probed_iop(u_int ioport);
void bt_mark_probed_bio(isa_compat_io_t port);
void bt_mark_probed_iop(u_int ioport);
-void bt_find_probe_range(int ioport,
- int *port_index,
- int *max_port_index);
-
-int bt_iop_from_bio(isa_compat_io_t bio_index);
#define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */
int bt_cmd(struct bt_softc *bt, bt_op_t opcode,
diff --git a/sys/dev/dec/mcclock_if.m b/sys/dev/dec/mcclock_if.m
index 79686237ed57b..39a06baf5d489 100644
--- a/sys/dev/dec/mcclock_if.m
+++ b/sys/dev/dec/mcclock_if.m
@@ -23,10 +23,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: mcclock_if.m,v 1.1 1998/06/14 13:52:55 dfr Exp $
+# $Id$
#
-INTERFACE mcclock;
+INTERFACE mcclock
#
# Read an RTC register and return its value.
diff --git a/sys/dev/dpt/dpt_control.c b/sys/dev/dpt/dpt_control.c
index b28fb672d1cfc..ba4bec9c3cdb1 100644
--- a/sys/dev/dpt/dpt_control.c
+++ b/sys/dev/dpt/dpt_control.c
@@ -36,7 +36,7 @@
* future.
*/
-#ident "$Id: dpt_control.c,v 1.9 1998/09/15 08:33:31 gibbs Exp $"
+#ident "$Id: dpt_control.c,v 1.8 1998/08/05 00:54:36 eivind Exp $"
#include "opt_dpt.h"
@@ -782,8 +782,7 @@ dpt_ioctl(dev_t dev, u_long cmd, caddr_t cmdarg, int flags, struct proc * p)
compat_softc.ha_npend = dpt->submitted_ccbs_count;
compat_softc.ha_active_jobs = dpt->waiting_ccbs_count;
strncpy(compat_softc.ha_fw_version,
- dpt->board_data.firmware,
- sizeof(compat_softc.ha_fw_version));
+ dpt->board_data.firmware, 4);
compat_softc.ha_ccb = NULL;
compat_softc.ha_cblist = NULL;
compat_softc.ha_dev = NULL;
diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c
index 47c12a51bdade..42ff038f6645d 100644
--- a/sys/dev/dpt/dpt_scsi.c
+++ b/sys/dev/dpt/dpt_scsi.c
@@ -43,7 +43,7 @@
* arrays that span controllers (Wow!).
*/
-#ident "$Id: dpt_scsi.c,v 1.21 1998/12/22 00:52:27 eivind Exp $"
+#ident "$Id: dpt_scsi.c,v 1.19 1998/10/15 23:17:56 gibbs Exp $"
#define _DPT_C_
@@ -300,12 +300,11 @@ dptallocsgmap(struct dpt_softc *dpt)
return (NULL);
}
- (void)bus_dmamap_load(dpt->sg_dmat, sg_map->sg_dmamap, sg_map->sg_vaddr,
- PAGE_SIZE, dptmapmem, &sg_map->sg_physaddr,
- /*flags*/0);
-
SLIST_INSERT_HEAD(&dpt->sg_maps, sg_map, links);
+ bus_dmamap_load(dpt->sg_dmat, sg_map->sg_dmamap, sg_map->sg_vaddr,
+ PAGE_SIZE, dptmapmem, &sg_map->sg_physaddr, /*flags*/0);
+
return (sg_map);
}
@@ -1129,7 +1128,7 @@ dpt_free(struct dpt_softc *dpt)
free(dpt, M_DEVBUF);
}
-static u_int8_t string_sizes[] =
+u_int8_t string_sizes[] =
{
sizeof(((dpt_inq_t*)NULL)->vendor),
sizeof(((dpt_inq_t*)NULL)->modelNum),
@@ -1148,9 +1147,6 @@ dpt_init(struct dpt_softc *dpt)
int i;
int retval;
- dpt->init_level = 0;
- SLIST_INIT(&dpt->sg_maps);
-
#ifdef DPT_RESET_BOARD
printf("dpt%d: resetting HBA\n", dpt->unit);
dpt_outb(dpt, HA_WCOMMAND, EATA_CMD_RESET);
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index 44a465927ca41..2e22fd1db3291 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -1278,8 +1278,8 @@ caddr_t data;
break;
if ((shadow = pvc_attach(ifp)) != NULL) {
- snprintf(ifr->ifr_name, sizeof(ifr->ifr_name),
- "%s%d", shadow->if_name, shadow->if_unit);
+ sprintf(ifr->ifr_name, "%s%d",
+ shadow->if_name, shadow->if_unit);
}
else
error = ENOBUFS;
@@ -3643,8 +3643,8 @@ static int en_pvctx(sc, pvcreq)
pvcreq->pvc_ifname);
return (EINVAL);
}
- snprintf(pvcreq->pvc_ifname, sizeof(pvcreq->pvc_ifname),
- "%s%d", sc->enif.if_name, sc->enif.if_unit);
+ sprintf(pvcreq->pvc_ifname, "%s%d",
+ sc->enif.if_name, sc->enif.if_unit);
ATM_PH_FLAGS(&api.aph) = ATM_PH_PVCSIF |
(ATM_PH_FLAGS(pvc_aph) & (ATM_PH_AAL5|ATM_PH_LLCSNAP));
diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c
deleted file mode 100644
index 99d15f852a373..0000000000000
--- a/sys/dev/fb/fb.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: fb.c,v 1.2 1999/01/12 10:35:50 yokota Exp $
- */
-
-#include "fb.h"
-#include "opt_fb.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-
-/* local arrays */
-
-/*
- * We need at least one entry each in order to initialize a video card
- * for the kernel console. The arrays will be increased dynamically
- * when necessary.
- */
-
-static int adapters = 1;
-static video_adapter_t *adp_ini;
-static video_adapter_t **adapter = &adp_ini;
-static video_switch_t *vidsw_ini;
- video_switch_t **vidsw = &vidsw_ini;
-
-#ifdef FB_INSTALL_CDEV
-
-#define ARRAY_DELTA 4
-
-static struct cdevsw *vidcdevsw_ini;
-static struct cdevsw **vidcdevsw = &vidcdevsw_ini;
-
-static void
-vid_realloc_array(void)
-{
- video_adapter_t **new_adp;
- video_switch_t **new_vidsw;
- struct cdevsw **new_cdevsw;
- int newsize;
- int s;
-
- s = spltty();
- newsize = ((adapters + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA;
- new_adp = malloc(sizeof(*new_adp)*newsize, M_DEVBUF, M_WAITOK);
- new_vidsw = malloc(sizeof(*new_vidsw)*newsize, M_DEVBUF, M_WAITOK);
- new_cdevsw = malloc(sizeof(*new_cdevsw)*newsize, M_DEVBUF, M_WAITOK);
- bzero(new_adp, sizeof(*new_adp)*newsize);
- bzero(new_vidsw, sizeof(*new_vidsw)*newsize);
- bzero(new_cdevsw, sizeof(*new_cdevsw)*newsize);
- bcopy(adapter, new_adp, sizeof(*adapter)*adapters);
- bcopy(vidsw, new_vidsw, sizeof(*vidsw)*adapters);
- bcopy(vidcdevsw, new_cdevsw, sizeof(*vidcdevsw)*adapters);
- if (adapters > 1) {
- free(adapter, M_DEVBUF);
- free(vidsw, M_DEVBUF);
- free(vidcdevsw, M_DEVBUF);
- }
- adapter = new_adp;
- vidsw = new_vidsw;
- vidcdevsw = new_cdevsw;
- adapters = newsize;
- splx(s);
-
- if (bootverbose)
- printf("fb: new array size %d\n", adapters);
-}
-
-#endif /* FB_INSTALL_CDEV */
-
-/*
- * Low-level frame buffer driver functions
- * frame buffer subdrivers, such as the VGA driver, call these functions
- * to initialize the video_adapter structure and register it to the virtual
- * frame buffer driver `fb'.
- */
-
-/* initialize the video_adapter_t structure */
-void
-vid_init_struct(video_adapter_t *adp, char *name, int type, int unit)
-{
- adp->va_flags = 0;
- adp->va_name = name;
- adp->va_type = type;
- adp->va_unit = unit;
-}
-
-/* Register a video adapter */
-int
-vid_register(video_adapter_t *adp)
-{
- video_driver_t **list;
- video_driver_t *p;
- int index;
-
- for (index = 0; index < adapters; ++index) {
- if (adapter[index] == NULL)
- break;
- }
- if (index >= adapters)
- return -1;
-
- adp->va_index = index;
- adp->va_token = NULL;
- list = (video_driver_t **)videodriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, adp->va_name) == 0) {
- adapter[index] = adp;
- vidsw[index] = p->vidsw;
- return index;
- }
- }
-
- return -1;
-}
-
-int
-vid_unregister(video_adapter_t *adp)
-{
- if ((adp->va_index < 0) || (adp->va_index >= adapters))
- return ENOENT;
- if (adapter[adp->va_index] != adp)
- return ENOENT;
-
- adapter[adp->va_index] = NULL;
- vidsw[adp->va_index] = NULL;
- return 0;
-}
-
-/* Get video I/O function table */
-video_switch_t
-*vid_get_switch(char *name)
-{
- video_driver_t **list;
- video_driver_t *p;
-
- list = (video_driver_t **)videodriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, name) == 0)
- return p->vidsw;
- }
-
- return NULL;
-}
-
-/*
- * Video card client functions
- * Video card clients, such as the console driver `syscons' and the frame
- * buffer cdev driver, use these functions to claim and release a card for
- * exclusive use.
- */
-
-/* find the video card specified by a driver name and a unit number */
-int
-vid_find_adapter(char *driver, int unit)
-{
- int i;
-
- for (i = 0; i < adapters; ++i) {
- if (adapter[i] == NULL)
- continue;
- if (strcmp("*", driver) && strcmp(adapter[i]->va_name, driver))
- continue;
- if ((unit != -1) && (adapter[i]->va_unit != unit))
- continue;
- return i;
- }
- return -1;
-}
-
-/* allocate a video card */
-int
-vid_allocate(char *driver, int unit, void *id)
-{
- int index;
- int s;
-
- s = spltty();
- index = vid_find_adapter(driver, unit);
- if (index >= 0) {
- if (adapter[index]->va_token) {
- splx(s);
- return -1;
- }
- adapter[index]->va_token = id;
- }
- splx(s);
- return index;
-}
-
-int
-vid_release(video_adapter_t *adp, void *id)
-{
- int error;
- int s;
-
- s = spltty();
- if (adp->va_token == NULL) {
- error = EINVAL;
- } else if (adp->va_token != id) {
- error = EPERM;
- } else {
- adp->va_token = NULL;
- error = 0;
- }
- splx(s);
- return error;
-}
-
-/* Get a video adapter structure */
-video_adapter_t
-*vid_get_adapter(int index)
-{
- if ((index < 0) || (index >= adapters))
- return NULL;
- return adapter[index];
-}
-
-/* Configure drivers: this is a backdoor for the console driver XXX */
-int
-vid_configure(int flags)
-{
- video_driver_t **list;
- video_driver_t *p;
-
- list = (video_driver_t **)videodriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (p->configure != NULL)
- (*p->configure)(flags);
- }
-
- return 0;
-}
-
-/*
- * Virtual frame buffer cdev driver functions
- * The virtual frame buffer driver dispatches driver functions to
- * appropriate subdrivers.
- */
-
-#define DRIVER_NAME "fb"
-
-#ifdef FB_INSTALL_CDEV
-
-#define FB_UNIT(dev) minor(dev)
-#define FB_MKMINOR(unit) (u)
-
-#if notyet
-
-static d_open_t fbopen;
-static d_close_t fbclose;
-static d_ioctl_t fbioctl;
-static d_mmap_t fbmmap;
-
-#define CDEV_MAJOR 141 /* XXX */
-
-static struct cdevsw fb_cdevsw = {
- fbopen, fbclose, noread, nowrite, /* ??? */
- fbioctl, nostop, nullreset, nodevtotty,
- seltrue, fbmmap, NULL, DRIVER_NAME,
- NULL, -1, nodump, nopsize,
-};
-
-static void
-vfbattach(void *arg)
-{
- static int fb_devsw_installed = FALSE;
- dev_t dev;
-
- if (!fb_devsw_installed) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &fb_cdevsw, NULL);
- fb_devsw_installed = TRUE;
- }
-}
-
-PSEUDO_SET(vfbattach, fb);
-
-#endif /* notyet */
-
-int
-fb_attach(dev_t dev, video_adapter *adp, struct cdevsw *cdevsw)
-{
- int s;
-
- if (adp->va_index >= adapters)
- return EINVAL;
- if (adapter[adp->va_index] != adp)
- return EINVAL;
-
- s = spltty();
- adp->va_minor = minor(dev);
- vidcdevsw[adp->va_index] = cdevsw;
- splx(s);
-
- /* XXX: DEVFS? */
-
- if (adp->va_index + 1 >= adapters)
- vid_realloc_array();
-
- printf("fb%d at %s%d\n", adp->va_index, adp->va_name, adp->va_unit);
- return 0;
-}
-
-int
-fb_detach(dev_t dev, video_adapter *adp, struct cdevsw *cdevsw)
-{
- int s;
-
- if (adp->va_index >= adapters)
- return EINVAL;
- if (adapter[adp->va_index] != adp)
- return EINVAL;
- if (vidcdevsw[adp->va_index] != cdevsw)
- return EINVAL;
-
- s = spltty();
- vidcdevsw[adp->va_index] = NULL;
- splx(s);
- return 0;
-}
-
-#endif /* FB_INSTALL_CDEV */
-
-static char
-*adapter_name(int type)
-{
- static struct {
- int type;
- char *name;
- } names[] = {
- { KD_MONO, "MDA" },
- { KD_HERCULES, "Hercules" },
- { KD_CGA, "CGA" },
- { KD_EGA, "EGA" },
- { KD_VGA, "VGA" },
- { KD_PC98, "PC-98x1" },
- { -1, "Unknown" },
- };
- int i;
-
- for (i = 0; names[i].type != -1; ++i)
- if (names[i].type == type)
- break;
- return names[i].name;
-}
-
-void
-fb_dump_adp_info(char *driver, video_adapter_t *adp, int level)
-{
- if (level <= 0)
- return;
-
- printf("%s%d: %s%d, %s, type:%s (%d), flags:0x%x\n",
- DRIVER_NAME, adp->va_index, driver, adp->va_unit, adp->va_name,
- adapter_name(adp->va_type), adp->va_type, adp->va_flags);
- printf("%s%d: port:0x%x-0x%x, crtc:0x%x, mem:0x%x 0x%x\n",
- DRIVER_NAME, adp->va_index,
- adp->va_io_base, adp->va_io_base + adp->va_io_size - 1,
- adp->va_crtc_addr, adp->va_mem_base, adp->va_mem_size);
- printf("%s%d: init mode:%d, bios mode:%d, current mode:%d\n",
- DRIVER_NAME, adp->va_index,
- adp->va_initial_mode, adp->va_initial_bios_mode, adp->va_mode);
- printf("%s%d: window:0x%x size:%dk gran:%dk, buf:0x%x size:%dk\n",
- DRIVER_NAME, adp->va_index,
- adp->va_window, (int)adp->va_window_size/1024,
- (int)adp->va_window_gran/1024, adp->va_buffer,
- (int)adp->va_buffer_size/1024);
-}
-
-void
-fb_dump_mode_info(char *driver, video_adapter_t *adp, video_info_t *info,
- int level)
-{
- if (level <= 0)
- return;
-
- printf("%s%d: %s, mode:%d, flags:0x%x ",
- driver, adp->va_unit, adp->va_name, info->vi_mode, info->vi_flags);
- if (info->vi_flags & V_INFO_GRAPHICS)
- printf("G %dx%dx%d, %d plane(s), font:%dx%d, ",
- info->vi_width, info->vi_height,
- info->vi_depth, info->vi_planes,
- info->vi_cwidth, info->vi_cheight);
- else
- printf("T %dx%d, font:%dx%d, ",
- info->vi_width, info->vi_height,
- info->vi_cwidth, info->vi_cheight);
- printf("win:0x%x\n", info->vi_window);
-}
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h
deleted file mode 100644
index 46f0343d0edd1..0000000000000
--- a/sys/dev/fb/fbreg.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: fbreg.h,v 1.1 1999/01/09 02:44:49 yokota Exp $
- */
-
-#ifndef _DEV_FB_FBREG_H_
-#define _DEV_FB_FBREG_H_
-
-#ifdef KERNEL
-
-#define V_MAX_ADAPTERS 8 /* XXX */
-
-/* some macros */
-#ifdef __i386__
-#define bcopy_toio(s, d, c) generic_bcopy((void *)(s), (void *)(d), c)
-#define bcopy_fromio(s, d, c) generic_bcopy((void *)(s), (void *)(d), c)
-#define bzero_io(d, c) generic_bzero((void *)(d), c)
-void generic_bcopy(const void *s, void *d, size_t c);
-void generic_bzero(void *d, size_t c);
-#else /* !__i386__ */
-#define bcopy_toio(s, d, c) memcpy_toio(d, s, c)
-#define bcopy_fromio(s, d, c) memcpy_fromio(d, s, c)
-#define bzero_io(d, c) memset_io(d, 0, c)
-#endif /* !__i386__ */
-
-/* video function table */
-typedef int vi_probe_t(int unit, video_adapter_t **adpp, void *arg, int flags);
-typedef int vi_init_t(int unit, video_adapter_t *adp, int flags);
-typedef int vi_get_info_t(video_adapter_t *adp, int mode, video_info_t *info);
-typedef int vi_query_mode_t(video_adapter_t *adp, video_info_t *info);
-typedef int vi_set_mode_t(video_adapter_t *adp, int mode);
-typedef int vi_save_font_t(video_adapter_t *adp, int page, int size,
- u_char *data, int c, int count);
-typedef int vi_load_font_t(video_adapter_t *adp, int page, int size,
- u_char *data, int c, int count);
-typedef int vi_show_font_t(video_adapter_t *adp, int page);
-typedef int vi_save_palette_t(video_adapter_t *adp, u_char *palette);
-typedef int vi_load_palette_t(video_adapter_t *adp, u_char *palette);
-typedef int vi_set_border_t(video_adapter_t *adp, int border);
-typedef int vi_save_state_t(video_adapter_t *adp, void *p, size_t size);
-typedef int vi_load_state_t(video_adapter_t *adp, void *p);
-typedef int vi_set_win_org_t(video_adapter_t *adp, off_t offset);
-typedef int vi_read_hw_cursor_t(video_adapter_t *adp, int *col, int *row);
-typedef int vi_set_hw_cursor_t(video_adapter_t *adp, int col, int row);
-typedef int vi_set_hw_cursor_shape_t(video_adapter_t *adp, int base,
- int height, int celsize, int blink);
-typedef int vi_blank_display_t(video_adapter_t *adp, int mode);
-#define V_DISPLAY_POWER_ON 0
-#define V_DISPLAY_SUSPEND 1
-#define V_DISPLAY_SUSPEND1 1
-#define V_DISPLAY_SUSPEND2 2
-#define V_DISPLAY_POWER_OFF 3
-typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset);
-typedef int vi_diag_t(video_adapter_t *adp, int level);
-
-typedef struct video_switch {
- vi_probe_t *probe;
- vi_init_t *init;
- vi_get_info_t *get_info;
- vi_query_mode_t *query_mode;
- vi_set_mode_t *set_mode;
- vi_save_font_t *save_font;
- vi_load_font_t *load_font;
- vi_show_font_t *show_font;
- vi_save_palette_t *save_palette;
- vi_load_palette_t *load_palette;
- vi_set_border_t *set_border;
- vi_save_state_t *save_state;
- vi_load_state_t *load_state;
- vi_set_win_org_t *set_win_org;
- vi_read_hw_cursor_t *read_hw_cursor;
- vi_set_hw_cursor_t *set_hw_cursor;
- vi_set_hw_cursor_shape_t *set_hw_cursor_shape;
- vi_blank_display_t *blank_display;
- vi_mmap_t *mmap;
- vi_diag_t *diag;
-} video_switch_t;
-
-/* video driver */
-typedef struct video_driver {
- char *name;
- video_switch_t *vidsw;
- int (*configure)(int); /* backdoor for the console driver */
-} video_driver_t;
-
-#define VIDEO_DRIVER(name, sw, config) \
- static struct video_driver name##_driver = { \
- #name, &sw, config \
- }; \
- DATA_SET(videodriver_set, name##_driver);
-
-/* global variables */
-extern struct video_switch **vidsw;
-extern struct linker_set videodriver_set;
-
-/* functions for the video card driver */
-int vid_register(video_adapter_t *adp);
-int vid_unregister(video_adapter_t *adp);
-video_switch_t *vid_get_switch(char *name);
-void vid_init_struct(video_adapter_t *adp, char *name, int type,
- int unit);
-
-/* functions for the video card client */
-int vid_allocate(char *driver, int unit, void *id);
-int vid_release(video_adapter_t *adp, void *id);
-int vid_find_adapter(char *driver, int unit);
-video_adapter_t *vid_get_adapter(int index);
-
-/* a backdoor for the console driver to tickle the video driver XXX */
-int vid_configure(int flags);
-#define VIO_PROBE_ONLY (1 << 0) /* probe only, don't initialize */
-
-#ifdef FB_INSTALL_CDEV
-
-/* virtual frame buffer driver functions */
-int fb_attach(dev_t dev, video_adapter_t *adp,
- struct cdevsw *cdevsw);
-int fb_detach(dev_t dev, video_adapter_t *adp,
- struct cdevsw *cdevsw);
-
-#endif /* FB_INSTALL_CDEV */
-
-/* generic low-level driver functions */
-
-void fb_dump_adp_info(char *driver, video_adapter_t *adp, int level);
-void fb_dump_mode_info(char *driver, video_adapter_t *adp,
- video_info_t *info, int level);
-
-#endif /* KERNEL */
-
-#endif /* !_DEV_FB_FBREG_H_ */
diff --git a/sys/dev/fb/splash.c b/sys/dev/fb/splash.c
deleted file mode 100644
index 1f3281e361a3c..0000000000000
--- a/sys/dev/fb/splash.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: splash.c,v 1.1 1999/01/09 02:44:49 yokota Exp $
- */
-
-#include "splash.h"
-
-#if NSPLASH > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/linker.h>
-
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
-
-/* video adapter and image decoder */
-static video_adapter_t *splash_adp;
-static splash_decoder_t *splash_decoder;
-
-/* decoder candidates */
-static int decoders;
-static splash_decoder_t **decoder_set;
-#define DECODER_ARRAY_DELTA 4
-
-/* console driver callback */
-static int (*splash_callback)(int);
-
-static int
-splash_find_data(splash_decoder_t *decoder)
-{
- caddr_t image_module;
- caddr_t p;
-
- if (decoder->data_type == NULL)
- return 0;
- image_module = preload_search_by_type(decoder->data_type);
- if (image_module == NULL)
- return ENOENT;
- p = preload_search_info(image_module, MODINFO_ADDR);
- if (p == NULL)
- return ENOENT;
- decoder->data = *(void **)p;
- p = preload_search_info(image_module, MODINFO_SIZE);
- if (p == NULL)
- return ENOENT;
- decoder->data_size = *(size_t *)p;
- if (bootverbose)
- printf("splash: image@%p, size:%u\n",
- decoder->data, decoder->data_size);
- return 0;
-}
-
-static int
-splash_test(splash_decoder_t *decoder)
-{
- if (splash_find_data(decoder))
- return ENOENT; /* XXX */
- if ((*decoder->init)(splash_adp)) {
- decoder->data = NULL;
- decoder->data_size = 0;
- return ENODEV; /* XXX */
- }
- if (bootverbose)
- printf("splash: image decoder found: %s\n", decoder->name);
- return 0;
-}
-
-static void
-splash_new(splash_decoder_t *decoder)
-{
- splash_decoder = decoder;
- if (splash_callback != NULL)
- (*splash_callback)(SPLASH_INIT);
-}
-
-int
-splash_register(splash_decoder_t *decoder)
-{
- splash_decoder_t **p;
- int error;
- int i;
-
- if (splash_adp != NULL) {
- /*
- * If the video card has aleady been initialized, test
- * this decoder immediately.
- */
- error = splash_test(decoder);
- if (error == 0) {
- /* replace the current decoder with new one */
- if (splash_decoder != NULL)
- error = splash_term(splash_adp);
- if (error == 0)
- splash_new(decoder);
- }
- return error;
- } else {
- /* register the decoder for later use */
- for (i = 0; i < decoders; ++i) {
- if (decoder_set[i] == NULL)
- break;
- }
- if ((i >= decoders) && (decoders % DECODER_ARRAY_DELTA) == 0) {
- p = malloc(sizeof(*p)*(decoders + DECODER_ARRAY_DELTA),
- M_DEVBUF, M_NOWAIT);
- if (p == NULL)
- return ENOMEM;
- if (decoder_set != NULL)
- bcopy(decoder_set, p, sizeof(*p)*decoders);
- free(decoder_set, M_DEVBUF);
- decoder_set = p;
- i = decoders++;
- }
- decoder_set[i] = decoder;
- }
-
- return 0;
-}
-
-int
-splash_unregister(splash_decoder_t *decoder)
-{
- int error;
-
- if (splash_decoder == decoder) {
- if ((error = splash_term(splash_adp)) != 0)
- return error;
- }
- return 0;
-}
-
-int
-splash_init(video_adapter_t *adp, int (*callback)(int))
-{
- int i;
-
- splash_adp = adp;
- splash_callback = callback;
-
- splash_decoder = NULL;
- for (i = 0; i < decoders; ++i) {
- if (decoder_set[i] == NULL)
- continue;
- if (splash_test(decoder_set[i]) == 0) {
- splash_new(decoder_set[i]);
- break;
- }
- decoder_set[i] = NULL;
- }
- for (++i; i < decoders; ++i) {
- decoder_set[i] = NULL;
- }
- return 0;
-}
-
-int
-splash_term(video_adapter_t *adp)
-{
- int error = 0;
-
- if (splash_decoder != NULL) {
- if (splash_callback != NULL)
- error = (*splash_callback)(SPLASH_TERM);
- if (error == 0)
- error = (*splash_decoder->term)(adp);
- if (error == 0)
- splash_decoder = NULL;
- }
- return error;
-}
-
-int
-splash(video_adapter_t *adp, int on)
-{
- if (splash_decoder != NULL)
- return (*splash_decoder->splash)(adp, on);
- return ENODEV;
-}
-
-#endif /* NSPLASH > 0 */
diff --git a/sys/dev/fb/splashreg.h b/sys/dev/fb/splashreg.h
deleted file mode 100644
index fb785346202d3..0000000000000
--- a/sys/dev/fb/splashreg.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: splashreg.h,v 1.1 1999/01/09 02:44:49 yokota Exp $
- */
-
-#ifndef _DEV_FB_SPLASHREG_H_
-#define _DEV_FB_SPLASHREG_H_
-
-#define SPLASH_IMAGE "splash_image_data"
-
-struct video_adapter;
-
-struct image_decoder {
- char *name;
- int (*init)(struct video_adapter *adp);
- int (*term)(struct video_adapter *adp);
- int (*splash)(struct video_adapter *adp, int on);
- char *data_type;
- void *data;
- size_t data_size;
-};
-
-typedef struct image_decoder splash_decoder_t;
-typedef struct image_decoder scrn_saver_t;
-
-#define SPLASH_DECODER(name, sw) \
- static int name##_modevent(module_t mod, int type, void *data) \
- { \
- switch ((modeventtype_t)type) { \
- case MOD_LOAD: \
- return splash_register(&sw); \
- case MOD_UNLOAD: \
- return splash_unregister(&sw); \
- default: \
- break; \
- } \
- return 0; \
- } \
- static moduledata_t name##_mod = { \
- #name, \
- name##_modevent, \
- NULL \
- }; \
- DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY)
-
-#define SAVER_MODULE(name, sw) \
- static int name##_modevent(module_t mod, int type, void *data) \
- { \
- switch ((modeventtype_t)type) { \
- case MOD_LOAD: \
- return splash_register(&sw); \
- case MOD_UNLOAD: \
- return splash_unregister(&sw); \
- default: \
- break; \
- } \
- return 0; \
- } \
- static moduledata_t name##_mod = { \
- #name, \
- name##_modevent, \
- NULL \
- }; \
- DECLARE_MODULE(name, name##_mod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE)
-
-/* entry point for the splash image decoder */
-int splash_register(splash_decoder_t *decoder);
-int splash_unregister(splash_decoder_t *decoder);
-
-/* entry points for the console driver */
-int splash_init(video_adapter_t *adp, int (*callback)(int));
-int splash_term(video_adapter_t *adp);
-int splash(video_adapter_t *adp, int on);
-
-/* event types for the callback function */
-#define SPLASH_INIT 0
-#define SPLASH_TERM 1
-
-#endif /* _DEV_FB_SPLASHREG_H_ */
diff --git a/sys/dev/fb/vgareg.h b/sys/dev/fb/vgareg.h
deleted file mode 100644
index 841408e898799..0000000000000
--- a/sys/dev/fb/vgareg.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id:$
- */
-
-#ifndef _DEV_FB_VGAREG_H_
-#define _DEV_FB_VGAREG_H_
-
-/* physical addresses */
-#define MDA_BUF_BASE 0xb0000
-#define MDA_BUF_SIZE 0x08000
-#define MDA_BUF BIOS_PADDRTOVADDR(MDA_BUF_BASE)
-#define CGA_BUF_BASE 0xb8000
-#define CGA_BUF_SIZE 0x08000
-#define CGA_BUF BIOS_PADDRTOVADDR(CGA_BUF_BASE)
-#define EGA_BUF_BASE 0xa0000
-#define EGA_BUF_SIZE 0x20000
-#define EGA_BUF BIOS_PADDRTOVADDR(EGA_BUF_BASE)
-#define GRAPHICS_BUF_BASE 0xa0000
-#define GRAPHICS_BUF_SIZE 0x10000
-#define GRAPHICS_BUF BIOS_PADDRTOVADDR(GRAPHICS_BUF_BASE)
-#define FONT_BUF BIOS_PADDRTOVADDR(GRAPHICS_BUF_BASE)
-#define VIDEO_BUF_BASE 0xa0000
-#define VIDEO_BUF_SIZE 0x20000
-
-/* I/O port addresses */
-#define MONO_CRTC (IO_MDA + 0x04) /* crt controller base mono */
-#define COLOR_CRTC (IO_CGA + 0x04) /* crt controller base color */
-#define MISC (IO_VGA + 0x02) /* misc output register */
-#define ATC (IO_VGA + 0x00) /* attribute controller */
-#define TSIDX (IO_VGA + 0x04) /* timing sequencer idx */
-#define TSREG (IO_VGA + 0x05) /* timing sequencer data */
-#define PIXMASK (IO_VGA + 0x06) /* pixel write mask */
-#define PALRADR (IO_VGA + 0x07) /* palette read address */
-#define PALWADR (IO_VGA + 0x08) /* palette write address */
-#define PALDATA (IO_VGA + 0x09) /* palette data register */
-#define GDCIDX (IO_VGA + 0x0E) /* graph data controller idx */
-#define GDCREG (IO_VGA + 0x0F) /* graph data controller data */
-
-#ifdef KERNEL
-extern int (*vga_sub_configure)(int flags);
-#endif
-
-#endif /* _DEV_FB_VGAREG_H_ */
diff --git a/sys/dev/hea/eni.c b/sys/dev/hea/eni.c
index 8c3e0604c1ac1..977ed9bf2060a 100644
--- a/sys/dev/hea/eni.c
+++ b/sys/dev/hea/eni.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni.c,v 1.4 1998/12/04 22:54:45 archie Exp $
+ * @(#) $Id: eni.c,v 1.1 1998/09/15 08:22:52 phk Exp $
*
*/
@@ -35,20 +35,20 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni.c,v 1.1 1998/09/15 08:22:52 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni.c,v 1.4 1998/12/04 22:54:45 archie Exp $");
-#endif
-
/*
* Typedef local functions
*/
-static const char *eni_pci_probe __P((pcici_t, pcidi_t));
+static char *eni_pci_probe __P((pcici_t, pcidi_t));
static void eni_pci_attach __P((pcici_t, int));
static int eni_get_ack __P((Eni_unit *));
static int eni_get_sebyte __P((Eni_unit *));
@@ -98,7 +98,7 @@ DATA_SET ( pcidevice_set, eni_pci_device );
* NULL unrecognized vendor/device
*
*/
-static const char *
+static char *
eni_pci_probe ( pcici_t config_id, pcidi_t device_id )
{
@@ -496,12 +496,10 @@ eni_pci_attach ( pcici_t config_id, int unit )
* Make a hw version number from the ID register values.
* Format: {Midway ID}.{Mother board ID}.{Daughter board ID}
*/
- snprintf ( eup->eu_config.ac_hard_vers,
- sizeof ( eup->eu_config.ac_hard_vers ),
- "%ld/%ld/%ld",
- (val >> ID_SHIFT) & ID_MASK,
+ sprintf ( eup->eu_config.ac_hard_vers, "%ld/%ld/%ld",
+ (val >> ID_SHIFT) & ID_MASK,
(val >> MID_SHIFT) & MID_MASK,
- (val >> DID_SHIFT) & DID_MASK );
+ (val >> DID_SHIFT) & DID_MASK );
/*
* There is no software version number
diff --git a/sys/dev/hea/eni_buffer.c b/sys/dev/hea/eni_buffer.c
index 71d2eb9128caa..35d1b13ae4f88 100644
--- a/sys/dev/hea/eni_buffer.c
+++ b/sys/dev/hea/eni_buffer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_buffer.c,v 1.1 1998/09/15 08:22:53 phk Exp $
+ * @(#) $Id: eni_buffer.c,v 1.8 1998/08/26 23:28:53 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_buffer.c,v 1.8 1998/08/26 23:28:53 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_buffer.c,v 1.1 1998/09/15 08:22:53 phk Exp $");
-#endif
-
static int eni_test_memory __P((Eni_unit *));
/*
diff --git a/sys/dev/hea/eni_globals.c b/sys/dev/hea/eni_globals.c
index 71253e27a8232..a2a51fa834093 100644
--- a/sys/dev/hea/eni_globals.c
+++ b/sys/dev/hea/eni_globals.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_globals.c,v 1.1 1998/09/15 08:22:53 phk Exp $
+ * @(#) $Id: eni_globals.c,v 1.2 1997/05/06 22:07:52 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_globals.c,v 1.2 1997/05/06 22:07:52 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_globals.c,v 1.1 1998/09/15 08:22:53 phk Exp $");
-#endif
-
/*
* Device unit table
*/
diff --git a/sys/dev/hea/eni_if.c b/sys/dev/hea/eni_if.c
index 49f5e09516cdc..41ffd485b3f13 100644
--- a/sys/dev/hea/eni_if.c
+++ b/sys/dev/hea/eni_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_if.c,v 1.2 1998/10/31 20:06:45 phk Exp $
+ * @(#) $Id: eni_if.c,v 1.6 1998/08/26 23:28:53 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_if.c,v 1.6 1998/08/26 23:28:53 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
@@ -42,10 +46,6 @@
#include <dev/hea/eni_suni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_if.c,v 1.2 1998/10/31 20:06:45 phk Exp $");
-#endif
-
static void eni_get_stats __P((Eni_unit *));
/*
@@ -194,8 +194,7 @@ eni_atm_ioctl ( code, data, arg )
*/
if ( eup == NULL )
return ( ENXIO );
- snprintf ( ifname, sizeof(ifname),
- "%s%d", pip->pif_name, pip->pif_unit );
+ sprintf ( ifname, "%s%d", pip->pif_name, pip->pif_unit );
/*
* Cast response structure onto user's buffer
diff --git a/sys/dev/hea/eni_init.c b/sys/dev/hea/eni_init.c
index 5706c65adb32b..d8106ab0e763e 100644
--- a/sys/dev/hea/eni_init.c
+++ b/sys/dev/hea/eni_init.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_init.c,v 1.1 1998/09/15 08:22:53 phk Exp $
+ * @(#) $Id: eni_init.c,v 1.6 1998/08/26 23:28:53 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_init.c,v 1.6 1998/08/26 23:28:53 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_init.c,v 1.1 1998/09/15 08:22:53 phk Exp $");
-#endif
-
/*
* Initialize adapter for PDU processing
*
diff --git a/sys/dev/hea/eni_intr.c b/sys/dev/hea/eni_intr.c
index ccc0d6bbc5475..44a6790eb88d9 100644
--- a/sys/dev/hea/eni_intr.c
+++ b/sys/dev/hea/eni_intr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_intr.c,v 1.2 1998/09/17 09:34:58 phk Exp $
+ * @(#) $Id: eni_intr.c,v 1.1 1998/09/15 08:22:53 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_intr.c,v 1.1 1998/09/15 08:22:53 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
@@ -42,10 +46,6 @@
#include <dev/hea/eni_suni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_intr.c,v 1.2 1998/09/17 09:34:58 phk Exp $");
-#endif
-
static void eni_suni_intr __P((Eni_unit *));
/*
diff --git a/sys/dev/hea/eni_receive.c b/sys/dev/hea/eni_receive.c
index 8e8be36d6577b..94ce8c48a2217 100644
--- a/sys/dev/hea/eni_receive.c
+++ b/sys/dev/hea/eni_receive.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_receive.c,v 1.2 1998/09/17 09:34:58 phk Exp $
+ * @(#) $Id: eni_receive.c,v 1.1 1998/09/15 08:22:53 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_receive.c,v 1.1 1998/09/15 08:22:53 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_receive.c,v 1.2 1998/09/17 09:34:58 phk Exp $");
-#endif
-
static void eni_recv_stack __P((void *, KBuffer *));
#ifdef DIAGNOSTIC
diff --git a/sys/dev/hea/eni_transmit.c b/sys/dev/hea/eni_transmit.c
index 2721709a8fd6a..25066dfb6060f 100644
--- a/sys/dev/hea/eni_transmit.c
+++ b/sys/dev/hea/eni_transmit.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_transmit.c,v 1.2 1998/10/18 11:58:57 phk Exp $
+ * @(#) $Id: eni_transmit.c,v 1.20 1998/07/17 20:20:16 root Exp $
*
*/
@@ -36,16 +36,16 @@
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_transmit.c,v 1.20 1998/07/17 20:20:16 root Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_transmit.c,v 1.2 1998/10/18 11:58:57 phk Exp $");
-#endif
-
/*
* Make a variable which controls printing of PDUs
* as they travel through the driver.
@@ -467,7 +467,7 @@ retry:
/*
* Gotta slide the data up
*/
- eup->eu_stats.eni_st_drv.drv_xm_segnoal++;
+ eup->eu_stats.eni_st_drv.drv_xm_segnoal;
bfr = cp - align;
KM_COPY ( cp, bfr, KB_LEN ( m ) );
KB_HEADMOVE ( m, -align );
diff --git a/sys/dev/hea/eni_vcm.c b/sys/dev/hea/eni_vcm.c
index a88fc01bc67ad..36c2a3dbcec53 100644
--- a/sys/dev/hea/eni_vcm.c
+++ b/sys/dev/hea/eni_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: eni_vcm.c,v 1.1 1998/09/15 08:22:54 phk Exp $
+ * @(#) $Id: eni_vcm.c,v 1.8 1998/06/29 23:03:18 mks Exp $
*
*/
@@ -36,16 +36,16 @@
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: eni_vcm.c,v 1.8 1998/06/29 23:03:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
#include <dev/hea/eni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: eni_vcm.c,v 1.1 1998/09/15 08:22:54 phk Exp $");
-#endif
-
/*
* VCC Stack Instantiation
diff --git a/sys/dev/hfa/fore_buffer.c b/sys/dev/hfa/fore_buffer.c
index 6952f01cc23d9..d8bdce48c6d1c 100644
--- a/sys/dev/hfa/fore_buffer.c
+++ b/sys/dev/hfa/fore_buffer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_buffer.c,v 1.1 1998/09/15 08:22:54 phk Exp $
+ * @(#) $Id: fore_buffer.c,v 1.6 1997/05/06 22:09:21 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_buffer.c,v 1.1 1998/09/15 08:22:54 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_buffer.c,v 1.6 1997/05/06 22:09:21 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
diff --git a/sys/dev/hfa/fore_command.c b/sys/dev/hfa/fore_command.c
index d8e0e9d3cd2e9..980be432deaa8 100644
--- a/sys/dev/hfa/fore_command.c
+++ b/sys/dev/hfa/fore_command.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_command.c,v 1.3 1998/10/31 20:06:52 phk Exp $
+ * @(#) $Id: fore_command.c,v 1.1 1998/09/15 08:22:54 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_command.c,v 1.3 1998/10/31 20:06:52 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_command.c,v 1.1 1998/09/15 08:22:54 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local variables
*/
@@ -341,8 +341,7 @@ fore_cmd_drain(fup)
sizeof(struct mac_addr));
fup->fu_config.ac_macaddr =
fup->fu_pif.pif_macaddr;
- snprintf(fup->fu_config.ac_hard_vers,
- sizeof(fup->fu_config.ac_hard_vers),
+ sprintf(fup->fu_config.ac_hard_vers,
"%ld.%ld.%ld",
(fp->pr_hwver >> 16) & 0xff,
(fp->pr_hwver >> 8) & 0xff,
diff --git a/sys/dev/hfa/fore_globals.c b/sys/dev/hfa/fore_globals.c
index 5dc803a954172..4abc5fa437c30 100644
--- a/sys/dev/hfa/fore_globals.c
+++ b/sys/dev/hfa/fore_globals.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_globals.c,v 1.1 1998/09/15 08:22:55 phk Exp $
+ * @(#) $Id: fore_globals.c,v 1.6 1997/05/06 22:09:31 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_globals.c,v 1.1 1998/09/15 08:22:55 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_globals.c,v 1.6 1997/05/06 22:09:31 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Supported device models
diff --git a/sys/dev/hfa/fore_if.c b/sys/dev/hfa/fore_if.c
index 479e7e672f816..7d3b3b6dff5f1 100644
--- a/sys/dev/hfa/fore_if.c
+++ b/sys/dev/hfa/fore_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_if.c,v 1.2 1998/10/31 20:06:52 phk Exp $
+ * @(#) $Id: fore_if.c,v 1.6 1998/08/26 23:28:58 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_if.c,v 1.2 1998/10/31 20:06:52 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_if.c,v 1.6 1998/08/26 23:28:58 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Handle netatm core service interface ioctl requests
@@ -85,8 +85,7 @@ fore_atm_ioctl(code, data, arg)
fup = (Fore_unit *)pip;
if ( pip == NULL )
return ( ENXIO );
- snprintf ( ifname, sizeof(ifname),
- "%s%d", pip->pif_name, pip->pif_unit );
+ sprintf ( ifname, "%s%d", pip->pif_name, pip->pif_unit );
/*
* Cast response structure onto user's buffer
diff --git a/sys/dev/hfa/fore_init.c b/sys/dev/hfa/fore_init.c
index 7c1ee96dd9055..d82a8f8f7a1d6 100644
--- a/sys/dev/hfa/fore_init.c
+++ b/sys/dev/hfa/fore_init.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_init.c,v 1.3 1998/10/31 20:06:53 phk Exp $
+ * @(#) $Id: fore_init.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_init.c,v 1.3 1998/10/31 20:06:53 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_init.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
@@ -122,8 +122,7 @@ fore_initialize(fup)
errmsg = "unsupported microcode version";
goto failed;
}
- snprintf(fup->fu_config.ac_firm_vers,
- sizeof(fup->fu_config.ac_firm_vers), "%ld.%ld.%ld",
+ sprintf(fup->fu_config.ac_firm_vers, "%ld.%ld.%ld",
(vers >> 16) & 0xff, (vers >> 8) & 0xff, vers & 0xff);
#ifdef notdef
diff --git a/sys/dev/hfa/fore_intr.c b/sys/dev/hfa/fore_intr.c
index 6fba5f224a7c3..f295b6267e393 100644
--- a/sys/dev/hfa/fore_intr.c
+++ b/sys/dev/hfa/fore_intr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_intr.c,v 1.1 1998/09/15 08:22:55 phk Exp $
+ * @(#) $Id: fore_intr.c,v 1.7 1997/05/06 22:09:48 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_intr.c,v 1.1 1998/09/15 08:22:55 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_intr.c,v 1.7 1997/05/06 22:09:48 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
#if defined(sun)
/*
* Polling interrupt routine
diff --git a/sys/dev/hfa/fore_load.c b/sys/dev/hfa/fore_load.c
index e41370efe5c35..251443d252471 100644
--- a/sys/dev/hfa/fore_load.c
+++ b/sys/dev/hfa/fore_load.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_load.c,v 1.4 1998/12/04 22:54:45 archie Exp $
+ * @(#) $Id: fore_load.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,26 +35,26 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_load.c,v 1.4 1998/12/04 22:54:45 archie Exp $");
+static char *RCSid = "@(#) $Id: fore_load.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
*/
static int fore_start __P((void));
-#ifdef sun
static int fore_stop __P((void));
static int fore_doload __P((void));
static int fore_dounload __P((void));
+#ifdef sun
static int fore_identify __P((char *));
static int fore_attach __P((struct devinfo *));
#endif
#ifdef __FreeBSD__
-static const char * fore_pci_probe __P((pcici_t, pcidi_t));
+static char * fore_pci_probe __P((pcici_t, pcidi_t));
static void fore_pci_attach __P((pcici_t, int));
#if BSD < 199506
static int fore_pci_shutdown __P((struct kern_devconf *, int));
@@ -156,8 +156,6 @@ fore_start()
}
-#ifdef sun
-
/*
* Halt driver processing
*
@@ -242,6 +240,8 @@ fore_stop()
return (0);
}
+
+#ifdef sun
/*
* Device identify routine
*
@@ -726,12 +726,10 @@ fore_attach(devinfo_p)
val = getprop ( devinfo_p->devi_nodeid, "hw-version", -1 );
}
if (val != -1) {
- snprintf(fcp->ac_hard_vers,
- sizeof(fcp->ac_hard_vers), "%d.%d.%d",
+ sprintf(fcp->ac_hard_vers, "%d.%d.%d",
(val >> 16) & 0xff, (val >> 8) & 0xff, val & 0xff);
} else
- snprintf(fcp->ac_hard_vers,
- sizeof(fcp->ac_hard_vers), "Unknown");
+ sprintf(fcp->ac_hard_vers, "Unknown");
val = getprop ( devinfo_p->devi_nodeid, "serialnumber", -1 );
if ( val != -1 )
@@ -844,7 +842,7 @@ fore_attach(devinfo_p)
* NULL device not claimed by this driver
*
*/
-static const char *
+static char *
fore_pci_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1145,8 +1143,8 @@ fore_unattach(fup)
struct dev_info *devinfo_p = fup->fu_devinfo;
struct dev_reg *dev_reg_p;
struct dev_intr *dev_intr_p;
- int i;
#endif
+ int i;
/*
@@ -1361,7 +1359,6 @@ fore_reset(fup)
*******************************************************************
*/
-#ifdef sun
/*
* Generic module load processing
*
@@ -1421,6 +1418,7 @@ fore_dounload()
}
+#ifdef sun
/*
* Loadable driver description
*/
diff --git a/sys/dev/hfa/fore_output.c b/sys/dev/hfa/fore_output.c
index d92d5a01ca481..59c82c939dc3a 100644
--- a/sys/dev/hfa/fore_output.c
+++ b/sys/dev/hfa/fore_output.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_output.c,v 1.1 1998/09/15 08:22:55 phk Exp $
+ * @(#) $Id: fore_output.c,v 1.7 1998/02/19 20:10:34 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_output.c,v 1.1 1998/09/15 08:22:55 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_output.c,v 1.7 1998/02/19 20:10:34 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
diff --git a/sys/dev/hfa/fore_receive.c b/sys/dev/hfa/fore_receive.c
index 431a03f17cba8..12dfcec0d69ce 100644
--- a/sys/dev/hfa/fore_receive.c
+++ b/sys/dev/hfa/fore_receive.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_receive.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: fore_receive.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_receive.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_receive.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Local functions
diff --git a/sys/dev/hfa/fore_stats.c b/sys/dev/hfa/fore_stats.c
index c1a1fab14e817..c70b09879a7a1 100644
--- a/sys/dev/hfa/fore_stats.c
+++ b/sys/dev/hfa/fore_stats.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_stats.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: fore_stats.c,v 1.1 1998/09/15 08:22:55 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_stats.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_stats.c,v 1.1 1998/09/15 08:22:55 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Get device statistics from CP
diff --git a/sys/dev/hfa/fore_timer.c b/sys/dev/hfa/fore_timer.c
index 15cb02efbe65d..e0d0c0ee0a39a 100644
--- a/sys/dev/hfa/fore_timer.c
+++ b/sys/dev/hfa/fore_timer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_timer.c,v 1.1 1998/09/15 08:22:56 phk Exp $
+ * @(#) $Id: fore_timer.c,v 1.5 1997/05/06 22:10:24 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_timer.c,v 1.1 1998/09/15 08:22:56 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_timer.c,v 1.5 1997/05/06 22:10:24 mks Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Process a Fore timer tick
diff --git a/sys/dev/hfa/fore_transmit.c b/sys/dev/hfa/fore_transmit.c
index bced06c25e67f..744e7751c7568 100644
--- a/sys/dev/hfa/fore_transmit.c
+++ b/sys/dev/hfa/fore_transmit.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_transmit.c,v 1.1 1998/09/15 08:22:56 phk Exp $
+ * @(#) $Id: fore_transmit.c,v 1.8 1998/07/17 20:19:37 root Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_transmit.c,v 1.1 1998/09/15 08:22:56 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_transmit.c,v 1.8 1998/07/17 20:19:37 root Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* Allocate Transmit Queue Data Structures
diff --git a/sys/dev/hfa/fore_vcm.c b/sys/dev/hfa/fore_vcm.c
index 325883b31b6eb..2481d17c20bab 100644
--- a/sys/dev/hfa/fore_vcm.c
+++ b/sys/dev/hfa/fore_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: fore_vcm.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: fore_vcm.c,v 1.1 1998/09/15 08:22:56 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <dev/hfa/fore_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: fore_vcm.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: fore_vcm.c,v 1.1 1998/09/15 08:22:56 phk Exp $";
#endif
+#include <dev/hfa/fore_include.h>
+
/*
* VCC Stack Instantiation
diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c
index 7af9db71f632f..52626e0904431 100644
--- a/sys/dev/iicbus/if_ic.c
+++ b/sys/dev/iicbus/if_ic.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ic.c,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: if_ic.c,v 1.1.1.11 1998/08/13 17:10:42 son Exp $
*/
/*
@@ -213,7 +213,7 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return ENOBUFS;
}
- iicbus_reset(parent, IIC_FASTEST, 0, NULL);
+ iicbus_reset(parent, IIC_FASTEST);
ifp->if_flags |= IFF_RUNNING;
}
@@ -290,6 +290,7 @@ icintr (device_t dev, int event, char *ptr)
int unit = device_get_unit(dev);
int s, len;
struct mbuf *top;
+ int i;
s = splhigh();
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
index e41d08b8a2b77..45d551b8f5de8 100644
--- a/sys/dev/iicbus/iic.c
+++ b/sys/dev/iicbus/iic.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iic.c,v 1.5 1998/12/07 21:58:16 archie Exp $
+ * $Id: iic.c,v 1.2 1998/09/04 17:53:35 nsouch Exp $
*
*/
#include <sys/param.h>
@@ -40,7 +40,6 @@
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
-
#include <machine/iic.h>
#include "iicbus_if.h"
@@ -118,6 +117,8 @@ iic_probe(device_t dev)
static int
iic_attach(device_t dev)
{
+ struct iic_softc *sc = (struct iic_softc *)device_get_softc(dev);
+
return (0);
}
@@ -210,16 +211,15 @@ iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
device_t iicdev = IIC_DEVICE(minor(dev));
struct iic_softc *sc = IIC_SOFTC(minor(dev));
+ int error;
device_t parent = device_get_parent(iicdev);
- struct iiccmd *s = (struct iiccmd *)data;
- int error, count;
if (!sc)
return (EINVAL);
switch (cmd) {
case I2CSTART:
- error = iicbus_start(parent, s->slave, 0);
+ error = iicbus_start(parent, sc->sc_addr);
break;
case I2CSTOP:
@@ -227,15 +227,7 @@ iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
break;
case I2CRSTCARD:
- error = iicbus_reset(parent, 0, 0, NULL);
- break;
-
- case I2CWRITE:
- error = iicbus_write(parent, s->buf, s->count, &count, 0);
- break;
-
- case I2CREAD:
- error = iicbus_read(parent, s->buf, s->count, &count, s->last, 0);
+ error = iicbus_reset(parent, 0);
break;
default:
diff --git a/sys/dev/iicbus/iicbb.c b/sys/dev/iicbus/iicbb.c
deleted file mode 100644
index 81629bcf2b099..0000000000000
--- a/sys/dev/iicbus/iicbb.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*-
- * Copyright (c) 1998 Nicolas Souchu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: iicbb.c,v 1.1 1998/10/31 11:31:07 nsouch Exp $
- *
- */
-
-/*
- * Generic I2C bit-banging code
- *
- * Example:
- *
- * iicbus
- * / \
- * iicbb pcf
- * | \
- * bti2c lpbb
- *
- * From Linux I2C generic interface
- * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
- *
- * TODO: port Peter's generic bit-banging code <dufault@hda.com>
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
-
-#include <machine/clock.h>
-
-#include <dev/iicbus/iiconf.h>
-#include <dev/iicbus/iicbus.h>
-
-#include <dev/smbus/smbconf.h>
-
-#include "iicbus_if.h"
-#include "iicbb_if.h"
-
-struct iicbb_softc {
- int dummy;
-};
-
-static int iicbb_probe(device_t);
-static int iicbb_attach(device_t);
-static void iicbb_print_child(device_t, device_t);
-
-static int iicbb_callback(device_t, int, caddr_t);
-static int iicbb_start(device_t, u_char, int);
-static int iicbb_stop(device_t);
-static int iicbb_write(device_t, char *, int, int *, int);
-static int iicbb_read(device_t, char *, int, int *, int, int);
-static int iicbb_reset(device_t, u_char, u_char, u_char *);
-
-static device_method_t iicbb_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, iicbb_probe),
- DEVMETHOD(device_attach, iicbb_attach),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, iicbb_print_child),
-
- /* iicbus interface */
- DEVMETHOD(iicbus_callback, iicbb_callback),
- DEVMETHOD(iicbus_start, iicbb_start),
- DEVMETHOD(iicbus_repeated_start, iicbb_start),
- DEVMETHOD(iicbus_stop, iicbb_stop),
- DEVMETHOD(iicbus_write, iicbb_write),
- DEVMETHOD(iicbus_read, iicbb_read),
- DEVMETHOD(iicbus_reset, iicbb_reset),
-
- { 0, 0 }
-};
-
-static driver_t iicbb_driver = {
- "iicbb",
- iicbb_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct iicbb_softc),
-};
-
-static devclass_t iicbb_devclass;
-
-static int iicbb_probe(device_t dev)
-{
- device_set_desc(dev, "I2C generic bit-banging driver");
-
- return (0);
-}
-
-static int iicbb_attach(device_t dev)
-{
- return (0);
-}
-
-static void
-iicbb_print_child(device_t bus, device_t dev)
-{
- int error;
- u_char oldaddr;
-
- /* retrieve the interface I2C address */
- error = IICBB_RESET(device_get_parent(bus), IIC_FASTEST, 0, &oldaddr);
- if (error == IIC_ENOADDR) {
- printf(" on %s%d master-only", device_get_name(bus),
- device_get_unit(bus));
-
- } else {
- /* restore the address */
- IICBB_RESET(device_get_parent(bus), IIC_FASTEST, oldaddr, NULL);
-
- printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), oldaddr & 0xff);
- }
-
- return;
-}
-
-#define I2C_SET(dev,ctrl,data) \
- IICBB_SETLINES(device_get_parent(dev), ctrl, data)
-
-#define I2C_GET(dev) (IICBB_GETDATALINE(device_get_parent(dev)))
-
-static int i2c_debug = 0;
-#define I2C_DEBUG(x) if (i2c_debug) (x)
-
-static void iicbb_one(device_t dev)
-{
- I2C_SET(dev,0,1);
- I2C_SET(dev,1,1);
- I2C_SET(dev,0,1);
- return;
-}
-
-static void iicbb_zero(device_t dev)
-{
- I2C_SET(dev,0,0);
- I2C_SET(dev,1,0);
- I2C_SET(dev,0,0);
- return;
-}
-
-/*
- * Waiting for ACKNOWLEDGE.
- *
- * When a chip is being addressed or has received data it will issue an
- * ACKNOWLEDGE pulse. Therefore the MASTER must release the DATA line
- * (set it to high level) and then release the CLOCK line.
- * Now it must wait for the SLAVE to pull the DATA line low.
- * Actually on the bus this looks like a START condition so nothing happens
- * because of the fact that the IC's that have not been addressed are doing
- * nothing.
- *
- * When the SLAVE has pulled this line low the MASTER will take the CLOCK
- * line low and then the SLAVE will release the SDA (data) line.
- */
-static int iicbb_ack(device_t dev, int timeout)
-{
- int noack;
- int k = timeout/10;
-
- I2C_SET(dev,0,1);
- I2C_SET(dev,1,1);
-
- do {
- noack = I2C_GET(dev);
- if (!noack)
- break;
- DELAY(10); /* XXX wait 10us */
- } while (k--);
-
- I2C_SET(dev,0,1);
- I2C_DEBUG(printf("%c ",noack?'-':'+'));
-
- return (noack);
-}
-
-static void iicbb_sendbyte(device_t dev, u_char data)
-{
- int i;
-
- I2C_SET(dev,0,0);
- for (i=7; i>=0; i--)
- (data&(1<<i)) ? iicbb_one(dev) : iicbb_zero(dev);
- I2C_DEBUG(printf("w%02x",(int)data));
- return;
-}
-
-static u_char iicbb_readbyte(device_t dev, int last)
-{
- int i;
- unsigned char data=0;
-
- I2C_SET(dev,0,1);
- for (i=7; i>=0; i--)
- {
- I2C_SET(dev,1,1);
- if (I2C_GET(dev))
- data |= (1<<i);
- I2C_SET(dev,0,1);
- }
- last ? iicbb_one(dev) : iicbb_zero(dev);
- I2C_DEBUG(printf("r%02x%c ",(int)data,last?'-':'+'));
- return data;
-}
-
-static int iicbb_callback(device_t dev, int index, caddr_t data)
-{
- return (IICBB_CALLBACK(device_get_parent(dev), index, data));
-}
-
-static int iicbb_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
-{
- return (IICBB_RESET(device_get_parent(dev), speed, addr, oldaddr));
-}
-
-static int iicbb_start(device_t dev, u_char slave, int timeout)
-{
- int error;
-
- I2C_DEBUG(printf("<"));
-
- I2C_SET(dev,0,1);
- I2C_SET(dev,1,1);
- I2C_SET(dev,1,0);
- I2C_SET(dev,0,0);
-
- /* send address */
- iicbb_sendbyte(dev, slave);
-
- /* check for ack */
- if (iicbb_ack(dev, timeout)) {
- error = IIC_ENOACK;
- goto error;
- }
-
- return(0);
-
-error:
- iicbb_stop(dev);
- return (error);
-}
-
-static int iicbb_stop(device_t dev)
-{
- I2C_SET(dev,0,0);
- I2C_SET(dev,1,0);
- I2C_SET(dev,1,1);
- I2C_DEBUG(printf(">"));
- return (0);
-}
-
-static int iicbb_write(device_t dev, char * buf, int len, int *sent,
- int timeout)
-{
- int bytes, error = 0;
-
- bytes = 0;
- while (len) {
- /* send byte */
- iicbb_sendbyte(dev,(u_char)*buf++);
-
- /* check for ack */
- if (iicbb_ack(dev, timeout)) {
- error = IIC_ENOACK;
- goto error;
- }
- bytes ++;
- len --;
- }
-
-error:
- *sent = bytes;
- return (error);
-}
-
-static int iicbb_read(device_t dev, char * buf, int len, int *read,
- int last, int delay)
-{
- int bytes;
-
- bytes = 0;
- while (len) {
- /* XXX should insert delay here */
- *buf++ = (char)iicbb_readbyte(dev, (len == 1) ? 1 : 0);
-
- bytes ++;
- len --;
- }
-
- *read = bytes;
- return (0);
-}
-
-DRIVER_MODULE(iicbb, bti2c, iicbb_driver, iicbb_devclass, 0, 0);
-DRIVER_MODULE(iicbb, lpbb, iicbb_driver, iicbb_devclass, 0, 0);
diff --git a/sys/dev/iicbus/iicbb_if.m b/sys/dev/iicbus/iicbb_if.m
deleted file mode 100644
index bdf1108fac95a..0000000000000
--- a/sys/dev/iicbus/iicbb_if.m
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Copyright (c) 1998 Nicolas Souchu
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $Id: iicbb_if.m,v 1.1 1998/10/31 11:31:07 nsouch Exp $
-#
-
-INTERFACE iicbb;
-
-#
-# iicbus callback
-#
-METHOD int callback {
- device_t dev;
- int index;
- caddr_t data;
-};
-
-#
-# Set I2C bus lines
-#
-METHOD void setlines {
- device_t dev;
- int ctrl;
- int data;
-};
-
-#
-# Get I2C bus lines
-#
-#
-METHOD int getdataline {
- device_t dev;
-};
-
-#
-# Reset interface
-#
-METHOD int reset {
- device_t dev;
- u_char speed;
- u_char addr;
- u_char *oldaddr;
-};
diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
index cf9f6ba5ac262..41a0cea4f01c4 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.c,v 1.6 1998/12/07 21:58:16 archie Exp $
+ * $Id: iicbus.c,v 1.1.2.7 1998/08/29 16:54:16 son Exp $
*
*/
@@ -54,7 +54,6 @@ struct iicbus_device {
int iicd_class; /* driver or slave device class */
const char *iicd_desc; /* device descriptor */
u_char iicd_addr; /* address of the device */
- int iicd_waitack; /* wait for ack timeout or delay */
int iicd_alive; /* 1 if device found */
};
@@ -62,10 +61,10 @@ struct iicbus_device {
* Common I2C addresses
*/
#define I2C_GENERAL_CALL 0x0
-#define PCF_MASTER_ADDRESS 0xaa
-#define FIRST_SLAVE_ADDR 0x2
+#define I2C_MASTER_ADDRESS 0xaa
+#define I2C_INET_ADDRESS 0xaa
-#define LAST_SLAVE_ADDR 255
+#define MAXSLAVE 256
#define IICBUS_UNKNOWN_CLASS 0
#define IICBUS_DEVICE_CLASS 1
@@ -73,15 +72,13 @@ struct iicbus_device {
/*
* list of known devices
- *
- * XXX only one smb driver should exist for each I2C interface
*/
struct iicbus_device iicbus_children[] = {
+ { "iic", IICBUS_DRIVER_CLASS, "General Call", I2C_GENERAL_CALL },
{ "iicsmb", IICBUS_DRIVER_CLASS, "I2C to SMB bridge" },
- { "iic", IICBUS_DRIVER_CLASS, "I2C general purpose I/O" },
-#if 0
- { "ic", IICBUS_DEVICE_CLASS, "network interface", PCF_MASTER_ADDRESS },
-#endif
+ { "iic", IICBUS_DEVICE_CLASS, "PCF8574 I2C to 8 bits parallel i/o", 64},
+ { "iic", IICBUS_DEVICE_CLASS, "PCF8584 as slave", I2C_MASTER_ADDRESS },
+ { "ic", IICBUS_DEVICE_CLASS, "network interface", I2C_INET_ADDRESS },
{ NULL, 0 }
};
@@ -94,7 +91,6 @@ static int iicbus_probe(device_t);
static int iicbus_attach(device_t);
static void iicbus_print_child(device_t, device_t);
static int iicbus_read_ivar(device_t , device_t, int, u_long *);
-static int iicbus_write_ivar(device_t , device_t, int, u_long);
static device_method_t iicbus_methods[] = {
/* device interface */
@@ -106,7 +102,9 @@ static device_method_t iicbus_methods[] = {
/* bus interface */
DEVMETHOD(bus_print_child, iicbus_print_child),
DEVMETHOD(bus_read_ivar, iicbus_read_ivar),
- DEVMETHOD(bus_write_ivar, iicbus_write_ivar),
+ DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -118,118 +116,59 @@ static driver_t iicbus_driver = {
sizeof(struct iicbus_softc),
};
-static int
-iicbus_probe(device_t dev)
-{
- device_set_desc(dev, "Philips I2C bus");
-
- return (0);
-}
-
-#if 0
-static int
-iic_probe_device(device_t dev, u_char addr)
-{
- int count;
- char byte;
-
- if ((addr & 1) == 0) {
- /* is device writable? */
- if (!iicbus_start(dev, (u_char)addr, 0)) {
- iicbus_stop(dev);
- return (1);
- }
- } else {
- /* is device readable? */
- if (!iicbus_block_read(dev, (u_char)addr, &byte, 1, &count))
- return (1);
- }
-
- return (0);
-}
-#endif
-
/*
- * We add all the devices which we know about.
- * The generic attach routine will attach them if they are alive.
+ * At 'probe' time, we add all the devices which we know about to the
+ * bus. The generic attach routine will probe and attach them if they
+ * are alive.
*/
static int
-iicbus_attach(device_t dev)
+iicbus_probe(device_t dev)
{
+ struct iicbus_softc *sc = device_get_softc(dev);
struct iicbus_device *iicdev;
device_t child;
- iicbus_reset(dev, IIC_FASTEST, 0, NULL);
+ /* XXX should query parent */
+ sc->ownaddr = I2C_MASTER_ADDRESS;
- /* device probing is meaningless since the bus is supposed to be
- * hot-plug. Moreover, some I2C chips do not appreciate random
- * accesses like stop after start to fast, reads for less than
- * x bytes...
- */
-#if 0
- printf("Probing for devices on iicbus%d:", device_get_unit(dev));
-
- /* probe any devices */
- for (addr = FIRST_SLAVE_ADDR; addr <= LAST_SLAVE_ADDR; addr++) {
- if (iic_probe_device(dev, (u_char)addr)) {
- printf(" <%x>", addr);
- }
- }
- printf("\n");
-#endif
+ iicbus_reset(dev, IIC_FASTEST);
- /* attach known devices */
for (iicdev = iicbus_children; iicdev->iicd_name; iicdev++) {
+
+ /* probe devices, not drivers */
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
- /* check if the devclass exists */
- if (devclass_find(iicdev->iicd_name))
+ if (!iicbus_start(dev, iicdev->iicd_addr)) {
+ iicbus_stop(dev);
iicdev->iicd_alive = 1;
- else if (bootverbose)
- printf("iicbus: %s devclass not found\n",
- iicdev->iicd_name);
+ }
break;
-
case IICBUS_DRIVER_CLASS:
- /* check if the devclass exists */
- if (devclass_find(iicdev->iicd_name))
- iicdev->iicd_alive = 1;
- else if (bootverbose)
- printf("iicbus: %s devclass not found\n",
- iicdev->iicd_name);
+ iicdev->iicd_addr = sc->ownaddr;
break;
-
default:
panic("%s: unknown class!", __FUNCTION__);
}
- if (iicdev->iicd_alive) {
- child = device_add_child(dev, iicdev->iicd_name,
- -1, iicdev);
- device_set_desc(child, iicdev->iicd_desc);
- }
+ child = device_add_child(dev, iicdev->iicd_name, -1, iicdev);
+ device_set_desc(child, iicdev->iicd_desc);
}
- bus_generic_attach(dev);
-
- return (0);
-}
-int
-iicbus_generic_intr(device_t dev, int event, char *buf)
-{
return (0);
}
-int
-iicbus_null_callback(device_t dev, int index, caddr_t data)
+static int
+iicbus_attach(device_t dev)
{
- return (0);
+ bus_generic_attach(dev);
+
+ return (0);
}
int
-iicbus_null_repeated_start(device_t dev, u_char addr)
+iicbus_generic_intr(device_t dev, int event, char *buf)
{
- return (IIC_ENOTSUPP);
+ return (0);
}
static void
@@ -239,8 +178,9 @@ iicbus_print_child(device_t bus, device_t dev)
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
- printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), iicdev->iicd_addr);
+ printf(" on %s%d addr %d %s", device_get_name(bus),
+ device_get_unit(bus), iicdev->iicd_addr,
+ (iicdev->iicd_alive) ? "found" : "not found");
break;
case IICBUS_DRIVER_CLASS:
@@ -272,17 +212,4 @@ iicbus_read_ivar(device_t bus, device_t dev, int index, u_long* result)
return (0);
}
-static int
-iicbus_write_ivar(device_t bus, device_t dev, int index, u_long val)
-{
- switch (index) {
- default:
- return (ENOENT);
- }
-
- return (0);
-}
-
DRIVER_MODULE(iicbus, pcf, iicbus_driver, iicbus_devclass, 0, 0);
-DRIVER_MODULE(iicbus, iicbb, iicbus_driver, iicbus_devclass, 0, 0);
-DRIVER_MODULE(iicbus, bti2c, iicbus_driver, iicbus_devclass, 0, 0);
diff --git a/sys/dev/iicbus/iicbus.h b/sys/dev/iicbus/iicbus.h
index 3c230955bbc12..e84525286175f 100644
--- a/sys/dev/iicbus/iicbus.h
+++ b/sys/dev/iicbus/iicbus.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iicbus.h,v 1.1.2.3 1998/08/13 17:10:43 son Exp $
*
*/
#ifndef __IICBUS_H
@@ -31,9 +31,8 @@
struct iicbus_softc {
+ u_char ownaddr; /* address of the adapter */
device_t owner; /* iicbus owner device structure */
- u_char started; /* address of the 'started' slave
- * 0 if no start condition succeeded */
};
extern devclass_t iicbus_devclass;
diff --git a/sys/dev/iicbus/iicbus_if.m b/sys/dev/iicbus/iicbus_if.m
index 7e29333db4954..bf7efeb3a45a7 100644
--- a/sys/dev/iicbus/iicbus_if.m
+++ b/sys/dev/iicbus/iicbus_if.m
@@ -23,13 +23,13 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: iicbus_if.m,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+# $Id: iicbus_if.m,v 1.1.2.4 1998/08/13 17:10:43 son Exp $
#
-INTERFACE iicbus;
+INTERFACE iicbus
#
-# Interpret interrupt
+# Interprete interrupt
#
METHOD int intr {
device_t dev;
@@ -38,21 +38,11 @@ METHOD int intr {
};
#
-# iicbus callback
-#
-METHOD int callback {
- device_t dev;
- int index;
- caddr_t data;
-};
-
-#
# Send REPEATED_START condition
#
METHOD int repeated_start {
device_t dev;
u_char slave;
- int timeout;
};
#
@@ -61,7 +51,6 @@ METHOD int repeated_start {
METHOD int start {
device_t dev;
u_char slave;
- int timeout;
};
#
@@ -79,8 +68,6 @@ METHOD int read {
char *buf;
int len;
int *bytes;
- int last;
- int delay;
};
#
@@ -91,7 +78,6 @@ METHOD int write {
char *buf;
int len;
int *bytes;
- int timeout;
};
#
@@ -100,6 +86,4 @@ METHOD int write {
METHOD int reset {
device_t dev;
u_char speed;
- u_char addr;
- u_char *oldaddr;
};
diff --git a/sys/dev/iicbus/iiconf.c b/sys/dev/iicbus/iiconf.c
index 47f1686fac0f5..b037b7cca2b13 100644
--- a/sys/dev/iicbus/iiconf.c
+++ b/sys/dev/iicbus/iiconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iiconf.c,v 1.3 1998/11/22 22:01:42 nsouch Exp $
+ * $Id: iiconf.c,v 1.1.1.11 1998/08/29 17:02:05 son Exp $
*
*/
#include <sys/param.h>
@@ -65,29 +65,10 @@ iicbus_alloc_bus(device_t parent)
/* add the bus to the parent */
child = device_add_child(parent, "iicbus", -1, NULL);
- return (child);
-}
-
-static int
-iicbus_poll(struct iicbus_softc *sc, int how)
-{
- int error;
+ if (child)
+ device_set_desc(child, "Philips I2C bus");
- switch (how) {
- case (IIC_WAIT | IIC_INTR):
- error = tsleep(sc, IICPRI|PCATCH, "iicreq", 0);
- break;
-
- case (IIC_WAIT | IIC_NOINTR):
- error = tsleep(sc, IICPRI, "iicreq", 0);
- break;
-
- default:
- return (EWOULDBLOCK);
- break;
- }
-
- return (error);
+ return (child);
}
/*
@@ -103,20 +84,25 @@ iicbus_request_bus(device_t bus, device_t dev, int how)
struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
int s, error = 0;
- /* first, ask the underlying layers if the request is ok */
- do {
- error = IICBUS_CALLBACK(device_get_parent(bus),
- IIC_REQUEST_BUS, (caddr_t)&how);
- if (error)
- error = iicbus_poll(sc, how);
- } while (error);
-
while (!error) {
s = splhigh();
if (sc->owner) {
splx(s);
- error = iicbus_poll(sc, how);
+ switch (how) {
+ case (IIC_WAIT | IIC_INTR):
+ error = tsleep(sc, IICPRI|PCATCH, "iicreq", 0);
+ break;
+
+ case (IIC_WAIT | IIC_NOINTR):
+ error = tsleep(sc, IICPRI, "iicreq", 0);
+ break;
+
+ default:
+ return (EWOULDBLOCK);
+ break;
+ }
+
} else {
sc->owner = dev;
@@ -137,13 +123,7 @@ int
iicbus_release_bus(device_t bus, device_t dev)
{
struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
- int s, error;
-
- /* first, ask the underlying layers if the release is ok */
- error = IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL);
-
- if (error)
- return (error);
+ int s;
s = splhigh();
if (sc->owner != dev) {
@@ -161,99 +141,6 @@ iicbus_release_bus(device_t bus, device_t dev)
}
/*
- * iicbus_started()
- *
- * Test if the iicbus is started by the controller
- */
-int
-iicbus_started(device_t bus)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
-
- return (sc->started);
-}
-
-/*
- * iicbus_start()
- *
- * Send start condition to the slave addressed by 'slave'
- */
-int
-iicbus_start(device_t bus, u_char slave, int timeout)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
- int error = 0;
-
- if (sc->started)
- return (EINVAL); /* bus already started */
-
- if (!(error = IICBUS_START(device_get_parent(bus), slave, timeout)))
- sc->started = slave;
- else
- sc->started = 0;
-
- return (error);
-}
-
-/*
- * iicbus_stop()
- *
- * Send stop condition to the bus
- */
-int
-iicbus_stop(device_t bus)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
- int error = 0;
-
- if (!sc->started)
- return (EINVAL); /* bus not started */
-
- error = IICBUS_STOP(device_get_parent(bus));
-
- /* refuse any further access */
- sc->started = 0;
-
- return (error);
-}
-
-/*
- * iicbus_write()
- *
- * Write a block of data to the slave previously started by
- * iicbus_start() call
- */
-int
-iicbus_write(device_t bus, char *buf, int len, int *sent, int timeout)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
-
- /* a slave must have been started with the appropriate address */
- if (!sc->started || (sc->started & LSB))
- return (EINVAL);
-
- return (IICBUS_WRITE(device_get_parent(bus), buf, len, sent, timeout));
-}
-
-/*
- * iicbus_read()
- *
- * Read a block of data from the slave previously started by
- * iicbus_read() call
- */
-int
-iicbus_read(device_t bus, char *buf, int len, int *read, int last, int delay)
-{
- struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
-
- /* a slave must have been started with the appropriate address */
- if (!sc->started || !(sc->started & LSB))
- return (EINVAL);
-
- return (IICBUS_READ(device_get_parent(bus), buf, len, read, last, delay));
-}
-
-/*
* iicbus_block_write()
*
* Write a block of data to slave ; start/stop protocol managed
@@ -264,10 +151,10 @@ iicbus_block_write(device_t bus, u_char slave, char *buf, int len, int *sent)
u_char addr = slave & ~LSB;
int error;
- if ((error = iicbus_start(bus, addr, 0)))
+ if ((error = iicbus_start(bus, addr)))
return (error);
- error = iicbus_write(bus, buf, len, sent, 0);
+ error = iicbus_write(bus, buf, len, sent);
iicbus_stop(bus);
@@ -285,12 +172,12 @@ iicbus_block_read(device_t bus, u_char slave, char *buf, int len, int *read)
u_char addr = slave | LSB;
int error;
- if ((error = iicbus_start(bus, addr, 0)))
+ if ((error = iicbus_start(bus, addr)))
return (error);
- error = iicbus_read(bus, buf, len, read, IIC_LAST_READ, 0);
+ error = iicbus_read(bus, buf, len, read);
- iicbus_stop(bus);
+ /* STOP condition sent at adapter level */
return (error);
}
@@ -303,7 +190,7 @@ iicbus_block_read(device_t bus, u_char slave, char *buf, int len, int *read)
u_char
iicbus_get_addr(device_t dev)
{
- uintptr_t addr;
+ u_long addr;
device_t parent = device_get_parent(dev);
BUS_READ_IVAR(parent, dev, IICBUS_IVAR_ADDR, &addr);
@@ -311,3 +198,10 @@ iicbus_get_addr(device_t dev)
return ((u_char)addr);
}
+u_char
+iicbus_get_own_address(device_t bus)
+{
+ struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
+
+ return (sc->ownaddr);
+}
diff --git a/sys/dev/iicbus/iiconf.h b/sys/dev/iicbus/iiconf.h
index 0b548fbdf8f05..9bf0ed35e3cd2 100644
--- a/sys/dev/iicbus/iiconf.h
+++ b/sys/dev/iicbus/iiconf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iiconf.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iiconf.h,v 1.1.1.10 1998/08/13 17:10:43 son Exp $
*/
#ifndef __IICONF_H
#define __IICONF_H
@@ -59,14 +59,6 @@
#define IIC_FAST 0x2
#define IIC_FASTEST 0x3
-#define IIC_LAST_READ 0x1
-
-/*
- * callback index
- */
-#define IIC_REQUEST_BUS 0x1
-#define IIC_RELEASE_BUS 0x2
-
/*
* interrupt events
*/
@@ -89,8 +81,6 @@
#define IIC_ESTATUS 0x5 /* status error */
#define IIC_EUNDERFLOW 0x6 /* slave ready for more data */
#define IIC_EOVERFLOW 0x7 /* too much data */
-#define IIC_ENOTSUPP 0x8 /* request not supported */
-#define IIC_ENOADDR 0x9 /* no address assigned to the interface */
/*
* ivars codes
@@ -103,25 +93,23 @@ extern device_t iicbus_alloc_bus(device_t);
extern void iicbus_intr(device_t, int, char *);
-extern int iicbus_null_repeated_start(device_t, u_char);
-extern int iicbus_null_callback(device_t, int, caddr_t);
-
-#define iicbus_repeated_start(bus,slave,timeout) \
- (IICBUS_REPEATED_START(device_get_parent(bus), slave, timeout))
-#define iicbus_reset(bus,speed,addr,oldaddr) \
- (IICBUS_RESET(device_get_parent(bus), speed, addr, oldaddr))
-
-/* basic I2C operations */
-extern int iicbus_started(device_t);
-extern int iicbus_start(device_t, u_char, int);
-extern int iicbus_stop(device_t);
-extern int iicbus_write(device_t, char *, int, int *, int);
-extern int iicbus_read(device_t, char *, int, int *, int, int);
+#define iicbus_repeated_start(bus,slave) \
+ (IICBUS_REPEATED_START(device_get_parent(bus), slave))
+#define iicbus_start(bus,slave) \
+ (IICBUS_START(device_get_parent(bus), slave))
+#define iicbus_stop(bus) \
+ (IICBUS_STOP(device_get_parent(bus)))
+#define iicbus_reset(bus,speed) \
+ (IICBUS_RESET(device_get_parent(bus), speed))
+#define iicbus_write(bus,buf,len,sent) \
+ (IICBUS_WRITE(device_get_parent(bus), buf, len, sent))
+#define iicbus_read(bus,buf,len,sent) \
+ (IICBUS_READ(device_get_parent(bus), buf, len, sent))
-/* Read/write operations with start/stop conditions managed */
extern int iicbus_block_write(device_t, u_char, char *, int, int *);
extern int iicbus_block_read(device_t, u_char, char *, int, int *);
extern u_char iicbus_get_addr(device_t);
+extern u_char iicbus_get_own_address(device_t);
#endif
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index 060c548d8a2fc..8f3a8bb7066d6 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -23,26 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicsmb.c,v 1.1.1.1 1998/09/03 20:51:50 nsouch Exp $
+ * $Id: iicsmb.c,v 1.1.2.2 1998/08/13 17:10:44 son Exp $
*
*/
/*
* I2C to SMB bridge
- *
- * Example:
- *
- * smb bttv
- * \ /
- * smbus
- * / \
- * iicsmb bti2c
- * |
- * iicbus
- * / | \
- * iicbb pcf ...
- * |
- * lpbb
*/
#include <sys/param.h>
@@ -86,7 +72,6 @@ static int iicsmb_attach(device_t);
static void iicsmb_print_child(device_t, device_t);
static void iicsmb_intr(device_t dev, int event, char *buf);
-static int iicsmb_callback(device_t dev, int index, caddr_t data);
static int iicsmb_quick(device_t dev, u_char slave, int how);
static int iicsmb_sendb(device_t dev, u_char slave, char byte);
static int iicsmb_recvb(device_t dev, u_char slave, char *byte);
@@ -112,7 +97,6 @@ static device_method_t iicsmb_methods[] = {
DEVMETHOD(iicbus_intr, iicsmb_intr),
/* smbus interface */
- DEVMETHOD(smbus_callback, iicsmb_callback),
DEVMETHOD(smbus_quick, iicsmb_quick),
DEVMETHOD(smbus_sendb, iicsmb_sendb),
DEVMETHOD(smbus_recvb, iicsmb_recvb),
@@ -239,32 +223,6 @@ end:
}
static int
-iicsmb_callback(device_t dev, int index, caddr_t data)
-{
- device_t parent = device_get_parent(dev);
- int error = 0;
- int how;
-
- switch (index) {
- case SMB_REQUEST_BUS:
- /* request underlying iicbus */
- how = *(int *)data;
- error = iicbus_request_bus(parent, dev, how);
- break;
-
- case SMB_RELEASE_BUS:
- /* release underlying iicbus */
- error = iicbus_release_bus(parent, dev);
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-static int
iicsmb_quick(device_t dev, u_char slave, int how)
{
device_t parent = device_get_parent(dev);
@@ -272,11 +230,11 @@ iicsmb_quick(device_t dev, u_char slave, int how)
switch (how) {
case SMB_QWRITE:
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
break;
case SMB_QREAD:
- error = iicbus_start(parent, slave | LSB, 0);
+ error = iicbus_start(parent, slave | LSB);
break;
default:
@@ -296,10 +254,10 @@ iicsmb_sendb(device_t dev, u_char slave, char byte)
device_t parent = device_get_parent(dev);
int error, sent;
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
if (!error) {
- error = iicbus_write(parent, &byte, 1, &sent, 0);
+ error = iicbus_write(parent, &byte, 1, &sent);
iicbus_stop(parent);
}
@@ -313,13 +271,10 @@ iicsmb_recvb(device_t dev, u_char slave, char *byte)
device_t parent = device_get_parent(dev);
int error, read;
- error = iicbus_start(parent, slave | LSB, 0);
+ error = iicbus_start(parent, slave | LSB);
- if (!error) {
- error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, 0);
-
- iicbus_stop(parent);
- }
+ if (!error)
+ error = iicbus_read(parent, byte, 1, &read);
return (error);
}
@@ -330,11 +285,11 @@ iicsmb_writeb(device_t dev, u_char slave, char cmd, char byte)
device_t parent = device_get_parent(dev);
int error, sent;
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
if (!error) {
- if (!(error = iicbus_write(parent, &cmd, 1, &sent, 0)))
- error = iicbus_write(parent, &byte, 1, &sent, 0);
+ if (!(error = iicbus_write(parent, &cmd, 1, &sent)))
+ error = iicbus_write(parent, &byte, 1, &sent);
iicbus_stop(parent);
}
@@ -351,12 +306,12 @@ iicsmb_writew(device_t dev, u_char slave, char cmd, short word)
char low = (char)(word & 0xff);
char high = (char)((word & 0xff00) >> 8);
- error = iicbus_start(parent, slave & ~LSB, 0);
+ error = iicbus_start(parent, slave & ~LSB);
if (!error) {
- if (!(error = iicbus_write(parent, &cmd, 1, &sent, 0)))
- if (!(error = iicbus_write(parent, &low, 1, &sent, 0)))
- error = iicbus_write(parent, &high, 1, &sent, 0);
+ if (!(error = iicbus_write(parent, &cmd, 1, &sent)))
+ if (!(error = iicbus_write(parent, &low, 1, &sent)))
+ error = iicbus_write(parent, &high, 1, &sent);
iicbus_stop(parent);
}
@@ -370,20 +325,19 @@ iicsmb_readb(device_t dev, u_char slave, char cmd, char *byte)
device_t parent = device_get_parent(dev);
int error, sent, read;
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, byte, 1, &read, IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, byte, 1, &read)))
goto error;
error:
- iicbus_stop(parent);
return (error);
}
@@ -397,23 +351,22 @@ iicsmb_readw(device_t dev, u_char slave, char cmd, short *word)
int error, sent, read;
char buf[2];
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, buf, 2, &read)))
goto error;
/* first, receive low, then high byte */
*word = BUF2SHORT(buf[0], buf[1]);
error:
- iicbus_stop(parent);
return (error);
}
@@ -424,30 +377,29 @@ iicsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata)
int error, sent, read;
char buf[2];
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
/* first, send low, then high byte */
buf[0] = (char)(sdata & 0xff);
buf[1] = (char)((sdata & 0xff00) >> 8);
- if ((error = iicbus_write(parent, buf, 2, &sent, 0)))
+ if ((error = iicbus_write(parent, buf, 2, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, buf, 2, &read, IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, buf, 2, &read)))
goto error;
/* first, receive low, then high byte */
*rdata = BUF2SHORT(buf[0], buf[1]);
error:
- iicbus_stop(parent);
return (error);
}
@@ -457,13 +409,13 @@ iicsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
device_t parent = device_get_parent(dev);
int error, sent;
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
+ if ((error = iicbus_start(parent, slave & ~LSB)))
goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_write(parent, buf, (int)count, &sent, 0)))
+ if ((error = iicbus_write(parent, buf, (int)count, &sent)))
goto error;
if ((error = iicbus_stop(parent)))
@@ -479,21 +431,19 @@ iicsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf)
device_t parent = device_get_parent(dev);
int error, sent, read;
- if ((error = iicbus_start(parent, slave & ~LSB, 0)))
- return (error);
+ if ((error = iicbus_start(parent, slave & ~LSB)))
+ goto error;
- if ((error = iicbus_write(parent, &cmd, 1, &sent, 0)))
+ if ((error = iicbus_write(parent, &cmd, 1, &sent)))
goto error;
- if ((error = iicbus_repeated_start(parent, slave | LSB, 0)))
+ if ((error = iicbus_repeated_start(parent, slave | LSB)))
goto error;
- if ((error = iicbus_read(parent, buf, (int)count, &read,
- IIC_LAST_READ, 0)))
+ if ((error = iicbus_read(parent, buf, (int)count, &read)))
goto error;
error:
- iicbus_stop(parent);
return (error);
}
diff --git a/sys/dev/isp/asm_pci.h b/sys/dev/isp/asm_pci.h
index b7e0f9a9a11dc..fd9313bd263e1 100644
--- a/sys/dev/isp/asm_pci.h
+++ b/sys/dev/isp/asm_pci.h
@@ -1,13 +1,1314 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: asm_pci.h,v 1.8 1998/09/14 23:24:59 mjacob Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998 by Qlogic Corporation
*/
/*
- * Firmware Version 7.55.00 (16:16 Mar 20, 1998)
+ * Version 2.10 Initiator Firmware (16:13 Oct 18, 1995)
+ *
+ * (this f/w now deprecated for newer f/w, but the old is held here
+ * in case of problems...)
*/
+
#define ISP_CODE_ORG 0x1000
+#if 0
+#define ISP_CODE_VERSION 2*1024+10
+static const u_int16_t ISP_RISC_CODE[] = {
+ 0x0078, 0x1041, 0x0000, 0x283a, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31,
+ 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320,
+ 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350,
+ 0x3130, 0x3230, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
+ 0x6572, 0x7369, 0x6f6e, 0x2030, 0x322e, 0x3130, 0x2020, 0x2043,
+ 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050,
+ 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020,
+ 0x2400, 0x20b9, 0x1212, 0x2071, 0x0010, 0x70c3, 0x0004, 0x20c9,
+ 0x43ff, 0x2089, 0x115b, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf,
+ 0x2020, 0x70d3, 0x0002, 0x3f00, 0x70d6, 0x20c1, 0x0008, 0x2019,
+ 0x0000, 0x2009, 0xfeff, 0x2100, 0x200b, 0xa5a5, 0xa1ec, 0x7fff,
+ 0x2d64, 0x206b, 0x0a0a, 0xaddc, 0x3fff, 0x2b54, 0x205b, 0x5050,
+ 0x2114, 0xa286, 0xa5a5, 0x0040, 0x10b3, 0xa386, 0x000f, 0x0040,
+ 0x1079, 0x2c6a, 0x2a5a, 0x20c1, 0x0000, 0x2019, 0x000f, 0x0078,
+ 0x1059, 0x2c6a, 0x2a5a, 0x20c1, 0x0008, 0x2009, 0x7fff, 0x2148,
+ 0x2944, 0x204b, 0x0a0a, 0xa9bc, 0x3fff, 0x2734, 0x203b, 0x5050,
+ 0x2114, 0xa286, 0x0a0a, 0x0040, 0x109d, 0x284a, 0x263a, 0x20c1,
+ 0x0004, 0x2009, 0x3fff, 0x2134, 0x200b, 0x5050, 0x2114, 0xa286,
+ 0x5050, 0x0040, 0x109e, 0x0078, 0x1163, 0x284a, 0x263a, 0x98c0,
+ 0xa188, 0x1000, 0x212c, 0x200b, 0xa5a5, 0x2114, 0xa286, 0xa5a5,
+ 0x0040, 0x10b0, 0x250a, 0xa18a, 0x1000, 0x98c1, 0x0078, 0x10b5,
+ 0x250a, 0x0078, 0x10b5, 0x2c6a, 0x2a5a, 0x2130, 0xa18a, 0x0040,
+ 0x2128, 0xa1a2, 0x3900, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424,
+ 0x8424, 0xa192, 0x4400, 0x2009, 0x0000, 0x2001, 0x002f, 0x1078,
+ 0x1a70, 0x2218, 0x2079, 0x3900, 0x2fa0, 0x2408, 0x2011, 0x0000,
+ 0x20a9, 0x0040, 0x42a4, 0x8109, 0x00c0, 0x10d0, 0x7eea, 0x7dde,
+ 0x8528, 0x7dda, 0x7ce2, 0x7be6, 0x787b, 0x0000, 0x2031, 0x0030,
+ 0x78c3, 0x0101, 0x780b, 0x0002, 0x780f, 0x0002, 0x784f, 0x0003,
+ 0x2069, 0x3940, 0x681b, 0x0028, 0x6807, 0x0007, 0x680b, 0x00fa,
+ 0x680f, 0x0008, 0x6813, 0x0005, 0x681f, 0x0000, 0x6823, 0x0006,
+ 0x6817, 0x0008, 0x6827, 0x0000, 0x2069, 0x3a00, 0x2011, 0x0020,
+ 0x2009, 0x0010, 0x680b, 0x0c19, 0x680f, 0x0019, 0x6803, 0xfd00,
+ 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004,
+ 0x8109, 0x00c0, 0x1102, 0x2069, 0x3a80, 0x20a9, 0x0080, 0x680b,
+ 0x0040, 0x7be8, 0xa386, 0xfeff, 0x00c0, 0x1124, 0x6817, 0x0100,
+ 0x681f, 0x0064, 0x0078, 0x1128, 0x6817, 0x0064, 0x681f, 0x0002,
+ 0xade8, 0x0010, 0x0070, 0x112e, 0x0078, 0x1117, 0x1078, 0x1d15,
+ 0x1078, 0x3366, 0x1078, 0x18a4, 0x1078, 0x37fc, 0x3200, 0xa085,
+ 0x000d, 0x2090, 0x70c3, 0x0000, 0x0090, 0x1145, 0x70c0, 0xa086,
+ 0x0002, 0x00c0, 0x1145, 0x1078, 0x1274, 0x1078, 0x1186, 0x78c0,
+ 0xa005, 0x00c0, 0x1151, 0x1078, 0x1a99, 0x0068, 0x1155, 0x1078,
+ 0x1c6f, 0x0068, 0x1155, 0x1078, 0x1997, 0x00e0, 0x1145, 0x1078,
+ 0x369a, 0x0078, 0x1145, 0x1163, 0x1165, 0x1ebb, 0x1ebb, 0x33d7,
+ 0x33d7, 0x1ebb, 0x1ebb, 0x0078, 0x1163, 0x0078, 0x1165, 0x0078,
+ 0x1167, 0x0078, 0x1169, 0x2009, 0x0022, 0x2104, 0xa086, 0x4000,
+ 0x0040, 0x1181, 0x7008, 0x800b, 0x00c8, 0x1181, 0x7007, 0x0002,
+ 0xa08c, 0x0060, 0x00c0, 0x1182, 0xa084, 0x0008, 0x0040, 0x1181,
+ 0x087a, 0x097a, 0x70c3, 0x4002, 0x0078, 0x1277, 0x0068, 0x11f1,
+ 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x11f1, 0x7814,
+ 0xa005, 0x00c0, 0x1197, 0x0010, 0x11f2, 0x0078, 0x11f1, 0x2009,
+ 0x3968, 0x2104, 0xa005, 0x00c0, 0x11f1, 0x2009, 0x3971, 0x200b,
+ 0x0000, 0x7914, 0xa186, 0x0042, 0x00c0, 0x11bc, 0x7816, 0x2009,
+ 0x396f, 0x2164, 0x200b, 0x0000, 0x6018, 0x70c6, 0x6014, 0x70ca,
+ 0x611c, 0xa18c, 0xff00, 0x6020, 0xa084, 0x00ff, 0xa105, 0x70ce,
+ 0x1078, 0x1896, 0x0078, 0x11ef, 0x7814, 0xa086, 0x0018, 0x00c0,
+ 0x11c3, 0x1078, 0x1622, 0x7817, 0x0000, 0x2009, 0x396f, 0x2104,
+ 0xa065, 0x0040, 0x11df, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x18f6,
+ 0x0c7f, 0x609f, 0x0000, 0x1078, 0x16e9, 0x2009, 0x001c, 0x6087,
+ 0x0103, 0x1078, 0x181d, 0x00c0, 0x11eb, 0x1078, 0x1896, 0x2009,
+ 0x396f, 0x200b, 0x0000, 0x2009, 0x3969, 0x2104, 0x200b, 0x0000,
+ 0xa005, 0x0040, 0x11ef, 0x2001, 0x4005, 0x0078, 0x1276, 0x0078,
+ 0x1274, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000, 0x70cb, 0x0000,
+ 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0, 0x1242, 0x2038,
+ 0x0079, 0x1202, 0x1274, 0x12cf, 0x1293, 0x12cf, 0x1338, 0x1338,
+ 0x128a, 0x16fd, 0x1343, 0x1282, 0x1297, 0x1299, 0x129b, 0x129d,
+ 0x1702, 0x1282, 0x1355, 0x1380, 0x163a, 0x16f7, 0x129f, 0x1569,
+ 0x158b, 0x15a1, 0x15be, 0x1526, 0x1534, 0x1548, 0x155c, 0x13f3,
+ 0x1282, 0x13a1, 0x13a7, 0x13ac, 0x13b1, 0x13b7, 0x13bc, 0x13c1,
+ 0x13c6, 0x13cb, 0x13cf, 0x13e4, 0x13f0, 0x1282, 0x1282, 0x1282,
+ 0x1282, 0x13ff, 0x1408, 0x1417, 0x143d, 0x1447, 0x144e, 0x1474,
+ 0x1483, 0x1492, 0x14a4, 0x1506, 0x1516, 0x1282, 0x1282, 0x1282,
+ 0x1282, 0x151b, 0xa0bc, 0xffa0, 0x00c0, 0x1282, 0x2038, 0xa084,
+ 0x001f, 0x0079, 0x124b, 0x1719, 0x171c, 0x172c, 0x17a8, 0x17e1,
+ 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282,
+ 0x1282, 0x1282, 0x1282, 0x12c5, 0x132e, 0x134b, 0x1376, 0x1630,
+ 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x17f9, 0x1803, 0x1807,
+ 0x1815, 0x1282, 0x1282, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078,
+ 0x1276, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068,
+ 0x1277, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x2091,
+ 0x4080, 0x007c, 0x70c3, 0x4001, 0x0078, 0x1277, 0x70c3, 0x4006,
+ 0x0078, 0x1277, 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005,
+ 0x53a3, 0x0078, 0x1274, 0x70c4, 0x70c3, 0x0004, 0x007a, 0x0078,
+ 0x1274, 0x0078, 0x1274, 0x0078, 0x1274, 0x0078, 0x1274, 0x2091,
+ 0x8000, 0x70c3, 0x0000, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf,
+ 0x2020, 0x70d3, 0x0002, 0x3f00, 0x70d6, 0x2079, 0x0000, 0x781b,
+ 0x0001, 0x2031, 0x0030, 0x2059, 0x1000, 0x2029, 0x0457, 0x2051,
+ 0x0470, 0x2061, 0x0472, 0x20b9, 0xffff, 0x20c1, 0x0000, 0x2091,
+ 0x5000, 0x2091, 0x4080, 0x0078, 0x0455, 0x1078, 0x1a04, 0x00c0,
+ 0x1286, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x12d2, 0x2029,
+ 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, 0x2098,
+ 0x2031, 0x0030, 0x81ff, 0x0040, 0x1274, 0x7007, 0x0004, 0x731a,
+ 0x721e, 0x7422, 0x7526, 0x2051, 0x0012, 0x2049, 0x130d, 0x2041,
+ 0x1274, 0x7003, 0x0002, 0xa786, 0x0001, 0x0040, 0x12f5, 0xa786,
+ 0x0050, 0x0040, 0x12f5, 0x0078, 0x12fb, 0x2049, 0x131a, 0x2041,
+ 0x1326, 0x7003, 0x0003, 0x7017, 0x0000, 0x810b, 0x7112, 0x00c8,
+ 0x1303, 0x7017, 0x0001, 0x7007, 0x0001, 0xa786, 0x0001, 0x0040,
+ 0x131a, 0xa786, 0x0050, 0x0040, 0x131a, 0x700c, 0xa084, 0x007f,
+ 0x2009, 0x0040, 0xa102, 0x8004, 0x094a, 0x20a8, 0x26a0, 0x53a6,
+ 0x0078, 0x116b, 0x700c, 0xa084, 0x007f, 0x0040, 0x131a, 0x80ac,
+ 0x0048, 0x131a, 0x2698, 0x53a5, 0x0078, 0x116b, 0x700c, 0xa084,
+ 0x007f, 0x80ac, 0x2698, 0x53a5, 0x0078, 0x1274, 0x1078, 0x1a04,
+ 0x00c0, 0x1286, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x12d2,
+ 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0, 0x1340, 0x200a,
+ 0x72ca, 0x0078, 0x1273, 0x70c7, 0x0002, 0x70cb, 0x000a, 0x70cf,
+ 0x0000, 0x0078, 0x1274, 0x1078, 0x1a04, 0x00c0, 0x1286, 0x75d8,
+ 0x76dc, 0x75da, 0x76de, 0x0078, 0x1358, 0x2029, 0x0000, 0x2530,
+ 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6, 0x72ca, 0x73ce, 0x74d2,
+ 0xa005, 0x0040, 0x1370, 0x8001, 0x788a, 0x7a92, 0x7b96, 0x7d9a,
+ 0x7e9e, 0x7c8e, 0x78c0, 0xa084, 0xfffc, 0x78c2, 0x0078, 0x1374,
+ 0x78c0, 0xa085, 0x0001, 0x78c2, 0x0078, 0x1274, 0x1078, 0x1a04,
+ 0x00c0, 0x1286, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x1383,
+ 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6,
+ 0x72ca, 0x73ce, 0x74d6, 0xa005, 0x0040, 0x139b, 0x8001, 0x78a6,
+ 0x7aae, 0x7bb2, 0x7db6, 0x7eba, 0x7caa, 0x78c0, 0xa084, 0xfcff,
+ 0x78c2, 0x0078, 0x139f, 0x78c0, 0xa085, 0x0100, 0x78c2, 0x0078,
+ 0x1274, 0x2009, 0x395f, 0x210c, 0x7ae4, 0x0078, 0x1272, 0x2009,
+ 0x3941, 0x210c, 0x0078, 0x1273, 0x2009, 0x3942, 0x210c, 0x0078,
+ 0x1273, 0x2061, 0x3940, 0x610c, 0x6210, 0x0078, 0x1272, 0x2009,
+ 0x3945, 0x210c, 0x0078, 0x1273, 0x2009, 0x3946, 0x210c, 0x0078,
+ 0x1273, 0x2009, 0x3947, 0x210c, 0x0078, 0x1273, 0x2009, 0x3948,
+ 0x210c, 0x0078, 0x1273, 0x7908, 0x7a0c, 0x0078, 0x1272, 0x71c4,
+ 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8, 0x3a00,
+ 0x6a00, 0x6804, 0xa084, 0x0008, 0x0040, 0x13e1, 0x6b08, 0x0078,
+ 0x13e2, 0x6b0c, 0x0078, 0x1271, 0x77c4, 0x1078, 0x18b4, 0x2091,
+ 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 0x0078, 0x1271,
+ 0x794c, 0x0078, 0x1273, 0x77c4, 0x1078, 0x18b4, 0x2091, 0x8000,
+ 0x6908, 0x6a18, 0x6b10, 0x2091, 0x8001, 0x0078, 0x1271, 0x71c4,
+ 0xa182, 0x0010, 0x00c8, 0x126c, 0x1078, 0x1d9b, 0x0078, 0x1271,
+ 0x71c4, 0xa182, 0x0010, 0x00c8, 0x126c, 0x2011, 0x3941, 0x2204,
+ 0x007e, 0x2112, 0x1078, 0x1d54, 0x017f, 0x0078, 0x1273, 0x71c4,
+ 0x2011, 0x1435, 0x20a9, 0x0008, 0x2204, 0xa106, 0x0040, 0x1427,
+ 0x8210, 0x0070, 0x1425, 0x0078, 0x141c, 0x0078, 0x126c, 0xa292,
+ 0x1435, 0x027e, 0x2011, 0x3942, 0x2204, 0x2112, 0x017f, 0x007e,
+ 0x1078, 0x1d60, 0x017f, 0x0078, 0x1273, 0x03e8, 0x00fa, 0x01f4,
+ 0x02ee, 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x3940, 0x610c,
+ 0x6210, 0x70c4, 0x600e, 0x70c8, 0x6012, 0x0078, 0x1272, 0x2061,
+ 0x3940, 0x6114, 0x70c4, 0x6016, 0x0078, 0x1273, 0x71c4, 0x2011,
+ 0x0004, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x1467, 0x2011,
+ 0x0005, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040, 0x1467, 0x2011,
+ 0x0006, 0x2019, 0x2323, 0xa186, 0x003c, 0x00c0, 0x126c, 0x2061,
+ 0x3940, 0x6018, 0x007e, 0x611a, 0x23b8, 0x1078, 0x1d71, 0x1078,
+ 0x37fc, 0x017f, 0x0078, 0x1273, 0x71c4, 0xa184, 0xffcf, 0x00c0,
+ 0x126c, 0x2011, 0x3947, 0x2204, 0x2112, 0x007e, 0x1078, 0x1d93,
+ 0x017f, 0x0078, 0x1273, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x126c,
+ 0x2011, 0x3948, 0x2204, 0x007e, 0x2112, 0x1078, 0x1d82, 0x017f,
+ 0x0078, 0x1273, 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x126b,
+ 0xa284, 0xfffd, 0x00c0, 0x126b, 0x2100, 0x7908, 0x780a, 0x2200,
+ 0x7a0c, 0x780e, 0x0078, 0x1272, 0x71c4, 0x8107, 0xa084, 0x000f,
+ 0x8003, 0x8003, 0x8003, 0xa0e8, 0x3a00, 0x2019, 0x0000, 0x72c8,
+ 0x6800, 0x007e, 0xa226, 0x0040, 0x14d3, 0x6a02, 0xa484, 0x2000,
+ 0x0040, 0x14bc, 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x14c2,
+ 0xa39d, 0x0008, 0xa484, 0x4000, 0x0040, 0x14d3, 0x810f, 0xa284,
+ 0x4000, 0x0040, 0x14cf, 0x1078, 0x1db5, 0x0078, 0x14d3, 0x1078,
+ 0x1da7, 0x0078, 0x14d3, 0x72cc, 0x82ff, 0x0040, 0x14ff, 0x6808,
+ 0xa206, 0x0040, 0x14ff, 0xa2a4, 0x00ff, 0x2061, 0x3940, 0x6118,
+ 0xa186, 0x0028, 0x0040, 0x14ec, 0xa186, 0x0032, 0x0040, 0x14f2,
+ 0xa186, 0x003c, 0x0040, 0x14f8, 0xa482, 0x0064, 0x00c8, 0x126d,
+ 0x0078, 0x14fc, 0xa482, 0x0050, 0x00c8, 0x126d, 0x0078, 0x14fc,
+ 0xa482, 0x0043, 0x00c8, 0x126d, 0x6a0a, 0xa39d, 0x000a, 0x6804,
+ 0xa305, 0x6806, 0x027f, 0x6b0c, 0x0078, 0x1271, 0x77c4, 0x1078,
+ 0x18b4, 0x2091, 0x8000, 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8,
+ 0x6816, 0x70cc, 0x681e, 0x2708, 0x0078, 0x1271, 0x70c4, 0x794c,
+ 0x784e, 0x0078, 0x1273, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010,
+ 0x00c8, 0x126c, 0x1078, 0x1dc3, 0x0078, 0x1271, 0x77c4, 0x1078,
+ 0x18b4, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0002, 0x6a0a, 0x2091,
+ 0x8001, 0x2708, 0x0078, 0x1272, 0x77c4, 0x1078, 0x18b4, 0x2091,
+ 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0040,
+ 0x1543, 0x1078, 0x1cf6, 0x2091, 0x8001, 0x2708, 0x0078, 0x1272,
+ 0x77c4, 0x1078, 0x18b4, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0004,
+ 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1557, 0x1078, 0x1cf6, 0x2091,
+ 0x8001, 0x2708, 0x0078, 0x1272, 0x77c4, 0x2041, 0x0001, 0x2049,
+ 0x0005, 0x2051, 0x0020, 0x1078, 0x18c1, 0x2708, 0x6a08, 0x0078,
+ 0x1272, 0x77c4, 0x73c8, 0x72cc, 0x77c6, 0x73ca, 0x72ce, 0x1078,
+ 0x193c, 0x00c0, 0x1587, 0x6818, 0xa005, 0x0040, 0x1581, 0x2708,
+ 0x1078, 0x1dd3, 0x00c0, 0x1581, 0x7817, 0x0015, 0x2091, 0x8001,
+ 0x007c, 0x2091, 0x8001, 0x2001, 0x4005, 0x0078, 0x1276, 0x2091,
+ 0x8001, 0x0078, 0x1274, 0x77c4, 0x77c6, 0x2061, 0x3940, 0x60a3,
+ 0x0003, 0x67b6, 0x60c7, 0x000f, 0x2041, 0x0021, 0x2049, 0x0005,
+ 0x2051, 0x0020, 0x1078, 0x18c1, 0x7817, 0x0016, 0x1078, 0x1cf6,
+ 0x007c, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2061, 0x3940, 0x60a3,
+ 0x0002, 0x67b6, 0x60c7, 0x000f, 0x7817, 0x0017, 0x1078, 0x1cf6,
+ 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x1078, 0x18c1,
+ 0x8738, 0xa784, 0x0007, 0x00c0, 0x15b6, 0x007c, 0x78c0, 0xa084,
+ 0x0003, 0x00c0, 0x15e2, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049,
+ 0x0004, 0x2051, 0x0008, 0x1078, 0x18b4, 0x2091, 0x8000, 0x6808,
+ 0xa80d, 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, 0x0007, 0x00c0,
+ 0x15cb, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00,
+ 0x00c0, 0x15cb, 0x2091, 0x8000, 0x2069, 0x0100, 0x6830, 0xa084,
+ 0x0040, 0x0040, 0x160b, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848,
+ 0xa084, 0x0004, 0x0040, 0x15f8, 0x0070, 0x15f8, 0x0078, 0x15ef,
+ 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001, 0x0040,
+ 0x1605, 0x0070, 0x1605, 0x0078, 0x15fc, 0x20a9, 0x00fa, 0x0070,
+ 0x160b, 0x0078, 0x1607, 0x2079, 0x3900, 0x7817, 0x0018, 0x2061,
+ 0x3940, 0x60a3, 0x0001, 0x60c7, 0x000f, 0x78c0, 0xa085, 0x0002,
+ 0x78c2, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0047, 0x2091,
+ 0x8001, 0x007c, 0x78c0, 0xa084, 0xfffd, 0x78c2, 0xa084, 0x0001,
+ 0x00c0, 0x162c, 0x1078, 0x197e, 0x71c4, 0x71c6, 0x794a, 0x007c,
+ 0x1078, 0x1a04, 0x00c0, 0x1286, 0x75d8, 0x74dc, 0x75da, 0x74de,
+ 0x0078, 0x163d, 0x2029, 0x0000, 0x2520, 0x71c4, 0x73c8, 0x72cc,
+ 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x3900, 0x1078, 0x188d, 0x0040,
+ 0x16e5, 0x20a9, 0x0005, 0x20a1, 0x3916, 0x41a1, 0x2009, 0x0040,
+ 0x1078, 0x1857, 0x0040, 0x1658, 0x1078, 0x1896, 0x0078, 0x16e5,
+ 0x6004, 0xa084, 0xff00, 0x8007, 0x8009, 0x0040, 0x16b9, 0x0c7e,
+ 0x2c68, 0x1078, 0x188d, 0x0040, 0x1688, 0x2c00, 0x689e, 0x8109,
+ 0x00c0, 0x1660, 0x609f, 0x0000, 0x0c7f, 0x0c7e, 0x7218, 0x731c,
+ 0x7420, 0x7524, 0x2c68, 0x689c, 0xa065, 0x0040, 0x16b8, 0x2009,
+ 0x0040, 0x1078, 0x1857, 0x00c0, 0x16a1, 0x6004, 0xa084, 0x00ff,
+ 0xa086, 0x0002, 0x00c0, 0x1688, 0x2d00, 0x6002, 0x0078, 0x166e,
+ 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x18f6, 0x0c7f, 0x609f,
+ 0x0000, 0x1078, 0x16e9, 0x2009, 0x001c, 0x6008, 0xa085, 0x0200,
+ 0x600a, 0x6004, 0x6086, 0x1078, 0x181d, 0x1078, 0x1896, 0x0078,
+ 0x16e5, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x18f6, 0x0c7f,
+ 0x609f, 0x0000, 0x1078, 0x16e9, 0x2009, 0x001c, 0x6087, 0x0103,
+ 0x601b, 0x0003, 0x1078, 0x181d, 0x1078, 0x1896, 0x0078, 0x16e5,
+ 0x0c7f, 0x74c4, 0x73c8, 0x72cc, 0x6014, 0x7817, 0x0012, 0x0e7e,
+ 0x2071, 0x3940, 0x70a3, 0x0005, 0x70a7, 0x0000, 0x73aa, 0x72ae,
+ 0x74b2, 0x70b6, 0x70bb, 0x0000, 0x2c00, 0x70be, 0x70c3, 0x0000,
+ 0xa02e, 0x2530, 0x611c, 0xa184, 0x0060, 0x0040, 0x16d9, 0x1078,
+ 0x330a, 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x669a, 0x60af, 0x0000,
+ 0x60b3, 0x0000, 0x1078, 0x1cf6, 0x007c, 0x70c3, 0x4005, 0x0078,
+ 0x1277, 0x20a9, 0x0005, 0x2099, 0x3916, 0x530a, 0x2100, 0xa210,
+ 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x007c, 0x71c4,
+ 0x70c7, 0x0000, 0x7906, 0x0078, 0x1274, 0x71c4, 0x71c6, 0x2168,
+ 0x0078, 0x1704, 0x2069, 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210,
+ 0x8d68, 0x8109, 0x00c0, 0x1706, 0xa285, 0x0000, 0x00c0, 0x1714,
+ 0x70c3, 0x4000, 0x0078, 0x1716, 0x70c3, 0x4003, 0x70ca, 0x0078,
+ 0x1277, 0x79d8, 0x0078, 0x1273, 0x71c4, 0x71c6, 0x2198, 0x20a1,
+ 0x0042, 0x20a9, 0x0004, 0x53a3, 0x21a0, 0x2099, 0x0042, 0x20a9,
+ 0x0004, 0x53a3, 0x0078, 0x1274, 0x70c4, 0x2068, 0x2079, 0x3900,
+ 0x1078, 0x188d, 0x0040, 0x17a4, 0x6007, 0x0001, 0x600b, 0x0000,
+ 0x602b, 0x0000, 0x601b, 0x0006, 0x6a10, 0xa28c, 0x0007, 0xa284,
+ 0x00f0, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x6016, 0xa284,
+ 0x0800, 0x0040, 0x174f, 0x601b, 0x000a, 0x0078, 0x1755, 0xa284,
+ 0x1000, 0x0040, 0x1755, 0x601b, 0x000c, 0xa284, 0x0300, 0x0040,
+ 0x175e, 0x602b, 0x0001, 0x8004, 0x8004, 0x8004, 0xa085, 0x0001,
+ 0x601e, 0x6023, 0x0000, 0x6027, 0x000a, 0xa284, 0x0400, 0x0040,
+ 0x176b, 0x602b, 0x0000, 0x20a9, 0x0006, 0xac80, 0x000b, 0x20a0,
+ 0xad80, 0x0005, 0x2098, 0x53a3, 0xa284, 0x0300, 0x00c0, 0x1780,
+ 0x6046, 0x604a, 0x604e, 0x6052, 0x6096, 0x609a, 0x0078, 0x178a,
+ 0x6800, 0x6046, 0x6804, 0x604a, 0x6e08, 0x664e, 0x6d0c, 0x6552,
+ 0x6596, 0x669a, 0x6014, 0x7817, 0x0042, 0x2c08, 0x2061, 0x3940,
+ 0x60a3, 0x0005, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x60af, 0x0000,
+ 0x60b3, 0x0000, 0x60b6, 0x61be, 0xa284, 0x0400, 0x60c2, 0x1078,
+ 0x32f5, 0x1078, 0x1cf6, 0x007c, 0x70c3, 0x4005, 0x0078, 0x1277,
+ 0x78f0, 0xa005, 0x0040, 0x1282, 0x2091, 0x8000, 0x70c4, 0x800a,
+ 0x2011, 0x0010, 0x810c, 0x0048, 0x17ba, 0x3a00, 0xa084, 0xfff7,
+ 0x0078, 0x17bd, 0x3a00, 0xa085, 0x0008, 0x20d0, 0x0005, 0x0005,
+ 0xa084, 0xfffb, 0x20d0, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005,
+ 0x0005, 0x0005, 0x0005, 0xa085, 0x0004, 0x20d0, 0x0005, 0x0005,
+ 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x8211, 0x00c0,
+ 0x17b2, 0x3a00, 0xa085, 0x0008, 0x20d0, 0x2091, 0x8001, 0x0078,
+ 0x1274, 0x2011, 0x04fd, 0x2204, 0xa082, 0x0004, 0x0048, 0x17f5,
+ 0x78f3, 0x0001, 0x2009, 0xff01, 0x200a, 0x2001, 0x000c, 0x20d8,
+ 0x2001, 0x000c, 0x20d0, 0x0078, 0x1274, 0x2001, 0x4005, 0x0078,
+ 0x1276, 0x7978, 0x71c6, 0x71c4, 0xa182, 0x0003, 0x00c8, 0x126c,
+ 0x797a, 0x0078, 0x1274, 0x7978, 0x71c6, 0x0078, 0x1274, 0x796c,
+ 0x71c6, 0x71c4, 0x796e, 0x7970, 0x71ca, 0x71c8, 0x7972, 0x7974,
+ 0x71ce, 0x71cc, 0x7976, 0x0078, 0x1274, 0x796c, 0x71c6, 0x7970,
+ 0x71ca, 0x7974, 0x71ce, 0x0078, 0x1274, 0x700c, 0xa084, 0x00ff,
+ 0x0040, 0x1829, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0,
+ 0x1824, 0x7017, 0x0000, 0x7112, 0x721a, 0x731e, 0x7422, 0x7526,
+ 0xac80, 0x0001, 0x8108, 0x810c, 0x81a9, 0x8098, 0x20a1, 0x0030,
+ 0x6084, 0x20a2, 0x53a6, 0x780c, 0xa085, 0x0000, 0x7002, 0x7007,
+ 0x0001, 0x2009, 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0, 0x1841,
+ 0x7108, 0x8103, 0x00c8, 0x1841, 0x7014, 0xa005, 0x0040, 0x1841,
+ 0x7007, 0x0002, 0xa184, 0x0060, 0x7003, 0x0000, 0x007c, 0x700c,
+ 0xa084, 0x00ff, 0x0040, 0x1863, 0x7007, 0x0004, 0x7004, 0xa084,
+ 0x0004, 0x00c0, 0x185e, 0x7017, 0x0000, 0x7112, 0x721a, 0x7422,
+ 0x7526, 0x731e, 0x2099, 0x0030, 0x8108, 0x81ac, 0x780c, 0xa085,
+ 0x0001, 0x7002, 0x7007, 0x0001, 0x2009, 0x0022, 0x2104, 0xa084,
+ 0x4000, 0x00c0, 0x1874, 0x7008, 0x800b, 0x00c8, 0x1874, 0x7007,
+ 0x0002, 0xa08c, 0x0060, 0x00c0, 0x188a, 0xac80, 0x0001, 0x20a0,
+ 0x53a5, 0xa006, 0x7003, 0x0000, 0x007c, 0x7850, 0xa065, 0x0040,
+ 0x1895, 0x2c04, 0x7852, 0x2063, 0x0000, 0x007c, 0x0f7e, 0x2079,
+ 0x3900, 0x7850, 0x2062, 0x2c00, 0xa005, 0x00c0, 0x18a1, 0x1078,
+ 0x1eac, 0x7852, 0x0f7f, 0x007c, 0x2011, 0x4400, 0x7a52, 0x7be4,
+ 0x8319, 0x0040, 0x18b1, 0xa280, 0x002f, 0x2012, 0x2010, 0x0078,
+ 0x18a8, 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784,
+ 0x0007, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e8, 0x3a80,
+ 0x007c, 0x1078, 0x18b4, 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808,
+ 0xa084, 0xffef, 0xa80d, 0x690a, 0x2091, 0x8000, 0x2009, 0x394f,
+ 0x210c, 0x6804, 0xa005, 0x0040, 0x18de, 0xa116, 0x00c0, 0x18de,
+ 0x2060, 0x6000, 0x6806, 0x017e, 0x0078, 0x18e1, 0x2009, 0x0000,
+ 0x017e, 0x6804, 0xa065, 0x0040, 0x18f0, 0x6000, 0x6806, 0x1078,
+ 0x1903, 0x1078, 0x1a14, 0x6810, 0x8001, 0x6812, 0x00c0, 0x18e1,
+ 0x017f, 0x6902, 0x6906, 0x2091, 0x8001, 0x007c, 0xa065, 0x0040,
+ 0x1902, 0x609c, 0x609f, 0x0000, 0x2008, 0x1078, 0x1896, 0x2100,
+ 0x0078, 0x18f6, 0x007c, 0x6007, 0x0103, 0x20a9, 0x001c, 0xac80,
+ 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a, 0x682c,
+ 0x6022, 0x007c, 0x0e7e, 0x2071, 0x3940, 0x7040, 0xa08c, 0x0080,
+ 0x00c0, 0x1920, 0xa088, 0x3980, 0x2d0a, 0x8000, 0x7042, 0xa006,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x3940, 0x2009, 0x3980, 0x7240,
+ 0x8221, 0x8211, 0x0048, 0x193a, 0x2104, 0x8108, 0xad06, 0x00c0,
+ 0x1929, 0x8119, 0x211e, 0x8108, 0x8318, 0x8211, 0x00c8, 0x1932,
+ 0x7442, 0xa006, 0x0e7f, 0x007c, 0x1078, 0x18b4, 0x2091, 0x8000,
+ 0x6804, 0x781e, 0xa065, 0x0040, 0x197d, 0x0078, 0x194d, 0x2c00,
+ 0x781e, 0x6000, 0xa065, 0x0040, 0x197d, 0x6010, 0xa306, 0x00c0,
+ 0x1947, 0x600c, 0xa206, 0x00c0, 0x1947, 0x2c28, 0x6804, 0xac06,
+ 0x00c0, 0x1964, 0x6000, 0x2060, 0x6806, 0xa005, 0x00c0, 0x1964,
+ 0x6803, 0x0000, 0x0078, 0x196e, 0x6400, 0x781c, 0x2060, 0x6402,
+ 0xa486, 0x0000, 0x00c0, 0x196e, 0x2c00, 0x6802, 0x2560, 0x1078,
+ 0x1903, 0x601b, 0x0005, 0x6023, 0x0020, 0x1078, 0x1a14, 0x6810,
+ 0x8001, 0x6812, 0x2001, 0xffff, 0xa005, 0x007c, 0x2039, 0x0000,
+ 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x1078, 0x18c1,
+ 0x8738, 0xa784, 0x0007, 0x00c0, 0x1986, 0xa7bc, 0xff00, 0x873f,
+ 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1986, 0x007c, 0x2061,
+ 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x19a8, 0x2091, 0x8000,
+ 0x78d4, 0x78d7, 0x0000, 0x2091, 0x8001, 0xa005, 0x00c0, 0x19a9,
+ 0x007c, 0xa08c, 0xfff0, 0x0040, 0x19af, 0x1078, 0x1eac, 0x0079,
+ 0x19b1, 0x19c1, 0x19c3, 0x19c9, 0x19cd, 0x19c1, 0x19d1, 0x19c1,
+ 0x19d8, 0x19dc, 0x19e0, 0x1a0a, 0x1a0e, 0x19c1, 0x19c1, 0x19c1,
+ 0x19c1, 0x1078, 0x1eac, 0x1078, 0x197e, 0x2001, 0x8001, 0x0078,
+ 0x1276, 0x2001, 0x8003, 0x0078, 0x1276, 0x2001, 0x8004, 0x0078,
+ 0x1276, 0x1078, 0x197e, 0x2001, 0x8006, 0x007c, 0x0078, 0x1276,
+ 0x2001, 0x8008, 0x0078, 0x1276, 0x2001, 0x8009, 0x0078, 0x1276,
+ 0x2091, 0x8000, 0x2069, 0x3940, 0x6800, 0xa086, 0x0000, 0x0040,
+ 0x19ee, 0x2091, 0x8001, 0x78d7, 0x0009, 0x007c, 0x68b4, 0xa0bc,
+ 0xff00, 0x2091, 0x8000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051,
+ 0x0010, 0x1078, 0x18c1, 0x8738, 0xa784, 0x0007, 0x00c0, 0x19f9,
+ 0x2001, 0x800a, 0x0078, 0x1276, 0x2001, 0x04fd, 0x2004, 0xa086,
+ 0x0004, 0x007c, 0x2001, 0x800c, 0x0078, 0x1276, 0x1078, 0x197e,
+ 0x2001, 0x800d, 0x0078, 0x1276, 0x6004, 0x6086, 0x2c08, 0x2063,
+ 0x0000, 0x787c, 0x8000, 0x787e, 0x7880, 0xa005, 0x7982, 0x0040,
+ 0x1a24, 0x2c02, 0x0078, 0x1a25, 0x7986, 0x007c, 0x0c7e, 0x2061,
+ 0x3900, 0x6887, 0x0103, 0x2d08, 0x206b, 0x0000, 0x607c, 0x8000,
+ 0x607e, 0x6080, 0xa005, 0x6182, 0x0040, 0x1a39, 0x2d02, 0x0078,
+ 0x1a3a, 0x6186, 0x0c7f, 0x007c, 0x1078, 0x1a4d, 0x0040, 0x1a4c,
+ 0x0c7e, 0x609c, 0xa065, 0x0040, 0x1a47, 0x1078, 0x18f6, 0x0c7f,
+ 0x609f, 0x0000, 0x1078, 0x1896, 0x007c, 0x7884, 0xa065, 0x0040,
+ 0x1a5f, 0x2091, 0x8000, 0x787c, 0x8001, 0x787e, 0x2c04, 0x7886,
+ 0xa005, 0x00c0, 0x1a5d, 0x7882, 0x8000, 0x2091, 0x8001, 0x007c,
+ 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, 0x00c8, 0x1a69,
+ 0xa200, 0x0070, 0x1a6d, 0x0078, 0x1a64, 0x8086, 0x818e, 0x007c,
+ 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x1a93, 0xa11a, 0x00c8,
+ 0x1a93, 0x8213, 0x818d, 0x0048, 0x1a84, 0xa11a, 0x00c8, 0x1a85,
+ 0x0070, 0x1a8b, 0x0078, 0x1a79, 0xa11a, 0x2308, 0x8210, 0x0070,
+ 0x1a8b, 0x0078, 0x1a79, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080,
+ 0x007f, 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078,
+ 0x1a8f, 0x798c, 0x70d0, 0x007e, 0x007f, 0xa106, 0x0040, 0x1ae9,
+ 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x1ae9,
+ 0x7008, 0x7208, 0xa206, 0x00c0, 0x1ae9, 0xa286, 0x0008, 0x00c0,
+ 0x1ae9, 0x2071, 0x0010, 0x1078, 0x188d, 0x0040, 0x1ae9, 0x7a94,
+ 0x7b90, 0x7c9c, 0x7d98, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399,
+ 0x0000, 0x2009, 0x0040, 0x1078, 0x1857, 0x2091, 0x8001, 0x0040,
+ 0x1ae0, 0x1078, 0x1896, 0x78a0, 0x8000, 0x78a2, 0xa086, 0x0002,
+ 0x00c0, 0x1ae9, 0x2091, 0x8000, 0x78d7, 0x0002, 0x78a3, 0x0000,
+ 0x78c0, 0xa085, 0x0003, 0x78c2, 0x2091, 0x8001, 0x0078, 0x1ae9,
+ 0x78a3, 0x0000, 0x1078, 0x1c38, 0x6004, 0xa084, 0x000f, 0x0079,
+ 0x1aee, 0x2071, 0x0010, 0x2091, 0x8001, 0x007c, 0x1afe, 0x1b20,
+ 0x1b46, 0x1afe, 0x1b58, 0x1b0d, 0x1afe, 0x1afe, 0x1afe, 0x1b1a,
+ 0x1b40, 0x1afe, 0x1afe, 0x1afe, 0x1afe, 0x1afe, 0x2039, 0x0400,
+ 0x78d0, 0xa705, 0x78d2, 0x6008, 0xa705, 0x600a, 0x1078, 0x1b96,
+ 0x609c, 0x78ce, 0x1078, 0x1c20, 0x007c, 0x78d0, 0xa084, 0x0100,
+ 0x0040, 0x1b14, 0x0078, 0x1afe, 0x601c, 0xa085, 0x0080, 0x601e,
+ 0x0078, 0x1b27, 0x1078, 0x1a04, 0x00c0, 0x1afe, 0x1078, 0x1c52,
+ 0x78d0, 0xa084, 0x0100, 0x0040, 0x1b27, 0x0078, 0x1afe, 0x78d3,
+ 0x0000, 0x6004, 0x8007, 0xa084, 0x00ff, 0x78c6, 0x8001, 0x609f,
+ 0x0000, 0x0040, 0x1b3d, 0x1078, 0x1b96, 0x0040, 0x1b3d, 0x78d0,
+ 0xa085, 0x0100, 0x78d2, 0x0078, 0x1b3f, 0x1078, 0x1bba, 0x007c,
+ 0x1078, 0x1a04, 0x00c0, 0x1afe, 0x1078, 0x1c4e, 0x78d0, 0xa08c,
+ 0x0e00, 0x00c0, 0x1b4f, 0xa084, 0x0100, 0x00c0, 0x1b51, 0x0078,
+ 0x1afe, 0x1078, 0x1b96, 0x00c0, 0x1b57, 0x1078, 0x1bba, 0x007c,
+ 0x78d0, 0xa084, 0x0100, 0x0040, 0x1b5f, 0x0078, 0x1afe, 0x78d3,
+ 0x0000, 0x6714, 0x20a9, 0x0001, 0x6018, 0xa005, 0x0040, 0x1b7a,
+ 0xa7bc, 0xff00, 0x20a9, 0x0008, 0xa08e, 0x0001, 0x0040, 0x1b7a,
+ 0x2039, 0x0000, 0x20a9, 0x0080, 0xa08e, 0x0002, 0x0040, 0x1b7a,
+ 0x0078, 0x1b93, 0x1078, 0x18b4, 0x2d00, 0xa088, 0x0002, 0x2091,
+ 0x8000, 0x2168, 0x682b, 0x0000, 0x682f, 0x0000, 0x2104, 0xa084,
+ 0xffde, 0x200a, 0x2100, 0xa088, 0x0010, 0x2091, 0x8001, 0x0070,
+ 0x1b93, 0x0078, 0x1b7f, 0x1078, 0x1896, 0x007c, 0x78c8, 0xa06d,
+ 0x00c0, 0x1ba1, 0x2c00, 0x78ca, 0x78ce, 0x609f, 0x0000, 0x0078,
+ 0x1bad, 0x2c00, 0x689e, 0x609f, 0x0000, 0x78ca, 0x2d00, 0x6002,
+ 0x78cc, 0xad06, 0x00c0, 0x1bad, 0x6002, 0x78c4, 0x8001, 0x78c6,
+ 0x00c0, 0x1bb9, 0x78d0, 0xa084, 0x0000, 0x78d2, 0x78cc, 0x2060,
+ 0xa006, 0x007c, 0xa02e, 0x2530, 0x611c, 0x61a2, 0xa184, 0xc1ff,
+ 0x601e, 0xa184, 0x0060, 0x0040, 0x1bc9, 0x0e7e, 0x1078, 0x330a,
+ 0x0e7f, 0x6596, 0x669a, 0x6714, 0x1078, 0x18b4, 0x2091, 0x8000,
+ 0x6808, 0xa084, 0x0001, 0x0040, 0x1be5, 0x2091, 0x8001, 0x1078,
+ 0x1903, 0x2091, 0x8000, 0x1078, 0x1a14, 0x2091, 0x8001, 0x78cb,
+ 0x0000, 0x78cf, 0x0000, 0x0078, 0x1c1f, 0x6024, 0xa096, 0x0001,
+ 0x00c0, 0x1bec, 0x8000, 0x6026, 0x6a10, 0x6814, 0x2091, 0x8001,
+ 0xa202, 0x0048, 0x1bfb, 0x0040, 0x1bfb, 0x2039, 0x0200, 0x1078,
+ 0x1c20, 0x0078, 0x1c1f, 0x2c08, 0x2091, 0x8000, 0x6800, 0xa065,
+ 0x0040, 0x1c03, 0x6102, 0x6902, 0x00c0, 0x1c07, 0x6906, 0x2160,
+ 0x6003, 0x0000, 0x6810, 0x8000, 0x6812, 0x2091, 0x8001, 0x6808,
+ 0xa08c, 0x0040, 0x0040, 0x1c19, 0xa086, 0x0040, 0x680a, 0x1078,
+ 0x1912, 0x1078, 0x1cf6, 0x78cf, 0x0000, 0x78cb, 0x0000, 0x007c,
+ 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x1078, 0x1a14, 0x2091,
+ 0x8001, 0x78cc, 0xa065, 0x0040, 0x1c33, 0x609c, 0x78ce, 0x609f,
+ 0x0000, 0x0078, 0x1c23, 0x78cb, 0x0000, 0x78cf, 0x0000, 0x007c,
+ 0x7988, 0x788c, 0x8000, 0xa10a, 0x00c8, 0x1c3f, 0xa006, 0x788e,
+ 0x70d2, 0x7804, 0xa005, 0x0040, 0x1c4d, 0x8001, 0x7806, 0x00c0,
+ 0x1c4d, 0x0068, 0x1c4d, 0x2091, 0x4080, 0x007c, 0x2039, 0x1c66,
+ 0x0078, 0x1c54, 0x2039, 0x1c6c, 0x2704, 0xa005, 0x0040, 0x1c65,
+ 0xac00, 0x2068, 0x6b08, 0x6c0c, 0x6910, 0x6a14, 0x690a, 0x6a0e,
+ 0x6b12, 0x6c16, 0x8738, 0x0078, 0x1c54, 0x007c, 0x0003, 0x0009,
+ 0x000f, 0x0015, 0x001b, 0x0000, 0x0015, 0x001b, 0x0000, 0x0068,
+ 0x1c87, 0x2029, 0x0000, 0x7884, 0xa065, 0x0040, 0x1c82, 0x1078,
+ 0x1c88, 0x0040, 0x1c82, 0x1078, 0x1c99, 0x00c0, 0x1c82, 0x8528,
+ 0x0078, 0x1c73, 0x85ff, 0x0040, 0x1c87, 0x2091, 0x4080, 0x007c,
+ 0x7ba4, 0x79a8, 0x70d4, 0x007e, 0x007f, 0xa102, 0x00c0, 0x1c93,
+ 0x2300, 0xa005, 0x007c, 0x0048, 0x1c97, 0xa302, 0x007c, 0x8002,
+ 0x007c, 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0,
+ 0x1cdd, 0x7008, 0x7208, 0xa206, 0x00c0, 0x1cdd, 0xa286, 0x0008,
+ 0x00c0, 0x1cdd, 0x2071, 0x0010, 0x1078, 0x1ce2, 0x2009, 0x001c,
+ 0x6028, 0xa005, 0x0040, 0x1cb6, 0x2009, 0x0040, 0x1078, 0x181d,
+ 0x0040, 0x1ccf, 0x78bc, 0x8000, 0x78be, 0xa086, 0x0002, 0x00c0,
+ 0x1cdd, 0x2091, 0x8000, 0x78d7, 0x0003, 0x78bf, 0x0000, 0x78c0,
+ 0xa085, 0x0300, 0x78c2, 0x2091, 0x8001, 0x0078, 0x1cdd, 0x78bf,
+ 0x0000, 0x1078, 0x1a3c, 0x79a4, 0x78a8, 0x8000, 0xa10a, 0x00c8,
+ 0x1cda, 0xa006, 0x78aa, 0x70d6, 0xa006, 0x2071, 0x0010, 0x2091,
+ 0x8001, 0x007c, 0x8107, 0x8004, 0x8004, 0x7ab0, 0x7bac, 0x7cb8,
+ 0x7db4, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000,
+ 0x007c, 0x2009, 0x3968, 0x2091, 0x8000, 0x200a, 0x0f7e, 0x2079,
+ 0x0100, 0x2009, 0x3940, 0x2091, 0x8000, 0x2104, 0xa086, 0x0000,
+ 0x00c0, 0x1d11, 0x2009, 0x3912, 0x2104, 0xa005, 0x00c0, 0x1d11,
+ 0x7830, 0xa084, 0x00c0, 0x00c0, 0x1d11, 0x0018, 0x1d11, 0x781b,
+ 0x0045, 0x2091, 0x8001, 0x0f7f, 0x007c, 0x127e, 0x2091, 0x2300,
+ 0x2071, 0x3940, 0x2079, 0x0100, 0x784b, 0x000f, 0x2019, 0x3205,
+ 0x20a1, 0x012b, 0x2304, 0xa005, 0x0040, 0x1d2f, 0x789a, 0x8318,
+ 0x23ac, 0x8318, 0x2398, 0x53a6, 0x3318, 0x0078, 0x1d22, 0x789b,
+ 0x0020, 0x20a9, 0x0010, 0x78af, 0x0000, 0x78af, 0x0020, 0x0070,
+ 0x1d3b, 0x0078, 0x1d33, 0x7003, 0x0000, 0x1078, 0x1e40, 0x7004,
+ 0xa084, 0x000f, 0xa085, 0x6280, 0x7806, 0x780f, 0x9200, 0x7843,
+ 0x00d8, 0x7853, 0x0080, 0x780b, 0x0008, 0x7047, 0x397f, 0x7043,
+ 0x0000, 0x127f, 0x2000, 0x007c, 0xa18c, 0x000f, 0x2011, 0x0101,
+ 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012, 0x1078, 0x1e40, 0x007c,
+ 0x2011, 0x0101, 0x20a9, 0x0009, 0x810b, 0x0070, 0x1d69, 0x0078,
+ 0x1d64, 0xa18c, 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012,
+ 0x007c, 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213, 0x0070, 0x1d7a,
+ 0x0078, 0x1d75, 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205,
+ 0x200a, 0x007c, 0x2011, 0x0101, 0x20a9, 0x000c, 0x810b, 0x0070,
+ 0x1d8b, 0x0078, 0x1d86, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff,
+ 0xa105, 0x2012, 0x007c, 0x2011, 0x0102, 0x2204, 0xa084, 0xffcf,
+ 0xa105, 0x2012, 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e,
+ 0x2061, 0x0100, 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x8103,
+ 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4,
+ 0xa084, 0xffdf, 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080,
+ 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0xa085, 0x0020,
+ 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e,
+ 0x2061, 0x0100, 0x609a, 0x60a4, 0x62ae, 0x2010, 0x60a4, 0x63ae,
+ 0x2018, 0x0c7f, 0x007c, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040,
+ 0x1e1c, 0x2061, 0x4380, 0x1078, 0x1e22, 0x0040, 0x1e06, 0x20a9,
+ 0x0000, 0x2061, 0x4280, 0x0c7e, 0x1078, 0x1e22, 0x0040, 0x1df0,
+ 0x0c7f, 0x8c60, 0x0070, 0x1dee, 0x0078, 0x1de3, 0x0078, 0x1e1c,
+ 0x007f, 0xa082, 0x4280, 0x2071, 0x3940, 0x70ba, 0x6020, 0xa085,
+ 0x0800, 0x6022, 0x2091, 0x8001, 0x71b6, 0x2001, 0x0004, 0x70a2,
+ 0x70c7, 0x000f, 0x1078, 0x1cf1, 0x0078, 0x1e18, 0x2071, 0x3940,
+ 0x6020, 0xa085, 0x0800, 0x6022, 0x2091, 0x8001, 0x71b6, 0x2c00,
+ 0x70be, 0x2001, 0x0006, 0x70a2, 0x70c7, 0x000f, 0x1078, 0x1cf1,
+ 0x2001, 0x0000, 0x0078, 0x1e1e, 0x2001, 0x0001, 0xa005, 0x0e7f,
+ 0x0c7f, 0x007c, 0x2091, 0x8000, 0x2c04, 0xa005, 0x0040, 0x1e3b,
+ 0x2060, 0x6010, 0xa306, 0x00c0, 0x1e38, 0x600c, 0xa206, 0x00c0,
+ 0x1e38, 0x6014, 0xa106, 0x00c0, 0x1e38, 0xa006, 0x0078, 0x1e3f,
+ 0x6000, 0x0078, 0x1e25, 0xa085, 0x0001, 0x2091, 0x8001, 0x007c,
+ 0x2011, 0x3941, 0x220c, 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204,
+ 0xa084, 0x0100, 0x0040, 0x1e56, 0x2021, 0xff04, 0x2122, 0x810b,
+ 0x810b, 0x810b, 0x810b, 0xa18d, 0x0f00, 0x2104, 0x007c, 0x0e7e,
+ 0x68e4, 0xa08c, 0x0020, 0x0040, 0x1eaa, 0xa084, 0x0006, 0x00c0,
+ 0x1eaa, 0x6014, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
+ 0xa0f0, 0x3a00, 0x7004, 0xa084, 0x000a, 0x00c0, 0x1eaa, 0x7108,
+ 0xa194, 0xff00, 0x0040, 0x1eaa, 0xa18c, 0x00ff, 0x2001, 0x000c,
+ 0xa106, 0x0040, 0x1e91, 0x2001, 0x0012, 0xa106, 0x0040, 0x1e95,
+ 0x2001, 0x0014, 0xa106, 0x0040, 0x1e99, 0x2001, 0x0019, 0xa106,
+ 0x0040, 0x1e9d, 0x2001, 0x0032, 0xa106, 0x0040, 0x1ea1, 0x0078,
+ 0x1ea5, 0x2009, 0x0012, 0x0078, 0x1ea7, 0x2009, 0x0014, 0x0078,
+ 0x1ea7, 0x2009, 0x0019, 0x0078, 0x1ea7, 0x2009, 0x0020, 0x0078,
+ 0x1ea7, 0x2009, 0x003f, 0x0078, 0x1ea7, 0x2011, 0x0000, 0x2100,
+ 0xa205, 0x700a, 0x0e7f, 0x007c, 0x2071, 0x0010, 0x70ca, 0x007f,
+ 0x70c6, 0x70c3, 0x8002, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091,
+ 0x4080, 0x0078, 0x1eb9, 0x107e, 0x007e, 0x127e, 0x2091, 0x2300,
+ 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x2009, 0x3974, 0x78a0, 0x200a,
+ 0x8108, 0x250a, 0x8108, 0x240a, 0x8108, 0x260a, 0x8108, 0x270a,
+ 0xa594, 0x003f, 0xa484, 0x4000, 0x0040, 0x1edc, 0xa784, 0x007c,
+ 0x00c0, 0x318f, 0x1078, 0x1eac, 0xa49c, 0x000f, 0xa382, 0x0004,
+ 0x0050, 0x1ee4, 0x1078, 0x1eac, 0x8507, 0xa084, 0x000f, 0x0079,
+ 0x1ee9, 0x236e, 0x240d, 0x242e, 0x2699, 0x28dd, 0x293b, 0x2984,
+ 0x29f0, 0x2a8d, 0x2b1a, 0x1f11, 0x1ef9, 0x21c3, 0x2288, 0x28bc,
+ 0x1ef9, 0x1078, 0x1eac, 0x0018, 0x1ec0, 0x127f, 0x2091, 0x8001,
+ 0x007f, 0x107f, 0x007c, 0x7003, 0x0000, 0x703f, 0x0000, 0x7030,
+ 0xa005, 0x0040, 0x1f0d, 0x7033, 0x0000, 0x1078, 0x316a, 0x0018,
+ 0x1ec0, 0x2009, 0x390f, 0x200b, 0x0000, 0x705c, 0xa005, 0x00c0,
+ 0x1fe2, 0x70a0, 0xa084, 0x0007, 0x0079, 0x1f1e, 0x2005, 0x1f26,
+ 0x1f34, 0x1f51, 0x1f73, 0x1fc0, 0x1f99, 0x1f26, 0x7808, 0xa084,
+ 0xfffd, 0x780a, 0x2009, 0x0047, 0x1078, 0x27c1, 0x00c0, 0x1f32,
+ 0x7003, 0x0004, 0x0078, 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1f4f,
+ 0x70b4, 0x8007, 0x7882, 0x789b, 0x0010, 0x78ab, 0x000c, 0x789b,
+ 0x0060, 0x78ab, 0x0001, 0x785b, 0x0004, 0x2009, 0x00fb, 0x1078,
+ 0x27bf, 0x00c0, 0x1f4f, 0x7003, 0x0004, 0x70c7, 0x000f, 0x0078,
+ 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1f71, 0x71b4, 0x8107, 0x7882,
+ 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab,
+ 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b, 0x0004, 0x2009,
+ 0x00fb, 0x1078, 0x27bf, 0x00c0, 0x1f71, 0x7003, 0x0004, 0x70c7,
+ 0x000f, 0x0078, 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1f97, 0x71b4,
+ 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0,
+ 0x79aa, 0x78ab, 0x0020, 0x71b8, 0x79aa, 0x78ab, 0x000d, 0x789b,
+ 0x0060, 0x78ab, 0x0004, 0x785b, 0x0004, 0x2009, 0x00fb, 0x1078,
+ 0x27bf, 0x00c0, 0x1f97, 0x7003, 0x0004, 0x70c7, 0x000f, 0x0078,
+ 0x1efb, 0x1078, 0x3151, 0x00c0, 0x1fbe, 0x71b4, 0x8107, 0x7882,
+ 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab,
+ 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b, 0x0004, 0x2009,
+ 0x00fb, 0x1078, 0x27bf, 0x00c0, 0x1fbe, 0x70bc, 0x70bf, 0x0000,
+ 0x2068, 0x703e, 0x7003, 0x0002, 0x70c7, 0x000f, 0x0078, 0x1efb,
+ 0x1078, 0x3151, 0x00c0, 0x1efb, 0x70bc, 0x2068, 0x1078, 0x31f3,
+ 0x789b, 0x0010, 0x6814, 0xa084, 0x0007, 0xa085, 0x0080, 0x007e,
+ 0x007f, 0x78aa, 0x6e1c, 0x067e, 0x067f, 0x2041, 0x0001, 0x70c0,
+ 0xa084, 0x0400, 0x2001, 0x0004, 0x0040, 0x1fe0, 0x2001, 0x0006,
+ 0x0078, 0x20e1, 0x1078, 0x3151, 0x00c0, 0x1efb, 0x789b, 0x0010,
+ 0x705c, 0x2068, 0x1078, 0x31f3, 0x6f14, 0x1078, 0x3099, 0x6008,
+ 0xa085, 0x0010, 0x600a, 0xad80, 0x0009, 0x2003, 0x0005, 0x6814,
+ 0xa084, 0x0007, 0xa085, 0x0080, 0x78aa, 0x2031, 0x0020, 0x2041,
+ 0x0001, 0x2001, 0x0003, 0x0078, 0x20e1, 0x0018, 0x1ec0, 0x7440,
+ 0xa485, 0x0000, 0x0040, 0x201f, 0xa080, 0x3980, 0x2030, 0x7144,
+ 0x8108, 0xa12a, 0x0048, 0x2016, 0x2009, 0x3980, 0x2164, 0x6504,
+ 0x85ff, 0x00c0, 0x202c, 0x8421, 0x00c0, 0x2010, 0x7146, 0x7003,
+ 0x0000, 0x703f, 0x0000, 0x0078, 0x1efb, 0x7640, 0xa6b0, 0x3980,
+ 0x7144, 0x2600, 0x0078, 0x201b, 0x7146, 0x2568, 0x2558, 0x753e,
+ 0x2c50, 0x6708, 0x7736, 0xa784, 0x013f, 0x0040, 0x2059, 0xa784,
+ 0x0021, 0x00c0, 0x2029, 0xa784, 0x0002, 0x0040, 0x2046, 0xa784,
+ 0x0004, 0x0040, 0x2029, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0008,
+ 0x00c0, 0x2029, 0xa784, 0x0010, 0x00c0, 0x2029, 0xa784, 0x0100,
+ 0x0040, 0x2059, 0x6018, 0xa005, 0x00c0, 0x2029, 0xa7bc, 0xfeff,
+ 0x670a, 0x6823, 0x0000, 0x6e1c, 0xa684, 0x000e, 0x6118, 0x0040,
+ 0x2069, 0x601c, 0xa102, 0x0048, 0x206c, 0x0040, 0x206c, 0x0078,
+ 0x2025, 0x81ff, 0x00c0, 0x2025, 0xa784, 0x0080, 0x00c0, 0x2072,
+ 0x700c, 0x6022, 0x1078, 0x31f3, 0x0018, 0x1ec0, 0x789b, 0x0010,
+ 0xa046, 0x1078, 0x3151, 0x00c0, 0x1efb, 0x6b14, 0xa39c, 0x0007,
+ 0xa39d, 0x00c0, 0x704c, 0xa084, 0x8000, 0x0040, 0x208b, 0xa684,
+ 0x0001, 0x0040, 0x208d, 0xa39c, 0xffbf, 0xa684, 0x0010, 0x0040,
+ 0x2093, 0xa39d, 0x0020, 0x7baa, 0x8840, 0xa684, 0x000e, 0x00c0,
+ 0x209e, 0xa7bd, 0x0010, 0x670a, 0x0078, 0x20df, 0x714c, 0xa18c,
+ 0x0800, 0x0040, 0x2cfc, 0x2011, 0x0021, 0x8004, 0x8004, 0x0048,
+ 0x20b5, 0x2011, 0x0022, 0x8004, 0x0048, 0x20b5, 0x2011, 0x0020,
+ 0x8004, 0x0048, 0x20b5, 0x0040, 0x20df, 0x7aaa, 0x8840, 0x1078,
+ 0x316a, 0x6a14, 0x610c, 0x8108, 0xa18c, 0x00ff, 0xa1e0, 0x4280,
+ 0x2c64, 0x8cff, 0x0040, 0x20d6, 0x6014, 0xa206, 0x00c0, 0x20c0,
+ 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x20bb, 0x0c7e, 0x2a60, 0x6008,
+ 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078, 0x2005, 0x1078, 0x3151,
+ 0x00c0, 0x1efb, 0x2a60, 0x610e, 0x79aa, 0x8840, 0x712e, 0x2001,
+ 0x0001, 0x007e, 0x7150, 0xa184, 0x0018, 0x0040, 0x20fc, 0xa184,
+ 0x0010, 0x0040, 0x20ef, 0x1078, 0x2ee3, 0x00c0, 0x211f, 0xa184,
+ 0x0008, 0x0040, 0x20fc, 0x69a0, 0xa184, 0x0600, 0x00c0, 0x20fc,
+ 0x1078, 0x2ddf, 0x0078, 0x211f, 0x69a0, 0xa184, 0x0800, 0x0040,
+ 0x2113, 0x0c7e, 0x027e, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002,
+ 0x6104, 0xa18d, 0x0010, 0x6106, 0x027f, 0x0c7f, 0x1078, 0x2ee3,
+ 0x00c0, 0x211f, 0x69a0, 0xa184, 0x0200, 0x0040, 0x211b, 0x1078,
+ 0x2e2e, 0x0078, 0x211f, 0xa184, 0x0400, 0x00c0, 0x20f8, 0x69a0,
+ 0xa184, 0x1000, 0x0040, 0x212a, 0x6914, 0xa18c, 0xff00, 0x810f,
+ 0x1078, 0x1da7, 0x007f, 0x7002, 0xa68c, 0x00e0, 0xa684, 0x0060,
+ 0x0040, 0x2138, 0xa086, 0x0060, 0x00c0, 0x2138, 0xa18d, 0x4000,
+ 0x88ff, 0x0040, 0x213d, 0xa18d, 0x0004, 0x795a, 0x69b6, 0x789b,
+ 0x0060, 0x2800, 0x78aa, 0x789b, 0x0061, 0x6818, 0xa08d, 0x8000,
+ 0xa084, 0x7fff, 0x691a, 0xa68c, 0x0080, 0x0040, 0x215c, 0x70cb,
+ 0x0000, 0xa08a, 0x000d, 0x0050, 0x215a, 0xa08a, 0x000c, 0x71ca,
+ 0x2001, 0x000c, 0x800c, 0x71ce, 0x78aa, 0x8008, 0x810c, 0x0040,
+ 0x2d07, 0xa18c, 0x00f8, 0x00c0, 0x2d07, 0x157e, 0x137e, 0x147e,
+ 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b,
+ 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6814, 0x8007, 0x7882,
+ 0x6d94, 0x7dd6, 0x7dde, 0x6e98, 0x7ed2, 0x7eda, 0x7830, 0xa084,
+ 0x00c0, 0x00c0, 0x2185, 0x0098, 0x218d, 0x6008, 0xa084, 0xffef,
+ 0x600a, 0x1078, 0x316a, 0x0078, 0x1f03, 0x7200, 0xa284, 0x0007,
+ 0xa086, 0x0001, 0x00c0, 0x219a, 0x781b, 0x004a, 0x1078, 0x316a,
+ 0x0078, 0x21ab, 0x6ab4, 0xa295, 0x2000, 0x7a5a, 0x781b, 0x004a,
+ 0x1078, 0x316a, 0x7200, 0x2500, 0xa605, 0x0040, 0x21ab, 0xa284,
+ 0x0007, 0x1079, 0x21b9, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0,
+ 0x1efb, 0x6018, 0x8000, 0x601a, 0xad80, 0x0009, 0x7032, 0x0078,
+ 0x1efb, 0x21c1, 0x3571, 0x3571, 0x3560, 0x3571, 0x21c1, 0x3560,
+ 0x21c1, 0x1078, 0x1eac, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0f7e,
+ 0x2079, 0x3900, 0x78c0, 0x0f7f, 0xa084, 0x0001, 0x0040, 0x21e9,
+ 0x70a0, 0xa086, 0x0001, 0x00c0, 0x21d8, 0x70a2, 0x0078, 0x226c,
+ 0x70a0, 0xa086, 0x0005, 0x00c0, 0x21e7, 0x70bc, 0x2068, 0x681b,
+ 0x0004, 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x70a3,
+ 0x0000, 0x157e, 0x2011, 0x0004, 0x71a0, 0xa186, 0x0001, 0x0040,
+ 0x2207, 0xa186, 0x0007, 0x00c0, 0x21fb, 0x2009, 0x3935, 0x200b,
+ 0x0005, 0x0078, 0x2207, 0x2009, 0x3913, 0x2104, 0x2009, 0x3912,
+ 0x200a, 0x2009, 0x3935, 0x200b, 0x0001, 0x0078, 0x2209, 0x70a3,
+ 0x0000, 0x1078, 0x32f5, 0x20a9, 0x0010, 0x2039, 0x0000, 0x1078,
+ 0x2f9a, 0xa7b8, 0x0100, 0x0070, 0x2217, 0x0078, 0x220f, 0x7000,
+ 0x0079, 0x221a, 0x2248, 0x2231, 0x2231, 0x2224, 0x2248, 0x2248,
+ 0x2248, 0x2222, 0x1078, 0x1eac, 0x2021, 0x3957, 0x2404, 0xa005,
+ 0x0040, 0x2248, 0xad06, 0x00c0, 0x2231, 0x6800, 0x2022, 0x0078,
+ 0x2241, 0x6820, 0xa084, 0x0001, 0x00c0, 0x223d, 0x6f14, 0x1078,
+ 0x3099, 0x1078, 0x2cc9, 0x0078, 0x2241, 0x7054, 0x2060, 0x6800,
+ 0x6002, 0x6a1a, 0x6820, 0xa085, 0x0008, 0x6822, 0x1078, 0x1a26,
+ 0x2021, 0x4380, 0x1078, 0x2272, 0x2021, 0x3957, 0x1078, 0x2272,
+ 0x20a9, 0x0000, 0x2021, 0x4280, 0x1078, 0x2272, 0x8420, 0x0070,
+ 0x225b, 0x0078, 0x2254, 0x20a9, 0x0080, 0x2061, 0x3a80, 0x6018,
+ 0x6110, 0xa102, 0x6012, 0x601b, 0x0000, 0xace0, 0x0010, 0x0070,
+ 0x226b, 0x0078, 0x225f, 0x157f, 0x7003, 0x0000, 0x703f, 0x0000,
+ 0x0078, 0x1efb, 0x047e, 0x2404, 0xa005, 0x0040, 0x2284, 0x2068,
+ 0x6800, 0x007e, 0x6a1a, 0x6820, 0xa085, 0x0008, 0x6822, 0x1078,
+ 0x1a26, 0x007f, 0x0078, 0x2274, 0x047f, 0x2023, 0x0000, 0x007c,
+ 0xa282, 0x0003, 0x0050, 0x228e, 0x1078, 0x1eac, 0x2300, 0x0079,
+ 0x2291, 0x2294, 0x2311, 0x232e, 0xa282, 0x0002, 0x0040, 0x229a,
+ 0x1078, 0x1eac, 0x70a0, 0x70a3, 0x0000, 0x70c7, 0x0000, 0x0079,
+ 0x22a1, 0x22a9, 0x22a9, 0x22ab, 0x22e9, 0x2d0d, 0x22a9, 0x22e9,
+ 0x22a9, 0x1078, 0x1eac, 0x77b4, 0x1078, 0x2f9a, 0x77b4, 0xa7bc,
+ 0x0f00, 0x1078, 0x3099, 0x6018, 0xa005, 0x0040, 0x22e0, 0x2021,
+ 0x4380, 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x2349, 0x0040,
+ 0x22e0, 0x157e, 0x20a9, 0x0000, 0x2021, 0x4280, 0x047e, 0x2009,
+ 0x0004, 0x2011, 0x0010, 0x1078, 0x2349, 0x047f, 0x0040, 0x22d5,
+ 0x8420, 0x0070, 0x22d5, 0x0078, 0x22c6, 0x157f, 0x2021, 0x3957,
+ 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x2349, 0x0040, 0x22e0,
+ 0x8738, 0xa784, 0x0007, 0x00c0, 0x22b1, 0x0078, 0x1f03, 0x0078,
+ 0x1f03, 0x77b4, 0x1078, 0x3099, 0x6018, 0xa005, 0x0040, 0x230f,
+ 0x2021, 0x4380, 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x2349,
+ 0x0040, 0x230f, 0x157e, 0x20a9, 0x0000, 0x2021, 0x4280, 0x047e,
+ 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x2349, 0x047f, 0x0040,
+ 0x230e, 0x8420, 0x0070, 0x230e, 0x0078, 0x22ff, 0x157f, 0x0078,
+ 0x1f03, 0x2200, 0x0079, 0x2314, 0x2317, 0x2319, 0x2319, 0x1078,
+ 0x1eac, 0x2009, 0x0012, 0x70a0, 0xa086, 0x0002, 0x0040, 0x2322,
+ 0x2009, 0x000e, 0x6818, 0xa084, 0x8000, 0x0040, 0x2328, 0x691a,
+ 0x70a3, 0x0000, 0x70a7, 0x0001, 0x0078, 0x311c, 0x2200, 0x0079,
+ 0x2331, 0x2336, 0x2319, 0x2334, 0x1078, 0x1eac, 0x1078, 0x27ce,
+ 0x7000, 0xa086, 0x0001, 0x00c0, 0x2c9f, 0x1078, 0x2cdf, 0x6008,
+ 0xa084, 0xffef, 0x600a, 0x1078, 0x2c92, 0x0040, 0x2c9f, 0x0078,
+ 0x2005, 0x2404, 0xa005, 0x0040, 0x236a, 0x2068, 0x2d04, 0x007e,
+ 0x6814, 0xa706, 0x0040, 0x2358, 0x2d20, 0x007f, 0x0078, 0x234a,
+ 0x007f, 0x2022, 0x691a, 0x6820, 0xa205, 0x6822, 0x1078, 0x1a26,
+ 0x6010, 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078,
+ 0x2cdf, 0x007c, 0xa085, 0x0001, 0x0078, 0x2369, 0x2300, 0x0079,
+ 0x2371, 0x2376, 0x2374, 0x23c2, 0x1078, 0x1eac, 0x78e4, 0xa005,
+ 0x00d0, 0x238a, 0x0018, 0x238a, 0xa084, 0x0007, 0x0079, 0x2380,
+ 0x239b, 0x23a8, 0x238e, 0x2388, 0x3144, 0x3144, 0x2388, 0x23b5,
+ 0x1078, 0x1eac, 0x2001, 0x0003, 0x0078, 0x26ad, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x2395, 0x681b, 0x001d, 0x1078, 0x2f7d, 0x781b,
+ 0x0053, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000, 0x0040, 0x23a2,
+ 0x681b, 0x001d, 0x1078, 0x2f7d, 0x781b, 0x00de, 0x0078, 0x1efb,
+ 0x6818, 0xa084, 0x8000, 0x0040, 0x23af, 0x681b, 0x001d, 0x1078,
+ 0x2f7d, 0x781b, 0x00e5, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000,
+ 0x0040, 0x23bc, 0x681b, 0x001d, 0x1078, 0x2f7d, 0x781b, 0x009c,
+ 0x0078, 0x1efb, 0xa584, 0x000f, 0x00c0, 0x23e1, 0x1078, 0x27ce,
+ 0x7000, 0x0079, 0x23cb, 0x23d3, 0x23d5, 0x23d3, 0x2c9f, 0x2c9f,
+ 0x2c9f, 0x2c9f, 0x23d3, 0x1078, 0x1eac, 0x1078, 0x2cdf, 0x6008,
+ 0xa084, 0xffef, 0x600a, 0x1078, 0x2c92, 0x0040, 0x2c9f, 0x0078,
+ 0x2005, 0x79e4, 0xa005, 0x00d0, 0x238a, 0x0018, 0x238a, 0xa184,
+ 0x0007, 0x0079, 0x23eb, 0x23fb, 0x2401, 0x23f5, 0x23f3, 0x3144,
+ 0x3144, 0x23f3, 0x313c, 0x1078, 0x1eac, 0x1078, 0x2f85, 0x781b,
+ 0x0053, 0x0078, 0x1efb, 0x1078, 0x2f85, 0x781b, 0x00de, 0x0078,
+ 0x1efb, 0x1078, 0x2f85, 0x781b, 0x00e5, 0x0078, 0x1efb, 0x1078,
+ 0x2f85, 0x781b, 0x009c, 0x0078, 0x1efb, 0x2300, 0x0079, 0x2410,
+ 0x2415, 0x2413, 0x2417, 0x1078, 0x1eac, 0x0078, 0x29f0, 0x681b,
+ 0x0008, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x29f0,
+ 0xa184, 0x0007, 0x0079, 0x2424, 0x242c, 0x2401, 0x238e, 0x311c,
+ 0x3144, 0x3144, 0x242c, 0x313c, 0x1078, 0x1eac, 0xa282, 0x0005,
+ 0x0050, 0x2434, 0x1078, 0x1eac, 0x2300, 0x0079, 0x2437, 0x243a,
+ 0x265e, 0x266a, 0x2200, 0x0079, 0x243d, 0x2457, 0x2444, 0x2457,
+ 0x2442, 0x2643, 0x1078, 0x1eac, 0x789b, 0x0018, 0x78a8, 0xa084,
+ 0x00ff, 0xa082, 0x0020, 0x0048, 0x2f69, 0xa08a, 0x0004, 0x00c8,
+ 0x2f69, 0x0079, 0x2453, 0x2f69, 0x2f69, 0x2f69, 0x2f23, 0x789b,
+ 0x0018, 0x79a8, 0xa184, 0x0080, 0x0040, 0x246c, 0xa184, 0x0018,
+ 0x0040, 0x2468, 0x0078, 0x2f69, 0x7000, 0xa005, 0x00c0, 0x2462,
+ 0x2011, 0x0004, 0x0078, 0x2b28, 0xa184, 0x00ff, 0xa08a, 0x0010,
+ 0x00c8, 0x2f69, 0x0079, 0x2474, 0x2486, 0x2484, 0x249e, 0x24a2,
+ 0x255a, 0x2f69, 0x2f69, 0x255c, 0x2f69, 0x2f69, 0x263f, 0x263f,
+ 0x2f69, 0x2f69, 0x2f69, 0x2641, 0x1078, 0x1eac, 0xa684, 0x1000,
+ 0x0040, 0x2493, 0x2001, 0x0300, 0x8000, 0x8000, 0x783a, 0x781b,
+ 0x0099, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000, 0x0040, 0x249c,
+ 0x681b, 0x001d, 0x0078, 0x248a, 0x0078, 0x311c, 0x681b, 0x001d,
+ 0x0078, 0x2f75, 0x6920, 0xa184, 0x8000, 0x00c0, 0x24ae, 0x68af,
+ 0x0000, 0x68b3, 0x0000, 0xa18d, 0x8000, 0x6922, 0xa684, 0x1800,
+ 0x00c0, 0x24ed, 0x6820, 0xa084, 0x0001, 0x00c0, 0x24f3, 0x6818,
+ 0xa086, 0x0008, 0x00c0, 0x24be, 0x681b, 0x0000, 0xa684, 0x0400,
+ 0x0040, 0x2556, 0xa684, 0x0080, 0x0040, 0x24e9, 0x70cb, 0x0000,
+ 0x6818, 0xa084, 0x003f, 0xa08a, 0x000d, 0x0050, 0x24e9, 0xa08a,
+ 0x000c, 0x71ca, 0x2001, 0x000c, 0x800c, 0x71ce, 0x789b, 0x0061,
+ 0x78aa, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000,
+ 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f,
+ 0x157f, 0x781b, 0x0056, 0x0078, 0x1efb, 0xa684, 0x1000, 0x0040,
+ 0x24f3, 0x0078, 0x1efb, 0xa684, 0x0060, 0x0040, 0x2552, 0xa684,
+ 0x0800, 0x0040, 0x2552, 0xa684, 0x8000, 0x00c0, 0x2503, 0x69b0,
+ 0x6aac, 0x0078, 0x251d, 0xa6b4, 0x7fff, 0x7e5a, 0x6eb6, 0x789b,
+ 0x0074, 0x7aac, 0x79ac, 0x78ac, 0x801b, 0x00c8, 0x2510, 0x8000,
+ 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302,
+ 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0xa684, 0x4000, 0x0040,
+ 0x2525, 0xa6b4, 0xbfff, 0x7e5a, 0x6eb6, 0xa006, 0x1078, 0x362f,
+ 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040, 0x2534,
+ 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x6ba6, 0x7bd6,
+ 0x2300, 0xa405, 0x00c0, 0x2544, 0xa6b5, 0x4000, 0x7e5a, 0x6eb6,
+ 0x781b, 0x0065, 0x0078, 0x1efb, 0x781b, 0x0065, 0x2200, 0xa115,
+ 0x00c0, 0x254e, 0x1078, 0x3571, 0x0078, 0x1efb, 0x1078, 0x35a6,
+ 0x0078, 0x1efb, 0x781b, 0x0068, 0x0078, 0x1efb, 0x781b, 0x0056,
+ 0x0078, 0x1efb, 0x1078, 0x1eac, 0x0078, 0x25b1, 0x6920, 0xa184,
+ 0x0100, 0x0040, 0x2570, 0xa18c, 0xfeff, 0x6922, 0x0c7e, 0x7048,
+ 0x2060, 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x25a0,
+ 0xa184, 0x0200, 0x0040, 0x25a0, 0xa18c, 0xfdff, 0x6922, 0x0c7e,
+ 0x7048, 0x2060, 0x6004, 0xa084, 0xffef, 0x6006, 0x2008, 0x2c48,
+ 0x0c7f, 0xa184, 0x0008, 0x0040, 0x25a0, 0x1078, 0x3095, 0x1078,
+ 0x2ddf, 0x88ff, 0x0040, 0x25a0, 0x789b, 0x0060, 0x2800, 0x78aa,
+ 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x259c,
+ 0x781b, 0x0053, 0x0078, 0x1efb, 0x781b, 0x0067, 0x0078, 0x1efb,
+ 0x7e58, 0xa684, 0x0400, 0x00c0, 0x25a9, 0x781b, 0x0056, 0x0078,
+ 0x1efb, 0x781b, 0x0068, 0x0078, 0x1efb, 0x0078, 0x2f6f, 0x0078,
+ 0x2f6f, 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 0x0040, 0x25af,
+ 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x00c0,
+ 0x25d4, 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, 0x25cc,
+ 0x0048, 0x25cc, 0x0078, 0x25ce, 0x0078, 0x255e, 0x24a8, 0x7aa8,
+ 0x00f0, 0x25ce, 0x0078, 0x25ba, 0xa284, 0x00f0, 0xa086, 0x0020,
+ 0x00c0, 0x2630, 0x8318, 0x8318, 0x2300, 0xa102, 0x0040, 0x25e4,
+ 0x0048, 0x25e4, 0x0078, 0x262d, 0xa286, 0x0023, 0x0040, 0x25af,
+ 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684, 0xfff1, 0xa085,
+ 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085, 0x0010, 0x600a, 0x0c7e,
+ 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0010,
+ 0x0040, 0x2608, 0x1078, 0x3095, 0x1078, 0x2ee3, 0x0078, 0x2617,
+ 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xa184,
+ 0x0008, 0x0040, 0x25a0, 0x1078, 0x3095, 0x1078, 0x2ddf, 0x88ff,
+ 0x0040, 0x25a0, 0x789b, 0x0060, 0x2800, 0x78aa, 0xa6b5, 0x0004,
+ 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2629, 0x781b, 0x0053, 0x0078,
+ 0x1efb, 0x781b, 0x0067, 0x0078, 0x1efb, 0x7aa8, 0x0078, 0x25ba,
+ 0x8318, 0x2300, 0xa102, 0x0040, 0x2639, 0x0048, 0x2639, 0x0078,
+ 0x25ba, 0xa284, 0x0080, 0x00c0, 0x2f75, 0x0078, 0x2f6f, 0x0078,
+ 0x2f75, 0x0078, 0x2f69, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff,
+ 0xa08e, 0x0001, 0x0040, 0x264e, 0x1078, 0x1eac, 0x7aa8, 0xa294,
+ 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x2f69,
+ 0x0079, 0x265a, 0x2f69, 0x2d32, 0x2f69, 0x2e7e, 0xa282, 0x0000,
+ 0x00c0, 0x2664, 0x1078, 0x1eac, 0x1078, 0x2f7d, 0x781b, 0x0067,
+ 0x0078, 0x1efb, 0xa282, 0x0003, 0x00c0, 0x2670, 0x1078, 0x1eac,
+ 0xa484, 0x8000, 0x00c0, 0x2693, 0x70a0, 0xa005, 0x0040, 0x267a,
+ 0x1078, 0x1eac, 0x6f14, 0x77b6, 0xa7bc, 0x0f00, 0x1078, 0x3099,
+ 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x0007, 0x00c0,
+ 0x267e, 0x1078, 0x2f81, 0x70a3, 0x0002, 0x2009, 0x3935, 0x200b,
+ 0x0009, 0x0078, 0x2695, 0x1078, 0x2f8d, 0x781b, 0x0067, 0x0078,
+ 0x1efb, 0xa282, 0x0004, 0x0050, 0x269f, 0x1078, 0x1eac, 0x2300,
+ 0x0079, 0x26a2, 0x26a5, 0x2781, 0x27a9, 0xa286, 0x0003, 0x0040,
+ 0x26ab, 0x1078, 0x1eac, 0x2001, 0x0000, 0x703a, 0x7000, 0xa084,
+ 0x0007, 0x0079, 0x26b3, 0x26bb, 0x26bd, 0x26bd, 0x2871, 0x28a2,
+ 0x1f03, 0x28a2, 0x26bb, 0x1078, 0x1eac, 0xa684, 0x1000, 0x00c0,
+ 0x26c5, 0x1078, 0x32f5, 0x0040, 0x275b, 0x7868, 0xa08c, 0x00ff,
+ 0x0040, 0x270d, 0xa186, 0x0008, 0x00c0, 0x26dc, 0x1078, 0x2cdf,
+ 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x2c92, 0x0040, 0x270d,
+ 0x1078, 0x32f5, 0x0078, 0x26f4, 0xa186, 0x0028, 0x00c0, 0x270d,
+ 0x1078, 0x32f5, 0x6008, 0xa084, 0xffef, 0x600a, 0x6018, 0xa005,
+ 0x0040, 0x26f4, 0x8001, 0x601a, 0xa005, 0x0040, 0x26f4, 0x8001,
+ 0xa005, 0x0040, 0x26f4, 0x601e, 0x6820, 0xa084, 0x0001, 0x0040,
+ 0x1f03, 0x6820, 0xa084, 0xfffe, 0x6822, 0x7054, 0x0c7e, 0x2060,
+ 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802, 0xa005, 0x2d00, 0x00c0,
+ 0x270a, 0x6002, 0x6006, 0x0078, 0x1f03, 0x017e, 0x1078, 0x27ce,
+ 0x017f, 0xa684, 0xdf00, 0x681e, 0x682b, 0x0000, 0x6f14, 0x81ff,
+ 0x0040, 0x275b, 0xa186, 0x0002, 0x00c0, 0x2753, 0xa684, 0x0800,
+ 0x00c0, 0x272a, 0xa684, 0x0060, 0x0040, 0x272a, 0x78d8, 0x7adc,
+ 0x682e, 0x6a32, 0x6820, 0xa084, 0x0800, 0x00c0, 0x275b, 0x8717,
+ 0xa294, 0x000f, 0x8213, 0x8213, 0x8213, 0xa290, 0x3a00, 0xa290,
+ 0x0000, 0x221c, 0x8210, 0x2204, 0xa085, 0x0018, 0x2012, 0x8211,
+ 0xa384, 0x0400, 0x0040, 0x274d, 0x68a0, 0xa084, 0x0100, 0x00c0,
+ 0x274d, 0x1078, 0x2830, 0x0078, 0x1f03, 0x6008, 0xa085, 0x0002,
+ 0x600a, 0x0078, 0x275b, 0xa186, 0x0018, 0x0040, 0x275b, 0xa186,
+ 0x0014, 0x0040, 0x1f03, 0x6916, 0x6818, 0xa084, 0x8000, 0x0040,
+ 0x2763, 0x7038, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x1078, 0x2cd0,
+ 0x1078, 0x2cdf, 0x00c0, 0x2770, 0x6008, 0xa084, 0xffef, 0x600a,
+ 0x6820, 0xa084, 0x0001, 0x00c0, 0x2779, 0x1078, 0x2cc9, 0x0078,
+ 0x277d, 0x7054, 0x2060, 0x6800, 0x6002, 0x1078, 0x1a26, 0x0078,
+ 0x1f03, 0xa282, 0x0004, 0x0048, 0x2787, 0x1078, 0x1eac, 0x2200,
+ 0x0079, 0x278a, 0x2785, 0x278e, 0x2794, 0x278e, 0x1078, 0x2f7d,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x7890, 0x8007, 0x8001, 0xa084,
+ 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186,
+ 0x0003, 0x0040, 0x27a5, 0x0078, 0x2f69, 0x781b, 0x0068, 0x0078,
+ 0x1efb, 0x6820, 0xa085, 0x0004, 0x6822, 0x82ff, 0x00c0, 0x27b4,
+ 0x1078, 0x2f7d, 0x0078, 0x27bb, 0x8211, 0x0040, 0x27b9, 0x1078,
+ 0x1eac, 0x1078, 0x2f8d, 0x781b, 0x0067, 0x0078, 0x1efb, 0x1078,
+ 0x316a, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x27cb, 0x0018, 0x27cb,
+ 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0xa684, 0x0060,
+ 0x00c0, 0x27d8, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x282f,
+ 0xa684, 0x0800, 0x00c0, 0x27e8, 0x6998, 0x6a94, 0x692e, 0x6a32,
+ 0x7000, 0xa086, 0x0006, 0x0040, 0x27e7, 0x1078, 0x32f5, 0x007c,
+ 0xa684, 0x0020, 0x0040, 0x2802, 0xa684, 0x4000, 0x0040, 0x27f6,
+ 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x27e0, 0x7038, 0xa005,
+ 0x00c0, 0x27fc, 0x703b, 0x0015, 0x79d8, 0x7adc, 0x692e, 0x6a32,
+ 0x0078, 0x27e0, 0xa684, 0x4000, 0x0040, 0x280c, 0x682f, 0x0000,
+ 0x6833, 0x0000, 0x0078, 0x27e0, 0x7038, 0xa005, 0x00c0, 0x2812,
+ 0x703b, 0x0015, 0x79d8, 0x7adc, 0x78d0, 0x80fb, 0x00c8, 0x2819,
+ 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x692e, 0x6a32,
+ 0x2100, 0xa205, 0x00c0, 0x2826, 0x0078, 0x27e0, 0x7000, 0xa086,
+ 0x0006, 0x0040, 0x282f, 0x1078, 0x362f, 0x0078, 0x27e0, 0x007c,
+ 0xa384, 0x0200, 0x0040, 0x2838, 0x6008, 0xa085, 0x0002, 0x600a,
+ 0x681b, 0x0006, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003,
+ 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b, 0x0020,
+ 0x7000, 0x0079, 0x284b, 0x2853, 0x2855, 0x285e, 0x2853, 0x2853,
+ 0x2853, 0x2853, 0x2853, 0x1078, 0x1eac, 0x6820, 0xa084, 0x0001,
+ 0x00c0, 0x285e, 0x1078, 0x2cc9, 0x0078, 0x2864, 0x7054, 0x2c50,
+ 0x2060, 0x6800, 0x6002, 0x2a60, 0x2021, 0x3957, 0x2404, 0xa005,
+ 0x0040, 0x286d, 0x2020, 0x0078, 0x2866, 0x2d22, 0x206b, 0x0000,
+ 0x007c, 0x1078, 0x2cd0, 0x1078, 0x2cdf, 0x682b, 0x0000, 0x789b,
+ 0x000e, 0x6f14, 0x6817, 0x0002, 0x1078, 0x366b, 0xa684, 0x0800,
+ 0x0040, 0x2886, 0x691c, 0xa18d, 0x2000, 0x691e, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x2896, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2894,
+ 0x681b, 0x001e, 0x0078, 0x2896, 0x681b, 0x0000, 0x2021, 0x3957,
+ 0x6800, 0x2022, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x1078, 0x1a26,
+ 0x0078, 0x1f03, 0x1078, 0x27ce, 0x682b, 0x0000, 0x789b, 0x000e,
+ 0x6f14, 0x1078, 0x316f, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x28b5, 0x7038, 0x681a, 0xa68c, 0xdf00, 0x691e,
+ 0x70a3, 0x0000, 0x0078, 0x1f03, 0xa006, 0x1078, 0x32f5, 0x6817,
+ 0x0000, 0x681b, 0x0001, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000,
+ 0x7000, 0x0079, 0x28cb, 0x28d3, 0x28d5, 0x28d5, 0x28d7, 0x28d7,
+ 0x28d7, 0x28d7, 0x28d3, 0x1078, 0x1eac, 0x1078, 0x2cdf, 0x6008,
+ 0xa084, 0xffef, 0x600a, 0x0078, 0x2caa, 0x2300, 0x0079, 0x28e0,
+ 0x28e3, 0x28e5, 0x2939, 0x1078, 0x1eac, 0x7000, 0x0079, 0x28e8,
+ 0x28f0, 0x28f2, 0x28f2, 0x290d, 0x28f2, 0x291a, 0x290d, 0x28f0,
+ 0x1078, 0x1eac, 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0, 0x2909,
+ 0xa6b4, 0xffdf, 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a, 0x681c,
+ 0xa084, 0xffdf, 0x681e, 0x1078, 0x32f5, 0x1078, 0x3571, 0x0078,
+ 0x311c, 0xa684, 0x2000, 0x0040, 0x28fc, 0x6818, 0xa084, 0x8000,
+ 0x0040, 0x291a, 0x681b, 0x0015, 0xa684, 0x4000, 0x0040, 0x291a,
+ 0x681b, 0x0007, 0x2009, 0x391e, 0x210c, 0xa186, 0x0000, 0x0040,
+ 0x292f, 0xa186, 0x0001, 0x0040, 0x2933, 0x2009, 0x3935, 0x200b,
+ 0x000b, 0x70a3, 0x0001, 0x781b, 0x0047, 0x0078, 0x1efb, 0x781b,
+ 0x00df, 0x0078, 0x1efb, 0x2009, 0x3935, 0x200b, 0x000a, 0x0078,
+ 0x1efb, 0x1078, 0x1eac, 0x2300, 0x0079, 0x293e, 0x2941, 0x2943,
+ 0x2976, 0x1078, 0x1eac, 0x7000, 0x0079, 0x2946, 0x294e, 0x2950,
+ 0x2950, 0x296b, 0x2950, 0x2972, 0x296b, 0x294e, 0x1078, 0x1eac,
+ 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0, 0x2967, 0xa6b4, 0xffbf,
+ 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a, 0x681c, 0xa084, 0xffbf,
+ 0x681e, 0x1078, 0x32f5, 0x1078, 0x3571, 0x0078, 0x311c, 0xa684,
+ 0x2000, 0x0040, 0x295a, 0x6818, 0xa084, 0x8000, 0x0040, 0x2972,
+ 0x681b, 0x0007, 0x781b, 0x00e6, 0x0078, 0x1efb, 0x6820, 0xa085,
+ 0x0004, 0x6822, 0x1078, 0x30e7, 0xa6b5, 0x0800, 0x1078, 0x2f7d,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x2300, 0x0079, 0x2987, 0x298a,
+ 0x298c, 0x298e, 0x1078, 0x1eac, 0x1078, 0x1eac, 0xa684, 0x0400,
+ 0x00c0, 0x29ae, 0x782b, 0x3009, 0x6920, 0xa18c, 0xfdff, 0xa18c,
+ 0xfeff, 0x6922, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb,
+ 0x785a, 0x79e4, 0xa184, 0x0020, 0x00c0, 0x29aa, 0x2001, 0x0014,
+ 0x0078, 0x26ad, 0xa184, 0x0007, 0x0079, 0x29e6, 0x7a90, 0xa294,
+ 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0040, 0x29e4, 0x789b,
+ 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 0x29d5, 0x7ba8, 0x7ba8,
+ 0xa386, 0x0001, 0x00c0, 0x29c8, 0x2009, 0xfff7, 0x0078, 0x29ce,
+ 0xa386, 0x0003, 0x00c0, 0x29d5, 0x2009, 0xffef, 0x0c7e, 0x7048,
+ 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab,
+ 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c,
+ 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 0x311c, 0x239b, 0x23a8,
+ 0x3124, 0x3124, 0x29ee, 0x29ee, 0x29ee, 0x3124, 0x1078, 0x1eac,
+ 0x79e4, 0xa184, 0x0030, 0x00c0, 0x2a06, 0x70a0, 0xa086, 0x0002,
+ 0x00c0, 0x29fe, 0x2011, 0x0002, 0x0078, 0x2288, 0x6818, 0xa085,
+ 0x8000, 0x681a, 0x2001, 0x0014, 0x0078, 0x26ad, 0xa184, 0x0007,
+ 0x0079, 0x2a0a, 0x311c, 0x311c, 0x2a12, 0x311c, 0x3144, 0x3144,
+ 0x311c, 0x311c, 0xa684, 0x0080, 0x0040, 0x2a41, 0x71c8, 0x81ff,
+ 0x0040, 0x2a41, 0xa182, 0x000d, 0x00d0, 0x2a22, 0x70cb, 0x0000,
+ 0x0078, 0x2a27, 0xa182, 0x000c, 0x70ca, 0x2009, 0x000c, 0x789b,
+ 0x0061, 0x79aa, 0x157e, 0x137e, 0x147e, 0x70cc, 0x8114, 0xa210,
+ 0x72ce, 0xa080, 0x000b, 0xad00, 0x2098, 0x20a1, 0x012b, 0x789b,
+ 0x0000, 0x8108, 0x81ac, 0x53a6, 0x147f, 0x137f, 0x157f, 0x0078,
+ 0x3124, 0xa684, 0x0400, 0x00c0, 0x2a82, 0x6820, 0xa084, 0x0001,
+ 0x0040, 0x3124, 0xa68c, 0x0060, 0xa684, 0x0060, 0x0040, 0x2a56,
+ 0xa086, 0x0060, 0x00c0, 0x2a56, 0xa18d, 0x4000, 0xa18c, 0xfffb,
+ 0x795a, 0x69b6, 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061,
+ 0x6818, 0xa085, 0x8000, 0x681a, 0x78aa, 0x8008, 0x810c, 0x0040,
+ 0x2d07, 0xa18c, 0x00f8, 0x00c0, 0x2d07, 0x157e, 0x137e, 0x147e,
+ 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b,
+ 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6814, 0x8007, 0x7882,
+ 0x0078, 0x3124, 0x6818, 0xa084, 0x8000, 0x0040, 0x2a89, 0x681b,
+ 0x0008, 0x781b, 0x00da, 0x0078, 0x1efb, 0x2300, 0x0079, 0x2a90,
+ 0x2a95, 0x2b18, 0x2a93, 0x1078, 0x1eac, 0x7000, 0xa084, 0x0007,
+ 0x0079, 0x2a9a, 0x2aa2, 0x2aa4, 0x2ac0, 0x2aa2, 0x2aa2, 0x1f03,
+ 0x2aa2, 0x2aa2, 0x1078, 0x1eac, 0x6920, 0xa18d, 0x0001, 0x6922,
+ 0x6800, 0x6006, 0xa005, 0x00c0, 0x2aae, 0x6002, 0x681c, 0xa084,
+ 0x000e, 0x0040, 0x2aba, 0x7014, 0x68ba, 0x712c, 0xa188, 0x4280,
+ 0x0078, 0x2abc, 0x2009, 0x4380, 0x2104, 0x6802, 0x2d0a, 0x7156,
+ 0x6920, 0xa184, 0x8000, 0x00c0, 0x2acc, 0x68af, 0x0000, 0x68b3,
+ 0x0000, 0xa18d, 0x8000, 0x6922, 0x6eb6, 0xa684, 0x0060, 0x0040,
+ 0x2b16, 0xa684, 0x0800, 0x00c0, 0x2add, 0x6894, 0x68a6, 0x6898,
+ 0x68aa, 0x1078, 0x32f5, 0x0078, 0x2b16, 0xa684, 0x0020, 0x0040,
+ 0x2aea, 0xa006, 0x1078, 0x362f, 0x79d8, 0x7adc, 0x69aa, 0x6aa6,
+ 0x0078, 0x2af0, 0x1078, 0x30a6, 0x69aa, 0x6aa6, 0x1078, 0x362f,
+ 0xa684, 0x8000, 0x0040, 0x2b16, 0xa684, 0x7fff, 0x68b6, 0x789b,
+ 0x0074, 0x1078, 0x316f, 0x2010, 0x1078, 0x316f, 0x2008, 0xa684,
+ 0x0020, 0x00c0, 0x2b0e, 0x1078, 0x316f, 0x801b, 0x00c8, 0x2b09,
+ 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100,
+ 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x0078, 0x1f03,
+ 0x0078, 0x2f75, 0x7033, 0x0000, 0xa282, 0x0006, 0x0050, 0x2b22,
+ 0x1078, 0x1eac, 0x2300, 0x0079, 0x2b25, 0x2b28, 0x2b4e, 0x2b72,
+ 0x2200, 0x0079, 0x2b2b, 0x2b31, 0x2f75, 0x2b33, 0x2b31, 0x2b9c,
+ 0x2bed, 0x1078, 0x1eac, 0x7003, 0x0005, 0x2001, 0x4390, 0x2068,
+ 0x703e, 0x157e, 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, 0x0070,
+ 0x2b43, 0x0078, 0x2b3c, 0x157f, 0x6817, 0x0000, 0x68b7, 0x0700,
+ 0x6823, 0x0800, 0x6827, 0x0003, 0x0078, 0x2f69, 0x7000, 0xa086,
+ 0x0001, 0x00c0, 0x2b5b, 0x1078, 0x2cdf, 0x1078, 0x32f5, 0x7034,
+ 0x600a, 0x0078, 0x2b60, 0x7000, 0xa086, 0x0003, 0x0040, 0x2b55,
+ 0x7003, 0x0005, 0x2001, 0x4390, 0x2068, 0x703e, 0x7032, 0x2200,
+ 0x0079, 0x2b6a, 0x2f75, 0x2b70, 0x2b70, 0x2b9c, 0x2b70, 0x2f75,
+ 0x1078, 0x1eac, 0x7000, 0xa086, 0x0001, 0x00c0, 0x2b7f, 0x1078,
+ 0x2cdf, 0x1078, 0x32f5, 0x7034, 0x600a, 0x0078, 0x2b84, 0x7000,
+ 0xa086, 0x0003, 0x0040, 0x2b79, 0x7003, 0x0005, 0x2001, 0x4390,
+ 0x2068, 0x703e, 0x7032, 0x2200, 0x0079, 0x2b8e, 0x2b96, 0x2b94,
+ 0x2b94, 0x2b96, 0x2b94, 0x2b96, 0x1078, 0x1eac, 0x1078, 0x2f8d,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x7000, 0xa086, 0x0001, 0x00c0,
+ 0x2ba9, 0x1078, 0x2cdf, 0x1078, 0x32f5, 0x7034, 0x600a, 0x0078,
+ 0x2bae, 0x7000, 0xa086, 0x0003, 0x0040, 0x2ba3, 0x7003, 0x0002,
+ 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x0007,
+ 0xa215, 0x2069, 0x4380, 0x2d04, 0x2d08, 0x7156, 0x2068, 0xa005,
+ 0x0040, 0x2bc9, 0x6814, 0xa206, 0x0040, 0x2be2, 0x6800, 0x0078,
+ 0x2bbc, 0x7003, 0x0005, 0x2001, 0x4390, 0x2068, 0x703e, 0x7032,
+ 0x157e, 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, 0x0070, 0x2bda,
+ 0x0078, 0x2bd3, 0x157f, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800,
+ 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6820, 0xa084, 0x0c00, 0x0040,
+ 0x2c4b, 0x1078, 0x2f85, 0x0078, 0x2c4b, 0x7000, 0xa086, 0x0001,
+ 0x00c0, 0x2bfa, 0x1078, 0x2cdf, 0x1078, 0x32f5, 0x7034, 0x600a,
+ 0x0078, 0x2bff, 0x7000, 0xa086, 0x0003, 0x0040, 0x2bf4, 0x7003,
+ 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484,
+ 0x0007, 0xa215, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0xa1e8, 0x4280,
+ 0x2d04, 0x2d08, 0x7156, 0x2068, 0xa005, 0x0040, 0x2c1e, 0x6814,
+ 0xa206, 0x0040, 0x2c36, 0x6800, 0x0078, 0x2c11, 0x7003, 0x0005,
+ 0x2001, 0x4390, 0x2068, 0x703e, 0x157e, 0x20a9, 0x002f, 0x2003,
+ 0x0000, 0x8000, 0x0070, 0x2c2e, 0x0078, 0x2c27, 0x157f, 0x6a16,
+ 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x7e5a,
+ 0x6820, 0xa084, 0x0c00, 0x0040, 0x2c4b, 0xa084, 0x0800, 0x0040,
+ 0x2c45, 0x1078, 0x2f89, 0x0078, 0x2c4b, 0x1078, 0x2f85, 0x70bf,
+ 0x0000, 0x0078, 0x2c4b, 0x027e, 0x8207, 0xa084, 0x000f, 0x8003,
+ 0x8003, 0x8003, 0xa080, 0x3a00, 0x2060, 0x704a, 0x6000, 0x704e,
+ 0x6004, 0x7052, 0xa684, 0x0060, 0x0040, 0x2c64, 0x68a8, 0x78d2,
+ 0x78da, 0x68a4, 0x78d6, 0x78de, 0x077f, 0x1078, 0x3099, 0x2009,
+ 0x0068, 0xa684, 0x0008, 0x0040, 0x2c6f, 0x2009, 0x0067, 0xa6b5,
+ 0x2000, 0x7e5a, 0x791a, 0xa684, 0x0060, 0x0040, 0x2c85, 0xa684,
+ 0x0800, 0x00c0, 0x2c7f, 0x1078, 0x3571, 0x0078, 0x2c85, 0xa684,
+ 0x4000, 0x00c0, 0x2c85, 0x1078, 0x3502, 0x2d00, 0x703e, 0x8207,
+ 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3a00, 0x2048,
+ 0x0078, 0x1efb, 0x6020, 0xa005, 0x0040, 0x2c9e, 0x8001, 0x6022,
+ 0x6008, 0xa085, 0x0008, 0x600a, 0x7010, 0x6026, 0x007c, 0xa006,
+ 0x1078, 0x32f5, 0x6817, 0x0000, 0x681b, 0x0001, 0x6823, 0x0040,
+ 0x681f, 0x0100, 0x7000, 0xa084, 0x0007, 0x0079, 0x2caf, 0x2cb7,
+ 0x2cb9, 0x2cb9, 0x2cc5, 0x2cc1, 0x2cb7, 0x2cc1, 0x2cb7, 0x1078,
+ 0x1eac, 0x1078, 0x2cd0, 0x1078, 0x2cc9, 0x1078, 0x1a26, 0x0078,
+ 0x1f03, 0x70a3, 0x0000, 0x0078, 0x1f03, 0x681b, 0x0000, 0x0078,
+ 0x2871, 0x6800, 0xa005, 0x00c0, 0x2cce, 0x6002, 0x6006, 0x007c,
+ 0x6010, 0xa005, 0x0040, 0x2cd9, 0x8001, 0x00d0, 0x2cd9, 0x1078,
+ 0x1eac, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x007c, 0x6018,
+ 0xa005, 0x0040, 0x2ce5, 0x8001, 0x601a, 0x007c, 0x1078, 0x316a,
+ 0x6818, 0xa084, 0x8000, 0x0040, 0x2cef, 0x681b, 0x0018, 0x0078,
+ 0x2d26, 0x1078, 0x316a, 0x6818, 0xa084, 0x8000, 0x0040, 0x2cfa,
+ 0x681b, 0x0019, 0x0078, 0x2d26, 0x1078, 0x316a, 0x6818, 0xa084,
+ 0x8000, 0x0040, 0x2d05, 0x681b, 0x001a, 0x0078, 0x2d26, 0x1078,
+ 0x316a, 0x681b, 0x0003, 0x0078, 0x2d26, 0x71b8, 0xa18c, 0x00ff,
+ 0xa1e8, 0x4280, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0, 0x2d1a,
+ 0x0078, 0x1f03, 0x6814, 0x72b4, 0xa206, 0x0040, 0x2d22, 0x6800,
+ 0x0078, 0x2d13, 0x6800, 0x200a, 0x681b, 0x0005, 0x681f, 0x0000,
+ 0x6823, 0x0020, 0x1078, 0x2cd0, 0x1078, 0x2cc9, 0x1078, 0x1a26,
+ 0x0078, 0x1f03, 0xa282, 0x0003, 0x00c0, 0x2f69, 0x7da8, 0xa5ac,
+ 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x6920, 0xa18d, 0x0080, 0x6922,
+ 0xa184, 0x0100, 0x0040, 0x2d92, 0xa18c, 0xfeff, 0x6922, 0xa6b4,
+ 0x00ff, 0x0040, 0x2d7c, 0xa682, 0x000c, 0x0048, 0x2d53, 0x0040,
+ 0x2d53, 0x2031, 0x000c, 0x852b, 0x852b, 0x1078, 0x3018, 0x0040,
+ 0x2d5d, 0x1078, 0x2e4a, 0x0078, 0x2d85, 0x1078, 0x2fd3, 0x0c7e,
+ 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x2e6e, 0x0c7f,
+ 0x6920, 0xa18d, 0x0100, 0x6922, 0x7e58, 0xa6b5, 0x0004, 0x7e5a,
+ 0xa684, 0x0400, 0x00c0, 0x2d78, 0x781b, 0x0053, 0x0078, 0x1efb,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x0c7e, 0x2960, 0x6004, 0xa084,
+ 0xfff5, 0x6006, 0x1078, 0x2e6e, 0x0c7f, 0x7e58, 0xa684, 0x0400,
+ 0x00c0, 0x2d8e, 0x781b, 0x0056, 0x0078, 0x1efb, 0x781b, 0x0068,
+ 0x0078, 0x1efb, 0x0c7e, 0x7048, 0x2060, 0x6100, 0xa18c, 0x1000,
+ 0x0040, 0x2dd2, 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c,
+ 0x0048, 0x2da6, 0x0040, 0x2da6, 0x2011, 0x000c, 0x2600, 0xa202,
+ 0x00c8, 0x2dab, 0x2230, 0x6208, 0xa294, 0x00ff, 0x7018, 0xa086,
+ 0x0028, 0x00c0, 0x2dbb, 0xa282, 0x0019, 0x00c8, 0x2dc1, 0x2011,
+ 0x0019, 0x0078, 0x2dc1, 0xa282, 0x000c, 0x00c8, 0x2dc1, 0x2011,
+ 0x000c, 0x2200, 0xa502, 0x00c8, 0x2dc6, 0x2228, 0x1078, 0x2fd7,
+ 0x852b, 0x852b, 0x1078, 0x3018, 0x0040, 0x2dd2, 0x1078, 0x2e4a,
+ 0x0078, 0x2dd6, 0x1078, 0x2fd3, 0x1078, 0x2e6e, 0x7858, 0xa085,
+ 0x0004, 0x785a, 0x0c7f, 0x781b, 0x0067, 0x0078, 0x1efb, 0x0c7e,
+ 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x2df7, 0x6010, 0xa084,
+ 0x000f, 0x00c0, 0x2df1, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x0c7f,
+ 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x2e1e, 0x68a0,
+ 0xa084, 0x0200, 0x00c0, 0x2df1, 0x6208, 0xa294, 0x00ff, 0x7018,
+ 0xa086, 0x0028, 0x00c0, 0x2e0c, 0xa282, 0x0019, 0x00c8, 0x2e12,
+ 0x2011, 0x0019, 0x0078, 0x2e12, 0xa282, 0x000c, 0x00c8, 0x2e12,
+ 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c,
+ 0x0048, 0x2e1e, 0x0040, 0x2e1e, 0x2019, 0x000c, 0x78ab, 0x0001,
+ 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005,
+ 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x2960,
+ 0x6104, 0xa18c, 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 0x0000,
+ 0x0078, 0x2e3a, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001,
+ 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xa085, 0x0100, 0x6822,
+ 0x0c7f, 0x007c, 0x0c7e, 0x7148, 0x2160, 0x2008, 0xa084, 0xfff0,
+ 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, 0x6612, 0x78a4, 0xa084,
+ 0xfff8, 0xa18c, 0x0007, 0xa105, 0x78a6, 0x6016, 0x788a, 0xa6b4,
+ 0x000f, 0x8637, 0x8204, 0x8004, 0xa084, 0x00ff, 0xa605, 0x600e,
+ 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x007c, 0x0c7e, 0x7048,
+ 0x2060, 0x6018, 0x789a, 0x78a4, 0xa084, 0xfff0, 0x78a6, 0x6012,
+ 0x7884, 0xa084, 0xfff0, 0x7886, 0x0c7f, 0x007c, 0xa282, 0x0002,
+ 0x00c0, 0x2f69, 0x7aa8, 0x6920, 0xa18d, 0x0080, 0x6922, 0xa184,
+ 0x0200, 0x0040, 0x2ec3, 0xa18c, 0xfdff, 0x6922, 0xa294, 0x00ff,
+ 0xa282, 0x0002, 0x00c8, 0x2f69, 0x1078, 0x2f0a, 0x1078, 0x2e6e,
+ 0xa980, 0x0001, 0x200c, 0x1078, 0x3095, 0x1078, 0x2ddf, 0x88ff,
+ 0x0040, 0x2eb6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5,
+ 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2eb2, 0x781b, 0x0053,
+ 0x0078, 0x1efb, 0x781b, 0x0067, 0x0078, 0x1efb, 0x7e58, 0xa684,
+ 0x0400, 0x00c0, 0x2ebf, 0x781b, 0x0056, 0x0078, 0x1efb, 0x781b,
+ 0x0068, 0x0078, 0x1efb, 0xa282, 0x0002, 0x00c8, 0x2ecb, 0xa284,
+ 0x0001, 0x0040, 0x2ed5, 0x7148, 0xa188, 0x0000, 0x210c, 0xa18c,
+ 0x2000, 0x00c0, 0x2ed5, 0x2011, 0x0000, 0x1078, 0x2fc5, 0x1078,
+ 0x2f0a, 0x1078, 0x2e6e, 0x7858, 0xa085, 0x0004, 0x785a, 0x781b,
+ 0x0067, 0x0078, 0x1efb, 0x0c7e, 0x027e, 0x2960, 0x6000, 0x2011,
+ 0x0001, 0xa084, 0x2000, 0x00c0, 0x2efa, 0x6014, 0xa084, 0x0040,
+ 0x00c0, 0x2ef8, 0xa18c, 0xffef, 0x6106, 0xa006, 0x0078, 0x2f07,
+ 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003,
+ 0x7aaa, 0xa8c0, 0x0004, 0x6820, 0xa085, 0x0200, 0x6822, 0x027f,
+ 0x0c7f, 0x007c, 0x0c7e, 0x7048, 0x2060, 0x82ff, 0x0040, 0x2f12,
+ 0x2011, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084,
+ 0xffbf, 0xa205, 0x78a6, 0x6016, 0x788a, 0x6004, 0xa084, 0xffef,
+ 0x6006, 0x0c7f, 0x007c, 0xa684, 0x0020, 0x0040, 0x2f65, 0x7888,
+ 0xa084, 0x0040, 0x0040, 0x2f65, 0x7bb8, 0xa384, 0x003f, 0x831b,
+ 0x00c8, 0x2f33, 0x8000, 0xa005, 0x0040, 0x2f4c, 0x831b, 0x00c8,
+ 0x2f3c, 0x8001, 0x0040, 0x2f61, 0xa684, 0x4000, 0x0040, 0x2f4c,
+ 0x78b8, 0x801b, 0x00c8, 0x2f45, 0x8000, 0xa084, 0x003f, 0x00c0,
+ 0x2f61, 0xa6b4, 0xbfff, 0x7e5a, 0x79d8, 0x7adc, 0x2001, 0x0001,
+ 0xa108, 0x00c8, 0x2f55, 0xa291, 0x0000, 0x79d2, 0x79da, 0x7ad6,
+ 0x7ade, 0x1078, 0x362f, 0x781b, 0x0065, 0x1078, 0x3502, 0x0078,
+ 0x1efb, 0x781b, 0x0065, 0x0078, 0x1efb, 0x781b, 0x0068, 0x0078,
+ 0x1efb, 0x1078, 0x2f91, 0x781b, 0x0067, 0x0078, 0x1efb, 0x1078,
+ 0x2f7d, 0x781b, 0x0067, 0x0078, 0x1efb, 0x6827, 0x0002, 0x1078,
+ 0x2f85, 0x781b, 0x0067, 0x0078, 0x1efb, 0x2001, 0x0005, 0x0078,
+ 0x2f93, 0x2001, 0x000c, 0x0078, 0x2f93, 0x2001, 0x0006, 0x0078,
+ 0x2f93, 0x2001, 0x000d, 0x0078, 0x2f93, 0x2001, 0x0009, 0x0078,
+ 0x2f93, 0x2001, 0x0007, 0x789b, 0x007e, 0x78aa, 0xa6b5, 0x0008,
+ 0x7e5a, 0x007c, 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b,
+ 0x8703, 0xa0e0, 0x3a00, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184,
+ 0x000f, 0x0040, 0x2fb3, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004,
+ 0xa085, 0x0008, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184,
+ 0x0040, 0x0040, 0x2fc3, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004,
+ 0xa085, 0x0010, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab,
+ 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060,
+ 0x78ab, 0x0004, 0x007c, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b,
+ 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa,
+ 0x7eaa, 0x789b, 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007,
+ 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4,
+ 0xa18c, 0xfff0, 0x2001, 0x3946, 0x2004, 0xa082, 0x0028, 0x0040,
+ 0x3001, 0x2021, 0x307c, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078,
+ 0x3007, 0x2021, 0x3088, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011,
+ 0x0064, 0x2404, 0xa084, 0xfff0, 0xa106, 0x0040, 0x3016, 0x8420,
+ 0x2300, 0xa210, 0x0070, 0x3016, 0x0078, 0x3009, 0x157f, 0x007c,
+ 0x157e, 0x2011, 0x3946, 0x2214, 0xa282, 0x0032, 0x0048, 0x302c,
+ 0x0040, 0x3030, 0x2021, 0x306e, 0x2019, 0x0011, 0x20a9, 0x000e,
+ 0x2011, 0x0032, 0x0078, 0x3042, 0xa282, 0x0028, 0x0040, 0x303a,
+ 0x2021, 0x307c, 0x2019, 0x0014, 0x20a9, 0x000c, 0x2011, 0x0064,
+ 0x0078, 0x3042, 0x2021, 0x3088, 0x2019, 0x0019, 0x20a9, 0x000d,
+ 0x2011, 0x0064, 0x2200, 0xa502, 0x0040, 0x3052, 0x0048, 0x3052,
+ 0x8420, 0x2300, 0xa210, 0x0070, 0x304f, 0x0078, 0x3042, 0x157f,
+ 0xa006, 0x007c, 0x157f, 0x7a08, 0xa582, 0x0064, 0x00c8, 0x305d,
+ 0xa285, 0x0040, 0x780a, 0x0078, 0x305d, 0x78ec, 0xa084, 0x0300,
+ 0x0040, 0x306b, 0x2404, 0xa09e, 0x2002, 0x00c0, 0x306b, 0x2001,
+ 0x2101, 0x0078, 0x306c, 0x2404, 0xa015, 0x007c, 0x2002, 0x3002,
+ 0x3202, 0x4203, 0x4403, 0x5404, 0x5604, 0x6605, 0x6805, 0x7806,
+ 0x7a06, 0x0a07, 0x0c07, 0x0e07, 0x3202, 0x4202, 0x5202, 0x6202,
+ 0x7202, 0x6605, 0x7605, 0x7805, 0x7a05, 0x7c05, 0x7e05, 0x7f05,
+ 0x2202, 0x3202, 0x4202, 0x5202, 0x5404, 0x6404, 0x7404, 0x7604,
+ 0x7804, 0x7a04, 0x7c04, 0x7e04, 0x7f04, 0x789b, 0x0010, 0xa046,
+ 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784, 0x0007, 0x8003, 0x8003,
+ 0x8003, 0x8003, 0xa105, 0xa0e0, 0x3a80, 0x007c, 0x79d8, 0x7adc,
+ 0x78d0, 0x801b, 0x00c8, 0x30ad, 0x8000, 0xa084, 0x003f, 0xa108,
+ 0xa291, 0x0000, 0x007c, 0x0f7e, 0x2079, 0x0100, 0x2009, 0x3940,
+ 0x2091, 0x8000, 0x2104, 0x0079, 0x30bd, 0x30e3, 0x30c7, 0x30c7,
+ 0x30c7, 0x30c7, 0x30c7, 0x30c7, 0x30c5, 0x1078, 0x1eac, 0x784b,
+ 0x0004, 0x68b4, 0xa085, 0x4000, 0x68b6, 0x7858, 0xa085, 0x4000,
+ 0x785a, 0x7830, 0xa084, 0x0080, 0x00c0, 0x30e3, 0x0018, 0x30e3,
+ 0x681c, 0xa084, 0x0020, 0x00c0, 0x30e1, 0x781b, 0x00df, 0x0078,
+ 0x30e3, 0x781b, 0x00e6, 0x2091, 0x8001, 0x0f7f, 0x007c, 0x0c7e,
+ 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0,
+ 0x3a00, 0x6004, 0xa084, 0x000a, 0x00c0, 0x311a, 0x6108, 0xa194,
+ 0xff00, 0x0040, 0x311a, 0xa18c, 0x00ff, 0x2001, 0x0019, 0xa106,
+ 0x0040, 0x3109, 0x2001, 0x0032, 0xa106, 0x0040, 0x310d, 0x0078,
+ 0x3111, 0x2009, 0x0020, 0x0078, 0x3113, 0x2009, 0x003f, 0x0078,
+ 0x3113, 0x2011, 0x0000, 0x2100, 0xa205, 0x600a, 0x6004, 0xa085,
+ 0x0002, 0x6006, 0x0c7f, 0x007c, 0x781b, 0x0068, 0x0078, 0x1efb,
+ 0x781b, 0x0067, 0x0078, 0x1efb, 0x781b, 0x0056, 0x0078, 0x1efb,
+ 0x781b, 0x0053, 0x0078, 0x1efb, 0x781b, 0x00df, 0x0078, 0x1efb,
+ 0x781b, 0x00de, 0x0078, 0x1efb, 0x781b, 0x00e6, 0x0078, 0x1efb,
+ 0x781b, 0x00e5, 0x0078, 0x1efb, 0x781b, 0x009d, 0x0078, 0x1efb,
+ 0x781b, 0x009c, 0x0078, 0x1efb, 0x6818, 0xa084, 0x8000, 0x0040,
+ 0x314b, 0x681b, 0x001d, 0x70a3, 0x0001, 0x781b, 0x0047, 0x0078,
+ 0x1efb, 0x007e, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3168, 0x7808,
+ 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec,
+ 0xa084, 0x0021, 0x0040, 0x3168, 0x7808, 0xa085, 0x0002, 0x780a,
+ 0x007f, 0x007c, 0x7808, 0xa085, 0x0002, 0x780a, 0x007c, 0x7830,
+ 0xa084, 0x0040, 0x00c0, 0x316f, 0x0098, 0x3178, 0x78ac, 0x007c,
+ 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005,
+ 0x78ec, 0xa084, 0x0021, 0x0040, 0x3187, 0x0098, 0x3185, 0x78ac,
+ 0x007e, 0x7808, 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, 0xa784,
+ 0x0070, 0x0040, 0x319b, 0x0c7e, 0x2d60, 0x2f68, 0x1078, 0x1e57,
+ 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040, 0x31a8, 0x784b,
+ 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x1f03, 0x0078, 0x311c,
+ 0xa784, 0x0004, 0x0040, 0x31db, 0x78b8, 0xa084, 0x4001, 0x0040,
+ 0x31db, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x1f03,
+ 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0, 0x31db, 0x78c0,
+ 0xa685, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00e6, 0x0078, 0x1efb,
+ 0x784b, 0x0008, 0x6818, 0xa084, 0x8000, 0x0040, 0x31d7, 0x681b,
+ 0x0015, 0xa684, 0x4000, 0x0040, 0x31d7, 0x681b, 0x0007, 0x781b,
+ 0x00df, 0x0078, 0x1efb, 0x681b, 0x0003, 0x7858, 0xa084, 0x3f00,
+ 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, 0x78e4,
+ 0xa005, 0x00d0, 0x238a, 0xa084, 0x0020, 0x0040, 0x238a, 0x0018,
+ 0x238a, 0x0078, 0x2f6f, 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003,
+ 0x8003, 0x8003, 0xa080, 0x3a00, 0x2060, 0x2048, 0x704a, 0x6000,
+ 0x704e, 0x6004, 0x7052, 0x2a60, 0x007c, 0x0020, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
+ 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0062,
+ 0x0009, 0x0014, 0x0014, 0x9848, 0x0014, 0x0014, 0x98f9, 0x98e9,
+ 0x0014, 0x0014, 0x0080, 0x00c0, 0x0100, 0x0402, 0x2008, 0xf880,
+ 0x0018, 0xa20a, 0x0014, 0x300b, 0xa20c, 0x0014, 0xa200, 0x8838,
+ 0x3806, 0x8839, 0x28c2, 0x9cc2, 0xa805, 0x0864, 0xa83d, 0x3008,
+ 0x28c1, 0x9cc2, 0xa201, 0x300c, 0x2847, 0x8161, 0x846a, 0x8000,
+ 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, 0x9c9f, 0xa8f3, 0x0864,
+ 0xa82b, 0x300c, 0xa801, 0x3008, 0x28e1, 0x9c9f, 0x280d, 0xa204,
+ 0x64c0, 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677,
+ 0xa80f, 0x786e, 0x883e, 0xa80c, 0x282b, 0xa205, 0x64a0, 0x67a0,
+ 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677, 0xa801, 0x883e,
+ 0x206b, 0x28c1, 0x9cc2, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8dc,
+ 0xa207, 0x2901, 0xa80a, 0x0014, 0xa203, 0x8000, 0x85a4, 0x1872,
+ 0x879a, 0x883c, 0x1fe2, 0xf601, 0xa208, 0x856e, 0x866f, 0x0704,
+ 0x3008, 0x9c9f, 0x0014, 0xa202, 0x8000, 0x85a4, 0x3009, 0x84a8,
+ 0x19e2, 0xf848, 0x8174, 0x86eb, 0x85eb, 0x872e, 0x87a9, 0x883f,
+ 0x08e6, 0xa8f1, 0xf861, 0xa8e8, 0xf801, 0x0014, 0xf881, 0x0016,
+ 0x85b2, 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, 0x8532, 0xf221,
+ 0x0014, 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, 0xa206, 0x6865,
+ 0x817e, 0x842a, 0x1dc1, 0x8823, 0x0016, 0x6042, 0x8008, 0xa8fa,
+ 0x8000, 0x84a4, 0x8160, 0x842a, 0xf021, 0x3008, 0x84a8, 0x11d6,
+ 0x7042, 0x20dd, 0x0011, 0x20d4, 0x8822, 0x0016, 0x8000, 0x2848,
+ 0x1011, 0xa8fc, 0x3008, 0x8000, 0xa000, 0x2802, 0x1011, 0xa8fd,
+ 0xa883, 0x3008, 0x283d, 0x1011, 0xa8fd, 0xa209, 0x0017, 0x300c,
+ 0x8000, 0x85a4, 0x1de2, 0xdac1, 0x0014, 0xd301, 0x0014, 0x26e0,
+ 0x873a, 0xfaa2, 0x19f2, 0x1fe2, 0x0014, 0xa20b, 0x0014, 0xa20d,
+ 0x3806, 0x0210, 0x9ccc, 0x0704, 0x0000, 0x127e, 0x2091, 0x2200,
+ 0x2049, 0x32f5, 0x7000, 0x7204, 0xa205, 0x720c, 0xa215, 0x7008,
+ 0xa084, 0xfff7, 0xa205, 0x0040, 0x3307, 0x1078, 0x3380, 0x127f,
+ 0x2000, 0x007c, 0x6428, 0x84ff, 0x0040, 0x3336, 0x2c70, 0x7004,
+ 0xa0bc, 0x000f, 0xa7b8, 0x3346, 0x273c, 0x87fb, 0x00c0, 0x3324,
+ 0x0048, 0x331c, 0x1078, 0x1eac, 0x609c, 0xa075, 0x0040, 0x3336,
+ 0x0078, 0x330f, 0x2039, 0x333b, 0x2704, 0xae68, 0x6808, 0xa630,
+ 0x680c, 0xa529, 0x8421, 0x0040, 0x3336, 0x8738, 0x2704, 0xa005,
+ 0x00c0, 0x3325, 0x709c, 0xa075, 0x00c0, 0x330f, 0x007c, 0x0000,
+ 0x0005, 0x0009, 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000,
+ 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x333b,
+ 0x3338, 0x0000, 0x0000, 0x8000, 0x0000, 0x333b, 0x0000, 0x3343,
+ 0x3340, 0x0000, 0x0000, 0x0000, 0x0000, 0x3343, 0x0000, 0x333e,
+ 0x333e, 0x0000, 0x0000, 0x8000, 0x0000, 0x333e, 0x0000, 0x3344,
+ 0x3344, 0x0000, 0x0000, 0x0000, 0x0000, 0x3344, 0x127e, 0x2091,
+ 0x2200, 0x2079, 0x3900, 0x2071, 0x0010, 0x7007, 0x000a, 0x7007,
+ 0x0002, 0x7003, 0x0000, 0x2071, 0x0020, 0x7007, 0x000a, 0x7007,
+ 0x0002, 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, 0x2000, 0x007c,
+ 0x2049, 0x3380, 0x2019, 0x0000, 0x7004, 0x8004, 0x00c8, 0x33b2,
+ 0x7007, 0x0012, 0x7108, 0x7008, 0xa106, 0x00c0, 0x338a, 0xa184,
+ 0x01e0, 0x0040, 0x3395, 0x1078, 0x1eac, 0xa184, 0x4000, 0x00c0,
+ 0x338a, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040, 0x33a7, 0xa386,
+ 0x0008, 0x0040, 0x33b2, 0xa386, 0x200c, 0x00c0, 0x338a, 0x7200,
+ 0x8204, 0x0048, 0x33b2, 0x730c, 0xa384, 0x00ff, 0x0040, 0x33b2,
+ 0x1078, 0x1eac, 0x7007, 0x0012, 0x7000, 0xa084, 0x0001, 0x00c0,
+ 0x33c3, 0x7310, 0x7014, 0xa305, 0x0040, 0x33c3, 0x700c, 0xa084,
+ 0x00ff, 0x00c0, 0x3380, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004,
+ 0xa084, 0x0008, 0x00c0, 0x33c7, 0x7007, 0x0012, 0x7108, 0x8103,
+ 0x0048, 0x33cc, 0x7003, 0x0000, 0x2049, 0x0000, 0x007c, 0x107e,
+ 0x007e, 0x127e, 0x157e, 0x2091, 0x2200, 0x7108, 0x1078, 0x33e7,
+ 0x157f, 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, 0x007c, 0x7204,
+ 0x7500, 0x730c, 0xa384, 0x0300, 0x00c0, 0x3426, 0xa184, 0x0060,
+ 0x00c0, 0x3442, 0x7008, 0x7108, 0xa106, 0x00c0, 0x33f2, 0xa184,
+ 0x01e0, 0x00c0, 0x3442, 0xa184, 0x4000, 0x00c0, 0x33f2, 0xa986,
+ 0x362f, 0x00c0, 0x341a, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040,
+ 0x3411, 0xa386, 0x0008, 0x0040, 0x341a, 0xa386, 0x200c, 0x00c0,
+ 0x33f2, 0x7200, 0x8204, 0x0048, 0x341a, 0x730c, 0xa384, 0x00ff,
+ 0x00c0, 0x3426, 0xa184, 0x0007, 0x0079, 0x341e, 0x3428, 0x3436,
+ 0x3426, 0x3436, 0x3426, 0x348f, 0x3426, 0x348d, 0x1078, 0x1eac,
+ 0x7007, 0x0002, 0x8aff, 0x00c0, 0x3431, 0x2049, 0x0000, 0x0078,
+ 0x3435, 0x1078, 0x3606, 0x00c0, 0x3431, 0x007c, 0x7007, 0x0002,
+ 0x8aff, 0x00c0, 0x343d, 0x0078, 0x3441, 0x1078, 0x3606, 0x00c0,
+ 0x343d, 0x007c, 0x7108, 0x7008, 0xa106, 0x00c0, 0x3442, 0xa184,
+ 0x4000, 0x00c0, 0x3442, 0x7007, 0x0012, 0x7108, 0x7008, 0xa106,
+ 0x00c0, 0x344d, 0xa184, 0x4000, 0x00c0, 0x344d, 0x00e0, 0x3456,
+ 0x2091, 0x6000, 0x00e0, 0x345a, 0x2091, 0x6000, 0x7007, 0x0012,
+ 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0, 0x3462, 0x7007,
+ 0x0012, 0x7108, 0x8103, 0x0048, 0x3467, 0x7003, 0x0000, 0x7000,
+ 0xa005, 0x00c0, 0x347b, 0x7004, 0xa005, 0x00c0, 0x347b, 0x700c,
+ 0xa005, 0x0040, 0x347d, 0x0078, 0x345e, 0x2049, 0x0000, 0x1078,
+ 0x30b3, 0x6818, 0xa084, 0x8000, 0x0040, 0x3488, 0x681b, 0x0002,
+ 0x007c, 0x1078, 0x1eac, 0x1078, 0x1eac, 0x1078, 0x34ed, 0x7210,
+ 0x7114, 0x700c, 0xa09c, 0x00ff, 0x2800, 0xa300, 0xa211, 0xa189,
+ 0x0000, 0x1078, 0x34ed, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200,
+ 0xa322, 0x630c, 0x2100, 0xa31b, 0x2400, 0xa305, 0x0040, 0x34b2,
+ 0x00c8, 0x34b2, 0x8412, 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60,
+ 0x0078, 0x3499, 0x2b60, 0x8a07, 0x007e, 0x6004, 0xa084, 0x0008,
+ 0x0040, 0x34be, 0xa7ba, 0x3340, 0x0078, 0x34c0, 0xa7ba, 0x3338,
+ 0x007f, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92, 0x6b8e, 0x1078,
+ 0x3380, 0x007c, 0x8738, 0x2704, 0xa005, 0x00c0, 0x34dd, 0x609c,
+ 0xa005, 0x0040, 0x34ea, 0x2060, 0x6004, 0xa084, 0x000f, 0xa080,
+ 0x3346, 0x203c, 0x87fb, 0x1040, 0x1eac, 0x8a51, 0x0040, 0x34e9,
+ 0x7008, 0x7508, 0xa52e, 0x00c0, 0x34e0, 0xa084, 0x0003, 0xa086,
+ 0x0003, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, 0x8739, 0x2704,
+ 0xa004, 0x00c0, 0x3501, 0x6000, 0xa064, 0x00c0, 0x34f8, 0x2d60,
+ 0x6004, 0xa084, 0x000f, 0xa080, 0x3356, 0x203c, 0x87fb, 0x1040,
+ 0x1eac, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x6884,
+ 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, 0xaad4, 0x00ff, 0xa084,
+ 0x00ff, 0x007e, 0x6804, 0xa084, 0x0008, 0x007f, 0x0040, 0x351c,
+ 0xa0b8, 0x3340, 0x0078, 0x351e, 0xa0b8, 0x3338, 0x7e08, 0xa6b5,
+ 0x000c, 0x681c, 0xa084, 0x0040, 0x0040, 0x3528, 0xa6b5, 0x0001,
+ 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x352a, 0x2400,
+ 0xa305, 0x00c0, 0x3535, 0x0078, 0x3559, 0x2c58, 0x2704, 0x6104,
+ 0xac60, 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 0xa184,
+ 0x0008, 0x0040, 0x3549, 0x6010, 0xa001, 0x7022, 0x6014, 0xa001,
+ 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 0xa203,
+ 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078, 0x34ca, 0x0078,
+ 0x355b, 0x1078, 0x3606, 0x00c0, 0x3559, 0x127f, 0x2000, 0x007c,
+ 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x7007, 0x0004, 0x7004,
+ 0xa084, 0x0004, 0x00c0, 0x3567, 0x7003, 0x0008, 0x127f, 0x2000,
+ 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x3571,
+ 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x357a, 0x7e08,
+ 0xa6b5, 0x000c, 0x681c, 0xa084, 0x0020, 0x00c0, 0x3589, 0xa6b5,
+ 0x0001, 0x6828, 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8,
+ 0x3346, 0x273c, 0x87fb, 0x00c0, 0x359f, 0x0048, 0x3599, 0x1078,
+ 0x1eac, 0x689c, 0xa065, 0x0040, 0x35a3, 0x0078, 0x358c, 0x1078,
+ 0x3606, 0x00c0, 0x359f, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e,
+ 0x017e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x037f, 0x047f, 0x7e08,
+ 0xa6b5, 0x000c, 0x681c, 0xa084, 0x0040, 0x0040, 0x35b9, 0xa6b5,
+ 0x0001, 0x2049, 0x35a6, 0x6828, 0xa055, 0x0040, 0x3603, 0x2d70,
+ 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x3346, 0x273c, 0x87fb,
+ 0x00c0, 0x35d5, 0x0048, 0x35ce, 0x1078, 0x1eac, 0x709c, 0xa075,
+ 0x2060, 0x0040, 0x3603, 0x0078, 0x35c1, 0x2704, 0xae68, 0x6808,
+ 0xa422, 0x680c, 0xa31b, 0x0048, 0x35f0, 0x8a51, 0x00c0, 0x35e2,
+ 0x1078, 0x1eac, 0x8738, 0x2704, 0xa005, 0x00c0, 0x35d6, 0x709c,
+ 0xa075, 0x2060, 0x0040, 0x3603, 0x2039, 0x3338, 0x0078, 0x35c1,
+ 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x6908, 0x2400, 0xa122,
+ 0x690c, 0x2300, 0xa11b, 0x00c8, 0x35ff, 0x1078, 0x1eac, 0x2071,
+ 0x0020, 0x0078, 0x3528, 0x127f, 0x2000, 0x007c, 0x7008, 0x7508,
+ 0xa52e, 0x00c0, 0x3606, 0xa084, 0x0003, 0xa086, 0x0003, 0x0040,
+ 0x362e, 0x2704, 0xac08, 0x2104, 0x701a, 0x8108, 0x2104, 0x701e,
+ 0x8108, 0x2104, 0x7012, 0x8108, 0x2104, 0x7016, 0x6004, 0xa084,
+ 0x0008, 0x0040, 0x3629, 0x8108, 0x2104, 0x7022, 0x8108, 0x2104,
+ 0x7026, 0x7602, 0x7007, 0x0001, 0x1078, 0x34ca, 0x007c, 0x127e,
+ 0x007e, 0x0d7e, 0x2091, 0x2200, 0x2049, 0x362f, 0x0d7f, 0x087f,
+ 0x7108, 0x7008, 0xa106, 0x00c0, 0x3638, 0xa184, 0x4000, 0x00c0,
+ 0x3638, 0xa184, 0x0003, 0x00c0, 0x364f, 0x6828, 0xa005, 0x0040,
+ 0x365d, 0x0020, 0x364f, 0x1078, 0x348f, 0x0078, 0x365d, 0x00a0,
+ 0x3656, 0x7108, 0x1078, 0x33e7, 0x0078, 0x3638, 0x7007, 0x0010,
+ 0x00a0, 0x3658, 0x7108, 0x1078, 0x33e7, 0x7008, 0xa086, 0x0008,
+ 0x00c0, 0x3638, 0x7000, 0xa005, 0x00c0, 0x3638, 0x2049, 0x0000,
+ 0x127f, 0x2000, 0x007c, 0x127e, 0x147e, 0x137e, 0x157e, 0x0d7e,
+ 0x2091, 0x2200, 0x0d7f, 0x2049, 0x366b, 0xad80, 0x0011, 0x20a0,
+ 0x2099, 0x0031, 0x700c, 0xa084, 0x00ff, 0x682a, 0x7007, 0x0008,
+ 0x7007, 0x0002, 0x7003, 0x0001, 0x0040, 0x3689, 0x8000, 0x80ac,
+ 0x53a5, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x368b,
+ 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f, 0x147f, 0x127f,
+ 0x2000, 0x007c, 0x2091, 0x6000, 0x78c0, 0xa005, 0x0040, 0x36af,
+ 0x798c, 0x70d0, 0xa106, 0x00c0, 0x36af, 0x7804, 0xa005, 0x0040,
+ 0x36af, 0x7807, 0x0000, 0x0068, 0x36af, 0x2091, 0x4080, 0x7820,
+ 0x8001, 0x7822, 0x00c0, 0x370f, 0x7824, 0x7822, 0x2091, 0x8000,
+ 0x78f0, 0xa005, 0x0040, 0x36dc, 0x78d4, 0xa005, 0x00c0, 0x36dc,
+ 0x3a10, 0xa284, 0x0002, 0x00c0, 0x36cc, 0x78d7, 0x0007, 0x2009,
+ 0xff01, 0x200a, 0x0078, 0x36dc, 0xa284, 0x0001, 0x00c0, 0x36d4,
+ 0x78ef, 0x0000, 0x0078, 0x36dc, 0x78ec, 0xa005, 0x00c0, 0x36dc,
+ 0x78d7, 0x0008, 0x78ef, 0x0001, 0x2069, 0x3940, 0x6800, 0xa084,
+ 0x0007, 0x0040, 0x36f3, 0xa086, 0x0002, 0x0040, 0x36f3, 0x6830,
+ 0xa00d, 0x0040, 0x36f3, 0x2104, 0xa005, 0x0040, 0x36f3, 0x8001,
+ 0x200a, 0x0040, 0x37b1, 0x7848, 0xa005, 0x0040, 0x3703, 0x8001,
+ 0x784a, 0x00c0, 0x3703, 0x0f7e, 0x2079, 0x0100, 0x1078, 0x316a,
+ 0x0f7f, 0x1078, 0x1cf6, 0x68c4, 0xa005, 0x0040, 0x370f, 0x8001,
+ 0x68c6, 0x00c0, 0x370f, 0x68a3, 0x0000, 0x68a7, 0x0001, 0x1078,
+ 0x3716, 0x1078, 0x373b, 0x2091, 0x8001, 0x007c, 0x7834, 0x8001,
+ 0x7836, 0x00c0, 0x373a, 0x7838, 0x7836, 0x2091, 0x8000, 0x7844,
+ 0xa005, 0x00c0, 0x3725, 0x2001, 0x0101, 0x8001, 0x7846, 0xa080,
+ 0x4280, 0x2040, 0x2004, 0xa065, 0x0040, 0x373a, 0x6024, 0xa005,
+ 0x0040, 0x3736, 0x8001, 0x6026, 0x0040, 0x376a, 0x6000, 0x2c40,
+ 0x0078, 0x372b, 0x007c, 0x7828, 0x8001, 0x782a, 0x00c0, 0x3769,
+ 0x782c, 0x782a, 0x7830, 0xa005, 0x00c0, 0x3748, 0x2001, 0x0080,
+ 0x8001, 0x7832, 0x8003, 0x8003, 0x8003, 0x8003, 0xa090, 0x3a80,
+ 0xa298, 0x0002, 0x2304, 0xa084, 0x0008, 0x0040, 0x3769, 0xa290,
+ 0x0009, 0x2204, 0xa005, 0x0040, 0x3761, 0x8001, 0x2012, 0x00c0,
+ 0x3769, 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080, 0x201a, 0x1078,
+ 0x1cf6, 0x007c, 0x2069, 0x3940, 0x6800, 0xa005, 0x0040, 0x3774,
+ 0x683c, 0xac06, 0x0040, 0x37b1, 0x601b, 0x0006, 0x60b4, 0xa084,
+ 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0060, 0x6022,
+ 0x6000, 0x2042, 0x6714, 0x6fb6, 0x1078, 0x18b4, 0x6818, 0xa005,
+ 0x0040, 0x378c, 0x8001, 0x681a, 0x6808, 0xa084, 0xffef, 0x680a,
+ 0x6810, 0x8001, 0x00d0, 0x3796, 0x1078, 0x1eac, 0x6812, 0x602f,
+ 0x0000, 0x6033, 0x0000, 0x2c68, 0x1078, 0x1a26, 0x2069, 0x3940,
+ 0x2001, 0x0006, 0x68a2, 0x7944, 0xa184, 0x0100, 0x00c0, 0x37ac,
+ 0x69ba, 0x2001, 0x0004, 0x68a2, 0x1078, 0x1cf1, 0x2091, 0x8001,
+ 0x007c, 0x2009, 0x394f, 0x2164, 0x2069, 0x0100, 0x1078, 0x1e57,
+ 0x601b, 0x0006, 0x6858, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084,
+ 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 0x0000,
+ 0x6830, 0xa084, 0x0040, 0x0040, 0x37ed, 0x684b, 0x0004, 0x20a9,
+ 0x0014, 0x6848, 0xa084, 0x0004, 0x0040, 0x37da, 0x0070, 0x37da,
+ 0x0078, 0x37d1, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084,
+ 0x0001, 0x0040, 0x37e7, 0x0070, 0x37e7, 0x0078, 0x37de, 0x20a9,
+ 0x00fa, 0x0070, 0x37ed, 0x0078, 0x37e9, 0x6808, 0xa084, 0xfffd,
+ 0x680a, 0x681b, 0x0047, 0x2009, 0x3968, 0x200b, 0x0007, 0x784c,
+ 0x784a, 0x2091, 0x8001, 0x007c, 0x2079, 0x3900, 0x1078, 0x3827,
+ 0x1078, 0x380b, 0x1078, 0x3819, 0x7833, 0x0000, 0x7847, 0x0000,
+ 0x784b, 0x0000, 0x007c, 0x2019, 0x000c, 0x2011, 0x3946, 0x2204,
+ 0xa086, 0x003c, 0x0040, 0x3816, 0x2019, 0x0008, 0x7b2a, 0x7b2e,
+ 0x007c, 0x2019, 0x0039, 0x2011, 0x3946, 0x2204, 0xa086, 0x003c,
+ 0x0040, 0x3824, 0x2019, 0x0027, 0x7b36, 0x7b3a, 0x007c, 0x2019,
+ 0x3971, 0x2011, 0x3946, 0x2204, 0xa086, 0x003c, 0x0040, 0x3832,
+ 0x2019, 0x2626, 0x7b22, 0x7b26, 0x783f, 0x0000, 0x7843, 0x000a,
+ 0x007c, 0x8e59
+};
+#define ISP_CODE_LENGTH 0x283a
+#endif
+/*
+ * Firmware Version 7.55.00 (16:16 Mar 20, 1998)
+ */
+
#define ISP_CODE_VERSION 7*1024+55
static const u_int16_t ISP_RISC_CODE[] = {
0x0078, 0x103a, 0x0000, 0x3cd2, 0x0000, 0x2043, 0x4f50, 0x5952,
@@ -1960,6166 +3261,5933 @@ static const u_int16_t ISP_RISC_CODE[] = {
};
#define ISP_CODE_LENGTH 0x3cd2
-/*
- * We now only support 1.15.07 version F/W with some various flavors
- *
- * ISP2100_FABRIC provides Fabric Login support
- * ISP2100_SCCLUN provides 16 bits worth of lun.
- *
- * As of 11/24/98 neither Fabric nor SCCLUN have been extensively tested.
- */
#define ISP2100_CODE_ORG 0x1000
-#define ISP2100_CODE_VERSION 1*1024+15
-/* #define ISP2100_FABRIC 1 */
-/* #define ISP2100_SCCLUN 1 */
-
-#if !defined(ISP2100_FABRIC) && !defined(ISP2100_SCCLUN)
/************************************************************************
* *
- * --- ISP2100 Initiator/Target Firmware --- *
+ * --- ISP2100 Fabric Initiator/Target Firmware --- *
* *
* *
- ************************************************************************
- * *
- * NOTICE *
- * *
- * COPYRIGHT 1998 QLOGIC CORPORATION *
- * ALL RIGHTS RESERVED *
- * *
- * This computer program is CONFIDENTIAL and contains TRADE SECRETS of *
- * QLOGIC CORPORATION. The receipt or possession of this program does *
- * not convey any rights to reproduce or disclose its contents, or to *
- * manufacture, use, or sell anything that it may describe, in whole or *
- * in part, without the specific written consent of QLOGIC CORPORATION. *
- * Any reproduction of this program without the express written consent *
- * of QLOGIC CORPORATION is a violation of the copyright laws and may *
- * subject you to civil liability and criminal prosecution. *
- * *
- ************************************************************************
- */
+ ************************************************************************/
+#if 0
/*
- * Firmware Version 1.15.07 (14:43 Oct 13, 1998)
+ * Firmware Version 1.13.00 (18:04 May 04, 1998)
*/
-
+#define ISP2100_CODE_VERSION 1*1024+13
static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x5e69, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x0078, 0x1029, 0x0000, 0x5c95, 0x0000, 0x2043, 0x4f50, 0x5952,
0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
- 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6e69, 0x2009, 0x0000, 0x20a9,
- 0x0697, 0x41a4, 0x3400, 0x20c9, 0x72ff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1ff1, 0x2051, 0x6f00,
- 0x2a70, 0x705b, 0x8d00, 0x705f, 0xffff, 0x7057, 0x8cf9, 0x7063,
- 0x0300, 0x1078, 0x1235, 0x20a1, 0x7500, 0x715c, 0x810d, 0x810d,
+ 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3133, 0x2020, 0x2020,
+ 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6c95, 0x2009, 0x0000, 0x20a9,
+ 0x076b, 0x41a4, 0x3400, 0x20c9, 0x71ff, 0x2091, 0x2000, 0x2059,
+ 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1e36, 0x2051, 0x6d00,
+ 0x2a70, 0x705b, 0x8c00, 0x705f, 0xffff, 0x7057, 0x8bf9, 0x7063,
+ 0x0300, 0x1078, 0x1264, 0x20a1, 0x7400, 0x715c, 0x810d, 0x810d,
0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1200, 0x1078, 0x1321, 0x1078, 0x14a6, 0x1078, 0x192f,
- 0x1078, 0x32c3, 0x1078, 0x5567, 0x1078, 0x12ac, 0x1078, 0x22f7,
- 0x1078, 0x38fc, 0x1078, 0x36d4, 0x1078, 0x40ad, 0x1078, 0x1dbe,
- 0x1078, 0x42ec, 0x1078, 0x3e1a, 0x1078, 0x1cdd, 0x1078, 0x1d9d,
+ 0x1078, 0x122b, 0x1078, 0x134e, 0x1078, 0x14d3, 0x1078, 0x17d7,
+ 0x1078, 0x324a, 0x1078, 0x54fc, 0x1078, 0x12d9, 0x1078, 0x2191,
+ 0x1078, 0x3875, 0x1078, 0x3655, 0x1078, 0x4064, 0x1078, 0x1c35,
+ 0x1078, 0x4213, 0x1078, 0x3d73, 0x1078, 0x1b5d, 0x1078, 0x1c14,
0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2a3b, 0x1078, 0x231f, 0x1078, 0x394c,
- 0x1078, 0x37bf, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x40c5, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5239, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x112a,
- 0x10cd, 0x117d, 0x11fd, 0x11fe, 0x11ff, 0x1078, 0x1288, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2b5e, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x1127, 0x2011, 0x31f0, 0x1078, 0x4187,
+ 0x00c0, 0x10bd, 0x1078, 0x2a96, 0x1078, 0x21b9, 0x1078, 0x38c5,
+ 0x1078, 0x373c, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
+ 0x10c1, 0x1078, 0x4078, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
+ 0x10aa, 0x1078, 0x52d8, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x1151,
+ 0x10cd, 0x11aa, 0x1228, 0x1229, 0x122a, 0x1078, 0x12b7, 0x007c,
+ 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2aec, 0x2079, 0x0100,
+ 0x7844, 0xa005, 0x00c0, 0x1142, 0x2011, 0x318e, 0x1078, 0x40d1,
0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b0, 0x1078, 0x29fa, 0x1078, 0x5084, 0x2011, 0x0004, 0x1078,
- 0x622b, 0x1078, 0x366e, 0x2079, 0x6f51, 0x7804, 0xd0ac, 0x00c0,
- 0x1115, 0x2011, 0x0001, 0x1078, 0x622b, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x20a1, 0x2011, 0x0005,
- 0x1078, 0x5193, 0x1078, 0x4893, 0x0c7e, 0x2061, 0x0100, 0x60e3,
- 0x0008, 0x0c7f, 0x127f, 0x0078, 0x1129, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x5193, 0x1078,
- 0x4893, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f,
- 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff,
- 0x0040, 0x1138, 0x1078, 0x20a1, 0x1078, 0x4893, 0x0078, 0x117b,
- 0x7080, 0xa005, 0x00c0, 0x117b, 0x2001, 0x6f52, 0x2004, 0xd0ac,
- 0x0040, 0x115e, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x017e, 0x1078, 0x34cb, 0x00c0, 0x1151, 0x6000, 0xd0ec, 0x00c0,
- 0x1159, 0x017f, 0x8108, 0x00f0, 0x1148, 0x0c7f, 0x157f, 0x0078,
- 0x115e, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x117b, 0x7003, 0x0003,
- 0x7087, 0xffff, 0x2001, 0x0000, 0x1078, 0x1f8a, 0x1078, 0x2a74,
- 0x2001, 0x70b7, 0x2004, 0xa086, 0x0005, 0x00c0, 0x1173, 0x2011,
- 0x0000, 0x1078, 0x5193, 0x2011, 0x0000, 0x1078, 0x519d, 0x1078,
- 0x4893, 0x1078, 0x4943, 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010, 0x7942,
- 0x7924, 0xd1b4, 0x0040, 0x118e, 0x7827, 0x0040, 0xd19c, 0x0040,
- 0x1193, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900, 0xa18a,
- 0x0003, 0x0050, 0x11b9, 0x7954, 0xd1ac, 0x00c0, 0x11b9, 0x2009,
- 0x00f8, 0x1078, 0x3292, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
- 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11b1, 0x7824, 0xd0ac, 0x00c0,
- 0x11ed, 0x00f0, 0x11a9, 0x2001, 0x0001, 0x1078, 0x1f8a, 0x0078,
- 0x11f6, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008, 0x00e0,
- 0x11bf, 0x2091, 0x6000, 0x00f0, 0x11bf, 0x7853, 0x0400, 0x782f,
- 0x0000, 0x2009, 0x00f8, 0x1078, 0x3292, 0x20a9, 0x000e, 0x0005,
- 0x00f0, 0x11cf, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x11e4,
- 0x7824, 0xd0ac, 0x00c0, 0x11ed, 0x8319, 0x00c0, 0x11da, 0x2001,
- 0x0001, 0x1078, 0x1f8a, 0x0078, 0x11f4, 0x7828, 0xc09d, 0x782a,
- 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f, 0x037f,
- 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x120c,
- 0x704f, 0xffff, 0x0078, 0x120e, 0x704f, 0x0000, 0x7053, 0xffff,
- 0x2061, 0x70a0, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800,
- 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000,
- 0x601f, 0x07d0, 0x2061, 0x70a8, 0x6003, 0x8000, 0x6007, 0x0000,
- 0x600b, 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000,
- 0x601b, 0x0001, 0x601f, 0x0000, 0x007c, 0x1078, 0x125b, 0x2011,
- 0x0000, 0x81ff, 0x0040, 0x125a, 0xa186, 0x0001, 0x00c0, 0x124a,
- 0x705f, 0x8fff, 0x7057, 0x7d01, 0x7063, 0x0100, 0x705b, 0x7d00,
- 0x0078, 0x1258, 0xa186, 0x0002, 0x00c0, 0x1252, 0x2011, 0x0000,
- 0x0078, 0x1258, 0xa186, 0x0005, 0x00c0, 0x1258, 0x2011, 0x0001,
- 0x1078, 0x1282, 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078,
- 0x1282, 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061,
- 0x7fff, 0x2c04, 0xa406, 0x0040, 0x1270, 0xc18d, 0x0078, 0x127d,
- 0xc185, 0x2011, 0x0001, 0x1078, 0x1282, 0x2061, 0xffff, 0x2362,
- 0x2c04, 0xa306, 0x00c0, 0x127d, 0xc195, 0x2011, 0x0001, 0x1078,
- 0x1282, 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c,
- 0x2091, 0x8000, 0x0068, 0x128a, 0x007e, 0x017e, 0x2079, 0x0000,
- 0x7818, 0xa084, 0x0000, 0x00c0, 0x1290, 0x017f, 0x792e, 0x007f,
- 0x782a, 0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b,
- 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0x6f00, 0x7803,
- 0x0005, 0x0078, 0x12a9, 0x007c, 0x2071, 0x6f00, 0x7158, 0x712e,
- 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12c2,
- 0x705c, 0xa302, 0x00c8, 0x12c2, 0x220a, 0x2208, 0x2310, 0x8420,
- 0x0078, 0x12b4, 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x6f00, 0x7098, 0xa0ea, 0x0010,
- 0x00c8, 0x12d5, 0xa06e, 0x0078, 0x12df, 0x8001, 0x709a, 0x702c,
- 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f,
- 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x127e, 0x2091, 0x8000,
- 0x7098, 0x8001, 0x00c8, 0x12ef, 0xa06e, 0x0078, 0x12f8, 0x709a,
- 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000,
- 0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x6f00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a,
- 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x1317, 0x6804, 0x6807,
- 0x0000, 0x007e, 0x1078, 0x12fb, 0x0d7f, 0x0078, 0x130b, 0x007c,
- 0x0e7e, 0x2071, 0x6f00, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x70d9, 0x7007, 0x0000, 0x701b, 0x0000,
- 0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012,
- 0x0e7f, 0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x70d9,
- 0x7018, 0xa088, 0x70e2, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a,
- 0x7004, 0xa005, 0x00c0, 0x134a, 0x0f7e, 0x2079, 0x0010, 0x1078,
- 0x135b, 0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x70d9, 0x7004,
- 0xa005, 0x00c0, 0x1359, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x135b,
- 0x0f7f, 0x0e7f, 0x007c, 0x7000, 0x0079, 0x135e, 0x1362, 0x13cc,
- 0x13e9, 0x13e9, 0x7018, 0x711c, 0xa106, 0x00c0, 0x136a, 0x7007,
- 0x0000, 0x007c, 0x0d7e, 0xa180, 0x70e2, 0x2004, 0x700a, 0x2068,
- 0x8108, 0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832,
- 0x6828, 0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e,
- 0x680c, 0x7016, 0x6804, 0x0d7f, 0xd084, 0x0040, 0x138c, 0x7007,
- 0x0001, 0x1078, 0x1391, 0x007c, 0x7007, 0x0002, 0x1078, 0x13a7,
- 0x007c, 0x017e, 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040,
- 0x00c8, 0x139c, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822,
- 0x7803, 0x0020, 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e,
- 0x027e, 0x137e, 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014,
- 0x7803, 0x0026, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8,
- 0x13bb, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822,
- 0x7803, 0x0020, 0x7803, 0x0001, 0x3300, 0x7016, 0x157f, 0x147f,
- 0x137f, 0x027f, 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099,
- 0x6fe5, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
- 0x127e, 0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000,
- 0xc084, 0x7002, 0x700b, 0x6fe0, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x7014, 0x209c, 0x20a1,
- 0x0014, 0x7803, 0x0026, 0x2001, 0x7015, 0x20ac, 0x53a6, 0x2099,
- 0x7016, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
- 0x127e, 0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000,
- 0xc08c, 0x7002, 0x700b, 0x7011, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x017e, 0x0e7e, 0x2071, 0x70d9, 0x0f7e, 0x2079, 0x0010,
- 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0040, 0x142c, 0xa18c, 0x0700,
- 0x0040, 0x1429, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078,
- 0x142c, 0x7004, 0x1079, 0x1430, 0x0f7f, 0x0e7f, 0x017f, 0x007c,
- 0x135b, 0x1438, 0x145a, 0x1474, 0x149d, 0x1436, 0x0078, 0x1436,
- 0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803,
- 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f,
- 0x137f, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x1391, 0x007c,
- 0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078,
- 0x135b, 0x007c, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x13a7,
- 0x007c, 0x0d7e, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a,
- 0x7838, 0x682e, 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007,
- 0x0000, 0x1078, 0x135b, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001,
- 0x6fe3, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803,
- 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0x6fe5, 0x2004, 0xd0bc,
- 0x0040, 0x1493, 0x2001, 0x6fee, 0x2004, 0xa080, 0x000d, 0x20a0,
- 0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007, 0x0000,
- 0x1078, 0x39f5, 0x1078, 0x135b, 0x007c, 0x2001, 0x7013, 0x2003,
- 0x0100, 0x7007, 0x0000, 0x1078, 0x135b, 0x007c, 0x127e, 0x2091,
- 0x2100, 0x2079, 0x0030, 0x2071, 0x70ea, 0x7003, 0x0000, 0x700f,
- 0x70f0, 0x7013, 0x70f0, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x14bc, 0x14c4, 0x150a, 0x14c4, 0x14c4,
- 0x14c4, 0x14ef, 0x14d3, 0x14c8, 0xa085, 0x0001, 0x0078, 0x1524,
- 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c, 0x682a,
- 0x6858, 0x0078, 0x1512, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0,
- 0x14c4, 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c,
- 0x682a, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0x6858, 0x0078, 0x151a, 0xa18c,
- 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14c4, 0x684c, 0xd0ac, 0x0040,
- 0x14c4, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858,
- 0x0078, 0x151a, 0x684c, 0xd0ac, 0x0040, 0x14c4, 0xa006, 0x682e,
- 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1beb, 0x210c, 0x6932,
- 0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1,
- 0x2000, 0x2001, 0x020a, 0x2004, 0x82ff, 0x0040, 0x153f, 0xa280,
- 0x0004, 0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x153b, 0x1078,
- 0x14b7, 0x10c0, 0x1288, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e,
- 0x047e, 0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f,
- 0x7000, 0xa005, 0x00c0, 0x1553, 0x7206, 0x2001, 0x1567, 0x007e,
- 0x2260, 0x0078, 0x167f, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108,
- 0x240a, 0x8108, 0xa182, 0x710b, 0x0048, 0x1560, 0x2009, 0x70f0,
- 0x710e, 0x7000, 0xa005, 0x00c0, 0x1567, 0x1078, 0x1668, 0x127f,
- 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100,
- 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110,
- 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x15bb, 0x6808, 0xa005,
- 0x0040, 0x1621, 0x7000, 0xa005, 0x00c0, 0x1588, 0x0078, 0x15b5,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1625, 0x7004, 0xa406, 0x00c0,
- 0x15b5, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x159e, 0x047e,
- 0x1078, 0x1737, 0x047f, 0x2460, 0x0078, 0x157e, 0x2001, 0x0207,
- 0x2004, 0xd09c, 0x00c0, 0x1591, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x15af, 0xa086, 0x6000, 0x0040, 0x15af, 0x0078, 0x1591, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x55fc, 0x0078, 0x1625, 0x6808, 0xa005, 0x0040, 0x1621, 0x7000,
- 0xa005, 0x00c0, 0x15c5, 0x0078, 0x1621, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x15ce, 0x7004, 0xa406, 0x00c0, 0x1621, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15db, 0x047e, 0x1078, 0x1737, 0x047f,
- 0x2460, 0x0078, 0x15bb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15ce, 0x2001, 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15d4, 0x7804,
- 0xa084, 0x6000, 0x0040, 0x15f2, 0xa086, 0x6000, 0x0040, 0x15f2,
- 0x0078, 0x15ce, 0x7007, 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e,
- 0x0001, 0x0040, 0x1613, 0xa08e, 0x0002, 0x00c0, 0x1621, 0x0c7e,
- 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1bc0, 0x2804, 0xac70, 0x6034,
- 0xd09c, 0x00c0, 0x160f, 0x7308, 0x720c, 0x0078, 0x1611, 0x7310,
- 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211, 0x6810,
- 0xa300, 0x6812, 0x6814, 0xa201, 0x6816, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x2009, 0x0048, 0x1078, 0x55fc, 0x0c7f, 0x0d7f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x70ea, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1665, 0x7004, 0xac06, 0x00c0, 0x1656, 0x2079, 0x0030,
- 0x7804, 0xd0fc, 0x00c0, 0x1652, 0x2001, 0x0207, 0x2004, 0xd09c,
- 0x00c0, 0x1638, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1644,
- 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, 0x0000,
- 0x0078, 0x1656, 0x1078, 0x1737, 0x0078, 0x162d, 0x157e, 0x20a9,
- 0x0009, 0x2009, 0x70f0, 0x2104, 0xac06, 0x00c0, 0x1660, 0x200a,
- 0xa188, 0x0003, 0x00f0, 0x165b, 0x157f, 0x0e7f, 0x0f7f, 0x007c,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1670, 0x7003, 0x0000, 0x007c,
+ 0x73b8, 0x1078, 0x2a53, 0x1078, 0x5129, 0x2011, 0x0004, 0x1078,
+ 0x6135, 0x1078, 0x35ef, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3,
+ 0x0000, 0x1078, 0x1145, 0x2011, 0x0000, 0x2079, 0x6d51, 0x7804,
+ 0xd0ac, 0x0040, 0x1104, 0xc295, 0x70a4, 0xa005, 0x0040, 0x1109,
+ 0xc29d, 0x72be, 0xa296, 0x0004, 0x0040, 0x112a, 0x2011, 0x0001,
+ 0x1078, 0x6135, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
+ 0x0f7f, 0x1078, 0x1ee6, 0x2011, 0x0005, 0x1078, 0x5232, 0x1078,
+ 0x476a, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f,
+ 0x0078, 0x1144, 0x7003, 0x0003, 0x2001, 0x0000, 0x1078, 0x1dc9,
+ 0x2011, 0x0000, 0x1078, 0x5232, 0x2011, 0x0000, 0x1078, 0x523c,
+ 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x1078, 0x476a,
+ 0x1078, 0x4821, 0x0f7f, 0x127f, 0x007c, 0x0c7e, 0x20a9, 0x0082,
+ 0x2009, 0x007e, 0x1078, 0x342f, 0x8108, 0x00f0, 0x114a, 0x0c7f,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086, 0xffff, 0x0040,
+ 0x115f, 0x1078, 0x1ee6, 0x1078, 0x476a, 0x0078, 0x11a8, 0x70bc,
+ 0xd09c, 0x0040, 0x1187, 0xd084, 0x0040, 0x1187, 0x0f7e, 0x2079,
+ 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c, 0x0040, 0x1187,
+ 0x70c0, 0xa086, 0xffff, 0x0040, 0x1183, 0x1078, 0x1fdb, 0x1078,
+ 0x476a, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078, 0x2013, 0x1078,
+ 0x476a, 0x0078, 0x11a8, 0x70c4, 0xa005, 0x00c0, 0x11a8, 0x7088,
+ 0xa005, 0x00c0, 0x11a8, 0x7003, 0x0003, 0x708f, 0xffff, 0x2001,
+ 0x0000, 0x1078, 0x1dc9, 0x1078, 0x2ad1, 0x2001, 0x6f11, 0x2004,
+ 0xa086, 0x0005, 0x00c0, 0x11a0, 0x2011, 0x0000, 0x1078, 0x5232,
+ 0x2011, 0x0000, 0x1078, 0x523c, 0x1078, 0x476a, 0x1078, 0x4821,
+ 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079,
+ 0x0100, 0x7843, 0x0000, 0x7924, 0xd1b4, 0x0040, 0x11b9, 0x7827,
+ 0x0040, 0xd19c, 0x0040, 0x11be, 0x7827, 0x0008, 0x007e, 0x037e,
+ 0x157e, 0x7900, 0xa18a, 0x0003, 0x0050, 0x11e4, 0x7954, 0xd1ac,
+ 0x00c0, 0x11e4, 0x2009, 0x00f8, 0x1078, 0x3233, 0x7843, 0x0090,
+ 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11dc,
+ 0x7824, 0xd0ac, 0x00c0, 0x1218, 0x00f0, 0x11d4, 0x2001, 0x0001,
+ 0x1078, 0x1dc9, 0x0078, 0x1221, 0x7853, 0x0000, 0x782f, 0x0020,
+ 0x20a9, 0x0008, 0x00e0, 0x11ea, 0x2091, 0x6000, 0x00f0, 0x11ea,
+ 0x7853, 0x0400, 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x3233,
+ 0x20a9, 0x000e, 0x0005, 0x00f0, 0x11fa, 0x7853, 0x1400, 0x7843,
+ 0x0090, 0x7843, 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005,
+ 0xd08c, 0x0040, 0x120f, 0x7824, 0xd0ac, 0x00c0, 0x1218, 0x8319,
+ 0x00c0, 0x1205, 0x2001, 0x0001, 0x1078, 0x1dc9, 0x0078, 0x121f,
+ 0x7828, 0xc09d, 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853,
+ 0x0400, 0x157f, 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c,
+ 0x007c, 0x007c, 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082,
+ 0x0002, 0x0048, 0x1237, 0x704f, 0xffff, 0x0078, 0x1239, 0x704f,
+ 0x0000, 0x7053, 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061,
+ 0x6f00, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f,
+ 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f,
+ 0x07d0, 0x2061, 0x6f08, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b,
+ 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b,
+ 0x0001, 0x601f, 0x0000, 0x007c, 0x1078, 0x128a, 0x2011, 0x0000,
+ 0x81ff, 0x0040, 0x1289, 0xa186, 0x0001, 0x00c0, 0x1279, 0x705f,
+ 0x8fff, 0x7057, 0x7c01, 0x7063, 0x0100, 0x705b, 0x7c00, 0x0078,
+ 0x1287, 0xa186, 0x0002, 0x00c0, 0x1281, 0x2011, 0x0000, 0x0078,
+ 0x1287, 0xa186, 0x0005, 0x00c0, 0x1287, 0x2011, 0x0001, 0x1078,
+ 0x12b1, 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12b1,
+ 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff,
+ 0x2c04, 0xa406, 0x0040, 0x129f, 0xc18d, 0x0078, 0x12ac, 0xc185,
+ 0x2011, 0x0001, 0x1078, 0x12b1, 0x2061, 0xffff, 0x2362, 0x2c04,
+ 0xa306, 0x00c0, 0x12ac, 0xc195, 0x2011, 0x0001, 0x1078, 0x12b1,
+ 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091,
+ 0x8000, 0x0068, 0x12b9, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818,
+ 0xa084, 0x0000, 0x00c0, 0x12bf, 0x017f, 0x792e, 0x007f, 0x782a,
+ 0x007f, 0x7826, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000,
+ 0x2091, 0x4080, 0x2079, 0x6d00, 0x7803, 0x0005, 0x0078, 0x12d6,
+ 0x007c, 0x2071, 0x6d00, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190,
+ 0x002d, 0xa298, 0x002d, 0x0048, 0x12ef, 0x705c, 0xa302, 0x00c8,
+ 0x12ef, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x12e1, 0x200b,
+ 0x0000, 0x749e, 0x74a2, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6d00, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1302, 0xa06e,
+ 0x0078, 0x130c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e,
+ 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6d00, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8,
+ 0x131c, 0xa06e, 0x0078, 0x1325, 0x70a2, 0x702c, 0x2068, 0x2d04,
+ 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c,
+ 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6d00, 0x702c, 0x206a,
+ 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x127f, 0x0e7f, 0x007c,
+ 0x8dff, 0x0040, 0x1344, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078,
+ 0x1328, 0x0d7f, 0x0078, 0x1338, 0x007c, 0x0e7e, 0x2071, 0x6d00,
+ 0x70a0, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
+ 0x6f31, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071,
+ 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2270, 0x700b, 0x0000, 0x2071, 0x6f31, 0x7018, 0xa088, 0x6f3a,
+ 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0,
+ 0x1377, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1388, 0x0f7f, 0x0e7f,
+ 0x007c, 0x0e7e, 0x2071, 0x6f31, 0x7004, 0xa005, 0x00c0, 0x1386,
+ 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1388, 0x0f7f, 0x0e7f, 0x007c,
+ 0x7000, 0x0079, 0x138b, 0x138f, 0x13f9, 0x1416, 0x1416, 0x7018,
+ 0x711c, 0xa106, 0x00c0, 0x1397, 0x7007, 0x0000, 0x007c, 0x0d7e,
+ 0xa180, 0x6f3a, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007,
+ 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c,
+ 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804,
+ 0x0d7f, 0xd084, 0x0040, 0x13b9, 0x7007, 0x0001, 0x1078, 0x13be,
+ 0x007c, 0x7007, 0x0002, 0x1078, 0x13d4, 0x007c, 0x017e, 0x027e,
+ 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13c9, 0x2110,
+ 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
+ 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e,
+ 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c,
+ 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e8, 0x2110, 0xa006,
+ 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
+ 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f,
+ 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x6dc5, 0x20a1, 0x0018,
+ 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
+ 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b,
+ 0x6dc0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e,
+ 0x157e, 0x2001, 0x6df4, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026,
+ 0x2001, 0x6df5, 0x20ac, 0x53a6, 0x2099, 0x6df6, 0x20a1, 0x0018,
+ 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
+ 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b,
+ 0x6df1, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e,
+ 0x2071, 0x6f31, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002,
+ 0xd1fc, 0x0040, 0x1459, 0xa18c, 0x0700, 0x0040, 0x1456, 0x7008,
+ 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1459, 0x7004, 0x1079,
+ 0x145d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x1388, 0x1465, 0x1487,
+ 0x14a1, 0x14ca, 0x1463, 0x0078, 0x1463, 0x137e, 0x147e, 0x157e,
+ 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8,
+ 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c, 0xa005,
+ 0x0040, 0x148e, 0x1078, 0x13be, 0x007c, 0x7008, 0xa080, 0x0002,
+ 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x1388, 0x007c, 0x700c,
+ 0xa005, 0x0040, 0x148e, 0x1078, 0x13d4, 0x007c, 0x0d7e, 0x7008,
+ 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c,
+ 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x1388,
+ 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x6dc3, 0x2004, 0xa080,
+ 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020,
+ 0x53a5, 0x2001, 0x6dc5, 0x2004, 0xd0bc, 0x0040, 0x14c0, 0x2001,
+ 0x6dce, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5,
+ 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x396e, 0x1078,
+ 0x1388, 0x007c, 0x2001, 0x6df3, 0x2003, 0x0100, 0x7007, 0x0000,
+ 0x1078, 0x1388, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030,
+ 0x2071, 0x6f42, 0x7003, 0x0000, 0x700f, 0x6f48, 0x7013, 0x6f48,
+ 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079,
+ 0x14e9, 0x14f1, 0x151b, 0x14f1, 0x14f1, 0x14f1, 0x1500, 0x14f1,
+ 0x14f5, 0xa085, 0x0001, 0x0078, 0x1531, 0x684c, 0xd0bc, 0x0040,
+ 0x14f1, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x1523,
+ 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14f1, 0x684c, 0xd0ac,
+ 0x0040, 0x14f1, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084,
+ 0x000f, 0xa080, 0x1a82, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a,
+ 0x6858, 0x0078, 0x152b, 0x684c, 0xd0ac, 0x0040, 0x14f1, 0xa006,
+ 0x682e, 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1a82, 0x210c,
+ 0x6932, 0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006,
+ 0x680a, 0x007c, 0x82ff, 0x0040, 0x1545, 0xa280, 0x0004, 0x0d7e,
+ 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x1541, 0x1078, 0x14e4, 0x10c0,
+ 0x12b7, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e,
+ 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005,
+ 0x00c0, 0x1559, 0x7206, 0x2001, 0x156d, 0x007e, 0x2260, 0x0078,
+ 0x164f, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108,
+ 0xa182, 0x6f63, 0x0048, 0x1566, 0x2009, 0x6f48, 0x710e, 0x7000,
+ 0xa005, 0x00c0, 0x156d, 0x1078, 0x1638, 0x127f, 0x007c, 0x127e,
+ 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f,
+ 0x037f, 0x027f, 0x0c7e, 0x0d7e, 0x2460, 0x6110, 0x2168, 0x6a62,
+ 0x6b5e, 0xa005, 0x0040, 0x15bc, 0x6808, 0xa005, 0x0040, 0x15ea,
+ 0x7000, 0xa005, 0x00c0, 0x158e, 0x0078, 0x15b4, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x15ba, 0x7004, 0xa406, 0x00c0, 0x15b4, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15ee, 0x2001, 0x0207, 0x2004,
+ 0xd09c, 0x00c0, 0x1597, 0x7804, 0xa084, 0x6000, 0x0040, 0x15ae,
+ 0xa086, 0x6000, 0x0040, 0x15ae, 0x0078, 0x1597, 0x7803, 0x0004,
+ 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5591,
+ 0x0078, 0x15ee, 0x0078, 0x15ee, 0x6808, 0xa005, 0x0040, 0x15ea,
+ 0x7000, 0xa005, 0x00c0, 0x15c6, 0x0078, 0x15ea, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x15ba, 0x7004, 0xa406, 0x00c0, 0x15ea, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15ee, 0x2001, 0x0207, 0x2004,
+ 0xd09c, 0x00c0, 0x15cf, 0x7804, 0xa084, 0x6000, 0x0040, 0x15e6,
+ 0xa086, 0x6000, 0x0040, 0x15e6, 0x0078, 0x15cf, 0x7803, 0x0004,
+ 0x7003, 0x0000, 0x2009, 0x0048, 0x1078, 0x5591, 0x0d7f, 0x0c7f,
+ 0x127f, 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x6f42, 0x7000, 0xa086,
+ 0x0000, 0x0040, 0x1635, 0x7004, 0xac06, 0x00c0, 0x1626, 0x2079,
+ 0x0030, 0x7804, 0xd0fc, 0x00c0, 0x1622, 0x2001, 0x0207, 0x2004,
+ 0xd09c, 0x00c0, 0x1601, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0,
+ 0x160d, 0x7908, 0xd1ec, 0x00c0, 0x1619, 0x2009, 0x0009, 0x0078,
+ 0x161b, 0x2009, 0x0019, 0x7803, 0x0002, 0x7902, 0x7003, 0x0003,
+ 0x0078, 0x1635, 0x1078, 0x16e5, 0x0078, 0x15f6, 0x157e, 0x20a9,
+ 0x0009, 0x2009, 0x6f48, 0x2104, 0xac06, 0x00c0, 0x1630, 0x200a,
+ 0xa188, 0x0003, 0x00f0, 0x162b, 0x157f, 0x0e7f, 0x0f7f, 0x007c,
+ 0x700c, 0x7110, 0xa106, 0x00c0, 0x1640, 0x7003, 0x0000, 0x007c,
0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108,
- 0xa182, 0x710b, 0x0048, 0x167e, 0x2009, 0x70f0, 0x7112, 0x8cff,
- 0x00c0, 0x169e, 0x7908, 0xd1ec, 0x00c0, 0x1692, 0x1078, 0x190d,
- 0x0040, 0x1692, 0x7803, 0x0009, 0x7904, 0xd1fc, 0x0040, 0x168c,
- 0x7803, 0x0006, 0x7007, 0x0000, 0x1078, 0x190d, 0x0040, 0x16c5,
- 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x16c5, 0x6010, 0x2068,
- 0x2d58, 0x6828, 0xa406, 0x00c0, 0x16a9, 0x682c, 0xa306, 0x0040,
- 0x16ad, 0x1078, 0x1c0b, 0x00c0, 0x1682, 0x684c, 0xd0f4, 0x00c0,
- 0x1682, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034,
- 0xa0cc, 0x000f, 0x2009, 0x0011, 0x1078, 0x16c6, 0x0040, 0x16c4,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x2d58, 0x007c, 0x8aff, 0x0040,
- 0x1732, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x16e5, 0x0d7e,
- 0x2804, 0xac68, 0x2900, 0x0079, 0x16d5, 0x1714, 0x16f5, 0x16f5,
- 0x1714, 0x1714, 0x170c, 0x1714, 0x16f5, 0x1714, 0x16fb, 0x16fb,
- 0x1714, 0x1714, 0x1714, 0x1703, 0x16fb, 0xc0fc, 0x6852, 0x6b6c,
- 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x1717, 0x2804,
- 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1717, 0x6b08, 0x6a0c, 0x6d00,
- 0x6c04, 0x0078, 0x1717, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08,
- 0x6e0c, 0x0078, 0x1717, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff,
- 0xa086, 0x001e, 0x00c0, 0x1714, 0x0d7f, 0x1078, 0x1ba7, 0x00c0,
- 0x16c6, 0xa00e, 0x0078, 0x1732, 0x0d7f, 0x1078, 0x1288, 0x7b22,
- 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000,
- 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e,
- 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816,
- 0x1078, 0x1ba7, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1735, 0xa184, 0x0003,
- 0xa086, 0x0003, 0x0040, 0x1735, 0x7000, 0x0079, 0x174f, 0x1757,
- 0x1759, 0x182a, 0x188e, 0x18a5, 0x1757, 0x1757, 0x1757, 0x1078,
- 0x1288, 0x8001, 0x7002, 0xa184, 0x0880, 0x00c0, 0x176e, 0x8aff,
- 0x0040, 0x17ca, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0040, 0x18b7,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0xd1dc, 0x0040, 0x17b9, 0x027e, 0x037e, 0x6b28,
- 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a,
- 0x6a2e, 0x7820, 0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101,
- 0x6816, 0x037f, 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078,
- 0x1bc0, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003,
- 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x17ab, 0x684c, 0xd0e4, 0x0040, 0x17ab, 0x7004, 0x2060, 0x2009,
- 0x0048, 0x1078, 0x55fc, 0x7808, 0xd0ec, 0x00c0, 0x17b5, 0x7803,
- 0x0009, 0x7003, 0x0004, 0x0078, 0x18b7, 0x1078, 0x1668, 0x0078,
- 0x18b7, 0x057e, 0x7d0c, 0x1078, 0x6e15, 0x057f, 0x1078, 0x18bb,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0,
- 0x17e2, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x17de,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x55fc, 0x1078, 0x1668,
- 0x0078, 0x18b7, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183,
- 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007,
- 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a,
- 0x810b, 0x810b, 0x810b, 0x1078, 0x18ea, 0x7803, 0x0004, 0x780f,
- 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1803, 0x7803,
- 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007, 0x0000,
- 0x2060, 0x2009, 0x0048, 0x1078, 0x55fc, 0x1078, 0x190d, 0x0040,
- 0x17de, 0x7908, 0xd1ec, 0x00c0, 0x1821, 0x2009, 0x0009, 0x0078,
- 0x1823, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x8001, 0x7002, 0xd194, 0x0040, 0x183c, 0x7804,
- 0xd0fc, 0x00c0, 0x173f, 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001,
- 0x1078, 0x16c6, 0x0078, 0x18b7, 0xa184, 0x0880, 0x00c0, 0x1849,
- 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078,
- 0x18b7, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x187d,
- 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0, 0x0d7e, 0x0f7e,
- 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x186d, 0x6808,
- 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c,
- 0x7814, 0xa101, 0x7816, 0x0078, 0x1879, 0x6810, 0x2008, 0xa31a,
- 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101,
- 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x1779, 0x057e, 0x7d0c, 0x1078,
- 0x6e15, 0x057f, 0x1078, 0x18bb, 0x697c, 0x6912, 0x6980, 0x6916,
- 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x18a1, 0x6808, 0x8001,
- 0x680a, 0x00c0, 0x18a1, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x55fc, 0x1078, 0x1668, 0x0078, 0x18b7, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x18a1, 0x2068,
- 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x167f, 0x017f,
- 0x007f, 0x127f, 0x007c, 0x1078, 0x18cc, 0x20e1, 0x9028, 0x700f,
- 0x70f0, 0x7013, 0x70f0, 0x2001, 0x015d, 0x200c, 0x810a, 0x2102,
- 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014, 0x2003,
- 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0,
- 0x18e9, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0, 0x18e9,
- 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x18e9, 0x8421, 0x00c0,
- 0x18d3, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200, 0x7808,
- 0xa084, 0xf000, 0xa10d, 0x1078, 0x18cc, 0x20e1, 0x7000, 0x7324,
- 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e,
- 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138,
- 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908,
- 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x191a, 0xa085, 0x0001,
- 0x0078, 0x192c, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1925, 0x20e1,
- 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c,
- 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e,
- 0x2071, 0x710b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280,
- 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x19b1, 0x6934, 0xa184,
- 0x0007, 0x0079, 0x1943, 0x194b, 0x199c, 0x194b, 0x194b, 0x194b,
- 0x1981, 0x195e, 0x194d, 0x1078, 0x1288, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x19a4, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x194b, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0x0078,
- 0x19ad, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x19b1, 0x684c,
- 0xd0b4, 0x0040, 0x1ab3, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0xa006,
- 0x682e, 0x682a, 0x0078, 0x19ad, 0x684c, 0xd0b4, 0x0040, 0x1733,
- 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084,
- 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd,
- 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc,
- 0x10c0, 0x1ab7, 0x0e7e, 0x0d7e, 0x2071, 0x710b, 0x7000, 0xa005,
- 0x00c0, 0x1a2d, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004,
- 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e,
- 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004,
- 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060,
- 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007,
- 0x0040, 0x19ef, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108,
- 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a,
- 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0,
- 0x1a06, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a13, 0x037e, 0x047e,
- 0x6b14, 0x6c10, 0x1078, 0x1c0b, 0x047f, 0x037f, 0x0040, 0x1a13,
- 0x0c7f, 0x0078, 0x1a2d, 0x8aff, 0x00c0, 0x1a1b, 0x0c7f, 0xa085,
- 0x0001, 0x0078, 0x1a2d, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020,
- 0x2009, 0x0001, 0x1078, 0x1a31, 0x0040, 0x1a2a, 0x2009, 0x0001,
- 0x1078, 0x1a31, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff,
- 0x0040, 0x1aac, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203,
- 0x0048, 0x1aab, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1a5e,
- 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1a4e, 0x1a8d, 0x1a6e,
- 0x1a6e, 0x1a8d, 0x1a8d, 0x1a85, 0x1a8d, 0x1a6e, 0x1a8d, 0x1a74,
- 0x1a74, 0x1a8d, 0x1a8d, 0x1a8d, 0x1a7c, 0x1a74, 0xc0fc, 0x6852,
- 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a91, 0x0d7e,
- 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x6b08, 0x6a0c,
- 0x6d00, 0x6c04, 0x0078, 0x1a90, 0x6b10, 0x6a14, 0x6d00, 0x6c04,
- 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x0d7f, 0x0d7e, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1a8d, 0x0d7f, 0x1078, 0x1ba7,
- 0x00c0, 0x1a37, 0xa00e, 0x0078, 0x1aac, 0x0d7f, 0x1078, 0x1288,
- 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902,
- 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201,
- 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078,
- 0x1ba7, 0x0078, 0x1aac, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f,
- 0x067f, 0x077f, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x2079, 0x0020, 0x2071, 0x710b, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1ab5, 0x7000, 0x0079,
- 0x1ad1, 0x1b78, 0x1ad5, 0x1b45, 0x1b76, 0x8001, 0x7002, 0xd19c,
- 0x00c0, 0x1ae9, 0x8aff, 0x0040, 0x1b08, 0x2009, 0x0001, 0x1078,
- 0x1a31, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31, 0x0078,
- 0x1b78, 0x7803, 0x0004, 0xd194, 0x0040, 0x1af9, 0x6850, 0xc0fc,
- 0x6852, 0x8aff, 0x00c0, 0x1afe, 0x684c, 0xc0f5, 0x684e, 0x0078,
- 0x1afe, 0x1078, 0x1bc0, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826,
- 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b78,
- 0x711c, 0x81ff, 0x0040, 0x1b1e, 0x7918, 0x7922, 0x7827, 0x0000,
- 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e,
- 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1b78, 0x0f7e, 0x027e,
- 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284,
- 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1b2c,
- 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803,
- 0x0008, 0x7003, 0x0000, 0x0078, 0x1b78, 0x8001, 0x7002, 0xd194,
- 0x0040, 0x1b5a, 0x7804, 0xd0fc, 0x00c0, 0x1ac7, 0xd19c, 0x00c0,
- 0x1b74, 0x8aff, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31,
- 0x0078, 0x1b78, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0,
- 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b6d, 0x6808,
- 0xa31a, 0x680c, 0xa213, 0x0078, 0x1b71, 0x6810, 0xa31a, 0x6814,
- 0xa213, 0x0d7f, 0x0078, 0x1af9, 0x0078, 0x1af9, 0x1078, 0x1288,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c,
- 0x0f7e, 0x0e7e, 0x2071, 0x710b, 0x7000, 0xa086, 0x0000, 0x0040,
- 0x1ba4, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040,
- 0x1b8b, 0x1078, 0x1ab7, 0x7000, 0xa086, 0x0000, 0x00c0, 0x1b8b,
- 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1b9a, 0x20e1, 0x9040,
+ 0xa182, 0x6f63, 0x0048, 0x164e, 0x2009, 0x6f48, 0x7112, 0x8cff,
+ 0x00c0, 0x1658, 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x167b,
+ 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406, 0x00c0, 0x1663, 0x682c,
+ 0xa306, 0x0040, 0x1667, 0x1078, 0x1aa2, 0x00c0, 0x1652, 0x6824,
+ 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f,
+ 0x2009, 0x0011, 0x1078, 0x167c, 0x0040, 0x167a, 0x2009, 0x0001,
+ 0x1078, 0x167c, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x16e0, 0xa03e,
+ 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x169b, 0x0d7e, 0x2804, 0xac68,
+ 0x2900, 0x0079, 0x168b, 0x16ca, 0x16ab, 0x16ab, 0x16ca, 0x16ca,
+ 0x16c2, 0x16ca, 0x16ab, 0x16ca, 0x16b1, 0x16b1, 0x16ca, 0x16ca,
+ 0x16ca, 0x16ca, 0x16b1, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c,
+ 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x16cd, 0x2804, 0xac68, 0x6f08,
+ 0x6e0c, 0x0078, 0x16cd, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078,
+ 0x16cd, 0x7b0c, 0xd3bc, 0x0040, 0x16ba, 0x7b08, 0xa39c, 0x0fff,
+ 0x0078, 0x16bb, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c,
+ 0x0078, 0x16cd, 0x0d7f, 0x1078, 0x1a3f, 0x00c0, 0x167c, 0xa00e,
+ 0x0078, 0x16e0, 0x0d7f, 0x1078, 0x12b7, 0x7b22, 0x7a26, 0x7d32,
+ 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f,
+ 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x1078, 0x1a3f,
+ 0x007c, 0x1078, 0x12b7, 0x1078, 0x12b7, 0x127e, 0x2091, 0x2100,
+ 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
+ 0xa184, 0x0700, 0x00c0, 0x16e3, 0xa184, 0x0003, 0xa086, 0x0003,
+ 0x0040, 0x16e3, 0x7000, 0x0079, 0x16fd, 0x1701, 0x1703, 0x1779,
+ 0x17c0, 0x1078, 0x12b7, 0x8001, 0x7002, 0xa184, 0x0880, 0x00c0,
+ 0x1718, 0x8aff, 0x0040, 0x175b, 0x2009, 0x0001, 0x1078, 0x167c,
+ 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078, 0x167c, 0x0078, 0x17d3,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x1751, 0x027e,
+ 0x037e, 0x6b28, 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872,
+ 0xa213, 0x6b2a, 0x6a2e, 0x037f, 0x027f, 0x7830, 0x681e, 0x7834,
+ 0x6822, 0x1078, 0x1a58, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800,
+ 0x6832, 0x7003, 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001,
+ 0x680a, 0x00c0, 0x174d, 0x684c, 0xd0e4, 0x0040, 0x174d, 0x7004,
+ 0x2060, 0x2009, 0x0048, 0x1078, 0x5591, 0x1078, 0x1638, 0x0078,
+ 0x17d3, 0x057e, 0x7d0c, 0xd5bc, 0x00c0, 0x1758, 0x1078, 0x6c41,
+ 0x057f, 0x0078, 0x1773, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
+ 0x00c0, 0x1773, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
+ 0x176f, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5591, 0x1078,
+ 0x1638, 0x0078, 0x17d3, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078,
+ 0x17d3, 0x8001, 0x7002, 0xd194, 0x0040, 0x178b, 0x7804, 0xd0fc,
+ 0x00c0, 0x16ed, 0x8aff, 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078,
+ 0x167c, 0x0078, 0x17d3, 0xa184, 0x0880, 0x00c0, 0x1798, 0x8aff,
+ 0x0040, 0x17d3, 0x2009, 0x0001, 0x1078, 0x167c, 0x0078, 0x17d3,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x17b9, 0x027e,
+ 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1a58, 0x0d7e, 0x2804, 0xac68,
+ 0x6034, 0xd09c, 0x00c0, 0x17b2, 0x6808, 0xa31a, 0x680c, 0xa213,
+ 0x0078, 0x17b6, 0x6810, 0xa31a, 0x6814, 0xa213, 0x0d7f, 0x0078,
+ 0x1723, 0x057e, 0x7d0c, 0x1078, 0x6c41, 0x057f, 0x0078, 0x1773,
+ 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x17d1, 0x6808, 0x8001,
+ 0x680a, 0x00c0, 0x17d1, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
+ 0x5591, 0x1078, 0x1638, 0x017f, 0x007f, 0x127f, 0x007c, 0x0e7e,
+ 0x2071, 0x6f63, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280,
+ 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1836, 0x6934, 0xa184,
+ 0x0007, 0x0079, 0x17eb, 0x17f3, 0x1821, 0x17f3, 0x17f3, 0x17f3,
+ 0x1806, 0x17f3, 0x17f5, 0x1078, 0x12b7, 0x684c, 0xd0b4, 0x0040,
+ 0x192f, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
+ 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1829, 0xa18c, 0x00ff,
+ 0xa186, 0x0015, 0x00c0, 0x1836, 0x684c, 0xd0b4, 0x0040, 0x192f,
+ 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080,
+ 0x1a82, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a, 0x0078,
+ 0x1832, 0x684c, 0xd0b4, 0x0040, 0x16e1, 0x6958, 0xa006, 0x682e,
+ 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080, 0x1a82,
+ 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x0d7f, 0x007c,
+ 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0, 0x1933, 0x0e7e,
+ 0x0d7e, 0x2071, 0x6f63, 0x7000, 0xa005, 0x00c0, 0x18b2, 0x0c7e,
+ 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068, 0x6818, 0x0d7e,
+ 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, 0x9040, 0x2079,
+ 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x0f7f, 0x0d7f,
+ 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034,
+ 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007, 0x0040, 0x1874, 0x017e,
+ 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a, 0x7116, 0x701e,
+ 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006, 0x700e, 0x7012,
+ 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x188b, 0x6928, 0x6810,
+ 0xa106, 0x0040, 0x1898, 0x037e, 0x047e, 0x6b14, 0x6c10, 0x1078,
+ 0x1aa2, 0x047f, 0x037f, 0x0040, 0x1898, 0x0c7f, 0x0078, 0x18b2,
+ 0x8aff, 0x00c0, 0x18a0, 0x0c7f, 0xa085, 0x0001, 0x0078, 0x18b2,
+ 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001, 0x1078,
+ 0x18b6, 0x0040, 0x18af, 0x2009, 0x0001, 0x1078, 0x18b6, 0x127f,
+ 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e, 0x067e,
+ 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040, 0x1928, 0x700c,
+ 0x7214, 0xa202, 0x7010, 0x7218, 0xa203, 0x0048, 0x1927, 0xa03e,
+ 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x18e3, 0x0d7e, 0x2804, 0xac68,
+ 0x2900, 0x0079, 0x18d3, 0x1909, 0x18f3, 0x18f3, 0x1909, 0x1909,
+ 0x1901, 0x1909, 0x18f3, 0x1909, 0x18f9, 0x18f9, 0x1909, 0x1909,
+ 0x1909, 0x1909, 0x18f9, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c,
+ 0x6c20, 0xd99c, 0x0040, 0x190d, 0x0d7e, 0x2804, 0xac68, 0x6f08,
+ 0x6e0c, 0x0078, 0x190c, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078,
+ 0x190c, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
+ 0x190c, 0x0d7f, 0x1078, 0x1a3f, 0x00c0, 0x18bc, 0xa00e, 0x0078,
+ 0x1928, 0x0d7f, 0x1078, 0x12b7, 0x0d7f, 0x7b22, 0x7a26, 0x7d32,
+ 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x6828,
+ 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c, 0xa300, 0x700e,
+ 0x7010, 0xa201, 0x7012, 0x1078, 0x1a3f, 0x0078, 0x1928, 0xa006,
+ 0x027f, 0x037f, 0x047f, 0x057f, 0x067f, 0x077f, 0x007c, 0x1078,
+ 0x12b7, 0x1078, 0x12b7, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020, 0x2071, 0x6f63,
+ 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700,
+ 0x00c0, 0x1931, 0x7000, 0x0079, 0x194d, 0x1a09, 0x1951, 0x19d6,
+ 0x1a07, 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1965, 0x8aff, 0x0040,
+ 0x199a, 0x2009, 0x0001, 0x1078, 0x18b6, 0x0040, 0x1a09, 0x2009,
+ 0x0001, 0x1078, 0x18b6, 0x0078, 0x1a09, 0x7803, 0x0004, 0xd194,
+ 0x0040, 0x1975, 0x6850, 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1990,
+ 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1990, 0x027e, 0x037e, 0x6b28,
+ 0x6a2c, 0x701c, 0xa005, 0x10c0, 0x1a11, 0x7820, 0x686e, 0xa31a,
+ 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x037f, 0x027f, 0x7830,
+ 0x681e, 0x7834, 0x6822, 0x1078, 0x1a58, 0x6850, 0xc0fd, 0x6852,
+ 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000,
+ 0x0078, 0x1a09, 0x711c, 0x81ff, 0x0040, 0x19af, 0x7922, 0x7827,
+ 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100,
+ 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1a09, 0x0f7e,
+ 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14,
+ 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0,
+ 0x19bd, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102,
+ 0x78c6, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f,
+ 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1a09, 0x8001, 0x7002,
+ 0xd194, 0x0040, 0x19eb, 0x7804, 0xd0fc, 0x00c0, 0x1943, 0xd19c,
+ 0x00c0, 0x1a05, 0x8aff, 0x0040, 0x1a09, 0x2009, 0x0001, 0x1078,
+ 0x18b6, 0x0078, 0x1a09, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078,
+ 0x1a58, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x19fe,
+ 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1a02, 0x6810, 0xa31a,
+ 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1979, 0x0078, 0x1975, 0x1078,
+ 0x12b7, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f,
+ 0x007c, 0x7920, 0xa108, 0x7922, 0x7924, 0xa189, 0x0000, 0x7926,
+ 0x7930, 0xa10a, 0x7932, 0x7934, 0xa18b, 0x0000, 0x7936, 0x007c,
+ 0x0f7e, 0x0e7e, 0x2071, 0x6f63, 0x7000, 0xa086, 0x0000, 0x0040,
+ 0x1a3c, 0x2079, 0x0020, 0x7804, 0xa084, 0x0003, 0x0040, 0x1a36,
+ 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1a32, 0x20e1, 0x9040,
0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840,
- 0x2804, 0xa005, 0x00c0, 0x1bbb, 0x6004, 0xa005, 0x0040, 0x1bbd,
- 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1beb, 0x2044,
- 0x88ff, 0x1040, 0x1288, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c,
- 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1bda, 0x2c00, 0xad06,
- 0x0040, 0x1bcf, 0x6000, 0xa005, 0x00c0, 0x1bcf, 0x2d00, 0x2060,
- 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1bfb, 0x2044, 0x88ff,
- 0x1040, 0x1288, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d,
+ 0x2804, 0xa005, 0x00c0, 0x1a53, 0x6004, 0xa005, 0x0040, 0x1a55,
+ 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1a82, 0x2044,
+ 0x88ff, 0x1040, 0x12b7, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c,
+ 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1a72, 0x2c00, 0xad06,
+ 0x0040, 0x1a67, 0x6000, 0xa005, 0x00c0, 0x1a67, 0x2d00, 0x2060,
+ 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1a92, 0x2044, 0x88ff,
+ 0x1040, 0x12b7, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d,
0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021,
- 0x0027, 0x0000, 0x0000, 0x0000, 0x1be0, 0x1bdc, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be0, 0x0000, 0x1be7, 0x1be4, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be7, 0x0000, 0x1be2, 0x1be2, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be2, 0x0000, 0x1be8, 0x1be8, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be8, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055,
- 0x0040, 0x1ca8, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1beb,
- 0xa986, 0x0007, 0x0040, 0x1c24, 0xa986, 0x000e, 0x0040, 0x1c24,
- 0xa986, 0x000f, 0x00c0, 0x1c28, 0x605c, 0xa422, 0x6060, 0xa31a,
- 0x2804, 0xa045, 0x00c0, 0x1c36, 0x0050, 0x1c30, 0x0078, 0x1ca8,
- 0x6004, 0xa065, 0x0040, 0x1ca8, 0x0078, 0x1c13, 0x2804, 0xa005,
- 0x0040, 0x1c54, 0xac68, 0xd99c, 0x00c0, 0x1c44, 0x6808, 0xa422,
- 0x680c, 0xa31b, 0x0078, 0x1c48, 0x6810, 0xa422, 0x6814, 0xa31b,
- 0x0048, 0x1c73, 0x2300, 0xa405, 0x0040, 0x1c5a, 0x8a51, 0x0040,
- 0x1ca8, 0x8840, 0x0078, 0x1c36, 0x6004, 0xa065, 0x0040, 0x1ca8,
- 0x0078, 0x1c13, 0x8a51, 0x0040, 0x1ca8, 0x8840, 0x2804, 0xa005,
- 0x00c0, 0x1c6d, 0x6004, 0xa065, 0x0040, 0x1ca8, 0x6034, 0xa0cc,
- 0x000f, 0xa9c0, 0x1beb, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc,
- 0x6852, 0x0078, 0x1ca0, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000,
- 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c8e,
- 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x1288,
- 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1c9a, 0x6910, 0x2400,
- 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x1288, 0x6800, 0xa420,
- 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852,
- 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1cad,
+ 0x0027, 0x0000, 0x0000, 0x1a78, 0x1a74, 0x0000, 0x0000, 0x8000,
+ 0x0000, 0x1a78, 0x0000, 0x1a7f, 0x1a7c, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x1a7f, 0x0000, 0x1a7a, 0x1a7a, 0x0000, 0x0000, 0x8000,
+ 0x0000, 0x1a7a, 0x0000, 0x1a80, 0x1a80, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x1a80, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055, 0x0040,
+ 0x1b28, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1a82, 0xa986,
+ 0x0007, 0x0040, 0x1ab7, 0xa986, 0x000f, 0x00c0, 0x1abb, 0x605c,
+ 0xa422, 0x6060, 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ac9, 0x0050,
+ 0x1ac3, 0x0078, 0x1b28, 0x6004, 0xa065, 0x0040, 0x1b28, 0x0078,
+ 0x1aaa, 0x2804, 0xa005, 0x0040, 0x1ae7, 0xac68, 0xd99c, 0x00c0,
+ 0x1ad7, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0078, 0x1adb, 0x6810,
+ 0xa422, 0x6814, 0xa31b, 0x0048, 0x1af5, 0x2300, 0xa405, 0x0040,
+ 0x1aed, 0x8a51, 0x0040, 0x1b28, 0x8840, 0x0078, 0x1ac9, 0x6004,
+ 0xa065, 0x0040, 0x1b28, 0x0078, 0x1aaa, 0x8a51, 0x8840, 0x2b68,
+ 0x6850, 0xc0fc, 0x6852, 0x0078, 0x1b22, 0x8422, 0x8420, 0x831a,
+ 0xa399, 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c,
+ 0x00c0, 0x1b10, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b,
+ 0x1048, 0x12b7, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1b1c,
+ 0x6910, 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12b7,
+ 0x6800, 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850,
+ 0xc0fd, 0x6852, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1b2d,
0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005,
- 0x2004, 0xa084, 0x0007, 0x0079, 0x1cb5, 0x1cbd, 0x1cbe, 0x1cc1,
- 0x1cc4, 0x1cc9, 0x1ccc, 0x1cd1, 0x1cd6, 0x007c, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1737, 0x007c, 0x1078, 0x1737, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1411, 0x007c, 0x1078, 0x1ab7, 0x1078, 0x1411,
- 0x007c, 0x1078, 0x1737, 0x1078, 0x1411, 0x007c, 0x1078, 0x1737,
- 0x1078, 0x1ab7, 0x1078, 0x1411, 0x007c, 0x127e, 0x2091, 0x2300,
- 0x2079, 0x0200, 0x2071, 0x7380, 0x2069, 0x6f00, 0x2009, 0x0004,
- 0x7912, 0x7817, 0x0004, 0x1078, 0x1fb7, 0x781b, 0x0002, 0x20e1,
- 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084,
- 0x0007, 0x0079, 0x1cfb, 0x1d1f, 0x1d03, 0x1d07, 0x1d0b, 0x1d11,
- 0x1d15, 0x1d19, 0x1d1d, 0x1078, 0x3e23, 0x0078, 0x1d1f, 0x1078,
- 0x3e52, 0x0078, 0x1d1f, 0x1078, 0x3e23, 0x1078, 0x3e52, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x127f,
- 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040,
- 0x1d2b, 0x1078, 0x1288, 0xa184, 0x0030, 0x0040, 0x1d3c, 0x6a00,
- 0xa286, 0x0003, 0x00c0, 0x1d36, 0x1078, 0x1288, 0x1078, 0x3229,
- 0x20e1, 0x9010, 0x0078, 0x1d48, 0xa184, 0x00c0, 0x0040, 0x1d42,
- 0x1078, 0x1288, 0xa184, 0x0300, 0x0040, 0x1d48, 0x20e1, 0x9020,
- 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e,
- 0x2071, 0x6f00, 0x7128, 0x2001, 0x70a3, 0x2102, 0x2001, 0x70ab,
- 0x2102, 0xa182, 0x0211, 0x00c8, 0x1d61, 0x2009, 0x0008, 0x0078,
- 0x1d8b, 0xa182, 0x0259, 0x00c8, 0x1d69, 0x2009, 0x0007, 0x0078,
- 0x1d8b, 0xa182, 0x02c1, 0x00c8, 0x1d71, 0x2009, 0x0006, 0x0078,
- 0x1d8b, 0xa182, 0x0349, 0x00c8, 0x1d79, 0x2009, 0x0005, 0x0078,
- 0x1d8b, 0xa182, 0x0421, 0x00c8, 0x1d81, 0x2009, 0x0004, 0x0078,
- 0x1d8b, 0xa182, 0x0581, 0x00c8, 0x1d89, 0x2009, 0x0003, 0x0078,
- 0x1d8b, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182, 0x0005,
- 0x00c8, 0x1d95, 0x7916, 0x0078, 0x1d97, 0x7817, 0x0004, 0x1078,
- 0x1fb7, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200,
- 0x2061, 0x0100, 0x2071, 0x6f00, 0x6024, 0x6026, 0x6033, 0x00ef,
- 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7,
- 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x00af,
- 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x6f2b,
- 0x2003, 0x0000, 0x2001, 0x6f2a, 0x2003, 0x0001, 0x007c, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c,
- 0x00c0, 0x1dd6, 0xa184, 0x0007, 0x0079, 0x1ddc, 0xa195, 0x0004,
- 0xa284, 0x0007, 0x0079, 0x1ddc, 0x1e08, 0x1de4, 0x1de8, 0x1dec,
- 0x1df2, 0x1df6, 0x1dfc, 0x1e02, 0x1078, 0x42ff, 0x0078, 0x1e08,
- 0x1078, 0x43ee, 0x0078, 0x1e08, 0x1078, 0x43ee, 0x1078, 0x42ff,
- 0x0078, 0x1e08, 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x42ff,
- 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x43ee, 0x1078, 0x1e0d,
- 0x0078, 0x1e08, 0x1078, 0x43ee, 0x1078, 0x42ff, 0x1078, 0x1e0d,
- 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1ebd,
- 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196,
- 0xff00, 0x0040, 0x1e3c, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116,
- 0x0040, 0x1e3c, 0x7130, 0xd18c, 0x00c0, 0x1e3c, 0x2011, 0x6f52,
- 0x2214, 0xd2ec, 0x0040, 0x1e30, 0xc18d, 0x7132, 0x0078, 0x1e3c,
- 0x6240, 0xa294, 0x0010, 0x0040, 0x1e7a, 0x6248, 0xa294, 0xff00,
- 0xa296, 0xff00, 0x00c0, 0x1e7a, 0x037e, 0x73b0, 0x2011, 0x8013,
- 0x1078, 0x29fa, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011, 0x6f52,
- 0x220c, 0xd1a4, 0x0040, 0x1e62, 0x017e, 0x2009, 0x0001, 0x2011,
- 0x0100, 0x1078, 0x42cd, 0x2019, 0x000e, 0x1078, 0x6d5c, 0xa484,
- 0x00ff, 0x1078, 0x1fe4, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078,
- 0x6dc4, 0x017f, 0xd1ac, 0x00c0, 0x1e6b, 0x2019, 0x0004, 0x1078,
- 0x2186, 0x0078, 0x1e7a, 0x157e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x1078, 0x34cb, 0x00c0, 0x1e76, 0x1078, 0x32cf, 0x8108, 0x00f0,
- 0x1e70, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7,
- 0x1078, 0x3292, 0x0f7e, 0x2079, 0x70c9, 0x783c, 0xa086, 0x0000,
- 0x0040, 0x1e92, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140,
- 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078, 0x5193, 0x2011,
- 0x0002, 0x1078, 0x519d, 0x1078, 0x50a9, 0x1078, 0x4204, 0x037e,
- 0x2019, 0x0000, 0x1078, 0x513b, 0x037f, 0x60e3, 0x0000, 0x017f,
- 0x2001, 0x6f00, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1eb5, 0xd19c,
- 0x00c0, 0x1eb5, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001,
- 0x6f1e, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x1f5e,
- 0x0f7e, 0x2079, 0x70c9, 0x783c, 0xa086, 0x0001, 0x00c0, 0x1ee1,
- 0x017e, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x2079, 0x70b6, 0x7807, 0x0000, 0x7833,
- 0x0000, 0x1078, 0x4893, 0x1078, 0x4943, 0x017f, 0x0f7f, 0x0078,
- 0x1f5e, 0x0f7f, 0x017e, 0x6220, 0xd2b4, 0x0040, 0x1f16, 0x1078,
- 0x4204, 0x1078, 0x4f8e, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140,
- 0x6804, 0xa084, 0x4000, 0x0040, 0x1ef9, 0x6803, 0x1000, 0x6803,
- 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x70b6, 0x6028, 0xa09a, 0x0002,
- 0x00c8, 0x1f09, 0x8000, 0x602a, 0x0c7f, 0x1078, 0x4f80, 0x0078,
- 0x1f5d, 0x2019, 0x70bf, 0x2304, 0xa065, 0x0040, 0x1f13, 0x2009,
- 0x0027, 0x1078, 0x55fc, 0x0c7f, 0x0078, 0x1f5d, 0xd2bc, 0x0040,
- 0x1f5d, 0x1078, 0x4212, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e,
- 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1f2b, 0x6803,
- 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x70b6, 0x6044,
- 0xa09a, 0x0002, 0x00c8, 0x1f4c, 0x8000, 0x6046, 0x603c, 0x0c7f,
- 0xa005, 0x0040, 0x1f5d, 0x1078, 0x4209, 0xa080, 0x0007, 0x2004,
- 0xa086, 0x0006, 0x00c0, 0x1f48, 0x6017, 0x0012, 0x0078, 0x1f5d,
- 0x6017, 0x0016, 0x0078, 0x1f5d, 0x037e, 0x2019, 0x0001, 0x1078,
- 0x513b, 0x037f, 0x2019, 0x70c5, 0x2304, 0xa065, 0x0040, 0x1f5c,
- 0x2009, 0x004f, 0x1078, 0x55fc, 0x0c7f, 0x017f, 0xd19c, 0x0040,
- 0x1f86, 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078,
- 0x5193, 0x2011, 0x0002, 0x1078, 0x519d, 0x1078, 0x50a9, 0x1078,
- 0x4204, 0x037e, 0x2019, 0x0000, 0x1078, 0x513b, 0x037f, 0x60e3,
- 0x0000, 0x1078, 0x6e33, 0x1078, 0x6e51, 0x2001, 0x6f00, 0x2003,
- 0x0004, 0x6027, 0x0008, 0x1078, 0x117d, 0x017f, 0xa18c, 0xffd0,
- 0x6126, 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x6f00, 0x71a8, 0x70aa, 0xa116, 0x0040,
- 0x1fb0, 0x81ff, 0x0040, 0x1fa2, 0x2011, 0x8011, 0x1078, 0x29fa,
- 0x0078, 0x1fb0, 0x2011, 0x8012, 0x1078, 0x29fa, 0x037e, 0x0c7e,
- 0x2061, 0x0100, 0x2019, 0x0028, 0x1078, 0x2186, 0x0c7f, 0x037f,
- 0x127f, 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e,
- 0x0f7e, 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x1fd2, 0x2204,
- 0x60f2, 0xa192, 0x0005, 0x00c8, 0x1fc9, 0xa190, 0x1fdb, 0x0078,
- 0x1fcb, 0x2011, 0x1fdf, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f,
- 0x0c7f, 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420, 0x0348,
- 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140,
- 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0xa080, 0x2207, 0x200c, 0xa18c,
- 0xff00, 0x810f, 0x007c, 0xa080, 0x2207, 0x200c, 0xa18c, 0x00ff,
- 0x007c, 0x2011, 0x2015, 0x2019, 0x201f, 0x2025, 0x202b, 0x2031,
- 0x2039, 0x2041, 0x2047, 0x204d, 0x2055, 0x205d, 0x2065, 0x206d,
- 0x2077, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x107e, 0x007e, 0x0078, 0x209a, 0x107e, 0x007e, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078,
- 0x209a, 0x0005, 0x0078, 0x2081, 0xb084, 0x003c, 0x8004, 0x8004,
- 0x0079, 0x208a, 0x209a, 0x2017, 0x201b, 0x2021, 0x2027, 0x202d,
- 0x2033, 0x203b, 0x2043, 0x2049, 0x204f, 0x2057, 0x205f, 0x2067,
- 0x206f, 0x2079, 0x0008, 0x2084, 0x007f, 0x107f, 0x2091, 0x8001,
- 0x007c, 0x0c7e, 0x027e, 0x2001, 0x010c, 0x203c, 0x7274, 0x82ff,
- 0x0040, 0x20f0, 0x037e, 0x7384, 0xa38e, 0xffff, 0x00c0, 0x20b2,
- 0x2019, 0x0001, 0x8314, 0xa2e0, 0x74c0, 0x2c04, 0xa38c, 0x0001,
- 0x0040, 0x20bf, 0xa084, 0xff00, 0x8007, 0x0078, 0x20c1, 0xa084,
- 0x00ff, 0xa70e, 0x0040, 0x20e5, 0xa08e, 0x0000, 0x0040, 0x20e5,
- 0xa08e, 0x00ff, 0x0040, 0x20eb, 0x1078, 0x1fe4, 0x1078, 0x3494,
- 0x00c0, 0x20e8, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x20df, 0x1078, 0x2138, 0x0040, 0x20e8, 0x0078, 0x20e5, 0x1078,
- 0x21d3, 0x1078, 0x215f, 0x0040, 0x20e8, 0x8318, 0x0078, 0x20b2,
- 0x7386, 0x0078, 0x20ed, 0x7087, 0xffff, 0x037f, 0x0078, 0x2135,
- 0xa780, 0x2207, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x20a9, 0x007e,
- 0x2009, 0x0000, 0x7084, 0xa096, 0xffff, 0x0040, 0x210c, 0xa092,
- 0x007e, 0x0048, 0x2107, 0x7087, 0xffff, 0x0078, 0x2132, 0x2008,
- 0x2011, 0x007e, 0xa202, 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106,
- 0x0040, 0x2129, 0x1078, 0x3494, 0x00c0, 0x2132, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2123, 0x1078, 0x2138, 0x0040,
- 0x2132, 0x0078, 0x2129, 0x1078, 0x21d3, 0x1078, 0x215f, 0x0040,
- 0x2132, 0x017f, 0x8108, 0x157f, 0x00f0, 0x210c, 0x7087, 0xffff,
- 0x0078, 0x2135, 0x017f, 0x157f, 0x7186, 0x027f, 0x0c7f, 0x007c,
- 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x556f, 0x0040,
- 0x215a, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078,
- 0x3463, 0x2001, 0x0000, 0x1078, 0x3477, 0x127e, 0x2091, 0x8000,
- 0x7080, 0x8000, 0x7082, 0x127f, 0x2009, 0x0004, 0x1078, 0x55fc,
- 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e,
- 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x556f, 0x0040, 0x2181,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x3463,
- 0x2001, 0x0002, 0x1078, 0x3477, 0x127e, 0x2091, 0x8000, 0x7080,
- 0x8000, 0x7082, 0x127f, 0x2009, 0x0002, 0x1078, 0x55fc, 0xa085,
- 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0e7e, 0x0c7e,
- 0x067e, 0x037e, 0x027e, 0x1078, 0x4582, 0x1078, 0x4532, 0x1078,
- 0x59e4, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34cb,
- 0x00c0, 0x219e, 0x1078, 0x364c, 0x1078, 0x32cf, 0x017f, 0x8108,
- 0x00f0, 0x2195, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0,
- 0x027e, 0x2019, 0x0029, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08,
- 0x1078, 0x6bfe, 0x017f, 0x2e60, 0x1078, 0x364c, 0x1078, 0x32cf,
- 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e,
- 0x2071, 0x6f00, 0x7080, 0xa005, 0x0040, 0x21d0, 0x8001, 0x7082,
- 0x007f, 0x0e7f, 0x007c, 0x6000, 0xc08c, 0x6002, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x157e, 0x81ff, 0x00c0, 0x21e4,
- 0x20a9, 0x0001, 0x0078, 0x21e8, 0x20a9, 0x007e, 0x2011, 0x0000,
- 0x027e, 0xa2e0, 0x7020, 0x2c64, 0x8cff, 0x0040, 0x21fa, 0x2019,
- 0x0029, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe,
- 0x1078, 0x364c, 0x027f, 0x8210, 0x00f0, 0x21e8, 0x027e, 0x027f,
- 0x157f, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x7eef,
- 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9,
- 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd,
- 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3,
- 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2,
- 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7,
- 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098,
- 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080,
- 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072,
- 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067,
- 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055,
- 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b,
- 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a,
- 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e,
- 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025,
- 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010,
- 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800,
- 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000,
- 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000,
- 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000,
- 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000,
- 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000,
- 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000,
- 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000,
- 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000,
- 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500,
- 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x2071,
- 0x6f6d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e,
- 0x7033, 0x6f7d, 0x7037, 0x6f7d, 0x7007, 0x0001, 0x2061, 0x6fbd,
- 0x6003, 0x0002, 0x007c, 0x0090, 0x231e, 0x0068, 0x231e, 0x2071,
- 0x6f6d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x231e, 0x2a60, 0x7820,
- 0xa08e, 0x0069, 0x00c0, 0x2405, 0x0079, 0x23a2, 0x007c, 0x2071,
- 0x6f6d, 0x7004, 0x0079, 0x2324, 0x2328, 0x2329, 0x2333, 0x2345,
- 0x007c, 0x0090, 0x2332, 0x0068, 0x2332, 0x2b78, 0x7818, 0xd084,
- 0x0040, 0x2351, 0x007c, 0x2b78, 0x2061, 0x6fbd, 0x6008, 0xa08e,
- 0x0100, 0x0040, 0x2340, 0xa086, 0x0200, 0x0040, 0x23fd, 0x007c,
- 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068, 0x6834,
- 0xa086, 0x0103, 0x0040, 0x234d, 0x007c, 0x2a60, 0x2b78, 0x7018,
- 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x235a, 0x61a8,
- 0x0079, 0x2362, 0x2100, 0xa08a, 0x0036, 0x00c8, 0x23f9, 0x61a8,
- 0x0079, 0x23a2, 0x23db, 0x240d, 0x2415, 0x2419, 0x2421, 0x2427,
- 0x242b, 0x2434, 0x2438, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x23f9,
- 0x2448, 0x23f9, 0x2458, 0x246f, 0x2486, 0x2502, 0x2507, 0x2534,
- 0x2581, 0x2590, 0x25b1, 0x25e7, 0x25f1, 0x25fe, 0x2611, 0x2629,
- 0x2632, 0x266f, 0x2675, 0x23f9, 0x2680, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2684, 0x268a, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x2692, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x269f, 0x26a5, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x26b7, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2704, 0x27d1, 0x27e5, 0x27ec, 0x284f, 0x28a0,
- 0x28ab, 0x28ed, 0x28fa, 0x2907, 0x290a, 0x26bb, 0x2933, 0x297a,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x2a81, 0x2a8f, 0x2a9c, 0x2ad6,
- 0x713c, 0x0078, 0x23db, 0x2021, 0x4000, 0x1078, 0x29d4, 0x127e,
- 0x2091, 0x8000, 0x0068, 0x23e8, 0x7818, 0xd084, 0x0040, 0x23eb,
- 0x127f, 0x0078, 0x23df, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a,
- 0x7b2e, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f,
- 0x007c, 0x2021, 0x4001, 0x0078, 0x23dd, 0x2021, 0x4002, 0x0078,
- 0x23dd, 0x2021, 0x4003, 0x0078, 0x23dd, 0x2021, 0x4005, 0x0078,
- 0x23dd, 0x2021, 0x4006, 0x0078, 0x23dd, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x29e3, 0x7823, 0x0004, 0x7824,
- 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x29e7, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x23db, 0x7924,
- 0x2114, 0x0078, 0x23db, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9,
- 0x0007, 0x53a3, 0x0078, 0x23db, 0x7824, 0x2060, 0x0078, 0x244a,
- 0x2009, 0x0001, 0x2011, 0x000f, 0x2019, 0x0007, 0x0078, 0x23db,
- 0x7d38, 0x7c3c, 0x0078, 0x240f, 0x7d38, 0x7c3c, 0x0078, 0x241b,
- 0x2061, 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109,
- 0x00c0, 0x244c, 0x2010, 0xa005, 0x0040, 0x23db, 0x0078, 0x2401,
- 0x2061, 0x6f51, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019,
- 0x0040, 0x2409, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056,
- 0xa006, 0x605a, 0x605e, 0x1078, 0x3917, 0x0078, 0x23db, 0x2061,
- 0x6f51, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019, 0x0040,
- 0x2409, 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006,
- 0x606a, 0x606e, 0x1078, 0x36ed, 0x0078, 0x23db, 0xa02e, 0x2520,
- 0x81ff, 0x00c0, 0x2405, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005,
- 0x20a1, 0x6f74, 0x41a1, 0x1078, 0x29ab, 0x0040, 0x2405, 0x2009,
- 0x0020, 0x1078, 0x29e3, 0x701b, 0x249e, 0x007c, 0x6834, 0x2008,
- 0xa084, 0x00ff, 0xa096, 0x0011, 0x0040, 0x24aa, 0xa096, 0x0019,
- 0x00c0, 0x2405, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x2405, 0x710e,
- 0x700c, 0x8001, 0x0040, 0x24db, 0x700e, 0x1078, 0x29ab, 0x0040,
- 0x2405, 0x2009, 0x0020, 0x2061, 0x6fbd, 0x6224, 0x6328, 0x642c,
- 0x6530, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
- 0x0000, 0x1078, 0x29e3, 0x701b, 0x24ce, 0x007c, 0x6834, 0xa084,
- 0x00ff, 0xa096, 0x0002, 0x0040, 0x24d9, 0xa096, 0x000a, 0x00c0,
- 0x2405, 0x0078, 0x24b0, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x33c8, 0x00c0, 0x24e9, 0x7007, 0x0003, 0x701b, 0x24eb,
- 0x007c, 0x1078, 0x37b0, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005,
- 0x2099, 0x6f74, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1,
- 0x0000, 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f,
- 0x0078, 0x29e7, 0x6190, 0x7824, 0x6092, 0x0078, 0x23db, 0x2091,
- 0x8000, 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f,
- 0x2020, 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061,
- 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a,
- 0x2009, 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003,
- 0x00c8, 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x2405, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x7c28, 0x7d2c, 0x1078, 0x360f, 0xd28c,
- 0x00c0, 0x2546, 0x1078, 0x359f, 0x0078, 0x2548, 0x1078, 0x35db,
- 0x00c0, 0x2572, 0x2061, 0x7500, 0x127e, 0x2091, 0x8000, 0x6000,
- 0xa086, 0x0000, 0x0040, 0x2560, 0x6010, 0xa06d, 0x0040, 0x2560,
- 0x683c, 0xa406, 0x00c0, 0x2560, 0x6840, 0xa506, 0x0040, 0x256b,
- 0x127f, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8,
- 0x2405, 0x0078, 0x254c, 0x1078, 0x6019, 0x127f, 0x0040, 0x2405,
- 0x0078, 0x23db, 0xa00e, 0x2001, 0x0005, 0x1078, 0x37b0, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x63dd, 0x1078, 0x3720, 0x127f, 0x0078,
- 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409,
- 0x1078, 0x3554, 0x1078, 0x3620, 0x0040, 0x2405, 0x0078, 0x23db,
- 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x2031,
- 0x000f, 0x1078, 0x3554, 0x8631, 0x00c8, 0x2599, 0x2019, 0x0005,
- 0x1078, 0x3641, 0x0040, 0x2405, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2409, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4194, 0x0078,
- 0x23db, 0x127e, 0x2091, 0x8000, 0x81ff, 0x00c0, 0x25e1, 0x2029,
- 0x007d, 0x644c, 0x2400, 0xa506, 0x0040, 0x25db, 0x2508, 0x1078,
- 0x34cb, 0x00c0, 0x25db, 0x2031, 0x000f, 0x1078, 0x3554, 0x8631,
- 0x00c8, 0x25c5, 0x2019, 0x0004, 0x1078, 0x3641, 0x0040, 0x25e1,
- 0x7824, 0xa08a, 0x1000, 0x00c8, 0x25e4, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x1078, 0x4194, 0x8529, 0x00c8, 0x25ba, 0x127f, 0x0078,
- 0x23db, 0x127f, 0x0078, 0x2405, 0x127f, 0x0078, 0x2409, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x1078, 0x3584, 0x1078, 0x360f, 0x0078,
- 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409,
- 0x1078, 0x356d, 0x1078, 0x360f, 0x0078, 0x23db, 0x81ff, 0x00c0,
- 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x35de, 0x0040,
- 0x2405, 0x1078, 0x3410, 0x1078, 0x3598, 0x1078, 0x360f, 0x0078,
- 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x3554, 0x62a0,
- 0x2019, 0x0005, 0x0c7e, 0x1078, 0x364c, 0x0c7f, 0x1078, 0x457b,
- 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe, 0x1078, 0x360f, 0x0078,
- 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x360f, 0x2208,
- 0x0078, 0x23db, 0x157e, 0x0d7e, 0x0e7e, 0x2069, 0x6fff, 0x6810,
- 0x6914, 0xa10a, 0x00c8, 0x263e, 0x2009, 0x0000, 0x6816, 0x2011,
- 0x0000, 0x2019, 0x0000, 0x20a9, 0x007d, 0x2069, 0x7020, 0x2d04,
- 0xa075, 0x0040, 0x2653, 0x704c, 0x1078, 0x265d, 0xa210, 0x7080,
- 0x1078, 0x265d, 0xa318, 0x8d68, 0x00f0, 0x2647, 0x2300, 0xa218,
- 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x23db, 0x0f7e, 0x017e, 0xa07d,
- 0x0040, 0x266c, 0x2001, 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040,
- 0x266c, 0x2178, 0x0078, 0x2664, 0x017f, 0x0f7f, 0x007c, 0x2069,
- 0x6fff, 0x6910, 0x6294, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405,
- 0x614c, 0xa190, 0x2207, 0x2214, 0xa294, 0x00ff, 0x0078, 0x23db,
- 0x613c, 0x6240, 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409,
- 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x6244, 0x6338,
- 0x0078, 0x23db, 0x613c, 0x6240, 0x7824, 0x603e, 0x7b28, 0x6342,
- 0x2069, 0x6f51, 0x831f, 0xa305, 0x6816, 0x0078, 0x23db, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040,
- 0x2409, 0x7828, 0xa00d, 0x0040, 0x2409, 0x782c, 0xa005, 0x0040,
- 0x2409, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078, 0x23db, 0x7d38,
- 0x7c3c, 0x0078, 0x2488, 0x7824, 0xa09c, 0x00ff, 0xa39a, 0x0003,
- 0x00c8, 0x2405, 0x624c, 0xa084, 0xff00, 0x8007, 0xa206, 0x00c0,
- 0x26d3, 0x2001, 0x6f40, 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x0078, 0x29e7, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3,
- 0x0040, 0x2409, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x2405, 0x0c7e, 0x1078, 0x29ab, 0x0c7f, 0x0040, 0x2405, 0x6837,
- 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x62f3, 0x0040, 0x2405,
- 0x7007, 0x0003, 0x701b, 0x26f5, 0x007c, 0x6830, 0xa086, 0x0100,
- 0x0040, 0x2405, 0xad80, 0x000e, 0x2009, 0x000c, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x0078, 0x29e7, 0x1078, 0x29ab, 0x0040, 0x2405,
- 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x29e3,
- 0x701b, 0x2713, 0x007c, 0xade8, 0x000d, 0x6800, 0xa005, 0x0040,
- 0x2409, 0x6804, 0xd0ac, 0x0040, 0x2720, 0xd0a4, 0x0040, 0x2409,
- 0xd094, 0x0040, 0x272b, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18c,
- 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x2736, 0x0c7e, 0x2061,
- 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f, 0x2009, 0x0100,
- 0x210c, 0xa18a, 0x0002, 0x0048, 0x274b, 0xd084, 0x0040, 0x274b,
- 0x6a28, 0xa28a, 0x007e, 0x00c8, 0x2409, 0xa288, 0x2207, 0x210c,
- 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040, 0x2754, 0x6828, 0xa08a,
- 0x007e, 0x00c8, 0x2409, 0x604e, 0x6808, 0xa08a, 0x0100, 0x0048,
- 0x2409, 0xa08a, 0x0841, 0x00c8, 0x2409, 0xa084, 0x0007, 0x00c0,
- 0x2409, 0x680c, 0xa005, 0x0040, 0x2409, 0x6810, 0xa005, 0x0040,
- 0x2409, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x2409, 0x8001, 0x0040,
- 0x2409, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x2409, 0x8001, 0x0040,
- 0x2409, 0x20a9, 0x001c, 0x2d98, 0x2069, 0x6f51, 0x2da0, 0x53a3,
- 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, 0x00ff, 0x6042,
- 0x1078, 0x3917, 0x1078, 0x36ed, 0x6000, 0xa086, 0x0000, 0x00c0,
- 0x27cf, 0x6808, 0x602a, 0x1078, 0x1d4d, 0x6818, 0x691c, 0x6a20,
- 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e,
- 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x27af, 0x6830, 0x6934, 0x6a38,
- 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0078, 0x27b1, 0xa084,
- 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x1078, 0x4220, 0x0c7e,
- 0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x0c7f, 0x60ac,
- 0xa005, 0x0040, 0x27cb, 0x6003, 0x0001, 0x2091, 0x301d, 0x1078,
- 0x3229, 0x0078, 0x27cf, 0x6003, 0x0004, 0x2091, 0x301d, 0x0078,
- 0x23db, 0x6000, 0xa086, 0x0000, 0x0040, 0x2405, 0x2069, 0x6f51,
- 0x7830, 0x6842, 0x7834, 0x6846, 0x2d00, 0x2009, 0x001c, 0x7a2c,
- 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29e7, 0x81ff, 0x00c0, 0x2405,
- 0x1078, 0x3229, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x6174,
- 0x81ff, 0x0040, 0x2806, 0x703f, 0x0000, 0x2001, 0x74c0, 0x2009,
- 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x29e7, 0x701b, 0x23d8, 0x127f, 0x007c, 0x703f, 0x0001,
- 0x0d7e, 0x2069, 0x74c0, 0x20a9, 0x0040, 0x20a1, 0x74c0, 0x2019,
- 0xffff, 0x43a4, 0x654c, 0xa588, 0x2207, 0x210c, 0xa18c, 0x00ff,
- 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100, 0xa506, 0x0040, 0x2838,
- 0x1078, 0x34cb, 0x00c0, 0x2838, 0x6014, 0x821c, 0x0048, 0x2830,
- 0xa398, 0x74c0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0078, 0x2837,
- 0xa398, 0x74c0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a, 0x8210,
- 0x8108, 0xa182, 0x007f, 0x00c8, 0x283f, 0x0078, 0x281c, 0x8201,
- 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f, 0x20a9, 0x0040, 0x20a1,
- 0x74c0, 0x2099, 0x74c0, 0x1078, 0x3272, 0x0078, 0x27f5, 0x1078,
- 0x29c3, 0x0040, 0x2409, 0x0c7e, 0x1078, 0x29ab, 0x0c7f, 0x0040,
- 0x2405, 0x2001, 0x6f52, 0x2004, 0xd0b4, 0x0040, 0x287c, 0x6000,
- 0xd08c, 0x00c0, 0x287c, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x287c, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078,
- 0x630f, 0x0040, 0x2405, 0x7007, 0x0003, 0x701b, 0x2878, 0x007c,
- 0x1078, 0x29c3, 0x0040, 0x2409, 0x20a9, 0x0029, 0x2c98, 0xade8,
- 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098,
- 0xad80, 0x0006, 0x20a0, 0x1078, 0x3272, 0x20a9, 0x0004, 0xac80,
- 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0, 0x1078, 0x3272, 0x2d00,
- 0x2009, 0x0029, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29e7,
- 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078,
- 0x362b, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x7828, 0xa08a,
- 0x1000, 0x00c8, 0x2409, 0x1078, 0x29c3, 0x0040, 0x2409, 0x2031,
- 0x000f, 0x1078, 0x3554, 0x8631, 0x00c8, 0x28b9, 0x2019, 0x0004,
- 0x1078, 0x3641, 0x7924, 0x810f, 0x7a28, 0x1078, 0x28c9, 0x0078,
- 0x23db, 0xa186, 0x00ff, 0x0040, 0x28d1, 0x1078, 0x28e1, 0x0078,
- 0x28e0, 0x2029, 0x007d, 0x2061, 0x6f00, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x28dd, 0x2508, 0x1078, 0x28e1, 0x8529, 0x00c8, 0x28d6,
- 0x007c, 0x1078, 0x34cb, 0x00c0, 0x28ec, 0x2200, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x1078, 0x4194, 0x007c, 0x81ff, 0x00c0, 0x2405,
- 0x1078, 0x29c3, 0x0040, 0x2409, 0x1078, 0x3554, 0x1078, 0x3636,
- 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040,
- 0x2409, 0x1078, 0x3554, 0x1078, 0x3620, 0x0078, 0x23db, 0x6100,
- 0x0078, 0x23db, 0x1078, 0x29c3, 0x0040, 0x2409, 0x6004, 0xa086,
- 0x0707, 0x0040, 0x2409, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003,
- 0x00c0, 0x2405, 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040,
- 0x2923, 0xace8, 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007,
- 0x783a, 0x6b04, 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c,
- 0x0200, 0x0078, 0x23db, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff,
- 0x0040, 0x293d, 0x81ff, 0x00c0, 0x2405, 0x7828, 0xa08a, 0x1000,
- 0x00c8, 0x2409, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff,
- 0x0040, 0x2951, 0xa182, 0x007e, 0x00c8, 0x2409, 0x2100, 0x1078,
- 0x1feb, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2061, 0x70c9,
- 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x0100, 0x6030, 0xa084,
- 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010,
- 0x2009, 0x001e, 0x2011, 0x324e, 0x1078, 0x4217, 0x7924, 0xa18c,
- 0xff00, 0x810f, 0x7a28, 0x1078, 0x28c9, 0x127f, 0x0c7f, 0x027f,
- 0x0078, 0x23db, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078,
- 0x3494, 0x2c08, 0x0c7f, 0x00c0, 0x2409, 0x0078, 0x23db, 0x017e,
- 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108, 0x280a,
- 0x8108, 0x00f0, 0x2989, 0x017f, 0x007c, 0x017e, 0x0a7e, 0x0b7e,
- 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000, 0x205c,
- 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a, 0x0b7f,
- 0x0a7f, 0x017f, 0x007c, 0x1078, 0x12c7, 0x0040, 0x29c2, 0xa006,
- 0x6802, 0x7010, 0xa005, 0x00c0, 0x29ba, 0x2d00, 0x7012, 0x7016,
- 0x0078, 0x29c0, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016,
- 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078,
- 0x34cb, 0x00c0, 0x29d1, 0xa6b4, 0x00ff, 0xa682, 0x0010, 0x0048,
- 0x29d2, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040,
- 0x29df, 0x2168, 0x6904, 0x1078, 0x12fb, 0x0078, 0x29d6, 0x7112,
- 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x29e9, 0x2031,
- 0x0000, 0x2061, 0x6fbd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a,
- 0x642e, 0x6532, 0x2c10, 0x1078, 0x1332, 0x7007, 0x0002, 0x701b,
- 0x23db, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000,
- 0x2001, 0x6f7b, 0x2004, 0xa005, 0x00c0, 0x2a14, 0x0068, 0x2a14,
- 0x7818, 0xd084, 0x00c0, 0x2a14, 0x781b, 0x0001, 0x7a22, 0x7b26,
- 0x2091, 0x4080, 0x0078, 0x2a38, 0x017e, 0x0c7e, 0x0e7e, 0x2071,
- 0x6f6d, 0x7138, 0xa182, 0x0008, 0x0048, 0x2a22, 0x7030, 0x2060,
- 0x0078, 0x2a33, 0x7030, 0xa0e0, 0x0008, 0xac82, 0x6fbd, 0x0048,
- 0x2a2b, 0x2061, 0x6f7d, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x2a31,
- 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x0e7f, 0x0c7f, 0x017f,
- 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0x6f6d, 0x7038, 0xa005,
- 0x0040, 0x2a72, 0x127e, 0x2091, 0x8000, 0x0068, 0x2a71, 0x0f7e,
- 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x2a70, 0x0c7e, 0x781b,
- 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x2091,
- 0x4080, 0x7038, 0x8001, 0x703a, 0xa005, 0x00c0, 0x2a66, 0x7033,
- 0x6f7d, 0x7037, 0x6f7d, 0x0c7f, 0x0078, 0x2a70, 0xac80, 0x0008,
- 0xa0fa, 0x6fbd, 0x0048, 0x2a6e, 0x2001, 0x6f7d, 0x7036, 0x0c7f,
- 0x0f7f, 0x127f, 0x0e7f, 0x007c, 0x027e, 0x2001, 0x6f52, 0x2004,
- 0xd0c4, 0x0040, 0x2a7f, 0x2011, 0x8014, 0x1078, 0x29fa, 0x027f,
- 0x007c, 0x81ff, 0x00c0, 0x2405, 0x127e, 0x2091, 0x8000, 0x6030,
- 0xc08d, 0x6032, 0x1078, 0x3229, 0x127f, 0x0078, 0x23db, 0x7824,
- 0x2008, 0xa18c, 0xfffd, 0x00c0, 0x2a9a, 0x61b4, 0xa10d, 0x61b6,
- 0x0078, 0x23db, 0x0078, 0x2409, 0x81ff, 0x00c0, 0x2405, 0x6000,
- 0xa086, 0x0003, 0x00c0, 0x2405, 0x2001, 0x6f52, 0x2004, 0xd0a4,
- 0x00c0, 0x2405, 0x1078, 0x29c3, 0x0040, 0x2409, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2ab9, 0x7828, 0xa005, 0x0040,
- 0x23db, 0x0c7e, 0x1078, 0x29ab, 0x0c7f, 0x0040, 0x2405, 0x6837,
- 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x637c,
- 0x0040, 0x2405, 0x7007, 0x0003, 0x701b, 0x2acf, 0x007c, 0x6830,
- 0xa086, 0x0100, 0x0040, 0x2405, 0x0078, 0x23db, 0x2001, 0x6f00,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x2405, 0x7f24, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x1078, 0x29ab, 0x0040, 0x2405, 0x2009, 0x0000,
- 0x2031, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000, 0xad80, 0x0005,
- 0x7026, 0x20a0, 0x1078, 0x34cb, 0x00c0, 0x2b1c, 0x6004, 0xa0c6,
- 0x0707, 0x0040, 0x2b1c, 0xa084, 0x00ff, 0xa0c6, 0x0006, 0x00c0,
- 0x2b1c, 0x87ff, 0x0040, 0x2b0f, 0xac80, 0x0006, 0x2098, 0x3400,
- 0x20a9, 0x0004, 0x53a3, 0x1078, 0x2995, 0x0078, 0x2b18, 0xac80,
- 0x000a, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x2995,
- 0x21a2, 0x94a0, 0xa6b0, 0x0005, 0x8108, 0xa186, 0x007e, 0x0040,
- 0x2b27, 0xa686, 0x0028, 0x0040, 0x2b30, 0x0078, 0x2af2, 0x86ff,
- 0x00c0, 0x2b2e, 0x7120, 0x810b, 0x0078, 0x23db, 0x702f, 0x0001,
- 0x711e, 0x7020, 0xa600, 0x7022, 0x772a, 0x2061, 0x6fbd, 0x6007,
- 0x0000, 0x6612, 0x7024, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
- 0x2c10, 0x1078, 0x1332, 0x7007, 0x0002, 0x701b, 0x2b48, 0x007c,
- 0x702c, 0xa005, 0x00c0, 0x2b5a, 0x711c, 0x7024, 0x20a0, 0x7728,
- 0x2031, 0x0000, 0x2061, 0x6fbd, 0x6224, 0x6328, 0x642c, 0x6530,
- 0x0078, 0x2af2, 0x7120, 0x810b, 0x0078, 0x23db, 0x127e, 0x0c7e,
- 0x0e7e, 0x2061, 0x0100, 0x2071, 0x6f00, 0x6044, 0xd0a4, 0x00c0,
- 0x2b87, 0xd084, 0x0040, 0x2b70, 0x1078, 0x2cae, 0x0078, 0x2b83,
- 0xd08c, 0x0040, 0x2b77, 0x1078, 0x2bc5, 0x0078, 0x2b83, 0xd094,
- 0x0040, 0x2b7e, 0x1078, 0x2ba8, 0x0078, 0x2b83, 0xd09c, 0x0040,
- 0x2b83, 0x1078, 0x2b91, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x017e,
- 0x6128, 0xd19c, 0x00c0, 0x2b8e, 0xc19d, 0x612a, 0x017f, 0x0078,
- 0x2b83, 0x6043, 0x0040, 0x6043, 0x0000, 0x7067, 0x0000, 0x707f,
- 0x0001, 0x709f, 0x0000, 0x2009, 0x74c0, 0x200b, 0x0000, 0x706b,
- 0x000f, 0x2009, 0x000f, 0x2011, 0x31e9, 0x1078, 0x4217, 0x007c,
- 0x7068, 0xa005, 0x00c0, 0x2bc4, 0x2011, 0x31e9, 0x1078, 0x4187,
- 0x6043, 0x0020, 0x6043, 0x0000, 0x6044, 0xd08c, 0x00c0, 0x2bc0,
- 0x707b, 0x0000, 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2bc4,
- 0x706f, 0x0000, 0x0078, 0x2bc4, 0x007c, 0x706c, 0xa08a, 0x0003,
- 0x00c8, 0x2bce, 0x1079, 0x2bd1, 0x0078, 0x2bd0, 0x1078, 0x1288,
- 0x007c, 0x2bd4, 0x2c23, 0x2cad, 0x0f7e, 0x706f, 0x0001, 0x20e1,
- 0xa000, 0x20e1, 0x8700, 0x1078, 0x1d4d, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x2079, 0x7300, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b,
- 0x0000, 0x780f, 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b,
- 0x0000, 0x781f, 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b,
- 0x0000, 0x782f, 0x0000, 0x2079, 0x730c, 0x207b, 0x1101, 0x7807,
- 0x0000, 0x2099, 0x6f05, 0x20a1, 0x730e, 0x20a9, 0x0004, 0x53a3,
- 0x2079, 0x7312, 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7300,
- 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f,
- 0x0000, 0x1078, 0x3210, 0x0f7f, 0x7073, 0x0000, 0x6043, 0x0008,
- 0x6043, 0x0000, 0x007c, 0x0d7e, 0x7070, 0x7073, 0x0000, 0xa025,
- 0x0040, 0x2c97, 0x6020, 0xd0b4, 0x00c0, 0x2c95, 0x717c, 0x81ff,
- 0x0040, 0x2c7e, 0xa486, 0x000c, 0x00c0, 0x2c89, 0xa480, 0x0018,
- 0x8004, 0x20a8, 0x2011, 0x7380, 0x2019, 0x7300, 0x220c, 0x2304,
- 0xa106, 0x00c0, 0x2c55, 0x8210, 0x8318, 0x00f0, 0x2c3e, 0x6043,
- 0x0004, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x706f,
- 0x0002, 0x707b, 0x0002, 0x0078, 0x2c95, 0x2069, 0x7380, 0x6930,
- 0xa18e, 0x1101, 0x00c0, 0x2c89, 0x6834, 0xa005, 0x00c0, 0x2c89,
- 0x6900, 0xa18c, 0x00ff, 0x00c0, 0x2c69, 0x6804, 0xa005, 0x0040,
- 0x2c7e, 0x2011, 0x738e, 0x2019, 0x6f05, 0x20a9, 0x0004, 0x220c,
- 0x2304, 0xa102, 0x0048, 0x2c7c, 0x00c0, 0x2c89, 0x8210, 0x8318,
- 0x00f0, 0x2c6f, 0x0078, 0x2c89, 0x707f, 0x0000, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x20a9, 0x0014,
- 0x53a6, 0x6043, 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0,
- 0x2c95, 0x60c3, 0x000c, 0x1078, 0x3210, 0x0d7f, 0x007c, 0x6020,
- 0xd0b4, 0x00c0, 0x2c95, 0x60c3, 0x000c, 0x2011, 0x70c0, 0x2013,
- 0x0000, 0x7073, 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7,
- 0x9575, 0x1078, 0x4f85, 0x0078, 0x2c95, 0x007c, 0x7078, 0xa08a,
- 0x001d, 0x00c8, 0x2cb7, 0x1079, 0x2cba, 0x0078, 0x2cb9, 0x1078,
- 0x1288, 0x007c, 0x2cde, 0x2ced, 0x2d1e, 0x2d33, 0x2d63, 0x2d8b,
- 0x2dbb, 0x2de5, 0x2e15, 0x2e3b, 0x2e86, 0x2ea8, 0x2ecc, 0x2ee2,
- 0x2f08, 0x2f1b, 0x2f24, 0x2f3d, 0x2f6b, 0x2f93, 0x2fc1, 0x2feb,
- 0x3030, 0x3065, 0x3087, 0x30c5, 0x30e9, 0x3102, 0x310f, 0x7003,
- 0x0007, 0x6004, 0xa084, 0xfff9, 0x6006, 0x007c, 0x608b, 0xbc94,
- 0x608f, 0xf0f0, 0x6043, 0x0002, 0x707b, 0x0001, 0x2009, 0x07d0,
- 0x2011, 0x31f0, 0x1078, 0x417a, 0x007c, 0x0f7e, 0x7070, 0xa086,
- 0x0014, 0x00c0, 0x2d1c, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0,
- 0x2d1c, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d1a,
- 0x7834, 0xa005, 0x00c0, 0x2d1a, 0x7a38, 0xd2fc, 0x0040, 0x2d10,
- 0x709c, 0xa005, 0x00c0, 0x2d10, 0x1078, 0x32a9, 0x709f, 0x0001,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0x707b, 0x0010, 0x1078, 0x2f24,
- 0x0078, 0x2d1c, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0003,
- 0x6043, 0x0004, 0x1078, 0x327a, 0x20a3, 0x1102, 0x20a3, 0x0000,
- 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x2d2a, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2d61,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2d5d,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d5d, 0x7834,
- 0xa005, 0x00c0, 0x2d5d, 0x7a38, 0xd2fc, 0x0040, 0x2d57, 0x709c,
- 0xa005, 0x00c0, 0x2d57, 0x1078, 0x32a9, 0x709f, 0x0001, 0x707b,
- 0x0004, 0x1078, 0x2d63, 0x0078, 0x2d61, 0x707b, 0x0002, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0005, 0x1078, 0x327a, 0x20a3,
- 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa005,
- 0x00c0, 0x2d7d, 0x714c, 0xa186, 0xffff, 0x0040, 0x2d7d, 0x1078,
- 0x31b4, 0x0040, 0x2d7d, 0x1078, 0x32a9, 0x20a9, 0x0008, 0x2298,
- 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2db9,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2db5,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2db5, 0x7834,
- 0xa005, 0x00c0, 0x2db5, 0x7a38, 0xd2fc, 0x0040, 0x2daf, 0x709c,
- 0xa005, 0x00c0, 0x2daf, 0x1078, 0x32a9, 0x709f, 0x0001, 0x707b,
- 0x0006, 0x1078, 0x2dbb, 0x0078, 0x2db9, 0x707b, 0x0002, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0007, 0x1078, 0x327a, 0x20a3,
- 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa005,
- 0x00c0, 0x2dd7, 0x7150, 0xa186, 0xffff, 0x0040, 0x2dd7, 0xa180,
- 0x2207, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x31b4, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x2e13, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014,
- 0x00c0, 0x2e0f, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1104, 0x00c0,
- 0x2e0f, 0x7834, 0xa005, 0x00c0, 0x2e0f, 0x7a38, 0xd2fc, 0x0040,
- 0x2e09, 0x709c, 0xa005, 0x00c0, 0x2e09, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x707b, 0x0008, 0x1078, 0x2e15, 0x0078, 0x2e13, 0x707b,
- 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0009, 0x1078,
- 0x327a, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, 0x7064, 0xa005,
- 0x00c0, 0x2e28, 0x1078, 0x311e, 0x0040, 0x2e38, 0x0078, 0x2e32,
- 0x20a9, 0x0008, 0x2099, 0x738e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3210, 0x0078, 0x2e3a,
- 0x1078, 0x2cd7, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2e84,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2e80,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1105, 0x00c0, 0x2e80, 0x7834,
- 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2e69, 0x7a38, 0xd2fc, 0x0040,
- 0x2e61, 0x709c, 0xa005, 0x00c0, 0x2e61, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x7077, 0x0001, 0x707b, 0x000a, 0x1078, 0x2e86, 0x0078,
- 0x2e84, 0xa005, 0x00c0, 0x2e80, 0x7a38, 0xd2fc, 0x0040, 0x2e78,
- 0x709c, 0xa005, 0x00c0, 0x2e78, 0x1078, 0x32a9, 0x709f, 0x0001,
- 0x7077, 0x0000, 0x707b, 0x000e, 0x1078, 0x2f08, 0x0078, 0x2e84,
- 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000b,
- 0x2011, 0x730e, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4,
- 0x20a9, 0x0002, 0x2009, 0x0000, 0x41a4, 0x1078, 0x327a, 0x20a3,
- 0x1106, 0x20a3, 0x0000, 0x6030, 0xa085, 0x0100, 0x2012, 0x2298,
- 0x20a9, 0x0042, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x3210, 0x007c,
- 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2eca, 0x2011, 0x31f0, 0x1078,
- 0x4187, 0xa086, 0x0084, 0x00c0, 0x2ec6, 0x2079, 0x7380, 0x7a30,
- 0xa296, 0x1106, 0x00c0, 0x2ec6, 0x7834, 0xa005, 0x00c0, 0x2ec6,
- 0x707b, 0x000c, 0x1078, 0x2ecc, 0x0078, 0x2eca, 0x707b, 0x0002,
- 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000d, 0x1078, 0x327a,
- 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099, 0x738e, 0x20a9, 0x0040,
- 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078,
- 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f06, 0x2011,
- 0x31f0, 0x1078, 0x4187, 0xa086, 0x0084, 0x00c0, 0x2f02, 0x2079,
- 0x7380, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x2f02, 0x7834, 0xa005,
- 0x00c0, 0x2f02, 0x1078, 0x326c, 0x707b, 0x000e, 0x1078, 0x2f08,
- 0x0078, 0x2f06, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c,
- 0x707b, 0x000f, 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5,
- 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x31f0,
- 0x1078, 0x417a, 0x007c, 0x7070, 0xa005, 0x0040, 0x2f23, 0x2011,
- 0x31f0, 0x1078, 0x4187, 0x007c, 0x707b, 0x0011, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x7470, 0xa480,
- 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6,
- 0x60c3, 0x0014, 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x2f69, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014,
- 0x00c0, 0x2f67, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1103, 0x00c0,
- 0x2f67, 0x7834, 0xa005, 0x00c0, 0x2f67, 0x7a38, 0xd2fc, 0x0040,
- 0x2f61, 0x709c, 0xa005, 0x00c0, 0x2f61, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x707b, 0x0012, 0x1078, 0x2f6b, 0x0078, 0x2f69, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0013, 0x1078, 0x3286, 0x20a3,
- 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa005,
- 0x00c0, 0x2f85, 0x714c, 0xa186, 0xffff, 0x0040, 0x2f85, 0x1078,
- 0x31b4, 0x0040, 0x2f85, 0x1078, 0x32a9, 0x20a9, 0x0008, 0x2298,
+ 0x2004, 0xa084, 0x0007, 0x0079, 0x1b35, 0x1b3d, 0x1b3e, 0x1b41,
+ 0x1b44, 0x1b49, 0x1b4c, 0x1b51, 0x1b56, 0x007c, 0x1078, 0x1933,
+ 0x007c, 0x1078, 0x16e5, 0x007c, 0x1078, 0x16e5, 0x1078, 0x1933,
+ 0x007c, 0x1078, 0x143e, 0x007c, 0x1078, 0x1933, 0x1078, 0x143e,
+ 0x007c, 0x1078, 0x16e5, 0x1078, 0x143e, 0x007c, 0x1078, 0x16e5,
+ 0x1078, 0x1933, 0x1078, 0x143e, 0x007c, 0x127e, 0x2091, 0x2300,
+ 0x2079, 0x0200, 0x2071, 0x7280, 0x2069, 0x6d00, 0x2009, 0x0004,
+ 0x7912, 0x7916, 0x1078, 0x1df6, 0x781b, 0x0002, 0x20e1, 0x8700,
+ 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007,
+ 0x0079, 0x1b7a, 0x1b9e, 0x1b82, 0x1b86, 0x1b8a, 0x1b90, 0x1b94,
+ 0x1b98, 0x1b9c, 0x1078, 0x3d7c, 0x0078, 0x1b9e, 0x1078, 0x3db0,
+ 0x0078, 0x1b9e, 0x1078, 0x3d7c, 0x1078, 0x3db0, 0x0078, 0x1b9e,
+ 0x1078, 0x1ba0, 0x0078, 0x1b9e, 0x1078, 0x1ba0, 0x0078, 0x1b9e,
+ 0x1078, 0x1ba0, 0x0078, 0x1b9e, 0x1078, 0x1ba0, 0x127f, 0x007c,
+ 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1baa,
+ 0x1078, 0x12b7, 0xa184, 0x0030, 0x0040, 0x1bbb, 0x6a00, 0xa286,
+ 0x0003, 0x00c0, 0x1bb5, 0x1078, 0x12b7, 0x1078, 0x31cb, 0x20e1,
+ 0x9010, 0x0078, 0x1bc7, 0xa184, 0x00c0, 0x0040, 0x1bc1, 0x1078,
+ 0x12b7, 0xa184, 0x0300, 0x0040, 0x1bc7, 0x20e1, 0x9020, 0x7932,
+ 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071,
+ 0x6d00, 0x7128, 0x2001, 0x6f03, 0x2102, 0x2001, 0x6f0b, 0x2102,
+ 0xa182, 0x0211, 0x00c8, 0x1be0, 0x2009, 0x0008, 0x0078, 0x1c0a,
+ 0xa182, 0x0259, 0x00c8, 0x1be8, 0x2009, 0x0007, 0x0078, 0x1c0a,
+ 0xa182, 0x02c1, 0x00c8, 0x1bf0, 0x2009, 0x0006, 0x0078, 0x1c0a,
+ 0xa182, 0x0349, 0x00c8, 0x1bf8, 0x2009, 0x0005, 0x0078, 0x1c0a,
+ 0xa182, 0x0421, 0x00c8, 0x1c00, 0x2009, 0x0004, 0x0078, 0x1c0a,
+ 0xa182, 0x0581, 0x00c8, 0x1c08, 0x2009, 0x0003, 0x0078, 0x1c0a,
+ 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0x7916, 0x1078, 0x1df6,
+ 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061,
+ 0x0100, 0x2071, 0x6d00, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7,
+ 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043,
+ 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x0caf, 0x600f,
+ 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x6d2d, 0x2003,
+ 0x0000, 0x2001, 0x6d2c, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091,
+ 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0,
+ 0x1c4d, 0xa184, 0x0007, 0x0079, 0x1c53, 0xa195, 0x0004, 0xa284,
+ 0x0007, 0x0079, 0x1c53, 0x1c7f, 0x1c5b, 0x1c5f, 0x1c63, 0x1c69,
+ 0x1c6d, 0x1c73, 0x1c79, 0x1078, 0x4226, 0x0078, 0x1c7f, 0x1078,
+ 0x42e4, 0x0078, 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x4226, 0x0078,
+ 0x1c7f, 0x1078, 0x1c84, 0x0078, 0x1c7f, 0x1078, 0x4226, 0x1078,
+ 0x1c84, 0x0078, 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x1c84, 0x0078,
+ 0x1c7f, 0x1078, 0x42e4, 0x1078, 0x4226, 0x1078, 0x1c84, 0x027f,
+ 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1d24, 0x017e,
+ 0x047e, 0x0c7e, 0x644c, 0x74ba, 0xa48c, 0xff00, 0xa196, 0xff00,
+ 0x0040, 0x1cb3, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040,
+ 0x1cb3, 0x7130, 0xd18c, 0x00c0, 0x1cb3, 0x2011, 0x6d52, 0x2214,
+ 0xd2ec, 0x0040, 0x1ca7, 0xc18d, 0x7132, 0x0078, 0x1cb3, 0x6240,
+ 0xa294, 0x0010, 0x0040, 0x1cf2, 0x6248, 0xa294, 0xff00, 0xa296,
+ 0xff00, 0x00c0, 0x1cf2, 0x2011, 0x8013, 0x1078, 0x2a53, 0x7130,
+ 0xc185, 0x7132, 0x2011, 0x6d52, 0x220c, 0xd1a4, 0x0040, 0x1cda,
+ 0x017e, 0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x41f4, 0x2019,
+ 0x000e, 0x1078, 0x6b8f, 0xa484, 0x00ff, 0xa080, 0x2091, 0x200c,
+ 0xa18c, 0xff00, 0x810f, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078,
+ 0x6bf7, 0x017f, 0xd1ac, 0x00c0, 0x1ce3, 0x2019, 0x0004, 0x1078,
+ 0x202f, 0x0078, 0x1cf2, 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000,
+ 0x1078, 0x3447, 0x00c0, 0x1cee, 0x1078, 0x3256, 0x8108, 0x00f0,
+ 0x1ce8, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7,
+ 0x1078, 0x3233, 0x2011, 0x0003, 0x1078, 0x5232, 0x2011, 0x0002,
+ 0x1078, 0x523c, 0x1078, 0x5148, 0x1078, 0x414c, 0x037e, 0x2019,
+ 0x0000, 0x1078, 0x51da, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001,
+ 0x6d00, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1d1c, 0xd19c, 0x00c0,
+ 0x1d1c, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x6d20,
+ 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x1d9d, 0x017e,
+ 0x6220, 0xd2b4, 0x0040, 0x1d5b, 0x1078, 0x414c, 0x1078, 0x4fe5,
+ 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
+ 0x0040, 0x1d3e, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
+ 0x2061, 0x6f10, 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1d4e, 0x8000,
+ 0x602a, 0x0c7f, 0x1078, 0x4fd7, 0x0078, 0x1d9c, 0x2019, 0x6f19,
+ 0x2304, 0xa065, 0x0040, 0x1d58, 0x2009, 0x0014, 0x1078, 0x5591,
+ 0x0c7f, 0x0078, 0x1d9c, 0xd2bc, 0x0040, 0x1d9c, 0x1078, 0x415a,
+ 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804,
+ 0xa084, 0x4000, 0x0040, 0x1d70, 0x6803, 0x1000, 0x6803, 0x0000,
+ 0x0d7f, 0x0c7e, 0x2061, 0x6f10, 0x6044, 0xa09a, 0x0002, 0x00c8,
+ 0x1d91, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1d9c,
+ 0x1078, 0x4151, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0,
+ 0x1d8d, 0x6017, 0x0012, 0x0078, 0x1d9c, 0x6017, 0x0016, 0x0078,
+ 0x1d9c, 0x2019, 0x6f1f, 0x2304, 0xa065, 0x0040, 0x1d9b, 0x2009,
+ 0x004a, 0x1078, 0x5591, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1dc5,
+ 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x5232,
+ 0x2011, 0x0002, 0x1078, 0x523c, 0x1078, 0x5148, 0x1078, 0x414c,
+ 0x037e, 0x2019, 0x0000, 0x1078, 0x51da, 0x037f, 0x60e3, 0x0000,
+ 0x1078, 0x6c5f, 0x1078, 0x6c7d, 0x2001, 0x6d00, 0x2003, 0x0004,
+ 0x6027, 0x0008, 0x1078, 0x11aa, 0x017f, 0xa18c, 0xffd0, 0x6126,
+ 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6d00, 0x71b0, 0x70b2, 0xa116, 0x0040, 0x1def,
+ 0x81ff, 0x0040, 0x1de1, 0x2011, 0x8011, 0x1078, 0x2a53, 0x0078,
+ 0x1def, 0x2011, 0x8012, 0x1078, 0x2a53, 0x037e, 0x0c7e, 0x2061,
+ 0x0100, 0x2019, 0x0028, 0x1078, 0x202f, 0x0c7f, 0x037f, 0x127f,
+ 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e,
+ 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x1e09, 0x2204, 0x60f2,
+ 0xa190, 0x1e12, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f,
+ 0x007c, 0x083e, 0x083e, 0x083e, 0x0580, 0x0420, 0x0348, 0x02c0,
+ 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8,
+ 0x00d0, 0x00b0, 0x00a0, 0x2028, 0x2130, 0xa094, 0xff00, 0x00c0,
+ 0x1e24, 0x81ff, 0x0040, 0x1e28, 0x1078, 0x3f00, 0x0078, 0x1e2f,
+ 0xa080, 0x2091, 0x200c, 0xa18c, 0xff00, 0x810f, 0xa006, 0x007c,
+ 0xa080, 0x2091, 0x200c, 0xa18c, 0x00ff, 0x007c, 0x1e56, 0x1e5a,
+ 0x1e5e, 0x1e64, 0x1e6a, 0x1e70, 0x1e76, 0x1e7e, 0x1e86, 0x1e8c,
+ 0x1e92, 0x1e9a, 0x1ea2, 0x1eaa, 0x1eb2, 0x1ebc, 0x1ec6, 0x1ec6,
+ 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6,
+ 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x1ec6, 0x107e, 0x007e,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1c3e, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x0078, 0x1edf,
+ 0x107e, 0x007e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1c3e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1c3e, 0x1078, 0x1b2e, 0x0078, 0x1edf, 0x107e, 0x007e,
+ 0x1078, 0x1b72, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1b2e, 0x1078, 0x1b72,
+ 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e, 0x1078, 0x1b2e,
+ 0x1078, 0x1b72, 0x0078, 0x1edf, 0x107e, 0x007e, 0x1078, 0x1c3e,
+ 0x1078, 0x1b2e, 0x1078, 0x1b72, 0x0078, 0x1edf, 0x0005, 0x0078,
+ 0x1ec6, 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x1ecf, 0x1edf,
+ 0x1e5c, 0x1e60, 0x1e66, 0x1e6c, 0x1e72, 0x1e78, 0x1e80, 0x1e88,
+ 0x1e8e, 0x1e94, 0x1e9c, 0x1ea4, 0x1eac, 0x1eb4, 0x1ebe, 0x0008,
+ 0x1ec9, 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e,
+ 0x2041, 0x007e, 0x70bc, 0xd09c, 0x0040, 0x1ef0, 0x2041, 0x007f,
+ 0x2001, 0x010c, 0x203c, 0x727c, 0x82ff, 0x0040, 0x1f3b, 0x037e,
+ 0x738c, 0xa38e, 0xffff, 0x00c0, 0x1eff, 0x2019, 0x0001, 0x8314,
+ 0xa2e0, 0x73c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x1f0c, 0xa084,
+ 0xff00, 0x8007, 0x0078, 0x1f0e, 0xa084, 0x00ff, 0xa70e, 0x0040,
+ 0x1f30, 0xa08e, 0x00ff, 0x0040, 0x1f36, 0x2009, 0x0000, 0x1078,
+ 0x1e1b, 0x1078, 0x3410, 0x00c0, 0x1f33, 0x6004, 0xa084, 0x00ff,
+ 0xa086, 0x0006, 0x00c0, 0x1f2a, 0x1078, 0x1f8d, 0x0040, 0x1f33,
+ 0x0078, 0x1f30, 0x1078, 0x208d, 0x1078, 0x1fb4, 0x0040, 0x1f33,
+ 0x8318, 0x0078, 0x1eff, 0x738e, 0x0078, 0x1f38, 0x708f, 0xffff,
+ 0x037f, 0x0078, 0x1f8a, 0xa780, 0x2091, 0x203c, 0xa7bc, 0xff00,
+ 0x873f, 0x708c, 0xa096, 0xffff, 0x0040, 0x1f4d, 0xa812, 0x00c8,
+ 0x1f5d, 0x708f, 0xffff, 0x0078, 0x1f87, 0x2009, 0x0000, 0x70bc,
+ 0xd09c, 0x0040, 0x1f58, 0xd094, 0x0040, 0x1f58, 0x2009, 0x007e,
+ 0x2100, 0xa802, 0x20a8, 0x0078, 0x1f61, 0x2008, 0x2810, 0xa202,
+ 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x1f7e, 0x1078,
+ 0x3410, 0x00c0, 0x1f87, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x00c0, 0x1f78, 0x1078, 0x1f8d, 0x0040, 0x1f87, 0x0078, 0x1f7e,
+ 0x1078, 0x208d, 0x1078, 0x1fb4, 0x0040, 0x1f87, 0x017f, 0x8108,
+ 0x157f, 0x00f0, 0x1f61, 0x708f, 0xffff, 0x0078, 0x1f8a, 0x017f,
+ 0x157f, 0x718e, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e,
+ 0x0c7e, 0x2c68, 0x1078, 0x5504, 0x0040, 0x1faf, 0x2d00, 0x601a,
+ 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0000,
+ 0x1078, 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a,
+ 0x127f, 0x2009, 0x0004, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f,
+ 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x5504, 0x0040, 0x1fd6, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078,
+ 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f,
+ 0x2009, 0x0002, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078,
+ 0x3410, 0x00c0, 0x1fe9, 0x1078, 0x1fec, 0x0040, 0x1fe9, 0x70c3,
+ 0xffff, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x5504, 0x0040, 0x200e, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078,
+ 0x33f3, 0x127e, 0x2091, 0x8000, 0x70c4, 0x8000, 0x70c6, 0x127f,
+ 0x2009, 0x0002, 0x1078, 0x5591, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x0c7e, 0x0d7e, 0x2009, 0x007f, 0x1078,
+ 0x3410, 0x00c0, 0x202c, 0x2c68, 0x1078, 0x5504, 0x0040, 0x202c,
+ 0x2d00, 0x601a, 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022,
+ 0x1078, 0x5591, 0xa085, 0x0001, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e,
+ 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078, 0x4463, 0x1078, 0x4417,
+ 0x1078, 0x59ce, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078,
+ 0x3447, 0x00c0, 0x2047, 0x1078, 0x35cf, 0x1078, 0x3256, 0x017f,
+ 0x8108, 0x00f0, 0x203e, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f,
+ 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270,
+ 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9,
+ 0x2c08, 0x1078, 0x6a57, 0x017f, 0x2e60, 0x1078, 0x35cf, 0x1078,
+ 0x3256, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e,
+ 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x00c0, 0x2083,
+ 0x2071, 0x6d00, 0x7088, 0xa005, 0x0040, 0x2080, 0x8001, 0x708a,
+ 0x007f, 0x0e7f, 0x007c, 0x2071, 0x6d00, 0x70c4, 0xa005, 0x0040,
+ 0x2080, 0x8001, 0x70c6, 0x0078, 0x2080, 0x6000, 0xc08c, 0x6002,
+ 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc,
+ 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1,
+ 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6,
+ 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4,
+ 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa,
+ 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d,
+ 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282,
+ 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074,
+ 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a,
+ 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559,
+ 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d,
+ 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043,
+ 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932,
+ 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227,
+ 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18,
+ 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000,
+ 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000,
+ 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00,
+ 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900,
+ 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200,
+ 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00,
+ 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600,
+ 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00,
+ 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900,
+ 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000,
+ 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000,
+ 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x2071, 0x6d6d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016,
+ 0x703a, 0x703e, 0x7033, 0x6d7d, 0x7037, 0x6d7d, 0x7007, 0x0001,
+ 0x2061, 0x6d9d, 0x6003, 0x0002, 0x007c, 0x0090, 0x21b8, 0x0068,
+ 0x21b8, 0x2071, 0x6d6d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x21b8,
+ 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x229c, 0x0079, 0x223c,
+ 0x007c, 0x2071, 0x6d6d, 0x7004, 0x0079, 0x21be, 0x21c2, 0x21c3,
+ 0x21cd, 0x21df, 0x007c, 0x0090, 0x21cc, 0x0068, 0x21cc, 0x2b78,
+ 0x7818, 0xd084, 0x0040, 0x21eb, 0x007c, 0x2b78, 0x2061, 0x6d9d,
+ 0x6008, 0xa08e, 0x0100, 0x0040, 0x21da, 0xa086, 0x0200, 0x0040,
+ 0x2294, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010,
+ 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x21e7, 0x007c, 0x2a60,
+ 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8,
+ 0x21f4, 0x61b0, 0x0079, 0x21fc, 0x2100, 0xa08a, 0x0033, 0x00c8,
+ 0x2290, 0x61b0, 0x0079, 0x223c, 0x2272, 0x22a4, 0x22ac, 0x22b0,
+ 0x22b8, 0x22be, 0x22c2, 0x22cb, 0x22cf, 0x22d7, 0x22db, 0x2290,
+ 0x2290, 0x2290, 0x22df, 0x2290, 0x22ef, 0x2306, 0x231d, 0x2399,
+ 0x239e, 0x23cb, 0x2416, 0x2425, 0x2446, 0x247c, 0x2486, 0x2493,
+ 0x24a6, 0x24be, 0x24c7, 0x2504, 0x250a, 0x2290, 0x251a, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x251e, 0x2524, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x252c, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2539, 0x253f, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x22d7, 0x22db, 0x2290, 0x2290,
+ 0x2551, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290, 0x2290,
+ 0x2290, 0x2290, 0x2290, 0x2290, 0x259e, 0x265d, 0x2671, 0x2678,
+ 0x26db, 0x2736, 0x2741, 0x2783, 0x2790, 0x279d, 0x27a0, 0x2555,
+ 0x27c9, 0x2811, 0x281e, 0x28fd, 0x29cb, 0x29f2, 0x2ade, 0x713c,
+ 0x0078, 0x2272, 0x2021, 0x4000, 0x1078, 0x2a2d, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x227f, 0x7818, 0xd084, 0x0040, 0x2282, 0x127f,
+ 0x0078, 0x2276, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e,
+ 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f, 0x007c,
+ 0x2021, 0x4001, 0x0078, 0x2274, 0x2021, 0x4002, 0x0078, 0x2274,
+ 0x2021, 0x4003, 0x0078, 0x2274, 0x2021, 0x4005, 0x0078, 0x2274,
+ 0x2021, 0x4006, 0x0078, 0x2274, 0xa02e, 0x2520, 0x7b28, 0x7a2c,
+ 0x7824, 0x7930, 0x0078, 0x2a3c, 0x7823, 0x0004, 0x7824, 0x007a,
+ 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2a40,
+ 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x2272, 0x7924, 0x2114,
+ 0x0078, 0x2272, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007,
+ 0x53a3, 0x0078, 0x2272, 0x7824, 0x2060, 0x0078, 0x22e1, 0x2009,
+ 0x0001, 0x2011, 0x000d, 0x2019, 0x0000, 0x0078, 0x2272, 0x7d38,
+ 0x7c3c, 0x0078, 0x22a6, 0x7d38, 0x7c3c, 0x0078, 0x22b2, 0x2061,
+ 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0,
+ 0x22e3, 0x2010, 0xa005, 0x0040, 0x2272, 0x0078, 0x2298, 0x2061,
+ 0x6d51, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x22a0, 0x8019, 0x0040,
+ 0x22a0, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056, 0xa006,
+ 0x605a, 0x605e, 0x1078, 0x3890, 0x0078, 0x2272, 0x2061, 0x6d51,
+ 0x7824, 0x7930, 0xa11a, 0x00c8, 0x22a0, 0x8019, 0x0040, 0x22a0,
+ 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006, 0x606a,
+ 0x606e, 0x1078, 0x366e, 0x0078, 0x2272, 0xa02e, 0x2520, 0x81ff,
+ 0x00c0, 0x229c, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1,
+ 0x6d74, 0x41a1, 0x1078, 0x2a04, 0x0040, 0x229c, 0x2009, 0x0020,
+ 0x1078, 0x2a3c, 0x701b, 0x2335, 0x007c, 0x6834, 0x2008, 0xa084,
+ 0x00ff, 0xa096, 0x0011, 0x0040, 0x2341, 0xa096, 0x0019, 0x00c0,
+ 0x229c, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x229c, 0x710e, 0x700c,
+ 0x8001, 0x0040, 0x2372, 0x700e, 0x1078, 0x2a04, 0x0040, 0x229c,
+ 0x2009, 0x0020, 0x2061, 0x6d9d, 0x6224, 0x6328, 0x642c, 0x6530,
+ 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000,
+ 0x1078, 0x2a3c, 0x701b, 0x2365, 0x007c, 0x6834, 0xa084, 0x00ff,
+ 0xa096, 0x0002, 0x0040, 0x2370, 0xa096, 0x000a, 0x00c0, 0x229c,
+ 0x0078, 0x2347, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078,
+ 0x3344, 0x00c0, 0x2380, 0x7007, 0x0003, 0x701b, 0x2382, 0x007c,
+ 0x1078, 0x372d, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099,
+ 0x6d74, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000,
+ 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f, 0x0078,
+ 0x2a40, 0x6198, 0x7824, 0x609a, 0x0078, 0x2272, 0x2091, 0x8000,
+ 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f, 0x2020,
+ 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100,
+ 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a, 0x2009,
+ 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091,
+ 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8,
+ 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x7c28, 0x7d2c, 0x1078, 0x3592, 0xd28c, 0x00c0,
+ 0x23dd, 0x1078, 0x3522, 0x0078, 0x23df, 0x1078, 0x355e, 0x00c0,
+ 0x2409, 0x2061, 0x7400, 0x127e, 0x2091, 0x8000, 0x6000, 0xa086,
+ 0x0000, 0x0040, 0x23f7, 0x6010, 0xa06d, 0x0040, 0x23f7, 0x683c,
+ 0xa406, 0x00c0, 0x23f7, 0x6840, 0xa506, 0x0040, 0x2402, 0x127f,
+ 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8, 0x229c,
+ 0x0078, 0x23e3, 0x1078, 0x5f5d, 0x127f, 0x0040, 0x229c, 0x0078,
+ 0x2272, 0xa00e, 0x2001, 0x0005, 0x1078, 0x372d, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x36a1, 0x127f, 0x0078, 0x2272, 0x81ff, 0x00c0,
+ 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x34d7, 0x1078,
+ 0x35a3, 0x0040, 0x229c, 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c,
+ 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x2031, 0x000f, 0x1078, 0x34d7,
+ 0x8631, 0x00c8, 0x242e, 0x2019, 0x0005, 0x1078, 0x35c4, 0x0040,
+ 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x22a0, 0x8003, 0x800b,
+ 0x810b, 0xa108, 0x1078, 0x40de, 0x0078, 0x2272, 0x127e, 0x2091,
+ 0x8000, 0x81ff, 0x00c0, 0x2476, 0x2029, 0x00ff, 0x644c, 0x2400,
+ 0xa506, 0x0040, 0x2470, 0x2508, 0x1078, 0x3447, 0x00c0, 0x2470,
+ 0x2031, 0x000f, 0x1078, 0x34d7, 0x8631, 0x00c8, 0x245a, 0x2019,
+ 0x0004, 0x1078, 0x35c4, 0x0040, 0x2476, 0x7824, 0xa08a, 0x1000,
+ 0x00c8, 0x2479, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x40de,
+ 0x8529, 0x00c8, 0x244f, 0x127f, 0x0078, 0x2272, 0x127f, 0x0078,
+ 0x229c, 0x127f, 0x0078, 0x22a0, 0x1078, 0x2a1c, 0x0040, 0x22a0,
+ 0x1078, 0x3507, 0x1078, 0x3592, 0x0078, 0x2272, 0x81ff, 0x00c0,
+ 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x34f0, 0x1078,
+ 0x3592, 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x3561, 0x0040, 0x229c, 0x1078, 0x338c,
+ 0x1078, 0x351b, 0x1078, 0x3592, 0x0078, 0x2272, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x34d7, 0x62a0, 0x2019, 0x0005, 0x0c7e,
+ 0x1078, 0x35cf, 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08,
+ 0x1078, 0x6a57, 0x1078, 0x3592, 0x0078, 0x2272, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x3592, 0x2208, 0x0078, 0x2272, 0x157e,
+ 0x0d7e, 0x0e7e, 0x2069, 0x6ddf, 0x6810, 0x6914, 0xa10a, 0x00c8,
+ 0x24d3, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000,
+ 0x20a9, 0x007e, 0x2069, 0x6e00, 0x2d04, 0xa075, 0x0040, 0x24e8,
+ 0x704c, 0x1078, 0x24f2, 0xa210, 0x7080, 0x1078, 0x24f2, 0xa318,
+ 0x8d68, 0x00f0, 0x24dc, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f,
+ 0x0078, 0x2272, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2501, 0x2001,
+ 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2501, 0x2178, 0x0078,
+ 0x24f9, 0x017f, 0x0f7f, 0x007c, 0x2069, 0x6ddf, 0x6910, 0x629c,
+ 0x0078, 0x2272, 0x81ff, 0x00c0, 0x229c, 0x614c, 0xa190, 0x2091,
+ 0x2214, 0xa294, 0x00ff, 0x6068, 0xa084, 0xff00, 0xa215, 0x6364,
+ 0x0078, 0x2272, 0x613c, 0x6240, 0x0078, 0x2272, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x0078, 0x2272, 0x1078, 0x2a1c, 0x0040, 0x22a0,
+ 0x6244, 0x6338, 0x0078, 0x2272, 0x613c, 0x6240, 0x7824, 0x603e,
+ 0x7b28, 0x6342, 0x2069, 0x6d51, 0x831f, 0xa305, 0x6816, 0x0078,
+ 0x2272, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x0078, 0x2272, 0x1078,
+ 0x2a1c, 0x0040, 0x22a0, 0x7828, 0xa00d, 0x0040, 0x22a0, 0x782c,
+ 0xa005, 0x0040, 0x22a0, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078,
+ 0x2272, 0x7d38, 0x7c3c, 0x0078, 0x231f, 0x7824, 0xa09c, 0x00ff,
+ 0xa39a, 0x0003, 0x00c8, 0x229c, 0x624c, 0xa084, 0xff00, 0x8007,
+ 0xa206, 0x00c0, 0x256d, 0x2001, 0x6d40, 0x2009, 0x000c, 0x7a2c,
+ 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x81ff, 0x00c0, 0x229c,
+ 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x6004, 0xa084, 0x00ff, 0xa086,
+ 0x0006, 0x00c0, 0x229c, 0x0c7e, 0x1078, 0x2a04, 0x0c7f, 0x0040,
+ 0x229c, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x6223,
+ 0x0040, 0x229c, 0x7007, 0x0003, 0x701b, 0x258f, 0x007c, 0x6830,
+ 0xa086, 0x0100, 0x0040, 0x229c, 0xad80, 0x000e, 0x2009, 0x000c,
+ 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x1078, 0x2a04,
+ 0x0040, 0x229c, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
+ 0x1078, 0x2a3c, 0x701b, 0x25ad, 0x007c, 0xade8, 0x000d, 0x6800,
+ 0xa005, 0x0040, 0x22a0, 0x6804, 0xd0ac, 0x0040, 0x25ba, 0xd0a4,
+ 0x0040, 0x22a0, 0xd094, 0x0040, 0x25c5, 0x0c7e, 0x2061, 0x0100,
+ 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x25d0,
+ 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f,
+ 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x25e5, 0xd084,
+ 0x0040, 0x25e5, 0x6828, 0xa08a, 0x007f, 0x00c8, 0x22a0, 0xa088,
+ 0x2091, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040, 0x25ee,
+ 0x6828, 0xa08a, 0x007f, 0x00c8, 0x22a0, 0x604e, 0x6808, 0xa08a,
+ 0x0100, 0x0048, 0x22a0, 0xa08a, 0x0841, 0x00c8, 0x22a0, 0xa084,
+ 0x0007, 0x00c0, 0x22a0, 0x680c, 0xa005, 0x0040, 0x22a0, 0x6810,
+ 0xa005, 0x0040, 0x22a0, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x22a0,
+ 0x8001, 0x0040, 0x22a0, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x22a0,
+ 0x8001, 0x0040, 0x22a0, 0x20a9, 0x001c, 0x2d98, 0x2069, 0x6d51,
+ 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084,
+ 0x00ff, 0x6042, 0x1078, 0x3890, 0x1078, 0x366e, 0x6000, 0xa086,
+ 0x0000, 0x00c0, 0x265b, 0x6808, 0x602a, 0x1078, 0x1bcc, 0x6818,
+ 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016,
+ 0x611a, 0x621e, 0x6322, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+ 0x6312, 0x1078, 0x4168, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
+ 0x602f, 0x0000, 0x0c7f, 0x60b4, 0xa005, 0x0040, 0x2657, 0x6003,
+ 0x0001, 0x2091, 0x301d, 0x1078, 0x31cb, 0x0078, 0x265b, 0x6003,
+ 0x0004, 0x2091, 0x301d, 0x0078, 0x2272, 0x6000, 0xa086, 0x0000,
+ 0x0040, 0x229c, 0x2069, 0x6d51, 0x7830, 0x6842, 0x7834, 0x6846,
+ 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
+ 0x2a40, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x31cb, 0x0078, 0x2272,
+ 0x81ff, 0x00c0, 0x229c, 0x617c, 0x81ff, 0x0040, 0x2692, 0x703f,
+ 0x0000, 0x2001, 0x73c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
+ 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2a40, 0x701b, 0x226f,
+ 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x73c0, 0x20a9,
+ 0x0040, 0x20a1, 0x73c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
+ 0x2091, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
+ 0x2100, 0xa506, 0x0040, 0x26c4, 0x1078, 0x3447, 0x00c0, 0x26c4,
+ 0x6014, 0x821c, 0x0048, 0x26bc, 0xa398, 0x73c0, 0xa085, 0xff00,
+ 0x8007, 0x201a, 0x0078, 0x26c3, 0xa398, 0x73c0, 0x2324, 0xa4a4,
+ 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8,
+ 0x26cb, 0x0078, 0x26a8, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
+ 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x73c0, 0x2099, 0x73c0, 0x1078,
+ 0x3213, 0x0078, 0x2681, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x0c7e,
+ 0x1078, 0x2a04, 0x0c7f, 0x0040, 0x229c, 0x2001, 0x6d52, 0x2004,
+ 0xd0b4, 0x0040, 0x2708, 0x6000, 0xd08c, 0x00c0, 0x2708, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2708, 0x6837, 0x0000,
+ 0x6838, 0xc0fd, 0x683a, 0x1078, 0x625b, 0x0040, 0x229c, 0x7007,
+ 0x0003, 0x701b, 0x2704, 0x007c, 0x1078, 0x2a1c, 0x0040, 0x22a0,
+ 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
+ 0x0002, 0xac80, 0x0004, 0x2098, 0xad80, 0x0004, 0x20a0, 0x1078,
+ 0x3213, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006,
+ 0x20a0, 0x1078, 0x3213, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098,
+ 0xad80, 0x000a, 0x20a0, 0x1078, 0x3213, 0x2d00, 0x2009, 0x0029,
+ 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a40, 0x81ff, 0x00c0,
+ 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078, 0x35ae, 0x0078,
+ 0x2272, 0x81ff, 0x00c0, 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8,
+ 0x22a0, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x2031, 0x000f, 0x1078,
+ 0x34d7, 0x8631, 0x00c8, 0x274f, 0x2019, 0x0004, 0x1078, 0x35c4,
+ 0x7924, 0x810f, 0x7a28, 0x1078, 0x275f, 0x0078, 0x2272, 0xa186,
+ 0x00ff, 0x0040, 0x2767, 0x1078, 0x2777, 0x0078, 0x2776, 0x2029,
+ 0x007e, 0x2061, 0x6d00, 0x644c, 0x2400, 0xa506, 0x0040, 0x2773,
+ 0x2508, 0x1078, 0x2777, 0x8529, 0x00c8, 0x276c, 0x007c, 0x1078,
+ 0x3447, 0x00c0, 0x2782, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108,
+ 0x1078, 0x40de, 0x007c, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c,
+ 0x0040, 0x22a0, 0x1078, 0x34d7, 0x1078, 0x35b9, 0x0078, 0x2272,
+ 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x1078,
+ 0x34d7, 0x1078, 0x35a3, 0x0078, 0x2272, 0x6100, 0x0078, 0x2272,
+ 0x1078, 0x2a1c, 0x0040, 0x22a0, 0x6004, 0xa086, 0x0707, 0x0040,
+ 0x22a0, 0x2001, 0x6d00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x229c,
+ 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x27b9, 0xace8,
+ 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04,
+ 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078,
+ 0x2272, 0x81ff, 0x00c0, 0x229c, 0x7828, 0xa08a, 0x1000, 0x00c8,
+ 0x22a0, 0x7924, 0xa184, 0x00ff, 0xa082, 0x0010, 0x00c8, 0x22a0,
+ 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x27e6, 0xa182,
+ 0x007f, 0x00c8, 0x22a0, 0x2100, 0x1078, 0x1e30, 0x027e, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x2061, 0x6f23, 0x601b, 0x0000, 0x601f,
+ 0x0000, 0x2061, 0x6d00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6030,
+ 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043,
+ 0x0010, 0x2009, 0x001e, 0x2011, 0x31f0, 0x1078, 0x415f, 0x7924,
+ 0x810f, 0x7a28, 0x1078, 0x275f, 0x127f, 0x0c7f, 0x027f, 0x0078,
+ 0x2272, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078, 0x3410,
+ 0x2c08, 0x0c7f, 0x00c0, 0x22a0, 0x0078, 0x2272, 0x81ff, 0x00c0,
+ 0x229c, 0x60bc, 0xd09c, 0x0040, 0x229c, 0x1078, 0x2a04, 0x0040,
+ 0x229c, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2a3c,
+ 0x701b, 0x2833, 0x007c, 0x2009, 0x0080, 0x1078, 0x3447, 0x00c0,
+ 0x229c, 0x0d7e, 0xade8, 0x000d, 0x6900, 0x6a08, 0x6b0c, 0x6c10,
+ 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0040, 0x28a7, 0xa0be,
+ 0x0112, 0x0040, 0x28a7, 0xa0be, 0x0113, 0x0040, 0x28a7, 0xa0be,
+ 0x0114, 0x0040, 0x28a7, 0xa0be, 0x0117, 0x0040, 0x28a7, 0xa0be,
+ 0x011a, 0x0040, 0x28a7, 0xa0be, 0x0121, 0x0040, 0x289d, 0xa0be,
+ 0x0131, 0x0040, 0x289d, 0xa0be, 0x0171, 0x0040, 0x28a7, 0xa0be,
+ 0x01a1, 0x00c0, 0x2870, 0x6830, 0x8007, 0x6832, 0x0078, 0x28ad,
+ 0xa0be, 0x0212, 0x0040, 0x28a3, 0xa0be, 0x0213, 0x0040, 0x28a3,
+ 0xa0be, 0x0214, 0x0040, 0x2895, 0xa0be, 0x0217, 0x0040, 0x288f,
+ 0xa0be, 0x021a, 0x00c0, 0x2889, 0x6838, 0x8007, 0x683a, 0x0078,
+ 0x28a7, 0xa0be, 0x0300, 0x0040, 0x28a7, 0x0078, 0x229c, 0xad80,
+ 0x0010, 0x20a9, 0x0007, 0x1078, 0x28d9, 0xad80, 0x000e, 0x20a9,
+ 0x0001, 0x1078, 0x28d9, 0x0078, 0x28a7, 0xad80, 0x000c, 0x1078,
+ 0x28e7, 0x0078, 0x28ad, 0xad80, 0x000e, 0x1078, 0x28e7, 0xad80,
+ 0x000c, 0x20a9, 0x0001, 0x1078, 0x28d9, 0x0c7e, 0x1078, 0x2a04,
+ 0x0040, 0x28ce, 0x6837, 0x0119, 0x684f, 0x0020, 0x685b, 0x0001,
+ 0x810b, 0x697e, 0x6883, 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92,
+ 0x6996, 0x689b, 0x0000, 0x0c7f, 0x0d7f, 0x1078, 0x623f, 0x0040,
+ 0x229c, 0x7007, 0x0003, 0x701b, 0x28d2, 0x007c, 0x0c7f, 0x0d7f,
+ 0x0078, 0x229c, 0x6820, 0xa086, 0x8001, 0x0040, 0x229c, 0x0078,
+ 0x2272, 0x017e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a,
+ 0x8108, 0x280a, 0x8108, 0x00f0, 0x28db, 0x017f, 0x007c, 0x017e,
+ 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054,
+ 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108,
+ 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x81ff, 0x00c0, 0x229c,
+ 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0081, 0x0048, 0x22a0,
+ 0xa182, 0x00ff, 0x00c8, 0x22a0, 0x7a2c, 0x7b28, 0x6064, 0xa306,
+ 0x00c0, 0x2918, 0x6068, 0xa206, 0x00c0, 0x2918, 0x0078, 0x22a0,
+ 0x0c7e, 0x1078, 0x297b, 0x2c68, 0x0c7f, 0x0040, 0x2939, 0xa0c6,
+ 0x4007, 0x00c0, 0x2926, 0x7c26, 0x0078, 0x2936, 0xa0c6, 0x4008,
+ 0x00c0, 0x292e, 0x7f26, 0x7e2a, 0x0078, 0x2936, 0xa0c6, 0x4009,
+ 0x00c0, 0x2934, 0x0078, 0x2936, 0x2001, 0x4006, 0x2020, 0x0078,
+ 0x2274, 0x017e, 0x0b7e, 0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x5504,
+ 0x0040, 0x2969, 0x2d00, 0x601a, 0x2e58, 0x0e7f, 0x0e7e, 0x0c7e,
+ 0x1078, 0x2a04, 0x0c7f, 0x2b70, 0x0040, 0x229c, 0x6837, 0x0000,
+ 0x2d00, 0x6012, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2001, 0x0002, 0x1078, 0x33f3, 0x127e, 0x2091, 0x8000, 0x7088,
+ 0x8000, 0x708a, 0x127f, 0x2009, 0x0002, 0x1078, 0x5591, 0xa085,
+ 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x0040, 0x229c, 0x7007,
+ 0x0003, 0x701b, 0x2974, 0x007c, 0x6830, 0xa086, 0x0100, 0x00c0,
+ 0x2272, 0x0078, 0x229c, 0x0e7e, 0x0d7e, 0x2029, 0x0000, 0x2021,
+ 0x0081, 0x20a9, 0x007e, 0x2071, 0x6e81, 0x2e04, 0xa005, 0x00c0,
+ 0x298f, 0x2100, 0xa406, 0x0040, 0x29c0, 0x0078, 0x29b4, 0x2068,
+ 0x6f10, 0x2700, 0xa306, 0x00c0, 0x29a5, 0x6e14, 0x2600, 0xa206,
+ 0x00c0, 0x29a5, 0x2400, 0xa106, 0x00c0, 0x29a1, 0x2d60, 0x0078,
+ 0x29c6, 0x2001, 0x4007, 0x0078, 0x29c7, 0x2400, 0xa106, 0x00c0,
+ 0x29b4, 0x6e14, 0x87ff, 0x00c0, 0x29b0, 0x86ff, 0x0040, 0x29c0,
+ 0x2001, 0x4008, 0x0078, 0x29c7, 0x8420, 0x8e70, 0x00f0, 0x2985,
+ 0x2001, 0x4009, 0x0078, 0x29c7, 0x2001, 0x0001, 0x0078, 0x29c7,
+ 0x1078, 0x3410, 0x00c0, 0x29bc, 0x6312, 0x6216, 0xa006, 0xa005,
+ 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0, 0x229c, 0x1078, 0x2a04,
+ 0x0040, 0x229c, 0x6837, 0x0000, 0x7824, 0xa005, 0x0040, 0x22a0,
+ 0xa096, 0x00ff, 0x0040, 0x29e0, 0xa092, 0x0004, 0x00c8, 0x22a0,
+ 0x2010, 0x2d18, 0x1078, 0x2013, 0x0040, 0x229c, 0x7007, 0x0003,
+ 0x701b, 0x29eb, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x229c,
+ 0x0078, 0x2272, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0081,
+ 0x0048, 0x22a0, 0xa182, 0x00ff, 0x00c8, 0x22a0, 0x1078, 0x615b,
+ 0x1078, 0x342f, 0x0078, 0x2272, 0x1078, 0x12f4, 0x0040, 0x2a1b,
+ 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0, 0x2a13, 0x2d00, 0x7012,
+ 0x7016, 0x0078, 0x2a19, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006,
+ 0x7016, 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff,
+ 0x1078, 0x3447, 0x00c0, 0x2a2a, 0xa6b4, 0x00ff, 0xa682, 0x0010,
+ 0x0048, 0x2a2b, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff,
+ 0x0040, 0x2a38, 0x2168, 0x6904, 0x1078, 0x1328, 0x0078, 0x2a2f,
+ 0x7112, 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x2a42,
+ 0x2031, 0x0000, 0x2061, 0x6d9d, 0x6606, 0x6112, 0x600e, 0x6226,
+ 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x135f, 0x7007, 0x0002,
+ 0x701b, 0x2272, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079,
+ 0x0000, 0x2001, 0x6d7b, 0x2004, 0xa005, 0x00c0, 0x2a6e, 0x0068,
+ 0x2a6e, 0x7818, 0xd084, 0x00c0, 0x2a6e, 0x781b, 0x0001, 0x7a22,
+ 0x7b26, 0x7c2a, 0x2091, 0x4080, 0x0078, 0x2a93, 0x017e, 0x0c7e,
+ 0x0e7e, 0x2071, 0x6d6d, 0x7138, 0xa182, 0x0004, 0x0048, 0x2a7c,
+ 0x7030, 0x2060, 0x0078, 0x2a8d, 0x7030, 0xa0e0, 0x0008, 0xac82,
+ 0x6d9d, 0x0048, 0x2a85, 0x2061, 0x6d7d, 0x2c00, 0x7032, 0x81ff,
+ 0x00c0, 0x2a8b, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a,
+ 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071,
+ 0x6d6d, 0x7038, 0xa005, 0x0040, 0x2acf, 0x127e, 0x2091, 0x8000,
+ 0x0068, 0x2ace, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0,
+ 0x2acd, 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822,
+ 0x6004, 0x7826, 0x6008, 0x782a, 0x2091, 0x4080, 0x7038, 0x8001,
+ 0x703a, 0xa005, 0x00c0, 0x2ac3, 0x7033, 0x6d7d, 0x7037, 0x6d7d,
+ 0x0c7f, 0x0078, 0x2acd, 0xac80, 0x0008, 0xa0fa, 0x6d9d, 0x0048,
+ 0x2acb, 0x2001, 0x6d7d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f,
+ 0x007c, 0x027e, 0x2001, 0x6d52, 0x2004, 0xd0c4, 0x0040, 0x2adc,
+ 0x2011, 0x8014, 0x1078, 0x2a53, 0x027f, 0x007c, 0x81ff, 0x00c0,
+ 0x229c, 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078,
+ 0x31cb, 0x127f, 0x0078, 0x2272, 0x127e, 0x0c7e, 0x0e7e, 0x2061,
+ 0x0100, 0x2071, 0x6d00, 0x6044, 0xd0a4, 0x00c0, 0x2b11, 0xd084,
+ 0x0040, 0x2afe, 0x1078, 0x2c34, 0x0078, 0x2b11, 0xd08c, 0x0040,
+ 0x2b05, 0x1078, 0x2b4b, 0x0078, 0x2b11, 0xd094, 0x0040, 0x2b0c,
+ 0x1078, 0x2b2c, 0x0078, 0x2b11, 0xd09c, 0x0040, 0x2b11, 0x1078,
+ 0x2b15, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x6043, 0x0040, 0x6043,
+ 0x0000, 0x706f, 0x0000, 0x7087, 0x0001, 0x70a7, 0x0000, 0x2009,
+ 0x73c0, 0x200b, 0x0000, 0x7073, 0x000f, 0x2009, 0x000f, 0x2011,
+ 0x3187, 0x1078, 0x415f, 0x007c, 0x7070, 0xa005, 0x00c0, 0x2b4a,
+ 0x2011, 0x3187, 0x1078, 0x40d1, 0x6043, 0x0020, 0x6043, 0x0000,
+ 0x6044, 0xd08c, 0x00c0, 0x2b46, 0x7003, 0x0001, 0x7083, 0x0000,
+ 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2b4a, 0x7077, 0x0000,
+ 0x0078, 0x2b4a, 0x007c, 0x7074, 0xa08a, 0x0003, 0x00c8, 0x2b54,
+ 0x1079, 0x2b57, 0x0078, 0x2b56, 0x1078, 0x12b7, 0x007c, 0x2b5a,
+ 0x2ba9, 0x2c33, 0x0f7e, 0x7077, 0x0001, 0x20e1, 0xa000, 0x20e1,
+ 0x8700, 0x1078, 0x1bcc, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079,
+ 0x7200, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f,
+ 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f,
+ 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f,
+ 0x0000, 0x2079, 0x720c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099,
+ 0x6d05, 0x20a1, 0x720e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7212,
+ 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7200, 0x20a1, 0x020b,
+ 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078,
+ 0x31b2, 0x0f7f, 0x707b, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000,
+ 0x007c, 0x0d7e, 0x7078, 0x707b, 0x0000, 0xa025, 0x0040, 0x2c1d,
+ 0x6020, 0xd0b4, 0x00c0, 0x2c1b, 0x7184, 0x81ff, 0x0040, 0x2c04,
+ 0xa486, 0x000c, 0x00c0, 0x2c0f, 0xa480, 0x0018, 0x8004, 0x20a8,
+ 0x2011, 0x7280, 0x2019, 0x7200, 0x220c, 0x2304, 0xa106, 0x00c0,
+ 0x2bdb, 0x8210, 0x8318, 0x00f0, 0x2bc4, 0x6043, 0x0004, 0x608b,
+ 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x7077, 0x0002, 0x7083,
+ 0x0002, 0x0078, 0x2c1b, 0x2069, 0x7280, 0x6930, 0xa18e, 0x1101,
+ 0x00c0, 0x2c0f, 0x6834, 0xa005, 0x00c0, 0x2c0f, 0x6900, 0xa18c,
+ 0x00ff, 0x00c0, 0x2bef, 0x6804, 0xa005, 0x0040, 0x2c04, 0x2011,
+ 0x728e, 0x2019, 0x6d05, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102,
+ 0x0048, 0x2c02, 0x00c0, 0x2c0f, 0x8210, 0x8318, 0x00f0, 0x2bf5,
+ 0x0078, 0x2c0f, 0x7087, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043,
+ 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2c1b, 0x60c3,
+ 0x000c, 0x1078, 0x31b2, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0,
+ 0x2c1b, 0x60c3, 0x000c, 0x2011, 0x6f1a, 0x2013, 0x0000, 0x707b,
+ 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
+ 0x4fdc, 0x0078, 0x2c1b, 0x007c, 0x7080, 0xa08a, 0x001d, 0x00c8,
+ 0x2c3d, 0x1079, 0x2c40, 0x0078, 0x2c3f, 0x1078, 0x12b7, 0x007c,
+ 0x2c64, 0x2c73, 0x2ca6, 0x2cbb, 0x2ced, 0x2d17, 0x2d49, 0x2d73,
+ 0x2da5, 0x2dcb, 0x2e1a, 0x2e3c, 0x2e60, 0x2e76, 0x2e9c, 0x2eaf,
+ 0x2eb8, 0x2ed1, 0x2f01, 0x2f2b, 0x2f5b, 0x2f85, 0x2fce, 0x3003,
+ 0x3025, 0x3063, 0x3087, 0x30a0, 0x30ad, 0x7003, 0x0007, 0x6004,
+ 0xa084, 0xfff9, 0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0,
+ 0x6043, 0x0002, 0x7083, 0x0001, 0x2009, 0x07d0, 0x2011, 0x318e,
+ 0x1078, 0x40c4, 0x007c, 0x0f7e, 0x7078, 0xa086, 0x0014, 0x00c0,
+ 0x2ca4, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2ca4, 0x2079,
+ 0x7280, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2ca2, 0x7834, 0xa005,
+ 0x00c0, 0x2ca2, 0x7a38, 0xd2fc, 0x0040, 0x2c98, 0x70a4, 0xa005,
+ 0x00c0, 0x2c98, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0x7083, 0x0010, 0x1078, 0x2eb8,
+ 0x0078, 0x2ca4, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0003,
+ 0x6043, 0x0004, 0x1078, 0x321b, 0x20a3, 0x1102, 0x20a3, 0x0000,
+ 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x2cb2, 0x60c3, 0x0014,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2ceb,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2ce7,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2ce7, 0x7834,
+ 0xa005, 0x00c0, 0x2ce7, 0x7a38, 0xd2fc, 0x0040, 0x2ce1, 0x70a4,
+ 0xa005, 0x00c0, 0x2ce1, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7,
+ 0x0001, 0x7083, 0x0004, 0x1078, 0x2ced, 0x0078, 0x2ceb, 0x7083,
+ 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0005, 0x1078,
+ 0x321b, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x728e,
+ 0x706c, 0xa005, 0x00c0, 0x2d09, 0x714c, 0xa186, 0xffff, 0x0040,
+ 0x2d09, 0x1078, 0x3152, 0x0040, 0x2d09, 0x2019, 0x002a, 0x1078,
+ 0x202f, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x007c, 0x0f7e,
+ 0x7078, 0xa005, 0x0040, 0x2d47, 0x2011, 0x318e, 0x1078, 0x40d1,
+ 0xa086, 0x0014, 0x00c0, 0x2d43, 0x2079, 0x7280, 0x7a30, 0xa296,
+ 0x1103, 0x00c0, 0x2d43, 0x7834, 0xa005, 0x00c0, 0x2d43, 0x7a38,
+ 0xd2fc, 0x0040, 0x2d3d, 0x70a4, 0xa005, 0x00c0, 0x2d3d, 0x2019,
+ 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x7083, 0x0006, 0x1078,
+ 0x2d49, 0x0078, 0x2d47, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f,
+ 0x007c, 0x7083, 0x0007, 0x1078, 0x321b, 0x20a3, 0x1104, 0x20a3,
+ 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa005, 0x00c0, 0x2d65,
+ 0x7150, 0xa186, 0xffff, 0x0040, 0x2d65, 0xa180, 0x2091, 0x200c,
+ 0xa18c, 0xff00, 0x810f, 0x1078, 0x3152, 0x20a9, 0x0008, 0x2298,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2fbf,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x2fbd,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2fbd, 0x7834,
- 0xa005, 0x00c0, 0x2fbd, 0x7a38, 0xd2fc, 0x0040, 0x2fb7, 0x709c,
- 0xa005, 0x00c0, 0x2fb7, 0x1078, 0x32a9, 0x709f, 0x0001, 0x707b,
- 0x0014, 0x1078, 0x2fc1, 0x0078, 0x2fbf, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0015, 0x1078, 0x3286, 0x20a3, 0x1104, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x738e, 0x7064, 0xa006, 0x00c0, 0x2fdd,
- 0x7150, 0xa186, 0xffff, 0x0040, 0x2fdd, 0xa180, 0x2207, 0x200c,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x31b4, 0x20a9, 0x0008, 0x2298,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2da3,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2d9f,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2d9f, 0x7834,
+ 0xa005, 0x00c0, 0x2d9f, 0x7a38, 0xd2fc, 0x0040, 0x2d99, 0x70a4,
+ 0xa005, 0x00c0, 0x2d99, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7,
+ 0x0001, 0x7083, 0x0008, 0x1078, 0x2da5, 0x0078, 0x2da3, 0x7083,
+ 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0009, 0x1078,
+ 0x321b, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430, 0x706c, 0xa005,
+ 0x00c0, 0x2db8, 0x1078, 0x30bc, 0x0040, 0x2dc8, 0x0078, 0x2dc2,
+ 0x20a9, 0x0008, 0x2099, 0x728e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x0078, 0x2dca,
+ 0x1078, 0x2c5d, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2e18,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2e14,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1105, 0x00c0, 0x2e14, 0x7834,
+ 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2dfb, 0x7a38, 0xd2fc, 0x0040,
+ 0x2df3, 0x70a4, 0xa005, 0x00c0, 0x2df3, 0x2019, 0x002a, 0x1078,
+ 0x202f, 0x70a7, 0x0001, 0x707f, 0x0001, 0x7083, 0x000a, 0x1078,
+ 0x2e1a, 0x0078, 0x2e18, 0xa005, 0x00c0, 0x2e14, 0x7a38, 0xd2fc,
+ 0x0040, 0x2e0c, 0x70a4, 0xa005, 0x00c0, 0x2e0c, 0x2019, 0x002a,
+ 0x1078, 0x202f, 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e,
+ 0x1078, 0x2e9c, 0x0078, 0x2e18, 0x7083, 0x0002, 0x707b, 0x0000,
+ 0x0f7f, 0x007c, 0x7083, 0x000b, 0x2011, 0x720e, 0x22a0, 0x20a9,
+ 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000,
+ 0x41a4, 0x1078, 0x321b, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
+ 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3,
+ 0x0084, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040,
+ 0x2e5e, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0,
+ 0x2e5a, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2e5a,
+ 0x7834, 0xa005, 0x00c0, 0x2e5a, 0x7083, 0x000c, 0x1078, 0x2e60,
+ 0x0078, 0x2e5e, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c,
+ 0x7083, 0x000d, 0x1078, 0x321b, 0x20a3, 0x1107, 0x20a3, 0x0000,
+ 0x2099, 0x728e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x0084, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078,
+ 0xa005, 0x0040, 0x2e9a, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086,
+ 0x0084, 0x00c0, 0x2e96, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1107,
+ 0x00c0, 0x2e96, 0x7834, 0xa005, 0x00c0, 0x2e96, 0x1078, 0x320d,
+ 0x7083, 0x000e, 0x1078, 0x2e9c, 0x0078, 0x2e9a, 0x7083, 0x0002,
+ 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000f, 0x707b, 0x0000,
+ 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004,
+ 0x2009, 0x07d0, 0x2011, 0x318e, 0x1078, 0x40c4, 0x007c, 0x7078,
+ 0xa005, 0x0040, 0x2eb7, 0x2011, 0x318e, 0x1078, 0x40d1, 0x007c,
+ 0x7083, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280,
+ 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
+ 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x31b2,
+ 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2eff, 0x2011, 0x318e,
+ 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2efd, 0x2079, 0x7280,
+ 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2efd, 0x7834, 0xa005, 0x00c0,
+ 0x2efd, 0x7a38, 0xd2fc, 0x0040, 0x2ef7, 0x70a4, 0xa005, 0x00c0,
+ 0x2ef7, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x7083,
+ 0x0012, 0x1078, 0x2f01, 0x0078, 0x2eff, 0x707b, 0x0000, 0x0f7f,
+ 0x007c, 0x7083, 0x0013, 0x1078, 0x3227, 0x20a3, 0x1103, 0x20a3,
+ 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa005, 0x00c0, 0x2f1d,
+ 0x714c, 0xa186, 0xffff, 0x0040, 0x2f1d, 0x1078, 0x3152, 0x0040,
+ 0x2f1d, 0x2019, 0x002a, 0x1078, 0x202f, 0x20a9, 0x0008, 0x2298,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x302e,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0014, 0x00c0, 0x302c,
- 0x2079, 0x7380, 0x7a30, 0xa296, 0x1105, 0x00c0, 0x302c, 0x7834,
- 0x2011, 0x0100, 0xa21e, 0x00c0, 0x3015, 0x7a38, 0xd2fc, 0x0040,
- 0x3011, 0x709c, 0xa005, 0x00c0, 0x3011, 0x1078, 0x32a9, 0x709f,
- 0x0001, 0x7077, 0x0001, 0x0078, 0x3026, 0xa005, 0x00c0, 0x302c,
- 0x7a38, 0xd2fc, 0x0040, 0x3024, 0x709c, 0xa005, 0x00c0, 0x3024,
- 0x1078, 0x32a9, 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x0016,
- 0x1078, 0x3030, 0x0078, 0x302e, 0x7073, 0x0000, 0x0f7f, 0x007c,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b,
- 0x20a9, 0x000e, 0x53a6, 0x3430, 0x2011, 0x738e, 0x7074, 0xa005,
- 0x0040, 0x3046, 0x707b, 0x0017, 0x0078, 0x3048, 0x707b, 0x001b,
- 0x7064, 0xa005, 0x00c0, 0x3052, 0x1078, 0x311e, 0x0040, 0x3062,
- 0x0078, 0x305c, 0x20a9, 0x0008, 0x2099, 0x738e, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x3210,
- 0x0078, 0x3064, 0x1078, 0x2cd7, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x3085, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0084,
- 0x00c0, 0x3083, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1106, 0x00c0,
- 0x3083, 0x7834, 0xa005, 0x00c0, 0x3083, 0x707b, 0x0018, 0x1078,
- 0x3087, 0x0078, 0x3085, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
- 0x0019, 0x1078, 0x3286, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430,
- 0x2099, 0x738e, 0x2039, 0x730e, 0x27a0, 0x20a9, 0x0040, 0x53a3,
- 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294,
- 0x00ff, 0x8007, 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0,
- 0x730e, 0x2414, 0xa38c, 0x0001, 0x0040, 0x30b2, 0xa294, 0xff00,
- 0x0078, 0x30b5, 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798,
- 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0084, 0x1078, 0x3210, 0x007c, 0x0f7e, 0x7070, 0xa005,
- 0x0040, 0x30e7, 0x2011, 0x31f0, 0x1078, 0x4187, 0xa086, 0x0084,
- 0x00c0, 0x30e5, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1107, 0x00c0,
- 0x30e5, 0x7834, 0xa005, 0x00c0, 0x30e5, 0x1078, 0x326c, 0x707b,
- 0x001a, 0x1078, 0x30e9, 0x0078, 0x30e7, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
- 0x7380, 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007,
- 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078,
- 0x3210, 0x007c, 0x7070, 0xa005, 0x0040, 0x310e, 0x2011, 0x31f0,
- 0x1078, 0x4187, 0x707b, 0x001c, 0x1078, 0x310f, 0x007c, 0x7073,
- 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0001, 0x2009,
- 0x07d0, 0x2011, 0x31f0, 0x1078, 0x417a, 0x007c, 0x087e, 0x097e,
- 0x2029, 0x6f52, 0x252c, 0x20a9, 0x0008, 0x2041, 0x730e, 0x28a0,
- 0x2099, 0x738e, 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4,
- 0x0040, 0x3134, 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6,
- 0xffff, 0x00c0, 0x3146, 0xd5d4, 0x0040, 0x3141, 0x8210, 0x0078,
- 0x3142, 0x8211, 0x00f0, 0x3134, 0x0078, 0x31ab, 0x82ff, 0x00c0,
- 0x3158, 0xd5d4, 0x0040, 0x3152, 0xa1a6, 0x3fff, 0x0040, 0x313e,
- 0x0078, 0x3156, 0xa1a6, 0x3fff, 0x0040, 0x31ab, 0xa18d, 0xc000,
- 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0040, 0x3161, 0x2019,
- 0x0010, 0x2120, 0xd5d4, 0x0040, 0x3168, 0x8423, 0x0078, 0x3169,
- 0x8424, 0x00c8, 0x3176, 0xd5d4, 0x0040, 0x3171, 0x8319, 0x0078,
- 0x3172, 0x8318, 0x00f0, 0x3162, 0x0078, 0x31ab, 0x23a8, 0x2021,
- 0x0001, 0x8426, 0x8425, 0x00f0, 0x317a, 0x2328, 0x8529, 0xa2be,
- 0x0007, 0x0040, 0x318e, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a,
- 0x007f, 0x27a8, 0xa5a8, 0x0010, 0x00f0, 0x318a, 0x754e, 0xa5c8,
- 0x2207, 0x292c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
- 0x2018, 0x2304, 0xa405, 0x201a, 0x7067, 0x0001, 0x26a0, 0x2898,
- 0x20a9, 0x0008, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085,
- 0x0001, 0x0078, 0x31b1, 0xa006, 0x0078, 0x31b1, 0xa006, 0x1078,
- 0x1288, 0x097f, 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001,
- 0x0007, 0xa39a, 0x0010, 0x0048, 0x31c1, 0x8420, 0x8001, 0x0078,
- 0x31b9, 0x2118, 0x84ff, 0x0040, 0x31ca, 0xa39a, 0x0010, 0x8421,
- 0x00c0, 0x31c5, 0x2021, 0x0001, 0x83ff, 0x0040, 0x31d3, 0x8423,
- 0x8319, 0x00c0, 0x31cf, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x31e8,
- 0xa405, 0x203a, 0x714e, 0xa1a0, 0x2207, 0x242c, 0xa5ac, 0x00ff,
- 0x6532, 0x60e7, 0x0000, 0x65ea, 0x7067, 0x0001, 0xa084, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x706b, 0x0000, 0x0e7f, 0x007c,
- 0x0e7e, 0x0f7e, 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x4f8e,
- 0x7004, 0xa084, 0x4000, 0x0040, 0x3201, 0x7003, 0x1000, 0x7003,
- 0x0000, 0x127e, 0x2091, 0x8000, 0x2071, 0x6f1e, 0x2073, 0x0000,
- 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f, 0x0e7f, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x2011, 0x70c0, 0x2013, 0x0000, 0x7073,
- 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
- 0x1078, 0x4f85, 0x2009, 0x07d0, 0x2011, 0x31f0, 0x1078, 0x4217,
- 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009,
- 0x00f7, 0x1078, 0x3292, 0x2061, 0x70c9, 0x601b, 0x0000, 0x601f,
- 0x0000, 0x2061, 0x6f00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043,
- 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x324e, 0x1078,
- 0x417a, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078, 0x4f8e, 0x2071,
- 0x0140, 0x7004, 0xa084, 0x4000, 0x0040, 0x3262, 0x7003, 0x1000,
- 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x1f8a, 0x1078, 0x3229,
- 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, 0x74c0,
- 0x2099, 0x738e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, 0x00f0,
- 0x3272, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7300,
- 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x20a9, 0x000c,
- 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, 0x2001,
- 0x6f2a, 0x2004, 0xa005, 0x00c0, 0x32a3, 0x6030, 0xa084, 0x00ff,
- 0xa105, 0x0078, 0x32a5, 0xa185, 0x00f7, 0x604a, 0x007f, 0x0c7f,
- 0x007c, 0x017e, 0x047e, 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x0040,
- 0x32bc, 0xa006, 0x2020, 0x2009, 0x002a, 0x1078, 0x6dc4, 0x2001,
- 0x6f0c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x1078, 0x2186,
- 0x047f, 0x017f, 0x007c, 0x157e, 0x20a9, 0x007d, 0x2009, 0x7020,
- 0xa006, 0x200a, 0x8108, 0x00f0, 0x32c9, 0x157f, 0x007c, 0x0d7e,
- 0x037e, 0x157e, 0x137e, 0x147e, 0x2069, 0x6f51, 0xa006, 0x6002,
- 0x6007, 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2207, 0x231c,
- 0xa39c, 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0,
- 0x40a4, 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e,
- 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066,
- 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086,
- 0x608a, 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x604a,
- 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, 0x00ff, 0x6042,
- 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, 0x127e, 0x2091,
- 0x8000, 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x33bb,
- 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8, 0x33c1, 0x2001,
- 0x6f0c, 0x2004, 0xa084, 0x0003, 0x00c0, 0x33a4, 0xa188, 0x7020,
- 0x2104, 0xa065, 0x0040, 0x339a, 0x6004, 0xa084, 0x00ff, 0xa08e,
- 0x0006, 0x00c0, 0x33a0, 0x6078, 0xa00d, 0x0040, 0x3345, 0xa680,
- 0x6e58, 0x2004, 0xa10c, 0x00c0, 0x3394, 0x607c, 0xa00d, 0x0040,
- 0x3361, 0xa680, 0x6e58, 0x2004, 0xa10c, 0x0040, 0x3361, 0x694c,
- 0xd1fc, 0x00c0, 0x3357, 0x1078, 0x3454, 0x0078, 0x338f, 0x1078,
- 0x3425, 0x694c, 0xd1ec, 0x00c0, 0x338f, 0x1078, 0x356d, 0x0078,
- 0x338f, 0x694c, 0xa184, 0xa000, 0x0040, 0x337f, 0xd1ec, 0x0040,
- 0x3378, 0xd1fc, 0x0040, 0x3370, 0x1078, 0x3584, 0x0078, 0x337b,
- 0xa680, 0x6e58, 0x200c, 0x607c, 0xa105, 0x607e, 0x0078, 0x337f,
- 0xd1fc, 0x0040, 0x337f, 0x1078, 0x3425, 0x0078, 0x338f, 0x6050,
- 0xa00d, 0x0040, 0x338a, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
- 0x0078, 0x338f, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x1078,
- 0x445d, 0xa006, 0x127f, 0x007c, 0x2001, 0x0005, 0x2009, 0x0000,
- 0x0078, 0x33c5, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x33c5,
- 0xa082, 0x0006, 0x0048, 0x333b, 0x2009, 0x6f0c, 0x210c, 0xd18c,
- 0x0040, 0x33ae, 0x2001, 0x0004, 0x0078, 0x33b7, 0xd184, 0x0040,
- 0x33b5, 0x2001, 0x0004, 0x0078, 0x33b7, 0x2001, 0x0029, 0x2009,
- 0x0000, 0x0078, 0x33c5, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
- 0x33c5, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c,
- 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x340a, 0xa18c,
- 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8, 0x33fa, 0xa188, 0x7020,
- 0x2104, 0xa065, 0x0040, 0x33fa, 0x6004, 0xa084, 0x00ff, 0xa08e,
- 0x0006, 0x00c0, 0x3400, 0x684c, 0xd0ec, 0x0040, 0x33ed, 0x1078,
- 0x3584, 0x1078, 0x3425, 0x0078, 0x33f5, 0x1078, 0x3425, 0x684c,
- 0xd0fc, 0x0040, 0x33f5, 0x1078, 0x356d, 0x1078, 0x3598, 0xa006,
- 0x0078, 0x340e, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x340e,
- 0xa082, 0x0006, 0x0048, 0x33e3, 0x2001, 0x0029, 0x2009, 0x0000,
- 0x0078, 0x340e, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x341e, 0x2d00,
- 0x200a, 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00, 0x6052,
- 0x604e, 0x6803, 0x0000, 0x0078, 0x341c, 0x127e, 0x2091, 0x8000,
- 0x604c, 0xa005, 0x0040, 0x3431, 0x6802, 0x2d00, 0x604e, 0x127f,
- 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x342f,
- 0x127e, 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x3446, 0x6800,
- 0xa005, 0x00c0, 0x3444, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c,
- 0x604c, 0xa06d, 0x0040, 0x3453, 0x6800, 0xa005, 0x00c0, 0x3451,
- 0x6052, 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d,
- 0x0040, 0x345e, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086,
- 0x6082, 0x0078, 0x345d, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000,
- 0x6218, 0x2260, 0x6200, 0xa005, 0x0040, 0x3471, 0xc285, 0x0078,
- 0x3472, 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e,
- 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0xff00,
- 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091,
- 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0x00ff, 0x8007, 0xa215,
- 0x6206, 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048,
- 0x349d, 0xa085, 0x0001, 0x0078, 0x34b1, 0xa190, 0x7020, 0x2204,
- 0xa065, 0x00c0, 0x34b0, 0x017e, 0x0d7e, 0x1078, 0x12c7, 0x2d60,
- 0x0d7f, 0x017f, 0x0040, 0x3499, 0x2c00, 0x2012, 0x1078, 0x32cf,
- 0xa006, 0x027f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x34bc,
- 0xa085, 0x0001, 0x0078, 0x34c9, 0x0d7e, 0xa190, 0x7020, 0x2204,
- 0xa06d, 0x0040, 0x34c7, 0x2013, 0x0000, 0x1078, 0x12fb, 0x0d7f,
- 0xa006, 0x027f, 0x007c, 0x017e, 0xa182, 0x007e, 0x0048, 0x34d4,
- 0xa085, 0x0001, 0x0078, 0x34db, 0xa188, 0x7020, 0x2104, 0xa065,
- 0x0040, 0x34d0, 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e,
- 0x147e, 0x600b, 0x0000, 0x600f, 0x0000, 0x6000, 0xc08c, 0x6002,
- 0x2069, 0x738e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a,
- 0x0048, 0x34f3, 0x603a, 0x6814, 0x6066, 0x2099, 0x7396, 0xac88,
- 0x000a, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0x739a, 0xac88,
- 0x0006, 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0x73ae, 0x6808,
- 0x606a, 0x690c, 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182,
- 0x0211, 0x00c8, 0x3517, 0x2009, 0x0008, 0x0078, 0x3541, 0xa182,
- 0x0259, 0x00c8, 0x351f, 0x2009, 0x0007, 0x0078, 0x3541, 0xa182,
- 0x02c1, 0x00c8, 0x3527, 0x2009, 0x0006, 0x0078, 0x3541, 0xa182,
- 0x0349, 0x00c8, 0x352f, 0x2009, 0x0005, 0x0078, 0x3541, 0xa182,
- 0x0421, 0x00c8, 0x3537, 0x2009, 0x0004, 0x0078, 0x3541, 0xa182,
- 0x0581, 0x00c8, 0x353f, 0x2009, 0x0003, 0x0078, 0x3541, 0x2009,
- 0x0002, 0x6192, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x0e7e,
- 0x2071, 0x738d, 0x2e04, 0x6896, 0x2071, 0x738e, 0x7004, 0x689a,
- 0x701c, 0x689e, 0x0e7f, 0x007c, 0x2001, 0x6e58, 0xa600, 0x2004,
- 0x127e, 0x2091, 0x8000, 0x6178, 0xa10d, 0x617a, 0x127f, 0x007c,
- 0x2001, 0x6e58, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000,
- 0x6178, 0xa10c, 0x617a, 0x127f, 0x007c, 0x2001, 0x6e58, 0xa600,
- 0x2004, 0x8002, 0x127e, 0x2091, 0x8000, 0x617c, 0xa10c, 0x617e,
- 0x127f, 0x0078, 0x357d, 0x1078, 0x3410, 0x1078, 0x35de, 0x00c0,
- 0x357b, 0x1078, 0x3598, 0x007c, 0x2001, 0x6e58, 0xa600, 0x2004,
- 0x127e, 0x2091, 0x8000, 0x617c, 0xa10d, 0x617e, 0x127f, 0x0078,
- 0x3593, 0x1078, 0x3454, 0x1078, 0x35a2, 0x00c0, 0x3591, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x445d, 0x127f, 0x007c, 0xa01e,
- 0x0078, 0x35a4, 0x2019, 0x0001, 0xa00e, 0x127e, 0x2091, 0x8000,
- 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0, 0x35c4, 0x8dff, 0x0040,
- 0x35d9, 0x83ff, 0x0040, 0x35bc, 0x6844, 0xa084, 0x00ff, 0xa606,
- 0x0040, 0x35c9, 0x0078, 0x35c4, 0x683c, 0xa406, 0x00c0, 0x35c4,
- 0x6840, 0xa506, 0x0040, 0x35c9, 0x2d08, 0x6800, 0x2068, 0x0078,
- 0x35ae, 0x6a00, 0x604c, 0xad06, 0x00c0, 0x35d1, 0x624e, 0x0078,
- 0x35d4, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x35d9, 0x6152,
- 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, 0x35e0, 0x2019, 0x0001,
- 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, 0x360e, 0x83ff, 0x0040,
- 0x35f1, 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x35fe, 0x0078,
- 0x35f9, 0x683c, 0xa406, 0x00c0, 0x35f9, 0x6840, 0xa506, 0x0040,
- 0x35fe, 0x2d08, 0x6800, 0x2068, 0x0078, 0x35e3, 0x6a00, 0x6080,
- 0xad06, 0x00c0, 0x3606, 0x6282, 0x0078, 0x3609, 0xa180, 0x0000,
- 0x2202, 0x82ff, 0x00c0, 0x360e, 0x6186, 0x8dff, 0x007c, 0x2001,
- 0x6e58, 0xa600, 0x2004, 0x6178, 0xa10c, 0x0040, 0x3619, 0x2011,
- 0x0001, 0x617c, 0xa10c, 0x0040, 0x361f, 0xa295, 0x0002, 0x007c,
- 0x1078, 0x366b, 0x0040, 0x3628, 0x1078, 0x62c8, 0x0078, 0x362a,
- 0xa085, 0x0001, 0x007c, 0x1078, 0x366b, 0x0040, 0x3633, 0x1078,
- 0x6257, 0x0078, 0x3635, 0xa085, 0x0001, 0x007c, 0x1078, 0x366b,
- 0x0040, 0x363e, 0x1078, 0x629d, 0x0078, 0x3640, 0xa085, 0x0001,
- 0x007c, 0x1078, 0x366b, 0x0040, 0x3649, 0x1078, 0x6273, 0x0078,
- 0x364b, 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091,
- 0x8000, 0x6080, 0xa06d, 0x0040, 0x3663, 0x6800, 0x007e, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x63d5, 0x1078, 0x3720,
- 0x007f, 0x0078, 0x3652, 0x6083, 0x0000, 0x6087, 0x0000, 0x0d7f,
- 0x007f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, 0x2079,
- 0x6f51, 0x7804, 0xd0a4, 0x0040, 0x3697, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34cb, 0x00c0, 0x368b,
- 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x00c0, 0x368b,
- 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, 0x367b, 0x0c7f,
- 0x157f, 0x2009, 0x07d0, 0x2011, 0x3699, 0x1078, 0x4217, 0x0f7f,
- 0x007c, 0x2011, 0x3699, 0x1078, 0x4187, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34cb, 0x00c0, 0x36c5,
- 0x6000, 0xd0ec, 0x0040, 0x36c5, 0x047e, 0x62a0, 0xa294, 0x00ff,
- 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x6dc4, 0x6000, 0xc0e5,
- 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x457b, 0x1078, 0x44be,
- 0x2009, 0x0000, 0x1078, 0x6bfe, 0x047f, 0x017f, 0x8108, 0x00f0,
- 0x36a3, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, 0x2060, 0x6000,
- 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x6fff, 0x7003, 0x0001,
- 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, 0x0000,
- 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, 0x0020,
- 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6fff,
- 0x684c, 0xa005, 0x00c0, 0x36fb, 0x7028, 0xc085, 0x702a, 0xa085,
- 0x0001, 0x0078, 0x371e, 0x6a60, 0x7236, 0x6b64, 0x733a, 0x6868,
- 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e, 0x6844,
- 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c,
- 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e, 0x7372,
- 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x0e7f, 0x007c,
- 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x3771, 0x6804, 0xa00d, 0x0040,
- 0x373f, 0x0d7e, 0x0e7e, 0x2071, 0x6f00, 0x027e, 0xa016, 0x702c,
- 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0, 0x3730,
- 0x702e, 0x7098, 0xa200, 0x709a, 0x027f, 0x0e7f, 0x0d7f, 0x2071,
- 0x6fff, 0x701c, 0xa005, 0x00c0, 0x3782, 0x0068, 0x3780, 0x2071,
- 0x6f51, 0x7004, 0xd09c, 0x0040, 0x3780, 0x6934, 0xa186, 0x0103,
- 0x00c0, 0x3793, 0x6948, 0x6844, 0xa105, 0x00c0, 0x3773, 0x2009,
- 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x3780, 0x7122,
- 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080,
- 0x2071, 0x6f00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000,
- 0x709a, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3780,
- 0x6868, 0xa005, 0x00c0, 0x3780, 0x2009, 0x8020, 0x0078, 0x3759,
- 0x2071, 0x6fff, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012,
- 0x7018, 0xa06d, 0x711a, 0x0040, 0x3790, 0x6902, 0x0078, 0x3791,
- 0x711e, 0x0078, 0x3771, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040,
- 0x37a1, 0xa186, 0x001e, 0x0040, 0x37a1, 0xa18e, 0x001f, 0x00c0,
- 0x3780, 0x684c, 0xd0cc, 0x0040, 0x3780, 0x6850, 0xa084, 0x00ff,
- 0xa086, 0x0001, 0x00c0, 0x3780, 0x2009, 0x8021, 0x0078, 0x3759,
- 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0,
- 0x2001, 0x0000, 0x40a4, 0x007f, 0x684a, 0x6952, 0x007c, 0x2071,
- 0x6fff, 0x7004, 0x0079, 0x37c4, 0x37cc, 0x37db, 0x386b, 0x386c,
- 0x387c, 0x3882, 0x37cd, 0x3859, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x0068, 0x37da, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080,
- 0x7007, 0x0001, 0x127f, 0x701c, 0xa06d, 0x0040, 0x3858, 0x0e7e,
- 0x2071, 0x6f51, 0x7004, 0xd09c, 0x0040, 0x383a, 0x6934, 0xa186,
- 0x0103, 0x00c0, 0x3810, 0x6948, 0x6844, 0xa105, 0x00c0, 0x382d,
- 0x2009, 0x8020, 0x127e, 0x2091, 0x8000, 0x0068, 0x380c, 0x2071,
- 0x0000, 0x7018, 0xd084, 0x00c0, 0x380c, 0x7122, 0x683c, 0x7026,
- 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x127f, 0x0e7f,
- 0x1078, 0x38b5, 0x0078, 0x3858, 0x127f, 0x0e7f, 0x0078, 0x3858,
- 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040, 0x381e, 0xa186, 0x001e,
- 0x0040, 0x381e, 0xa18e, 0x001f, 0x00c0, 0x383a, 0x684c, 0xd0cc,
- 0x0040, 0x383a, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0,
- 0x383a, 0x2009, 0x8021, 0x0078, 0x37f2, 0x6844, 0xa086, 0x0100,
- 0x00c0, 0x383a, 0x6868, 0xa005, 0x00c0, 0x383a, 0x2009, 0x8020,
- 0x0078, 0x37f2, 0x0e7f, 0x1078, 0x38c9, 0x0040, 0x3858, 0x700f,
- 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0, 0x384f,
- 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x384f, 0x710e, 0x7007,
- 0x0003, 0x1078, 0x38e9, 0x7050, 0xa086, 0x0100, 0x0040, 0x386c,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x386a, 0x1078, 0x38c9, 0x0040,
- 0x386a, 0x7007, 0x0003, 0x1078, 0x38e9, 0x7050, 0xa086, 0x0100,
- 0x0040, 0x386c, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100, 0x00c0,
- 0x3875, 0x7007, 0x0004, 0x0078, 0x387c, 0xa086, 0x0200, 0x00c0,
- 0x387b, 0x7007, 0x0005, 0x007c, 0x1078, 0x3883, 0x7006, 0x1078,
- 0x38b5, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048,
- 0x3890, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078, 0x389a,
- 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x389a, 0x7070, 0xa081,
- 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, 0x00c0, 0x38ae,
- 0x127e, 0x2091, 0x8000, 0x0068, 0x38b1, 0x2001, 0x000d, 0x2102,
- 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, 0x2001, 0x0007,
- 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x38c8, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04,
- 0x701e, 0xa005, 0x00c0, 0x38c5, 0x701a, 0x127f, 0x1078, 0x12fb,
- 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, 0x38d8,
- 0x2304, 0x230c, 0xa10e, 0x0040, 0x38d8, 0xa006, 0x0078, 0x38e8,
- 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x38e2, 0x2300, 0xa005,
- 0x0078, 0x38e8, 0x0048, 0x38e7, 0xa302, 0x0078, 0x38e8, 0x8002,
- 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000,
- 0x127e, 0x2091, 0x8000, 0x2009, 0x70d9, 0x2104, 0xc08d, 0x200a,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x2071, 0x6fcd, 0x7003, 0x0000,
- 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000,
- 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000,
- 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x6fcd, 0x6848, 0xa005, 0x00c0, 0x3925, 0x7028, 0xc085,
- 0x702a, 0xa085, 0x0001, 0x0078, 0x394a, 0x6a50, 0x7236, 0x6b54,
- 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e, 0x6848,
- 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007, 0x8006,
- 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319,
- 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700f,
- 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0x6fcd, 0x7004,
- 0x1079, 0x39aa, 0x700c, 0x0079, 0x3955, 0x395a, 0x394f, 0x394f,
- 0x394f, 0x394f, 0x007c, 0x700c, 0x0079, 0x395e, 0x3963, 0x39a8,
- 0x39a8, 0x39a9, 0x39a9, 0x7830, 0x7930, 0xa106, 0x0040, 0x396d,
- 0x7830, 0x7930, 0xa106, 0x00c0, 0x3993, 0x7030, 0xa10a, 0x0040,
- 0x3993, 0x00c8, 0x3975, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x00c8,
- 0x3994, 0x1078, 0x12c7, 0x0040, 0x3993, 0x2d00, 0x705a, 0x7063,
- 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e, 0x2091,
- 0x8000, 0x2009, 0x70d9, 0x2104, 0xc085, 0x200a, 0x007f, 0x700e,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x1078, 0x12c7, 0x0040, 0x3993,
- 0x2d00, 0x705a, 0x1078, 0x12c7, 0x00c0, 0x39a0, 0x0078, 0x397f,
- 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078, 0x3983,
- 0x007c, 0x007c, 0x39bb, 0x39bc, 0x39f3, 0x39f4, 0x39a8, 0x3a2a,
- 0x3a2f, 0x3a66, 0x3a67, 0x3a82, 0x3a83, 0x3a84, 0x3a85, 0x3a86,
- 0x3a87, 0x3af0, 0x3b1a, 0x007c, 0x700c, 0x0079, 0x39bf, 0x39c4,
- 0x39c7, 0x39d7, 0x39f2, 0x39f2, 0x1078, 0x395b, 0x007c, 0x127e,
- 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x3df9, 0x0040, 0x39d4,
- 0x2091, 0x8000, 0x1078, 0x395b, 0x0d7f, 0x0078, 0x39e0, 0x127e,
- 0x8001, 0x700e, 0x1078, 0x3df9, 0x7058, 0x2068, 0x7084, 0x705a,
- 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a,
- 0x0020, 0x00c8, 0x39ef, 0x1079, 0x3a0a, 0x127f, 0x007c, 0x127f,
- 0x1078, 0x3a88, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, 0x6fcd,
- 0x700c, 0x0079, 0x39fb, 0x3a00, 0x3a00, 0x3a00, 0x3a02, 0x3a06,
- 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3a08, 0x700f, 0x0002,
- 0x0e7f, 0x007c, 0x3a88, 0x3a88, 0x3aa4, 0x3a88, 0x3b8f, 0x3a88,
- 0x3a88, 0x3a88, 0x3a88, 0x3a88, 0x3aa4, 0x3bd4, 0x3c1d, 0x3c75,
- 0x3c88, 0x3a88, 0x3a88, 0x3ac0, 0x3aa4, 0x3a88, 0x3a88, 0x3ad6,
- 0x3d0f, 0x3d2c, 0x3a88, 0x3ac0, 0x3a88, 0x3a88, 0x3a88, 0x3a88,
- 0x3ad6, 0x3d2c, 0x7020, 0x2068, 0x1078, 0x12fb, 0x007c, 0x700c,
- 0x0079, 0x3a32, 0x3a37, 0x3a3a, 0x3a4a, 0x3a65, 0x3a65, 0x1078,
- 0x395b, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078,
- 0x3df9, 0x0040, 0x3a47, 0x2091, 0x8000, 0x1078, 0x395b, 0x0d7f,
- 0x0078, 0x3a53, 0x127e, 0x8001, 0x700e, 0x1078, 0x3df9, 0x7058,
- 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834,
- 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x3a62, 0x1079, 0x3a68,
- 0x127f, 0x007c, 0x127f, 0x1078, 0x3a88, 0x007c, 0x007c, 0x007c,
- 0x3a88, 0x3aa4, 0x3b79, 0x3a88, 0x3aa4, 0x3a88, 0x3aa4, 0x3aa4,
- 0x3a88, 0x3aa4, 0x3b79, 0x3aa4, 0x3aa4, 0x3aa4, 0x3aa4, 0x3aa4,
- 0x3a88, 0x3aa4, 0x3b79, 0x3a88, 0x3a88, 0x3aa4, 0x3a88, 0x3a88,
- 0x3a88, 0x3aa4, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3720, 0x127f, 0x007c, 0x7007, 0x0001,
- 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3720, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3720,
- 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3720, 0x127f, 0x007c,
- 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3a96, 0x8001, 0x00c0,
- 0x3acd, 0x7007, 0x0001, 0x0078, 0x3b56, 0x7007, 0x0006, 0x7012,
- 0x2d00, 0x7016, 0x701a, 0x704b, 0x3b56, 0x007c, 0x2d00, 0x7016,
- 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, 0x6ff8,
- 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x3ab2, 0x6884,
- 0xa08a, 0x0003, 0x00c8, 0x3ab2, 0xa080, 0x3b47, 0x2004, 0x70c6,
- 0x7010, 0xa015, 0x0040, 0x3b3a, 0x1078, 0x12c7, 0x00c0, 0x3afb,
- 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060, 0x6000,
- 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8, 0x3b0a,
- 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, 0xa296, 0x0004,
- 0x0040, 0x3b13, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90, 0x0022,
- 0x1078, 0x1332, 0x7090, 0xa08e, 0x0100, 0x0040, 0x3b2e, 0xa086,
- 0x0200, 0x0040, 0x3b26, 0x7007, 0x0010, 0x007c, 0x7020, 0x2068,
- 0x1078, 0x12fb, 0x7014, 0x2068, 0x0078, 0x3ab2, 0x7020, 0x2068,
- 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, 0x6906, 0x711a,
- 0x0078, 0x3af0, 0x7014, 0x2068, 0x7007, 0x0001, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x0040, 0x3d49, 0x0078, 0x3b56, 0x3b4a,
- 0x3b4e, 0x3b52, 0x0002, 0x0011, 0x0007, 0x0004, 0x000a, 0x000f,
- 0x0005, 0x0006, 0x0012, 0x000f, 0x0005, 0x0006, 0x2009, 0x6f2a,
- 0x210c, 0x81ff, 0x00c0, 0x3b73, 0x6838, 0xa084, 0x00ff, 0x683a,
- 0x6853, 0x0000, 0x1078, 0x3316, 0x00c0, 0x3b67, 0x007c, 0x1078,
- 0x37b0, 0x127e, 0x2091, 0x8000, 0x1078, 0x63d5, 0x1078, 0x3720,
- 0x127f, 0x0078, 0x3b66, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078,
- 0x3b67, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010,
- 0x8001, 0x7012, 0x0040, 0x3b88, 0x7007, 0x0006, 0x0078, 0x3b8e,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x2f59,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014, 0x00c0, 0x2f57,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2f57, 0x7834,
+ 0xa005, 0x00c0, 0x2f57, 0x7a38, 0xd2fc, 0x0040, 0x2f51, 0x70a4,
+ 0xa005, 0x00c0, 0x2f51, 0x2019, 0x002a, 0x1078, 0x202f, 0x70a7,
+ 0x0001, 0x7083, 0x0014, 0x1078, 0x2f5b, 0x0078, 0x2f59, 0x707b,
+ 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0015, 0x1078, 0x3227, 0x20a3,
+ 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x728e, 0x706c, 0xa006,
+ 0x00c0, 0x2f77, 0x7150, 0xa186, 0xffff, 0x0040, 0x2f77, 0xa180,
+ 0x2091, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x3152, 0x20a9,
+ 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005,
+ 0x0040, 0x2fcc, 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0014,
+ 0x00c0, 0x2fca, 0x2079, 0x7280, 0x7a30, 0xa296, 0x1105, 0x00c0,
+ 0x2fca, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x2fb1, 0x7a38,
+ 0xd2fc, 0x0040, 0x2fad, 0x70a4, 0xa005, 0x00c0, 0x2fad, 0x2019,
+ 0x002a, 0x1078, 0x202f, 0x70a7, 0x0001, 0x707f, 0x0001, 0x0078,
+ 0x2fc4, 0xa005, 0x00c0, 0x2fca, 0x7a38, 0xd2fc, 0x0040, 0x2fc2,
+ 0x70a4, 0xa005, 0x00c0, 0x2fc2, 0x2019, 0x002a, 0x1078, 0x202f,
+ 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x0016, 0x1078, 0x2fce,
+ 0x0078, 0x2fcc, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9, 0x000e,
+ 0x53a6, 0x3430, 0x2011, 0x728e, 0x707c, 0xa005, 0x0040, 0x2fe4,
+ 0x7083, 0x0017, 0x0078, 0x2fe6, 0x7083, 0x001b, 0x706c, 0xa005,
+ 0x00c0, 0x2ff0, 0x1078, 0x30bc, 0x0040, 0x3000, 0x0078, 0x2ffa,
+ 0x20a9, 0x0008, 0x2099, 0x728e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31b2, 0x0078, 0x3002,
+ 0x1078, 0x2c5d, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3023,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0, 0x3021,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x3021, 0x7834,
+ 0xa005, 0x00c0, 0x3021, 0x7083, 0x0018, 0x1078, 0x3025, 0x0078,
+ 0x3023, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0019, 0x1078,
+ 0x3227, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x728e,
+ 0x2039, 0x720e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514,
+ 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007,
+ 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0, 0x720e, 0x2414,
+ 0xa38c, 0x0001, 0x0040, 0x3050, 0xa294, 0xff00, 0x0078, 0x3053,
+ 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9,
+ 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084,
+ 0x1078, 0x31b2, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3085,
+ 0x2011, 0x318e, 0x1078, 0x40d1, 0xa086, 0x0084, 0x00c0, 0x3083,
+ 0x2079, 0x7280, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x3083, 0x7834,
+ 0xa005, 0x00c0, 0x3083, 0x1078, 0x320d, 0x7083, 0x001a, 0x1078,
+ 0x3087, 0x0078, 0x3085, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
+ 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1,
+ 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8,
+ 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x31b2, 0x007c,
+ 0x7078, 0xa005, 0x0040, 0x30ac, 0x2011, 0x318e, 0x1078, 0x40d1,
+ 0x7083, 0x001c, 0x1078, 0x30ad, 0x007c, 0x707b, 0x0000, 0x608b,
+ 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011,
+ 0x318e, 0x1078, 0x40c4, 0x007c, 0x087e, 0x097e, 0x2029, 0x6d52,
+ 0x252c, 0x20a9, 0x0008, 0x2041, 0x720e, 0x28a0, 0x2099, 0x728e,
+ 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x30d2,
+ 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0,
+ 0x30e4, 0xd5d4, 0x0040, 0x30df, 0x8210, 0x0078, 0x30e0, 0x8211,
+ 0x00f0, 0x30d2, 0x0078, 0x3149, 0x82ff, 0x00c0, 0x30f6, 0xd5d4,
+ 0x0040, 0x30f0, 0xa1a6, 0x3fff, 0x0040, 0x30dc, 0x0078, 0x30f4,
+ 0xa1a6, 0x3fff, 0x0040, 0x3149, 0xa18d, 0xc000, 0x20a9, 0x0010,
+ 0x2019, 0x0001, 0xd5d4, 0x0040, 0x30ff, 0x2019, 0x0010, 0x2120,
+ 0xd5d4, 0x0040, 0x3106, 0x8423, 0x0078, 0x3107, 0x8424, 0x00c8,
+ 0x3114, 0xd5d4, 0x0040, 0x310f, 0x8319, 0x0078, 0x3110, 0x8318,
+ 0x00f0, 0x3100, 0x0078, 0x3149, 0x23a8, 0x2021, 0x0001, 0x8426,
+ 0x8425, 0x00f0, 0x3118, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040,
+ 0x312c, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8,
+ 0xa5a8, 0x0010, 0x00f0, 0x3128, 0x754e, 0xa5c8, 0x2091, 0x292c,
+ 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304,
+ 0xa405, 0x201a, 0x706f, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008,
+ 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078,
+ 0x314f, 0xa006, 0x0078, 0x314f, 0xa006, 0x1078, 0x12b7, 0x097f,
+ 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a,
+ 0x0010, 0x0048, 0x315f, 0x8420, 0x8001, 0x0078, 0x3157, 0x2118,
+ 0x84ff, 0x0040, 0x3168, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x3163,
+ 0x2021, 0x0001, 0x83ff, 0x0040, 0x3171, 0x8423, 0x8319, 0x00c0,
+ 0x316d, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x3186, 0xa405, 0x203a,
+ 0x714e, 0xa1a0, 0x2091, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7,
+ 0x0000, 0x65ea, 0x706f, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e,
+ 0x2071, 0x6d00, 0x7073, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e,
+ 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x4fe5, 0x7004, 0xa084,
+ 0x4000, 0x0040, 0x319f, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x6d00, 0x7003, 0x0001, 0x2071, 0x6d20,
+ 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f,
+ 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011, 0x6f1a, 0x2013,
+ 0x0000, 0x707b, 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056,
+ 0x60a7, 0x9575, 0x1078, 0x4fdc, 0x2009, 0x07d0, 0x2011, 0x318e,
+ 0x1078, 0x415f, 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091,
+ 0x8000, 0x2009, 0x00f7, 0x1078, 0x3233, 0x2061, 0x6f23, 0x601b,
+ 0x0000, 0x601f, 0x0000, 0x2061, 0x6d00, 0x6003, 0x0001, 0x2061,
+ 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011,
+ 0x31f0, 0x1078, 0x40c4, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c,
+ 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078,
+ 0x4fe5, 0x2071, 0x0140, 0xa084, 0x4000, 0x0040, 0x3203, 0x7003,
+ 0x1000, 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x1dc9, 0x1078,
+ 0x31cb, 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1,
+ 0x73c0, 0x2099, 0x728e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0,
+ 0x00f0, 0x3213, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099,
+ 0x7200, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x2099, 0x7280, 0x20a1, 0x020b, 0x20a9,
+ 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f,
+ 0x2001, 0x6d2c, 0x2004, 0xa005, 0x00c0, 0x3244, 0x6030, 0xa084,
+ 0x00ff, 0xa105, 0x0078, 0x3246, 0xa185, 0x00f7, 0x604a, 0x007f,
+ 0x0c7f, 0x007c, 0x157e, 0x20a9, 0x00ff, 0x2009, 0x6e00, 0xa006,
+ 0x200a, 0x8108, 0x00f0, 0x3250, 0x157f, 0x007c, 0x0d7e, 0x037e,
+ 0x157e, 0x137e, 0x147e, 0x2069, 0x6d51, 0xa006, 0x6002, 0x6007,
+ 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2091, 0x231c, 0xa39c,
+ 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4,
+ 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042,
+ 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a,
+ 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a,
+ 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x604a, 0x6810,
+ 0x603a, 0x680c, 0x6046, 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0xa1b4, 0x00ff, 0xa682,
+ 0x0010, 0x00c8, 0x3337, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
+ 0x00c8, 0x333d, 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x3316,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x331c, 0x6078,
+ 0xa00d, 0x0040, 0x32c1, 0xa680, 0x6c84, 0x2004, 0xa10c, 0x00c0,
+ 0x3310, 0x607c, 0xa00d, 0x0040, 0x32dd, 0xa680, 0x6c84, 0x2004,
+ 0xa10c, 0x0040, 0x32dd, 0x694c, 0xd1fc, 0x00c0, 0x32d3, 0x1078,
+ 0x33d0, 0x0078, 0x330b, 0x1078, 0x33a1, 0x694c, 0xd1ec, 0x00c0,
+ 0x330b, 0x1078, 0x34f0, 0x0078, 0x330b, 0x694c, 0xa184, 0xa000,
+ 0x0040, 0x32fb, 0xd1ec, 0x0040, 0x32f4, 0xd1fc, 0x0040, 0x32ec,
+ 0x1078, 0x3507, 0x0078, 0x32f7, 0xa680, 0x6c84, 0x200c, 0x607c,
+ 0xa105, 0x607e, 0x0078, 0x32fb, 0xd1fc, 0x0040, 0x32fb, 0x1078,
+ 0x33a1, 0x0078, 0x330b, 0x6050, 0xa00d, 0x0040, 0x3306, 0x2d00,
+ 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x330b, 0x2d00, 0x6052,
+ 0x604e, 0x6803, 0x0000, 0x1078, 0x4346, 0xa006, 0x127f, 0x007c,
+ 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x3341, 0xa082, 0x0006, 0x0048, 0x32b7,
+ 0x2009, 0x6d0c, 0x210c, 0xd18c, 0x0040, 0x332a, 0x2001, 0x0004,
+ 0x0078, 0x3333, 0xd184, 0x0040, 0x3331, 0x2001, 0x0004, 0x0078,
+ 0x3333, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001,
+ 0x0029, 0x2009, 0x0000, 0x0078, 0x3341, 0x2001, 0x0029, 0x2009,
+ 0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0xa1b4, 0x00ff, 0xa682,
+ 0x0010, 0x00c8, 0x3386, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
+ 0x00c8, 0x3376, 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x3376,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x337c, 0x684c,
+ 0xd0ec, 0x0040, 0x3369, 0x1078, 0x3507, 0x1078, 0x33a1, 0x0078,
+ 0x3371, 0x1078, 0x33a1, 0x684c, 0xd0fc, 0x0040, 0x3371, 0x1078,
+ 0x34f0, 0x1078, 0x351b, 0xa006, 0x0078, 0x338a, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x338a, 0xa082, 0x0006, 0x0048, 0x335f,
+ 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x338a, 0x2001, 0x0029,
+ 0x2009, 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050,
+ 0xa00d, 0x0040, 0x339a, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
+ 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078,
+ 0x3398, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x33ad,
+ 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
+ 0x6803, 0x0000, 0x0078, 0x33ab, 0x127e, 0x2091, 0x8000, 0x604c,
+ 0xa06d, 0x0040, 0x33c2, 0x6800, 0xa005, 0x00c0, 0x33c0, 0x6052,
+ 0x604e, 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x33cf,
+ 0x6800, 0xa005, 0x00c0, 0x33cd, 0x6052, 0x604e, 0xad05, 0x007c,
+ 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040, 0x33da, 0x2d00, 0x200a,
+ 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x33d9, 0x127e,
+ 0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005,
+ 0x0040, 0x33ed, 0xc285, 0x0078, 0x33ee, 0xc284, 0x6202, 0x027f,
+ 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218,
+ 0x2260, 0x6204, 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f,
+ 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204,
+ 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c,
+ 0x027e, 0xa182, 0x00ff, 0x0048, 0x3419, 0xa085, 0x0001, 0x0078,
+ 0x342d, 0xa190, 0x6e00, 0x2204, 0xa065, 0x00c0, 0x342c, 0x017e,
+ 0x0d7e, 0x1078, 0x12f4, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x3415,
+ 0x2c00, 0x2012, 0x1078, 0x3256, 0xa006, 0x027f, 0x007c, 0x027e,
+ 0xa182, 0x00ff, 0x0048, 0x3438, 0xa085, 0x0001, 0x0078, 0x3445,
+ 0x0d7e, 0xa190, 0x6e00, 0x2204, 0xa06d, 0x0040, 0x3443, 0x2013,
+ 0x0000, 0x1078, 0x1328, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e,
+ 0xa182, 0x00ff, 0x0048, 0x3450, 0xa085, 0x0001, 0x0078, 0x3457,
+ 0xa188, 0x6e00, 0x2104, 0xa065, 0x0040, 0x344c, 0xa006, 0x017f,
+ 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f,
+ 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0x728e, 0x6808, 0x605e,
+ 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x346f, 0x603a, 0x6814,
+ 0x6066, 0x2099, 0x7296, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2099, 0x729a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2069, 0x72ae, 0x6904, 0xa18c, 0x00ff, 0x810f, 0x6808,
+ 0xa084, 0x00ff, 0xa105, 0x606a, 0x690c, 0x616e, 0x6810, 0x6072,
+ 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x349a, 0x2009, 0x0008,
+ 0x0078, 0x34c4, 0xa182, 0x0259, 0x00c8, 0x34a2, 0x2009, 0x0007,
+ 0x0078, 0x34c4, 0xa182, 0x02c1, 0x00c8, 0x34aa, 0x2009, 0x0006,
+ 0x0078, 0x34c4, 0xa182, 0x0349, 0x00c8, 0x34b2, 0x2009, 0x0005,
+ 0x0078, 0x34c4, 0xa182, 0x0421, 0x00c8, 0x34ba, 0x2009, 0x0004,
+ 0x0078, 0x34c4, 0xa182, 0x0581, 0x00c8, 0x34c2, 0x2009, 0x0003,
+ 0x0078, 0x34c4, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f, 0x157f,
+ 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x728d, 0x2e04, 0x6896, 0x2071,
+ 0x728e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c, 0x2001,
+ 0x6c84, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10d,
+ 0x617a, 0x127f, 0x007c, 0x2001, 0x6c84, 0xa600, 0x2004, 0x8002,
+ 0x127e, 0x2091, 0x8000, 0x6178, 0xa10c, 0x617a, 0x127f, 0x007c,
+ 0x2001, 0x6c84, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000,
+ 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078, 0x3500, 0x1078, 0x338c,
+ 0x1078, 0x3561, 0x00c0, 0x34fe, 0x1078, 0x351b, 0x007c, 0x2001,
+ 0x6c84, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c, 0xa10d,
+ 0x617e, 0x127f, 0x0078, 0x3516, 0x1078, 0x33d0, 0x1078, 0x3525,
+ 0x00c0, 0x3514, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4346,
+ 0x127f, 0x007c, 0xa01e, 0x0078, 0x3527, 0x2019, 0x0001, 0xa00e,
+ 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0,
+ 0x3547, 0x8dff, 0x0040, 0x355c, 0x83ff, 0x0040, 0x353f, 0x6844,
+ 0xa084, 0x00ff, 0xa606, 0x0040, 0x354c, 0x0078, 0x3547, 0x683c,
+ 0xa406, 0x00c0, 0x3547, 0x6840, 0xa506, 0x0040, 0x354c, 0x2d08,
+ 0x6800, 0x2068, 0x0078, 0x3531, 0x6a00, 0x604c, 0xad06, 0x00c0,
+ 0x3554, 0x624e, 0x0078, 0x3557, 0xa180, 0x0000, 0x2202, 0x82ff,
+ 0x00c0, 0x355c, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078,
+ 0x3563, 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040,
+ 0x3591, 0x83ff, 0x0040, 0x3574, 0x6844, 0xa084, 0x00ff, 0xa606,
+ 0x0040, 0x3581, 0x0078, 0x357c, 0x683c, 0xa406, 0x00c0, 0x357c,
+ 0x6840, 0xa506, 0x0040, 0x3581, 0x2d08, 0x6800, 0x2068, 0x0078,
+ 0x3566, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x3589, 0x6282, 0x0078,
+ 0x358c, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x3591, 0x6186,
+ 0x8dff, 0x007c, 0x2001, 0x6c84, 0xa600, 0x2004, 0x6178, 0xa10c,
+ 0x0040, 0x359c, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040, 0x35a2,
+ 0xa295, 0x0002, 0x007c, 0x1078, 0x35ec, 0x0040, 0x35ab, 0x1078,
+ 0x61f8, 0x0078, 0x35ad, 0xa085, 0x0001, 0x007c, 0x1078, 0x35ec,
+ 0x0040, 0x35b6, 0x1078, 0x6187, 0x0078, 0x35b8, 0xa085, 0x0001,
+ 0x007c, 0x1078, 0x35ec, 0x0040, 0x35c1, 0x1078, 0x61cd, 0x0078,
+ 0x35c3, 0xa085, 0x0001, 0x007c, 0x1078, 0x35ec, 0x0040, 0x35cc,
+ 0x1078, 0x61a3, 0x0078, 0x35ce, 0xa085, 0x0001, 0x007c, 0x127e,
+ 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040, 0x35e4,
+ 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
+ 0x36a1, 0x007f, 0x0078, 0x35d5, 0x6083, 0x0000, 0x6087, 0x0000,
+ 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e,
+ 0x2079, 0x6d51, 0x7804, 0xd0a4, 0x0040, 0x3618, 0x157e, 0x0c7e,
+ 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3447, 0x00c0,
+ 0x360c, 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x00c0,
+ 0x360c, 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, 0x35fc,
+ 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011, 0x361a, 0x1078, 0x415f,
+ 0x0f7f, 0x007c, 0x2011, 0x361a, 0x1078, 0x40d1, 0x157e, 0x0c7e,
+ 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3447, 0x00c0,
+ 0x3646, 0x6000, 0xd0ec, 0x0040, 0x3646, 0x047e, 0x62a0, 0xa294,
+ 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x6bf7, 0x6000,
+ 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x445c, 0x1078,
+ 0x43a9, 0x2009, 0x0000, 0x1078, 0x6a57, 0x047f, 0x017f, 0x8108,
+ 0x00f0, 0x3624, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, 0x2060,
+ 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x6ddf, 0x7003,
+ 0x0001, 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b,
+ 0x0000, 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b,
+ 0x0020, 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, 0x2071,
+ 0x6ddf, 0x684c, 0xa005, 0x00c0, 0x367c, 0x7028, 0xc085, 0x702a,
+ 0xa085, 0x0001, 0x0078, 0x369f, 0x6a60, 0x7236, 0x6b64, 0x733a,
+ 0x6868, 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e,
+ 0x6844, 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, 0x8006,
+ 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e,
+ 0x7372, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x0e7f,
+ 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x36f2, 0x6804, 0xa00d,
+ 0x0040, 0x36c0, 0x0d7e, 0x0e7e, 0x2071, 0x6d00, 0x027e, 0xa016,
+ 0x702c, 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0,
+ 0x36b1, 0x702e, 0x70a0, 0xa200, 0x70a2, 0x027f, 0x0e7f, 0x0d7f,
+ 0x2071, 0x6ddf, 0x701c, 0xa005, 0x00c0, 0x3703, 0x0068, 0x3701,
+ 0x2071, 0x6d51, 0x7004, 0xd09c, 0x0040, 0x3701, 0x6934, 0xa186,
+ 0x0103, 0x00c0, 0x3714, 0x6948, 0x6844, 0xa105, 0x00c0, 0x36f4,
+ 0x2009, 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x3701,
+ 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091,
+ 0x4080, 0x2071, 0x6d00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70a0,
+ 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0,
+ 0x3701, 0x6868, 0xa005, 0x00c0, 0x3701, 0x2009, 0x8020, 0x0078,
+ 0x36da, 0x2071, 0x6ddf, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000,
+ 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040, 0x3711, 0x6902, 0x0078,
+ 0x3712, 0x711e, 0x0078, 0x36f2, 0xa18c, 0x00ff, 0xa18e, 0x0017,
+ 0x0040, 0x371e, 0xa18e, 0x001f, 0x00c0, 0x3701, 0x684c, 0xd0cc,
+ 0x0040, 0x3701, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0,
+ 0x3701, 0x2009, 0x8021, 0x0078, 0x36da, 0x007e, 0x6837, 0x0103,
+ 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4,
+ 0x007f, 0x684a, 0x6952, 0x007c, 0x2071, 0x6ddf, 0x7004, 0x0079,
+ 0x3741, 0x3749, 0x3758, 0x37e4, 0x37e5, 0x37f5, 0x37fb, 0x374a,
+ 0x37d2, 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x3757, 0x2009,
+ 0x000d, 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f,
+ 0x701c, 0xa06d, 0x0040, 0x37d1, 0x0e7e, 0x2071, 0x6d51, 0x7004,
+ 0xd09c, 0x0040, 0x37b3, 0x6934, 0xa186, 0x0103, 0x00c0, 0x378d,
+ 0x6948, 0x6844, 0xa105, 0x00c0, 0x37a6, 0x2009, 0x8020, 0x127e,
+ 0x2091, 0x8000, 0x0068, 0x3789, 0x2071, 0x0000, 0x7018, 0xd084,
+ 0x00c0, 0x3789, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b,
+ 0x0001, 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x382e, 0x0078,
+ 0x37d1, 0x127f, 0x0e7f, 0x0078, 0x37d1, 0xa18c, 0x00ff, 0xa18e,
+ 0x0017, 0x0040, 0x3797, 0xa18e, 0x001f, 0x00c0, 0x37b3, 0x684c,
+ 0xd0cc, 0x0040, 0x37b3, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001,
+ 0x00c0, 0x37b3, 0x2009, 0x8021, 0x0078, 0x376f, 0x6844, 0xa086,
+ 0x0100, 0x00c0, 0x37b3, 0x6868, 0xa005, 0x00c0, 0x37b3, 0x2009,
+ 0x8020, 0x0078, 0x376f, 0x0e7f, 0x1078, 0x3842, 0x0040, 0x37d1,
+ 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0,
+ 0x37c8, 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x37c8, 0x710e,
+ 0x7007, 0x0003, 0x1078, 0x3862, 0x7050, 0xa086, 0x0100, 0x0040,
+ 0x37e5, 0x007c, 0x701c, 0xa06d, 0x0040, 0x37e3, 0x1078, 0x3842,
+ 0x0040, 0x37e3, 0x7007, 0x0003, 0x1078, 0x3862, 0x7050, 0xa086,
+ 0x0100, 0x0040, 0x37e5, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100,
+ 0x00c0, 0x37ee, 0x7007, 0x0004, 0x0078, 0x37f5, 0xa086, 0x0200,
+ 0x00c0, 0x37f4, 0x7007, 0x0005, 0x007c, 0x1078, 0x37fc, 0x7006,
+ 0x1078, 0x382e, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102,
+ 0x0048, 0x3809, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078,
+ 0x3813, 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x3813, 0x7070,
+ 0xa081, 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, 0x00c0,
+ 0x3827, 0x127e, 0x2091, 0x8000, 0x0068, 0x382a, 0x2001, 0x000d,
+ 0x2102, 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, 0x2001,
+ 0x0007, 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, 0xa06d,
+ 0x0040, 0x3841, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012,
+ 0x2d04, 0x701e, 0xa005, 0x00c0, 0x383e, 0x701a, 0x127f, 0x1078,
+ 0x1328, 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040,
+ 0x3851, 0x2304, 0x230c, 0xa10e, 0x0040, 0x3851, 0xa006, 0x0078,
+ 0x3861, 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x385b, 0x2300,
+ 0xa005, 0x0078, 0x3861, 0x0048, 0x3860, 0xa302, 0x0078, 0x3861,
+ 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053,
+ 0x0000, 0x127e, 0x2091, 0x8000, 0x2009, 0x6f31, 0x2104, 0xc08d,
+ 0x200a, 0x127f, 0x1078, 0x1379, 0x007c, 0x2071, 0x6dad, 0x7003,
+ 0x0000, 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f,
+ 0x0000, 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083,
+ 0x0000, 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c,
+ 0x0e7e, 0x2071, 0x6dad, 0x6848, 0xa005, 0x00c0, 0x389e, 0x7028,
+ 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x38c3, 0x6a50, 0x7236,
+ 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e,
+ 0x6848, 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007,
+ 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100,
+ 0xa319, 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001,
+ 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0x6dad,
+ 0x7004, 0x1079, 0x3923, 0x700c, 0x0079, 0x38ce, 0x38d3, 0x38c8,
+ 0x38c8, 0x38c8, 0x38c8, 0x007c, 0x700c, 0x0079, 0x38d7, 0x38dc,
+ 0x3921, 0x3921, 0x3922, 0x3922, 0x7830, 0x7930, 0xa106, 0x0040,
+ 0x38e6, 0x7830, 0x7930, 0xa106, 0x00c0, 0x390c, 0x7030, 0xa10a,
+ 0x0040, 0x390c, 0x00c8, 0x38ee, 0x712c, 0xa10a, 0xa18a, 0x0002,
+ 0x00c8, 0x390d, 0x1078, 0x12f4, 0x0040, 0x390c, 0x2d00, 0x705a,
+ 0x7063, 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e,
+ 0x2091, 0x8000, 0x2009, 0x6f31, 0x2104, 0xc085, 0x200a, 0x007f,
+ 0x700e, 0x127f, 0x1078, 0x1379, 0x007c, 0x1078, 0x12f4, 0x0040,
+ 0x390c, 0x2d00, 0x705a, 0x1078, 0x12f4, 0x00c0, 0x3919, 0x0078,
+ 0x38f8, 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078,
+ 0x38fc, 0x007c, 0x007c, 0x3934, 0x3935, 0x396c, 0x396d, 0x3921,
+ 0x39a3, 0x39a8, 0x39df, 0x39e0, 0x39fb, 0x39fc, 0x39fd, 0x39fe,
+ 0x39ff, 0x3a00, 0x3a69, 0x3a93, 0x007c, 0x700c, 0x0079, 0x3938,
+ 0x393d, 0x3940, 0x3950, 0x396b, 0x396b, 0x1078, 0x38d4, 0x007c,
+ 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x3d52, 0x0040,
+ 0x394d, 0x2091, 0x8000, 0x1078, 0x38d4, 0x0d7f, 0x0078, 0x3959,
+ 0x127e, 0x8001, 0x700e, 0x1078, 0x3d52, 0x7058, 0x2068, 0x7084,
+ 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff,
+ 0xa08a, 0x0020, 0x00c8, 0x3968, 0x1079, 0x3983, 0x127f, 0x007c,
+ 0x127f, 0x1078, 0x3a01, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071,
+ 0x6dad, 0x700c, 0x0079, 0x3974, 0x3979, 0x3979, 0x3979, 0x397b,
+ 0x397f, 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3981, 0x700f,
+ 0x0002, 0x0e7f, 0x007c, 0x3a01, 0x3a01, 0x3a1d, 0x3a01, 0x3aff,
+ 0x3a01, 0x3a01, 0x3a01, 0x3a01, 0x3a01, 0x3a1d, 0x3b44, 0x3b8d,
+ 0x3be5, 0x3bf8, 0x3a01, 0x3a01, 0x3a39, 0x3a1d, 0x3a01, 0x3a01,
+ 0x3a4f, 0x3c74, 0x3c91, 0x3a01, 0x3a39, 0x3a01, 0x3a01, 0x3a01,
+ 0x3a01, 0x3a01, 0x3c91, 0x7020, 0x2068, 0x1078, 0x1328, 0x007c,
+ 0x700c, 0x0079, 0x39ab, 0x39b0, 0x39b3, 0x39c3, 0x39de, 0x39de,
+ 0x1078, 0x38d4, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
+ 0x1078, 0x3d52, 0x0040, 0x39c0, 0x2091, 0x8000, 0x1078, 0x38d4,
+ 0x0d7f, 0x0078, 0x39cc, 0x127e, 0x8001, 0x700e, 0x1078, 0x3d52,
+ 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
+ 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x39db, 0x1079,
+ 0x39e1, 0x127f, 0x007c, 0x127f, 0x1078, 0x3a01, 0x007c, 0x007c,
+ 0x007c, 0x3a01, 0x3a1d, 0x3ae9, 0x3a01, 0x3a1d, 0x3a01, 0x3a1d,
+ 0x3a1d, 0x3a01, 0x3a1d, 0x3ae9, 0x3a1d, 0x3a1d, 0x3a1d, 0x3a1d,
+ 0x3a1d, 0x3a01, 0x3a1d, 0x3ae9, 0x3a01, 0x3a01, 0x3a1d, 0x3a01,
+ 0x3a01, 0x3a01, 0x3a1d, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c,
+ 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1, 0x127f, 0x007c, 0x7007,
+ 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x36a1, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838,
+ 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x36a1, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff,
+ 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1, 0x127f,
+ 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3a0f, 0x8001,
+ 0x00c0, 0x3a46, 0x7007, 0x0001, 0x0078, 0x3ac8, 0x7007, 0x0006,
+ 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x3ac8, 0x007c, 0x2d00,
+ 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1,
+ 0x6dd8, 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x3a2b,
+ 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3a2b, 0xa080, 0x3ab9, 0x2004,
+ 0x70c6, 0x7010, 0xa015, 0x0040, 0x3ab3, 0x1078, 0x12f4, 0x00c0,
+ 0x3a74, 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060,
+ 0x6000, 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8,
+ 0x3a83, 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, 0xa296,
+ 0x0004, 0x0040, 0x3a8c, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90,
+ 0x0022, 0x1078, 0x135f, 0x7090, 0xa08e, 0x0100, 0x0040, 0x3aa7,
+ 0xa086, 0x0200, 0x0040, 0x3a9f, 0x7007, 0x0010, 0x007c, 0x7020,
+ 0x2068, 0x1078, 0x1328, 0x7014, 0x2068, 0x0078, 0x3a2b, 0x7020,
+ 0x2068, 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, 0x6906,
+ 0x711a, 0x0078, 0x3a69, 0x7014, 0x2068, 0x7007, 0x0001, 0x0078,
+ 0x3ac8, 0x3abc, 0x3ac0, 0x3ac4, 0x0002, 0x0011, 0x0007, 0x0004,
+ 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f, 0x0005, 0x0006,
+ 0x2009, 0x6d2c, 0x210c, 0x81ff, 0x00c0, 0x3ae3, 0x6838, 0xa084,
+ 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3299, 0x00c0, 0x3ad9,
+ 0x007c, 0x1078, 0x372d, 0x127e, 0x2091, 0x8000, 0x1078, 0x36a1,
+ 0x127f, 0x0078, 0x3ad8, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078,
+ 0x3ad9, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010,
+ 0x8001, 0x7012, 0x0040, 0x3af8, 0x7007, 0x0006, 0x0078, 0x3afe,
0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, 0x007c, 0x7007,
0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, 0x00ff,
- 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3bba, 0x2009, 0x0000,
- 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3bba, 0xa005, 0x00c0,
- 0x3bd1, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34cb, 0x00c0,
- 0x3bd1, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078, 0x3560, 0x067f,
- 0x0078, 0x3bd1, 0x047e, 0x2011, 0x6f0c, 0x2224, 0xc484, 0xc48c,
- 0x2412, 0x047f, 0x0c7e, 0x1078, 0x34cb, 0x00c0, 0x3bcd, 0x2091,
- 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108, 0x00f0, 0x3bc3,
- 0x0c7f, 0x1078, 0x12fb, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007,
- 0x0001, 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x0040, 0x3c14, 0x6944,
- 0x1078, 0x3e15, 0x6100, 0xd184, 0x0040, 0x3bf9, 0x6858, 0xa084,
- 0x00ff, 0x00c0, 0x3c17, 0x6000, 0xd084, 0x0040, 0x3c14, 0x6004,
- 0xa005, 0x00c0, 0x3c1a, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078,
- 0x3c11, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, 0x3c01, 0x2001,
- 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x3c14,
- 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3c14, 0x600a,
- 0x6202, 0x127f, 0x0078, 0x3de8, 0x127f, 0x0078, 0x3de0, 0x127f,
- 0x0078, 0x3dd8, 0x127f, 0x0078, 0x3ddc, 0x127e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x0040, 0x3c72,
- 0x6944, 0x1078, 0x3e15, 0x6000, 0xa084, 0x0001, 0x0040, 0x3c72,
- 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, 0x3c4a, 0x6958,
- 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3c43, 0x2100, 0xa210, 0x0048,
- 0x3c6f, 0x0078, 0x3c4a, 0x8001, 0x00c0, 0x3c6f, 0x2100, 0xa212,
- 0x0048, 0x3c6f, 0xa484, 0x000c, 0x0040, 0x3c64, 0x6958, 0x810f,
- 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3c5c, 0x2100, 0xa318,
- 0x0048, 0x3c6f, 0x0078, 0x3c64, 0xa082, 0x0004, 0x00c0, 0x3c6f,
- 0x2100, 0xa31a, 0x0048, 0x3c6f, 0x6860, 0xa005, 0x0040, 0x3c6a,
- 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, 0x3de8, 0x127f,
- 0x0078, 0x3de4, 0x127f, 0x0078, 0x3de0, 0x127e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x6944, 0x1078, 0x3e15, 0x6308, 0x8318, 0x0048,
- 0x3c85, 0x630a, 0x127f, 0x0078, 0x3df6, 0x127f, 0x0078, 0x3de4,
+ 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3b2a, 0x2009, 0x0000,
+ 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3b2a, 0xa005, 0x00c0,
+ 0x3b41, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x3447, 0x00c0,
+ 0x3b41, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078, 0x34e3, 0x067f,
+ 0x0078, 0x3b41, 0x047e, 0x2011, 0x6d0c, 0x2224, 0xc484, 0xc48c,
+ 0x2412, 0x047f, 0x0c7e, 0x1078, 0x3447, 0x00c0, 0x3b3d, 0x2091,
+ 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108, 0x00f0, 0x3b33,
+ 0x0c7f, 0x1078, 0x1328, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007,
+ 0x0001, 0x2001, 0x6d52, 0x2004, 0xd0a4, 0x0040, 0x3b84, 0x6944,
+ 0x1078, 0x3d6e, 0x6100, 0xd184, 0x0040, 0x3b69, 0x6858, 0xa084,
+ 0x00ff, 0x00c0, 0x3b87, 0x6000, 0xd084, 0x0040, 0x3b84, 0x6004,
+ 0xa005, 0x00c0, 0x3b8a, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078,
+ 0x3b81, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, 0x3b71, 0x2001,
+ 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x3b84,
+ 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3b84, 0x600a,
+ 0x6202, 0x127f, 0x0078, 0x3d41, 0x127f, 0x0078, 0x3d39, 0x127f,
+ 0x0078, 0x3d31, 0x127f, 0x0078, 0x3d35, 0x127e, 0x2091, 0x8000,
+ 0x7007, 0x0001, 0x2001, 0x6d52, 0x2004, 0xd0a4, 0x0040, 0x3be2,
+ 0x6944, 0x1078, 0x3d6e, 0x6000, 0xa084, 0x0001, 0x0040, 0x3be2,
+ 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, 0x3bba, 0x6958,
+ 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3bb3, 0x2100, 0xa210, 0x0048,
+ 0x3bdf, 0x0078, 0x3bba, 0x8001, 0x00c0, 0x3bdf, 0x2100, 0xa212,
+ 0x0048, 0x3bdf, 0xa484, 0x000c, 0x0040, 0x3bd4, 0x6958, 0x810f,
+ 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3bcc, 0x2100, 0xa318,
+ 0x0048, 0x3bdf, 0x0078, 0x3bd4, 0xa082, 0x0004, 0x00c0, 0x3bdf,
+ 0x2100, 0xa31a, 0x0048, 0x3bdf, 0x6860, 0xa005, 0x0040, 0x3bda,
+ 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, 0x3d41, 0x127f,
+ 0x0078, 0x3d3d, 0x127f, 0x0078, 0x3d39, 0x127e, 0x2091, 0x8000,
+ 0x7007, 0x0001, 0x6944, 0x1078, 0x3d6e, 0x6308, 0x8318, 0x0048,
+ 0x3bf5, 0x630a, 0x127f, 0x0078, 0x3d4f, 0x127f, 0x0078, 0x3d3d,
0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac,
- 0x0040, 0x3c9c, 0x027e, 0x2009, 0x0000, 0x2011, 0xfcff, 0x1078,
- 0x42cd, 0x027f, 0x0078, 0x3cd2, 0x6858, 0xa005, 0x0040, 0x3ce6,
- 0x685c, 0xa065, 0x0040, 0x3ce2, 0x2001, 0x6f2a, 0x2004, 0xa005,
- 0x0040, 0x3cae, 0x1078, 0x6337, 0x0078, 0x3cb4, 0x6013, 0x0400,
- 0x2009, 0x0041, 0x1078, 0x55fc, 0x6958, 0xa18c, 0xe600, 0xa186,
- 0x2000, 0x0040, 0x3cca, 0xa186, 0x0400, 0x0040, 0x3cca, 0x6944,
- 0x0c7e, 0x1078, 0x4225, 0x6000, 0xa084, 0xfdff, 0x6002, 0x0c7f,
- 0x0078, 0x3cd2, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078,
- 0x42cd, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3cde, 0x6944, 0x1078,
- 0x4225, 0x6008, 0x8000, 0x0048, 0x3cde, 0x600a, 0x0c7f, 0x127f,
- 0x0078, 0x3de8, 0x0c7f, 0x127f, 0x0078, 0x3de0, 0x6954, 0xa186,
- 0x002a, 0x00c0, 0x3cf2, 0x2001, 0x6f0c, 0x200c, 0xc194, 0x2102,
- 0x0078, 0x3cd2, 0xa186, 0x0020, 0x0040, 0x3d07, 0xa186, 0x0029,
- 0x00c0, 0x3ce2, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, 0x34cb,
- 0x00c0, 0x3cd2, 0x6000, 0xc0e4, 0x6002, 0x0078, 0x3cd2, 0x685c,
- 0xa065, 0x0040, 0x3ce2, 0x6017, 0x0014, 0x0078, 0x3cd2, 0x6944,
- 0x1078, 0x3e15, 0x6000, 0xa084, 0x0001, 0x0040, 0x3d28, 0x2091,
- 0x8000, 0x6204, 0x8210, 0x0048, 0x3d22, 0x6206, 0x2091, 0x8001,
- 0x0078, 0x3df6, 0x2091, 0x8001, 0x6853, 0x0016, 0x0078, 0x3def,
- 0x6853, 0x0007, 0x0078, 0x3def, 0x6834, 0x8007, 0xa084, 0x00ff,
- 0x00c0, 0x3d36, 0x1078, 0x3a96, 0x0078, 0x3d48, 0x2030, 0x8001,
- 0x00c0, 0x3d40, 0x7007, 0x0001, 0x1078, 0x3d49, 0x0078, 0x3d48,
- 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x3d49,
- 0x007c, 0x0e7e, 0x2009, 0x6f2a, 0x210c, 0x81ff, 0x00c0, 0x3dca,
- 0x2009, 0x6f0c, 0x210c, 0xd194, 0x00c0, 0x3dd4, 0x6848, 0x2070,
- 0xae82, 0x7500, 0x0048, 0x3db9, 0x2001, 0x6f15, 0x2004, 0xae02,
- 0x00c8, 0x3db9, 0x6944, 0x1078, 0x3e15, 0x6100, 0xa184, 0x0001,
- 0x0040, 0x3d9f, 0xa184, 0x0100, 0x00c0, 0x3dbd, 0xa184, 0x0200,
- 0x00c0, 0x3dc1, 0x601c, 0xa005, 0x00c0, 0x3dc5, 0x711c, 0xa186,
- 0x0006, 0x00c0, 0x3da4, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08,
- 0x127e, 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, 0x3d96, 0x7112,
- 0x7018, 0xa065, 0x0040, 0x3dc9, 0x6000, 0xd0e4, 0x00c0, 0x3dce,
- 0x2e60, 0x1078, 0x422e, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800,
- 0xa005, 0x00c0, 0x3d96, 0x6902, 0x127f, 0x0e7f, 0x007c, 0x0e7f,
- 0x6853, 0x0006, 0x0078, 0x3def, 0x6944, 0xa18c, 0xff00, 0x810f,
- 0x1078, 0x34cb, 0x00c0, 0x3dcf, 0x6000, 0xd0e4, 0x00c0, 0x3dcf,
- 0x711c, 0xa186, 0x0007, 0x00c0, 0x3db9, 0x6853, 0x0002, 0x0078,
- 0x3dd1, 0x6853, 0x0008, 0x0078, 0x3dd1, 0x6853, 0x000e, 0x0078,
- 0x3dd1, 0x6853, 0x0017, 0x0078, 0x3dd1, 0x6853, 0x0035, 0x0078,
- 0x3dd1, 0x127f, 0x6853, 0x0028, 0x0078, 0x3dd1, 0x127f, 0x6853,
- 0x0029, 0x0e7f, 0x0078, 0x3def, 0x6853, 0x002a, 0x0078, 0x3dd1,
- 0x2009, 0x003e, 0x0078, 0x3dea, 0x2009, 0x0004, 0x0078, 0x3dea,
- 0x2009, 0x0006, 0x0078, 0x3dea, 0x2009, 0x0016, 0x0078, 0x3dea,
- 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856, 0x2091,
- 0x8000, 0x1078, 0x3720, 0x2091, 0x8001, 0x007c, 0x1078, 0x12fb,
- 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x3e06, 0xa00e,
- 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x3e12, 0x7070, 0xa080,
- 0x0040, 0x7072, 0x00c8, 0x3e12, 0x7074, 0xa081, 0x0000, 0x7076,
- 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078, 0x4225,
- 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085, 0x8002,
- 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1, 0x2000,
- 0x3d00, 0xa084, 0x7000, 0x0040, 0x3e31, 0xa086, 0x1000, 0x00c0,
- 0x3e4d, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x3e38, 0x3e60,
- 0xac84, 0x0007, 0x00c0, 0x3e4d, 0xac82, 0x7500, 0x0048, 0x3e4d,
- 0x6854, 0xac02, 0x00c8, 0x3e4d, 0x2009, 0x0047, 0x1078, 0x55fc,
- 0x7a1c, 0xd284, 0x00c0, 0x3e23, 0x007c, 0xa016, 0x1078, 0x1525,
- 0x0078, 0x3e48, 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20,
- 0x3e28, 0xa584, 0x0070, 0x00c0, 0x3e7b, 0xa484, 0x7000, 0xa086,
- 0x1000, 0x00c0, 0x3e7b, 0x1078, 0x3e88, 0x0040, 0x3e7b, 0x20e1,
- 0x3000, 0x7828, 0x7828, 0x1078, 0x3ea6, 0x147f, 0x137f, 0x157f,
- 0x2009, 0x70be, 0x2104, 0xa005, 0x00c0, 0x3e77, 0x007c, 0x1078,
- 0x4893, 0x0078, 0x3e76, 0x1078, 0x6df7, 0x1078, 0x3e88, 0x20e1,
- 0x3000, 0x7828, 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x3e76,
- 0xa484, 0x01ff, 0x6872, 0xa005, 0x0040, 0x3e9a, 0xa080, 0x001f,
- 0xa084, 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a,
- 0x53a5, 0x007c, 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099,
- 0x020a, 0x53a5, 0xa085, 0x0001, 0x0078, 0x3e99, 0x7000, 0xa084,
- 0xff00, 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x3eb3,
- 0x0078, 0x3f9f, 0x007c, 0xa196, 0x2000, 0x00c0, 0x3ec4, 0x6900,
- 0xa18e, 0x0001, 0x00c0, 0x3ec0, 0x1078, 0x2b5e, 0x0078, 0x3eb2,
- 0x1078, 0x3ecc, 0x0078, 0x3eb2, 0xa196, 0x8000, 0x00c0, 0x3eb2,
- 0x1078, 0x4025, 0x0078, 0x3eb2, 0x0c7e, 0x7110, 0xa18c, 0xff00,
- 0x810f, 0xa196, 0x0001, 0x0040, 0x3ed9, 0xa196, 0x0023, 0x00c0,
- 0x3f97, 0xa08e, 0x0023, 0x00c0, 0x3f0a, 0x1078, 0x4097, 0x0040,
- 0x3f97, 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x3ef2,
- 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009, 0x0015, 0x1078, 0x55fc,
- 0x0078, 0x3f97, 0xa08e, 0x0210, 0x00c0, 0x3efc, 0x2009, 0x0015,
- 0x1078, 0x55fc, 0x0078, 0x3f97, 0xa08e, 0x0100, 0x00c0, 0x3f97,
- 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009, 0x0016, 0x1078, 0x55fc,
- 0x0078, 0x3f97, 0xa08e, 0x0022, 0x00c0, 0x3f97, 0x7030, 0xa08e,
- 0x0300, 0x00c0, 0x3f1b, 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009,
- 0x0017, 0x0078, 0x3f7f, 0xa08e, 0x0500, 0x00c0, 0x3f27, 0x7034,
- 0xa005, 0x00c0, 0x3f97, 0x2009, 0x0018, 0x0078, 0x3f7f, 0xa08e,
- 0x2010, 0x00c0, 0x3f2f, 0x2009, 0x0019, 0x0078, 0x3f7f, 0xa08e,
- 0x2110, 0x00c0, 0x3f37, 0x2009, 0x001a, 0x0078, 0x3f7f, 0xa08e,
- 0x5200, 0x00c0, 0x3f43, 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009,
- 0x001b, 0x0078, 0x3f7f, 0xa08e, 0x5000, 0x00c0, 0x3f4f, 0x7034,
- 0xa005, 0x00c0, 0x3f97, 0x2009, 0x001c, 0x0078, 0x3f7f, 0xa08e,
- 0x1200, 0x00c0, 0x3f5b, 0x7034, 0xa005, 0x00c0, 0x3f97, 0x2009,
- 0x0024, 0x0078, 0x3f7f, 0xa08c, 0xff00, 0xa18e, 0x2400, 0x00c0,
- 0x3f65, 0x2009, 0x002d, 0x0078, 0x3f7f, 0xa08c, 0xff00, 0xa18e,
- 0x5300, 0x00c0, 0x3f6f, 0x2009, 0x002a, 0x0078, 0x3f7f, 0xa08e,
- 0x0f00, 0x00c0, 0x3f77, 0x2009, 0x0020, 0x0078, 0x3f7f, 0xa08e,
- 0x5300, 0x00c0, 0x3f7d, 0x0078, 0x3f7d, 0x2009, 0x001d, 0x017e,
- 0x2011, 0x7383, 0x2204, 0x1078, 0x1fe4, 0x1078, 0x3494, 0x00c0,
- 0x3f99, 0x0c7e, 0x1078, 0x556f, 0x0040, 0x3f9c, 0x017f, 0x611a,
- 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x55fc, 0x0c7f,
- 0x007c, 0x017f, 0x0078, 0x3f97, 0x0c7f, 0x0078, 0x3f99, 0xa084,
- 0x0007, 0x0079, 0x3fa4, 0x007c, 0x3fac, 0x3fac, 0x3fac, 0x3fac,
- 0x3fac, 0x3fad, 0x3fc6, 0x400e, 0x007c, 0x7110, 0xd1bc, 0x0040,
- 0x3fc5, 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, 0x3fc5, 0xac8a,
- 0x7500, 0x0048, 0x3fc5, 0x6854, 0xac02, 0x00c8, 0x3fc5, 0x7124,
- 0x610a, 0x2009, 0x0046, 0x1078, 0x55fc, 0x007c, 0x0c7e, 0x7110,
- 0xd1bc, 0x00c0, 0x400c, 0x2011, 0x7383, 0x2204, 0xa080, 0x2207,
- 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x34cb, 0x00c0, 0x400c,
- 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x3ff1,
- 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x400c, 0x611a, 0x601f,
- 0x0006, 0x7120, 0x610a, 0x2009, 0x0044, 0x1078, 0x55fc, 0x0078,
- 0x400c, 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x400c, 0x611a,
- 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x4004,
- 0x6007, 0x0005, 0x0078, 0x4006, 0x6007, 0x0001, 0x6003, 0x0001,
- 0x1078, 0x448b, 0x1078, 0x4893, 0x0c7f, 0x007c, 0x7110, 0xd1bc,
- 0x0040, 0x4024, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x4024,
- 0xac82, 0x7500, 0x0048, 0x4024, 0x6854, 0xac02, 0x00c8, 0x4024,
- 0x2009, 0x0045, 0x1078, 0x55fc, 0x007c, 0x7110, 0xa18c, 0xff00,
- 0x810f, 0xa18e, 0x0000, 0x00c0, 0x4035, 0xa084, 0x000f, 0xa08a,
- 0x0006, 0x10c8, 0x1288, 0x1079, 0x4036, 0x007c, 0x403c, 0x403d,
- 0x403c, 0x403c, 0x4079, 0x4088, 0x007c, 0x7110, 0xd1bc, 0x00c0,
- 0x4078, 0x700c, 0x1078, 0x1fe4, 0x1078, 0x3494, 0x00c0, 0x4078,
- 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x4061,
- 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x4078, 0x611a, 0x601f,
- 0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x55fc, 0x0078,
- 0x4078, 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x4078, 0x611a,
- 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x4074,
- 0x2009, 0x0005, 0x0078, 0x4076, 0x2009, 0x0001, 0x1078, 0x55fc,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4087, 0x1078, 0x4097, 0x0040,
- 0x4087, 0x7124, 0x610a, 0x2009, 0x0089, 0x1078, 0x55fc, 0x007c,
- 0x7110, 0xd1bc, 0x0040, 0x4096, 0x1078, 0x4097, 0x0040, 0x4096,
- 0x7124, 0x610a, 0x2009, 0x008a, 0x1078, 0x55fc, 0x007c, 0x7020,
- 0x2060, 0xac84, 0x0007, 0x00c0, 0x40aa, 0xac82, 0x7500, 0x0048,
- 0x40aa, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8, 0x40aa, 0xa085,
- 0x0001, 0x007c, 0xa006, 0x0078, 0x40a9, 0x2071, 0x70c9, 0x7003,
- 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7500,
- 0x7007, 0x0000, 0x7026, 0x702b, 0x4f9b, 0x7032, 0x7037, 0x4fdc,
- 0x703b, 0x0002, 0x703f, 0x0000, 0x007c, 0x2071, 0x70c9, 0x00e0,
- 0x4174, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0, 0x413d,
- 0x700f, 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000, 0x7138,
- 0x8109, 0x713a, 0x00c0, 0x413b, 0x703b, 0x0002, 0x2009, 0x0100,
- 0x2104, 0xa082, 0x0003, 0x00c8, 0x413b, 0x703c, 0xa086, 0x0001,
- 0x00c0, 0x4118, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x40f6, 0x6803, 0x1000, 0x0078, 0x40fd, 0x6804, 0xa084,
- 0x1000, 0x0040, 0x40fd, 0x6803, 0x0100, 0x6803, 0x0000, 0x703f,
- 0x0000, 0x2069, 0x70b6, 0x6804, 0xa082, 0x0006, 0x00c0, 0x410a,
- 0x6807, 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x4111, 0x6833,
- 0x0000, 0x1078, 0x4893, 0x1078, 0x4943, 0x0d7f, 0x0078, 0x413b,
- 0x0d7e, 0x2069, 0x6f00, 0x6944, 0x6860, 0xa102, 0x00c8, 0x413a,
- 0x2069, 0x70b6, 0x6804, 0xa086, 0x0000, 0x00c0, 0x413a, 0x6830,
- 0xa086, 0x0000, 0x00c0, 0x413a, 0x703f, 0x0001, 0x6807, 0x0006,
- 0x6833, 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069, 0x0140,
- 0x6803, 0x0600, 0x0d7f, 0x0078, 0x4140, 0x127e, 0x2091, 0x8000,
- 0x7024, 0xa00d, 0x0040, 0x4151, 0x7020, 0x8001, 0x7022, 0x00c0,
- 0x4151, 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, 0x4151, 0x7028,
- 0x107a, 0x7030, 0xa00d, 0x0040, 0x4162, 0x702c, 0x8001, 0x702e,
- 0x00c0, 0x4162, 0x702f, 0x0009, 0x8109, 0x7132, 0x00c0, 0x4162,
- 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040, 0x4173, 0x7008, 0x8001,
- 0x700a, 0x00c0, 0x4173, 0x700b, 0x0009, 0x8109, 0x711a, 0x00c0,
- 0x4173, 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, 0x4177, 0x419e,
- 0x419f, 0x41bb, 0x0e7e, 0x2071, 0x70c9, 0x7018, 0xa005, 0x00c0,
- 0x4185, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e,
- 0x007e, 0x2071, 0x70c9, 0x701c, 0xa206, 0x00c0, 0x4191, 0x701a,
- 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x6088,
- 0xa102, 0x0048, 0x419c, 0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110,
- 0x1078, 0x34cb, 0x00c0, 0x41b1, 0x6088, 0x8001, 0x0048, 0x41b1,
- 0x608a, 0x00c0, 0x41b1, 0x127e, 0x2091, 0x8000, 0x1078, 0x4893,
- 0x127f, 0x8108, 0xa182, 0x007e, 0x0048, 0x41b9, 0xa00e, 0x7007,
- 0x0002, 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, 0x2091, 0x8000,
- 0x6014, 0xa005, 0x0040, 0x41ea, 0x8001, 0x6016, 0x00c0, 0x41ea,
- 0x611c, 0xa186, 0x0003, 0x0040, 0x41d1, 0xa186, 0x0006, 0x00c0,
- 0x41e8, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x41e8,
- 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x41e1, 0x2001,
- 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x41ea,
- 0x1078, 0x60aa, 0x127f, 0xac88, 0x0008, 0x7116, 0x2001, 0x6f16,
- 0x2004, 0xa102, 0x0048, 0x41f8, 0x7017, 0x7500, 0x7007, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x7027, 0x07d0, 0x7023, 0x0009,
- 0x703b, 0x0002, 0x0e7f, 0x007c, 0x2001, 0x70d2, 0x2003, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x7033, 0x07d0, 0x702f, 0x0009,
- 0x0e7f, 0x007c, 0x2011, 0x70d5, 0x2013, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x70c9, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c,
- 0x0c7e, 0x2061, 0x715a, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003,
- 0x8003, 0x8003, 0xa080, 0x715a, 0x2060, 0x007c, 0x6854, 0xa08a,
- 0x199a, 0x0048, 0x4235, 0x2001, 0x1999, 0xa005, 0x00c0, 0x4245,
- 0x6944, 0x0c7e, 0x1078, 0x4225, 0x6014, 0x0c7f, 0xa005, 0x00c0,
- 0x424a, 0x2001, 0x001e, 0x0078, 0x424a, 0xa08e, 0xffff, 0x00c0,
- 0x424a, 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c,
- 0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x4285, 0xd0b4, 0x00c0,
- 0x4261, 0xd0bc, 0x00c0, 0x4273, 0x2009, 0x0006, 0x1078, 0x42a8,
- 0x007c, 0xd0fc, 0x0040, 0x426e, 0xa084, 0x0003, 0xa08e, 0x0003,
- 0x0040, 0x42a1, 0xa08e, 0x0000, 0x00c0, 0x42a1, 0x2009, 0x0043,
- 0x1078, 0x55fc, 0x007c, 0xd0fc, 0x0040, 0x4280, 0xa084, 0x0003,
- 0xa08e, 0x0003, 0x0040, 0x42a1, 0xa08e, 0x0000, 0x00c0, 0x42a1,
- 0x2009, 0x0042, 0x1078, 0x55fc, 0x007c, 0xd0fc, 0x0040, 0x4297,
- 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x42a1, 0xa08e, 0x0002,
- 0x0040, 0x429b, 0x2009, 0x0041, 0x1078, 0x55fc, 0x007c, 0x1078,
- 0x42a6, 0x0078, 0x4296, 0x2009, 0x0043, 0x1078, 0x55fc, 0x0078,
- 0x4296, 0x2009, 0x0004, 0x1078, 0x42a8, 0x007c, 0x2009, 0x0001,
- 0x6010, 0xa0ec, 0xf000, 0x0040, 0x42cc, 0x2068, 0x6952, 0x6800,
- 0x6012, 0xa186, 0x0001, 0x00c0, 0x42c6, 0x694c, 0xa18c, 0x8100,
- 0xa18e, 0x8100, 0x00c0, 0x42c6, 0x0c7e, 0x6944, 0x1078, 0x4225,
- 0x6204, 0x8210, 0x0048, 0x42c5, 0x6206, 0x0c7f, 0x1078, 0x3720,
- 0x6010, 0xa06d, 0x10c0, 0x422e, 0x007c, 0x157e, 0x0c7e, 0x20a9,
- 0x0010, 0x2061, 0x715a, 0x6000, 0x81ff, 0x0040, 0x42da, 0xa205,
- 0x0078, 0x42db, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x42d3,
- 0x0c7f, 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x42eb, 0x8001,
- 0x680a, 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079,
- 0x70b6, 0x127f, 0x0d7e, 0x2069, 0x70b6, 0x6803, 0x0005, 0x2069,
- 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e,
- 0x6027, 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x4307, 0x4311,
- 0x4336, 0x4391, 0x4317, 0x4336, 0x430f, 0x430f, 0x430f, 0x1078,
- 0x1288, 0x1078, 0x4204, 0x1078, 0x4893, 0x0c7f, 0x007c, 0x62c0,
- 0x82ff, 0x00c0, 0x431d, 0x0c7f, 0x007c, 0x2011, 0x31f0, 0x1078,
- 0x4187, 0x7828, 0xa092, 0x0002, 0x00c8, 0x432c, 0x8000, 0x782a,
- 0x1078, 0x3220, 0x0078, 0x431b, 0x1078, 0x31f0, 0x7807, 0x0003,
- 0x7827, 0x0000, 0x782b, 0x0000, 0x0078, 0x431b, 0x1078, 0x4204,
- 0x3c00, 0x007e, 0x2011, 0x0209, 0x20e1, 0x4000, 0x2214, 0x007f,
- 0x20e0, 0x82ff, 0x0040, 0x4354, 0x62c0, 0x82ff, 0x00c0, 0x4354,
- 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1288, 0x2009, 0x0013,
- 0x1078, 0x55fc, 0x0c7f, 0x007c, 0x3900, 0xa082, 0x71fa, 0x00c8,
- 0x435b, 0x1078, 0x54ff, 0x0c7e, 0x7824, 0xa065, 0x1040, 0x1288,
- 0x7804, 0xa086, 0x0004, 0x0040, 0x43d6, 0x7828, 0xa092, 0x2710,
- 0x00c8, 0x4371, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x4f80, 0x0078,
- 0x4352, 0x6104, 0xa186, 0x0003, 0x00c0, 0x4388, 0x0e7e, 0x2071,
- 0x6f00, 0x70b4, 0x0e7f, 0xd08c, 0x0040, 0x4388, 0x0c7e, 0x0e7e,
- 0x2061, 0x0100, 0x2071, 0x6f00, 0x1078, 0x3229, 0x0e7f, 0x0c7f,
- 0x1078, 0x6e4a, 0x2009, 0x0014, 0x1078, 0x55fc, 0x0c7f, 0x0078,
- 0x4352, 0x2001, 0x70d2, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0,
- 0x43a5, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1288, 0x2009,
- 0x0013, 0x1078, 0x5649, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900,
- 0xa082, 0x71fa, 0x00c8, 0x43ae, 0x1078, 0x54ff, 0x7824, 0xa005,
- 0x1040, 0x1288, 0x781c, 0xa06d, 0x1040, 0x1288, 0x6800, 0xc0dc,
- 0x6802, 0x7924, 0x2160, 0x1078, 0x55d5, 0x693c, 0x81ff, 0x1040,
- 0x1288, 0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x43ca, 0x7a1e,
- 0x0078, 0x43cc, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000,
- 0x0d7f, 0x0c7f, 0x1078, 0x4893, 0x0078, 0x43a3, 0x6104, 0xa186,
- 0x0002, 0x0040, 0x43e1, 0xa186, 0x0004, 0x0040, 0x43e1, 0x0078,
- 0x4365, 0x7808, 0xac06, 0x0040, 0x4365, 0x1078, 0x479a, 0x1078,
- 0x448b, 0x0c7f, 0x1078, 0x4893, 0x0078, 0x4352, 0x0c7e, 0x6027,
- 0x0002, 0x2011, 0x70d5, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0,
- 0x4408, 0x62c4, 0x82ff, 0x00c0, 0x4408, 0x793c, 0xa1e5, 0x0000,
- 0x0040, 0x4406, 0x2009, 0x0049, 0x1078, 0x55fc, 0x0c7f, 0x007c,
- 0x3908, 0xa192, 0x71fa, 0x00c8, 0x440f, 0x1078, 0x54ff, 0x6017,
- 0x0010, 0x793c, 0x81ff, 0x0040, 0x4406, 0x7944, 0xa192, 0x7530,
- 0x00c8, 0x442e, 0x8108, 0x7946, 0x1078, 0x4209, 0x793c, 0xa188,
- 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x442a, 0x6017, 0x0012,
- 0x0078, 0x4406, 0x6017, 0x0016, 0x0078, 0x4406, 0x037e, 0x2019,
- 0x0001, 0x1078, 0x513b, 0x037f, 0x1078, 0x6e4a, 0x793c, 0x2160,
- 0x2009, 0x004a, 0x1078, 0x55fc, 0x0078, 0x4406, 0x007e, 0x017e,
+ 0x0040, 0x3c0c, 0x027e, 0x2009, 0x0000, 0x2011, 0xfcff, 0x1078,
+ 0x41f4, 0x027f, 0x0078, 0x3c42, 0x6858, 0xa005, 0x0040, 0x3c56,
+ 0x685c, 0xa065, 0x0040, 0x3c52, 0x2001, 0x6d2c, 0x2004, 0xa005,
+ 0x0040, 0x3c1e, 0x1078, 0x6283, 0x0078, 0x3c24, 0x6013, 0x0400,
+ 0x2009, 0x0041, 0x1078, 0x5591, 0x6958, 0xa18c, 0xe600, 0xa186,
+ 0x2000, 0x0040, 0x3c3a, 0xa186, 0x0400, 0x0040, 0x3c3a, 0x6944,
+ 0x0c7e, 0x1078, 0x416d, 0x6000, 0xa084, 0xfdff, 0x6002, 0x0c7f,
+ 0x0078, 0x3c42, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078,
+ 0x41f4, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3c4e, 0x6944, 0x1078,
+ 0x416d, 0x6008, 0x8000, 0x0048, 0x3c4e, 0x600a, 0x0c7f, 0x127f,
+ 0x0078, 0x3d41, 0x0c7f, 0x127f, 0x0078, 0x3d39, 0x6954, 0xa186,
+ 0x0020, 0x0040, 0x3c6c, 0xa186, 0x0029, 0x00c0, 0x3c52, 0x6944,
+ 0xa18c, 0xff00, 0x810f, 0x1078, 0x3447, 0x00c0, 0x3c42, 0x6000,
+ 0xc0e4, 0x6002, 0x0078, 0x3c42, 0x685c, 0xa065, 0x0040, 0x3c52,
+ 0x6017, 0x0014, 0x0078, 0x3c42, 0x6944, 0x1078, 0x3d6e, 0x6000,
+ 0xa084, 0x0001, 0x0040, 0x3c8d, 0x2091, 0x8000, 0x6204, 0x8210,
+ 0x0048, 0x3c87, 0x6206, 0x2091, 0x8001, 0x0078, 0x3d4f, 0x2091,
+ 0x8001, 0x6853, 0x0016, 0x0078, 0x3d48, 0x6853, 0x0007, 0x0078,
+ 0x3d48, 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x3c9b, 0x1078,
+ 0x3a0f, 0x0078, 0x3cad, 0x2030, 0x8001, 0x00c0, 0x3ca5, 0x7007,
+ 0x0001, 0x1078, 0x3cae, 0x0078, 0x3cad, 0x7007, 0x0006, 0x7012,
+ 0x2d00, 0x7016, 0x701a, 0x704b, 0x3cae, 0x007c, 0x0e7e, 0x2009,
+ 0x6d2c, 0x210c, 0x81ff, 0x00c0, 0x3d28, 0x6848, 0x2070, 0xae82,
+ 0x7400, 0x0048, 0x3d18, 0x2001, 0x6d15, 0x2004, 0xae02, 0x00c8,
+ 0x3d18, 0x6944, 0x1078, 0x3d6e, 0x6100, 0xa184, 0x0001, 0x0040,
+ 0x3cfe, 0xa184, 0x0100, 0x00c0, 0x3d1c, 0xa184, 0x0200, 0x00c0,
+ 0x3d20, 0x601c, 0xa005, 0x00c0, 0x3d24, 0x711c, 0xa186, 0x0006,
+ 0x00c0, 0x3d03, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08, 0x127e,
+ 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, 0x3cf5, 0x7112, 0x7018,
+ 0xa065, 0x0040, 0x3d28, 0x6000, 0xd0e4, 0x00c0, 0x3d2c, 0x2e60,
+ 0x1078, 0x4176, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005,
+ 0x00c0, 0x3cf5, 0x6902, 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853,
+ 0x0006, 0x0078, 0x3d48, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078,
+ 0x3447, 0x00c0, 0x3d2c, 0x6000, 0xd0e4, 0x00c0, 0x3d2c, 0x711c,
+ 0xa186, 0x0007, 0x00c0, 0x3d18, 0x6853, 0x0002, 0x0078, 0x3d2e,
+ 0x6853, 0x0008, 0x0078, 0x3d2e, 0x6853, 0x000e, 0x0078, 0x3d2e,
+ 0x6853, 0x0017, 0x0078, 0x3d2e, 0x6853, 0x0035, 0x0078, 0x3d2e,
+ 0x6853, 0x0028, 0x0078, 0x3d2e, 0x6853, 0x0029, 0x0e7f, 0x0078,
+ 0x3d48, 0x2009, 0x003e, 0x0078, 0x3d43, 0x2009, 0x0004, 0x0078,
+ 0x3d43, 0x2009, 0x0006, 0x0078, 0x3d43, 0x2009, 0x0016, 0x0078,
+ 0x3d43, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856,
+ 0x2091, 0x8000, 0x1078, 0x36a1, 0x2091, 0x8001, 0x007c, 0x1078,
+ 0x1328, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x3d5f,
+ 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x3d6b, 0x7070,
+ 0xa080, 0x0040, 0x7072, 0x00c8, 0x3d6b, 0x7074, 0xa081, 0x0000,
+ 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078,
+ 0x416d, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085,
+ 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1,
+ 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x3d8a, 0xa086, 0x1000,
+ 0x00c0, 0x3dab, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x3d91,
+ 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3dab, 0xac82, 0x7400, 0x0048,
+ 0x3dab, 0x6854, 0xac02, 0x00c8, 0x3dab, 0x2009, 0x0047, 0x1078,
+ 0x5591, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x7a28, 0x7a1c, 0xd284,
+ 0x00c0, 0x3d7c, 0x007c, 0xa016, 0x1078, 0x1532, 0x0078, 0x3da1,
+ 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584,
+ 0x0070, 0x00c0, 0x3dd9, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0,
+ 0x3dd9, 0x1078, 0x3de6, 0x0040, 0x3dd9, 0x20e1, 0x3000, 0x7828,
+ 0x7828, 0x1078, 0x3e04, 0x147f, 0x137f, 0x157f, 0x2009, 0x6f18,
+ 0x2104, 0xa005, 0x00c0, 0x3dd5, 0x007c, 0x1078, 0x476a, 0x0078,
+ 0x3dd4, 0x1078, 0x6c23, 0x1078, 0x3de6, 0x20e1, 0x3000, 0x7828,
+ 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x3dd4, 0xa484, 0x01ff,
+ 0x687a, 0xa005, 0x0040, 0x3df8, 0xa080, 0x001f, 0xa084, 0x03f8,
+ 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c,
+ 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
+ 0xa085, 0x0001, 0x0078, 0x3df7, 0x7000, 0xa084, 0xff00, 0xa08c,
+ 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x3e11, 0x0078, 0x3f51,
+ 0x007c, 0xa196, 0x2000, 0x00c0, 0x3e22, 0x6900, 0xa18e, 0x0001,
+ 0x00c0, 0x3e1e, 0x1078, 0x2aec, 0x0078, 0x3e10, 0x1078, 0x3e2a,
+ 0x0078, 0x3e10, 0xa196, 0x8000, 0x00c0, 0x3e10, 0x1078, 0x3fd7,
+ 0x0078, 0x3e10, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196,
+ 0x0001, 0x0040, 0x3e37, 0xa196, 0x0023, 0x00c0, 0x3ef8, 0xa08e,
+ 0x0023, 0x00c0, 0x3e68, 0x1078, 0x404e, 0x0040, 0x3ef8, 0x7124,
+ 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x3e50, 0x7034, 0xa005,
+ 0x00c0, 0x3ef8, 0x2009, 0x0015, 0x1078, 0x5591, 0x0078, 0x3ef8,
+ 0xa08e, 0x0210, 0x00c0, 0x3e5a, 0x2009, 0x0015, 0x1078, 0x5591,
+ 0x0078, 0x3ef8, 0xa08e, 0x0100, 0x00c0, 0x3ef8, 0x7034, 0xa005,
+ 0x00c0, 0x3ef8, 0x2009, 0x0016, 0x1078, 0x5591, 0x0078, 0x3ef8,
+ 0xa08e, 0x0022, 0x00c0, 0x3ef8, 0x7030, 0xa08e, 0x0300, 0x00c0,
+ 0x3e79, 0x7034, 0xa005, 0x00c0, 0x3ef8, 0x2009, 0x0017, 0x0078,
+ 0x3eda, 0xa08e, 0x0500, 0x00c0, 0x3e85, 0x7034, 0xa005, 0x00c0,
+ 0x3ef8, 0x2009, 0x0018, 0x0078, 0x3eda, 0xa08e, 0x2010, 0x00c0,
+ 0x3e8d, 0x2009, 0x0019, 0x0078, 0x3eda, 0xa08e, 0x2110, 0x00c0,
+ 0x3e95, 0x2009, 0x001a, 0x0078, 0x3eda, 0xa08e, 0x5200, 0x00c0,
+ 0x3ea1, 0x7034, 0xa005, 0x00c0, 0x3ef8, 0x2009, 0x001b, 0x0078,
+ 0x3eda, 0xa08e, 0x5000, 0x00c0, 0x3ead, 0x7034, 0xa005, 0x00c0,
+ 0x3ef8, 0x2009, 0x001c, 0x0078, 0x3eda, 0xa08e, 0x2400, 0x00c0,
+ 0x3eb3, 0x0078, 0x3ed8, 0xa08e, 0x5300, 0x00c0, 0x3eb9, 0x0078,
+ 0x3ed8, 0xa08e, 0x0f00, 0x00c0, 0x3ec1, 0x2009, 0x0020, 0x0078,
+ 0x3eda, 0xa08e, 0x5300, 0x00c0, 0x3ec7, 0x0078, 0x3ed8, 0xa08e,
+ 0x6104, 0x00c0, 0x3ed8, 0x2009, 0x728e, 0x2011, 0x8015, 0x211c,
+ 0x8108, 0x2124, 0x1078, 0x2a53, 0x2009, 0x0023, 0x0078, 0x3eda,
+ 0x2009, 0x001d, 0x017e, 0x2011, 0x7283, 0x2204, 0x8211, 0x220c,
+ 0x1078, 0x1e1b, 0x00c0, 0x3efa, 0x1078, 0x3410, 0x00c0, 0x3efa,
+ 0x6612, 0x6516, 0x0c7e, 0x1078, 0x5504, 0x0040, 0x3efd, 0x017f,
+ 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x5591,
+ 0x0c7f, 0x007c, 0x017f, 0x0078, 0x3ef8, 0x0c7f, 0x0078, 0x3efa,
+ 0x0e7e, 0x0d7e, 0x2028, 0x2130, 0xa696, 0x00ff, 0x00c0, 0x3f20,
+ 0xa596, 0xfffd, 0x00c0, 0x3f10, 0x2009, 0x007f, 0x0078, 0x3f4d,
+ 0xa596, 0xfffe, 0x00c0, 0x3f18, 0x2009, 0x007e, 0x0078, 0x3f4d,
+ 0xa596, 0xfffc, 0x00c0, 0x3f20, 0x2009, 0x0080, 0x0078, 0x3f4d,
+ 0x2011, 0x0000, 0x2021, 0x007e, 0x20a9, 0x0082, 0x2071, 0x6e7e,
+ 0x2e1c, 0x83ff, 0x00c0, 0x3f32, 0x82ff, 0x00c0, 0x3f41, 0x2410,
+ 0x0078, 0x3f41, 0x2368, 0x6b10, 0x007e, 0x2100, 0xa31e, 0x007f,
+ 0x00c0, 0x3f41, 0x6b14, 0xa31e, 0x00c0, 0x3f41, 0x2408, 0x0078,
+ 0x3f4d, 0x8420, 0x8e70, 0x00f0, 0x3f28, 0x82ff, 0x00c0, 0x3f4c,
+ 0xa085, 0x0001, 0x0078, 0x3f4e, 0x2208, 0xa006, 0x0d7f, 0x0e7f,
+ 0x007c, 0xa084, 0x0007, 0x0079, 0x3f56, 0x007c, 0x3f5e, 0x3f5e,
+ 0x3f5e, 0x3f5e, 0x3f5e, 0x3f5f, 0x3f78, 0x3fc0, 0x007c, 0x7110,
+ 0xd1bc, 0x0040, 0x3f77, 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0,
+ 0x3f77, 0xac8a, 0x7400, 0x0048, 0x3f77, 0x6854, 0xac02, 0x00c8,
+ 0x3f77, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078, 0x5591, 0x007c,
+ 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x3fbe, 0x2011, 0x7283, 0x2204,
+ 0x8211, 0x220c, 0x1078, 0x1e1b, 0x00c0, 0x3fbe, 0x1078, 0x3447,
+ 0x00c0, 0x3fbe, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006,
+ 0x00c0, 0x3fa3, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, 0x3fbe,
+ 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009, 0x0044, 0x1078,
+ 0x5591, 0x0078, 0x3fbe, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040,
+ 0x3fbe, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004,
+ 0x00c0, 0x3fb6, 0x6007, 0x0005, 0x0078, 0x3fb8, 0x6007, 0x0001,
+ 0x6003, 0x0001, 0x1078, 0x4376, 0x1078, 0x476a, 0x0c7f, 0x007c,
+ 0x7110, 0xd1bc, 0x0040, 0x3fd6, 0x7020, 0x2060, 0xac84, 0x0007,
+ 0x00c0, 0x3fd6, 0xac82, 0x7400, 0x0048, 0x3fd6, 0x6854, 0xac02,
+ 0x00c8, 0x3fd6, 0x2009, 0x0045, 0x1078, 0x5591, 0x007c, 0x7110,
+ 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0, 0x3fe7, 0xa084,
+ 0x000f, 0xa08a, 0x0006, 0x10c8, 0x12b7, 0x1079, 0x3fe8, 0x007c,
+ 0x3fee, 0x3fef, 0x3fee, 0x3fee, 0x4030, 0x403f, 0x007c, 0x7110,
+ 0xd1bc, 0x00c0, 0x402f, 0x700c, 0x7108, 0x1078, 0x1e1b, 0x00c0,
+ 0x402f, 0x1078, 0x3410, 0x00c0, 0x402f, 0x6612, 0x6516, 0x6204,
+ 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x4018, 0x0c7e,
+ 0x1078, 0x5504, 0x017f, 0x0040, 0x402f, 0x611a, 0x601f, 0x0005,
+ 0x7120, 0x610a, 0x2009, 0x0028, 0x1078, 0x5591, 0x0078, 0x402f,
+ 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040, 0x402f, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x402b, 0x2009,
+ 0x0005, 0x0078, 0x402d, 0x2009, 0x0001, 0x1078, 0x5591, 0x007c,
+ 0x7110, 0xd1bc, 0x0040, 0x403e, 0x1078, 0x404e, 0x0040, 0x403e,
+ 0x7124, 0x610a, 0x2009, 0x0029, 0x1078, 0x5591, 0x007c, 0x7110,
+ 0xd1bc, 0x0040, 0x404d, 0x1078, 0x404e, 0x0040, 0x404d, 0x7124,
+ 0x610a, 0x2009, 0x002a, 0x1078, 0x5591, 0x007c, 0x7020, 0x2060,
+ 0xac84, 0x0007, 0x00c0, 0x4061, 0xac82, 0x7400, 0x0048, 0x4061,
+ 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8, 0x4061, 0xa085, 0x0001,
+ 0x007c, 0xa006, 0x0078, 0x4060, 0x2071, 0x6f23, 0x7003, 0x0003,
+ 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7400, 0x7007,
+ 0x0000, 0x7026, 0x702b, 0x4ff2, 0x7032, 0x7037, 0x503e, 0x007c,
+ 0x2071, 0x6f23, 0x00e0, 0x40be, 0x2091, 0x6000, 0x700c, 0x8001,
+ 0x700e, 0x00c0, 0x4087, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e,
+ 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x409b, 0x7020, 0x8001,
+ 0x7022, 0x00c0, 0x409b, 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0,
+ 0x409b, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040, 0x40ac, 0x702c,
+ 0x8001, 0x702e, 0x00c0, 0x40ac, 0x702f, 0x0009, 0x8109, 0x7132,
+ 0x00c0, 0x40ac, 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040, 0x40bd,
+ 0x7008, 0x8001, 0x700a, 0x00c0, 0x40bd, 0x700b, 0x0009, 0x8109,
+ 0x711a, 0x00c0, 0x40bd, 0x701c, 0x107a, 0x127f, 0x7004, 0x0079,
+ 0x40c1, 0x40e8, 0x40e9, 0x4105, 0x0e7e, 0x2071, 0x6f23, 0x7018,
+ 0xa005, 0x00c0, 0x40cf, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f,
+ 0x007c, 0x0e7e, 0x007e, 0x2071, 0x6f23, 0x701c, 0xa206, 0x00c0,
+ 0x40db, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
+ 0x6f23, 0x6088, 0xa102, 0x0048, 0x40e6, 0x618a, 0x0e7f, 0x007c,
+ 0x007c, 0x7110, 0x1078, 0x3447, 0x00c0, 0x40fb, 0x6088, 0x8001,
+ 0x0048, 0x40fb, 0x608a, 0x00c0, 0x40fb, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x476a, 0x127f, 0x8108, 0xa182, 0x00ff, 0x0048, 0x4103,
+ 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014, 0x2060, 0x127e,
+ 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x4134, 0x8001, 0x6016,
+ 0x00c0, 0x4134, 0x611c, 0xa186, 0x0003, 0x0040, 0x411b, 0xa186,
+ 0x0006, 0x00c0, 0x4132, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a,
+ 0x0048, 0x4132, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048,
+ 0x412b, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116,
+ 0x0078, 0x4134, 0x1078, 0x5fea, 0x127f, 0xac88, 0x0008, 0x7116,
+ 0x2001, 0x6d16, 0x2004, 0xa102, 0x0048, 0x4142, 0x7017, 0x7400,
+ 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6f23, 0x7027, 0x07d0,
+ 0x7023, 0x0009, 0x0e7f, 0x007c, 0x2001, 0x6f2c, 0x2003, 0x0000,
+ 0x007c, 0x0e7e, 0x2071, 0x6f23, 0x7033, 0x07d0, 0x702f, 0x0009,
+ 0x0e7f, 0x007c, 0x2011, 0x6f2f, 0x2013, 0x0000, 0x007c, 0x0e7e,
+ 0x2071, 0x6f23, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c,
+ 0x0c7e, 0x2061, 0x6fb2, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003,
+ 0x8003, 0x8003, 0xa080, 0x6fb2, 0x2060, 0x007c, 0x684c, 0xa08c,
+ 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x41ac, 0xd0b4, 0x00c0, 0x4188,
+ 0xd0bc, 0x00c0, 0x419a, 0x2009, 0x0006, 0x1078, 0x41cf, 0x007c,
+ 0xd0fc, 0x0040, 0x4195, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040,
+ 0x41c8, 0xa08e, 0x0000, 0x00c0, 0x41c8, 0x2009, 0x0043, 0x1078,
+ 0x5591, 0x007c, 0xd0fc, 0x0040, 0x41a7, 0xa084, 0x0003, 0xa08e,
+ 0x0003, 0x0040, 0x41c8, 0xa08e, 0x0000, 0x00c0, 0x41c8, 0x2009,
+ 0x0042, 0x1078, 0x5591, 0x007c, 0xd0fc, 0x0040, 0x41be, 0xa084,
+ 0x0003, 0xa08e, 0x0003, 0x0040, 0x41c8, 0xa08e, 0x0002, 0x0040,
+ 0x41c2, 0x2009, 0x0041, 0x1078, 0x5591, 0x007c, 0x1078, 0x41cd,
+ 0x0078, 0x41bd, 0x2009, 0x0043, 0x1078, 0x5591, 0x0078, 0x41bd,
+ 0x2009, 0x0004, 0x1078, 0x41cf, 0x007c, 0x2009, 0x0001, 0x6010,
+ 0xa0ec, 0xf000, 0x0040, 0x41f3, 0x2068, 0x6952, 0x6800, 0x6012,
+ 0xa186, 0x0001, 0x00c0, 0x41ed, 0x694c, 0xa18c, 0x8100, 0xa18e,
+ 0x8100, 0x00c0, 0x41ed, 0x0c7e, 0x6944, 0x1078, 0x416d, 0x6204,
+ 0x8210, 0x0048, 0x41ec, 0x6206, 0x0c7f, 0x1078, 0x36a1, 0x6010,
+ 0xa06d, 0x10c0, 0x4176, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010,
+ 0x2061, 0x6fb2, 0x6000, 0x81ff, 0x0040, 0x4201, 0xa205, 0x0078,
+ 0x4202, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x41fa, 0x0c7f,
+ 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x4212, 0x8001, 0x680a,
+ 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x6f10,
+ 0x127f, 0x0d7e, 0x2069, 0x6f10, 0x6803, 0x0005, 0x2069, 0x0004,
+ 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027,
+ 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x422e, 0x4238, 0x425d,
+ 0x428e, 0x423e, 0x425d, 0x4236, 0x4236, 0x4236, 0x1078, 0x12b7,
+ 0x1078, 0x414c, 0x1078, 0x476a, 0x0c7f, 0x007c, 0x62c0, 0x82ff,
+ 0x00c0, 0x4244, 0x0c7f, 0x007c, 0x2011, 0x318e, 0x1078, 0x40d1,
+ 0x7828, 0xa092, 0x0002, 0x00c8, 0x4253, 0x8000, 0x782a, 0x1078,
+ 0x31c2, 0x0078, 0x4242, 0x1078, 0x318e, 0x7807, 0x0003, 0x7827,
+ 0x0000, 0x782b, 0x0000, 0x0078, 0x4242, 0x1078, 0x414c, 0x62c0,
+ 0x82ff, 0x00c0, 0x426f, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040,
+ 0x12b7, 0x2009, 0x0013, 0x1078, 0x5591, 0x0c7f, 0x007c, 0x0c7e,
+ 0x7824, 0xa065, 0x1040, 0x12b7, 0x7804, 0xa086, 0x0004, 0x0040,
+ 0x42cc, 0x7828, 0xa092, 0x2710, 0x00c8, 0x4285, 0x8000, 0x782a,
+ 0x0c7f, 0x1078, 0x4fd7, 0x0078, 0x426d, 0x1078, 0x6c76, 0x2009,
+ 0x0014, 0x1078, 0x5591, 0x0c7f, 0x0078, 0x426d, 0x2001, 0x6f2c,
+ 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x42a2, 0x782b, 0x0000,
+ 0x7824, 0xa065, 0x1040, 0x12b7, 0x2009, 0x0013, 0x1078, 0x55df,
+ 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x7824, 0xa005, 0x1040, 0x12b7,
+ 0x781c, 0xa06d, 0x1040, 0x12b7, 0x6800, 0xc0dc, 0x6802, 0x7924,
+ 0x2160, 0x1078, 0x556a, 0x693c, 0x81ff, 0x1040, 0x12b7, 0x8109,
+ 0x693e, 0x6854, 0xa015, 0x0040, 0x42c0, 0x7a1e, 0x0078, 0x42c2,
+ 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f,
+ 0x1078, 0x476a, 0x0078, 0x42a0, 0x6104, 0xa186, 0x0002, 0x0040,
+ 0x42d7, 0xa186, 0x0004, 0x0040, 0x42d7, 0x0078, 0x4279, 0x7808,
+ 0xac06, 0x0040, 0x4279, 0x1078, 0x4671, 0x1078, 0x4376, 0x0c7f,
+ 0x1078, 0x476a, 0x0078, 0x426d, 0x0c7e, 0x6027, 0x0002, 0x2011,
+ 0x6f2f, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x42fe, 0x62c4,
+ 0x82ff, 0x00c0, 0x42fe, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x42fc,
+ 0x2009, 0x0049, 0x1078, 0x5591, 0x0c7f, 0x007c, 0x6017, 0x0010,
+ 0x793c, 0x81ff, 0x0040, 0x42fc, 0x7944, 0xa192, 0x2710, 0x00c8,
+ 0x431d, 0x8108, 0x7946, 0x1078, 0x4151, 0x793c, 0xa188, 0x0007,
+ 0x210c, 0xa18e, 0x0006, 0x00c0, 0x4319, 0x6017, 0x0012, 0x0078,
+ 0x42fc, 0x6017, 0x0016, 0x0078, 0x42fc, 0x1078, 0x6c76, 0x793c,
+ 0x2160, 0x2009, 0x004a, 0x1078, 0x5591, 0x0078, 0x42fc, 0x007e,
+ 0x017e, 0x0c7e, 0x127e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x6f10,
+ 0x2091, 0x8000, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040,
+ 0x4342, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f,
+ 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x433d, 0x0d7e, 0x2069,
+ 0x6f10, 0x6000, 0xd0d4, 0x0040, 0x435d, 0x6820, 0x8000, 0x6822,
+ 0xa086, 0x0001, 0x00c0, 0x4356, 0x2c00, 0x681e, 0x6804, 0xa084,
+ 0x0007, 0x0079, 0x4772, 0x0d7f, 0x007c, 0xc0d5, 0x6002, 0x6818,
+ 0xa005, 0x0040, 0x436f, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00,
+ 0x681a, 0x0d7f, 0x685a, 0x2069, 0x6f10, 0x0078, 0x434d, 0x6056,
+ 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x434d, 0x007e, 0x017e,
0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061,
- 0x70b6, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040, 0x4459,
- 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f, 0x007f,
- 0x007c, 0x6116, 0x6112, 0x0078, 0x4454, 0x0d7e, 0x2069, 0x70b6,
- 0x6000, 0xd0d4, 0x0040, 0x4472, 0x6820, 0x8000, 0x6822, 0xa086,
- 0x0001, 0x00c0, 0x446d, 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007,
- 0x0079, 0x489b, 0xc0d5, 0x6002, 0x6818, 0xa005, 0x0040, 0x4484,
- 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a, 0x0d7f, 0x685a,
- 0x2069, 0x70b6, 0x0078, 0x4464, 0x6056, 0x605a, 0x2c00, 0x681a,
- 0x681e, 0x0078, 0x4464, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x70b6, 0x6020, 0x8000,
- 0x6022, 0x6008, 0xa005, 0x0040, 0x44a6, 0xa080, 0x0003, 0x2102,
- 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x610e, 0x610a,
- 0x0078, 0x44a1, 0x0c7e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x70b6,
- 0x6034, 0xa005, 0x0040, 0x44ba, 0xa080, 0x0003, 0x2102, 0x6136,
- 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x44b8, 0x0f7e, 0x0e7e,
- 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2071, 0x70b6,
- 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x4520,
- 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x451b, 0x703c,
- 0xac06, 0x00c0, 0x44e0, 0x6003, 0x000a, 0x630a, 0x0078, 0x451b,
- 0x7038, 0xac36, 0x00c0, 0x44e6, 0x660c, 0x763a, 0x7034, 0xac36,
- 0x00c0, 0x44f4, 0x2c00, 0xaf36, 0x0040, 0x44f2, 0x2f00, 0x7036,
- 0x0078, 0x44f4, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
- 0x0040, 0x44fd, 0x7e0e, 0x0078, 0x44fe, 0x2678, 0x600f, 0x0000,
- 0x1078, 0x6216, 0x0040, 0x4516, 0x6010, 0x2068, 0x601c, 0xa086,
- 0x0003, 0x00c0, 0x4529, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x63d5, 0x1078, 0x3720, 0x1078, 0x632a, 0x1078, 0x6337,
- 0x0c7f, 0x0078, 0x44cd, 0x2c78, 0x600c, 0x2060, 0x0078, 0x44cd,
- 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x450b, 0x1078, 0x6d80,
- 0x0078, 0x4516, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031,
- 0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0x70b6, 0x7838, 0xa065,
- 0x0040, 0x4569, 0x600c, 0x007e, 0x600f, 0x0000, 0x783c, 0xac06,
- 0x00c0, 0x4550, 0x6003, 0x000a, 0x630a, 0x2c30, 0x0078, 0x4566,
- 0x1078, 0x6216, 0x0040, 0x4564, 0x6010, 0x2068, 0x601c, 0xa086,
- 0x0003, 0x00c0, 0x4572, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x3720, 0x1078, 0x632a, 0x1078, 0x6337, 0x007f, 0x0078,
- 0x453f, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f,
- 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x455b, 0x1078,
- 0x6d80, 0x0078, 0x4564, 0x027e, 0x1078, 0x458f, 0x1078, 0x4628,
- 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x70b6, 0x2091, 0x8000,
- 0x1078, 0x46bf, 0x1078, 0x4727, 0x127f, 0x0f7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040, 0x4617,
- 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x4612, 0x7024,
- 0xac06, 0x00c0, 0x45d5, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
- 0x45d0, 0x1078, 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x5405, 0x7027,
+ 0x6f10, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x4391,
+ 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f,
+ 0x007c, 0x610e, 0x610a, 0x0078, 0x438c, 0x0c7e, 0x600f, 0x0000,
+ 0x2c08, 0x2061, 0x6f10, 0x6034, 0xa005, 0x0040, 0x43a5, 0xa080,
+ 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078,
+ 0x43a3, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
+ 0x127e, 0x2071, 0x6f10, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000,
+ 0x8cff, 0x0040, 0x4405, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206,
+ 0x00c0, 0x4400, 0x703c, 0xac06, 0x00c0, 0x43cb, 0x6003, 0x000a,
+ 0x630a, 0x0078, 0x4400, 0x7038, 0xac36, 0x00c0, 0x43d1, 0x660c,
+ 0x763a, 0x7034, 0xac36, 0x00c0, 0x43df, 0x2c00, 0xaf36, 0x0040,
+ 0x43dd, 0x2f00, 0x7036, 0x0078, 0x43df, 0x7037, 0x0000, 0x660c,
+ 0x067e, 0x2c00, 0xaf06, 0x0040, 0x43e8, 0x7e0e, 0x0078, 0x43e9,
+ 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003,
+ 0x00c0, 0x440e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
+ 0x36a1, 0x1078, 0x6276, 0x1078, 0x6283, 0x0c7f, 0x0078, 0x43b8,
+ 0x2c78, 0x600c, 0x2060, 0x0078, 0x43b8, 0x127f, 0x007f, 0x027f,
+ 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x43f2, 0x1078, 0x6bb3, 0x0078, 0x43fb, 0x007e,
+ 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091,
+ 0x8000, 0x2079, 0x6f10, 0x7838, 0xa065, 0x0040, 0x444a, 0x600c,
+ 0x007e, 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x4435, 0x6003,
+ 0x000a, 0x630a, 0x2c30, 0x0078, 0x4447, 0x6010, 0x2068, 0x601c,
+ 0xa086, 0x0003, 0x00c0, 0x4453, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x36a1, 0x1078, 0x6276, 0x1078, 0x6283, 0x007f,
+ 0x0078, 0x4424, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f,
+ 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x443c,
+ 0x1078, 0x6bb3, 0x0078, 0x4445, 0x027e, 0x1078, 0x4470, 0x1078,
+ 0x4507, 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x6f10, 0x2091,
+ 0x8000, 0x1078, 0x4599, 0x1078, 0x4601, 0x127f, 0x0f7f, 0x007c,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6f10, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040,
+ 0x44f6, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x44f1,
+ 0x7024, 0xac06, 0x00c0, 0x44b6, 0x2069, 0x0100, 0x68c0, 0xa005,
+ 0x0040, 0x44b1, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4,
+ 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
+ 0x0040, 0x44a6, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
+ 0x6824, 0xd084, 0x0040, 0x44ae, 0x6827, 0x0001, 0x037f, 0x0078,
+ 0x44b6, 0x6003, 0x0009, 0x630a, 0x0078, 0x44f1, 0x7014, 0xac36,
+ 0x00c0, 0x44bc, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x44ca,
+ 0x2c00, 0xaf36, 0x0040, 0x44c8, 0x2f00, 0x7012, 0x0078, 0x44ca,
+ 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x44d3,
+ 0x7e0e, 0x0078, 0x44d4, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x44ea, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x44fe, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1,
+ 0x1078, 0x6276, 0x1078, 0x6283, 0x1078, 0x5374, 0x0c7f, 0x0078,
+ 0x447e, 0x2c78, 0x600c, 0x2060, 0x0078, 0x447e, 0x127f, 0x007f,
+ 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x44e1, 0x1078, 0x6bb3, 0x0078, 0x44ea, 0x0c7e,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x6e00, 0x2004, 0xa065,
+ 0x0040, 0x4595, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x6f10,
+ 0x6654, 0x7018, 0xac06, 0x00c0, 0x451e, 0x761a, 0x701c, 0xac06,
+ 0x00c0, 0x452a, 0x86ff, 0x00c0, 0x4529, 0x7018, 0x701e, 0x0078,
+ 0x452a, 0x761e, 0x6058, 0xa07d, 0x0040, 0x452f, 0x7e56, 0xa6ed,
+ 0x0000, 0x0040, 0x4535, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b,
+ 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x33c4, 0x0040,
+ 0x4591, 0x7624, 0x86ff, 0x0040, 0x4586, 0xa680, 0x0004, 0x2004,
+ 0xad06, 0x00c0, 0x4586, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005,
+ 0x0040, 0x457d, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4,
+ 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
+ 0x0040, 0x4566, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
+ 0x6824, 0xd084, 0x0040, 0x456e, 0x6827, 0x0001, 0x037f, 0x0d7f,
+ 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4577, 0x8001, 0x603e, 0x2660,
+ 0x1078, 0x6283, 0x0c7f, 0x0078, 0x4586, 0x0d7f, 0x0c7e, 0x2660,
+ 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x453d, 0x6837, 0x0103,
+ 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078, 0x5374, 0x0078,
+ 0x453d, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f,
+ 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814,
+ 0xa065, 0x0040, 0x45f1, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824,
+ 0xac06, 0x00c0, 0x45d6, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
+ 0x45d0, 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, 0x7827,
0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040,
0x45c5, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
- 0xd084, 0x0040, 0x45cd, 0x6827, 0x0001, 0x037f, 0x0078, 0x45d5,
- 0x6003, 0x0009, 0x630a, 0x0078, 0x4612, 0x7014, 0xac36, 0x00c0,
- 0x45db, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x45e9, 0x2c00,
- 0xaf36, 0x0040, 0x45e7, 0x2f00, 0x7012, 0x0078, 0x45e9, 0x7013,
- 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x45f2, 0x7e0e,
- 0x0078, 0x45f3, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078,
- 0x6216, 0x0040, 0x460b, 0x601c, 0xa086, 0x0003, 0x00c0, 0x461f,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x63d5, 0x1078,
- 0x3720, 0x1078, 0x632a, 0x1078, 0x6337, 0x1078, 0x52d5, 0x0c7f,
- 0x0078, 0x459d, 0x2c78, 0x600c, 0x2060, 0x0078, 0x459d, 0x127f,
- 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x4600, 0x1078, 0x6d80, 0x0078, 0x460b,
- 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x7020, 0x2004,
- 0xa065, 0x0040, 0x46bb, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071,
- 0x70b6, 0x6654, 0x7018, 0xac06, 0x00c0, 0x463f, 0x761a, 0x701c,
- 0xac06, 0x00c0, 0x464b, 0x86ff, 0x00c0, 0x464a, 0x7018, 0x701e,
- 0x0078, 0x464b, 0x761e, 0x6058, 0xa07d, 0x0040, 0x4650, 0x7e56,
- 0xa6ed, 0x0000, 0x0040, 0x4656, 0x2f00, 0x685a, 0x6057, 0x0000,
- 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x3448,
- 0x0040, 0x46b7, 0x7624, 0x86ff, 0x0040, 0x46a7, 0xa680, 0x0004,
- 0x2004, 0xad06, 0x00c0, 0x46a7, 0x0d7e, 0x2069, 0x0100, 0x68c0,
- 0xa005, 0x0040, 0x469e, 0x1078, 0x4f8e, 0x68c3, 0x0000, 0x1078,
- 0x5405, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
- 0x1000, 0x0040, 0x4687, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
- 0x0100, 0x6824, 0xd084, 0x0040, 0x468f, 0x6827, 0x0001, 0x037f,
- 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4698, 0x8001, 0x603e,
- 0x2660, 0x1078, 0x6337, 0x0c7f, 0x0078, 0x46a7, 0x0d7f, 0x0c7e,
- 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x465e, 0x8dff,
- 0x0040, 0x46b3, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
- 0x63d5, 0x1078, 0x3720, 0x1078, 0x52d5, 0x0078, 0x465e, 0x067f,
- 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e,
- 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065, 0x0040,
- 0x4717, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0,
- 0x46fc, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x46f6, 0x1078,
- 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x5405, 0x7827, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x46eb, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x46f3, 0x6827, 0x0001, 0x037f, 0x0078, 0x46fc, 0x6003, 0x0009,
- 0x630a, 0x2c30, 0x0078, 0x4714, 0x6010, 0x2068, 0x1078, 0x6216,
- 0x0040, 0x4710, 0x601c, 0xa086, 0x0003, 0x00c0, 0x471e, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x632a,
- 0x1078, 0x6337, 0x1078, 0x52d5, 0x007f, 0x0078, 0x46c6, 0x7e16,
- 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x4707, 0x1078, 0x6d80, 0x0078, 0x4710, 0x007e,
- 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, 0x4793, 0x6054,
- 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc,
- 0x6002, 0x1078, 0x3448, 0x0040, 0x4790, 0x7e24, 0x86ff, 0x0040,
- 0x4782, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4782, 0x0d7e,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4779, 0x1078, 0x4f8e,
- 0x68c3, 0x0000, 0x1078, 0x5405, 0x7827, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4762, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x476a,
- 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040,
- 0x4773, 0x8001, 0x603e, 0x2660, 0x1078, 0x6337, 0x0c7f, 0x0078,
- 0x4782, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f,
- 0x0078, 0x4739, 0x8dff, 0x0040, 0x478c, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x52d5, 0x0078, 0x4739,
- 0x007f, 0x0078, 0x472c, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f,
- 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x70b6, 0x7004, 0xa084,
- 0x0007, 0x0079, 0x47a3, 0x47ad, 0x47b0, 0x47c9, 0x47e5, 0x482a,
- 0x47ad, 0x47ad, 0x47ab, 0x1078, 0x1288, 0x0c7f, 0x0e7f, 0x007c,
- 0x7024, 0xa065, 0x0040, 0x47be, 0x7020, 0x8001, 0x7022, 0x600c,
- 0xa015, 0x0040, 0x47c5, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000,
- 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078,
- 0x47be, 0x6018, 0x2060, 0x1078, 0x3448, 0x6000, 0xc0dc, 0x6002,
- 0x7020, 0x8001, 0x7022, 0x0040, 0x47da, 0x6054, 0xa015, 0x0040,
- 0x47e1, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
- 0x007c, 0x7218, 0x721e, 0x0078, 0x47da, 0x7024, 0xa065, 0x0040,
- 0x4827, 0x700c, 0xac06, 0x00c0, 0x47fc, 0x1078, 0x52d5, 0x600c,
- 0xa015, 0x0040, 0x47f8, 0x720e, 0x600f, 0x0000, 0x0078, 0x4825,
- 0x720e, 0x720a, 0x0078, 0x4825, 0x7014, 0xac06, 0x00c0, 0x480f,
- 0x1078, 0x52d5, 0x600c, 0xa015, 0x0040, 0x480b, 0x7216, 0x600f,
- 0x0000, 0x0078, 0x4825, 0x7216, 0x7212, 0x0078, 0x4825, 0x6018,
- 0x2060, 0x1078, 0x3448, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x52d5,
- 0x701c, 0xa065, 0x0040, 0x4825, 0x6054, 0xa015, 0x0040, 0x4823,
- 0x721e, 0x0078, 0x4825, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x4837, 0x1078, 0x52d5,
- 0x600c, 0xa015, 0x0040, 0x483e, 0x720e, 0x600f, 0x0000, 0x1078,
- 0x5405, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a,
- 0x0078, 0x4837, 0x0d7e, 0x2069, 0x70b6, 0x6830, 0xa084, 0x0003,
- 0x0079, 0x484a, 0x4850, 0x4852, 0x4878, 0x4850, 0x1078, 0x1288,
- 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x486e,
- 0x683c, 0xa065, 0x0040, 0x4863, 0x600c, 0xa015, 0x0040, 0x486a,
- 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f,
- 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x4863, 0x6843, 0x0000,
- 0x6838, 0xa065, 0x0040, 0x4863, 0x6003, 0x0003, 0x0078, 0x4863,
- 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040,
- 0x4890, 0x600c, 0xa015, 0x0040, 0x488c, 0x6a3a, 0x600f, 0x0000,
- 0x683f, 0x0000, 0x0078, 0x4890, 0x683f, 0x0000, 0x683a, 0x6836,
- 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x70b6, 0x6804, 0xa084,
- 0x0007, 0x0079, 0x489b, 0x48a5, 0x4932, 0x4932, 0x4932, 0x4932,
- 0x4934, 0x4932, 0x48a3, 0x1078, 0x1288, 0x6820, 0xa005, 0x00c0,
- 0x48ab, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x48ba,
- 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x497a, 0x0c7f,
- 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x48c8, 0x6807, 0x0001,
- 0x6826, 0x682b, 0x0000, 0x1078, 0x497a, 0x0c7f, 0x0d7f, 0x007c,
- 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x492d, 0x704c,
- 0xa00d, 0x0040, 0x48d7, 0x7088, 0xa005, 0x0040, 0x48ef, 0x7054,
- 0xa075, 0x0040, 0x48e0, 0xa20e, 0x0040, 0x492d, 0x0078, 0x48e5,
- 0x6818, 0xa20e, 0x0040, 0x492d, 0x2070, 0x704c, 0xa00d, 0x0040,
- 0x48d7, 0x7088, 0xa005, 0x00c0, 0x48d7, 0x2e00, 0x681e, 0x733c,
- 0x7038, 0xa302, 0x00c8, 0x48d7, 0x1078, 0x55a4, 0x0040, 0x492d,
- 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004,
- 0xa08a, 0x199a, 0x0048, 0x4906, 0x2001, 0x1999, 0x8003, 0x801b,
- 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xa1e0,
- 0x2207, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078,
- 0x4c94, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26,
- 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040,
- 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f,
- 0x0078, 0x492b, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
- 0x4940, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x497a,
- 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x70b6, 0x6830,
- 0xa086, 0x0000, 0x00c0, 0x4961, 0x6838, 0xa07d, 0x0040, 0x4961,
- 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091,
- 0x2200, 0x027f, 0x1078, 0x19b3, 0x00c0, 0x4964, 0x127f, 0x1078,
- 0x4ec1, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803,
- 0x0002, 0x780c, 0xa015, 0x0040, 0x4976, 0x6a3a, 0x780f, 0x0000,
- 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x4961, 0x683a, 0x6836,
- 0x0078, 0x4970, 0x601c, 0xa084, 0x0007, 0x1079, 0x4980, 0x007c,
- 0x4988, 0x498d, 0x4bcc, 0x4c64, 0x498d, 0x4bcc, 0x4c64, 0x4988,
- 0x1078, 0x479a, 0x1078, 0x4893, 0x007c, 0x157e, 0x137e, 0x147e,
- 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288, 0x6118,
- 0x2178, 0x79a0, 0xa1f8, 0x2207, 0x2f0c, 0xa18c, 0x00ff, 0x2c78,
- 0x2061, 0x0100, 0x619a, 0x1079, 0x49ab, 0x0f7f, 0x0c7f, 0x147f,
- 0x137f, 0x157f, 0x007c, 0x49dd, 0x4a15, 0x4a2d, 0x4a66, 0x4a93,
- 0x4a9b, 0x4abc, 0x4acd, 0x4ade, 0x4ae6, 0x4af7, 0x4ae6, 0x4b3f,
- 0x4acd, 0x4b60, 0x4b68, 0x4ade, 0x4b68, 0x4b79, 0x49db, 0x49db,
- 0x49db, 0x49db, 0x49db, 0x49db, 0x49db, 0x49db, 0x49db, 0x49db,
- 0x49db, 0x49db, 0x504c, 0x5061, 0x49db, 0x49db, 0x49db, 0x49db,
- 0x4abc, 0x4ae6, 0x49db, 0x4a2d, 0x4a66, 0x49db, 0x551f, 0x4ae6,
- 0x49db, 0x5542, 0x4ae6, 0x1078, 0x1288, 0x20a1, 0x020b, 0x1078,
- 0x4b8e, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6f51,
- 0x6804, 0xd084, 0x0040, 0x49f7, 0x6828, 0x20a3, 0x0000, 0x017e,
- 0x1078, 0x1feb, 0x21a2, 0x017f, 0x0d7f, 0x0078, 0x49fc, 0x0d7f,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6f05,
- 0x53a6, 0x20a9, 0x0004, 0x2099, 0x6f01, 0x53a6, 0x20a3, 0x0000,
- 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x001c, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x4b8e, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030,
- 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6,
- 0x60c3, 0x0010, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x4b8e, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x2099, 0x70a0, 0x20a9,
- 0x0008, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x6f01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
- 0x00f0, 0x4a46, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4a4c,
- 0x2099, 0x70a8, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3,
- 0x0000, 0x00f0, 0x4a57, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0,
- 0x4a5d, 0x60c3, 0x0074, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x4b8e, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800,
- 0x20a3, 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x0f7e, 0x2079, 0x6f51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4a82,
- 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4a87, 0xa085, 0x0010, 0xa085,
- 0x0002, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b8e, 0x20a3,
- 0x5000, 0x0078, 0x4a33, 0x20a1, 0x020b, 0x1078, 0x4b8e, 0x20a3,
- 0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4bad,
- 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0004, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
- 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x4bad, 0x20a3, 0x0200, 0x0078, 0x4a33, 0x20a1, 0x020b,
- 0x1078, 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003,
- 0x7810, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0210, 0x20a3, 0x0014,
- 0x20a3, 0x0800, 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0,
- 0x4b1d, 0x6998, 0xa184, 0xc000, 0x00c0, 0x4b19, 0xd1ec, 0x0040,
- 0x4b15, 0x20a3, 0x2100, 0x0078, 0x4b1f, 0x20a3, 0x0100, 0x0078,
- 0x4b1f, 0x20a3, 0x0400, 0x0078, 0x4b1f, 0x20a3, 0x0700, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6f51,
- 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4b2f, 0xa085, 0x0020, 0xd1a4,
- 0x0040, 0x4b34, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2,
- 0x20a2, 0x60c3, 0x0014, 0x1078, 0x4f7a, 0x0d7f, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
+ 0xd084, 0x0040, 0x45cd, 0x6827, 0x0001, 0x037f, 0x0078, 0x45d6,
+ 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078, 0x45ee, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x45ea, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x45f8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1,
+ 0x1078, 0x6276, 0x1078, 0x6283, 0x1078, 0x5374, 0x007f, 0x0078,
+ 0x45a0, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c,
+ 0x601c, 0xa086, 0x0006, 0x00c0, 0x45e1, 0x1078, 0x6bb3, 0x0078,
+ 0x45ea, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040,
+ 0x466a, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000,
+ 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x33c4, 0x0040, 0x4667, 0x7e24,
+ 0x86ff, 0x0040, 0x465c, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0,
+ 0x465c, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4653,
+ 0x1078, 0x4fe5, 0x68c3, 0x0000, 0x1078, 0x54a4, 0x7827, 0x0000,
+ 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x463c,
+ 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
+ 0x0040, 0x4644, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c,
+ 0xa005, 0x0040, 0x464d, 0x8001, 0x603e, 0x2660, 0x1078, 0x6283,
+ 0x0c7f, 0x0078, 0x465c, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009,
+ 0x630a, 0x0c7f, 0x0078, 0x4613, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x36a1, 0x1078, 0x5374, 0x0078, 0x4613, 0x007f,
+ 0x0078, 0x4606, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f,
+ 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x6f10, 0x7004, 0xa084, 0x0007,
+ 0x0079, 0x467a, 0x4684, 0x4687, 0x46a0, 0x46bc, 0x4701, 0x4684,
+ 0x4682, 0x4682, 0x1078, 0x12b7, 0x0c7f, 0x0e7f, 0x007c, 0x7024,
+ 0xa065, 0x0040, 0x4695, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015,
+ 0x0040, 0x469c, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027,
+ 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x4695,
+ 0x6018, 0x2060, 0x1078, 0x33c4, 0x6000, 0xc0dc, 0x6002, 0x7020,
+ 0x8001, 0x7022, 0x0040, 0x46b1, 0x6054, 0xa015, 0x0040, 0x46b8,
+ 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c,
+ 0x7218, 0x721e, 0x0078, 0x46b1, 0x7024, 0xa065, 0x0040, 0x46fe,
+ 0x700c, 0xac06, 0x00c0, 0x46d3, 0x1078, 0x5374, 0x600c, 0xa015,
+ 0x0040, 0x46cf, 0x720e, 0x600f, 0x0000, 0x0078, 0x46fc, 0x720e,
+ 0x720a, 0x0078, 0x46fc, 0x7014, 0xac06, 0x00c0, 0x46e6, 0x1078,
+ 0x5374, 0x600c, 0xa015, 0x0040, 0x46e2, 0x7216, 0x600f, 0x0000,
+ 0x0078, 0x46fc, 0x7216, 0x7212, 0x0078, 0x46fc, 0x6018, 0x2060,
+ 0x1078, 0x33c4, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x5374, 0x701c,
+ 0xa065, 0x0040, 0x46fc, 0x6054, 0xa015, 0x0040, 0x46fa, 0x721e,
+ 0x0078, 0x46fc, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
+ 0x007c, 0x7024, 0xa065, 0x0040, 0x470e, 0x1078, 0x5374, 0x600c,
+ 0xa015, 0x0040, 0x4715, 0x720e, 0x600f, 0x0000, 0x1078, 0x54a4,
+ 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078,
+ 0x470e, 0x0d7e, 0x2069, 0x6f10, 0x6830, 0xa084, 0x0003, 0x0079,
+ 0x4721, 0x4727, 0x4729, 0x474f, 0x4725, 0x1078, 0x12b7, 0x0d7f,
+ 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x4745, 0x683c,
+ 0xa065, 0x0040, 0x473a, 0x600c, 0xa015, 0x0040, 0x4741, 0x6a3a,
+ 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f,
+ 0x007c, 0x683a, 0x6836, 0x0078, 0x473a, 0x6843, 0x0000, 0x6838,
+ 0xa065, 0x0040, 0x473a, 0x6003, 0x0003, 0x0078, 0x473a, 0x0c7e,
+ 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x4767,
+ 0x600c, 0xa015, 0x0040, 0x4763, 0x6a3a, 0x600f, 0x0000, 0x683f,
+ 0x0000, 0x0078, 0x4767, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f,
+ 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x6f10, 0x6804, 0xa084, 0x0007,
+ 0x0079, 0x4772, 0x477c, 0x4810, 0x4810, 0x4810, 0x4810, 0x4812,
+ 0x477a, 0x477a, 0x1078, 0x12b7, 0x6820, 0xa005, 0x00c0, 0x4782,
+ 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4791, 0x6807,
+ 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f,
+ 0x007c, 0x6814, 0xa065, 0x0040, 0x479f, 0x6807, 0x0001, 0x6826,
+ 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e,
+ 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x480b, 0x704c, 0xa00d,
+ 0x0040, 0x47ae, 0x7088, 0xa005, 0x0040, 0x47c6, 0x7054, 0xa075,
+ 0x0040, 0x47b7, 0xa20e, 0x0040, 0x480b, 0x0078, 0x47bc, 0x6818,
+ 0xa20e, 0x0040, 0x480b, 0x2070, 0x704c, 0xa00d, 0x0040, 0x47ae,
+ 0x7088, 0xa005, 0x00c0, 0x47ae, 0x2e00, 0x681e, 0x733c, 0x7038,
+ 0xa302, 0x00c8, 0x47ae, 0x1078, 0x5539, 0x0040, 0x480b, 0x8318,
+ 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004, 0xa08a,
+ 0x199a, 0x0048, 0x47dd, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b,
+ 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc, 0x0040,
+ 0x47ed, 0x2009, 0x0000, 0x0078, 0x47f2, 0xa1e0, 0x2091, 0x2c0c,
+ 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078, 0x4c44, 0x7300,
+ 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000,
+ 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, 0x0e7f,
+ 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, 0x4809,
+ 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x481e, 0x6807,
+ 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4858, 0x0c7f, 0x0d7f,
+ 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x6f10, 0x6830, 0xa086, 0x0000,
+ 0x00c0, 0x483f, 0x6838, 0xa07d, 0x0040, 0x483f, 0x6833, 0x0001,
+ 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, 0x027f,
+ 0x1078, 0x1838, 0x00c0, 0x4842, 0x127f, 0x1078, 0x4ed5, 0x0d7f,
+ 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c,
+ 0xa015, 0x0040, 0x4854, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000,
+ 0x683f, 0x0000, 0x0078, 0x483f, 0x683a, 0x6836, 0x0078, 0x484e,
+ 0x601c, 0xa084, 0x000f, 0x1079, 0x485e, 0x007c, 0x4867, 0x4869,
+ 0x4b33, 0x4c15, 0x4869, 0x4b33, 0x4c15, 0x4867, 0x4869, 0x1078,
+ 0x12b7, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a,
+ 0x0024, 0x10c8, 0x12b7, 0x6118, 0x2178, 0x79a0, 0xa1f8, 0x2091,
+ 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x1079,
+ 0x4887, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x48ad,
+ 0x48ec, 0x4904, 0x494c, 0x4979, 0x4981, 0x49a2, 0x49b3, 0x49c4,
+ 0x49cc, 0x49dd, 0x49cc, 0x4a25, 0x49b3, 0x4a55, 0x4a5d, 0x49c4,
+ 0x4a5d, 0x4a6e, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab,
+ 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x48ab, 0x50b8, 0x50cd,
+ 0x50f0, 0x5114, 0x49a2, 0x1078, 0x12b7, 0x20a1, 0x020b, 0x1078,
+ 0x4a83, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6d51,
+ 0x6804, 0xd084, 0x0040, 0x48ce, 0x6828, 0x017e, 0x2069, 0x6d00,
+ 0x694c, 0xa106, 0x017f, 0x00c0, 0x48ce, 0x20a3, 0x0000, 0x6030,
+ 0xa084, 0x00ff, 0x20a2, 0x0d7f, 0x0078, 0x48d3, 0x0d7f, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6d01, 0x53a6, 0x20a3, 0x0000, 0x6030,
+ 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x001c, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83,
+ 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6, 0x60c3,
+ 0x0010, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83,
+ 0x7818, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x4917,
+ 0x20a3, 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0078, 0x4919, 0x20a3,
+ 0x0300, 0x20a3, 0x0000, 0x2099, 0x6f00, 0x20a9, 0x0008, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6d05, 0x53a6, 0x20a9, 0x0004, 0x2099,
+ 0x6d01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x492c,
+ 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4932, 0x2099, 0x6f08,
+ 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0,
+ 0x493d, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4943, 0x60c3,
+ 0x0074, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83,
+ 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079,
+ 0x6d51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4968, 0xa085, 0x0020,
+ 0xd1a4, 0x0040, 0x496d, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4fd1,
+ 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x5000, 0x0078,
+ 0x4919, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x2110, 0x20a3,
+ 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0x20a3, 0x0000, 0x20a3,
0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4f7a, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0200, 0x0078, 0x49e3,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000,
- 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4f7a,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078,
- 0x4bad, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3,
- 0x0000, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x007c, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078,
- 0x4f69, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x4f69,
- 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a,
- 0x0085, 0x1048, 0x1288, 0xa08a, 0x008c, 0x10c8, 0x1288, 0x6118,
- 0x2178, 0x79a0, 0xa1f8, 0x2207, 0x2f0c, 0xa18c, 0x00ff, 0x2c78,
- 0x2061, 0x0100, 0x619a, 0xa082, 0x0085, 0x1079, 0x4bea, 0x0f7f,
- 0x0c7f, 0x007c, 0x4bf3, 0x4bfe, 0x4c18, 0x4bf1, 0x4bf1, 0x4bf1,
- 0x4bf3, 0x1078, 0x1288, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c2b,
- 0x60c3, 0x0000, 0x1078, 0x4f7a, 0x147f, 0x007c, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x4c3e, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808,
- 0x20a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x4f7a, 0x147f, 0x007c,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c51, 0x20a3, 0x0003, 0x20a3,
- 0x0300, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078,
- 0x4f7a, 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x20a3, 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0078, 0x4b9f, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078,
- 0x4bbe, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8500,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1,
- 0x20a3, 0x0000, 0x0078, 0x4bbe, 0x0c7e, 0x0f7e, 0x2c78, 0x7804,
- 0xa08a, 0x0040, 0x1048, 0x1288, 0xa08a, 0x0050, 0x10c8, 0x1288,
- 0x7918, 0x2160, 0x61a0, 0xa1e0, 0x2207, 0x2c0c, 0xa18c, 0x00ff,
- 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4c82, 0x0f7f,
- 0x0c7f, 0x007c, 0x4c94, 0x4d46, 0x4d07, 0x4e55, 0x4c92, 0x4c92,
- 0x4c92, 0x4c92, 0x4c92, 0x4c92, 0x4c92, 0x51ee, 0x51ff, 0x5210,
- 0x5221, 0x4c92, 0x1078, 0x1288, 0x0d7e, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x4ce7, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff,
+ 0x0022, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+ 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0200,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004,
+ 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3,
+ 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3,
+ 0x0008, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4afa,
+ 0x20a3, 0x0200, 0x0078, 0x4919, 0x20a1, 0x020b, 0x1078, 0x4afa,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2,
+ 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x007c, 0x0d7e, 0x20a1, 0x020b,
+ 0x1078, 0x4afa, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800,
+ 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x4a03, 0x6998,
+ 0xa184, 0xc000, 0x00c0, 0x49ff, 0xd1ec, 0x0040, 0x49fb, 0x20a3,
+ 0x2100, 0x0078, 0x4a05, 0x20a3, 0x0100, 0x0078, 0x4a05, 0x20a3,
+ 0x0400, 0x0078, 0x4a05, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6d51, 0x7904, 0x0f7f,
+ 0xd1ac, 0x00c0, 0x4a15, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4a1a,
+ 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x0014, 0x1078, 0x4fd1, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4afa, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x6018,
+ 0x0d7e, 0x2068, 0x6804, 0x0d7f, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x0040, 0x4a3e, 0x20a3, 0x0400, 0x0078, 0x4a40, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4afa, 0x20a3, 0x0200, 0x0078, 0x48b3, 0x20a1, 0x020b, 0x1078,
+ 0x4afa, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
+ 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008,
+ 0x1078, 0x4fd1, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x7818, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0, 0x4a96,
+ 0x20a3, 0x22ff, 0x20a3, 0xfffe, 0x0078, 0x4ac4, 0xa286, 0x007f,
+ 0x00c0, 0x4aa1, 0x0d7e, 0x20a3, 0x22ff, 0x20a3, 0xfffd, 0x0078,
+ 0x4ab8, 0xd2bc, 0x0040, 0x4ac0, 0xa286, 0x0080, 0x0d7e, 0x00c0,
+ 0x4aaf, 0x20a3, 0x22ff, 0x20a3, 0xfffc, 0x0078, 0x4ab8, 0xa2e8,
+ 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x2200, 0x20a2, 0x6814, 0x20a2,
+ 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4ac8,
+ 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
+ 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3,
+ 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x02ff, 0x2011, 0xfffc, 0x22a2, 0x0d7e, 0x2069, 0x6d19, 0x2da6,
+ 0x8d68, 0x2da6, 0x0d7f, 0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078,
+ 0x4acc, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3,
+ 0x0000, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
+ 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x4b19, 0x0d7e,
+ 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x2300, 0x20a2, 0x6814,
+ 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078,
+ 0x4b21, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
+ 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2,
+ 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0025,
+ 0x1048, 0x12b7, 0xa08a, 0x002c, 0x10c8, 0x12b7, 0x6118, 0x2178,
+ 0x79a0, 0xa1f8, 0x2091, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061,
+ 0x0100, 0x619a, 0xa082, 0x0025, 0x1079, 0x4b51, 0x0f7f, 0x0c7f,
+ 0x007c, 0x4b5a, 0x4b65, 0x4b7f, 0x4b58, 0x4b58, 0x4b58, 0x4b5a,
+ 0x1078, 0x12b7, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b8e, 0x60c3,
+ 0x0000, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4bbb, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
+ 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x000c, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4be8, 0x20a3, 0x0003, 0x20a3, 0x0300,
+ 0x60c3, 0x0004, 0x1078, 0x4fd1, 0x147f, 0x007c, 0x027e, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092,
+ 0x007e, 0x0048, 0x4bad, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810,
+ 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6,
+ 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4bb5, 0x20a3, 0x8100, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3,
+ 0x0000, 0x0078, 0x4acc, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x4bda,
+ 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2,
+ 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
+ 0x0078, 0x4be2, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b25,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+ 0x2004, 0xa092, 0x007e, 0x0048, 0x4c07, 0x0d7e, 0xa0e8, 0x6e00,
+ 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069,
+ 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4c0f, 0x20a3,
+ 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b25, 0x0c7e, 0x0f7e, 0x2c78,
+ 0x7804, 0xa08a, 0x0040, 0x1048, 0x12b7, 0xa08a, 0x004f, 0x10c8,
+ 0x12b7, 0x7918, 0x2160, 0x61a0, 0xa1e0, 0x2091, 0x2c0c, 0xa18c,
+ 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4c33,
+ 0x0f7f, 0x0c7f, 0x007c, 0x4c44, 0x4d28, 0x4cd0, 0x4e50, 0x4c42,
+ 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x4c42, 0x528d, 0x529e,
+ 0x52af, 0x52c0, 0x1078, 0x12b7, 0x0d7e, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4c93, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff,
0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006,
- 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4cb1, 0x20a3, 0x0002, 0x0078,
- 0x4cbd, 0xd1b4, 0x0040, 0x4cb8, 0x20a3, 0x0001, 0x0078, 0x4cbd,
- 0x20a3, 0x0000, 0x2230, 0x0078, 0x4cbf, 0x6a80, 0x6e7c, 0x20a9,
+ 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4c61, 0x20a3, 0x0002, 0x0078,
+ 0x4c6d, 0xd1b4, 0x0040, 0x4c68, 0x20a3, 0x0001, 0x0078, 0x4c6d,
+ 0x20a3, 0x0000, 0x2230, 0x0078, 0x4c6f, 0x6a80, 0x6e7c, 0x20a9,
0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0,
- 0x4cc3, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014,
- 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x70d2, 0x2003,
- 0x07d0, 0x2001, 0x70d1, 0x2003, 0x0009, 0x2001, 0x70d7, 0x2003,
- 0x0002, 0x1078, 0x14b7, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210,
- 0xa294, 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3, 0x0600, 0x6198,
- 0x21a2, 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a2, 0x22a2,
- 0x20a2, 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2, 0x007c, 0x0d7e,
- 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4d27, 0x7810,
- 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c,
- 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c,
- 0x1078, 0x4f7a, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000,
- 0x1078, 0x4f69, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e36, 0x7810, 0x2068,
- 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084,
- 0xf000, 0x00c0, 0x4d63, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079,
- 0x4d6b, 0x0078, 0x4d66, 0xa006, 0x1079, 0x4d6b, 0x147f, 0x137f,
- 0x157f, 0x0d7f, 0x007c, 0x4d75, 0x4dd7, 0x4ddb, 0x4dfe, 0x4e0b,
- 0x4e1d, 0x4e21, 0x4d73, 0x1078, 0x1288, 0x017e, 0x037e, 0x694c,
- 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4d88, 0x6b78, 0x23a2,
- 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x4e02,
- 0xa186, 0x0001, 0x00c0, 0x4dd2, 0x6b78, 0x23a2, 0x6868, 0x20a2,
- 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2,
- 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4dd1, 0xd3c4, 0x0040,
- 0x4da3, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4da8, 0x6874, 0xa108,
- 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2,
- 0x8000, 0x00f0, 0x4dad, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184,
- 0x0003, 0x0040, 0x4dd1, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
- 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4f69, 0x22a2, 0x20a3,
- 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x4f7a, 0x007c, 0x20a3,
- 0x0008, 0x0078, 0x4e00, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2,
- 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a,
- 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x60c3, 0x0032, 0x1078, 0x4f7a, 0x007c, 0x20a3, 0x0028,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018,
- 0x1078, 0x4f7a, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x60c3, 0x0020, 0x1078, 0x4f7a, 0x007c, 0x20a3, 0x0008, 0x0078,
- 0x4e00, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff,
- 0x8001, 0x00c0, 0x4e2f, 0x22a2, 0x037f, 0x0078, 0x4e00, 0x20a3,
- 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4e02, 0x027e, 0x20e1,
+ 0x4c73, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014,
+ 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x6f2c, 0x2003,
+ 0x07d0, 0x2001, 0x6f2b, 0x2003, 0x0009, 0x1078, 0x14e4, 0x147f,
+ 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18,
+ 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217,
+ 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x4cb9, 0x0d7e,
+ 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814,
+ 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078,
+ 0x4cc1, 0x20a3, 0x0600, 0x6198, 0x21a2, 0x20a3, 0x0000, 0x6130,
+ 0x21a2, 0x20a3, 0x0829, 0x20a3, 0x0000, 0x22a2, 0x20a3, 0x0000,
+ 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cf0,
+ 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2,
+ 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x000c, 0x1078, 0x4fd1, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+ 0x2004, 0xd0bc, 0x0040, 0x4d0e, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c,
+ 0x6810, 0xa085, 0x0500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19,
+ 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4d16, 0x20a3, 0x0500,
+ 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889,
+ 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08,
+ 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e18,
+ 0x7810, 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x7810, 0xa084, 0xf000, 0x00c0, 0x4d45, 0x7810, 0xa084, 0x0700,
+ 0x8007, 0x1079, 0x4d4d, 0x0078, 0x4d48, 0xa006, 0x1079, 0x4d4d,
+ 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4d57, 0x4db9, 0x4dbd,
+ 0x4de0, 0x4ded, 0x4dff, 0x4e03, 0x4d55, 0x1078, 0x12b7, 0x017e,
+ 0x037e, 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4d6a,
+ 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f,
+ 0x0078, 0x4de4, 0xa186, 0x0001, 0x00c0, 0x4db4, 0x6b78, 0x23a2,
+ 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2,
+ 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4db3,
+ 0xd3c4, 0x0040, 0x4d85, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4d8a,
+ 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c,
+ 0x831f, 0x23a2, 0x8000, 0x00f0, 0x4d8f, 0x157f, 0x22a2, 0x22a2,
+ 0x22a2, 0xa184, 0x0003, 0x0040, 0x4db3, 0x20a1, 0x020b, 0x20e1,
0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000, 0x1078,
- 0x4f69, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e,
- 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079,
- 0x4e68, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c,
- 0x4e70, 0x4e70, 0x4e72, 0x4e70, 0x4e70, 0x4e70, 0x4e97, 0x4e70,
- 0x1078, 0x1288, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600, 0x7912,
- 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4ea1, 0x0d7e, 0x2069,
- 0x6f51, 0x6804, 0xd0bc, 0x0040, 0x4e8c, 0x682c, 0xa084, 0x00ff,
- 0x8007, 0x20a2, 0x0078, 0x4e8e, 0x20a3, 0x3f00, 0x0d7f, 0x22a2,
- 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x4f7a, 0x007c, 0x20a1,
- 0x020b, 0x2009, 0x0003, 0x1078, 0x4ea1, 0x20a3, 0x7f00, 0x0078,
- 0x4e8f, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0100,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0888,
- 0xa18d, 0x0008, 0x21a2, 0x1078, 0x4f69, 0x22a2, 0x20a3, 0x0000,
- 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100, 0x2071, 0x6f00,
- 0x6130, 0x7818, 0x2068, 0x68a0, 0xa080, 0x2207, 0x2014, 0xa294,
- 0x00ff, 0x781c, 0xa086, 0x0006, 0x0040, 0x4f08, 0x6063, 0x0100,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077, 0x0008,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070, 0x7014,
- 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c,
- 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e,
- 0x6017, 0x0016, 0x1078, 0x4209, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c,
- 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040,
- 0x4f3d, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073,
+ 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4fc0,
+ 0x22a2, 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x4fd1,
+ 0x007c, 0x20a3, 0x0008, 0x0078, 0x4de2, 0x20a3, 0x0302, 0x22a2,
+ 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2,
+ 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x4fd1, 0x007c,
+ 0x20a3, 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x60c3, 0x0018, 0x1078, 0x4fd1, 0x007c, 0x20a3, 0x0100, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x1078, 0x4fd1, 0x007c, 0x20a3,
+ 0x0008, 0x0078, 0x4de2, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812,
+ 0xa384, 0x00ff, 0x8001, 0x00c0, 0x4e11, 0x22a2, 0x037f, 0x0078,
+ 0x4de2, 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4de4,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
+ 0x2004, 0xd0bc, 0x0040, 0x4e36, 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c,
+ 0x6810, 0xa085, 0x0700, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x6d19,
+ 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x4e3e, 0x20a3, 0x0700,
+ 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898,
+ 0x20a3, 0x0000, 0x1078, 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08,
+ 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084,
+ 0x0700, 0x8007, 0x1079, 0x4e63, 0x037f, 0x017f, 0x147f, 0x137f,
+ 0x157f, 0x0d7f, 0x007c, 0x4e6b, 0x4e6b, 0x4e6d, 0x4e6b, 0x4e6b,
+ 0x4e6b, 0x4e92, 0x4e6b, 0x1078, 0x12b7, 0x7910, 0xa18c, 0xf8ff,
+ 0xa18d, 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078,
+ 0x4e9c, 0x0d7e, 0x2069, 0x6d51, 0x6804, 0xd0bc, 0x0040, 0x4e87,
+ 0x682c, 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x4e89, 0x20a3,
+ 0x3f00, 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078,
+ 0x4fd1, 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4e9c,
+ 0x20a3, 0x7f00, 0x0078, 0x4e8a, 0x027e, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x4eba,
+ 0x0d7e, 0xa0e8, 0x6e00, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2,
+ 0x6814, 0x20a2, 0x2069, 0x6d19, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
+ 0x0078, 0x4ec2, 0x20a3, 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078,
+ 0x4fc0, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x057e, 0x047e, 0x037e, 0x2061, 0x0100, 0x2071, 0x6d00, 0x6130,
+ 0x7818, 0x2068, 0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x4eee, 0xa080,
+ 0x2091, 0x2014, 0xa294, 0x00ff, 0x0078, 0x4ef2, 0x6910, 0x6a14,
+ 0x7364, 0x7468, 0x781c, 0xa086, 0x0006, 0x0040, 0x4f3d, 0xd5bc,
+ 0x0040, 0x4f02, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e,
+ 0x0078, 0x4f08, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e,
+ 0x6073, 0x0809, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff,
+ 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808,
+ 0x6086, 0x7810, 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c,
+ 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af,
+ 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x4f31, 0x2011,
+ 0x0000, 0x629e, 0x6017, 0x0016, 0x1078, 0x4151, 0x037f, 0x047f,
+ 0x057f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c,
+ 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x4f83, 0xd5bc, 0x0040,
+ 0x4f51, 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078,
+ 0x4f57, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073,
0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e,
0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082,
0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca,
0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
- 0x629e, 0x6017, 0x0012, 0x0078, 0x4f02, 0x6063, 0x0700, 0x6266,
- 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000, 0x688c,
- 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000,
- 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010, 0x608e,
- 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036,
- 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078,
- 0x4f02, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff,
- 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x70b6, 0x6843, 0x0001,
- 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
- 0x1078, 0x4f85, 0x1078, 0x41f9, 0x007c, 0x007e, 0x6014, 0xa084,
- 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e,
- 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016,
- 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078,
- 0x4204, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x4fd8, 0x1078, 0x4f8e, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0c7e, 0x2061, 0x70b6, 0x6128, 0xa192, 0x0002, 0x00c8, 0x4fc5,
- 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x4fd3, 0x1078,
- 0x41f9, 0x1078, 0x4f85, 0x0078, 0x4fd3, 0x6124, 0xa1e5, 0x0000,
- 0x0040, 0x4fd0, 0x1078, 0x6e4a, 0x2009, 0x0014, 0x1078, 0x55fc,
- 0x0c7f, 0x0078, 0x4fd3, 0x027f, 0x017f, 0x0d7f, 0x0c7f, 0x007c,
- 0x1078, 0x3229, 0x0078, 0x4fd3, 0x0c7e, 0x0d7e, 0x0e7e, 0x017e,
- 0x027e, 0x1078, 0x4212, 0x2071, 0x70b6, 0x713c, 0x81ff, 0x0040,
- 0x5006, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x500c, 0x6803, 0x1000, 0x6803, 0x0000, 0x037e, 0x2019,
- 0x0001, 0x1078, 0x513b, 0x037f, 0x713c, 0x2160, 0x1078, 0x6e4a,
- 0x2009, 0x004a, 0x1078, 0x55fc, 0x0078, 0x5006, 0x027f, 0x017f,
- 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x7144, 0xa192, 0x0002, 0x00c8,
- 0x4ff6, 0x8108, 0x7146, 0x1078, 0x4209, 0x0078, 0x5006, 0x0e7e,
- 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, 0x70b6, 0x7018, 0x2068,
- 0x8dff, 0x0040, 0x5043, 0x68a0, 0xa406, 0x0040, 0x5033, 0x6854,
- 0x2068, 0x0078, 0x5028, 0x6010, 0x2060, 0x643c, 0x6540, 0x6644,
- 0xa6b4, 0x000f, 0x2d60, 0x1078, 0x359f, 0x0040, 0x5043, 0x1078,
- 0x52d5, 0xa085, 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b,
- 0x1078, 0x4b8e, 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4f7a, 0x147f, 0x157f,
- 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3,
- 0x0200, 0x20a3, 0x0000, 0x20a9, 0x0006, 0x2011, 0x6f40, 0x2019,
- 0x6f41, 0x23a6, 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0,
- 0x5071, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078,
- 0x4f7a, 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x70b6, 0x700c, 0x2060, 0x8cff, 0x0040,
- 0x50a0, 0x1078, 0x6364, 0x00c0, 0x5097, 0x1078, 0x57d2, 0x600c,
- 0x007e, 0x1078, 0x55d5, 0x1078, 0x52d5, 0x0c7f, 0x0078, 0x508e,
- 0x700f, 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f,
- 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e,
- 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140,
- 0x2071, 0x70b6, 0x7024, 0x2060, 0x8cff, 0x0040, 0x50f9, 0x1078,
- 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x4204, 0x2009, 0x0013, 0x1078,
- 0x55fc, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x50dc, 0x6827,
- 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x50ee, 0x7803, 0x1000,
- 0x7803, 0x0000, 0x0078, 0x50ee, 0xd084, 0x0040, 0x50e3, 0x6827,
- 0x0001, 0x0078, 0x50e5, 0x00f0, 0x50cb, 0x7804, 0xa084, 0x1000,
- 0x0040, 0x50ee, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f,
- 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f,
- 0x007c, 0x2001, 0x6f00, 0x2004, 0xa096, 0x0001, 0x0040, 0x5131,
- 0xa096, 0x0004, 0x0040, 0x5131, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x2011, 0x31f0, 0x1078, 0x4187, 0x20a9, 0x01f4, 0x6824, 0xd094,
- 0x0040, 0x511f, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040,
- 0x5131, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5131, 0xd084,
- 0x0040, 0x5126, 0x6827, 0x0001, 0x0078, 0x5128, 0x00f0, 0x510e,
- 0x7804, 0xa084, 0x1000, 0x0040, 0x5131, 0x7803, 0x0100, 0x7803,
- 0x0000, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x157f, 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100,
- 0x2079, 0x0140, 0x2071, 0x70b6, 0x703c, 0x2060, 0x8cff, 0x0040,
- 0x5189, 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078,
- 0x4212, 0x1078, 0x1b80, 0xa39d, 0x0000, 0x00c0, 0x5163, 0x2009,
- 0x0049, 0x1078, 0x55fc, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040,
- 0x5176, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5188,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5188, 0xd094, 0x0040,
- 0x517d, 0x6827, 0x0002, 0x0078, 0x517f, 0x00f0, 0x5165, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x5188, 0x7803, 0x0100, 0x7803, 0x0000,
- 0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x157f, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069,
- 0x70b6, 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091,
- 0x8000, 0x2069, 0x70b6, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x70b6, 0x7614,
- 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x51e7, 0x601c,
- 0xa206, 0x00c0, 0x51e2, 0x7014, 0xac36, 0x00c0, 0x51c1, 0x660c,
- 0x7616, 0x7010, 0xac36, 0x00c0, 0x51cf, 0x2c00, 0xaf36, 0x0040,
- 0x51cd, 0x2f00, 0x7012, 0x0078, 0x51cf, 0x7013, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x51d8, 0x7e0e, 0x0078, 0x51d9,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6337, 0x1078, 0x52d5, 0x0c7f,
- 0x0078, 0x51b4, 0x2c78, 0x600c, 0x2060, 0x0078, 0x51b4, 0x127f,
- 0x007f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x5230, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x5230,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078,
- 0x5230, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ce7, 0x7810,
- 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200,
- 0x1078, 0x52e0, 0x60c3, 0x0020, 0x1078, 0x4f7a, 0x147f, 0x157f,
- 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120,
- 0xd1b4, 0x00c0, 0x5248, 0xd1bc, 0x00c0, 0x5292, 0x0078, 0x52d2,
- 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069,
- 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x5289, 0x6020, 0xd0b4, 0x0040, 0x5289, 0x6024, 0xd094,
- 0x00c0, 0x5289, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
- 0x5289, 0x00f0, 0x5255, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107,
- 0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b,
- 0xbc91, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024,
- 0xd094, 0x00c0, 0x5288, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x527f,
- 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000,
- 0x0078, 0x52d2, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e,
- 0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x52cb, 0x6020, 0xd0bc, 0x0040, 0x52cb,
- 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x52cb, 0x00f0,
- 0x529f, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
- 0x00ff, 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043,
- 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000,
- 0x00c0, 0x52c5, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f,
- 0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x70b6,
- 0x7020, 0xa005, 0x0040, 0x52de, 0x8001, 0x7022, 0x0e7f, 0x007c,
- 0x20a9, 0x0008, 0x20a2, 0x00f0, 0x52e2, 0x20a2, 0x20a2, 0x007c,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x2039,
- 0x0001, 0x87ff, 0x0040, 0x5378, 0x8cff, 0x0040, 0x5378, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x5373, 0x88ff, 0x0040, 0x530f, 0x2800,
- 0xac06, 0x00c0, 0x5373, 0x2039, 0x0000, 0x0078, 0x5313, 0x6018,
- 0xa206, 0x00c0, 0x5373, 0x7024, 0xac06, 0x00c0, 0x5341, 0x2069,
- 0x0100, 0x68c0, 0xa005, 0x0040, 0x533c, 0x6817, 0x0008, 0x68c3,
- 0x0000, 0x1078, 0x5405, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
- 0x6b04, 0xa384, 0x1000, 0x0040, 0x5331, 0x6803, 0x0100, 0x6803,
- 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5339, 0x6827,
- 0x0001, 0x037f, 0x0078, 0x5341, 0x6003, 0x0009, 0x630a, 0x0078,
- 0x5373, 0x7014, 0xac36, 0x00c0, 0x5347, 0x660c, 0x7616, 0x7010,
- 0xac36, 0x00c0, 0x5355, 0x2c00, 0xaf36, 0x0040, 0x5353, 0x2f00,
- 0x7012, 0x0078, 0x5355, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x535e, 0x7e0e, 0x0078, 0x535f, 0x2678, 0x600f,
- 0x0000, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040, 0x5369, 0x1078,
- 0x6d80, 0x1078, 0x6337, 0x1078, 0x52d5, 0x88ff, 0x00c0, 0x5382,
- 0x0c7f, 0x0078, 0x52f9, 0x2c78, 0x600c, 0x2060, 0x0078, 0x52f9,
- 0xa006, 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078,
- 0x5379, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6, 0x7638, 0x2660, 0x2678,
- 0x8cff, 0x0040, 0x53f4, 0x601c, 0xa086, 0x0006, 0x00c0, 0x53ef,
- 0x88ff, 0x0040, 0x53a9, 0x2800, 0xac06, 0x00c0, 0x53ef, 0x0078,
- 0x53ad, 0x6018, 0xa206, 0x00c0, 0x53ef, 0x703c, 0xac06, 0x00c0,
- 0x53bf, 0x037e, 0x2019, 0x0001, 0x1078, 0x513b, 0x7033, 0x0000,
- 0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038,
- 0xac36, 0x00c0, 0x53c5, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0,
- 0x53d3, 0x2c00, 0xaf36, 0x0040, 0x53d1, 0x2f00, 0x7036, 0x0078,
- 0x53d3, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
- 0x53dc, 0x7e0e, 0x0078, 0x53dd, 0x2678, 0x600f, 0x0000, 0x6010,
- 0x2068, 0x1078, 0x6216, 0x0040, 0x53e7, 0x1078, 0x6d80, 0x1078,
- 0x6337, 0x88ff, 0x00c0, 0x53fe, 0x0c7f, 0x0078, 0x5398, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x5398, 0xa006, 0x127f, 0x007f, 0x027f,
- 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000,
- 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x53f5, 0x0e7e, 0x2071, 0x70b6,
- 0x2001, 0x6f00, 0x2004, 0xa086, 0x0002, 0x00c0, 0x5413, 0x7007,
- 0x0005, 0x0078, 0x5415, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x70b6, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040,
- 0x5455, 0x2200, 0xac06, 0x00c0, 0x5450, 0x7038, 0xac36, 0x00c0,
- 0x5433, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5441, 0x2c00,
- 0xaf36, 0x0040, 0x543f, 0x2f00, 0x7036, 0x0078, 0x5441, 0x7037,
- 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5449, 0x7e0e, 0x0078,
- 0x544a, 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5455,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5426, 0x127f, 0x007f, 0x027f,
- 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6,
- 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040, 0x54ee, 0x6018, 0xa080,
- 0x0028, 0x2004, 0xa206, 0x00c0, 0x54e9, 0x7024, 0xac06, 0x00c0,
- 0x549c, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x549c, 0x1078,
- 0x4f8e, 0x68c3, 0x0000, 0x1078, 0x5405, 0x7027, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5493, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x549b, 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x54a2,
- 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0, 0x54b0, 0x2c00, 0xaf36,
- 0x0040, 0x54ae, 0x2f00, 0x700a, 0x0078, 0x54b0, 0x700b, 0x0000,
- 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x54b9, 0x7e0e, 0x0078,
- 0x54ba, 0x2678, 0x600f, 0x0000, 0x1078, 0x6350, 0x00c0, 0x54c4,
- 0x1078, 0x21c6, 0x0078, 0x54e0, 0x1078, 0x6364, 0x00c0, 0x54cc,
- 0x1078, 0x57d2, 0x0078, 0x54e0, 0x6010, 0x2068, 0x1078, 0x6216,
- 0x0040, 0x54e0, 0x601c, 0xa086, 0x0003, 0x00c0, 0x54f6, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x632a,
- 0x6003, 0x0000, 0x1078, 0x6337, 0x1078, 0x52d5, 0x0c7f, 0x0078,
- 0x546b, 0x2c78, 0x600c, 0x2060, 0x0078, 0x546b, 0x127f, 0x007f,
- 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x54d7, 0x1078, 0x6d80, 0x0078, 0x54e0, 0x037e,
- 0x157e, 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c,
- 0xa39e, 0x20a0, 0x00c0, 0x5510, 0x8210, 0x8000, 0x0078, 0x5507,
- 0xa005, 0x0040, 0x551a, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0,
- 0x22c8, 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0200, 0x20a3, 0x0014,
- 0x60c3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c,
- 0x20a3, 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004,
- 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x4f7a,
- 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4bad, 0x20a3, 0x0210,
- 0x20a3, 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0018, 0x1078, 0x4f7a, 0x007c, 0x2061,
- 0x7500, 0x2a70, 0x7060, 0x7046, 0x704b, 0x7500, 0x007c, 0x0e7e,
- 0x127e, 0x2071, 0x6f00, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001,
- 0x0048, 0x55a1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x558d, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5589, 0x0078,
- 0x557c, 0x2061, 0x7500, 0x0078, 0x557c, 0x6003, 0x0008, 0x8529,
- 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x559d, 0x754a,
- 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7500, 0x0078,
- 0x5598, 0xa006, 0x0078, 0x559a, 0x0e7e, 0x2071, 0x6f00, 0x7544,
- 0xa582, 0x0001, 0x0048, 0x55d2, 0x7048, 0x2060, 0x6000, 0xa086,
- 0x0000, 0x0040, 0x55bf, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
- 0x55bb, 0x0078, 0x55ae, 0x2061, 0x7500, 0x0078, 0x55ae, 0x6003,
- 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8,
- 0x55ce, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7500,
- 0x0078, 0x55ca, 0xa006, 0x0078, 0x55cc, 0xac82, 0x7500, 0x1048,
- 0x1288, 0x2001, 0x6f15, 0x2004, 0xac02, 0x10c8, 0x1288, 0xa006,
- 0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000,
- 0x6003, 0x0000, 0x2061, 0x6f00, 0x6044, 0x8000, 0x6046, 0xa086,
- 0x0001, 0x0040, 0x55f4, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4893, 0x127f, 0x0078, 0x55f3, 0x601c, 0xa084, 0x0007, 0x0079,
- 0x5601, 0x5609, 0x5611, 0x562d, 0x5649, 0x63e1, 0x63fd, 0x6419,
- 0x5609, 0xa18e, 0x0047, 0x00c0, 0x5610, 0xa016, 0x1078, 0x1525,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x561b, 0x067f, 0x007c, 0x562b, 0x56f6, 0x57e1, 0x562b, 0x562b,
- 0x562b, 0x562b, 0x562b, 0x56a5, 0x5a63, 0x562b, 0x562b, 0x562b,
- 0x562b, 0x562b, 0x562b, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x5637, 0x067f, 0x007c, 0x5647,
- 0x5647, 0x5647, 0x5647, 0x5647, 0x5647, 0x5647, 0x5647, 0x5ed3,
- 0x5f99, 0x5647, 0x5eec, 0x5f45, 0x5eec, 0x5f45, 0x5647, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x5653, 0x067f, 0x007c, 0x5663, 0x5aa1, 0x5b47, 0x5c09, 0x5d5d,
- 0x5663, 0x5663, 0x5663, 0x5a7f, 0x5e88, 0x5e8c, 0x5663, 0x5663,
- 0x5663, 0x5663, 0x5eb2, 0x1078, 0x1288, 0x20a9, 0x000e, 0x2e98,
- 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
- 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5673, 0x0e7e,
- 0x1078, 0x6216, 0x0040, 0x568a, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x55d5, 0x007c, 0x0d7e, 0x20a9,
- 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0,
- 0x56a2, 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800,
- 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x567f, 0x2100, 0xa1b2, 0x0030,
- 0x10c8, 0x1288, 0x0079, 0x56ac, 0x56de, 0x56ea, 0x56de, 0x56de,
- 0x56de, 0x56de, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56de, 0x56dc, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x56de, 0x56dc, 0x56dc, 0x56dc,
- 0x56dc, 0x56dc, 0x56dc, 0x56dc, 0x1078, 0x1288, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x448b, 0x127e, 0x2091, 0x8000, 0x1078, 0x4893,
- 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x448b, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4893, 0x127f, 0x007c, 0x6004, 0xa0b2,
- 0x0030, 0x10c8, 0x1288, 0xa1b6, 0x0013, 0x00c0, 0x5702, 0x2008,
- 0x0079, 0x575a, 0xa1b6, 0x0027, 0x00c0, 0x5740, 0x1078, 0x479a,
- 0x6004, 0x1078, 0x6350, 0x0040, 0x5713, 0x1078, 0x6364, 0x0040,
- 0x573c, 0x0078, 0x5737, 0x1078, 0x21c6, 0x2001, 0x0007, 0x1078,
- 0x3477, 0x6018, 0xa080, 0x0028, 0x200c, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x457b, 0x1078, 0x44be, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x572e, 0x1078, 0x364c, 0x0c7f, 0x2c08,
- 0x1078, 0x6bfe, 0x037f, 0x027f, 0x017f, 0x1078, 0x34b3, 0x1078,
- 0x55d5, 0x1078, 0x4893, 0x007c, 0x1078, 0x57d2, 0x0078, 0x5737,
- 0xa186, 0x0014, 0x00c0, 0x573b, 0x1078, 0x479a, 0x1078, 0x21a8,
- 0x1078, 0x6350, 0x00c0, 0x5750, 0x1078, 0x21c6, 0x0078, 0x5737,
- 0x1078, 0x6364, 0x00c0, 0x5758, 0x1078, 0x57d2, 0x0078, 0x5737,
- 0x0078, 0x5737, 0x578c, 0x578e, 0x5792, 0x5796, 0x579a, 0x579e,
- 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x57a2, 0x57a8, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x57a8, 0x57a8, 0x578a, 0x578a, 0x578a, 0x578a,
- 0x578a, 0x578a, 0x1078, 0x1288, 0x0078, 0x57a8, 0x2001, 0x000b,
- 0x0078, 0x57b1, 0x2001, 0x0003, 0x0078, 0x57b1, 0x2001, 0x0005,
- 0x0078, 0x57b1, 0x2001, 0x0001, 0x0078, 0x57b1, 0x2001, 0x0009,
- 0x0078, 0x57b1, 0x1078, 0x1288, 0x0078, 0x57b0, 0x1078, 0x3477,
- 0x1078, 0x479a, 0x6003, 0x0002, 0x6017, 0x0028, 0x1078, 0x4893,
- 0x007c, 0x1078, 0x3477, 0x1078, 0x479a, 0x6003, 0x0002, 0x037e,
- 0x2019, 0x6f5c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x57c3, 0x2019,
- 0x0028, 0x0078, 0x57cc, 0x8007, 0xa09a, 0x0004, 0x0048, 0x57bf,
- 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x4893,
- 0x0078, 0x57b0, 0x0e7e, 0x1078, 0x6216, 0x0040, 0x57df, 0x6010,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f,
- 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x1288, 0x6604, 0xa6b6, 0x0028, 0x00c0,
- 0x57f5, 0x1078, 0x6399, 0x0078, 0x581e, 0x6604, 0xa6b6, 0x0029,
- 0x00c0, 0x57fe, 0x1078, 0x63b3, 0x0078, 0x581e, 0x6604, 0xa6b6,
- 0x001f, 0x00c0, 0x5807, 0x1078, 0x5665, 0x0078, 0x581e, 0x6604,
- 0xa6b6, 0x0000, 0x00c0, 0x5810, 0x1078, 0x568e, 0x0078, 0x581e,
- 0xa1b6, 0x0015, 0x00c0, 0x5818, 0x1079, 0x5823, 0x0078, 0x581e,
- 0xa1b6, 0x0016, 0x00c0, 0x581f, 0x1079, 0x58ec, 0x007c, 0x1078,
- 0x5609, 0x0078, 0x581e, 0x582f, 0x5832, 0x582f, 0x5873, 0x582f,
- 0x589b, 0x582f, 0x582f, 0x582f, 0x58c4, 0x582f, 0x58da, 0x0005,
- 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x7070, 0xa086, 0x0074,
- 0x00c0, 0x585c, 0x1078, 0x6bd6, 0x00c0, 0x584e, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x5860, 0x0d7f, 0x2001, 0x0006, 0x1078, 0x3477,
- 0x1078, 0x21c6, 0x1078, 0x55d5, 0x0078, 0x585e, 0x2001, 0x000a,
- 0x1078, 0x3477, 0x1078, 0x21c6, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x448b, 0x0078, 0x585e, 0x1078, 0x588b, 0x0e7f, 0x007c,
- 0x6800, 0xd084, 0x0040, 0x5872, 0x2001, 0x0000, 0x1078, 0x3463,
- 0x2069, 0x6f51, 0x6804, 0xd0a4, 0x0040, 0x5872, 0x2001, 0x0006,
- 0x1078, 0x3485, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086, 0x0074,
- 0x00c0, 0x5888, 0x1078, 0x59b5, 0x2001, 0x0004, 0x1078, 0x3477,
- 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x448b, 0x0078, 0x588a,
- 0x1078, 0x588b, 0x007c, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003,
- 0x0040, 0x5896, 0x2001, 0x0007, 0x1078, 0x3477, 0x1078, 0x55d5,
- 0x1078, 0x21c6, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x7070, 0xa086,
- 0x0014, 0x00c0, 0x58c0, 0x7000, 0xa086, 0x0003, 0x00c0, 0x58aa,
- 0x1078, 0x2a74, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3547, 0x1078,
- 0x5860, 0x0d7f, 0x1078, 0x59bf, 0x00c0, 0x58c0, 0x2001, 0x0006,
- 0x1078, 0x3477, 0x1078, 0x55d5, 0x1078, 0x21c6, 0x0078, 0x58c2,
- 0x1078, 0x588b, 0x0e7f, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x58d7, 0x2001, 0x0002, 0x1078, 0x3477, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x448b, 0x0078, 0x58d9, 0x1078,
- 0x588b, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x58e9, 0x2001, 0x0007, 0x1078, 0x3477, 0x1078, 0x55d5, 0x0078,
- 0x58eb, 0x1078, 0x588b, 0x007c, 0x582f, 0x58f8, 0x582f, 0x591e,
- 0x582f, 0x596a, 0x582f, 0x582f, 0x582f, 0x597d, 0x582f, 0x5990,
- 0x0c7e, 0x1078, 0x59a3, 0x00c0, 0x590d, 0x2001, 0x0000, 0x1078,
- 0x3463, 0x2001, 0x0002, 0x1078, 0x3477, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x448b, 0x0078, 0x591c, 0x2009, 0x738f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x591a, 0x1078, 0x55d5,
- 0x0078, 0x591c, 0x1078, 0x588b, 0x0c7f, 0x007c, 0x1078, 0x59b2,
- 0x00c0, 0x5932, 0x2001, 0x0000, 0x1078, 0x3463, 0x2001, 0x0002,
- 0x1078, 0x3477, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x448b,
- 0x0078, 0x5952, 0x2009, 0x738e, 0x2134, 0xa6b4, 0x00ff, 0xa686,
- 0x0005, 0x0040, 0x5953, 0x2009, 0x738f, 0x2104, 0xa084, 0xff00,
- 0xa086, 0x1900, 0x00c0, 0x5950, 0xa686, 0x0009, 0x0040, 0x5953,
- 0x2001, 0x0004, 0x1078, 0x3477, 0x1078, 0x55d5, 0x0078, 0x5952,
- 0x1078, 0x588b, 0x007c, 0x0d7e, 0x6018, 0x2068, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x5965, 0x8001, 0x6842, 0x6017, 0x000a,
- 0x6007, 0x0016, 0x0d7f, 0x0078, 0x5952, 0x1078, 0x21a8, 0x0d7f,
- 0x0078, 0x5950, 0x1078, 0x59b2, 0x00c0, 0x597a, 0x2001, 0x0004,
- 0x1078, 0x3477, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x448b,
- 0x0078, 0x597c, 0x1078, 0x588b, 0x007c, 0x1078, 0x59b2, 0x00c0,
- 0x598d, 0x2001, 0x0008, 0x1078, 0x3477, 0x6003, 0x0001, 0x6007,
- 0x0005, 0x1078, 0x448b, 0x0078, 0x598f, 0x1078, 0x588b, 0x007c,
- 0x1078, 0x59b2, 0x00c0, 0x59a0, 0x2001, 0x000a, 0x1078, 0x3477,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x448b, 0x0078, 0x59a2,
- 0x1078, 0x588b, 0x007c, 0x2009, 0x738e, 0x2104, 0xa086, 0x0003,
- 0x00c0, 0x59b1, 0x2009, 0x738f, 0x2104, 0xa084, 0xff00, 0xa086,
- 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, 0x017e, 0xac88,
- 0x0006, 0x2164, 0x1078, 0x34dd, 0x017f, 0x0c7f, 0x007c, 0x0e7e,
- 0x2071, 0x738c, 0x7004, 0xa086, 0x0014, 0x00c0, 0x59e2, 0x7008,
- 0xa086, 0x0800, 0x00c0, 0x59e2, 0x700c, 0xd0ec, 0x0040, 0x59e0,
- 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x59e0, 0x7024, 0xd0a4,
- 0x0040, 0x59e0, 0xd08c, 0x0040, 0x59e0, 0xa006, 0x0078, 0x59e2,
- 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e,
- 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2029,
- 0x70bf, 0x252c, 0x2021, 0x70c5, 0x2424, 0x2061, 0x7500, 0x2071,
- 0x6f00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5a39, 0x1078, 0x6ddc,
- 0x0040, 0x5a31, 0x671c, 0xa786, 0x0001, 0x0040, 0x5a31, 0xa786,
- 0x0007, 0x0040, 0x5a31, 0x2500, 0xac06, 0x0040, 0x5a31, 0x2400,
- 0xac06, 0x0040, 0x5a31, 0x0c7e, 0x6000, 0xa086, 0x0004, 0x00c0,
- 0x5a1b, 0x1078, 0x1629, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040,
- 0x5a2e, 0xa786, 0x0003, 0x00c0, 0x5a43, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x632a, 0x1078, 0x6337,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5a39, 0x0078,
- 0x59f9, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f, 0x077f, 0x0c7f,
- 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x5a25, 0x1078,
- 0x6d80, 0x0078, 0x5a2e, 0x220c, 0x2304, 0xa106, 0x00c0, 0x5a56,
- 0x8210, 0x8318, 0x00f0, 0x5a4b, 0xa006, 0x007c, 0x2304, 0xa102,
- 0x0048, 0x5a5e, 0x2001, 0x0001, 0x0078, 0x5a60, 0x2001, 0x0000,
- 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288,
- 0x1078, 0x6350, 0x0040, 0x5a72, 0x1078, 0x6364, 0x0040, 0x5a7b,
- 0x0078, 0x5a74, 0x1078, 0x21c6, 0x1078, 0x479a, 0x1078, 0x55d5,
- 0x1078, 0x4893, 0x007c, 0x1078, 0x57d2, 0x0078, 0x5a74, 0xa182,
- 0x0040, 0x0079, 0x5a83, 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a93,
- 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a93, 0x5a95, 0x5a95,
- 0x5a95, 0x5a95, 0x5a93, 0x1078, 0x1288, 0x6003, 0x0001, 0x6106,
- 0x1078, 0x443e, 0x127e, 0x2091, 0x8000, 0x1078, 0x4893, 0x127f,
- 0x007c, 0xa186, 0x0013, 0x00c0, 0x5aaa, 0x6004, 0xa082, 0x0040,
- 0x0079, 0x5b20, 0xa186, 0x0027, 0x00c0, 0x5ac7, 0x1078, 0x479a,
- 0x1078, 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6216, 0x0040,
- 0x5ac1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3720, 0x1078,
- 0x632a, 0x0d7f, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c, 0xa186,
- 0x0014, 0x00c0, 0x5ad0, 0x6004, 0xa082, 0x0040, 0x0079, 0x5af0,
- 0xa186, 0x0047, 0x10c0, 0x1288, 0x2001, 0x0109, 0x2004, 0xd084,
- 0x0040, 0x5aed, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e,
- 0x1078, 0x42ff, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x5aed, 0x0078, 0x5b47, 0x1078, 0x5609, 0x007c,
- 0x5b02, 0x5b00, 0x5b00, 0x5b00, 0x5b00, 0x5b00, 0x5b00, 0x5b00,
- 0x5b00, 0x5b00, 0x5b00, 0x5b19, 0x5b19, 0x5b19, 0x5b19, 0x5b00,
- 0x1078, 0x1288, 0x1078, 0x479a, 0x0d7e, 0x6110, 0x2168, 0x1078,
- 0x6216, 0x0040, 0x5b13, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078,
- 0x3720, 0x1078, 0x632a, 0x0d7f, 0x1078, 0x55d5, 0x1078, 0x4893,
- 0x007c, 0x1078, 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c,
- 0x5b32, 0x5b30, 0x5b30, 0x5b30, 0x5b30, 0x5b30, 0x5b30, 0x5b30,
- 0x5b30, 0x5b30, 0x5b30, 0x5b40, 0x5b40, 0x5b40, 0x5b40, 0x5b30,
- 0x1078, 0x1288, 0x1078, 0x479a, 0x6003, 0x0002, 0x1078, 0x4893,
- 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c,
- 0x1078, 0x479a, 0x6003, 0x000f, 0x1078, 0x4893, 0x007c, 0xa182,
- 0x0040, 0x0079, 0x5b4b, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b,
- 0x5b5d, 0x5be6, 0x5bfe, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b, 0x5b5b,
- 0x5b5b, 0x5b5b, 0x5b5b, 0x1078, 0x1288, 0x0e7e, 0x0d7e, 0x2071,
- 0x738c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040,
- 0x5bca, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5b8f, 0xa186,
- 0x0028, 0x00c0, 0x5b79, 0x1078, 0x633e, 0x684b, 0x001c, 0x0078,
- 0x5b91, 0xd6dc, 0x0040, 0x5b84, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5b91, 0xd6d4, 0x0040, 0x5b8f, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5b91, 0x684b,
- 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x5ba4,
- 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7398, 0xad90,
- 0x0019, 0x1078, 0x6008, 0x037f, 0xd6cc, 0x0040, 0x5bda, 0x7124,
- 0x695a, 0xa192, 0x0021, 0x00c8, 0x5bb8, 0x2071, 0x7398, 0x831c,
- 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6008, 0x0078, 0x5bda,
- 0x6838, 0xd0fc, 0x0040, 0x5bc1, 0x2009, 0x0020, 0x695a, 0x0078,
- 0x5bad, 0x0f7e, 0x2d78, 0x1078, 0x5fa0, 0x0f7f, 0x1078, 0x5ff5,
- 0x0078, 0x5bdc, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0x684c,
- 0xd0ac, 0x0040, 0x5bda, 0x6810, 0x6914, 0xa115, 0x0040, 0x5bda,
- 0x1078, 0x5d4e, 0x1078, 0x3720, 0x6218, 0x2268, 0x6a3c, 0x8211,
- 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x55d5, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
+ 0xa582, 0x0080, 0x0048, 0x4f7e, 0x2011, 0x0000, 0x629e, 0x6017,
+ 0x0012, 0x0078, 0x4f34, 0xd5bc, 0x0040, 0x4f8e, 0xa185, 0x0700,
+ 0x20a2, 0x6266, 0x636a, 0x646e, 0x0078, 0x4f94, 0x6063, 0x0700,
+ 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000,
+ 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
+ 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010,
+ 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab,
+ 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048,
+ 0x4fbb, 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078, 0x4f34,
+ 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202,
+ 0x8217, 0x007c, 0x0d7e, 0x2069, 0x6f10, 0x6843, 0x0001, 0x0d7f,
+ 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
+ 0x4fdc, 0x1078, 0x4143, 0x007c, 0x007e, 0x6014, 0xa084, 0x0004,
+ 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061,
+ 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f,
+ 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078, 0x414c,
+ 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040,
+ 0x503a, 0x1078, 0x4fe5, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e,
+ 0x2061, 0x6f10, 0x6128, 0xa192, 0x0002, 0x00c8, 0x5027, 0x8108,
+ 0x612a, 0x613c, 0x0c7f, 0x81ff, 0x0040, 0x5035, 0x1078, 0x4143,
+ 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x5023, 0x6017,
+ 0x0012, 0x0078, 0x5035, 0x1078, 0x4fdc, 0x0078, 0x5035, 0x6124,
+ 0xa1e5, 0x0000, 0x0040, 0x5032, 0x1078, 0x6c76, 0x2009, 0x0014,
+ 0x1078, 0x5591, 0x0c7f, 0x0078, 0x5035, 0x027f, 0x017f, 0x0d7f,
+ 0x0c7f, 0x007c, 0x1078, 0x31cb, 0x0078, 0x5035, 0x0c7e, 0x0d7e,
+ 0x0e7e, 0x017e, 0x027e, 0x1078, 0x415a, 0x2071, 0x6f10, 0x713c,
+ 0x81ff, 0x0040, 0x5079, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
+ 0x017e, 0x017f, 0xa194, 0x4000, 0x0040, 0x507f, 0x6017, 0x0010,
+ 0x7144, 0xa192, 0x0002, 0x00c8, 0x5071, 0x8108, 0x7146, 0x1078,
+ 0x4151, 0x713c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0,
+ 0x506d, 0x6017, 0x0012, 0x0078, 0x5079, 0x6017, 0x0016, 0x0078,
+ 0x5079, 0x1078, 0x6c76, 0x2009, 0x004a, 0x1078, 0x5591, 0x0078,
+ 0x5079, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x1078,
+ 0x4151, 0x0078, 0x5079, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e,
+ 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0,
+ 0x2071, 0x6f10, 0x7018, 0x2068, 0x8dff, 0x0040, 0x50af, 0x68a0,
+ 0xa406, 0x0040, 0x509f, 0x6854, 0x2068, 0x0078, 0x5094, 0x6010,
+ 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f, 0x2d60, 0x1078,
+ 0x3522, 0x0040, 0x50af, 0x1078, 0x5374, 0xa085, 0x0001, 0x127f,
+ 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4a83, 0x20a3, 0x0f00,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008,
+ 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4afa, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a9,
+ 0x0006, 0x2011, 0x6d40, 0x2019, 0x6d40, 0x23a6, 0x22a6, 0xa398,
+ 0x0002, 0xa290, 0x0002, 0x00f0, 0x50dd, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x001c, 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c,
+ 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b, 0x1078, 0x4ada,
+ 0x1078, 0x4af1, 0x7810, 0x007e, 0xa080, 0x0015, 0x2098, 0x7808,
+ 0xa088, 0x0002, 0x21a8, 0x53a6, 0xa080, 0x0004, 0x8003, 0x60c2,
+ 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078, 0x4fd1, 0x027f,
+ 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4a83, 0x20a3, 0x6200, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4fd1, 0x147f, 0x157f,
+ 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
+ 0x6f10, 0x700c, 0x2060, 0x8cff, 0x0040, 0x513f, 0x600c, 0x007e,
+ 0x1078, 0x556a, 0x1078, 0x5374, 0x0c7f, 0x0078, 0x5133, 0x700f,
+ 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c,
+ 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e,
+ 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
+ 0x6f10, 0x7024, 0x2060, 0x8cff, 0x0040, 0x5198, 0x1078, 0x4fe5,
+ 0x68c3, 0x0000, 0x1078, 0x414c, 0x2009, 0x0013, 0x1078, 0x5591,
+ 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x517b, 0x6827, 0x0004,
+ 0x7804, 0xa084, 0x4000, 0x0040, 0x518d, 0x7803, 0x1000, 0x7803,
+ 0x0000, 0x0078, 0x518d, 0xd084, 0x0040, 0x5182, 0x6827, 0x0001,
+ 0x0078, 0x5184, 0x00f0, 0x516a, 0x7804, 0xa084, 0x1000, 0x0040,
+ 0x518d, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f,
+ 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
+ 0x2001, 0x6d00, 0x2004, 0xa096, 0x0001, 0x0040, 0x51d0, 0xa096,
+ 0x0004, 0x0040, 0x51d0, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
+ 0x318e, 0x1078, 0x40d1, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040,
+ 0x51be, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x51d0,
+ 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x51d0, 0xd084, 0x0040,
+ 0x51c5, 0x6827, 0x0001, 0x0078, 0x51c7, 0x00f0, 0x51ad, 0x7804,
+ 0xa084, 0x1000, 0x0040, 0x51d0, 0x7803, 0x0100, 0x7803, 0x0000,
+ 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
+ 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079,
+ 0x0140, 0x2071, 0x6f10, 0x703c, 0x2060, 0x8cff, 0x0040, 0x5228,
+ 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x415a,
+ 0x1078, 0x1a20, 0xa39d, 0x0000, 0x00c0, 0x5202, 0x2009, 0x0049,
+ 0x1078, 0x5591, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x5215,
+ 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5227, 0x7803,
+ 0x1000, 0x7803, 0x0000, 0x0078, 0x5227, 0xd094, 0x0040, 0x521c,
+ 0x6827, 0x0002, 0x0078, 0x521e, 0x00f0, 0x5204, 0x7804, 0xa084,
+ 0x1000, 0x0040, 0x5227, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
+ 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
+ 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x6f10,
+ 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
+ 0x2069, 0x6f10, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x6f10, 0x7614, 0x2660,
+ 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x5286, 0x601c, 0xa206,
+ 0x00c0, 0x5281, 0x7014, 0xac36, 0x00c0, 0x5260, 0x660c, 0x7616,
+ 0x7010, 0xac36, 0x00c0, 0x526e, 0x2c00, 0xaf36, 0x0040, 0x526c,
+ 0x2f00, 0x7012, 0x0078, 0x526e, 0x7013, 0x0000, 0x660c, 0x067e,
+ 0x2c00, 0xaf06, 0x0040, 0x5277, 0x7e0e, 0x0078, 0x5278, 0x2678,
+ 0x600f, 0x0000, 0x1078, 0x6283, 0x1078, 0x5374, 0x0c7f, 0x0078,
+ 0x5253, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5253, 0x127f, 0x007f,
+ 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x52cf, 0x157e, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x52cf, 0x157e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2, 0xa006,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x52cf,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c93, 0x7810, 0x20a2,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078,
+ 0x537f, 0x60c3, 0x0020, 0x1078, 0x4fd1, 0x147f, 0x157f, 0x007c,
+ 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4,
+ 0x00c0, 0x52e7, 0xd1bc, 0x00c0, 0x5331, 0x0078, 0x5371, 0x2009,
+ 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140,
+ 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040,
+ 0x5328, 0x6020, 0xd0b4, 0x0040, 0x5328, 0x6024, 0xd094, 0x00c0,
+ 0x5328, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5328,
+ 0x00f0, 0x52f4, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130,
+ 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91,
+ 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094,
+ 0x00c0, 0x5327, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x531e, 0x027f,
+ 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078,
+ 0x5371, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e,
+ 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084,
+ 0x4000, 0x0040, 0x536a, 0x6020, 0xd0bc, 0x0040, 0x536a, 0x2104,
+ 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x536a, 0x00f0, 0x533e,
+ 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff,
+ 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001,
+ 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0,
+ 0x5364, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b,
+ 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x6f10, 0x7020,
+ 0xa005, 0x0040, 0x537d, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9,
+ 0x0008, 0x20a2, 0x00f0, 0x5381, 0x20a2, 0x20a2, 0x007c, 0x0f7e,
+ 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6f10, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001,
+ 0x87ff, 0x0040, 0x5417, 0x8cff, 0x0040, 0x5417, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x5412, 0x88ff, 0x0040, 0x53ae, 0x2800, 0xac06,
+ 0x00c0, 0x5412, 0x2039, 0x0000, 0x0078, 0x53b2, 0x6018, 0xa206,
+ 0x00c0, 0x5412, 0x7024, 0xac06, 0x00c0, 0x53e0, 0x2069, 0x0100,
+ 0x68c0, 0xa005, 0x0040, 0x53db, 0x6817, 0x0008, 0x68c3, 0x0000,
+ 0x1078, 0x54a4, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
+ 0xa384, 0x1000, 0x0040, 0x53d0, 0x6803, 0x0100, 0x6803, 0x0000,
+ 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x53d8, 0x6827, 0x0001,
+ 0x037f, 0x0078, 0x53e0, 0x6003, 0x0009, 0x630a, 0x0078, 0x5412,
+ 0x7014, 0xac36, 0x00c0, 0x53e6, 0x660c, 0x7616, 0x7010, 0xac36,
+ 0x00c0, 0x53f4, 0x2c00, 0xaf36, 0x0040, 0x53f2, 0x2f00, 0x7012,
+ 0x0078, 0x53f4, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
+ 0x0040, 0x53fd, 0x7e0e, 0x0078, 0x53fe, 0x2678, 0x600f, 0x0000,
+ 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5408, 0x1078, 0x6bb3,
+ 0x1078, 0x6283, 0x1078, 0x5374, 0x88ff, 0x00c0, 0x5421, 0x0c7f,
+ 0x0078, 0x5398, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5398, 0xa006,
+ 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5418,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x6f10, 0x7638, 0x2660, 0x2678, 0x8cff,
+ 0x0040, 0x5493, 0x601c, 0xa086, 0x0006, 0x00c0, 0x548e, 0x88ff,
+ 0x0040, 0x5448, 0x2800, 0xac06, 0x00c0, 0x548e, 0x0078, 0x544c,
+ 0x6018, 0xa206, 0x00c0, 0x548e, 0x703c, 0xac06, 0x00c0, 0x545e,
+ 0x037e, 0x2019, 0x0001, 0x1078, 0x51da, 0x7033, 0x0000, 0x703f,
+ 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36,
+ 0x00c0, 0x5464, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5472,
+ 0x2c00, 0xaf36, 0x0040, 0x5470, 0x2f00, 0x7036, 0x0078, 0x5472,
+ 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x547b,
+ 0x7e0e, 0x0078, 0x547c, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x5486, 0x1078, 0x6bb3, 0x1078, 0x6283,
+ 0x88ff, 0x00c0, 0x549d, 0x0c7f, 0x0078, 0x5437, 0x2c78, 0x600c,
+ 0x2060, 0x0078, 0x5437, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f,
+ 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f,
+ 0xa8c5, 0x0001, 0x0078, 0x5494, 0x0e7e, 0x2071, 0x6f10, 0x2001,
+ 0x6d00, 0x2004, 0xa086, 0x0002, 0x00c0, 0x54b2, 0x7007, 0x0005,
+ 0x0078, 0x54b4, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
+ 0x6f10, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x54f4,
+ 0x2200, 0xac06, 0x00c0, 0x54ef, 0x7038, 0xac36, 0x00c0, 0x54d2,
+ 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x54e0, 0x2c00, 0xaf36,
+ 0x0040, 0x54de, 0x2f00, 0x7036, 0x0078, 0x54e0, 0x7037, 0x0000,
+ 0x660c, 0x2c00, 0xaf06, 0x0040, 0x54e8, 0x7e0e, 0x0078, 0x54e9,
+ 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x54f4, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x54c5, 0x127f, 0x007f, 0x027f, 0x067f,
+ 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x2061, 0x7400, 0x2a70, 0x7060,
+ 0x7046, 0x704b, 0x7400, 0x007c, 0x0e7e, 0x127e, 0x2071, 0x6d00,
+ 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048, 0x5536, 0x7048,
+ 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5522, 0xace0, 0x0008,
+ 0x7054, 0xac02, 0x00c8, 0x551e, 0x0078, 0x5511, 0x2061, 0x7400,
+ 0x0078, 0x5511, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008,
+ 0x7054, 0xa502, 0x00c8, 0x5532, 0x754a, 0xa085, 0x0001, 0x127f,
+ 0x0e7f, 0x007c, 0x704b, 0x7400, 0x0078, 0x552d, 0xa006, 0x0078,
+ 0x552f, 0x0e7e, 0x2071, 0x6d00, 0x7544, 0xa582, 0x0001, 0x0048,
+ 0x5567, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5554,
+ 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5550, 0x0078, 0x5543,
+ 0x2061, 0x7400, 0x0078, 0x5543, 0x6003, 0x0008, 0x8529, 0x7546,
+ 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5563, 0x754a, 0xa085,
+ 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7400, 0x0078, 0x555f, 0xa006,
+ 0x0078, 0x5561, 0xac82, 0x7400, 0x1048, 0x12b7, 0x2001, 0x6d15,
+ 0x2004, 0xac02, 0x10c8, 0x12b7, 0xa006, 0x6006, 0x600a, 0x600e,
+ 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003, 0x0000, 0x2061,
+ 0x6d00, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001, 0x0040, 0x5589,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x0078,
+ 0x5588, 0x601c, 0xa084, 0x000f, 0x0079, 0x5596, 0x559f, 0x55a7,
+ 0x55c3, 0x55df, 0x629a, 0x62b6, 0x62d2, 0x559f, 0x55a7, 0xa18e,
+ 0x0047, 0x00c0, 0x55a6, 0xa016, 0x1078, 0x1532, 0x007c, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x55b1, 0x067f,
+ 0x007c, 0x55c1, 0x5698, 0x5792, 0x55c1, 0x57d7, 0x55c1, 0x55c1,
+ 0x55c1, 0x5653, 0x5a4d, 0x55c1, 0x55c1, 0x55c1, 0x55c1, 0x55c1,
+ 0x55c1, 0x1078, 0x12b7, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
+ 0x12b7, 0x1079, 0x55cd, 0x067f, 0x007c, 0x55dd, 0x55dd, 0x55dd,
+ 0x55dd, 0x55dd, 0x55dd, 0x55dd, 0x55dd, 0x5e10, 0x5edd, 0x55dd,
+ 0x5e29, 0x5e8f, 0x5e29, 0x5e8f, 0x55dd, 0x1078, 0x12b7, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x55e9, 0x067f,
+ 0x007c, 0x55f9, 0x5a96, 0x5b05, 0x5bbb, 0x5cd2, 0x55f9, 0x55f9,
+ 0x55f9, 0x5a75, 0x5dc6, 0x5dca, 0x55f9, 0x55f9, 0x55f9, 0x55f9,
+ 0x5df0, 0x1078, 0x12b7, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
+ 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398, 0x94a0, 0x3318,
+ 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8, 0x0002, 0xa398,
+ 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5609, 0x0e7e, 0x6010, 0x2070,
+ 0x7007, 0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x556a, 0x007c,
+ 0x0d7e, 0x037e, 0x7330, 0xa386, 0x0200, 0x00c0, 0x562d, 0x6018,
+ 0x2068, 0x6813, 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040,
+ 0x5637, 0x2068, 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078,
+ 0x556a, 0x037f, 0x0d7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98,
+ 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x5650, 0x6018,
+ 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802,
+ 0x0d7f, 0x0078, 0x5615, 0x2100, 0xa1b2, 0x0024, 0x10c8, 0x12b7,
+ 0x0079, 0x565a, 0x5680, 0x568c, 0x5680, 0x5680, 0x5680, 0x5680,
+ 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e,
+ 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e,
+ 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e, 0x567e,
+ 0x567e, 0x5680, 0x567e, 0x5680, 0x5680, 0x567e, 0x1078, 0x12b7,
+ 0x6003, 0x0001, 0x6106, 0x1078, 0x4376, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x476a, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078,
+ 0x4376, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c,
+ 0x6004, 0xa0b2, 0x0024, 0x10c8, 0x12b7, 0xa1b6, 0x0013, 0x00c0,
+ 0x56a4, 0x2008, 0x0079, 0x5706, 0xa1b6, 0x0014, 0x00c0, 0x56fd,
+ 0x1078, 0x4671, 0x6004, 0xa08e, 0x0000, 0x0040, 0x56fe, 0xa08e,
+ 0x0002, 0x0040, 0x56c9, 0xa08e, 0x0003, 0x0040, 0x56c9, 0xa08e,
+ 0x0004, 0x0040, 0x56c9, 0xa08e, 0x001f, 0x0040, 0x56fe, 0xa08e,
+ 0x0021, 0x0040, 0x5702, 0xa08e, 0x0022, 0x0040, 0x56fe, 0x0078,
+ 0x56f9, 0x1078, 0x206f, 0x2001, 0x0007, 0x1078, 0x33f3, 0x6018,
+ 0xa080, 0x0028, 0x200c, 0x1078, 0x5778, 0xa186, 0x007e, 0x00c0,
+ 0x56df, 0x2001, 0x6d2f, 0x2014, 0xa295, 0x0001, 0x2202, 0x017e,
+ 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078, 0x445c, 0x1078,
+ 0x43a9, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x56f0, 0x1078, 0x35cf,
+ 0x0c7f, 0x2c08, 0x1078, 0x6a57, 0x037f, 0x027f, 0x017f, 0x1078,
+ 0x342f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x1078, 0x5778,
+ 0x0078, 0x56f9, 0x1078, 0x5786, 0x0078, 0x56f9, 0x572c, 0x572e,
+ 0x5732, 0x5736, 0x573a, 0x573e, 0x572a, 0x572a, 0x572a, 0x572a,
+ 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a,
+ 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a, 0x572a,
+ 0x572a, 0x572a, 0x572a, 0x572a, 0x5742, 0x5748, 0x572a, 0x5752,
+ 0x5748, 0x572a, 0x1078, 0x12b7, 0x0078, 0x5748, 0x2001, 0x000b,
+ 0x0078, 0x575b, 0x2001, 0x0003, 0x0078, 0x575b, 0x2001, 0x0005,
+ 0x0078, 0x575b, 0x2001, 0x0001, 0x0078, 0x575b, 0x2001, 0x0009,
+ 0x0078, 0x575b, 0x1078, 0x12b7, 0x0078, 0x575a, 0x1078, 0x33f3,
+ 0x1078, 0x4671, 0x6003, 0x0002, 0x6017, 0x0028, 0x1078, 0x476a,
+ 0x0078, 0x575a, 0x1078, 0x4671, 0x6003, 0x0004, 0x6017, 0x0028,
+ 0x1078, 0x476a, 0x007c, 0x1078, 0x33f3, 0x1078, 0x4671, 0x6003,
+ 0x0002, 0x037e, 0x2019, 0x6d5c, 0x2304, 0xa084, 0xff00, 0x00c0,
+ 0x576d, 0x2019, 0x0028, 0x0078, 0x5772, 0x8007, 0x8003, 0x801b,
+ 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x476a, 0x0078, 0x575a,
+ 0x0e7e, 0x6010, 0xa005, 0x0040, 0x5784, 0x2070, 0x7007, 0x0000,
+ 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f, 0x007c, 0x0e7e, 0xacf0,
+ 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x7023, 0x8001,
+ 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff,
+ 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12b7, 0x6604, 0xa6b6, 0x001f,
+ 0x00c0, 0x57a6, 0x1078, 0x55fb, 0x0078, 0x57c6, 0x6604, 0xa6b6,
+ 0x0000, 0x00c0, 0x57af, 0x1078, 0x563c, 0x0078, 0x57c6, 0x6604,
+ 0xa6b6, 0x0022, 0x00c0, 0x57b8, 0x1078, 0x5620, 0x0078, 0x57c6,
+ 0xa1b6, 0x0015, 0x00c0, 0x57c0, 0x1079, 0x57cb, 0x0078, 0x57c6,
+ 0xa1b6, 0x0016, 0x00c0, 0x57c7, 0x1079, 0x58f6, 0x007c, 0x1078,
+ 0x559f, 0x0078, 0x57c6, 0x57ef, 0x57f2, 0x57ef, 0x5833, 0x57ef,
+ 0x5892, 0x57ef, 0x57ef, 0x57ef, 0x58ce, 0x57ef, 0x58e4, 0xa1b6,
+ 0x0048, 0x0040, 0x57e3, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1532, 0x007c, 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000,
+ 0x2070, 0x7037, 0x0103, 0x0e7f, 0x1078, 0x556a, 0x007c, 0x0005,
+ 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6d00, 0x7078, 0xa086, 0x0074,
+ 0x00c0, 0x581c, 0x1078, 0x6a2b, 0x00c0, 0x580e, 0x0d7e, 0x6018,
+ 0x2068, 0x1078, 0x5820, 0x0d7f, 0x2001, 0x0006, 0x1078, 0x33f3,
+ 0x1078, 0x206f, 0x1078, 0x556a, 0x0078, 0x581e, 0x2001, 0x000a,
+ 0x1078, 0x33f3, 0x1078, 0x206f, 0x6003, 0x0001, 0x6007, 0x0001,
+ 0x1078, 0x4376, 0x0078, 0x581e, 0x1078, 0x5889, 0x0e7f, 0x007c,
+ 0x6800, 0xd084, 0x0040, 0x5832, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2069, 0x6d51, 0x6804, 0xd0a4, 0x0040, 0x5832, 0x2001, 0x0006,
+ 0x1078, 0x3401, 0x007c, 0x0d7e, 0x2011, 0x6d1e, 0x2204, 0xa086,
+ 0x0074, 0x00c0, 0x5885, 0x1078, 0x599f, 0x6018, 0x2068, 0xa080,
+ 0x0028, 0x2014, 0xa286, 0x007e, 0x0040, 0x5850, 0xa286, 0x0080,
+ 0x00c0, 0x5879, 0x6813, 0x00ff, 0x6817, 0xfffc, 0x0078, 0x586f,
+ 0x0e7e, 0x0f7e, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x6d2f,
+ 0x2e04, 0xa085, 0x0003, 0x2072, 0x2071, 0x7280, 0x2079, 0x0100,
+ 0x2e04, 0xa084, 0x00ff, 0x2069, 0x6d19, 0x206a, 0x78e6, 0x8e70,
+ 0x2e04, 0x2069, 0x6d1a, 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001,
+ 0x0006, 0x1078, 0x33f3, 0x1078, 0x206f, 0x1078, 0x556a, 0x0078,
+ 0x5887, 0x2001, 0x0004, 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007,
+ 0x0003, 0x1078, 0x4376, 0x0078, 0x5887, 0x1078, 0x5889, 0x0d7f,
+ 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078, 0x206f, 0x1078,
+ 0x556a, 0x007c, 0x0e7e, 0x2071, 0x6d00, 0x7078, 0xa086, 0x0014,
+ 0x00c0, 0x58c8, 0x7000, 0xa086, 0x0003, 0x00c0, 0x58a5, 0x6010,
+ 0xa005, 0x00c0, 0x58a5, 0x1078, 0x2ad1, 0x0d7e, 0x6018, 0x2068,
+ 0x1078, 0x34ca, 0x1078, 0x5820, 0x0d7f, 0x1078, 0x59a9, 0x00c0,
+ 0x58c8, 0x2001, 0x0006, 0x1078, 0x33f3, 0x0e7e, 0x6010, 0xa005,
+ 0x0040, 0x58c1, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033,
+ 0x0200, 0x0e7f, 0x1078, 0x206f, 0x1078, 0x556a, 0x0078, 0x58cc,
+ 0x1078, 0x5778, 0x1078, 0x5889, 0x0e7f, 0x007c, 0x2011, 0x6d1e,
+ 0x2204, 0xa086, 0x0014, 0x00c0, 0x58e1, 0x2001, 0x0002, 0x1078,
+ 0x33f3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4376, 0x0078,
+ 0x58e3, 0x1078, 0x5889, 0x007c, 0x2011, 0x6d1e, 0x2204, 0xa086,
+ 0x0004, 0x00c0, 0x58f3, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078,
+ 0x556a, 0x0078, 0x58f5, 0x1078, 0x5889, 0x007c, 0x57ef, 0x5902,
+ 0x57ef, 0x5928, 0x57ef, 0x5952, 0x57ef, 0x57ef, 0x57ef, 0x5967,
+ 0x57ef, 0x597a, 0x0c7e, 0x1078, 0x598d, 0x00c0, 0x5917, 0x2001,
+ 0x0000, 0x1078, 0x33df, 0x2001, 0x0002, 0x1078, 0x33f3, 0x6003,
+ 0x0001, 0x6007, 0x0002, 0x1078, 0x4376, 0x0078, 0x5926, 0x2009,
+ 0x728f, 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5924,
+ 0x1078, 0x556a, 0x0078, 0x5926, 0x1078, 0x5889, 0x0c7f, 0x007c,
+ 0x1078, 0x599c, 0x00c0, 0x593c, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2001, 0x0002, 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4376, 0x0078, 0x5951, 0x1078, 0x5778, 0x2009, 0x728f,
+ 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x594f, 0x2001,
+ 0x0004, 0x1078, 0x33f3, 0x1078, 0x556a, 0x0078, 0x5951, 0x1078,
+ 0x5889, 0x007c, 0x1078, 0x599c, 0x00c0, 0x5962, 0x2001, 0x0004,
+ 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4376,
+ 0x0078, 0x5966, 0x1078, 0x5778, 0x1078, 0x5889, 0x007c, 0x1078,
+ 0x599c, 0x00c0, 0x5977, 0x2001, 0x0008, 0x1078, 0x33f3, 0x6003,
+ 0x0001, 0x6007, 0x0005, 0x1078, 0x4376, 0x0078, 0x5979, 0x1078,
+ 0x5889, 0x007c, 0x1078, 0x599c, 0x00c0, 0x598a, 0x2001, 0x000a,
+ 0x1078, 0x33f3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4376,
+ 0x0078, 0x598c, 0x1078, 0x5889, 0x007c, 0x2009, 0x728e, 0x2104,
+ 0xa086, 0x0003, 0x00c0, 0x599b, 0x2009, 0x728f, 0x2104, 0xa084,
+ 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e,
+ 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x3459, 0x017f, 0x0c7f,
+ 0x007c, 0x0e7e, 0x2071, 0x728c, 0x7004, 0xa086, 0x0014, 0x00c0,
+ 0x59cc, 0x7008, 0xa086, 0x0800, 0x00c0, 0x59cc, 0x700c, 0xd0ec,
+ 0x0040, 0x59ca, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x59ca,
+ 0x7024, 0xd0a4, 0x0040, 0x59ca, 0xd08c, 0x0040, 0x59ca, 0xa006,
+ 0x0078, 0x59cc, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e,
+ 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x6f19, 0x252c, 0x2021, 0x6f1f, 0x2424, 0x2061,
+ 0x7400, 0x2071, 0x6d00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5a23,
+ 0x1078, 0x6c0f, 0x0040, 0x5a1b, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x5a1b, 0xa786, 0x0007, 0x0040, 0x5a1b, 0x2500, 0xac06, 0x0040,
+ 0x5a1b, 0x2400, 0xac06, 0x0040, 0x5a1b, 0x0c7e, 0x6010, 0x2068,
+ 0x1078, 0x6120, 0x0040, 0x5a11, 0xa786, 0x0003, 0x00c0, 0x5a2d,
+ 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078,
+ 0x6276, 0x6000, 0xa086, 0x0004, 0x00c0, 0x5a18, 0x1078, 0x15f2,
+ 0x1078, 0x6283, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x5a23, 0x0078, 0x59e3, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x5a08, 0x1078, 0x6bb3, 0x0078, 0x5a11, 0x220c, 0x2304, 0xa106,
+ 0x00c0, 0x5a40, 0x8210, 0x8318, 0x00f0, 0x5a35, 0xa006, 0x007c,
+ 0x2304, 0xa102, 0x0048, 0x5a48, 0x2001, 0x0001, 0x0078, 0x5a4a,
+ 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0024,
+ 0x10c8, 0x12b7, 0xa08e, 0x0000, 0x0040, 0x5a71, 0xa08e, 0x0002,
+ 0x0040, 0x5a68, 0xa08e, 0x0003, 0x0040, 0x5a68, 0xa08e, 0x0004,
+ 0x0040, 0x5a68, 0xa08e, 0x001f, 0x0040, 0x5a71, 0x0078, 0x5a6a,
+ 0x1078, 0x206f, 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a,
+ 0x007c, 0x1078, 0x5778, 0x0078, 0x5a6a, 0xa182, 0x0040, 0x0079,
+ 0x5a79, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a88,
+ 0x5a88, 0x5a88, 0x5a88, 0x5a88, 0x5a8a, 0x5a8a, 0x5a8a, 0x5a8a,
+ 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106, 0x1078, 0x4327, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c, 0xa186, 0x0013,
+ 0x00c0, 0x5a9f, 0x6004, 0xa082, 0x0040, 0x0079, 0x5adf, 0xa186,
+ 0x0014, 0x10c0, 0x12b7, 0x6004, 0xa082, 0x0040, 0x0079, 0x5aa8,
+ 0x5ab9, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7, 0x5ab7,
+ 0x5ab7, 0x5ab7, 0x5ab7, 0x5ad4, 0x5ad4, 0x5ad4, 0x5ad4, 0x1078,
+ 0x12b7, 0x2001, 0x0007, 0x1078, 0x33f3, 0x1078, 0x4671, 0x0d7e,
+ 0x6110, 0x2168, 0x1078, 0x6120, 0x0040, 0x5ace, 0x6837, 0x0103,
+ 0x684b, 0x0028, 0x1078, 0x36a1, 0x1078, 0x6276, 0x0d7f, 0x1078,
+ 0x556a, 0x1078, 0x476a, 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3,
+ 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x5af0,
+ 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee, 0x5aee,
+ 0x5aee, 0x5aee, 0x5afe, 0x5afe, 0x5afe, 0x5afe, 0x1078, 0x12b7,
+ 0x1078, 0x4671, 0x6003, 0x0002, 0x1078, 0x476a, 0x6010, 0xa088,
+ 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, 0x4671,
+ 0x6003, 0x000f, 0x1078, 0x476a, 0x007c, 0xa182, 0x0040, 0x0079,
+ 0x5b09, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b1a, 0x5b98,
+ 0x5bb0, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18, 0x5b18,
+ 0x1078, 0x12b7, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2168,
+ 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x5b87, 0xa68c, 0x00ff,
+ 0xa186, 0x0002, 0x0040, 0x5b4c, 0xa186, 0x0028, 0x00c0, 0x5b36,
+ 0x1078, 0x628a, 0x684b, 0x001c, 0x0078, 0x5b4e, 0xd6dc, 0x0040,
+ 0x5b41, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5b4e, 0xd6d4, 0x0040, 0x5b4c, 0x684b, 0x0007, 0x7318, 0x6b62,
+ 0x731c, 0x6b5e, 0x0078, 0x5b4e, 0x684b, 0x0000, 0x6837, 0x0103,
+ 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x5b61, 0x7328, 0x732c, 0x6b56,
+ 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078, 0x5f4c,
+ 0x037f, 0xd6cc, 0x0040, 0x5b8c, 0x7124, 0x695a, 0xa192, 0x0021,
+ 0x00c8, 0x5b75, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18, 0xad90,
+ 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5b8c, 0x6838, 0xd0fc, 0x0040,
+ 0x5b7e, 0x2009, 0x0020, 0x695a, 0x0078, 0x5b6a, 0x0f7e, 0x2d78,
+ 0x1078, 0x5ee4, 0x0f7f, 0x1078, 0x5f39, 0x0078, 0x5b8e, 0x684b,
+ 0x0000, 0x6837, 0x0103, 0x6e46, 0x1078, 0x36a1, 0x6218, 0x2268,
+ 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x556a, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x728c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x17de, 0x1078, 0x4395, 0x1078, 0x4821, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1532, 0x007c, 0xa182, 0x0040, 0x0079, 0x5bbf, 0x5bce,
+ 0x5bce, 0x5bce, 0x5bce, 0x5bce, 0x5bd0, 0x5c5e, 0x5bce, 0x5bce,
+ 0x5c74, 0x5cb4, 0x5bce, 0x5bce, 0x5bce, 0x5bce, 0x1078, 0x12b7,
+ 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2178,
+ 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218,
+ 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5c59, 0xa694,
+ 0xff00, 0xa284, 0x0c00, 0x0040, 0x5bf1, 0x7018, 0x7862, 0x701c,
+ 0x785e, 0xa284, 0x0300, 0x0040, 0x5c59, 0x1078, 0x130f, 0x1040,
+ 0x12b7, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103,
+ 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
+ 0x00ff, 0xa186, 0x0002, 0x0040, 0x5c2b, 0xa186, 0x0028, 0x00c0,
+ 0x5c15, 0x684b, 0x001c, 0x0078, 0x5c2d, 0xd6dc, 0x0040, 0x5c20,
+ 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5c2d,
+ 0xd6d4, 0x0040, 0x5c2b, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
+ 0x6b5e, 0x0078, 0x5c2d, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
+ 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5c42, 0x7328, 0x732c,
+ 0x6b56, 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078,
+ 0x5f4c, 0x037f, 0xd6cc, 0x0040, 0x5c59, 0x7124, 0x695a, 0xa192,
+ 0x0021, 0x00c8, 0x5c56, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18,
+ 0xad90, 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5c59, 0x2d78, 0x1078,
+ 0x5ee4, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003,
+ 0x0003, 0x2079, 0x728c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x44aa, 0x1078, 0x4943, 0x007c, 0x6003, 0x0004,
- 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x5c0d, 0x5c1d, 0x5c1d, 0x5c1d,
- 0x5c1d, 0x5c1d, 0x5c1f, 0x5cb6, 0x5c1d, 0x5c1d, 0x5ccc, 0x5d2e,
- 0x5c1d, 0x5c1d, 0x5c1d, 0x5c1d, 0x5d35, 0x1078, 0x1288, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x738c, 0x6110, 0x2178, 0x7614,
+ 0x17de, 0x1078, 0x4fca, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078,
+ 0x4719, 0x1078, 0x4821, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040,
+ 0x5cb2, 0xd1cc, 0x0040, 0x5c8d, 0x6948, 0x017e, 0x1078, 0x1338,
+ 0x0d7f, 0x1078, 0x5f39, 0x0078, 0x5cb0, 0x6837, 0x0103, 0x6944,
+ 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5cac, 0xa086, 0x0028,
+ 0x00c0, 0x5c9e, 0x684b, 0x001c, 0x0078, 0x5cae, 0xd1dc, 0x0040,
+ 0x5ca5, 0x684b, 0x0015, 0x0078, 0x5cae, 0xd1d4, 0x0040, 0x5cac,
+ 0x684b, 0x0007, 0x0078, 0x5cae, 0x684b, 0x0000, 0x1078, 0x36a1,
+ 0x1078, 0x556a, 0x0d7f, 0x007c, 0x2001, 0x0007, 0x1078, 0x33f3,
+ 0x1078, 0x4719, 0x0f7e, 0x0d7e, 0x6110, 0x2178, 0x1078, 0x6120,
+ 0x0040, 0x5ccb, 0x7837, 0x0103, 0x784b, 0x0028, 0x2f68, 0x1078,
+ 0x36a1, 0x1078, 0x6276, 0x0d7f, 0x0f7f, 0x1078, 0x556a, 0x1078,
+ 0x4821, 0x007c, 0xa182, 0x0040, 0x0079, 0x5cd6, 0x5ce5, 0x5ce5,
+ 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce7, 0x5ce5, 0x5d82, 0x5d8a, 0x5ce5,
+ 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce5, 0x5ce5, 0x1078, 0x12b7, 0x077e,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x728c, 0x6110, 0x2178, 0x7614,
0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5cb1, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x5c40, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x5cb1, 0x1078, 0x12e2, 0x1040, 0x1288,
- 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838,
- 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x5c7a, 0xa186, 0x0028, 0x00c0, 0x5c64,
- 0x684b, 0x001c, 0x0078, 0x5c7c, 0xd6dc, 0x0040, 0x5c6f, 0x684b,
- 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5c7c, 0xd6d4,
- 0x0040, 0x5c7a, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e,
- 0x0078, 0x5c7c, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854,
- 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5c91, 0x7328, 0x732c, 0x6b56,
- 0x037e, 0x2308, 0x2019, 0x7398, 0xad90, 0x0019, 0x1078, 0x6008,
- 0x037f, 0xd6cc, 0x0040, 0x5cb1, 0x7124, 0x695a, 0xa192, 0x0021,
- 0x00c8, 0x5ca5, 0x2071, 0x7398, 0x831c, 0x2300, 0xae18, 0xad90,
- 0x001d, 0x1078, 0x6008, 0x0078, 0x5cb1, 0x7838, 0xd0fc, 0x0040,
- 0x5cae, 0x2009, 0x0020, 0x695a, 0x0078, 0x5c9a, 0x2d78, 0x1078,
- 0x5fa0, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
- 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x4f73, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078,
- 0x4842, 0x1078, 0x4943, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040,
- 0x5d2c, 0xd1cc, 0x0040, 0x5d07, 0x6948, 0x6838, 0xd0fc, 0x0040,
- 0x5cff, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d,
- 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012,
- 0x8318, 0x8210, 0x00f0, 0x5cee, 0x157f, 0x007f, 0x6852, 0x007f,
- 0x684e, 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5d2a, 0x017e,
- 0x1078, 0x130b, 0x0d7f, 0x1078, 0x5ff5, 0x0078, 0x5d2a, 0x6837,
- 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5d26,
- 0xa086, 0x0028, 0x00c0, 0x5d18, 0x684b, 0x001c, 0x0078, 0x5d28,
- 0xd1dc, 0x0040, 0x5d1f, 0x684b, 0x0015, 0x0078, 0x5d28, 0xd1d4,
- 0x0040, 0x5d26, 0x684b, 0x0007, 0x0078, 0x5d28, 0x684b, 0x0000,
- 0x1078, 0x3720, 0x1078, 0x55d5, 0x0d7f, 0x007c, 0x6003, 0x0002,
- 0x1078, 0x4842, 0x1078, 0x4943, 0x007c, 0x1078, 0x4842, 0x1078,
- 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6216, 0x0040, 0x5d48,
- 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3720, 0x1078, 0x632a,
- 0x0d7f, 0x1078, 0x55d5, 0x1078, 0x4943, 0x007c, 0x684b, 0x0015,
- 0xd1fc, 0x0040, 0x5d5a, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a,
- 0xa189, 0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x5d61, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d73, 0x5d71,
- 0x5e17, 0x5e1f, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d71, 0x5d71,
- 0x5d71, 0x1078, 0x1288, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x738c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x5e09, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5d94,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5e06,
- 0x1078, 0x12e2, 0x1040, 0x1288, 0x2d00, 0x784a, 0x7f4c, 0xa7bd,
- 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e,
- 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
- 0x5dcf, 0xa186, 0x0028, 0x00c0, 0x5db9, 0x684b, 0x001c, 0x0078,
- 0x5dd1, 0xd6dc, 0x0040, 0x5dc4, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5dd1, 0xd6d4, 0x0040, 0x5dcf, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5dd1, 0x684b,
- 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4,
- 0x0040, 0x5de6, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
- 0x7398, 0xad90, 0x0019, 0x1078, 0x6008, 0x037f, 0xd6cc, 0x0040,
- 0x5e06, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5dfa, 0x2071,
- 0x7398, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6008,
- 0x0078, 0x5e06, 0x7838, 0xd0fc, 0x0040, 0x5e03, 0x2009, 0x0020,
- 0x695a, 0x0078, 0x5def, 0x2d78, 0x1078, 0x5fa0, 0xd6dc, 0x00c0,
- 0x5e0c, 0xa006, 0x0078, 0x5e10, 0x2001, 0x0001, 0x7218, 0x731c,
- 0x1078, 0x1569, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x007c, 0x0d7e,
- 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x5e86,
- 0xd1cc, 0x0040, 0x5e56, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x5e4e,
- 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198,
- 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x5e3d, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e,
- 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5e84, 0x017e, 0x1078,
- 0x130b, 0x0d7f, 0x1078, 0x5ff5, 0x0078, 0x5e84, 0x6837, 0x0103,
- 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5e75, 0xa086,
- 0x0028, 0x00c0, 0x5e67, 0x684b, 0x001c, 0x0078, 0x5e82, 0xd1dc,
- 0x0040, 0x5e6e, 0x684b, 0x0015, 0x0078, 0x5e82, 0xd1d4, 0x0040,
- 0x5e75, 0x684b, 0x0007, 0x0078, 0x5e82, 0x684b, 0x0000, 0x684c,
- 0xd0ac, 0x0040, 0x5e82, 0x6810, 0x6914, 0xa115, 0x0040, 0x5e82,
- 0x1078, 0x5d4e, 0x1078, 0x3720, 0x1078, 0x55d5, 0x0d7f, 0x007c,
- 0x1078, 0x479a, 0x0078, 0x5e8e, 0x1078, 0x4842, 0x1078, 0x6216,
- 0x0040, 0x5ea5, 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009,
- 0x6f0c, 0x210c, 0xd18c, 0x00c0, 0x5eae, 0xd184, 0x00c0, 0x5eaa,
- 0x6108, 0x694a, 0x1078, 0x3720, 0x0d7f, 0x1078, 0x55d5, 0x1078,
- 0x4893, 0x007c, 0x684b, 0x0004, 0x0078, 0x5ea2, 0x684b, 0x0004,
- 0x0078, 0x5ea2, 0xa182, 0x0040, 0x0079, 0x5eb6, 0x5ec6, 0x5ec6,
- 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec8, 0x5ec6, 0x5ecb, 0x5ec6, 0x5ec6,
- 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec6, 0x5ec6, 0x1078, 0x1288,
- 0x1078, 0x55d5, 0x007c, 0x007e, 0x027e, 0xa016, 0x1078, 0x1525,
- 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079, 0x5ed7, 0x5ee0,
- 0x5ede, 0x5ede, 0x5ede, 0x5ede, 0x5ede, 0x5ede, 0x1078, 0x1288,
- 0x6003, 0x0001, 0x6106, 0x1078, 0x443e, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x4893, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x5ef6,
- 0x6004, 0xa082, 0x0085, 0x2008, 0x0079, 0x5f2a, 0xa186, 0x0027,
- 0x00c0, 0x5f17, 0x1078, 0x479a, 0x1078, 0x21a8, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6216, 0x0040, 0x5f0d, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3720, 0x1078, 0x632a, 0x0d7f, 0x1078, 0x55d5,
- 0x1078, 0x4893, 0x007c, 0x1078, 0x5609, 0x0078, 0x5f12, 0xa186,
- 0x0014, 0x00c0, 0x5f13, 0x1078, 0x479a, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6216, 0x0040, 0x5f0d, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x0078, 0x5f09, 0x5f33, 0x5f31, 0x5f31, 0x5f31, 0x5f31, 0x5f31,
- 0x5f3c, 0x1078, 0x1288, 0x1078, 0x479a, 0x6017, 0x0014, 0x6003,
- 0x000c, 0x1078, 0x4893, 0x007c, 0x1078, 0x479a, 0x6017, 0x0014,
- 0x6003, 0x000e, 0x1078, 0x4893, 0x007c, 0xa182, 0x008c, 0x00c8,
- 0x5f4f, 0xa182, 0x0085, 0x0048, 0x5f4f, 0x0079, 0x5f52, 0x1078,
- 0x5609, 0x007c, 0x5f59, 0x5f59, 0x5f59, 0x5f59, 0x5f5b, 0x5f7a,
- 0x5f59, 0x1078, 0x1288, 0x0d7e, 0x1078, 0x632a, 0x1078, 0x6216,
- 0x0040, 0x5f76, 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4,
- 0x0040, 0x5f6e, 0x684b, 0x0006, 0x0078, 0x5f72, 0x684b, 0x0005,
- 0x1078, 0x63dd, 0x6847, 0x0000, 0x1078, 0x3720, 0x1078, 0x55d5,
- 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040,
- 0x5f95, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x5f8b, 0x684b,
- 0x0006, 0x0078, 0x5f8f, 0x684b, 0x0005, 0x1078, 0x63dd, 0x6847,
- 0x0000, 0x1078, 0x3720, 0x1078, 0x632a, 0x0d7f, 0x1078, 0x55d5,
- 0x007c, 0x1078, 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c,
- 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001, 0xa182, 0x0101,
- 0x00c8, 0x5fac, 0x0078, 0x5fae, 0x2009, 0x0100, 0x2130, 0x2069,
- 0x7398, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90, 0x001d,
- 0x1078, 0x6008, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0040, 0x5fc2,
- 0x1078, 0x130b, 0x1078, 0x12e2, 0x0040, 0x5fec, 0x8528, 0x6837,
- 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, 0x00c8,
- 0x5fd8, 0x2608, 0xad90, 0x000f, 0x1078, 0x6008, 0x0078, 0x5fec,
- 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90, 0x000f, 0x1078,
- 0x6008, 0x0078, 0x5fc2, 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36,
- 0xa5ac, 0x0000, 0x0078, 0x5ff1, 0x0f7f, 0x852f, 0xa5ad, 0x0003,
- 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e, 0x8dff, 0x0040,
- 0x6006, 0x6804, 0xa07d, 0x0040, 0x6004, 0x6807, 0x0000, 0x1078,
- 0x3720, 0x2f68, 0x0078, 0x5ff9, 0x1078, 0x3720, 0x0f7f, 0x007c,
- 0x157e, 0xa184, 0x0001, 0x0040, 0x600e, 0x8108, 0x810c, 0x21a8,
- 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6010, 0x157f,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084, 0x0007, 0x1079,
- 0x6023, 0x127f, 0x007c, 0x6032, 0x602b, 0x602d, 0x604b, 0x602b,
- 0x602d, 0x602d, 0x602d, 0x1078, 0x1288, 0xa006, 0x007c, 0xa085,
- 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6216, 0x0040,
- 0x6048, 0xa00e, 0x2001, 0x0005, 0x1078, 0x37b0, 0x1078, 0x63dd,
- 0x1078, 0x3720, 0x1078, 0x55d5, 0xa085, 0x0001, 0x0d7f, 0x007c,
- 0xa006, 0x0078, 0x6046, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288,
- 0x1079, 0x6053, 0x007c, 0x6063, 0x6080, 0x6065, 0x6091, 0x607c,
- 0x6063, 0x602d, 0x6032, 0x6032, 0x602d, 0x602d, 0x602d, 0x602d,
- 0x602d, 0x602d, 0x602d, 0x1078, 0x1288, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6216, 0x0040, 0x606e, 0x1078, 0x63dd, 0x0d7f, 0x6007,
- 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, 0x443e, 0x1078,
- 0x4893, 0xa085, 0x0001, 0x007c, 0x1078, 0x1629, 0x0078, 0x6065,
- 0x0e7e, 0x2071, 0x70b6, 0x7024, 0xac06, 0x00c0, 0x6089, 0x1078,
- 0x50a9, 0x1078, 0x5017, 0x0e7f, 0x00c0, 0x6065, 0x1078, 0x602d,
- 0x007c, 0x037e, 0x0e7e, 0x2071, 0x70b6, 0x703c, 0xac06, 0x00c0,
- 0x60a1, 0x2019, 0x0000, 0x1078, 0x513b, 0x0e7f, 0x037f, 0x0078,
- 0x6065, 0x1078, 0x5417, 0x0e7f, 0x037f, 0x00c0, 0x6065, 0x1078,
- 0x602d, 0x007c, 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x60b2,
- 0x0c7f, 0x007c, 0x60c0, 0x611d, 0x61ba, 0x60c4, 0x60c0, 0x60c0,
- 0x6a64, 0x55d5, 0x1078, 0x6364, 0x00c0, 0x60c0, 0x1078, 0x57d2,
- 0x007c, 0x6017, 0x0001, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8,
- 0x1288, 0x1079, 0x60cc, 0x007c, 0x60dc, 0x60de, 0x60fe, 0x6110,
- 0x6110, 0x60dc, 0x60c0, 0x60c0, 0x60c0, 0x6110, 0x6110, 0x60dc,
- 0x60dc, 0x60dc, 0x60dc, 0x611a, 0x1078, 0x1288, 0x0e7e, 0x6010,
- 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0x70b6, 0x7024, 0xac06,
- 0x0040, 0x60fa, 0x1078, 0x5017, 0x6007, 0x0085, 0x6003, 0x000b,
- 0x601f, 0x0002, 0x6017, 0x0014, 0x1078, 0x443e, 0x1078, 0x4893,
- 0x0e7f, 0x007c, 0x6017, 0x0001, 0x0078, 0x60f8, 0x0d7e, 0x6010,
- 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003,
- 0x000b, 0x601f, 0x0002, 0x1078, 0x443e, 0x1078, 0x4893, 0x007c,
- 0x0d7e, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852,
- 0x0d7f, 0x007c, 0x1078, 0x55d5, 0x007c, 0x6000, 0xa08a, 0x0010,
- 0x10c8, 0x1288, 0x1079, 0x6125, 0x007c, 0x6135, 0x60c1, 0x6137,
- 0x6135, 0x6135, 0x6135, 0x6135, 0x6135, 0x60ba, 0x60ba, 0x6135,
- 0x6135, 0x6135, 0x6135, 0x6135, 0x6135, 0x1078, 0x1288, 0x0d7e,
- 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c,
- 0x10c8, 0x1288, 0x1079, 0x6145, 0x007c, 0x6151, 0x616c, 0x6151,
- 0x616c, 0x6151, 0x616c, 0x6153, 0x615c, 0x6151, 0x616c, 0x6151,
- 0x6161, 0x1078, 0x1288, 0x6004, 0xa08e, 0x0004, 0x0040, 0x6163,
- 0xa08e, 0x0002, 0x0040, 0x6163, 0x6004, 0x1078, 0x6364, 0x0040,
- 0x61b6, 0x1078, 0x21a8, 0x1078, 0x6364, 0x00c0, 0x6169, 0x1078,
- 0x57d2, 0x1078, 0x55d5, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186,
- 0x0016, 0x0040, 0x61a6, 0xa186, 0x0002, 0x00c0, 0x6191, 0x6018,
- 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x6191, 0x8001,
- 0x6842, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0398, 0x1078,
- 0x556f, 0x0040, 0x6191, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078,
- 0x61a6, 0x0d7f, 0x0c7f, 0x1078, 0x6364, 0x00c0, 0x6199, 0x1078,
- 0x57d2, 0x1078, 0x21a8, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x21c6, 0x127f, 0x0e7f, 0x1078, 0x55d5, 0x007c, 0x2001, 0x0002,
- 0x1078, 0x3477, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x448b,
- 0x1078, 0x4893, 0x0d7f, 0x0c7f, 0x0078, 0x61a5, 0x1078, 0x57d2,
- 0x0078, 0x6169, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x61c2, 0x007c, 0x61d2, 0x61d2, 0x61d2, 0x61d2, 0x61d2, 0x61d2,
- 0x61d2, 0x61d2, 0x61d2, 0x60c0, 0x61d2, 0x60c1, 0x61d4, 0x60c1,
- 0x61dd, 0x61d2, 0x1078, 0x1288, 0x6007, 0x008b, 0x6003, 0x000d,
- 0x1078, 0x443e, 0x1078, 0x4893, 0x007c, 0x1078, 0x632a, 0x1078,
- 0x6216, 0x0040, 0x61ff, 0x1078, 0x21a8, 0x0d7e, 0x1078, 0x6216,
- 0x0040, 0x61f2, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x1078, 0x3720, 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003,
- 0x0001, 0x1078, 0x448b, 0x1078, 0x4893, 0x0078, 0x6201, 0x1078,
- 0x55d5, 0x007c, 0xa284, 0x0007, 0x00c0, 0x6213, 0xa282, 0x7500,
- 0x0048, 0x6213, 0x2001, 0x6f15, 0x2004, 0xa202, 0x00c8, 0x6213,
- 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x6212, 0x027e, 0x0e7e,
- 0x2071, 0x6f00, 0x6210, 0x7058, 0xa202, 0x0048, 0x6228, 0x705c,
- 0xa202, 0x00c8, 0x6228, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c,
- 0xa006, 0x0078, 0x6225, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2061, 0x7500, 0x2071, 0x6f00, 0x7344, 0x7060,
- 0xa302, 0x00c8, 0x6251, 0x601c, 0xa206, 0x00c0, 0x6249, 0x1078,
- 0x6364, 0x00c0, 0x6245, 0x1078, 0x57d2, 0x0c7e, 0x1078, 0x55d5,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6251, 0x0078,
- 0x6236, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e,
- 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x556f, 0x057f,
- 0x0040, 0x6270, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b,
- 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x626c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
- 0x62a0, 0x0c7e, 0x1078, 0x556f, 0x057f, 0x0040, 0x629a, 0x6013,
- 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x364c,
- 0x0c7f, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe,
- 0x2009, 0x004c, 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x057f,
- 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6296, 0x0c7e, 0x057e, 0x127e,
- 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x556f, 0x057f, 0x0040,
- 0x62c5, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e,
- 0x2560, 0x1078, 0x364c, 0x0c7f, 0x1078, 0x457b, 0x1078, 0x44be,
- 0x2c08, 0x1078, 0x6bfe, 0x2009, 0x004d, 0x1078, 0x55fc, 0xa085,
- 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x62c1,
+ 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5d74, 0xa694, 0xff00,
+ 0xa284, 0x0c00, 0x0040, 0x5d08, 0x7018, 0x7862, 0x701c, 0x785e,
+ 0xa284, 0x0300, 0x0040, 0x5d71, 0x1078, 0x130f, 0x1040, 0x12b7,
+ 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103,
+ 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
+ 0x00ff, 0xa186, 0x0002, 0x0040, 0x5d43, 0xa186, 0x0028, 0x00c0,
+ 0x5d2d, 0x684b, 0x001c, 0x0078, 0x5d45, 0xd6dc, 0x0040, 0x5d38,
+ 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5d45,
+ 0xd6d4, 0x0040, 0x5d43, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
+ 0x6b5e, 0x0078, 0x5d45, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
+ 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5d5a, 0x7328, 0x732c,
+ 0x6b56, 0x037e, 0x2308, 0x2019, 0x7298, 0xad90, 0x0019, 0x1078,
+ 0x5f4c, 0x037f, 0xd6cc, 0x0040, 0x5d71, 0x7124, 0x695a, 0xa192,
+ 0x0021, 0x00c8, 0x5d6e, 0x2071, 0x7298, 0x831c, 0x2300, 0xae18,
+ 0xad90, 0x001d, 0x1078, 0x5f4c, 0x0078, 0x5d71, 0x2d78, 0x1078,
+ 0x5ee4, 0xd6dc, 0x00c0, 0x5d77, 0xa006, 0x0078, 0x5d7b, 0x2001,
+ 0x0001, 0x7218, 0x731c, 0x1078, 0x156f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078,
+ 0x1532, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168, 0x694c,
+ 0xd1e4, 0x0040, 0x5dc4, 0xd1cc, 0x0040, 0x5d9f, 0x6948, 0x017e,
+ 0x1078, 0x1338, 0x0d7f, 0x1078, 0x5f39, 0x0078, 0x5dc2, 0x6837,
+ 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5dbe,
+ 0xa086, 0x0028, 0x00c0, 0x5db0, 0x684b, 0x001c, 0x0078, 0x5dc0,
+ 0xd1dc, 0x0040, 0x5db7, 0x684b, 0x0015, 0x0078, 0x5dc0, 0xd1d4,
+ 0x0040, 0x5dbe, 0x684b, 0x0007, 0x0078, 0x5dc0, 0x684b, 0x0000,
+ 0x1078, 0x36a1, 0x1078, 0x556a, 0x0d7f, 0x007c, 0x1078, 0x4671,
+ 0x0078, 0x5dcc, 0x1078, 0x4719, 0x1078, 0x6120, 0x0040, 0x5de3,
+ 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009, 0x6d0c, 0x210c,
+ 0xd18c, 0x00c0, 0x5dec, 0xd184, 0x00c0, 0x5de8, 0x6108, 0x694a,
+ 0x1078, 0x36a1, 0x0d7f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c,
+ 0x684b, 0x0004, 0x0078, 0x5de0, 0x684b, 0x0004, 0x0078, 0x5de0,
+ 0xa182, 0x0040, 0x0079, 0x5df4, 0x5e03, 0x5e03, 0x5e03, 0x5e03,
+ 0x5e03, 0x5e05, 0x5e03, 0x5e08, 0x5e03, 0x5e03, 0x5e03, 0x5e03,
+ 0x5e03, 0x5e03, 0x5e03, 0x1078, 0x12b7, 0x1078, 0x556a, 0x007c,
+ 0x007e, 0x027e, 0xa016, 0x1078, 0x1532, 0x027f, 0x007f, 0x007c,
+ 0xa182, 0x0025, 0x0079, 0x5e14, 0x5e1d, 0x5e1b, 0x5e1b, 0x5e1b,
+ 0x5e1b, 0x5e1b, 0x5e1b, 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106,
+ 0x1078, 0x4327, 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f,
+ 0x007c, 0xa186, 0x0013, 0x00c0, 0x5e33, 0x6004, 0xa082, 0x0025,
+ 0x2008, 0x0079, 0x5e74, 0xa186, 0x0014, 0x00c0, 0x5e70, 0x1078,
+ 0x4671, 0x2001, 0x0007, 0x1078, 0x33f3, 0x6018, 0xa080, 0x0028,
+ 0x200c, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078,
+ 0x445c, 0x1078, 0x43a9, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x5e52,
+ 0x1078, 0x35cf, 0x0c7f, 0x2c08, 0x1078, 0x6a57, 0x037f, 0x027f,
+ 0x017f, 0x1078, 0x342f, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120,
+ 0x0040, 0x5e6a, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x36a1,
+ 0x1078, 0x6276, 0x0d7f, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c,
+ 0x1078, 0x559f, 0x0078, 0x5e6f, 0x5e7d, 0x5e7b, 0x5e7b, 0x5e7b,
+ 0x5e7b, 0x5e7b, 0x5e86, 0x1078, 0x12b7, 0x1078, 0x4671, 0x6017,
+ 0x0014, 0x6003, 0x000c, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671,
+ 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x476a, 0x007c, 0xa182,
+ 0x002c, 0x00c8, 0x5e99, 0xa182, 0x0025, 0x0048, 0x5e99, 0x0079,
+ 0x5e9c, 0x1078, 0x559f, 0x007c, 0x5ea3, 0x5ea3, 0x5ea3, 0x5ea3,
+ 0x5ea5, 0x5ebf, 0x5ea3, 0x1078, 0x12b7, 0x0d7e, 0x1078, 0x6276,
+ 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xa084, 0x0040, 0x0040,
+ 0x5eb5, 0x684b, 0x0006, 0x0078, 0x5eb7, 0x684b, 0x0005, 0x6847,
+ 0x0000, 0x1078, 0x36a1, 0x1078, 0x556a, 0x0d7f, 0x007c, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5ed9, 0x6837, 0x0103,
+ 0x6850, 0xa084, 0x0040, 0x0040, 0x5ed1, 0x684b, 0x0006, 0x0078,
+ 0x5ed3, 0x684b, 0x0005, 0x6847, 0x0000, 0x1078, 0x36a1, 0x1078,
+ 0x6276, 0x0d7f, 0x1078, 0x556a, 0x007c, 0x1078, 0x4671, 0x1078,
+ 0x556a, 0x1078, 0x476a, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e,
+ 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, 0x5ef0, 0x0078, 0x5ef2,
+ 0x2009, 0x0100, 0x2130, 0x2069, 0x7298, 0x831c, 0x2300, 0xad18,
+ 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, 0x5f4c, 0xa6b2, 0x0020,
+ 0x7804, 0xa06d, 0x0040, 0x5f06, 0x1078, 0x1338, 0x1078, 0x130f,
+ 0x0040, 0x5f30, 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20,
+ 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x5f1c, 0x2608, 0xad90, 0x000f,
+ 0x1078, 0x5f4c, 0x0078, 0x5f30, 0xa6b2, 0x003c, 0x2009, 0x003c,
+ 0x2d78, 0xad90, 0x000f, 0x1078, 0x5f4c, 0x0078, 0x5f06, 0x0f7f,
+ 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x5f35,
+ 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f,
+ 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x5f4a, 0x6804, 0xa07d, 0x0040,
+ 0x5f48, 0x6807, 0x0000, 0x1078, 0x36a1, 0x2f68, 0x0078, 0x5f3d,
+ 0x1078, 0x36a1, 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040,
+ 0x5f52, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318,
+ 0x8210, 0x00f0, 0x5f54, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000,
+ 0x601c, 0xa084, 0x000f, 0x1079, 0x5f67, 0x127f, 0x007c, 0x5f76,
+ 0x5f6f, 0x5f71, 0x5f8d, 0x5f6f, 0x5f71, 0x5f71, 0x5f71, 0x1078,
+ 0x12b7, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010,
+ 0x2068, 0x1078, 0x6120, 0x0040, 0x5f8a, 0xa00e, 0x2001, 0x0005,
+ 0x1078, 0x372d, 0x1078, 0x36a1, 0x1078, 0x556a, 0xa085, 0x0001,
+ 0x0d7f, 0x007c, 0xa006, 0x0078, 0x5f88, 0x6000, 0xa08a, 0x0010,
+ 0x10c8, 0x12b7, 0x1079, 0x5f95, 0x007c, 0x5fa5, 0x5fc4, 0x5fa7,
+ 0x5fd5, 0x5fc0, 0x5fa5, 0x5f71, 0x5f76, 0x5f76, 0x5f71, 0x5f71,
+ 0x5f71, 0x5f71, 0x5f71, 0x5f71, 0x5f71, 0x1078, 0x12b7, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x5fb2, 0x6850, 0xa085,
+ 0x0005, 0x6852, 0x0d7f, 0x6007, 0x0025, 0x6003, 0x000b, 0x601f,
+ 0x0002, 0x1078, 0x4327, 0x1078, 0x476a, 0xa085, 0x0001, 0x007c,
+ 0x1078, 0x15f2, 0x0078, 0x5fa7, 0x0e7e, 0x2071, 0x6f10, 0x7024,
+ 0xac06, 0x00c0, 0x5fcd, 0x1078, 0x5148, 0x1078, 0x5083, 0x0e7f,
+ 0x00c0, 0x5fa7, 0x1078, 0x5f71, 0x007c, 0x037e, 0x0e7e, 0x2071,
+ 0x6f10, 0x703c, 0xac06, 0x00c0, 0x5fe1, 0x2019, 0x0000, 0x1078,
+ 0x51da, 0x1078, 0x54b6, 0x0e7f, 0x037f, 0x00c0, 0x5fa7, 0x1078,
+ 0x5f71, 0x007c, 0x0c7e, 0x601c, 0xa084, 0x000f, 0x1079, 0x5ff2,
+ 0x0c7f, 0x007c, 0x5ffb, 0x605b, 0x60c8, 0x5fff, 0x5ffb, 0x5ffb,
+ 0x5ffb, 0x556a, 0x605b, 0x007c, 0x6017, 0x0001, 0x007c, 0x6000,
+ 0xa08a, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x6007, 0x007c, 0x6017,
+ 0x6019, 0x603a, 0x604d, 0x604d, 0x6017, 0x5ffb, 0x5ffb, 0x5ffb,
+ 0x604d, 0x604d, 0x6017, 0x6017, 0x6017, 0x6017, 0x6058, 0x1078,
+ 0x12b7, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xa085, 0x0040, 0x7052,
+ 0x2071, 0x6f10, 0x7024, 0xac06, 0x0040, 0x6036, 0x1078, 0x5083,
+ 0x6007, 0x0025, 0x6003, 0x000b, 0x601f, 0x0002, 0x6017, 0x0014,
+ 0x1078, 0x4327, 0x1078, 0x476a, 0x0e7f, 0x007c, 0x6017, 0x0001,
+ 0x0078, 0x6034, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xa085, 0x0040,
+ 0x6852, 0x0d7f, 0x6007, 0x0025, 0x6003, 0x000b, 0x601f, 0x0002,
+ 0x1078, 0x4327, 0x1078, 0x476a, 0x007c, 0x0d7e, 0x6017, 0x0001,
+ 0x6010, 0x2068, 0x6850, 0xa085, 0x0040, 0x6852, 0x0d7f, 0x007c,
+ 0x1078, 0x556a, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12b7,
+ 0x1079, 0x6063, 0x007c, 0x6073, 0x5ffc, 0x6075, 0x6073, 0x6075,
+ 0x6073, 0x6073, 0x6073, 0x5ffb, 0x5ffb, 0x6073, 0x6073, 0x6073,
+ 0x6073, 0x6073, 0x6073, 0x1078, 0x12b7, 0x0d7e, 0x6018, 0x2068,
+ 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x12b7,
+ 0x1079, 0x6083, 0x007c, 0x608f, 0x60b1, 0x608f, 0x60b1, 0x608f,
+ 0x60b1, 0x6091, 0x609a, 0x608f, 0x60b1, 0x608f, 0x60aa, 0x1078,
+ 0x12b7, 0x6004, 0xa08e, 0x0004, 0x0040, 0x60ac, 0xa08e, 0x0002,
+ 0x0040, 0x60ac, 0xa08e, 0x0000, 0x0040, 0x60c0, 0xa08e, 0x001f,
+ 0x0040, 0x60c0, 0xa08e, 0x0021, 0x0040, 0x60c4, 0xa08e, 0x0022,
+ 0x0040, 0x60c0, 0x1078, 0x2051, 0x1078, 0x5778, 0x1078, 0x556a,
+ 0x007c, 0x1078, 0x5778, 0x1078, 0x2051, 0x0e7e, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x206f, 0x127f, 0x0e7f, 0x1078, 0x556a, 0x007c,
+ 0x1078, 0x5778, 0x0078, 0x60ac, 0x1078, 0x5786, 0x0078, 0x60ac,
+ 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x60d0, 0x007c,
+ 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0, 0x60e0,
+ 0x60e0, 0x5ffb, 0x60e0, 0x5ffc, 0x60e2, 0x5ffc, 0x60eb, 0x60e0,
+ 0x1078, 0x12b7, 0x6007, 0x002b, 0x6003, 0x000d, 0x1078, 0x4327,
+ 0x1078, 0x476a, 0x007c, 0x1078, 0x6276, 0x1078, 0x6120, 0x0040,
+ 0x6109, 0x1078, 0x2051, 0x0d7e, 0x6010, 0x2068, 0x6837, 0x0103,
+ 0x684b, 0x0006, 0x1078, 0x36a1, 0x0d7f, 0x601f, 0x0001, 0x6007,
+ 0x0001, 0x6003, 0x0001, 0x1078, 0x4376, 0x1078, 0x476a, 0x0078,
+ 0x610b, 0x1078, 0x556a, 0x007c, 0xa284, 0x0007, 0x00c0, 0x611d,
+ 0xa282, 0x7400, 0x0048, 0x611d, 0x2001, 0x6d15, 0x2004, 0xa202,
+ 0x00c8, 0x611d, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x611c,
+ 0x027e, 0x0e7e, 0x2071, 0x6d00, 0x6210, 0x7058, 0xa202, 0x0048,
+ 0x6132, 0x705c, 0xa202, 0x00c8, 0x6132, 0xa085, 0x0001, 0x0e7f,
+ 0x027f, 0x007c, 0xa006, 0x0078, 0x612f, 0x0e7e, 0x0c7e, 0x037e,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7400, 0x2071, 0x6d00,
+ 0x7344, 0x7060, 0xa302, 0x00c8, 0x6155, 0x601c, 0xa206, 0x00c0,
+ 0x614d, 0x0c7e, 0x1078, 0x556a, 0x0c7f, 0xace0, 0x0008, 0x7054,
+ 0xac02, 0x00c8, 0x6155, 0x0078, 0x6140, 0x127f, 0x007f, 0x037f,
+ 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0x127e, 0x2091,
+ 0x8000, 0xa188, 0x6e00, 0x210c, 0x81ff, 0x0040, 0x6182, 0x2061,
+ 0x7400, 0x2071, 0x6d00, 0x7344, 0x7060, 0xa302, 0x00c8, 0x6182,
+ 0x6018, 0xa106, 0x00c0, 0x617c, 0x1078, 0x2051, 0x017e, 0x0c7e,
+ 0x1078, 0x556a, 0x0c7f, 0x017f, 0xace0, 0x0008, 0x7054, 0xac02,
+ 0x0048, 0x6170, 0x127f, 0x017f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e,
+ 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5504, 0x057f,
+ 0x0040, 0x61a0, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b,
+ 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x619c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
+ 0x62a0, 0x0c7e, 0x1078, 0x5504, 0x057f, 0x0040, 0x61ca, 0x6013,
+ 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x35cf,
+ 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57,
+ 0x2009, 0x004c, 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f,
+ 0x0c7f, 0x007c, 0xa006, 0x0078, 0x61c6, 0x0c7e, 0x057e, 0x127e,
+ 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5504, 0x057f, 0x0040,
+ 0x61f5, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e,
+ 0x2560, 0x1078, 0x35cf, 0x0c7f, 0x1078, 0x445c, 0x1078, 0x43a9,
+ 0x2c08, 0x1078, 0x6a57, 0x2009, 0x004d, 0x1078, 0x5591, 0xa085,
+ 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x61f1,
0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078,
- 0x556f, 0x057f, 0x0040, 0x62f0, 0x6612, 0x651a, 0x601f, 0x0003,
- 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x364c, 0x0c7f, 0x1078,
- 0x457b, 0x1078, 0x44be, 0x2c08, 0x1078, 0x6bfe, 0x2009, 0x004e,
- 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x62ec, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
- 0x1078, 0x556f, 0x017f, 0x0040, 0x630c, 0x660a, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x55fc, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6309, 0x0c7e,
- 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040,
- 0x6327, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000,
- 0x1078, 0x55fc, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
- 0x0078, 0x6324, 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff,
- 0x0040, 0x6334, 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013,
- 0x0000, 0x601f, 0x0007, 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e,
- 0x0d7e, 0x2031, 0x6f52, 0x2634, 0xd6e4, 0x0040, 0x634c, 0x6618,
- 0x2660, 0x6e44, 0x1078, 0x3584, 0x0d7f, 0x0c7f, 0x067f, 0x007c,
- 0x007e, 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x6361, 0xa08e,
- 0x0003, 0x0040, 0x6361, 0xa08e, 0x0004, 0x0040, 0x6361, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e,
- 0x0000, 0x0040, 0x6379, 0xa08e, 0x001f, 0x0040, 0x6379, 0xa08e,
- 0x0028, 0x0040, 0x6379, 0xa08e, 0x0029, 0x0040, 0x6379, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x556f, 0x017f, 0x0040, 0x6396, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x1078, 0x21a8, 0x2009, 0x0028, 0x1078,
- 0x55fc, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x6393, 0xa186, 0x0015, 0x00c0, 0x63ae, 0x2011, 0x6f1c, 0x2204,
- 0xa086, 0x0074, 0x00c0, 0x63ae, 0x1078, 0x59b5, 0x6003, 0x0001,
- 0x6007, 0x0029, 0x1078, 0x448b, 0x0078, 0x63b2, 0x1078, 0x57d2,
- 0x1078, 0x55d5, 0x007c, 0xa186, 0x0015, 0x00c0, 0x63d0, 0x2011,
- 0x6f1c, 0x2204, 0xa086, 0x0014, 0x00c0, 0x63d0, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x3547, 0x0d7f, 0x1078, 0x59bf, 0x00c0, 0x63d0,
- 0x2001, 0x0006, 0x1078, 0x3477, 0x1078, 0x567f, 0x0078, 0x63d4,
- 0x1078, 0x57d2, 0x1078, 0x55d5, 0x007c, 0x6848, 0xa086, 0x0005,
- 0x00c0, 0x63dc, 0x1078, 0x63dd, 0x007c, 0x6850, 0xc0ad, 0x6852,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x63eb, 0x067f, 0x007c, 0x63fb, 0x65cb, 0x66ac, 0x63fb, 0x63fb,
- 0x63fb, 0x63fb, 0x63fb, 0x6435, 0x6712, 0x63fb, 0x63fb, 0x63fb,
- 0x63fb, 0x63fb, 0x63fb, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x6407, 0x067f, 0x007c, 0x6417,
- 0x6a13, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x69ee,
- 0x6a5d, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x6417, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x6423, 0x067f, 0x007c, 0x6433, 0x685f, 0x68d1, 0x68f3, 0x693f,
- 0x6433, 0x6433, 0x6999, 0x671e, 0x69d6, 0x69da, 0x6433, 0x6433,
- 0x6433, 0x6433, 0x6433, 0x1078, 0x1288, 0xa1b2, 0x0030, 0x10c8,
- 0x1288, 0x2100, 0x0079, 0x643c, 0x646c, 0x6549, 0x646c, 0x646c,
- 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c,
- 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c,
- 0x646c, 0x646c, 0x646c, 0x646e, 0x649d, 0x64a8, 0x64d0, 0x64d6,
- 0x650a, 0x6542, 0x646c, 0x646c, 0x6551, 0x646c, 0x646c, 0x646c,
- 0x6558, 0x646c, 0x646c, 0x646c, 0x646c, 0x646c, 0x6575, 0x646c,
- 0x646c, 0x6580, 0x646c, 0x646c, 0x1078, 0x1288, 0x1078, 0x36cc,
- 0x6618, 0x0c7e, 0x2660, 0x1078, 0x34dd, 0x0c7f, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x648f, 0x1078,
- 0x6b3d, 0x00c0, 0x64ca, 0x1078, 0x6adb, 0x00c0, 0x648b, 0x6007,
- 0x0008, 0x0078, 0x6544, 0x6007, 0x0009, 0x0078, 0x6544, 0x1078,
- 0x6ccf, 0x0040, 0x6499, 0x1078, 0x6b3d, 0x0040, 0x6483, 0x0078,
- 0x64ca, 0x6013, 0x1900, 0x0078, 0x648b, 0x6106, 0x1078, 0x6a9e,
- 0x6007, 0x0006, 0x0078, 0x6544, 0x6007, 0x0007, 0x0078, 0x6544,
- 0x0d7e, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x64ba, 0xa686, 0x0004, 0x0040, 0x64ba, 0x0d7f,
- 0x0078, 0x64ca, 0x1078, 0x6b9b, 0x00c0, 0x64c5, 0x1078, 0x3547,
- 0x6007, 0x000a, 0x0d7f, 0x0078, 0x6544, 0x6007, 0x000b, 0x0d7f,
- 0x0078, 0x6544, 0x1078, 0x21a8, 0x6007, 0x0001, 0x0078, 0x6544,
- 0x1078, 0x21a8, 0x6007, 0x000c, 0x0078, 0x6544, 0x1078, 0x36cc,
+ 0x5504, 0x057f, 0x0040, 0x6220, 0x6612, 0x651a, 0x601f, 0x0003,
+ 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x35cf, 0x0c7f, 0x1078,
+ 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57, 0x2009, 0x004e,
+ 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x621c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
+ 0x1078, 0x5504, 0x017f, 0x0040, 0x623c, 0x660a, 0x611a, 0x601f,
+ 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x5591, 0xa085,
+ 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6239, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5504, 0x017f, 0x0040,
+ 0x6258, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012, 0x2009,
+ 0x0021, 0x1078, 0x5591, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x6255, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
+ 0x1078, 0x5504, 0x017f, 0x0040, 0x6273, 0x611a, 0x601f, 0x0001,
+ 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x5591, 0xa085, 0x0001,
+ 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6270, 0x027e, 0x0d7e,
+ 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x6280, 0x8211, 0x6a3e,
+ 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017,
+ 0x0014, 0x007c, 0x067e, 0x0c7e, 0x2031, 0x6d52, 0x2634, 0xd6e4,
+ 0x0040, 0x6297, 0x6618, 0x2660, 0x6e44, 0x1078, 0x3507, 0x0c7f,
+ 0x067f, 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7,
+ 0x1079, 0x62a4, 0x067f, 0x007c, 0x62b4, 0x640b, 0x64d4, 0x62b4,
+ 0x62b4, 0x62b4, 0x62b4, 0x62b4, 0x62ee, 0x6542, 0x62b4, 0x62b4,
+ 0x62b4, 0x62b4, 0x62b4, 0x62b4, 0x1078, 0x12b7, 0x067e, 0x6000,
+ 0xa0b2, 0x0010, 0x10c8, 0x12b7, 0x1079, 0x62c0, 0x067f, 0x007c,
+ 0x62d0, 0x6837, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0,
+ 0x6812, 0x687d, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0, 0x62d0,
+ 0x1078, 0x12b7, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12b7,
+ 0x1079, 0x62dc, 0x067f, 0x007c, 0x62ec, 0x668f, 0x66fb, 0x671c,
+ 0x6769, 0x62ec, 0x62ec, 0x67be, 0x654e, 0x67fa, 0x67fe, 0x62ec,
+ 0x62ec, 0x62ec, 0x62ec, 0x62ec, 0x1078, 0x12b7, 0xa1b2, 0x0024,
+ 0x10c8, 0x12b7, 0x2100, 0x0079, 0x62f5, 0x6319, 0x63f5, 0x6319,
+ 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319,
+ 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319, 0x6319,
+ 0x6319, 0x6319, 0x6319, 0x6319, 0x631b, 0x634a, 0x6354, 0x637c,
+ 0x6382, 0x63b6, 0x63ee, 0x6319, 0x6319, 0x63fd, 0x6319, 0x6319,
+ 0x6404, 0x1078, 0x12b7, 0x1078, 0x364d, 0x6618, 0x0c7e, 0x2660,
+ 0x1078, 0x3459, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
+ 0xa082, 0x0006, 0x0048, 0x633c, 0x1078, 0x6993, 0x00c0, 0x6376,
+ 0x1078, 0x6931, 0x00c0, 0x6338, 0x6007, 0x0008, 0x0078, 0x63f0,
+ 0x6007, 0x0009, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x6346,
+ 0x1078, 0x6993, 0x0040, 0x6330, 0x0078, 0x6376, 0x6013, 0x1900,
+ 0x0078, 0x6338, 0x1078, 0x68b7, 0x6007, 0x0006, 0x0078, 0x63f0,
+ 0x6007, 0x0007, 0x0078, 0x63f0, 0x0d7e, 0x6618, 0x2668, 0x6e04,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6366, 0xa686,
+ 0x0004, 0x0040, 0x6366, 0x0d7f, 0x0078, 0x6376, 0x1078, 0x69f1,
+ 0x00c0, 0x6371, 0x1078, 0x34ca, 0x6007, 0x000a, 0x0d7f, 0x0078,
+ 0x63f0, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x63f0, 0x1078, 0x2051,
+ 0x6007, 0x0001, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007, 0x000c,
+ 0x0078, 0x63f0, 0x1078, 0x364d, 0x6618, 0xa6b0, 0x0001, 0x2634,
+ 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x63a3, 0xa6b4, 0xff00,
+ 0x8637, 0xa686, 0x0006, 0x00c0, 0x6376, 0x1078, 0x6a00, 0x00c0,
+ 0x639d, 0x6007, 0x000e, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007,
+ 0x000f, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x63b0, 0xa6b4,
+ 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6395, 0x0078, 0x6376,
+ 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x63f0, 0x1078, 0x364d,
0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006,
- 0x0048, 0x64f7, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0,
- 0x64ca, 0x1078, 0x6baa, 0x00c0, 0x64f1, 0x6007, 0x000e, 0x0078,
- 0x6544, 0x1078, 0x21a8, 0x6007, 0x000f, 0x0078, 0x6544, 0x1078,
- 0x6ccf, 0x0040, 0x6504, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x64e9, 0x0078, 0x64ca, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6544, 0x1078, 0x36cc, 0x6618, 0xa6b0, 0x0001, 0x2634,
- 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x652f, 0xa6b4, 0xff00,
- 0x8637, 0xa686, 0x0006, 0x00c0, 0x64ca, 0x1078, 0x6bd6, 0x00c0,
- 0x6529, 0x1078, 0x6adb, 0x00c0, 0x6529, 0x6007, 0x0010, 0x0078,
- 0x6544, 0x1078, 0x21a8, 0x6007, 0x0011, 0x0078, 0x6544, 0x1078,
- 0x6ccf, 0x0040, 0x653c, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x651d, 0x0078, 0x64ca, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6544, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x448b,
- 0x007c, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x448b, 0x0078,
- 0x6548, 0x6007, 0x0020, 0x6003, 0x0001, 0x1078, 0x448b, 0x007c,
- 0x017e, 0x027e, 0x2011, 0x7388, 0x2214, 0x2c08, 0x1078, 0x6d97,
- 0x00c0, 0x6569, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078,
- 0x656e, 0x1078, 0x55d5, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001,
- 0x1078, 0x448b, 0x027f, 0x017f, 0x007c, 0x6106, 0x1078, 0x6587,
- 0x6007, 0x002b, 0x0078, 0x6544, 0x6007, 0x002c, 0x0078, 0x6544,
- 0x6106, 0x1078, 0x658c, 0x6007, 0x002e, 0x0078, 0x6544, 0x0d7e,
- 0x1078, 0x65b2, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x65c1, 0x00c0,
- 0x65ab, 0x680c, 0xa08c, 0xff00, 0x6824, 0xa084, 0x00ff, 0xa115,
- 0x6212, 0xd1e4, 0x0040, 0x65a0, 0x2009, 0x0001, 0x0078, 0x65a7,
- 0xd1ec, 0x0040, 0x65ab, 0x2009, 0x0000, 0xa294, 0x00ff, 0x1078,
- 0x21d7, 0x0078, 0x65af, 0xa085, 0x0001, 0x0078, 0x65b0, 0xa006,
- 0x0d7f, 0x007c, 0x2069, 0x738d, 0x6800, 0xa082, 0x0010, 0x00c8,
- 0x65bf, 0x6013, 0x0000, 0xa085, 0x0001, 0x0078, 0x65c0, 0xa006,
- 0x007c, 0x6013, 0x0000, 0x2069, 0x738c, 0x6808, 0xa084, 0xff00,
- 0xa086, 0x0800, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x1288,
- 0xa1b6, 0x0013, 0x00c0, 0x65d7, 0x2008, 0x0079, 0x65ea, 0xa1b6,
- 0x0027, 0x0040, 0x65df, 0xa1b6, 0x0014, 0x10c0, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x3485, 0x1078, 0x479a, 0x1078, 0x6337, 0x1078,
- 0x4893, 0x007c, 0x661a, 0x661c, 0x661a, 0x661a, 0x661a, 0x661c,
- 0x6624, 0x6687, 0x664a, 0x6687, 0x665e, 0x6687, 0x6624, 0x6687,
- 0x667f, 0x6687, 0x667f, 0x6687, 0x6687, 0x661a, 0x661a, 0x661a,
- 0x661a, 0x661a, 0x661a, 0x661a, 0x661a, 0x661a, 0x661a, 0x661a,
- 0x661a, 0x661a, 0x6687, 0x661a, 0x661a, 0x661a, 0x661a, 0x6687,
- 0x6687, 0x661a, 0x661a, 0x661a, 0x661a, 0x6687, 0x6687, 0x661a,
- 0x6687, 0x6687, 0x1078, 0x1288, 0x1078, 0x479a, 0x6003, 0x0002,
- 0x1078, 0x4893, 0x0078, 0x668d, 0x0f7e, 0x2079, 0x6f51, 0x7804,
- 0x0f7f, 0xd0ac, 0x00c0, 0x6687, 0x2001, 0x0000, 0x1078, 0x3463,
- 0x2001, 0x0002, 0x1078, 0x3477, 0x1078, 0x479a, 0x601f, 0x0001,
- 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x448b, 0x1078, 0x4893,
- 0x0c7e, 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x4194, 0x0c7f,
- 0x0078, 0x668d, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6687, 0xa686, 0x0004,
- 0x0040, 0x6687, 0x2001, 0x0004, 0x0078, 0x6685, 0x2001, 0x6f00,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x6667, 0x1078, 0x2a74, 0x2001,
- 0x0006, 0x1078, 0x668e, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6687, 0x2001,
- 0x0006, 0x0078, 0x6685, 0x2001, 0x0004, 0x0078, 0x6685, 0x2001,
- 0x0006, 0x1078, 0x668e, 0x0078, 0x6687, 0x1078, 0x3485, 0x1078,
- 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c, 0x017e, 0x0d7e,
- 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x66a9, 0x6104, 0xa18e,
- 0x000a, 0x00c0, 0x66a1, 0x699c, 0xd1a4, 0x00c0, 0x66a1, 0x2001,
- 0x0007, 0x1078, 0x3477, 0x2001, 0x0000, 0x1078, 0x3463, 0x1078,
- 0x21c6, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1288,
- 0xa1b6, 0x0015, 0x00c0, 0x66c0, 0x1079, 0x66c7, 0x0078, 0x66c6,
- 0xa1b6, 0x0016, 0x10c0, 0x1288, 0x1079, 0x66f7, 0x007c, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x66d3, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x0f7e, 0x2079, 0x6f51, 0x7804, 0x0f7f,
- 0xd0ac, 0x00c0, 0x66ef, 0x2001, 0x0000, 0x1078, 0x3463, 0x2001,
- 0x0002, 0x1078, 0x3477, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x448b, 0x1078, 0x4893, 0x0078, 0x66f6, 0x2011,
- 0x7383, 0x220c, 0x1078, 0x32cf, 0x1078, 0x55d5, 0x007c, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x582f, 0x6703, 0x582f,
- 0x582f, 0x582f, 0x582f, 0x1078, 0x59b2, 0x00c0, 0x670f, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x448b, 0x0078, 0x6711, 0x1078,
- 0x55d5, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288, 0x1078,
- 0x479a, 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0xa182, 0x0040,
- 0x0079, 0x6722, 0x6732, 0x6732, 0x6732, 0x6732, 0x6734, 0x6732,
- 0x6732, 0x6732, 0x6732, 0x6732, 0x6732, 0x6732, 0x6732, 0x6732,
- 0x6732, 0x6732, 0x1078, 0x1288, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e,
- 0x047e, 0x027e, 0x6106, 0x2071, 0x7380, 0x7444, 0xa4a4, 0xe600,
- 0x0040, 0x67a5, 0xa486, 0x2000, 0x0040, 0x6764, 0xa486, 0x0400,
- 0x0040, 0x6764, 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8,
- 0x6837, 0x0c7e, 0x1078, 0x4225, 0x2c68, 0x0c7f, 0x6a00, 0xa284,
- 0x0001, 0x0040, 0x6818, 0x1078, 0x42e3, 0x0040, 0x6843, 0xa295,
- 0x0200, 0x6a02, 0x0078, 0x676a, 0x2009, 0x0001, 0x2011, 0x0200,
- 0x1078, 0x42cd, 0x1078, 0x12e2, 0x1040, 0x1288, 0x6003, 0x0007,
- 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x6c5a,
- 0x2c00, 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0xa18c,
- 0x00ff, 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078,
- 0x3720, 0xa486, 0x2000, 0x00c0, 0x6793, 0x2019, 0x0017, 0x1078,
- 0x6d5c, 0x0078, 0x6805, 0xa486, 0x0400, 0x00c0, 0x679d, 0x2019,
- 0x0002, 0x1078, 0x6d5c, 0x0078, 0x6805, 0xa486, 0x0200, 0x00c0,
- 0x67a3, 0x1078, 0x6d4d, 0x0078, 0x6805, 0x7130, 0xa184, 0xff00,
- 0x00c0, 0x6857, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8, 0x6857,
- 0x0c7e, 0x1078, 0x4225, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001,
- 0x0040, 0x685b, 0xa284, 0x0300, 0x00c0, 0x6853, 0x6804, 0xa005,
- 0x0040, 0x6843, 0x8001, 0x6806, 0x6003, 0x0007, 0x1078, 0x12c7,
- 0x0040, 0x680c, 0x6013, 0x0000, 0x6803, 0x0000, 0x6837, 0x0116,
- 0x683b, 0x0000, 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, 0x8007,
- 0xa10d, 0x6946, 0x6853, 0x003d, 0x7044, 0xa084, 0x0003, 0xa086,
- 0x0002, 0x00c0, 0x67e7, 0x684f, 0x0040, 0x0078, 0x67f1, 0xa086,
- 0x0001, 0x00c0, 0x67ef, 0x684f, 0x0080, 0x0078, 0x67f1, 0x684f,
- 0x0000, 0x20a9, 0x000a, 0x2001, 0x7390, 0xad90, 0x0015, 0x200c,
- 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x67f7, 0x200c, 0x6982,
- 0x8000, 0x200c, 0x697e, 0x1078, 0x3720, 0x027f, 0x047f, 0x157f,
- 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100, 0x6003, 0x0001,
- 0x6007, 0x0041, 0x1078, 0x443e, 0x1078, 0x4893, 0x0078, 0x6805,
- 0x2069, 0x7392, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x00c0,
- 0x6837, 0x2069, 0x7380, 0x686c, 0xa084, 0x00ff, 0x017e, 0x6110,
- 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003, 0x0001, 0x6007,
- 0x0043, 0x1078, 0x443e, 0x1078, 0x4893, 0x0078, 0x6805, 0x6013,
- 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x443e, 0x1078,
- 0x4893, 0x0078, 0x6805, 0x6013, 0x0300, 0x0078, 0x6849, 0x6013,
- 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x443e, 0x1078,
- 0x4893, 0x0078, 0x6805, 0x6013, 0x0500, 0x0078, 0x6849, 0x6013,
- 0x0600, 0x0078, 0x6818, 0x6013, 0x0200, 0x0078, 0x6818, 0xa186,
- 0x0013, 0x00c0, 0x6871, 0x6004, 0xa08a, 0x0040, 0x1048, 0x1288,
- 0xa08a, 0x0050, 0x10c8, 0x1288, 0xa082, 0x0040, 0x2008, 0x0079,
- 0x68a2, 0xa186, 0x0047, 0x00c0, 0x6877, 0x0078, 0x68d1, 0xa186,
- 0x0027, 0x0040, 0x687f, 0xa186, 0x0014, 0x10c0, 0x1288, 0x6004,
- 0xa082, 0x0040, 0x2008, 0x0079, 0x6885, 0x6895, 0x6897, 0x6897,
- 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x6895,
- 0x6895, 0x6895, 0x6895, 0x6895, 0x6895, 0x1078, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x3485, 0x1078, 0x479a, 0x1078, 0x6337, 0x1078,
- 0x4893, 0x007c, 0x68b2, 0x68c2, 0x68bb, 0x68cb, 0x68b2, 0x68b2,
- 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2, 0x68b2,
- 0x68b2, 0x68b2, 0x1078, 0x1288, 0x6010, 0xa088, 0x0013, 0x2104,
- 0xa085, 0x0400, 0x200a, 0x1078, 0x479a, 0x6003, 0x0002, 0x1078,
- 0x4893, 0x007c, 0x1078, 0x479a, 0x1078, 0x42a6, 0x1078, 0x55d5,
- 0x1078, 0x4893, 0x007c, 0x1078, 0x479a, 0x2009, 0x0041, 0x0078,
- 0x6999, 0xa182, 0x0040, 0x0079, 0x68d5, 0x68e5, 0x68e7, 0x68e5,
- 0x68e5, 0x68e5, 0x68e5, 0x68e5, 0x68e8, 0x68e5, 0x68e5, 0x68e5,
- 0x68e5, 0x68e5, 0x68e5, 0x68e5, 0x68e5, 0x1078, 0x1288, 0x007c,
- 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
- 0x1078, 0x1525, 0x007c, 0xa182, 0x0040, 0x0079, 0x68f7, 0x6907,
- 0x6907, 0x6907, 0x6907, 0x6907, 0x6907, 0x6907, 0x6907, 0x6907,
- 0x6909, 0x692c, 0x6907, 0x6907, 0x6907, 0x6907, 0x692c, 0x1078,
- 0x1288, 0x1078, 0x4842, 0x1078, 0x4943, 0x6010, 0x0d7e, 0x2068,
- 0x684c, 0xd0fc, 0x0040, 0x691f, 0xa08c, 0x0003, 0xa18e, 0x0002,
- 0x0040, 0x6925, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6999, 0x6003,
- 0x0007, 0x1078, 0x42a6, 0x0d7f, 0x007c, 0x1078, 0x42a6, 0x1078,
- 0x55d5, 0x0d7f, 0x0078, 0x6924, 0x037e, 0x1078, 0x4842, 0x1078,
- 0x4943, 0x6010, 0x0d7e, 0x2068, 0x2019, 0x0004, 0x1078, 0x6d80,
- 0x1078, 0x6337, 0x6017, 0x0028, 0x0d7f, 0x037f, 0x007c, 0xa186,
- 0x0013, 0x00c0, 0x694d, 0x6004, 0xa086, 0x0042, 0x10c0, 0x1288,
- 0x1078, 0x479a, 0x1078, 0x4893, 0x007c, 0xa186, 0x0027, 0x0040,
- 0x6955, 0xa186, 0x0014, 0x00c0, 0x6965, 0x6004, 0xa086, 0x0042,
- 0x10c0, 0x1288, 0x2001, 0x0007, 0x1078, 0x3485, 0x1078, 0x479a,
- 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x6969, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979,
- 0x697b, 0x6987, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979,
- 0x6979, 0x1078, 0x1288, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18,
- 0x3e20, 0x2c10, 0x1078, 0x1525, 0x047f, 0x037f, 0x007c, 0x6010,
- 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x6993, 0x2009, 0x0041,
- 0x0d7f, 0x0078, 0x6999, 0x6003, 0x0007, 0x1078, 0x42a6, 0x0d7f,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x699d, 0x69ad, 0x69af, 0x69bb,
- 0x69c7, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad,
- 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x69ad, 0x1078, 0x1288, 0x6003,
- 0x0001, 0x6106, 0x1078, 0x443e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4893, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x443e,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x4893, 0x127f, 0x007c, 0x6003,
- 0x0003, 0x6106, 0x2c10, 0x1078, 0x1936, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x44aa, 0x1078, 0x4943, 0x127f, 0x007c, 0x1078, 0x479a,
- 0x0078, 0x69dc, 0x1078, 0x4842, 0x6110, 0x81ff, 0x0040, 0x69e9,
- 0x0d7e, 0x2168, 0x037e, 0x2019, 0x0029, 0x1078, 0x6d80, 0x037f,
- 0x0d7f, 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0xa182, 0x0085,
- 0x0079, 0x69f2, 0x69f9, 0x69f9, 0x69f9, 0x69fb, 0x69f9, 0x69f9,
- 0x69f9, 0x1078, 0x1288, 0x027e, 0x0e7e, 0x2071, 0x7380, 0x7220,
- 0x1078, 0x6c9a, 0x0040, 0x6a08, 0x6007, 0x0086, 0x0078, 0x6a0a,
- 0x6007, 0x0087, 0x6003, 0x0001, 0x1078, 0x443e, 0x1078, 0x4893,
- 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6a24, 0x6004,
- 0xa08a, 0x0085, 0x1048, 0x1288, 0xa08a, 0x008c, 0x10c8, 0x1288,
- 0xa082, 0x0085, 0x0079, 0x6a37, 0xa186, 0x0027, 0x0040, 0x6a2c,
- 0xa186, 0x0014, 0x10c0, 0x1288, 0x2001, 0x0007, 0x1078, 0x3485,
- 0x1078, 0x479a, 0x1078, 0x6337, 0x1078, 0x4893, 0x007c, 0x6a3e,
- 0x6a40, 0x6a40, 0x6a3e, 0x6a3e, 0x6a3e, 0x6a3e, 0x1078, 0x1288,
- 0x1078, 0x479a, 0x1078, 0x55d5, 0x1078, 0x4893, 0x007c, 0xa182,
- 0x0085, 0x1048, 0x1288, 0xa182, 0x008c, 0x10c8, 0x1288, 0xa182,
- 0x0085, 0x0079, 0x6a53, 0x6a5a, 0x6a5a, 0x6a5a, 0x6a5c, 0x6a5a,
- 0x6a5a, 0x6a5a, 0x1078, 0x1288, 0x007c, 0x1078, 0x479a, 0x1078,
- 0x6337, 0x1078, 0x4893, 0x007c, 0x037e, 0x2019, 0x000b, 0x1078,
- 0x6a6d, 0x601f, 0x0006, 0x037f, 0x007c, 0x127e, 0x037e, 0x087e,
- 0x2091, 0x8000, 0x2c40, 0x1078, 0x52e8, 0x00c0, 0x6a9a, 0x1078,
- 0x5389, 0x00c0, 0x6a9a, 0x6000, 0xa086, 0x0000, 0x0040, 0x6a9a,
- 0x601c, 0xa086, 0x0007, 0x0040, 0x6a9a, 0x0d7e, 0x6000, 0xa086,
- 0x0004, 0x00c0, 0x6a8d, 0x1078, 0x1629, 0x6010, 0x2068, 0x1078,
- 0x6216, 0x0040, 0x6a95, 0x1078, 0x6d80, 0x0d7f, 0x6013, 0x0000,
- 0x601f, 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e, 0x0c7e,
- 0x037e, 0x157e, 0x2079, 0x7380, 0x7838, 0xa084, 0x00ff, 0xa005,
- 0x00c0, 0x6ad6, 0x783c, 0x1078, 0x1fe4, 0x017e, 0x0c7e, 0x1078,
- 0x34cb, 0x00c0, 0x6ad4, 0x2011, 0x7390, 0xac98, 0x000a, 0x20a9,
- 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6ad4, 0x017f, 0x027f, 0x027e,
- 0x017e, 0x2019, 0x0029, 0x1078, 0x545d, 0x1078, 0x457b, 0x1078,
- 0x44be, 0x017f, 0x1078, 0x6bfe, 0x1078, 0x364c, 0x017f, 0x1078,
- 0x32cf, 0xa006, 0x0078, 0x6ad6, 0x0c7f, 0x017f, 0x157f, 0x037f,
- 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x6f1c,
- 0x2104, 0xa086, 0x0074, 0x00c0, 0x6b32, 0x2069, 0x738e, 0x690c,
- 0xa182, 0x0100, 0x0048, 0x6b22, 0x6908, 0xa184, 0x8000, 0x0040,
- 0x6b2e, 0xa184, 0x0800, 0x0040, 0x6b2e, 0x6910, 0xa18a, 0x0001,
- 0x0048, 0x6b26, 0x6914, 0x2069, 0x73ae, 0x6904, 0x81ff, 0x00c0,
- 0x6b1a, 0x690c, 0xa182, 0x0100, 0x0048, 0x6b22, 0x6908, 0x81ff,
- 0x00c0, 0x6b1e, 0x6910, 0xa18a, 0x0001, 0x0048, 0x6b26, 0x6918,
- 0xa18a, 0x0001, 0x0048, 0x6b2e, 0x0078, 0x6b38, 0x6013, 0x0100,
- 0x0078, 0x6b34, 0x6013, 0x0300, 0x0078, 0x6b34, 0x6013, 0x0500,
- 0x0078, 0x6b34, 0x6013, 0x0700, 0x0078, 0x6b34, 0x6013, 0x0900,
- 0x0078, 0x6b34, 0x6013, 0x0b00, 0x0078, 0x6b34, 0x6013, 0x0f00,
- 0x0078, 0x6b34, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x6b39,
- 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e,
- 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286,
- 0x0006, 0x0040, 0x6b61, 0xa286, 0x0004, 0x0040, 0x6b61, 0xa394,
- 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x6b61, 0xa286, 0x0004,
- 0x0040, 0x6b61, 0x0c7e, 0x2d60, 0x1078, 0x34dd, 0x0c7f, 0x0078,
- 0x6b94, 0x2011, 0x7396, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x5a4b, 0x00c0, 0x6b95, 0x2011, 0x739a, 0xad98, 0x0006, 0x20a9,
- 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6b95, 0x047e, 0x017e, 0x6aa0,
- 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x6f52, 0x210c, 0xd1a4,
- 0x0040, 0x6b89, 0x2009, 0x0029, 0x1078, 0x6dc4, 0x6800, 0xc0e5,
- 0x6802, 0x2019, 0x0029, 0x1078, 0x457b, 0x1078, 0x44be, 0x2c08,
- 0x1078, 0x6bfe, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f,
- 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0x738e, 0x6800, 0xa086,
- 0x0800, 0x0040, 0x6ba7, 0x6013, 0x0000, 0x0078, 0x6ba8, 0xa006,
- 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e,
- 0x2079, 0x738c, 0x7830, 0xa00d, 0x00c0, 0x6bcf, 0x7834, 0x1078,
- 0x1fe4, 0x1078, 0x34cb, 0x00c0, 0x6bcf, 0x2011, 0x7390, 0xac98,
- 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6bcf, 0x2011,
- 0x7394, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x157f,
- 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e,
- 0x017e, 0x027e, 0x037e, 0x157e, 0x2011, 0x7383, 0x2204, 0x1078,
- 0x1fe4, 0x1078, 0x34cb, 0x00c0, 0x6bf7, 0x2011, 0x7396, 0xac98,
- 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x00c0, 0x6bf7, 0x2011,
- 0x739a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a4b, 0x157f,
- 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091, 0x8000,
- 0x2029, 0x70bf, 0x252c, 0x2021, 0x70c5, 0x2424, 0x2061, 0x7500,
- 0x2071, 0x6f00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x6c63,
- 0x2100, 0xac06, 0x0040, 0x6c59, 0x1078, 0x6ddc, 0x0040, 0x6c59,
- 0x671c, 0xa786, 0x0001, 0x0040, 0x6c78, 0xa786, 0x0007, 0x0040,
- 0x6c59, 0x2500, 0xac06, 0x0040, 0x6c59, 0x2400, 0xac06, 0x0040,
- 0x6c59, 0x1078, 0x6df0, 0x00c0, 0x6c59, 0x0d7e, 0x6000, 0xa086,
- 0x0004, 0x00c0, 0x6c3f, 0x017e, 0x1078, 0x1629, 0x017f, 0x6010,
- 0x2068, 0x1078, 0x6216, 0x0040, 0x6c56, 0xa786, 0x0003, 0x00c0,
- 0x6c6c, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x017e, 0x1078,
- 0x63d5, 0x1078, 0x3720, 0x017f, 0x1078, 0x632a, 0x0d7f, 0x1078,
- 0x6337, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8,
- 0x6c63, 0x0078, 0x6c10, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f,
- 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x6c49,
- 0xa386, 0x0005, 0x0040, 0x6c59, 0x1078, 0x6d80, 0x0078, 0x6c56,
- 0x1078, 0x6df0, 0x00c0, 0x6c59, 0xa180, 0x0001, 0x2004, 0xa086,
- 0x0018, 0x00c0, 0x6c59, 0x6000, 0xa086, 0x0002, 0x00c0, 0x6c59,
- 0x1078, 0x6350, 0x0040, 0x6c94, 0x1078, 0x6364, 0x00c0, 0x6c59,
- 0x1078, 0x57d2, 0x0078, 0x6c96, 0x1078, 0x21c6, 0x1078, 0x6337,
- 0x0078, 0x6c59, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078,
- 0x6d97, 0x017f, 0x0040, 0x6ca9, 0x601c, 0xa084, 0x0007, 0x1079,
- 0x6cac, 0x0e7f, 0x0c7f, 0x007c, 0x6cb4, 0x6cb4, 0x6cb4, 0x6cb4,
- 0x6cb4, 0x6cb4, 0x6cb6, 0x6cb4, 0xa006, 0x007c, 0x047e, 0x017e,
- 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00,
- 0x2009, 0x0020, 0x1078, 0x6dc4, 0x017f, 0x047f, 0x037e, 0x2019,
- 0x0002, 0x1078, 0x6a6d, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0001, 0x1078, 0x3463, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9,
- 0x0004, 0x2019, 0x6f05, 0x2011, 0x7396, 0x1078, 0x5a4b, 0x037f,
- 0x027f, 0x017f, 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7500,
- 0x2079, 0x0001, 0x8fff, 0x0040, 0x6d40, 0x2071, 0x6f00, 0x7644,
- 0x7060, 0x8001, 0xa602, 0x00c8, 0x6d40, 0x88ff, 0x0040, 0x6d06,
- 0x2800, 0xac06, 0x00c0, 0x6d36, 0x2079, 0x0000, 0x1078, 0x6ddc,
- 0x0040, 0x6d36, 0x2400, 0xac06, 0x0040, 0x6d36, 0x671c, 0xa786,
- 0x0006, 0x00c0, 0x6d36, 0xa786, 0x0007, 0x0040, 0x6d36, 0x88ff,
- 0x00c0, 0x6d1e, 0x6018, 0xa206, 0x00c0, 0x6d36, 0x0d7e, 0x6000,
- 0xa086, 0x0004, 0x00c0, 0x6d26, 0x1078, 0x1629, 0x6010, 0x2068,
- 0x1078, 0x6216, 0x0040, 0x6d30, 0x047e, 0x1078, 0x6d80, 0x047f,
- 0x0d7f, 0x1078, 0x6337, 0x88ff, 0x00c0, 0x6d49, 0xace0, 0x0008,
- 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8, 0x6d40, 0x0078, 0x6cf2,
- 0xa006, 0x127f, 0x027f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f,
- 0x007c, 0xa8c5, 0x0001, 0x0078, 0x6d41, 0x087e, 0x2041, 0x0000,
- 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078, 0x52e8, 0x1078, 0x5389,
- 0x1078, 0x6ce5, 0x087f, 0x007c, 0x027e, 0x047e, 0x087e, 0x0c7e,
- 0x157e, 0x2c20, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x037e,
- 0x1078, 0x34cb, 0x00c0, 0x6d75, 0x2c10, 0x2041, 0x0000, 0x1078,
- 0x52e8, 0x1078, 0x5389, 0x1078, 0x6ce5, 0x037f, 0x017f, 0x8108,
- 0x00f0, 0x6d66, 0x157f, 0x0c7f, 0x087f, 0x047f, 0x027f, 0x007c,
- 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x6d94, 0x6800, 0xa07d, 0x0040,
- 0x6d91, 0x6803, 0x0000, 0x6b52, 0x1078, 0x3720, 0x2f68, 0x0078,
- 0x6d85, 0x6b52, 0x1078, 0x3720, 0x0f7f, 0x017f, 0x007c, 0x0e7e,
- 0x047e, 0x037e, 0x2061, 0x7500, 0x2071, 0x6f00, 0x7444, 0x7060,
- 0x8001, 0xa402, 0x00c8, 0x6dbf, 0x2100, 0xac06, 0x0040, 0x6db1,
- 0x6000, 0xa086, 0x0000, 0x0040, 0x6db1, 0x6008, 0xa206, 0x0040,
- 0x6dbb, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02, 0x00c8,
- 0x6dbf, 0x0078, 0x6d9c, 0xa085, 0x0001, 0x0078, 0x6dc0, 0xa006,
- 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e, 0x007e, 0x1078, 0x12e2,
- 0x007f, 0x1040, 0x1288, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b,
- 0x0000, 0x685b, 0x0000, 0x685e, 0x6956, 0x6c46, 0x684f, 0x0000,
- 0x1078, 0x3720, 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, 0x0040,
- 0x6def, 0xa786, 0x0001, 0x0040, 0x6def, 0xa786, 0x000a, 0x0040,
- 0x6def, 0xa786, 0x0009, 0x0040, 0x6def, 0xa085, 0x0001, 0x007c,
- 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x127e,
- 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6f40, 0xd5a4, 0x0040,
- 0x6e04, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6e0a, 0x7030,
- 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6e11, 0x2071, 0x6f4a, 0x1078,
- 0x6e40, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e,
- 0x2091, 0x8000, 0x2071, 0x6f40, 0xd5a4, 0x0040, 0x6e22, 0x7034,
- 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6e28, 0x7030, 0x8000, 0x7032,
- 0xd5ac, 0x0040, 0x6e2f, 0x2071, 0x6f4a, 0x1078, 0x6e40, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
- 0x2071, 0x6f42, 0x1078, 0x6e40, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x2e04, 0x8000, 0x2072, 0x00c8, 0x6e49, 0x8e70, 0x2e04, 0x8000,
- 0x2072, 0x007c, 0x0e7e, 0x2071, 0x6f40, 0x1078, 0x6e40, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x6f44, 0x1078, 0x6e40, 0x0e7f, 0x007c,
- 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
- 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000,
- 0x5879
+ 0x0048, 0x63db, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0,
+ 0x6376, 0x1078, 0x6a2b, 0x00c0, 0x63d5, 0x1078, 0x6931, 0x00c0,
+ 0x63d5, 0x6007, 0x0010, 0x0078, 0x63f0, 0x1078, 0x2051, 0x6007,
+ 0x0011, 0x0078, 0x63f0, 0x1078, 0x6b02, 0x0040, 0x63e8, 0xa6b4,
+ 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x63c9, 0x0078, 0x6376,
+ 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x63f0, 0x6007, 0x0012,
+ 0x6003, 0x0001, 0x1078, 0x4376, 0x007c, 0x6007, 0x0001, 0x6003,
+ 0x0001, 0x1078, 0x4376, 0x0078, 0x63f4, 0x6007, 0x0020, 0x6003,
+ 0x0001, 0x1078, 0x4376, 0x007c, 0x6007, 0x0023, 0x6003, 0x0001,
+ 0x1078, 0x4376, 0x007c, 0x6004, 0xa0b2, 0x0024, 0x10c8, 0x12b7,
+ 0xa1b6, 0x0013, 0x00c0, 0x6417, 0x2008, 0x0079, 0x6426, 0xa1b6,
+ 0x0014, 0x10c0, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401, 0x1078,
+ 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x644a, 0x644c,
+ 0x644a, 0x644a, 0x644a, 0x644c, 0x6454, 0x64af, 0x6472, 0x64af,
+ 0x6486, 0x64af, 0x6454, 0x64af, 0x64a7, 0x64af, 0x64a7, 0x64af,
+ 0x64af, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a,
+ 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x644a, 0x64af, 0x644a,
+ 0x644a, 0x64af, 0x1078, 0x12b7, 0x1078, 0x4671, 0x6003, 0x0002,
+ 0x1078, 0x476a, 0x0078, 0x64b5, 0x0f7e, 0x2079, 0x6d51, 0x7804,
+ 0x0f7f, 0xd0ac, 0x00c0, 0x64af, 0x2001, 0x0000, 0x1078, 0x33df,
+ 0x2001, 0x0002, 0x1078, 0x33f3, 0x1078, 0x4671, 0x601f, 0x0001,
+ 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4376, 0x1078, 0x476a,
+ 0x0078, 0x64b5, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
+ 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af, 0xa686, 0x0004,
+ 0x0040, 0x64af, 0x2001, 0x0004, 0x0078, 0x64ad, 0x2001, 0x6d00,
+ 0x2004, 0xa086, 0x0003, 0x00c0, 0x648f, 0x1078, 0x2ad1, 0x2001,
+ 0x0006, 0x1078, 0x64b6, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af, 0x2001,
+ 0x0006, 0x0078, 0x64ad, 0x2001, 0x0004, 0x0078, 0x64ad, 0x2001,
+ 0x0006, 0x1078, 0x64b6, 0x0078, 0x64af, 0x1078, 0x3401, 0x1078,
+ 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x017e, 0x0d7e,
+ 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x64d1, 0x6104, 0xa18e,
+ 0x000a, 0x00c0, 0x64c9, 0x699c, 0xd1a4, 0x00c0, 0x64c9, 0x2001,
+ 0x0007, 0x1078, 0x33f3, 0x2001, 0x0000, 0x1078, 0x33df, 0x1078,
+ 0x206f, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
+ 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12b7,
+ 0xa1b6, 0x0015, 0x00c0, 0x64e8, 0x1079, 0x64ef, 0x0078, 0x64ee,
+ 0xa1b6, 0x0016, 0x10c0, 0x12b7, 0x1079, 0x6527, 0x007c, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x64fb, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x0f7e, 0x2079, 0x6d51, 0x7804, 0x0f7f,
+ 0xd0ac, 0x00c0, 0x6517, 0x2001, 0x0000, 0x1078, 0x33df, 0x2001,
+ 0x0002, 0x1078, 0x33f3, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007,
+ 0x0002, 0x1078, 0x4376, 0x1078, 0x476a, 0x0078, 0x6526, 0x2011,
+ 0x7283, 0x220c, 0x017e, 0x0c7e, 0x1078, 0x3447, 0x00c0, 0x6526,
+ 0x1078, 0x3256, 0x0c7f, 0x017f, 0x1078, 0x556a, 0x007c, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x57ef, 0x6533, 0x57ef,
+ 0x57ef, 0x57ef, 0x57ef, 0x1078, 0x599c, 0x00c0, 0x653f, 0x6003,
+ 0x0001, 0x6007, 0x0001, 0x1078, 0x4376, 0x0078, 0x6541, 0x1078,
+ 0x556a, 0x007c, 0x6004, 0xa08a, 0x0024, 0x10c8, 0x12b7, 0x1078,
+ 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0xa182, 0x0040,
+ 0x0079, 0x6552, 0x6561, 0x6561, 0x6561, 0x6561, 0x6563, 0x6561,
+ 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561, 0x6561,
+ 0x6561, 0x1078, 0x12b7, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e,
+ 0x027e, 0x2071, 0x7280, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x65d4,
+ 0xa486, 0x2000, 0x0040, 0x6592, 0xa486, 0x0400, 0x0040, 0x6592,
+ 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8, 0x6663, 0x0c7e,
+ 0x1078, 0x416d, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040,
+ 0x6644, 0x1078, 0x420a, 0x0040, 0x666f, 0xa295, 0x0200, 0x6a02,
+ 0x0078, 0x6598, 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x41f4,
+ 0x1078, 0x130f, 0x1040, 0x12b7, 0x6003, 0x0007, 0x6106, 0x2d00,
+ 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00,
+ 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0xa18c, 0x00ff,
+ 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078, 0x36a1,
+ 0xa486, 0x2000, 0x00c0, 0x65c2, 0x2019, 0x0017, 0x1078, 0x6b8f,
+ 0x0078, 0x6631, 0xa486, 0x0400, 0x00c0, 0x65cc, 0x2019, 0x0002,
+ 0x1078, 0x6b8f, 0x0078, 0x6631, 0xa486, 0x0200, 0x00c0, 0x65d2,
+ 0x1078, 0x6b80, 0x0078, 0x6631, 0x7130, 0xa18c, 0x00ff, 0xa182,
+ 0x0010, 0x00c8, 0x6687, 0x0c7e, 0x1078, 0x416d, 0x2c68, 0x0c7f,
+ 0x6a00, 0xa284, 0x0001, 0x0040, 0x668b, 0xa284, 0x0300, 0x00c0,
+ 0x6683, 0x6804, 0xa005, 0x0040, 0x666f, 0x8001, 0x6806, 0x6003,
+ 0x0007, 0x6106, 0x1078, 0x12f4, 0x0040, 0x6638, 0x6013, 0x0000,
+ 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a,
+ 0x6018, 0x2078, 0x78a0, 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d,
+ 0x7044, 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x6613, 0x684f,
+ 0x0040, 0x0078, 0x661d, 0xa086, 0x0001, 0x00c0, 0x661b, 0x684f,
+ 0x0080, 0x0078, 0x661d, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001,
+ 0x7290, 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210,
+ 0x00f0, 0x6623, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078,
+ 0x36a1, 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c,
+ 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4327,
+ 0x1078, 0x476a, 0x0078, 0x6631, 0x2069, 0x7292, 0x2d04, 0xa084,
+ 0xff00, 0xa086, 0x1200, 0x00c0, 0x6663, 0x2069, 0x7280, 0x686c,
+ 0xa084, 0x00ff, 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112,
+ 0x017f, 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x4327, 0x1078,
+ 0x476a, 0x0078, 0x6631, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007,
+ 0x0041, 0x1078, 0x4327, 0x1078, 0x476a, 0x0078, 0x6631, 0xa284,
+ 0x0004, 0x00c0, 0x6677, 0x6013, 0x0300, 0x0078, 0x6679, 0x6013,
+ 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4327, 0x1078,
+ 0x476a, 0x0078, 0x6631, 0x6013, 0x0500, 0x0078, 0x6679, 0x6013,
+ 0x0600, 0x0078, 0x6644, 0x6013, 0x0200, 0x0078, 0x6644, 0xa186,
+ 0x0013, 0x00c0, 0x66a1, 0x6004, 0xa08a, 0x0040, 0x1048, 0x12b7,
+ 0xa08a, 0x004f, 0x10c8, 0x12b7, 0xa082, 0x0040, 0x2008, 0x0079,
+ 0x66cd, 0xa186, 0x0047, 0x00c0, 0x66a7, 0x0078, 0x66fb, 0xa186,
+ 0x0014, 0x10c0, 0x12b7, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079,
+ 0x66b1, 0x66c0, 0x66c2, 0x66c2, 0x66c0, 0x66c0, 0x66c0, 0x66c0,
+ 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0, 0x66c0,
+ 0x1078, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401, 0x1078, 0x4671,
+ 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x66dc, 0x66ec, 0x66e5,
+ 0x66f5, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x66dc,
+ 0x66dc, 0x66dc, 0x66dc, 0x66dc, 0x1078, 0x12b7, 0x6010, 0xa088,
+ 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078, 0x4671, 0x6003,
+ 0x0002, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671, 0x1078, 0x41cd,
+ 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0x1078, 0x4671, 0x2009,
+ 0x0041, 0x0078, 0x67be, 0xa182, 0x0040, 0x0079, 0x66ff, 0x670e,
+ 0x6710, 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x6711, 0x670e,
+ 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x670e, 0x1078, 0x12b7,
+ 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20,
+ 0x2c10, 0x1078, 0x1532, 0x007c, 0xa182, 0x0040, 0x0079, 0x6720,
+ 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f, 0x672f,
+ 0x672f, 0x6731, 0x6754, 0x672f, 0x672f, 0x672f, 0x672f, 0x1078,
+ 0x12b7, 0x1078, 0x4719, 0x1078, 0x4821, 0x6010, 0x0d7e, 0x2068,
+ 0x684c, 0xd0fc, 0x0040, 0x6747, 0xa08c, 0x0003, 0xa18e, 0x0002,
+ 0x0040, 0x674d, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x67be, 0x6003,
+ 0x0007, 0x1078, 0x41cd, 0x0d7f, 0x007c, 0x1078, 0x41cd, 0x1078,
+ 0x556a, 0x0d7f, 0x0078, 0x674c, 0x2001, 0x0007, 0x1078, 0x3401,
+ 0x1078, 0x4719, 0x1078, 0x4821, 0x6010, 0x0d7e, 0x2068, 0x037e,
+ 0x2019, 0x0004, 0x1078, 0x6bb3, 0x037f, 0x1078, 0x6283, 0x0d7f,
+ 0x007c, 0xa186, 0x0013, 0x00c0, 0x6777, 0x6004, 0xa086, 0x0042,
+ 0x10c0, 0x12b7, 0x1078, 0x4671, 0x1078, 0x476a, 0x007c, 0xa186,
+ 0x0014, 0x00c0, 0x678b, 0x6004, 0xa086, 0x0042, 0x10c0, 0x12b7,
+ 0x2001, 0x0007, 0x1078, 0x3401, 0x1078, 0x4671, 0x1078, 0x6283,
+ 0x1078, 0x476a, 0x007c, 0xa182, 0x0040, 0x0079, 0x678f, 0x679e,
+ 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x67a0, 0x67ac,
+ 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x679e, 0x1078, 0x12b7,
+ 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078,
+ 0x1532, 0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x684c,
+ 0xd0fc, 0x0040, 0x67b8, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x67be,
+ 0x6003, 0x0007, 0x1078, 0x41cd, 0x0d7f, 0x007c, 0xa182, 0x0040,
+ 0x0079, 0x67c2, 0x67d1, 0x67d3, 0x67df, 0x67eb, 0x67d1, 0x67d1,
+ 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1, 0x67d1,
+ 0x67d1, 0x1078, 0x12b7, 0x6003, 0x0001, 0x6106, 0x1078, 0x4327,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x476a, 0x127f, 0x007c, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x4327, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x476a, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078,
+ 0x17de, 0x127e, 0x2091, 0x8000, 0x1078, 0x4395, 0x1078, 0x4821,
+ 0x127f, 0x007c, 0x1078, 0x4671, 0x0078, 0x6800, 0x1078, 0x4719,
+ 0x6110, 0x81ff, 0x0040, 0x680d, 0x0d7e, 0x2168, 0x037e, 0x2019,
+ 0x0029, 0x1078, 0x6bb3, 0x037f, 0x0d7f, 0x1078, 0x6283, 0x1078,
+ 0x476a, 0x007c, 0xa182, 0x0025, 0x0079, 0x6816, 0x681d, 0x681d,
+ 0x681d, 0x681f, 0x681d, 0x681d, 0x681d, 0x1078, 0x12b7, 0x027e,
+ 0x0e7e, 0x2071, 0x7280, 0x7220, 0x1078, 0x6ad1, 0x0040, 0x682c,
+ 0x6007, 0x0026, 0x0078, 0x682e, 0x6007, 0x0027, 0x6003, 0x0001,
+ 0x1078, 0x4327, 0x1078, 0x476a, 0x0e7f, 0x027f, 0x007c, 0xa186,
+ 0x0013, 0x00c0, 0x6848, 0x6004, 0xa08a, 0x0025, 0x1048, 0x12b7,
+ 0xa08a, 0x002c, 0x10c8, 0x12b7, 0xa082, 0x0025, 0x0079, 0x6857,
+ 0xa186, 0x0014, 0x10c0, 0x12b7, 0x2001, 0x0007, 0x1078, 0x3401,
+ 0x1078, 0x4671, 0x1078, 0x6283, 0x1078, 0x476a, 0x007c, 0x685e,
+ 0x6860, 0x6860, 0x685e, 0x685e, 0x685e, 0x685e, 0x1078, 0x12b7,
+ 0x1078, 0x4671, 0x1078, 0x556a, 0x1078, 0x476a, 0x007c, 0xa182,
+ 0x0025, 0x1048, 0x12b7, 0xa182, 0x002c, 0x10c8, 0x12b7, 0xa182,
+ 0x0025, 0x0079, 0x6873, 0x687a, 0x687a, 0x687a, 0x687c, 0x687a,
+ 0x687a, 0x687a, 0x1078, 0x12b7, 0x007c, 0x1078, 0x4671, 0x1078,
+ 0x6283, 0x1078, 0x476a, 0x007c, 0x127e, 0x037e, 0x087e, 0x2091,
+ 0x8000, 0x2c40, 0x2019, 0x0002, 0x1078, 0x5387, 0x00c0, 0x68b3,
+ 0x1078, 0x5428, 0x00c0, 0x68b3, 0x6000, 0xa086, 0x0000, 0x0040,
+ 0x68b3, 0x601c, 0xa086, 0x0007, 0x0040, 0x68b3, 0x0d7e, 0x6010,
+ 0x2068, 0x1078, 0x6120, 0x0040, 0x68a7, 0x1078, 0x6bb3, 0x0d7f,
+ 0x6000, 0xa086, 0x0004, 0x00c0, 0x68af, 0x1078, 0x15f2, 0x6013,
+ 0x0000, 0x601f, 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e,
+ 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7280, 0x7938, 0x783c, 0x1078,
+ 0x1e1b, 0x00c0, 0x68e8, 0x017e, 0x0c7e, 0x1078, 0x3447, 0x00c0,
+ 0x68e8, 0x2011, 0x7290, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x5a35, 0x00c0, 0x68e8, 0x017f, 0x027f, 0x027e, 0x017e, 0x2019,
+ 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9, 0x017f, 0x1078, 0x6a57,
+ 0x1078, 0x35cf, 0x017f, 0x1078, 0x3256, 0xa006, 0x0078, 0x68ea,
+ 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0e7e,
+ 0x0d7e, 0x0c7e, 0x047e, 0x037e, 0x027e, 0x2061, 0x7400, 0x2071,
+ 0x6d00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6929, 0x2100,
+ 0xac06, 0x0040, 0x691b, 0x6000, 0xa086, 0x0000, 0x0040, 0x691b,
+ 0x6018, 0x2068, 0x68a0, 0xa206, 0x00c0, 0x691b, 0x631c, 0xa386,
+ 0x0004, 0x0040, 0x6925, 0xa386, 0x0005, 0x0040, 0x6925, 0xa386,
+ 0x0006, 0x0040, 0x6925, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004,
+ 0xac02, 0x00c8, 0x6929, 0x0078, 0x68f7, 0xa085, 0x0001, 0x0078,
+ 0x692a, 0xa006, 0x027f, 0x037f, 0x047f, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x6d1e, 0x2104, 0xa086,
+ 0x0074, 0x00c0, 0x6988, 0x2069, 0x728e, 0x690c, 0xa182, 0x0100,
+ 0x0048, 0x6978, 0x6908, 0xa184, 0x8000, 0x0040, 0x6984, 0xa184,
+ 0x0800, 0x0040, 0x6984, 0x6910, 0xa18a, 0x0001, 0x0048, 0x697c,
+ 0x6914, 0x2069, 0x72ae, 0x6904, 0x81ff, 0x00c0, 0x6970, 0x690c,
+ 0xa182, 0x0100, 0x0048, 0x6978, 0x6908, 0x81ff, 0x00c0, 0x6974,
+ 0x6910, 0xa18a, 0x0001, 0x0048, 0x697c, 0x6918, 0xa18a, 0x0001,
+ 0x0048, 0x6984, 0x0078, 0x698e, 0x6013, 0x0100, 0x0078, 0x698a,
+ 0x6013, 0x0300, 0x0078, 0x698a, 0x6013, 0x0500, 0x0078, 0x698a,
+ 0x6013, 0x0700, 0x0078, 0x698a, 0x6013, 0x0900, 0x0078, 0x698a,
+ 0x6013, 0x0b00, 0x0078, 0x698a, 0x6013, 0x0f00, 0x0078, 0x698a,
+ 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x698f, 0xa006, 0x017f,
+ 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e,
+ 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040,
+ 0x69b7, 0xa286, 0x0004, 0x0040, 0x69b7, 0xa394, 0xff00, 0x8217,
+ 0xa286, 0x0006, 0x0040, 0x69b7, 0xa286, 0x0004, 0x0040, 0x69b7,
+ 0x0c7e, 0x2d60, 0x1078, 0x3459, 0x0c7f, 0x0078, 0x69ea, 0x2011,
+ 0x7296, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a35, 0x00c0,
+ 0x69eb, 0x2011, 0x729a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078,
+ 0x5a35, 0x00c0, 0x69eb, 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff,
+ 0x8227, 0xa006, 0x2009, 0x6d52, 0x210c, 0xd1a4, 0x0040, 0x69df,
+ 0x2009, 0x0029, 0x1078, 0x6bf7, 0x6800, 0xc0e5, 0x6802, 0x2019,
+ 0x0029, 0x1078, 0x445c, 0x1078, 0x43a9, 0x2c08, 0x1078, 0x6a57,
+ 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f,
+ 0x007c, 0x0d7e, 0x2069, 0x728e, 0x6800, 0xa086, 0x0800, 0x0040,
+ 0x69fd, 0x6013, 0x0000, 0x0078, 0x69fe, 0xa006, 0x0d7f, 0x007c,
+ 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, 0x728c,
+ 0x7930, 0x7834, 0x1078, 0x1e1b, 0x00c0, 0x6a24, 0x1078, 0x3447,
+ 0x00c0, 0x6a24, 0x2011, 0x7290, 0xac98, 0x000a, 0x20a9, 0x0004,
+ 0x1078, 0x5a35, 0x00c0, 0x6a24, 0x2011, 0x7294, 0xac98, 0x0006,
+ 0x20a9, 0x0004, 0x1078, 0x5a35, 0x157f, 0x037f, 0x027f, 0x017f,
+ 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, 0x037e,
+ 0x157e, 0x2011, 0x7283, 0x2204, 0x8211, 0x220c, 0x1078, 0x1e1b,
+ 0x00c0, 0x6a50, 0x1078, 0x3447, 0x00c0, 0x6a50, 0x2011, 0x7296,
+ 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a35, 0x00c0, 0x6a50,
+ 0x2011, 0x729a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a35,
+ 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e,
+ 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x6f19, 0x252c, 0x2021, 0x6f1f, 0x2424, 0x2061,
+ 0x7400, 0x2071, 0x6d00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8,
+ 0x6abc, 0x2100, 0xac06, 0x0040, 0x6ab2, 0x1078, 0x6c0f, 0x0040,
+ 0x6ab2, 0x671c, 0xa786, 0x0001, 0x0040, 0x6ab2, 0xa786, 0x0007,
+ 0x0040, 0x6ab2, 0x2500, 0xac06, 0x0040, 0x6ab2, 0x2400, 0xac06,
+ 0x0040, 0x6ab2, 0x6018, 0x2070, 0x70a0, 0xa206, 0x00c0, 0x6ab2,
+ 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x6aa6, 0xa786,
+ 0x0003, 0x00c0, 0x6ac5, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+ 0x017e, 0x1078, 0x36a1, 0x017f, 0x1078, 0x6276, 0x0d7f, 0x6000,
+ 0xa086, 0x0004, 0x00c0, 0x6ab0, 0x017e, 0x1078, 0x15f2, 0x017f,
+ 0x1078, 0x6283, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02,
+ 0x00c8, 0x6abc, 0x0078, 0x6a69, 0x127f, 0x027f, 0x047f, 0x057f,
+ 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x6a9b, 0xa386, 0x0005, 0x0040, 0x6ab2, 0x1078, 0x6bb3, 0x0078,
+ 0x6aa6, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x6bca,
+ 0x017f, 0x0040, 0x6ae0, 0x601c, 0xa084, 0x000f, 0x1079, 0x6ae3,
+ 0x0e7f, 0x0c7f, 0x007c, 0x6aeb, 0x6aeb, 0x6aeb, 0x6aeb, 0x6aeb,
+ 0x6aeb, 0x6aed, 0x6aeb, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018,
+ 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009,
+ 0x0020, 0x1078, 0x6bf7, 0x017f, 0x047f, 0x1078, 0x6884, 0xa085,
+ 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x33df, 0x157e, 0x017e,
+ 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x6d05, 0x2011, 0x7296,
+ 0x1078, 0x5a35, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005, 0x007c,
+ 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091,
+ 0x8000, 0x2061, 0x7400, 0x2079, 0x0001, 0x8fff, 0x0040, 0x6b73,
+ 0x2071, 0x6d00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x6b73,
+ 0x88ff, 0x0040, 0x6b39, 0x2800, 0xac06, 0x00c0, 0x6b69, 0x2079,
+ 0x0000, 0x1078, 0x6c0f, 0x0040, 0x6b69, 0x2400, 0xac06, 0x0040,
+ 0x6b69, 0x671c, 0xa786, 0x0006, 0x00c0, 0x6b69, 0xa786, 0x0007,
+ 0x0040, 0x6b69, 0x88ff, 0x00c0, 0x6b51, 0x6018, 0xa206, 0x00c0,
+ 0x6b69, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6120, 0x0040, 0x6b5c,
+ 0x047e, 0x1078, 0x6bb3, 0x047f, 0x0d7f, 0x6000, 0xa086, 0x0004,
+ 0x00c0, 0x6b64, 0x1078, 0x15f2, 0x1078, 0x6283, 0x88ff, 0x00c0,
+ 0x6b7c, 0xace0, 0x0008, 0x2001, 0x6d15, 0x2004, 0xac02, 0x00c8,
+ 0x6b73, 0x0078, 0x6b25, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f,
+ 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, 0x6b74,
+ 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078,
+ 0x5387, 0x1078, 0x5428, 0x1078, 0x6b18, 0x087f, 0x007c, 0x027e,
+ 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009,
+ 0x0000, 0x017e, 0x037e, 0x1078, 0x3447, 0x00c0, 0x6ba8, 0x2c10,
+ 0x2041, 0x0000, 0x1078, 0x5387, 0x1078, 0x5428, 0x1078, 0x6b18,
+ 0x037f, 0x017f, 0x8108, 0x00f0, 0x6b99, 0x157f, 0x0c7f, 0x087f,
+ 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x6bc7,
+ 0x6800, 0xa07d, 0x0040, 0x6bc4, 0x6803, 0x0000, 0x6b52, 0x1078,
+ 0x36a1, 0x2f68, 0x0078, 0x6bb8, 0x6b52, 0x1078, 0x36a1, 0x0f7f,
+ 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7400, 0x2071,
+ 0x6d00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6bf2, 0x2100,
+ 0xac06, 0x0040, 0x6be4, 0x6000, 0xa086, 0x0000, 0x0040, 0x6be4,
+ 0x6008, 0xa206, 0x0040, 0x6bee, 0xace0, 0x0008, 0x2001, 0x6d15,
+ 0x2004, 0xac02, 0x00c8, 0x6bf2, 0x0078, 0x6bcf, 0xa085, 0x0001,
+ 0x0078, 0x6bf3, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e,
+ 0x007e, 0x1078, 0x130f, 0x007f, 0x1040, 0x12b7, 0x6837, 0x010d,
+ 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e, 0x6956,
+ 0x6c46, 0x684f, 0x0000, 0x1078, 0x36a1, 0x0d7f, 0x007c, 0x6700,
+ 0xa786, 0x0000, 0x0040, 0x6c22, 0xa786, 0x0001, 0x0040, 0x6c22,
+ 0xa786, 0x000a, 0x0040, 0x6c22, 0xa786, 0x0009, 0x0040, 0x6c22,
+ 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
+ 0x2071, 0x6d00, 0xd5a4, 0x0040, 0x6c30, 0x7034, 0x8000, 0x7036,
+ 0xd5b4, 0x0040, 0x6c36, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040,
+ 0x6c3d, 0x2071, 0x6d0a, 0x1078, 0x6c6c, 0x0e7f, 0x007f, 0x127f,
+ 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6d00,
+ 0xd5a4, 0x0040, 0x6c4e, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040,
+ 0x6c54, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6c5b, 0x2071,
+ 0x6d0a, 0x1078, 0x6c6c, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e,
+ 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6d02, 0x1078, 0x6c6c,
+ 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8,
+ 0x6c75, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071,
+ 0x6d00, 0x1078, 0x6c6c, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6d04,
+ 0x1078, 0x6c6c, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008,
+ 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800,
+ 0x1000, 0x2000, 0x4000, 0x8000, 0x614c
};
-#define ISP2100_CODE_LENGTH 0x5e69
+#define ISP2100_CODE_LENGTH 0x5c95
#endif
-#if !defined(ISP2100_FABRIC) && defined(ISP2100_SCCLUN)
-/************************************************************************
- * *
- * --- ISP2100 Initiator/Target Firmware --- *
- * with expanded LUN addressing. *
- * *
- * *
- ************************************************************************
- * *
- * NOTICE *
- * *
- * COPYRIGHT 1998 QLOGIC CORPORATION *
- * ALL RIGHTS RESERVED *
- * *
- * This computer program is CONFIDENTIAL and contains TRADE SECRETS of *
- * QLOGIC CORPORATION. The receipt or possession of this program does *
- * not convey any rights to reproduce or disclose its contents, or to *
- * manufacture, use, or sell anything that it may describe, in whole or *
- * in part, without the specific written consent of QLOGIC CORPORATION. *
- * Any reproduction of this program without the express written consent *
- * of QLOGIC CORPORATION is a violation of the copyright laws and may *
- * subject you to civil liability and criminal prosecution. *
- * *
- ************************************************************************
- */
+#if 0
/*
- * Firmware Version 1.15.07 (14:38 Oct 13, 1998)
+ * Firmware Version 1.14.06 (15:32 Jul 02, 1998)
*/
-
+#define ISP2100_CODE_VERSION 1*1024+14
static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x5f74, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x0078, 0x1029, 0x0000, 0x5baf, 0x0000, 0x2043, 0x4f50, 0x5952,
0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
- 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6f74, 0x2009, 0x0000, 0x20a9,
- 0x068c, 0x41a4, 0x3400, 0x20c9, 0x73ff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1ff1, 0x2051, 0x7000,
- 0x2a70, 0x705b, 0x8e00, 0x705f, 0xffff, 0x7057, 0x8df9, 0x7063,
- 0x0300, 0x1078, 0x1235, 0x20a1, 0x7600, 0x715c, 0x810d, 0x810d,
+ 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3134, 0x2020, 0x2020,
+ 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6baf, 0x2009, 0x0000, 0x20a9,
+ 0x0651, 0x41a4, 0x3400, 0x20c9, 0x6fff, 0x2091, 0x2000, 0x2059,
+ 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1f6e, 0x2051, 0x6c00,
+ 0x2a70, 0x705b, 0x8a00, 0x705f, 0xffff, 0x7057, 0x89f9, 0x7063,
+ 0x0300, 0x1078, 0x1217, 0x20a1, 0x7200, 0x715c, 0x810d, 0x810d,
0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1200, 0x1078, 0x1321, 0x1078, 0x14a6, 0x1078, 0x192f,
- 0x1078, 0x32e1, 0x1078, 0x5687, 0x1078, 0x12ac, 0x1078, 0x22f7,
- 0x1078, 0x3a1c, 0x1078, 0x37f4, 0x1078, 0x41d0, 0x1078, 0x1dbe,
- 0x1078, 0x4410, 0x1078, 0x3f3d, 0x1078, 0x1cdd, 0x1078, 0x1d9d,
+ 0x1078, 0x11e2, 0x1078, 0x1301, 0x1078, 0x1486, 0x1078, 0x18ce,
+ 0x1078, 0x3162, 0x1078, 0x53b7, 0x1078, 0x128c, 0x1078, 0x2244,
+ 0x1078, 0x37a0, 0x1078, 0x3578, 0x1078, 0x3f4c, 0x1078, 0x1d4c,
+ 0x1078, 0x418b, 0x1078, 0x3cbc, 0x1078, 0x1c74, 0x1078, 0x1d2b,
0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2a59, 0x1078, 0x231f, 0x1078, 0x3a6c,
- 0x1078, 0x38df, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x41e8, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5359, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x112a,
- 0x10cd, 0x117d, 0x11fd, 0x11fe, 0x11ff, 0x1078, 0x1288, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2b7c, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x1127, 0x2011, 0x320e, 0x1078, 0x42aa,
+ 0x00c0, 0x10bd, 0x1078, 0x2967, 0x1078, 0x226c, 0x1078, 0x37f0,
+ 0x1078, 0x3663, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
+ 0x10c1, 0x1078, 0x3f64, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
+ 0x10aa, 0x1078, 0x50d1, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x1130,
+ 0x10cd, 0x1161, 0x11df, 0x11e0, 0x11e1, 0x1078, 0x126a, 0x007c,
+ 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2a02, 0x2079, 0x0100,
+ 0x7844, 0xa005, 0x00c0, 0x112d, 0x2011, 0x308c, 0x1078, 0x4026,
0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b0, 0x1078, 0x2a18, 0x1078, 0x51a4, 0x2011, 0x0004, 0x1078,
- 0x634b, 0x1078, 0x378e, 0x2079, 0x7051, 0x7804, 0xd0ac, 0x00c0,
- 0x1115, 0x2011, 0x0001, 0x1078, 0x634b, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x20a1, 0x2011, 0x0005,
- 0x1078, 0x52b3, 0x1078, 0x49b7, 0x0c7e, 0x2061, 0x0100, 0x60e3,
- 0x0008, 0x0c7f, 0x127f, 0x0078, 0x1129, 0x7083, 0x0000, 0x7087,
- 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x52b3, 0x1078,
- 0x49b7, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f,
- 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff,
- 0x0040, 0x1138, 0x1078, 0x20a1, 0x1078, 0x49b7, 0x0078, 0x117b,
- 0x7080, 0xa005, 0x00c0, 0x117b, 0x2001, 0x7052, 0x2004, 0xd0ac,
- 0x0040, 0x115e, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x017e, 0x1078, 0x34fa, 0x00c0, 0x1151, 0x6000, 0xd0ec, 0x00c0,
- 0x1159, 0x017f, 0x8108, 0x00f0, 0x1148, 0x0c7f, 0x157f, 0x0078,
- 0x115e, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x117b, 0x7003, 0x0003,
- 0x7087, 0xffff, 0x2001, 0x0000, 0x1078, 0x1f8a, 0x1078, 0x2a92,
- 0x2001, 0x71b7, 0x2004, 0xa086, 0x0005, 0x00c0, 0x1173, 0x2011,
- 0x0000, 0x1078, 0x52b3, 0x2011, 0x0000, 0x1078, 0x52bd, 0x1078,
- 0x49b7, 0x1078, 0x4a67, 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010, 0x7942,
- 0x7924, 0xd1b4, 0x0040, 0x118e, 0x7827, 0x0040, 0xd19c, 0x0040,
- 0x1193, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900, 0xa18a,
- 0x0003, 0x0050, 0x11b9, 0x7954, 0xd1ac, 0x00c0, 0x11b9, 0x2009,
- 0x00f8, 0x1078, 0x32b0, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
- 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11b1, 0x7824, 0xd0ac, 0x00c0,
- 0x11ed, 0x00f0, 0x11a9, 0x2001, 0x0001, 0x1078, 0x1f8a, 0x0078,
- 0x11f6, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008, 0x00e0,
- 0x11bf, 0x2091, 0x6000, 0x00f0, 0x11bf, 0x7853, 0x0400, 0x782f,
- 0x0000, 0x2009, 0x00f8, 0x1078, 0x32b0, 0x20a9, 0x000e, 0x0005,
- 0x00f0, 0x11cf, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x11e4,
- 0x7824, 0xd0ac, 0x00c0, 0x11ed, 0x8319, 0x00c0, 0x11da, 0x2001,
- 0x0001, 0x1078, 0x1f8a, 0x0078, 0x11f4, 0x7828, 0xc09d, 0x782a,
- 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f, 0x037f,
- 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x120c,
- 0x704f, 0xffff, 0x0078, 0x120e, 0x704f, 0x0000, 0x7053, 0xffff,
- 0x2061, 0x71a0, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800,
- 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000,
- 0x601f, 0x07d0, 0x2061, 0x71a8, 0x6003, 0x8000, 0x6007, 0x0000,
- 0x600b, 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000,
- 0x601b, 0x0001, 0x601f, 0x0000, 0x007c, 0x1078, 0x125b, 0x2011,
- 0x0000, 0x81ff, 0x0040, 0x125a, 0xa186, 0x0001, 0x00c0, 0x124a,
- 0x705f, 0x8fff, 0x7057, 0x7e01, 0x7063, 0x0100, 0x705b, 0x7e00,
- 0x0078, 0x1258, 0xa186, 0x0002, 0x00c0, 0x1252, 0x2011, 0x0000,
- 0x0078, 0x1258, 0xa186, 0x0005, 0x00c0, 0x1258, 0x2011, 0x0001,
- 0x1078, 0x1282, 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078,
- 0x1282, 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061,
- 0x7fff, 0x2c04, 0xa406, 0x0040, 0x1270, 0xc18d, 0x0078, 0x127d,
- 0xc185, 0x2011, 0x0001, 0x1078, 0x1282, 0x2061, 0xffff, 0x2362,
- 0x2c04, 0xa306, 0x00c0, 0x127d, 0xc195, 0x2011, 0x0001, 0x1078,
- 0x1282, 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c,
- 0x2091, 0x8000, 0x0068, 0x128a, 0x007e, 0x017e, 0x2079, 0x0000,
- 0x7818, 0xa084, 0x0000, 0x00c0, 0x1290, 0x017f, 0x792e, 0x007f,
- 0x782a, 0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b,
- 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0x7000, 0x7803,
- 0x0005, 0x0078, 0x12a9, 0x007c, 0x2071, 0x7000, 0x7158, 0x712e,
- 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12c2,
- 0x705c, 0xa302, 0x00c8, 0x12c2, 0x220a, 0x2208, 0x2310, 0x8420,
- 0x0078, 0x12b4, 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x7000, 0x7098, 0xa0ea, 0x0010,
- 0x00c8, 0x12d5, 0xa06e, 0x0078, 0x12df, 0x8001, 0x709a, 0x702c,
+ 0x73b0, 0x1078, 0x2926, 0x1078, 0x4f22, 0x2011, 0x0004, 0x1078,
+ 0x5fe2, 0x1078, 0x3512, 0x2079, 0x6c51, 0x7804, 0xd0ac, 0x00c0,
+ 0x1115, 0x2011, 0x0001, 0x1078, 0x5fe2, 0x7083, 0x0000, 0x7087,
+ 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x201e, 0x2011, 0x0005,
+ 0x1078, 0x502b, 0x1078, 0x4713, 0x0c7e, 0x2061, 0x0100, 0x60e3,
+ 0x0008, 0x0c7f, 0x127f, 0x0078, 0x112f, 0x7003, 0x0003, 0x2001,
+ 0x0000, 0x1078, 0x1f0f, 0x2011, 0x0000, 0x1078, 0x502b, 0x2011,
+ 0x0000, 0x1078, 0x5035, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008,
+ 0x0c7f, 0x1078, 0x4713, 0x1078, 0x47c3, 0x0f7f, 0x127f, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff, 0x0040, 0x113e,
+ 0x1078, 0x201e, 0x1078, 0x4713, 0x0078, 0x115f, 0x7080, 0xa005,
+ 0x00c0, 0x115f, 0x7003, 0x0003, 0x7087, 0xffff, 0x2001, 0x0000,
+ 0x1078, 0x1f0f, 0x1078, 0x29a0, 0x2001, 0x6db1, 0x2004, 0xa086,
+ 0x0005, 0x00c0, 0x1157, 0x2011, 0x0000, 0x1078, 0x502b, 0x2011,
+ 0x0000, 0x1078, 0x5035, 0x1078, 0x4713, 0x1078, 0x47c3, 0x127f,
+ 0x007c, 0x017e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0100,
+ 0x7843, 0x0000, 0x7924, 0xd1b4, 0x0040, 0x1170, 0x7827, 0x0040,
+ 0xd19c, 0x0040, 0x1175, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e,
+ 0x7900, 0xa18a, 0x0003, 0x0050, 0x119b, 0x7954, 0xd1ac, 0x00c0,
+ 0x119b, 0x2009, 0x00f8, 0x1078, 0x3131, 0x7843, 0x0090, 0x7843,
+ 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x1193, 0x7824,
+ 0xd0ac, 0x00c0, 0x11cf, 0x00f0, 0x118b, 0x2001, 0x0001, 0x1078,
+ 0x1f0f, 0x0078, 0x11d8, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9,
+ 0x0008, 0x00e0, 0x11a1, 0x2091, 0x6000, 0x00f0, 0x11a1, 0x7853,
+ 0x0400, 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x3131, 0x20a9,
+ 0x000e, 0x0005, 0x00f0, 0x11b1, 0x7853, 0x1400, 0x7843, 0x0090,
+ 0x7843, 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c,
+ 0x0040, 0x11c6, 0x7824, 0xd0ac, 0x00c0, 0x11cf, 0x8319, 0x00c0,
+ 0x11bc, 0x2001, 0x0001, 0x1078, 0x1f0f, 0x0078, 0x11d6, 0x7828,
+ 0xc09d, 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400,
+ 0x157f, 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c,
+ 0x007c, 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002,
+ 0x0048, 0x11ee, 0x704f, 0xffff, 0x0078, 0x11f0, 0x704f, 0x0000,
+ 0x7053, 0xffff, 0x2061, 0x6da0, 0x6003, 0x0909, 0x6007, 0x0000,
+ 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003,
+ 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061, 0x6da8, 0x6003, 0x8000,
+ 0x6007, 0x0000, 0x600b, 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff,
+ 0x6017, 0x0000, 0x601b, 0x0001, 0x601f, 0x0000, 0x007c, 0x1078,
+ 0x123d, 0x2011, 0x0000, 0x81ff, 0x0040, 0x123c, 0xa186, 0x0001,
+ 0x00c0, 0x122c, 0x705f, 0x8fff, 0x7057, 0x7a01, 0x7063, 0x0100,
+ 0x705b, 0x7a00, 0x0078, 0x123a, 0xa186, 0x0002, 0x00c0, 0x1234,
+ 0x2011, 0x0000, 0x0078, 0x123a, 0xa186, 0x0005, 0x00c0, 0x123a,
+ 0x2011, 0x0001, 0x1078, 0x1264, 0x007c, 0x2009, 0x0000, 0x2011,
+ 0x0000, 0x1078, 0x1264, 0x2019, 0xaaaa, 0x2061, 0xffff, 0x2362,
+ 0x2c24, 0x2061, 0x7fff, 0x2c04, 0xa406, 0x0040, 0x1252, 0xc18d,
+ 0x0078, 0x125f, 0xc185, 0x2011, 0x0001, 0x1078, 0x1264, 0x2061,
+ 0xffff, 0x2362, 0x2c04, 0xa306, 0x00c0, 0x125f, 0xc195, 0x2011,
+ 0x0001, 0x1078, 0x1264, 0x007c, 0x3800, 0xa084, 0xfffc, 0xa205,
+ 0x20c0, 0x007c, 0x2091, 0x8000, 0x0068, 0x126c, 0x007e, 0x017e,
+ 0x2079, 0x0000, 0x7818, 0xa084, 0x0000, 0x00c0, 0x1272, 0x017f,
+ 0x792e, 0x007f, 0x782a, 0x007f, 0x7826, 0x7823, 0x8002, 0x781b,
+ 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0x6c00, 0x7803,
+ 0x0005, 0x0078, 0x1289, 0x007c, 0x2071, 0x6c00, 0x7158, 0x712e,
+ 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12a2,
+ 0x705c, 0xa302, 0x00c8, 0x12a2, 0x220a, 0x2208, 0x2310, 0x8420,
+ 0x0078, 0x1294, 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e,
+ 0x127e, 0x2091, 0x8000, 0x2071, 0x6c00, 0x7098, 0xa0ea, 0x0010,
+ 0x00c8, 0x12b5, 0xa06e, 0x0078, 0x12bf, 0x8001, 0x709a, 0x702c,
0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f,
- 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7000, 0x127e, 0x2091, 0x8000,
- 0x7098, 0x8001, 0x00c8, 0x12ef, 0xa06e, 0x0078, 0x12f8, 0x709a,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6c00, 0x127e, 0x2091, 0x8000,
+ 0x7098, 0x8001, 0x00c8, 0x12cf, 0xa06e, 0x0078, 0x12d8, 0x709a,
0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000,
0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7000, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a,
- 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x1317, 0x6804, 0x6807,
- 0x0000, 0x007e, 0x1078, 0x12fb, 0x0d7f, 0x0078, 0x130b, 0x007c,
- 0x0e7e, 0x2071, 0x7000, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x71d9, 0x7007, 0x0000, 0x701b, 0x0000,
+ 0x6c00, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a,
+ 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x12f7, 0x6804, 0x6807,
+ 0x0000, 0x007e, 0x1078, 0x12db, 0x0d7f, 0x0078, 0x12eb, 0x007c,
+ 0x0e7e, 0x2071, 0x6c00, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f,
+ 0x007c, 0x0e7e, 0x2071, 0x6dd3, 0x7007, 0x0000, 0x701b, 0x0000,
0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012,
- 0x0e7f, 0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x71d9,
- 0x7018, 0xa088, 0x71e2, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a,
- 0x7004, 0xa005, 0x00c0, 0x134a, 0x0f7e, 0x2079, 0x0010, 0x1078,
- 0x135b, 0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x71d9, 0x7004,
- 0xa005, 0x00c0, 0x1359, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x135b,
- 0x0f7f, 0x0e7f, 0x007c, 0x7000, 0x0079, 0x135e, 0x1362, 0x13cc,
- 0x13e9, 0x13e9, 0x7018, 0x711c, 0xa106, 0x00c0, 0x136a, 0x7007,
- 0x0000, 0x007c, 0x0d7e, 0xa180, 0x71e2, 0x2004, 0x700a, 0x2068,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x6dd3,
+ 0x7018, 0xa088, 0x6ddc, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a,
+ 0x7004, 0xa005, 0x00c0, 0x132a, 0x0f7e, 0x2079, 0x0010, 0x1078,
+ 0x133b, 0x0f7f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6dd3, 0x7004,
+ 0xa005, 0x00c0, 0x1339, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x133b,
+ 0x0f7f, 0x0e7f, 0x007c, 0x7000, 0x0079, 0x133e, 0x1342, 0x13ac,
+ 0x13c9, 0x13c9, 0x7018, 0x711c, 0xa106, 0x00c0, 0x134a, 0x7007,
+ 0x0000, 0x007c, 0x0d7e, 0xa180, 0x6ddc, 0x2004, 0x700a, 0x2068,
0x8108, 0xa18c, 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832,
0x6828, 0x7836, 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e,
- 0x680c, 0x7016, 0x6804, 0x0d7f, 0xd084, 0x0040, 0x138c, 0x7007,
- 0x0001, 0x1078, 0x1391, 0x007c, 0x7007, 0x0002, 0x1078, 0x13a7,
+ 0x680c, 0x7016, 0x6804, 0x0d7f, 0xd084, 0x0040, 0x136c, 0x7007,
+ 0x0001, 0x1078, 0x1371, 0x007c, 0x7007, 0x0002, 0x1078, 0x1387,
0x007c, 0x017e, 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040,
- 0x00c8, 0x139c, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822,
+ 0x00c8, 0x137c, 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822,
0x7803, 0x0020, 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e,
0x027e, 0x137e, 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014,
0x7803, 0x0026, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8,
- 0x13bb, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822,
+ 0x139b, 0x2110, 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822,
0x7803, 0x0020, 0x7803, 0x0001, 0x3300, 0x7016, 0x157f, 0x147f,
0x137f, 0x027f, 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099,
- 0x70e5, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
+ 0x6ce5, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
0x127e, 0x2091, 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000,
- 0xc084, 0x7002, 0x700b, 0x70e0, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x7114, 0x209c, 0x20a1,
- 0x0014, 0x7803, 0x0026, 0x2001, 0x7115, 0x20ac, 0x53a6, 0x2099,
- 0x7116, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
+ 0xc084, 0x7002, 0x700b, 0x6ce0, 0x127f, 0x157f, 0x147f, 0x137f,
+ 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x6d14, 0x209c, 0x20a1,
+ 0x0014, 0x7803, 0x0026, 0x2001, 0x6d15, 0x20ac, 0x53a6, 0x2099,
+ 0x6d16, 0x20a1, 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020,
0x127e, 0x2091, 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000,
- 0xc08c, 0x7002, 0x700b, 0x7111, 0x127f, 0x157f, 0x147f, 0x137f,
- 0x007c, 0x017e, 0x0e7e, 0x2071, 0x71d9, 0x0f7e, 0x2079, 0x0010,
- 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0040, 0x142c, 0xa18c, 0x0700,
- 0x0040, 0x1429, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078,
- 0x142c, 0x7004, 0x1079, 0x1430, 0x0f7f, 0x0e7f, 0x017f, 0x007c,
- 0x135b, 0x1438, 0x145a, 0x1474, 0x149d, 0x1436, 0x0078, 0x1436,
+ 0xc08c, 0x7002, 0x700b, 0x6d11, 0x127f, 0x157f, 0x147f, 0x137f,
+ 0x007c, 0x017e, 0x0e7e, 0x2071, 0x6dd3, 0x0f7e, 0x2079, 0x0010,
+ 0x7904, 0x7803, 0x0002, 0xd1fc, 0x0040, 0x140c, 0xa18c, 0x0700,
+ 0x0040, 0x1409, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078,
+ 0x140c, 0x7004, 0x1079, 0x1410, 0x0f7f, 0x0e7f, 0x017f, 0x007c,
+ 0x133b, 0x1418, 0x143a, 0x1454, 0x147d, 0x1416, 0x0078, 0x1416,
0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803,
0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f,
- 0x137f, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x1391, 0x007c,
+ 0x137f, 0x700c, 0xa005, 0x0040, 0x1441, 0x1078, 0x1371, 0x007c,
0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078,
- 0x135b, 0x007c, 0x700c, 0xa005, 0x0040, 0x1461, 0x1078, 0x13a7,
+ 0x133b, 0x007c, 0x700c, 0xa005, 0x0040, 0x1441, 0x1078, 0x1387,
0x007c, 0x0d7e, 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a,
0x7838, 0x682e, 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007,
- 0x0000, 0x1078, 0x135b, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001,
- 0x70e3, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803,
- 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0x70e5, 0x2004, 0xd0bc,
- 0x0040, 0x1493, 0x2001, 0x70ee, 0x2004, 0xa080, 0x000d, 0x20a0,
+ 0x0000, 0x1078, 0x133b, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001,
+ 0x6ce3, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803,
+ 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0x6ce5, 0x2004, 0xd0bc,
+ 0x0040, 0x1473, 0x2001, 0x6cee, 0x2004, 0xa080, 0x000d, 0x20a0,
0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007, 0x0000,
- 0x1078, 0x3b15, 0x1078, 0x135b, 0x007c, 0x2001, 0x7113, 0x2003,
- 0x0100, 0x7007, 0x0000, 0x1078, 0x135b, 0x007c, 0x127e, 0x2091,
- 0x2100, 0x2079, 0x0030, 0x2071, 0x71ea, 0x7003, 0x0000, 0x700f,
- 0x71f0, 0x7013, 0x71f0, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x14bc, 0x14c4, 0x150a, 0x14c4, 0x14c4,
- 0x14c4, 0x14ef, 0x14d3, 0x14c8, 0xa085, 0x0001, 0x0078, 0x1524,
- 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c, 0x682a,
- 0x6858, 0x0078, 0x1512, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0,
- 0x14c4, 0x684c, 0xd0bc, 0x0040, 0x14c4, 0x6860, 0x682e, 0x685c,
+ 0x1078, 0x3899, 0x1078, 0x133b, 0x007c, 0x2001, 0x6d13, 0x2003,
+ 0x0100, 0x7007, 0x0000, 0x1078, 0x133b, 0x007c, 0x127e, 0x2091,
+ 0x2100, 0x2079, 0x0030, 0x2071, 0x6de4, 0x7003, 0x0000, 0x700f,
+ 0x6dea, 0x7013, 0x6dea, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934,
+ 0xa184, 0x0007, 0x0079, 0x149c, 0x14a4, 0x14ea, 0x14a4, 0x14a4,
+ 0x14a4, 0x14cf, 0x14b3, 0x14a8, 0xa085, 0x0001, 0x0078, 0x1504,
+ 0x684c, 0xd0bc, 0x0040, 0x14a4, 0x6860, 0x682e, 0x685c, 0x682a,
+ 0x6858, 0x0078, 0x14f2, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0,
+ 0x14a4, 0x684c, 0xd0bc, 0x0040, 0x14a4, 0x6860, 0x682e, 0x685c,
0x682a, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0x6858, 0x0078, 0x151a, 0xa18c,
- 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14c4, 0x684c, 0xd0ac, 0x0040,
- 0x14c4, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
- 0xa080, 0x1beb, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858,
- 0x0078, 0x151a, 0x684c, 0xd0ac, 0x0040, 0x14c4, 0xa006, 0x682e,
- 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1beb, 0x210c, 0x6932,
+ 0xa080, 0x1b82, 0x2004, 0x6832, 0x6858, 0x0078, 0x14fa, 0xa18c,
+ 0x00ff, 0xa186, 0x0015, 0x00c0, 0x14a4, 0x684c, 0xd0ac, 0x0040,
+ 0x14a4, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
+ 0xa080, 0x1b82, 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858,
+ 0x0078, 0x14fa, 0x684c, 0xd0ac, 0x0040, 0x14a4, 0xa006, 0x682e,
+ 0x682a, 0x6858, 0xa18c, 0x000f, 0xa188, 0x1b82, 0x210c, 0x6932,
0x2d08, 0x691a, 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1,
- 0x2000, 0x2001, 0x020a, 0x2004, 0x82ff, 0x0040, 0x153f, 0xa280,
- 0x0004, 0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x153b, 0x1078,
- 0x14b7, 0x10c0, 0x1288, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e,
- 0x047e, 0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f,
- 0x7000, 0xa005, 0x00c0, 0x1553, 0x7206, 0x2001, 0x1567, 0x007e,
- 0x2260, 0x0078, 0x167f, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108,
- 0x240a, 0x8108, 0xa182, 0x720b, 0x0048, 0x1560, 0x2009, 0x71f0,
- 0x710e, 0x7000, 0xa005, 0x00c0, 0x1567, 0x1078, 0x1668, 0x127f,
- 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100,
- 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110,
- 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x15bb, 0x6808, 0xa005,
- 0x0040, 0x1621, 0x7000, 0xa005, 0x00c0, 0x1588, 0x0078, 0x15b5,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1625, 0x7004, 0xa406, 0x00c0,
- 0x15b5, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x159e, 0x047e,
- 0x1078, 0x1737, 0x047f, 0x2460, 0x0078, 0x157e, 0x2001, 0x0207,
- 0x2004, 0xd09c, 0x00c0, 0x1591, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x15af, 0xa086, 0x6000, 0x0040, 0x15af, 0x0078, 0x1591, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x571c, 0x0078, 0x1625, 0x6808, 0xa005, 0x0040, 0x1621, 0x7000,
- 0xa005, 0x00c0, 0x15c5, 0x0078, 0x1621, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x15ce, 0x7004, 0xa406, 0x00c0, 0x1621, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15db, 0x047e, 0x1078, 0x1737, 0x047f,
- 0x2460, 0x0078, 0x15bb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15ce, 0x2001, 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15d4, 0x7804,
- 0xa084, 0x6000, 0x0040, 0x15f2, 0xa086, 0x6000, 0x0040, 0x15f2,
- 0x0078, 0x15ce, 0x7007, 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e,
- 0x0001, 0x0040, 0x1613, 0xa08e, 0x0002, 0x00c0, 0x1621, 0x0c7e,
- 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1bc0, 0x2804, 0xac70, 0x6034,
- 0xd09c, 0x00c0, 0x160f, 0x7308, 0x720c, 0x0078, 0x1611, 0x7310,
- 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211, 0x6810,
- 0xa300, 0x6812, 0x6814, 0xa201, 0x6816, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x2009, 0x0048, 0x1078, 0x571c, 0x0c7f, 0x0d7f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x71ea, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1665, 0x7004, 0xac06, 0x00c0, 0x1656, 0x2079, 0x0030,
- 0x7804, 0xd0fc, 0x00c0, 0x1652, 0x2001, 0x0207, 0x2004, 0xd09c,
- 0x00c0, 0x1638, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1644,
- 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, 0x0000,
- 0x0078, 0x1656, 0x1078, 0x1737, 0x0078, 0x162d, 0x157e, 0x20a9,
- 0x0009, 0x2009, 0x71f0, 0x2104, 0xac06, 0x00c0, 0x1660, 0x200a,
- 0xa188, 0x0003, 0x00f0, 0x165b, 0x157f, 0x0e7f, 0x0f7f, 0x007c,
- 0x700c, 0x7110, 0xa106, 0x00c0, 0x1670, 0x7003, 0x0000, 0x007c,
- 0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108,
- 0xa182, 0x720b, 0x0048, 0x167e, 0x2009, 0x71f0, 0x7112, 0x8cff,
- 0x00c0, 0x169e, 0x7908, 0xd1ec, 0x00c0, 0x1692, 0x1078, 0x190d,
- 0x0040, 0x1692, 0x7803, 0x0009, 0x7904, 0xd1fc, 0x0040, 0x168c,
- 0x7803, 0x0006, 0x7007, 0x0000, 0x1078, 0x190d, 0x0040, 0x16c5,
- 0x7803, 0x0019, 0x7003, 0x0003, 0x0078, 0x16c5, 0x6010, 0x2068,
- 0x2d58, 0x6828, 0xa406, 0x00c0, 0x16a9, 0x682c, 0xa306, 0x0040,
- 0x16ad, 0x1078, 0x1c0b, 0x00c0, 0x1682, 0x684c, 0xd0f4, 0x00c0,
- 0x1682, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034,
- 0xa0cc, 0x000f, 0x2009, 0x0011, 0x1078, 0x16c6, 0x0040, 0x16c4,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x2d58, 0x007c, 0x8aff, 0x0040,
- 0x1732, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x16e5, 0x0d7e,
- 0x2804, 0xac68, 0x2900, 0x0079, 0x16d5, 0x1714, 0x16f5, 0x16f5,
- 0x1714, 0x1714, 0x170c, 0x1714, 0x16f5, 0x1714, 0x16fb, 0x16fb,
- 0x1714, 0x1714, 0x1714, 0x1703, 0x16fb, 0xc0fc, 0x6852, 0x6b6c,
- 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x1717, 0x2804,
- 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1717, 0x6b08, 0x6a0c, 0x6d00,
- 0x6c04, 0x0078, 0x1717, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08,
- 0x6e0c, 0x0078, 0x1717, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff,
- 0xa086, 0x001e, 0x00c0, 0x1714, 0x0d7f, 0x1078, 0x1ba7, 0x00c0,
- 0x16c6, 0xa00e, 0x0078, 0x1732, 0x0d7f, 0x1078, 0x1288, 0x7b22,
- 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000,
- 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e,
- 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816,
- 0x1078, 0x1ba7, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1735, 0xa184, 0x0003,
- 0xa086, 0x0003, 0x0040, 0x1735, 0x7000, 0x0079, 0x174f, 0x1757,
- 0x1759, 0x182a, 0x188e, 0x18a5, 0x1757, 0x1757, 0x1757, 0x1078,
- 0x1288, 0x8001, 0x7002, 0xa184, 0x0880, 0x00c0, 0x176e, 0x8aff,
- 0x0040, 0x17ca, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0040, 0x18b7,
- 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0xd1dc, 0x0040, 0x17b9, 0x027e, 0x037e, 0x6b28,
- 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a,
- 0x6a2e, 0x7820, 0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101,
- 0x6816, 0x037f, 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078,
- 0x1bc0, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003,
- 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x17ab, 0x684c, 0xd0e4, 0x0040, 0x17ab, 0x7004, 0x2060, 0x2009,
- 0x0048, 0x1078, 0x571c, 0x7808, 0xd0ec, 0x00c0, 0x17b5, 0x7803,
- 0x0009, 0x7003, 0x0004, 0x0078, 0x18b7, 0x1078, 0x1668, 0x0078,
- 0x18b7, 0x057e, 0x7d0c, 0x1078, 0x6f20, 0x057f, 0x1078, 0x18bb,
- 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0,
- 0x17e2, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x17de,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x571c, 0x1078, 0x1668,
- 0x0078, 0x18b7, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183,
- 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188, 0x0007,
- 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004, 0xa20a,
- 0x810b, 0x810b, 0x810b, 0x1078, 0x18ea, 0x7803, 0x0004, 0x780f,
- 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1803, 0x7803,
- 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007, 0x0000,
- 0x2060, 0x2009, 0x0048, 0x1078, 0x571c, 0x1078, 0x190d, 0x0040,
- 0x17de, 0x7908, 0xd1ec, 0x00c0, 0x1821, 0x2009, 0x0009, 0x0078,
- 0x1823, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003, 0x0003,
- 0x0078, 0x18b7, 0x8001, 0x7002, 0xd194, 0x0040, 0x183c, 0x7804,
- 0xd0fc, 0x00c0, 0x173f, 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001,
- 0x1078, 0x16c6, 0x0078, 0x18b7, 0xa184, 0x0880, 0x00c0, 0x1849,
- 0x8aff, 0x0040, 0x18b7, 0x2009, 0x0001, 0x1078, 0x16c6, 0x0078,
- 0x18b7, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x187d,
- 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0, 0x0d7e, 0x0f7e,
- 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x186d, 0x6808,
- 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c,
- 0x7814, 0xa101, 0x7816, 0x0078, 0x1879, 0x6810, 0x2008, 0xa31a,
- 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101,
- 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x1779, 0x057e, 0x7d0c, 0x1078,
- 0x6f20, 0x057f, 0x1078, 0x18bb, 0x697c, 0x6912, 0x6980, 0x6916,
- 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b7, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x18a1, 0x6808, 0x8001,
- 0x680a, 0x00c0, 0x18a1, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x571c, 0x1078, 0x1668, 0x0078, 0x18b7, 0x7803, 0x0004, 0x7003,
- 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x18a1, 0x2068,
- 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x167f, 0x017f,
- 0x007f, 0x127f, 0x007c, 0x1078, 0x18cc, 0x20e1, 0x9028, 0x700f,
- 0x71f0, 0x7013, 0x71f0, 0x2001, 0x015d, 0x200c, 0x810a, 0x2102,
- 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014, 0x2003,
- 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0,
- 0x18e9, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0, 0x18e9,
- 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x18e9, 0x8421, 0x00c0,
- 0x18d3, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200, 0x7808,
- 0xa084, 0xf000, 0xa10d, 0x1078, 0x18cc, 0x20e1, 0x7000, 0x7324,
- 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e,
- 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138,
- 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908,
- 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x191a, 0xa085, 0x0001,
- 0x0078, 0x192c, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1925, 0x20e1,
- 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c,
- 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e,
- 0x2071, 0x720b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280,
- 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x19b1, 0x6934, 0xa184,
- 0x0007, 0x0079, 0x1943, 0x194b, 0x199c, 0x194b, 0x194b, 0x194b,
- 0x1981, 0x195e, 0x194d, 0x1078, 0x1288, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x19a4, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x194b, 0x684c, 0xd0b4, 0x0040,
- 0x1ab3, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c,
- 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0x0078,
- 0x19ad, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x19b1, 0x684c,
- 0xd0b4, 0x0040, 0x1ab3, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004,
- 0xa084, 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6958, 0xa006,
- 0x682e, 0x682a, 0x0078, 0x19ad, 0x684c, 0xd0b4, 0x0040, 0x1733,
- 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084,
- 0x000f, 0xa080, 0x1beb, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd,
- 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc,
- 0x10c0, 0x1ab7, 0x0e7e, 0x0d7e, 0x2071, 0x720b, 0x7000, 0xa005,
- 0x00c0, 0x1a2d, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004,
- 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e,
- 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004,
- 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060,
- 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007,
- 0x0040, 0x19ef, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108,
- 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a,
- 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0,
- 0x1a06, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a13, 0x037e, 0x047e,
- 0x6b14, 0x6c10, 0x1078, 0x1c0b, 0x047f, 0x037f, 0x0040, 0x1a13,
- 0x0c7f, 0x0078, 0x1a2d, 0x8aff, 0x00c0, 0x1a1b, 0x0c7f, 0xa085,
- 0x0001, 0x0078, 0x1a2d, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020,
- 0x2009, 0x0001, 0x1078, 0x1a31, 0x0040, 0x1a2a, 0x2009, 0x0001,
- 0x1078, 0x1a31, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff,
- 0x0040, 0x1aac, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203,
- 0x0048, 0x1aab, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1a5e,
- 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1a4e, 0x1a8d, 0x1a6e,
- 0x1a6e, 0x1a8d, 0x1a8d, 0x1a85, 0x1a8d, 0x1a6e, 0x1a8d, 0x1a74,
- 0x1a74, 0x1a8d, 0x1a8d, 0x1a8d, 0x1a7c, 0x1a74, 0xc0fc, 0x6852,
- 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a91, 0x0d7e,
- 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x6b08, 0x6a0c,
- 0x6d00, 0x6c04, 0x0078, 0x1a90, 0x6b10, 0x6a14, 0x6d00, 0x6c04,
- 0x6f08, 0x6e0c, 0x0078, 0x1a90, 0x0d7f, 0x0d7e, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1a8d, 0x0d7f, 0x1078, 0x1ba7,
- 0x00c0, 0x1a37, 0xa00e, 0x0078, 0x1aac, 0x0d7f, 0x1078, 0x1288,
- 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902,
- 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201,
- 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078,
- 0x1ba7, 0x0078, 0x1aac, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f,
- 0x067f, 0x077f, 0x007c, 0x1078, 0x1288, 0x1078, 0x1288, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x2079, 0x0020, 0x2071, 0x720b, 0x2b68, 0x6818, 0x2060, 0x7904,
- 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1ab5, 0x7000, 0x0079,
- 0x1ad1, 0x1b78, 0x1ad5, 0x1b45, 0x1b76, 0x8001, 0x7002, 0xd19c,
- 0x00c0, 0x1ae9, 0x8aff, 0x0040, 0x1b08, 0x2009, 0x0001, 0x1078,
- 0x1a31, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31, 0x0078,
- 0x1b78, 0x7803, 0x0004, 0xd194, 0x0040, 0x1af9, 0x6850, 0xc0fc,
- 0x6852, 0x8aff, 0x00c0, 0x1afe, 0x684c, 0xc0f5, 0x684e, 0x0078,
- 0x1afe, 0x1078, 0x1bc0, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826,
- 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b78,
- 0x711c, 0x81ff, 0x0040, 0x1b1e, 0x7918, 0x7922, 0x7827, 0x0000,
- 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e,
- 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1b78, 0x0f7e, 0x027e,
- 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284,
- 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1b2c,
- 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803,
- 0x0008, 0x7003, 0x0000, 0x0078, 0x1b78, 0x8001, 0x7002, 0xd194,
- 0x0040, 0x1b5a, 0x7804, 0xd0fc, 0x00c0, 0x1ac7, 0xd19c, 0x00c0,
- 0x1b74, 0x8aff, 0x0040, 0x1b78, 0x2009, 0x0001, 0x1078, 0x1a31,
- 0x0078, 0x1b78, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1bc0,
- 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b6d, 0x6808,
- 0xa31a, 0x680c, 0xa213, 0x0078, 0x1b71, 0x6810, 0xa31a, 0x6814,
- 0xa213, 0x0d7f, 0x0078, 0x1af9, 0x0078, 0x1af9, 0x1078, 0x1288,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c,
- 0x0f7e, 0x0e7e, 0x2071, 0x720b, 0x7000, 0xa086, 0x0000, 0x0040,
- 0x1ba4, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040,
- 0x1b8b, 0x1078, 0x1ab7, 0x7000, 0xa086, 0x0000, 0x00c0, 0x1b8b,
- 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1b9a, 0x20e1, 0x9040,
- 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840,
- 0x2804, 0xa005, 0x00c0, 0x1bbb, 0x6004, 0xa005, 0x0040, 0x1bbd,
- 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1beb, 0x2044,
- 0x88ff, 0x1040, 0x1288, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c,
- 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1bda, 0x2c00, 0xad06,
- 0x0040, 0x1bcf, 0x6000, 0xa005, 0x00c0, 0x1bcf, 0x2d00, 0x2060,
- 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1bfb, 0x2044, 0x88ff,
- 0x1040, 0x1288, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d,
- 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021,
- 0x0027, 0x0000, 0x0000, 0x0000, 0x1be0, 0x1bdc, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be0, 0x0000, 0x1be7, 0x1be4, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be7, 0x0000, 0x1be2, 0x1be2, 0x0000, 0x0000,
- 0x1bea, 0x0000, 0x1be2, 0x0000, 0x1be8, 0x1be8, 0x0000, 0x0000,
- 0x0000, 0x1bea, 0x1be8, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055,
- 0x0040, 0x1ca8, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1beb,
- 0xa986, 0x0007, 0x0040, 0x1c24, 0xa986, 0x000e, 0x0040, 0x1c24,
- 0xa986, 0x000f, 0x00c0, 0x1c28, 0x605c, 0xa422, 0x6060, 0xa31a,
- 0x2804, 0xa045, 0x00c0, 0x1c36, 0x0050, 0x1c30, 0x0078, 0x1ca8,
- 0x6004, 0xa065, 0x0040, 0x1ca8, 0x0078, 0x1c13, 0x2804, 0xa005,
- 0x0040, 0x1c54, 0xac68, 0xd99c, 0x00c0, 0x1c44, 0x6808, 0xa422,
- 0x680c, 0xa31b, 0x0078, 0x1c48, 0x6810, 0xa422, 0x6814, 0xa31b,
- 0x0048, 0x1c73, 0x2300, 0xa405, 0x0040, 0x1c5a, 0x8a51, 0x0040,
- 0x1ca8, 0x8840, 0x0078, 0x1c36, 0x6004, 0xa065, 0x0040, 0x1ca8,
- 0x0078, 0x1c13, 0x8a51, 0x0040, 0x1ca8, 0x8840, 0x2804, 0xa005,
- 0x00c0, 0x1c6d, 0x6004, 0xa065, 0x0040, 0x1ca8, 0x6034, 0xa0cc,
- 0x000f, 0xa9c0, 0x1beb, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc,
- 0x6852, 0x0078, 0x1ca0, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000,
- 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c8e,
- 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x1288,
- 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1c9a, 0x6910, 0x2400,
- 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x1288, 0x6800, 0xa420,
- 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852,
- 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1cad,
- 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005,
- 0x2004, 0xa084, 0x0007, 0x0079, 0x1cb5, 0x1cbd, 0x1cbe, 0x1cc1,
- 0x1cc4, 0x1cc9, 0x1ccc, 0x1cd1, 0x1cd6, 0x007c, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1737, 0x007c, 0x1078, 0x1737, 0x1078, 0x1ab7,
- 0x007c, 0x1078, 0x1411, 0x007c, 0x1078, 0x1ab7, 0x1078, 0x1411,
- 0x007c, 0x1078, 0x1737, 0x1078, 0x1411, 0x007c, 0x1078, 0x1737,
- 0x1078, 0x1ab7, 0x1078, 0x1411, 0x007c, 0x127e, 0x2091, 0x2300,
- 0x2079, 0x0200, 0x2071, 0x7480, 0x2069, 0x7000, 0x2009, 0x0004,
- 0x7912, 0x7817, 0x0004, 0x1078, 0x1fb7, 0x781b, 0x0002, 0x20e1,
- 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084,
- 0x0007, 0x0079, 0x1cfb, 0x1d1f, 0x1d03, 0x1d07, 0x1d0b, 0x1d11,
- 0x1d15, 0x1d19, 0x1d1d, 0x1078, 0x3f46, 0x0078, 0x1d1f, 0x1078,
- 0x3f75, 0x0078, 0x1d1f, 0x1078, 0x3f46, 0x1078, 0x3f75, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x0078,
- 0x1d1f, 0x1078, 0x1d21, 0x0078, 0x1d1f, 0x1078, 0x1d21, 0x127f,
- 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040,
- 0x1d2b, 0x1078, 0x1288, 0xa184, 0x0030, 0x0040, 0x1d3c, 0x6a00,
- 0xa286, 0x0003, 0x00c0, 0x1d36, 0x1078, 0x1288, 0x1078, 0x3247,
- 0x20e1, 0x9010, 0x0078, 0x1d48, 0xa184, 0x00c0, 0x0040, 0x1d42,
- 0x1078, 0x1288, 0xa184, 0x0300, 0x0040, 0x1d48, 0x20e1, 0x9020,
- 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e,
- 0x2071, 0x7000, 0x7128, 0x2001, 0x71a3, 0x2102, 0x2001, 0x71ab,
- 0x2102, 0xa182, 0x0211, 0x00c8, 0x1d61, 0x2009, 0x0008, 0x0078,
- 0x1d8b, 0xa182, 0x0259, 0x00c8, 0x1d69, 0x2009, 0x0007, 0x0078,
- 0x1d8b, 0xa182, 0x02c1, 0x00c8, 0x1d71, 0x2009, 0x0006, 0x0078,
- 0x1d8b, 0xa182, 0x0349, 0x00c8, 0x1d79, 0x2009, 0x0005, 0x0078,
- 0x1d8b, 0xa182, 0x0421, 0x00c8, 0x1d81, 0x2009, 0x0004, 0x0078,
- 0x1d8b, 0xa182, 0x0581, 0x00c8, 0x1d89, 0x2009, 0x0003, 0x0078,
- 0x1d8b, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182, 0x0005,
- 0x00c8, 0x1d95, 0x7916, 0x0078, 0x1d97, 0x7817, 0x0004, 0x1078,
- 0x1fb7, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200,
- 0x2061, 0x0100, 0x2071, 0x7000, 0x6024, 0x6026, 0x6033, 0x00ef,
- 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7,
- 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x00af,
- 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x702b,
- 0x2003, 0x0000, 0x2001, 0x702a, 0x2003, 0x0001, 0x007c, 0x127e,
- 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c,
- 0x00c0, 0x1dd6, 0xa184, 0x0007, 0x0079, 0x1ddc, 0xa195, 0x0004,
- 0xa284, 0x0007, 0x0079, 0x1ddc, 0x1e08, 0x1de4, 0x1de8, 0x1dec,
- 0x1df2, 0x1df6, 0x1dfc, 0x1e02, 0x1078, 0x4423, 0x0078, 0x1e08,
- 0x1078, 0x4512, 0x0078, 0x1e08, 0x1078, 0x4512, 0x1078, 0x4423,
- 0x0078, 0x1e08, 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x4423,
- 0x1078, 0x1e0d, 0x0078, 0x1e08, 0x1078, 0x4512, 0x1078, 0x1e0d,
- 0x0078, 0x1e08, 0x1078, 0x4512, 0x1078, 0x4423, 0x1078, 0x1e0d,
- 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1ebd,
- 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196,
- 0xff00, 0x0040, 0x1e3c, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116,
- 0x0040, 0x1e3c, 0x7130, 0xd18c, 0x00c0, 0x1e3c, 0x2011, 0x7052,
- 0x2214, 0xd2ec, 0x0040, 0x1e30, 0xc18d, 0x7132, 0x0078, 0x1e3c,
- 0x6240, 0xa294, 0x0010, 0x0040, 0x1e7a, 0x6248, 0xa294, 0xff00,
- 0xa296, 0xff00, 0x00c0, 0x1e7a, 0x037e, 0x73b0, 0x2011, 0x8013,
- 0x1078, 0x2a18, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011, 0x7052,
- 0x220c, 0xd1a4, 0x0040, 0x1e62, 0x017e, 0x2009, 0x0001, 0x2011,
- 0x0100, 0x1078, 0x43f1, 0x2019, 0x000e, 0x1078, 0x6e67, 0xa484,
- 0x00ff, 0x1078, 0x1fe4, 0x8127, 0xa006, 0x2009, 0x000e, 0x1078,
- 0x6ecf, 0x017f, 0xd1ac, 0x00c0, 0x1e6b, 0x2019, 0x0004, 0x1078,
- 0x2186, 0x0078, 0x1e7a, 0x157e, 0x20a9, 0x007e, 0x2009, 0x0000,
- 0x1078, 0x34fa, 0x00c0, 0x1e76, 0x1078, 0x32ed, 0x8108, 0x00f0,
- 0x1e70, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7,
- 0x1078, 0x32b0, 0x0f7e, 0x2079, 0x71c9, 0x783c, 0xa086, 0x0000,
- 0x0040, 0x1e92, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140,
- 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078, 0x52b3, 0x2011,
- 0x0002, 0x1078, 0x52bd, 0x1078, 0x51c9, 0x1078, 0x4327, 0x037e,
- 0x2019, 0x0000, 0x1078, 0x525b, 0x037f, 0x60e3, 0x0000, 0x017f,
- 0x2001, 0x7000, 0x2014, 0xa296, 0x0004, 0x00c0, 0x1eb5, 0xd19c,
- 0x00c0, 0x1eb5, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001,
- 0x701e, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x1f5e,
- 0x0f7e, 0x2079, 0x71c9, 0x783c, 0xa086, 0x0001, 0x00c0, 0x1ee1,
- 0x017e, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x2079, 0x71b6, 0x7807, 0x0000, 0x7833,
- 0x0000, 0x1078, 0x49b7, 0x1078, 0x4a67, 0x017f, 0x0f7f, 0x0078,
- 0x1f5e, 0x0f7f, 0x017e, 0x6220, 0xd2b4, 0x0040, 0x1f16, 0x1078,
- 0x4327, 0x1078, 0x50b0, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140,
- 0x6804, 0xa084, 0x4000, 0x0040, 0x1ef9, 0x6803, 0x1000, 0x6803,
- 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x71b6, 0x6028, 0xa09a, 0x0002,
- 0x00c8, 0x1f09, 0x8000, 0x602a, 0x0c7f, 0x1078, 0x50a2, 0x0078,
- 0x1f5d, 0x2019, 0x71bf, 0x2304, 0xa065, 0x0040, 0x1f13, 0x2009,
- 0x0027, 0x1078, 0x571c, 0x0c7f, 0x0078, 0x1f5d, 0xd2bc, 0x0040,
- 0x1f5d, 0x1078, 0x4335, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e,
- 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1f2b, 0x6803,
- 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x71b6, 0x6044,
- 0xa09a, 0x0002, 0x00c8, 0x1f4c, 0x8000, 0x6046, 0x603c, 0x0c7f,
- 0xa005, 0x0040, 0x1f5d, 0x1078, 0x432c, 0xa080, 0x0007, 0x2004,
- 0xa086, 0x0006, 0x00c0, 0x1f48, 0x6017, 0x0012, 0x0078, 0x1f5d,
- 0x6017, 0x0016, 0x0078, 0x1f5d, 0x037e, 0x2019, 0x0001, 0x1078,
- 0x525b, 0x037f, 0x2019, 0x71c5, 0x2304, 0xa065, 0x0040, 0x1f5c,
- 0x2009, 0x004f, 0x1078, 0x571c, 0x0c7f, 0x017f, 0xd19c, 0x0040,
- 0x1f86, 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078,
- 0x52b3, 0x2011, 0x0002, 0x1078, 0x52bd, 0x1078, 0x51c9, 0x1078,
- 0x4327, 0x037e, 0x2019, 0x0000, 0x1078, 0x525b, 0x037f, 0x60e3,
- 0x0000, 0x1078, 0x6f3e, 0x1078, 0x6f5c, 0x2001, 0x7000, 0x2003,
- 0x0004, 0x6027, 0x0008, 0x1078, 0x117d, 0x017f, 0xa18c, 0xffd0,
- 0x6126, 0x007c, 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x7000, 0x71a8, 0x70aa, 0xa116, 0x0040,
- 0x1fb0, 0x81ff, 0x0040, 0x1fa2, 0x2011, 0x8011, 0x1078, 0x2a18,
- 0x0078, 0x1fb0, 0x2011, 0x8012, 0x1078, 0x2a18, 0x037e, 0x0c7e,
- 0x2061, 0x0100, 0x2019, 0x0028, 0x1078, 0x2186, 0x0c7f, 0x037f,
- 0x127f, 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e,
- 0x0f7e, 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x1fd2, 0x2204,
- 0x60f2, 0xa192, 0x0005, 0x00c8, 0x1fc9, 0xa190, 0x1fdb, 0x0078,
- 0x1fcb, 0x2011, 0x1fdf, 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f,
- 0x0c7f, 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420, 0x0348,
- 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140,
- 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0xa080, 0x2207, 0x200c, 0xa18c,
- 0xff00, 0x810f, 0x007c, 0xa080, 0x2207, 0x200c, 0xa18c, 0x00ff,
- 0x007c, 0x2011, 0x2015, 0x2019, 0x201f, 0x2025, 0x202b, 0x2031,
- 0x2039, 0x2041, 0x2047, 0x204d, 0x2055, 0x205d, 0x2065, 0x206d,
- 0x2077, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081, 0x2081,
- 0x2081, 0x107e, 0x007e, 0x0078, 0x209a, 0x107e, 0x007e, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x0078,
- 0x209a, 0x107e, 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e, 0x007e, 0x1078,
- 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078, 0x209a, 0x107e,
- 0x007e, 0x1078, 0x1dc7, 0x1078, 0x1cae, 0x1078, 0x1cf3, 0x0078,
- 0x209a, 0x0005, 0x0078, 0x2081, 0xb084, 0x003c, 0x8004, 0x8004,
- 0x0079, 0x208a, 0x209a, 0x2017, 0x201b, 0x2021, 0x2027, 0x202d,
- 0x2033, 0x203b, 0x2043, 0x2049, 0x204f, 0x2057, 0x205f, 0x2067,
- 0x206f, 0x2079, 0x0008, 0x2084, 0x007f, 0x107f, 0x2091, 0x8001,
- 0x007c, 0x0c7e, 0x027e, 0x2001, 0x010c, 0x203c, 0x7274, 0x82ff,
- 0x0040, 0x20f0, 0x037e, 0x7384, 0xa38e, 0xffff, 0x00c0, 0x20b2,
- 0x2019, 0x0001, 0x8314, 0xa2e0, 0x75c0, 0x2c04, 0xa38c, 0x0001,
- 0x0040, 0x20bf, 0xa084, 0xff00, 0x8007, 0x0078, 0x20c1, 0xa084,
- 0x00ff, 0xa70e, 0x0040, 0x20e5, 0xa08e, 0x0000, 0x0040, 0x20e5,
- 0xa08e, 0x00ff, 0x0040, 0x20eb, 0x1078, 0x1fe4, 0x1078, 0x34bf,
- 0x00c0, 0x20e8, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x20df, 0x1078, 0x2138, 0x0040, 0x20e8, 0x0078, 0x20e5, 0x1078,
- 0x21d3, 0x1078, 0x215f, 0x0040, 0x20e8, 0x8318, 0x0078, 0x20b2,
- 0x7386, 0x0078, 0x20ed, 0x7087, 0xffff, 0x037f, 0x0078, 0x2135,
- 0xa780, 0x2207, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x20a9, 0x007e,
- 0x2009, 0x0000, 0x7084, 0xa096, 0xffff, 0x0040, 0x210c, 0xa092,
- 0x007e, 0x0048, 0x2107, 0x7087, 0xffff, 0x0078, 0x2132, 0x2008,
- 0x2011, 0x007e, 0xa202, 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106,
- 0x0040, 0x2129, 0x1078, 0x34bf, 0x00c0, 0x2132, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2123, 0x1078, 0x2138, 0x0040,
- 0x2132, 0x0078, 0x2129, 0x1078, 0x21d3, 0x1078, 0x215f, 0x0040,
- 0x2132, 0x017f, 0x8108, 0x157f, 0x00f0, 0x210c, 0x7087, 0xffff,
- 0x0078, 0x2135, 0x017f, 0x157f, 0x7186, 0x027f, 0x0c7f, 0x007c,
- 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x568f, 0x0040,
- 0x215a, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078,
- 0x348e, 0x2001, 0x0000, 0x1078, 0x34a2, 0x127e, 0x2091, 0x8000,
- 0x7080, 0x8000, 0x7082, 0x127f, 0x2009, 0x0004, 0x1078, 0x571c,
- 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e,
- 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078, 0x568f, 0x0040, 0x2181,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x348e,
- 0x2001, 0x0002, 0x1078, 0x34a2, 0x127e, 0x2091, 0x8000, 0x7080,
- 0x8000, 0x7082, 0x127f, 0x2009, 0x0002, 0x1078, 0x571c, 0xa085,
- 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f, 0x007c, 0x0e7e, 0x0c7e,
- 0x067e, 0x037e, 0x027e, 0x1078, 0x46a6, 0x1078, 0x4656, 0x1078,
- 0x5b04, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34fa,
- 0x00c0, 0x219e, 0x1078, 0x36e4, 0x1078, 0x32ed, 0x017f, 0x8108,
- 0x00f0, 0x2195, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0,
- 0x027e, 0x2019, 0x0029, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08,
- 0x1078, 0x6d09, 0x017f, 0x2e60, 0x1078, 0x36e4, 0x1078, 0x32ed,
- 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e,
- 0x2071, 0x7000, 0x7080, 0xa005, 0x0040, 0x21d0, 0x8001, 0x7082,
- 0x007f, 0x0e7f, 0x007c, 0x6000, 0xc08c, 0x6002, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x157e, 0x81ff, 0x00c0, 0x21e4,
- 0x20a9, 0x0001, 0x0078, 0x21e8, 0x20a9, 0x007e, 0x2011, 0x0000,
- 0x027e, 0xa2e0, 0x7120, 0x2c64, 0x8cff, 0x0040, 0x21fa, 0x2019,
- 0x0029, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09,
- 0x1078, 0x36e4, 0x027f, 0x8210, 0x00f0, 0x21e8, 0x027e, 0x027f,
- 0x157f, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x7eef,
- 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9,
- 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd,
- 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3,
- 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2,
- 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7,
- 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098,
- 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080,
- 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072,
- 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067,
- 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055,
- 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b,
- 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a,
- 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e,
- 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025,
- 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010,
- 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800,
- 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000,
- 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000,
- 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000,
- 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000,
- 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000,
- 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000,
- 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000,
- 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000,
- 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500,
- 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x2071,
- 0x706d, 0x7003, 0x0002, 0xa006, 0x7012, 0x7016, 0x703a, 0x703e,
- 0x7033, 0x707d, 0x7037, 0x707d, 0x7007, 0x0001, 0x2061, 0x70bd,
- 0x6003, 0x0002, 0x007c, 0x0090, 0x231e, 0x0068, 0x231e, 0x2071,
- 0x706d, 0x2b78, 0x7818, 0xd084, 0x00c0, 0x231e, 0x2a60, 0x7820,
- 0xa08e, 0x0069, 0x00c0, 0x2405, 0x0079, 0x23a2, 0x007c, 0x2071,
- 0x706d, 0x7004, 0x0079, 0x2324, 0x2328, 0x2329, 0x2333, 0x2345,
- 0x007c, 0x0090, 0x2332, 0x0068, 0x2332, 0x2b78, 0x7818, 0xd084,
- 0x0040, 0x2351, 0x007c, 0x2b78, 0x2061, 0x70bd, 0x6008, 0xa08e,
- 0x0100, 0x0040, 0x2340, 0xa086, 0x0200, 0x0040, 0x23fd, 0x007c,
- 0x7014, 0x2068, 0x2a60, 0x7018, 0x007a, 0x7010, 0x2068, 0x6834,
- 0xa086, 0x0103, 0x0040, 0x234d, 0x007c, 0x2a60, 0x2b78, 0x7018,
- 0x007a, 0x2a60, 0x7820, 0xa08a, 0x0040, 0x00c8, 0x235a, 0x61a8,
- 0x0079, 0x2362, 0x2100, 0xa08a, 0x0036, 0x00c8, 0x23f9, 0x61a8,
- 0x0079, 0x23a2, 0x23db, 0x240d, 0x2415, 0x2419, 0x2421, 0x2427,
- 0x242b, 0x2434, 0x2438, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x23f9,
- 0x2448, 0x23f9, 0x2458, 0x246f, 0x2486, 0x2502, 0x2507, 0x2534,
- 0x258e, 0x259f, 0x25bd, 0x25f0, 0x25fa, 0x2607, 0x261a, 0x2634,
- 0x263d, 0x267a, 0x2680, 0x23f9, 0x268b, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x268f, 0x2695, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x269d, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x26aa, 0x26b0, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x2440, 0x2444, 0x23f9, 0x23f9, 0x26c2, 0x23f9,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x23f9,
- 0x23f9, 0x23f9, 0x270f, 0x27dc, 0x27f0, 0x27f7, 0x285a, 0x28ab,
- 0x28b6, 0x28f5, 0x2904, 0x2913, 0x2916, 0x26c6, 0x293f, 0x2986,
- 0x23f9, 0x23f9, 0x23f9, 0x23f9, 0x2a9f, 0x2aad, 0x2aba, 0x2af4,
- 0x713c, 0x0078, 0x23db, 0x2021, 0x4000, 0x1078, 0x29f2, 0x127e,
- 0x2091, 0x8000, 0x0068, 0x23e8, 0x7818, 0xd084, 0x0040, 0x23eb,
- 0x127f, 0x0078, 0x23df, 0x781b, 0x0001, 0x7c22, 0x7926, 0x7a2a,
- 0x7b2e, 0x2091, 0x4080, 0x7007, 0x0001, 0x2091, 0x5000, 0x127f,
- 0x007c, 0x2021, 0x4001, 0x0078, 0x23dd, 0x2021, 0x4002, 0x0078,
- 0x23dd, 0x2021, 0x4003, 0x0078, 0x23dd, 0x2021, 0x4005, 0x0078,
- 0x23dd, 0x2021, 0x4006, 0x0078, 0x23dd, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2a01, 0x7823, 0x0004, 0x7824,
- 0x007a, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x2a05, 0x7924, 0x7828, 0x2114, 0x200a, 0x0078, 0x23db, 0x7924,
- 0x2114, 0x0078, 0x23db, 0x2099, 0x0009, 0x20a1, 0x0009, 0x20a9,
- 0x0007, 0x53a3, 0x0078, 0x23db, 0x7824, 0x2060, 0x0078, 0x244a,
- 0x2009, 0x0001, 0x2011, 0x000f, 0x2019, 0x0007, 0x0078, 0x23db,
- 0x7d38, 0x7c3c, 0x0078, 0x240f, 0x7d38, 0x7c3c, 0x0078, 0x241b,
- 0x2061, 0x1000, 0x610c, 0xa006, 0x2c14, 0xa200, 0x8c60, 0x8109,
- 0x00c0, 0x244c, 0x2010, 0xa005, 0x0040, 0x23db, 0x0078, 0x2401,
- 0x2061, 0x7051, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019,
- 0x0040, 0x2409, 0x604a, 0x6142, 0x782c, 0x6052, 0x7828, 0x6056,
- 0xa006, 0x605a, 0x605e, 0x1078, 0x3a37, 0x0078, 0x23db, 0x2061,
- 0x7051, 0x7824, 0x7930, 0xa11a, 0x00c8, 0x2409, 0x8019, 0x0040,
- 0x2409, 0x604e, 0x6146, 0x782c, 0x6062, 0x7828, 0x6066, 0xa006,
- 0x606a, 0x606e, 0x1078, 0x380d, 0x0078, 0x23db, 0xa02e, 0x2520,
- 0x81ff, 0x00c0, 0x2405, 0x7924, 0x7b28, 0x7a2c, 0x20a9, 0x0005,
- 0x20a1, 0x7074, 0x41a1, 0x1078, 0x29b7, 0x0040, 0x2405, 0x2009,
- 0x0020, 0x1078, 0x2a01, 0x701b, 0x249e, 0x007c, 0x6834, 0x2008,
- 0xa084, 0x00ff, 0xa096, 0x0011, 0x0040, 0x24aa, 0xa096, 0x0019,
- 0x00c0, 0x2405, 0x810f, 0xa18c, 0x00ff, 0x0040, 0x2405, 0x710e,
- 0x700c, 0x8001, 0x0040, 0x24db, 0x700e, 0x1078, 0x29b7, 0x0040,
- 0x2405, 0x2009, 0x0020, 0x2061, 0x70bd, 0x6224, 0x6328, 0x642c,
- 0x6530, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
- 0x0000, 0x1078, 0x2a01, 0x701b, 0x24ce, 0x007c, 0x6834, 0xa084,
- 0x00ff, 0xa096, 0x0002, 0x0040, 0x24d9, 0xa096, 0x000a, 0x00c0,
- 0x2405, 0x0078, 0x24b0, 0x7010, 0x2068, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x33f2, 0x00c0, 0x24e9, 0x7007, 0x0003, 0x701b, 0x24eb,
- 0x007c, 0x1078, 0x38d0, 0x127e, 0x2091, 0x8000, 0x20a9, 0x0005,
- 0x2099, 0x7074, 0x530a, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1,
- 0x0000, 0xa5a9, 0x0000, 0xad80, 0x000d, 0x2009, 0x0020, 0x127f,
- 0x0078, 0x2a05, 0x6190, 0x7824, 0x6092, 0x0078, 0x23db, 0x2091,
- 0x8000, 0x7823, 0x4000, 0x7827, 0x4953, 0x782b, 0x5020, 0x782f,
- 0x2020, 0x2009, 0x017f, 0x2104, 0x7832, 0x3f00, 0x7836, 0x2061,
- 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0xa205, 0x783a,
- 0x2009, 0x04fd, 0x2104, 0x783e, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2071, 0x0010, 0x20c1, 0x00f0, 0xa08a, 0x0003,
- 0x00c8, 0x0427, 0x0078, 0x0423, 0x81ff, 0x00c0, 0x2405, 0x7924,
- 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0, 0x2409, 0x7e38,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x2548, 0x0078, 0x2409,
- 0x7c28, 0x7d2c, 0x1078, 0x36ab, 0xd28c, 0x00c0, 0x2553, 0x1078,
- 0x363f, 0x0078, 0x2555, 0x1078, 0x3679, 0x00c0, 0x257f, 0x2061,
- 0x7600, 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x256d, 0x6010, 0xa06d, 0x0040, 0x256d, 0x683c, 0xa406, 0x00c0,
- 0x256d, 0x6840, 0xa506, 0x0040, 0x2578, 0x127f, 0xace0, 0x0008,
- 0x2001, 0x7015, 0x2004, 0xac02, 0x00c8, 0x2405, 0x0078, 0x2559,
- 0x1078, 0x6139, 0x127f, 0x0040, 0x2405, 0x0078, 0x23db, 0xa00e,
- 0x2001, 0x0005, 0x1078, 0x38d0, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x64fd, 0x1078, 0x3840, 0x127f, 0x0078, 0x23db, 0x81ff, 0x00c0,
- 0x2405, 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583, 0x0040,
- 0x2405, 0x1078, 0x36b8, 0x0040, 0x2405, 0x0078, 0x23db, 0x81ff,
- 0x00c0, 0x2405, 0x1078, 0x29e1, 0x0040, 0x2409, 0x1078, 0x371f,
- 0x0040, 0x2405, 0x2019, 0x0005, 0x1078, 0x36d9, 0x0040, 0x2405,
- 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2409, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x1078, 0x42b7, 0x0078, 0x23db, 0x127e, 0x2091, 0x8000,
- 0x81ff, 0x00c0, 0x25ea, 0x2029, 0x007d, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x25e4, 0x2508, 0x1078, 0x34fa, 0x00c0, 0x25e4, 0x1078,
- 0x371f, 0x0040, 0x2405, 0x2019, 0x0004, 0x1078, 0x36d9, 0x0040,
- 0x25ea, 0x7824, 0xa08a, 0x1000, 0x00c8, 0x25ed, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x1078, 0x42b7, 0x8529, 0x00c8, 0x25c6, 0x127f,
- 0x0078, 0x23db, 0x127f, 0x0078, 0x2405, 0x127f, 0x0078, 0x2409,
- 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x35f0, 0x1078, 0x36ab,
- 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29cf, 0x0040,
- 0x2409, 0x1078, 0x35df, 0x1078, 0x36ab, 0x0078, 0x23db, 0x81ff,
- 0x00c0, 0x2405, 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x367c,
- 0x0040, 0x2405, 0x1078, 0x343b, 0x1078, 0x3638, 0x1078, 0x36ab,
- 0x0078, 0x23db, 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583,
- 0x0040, 0x2405, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078, 0x36e4,
- 0x0c7f, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09,
- 0x1078, 0x36ab, 0x0078, 0x23db, 0x1078, 0x29cf, 0x0040, 0x2409,
- 0x1078, 0x36ab, 0x2208, 0x0078, 0x23db, 0x157e, 0x0d7e, 0x0e7e,
- 0x2069, 0x70ff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x2649, 0x2009,
- 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9, 0x007d,
- 0x2069, 0x7120, 0x2d04, 0xa075, 0x0040, 0x265e, 0x704c, 0x1078,
- 0x2668, 0xa210, 0x7080, 0x1078, 0x2668, 0xa318, 0x8d68, 0x00f0,
- 0x2652, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x23db,
- 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2677, 0x2001, 0x0000, 0x8000,
- 0x2f0c, 0x81ff, 0x0040, 0x2677, 0x2178, 0x0078, 0x266f, 0x017f,
- 0x0f7f, 0x007c, 0x2069, 0x70ff, 0x6910, 0x6294, 0x0078, 0x23db,
- 0x81ff, 0x00c0, 0x2405, 0x614c, 0xa190, 0x2207, 0x2214, 0xa294,
- 0x00ff, 0x0078, 0x23db, 0x613c, 0x6240, 0x0078, 0x23db, 0x1078,
- 0x29e1, 0x0040, 0x2409, 0x0078, 0x23db, 0x1078, 0x29e1, 0x0040,
- 0x2409, 0x6244, 0x6338, 0x0078, 0x23db, 0x613c, 0x6240, 0x7824,
- 0x603e, 0x7b28, 0x6342, 0x2069, 0x7051, 0x831f, 0xa305, 0x6816,
- 0x0078, 0x23db, 0x1078, 0x29e1, 0x0040, 0x2409, 0x0078, 0x23db,
- 0x1078, 0x29e1, 0x0040, 0x2409, 0x7828, 0xa00d, 0x0040, 0x2409,
- 0x782c, 0xa005, 0x0040, 0x2409, 0x6244, 0x6146, 0x6338, 0x603a,
- 0x0078, 0x23db, 0x7d38, 0x7c3c, 0x0078, 0x2488, 0x7824, 0xa09c,
- 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x2405, 0x624c, 0xa084, 0xff00,
- 0x8007, 0xa206, 0x00c0, 0x26de, 0x2001, 0x7040, 0x2009, 0x000c,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a05, 0x81ff, 0x00c0,
- 0x2405, 0x1078, 0x29e1, 0x0040, 0x2409, 0x6004, 0xa084, 0x00ff,
- 0xa086, 0x0006, 0x00c0, 0x2405, 0x0c7e, 0x1078, 0x29b7, 0x0c7f,
- 0x0040, 0x2405, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078,
- 0x6413, 0x0040, 0x2405, 0x7007, 0x0003, 0x701b, 0x2700, 0x007c,
- 0x6830, 0xa086, 0x0100, 0x0040, 0x2405, 0xad80, 0x000e, 0x2009,
- 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a05, 0x1078,
- 0x29b7, 0x0040, 0x2405, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x1078, 0x2a01, 0x701b, 0x271e, 0x007c, 0xade8, 0x000d,
- 0x6800, 0xa005, 0x0040, 0x2409, 0x6804, 0xd0ac, 0x0040, 0x272b,
- 0xd0a4, 0x0040, 0x2409, 0xd094, 0x0040, 0x2736, 0x0c7e, 0x2061,
- 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040,
- 0x2741, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106,
- 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x2756,
- 0xd084, 0x0040, 0x2756, 0x6a28, 0xa28a, 0x007e, 0x00c8, 0x2409,
- 0xa288, 0x2207, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040,
- 0x275f, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x2409, 0x604e, 0x6808,
- 0xa08a, 0x0100, 0x0048, 0x2409, 0xa08a, 0x0841, 0x00c8, 0x2409,
- 0xa084, 0x0007, 0x00c0, 0x2409, 0x680c, 0xa005, 0x0040, 0x2409,
- 0x6810, 0xa005, 0x0040, 0x2409, 0x6848, 0x6940, 0xa10a, 0x00c8,
- 0x2409, 0x8001, 0x0040, 0x2409, 0x684c, 0x6944, 0xa10a, 0x00c8,
- 0x2409, 0x8001, 0x0040, 0x2409, 0x20a9, 0x001c, 0x2d98, 0x2069,
- 0x7051, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007,
- 0xa084, 0x00ff, 0x6042, 0x1078, 0x3a37, 0x1078, 0x380d, 0x6000,
- 0xa086, 0x0000, 0x00c0, 0x27da, 0x6808, 0x602a, 0x1078, 0x1d4d,
- 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f,
- 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x27ba,
- 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f,
- 0x0078, 0x27bc, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312,
- 0x1078, 0x4343, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040, 0x602f,
- 0x0000, 0x0c7f, 0x60ac, 0xa005, 0x0040, 0x27d6, 0x6003, 0x0001,
- 0x2091, 0x301d, 0x1078, 0x3247, 0x0078, 0x27da, 0x6003, 0x0004,
- 0x2091, 0x301d, 0x0078, 0x23db, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x2405, 0x2069, 0x7051, 0x7830, 0x6842, 0x7834, 0x6846, 0x2d00,
- 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2a05,
- 0x81ff, 0x00c0, 0x2405, 0x1078, 0x3247, 0x0078, 0x23db, 0x81ff,
- 0x00c0, 0x2405, 0x6174, 0x81ff, 0x0040, 0x2811, 0x703f, 0x0000,
- 0x2001, 0x75c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x2a05, 0x701b, 0x23d8, 0x127f,
- 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x75c0, 0x20a9, 0x0040,
- 0x20a1, 0x75c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x2207,
- 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100,
- 0xa506, 0x0040, 0x2843, 0x1078, 0x34fa, 0x00c0, 0x2843, 0x6014,
- 0x821c, 0x0048, 0x283b, 0xa398, 0x75c0, 0xa085, 0xff00, 0x8007,
- 0x201a, 0x0078, 0x2842, 0xa398, 0x75c0, 0x2324, 0xa4a4, 0xff00,
- 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x007f, 0x00c8, 0x284a,
- 0x0078, 0x2827, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f,
- 0x20a9, 0x0040, 0x20a1, 0x75c0, 0x2099, 0x75c0, 0x1078, 0x3290,
- 0x0078, 0x2800, 0x1078, 0x29e1, 0x0040, 0x2409, 0x0c7e, 0x1078,
- 0x29b7, 0x0c7f, 0x0040, 0x2405, 0x2001, 0x7052, 0x2004, 0xd0b4,
- 0x0040, 0x2887, 0x6000, 0xd08c, 0x00c0, 0x2887, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2887, 0x6837, 0x0000, 0x6838,
- 0xc0fd, 0x683a, 0x1078, 0x642f, 0x0040, 0x2405, 0x7007, 0x0003,
- 0x701b, 0x2883, 0x007c, 0x1078, 0x29e1, 0x0040, 0x2409, 0x20a9,
- 0x002b, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0004,
- 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078, 0x3290,
- 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0,
- 0x1078, 0x3290, 0x2d00, 0x2009, 0x002b, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x0078, 0x2a05, 0x81ff, 0x00c0, 0x2405, 0x1078, 0x29cf,
- 0x0040, 0x2409, 0x1078, 0x36c3, 0x0078, 0x23db, 0x81ff, 0x00c0,
- 0x2405, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2409, 0x1078, 0x29e1,
- 0x0040, 0x2409, 0x1078, 0x371f, 0x0040, 0x2405, 0x2019, 0x0004,
- 0x1078, 0x36d9, 0x7924, 0x810f, 0x7a28, 0x1078, 0x28d1, 0x0078,
- 0x23db, 0xa186, 0x00ff, 0x0040, 0x28d9, 0x1078, 0x28e9, 0x0078,
- 0x28e8, 0x2029, 0x007d, 0x2061, 0x7000, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x28e5, 0x2508, 0x1078, 0x28e9, 0x8529, 0x00c8, 0x28de,
- 0x007c, 0x1078, 0x34fa, 0x00c0, 0x28f4, 0x2200, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x1078, 0x42b7, 0x007c, 0x81ff, 0x00c0, 0x2405,
- 0x1078, 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583, 0x0040, 0x2405,
- 0x1078, 0x36ce, 0x0078, 0x23db, 0x81ff, 0x00c0, 0x2405, 0x1078,
- 0x29cf, 0x0040, 0x2409, 0x1078, 0x3583, 0x0040, 0x2405, 0x1078,
- 0x36b8, 0x0078, 0x23db, 0x6100, 0x0078, 0x23db, 0x1078, 0x29e1,
- 0x0040, 0x2409, 0x6004, 0xa086, 0x0707, 0x0040, 0x2409, 0x2001,
- 0x7000, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2405, 0x0d7e, 0xace8,
- 0x000a, 0x7924, 0xd184, 0x0040, 0x292f, 0xace8, 0x0006, 0x680c,
+ 0x697c, 0x6912, 0x6980, 0x6916, 0x007c, 0x82ff, 0x0040, 0x1518,
+ 0xa280, 0x0004, 0x0d7e, 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x1514,
+ 0x1078, 0x1497, 0x10c0, 0x126a, 0x6808, 0x8000, 0x680a, 0x0d7f,
+ 0x127e, 0x047e, 0x037e, 0x027e, 0x2091, 0x2100, 0x027f, 0x037f,
+ 0x047f, 0x7000, 0xa005, 0x00c0, 0x152c, 0x7206, 0x2001, 0x1540,
+ 0x007e, 0x2260, 0x0078, 0x1652, 0x710c, 0x220a, 0x8108, 0x230a,
+ 0x8108, 0x240a, 0x8108, 0xa182, 0x6e05, 0x0048, 0x1539, 0x2009,
+ 0x6dea, 0x710e, 0x7000, 0xa005, 0x00c0, 0x1540, 0x1078, 0x163b,
+ 0x127f, 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091,
+ 0x2100, 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460,
+ 0x6110, 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x1594, 0x6808,
+ 0xa005, 0x0040, 0x15f4, 0x7000, 0xa005, 0x00c0, 0x1561, 0x0078,
+ 0x158e, 0x700c, 0x7110, 0xa106, 0x00c0, 0x15f8, 0x7004, 0xa406,
+ 0x00c0, 0x158e, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x1577,
+ 0x047e, 0x1078, 0x170a, 0x047f, 0x2460, 0x0078, 0x1557, 0x2001,
+ 0x0207, 0x2004, 0xd09c, 0x00c0, 0x156a, 0x7804, 0xa084, 0x6000,
+ 0x0040, 0x1588, 0xa086, 0x6000, 0x0040, 0x1588, 0x0078, 0x156a,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x2009, 0x0048,
+ 0x1078, 0x544c, 0x0078, 0x15f8, 0x6808, 0xa005, 0x0040, 0x15f4,
+ 0x7000, 0xa005, 0x00c0, 0x159e, 0x0078, 0x15f4, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x15a7, 0x7004, 0xa406, 0x00c0, 0x15f4, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x0040, 0x15b4, 0x047e, 0x1078, 0x170a,
+ 0x047f, 0x2460, 0x0078, 0x1594, 0x2001, 0x0207, 0x2004, 0xd09c,
+ 0x00c0, 0x15a7, 0x7804, 0xa084, 0x6000, 0x0040, 0x15c5, 0xa086,
+ 0x6000, 0x0040, 0x15c5, 0x0078, 0x15a7, 0x7007, 0x0000, 0xa016,
+ 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x15e6, 0xa08e, 0x0002,
+ 0x00c0, 0x15f4, 0x0c7e, 0x0e7e, 0x6818, 0x2060, 0x1078, 0x1b57,
+ 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x15e2, 0x7308, 0x720c,
+ 0x0078, 0x15e4, 0x7310, 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318,
+ 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814, 0xa201, 0x6816,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0x2009, 0x0048, 0x1078, 0x544c,
+ 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x6de4,
+ 0x7000, 0xa086, 0x0000, 0x0040, 0x1638, 0x7004, 0xac06, 0x00c0,
+ 0x1629, 0x2079, 0x0030, 0x7804, 0xd0fc, 0x00c0, 0x1625, 0x2001,
+ 0x0207, 0x2004, 0xd09c, 0x00c0, 0x160b, 0x7803, 0x0004, 0x7804,
+ 0xd0ac, 0x00c0, 0x1617, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003,
+ 0x0003, 0x7007, 0x0000, 0x0078, 0x1629, 0x1078, 0x170a, 0x0078,
+ 0x1600, 0x157e, 0x20a9, 0x0009, 0x2009, 0x6dea, 0x2104, 0xac06,
+ 0x00c0, 0x1633, 0x200a, 0xa188, 0x0003, 0x00f0, 0x162e, 0x157f,
+ 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110, 0xa106, 0x00c0, 0x1643,
+ 0x7003, 0x0000, 0x007c, 0x2104, 0x7006, 0x2060, 0x8108, 0x211c,
+ 0x8108, 0x2124, 0x8108, 0xa182, 0x6e05, 0x0048, 0x1651, 0x2009,
+ 0x6dea, 0x7112, 0x8cff, 0x00c0, 0x1671, 0x7908, 0xd1ec, 0x00c0,
+ 0x1665, 0x1078, 0x18ac, 0x0040, 0x1665, 0x7803, 0x0009, 0x7904,
+ 0xd1fc, 0x0040, 0x165f, 0x7803, 0x0006, 0x7007, 0x0000, 0x1078,
+ 0x18ac, 0x0040, 0x1698, 0x7803, 0x0019, 0x7003, 0x0003, 0x0078,
+ 0x1698, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406, 0x00c0, 0x167c,
+ 0x682c, 0xa306, 0x0040, 0x1680, 0x1078, 0x1ba2, 0x00c0, 0x1655,
+ 0x684c, 0xd0f4, 0x00c0, 0x1655, 0x6824, 0x2050, 0x6818, 0x2060,
+ 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009, 0x0011, 0x1078,
+ 0x1699, 0x0040, 0x1697, 0x2009, 0x0001, 0x1078, 0x1699, 0x2d58,
+ 0x007c, 0x8aff, 0x0040, 0x1705, 0xa03e, 0x2730, 0x6850, 0xd0fc,
+ 0x00c0, 0x16b8, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x16a8,
+ 0x16e7, 0x16c8, 0x16c8, 0x16e7, 0x16e7, 0x16df, 0x16e7, 0x16c8,
+ 0x16e7, 0x16ce, 0x16ce, 0x16e7, 0x16e7, 0x16e7, 0x16d6, 0x16ce,
+ 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c,
+ 0x0040, 0x16ea, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x16ea,
+ 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x16ea, 0x6b10, 0x6a14,
+ 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x16ea, 0x0d7f, 0x0d7e,
+ 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x16e7, 0x0d7f,
+ 0x1078, 0x1b3e, 0x00c0, 0x1699, 0xa00e, 0x0078, 0x1705, 0x0d7f,
+ 0x1078, 0x126a, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
+ 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a,
+ 0x682c, 0xa201, 0x682e, 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200,
+ 0x6a14, 0xa203, 0x6816, 0x1078, 0x1b3e, 0x007c, 0x1078, 0x126a,
+ 0x1078, 0x126a, 0x127e, 0x2091, 0x2100, 0x007e, 0x017e, 0x2b68,
+ 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0,
+ 0x1708, 0xa184, 0x0003, 0xa086, 0x0003, 0x0040, 0x1708, 0x7000,
+ 0x0079, 0x1722, 0x172a, 0x172c, 0x17f3, 0x184d, 0x1864, 0x172a,
+ 0x172a, 0x172a, 0x1078, 0x126a, 0x8001, 0x7002, 0xa184, 0x0880,
+ 0x00c0, 0x1741, 0x8aff, 0x0040, 0x1793, 0x2009, 0x0001, 0x1078,
+ 0x1699, 0x0040, 0x1876, 0x2009, 0x0001, 0x1078, 0x1699, 0x0078,
+ 0x1876, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040, 0x178c,
+ 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820, 0x686e, 0xa31a, 0x7824,
+ 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x7820, 0x6910, 0xa100, 0x6812,
+ 0x7824, 0x6914, 0xa101, 0x6816, 0x037f, 0x027f, 0x7830, 0x681e,
+ 0x7834, 0x6822, 0x1078, 0x1b57, 0x2a00, 0x6826, 0x2c00, 0x681a,
+ 0x2800, 0x6832, 0x7003, 0x0000, 0x6850, 0xc0fd, 0x6852, 0x6808,
+ 0x8001, 0x680a, 0x00c0, 0x177e, 0x684c, 0xd0e4, 0x0040, 0x177e,
+ 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c, 0x7808, 0xd0ec,
+ 0x00c0, 0x1788, 0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1876,
+ 0x1078, 0x163b, 0x0078, 0x1876, 0x057e, 0x7d0c, 0x1078, 0x6b5b,
+ 0x057f, 0x0078, 0x17ab, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
+ 0x00c0, 0x17ab, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
+ 0x17a7, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c, 0x1078,
+ 0x163b, 0x0078, 0x1876, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914,
+ 0xa183, 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188,
+ 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004,
+ 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x187a, 0x7803, 0x0004,
+ 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x17cc,
+ 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007,
+ 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c, 0x1078, 0x18ac,
+ 0x0040, 0x17a7, 0x7908, 0xd1ec, 0x00c0, 0x17ea, 0x2009, 0x0009,
+ 0x0078, 0x17ec, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003,
+ 0x0003, 0x0078, 0x1876, 0x8001, 0x7002, 0xd194, 0x0040, 0x1805,
+ 0x7804, 0xd0fc, 0x00c0, 0x1712, 0x8aff, 0x0040, 0x1876, 0x2009,
+ 0x0001, 0x1078, 0x1699, 0x0078, 0x1876, 0xa184, 0x0880, 0x00c0,
+ 0x1812, 0x8aff, 0x0040, 0x1876, 0x2009, 0x0001, 0x1078, 0x1699,
+ 0x0078, 0x1876, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040,
+ 0x1846, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1b57, 0x0d7e,
+ 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1836,
+ 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812,
+ 0x690c, 0x7814, 0xa101, 0x7816, 0x0078, 0x1842, 0x6810, 0x2008,
+ 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814,
+ 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x174c, 0x057e, 0x7d0c,
+ 0x1078, 0x6b5b, 0x057f, 0x0078, 0x17ab, 0x7803, 0x0004, 0x7003,
+ 0x0000, 0x7004, 0xa00d, 0x0040, 0x1860, 0x6808, 0x8001, 0x680a,
+ 0x00c0, 0x1860, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x544c,
+ 0x1078, 0x163b, 0x0078, 0x1876, 0x7803, 0x0004, 0x7003, 0x0000,
+ 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x1860, 0x2068, 0x6808,
+ 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x1652, 0x017f, 0x007f,
+ 0x127f, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200, 0x7808,
+ 0xa084, 0xf000, 0xa10d, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000,
+ 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0, 0x1894, 0x2001, 0x0111,
+ 0x201c, 0x83ff, 0x0040, 0x1888, 0x20e1, 0x7000, 0x7324, 0x7420,
+ 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f,
+ 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202,
+ 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908, 0xa18c,
+ 0x0fff, 0xa182, 0x0009, 0x0048, 0x18b9, 0xa085, 0x0001, 0x0078,
+ 0x18cb, 0x2001, 0x020a, 0x81ff, 0x0040, 0x18c4, 0x20e1, 0x6000,
+ 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c, 0x200c,
+ 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e, 0x2071,
+ 0x6e05, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280, 0x0004,
+ 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1950, 0x6934, 0xa184, 0x0007,
+ 0x0079, 0x18e2, 0x18ea, 0x193b, 0x18ea, 0x18ea, 0x18ea, 0x1920,
+ 0x18fd, 0x18ec, 0x1078, 0x126a, 0x684c, 0xd0b4, 0x0040, 0x1a52,
+ 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a,
+ 0x6880, 0x680e, 0x6958, 0x0078, 0x1943, 0x6834, 0xa084, 0x00ff,
+ 0xa086, 0x001e, 0x00c0, 0x18ea, 0x684c, 0xd0b4, 0x0040, 0x1a52,
+ 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a,
+ 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084,
+ 0x000f, 0xa080, 0x1b82, 0x2004, 0x6832, 0x6958, 0x0078, 0x194c,
+ 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1950, 0x684c, 0xd0b4,
+ 0x0040, 0x1a52, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084,
+ 0x000f, 0xa080, 0x1b82, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e,
+ 0x682a, 0x0078, 0x194c, 0x684c, 0xd0b4, 0x0040, 0x1706, 0x6958,
+ 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f,
+ 0xa080, 0x1b82, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e,
+ 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0,
+ 0x1a56, 0x0e7e, 0x0d7e, 0x2071, 0x6e05, 0x7000, 0xa005, 0x00c0,
+ 0x19cc, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068,
+ 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1,
+ 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6,
+ 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830,
+ 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007, 0x0040,
+ 0x198e, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a,
+ 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006,
+ 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x19a5,
+ 0x6928, 0x6810, 0xa106, 0x0040, 0x19b2, 0x037e, 0x047e, 0x6b14,
+ 0x6c10, 0x1078, 0x1ba2, 0x047f, 0x037f, 0x0040, 0x19b2, 0x0c7f,
+ 0x0078, 0x19cc, 0x8aff, 0x00c0, 0x19ba, 0x0c7f, 0xa085, 0x0001,
+ 0x0078, 0x19cc, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009,
+ 0x0001, 0x1078, 0x19d0, 0x0040, 0x19c9, 0x2009, 0x0001, 0x1078,
+ 0x19d0, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c,
+ 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040,
+ 0x1a4b, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203, 0x0048,
+ 0x1a4a, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x19fd, 0x0d7e,
+ 0x2804, 0xac68, 0x2900, 0x0079, 0x19ed, 0x1a2c, 0x1a0d, 0x1a0d,
+ 0x1a2c, 0x1a2c, 0x1a24, 0x1a2c, 0x1a0d, 0x1a2c, 0x1a13, 0x1a13,
+ 0x1a2c, 0x1a2c, 0x1a2c, 0x1a1b, 0x1a13, 0xc0fc, 0x6852, 0x6b6c,
+ 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a30, 0x0d7e, 0x2804,
+ 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1a2f, 0x6b08, 0x6a0c, 0x6d00,
+ 0x6c04, 0x0078, 0x1a2f, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08,
+ 0x6e0c, 0x0078, 0x1a2f, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff,
+ 0xa086, 0x001e, 0x00c0, 0x1a2c, 0x0d7f, 0x1078, 0x1b3e, 0x00c0,
+ 0x19d6, 0xa00e, 0x0078, 0x1a4b, 0x0d7f, 0x1078, 0x126a, 0x0d7f,
+ 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000,
+ 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e,
+ 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078, 0x1b3e,
+ 0x0078, 0x1a4b, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f, 0x067f,
+ 0x077f, 0x007c, 0x1078, 0x126a, 0x1078, 0x126a, 0x127e, 0x2091,
+ 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079,
+ 0x0020, 0x2071, 0x6e05, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803,
+ 0x0002, 0xa184, 0x0700, 0x00c0, 0x1a54, 0x7000, 0x0079, 0x1a70,
+ 0x1b17, 0x1a74, 0x1ae4, 0x1b15, 0x8001, 0x7002, 0xd19c, 0x00c0,
+ 0x1a88, 0x8aff, 0x0040, 0x1aa7, 0x2009, 0x0001, 0x1078, 0x19d0,
+ 0x0040, 0x1b17, 0x2009, 0x0001, 0x1078, 0x19d0, 0x0078, 0x1b17,
+ 0x7803, 0x0004, 0xd194, 0x0040, 0x1a98, 0x6850, 0xc0fc, 0x6852,
+ 0x8aff, 0x00c0, 0x1a9d, 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1a9d,
+ 0x1078, 0x1b57, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826, 0x2c00,
+ 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b17, 0x711c,
+ 0x81ff, 0x0040, 0x1abd, 0x7918, 0x7922, 0x7827, 0x0000, 0x7803,
+ 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e, 0x7010,
+ 0xa081, 0x0000, 0x7012, 0x0078, 0x1b17, 0x0f7e, 0x027e, 0x781c,
+ 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0004,
+ 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1acb, 0x79c8,
+ 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6, 0xa284,
+ 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803, 0x0008,
+ 0x7003, 0x0000, 0x0078, 0x1b17, 0x8001, 0x7002, 0xd194, 0x0040,
+ 0x1af9, 0x7804, 0xd0fc, 0x00c0, 0x1a66, 0xd19c, 0x00c0, 0x1b13,
+ 0x8aff, 0x0040, 0x1b17, 0x2009, 0x0001, 0x1078, 0x19d0, 0x0078,
+ 0x1b17, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1b57, 0x0d7e,
+ 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b0c, 0x6808, 0xa31a,
+ 0x680c, 0xa213, 0x0078, 0x1b10, 0x6810, 0xa31a, 0x6814, 0xa213,
+ 0x0d7f, 0x0078, 0x1a98, 0x0078, 0x1a98, 0x1078, 0x126a, 0x0c7f,
+ 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c, 0x0f7e,
+ 0x0e7e, 0x2071, 0x6e05, 0x7000, 0xa086, 0x0000, 0x0040, 0x1b3b,
+ 0x2079, 0x0020, 0x7804, 0xa084, 0x0003, 0x0040, 0x1b35, 0x7803,
+ 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1b31, 0x20e1, 0x9040, 0x7803,
+ 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840, 0x2804,
+ 0xa005, 0x00c0, 0x1b52, 0x6004, 0xa005, 0x0040, 0x1b54, 0x681a,
+ 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1b82, 0x2044, 0x88ff,
+ 0x1040, 0x126a, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50,
+ 0x8841, 0x2804, 0xa005, 0x00c0, 0x1b71, 0x2c00, 0xad06, 0x0040,
+ 0x1b66, 0x6000, 0xa005, 0x00c0, 0x1b66, 0x2d00, 0x2060, 0x681a,
+ 0x6034, 0xa084, 0x000f, 0xa080, 0x1b92, 0x2044, 0x88ff, 0x1040,
+ 0x126a, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, 0x0021,
+ 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, 0x0027,
+ 0x0000, 0x0000, 0x0000, 0x1b77, 0x1b73, 0x0000, 0x0000, 0x1b81,
+ 0x0000, 0x1b77, 0x0000, 0x1b7e, 0x1b7b, 0x0000, 0x0000, 0x0000,
+ 0x1b81, 0x1b7e, 0x0000, 0x1b79, 0x1b79, 0x0000, 0x0000, 0x1b81,
+ 0x0000, 0x1b79, 0x0000, 0x1b7f, 0x1b7f, 0x0000, 0x0000, 0x0000,
+ 0x1b81, 0x1b7f, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055, 0x0040,
+ 0x1c3f, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1b82, 0xa986,
+ 0x0007, 0x0040, 0x1bbb, 0xa986, 0x000e, 0x0040, 0x1bbb, 0xa986,
+ 0x000f, 0x00c0, 0x1bbf, 0x605c, 0xa422, 0x6060, 0xa31a, 0x2804,
+ 0xa045, 0x00c0, 0x1bcd, 0x0050, 0x1bc7, 0x0078, 0x1c3f, 0x6004,
+ 0xa065, 0x0040, 0x1c3f, 0x0078, 0x1baa, 0x2804, 0xa005, 0x0040,
+ 0x1beb, 0xac68, 0xd99c, 0x00c0, 0x1bdb, 0x6808, 0xa422, 0x680c,
+ 0xa31b, 0x0078, 0x1bdf, 0x6810, 0xa422, 0x6814, 0xa31b, 0x0048,
+ 0x1c0a, 0x2300, 0xa405, 0x0040, 0x1bf1, 0x8a51, 0x0040, 0x1c3f,
+ 0x8840, 0x0078, 0x1bcd, 0x6004, 0xa065, 0x0040, 0x1c3f, 0x0078,
+ 0x1baa, 0x8a51, 0x0040, 0x1c3f, 0x8840, 0x2804, 0xa005, 0x00c0,
+ 0x1c04, 0x6004, 0xa065, 0x0040, 0x1c3f, 0x6034, 0xa0cc, 0x000f,
+ 0xa9c0, 0x1b82, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc, 0x6852,
+ 0x0078, 0x1c37, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x0d7e,
+ 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c25, 0x6908,
+ 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x126a, 0x6800,
+ 0xa420, 0x6804, 0xa319, 0x0078, 0x1c31, 0x6910, 0x2400, 0xa122,
+ 0x6914, 0x2300, 0xa11b, 0x1048, 0x126a, 0x6800, 0xa420, 0x6804,
+ 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852, 0x2c00,
+ 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1c44, 0x087f,
+ 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, 0x2004,
+ 0xa084, 0x0007, 0x0079, 0x1c4c, 0x1c54, 0x1c55, 0x1c58, 0x1c5b,
+ 0x1c60, 0x1c63, 0x1c68, 0x1c6d, 0x007c, 0x1078, 0x1a56, 0x007c,
+ 0x1078, 0x170a, 0x007c, 0x1078, 0x170a, 0x1078, 0x1a56, 0x007c,
+ 0x1078, 0x13f1, 0x007c, 0x1078, 0x1a56, 0x1078, 0x13f1, 0x007c,
+ 0x1078, 0x170a, 0x1078, 0x13f1, 0x007c, 0x1078, 0x170a, 0x1078,
+ 0x1a56, 0x1078, 0x13f1, 0x007c, 0x127e, 0x2091, 0x2300, 0x2079,
+ 0x0200, 0x2071, 0x7080, 0x2069, 0x6c00, 0x2009, 0x0004, 0x7912,
+ 0x7916, 0x1078, 0x1f3c, 0x781b, 0x0002, 0x20e1, 0x8700, 0x127f,
+ 0x007c, 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, 0x0079,
+ 0x1c91, 0x1cb5, 0x1c99, 0x1c9d, 0x1ca1, 0x1ca7, 0x1cab, 0x1caf,
+ 0x1cb3, 0x1078, 0x3cc5, 0x0078, 0x1cb5, 0x1078, 0x3cf9, 0x0078,
+ 0x1cb5, 0x1078, 0x3cc5, 0x1078, 0x3cf9, 0x0078, 0x1cb5, 0x1078,
+ 0x1cb7, 0x0078, 0x1cb5, 0x1078, 0x1cb7, 0x0078, 0x1cb5, 0x1078,
+ 0x1cb7, 0x0078, 0x1cb5, 0x1078, 0x1cb7, 0x127f, 0x007c, 0x007e,
+ 0x017e, 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1cc1, 0x1078,
+ 0x126a, 0xa184, 0x0030, 0x0040, 0x1cd2, 0x6a00, 0xa286, 0x0003,
+ 0x00c0, 0x1ccc, 0x1078, 0x126a, 0x1078, 0x30c9, 0x20e1, 0x9010,
+ 0x0078, 0x1cde, 0xa184, 0x00c0, 0x0040, 0x1cd8, 0x1078, 0x126a,
+ 0xa184, 0x0300, 0x0040, 0x1cde, 0x20e1, 0x9020, 0x7932, 0x027f,
+ 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, 0x6c00,
+ 0x7128, 0x2001, 0x6da3, 0x2102, 0x2001, 0x6dab, 0x2102, 0xa182,
+ 0x0211, 0x00c8, 0x1cf7, 0x2009, 0x0008, 0x0078, 0x1d21, 0xa182,
+ 0x0259, 0x00c8, 0x1cff, 0x2009, 0x0007, 0x0078, 0x1d21, 0xa182,
+ 0x02c1, 0x00c8, 0x1d07, 0x2009, 0x0006, 0x0078, 0x1d21, 0xa182,
+ 0x0349, 0x00c8, 0x1d0f, 0x2009, 0x0005, 0x0078, 0x1d21, 0xa182,
+ 0x0421, 0x00c8, 0x1d17, 0x2009, 0x0004, 0x0078, 0x1d21, 0xa182,
+ 0x0581, 0x00c8, 0x1d1f, 0x2009, 0x0003, 0x0078, 0x1d21, 0x2009,
+ 0x0002, 0x2079, 0x0200, 0x7912, 0x7916, 0x1078, 0x1f3c, 0x0f7f,
+ 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061, 0x0100,
+ 0x2071, 0x6c00, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7, 0x0000,
+ 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000,
+ 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x00af, 0x600f, 0x00ff,
+ 0x602b, 0x002f, 0x127f, 0x007c, 0x2001, 0x6c2b, 0x2003, 0x0000,
+ 0x2001, 0x6c2a, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200,
+ 0x007e, 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, 0x1d64,
+ 0xa184, 0x0007, 0x0079, 0x1d6a, 0xa195, 0x0004, 0xa284, 0x0007,
+ 0x0079, 0x1d6a, 0x1d96, 0x1d72, 0x1d76, 0x1d7a, 0x1d80, 0x1d84,
+ 0x1d8a, 0x1d90, 0x1078, 0x419e, 0x0078, 0x1d96, 0x1078, 0x427a,
+ 0x0078, 0x1d96, 0x1078, 0x427a, 0x1078, 0x419e, 0x0078, 0x1d96,
+ 0x1078, 0x1d9b, 0x0078, 0x1d96, 0x1078, 0x419e, 0x1078, 0x1d9b,
+ 0x0078, 0x1d96, 0x1078, 0x427a, 0x1078, 0x1d9b, 0x0078, 0x1d96,
+ 0x1078, 0x427a, 0x1078, 0x419e, 0x1078, 0x1d9b, 0x027f, 0x017f,
+ 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1e48, 0x017e, 0x047e,
+ 0x0c7e, 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196, 0xff00, 0x0040,
+ 0x1dca, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, 0x1dca,
+ 0x7130, 0xd18c, 0x00c0, 0x1dca, 0x2011, 0x6c52, 0x2214, 0xd2ec,
+ 0x0040, 0x1dbe, 0xc18d, 0x7132, 0x0078, 0x1dca, 0x6240, 0xa294,
+ 0x0010, 0x0040, 0x1e05, 0x6248, 0xa294, 0xff00, 0xa296, 0xff00,
+ 0x00c0, 0x1e05, 0x2011, 0x8013, 0x1078, 0x2926, 0x7130, 0xc185,
+ 0x7132, 0x2011, 0x6c52, 0x220c, 0xd1a4, 0x0040, 0x1ded, 0x017e,
+ 0x2009, 0x0001, 0x2011, 0x0100, 0x1078, 0x416c, 0x2019, 0x000e,
+ 0x1078, 0x6aa2, 0xa484, 0x00ff, 0x1078, 0x1f61, 0x8127, 0xa006,
+ 0x2009, 0x000e, 0x1078, 0x6b0a, 0x017f, 0xd1ac, 0x00c0, 0x1df6,
+ 0x2019, 0x0004, 0x1078, 0x2103, 0x0078, 0x1e05, 0x157e, 0x20a9,
+ 0x007e, 0x2009, 0x0000, 0x1078, 0x336a, 0x00c0, 0x1e01, 0x1078,
+ 0x316e, 0x8108, 0x00f0, 0x1dfb, 0x157f, 0x0c7f, 0x047f, 0x6043,
+ 0x0000, 0x2009, 0x00f7, 0x1078, 0x3131, 0x0f7e, 0x2079, 0x6dc3,
+ 0x783c, 0xa086, 0x0000, 0x0040, 0x1e1d, 0x6027, 0x0004, 0x783f,
+ 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003,
+ 0x1078, 0x502b, 0x2011, 0x0002, 0x1078, 0x5035, 0x1078, 0x4f41,
+ 0x1078, 0x40a3, 0x037e, 0x2019, 0x0000, 0x1078, 0x4fd3, 0x037f,
+ 0x60e3, 0x0000, 0x017f, 0x2001, 0x6c00, 0x2014, 0xa296, 0x0004,
+ 0x00c0, 0x1e40, 0xd19c, 0x00c0, 0x1e40, 0x6228, 0xc29d, 0x622a,
+ 0x2003, 0x0001, 0x2001, 0x6c1e, 0x2003, 0x0000, 0x6027, 0x0020,
+ 0xd194, 0x0040, 0x1ee3, 0x0f7e, 0x2079, 0x6dc3, 0x783c, 0xa086,
+ 0x0001, 0x00c0, 0x1e6c, 0x017e, 0x6027, 0x0004, 0x783f, 0x0000,
+ 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000, 0x2079, 0x6db0,
+ 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x4713, 0x1078, 0x47c3,
+ 0x017f, 0x0f7f, 0x0078, 0x1ee3, 0x0f7f, 0x017e, 0x6220, 0xd2b4,
+ 0x0040, 0x1ea1, 0x1078, 0x40a3, 0x1078, 0x4e17, 0x6027, 0x0004,
+ 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1e84,
+ 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x6db0,
+ 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1e94, 0x8000, 0x602a, 0x0c7f,
+ 0x1078, 0x4e09, 0x0078, 0x1ee2, 0x2019, 0x6db9, 0x2304, 0xa065,
+ 0x0040, 0x1e9e, 0x2009, 0x0027, 0x1078, 0x544c, 0x0c7f, 0x0078,
+ 0x1ee2, 0xd2bc, 0x0040, 0x1ee2, 0x1078, 0x40b1, 0x6017, 0x0010,
+ 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
+ 0x0040, 0x1eb6, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
+ 0x2061, 0x6db0, 0x6044, 0xa09a, 0x0002, 0x00c8, 0x1ed7, 0x8000,
+ 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1ee2, 0x1078, 0x40a8,
+ 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0, 0x1ed3, 0x6017,
+ 0x0012, 0x0078, 0x1ee2, 0x6017, 0x0016, 0x0078, 0x1ee2, 0x2019,
+ 0x6dbf, 0x2304, 0xa065, 0x0040, 0x1ee1, 0x2009, 0x004f, 0x1078,
+ 0x544c, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1f0b, 0x017e, 0x6028,
+ 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x502b, 0x2011, 0x0002,
+ 0x1078, 0x5035, 0x1078, 0x4f41, 0x1078, 0x40a3, 0x037e, 0x2019,
+ 0x0000, 0x1078, 0x4fd3, 0x037f, 0x60e3, 0x0000, 0x1078, 0x6b79,
+ 0x1078, 0x6b97, 0x2001, 0x6c00, 0x2003, 0x0004, 0x6027, 0x0008,
+ 0x1078, 0x1161, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e,
+ 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071,
+ 0x6c00, 0x71a8, 0x70aa, 0xa116, 0x0040, 0x1f35, 0x81ff, 0x0040,
+ 0x1f27, 0x2011, 0x8011, 0x1078, 0x2926, 0x0078, 0x1f35, 0x2011,
+ 0x8012, 0x1078, 0x2926, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019,
+ 0x0028, 0x1078, 0x2103, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f,
+ 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e,
+ 0x2061, 0x0100, 0xa190, 0x1f4f, 0x2204, 0x60f2, 0xa190, 0x1f58,
+ 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x083e,
+ 0x083e, 0x083e, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210,
+ 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0,
+ 0x00a0, 0xa080, 0x2154, 0x200c, 0xa18c, 0xff00, 0x810f, 0x007c,
+ 0xa080, 0x2154, 0x200c, 0xa18c, 0x00ff, 0x007c, 0x1f8e, 0x1f92,
+ 0x1f96, 0x1f9c, 0x1fa2, 0x1fa8, 0x1fae, 0x1fb6, 0x1fbe, 0x1fc4,
+ 0x1fca, 0x1fd2, 0x1fda, 0x1fe2, 0x1fea, 0x1ff4, 0x1ffe, 0x1ffe,
+ 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe,
+ 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x1ffe, 0x107e, 0x007e,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1d55, 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c45, 0x0078, 0x2017,
+ 0x107e, 0x007e, 0x1078, 0x1c45, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1d55, 0x1078, 0x1c45, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1d55, 0x1078, 0x1c45, 0x0078, 0x2017, 0x107e, 0x007e,
+ 0x1078, 0x1c89, 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c45, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1c45, 0x1078, 0x1c89,
+ 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55, 0x1078, 0x1c45,
+ 0x1078, 0x1c89, 0x0078, 0x2017, 0x107e, 0x007e, 0x1078, 0x1d55,
+ 0x1078, 0x1c45, 0x1078, 0x1c89, 0x0078, 0x2017, 0x0005, 0x0078,
+ 0x1ffe, 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x2007, 0x2017,
+ 0x1f94, 0x1f98, 0x1f9e, 0x1fa4, 0x1faa, 0x1fb0, 0x1fb8, 0x1fc0,
+ 0x1fc6, 0x1fcc, 0x1fd4, 0x1fdc, 0x1fe4, 0x1fec, 0x1ff6, 0x0008,
+ 0x2001, 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e,
+ 0x2001, 0x010c, 0x203c, 0x7274, 0x82ff, 0x0040, 0x206d, 0x037e,
+ 0x7384, 0xa38e, 0xffff, 0x00c0, 0x202f, 0x2019, 0x0001, 0x8314,
+ 0xa2e0, 0x71c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x203c, 0xa084,
+ 0xff00, 0x8007, 0x0078, 0x203e, 0xa084, 0x00ff, 0xa70e, 0x0040,
+ 0x2062, 0xa08e, 0x0000, 0x0040, 0x2062, 0xa08e, 0x00ff, 0x0040,
+ 0x2068, 0x1078, 0x1f61, 0x1078, 0x3333, 0x00c0, 0x2065, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x205c, 0x1078, 0x20b5,
+ 0x0040, 0x2065, 0x0078, 0x2062, 0x1078, 0x2150, 0x1078, 0x20dc,
+ 0x0040, 0x2065, 0x8318, 0x0078, 0x202f, 0x7386, 0x0078, 0x206a,
+ 0x7087, 0xffff, 0x037f, 0x0078, 0x20b2, 0xa780, 0x2154, 0x203c,
+ 0xa7bc, 0xff00, 0x873f, 0x20a9, 0x007e, 0x2009, 0x0000, 0x7084,
+ 0xa096, 0xffff, 0x0040, 0x2089, 0xa092, 0x007e, 0x0048, 0x2084,
+ 0x7087, 0xffff, 0x0078, 0x20af, 0x2008, 0x2011, 0x007e, 0xa202,
+ 0x20a8, 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x20a6, 0x1078,
+ 0x3333, 0x00c0, 0x20af, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x00c0, 0x20a0, 0x1078, 0x20b5, 0x0040, 0x20af, 0x0078, 0x20a6,
+ 0x1078, 0x2150, 0x1078, 0x20dc, 0x0040, 0x20af, 0x017f, 0x8108,
+ 0x157f, 0x00f0, 0x2089, 0x7087, 0xffff, 0x0078, 0x20b2, 0x017f,
+ 0x157f, 0x7186, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e,
+ 0x0c7e, 0x2c68, 0x1078, 0x53bf, 0x0040, 0x20d7, 0x2d00, 0x601a,
+ 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x3302, 0x2001, 0x0000,
+ 0x1078, 0x3316, 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082,
+ 0x127f, 0x2009, 0x0004, 0x1078, 0x544c, 0xa085, 0x0001, 0x0c7f,
+ 0x0d7f, 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x53bf, 0x0040, 0x20fe, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x3302, 0x2001, 0x0002, 0x1078,
+ 0x3316, 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082, 0x127f,
+ 0x2009, 0x0002, 0x1078, 0x544c, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x0e7e, 0x0c7e, 0x067e, 0x037e, 0x027e,
+ 0x1078, 0x4406, 0x1078, 0x43b6, 0x1078, 0x5826, 0x20a9, 0x007e,
+ 0x2009, 0x0000, 0x017e, 0x1078, 0x336a, 0x00c0, 0x211b, 0x1078,
+ 0x34f2, 0x1078, 0x316e, 0x017f, 0x8108, 0x00f0, 0x2112, 0x027f,
+ 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x037e,
+ 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078, 0x6946, 0x017f,
+ 0x2e60, 0x1078, 0x34f2, 0x1078, 0x316e, 0x017f, 0x027f, 0x037f,
+ 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x6c00, 0x7080,
+ 0xa005, 0x0040, 0x214d, 0x8001, 0x7082, 0x007f, 0x0e7f, 0x007c,
+ 0x6000, 0xc08c, 0x6002, 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2,
+ 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4,
+ 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca,
+ 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9,
+ 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad,
+ 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3,
+ 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f,
+ 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079,
+ 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d,
+ 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863,
+ 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252,
+ 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047,
+ 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35,
+ 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b,
+ 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e,
+ 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004,
+ 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000,
+ 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00,
+ 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00,
+ 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500,
+ 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00,
+ 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000,
+ 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800,
+ 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200,
+ 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00,
+ 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000,
+ 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000,
+ 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000,
+ 0x8000, 0x8000, 0x8000, 0x0000, 0x2071, 0x6c6d, 0x7003, 0x0002,
+ 0xa006, 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x6c7d, 0x7037,
+ 0x6c7d, 0x7007, 0x0001, 0x2061, 0x6cbd, 0x6003, 0x0002, 0x007c,
+ 0x0090, 0x226b, 0x0068, 0x226b, 0x2071, 0x6c6d, 0x2b78, 0x7818,
+ 0xd084, 0x00c0, 0x226b, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0,
+ 0x2351, 0x0079, 0x22ef, 0x007c, 0x2071, 0x6c6d, 0x7004, 0x0079,
+ 0x2271, 0x2275, 0x2276, 0x2280, 0x2292, 0x007c, 0x0090, 0x227f,
+ 0x0068, 0x227f, 0x2b78, 0x7818, 0xd084, 0x0040, 0x229e, 0x007c,
+ 0x2b78, 0x2061, 0x6cbd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x228d,
+ 0xa086, 0x0200, 0x0040, 0x2349, 0x007c, 0x7014, 0x2068, 0x2a60,
+ 0x7018, 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040,
+ 0x229a, 0x007c, 0x2a60, 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820,
+ 0xa08a, 0x0040, 0x00c8, 0x22a7, 0x61a8, 0x0079, 0x22af, 0x2100,
+ 0xa08a, 0x0035, 0x00c8, 0x2345, 0x61a8, 0x0079, 0x22ef, 0x2327,
+ 0x2359, 0x2361, 0x2365, 0x236d, 0x2373, 0x2377, 0x2380, 0x2384,
+ 0x238c, 0x2390, 0x2345, 0x2345, 0x2345, 0x2394, 0x2345, 0x23a4,
+ 0x23bb, 0x23d2, 0x244e, 0x2453, 0x2480, 0x24cb, 0x24da, 0x24fb,
+ 0x2531, 0x253b, 0x2548, 0x255b, 0x2573, 0x257c, 0x25b9, 0x25bf,
+ 0x2345, 0x25ca, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x25ce,
+ 0x25d4, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x25dc, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x25e9,
+ 0x25ef, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x238c,
+ 0x2390, 0x2345, 0x2345, 0x2601, 0x2345, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x2345, 0x264e,
+ 0x271d, 0x2731, 0x2738, 0x279b, 0x27ec, 0x27f7, 0x2839, 0x2846,
+ 0x2853, 0x2856, 0x2605, 0x287f, 0x28ca, 0x2345, 0x2345, 0x2345,
+ 0x2345, 0x29ad, 0x29bb, 0x29c8, 0x713c, 0x0078, 0x2327, 0x2021,
+ 0x4000, 0x1078, 0x2900, 0x127e, 0x2091, 0x8000, 0x0068, 0x2334,
+ 0x7818, 0xd084, 0x0040, 0x2337, 0x127f, 0x0078, 0x232b, 0x781b,
+ 0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x2091, 0x4080, 0x7007,
+ 0x0001, 0x2091, 0x5000, 0x127f, 0x007c, 0x2021, 0x4001, 0x0078,
+ 0x2329, 0x2021, 0x4002, 0x0078, 0x2329, 0x2021, 0x4003, 0x0078,
+ 0x2329, 0x2021, 0x4005, 0x0078, 0x2329, 0x2021, 0x4006, 0x0078,
+ 0x2329, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
+ 0x290f, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
+ 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2913, 0x7924, 0x7828, 0x2114,
+ 0x200a, 0x0078, 0x2327, 0x7924, 0x2114, 0x0078, 0x2327, 0x2099,
+ 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x2327,
+ 0x7824, 0x2060, 0x0078, 0x2396, 0x2009, 0x0001, 0x2011, 0x000e,
+ 0x2019, 0x0006, 0x0078, 0x2327, 0x7d38, 0x7c3c, 0x0078, 0x235b,
+ 0x7d38, 0x7c3c, 0x0078, 0x2367, 0x2061, 0x1000, 0x610c, 0xa006,
+ 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2398, 0x2010, 0xa005,
+ 0x0040, 0x2327, 0x0078, 0x234d, 0x2061, 0x6c51, 0x7824, 0x7930,
+ 0xa11a, 0x00c8, 0x2355, 0x8019, 0x0040, 0x2355, 0x604a, 0x6142,
+ 0x782c, 0x6052, 0x7828, 0x6056, 0xa006, 0x605a, 0x605e, 0x1078,
+ 0x37bb, 0x0078, 0x2327, 0x2061, 0x6c51, 0x7824, 0x7930, 0xa11a,
+ 0x00c8, 0x2355, 0x8019, 0x0040, 0x2355, 0x604e, 0x6146, 0x782c,
+ 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x3591,
+ 0x0078, 0x2327, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x2351, 0x7924,
+ 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x6c74, 0x41a1, 0x1078,
+ 0x28d7, 0x0040, 0x2351, 0x2009, 0x0020, 0x1078, 0x290f, 0x701b,
+ 0x23ea, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
+ 0x0040, 0x23f6, 0xa096, 0x0019, 0x00c0, 0x2351, 0x810f, 0xa18c,
+ 0x00ff, 0x0040, 0x2351, 0x710e, 0x700c, 0x8001, 0x0040, 0x2427,
+ 0x700e, 0x1078, 0x28d7, 0x0040, 0x2351, 0x2009, 0x0020, 0x2061,
+ 0x6cbd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
+ 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x290f, 0x701b,
+ 0x241a, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
+ 0x2425, 0xa096, 0x000a, 0x00c0, 0x2351, 0x0078, 0x23fc, 0x7010,
+ 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x3267, 0x00c0, 0x2435,
+ 0x7007, 0x0003, 0x701b, 0x2437, 0x007c, 0x1078, 0x3654, 0x127e,
+ 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x6c74, 0x530a, 0x2100,
+ 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80,
+ 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x2913, 0x6190, 0x7824,
+ 0x6092, 0x0078, 0x2327, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
+ 0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104,
+ 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
+ 0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e,
+ 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010,
+ 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, 0x0078, 0x0423,
+ 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355, 0x7c28,
+ 0x7d2c, 0x1078, 0x34b5, 0xd28c, 0x00c0, 0x2492, 0x1078, 0x3445,
+ 0x0078, 0x2494, 0x1078, 0x3481, 0x00c0, 0x24be, 0x2061, 0x7200,
+ 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x24ac,
+ 0x6010, 0xa06d, 0x0040, 0x24ac, 0x683c, 0xa406, 0x00c0, 0x24ac,
+ 0x6840, 0xa506, 0x0040, 0x24b7, 0x127f, 0xace0, 0x0008, 0x2001,
+ 0x6c15, 0x2004, 0xac02, 0x00c8, 0x2351, 0x0078, 0x2498, 0x1078,
+ 0x5de3, 0x127f, 0x0040, 0x2351, 0x0078, 0x2327, 0xa00e, 0x2001,
+ 0x0005, 0x1078, 0x3654, 0x127e, 0x2091, 0x8000, 0x1078, 0x35c4,
+ 0x127f, 0x0078, 0x2327, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x1078, 0x33fa, 0x1078, 0x34c6, 0x0040, 0x2351,
+ 0x0078, 0x2327, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040,
+ 0x2355, 0x2031, 0x000f, 0x1078, 0x33fa, 0x8631, 0x00c8, 0x24e3,
+ 0x2019, 0x0005, 0x1078, 0x34e7, 0x0040, 0x2351, 0x7828, 0xa08a,
+ 0x1000, 0x00c8, 0x2355, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078,
+ 0x4033, 0x0078, 0x2327, 0x127e, 0x2091, 0x8000, 0x81ff, 0x00c0,
+ 0x252b, 0x2029, 0x007d, 0x644c, 0x2400, 0xa506, 0x0040, 0x2525,
+ 0x2508, 0x1078, 0x336a, 0x00c0, 0x2525, 0x2031, 0x000f, 0x1078,
+ 0x33fa, 0x8631, 0x00c8, 0x250f, 0x2019, 0x0004, 0x1078, 0x34e7,
+ 0x0040, 0x252b, 0x7824, 0xa08a, 0x1000, 0x00c8, 0x252e, 0x8003,
+ 0x800b, 0x810b, 0xa108, 0x1078, 0x4033, 0x8529, 0x00c8, 0x2504,
+ 0x127f, 0x0078, 0x2327, 0x127f, 0x0078, 0x2351, 0x127f, 0x0078,
+ 0x2355, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078, 0x342a, 0x1078,
+ 0x34b5, 0x0078, 0x2327, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x1078, 0x3413, 0x1078, 0x34b5, 0x0078, 0x2327,
+ 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078,
+ 0x3484, 0x0040, 0x2351, 0x1078, 0x32af, 0x1078, 0x343e, 0x1078,
+ 0x34b5, 0x0078, 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078,
+ 0x33fa, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078, 0x34f2, 0x0c7f,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078, 0x6946, 0x1078,
+ 0x34b5, 0x0078, 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078,
+ 0x34b5, 0x2208, 0x0078, 0x2327, 0x157e, 0x0d7e, 0x0e7e, 0x2069,
+ 0x6cff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x2588, 0x2009, 0x0000,
+ 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9, 0x007d, 0x2069,
+ 0x6d20, 0x2d04, 0xa075, 0x0040, 0x259d, 0x704c, 0x1078, 0x25a7,
+ 0xa210, 0x7080, 0x1078, 0x25a7, 0xa318, 0x8d68, 0x00f0, 0x2591,
+ 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078, 0x2327, 0x0f7e,
+ 0x017e, 0xa07d, 0x0040, 0x25b6, 0x2001, 0x0000, 0x8000, 0x2f0c,
+ 0x81ff, 0x0040, 0x25b6, 0x2178, 0x0078, 0x25ae, 0x017f, 0x0f7f,
+ 0x007c, 0x2069, 0x6cff, 0x6910, 0x6294, 0x0078, 0x2327, 0x81ff,
+ 0x00c0, 0x2351, 0x614c, 0xa190, 0x2154, 0x2214, 0xa294, 0x00ff,
+ 0x0078, 0x2327, 0x613c, 0x6240, 0x0078, 0x2327, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x0078, 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355,
+ 0x6244, 0x6338, 0x0078, 0x2327, 0x613c, 0x6240, 0x7824, 0x603e,
+ 0x7b28, 0x6342, 0x2069, 0x6c51, 0x831f, 0xa305, 0x6816, 0x0078,
+ 0x2327, 0x1078, 0x28ef, 0x0040, 0x2355, 0x0078, 0x2327, 0x1078,
+ 0x28ef, 0x0040, 0x2355, 0x7828, 0xa00d, 0x0040, 0x2355, 0x782c,
+ 0xa005, 0x0040, 0x2355, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078,
+ 0x2327, 0x7d38, 0x7c3c, 0x0078, 0x23d4, 0x7824, 0xa09c, 0x00ff,
+ 0xa39a, 0x0003, 0x00c8, 0x2351, 0x624c, 0xa084, 0xff00, 0x8007,
+ 0xa206, 0x00c0, 0x261d, 0x2001, 0x6c40, 0x2009, 0x000c, 0x7a2c,
+ 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2913, 0x81ff, 0x00c0, 0x2351,
+ 0x1078, 0x28ef, 0x0040, 0x2355, 0x6004, 0xa084, 0x00ff, 0xa086,
+ 0x0006, 0x00c0, 0x2351, 0x0c7e, 0x1078, 0x28d7, 0x0c7f, 0x0040,
+ 0x2351, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x60a4,
+ 0x0040, 0x2351, 0x7007, 0x0003, 0x701b, 0x263f, 0x007c, 0x6830,
+ 0xa086, 0x0100, 0x0040, 0x2351, 0xad80, 0x000e, 0x2009, 0x000c,
+ 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2913, 0x1078, 0x28d7,
+ 0x0040, 0x2351, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
+ 0x1078, 0x290f, 0x701b, 0x265d, 0x007c, 0xade8, 0x000d, 0x6800,
+ 0xa005, 0x0040, 0x2355, 0x6804, 0xd0ac, 0x0040, 0x266a, 0xd0a4,
+ 0x0040, 0x2355, 0xd094, 0x0040, 0x2675, 0x0c7e, 0x2061, 0x0100,
+ 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x2680,
+ 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f,
+ 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x2697, 0xd084,
+ 0x0040, 0x2697, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x2355, 0xa088,
+ 0x2154, 0x210c, 0xa18c, 0x00ff, 0x6152, 0x0078, 0x26a0, 0xd0dc,
+ 0x0040, 0x26a0, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x2355, 0x604e,
+ 0x6808, 0xa08a, 0x0100, 0x0048, 0x2355, 0xa08a, 0x0841, 0x00c8,
+ 0x2355, 0xa084, 0x0007, 0x00c0, 0x2355, 0x680c, 0xa005, 0x0040,
+ 0x2355, 0x6810, 0xa005, 0x0040, 0x2355, 0x6848, 0x6940, 0xa10a,
+ 0x00c8, 0x2355, 0x8001, 0x0040, 0x2355, 0x684c, 0x6944, 0xa10a,
+ 0x00c8, 0x2355, 0x8001, 0x0040, 0x2355, 0x20a9, 0x001c, 0x2d98,
+ 0x2069, 0x6c51, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e,
+ 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, 0x37bb, 0x1078, 0x3591,
+ 0x6000, 0xa086, 0x0000, 0x00c0, 0x271b, 0x6808, 0x602a, 0x1078,
+ 0x1ce3, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040,
+ 0x26fb, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x0078, 0x26fd, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+ 0x6312, 0x1078, 0x40bf, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
+ 0x602f, 0x0000, 0x0c7f, 0x60ac, 0xa005, 0x0040, 0x2717, 0x6003,
+ 0x0001, 0x2091, 0x301d, 0x1078, 0x30c9, 0x0078, 0x271b, 0x6003,
+ 0x0004, 0x2091, 0x301d, 0x0078, 0x2327, 0x6000, 0xa086, 0x0000,
+ 0x0040, 0x2351, 0x2069, 0x6c51, 0x7830, 0x6842, 0x7834, 0x6846,
+ 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
+ 0x2913, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x30c9, 0x0078, 0x2327,
+ 0x81ff, 0x00c0, 0x2351, 0x6174, 0x81ff, 0x0040, 0x2752, 0x703f,
+ 0x0000, 0x2001, 0x71c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
+ 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2913, 0x701b, 0x2324,
+ 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x71c0, 0x20a9,
+ 0x0040, 0x20a1, 0x71c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
+ 0x2154, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
+ 0x2100, 0xa506, 0x0040, 0x2784, 0x1078, 0x336a, 0x00c0, 0x2784,
+ 0x6014, 0x821c, 0x0048, 0x277c, 0xa398, 0x71c0, 0xa085, 0xff00,
+ 0x8007, 0x201a, 0x0078, 0x2783, 0xa398, 0x71c0, 0x2324, 0xa4a4,
+ 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x007f, 0x00c8,
+ 0x278b, 0x0078, 0x2768, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
+ 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x71c0, 0x2099, 0x71c0, 0x1078,
+ 0x3111, 0x0078, 0x2741, 0x1078, 0x28ef, 0x0040, 0x2355, 0x0c7e,
+ 0x1078, 0x28d7, 0x0c7f, 0x0040, 0x2351, 0x2001, 0x6c52, 0x2004,
+ 0xd0b4, 0x0040, 0x27c8, 0x6000, 0xd08c, 0x00c0, 0x27c8, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x27c8, 0x6837, 0x0000,
+ 0x6838, 0xc0fd, 0x683a, 0x1078, 0x60c0, 0x0040, 0x2351, 0x7007,
+ 0x0003, 0x701b, 0x27c4, 0x007c, 0x1078, 0x28ef, 0x0040, 0x2355,
+ 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
+ 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078,
+ 0x3111, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a,
+ 0x20a0, 0x1078, 0x3111, 0x2d00, 0x2009, 0x0029, 0x7a2c, 0x7b28,
+ 0x7c3c, 0x7d38, 0x0078, 0x2913, 0x81ff, 0x00c0, 0x2351, 0x1078,
+ 0x28ef, 0x0040, 0x2355, 0x1078, 0x34d1, 0x0078, 0x2327, 0x81ff,
+ 0x00c0, 0x2351, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2355, 0x1078,
+ 0x28ef, 0x0040, 0x2355, 0x2031, 0x000f, 0x1078, 0x33fa, 0x8631,
+ 0x00c8, 0x2805, 0x2019, 0x0004, 0x1078, 0x34e7, 0x7924, 0x810f,
+ 0x7a28, 0x1078, 0x2815, 0x0078, 0x2327, 0xa186, 0x00ff, 0x0040,
+ 0x281d, 0x1078, 0x282d, 0x0078, 0x282c, 0x2029, 0x007d, 0x2061,
+ 0x6c00, 0x644c, 0x2400, 0xa506, 0x0040, 0x2829, 0x2508, 0x1078,
+ 0x282d, 0x8529, 0x00c8, 0x2822, 0x007c, 0x1078, 0x336a, 0x00c0,
+ 0x2838, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4033,
+ 0x007c, 0x81ff, 0x00c0, 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355,
+ 0x1078, 0x33fa, 0x1078, 0x34dc, 0x0078, 0x2327, 0x81ff, 0x00c0,
+ 0x2351, 0x1078, 0x28ef, 0x0040, 0x2355, 0x1078, 0x33fa, 0x1078,
+ 0x34c6, 0x0078, 0x2327, 0x6100, 0x0078, 0x2327, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x6004, 0xa086, 0x0707, 0x0040, 0x2355, 0x2001,
+ 0x6c00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2351, 0x0d7e, 0xace8,
+ 0x000a, 0x7924, 0xd184, 0x0040, 0x286f, 0xace8, 0x0006, 0x680c,
0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00,
- 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x23db, 0x7824,
- 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2949, 0x81ff, 0x00c0,
- 0x2405, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2409, 0x7924, 0xa18c,
- 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x295d, 0xa182, 0x007e,
- 0x00c8, 0x2409, 0x2100, 0x1078, 0x1feb, 0x027e, 0x0c7e, 0x127e,
- 0x2091, 0x8000, 0x2061, 0x71c9, 0x601b, 0x0000, 0x601f, 0x0000,
- 0x2061, 0x0100, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a,
- 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x326c,
- 0x1078, 0x433a, 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078,
- 0x28d1, 0x127f, 0x0c7f, 0x027f, 0x0078, 0x23db, 0x7924, 0xa18c,
- 0xff00, 0x810f, 0x0c7e, 0x1078, 0x34bf, 0x2c08, 0x0c7f, 0x00c0,
- 0x2409, 0x0078, 0x23db, 0x017e, 0x2008, 0x2044, 0x8000, 0x204c,
- 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, 0x00f0, 0x2995, 0x017f,
- 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c,
- 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108,
- 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x1078,
- 0x12c7, 0x0040, 0x29ce, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
- 0x29c6, 0x2d00, 0x7012, 0x7016, 0x0078, 0x29cc, 0x7014, 0x6802,
- 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7924,
- 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0, 0x29de, 0x7e28,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x29df, 0xa066, 0x8cff,
- 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0,
- 0x29ef, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0048, 0x29f0, 0xa066,
- 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040, 0x29fd, 0x2168,
- 0x6904, 0x1078, 0x12fb, 0x0078, 0x29f4, 0x7112, 0x7116, 0x017f,
- 0x007c, 0x2031, 0x0001, 0x0078, 0x2a07, 0x2031, 0x0000, 0x2061,
- 0x70bd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
- 0x2c10, 0x1078, 0x1332, 0x7007, 0x0002, 0x701b, 0x23db, 0x007c,
- 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x707b,
- 0x2004, 0xa005, 0x00c0, 0x2a32, 0x0068, 0x2a32, 0x7818, 0xd084,
- 0x00c0, 0x2a32, 0x781b, 0x0001, 0x7a22, 0x7b26, 0x2091, 0x4080,
- 0x0078, 0x2a56, 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x706d, 0x7138,
- 0xa182, 0x0008, 0x0048, 0x2a40, 0x7030, 0x2060, 0x0078, 0x2a51,
- 0x7030, 0xa0e0, 0x0008, 0xac82, 0x70bd, 0x0048, 0x2a49, 0x2061,
- 0x707d, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x2a4f, 0x7036, 0x8108,
- 0x713a, 0x2262, 0x6306, 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f,
- 0x007c, 0x0e7e, 0x2071, 0x706d, 0x7038, 0xa005, 0x0040, 0x2a90,
- 0x127e, 0x2091, 0x8000, 0x0068, 0x2a8f, 0x0f7e, 0x2079, 0x0000,
- 0x7818, 0xd084, 0x00c0, 0x2a8e, 0x0c7e, 0x781b, 0x0001, 0x7034,
- 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x2091, 0x4080, 0x7038,
- 0x8001, 0x703a, 0xa005, 0x00c0, 0x2a84, 0x7033, 0x707d, 0x7037,
- 0x707d, 0x0c7f, 0x0078, 0x2a8e, 0xac80, 0x0008, 0xa0fa, 0x70bd,
- 0x0048, 0x2a8c, 0x2001, 0x707d, 0x7036, 0x0c7f, 0x0f7f, 0x127f,
- 0x0e7f, 0x007c, 0x027e, 0x2001, 0x7052, 0x2004, 0xd0c4, 0x0040,
- 0x2a9d, 0x2011, 0x8014, 0x1078, 0x2a18, 0x027f, 0x007c, 0x81ff,
- 0x00c0, 0x2405, 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032,
- 0x1078, 0x3247, 0x127f, 0x0078, 0x23db, 0x7824, 0x2008, 0xa18c,
- 0xfffd, 0x00c0, 0x2ab8, 0x61b4, 0xa10d, 0x61b6, 0x0078, 0x23db,
- 0x0078, 0x2409, 0x81ff, 0x00c0, 0x2405, 0x6000, 0xa086, 0x0003,
- 0x00c0, 0x2405, 0x2001, 0x7052, 0x2004, 0xd0a4, 0x00c0, 0x2405,
- 0x1078, 0x29e1, 0x0040, 0x2409, 0x6004, 0xa084, 0x00ff, 0xa086,
- 0x0006, 0x00c0, 0x2ad7, 0x7828, 0xa005, 0x0040, 0x23db, 0x0c7e,
- 0x1078, 0x29b7, 0x0c7f, 0x0040, 0x2405, 0x6837, 0x0000, 0x6833,
- 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x649c, 0x0040, 0x2405,
- 0x7007, 0x0003, 0x701b, 0x2aed, 0x007c, 0x6830, 0xa086, 0x0100,
- 0x0040, 0x2405, 0x0078, 0x23db, 0x2001, 0x7000, 0x2004, 0xa086,
- 0x0003, 0x00c0, 0x2405, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
- 0x1078, 0x29b7, 0x0040, 0x2405, 0x2009, 0x0000, 0x2031, 0x0000,
- 0x7023, 0x0000, 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0,
- 0x1078, 0x34fa, 0x00c0, 0x2b3a, 0x6004, 0xa0c6, 0x0707, 0x0040,
- 0x2b3a, 0xa084, 0x00ff, 0xa0c6, 0x0006, 0x00c0, 0x2b3a, 0x87ff,
- 0x0040, 0x2b2d, 0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, 0x0004,
- 0x53a3, 0x1078, 0x29a1, 0x0078, 0x2b36, 0xac80, 0x000a, 0x2098,
- 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x29a1, 0x21a2, 0x94a0,
- 0xa6b0, 0x0005, 0x8108, 0xa186, 0x007e, 0x0040, 0x2b45, 0xa686,
- 0x0028, 0x0040, 0x2b4e, 0x0078, 0x2b10, 0x86ff, 0x00c0, 0x2b4c,
- 0x7120, 0x810b, 0x0078, 0x23db, 0x702f, 0x0001, 0x711e, 0x7020,
- 0xa600, 0x7022, 0x772a, 0x2061, 0x70bd, 0x6007, 0x0000, 0x6612,
- 0x7024, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078,
- 0x1332, 0x7007, 0x0002, 0x701b, 0x2b66, 0x007c, 0x702c, 0xa005,
- 0x00c0, 0x2b78, 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000,
- 0x2061, 0x70bd, 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x2b10,
- 0x7120, 0x810b, 0x0078, 0x23db, 0x127e, 0x0c7e, 0x0e7e, 0x2061,
- 0x0100, 0x2071, 0x7000, 0x6044, 0xd0a4, 0x00c0, 0x2ba5, 0xd084,
- 0x0040, 0x2b8e, 0x1078, 0x2ccc, 0x0078, 0x2ba1, 0xd08c, 0x0040,
- 0x2b95, 0x1078, 0x2be3, 0x0078, 0x2ba1, 0xd094, 0x0040, 0x2b9c,
- 0x1078, 0x2bc6, 0x0078, 0x2ba1, 0xd09c, 0x0040, 0x2ba1, 0x1078,
- 0x2baf, 0x0e7f, 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c,
- 0x00c0, 0x2bac, 0xc19d, 0x612a, 0x017f, 0x0078, 0x2ba1, 0x6043,
- 0x0040, 0x6043, 0x0000, 0x7067, 0x0000, 0x707f, 0x0001, 0x709f,
- 0x0000, 0x2009, 0x75c0, 0x200b, 0x0000, 0x706b, 0x000f, 0x2009,
- 0x000f, 0x2011, 0x3207, 0x1078, 0x433a, 0x007c, 0x7068, 0xa005,
- 0x00c0, 0x2be2, 0x2011, 0x3207, 0x1078, 0x42aa, 0x6043, 0x0020,
- 0x6043, 0x0000, 0x6044, 0xd08c, 0x00c0, 0x2bde, 0x707b, 0x0000,
- 0x6043, 0x0090, 0x6043, 0x0010, 0x0078, 0x2be2, 0x706f, 0x0000,
- 0x0078, 0x2be2, 0x007c, 0x706c, 0xa08a, 0x0003, 0x00c8, 0x2bec,
- 0x1079, 0x2bef, 0x0078, 0x2bee, 0x1078, 0x1288, 0x007c, 0x2bf2,
- 0x2c41, 0x2ccb, 0x0f7e, 0x706f, 0x0001, 0x20e1, 0xa000, 0x20e1,
- 0x8700, 0x1078, 0x1d4d, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079,
- 0x7400, 0x207b, 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f,
- 0x00ef, 0x7813, 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f,
- 0x0000, 0x7823, 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f,
- 0x0000, 0x2079, 0x740c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099,
- 0x7005, 0x20a1, 0x740e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7412,
- 0x207b, 0x0000, 0x7807, 0x0000, 0x2099, 0x7400, 0x20a1, 0x020b,
- 0x20a9, 0x0014, 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078,
- 0x322e, 0x0f7f, 0x7073, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000,
- 0x007c, 0x0d7e, 0x7070, 0x7073, 0x0000, 0xa025, 0x0040, 0x2cb5,
- 0x6020, 0xd0b4, 0x00c0, 0x2cb3, 0x717c, 0x81ff, 0x0040, 0x2c9c,
- 0xa486, 0x000c, 0x00c0, 0x2ca7, 0xa480, 0x0018, 0x8004, 0x20a8,
- 0x2011, 0x7480, 0x2019, 0x7400, 0x220c, 0x2304, 0xa106, 0x00c0,
- 0x2c73, 0x8210, 0x8318, 0x00f0, 0x2c5c, 0x6043, 0x0004, 0x608b,
- 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0006, 0x706f, 0x0002, 0x707b,
- 0x0002, 0x0078, 0x2cb3, 0x2069, 0x7480, 0x6930, 0xa18e, 0x1101,
- 0x00c0, 0x2ca7, 0x6834, 0xa005, 0x00c0, 0x2ca7, 0x6900, 0xa18c,
- 0x00ff, 0x00c0, 0x2c87, 0x6804, 0xa005, 0x0040, 0x2c9c, 0x2011,
- 0x748e, 0x2019, 0x7005, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102,
- 0x0048, 0x2c9a, 0x00c0, 0x2ca7, 0x8210, 0x8318, 0x00f0, 0x2c8d,
- 0x0078, 0x2ca7, 0x707f, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7480, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043,
- 0x0008, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2cb3, 0x60c3,
- 0x000c, 0x1078, 0x322e, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0,
- 0x2cb3, 0x60c3, 0x000c, 0x2011, 0x71c0, 0x2013, 0x0000, 0x7073,
- 0x0000, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
- 0x50a7, 0x0078, 0x2cb3, 0x007c, 0x7078, 0xa08a, 0x001d, 0x00c8,
- 0x2cd5, 0x1079, 0x2cd8, 0x0078, 0x2cd7, 0x1078, 0x1288, 0x007c,
- 0x2cfc, 0x2d0b, 0x2d3c, 0x2d51, 0x2d81, 0x2da9, 0x2dd9, 0x2e03,
- 0x2e33, 0x2e59, 0x2ea4, 0x2ec6, 0x2eea, 0x2f00, 0x2f26, 0x2f39,
- 0x2f42, 0x2f5b, 0x2f89, 0x2fb1, 0x2fdf, 0x3009, 0x304e, 0x3083,
- 0x30a5, 0x30e3, 0x3107, 0x3120, 0x312d, 0x7003, 0x0007, 0x6004,
- 0xa084, 0xfff9, 0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0,
- 0x6043, 0x0002, 0x707b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x320e,
- 0x1078, 0x429d, 0x007c, 0x0f7e, 0x7070, 0xa086, 0x0014, 0x00c0,
- 0x2d3a, 0x6043, 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2d3a, 0x2079,
- 0x7480, 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d38, 0x7834, 0xa005,
- 0x00c0, 0x2d38, 0x7a38, 0xd2fc, 0x0040, 0x2d2e, 0x709c, 0xa005,
- 0x00c0, 0x2d2e, 0x1078, 0x32c7, 0x709f, 0x0001, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0x707b, 0x0010, 0x1078, 0x2f42, 0x0078, 0x2d3a,
- 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0003, 0x6043, 0x0004,
- 0x1078, 0x3298, 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a,
- 0x20a3, 0x0000, 0x00f0, 0x2d48, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2d7f, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2d7b, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1102, 0x00c0, 0x2d7b, 0x7834, 0xa005, 0x00c0,
- 0x2d7b, 0x7a38, 0xd2fc, 0x0040, 0x2d75, 0x709c, 0xa005, 0x00c0,
- 0x2d75, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b, 0x0004, 0x1078,
- 0x2d81, 0x0078, 0x2d7f, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0005, 0x1078, 0x3298, 0x20a3, 0x1103, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x748e, 0x7064, 0xa005, 0x00c0, 0x2d9b,
- 0x714c, 0xa186, 0xffff, 0x0040, 0x2d9b, 0x1078, 0x31d2, 0x0040,
- 0x2d9b, 0x1078, 0x32c7, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2dd7, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2dd3, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2dd3, 0x7834, 0xa005, 0x00c0,
- 0x2dd3, 0x7a38, 0xd2fc, 0x0040, 0x2dcd, 0x709c, 0xa005, 0x00c0,
- 0x2dcd, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b, 0x0006, 0x1078,
- 0x2dd9, 0x0078, 0x2dd7, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0007, 0x1078, 0x3298, 0x20a3, 0x1104, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x748e, 0x7064, 0xa005, 0x00c0, 0x2df5,
- 0x7150, 0xa186, 0xffff, 0x0040, 0x2df5, 0xa180, 0x2207, 0x200c,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x31d2, 0x20a9, 0x0008, 0x2298,
+ 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x2327, 0x7824,
+ 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2889, 0x81ff, 0x00c0,
+ 0x2351, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2355, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x289d, 0xa182, 0x007e,
+ 0x00c8, 0x2355, 0x2100, 0x1078, 0x1f68, 0x027e, 0x0c7e, 0x127e,
+ 0x2091, 0x8000, 0x2061, 0x6dc3, 0x601b, 0x0000, 0x601f, 0x0000,
+ 0x2061, 0x6c00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6030, 0xa084,
+ 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010,
+ 0x2009, 0x001e, 0x2011, 0x30ee, 0x1078, 0x40b6, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0x7a28, 0x1078, 0x2815, 0x127f, 0x0c7f, 0x027f,
+ 0x0078, 0x2327, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078,
+ 0x3333, 0x2c08, 0x0c7f, 0x00c0, 0x2355, 0x0078, 0x2327, 0x1078,
+ 0x12a7, 0x0040, 0x28ee, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
+ 0x28e6, 0x2d00, 0x7012, 0x7016, 0x0078, 0x28ec, 0x7014, 0x6802,
+ 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7e24,
+ 0x860f, 0xa18c, 0x00ff, 0x1078, 0x336a, 0x00c0, 0x28fd, 0xa6b4,
+ 0x00ff, 0xa682, 0x0010, 0x0048, 0x28fe, 0xa066, 0x8cff, 0x007c,
+ 0x017e, 0x7110, 0x81ff, 0x0040, 0x290b, 0x2168, 0x6904, 0x1078,
+ 0x12db, 0x0078, 0x2902, 0x7112, 0x7116, 0x017f, 0x007c, 0x2031,
+ 0x0001, 0x0078, 0x2915, 0x2031, 0x0000, 0x2061, 0x6cbd, 0x6606,
+ 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078,
+ 0x1312, 0x7007, 0x0002, 0x701b, 0x2327, 0x007c, 0x0f7e, 0x127e,
+ 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x6c7b, 0x2004, 0xa005,
+ 0x00c0, 0x2940, 0x0068, 0x2940, 0x7818, 0xd084, 0x00c0, 0x2940,
+ 0x781b, 0x0001, 0x7a22, 0x7b26, 0x2091, 0x4080, 0x0078, 0x2964,
+ 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x6c6d, 0x7138, 0xa182, 0x0008,
+ 0x0048, 0x294e, 0x7030, 0x2060, 0x0078, 0x295f, 0x7030, 0xa0e0,
+ 0x0008, 0xac82, 0x6cbd, 0x0048, 0x2957, 0x2061, 0x6c7d, 0x2c00,
+ 0x7032, 0x81ff, 0x00c0, 0x295d, 0x7036, 0x8108, 0x713a, 0x2262,
+ 0x6306, 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6c6d, 0x7038, 0xa005, 0x0040, 0x299e, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x299d, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084,
+ 0x00c0, 0x299c, 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04,
+ 0x7822, 0x6004, 0x7826, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a,
+ 0xa005, 0x00c0, 0x2992, 0x7033, 0x6c7d, 0x7037, 0x6c7d, 0x0c7f,
+ 0x0078, 0x299c, 0xac80, 0x0008, 0xa0fa, 0x6cbd, 0x0048, 0x299a,
+ 0x2001, 0x6c7d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c,
+ 0x027e, 0x2001, 0x6c52, 0x2004, 0xd0c4, 0x0040, 0x29ab, 0x2011,
+ 0x8014, 0x1078, 0x2926, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2351,
+ 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x30c9,
+ 0x127f, 0x0078, 0x2327, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0,
+ 0x29c6, 0x61b4, 0xa10d, 0x61b6, 0x0078, 0x2327, 0x0078, 0x2355,
+ 0x81ff, 0x00c0, 0x2351, 0x6000, 0xa086, 0x0003, 0x00c0, 0x2351,
+ 0x2001, 0x6c52, 0x2004, 0xd0a4, 0x00c0, 0x2351, 0x1078, 0x28ef,
+ 0x0040, 0x2355, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+ 0x29e5, 0x7828, 0xa005, 0x0040, 0x2327, 0x0c7e, 0x1078, 0x28d7,
+ 0x0c7f, 0x0040, 0x2351, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
+ 0xc0fd, 0x683a, 0x1078, 0x612d, 0x0040, 0x2351, 0x7007, 0x0003,
+ 0x701b, 0x29fb, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2351,
+ 0x0078, 0x2327, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
+ 0x6c00, 0x6044, 0xd0a4, 0x00c0, 0x2a27, 0xd084, 0x0040, 0x2a14,
+ 0x1078, 0x2b4a, 0x0078, 0x2a27, 0xd08c, 0x0040, 0x2a1b, 0x1078,
+ 0x2a61, 0x0078, 0x2a27, 0xd094, 0x0040, 0x2a22, 0x1078, 0x2a42,
+ 0x0078, 0x2a27, 0xd09c, 0x0040, 0x2a27, 0x1078, 0x2a2b, 0x0e7f,
+ 0x0c7f, 0x127f, 0x007c, 0x6043, 0x0040, 0x6043, 0x0000, 0x7067,
+ 0x0000, 0x707f, 0x0001, 0x709f, 0x0000, 0x2009, 0x71c0, 0x200b,
+ 0x0000, 0x706b, 0x000f, 0x2009, 0x000f, 0x2011, 0x3085, 0x1078,
+ 0x40b6, 0x007c, 0x7068, 0xa005, 0x00c0, 0x2a60, 0x2011, 0x3085,
+ 0x1078, 0x4026, 0x6043, 0x0020, 0x6043, 0x0000, 0x6044, 0xd08c,
+ 0x00c0, 0x2a5c, 0x7003, 0x0001, 0x707b, 0x0000, 0x6043, 0x0090,
+ 0x6043, 0x0010, 0x0078, 0x2a60, 0x706f, 0x0000, 0x0078, 0x2a60,
+ 0x007c, 0x706c, 0xa08a, 0x0003, 0x00c8, 0x2a6a, 0x1079, 0x2a6d,
+ 0x0078, 0x2a6c, 0x1078, 0x126a, 0x007c, 0x2a70, 0x2abf, 0x2b49,
+ 0x0f7e, 0x706f, 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078,
+ 0x1ce3, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, 0x7000, 0x207b,
+ 0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, 0x00ef, 0x7813,
+ 0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f, 0x0000, 0x7823,
+ 0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f, 0x0000, 0x2079,
+ 0x700c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, 0x6c05, 0x20a1,
+ 0x700e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7012, 0x207b, 0x0000,
+ 0x7807, 0x0000, 0x2099, 0x7000, 0x20a1, 0x020b, 0x20a9, 0x0014,
+ 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, 0x30b0, 0x0f7f,
+ 0x7073, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e,
+ 0x7070, 0x7073, 0x0000, 0xa025, 0x0040, 0x2b33, 0x6020, 0xd0b4,
+ 0x00c0, 0x2b31, 0x717c, 0x81ff, 0x0040, 0x2b1a, 0xa486, 0x000c,
+ 0x00c0, 0x2b25, 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7080,
+ 0x2019, 0x7000, 0x220c, 0x2304, 0xa106, 0x00c0, 0x2af1, 0x8210,
+ 0x8318, 0x00f0, 0x2ada, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f,
+ 0xf0f0, 0x6043, 0x0006, 0x706f, 0x0002, 0x707b, 0x0002, 0x0078,
+ 0x2b31, 0x2069, 0x7080, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2b25,
+ 0x6834, 0xa005, 0x00c0, 0x2b25, 0x6900, 0xa18c, 0x00ff, 0x00c0,
+ 0x2b05, 0x6804, 0xa005, 0x0040, 0x2b1a, 0x2011, 0x708e, 0x2019,
+ 0x6c05, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2b18,
+ 0x00c0, 0x2b25, 0x8210, 0x8318, 0x00f0, 0x2b0b, 0x0078, 0x2b25,
+ 0x707f, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7080,
+ 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2b31, 0x60c3, 0x000c, 0x1078,
+ 0x30b0, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2b31, 0x60c3,
+ 0x000c, 0x2011, 0x6dba, 0x2013, 0x0000, 0x7073, 0x0000, 0x20e1,
+ 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x4e0e, 0x0078,
+ 0x2b31, 0x007c, 0x7078, 0xa08a, 0x001d, 0x00c8, 0x2b53, 0x1079,
+ 0x2b56, 0x0078, 0x2b55, 0x1078, 0x126a, 0x007c, 0x2b7a, 0x2b89,
+ 0x2bba, 0x2bcf, 0x2bff, 0x2c27, 0x2c57, 0x2c81, 0x2cb1, 0x2cd7,
+ 0x2d22, 0x2d44, 0x2d68, 0x2d7e, 0x2da4, 0x2db7, 0x2dc0, 0x2dd9,
+ 0x2e07, 0x2e2f, 0x2e5d, 0x2e87, 0x2ecc, 0x2f01, 0x2f23, 0x2f61,
+ 0x2f85, 0x2f9e, 0x2fab, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9,
+ 0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002,
+ 0x707b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078, 0x4019,
+ 0x007c, 0x0f7e, 0x7070, 0xa086, 0x0014, 0x00c0, 0x2bb8, 0x6043,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2bb8, 0x2079, 0x7080, 0x7a30,
+ 0xa296, 0x1102, 0x00c0, 0x2bb6, 0x7834, 0xa005, 0x00c0, 0x2bb6,
+ 0x7a38, 0xd2fc, 0x0040, 0x2bac, 0x709c, 0xa005, 0x00c0, 0x2bac,
+ 0x1078, 0x3148, 0x709f, 0x0001, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0x707b, 0x0010, 0x1078, 0x2dc0, 0x0078, 0x2bb8, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x0003, 0x6043, 0x0004, 0x1078, 0x3119,
+ 0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a, 0x20a3, 0x0000,
+ 0x00f0, 0x2bc6, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2bfd, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2bf9, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1102, 0x00c0, 0x2bf9, 0x7834, 0xa005, 0x00c0, 0x2bf9, 0x7a38,
+ 0xd2fc, 0x0040, 0x2bf3, 0x709c, 0xa005, 0x00c0, 0x2bf3, 0x1078,
+ 0x3148, 0x709f, 0x0001, 0x707b, 0x0004, 0x1078, 0x2bff, 0x0078,
+ 0x2bfd, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0005, 0x1078, 0x3119, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x708e, 0x7064, 0xa005, 0x00c0, 0x2c19, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2c19, 0x1078, 0x3050, 0x0040, 0x2c19, 0x1078,
+ 0x3148, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2c55, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2c51, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1103, 0x00c0, 0x2c51, 0x7834, 0xa005, 0x00c0, 0x2c51, 0x7a38,
+ 0xd2fc, 0x0040, 0x2c4b, 0x709c, 0xa005, 0x00c0, 0x2c4b, 0x1078,
+ 0x3148, 0x709f, 0x0001, 0x707b, 0x0006, 0x1078, 0x2c57, 0x0078,
+ 0x2c55, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0007, 0x1078, 0x3119, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x708e, 0x7064, 0xa005, 0x00c0, 0x2c73, 0x7150, 0xa186,
+ 0xffff, 0x0040, 0x2c73, 0xa180, 0x2154, 0x200c, 0xa18c, 0xff00,
+ 0x810f, 0x1078, 0x3050, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2caf, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0014, 0x00c0, 0x2cab, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2cab, 0x7834, 0xa005, 0x00c0,
+ 0x2cab, 0x7a38, 0xd2fc, 0x0040, 0x2ca5, 0x709c, 0xa005, 0x00c0,
+ 0x2ca5, 0x1078, 0x3148, 0x709f, 0x0001, 0x707b, 0x0008, 0x1078,
+ 0x2cb1, 0x0078, 0x2caf, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
+ 0x007c, 0x707b, 0x0009, 0x1078, 0x3119, 0x20a3, 0x1105, 0x20a3,
+ 0x0100, 0x3430, 0x7064, 0xa005, 0x00c0, 0x2cc4, 0x1078, 0x2fba,
+ 0x0040, 0x2cd4, 0x0078, 0x2cce, 0x20a9, 0x0008, 0x2099, 0x708e,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2e31,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2e2d,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2e2d, 0x7834,
- 0xa005, 0x00c0, 0x2e2d, 0x7a38, 0xd2fc, 0x0040, 0x2e27, 0x709c,
- 0xa005, 0x00c0, 0x2e27, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b,
- 0x0008, 0x1078, 0x2e33, 0x0078, 0x2e31, 0x707b, 0x0002, 0x7073,
- 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0009, 0x1078, 0x3298, 0x20a3,
- 0x1105, 0x20a3, 0x0100, 0x3430, 0x7064, 0xa005, 0x00c0, 0x2e46,
- 0x1078, 0x313c, 0x0040, 0x2e56, 0x0078, 0x2e50, 0x20a9, 0x0008,
- 0x2099, 0x748e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x322e, 0x0078, 0x2e58, 0x1078, 0x2cf5,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2ea2, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2e9e, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1105, 0x00c0, 0x2e9e, 0x7834, 0x2011, 0x0100,
- 0xa21e, 0x00c0, 0x2e87, 0x7a38, 0xd2fc, 0x0040, 0x2e7f, 0x709c,
- 0xa005, 0x00c0, 0x2e7f, 0x1078, 0x32c7, 0x709f, 0x0001, 0x7077,
- 0x0001, 0x707b, 0x000a, 0x1078, 0x2ea4, 0x0078, 0x2ea2, 0xa005,
- 0x00c0, 0x2e9e, 0x7a38, 0xd2fc, 0x0040, 0x2e96, 0x709c, 0xa005,
- 0x00c0, 0x2e96, 0x1078, 0x32c7, 0x709f, 0x0001, 0x7077, 0x0000,
- 0x707b, 0x000e, 0x1078, 0x2f26, 0x0078, 0x2ea2, 0x707b, 0x0002,
- 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000b, 0x2011, 0x740e,
- 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002,
- 0x2009, 0x0000, 0x41a4, 0x1078, 0x3298, 0x20a3, 0x1106, 0x20a3,
- 0x0000, 0x6030, 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042,
- 0x53a6, 0x60c3, 0x0084, 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070,
- 0xa005, 0x0040, 0x2ee8, 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086,
- 0x0084, 0x00c0, 0x2ee4, 0x2079, 0x7480, 0x7a30, 0xa296, 0x1106,
- 0x00c0, 0x2ee4, 0x7834, 0xa005, 0x00c0, 0x2ee4, 0x707b, 0x000c,
- 0x1078, 0x2eea, 0x0078, 0x2ee8, 0x707b, 0x0002, 0x7073, 0x0000,
- 0x0f7f, 0x007c, 0x707b, 0x000d, 0x1078, 0x3298, 0x20a3, 0x1107,
- 0x20a3, 0x0000, 0x2099, 0x748e, 0x20a9, 0x0040, 0x53a6, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x322e, 0x007c,
- 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f24, 0x2011, 0x320e, 0x1078,
- 0x42aa, 0xa086, 0x0084, 0x00c0, 0x2f20, 0x2079, 0x7480, 0x7a30,
- 0xa296, 0x1107, 0x00c0, 0x2f20, 0x7834, 0xa005, 0x00c0, 0x2f20,
- 0x1078, 0x328a, 0x707b, 0x000e, 0x1078, 0x2f26, 0x0078, 0x2f24,
- 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000f,
- 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005,
- 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x320e, 0x1078, 0x429d,
- 0x007c, 0x7070, 0xa005, 0x0040, 0x2f41, 0x2011, 0x320e, 0x1078,
- 0x42aa, 0x007c, 0x707b, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7480, 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080,
- 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014,
- 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f87,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2f85,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2f85, 0x7834,
- 0xa005, 0x00c0, 0x2f85, 0x7a38, 0xd2fc, 0x0040, 0x2f7f, 0x709c,
- 0xa005, 0x00c0, 0x2f7f, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b,
- 0x0012, 0x1078, 0x2f89, 0x0078, 0x2f87, 0x7073, 0x0000, 0x0f7f,
- 0x007c, 0x707b, 0x0013, 0x1078, 0x32a4, 0x20a3, 0x1103, 0x20a3,
- 0x0000, 0x3430, 0x2011, 0x748e, 0x7064, 0xa005, 0x00c0, 0x2fa3,
- 0x714c, 0xa186, 0xffff, 0x0040, 0x2fa3, 0x1078, 0x31d2, 0x0040,
- 0x2fa3, 0x1078, 0x32c7, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2fdd, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x2fdb, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2fdb, 0x7834, 0xa005, 0x00c0,
- 0x2fdb, 0x7a38, 0xd2fc, 0x0040, 0x2fd5, 0x709c, 0xa005, 0x00c0,
- 0x2fd5, 0x1078, 0x32c7, 0x709f, 0x0001, 0x707b, 0x0014, 0x1078,
- 0x2fdf, 0x0078, 0x2fdd, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
- 0x0015, 0x1078, 0x32a4, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x748e, 0x7064, 0xa006, 0x00c0, 0x2ffb, 0x7150, 0xa186,
- 0xffff, 0x0040, 0x2ffb, 0xa180, 0x2207, 0x200c, 0xa18c, 0xff00,
- 0x810f, 0x1078, 0x31d2, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e,
- 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x304c, 0x2011, 0x320e,
- 0x1078, 0x42aa, 0xa086, 0x0014, 0x00c0, 0x304a, 0x2079, 0x7480,
- 0x7a30, 0xa296, 0x1105, 0x00c0, 0x304a, 0x7834, 0x2011, 0x0100,
- 0xa21e, 0x00c0, 0x3033, 0x7a38, 0xd2fc, 0x0040, 0x302f, 0x709c,
- 0xa005, 0x00c0, 0x302f, 0x1078, 0x32c7, 0x709f, 0x0001, 0x7077,
- 0x0001, 0x0078, 0x3044, 0xa005, 0x00c0, 0x304a, 0x7a38, 0xd2fc,
- 0x0040, 0x3042, 0x709c, 0xa005, 0x00c0, 0x3042, 0x1078, 0x32c7,
- 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x0016, 0x1078, 0x304e,
- 0x0078, 0x304c, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7480, 0x20a1, 0x020b, 0x20a9, 0x000e,
- 0x53a6, 0x3430, 0x2011, 0x748e, 0x7074, 0xa005, 0x0040, 0x3064,
- 0x707b, 0x0017, 0x0078, 0x3066, 0x707b, 0x001b, 0x7064, 0xa005,
- 0x00c0, 0x3070, 0x1078, 0x313c, 0x0040, 0x3080, 0x0078, 0x307a,
- 0x20a9, 0x0008, 0x2099, 0x748e, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x322e, 0x0078, 0x3082,
- 0x1078, 0x2cf5, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x30a3,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0084, 0x00c0, 0x30a1,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x30a1, 0x7834,
- 0xa005, 0x00c0, 0x30a1, 0x707b, 0x0018, 0x1078, 0x30a5, 0x0078,
- 0x30a3, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0019, 0x1078,
- 0x32a4, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x748e,
- 0x2039, 0x740e, 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514,
- 0x8207, 0xa084, 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007,
- 0xa205, 0x202a, 0x6030, 0x2310, 0x8214, 0xa2a0, 0x740e, 0x2414,
- 0xa38c, 0x0001, 0x0040, 0x30d0, 0xa294, 0xff00, 0x0078, 0x30d3,
- 0xa294, 0x00ff, 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9,
- 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084,
- 0x1078, 0x322e, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x3105,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0xa086, 0x0084, 0x00c0, 0x3103,
- 0x2079, 0x7480, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x3103, 0x7834,
- 0xa005, 0x00c0, 0x3103, 0x1078, 0x328a, 0x707b, 0x001a, 0x1078,
- 0x3107, 0x0078, 0x3105, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
- 0x001b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7480, 0x20a1,
- 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8,
- 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0084, 0x1078, 0x322e, 0x007c,
- 0x7070, 0xa005, 0x0040, 0x312c, 0x2011, 0x320e, 0x1078, 0x42aa,
- 0x707b, 0x001c, 0x1078, 0x312d, 0x007c, 0x7073, 0x0000, 0x608b,
- 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011,
- 0x320e, 0x1078, 0x429d, 0x007c, 0x087e, 0x097e, 0x2029, 0x7052,
- 0x252c, 0x20a9, 0x0008, 0x2041, 0x740e, 0x28a0, 0x2099, 0x748e,
- 0x53a3, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x3152,
- 0x2011, 0x0000, 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0,
- 0x3164, 0xd5d4, 0x0040, 0x315f, 0x8210, 0x0078, 0x3160, 0x8211,
- 0x00f0, 0x3152, 0x0078, 0x31c9, 0x82ff, 0x00c0, 0x3176, 0xd5d4,
- 0x0040, 0x3170, 0xa1a6, 0x3fff, 0x0040, 0x315c, 0x0078, 0x3174,
- 0xa1a6, 0x3fff, 0x0040, 0x31c9, 0xa18d, 0xc000, 0x20a9, 0x0010,
- 0x2019, 0x0001, 0xd5d4, 0x0040, 0x317f, 0x2019, 0x0010, 0x2120,
- 0xd5d4, 0x0040, 0x3186, 0x8423, 0x0078, 0x3187, 0x8424, 0x00c8,
- 0x3194, 0xd5d4, 0x0040, 0x318f, 0x8319, 0x0078, 0x3190, 0x8318,
- 0x00f0, 0x3180, 0x0078, 0x31c9, 0x23a8, 0x2021, 0x0001, 0x8426,
- 0x8425, 0x00f0, 0x3198, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040,
- 0x31ac, 0x007e, 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8,
- 0xa5a8, 0x0010, 0x00f0, 0x31a8, 0x754e, 0xa5c8, 0x2207, 0x292c,
- 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304,
- 0xa405, 0x201a, 0x7067, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008,
- 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078,
- 0x31cf, 0xa006, 0x0078, 0x31cf, 0xa006, 0x1078, 0x1288, 0x097f,
- 0x087f, 0x007c, 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a,
- 0x0010, 0x0048, 0x31df, 0x8420, 0x8001, 0x0078, 0x31d7, 0x2118,
- 0x84ff, 0x0040, 0x31e8, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x31e3,
- 0x2021, 0x0001, 0x83ff, 0x0040, 0x31f1, 0x8423, 0x8319, 0x00c0,
- 0x31ed, 0xa238, 0x2704, 0xa42c, 0x00c0, 0x3206, 0xa405, 0x203a,
- 0x714e, 0xa1a0, 0x2207, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7,
- 0x0000, 0x65ea, 0x7067, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x7000, 0x706b, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e,
- 0x2079, 0x0100, 0x2071, 0x0140, 0x1078, 0x50b0, 0x7004, 0xa084,
- 0x4000, 0x0040, 0x321f, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x701e, 0x2073, 0x0000, 0x7843, 0x0090,
- 0x7843, 0x0010, 0x127f, 0x0f7f, 0x0e7f, 0x007c, 0x127e, 0x2091,
- 0x8000, 0x2011, 0x71c0, 0x2013, 0x0000, 0x7073, 0x0000, 0x127f,
- 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x50a7,
- 0x2009, 0x07d0, 0x2011, 0x320e, 0x1078, 0x433a, 0x007c, 0x017e,
- 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009, 0x00f7, 0x1078,
- 0x32b0, 0x2061, 0x71c9, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061,
- 0x7000, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043,
- 0x0010, 0x2009, 0x001e, 0x2011, 0x326c, 0x1078, 0x429d, 0x127f,
- 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x0100, 0x1078, 0x50b0, 0x2071, 0x0140, 0x7004,
- 0xa084, 0x4000, 0x0040, 0x3280, 0x7003, 0x1000, 0x7003, 0x0000,
- 0x2001, 0x0001, 0x1078, 0x1f8a, 0x1078, 0x3247, 0x127f, 0x007f,
- 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, 0x75c0, 0x2099, 0x748e,
- 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x3290, 0x007c,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7400, 0x20a1, 0x020b,
- 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7480, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c,
- 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, 0x2001, 0x702a, 0x2004,
- 0xa005, 0x00c0, 0x32c1, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078,
- 0x32c3, 0xa185, 0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c, 0x017e,
- 0x047e, 0x2001, 0x7052, 0x2004, 0xd0a4, 0x0040, 0x32da, 0xa006,
- 0x2020, 0x2009, 0x002a, 0x1078, 0x6ecf, 0x2001, 0x700c, 0x200c,
- 0xc195, 0x2102, 0x2019, 0x002a, 0x1078, 0x2186, 0x047f, 0x017f,
- 0x007c, 0x157e, 0x20a9, 0x007d, 0x2009, 0x7120, 0xa006, 0x200a,
- 0x8108, 0x00f0, 0x32e7, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e,
- 0x137e, 0x147e, 0x2069, 0x7051, 0xa006, 0x6002, 0x6007, 0x0707,
- 0x600a, 0x600e, 0x6012, 0xa198, 0x2207, 0x231c, 0xa39c, 0x00ff,
- 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4, 0x20a9,
- 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042, 0x604e,
- 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a, 0x606e,
- 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a, 0x608e,
- 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x0d7e, 0x60a4, 0xa06d,
- 0x0040, 0x332c, 0x1078, 0x12fb, 0x60a7, 0x0000, 0x60a8, 0xa06d,
- 0x0040, 0x3334, 0x1078, 0x12fb, 0x60ab, 0x0000, 0x0d7f, 0xa006,
- 0x604a, 0x6810, 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, 0x00ff,
- 0x6042, 0x147f, 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000,
- 0x00c8, 0x33e5, 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8,
- 0x33eb, 0x2001, 0x700c, 0x2004, 0xa084, 0x0003, 0x00c0, 0x33ce,
- 0xa188, 0x7120, 0x2104, 0xa065, 0x0040, 0x33c4, 0x6004, 0xa084,
- 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x33ca, 0x60a4, 0xa00d, 0x0040,
- 0x3375, 0x1078, 0x370a, 0x0040, 0x33be, 0x60a8, 0xa00d, 0x0040,
- 0x338f, 0x1078, 0x375a, 0x00c0, 0x338f, 0x694c, 0xd1fc, 0x00c0,
- 0x3385, 0x1078, 0x347f, 0x0078, 0x33b9, 0x1078, 0x3450, 0x694c,
- 0xd1ec, 0x00c0, 0x33b9, 0x1078, 0x35df, 0x0078, 0x33b9, 0x694c,
- 0xa184, 0xa000, 0x0040, 0x33a9, 0xd1ec, 0x0040, 0x33a2, 0xd1fc,
- 0x0040, 0x339e, 0x1078, 0x35f0, 0x0078, 0x33a5, 0x1078, 0x35f0,
- 0x0078, 0x33a9, 0xd1fc, 0x0040, 0x33a9, 0x1078, 0x3450, 0x0078,
- 0x33b9, 0x6050, 0xa00d, 0x0040, 0x33b4, 0x2d00, 0x200a, 0x6803,
- 0x0000, 0x6052, 0x0078, 0x33b9, 0x2d00, 0x6052, 0x604e, 0x6803,
- 0x0000, 0x1078, 0x4581, 0xa006, 0x127f, 0x007c, 0x2001, 0x0005,
- 0x2009, 0x0000, 0x0078, 0x33ef, 0x2001, 0x0028, 0x2009, 0x0000,
- 0x0078, 0x33ef, 0xa082, 0x0006, 0x0048, 0x336d, 0x2009, 0x700c,
- 0x210c, 0xd18c, 0x0040, 0x33d8, 0x2001, 0x0004, 0x0078, 0x33e1,
- 0xd184, 0x0040, 0x33df, 0x2001, 0x0004, 0x0078, 0x33e1, 0x2001,
- 0x0029, 0x2009, 0x0000, 0x0078, 0x33ef, 0x2001, 0x0029, 0x2009,
- 0x0000, 0x0078, 0x33ef, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005,
- 0x127f, 0x007c, 0x6944, 0x6e48, 0xa684, 0x3fff, 0xa082, 0x4000,
- 0x00c8, 0x3435, 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8,
- 0x3425, 0xa188, 0x7120, 0x2104, 0xa065, 0x0040, 0x3425, 0x6004,
- 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x342b, 0x684c, 0xd0ec,
- 0x0040, 0x3418, 0x1078, 0x35f0, 0x1078, 0x3450, 0x0078, 0x3420,
- 0x1078, 0x3450, 0x684c, 0xd0fc, 0x0040, 0x3420, 0x1078, 0x35df,
- 0x1078, 0x3638, 0xa006, 0x0078, 0x3439, 0x2001, 0x0028, 0x2009,
- 0x0000, 0x0078, 0x3439, 0xa082, 0x0006, 0x0048, 0x340e, 0x2001,
- 0x0029, 0x2009, 0x0000, 0x0078, 0x3439, 0x2001, 0x0029, 0x2009,
- 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050, 0xa00d,
- 0x0040, 0x3449, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x127f,
- 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x3447,
- 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x345c, 0x6802,
- 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803,
- 0x0000, 0x0078, 0x345a, 0x127e, 0x2091, 0x8000, 0x604c, 0xa06d,
- 0x0040, 0x3471, 0x6800, 0xa005, 0x00c0, 0x346f, 0x6052, 0x604e,
- 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x347e, 0x6800,
- 0xa005, 0x00c0, 0x347c, 0x6052, 0x604e, 0xad05, 0x007c, 0x6803,
- 0x0000, 0x6084, 0xa00d, 0x0040, 0x3489, 0x2d00, 0x200a, 0x6086,
- 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x3488, 0x127e, 0x0c7e,
- 0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005, 0x0040,
- 0x349c, 0xc285, 0x0078, 0x349d, 0xc284, 0x6202, 0x027f, 0x0c7f,
- 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260,
- 0x6204, 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c,
- 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294,
- 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c, 0x027e,
- 0xa182, 0x007e, 0x0048, 0x34c8, 0xa085, 0x0001, 0x0078, 0x34e0,
- 0xa190, 0x7120, 0x2204, 0xa065, 0x00c0, 0x34df, 0x017e, 0x0d7e,
- 0x1078, 0x12c7, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x34c4, 0x2c00,
- 0x2012, 0x60a7, 0x0000, 0x60ab, 0x0000, 0x1078, 0x32ed, 0xa006,
- 0x027f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x34eb, 0xa085,
- 0x0001, 0x0078, 0x34f8, 0x0d7e, 0xa190, 0x7120, 0x2204, 0xa06d,
- 0x0040, 0x34f6, 0x2013, 0x0000, 0x1078, 0x12fb, 0x0d7f, 0xa006,
- 0x027f, 0x007c, 0x017e, 0xa182, 0x007e, 0x0048, 0x3503, 0xa085,
- 0x0001, 0x0078, 0x350a, 0xa188, 0x7120, 0x2104, 0xa065, 0x0040,
- 0x34ff, 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
+ 0x1078, 0x30b0, 0x0078, 0x2cd6, 0x1078, 0x2b73, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2d20, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2d1c, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2d1c, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2d05, 0x7a38, 0xd2fc, 0x0040, 0x2cfd, 0x709c, 0xa005, 0x00c0,
+ 0x2cfd, 0x1078, 0x3148, 0x709f, 0x0001, 0x7077, 0x0001, 0x707b,
+ 0x000a, 0x1078, 0x2d22, 0x0078, 0x2d20, 0xa005, 0x00c0, 0x2d1c,
+ 0x7a38, 0xd2fc, 0x0040, 0x2d14, 0x709c, 0xa005, 0x00c0, 0x2d14,
+ 0x1078, 0x3148, 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x000e,
+ 0x1078, 0x2da4, 0x0078, 0x2d20, 0x707b, 0x0002, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x000b, 0x2011, 0x700e, 0x22a0, 0x20a9,
+ 0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000,
+ 0x41a4, 0x1078, 0x3119, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
+ 0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3,
+ 0x0084, 0x1078, 0x30b0, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040,
+ 0x2d66, 0x2011, 0x308c, 0x1078, 0x4026, 0xa086, 0x0084, 0x00c0,
+ 0x2d62, 0x2079, 0x7080, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2d62,
+ 0x7834, 0xa005, 0x00c0, 0x2d62, 0x707b, 0x000c, 0x1078, 0x2d68,
+ 0x0078, 0x2d66, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c,
+ 0x707b, 0x000d, 0x1078, 0x3119, 0x20a3, 0x1107, 0x20a3, 0x0000,
+ 0x2099, 0x708e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x0084, 0x1078, 0x30b0, 0x007c, 0x0f7e, 0x7070,
+ 0xa005, 0x0040, 0x2da2, 0x2011, 0x308c, 0x1078, 0x4026, 0xa086,
+ 0x0084, 0x00c0, 0x2d9e, 0x2079, 0x7080, 0x7a30, 0xa296, 0x1107,
+ 0x00c0, 0x2d9e, 0x7834, 0xa005, 0x00c0, 0x2d9e, 0x1078, 0x310b,
+ 0x707b, 0x000e, 0x1078, 0x2da4, 0x0078, 0x2da2, 0x707b, 0x0002,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000f, 0x7073, 0x0000,
+ 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004,
+ 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078, 0x4019, 0x007c, 0x7070,
+ 0xa005, 0x0040, 0x2dbf, 0x2011, 0x308c, 0x1078, 0x4026, 0x007c,
+ 0x707b, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7080,
+ 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
+ 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x30b0,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2e05, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0014, 0x00c0, 0x2e03, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2e03, 0x7834, 0xa005, 0x00c0,
+ 0x2e03, 0x7a38, 0xd2fc, 0x0040, 0x2dfd, 0x709c, 0xa005, 0x00c0,
+ 0x2dfd, 0x1078, 0x3148, 0x709f, 0x0001, 0x707b, 0x0012, 0x1078,
+ 0x2e07, 0x0078, 0x2e05, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0013, 0x1078, 0x3125, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x708e, 0x7064, 0xa005, 0x00c0, 0x2e21, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2e21, 0x1078, 0x3050, 0x0040, 0x2e21, 0x1078,
+ 0x3148, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2e5b, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2e59, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1104, 0x00c0, 0x2e59, 0x7834, 0xa005, 0x00c0, 0x2e59, 0x7a38,
+ 0xd2fc, 0x0040, 0x2e53, 0x709c, 0xa005, 0x00c0, 0x2e53, 0x1078,
+ 0x3148, 0x709f, 0x0001, 0x707b, 0x0014, 0x1078, 0x2e5d, 0x0078,
+ 0x2e5b, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0015, 0x1078,
+ 0x3125, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x708e,
+ 0x7064, 0xa006, 0x00c0, 0x2e79, 0x7150, 0xa186, 0xffff, 0x0040,
+ 0x2e79, 0xa180, 0x2154, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
+ 0x3050, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x30b0, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2eca, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0xa086, 0x0014, 0x00c0, 0x2ec8, 0x2079, 0x7080, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2ec8, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2eb1, 0x7a38, 0xd2fc, 0x0040, 0x2ead, 0x709c, 0xa005, 0x00c0,
+ 0x2ead, 0x1078, 0x3148, 0x709f, 0x0001, 0x7077, 0x0001, 0x0078,
+ 0x2ec2, 0xa005, 0x00c0, 0x2ec8, 0x7a38, 0xd2fc, 0x0040, 0x2ec0,
+ 0x709c, 0xa005, 0x00c0, 0x2ec0, 0x1078, 0x3148, 0x709f, 0x0001,
+ 0x7077, 0x0000, 0x707b, 0x0016, 0x1078, 0x2ecc, 0x0078, 0x2eca,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x2099, 0x7080, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430,
+ 0x2011, 0x708e, 0x7074, 0xa005, 0x0040, 0x2ee2, 0x707b, 0x0017,
+ 0x0078, 0x2ee4, 0x707b, 0x001b, 0x7064, 0xa005, 0x00c0, 0x2eee,
+ 0x1078, 0x2fba, 0x0040, 0x2efe, 0x0078, 0x2ef8, 0x20a9, 0x0008,
+ 0x2099, 0x708e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x30b0, 0x0078, 0x2f00, 0x1078, 0x2b73,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f21, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0084, 0x00c0, 0x2f1f, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2f1f, 0x7834, 0xa005, 0x00c0,
+ 0x2f1f, 0x707b, 0x0018, 0x1078, 0x2f23, 0x0078, 0x2f21, 0x7073,
+ 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0019, 0x1078, 0x3125, 0x20a3,
+ 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x708e, 0x2039, 0x700e,
+ 0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514, 0x8207, 0xa084,
+ 0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a,
+ 0x6030, 0x2310, 0x8214, 0xa2a0, 0x700e, 0x2414, 0xa38c, 0x0001,
+ 0x0040, 0x2f4e, 0xa294, 0xff00, 0x0078, 0x2f51, 0xa294, 0x00ff,
+ 0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x30b0,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f83, 0x2011, 0x308c,
+ 0x1078, 0x4026, 0xa086, 0x0084, 0x00c0, 0x2f81, 0x2079, 0x7080,
+ 0x7a30, 0xa296, 0x1107, 0x00c0, 0x2f81, 0x7834, 0xa005, 0x00c0,
+ 0x2f81, 0x1078, 0x310b, 0x707b, 0x001a, 0x1078, 0x2f85, 0x0078,
+ 0x2f83, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x001b, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x2099, 0x7080, 0x20a1, 0x020b, 0x7470,
+ 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8,
+ 0x53a6, 0x60c3, 0x0084, 0x1078, 0x30b0, 0x007c, 0x7070, 0xa005,
+ 0x0040, 0x2faa, 0x2011, 0x308c, 0x1078, 0x4026, 0x707b, 0x001c,
+ 0x1078, 0x2fab, 0x007c, 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f,
+ 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078,
+ 0x4019, 0x007c, 0x087e, 0x097e, 0x2029, 0x6c52, 0x252c, 0x20a9,
+ 0x0008, 0x2041, 0x700e, 0x28a0, 0x2099, 0x708e, 0x53a3, 0x20a9,
+ 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x2fd0, 0x2011, 0x0000,
+ 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x2fe2, 0xd5d4,
+ 0x0040, 0x2fdd, 0x8210, 0x0078, 0x2fde, 0x8211, 0x00f0, 0x2fd0,
+ 0x0078, 0x3047, 0x82ff, 0x00c0, 0x2ff4, 0xd5d4, 0x0040, 0x2fee,
+ 0xa1a6, 0x3fff, 0x0040, 0x2fda, 0x0078, 0x2ff2, 0xa1a6, 0x3fff,
+ 0x0040, 0x3047, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001,
+ 0xd5d4, 0x0040, 0x2ffd, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040,
+ 0x3004, 0x8423, 0x0078, 0x3005, 0x8424, 0x00c8, 0x3012, 0xd5d4,
+ 0x0040, 0x300d, 0x8319, 0x0078, 0x300e, 0x8318, 0x00f0, 0x2ffe,
+ 0x0078, 0x3047, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0,
+ 0x3016, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x302a, 0x007e,
+ 0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010,
+ 0x00f0, 0x3026, 0x754e, 0xa5c8, 0x2154, 0x292c, 0xa5ac, 0x00ff,
+ 0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a,
+ 0x7067, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, 0x304d, 0xa006,
+ 0x0078, 0x304d, 0xa006, 0x1078, 0x126a, 0x097f, 0x087f, 0x007c,
+ 0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0048,
+ 0x305d, 0x8420, 0x8001, 0x0078, 0x3055, 0x2118, 0x84ff, 0x0040,
+ 0x3066, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x3061, 0x2021, 0x0001,
+ 0x83ff, 0x0040, 0x306f, 0x8423, 0x8319, 0x00c0, 0x306b, 0xa238,
+ 0x2704, 0xa42c, 0x00c0, 0x3084, 0xa405, 0x203a, 0x714e, 0xa1a0,
+ 0x2154, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
+ 0x7067, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6c00,
+ 0x706b, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100,
+ 0x2071, 0x0140, 0x1078, 0x4e17, 0x7004, 0xa084, 0x4000, 0x0040,
+ 0x309d, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6c00, 0x7003, 0x0001, 0x2071, 0x6c1e, 0x2073, 0x0000,
+ 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f, 0x0e7f, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x2011, 0x6dba, 0x2013, 0x0000, 0x7073,
+ 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
+ 0x1078, 0x4e0e, 0x2009, 0x07d0, 0x2011, 0x308c, 0x1078, 0x40b6,
+ 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2009,
+ 0x00f7, 0x1078, 0x3131, 0x2061, 0x6dc3, 0x601b, 0x0000, 0x601f,
+ 0x0000, 0x2061, 0x6c00, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043,
+ 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x30ee, 0x1078,
+ 0x4019, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c, 0x0e7e, 0x007e,
+ 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078, 0x4e17, 0x2071,
+ 0x0140, 0xa084, 0x4000, 0x0040, 0x3101, 0x7003, 0x1000, 0x7003,
+ 0x0000, 0x2001, 0x0001, 0x1078, 0x1f0f, 0x1078, 0x30c9, 0x127f,
+ 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040, 0x20a1, 0x71c0, 0x2099,
+ 0x708e, 0x3304, 0x8007, 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x3111,
+ 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7000, 0x20a1,
+ 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x2099, 0x7080, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6,
+ 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100, 0x810f, 0x2001, 0x6c2a,
+ 0x2004, 0xa005, 0x00c0, 0x3142, 0x6030, 0xa084, 0x00ff, 0xa105,
+ 0x0078, 0x3144, 0xa185, 0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c,
+ 0x017e, 0x047e, 0x2001, 0x6c52, 0x2004, 0xd0a4, 0x0040, 0x315b,
+ 0xa006, 0x2020, 0x2009, 0x002a, 0x1078, 0x6b0a, 0x2001, 0x6c0c,
+ 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x1078, 0x2103, 0x047f,
+ 0x017f, 0x007c, 0x157e, 0x20a9, 0x007d, 0x2009, 0x6d20, 0xa006,
+ 0x200a, 0x8108, 0x00f0, 0x3168, 0x157f, 0x007c, 0x0d7e, 0x037e,
+ 0x157e, 0x137e, 0x147e, 0x2069, 0x6c51, 0xa006, 0x6002, 0x6007,
+ 0x0707, 0x600a, 0x600e, 0x6012, 0xa198, 0x2154, 0x231c, 0xa39c,
+ 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4,
+ 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042,
+ 0x604e, 0x6052, 0x6056, 0x605a, 0x605e, 0x6062, 0x6066, 0x606a,
+ 0x606e, 0x6072, 0x6076, 0x607a, 0x607e, 0x6082, 0x6086, 0x608a,
+ 0x608e, 0x6092, 0x6096, 0x609a, 0x609e, 0x61a2, 0x604a, 0x6810,
+ 0x603a, 0x680c, 0x6046, 0x6814, 0xa084, 0x00ff, 0x6042, 0x147f,
+ 0x137f, 0x157f, 0x037f, 0x0d7f, 0x007c, 0x127e, 0x2091, 0x8000,
+ 0x6944, 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x325a, 0xa18c,
+ 0xff00, 0x810f, 0xa182, 0x007e, 0x00c8, 0x3260, 0x2001, 0x6c0c,
+ 0x2004, 0xa084, 0x0003, 0x00c0, 0x3243, 0xa188, 0x6d20, 0x2104,
+ 0xa065, 0x0040, 0x3239, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
+ 0x00c0, 0x323f, 0x6078, 0xa00d, 0x0040, 0x31e4, 0xa680, 0x6b9e,
+ 0x2004, 0xa10c, 0x00c0, 0x3233, 0x607c, 0xa00d, 0x0040, 0x3200,
+ 0xa680, 0x6b9e, 0x2004, 0xa10c, 0x0040, 0x3200, 0x694c, 0xd1fc,
+ 0x00c0, 0x31f6, 0x1078, 0x32f3, 0x0078, 0x322e, 0x1078, 0x32c4,
+ 0x694c, 0xd1ec, 0x00c0, 0x322e, 0x1078, 0x3413, 0x0078, 0x322e,
+ 0x694c, 0xa184, 0xa000, 0x0040, 0x321e, 0xd1ec, 0x0040, 0x3217,
+ 0xd1fc, 0x0040, 0x320f, 0x1078, 0x342a, 0x0078, 0x321a, 0xa680,
+ 0x6b9e, 0x200c, 0x607c, 0xa105, 0x607e, 0x0078, 0x321e, 0xd1fc,
+ 0x0040, 0x321e, 0x1078, 0x32c4, 0x0078, 0x322e, 0x6050, 0xa00d,
+ 0x0040, 0x3229, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0078,
+ 0x322e, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x1078, 0x42e3,
+ 0xa006, 0x127f, 0x007c, 0x2001, 0x0005, 0x2009, 0x0000, 0x0078,
+ 0x3264, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x3264, 0xa082,
+ 0x0006, 0x0048, 0x31da, 0x2009, 0x6c0c, 0x210c, 0xd18c, 0x0040,
+ 0x324d, 0x2001, 0x0004, 0x0078, 0x3256, 0xd184, 0x0040, 0x3254,
+ 0x2001, 0x0004, 0x0078, 0x3256, 0x2001, 0x0029, 0x2009, 0x0000,
+ 0x0078, 0x3264, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x3264,
+ 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c, 0x6944,
+ 0xa1b4, 0x00ff, 0xa682, 0x0010, 0x00c8, 0x32a9, 0xa18c, 0xff00,
+ 0x810f, 0xa182, 0x007e, 0x00c8, 0x3299, 0xa188, 0x6d20, 0x2104,
+ 0xa065, 0x0040, 0x3299, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
+ 0x00c0, 0x329f, 0x684c, 0xd0ec, 0x0040, 0x328c, 0x1078, 0x342a,
+ 0x1078, 0x32c4, 0x0078, 0x3294, 0x1078, 0x32c4, 0x684c, 0xd0fc,
+ 0x0040, 0x3294, 0x1078, 0x3413, 0x1078, 0x343e, 0xa006, 0x0078,
+ 0x32ad, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x32ad, 0xa082,
+ 0x0006, 0x0048, 0x3282, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
+ 0x32ad, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x007c, 0x127e,
+ 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x32bd, 0x2d00, 0x200a,
+ 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
+ 0x6803, 0x0000, 0x0078, 0x32bb, 0x127e, 0x2091, 0x8000, 0x604c,
+ 0xa005, 0x0040, 0x32d0, 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c,
+ 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x32ce, 0x127e,
+ 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x32e5, 0x6800, 0xa005,
+ 0x00c0, 0x32e3, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c, 0x604c,
+ 0xa06d, 0x0040, 0x32f2, 0x6800, 0xa005, 0x00c0, 0x32f0, 0x6052,
+ 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040,
+ 0x32fd, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082,
+ 0x0078, 0x32fc, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218,
+ 0x2260, 0x6200, 0xa005, 0x0040, 0x3310, 0xc285, 0x0078, 0x3311,
+ 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e,
+ 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0xff00, 0xa215,
+ 0x6206, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000,
+ 0x6218, 0x2260, 0x6204, 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206,
+ 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x333c,
+ 0xa085, 0x0001, 0x0078, 0x3350, 0xa190, 0x6d20, 0x2204, 0xa065,
+ 0x00c0, 0x334f, 0x017e, 0x0d7e, 0x1078, 0x12a7, 0x2d60, 0x0d7f,
+ 0x017f, 0x0040, 0x3338, 0x2c00, 0x2012, 0x1078, 0x316e, 0xa006,
+ 0x027f, 0x007c, 0x027e, 0xa182, 0x007e, 0x0048, 0x335b, 0xa085,
+ 0x0001, 0x0078, 0x3368, 0x0d7e, 0xa190, 0x6d20, 0x2204, 0xa06d,
+ 0x0040, 0x3366, 0x2013, 0x0000, 0x1078, 0x12db, 0x0d7f, 0xa006,
+ 0x027f, 0x007c, 0x017e, 0xa182, 0x007e, 0x0048, 0x3373, 0xa085,
+ 0x0001, 0x0078, 0x337a, 0xa188, 0x6d20, 0x2104, 0xa065, 0x0040,
+ 0x336f, 0xa006, 0x017f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
0x600b, 0x0000, 0x600f, 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069,
- 0x748e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048,
- 0x3522, 0x603a, 0x6814, 0x6066, 0x2099, 0x7496, 0xac88, 0x000a,
- 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0x749a, 0xac88, 0x0006,
- 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0x74ae, 0x6808, 0x606a,
- 0x690c, 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182, 0x0211,
- 0x00c8, 0x3546, 0x2009, 0x0008, 0x0078, 0x3570, 0xa182, 0x0259,
- 0x00c8, 0x354e, 0x2009, 0x0007, 0x0078, 0x3570, 0xa182, 0x02c1,
- 0x00c8, 0x3556, 0x2009, 0x0006, 0x0078, 0x3570, 0xa182, 0x0349,
- 0x00c8, 0x355e, 0x2009, 0x0005, 0x0078, 0x3570, 0xa182, 0x0421,
- 0x00c8, 0x3566, 0x2009, 0x0004, 0x0078, 0x3570, 0xa182, 0x0581,
- 0x00c8, 0x356e, 0x2009, 0x0003, 0x0078, 0x3570, 0x2009, 0x0002,
- 0x6192, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071,
- 0x748d, 0x2e04, 0x6896, 0x2071, 0x748e, 0x7004, 0x689a, 0x701c,
- 0x689e, 0x0e7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4,
- 0xa06d, 0x0040, 0x35a7, 0x6900, 0x81ff, 0x00c0, 0x35bb, 0x6a04,
- 0xa282, 0x0010, 0x00c8, 0x35c0, 0xad88, 0x0004, 0x20a9, 0x0010,
- 0x2104, 0xa086, 0xffff, 0x0040, 0x35a2, 0x8108, 0x00f0, 0x3598,
- 0x1078, 0x1288, 0x260a, 0x8210, 0x6a06, 0x0078, 0x35bb, 0x1078,
- 0x12c7, 0x0040, 0x35c0, 0x2d00, 0x60a6, 0x6803, 0x0000, 0xad88,
- 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0, 0x35b3,
- 0x6807, 0x0001, 0x6e12, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c,
- 0xa006, 0x0078, 0x35bd, 0x127e, 0x2091, 0x8000, 0x1078, 0x3703,
- 0x00c0, 0x35dd, 0x200b, 0xffff, 0x0d7e, 0x60a4, 0x2068, 0x6804,
- 0xa08a, 0x0002, 0x0048, 0x35d8, 0x8001, 0x6806, 0x0078, 0x35dc,
- 0x1078, 0x12fb, 0x60a7, 0x0000, 0x0d7f, 0x127f, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x376f, 0x0078, 0x35e8, 0x1078, 0x343b,
- 0x1078, 0x367c, 0x00c0, 0x35e6, 0x1078, 0x3638, 0x127f, 0x007c,
- 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a8, 0xa06d, 0x0040, 0x3614,
- 0x6950, 0x81ff, 0x00c0, 0x3628, 0x6a54, 0xa282, 0x0010, 0x00c8,
- 0x3635, 0xad88, 0x0018, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff,
- 0x0040, 0x360f, 0x8108, 0x00f0, 0x3605, 0x1078, 0x1288, 0x260a,
- 0x8210, 0x6a56, 0x0078, 0x3628, 0x1078, 0x12c7, 0x0040, 0x3635,
- 0x2d00, 0x60aa, 0x6853, 0x0000, 0xad88, 0x0018, 0x20a9, 0x0010,
- 0x200b, 0xffff, 0x8108, 0x00f0, 0x3620, 0x6857, 0x0001, 0x6e62,
- 0x0078, 0x362c, 0x1078, 0x347f, 0x1078, 0x3642, 0x00c0, 0x362a,
- 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x3632,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x4581, 0x127f, 0x007c, 0xa01e,
- 0x0078, 0x3644, 0x2019, 0x0001, 0xa00e, 0x127e, 0x2091, 0x8000,
- 0x604c, 0x2068, 0x6000, 0xd0dc, 0x00c0, 0x3662, 0x8dff, 0x0040,
- 0x3677, 0x83ff, 0x0040, 0x365a, 0x6848, 0xa606, 0x0040, 0x3667,
- 0x0078, 0x3662, 0x683c, 0xa406, 0x00c0, 0x3662, 0x6840, 0xa506,
- 0x0040, 0x3667, 0x2d08, 0x6800, 0x2068, 0x0078, 0x364e, 0x6a00,
- 0x604c, 0xad06, 0x00c0, 0x366f, 0x624e, 0x0078, 0x3672, 0xa180,
- 0x0000, 0x2202, 0x82ff, 0x00c0, 0x3677, 0x6152, 0x8dff, 0x127f,
- 0x007c, 0xa01e, 0x0078, 0x367e, 0x2019, 0x0001, 0xa00e, 0x6080,
- 0x2068, 0x8dff, 0x0040, 0x36aa, 0x83ff, 0x0040, 0x368d, 0x6848,
- 0xa606, 0x0040, 0x369a, 0x0078, 0x3695, 0x683c, 0xa406, 0x00c0,
- 0x3695, 0x6840, 0xa506, 0x0040, 0x369a, 0x2d08, 0x6800, 0x2068,
- 0x0078, 0x3681, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x36a2, 0x6282,
- 0x0078, 0x36a5, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x36aa,
- 0x6186, 0x8dff, 0x007c, 0x1078, 0x3703, 0x00c0, 0x36b1, 0x2011,
- 0x0001, 0x1078, 0x3753, 0x00c0, 0x36b7, 0xa295, 0x0002, 0x007c,
- 0x1078, 0x378b, 0x0040, 0x36c0, 0x1078, 0x63e8, 0x0078, 0x36c2,
- 0xa085, 0x0001, 0x007c, 0x1078, 0x378b, 0x0040, 0x36cb, 0x1078,
- 0x6377, 0x0078, 0x36cd, 0xa085, 0x0001, 0x007c, 0x1078, 0x378b,
- 0x0040, 0x36d6, 0x1078, 0x63bd, 0x0078, 0x36d8, 0xa085, 0x0001,
- 0x007c, 0x1078, 0x378b, 0x0040, 0x36e1, 0x1078, 0x6393, 0x0078,
- 0x36e3, 0xa085, 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091,
- 0x8000, 0x6080, 0xa06d, 0x0040, 0x36fb, 0x6800, 0x007e, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840,
- 0x007f, 0x0078, 0x36ea, 0x6083, 0x0000, 0x6087, 0x0000, 0x0d7f,
- 0x007f, 0x127f, 0x007c, 0x60a4, 0xa00d, 0x00c0, 0x370a, 0xa085,
- 0x0001, 0x007c, 0x0e7e, 0x2170, 0x7000, 0xa005, 0x00c0, 0x371d,
- 0x20a9, 0x0010, 0xae88, 0x0004, 0x2104, 0xa606, 0x0040, 0x371d,
- 0x8108, 0x00f0, 0x3714, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0d7e,
- 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x00c0, 0x372d, 0x1078,
- 0x12c7, 0x0040, 0x373f, 0x2d00, 0x60a6, 0x6803, 0x0001, 0x6807,
- 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108,
- 0x00f0, 0x3735, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006,
- 0x0078, 0x373c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d,
- 0x0040, 0x3750, 0x60a7, 0x0000, 0x1078, 0x12fb, 0xa085, 0x0001,
- 0x127f, 0x0d7f, 0x007c, 0x60a8, 0xa00d, 0x00c0, 0x375a, 0xa085,
- 0x0001, 0x007c, 0x0e7e, 0x2170, 0x7050, 0xa005, 0x00c0, 0x376d,
- 0x20a9, 0x0010, 0xae88, 0x0018, 0x2104, 0xa606, 0x0040, 0x376d,
- 0x8108, 0x00f0, 0x3764, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3753, 0x00c0, 0x3789, 0x200b, 0xffff,
- 0x0d7e, 0x60a8, 0x2068, 0x6854, 0xa08a, 0x0002, 0x0048, 0x3784,
- 0x8001, 0x6856, 0x0078, 0x3788, 0x1078, 0x12fb, 0x60ab, 0x0000,
- 0x0d7f, 0x127f, 0x007c, 0x609c, 0xd0a4, 0x007c, 0x0f7e, 0x2079,
- 0x7051, 0x7804, 0xd0a4, 0x0040, 0x37b7, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34fa, 0x00c0, 0x37ab,
- 0x6004, 0xa084, 0xff00, 0x8007, 0xa086, 0x0006, 0x00c0, 0x37ab,
- 0x6000, 0xc0ed, 0x6002, 0x017f, 0x8108, 0x00f0, 0x379b, 0x0c7f,
- 0x157f, 0x2009, 0x07d0, 0x2011, 0x37b9, 0x1078, 0x433a, 0x0f7f,
- 0x007c, 0x2011, 0x37b9, 0x1078, 0x42aa, 0x157e, 0x0c7e, 0x20a9,
- 0x007e, 0x2009, 0x0000, 0x017e, 0x1078, 0x34fa, 0x00c0, 0x37e5,
- 0x6000, 0xd0ec, 0x0040, 0x37e5, 0x047e, 0x62a0, 0xa294, 0x00ff,
- 0x8227, 0xa006, 0x2009, 0x0029, 0x1078, 0x6ecf, 0x6000, 0xc0e5,
- 0xc0ec, 0x6002, 0x2019, 0x0029, 0x1078, 0x469f, 0x1078, 0x45e2,
- 0x2009, 0x0000, 0x1078, 0x6d09, 0x047f, 0x017f, 0x8108, 0x00f0,
- 0x37c3, 0x0c7f, 0x157f, 0x007c, 0x0c7e, 0x6018, 0x2060, 0x6000,
- 0xc0ec, 0x6002, 0x0c7f, 0x007c, 0x2071, 0x70ff, 0x7003, 0x0001,
- 0x7007, 0x0000, 0x7013, 0x0000, 0x7017, 0x0000, 0x701b, 0x0000,
- 0x701f, 0x0000, 0x704b, 0x0001, 0x704f, 0x0000, 0x705b, 0x0020,
- 0x705f, 0x0040, 0x707f, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70ff,
- 0x684c, 0xa005, 0x00c0, 0x381b, 0x7028, 0xc085, 0x702a, 0xa085,
- 0x0001, 0x0078, 0x383e, 0x6a60, 0x7236, 0x6b64, 0x733a, 0x6868,
- 0x703e, 0x7076, 0x686c, 0x7042, 0x707a, 0x684c, 0x702e, 0x6844,
- 0x7032, 0x2009, 0x000d, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c,
- 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319, 0x726e, 0x7372,
- 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0xa006, 0x0e7f, 0x007c,
- 0x0e7e, 0x6838, 0xd0fc, 0x00c0, 0x3891, 0x6804, 0xa00d, 0x0040,
- 0x385f, 0x0d7e, 0x0e7e, 0x2071, 0x7000, 0x027e, 0xa016, 0x702c,
- 0x2168, 0x6904, 0x206a, 0x8210, 0x2d00, 0x81ff, 0x00c0, 0x3850,
- 0x702e, 0x7098, 0xa200, 0x709a, 0x027f, 0x0e7f, 0x0d7f, 0x2071,
- 0x70ff, 0x701c, 0xa005, 0x00c0, 0x38a2, 0x0068, 0x38a0, 0x2071,
- 0x7051, 0x7004, 0xd09c, 0x0040, 0x38a0, 0x6934, 0xa186, 0x0103,
- 0x00c0, 0x38b3, 0x6948, 0x6844, 0xa105, 0x00c0, 0x3893, 0x2009,
- 0x8020, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0, 0x38a0, 0x7122,
- 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080,
- 0x2071, 0x7000, 0x702c, 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000,
- 0x709a, 0x0e7f, 0x007c, 0x6844, 0xa086, 0x0100, 0x00c0, 0x38a0,
- 0x6868, 0xa005, 0x00c0, 0x38a0, 0x2009, 0x8020, 0x0078, 0x3879,
- 0x2071, 0x70ff, 0x2d08, 0x206b, 0x0000, 0x7010, 0x8000, 0x7012,
- 0x7018, 0xa06d, 0x711a, 0x0040, 0x38b0, 0x6902, 0x0078, 0x38b1,
- 0x711e, 0x0078, 0x3891, 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040,
- 0x38c1, 0xa186, 0x001e, 0x0040, 0x38c1, 0xa18e, 0x001f, 0x00c0,
- 0x38a0, 0x684c, 0xd0cc, 0x0040, 0x38a0, 0x6850, 0xa084, 0x00ff,
- 0xa086, 0x0001, 0x00c0, 0x38a0, 0x2009, 0x8021, 0x0078, 0x3879,
- 0x007e, 0x6837, 0x0103, 0x20a9, 0x001c, 0xad80, 0x0011, 0x20a0,
- 0x2001, 0x0000, 0x40a4, 0x007f, 0x684a, 0x6952, 0x007c, 0x2071,
- 0x70ff, 0x7004, 0x0079, 0x38e4, 0x38ec, 0x38fb, 0x398b, 0x398c,
- 0x399c, 0x39a2, 0x38ed, 0x3979, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x0068, 0x38fa, 0x2009, 0x000d, 0x7030, 0x200a, 0x2091, 0x4080,
- 0x7007, 0x0001, 0x127f, 0x701c, 0xa06d, 0x0040, 0x3978, 0x0e7e,
- 0x2071, 0x7051, 0x7004, 0xd09c, 0x0040, 0x395a, 0x6934, 0xa186,
- 0x0103, 0x00c0, 0x3930, 0x6948, 0x6844, 0xa105, 0x00c0, 0x394d,
- 0x2009, 0x8020, 0x127e, 0x2091, 0x8000, 0x0068, 0x392c, 0x2071,
- 0x0000, 0x7018, 0xd084, 0x00c0, 0x392c, 0x7122, 0x683c, 0x7026,
- 0x6840, 0x702a, 0x701b, 0x0001, 0x2091, 0x4080, 0x127f, 0x0e7f,
- 0x1078, 0x39d5, 0x0078, 0x3978, 0x127f, 0x0e7f, 0x0078, 0x3978,
- 0xa18c, 0x00ff, 0xa186, 0x0017, 0x0040, 0x393e, 0xa186, 0x001e,
- 0x0040, 0x393e, 0xa18e, 0x001f, 0x00c0, 0x395a, 0x684c, 0xd0cc,
- 0x0040, 0x395a, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0,
- 0x395a, 0x2009, 0x8021, 0x0078, 0x3912, 0x6844, 0xa086, 0x0100,
- 0x00c0, 0x395a, 0x6868, 0xa005, 0x00c0, 0x395a, 0x2009, 0x8020,
- 0x0078, 0x3912, 0x0e7f, 0x1078, 0x39e9, 0x0040, 0x3978, 0x700f,
- 0x0001, 0x6934, 0xa184, 0x00ff, 0xa086, 0x0003, 0x00c0, 0x396f,
- 0x810f, 0xa18c, 0x00ff, 0x8101, 0x0040, 0x396f, 0x710e, 0x7007,
- 0x0003, 0x1078, 0x3a09, 0x7050, 0xa086, 0x0100, 0x0040, 0x398c,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x398a, 0x1078, 0x39e9, 0x0040,
- 0x398a, 0x7007, 0x0003, 0x1078, 0x3a09, 0x7050, 0xa086, 0x0100,
- 0x0040, 0x398c, 0x007c, 0x007c, 0x7050, 0xa09e, 0x0100, 0x00c0,
- 0x3995, 0x7007, 0x0004, 0x0078, 0x399c, 0xa086, 0x0200, 0x00c0,
- 0x399b, 0x7007, 0x0005, 0x007c, 0x1078, 0x39a3, 0x7006, 0x1078,
- 0x39d5, 0x007c, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048,
- 0x39b0, 0xa00e, 0x7034, 0x706e, 0x7038, 0x7072, 0x0078, 0x39ba,
- 0x706c, 0xa080, 0x0040, 0x706e, 0x00c8, 0x39ba, 0x7070, 0xa081,
- 0x0000, 0x7072, 0x7132, 0x700c, 0x8001, 0x700e, 0x00c0, 0x39ce,
- 0x127e, 0x2091, 0x8000, 0x0068, 0x39d1, 0x2001, 0x000d, 0x2102,
- 0x2091, 0x4080, 0x2001, 0x0001, 0x127f, 0x007c, 0x2001, 0x0007,
- 0x007c, 0x2001, 0x0006, 0x127f, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x39e8, 0x127e, 0x2091, 0x8000, 0x7010, 0x8001, 0x7012, 0x2d04,
- 0x701e, 0xa005, 0x00c0, 0x39e5, 0x701a, 0x127f, 0x1078, 0x12fb,
- 0x007c, 0x2019, 0x000d, 0x2304, 0x230c, 0xa10e, 0x0040, 0x39f8,
- 0x2304, 0x230c, 0xa10e, 0x0040, 0x39f8, 0xa006, 0x0078, 0x3a08,
- 0x732c, 0x8319, 0x7130, 0xa102, 0x00c0, 0x3a02, 0x2300, 0xa005,
- 0x0078, 0x3a08, 0x0048, 0x3a07, 0xa302, 0x0078, 0x3a08, 0x8002,
- 0x007c, 0x2d00, 0x7026, 0xa080, 0x000d, 0x7056, 0x7053, 0x0000,
- 0x127e, 0x2091, 0x8000, 0x2009, 0x71d9, 0x2104, 0xc08d, 0x200a,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x2071, 0x70cd, 0x7003, 0x0000,
- 0x7007, 0x0000, 0x700f, 0x0000, 0x702b, 0x0001, 0x704f, 0x0000,
- 0x7053, 0x0001, 0x705f, 0x0020, 0x7063, 0x0040, 0x7083, 0x0000,
- 0x708b, 0x0000, 0x708f, 0x0001, 0x70bf, 0x0000, 0x007c, 0x0e7e,
- 0x2071, 0x70cd, 0x6848, 0xa005, 0x00c0, 0x3a45, 0x7028, 0xc085,
- 0x702a, 0xa085, 0x0001, 0x0078, 0x3a6a, 0x6a50, 0x7236, 0x6b54,
- 0x733a, 0x6858, 0x703e, 0x707a, 0x685c, 0x7042, 0x707e, 0x6848,
- 0x702e, 0x6840, 0x7032, 0x2009, 0x000c, 0x200a, 0x8007, 0x8006,
- 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210, 0x2100, 0xa319,
- 0x7272, 0x7376, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700f,
- 0x0000, 0xa006, 0x0e7f, 0x007c, 0x2b78, 0x2071, 0x70cd, 0x7004,
- 0x1079, 0x3aca, 0x700c, 0x0079, 0x3a75, 0x3a7a, 0x3a6f, 0x3a6f,
- 0x3a6f, 0x3a6f, 0x007c, 0x700c, 0x0079, 0x3a7e, 0x3a83, 0x3ac8,
- 0x3ac8, 0x3ac9, 0x3ac9, 0x7830, 0x7930, 0xa106, 0x0040, 0x3a8d,
- 0x7830, 0x7930, 0xa106, 0x00c0, 0x3ab3, 0x7030, 0xa10a, 0x0040,
- 0x3ab3, 0x00c8, 0x3a95, 0x712c, 0xa10a, 0xa18a, 0x0002, 0x00c8,
- 0x3ab4, 0x1078, 0x12c7, 0x0040, 0x3ab3, 0x2d00, 0x705a, 0x7063,
- 0x0040, 0x2001, 0x0003, 0x7057, 0x0000, 0x127e, 0x007e, 0x2091,
- 0x8000, 0x2009, 0x71d9, 0x2104, 0xc085, 0x200a, 0x007f, 0x700e,
- 0x127f, 0x1078, 0x134c, 0x007c, 0x1078, 0x12c7, 0x0040, 0x3ab3,
- 0x2d00, 0x705a, 0x1078, 0x12c7, 0x00c0, 0x3ac0, 0x0078, 0x3a9f,
- 0x2d00, 0x7086, 0x7063, 0x0080, 0x2001, 0x0004, 0x0078, 0x3aa3,
- 0x007c, 0x007c, 0x3adb, 0x3adc, 0x3b13, 0x3b14, 0x3ac8, 0x3b4a,
- 0x3b4f, 0x3b86, 0x3b87, 0x3ba2, 0x3ba3, 0x3ba4, 0x3ba5, 0x3ba6,
- 0x3ba7, 0x3c10, 0x3c3a, 0x007c, 0x700c, 0x0079, 0x3adf, 0x3ae4,
- 0x3ae7, 0x3af7, 0x3b12, 0x3b12, 0x1078, 0x3a7b, 0x007c, 0x127e,
- 0x8001, 0x700e, 0x7058, 0x007e, 0x1078, 0x3f1c, 0x0040, 0x3af4,
- 0x2091, 0x8000, 0x1078, 0x3a7b, 0x0d7f, 0x0078, 0x3b00, 0x127e,
- 0x8001, 0x700e, 0x1078, 0x3f1c, 0x7058, 0x2068, 0x7084, 0x705a,
- 0x6803, 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a,
- 0x0020, 0x00c8, 0x3b0f, 0x1079, 0x3b2a, 0x127f, 0x007c, 0x127f,
- 0x1078, 0x3ba8, 0x007c, 0x007c, 0x007c, 0x0e7e, 0x2071, 0x70cd,
- 0x700c, 0x0079, 0x3b1b, 0x3b20, 0x3b20, 0x3b20, 0x3b22, 0x3b26,
- 0x0e7f, 0x007c, 0x700f, 0x0001, 0x0078, 0x3b28, 0x700f, 0x0002,
- 0x0e7f, 0x007c, 0x3ba8, 0x3ba8, 0x3bc4, 0x3ba8, 0x3caf, 0x3ba8,
- 0x3ba8, 0x3ba8, 0x3ba8, 0x3ba8, 0x3bc4, 0x3cee, 0x3d38, 0x3d91,
- 0x3da5, 0x3ba8, 0x3ba8, 0x3be0, 0x3bc4, 0x3ba8, 0x3ba8, 0x3bf6,
- 0x3e30, 0x3e4e, 0x3ba8, 0x3be0, 0x3ba8, 0x3ba8, 0x3ba8, 0x3ba8,
- 0x3bf6, 0x3e4e, 0x7020, 0x2068, 0x1078, 0x12fb, 0x007c, 0x700c,
- 0x0079, 0x3b52, 0x3b57, 0x3b5a, 0x3b6a, 0x3b85, 0x3b85, 0x1078,
- 0x3a7b, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e, 0x1078,
- 0x3f1c, 0x0040, 0x3b67, 0x2091, 0x8000, 0x1078, 0x3a7b, 0x0d7f,
- 0x0078, 0x3b73, 0x127e, 0x8001, 0x700e, 0x1078, 0x3f1c, 0x7058,
- 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000, 0x6834,
- 0xa084, 0x00ff, 0xa08a, 0x001a, 0x00c8, 0x3b82, 0x1079, 0x3b88,
- 0x127f, 0x007c, 0x127f, 0x1078, 0x3ba8, 0x007c, 0x007c, 0x007c,
- 0x3ba8, 0x3bc4, 0x3c99, 0x3ba8, 0x3bc4, 0x3ba8, 0x3bc4, 0x3bc4,
- 0x3ba8, 0x3bc4, 0x3c99, 0x3bc4, 0x3bc4, 0x3bc4, 0x3bc4, 0x3bc4,
- 0x3ba8, 0x3bc4, 0x3c99, 0x3ba8, 0x3ba8, 0x3bc4, 0x3ba8, 0x3ba8,
- 0x3ba8, 0x3bc4, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c,
- 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0d5, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3840, 0x127f, 0x007c, 0x7007, 0x0001,
- 0x6838, 0xa084, 0x00ff, 0xc0e5, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3840, 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0ed, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3840,
- 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0dd,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3840, 0x127f, 0x007c,
- 0x6834, 0x8007, 0xa084, 0x00ff, 0x0040, 0x3bb6, 0x8001, 0x00c0,
- 0x3bed, 0x7007, 0x0001, 0x0078, 0x3c76, 0x7007, 0x0006, 0x7012,
- 0x2d00, 0x7016, 0x701a, 0x704b, 0x3c76, 0x007c, 0x2d00, 0x7016,
- 0x701a, 0x20a9, 0x0004, 0xa080, 0x0024, 0x2098, 0x20a1, 0x70f8,
- 0x53a3, 0x6858, 0x7012, 0xa082, 0x0401, 0x00c8, 0x3bd2, 0x6884,
- 0xa08a, 0x0003, 0x00c8, 0x3bd2, 0xa080, 0x3c67, 0x2004, 0x70c6,
- 0x7010, 0xa015, 0x0040, 0x3c5a, 0x1078, 0x12c7, 0x00c0, 0x3c1b,
- 0x7007, 0x000f, 0x007c, 0x2d00, 0x7022, 0x70c4, 0x2060, 0x6000,
- 0x6836, 0x6004, 0xad00, 0x7096, 0x6008, 0xa20a, 0x00c8, 0x3c2a,
- 0xa00e, 0x2200, 0x7112, 0x620c, 0x8003, 0x800b, 0xa296, 0x0004,
- 0x0040, 0x3c33, 0xa108, 0x719a, 0x810b, 0x719e, 0xae90, 0x0022,
- 0x1078, 0x1332, 0x7090, 0xa08e, 0x0100, 0x0040, 0x3c4e, 0xa086,
- 0x0200, 0x0040, 0x3c46, 0x7007, 0x0010, 0x007c, 0x7020, 0x2068,
- 0x1078, 0x12fb, 0x7014, 0x2068, 0x0078, 0x3bd2, 0x7020, 0x2068,
- 0x7018, 0x6802, 0x6807, 0x0000, 0x2d08, 0x2068, 0x6906, 0x711a,
- 0x0078, 0x3c10, 0x7014, 0x2068, 0x7007, 0x0001, 0x6834, 0xa084,
- 0x00ff, 0xa086, 0x001e, 0x0040, 0x3e6b, 0x0078, 0x3c76, 0x3c6a,
- 0x3c6e, 0x3c72, 0x0002, 0x0011, 0x0007, 0x0004, 0x000a, 0x000f,
- 0x0005, 0x0006, 0x0012, 0x000f, 0x0005, 0x0006, 0x2009, 0x702a,
- 0x210c, 0x81ff, 0x00c0, 0x3c93, 0x6838, 0xa084, 0x00ff, 0x683a,
- 0x6853, 0x0000, 0x1078, 0x3347, 0x00c0, 0x3c87, 0x007c, 0x1078,
- 0x38d0, 0x127e, 0x2091, 0x8000, 0x1078, 0x64f5, 0x1078, 0x3840,
- 0x127f, 0x0078, 0x3c86, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078,
- 0x3c87, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906, 0x711a, 0x7010,
- 0x8001, 0x7012, 0x0040, 0x3ca8, 0x7007, 0x0006, 0x0078, 0x3cae,
- 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a, 0x007c, 0x7007,
- 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848, 0xa084, 0x00ff,
- 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3cd8, 0x2009, 0x0000,
- 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3cd8, 0xa005, 0x00c0,
- 0x3ceb, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078, 0x34fa, 0x00c0,
- 0x3ceb, 0x067e, 0x6e50, 0x1078, 0x35c3, 0x067f, 0x0078, 0x3ceb,
- 0x047e, 0x2011, 0x700c, 0x2224, 0xc484, 0xc48c, 0x2412, 0x047f,
- 0x0c7e, 0x1078, 0x34fa, 0x00c0, 0x3ce7, 0x1078, 0x3742, 0x8108,
- 0x00f0, 0x3ce1, 0x0c7f, 0x1078, 0x12fb, 0x007c, 0x127e, 0x2091,
- 0x8000, 0x7007, 0x0001, 0x2001, 0x7052, 0x2004, 0xd0a4, 0x0040,
- 0x3d2f, 0x2009, 0x0000, 0x1078, 0x3f38, 0x6100, 0xd184, 0x0040,
- 0x3d14, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3d32, 0x6000, 0xd084,
- 0x0040, 0x3d2f, 0x6004, 0xa005, 0x00c0, 0x3d35, 0x6003, 0x0000,
- 0x600b, 0x0000, 0x0078, 0x3d2c, 0x2011, 0x0001, 0x6860, 0xa005,
- 0x00c0, 0x3d1c, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858, 0xa084,
- 0x00ff, 0x0040, 0x3d2f, 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff,
- 0x0040, 0x3d2f, 0x600a, 0x6202, 0x127f, 0x0078, 0x3f0b, 0x127f,
- 0x0078, 0x3f03, 0x127f, 0x0078, 0x3efb, 0x127f, 0x0078, 0x3eff,
- 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x7052, 0x2004,
- 0xd0a4, 0x0040, 0x3d8e, 0x2009, 0x0000, 0x1078, 0x3f38, 0x6000,
- 0xa084, 0x0001, 0x0040, 0x3d8e, 0x6204, 0x6308, 0x6c48, 0xa484,
- 0x0003, 0x0040, 0x3d66, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0,
- 0x3d5f, 0x2100, 0xa210, 0x0048, 0x3d8b, 0x0078, 0x3d66, 0x8001,
- 0x00c0, 0x3d8b, 0x2100, 0xa212, 0x0048, 0x3d8b, 0xa484, 0x000c,
- 0x0040, 0x3d80, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
- 0x00c0, 0x3d78, 0x2100, 0xa318, 0x0048, 0x3d8b, 0x0078, 0x3d80,
- 0xa082, 0x0004, 0x00c0, 0x3d8b, 0x2100, 0xa31a, 0x0048, 0x3d8b,
- 0x6860, 0xa005, 0x0040, 0x3d86, 0x8000, 0x6016, 0x6206, 0x630a,
- 0x127f, 0x0078, 0x3f0b, 0x127f, 0x0078, 0x3f07, 0x127f, 0x0078,
- 0x3f03, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2009, 0x0000,
- 0x1078, 0x3f38, 0x6308, 0x8318, 0x0048, 0x3da2, 0x630a, 0x127f,
- 0x0078, 0x3f19, 0x127f, 0x0078, 0x3f07, 0x127e, 0x0c7e, 0x2091,
- 0x8000, 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x3dbb, 0x2009,
- 0x0000, 0x0c7e, 0x1078, 0x4348, 0x6000, 0x2001, 0xfcff, 0x6002,
- 0x0c7f, 0x0078, 0x3df2, 0x6858, 0xa005, 0x0040, 0x3e07, 0x685c,
- 0xa065, 0x0040, 0x3e03, 0x2001, 0x702a, 0x2004, 0xa005, 0x0040,
- 0x3dcd, 0x1078, 0x6457, 0x0078, 0x3dd3, 0x6013, 0x0400, 0x2009,
- 0x0041, 0x1078, 0x571c, 0x6958, 0xa18c, 0xe600, 0xa186, 0x2000,
- 0x0040, 0x3dea, 0xa186, 0x0400, 0x0040, 0x3dea, 0x2009, 0x0000,
- 0x0c7e, 0x1078, 0x4348, 0x6000, 0xa084, 0xfdff, 0x6002, 0x0c7f,
- 0x0078, 0x3df2, 0x027e, 0x2009, 0x0000, 0x2011, 0xfdff, 0x1078,
- 0x43f1, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3dff, 0x2009, 0x0000,
- 0x1078, 0x4348, 0x6008, 0x8000, 0x0048, 0x3dff, 0x600a, 0x0c7f,
- 0x127f, 0x0078, 0x3f0b, 0x0c7f, 0x127f, 0x0078, 0x3f03, 0x6954,
- 0xa186, 0x002a, 0x00c0, 0x3e13, 0x2001, 0x700c, 0x200c, 0xc194,
- 0x2102, 0x0078, 0x3df2, 0xa186, 0x0020, 0x0040, 0x3e28, 0xa186,
- 0x0029, 0x00c0, 0x3e03, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34fa, 0x00c0, 0x3df2, 0x6000, 0xc0e4, 0x6002, 0x0078, 0x3df2,
- 0x685c, 0xa065, 0x0040, 0x3e03, 0x6017, 0x0014, 0x0078, 0x3df2,
- 0x2009, 0x0000, 0x1078, 0x3f38, 0x6000, 0xa084, 0x0001, 0x0040,
- 0x3e4a, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048, 0x3e44, 0x6206,
- 0x2091, 0x8001, 0x0078, 0x3f19, 0x2091, 0x8001, 0x6853, 0x0016,
- 0x0078, 0x3f12, 0x6853, 0x0007, 0x0078, 0x3f12, 0x6834, 0x8007,
- 0xa084, 0x00ff, 0x00c0, 0x3e58, 0x1078, 0x3bb6, 0x0078, 0x3e6a,
- 0x2030, 0x8001, 0x00c0, 0x3e62, 0x7007, 0x0001, 0x1078, 0x3e6b,
- 0x0078, 0x3e6a, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a,
- 0x704b, 0x3e6b, 0x007c, 0x0e7e, 0x2009, 0x702a, 0x210c, 0x81ff,
- 0x00c0, 0x3eed, 0x2009, 0x700c, 0x210c, 0xd194, 0x00c0, 0x3ef7,
- 0x6848, 0x2070, 0xae82, 0x7600, 0x0048, 0x3edc, 0x2001, 0x7015,
- 0x2004, 0xae02, 0x00c8, 0x3edc, 0x2009, 0x0000, 0x1078, 0x3f38,
- 0x6100, 0xa184, 0x0001, 0x0040, 0x3ec2, 0xa184, 0x0100, 0x00c0,
- 0x3ee0, 0xa184, 0x0200, 0x00c0, 0x3ee4, 0x601c, 0xa005, 0x00c0,
- 0x3ee8, 0x711c, 0xa186, 0x0006, 0x00c0, 0x3ec7, 0x6853, 0x0000,
- 0x6803, 0x0000, 0x2d08, 0x127e, 0x2091, 0x8000, 0x7010, 0xa005,
- 0x00c0, 0x3eb9, 0x7112, 0x7018, 0xa065, 0x0040, 0x3eec, 0x6000,
- 0xd0e4, 0x00c0, 0x3ef1, 0x2e60, 0x1078, 0x4351, 0x127f, 0x0e7f,
- 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x3eb9, 0x6902, 0x127f,
- 0x0e7f, 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x3f12, 0x6944,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x34fa, 0x00c0, 0x3ef2, 0x6000,
- 0xd0e4, 0x00c0, 0x3ef2, 0x711c, 0xa186, 0x0007, 0x00c0, 0x3edc,
- 0x6853, 0x0002, 0x0078, 0x3ef4, 0x6853, 0x0008, 0x0078, 0x3ef4,
- 0x6853, 0x000e, 0x0078, 0x3ef4, 0x6853, 0x0017, 0x0078, 0x3ef4,
- 0x6853, 0x0035, 0x0078, 0x3ef4, 0x127f, 0x6853, 0x0028, 0x0078,
- 0x3ef4, 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x3f12, 0x6853,
- 0x002a, 0x0078, 0x3ef4, 0x2009, 0x003e, 0x0078, 0x3f0d, 0x2009,
- 0x0004, 0x0078, 0x3f0d, 0x2009, 0x0006, 0x0078, 0x3f0d, 0x2009,
- 0x0016, 0x0078, 0x3f0d, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00,
- 0xa105, 0x6856, 0x2091, 0x8000, 0x1078, 0x3840, 0x2091, 0x8001,
- 0x007c, 0x1078, 0x12fb, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102,
- 0x0048, 0x3f29, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078,
- 0x3f35, 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x3f35, 0x7074,
- 0xa081, 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c,
- 0x0d7e, 0x1078, 0x4348, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004,
- 0x2204, 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002,
- 0x3d08, 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x3f54,
- 0xa086, 0x1000, 0x00c0, 0x3f70, 0x20e1, 0x0004, 0x3d60, 0xd1bc,
- 0x00c0, 0x3f5b, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3f70, 0xac82,
- 0x7600, 0x0048, 0x3f70, 0x6854, 0xac02, 0x00c8, 0x3f70, 0x2009,
- 0x0047, 0x1078, 0x571c, 0x7a1c, 0xd284, 0x00c0, 0x3f46, 0x007c,
- 0xa016, 0x1078, 0x1525, 0x0078, 0x3f6b, 0x157e, 0x137e, 0x147e,
- 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0070, 0x00c0, 0x3f9e,
- 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x3f9e, 0x1078, 0x3fab,
- 0x0040, 0x3f9e, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078, 0x3fc9,
- 0x147f, 0x137f, 0x157f, 0x2009, 0x71be, 0x2104, 0xa005, 0x00c0,
- 0x3f9a, 0x007c, 0x1078, 0x49b7, 0x0078, 0x3f99, 0x1078, 0x6f02,
- 0x1078, 0x3fab, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f, 0x137f,
- 0x157f, 0x0078, 0x3f99, 0xa484, 0x01ff, 0x6872, 0xa005, 0x0040,
- 0x3fbd, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1, 0x1000,
- 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c, 0x20a9, 0x000c, 0x20e1,
- 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001, 0x0078,
- 0x3fbc, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007, 0xa196,
- 0x0000, 0x00c0, 0x3fd6, 0x0078, 0x40c2, 0x007c, 0xa196, 0x2000,
- 0x00c0, 0x3fe7, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x3fe3, 0x1078,
- 0x2b7c, 0x0078, 0x3fd5, 0x1078, 0x3fef, 0x0078, 0x3fd5, 0xa196,
- 0x8000, 0x00c0, 0x3fd5, 0x1078, 0x4148, 0x0078, 0x3fd5, 0x0c7e,
- 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0040, 0x3ffc,
- 0xa196, 0x0023, 0x00c0, 0x40ba, 0xa08e, 0x0023, 0x00c0, 0x402d,
- 0x1078, 0x41ba, 0x0040, 0x40ba, 0x7124, 0x610a, 0x7030, 0xa08e,
- 0x0200, 0x00c0, 0x4015, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009,
- 0x0015, 0x1078, 0x571c, 0x0078, 0x40ba, 0xa08e, 0x0210, 0x00c0,
- 0x401f, 0x2009, 0x0015, 0x1078, 0x571c, 0x0078, 0x40ba, 0xa08e,
- 0x0100, 0x00c0, 0x40ba, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009,
- 0x0016, 0x1078, 0x571c, 0x0078, 0x40ba, 0xa08e, 0x0022, 0x00c0,
- 0x40ba, 0x7030, 0xa08e, 0x0300, 0x00c0, 0x403e, 0x7034, 0xa005,
- 0x00c0, 0x40ba, 0x2009, 0x0017, 0x0078, 0x40a2, 0xa08e, 0x0500,
- 0x00c0, 0x404a, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009, 0x0018,
- 0x0078, 0x40a2, 0xa08e, 0x2010, 0x00c0, 0x4052, 0x2009, 0x0019,
- 0x0078, 0x40a2, 0xa08e, 0x2110, 0x00c0, 0x405a, 0x2009, 0x001a,
- 0x0078, 0x40a2, 0xa08e, 0x5200, 0x00c0, 0x4066, 0x7034, 0xa005,
- 0x00c0, 0x40ba, 0x2009, 0x001b, 0x0078, 0x40a2, 0xa08e, 0x5000,
- 0x00c0, 0x4072, 0x7034, 0xa005, 0x00c0, 0x40ba, 0x2009, 0x001c,
- 0x0078, 0x40a2, 0xa08e, 0x1200, 0x00c0, 0x407e, 0x7034, 0xa005,
- 0x00c0, 0x40ba, 0x2009, 0x0024, 0x0078, 0x40a2, 0xa08c, 0xff00,
- 0xa18e, 0x2400, 0x00c0, 0x4088, 0x2009, 0x002d, 0x0078, 0x40a2,
- 0xa08c, 0xff00, 0xa18e, 0x5300, 0x00c0, 0x4092, 0x2009, 0x002a,
- 0x0078, 0x40a2, 0xa08e, 0x0f00, 0x00c0, 0x409a, 0x2009, 0x0020,
- 0x0078, 0x40a2, 0xa08e, 0x5300, 0x00c0, 0x40a0, 0x0078, 0x40a0,
- 0x2009, 0x001d, 0x017e, 0x2011, 0x7483, 0x2204, 0x1078, 0x1fe4,
- 0x1078, 0x34bf, 0x00c0, 0x40bc, 0x0c7e, 0x1078, 0x568f, 0x0040,
- 0x40bf, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f,
- 0x1078, 0x571c, 0x0c7f, 0x007c, 0x017f, 0x0078, 0x40ba, 0x0c7f,
- 0x0078, 0x40bc, 0xa084, 0x0007, 0x0079, 0x40c7, 0x007c, 0x40cf,
- 0x40cf, 0x40cf, 0x40cf, 0x40cf, 0x40d0, 0x40e9, 0x4131, 0x007c,
- 0x7110, 0xd1bc, 0x0040, 0x40e8, 0x7120, 0x2160, 0xac8c, 0x0007,
- 0x00c0, 0x40e8, 0xac8a, 0x7600, 0x0048, 0x40e8, 0x6854, 0xac02,
- 0x00c8, 0x40e8, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078, 0x571c,
- 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x412f, 0x2011, 0x7483,
- 0x2204, 0xa080, 0x2207, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34fa, 0x00c0, 0x412f, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286,
- 0x0006, 0x00c0, 0x4114, 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040,
- 0x412f, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009, 0x0044,
- 0x1078, 0x571c, 0x0078, 0x412f, 0x0c7e, 0x1078, 0x568f, 0x017f,
- 0x0040, 0x412f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286,
- 0x0004, 0x00c0, 0x4127, 0x6007, 0x0005, 0x0078, 0x4129, 0x6007,
- 0x0001, 0x6003, 0x0001, 0x1078, 0x45af, 0x1078, 0x49b7, 0x0c7f,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4147, 0x7020, 0x2060, 0xac84,
- 0x0007, 0x00c0, 0x4147, 0xac82, 0x7600, 0x0048, 0x4147, 0x6854,
- 0xac02, 0x00c8, 0x4147, 0x2009, 0x0045, 0x1078, 0x571c, 0x007c,
- 0x7110, 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0, 0x4158,
- 0xa084, 0x000f, 0xa08a, 0x0006, 0x10c8, 0x1288, 0x1079, 0x4159,
- 0x007c, 0x415f, 0x4160, 0x415f, 0x415f, 0x419c, 0x41ab, 0x007c,
- 0x7110, 0xd1bc, 0x00c0, 0x419b, 0x700c, 0x1078, 0x1fe4, 0x1078,
- 0x34bf, 0x00c0, 0x419b, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286,
- 0x0006, 0x00c0, 0x4184, 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040,
- 0x419b, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088,
- 0x1078, 0x571c, 0x0078, 0x419b, 0x0c7e, 0x1078, 0x568f, 0x017f,
- 0x0040, 0x419b, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286,
- 0x0004, 0x00c0, 0x4197, 0x2009, 0x0005, 0x0078, 0x4199, 0x2009,
- 0x0001, 0x1078, 0x571c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x41aa,
- 0x1078, 0x41ba, 0x0040, 0x41aa, 0x7124, 0x610a, 0x2009, 0x0089,
- 0x1078, 0x571c, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x41b9, 0x1078,
- 0x41ba, 0x0040, 0x41b9, 0x7124, 0x610a, 0x2009, 0x008a, 0x1078,
- 0x571c, 0x007c, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x41cd,
- 0xac82, 0x7600, 0x0048, 0x41cd, 0x2001, 0x7015, 0x2004, 0xac02,
- 0x00c8, 0x41cd, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x41cc,
- 0x2071, 0x71c9, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a,
- 0x7012, 0x7017, 0x7600, 0x7007, 0x0000, 0x7026, 0x702b, 0x50bd,
- 0x7032, 0x7037, 0x50fe, 0x703b, 0x0002, 0x703f, 0x0000, 0x007c,
- 0x2071, 0x71c9, 0x00e0, 0x4297, 0x2091, 0x6000, 0x700c, 0x8001,
- 0x700e, 0x00c0, 0x4260, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e,
- 0x2091, 0x8000, 0x7138, 0x8109, 0x713a, 0x00c0, 0x425e, 0x703b,
- 0x0002, 0x2009, 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8, 0x425e,
- 0x703c, 0xa086, 0x0001, 0x00c0, 0x423b, 0x0d7e, 0x2069, 0x0140,
- 0x6804, 0xa084, 0x4000, 0x0040, 0x4219, 0x6803, 0x1000, 0x0078,
- 0x4220, 0x6804, 0xa084, 0x1000, 0x0040, 0x4220, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x703f, 0x0000, 0x2069, 0x71b6, 0x6804, 0xa082,
- 0x0006, 0x00c0, 0x422d, 0x6807, 0x0000, 0x6830, 0xa082, 0x0003,
- 0x00c0, 0x4234, 0x6833, 0x0000, 0x1078, 0x49b7, 0x1078, 0x4a67,
- 0x0d7f, 0x0078, 0x425e, 0x0d7e, 0x2069, 0x7000, 0x6944, 0x6860,
- 0xa102, 0x00c8, 0x425d, 0x2069, 0x71b6, 0x6804, 0xa086, 0x0000,
- 0x00c0, 0x425d, 0x6830, 0xa086, 0x0000, 0x00c0, 0x425d, 0x703f,
- 0x0001, 0x6807, 0x0006, 0x6833, 0x0003, 0x2069, 0x0100, 0x6830,
- 0x689e, 0x2069, 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078, 0x4263,
- 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x4274, 0x7020,
- 0x8001, 0x7022, 0x00c0, 0x4274, 0x7023, 0x0009, 0x8109, 0x7126,
- 0x00c0, 0x4274, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040, 0x4285,
- 0x702c, 0x8001, 0x702e, 0x00c0, 0x4285, 0x702f, 0x0009, 0x8109,
- 0x7132, 0x00c0, 0x4285, 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040,
- 0x4296, 0x7008, 0x8001, 0x700a, 0x00c0, 0x4296, 0x700b, 0x0009,
- 0x8109, 0x711a, 0x00c0, 0x4296, 0x701c, 0x107a, 0x127f, 0x7004,
- 0x0079, 0x429a, 0x42c1, 0x42c2, 0x42de, 0x0e7e, 0x2071, 0x71c9,
- 0x7018, 0xa005, 0x00c0, 0x42a8, 0x711a, 0x721e, 0x700b, 0x0009,
- 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x71c9, 0x701c, 0xa206,
- 0x00c0, 0x42b4, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e,
- 0x2071, 0x71c9, 0x6088, 0xa102, 0x0048, 0x42bf, 0x618a, 0x0e7f,
- 0x007c, 0x007c, 0x7110, 0x1078, 0x34fa, 0x00c0, 0x42d4, 0x6088,
- 0x8001, 0x0048, 0x42d4, 0x608a, 0x00c0, 0x42d4, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x49b7, 0x127f, 0x8108, 0xa182, 0x007e, 0x0048,
- 0x42dc, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014, 0x2060,
- 0x127e, 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x430d, 0x8001,
- 0x6016, 0x00c0, 0x430d, 0x611c, 0xa186, 0x0003, 0x0040, 0x42f4,
- 0xa186, 0x0006, 0x00c0, 0x430b, 0x6010, 0x2068, 0x6854, 0xa08a,
- 0x199a, 0x0048, 0x430b, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a,
- 0x0048, 0x4304, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108,
- 0x6116, 0x0078, 0x430d, 0x1078, 0x61ca, 0x127f, 0xac88, 0x0008,
- 0x7116, 0x2001, 0x7016, 0x2004, 0xa102, 0x0048, 0x431b, 0x7017,
- 0x7600, 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x71c9, 0x7027,
- 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c, 0x2001,
- 0x71d2, 0x2003, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x71c9, 0x7033,
- 0x07d0, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011, 0x71d5, 0x2013,
- 0x0000, 0x007c, 0x0e7e, 0x2071, 0x71c9, 0x711a, 0x721e, 0x700b,
- 0x0009, 0x0e7f, 0x007c, 0x0c7e, 0x2061, 0x725a, 0x0c7f, 0x007c,
- 0xa184, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x725a, 0x2060,
- 0x007c, 0x6854, 0xa08a, 0x199a, 0x0048, 0x4358, 0x2001, 0x1999,
- 0xa005, 0x00c0, 0x4368, 0x6944, 0x0c7e, 0x1078, 0x4348, 0x6014,
- 0x0c7f, 0xa005, 0x00c0, 0x436d, 0x2001, 0x001e, 0x0078, 0x436d,
- 0xa08e, 0xffff, 0x00c0, 0x436d, 0xa006, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x0040,
- 0x43a8, 0xd0b4, 0x00c0, 0x4384, 0xd0bc, 0x00c0, 0x4396, 0x2009,
- 0x0006, 0x1078, 0x43cb, 0x007c, 0xd0fc, 0x0040, 0x4391, 0xa084,
- 0x0003, 0xa08e, 0x0003, 0x0040, 0x43c4, 0xa08e, 0x0000, 0x00c0,
- 0x43c4, 0x2009, 0x0043, 0x1078, 0x571c, 0x007c, 0xd0fc, 0x0040,
- 0x43a3, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x43c4, 0xa08e,
- 0x0000, 0x00c0, 0x43c4, 0x2009, 0x0042, 0x1078, 0x571c, 0x007c,
- 0xd0fc, 0x0040, 0x43ba, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040,
- 0x43c4, 0xa08e, 0x0002, 0x0040, 0x43be, 0x2009, 0x0041, 0x1078,
- 0x571c, 0x007c, 0x1078, 0x43c9, 0x0078, 0x43b9, 0x2009, 0x0043,
- 0x1078, 0x571c, 0x0078, 0x43b9, 0x2009, 0x0004, 0x1078, 0x43cb,
- 0x007c, 0x2009, 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040, 0x43f0,
- 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0, 0x43ea,
- 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x43ea, 0x0c7e,
- 0x2009, 0x0000, 0x1078, 0x4348, 0x6204, 0x8210, 0x0048, 0x43e9,
- 0x6206, 0x0c7f, 0x1078, 0x3840, 0x6010, 0xa06d, 0x10c0, 0x4351,
- 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, 0x2061, 0x725a, 0x6000,
- 0x81ff, 0x0040, 0x43fe, 0xa205, 0x0078, 0x43ff, 0xa204, 0x6002,
- 0xace0, 0x0008, 0x00f0, 0x43f7, 0x0c7f, 0x157f, 0x007c, 0x6808,
- 0xa005, 0x0040, 0x440f, 0x8001, 0x680a, 0xa085, 0x0001, 0x007c,
- 0x127e, 0x2091, 0x2200, 0x2079, 0x71b6, 0x127f, 0x0d7e, 0x2069,
- 0x71b6, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001,
- 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084,
- 0x0007, 0x0079, 0x442b, 0x4435, 0x445a, 0x44b5, 0x443b, 0x445a,
- 0x4433, 0x4433, 0x4433, 0x1078, 0x1288, 0x1078, 0x4327, 0x1078,
- 0x49b7, 0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x4441, 0x0c7f,
- 0x007c, 0x2011, 0x320e, 0x1078, 0x42aa, 0x7828, 0xa092, 0x0002,
- 0x00c8, 0x4450, 0x8000, 0x782a, 0x1078, 0x323e, 0x0078, 0x443f,
- 0x1078, 0x320e, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000,
- 0x0078, 0x443f, 0x1078, 0x4327, 0x3c00, 0x007e, 0x2011, 0x0209,
- 0x20e1, 0x4000, 0x2214, 0x007f, 0x20e0, 0x82ff, 0x0040, 0x4478,
- 0x62c0, 0x82ff, 0x00c0, 0x4478, 0x782b, 0x0000, 0x7824, 0xa065,
- 0x1040, 0x1288, 0x2009, 0x0013, 0x1078, 0x571c, 0x0c7f, 0x007c,
- 0x3900, 0xa082, 0x72fa, 0x00c8, 0x447f, 0x1078, 0x561f, 0x0c7e,
- 0x7824, 0xa065, 0x1040, 0x1288, 0x7804, 0xa086, 0x0004, 0x0040,
- 0x44fa, 0x7828, 0xa092, 0x2710, 0x00c8, 0x4495, 0x8000, 0x782a,
- 0x0c7f, 0x1078, 0x50a2, 0x0078, 0x4476, 0x6104, 0xa186, 0x0003,
- 0x00c0, 0x44ac, 0x0e7e, 0x2071, 0x7000, 0x70b4, 0x0e7f, 0xd08c,
- 0x0040, 0x44ac, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0x7000,
- 0x1078, 0x3247, 0x0e7f, 0x0c7f, 0x1078, 0x6f55, 0x2009, 0x0014,
- 0x1078, 0x571c, 0x0c7f, 0x0078, 0x4476, 0x2001, 0x71d2, 0x2003,
- 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x44c9, 0x782b, 0x0000, 0x7824,
- 0xa065, 0x1040, 0x1288, 0x2009, 0x0013, 0x1078, 0x5769, 0x0c7f,
- 0x007c, 0x0c7e, 0x0d7e, 0x3900, 0xa082, 0x72fa, 0x00c8, 0x44d2,
- 0x1078, 0x561f, 0x7824, 0xa005, 0x1040, 0x1288, 0x781c, 0xa06d,
- 0x1040, 0x1288, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078,
- 0x56f5, 0x693c, 0x81ff, 0x1040, 0x1288, 0x8109, 0x693e, 0x6854,
- 0xa015, 0x0040, 0x44ee, 0x7a1e, 0x0078, 0x44f0, 0x7918, 0x791e,
- 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x49b7,
- 0x0078, 0x44c7, 0x6104, 0xa186, 0x0002, 0x0040, 0x4505, 0xa186,
- 0x0004, 0x0040, 0x4505, 0x0078, 0x4489, 0x7808, 0xac06, 0x0040,
- 0x4489, 0x1078, 0x48be, 0x1078, 0x45af, 0x0c7f, 0x1078, 0x49b7,
- 0x0078, 0x4476, 0x0c7e, 0x6027, 0x0002, 0x2011, 0x71d5, 0x2013,
- 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x452c, 0x62c4, 0x82ff, 0x00c0,
- 0x452c, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x452a, 0x2009, 0x0049,
- 0x1078, 0x571c, 0x0c7f, 0x007c, 0x3908, 0xa192, 0x72fa, 0x00c8,
- 0x4533, 0x1078, 0x561f, 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040,
- 0x452a, 0x7944, 0xa192, 0x7530, 0x00c8, 0x4552, 0x8108, 0x7946,
- 0x1078, 0x432c, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006,
- 0x00c0, 0x454e, 0x6017, 0x0012, 0x0078, 0x452a, 0x6017, 0x0016,
- 0x0078, 0x452a, 0x037e, 0x2019, 0x0001, 0x1078, 0x525b, 0x037f,
- 0x1078, 0x6f55, 0x793c, 0x2160, 0x2009, 0x004a, 0x1078, 0x571c,
- 0x0078, 0x452a, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x600f, 0x0000, 0x2c08, 0x2061, 0x71b6, 0x6020, 0x8000, 0x6022,
- 0x6010, 0xa005, 0x0040, 0x457d, 0xa080, 0x0003, 0x2102, 0x6112,
- 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x6116, 0x6112, 0x0078,
- 0x4578, 0x0d7e, 0x2069, 0x71b6, 0x6000, 0xd0d4, 0x0040, 0x4596,
- 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x00c0, 0x4591, 0x2c00,
- 0x681e, 0x6804, 0xa084, 0x0007, 0x0079, 0x49bf, 0xc0d5, 0x6002,
- 0x6818, 0xa005, 0x0040, 0x45a8, 0x6056, 0x605b, 0x0000, 0x007e,
- 0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, 0x71b6, 0x0078, 0x4588,
- 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x4588, 0x007e,
- 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
- 0x2061, 0x71b6, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040,
- 0x45ca, 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f,
- 0x007f, 0x007c, 0x610e, 0x610a, 0x0078, 0x45c5, 0x0c7e, 0x600f,
- 0x0000, 0x2c08, 0x2061, 0x71b6, 0x6034, 0xa005, 0x0040, 0x45de,
- 0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136,
- 0x0078, 0x45dc, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e,
- 0x007e, 0x127e, 0x2071, 0x71b6, 0x7638, 0x2660, 0x2678, 0x2091,
- 0x8000, 0x8cff, 0x0040, 0x4644, 0x6018, 0xa080, 0x0028, 0x2004,
- 0xa206, 0x00c0, 0x463f, 0x703c, 0xac06, 0x00c0, 0x4604, 0x6003,
- 0x000a, 0x630a, 0x0078, 0x463f, 0x7038, 0xac36, 0x00c0, 0x460a,
- 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x4618, 0x2c00, 0xaf36,
- 0x0040, 0x4616, 0x2f00, 0x7036, 0x0078, 0x4618, 0x7037, 0x0000,
- 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x4621, 0x7e0e, 0x0078,
- 0x4622, 0x2678, 0x600f, 0x0000, 0x1078, 0x6336, 0x0040, 0x463a,
- 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x464d, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840,
- 0x1078, 0x644a, 0x1078, 0x6457, 0x0c7f, 0x0078, 0x45f1, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x45f1, 0x127f, 0x007f, 0x027f, 0x067f,
+ 0x708e, 0x6808, 0x605e, 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048,
+ 0x3392, 0x603a, 0x6814, 0x6066, 0x2099, 0x7096, 0xac88, 0x000a,
+ 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2099, 0x709a, 0xac88, 0x0006,
+ 0x21a0, 0x20a9, 0x0004, 0x53a3, 0x2069, 0x70ae, 0x6904, 0xa18c,
+ 0x00ff, 0x810f, 0x6808, 0xa084, 0x00ff, 0xa105, 0x606a, 0x690c,
+ 0x616e, 0x6810, 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8,
+ 0x33bd, 0x2009, 0x0008, 0x0078, 0x33e7, 0xa182, 0x0259, 0x00c8,
+ 0x33c5, 0x2009, 0x0007, 0x0078, 0x33e7, 0xa182, 0x02c1, 0x00c8,
+ 0x33cd, 0x2009, 0x0006, 0x0078, 0x33e7, 0xa182, 0x0349, 0x00c8,
+ 0x33d5, 0x2009, 0x0005, 0x0078, 0x33e7, 0xa182, 0x0421, 0x00c8,
+ 0x33dd, 0x2009, 0x0004, 0x0078, 0x33e7, 0xa182, 0x0581, 0x00c8,
+ 0x33e5, 0x2009, 0x0003, 0x0078, 0x33e7, 0x2009, 0x0002, 0x6192,
+ 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x708d,
+ 0x2e04, 0x6896, 0x2071, 0x708e, 0x7004, 0x689a, 0x701c, 0x689e,
+ 0x0e7f, 0x007c, 0x2001, 0x6b9e, 0xa600, 0x2004, 0x127e, 0x2091,
+ 0x8000, 0x6178, 0xa10d, 0x617a, 0x127f, 0x007c, 0x2001, 0x6b9e,
+ 0xa600, 0x2004, 0x8002, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10c,
+ 0x617a, 0x127f, 0x007c, 0x2001, 0x6b9e, 0xa600, 0x2004, 0x8002,
+ 0x127e, 0x2091, 0x8000, 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078,
+ 0x3423, 0x1078, 0x32af, 0x1078, 0x3484, 0x00c0, 0x3421, 0x1078,
+ 0x343e, 0x007c, 0x2001, 0x6b9e, 0xa600, 0x2004, 0x127e, 0x2091,
+ 0x8000, 0x617c, 0xa10d, 0x617e, 0x127f, 0x0078, 0x3439, 0x1078,
+ 0x32f3, 0x1078, 0x3448, 0x00c0, 0x3437, 0x007c, 0x127e, 0x2091,
+ 0x8000, 0x1078, 0x42e3, 0x127f, 0x007c, 0xa01e, 0x0078, 0x344a,
+ 0x2019, 0x0001, 0xa00e, 0x127e, 0x2091, 0x8000, 0x604c, 0x2068,
+ 0x6000, 0xd0dc, 0x00c0, 0x346a, 0x8dff, 0x0040, 0x347f, 0x83ff,
+ 0x0040, 0x3462, 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x346f,
+ 0x0078, 0x346a, 0x683c, 0xa406, 0x00c0, 0x346a, 0x6840, 0xa506,
+ 0x0040, 0x346f, 0x2d08, 0x6800, 0x2068, 0x0078, 0x3454, 0x6a00,
+ 0x604c, 0xad06, 0x00c0, 0x3477, 0x624e, 0x0078, 0x347a, 0xa180,
+ 0x0000, 0x2202, 0x82ff, 0x00c0, 0x347f, 0x6152, 0x8dff, 0x127f,
+ 0x007c, 0xa01e, 0x0078, 0x3486, 0x2019, 0x0001, 0xa00e, 0x6080,
+ 0x2068, 0x8dff, 0x0040, 0x34b4, 0x83ff, 0x0040, 0x3497, 0x6844,
+ 0xa084, 0x00ff, 0xa606, 0x0040, 0x34a4, 0x0078, 0x349f, 0x683c,
+ 0xa406, 0x00c0, 0x349f, 0x6840, 0xa506, 0x0040, 0x34a4, 0x2d08,
+ 0x6800, 0x2068, 0x0078, 0x3489, 0x6a00, 0x6080, 0xad06, 0x00c0,
+ 0x34ac, 0x6282, 0x0078, 0x34af, 0xa180, 0x0000, 0x2202, 0x82ff,
+ 0x00c0, 0x34b4, 0x6186, 0x8dff, 0x007c, 0x2001, 0x6b9e, 0xa600,
+ 0x2004, 0x6178, 0xa10c, 0x0040, 0x34bf, 0x2011, 0x0001, 0x617c,
+ 0xa10c, 0x0040, 0x34c5, 0xa295, 0x0002, 0x007c, 0x1078, 0x350f,
+ 0x0040, 0x34ce, 0x1078, 0x6079, 0x0078, 0x34d0, 0xa085, 0x0001,
+ 0x007c, 0x1078, 0x350f, 0x0040, 0x34d9, 0x1078, 0x6008, 0x0078,
+ 0x34db, 0xa085, 0x0001, 0x007c, 0x1078, 0x350f, 0x0040, 0x34e4,
+ 0x1078, 0x604e, 0x0078, 0x34e6, 0xa085, 0x0001, 0x007c, 0x1078,
+ 0x350f, 0x0040, 0x34ef, 0x1078, 0x6024, 0x0078, 0x34f1, 0xa085,
+ 0x0001, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080,
+ 0xa06d, 0x0040, 0x3507, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x35c4, 0x007f, 0x0078, 0x34f8, 0x6083,
+ 0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c,
+ 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x6c51, 0x7804, 0xd0a4, 0x0040,
+ 0x353b, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x336a, 0x00c0, 0x352f, 0x6004, 0xa084, 0xff00, 0x8007,
+ 0xa086, 0x0006, 0x00c0, 0x352f, 0x6000, 0xc0ed, 0x6002, 0x017f,
+ 0x8108, 0x00f0, 0x351f, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
+ 0x353d, 0x1078, 0x40b6, 0x0f7f, 0x007c, 0x2011, 0x353d, 0x1078,
+ 0x4026, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x336a, 0x00c0, 0x3569, 0x6000, 0xd0ec, 0x0040, 0x3569,
+ 0x047e, 0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029,
+ 0x1078, 0x6b0a, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2009, 0x0000, 0x1078, 0x6946,
+ 0x047f, 0x017f, 0x8108, 0x00f0, 0x3547, 0x0c7f, 0x157f, 0x007c,
+ 0x0c7e, 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c,
+ 0x2071, 0x6cff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
+ 0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x704b, 0x0001,
+ 0x704f, 0x0000, 0x705b, 0x0020, 0x705f, 0x0040, 0x707f, 0x0000,
+ 0x007c, 0x0e7e, 0x2071, 0x6cff, 0x684c, 0xa005, 0x00c0, 0x359f,
+ 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x35c2, 0x6a60,
+ 0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, 0x7076, 0x686c, 0x7042,
+ 0x707a, 0x684c, 0x702e, 0x6844, 0x7032, 0x2009, 0x000d, 0x200a,
+ 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210,
+ 0x2100, 0xa319, 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007,
+ 0x0001, 0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0,
+ 0x3615, 0x6804, 0xa00d, 0x0040, 0x35e3, 0x0d7e, 0x0e7e, 0x2071,
+ 0x6c00, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
+ 0x2d00, 0x81ff, 0x00c0, 0x35d4, 0x702e, 0x7098, 0xa200, 0x709a,
+ 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x6cff, 0x701c, 0xa005, 0x00c0,
+ 0x3626, 0x0068, 0x3624, 0x2071, 0x6c51, 0x7004, 0xd09c, 0x0040,
+ 0x3624, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3637, 0x6948, 0x6844,
+ 0xa105, 0x00c0, 0x3617, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
+ 0xd084, 0x00c0, 0x3624, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
+ 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x6c00, 0x702c, 0x206a,
+ 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a, 0x0e7f, 0x007c, 0x6844,
+ 0xa086, 0x0100, 0x00c0, 0x3624, 0x6868, 0xa005, 0x00c0, 0x3624,
+ 0x2009, 0x8020, 0x0078, 0x35fd, 0x2071, 0x6cff, 0x2d08, 0x206b,
+ 0x0000, 0x7010, 0x8000, 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040,
+ 0x3634, 0x6902, 0x0078, 0x3635, 0x711e, 0x0078, 0x3615, 0xa18c,
+ 0x00ff, 0xa186, 0x0017, 0x0040, 0x3645, 0xa186, 0x001e, 0x0040,
+ 0x3645, 0xa18e, 0x001f, 0x00c0, 0x3624, 0x684c, 0xd0cc, 0x0040,
+ 0x3624, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3624,
+ 0x2009, 0x8021, 0x0078, 0x35fd, 0x007e, 0x6837, 0x0103, 0x20a9,
+ 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f,
+ 0x684a, 0x6952, 0x007c, 0x2071, 0x6cff, 0x7004, 0x0079, 0x3668,
+ 0x3670, 0x367f, 0x370f, 0x3710, 0x3720, 0x3726, 0x3671, 0x36fd,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x367e, 0x2009, 0x000d,
+ 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x701c,
+ 0xa06d, 0x0040, 0x36fc, 0x0e7e, 0x2071, 0x6c51, 0x7004, 0xd09c,
+ 0x0040, 0x36de, 0x6934, 0xa186, 0x0103, 0x00c0, 0x36b4, 0x6948,
+ 0x6844, 0xa105, 0x00c0, 0x36d1, 0x2009, 0x8020, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x36b0, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
+ 0x36b0, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
+ 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3759, 0x0078, 0x36fc,
+ 0x127f, 0x0e7f, 0x0078, 0x36fc, 0xa18c, 0x00ff, 0xa186, 0x0017,
+ 0x0040, 0x36c2, 0xa186, 0x001e, 0x0040, 0x36c2, 0xa18e, 0x001f,
+ 0x00c0, 0x36de, 0x684c, 0xd0cc, 0x0040, 0x36de, 0x6850, 0xa084,
+ 0x00ff, 0xa086, 0x0001, 0x00c0, 0x36de, 0x2009, 0x8021, 0x0078,
+ 0x3696, 0x6844, 0xa086, 0x0100, 0x00c0, 0x36de, 0x6868, 0xa005,
+ 0x00c0, 0x36de, 0x2009, 0x8020, 0x0078, 0x3696, 0x0e7f, 0x1078,
+ 0x376d, 0x0040, 0x36fc, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
+ 0xa086, 0x0003, 0x00c0, 0x36f3, 0x810f, 0xa18c, 0x00ff, 0x8101,
+ 0x0040, 0x36f3, 0x710e, 0x7007, 0x0003, 0x1078, 0x378d, 0x7050,
+ 0xa086, 0x0100, 0x0040, 0x3710, 0x007c, 0x701c, 0xa06d, 0x0040,
+ 0x370e, 0x1078, 0x376d, 0x0040, 0x370e, 0x7007, 0x0003, 0x1078,
+ 0x378d, 0x7050, 0xa086, 0x0100, 0x0040, 0x3710, 0x007c, 0x007c,
+ 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3719, 0x7007, 0x0004, 0x0078,
+ 0x3720, 0xa086, 0x0200, 0x00c0, 0x371f, 0x7007, 0x0005, 0x007c,
+ 0x1078, 0x3727, 0x7006, 0x1078, 0x3759, 0x007c, 0x007c, 0x702c,
+ 0x7130, 0x8108, 0xa102, 0x0048, 0x3734, 0xa00e, 0x7034, 0x706e,
+ 0x7038, 0x7072, 0x0078, 0x373e, 0x706c, 0xa080, 0x0040, 0x706e,
+ 0x00c8, 0x373e, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
+ 0x8001, 0x700e, 0x00c0, 0x3752, 0x127e, 0x2091, 0x8000, 0x0068,
+ 0x3755, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
+ 0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x127f,
+ 0x007c, 0x701c, 0xa06d, 0x0040, 0x376c, 0x127e, 0x2091, 0x8000,
+ 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3769,
+ 0x701a, 0x127f, 0x1078, 0x12db, 0x007c, 0x2019, 0x000d, 0x2304,
+ 0x230c, 0xa10e, 0x0040, 0x377c, 0x2304, 0x230c, 0xa10e, 0x0040,
+ 0x377c, 0xa006, 0x0078, 0x378c, 0x732c, 0x8319, 0x7130, 0xa102,
+ 0x00c0, 0x3786, 0x2300, 0xa005, 0x0078, 0x378c, 0x0048, 0x378b,
+ 0xa302, 0x0078, 0x378c, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
+ 0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091, 0x8000, 0x2009,
+ 0x6dd3, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x132c, 0x007c,
+ 0x2071, 0x6ccd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
+ 0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001, 0x705f, 0x0020,
+ 0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000, 0x708f, 0x0001,
+ 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6ccd, 0x6848, 0xa005,
+ 0x00c0, 0x37c9, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
+ 0x37ee, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
+ 0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009,
+ 0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084,
+ 0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084,
+ 0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c,
+ 0x2b78, 0x2071, 0x6ccd, 0x7004, 0x1079, 0x384e, 0x700c, 0x0079,
+ 0x37f9, 0x37fe, 0x37f3, 0x37f3, 0x37f3, 0x37f3, 0x007c, 0x700c,
+ 0x0079, 0x3802, 0x3807, 0x384c, 0x384c, 0x384d, 0x384d, 0x7830,
+ 0x7930, 0xa106, 0x0040, 0x3811, 0x7830, 0x7930, 0xa106, 0x00c0,
+ 0x3837, 0x7030, 0xa10a, 0x0040, 0x3837, 0x00c8, 0x3819, 0x712c,
+ 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3838, 0x1078, 0x12a7, 0x0040,
+ 0x3837, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
+ 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x6dd3, 0x2104,
+ 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x132c, 0x007c,
+ 0x1078, 0x12a7, 0x0040, 0x3837, 0x2d00, 0x705a, 0x1078, 0x12a7,
+ 0x00c0, 0x3844, 0x0078, 0x3823, 0x2d00, 0x7086, 0x7063, 0x0080,
+ 0x2001, 0x0004, 0x0078, 0x3827, 0x007c, 0x007c, 0x385f, 0x3860,
+ 0x3897, 0x3898, 0x384c, 0x38ce, 0x38d3, 0x390a, 0x390b, 0x3926,
+ 0x3927, 0x3928, 0x3929, 0x392a, 0x392b, 0x3994, 0x39be, 0x007c,
+ 0x700c, 0x0079, 0x3863, 0x3868, 0x386b, 0x387b, 0x3896, 0x3896,
+ 0x1078, 0x37ff, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
+ 0x1078, 0x3c9b, 0x0040, 0x3878, 0x2091, 0x8000, 0x1078, 0x37ff,
+ 0x0d7f, 0x0078, 0x3884, 0x127e, 0x8001, 0x700e, 0x1078, 0x3c9b,
+ 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
+ 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x3893, 0x1079,
+ 0x38ae, 0x127f, 0x007c, 0x127f, 0x1078, 0x392c, 0x007c, 0x007c,
+ 0x007c, 0x0e7e, 0x2071, 0x6ccd, 0x700c, 0x0079, 0x389f, 0x38a4,
+ 0x38a4, 0x38a4, 0x38a6, 0x38aa, 0x0e7f, 0x007c, 0x700f, 0x0001,
+ 0x0078, 0x38ac, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x392c, 0x392c,
+ 0x3948, 0x392c, 0x3a31, 0x392c, 0x392c, 0x392c, 0x392c, 0x392c,
+ 0x3948, 0x3a76, 0x3abf, 0x3b17, 0x3b2a, 0x392c, 0x392c, 0x3964,
+ 0x3948, 0x392c, 0x392c, 0x397a, 0x3bb1, 0x3bce, 0x392c, 0x3964,
+ 0x392c, 0x392c, 0x392c, 0x392c, 0x397a, 0x3bce, 0x7020, 0x2068,
+ 0x1078, 0x12db, 0x007c, 0x700c, 0x0079, 0x38d6, 0x38db, 0x38de,
+ 0x38ee, 0x3909, 0x3909, 0x1078, 0x37ff, 0x007c, 0x127e, 0x8001,
+ 0x700e, 0x7058, 0x007e, 0x1078, 0x3c9b, 0x0040, 0x38eb, 0x2091,
+ 0x8000, 0x1078, 0x37ff, 0x0d7f, 0x0078, 0x38f7, 0x127e, 0x8001,
+ 0x700e, 0x1078, 0x3c9b, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
+ 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a,
+ 0x00c8, 0x3906, 0x1079, 0x390c, 0x127f, 0x007c, 0x127f, 0x1078,
+ 0x392c, 0x007c, 0x007c, 0x007c, 0x392c, 0x3948, 0x3a1b, 0x392c,
+ 0x3948, 0x392c, 0x3948, 0x3948, 0x392c, 0x3948, 0x3a1b, 0x3948,
+ 0x3948, 0x3948, 0x3948, 0x3948, 0x392c, 0x3948, 0x3a1b, 0x392c,
+ 0x392c, 0x3948, 0x392c, 0x392c, 0x392c, 0x3948, 0x007c, 0x007c,
+ 0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
+ 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x35c4,
+ 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5,
+ 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x35c4, 0x127f, 0x007c,
+ 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x35c4, 0x127f, 0x007c, 0x7007, 0x0001,
+ 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x35c4, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
+ 0x0040, 0x393a, 0x8001, 0x00c0, 0x3971, 0x7007, 0x0001, 0x0078,
+ 0x39fa, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
+ 0x39fa, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
+ 0x0024, 0x2098, 0x20a1, 0x6cf8, 0x53a3, 0x6858, 0x7012, 0xa082,
+ 0x0401, 0x00c8, 0x3956, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3956,
+ 0xa080, 0x39eb, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x39de,
+ 0x1078, 0x12a7, 0x00c0, 0x399f, 0x7007, 0x000f, 0x007c, 0x2d00,
+ 0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, 0x7096,
+ 0x6008, 0xa20a, 0x00c8, 0x39ae, 0xa00e, 0x2200, 0x7112, 0x620c,
+ 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x39b7, 0xa108, 0x719a,
+ 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x1312, 0x7090, 0xa08e,
+ 0x0100, 0x0040, 0x39d2, 0xa086, 0x0200, 0x0040, 0x39ca, 0x7007,
+ 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x12db, 0x7014, 0x2068,
+ 0x0078, 0x3956, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
+ 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3994, 0x7014, 0x2068,
+ 0x7007, 0x0001, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0040,
+ 0x3beb, 0x0078, 0x39fa, 0x39ee, 0x39f2, 0x39f6, 0x0002, 0x0011,
+ 0x0007, 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f,
+ 0x0005, 0x0006, 0x2009, 0x6c2a, 0x210c, 0x81ff, 0x00c0, 0x3a15,
+ 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x31b5,
+ 0x00c0, 0x3a0b, 0x007c, 0x1078, 0x3654, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x35c4, 0x127f, 0x0078, 0x3a0a, 0x2001, 0x0028, 0x2009,
+ 0x0000, 0x0078, 0x3a0b, 0x7018, 0x6802, 0x2d08, 0x2068, 0x6906,
+ 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3a2a, 0x7007, 0x0006,
+ 0x0078, 0x3a30, 0x7014, 0x2068, 0x7007, 0x0001, 0x7048, 0x107a,
+ 0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x6848,
+ 0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001, 0x0040, 0x3a5c,
+ 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002, 0x0040, 0x3a5c,
+ 0xa005, 0x00c0, 0x3a73, 0x6944, 0x810f, 0xa18c, 0x00ff, 0x1078,
+ 0x336a, 0x00c0, 0x3a73, 0x067e, 0x6e44, 0xa6b4, 0x000f, 0x1078,
+ 0x3406, 0x067f, 0x0078, 0x3a73, 0x047e, 0x2011, 0x6c0c, 0x2224,
+ 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078, 0x336a, 0x00c0,
+ 0x3a6f, 0x2091, 0x8000, 0x607b, 0x0000, 0x2091, 0x8001, 0x8108,
+ 0x00f0, 0x3a65, 0x0c7f, 0x1078, 0x12db, 0x007c, 0x127e, 0x2091,
+ 0x8000, 0x7007, 0x0001, 0x2001, 0x6c52, 0x2004, 0xd0a4, 0x0040,
+ 0x3ab6, 0x6944, 0x1078, 0x3cb7, 0x6100, 0xd184, 0x0040, 0x3a9b,
+ 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3ab9, 0x6000, 0xd084, 0x0040,
+ 0x3ab6, 0x6004, 0xa005, 0x00c0, 0x3abc, 0x6003, 0x0000, 0x600b,
+ 0x0000, 0x0078, 0x3ab3, 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0,
+ 0x3aa3, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff,
+ 0x0040, 0x3ab6, 0x6006, 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040,
+ 0x3ab6, 0x600a, 0x6202, 0x127f, 0x0078, 0x3c8a, 0x127f, 0x0078,
+ 0x3c82, 0x127f, 0x0078, 0x3c7a, 0x127f, 0x0078, 0x3c7e, 0x127e,
+ 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x6c52, 0x2004, 0xd0a4,
+ 0x0040, 0x3b14, 0x6944, 0x1078, 0x3cb7, 0x6000, 0xa084, 0x0001,
+ 0x0040, 0x3b14, 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040,
+ 0x3aec, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x3ae5, 0x2100,
+ 0xa210, 0x0048, 0x3b11, 0x0078, 0x3aec, 0x8001, 0x00c0, 0x3b11,
+ 0x2100, 0xa212, 0x0048, 0x3b11, 0xa484, 0x000c, 0x0040, 0x3b06,
+ 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x3afe,
+ 0x2100, 0xa318, 0x0048, 0x3b11, 0x0078, 0x3b06, 0xa082, 0x0004,
+ 0x00c0, 0x3b11, 0x2100, 0xa31a, 0x0048, 0x3b11, 0x6860, 0xa005,
+ 0x0040, 0x3b0c, 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078,
+ 0x3c8a, 0x127f, 0x0078, 0x3c86, 0x127f, 0x0078, 0x3c82, 0x127e,
+ 0x2091, 0x8000, 0x7007, 0x0001, 0x6944, 0x1078, 0x3cb7, 0x6308,
+ 0x8318, 0x0048, 0x3b27, 0x630a, 0x127f, 0x0078, 0x3c98, 0x127f,
+ 0x0078, 0x3c86, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001,
+ 0x684c, 0xd0ac, 0x0040, 0x3b3e, 0x027e, 0x2009, 0x0000, 0x2011,
+ 0xfcff, 0x1078, 0x416c, 0x027f, 0x0078, 0x3b74, 0x6858, 0xa005,
+ 0x0040, 0x3b88, 0x685c, 0xa065, 0x0040, 0x3b84, 0x2001, 0x6c2a,
+ 0x2004, 0xa005, 0x0040, 0x3b50, 0x1078, 0x60e8, 0x0078, 0x3b56,
+ 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x544c, 0x6958, 0xa18c,
+ 0xe600, 0xa186, 0x2000, 0x0040, 0x3b6c, 0xa186, 0x0400, 0x0040,
+ 0x3b6c, 0x6944, 0x0c7e, 0x1078, 0x40c4, 0x6000, 0xa084, 0xfdff,
+ 0x6002, 0x0c7f, 0x0078, 0x3b74, 0x027e, 0x2009, 0x0000, 0x2011,
+ 0xfdff, 0x1078, 0x416c, 0x027f, 0x684c, 0xd0c4, 0x0040, 0x3b80,
+ 0x6944, 0x1078, 0x40c4, 0x6008, 0x8000, 0x0048, 0x3b80, 0x600a,
+ 0x0c7f, 0x127f, 0x0078, 0x3c8a, 0x0c7f, 0x127f, 0x0078, 0x3c82,
+ 0x6954, 0xa186, 0x002a, 0x00c0, 0x3b94, 0x2001, 0x6c0c, 0x200c,
+ 0xc194, 0x2102, 0x0078, 0x3b74, 0xa186, 0x0020, 0x0040, 0x3ba9,
+ 0xa186, 0x0029, 0x00c0, 0x3b84, 0x6944, 0xa18c, 0xff00, 0x810f,
+ 0x1078, 0x336a, 0x00c0, 0x3b74, 0x6000, 0xc0e4, 0x6002, 0x0078,
+ 0x3b74, 0x685c, 0xa065, 0x0040, 0x3b84, 0x6017, 0x0014, 0x0078,
+ 0x3b74, 0x6944, 0x1078, 0x3cb7, 0x6000, 0xa084, 0x0001, 0x0040,
+ 0x3bca, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048, 0x3bc4, 0x6206,
+ 0x2091, 0x8001, 0x0078, 0x3c98, 0x2091, 0x8001, 0x6853, 0x0016,
+ 0x0078, 0x3c91, 0x6853, 0x0007, 0x0078, 0x3c91, 0x6834, 0x8007,
+ 0xa084, 0x00ff, 0x00c0, 0x3bd8, 0x1078, 0x393a, 0x0078, 0x3bea,
+ 0x2030, 0x8001, 0x00c0, 0x3be2, 0x7007, 0x0001, 0x1078, 0x3beb,
+ 0x0078, 0x3bea, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a,
+ 0x704b, 0x3beb, 0x007c, 0x0e7e, 0x2009, 0x6c2a, 0x210c, 0x81ff,
+ 0x00c0, 0x3c6c, 0x2009, 0x6c0c, 0x210c, 0xd194, 0x00c0, 0x3c76,
+ 0x6848, 0x2070, 0xae82, 0x7200, 0x0048, 0x3c5b, 0x2001, 0x6c15,
+ 0x2004, 0xae02, 0x00c8, 0x3c5b, 0x6944, 0x1078, 0x3cb7, 0x6100,
+ 0xa184, 0x0001, 0x0040, 0x3c41, 0xa184, 0x0100, 0x00c0, 0x3c5f,
+ 0xa184, 0x0200, 0x00c0, 0x3c63, 0x601c, 0xa005, 0x00c0, 0x3c67,
+ 0x711c, 0xa186, 0x0006, 0x00c0, 0x3c46, 0x6853, 0x0000, 0x6803,
+ 0x0000, 0x2d08, 0x127e, 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0,
+ 0x3c38, 0x7112, 0x7018, 0xa065, 0x0040, 0x3c6b, 0x6000, 0xd0e4,
+ 0x00c0, 0x3c70, 0x2e60, 0x1078, 0x40cd, 0x127f, 0x0e7f, 0x007c,
+ 0x2068, 0x6800, 0xa005, 0x00c0, 0x3c38, 0x6902, 0x127f, 0x0e7f,
+ 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x3c91, 0x6944, 0xa18c,
+ 0xff00, 0x810f, 0x1078, 0x336a, 0x00c0, 0x3c71, 0x6000, 0xd0e4,
+ 0x00c0, 0x3c71, 0x711c, 0xa186, 0x0007, 0x00c0, 0x3c5b, 0x6853,
+ 0x0002, 0x0078, 0x3c73, 0x6853, 0x0008, 0x0078, 0x3c73, 0x6853,
+ 0x000e, 0x0078, 0x3c73, 0x6853, 0x0017, 0x0078, 0x3c73, 0x6853,
+ 0x0035, 0x0078, 0x3c73, 0x127f, 0x6853, 0x0028, 0x0078, 0x3c73,
+ 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x3c91, 0x6853, 0x002a,
+ 0x0078, 0x3c73, 0x2009, 0x003e, 0x0078, 0x3c8c, 0x2009, 0x0004,
+ 0x0078, 0x3c8c, 0x2009, 0x0006, 0x0078, 0x3c8c, 0x2009, 0x0016,
+ 0x0078, 0x3c8c, 0x2009, 0x0001, 0x6854, 0xa084, 0xff00, 0xa105,
+ 0x6856, 0x2091, 0x8000, 0x1078, 0x35c4, 0x2091, 0x8001, 0x007c,
+ 0x1078, 0x12db, 0x007c, 0x702c, 0x7130, 0x8108, 0xa102, 0x0048,
+ 0x3ca8, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076, 0x0078, 0x3cb4,
+ 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x3cb4, 0x7074, 0xa081,
+ 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e,
+ 0x1078, 0x40c4, 0x0d7f, 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204,
+ 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08,
+ 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040, 0x3cd3, 0xa086,
+ 0x1000, 0x00c0, 0x3cf4, 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0,
+ 0x3cda, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3cf4, 0xac82, 0x7200,
+ 0x0048, 0x3cf4, 0x6854, 0xac02, 0x00c8, 0x3cf4, 0x2009, 0x0047,
+ 0x1078, 0x544c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x7a28, 0x7a1c,
+ 0xd284, 0x00c0, 0x3cc5, 0x007c, 0xa016, 0x1078, 0x1505, 0x0078,
+ 0x3cea, 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28,
+ 0xa584, 0x0070, 0x00c0, 0x3d22, 0xa484, 0x7000, 0xa086, 0x1000,
+ 0x00c0, 0x3d22, 0x1078, 0x3d2f, 0x0040, 0x3d22, 0x20e1, 0x3000,
+ 0x7828, 0x7828, 0x1078, 0x3d4d, 0x147f, 0x137f, 0x157f, 0x2009,
+ 0x6db8, 0x2104, 0xa005, 0x00c0, 0x3d1e, 0x007c, 0x1078, 0x4713,
+ 0x0078, 0x3d1d, 0x1078, 0x6b3d, 0x1078, 0x3d2f, 0x20e1, 0x3000,
+ 0x7828, 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x3d1d, 0xa484,
+ 0x01ff, 0x6872, 0xa005, 0x0040, 0x3d41, 0xa080, 0x001f, 0xa084,
+ 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
+ 0x007c, 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a,
+ 0x53a5, 0xa085, 0x0001, 0x0078, 0x3d40, 0x7000, 0xa084, 0xff00,
+ 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x3d5a, 0x0078,
+ 0x3e3e, 0x007c, 0xa196, 0x2000, 0x00c0, 0x3d6b, 0x6900, 0xa18e,
+ 0x0001, 0x00c0, 0x3d67, 0x1078, 0x2a02, 0x0078, 0x3d59, 0x1078,
+ 0x3d73, 0x0078, 0x3d59, 0xa196, 0x8000, 0x00c0, 0x3d59, 0x1078,
+ 0x3ec4, 0x0078, 0x3d59, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f,
+ 0xa196, 0x0001, 0x0040, 0x3d80, 0xa196, 0x0023, 0x00c0, 0x3e36,
+ 0xa08e, 0x0023, 0x00c0, 0x3db1, 0x1078, 0x3f36, 0x0040, 0x3e36,
+ 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x3d99, 0x7034,
+ 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0015, 0x1078, 0x544c, 0x0078,
+ 0x3e36, 0xa08e, 0x0210, 0x00c0, 0x3da3, 0x2009, 0x0015, 0x1078,
+ 0x544c, 0x0078, 0x3e36, 0xa08e, 0x0100, 0x00c0, 0x3e36, 0x7034,
+ 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0016, 0x1078, 0x544c, 0x0078,
+ 0x3e36, 0xa08e, 0x0022, 0x00c0, 0x3e36, 0x7030, 0xa08e, 0x0300,
+ 0x00c0, 0x3dc2, 0x7034, 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0017,
+ 0x0078, 0x3e1e, 0xa08e, 0x0500, 0x00c0, 0x3dce, 0x7034, 0xa005,
+ 0x00c0, 0x3e36, 0x2009, 0x0018, 0x0078, 0x3e1e, 0xa08e, 0x2010,
+ 0x00c0, 0x3dd6, 0x2009, 0x0019, 0x0078, 0x3e1e, 0xa08e, 0x2110,
+ 0x00c0, 0x3dde, 0x2009, 0x001a, 0x0078, 0x3e1e, 0xa08e, 0x5200,
+ 0x00c0, 0x3dea, 0x7034, 0xa005, 0x00c0, 0x3e36, 0x2009, 0x001b,
+ 0x0078, 0x3e1e, 0xa08e, 0x5000, 0x00c0, 0x3df6, 0x7034, 0xa005,
+ 0x00c0, 0x3e36, 0x2009, 0x001c, 0x0078, 0x3e1e, 0xa08e, 0x1200,
+ 0x00c0, 0x3e02, 0x7034, 0xa005, 0x00c0, 0x3e36, 0x2009, 0x0024,
+ 0x0078, 0x3e1e, 0xa08e, 0x2400, 0x00c0, 0x3e08, 0x0078, 0x3e1c,
+ 0xa08e, 0x5300, 0x00c0, 0x3e0e, 0x0078, 0x3e1c, 0xa08e, 0x0f00,
+ 0x00c0, 0x3e16, 0x2009, 0x0020, 0x0078, 0x3e1e, 0xa08e, 0x5300,
+ 0x00c0, 0x3e1c, 0x0078, 0x3e1c, 0x2009, 0x001d, 0x017e, 0x2011,
+ 0x7083, 0x2204, 0x1078, 0x1f61, 0x1078, 0x3333, 0x00c0, 0x3e38,
+ 0x0c7e, 0x1078, 0x53bf, 0x0040, 0x3e3b, 0x017f, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0x017f, 0x1078, 0x544c, 0x0c7f, 0x007c,
+ 0x017f, 0x0078, 0x3e36, 0x0c7f, 0x0078, 0x3e38, 0xa084, 0x0007,
+ 0x0079, 0x3e43, 0x007c, 0x3e4b, 0x3e4b, 0x3e4b, 0x3e4b, 0x3e4b,
+ 0x3e4c, 0x3e65, 0x3ead, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x3e64,
+ 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, 0x3e64, 0xac8a, 0x7200,
+ 0x0048, 0x3e64, 0x6854, 0xac02, 0x00c8, 0x3e64, 0x7124, 0x610a,
+ 0x2009, 0x0046, 0x1078, 0x544c, 0x007c, 0x0c7e, 0x7110, 0xd1bc,
+ 0x00c0, 0x3eab, 0x2011, 0x7083, 0x2204, 0xa080, 0x2154, 0x200c,
+ 0xa18c, 0xff00, 0x810f, 0x1078, 0x336a, 0x00c0, 0x3eab, 0x6204,
+ 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x3e90, 0x0c7e,
+ 0x1078, 0x53bf, 0x017f, 0x0040, 0x3eab, 0x611a, 0x601f, 0x0006,
+ 0x7120, 0x610a, 0x2009, 0x0044, 0x1078, 0x544c, 0x0078, 0x3eab,
+ 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x3eab, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x3ea3, 0x6007,
+ 0x0005, 0x0078, 0x3ea5, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
+ 0x4311, 0x1078, 0x4713, 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040,
+ 0x3ec3, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x3ec3, 0xac82,
+ 0x7200, 0x0048, 0x3ec3, 0x6854, 0xac02, 0x00c8, 0x3ec3, 0x2009,
+ 0x0045, 0x1078, 0x544c, 0x007c, 0x7110, 0xa18c, 0xff00, 0x810f,
+ 0xa18e, 0x0000, 0x00c0, 0x3ed4, 0xa084, 0x000f, 0xa08a, 0x0006,
+ 0x10c8, 0x126a, 0x1079, 0x3ed5, 0x007c, 0x3edb, 0x3edc, 0x3edb,
+ 0x3edb, 0x3f18, 0x3f27, 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x3f17,
+ 0x700c, 0x1078, 0x1f61, 0x1078, 0x3333, 0x00c0, 0x3f17, 0x6204,
+ 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x3f00, 0x0c7e,
+ 0x1078, 0x53bf, 0x017f, 0x0040, 0x3f17, 0x611a, 0x601f, 0x0005,
+ 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x544c, 0x0078, 0x3f17,
+ 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x3f17, 0x611a, 0x601f,
+ 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x3f13, 0x2009,
+ 0x0005, 0x0078, 0x3f15, 0x2009, 0x0001, 0x1078, 0x544c, 0x007c,
+ 0x7110, 0xd1bc, 0x0040, 0x3f26, 0x1078, 0x3f36, 0x0040, 0x3f26,
+ 0x7124, 0x610a, 0x2009, 0x0089, 0x1078, 0x544c, 0x007c, 0x7110,
+ 0xd1bc, 0x0040, 0x3f35, 0x1078, 0x3f36, 0x0040, 0x3f35, 0x7124,
+ 0x610a, 0x2009, 0x008a, 0x1078, 0x544c, 0x007c, 0x7020, 0x2060,
+ 0xac84, 0x0007, 0x00c0, 0x3f49, 0xac82, 0x7200, 0x0048, 0x3f49,
+ 0x2001, 0x6c15, 0x2004, 0xac02, 0x00c8, 0x3f49, 0xa085, 0x0001,
+ 0x007c, 0xa006, 0x0078, 0x3f48, 0x2071, 0x6dc3, 0x7003, 0x0003,
+ 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017, 0x7200, 0x7007,
+ 0x0000, 0x7026, 0x702b, 0x4e24, 0x7032, 0x7037, 0x4e70, 0x703b,
+ 0x0002, 0x703f, 0x0000, 0x007c, 0x2071, 0x6dc3, 0x00e0, 0x4013,
+ 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0, 0x3fdc, 0x700f,
+ 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000, 0x7138, 0x8109,
+ 0x713a, 0x00c0, 0x3fda, 0x703b, 0x0002, 0x2009, 0x0100, 0x2104,
+ 0xa082, 0x0003, 0x00c8, 0x3fda, 0x703c, 0xa086, 0x0001, 0x00c0,
+ 0x3fb7, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040,
+ 0x3f95, 0x6803, 0x1000, 0x0078, 0x3f9c, 0x6804, 0xa084, 0x1000,
+ 0x0040, 0x3f9c, 0x6803, 0x0100, 0x6803, 0x0000, 0x703f, 0x0000,
+ 0x2069, 0x6db0, 0x6804, 0xa082, 0x0006, 0x00c0, 0x3fa9, 0x6807,
+ 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x3fb0, 0x6833, 0x0000,
+ 0x1078, 0x4713, 0x1078, 0x47c3, 0x0d7f, 0x0078, 0x3fda, 0x0d7e,
+ 0x2069, 0x6c00, 0x6944, 0x6860, 0xa102, 0x00c8, 0x3fd9, 0x2069,
+ 0x6db0, 0x6804, 0xa086, 0x0000, 0x00c0, 0x3fd9, 0x6830, 0xa086,
+ 0x0000, 0x00c0, 0x3fd9, 0x703f, 0x0001, 0x6807, 0x0006, 0x6833,
+ 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069, 0x0140, 0x6803,
+ 0x0600, 0x0d7f, 0x0078, 0x3fdf, 0x127e, 0x2091, 0x8000, 0x7024,
+ 0xa00d, 0x0040, 0x3ff0, 0x7020, 0x8001, 0x7022, 0x00c0, 0x3ff0,
+ 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, 0x3ff0, 0x7028, 0x107a,
+ 0x7030, 0xa00d, 0x0040, 0x4001, 0x702c, 0x8001, 0x702e, 0x00c0,
+ 0x4001, 0x702f, 0x0009, 0x8109, 0x7132, 0x00c0, 0x4001, 0x7034,
+ 0x107a, 0x7018, 0xa00d, 0x0040, 0x4012, 0x7008, 0x8001, 0x700a,
+ 0x00c0, 0x4012, 0x700b, 0x0009, 0x8109, 0x711a, 0x00c0, 0x4012,
+ 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, 0x4016, 0x403d, 0x403e,
+ 0x405a, 0x0e7e, 0x2071, 0x6dc3, 0x7018, 0xa005, 0x00c0, 0x4024,
+ 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e,
+ 0x2071, 0x6dc3, 0x701c, 0xa206, 0x00c0, 0x4030, 0x701a, 0x701e,
+ 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6dc3, 0x6088, 0xa102,
+ 0x0048, 0x403b, 0x618a, 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078,
+ 0x336a, 0x00c0, 0x4050, 0x6088, 0x8001, 0x0048, 0x4050, 0x608a,
+ 0x00c0, 0x4050, 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f,
+ 0x8108, 0xa182, 0x007e, 0x0048, 0x4058, 0xa00e, 0x7007, 0x0002,
+ 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, 0x2091, 0x8000, 0x6014,
+ 0xa005, 0x0040, 0x4089, 0x8001, 0x6016, 0x00c0, 0x4089, 0x611c,
+ 0xa186, 0x0003, 0x0040, 0x4070, 0xa186, 0x0006, 0x00c0, 0x4087,
+ 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048, 0x4087, 0xa082,
+ 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x4080, 0x2001, 0x1999,
+ 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078, 0x4089, 0x1078,
+ 0x5e70, 0x127f, 0xac88, 0x0008, 0x7116, 0x2001, 0x6c16, 0x2004,
+ 0xa102, 0x0048, 0x4097, 0x7017, 0x7200, 0x7007, 0x0000, 0x007c,
+ 0x0e7e, 0x2071, 0x6dc3, 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b,
+ 0x0002, 0x0e7f, 0x007c, 0x2001, 0x6dcc, 0x2003, 0x0000, 0x007c,
+ 0x0e7e, 0x2071, 0x6dc3, 0x7033, 0x07d0, 0x702f, 0x0009, 0x0e7f,
+ 0x007c, 0x2011, 0x6dcf, 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071,
+ 0x6dc3, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0c7e,
+ 0x2061, 0x6e54, 0x0c7f, 0x007c, 0xa184, 0x000f, 0x8003, 0x8003,
+ 0x8003, 0xa080, 0x6e54, 0x2060, 0x007c, 0x6854, 0xa08a, 0x199a,
+ 0x0048, 0x40d4, 0x2001, 0x1999, 0xa005, 0x00c0, 0x40e4, 0x6944,
+ 0x0c7e, 0x1078, 0x40c4, 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x40e9,
+ 0x2001, 0x001e, 0x0078, 0x40e9, 0xa08e, 0xffff, 0x00c0, 0x40e9,
+ 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c,
+ 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x4124, 0xd0b4, 0x00c0, 0x4100,
+ 0xd0bc, 0x00c0, 0x4112, 0x2009, 0x0006, 0x1078, 0x4147, 0x007c,
+ 0xd0fc, 0x0040, 0x410d, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040,
+ 0x4140, 0xa08e, 0x0000, 0x00c0, 0x4140, 0x2009, 0x0043, 0x1078,
+ 0x544c, 0x007c, 0xd0fc, 0x0040, 0x411f, 0xa084, 0x0003, 0xa08e,
+ 0x0003, 0x0040, 0x4140, 0xa08e, 0x0000, 0x00c0, 0x4140, 0x2009,
+ 0x0042, 0x1078, 0x544c, 0x007c, 0xd0fc, 0x0040, 0x4136, 0xa084,
+ 0x0003, 0xa08e, 0x0003, 0x0040, 0x4140, 0xa08e, 0x0002, 0x0040,
+ 0x413a, 0x2009, 0x0041, 0x1078, 0x544c, 0x007c, 0x1078, 0x4145,
+ 0x0078, 0x4135, 0x2009, 0x0043, 0x1078, 0x544c, 0x0078, 0x4135,
+ 0x2009, 0x0004, 0x1078, 0x4147, 0x007c, 0x2009, 0x0001, 0x6010,
+ 0xa0ec, 0xf000, 0x0040, 0x416b, 0x2068, 0x6952, 0x6800, 0x6012,
+ 0xa186, 0x0001, 0x00c0, 0x4165, 0x694c, 0xa18c, 0x8100, 0xa18e,
+ 0x8100, 0x00c0, 0x4165, 0x0c7e, 0x6944, 0x1078, 0x40c4, 0x6204,
+ 0x8210, 0x0048, 0x4164, 0x6206, 0x0c7f, 0x1078, 0x35c4, 0x6010,
+ 0xa06d, 0x10c0, 0x40cd, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010,
+ 0x2061, 0x6e54, 0x6000, 0x81ff, 0x0040, 0x4179, 0xa205, 0x0078,
+ 0x417a, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0, 0x4172, 0x0c7f,
+ 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x418a, 0x8001, 0x680a,
+ 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x6db0,
+ 0x127f, 0x0d7e, 0x2069, 0x6db0, 0x6803, 0x0005, 0x2069, 0x0004,
+ 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027,
+ 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x41a6, 0x41b0, 0x41d5,
+ 0x4224, 0x41b6, 0x41d5, 0x41ae, 0x41ae, 0x41ae, 0x1078, 0x126a,
+ 0x1078, 0x40a3, 0x1078, 0x4713, 0x0c7f, 0x007c, 0x62c0, 0x82ff,
+ 0x00c0, 0x41bc, 0x0c7f, 0x007c, 0x2011, 0x308c, 0x1078, 0x4026,
+ 0x7828, 0xa092, 0x0002, 0x00c8, 0x41cb, 0x8000, 0x782a, 0x1078,
+ 0x30c0, 0x0078, 0x41ba, 0x1078, 0x308c, 0x7807, 0x0003, 0x7827,
+ 0x0000, 0x782b, 0x0000, 0x0078, 0x41ba, 0x1078, 0x40a3, 0x62c0,
+ 0x82ff, 0x00c0, 0x41e7, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040,
+ 0x126a, 0x2009, 0x0013, 0x1078, 0x544c, 0x0c7f, 0x007c, 0x3900,
+ 0xa082, 0x6ef4, 0x00c8, 0x41ee, 0x1078, 0x5397, 0x0c7e, 0x7824,
+ 0xa065, 0x1040, 0x126a, 0x7804, 0xa086, 0x0004, 0x0040, 0x4262,
+ 0x7828, 0xa092, 0x2710, 0x00c8, 0x4204, 0x8000, 0x782a, 0x0c7f,
+ 0x1078, 0x4e09, 0x0078, 0x41e5, 0x6104, 0xa186, 0x0003, 0x00c0,
+ 0x421b, 0x0e7e, 0x2071, 0x6c00, 0x70b4, 0x0e7f, 0xd08c, 0x0040,
+ 0x421b, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0x6c00, 0x1078,
+ 0x30c9, 0x0e7f, 0x0c7f, 0x1078, 0x6b90, 0x2009, 0x0014, 0x1078,
+ 0x544c, 0x0c7f, 0x0078, 0x41e5, 0x2001, 0x6dcc, 0x2003, 0x0000,
+ 0x62c0, 0x82ff, 0x00c0, 0x4238, 0x782b, 0x0000, 0x7824, 0xa065,
+ 0x1040, 0x126a, 0x2009, 0x0013, 0x1078, 0x5499, 0x0c7f, 0x007c,
+ 0x0c7e, 0x0d7e, 0x7824, 0xa005, 0x1040, 0x126a, 0x781c, 0xa06d,
+ 0x1040, 0x126a, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078,
+ 0x5425, 0x693c, 0x81ff, 0x1040, 0x126a, 0x8109, 0x693e, 0x6854,
+ 0xa015, 0x0040, 0x4256, 0x7a1e, 0x0078, 0x4258, 0x7918, 0x791e,
+ 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x4713,
+ 0x0078, 0x4236, 0x6104, 0xa186, 0x0002, 0x0040, 0x426d, 0xa186,
+ 0x0004, 0x0040, 0x426d, 0x0078, 0x41f8, 0x7808, 0xac06, 0x0040,
+ 0x41f8, 0x1078, 0x461a, 0x1078, 0x4311, 0x0c7f, 0x1078, 0x4713,
+ 0x0078, 0x41e5, 0x0c7e, 0x6027, 0x0002, 0x2011, 0x6dcf, 0x2013,
+ 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x4294, 0x62c4, 0x82ff, 0x00c0,
+ 0x4294, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x4292, 0x2009, 0x0049,
+ 0x1078, 0x544c, 0x0c7f, 0x007c, 0x3908, 0xa192, 0x6ef4, 0x00c8,
+ 0x429b, 0x1078, 0x5397, 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040,
+ 0x4292, 0x7944, 0xa192, 0x2710, 0x00c8, 0x42ba, 0x8108, 0x7946,
+ 0x1078, 0x40a8, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006,
+ 0x00c0, 0x42b6, 0x6017, 0x0012, 0x0078, 0x4292, 0x6017, 0x0016,
+ 0x0078, 0x4292, 0x1078, 0x6b90, 0x793c, 0x2160, 0x2009, 0x004a,
+ 0x1078, 0x544c, 0x0078, 0x4292, 0x007e, 0x017e, 0x0c7e, 0x127e,
+ 0x600f, 0x0000, 0x2c08, 0x2061, 0x6db0, 0x2091, 0x8000, 0x6020,
+ 0x8000, 0x6022, 0x6010, 0xa005, 0x0040, 0x42df, 0xa080, 0x0003,
+ 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x6116,
+ 0x6112, 0x0078, 0x42da, 0x0d7e, 0x2069, 0x6db0, 0x6000, 0xd0d4,
+ 0x0040, 0x42f8, 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x00c0,
+ 0x42f3, 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007, 0x0079, 0x471b,
+ 0xc0d5, 0x6002, 0x6818, 0xa005, 0x0040, 0x430a, 0x6056, 0x605b,
+ 0x0000, 0x007e, 0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, 0x6db0,
+ 0x0078, 0x42ea, 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078,
+ 0x42ea, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f,
+ 0x0000, 0x2c08, 0x2061, 0x6db0, 0x6020, 0x8000, 0x6022, 0x6008,
+ 0xa005, 0x0040, 0x432c, 0xa080, 0x0003, 0x2102, 0x610a, 0x127f,
+ 0x0c7f, 0x017f, 0x007f, 0x007c, 0x610e, 0x610a, 0x0078, 0x4327,
+ 0x0c7e, 0x600f, 0x0000, 0x2c08, 0x2061, 0x6db0, 0x6034, 0xa005,
+ 0x0040, 0x4340, 0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c,
+ 0x613a, 0x6136, 0x0078, 0x433e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x067e, 0x027e, 0x007e, 0x127e, 0x2071, 0x6db0, 0x7638, 0x2660,
+ 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x43a4, 0x6018, 0xa080,
+ 0x0028, 0x2004, 0xa206, 0x00c0, 0x439f, 0x703c, 0xac06, 0x00c0,
+ 0x4366, 0x6003, 0x000a, 0x630a, 0x0078, 0x439f, 0x7038, 0xac36,
+ 0x00c0, 0x436c, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x437a,
+ 0x2c00, 0xaf36, 0x0040, 0x4378, 0x2f00, 0x7036, 0x0078, 0x437a,
+ 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x4383,
+ 0x7e0e, 0x0078, 0x4384, 0x2678, 0x600f, 0x0000, 0x1078, 0x5fcd,
+ 0x0040, 0x439a, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x43ad, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4,
+ 0x1078, 0x60db, 0x1078, 0x60e8, 0x0c7f, 0x0078, 0x4353, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x4353, 0x127f, 0x007f, 0x027f, 0x067f,
0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006,
- 0x00c0, 0x462f, 0x1078, 0x6e8b, 0x0078, 0x463a, 0x007e, 0x067e,
+ 0x00c0, 0x4391, 0x1078, 0x6ac6, 0x0078, 0x439a, 0x007e, 0x067e,
0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091, 0x8000,
- 0x2079, 0x71b6, 0x7838, 0xa065, 0x0040, 0x468d, 0x600c, 0x007e,
- 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x4674, 0x6003, 0x000a,
- 0x630a, 0x2c30, 0x0078, 0x468a, 0x1078, 0x6336, 0x0040, 0x4688,
- 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4696, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x644a,
- 0x1078, 0x6457, 0x007f, 0x0078, 0x4663, 0x7e3a, 0x7e36, 0x127f,
+ 0x2079, 0x6db0, 0x7838, 0xa065, 0x0040, 0x43ed, 0x600c, 0x007e,
+ 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x43d4, 0x6003, 0x000a,
+ 0x630a, 0x2c30, 0x0078, 0x43ea, 0x1078, 0x5fcd, 0x0040, 0x43e8,
+ 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x43f6, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x1078, 0x60e8, 0x007f, 0x0078, 0x43c3, 0x7e3a, 0x7e36, 0x127f,
0x0f7f, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x467f, 0x1078, 0x6e8b, 0x0078, 0x4688, 0x027e,
- 0x1078, 0x46b3, 0x1078, 0x474c, 0x027f, 0x007c, 0x0f7e, 0x127e,
- 0x2079, 0x71b6, 0x2091, 0x8000, 0x1078, 0x47e3, 0x1078, 0x484b,
+ 0x0006, 0x00c0, 0x43df, 0x1078, 0x6ac6, 0x0078, 0x43e8, 0x027e,
+ 0x1078, 0x4413, 0x1078, 0x44aa, 0x027f, 0x007c, 0x0f7e, 0x127e,
+ 0x2079, 0x6db0, 0x2091, 0x8000, 0x1078, 0x453f, 0x1078, 0x45a7,
0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e,
- 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x71b6, 0x7614, 0x2660,
- 0x2678, 0x8cff, 0x0040, 0x473b, 0x6018, 0xa080, 0x0028, 0x2004,
- 0xa206, 0x00c0, 0x4736, 0x7024, 0xac06, 0x00c0, 0x46f9, 0x2069,
- 0x0100, 0x68c0, 0xa005, 0x0040, 0x46f4, 0x1078, 0x50b0, 0x68c3,
- 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
- 0x6b04, 0xa384, 0x1000, 0x0040, 0x46e9, 0x6803, 0x0100, 0x6803,
- 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x46f1, 0x6827,
- 0x0001, 0x037f, 0x0078, 0x46f9, 0x6003, 0x0009, 0x630a, 0x0078,
- 0x4736, 0x7014, 0xac36, 0x00c0, 0x46ff, 0x660c, 0x7616, 0x7010,
- 0xac36, 0x00c0, 0x470d, 0x2c00, 0xaf36, 0x0040, 0x470b, 0x2f00,
- 0x7012, 0x0078, 0x470d, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x4716, 0x7e0e, 0x0078, 0x4717, 0x2678, 0x600f,
- 0x0000, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x472f, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x4743, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840, 0x1078, 0x644a, 0x1078,
- 0x6457, 0x1078, 0x53f5, 0x0c7f, 0x0078, 0x46c1, 0x2c78, 0x600c,
- 0x2060, 0x0078, 0x46c1, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x4724,
- 0x1078, 0x6e8b, 0x0078, 0x472f, 0x0c7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0xa280, 0x7120, 0x2004, 0xa065, 0x0040, 0x47df, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x71b6, 0x6654, 0x7018, 0xac06,
- 0x00c0, 0x4763, 0x761a, 0x701c, 0xac06, 0x00c0, 0x476f, 0x86ff,
- 0x00c0, 0x476e, 0x7018, 0x701e, 0x0078, 0x476f, 0x761e, 0x6058,
- 0xa07d, 0x0040, 0x4774, 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x477a,
- 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4,
- 0xc0dc, 0x6002, 0x1078, 0x3473, 0x0040, 0x47db, 0x7624, 0x86ff,
- 0x0040, 0x47cb, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x47cb,
- 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x47c2, 0x1078,
- 0x50b0, 0x68c3, 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x47ab, 0x6803,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6db0, 0x7614, 0x2660,
+ 0x2678, 0x8cff, 0x0040, 0x4499, 0x6018, 0xa080, 0x0028, 0x2004,
+ 0xa206, 0x00c0, 0x4494, 0x7024, 0xac06, 0x00c0, 0x4459, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x4454, 0x1078, 0x4e17, 0x68c3,
+ 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x4449, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4451, 0x6827,
+ 0x0001, 0x037f, 0x0078, 0x4459, 0x6003, 0x0009, 0x630a, 0x0078,
+ 0x4494, 0x7014, 0xac36, 0x00c0, 0x445f, 0x660c, 0x7616, 0x7010,
+ 0xac36, 0x00c0, 0x446d, 0x2c00, 0xaf36, 0x0040, 0x446b, 0x2f00,
+ 0x7012, 0x0078, 0x446d, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
+ 0xaf06, 0x0040, 0x4476, 0x7e0e, 0x0078, 0x4477, 0x2678, 0x600f,
+ 0x0000, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040, 0x448d, 0x601c,
+ 0xa086, 0x0003, 0x00c0, 0x44a1, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db, 0x1078, 0x60e8, 0x1078,
+ 0x516d, 0x0c7f, 0x0078, 0x4421, 0x2c78, 0x600c, 0x2060, 0x0078,
+ 0x4421, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x4484, 0x1078, 0x6ac6,
+ 0x0078, 0x448d, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280,
+ 0x6d20, 0x2004, 0xa065, 0x0040, 0x453b, 0x0f7e, 0x0e7e, 0x0d7e,
+ 0x067e, 0x2071, 0x6db0, 0x6654, 0x7018, 0xac06, 0x00c0, 0x44c1,
+ 0x761a, 0x701c, 0xac06, 0x00c0, 0x44cd, 0x86ff, 0x00c0, 0x44cc,
+ 0x7018, 0x701e, 0x0078, 0x44cd, 0x761e, 0x6058, 0xa07d, 0x0040,
+ 0x44d2, 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x44d8, 0x2f00, 0x685a,
+ 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002,
+ 0x1078, 0x32e7, 0x0040, 0x4537, 0x7624, 0x86ff, 0x0040, 0x4529,
+ 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4529, 0x0d7e, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x4520, 0x1078, 0x4e17, 0x68c3,
+ 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x4509, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4511, 0x6827,
+ 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x451a,
+ 0x8001, 0x603e, 0x2660, 0x1078, 0x60e8, 0x0c7f, 0x0078, 0x4529,
+ 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078,
+ 0x44e0, 0x8dff, 0x0040, 0x4533, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x35c4, 0x1078, 0x516d, 0x0078, 0x44e0, 0x067f,
+ 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e,
+ 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065, 0x0040,
+ 0x4597, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0,
+ 0x457c, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4576, 0x1078,
+ 0x4e17, 0x68c3, 0x0000, 0x1078, 0x529d, 0x7827, 0x0000, 0x037e,
+ 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x456b, 0x6803,
0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x47b3, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005,
- 0x0040, 0x47bc, 0x8001, 0x603e, 0x2660, 0x1078, 0x6457, 0x0c7f,
- 0x0078, 0x47cb, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a,
- 0x0c7f, 0x0078, 0x4782, 0x8dff, 0x0040, 0x47d7, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x64f5, 0x1078, 0x3840, 0x1078,
- 0x53f5, 0x0078, 0x4782, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f,
- 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031,
- 0x0000, 0x7814, 0xa065, 0x0040, 0x483b, 0x600c, 0x007e, 0x600f,
- 0x0000, 0x7824, 0xac06, 0x00c0, 0x4820, 0x2069, 0x0100, 0x68c0,
- 0xa005, 0x0040, 0x481a, 0x1078, 0x50b0, 0x68c3, 0x0000, 0x1078,
- 0x5525, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
- 0x1000, 0x0040, 0x480f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
- 0x0100, 0x6824, 0xd084, 0x0040, 0x4817, 0x6827, 0x0001, 0x037f,
- 0x0078, 0x4820, 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078, 0x4838,
- 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x4834, 0x601c, 0xa086,
- 0x0003, 0x00c0, 0x4842, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x3840, 0x1078, 0x644a, 0x1078, 0x6457, 0x1078, 0x53f5,
- 0x007f, 0x0078, 0x47ea, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f,
- 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x482b, 0x1078,
- 0x6e8b, 0x0078, 0x4834, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818,
- 0xa065, 0x0040, 0x48b7, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b,
- 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x3473, 0x0040,
- 0x48b4, 0x7e24, 0x86ff, 0x0040, 0x48a6, 0xa680, 0x0004, 0x2004,
- 0xad06, 0x00c0, 0x48a6, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005,
- 0x0040, 0x489d, 0x1078, 0x50b0, 0x68c3, 0x0000, 0x1078, 0x5525,
- 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
- 0x0040, 0x4886, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
- 0x6824, 0xd084, 0x0040, 0x488e, 0x6827, 0x0001, 0x037f, 0x0d7f,
- 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4897, 0x8001, 0x603e, 0x2660,
- 0x1078, 0x6457, 0x0c7f, 0x0078, 0x48a6, 0x0d7f, 0x0c7e, 0x2660,
- 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x485d, 0x8dff, 0x0040,
- 0x48b0, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3840,
- 0x1078, 0x53f5, 0x0078, 0x485d, 0x007f, 0x0078, 0x4850, 0x781e,
- 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e, 0x0c7e,
- 0x2071, 0x71b6, 0x7004, 0xa084, 0x0007, 0x0079, 0x48c7, 0x48d1,
- 0x48d4, 0x48ed, 0x4909, 0x494e, 0x48d1, 0x48d1, 0x48cf, 0x1078,
- 0x1288, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x48e2,
- 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0040, 0x48e9, 0x7216,
- 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
- 0x007c, 0x7216, 0x7212, 0x0078, 0x48e2, 0x6018, 0x2060, 0x1078,
- 0x3473, 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022, 0x0040,
- 0x48fe, 0x6054, 0xa015, 0x0040, 0x4905, 0x721e, 0x7007, 0x0000,
- 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7218, 0x721e, 0x0078,
- 0x48fe, 0x7024, 0xa065, 0x0040, 0x494b, 0x700c, 0xac06, 0x00c0,
- 0x4920, 0x1078, 0x53f5, 0x600c, 0xa015, 0x0040, 0x491c, 0x720e,
- 0x600f, 0x0000, 0x0078, 0x4949, 0x720e, 0x720a, 0x0078, 0x4949,
- 0x7014, 0xac06, 0x00c0, 0x4933, 0x1078, 0x53f5, 0x600c, 0xa015,
- 0x0040, 0x492f, 0x7216, 0x600f, 0x0000, 0x0078, 0x4949, 0x7216,
- 0x7212, 0x0078, 0x4949, 0x6018, 0x2060, 0x1078, 0x3473, 0x6000,
- 0xc0dc, 0x6002, 0x1078, 0x53f5, 0x701c, 0xa065, 0x0040, 0x4949,
- 0x6054, 0xa015, 0x0040, 0x4947, 0x721e, 0x0078, 0x4949, 0x7218,
- 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065,
- 0x0040, 0x495b, 0x1078, 0x53f5, 0x600c, 0xa015, 0x0040, 0x4962,
- 0x720e, 0x600f, 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078, 0x495b, 0x0d7e, 0x2069,
- 0x71b6, 0x6830, 0xa084, 0x0003, 0x0079, 0x496e, 0x4974, 0x4976,
- 0x499c, 0x4974, 0x1078, 0x1288, 0x0d7f, 0x007c, 0x0c7e, 0x6840,
- 0xa086, 0x0001, 0x0040, 0x4992, 0x683c, 0xa065, 0x0040, 0x4987,
- 0x600c, 0xa015, 0x0040, 0x498e, 0x6a3a, 0x600f, 0x0000, 0x6833,
- 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f, 0x007c, 0x683a, 0x6836,
- 0x0078, 0x4987, 0x6843, 0x0000, 0x6838, 0xa065, 0x0040, 0x4987,
- 0x6003, 0x0003, 0x0078, 0x4987, 0x0c7e, 0x6843, 0x0000, 0x6847,
- 0x0000, 0x683c, 0xa065, 0x0040, 0x49b4, 0x600c, 0xa015, 0x0040,
- 0x49b0, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0078, 0x49b4,
- 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, 0x0d7f, 0x007c, 0x0d7e,
- 0x2069, 0x71b6, 0x6804, 0xa084, 0x0007, 0x0079, 0x49bf, 0x49c9,
- 0x4a56, 0x4a56, 0x4a56, 0x4a56, 0x4a58, 0x4a56, 0x49c7, 0x1078,
- 0x1288, 0x6820, 0xa005, 0x00c0, 0x49cf, 0x0d7f, 0x007c, 0x0c7e,
- 0x680c, 0xa065, 0x0040, 0x49de, 0x6807, 0x0004, 0x6826, 0x682b,
- 0x0000, 0x1078, 0x4a9e, 0x0c7f, 0x0d7f, 0x007c, 0x6814, 0xa065,
- 0x0040, 0x49ec, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x1078,
- 0x4a9e, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, 0x037e, 0x6a1c, 0xa2f5,
- 0x0000, 0x0040, 0x4a51, 0x704c, 0xa00d, 0x0040, 0x49fb, 0x7088,
- 0xa005, 0x0040, 0x4a13, 0x7054, 0xa075, 0x0040, 0x4a04, 0xa20e,
- 0x0040, 0x4a51, 0x0078, 0x4a09, 0x6818, 0xa20e, 0x0040, 0x4a51,
- 0x2070, 0x704c, 0xa00d, 0x0040, 0x49fb, 0x7088, 0xa005, 0x00c0,
- 0x49fb, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302, 0x00c8, 0x49fb,
- 0x1078, 0x56c4, 0x0040, 0x4a51, 0x8318, 0x733e, 0x6112, 0x2e10,
- 0x621a, 0xa180, 0x0015, 0x2004, 0xa08a, 0x199a, 0x0048, 0x4a2a,
- 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f,
- 0x0f7e, 0x2c78, 0x71a0, 0xa1e0, 0x2207, 0x2c0c, 0xa18c, 0x00ff,
- 0x2061, 0x0100, 0x619a, 0x1078, 0x4db8, 0x7300, 0xc3dd, 0x7302,
- 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x781f, 0x0003,
- 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f,
- 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, 0x4a4f, 0x0d7f, 0x007c,
- 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4a64, 0x6807, 0x0004, 0x6826,
- 0x682b, 0x0000, 0x1078, 0x4a9e, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e,
- 0x0d7e, 0x2069, 0x71b6, 0x6830, 0xa086, 0x0000, 0x00c0, 0x4a85,
- 0x6838, 0xa07d, 0x0040, 0x4a85, 0x6833, 0x0001, 0x683e, 0x6847,
- 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, 0x027f, 0x1078, 0x19b3,
- 0x00c0, 0x4a88, 0x127f, 0x1078, 0x4fe3, 0x0d7f, 0x0f7f, 0x007c,
- 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0xa015, 0x0040,
- 0x4a9a, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000,
- 0x0078, 0x4a85, 0x683a, 0x6836, 0x0078, 0x4a94, 0x601c, 0xa084,
- 0x0007, 0x1079, 0x4aa4, 0x007c, 0x4aac, 0x4ab1, 0x4cf0, 0x4d88,
- 0x4ab1, 0x4cf0, 0x4d88, 0x4aac, 0x1078, 0x48be, 0x1078, 0x49b7,
- 0x007c, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a,
- 0x0030, 0x10c8, 0x1288, 0x6118, 0x2178, 0x79a0, 0xa1f8, 0x2207,
- 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x1079,
- 0x4acf, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x4b01,
- 0x4b39, 0x4b51, 0x4b8a, 0x4bb7, 0x4bbf, 0x4be0, 0x4bf1, 0x4c02,
- 0x4c0a, 0x4c1b, 0x4c0a, 0x4c63, 0x4bf1, 0x4c84, 0x4c8c, 0x4c02,
- 0x4c8c, 0x4c9d, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff,
- 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x516c, 0x5181,
- 0x4aff, 0x4aff, 0x4aff, 0x4aff, 0x4be0, 0x4c0a, 0x4aff, 0x4b51,
- 0x4b8a, 0x4aff, 0x563f, 0x4c0a, 0x4aff, 0x5662, 0x4c0a, 0x1078,
- 0x1288, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x5200, 0x20a3,
- 0x0000, 0x0d7e, 0x2069, 0x7051, 0x6804, 0xd084, 0x0040, 0x4b1b,
- 0x6828, 0x20a3, 0x0000, 0x017e, 0x1078, 0x1feb, 0x21a2, 0x017f,
- 0x0d7f, 0x0078, 0x4b20, 0x0d7f, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a9, 0x0004, 0x2099, 0x7005, 0x53a6, 0x20a9, 0x0004, 0x2099,
- 0x7001, 0x53a6, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x0500, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a9,
- 0x0004, 0x2099, 0x7005, 0x53a6, 0x60c3, 0x0010, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x0300, 0x20a3,
- 0x0000, 0x2099, 0x71a0, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0004,
- 0x2099, 0x7005, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7001, 0x53a6,
- 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4b6a, 0x20a9, 0x0008,
- 0x20a3, 0x0000, 0x00f0, 0x4b70, 0x2099, 0x71a8, 0x20a9, 0x0008,
- 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4b7b, 0x20a9,
- 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4b81, 0x60c3, 0x0074, 0x1078,
- 0x509c, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x2010,
- 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x7051, 0x7904,
- 0x0f7f, 0xd1ac, 0x00c0, 0x4ba6, 0xa085, 0x0020, 0xd1a4, 0x0040,
- 0x4bab, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x509c, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x5000, 0x0078, 0x4b57, 0x20a1,
- 0x020b, 0x1078, 0x4cb2, 0x20a3, 0x2110, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x509c, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078,
- 0x509c, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0200,
- 0x0078, 0x4b57, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0100,
- 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3, 0x0008,
- 0x1078, 0x509c, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x4cd1,
- 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818, 0x2068,
- 0x6894, 0xa086, 0x0014, 0x00c0, 0x4c41, 0x6998, 0xa184, 0xc000,
- 0x00c0, 0x4c3d, 0xd1ec, 0x0040, 0x4c39, 0x20a3, 0x2100, 0x0078,
- 0x4c43, 0x20a3, 0x0100, 0x0078, 0x4c43, 0x20a3, 0x0400, 0x0078,
- 0x4c43, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x20a2, 0x0f7e, 0x2079, 0x7051, 0x7904, 0x0f7f, 0xd1ac, 0x00c0,
- 0x4c53, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4c58, 0xa085, 0x0010,
- 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x0014, 0x1078,
- 0x509c, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3,
- 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0100, 0x20a3,
+ 0x4573, 0x6827, 0x0001, 0x037f, 0x0078, 0x457c, 0x6003, 0x0009,
+ 0x630a, 0x2c30, 0x0078, 0x4594, 0x6010, 0x2068, 0x1078, 0x5fcd,
+ 0x0040, 0x4590, 0x601c, 0xa086, 0x0003, 0x00c0, 0x459e, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x1078, 0x60e8, 0x1078, 0x516d, 0x007f, 0x0078, 0x4546, 0x7e16,
+ 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086,
+ 0x0006, 0x00c0, 0x4587, 0x1078, 0x6ac6, 0x0078, 0x4590, 0x007e,
+ 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, 0x4613, 0x6054,
+ 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc,
+ 0x6002, 0x1078, 0x32e7, 0x0040, 0x4610, 0x7e24, 0x86ff, 0x0040,
+ 0x4602, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4602, 0x0d7e,
+ 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x45f9, 0x1078, 0x4e17,
+ 0x68c3, 0x0000, 0x1078, 0x529d, 0x7827, 0x0000, 0x037e, 0x2069,
+ 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x45e2, 0x6803, 0x0100,
+ 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x45ea,
+ 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040,
+ 0x45f3, 0x8001, 0x603e, 0x2660, 0x1078, 0x60e8, 0x0c7f, 0x0078,
+ 0x4602, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f,
+ 0x0078, 0x45b9, 0x8dff, 0x0040, 0x460c, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x516d, 0x0078, 0x45b9,
+ 0x007f, 0x0078, 0x45ac, 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f,
+ 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x6db0, 0x7004, 0xa084,
+ 0x0007, 0x0079, 0x4623, 0x462d, 0x4630, 0x4649, 0x4665, 0x46aa,
+ 0x462d, 0x462d, 0x462b, 0x1078, 0x126a, 0x0c7f, 0x0e7f, 0x007c,
+ 0x7024, 0xa065, 0x0040, 0x463e, 0x7020, 0x8001, 0x7022, 0x600c,
+ 0xa015, 0x0040, 0x4645, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000,
+ 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078,
+ 0x463e, 0x6018, 0x2060, 0x1078, 0x32e7, 0x6000, 0xc0dc, 0x6002,
+ 0x7020, 0x8001, 0x7022, 0x0040, 0x465a, 0x6054, 0xa015, 0x0040,
+ 0x4661, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f,
+ 0x007c, 0x7218, 0x721e, 0x0078, 0x465a, 0x7024, 0xa065, 0x0040,
+ 0x46a7, 0x700c, 0xac06, 0x00c0, 0x467c, 0x1078, 0x516d, 0x600c,
+ 0xa015, 0x0040, 0x4678, 0x720e, 0x600f, 0x0000, 0x0078, 0x46a5,
+ 0x720e, 0x720a, 0x0078, 0x46a5, 0x7014, 0xac06, 0x00c0, 0x468f,
+ 0x1078, 0x516d, 0x600c, 0xa015, 0x0040, 0x468b, 0x7216, 0x600f,
+ 0x0000, 0x0078, 0x46a5, 0x7216, 0x7212, 0x0078, 0x46a5, 0x6018,
+ 0x2060, 0x1078, 0x32e7, 0x6000, 0xc0dc, 0x6002, 0x1078, 0x516d,
+ 0x701c, 0xa065, 0x0040, 0x46a5, 0x6054, 0xa015, 0x0040, 0x46a3,
+ 0x721e, 0x0078, 0x46a5, 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f,
+ 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x46b7, 0x1078, 0x516d,
+ 0x600c, 0xa015, 0x0040, 0x46be, 0x720e, 0x600f, 0x0000, 0x1078,
+ 0x529d, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a,
+ 0x0078, 0x46b7, 0x0d7e, 0x2069, 0x6db0, 0x6830, 0xa084, 0x0003,
+ 0x0079, 0x46ca, 0x46d0, 0x46d2, 0x46f8, 0x46d0, 0x1078, 0x126a,
+ 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040, 0x46ee,
+ 0x683c, 0xa065, 0x0040, 0x46e3, 0x600c, 0xa015, 0x0040, 0x46ea,
+ 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f,
+ 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x46e3, 0x6843, 0x0000,
+ 0x6838, 0xa065, 0x0040, 0x46e3, 0x6003, 0x0003, 0x0078, 0x46e3,
+ 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065, 0x0040,
+ 0x4710, 0x600c, 0xa015, 0x0040, 0x470c, 0x6a3a, 0x600f, 0x0000,
+ 0x683f, 0x0000, 0x0078, 0x4710, 0x683f, 0x0000, 0x683a, 0x6836,
+ 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x6db0, 0x6804, 0xa084,
+ 0x0007, 0x0079, 0x471b, 0x4725, 0x47b2, 0x47b2, 0x47b2, 0x47b2,
+ 0x47b4, 0x47b2, 0x4723, 0x1078, 0x126a, 0x6820, 0xa005, 0x00c0,
+ 0x472b, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x473a,
+ 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x47fa, 0x0c7f,
+ 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x4748, 0x6807, 0x0001,
+ 0x6826, 0x682b, 0x0000, 0x1078, 0x47fa, 0x0c7f, 0x0d7f, 0x007c,
+ 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x47ad, 0x704c,
+ 0xa00d, 0x0040, 0x4757, 0x7088, 0xa005, 0x0040, 0x476f, 0x7054,
+ 0xa075, 0x0040, 0x4760, 0xa20e, 0x0040, 0x47ad, 0x0078, 0x4765,
+ 0x6818, 0xa20e, 0x0040, 0x47ad, 0x2070, 0x704c, 0xa00d, 0x0040,
+ 0x4757, 0x7088, 0xa005, 0x00c0, 0x4757, 0x2e00, 0x681e, 0x733c,
+ 0x7038, 0xa302, 0x00c8, 0x4757, 0x1078, 0x53f4, 0x0040, 0x47ad,
+ 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004,
+ 0xa08a, 0x199a, 0x0048, 0x4786, 0x2001, 0x1999, 0x8003, 0x801b,
+ 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xa1e0,
+ 0x2154, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078,
+ 0x4b1d, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26,
+ 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040,
+ 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f,
+ 0x0078, 0x47ab, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
+ 0x47c0, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x47fa,
+ 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x6db0, 0x6830,
+ 0xa086, 0x0000, 0x00c0, 0x47e1, 0x6838, 0xa07d, 0x0040, 0x47e1,
+ 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091,
+ 0x2200, 0x027f, 0x1078, 0x1952, 0x00c0, 0x47e4, 0x127f, 0x1078,
+ 0x4d4a, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000, 0x7803,
+ 0x0002, 0x780c, 0xa015, 0x0040, 0x47f6, 0x6a3a, 0x780f, 0x0000,
+ 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x47e1, 0x683a, 0x6836,
+ 0x0078, 0x47f0, 0x601c, 0xa084, 0x0007, 0x1079, 0x4800, 0x007c,
+ 0x4808, 0x480a, 0x4a59, 0x4aed, 0x480a, 0x4a59, 0x4aed, 0x4808,
+ 0x1078, 0x126a, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004,
+ 0xa08a, 0x002a, 0x10c8, 0x126a, 0x6118, 0x2178, 0x79a0, 0xa1f8,
+ 0x2154, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a,
+ 0x1079, 0x4828, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c,
+ 0x4854, 0x4893, 0x48ab, 0x48e4, 0x4911, 0x4919, 0x493a, 0x494b,
+ 0x495c, 0x4964, 0x4975, 0x4964, 0x49bd, 0x494b, 0x49ed, 0x49f5,
+ 0x495c, 0x49f5, 0x4a06, 0x4852, 0x4852, 0x4852, 0x4852, 0x4852,
+ 0x4852, 0x4852, 0x4852, 0x4852, 0x4852, 0x4852, 0x4852, 0x4eea,
+ 0x4eff, 0x4852, 0x4852, 0x4852, 0x4852, 0x493a, 0x4964, 0x4852,
+ 0x48ab, 0x48e4, 0x1078, 0x126a, 0x20a1, 0x020b, 0x1078, 0x4a1b,
+ 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6c51, 0x6804,
+ 0xd084, 0x0040, 0x4875, 0x6828, 0x017e, 0x2069, 0x6c00, 0x694c,
+ 0xa106, 0x017f, 0x00c0, 0x4875, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x0d7f, 0x0078, 0x487a, 0x0d7f, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6c05, 0x53a6, 0x20a9,
+ 0x0004, 0x2099, 0x6c01, 0x53a6, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c,
+ 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3,
+ 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff,
+ 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6c05, 0x53a6, 0x60c3, 0x0010,
+ 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3,
+ 0x0300, 0x20a3, 0x0000, 0x2099, 0x6da0, 0x20a9, 0x0008, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6c05, 0x53a6, 0x20a9, 0x0004, 0x2099,
+ 0x6c01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x48c4,
+ 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x48ca, 0x2099, 0x6da8,
+ 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0,
+ 0x48d5, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x48db, 0x60c3,
+ 0x0074, 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b,
+ 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079,
+ 0x6c51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4900, 0xa085, 0x0020,
+ 0xd1a4, 0x0040, 0x4905, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4e03,
+ 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3, 0x5000, 0x0078,
+ 0x48b1, 0x20a1, 0x020b, 0x1078, 0x4a1b, 0x20a3, 0x2110, 0x20a3,
+ 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0x20a3, 0x0000, 0x20a3,
0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x509c, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1,
- 0x20a3, 0x0200, 0x0078, 0x4b07, 0x20a1, 0x020b, 0x1078, 0x4cd1,
- 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00,
- 0x60c3, 0x0008, 0x1078, 0x509c, 0x007c, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, 0x1078,
- 0x509c, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
- 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x0129, 0x20a3, 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000,
- 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x2300,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0198,
- 0x20a3, 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000, 0x7a08,
- 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
- 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1288, 0xa08a,
- 0x008c, 0x10c8, 0x1288, 0x6118, 0x2178, 0x79a0, 0xa1f8, 0x2207,
- 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa082,
- 0x0085, 0x1079, 0x4d0e, 0x0f7f, 0x0c7f, 0x007c, 0x4d17, 0x4d22,
- 0x4d3c, 0x4d15, 0x4d15, 0x4d15, 0x4d17, 0x1078, 0x1288, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4d4f, 0x60c3, 0x0000, 0x1078, 0x509c,
- 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4d62, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x2fa2, 0x20a3, 0x0000,
- 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c,
- 0x1078, 0x509c, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078,
- 0x4d75, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0004, 0x1078, 0x509c, 0x147f, 0x007c, 0x027e,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8100, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000,
- 0x0078, 0x4cc3, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
- 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4ce2, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x20a3, 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4ce2,
- 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x1048, 0x1288,
- 0xa08a, 0x0050, 0x10c8, 0x1288, 0x7918, 0x2160, 0x61a0, 0xa1e0,
- 0x2207, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082,
- 0x0040, 0x1079, 0x4da6, 0x0f7f, 0x0c7f, 0x007c, 0x4db8, 0x4e68,
- 0x4e29, 0x4f77, 0x4db6, 0x4db6, 0x4db6, 0x4db6, 0x4db6, 0x4db6,
- 0x4db6, 0x530e, 0x531f, 0x5330, 0x5341, 0x4db6, 0x1078, 0x1288,
- 0x0d7e, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7910,
- 0x2168, 0x6948, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c,
- 0xa184, 0x0006, 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4dd3, 0x20a3,
- 0x0002, 0x0078, 0x4ddf, 0xd1b4, 0x0040, 0x4dda, 0x20a3, 0x0001,
- 0x0078, 0x4ddf, 0x20a3, 0x0000, 0x2230, 0x0078, 0x4de1, 0x6a80,
- 0x6e7c, 0x20a9, 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2,
- 0x8000, 0x00f0, 0x4de5, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1,
- 0x9080, 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001,
- 0x71d2, 0x2003, 0x07d0, 0x2001, 0x71d1, 0x2003, 0x0009, 0x2001,
- 0x71d7, 0x2003, 0x0002, 0x1078, 0x14b7, 0x147f, 0x157f, 0x0d7f,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023,
- 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3,
- 0x0600, 0x6198, 0x21a2, 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829,
- 0x20a2, 0x22a2, 0x20a2, 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2,
- 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078,
- 0x4e49, 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880,
- 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x60c3, 0x000c, 0x1078, 0x509c, 0x147f, 0x137f, 0x157f, 0x0d7f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889,
- 0x20a3, 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000, 0x7a08,
- 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
- 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4f58,
- 0x7810, 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x7810, 0xa084, 0xf000, 0x00c0, 0x4e85, 0x7810, 0xa084, 0x0700,
- 0x8007, 0x1079, 0x4e8d, 0x0078, 0x4e88, 0xa006, 0x1079, 0x4e8d,
- 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4e97, 0x4ef9, 0x4efd,
- 0x4f20, 0x4f2d, 0x4f3f, 0x4f43, 0x4e95, 0x1078, 0x1288, 0x017e,
- 0x037e, 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4eaa,
- 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f,
- 0x0078, 0x4f24, 0xa186, 0x0001, 0x00c0, 0x4ef4, 0x6b78, 0x23a2,
- 0x6868, 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2,
- 0x687c, 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4ef3,
- 0xd3c4, 0x0040, 0x4ec5, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4eca,
- 0x6874, 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c,
- 0x831f, 0x23a2, 0x8000, 0x00f0, 0x4ecf, 0x157f, 0x22a2, 0x22a2,
- 0x22a2, 0xa184, 0x0003, 0x0040, 0x4ef3, 0x20a1, 0x020b, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x508b,
- 0x22a2, 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x509c,
- 0x007c, 0x20a3, 0x0008, 0x0078, 0x4f22, 0x20a3, 0x0302, 0x22a2,
- 0x22a2, 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2,
- 0x20a3, 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x509c, 0x007c,
- 0x20a3, 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x60c3, 0x0018, 0x1078, 0x509c, 0x007c, 0x20a3, 0x0100, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x60c3, 0x0020, 0x1078, 0x509c, 0x007c, 0x20a3,
- 0x0008, 0x0078, 0x4f22, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812,
- 0xa384, 0x00ff, 0x8001, 0x00c0, 0x4f51, 0x22a2, 0x037f, 0x0078,
- 0x4f22, 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4f24,
- 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298,
- 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3,
- 0x0000, 0x1078, 0x508b, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2,
+ 0x0022, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+ 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3, 0x0200,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004,
+ 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3,
+ 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3,
+ 0x0008, 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4a3a,
+ 0x20a3, 0x0200, 0x0078, 0x48b1, 0x20a1, 0x020b, 0x1078, 0x4a3a,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2,
+ 0x60c3, 0x0008, 0x1078, 0x4e03, 0x007c, 0x0d7e, 0x20a1, 0x020b,
+ 0x1078, 0x4a3a, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800,
+ 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x499b, 0x6998,
+ 0xa184, 0xc000, 0x00c0, 0x4997, 0xd1ec, 0x0040, 0x4993, 0x20a3,
+ 0x2100, 0x0078, 0x499d, 0x20a3, 0x0100, 0x0078, 0x499d, 0x20a3,
+ 0x0400, 0x0078, 0x499d, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6c51, 0x7904, 0x0f7f,
+ 0xd1ac, 0x00c0, 0x49ad, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x49b2,
+ 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x0014, 0x1078, 0x4e03, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4a3a, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x6018,
+ 0x0d7e, 0x2068, 0x6804, 0x0d7f, 0xa084, 0x00ff, 0xa086, 0x0006,
+ 0x0040, 0x49d6, 0x20a3, 0x0400, 0x0078, 0x49d8, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x4e03, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4a3a, 0x20a3, 0x0200, 0x0078, 0x485a, 0x20a1, 0x020b, 0x1078,
+ 0x4a3a, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
+ 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4e03, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3, 0x0100,
+ 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008,
+ 0x1078, 0x4e03, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
+ 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x4df2, 0x22a2, 0x20a3,
+ 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x0198, 0x20a3, 0x0000, 0x1078, 0x4df2, 0x22a2, 0x20a3, 0x0000,
+ 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
+ 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048, 0x126a,
+ 0xa08a, 0x008c, 0x10c8, 0x126a, 0x6118, 0x2178, 0x79a0, 0xa1f8,
+ 0x2154, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a,
+ 0xa082, 0x0085, 0x1079, 0x4a77, 0x0f7f, 0x0c7f, 0x007c, 0x4a80,
+ 0x4a8b, 0x4aa5, 0x4a7e, 0x4a7e, 0x4a7e, 0x4a80, 0x1078, 0x126a,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ab4, 0x60c3, 0x0000, 0x1078,
+ 0x4e03, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ac7,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x2fa2, 0x20a3,
+ 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x000c, 0x1078, 0x4e03, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4ada, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x60c3, 0x0004,
+ 0x1078, 0x4e03, 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x20a3, 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
+ 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0078, 0x4a2c, 0x027e,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8400, 0x6298, 0x22a2,
+ 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000,
+ 0x0078, 0x4a4b, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4a4b, 0x0c7e, 0x0f7e, 0x2c78,
+ 0x7804, 0xa08a, 0x0040, 0x1048, 0x126a, 0xa08a, 0x0050, 0x10c8,
+ 0x126a, 0x7918, 0x2160, 0x61a0, 0xa1e0, 0x2154, 0x2c0c, 0xa18c,
+ 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4b0b,
+ 0x0f7f, 0x0c7f, 0x007c, 0x4b1d, 0x4bcf, 0x4b90, 0x4cde, 0x4b1b,
+ 0x4b1b, 0x4b1b, 0x4b1b, 0x4b1b, 0x4b1b, 0x4b1b, 0x5086, 0x5097,
+ 0x50a8, 0x50b9, 0x4b1b, 0x1078, 0x126a, 0x0d7e, 0x157e, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7910, 0x2168, 0x6944, 0xa18c,
+ 0x00ff, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184,
+ 0x0006, 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x4b3a, 0x20a3, 0x0002,
+ 0x0078, 0x4b46, 0xd1b4, 0x0040, 0x4b41, 0x20a3, 0x0001, 0x0078,
+ 0x4b46, 0x20a3, 0x0000, 0x2230, 0x0078, 0x4b48, 0x6a80, 0x6e7c,
+ 0x20a9, 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000,
+ 0x00f0, 0x4b4c, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080,
+ 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x6dcc,
+ 0x2003, 0x07d0, 0x2001, 0x6dcb, 0x2003, 0x0009, 0x2001, 0x6dd1,
+ 0x2003, 0x0002, 0x1078, 0x1497, 0x147f, 0x157f, 0x0d7f, 0x007c,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014,
+ 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3, 0x0600,
+ 0x6198, 0x21a2, 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a2,
+ 0x22a2, 0x20a2, 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2, 0x007c,
+ 0x0d7e, 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4bb0,
+ 0x7810, 0x2068, 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2,
+ 0x687c, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3,
+ 0x000c, 0x1078, 0x4e03, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3,
+ 0x0000, 0x1078, 0x4df2, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2,
0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e,
- 0x157e, 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700,
- 0x8007, 0x1079, 0x4f8a, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f,
- 0x0d7f, 0x007c, 0x4f92, 0x4f92, 0x4f94, 0x4f92, 0x4f92, 0x4f92,
- 0x4fb9, 0x4f92, 0x1078, 0x1288, 0x7910, 0xa18c, 0xf8ff, 0xa18d,
- 0x0600, 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4fc3,
- 0x0d7e, 0x2069, 0x7051, 0x6804, 0xd0bc, 0x0040, 0x4fae, 0x682c,
- 0xa084, 0x00ff, 0x8007, 0x20a2, 0x0078, 0x4fb0, 0x20a3, 0x3f00,
- 0x0d7f, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x509c,
- 0x007c, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4fc3, 0x20a3,
- 0x7f00, 0x0078, 0x4fb1, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x20a3, 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, 0x508b, 0x22a2,
- 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100,
- 0x2071, 0x7000, 0x6130, 0x7818, 0x2068, 0x68a0, 0xa080, 0x2207,
- 0x2014, 0xa294, 0x00ff, 0x781c, 0xa086, 0x0006, 0x0040, 0x502a,
- 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809,
- 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
- 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810,
- 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008,
+ 0x157e, 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cbf, 0x7810,
+ 0x2068, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810,
+ 0xa084, 0xf000, 0x00c0, 0x4bec, 0x7810, 0xa084, 0x0700, 0x8007,
+ 0x1079, 0x4bf4, 0x0078, 0x4bef, 0xa006, 0x1079, 0x4bf4, 0x147f,
+ 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4bfe, 0x4c60, 0x4c64, 0x4c87,
+ 0x4c94, 0x4ca6, 0x4caa, 0x4bfc, 0x1078, 0x126a, 0x017e, 0x037e,
+ 0x694c, 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x4c11, 0x6b78,
+ 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078,
+ 0x4c8b, 0xa186, 0x0001, 0x00c0, 0x4c5b, 0x6b78, 0x23a2, 0x6868,
+ 0x20a2, 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c,
+ 0x20a2, 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x4c5a, 0xd3c4,
+ 0x0040, 0x4c2c, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4c31, 0x6874,
+ 0xa108, 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f,
+ 0x23a2, 0x8000, 0x00f0, 0x4c36, 0x157f, 0x22a2, 0x22a2, 0x22a2,
+ 0xa184, 0x0003, 0x0040, 0x4c5a, 0x20a1, 0x020b, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4df2, 0x22a2,
+ 0x20a3, 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x4e03, 0x007c,
+ 0x20a3, 0x0008, 0x0078, 0x4c89, 0x20a3, 0x0302, 0x22a2, 0x22a2,
+ 0x22a2, 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3,
+ 0x000a, 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x60c3, 0x0032, 0x1078, 0x4e03, 0x007c, 0x20a3,
+ 0x0028, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3,
+ 0x0018, 0x1078, 0x4e03, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2,
+ 0x22a2, 0x60c3, 0x0020, 0x1078, 0x4e03, 0x007c, 0x20a3, 0x0008,
+ 0x0078, 0x4c89, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384,
+ 0x00ff, 0x8001, 0x00c0, 0x4cb8, 0x22a2, 0x037f, 0x0078, 0x4c89,
+ 0x20a3, 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4c8b, 0x027e,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2,
+ 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000,
+ 0x1078, 0x4df2, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
+ 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007,
+ 0x1079, 0x4cf1, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f,
+ 0x007c, 0x4cf9, 0x4cf9, 0x4cfb, 0x4cf9, 0x4cf9, 0x4cf9, 0x4d20,
+ 0x4cf9, 0x1078, 0x126a, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600,
+ 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4d2a, 0x0d7e,
+ 0x2069, 0x6c51, 0x6804, 0xd0bc, 0x0040, 0x4d15, 0x682c, 0xa084,
+ 0x00ff, 0x8007, 0x20a2, 0x0078, 0x4d17, 0x20a3, 0x3f00, 0x0d7f,
+ 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x4e03, 0x007c,
+ 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x4d2a, 0x20a3, 0x7f00,
+ 0x0078, 0x4d18, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, 0x4df2, 0x22a2, 0x20a3,
+ 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100, 0x2071,
+ 0x6c00, 0x6130, 0x7818, 0x2068, 0x68a0, 0xa080, 0x2154, 0x2014,
+ 0xa294, 0x00ff, 0x781c, 0xa086, 0x0006, 0x0040, 0x4d91, 0x6063,
+ 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077,
+ 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a,
+ 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070,
+ 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca,
+ 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
+ 0x629e, 0x6017, 0x0016, 0x1078, 0x40a8, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x007c, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002,
+ 0x0040, 0x4dc6, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e,
+ 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff,
+ 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808,
+ 0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c,
0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
- 0x0000, 0x629e, 0x6017, 0x0016, 0x1078, 0x432c, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086,
- 0x0002, 0x0040, 0x505f, 0x6063, 0x0100, 0x6266, 0x606b, 0x0000,
- 0x616e, 0x6073, 0x0880, 0x6077, 0x0008, 0x688c, 0x8000, 0xa084,
- 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086,
- 0x7808, 0x6082, 0x7060, 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6,
- 0x707c, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5,
- 0x60d7, 0x0000, 0x629e, 0x6017, 0x0012, 0x0078, 0x5024, 0x6063,
- 0x0700, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077,
- 0x0000, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a,
- 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a,
- 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce,
- 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017,
- 0x0016, 0x0078, 0x5024, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210,
- 0xa294, 0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x71b6,
- 0x6843, 0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056,
- 0x60a7, 0x9575, 0x1078, 0x50a7, 0x1078, 0x431c, 0x007c, 0x007e,
- 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c,
- 0x007e, 0x0c7e, 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085,
- 0x0008, 0x6016, 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e,
- 0x027e, 0x1078, 0x4327, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
- 0xa194, 0x4000, 0x0040, 0x50fa, 0x1078, 0x50b0, 0x6803, 0x1000,
- 0x6803, 0x0000, 0x0c7e, 0x2061, 0x71b6, 0x6128, 0xa192, 0x0002,
- 0x00c8, 0x50e7, 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040,
- 0x50f5, 0x1078, 0x431c, 0x1078, 0x50a7, 0x0078, 0x50f5, 0x6124,
- 0xa1e5, 0x0000, 0x0040, 0x50f2, 0x1078, 0x6f55, 0x2009, 0x0014,
- 0x1078, 0x571c, 0x0c7f, 0x0078, 0x50f5, 0x027f, 0x017f, 0x0d7f,
- 0x0c7f, 0x007c, 0x1078, 0x3247, 0x0078, 0x50f5, 0x0c7e, 0x0d7e,
- 0x0e7e, 0x017e, 0x027e, 0x1078, 0x4335, 0x2071, 0x71b6, 0x713c,
- 0x81ff, 0x0040, 0x5128, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
- 0xa194, 0x4000, 0x0040, 0x512e, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x037e, 0x2019, 0x0001, 0x1078, 0x525b, 0x037f, 0x713c, 0x2160,
- 0x1078, 0x6f55, 0x2009, 0x004a, 0x1078, 0x571c, 0x0078, 0x5128,
- 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x7144, 0xa192,
- 0x0002, 0x00c8, 0x5118, 0x8108, 0x7146, 0x1078, 0x432c, 0x0078,
- 0x5128, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, 0x71b6,
- 0x7018, 0x2068, 0x8dff, 0x0040, 0x5163, 0x68a0, 0xa406, 0x0040,
- 0x5155, 0x6854, 0x2068, 0x0078, 0x514a, 0x6010, 0x2060, 0x643c,
- 0x6540, 0x6e48, 0x2d60, 0x1078, 0x363f, 0x0040, 0x5163, 0x1078,
- 0x53f5, 0xa085, 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b,
- 0x1078, 0x4cb2, 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x509c, 0x147f, 0x157f,
- 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3,
- 0x0200, 0x20a3, 0x0000, 0x20a9, 0x0006, 0x2011, 0x7040, 0x2019,
- 0x7041, 0x23a6, 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0,
- 0x5191, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078,
- 0x509c, 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x71b6, 0x700c, 0x2060, 0x8cff, 0x0040,
- 0x51c0, 0x1078, 0x6484, 0x00c0, 0x51b7, 0x1078, 0x58f2, 0x600c,
- 0x007e, 0x1078, 0x56f5, 0x1078, 0x53f5, 0x0c7f, 0x0078, 0x51ae,
+ 0x0000, 0x629e, 0x6017, 0x0012, 0x0078, 0x4d8b, 0x6063, 0x0700,
+ 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000,
+ 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
+ 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010,
+ 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab,
+ 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017, 0x0016,
+ 0x0078, 0x4d8b, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294,
+ 0x00ff, 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x6db0, 0x6843,
+ 0x0001, 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7,
+ 0x9575, 0x1078, 0x4e0e, 0x1078, 0x4098, 0x007c, 0x007e, 0x6014,
+ 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e,
+ 0x0c7e, 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008,
+ 0x6016, 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e,
+ 0x1078, 0x40a3, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194,
+ 0x4000, 0x0040, 0x4e6c, 0x1078, 0x4e17, 0x6803, 0x1000, 0x6803,
+ 0x0000, 0x0c7e, 0x2061, 0x6db0, 0x6128, 0xa192, 0x0002, 0x00c8,
+ 0x4e59, 0x8108, 0x612a, 0x613c, 0x0c7f, 0x81ff, 0x0040, 0x4e67,
+ 0x1078, 0x4098, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0,
+ 0x4e55, 0x6017, 0x0012, 0x0078, 0x4e67, 0x1078, 0x4e0e, 0x0078,
+ 0x4e67, 0x6124, 0xa1e5, 0x0000, 0x0040, 0x4e64, 0x1078, 0x6b90,
+ 0x2009, 0x0014, 0x1078, 0x544c, 0x0c7f, 0x0078, 0x4e67, 0x027f,
+ 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x1078, 0x30c9, 0x0078, 0x4e67,
+ 0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078, 0x40b1, 0x2071,
+ 0x6db0, 0x713c, 0x81ff, 0x0040, 0x4eab, 0x2061, 0x0100, 0x2069,
+ 0x0140, 0x6904, 0x017e, 0x017f, 0xa194, 0x4000, 0x0040, 0x4eb1,
+ 0x6017, 0x0010, 0x7144, 0xa192, 0x0002, 0x00c8, 0x4ea3, 0x8108,
+ 0x7146, 0x1078, 0x40a8, 0x713c, 0xa188, 0x0007, 0x210c, 0xa18e,
+ 0x0006, 0x00c0, 0x4e9f, 0x6017, 0x0012, 0x0078, 0x4eab, 0x6017,
+ 0x0016, 0x0078, 0x4eab, 0x1078, 0x6b90, 0x2009, 0x004a, 0x1078,
+ 0x544c, 0x0078, 0x4eab, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f,
+ 0x007c, 0x1078, 0x40a8, 0x0078, 0x4eab, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018,
+ 0x2068, 0x6ca0, 0x2071, 0x6db0, 0x7018, 0x2068, 0x8dff, 0x0040,
+ 0x4ee1, 0x68a0, 0xa406, 0x0040, 0x4ed1, 0x6854, 0x2068, 0x0078,
+ 0x4ec6, 0x6010, 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f,
+ 0x2d60, 0x1078, 0x3445, 0x0040, 0x4ee1, 0x1078, 0x516d, 0xa085,
+ 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4a1b,
+ 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
+ 0x60c3, 0x0008, 0x1078, 0x4e03, 0x147f, 0x157f, 0x007c, 0x157e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4a3a, 0x20a3, 0x0200, 0x20a3,
+ 0x0000, 0x20a9, 0x0006, 0x2011, 0x6c40, 0x2019, 0x6c41, 0x23a6,
+ 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x4f0f, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x4e03, 0x147f,
+ 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6db0, 0x700c, 0x2060, 0x8cff, 0x0040, 0x4f38, 0x600c,
+ 0x007e, 0x1078, 0x5425, 0x1078, 0x516d, 0x0c7f, 0x0078, 0x4f2c,
0x700f, 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f,
0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e,
0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140,
- 0x2071, 0x71b6, 0x7024, 0x2060, 0x8cff, 0x0040, 0x5219, 0x1078,
- 0x50b0, 0x68c3, 0x0000, 0x1078, 0x4327, 0x2009, 0x0013, 0x1078,
- 0x571c, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x51fc, 0x6827,
- 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x520e, 0x7803, 0x1000,
- 0x7803, 0x0000, 0x0078, 0x520e, 0xd084, 0x0040, 0x5203, 0x6827,
- 0x0001, 0x0078, 0x5205, 0x00f0, 0x51eb, 0x7804, 0xa084, 0x1000,
- 0x0040, 0x520e, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f,
+ 0x2071, 0x6db0, 0x7024, 0x2060, 0x8cff, 0x0040, 0x4f91, 0x1078,
+ 0x4e17, 0x68c3, 0x0000, 0x1078, 0x40a3, 0x2009, 0x0013, 0x1078,
+ 0x544c, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x4f74, 0x6827,
+ 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x4f86, 0x7803, 0x1000,
+ 0x7803, 0x0000, 0x0078, 0x4f86, 0xd084, 0x0040, 0x4f7b, 0x6827,
+ 0x0001, 0x0078, 0x4f7d, 0x00f0, 0x4f63, 0x7804, 0xa084, 0x1000,
+ 0x0040, 0x4f86, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f,
0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f,
- 0x007c, 0x2001, 0x7000, 0x2004, 0xa096, 0x0001, 0x0040, 0x5251,
- 0xa096, 0x0004, 0x0040, 0x5251, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x2011, 0x320e, 0x1078, 0x42aa, 0x20a9, 0x01f4, 0x6824, 0xd094,
- 0x0040, 0x523f, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040,
- 0x5251, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5251, 0xd084,
- 0x0040, 0x5246, 0x6827, 0x0001, 0x0078, 0x5248, 0x00f0, 0x522e,
- 0x7804, 0xa084, 0x1000, 0x0040, 0x5251, 0x7803, 0x0100, 0x7803,
+ 0x007c, 0x2001, 0x6c00, 0x2004, 0xa096, 0x0001, 0x0040, 0x4fc9,
+ 0xa096, 0x0004, 0x0040, 0x4fc9, 0x6817, 0x0008, 0x68c3, 0x0000,
+ 0x2011, 0x308c, 0x1078, 0x4026, 0x20a9, 0x01f4, 0x6824, 0xd094,
+ 0x0040, 0x4fb7, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040,
+ 0x4fc9, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x4fc9, 0xd084,
+ 0x0040, 0x4fbe, 0x6827, 0x0001, 0x0078, 0x4fc0, 0x00f0, 0x4fa6,
+ 0x7804, 0xa084, 0x1000, 0x0040, 0x4fc9, 0x7803, 0x0100, 0x7803,
0x0000, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
0x157f, 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e,
0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100,
- 0x2079, 0x0140, 0x2071, 0x71b6, 0x703c, 0x2060, 0x8cff, 0x0040,
- 0x52a9, 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078,
- 0x4335, 0x1078, 0x1b80, 0xa39d, 0x0000, 0x00c0, 0x5283, 0x2009,
- 0x0049, 0x1078, 0x571c, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040,
- 0x5296, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x52a8,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x52a8, 0xd094, 0x0040,
- 0x529d, 0x6827, 0x0002, 0x0078, 0x529f, 0x00f0, 0x5285, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x52a8, 0x7803, 0x0100, 0x7803, 0x0000,
+ 0x2079, 0x0140, 0x2071, 0x6db0, 0x703c, 0x2060, 0x8cff, 0x0040,
+ 0x5021, 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078,
+ 0x40b1, 0x1078, 0x1b1f, 0xa39d, 0x0000, 0x00c0, 0x4ffb, 0x2009,
+ 0x0049, 0x1078, 0x544c, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040,
+ 0x500e, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5020,
+ 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5020, 0xd094, 0x0040,
+ 0x5015, 0x6827, 0x0002, 0x0078, 0x5017, 0x00f0, 0x4ffd, 0x7804,
+ 0xa084, 0x1000, 0x0040, 0x5020, 0x7803, 0x0100, 0x7803, 0x0000,
0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
0x157f, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069,
- 0x71b6, 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091,
- 0x8000, 0x2069, 0x71b6, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e,
- 0x0e7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x71b6, 0x7614,
- 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x5307, 0x601c,
- 0xa206, 0x00c0, 0x5302, 0x7014, 0xac36, 0x00c0, 0x52e1, 0x660c,
- 0x7616, 0x7010, 0xac36, 0x00c0, 0x52ef, 0x2c00, 0xaf36, 0x0040,
- 0x52ed, 0x2f00, 0x7012, 0x0078, 0x52ef, 0x7013, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x52f8, 0x7e0e, 0x0078, 0x52f9,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6457, 0x1078, 0x53f5, 0x0c7f,
- 0x0078, 0x52d4, 0x2c78, 0x600c, 0x2060, 0x0078, 0x52d4, 0x127f,
+ 0x6db0, 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091,
+ 0x8000, 0x2069, 0x6db0, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e,
+ 0x0e7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x6db0, 0x7614,
+ 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x507f, 0x601c,
+ 0xa206, 0x00c0, 0x507a, 0x7014, 0xac36, 0x00c0, 0x5059, 0x660c,
+ 0x7616, 0x7010, 0xac36, 0x00c0, 0x5067, 0x2c00, 0xaf36, 0x0040,
+ 0x5065, 0x2f00, 0x7012, 0x0078, 0x5067, 0x7013, 0x0000, 0x660c,
+ 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5070, 0x7e0e, 0x0078, 0x5071,
+ 0x2678, 0x600f, 0x0000, 0x1078, 0x60e8, 0x1078, 0x516d, 0x0c7f,
+ 0x0078, 0x504c, 0x2c78, 0x600c, 0x2060, 0x0078, 0x504c, 0x127f,
0x007f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x5350, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x5350,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810, 0x20a2,
+ 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810, 0x20a2, 0xa006, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x50c8, 0x157e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810, 0x20a2, 0xa006,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x50c8,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810, 0x20a2,
0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078,
- 0x5350, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4e09, 0x7810,
+ 0x50c8, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b70, 0x7810,
0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200,
- 0x1078, 0x5400, 0x60c3, 0x0020, 0x1078, 0x509c, 0x147f, 0x157f,
+ 0x1078, 0x5178, 0x60c3, 0x0020, 0x1078, 0x4e03, 0x147f, 0x157f,
0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120,
- 0xd1b4, 0x00c0, 0x5368, 0xd1bc, 0x00c0, 0x53b2, 0x0078, 0x53f2,
+ 0xd1b4, 0x00c0, 0x50e0, 0xd1bc, 0x00c0, 0x512a, 0x0078, 0x516a,
0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069,
0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x53a9, 0x6020, 0xd0b4, 0x0040, 0x53a9, 0x6024, 0xd094,
- 0x00c0, 0x53a9, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
- 0x53a9, 0x00f0, 0x5375, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107,
+ 0x0040, 0x5121, 0x6020, 0xd0b4, 0x0040, 0x5121, 0x6024, 0xd094,
+ 0x00c0, 0x5121, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0,
+ 0x5121, 0x00f0, 0x50ed, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107,
0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b,
0xbc91, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024,
- 0xd094, 0x00c0, 0x53a8, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x539f,
+ 0xd094, 0x00c0, 0x5120, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x5117,
0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000,
- 0x0078, 0x53f2, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e,
+ 0x0078, 0x516a, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e,
0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x53eb, 0x6020, 0xd0bc, 0x0040, 0x53eb,
- 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x53eb, 0x00f0,
- 0x53bf, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
+ 0xa084, 0x4000, 0x0040, 0x5163, 0x6020, 0xd0bc, 0x0040, 0x5163,
+ 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5163, 0x00f0,
+ 0x5137, 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c,
0x00ff, 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043,
0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000,
- 0x00c0, 0x53e5, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f,
- 0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x71b6,
- 0x7020, 0xa005, 0x0040, 0x53fe, 0x8001, 0x7022, 0x0e7f, 0x007c,
- 0x20a9, 0x0008, 0x20a2, 0x00f0, 0x5402, 0x20a2, 0x20a2, 0x007c,
+ 0x00c0, 0x515d, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f,
+ 0x200b, 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x6db0,
+ 0x7020, 0xa005, 0x0040, 0x5176, 0x8001, 0x7022, 0x0e7f, 0x007c,
+ 0x20a9, 0x0008, 0x20a2, 0x00f0, 0x517a, 0x20a2, 0x20a2, 0x007c,
0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x71b6, 0x7614, 0x2660, 0x2678, 0x2039,
- 0x0001, 0x87ff, 0x0040, 0x5498, 0x8cff, 0x0040, 0x5498, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x5493, 0x88ff, 0x0040, 0x542f, 0x2800,
- 0xac06, 0x00c0, 0x5493, 0x2039, 0x0000, 0x0078, 0x5433, 0x6018,
- 0xa206, 0x00c0, 0x5493, 0x7024, 0xac06, 0x00c0, 0x5461, 0x2069,
- 0x0100, 0x68c0, 0xa005, 0x0040, 0x545c, 0x6817, 0x0008, 0x68c3,
- 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
- 0x6b04, 0xa384, 0x1000, 0x0040, 0x5451, 0x6803, 0x0100, 0x6803,
- 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5459, 0x6827,
- 0x0001, 0x037f, 0x0078, 0x5461, 0x6003, 0x0009, 0x630a, 0x0078,
- 0x5493, 0x7014, 0xac36, 0x00c0, 0x5467, 0x660c, 0x7616, 0x7010,
- 0xac36, 0x00c0, 0x5475, 0x2c00, 0xaf36, 0x0040, 0x5473, 0x2f00,
- 0x7012, 0x0078, 0x5475, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x547e, 0x7e0e, 0x0078, 0x547f, 0x2678, 0x600f,
- 0x0000, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x5489, 0x1078,
- 0x6e8b, 0x1078, 0x6457, 0x1078, 0x53f5, 0x88ff, 0x00c0, 0x54a2,
- 0x0c7f, 0x0078, 0x5419, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5419,
+ 0x2091, 0x8000, 0x2071, 0x6db0, 0x7614, 0x2660, 0x2678, 0x2039,
+ 0x0001, 0x87ff, 0x0040, 0x5210, 0x8cff, 0x0040, 0x5210, 0x601c,
+ 0xa086, 0x0006, 0x00c0, 0x520b, 0x88ff, 0x0040, 0x51a7, 0x2800,
+ 0xac06, 0x00c0, 0x520b, 0x2039, 0x0000, 0x0078, 0x51ab, 0x6018,
+ 0xa206, 0x00c0, 0x520b, 0x7024, 0xac06, 0x00c0, 0x51d9, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x51d4, 0x6817, 0x0008, 0x68c3,
+ 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x51c9, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x51d1, 0x6827,
+ 0x0001, 0x037f, 0x0078, 0x51d9, 0x6003, 0x0009, 0x630a, 0x0078,
+ 0x520b, 0x7014, 0xac36, 0x00c0, 0x51df, 0x660c, 0x7616, 0x7010,
+ 0xac36, 0x00c0, 0x51ed, 0x2c00, 0xaf36, 0x0040, 0x51eb, 0x2f00,
+ 0x7012, 0x0078, 0x51ed, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00,
+ 0xaf06, 0x0040, 0x51f6, 0x7e0e, 0x0078, 0x51f7, 0x2678, 0x600f,
+ 0x0000, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040, 0x5201, 0x1078,
+ 0x6ac6, 0x1078, 0x60e8, 0x1078, 0x516d, 0x88ff, 0x00c0, 0x521a,
+ 0x0c7f, 0x0078, 0x5191, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5191,
0xa006, 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f,
0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078,
- 0x5499, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2071, 0x71b6, 0x7638, 0x2660, 0x2678,
- 0x8cff, 0x0040, 0x5514, 0x601c, 0xa086, 0x0006, 0x00c0, 0x550f,
- 0x88ff, 0x0040, 0x54c9, 0x2800, 0xac06, 0x00c0, 0x550f, 0x0078,
- 0x54cd, 0x6018, 0xa206, 0x00c0, 0x550f, 0x703c, 0xac06, 0x00c0,
- 0x54df, 0x037e, 0x2019, 0x0001, 0x1078, 0x525b, 0x7033, 0x0000,
+ 0x5211, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e,
+ 0x127e, 0x2091, 0x8000, 0x2071, 0x6db0, 0x7638, 0x2660, 0x2678,
+ 0x8cff, 0x0040, 0x528c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5287,
+ 0x88ff, 0x0040, 0x5241, 0x2800, 0xac06, 0x00c0, 0x5287, 0x0078,
+ 0x5245, 0x6018, 0xa206, 0x00c0, 0x5287, 0x703c, 0xac06, 0x00c0,
+ 0x5257, 0x037e, 0x2019, 0x0001, 0x1078, 0x4fd3, 0x7033, 0x0000,
0x703f, 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038,
- 0xac36, 0x00c0, 0x54e5, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0,
- 0x54f3, 0x2c00, 0xaf36, 0x0040, 0x54f1, 0x2f00, 0x7036, 0x0078,
- 0x54f3, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
- 0x54fc, 0x7e0e, 0x0078, 0x54fd, 0x2678, 0x600f, 0x0000, 0x6010,
- 0x2068, 0x1078, 0x6336, 0x0040, 0x5507, 0x1078, 0x6e8b, 0x1078,
- 0x6457, 0x88ff, 0x00c0, 0x551e, 0x0c7f, 0x0078, 0x54b8, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x54b8, 0xa006, 0x127f, 0x007f, 0x027f,
+ 0xac36, 0x00c0, 0x525d, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0,
+ 0x526b, 0x2c00, 0xaf36, 0x0040, 0x5269, 0x2f00, 0x7036, 0x0078,
+ 0x526b, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
+ 0x5274, 0x7e0e, 0x0078, 0x5275, 0x2678, 0x600f, 0x0000, 0x6010,
+ 0x2068, 0x1078, 0x5fcd, 0x0040, 0x527f, 0x1078, 0x6ac6, 0x1078,
+ 0x60e8, 0x88ff, 0x00c0, 0x5296, 0x0c7f, 0x0078, 0x5230, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x5230, 0xa006, 0x127f, 0x007f, 0x027f,
0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000,
- 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5515, 0x0e7e, 0x2071, 0x71b6,
- 0x2001, 0x7000, 0x2004, 0xa086, 0x0002, 0x00c0, 0x5533, 0x7007,
- 0x0005, 0x0078, 0x5535, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e,
+ 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x528d, 0x0e7e, 0x2071, 0x6db0,
+ 0x2001, 0x6c00, 0x2004, 0xa086, 0x0002, 0x00c0, 0x52ab, 0x7007,
+ 0x0005, 0x0078, 0x52ad, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e,
0x0e7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x71b6, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040,
- 0x5575, 0x2200, 0xac06, 0x00c0, 0x5570, 0x7038, 0xac36, 0x00c0,
- 0x5553, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5561, 0x2c00,
- 0xaf36, 0x0040, 0x555f, 0x2f00, 0x7036, 0x0078, 0x5561, 0x7037,
- 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5569, 0x7e0e, 0x0078,
- 0x556a, 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5575,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5546, 0x127f, 0x007f, 0x027f,
+ 0x2071, 0x6db0, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040,
+ 0x52ed, 0x2200, 0xac06, 0x00c0, 0x52e8, 0x7038, 0xac36, 0x00c0,
+ 0x52cb, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x52d9, 0x2c00,
+ 0xaf36, 0x0040, 0x52d7, 0x2f00, 0x7036, 0x0078, 0x52d9, 0x7037,
+ 0x0000, 0x660c, 0x2c00, 0xaf06, 0x0040, 0x52e1, 0x7e0e, 0x0078,
+ 0x52e2, 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x52ed,
+ 0x2c78, 0x600c, 0x2060, 0x0078, 0x52be, 0x127f, 0x007f, 0x027f,
0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x71b6,
- 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040, 0x560e, 0x6018, 0xa080,
- 0x0028, 0x2004, 0xa206, 0x00c0, 0x5609, 0x7024, 0xac06, 0x00c0,
- 0x55bc, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x55bc, 0x1078,
- 0x50b0, 0x68c3, 0x0000, 0x1078, 0x5525, 0x7027, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x55b3, 0x6803,
+ 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6db0,
+ 0x760c, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5386, 0x6018, 0xa080,
+ 0x0028, 0x2004, 0xa206, 0x00c0, 0x5381, 0x7024, 0xac06, 0x00c0,
+ 0x5334, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5334, 0x1078,
+ 0x4e17, 0x68c3, 0x0000, 0x1078, 0x529d, 0x7027, 0x0000, 0x037e,
+ 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x532b, 0x6803,
0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x55bb, 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x55c2,
- 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0, 0x55d0, 0x2c00, 0xaf36,
- 0x0040, 0x55ce, 0x2f00, 0x700a, 0x0078, 0x55d0, 0x700b, 0x0000,
- 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x55d9, 0x7e0e, 0x0078,
- 0x55da, 0x2678, 0x600f, 0x0000, 0x1078, 0x6470, 0x00c0, 0x55e4,
- 0x1078, 0x21c6, 0x0078, 0x5600, 0x1078, 0x6484, 0x00c0, 0x55ec,
- 0x1078, 0x58f2, 0x0078, 0x5600, 0x6010, 0x2068, 0x1078, 0x6336,
- 0x0040, 0x5600, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5616, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x644a,
- 0x6003, 0x0000, 0x1078, 0x6457, 0x1078, 0x53f5, 0x0c7f, 0x0078,
- 0x558b, 0x2c78, 0x600c, 0x2060, 0x0078, 0x558b, 0x127f, 0x007f,
+ 0x5333, 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x533a,
+ 0x660c, 0x760e, 0x7008, 0xac36, 0x00c0, 0x5348, 0x2c00, 0xaf36,
+ 0x0040, 0x5346, 0x2f00, 0x700a, 0x0078, 0x5348, 0x700b, 0x0000,
+ 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5351, 0x7e0e, 0x0078,
+ 0x5352, 0x2678, 0x600f, 0x0000, 0x1078, 0x6101, 0x00c0, 0x535c,
+ 0x1078, 0x2143, 0x0078, 0x5378, 0x1078, 0x6115, 0x00c0, 0x5364,
+ 0x1078, 0x5614, 0x0078, 0x5378, 0x6010, 0x2068, 0x1078, 0x5fcd,
+ 0x0040, 0x5378, 0x601c, 0xa086, 0x0003, 0x00c0, 0x538e, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x6003, 0x0000, 0x1078, 0x60e8, 0x1078, 0x516d, 0x0c7f, 0x0078,
+ 0x5303, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5303, 0x127f, 0x007f,
0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x55f7, 0x1078, 0x6e8b, 0x0078, 0x5600, 0x037e,
+ 0x0006, 0x00c0, 0x536f, 0x1078, 0x6ac6, 0x0078, 0x5378, 0x037e,
0x157e, 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c,
- 0xa39e, 0x20a0, 0x00c0, 0x5630, 0x8210, 0x8000, 0x0078, 0x5627,
- 0xa005, 0x0040, 0x563a, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0,
- 0x22c8, 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0200, 0x20a3, 0x0014,
- 0x60c3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c,
- 0x20a3, 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004,
- 0x20a3, 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x509c,
- 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4cd1, 0x20a3, 0x0210,
- 0x20a3, 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0018, 0x1078, 0x509c, 0x007c, 0x2061,
- 0x7600, 0x2a70, 0x7060, 0x7046, 0x704b, 0x7600, 0x007c, 0x0e7e,
- 0x127e, 0x2071, 0x7000, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001,
- 0x0048, 0x56c1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
- 0x56ad, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x56a9, 0x0078,
- 0x569c, 0x2061, 0x7600, 0x0078, 0x569c, 0x6003, 0x0008, 0x8529,
- 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x56bd, 0x754a,
- 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7600, 0x0078,
- 0x56b8, 0xa006, 0x0078, 0x56ba, 0x0e7e, 0x2071, 0x7000, 0x7544,
- 0xa582, 0x0001, 0x0048, 0x56f2, 0x7048, 0x2060, 0x6000, 0xa086,
- 0x0000, 0x0040, 0x56df, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
- 0x56db, 0x0078, 0x56ce, 0x2061, 0x7600, 0x0078, 0x56ce, 0x6003,
+ 0xa39e, 0x201d, 0x00c0, 0x53a8, 0x8210, 0x8000, 0x0078, 0x539f,
+ 0xa005, 0x0040, 0x53b2, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0,
+ 0x22c8, 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x2061,
+ 0x7200, 0x2a70, 0x7060, 0x7046, 0x704b, 0x7200, 0x007c, 0x0e7e,
+ 0x127e, 0x2071, 0x6c00, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001,
+ 0x0048, 0x53f1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040,
+ 0x53dd, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x53d9, 0x0078,
+ 0x53cc, 0x2061, 0x7200, 0x0078, 0x53cc, 0x6003, 0x0008, 0x8529,
+ 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x53ed, 0x754a,
+ 0xa085, 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7200, 0x0078,
+ 0x53e8, 0xa006, 0x0078, 0x53ea, 0x0e7e, 0x2071, 0x6c00, 0x7544,
+ 0xa582, 0x0001, 0x0048, 0x5422, 0x7048, 0x2060, 0x6000, 0xa086,
+ 0x0000, 0x0040, 0x540f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x540b, 0x0078, 0x53fe, 0x2061, 0x7200, 0x0078, 0x53fe, 0x6003,
0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8,
- 0x56ee, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7600,
- 0x0078, 0x56ea, 0xa006, 0x0078, 0x56ec, 0xac82, 0x7600, 0x1048,
- 0x1288, 0x2001, 0x7015, 0x2004, 0xac02, 0x10c8, 0x1288, 0xa006,
+ 0x541e, 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7200,
+ 0x0078, 0x541a, 0xa006, 0x0078, 0x541c, 0xac82, 0x7200, 0x1048,
+ 0x126a, 0x2001, 0x6c15, 0x2004, 0xac02, 0x10c8, 0x126a, 0xa006,
0x6006, 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000,
- 0x6003, 0x0000, 0x2061, 0x7000, 0x6044, 0x8000, 0x6046, 0xa086,
- 0x0001, 0x0040, 0x5714, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x49b7, 0x127f, 0x0078, 0x5713, 0x601c, 0xa084, 0x0007, 0x0079,
- 0x5721, 0x5729, 0x5731, 0x574d, 0x5769, 0x6501, 0x651d, 0x6539,
- 0x5729, 0xa18e, 0x0047, 0x00c0, 0x5730, 0xa016, 0x1078, 0x1525,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x573b, 0x067f, 0x007c, 0x574b, 0x5816, 0x5901, 0x574b, 0x574b,
- 0x574b, 0x574b, 0x574b, 0x57c5, 0x5b83, 0x574b, 0x574b, 0x574b,
- 0x574b, 0x574b, 0x574b, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x5757, 0x067f, 0x007c, 0x5767,
- 0x5767, 0x5767, 0x5767, 0x5767, 0x5767, 0x5767, 0x5767, 0x5ff3,
- 0x60b9, 0x5767, 0x600c, 0x6065, 0x600c, 0x6065, 0x5767, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x5773, 0x067f, 0x007c, 0x5783, 0x5bc1, 0x5c67, 0x5d29, 0x5e7d,
- 0x5783, 0x5783, 0x5783, 0x5b9f, 0x5fa8, 0x5fac, 0x5783, 0x5783,
- 0x5783, 0x5783, 0x5fd2, 0x1078, 0x1288, 0x20a9, 0x000e, 0x2e98,
+ 0x6003, 0x0000, 0x2061, 0x6c00, 0x6044, 0x8000, 0x6046, 0xa086,
+ 0x0001, 0x0040, 0x5444, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4713, 0x127f, 0x0078, 0x5443, 0x601c, 0xa084, 0x0007, 0x0079,
+ 0x5451, 0x5459, 0x5461, 0x547d, 0x5499, 0x6186, 0x61a2, 0x61be,
+ 0x5459, 0xa18e, 0x0047, 0x00c0, 0x5460, 0xa016, 0x1078, 0x1505,
+ 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079,
+ 0x546b, 0x067f, 0x007c, 0x547b, 0x5540, 0x5623, 0x547b, 0x547b,
+ 0x547b, 0x547b, 0x547b, 0x54f5, 0x58a5, 0x547b, 0x547b, 0x547b,
+ 0x547b, 0x547b, 0x547b, 0x1078, 0x126a, 0x067e, 0x6000, 0xa0b2,
+ 0x0010, 0x10c8, 0x126a, 0x1079, 0x5487, 0x067f, 0x007c, 0x5497,
+ 0x5497, 0x5497, 0x5497, 0x5497, 0x5497, 0x5497, 0x5497, 0x5c9f,
+ 0x5d63, 0x5497, 0x5cb8, 0x5d11, 0x5cb8, 0x5d11, 0x5497, 0x1078,
+ 0x126a, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079,
+ 0x54a3, 0x067f, 0x007c, 0x54b3, 0x58e3, 0x5969, 0x5a2b, 0x5b54,
+ 0x54b3, 0x54b3, 0x54b3, 0x58c1, 0x5c54, 0x5c58, 0x54b3, 0x54b3,
+ 0x54b3, 0x54b3, 0x5c7e, 0x1078, 0x126a, 0x20a9, 0x000e, 0x2e98,
0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5793, 0x0e7e,
- 0x1078, 0x6336, 0x0040, 0x57aa, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x56f5, 0x007c, 0x0d7e, 0x20a9,
+ 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x54c3, 0x0e7e,
+ 0x1078, 0x5fcd, 0x0040, 0x54da, 0x6010, 0x2070, 0x7007, 0x0000,
+ 0x7037, 0x0103, 0x0e7f, 0x1078, 0x5425, 0x007c, 0x0d7e, 0x20a9,
0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0xa1b6, 0x0015, 0x00c0,
- 0x57c2, 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800,
- 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x579f, 0x2100, 0xa1b2, 0x0030,
- 0x10c8, 0x1288, 0x0079, 0x57cc, 0x57fe, 0x580a, 0x57fe, 0x57fe,
- 0x57fe, 0x57fe, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fe, 0x57fc, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x57fe, 0x57fc, 0x57fc, 0x57fc,
- 0x57fc, 0x57fc, 0x57fc, 0x57fc, 0x1078, 0x1288, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x45af, 0x127e, 0x2091, 0x8000, 0x1078, 0x49b7,
- 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x45af, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x49b7, 0x127f, 0x007c, 0x6004, 0xa0b2,
- 0x0030, 0x10c8, 0x1288, 0xa1b6, 0x0013, 0x00c0, 0x5822, 0x2008,
- 0x0079, 0x587a, 0xa1b6, 0x0027, 0x00c0, 0x5860, 0x1078, 0x48be,
- 0x6004, 0x1078, 0x6470, 0x0040, 0x5833, 0x1078, 0x6484, 0x0040,
- 0x585c, 0x0078, 0x5857, 0x1078, 0x21c6, 0x2001, 0x0007, 0x1078,
- 0x34a2, 0x6018, 0xa080, 0x0028, 0x200c, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x469f, 0x1078, 0x45e2, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x584e, 0x1078, 0x36e4, 0x0c7f, 0x2c08,
- 0x1078, 0x6d09, 0x037f, 0x027f, 0x017f, 0x1078, 0x34e2, 0x1078,
- 0x56f5, 0x1078, 0x49b7, 0x007c, 0x1078, 0x58f2, 0x0078, 0x5857,
- 0xa186, 0x0014, 0x00c0, 0x585b, 0x1078, 0x48be, 0x1078, 0x21a8,
- 0x1078, 0x6470, 0x00c0, 0x5870, 0x1078, 0x21c6, 0x0078, 0x5857,
- 0x1078, 0x6484, 0x00c0, 0x5878, 0x1078, 0x58f2, 0x0078, 0x5857,
- 0x0078, 0x5857, 0x58ac, 0x58ae, 0x58b2, 0x58b6, 0x58ba, 0x58be,
- 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58c2, 0x58c8, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x58c8, 0x58c8, 0x58aa, 0x58aa, 0x58aa, 0x58aa,
- 0x58aa, 0x58aa, 0x1078, 0x1288, 0x0078, 0x58c8, 0x2001, 0x000b,
- 0x0078, 0x58d1, 0x2001, 0x0003, 0x0078, 0x58d1, 0x2001, 0x0005,
- 0x0078, 0x58d1, 0x2001, 0x0001, 0x0078, 0x58d1, 0x2001, 0x0009,
- 0x0078, 0x58d1, 0x1078, 0x1288, 0x0078, 0x58d0, 0x1078, 0x34a2,
- 0x1078, 0x48be, 0x6003, 0x0002, 0x6017, 0x0028, 0x1078, 0x49b7,
- 0x007c, 0x1078, 0x34a2, 0x1078, 0x48be, 0x6003, 0x0002, 0x037e,
- 0x2019, 0x705c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x58e3, 0x2019,
- 0x0028, 0x0078, 0x58ec, 0x8007, 0xa09a, 0x0004, 0x0048, 0x58df,
- 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x49b7,
- 0x0078, 0x58d0, 0x0e7e, 0x1078, 0x6336, 0x0040, 0x58ff, 0x6010,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f,
- 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0x00ff, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x1288, 0x6604, 0xa6b6, 0x0028, 0x00c0,
- 0x5915, 0x1078, 0x64b9, 0x0078, 0x593e, 0x6604, 0xa6b6, 0x0029,
- 0x00c0, 0x591e, 0x1078, 0x64d3, 0x0078, 0x593e, 0x6604, 0xa6b6,
- 0x001f, 0x00c0, 0x5927, 0x1078, 0x5785, 0x0078, 0x593e, 0x6604,
- 0xa6b6, 0x0000, 0x00c0, 0x5930, 0x1078, 0x57ae, 0x0078, 0x593e,
- 0xa1b6, 0x0015, 0x00c0, 0x5938, 0x1079, 0x5943, 0x0078, 0x593e,
- 0xa1b6, 0x0016, 0x00c0, 0x593f, 0x1079, 0x5a0c, 0x007c, 0x1078,
- 0x5729, 0x0078, 0x593e, 0x594f, 0x5952, 0x594f, 0x5993, 0x594f,
- 0x59bb, 0x594f, 0x594f, 0x594f, 0x59e4, 0x594f, 0x59fa, 0x0005,
- 0x0005, 0x007c, 0x0e7e, 0x2071, 0x7000, 0x7070, 0xa086, 0x0074,
- 0x00c0, 0x597c, 0x1078, 0x6ce1, 0x00c0, 0x596e, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x5980, 0x0d7f, 0x2001, 0x0006, 0x1078, 0x34a2,
- 0x1078, 0x21c6, 0x1078, 0x56f5, 0x0078, 0x597e, 0x2001, 0x000a,
- 0x1078, 0x34a2, 0x1078, 0x21c6, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x45af, 0x0078, 0x597e, 0x1078, 0x59ab, 0x0e7f, 0x007c,
- 0x6800, 0xd084, 0x0040, 0x5992, 0x2001, 0x0000, 0x1078, 0x348e,
- 0x2069, 0x7051, 0x6804, 0xd0a4, 0x0040, 0x5992, 0x2001, 0x0006,
- 0x1078, 0x34b0, 0x007c, 0x2011, 0x701c, 0x2204, 0xa086, 0x0074,
- 0x00c0, 0x59a8, 0x1078, 0x5ad5, 0x2001, 0x0004, 0x1078, 0x34a2,
- 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x45af, 0x0078, 0x59aa,
- 0x1078, 0x59ab, 0x007c, 0x2001, 0x7000, 0x2004, 0xa086, 0x0003,
- 0x0040, 0x59b6, 0x2001, 0x0007, 0x1078, 0x34a2, 0x1078, 0x56f5,
- 0x1078, 0x21c6, 0x007c, 0x0e7e, 0x2071, 0x7000, 0x7070, 0xa086,
- 0x0014, 0x00c0, 0x59e0, 0x7000, 0xa086, 0x0003, 0x00c0, 0x59ca,
- 0x1078, 0x2a92, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3576, 0x1078,
- 0x5980, 0x0d7f, 0x1078, 0x5adf, 0x00c0, 0x59e0, 0x2001, 0x0006,
- 0x1078, 0x34a2, 0x1078, 0x56f5, 0x1078, 0x21c6, 0x0078, 0x59e2,
- 0x1078, 0x59ab, 0x0e7f, 0x007c, 0x2011, 0x701c, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x59f7, 0x2001, 0x0002, 0x1078, 0x34a2, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x45af, 0x0078, 0x59f9, 0x1078,
- 0x59ab, 0x007c, 0x2011, 0x701c, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x5a09, 0x2001, 0x0007, 0x1078, 0x34a2, 0x1078, 0x56f5, 0x0078,
- 0x5a0b, 0x1078, 0x59ab, 0x007c, 0x594f, 0x5a18, 0x594f, 0x5a3e,
- 0x594f, 0x5a8a, 0x594f, 0x594f, 0x594f, 0x5a9d, 0x594f, 0x5ab0,
- 0x0c7e, 0x1078, 0x5ac3, 0x00c0, 0x5a2d, 0x2001, 0x0000, 0x1078,
- 0x348e, 0x2001, 0x0002, 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x45af, 0x0078, 0x5a3c, 0x2009, 0x748f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5a3a, 0x1078, 0x56f5,
- 0x0078, 0x5a3c, 0x1078, 0x59ab, 0x0c7f, 0x007c, 0x1078, 0x5ad2,
- 0x00c0, 0x5a52, 0x2001, 0x0000, 0x1078, 0x348e, 0x2001, 0x0002,
- 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x45af,
- 0x0078, 0x5a72, 0x2009, 0x748e, 0x2134, 0xa6b4, 0x00ff, 0xa686,
- 0x0005, 0x0040, 0x5a73, 0x2009, 0x748f, 0x2104, 0xa084, 0xff00,
- 0xa086, 0x1900, 0x00c0, 0x5a70, 0xa686, 0x0009, 0x0040, 0x5a73,
- 0x2001, 0x0004, 0x1078, 0x34a2, 0x1078, 0x56f5, 0x0078, 0x5a72,
- 0x1078, 0x59ab, 0x007c, 0x0d7e, 0x6018, 0x2068, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x5a85, 0x8001, 0x6842, 0x6017, 0x000a,
- 0x6007, 0x0016, 0x0d7f, 0x0078, 0x5a72, 0x1078, 0x21a8, 0x0d7f,
- 0x0078, 0x5a70, 0x1078, 0x5ad2, 0x00c0, 0x5a9a, 0x2001, 0x0004,
- 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x45af,
- 0x0078, 0x5a9c, 0x1078, 0x59ab, 0x007c, 0x1078, 0x5ad2, 0x00c0,
- 0x5aad, 0x2001, 0x0008, 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007,
- 0x0005, 0x1078, 0x45af, 0x0078, 0x5aaf, 0x1078, 0x59ab, 0x007c,
- 0x1078, 0x5ad2, 0x00c0, 0x5ac0, 0x2001, 0x000a, 0x1078, 0x34a2,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x45af, 0x0078, 0x5ac2,
- 0x1078, 0x59ab, 0x007c, 0x2009, 0x748e, 0x2104, 0xa086, 0x0003,
- 0x00c0, 0x5ad1, 0x2009, 0x748f, 0x2104, 0xa084, 0xff00, 0xa086,
- 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e, 0x017e, 0xac88,
- 0x0006, 0x2164, 0x1078, 0x350c, 0x017f, 0x0c7f, 0x007c, 0x0e7e,
- 0x2071, 0x748c, 0x7004, 0xa086, 0x0014, 0x00c0, 0x5b02, 0x7008,
- 0xa086, 0x0800, 0x00c0, 0x5b02, 0x700c, 0xd0ec, 0x0040, 0x5b00,
- 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x5b00, 0x7024, 0xd0a4,
- 0x0040, 0x5b00, 0xd08c, 0x0040, 0x5b00, 0xa006, 0x0078, 0x5b02,
- 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x077e,
- 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2029,
- 0x71bf, 0x252c, 0x2021, 0x71c5, 0x2424, 0x2061, 0x7600, 0x2071,
- 0x7000, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5b59, 0x1078, 0x6ee7,
- 0x0040, 0x5b51, 0x671c, 0xa786, 0x0001, 0x0040, 0x5b51, 0xa786,
- 0x0007, 0x0040, 0x5b51, 0x2500, 0xac06, 0x0040, 0x5b51, 0x2400,
- 0xac06, 0x0040, 0x5b51, 0x0c7e, 0x6000, 0xa086, 0x0004, 0x00c0,
- 0x5b3b, 0x1078, 0x1629, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040,
- 0x5b4e, 0xa786, 0x0003, 0x00c0, 0x5b63, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x644a, 0x1078, 0x6457,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5b59, 0x0078,
- 0x5b19, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f, 0x077f, 0x0c7f,
- 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x5b45, 0x1078,
- 0x6e8b, 0x0078, 0x5b4e, 0x220c, 0x2304, 0xa106, 0x00c0, 0x5b76,
- 0x8210, 0x8318, 0x00f0, 0x5b6b, 0xa006, 0x007c, 0x2304, 0xa102,
- 0x0048, 0x5b7e, 0x2001, 0x0001, 0x0078, 0x5b80, 0x2001, 0x0000,
- 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288,
- 0x1078, 0x6470, 0x0040, 0x5b92, 0x1078, 0x6484, 0x0040, 0x5b9b,
- 0x0078, 0x5b94, 0x1078, 0x21c6, 0x1078, 0x48be, 0x1078, 0x56f5,
- 0x1078, 0x49b7, 0x007c, 0x1078, 0x58f2, 0x0078, 0x5b94, 0xa182,
- 0x0040, 0x0079, 0x5ba3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3,
- 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb3, 0x5bb5, 0x5bb5,
- 0x5bb5, 0x5bb5, 0x5bb3, 0x1078, 0x1288, 0x6003, 0x0001, 0x6106,
- 0x1078, 0x4562, 0x127e, 0x2091, 0x8000, 0x1078, 0x49b7, 0x127f,
- 0x007c, 0xa186, 0x0013, 0x00c0, 0x5bca, 0x6004, 0xa082, 0x0040,
- 0x0079, 0x5c40, 0xa186, 0x0027, 0x00c0, 0x5be7, 0x1078, 0x48be,
- 0x1078, 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6336, 0x0040,
- 0x5be1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3840, 0x1078,
- 0x644a, 0x0d7f, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c, 0xa186,
- 0x0014, 0x00c0, 0x5bf0, 0x6004, 0xa082, 0x0040, 0x0079, 0x5c10,
- 0xa186, 0x0047, 0x10c0, 0x1288, 0x2001, 0x0109, 0x2004, 0xd084,
- 0x0040, 0x5c0d, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e,
- 0x1078, 0x4423, 0x027f, 0x017f, 0x007f, 0x127f, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x5c0d, 0x0078, 0x5c67, 0x1078, 0x5729, 0x007c,
- 0x5c22, 0x5c20, 0x5c20, 0x5c20, 0x5c20, 0x5c20, 0x5c20, 0x5c20,
- 0x5c20, 0x5c20, 0x5c20, 0x5c39, 0x5c39, 0x5c39, 0x5c39, 0x5c20,
- 0x1078, 0x1288, 0x1078, 0x48be, 0x0d7e, 0x6110, 0x2168, 0x1078,
- 0x6336, 0x0040, 0x5c33, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078,
- 0x3840, 0x1078, 0x644a, 0x0d7f, 0x1078, 0x56f5, 0x1078, 0x49b7,
- 0x007c, 0x1078, 0x48be, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c,
- 0x5c52, 0x5c50, 0x5c50, 0x5c50, 0x5c50, 0x5c50, 0x5c50, 0x5c50,
- 0x5c50, 0x5c50, 0x5c50, 0x5c60, 0x5c60, 0x5c60, 0x5c60, 0x5c50,
- 0x1078, 0x1288, 0x1078, 0x48be, 0x6003, 0x0002, 0x1078, 0x49b7,
- 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x007c,
- 0x1078, 0x48be, 0x6003, 0x000f, 0x1078, 0x49b7, 0x007c, 0xa182,
- 0x0040, 0x0079, 0x5c6b, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b,
- 0x5c7d, 0x5d06, 0x5d1e, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b, 0x5c7b,
- 0x5c7b, 0x5c7b, 0x5c7b, 0x1078, 0x1288, 0x0e7e, 0x0d7e, 0x2071,
- 0x748c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff, 0x86ff, 0x0040,
- 0x5cea, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5caf, 0xa186,
- 0x0028, 0x00c0, 0x5c99, 0x1078, 0x645e, 0x684b, 0x001c, 0x0078,
- 0x5cb1, 0xd6dc, 0x0040, 0x5ca4, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5cb1, 0xd6d4, 0x0040, 0x5caf, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5cb1, 0x684b,
- 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4, 0x0040, 0x5cc4,
- 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7498, 0xad90,
- 0x0019, 0x1078, 0x6128, 0x037f, 0xd6cc, 0x0040, 0x5cfa, 0x7124,
- 0x695a, 0xa192, 0x0021, 0x00c8, 0x5cd8, 0x2071, 0x7498, 0x831c,
- 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6128, 0x0078, 0x5cfa,
- 0x6838, 0xd0fc, 0x0040, 0x5ce1, 0x2009, 0x0020, 0x695a, 0x0078,
- 0x5ccd, 0x0f7e, 0x2d78, 0x1078, 0x60c0, 0x0f7f, 0x1078, 0x6115,
- 0x0078, 0x5cfc, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0x684c,
- 0xd0ac, 0x0040, 0x5cfa, 0x6810, 0x6914, 0xa115, 0x0040, 0x5cfa,
- 0x1078, 0x5e6e, 0x1078, 0x3840, 0x6218, 0x2268, 0x6a3c, 0x8211,
- 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x56f5, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x748c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
- 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x45ce, 0x1078, 0x4a67, 0x007c, 0x6003, 0x0004,
- 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x5d2d, 0x5d3d, 0x5d3d, 0x5d3d,
- 0x5d3d, 0x5d3d, 0x5d3f, 0x5dd6, 0x5d3d, 0x5d3d, 0x5dec, 0x5e4e,
- 0x5d3d, 0x5d3d, 0x5d3d, 0x5d3d, 0x5e55, 0x1078, 0x1288, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x748c, 0x6110, 0x2178, 0x7614,
- 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5dd1, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x5d60, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x5dd1, 0x1078, 0x12e2, 0x1040, 0x1288,
- 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837, 0x0103, 0x7838,
- 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x5d9a, 0xa186, 0x0028, 0x00c0, 0x5d84,
- 0x684b, 0x001c, 0x0078, 0x5d9c, 0xd6dc, 0x0040, 0x5d8f, 0x684b,
- 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5d9c, 0xd6d4,
- 0x0040, 0x5d9a, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e,
- 0x0078, 0x5d9c, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854,
- 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5db1, 0x7328, 0x732c, 0x6b56,
- 0x037e, 0x2308, 0x2019, 0x7498, 0xad90, 0x0019, 0x1078, 0x6128,
- 0x037f, 0xd6cc, 0x0040, 0x5dd1, 0x7124, 0x695a, 0xa192, 0x0021,
- 0x00c8, 0x5dc5, 0x2071, 0x7498, 0x831c, 0x2300, 0xae18, 0xad90,
- 0x001d, 0x1078, 0x6128, 0x0078, 0x5dd1, 0x7838, 0xd0fc, 0x0040,
- 0x5dce, 0x2009, 0x0020, 0x695a, 0x0078, 0x5dba, 0x2d78, 0x1078,
- 0x60c0, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e, 0x6003,
- 0x0003, 0x2079, 0x748c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6010,
- 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10, 0x1078,
- 0x1936, 0x1078, 0x5095, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x1078,
- 0x4966, 0x1078, 0x4a67, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040,
- 0x5e4c, 0xd1cc, 0x0040, 0x5e27, 0x6948, 0x6838, 0xd0fc, 0x0040,
- 0x5e1f, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d,
- 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012,
- 0x8318, 0x8210, 0x00f0, 0x5e0e, 0x157f, 0x007f, 0x6852, 0x007f,
- 0x684e, 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5e4a, 0x017e,
- 0x1078, 0x130b, 0x0d7f, 0x1078, 0x6115, 0x0078, 0x5e4a, 0x6837,
- 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5e46,
- 0xa086, 0x0028, 0x00c0, 0x5e38, 0x684b, 0x001c, 0x0078, 0x5e48,
- 0xd1dc, 0x0040, 0x5e3f, 0x684b, 0x0015, 0x0078, 0x5e48, 0xd1d4,
- 0x0040, 0x5e46, 0x684b, 0x0007, 0x0078, 0x5e48, 0x684b, 0x0000,
- 0x1078, 0x3840, 0x1078, 0x56f5, 0x0d7f, 0x007c, 0x6003, 0x0002,
- 0x1078, 0x4966, 0x1078, 0x4a67, 0x007c, 0x1078, 0x4966, 0x1078,
- 0x21a8, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6336, 0x0040, 0x5e68,
- 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3840, 0x1078, 0x644a,
- 0x0d7f, 0x1078, 0x56f5, 0x1078, 0x4a67, 0x007c, 0x684b, 0x0015,
- 0xd1fc, 0x0040, 0x5e7a, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a,
- 0xa189, 0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x5e81, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e93, 0x5e91,
- 0x5f37, 0x5f3f, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e91, 0x5e91,
- 0x5e91, 0x1078, 0x1288, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x748c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x5f29, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5eb4,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5f26,
- 0x1078, 0x12e2, 0x1040, 0x1288, 0x2d00, 0x784a, 0x7f4c, 0xa7bd,
- 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e,
- 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
- 0x5eef, 0xa186, 0x0028, 0x00c0, 0x5ed9, 0x684b, 0x001c, 0x0078,
- 0x5ef1, 0xd6dc, 0x0040, 0x5ee4, 0x684b, 0x0015, 0x7318, 0x6b62,
- 0x731c, 0x6b5e, 0x0078, 0x5ef1, 0xd6d4, 0x0040, 0x5eef, 0x684b,
- 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5ef1, 0x684b,
- 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4,
- 0x0040, 0x5f06, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
- 0x7498, 0xad90, 0x0019, 0x1078, 0x6128, 0x037f, 0xd6cc, 0x0040,
- 0x5f26, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5f1a, 0x2071,
- 0x7498, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x6128,
- 0x0078, 0x5f26, 0x7838, 0xd0fc, 0x0040, 0x5f23, 0x2009, 0x0020,
- 0x695a, 0x0078, 0x5f0f, 0x2d78, 0x1078, 0x60c0, 0xd6dc, 0x00c0,
- 0x5f2c, 0xa006, 0x0078, 0x5f30, 0x2001, 0x0001, 0x7218, 0x731c,
- 0x1078, 0x1569, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x007c, 0x0d7e,
- 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x5fa6,
- 0xd1cc, 0x0040, 0x5f76, 0x6948, 0x6838, 0xd0fc, 0x0040, 0x5f6e,
- 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90, 0x000d, 0xa198,
- 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x5f5d, 0x157f, 0x007f, 0x6852, 0x007f, 0x684e,
- 0x017f, 0x2168, 0x1078, 0x130b, 0x0078, 0x5fa4, 0x017e, 0x1078,
- 0x130b, 0x0d7f, 0x1078, 0x6115, 0x0078, 0x5fa4, 0x6837, 0x0103,
- 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5f95, 0xa086,
- 0x0028, 0x00c0, 0x5f87, 0x684b, 0x001c, 0x0078, 0x5fa2, 0xd1dc,
- 0x0040, 0x5f8e, 0x684b, 0x0015, 0x0078, 0x5fa2, 0xd1d4, 0x0040,
- 0x5f95, 0x684b, 0x0007, 0x0078, 0x5fa2, 0x684b, 0x0000, 0x684c,
- 0xd0ac, 0x0040, 0x5fa2, 0x6810, 0x6914, 0xa115, 0x0040, 0x5fa2,
- 0x1078, 0x5e6e, 0x1078, 0x3840, 0x1078, 0x56f5, 0x0d7f, 0x007c,
- 0x1078, 0x48be, 0x0078, 0x5fae, 0x1078, 0x4966, 0x1078, 0x6336,
- 0x0040, 0x5fc5, 0x0d7e, 0x6110, 0x2168, 0x6837, 0x0103, 0x2009,
- 0x700c, 0x210c, 0xd18c, 0x00c0, 0x5fce, 0xd184, 0x00c0, 0x5fca,
- 0x6108, 0x694a, 0x1078, 0x3840, 0x0d7f, 0x1078, 0x56f5, 0x1078,
- 0x49b7, 0x007c, 0x684b, 0x0004, 0x0078, 0x5fc2, 0x684b, 0x0004,
- 0x0078, 0x5fc2, 0xa182, 0x0040, 0x0079, 0x5fd6, 0x5fe6, 0x5fe6,
- 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe8, 0x5fe6, 0x5feb, 0x5fe6, 0x5fe6,
- 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe6, 0x5fe6, 0x1078, 0x1288,
- 0x1078, 0x56f5, 0x007c, 0x007e, 0x027e, 0xa016, 0x1078, 0x1525,
- 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079, 0x5ff7, 0x6000,
- 0x5ffe, 0x5ffe, 0x5ffe, 0x5ffe, 0x5ffe, 0x5ffe, 0x1078, 0x1288,
- 0x6003, 0x0001, 0x6106, 0x1078, 0x4562, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x49b7, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6016,
- 0x6004, 0xa082, 0x0085, 0x2008, 0x0079, 0x604a, 0xa186, 0x0027,
- 0x00c0, 0x6037, 0x1078, 0x48be, 0x1078, 0x21a8, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6336, 0x0040, 0x602d, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3840, 0x1078, 0x644a, 0x0d7f, 0x1078, 0x56f5,
- 0x1078, 0x49b7, 0x007c, 0x1078, 0x5729, 0x0078, 0x6032, 0xa186,
- 0x0014, 0x00c0, 0x6033, 0x1078, 0x48be, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6336, 0x0040, 0x602d, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x0078, 0x6029, 0x6053, 0x6051, 0x6051, 0x6051, 0x6051, 0x6051,
- 0x605c, 0x1078, 0x1288, 0x1078, 0x48be, 0x6017, 0x0014, 0x6003,
- 0x000c, 0x1078, 0x49b7, 0x007c, 0x1078, 0x48be, 0x6017, 0x0014,
- 0x6003, 0x000e, 0x1078, 0x49b7, 0x007c, 0xa182, 0x008c, 0x00c8,
- 0x606f, 0xa182, 0x0085, 0x0048, 0x606f, 0x0079, 0x6072, 0x1078,
- 0x5729, 0x007c, 0x6079, 0x6079, 0x6079, 0x6079, 0x607b, 0x609a,
- 0x6079, 0x1078, 0x1288, 0x0d7e, 0x1078, 0x644a, 0x1078, 0x6336,
- 0x0040, 0x6096, 0x6010, 0x2068, 0x6837, 0x0103, 0x6850, 0xd0b4,
- 0x0040, 0x608e, 0x684b, 0x0006, 0x0078, 0x6092, 0x684b, 0x0005,
- 0x1078, 0x64fd, 0x6847, 0x0000, 0x1078, 0x3840, 0x1078, 0x56f5,
- 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040,
- 0x60b5, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x60ab, 0x684b,
- 0x0006, 0x0078, 0x60af, 0x684b, 0x0005, 0x1078, 0x64fd, 0x6847,
- 0x0000, 0x1078, 0x3840, 0x1078, 0x644a, 0x0d7f, 0x1078, 0x56f5,
- 0x007c, 0x1078, 0x48be, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c,
- 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001, 0xa182, 0x0101,
- 0x00c8, 0x60cc, 0x0078, 0x60ce, 0x2009, 0x0100, 0x2130, 0x2069,
- 0x7498, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020, 0xaf90, 0x001d,
- 0x1078, 0x6128, 0xa6b2, 0x0020, 0x7804, 0xa06d, 0x0040, 0x60e2,
- 0x1078, 0x130b, 0x1078, 0x12e2, 0x0040, 0x610c, 0x8528, 0x6837,
- 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a, 0x003d, 0x00c8,
- 0x60f8, 0x2608, 0xad90, 0x000f, 0x1078, 0x6128, 0x0078, 0x610c,
- 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90, 0x000f, 0x1078,
- 0x6128, 0x0078, 0x60e2, 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36,
- 0xa5ac, 0x0000, 0x0078, 0x6111, 0x0f7f, 0x852f, 0xa5ad, 0x0003,
- 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e, 0x8dff, 0x0040,
- 0x6126, 0x6804, 0xa07d, 0x0040, 0x6124, 0x6807, 0x0000, 0x1078,
- 0x3840, 0x2f68, 0x0078, 0x6119, 0x1078, 0x3840, 0x0f7f, 0x007c,
- 0x157e, 0xa184, 0x0001, 0x0040, 0x612e, 0x8108, 0x810c, 0x21a8,
- 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6130, 0x157f,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084, 0x0007, 0x1079,
- 0x6143, 0x127f, 0x007c, 0x6152, 0x614b, 0x614d, 0x616b, 0x614b,
- 0x614d, 0x614d, 0x614d, 0x1078, 0x1288, 0xa006, 0x007c, 0xa085,
- 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040,
- 0x6168, 0xa00e, 0x2001, 0x0005, 0x1078, 0x38d0, 0x1078, 0x64fd,
- 0x1078, 0x3840, 0x1078, 0x56f5, 0xa085, 0x0001, 0x0d7f, 0x007c,
- 0xa006, 0x0078, 0x6166, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288,
- 0x1079, 0x6173, 0x007c, 0x6183, 0x61a0, 0x6185, 0x61b1, 0x619c,
- 0x6183, 0x614d, 0x6152, 0x6152, 0x614d, 0x614d, 0x614d, 0x614d,
- 0x614d, 0x614d, 0x614d, 0x1078, 0x1288, 0x0d7e, 0x6010, 0x2068,
- 0x1078, 0x6336, 0x0040, 0x618e, 0x1078, 0x64fd, 0x0d7f, 0x6007,
- 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, 0x4562, 0x1078,
- 0x49b7, 0xa085, 0x0001, 0x007c, 0x1078, 0x1629, 0x0078, 0x6185,
- 0x0e7e, 0x2071, 0x71b6, 0x7024, 0xac06, 0x00c0, 0x61a9, 0x1078,
- 0x51c9, 0x1078, 0x5139, 0x0e7f, 0x00c0, 0x6185, 0x1078, 0x614d,
- 0x007c, 0x037e, 0x0e7e, 0x2071, 0x71b6, 0x703c, 0xac06, 0x00c0,
- 0x61c1, 0x2019, 0x0000, 0x1078, 0x525b, 0x0e7f, 0x037f, 0x0078,
- 0x6185, 0x1078, 0x5537, 0x0e7f, 0x037f, 0x00c0, 0x6185, 0x1078,
- 0x614d, 0x007c, 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x61d2,
- 0x0c7f, 0x007c, 0x61e0, 0x623d, 0x62da, 0x61e4, 0x61e0, 0x61e0,
- 0x6b6f, 0x56f5, 0x1078, 0x6484, 0x00c0, 0x61e0, 0x1078, 0x58f2,
+ 0x54f2, 0x6018, 0x2068, 0x7038, 0x680a, 0x703c, 0x680e, 0x6800,
+ 0xc08d, 0x6802, 0x0d7f, 0x0078, 0x54cf, 0x2100, 0xa1b2, 0x002a,
+ 0x10c8, 0x126a, 0x0079, 0x54fc, 0x5528, 0x5534, 0x5528, 0x5528,
+ 0x5528, 0x5528, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5528, 0x5526, 0x5526, 0x5526, 0x5526,
+ 0x5526, 0x5526, 0x5526, 0x5526, 0x5528, 0x5526, 0x1078, 0x126a,
+ 0x6003, 0x0001, 0x6106, 0x1078, 0x4311, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x4713, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078,
+ 0x4311, 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f, 0x007c,
+ 0x6004, 0xa0b2, 0x002a, 0x10c8, 0x126a, 0xa1b6, 0x0013, 0x00c0,
+ 0x554c, 0x2008, 0x0079, 0x55a2, 0xa1b6, 0x0027, 0x00c0, 0x558a,
+ 0x1078, 0x461a, 0x6004, 0x1078, 0x6101, 0x0040, 0x555d, 0x1078,
+ 0x6115, 0x0040, 0x5586, 0x0078, 0x5581, 0x1078, 0x2143, 0x2001,
+ 0x0007, 0x1078, 0x3316, 0x6018, 0xa080, 0x0028, 0x200c, 0x017e,
+ 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078, 0x43ff, 0x1078,
+ 0x4344, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x5578, 0x1078, 0x34f2,
+ 0x0c7f, 0x2c08, 0x1078, 0x6946, 0x037f, 0x027f, 0x017f, 0x1078,
+ 0x3352, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x1078, 0x5614,
+ 0x0078, 0x5581, 0xa186, 0x0014, 0x1078, 0x461a, 0x1078, 0x2125,
+ 0x1078, 0x6101, 0x00c0, 0x5598, 0x1078, 0x2143, 0x0078, 0x5581,
+ 0x1078, 0x6115, 0x00c0, 0x55a0, 0x1078, 0x5614, 0x0078, 0x5581,
+ 0x0078, 0x5581, 0x55ce, 0x55d0, 0x55d4, 0x55d8, 0x55dc, 0x55e0,
+ 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55e4, 0x55ea, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc, 0x55cc,
+ 0x55cc, 0x55cc, 0x55ea, 0x55ea, 0x1078, 0x126a, 0x0078, 0x55ea,
+ 0x2001, 0x000b, 0x0078, 0x55f3, 0x2001, 0x0003, 0x0078, 0x55f3,
+ 0x2001, 0x0005, 0x0078, 0x55f3, 0x2001, 0x0001, 0x0078, 0x55f3,
+ 0x2001, 0x0009, 0x0078, 0x55f3, 0x1078, 0x126a, 0x0078, 0x55f2,
+ 0x1078, 0x3316, 0x1078, 0x461a, 0x6003, 0x0002, 0x6017, 0x0028,
+ 0x1078, 0x4713, 0x007c, 0x1078, 0x3316, 0x1078, 0x461a, 0x6003,
+ 0x0002, 0x037e, 0x2019, 0x6c5c, 0x2304, 0xa084, 0xff00, 0x00c0,
+ 0x5605, 0x2019, 0x0028, 0x0078, 0x560e, 0x8007, 0xa09a, 0x0004,
+ 0x0048, 0x5601, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f,
+ 0x1078, 0x4713, 0x0078, 0x55f2, 0x0e7e, 0x1078, 0x5fcd, 0x0040,
+ 0x5621, 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033,
+ 0x0100, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084,
+ 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x126a, 0x6604, 0xa6b6,
+ 0x0028, 0x00c0, 0x5637, 0x1078, 0x614a, 0x0078, 0x5660, 0x6604,
+ 0xa6b6, 0x0029, 0x00c0, 0x5640, 0x1078, 0x6164, 0x0078, 0x5660,
+ 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x5649, 0x1078, 0x54b5, 0x0078,
+ 0x5660, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x5652, 0x1078, 0x54de,
+ 0x0078, 0x5660, 0xa1b6, 0x0015, 0x00c0, 0x565a, 0x1079, 0x5665,
+ 0x0078, 0x5660, 0xa1b6, 0x0016, 0x00c0, 0x5661, 0x1079, 0x572e,
+ 0x007c, 0x1078, 0x5459, 0x0078, 0x5660, 0x5671, 0x5674, 0x5671,
+ 0x56b5, 0x5671, 0x56dd, 0x5671, 0x5671, 0x5671, 0x5706, 0x5671,
+ 0x571c, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6c00, 0x7070,
+ 0xa086, 0x0074, 0x00c0, 0x569e, 0x1078, 0x691e, 0x00c0, 0x5690,
+ 0x0d7e, 0x6018, 0x2068, 0x1078, 0x56a2, 0x0d7f, 0x2001, 0x0006,
+ 0x1078, 0x3316, 0x1078, 0x2143, 0x1078, 0x5425, 0x0078, 0x56a0,
+ 0x2001, 0x000a, 0x1078, 0x3316, 0x1078, 0x2143, 0x6003, 0x0001,
+ 0x6007, 0x0001, 0x1078, 0x4311, 0x0078, 0x56a0, 0x1078, 0x56cd,
+ 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x56b4, 0x2001, 0x0000,
+ 0x1078, 0x3302, 0x2069, 0x6c51, 0x6804, 0xd0a4, 0x0040, 0x56b4,
+ 0x2001, 0x0006, 0x1078, 0x3324, 0x007c, 0x2011, 0x6c1c, 0x2204,
+ 0xa086, 0x0074, 0x00c0, 0x56ca, 0x1078, 0x57f7, 0x2001, 0x0004,
+ 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4311,
+ 0x0078, 0x56cc, 0x1078, 0x56cd, 0x007c, 0x2001, 0x6c00, 0x2004,
+ 0xa086, 0x0003, 0x0040, 0x56d8, 0x2001, 0x0007, 0x1078, 0x3316,
+ 0x1078, 0x5425, 0x1078, 0x2143, 0x007c, 0x0e7e, 0x2071, 0x6c00,
+ 0x7070, 0xa086, 0x0014, 0x00c0, 0x5702, 0x7000, 0xa086, 0x0003,
+ 0x00c0, 0x56ec, 0x1078, 0x29a0, 0x0d7e, 0x6018, 0x2068, 0x1078,
+ 0x33ed, 0x1078, 0x56a2, 0x0d7f, 0x1078, 0x5801, 0x00c0, 0x5702,
+ 0x2001, 0x0006, 0x1078, 0x3316, 0x1078, 0x5425, 0x1078, 0x2143,
+ 0x0078, 0x5704, 0x1078, 0x56cd, 0x0e7f, 0x007c, 0x2011, 0x6c1c,
+ 0x2204, 0xa086, 0x0014, 0x00c0, 0x5719, 0x2001, 0x0002, 0x1078,
+ 0x3316, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4311, 0x0078,
+ 0x571b, 0x1078, 0x56cd, 0x007c, 0x2011, 0x6c1c, 0x2204, 0xa086,
+ 0x0004, 0x00c0, 0x572b, 0x2001, 0x0007, 0x1078, 0x3316, 0x1078,
+ 0x5425, 0x0078, 0x572d, 0x1078, 0x56cd, 0x007c, 0x5671, 0x573a,
+ 0x5671, 0x5760, 0x5671, 0x57ac, 0x5671, 0x5671, 0x5671, 0x57bf,
+ 0x5671, 0x57d2, 0x0c7e, 0x1078, 0x57e5, 0x00c0, 0x574f, 0x2001,
+ 0x0000, 0x1078, 0x3302, 0x2001, 0x0002, 0x1078, 0x3316, 0x6003,
+ 0x0001, 0x6007, 0x0002, 0x1078, 0x4311, 0x0078, 0x575e, 0x2009,
+ 0x708f, 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x575c,
+ 0x1078, 0x5425, 0x0078, 0x575e, 0x1078, 0x56cd, 0x0c7f, 0x007c,
+ 0x1078, 0x57f4, 0x00c0, 0x5774, 0x2001, 0x0000, 0x1078, 0x3302,
+ 0x2001, 0x0002, 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4311, 0x0078, 0x5794, 0x2009, 0x708e, 0x2134, 0xa6b4,
+ 0x00ff, 0xa686, 0x0005, 0x0040, 0x5795, 0x2009, 0x708f, 0x2104,
+ 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5792, 0xa686, 0x0009,
+ 0x0040, 0x5795, 0x2001, 0x0004, 0x1078, 0x3316, 0x1078, 0x5425,
+ 0x0078, 0x5794, 0x1078, 0x56cd, 0x007c, 0x0d7e, 0x6018, 0x2068,
+ 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x57a7, 0x8001, 0x6842,
+ 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x5794, 0x1078,
+ 0x2125, 0x0d7f, 0x0078, 0x5792, 0x1078, 0x57f4, 0x00c0, 0x57bc,
+ 0x2001, 0x0004, 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0003,
+ 0x1078, 0x4311, 0x0078, 0x57be, 0x1078, 0x56cd, 0x007c, 0x1078,
+ 0x57f4, 0x00c0, 0x57cf, 0x2001, 0x0008, 0x1078, 0x3316, 0x6003,
+ 0x0001, 0x6007, 0x0005, 0x1078, 0x4311, 0x0078, 0x57d1, 0x1078,
+ 0x56cd, 0x007c, 0x1078, 0x57f4, 0x00c0, 0x57e2, 0x2001, 0x000a,
+ 0x1078, 0x3316, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4311,
+ 0x0078, 0x57e4, 0x1078, 0x56cd, 0x007c, 0x2009, 0x708e, 0x2104,
+ 0xa086, 0x0003, 0x00c0, 0x57f3, 0x2009, 0x708f, 0x2104, 0xa084,
+ 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e,
+ 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x337c, 0x017f, 0x0c7f,
+ 0x007c, 0x0e7e, 0x2071, 0x708c, 0x7004, 0xa086, 0x0014, 0x00c0,
+ 0x5824, 0x7008, 0xa086, 0x0800, 0x00c0, 0x5824, 0x700c, 0xd0ec,
+ 0x0040, 0x5822, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x5822,
+ 0x7024, 0xd0a4, 0x0040, 0x5822, 0xd08c, 0x0040, 0x5822, 0xa006,
+ 0x0078, 0x5824, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e,
+ 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x6db9, 0x252c, 0x2021, 0x6dbf, 0x2424, 0x2061,
+ 0x7200, 0x2071, 0x6c00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x587b,
+ 0x1078, 0x6b22, 0x0040, 0x5873, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x5873, 0xa786, 0x0007, 0x0040, 0x5873, 0x2500, 0xac06, 0x0040,
+ 0x5873, 0x2400, 0xac06, 0x0040, 0x5873, 0x0c7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x585d, 0x1078, 0x15fc, 0x6010, 0x2068, 0x1078,
+ 0x5fcd, 0x0040, 0x5870, 0xa786, 0x0003, 0x00c0, 0x5885, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db,
+ 0x1078, 0x60e8, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x587b, 0x0078, 0x583b, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x5867, 0x1078, 0x6ac6, 0x0078, 0x5870, 0x220c, 0x2304, 0xa106,
+ 0x00c0, 0x5898, 0x8210, 0x8318, 0x00f0, 0x588d, 0xa006, 0x007c,
+ 0x2304, 0xa102, 0x0048, 0x58a0, 0x2001, 0x0001, 0x0078, 0x58a2,
+ 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x002a,
+ 0x10c8, 0x126a, 0x1078, 0x6101, 0x0040, 0x58b4, 0x1078, 0x6115,
+ 0x0040, 0x58bd, 0x0078, 0x58b6, 0x1078, 0x2143, 0x1078, 0x461a,
+ 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x1078, 0x5614, 0x0078,
+ 0x58b6, 0xa182, 0x0040, 0x0079, 0x58c5, 0x58d5, 0x58d5, 0x58d5,
+ 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5, 0x58d5,
+ 0x58d7, 0x58d7, 0x58d7, 0x58d7, 0x58d5, 0x1078, 0x126a, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x42c4, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4713, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x58ec, 0x6004,
+ 0xa082, 0x0040, 0x0079, 0x5942, 0xa186, 0x0027, 0x00c0, 0x5909,
+ 0x1078, 0x461a, 0x1078, 0x2125, 0x0d7e, 0x6110, 0x2168, 0x1078,
+ 0x5fcd, 0x0040, 0x5903, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078,
+ 0x35c4, 0x1078, 0x60db, 0x0d7f, 0x1078, 0x5425, 0x1078, 0x4713,
+ 0x007c, 0xa186, 0x0014, 0x10c0, 0x126a, 0x6004, 0xa082, 0x0040,
+ 0x0079, 0x5912, 0x5924, 0x5922, 0x5922, 0x5922, 0x5922, 0x5922,
+ 0x5922, 0x5922, 0x5922, 0x5922, 0x5922, 0x593b, 0x593b, 0x593b,
+ 0x593b, 0x5922, 0x1078, 0x126a, 0x1078, 0x461a, 0x0d7e, 0x6110,
+ 0x2168, 0x1078, 0x5fcd, 0x0040, 0x5935, 0x6837, 0x0103, 0x684b,
+ 0x0006, 0x1078, 0x35c4, 0x1078, 0x60db, 0x0d7f, 0x1078, 0x5425,
+ 0x1078, 0x4713, 0x007c, 0x1078, 0x461a, 0x1078, 0x5425, 0x1078,
+ 0x4713, 0x007c, 0x5954, 0x5952, 0x5952, 0x5952, 0x5952, 0x5952,
+ 0x5952, 0x5952, 0x5952, 0x5952, 0x5952, 0x5962, 0x5962, 0x5962,
+ 0x5962, 0x5952, 0x1078, 0x126a, 0x1078, 0x461a, 0x6003, 0x0002,
+ 0x1078, 0x4713, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400,
+ 0x200a, 0x007c, 0x1078, 0x461a, 0x6003, 0x000f, 0x1078, 0x4713,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x596d, 0x597d, 0x597d, 0x597d,
+ 0x597d, 0x597d, 0x597f, 0x5a08, 0x5a20, 0x597d, 0x597d, 0x597d,
+ 0x597d, 0x597d, 0x597d, 0x597d, 0x597d, 0x1078, 0x126a, 0x0e7e,
+ 0x0d7e, 0x2071, 0x708c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff,
+ 0x86ff, 0x0040, 0x59ec, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
+ 0x59b1, 0xa186, 0x0028, 0x00c0, 0x599b, 0x1078, 0x60ef, 0x684b,
+ 0x001c, 0x0078, 0x59b3, 0xd6dc, 0x0040, 0x59a6, 0x684b, 0x0015,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x59b3, 0xd6d4, 0x0040,
+ 0x59b1, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x59b3, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4,
+ 0x0040, 0x59c6, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
+ 0x7098, 0xad90, 0x0019, 0x1078, 0x5dd2, 0x037f, 0xd6cc, 0x0040,
+ 0x59fc, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x59da, 0x2071,
+ 0x7098, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x5dd2,
+ 0x0078, 0x59fc, 0x6838, 0xd0fc, 0x0040, 0x59e3, 0x2009, 0x0020,
+ 0x695a, 0x0078, 0x59cf, 0x0f7e, 0x2d78, 0x1078, 0x5d6a, 0x0f7f,
+ 0x1078, 0x5dbf, 0x0078, 0x59fe, 0x684b, 0x0000, 0x6837, 0x0103,
+ 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x59fc, 0x6810, 0x6914, 0xa115,
+ 0x0040, 0x59fc, 0x1078, 0x5b45, 0x1078, 0x35c4, 0x6218, 0x2268,
+ 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x5425, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x708c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x18d5, 0x1078, 0x4330, 0x1078, 0x47c3, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1505, 0x007c, 0xa182, 0x0040, 0x0079, 0x5a2f, 0x5a3f,
+ 0x5a3f, 0x5a3f, 0x5a3f, 0x5a3f, 0x5a41, 0x5acf, 0x5a3f, 0x5a3f,
+ 0x5ae5, 0x5b25, 0x5a3f, 0x5a3f, 0x5a3f, 0x5a3f, 0x5b2c, 0x1078,
+ 0x126a, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x708c, 0x6110,
+ 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e,
+ 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5aca,
+ 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5a62, 0x7018, 0x7862,
+ 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5aca, 0x1078, 0x12c2,
+ 0x1040, 0x126a, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837,
+ 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46,
+ 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5a9c, 0xa186, 0x0028,
+ 0x00c0, 0x5a86, 0x684b, 0x001c, 0x0078, 0x5a9e, 0xd6dc, 0x0040,
+ 0x5a91, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5a9e, 0xd6d4, 0x0040, 0x5a9c, 0x684b, 0x0007, 0x7318, 0x6b62,
+ 0x731c, 0x6b5e, 0x0078, 0x5a9e, 0x684b, 0x0000, 0x6f4e, 0x7850,
+ 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5ab3, 0x7328,
+ 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7098, 0xad90, 0x0019,
+ 0x1078, 0x5dd2, 0x037f, 0xd6cc, 0x0040, 0x5aca, 0x7124, 0x695a,
+ 0xa192, 0x0021, 0x00c8, 0x5ac7, 0x2071, 0x7098, 0x831c, 0x2300,
+ 0xae18, 0xad90, 0x001d, 0x1078, 0x5dd2, 0x0078, 0x5aca, 0x2d78,
+ 0x1078, 0x5d6a, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x0f7e,
+ 0x6003, 0x0003, 0x2079, 0x708c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
+ 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f, 0x2c10,
+ 0x1078, 0x18d5, 0x1078, 0x4dfc, 0x007c, 0x0d7e, 0x6003, 0x0002,
+ 0x1078, 0x46c2, 0x1078, 0x47c3, 0x6110, 0x2168, 0x694c, 0xd1e4,
+ 0x0040, 0x5b23, 0xd1cc, 0x0040, 0x5afe, 0x6948, 0x017e, 0x1078,
+ 0x12eb, 0x0d7f, 0x1078, 0x5dbf, 0x0078, 0x5b21, 0x6837, 0x0103,
+ 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5b1d, 0xa086,
+ 0x0028, 0x00c0, 0x5b0f, 0x684b, 0x001c, 0x0078, 0x5b1f, 0xd1dc,
+ 0x0040, 0x5b16, 0x684b, 0x0015, 0x0078, 0x5b1f, 0xd1d4, 0x0040,
+ 0x5b1d, 0x684b, 0x0007, 0x0078, 0x5b1f, 0x684b, 0x0000, 0x1078,
+ 0x35c4, 0x1078, 0x5425, 0x0d7f, 0x007c, 0x6003, 0x0002, 0x1078,
+ 0x46c2, 0x1078, 0x47c3, 0x007c, 0x1078, 0x46c2, 0x1078, 0x2125,
+ 0x0d7e, 0x6110, 0x2168, 0x1078, 0x5fcd, 0x0040, 0x5b3f, 0x6837,
+ 0x0103, 0x684b, 0x0029, 0x1078, 0x35c4, 0x1078, 0x60db, 0x0d7f,
+ 0x1078, 0x5425, 0x1078, 0x47c3, 0x007c, 0x684b, 0x0015, 0xd1fc,
+ 0x0040, 0x5b51, 0x684b, 0x0007, 0x8002, 0x8000, 0x810a, 0xa189,
+ 0x0000, 0x6962, 0x685e, 0x007c, 0xa182, 0x0040, 0x0079, 0x5b58,
+ 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b6a, 0x5b68, 0x5c05,
+ 0x5c0d, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68, 0x5b68,
+ 0x1078, 0x126a, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x708c,
+ 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5,
+ 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040,
+ 0x5bf7, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5b8b, 0x7018,
+ 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5bf4, 0x1078,
+ 0x12c2, 0x1040, 0x126a, 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200,
+ 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840,
+ 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5bc6,
+ 0xa186, 0x0028, 0x00c0, 0x5bb0, 0x684b, 0x001c, 0x0078, 0x5bc8,
+ 0xd6dc, 0x0040, 0x5bbb, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c,
+ 0x6b5e, 0x0078, 0x5bc8, 0xd6d4, 0x0040, 0x5bc6, 0x684b, 0x0007,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5bc8, 0x684b, 0x0000,
+ 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040,
+ 0x5bdd, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7098,
+ 0xad90, 0x0019, 0x1078, 0x5dd2, 0x037f, 0xd6cc, 0x0040, 0x5bf4,
+ 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5bf1, 0x2071, 0x7098,
+ 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x5dd2, 0x0078,
+ 0x5bf4, 0x2d78, 0x1078, 0x5d6a, 0xd6dc, 0x00c0, 0x5bfa, 0xa006,
+ 0x0078, 0x5bfe, 0x2001, 0x0001, 0x7218, 0x731c, 0x1078, 0x1542,
+ 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18,
+ 0x3e20, 0x2c10, 0x1078, 0x1505, 0x007c, 0x0d7e, 0x6003, 0x0002,
+ 0x6110, 0x2168, 0x694c, 0xd1e4, 0x0040, 0x5c52, 0xd1cc, 0x0040,
+ 0x5c22, 0x6948, 0x017e, 0x1078, 0x12eb, 0x0d7f, 0x1078, 0x5dbf,
+ 0x0078, 0x5c50, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186,
+ 0x0002, 0x0040, 0x5c41, 0xa086, 0x0028, 0x00c0, 0x5c33, 0x684b,
+ 0x001c, 0x0078, 0x5c4e, 0xd1dc, 0x0040, 0x5c3a, 0x684b, 0x0015,
+ 0x0078, 0x5c4e, 0xd1d4, 0x0040, 0x5c41, 0x684b, 0x0007, 0x0078,
+ 0x5c4e, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0040, 0x5c4e, 0x6810,
+ 0x6914, 0xa115, 0x0040, 0x5c4e, 0x1078, 0x5b45, 0x1078, 0x35c4,
+ 0x1078, 0x5425, 0x0d7f, 0x007c, 0x1078, 0x461a, 0x0078, 0x5c5a,
+ 0x1078, 0x46c2, 0x1078, 0x5fcd, 0x0040, 0x5c71, 0x0d7e, 0x6110,
+ 0x2168, 0x6837, 0x0103, 0x2009, 0x6c0c, 0x210c, 0xd18c, 0x00c0,
+ 0x5c7a, 0xd184, 0x00c0, 0x5c76, 0x6108, 0x694a, 0x1078, 0x35c4,
+ 0x0d7f, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x684b, 0x0004,
+ 0x0078, 0x5c6e, 0x684b, 0x0004, 0x0078, 0x5c6e, 0xa182, 0x0040,
+ 0x0079, 0x5c82, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c94,
+ 0x5c92, 0x5c97, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c92, 0x5c92,
+ 0x5c92, 0x5c92, 0x1078, 0x126a, 0x1078, 0x5425, 0x007c, 0x007e,
+ 0x027e, 0xa016, 0x1078, 0x1505, 0x027f, 0x007f, 0x007c, 0xa182,
+ 0x0085, 0x0079, 0x5ca3, 0x5cac, 0x5caa, 0x5caa, 0x5caa, 0x5caa,
+ 0x5caa, 0x5caa, 0x1078, 0x126a, 0x6003, 0x0001, 0x6106, 0x1078,
+ 0x42c4, 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f, 0x007c,
+ 0xa186, 0x0013, 0x00c0, 0x5cc2, 0x6004, 0xa082, 0x0085, 0x2008,
+ 0x0079, 0x5cf6, 0xa186, 0x0027, 0x00c0, 0x5ce3, 0x1078, 0x461a,
+ 0x1078, 0x2125, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040,
+ 0x5cd9, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x35c4, 0x1078,
+ 0x60db, 0x0d7f, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x1078,
+ 0x5459, 0x0078, 0x5cde, 0xa186, 0x0014, 0x00c0, 0x5cdf, 0x1078,
+ 0x461a, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x5fcd, 0x0040, 0x5cd9,
+ 0x6837, 0x0103, 0x684b, 0x0006, 0x0078, 0x5cd5, 0x5cff, 0x5cfd,
+ 0x5cfd, 0x5cfd, 0x5cfd, 0x5cfd, 0x5d08, 0x1078, 0x126a, 0x1078,
+ 0x461a, 0x6017, 0x0014, 0x6003, 0x000c, 0x1078, 0x4713, 0x007c,
+ 0x1078, 0x461a, 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x4713,
+ 0x007c, 0xa182, 0x008c, 0x00c8, 0x5d1b, 0xa182, 0x0085, 0x0048,
+ 0x5d1b, 0x0079, 0x5d1e, 0x1078, 0x5459, 0x007c, 0x5d25, 0x5d25,
+ 0x5d25, 0x5d25, 0x5d27, 0x5d45, 0x5d25, 0x1078, 0x126a, 0x0d7e,
+ 0x1078, 0x60db, 0x1078, 0x5fcd, 0x0040, 0x5d41, 0x6010, 0x2068,
+ 0x6837, 0x0103, 0x6850, 0xa084, 0x0040, 0x0040, 0x5d3b, 0x684b,
+ 0x0006, 0x0078, 0x5d3d, 0x684b, 0x0005, 0x6847, 0x0000, 0x1078,
+ 0x35c4, 0x1078, 0x5425, 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068,
+ 0x1078, 0x5fcd, 0x0040, 0x5d5f, 0x6837, 0x0103, 0x6850, 0xa084,
+ 0x0040, 0x0040, 0x5d57, 0x684b, 0x0006, 0x0078, 0x5d59, 0x684b,
+ 0x0005, 0x6847, 0x0000, 0x1078, 0x35c4, 0x1078, 0x60db, 0x0d7f,
+ 0x1078, 0x5425, 0x007c, 0x1078, 0x461a, 0x1078, 0x5425, 0x1078,
+ 0x4713, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001,
+ 0xa182, 0x0101, 0x00c8, 0x5d76, 0x0078, 0x5d78, 0x2009, 0x0100,
+ 0x2130, 0x2069, 0x7098, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020,
+ 0xaf90, 0x001d, 0x1078, 0x5dd2, 0xa6b2, 0x0020, 0x7804, 0xa06d,
+ 0x0040, 0x5d8c, 0x1078, 0x12eb, 0x1078, 0x12c2, 0x0040, 0x5db6,
+ 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a,
+ 0x003d, 0x00c8, 0x5da2, 0x2608, 0xad90, 0x000f, 0x1078, 0x5dd2,
+ 0x0078, 0x5db6, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90,
+ 0x000f, 0x1078, 0x5dd2, 0x0078, 0x5d8c, 0x0f7f, 0x852f, 0xa5ad,
+ 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x5dbb, 0x0f7f, 0x852f,
+ 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e,
+ 0x8dff, 0x0040, 0x5dd0, 0x6804, 0xa07d, 0x0040, 0x5dce, 0x6807,
+ 0x0000, 0x1078, 0x35c4, 0x2f68, 0x0078, 0x5dc3, 0x1078, 0x35c4,
+ 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040, 0x5dd8, 0x8108,
+ 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0,
+ 0x5dda, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084,
+ 0x0007, 0x1079, 0x5ded, 0x127f, 0x007c, 0x5dfc, 0x5df5, 0x5df7,
+ 0x5e13, 0x5df5, 0x5df7, 0x5df7, 0x5df7, 0x1078, 0x126a, 0xa006,
+ 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078,
+ 0x5fcd, 0x0040, 0x5e10, 0xa00e, 0x2001, 0x0005, 0x1078, 0x3654,
+ 0x1078, 0x35c4, 0x1078, 0x5425, 0xa085, 0x0001, 0x0d7f, 0x007c,
+ 0xa006, 0x0078, 0x5e0e, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x126a,
+ 0x1079, 0x5e1b, 0x007c, 0x5e2b, 0x5e4a, 0x5e2d, 0x5e5b, 0x5e46,
+ 0x5e2b, 0x5df7, 0x5dfc, 0x5dfc, 0x5df7, 0x5df7, 0x5df7, 0x5df7,
+ 0x5df7, 0x5df7, 0x5df7, 0x1078, 0x126a, 0x0d7e, 0x6010, 0x2068,
+ 0x1078, 0x5fcd, 0x0040, 0x5e38, 0x6850, 0xa085, 0x0005, 0x6852,
+ 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078,
+ 0x42c4, 0x1078, 0x4713, 0xa085, 0x0001, 0x007c, 0x1078, 0x15fc,
+ 0x0078, 0x5e2d, 0x0e7e, 0x2071, 0x6db0, 0x7024, 0xac06, 0x00c0,
+ 0x5e53, 0x1078, 0x4f41, 0x1078, 0x4eb5, 0x0e7f, 0x00c0, 0x5e2d,
+ 0x1078, 0x5df7, 0x007c, 0x037e, 0x0e7e, 0x2071, 0x6db0, 0x703c,
+ 0xac06, 0x00c0, 0x5e67, 0x2019, 0x0000, 0x1078, 0x4fd3, 0x1078,
+ 0x52af, 0x0e7f, 0x037f, 0x00c0, 0x5e2d, 0x1078, 0x5df7, 0x007c,
+ 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x5e78, 0x0c7f, 0x007c,
+ 0x5e80, 0x5ee0, 0x5f71, 0x5e84, 0x5e80, 0x5e80, 0x67ac, 0x5425,
0x007c, 0x6017, 0x0001, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8,
- 0x1288, 0x1079, 0x61ec, 0x007c, 0x61fc, 0x61fe, 0x621e, 0x6230,
- 0x6230, 0x61fc, 0x61e0, 0x61e0, 0x61e0, 0x6230, 0x6230, 0x61fc,
- 0x61fc, 0x61fc, 0x61fc, 0x623a, 0x1078, 0x1288, 0x0e7e, 0x6010,
- 0x2070, 0x7050, 0xc0b5, 0x7052, 0x2071, 0x71b6, 0x7024, 0xac06,
- 0x0040, 0x621a, 0x1078, 0x5139, 0x6007, 0x0085, 0x6003, 0x000b,
- 0x601f, 0x0002, 0x6017, 0x0014, 0x1078, 0x4562, 0x1078, 0x49b7,
- 0x0e7f, 0x007c, 0x6017, 0x0001, 0x0078, 0x6218, 0x0d7e, 0x6010,
- 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003,
- 0x000b, 0x601f, 0x0002, 0x1078, 0x4562, 0x1078, 0x49b7, 0x007c,
- 0x0d7e, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852,
- 0x0d7f, 0x007c, 0x1078, 0x56f5, 0x007c, 0x6000, 0xa08a, 0x0010,
- 0x10c8, 0x1288, 0x1079, 0x6245, 0x007c, 0x6255, 0x61e1, 0x6257,
- 0x6255, 0x6255, 0x6255, 0x6255, 0x6255, 0x61da, 0x61da, 0x6255,
- 0x6255, 0x6255, 0x6255, 0x6255, 0x6255, 0x1078, 0x1288, 0x0d7e,
- 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c,
- 0x10c8, 0x1288, 0x1079, 0x6265, 0x007c, 0x6271, 0x628c, 0x6271,
- 0x628c, 0x6271, 0x628c, 0x6273, 0x627c, 0x6271, 0x628c, 0x6271,
- 0x6281, 0x1078, 0x1288, 0x6004, 0xa08e, 0x0004, 0x0040, 0x6283,
- 0xa08e, 0x0002, 0x0040, 0x6283, 0x6004, 0x1078, 0x6484, 0x0040,
- 0x62d6, 0x1078, 0x21a8, 0x1078, 0x6484, 0x00c0, 0x6289, 0x1078,
- 0x58f2, 0x1078, 0x56f5, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186,
- 0x0016, 0x0040, 0x62c6, 0xa186, 0x0002, 0x00c0, 0x62b1, 0x6018,
- 0x2068, 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x62b1, 0x8001,
- 0x6842, 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0398, 0x1078,
- 0x568f, 0x0040, 0x62b1, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078,
- 0x62c6, 0x0d7f, 0x0c7f, 0x1078, 0x6484, 0x00c0, 0x62b9, 0x1078,
- 0x58f2, 0x1078, 0x21a8, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x21c6, 0x127f, 0x0e7f, 0x1078, 0x56f5, 0x007c, 0x2001, 0x0002,
- 0x1078, 0x34a2, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x45af,
- 0x1078, 0x49b7, 0x0d7f, 0x0c7f, 0x0078, 0x62c5, 0x1078, 0x58f2,
- 0x0078, 0x6289, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x62e2, 0x007c, 0x62f2, 0x62f2, 0x62f2, 0x62f2, 0x62f2, 0x62f2,
- 0x62f2, 0x62f2, 0x62f2, 0x61e0, 0x62f2, 0x61e1, 0x62f4, 0x61e1,
- 0x62fd, 0x62f2, 0x1078, 0x1288, 0x6007, 0x008b, 0x6003, 0x000d,
- 0x1078, 0x4562, 0x1078, 0x49b7, 0x007c, 0x1078, 0x644a, 0x1078,
- 0x6336, 0x0040, 0x631f, 0x1078, 0x21a8, 0x0d7e, 0x1078, 0x6336,
- 0x0040, 0x6312, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006,
- 0x1078, 0x3840, 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003,
- 0x0001, 0x1078, 0x45af, 0x1078, 0x49b7, 0x0078, 0x6321, 0x1078,
- 0x56f5, 0x007c, 0xa284, 0x0007, 0x00c0, 0x6333, 0xa282, 0x7600,
- 0x0048, 0x6333, 0x2001, 0x7015, 0x2004, 0xa202, 0x00c8, 0x6333,
- 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x6332, 0x027e, 0x0e7e,
- 0x2071, 0x7000, 0x6210, 0x7058, 0xa202, 0x0048, 0x6348, 0x705c,
- 0xa202, 0x00c8, 0x6348, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c,
- 0xa006, 0x0078, 0x6345, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2061, 0x7600, 0x2071, 0x7000, 0x7344, 0x7060,
- 0xa302, 0x00c8, 0x6371, 0x601c, 0xa206, 0x00c0, 0x6369, 0x1078,
- 0x6484, 0x00c0, 0x6365, 0x1078, 0x58f2, 0x0c7e, 0x1078, 0x56f5,
- 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6371, 0x0078,
- 0x6356, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e,
- 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x568f, 0x057f,
- 0x0040, 0x6390, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b,
- 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x638c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
- 0x62a0, 0x0c7e, 0x1078, 0x568f, 0x057f, 0x0040, 0x63ba, 0x6013,
- 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x36e4,
- 0x0c7f, 0x1078, 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09,
- 0x2009, 0x004c, 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x057f,
- 0x0c7f, 0x007c, 0xa006, 0x0078, 0x63b6, 0x0c7e, 0x057e, 0x127e,
- 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x568f, 0x057f, 0x0040,
- 0x63e5, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e,
- 0x2560, 0x1078, 0x36e4, 0x0c7f, 0x1078, 0x469f, 0x1078, 0x45e2,
- 0x2c08, 0x1078, 0x6d09, 0x2009, 0x004d, 0x1078, 0x571c, 0xa085,
- 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x63e1,
- 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078,
- 0x568f, 0x057f, 0x0040, 0x6410, 0x6612, 0x651a, 0x601f, 0x0003,
- 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x36e4, 0x0c7f, 0x1078,
- 0x469f, 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09, 0x2009, 0x004e,
- 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
- 0xa006, 0x0078, 0x640c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e,
- 0x1078, 0x568f, 0x017f, 0x0040, 0x642c, 0x660a, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x571c, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6429, 0x0c7e,
- 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040,
- 0x6447, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000,
- 0x1078, 0x571c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
- 0x0078, 0x6444, 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff,
- 0x0040, 0x6454, 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013,
- 0x0000, 0x601f, 0x0007, 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e,
- 0x0d7e, 0x2031, 0x7052, 0x2634, 0xd6e4, 0x0040, 0x646c, 0x6618,
- 0x2660, 0x6e48, 0x1078, 0x35f0, 0x0d7f, 0x0c7f, 0x067f, 0x007c,
- 0x007e, 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x6481, 0xa08e,
- 0x0003, 0x0040, 0x6481, 0xa08e, 0x0004, 0x0040, 0x6481, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e,
- 0x0000, 0x0040, 0x6499, 0xa08e, 0x001f, 0x0040, 0x6499, 0xa08e,
- 0x0028, 0x0040, 0x6499, 0xa08e, 0x0029, 0x0040, 0x6499, 0xa085,
- 0x0001, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x568f, 0x017f, 0x0040, 0x64b6, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x1078, 0x21a8, 0x2009, 0x0028, 0x1078,
- 0x571c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x64b3, 0xa186, 0x0015, 0x00c0, 0x64ce, 0x2011, 0x701c, 0x2204,
- 0xa086, 0x0074, 0x00c0, 0x64ce, 0x1078, 0x5ad5, 0x6003, 0x0001,
- 0x6007, 0x0029, 0x1078, 0x45af, 0x0078, 0x64d2, 0x1078, 0x58f2,
- 0x1078, 0x56f5, 0x007c, 0xa186, 0x0015, 0x00c0, 0x64f0, 0x2011,
- 0x701c, 0x2204, 0xa086, 0x0014, 0x00c0, 0x64f0, 0x0d7e, 0x6018,
- 0x2068, 0x1078, 0x3576, 0x0d7f, 0x1078, 0x5adf, 0x00c0, 0x64f0,
- 0x2001, 0x0006, 0x1078, 0x34a2, 0x1078, 0x579f, 0x0078, 0x64f4,
- 0x1078, 0x58f2, 0x1078, 0x56f5, 0x007c, 0x6848, 0xa086, 0x0005,
- 0x00c0, 0x64fc, 0x1078, 0x64fd, 0x007c, 0x6850, 0xc0ad, 0x6852,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x650b, 0x067f, 0x007c, 0x651b, 0x66eb, 0x67cc, 0x651b, 0x651b,
- 0x651b, 0x651b, 0x651b, 0x6555, 0x6832, 0x651b, 0x651b, 0x651b,
- 0x651b, 0x651b, 0x651b, 0x1078, 0x1288, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x1288, 0x1079, 0x6527, 0x067f, 0x007c, 0x6537,
- 0x6b1e, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x6af9,
- 0x6b68, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x6537, 0x1078,
- 0x1288, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1288, 0x1079,
- 0x6543, 0x067f, 0x007c, 0x6553, 0x696a, 0x69dc, 0x69fe, 0x6a4a,
- 0x6553, 0x6553, 0x6aa4, 0x683e, 0x6ae1, 0x6ae5, 0x6553, 0x6553,
- 0x6553, 0x6553, 0x6553, 0x1078, 0x1288, 0xa1b2, 0x0030, 0x10c8,
- 0x1288, 0x2100, 0x0079, 0x655c, 0x658c, 0x6669, 0x658c, 0x658c,
- 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c,
- 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c,
- 0x658c, 0x658c, 0x658c, 0x658e, 0x65bd, 0x65c8, 0x65f0, 0x65f6,
- 0x662a, 0x6662, 0x658c, 0x658c, 0x6671, 0x658c, 0x658c, 0x658c,
- 0x6678, 0x658c, 0x658c, 0x658c, 0x658c, 0x658c, 0x6695, 0x658c,
- 0x658c, 0x66a0, 0x658c, 0x658c, 0x1078, 0x1288, 0x1078, 0x37ec,
- 0x6618, 0x0c7e, 0x2660, 0x1078, 0x350c, 0x0c7f, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x65af, 0x1078,
- 0x6c48, 0x00c0, 0x65ea, 0x1078, 0x6be6, 0x00c0, 0x65ab, 0x6007,
- 0x0008, 0x0078, 0x6664, 0x6007, 0x0009, 0x0078, 0x6664, 0x1078,
- 0x6dda, 0x0040, 0x65b9, 0x1078, 0x6c48, 0x0040, 0x65a3, 0x0078,
- 0x65ea, 0x6013, 0x1900, 0x0078, 0x65ab, 0x6106, 0x1078, 0x6ba9,
- 0x6007, 0x0006, 0x0078, 0x6664, 0x6007, 0x0007, 0x0078, 0x6664,
- 0x0d7e, 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x65da, 0xa686, 0x0004, 0x0040, 0x65da, 0x0d7f,
- 0x0078, 0x65ea, 0x1078, 0x6ca6, 0x00c0, 0x65e5, 0x1078, 0x3576,
- 0x6007, 0x000a, 0x0d7f, 0x0078, 0x6664, 0x6007, 0x000b, 0x0d7f,
- 0x0078, 0x6664, 0x1078, 0x21a8, 0x6007, 0x0001, 0x0078, 0x6664,
- 0x1078, 0x21a8, 0x6007, 0x000c, 0x0078, 0x6664, 0x1078, 0x37ec,
- 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006,
- 0x0048, 0x6617, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0,
- 0x65ea, 0x1078, 0x6cb5, 0x00c0, 0x6611, 0x6007, 0x000e, 0x0078,
- 0x6664, 0x1078, 0x21a8, 0x6007, 0x000f, 0x0078, 0x6664, 0x1078,
- 0x6dda, 0x0040, 0x6624, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x6609, 0x0078, 0x65ea, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6664, 0x1078, 0x37ec, 0x6618, 0xa6b0, 0x0001, 0x2634,
- 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x664f, 0xa6b4, 0xff00,
- 0x8637, 0xa686, 0x0006, 0x00c0, 0x65ea, 0x1078, 0x6ce1, 0x00c0,
- 0x6649, 0x1078, 0x6be6, 0x00c0, 0x6649, 0x6007, 0x0010, 0x0078,
- 0x6664, 0x1078, 0x21a8, 0x6007, 0x0011, 0x0078, 0x6664, 0x1078,
- 0x6dda, 0x0040, 0x665c, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x663d, 0x0078, 0x65ea, 0x6013, 0x1900, 0x6007, 0x0009,
- 0x0078, 0x6664, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x45af,
- 0x007c, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x45af, 0x0078,
- 0x6668, 0x6007, 0x0020, 0x6003, 0x0001, 0x1078, 0x45af, 0x007c,
- 0x017e, 0x027e, 0x2011, 0x7488, 0x2214, 0x2c08, 0x1078, 0x6ea2,
- 0x00c0, 0x6689, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078,
- 0x668e, 0x1078, 0x56f5, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001,
- 0x1078, 0x45af, 0x027f, 0x017f, 0x007c, 0x6106, 0x1078, 0x66a7,
- 0x6007, 0x002b, 0x0078, 0x6664, 0x6007, 0x002c, 0x0078, 0x6664,
- 0x6106, 0x1078, 0x66ac, 0x6007, 0x002e, 0x0078, 0x6664, 0x0d7e,
- 0x1078, 0x66d2, 0x0d7f, 0x007c, 0x0d7e, 0x1078, 0x66e1, 0x00c0,
- 0x66cb, 0x680c, 0xa08c, 0xff00, 0x6824, 0xa084, 0x00ff, 0xa115,
- 0x6212, 0xd1e4, 0x0040, 0x66c0, 0x2009, 0x0001, 0x0078, 0x66c7,
- 0xd1ec, 0x0040, 0x66cb, 0x2009, 0x0000, 0xa294, 0x00ff, 0x1078,
- 0x21d7, 0x0078, 0x66cf, 0xa085, 0x0001, 0x0078, 0x66d0, 0xa006,
- 0x0d7f, 0x007c, 0x2069, 0x748d, 0x6800, 0xa082, 0x0010, 0x00c8,
- 0x66df, 0x6013, 0x0000, 0xa085, 0x0001, 0x0078, 0x66e0, 0xa006,
- 0x007c, 0x6013, 0x0000, 0x2069, 0x748c, 0x6808, 0xa084, 0xff00,
- 0xa086, 0x0800, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x1288,
- 0xa1b6, 0x0013, 0x00c0, 0x66f7, 0x2008, 0x0079, 0x670a, 0xa1b6,
- 0x0027, 0x0040, 0x66ff, 0xa1b6, 0x0014, 0x10c0, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x34b0, 0x1078, 0x48be, 0x1078, 0x6457, 0x1078,
- 0x49b7, 0x007c, 0x673a, 0x673c, 0x673a, 0x673a, 0x673a, 0x673c,
- 0x6744, 0x67a7, 0x676a, 0x67a7, 0x677e, 0x67a7, 0x6744, 0x67a7,
- 0x679f, 0x67a7, 0x679f, 0x67a7, 0x67a7, 0x673a, 0x673a, 0x673a,
- 0x673a, 0x673a, 0x673a, 0x673a, 0x673a, 0x673a, 0x673a, 0x673a,
- 0x673a, 0x673a, 0x67a7, 0x673a, 0x673a, 0x673a, 0x673a, 0x67a7,
- 0x67a7, 0x673a, 0x673a, 0x673a, 0x673a, 0x67a7, 0x67a7, 0x673a,
- 0x67a7, 0x67a7, 0x1078, 0x1288, 0x1078, 0x48be, 0x6003, 0x0002,
- 0x1078, 0x49b7, 0x0078, 0x67ad, 0x0f7e, 0x2079, 0x7051, 0x7804,
- 0x0f7f, 0xd0ac, 0x00c0, 0x67a7, 0x2001, 0x0000, 0x1078, 0x348e,
- 0x2001, 0x0002, 0x1078, 0x34a2, 0x1078, 0x48be, 0x601f, 0x0001,
- 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x45af, 0x1078, 0x49b7,
- 0x0c7e, 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x42b7, 0x0c7f,
- 0x0078, 0x67ad, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x67a7, 0xa686, 0x0004,
- 0x0040, 0x67a7, 0x2001, 0x0004, 0x0078, 0x67a5, 0x2001, 0x7000,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x6787, 0x1078, 0x2a92, 0x2001,
- 0x0006, 0x1078, 0x67ae, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x67a7, 0x2001,
- 0x0006, 0x0078, 0x67a5, 0x2001, 0x0004, 0x0078, 0x67a5, 0x2001,
- 0x0006, 0x1078, 0x67ae, 0x0078, 0x67a7, 0x1078, 0x34b0, 0x1078,
- 0x48be, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c, 0x017e, 0x0d7e,
- 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x67c9, 0x6104, 0xa18e,
- 0x000a, 0x00c0, 0x67c1, 0x699c, 0xd1a4, 0x00c0, 0x67c1, 0x2001,
- 0x0007, 0x1078, 0x34a2, 0x2001, 0x0000, 0x1078, 0x348e, 0x1078,
- 0x21c6, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1288,
- 0xa1b6, 0x0015, 0x00c0, 0x67e0, 0x1079, 0x67e7, 0x0078, 0x67e6,
- 0xa1b6, 0x0016, 0x10c0, 0x1288, 0x1079, 0x6817, 0x007c, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x67f3, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x0f7e, 0x2079, 0x7051, 0x7804, 0x0f7f,
- 0xd0ac, 0x00c0, 0x680f, 0x2001, 0x0000, 0x1078, 0x348e, 0x2001,
- 0x0002, 0x1078, 0x34a2, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x45af, 0x1078, 0x49b7, 0x0078, 0x6816, 0x2011,
- 0x7483, 0x220c, 0x1078, 0x32ed, 0x1078, 0x56f5, 0x007c, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x594f, 0x6823, 0x594f,
- 0x594f, 0x594f, 0x594f, 0x1078, 0x5ad2, 0x00c0, 0x682f, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x45af, 0x0078, 0x6831, 0x1078,
- 0x56f5, 0x007c, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1288, 0x1078,
- 0x48be, 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c, 0xa182, 0x0040,
- 0x0079, 0x6842, 0x6852, 0x6852, 0x6852, 0x6852, 0x6854, 0x6852,
- 0x6852, 0x6852, 0x6852, 0x6852, 0x6852, 0x6852, 0x6852, 0x6852,
- 0x6852, 0x6852, 0x1078, 0x1288, 0x0d7e, 0x0e7e, 0x0f7e, 0x157e,
- 0x047e, 0x027e, 0x6106, 0x2071, 0x7480, 0x7444, 0xa4a4, 0xe600,
- 0x0040, 0x68b8, 0x2009, 0x0000, 0x0c7e, 0x1078, 0x4348, 0x2c68,
- 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6923, 0x1078, 0x4407,
- 0x0040, 0x694e, 0xa295, 0x0200, 0x6a02, 0x0078, 0x687d, 0x2009,
- 0x0001, 0x2011, 0x0200, 0x1078, 0x43f1, 0x1078, 0x12e2, 0x1040,
- 0x1288, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000,
- 0x683b, 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6018, 0x2078, 0x78a0,
- 0x8007, 0x7130, 0x694a, 0xa084, 0xff00, 0x6846, 0x684f, 0x0000,
- 0x6857, 0x0036, 0x1078, 0x3840, 0xa486, 0x2000, 0x00c0, 0x68a6,
- 0x2019, 0x0017, 0x1078, 0x6e67, 0x0078, 0x6910, 0xa486, 0x0400,
- 0x00c0, 0x68b0, 0x2019, 0x0002, 0x1078, 0x6e67, 0x0078, 0x6910,
- 0xa486, 0x0200, 0x00c0, 0x68b6, 0x1078, 0x6e58, 0x0078, 0x6910,
- 0x2009, 0x0000, 0x0c7e, 0x1078, 0x4348, 0x2c68, 0x0c7f, 0x6a00,
- 0xa284, 0x0001, 0x0040, 0x6966, 0xa284, 0x0300, 0x00c0, 0x695e,
- 0x6804, 0xa005, 0x0040, 0x694e, 0x8001, 0x6806, 0x6003, 0x0007,
- 0x1078, 0x12c7, 0x0040, 0x6917, 0x6013, 0x0000, 0x6803, 0x0000,
+ 0x126a, 0x1079, 0x5e8c, 0x007c, 0x5e9c, 0x5e9e, 0x5ebf, 0x5ed2,
+ 0x5ed2, 0x5e9c, 0x5e80, 0x5e80, 0x5e80, 0x5ed2, 0x5ed2, 0x5e9c,
+ 0x5e9c, 0x5e9c, 0x5e9c, 0x5edd, 0x1078, 0x126a, 0x0e7e, 0x6010,
+ 0x2070, 0x7050, 0xa085, 0x0040, 0x7052, 0x2071, 0x6db0, 0x7024,
+ 0xac06, 0x0040, 0x5ebb, 0x1078, 0x4eb5, 0x6007, 0x0085, 0x6003,
+ 0x000b, 0x601f, 0x0002, 0x6017, 0x0014, 0x1078, 0x42c4, 0x1078,
+ 0x4713, 0x0e7f, 0x007c, 0x6017, 0x0001, 0x0078, 0x5eb9, 0x0d7e,
+ 0x6010, 0x2068, 0x6850, 0xa085, 0x0040, 0x6852, 0x0d7f, 0x6007,
+ 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078, 0x42c4, 0x1078,
+ 0x4713, 0x007c, 0x0d7e, 0x6017, 0x0001, 0x6010, 0x2068, 0x6850,
+ 0xa085, 0x0040, 0x6852, 0x0d7f, 0x007c, 0x1078, 0x5425, 0x007c,
+ 0x6000, 0xa08a, 0x0010, 0x10c8, 0x126a, 0x1079, 0x5ee8, 0x007c,
+ 0x5ef8, 0x5e81, 0x5efa, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8,
+ 0x5e80, 0x5e80, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8, 0x5ef8,
+ 0x1078, 0x126a, 0x0d7e, 0x6018, 0x2068, 0x6804, 0xa084, 0x00ff,
+ 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x126a, 0x1079, 0x5f08, 0x007c,
+ 0x5f14, 0x5f29, 0x5f14, 0x5f29, 0x5f14, 0x5f29, 0x5f16, 0x5f1f,
+ 0x5f14, 0x5f29, 0x5f14, 0x5f24, 0x1078, 0x126a, 0x6004, 0xa08e,
+ 0x0004, 0x0040, 0x5f26, 0xa08e, 0x0002, 0x0040, 0x5f26, 0x6004,
+ 0x1078, 0x6115, 0x0040, 0x5f6d, 0x1078, 0x2125, 0x1078, 0x5425,
+ 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, 0x0040, 0x5f5d,
+ 0xa186, 0x0002, 0x00c0, 0x5f4e, 0x6018, 0x2068, 0x6840, 0xa084,
+ 0x00ff, 0xa005, 0x0040, 0x5f4e, 0x8001, 0x6842, 0x6013, 0x0000,
+ 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x53bf, 0x0040, 0x5f4e,
+ 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x5f5d, 0x0d7f, 0x0c7f,
+ 0x1078, 0x2125, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078, 0x2143,
+ 0x127f, 0x0e7f, 0x1078, 0x5425, 0x007c, 0x2001, 0x0002, 0x1078,
+ 0x3316, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4311, 0x1078,
+ 0x4713, 0x0d7f, 0x0c7f, 0x0078, 0x5f5c, 0x1078, 0x5614, 0x0078,
+ 0x5f26, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x126a, 0x1079, 0x5f79,
+ 0x007c, 0x5f89, 0x5f89, 0x5f89, 0x5f89, 0x5f89, 0x5f89, 0x5f89,
+ 0x5f89, 0x5f89, 0x5e80, 0x5f89, 0x5e81, 0x5f8b, 0x5e81, 0x5f94,
+ 0x5f89, 0x1078, 0x126a, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078,
+ 0x42c4, 0x1078, 0x4713, 0x007c, 0x1078, 0x60db, 0x1078, 0x5fcd,
+ 0x0040, 0x5fb6, 0x1078, 0x2125, 0x0d7e, 0x1078, 0x5fcd, 0x0040,
+ 0x5fa9, 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078,
+ 0x35c4, 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+ 0x1078, 0x4311, 0x1078, 0x4713, 0x0078, 0x5fb8, 0x1078, 0x5425,
+ 0x007c, 0xa284, 0x0007, 0x00c0, 0x5fca, 0xa282, 0x7200, 0x0048,
+ 0x5fca, 0x2001, 0x6c15, 0x2004, 0xa202, 0x00c8, 0x5fca, 0xa085,
+ 0x0001, 0x007c, 0xa006, 0x0078, 0x5fc9, 0x027e, 0x0e7e, 0x2071,
+ 0x6c00, 0x6210, 0x7058, 0xa202, 0x0048, 0x5fdf, 0x705c, 0xa202,
+ 0x00c8, 0x5fdf, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006,
+ 0x0078, 0x5fdc, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2061, 0x7200, 0x2071, 0x6c00, 0x7344, 0x7060, 0xa302,
+ 0x00c8, 0x6002, 0x601c, 0xa206, 0x00c0, 0x5ffa, 0x0c7e, 0x1078,
+ 0x5425, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x6002,
+ 0x0078, 0x5fed, 0x127f, 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c,
+ 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x53bf,
+ 0x057f, 0x0040, 0x6021, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009,
+ 0x004b, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
+ 0x007c, 0xa006, 0x0078, 0x601d, 0x0c7e, 0x057e, 0x127e, 0x2091,
+ 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x53bf, 0x057f, 0x0040, 0x604b,
+ 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078,
+ 0x34f2, 0x0c7f, 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078,
+ 0x6946, 0x2009, 0x004c, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f,
+ 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6047, 0x0c7e, 0x057e,
+ 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x53bf, 0x057f,
+ 0x0040, 0x6076, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
+ 0x0c7e, 0x2560, 0x1078, 0x34f2, 0x0c7f, 0x1078, 0x43ff, 0x1078,
+ 0x4344, 0x2c08, 0x1078, 0x6946, 0x2009, 0x004d, 0x1078, 0x544c,
+ 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
+ 0x6072, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
+ 0x1078, 0x53bf, 0x057f, 0x0040, 0x60a1, 0x6612, 0x651a, 0x601f,
+ 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x34f2, 0x0c7f,
+ 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08, 0x1078, 0x6946, 0x2009,
+ 0x004e, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
+ 0x007c, 0xa006, 0x0078, 0x609d, 0x0c7e, 0x127e, 0x2091, 0x8000,
+ 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x60bd, 0x660a, 0x611a,
+ 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x544c,
+ 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x60ba,
+ 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x53bf, 0x017f,
+ 0x0040, 0x60d8, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009,
+ 0x0000, 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x60d5, 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c,
+ 0x82ff, 0x0040, 0x60e5, 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c,
+ 0x6013, 0x0000, 0x601f, 0x0007, 0x6017, 0x0014, 0x007c, 0x067e,
+ 0x0c7e, 0x0d7e, 0x2031, 0x6c52, 0x2634, 0xd6e4, 0x0040, 0x60fd,
+ 0x6618, 0x2660, 0x6e44, 0x1078, 0x342a, 0x0d7f, 0x0c7f, 0x067f,
+ 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0002, 0x0040, 0x6112,
+ 0xa08e, 0x0003, 0x0040, 0x6112, 0xa08e, 0x0004, 0x0040, 0x6112,
+ 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x007e, 0x017e, 0x6004,
+ 0xa08e, 0x0000, 0x0040, 0x612a, 0xa08e, 0x001f, 0x0040, 0x612a,
+ 0xa08e, 0x0028, 0x0040, 0x612a, 0xa08e, 0x0029, 0x0040, 0x612a,
+ 0xa085, 0x0001, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091,
+ 0x8000, 0x0c7e, 0x1078, 0x53bf, 0x017f, 0x0040, 0x6147, 0x611a,
+ 0x601f, 0x0001, 0x2d00, 0x6012, 0x1078, 0x2125, 0x2009, 0x0028,
+ 0x1078, 0x544c, 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006,
+ 0x0078, 0x6144, 0xa186, 0x0015, 0x00c0, 0x615f, 0x2011, 0x6c1c,
+ 0x2204, 0xa086, 0x0074, 0x00c0, 0x615f, 0x1078, 0x57f7, 0x6003,
+ 0x0001, 0x6007, 0x0029, 0x1078, 0x4311, 0x0078, 0x6163, 0x1078,
+ 0x5614, 0x1078, 0x5425, 0x007c, 0xa186, 0x0015, 0x00c0, 0x6181,
+ 0x2011, 0x6c1c, 0x2204, 0xa086, 0x0014, 0x00c0, 0x6181, 0x0d7e,
+ 0x6018, 0x2068, 0x1078, 0x33ed, 0x0d7f, 0x1078, 0x5801, 0x00c0,
+ 0x6181, 0x2001, 0x0006, 0x1078, 0x3316, 0x1078, 0x54cf, 0x0078,
+ 0x6185, 0x1078, 0x5614, 0x1078, 0x5425, 0x007c, 0x067e, 0x6000,
+ 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079, 0x6190, 0x067f, 0x007c,
+ 0x61a0, 0x6312, 0x63ed, 0x61a0, 0x61a0, 0x61a0, 0x61a0, 0x61a0,
+ 0x61da, 0x6453, 0x61a0, 0x61a0, 0x61a0, 0x61a0, 0x61a0, 0x61a0,
+ 0x1078, 0x126a, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x126a,
+ 0x1079, 0x61ac, 0x067f, 0x007c, 0x61bc, 0x675b, 0x61bc, 0x61bc,
+ 0x61bc, 0x61bc, 0x61bc, 0x61bc, 0x6736, 0x67a5, 0x61bc, 0x61bc,
+ 0x61bc, 0x61bc, 0x61bc, 0x61bc, 0x1078, 0x126a, 0x067e, 0x6000,
+ 0xa0b2, 0x0010, 0x10c8, 0x126a, 0x1079, 0x61c8, 0x067f, 0x007c,
+ 0x61d8, 0x65a5, 0x6617, 0x6639, 0x6687, 0x61d8, 0x61d8, 0x66e1,
+ 0x645f, 0x671e, 0x6722, 0x61d8, 0x61d8, 0x61d8, 0x61d8, 0x61d8,
+ 0x1078, 0x126a, 0xa1b2, 0x002a, 0x10c8, 0x126a, 0x2100, 0x0079,
+ 0x61e1, 0x620b, 0x62e8, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b,
+ 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b,
+ 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b, 0x620b,
+ 0x620d, 0x623c, 0x6247, 0x626f, 0x6275, 0x62a9, 0x62e1, 0x620b,
+ 0x620b, 0x62f0, 0x620b, 0x620b, 0x620b, 0x62f7, 0x620b, 0x620b,
+ 0x620b, 0x620b, 0x620b, 0x1078, 0x126a, 0x1078, 0x3570, 0x6618,
+ 0x0c7e, 0x2660, 0x1078, 0x337c, 0x0c7f, 0xa6b0, 0x0001, 0x2634,
+ 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x622e, 0x1078, 0x6885,
+ 0x00c0, 0x6269, 0x1078, 0x6823, 0x00c0, 0x622a, 0x6007, 0x0008,
+ 0x0078, 0x62e3, 0x6007, 0x0009, 0x0078, 0x62e3, 0x1078, 0x6a15,
+ 0x0040, 0x6238, 0x1078, 0x6885, 0x0040, 0x6222, 0x0078, 0x6269,
+ 0x6013, 0x1900, 0x0078, 0x622a, 0x6106, 0x1078, 0x67e6, 0x6007,
+ 0x0006, 0x0078, 0x62e3, 0x6007, 0x0007, 0x0078, 0x62e3, 0x0d7e,
+ 0x6618, 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
+ 0x0040, 0x6259, 0xa686, 0x0004, 0x0040, 0x6259, 0x0d7f, 0x0078,
+ 0x6269, 0x1078, 0x68e3, 0x00c0, 0x6264, 0x1078, 0x33ed, 0x6007,
+ 0x000a, 0x0d7f, 0x0078, 0x62e3, 0x6007, 0x000b, 0x0d7f, 0x0078,
+ 0x62e3, 0x1078, 0x2125, 0x6007, 0x0001, 0x0078, 0x62e3, 0x1078,
+ 0x2125, 0x6007, 0x000c, 0x0078, 0x62e3, 0x1078, 0x3570, 0x6618,
+ 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048,
+ 0x6296, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6269,
+ 0x1078, 0x68f2, 0x00c0, 0x6290, 0x6007, 0x000e, 0x0078, 0x62e3,
+ 0x1078, 0x2125, 0x6007, 0x000f, 0x0078, 0x62e3, 0x1078, 0x6a15,
+ 0x0040, 0x62a3, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040,
+ 0x6288, 0x0078, 0x6269, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078,
+ 0x62e3, 0x1078, 0x3570, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684,
+ 0x00ff, 0xa082, 0x0006, 0x0048, 0x62ce, 0xa6b4, 0xff00, 0x8637,
+ 0xa686, 0x0006, 0x00c0, 0x6269, 0x1078, 0x691e, 0x00c0, 0x62c8,
+ 0x1078, 0x6823, 0x00c0, 0x62c8, 0x6007, 0x0010, 0x0078, 0x62e3,
+ 0x1078, 0x2125, 0x6007, 0x0011, 0x0078, 0x62e3, 0x1078, 0x6a15,
+ 0x0040, 0x62db, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040,
+ 0x62bc, 0x0078, 0x6269, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078,
+ 0x62e3, 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x4311, 0x007c,
+ 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4311, 0x0078, 0x62e7,
+ 0x6007, 0x0020, 0x6003, 0x0001, 0x1078, 0x4311, 0x007c, 0x017e,
+ 0x027e, 0x2011, 0x7088, 0x2214, 0x2c08, 0x1078, 0x6add, 0x00c0,
+ 0x6308, 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078, 0x630b,
+ 0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4311, 0x027f,
+ 0x017f, 0x007c, 0x6004, 0xa0b2, 0x002a, 0x10c8, 0x126a, 0xa1b6,
+ 0x0013, 0x00c0, 0x631e, 0x2008, 0x0079, 0x6331, 0xa1b6, 0x0027,
+ 0x0040, 0x6326, 0xa1b6, 0x0014, 0x10c0, 0x126a, 0x2001, 0x0007,
+ 0x1078, 0x3324, 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713,
+ 0x007c, 0x635b, 0x635d, 0x635b, 0x635b, 0x635b, 0x635d, 0x6365,
+ 0x63c8, 0x638b, 0x63c8, 0x639f, 0x63c8, 0x6365, 0x63c8, 0x63c0,
+ 0x63c8, 0x63c0, 0x63c8, 0x63c8, 0x635b, 0x635b, 0x635b, 0x635b,
+ 0x635b, 0x635b, 0x635b, 0x635b, 0x635b, 0x635b, 0x635b, 0x635b,
+ 0x635b, 0x63c8, 0x635b, 0x635b, 0x635b, 0x635b, 0x63c8, 0x63c8,
+ 0x635b, 0x635b, 0x635b, 0x1078, 0x126a, 0x1078, 0x461a, 0x6003,
+ 0x0002, 0x1078, 0x4713, 0x0078, 0x63ce, 0x0f7e, 0x2079, 0x6c51,
+ 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x63c8, 0x2001, 0x0000, 0x1078,
+ 0x3302, 0x2001, 0x0002, 0x1078, 0x3316, 0x1078, 0x461a, 0x601f,
+ 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4311, 0x1078,
+ 0x4713, 0x0c7e, 0x6118, 0x2160, 0x2009, 0x0001, 0x1078, 0x4033,
+ 0x0c7f, 0x0078, 0x63ce, 0x6618, 0x0d7e, 0x2668, 0x6e04, 0x0d7f,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x63c8, 0xa686,
+ 0x0004, 0x0040, 0x63c8, 0x2001, 0x0004, 0x0078, 0x63c6, 0x2001,
+ 0x6c00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x63a8, 0x1078, 0x29a0,
+ 0x2001, 0x0006, 0x1078, 0x63cf, 0x6618, 0x0d7e, 0x2668, 0x6e04,
+ 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x63c8,
+ 0x2001, 0x0006, 0x0078, 0x63c6, 0x2001, 0x0004, 0x0078, 0x63c6,
+ 0x2001, 0x0006, 0x1078, 0x63cf, 0x0078, 0x63c8, 0x1078, 0x3324,
+ 0x1078, 0x461a, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0x017e,
+ 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184, 0x0040, 0x63ea, 0x6104,
+ 0xa18e, 0x000a, 0x00c0, 0x63e2, 0x699c, 0xd1a4, 0x00c0, 0x63e2,
+ 0x2001, 0x0007, 0x1078, 0x3316, 0x2001, 0x0000, 0x1078, 0x3302,
+ 0x1078, 0x2143, 0x0d7f, 0x017f, 0x007c, 0x0d7e, 0x6618, 0x2668,
+ 0x6804, 0xa084, 0xff00, 0x8007, 0x0d7f, 0xa0b2, 0x000c, 0x10c8,
+ 0x126a, 0xa1b6, 0x0015, 0x00c0, 0x6401, 0x1079, 0x6408, 0x0078,
+ 0x6407, 0xa1b6, 0x0016, 0x10c0, 0x126a, 0x1079, 0x6438, 0x007c,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x6414,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x0f7e, 0x2079, 0x6c51, 0x7804,
+ 0x0f7f, 0xd0ac, 0x00c0, 0x6430, 0x2001, 0x0000, 0x1078, 0x3302,
+ 0x2001, 0x0002, 0x1078, 0x3316, 0x601f, 0x0001, 0x6003, 0x0001,
+ 0x6007, 0x0002, 0x1078, 0x4311, 0x1078, 0x4713, 0x0078, 0x6437,
+ 0x2011, 0x7083, 0x220c, 0x1078, 0x316e, 0x1078, 0x5425, 0x007c,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x5671, 0x6444,
+ 0x5671, 0x5671, 0x5671, 0x5671, 0x1078, 0x57f4, 0x00c0, 0x6450,
+ 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4311, 0x0078, 0x6452,
+ 0x1078, 0x5425, 0x007c, 0x6004, 0xa08a, 0x002a, 0x10c8, 0x126a,
+ 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0xa182,
+ 0x0040, 0x0079, 0x6463, 0x6473, 0x6473, 0x6473, 0x6473, 0x6475,
+ 0x6473, 0x6473, 0x6473, 0x6473, 0x6473, 0x6473, 0x6473, 0x6473,
+ 0x6473, 0x6473, 0x6473, 0x1078, 0x126a, 0x0d7e, 0x0e7e, 0x0f7e,
+ 0x157e, 0x047e, 0x027e, 0x2071, 0x7080, 0x7444, 0xa4a4, 0xe600,
+ 0x0040, 0x64e6, 0xa486, 0x2000, 0x0040, 0x64a4, 0xa486, 0x0400,
+ 0x0040, 0x64a4, 0x7130, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8,
+ 0x6579, 0x0c7e, 0x1078, 0x40c4, 0x2c68, 0x0c7f, 0x6a00, 0xa284,
+ 0x0001, 0x0040, 0x655a, 0x1078, 0x4182, 0x0040, 0x6585, 0xa295,
+ 0x0200, 0x6a02, 0x0078, 0x64aa, 0x2009, 0x0001, 0x2011, 0x0200,
+ 0x1078, 0x416c, 0x1078, 0x12c2, 0x1040, 0x126a, 0x6003, 0x0007,
+ 0x6106, 0x2d00, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000,
+ 0x6c5a, 0x2c00, 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130,
+ 0xa18c, 0x00ff, 0xa10d, 0x6946, 0x684f, 0x0000, 0x6857, 0x0036,
+ 0x1078, 0x35c4, 0xa486, 0x2000, 0x00c0, 0x64d4, 0x2019, 0x0017,
+ 0x1078, 0x6aa2, 0x0078, 0x6547, 0xa486, 0x0400, 0x00c0, 0x64de,
+ 0x2019, 0x0002, 0x1078, 0x6aa2, 0x0078, 0x6547, 0xa486, 0x0200,
+ 0x00c0, 0x64e4, 0x1078, 0x6a93, 0x0078, 0x6547, 0x7130, 0xa184,
+ 0xff00, 0x00c0, 0x659d, 0xa18c, 0x00ff, 0xa182, 0x0010, 0x00c8,
+ 0x659d, 0x0c7e, 0x1078, 0x40c4, 0x2c68, 0x0c7f, 0x6a00, 0xa284,
+ 0x0001, 0x0040, 0x65a1, 0xa284, 0x0300, 0x00c0, 0x6599, 0x6804,
+ 0xa005, 0x0040, 0x6585, 0x8001, 0x6806, 0x6003, 0x0007, 0x6106,
+ 0x1078, 0x12a7, 0x0040, 0x654e, 0x6013, 0x0000, 0x6803, 0x0000,
0x6837, 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a, 0x6018, 0x2078,
- 0x78a0, 0x8007, 0x7130, 0x6986, 0x6846, 0x6853, 0x003d, 0x7044,
- 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x68f2, 0x684f, 0x0040,
- 0x0078, 0x68fc, 0xa086, 0x0001, 0x00c0, 0x68fa, 0x684f, 0x0080,
- 0x0078, 0x68fc, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001, 0x7490,
- 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0,
- 0x6902, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078, 0x3840,
- 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013,
- 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x4562, 0x1078,
- 0x49b7, 0x0078, 0x6910, 0x2069, 0x7492, 0x2d04, 0xa084, 0xff00,
- 0xa086, 0x1200, 0x00c0, 0x6942, 0x2069, 0x7480, 0x686c, 0xa084,
- 0x00ff, 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f,
- 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x4562, 0x1078, 0x49b7,
- 0x0078, 0x6910, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041,
- 0x1078, 0x4562, 0x1078, 0x49b7, 0x0078, 0x6910, 0x6013, 0x0300,
- 0x0078, 0x6954, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041,
- 0x1078, 0x4562, 0x1078, 0x49b7, 0x0078, 0x6910, 0x6013, 0x0500,
- 0x0078, 0x6954, 0x6013, 0x0600, 0x0078, 0x6923, 0x6013, 0x0200,
- 0x0078, 0x6923, 0xa186, 0x0013, 0x00c0, 0x697c, 0x6004, 0xa08a,
- 0x0040, 0x1048, 0x1288, 0xa08a, 0x0050, 0x10c8, 0x1288, 0xa082,
- 0x0040, 0x2008, 0x0079, 0x69ad, 0xa186, 0x0047, 0x00c0, 0x6982,
- 0x0078, 0x69dc, 0xa186, 0x0027, 0x0040, 0x698a, 0xa186, 0x0014,
- 0x10c0, 0x1288, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079, 0x6990,
- 0x69a0, 0x69a2, 0x69a2, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0,
- 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0, 0x69a0,
- 0x1078, 0x1288, 0x2001, 0x0007, 0x1078, 0x34b0, 0x1078, 0x48be,
- 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c, 0x69bd, 0x69cd, 0x69c6,
- 0x69d6, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd,
- 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x69bd, 0x1078, 0x1288, 0x6010,
- 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078, 0x48be,
- 0x6003, 0x0002, 0x1078, 0x49b7, 0x007c, 0x1078, 0x48be, 0x1078,
- 0x43c9, 0x1078, 0x56f5, 0x1078, 0x49b7, 0x007c, 0x1078, 0x48be,
- 0x2009, 0x0041, 0x0078, 0x6aa4, 0xa182, 0x0040, 0x0079, 0x69e0,
- 0x69f0, 0x69f2, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f3,
- 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0, 0x69f0,
- 0x1078, 0x1288, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005,
- 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x007c, 0xa182, 0x0040,
- 0x0079, 0x6a02, 0x6a12, 0x6a12, 0x6a12, 0x6a12, 0x6a12, 0x6a12,
- 0x6a12, 0x6a12, 0x6a12, 0x6a14, 0x6a37, 0x6a12, 0x6a12, 0x6a12,
- 0x6a12, 0x6a37, 0x1078, 0x1288, 0x1078, 0x4966, 0x1078, 0x4a67,
- 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x6a2a, 0xa08c,
- 0x0003, 0xa18e, 0x0002, 0x0040, 0x6a30, 0x2009, 0x0041, 0x0d7f,
- 0x0078, 0x6aa4, 0x6003, 0x0007, 0x1078, 0x43c9, 0x0d7f, 0x007c,
- 0x1078, 0x43c9, 0x1078, 0x56f5, 0x0d7f, 0x0078, 0x6a2f, 0x037e,
- 0x1078, 0x4966, 0x1078, 0x4a67, 0x6010, 0x0d7e, 0x2068, 0x2019,
- 0x0004, 0x1078, 0x6e8b, 0x1078, 0x6457, 0x6017, 0x0028, 0x0d7f,
- 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6a58, 0x6004, 0xa086,
- 0x0042, 0x10c0, 0x1288, 0x1078, 0x48be, 0x1078, 0x49b7, 0x007c,
- 0xa186, 0x0027, 0x0040, 0x6a60, 0xa186, 0x0014, 0x00c0, 0x6a70,
- 0x6004, 0xa086, 0x0042, 0x10c0, 0x1288, 0x2001, 0x0007, 0x1078,
- 0x34b0, 0x1078, 0x48be, 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c,
- 0xa182, 0x0040, 0x0079, 0x6a74, 0x6a84, 0x6a84, 0x6a84, 0x6a84,
- 0x6a84, 0x6a84, 0x6a84, 0x6a86, 0x6a92, 0x6a84, 0x6a84, 0x6a84,
- 0x6a84, 0x6a84, 0x6a84, 0x6a84, 0x1078, 0x1288, 0x037e, 0x047e,
- 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1525, 0x047f,
- 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040,
- 0x6a9e, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6aa4, 0x6003, 0x0007,
- 0x1078, 0x43c9, 0x0d7f, 0x007c, 0xa182, 0x0040, 0x0079, 0x6aa8,
- 0x6ab8, 0x6aba, 0x6ac6, 0x6ad2, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8,
- 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8, 0x6ab8,
- 0x1078, 0x1288, 0x6003, 0x0001, 0x6106, 0x1078, 0x4562, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x49b7, 0x127f, 0x007c, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x4562, 0x127e, 0x2091, 0x8000, 0x1078, 0x49b7,
- 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078, 0x1936,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x45ce, 0x1078, 0x4a67, 0x127f,
- 0x007c, 0x1078, 0x48be, 0x0078, 0x6ae7, 0x1078, 0x4966, 0x6110,
- 0x81ff, 0x0040, 0x6af4, 0x0d7e, 0x2168, 0x037e, 0x2019, 0x0029,
- 0x1078, 0x6e8b, 0x037f, 0x0d7f, 0x1078, 0x6457, 0x1078, 0x49b7,
- 0x007c, 0xa182, 0x0085, 0x0079, 0x6afd, 0x6b04, 0x6b04, 0x6b04,
- 0x6b06, 0x6b04, 0x6b04, 0x6b04, 0x1078, 0x1288, 0x027e, 0x0e7e,
- 0x2071, 0x7480, 0x7220, 0x1078, 0x6da5, 0x0040, 0x6b13, 0x6007,
- 0x0086, 0x0078, 0x6b15, 0x6007, 0x0087, 0x6003, 0x0001, 0x1078,
- 0x4562, 0x1078, 0x49b7, 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013,
- 0x00c0, 0x6b2f, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1288, 0xa08a,
- 0x008c, 0x10c8, 0x1288, 0xa082, 0x0085, 0x0079, 0x6b42, 0xa186,
- 0x0027, 0x0040, 0x6b37, 0xa186, 0x0014, 0x10c0, 0x1288, 0x2001,
- 0x0007, 0x1078, 0x34b0, 0x1078, 0x48be, 0x1078, 0x6457, 0x1078,
- 0x49b7, 0x007c, 0x6b49, 0x6b4b, 0x6b4b, 0x6b49, 0x6b49, 0x6b49,
- 0x6b49, 0x1078, 0x1288, 0x1078, 0x48be, 0x1078, 0x56f5, 0x1078,
- 0x49b7, 0x007c, 0xa182, 0x0085, 0x1048, 0x1288, 0xa182, 0x008c,
- 0x10c8, 0x1288, 0xa182, 0x0085, 0x0079, 0x6b5e, 0x6b65, 0x6b65,
- 0x6b65, 0x6b67, 0x6b65, 0x6b65, 0x6b65, 0x1078, 0x1288, 0x007c,
- 0x1078, 0x48be, 0x1078, 0x6457, 0x1078, 0x49b7, 0x007c, 0x037e,
- 0x2019, 0x000b, 0x1078, 0x6b78, 0x601f, 0x0006, 0x037f, 0x007c,
- 0x127e, 0x037e, 0x087e, 0x2091, 0x8000, 0x2c40, 0x1078, 0x5408,
- 0x00c0, 0x6ba5, 0x1078, 0x54a9, 0x00c0, 0x6ba5, 0x6000, 0xa086,
- 0x0000, 0x0040, 0x6ba5, 0x601c, 0xa086, 0x0007, 0x0040, 0x6ba5,
- 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6b98, 0x1078, 0x1629,
- 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x6ba0, 0x1078, 0x6e8b,
- 0x0d7f, 0x6013, 0x0000, 0x601f, 0x0007, 0x087f, 0x037f, 0x127f,
- 0x007c, 0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7480, 0x7838,
- 0xa084, 0x00ff, 0xa005, 0x00c0, 0x6be1, 0x783c, 0x1078, 0x1fe4,
- 0x017e, 0x0c7e, 0x1078, 0x34fa, 0x00c0, 0x6bdf, 0x2011, 0x7490,
- 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5b6b, 0x00c0, 0x6bdf,
- 0x017f, 0x027f, 0x027e, 0x017e, 0x2019, 0x0029, 0x1078, 0x557d,
- 0x1078, 0x469f, 0x1078, 0x45e2, 0x017f, 0x1078, 0x6d09, 0x1078,
- 0x36e4, 0x017f, 0x1078, 0x32ed, 0xa006, 0x0078, 0x6be1, 0x0c7f,
- 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e,
- 0x017e, 0x2009, 0x701c, 0x2104, 0xa086, 0x0074, 0x00c0, 0x6c3d,
- 0x2069, 0x748e, 0x690c, 0xa182, 0x0100, 0x0048, 0x6c2d, 0x6908,
- 0xa184, 0x8000, 0x0040, 0x6c39, 0xa184, 0x0800, 0x0040, 0x6c39,
- 0x6910, 0xa18a, 0x0001, 0x0048, 0x6c31, 0x6914, 0x2069, 0x74ae,
- 0x6904, 0x81ff, 0x00c0, 0x6c25, 0x690c, 0xa182, 0x0100, 0x0048,
- 0x6c2d, 0x6908, 0x81ff, 0x00c0, 0x6c29, 0x6910, 0xa18a, 0x0001,
- 0x0048, 0x6c31, 0x6918, 0xa18a, 0x0001, 0x0048, 0x6c39, 0x0078,
- 0x6c43, 0x6013, 0x0100, 0x0078, 0x6c3f, 0x6013, 0x0300, 0x0078,
- 0x6c3f, 0x6013, 0x0500, 0x0078, 0x6c3f, 0x6013, 0x0700, 0x0078,
- 0x6c3f, 0x6013, 0x0900, 0x0078, 0x6c3f, 0x6013, 0x0b00, 0x0078,
- 0x6c3f, 0x6013, 0x0f00, 0x0078, 0x6c3f, 0x6013, 0x2d00, 0xa085,
- 0x0001, 0x0078, 0x6c44, 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c,
- 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04,
- 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040, 0x6c6c, 0xa286, 0x0004,
- 0x0040, 0x6c6c, 0xa394, 0xff00, 0x8217, 0xa286, 0x0006, 0x0040,
- 0x6c6c, 0xa286, 0x0004, 0x0040, 0x6c6c, 0x0c7e, 0x2d60, 0x1078,
- 0x350c, 0x0c7f, 0x0078, 0x6c9f, 0x2011, 0x7496, 0xad98, 0x000a,
- 0x20a9, 0x0004, 0x1078, 0x5b6b, 0x00c0, 0x6ca0, 0x2011, 0x749a,
- 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5b6b, 0x00c0, 0x6ca0,
- 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009,
- 0x7052, 0x210c, 0xd1a4, 0x0040, 0x6c94, 0x2009, 0x0029, 0x1078,
- 0x6ecf, 0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029, 0x1078, 0x469f,
- 0x1078, 0x45e2, 0x2c08, 0x1078, 0x6d09, 0x017f, 0x047f, 0xa006,
- 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069,
- 0x748e, 0x6800, 0xa086, 0x0800, 0x0040, 0x6cb2, 0x6013, 0x0000,
- 0x0078, 0x6cb3, 0xa006, 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e,
- 0x027e, 0x037e, 0x157e, 0x2079, 0x748c, 0x7830, 0xa00d, 0x00c0,
- 0x6cda, 0x7834, 0x1078, 0x1fe4, 0x1078, 0x34fa, 0x00c0, 0x6cda,
- 0x2011, 0x7490, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5b6b,
- 0x00c0, 0x6cda, 0x2011, 0x7494, 0xac98, 0x0006, 0x20a9, 0x0004,
- 0x1078, 0x5b6b, 0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f,
- 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2011,
- 0x7483, 0x2204, 0x1078, 0x1fe4, 0x1078, 0x34fa, 0x00c0, 0x6d02,
- 0x2011, 0x7496, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5b6b,
- 0x00c0, 0x6d02, 0x2011, 0x749a, 0xac98, 0x0006, 0x20a9, 0x0004,
- 0x1078, 0x5b6b, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f,
- 0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x71bf, 0x252c, 0x2021, 0x71c5,
- 0x2424, 0x2061, 0x7600, 0x2071, 0x7000, 0x7644, 0x7060, 0x8001,
- 0xa602, 0x00c8, 0x6d6e, 0x2100, 0xac06, 0x0040, 0x6d64, 0x1078,
- 0x6ee7, 0x0040, 0x6d64, 0x671c, 0xa786, 0x0001, 0x0040, 0x6d83,
- 0xa786, 0x0007, 0x0040, 0x6d64, 0x2500, 0xac06, 0x0040, 0x6d64,
- 0x2400, 0xac06, 0x0040, 0x6d64, 0x1078, 0x6efb, 0x00c0, 0x6d64,
- 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6d4a, 0x017e, 0x1078,
- 0x1629, 0x017f, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x6d61,
- 0xa786, 0x0003, 0x00c0, 0x6d77, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x017e, 0x1078, 0x64f5, 0x1078, 0x3840, 0x017f, 0x1078,
- 0x644a, 0x0d7f, 0x1078, 0x6457, 0xace0, 0x0008, 0x2001, 0x7015,
- 0x2004, 0xac02, 0x00c8, 0x6d6e, 0x0078, 0x6d1b, 0x127f, 0x027f,
- 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x6d54, 0xa386, 0x0005, 0x0040, 0x6d64, 0x1078,
- 0x6e8b, 0x0078, 0x6d61, 0x1078, 0x6efb, 0x00c0, 0x6d64, 0xa180,
- 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0, 0x6d64, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x6d64, 0x1078, 0x6470, 0x0040, 0x6d9f, 0x1078,
- 0x6484, 0x00c0, 0x6d64, 0x1078, 0x58f2, 0x0078, 0x6da1, 0x1078,
- 0x21c6, 0x1078, 0x6457, 0x0078, 0x6d64, 0x0c7e, 0x0e7e, 0x017e,
- 0x2c08, 0x2170, 0x1078, 0x6ea2, 0x017f, 0x0040, 0x6db4, 0x601c,
- 0xa084, 0x0007, 0x1079, 0x6db7, 0x0e7f, 0x0c7f, 0x007c, 0x6dbf,
- 0x6dbf, 0x6dbf, 0x6dbf, 0x6dbf, 0x6dbf, 0x6dc1, 0x6dbf, 0xa006,
- 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4,
- 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x1078, 0x6ecf, 0x017f,
- 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, 0x6b78, 0x037f, 0xa085,
- 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x348e, 0x157e, 0x017e,
- 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x7005, 0x2011, 0x7496,
- 0x1078, 0x5b6b, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005, 0x007c,
- 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091,
- 0x8000, 0x2061, 0x7600, 0x2079, 0x0001, 0x8fff, 0x0040, 0x6e4b,
- 0x2071, 0x7000, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x6e4b,
- 0x88ff, 0x0040, 0x6e11, 0x2800, 0xac06, 0x00c0, 0x6e41, 0x2079,
- 0x0000, 0x1078, 0x6ee7, 0x0040, 0x6e41, 0x2400, 0xac06, 0x0040,
- 0x6e41, 0x671c, 0xa786, 0x0006, 0x00c0, 0x6e41, 0xa786, 0x0007,
- 0x0040, 0x6e41, 0x88ff, 0x00c0, 0x6e29, 0x6018, 0xa206, 0x00c0,
- 0x6e41, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6e31, 0x1078,
- 0x1629, 0x6010, 0x2068, 0x1078, 0x6336, 0x0040, 0x6e3b, 0x047e,
- 0x1078, 0x6e8b, 0x047f, 0x0d7f, 0x1078, 0x6457, 0x88ff, 0x00c0,
- 0x6e54, 0xace0, 0x0008, 0x2001, 0x7015, 0x2004, 0xac02, 0x00c8,
- 0x6e4b, 0x0078, 0x6dfd, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, 0x6e4c,
- 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078,
- 0x5408, 0x1078, 0x54a9, 0x1078, 0x6df0, 0x087f, 0x007c, 0x027e,
- 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007e, 0x2009,
- 0x0000, 0x017e, 0x037e, 0x1078, 0x34fa, 0x00c0, 0x6e80, 0x2c10,
- 0x2041, 0x0000, 0x1078, 0x5408, 0x1078, 0x54a9, 0x1078, 0x6df0,
- 0x037f, 0x017f, 0x8108, 0x00f0, 0x6e71, 0x157f, 0x0c7f, 0x087f,
- 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x6e9f,
- 0x6800, 0xa07d, 0x0040, 0x6e9c, 0x6803, 0x0000, 0x6b52, 0x1078,
- 0x3840, 0x2f68, 0x0078, 0x6e90, 0x6b52, 0x1078, 0x3840, 0x0f7f,
- 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7600, 0x2071,
- 0x7000, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6eca, 0x2100,
- 0xac06, 0x0040, 0x6ebc, 0x6000, 0xa086, 0x0000, 0x0040, 0x6ebc,
- 0x6008, 0xa206, 0x0040, 0x6ec6, 0xace0, 0x0008, 0x2001, 0x7015,
- 0x2004, 0xac02, 0x00c8, 0x6eca, 0x0078, 0x6ea7, 0xa085, 0x0001,
- 0x0078, 0x6ecb, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e,
- 0x007e, 0x1078, 0x12e2, 0x007f, 0x1040, 0x1288, 0x6837, 0x010d,
- 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e, 0x6956,
- 0x6c46, 0x684f, 0x0000, 0x1078, 0x3840, 0x0d7f, 0x007c, 0x6700,
- 0xa786, 0x0000, 0x0040, 0x6efa, 0xa786, 0x0001, 0x0040, 0x6efa,
- 0xa786, 0x000a, 0x0040, 0x6efa, 0xa786, 0x0009, 0x0040, 0x6efa,
- 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206,
- 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071,
- 0x7040, 0xd5a4, 0x0040, 0x6f0f, 0x7034, 0x8000, 0x7036, 0xd5b4,
- 0x0040, 0x6f15, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6f1c,
- 0x2071, 0x704a, 0x1078, 0x6f4b, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7040, 0xd5a4,
- 0x0040, 0x6f2d, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6f33,
- 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6f3a, 0x2071, 0x704a,
- 0x1078, 0x6f4b, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e,
- 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7042, 0x1078, 0x6f4b, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8, 0x6f54,
- 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071, 0x7040,
- 0x1078, 0x6f4b, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7044, 0x1078,
- 0x6f4b, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010,
- 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000,
- 0x2000, 0x4000, 0x8000, 0xd13b
+ 0x78a0, 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d, 0x7044, 0xa084,
+ 0x0003, 0xa086, 0x0002, 0x00c0, 0x6529, 0x684f, 0x0040, 0x0078,
+ 0x6533, 0xa086, 0x0001, 0x00c0, 0x6531, 0x684f, 0x0080, 0x0078,
+ 0x6533, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001, 0x7090, 0xad90,
+ 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210, 0x00f0, 0x6539,
+ 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078, 0x35c4, 0x027f,
+ 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100,
+ 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x42c4, 0x1078, 0x4713,
+ 0x0078, 0x6547, 0x2069, 0x7092, 0x2d04, 0xa084, 0xff00, 0xa086,
+ 0x1200, 0x00c0, 0x6579, 0x2069, 0x7080, 0x686c, 0xa084, 0x00ff,
+ 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003,
+ 0x0001, 0x6007, 0x0043, 0x1078, 0x42c4, 0x1078, 0x4713, 0x0078,
+ 0x6547, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078,
+ 0x42c4, 0x1078, 0x4713, 0x0078, 0x6547, 0xa284, 0x0004, 0x00c0,
+ 0x658d, 0x6013, 0x0300, 0x0078, 0x658f, 0x6013, 0x0100, 0x6003,
+ 0x0001, 0x6007, 0x0041, 0x1078, 0x42c4, 0x1078, 0x4713, 0x0078,
+ 0x6547, 0x6013, 0x0500, 0x0078, 0x658f, 0x6013, 0x0600, 0x0078,
+ 0x655a, 0x6013, 0x0200, 0x0078, 0x655a, 0xa186, 0x0013, 0x00c0,
+ 0x65b7, 0x6004, 0xa08a, 0x0040, 0x1048, 0x126a, 0xa08a, 0x0050,
+ 0x10c8, 0x126a, 0xa082, 0x0040, 0x2008, 0x0079, 0x65e8, 0xa186,
+ 0x0047, 0x00c0, 0x65bd, 0x0078, 0x6617, 0xa186, 0x0027, 0x0040,
+ 0x65c5, 0xa186, 0x0014, 0x10c0, 0x126a, 0x6004, 0xa082, 0x0040,
+ 0x2008, 0x0079, 0x65cb, 0x65db, 0x65dd, 0x65dd, 0x65db, 0x65db,
+ 0x65db, 0x65db, 0x65db, 0x65db, 0x65db, 0x65db, 0x65db, 0x65db,
+ 0x65db, 0x65db, 0x65db, 0x1078, 0x126a, 0x2001, 0x0007, 0x1078,
+ 0x3324, 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c,
+ 0x65f8, 0x6608, 0x6601, 0x6611, 0x65f8, 0x65f8, 0x65f8, 0x65f8,
+ 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8, 0x65f8,
+ 0x1078, 0x126a, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400,
+ 0x200a, 0x1078, 0x461a, 0x6003, 0x0002, 0x1078, 0x4713, 0x007c,
+ 0x1078, 0x461a, 0x1078, 0x4145, 0x1078, 0x5425, 0x1078, 0x4713,
+ 0x007c, 0x1078, 0x461a, 0x2009, 0x0041, 0x0078, 0x66e1, 0xa182,
+ 0x0040, 0x0079, 0x661b, 0x662b, 0x662d, 0x662b, 0x662b, 0x662b,
+ 0x662b, 0x662b, 0x662e, 0x662b, 0x662b, 0x662b, 0x662b, 0x662b,
+ 0x662b, 0x662b, 0x662b, 0x1078, 0x126a, 0x007c, 0x6003, 0x0004,
+ 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1505,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x663d, 0x664d, 0x664d, 0x664d,
+ 0x664d, 0x664d, 0x664d, 0x664d, 0x664d, 0x664d, 0x664f, 0x6672,
+ 0x664d, 0x664d, 0x664d, 0x664d, 0x6672, 0x1078, 0x126a, 0x1078,
+ 0x46c2, 0x1078, 0x47c3, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc,
+ 0x0040, 0x6665, 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0040, 0x666b,
+ 0x2009, 0x0041, 0x0d7f, 0x0078, 0x66e1, 0x6003, 0x0007, 0x1078,
+ 0x4145, 0x0d7f, 0x007c, 0x1078, 0x4145, 0x1078, 0x5425, 0x0d7f,
+ 0x0078, 0x666a, 0x2001, 0x0007, 0x1078, 0x3324, 0x1078, 0x46c2,
+ 0x1078, 0x47c3, 0x6010, 0x0d7e, 0x2068, 0x037e, 0x2019, 0x0004,
+ 0x1078, 0x6ac6, 0x037f, 0x1078, 0x60e8, 0x0d7f, 0x007c, 0xa186,
+ 0x0013, 0x00c0, 0x6695, 0x6004, 0xa086, 0x0042, 0x10c0, 0x126a,
+ 0x1078, 0x461a, 0x1078, 0x4713, 0x007c, 0xa186, 0x0027, 0x0040,
+ 0x669d, 0xa186, 0x0014, 0x00c0, 0x66ad, 0x6004, 0xa086, 0x0042,
+ 0x10c0, 0x126a, 0x2001, 0x0007, 0x1078, 0x3324, 0x1078, 0x461a,
+ 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0xa182, 0x0040, 0x0079,
+ 0x66b1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1,
+ 0x66c3, 0x66cf, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1, 0x66c1,
+ 0x66c1, 0x1078, 0x126a, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18,
+ 0x3e20, 0x2c10, 0x1078, 0x1505, 0x047f, 0x037f, 0x007c, 0x6010,
+ 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x66db, 0x2009, 0x0041,
+ 0x0d7f, 0x0078, 0x66e1, 0x6003, 0x0007, 0x1078, 0x4145, 0x0d7f,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x66e5, 0x66f5, 0x66f7, 0x6703,
+ 0x670f, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5,
+ 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x66f5, 0x1078, 0x126a, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x42c4, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4713, 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x42c4,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x4713, 0x127f, 0x007c, 0x6003,
+ 0x0003, 0x6106, 0x2c10, 0x1078, 0x18d5, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x4330, 0x1078, 0x47c3, 0x127f, 0x007c, 0x1078, 0x461a,
+ 0x0078, 0x6724, 0x1078, 0x46c2, 0x6110, 0x81ff, 0x0040, 0x6731,
+ 0x0d7e, 0x2168, 0x037e, 0x2019, 0x0029, 0x1078, 0x6ac6, 0x037f,
+ 0x0d7f, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0xa182, 0x0085,
+ 0x0079, 0x673a, 0x6741, 0x6741, 0x6741, 0x6743, 0x6741, 0x6741,
+ 0x6741, 0x1078, 0x126a, 0x027e, 0x0e7e, 0x2071, 0x7080, 0x7220,
+ 0x1078, 0x69e0, 0x0040, 0x6750, 0x6007, 0x0086, 0x0078, 0x6752,
+ 0x6007, 0x0087, 0x6003, 0x0001, 0x1078, 0x42c4, 0x1078, 0x4713,
+ 0x0e7f, 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x676c, 0x6004,
+ 0xa08a, 0x0085, 0x1048, 0x126a, 0xa08a, 0x008c, 0x10c8, 0x126a,
+ 0xa082, 0x0085, 0x0079, 0x677f, 0xa186, 0x0027, 0x0040, 0x6774,
+ 0xa186, 0x0014, 0x10c0, 0x126a, 0x2001, 0x0007, 0x1078, 0x3324,
+ 0x1078, 0x461a, 0x1078, 0x60e8, 0x1078, 0x4713, 0x007c, 0x6786,
+ 0x6788, 0x6788, 0x6786, 0x6786, 0x6786, 0x6786, 0x1078, 0x126a,
+ 0x1078, 0x461a, 0x1078, 0x5425, 0x1078, 0x4713, 0x007c, 0xa182,
+ 0x0085, 0x1048, 0x126a, 0xa182, 0x008c, 0x10c8, 0x126a, 0xa182,
+ 0x0085, 0x0079, 0x679b, 0x67a2, 0x67a2, 0x67a2, 0x67a4, 0x67a2,
+ 0x67a2, 0x67a2, 0x1078, 0x126a, 0x007c, 0x1078, 0x461a, 0x1078,
+ 0x60e8, 0x1078, 0x4713, 0x007c, 0x037e, 0x2019, 0x000b, 0x1078,
+ 0x67b5, 0x601f, 0x0006, 0x037f, 0x007c, 0x127e, 0x037e, 0x087e,
+ 0x2091, 0x8000, 0x2c40, 0x1078, 0x5180, 0x00c0, 0x67e2, 0x1078,
+ 0x5221, 0x00c0, 0x67e2, 0x6000, 0xa086, 0x0000, 0x0040, 0x67e2,
+ 0x601c, 0xa086, 0x0007, 0x0040, 0x67e2, 0x0d7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x67d5, 0x1078, 0x15fc, 0x6010, 0x2068, 0x1078,
+ 0x5fcd, 0x0040, 0x67dd, 0x1078, 0x6ac6, 0x0d7f, 0x6013, 0x0000,
+ 0x601f, 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e, 0x0c7e,
+ 0x037e, 0x157e, 0x2079, 0x7080, 0x7838, 0xa084, 0x00ff, 0xa005,
+ 0x00c0, 0x681e, 0x783c, 0x1078, 0x1f61, 0x017e, 0x0c7e, 0x1078,
+ 0x336a, 0x00c0, 0x681c, 0x2011, 0x7090, 0xac98, 0x000a, 0x20a9,
+ 0x0004, 0x1078, 0x588d, 0x00c0, 0x681c, 0x017f, 0x027f, 0x027e,
+ 0x017e, 0x2019, 0x0029, 0x1078, 0x52f5, 0x1078, 0x43ff, 0x1078,
+ 0x4344, 0x017f, 0x1078, 0x6946, 0x1078, 0x34f2, 0x017f, 0x1078,
+ 0x316e, 0xa006, 0x0078, 0x681e, 0x0c7f, 0x017f, 0x157f, 0x037f,
+ 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x6c1c,
+ 0x2104, 0xa086, 0x0074, 0x00c0, 0x687a, 0x2069, 0x708e, 0x690c,
+ 0xa182, 0x0100, 0x0048, 0x686a, 0x6908, 0xa184, 0x8000, 0x0040,
+ 0x6876, 0xa184, 0x0800, 0x0040, 0x6876, 0x6910, 0xa18a, 0x0001,
+ 0x0048, 0x686e, 0x6914, 0x2069, 0x70ae, 0x6904, 0x81ff, 0x00c0,
+ 0x6862, 0x690c, 0xa182, 0x0100, 0x0048, 0x686a, 0x6908, 0x81ff,
+ 0x00c0, 0x6866, 0x6910, 0xa18a, 0x0001, 0x0048, 0x686e, 0x6918,
+ 0xa18a, 0x0001, 0x0048, 0x6876, 0x0078, 0x6880, 0x6013, 0x0100,
+ 0x0078, 0x687c, 0x6013, 0x0300, 0x0078, 0x687c, 0x6013, 0x0500,
+ 0x0078, 0x687c, 0x6013, 0x0700, 0x0078, 0x687c, 0x6013, 0x0900,
+ 0x0078, 0x687c, 0x6013, 0x0b00, 0x0078, 0x687c, 0x6013, 0x0f00,
+ 0x0078, 0x687c, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x6881,
+ 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e,
+ 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286,
+ 0x0006, 0x0040, 0x68a9, 0xa286, 0x0004, 0x0040, 0x68a9, 0xa394,
+ 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x68a9, 0xa286, 0x0004,
+ 0x0040, 0x68a9, 0x0c7e, 0x2d60, 0x1078, 0x337c, 0x0c7f, 0x0078,
+ 0x68dc, 0x2011, 0x7096, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x588d, 0x00c0, 0x68dd, 0x2011, 0x709a, 0xad98, 0x0006, 0x20a9,
+ 0x0004, 0x1078, 0x588d, 0x00c0, 0x68dd, 0x047e, 0x017e, 0x6aa0,
+ 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x6c52, 0x210c, 0xd1a4,
+ 0x0040, 0x68d1, 0x2009, 0x0029, 0x1078, 0x6b0a, 0x6800, 0xc0e5,
+ 0x6802, 0x2019, 0x0029, 0x1078, 0x43ff, 0x1078, 0x4344, 0x2c08,
+ 0x1078, 0x6946, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f,
+ 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0x708e, 0x6800, 0xa086,
+ 0x0800, 0x0040, 0x68ef, 0x6013, 0x0000, 0x0078, 0x68f0, 0xa006,
+ 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e,
+ 0x2079, 0x708c, 0x7830, 0xa00d, 0x00c0, 0x6917, 0x7834, 0x1078,
+ 0x1f61, 0x1078, 0x336a, 0x00c0, 0x6917, 0x2011, 0x7090, 0xac98,
+ 0x000a, 0x20a9, 0x0004, 0x1078, 0x588d, 0x00c0, 0x6917, 0x2011,
+ 0x7094, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x588d, 0x157f,
+ 0x037f, 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e,
+ 0x017e, 0x027e, 0x037e, 0x157e, 0x2011, 0x7083, 0x2204, 0x1078,
+ 0x1f61, 0x1078, 0x336a, 0x00c0, 0x693f, 0x2011, 0x7096, 0xac98,
+ 0x000a, 0x20a9, 0x0004, 0x1078, 0x588d, 0x00c0, 0x693f, 0x2011,
+ 0x709a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x588d, 0x157f,
+ 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e,
+ 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091, 0x8000,
+ 0x2029, 0x6db9, 0x252c, 0x2021, 0x6dbf, 0x2424, 0x2061, 0x7200,
+ 0x2071, 0x6c00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x69a9,
+ 0x2100, 0xac06, 0x0040, 0x699f, 0x1078, 0x6b22, 0x0040, 0x699f,
+ 0x671c, 0xa786, 0x0001, 0x0040, 0x69be, 0xa786, 0x0007, 0x0040,
+ 0x699f, 0x2500, 0xac06, 0x0040, 0x699f, 0x2400, 0xac06, 0x0040,
+ 0x699f, 0x1078, 0x6b36, 0x00c0, 0x699f, 0x0d7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x6987, 0x017e, 0x1078, 0x15fc, 0x017f, 0x6010,
+ 0x2068, 0x1078, 0x5fcd, 0x0040, 0x699c, 0xa786, 0x0003, 0x00c0,
+ 0x69b2, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x017e, 0x1078,
+ 0x35c4, 0x017f, 0x1078, 0x60db, 0x0d7f, 0x1078, 0x60e8, 0xace0,
+ 0x0008, 0x2001, 0x6c15, 0x2004, 0xac02, 0x00c8, 0x69a9, 0x0078,
+ 0x6958, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f,
+ 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x6991, 0xa386, 0x0005,
+ 0x0040, 0x699f, 0x1078, 0x6ac6, 0x0078, 0x699c, 0x1078, 0x6b36,
+ 0x00c0, 0x699f, 0xa180, 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0,
+ 0x699f, 0x6000, 0xa086, 0x0002, 0x00c0, 0x699f, 0x1078, 0x6101,
+ 0x0040, 0x69da, 0x1078, 0x6115, 0x00c0, 0x699f, 0x1078, 0x5614,
+ 0x0078, 0x69dc, 0x1078, 0x2143, 0x1078, 0x60e8, 0x0078, 0x699f,
+ 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078, 0x6add, 0x017f,
+ 0x0040, 0x69ef, 0x601c, 0xa084, 0x0007, 0x1079, 0x69f2, 0x0e7f,
+ 0x0c7f, 0x007c, 0x69fa, 0x69fa, 0x69fa, 0x69fa, 0x69fa, 0x69fa,
+ 0x69fc, 0x69fa, 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, 0xa080,
+ 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020,
+ 0x1078, 0x6b0a, 0x017f, 0x047f, 0x037e, 0x2019, 0x0002, 0x1078,
+ 0x67b5, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0001, 0x1078,
+ 0x3302, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019,
+ 0x6c05, 0x2011, 0x7096, 0x1078, 0x588d, 0x037f, 0x027f, 0x017f,
+ 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e,
+ 0x027e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7200, 0x2079, 0x0001,
+ 0x8fff, 0x0040, 0x6a86, 0x2071, 0x6c00, 0x7644, 0x7060, 0x8001,
+ 0xa602, 0x00c8, 0x6a86, 0x88ff, 0x0040, 0x6a4c, 0x2800, 0xac06,
+ 0x00c0, 0x6a7c, 0x2079, 0x0000, 0x1078, 0x6b22, 0x0040, 0x6a7c,
+ 0x2400, 0xac06, 0x0040, 0x6a7c, 0x671c, 0xa786, 0x0006, 0x00c0,
+ 0x6a7c, 0xa786, 0x0007, 0x0040, 0x6a7c, 0x88ff, 0x00c0, 0x6a64,
+ 0x6018, 0xa206, 0x00c0, 0x6a7c, 0x0d7e, 0x6000, 0xa086, 0x0004,
+ 0x00c0, 0x6a6c, 0x1078, 0x15fc, 0x6010, 0x2068, 0x1078, 0x5fcd,
+ 0x0040, 0x6a76, 0x047e, 0x1078, 0x6ac6, 0x047f, 0x0d7f, 0x1078,
+ 0x60e8, 0x88ff, 0x00c0, 0x6a8f, 0xace0, 0x0008, 0x2001, 0x6c15,
+ 0x2004, 0xac02, 0x00c8, 0x6a86, 0x0078, 0x6a38, 0xa006, 0x127f,
+ 0x027f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5,
+ 0x0001, 0x0078, 0x6a87, 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019,
+ 0x0002, 0x6218, 0x1078, 0x5180, 0x1078, 0x5221, 0x1078, 0x6a2b,
+ 0x087f, 0x007c, 0x027e, 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20,
+ 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e, 0x037e, 0x1078, 0x336a,
+ 0x00c0, 0x6abb, 0x2c10, 0x2041, 0x0000, 0x1078, 0x5180, 0x1078,
+ 0x5221, 0x1078, 0x6a2b, 0x037f, 0x017f, 0x8108, 0x00f0, 0x6aac,
+ 0x157f, 0x0c7f, 0x087f, 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e,
+ 0x8dff, 0x0040, 0x6ada, 0x6800, 0xa07d, 0x0040, 0x6ad7, 0x6803,
+ 0x0000, 0x6b52, 0x1078, 0x35c4, 0x2f68, 0x0078, 0x6acb, 0x6b52,
+ 0x1078, 0x35c4, 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e,
+ 0x2061, 0x7200, 0x2071, 0x6c00, 0x7444, 0x7060, 0x8001, 0xa402,
+ 0x00c8, 0x6b05, 0x2100, 0xac06, 0x0040, 0x6af7, 0x6000, 0xa086,
+ 0x0000, 0x0040, 0x6af7, 0x6008, 0xa206, 0x0040, 0x6b01, 0xace0,
+ 0x0008, 0x2001, 0x6c15, 0x2004, 0xac02, 0x00c8, 0x6b05, 0x0078,
+ 0x6ae2, 0xa085, 0x0001, 0x0078, 0x6b06, 0xa006, 0x037f, 0x047f,
+ 0x0e7f, 0x007c, 0x0d7e, 0x007e, 0x1078, 0x12c2, 0x007f, 0x1040,
+ 0x126a, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b,
+ 0x0000, 0x685e, 0x6956, 0x6c46, 0x684f, 0x0000, 0x1078, 0x35c4,
+ 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, 0x0040, 0x6b35, 0xa786,
+ 0x0001, 0x0040, 0x6b35, 0xa786, 0x000a, 0x0040, 0x6b35, 0xa786,
+ 0x0009, 0x0040, 0x6b35, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018,
+ 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e,
+ 0x2091, 0x8000, 0x2071, 0x6c40, 0xd5a4, 0x0040, 0x6b4a, 0x7034,
+ 0x8000, 0x7036, 0xd5b4, 0x0040, 0x6b50, 0x7030, 0x8000, 0x7032,
+ 0xd5ac, 0x0040, 0x6b57, 0x2071, 0x6c4a, 0x1078, 0x6b86, 0x0e7f,
+ 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
+ 0x2071, 0x6c40, 0xd5a4, 0x0040, 0x6b68, 0x7034, 0x8000, 0x7036,
+ 0xd5b4, 0x0040, 0x6b6e, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040,
+ 0x6b75, 0x2071, 0x6c4a, 0x1078, 0x6b86, 0x0e7f, 0x007f, 0x127f,
+ 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6c42,
+ 0x1078, 0x6b86, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000,
+ 0x2072, 0x00c8, 0x6b8f, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c,
+ 0x0e7e, 0x2071, 0x6c40, 0x1078, 0x6b86, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6c44, 0x1078, 0x6b86, 0x0e7f, 0x007c, 0x0001, 0x0002,
+ 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
+ 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x3cfe
};
-#define ISP2100_CODE_LENGTH 0x5f74
+#define ISP2100_CODE_LENGTH 0x5baf
#endif
-#if defined(ISP2100_FABRIC) && !defined(ISP2100_SCCLUN)
+#if 1
/************************************************************************
* *
- * --- ISP2100 Fabric Initiator/Target Firmware --- *
+ * --- ISP2100 Initiator/Target Firmware --- *
* *
* *
************************************************************************
@@ -8141,618 +9209,580 @@ static const u_int16_t ISP2100_RISC_CODE[] = {
************************************************************************
*/
/*
- * Firmware Version 1.15.07 (14:45 Oct 13, 1998)
+ * Firmware Version 1.15.00 (12:09 Sep 10, 1998)
*/
-
+#define ISP2100_CODE_VERSION 1*1024+15
static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x6591, 0x0000, 0x2043, 0x4f50, 0x5952,
+ 0x0078, 0x1029, 0x0000, 0x5e35, 0x0000, 0x2043, 0x4f50, 0x5952,
0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x7591, 0x2009, 0x0000, 0x20a9,
- 0x076f, 0x41a4, 0x3400, 0x20c9, 0x7aff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x2074, 0x2051, 0x7600,
- 0x2a70, 0x705b, 0x9500, 0x705f, 0xffff, 0x7057, 0x94f9, 0x7063,
- 0x0300, 0x1078, 0x1282, 0x20a1, 0x7d00, 0x715c, 0x810d, 0x810d,
+ 0x2400, 0x20c1, 0x0021, 0x20a1, 0x6e35, 0x2009, 0x0000, 0x20a9,
+ 0x06cb, 0x41a4, 0x3400, 0x20c9, 0x72ff, 0x2091, 0x2000, 0x2059,
+ 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x1fbd, 0x2051, 0x6f00,
+ 0x2a70, 0x705b, 0x8d00, 0x705f, 0xffff, 0x7057, 0x8cf9, 0x7063,
+ 0x0300, 0x1078, 0x1233, 0x20a1, 0x7500, 0x715c, 0x810d, 0x810d,
0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1249, 0x1078, 0x136e, 0x1078, 0x14f3, 0x1078, 0x19a0,
- 0x1078, 0x35cf, 0x1078, 0x5b46, 0x1078, 0x12f9, 0x1078, 0x2403,
- 0x1078, 0x3c08, 0x1078, 0x39e0, 0x1078, 0x4446, 0x1078, 0x1e2f,
- 0x1078, 0x4685, 0x1078, 0x4126, 0x1078, 0x1d4e, 0x1078, 0x1e0e,
+ 0x1078, 0x11fe, 0x1078, 0x131f, 0x1078, 0x14a4, 0x1078, 0x1915,
+ 0x1078, 0x328f, 0x1078, 0x5533, 0x1078, 0x12aa, 0x1078, 0x22c3,
+ 0x1078, 0x38c8, 0x1078, 0x36a0, 0x1078, 0x4079, 0x1078, 0x1d9b,
+ 0x1078, 0x42b8, 0x1078, 0x3de6, 0x1078, 0x1cc3, 0x1078, 0x1d7a,
0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2d45, 0x1078, 0x242b, 0x1078, 0x3c58,
- 0x1078, 0x3acb, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x445e, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5818, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x114b,
- 0x10cd, 0x11c6, 0x1246, 0x1247, 0x1248, 0x1078, 0x12d5, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2e6a, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x113c, 0x2011, 0x34fc, 0x1078, 0x4520,
+ 0x00c0, 0x10bd, 0x1078, 0x2a07, 0x1078, 0x22eb, 0x1078, 0x3918,
+ 0x1078, 0x378b, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
+ 0x10c1, 0x1078, 0x4091, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
+ 0x10aa, 0x1078, 0x5205, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x112a,
+ 0x10cd, 0x117d, 0x11fb, 0x11fc, 0x11fd, 0x1078, 0x1286, 0x007c,
+ 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2b2a, 0x2079, 0x0100,
+ 0x7844, 0xa005, 0x00c0, 0x1127, 0x2011, 0x31bc, 0x1078, 0x4153,
0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b8, 0x1078, 0x2d02, 0x1078, 0x5663, 0x2011, 0x0004, 0x1078,
- 0x68f8, 0x1078, 0x397a, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3,
- 0x0000, 0x1078, 0x113f, 0x2011, 0x0000, 0x2079, 0x7651, 0x7804,
- 0xd0ac, 0x0040, 0x1104, 0xc295, 0x70a4, 0xa005, 0x0040, 0x1109,
- 0xc29d, 0x72be, 0xa296, 0x0004, 0x0040, 0x112a, 0x2011, 0x0001,
- 0x1078, 0x68f8, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x0f7f, 0x1078, 0x2124, 0x2011, 0x0005, 0x1078, 0x5772, 0x1078,
- 0x4c2c, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f,
- 0x0078, 0x113e, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x2011, 0x0005, 0x1078, 0x5772, 0x1078, 0x4c2c, 0x0c7e, 0x2061,
- 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f, 0x127f, 0x007c, 0x0c7e,
- 0x20a9, 0x0082, 0x2009, 0x007e, 0x1078, 0x37bf, 0x8108, 0x00f0,
- 0x1144, 0x0c7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086,
- 0xffff, 0x0040, 0x1159, 0x1078, 0x2124, 0x1078, 0x4c2c, 0x0078,
- 0x11c4, 0x70bc, 0xd09c, 0x0040, 0x1181, 0xd084, 0x0040, 0x1181,
- 0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c,
- 0x0040, 0x1181, 0x70c0, 0xa086, 0xffff, 0x0040, 0x117d, 0x1078,
- 0x2219, 0x1078, 0x4c2c, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078,
- 0x2251, 0x1078, 0x4c2c, 0x0078, 0x11c4, 0x70c4, 0xa005, 0x00c0,
- 0x11c4, 0x7088, 0xa005, 0x00c0, 0x11c4, 0x2001, 0x7652, 0x2004,
- 0xd0ac, 0x0040, 0x11a7, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009,
- 0x0000, 0x017e, 0x1078, 0x37d7, 0x00c0, 0x119a, 0x6000, 0xd0ec,
- 0x00c0, 0x11a2, 0x017f, 0x8108, 0x00f0, 0x1191, 0x0c7f, 0x157f,
- 0x0078, 0x11a7, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x11c4, 0x7003,
- 0x0003, 0x708f, 0xffff, 0x2001, 0x0000, 0x1078, 0x1fff, 0x1078,
- 0x2d80, 0x2001, 0x7837, 0x2004, 0xa086, 0x0005, 0x00c0, 0x11bc,
- 0x2011, 0x0000, 0x1078, 0x5772, 0x2011, 0x0000, 0x1078, 0x577c,
- 0x1078, 0x4c2c, 0x1078, 0x4cec, 0x127f, 0x007c, 0x017e, 0x0f7e,
- 0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010,
- 0x7942, 0x7924, 0xd1b4, 0x0040, 0x11d7, 0x7827, 0x0040, 0xd19c,
- 0x0040, 0x11dc, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900,
- 0xa18a, 0x0003, 0x0050, 0x1202, 0x7954, 0xd1ac, 0x00c0, 0x1202,
- 0x2009, 0x00f8, 0x1078, 0x359e, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11fa, 0x7824, 0xd0ac,
- 0x00c0, 0x1236, 0x00f0, 0x11f2, 0x2001, 0x0001, 0x1078, 0x1fff,
- 0x0078, 0x123f, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008,
- 0x00e0, 0x1208, 0x2091, 0x6000, 0x00f0, 0x1208, 0x7853, 0x0400,
- 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x359e, 0x20a9, 0x000e,
- 0x0005, 0x00f0, 0x1218, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843,
- 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040,
- 0x122d, 0x7824, 0xd0ac, 0x00c0, 0x1236, 0x8319, 0x00c0, 0x1223,
- 0x2001, 0x0001, 0x1078, 0x1fff, 0x0078, 0x123d, 0x7828, 0xc09d,
- 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f,
- 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c,
- 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x1255, 0x704f, 0xffff, 0x0078, 0x1257, 0x704f, 0x0000, 0x7053,
- 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061, 0x7820, 0x6003,
- 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013,
- 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061,
- 0x7828, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f,
- 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f,
- 0x0000, 0x007c, 0x1078, 0x12a8, 0x2011, 0x0000, 0x81ff, 0x0040,
- 0x12a7, 0xa186, 0x0001, 0x00c0, 0x1297, 0x705f, 0x8fff, 0x7057,
- 0x8501, 0x7063, 0x0100, 0x705b, 0x8500, 0x0078, 0x12a5, 0xa186,
- 0x0002, 0x00c0, 0x129f, 0x2011, 0x0000, 0x0078, 0x12a5, 0xa186,
- 0x0005, 0x00c0, 0x12a5, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c,
- 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12cf, 0x2019, 0xaaaa,
- 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, 0x2c04, 0xa406,
- 0x0040, 0x12bd, 0xc18d, 0x0078, 0x12ca, 0xc185, 0x2011, 0x0001,
- 0x1078, 0x12cf, 0x2061, 0xffff, 0x2362, 0x2c04, 0xa306, 0x00c0,
- 0x12ca, 0xc195, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c, 0x3800,
- 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, 0x8000, 0x0068,
- 0x12d7, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, 0xa084, 0x0000,
- 0x00c0, 0x12dd, 0x017f, 0x792e, 0x007f, 0x782a, 0x007f, 0x7826,
- 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2079, 0x7600, 0x7803, 0x0005, 0x0078, 0x12f6,
- 0x007c, 0x2071, 0x7600, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190,
- 0x002d, 0xa298, 0x002d, 0x0048, 0x130f, 0x705c, 0xa302, 0x00c8,
- 0x130f, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x1301, 0x200b,
- 0x0000, 0x749e, 0x74a2, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x7600, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1322, 0xa06e,
- 0x0078, 0x132c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e,
- 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e,
- 0x2071, 0x7600, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8,
- 0x133c, 0xa06e, 0x0078, 0x1345, 0x70a2, 0x702c, 0x2068, 0x2d04,
+ 0x73b0, 0x1078, 0x29c6, 0x1078, 0x5050, 0x2011, 0x0004, 0x1078,
+ 0x61f1, 0x1078, 0x363a, 0x2079, 0x6f51, 0x7804, 0xd0ac, 0x00c0,
+ 0x1115, 0x2011, 0x0001, 0x1078, 0x61f1, 0x7083, 0x0000, 0x7087,
+ 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x206d, 0x2011, 0x0005,
+ 0x1078, 0x515f, 0x1078, 0x484d, 0x0c7e, 0x2061, 0x0100, 0x60e3,
+ 0x0008, 0x0c7f, 0x127f, 0x0078, 0x1129, 0x7083, 0x0000, 0x7087,
+ 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x515f, 0x1078,
+ 0x484d, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f,
+ 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x7084, 0xa086, 0xffff,
+ 0x0040, 0x1138, 0x1078, 0x206d, 0x1078, 0x484d, 0x0078, 0x117b,
+ 0x7080, 0xa005, 0x00c0, 0x117b, 0x2001, 0x6f52, 0x2004, 0xd0ac,
+ 0x0040, 0x115e, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000,
+ 0x017e, 0x1078, 0x3497, 0x00c0, 0x1151, 0x6000, 0xd0ec, 0x00c0,
+ 0x1159, 0x017f, 0x8108, 0x00f0, 0x1148, 0x0c7f, 0x157f, 0x0078,
+ 0x115e, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x117b, 0x7003, 0x0003,
+ 0x7087, 0xffff, 0x2001, 0x0000, 0x1078, 0x1f5e, 0x1078, 0x2a40,
+ 0x2001, 0x70b7, 0x2004, 0xa086, 0x0005, 0x00c0, 0x1173, 0x2011,
+ 0x0000, 0x1078, 0x515f, 0x2011, 0x0000, 0x1078, 0x5169, 0x1078,
+ 0x484d, 0x1078, 0x48fd, 0x127f, 0x007c, 0x017e, 0x0f7e, 0x127e,
+ 0x2091, 0x8000, 0x2079, 0x0100, 0x7843, 0x0000, 0x7924, 0xd1b4,
+ 0x0040, 0x118c, 0x7827, 0x0040, 0xd19c, 0x0040, 0x1191, 0x7827,
+ 0x0008, 0x007e, 0x037e, 0x157e, 0x7900, 0xa18a, 0x0003, 0x0050,
+ 0x11b7, 0x7954, 0xd1ac, 0x00c0, 0x11b7, 0x2009, 0x00f8, 0x1078,
+ 0x325e, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820,
+ 0xd09c, 0x00c0, 0x11af, 0x7824, 0xd0ac, 0x00c0, 0x11eb, 0x00f0,
+ 0x11a7, 0x2001, 0x0001, 0x1078, 0x1f5e, 0x0078, 0x11f4, 0x7853,
+ 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008, 0x00e0, 0x11bd, 0x2091,
+ 0x6000, 0x00f0, 0x11bd, 0x7853, 0x0400, 0x782f, 0x0000, 0x2009,
+ 0x00f8, 0x1078, 0x325e, 0x20a9, 0x000e, 0x0005, 0x00f0, 0x11cd,
+ 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010, 0x2019, 0x61a8,
+ 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x11e2, 0x7824, 0xd0ac,
+ 0x00c0, 0x11eb, 0x8319, 0x00c0, 0x11d8, 0x2001, 0x0001, 0x1078,
+ 0x1f5e, 0x0078, 0x11f2, 0x7828, 0xc09d, 0x782a, 0x7827, 0x0008,
+ 0x7827, 0x0040, 0x7853, 0x0400, 0x157f, 0x037f, 0x007f, 0x127f,
+ 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c, 0x2a70, 0x2009,
+ 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, 0x120a, 0x704f, 0xffff,
+ 0x0078, 0x120c, 0x704f, 0x0000, 0x7053, 0xffff, 0x2061, 0x70a0,
+ 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200,
+ 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0,
+ 0x2061, 0x70a8, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000,
+ 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001,
+ 0x601f, 0x0000, 0x007c, 0x1078, 0x1259, 0x2011, 0x0000, 0x81ff,
+ 0x0040, 0x1258, 0xa186, 0x0001, 0x00c0, 0x1248, 0x705f, 0x8fff,
+ 0x7057, 0x7d01, 0x7063, 0x0100, 0x705b, 0x7d00, 0x0078, 0x1256,
+ 0xa186, 0x0002, 0x00c0, 0x1250, 0x2011, 0x0000, 0x0078, 0x1256,
+ 0xa186, 0x0005, 0x00c0, 0x1256, 0x2011, 0x0001, 0x1078, 0x1280,
+ 0x007c, 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x1280, 0x2019,
+ 0xaaaa, 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, 0x2c04,
+ 0xa406, 0x0040, 0x126e, 0xc18d, 0x0078, 0x127b, 0xc185, 0x2011,
+ 0x0001, 0x1078, 0x1280, 0x2061, 0xffff, 0x2362, 0x2c04, 0xa306,
+ 0x00c0, 0x127b, 0xc195, 0x2011, 0x0001, 0x1078, 0x1280, 0x007c,
+ 0x3800, 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, 0x8000,
+ 0x0068, 0x1288, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, 0xa084,
+ 0x0000, 0x00c0, 0x128e, 0x017f, 0x792e, 0x007f, 0x782a, 0x007f,
+ 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091,
+ 0x5000, 0x2091, 0x4080, 0x2079, 0x6f00, 0x7803, 0x0005, 0x0078,
+ 0x12a7, 0x007c, 0x2071, 0x6f00, 0x7158, 0x712e, 0x2021, 0x0001,
+ 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, 0x12c0, 0x705c, 0xa302,
+ 0x00c8, 0x12c0, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x12b2,
+ 0x200b, 0x0000, 0x7496, 0x749a, 0x007c, 0x0e7e, 0x127e, 0x2091,
+ 0x8000, 0x2071, 0x6f00, 0x7098, 0xa0ea, 0x0010, 0x00c8, 0x12d3,
+ 0xa06e, 0x0078, 0x12dd, 0x8001, 0x709a, 0x702c, 0x2068, 0x2d04,
0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c,
- 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7600, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x127f, 0x0e7f, 0x007c,
- 0x8dff, 0x0040, 0x1364, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078,
- 0x1348, 0x0d7f, 0x0078, 0x1358, 0x007c, 0x0e7e, 0x2071, 0x7600,
- 0x70a0, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
- 0x7859, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071,
- 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c, 0x0e7e,
- 0x2270, 0x700b, 0x0000, 0x2071, 0x7859, 0x7018, 0xa088, 0x7862,
- 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0,
- 0x1397, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x7859, 0x7004, 0xa005, 0x00c0, 0x13a6,
- 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f, 0x007c,
- 0x7000, 0x0079, 0x13ab, 0x13af, 0x1419, 0x1436, 0x1436, 0x7018,
- 0x711c, 0xa106, 0x00c0, 0x13b7, 0x7007, 0x0000, 0x007c, 0x0d7e,
- 0xa180, 0x7862, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007,
- 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c,
- 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804,
- 0x0d7f, 0xd084, 0x0040, 0x13d9, 0x7007, 0x0001, 0x1078, 0x13de,
- 0x007c, 0x7007, 0x0002, 0x1078, 0x13f4, 0x007c, 0x017e, 0x027e,
- 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e9, 0x2110,
- 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e,
- 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c,
- 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1408, 0x2110, 0xa006,
- 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x76e5, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b,
- 0x76e0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e,
- 0x157e, 0x2001, 0x7714, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026,
- 0x2001, 0x7715, 0x20ac, 0x53a6, 0x2099, 0x7716, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b,
- 0x7711, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e,
- 0x2071, 0x7859, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002,
- 0xd1fc, 0x0040, 0x1479, 0xa18c, 0x0700, 0x0040, 0x1476, 0x7008,
- 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1479, 0x7004, 0x1079,
- 0x147d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x13a8, 0x1485, 0x14a7,
- 0x14c1, 0x14ea, 0x1483, 0x0078, 0x1483, 0x137e, 0x147e, 0x157e,
- 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8,
- 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c, 0xa005,
- 0x0040, 0x14ae, 0x1078, 0x13de, 0x007c, 0x7008, 0xa080, 0x0002,
- 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x13a8, 0x007c, 0x700c,
- 0xa005, 0x0040, 0x14ae, 0x1078, 0x13f4, 0x007c, 0x0d7e, 0x7008,
- 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c,
- 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x13a8,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x76e3, 0x2004, 0xa080,
- 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020,
- 0x53a5, 0x2001, 0x76e5, 0x2004, 0xd0bc, 0x0040, 0x14e0, 0x2001,
- 0x76ee, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5,
- 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x3d01, 0x1078,
- 0x13a8, 0x007c, 0x2001, 0x7713, 0x2003, 0x0100, 0x7007, 0x0000,
- 0x1078, 0x13a8, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030,
- 0x2071, 0x786a, 0x7003, 0x0000, 0x700f, 0x7870, 0x7013, 0x7870,
- 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079,
- 0x1509, 0x1511, 0x1557, 0x1511, 0x1511, 0x1511, 0x153c, 0x1520,
- 0x1515, 0xa085, 0x0001, 0x0078, 0x1571, 0x684c, 0xd0bc, 0x0040,
- 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x155f,
- 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x1511, 0x684c, 0xd0bc,
- 0x0040, 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0x6858, 0x0078, 0x1567, 0xa18c, 0x00ff, 0xa186, 0x0015,
- 0x00c0, 0x1511, 0x684c, 0xd0ac, 0x0040, 0x1511, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x1567, 0x684c,
- 0xd0ac, 0x0040, 0x1511, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c,
- 0x000f, 0xa188, 0x1c5c, 0x210c, 0x6932, 0x2d08, 0x691a, 0x6826,
- 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a,
- 0x2004, 0x82ff, 0x0040, 0x158c, 0xa280, 0x0004, 0x0d7e, 0x206c,
- 0x684c, 0xd0dc, 0x00c0, 0x1588, 0x1078, 0x1504, 0x10c0, 0x12d5,
- 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, 0x027e,
- 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, 0x00c0,
- 0x15a0, 0x7206, 0x2001, 0x15b4, 0x007e, 0x2260, 0x0078, 0x16cc,
- 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182,
- 0x788b, 0x0048, 0x15ad, 0x2009, 0x7870, 0x710e, 0x7000, 0xa005,
- 0x00c0, 0x15b4, 0x1078, 0x16b5, 0x127f, 0x007c, 0x127e, 0x027e,
- 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, 0x037f,
- 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e,
- 0xa005, 0x0040, 0x1608, 0x6808, 0xa005, 0x0040, 0x166e, 0x7000,
- 0xa005, 0x00c0, 0x15d5, 0x0078, 0x1602, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x1672, 0x7004, 0xa406, 0x00c0, 0x1602, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15eb, 0x047e, 0x1078, 0x17a5, 0x047f,
- 0x2460, 0x0078, 0x15cb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15de, 0x7804, 0xa084, 0x6000, 0x0040, 0x15fc, 0xa086, 0x6000,
- 0x0040, 0x15fc, 0x0078, 0x15de, 0x7803, 0x0004, 0x7003, 0x0000,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5bdb, 0x0078, 0x1672,
- 0x6808, 0xa005, 0x0040, 0x166e, 0x7000, 0xa005, 0x00c0, 0x1612,
- 0x0078, 0x166e, 0x700c, 0x7110, 0xa106, 0x00c0, 0x161b, 0x7004,
- 0xa406, 0x00c0, 0x166e, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040,
- 0x1628, 0x047e, 0x1078, 0x17a5, 0x047f, 0x2460, 0x0078, 0x1608,
- 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x161b, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x00c0, 0x1621, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x163f, 0xa086, 0x6000, 0x0040, 0x163f, 0x0078, 0x161b, 0x7007,
- 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x1660,
- 0xa08e, 0x0002, 0x00c0, 0x166e, 0x0c7e, 0x0e7e, 0x6818, 0x2060,
- 0x1078, 0x1c31, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x165c,
- 0x7308, 0x720c, 0x0078, 0x165e, 0x7310, 0x7214, 0x0e7f, 0x0c7f,
- 0x7820, 0xa318, 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814,
- 0xa201, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x2009, 0x0048,
- 0x1078, 0x5bdb, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, 0x0e7e,
- 0x2071, 0x786a, 0x7000, 0xa086, 0x0000, 0x0040, 0x16b2, 0x7004,
- 0xac06, 0x00c0, 0x16a3, 0x2079, 0x0030, 0x7804, 0xd0fc, 0x00c0,
- 0x169f, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1685, 0x7803,
- 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1691, 0x7803, 0x0002, 0x7803,
- 0x0009, 0x7003, 0x0003, 0x7007, 0x0000, 0x0078, 0x16a3, 0x1078,
- 0x17a5, 0x0078, 0x167a, 0x157e, 0x20a9, 0x0009, 0x2009, 0x7870,
- 0x2104, 0xac06, 0x00c0, 0x16ad, 0x200a, 0xa188, 0x0003, 0x00f0,
- 0x16a8, 0x157f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x16bd, 0x7003, 0x0000, 0x007c, 0x2104, 0x7006, 0x2060,
- 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0x788b, 0x0048,
- 0x16cb, 0x2009, 0x7870, 0x7112, 0x8cff, 0x00c0, 0x16eb, 0x7908,
- 0xd1ec, 0x00c0, 0x16df, 0x1078, 0x197e, 0x0040, 0x16df, 0x7803,
- 0x0009, 0x7904, 0xd1fc, 0x0040, 0x16d9, 0x7803, 0x0006, 0x7007,
- 0x0000, 0x1078, 0x197e, 0x0040, 0x1712, 0x7803, 0x0019, 0x7003,
- 0x0003, 0x0078, 0x1712, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406,
- 0x00c0, 0x16f6, 0x682c, 0xa306, 0x0040, 0x16fa, 0x1078, 0x1c7c,
- 0x00c0, 0x16cf, 0x684c, 0xd0f4, 0x00c0, 0x16cf, 0x6824, 0x2050,
- 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009,
- 0x0011, 0x1078, 0x1713, 0x0040, 0x1711, 0x2009, 0x0001, 0x1078,
- 0x1713, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x17a0, 0xa03e, 0x2730,
- 0x6850, 0xd0fc, 0x00c0, 0x1732, 0x0d7e, 0x2804, 0xac68, 0x2900,
- 0x0079, 0x1722, 0x1782, 0x1742, 0x1742, 0x1782, 0x1782, 0x177a,
- 0x1782, 0x1742, 0x1782, 0x1748, 0x1748, 0x1782, 0x1782, 0x1782,
- 0x1771, 0x1748, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20,
- 0x0d7e, 0xd99c, 0x0040, 0x1785, 0x2804, 0xac68, 0x6f08, 0x6e0c,
- 0x0078, 0x1785, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1785,
- 0x7b0c, 0xd3bc, 0x0040, 0x1769, 0x7004, 0x0e7e, 0x2070, 0x701c,
- 0x0e7f, 0xa086, 0x0008, 0x00c0, 0x1769, 0x7b08, 0xa39c, 0x0fff,
- 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, 0x82ff, 0x00c0, 0x1764, 0x6810,
- 0xa302, 0x0048, 0x1764, 0x6b10, 0x2011, 0x0000, 0x2468, 0x0078,
- 0x176b, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
- 0x1785, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
- 0x00c0, 0x1782, 0x0d7f, 0x1078, 0x1c18, 0x00c0, 0x1713, 0xa00e,
- 0x0078, 0x17a0, 0x0d7f, 0x1078, 0x12d5, 0x7b22, 0x7a26, 0x7d32,
+ 0x0e7e, 0x2071, 0x6f00, 0x127e, 0x2091, 0x8000, 0x7098, 0x8001,
+ 0x00c8, 0x12ed, 0xa06e, 0x0078, 0x12f6, 0x709a, 0x702c, 0x2068,
+ 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f,
+ 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6f00, 0x702c,
+ 0x206a, 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a, 0x127f, 0x0e7f,
+ 0x007c, 0x8dff, 0x0040, 0x1315, 0x6804, 0x6807, 0x0000, 0x007e,
+ 0x1078, 0x12f9, 0x0d7f, 0x0078, 0x1309, 0x007c, 0x0e7e, 0x2071,
+ 0x6f00, 0x7098, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e,
+ 0x2071, 0x70d9, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000,
+ 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c,
+ 0x0e7e, 0x2270, 0x700b, 0x0000, 0x2071, 0x70d9, 0x7018, 0xa088,
+ 0x70e2, 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005,
+ 0x00c0, 0x1348, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1359, 0x0f7f,
+ 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x70d9, 0x7004, 0xa005, 0x00c0,
+ 0x1357, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1359, 0x0f7f, 0x0e7f,
+ 0x007c, 0x7000, 0x0079, 0x135c, 0x1360, 0x13ca, 0x13e7, 0x13e7,
+ 0x7018, 0x711c, 0xa106, 0x00c0, 0x1368, 0x7007, 0x0000, 0x007c,
+ 0x0d7e, 0xa180, 0x70e2, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c,
+ 0x0007, 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836,
+ 0x682c, 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016,
+ 0x6804, 0x0d7f, 0xd084, 0x0040, 0x138a, 0x7007, 0x0001, 0x1078,
+ 0x138f, 0x007c, 0x7007, 0x0002, 0x1078, 0x13a5, 0x007c, 0x017e,
+ 0x027e, 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x139a,
+ 0x2110, 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020,
+ 0x7803, 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e,
+ 0x147e, 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026,
+ 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13b9, 0x2110,
+ 0xa006, 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020,
+ 0x7803, 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f,
+ 0x017f, 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x6fe5, 0x20a1,
+ 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091,
+ 0x8000, 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002,
+ 0x700b, 0x6fe0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e,
+ 0x147e, 0x157e, 0x2001, 0x7014, 0x209c, 0x20a1, 0x0014, 0x7803,
+ 0x0026, 0x2001, 0x7015, 0x20ac, 0x53a6, 0x2099, 0x7016, 0x20a1,
+ 0x0018, 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091,
+ 0x8000, 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002,
+ 0x700b, 0x7011, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e,
+ 0x0e7e, 0x2071, 0x70d9, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803,
+ 0x0002, 0xd1fc, 0x0040, 0x142a, 0xa18c, 0x0700, 0x0040, 0x1427,
+ 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x142a, 0x7004,
+ 0x1079, 0x142e, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x1359, 0x1436,
+ 0x1458, 0x1472, 0x149b, 0x1434, 0x0078, 0x1434, 0x137e, 0x147e,
+ 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010,
+ 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c,
+ 0xa005, 0x0040, 0x145f, 0x1078, 0x138f, 0x007c, 0x7008, 0xa080,
+ 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x1359, 0x007c,
+ 0x700c, 0xa005, 0x0040, 0x145f, 0x1078, 0x13a5, 0x007c, 0x0d7e,
+ 0x7008, 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e,
+ 0x783c, 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078,
+ 0x1359, 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x6fe3, 0x2004,
+ 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9,
+ 0x0020, 0x53a5, 0x2001, 0x6fe5, 0x2004, 0xd0bc, 0x0040, 0x1491,
+ 0x2001, 0x6fee, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020,
+ 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x39c1,
+ 0x1078, 0x1359, 0x007c, 0x2001, 0x7013, 0x2003, 0x0100, 0x7007,
+ 0x0000, 0x1078, 0x1359, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079,
+ 0x0030, 0x2071, 0x70ea, 0x7003, 0x0000, 0x700f, 0x70f0, 0x7013,
+ 0x70f0, 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007,
+ 0x0079, 0x14ba, 0x14c2, 0x1508, 0x14c2, 0x14c2, 0x14c2, 0x14ed,
+ 0x14d1, 0x14c6, 0xa085, 0x0001, 0x0078, 0x1522, 0x684c, 0xd0bc,
+ 0x0040, 0x14c2, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078,
+ 0x1510, 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x14c2, 0x684c,
+ 0xd0bc, 0x0040, 0x14c2, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804,
+ 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1bd1,
+ 0x2004, 0x6832, 0x6858, 0x0078, 0x1518, 0xa18c, 0x00ff, 0xa186,
+ 0x0015, 0x00c0, 0x14c2, 0x684c, 0xd0ac, 0x0040, 0x14c2, 0x6804,
+ 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1bd1,
+ 0x2004, 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x1518,
+ 0x684c, 0xd0ac, 0x0040, 0x14c2, 0xa006, 0x682e, 0x682a, 0x6858,
+ 0xa18c, 0x000f, 0xa188, 0x1bd1, 0x210c, 0x6932, 0x2d08, 0x691a,
+ 0x6826, 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912,
+ 0x6980, 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001,
+ 0x020a, 0x2004, 0x82ff, 0x0040, 0x153d, 0xa280, 0x0004, 0x0d7e,
+ 0x206c, 0x684c, 0xd0dc, 0x00c0, 0x1539, 0x1078, 0x14b5, 0x10c0,
+ 0x1286, 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e,
+ 0x027e, 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005,
+ 0x00c0, 0x1551, 0x7206, 0x2001, 0x1565, 0x007e, 0x2260, 0x0078,
+ 0x167d, 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108,
+ 0xa182, 0x710b, 0x0048, 0x155e, 0x2009, 0x70f0, 0x710e, 0x7000,
+ 0xa005, 0x00c0, 0x1565, 0x1078, 0x1666, 0x127f, 0x007c, 0x127e,
+ 0x027e, 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f,
+ 0x037f, 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62,
+ 0x6b5e, 0xa005, 0x0040, 0x15b9, 0x6808, 0xa005, 0x0040, 0x161f,
+ 0x7000, 0xa005, 0x00c0, 0x1586, 0x0078, 0x15b3, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x1623, 0x7004, 0xa406, 0x00c0, 0x15b3, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x0040, 0x159c, 0x047e, 0x1078, 0x1735,
+ 0x047f, 0x2460, 0x0078, 0x157c, 0x2001, 0x0207, 0x2004, 0xd09c,
+ 0x00c0, 0x158f, 0x7804, 0xa084, 0x6000, 0x0040, 0x15ad, 0xa086,
+ 0x6000, 0x0040, 0x15ad, 0x0078, 0x158f, 0x7803, 0x0004, 0x7003,
+ 0x0000, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x55c8, 0x0078,
+ 0x1623, 0x6808, 0xa005, 0x0040, 0x161f, 0x7000, 0xa005, 0x00c0,
+ 0x15c3, 0x0078, 0x161f, 0x700c, 0x7110, 0xa106, 0x00c0, 0x15cc,
+ 0x7004, 0xa406, 0x00c0, 0x161f, 0x2001, 0x0005, 0x2004, 0xd08c,
+ 0x0040, 0x15d9, 0x047e, 0x1078, 0x1735, 0x047f, 0x2460, 0x0078,
+ 0x15b9, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x15cc, 0x2001,
+ 0x0005, 0x2004, 0xd08c, 0x00c0, 0x15d2, 0x7804, 0xa084, 0x6000,
+ 0x0040, 0x15f0, 0xa086, 0x6000, 0x0040, 0x15f0, 0x0078, 0x15cc,
+ 0x7007, 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040,
+ 0x1611, 0xa08e, 0x0002, 0x00c0, 0x161f, 0x0c7e, 0x0e7e, 0x6818,
+ 0x2060, 0x1078, 0x1ba6, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0,
+ 0x160d, 0x7308, 0x720c, 0x0078, 0x160f, 0x7310, 0x7214, 0x0e7f,
+ 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211, 0x6810, 0xa300, 0x6812,
+ 0x6814, 0xa201, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x2009,
+ 0x0048, 0x1078, 0x55c8, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e,
+ 0x0e7e, 0x2071, 0x70ea, 0x7000, 0xa086, 0x0000, 0x0040, 0x1663,
+ 0x7004, 0xac06, 0x00c0, 0x1654, 0x2079, 0x0030, 0x7804, 0xd0fc,
+ 0x00c0, 0x1650, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1636,
+ 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1642, 0x7803, 0x0002,
+ 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, 0x0000, 0x0078, 0x1654,
+ 0x1078, 0x1735, 0x0078, 0x162b, 0x157e, 0x20a9, 0x0009, 0x2009,
+ 0x70f0, 0x2104, 0xac06, 0x00c0, 0x165e, 0x200a, 0xa188, 0x0003,
+ 0x00f0, 0x1659, 0x157f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110,
+ 0xa106, 0x00c0, 0x166e, 0x7003, 0x0000, 0x007c, 0x2104, 0x7006,
+ 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0x710b,
+ 0x0048, 0x167c, 0x2009, 0x70f0, 0x7112, 0x8cff, 0x00c0, 0x169c,
+ 0x7908, 0xd1ec, 0x00c0, 0x1690, 0x1078, 0x18f3, 0x0040, 0x1690,
+ 0x7803, 0x0009, 0x7904, 0xd1fc, 0x0040, 0x168a, 0x7803, 0x0006,
+ 0x7007, 0x0000, 0x1078, 0x18f3, 0x0040, 0x16c3, 0x7803, 0x0019,
+ 0x7003, 0x0003, 0x0078, 0x16c3, 0x6010, 0x2068, 0x2d58, 0x6828,
+ 0xa406, 0x00c0, 0x16a7, 0x682c, 0xa306, 0x0040, 0x16ab, 0x1078,
+ 0x1bf1, 0x00c0, 0x1680, 0x684c, 0xd0f4, 0x00c0, 0x1680, 0x6824,
+ 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f,
+ 0x2009, 0x0011, 0x1078, 0x16c4, 0x0040, 0x16c2, 0x2009, 0x0001,
+ 0x1078, 0x16c4, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x1730, 0xa03e,
+ 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x16e3, 0x0d7e, 0x2804, 0xac68,
+ 0x2900, 0x0079, 0x16d3, 0x1712, 0x16f3, 0x16f3, 0x1712, 0x1712,
+ 0x170a, 0x1712, 0x16f3, 0x1712, 0x16f9, 0x16f9, 0x1712, 0x1712,
+ 0x1712, 0x1701, 0x16f9, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c,
+ 0x6c20, 0x0d7e, 0xd99c, 0x0040, 0x1715, 0x2804, 0xac68, 0x6f08,
+ 0x6e0c, 0x0078, 0x1715, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078,
+ 0x1715, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
+ 0x1715, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
+ 0x00c0, 0x1712, 0x0d7f, 0x1078, 0x1b8d, 0x00c0, 0x16c4, 0xa00e,
+ 0x0078, 0x1730, 0x0d7f, 0x1078, 0x1286, 0x7b22, 0x7a26, 0x7d32,
0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f,
0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x2300, 0x6b10,
- 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816, 0x1078, 0x1c18,
- 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5, 0x127e, 0x2091, 0x2100,
+ 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816, 0x1078, 0x1b8d,
+ 0x007c, 0x1078, 0x1286, 0x1078, 0x1286, 0x127e, 0x2091, 0x2100,
0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
- 0xa184, 0x0700, 0x00c0, 0x17a3, 0xa184, 0x0003, 0xa086, 0x0003,
- 0x0040, 0x17a3, 0x7000, 0x0079, 0x17bd, 0x17c5, 0x17c7, 0x189b,
- 0x18ff, 0x1916, 0x17c5, 0x17c5, 0x17c5, 0x1078, 0x12d5, 0x8001,
- 0x7002, 0xa184, 0x0880, 0x00c0, 0x17dc, 0x8aff, 0x0040, 0x183b,
- 0x2009, 0x0001, 0x1078, 0x1713, 0x0040, 0x1928, 0x2009, 0x0001,
- 0x1078, 0x1713, 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000,
- 0xd1dc, 0x0040, 0x1827, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820,
+ 0xa184, 0x0700, 0x00c0, 0x1733, 0xa184, 0x0003, 0xa086, 0x0003,
+ 0x0040, 0x1733, 0x7000, 0x0079, 0x174d, 0x1755, 0x1757, 0x1826,
+ 0x1888, 0x189f, 0x1755, 0x1755, 0x1755, 0x1078, 0x1286, 0x8001,
+ 0x7002, 0xa184, 0x0880, 0x00c0, 0x176c, 0x8aff, 0x0040, 0x17c6,
+ 0x2009, 0x0001, 0x1078, 0x16c4, 0x0040, 0x18b1, 0x2009, 0x0001,
+ 0x1078, 0x16c4, 0x0078, 0x18b1, 0x7803, 0x0004, 0x7003, 0x0000,
+ 0xd1dc, 0x0040, 0x17b7, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820,
0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x7820,
0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101, 0x6816, 0x037f,
- 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078, 0x1c31, 0x2a00,
+ 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078, 0x1ba6, 0x2a00,
0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x6850,
- 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0, 0x1819, 0x684c,
- 0xd0e4, 0x0040, 0x1819, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x5bdb, 0x7808, 0xd0ec, 0x00c0, 0x1823, 0x7803, 0x0009, 0x7003,
- 0x0004, 0x0078, 0x1928, 0x1078, 0x16b5, 0x0078, 0x1928, 0x057e,
- 0x7d0c, 0xd5bc, 0x00c0, 0x182e, 0x1078, 0x753d, 0x057f, 0x1078,
- 0x192c, 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
- 0x00c0, 0x1853, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x184f, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5bdb, 0x1078,
- 0x16b5, 0x0078, 0x1928, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914,
- 0xa183, 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188,
- 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004,
- 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x195b, 0x7803, 0x0004,
- 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1874,
- 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007,
- 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x5bdb, 0x1078, 0x197e,
- 0x0040, 0x184f, 0x7908, 0xd1ec, 0x00c0, 0x1892, 0x2009, 0x0009,
- 0x0078, 0x1894, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x8001, 0x7002, 0xd194, 0x0040, 0x18ad,
- 0x7804, 0xd0fc, 0x00c0, 0x17ad, 0x8aff, 0x0040, 0x1928, 0x2009,
- 0x0001, 0x1078, 0x1713, 0x0078, 0x1928, 0xa184, 0x0880, 0x00c0,
- 0x18ba, 0x8aff, 0x0040, 0x1928, 0x2009, 0x0001, 0x1078, 0x1713,
- 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040,
- 0x18ee, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1c31, 0x0d7e,
- 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x18de,
- 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812,
- 0x690c, 0x7814, 0xa101, 0x7816, 0x0078, 0x18ea, 0x6810, 0x2008,
- 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814,
- 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x17e7, 0x057e, 0x7d0c,
- 0x1078, 0x753d, 0x057f, 0x1078, 0x192c, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x1928, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x1912, 0x6808,
- 0x8001, 0x680a, 0x00c0, 0x1912, 0x7004, 0x2060, 0x2009, 0x0048,
- 0x1078, 0x5bdb, 0x1078, 0x16b5, 0x0078, 0x1928, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x1912,
- 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x16cc,
- 0x017f, 0x007f, 0x127f, 0x007c, 0x1078, 0x193d, 0x20e1, 0x9028,
- 0x700f, 0x7870, 0x7013, 0x7870, 0x2001, 0x015d, 0x200c, 0x810a,
- 0x2102, 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014,
- 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc,
- 0x00c0, 0x195a, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0,
- 0x195a, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x195a, 0x8421,
- 0x00c0, 0x1944, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200,
- 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x193d, 0x20e1, 0x7000,
- 0x7324, 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f,
- 0x712e, 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001,
- 0x0138, 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e,
- 0x7908, 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x198b, 0xa085,
- 0x0001, 0x0078, 0x199d, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1996,
- 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000,
- 0x200c, 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c,
- 0x0e7e, 0x2071, 0x788b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e,
- 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1a22, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x19b4, 0x19bc, 0x1a0d, 0x19bc, 0x19bc,
- 0x19bc, 0x19f2, 0x19cf, 0x19be, 0x1078, 0x12d5, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1a15, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x19bc, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0x0078, 0x1a1e, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1a22,
- 0x684c, 0xd0b4, 0x0040, 0x1b24, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0xa006, 0x682e, 0x682a, 0x0078, 0x1a1e, 0x684c, 0xd0b4, 0x0040,
- 0x17a1, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834,
- 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6926, 0x684c,
- 0xc0dd, 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804,
- 0xd0fc, 0x10c0, 0x1b28, 0x0e7e, 0x0d7e, 0x2071, 0x788b, 0x7000,
- 0xa005, 0x00c0, 0x1a9e, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c,
- 0x7004, 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890,
- 0x0f7e, 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100,
- 0x8004, 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818,
- 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184,
- 0x0007, 0x0040, 0x1a60, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f,
- 0xa108, 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e,
- 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106,
- 0x00c0, 0x1a77, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a84, 0x037e,
- 0x047e, 0x6b14, 0x6c10, 0x1078, 0x1c7c, 0x047f, 0x037f, 0x0040,
- 0x1a84, 0x0c7f, 0x0078, 0x1a9e, 0x8aff, 0x00c0, 0x1a8c, 0x0c7f,
- 0xa085, 0x0001, 0x0078, 0x1a9e, 0x127e, 0x2091, 0x8000, 0x2079,
- 0x0020, 0x2009, 0x0001, 0x1078, 0x1aa2, 0x0040, 0x1a9b, 0x2009,
- 0x0001, 0x1078, 0x1aa2, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e,
- 0x8aff, 0x0040, 0x1b1d, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218,
- 0xa203, 0x0048, 0x1b1c, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0,
- 0x1acf, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1abf, 0x1afe,
- 0x1adf, 0x1adf, 0x1afe, 0x1afe, 0x1af6, 0x1afe, 0x1adf, 0x1afe,
- 0x1ae5, 0x1ae5, 0x1afe, 0x1afe, 0x1afe, 0x1aed, 0x1ae5, 0xc0fc,
- 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1b02,
- 0x0d7e, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x6b08,
- 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1b01, 0x6b10, 0x6a14, 0x6d00,
- 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x0d7f, 0x0d7e, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1afe, 0x0d7f, 0x1078,
- 0x1c18, 0x00c0, 0x1aa8, 0xa00e, 0x0078, 0x1b1d, 0x0d7f, 0x1078,
- 0x12d5, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
- 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c,
- 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012,
- 0x1078, 0x1c18, 0x0078, 0x1b1d, 0xa006, 0x027f, 0x037f, 0x047f,
- 0x057f, 0x067f, 0x077f, 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x2079, 0x0020, 0x2071, 0x788b, 0x2b68, 0x6818, 0x2060,
- 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1b26, 0x7000,
- 0x0079, 0x1b42, 0x1be9, 0x1b46, 0x1bb6, 0x1be7, 0x8001, 0x7002,
- 0xd19c, 0x00c0, 0x1b5a, 0x8aff, 0x0040, 0x1b79, 0x2009, 0x0001,
- 0x1078, 0x1aa2, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078, 0x1aa2,
- 0x0078, 0x1be9, 0x7803, 0x0004, 0xd194, 0x0040, 0x1b6a, 0x6850,
- 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1b6f, 0x684c, 0xc0f5, 0x684e,
- 0x0078, 0x1b6f, 0x1078, 0x1c31, 0x6850, 0xc0fd, 0x6852, 0x2a00,
- 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078,
- 0x1be9, 0x711c, 0x81ff, 0x0040, 0x1b8f, 0x7918, 0x7922, 0x7827,
- 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100,
- 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1be9, 0x0f7e,
- 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0,
- 0x1b9d, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102,
- 0x78c6, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f,
- 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1be9, 0x8001, 0x7002,
- 0xd194, 0x0040, 0x1bcb, 0x7804, 0xd0fc, 0x00c0, 0x1b38, 0xd19c,
- 0x00c0, 0x1be5, 0x8aff, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078,
- 0x1aa2, 0x0078, 0x1be9, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078,
- 0x1c31, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1bde,
- 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1be2, 0x6810, 0xa31a,
- 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1b6a, 0x0078, 0x1b6a, 0x1078,
- 0x12d5, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x788b, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1c15, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc,
- 0x0040, 0x1bfc, 0x1078, 0x1b28, 0x7000, 0xa086, 0x0000, 0x00c0,
- 0x1bfc, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1c0b, 0x20e1,
- 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c,
- 0x8840, 0x2804, 0xa005, 0x00c0, 0x1c2c, 0x6004, 0xa005, 0x0040,
- 0x1c2e, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c5c,
- 0x2044, 0x88ff, 0x1040, 0x12d5, 0x8a51, 0x007c, 0x2051, 0x0000,
- 0x007c, 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1c4b, 0x2c00,
- 0xad06, 0x0040, 0x1c40, 0x6000, 0xa005, 0x00c0, 0x1c40, 0x2d00,
- 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c6c, 0x2044,
- 0x88ff, 0x1040, 0x12d5, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019,
- 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b,
- 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x1c51, 0x1c4d, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c51, 0x0000, 0x1c58, 0x1c55, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c58, 0x0000, 0x1c53, 0x1c53, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c53, 0x0000, 0x1c59, 0x1c59, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c59, 0x0a7e, 0x097e, 0x087e, 0x6858,
- 0xa055, 0x0040, 0x1d19, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
- 0x1c5c, 0xa986, 0x0007, 0x0040, 0x1c95, 0xa986, 0x000e, 0x0040,
- 0x1c95, 0xa986, 0x000f, 0x00c0, 0x1c99, 0x605c, 0xa422, 0x6060,
- 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ca7, 0x0050, 0x1ca1, 0x0078,
- 0x1d19, 0x6004, 0xa065, 0x0040, 0x1d19, 0x0078, 0x1c84, 0x2804,
- 0xa005, 0x0040, 0x1cc5, 0xac68, 0xd99c, 0x00c0, 0x1cb5, 0x6808,
- 0xa422, 0x680c, 0xa31b, 0x0078, 0x1cb9, 0x6810, 0xa422, 0x6814,
- 0xa31b, 0x0048, 0x1ce4, 0x2300, 0xa405, 0x0040, 0x1ccb, 0x8a51,
- 0x0040, 0x1d19, 0x8840, 0x0078, 0x1ca7, 0x6004, 0xa065, 0x0040,
- 0x1d19, 0x0078, 0x1c84, 0x8a51, 0x0040, 0x1d19, 0x8840, 0x2804,
- 0xa005, 0x00c0, 0x1cde, 0x6004, 0xa065, 0x0040, 0x1d19, 0x6034,
- 0xa0cc, 0x000f, 0xa9c0, 0x1c5c, 0x2804, 0x2040, 0x2b68, 0x6850,
- 0xc0fc, 0x6852, 0x0078, 0x1d11, 0x8422, 0x8420, 0x831a, 0xa399,
- 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0,
- 0x1cff, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048,
- 0x12d5, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1d0b, 0x6910,
- 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12d5, 0x6800,
- 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd,
- 0x6852, 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078,
- 0x1d1e, 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0005, 0x2004, 0xa084, 0x0007, 0x0079, 0x1d26, 0x1d2e, 0x1d2f,
- 0x1d32, 0x1d35, 0x1d3a, 0x1d3d, 0x1d42, 0x1d47, 0x007c, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x17a5, 0x007c, 0x1078, 0x17a5, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x145e, 0x007c, 0x1078, 0x1b28, 0x1078,
- 0x145e, 0x007c, 0x1078, 0x17a5, 0x1078, 0x145e, 0x007c, 0x1078,
- 0x17a5, 0x1078, 0x1b28, 0x1078, 0x145e, 0x007c, 0x127e, 0x2091,
- 0x2300, 0x2079, 0x0200, 0x2071, 0x7b80, 0x2069, 0x7600, 0x2009,
- 0x0004, 0x7912, 0x7817, 0x0004, 0x1078, 0x202c, 0x781b, 0x0002,
- 0x20e1, 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c,
- 0xa084, 0x0007, 0x0079, 0x1d6c, 0x1d90, 0x1d74, 0x1d78, 0x1d7c,
- 0x1d82, 0x1d86, 0x1d8a, 0x1d8e, 0x1078, 0x412f, 0x0078, 0x1d90,
- 0x1078, 0x415e, 0x0078, 0x1d90, 0x1078, 0x412f, 0x1078, 0x415e,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x127f, 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003,
- 0x0040, 0x1d9c, 0x1078, 0x12d5, 0xa184, 0x0030, 0x0040, 0x1dad,
- 0x6a00, 0xa286, 0x0003, 0x00c0, 0x1da7, 0x1078, 0x12d5, 0x1078,
- 0x3535, 0x20e1, 0x9010, 0x0078, 0x1db9, 0xa184, 0x00c0, 0x0040,
- 0x1db3, 0x1078, 0x12d5, 0xa184, 0x0300, 0x0040, 0x1db9, 0x20e1,
- 0x9020, 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e,
- 0x0f7e, 0x2071, 0x7600, 0x7128, 0x2001, 0x7823, 0x2102, 0x2001,
- 0x782b, 0x2102, 0xa182, 0x0211, 0x00c8, 0x1dd2, 0x2009, 0x0008,
- 0x0078, 0x1dfc, 0xa182, 0x0259, 0x00c8, 0x1dda, 0x2009, 0x0007,
- 0x0078, 0x1dfc, 0xa182, 0x02c1, 0x00c8, 0x1de2, 0x2009, 0x0006,
- 0x0078, 0x1dfc, 0xa182, 0x0349, 0x00c8, 0x1dea, 0x2009, 0x0005,
- 0x0078, 0x1dfc, 0xa182, 0x0421, 0x00c8, 0x1df2, 0x2009, 0x0004,
- 0x0078, 0x1dfc, 0xa182, 0x0581, 0x00c8, 0x1dfa, 0x2009, 0x0003,
- 0x0078, 0x1dfc, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182,
- 0x0005, 0x00c8, 0x1e06, 0x7916, 0x0078, 0x1e08, 0x7817, 0x0004,
- 0x1078, 0x202c, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091,
- 0x2200, 0x2061, 0x0100, 0x2071, 0x7600, 0x6024, 0x6026, 0x6033,
- 0x00ef, 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b,
- 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007,
- 0x0caf, 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001,
- 0x762d, 0x2003, 0x0000, 0x2001, 0x762c, 0x2003, 0x0001, 0x007c,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184,
- 0x002c, 0x00c0, 0x1e47, 0xa184, 0x0007, 0x0079, 0x1e4d, 0xa195,
- 0x0004, 0xa284, 0x0007, 0x0079, 0x1e4d, 0x1e79, 0x1e55, 0x1e59,
- 0x1e5d, 0x1e63, 0x1e67, 0x1e6d, 0x1e73, 0x1078, 0x4698, 0x0078,
- 0x1e79, 0x1078, 0x4787, 0x0078, 0x1e79, 0x1078, 0x4787, 0x1078,
- 0x4698, 0x0078, 0x1e79, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078,
- 0x4698, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x4787, 0x1078,
- 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x4787, 0x1078, 0x4698, 0x1078,
- 0x1e7e, 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040,
- 0x1f32, 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74ba, 0xa48c, 0xff00,
- 0xa196, 0xff00, 0x0040, 0x1ead, 0x6030, 0xa084, 0x00ff, 0x810f,
- 0xa116, 0x0040, 0x1ead, 0x7130, 0xd18c, 0x00c0, 0x1ead, 0x2011,
- 0x7652, 0x2214, 0xd2ec, 0x0040, 0x1ea1, 0xc18d, 0x7132, 0x0078,
- 0x1ead, 0x6240, 0xa294, 0x0010, 0x0040, 0x1eef, 0x6248, 0xa294,
- 0xff00, 0xa296, 0xff00, 0x00c0, 0x1eef, 0x037e, 0x73b8, 0x2011,
- 0x8013, 0x1078, 0x2d02, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011,
- 0x7652, 0x220c, 0xd1a4, 0x0040, 0x1ed7, 0x017e, 0x2009, 0x0001,
- 0x2011, 0x0100, 0x1078, 0x4666, 0x2019, 0x000e, 0x1078, 0x7484,
- 0xa484, 0x00ff, 0xa080, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f,
- 0x8127, 0xa006, 0x2009, 0x000e, 0x1078, 0x74ec, 0x017f, 0xd1ac,
- 0x00c0, 0x1ee0, 0x2019, 0x0004, 0x1078, 0x226d, 0x0078, 0x1eef,
- 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x1078, 0x37d7, 0x00c0,
- 0x1eeb, 0x1078, 0x35db, 0x8108, 0x00f0, 0x1ee5, 0x157f, 0x0c7f,
- 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7, 0x1078, 0x359e, 0x0f7e,
- 0x2079, 0x7849, 0x783c, 0xa086, 0x0000, 0x0040, 0x1f07, 0x6027,
- 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f,
- 0x2011, 0x0003, 0x1078, 0x5772, 0x2011, 0x0002, 0x1078, 0x577c,
- 0x1078, 0x5688, 0x1078, 0x459d, 0x037e, 0x2019, 0x0000, 0x1078,
- 0x571a, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, 0x7600, 0x2014,
- 0xa296, 0x0004, 0x00c0, 0x1f2a, 0xd19c, 0x00c0, 0x1f2a, 0x6228,
- 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x7620, 0x2003, 0x0000,
- 0x6027, 0x0020, 0xd194, 0x0040, 0x1fd3, 0x0f7e, 0x2079, 0x7849,
- 0x783c, 0xa086, 0x0001, 0x00c0, 0x1f56, 0x017e, 0x6027, 0x0004,
- 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000,
- 0x2079, 0x7836, 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x4c2c,
- 0x1078, 0x4cec, 0x017f, 0x0f7f, 0x0078, 0x1fd3, 0x0f7f, 0x017e,
- 0x6220, 0xd2b4, 0x0040, 0x1f8b, 0x1078, 0x459d, 0x1078, 0x5534,
- 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x1f6e, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
- 0x2061, 0x7836, 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1f7e, 0x8000,
- 0x602a, 0x0c7f, 0x1078, 0x5526, 0x0078, 0x1fd2, 0x2019, 0x783f,
- 0x2304, 0xa065, 0x0040, 0x1f88, 0x2009, 0x0027, 0x1078, 0x5bdb,
- 0x0c7f, 0x0078, 0x1fd2, 0xd2bc, 0x0040, 0x1fd2, 0x1078, 0x45ab,
- 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x1fa0, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0d7f, 0x0c7e, 0x2061, 0x7836, 0x6044, 0xa09a, 0x0002, 0x00c8,
- 0x1fc1, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1fd2,
- 0x1078, 0x45a2, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0,
- 0x1fbd, 0x6017, 0x0012, 0x0078, 0x1fd2, 0x6017, 0x0016, 0x0078,
- 0x1fd2, 0x037e, 0x2019, 0x0001, 0x1078, 0x571a, 0x037f, 0x2019,
- 0x7845, 0x2304, 0xa065, 0x0040, 0x1fd1, 0x2009, 0x004f, 0x1078,
- 0x5bdb, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1ffb, 0x017e, 0x6028,
- 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x5772, 0x2011, 0x0002,
- 0x1078, 0x577c, 0x1078, 0x5688, 0x1078, 0x459d, 0x037e, 0x2019,
- 0x0000, 0x1078, 0x571a, 0x037f, 0x60e3, 0x0000, 0x1078, 0x755b,
- 0x1078, 0x7579, 0x2001, 0x7600, 0x2003, 0x0004, 0x6027, 0x0008,
- 0x1078, 0x11c6, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e,
- 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7600, 0x71b0, 0x70b2, 0xa116, 0x0040, 0x2025, 0x81ff, 0x0040,
- 0x2017, 0x2011, 0x8011, 0x1078, 0x2d02, 0x0078, 0x2025, 0x2011,
- 0x8012, 0x1078, 0x2d02, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019,
- 0x0028, 0x1078, 0x226d, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f,
- 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e,
- 0x2061, 0x0100, 0xa190, 0x2047, 0x2204, 0x60f2, 0xa192, 0x0005,
- 0x00c8, 0x203e, 0xa190, 0x2050, 0x0078, 0x2040, 0x2011, 0x2054,
- 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x0840,
- 0x0840, 0x0840, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210,
- 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0,
- 0x00a0, 0x2028, 0x2130, 0xa094, 0xff00, 0x00c0, 0x2062, 0x81ff,
- 0x0040, 0x2066, 0x1078, 0x42e2, 0x0078, 0x206d, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0xff00, 0x810f, 0xa006, 0x007c, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0x00ff, 0x007c, 0x2094, 0x2098, 0x209c, 0x20a2,
- 0x20a8, 0x20ae, 0x20b4, 0x20bc, 0x20c4, 0x20ca, 0x20d0, 0x20d8,
- 0x20e0, 0x20e8, 0x20f0, 0x20fa, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x107e, 0x007e, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f,
- 0x1078, 0x1d64, 0x0078, 0x211d, 0x0005, 0x0078, 0x2104, 0xb084,
- 0x003c, 0x8004, 0x8004, 0x0079, 0x210d, 0x211d, 0x209a, 0x209e,
- 0x20a4, 0x20aa, 0x20b0, 0x20b6, 0x20be, 0x20c6, 0x20cc, 0x20d2,
- 0x20da, 0x20e2, 0x20ea, 0x20f2, 0x20fc, 0x0008, 0x2107, 0x007f,
- 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x2041, 0x007e,
- 0x70bc, 0xd09c, 0x0040, 0x212e, 0x2041, 0x007f, 0x2001, 0x010c,
- 0x203c, 0x727c, 0x82ff, 0x0040, 0x2179, 0x037e, 0x738c, 0xa38e,
- 0xffff, 0x00c0, 0x213d, 0x2019, 0x0001, 0x8314, 0xa2e0, 0x7cc0,
- 0x2c04, 0xa38c, 0x0001, 0x0040, 0x214a, 0xa084, 0xff00, 0x8007,
- 0x0078, 0x214c, 0xa084, 0x00ff, 0xa70e, 0x0040, 0x216e, 0xa08e,
- 0x00ff, 0x0040, 0x2174, 0x2009, 0x0000, 0x1078, 0x2059, 0x1078,
- 0x37a0, 0x00c0, 0x2171, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x2168, 0x1078, 0x21cb, 0x0040, 0x2171, 0x0078, 0x216e,
- 0x1078, 0x22cf, 0x1078, 0x21f2, 0x0040, 0x2171, 0x8318, 0x0078,
- 0x213d, 0x738e, 0x0078, 0x2176, 0x708f, 0xffff, 0x037f, 0x0078,
- 0x21c8, 0xa780, 0x2303, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x708c,
- 0xa096, 0xffff, 0x0040, 0x218b, 0xa812, 0x00c8, 0x219b, 0x708f,
- 0xffff, 0x0078, 0x21c5, 0x2009, 0x0000, 0x70bc, 0xd09c, 0x0040,
- 0x2196, 0xd094, 0x0040, 0x2196, 0x2009, 0x007e, 0x2100, 0xa802,
- 0x20a8, 0x0078, 0x219f, 0x2008, 0x2810, 0xa202, 0x20a8, 0x2700,
- 0x157e, 0x017e, 0xa106, 0x0040, 0x21bc, 0x1078, 0x37a0, 0x00c0,
- 0x21c5, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x21b6,
- 0x1078, 0x21cb, 0x0040, 0x21c5, 0x0078, 0x21bc, 0x1078, 0x22cf,
- 0x1078, 0x21f2, 0x0040, 0x21c5, 0x017f, 0x8108, 0x157f, 0x00f0,
- 0x219f, 0x708f, 0xffff, 0x0078, 0x21c8, 0x017f, 0x157f, 0x718e,
- 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68,
- 0x1078, 0x5b4e, 0x0040, 0x21ed, 0x2d00, 0x601a, 0x601f, 0x0001,
- 0x2001, 0x0000, 0x1078, 0x376f, 0x2001, 0x0000, 0x1078, 0x3783,
- 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009,
- 0x0004, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
- 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5b4e, 0x0040, 0x2214, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x127e,
- 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078, 0x37a0, 0x00c0,
- 0x2227, 0x1078, 0x222a, 0x0040, 0x2227, 0x70c3, 0xffff, 0x027f,
- 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5b4e, 0x0040, 0x224c, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x127e,
- 0x2091, 0x8000, 0x70c4, 0x8000, 0x70c6, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x0d7e, 0x2009, 0x007f, 0x1078, 0x37a0, 0x00c0,
- 0x226a, 0x2c68, 0x1078, 0x5b4e, 0x0040, 0x226a, 0x2d00, 0x601a,
- 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022, 0x1078, 0x5bdb,
- 0xa085, 0x0001, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x067e,
- 0x037e, 0x027e, 0x1078, 0x491b, 0x1078, 0x48cb, 0x1078, 0x60a8,
- 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x37d7, 0x00c0,
- 0x2285, 0x1078, 0x3958, 0x1078, 0x35db, 0x017f, 0x8108, 0x00f0,
- 0x227c, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e,
- 0x2019, 0x0029, 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078,
- 0x7326, 0x017f, 0x2e60, 0x1078, 0x3958, 0xa186, 0x007f, 0x0040,
- 0x22ab, 0x1078, 0x35db, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x00c0, 0x22c5, 0x2071, 0x7600, 0x7088, 0xa005, 0x0040, 0x22c2,
- 0x8001, 0x708a, 0x007f, 0x0e7f, 0x007c, 0x2071, 0x7600, 0x70c4,
- 0xa005, 0x0040, 0x22c2, 0x8001, 0x70c6, 0x0078, 0x22c2, 0x6000,
+ 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0, 0x17a9, 0x684c,
+ 0xd0e4, 0x0040, 0x17a9, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
+ 0x55c8, 0x7808, 0xd0ec, 0x00c0, 0x17b3, 0x7803, 0x0009, 0x7003,
+ 0x0004, 0x0078, 0x18b1, 0x1078, 0x1666, 0x0078, 0x18b1, 0x057e,
+ 0x7d0c, 0x1078, 0x6de1, 0x057f, 0x697c, 0x6912, 0x6980, 0x6916,
+ 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b1, 0x684c, 0xc0f5,
+ 0x684e, 0x7814, 0xa005, 0x00c0, 0x17de, 0x7003, 0x0000, 0x6808,
+ 0x8001, 0x680a, 0x00c0, 0x17da, 0x7004, 0x2060, 0x2009, 0x0048,
+ 0x1078, 0x55c8, 0x1078, 0x1666, 0x0078, 0x18b1, 0x7814, 0x6910,
+ 0xa102, 0x6812, 0x6914, 0xa183, 0x0000, 0x6816, 0x7814, 0x7908,
+ 0xa18c, 0x0fff, 0xa188, 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a,
+ 0x8104, 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078,
+ 0x18b5, 0x7803, 0x0004, 0x780f, 0xffff, 0x7803, 0x0001, 0x7804,
+ 0xd0fc, 0x0040, 0x17ff, 0x7803, 0x0002, 0x7803, 0x0004, 0x780f,
+ 0x0070, 0x7004, 0x7007, 0x0000, 0x2060, 0x2009, 0x0048, 0x1078,
+ 0x55c8, 0x1078, 0x18f3, 0x0040, 0x17da, 0x7908, 0xd1ec, 0x00c0,
+ 0x181d, 0x2009, 0x0009, 0x0078, 0x181f, 0x2009, 0x0019, 0x7902,
+ 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b1, 0x8001, 0x7002,
+ 0xd194, 0x0040, 0x1838, 0x7804, 0xd0fc, 0x00c0, 0x173d, 0x8aff,
+ 0x0040, 0x18b1, 0x2009, 0x0001, 0x1078, 0x16c4, 0x0078, 0x18b1,
+ 0xa184, 0x0880, 0x00c0, 0x1845, 0x8aff, 0x0040, 0x18b1, 0x2009,
+ 0x0001, 0x1078, 0x16c4, 0x0078, 0x18b1, 0x7803, 0x0004, 0x7003,
+ 0x0000, 0xd1dc, 0x0040, 0x1879, 0x027e, 0x037e, 0x6b28, 0x6a2c,
+ 0x1078, 0x1ba6, 0x0d7e, 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034,
+ 0xd09c, 0x00c0, 0x1869, 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213,
+ 0x7810, 0xa100, 0x7812, 0x690c, 0x7814, 0xa101, 0x7816, 0x0078,
+ 0x1875, 0x6810, 0x2008, 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100,
+ 0x7812, 0x6914, 0x7814, 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078,
+ 0x1777, 0x057e, 0x7d0c, 0x1078, 0x6de1, 0x057f, 0x697c, 0x6912,
+ 0x6980, 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x18b1,
+ 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x189b,
+ 0x6808, 0x8001, 0x680a, 0x00c0, 0x189b, 0x7004, 0x2060, 0x2009,
+ 0x0048, 0x1078, 0x55c8, 0x1078, 0x1666, 0x0078, 0x18b1, 0x7803,
+ 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040,
+ 0x189b, 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078,
+ 0x167d, 0x017f, 0x007f, 0x127f, 0x007c, 0x3c00, 0x007e, 0x0e7e,
+ 0x2071, 0x0200, 0x7808, 0xa084, 0xf000, 0xa10d, 0x2001, 0x0138,
+ 0x2014, 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c,
+ 0xd3dc, 0x00c0, 0x18db, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048,
+ 0x00c0, 0x18db, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x18db,
+ 0x8421, 0x00c0, 0x18c5, 0x20e1, 0x7000, 0x7324, 0x7420, 0x7028,
+ 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f, 0x0100,
+ 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202, 0x0e7f,
+ 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e, 0x7908, 0xa18c, 0x0fff,
+ 0xa182, 0x0009, 0x0048, 0x1900, 0xa085, 0x0001, 0x0078, 0x1912,
+ 0x2001, 0x020a, 0x81ff, 0x0040, 0x190b, 0x20e1, 0x6000, 0x200c,
+ 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000, 0x200c, 0x200c, 0x7003,
+ 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c, 0x0e7e, 0x2071, 0x710b,
+ 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e, 0xa280, 0x0004, 0x206c,
+ 0x694c, 0xd1dc, 0x00c0, 0x1997, 0x6934, 0xa184, 0x0007, 0x0079,
+ 0x1929, 0x1931, 0x1982, 0x1931, 0x1931, 0x1931, 0x1967, 0x1944,
+ 0x1933, 0x1078, 0x1286, 0x684c, 0xd0b4, 0x0040, 0x1a99, 0x6860,
+ 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880,
+ 0x680e, 0x6958, 0x0078, 0x198a, 0x6834, 0xa084, 0x00ff, 0xa086,
+ 0x001e, 0x00c0, 0x1931, 0x684c, 0xd0b4, 0x0040, 0x1a99, 0x6860,
+ 0x682e, 0x6816, 0x685c, 0x682a, 0x6812, 0x687c, 0x680a, 0x6880,
+ 0x680e, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
+ 0xa080, 0x1bd1, 0x2004, 0x6832, 0x6958, 0x0078, 0x1993, 0xa18c,
+ 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1997, 0x684c, 0xd0b4, 0x0040,
+ 0x1a99, 0x6804, 0x681a, 0xa080, 0x000d, 0x2004, 0xa084, 0x000f,
+ 0xa080, 0x1bd1, 0x2004, 0x6832, 0x6958, 0xa006, 0x682e, 0x682a,
+ 0x0078, 0x1993, 0x684c, 0xd0b4, 0x0040, 0x1731, 0x6958, 0xa006,
+ 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834, 0xa084, 0x000f, 0xa080,
+ 0x1bd1, 0x2004, 0x6832, 0x6926, 0x684c, 0xc0dd, 0x684e, 0x0d7f,
+ 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804, 0xd0fc, 0x10c0, 0x1a9d,
+ 0x0e7e, 0x0d7e, 0x2071, 0x710b, 0x7000, 0xa005, 0x00c0, 0x1a13,
+ 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c, 0x7004, 0x2068, 0x6818,
+ 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, 0x9040,
+ 0x2079, 0x0200, 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x0f7f,
+ 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040,
+ 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184, 0x0007, 0x0040, 0x19d5,
+ 0x017e, 0x2009, 0x0008, 0xa102, 0x017f, 0xa108, 0x791a, 0x7116,
+ 0x701e, 0x680c, 0xa081, 0x0000, 0x781e, 0x701a, 0xa006, 0x700e,
+ 0x7012, 0x7004, 0x692c, 0x6814, 0xa106, 0x00c0, 0x19ec, 0x6928,
+ 0x6810, 0xa106, 0x0040, 0x19f9, 0x037e, 0x047e, 0x6b14, 0x6c10,
+ 0x1078, 0x1bf1, 0x047f, 0x037f, 0x0040, 0x19f9, 0x0c7f, 0x0078,
+ 0x1a13, 0x8aff, 0x00c0, 0x1a01, 0x0c7f, 0xa085, 0x0001, 0x0078,
+ 0x1a13, 0x127e, 0x2091, 0x8000, 0x2079, 0x0020, 0x2009, 0x0001,
+ 0x1078, 0x1a17, 0x0040, 0x1a10, 0x2009, 0x0001, 0x1078, 0x1a17,
+ 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e,
+ 0x067e, 0x057e, 0x047e, 0x037e, 0x027e, 0x8aff, 0x0040, 0x1a92,
+ 0x700c, 0x7214, 0xa202, 0x7010, 0x7218, 0xa203, 0x0048, 0x1a91,
+ 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1a44, 0x0d7e, 0x2804,
+ 0xac68, 0x2900, 0x0079, 0x1a34, 0x1a73, 0x1a54, 0x1a54, 0x1a73,
+ 0x1a73, 0x1a6b, 0x1a73, 0x1a54, 0x1a73, 0x1a5a, 0x1a5a, 0x1a73,
+ 0x1a73, 0x1a73, 0x1a62, 0x1a5a, 0xc0fc, 0x6852, 0x6b6c, 0x6a70,
+ 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1a77, 0x0d7e, 0x2804, 0xac68,
+ 0x6f08, 0x6e0c, 0x0078, 0x1a76, 0x6b08, 0x6a0c, 0x6d00, 0x6c04,
+ 0x0078, 0x1a76, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c,
+ 0x0078, 0x1a76, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086,
+ 0x001e, 0x00c0, 0x1a73, 0x0d7f, 0x1078, 0x1b8d, 0x00c0, 0x1a1d,
+ 0xa00e, 0x0078, 0x1a92, 0x0d7f, 0x1078, 0x1286, 0x0d7f, 0x7b22,
+ 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000,
+ 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c,
+ 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078, 0x1b8d, 0x0078,
+ 0x1a92, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f, 0x067f, 0x077f,
+ 0x007c, 0x1078, 0x1286, 0x1078, 0x1286, 0x127e, 0x2091, 0x2200,
+ 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020,
+ 0x2071, 0x710b, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
+ 0xa184, 0x0700, 0x00c0, 0x1a9b, 0x7000, 0x0079, 0x1ab7, 0x1b5e,
+ 0x1abb, 0x1b2b, 0x1b5c, 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1acf,
+ 0x8aff, 0x0040, 0x1aee, 0x2009, 0x0001, 0x1078, 0x1a17, 0x0040,
+ 0x1b5e, 0x2009, 0x0001, 0x1078, 0x1a17, 0x0078, 0x1b5e, 0x7803,
+ 0x0004, 0xd194, 0x0040, 0x1adf, 0x6850, 0xc0fc, 0x6852, 0x8aff,
+ 0x00c0, 0x1ae4, 0x684c, 0xc0f5, 0x684e, 0x0078, 0x1ae4, 0x1078,
+ 0x1ba6, 0x6850, 0xc0fd, 0x6852, 0x2a00, 0x6826, 0x2c00, 0x681a,
+ 0x2800, 0x6832, 0x7003, 0x0000, 0x0078, 0x1b5e, 0x711c, 0x81ff,
+ 0x0040, 0x1b04, 0x7918, 0x7922, 0x7827, 0x0000, 0x7803, 0x0001,
+ 0x7000, 0x8000, 0x7002, 0x700c, 0xa100, 0x700e, 0x7010, 0xa081,
+ 0x0000, 0x7012, 0x0078, 0x1b5e, 0x0f7e, 0x027e, 0x781c, 0x007e,
+ 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14, 0xa284, 0x0004, 0xa085,
+ 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0, 0x1b12, 0x79c8, 0x007f,
+ 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102, 0x78c6, 0xa284, 0x0004,
+ 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803, 0x0008, 0x7003,
+ 0x0000, 0x0078, 0x1b5e, 0x8001, 0x7002, 0xd194, 0x0040, 0x1b40,
+ 0x7804, 0xd0fc, 0x00c0, 0x1aad, 0xd19c, 0x00c0, 0x1b5a, 0x8aff,
+ 0x0040, 0x1b5e, 0x2009, 0x0001, 0x1078, 0x1a17, 0x0078, 0x1b5e,
+ 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1ba6, 0x0d7e, 0x2804,
+ 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1b53, 0x6808, 0xa31a, 0x680c,
+ 0xa213, 0x0078, 0x1b57, 0x6810, 0xa31a, 0x6814, 0xa213, 0x0d7f,
+ 0x0078, 0x1adf, 0x0078, 0x1adf, 0x1078, 0x1286, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x2071, 0x710b, 0x7000, 0xa086, 0x0000, 0x0040, 0x1b8a, 0x2079,
+ 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc, 0x0040, 0x1b71, 0x1078,
+ 0x1a9d, 0x7000, 0xa086, 0x0000, 0x00c0, 0x1b71, 0x7803, 0x0004,
+ 0x7804, 0xd0ac, 0x00c0, 0x1b80, 0x20e1, 0x9040, 0x7803, 0x0002,
+ 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c, 0x8840, 0x2804, 0xa005,
+ 0x00c0, 0x1ba1, 0x6004, 0xa005, 0x0040, 0x1ba3, 0x681a, 0x2060,
+ 0x6034, 0xa084, 0x000f, 0xa080, 0x1bd1, 0x2044, 0x88ff, 0x1040,
+ 0x1286, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, 0x8841,
+ 0x2804, 0xa005, 0x00c0, 0x1bc0, 0x2c00, 0xad06, 0x0040, 0x1bb5,
+ 0x6000, 0xa005, 0x00c0, 0x1bb5, 0x2d00, 0x2060, 0x681a, 0x6034,
+ 0xa084, 0x000f, 0xa080, 0x1be1, 0x2044, 0x88ff, 0x1040, 0x1286,
+ 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, 0x0021, 0x0025,
+ 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, 0x0027, 0x0000,
+ 0x0000, 0x0000, 0x1bc6, 0x1bc2, 0x0000, 0x0000, 0x1bd0, 0x0000,
+ 0x1bc6, 0x0000, 0x1bcd, 0x1bca, 0x0000, 0x0000, 0x0000, 0x1bd0,
+ 0x1bcd, 0x0000, 0x1bc8, 0x1bc8, 0x0000, 0x0000, 0x1bd0, 0x0000,
+ 0x1bc8, 0x0000, 0x1bce, 0x1bce, 0x0000, 0x0000, 0x0000, 0x1bd0,
+ 0x1bce, 0x0a7e, 0x097e, 0x087e, 0x6858, 0xa055, 0x0040, 0x1c8e,
+ 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, 0x1bd1, 0xa986, 0x0007,
+ 0x0040, 0x1c0a, 0xa986, 0x000e, 0x0040, 0x1c0a, 0xa986, 0x000f,
+ 0x00c0, 0x1c0e, 0x605c, 0xa422, 0x6060, 0xa31a, 0x2804, 0xa045,
+ 0x00c0, 0x1c1c, 0x0050, 0x1c16, 0x0078, 0x1c8e, 0x6004, 0xa065,
+ 0x0040, 0x1c8e, 0x0078, 0x1bf9, 0x2804, 0xa005, 0x0040, 0x1c3a,
+ 0xac68, 0xd99c, 0x00c0, 0x1c2a, 0x6808, 0xa422, 0x680c, 0xa31b,
+ 0x0078, 0x1c2e, 0x6810, 0xa422, 0x6814, 0xa31b, 0x0048, 0x1c59,
+ 0x2300, 0xa405, 0x0040, 0x1c40, 0x8a51, 0x0040, 0x1c8e, 0x8840,
+ 0x0078, 0x1c1c, 0x6004, 0xa065, 0x0040, 0x1c8e, 0x0078, 0x1bf9,
+ 0x8a51, 0x0040, 0x1c8e, 0x8840, 0x2804, 0xa005, 0x00c0, 0x1c53,
+ 0x6004, 0xa065, 0x0040, 0x1c8e, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
+ 0x1bd1, 0x2804, 0x2040, 0x2b68, 0x6850, 0xc0fc, 0x6852, 0x0078,
+ 0x1c86, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x0d7e, 0x2b68,
+ 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, 0x1c74, 0x6908, 0x2400,
+ 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, 0x1286, 0x6800, 0xa420,
+ 0x6804, 0xa319, 0x0078, 0x1c80, 0x6910, 0x2400, 0xa122, 0x6914,
+ 0x2300, 0xa11b, 0x1048, 0x1286, 0x6800, 0xa420, 0x6804, 0xa319,
+ 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, 0x6852, 0x2c00, 0x681a,
+ 0x007f, 0x007f, 0x007f, 0xa006, 0x0078, 0x1c93, 0x087f, 0x097f,
+ 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, 0x2004, 0xa084,
+ 0x0007, 0x0079, 0x1c9b, 0x1ca3, 0x1ca4, 0x1ca7, 0x1caa, 0x1caf,
+ 0x1cb2, 0x1cb7, 0x1cbc, 0x007c, 0x1078, 0x1a9d, 0x007c, 0x1078,
+ 0x1735, 0x007c, 0x1078, 0x1735, 0x1078, 0x1a9d, 0x007c, 0x1078,
+ 0x140f, 0x007c, 0x1078, 0x1a9d, 0x1078, 0x140f, 0x007c, 0x1078,
+ 0x1735, 0x1078, 0x140f, 0x007c, 0x1078, 0x1735, 0x1078, 0x1a9d,
+ 0x1078, 0x140f, 0x007c, 0x127e, 0x2091, 0x2300, 0x2079, 0x0200,
+ 0x2071, 0x7380, 0x2069, 0x6f00, 0x2009, 0x0004, 0x7912, 0x7916,
+ 0x1078, 0x1f8b, 0x781b, 0x0002, 0x20e1, 0x8700, 0x127f, 0x007c,
+ 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, 0x0079, 0x1ce0,
+ 0x1d04, 0x1ce8, 0x1cec, 0x1cf0, 0x1cf6, 0x1cfa, 0x1cfe, 0x1d02,
+ 0x1078, 0x3def, 0x0078, 0x1d04, 0x1078, 0x3e1e, 0x0078, 0x1d04,
+ 0x1078, 0x3def, 0x1078, 0x3e1e, 0x0078, 0x1d04, 0x1078, 0x1d06,
+ 0x0078, 0x1d04, 0x1078, 0x1d06, 0x0078, 0x1d04, 0x1078, 0x1d06,
+ 0x0078, 0x1d04, 0x1078, 0x1d06, 0x127f, 0x007c, 0x007e, 0x017e,
+ 0x027e, 0x7930, 0xa184, 0x0003, 0x0040, 0x1d10, 0x1078, 0x1286,
+ 0xa184, 0x0030, 0x0040, 0x1d21, 0x6a00, 0xa286, 0x0003, 0x00c0,
+ 0x1d1b, 0x1078, 0x1286, 0x1078, 0x31f5, 0x20e1, 0x9010, 0x0078,
+ 0x1d2d, 0xa184, 0x00c0, 0x0040, 0x1d27, 0x1078, 0x1286, 0xa184,
+ 0x0300, 0x0040, 0x1d2d, 0x20e1, 0x9020, 0x7932, 0x027f, 0x017f,
+ 0x007f, 0x007c, 0x017e, 0x0e7e, 0x0f7e, 0x2071, 0x6f00, 0x7128,
+ 0x2001, 0x70a3, 0x2102, 0x2001, 0x70ab, 0x2102, 0xa182, 0x0211,
+ 0x00c8, 0x1d46, 0x2009, 0x0008, 0x0078, 0x1d70, 0xa182, 0x0259,
+ 0x00c8, 0x1d4e, 0x2009, 0x0007, 0x0078, 0x1d70, 0xa182, 0x02c1,
+ 0x00c8, 0x1d56, 0x2009, 0x0006, 0x0078, 0x1d70, 0xa182, 0x0349,
+ 0x00c8, 0x1d5e, 0x2009, 0x0005, 0x0078, 0x1d70, 0xa182, 0x0421,
+ 0x00c8, 0x1d66, 0x2009, 0x0004, 0x0078, 0x1d70, 0xa182, 0x0581,
+ 0x00c8, 0x1d6e, 0x2009, 0x0003, 0x0078, 0x1d70, 0x2009, 0x0002,
+ 0x2079, 0x0200, 0x7912, 0x7916, 0x1078, 0x1f8b, 0x0f7f, 0x0e7f,
+ 0x017f, 0x007c, 0x127e, 0x2091, 0x2200, 0x2061, 0x0100, 0x2071,
+ 0x6f00, 0x6024, 0x6026, 0x6033, 0x00ef, 0x60e7, 0x0000, 0x60eb,
+ 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f,
+ 0x0080, 0x602f, 0x0000, 0x6007, 0x00af, 0x600f, 0x00ff, 0x602b,
+ 0x002f, 0x127f, 0x007c, 0x2001, 0x6f2b, 0x2003, 0x0000, 0x2001,
+ 0x6f2a, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x007e,
+ 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, 0x1db3, 0xa184,
+ 0x0007, 0x0079, 0x1db9, 0xa195, 0x0004, 0xa284, 0x0007, 0x0079,
+ 0x1db9, 0x1de5, 0x1dc1, 0x1dc5, 0x1dc9, 0x1dcf, 0x1dd3, 0x1dd9,
+ 0x1ddf, 0x1078, 0x42cb, 0x0078, 0x1de5, 0x1078, 0x43ae, 0x0078,
+ 0x1de5, 0x1078, 0x43ae, 0x1078, 0x42cb, 0x0078, 0x1de5, 0x1078,
+ 0x1dea, 0x0078, 0x1de5, 0x1078, 0x42cb, 0x1078, 0x1dea, 0x0078,
+ 0x1de5, 0x1078, 0x43ae, 0x1078, 0x1dea, 0x0078, 0x1de5, 0x1078,
+ 0x43ae, 0x1078, 0x42cb, 0x1078, 0x1dea, 0x027f, 0x017f, 0x007f,
+ 0x127f, 0x007c, 0xd1ac, 0x0040, 0x1e97, 0x017e, 0x047e, 0x0c7e,
+ 0x644c, 0x74b2, 0xa48c, 0xff00, 0xa196, 0xff00, 0x0040, 0x1e19,
+ 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, 0x1e19, 0x7130,
+ 0xd18c, 0x00c0, 0x1e19, 0x2011, 0x6f52, 0x2214, 0xd2ec, 0x0040,
+ 0x1e0d, 0xc18d, 0x7132, 0x0078, 0x1e19, 0x6240, 0xa294, 0x0010,
+ 0x0040, 0x1e54, 0x6248, 0xa294, 0xff00, 0xa296, 0xff00, 0x00c0,
+ 0x1e54, 0x2011, 0x8013, 0x1078, 0x29c6, 0x7130, 0xc185, 0x7132,
+ 0x2011, 0x6f52, 0x220c, 0xd1a4, 0x0040, 0x1e3c, 0x017e, 0x2009,
+ 0x0001, 0x2011, 0x0100, 0x1078, 0x4299, 0x2019, 0x000e, 0x1078,
+ 0x6d28, 0xa484, 0x00ff, 0x1078, 0x1fb0, 0x8127, 0xa006, 0x2009,
+ 0x000e, 0x1078, 0x6d90, 0x017f, 0xd1ac, 0x00c0, 0x1e45, 0x2019,
+ 0x0004, 0x1078, 0x2152, 0x0078, 0x1e54, 0x157e, 0x20a9, 0x007e,
+ 0x2009, 0x0000, 0x1078, 0x3497, 0x00c0, 0x1e50, 0x1078, 0x329b,
+ 0x8108, 0x00f0, 0x1e4a, 0x157f, 0x0c7f, 0x047f, 0x6043, 0x0000,
+ 0x2009, 0x00f7, 0x1078, 0x325e, 0x0f7e, 0x2079, 0x70c9, 0x783c,
+ 0xa086, 0x0000, 0x0040, 0x1e6c, 0x6027, 0x0004, 0x783f, 0x0000,
+ 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078,
+ 0x515f, 0x2011, 0x0002, 0x1078, 0x5169, 0x1078, 0x5075, 0x1078,
+ 0x41d0, 0x037e, 0x2019, 0x0000, 0x1078, 0x5107, 0x037f, 0x60e3,
+ 0x0000, 0x017f, 0x2001, 0x6f00, 0x2014, 0xa296, 0x0004, 0x00c0,
+ 0x1e8f, 0xd19c, 0x00c0, 0x1e8f, 0x6228, 0xc29d, 0x622a, 0x2003,
+ 0x0001, 0x2001, 0x6f1e, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194,
+ 0x0040, 0x1f32, 0x0f7e, 0x2079, 0x70c9, 0x783c, 0xa086, 0x0001,
+ 0x00c0, 0x1ebb, 0x017e, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079,
+ 0x0140, 0x7803, 0x1000, 0x7803, 0x0000, 0x2079, 0x70b6, 0x7807,
+ 0x0000, 0x7833, 0x0000, 0x1078, 0x484d, 0x1078, 0x48fd, 0x017f,
+ 0x0f7f, 0x0078, 0x1f32, 0x0f7f, 0x017e, 0x6220, 0xd2b4, 0x0040,
+ 0x1ef0, 0x1078, 0x41d0, 0x1078, 0x4f45, 0x6027, 0x0004, 0x0d7e,
+ 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x1ed3, 0x6803,
+ 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0x70b6, 0x6028,
+ 0xa09a, 0x0002, 0x00c8, 0x1ee3, 0x8000, 0x602a, 0x0c7f, 0x1078,
+ 0x4f37, 0x0078, 0x1f31, 0x2019, 0x70bf, 0x2304, 0xa065, 0x0040,
+ 0x1eed, 0x2009, 0x0027, 0x1078, 0x55c8, 0x0c7f, 0x0078, 0x1f31,
+ 0xd2bc, 0x0040, 0x1f31, 0x1078, 0x41de, 0x6017, 0x0010, 0x6027,
+ 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040,
+ 0x1f05, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061,
+ 0x70b6, 0x6044, 0xa09a, 0x0002, 0x00c8, 0x1f26, 0x8000, 0x6046,
+ 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1f31, 0x1078, 0x41d5, 0xa080,
+ 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0, 0x1f22, 0x6017, 0x0012,
+ 0x0078, 0x1f31, 0x6017, 0x0016, 0x0078, 0x1f31, 0x2019, 0x70c5,
+ 0x2304, 0xa065, 0x0040, 0x1f30, 0x2009, 0x004f, 0x1078, 0x55c8,
+ 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1f5a, 0x017e, 0x6028, 0xc09c,
+ 0x602a, 0x2011, 0x0003, 0x1078, 0x515f, 0x2011, 0x0002, 0x1078,
+ 0x5169, 0x1078, 0x5075, 0x1078, 0x41d0, 0x037e, 0x2019, 0x0000,
+ 0x1078, 0x5107, 0x037f, 0x60e3, 0x0000, 0x1078, 0x6dff, 0x1078,
+ 0x6e1d, 0x2001, 0x6f00, 0x2003, 0x0004, 0x6027, 0x0008, 0x1078,
+ 0x117d, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e, 0x017e,
+ 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x6f00,
+ 0x71a8, 0x70aa, 0xa116, 0x0040, 0x1f84, 0x81ff, 0x0040, 0x1f76,
+ 0x2011, 0x8011, 0x1078, 0x29c6, 0x0078, 0x1f84, 0x2011, 0x8012,
+ 0x1078, 0x29c6, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019, 0x0028,
+ 0x1078, 0x2152, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f, 0x027f,
+ 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e, 0x2061,
+ 0x0100, 0xa190, 0x1f9e, 0x2204, 0x60f2, 0xa190, 0x1fa7, 0x2204,
+ 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x0840, 0x0840,
+ 0x0840, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210, 0x01a8,
+ 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0, 0x00a0,
+ 0xa080, 0x21d3, 0x200c, 0xa18c, 0xff00, 0x810f, 0x007c, 0xa080,
+ 0x21d3, 0x200c, 0xa18c, 0x00ff, 0x007c, 0x1fdd, 0x1fe1, 0x1fe5,
+ 0x1feb, 0x1ff1, 0x1ff7, 0x1ffd, 0x2005, 0x200d, 0x2013, 0x2019,
+ 0x2021, 0x2029, 0x2031, 0x2039, 0x2043, 0x204d, 0x204d, 0x204d,
+ 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x204d,
+ 0x204d, 0x204d, 0x204d, 0x204d, 0x204d, 0x107e, 0x007e, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1da4, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e,
+ 0x007e, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1da4, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1da4, 0x1078, 0x1c94, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078,
+ 0x1cd8, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1c94, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1c94, 0x1078, 0x1cd8, 0x0078,
+ 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078, 0x1c94, 0x1078,
+ 0x1cd8, 0x0078, 0x2066, 0x107e, 0x007e, 0x1078, 0x1da4, 0x1078,
+ 0x1c94, 0x1078, 0x1cd8, 0x0078, 0x2066, 0x0005, 0x0078, 0x204d,
+ 0xb084, 0x003c, 0x8004, 0x8004, 0x0079, 0x2056, 0x2066, 0x1fe3,
+ 0x1fe7, 0x1fed, 0x1ff3, 0x1ff9, 0x1fff, 0x2007, 0x200f, 0x2015,
+ 0x201b, 0x2023, 0x202b, 0x2033, 0x203b, 0x2045, 0x0008, 0x2050,
+ 0x007f, 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x2001,
+ 0x010c, 0x203c, 0x7274, 0x82ff, 0x0040, 0x20bc, 0x037e, 0x7384,
+ 0xa38e, 0xffff, 0x00c0, 0x207e, 0x2019, 0x0001, 0x8314, 0xa2e0,
+ 0x74c0, 0x2c04, 0xa38c, 0x0001, 0x0040, 0x208b, 0xa084, 0xff00,
+ 0x8007, 0x0078, 0x208d, 0xa084, 0x00ff, 0xa70e, 0x0040, 0x20b1,
+ 0xa08e, 0x0000, 0x0040, 0x20b1, 0xa08e, 0x00ff, 0x0040, 0x20b7,
+ 0x1078, 0x1fb0, 0x1078, 0x3460, 0x00c0, 0x20b4, 0x6004, 0xa084,
+ 0x00ff, 0xa086, 0x0006, 0x00c0, 0x20ab, 0x1078, 0x2104, 0x0040,
+ 0x20b4, 0x0078, 0x20b1, 0x1078, 0x219f, 0x1078, 0x212b, 0x0040,
+ 0x20b4, 0x8318, 0x0078, 0x207e, 0x7386, 0x0078, 0x20b9, 0x7087,
+ 0xffff, 0x037f, 0x0078, 0x2101, 0xa780, 0x21d3, 0x203c, 0xa7bc,
+ 0xff00, 0x873f, 0x20a9, 0x007e, 0x2009, 0x0000, 0x7084, 0xa096,
+ 0xffff, 0x0040, 0x20d8, 0xa092, 0x007e, 0x0048, 0x20d3, 0x7087,
+ 0xffff, 0x0078, 0x20fe, 0x2008, 0x2011, 0x007e, 0xa202, 0x20a8,
+ 0x2700, 0x157e, 0x017e, 0xa106, 0x0040, 0x20f5, 0x1078, 0x3460,
+ 0x00c0, 0x20fe, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+ 0x20ef, 0x1078, 0x2104, 0x0040, 0x20fe, 0x0078, 0x20f5, 0x1078,
+ 0x219f, 0x1078, 0x212b, 0x0040, 0x20fe, 0x017f, 0x8108, 0x157f,
+ 0x00f0, 0x20d8, 0x7087, 0xffff, 0x0078, 0x2101, 0x017f, 0x157f,
+ 0x7186, 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e,
+ 0x2c68, 0x1078, 0x553b, 0x0040, 0x2126, 0x2d00, 0x601a, 0x601f,
+ 0x0001, 0x2001, 0x0000, 0x1078, 0x342f, 0x2001, 0x0000, 0x1078,
+ 0x3443, 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082, 0x127f,
+ 0x2009, 0x0004, 0x1078, 0x55c8, 0xa085, 0x0001, 0x0c7f, 0x0d7f,
+ 0x077f, 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68,
+ 0x1078, 0x553b, 0x0040, 0x214d, 0x2d00, 0x601a, 0x601f, 0x0001,
+ 0x2001, 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443,
+ 0x127e, 0x2091, 0x8000, 0x7080, 0x8000, 0x7082, 0x127f, 0x2009,
+ 0x0002, 0x1078, 0x55c8, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
+ 0x017f, 0x007c, 0x0e7e, 0x0c7e, 0x067e, 0x037e, 0x027e, 0x1078,
+ 0x453c, 0x1078, 0x44ec, 0x1078, 0x59ae, 0x20a9, 0x007e, 0x2009,
+ 0x0000, 0x017e, 0x1078, 0x3497, 0x00c0, 0x216a, 0x1078, 0x3618,
+ 0x1078, 0x329b, 0x017f, 0x8108, 0x00f0, 0x2161, 0x027f, 0x037f,
+ 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e,
+ 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e, 0x2019, 0x0029, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078, 0x6bca, 0x017f, 0x2e60,
+ 0x1078, 0x3618, 0x1078, 0x329b, 0x017f, 0x027f, 0x037f, 0x0c7f,
+ 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x6f00, 0x7080, 0xa005,
+ 0x0040, 0x219c, 0x8001, 0x7082, 0x007f, 0x0e7f, 0x007c, 0x6000,
0xc08c, 0x6002, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e,
- 0x157e, 0x81ff, 0x00c0, 0x22e0, 0x20a9, 0x0001, 0x0078, 0x22e4,
- 0x20a9, 0x007f, 0x2011, 0x0000, 0x027e, 0xa2e0, 0x7720, 0x2c64,
- 0x8cff, 0x0040, 0x22f6, 0x2019, 0x0029, 0x1078, 0x4914, 0x1078,
- 0x4857, 0x2c08, 0x1078, 0x7326, 0x1078, 0x3958, 0x027f, 0x8210,
- 0x00f0, 0x22e4, 0x027e, 0x027f, 0x157f, 0x017f, 0x027f, 0x037f,
+ 0x157e, 0x81ff, 0x00c0, 0x21b0, 0x20a9, 0x0001, 0x0078, 0x21b4,
+ 0x20a9, 0x007e, 0x2011, 0x0000, 0x027e, 0xa2e0, 0x7020, 0x2c64,
+ 0x8cff, 0x0040, 0x21c6, 0x2019, 0x0029, 0x1078, 0x4535, 0x1078,
+ 0x4478, 0x2c08, 0x1078, 0x6bca, 0x1078, 0x3618, 0x027f, 0x8210,
+ 0x00f0, 0x21b4, 0x027e, 0x027f, 0x157f, 0x017f, 0x027f, 0x037f,
0x0c7f, 0x0e7f, 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1,
0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3,
0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9,
@@ -8783,582 +9813,516 @@ static const u_int16_t ISP2100_RISC_CODE[] = {
0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600,
0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200,
0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x2071, 0x766d, 0x7003, 0x0002, 0xa006,
- 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x767d, 0x7037, 0x767d,
- 0x7007, 0x0001, 0x2061, 0x76bd, 0x6003, 0x0002, 0x007c, 0x0090,
- 0x242a, 0x0068, 0x242a, 0x2071, 0x766d, 0x2b78, 0x7818, 0xd084,
- 0x00c0, 0x242a, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x2511,
- 0x0079, 0x24ae, 0x007c, 0x2071, 0x766d, 0x7004, 0x0079, 0x2430,
- 0x2434, 0x2435, 0x243f, 0x2451, 0x007c, 0x0090, 0x243e, 0x0068,
- 0x243e, 0x2b78, 0x7818, 0xd084, 0x0040, 0x245d, 0x007c, 0x2b78,
- 0x2061, 0x76bd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x244c, 0xa086,
- 0x0200, 0x0040, 0x2509, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018,
- 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x2459,
+ 0x8000, 0x8000, 0x0000, 0x2071, 0x6f6d, 0x7003, 0x0002, 0xa006,
+ 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x6f7d, 0x7037, 0x6f7d,
+ 0x7007, 0x0001, 0x2061, 0x6fbd, 0x6003, 0x0002, 0x007c, 0x0090,
+ 0x22ea, 0x0068, 0x22ea, 0x2071, 0x6f6d, 0x2b78, 0x7818, 0xd084,
+ 0x00c0, 0x22ea, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x23d1,
+ 0x0079, 0x236e, 0x007c, 0x2071, 0x6f6d, 0x7004, 0x0079, 0x22f0,
+ 0x22f4, 0x22f5, 0x22ff, 0x2311, 0x007c, 0x0090, 0x22fe, 0x0068,
+ 0x22fe, 0x2b78, 0x7818, 0xd084, 0x0040, 0x231d, 0x007c, 0x2b78,
+ 0x2061, 0x6fbd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x230c, 0xa086,
+ 0x0200, 0x0040, 0x23c9, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018,
+ 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x2319,
0x007c, 0x2a60, 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a,
- 0x0040, 0x00c8, 0x2466, 0x61b0, 0x0079, 0x246e, 0x2100, 0xa08a,
- 0x0036, 0x00c8, 0x2505, 0x61b0, 0x0079, 0x24ae, 0x24e7, 0x2519,
- 0x2521, 0x2525, 0x252d, 0x2533, 0x2537, 0x2540, 0x2544, 0x254c,
- 0x2550, 0x2505, 0x2505, 0x2505, 0x2554, 0x2505, 0x2564, 0x257b,
- 0x2592, 0x260e, 0x2613, 0x2640, 0x268d, 0x269c, 0x26bd, 0x26f3,
- 0x26fd, 0x270a, 0x271d, 0x2735, 0x273e, 0x277b, 0x2781, 0x2505,
- 0x2791, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2795, 0x279b,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x27a3, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x27b0, 0x27b6,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x254c, 0x2550,
- 0x2505, 0x2505, 0x27c8, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2815, 0x28e2,
- 0x28f6, 0x28fd, 0x2960, 0x29bb, 0x29c6, 0x2a08, 0x2a15, 0x2a22,
- 0x2a25, 0x27cc, 0x2a4e, 0x2a95, 0x2aa2, 0x2b94, 0x2c7a, 0x2ca1,
- 0x2d8d, 0x2d9b, 0x2da8, 0x2de2, 0x713c, 0x0078, 0x24e7, 0x2021,
- 0x4000, 0x1078, 0x2cdc, 0x127e, 0x2091, 0x8000, 0x0068, 0x24f4,
- 0x7818, 0xd084, 0x0040, 0x24f7, 0x127f, 0x0078, 0x24eb, 0x781b,
+ 0x0040, 0x00c8, 0x2326, 0x61a8, 0x0079, 0x232e, 0x2100, 0xa08a,
+ 0x0036, 0x00c8, 0x23c5, 0x61a8, 0x0079, 0x236e, 0x23a7, 0x23d9,
+ 0x23e1, 0x23e5, 0x23ed, 0x23f3, 0x23f7, 0x2400, 0x2404, 0x240c,
+ 0x2410, 0x23c5, 0x23c5, 0x23c5, 0x2414, 0x23c5, 0x2424, 0x243b,
+ 0x2452, 0x24ce, 0x24d3, 0x2500, 0x254d, 0x255c, 0x257d, 0x25b3,
+ 0x25bd, 0x25ca, 0x25dd, 0x25f5, 0x25fe, 0x263b, 0x2641, 0x23c5,
+ 0x264c, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x2650, 0x2656,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x265e, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x266b, 0x2671,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x240c, 0x2410,
+ 0x23c5, 0x23c5, 0x2683, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x23c5, 0x26d0, 0x279d,
+ 0x27b1, 0x27b8, 0x281b, 0x286c, 0x2877, 0x28b9, 0x28c6, 0x28d3,
+ 0x28d6, 0x2687, 0x28ff, 0x2946, 0x23c5, 0x23c5, 0x23c5, 0x23c5,
+ 0x2a4d, 0x2a5b, 0x2a68, 0x2aa2, 0x713c, 0x0078, 0x23a7, 0x2021,
+ 0x4000, 0x1078, 0x29a0, 0x127e, 0x2091, 0x8000, 0x0068, 0x23b4,
+ 0x7818, 0xd084, 0x0040, 0x23b7, 0x127f, 0x0078, 0x23ab, 0x781b,
0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x2091, 0x4080, 0x7007,
0x0001, 0x2091, 0x5000, 0x127f, 0x007c, 0x2021, 0x4001, 0x0078,
- 0x24e9, 0x2021, 0x4002, 0x0078, 0x24e9, 0x2021, 0x4003, 0x0078,
- 0x24e9, 0x2021, 0x4005, 0x0078, 0x24e9, 0x2021, 0x4006, 0x0078,
- 0x24e9, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x2ceb, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2cef, 0x7924, 0x7828, 0x2114,
- 0x200a, 0x0078, 0x24e7, 0x7924, 0x2114, 0x0078, 0x24e7, 0x2099,
- 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x24e7,
- 0x7824, 0x2060, 0x0078, 0x2556, 0x2009, 0x0001, 0x2011, 0x000f,
- 0x2019, 0x0007, 0x0078, 0x24e7, 0x7d38, 0x7c3c, 0x0078, 0x251b,
- 0x7d38, 0x7c3c, 0x0078, 0x2527, 0x2061, 0x1000, 0x610c, 0xa006,
- 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2558, 0x2010, 0xa005,
- 0x0040, 0x24e7, 0x0078, 0x250d, 0x2061, 0x7651, 0x7824, 0x7930,
- 0xa11a, 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604a, 0x6142,
+ 0x23a9, 0x2021, 0x4002, 0x0078, 0x23a9, 0x2021, 0x4003, 0x0078,
+ 0x23a9, 0x2021, 0x4005, 0x0078, 0x23a9, 0x2021, 0x4006, 0x0078,
+ 0x23a9, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
+ 0x29af, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
+ 0x7a2c, 0x7824, 0x7930, 0x0078, 0x29b3, 0x7924, 0x7828, 0x2114,
+ 0x200a, 0x0078, 0x23a7, 0x7924, 0x2114, 0x0078, 0x23a7, 0x2099,
+ 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x23a7,
+ 0x7824, 0x2060, 0x0078, 0x2416, 0x2009, 0x0001, 0x2011, 0x000f,
+ 0x2019, 0x0000, 0x0078, 0x23a7, 0x7d38, 0x7c3c, 0x0078, 0x23db,
+ 0x7d38, 0x7c3c, 0x0078, 0x23e7, 0x2061, 0x1000, 0x610c, 0xa006,
+ 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2418, 0x2010, 0xa005,
+ 0x0040, 0x23a7, 0x0078, 0x23cd, 0x2061, 0x6f51, 0x7824, 0x7930,
+ 0xa11a, 0x00c8, 0x23d5, 0x8019, 0x0040, 0x23d5, 0x604a, 0x6142,
0x782c, 0x6052, 0x7828, 0x6056, 0xa006, 0x605a, 0x605e, 0x1078,
- 0x3c23, 0x0078, 0x24e7, 0x2061, 0x7651, 0x7824, 0x7930, 0xa11a,
- 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604e, 0x6146, 0x782c,
- 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x39f9,
- 0x0078, 0x24e7, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x2511, 0x7924,
- 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x7674, 0x41a1, 0x1078,
- 0x2cb3, 0x0040, 0x2511, 0x2009, 0x0020, 0x1078, 0x2ceb, 0x701b,
- 0x25aa, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
- 0x0040, 0x25b6, 0xa096, 0x0019, 0x00c0, 0x2511, 0x810f, 0xa18c,
- 0x00ff, 0x0040, 0x2511, 0x710e, 0x700c, 0x8001, 0x0040, 0x25e7,
- 0x700e, 0x1078, 0x2cb3, 0x0040, 0x2511, 0x2009, 0x0020, 0x2061,
- 0x76bd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
- 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x2ceb, 0x701b,
- 0x25da, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
- 0x25e5, 0xa096, 0x000a, 0x00c0, 0x2511, 0x0078, 0x25bc, 0x7010,
- 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x36d4, 0x00c0, 0x25f5,
- 0x7007, 0x0003, 0x701b, 0x25f7, 0x007c, 0x1078, 0x3abc, 0x127e,
- 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x7674, 0x530a, 0x2100,
+ 0x38e3, 0x0078, 0x23a7, 0x2061, 0x6f51, 0x7824, 0x7930, 0xa11a,
+ 0x00c8, 0x23d5, 0x8019, 0x0040, 0x23d5, 0x604e, 0x6146, 0x782c,
+ 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x36b9,
+ 0x0078, 0x23a7, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x23d1, 0x7924,
+ 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x6f74, 0x41a1, 0x1078,
+ 0x2977, 0x0040, 0x23d1, 0x2009, 0x0020, 0x1078, 0x29af, 0x701b,
+ 0x246a, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
+ 0x0040, 0x2476, 0xa096, 0x0019, 0x00c0, 0x23d1, 0x810f, 0xa18c,
+ 0x00ff, 0x0040, 0x23d1, 0x710e, 0x700c, 0x8001, 0x0040, 0x24a7,
+ 0x700e, 0x1078, 0x2977, 0x0040, 0x23d1, 0x2009, 0x0020, 0x2061,
+ 0x6fbd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
+ 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x29af, 0x701b,
+ 0x249a, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
+ 0x24a5, 0xa096, 0x000a, 0x00c0, 0x23d1, 0x0078, 0x247c, 0x7010,
+ 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x3394, 0x00c0, 0x24b5,
+ 0x7007, 0x0003, 0x701b, 0x24b7, 0x007c, 0x1078, 0x377c, 0x127e,
+ 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x6f74, 0x530a, 0x2100,
0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80,
- 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x2cef, 0x6198, 0x7824,
- 0x609a, 0x0078, 0x24e7, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
+ 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x29b3, 0x6190, 0x7824,
+ 0x6092, 0x0078, 0x23a7, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104,
0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e,
0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010,
0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, 0x0078, 0x0423,
- 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x7c28,
- 0x7d2c, 0x1078, 0x391b, 0xd28c, 0x00c0, 0x2652, 0x1078, 0x38ab,
- 0x0078, 0x2654, 0x1078, 0x38e7, 0x00c0, 0x267e, 0x2061, 0x7d00,
- 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x266c,
- 0x6010, 0xa06d, 0x0040, 0x266c, 0x683c, 0xa406, 0x00c0, 0x266c,
- 0x6840, 0xa506, 0x0040, 0x2677, 0x127f, 0xace0, 0x0008, 0x2001,
- 0x7615, 0x2004, 0xac02, 0x00c8, 0x2511, 0x0078, 0x2658, 0x1078,
- 0x66dd, 0x127f, 0x0040, 0x2511, 0x0078, 0x24e7, 0xa00e, 0x2001,
- 0x0005, 0x1078, 0x3abc, 0x127e, 0x2091, 0x8000, 0x1078, 0x6af2,
- 0x1078, 0x3a2c, 0x127f, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078, 0x3860, 0x1078, 0x392c,
- 0x0040, 0x2511, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078,
- 0x2ccb, 0x0040, 0x2515, 0x2031, 0x000f, 0x1078, 0x3860, 0x8631,
- 0x00c8, 0x26a5, 0x2019, 0x0005, 0x1078, 0x394d, 0x0040, 0x2511,
- 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2515, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x1078, 0x452d, 0x0078, 0x24e7, 0x127e, 0x2091, 0x8000,
- 0x81ff, 0x00c0, 0x26ed, 0x2029, 0x00ff, 0x644c, 0x2400, 0xa506,
- 0x0040, 0x26e7, 0x2508, 0x1078, 0x37d7, 0x00c0, 0x26e7, 0x2031,
- 0x000f, 0x1078, 0x3860, 0x8631, 0x00c8, 0x26d1, 0x2019, 0x0004,
- 0x1078, 0x394d, 0x0040, 0x26ed, 0x7824, 0xa08a, 0x1000, 0x00c8,
- 0x26f0, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x452d, 0x8529,
- 0x00c8, 0x26c6, 0x127f, 0x0078, 0x24e7, 0x127f, 0x0078, 0x2511,
- 0x127f, 0x0078, 0x2515, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078,
- 0x3890, 0x1078, 0x391b, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078, 0x3879, 0x1078, 0x391b,
- 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x1078, 0x38ea, 0x0040, 0x2511, 0x1078, 0x371c, 0x1078,
- 0x38a4, 0x1078, 0x391b, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x1078, 0x3860, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078,
- 0x3958, 0x0c7f, 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078,
- 0x7326, 0x1078, 0x391b, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x1078, 0x391b, 0x2208, 0x0078, 0x24e7, 0x157e, 0x0d7e,
- 0x0e7e, 0x2069, 0x76ff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x274a,
+ 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x7c28,
+ 0x7d2c, 0x1078, 0x35db, 0xd28c, 0x00c0, 0x2512, 0x1078, 0x356b,
+ 0x0078, 0x2514, 0x1078, 0x35a7, 0x00c0, 0x253e, 0x2061, 0x7500,
+ 0x127e, 0x2091, 0x8000, 0x6000, 0xa086, 0x0000, 0x0040, 0x252c,
+ 0x6010, 0xa06d, 0x0040, 0x252c, 0x683c, 0xa406, 0x00c0, 0x252c,
+ 0x6840, 0xa506, 0x0040, 0x2537, 0x127f, 0xace0, 0x0008, 0x2001,
+ 0x6f15, 0x2004, 0xac02, 0x00c8, 0x23d1, 0x0078, 0x2518, 0x1078,
+ 0x5fe3, 0x127f, 0x0040, 0x23d1, 0x0078, 0x23a7, 0xa00e, 0x2001,
+ 0x0005, 0x1078, 0x377c, 0x127e, 0x2091, 0x8000, 0x1078, 0x63a3,
+ 0x1078, 0x36ec, 0x127f, 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1,
+ 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078, 0x3520, 0x1078, 0x35ec,
+ 0x0040, 0x23d1, 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1, 0x1078,
+ 0x298f, 0x0040, 0x23d5, 0x2031, 0x000f, 0x1078, 0x3520, 0x8631,
+ 0x00c8, 0x2565, 0x2019, 0x0005, 0x1078, 0x360d, 0x0040, 0x23d1,
+ 0x7828, 0xa08a, 0x1000, 0x00c8, 0x23d5, 0x8003, 0x800b, 0x810b,
+ 0xa108, 0x1078, 0x4160, 0x0078, 0x23a7, 0x127e, 0x2091, 0x8000,
+ 0x81ff, 0x00c0, 0x25ad, 0x2029, 0x007d, 0x644c, 0x2400, 0xa506,
+ 0x0040, 0x25a7, 0x2508, 0x1078, 0x3497, 0x00c0, 0x25a7, 0x2031,
+ 0x000f, 0x1078, 0x3520, 0x8631, 0x00c8, 0x2591, 0x2019, 0x0004,
+ 0x1078, 0x360d, 0x0040, 0x25ad, 0x7824, 0xa08a, 0x1000, 0x00c8,
+ 0x25b0, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4160, 0x8529,
+ 0x00c8, 0x2586, 0x127f, 0x0078, 0x23a7, 0x127f, 0x0078, 0x23d1,
+ 0x127f, 0x0078, 0x23d5, 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078,
+ 0x3550, 0x1078, 0x35db, 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1,
+ 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078, 0x3539, 0x1078, 0x35db,
+ 0x0078, 0x23a7, 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040,
+ 0x23d5, 0x1078, 0x35aa, 0x0040, 0x23d1, 0x1078, 0x33dc, 0x1078,
+ 0x3564, 0x1078, 0x35db, 0x0078, 0x23a7, 0x1078, 0x298f, 0x0040,
+ 0x23d5, 0x1078, 0x3520, 0x62a0, 0x2019, 0x0005, 0x0c7e, 0x1078,
+ 0x3618, 0x0c7f, 0x1078, 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078,
+ 0x6bca, 0x1078, 0x35db, 0x0078, 0x23a7, 0x1078, 0x298f, 0x0040,
+ 0x23d5, 0x1078, 0x35db, 0x2208, 0x0078, 0x23a7, 0x157e, 0x0d7e,
+ 0x0e7e, 0x2069, 0x6fff, 0x6810, 0x6914, 0xa10a, 0x00c8, 0x260a,
0x2009, 0x0000, 0x6816, 0x2011, 0x0000, 0x2019, 0x0000, 0x20a9,
- 0x007e, 0x2069, 0x7720, 0x2d04, 0xa075, 0x0040, 0x275f, 0x704c,
- 0x1078, 0x2769, 0xa210, 0x7080, 0x1078, 0x2769, 0xa318, 0x8d68,
- 0x00f0, 0x2753, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078,
- 0x24e7, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2778, 0x2001, 0x0000,
- 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2778, 0x2178, 0x0078, 0x2770,
- 0x017f, 0x0f7f, 0x007c, 0x2069, 0x76ff, 0x6910, 0x629c, 0x0078,
- 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x614c, 0xa190, 0x2303, 0x2214,
- 0xa294, 0x00ff, 0x6068, 0xa084, 0xff00, 0xa215, 0x6364, 0x0078,
- 0x24e7, 0x613c, 0x6240, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x6244,
- 0x6338, 0x0078, 0x24e7, 0x613c, 0x6240, 0x7824, 0x603e, 0x7b28,
- 0x6342, 0x2069, 0x7651, 0x831f, 0xa305, 0x6816, 0x0078, 0x24e7,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x0078, 0x24e7, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x7828, 0xa00d, 0x0040, 0x2515, 0x782c, 0xa005,
- 0x0040, 0x2515, 0x6244, 0x6146, 0x6338, 0x603a, 0x0078, 0x24e7,
- 0x7d38, 0x7c3c, 0x0078, 0x2594, 0x7824, 0xa09c, 0x00ff, 0xa39a,
- 0x0003, 0x00c8, 0x2511, 0x624c, 0xa084, 0xff00, 0x8007, 0xa206,
- 0x00c0, 0x27e4, 0x2001, 0x7640, 0x2009, 0x000c, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x0078, 0x2cef, 0x81ff, 0x00c0, 0x2511, 0x1078,
- 0x2ccb, 0x0040, 0x2515, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x2511, 0x0c7e, 0x1078, 0x2cb3, 0x0c7f, 0x0040, 0x2511,
- 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x69ec, 0x0040,
- 0x2511, 0x7007, 0x0003, 0x701b, 0x2806, 0x007c, 0x6830, 0xa086,
- 0x0100, 0x0040, 0x2511, 0xad80, 0x000e, 0x2009, 0x000c, 0x7a2c,
- 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2cef, 0x1078, 0x2cb3, 0x0040,
- 0x2511, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078,
- 0x2ceb, 0x701b, 0x2824, 0x007c, 0xade8, 0x000d, 0x6800, 0xa005,
- 0x0040, 0x2515, 0x6804, 0xd0ac, 0x0040, 0x2831, 0xd0a4, 0x0040,
- 0x2515, 0xd094, 0x0040, 0x283c, 0x0c7e, 0x2061, 0x0100, 0x6104,
- 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c, 0x0040, 0x2847, 0x0c7e,
- 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010, 0x6106, 0x0c7f, 0x2009,
- 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048, 0x285c, 0xd084, 0x0040,
- 0x285c, 0x6a28, 0xa28a, 0x007f, 0x00c8, 0x2515, 0xa288, 0x2303,
- 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc, 0x0040, 0x2865, 0x6828,
- 0xa08a, 0x007f, 0x00c8, 0x2515, 0x604e, 0x6808, 0xa08a, 0x0100,
- 0x0048, 0x2515, 0xa08a, 0x0841, 0x00c8, 0x2515, 0xa084, 0x0007,
- 0x00c0, 0x2515, 0x680c, 0xa005, 0x0040, 0x2515, 0x6810, 0xa005,
- 0x0040, 0x2515, 0x6848, 0x6940, 0xa10a, 0x00c8, 0x2515, 0x8001,
- 0x0040, 0x2515, 0x684c, 0x6944, 0xa10a, 0x00c8, 0x2515, 0x8001,
- 0x0040, 0x2515, 0x20a9, 0x001c, 0x2d98, 0x2069, 0x7651, 0x2da0,
- 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e, 0x8007, 0xa084, 0x00ff,
- 0x6042, 0x1078, 0x3c23, 0x1078, 0x39f9, 0x6000, 0xa086, 0x0000,
- 0x00c0, 0x28e0, 0x6808, 0x602a, 0x1078, 0x1dbe, 0x6818, 0x691c,
- 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a,
- 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040, 0x28c0, 0x6830, 0x6934,
- 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0078, 0x28c2,
- 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x1078, 0x45b9,
- 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x0c7f,
- 0x60b4, 0xa005, 0x0040, 0x28dc, 0x6003, 0x0001, 0x2091, 0x301d,
- 0x1078, 0x3535, 0x0078, 0x28e0, 0x6003, 0x0004, 0x2091, 0x301d,
- 0x0078, 0x24e7, 0x6000, 0xa086, 0x0000, 0x0040, 0x2511, 0x2069,
- 0x7651, 0x7830, 0x6842, 0x7834, 0x6846, 0x2d00, 0x2009, 0x001c,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2cef, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x3535, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x617c, 0x81ff, 0x0040, 0x2917, 0x703f, 0x0000, 0x2001, 0x7cc0,
- 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x2cef, 0x701b, 0x24e4, 0x127f, 0x007c, 0x703f,
- 0x0001, 0x0d7e, 0x2069, 0x7cc0, 0x20a9, 0x0040, 0x20a1, 0x7cc0,
- 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588, 0x2303, 0x210c, 0xa18c,
- 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002, 0x2100, 0xa506, 0x0040,
- 0x2949, 0x1078, 0x37d7, 0x00c0, 0x2949, 0x6014, 0x821c, 0x0048,
- 0x2941, 0xa398, 0x7cc0, 0xa085, 0xff00, 0x8007, 0x201a, 0x0078,
- 0x2948, 0xa398, 0x7cc0, 0x2324, 0xa4a4, 0xff00, 0xa405, 0x201a,
- 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8, 0x2950, 0x0078, 0x292d,
- 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a, 0x0d7f, 0x20a9, 0x0040,
- 0x20a1, 0x7cc0, 0x2099, 0x7cc0, 0x1078, 0x357e, 0x0078, 0x2906,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x0c7e, 0x1078, 0x2cb3, 0x0c7f,
- 0x0040, 0x2511, 0x2001, 0x7652, 0x2004, 0xd0b4, 0x0040, 0x298d,
- 0x6000, 0xd08c, 0x00c0, 0x298d, 0x6004, 0xa084, 0x00ff, 0xa086,
- 0x0006, 0x00c0, 0x298d, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x6a24, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2989,
- 0x007c, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x20a9, 0x0029, 0x2c98,
- 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9, 0x0002, 0xac80, 0x0004,
- 0x2098, 0xad80, 0x0004, 0x20a0, 0x1078, 0x357e, 0x20a9, 0x0004,
- 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078, 0x357e,
- 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a, 0x20a0,
- 0x1078, 0x357e, 0x2d00, 0x2009, 0x0029, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x0078, 0x2cef, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x1078, 0x3937, 0x0078, 0x24e7, 0x81ff, 0x00c0,
- 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2515, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x2031, 0x000f, 0x1078, 0x3860, 0x8631, 0x00c8,
- 0x29d4, 0x2019, 0x0004, 0x1078, 0x394d, 0x7924, 0x810f, 0x7a28,
- 0x1078, 0x29e4, 0x0078, 0x24e7, 0xa186, 0x00ff, 0x0040, 0x29ec,
- 0x1078, 0x29fc, 0x0078, 0x29fb, 0x2029, 0x007e, 0x2061, 0x7600,
- 0x644c, 0x2400, 0xa506, 0x0040, 0x29f8, 0x2508, 0x1078, 0x29fc,
- 0x8529, 0x00c8, 0x29f1, 0x007c, 0x1078, 0x37d7, 0x00c0, 0x2a07,
- 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x452d, 0x007c,
- 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078,
- 0x3860, 0x1078, 0x3942, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511,
- 0x1078, 0x2ccb, 0x0040, 0x2515, 0x1078, 0x3860, 0x1078, 0x392c,
- 0x0078, 0x24e7, 0x6100, 0x0078, 0x24e7, 0x1078, 0x2ccb, 0x0040,
- 0x2515, 0x6004, 0xa086, 0x0707, 0x0040, 0x2515, 0x2001, 0x7600,
- 0x2004, 0xa086, 0x0003, 0x00c0, 0x2511, 0x0d7e, 0xace8, 0x000a,
- 0x7924, 0xd184, 0x0040, 0x2a3e, 0xace8, 0x0006, 0x680c, 0x8007,
- 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00, 0x8217,
- 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x24e7, 0x7824, 0xa084,
- 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2a58, 0x81ff, 0x00c0, 0x2511,
- 0x7828, 0xa08a, 0x1000, 0x00c8, 0x2515, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0xa186, 0x00ff, 0x0040, 0x2a6c, 0xa182, 0x007f, 0x00c8,
- 0x2515, 0x2100, 0x1078, 0x206e, 0x027e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x2061, 0x7849, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061,
- 0x0100, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a, 0x6043,
- 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x355a, 0x1078,
- 0x45b0, 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078, 0x29e4,
- 0x127f, 0x0c7f, 0x027f, 0x0078, 0x24e7, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0x0c7e, 0x1078, 0x37a0, 0x2c08, 0x0c7f, 0x00c0, 0x2515,
- 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x60bc, 0xd09c, 0x0040,
- 0x2511, 0x1078, 0x2cb3, 0x0040, 0x2511, 0x6823, 0x0000, 0x7924,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2ceb, 0x701b, 0x2ab9,
- 0x007c, 0x2009, 0x0080, 0x1078, 0x37d7, 0x00c0, 0x2ac6, 0x6004,
- 0xa084, 0x00ff, 0xa086, 0x0006, 0x0040, 0x2aca, 0x2021, 0x400a,
- 0x0078, 0x24e9, 0x0d7e, 0xade8, 0x000d, 0x6900, 0x6a08, 0x6b0c,
- 0x6c10, 0x6d14, 0x6e18, 0x6820, 0xa0be, 0x0100, 0x0040, 0x2b3c,
- 0xa0be, 0x0112, 0x0040, 0x2b3c, 0xa0be, 0x0113, 0x0040, 0x2b3c,
- 0xa0be, 0x0114, 0x0040, 0x2b3c, 0xa0be, 0x0117, 0x0040, 0x2b3c,
- 0xa0be, 0x011a, 0x0040, 0x2b3c, 0xa0be, 0x0121, 0x0040, 0x2b32,
- 0xa0be, 0x0131, 0x0040, 0x2b32, 0xa0be, 0x0171, 0x0040, 0x2b3c,
- 0xa0be, 0x0173, 0x0040, 0x2b3c, 0xa0be, 0x01a1, 0x00c0, 0x2b05,
- 0x6830, 0x8007, 0x6832, 0x0078, 0x2b42, 0xa0be, 0x0212, 0x0040,
- 0x2b38, 0xa0be, 0x0213, 0x0040, 0x2b38, 0xa0be, 0x0214, 0x0040,
- 0x2b2a, 0xa0be, 0x0217, 0x0040, 0x2b24, 0xa0be, 0x021a, 0x00c0,
- 0x2b1e, 0x6838, 0x8007, 0x683a, 0x0078, 0x2b3c, 0xa0be, 0x0300,
- 0x0040, 0x2b3c, 0x0078, 0x2511, 0xad80, 0x0010, 0x20a9, 0x0007,
- 0x1078, 0x2b70, 0xad80, 0x000e, 0x20a9, 0x0001, 0x1078, 0x2b70,
- 0x0078, 0x2b3c, 0xad80, 0x000c, 0x1078, 0x2b7e, 0x0078, 0x2b42,
- 0xad80, 0x000e, 0x1078, 0x2b7e, 0xad80, 0x000c, 0x20a9, 0x0001,
- 0x1078, 0x2b70, 0x0c7e, 0x1078, 0x2cb3, 0x0040, 0x2b65, 0x6837,
- 0x0119, 0x684f, 0x0020, 0x685b, 0x0001, 0x810b, 0x697e, 0x6883,
- 0x0000, 0x6a86, 0x6b8a, 0x6c8e, 0x6d92, 0x6996, 0x689b, 0x0000,
- 0x0c7f, 0x0d7f, 0x6837, 0x0000, 0x1078, 0x6a08, 0x0040, 0x2511,
- 0x7007, 0x0003, 0x701b, 0x2b69, 0x007c, 0x0c7f, 0x0d7f, 0x0078,
- 0x2511, 0x6820, 0xa086, 0x8001, 0x0040, 0x2511, 0x0078, 0x24e7,
- 0x017e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x290a, 0x8108,
- 0x280a, 0x8108, 0x00f0, 0x2b72, 0x017f, 0x007c, 0x017e, 0x0a7e,
- 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c, 0x8000, 0x2054, 0x8000,
- 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108, 0x290a, 0x8108, 0x280a,
- 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x81ff, 0x00c0, 0x2511, 0x7924,
- 0x2140, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048, 0x2515,
- 0xa182, 0x00ff, 0x00c8, 0x2515, 0x7a2c, 0x7b28, 0x6064, 0xa306,
- 0x00c0, 0x2bb5, 0x6068, 0xa246, 0xa8c4, 0xff00, 0x0040, 0x2515,
- 0xa206, 0x00c0, 0x2bb5, 0x0078, 0x2515, 0x0c7e, 0x1078, 0x2c1e,
- 0x2c68, 0x0c7f, 0x0040, 0x2bdc, 0xa0c6, 0x4000, 0x00c0, 0x2bc2,
- 0x0078, 0x2bd9, 0xa0c6, 0x4007, 0x00c0, 0x2bc9, 0x2408, 0x0078,
- 0x2bd9, 0xa0c6, 0x4008, 0x00c0, 0x2bd1, 0x2708, 0x2610, 0x0078,
- 0x2bd9, 0xa0c6, 0x4009, 0x00c0, 0x2bd7, 0x0078, 0x2bd9, 0x2001,
- 0x4006, 0x2020, 0x0078, 0x24e9, 0x017e, 0x0b7e, 0x0c7e, 0x0e7e,
- 0x2c70, 0x1078, 0x5b4e, 0x0040, 0x2c0c, 0x2d00, 0x601a, 0x2e58,
- 0x0e7f, 0x0e7e, 0x0c7e, 0x1078, 0x2cb3, 0x0c7f, 0x2b70, 0x0040,
- 0x2511, 0x6837, 0x0000, 0x2d00, 0x6012, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x127e,
- 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5bdb, 0xa085, 0x0001, 0x0e7f, 0x0c7f, 0x0b7f, 0x017f,
- 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2c17, 0x007c, 0x6830,
- 0xa086, 0x0100, 0x00c0, 0x24e7, 0x0078, 0x2511, 0x0e7e, 0x0d7e,
- 0x2029, 0x0000, 0x2021, 0x0080, 0x20a9, 0x007f, 0x2071, 0x77a0,
- 0x2e04, 0xa005, 0x00c0, 0x2c32, 0x2100, 0xa406, 0x0040, 0x2c6f,
- 0x0078, 0x2c63, 0x2068, 0x6f10, 0x2700, 0xa306, 0x00c0, 0x2c54,
- 0x6e14, 0x2600, 0xa206, 0x00c0, 0x2c54, 0x2400, 0xa106, 0x00c0,
- 0x2c50, 0x2d60, 0xd884, 0x0040, 0x2c75, 0x6004, 0xa084, 0x00ff,
- 0xa086, 0x0006, 0x00c0, 0x2c75, 0x2001, 0x4000, 0x0078, 0x2c76,
- 0x2001, 0x4007, 0x0078, 0x2c76, 0x2400, 0xa106, 0x00c0, 0x2c63,
- 0x6e14, 0x87ff, 0x00c0, 0x2c5f, 0x86ff, 0x0040, 0x2c6f, 0x2001,
- 0x4008, 0x0078, 0x2c76, 0x8420, 0x8e70, 0x00f0, 0x2c28, 0x2001,
- 0x4009, 0x0078, 0x2c76, 0x2001, 0x0001, 0x0078, 0x2c76, 0x1078,
- 0x37a0, 0x00c0, 0x2c6b, 0x6312, 0x6216, 0xa006, 0xa005, 0x0d7f,
- 0x0e7f, 0x007c, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cb3, 0x0040,
- 0x2511, 0x6837, 0x0000, 0x7824, 0xa005, 0x0040, 0x2515, 0xa096,
- 0x00ff, 0x0040, 0x2c8f, 0xa092, 0x0004, 0x00c8, 0x2515, 0x2010,
- 0x2d18, 0x1078, 0x2251, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b,
- 0x2c9a, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511, 0x0078,
- 0x24e7, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa182, 0x0080, 0x0048,
- 0x2515, 0xa182, 0x00ff, 0x00c8, 0x2515, 0x1078, 0x6924, 0x1078,
- 0x37bf, 0x0078, 0x24e7, 0x1078, 0x1314, 0x0040, 0x2cca, 0xa006,
- 0x6802, 0x7010, 0xa005, 0x00c0, 0x2cc2, 0x2d00, 0x7012, 0x7016,
- 0x0078, 0x2cc8, 0x7014, 0x6802, 0x2060, 0x2d00, 0x6006, 0x7016,
- 0xad80, 0x000d, 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078,
- 0x37d7, 0x00c0, 0x2cd9, 0xa6b4, 0x00ff, 0xa682, 0x0010, 0x0048,
- 0x2cda, 0xa066, 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040,
- 0x2ce7, 0x2168, 0x6904, 0x1078, 0x1348, 0x0078, 0x2cde, 0x7112,
- 0x7116, 0x017f, 0x007c, 0x2031, 0x0001, 0x0078, 0x2cf1, 0x2031,
- 0x0000, 0x2061, 0x76bd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a,
- 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007, 0x0002, 0x701b,
- 0x24e7, 0x007c, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000,
- 0x2001, 0x767b, 0x2004, 0xa005, 0x00c0, 0x2d1d, 0x0068, 0x2d1d,
- 0x7818, 0xd084, 0x00c0, 0x2d1d, 0x781b, 0x0001, 0x7a22, 0x7b26,
- 0x7c2a, 0x2091, 0x4080, 0x0078, 0x2d42, 0x017e, 0x0c7e, 0x0e7e,
- 0x2071, 0x766d, 0x7138, 0xa182, 0x0008, 0x0048, 0x2d2b, 0x7030,
- 0x2060, 0x0078, 0x2d3c, 0x7030, 0xa0e0, 0x0008, 0xac82, 0x76bd,
- 0x0048, 0x2d34, 0x2061, 0x767d, 0x2c00, 0x7032, 0x81ff, 0x00c0,
- 0x2d3a, 0x7036, 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, 0x0e7f,
- 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0x766d,
- 0x7038, 0xa005, 0x0040, 0x2d7e, 0x127e, 0x2091, 0x8000, 0x0068,
- 0x2d7d, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x2d7c,
- 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004,
- 0x7826, 0x6008, 0x782a, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a,
- 0xa005, 0x00c0, 0x2d72, 0x7033, 0x767d, 0x7037, 0x767d, 0x0c7f,
- 0x0078, 0x2d7c, 0xac80, 0x0008, 0xa0fa, 0x76bd, 0x0048, 0x2d7a,
- 0x2001, 0x767d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c,
- 0x027e, 0x2001, 0x7652, 0x2004, 0xd0c4, 0x0040, 0x2d8b, 0x2011,
- 0x8014, 0x1078, 0x2d02, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2511,
- 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x3535,
- 0x127f, 0x0078, 0x24e7, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0,
- 0x2da6, 0x61c8, 0xa10d, 0x61ca, 0x0078, 0x24e7, 0x0078, 0x2515,
- 0x81ff, 0x00c0, 0x2511, 0x6000, 0xa086, 0x0003, 0x00c0, 0x2511,
- 0x2001, 0x7652, 0x2004, 0xd0a4, 0x00c0, 0x2511, 0x1078, 0x2ccb,
- 0x0040, 0x2515, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
- 0x2dc5, 0x7828, 0xa005, 0x0040, 0x24e7, 0x0c7e, 0x1078, 0x2cb3,
- 0x0c7f, 0x0040, 0x2511, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
- 0xc0fd, 0x683a, 0x1078, 0x6a91, 0x0040, 0x2511, 0x7007, 0x0003,
- 0x701b, 0x2ddb, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511,
- 0x0078, 0x24e7, 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x2511, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2cb3,
- 0x0040, 0x2511, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000,
- 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x37d7,
- 0x00c0, 0x2e28, 0x6004, 0xa0c6, 0x0707, 0x0040, 0x2e28, 0xa084,
- 0x00ff, 0xa0c6, 0x0006, 0x00c0, 0x2e28, 0x87ff, 0x0040, 0x2e1b,
+ 0x007d, 0x2069, 0x7020, 0x2d04, 0xa075, 0x0040, 0x261f, 0x704c,
+ 0x1078, 0x2629, 0xa210, 0x7080, 0x1078, 0x2629, 0xa318, 0x8d68,
+ 0x00f0, 0x2613, 0x2300, 0xa218, 0x0e7f, 0x0d7f, 0x157f, 0x0078,
+ 0x23a7, 0x0f7e, 0x017e, 0xa07d, 0x0040, 0x2638, 0x2001, 0x0000,
+ 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2638, 0x2178, 0x0078, 0x2630,
+ 0x017f, 0x0f7f, 0x007c, 0x2069, 0x6fff, 0x6910, 0x6294, 0x0078,
+ 0x23a7, 0x81ff, 0x00c0, 0x23d1, 0x614c, 0xa190, 0x21d3, 0x2214,
+ 0xa294, 0x00ff, 0x0078, 0x23a7, 0x613c, 0x6240, 0x0078, 0x23a7,
+ 0x1078, 0x298f, 0x0040, 0x23d5, 0x0078, 0x23a7, 0x1078, 0x298f,
+ 0x0040, 0x23d5, 0x6244, 0x6338, 0x0078, 0x23a7, 0x613c, 0x6240,
+ 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0x6f51, 0x831f, 0xa305,
+ 0x6816, 0x0078, 0x23a7, 0x1078, 0x298f, 0x0040, 0x23d5, 0x0078,
+ 0x23a7, 0x1078, 0x298f, 0x0040, 0x23d5, 0x7828, 0xa00d, 0x0040,
+ 0x23d5, 0x782c, 0xa005, 0x0040, 0x23d5, 0x6244, 0x6146, 0x6338,
+ 0x603a, 0x0078, 0x23a7, 0x7d38, 0x7c3c, 0x0078, 0x2454, 0x7824,
+ 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x23d1, 0x624c, 0xa084,
+ 0xff00, 0x8007, 0xa206, 0x00c0, 0x269f, 0x2001, 0x6f40, 0x2009,
+ 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29b3, 0x81ff,
+ 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x6004, 0xa084,
+ 0x00ff, 0xa086, 0x0006, 0x00c0, 0x23d1, 0x0c7e, 0x1078, 0x2977,
+ 0x0c7f, 0x0040, 0x23d1, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
+ 0x1078, 0x62b9, 0x0040, 0x23d1, 0x7007, 0x0003, 0x701b, 0x26c1,
+ 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x23d1, 0xad80, 0x000e,
+ 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x29b3,
+ 0x1078, 0x2977, 0x0040, 0x23d1, 0x2009, 0x001c, 0x7a2c, 0x7b28,
+ 0x7c3c, 0x7d38, 0x1078, 0x29af, 0x701b, 0x26df, 0x007c, 0xade8,
+ 0x000d, 0x6800, 0xa005, 0x0040, 0x23d5, 0x6804, 0xd0ac, 0x0040,
+ 0x26ec, 0xd0a4, 0x0040, 0x23d5, 0xd094, 0x0040, 0x26f7, 0x0c7e,
+ 0x2061, 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c,
+ 0x0040, 0x2702, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010,
+ 0x6106, 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048,
+ 0x2717, 0xd084, 0x0040, 0x2717, 0x6a28, 0xa28a, 0x007e, 0x00c8,
+ 0x23d5, 0xa288, 0x21d3, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc,
+ 0x0040, 0x2720, 0x6828, 0xa08a, 0x007e, 0x00c8, 0x23d5, 0x604e,
+ 0x6808, 0xa08a, 0x0100, 0x0048, 0x23d5, 0xa08a, 0x0841, 0x00c8,
+ 0x23d5, 0xa084, 0x0007, 0x00c0, 0x23d5, 0x680c, 0xa005, 0x0040,
+ 0x23d5, 0x6810, 0xa005, 0x0040, 0x23d5, 0x6848, 0x6940, 0xa10a,
+ 0x00c8, 0x23d5, 0x8001, 0x0040, 0x23d5, 0x684c, 0x6944, 0xa10a,
+ 0x00c8, 0x23d5, 0x8001, 0x0040, 0x23d5, 0x20a9, 0x001c, 0x2d98,
+ 0x2069, 0x6f51, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e,
+ 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, 0x38e3, 0x1078, 0x36b9,
+ 0x6000, 0xa086, 0x0000, 0x00c0, 0x279b, 0x6808, 0x602a, 0x1078,
+ 0x1d32, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040,
+ 0x277b, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217,
+ 0x831f, 0x0078, 0x277d, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+ 0x6312, 0x1078, 0x41ec, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
+ 0x602f, 0x0000, 0x0c7f, 0x60ac, 0xa005, 0x0040, 0x2797, 0x6003,
+ 0x0001, 0x2091, 0x301d, 0x1078, 0x31f5, 0x0078, 0x279b, 0x6003,
+ 0x0004, 0x2091, 0x301d, 0x0078, 0x23a7, 0x6000, 0xa086, 0x0000,
+ 0x0040, 0x23d1, 0x2069, 0x6f51, 0x7830, 0x6842, 0x7834, 0x6846,
+ 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
+ 0x29b3, 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x31f5, 0x0078, 0x23a7,
+ 0x81ff, 0x00c0, 0x23d1, 0x6174, 0x81ff, 0x0040, 0x27d2, 0x703f,
+ 0x0000, 0x2001, 0x74c0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
+ 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x29b3, 0x701b, 0x23a4,
+ 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x74c0, 0x20a9,
+ 0x0040, 0x20a1, 0x74c0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
+ 0x21d3, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
+ 0x2100, 0xa506, 0x0040, 0x2804, 0x1078, 0x3497, 0x00c0, 0x2804,
+ 0x6014, 0x821c, 0x0048, 0x27fc, 0xa398, 0x74c0, 0xa085, 0xff00,
+ 0x8007, 0x201a, 0x0078, 0x2803, 0xa398, 0x74c0, 0x2324, 0xa4a4,
+ 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x007f, 0x00c8,
+ 0x280b, 0x0078, 0x27e8, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
+ 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x74c0, 0x2099, 0x74c0, 0x1078,
+ 0x323e, 0x0078, 0x27c1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x0c7e,
+ 0x1078, 0x2977, 0x0c7f, 0x0040, 0x23d1, 0x2001, 0x6f52, 0x2004,
+ 0xd0b4, 0x0040, 0x2848, 0x6000, 0xd08c, 0x00c0, 0x2848, 0x6004,
+ 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2848, 0x6837, 0x0000,
+ 0x6838, 0xc0fd, 0x683a, 0x1078, 0x62d5, 0x0040, 0x23d1, 0x7007,
+ 0x0003, 0x701b, 0x2844, 0x007c, 0x1078, 0x298f, 0x0040, 0x23d5,
+ 0x20a9, 0x0029, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
+ 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006, 0x20a0, 0x1078,
+ 0x323e, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098, 0xad80, 0x000a,
+ 0x20a0, 0x1078, 0x323e, 0x2d00, 0x2009, 0x0029, 0x7a2c, 0x7b28,
+ 0x7c3c, 0x7d38, 0x0078, 0x29b3, 0x81ff, 0x00c0, 0x23d1, 0x1078,
+ 0x298f, 0x0040, 0x23d5, 0x1078, 0x35f7, 0x0078, 0x23a7, 0x81ff,
+ 0x00c0, 0x23d1, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x23d5, 0x1078,
+ 0x298f, 0x0040, 0x23d5, 0x2031, 0x000f, 0x1078, 0x3520, 0x8631,
+ 0x00c8, 0x2885, 0x2019, 0x0004, 0x1078, 0x360d, 0x7924, 0x810f,
+ 0x7a28, 0x1078, 0x2895, 0x0078, 0x23a7, 0xa186, 0x00ff, 0x0040,
+ 0x289d, 0x1078, 0x28ad, 0x0078, 0x28ac, 0x2029, 0x007d, 0x2061,
+ 0x6f00, 0x644c, 0x2400, 0xa506, 0x0040, 0x28a9, 0x2508, 0x1078,
+ 0x28ad, 0x8529, 0x00c8, 0x28a2, 0x007c, 0x1078, 0x3497, 0x00c0,
+ 0x28b8, 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4160,
+ 0x007c, 0x81ff, 0x00c0, 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5,
+ 0x1078, 0x3520, 0x1078, 0x3602, 0x0078, 0x23a7, 0x81ff, 0x00c0,
+ 0x23d1, 0x1078, 0x298f, 0x0040, 0x23d5, 0x1078, 0x3520, 0x1078,
+ 0x35ec, 0x0078, 0x23a7, 0x6100, 0x0078, 0x23a7, 0x1078, 0x298f,
+ 0x0040, 0x23d5, 0x6004, 0xa086, 0x0707, 0x0040, 0x23d5, 0x2001,
+ 0x6f00, 0x2004, 0xa086, 0x0003, 0x00c0, 0x23d1, 0x0d7e, 0xace8,
+ 0x000a, 0x7924, 0xd184, 0x0040, 0x28ef, 0xace8, 0x0006, 0x680c,
+ 0x8007, 0x783e, 0x6808, 0x8007, 0x783a, 0x6b04, 0x831f, 0x6a00,
+ 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200, 0x0078, 0x23a7, 0x7824,
+ 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040, 0x2909, 0x81ff, 0x00c0,
+ 0x23d1, 0x7828, 0xa08a, 0x1000, 0x00c8, 0x23d5, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040, 0x291d, 0xa182, 0x007e,
+ 0x00c8, 0x23d5, 0x2100, 0x1078, 0x1fb7, 0x027e, 0x0c7e, 0x127e,
+ 0x2091, 0x8000, 0x2061, 0x70c9, 0x601b, 0x0000, 0x601f, 0x0000,
+ 0x2061, 0x0100, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa105, 0x604a,
+ 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011, 0x321a,
+ 0x1078, 0x41e3, 0x7924, 0xa18c, 0xff00, 0x810f, 0x7a28, 0x1078,
+ 0x2895, 0x127f, 0x0c7f, 0x027f, 0x0078, 0x23a7, 0x7924, 0xa18c,
+ 0xff00, 0x810f, 0x0c7e, 0x1078, 0x3460, 0x2c08, 0x0c7f, 0x00c0,
+ 0x23d5, 0x0078, 0x23a7, 0x017e, 0x2008, 0x2044, 0x8000, 0x204c,
+ 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, 0x00f0, 0x2955, 0x017f,
+ 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000, 0x204c,
+ 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a, 0x8108,
+ 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c, 0x1078,
+ 0x12c5, 0x0040, 0x298e, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
+ 0x2986, 0x2d00, 0x7012, 0x7016, 0x0078, 0x298c, 0x7014, 0x6802,
+ 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7e24,
+ 0x860f, 0xa18c, 0x00ff, 0x1078, 0x3497, 0x00c0, 0x299d, 0xa6b4,
+ 0x00ff, 0xa682, 0x0010, 0x0048, 0x299e, 0xa066, 0x8cff, 0x007c,
+ 0x017e, 0x7110, 0x81ff, 0x0040, 0x29ab, 0x2168, 0x6904, 0x1078,
+ 0x12f9, 0x0078, 0x29a2, 0x7112, 0x7116, 0x017f, 0x007c, 0x2031,
+ 0x0001, 0x0078, 0x29b5, 0x2031, 0x0000, 0x2061, 0x6fbd, 0x6606,
+ 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078,
+ 0x1330, 0x7007, 0x0002, 0x701b, 0x23a7, 0x007c, 0x0f7e, 0x127e,
+ 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x6f7b, 0x2004, 0xa005,
+ 0x00c0, 0x29e0, 0x0068, 0x29e0, 0x7818, 0xd084, 0x00c0, 0x29e0,
+ 0x781b, 0x0001, 0x7a22, 0x7b26, 0x2091, 0x4080, 0x0078, 0x2a04,
+ 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x6f6d, 0x7138, 0xa182, 0x0008,
+ 0x0048, 0x29ee, 0x7030, 0x2060, 0x0078, 0x29ff, 0x7030, 0xa0e0,
+ 0x0008, 0xac82, 0x6fbd, 0x0048, 0x29f7, 0x2061, 0x6f7d, 0x2c00,
+ 0x7032, 0x81ff, 0x00c0, 0x29fd, 0x7036, 0x8108, 0x713a, 0x2262,
+ 0x6306, 0x0e7f, 0x0c7f, 0x017f, 0x127f, 0x0f7f, 0x007c, 0x0e7e,
+ 0x2071, 0x6f6d, 0x7038, 0xa005, 0x0040, 0x2a3e, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x2a3d, 0x0f7e, 0x2079, 0x0000, 0x7818, 0xd084,
+ 0x00c0, 0x2a3c, 0x0c7e, 0x781b, 0x0001, 0x7034, 0x2060, 0x2c04,
+ 0x7822, 0x6004, 0x7826, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a,
+ 0xa005, 0x00c0, 0x2a32, 0x7033, 0x6f7d, 0x7037, 0x6f7d, 0x0c7f,
+ 0x0078, 0x2a3c, 0xac80, 0x0008, 0xa0fa, 0x6fbd, 0x0048, 0x2a3a,
+ 0x2001, 0x6f7d, 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c,
+ 0x027e, 0x2001, 0x6f52, 0x2004, 0xd0c4, 0x0040, 0x2a4b, 0x2011,
+ 0x8014, 0x1078, 0x29c6, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x23d1,
+ 0x127e, 0x2091, 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x31f5,
+ 0x127f, 0x0078, 0x23a7, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0,
+ 0x2a66, 0x61b4, 0xa10d, 0x61b6, 0x0078, 0x23a7, 0x0078, 0x23d5,
+ 0x81ff, 0x00c0, 0x23d1, 0x6000, 0xa086, 0x0003, 0x00c0, 0x23d1,
+ 0x2001, 0x6f52, 0x2004, 0xd0a4, 0x00c0, 0x23d1, 0x1078, 0x298f,
+ 0x0040, 0x23d5, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
+ 0x2a85, 0x7828, 0xa005, 0x0040, 0x23a7, 0x0c7e, 0x1078, 0x2977,
+ 0x0c7f, 0x0040, 0x23d1, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838,
+ 0xc0fd, 0x683a, 0x1078, 0x6342, 0x0040, 0x23d1, 0x7007, 0x0003,
+ 0x701b, 0x2a9b, 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x23d1,
+ 0x0078, 0x23a7, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003, 0x00c0,
+ 0x23d1, 0x7f24, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2977,
+ 0x0040, 0x23d1, 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000,
+ 0x702f, 0x0000, 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x3497,
+ 0x00c0, 0x2ae8, 0x6004, 0xa0c6, 0x0707, 0x0040, 0x2ae8, 0xa084,
+ 0x00ff, 0xa0c6, 0x0006, 0x00c0, 0x2ae8, 0x87ff, 0x0040, 0x2adb,
0xac80, 0x0006, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078,
- 0x2b7e, 0x0078, 0x2e24, 0xac80, 0x000a, 0x2098, 0x3400, 0x20a9,
- 0x0004, 0x53a3, 0x1078, 0x2b7e, 0x21a2, 0x94a0, 0xa6b0, 0x0005,
- 0x8108, 0xa186, 0x007e, 0x0040, 0x2e33, 0xa686, 0x0028, 0x0040,
- 0x2e3c, 0x0078, 0x2dfe, 0x86ff, 0x00c0, 0x2e3a, 0x7120, 0x810b,
- 0x0078, 0x24e7, 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022,
- 0x772a, 0x2061, 0x76bd, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e,
- 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007,
- 0x0002, 0x701b, 0x2e54, 0x007c, 0x702c, 0xa005, 0x00c0, 0x2e66,
- 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x76bd,
- 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x2dfe, 0x7120, 0x810b,
- 0x0078, 0x24e7, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
- 0x7600, 0x6044, 0xd0a4, 0x00c0, 0x2e93, 0xd084, 0x0040, 0x2e7c,
- 0x1078, 0x2fba, 0x0078, 0x2e8f, 0xd08c, 0x0040, 0x2e83, 0x1078,
- 0x2ed1, 0x0078, 0x2e8f, 0xd094, 0x0040, 0x2e8a, 0x1078, 0x2eb4,
- 0x0078, 0x2e8f, 0xd09c, 0x0040, 0x2e8f, 0x1078, 0x2e9d, 0x0e7f,
- 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, 0x2e9a,
- 0xc19d, 0x612a, 0x017f, 0x0078, 0x2e8f, 0x6043, 0x0040, 0x6043,
- 0x0000, 0x706f, 0x0000, 0x7087, 0x0001, 0x70a7, 0x0000, 0x2009,
- 0x7cc0, 0x200b, 0x0000, 0x7073, 0x000f, 0x2009, 0x000f, 0x2011,
- 0x34f5, 0x1078, 0x45b0, 0x007c, 0x7070, 0xa005, 0x00c0, 0x2ed0,
- 0x2011, 0x34f5, 0x1078, 0x4520, 0x6043, 0x0020, 0x6043, 0x0000,
- 0x6044, 0xd08c, 0x00c0, 0x2ecc, 0x7083, 0x0000, 0x6043, 0x0090,
- 0x6043, 0x0010, 0x0078, 0x2ed0, 0x7077, 0x0000, 0x0078, 0x2ed0,
- 0x007c, 0x7074, 0xa08a, 0x0003, 0x00c8, 0x2eda, 0x1079, 0x2edd,
- 0x0078, 0x2edc, 0x1078, 0x12d5, 0x007c, 0x2ee0, 0x2f2f, 0x2fb9,
- 0x0f7e, 0x7077, 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078,
- 0x1dbe, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, 0x7b00, 0x207b,
+ 0x2961, 0x0078, 0x2ae4, 0xac80, 0x000a, 0x2098, 0x3400, 0x20a9,
+ 0x0004, 0x53a3, 0x1078, 0x2961, 0x21a2, 0x94a0, 0xa6b0, 0x0005,
+ 0x8108, 0xa186, 0x007e, 0x0040, 0x2af3, 0xa686, 0x0028, 0x0040,
+ 0x2afc, 0x0078, 0x2abe, 0x86ff, 0x00c0, 0x2afa, 0x7120, 0x810b,
+ 0x0078, 0x23a7, 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022,
+ 0x772a, 0x2061, 0x6fbd, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e,
+ 0x6226, 0x632a, 0x642e, 0x6532, 0x2c10, 0x1078, 0x1330, 0x7007,
+ 0x0002, 0x701b, 0x2b14, 0x007c, 0x702c, 0xa005, 0x00c0, 0x2b26,
+ 0x711c, 0x7024, 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x6fbd,
+ 0x6224, 0x6328, 0x642c, 0x6530, 0x0078, 0x2abe, 0x7120, 0x810b,
+ 0x0078, 0x23a7, 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
+ 0x6f00, 0x6044, 0xd0a4, 0x00c0, 0x2b53, 0xd084, 0x0040, 0x2b3c,
+ 0x1078, 0x2c7a, 0x0078, 0x2b4f, 0xd08c, 0x0040, 0x2b43, 0x1078,
+ 0x2b91, 0x0078, 0x2b4f, 0xd094, 0x0040, 0x2b4a, 0x1078, 0x2b74,
+ 0x0078, 0x2b4f, 0xd09c, 0x0040, 0x2b4f, 0x1078, 0x2b5d, 0x0e7f,
+ 0x0c7f, 0x127f, 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, 0x2b5a,
+ 0xc19d, 0x612a, 0x017f, 0x0078, 0x2b4f, 0x6043, 0x0040, 0x6043,
+ 0x0000, 0x7067, 0x0000, 0x707f, 0x0001, 0x709f, 0x0000, 0x2009,
+ 0x74c0, 0x200b, 0x0000, 0x706b, 0x000f, 0x2009, 0x000f, 0x2011,
+ 0x31b5, 0x1078, 0x41e3, 0x007c, 0x7068, 0xa005, 0x00c0, 0x2b90,
+ 0x2011, 0x31b5, 0x1078, 0x4153, 0x6043, 0x0020, 0x6043, 0x0000,
+ 0x6044, 0xd08c, 0x00c0, 0x2b8c, 0x707b, 0x0000, 0x6043, 0x0090,
+ 0x6043, 0x0010, 0x0078, 0x2b90, 0x706f, 0x0000, 0x0078, 0x2b90,
+ 0x007c, 0x706c, 0xa08a, 0x0003, 0x00c8, 0x2b9a, 0x1079, 0x2b9d,
+ 0x0078, 0x2b9c, 0x1078, 0x1286, 0x007c, 0x2ba0, 0x2bef, 0x2c79,
+ 0x0f7e, 0x706f, 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078,
+ 0x1d32, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2079, 0x7300, 0x207b,
0x2200, 0x7807, 0x00ef, 0x780b, 0x0000, 0x780f, 0x00ef, 0x7813,
0x0138, 0x7817, 0x0000, 0x781b, 0x0000, 0x781f, 0x0000, 0x7823,
0xffff, 0x7827, 0xffff, 0x782b, 0x0000, 0x782f, 0x0000, 0x2079,
- 0x7b0c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, 0x7605, 0x20a1,
- 0x7b0e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7b12, 0x207b, 0x0000,
- 0x7807, 0x0000, 0x2099, 0x7b00, 0x20a1, 0x020b, 0x20a9, 0x0014,
- 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, 0x351c, 0x0f7f,
- 0x707b, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e,
- 0x7078, 0x707b, 0x0000, 0xa025, 0x0040, 0x2fa3, 0x6020, 0xd0b4,
- 0x00c0, 0x2fa1, 0x7184, 0x81ff, 0x0040, 0x2f8a, 0xa486, 0x000c,
- 0x00c0, 0x2f95, 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7b80,
- 0x2019, 0x7b00, 0x220c, 0x2304, 0xa106, 0x00c0, 0x2f61, 0x8210,
- 0x8318, 0x00f0, 0x2f4a, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f,
- 0xf0f0, 0x6043, 0x0006, 0x7077, 0x0002, 0x7083, 0x0002, 0x0078,
- 0x2fa1, 0x2069, 0x7b80, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2f95,
- 0x6834, 0xa005, 0x00c0, 0x2f95, 0x6900, 0xa18c, 0x00ff, 0x00c0,
- 0x2f75, 0x6804, 0xa005, 0x0040, 0x2f8a, 0x2011, 0x7b8e, 0x2019,
- 0x7605, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2f88,
- 0x00c0, 0x2f95, 0x8210, 0x8318, 0x00f0, 0x2f7b, 0x0078, 0x2f95,
- 0x7087, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80,
+ 0x730c, 0x207b, 0x1101, 0x7807, 0x0000, 0x2099, 0x6f05, 0x20a1,
+ 0x730e, 0x20a9, 0x0004, 0x53a3, 0x2079, 0x7312, 0x207b, 0x0000,
+ 0x7807, 0x0000, 0x2099, 0x7300, 0x20a1, 0x020b, 0x20a9, 0x0014,
+ 0x53a6, 0x60c3, 0x000c, 0x600f, 0x0000, 0x1078, 0x31dc, 0x0f7f,
+ 0x7073, 0x0000, 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e,
+ 0x7070, 0x7073, 0x0000, 0xa025, 0x0040, 0x2c63, 0x6020, 0xd0b4,
+ 0x00c0, 0x2c61, 0x717c, 0x81ff, 0x0040, 0x2c4a, 0xa486, 0x000c,
+ 0x00c0, 0x2c55, 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7380,
+ 0x2019, 0x7300, 0x220c, 0x2304, 0xa106, 0x00c0, 0x2c21, 0x8210,
+ 0x8318, 0x00f0, 0x2c0a, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f,
+ 0xf0f0, 0x6043, 0x0006, 0x706f, 0x0002, 0x707b, 0x0002, 0x0078,
+ 0x2c61, 0x2069, 0x7380, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2c55,
+ 0x6834, 0xa005, 0x00c0, 0x2c55, 0x6900, 0xa18c, 0x00ff, 0x00c0,
+ 0x2c35, 0x6804, 0xa005, 0x0040, 0x2c4a, 0x2011, 0x738e, 0x2019,
+ 0x6f05, 0x20a9, 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2c48,
+ 0x00c0, 0x2c55, 0x8210, 0x8318, 0x00f0, 0x2c3b, 0x0078, 0x2c55,
+ 0x707f, 0x0000, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380,
0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043,
- 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2fa1, 0x60c3, 0x000c, 0x1078,
- 0x351c, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2fa1, 0x60c3,
- 0x000c, 0x2011, 0x7840, 0x2013, 0x0000, 0x707b, 0x0000, 0x20e1,
- 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x552b, 0x0078,
- 0x2fa1, 0x007c, 0x7080, 0xa08a, 0x001d, 0x00c8, 0x2fc3, 0x1079,
- 0x2fc6, 0x0078, 0x2fc5, 0x1078, 0x12d5, 0x007c, 0x2fea, 0x2ff9,
- 0x302a, 0x303f, 0x306f, 0x3097, 0x30c7, 0x30f1, 0x3121, 0x3147,
- 0x3192, 0x31b4, 0x31d8, 0x31ee, 0x3214, 0x3227, 0x3230, 0x3249,
- 0x3277, 0x329f, 0x32cd, 0x32f7, 0x333c, 0x3371, 0x3393, 0x33d1,
- 0x33f5, 0x340e, 0x341b, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2c61, 0x60c3, 0x000c, 0x1078,
+ 0x31dc, 0x0d7f, 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2c61, 0x60c3,
+ 0x000c, 0x2011, 0x70c0, 0x2013, 0x0000, 0x7073, 0x0000, 0x20e1,
+ 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x4f3c, 0x0078,
+ 0x2c61, 0x007c, 0x7078, 0xa08a, 0x001d, 0x00c8, 0x2c83, 0x1079,
+ 0x2c86, 0x0078, 0x2c85, 0x1078, 0x1286, 0x007c, 0x2caa, 0x2cb9,
+ 0x2cea, 0x2cff, 0x2d2f, 0x2d57, 0x2d87, 0x2db1, 0x2de1, 0x2e07,
+ 0x2e52, 0x2e74, 0x2e98, 0x2eae, 0x2ed4, 0x2ee7, 0x2ef0, 0x2f09,
+ 0x2f37, 0x2f5f, 0x2f8d, 0x2fb7, 0x2ffc, 0x3031, 0x3053, 0x3091,
+ 0x30b5, 0x30ce, 0x30db, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9,
0x6006, 0x007c, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002,
- 0x7083, 0x0001, 0x2009, 0x07d0, 0x2011, 0x34fc, 0x1078, 0x4513,
- 0x007c, 0x0f7e, 0x7078, 0xa086, 0x0014, 0x00c0, 0x3028, 0x6043,
- 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x3028, 0x2079, 0x7b80, 0x7a30,
- 0xa296, 0x1102, 0x00c0, 0x3026, 0x7834, 0xa005, 0x00c0, 0x3026,
- 0x7a38, 0xd2fc, 0x0040, 0x301c, 0x70a4, 0xa005, 0x00c0, 0x301c,
- 0x1078, 0x35b5, 0x70a7, 0x0001, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0x7083, 0x0010, 0x1078, 0x3230, 0x0078, 0x3028, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x7083, 0x0003, 0x6043, 0x0004, 0x1078, 0x3586,
+ 0x707b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x31bc, 0x1078, 0x4146,
+ 0x007c, 0x0f7e, 0x7070, 0xa086, 0x0014, 0x00c0, 0x2ce8, 0x6043,
+ 0x0000, 0x6020, 0xd0b4, 0x00c0, 0x2ce8, 0x2079, 0x7380, 0x7a30,
+ 0xa296, 0x1102, 0x00c0, 0x2ce6, 0x7834, 0xa005, 0x00c0, 0x2ce6,
+ 0x7a38, 0xd2fc, 0x0040, 0x2cdc, 0x709c, 0xa005, 0x00c0, 0x2cdc,
+ 0x1078, 0x3275, 0x709f, 0x0001, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0x707b, 0x0010, 0x1078, 0x2ef0, 0x0078, 0x2ce8, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x0003, 0x6043, 0x0004, 0x1078, 0x3246,
0x20a3, 0x1102, 0x20a3, 0x0000, 0x20a9, 0x000a, 0x20a3, 0x0000,
- 0x00f0, 0x3036, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x306d, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x3069, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1102, 0x00c0, 0x3069, 0x7834, 0xa005, 0x00c0, 0x3069, 0x7a38,
- 0xd2fc, 0x0040, 0x3063, 0x70a4, 0xa005, 0x00c0, 0x3063, 0x1078,
- 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0004, 0x1078, 0x306f, 0x0078,
- 0x306d, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0005, 0x1078, 0x3586, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x3089, 0x714c, 0xa186,
- 0xffff, 0x0040, 0x3089, 0x1078, 0x34c0, 0x0040, 0x3089, 0x1078,
- 0x35b5, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x30c5, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x30c1, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1103, 0x00c0, 0x30c1, 0x7834, 0xa005, 0x00c0, 0x30c1, 0x7a38,
- 0xd2fc, 0x0040, 0x30bb, 0x70a4, 0xa005, 0x00c0, 0x30bb, 0x1078,
- 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0006, 0x1078, 0x30c7, 0x0078,
- 0x30c5, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0007, 0x1078, 0x3586, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x30e3, 0x7150, 0xa186,
- 0xffff, 0x0040, 0x30e3, 0xa180, 0x2303, 0x200c, 0xa18c, 0xff00,
- 0x810f, 0x1078, 0x34c0, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x311f, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0014, 0x00c0, 0x311b, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1104, 0x00c0, 0x311b, 0x7834, 0xa005, 0x00c0,
- 0x311b, 0x7a38, 0xd2fc, 0x0040, 0x3115, 0x70a4, 0xa005, 0x00c0,
- 0x3115, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0008, 0x1078,
- 0x3121, 0x0078, 0x311f, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f,
- 0x007c, 0x7083, 0x0009, 0x1078, 0x3586, 0x20a3, 0x1105, 0x20a3,
- 0x0100, 0x3430, 0x706c, 0xa005, 0x00c0, 0x3134, 0x1078, 0x342a,
- 0x0040, 0x3144, 0x0078, 0x313e, 0x20a9, 0x0008, 0x2099, 0x7b8e,
+ 0x00f0, 0x2cf6, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2d2d, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2d29, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1102, 0x00c0, 0x2d29, 0x7834, 0xa005, 0x00c0, 0x2d29, 0x7a38,
+ 0xd2fc, 0x0040, 0x2d23, 0x709c, 0xa005, 0x00c0, 0x2d23, 0x1078,
+ 0x3275, 0x709f, 0x0001, 0x707b, 0x0004, 0x1078, 0x2d2f, 0x0078,
+ 0x2d2d, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0005, 0x1078, 0x3246, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x738e, 0x7064, 0xa005, 0x00c0, 0x2d49, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2d49, 0x1078, 0x3180, 0x0040, 0x2d49, 0x1078,
+ 0x3275, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2d85, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2d81, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1103, 0x00c0, 0x2d81, 0x7834, 0xa005, 0x00c0, 0x2d81, 0x7a38,
+ 0xd2fc, 0x0040, 0x2d7b, 0x709c, 0xa005, 0x00c0, 0x2d7b, 0x1078,
+ 0x3275, 0x709f, 0x0001, 0x707b, 0x0006, 0x1078, 0x2d87, 0x0078,
+ 0x2d85, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0007, 0x1078, 0x3246, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x738e, 0x7064, 0xa005, 0x00c0, 0x2da3, 0x7150, 0xa186,
+ 0xffff, 0x0040, 0x2da3, 0xa180, 0x21d3, 0x200c, 0xa18c, 0xff00,
+ 0x810f, 0x1078, 0x3180, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2ddf, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0014, 0x00c0, 0x2ddb, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1104, 0x00c0, 0x2ddb, 0x7834, 0xa005, 0x00c0,
+ 0x2ddb, 0x7a38, 0xd2fc, 0x0040, 0x2dd5, 0x709c, 0xa005, 0x00c0,
+ 0x2dd5, 0x1078, 0x3275, 0x709f, 0x0001, 0x707b, 0x0008, 0x1078,
+ 0x2de1, 0x0078, 0x2ddf, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f,
+ 0x007c, 0x707b, 0x0009, 0x1078, 0x3246, 0x20a3, 0x1105, 0x20a3,
+ 0x0100, 0x3430, 0x7064, 0xa005, 0x00c0, 0x2df4, 0x1078, 0x30ea,
+ 0x0040, 0x2e04, 0x0078, 0x2dfe, 0x20a9, 0x0008, 0x2099, 0x738e,
0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x351c, 0x0078, 0x3146, 0x1078, 0x2fe3, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x3190, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x318c, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1105, 0x00c0, 0x318c, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
- 0x3175, 0x7a38, 0xd2fc, 0x0040, 0x316d, 0x70a4, 0xa005, 0x00c0,
- 0x316d, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x707f, 0x0001, 0x7083,
- 0x000a, 0x1078, 0x3192, 0x0078, 0x3190, 0xa005, 0x00c0, 0x318c,
- 0x7a38, 0xd2fc, 0x0040, 0x3184, 0x70a4, 0xa005, 0x00c0, 0x3184,
- 0x1078, 0x35b5, 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e,
- 0x1078, 0x3214, 0x0078, 0x3190, 0x7083, 0x0002, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x7083, 0x000b, 0x2011, 0x7b0e, 0x22a0, 0x20a9,
+ 0x1078, 0x31dc, 0x0078, 0x2e06, 0x1078, 0x2ca3, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2e50, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2e4c, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2e4c, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2e35, 0x7a38, 0xd2fc, 0x0040, 0x2e2d, 0x709c, 0xa005, 0x00c0,
+ 0x2e2d, 0x1078, 0x3275, 0x709f, 0x0001, 0x7077, 0x0001, 0x707b,
+ 0x000a, 0x1078, 0x2e52, 0x0078, 0x2e50, 0xa005, 0x00c0, 0x2e4c,
+ 0x7a38, 0xd2fc, 0x0040, 0x2e44, 0x709c, 0xa005, 0x00c0, 0x2e44,
+ 0x1078, 0x3275, 0x709f, 0x0001, 0x7077, 0x0000, 0x707b, 0x000e,
+ 0x1078, 0x2ed4, 0x0078, 0x2e50, 0x707b, 0x0002, 0x7073, 0x0000,
+ 0x0f7f, 0x007c, 0x707b, 0x000b, 0x2011, 0x730e, 0x22a0, 0x20a9,
0x0040, 0x2019, 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000,
- 0x41a4, 0x1078, 0x3586, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
+ 0x41a4, 0x1078, 0x3246, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030,
0xa085, 0x0100, 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3,
- 0x0084, 0x1078, 0x351c, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040,
- 0x31d6, 0x2011, 0x34fc, 0x1078, 0x4520, 0xa086, 0x0084, 0x00c0,
- 0x31d2, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x31d2,
- 0x7834, 0xa005, 0x00c0, 0x31d2, 0x7083, 0x000c, 0x1078, 0x31d8,
- 0x0078, 0x31d6, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c,
- 0x7083, 0x000d, 0x1078, 0x3586, 0x20a3, 0x1107, 0x20a3, 0x0000,
- 0x2099, 0x7b8e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0084, 0x1078, 0x351c, 0x007c, 0x0f7e, 0x7078,
- 0xa005, 0x0040, 0x3212, 0x2011, 0x34fc, 0x1078, 0x4520, 0xa086,
- 0x0084, 0x00c0, 0x320e, 0x2079, 0x7b80, 0x7a30, 0xa296, 0x1107,
- 0x00c0, 0x320e, 0x7834, 0xa005, 0x00c0, 0x320e, 0x1078, 0x3578,
- 0x7083, 0x000e, 0x1078, 0x3214, 0x0078, 0x3212, 0x7083, 0x0002,
- 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000f, 0x707b, 0x0000,
+ 0x0084, 0x1078, 0x31dc, 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040,
+ 0x2e96, 0x2011, 0x31bc, 0x1078, 0x4153, 0xa086, 0x0084, 0x00c0,
+ 0x2e92, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x2e92,
+ 0x7834, 0xa005, 0x00c0, 0x2e92, 0x707b, 0x000c, 0x1078, 0x2e98,
+ 0x0078, 0x2e96, 0x707b, 0x0002, 0x7073, 0x0000, 0x0f7f, 0x007c,
+ 0x707b, 0x000d, 0x1078, 0x3246, 0x20a3, 0x1107, 0x20a3, 0x0000,
+ 0x2099, 0x738e, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x0084, 0x1078, 0x31dc, 0x007c, 0x0f7e, 0x7070,
+ 0xa005, 0x0040, 0x2ed2, 0x2011, 0x31bc, 0x1078, 0x4153, 0xa086,
+ 0x0084, 0x00c0, 0x2ece, 0x2079, 0x7380, 0x7a30, 0xa296, 0x1107,
+ 0x00c0, 0x2ece, 0x7834, 0xa005, 0x00c0, 0x2ece, 0x1078, 0x3238,
+ 0x707b, 0x000e, 0x1078, 0x2ed4, 0x0078, 0x2ed2, 0x707b, 0x0002,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x000f, 0x7073, 0x0000,
0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004,
- 0x2009, 0x07d0, 0x2011, 0x34fc, 0x1078, 0x4513, 0x007c, 0x7078,
- 0xa005, 0x0040, 0x322f, 0x2011, 0x34fc, 0x1078, 0x4520, 0x007c,
- 0x7083, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80,
- 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
- 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x351c,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3275, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0014, 0x00c0, 0x3273, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1103, 0x00c0, 0x3273, 0x7834, 0xa005, 0x00c0,
- 0x3273, 0x7a38, 0xd2fc, 0x0040, 0x326d, 0x70a4, 0xa005, 0x00c0,
- 0x326d, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0012, 0x1078,
- 0x3277, 0x0078, 0x3275, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0013, 0x1078, 0x3592, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
- 0x2011, 0x7b8e, 0x706c, 0xa005, 0x00c0, 0x3291, 0x714c, 0xa186,
- 0xffff, 0x0040, 0x3291, 0x1078, 0x34c0, 0x0040, 0x3291, 0x1078,
- 0x35b5, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x32cb, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x32c9, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1104, 0x00c0, 0x32c9, 0x7834, 0xa005, 0x00c0, 0x32c9, 0x7a38,
- 0xd2fc, 0x0040, 0x32c3, 0x70a4, 0xa005, 0x00c0, 0x32c3, 0x1078,
- 0x35b5, 0x70a7, 0x0001, 0x7083, 0x0014, 0x1078, 0x32cd, 0x0078,
- 0x32cb, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0015, 0x1078,
- 0x3592, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7b8e,
- 0x706c, 0xa006, 0x00c0, 0x32e9, 0x7150, 0xa186, 0xffff, 0x0040,
- 0x32e9, 0xa180, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34c0, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x351c, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x333a, 0x2011, 0x34fc, 0x1078, 0x4520,
- 0xa086, 0x0014, 0x00c0, 0x3338, 0x2079, 0x7b80, 0x7a30, 0xa296,
- 0x1105, 0x00c0, 0x3338, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
- 0x3321, 0x7a38, 0xd2fc, 0x0040, 0x331d, 0x70a4, 0xa005, 0x00c0,
- 0x331d, 0x1078, 0x35b5, 0x70a7, 0x0001, 0x707f, 0x0001, 0x0078,
- 0x3332, 0xa005, 0x00c0, 0x3338, 0x7a38, 0xd2fc, 0x0040, 0x3330,
- 0x70a4, 0xa005, 0x00c0, 0x3330, 0x1078, 0x35b5, 0x70a7, 0x0001,
- 0x707f, 0x0000, 0x7083, 0x0016, 0x1078, 0x333c, 0x0078, 0x333a,
- 0x707b, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7b80, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430,
- 0x2011, 0x7b8e, 0x707c, 0xa005, 0x0040, 0x3352, 0x7083, 0x0017,
- 0x0078, 0x3354, 0x7083, 0x001b, 0x706c, 0xa005, 0x00c0, 0x335e,
- 0x1078, 0x342a, 0x0040, 0x336e, 0x0078, 0x3368, 0x20a9, 0x0008,
- 0x2099, 0x7b8e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x351c, 0x0078, 0x3370, 0x1078, 0x2fe3,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x3391, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0084, 0x00c0, 0x338f, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1106, 0x00c0, 0x338f, 0x7834, 0xa005, 0x00c0,
- 0x338f, 0x7083, 0x0018, 0x1078, 0x3393, 0x0078, 0x3391, 0x707b,
- 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0019, 0x1078, 0x3592, 0x20a3,
- 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x7b8e, 0x2039, 0x7b0e,
+ 0x2009, 0x07d0, 0x2011, 0x31bc, 0x1078, 0x4146, 0x007c, 0x7070,
+ 0xa005, 0x0040, 0x2eef, 0x2011, 0x31bc, 0x1078, 0x4153, 0x007c,
+ 0x707b, 0x0011, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380,
+ 0x20a1, 0x020b, 0x7470, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084,
+ 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x31dc,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x2f35, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0014, 0x00c0, 0x2f33, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1103, 0x00c0, 0x2f33, 0x7834, 0xa005, 0x00c0,
+ 0x2f33, 0x7a38, 0xd2fc, 0x0040, 0x2f2d, 0x709c, 0xa005, 0x00c0,
+ 0x2f2d, 0x1078, 0x3275, 0x709f, 0x0001, 0x707b, 0x0012, 0x1078,
+ 0x2f37, 0x0078, 0x2f35, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b,
+ 0x0013, 0x1078, 0x3252, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430,
+ 0x2011, 0x738e, 0x7064, 0xa005, 0x00c0, 0x2f51, 0x714c, 0xa186,
+ 0xffff, 0x0040, 0x2f51, 0x1078, 0x3180, 0x0040, 0x2f51, 0x1078,
+ 0x3275, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2f8b, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2f89, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1104, 0x00c0, 0x2f89, 0x7834, 0xa005, 0x00c0, 0x2f89, 0x7a38,
+ 0xd2fc, 0x0040, 0x2f83, 0x709c, 0xa005, 0x00c0, 0x2f83, 0x1078,
+ 0x3275, 0x709f, 0x0001, 0x707b, 0x0014, 0x1078, 0x2f8d, 0x0078,
+ 0x2f8b, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0015, 0x1078,
+ 0x3252, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x738e,
+ 0x7064, 0xa006, 0x00c0, 0x2fa9, 0x7150, 0xa186, 0xffff, 0x0040,
+ 0x2fa9, 0xa180, 0x21d3, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
+ 0x3180, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x31dc, 0x007c, 0x0f7e,
+ 0x7070, 0xa005, 0x0040, 0x2ffa, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0xa086, 0x0014, 0x00c0, 0x2ff8, 0x2079, 0x7380, 0x7a30, 0xa296,
+ 0x1105, 0x00c0, 0x2ff8, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0,
+ 0x2fe1, 0x7a38, 0xd2fc, 0x0040, 0x2fdd, 0x709c, 0xa005, 0x00c0,
+ 0x2fdd, 0x1078, 0x3275, 0x709f, 0x0001, 0x7077, 0x0001, 0x0078,
+ 0x2ff2, 0xa005, 0x00c0, 0x2ff8, 0x7a38, 0xd2fc, 0x0040, 0x2ff0,
+ 0x709c, 0xa005, 0x00c0, 0x2ff0, 0x1078, 0x3275, 0x709f, 0x0001,
+ 0x7077, 0x0000, 0x707b, 0x0016, 0x1078, 0x2ffc, 0x0078, 0x2ffa,
+ 0x7073, 0x0000, 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x2099, 0x7380, 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430,
+ 0x2011, 0x738e, 0x7074, 0xa005, 0x0040, 0x3012, 0x707b, 0x0017,
+ 0x0078, 0x3014, 0x707b, 0x001b, 0x7064, 0xa005, 0x00c0, 0x301e,
+ 0x1078, 0x30ea, 0x0040, 0x302e, 0x0078, 0x3028, 0x20a9, 0x0008,
+ 0x2099, 0x738e, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x60c3, 0x0014, 0x1078, 0x31dc, 0x0078, 0x3030, 0x1078, 0x2ca3,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x3051, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0084, 0x00c0, 0x304f, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1106, 0x00c0, 0x304f, 0x7834, 0xa005, 0x00c0,
+ 0x304f, 0x707b, 0x0018, 0x1078, 0x3053, 0x0078, 0x3051, 0x7073,
+ 0x0000, 0x0f7f, 0x007c, 0x707b, 0x0019, 0x1078, 0x3252, 0x20a3,
+ 0x1106, 0x20a3, 0x0000, 0x3430, 0x2099, 0x738e, 0x2039, 0x730e,
0x27a0, 0x20a9, 0x0040, 0x53a3, 0x2728, 0x2514, 0x8207, 0xa084,
0x00ff, 0x8000, 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a,
- 0x6030, 0x2310, 0x8214, 0xa2a0, 0x7b0e, 0x2414, 0xa38c, 0x0001,
- 0x0040, 0x33be, 0xa294, 0xff00, 0x0078, 0x33c1, 0xa294, 0x00ff,
+ 0x6030, 0x2310, 0x8214, 0xa2a0, 0x730e, 0x2414, 0xa38c, 0x0001,
+ 0x0040, 0x307e, 0xa294, 0xff00, 0x0078, 0x3081, 0xa294, 0x00ff,
0x8007, 0xa215, 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x351c,
- 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x33f3, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0xa086, 0x0084, 0x00c0, 0x33f1, 0x2079, 0x7b80,
- 0x7a30, 0xa296, 0x1107, 0x00c0, 0x33f1, 0x7834, 0xa005, 0x00c0,
- 0x33f1, 0x1078, 0x3578, 0x7083, 0x001a, 0x1078, 0x33f5, 0x0078,
- 0x33f3, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x001b, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80, 0x20a1, 0x020b, 0x7478,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x31dc,
+ 0x007c, 0x0f7e, 0x7070, 0xa005, 0x0040, 0x30b3, 0x2011, 0x31bc,
+ 0x1078, 0x4153, 0xa086, 0x0084, 0x00c0, 0x30b1, 0x2079, 0x7380,
+ 0x7a30, 0xa296, 0x1107, 0x00c0, 0x30b1, 0x7834, 0xa005, 0x00c0,
+ 0x30b1, 0x1078, 0x3238, 0x707b, 0x001a, 0x1078, 0x30b5, 0x0078,
+ 0x30b3, 0x7073, 0x0000, 0x0f7f, 0x007c, 0x707b, 0x001b, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380, 0x20a1, 0x020b, 0x7470,
0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8,
- 0x53a6, 0x60c3, 0x0084, 0x1078, 0x351c, 0x007c, 0x7078, 0xa005,
- 0x0040, 0x341a, 0x2011, 0x34fc, 0x1078, 0x4520, 0x7083, 0x001c,
- 0x1078, 0x341b, 0x007c, 0x707b, 0x0000, 0x608b, 0xbc85, 0x608f,
- 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011, 0x34fc, 0x1078,
- 0x4513, 0x007c, 0x087e, 0x097e, 0x2029, 0x7652, 0x252c, 0x20a9,
- 0x0008, 0x2041, 0x7b0e, 0x28a0, 0x2099, 0x7b8e, 0x53a3, 0x20a9,
- 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x3440, 0x2011, 0x0000,
- 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x3452, 0xd5d4,
- 0x0040, 0x344d, 0x8210, 0x0078, 0x344e, 0x8211, 0x00f0, 0x3440,
- 0x0078, 0x34b7, 0x82ff, 0x00c0, 0x3464, 0xd5d4, 0x0040, 0x345e,
- 0xa1a6, 0x3fff, 0x0040, 0x344a, 0x0078, 0x3462, 0xa1a6, 0x3fff,
- 0x0040, 0x34b7, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001,
- 0xd5d4, 0x0040, 0x346d, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040,
- 0x3474, 0x8423, 0x0078, 0x3475, 0x8424, 0x00c8, 0x3482, 0xd5d4,
- 0x0040, 0x347d, 0x8319, 0x0078, 0x347e, 0x8318, 0x00f0, 0x346e,
- 0x0078, 0x34b7, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0,
- 0x3486, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x349a, 0x007e,
+ 0x53a6, 0x60c3, 0x0084, 0x1078, 0x31dc, 0x007c, 0x7070, 0xa005,
+ 0x0040, 0x30da, 0x2011, 0x31bc, 0x1078, 0x4153, 0x707b, 0x001c,
+ 0x1078, 0x30db, 0x007c, 0x7073, 0x0000, 0x608b, 0xbc85, 0x608f,
+ 0xb5b5, 0x6043, 0x0001, 0x2009, 0x07d0, 0x2011, 0x31bc, 0x1078,
+ 0x4146, 0x007c, 0x087e, 0x097e, 0x2029, 0x6f52, 0x252c, 0x20a9,
+ 0x0008, 0x2041, 0x730e, 0x28a0, 0x2099, 0x738e, 0x53a3, 0x20a9,
+ 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0040, 0x3100, 0x2011, 0x0000,
+ 0x2800, 0xa200, 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x3112, 0xd5d4,
+ 0x0040, 0x310d, 0x8210, 0x0078, 0x310e, 0x8211, 0x00f0, 0x3100,
+ 0x0078, 0x3177, 0x82ff, 0x00c0, 0x3124, 0xd5d4, 0x0040, 0x311e,
+ 0xa1a6, 0x3fff, 0x0040, 0x310a, 0x0078, 0x3122, 0xa1a6, 0x3fff,
+ 0x0040, 0x3177, 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001,
+ 0xd5d4, 0x0040, 0x312d, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040,
+ 0x3134, 0x8423, 0x0078, 0x3135, 0x8424, 0x00c8, 0x3142, 0xd5d4,
+ 0x0040, 0x313d, 0x8319, 0x0078, 0x313e, 0x8318, 0x00f0, 0x312e,
+ 0x0078, 0x3177, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0,
+ 0x3146, 0x2328, 0x8529, 0xa2be, 0x0007, 0x0040, 0x315a, 0x007e,
0x2039, 0x0007, 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010,
- 0x00f0, 0x3496, 0x754e, 0xa5c8, 0x2303, 0x292c, 0xa5ac, 0x00ff,
+ 0x00f0, 0x3156, 0x754e, 0xa5c8, 0x21d3, 0x292c, 0xa5ac, 0x00ff,
0x6532, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a,
- 0x706f, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, 0x34bd, 0xa006,
- 0x0078, 0x34bd, 0xa006, 0x1078, 0x12d5, 0x097f, 0x087f, 0x007c,
+ 0x7067, 0x0001, 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0xa085, 0x0001, 0x0078, 0x317d, 0xa006,
+ 0x0078, 0x317d, 0xa006, 0x1078, 0x1286, 0x097f, 0x087f, 0x007c,
0x2118, 0x2021, 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0048,
- 0x34cd, 0x8420, 0x8001, 0x0078, 0x34c5, 0x2118, 0x84ff, 0x0040,
- 0x34d6, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x34d1, 0x2021, 0x0001,
- 0x83ff, 0x0040, 0x34df, 0x8423, 0x8319, 0x00c0, 0x34db, 0xa238,
- 0x2704, 0xa42c, 0x00c0, 0x34f4, 0xa405, 0x203a, 0x714e, 0xa1a0,
- 0x2303, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
- 0x706f, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7600,
- 0x7073, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100,
- 0x2071, 0x0140, 0x1078, 0x5534, 0x7004, 0xa084, 0x4000, 0x0040,
- 0x350d, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x7620, 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010,
+ 0x318d, 0x8420, 0x8001, 0x0078, 0x3185, 0x2118, 0x84ff, 0x0040,
+ 0x3196, 0xa39a, 0x0010, 0x8421, 0x00c0, 0x3191, 0x2021, 0x0001,
+ 0x83ff, 0x0040, 0x319f, 0x8423, 0x8319, 0x00c0, 0x319b, 0xa238,
+ 0x2704, 0xa42c, 0x00c0, 0x31b4, 0xa405, 0x203a, 0x714e, 0xa1a0,
+ 0x21d3, 0x242c, 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea,
+ 0x7067, 0x0001, 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6f00,
+ 0x706b, 0x0000, 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100,
+ 0x2071, 0x0140, 0x1078, 0x4f45, 0x7004, 0xa084, 0x4000, 0x0040,
+ 0x31cd, 0x7003, 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000,
+ 0x2071, 0x6f1e, 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010,
0x127f, 0x0f7f, 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011,
- 0x7840, 0x2013, 0x0000, 0x707b, 0x0000, 0x127f, 0x20e1, 0x9080,
- 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x552b, 0x2009, 0x07d0,
- 0x2011, 0x34fc, 0x1078, 0x45b0, 0x007c, 0x017e, 0x027e, 0x0c7e,
- 0x127e, 0x2091, 0x8000, 0x2009, 0x00f7, 0x1078, 0x359e, 0x2061,
- 0x7849, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x7600, 0x6003,
+ 0x70c0, 0x2013, 0x0000, 0x7073, 0x0000, 0x127f, 0x20e1, 0x9080,
+ 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x4f3c, 0x2009, 0x07d0,
+ 0x2011, 0x31bc, 0x1078, 0x41e3, 0x007c, 0x017e, 0x027e, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x2009, 0x00f7, 0x1078, 0x325e, 0x2061,
+ 0x70c9, 0x601b, 0x0000, 0x601f, 0x0000, 0x2061, 0x6f00, 0x6003,
0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
- 0x001e, 0x2011, 0x355a, 0x1078, 0x4513, 0x127f, 0x0c7f, 0x027f,
+ 0x001e, 0x2011, 0x321a, 0x1078, 0x4146, 0x127f, 0x0c7f, 0x027f,
0x017f, 0x007c, 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x0100, 0x1078, 0x5534, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000,
- 0x0040, 0x356e, 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001,
- 0x1078, 0x1fff, 0x1078, 0x3535, 0x127f, 0x007f, 0x0e7f, 0x007c,
- 0x20a9, 0x0040, 0x20a1, 0x7cc0, 0x2099, 0x7b8e, 0x3304, 0x8007,
- 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x357e, 0x007c, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x2099, 0x7b00, 0x20a1, 0x020b, 0x20a9, 0x000c,
- 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7b80,
+ 0x0100, 0x1078, 0x4f45, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000,
+ 0x0040, 0x322e, 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001,
+ 0x1078, 0x1f5e, 0x1078, 0x31f5, 0x127f, 0x007f, 0x0e7f, 0x007c,
+ 0x20a9, 0x0040, 0x20a1, 0x74c0, 0x2099, 0x738e, 0x3304, 0x8007,
+ 0x20a2, 0x9398, 0x94a0, 0x00f0, 0x323e, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x2099, 0x7300, 0x20a1, 0x020b, 0x20a9, 0x000c,
+ 0x53a6, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7380,
0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e,
- 0x2061, 0x0100, 0x810f, 0x2001, 0x762c, 0x2004, 0xa005, 0x00c0,
- 0x35af, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078, 0x35b1, 0xa185,
+ 0x2061, 0x0100, 0x810f, 0x2001, 0x6f2a, 0x2004, 0xa005, 0x00c0,
+ 0x326f, 0x6030, 0xa084, 0x00ff, 0xa105, 0x0078, 0x3271, 0xa185,
0x00f7, 0x604a, 0x007f, 0x0c7f, 0x007c, 0x017e, 0x047e, 0x2001,
- 0x7652, 0x2004, 0xd0a4, 0x0040, 0x35c8, 0xa006, 0x2020, 0x2009,
- 0x002a, 0x1078, 0x74ec, 0x2001, 0x760c, 0x200c, 0xc195, 0x2102,
- 0x2019, 0x002a, 0x1078, 0x226d, 0x047f, 0x017f, 0x007c, 0x157e,
- 0x20a9, 0x00ff, 0x2009, 0x7720, 0xa006, 0x200a, 0x8108, 0x00f0,
- 0x35d5, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e,
- 0x2069, 0x7651, 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e,
- 0x6012, 0xa198, 0x2303, 0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9,
+ 0x6f52, 0x2004, 0xd0a4, 0x0040, 0x3288, 0xa006, 0x2020, 0x2009,
+ 0x002a, 0x1078, 0x6d90, 0x2001, 0x6f0c, 0x200c, 0xc195, 0x2102,
+ 0x2019, 0x002a, 0x1078, 0x2152, 0x047f, 0x017f, 0x007c, 0x157e,
+ 0x20a9, 0x007d, 0x2009, 0x7020, 0xa006, 0x200a, 0x8108, 0x00f0,
+ 0x3295, 0x157f, 0x007c, 0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e,
+ 0x2069, 0x6f51, 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e,
+ 0x6012, 0xa198, 0x21d3, 0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9,
0x0004, 0xac98, 0x0006, 0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98,
0x000a, 0x23a0, 0x40a4, 0x603e, 0x6042, 0x604e, 0x6052, 0x6056,
0x605a, 0x605e, 0x6062, 0x6066, 0x606a, 0x606e, 0x6072, 0x6076,
@@ -9366,5354 +10330,1904 @@ static const u_int16_t ISP2100_RISC_CODE[] = {
0x609a, 0x609e, 0x61a2, 0x604a, 0x6810, 0x603a, 0x680c, 0x6046,
0x6814, 0xa084, 0x00ff, 0x6042, 0x147f, 0x137f, 0x157f, 0x037f,
0x0d7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0xa1b4, 0x00ff,
- 0xa682, 0x0010, 0x00c8, 0x36c7, 0xa18c, 0xff00, 0x810f, 0xa182,
- 0x00ff, 0x00c8, 0x36cd, 0x2001, 0x760c, 0x2004, 0xa084, 0x0003,
- 0x00c0, 0x36b0, 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x36a6,
- 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x36ac, 0x6078,
- 0xa00d, 0x0040, 0x3651, 0xa680, 0x7580, 0x2004, 0xa10c, 0x00c0,
- 0x36a0, 0x607c, 0xa00d, 0x0040, 0x366d, 0xa680, 0x7580, 0x2004,
- 0xa10c, 0x0040, 0x366d, 0x694c, 0xd1fc, 0x00c0, 0x3663, 0x1078,
- 0x3760, 0x0078, 0x369b, 0x1078, 0x3731, 0x694c, 0xd1ec, 0x00c0,
- 0x369b, 0x1078, 0x3879, 0x0078, 0x369b, 0x694c, 0xa184, 0xa000,
- 0x0040, 0x368b, 0xd1ec, 0x0040, 0x3684, 0xd1fc, 0x0040, 0x367c,
- 0x1078, 0x3890, 0x0078, 0x3687, 0xa680, 0x7580, 0x200c, 0x607c,
- 0xa105, 0x607e, 0x0078, 0x368b, 0xd1fc, 0x0040, 0x368b, 0x1078,
- 0x3731, 0x0078, 0x369b, 0x6050, 0xa00d, 0x0040, 0x3696, 0x2d00,
- 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x369b, 0x2d00, 0x6052,
- 0x604e, 0x6803, 0x0000, 0x1078, 0x47f6, 0xa006, 0x127f, 0x007c,
- 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x36d1, 0x2001, 0x0028,
- 0x2009, 0x0000, 0x0078, 0x36d1, 0xa082, 0x0006, 0x0048, 0x3647,
- 0x2009, 0x760c, 0x210c, 0xd18c, 0x0040, 0x36ba, 0x2001, 0x0004,
- 0x0078, 0x36c3, 0xd184, 0x0040, 0x36c1, 0x2001, 0x0004, 0x0078,
- 0x36c3, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x36d1, 0x2001,
- 0x0029, 0x2009, 0x0000, 0x0078, 0x36d1, 0x2001, 0x0029, 0x2009,
+ 0xa682, 0x0010, 0x00c8, 0x3387, 0xa18c, 0xff00, 0x810f, 0xa182,
+ 0x007e, 0x00c8, 0x338d, 0x2001, 0x6f0c, 0x2004, 0xa084, 0x0003,
+ 0x00c0, 0x3370, 0xa188, 0x7020, 0x2104, 0xa065, 0x0040, 0x3366,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x336c, 0x6078,
+ 0xa00d, 0x0040, 0x3311, 0xa680, 0x6e24, 0x2004, 0xa10c, 0x00c0,
+ 0x3360, 0x607c, 0xa00d, 0x0040, 0x332d, 0xa680, 0x6e24, 0x2004,
+ 0xa10c, 0x0040, 0x332d, 0x694c, 0xd1fc, 0x00c0, 0x3323, 0x1078,
+ 0x3420, 0x0078, 0x335b, 0x1078, 0x33f1, 0x694c, 0xd1ec, 0x00c0,
+ 0x335b, 0x1078, 0x3539, 0x0078, 0x335b, 0x694c, 0xa184, 0xa000,
+ 0x0040, 0x334b, 0xd1ec, 0x0040, 0x3344, 0xd1fc, 0x0040, 0x333c,
+ 0x1078, 0x3550, 0x0078, 0x3347, 0xa680, 0x6e24, 0x200c, 0x607c,
+ 0xa105, 0x607e, 0x0078, 0x334b, 0xd1fc, 0x0040, 0x334b, 0x1078,
+ 0x33f1, 0x0078, 0x335b, 0x6050, 0xa00d, 0x0040, 0x3356, 0x2d00,
+ 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x335b, 0x2d00, 0x6052,
+ 0x604e, 0x6803, 0x0000, 0x1078, 0x4417, 0xa006, 0x127f, 0x007c,
+ 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x3391, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x3391, 0xa082, 0x0006, 0x0048, 0x3307,
+ 0x2009, 0x6f0c, 0x210c, 0xd18c, 0x0040, 0x337a, 0x2001, 0x0004,
+ 0x0078, 0x3383, 0xd184, 0x0040, 0x3381, 0x2001, 0x0004, 0x0078,
+ 0x3383, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x3391, 0x2001,
+ 0x0029, 0x2009, 0x0000, 0x0078, 0x3391, 0x2001, 0x0029, 0x2009,
0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0xa1b4, 0x00ff, 0xa682,
- 0x0010, 0x00c8, 0x3716, 0xa18c, 0xff00, 0x810f, 0xa182, 0x00ff,
- 0x00c8, 0x3706, 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x3706,
- 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x370c, 0x684c,
- 0xd0ec, 0x0040, 0x36f9, 0x1078, 0x3890, 0x1078, 0x3731, 0x0078,
- 0x3701, 0x1078, 0x3731, 0x684c, 0xd0fc, 0x0040, 0x3701, 0x1078,
- 0x3879, 0x1078, 0x38a4, 0xa006, 0x0078, 0x371a, 0x2001, 0x0028,
- 0x2009, 0x0000, 0x0078, 0x371a, 0xa082, 0x0006, 0x0048, 0x36ef,
- 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x371a, 0x2001, 0x0029,
+ 0x0010, 0x00c8, 0x33d6, 0xa18c, 0xff00, 0x810f, 0xa182, 0x007e,
+ 0x00c8, 0x33c6, 0xa188, 0x7020, 0x2104, 0xa065, 0x0040, 0x33c6,
+ 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0, 0x33cc, 0x684c,
+ 0xd0ec, 0x0040, 0x33b9, 0x1078, 0x3550, 0x1078, 0x33f1, 0x0078,
+ 0x33c1, 0x1078, 0x33f1, 0x684c, 0xd0fc, 0x0040, 0x33c1, 0x1078,
+ 0x3539, 0x1078, 0x3564, 0xa006, 0x0078, 0x33da, 0x2001, 0x0028,
+ 0x2009, 0x0000, 0x0078, 0x33da, 0xa082, 0x0006, 0x0048, 0x33af,
+ 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x33da, 0x2001, 0x0029,
0x2009, 0x0000, 0xa005, 0x007c, 0x127e, 0x2091, 0x8000, 0x6050,
- 0xa00d, 0x0040, 0x372a, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
+ 0xa00d, 0x0040, 0x33ea, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052,
0x127f, 0x007c, 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078,
- 0x3728, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x373d,
+ 0x33e8, 0x127e, 0x2091, 0x8000, 0x604c, 0xa005, 0x0040, 0x33fd,
0x6802, 0x2d00, 0x604e, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
- 0x6803, 0x0000, 0x0078, 0x373b, 0x127e, 0x2091, 0x8000, 0x604c,
- 0xa06d, 0x0040, 0x3752, 0x6800, 0xa005, 0x00c0, 0x3750, 0x6052,
- 0x604e, 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x375f,
- 0x6800, 0xa005, 0x00c0, 0x375d, 0x6052, 0x604e, 0xad05, 0x007c,
- 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040, 0x376a, 0x2d00, 0x200a,
- 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x3769, 0x127e,
+ 0x6803, 0x0000, 0x0078, 0x33fb, 0x127e, 0x2091, 0x8000, 0x604c,
+ 0xa06d, 0x0040, 0x3412, 0x6800, 0xa005, 0x00c0, 0x3410, 0x6052,
+ 0x604e, 0xad05, 0x127f, 0x007c, 0x604c, 0xa06d, 0x0040, 0x341f,
+ 0x6800, 0xa005, 0x00c0, 0x341d, 0x6052, 0x604e, 0xad05, 0x007c,
+ 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040, 0x342a, 0x2d00, 0x200a,
+ 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082, 0x0078, 0x3429, 0x127e,
0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6200, 0xa005,
- 0x0040, 0x377d, 0xc285, 0x0078, 0x377e, 0xc284, 0x6202, 0x027f,
+ 0x0040, 0x343d, 0xc285, 0x0078, 0x343e, 0xc284, 0x6202, 0x027f,
0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218,
0x2260, 0x6204, 0xa294, 0xff00, 0xa215, 0x6206, 0x0c7f, 0x127f,
0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x6218, 0x2260, 0x6204,
0xa294, 0x00ff, 0x8007, 0xa215, 0x6206, 0x0c7f, 0x127f, 0x007c,
- 0x027e, 0xa182, 0x00ff, 0x0048, 0x37a9, 0xa085, 0x0001, 0x0078,
- 0x37bd, 0xa190, 0x7720, 0x2204, 0xa065, 0x00c0, 0x37bc, 0x017e,
- 0x0d7e, 0x1078, 0x1314, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x37a5,
- 0x2c00, 0x2012, 0x1078, 0x35db, 0xa006, 0x027f, 0x007c, 0x027e,
- 0xa182, 0x00ff, 0x0048, 0x37c8, 0xa085, 0x0001, 0x0078, 0x37d5,
- 0x0d7e, 0xa190, 0x7720, 0x2204, 0xa06d, 0x0040, 0x37d3, 0x2013,
- 0x0000, 0x1078, 0x1348, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e,
- 0xa182, 0x00ff, 0x0048, 0x37e0, 0xa085, 0x0001, 0x0078, 0x37e7,
- 0xa188, 0x7720, 0x2104, 0xa065, 0x0040, 0x37dc, 0xa006, 0x017f,
+ 0x027e, 0xa182, 0x007e, 0x0048, 0x3469, 0xa085, 0x0001, 0x0078,
+ 0x347d, 0xa190, 0x7020, 0x2204, 0xa065, 0x00c0, 0x347c, 0x017e,
+ 0x0d7e, 0x1078, 0x12c5, 0x2d60, 0x0d7f, 0x017f, 0x0040, 0x3465,
+ 0x2c00, 0x2012, 0x1078, 0x329b, 0xa006, 0x027f, 0x007c, 0x027e,
+ 0xa182, 0x007e, 0x0048, 0x3488, 0xa085, 0x0001, 0x0078, 0x3495,
+ 0x0d7e, 0xa190, 0x7020, 0x2204, 0xa06d, 0x0040, 0x3493, 0x2013,
+ 0x0000, 0x1078, 0x12f9, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e,
+ 0xa182, 0x007e, 0x0048, 0x34a0, 0xa085, 0x0001, 0x0078, 0x34a7,
+ 0xa188, 0x7020, 0x2104, 0xa065, 0x0040, 0x349c, 0xa006, 0x017f,
0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f,
- 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0x7b8e, 0x6808, 0x605e,
- 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x37ff, 0x603a, 0x6814,
- 0x6066, 0x2099, 0x7b96, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004,
- 0x53a3, 0x2099, 0x7b9a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004,
- 0x53a3, 0x2069, 0x7bae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810,
- 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x3823, 0x2009,
- 0x0008, 0x0078, 0x384d, 0xa182, 0x0259, 0x00c8, 0x382b, 0x2009,
- 0x0007, 0x0078, 0x384d, 0xa182, 0x02c1, 0x00c8, 0x3833, 0x2009,
- 0x0006, 0x0078, 0x384d, 0xa182, 0x0349, 0x00c8, 0x383b, 0x2009,
- 0x0005, 0x0078, 0x384d, 0xa182, 0x0421, 0x00c8, 0x3843, 0x2009,
- 0x0004, 0x0078, 0x384d, 0xa182, 0x0581, 0x00c8, 0x384b, 0x2009,
- 0x0003, 0x0078, 0x384d, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f,
- 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x7b8d, 0x2e04, 0x6896,
- 0x2071, 0x7b8e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c,
- 0x2001, 0x7580, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178,
- 0xa10d, 0x617a, 0x127f, 0x007c, 0x2001, 0x7580, 0xa600, 0x2004,
+ 0x0000, 0x6000, 0xc08c, 0x6002, 0x2069, 0x738e, 0x6808, 0x605e,
+ 0x6810, 0x6062, 0x6138, 0xa10a, 0x0048, 0x34bf, 0x603a, 0x6814,
+ 0x6066, 0x2099, 0x7396, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2099, 0x739a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004,
+ 0x53a3, 0x2069, 0x73ae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810,
+ 0x6072, 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x34e3, 0x2009,
+ 0x0008, 0x0078, 0x350d, 0xa182, 0x0259, 0x00c8, 0x34eb, 0x2009,
+ 0x0007, 0x0078, 0x350d, 0xa182, 0x02c1, 0x00c8, 0x34f3, 0x2009,
+ 0x0006, 0x0078, 0x350d, 0xa182, 0x0349, 0x00c8, 0x34fb, 0x2009,
+ 0x0005, 0x0078, 0x350d, 0xa182, 0x0421, 0x00c8, 0x3503, 0x2009,
+ 0x0004, 0x0078, 0x350d, 0xa182, 0x0581, 0x00c8, 0x350b, 0x2009,
+ 0x0003, 0x0078, 0x350d, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f,
+ 0x157f, 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x738d, 0x2e04, 0x6896,
+ 0x2071, 0x738e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c,
+ 0x2001, 0x6e24, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x6178,
+ 0xa10d, 0x617a, 0x127f, 0x007c, 0x2001, 0x6e24, 0xa600, 0x2004,
0x8002, 0x127e, 0x2091, 0x8000, 0x6178, 0xa10c, 0x617a, 0x127f,
- 0x007c, 0x2001, 0x7580, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091,
- 0x8000, 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078, 0x3889, 0x1078,
- 0x371c, 0x1078, 0x38ea, 0x00c0, 0x3887, 0x1078, 0x38a4, 0x007c,
- 0x2001, 0x7580, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c,
- 0xa10d, 0x617e, 0x127f, 0x0078, 0x389f, 0x1078, 0x3760, 0x1078,
- 0x38ae, 0x00c0, 0x389d, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x47f6, 0x127f, 0x007c, 0xa01e, 0x0078, 0x38b0, 0x2019, 0x0001,
+ 0x007c, 0x2001, 0x6e24, 0xa600, 0x2004, 0x8002, 0x127e, 0x2091,
+ 0x8000, 0x617c, 0xa10c, 0x617e, 0x127f, 0x0078, 0x3549, 0x1078,
+ 0x33dc, 0x1078, 0x35aa, 0x00c0, 0x3547, 0x1078, 0x3564, 0x007c,
+ 0x2001, 0x6e24, 0xa600, 0x2004, 0x127e, 0x2091, 0x8000, 0x617c,
+ 0xa10d, 0x617e, 0x127f, 0x0078, 0x355f, 0x1078, 0x3420, 0x1078,
+ 0x356e, 0x00c0, 0x355d, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x4417, 0x127f, 0x007c, 0xa01e, 0x0078, 0x3570, 0x2019, 0x0001,
0xa00e, 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc,
- 0x00c0, 0x38d0, 0x8dff, 0x0040, 0x38e5, 0x83ff, 0x0040, 0x38c8,
- 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x38d5, 0x0078, 0x38d0,
- 0x683c, 0xa406, 0x00c0, 0x38d0, 0x6840, 0xa506, 0x0040, 0x38d5,
- 0x2d08, 0x6800, 0x2068, 0x0078, 0x38ba, 0x6a00, 0x604c, 0xad06,
- 0x00c0, 0x38dd, 0x624e, 0x0078, 0x38e0, 0xa180, 0x0000, 0x2202,
- 0x82ff, 0x00c0, 0x38e5, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e,
- 0x0078, 0x38ec, 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff,
- 0x0040, 0x391a, 0x83ff, 0x0040, 0x38fd, 0x6844, 0xa084, 0x00ff,
- 0xa606, 0x0040, 0x390a, 0x0078, 0x3905, 0x683c, 0xa406, 0x00c0,
- 0x3905, 0x6840, 0xa506, 0x0040, 0x390a, 0x2d08, 0x6800, 0x2068,
- 0x0078, 0x38ef, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x3912, 0x6282,
- 0x0078, 0x3915, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x391a,
- 0x6186, 0x8dff, 0x007c, 0x2001, 0x7580, 0xa600, 0x2004, 0x6178,
- 0xa10c, 0x0040, 0x3925, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040,
- 0x392b, 0xa295, 0x0002, 0x007c, 0x1078, 0x3977, 0x0040, 0x3934,
- 0x1078, 0x69c1, 0x0078, 0x3936, 0xa085, 0x0001, 0x007c, 0x1078,
- 0x3977, 0x0040, 0x393f, 0x1078, 0x6950, 0x0078, 0x3941, 0xa085,
- 0x0001, 0x007c, 0x1078, 0x3977, 0x0040, 0x394a, 0x1078, 0x6996,
- 0x0078, 0x394c, 0xa085, 0x0001, 0x007c, 0x1078, 0x3977, 0x0040,
- 0x3955, 0x1078, 0x696c, 0x0078, 0x3957, 0xa085, 0x0001, 0x007c,
+ 0x00c0, 0x3590, 0x8dff, 0x0040, 0x35a5, 0x83ff, 0x0040, 0x3588,
+ 0x6844, 0xa084, 0x00ff, 0xa606, 0x0040, 0x3595, 0x0078, 0x3590,
+ 0x683c, 0xa406, 0x00c0, 0x3590, 0x6840, 0xa506, 0x0040, 0x3595,
+ 0x2d08, 0x6800, 0x2068, 0x0078, 0x357a, 0x6a00, 0x604c, 0xad06,
+ 0x00c0, 0x359d, 0x624e, 0x0078, 0x35a0, 0xa180, 0x0000, 0x2202,
+ 0x82ff, 0x00c0, 0x35a5, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e,
+ 0x0078, 0x35ac, 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff,
+ 0x0040, 0x35da, 0x83ff, 0x0040, 0x35bd, 0x6844, 0xa084, 0x00ff,
+ 0xa606, 0x0040, 0x35ca, 0x0078, 0x35c5, 0x683c, 0xa406, 0x00c0,
+ 0x35c5, 0x6840, 0xa506, 0x0040, 0x35ca, 0x2d08, 0x6800, 0x2068,
+ 0x0078, 0x35af, 0x6a00, 0x6080, 0xad06, 0x00c0, 0x35d2, 0x6282,
+ 0x0078, 0x35d5, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0, 0x35da,
+ 0x6186, 0x8dff, 0x007c, 0x2001, 0x6e24, 0xa600, 0x2004, 0x6178,
+ 0xa10c, 0x0040, 0x35e5, 0x2011, 0x0001, 0x617c, 0xa10c, 0x0040,
+ 0x35eb, 0xa295, 0x0002, 0x007c, 0x1078, 0x3637, 0x0040, 0x35f4,
+ 0x1078, 0x628e, 0x0078, 0x35f6, 0xa085, 0x0001, 0x007c, 0x1078,
+ 0x3637, 0x0040, 0x35ff, 0x1078, 0x621d, 0x0078, 0x3601, 0xa085,
+ 0x0001, 0x007c, 0x1078, 0x3637, 0x0040, 0x360a, 0x1078, 0x6263,
+ 0x0078, 0x360c, 0xa085, 0x0001, 0x007c, 0x1078, 0x3637, 0x0040,
+ 0x3615, 0x1078, 0x6239, 0x0078, 0x3617, 0xa085, 0x0001, 0x007c,
0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040,
- 0x396f, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x007f, 0x0078, 0x395e, 0x6083,
+ 0x362f, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+ 0x1078, 0x639b, 0x1078, 0x36ec, 0x007f, 0x0078, 0x361e, 0x6083,
0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c, 0x609c,
- 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x7651, 0x7804, 0xd0a4, 0x0040,
- 0x39a3, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x37d7, 0x00c0, 0x3997, 0x6004, 0xa084, 0xff00, 0x8007,
- 0xa086, 0x0006, 0x00c0, 0x3997, 0x6000, 0xc0ed, 0x6002, 0x017f,
- 0x8108, 0x00f0, 0x3987, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
- 0x39a5, 0x1078, 0x45b0, 0x0f7f, 0x007c, 0x2011, 0x39a5, 0x1078,
- 0x4520, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x37d7, 0x00c0, 0x39d1, 0x6000, 0xd0ec, 0x0040, 0x39d1,
+ 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x6f51, 0x7804, 0xd0a4, 0x0040,
+ 0x3663, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x3497, 0x00c0, 0x3657, 0x6004, 0xa084, 0xff00, 0x8007,
+ 0xa086, 0x0006, 0x00c0, 0x3657, 0x6000, 0xc0ed, 0x6002, 0x017f,
+ 0x8108, 0x00f0, 0x3647, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
+ 0x3665, 0x1078, 0x41e3, 0x0f7f, 0x007c, 0x2011, 0x3665, 0x1078,
+ 0x4153, 0x157e, 0x0c7e, 0x20a9, 0x007e, 0x2009, 0x0000, 0x017e,
+ 0x1078, 0x3497, 0x00c0, 0x3691, 0x6000, 0xd0ec, 0x0040, 0x3691,
0x047e, 0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029,
- 0x1078, 0x74ec, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x2009, 0x0000, 0x1078, 0x7326,
- 0x047f, 0x017f, 0x8108, 0x00f0, 0x39af, 0x0c7f, 0x157f, 0x007c,
+ 0x1078, 0x6d90, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
+ 0x1078, 0x4535, 0x1078, 0x4478, 0x2009, 0x0000, 0x1078, 0x6bca,
+ 0x047f, 0x017f, 0x8108, 0x00f0, 0x366f, 0x0c7f, 0x157f, 0x007c,
0x0c7e, 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c,
- 0x2071, 0x76ff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
+ 0x2071, 0x6fff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x704b, 0x0001,
0x704f, 0x0000, 0x705b, 0x0020, 0x705f, 0x0040, 0x707f, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x76ff, 0x684c, 0xa005, 0x00c0, 0x3a07,
- 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x3a2a, 0x6a60,
+ 0x007c, 0x0e7e, 0x2071, 0x6fff, 0x684c, 0xa005, 0x00c0, 0x36c7,
+ 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x36ea, 0x6a60,
0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, 0x7076, 0x686c, 0x7042,
0x707a, 0x684c, 0x702e, 0x6844, 0x7032, 0x2009, 0x000d, 0x200a,
0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210,
0x2100, 0xa319, 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007,
0x0001, 0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0,
- 0x3a7d, 0x6804, 0xa00d, 0x0040, 0x3a4b, 0x0d7e, 0x0e7e, 0x2071,
- 0x7600, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
- 0x2d00, 0x81ff, 0x00c0, 0x3a3c, 0x702e, 0x70a0, 0xa200, 0x70a2,
- 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x76ff, 0x701c, 0xa005, 0x00c0,
- 0x3a8e, 0x0068, 0x3a8c, 0x2071, 0x7651, 0x7004, 0xd09c, 0x0040,
- 0x3a8c, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3a9f, 0x6948, 0x6844,
- 0xa105, 0x00c0, 0x3a7f, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
- 0xd084, 0x00c0, 0x3a8c, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
- 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x7600, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844,
- 0xa086, 0x0100, 0x00c0, 0x3a8c, 0x6868, 0xa005, 0x00c0, 0x3a8c,
- 0x2009, 0x8020, 0x0078, 0x3a65, 0x2071, 0x76ff, 0x2d08, 0x206b,
+ 0x373d, 0x6804, 0xa00d, 0x0040, 0x370b, 0x0d7e, 0x0e7e, 0x2071,
+ 0x6f00, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
+ 0x2d00, 0x81ff, 0x00c0, 0x36fc, 0x702e, 0x7098, 0xa200, 0x709a,
+ 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x6fff, 0x701c, 0xa005, 0x00c0,
+ 0x374e, 0x0068, 0x374c, 0x2071, 0x6f51, 0x7004, 0xd09c, 0x0040,
+ 0x374c, 0x6934, 0xa186, 0x0103, 0x00c0, 0x375f, 0x6948, 0x6844,
+ 0xa105, 0x00c0, 0x373f, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
+ 0xd084, 0x00c0, 0x374c, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
+ 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x6f00, 0x702c, 0x206a,
+ 0x2d00, 0x702e, 0x7098, 0x8000, 0x709a, 0x0e7f, 0x007c, 0x6844,
+ 0xa086, 0x0100, 0x00c0, 0x374c, 0x6868, 0xa005, 0x00c0, 0x374c,
+ 0x2009, 0x8020, 0x0078, 0x3725, 0x2071, 0x6fff, 0x2d08, 0x206b,
0x0000, 0x7010, 0x8000, 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040,
- 0x3a9c, 0x6902, 0x0078, 0x3a9d, 0x711e, 0x0078, 0x3a7d, 0xa18c,
- 0x00ff, 0xa186, 0x0017, 0x0040, 0x3aad, 0xa186, 0x001e, 0x0040,
- 0x3aad, 0xa18e, 0x001f, 0x00c0, 0x3a8c, 0x684c, 0xd0cc, 0x0040,
- 0x3a8c, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3a8c,
- 0x2009, 0x8021, 0x0078, 0x3a65, 0x007e, 0x6837, 0x0103, 0x20a9,
+ 0x375c, 0x6902, 0x0078, 0x375d, 0x711e, 0x0078, 0x373d, 0xa18c,
+ 0x00ff, 0xa186, 0x0017, 0x0040, 0x376d, 0xa186, 0x001e, 0x0040,
+ 0x376d, 0xa18e, 0x001f, 0x00c0, 0x374c, 0x684c, 0xd0cc, 0x0040,
+ 0x374c, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x374c,
+ 0x2009, 0x8021, 0x0078, 0x3725, 0x007e, 0x6837, 0x0103, 0x20a9,
0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f,
- 0x684a, 0x6952, 0x007c, 0x2071, 0x76ff, 0x7004, 0x0079, 0x3ad0,
- 0x3ad8, 0x3ae7, 0x3b77, 0x3b78, 0x3b88, 0x3b8e, 0x3ad9, 0x3b65,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x3ae6, 0x2009, 0x000d,
+ 0x684a, 0x6952, 0x007c, 0x2071, 0x6fff, 0x7004, 0x0079, 0x3790,
+ 0x3798, 0x37a7, 0x3837, 0x3838, 0x3848, 0x384e, 0x3799, 0x3825,
+ 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x37a6, 0x2009, 0x000d,
0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x701c,
- 0xa06d, 0x0040, 0x3b64, 0x0e7e, 0x2071, 0x7651, 0x7004, 0xd09c,
- 0x0040, 0x3b46, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3b1c, 0x6948,
- 0x6844, 0xa105, 0x00c0, 0x3b39, 0x2009, 0x8020, 0x127e, 0x2091,
- 0x8000, 0x0068, 0x3b18, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
- 0x3b18, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
- 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3bc1, 0x0078, 0x3b64,
- 0x127f, 0x0e7f, 0x0078, 0x3b64, 0xa18c, 0x00ff, 0xa186, 0x0017,
- 0x0040, 0x3b2a, 0xa186, 0x001e, 0x0040, 0x3b2a, 0xa18e, 0x001f,
- 0x00c0, 0x3b46, 0x684c, 0xd0cc, 0x0040, 0x3b46, 0x6850, 0xa084,
- 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3b46, 0x2009, 0x8021, 0x0078,
- 0x3afe, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3b46, 0x6868, 0xa005,
- 0x00c0, 0x3b46, 0x2009, 0x8020, 0x0078, 0x3afe, 0x0e7f, 0x1078,
- 0x3bd5, 0x0040, 0x3b64, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
- 0xa086, 0x0003, 0x00c0, 0x3b5b, 0x810f, 0xa18c, 0x00ff, 0x8101,
- 0x0040, 0x3b5b, 0x710e, 0x7007, 0x0003, 0x1078, 0x3bf5, 0x7050,
- 0xa086, 0x0100, 0x0040, 0x3b78, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x3b76, 0x1078, 0x3bd5, 0x0040, 0x3b76, 0x7007, 0x0003, 0x1078,
- 0x3bf5, 0x7050, 0xa086, 0x0100, 0x0040, 0x3b78, 0x007c, 0x007c,
- 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3b81, 0x7007, 0x0004, 0x0078,
- 0x3b88, 0xa086, 0x0200, 0x00c0, 0x3b87, 0x7007, 0x0005, 0x007c,
- 0x1078, 0x3b8f, 0x7006, 0x1078, 0x3bc1, 0x007c, 0x007c, 0x702c,
- 0x7130, 0x8108, 0xa102, 0x0048, 0x3b9c, 0xa00e, 0x7034, 0x706e,
- 0x7038, 0x7072, 0x0078, 0x3ba6, 0x706c, 0xa080, 0x0040, 0x706e,
- 0x00c8, 0x3ba6, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
- 0x8001, 0x700e, 0x00c0, 0x3bba, 0x127e, 0x2091, 0x8000, 0x0068,
- 0x3bbd, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
+ 0xa06d, 0x0040, 0x3824, 0x0e7e, 0x2071, 0x6f51, 0x7004, 0xd09c,
+ 0x0040, 0x3806, 0x6934, 0xa186, 0x0103, 0x00c0, 0x37dc, 0x6948,
+ 0x6844, 0xa105, 0x00c0, 0x37f9, 0x2009, 0x8020, 0x127e, 0x2091,
+ 0x8000, 0x0068, 0x37d8, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
+ 0x37d8, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
+ 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3881, 0x0078, 0x3824,
+ 0x127f, 0x0e7f, 0x0078, 0x3824, 0xa18c, 0x00ff, 0xa186, 0x0017,
+ 0x0040, 0x37ea, 0xa186, 0x001e, 0x0040, 0x37ea, 0xa18e, 0x001f,
+ 0x00c0, 0x3806, 0x684c, 0xd0cc, 0x0040, 0x3806, 0x6850, 0xa084,
+ 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3806, 0x2009, 0x8021, 0x0078,
+ 0x37be, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3806, 0x6868, 0xa005,
+ 0x00c0, 0x3806, 0x2009, 0x8020, 0x0078, 0x37be, 0x0e7f, 0x1078,
+ 0x3895, 0x0040, 0x3824, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
+ 0xa086, 0x0003, 0x00c0, 0x381b, 0x810f, 0xa18c, 0x00ff, 0x8101,
+ 0x0040, 0x381b, 0x710e, 0x7007, 0x0003, 0x1078, 0x38b5, 0x7050,
+ 0xa086, 0x0100, 0x0040, 0x3838, 0x007c, 0x701c, 0xa06d, 0x0040,
+ 0x3836, 0x1078, 0x3895, 0x0040, 0x3836, 0x7007, 0x0003, 0x1078,
+ 0x38b5, 0x7050, 0xa086, 0x0100, 0x0040, 0x3838, 0x007c, 0x007c,
+ 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3841, 0x7007, 0x0004, 0x0078,
+ 0x3848, 0xa086, 0x0200, 0x00c0, 0x3847, 0x7007, 0x0005, 0x007c,
+ 0x1078, 0x384f, 0x7006, 0x1078, 0x3881, 0x007c, 0x007c, 0x702c,
+ 0x7130, 0x8108, 0xa102, 0x0048, 0x385c, 0xa00e, 0x7034, 0x706e,
+ 0x7038, 0x7072, 0x0078, 0x3866, 0x706c, 0xa080, 0x0040, 0x706e,
+ 0x00c8, 0x3866, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
+ 0x8001, 0x700e, 0x00c0, 0x387a, 0x127e, 0x2091, 0x8000, 0x0068,
+ 0x387d, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x127f,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x3bd4, 0x127e, 0x2091, 0x8000,
- 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3bd1,
- 0x701a, 0x127f, 0x1078, 0x1348, 0x007c, 0x2019, 0x000d, 0x2304,
- 0x230c, 0xa10e, 0x0040, 0x3be4, 0x2304, 0x230c, 0xa10e, 0x0040,
- 0x3be4, 0xa006, 0x0078, 0x3bf4, 0x732c, 0x8319, 0x7130, 0xa102,
- 0x00c0, 0x3bee, 0x2300, 0xa005, 0x0078, 0x3bf4, 0x0048, 0x3bf3,
- 0xa302, 0x0078, 0x3bf4, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
+ 0x007c, 0x701c, 0xa06d, 0x0040, 0x3894, 0x127e, 0x2091, 0x8000,
+ 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3891,
+ 0x701a, 0x127f, 0x1078, 0x12f9, 0x007c, 0x2019, 0x000d, 0x2304,
+ 0x230c, 0xa10e, 0x0040, 0x38a4, 0x2304, 0x230c, 0xa10e, 0x0040,
+ 0x38a4, 0xa006, 0x0078, 0x38b4, 0x732c, 0x8319, 0x7130, 0xa102,
+ 0x00c0, 0x38ae, 0x2300, 0xa005, 0x0078, 0x38b4, 0x0048, 0x38b3,
+ 0xa302, 0x0078, 0x38b4, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091, 0x8000, 0x2009,
- 0x7859, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x2071, 0x76cd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
+ 0x70d9, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x134a, 0x007c,
+ 0x2071, 0x6fcd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001, 0x705f, 0x0020,
0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000, 0x708f, 0x0001,
- 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x76cd, 0x6848, 0xa005,
- 0x00c0, 0x3c31, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
- 0x3c56, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
+ 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x6fcd, 0x6848, 0xa005,
+ 0x00c0, 0x38f1, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
+ 0x3916, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009,
0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084,
0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084,
0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c,
- 0x2b78, 0x2071, 0x76cd, 0x7004, 0x1079, 0x3cb6, 0x700c, 0x0079,
- 0x3c61, 0x3c66, 0x3c5b, 0x3c5b, 0x3c5b, 0x3c5b, 0x007c, 0x700c,
- 0x0079, 0x3c6a, 0x3c6f, 0x3cb4, 0x3cb4, 0x3cb5, 0x3cb5, 0x7830,
- 0x7930, 0xa106, 0x0040, 0x3c79, 0x7830, 0x7930, 0xa106, 0x00c0,
- 0x3c9f, 0x7030, 0xa10a, 0x0040, 0x3c9f, 0x00c8, 0x3c81, 0x712c,
- 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3ca0, 0x1078, 0x1314, 0x0040,
- 0x3c9f, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
- 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x7859, 0x2104,
- 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x1078, 0x1314, 0x0040, 0x3c9f, 0x2d00, 0x705a, 0x1078, 0x1314,
- 0x00c0, 0x3cac, 0x0078, 0x3c8b, 0x2d00, 0x7086, 0x7063, 0x0080,
- 0x2001, 0x0004, 0x0078, 0x3c8f, 0x007c, 0x007c, 0x3cc7, 0x3cc8,
- 0x3cff, 0x3d00, 0x3cb4, 0x3d36, 0x3d3b, 0x3d72, 0x3d73, 0x3d8e,
- 0x3d8f, 0x3d90, 0x3d91, 0x3d92, 0x3d93, 0x3dfc, 0x3e26, 0x007c,
- 0x700c, 0x0079, 0x3ccb, 0x3cd0, 0x3cd3, 0x3ce3, 0x3cfe, 0x3cfe,
- 0x1078, 0x3c67, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
- 0x1078, 0x4105, 0x0040, 0x3ce0, 0x2091, 0x8000, 0x1078, 0x3c67,
- 0x0d7f, 0x0078, 0x3cec, 0x127e, 0x8001, 0x700e, 0x1078, 0x4105,
+ 0x2b78, 0x2071, 0x6fcd, 0x7004, 0x1079, 0x3976, 0x700c, 0x0079,
+ 0x3921, 0x3926, 0x391b, 0x391b, 0x391b, 0x391b, 0x007c, 0x700c,
+ 0x0079, 0x392a, 0x392f, 0x3974, 0x3974, 0x3975, 0x3975, 0x7830,
+ 0x7930, 0xa106, 0x0040, 0x3939, 0x7830, 0x7930, 0xa106, 0x00c0,
+ 0x395f, 0x7030, 0xa10a, 0x0040, 0x395f, 0x00c8, 0x3941, 0x712c,
+ 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3960, 0x1078, 0x12c5, 0x0040,
+ 0x395f, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
+ 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x70d9, 0x2104,
+ 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x134a, 0x007c,
+ 0x1078, 0x12c5, 0x0040, 0x395f, 0x2d00, 0x705a, 0x1078, 0x12c5,
+ 0x00c0, 0x396c, 0x0078, 0x394b, 0x2d00, 0x7086, 0x7063, 0x0080,
+ 0x2001, 0x0004, 0x0078, 0x394f, 0x007c, 0x007c, 0x3987, 0x3988,
+ 0x39bf, 0x39c0, 0x3974, 0x39f6, 0x39fb, 0x3a32, 0x3a33, 0x3a4e,
+ 0x3a4f, 0x3a50, 0x3a51, 0x3a52, 0x3a53, 0x3abc, 0x3ae6, 0x007c,
+ 0x700c, 0x0079, 0x398b, 0x3990, 0x3993, 0x39a3, 0x39be, 0x39be,
+ 0x1078, 0x3927, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
+ 0x1078, 0x3dc5, 0x0040, 0x39a0, 0x2091, 0x8000, 0x1078, 0x3927,
+ 0x0d7f, 0x0078, 0x39ac, 0x127e, 0x8001, 0x700e, 0x1078, 0x3dc5,
0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
- 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x3cfb, 0x1079,
- 0x3d16, 0x127f, 0x007c, 0x127f, 0x1078, 0x3d94, 0x007c, 0x007c,
- 0x007c, 0x0e7e, 0x2071, 0x76cd, 0x700c, 0x0079, 0x3d07, 0x3d0c,
- 0x3d0c, 0x3d0c, 0x3d0e, 0x3d12, 0x0e7f, 0x007c, 0x700f, 0x0001,
- 0x0078, 0x3d14, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x3d94, 0x3d94,
- 0x3db0, 0x3d94, 0x3e9b, 0x3d94, 0x3d94, 0x3d94, 0x3d94, 0x3d94,
- 0x3db0, 0x3ee0, 0x3f29, 0x3f81, 0x3f94, 0x3d94, 0x3d94, 0x3dcc,
- 0x3db0, 0x3d94, 0x3d94, 0x3de2, 0x401b, 0x4038, 0x3d94, 0x3dcc,
- 0x3d94, 0x3d94, 0x3d94, 0x3d94, 0x3de2, 0x4038, 0x7020, 0x2068,
- 0x1078, 0x1348, 0x007c, 0x700c, 0x0079, 0x3d3e, 0x3d43, 0x3d46,
- 0x3d56, 0x3d71, 0x3d71, 0x1078, 0x3c67, 0x007c, 0x127e, 0x8001,
- 0x700e, 0x7058, 0x007e, 0x1078, 0x4105, 0x0040, 0x3d53, 0x2091,
- 0x8000, 0x1078, 0x3c67, 0x0d7f, 0x0078, 0x3d5f, 0x127e, 0x8001,
- 0x700e, 0x1078, 0x4105, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
+ 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x39bb, 0x1079,
+ 0x39d6, 0x127f, 0x007c, 0x127f, 0x1078, 0x3a54, 0x007c, 0x007c,
+ 0x007c, 0x0e7e, 0x2071, 0x6fcd, 0x700c, 0x0079, 0x39c7, 0x39cc,
+ 0x39cc, 0x39cc, 0x39ce, 0x39d2, 0x0e7f, 0x007c, 0x700f, 0x0001,
+ 0x0078, 0x39d4, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x3a54, 0x3a54,
+ 0x3a70, 0x3a54, 0x3b5b, 0x3a54, 0x3a54, 0x3a54, 0x3a54, 0x3a54,
+ 0x3a70, 0x3ba0, 0x3be9, 0x3c41, 0x3c54, 0x3a54, 0x3a54, 0x3a8c,
+ 0x3a70, 0x3a54, 0x3a54, 0x3aa2, 0x3cdb, 0x3cf8, 0x3a54, 0x3a8c,
+ 0x3a54, 0x3a54, 0x3a54, 0x3a54, 0x3aa2, 0x3cf8, 0x7020, 0x2068,
+ 0x1078, 0x12f9, 0x007c, 0x700c, 0x0079, 0x39fe, 0x3a03, 0x3a06,
+ 0x3a16, 0x3a31, 0x3a31, 0x1078, 0x3927, 0x007c, 0x127e, 0x8001,
+ 0x700e, 0x7058, 0x007e, 0x1078, 0x3dc5, 0x0040, 0x3a13, 0x2091,
+ 0x8000, 0x1078, 0x3927, 0x0d7f, 0x0078, 0x3a1f, 0x127e, 0x8001,
+ 0x700e, 0x1078, 0x3dc5, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a,
- 0x00c8, 0x3d6e, 0x1079, 0x3d74, 0x127f, 0x007c, 0x127f, 0x1078,
- 0x3d94, 0x007c, 0x007c, 0x007c, 0x3d94, 0x3db0, 0x3e85, 0x3d94,
- 0x3db0, 0x3d94, 0x3db0, 0x3db0, 0x3d94, 0x3db0, 0x3e85, 0x3db0,
- 0x3db0, 0x3db0, 0x3db0, 0x3db0, 0x3d94, 0x3db0, 0x3e85, 0x3d94,
- 0x3d94, 0x3db0, 0x3d94, 0x3d94, 0x3d94, 0x3db0, 0x007c, 0x007c,
+ 0x00c8, 0x3a2e, 0x1079, 0x3a34, 0x127f, 0x007c, 0x127f, 0x1078,
+ 0x3a54, 0x007c, 0x007c, 0x007c, 0x3a54, 0x3a70, 0x3b45, 0x3a54,
+ 0x3a70, 0x3a54, 0x3a70, 0x3a70, 0x3a54, 0x3a70, 0x3b45, 0x3a70,
+ 0x3a70, 0x3a70, 0x3a70, 0x3a70, 0x3a54, 0x3a70, 0x3b45, 0x3a54,
+ 0x3a54, 0x3a70, 0x3a54, 0x3a54, 0x3a54, 0x3a70, 0x007c, 0x007c,
0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a2c,
+ 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x36ec,
0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a2c, 0x127f, 0x007c,
+ 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x36ec, 0x127f, 0x007c,
0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3a2c, 0x127f, 0x007c, 0x7007, 0x0001,
+ 0x2091, 0x8000, 0x1078, 0x36ec, 0x127f, 0x007c, 0x7007, 0x0001,
0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3a2c, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
- 0x0040, 0x3da2, 0x8001, 0x00c0, 0x3dd9, 0x7007, 0x0001, 0x0078,
- 0x3e62, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
- 0x3e62, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
- 0x0024, 0x2098, 0x20a1, 0x76f8, 0x53a3, 0x6858, 0x7012, 0xa082,
- 0x0401, 0x00c8, 0x3dbe, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3dbe,
- 0xa080, 0x3e53, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x3e46,
- 0x1078, 0x1314, 0x00c0, 0x3e07, 0x7007, 0x000f, 0x007c, 0x2d00,
+ 0x1078, 0x36ec, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
+ 0x0040, 0x3a62, 0x8001, 0x00c0, 0x3a99, 0x7007, 0x0001, 0x0078,
+ 0x3b22, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
+ 0x3b22, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
+ 0x0024, 0x2098, 0x20a1, 0x6ff8, 0x53a3, 0x6858, 0x7012, 0xa082,
+ 0x0401, 0x00c8, 0x3a7e, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3a7e,
+ 0xa080, 0x3b13, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x3b06,
+ 0x1078, 0x12c5, 0x00c0, 0x3ac7, 0x7007, 0x000f, 0x007c, 0x2d00,
0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, 0x7096,
- 0x6008, 0xa20a, 0x00c8, 0x3e16, 0xa00e, 0x2200, 0x7112, 0x620c,
- 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x3e1f, 0xa108, 0x719a,
- 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x137f, 0x7090, 0xa08e,
- 0x0100, 0x0040, 0x3e3a, 0xa086, 0x0200, 0x0040, 0x3e32, 0x7007,
- 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x1348, 0x7014, 0x2068,
- 0x0078, 0x3dbe, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
- 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3dfc, 0x7014, 0x2068,
+ 0x6008, 0xa20a, 0x00c8, 0x3ad6, 0xa00e, 0x2200, 0x7112, 0x620c,
+ 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x3adf, 0xa108, 0x719a,
+ 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x1330, 0x7090, 0xa08e,
+ 0x0100, 0x0040, 0x3afa, 0xa086, 0x0200, 0x0040, 0x3af2, 0x7007,
+ 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x12f9, 0x7014, 0x2068,
+ 0x0078, 0x3a7e, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
+ 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3abc, 0x7014, 0x2068,
0x7007, 0x0001, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0040,
- 0x4055, 0x0078, 0x3e62, 0x3e56, 0x3e5a, 0x3e5e, 0x0002, 0x0011,
+ 0x3d15, 0x0078, 0x3b22, 0x3b16, 0x3b1a, 0x3b1e, 0x0002, 0x0011,
0x0007, 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f,
- 0x0005, 0x0006, 0x2009, 0x762c, 0x210c, 0x81ff, 0x00c0, 0x3e7f,
- 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3622,
- 0x00c0, 0x3e73, 0x007c, 0x1078, 0x3abc, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x127f, 0x0078, 0x3e72, 0x2001,
- 0x0028, 0x2009, 0x0000, 0x0078, 0x3e73, 0x7018, 0x6802, 0x2d08,
- 0x2068, 0x6906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3e94,
- 0x7007, 0x0006, 0x0078, 0x3e9a, 0x7014, 0x2068, 0x7007, 0x0001,
+ 0x0005, 0x0006, 0x2009, 0x6f2a, 0x210c, 0x81ff, 0x00c0, 0x3b3f,
+ 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x32e2,
+ 0x00c0, 0x3b33, 0x007c, 0x1078, 0x377c, 0x127e, 0x2091, 0x8000,
+ 0x1078, 0x639b, 0x1078, 0x36ec, 0x127f, 0x0078, 0x3b32, 0x2001,
+ 0x0028, 0x2009, 0x0000, 0x0078, 0x3b33, 0x7018, 0x6802, 0x2d08,
+ 0x2068, 0x6906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3b54,
+ 0x7007, 0x0006, 0x0078, 0x3b5a, 0x7014, 0x2068, 0x7007, 0x0001,
0x7048, 0x107a, 0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c,
0x00ff, 0x6848, 0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001,
- 0x0040, 0x3ec6, 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002,
- 0x0040, 0x3ec6, 0xa005, 0x00c0, 0x3edd, 0x6944, 0x810f, 0xa18c,
- 0x00ff, 0x1078, 0x37d7, 0x00c0, 0x3edd, 0x067e, 0x6e44, 0xa6b4,
- 0x000f, 0x1078, 0x386c, 0x067f, 0x0078, 0x3edd, 0x047e, 0x2011,
- 0x760c, 0x2224, 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078,
- 0x37d7, 0x00c0, 0x3ed9, 0x2091, 0x8000, 0x607b, 0x0000, 0x2091,
- 0x8001, 0x8108, 0x00f0, 0x3ecf, 0x0c7f, 0x1078, 0x1348, 0x007c,
- 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x7652, 0x2004,
- 0xd0a4, 0x0040, 0x3f20, 0x6944, 0x1078, 0x4121, 0x6100, 0xd184,
- 0x0040, 0x3f05, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3f23, 0x6000,
- 0xd084, 0x0040, 0x3f20, 0x6004, 0xa005, 0x00c0, 0x3f26, 0x6003,
- 0x0000, 0x600b, 0x0000, 0x0078, 0x3f1d, 0x2011, 0x0001, 0x6860,
- 0xa005, 0x00c0, 0x3f0d, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858,
- 0xa084, 0x00ff, 0x0040, 0x3f20, 0x6006, 0x6858, 0x8007, 0xa084,
- 0x00ff, 0x0040, 0x3f20, 0x600a, 0x6202, 0x127f, 0x0078, 0x40f4,
- 0x127f, 0x0078, 0x40ec, 0x127f, 0x0078, 0x40e4, 0x127f, 0x0078,
- 0x40e8, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x7652,
- 0x2004, 0xd0a4, 0x0040, 0x3f7e, 0x6944, 0x1078, 0x4121, 0x6000,
- 0xa084, 0x0001, 0x0040, 0x3f7e, 0x6204, 0x6308, 0x6c48, 0xa484,
- 0x0003, 0x0040, 0x3f56, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0,
- 0x3f4f, 0x2100, 0xa210, 0x0048, 0x3f7b, 0x0078, 0x3f56, 0x8001,
- 0x00c0, 0x3f7b, 0x2100, 0xa212, 0x0048, 0x3f7b, 0xa484, 0x000c,
- 0x0040, 0x3f70, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
- 0x00c0, 0x3f68, 0x2100, 0xa318, 0x0048, 0x3f7b, 0x0078, 0x3f70,
- 0xa082, 0x0004, 0x00c0, 0x3f7b, 0x2100, 0xa31a, 0x0048, 0x3f7b,
- 0x6860, 0xa005, 0x0040, 0x3f76, 0x8000, 0x6016, 0x6206, 0x630a,
- 0x127f, 0x0078, 0x40f4, 0x127f, 0x0078, 0x40f0, 0x127f, 0x0078,
- 0x40ec, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x6944, 0x1078,
- 0x4121, 0x6308, 0x8318, 0x0048, 0x3f91, 0x630a, 0x127f, 0x0078,
- 0x4102, 0x127f, 0x0078, 0x40f0, 0x127e, 0x0c7e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x3fa8, 0x027e, 0x2009,
- 0x0000, 0x2011, 0xfcff, 0x1078, 0x4666, 0x027f, 0x0078, 0x3fde,
- 0x6858, 0xa005, 0x0040, 0x3ff2, 0x685c, 0xa065, 0x0040, 0x3fee,
- 0x2001, 0x762c, 0x2004, 0xa005, 0x0040, 0x3fba, 0x1078, 0x6a4c,
- 0x0078, 0x3fc0, 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x5bdb,
- 0x6958, 0xa18c, 0xe600, 0xa186, 0x2000, 0x0040, 0x3fd6, 0xa186,
- 0x0400, 0x0040, 0x3fd6, 0x6944, 0x0c7e, 0x1078, 0x45be, 0x6000,
- 0xa084, 0xfdff, 0x6002, 0x0c7f, 0x0078, 0x3fde, 0x027e, 0x2009,
- 0x0000, 0x2011, 0xfdff, 0x1078, 0x4666, 0x027f, 0x684c, 0xd0c4,
- 0x0040, 0x3fea, 0x6944, 0x1078, 0x45be, 0x6008, 0x8000, 0x0048,
- 0x3fea, 0x600a, 0x0c7f, 0x127f, 0x0078, 0x40f4, 0x0c7f, 0x127f,
- 0x0078, 0x40ec, 0x6954, 0xa186, 0x002a, 0x00c0, 0x3ffe, 0x2001,
- 0x760c, 0x200c, 0xc194, 0x2102, 0x0078, 0x3fde, 0xa186, 0x0020,
- 0x0040, 0x4013, 0xa186, 0x0029, 0x00c0, 0x3fee, 0x6944, 0xa18c,
- 0xff00, 0x810f, 0x1078, 0x37d7, 0x00c0, 0x3fde, 0x6000, 0xc0e4,
- 0x6002, 0x0078, 0x3fde, 0x685c, 0xa065, 0x0040, 0x3fee, 0x6017,
- 0x0014, 0x0078, 0x3fde, 0x6944, 0x1078, 0x4121, 0x6000, 0xa084,
- 0x0001, 0x0040, 0x4034, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048,
- 0x402e, 0x6206, 0x2091, 0x8001, 0x0078, 0x4102, 0x2091, 0x8001,
- 0x6853, 0x0016, 0x0078, 0x40fb, 0x6853, 0x0007, 0x0078, 0x40fb,
- 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x4042, 0x1078, 0x3da2,
- 0x0078, 0x4054, 0x2030, 0x8001, 0x00c0, 0x404c, 0x7007, 0x0001,
- 0x1078, 0x4055, 0x0078, 0x4054, 0x7007, 0x0006, 0x7012, 0x2d00,
- 0x7016, 0x701a, 0x704b, 0x4055, 0x007c, 0x0e7e, 0x2009, 0x762c,
- 0x210c, 0x81ff, 0x00c0, 0x40d6, 0x2009, 0x760c, 0x210c, 0xd194,
- 0x00c0, 0x40e0, 0x6848, 0x2070, 0xae82, 0x7d00, 0x0048, 0x40c5,
- 0x2001, 0x7615, 0x2004, 0xae02, 0x00c8, 0x40c5, 0x6944, 0x1078,
- 0x4121, 0x6100, 0xa184, 0x0001, 0x0040, 0x40ab, 0xa184, 0x0100,
- 0x00c0, 0x40c9, 0xa184, 0x0200, 0x00c0, 0x40cd, 0x601c, 0xa005,
- 0x00c0, 0x40d1, 0x711c, 0xa186, 0x0006, 0x00c0, 0x40b0, 0x6853,
+ 0x0040, 0x3b86, 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002,
+ 0x0040, 0x3b86, 0xa005, 0x00c0, 0x3b9d, 0x6944, 0x810f, 0xa18c,
+ 0x00ff, 0x1078, 0x3497, 0x00c0, 0x3b9d, 0x067e, 0x6e44, 0xa6b4,
+ 0x000f, 0x1078, 0x352c, 0x067f, 0x0078, 0x3b9d, 0x047e, 0x2011,
+ 0x6f0c, 0x2224, 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078,
+ 0x3497, 0x00c0, 0x3b99, 0x2091, 0x8000, 0x607b, 0x0000, 0x2091,
+ 0x8001, 0x8108, 0x00f0, 0x3b8f, 0x0c7f, 0x1078, 0x12f9, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x6f52, 0x2004,
+ 0xd0a4, 0x0040, 0x3be0, 0x6944, 0x1078, 0x3de1, 0x6100, 0xd184,
+ 0x0040, 0x3bc5, 0x6858, 0xa084, 0x00ff, 0x00c0, 0x3be3, 0x6000,
+ 0xd084, 0x0040, 0x3be0, 0x6004, 0xa005, 0x00c0, 0x3be6, 0x6003,
+ 0x0000, 0x600b, 0x0000, 0x0078, 0x3bdd, 0x2011, 0x0001, 0x6860,
+ 0xa005, 0x00c0, 0x3bcd, 0x2001, 0x001e, 0x8000, 0x6016, 0x6858,
+ 0xa084, 0x00ff, 0x0040, 0x3be0, 0x6006, 0x6858, 0x8007, 0xa084,
+ 0x00ff, 0x0040, 0x3be0, 0x600a, 0x6202, 0x127f, 0x0078, 0x3db4,
+ 0x127f, 0x0078, 0x3dac, 0x127f, 0x0078, 0x3da4, 0x127f, 0x0078,
+ 0x3da8, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001, 0x6f52,
+ 0x2004, 0xd0a4, 0x0040, 0x3c3e, 0x6944, 0x1078, 0x3de1, 0x6000,
+ 0xa084, 0x0001, 0x0040, 0x3c3e, 0x6204, 0x6308, 0x6c48, 0xa484,
+ 0x0003, 0x0040, 0x3c16, 0x6958, 0xa18c, 0x00ff, 0x8001, 0x00c0,
+ 0x3c0f, 0x2100, 0xa210, 0x0048, 0x3c3b, 0x0078, 0x3c16, 0x8001,
+ 0x00c0, 0x3c3b, 0x2100, 0xa212, 0x0048, 0x3c3b, 0xa484, 0x000c,
+ 0x0040, 0x3c30, 0x6958, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004,
+ 0x00c0, 0x3c28, 0x2100, 0xa318, 0x0048, 0x3c3b, 0x0078, 0x3c30,
+ 0xa082, 0x0004, 0x00c0, 0x3c3b, 0x2100, 0xa31a, 0x0048, 0x3c3b,
+ 0x6860, 0xa005, 0x0040, 0x3c36, 0x8000, 0x6016, 0x6206, 0x630a,
+ 0x127f, 0x0078, 0x3db4, 0x127f, 0x0078, 0x3db0, 0x127f, 0x0078,
+ 0x3dac, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x6944, 0x1078,
+ 0x3de1, 0x6308, 0x8318, 0x0048, 0x3c51, 0x630a, 0x127f, 0x0078,
+ 0x3dc2, 0x127f, 0x0078, 0x3db0, 0x127e, 0x0c7e, 0x2091, 0x8000,
+ 0x7007, 0x0001, 0x684c, 0xd0ac, 0x0040, 0x3c68, 0x027e, 0x2009,
+ 0x0000, 0x2011, 0xfcff, 0x1078, 0x4299, 0x027f, 0x0078, 0x3c9e,
+ 0x6858, 0xa005, 0x0040, 0x3cb2, 0x685c, 0xa065, 0x0040, 0x3cae,
+ 0x2001, 0x6f2a, 0x2004, 0xa005, 0x0040, 0x3c7a, 0x1078, 0x62fd,
+ 0x0078, 0x3c80, 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x55c8,
+ 0x6958, 0xa18c, 0xe600, 0xa186, 0x2000, 0x0040, 0x3c96, 0xa186,
+ 0x0400, 0x0040, 0x3c96, 0x6944, 0x0c7e, 0x1078, 0x41f1, 0x6000,
+ 0xa084, 0xfdff, 0x6002, 0x0c7f, 0x0078, 0x3c9e, 0x027e, 0x2009,
+ 0x0000, 0x2011, 0xfdff, 0x1078, 0x4299, 0x027f, 0x684c, 0xd0c4,
+ 0x0040, 0x3caa, 0x6944, 0x1078, 0x41f1, 0x6008, 0x8000, 0x0048,
+ 0x3caa, 0x600a, 0x0c7f, 0x127f, 0x0078, 0x3db4, 0x0c7f, 0x127f,
+ 0x0078, 0x3dac, 0x6954, 0xa186, 0x002a, 0x00c0, 0x3cbe, 0x2001,
+ 0x6f0c, 0x200c, 0xc194, 0x2102, 0x0078, 0x3c9e, 0xa186, 0x0020,
+ 0x0040, 0x3cd3, 0xa186, 0x0029, 0x00c0, 0x3cae, 0x6944, 0xa18c,
+ 0xff00, 0x810f, 0x1078, 0x3497, 0x00c0, 0x3c9e, 0x6000, 0xc0e4,
+ 0x6002, 0x0078, 0x3c9e, 0x685c, 0xa065, 0x0040, 0x3cae, 0x6017,
+ 0x0014, 0x0078, 0x3c9e, 0x6944, 0x1078, 0x3de1, 0x6000, 0xa084,
+ 0x0001, 0x0040, 0x3cf4, 0x2091, 0x8000, 0x6204, 0x8210, 0x0048,
+ 0x3cee, 0x6206, 0x2091, 0x8001, 0x0078, 0x3dc2, 0x2091, 0x8001,
+ 0x6853, 0x0016, 0x0078, 0x3dbb, 0x6853, 0x0007, 0x0078, 0x3dbb,
+ 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x3d02, 0x1078, 0x3a62,
+ 0x0078, 0x3d14, 0x2030, 0x8001, 0x00c0, 0x3d0c, 0x7007, 0x0001,
+ 0x1078, 0x3d15, 0x0078, 0x3d14, 0x7007, 0x0006, 0x7012, 0x2d00,
+ 0x7016, 0x701a, 0x704b, 0x3d15, 0x007c, 0x0e7e, 0x2009, 0x6f2a,
+ 0x210c, 0x81ff, 0x00c0, 0x3d96, 0x2009, 0x6f0c, 0x210c, 0xd194,
+ 0x00c0, 0x3da0, 0x6848, 0x2070, 0xae82, 0x7500, 0x0048, 0x3d85,
+ 0x2001, 0x6f15, 0x2004, 0xae02, 0x00c8, 0x3d85, 0x6944, 0x1078,
+ 0x3de1, 0x6100, 0xa184, 0x0001, 0x0040, 0x3d6b, 0xa184, 0x0100,
+ 0x00c0, 0x3d89, 0xa184, 0x0200, 0x00c0, 0x3d8d, 0x601c, 0xa005,
+ 0x00c0, 0x3d91, 0x711c, 0xa186, 0x0006, 0x00c0, 0x3d70, 0x6853,
0x0000, 0x6803, 0x0000, 0x2d08, 0x127e, 0x2091, 0x8000, 0x7010,
- 0xa005, 0x00c0, 0x40a2, 0x7112, 0x7018, 0xa065, 0x0040, 0x40d5,
- 0x6000, 0xd0e4, 0x00c0, 0x40da, 0x2e60, 0x1078, 0x45c7, 0x127f,
- 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x40a2, 0x6902,
- 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x40fb,
- 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, 0x37d7, 0x00c0, 0x40db,
- 0x6000, 0xd0e4, 0x00c0, 0x40db, 0x711c, 0xa186, 0x0007, 0x00c0,
- 0x40c5, 0x6853, 0x0002, 0x0078, 0x40dd, 0x6853, 0x0008, 0x0078,
- 0x40dd, 0x6853, 0x000e, 0x0078, 0x40dd, 0x6853, 0x0017, 0x0078,
- 0x40dd, 0x6853, 0x0035, 0x0078, 0x40dd, 0x127f, 0x6853, 0x0028,
- 0x0078, 0x40dd, 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x40fb,
- 0x6853, 0x002a, 0x0078, 0x40dd, 0x2009, 0x003e, 0x0078, 0x40f6,
- 0x2009, 0x0004, 0x0078, 0x40f6, 0x2009, 0x0006, 0x0078, 0x40f6,
- 0x2009, 0x0016, 0x0078, 0x40f6, 0x2009, 0x0001, 0x6854, 0xa084,
- 0xff00, 0xa105, 0x6856, 0x2091, 0x8000, 0x1078, 0x3a2c, 0x2091,
- 0x8001, 0x007c, 0x1078, 0x1348, 0x007c, 0x702c, 0x7130, 0x8108,
- 0xa102, 0x0048, 0x4112, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076,
- 0x0078, 0x411e, 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x411e,
+ 0xa005, 0x00c0, 0x3d62, 0x7112, 0x7018, 0xa065, 0x0040, 0x3d95,
+ 0x6000, 0xd0e4, 0x00c0, 0x3d9a, 0x2e60, 0x1078, 0x41fa, 0x127f,
+ 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005, 0x00c0, 0x3d62, 0x6902,
+ 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853, 0x0006, 0x0078, 0x3dbb,
+ 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078, 0x3497, 0x00c0, 0x3d9b,
+ 0x6000, 0xd0e4, 0x00c0, 0x3d9b, 0x711c, 0xa186, 0x0007, 0x00c0,
+ 0x3d85, 0x6853, 0x0002, 0x0078, 0x3d9d, 0x6853, 0x0008, 0x0078,
+ 0x3d9d, 0x6853, 0x000e, 0x0078, 0x3d9d, 0x6853, 0x0017, 0x0078,
+ 0x3d9d, 0x6853, 0x0035, 0x0078, 0x3d9d, 0x127f, 0x6853, 0x0028,
+ 0x0078, 0x3d9d, 0x127f, 0x6853, 0x0029, 0x0e7f, 0x0078, 0x3dbb,
+ 0x6853, 0x002a, 0x0078, 0x3d9d, 0x2009, 0x003e, 0x0078, 0x3db6,
+ 0x2009, 0x0004, 0x0078, 0x3db6, 0x2009, 0x0006, 0x0078, 0x3db6,
+ 0x2009, 0x0016, 0x0078, 0x3db6, 0x2009, 0x0001, 0x6854, 0xa084,
+ 0xff00, 0xa105, 0x6856, 0x2091, 0x8000, 0x1078, 0x36ec, 0x2091,
+ 0x8001, 0x007c, 0x1078, 0x12f9, 0x007c, 0x702c, 0x7130, 0x8108,
+ 0xa102, 0x0048, 0x3dd2, 0xa00e, 0x7034, 0x7072, 0x7038, 0x7076,
+ 0x0078, 0x3dde, 0x7070, 0xa080, 0x0040, 0x7072, 0x00c8, 0x3dde,
0x7074, 0xa081, 0x0000, 0x7076, 0xa085, 0x0001, 0x7932, 0x7132,
- 0x007c, 0x0d7e, 0x1078, 0x45be, 0x0d7f, 0x007c, 0x0d7e, 0x2011,
+ 0x007c, 0x0d7e, 0x1078, 0x41f1, 0x0d7f, 0x007c, 0x0d7e, 0x2011,
0x0004, 0x2204, 0xa085, 0x8002, 0x2012, 0x0d7f, 0x007c, 0x20e1,
0x0002, 0x3d08, 0x20e1, 0x2000, 0x3d00, 0xa084, 0x7000, 0x0040,
- 0x413d, 0xa086, 0x1000, 0x00c0, 0x4159, 0x20e1, 0x0004, 0x3d60,
- 0xd1bc, 0x00c0, 0x4144, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x4159,
- 0xac82, 0x7d00, 0x0048, 0x4159, 0x6854, 0xac02, 0x00c8, 0x4159,
- 0x2009, 0x0047, 0x1078, 0x5bdb, 0x7a1c, 0xd284, 0x00c0, 0x412f,
- 0x007c, 0xa016, 0x1078, 0x1572, 0x0078, 0x4154, 0x157e, 0x137e,
+ 0x3dfd, 0xa086, 0x1000, 0x00c0, 0x3e19, 0x20e1, 0x0004, 0x3d60,
+ 0xd1bc, 0x00c0, 0x3e04, 0x3e60, 0xac84, 0x0007, 0x00c0, 0x3e19,
+ 0xac82, 0x7500, 0x0048, 0x3e19, 0x6854, 0xac02, 0x00c8, 0x3e19,
+ 0x2009, 0x0047, 0x1078, 0x55c8, 0x7a1c, 0xd284, 0x00c0, 0x3def,
+ 0x007c, 0xa016, 0x1078, 0x1523, 0x0078, 0x3e14, 0x157e, 0x137e,
0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28, 0xa584, 0x0070, 0x00c0,
- 0x4187, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x4187, 0x1078,
- 0x4194, 0x0040, 0x4187, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078,
- 0x41b2, 0x147f, 0x137f, 0x157f, 0x2009, 0x783e, 0x2104, 0xa005,
- 0x00c0, 0x4183, 0x007c, 0x1078, 0x4c2c, 0x0078, 0x4182, 0x1078,
- 0x751f, 0x1078, 0x4194, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f,
- 0x137f, 0x157f, 0x0078, 0x4182, 0xa484, 0x01ff, 0x687a, 0xa005,
- 0x0040, 0x41a6, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1,
+ 0x3e47, 0xa484, 0x7000, 0xa086, 0x1000, 0x00c0, 0x3e47, 0x1078,
+ 0x3e54, 0x0040, 0x3e47, 0x20e1, 0x3000, 0x7828, 0x7828, 0x1078,
+ 0x3e72, 0x147f, 0x137f, 0x157f, 0x2009, 0x70be, 0x2104, 0xa005,
+ 0x00c0, 0x3e43, 0x007c, 0x1078, 0x484d, 0x0078, 0x3e42, 0x1078,
+ 0x6dc3, 0x1078, 0x3e54, 0x20e1, 0x3000, 0x7828, 0x7828, 0x147f,
+ 0x137f, 0x157f, 0x0078, 0x3e42, 0xa484, 0x01ff, 0x6872, 0xa005,
+ 0x0040, 0x3e66, 0xa080, 0x001f, 0xa084, 0x03f8, 0x80ac, 0x20e1,
0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0x007c, 0x20a9, 0x000c,
0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5, 0xa085, 0x0001,
- 0x0078, 0x41a5, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007,
- 0xa196, 0x0000, 0x00c0, 0x41bf, 0x0078, 0x4333, 0x007c, 0xa196,
- 0x2000, 0x00c0, 0x41d0, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x41cc,
- 0x1078, 0x2e6a, 0x0078, 0x41be, 0x1078, 0x41d8, 0x0078, 0x41be,
- 0xa196, 0x8000, 0x00c0, 0x41be, 0x1078, 0x43b9, 0x0078, 0x41be,
+ 0x0078, 0x3e65, 0x7000, 0xa084, 0xff00, 0xa08c, 0xf000, 0x8007,
+ 0xa196, 0x0000, 0x00c0, 0x3e7f, 0x0078, 0x3f6b, 0x007c, 0xa196,
+ 0x2000, 0x00c0, 0x3e90, 0x6900, 0xa18e, 0x0001, 0x00c0, 0x3e8c,
+ 0x1078, 0x2b2a, 0x0078, 0x3e7e, 0x1078, 0x3e98, 0x0078, 0x3e7e,
+ 0xa196, 0x8000, 0x00c0, 0x3e7e, 0x1078, 0x3ff1, 0x0078, 0x3e7e,
0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa196, 0x0001, 0x0040,
- 0x41e5, 0xa196, 0x0023, 0x00c0, 0x42da, 0xa08e, 0x0023, 0x00c0,
- 0x4216, 0x1078, 0x4430, 0x0040, 0x42da, 0x7124, 0x610a, 0x7030,
- 0xa08e, 0x0200, 0x00c0, 0x41fe, 0x7034, 0xa005, 0x00c0, 0x42da,
- 0x2009, 0x0015, 0x1078, 0x5bdb, 0x0078, 0x42da, 0xa08e, 0x0210,
- 0x00c0, 0x4208, 0x2009, 0x0015, 0x1078, 0x5bdb, 0x0078, 0x42da,
- 0xa08e, 0x0100, 0x00c0, 0x42da, 0x7034, 0xa005, 0x00c0, 0x42da,
- 0x2009, 0x0016, 0x1078, 0x5bdb, 0x0078, 0x42da, 0xa08e, 0x0022,
- 0x00c0, 0x42da, 0x7030, 0xa08e, 0x0300, 0x00c0, 0x4227, 0x7034,
- 0xa005, 0x00c0, 0x42da, 0x2009, 0x0017, 0x0078, 0x42a6, 0xa08e,
- 0x0500, 0x00c0, 0x4233, 0x7034, 0xa005, 0x00c0, 0x42da, 0x2009,
- 0x0018, 0x0078, 0x42a6, 0xa08e, 0x2010, 0x00c0, 0x423b, 0x2009,
- 0x0019, 0x0078, 0x42a6, 0xa08e, 0x2110, 0x00c0, 0x4243, 0x2009,
- 0x001a, 0x0078, 0x42a6, 0xa08e, 0x5200, 0x00c0, 0x424f, 0x7034,
- 0xa005, 0x00c0, 0x42da, 0x2009, 0x001b, 0x0078, 0x42a6, 0xa08e,
- 0x5000, 0x00c0, 0x425b, 0x7034, 0xa005, 0x00c0, 0x42da, 0x2009,
- 0x001c, 0x0078, 0x42a6, 0xa08e, 0x1200, 0x00c0, 0x4267, 0x7034,
- 0xa005, 0x00c0, 0x42da, 0x2009, 0x0024, 0x0078, 0x42a6, 0xa08c,
- 0xff00, 0xa18e, 0x2400, 0x00c0, 0x4271, 0x2009, 0x002d, 0x0078,
- 0x42a6, 0xa08c, 0xff00, 0xa18e, 0x5300, 0x00c0, 0x427b, 0x2009,
- 0x002a, 0x0078, 0x42a6, 0xa08e, 0x0f00, 0x00c0, 0x4283, 0x2009,
- 0x0020, 0x0078, 0x42a6, 0xa08e, 0x5300, 0x00c0, 0x4289, 0x0078,
- 0x42a4, 0xa08e, 0x6104, 0x00c0, 0x42a4, 0x2011, 0x7b8d, 0x8208,
- 0x2204, 0xa082, 0x0004, 0x20a8, 0x95ac, 0x95ac, 0x2011, 0x8015,
- 0x211c, 0x8108, 0x2124, 0x1078, 0x2d02, 0x8108, 0x00f0, 0x4296,
- 0x2009, 0x0023, 0x0078, 0x42a6, 0x2009, 0x001d, 0x017e, 0x2011,
- 0x7b83, 0x2204, 0x8211, 0x220c, 0x1078, 0x2059, 0x00c0, 0x42dc,
- 0x1078, 0x37a0, 0x00c0, 0x42dc, 0x6612, 0x6516, 0x86ff, 0x0040,
- 0x42cc, 0x017f, 0x017e, 0xa186, 0x0017, 0x00c0, 0x42cc, 0x6864,
- 0xa606, 0x00c0, 0x42cc, 0x6868, 0xa506, 0xa084, 0xff00, 0x00c0,
- 0x42cc, 0x6000, 0xc0f5, 0x6002, 0x0c7e, 0x1078, 0x5b4e, 0x0040,
- 0x42df, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0x017f,
- 0x1078, 0x5bdb, 0x0c7f, 0x007c, 0x017f, 0x0078, 0x42da, 0x0c7f,
- 0x0078, 0x42dc, 0x0e7e, 0x0d7e, 0x2028, 0x2130, 0xa696, 0x00ff,
- 0x00c0, 0x4302, 0xa596, 0xfffd, 0x00c0, 0x42f2, 0x2009, 0x007f,
- 0x0078, 0x432f, 0xa596, 0xfffe, 0x00c0, 0x42fa, 0x2009, 0x007e,
- 0x0078, 0x432f, 0xa596, 0xfffc, 0x00c0, 0x4302, 0x2009, 0x0080,
- 0x0078, 0x432f, 0x2011, 0x0000, 0x2021, 0x007e, 0x20a9, 0x0082,
- 0x2071, 0x779e, 0x2e1c, 0x83ff, 0x00c0, 0x4314, 0x82ff, 0x00c0,
- 0x4323, 0x2410, 0x0078, 0x4323, 0x2368, 0x6b10, 0x007e, 0x2100,
- 0xa31e, 0x007f, 0x00c0, 0x4323, 0x6b14, 0xa31e, 0x00c0, 0x4323,
- 0x2408, 0x0078, 0x432f, 0x8420, 0x8e70, 0x00f0, 0x430a, 0x82ff,
- 0x00c0, 0x432e, 0xa085, 0x0001, 0x0078, 0x4330, 0x2208, 0xa006,
- 0x0d7f, 0x0e7f, 0x007c, 0xa084, 0x0007, 0x0079, 0x4338, 0x007c,
- 0x4340, 0x4340, 0x4340, 0x4340, 0x4340, 0x4341, 0x435a, 0x43a2,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4359, 0x7120, 0x2160, 0xac8c,
- 0x0007, 0x00c0, 0x4359, 0xac8a, 0x7d00, 0x0048, 0x4359, 0x6854,
- 0xac02, 0x00c8, 0x4359, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078,
- 0x5bdb, 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x43a0, 0x2011,
- 0x7b83, 0x2204, 0x8211, 0x220c, 0x1078, 0x2059, 0x00c0, 0x43a0,
- 0x1078, 0x37d7, 0x00c0, 0x43a0, 0x6204, 0xa294, 0xff00, 0x8217,
- 0xa286, 0x0006, 0x00c0, 0x4385, 0x0c7e, 0x1078, 0x5b4e, 0x017f,
- 0x0040, 0x43a0, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009,
- 0x0044, 0x1078, 0x5bdb, 0x0078, 0x43a0, 0x0c7e, 0x1078, 0x5b4e,
- 0x017f, 0x0040, 0x43a0, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
- 0xa286, 0x0004, 0x00c0, 0x4398, 0x6007, 0x0005, 0x0078, 0x439a,
- 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4824, 0x1078, 0x4c2c,
- 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x43b8, 0x7020, 0x2060,
- 0xac84, 0x0007, 0x00c0, 0x43b8, 0xac82, 0x7d00, 0x0048, 0x43b8,
- 0x6854, 0xac02, 0x00c8, 0x43b8, 0x2009, 0x0045, 0x1078, 0x5bdb,
+ 0x3ea5, 0xa196, 0x0023, 0x00c0, 0x3f63, 0xa08e, 0x0023, 0x00c0,
+ 0x3ed6, 0x1078, 0x4063, 0x0040, 0x3f63, 0x7124, 0x610a, 0x7030,
+ 0xa08e, 0x0200, 0x00c0, 0x3ebe, 0x7034, 0xa005, 0x00c0, 0x3f63,
+ 0x2009, 0x0015, 0x1078, 0x55c8, 0x0078, 0x3f63, 0xa08e, 0x0210,
+ 0x00c0, 0x3ec8, 0x2009, 0x0015, 0x1078, 0x55c8, 0x0078, 0x3f63,
+ 0xa08e, 0x0100, 0x00c0, 0x3f63, 0x7034, 0xa005, 0x00c0, 0x3f63,
+ 0x2009, 0x0016, 0x1078, 0x55c8, 0x0078, 0x3f63, 0xa08e, 0x0022,
+ 0x00c0, 0x3f63, 0x7030, 0xa08e, 0x0300, 0x00c0, 0x3ee7, 0x7034,
+ 0xa005, 0x00c0, 0x3f63, 0x2009, 0x0017, 0x0078, 0x3f4b, 0xa08e,
+ 0x0500, 0x00c0, 0x3ef3, 0x7034, 0xa005, 0x00c0, 0x3f63, 0x2009,
+ 0x0018, 0x0078, 0x3f4b, 0xa08e, 0x2010, 0x00c0, 0x3efb, 0x2009,
+ 0x0019, 0x0078, 0x3f4b, 0xa08e, 0x2110, 0x00c0, 0x3f03, 0x2009,
+ 0x001a, 0x0078, 0x3f4b, 0xa08e, 0x5200, 0x00c0, 0x3f0f, 0x7034,
+ 0xa005, 0x00c0, 0x3f63, 0x2009, 0x001b, 0x0078, 0x3f4b, 0xa08e,
+ 0x5000, 0x00c0, 0x3f1b, 0x7034, 0xa005, 0x00c0, 0x3f63, 0x2009,
+ 0x001c, 0x0078, 0x3f4b, 0xa08e, 0x1200, 0x00c0, 0x3f27, 0x7034,
+ 0xa005, 0x00c0, 0x3f63, 0x2009, 0x0024, 0x0078, 0x3f4b, 0xa08c,
+ 0xff00, 0xa18e, 0x2400, 0x00c0, 0x3f31, 0x2009, 0x002d, 0x0078,
+ 0x3f4b, 0xa08c, 0xff00, 0xa18e, 0x5300, 0x00c0, 0x3f3b, 0x2009,
+ 0x002a, 0x0078, 0x3f4b, 0xa08e, 0x0f00, 0x00c0, 0x3f43, 0x2009,
+ 0x0020, 0x0078, 0x3f4b, 0xa08e, 0x5300, 0x00c0, 0x3f49, 0x0078,
+ 0x3f49, 0x2009, 0x001d, 0x017e, 0x2011, 0x7383, 0x2204, 0x1078,
+ 0x1fb0, 0x1078, 0x3460, 0x00c0, 0x3f65, 0x0c7e, 0x1078, 0x553b,
+ 0x0040, 0x3f68, 0x017f, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
+ 0x017f, 0x1078, 0x55c8, 0x0c7f, 0x007c, 0x017f, 0x0078, 0x3f63,
+ 0x0c7f, 0x0078, 0x3f65, 0xa084, 0x0007, 0x0079, 0x3f70, 0x007c,
+ 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f78, 0x3f79, 0x3f92, 0x3fda,
+ 0x007c, 0x7110, 0xd1bc, 0x0040, 0x3f91, 0x7120, 0x2160, 0xac8c,
+ 0x0007, 0x00c0, 0x3f91, 0xac8a, 0x7500, 0x0048, 0x3f91, 0x6854,
+ 0xac02, 0x00c8, 0x3f91, 0x7124, 0x610a, 0x2009, 0x0046, 0x1078,
+ 0x55c8, 0x007c, 0x0c7e, 0x7110, 0xd1bc, 0x00c0, 0x3fd8, 0x2011,
+ 0x7383, 0x2204, 0xa080, 0x21d3, 0x200c, 0xa18c, 0xff00, 0x810f,
+ 0x1078, 0x3497, 0x00c0, 0x3fd8, 0x6204, 0xa294, 0xff00, 0x8217,
+ 0xa286, 0x0006, 0x00c0, 0x3fbd, 0x0c7e, 0x1078, 0x553b, 0x017f,
+ 0x0040, 0x3fd8, 0x611a, 0x601f, 0x0006, 0x7120, 0x610a, 0x2009,
+ 0x0044, 0x1078, 0x55c8, 0x0078, 0x3fd8, 0x0c7e, 0x1078, 0x553b,
+ 0x017f, 0x0040, 0x3fd8, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
+ 0xa286, 0x0004, 0x00c0, 0x3fd0, 0x6007, 0x0005, 0x0078, 0x3fd2,
+ 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4445, 0x1078, 0x484d,
+ 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x3ff0, 0x7020, 0x2060,
+ 0xac84, 0x0007, 0x00c0, 0x3ff0, 0xac82, 0x7500, 0x0048, 0x3ff0,
+ 0x6854, 0xac02, 0x00c8, 0x3ff0, 0x2009, 0x0045, 0x1078, 0x55c8,
0x007c, 0x7110, 0xa18c, 0xff00, 0x810f, 0xa18e, 0x0000, 0x00c0,
- 0x43c9, 0xa084, 0x000f, 0xa08a, 0x0006, 0x10c8, 0x12d5, 0x1079,
- 0x43ca, 0x007c, 0x43d0, 0x43d1, 0x43d0, 0x43d0, 0x4412, 0x4421,
- 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x4411, 0x700c, 0x7108, 0x1078,
- 0x2059, 0x00c0, 0x4411, 0x1078, 0x37a0, 0x00c0, 0x4411, 0x6612,
- 0x6516, 0x6204, 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0,
- 0x43fa, 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x4411, 0x611a,
- 0x601f, 0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x1078, 0x5bdb,
- 0x0078, 0x4411, 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x4411,
- 0x611a, 0x601f, 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0,
- 0x440d, 0x2009, 0x0005, 0x0078, 0x440f, 0x2009, 0x0001, 0x1078,
- 0x5bdb, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4420, 0x1078, 0x4430,
- 0x0040, 0x4420, 0x7124, 0x610a, 0x2009, 0x0089, 0x1078, 0x5bdb,
- 0x007c, 0x7110, 0xd1bc, 0x0040, 0x442f, 0x1078, 0x4430, 0x0040,
- 0x442f, 0x7124, 0x610a, 0x2009, 0x008a, 0x1078, 0x5bdb, 0x007c,
- 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x4443, 0xac82, 0x7d00,
- 0x0048, 0x4443, 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, 0x4443,
- 0xa085, 0x0001, 0x007c, 0xa006, 0x0078, 0x4442, 0x2071, 0x7849,
- 0x7003, 0x0003, 0x700f, 0x0361, 0xa006, 0x701a, 0x7012, 0x7017,
- 0x7d00, 0x7007, 0x0000, 0x7026, 0x702b, 0x5541, 0x7032, 0x7037,
- 0x5582, 0x703b, 0x0002, 0x703f, 0x0000, 0x007c, 0x2071, 0x7849,
- 0x00e0, 0x450d, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x00c0,
- 0x44d6, 0x700f, 0x0361, 0x7007, 0x0001, 0x127e, 0x2091, 0x8000,
- 0x7138, 0x8109, 0x713a, 0x00c0, 0x44d4, 0x703b, 0x0002, 0x2009,
- 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8, 0x44d4, 0x703c, 0xa086,
- 0x0001, 0x00c0, 0x44b1, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084,
- 0x4000, 0x0040, 0x448f, 0x6803, 0x1000, 0x0078, 0x4496, 0x6804,
- 0xa084, 0x1000, 0x0040, 0x4496, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x703f, 0x0000, 0x2069, 0x7836, 0x6804, 0xa082, 0x0006, 0x00c0,
- 0x44a3, 0x6807, 0x0000, 0x6830, 0xa082, 0x0003, 0x00c0, 0x44aa,
- 0x6833, 0x0000, 0x1078, 0x4c2c, 0x1078, 0x4cec, 0x0d7f, 0x0078,
- 0x44d4, 0x0d7e, 0x2069, 0x7600, 0x6944, 0x6860, 0xa102, 0x00c8,
- 0x44d3, 0x2069, 0x7836, 0x6804, 0xa086, 0x0000, 0x00c0, 0x44d3,
- 0x6830, 0xa086, 0x0000, 0x00c0, 0x44d3, 0x703f, 0x0001, 0x6807,
- 0x0006, 0x6833, 0x0003, 0x2069, 0x0100, 0x6830, 0x689e, 0x2069,
- 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078, 0x44d9, 0x127e, 0x2091,
- 0x8000, 0x7024, 0xa00d, 0x0040, 0x44ea, 0x7020, 0x8001, 0x7022,
- 0x00c0, 0x44ea, 0x7023, 0x0009, 0x8109, 0x7126, 0x00c0, 0x44ea,
- 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040, 0x44fb, 0x702c, 0x8001,
- 0x702e, 0x00c0, 0x44fb, 0x702f, 0x0009, 0x8109, 0x7132, 0x00c0,
- 0x44fb, 0x7034, 0x107a, 0x7018, 0xa00d, 0x0040, 0x450c, 0x7008,
- 0x8001, 0x700a, 0x00c0, 0x450c, 0x700b, 0x0009, 0x8109, 0x711a,
- 0x00c0, 0x450c, 0x701c, 0x107a, 0x127f, 0x7004, 0x0079, 0x4510,
- 0x4537, 0x4538, 0x4554, 0x0e7e, 0x2071, 0x7849, 0x7018, 0xa005,
- 0x00c0, 0x451e, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f, 0x007c,
- 0x0e7e, 0x007e, 0x2071, 0x7849, 0x701c, 0xa206, 0x00c0, 0x452a,
- 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7849,
- 0x6088, 0xa102, 0x0048, 0x4535, 0x618a, 0x0e7f, 0x007c, 0x007c,
- 0x7110, 0x1078, 0x37d7, 0x00c0, 0x454a, 0x6088, 0x8001, 0x0048,
- 0x454a, 0x608a, 0x00c0, 0x454a, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4c2c, 0x127f, 0x8108, 0xa182, 0x00ff, 0x0048, 0x4552, 0xa00e,
- 0x7007, 0x0002, 0x7112, 0x007c, 0x7014, 0x2060, 0x127e, 0x2091,
- 0x8000, 0x6014, 0xa005, 0x0040, 0x4583, 0x8001, 0x6016, 0x00c0,
- 0x4583, 0x611c, 0xa186, 0x0003, 0x0040, 0x456a, 0xa186, 0x0006,
- 0x00c0, 0x4581, 0x6010, 0x2068, 0x6854, 0xa08a, 0x199a, 0x0048,
- 0x4581, 0xa082, 0x1999, 0x6856, 0xa08a, 0x199a, 0x0048, 0x457a,
- 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116, 0x0078,
- 0x4583, 0x1078, 0x676e, 0x127f, 0xac88, 0x0008, 0x7116, 0x2001,
- 0x7616, 0x2004, 0xa102, 0x0048, 0x4591, 0x7017, 0x7d00, 0x7007,
- 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7849, 0x7027, 0x07d0, 0x7023,
- 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c, 0x2001, 0x7852, 0x2003,
- 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7849, 0x7033, 0x07d0, 0x702f,
- 0x0009, 0x0e7f, 0x007c, 0x2011, 0x7855, 0x2013, 0x0000, 0x007c,
- 0x0e7e, 0x2071, 0x7849, 0x711a, 0x721e, 0x700b, 0x0009, 0x0e7f,
- 0x007c, 0x0c7e, 0x2061, 0x78da, 0x0c7f, 0x007c, 0xa184, 0x000f,
- 0x8003, 0x8003, 0x8003, 0xa080, 0x78da, 0x2060, 0x007c, 0x6854,
- 0xa08a, 0x199a, 0x0048, 0x45ce, 0x2001, 0x1999, 0xa005, 0x00c0,
- 0x45de, 0x6944, 0x0c7e, 0x1078, 0x45be, 0x6014, 0x0c7f, 0xa005,
- 0x00c0, 0x45e3, 0x2001, 0x001e, 0x0078, 0x45e3, 0xa08e, 0xffff,
- 0x00c0, 0x45e3, 0xa006, 0x8003, 0x800b, 0x810b, 0xa108, 0x6116,
- 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0, 0x0040, 0x461e, 0xd0b4,
- 0x00c0, 0x45fa, 0xd0bc, 0x00c0, 0x460c, 0x2009, 0x0006, 0x1078,
- 0x4641, 0x007c, 0xd0fc, 0x0040, 0x4607, 0xa084, 0x0003, 0xa08e,
- 0x0003, 0x0040, 0x463a, 0xa08e, 0x0000, 0x00c0, 0x463a, 0x2009,
- 0x0043, 0x1078, 0x5bdb, 0x007c, 0xd0fc, 0x0040, 0x4619, 0xa084,
- 0x0003, 0xa08e, 0x0003, 0x0040, 0x463a, 0xa08e, 0x0000, 0x00c0,
- 0x463a, 0x2009, 0x0042, 0x1078, 0x5bdb, 0x007c, 0xd0fc, 0x0040,
- 0x4630, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x463a, 0xa08e,
- 0x0002, 0x0040, 0x4634, 0x2009, 0x0041, 0x1078, 0x5bdb, 0x007c,
- 0x1078, 0x463f, 0x0078, 0x462f, 0x2009, 0x0043, 0x1078, 0x5bdb,
- 0x0078, 0x462f, 0x2009, 0x0004, 0x1078, 0x4641, 0x007c, 0x2009,
- 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040, 0x4665, 0x2068, 0x6952,
- 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0, 0x465f, 0x694c, 0xa18c,
- 0x8100, 0xa18e, 0x8100, 0x00c0, 0x465f, 0x0c7e, 0x6944, 0x1078,
- 0x45be, 0x6204, 0x8210, 0x0048, 0x465e, 0x6206, 0x0c7f, 0x1078,
- 0x3a2c, 0x6010, 0xa06d, 0x10c0, 0x45c7, 0x007c, 0x157e, 0x0c7e,
- 0x20a9, 0x0010, 0x2061, 0x78da, 0x6000, 0x81ff, 0x0040, 0x4673,
- 0xa205, 0x0078, 0x4674, 0xa204, 0x6002, 0xace0, 0x0008, 0x00f0,
- 0x466c, 0x0c7f, 0x157f, 0x007c, 0x6808, 0xa005, 0x0040, 0x4684,
- 0x8001, 0x680a, 0xa085, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200,
- 0x2079, 0x7836, 0x127f, 0x0d7e, 0x2069, 0x7836, 0x6803, 0x0005,
- 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001, 0x206a, 0x0d7f, 0x007c,
- 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084, 0x0007, 0x0079, 0x46a0,
- 0x46aa, 0x46cf, 0x472a, 0x46b0, 0x46cf, 0x46a8, 0x46a8, 0x46a8,
- 0x1078, 0x12d5, 0x1078, 0x459d, 0x1078, 0x4c2c, 0x0c7f, 0x007c,
- 0x62c0, 0x82ff, 0x00c0, 0x46b6, 0x0c7f, 0x007c, 0x2011, 0x34fc,
- 0x1078, 0x4520, 0x7828, 0xa092, 0x0002, 0x00c8, 0x46c5, 0x8000,
- 0x782a, 0x1078, 0x352c, 0x0078, 0x46b4, 0x1078, 0x34fc, 0x7807,
- 0x0003, 0x7827, 0x0000, 0x782b, 0x0000, 0x0078, 0x46b4, 0x1078,
- 0x459d, 0x3c00, 0x007e, 0x2011, 0x0209, 0x20e1, 0x4000, 0x2214,
- 0x007f, 0x20e0, 0x82ff, 0x0040, 0x46ed, 0x62c0, 0x82ff, 0x00c0,
- 0x46ed, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x12d5, 0x2009,
- 0x0013, 0x1078, 0x5bdb, 0x0c7f, 0x007c, 0x3900, 0xa082, 0x797a,
- 0x00c8, 0x46f4, 0x1078, 0x5ade, 0x0c7e, 0x7824, 0xa065, 0x1040,
- 0x12d5, 0x7804, 0xa086, 0x0004, 0x0040, 0x476f, 0x7828, 0xa092,
- 0x2710, 0x00c8, 0x470a, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x5526,
- 0x0078, 0x46eb, 0x6104, 0xa186, 0x0003, 0x00c0, 0x4721, 0x0e7e,
- 0x2071, 0x7600, 0x70c8, 0x0e7f, 0xd08c, 0x0040, 0x4721, 0x0c7e,
- 0x0e7e, 0x2061, 0x0100, 0x2071, 0x7600, 0x1078, 0x3535, 0x0e7f,
- 0x0c7f, 0x1078, 0x7572, 0x2009, 0x0014, 0x1078, 0x5bdb, 0x0c7f,
- 0x0078, 0x46eb, 0x2001, 0x7852, 0x2003, 0x0000, 0x62c0, 0x82ff,
- 0x00c0, 0x473e, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x12d5,
- 0x2009, 0x0013, 0x1078, 0x5c29, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e,
- 0x3900, 0xa082, 0x797a, 0x00c8, 0x4747, 0x1078, 0x5ade, 0x7824,
- 0xa005, 0x1040, 0x12d5, 0x781c, 0xa06d, 0x1040, 0x12d5, 0x6800,
- 0xc0dc, 0x6802, 0x7924, 0x2160, 0x1078, 0x5bb4, 0x693c, 0x81ff,
- 0x1040, 0x12d5, 0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x4763,
- 0x7a1e, 0x0078, 0x4765, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827,
- 0x0000, 0x0d7f, 0x0c7f, 0x1078, 0x4c2c, 0x0078, 0x473c, 0x6104,
- 0xa186, 0x0002, 0x0040, 0x477a, 0xa186, 0x0004, 0x0040, 0x477a,
- 0x0078, 0x46fe, 0x7808, 0xac06, 0x0040, 0x46fe, 0x1078, 0x4b33,
- 0x1078, 0x4824, 0x0c7f, 0x1078, 0x4c2c, 0x0078, 0x46eb, 0x0c7e,
- 0x6027, 0x0002, 0x2011, 0x7855, 0x2013, 0x0000, 0x62c8, 0x82ff,
- 0x00c0, 0x47a1, 0x62c4, 0x82ff, 0x00c0, 0x47a1, 0x793c, 0xa1e5,
- 0x0000, 0x0040, 0x479f, 0x2009, 0x0049, 0x1078, 0x5bdb, 0x0c7f,
- 0x007c, 0x3908, 0xa192, 0x797a, 0x00c8, 0x47a8, 0x1078, 0x5ade,
- 0x6017, 0x0010, 0x793c, 0x81ff, 0x0040, 0x479f, 0x7944, 0xa192,
- 0x7530, 0x00c8, 0x47c7, 0x8108, 0x7946, 0x1078, 0x45a2, 0x793c,
- 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x47c3, 0x6017,
- 0x0012, 0x0078, 0x479f, 0x6017, 0x0016, 0x0078, 0x479f, 0x037e,
- 0x2019, 0x0001, 0x1078, 0x571a, 0x037f, 0x1078, 0x7572, 0x793c,
- 0x2160, 0x2009, 0x004a, 0x1078, 0x5bdb, 0x0078, 0x479f, 0x007e,
- 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
- 0x2061, 0x7836, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005, 0x0040,
- 0x47f2, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f, 0x017f,
- 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x47ed, 0x0d7e, 0x2069,
- 0x7836, 0x6000, 0xd0d4, 0x0040, 0x480b, 0x6820, 0x8000, 0x6822,
- 0xa086, 0x0001, 0x00c0, 0x4806, 0x2c00, 0x681e, 0x6804, 0xa084,
- 0x0007, 0x0079, 0x4c34, 0xc0d5, 0x6002, 0x6818, 0xa005, 0x0040,
- 0x481d, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a, 0x0d7f,
- 0x685a, 0x2069, 0x7836, 0x0078, 0x47fd, 0x6056, 0x605a, 0x2c00,
- 0x681a, 0x681e, 0x0078, 0x47fd, 0x007e, 0x017e, 0x0c7e, 0x127e,
- 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x7836, 0x6020,
- 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x483f, 0xa080, 0x0003,
- 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x610e,
- 0x610a, 0x0078, 0x483a, 0x0c7e, 0x600f, 0x0000, 0x2c08, 0x2061,
- 0x7836, 0x6034, 0xa005, 0x0040, 0x4853, 0xa080, 0x0003, 0x2102,
- 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x4851, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2071,
- 0x7836, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040,
- 0x48b9, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x48b4,
- 0x703c, 0xac06, 0x00c0, 0x4879, 0x6003, 0x000a, 0x630a, 0x0078,
- 0x48b4, 0x7038, 0xac36, 0x00c0, 0x487f, 0x660c, 0x763a, 0x7034,
- 0xac36, 0x00c0, 0x488d, 0x2c00, 0xaf36, 0x0040, 0x488b, 0x2f00,
- 0x7036, 0x0078, 0x488d, 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00,
- 0xaf06, 0x0040, 0x4896, 0x7e0e, 0x0078, 0x4897, 0x2678, 0x600f,
- 0x0000, 0x1078, 0x68e3, 0x0040, 0x48af, 0x6010, 0x2068, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x48c2, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x1078,
- 0x6a4c, 0x0c7f, 0x0078, 0x4866, 0x2c78, 0x600c, 0x2060, 0x0078,
- 0x4866, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x48a4, 0x1078,
- 0x74a8, 0x0078, 0x48af, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x0f7e,
- 0x2031, 0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0x7836, 0x7838,
- 0xa065, 0x0040, 0x4902, 0x600c, 0x007e, 0x600f, 0x0000, 0x783c,
- 0xac06, 0x00c0, 0x48e9, 0x6003, 0x000a, 0x630a, 0x2c30, 0x0078,
- 0x48ff, 0x1078, 0x68e3, 0x0040, 0x48fd, 0x6010, 0x2068, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x490b, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x1078, 0x6a4c, 0x007f,
- 0x0078, 0x48d8, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f, 0x0c7f,
- 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x48f4,
- 0x1078, 0x74a8, 0x0078, 0x48fd, 0x027e, 0x1078, 0x4928, 0x1078,
- 0x49c1, 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x7836, 0x2091,
- 0x8000, 0x1078, 0x4a58, 0x1078, 0x4ac0, 0x127f, 0x0f7f, 0x007c,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7836, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0040,
- 0x49b0, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0, 0x49ab,
- 0x7024, 0xac06, 0x00c0, 0x496e, 0x2069, 0x0100, 0x68c0, 0xa005,
- 0x0040, 0x4969, 0x1078, 0x5534, 0x68c3, 0x0000, 0x1078, 0x59e4,
- 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000,
- 0x0040, 0x495e, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100,
- 0x6824, 0xd084, 0x0040, 0x4966, 0x6827, 0x0001, 0x037f, 0x0078,
- 0x496e, 0x6003, 0x0009, 0x630a, 0x0078, 0x49ab, 0x7014, 0xac36,
- 0x00c0, 0x4974, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x4982,
- 0x2c00, 0xaf36, 0x0040, 0x4980, 0x2f00, 0x7012, 0x0078, 0x4982,
- 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x498b,
- 0x7e0e, 0x0078, 0x498c, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
- 0x1078, 0x68e3, 0x0040, 0x49a4, 0x601c, 0xa086, 0x0003, 0x00c0,
- 0x49b8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6aea,
- 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x1078, 0x6a4c, 0x1078, 0x58b4,
- 0x0c7f, 0x0078, 0x4936, 0x2c78, 0x600c, 0x2060, 0x0078, 0x4936,
- 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c,
- 0x601c, 0xa086, 0x0006, 0x00c0, 0x4999, 0x1078, 0x74a8, 0x0078,
- 0x49a4, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280, 0x7720,
- 0x2004, 0xa065, 0x0040, 0x4a54, 0x0f7e, 0x0e7e, 0x0d7e, 0x067e,
- 0x2071, 0x7836, 0x6654, 0x7018, 0xac06, 0x00c0, 0x49d8, 0x761a,
- 0x701c, 0xac06, 0x00c0, 0x49e4, 0x86ff, 0x00c0, 0x49e3, 0x7018,
- 0x701e, 0x0078, 0x49e4, 0x761e, 0x6058, 0xa07d, 0x0040, 0x49e9,
- 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x49ef, 0x2f00, 0x685a, 0x6057,
- 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078,
- 0x3754, 0x0040, 0x4a50, 0x7624, 0x86ff, 0x0040, 0x4a40, 0xa680,
- 0x0004, 0x2004, 0xad06, 0x00c0, 0x4a40, 0x0d7e, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x4a37, 0x1078, 0x5534, 0x68c3, 0x0000,
- 0x1078, 0x59e4, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x4a20, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4a28, 0x6827, 0x0001,
- 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4a31, 0x8001,
- 0x603e, 0x2660, 0x1078, 0x6a4c, 0x0c7f, 0x0078, 0x4a40, 0x0d7f,
- 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x49f7,
- 0x8dff, 0x0040, 0x4a4c, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x6aea, 0x1078, 0x3a2c, 0x1078, 0x58b4, 0x0078, 0x49f7,
- 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f, 0x007c,
- 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814, 0xa065,
- 0x0040, 0x4ab0, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824, 0xac06,
- 0x00c0, 0x4a95, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4a8f,
- 0x1078, 0x5534, 0x68c3, 0x0000, 0x1078, 0x59e4, 0x7827, 0x0000,
- 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4a84,
+ 0x4001, 0xa084, 0x000f, 0xa08a, 0x0006, 0x10c8, 0x1286, 0x1079,
+ 0x4002, 0x007c, 0x4008, 0x4009, 0x4008, 0x4008, 0x4045, 0x4054,
+ 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x4044, 0x700c, 0x1078, 0x1fb0,
+ 0x1078, 0x3460, 0x00c0, 0x4044, 0x6204, 0xa294, 0xff00, 0x8217,
+ 0xa286, 0x0006, 0x00c0, 0x402d, 0x0c7e, 0x1078, 0x553b, 0x017f,
+ 0x0040, 0x4044, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009,
+ 0x0088, 0x1078, 0x55c8, 0x0078, 0x4044, 0x0c7e, 0x1078, 0x553b,
+ 0x017f, 0x0040, 0x4044, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
+ 0xa286, 0x0004, 0x00c0, 0x4040, 0x2009, 0x0005, 0x0078, 0x4042,
+ 0x2009, 0x0001, 0x1078, 0x55c8, 0x007c, 0x7110, 0xd1bc, 0x0040,
+ 0x4053, 0x1078, 0x4063, 0x0040, 0x4053, 0x7124, 0x610a, 0x2009,
+ 0x0089, 0x1078, 0x55c8, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4062,
+ 0x1078, 0x4063, 0x0040, 0x4062, 0x7124, 0x610a, 0x2009, 0x008a,
+ 0x1078, 0x55c8, 0x007c, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0,
+ 0x4076, 0xac82, 0x7500, 0x0048, 0x4076, 0x2001, 0x6f15, 0x2004,
+ 0xac02, 0x00c8, 0x4076, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078,
+ 0x4075, 0x2071, 0x70c9, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006,
+ 0x701a, 0x7012, 0x7017, 0x7500, 0x7007, 0x0000, 0x7026, 0x702b,
+ 0x4f52, 0x7032, 0x7037, 0x4f9e, 0x703b, 0x0002, 0x703f, 0x0000,
+ 0x007c, 0x2071, 0x70c9, 0x00e0, 0x4140, 0x2091, 0x6000, 0x700c,
+ 0x8001, 0x700e, 0x00c0, 0x4109, 0x700f, 0x0361, 0x7007, 0x0001,
+ 0x127e, 0x2091, 0x8000, 0x7138, 0x8109, 0x713a, 0x00c0, 0x4107,
+ 0x703b, 0x0002, 0x2009, 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8,
+ 0x4107, 0x703c, 0xa086, 0x0001, 0x00c0, 0x40e4, 0x0d7e, 0x2069,
+ 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x40c2, 0x6803, 0x1000,
+ 0x0078, 0x40c9, 0x6804, 0xa084, 0x1000, 0x0040, 0x40c9, 0x6803,
+ 0x0100, 0x6803, 0x0000, 0x703f, 0x0000, 0x2069, 0x70b6, 0x6804,
+ 0xa082, 0x0006, 0x00c0, 0x40d6, 0x6807, 0x0000, 0x6830, 0xa082,
+ 0x0003, 0x00c0, 0x40dd, 0x6833, 0x0000, 0x1078, 0x484d, 0x1078,
+ 0x48fd, 0x0d7f, 0x0078, 0x4107, 0x0d7e, 0x2069, 0x6f00, 0x6944,
+ 0x6860, 0xa102, 0x00c8, 0x4106, 0x2069, 0x70b6, 0x6804, 0xa086,
+ 0x0000, 0x00c0, 0x4106, 0x6830, 0xa086, 0x0000, 0x00c0, 0x4106,
+ 0x703f, 0x0001, 0x6807, 0x0006, 0x6833, 0x0003, 0x2069, 0x0100,
+ 0x6830, 0x689e, 0x2069, 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078,
+ 0x410c, 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x411d,
+ 0x7020, 0x8001, 0x7022, 0x00c0, 0x411d, 0x7023, 0x0009, 0x8109,
+ 0x7126, 0x00c0, 0x411d, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040,
+ 0x412e, 0x702c, 0x8001, 0x702e, 0x00c0, 0x412e, 0x702f, 0x0009,
+ 0x8109, 0x7132, 0x00c0, 0x412e, 0x7034, 0x107a, 0x7018, 0xa00d,
+ 0x0040, 0x413f, 0x7008, 0x8001, 0x700a, 0x00c0, 0x413f, 0x700b,
+ 0x0009, 0x8109, 0x711a, 0x00c0, 0x413f, 0x701c, 0x107a, 0x127f,
+ 0x7004, 0x0079, 0x4143, 0x416a, 0x416b, 0x4187, 0x0e7e, 0x2071,
+ 0x70c9, 0x7018, 0xa005, 0x00c0, 0x4151, 0x711a, 0x721e, 0x700b,
+ 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x70c9, 0x701c,
+ 0xa206, 0x00c0, 0x415d, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c,
+ 0x0e7e, 0x2071, 0x70c9, 0x6088, 0xa102, 0x0048, 0x4168, 0x618a,
+ 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, 0x3497, 0x00c0, 0x417d,
+ 0x6088, 0x8001, 0x0048, 0x417d, 0x608a, 0x00c0, 0x417d, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x8108, 0xa182, 0x007e,
+ 0x0048, 0x4185, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014,
+ 0x2060, 0x127e, 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x41b6,
+ 0x8001, 0x6016, 0x00c0, 0x41b6, 0x611c, 0xa186, 0x0003, 0x0040,
+ 0x419d, 0xa186, 0x0006, 0x00c0, 0x41b4, 0x6010, 0x2068, 0x6854,
+ 0xa08a, 0x199a, 0x0048, 0x41b4, 0xa082, 0x1999, 0x6856, 0xa08a,
+ 0x199a, 0x0048, 0x41ad, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b,
+ 0xa108, 0x6116, 0x0078, 0x41b6, 0x1078, 0x6070, 0x127f, 0xac88,
+ 0x0008, 0x7116, 0x2001, 0x6f16, 0x2004, 0xa102, 0x0048, 0x41c4,
+ 0x7017, 0x7500, 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70c9,
+ 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c,
+ 0x2001, 0x70d2, 0x2003, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70c9,
+ 0x7033, 0x07d0, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011, 0x70d5,
+ 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x70c9, 0x711a, 0x721e,
+ 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0c7e, 0x2061, 0x715a, 0x0c7f,
+ 0x007c, 0xa184, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x715a,
+ 0x2060, 0x007c, 0x6854, 0xa08a, 0x199a, 0x0048, 0x4201, 0x2001,
+ 0x1999, 0xa005, 0x00c0, 0x4211, 0x6944, 0x0c7e, 0x1078, 0x41f1,
+ 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x4216, 0x2001, 0x001e, 0x0078,
+ 0x4216, 0xa08e, 0xffff, 0x00c0, 0x4216, 0xa006, 0x8003, 0x800b,
+ 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0,
+ 0x0040, 0x4251, 0xd0b4, 0x00c0, 0x422d, 0xd0bc, 0x00c0, 0x423f,
+ 0x2009, 0x0006, 0x1078, 0x4274, 0x007c, 0xd0fc, 0x0040, 0x423a,
+ 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x426d, 0xa08e, 0x0000,
+ 0x00c0, 0x426d, 0x2009, 0x0043, 0x1078, 0x55c8, 0x007c, 0xd0fc,
+ 0x0040, 0x424c, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x426d,
+ 0xa08e, 0x0000, 0x00c0, 0x426d, 0x2009, 0x0042, 0x1078, 0x55c8,
+ 0x007c, 0xd0fc, 0x0040, 0x4263, 0xa084, 0x0003, 0xa08e, 0x0003,
+ 0x0040, 0x426d, 0xa08e, 0x0002, 0x0040, 0x4267, 0x2009, 0x0041,
+ 0x1078, 0x55c8, 0x007c, 0x1078, 0x4272, 0x0078, 0x4262, 0x2009,
+ 0x0043, 0x1078, 0x55c8, 0x0078, 0x4262, 0x2009, 0x0004, 0x1078,
+ 0x4274, 0x007c, 0x2009, 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040,
+ 0x4298, 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0,
+ 0x4292, 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x4292,
+ 0x0c7e, 0x6944, 0x1078, 0x41f1, 0x6204, 0x8210, 0x0048, 0x4291,
+ 0x6206, 0x0c7f, 0x1078, 0x36ec, 0x6010, 0xa06d, 0x10c0, 0x41fa,
+ 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, 0x2061, 0x715a, 0x6000,
+ 0x81ff, 0x0040, 0x42a6, 0xa205, 0x0078, 0x42a7, 0xa204, 0x6002,
+ 0xace0, 0x0008, 0x00f0, 0x429f, 0x0c7f, 0x157f, 0x007c, 0x6808,
+ 0xa005, 0x0040, 0x42b7, 0x8001, 0x680a, 0xa085, 0x0001, 0x007c,
+ 0x127e, 0x2091, 0x2200, 0x2079, 0x70b6, 0x127f, 0x0d7e, 0x2069,
+ 0x70b6, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085, 0x8001,
+ 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804, 0xa084,
+ 0x0007, 0x0079, 0x42d3, 0x42dd, 0x4302, 0x4351, 0x42e3, 0x4302,
+ 0x42db, 0x42db, 0x42db, 0x1078, 0x1286, 0x1078, 0x41d0, 0x1078,
+ 0x484d, 0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x42e9, 0x0c7f,
+ 0x007c, 0x2011, 0x31bc, 0x1078, 0x4153, 0x7828, 0xa092, 0x0002,
+ 0x00c8, 0x42f8, 0x8000, 0x782a, 0x1078, 0x31ec, 0x0078, 0x42e7,
+ 0x1078, 0x31bc, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000,
+ 0x0078, 0x42e7, 0x1078, 0x41d0, 0x62c0, 0x82ff, 0x00c0, 0x4314,
+ 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1286, 0x2009, 0x0013,
+ 0x1078, 0x55c8, 0x0c7f, 0x007c, 0x3900, 0xa082, 0x71fa, 0x00c8,
+ 0x431b, 0x1078, 0x54cb, 0x0c7e, 0x7824, 0xa065, 0x1040, 0x1286,
+ 0x7804, 0xa086, 0x0004, 0x0040, 0x4396, 0x7828, 0xa092, 0x2710,
+ 0x00c8, 0x4331, 0x8000, 0x782a, 0x0c7f, 0x1078, 0x4f37, 0x0078,
+ 0x4312, 0x6104, 0xa186, 0x0003, 0x00c0, 0x4348, 0x0e7e, 0x2071,
+ 0x6f00, 0x70b4, 0x0e7f, 0xd08c, 0x0040, 0x4348, 0x0c7e, 0x0e7e,
+ 0x2061, 0x0100, 0x2071, 0x6f00, 0x1078, 0x31f5, 0x0e7f, 0x0c7f,
+ 0x1078, 0x6e16, 0x2009, 0x0014, 0x1078, 0x55c8, 0x0c7f, 0x0078,
+ 0x4312, 0x2001, 0x70d2, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0,
+ 0x4365, 0x782b, 0x0000, 0x7824, 0xa065, 0x1040, 0x1286, 0x2009,
+ 0x0013, 0x1078, 0x5615, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900,
+ 0xa082, 0x71fa, 0x00c8, 0x436e, 0x1078, 0x54cb, 0x7824, 0xa005,
+ 0x1040, 0x1286, 0x781c, 0xa06d, 0x1040, 0x1286, 0x6800, 0xc0dc,
+ 0x6802, 0x7924, 0x2160, 0x1078, 0x55a1, 0x693c, 0x81ff, 0x1040,
+ 0x1286, 0x8109, 0x693e, 0x6854, 0xa015, 0x0040, 0x438a, 0x7a1e,
+ 0x0078, 0x438c, 0x7918, 0x791e, 0x7807, 0x0000, 0x7827, 0x0000,
+ 0x0d7f, 0x0c7f, 0x1078, 0x484d, 0x0078, 0x4363, 0x6104, 0xa186,
+ 0x0002, 0x0040, 0x43a1, 0xa186, 0x0004, 0x0040, 0x43a1, 0x0078,
+ 0x4325, 0x7808, 0xac06, 0x0040, 0x4325, 0x1078, 0x4754, 0x1078,
+ 0x4445, 0x0c7f, 0x1078, 0x484d, 0x0078, 0x4312, 0x0c7e, 0x6027,
+ 0x0002, 0x2011, 0x70d5, 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0,
+ 0x43c8, 0x62c4, 0x82ff, 0x00c0, 0x43c8, 0x793c, 0xa1e5, 0x0000,
+ 0x0040, 0x43c6, 0x2009, 0x0049, 0x1078, 0x55c8, 0x0c7f, 0x007c,
+ 0x3908, 0xa192, 0x71fa, 0x00c8, 0x43cf, 0x1078, 0x54cb, 0x6017,
+ 0x0010, 0x793c, 0x81ff, 0x0040, 0x43c6, 0x7944, 0xa192, 0x2710,
+ 0x00c8, 0x43ee, 0x8108, 0x7946, 0x1078, 0x41d5, 0x793c, 0xa188,
+ 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x43ea, 0x6017, 0x0012,
+ 0x0078, 0x43c6, 0x6017, 0x0016, 0x0078, 0x43c6, 0x1078, 0x6e16,
+ 0x793c, 0x2160, 0x2009, 0x004a, 0x1078, 0x55c8, 0x0078, 0x43c6,
+ 0x007e, 0x017e, 0x0c7e, 0x127e, 0x600f, 0x0000, 0x2c08, 0x2061,
+ 0x70b6, 0x2091, 0x8000, 0x6020, 0x8000, 0x6022, 0x6010, 0xa005,
+ 0x0040, 0x4413, 0xa080, 0x0003, 0x2102, 0x6112, 0x127f, 0x0c7f,
+ 0x017f, 0x007f, 0x007c, 0x6116, 0x6112, 0x0078, 0x440e, 0x0d7e,
+ 0x2069, 0x70b6, 0x6000, 0xd0d4, 0x0040, 0x442c, 0x6820, 0x8000,
+ 0x6822, 0xa086, 0x0001, 0x00c0, 0x4427, 0x2c00, 0x681e, 0x6804,
+ 0xa084, 0x0007, 0x0079, 0x4855, 0xc0d5, 0x6002, 0x6818, 0xa005,
+ 0x0040, 0x443e, 0x6056, 0x605b, 0x0000, 0x007e, 0x2c00, 0x681a,
+ 0x0d7f, 0x685a, 0x2069, 0x70b6, 0x0078, 0x441e, 0x6056, 0x605a,
+ 0x2c00, 0x681a, 0x681e, 0x0078, 0x441e, 0x007e, 0x017e, 0x0c7e,
+ 0x127e, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x70b6,
+ 0x6020, 0x8000, 0x6022, 0x6008, 0xa005, 0x0040, 0x4460, 0xa080,
+ 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c,
+ 0x610e, 0x610a, 0x0078, 0x445b, 0x0c7e, 0x600f, 0x0000, 0x2c08,
+ 0x2061, 0x70b6, 0x6034, 0xa005, 0x0040, 0x4474, 0xa080, 0x0003,
+ 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a, 0x6136, 0x0078, 0x4472,
+ 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
+ 0x2071, 0x70b6, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff,
+ 0x0040, 0x44da, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0,
+ 0x44d5, 0x703c, 0xac06, 0x00c0, 0x449a, 0x6003, 0x000a, 0x630a,
+ 0x0078, 0x44d5, 0x7038, 0xac36, 0x00c0, 0x44a0, 0x660c, 0x763a,
+ 0x7034, 0xac36, 0x00c0, 0x44ae, 0x2c00, 0xaf36, 0x0040, 0x44ac,
+ 0x2f00, 0x7036, 0x0078, 0x44ae, 0x7037, 0x0000, 0x660c, 0x067e,
+ 0x2c00, 0xaf06, 0x0040, 0x44b7, 0x7e0e, 0x0078, 0x44b8, 0x2678,
+ 0x600f, 0x0000, 0x1078, 0x61dc, 0x0040, 0x44d0, 0x6010, 0x2068,
+ 0x601c, 0xa086, 0x0003, 0x00c0, 0x44e3, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x639b, 0x1078, 0x36ec, 0x1078, 0x62f0,
+ 0x1078, 0x62fd, 0x0c7f, 0x0078, 0x4487, 0x2c78, 0x600c, 0x2060,
+ 0x0078, 0x4487, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x44c5,
+ 0x1078, 0x6d4c, 0x0078, 0x44d0, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
+ 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091, 0x8000, 0x2079, 0x70b6,
+ 0x7838, 0xa065, 0x0040, 0x4523, 0x600c, 0x007e, 0x600f, 0x0000,
+ 0x783c, 0xac06, 0x00c0, 0x450a, 0x6003, 0x000a, 0x630a, 0x2c30,
+ 0x0078, 0x4520, 0x1078, 0x61dc, 0x0040, 0x451e, 0x6010, 0x2068,
+ 0x601c, 0xa086, 0x0003, 0x00c0, 0x452c, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x1078, 0x62fd,
+ 0x007f, 0x0078, 0x44f9, 0x7e3a, 0x7e36, 0x127f, 0x0f7f, 0x0d7f,
+ 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0,
+ 0x4515, 0x1078, 0x6d4c, 0x0078, 0x451e, 0x027e, 0x1078, 0x4549,
+ 0x1078, 0x45e2, 0x027f, 0x007c, 0x0f7e, 0x127e, 0x2079, 0x70b6,
+ 0x2091, 0x8000, 0x1078, 0x4679, 0x1078, 0x46e1, 0x127f, 0x0f7f,
+ 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x8cff,
+ 0x0040, 0x45d1, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0,
+ 0x45cc, 0x7024, 0xac06, 0x00c0, 0x458f, 0x2069, 0x0100, 0x68c0,
+ 0xa005, 0x0040, 0x458a, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078,
+ 0x53d1, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
+ 0x1000, 0x0040, 0x457f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
+ 0x0100, 0x6824, 0xd084, 0x0040, 0x4587, 0x6827, 0x0001, 0x037f,
+ 0x0078, 0x458f, 0x6003, 0x0009, 0x630a, 0x0078, 0x45cc, 0x7014,
+ 0xac36, 0x00c0, 0x4595, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0,
+ 0x45a3, 0x2c00, 0xaf36, 0x0040, 0x45a1, 0x2f00, 0x7012, 0x0078,
+ 0x45a3, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
+ 0x45ac, 0x7e0e, 0x0078, 0x45ad, 0x2678, 0x600f, 0x0000, 0x6010,
+ 0x2068, 0x1078, 0x61dc, 0x0040, 0x45c5, 0x601c, 0xa086, 0x0003,
+ 0x00c0, 0x45d9, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
+ 0x639b, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x1078, 0x62fd, 0x1078,
+ 0x52a1, 0x0c7f, 0x0078, 0x4557, 0x2c78, 0x600c, 0x2060, 0x0078,
+ 0x4557, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x45ba, 0x1078, 0x6d4c,
+ 0x0078, 0x45c5, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0xa280,
+ 0x7020, 0x2004, 0xa065, 0x0040, 0x4675, 0x0f7e, 0x0e7e, 0x0d7e,
+ 0x067e, 0x2071, 0x70b6, 0x6654, 0x7018, 0xac06, 0x00c0, 0x45f9,
+ 0x761a, 0x701c, 0xac06, 0x00c0, 0x4605, 0x86ff, 0x00c0, 0x4604,
+ 0x7018, 0x701e, 0x0078, 0x4605, 0x761e, 0x6058, 0xa07d, 0x0040,
+ 0x460a, 0x7e56, 0xa6ed, 0x0000, 0x0040, 0x4610, 0x2f00, 0x685a,
+ 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002,
+ 0x1078, 0x3414, 0x0040, 0x4671, 0x7624, 0x86ff, 0x0040, 0x4661,
+ 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4661, 0x0d7e, 0x2069,
+ 0x0100, 0x68c0, 0xa005, 0x0040, 0x4658, 0x1078, 0x4f45, 0x68c3,
+ 0x0000, 0x1078, 0x53d1, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140,
+ 0x6b04, 0xa384, 0x1000, 0x0040, 0x4641, 0x6803, 0x0100, 0x6803,
+ 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4649, 0x6827,
+ 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4652,
+ 0x8001, 0x603e, 0x2660, 0x1078, 0x62fd, 0x0c7f, 0x0078, 0x4661,
+ 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078,
+ 0x4618, 0x8dff, 0x0040, 0x466d, 0x6837, 0x0103, 0x6b4a, 0x6847,
+ 0x0000, 0x1078, 0x639b, 0x1078, 0x36ec, 0x1078, 0x52a1, 0x0078,
+ 0x4618, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f, 0x127f, 0x007f, 0x0c7f,
+ 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x0000, 0x7814,
+ 0xa065, 0x0040, 0x46d1, 0x600c, 0x007e, 0x600f, 0x0000, 0x7824,
+ 0xac06, 0x00c0, 0x46b6, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
+ 0x46b0, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078, 0x53d1, 0x7827,
+ 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040,
+ 0x46a5, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
+ 0xd084, 0x0040, 0x46ad, 0x6827, 0x0001, 0x037f, 0x0078, 0x46b6,
+ 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078, 0x46ce, 0x6010, 0x2068,
+ 0x1078, 0x61dc, 0x0040, 0x46ca, 0x601c, 0xa086, 0x0003, 0x00c0,
+ 0x46d8, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36ec,
+ 0x1078, 0x62f0, 0x1078, 0x62fd, 0x1078, 0x52a1, 0x007f, 0x0078,
+ 0x4680, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c,
+ 0x601c, 0xa086, 0x0006, 0x00c0, 0x46c1, 0x1078, 0x6d4c, 0x0078,
+ 0x46ca, 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040,
+ 0x474d, 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000,
+ 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x3414, 0x0040, 0x474a, 0x7e24,
+ 0x86ff, 0x0040, 0x473c, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0,
+ 0x473c, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4733,
+ 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078, 0x53d1, 0x7827, 0x0000,
+ 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x471c,
0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
- 0x0040, 0x4a8c, 0x6827, 0x0001, 0x037f, 0x0078, 0x4a95, 0x6003,
- 0x0009, 0x630a, 0x2c30, 0x0078, 0x4aad, 0x6010, 0x2068, 0x1078,
- 0x68e3, 0x0040, 0x4aa9, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4ab7,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078,
- 0x6a3f, 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x007f, 0x0078, 0x4a5f,
- 0x7e16, 0x7e12, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x4aa0, 0x1078, 0x74a8, 0x0078, 0x4aa9,
- 0x007e, 0x067e, 0x0c7e, 0x0d7e, 0x7818, 0xa065, 0x0040, 0x4b2c,
- 0x6054, 0x007e, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000, 0xc0d4,
- 0xc0dc, 0x6002, 0x1078, 0x3754, 0x0040, 0x4b29, 0x7e24, 0x86ff,
- 0x0040, 0x4b1b, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0, 0x4b1b,
- 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4b12, 0x1078,
- 0x5534, 0x68c3, 0x0000, 0x1078, 0x59e4, 0x7827, 0x0000, 0x037e,
- 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4afb, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040,
- 0x4b03, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c, 0xa005,
- 0x0040, 0x4b0c, 0x8001, 0x603e, 0x2660, 0x1078, 0x6a4c, 0x0c7f,
- 0x0078, 0x4b1b, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009, 0x630a,
- 0x0c7f, 0x0078, 0x4ad2, 0x8dff, 0x0040, 0x4b25, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078, 0x58b4, 0x0078,
- 0x4ad2, 0x007f, 0x0078, 0x4ac5, 0x781e, 0x781a, 0x0d7f, 0x0c7f,
- 0x067f, 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x7836, 0x7004,
- 0xa084, 0x0007, 0x0079, 0x4b3c, 0x4b46, 0x4b49, 0x4b62, 0x4b7e,
- 0x4bc3, 0x4b46, 0x4b46, 0x4b44, 0x1078, 0x12d5, 0x0c7f, 0x0e7f,
- 0x007c, 0x7024, 0xa065, 0x0040, 0x4b57, 0x7020, 0x8001, 0x7022,
- 0x600c, 0xa015, 0x0040, 0x4b5e, 0x7216, 0x600f, 0x0000, 0x7007,
- 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216, 0x7212,
- 0x0078, 0x4b57, 0x6018, 0x2060, 0x1078, 0x3754, 0x6000, 0xc0dc,
- 0x6002, 0x7020, 0x8001, 0x7022, 0x0040, 0x4b73, 0x6054, 0xa015,
- 0x0040, 0x4b7a, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x7218, 0x721e, 0x0078, 0x4b73, 0x7024, 0xa065,
- 0x0040, 0x4bc0, 0x700c, 0xac06, 0x00c0, 0x4b95, 0x1078, 0x58b4,
- 0x600c, 0xa015, 0x0040, 0x4b91, 0x720e, 0x600f, 0x0000, 0x0078,
- 0x4bbe, 0x720e, 0x720a, 0x0078, 0x4bbe, 0x7014, 0xac06, 0x00c0,
- 0x4ba8, 0x1078, 0x58b4, 0x600c, 0xa015, 0x0040, 0x4ba4, 0x7216,
- 0x600f, 0x0000, 0x0078, 0x4bbe, 0x7216, 0x7212, 0x0078, 0x4bbe,
- 0x6018, 0x2060, 0x1078, 0x3754, 0x6000, 0xc0dc, 0x6002, 0x1078,
- 0x58b4, 0x701c, 0xa065, 0x0040, 0x4bbe, 0x6054, 0xa015, 0x0040,
- 0x4bbc, 0x721e, 0x0078, 0x4bbe, 0x7218, 0x721e, 0x7027, 0x0000,
- 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x4bd0, 0x1078,
- 0x58b4, 0x600c, 0xa015, 0x0040, 0x4bd7, 0x720e, 0x600f, 0x0000,
- 0x1078, 0x59e4, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x720e,
- 0x720a, 0x0078, 0x4bd0, 0x0d7e, 0x2069, 0x7836, 0x6830, 0xa084,
- 0x0003, 0x0079, 0x4be3, 0x4be9, 0x4beb, 0x4c11, 0x4be9, 0x1078,
- 0x12d5, 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001, 0x0040,
- 0x4c07, 0x683c, 0xa065, 0x0040, 0x4bfc, 0x600c, 0xa015, 0x0040,
- 0x4c03, 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000,
- 0x0c7f, 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x4bfc, 0x6843,
- 0x0000, 0x6838, 0xa065, 0x0040, 0x4bfc, 0x6003, 0x0003, 0x0078,
- 0x4bfc, 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c, 0xa065,
- 0x0040, 0x4c29, 0x600c, 0xa015, 0x0040, 0x4c25, 0x6a3a, 0x600f,
- 0x0000, 0x683f, 0x0000, 0x0078, 0x4c29, 0x683f, 0x0000, 0x683a,
- 0x6836, 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x7836, 0x6804,
- 0xa084, 0x0007, 0x0079, 0x4c34, 0x4c3e, 0x4cdb, 0x4cdb, 0x4cdb,
- 0x4cdb, 0x4cdd, 0x4cdb, 0x4c3c, 0x1078, 0x12d5, 0x6820, 0xa005,
- 0x00c0, 0x4c44, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040,
- 0x4c53, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078, 0x4d23,
- 0x0c7f, 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x4c61, 0x6807,
- 0x0001, 0x6826, 0x682b, 0x0000, 0x1078, 0x4d23, 0x0c7f, 0x0d7f,
- 0x007c, 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040, 0x4cd6,
- 0x704c, 0xa00d, 0x0040, 0x4c70, 0x7088, 0xa005, 0x0040, 0x4c88,
- 0x7054, 0xa075, 0x0040, 0x4c79, 0xa20e, 0x0040, 0x4cd6, 0x0078,
- 0x4c7e, 0x6818, 0xa20e, 0x0040, 0x4cd6, 0x2070, 0x704c, 0xa00d,
- 0x0040, 0x4c70, 0x7088, 0xa005, 0x00c0, 0x4c70, 0x2e00, 0x681e,
- 0x733c, 0x7038, 0xa302, 0x00c8, 0x4c70, 0x1078, 0x5b83, 0x0040,
- 0x4cd6, 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180, 0x0015,
- 0x2004, 0xa08a, 0x199a, 0x0048, 0x4c9f, 0x2001, 0x1999, 0x8003,
- 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78, 0x71a0,
- 0xd1bc, 0x0040, 0x4cb8, 0x7100, 0xd1f4, 0x0040, 0x4cb4, 0x7114,
- 0xa18c, 0x00ff, 0x0078, 0x4cbd, 0x2009, 0x0000, 0x0078, 0x4cbd,
- 0xa1e0, 0x2303, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a,
- 0x1078, 0x5174, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002, 0x2f18,
- 0x6b26, 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001, 0x7807,
- 0x0040, 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f, 0x0e7f,
- 0x0c7f, 0x0078, 0x4cd4, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065,
- 0x0040, 0x4ce9, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078,
- 0x4d23, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069, 0x7836,
- 0x6830, 0xa086, 0x0000, 0x00c0, 0x4d0a, 0x6838, 0xa07d, 0x0040,
- 0x4d0a, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e, 0x0f7e,
- 0x2091, 0x2200, 0x027f, 0x1078, 0x1a24, 0x00c0, 0x4d0d, 0x127f,
- 0x1078, 0x5409, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843, 0x0000,
- 0x7803, 0x0002, 0x780c, 0xa015, 0x0040, 0x4d1f, 0x6a3a, 0x780f,
- 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x4d0a, 0x683a,
- 0x6836, 0x0078, 0x4d19, 0x601c, 0xa084, 0x000f, 0x1079, 0x4d29,
- 0x007c, 0x4d32, 0x4d37, 0x503e, 0x5134, 0x4d37, 0x503e, 0x5134,
- 0x4d32, 0x4d37, 0x1078, 0x4b33, 0x1078, 0x4c2c, 0x007c, 0x157e,
- 0x137e, 0x147e, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0030, 0x10c8,
- 0x12d5, 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x4d54, 0x7900,
- 0xd1f4, 0x0040, 0x4d50, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x4d59,
- 0x2009, 0x0000, 0x0078, 0x4d59, 0xa1f8, 0x2303, 0x2f0c, 0xa18c,
- 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0x1079, 0x4d65, 0x0f7f,
- 0x0c7f, 0x147f, 0x137f, 0x157f, 0x007c, 0x4d97, 0x4dcf, 0x4de7,
- 0x4e66, 0x4e93, 0x4e9b, 0x4ebc, 0x4ecd, 0x4ede, 0x4ee6, 0x4ef7,
- 0x4ee6, 0x4f3f, 0x4ecd, 0x4f60, 0x4f68, 0x4ede, 0x4f68, 0x4f79,
- 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x4d95,
- 0x4d95, 0x4d95, 0x4d95, 0x4d95, 0x55f2, 0x5607, 0x562a, 0x564e,
- 0x4ebc, 0x4d95, 0x4ebc, 0x4ee6, 0x4d95, 0x4de7, 0x4e66, 0x4d95,
- 0x5afe, 0x4ee6, 0x4d95, 0x5b21, 0x4ee6, 0x1078, 0x12d5, 0x20a1,
- 0x020b, 0x1078, 0x4f8e, 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e,
- 0x2069, 0x7651, 0x6804, 0xd084, 0x0040, 0x4db1, 0x6828, 0x20a3,
- 0x0000, 0x017e, 0x1078, 0x206e, 0x21a2, 0x017f, 0x0d7f, 0x0078,
- 0x4db6, 0x0d7f, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004,
- 0x2099, 0x7605, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7601, 0x53a6,
- 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x5520, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4f8e, 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x6030, 0xa084, 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099,
- 0x7605, 0x53a6, 0x60c3, 0x0010, 0x1078, 0x5520, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x4f8e, 0x7818, 0xa080, 0x0028, 0x2004, 0xa086,
- 0x007e, 0x00c0, 0x4dfa, 0x20a3, 0x0400, 0x620c, 0xc2b4, 0x620e,
- 0x0078, 0x4dfc, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x4e35, 0x2099, 0x7820,
- 0x33a6, 0x9398, 0x33a6, 0x9398, 0x3304, 0xa084, 0x3fff, 0x20a2,
- 0x9398, 0x33a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x7605, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x7601, 0x53a6, 0x20a9, 0x0010, 0x20a3, 0x0000,
- 0x00f0, 0x4e26, 0x2099, 0x7828, 0x33a6, 0x20a9, 0x0007, 0x20a3,
- 0x0000, 0x00f0, 0x4e2f, 0x0078, 0x4e55, 0x2099, 0x7820, 0x20a9,
- 0x0008, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7605, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x7601, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
- 0x00f0, 0x4e46, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4e4c,
- 0x2099, 0x7828, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3,
- 0x0000, 0x00f0, 0x4e57, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0,
- 0x4e5d, 0x60c3, 0x0074, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x4f8e, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800,
- 0x20a3, 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x0f7e, 0x2079, 0x7651, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4e82,
- 0xa085, 0x0020, 0xd1a4, 0x0040, 0x4e87, 0xa085, 0x0010, 0xa085,
- 0x0002, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4f8e, 0x20a3,
- 0x5000, 0x0078, 0x4dfc, 0x20a1, 0x020b, 0x1078, 0x4f8e, 0x20a3,
- 0x2110, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5005,
- 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0004, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b, 0x1078,
- 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3,
- 0x2a00, 0x60c3, 0x0008, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b,
- 0x1078, 0x5005, 0x20a3, 0x0200, 0x0078, 0x4dfc, 0x20a1, 0x020b,
- 0x1078, 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003,
- 0x7810, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x5520, 0x007c, 0x0d7e,
- 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0210, 0x20a3, 0x0014,
- 0x20a3, 0x0800, 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0,
- 0x4f1d, 0x6998, 0xa184, 0xc000, 0x00c0, 0x4f19, 0xd1ec, 0x0040,
- 0x4f15, 0x20a3, 0x2100, 0x0078, 0x4f1f, 0x20a3, 0x0100, 0x0078,
- 0x4f1f, 0x20a3, 0x0400, 0x0078, 0x4f1f, 0x20a3, 0x0700, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x7651,
- 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4f2f, 0xa085, 0x0020, 0xd1a4,
- 0x0040, 0x4f34, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2,
- 0x20a2, 0x60c3, 0x0014, 0x1078, 0x5520, 0x0d7f, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x5005, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x5520, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0200, 0x0078, 0x4d9d,
- 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000,
- 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x5520,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078,
- 0x5005, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3,
- 0x0000, 0x60c3, 0x0008, 0x1078, 0x5520, 0x007c, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2014, 0xa286,
- 0x007e, 0x00c0, 0x4fa1, 0x20a3, 0x22ff, 0x20a3, 0xfffe, 0x0078,
- 0x4fcf, 0xa286, 0x007f, 0x00c0, 0x4fac, 0x0d7e, 0x20a3, 0x22ff,
- 0x20a3, 0xfffd, 0x0078, 0x4fc3, 0xd2bc, 0x0040, 0x4fcb, 0xa286,
- 0x0080, 0x0d7e, 0x00c0, 0x4fba, 0x20a3, 0x22ff, 0x20a3, 0xfffc,
- 0x0078, 0x4fc3, 0xa2e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x2200,
- 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6,
- 0x0d7f, 0x0078, 0x4fd3, 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3,
- 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078,
- 0x550f, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x20a3, 0x02ff, 0x2011, 0xfffc, 0x22a2, 0x0d7e,
- 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x20a3, 0x2029,
- 0x20a3, 0x0000, 0x0078, 0x4fd7, 0x20a3, 0x0100, 0x20a3, 0x0000,
- 0x20a3, 0xfc02, 0x20a3, 0x0000, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e,
- 0x0048, 0x5024, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085,
- 0x2300, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x502c, 0x20a3, 0x2300, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000,
- 0x1078, 0x550f, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e,
- 0x6004, 0xa08a, 0x0085, 0x1048, 0x12d5, 0xa08a, 0x008c, 0x10c8,
- 0x12d5, 0x6118, 0x2178, 0x79a0, 0xd1bc, 0x0040, 0x505c, 0x7900,
- 0xd1f4, 0x0040, 0x5058, 0x7914, 0xa18c, 0x00ff, 0x0078, 0x5061,
- 0x2009, 0x0000, 0x0078, 0x5061, 0xa1f8, 0x2303, 0x2f0c, 0xa18c,
- 0x00ff, 0x2c78, 0x2061, 0x0100, 0x619a, 0xa082, 0x0085, 0x1079,
- 0x506c, 0x0f7f, 0x0c7f, 0x007c, 0x5075, 0x5080, 0x509a, 0x5073,
- 0x5073, 0x5073, 0x5075, 0x1078, 0x12d5, 0x147e, 0x20a1, 0x020b,
- 0x1078, 0x50ad, 0x60c3, 0x0000, 0x1078, 0x5520, 0x147f, 0x007c,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x50da, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x7808, 0x20a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x000c, 0x1078, 0x5520,
- 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078, 0x5107, 0x20a3,
- 0x0003, 0x20a3, 0x0300, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0004, 0x1078, 0x5520, 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080,
- 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e,
- 0x0048, 0x50cc, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085,
- 0x8100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x50d4, 0x20a3, 0x8100, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0009, 0x20a3, 0x0000,
- 0x0078, 0x4fd7, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
- 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x50f9, 0x0d7e,
- 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x8400, 0x20a2, 0x6814,
- 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078,
- 0x5101, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
- 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x5030, 0x027e,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004,
- 0xa092, 0x007e, 0x0048, 0x5126, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c,
- 0x6810, 0xa085, 0x8500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619,
- 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x512e, 0x20a3, 0x8500,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1,
- 0x20a3, 0x0000, 0x0078, 0x5030, 0x0c7e, 0x0f7e, 0x2c78, 0x7804,
- 0xa08a, 0x0040, 0x1048, 0x12d5, 0xa08a, 0x0050, 0x10c8, 0x12d5,
- 0x7918, 0x2160, 0x61a0, 0xd1bc, 0x0040, 0x5153, 0x6100, 0xd1f4,
- 0x0040, 0x514f, 0x6114, 0xa18c, 0x00ff, 0x0078, 0x5158, 0x2009,
- 0x0000, 0x0078, 0x5158, 0xa1e0, 0x2303, 0x2c0c, 0xa18c, 0x00ff,
- 0x2061, 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x5162, 0x0f7f,
- 0x0c7f, 0x007c, 0x5174, 0x525c, 0x5204, 0x5384, 0x5172, 0x5172,
- 0x5172, 0x5172, 0x5172, 0x5172, 0x5172, 0x57cd, 0x57de, 0x57ef,
- 0x5800, 0x5172, 0x1078, 0x12d5, 0x0d7e, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x51c7, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff,
- 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006,
- 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x5191, 0x20a3, 0x0002, 0x0078,
- 0x519d, 0xd1b4, 0x0040, 0x5198, 0x20a3, 0x0001, 0x0078, 0x519d,
- 0x20a3, 0x0000, 0x2230, 0x0078, 0x519f, 0x6a80, 0x6e7c, 0x20a9,
- 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0,
- 0x51a3, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014,
- 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x7852, 0x2003,
- 0x07d0, 0x2001, 0x7851, 0x2003, 0x0009, 0x2001, 0x7857, 0x2003,
- 0x0002, 0x1078, 0x1504, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210,
- 0xa294, 0x00ff, 0x2202, 0x8217, 0x7818, 0xa080, 0x0028, 0x2004,
- 0xd0bc, 0x0040, 0x51ed, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810,
- 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6,
- 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x51f5, 0x20a3, 0x0600, 0x6198,
- 0x21a2, 0x20a3, 0x0000, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a3,
- 0x0000, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x5224, 0x7810, 0x2068, 0x6860, 0x20a2,
- 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x1078, 0x5520, 0x147f,
- 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x5242,
- 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x0500, 0x20a2,
- 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
- 0x0078, 0x524a, 0x20a3, 0x0500, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000, 0x1078, 0x550f,
- 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x534c, 0x7810, 0x2068, 0xa016, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084, 0xf000, 0x00c0,
- 0x5279, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x5281, 0x0078,
- 0x527c, 0xa006, 0x1079, 0x5281, 0x147f, 0x137f, 0x157f, 0x0d7f,
- 0x007c, 0x528b, 0x52ed, 0x52f1, 0x5314, 0x5321, 0x5333, 0x5337,
- 0x5289, 0x1078, 0x12d5, 0x017e, 0x037e, 0x694c, 0xa18c, 0x0003,
- 0xa186, 0x0000, 0x00c0, 0x529e, 0x6b78, 0x23a2, 0x6868, 0x20a2,
- 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x5318, 0xa186, 0x0001,
- 0x00c0, 0x52e8, 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864, 0x20a2,
- 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009, 0x0018,
- 0xa384, 0x0300, 0x0040, 0x52e7, 0xd3c4, 0x0040, 0x52b9, 0x687c,
- 0xa108, 0xd3cc, 0x0040, 0x52be, 0x6874, 0xa108, 0x157e, 0x20a9,
- 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2, 0x8000, 0x00f0,
- 0x52c3, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184, 0x0003, 0x0040,
- 0x52e7, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
- 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x0898, 0x20a2, 0x1078, 0x550f, 0x22a2, 0x20a3, 0x0000, 0x61c2,
- 0x037f, 0x017f, 0x1078, 0x5520, 0x007c, 0x20a3, 0x0008, 0x0078,
- 0x5316, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2, 0x20a3, 0x0012,
- 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x20a3,
- 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a, 0x22a2, 0x22a2,
- 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3,
- 0x0032, 0x1078, 0x5520, 0x007c, 0x20a3, 0x0028, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018, 0x1078, 0x5520,
- 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0020,
- 0x1078, 0x5520, 0x007c, 0x20a3, 0x0008, 0x0078, 0x5316, 0x037e,
- 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001, 0x00c0,
- 0x5345, 0x22a2, 0x037f, 0x0078, 0x5316, 0x20a3, 0x0800, 0x22a2,
- 0x20a2, 0x037f, 0x0078, 0x5318, 0x027e, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x536a,
- 0x0d7e, 0xa0e8, 0x7720, 0x2d6c, 0x6810, 0xa085, 0x0700, 0x20a2,
- 0x6814, 0x20a2, 0x2069, 0x7619, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
- 0x0078, 0x5372, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000, 0x1078, 0x550f,
+ 0x0040, 0x4724, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c,
+ 0xa005, 0x0040, 0x472d, 0x8001, 0x603e, 0x2660, 0x1078, 0x62fd,
+ 0x0c7f, 0x0078, 0x473c, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009,
+ 0x630a, 0x0c7f, 0x0078, 0x46f3, 0x8dff, 0x0040, 0x4746, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x52a1,
+ 0x0078, 0x46f3, 0x007f, 0x0078, 0x46e6, 0x781e, 0x781a, 0x0d7f,
+ 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e, 0x0c7e, 0x2071, 0x70b6,
+ 0x7004, 0xa084, 0x0007, 0x0079, 0x475d, 0x4767, 0x476a, 0x4783,
+ 0x479f, 0x47e4, 0x4767, 0x4767, 0x4765, 0x1078, 0x1286, 0x0c7f,
+ 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x4778, 0x7020, 0x8001,
+ 0x7022, 0x600c, 0xa015, 0x0040, 0x477f, 0x7216, 0x600f, 0x0000,
+ 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7216,
+ 0x7212, 0x0078, 0x4778, 0x6018, 0x2060, 0x1078, 0x3414, 0x6000,
+ 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022, 0x0040, 0x4794, 0x6054,
+ 0xa015, 0x0040, 0x479b, 0x721e, 0x7007, 0x0000, 0x7027, 0x0000,
+ 0x0c7f, 0x0e7f, 0x007c, 0x7218, 0x721e, 0x0078, 0x4794, 0x7024,
+ 0xa065, 0x0040, 0x47e1, 0x700c, 0xac06, 0x00c0, 0x47b6, 0x1078,
+ 0x52a1, 0x600c, 0xa015, 0x0040, 0x47b2, 0x720e, 0x600f, 0x0000,
+ 0x0078, 0x47df, 0x720e, 0x720a, 0x0078, 0x47df, 0x7014, 0xac06,
+ 0x00c0, 0x47c9, 0x1078, 0x52a1, 0x600c, 0xa015, 0x0040, 0x47c5,
+ 0x7216, 0x600f, 0x0000, 0x0078, 0x47df, 0x7216, 0x7212, 0x0078,
+ 0x47df, 0x6018, 0x2060, 0x1078, 0x3414, 0x6000, 0xc0dc, 0x6002,
+ 0x1078, 0x52a1, 0x701c, 0xa065, 0x0040, 0x47df, 0x6054, 0xa015,
+ 0x0040, 0x47dd, 0x721e, 0x0078, 0x47df, 0x7218, 0x721e, 0x7027,
+ 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040, 0x47f1,
+ 0x1078, 0x52a1, 0x600c, 0xa015, 0x0040, 0x47f8, 0x720e, 0x600f,
+ 0x0000, 0x1078, 0x53d1, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c,
+ 0x720e, 0x720a, 0x0078, 0x47f1, 0x0d7e, 0x2069, 0x70b6, 0x6830,
+ 0xa084, 0x0003, 0x0079, 0x4804, 0x480a, 0x480c, 0x4832, 0x480a,
+ 0x1078, 0x1286, 0x0d7f, 0x007c, 0x0c7e, 0x6840, 0xa086, 0x0001,
+ 0x0040, 0x4828, 0x683c, 0xa065, 0x0040, 0x481d, 0x600c, 0xa015,
+ 0x0040, 0x4824, 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f,
+ 0x0000, 0x0c7f, 0x0d7f, 0x007c, 0x683a, 0x6836, 0x0078, 0x481d,
+ 0x6843, 0x0000, 0x6838, 0xa065, 0x0040, 0x481d, 0x6003, 0x0003,
+ 0x0078, 0x481d, 0x0c7e, 0x6843, 0x0000, 0x6847, 0x0000, 0x683c,
+ 0xa065, 0x0040, 0x484a, 0x600c, 0xa015, 0x0040, 0x4846, 0x6a3a,
+ 0x600f, 0x0000, 0x683f, 0x0000, 0x0078, 0x484a, 0x683f, 0x0000,
+ 0x683a, 0x6836, 0x0c7f, 0x0d7f, 0x007c, 0x0d7e, 0x2069, 0x70b6,
+ 0x6804, 0xa084, 0x0007, 0x0079, 0x4855, 0x485f, 0x48ec, 0x48ec,
+ 0x48ec, 0x48ec, 0x48ee, 0x48ec, 0x485d, 0x1078, 0x1286, 0x6820,
+ 0xa005, 0x00c0, 0x4865, 0x0d7f, 0x007c, 0x0c7e, 0x680c, 0xa065,
+ 0x0040, 0x4874, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x1078,
+ 0x4934, 0x0c7f, 0x0d7f, 0x007c, 0x6814, 0xa065, 0x0040, 0x4882,
+ 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x1078, 0x4934, 0x0c7f,
+ 0x0d7f, 0x007c, 0x0e7e, 0x037e, 0x6a1c, 0xa2f5, 0x0000, 0x0040,
+ 0x48e7, 0x704c, 0xa00d, 0x0040, 0x4891, 0x7088, 0xa005, 0x0040,
+ 0x48a9, 0x7054, 0xa075, 0x0040, 0x489a, 0xa20e, 0x0040, 0x48e7,
+ 0x0078, 0x489f, 0x6818, 0xa20e, 0x0040, 0x48e7, 0x2070, 0x704c,
+ 0xa00d, 0x0040, 0x4891, 0x7088, 0xa005, 0x00c0, 0x4891, 0x2e00,
+ 0x681e, 0x733c, 0x7038, 0xa302, 0x00c8, 0x4891, 0x1078, 0x5570,
+ 0x0040, 0x48e7, 0x8318, 0x733e, 0x6112, 0x2e10, 0x621a, 0xa180,
+ 0x0015, 0x2004, 0xa08a, 0x199a, 0x0048, 0x48c0, 0x2001, 0x1999,
+ 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x0f7e, 0x2c78,
+ 0x71a0, 0xa1e0, 0x21d3, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100,
+ 0x619a, 0x1078, 0x4c4b, 0x7300, 0xc3dd, 0x7302, 0x6807, 0x0002,
+ 0x2f18, 0x6b26, 0x682b, 0x0000, 0x781f, 0x0003, 0x7803, 0x0001,
+ 0x7807, 0x0040, 0x0f7f, 0x0e7f, 0x0c7f, 0x0d7f, 0x007c, 0x037f,
+ 0x0e7f, 0x0c7f, 0x0078, 0x48e5, 0x0d7f, 0x007c, 0x0c7e, 0x680c,
+ 0xa065, 0x0040, 0x48fa, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000,
+ 0x1078, 0x4934, 0x0c7f, 0x0d7f, 0x007c, 0x0f7e, 0x0d7e, 0x2069,
+ 0x70b6, 0x6830, 0xa086, 0x0000, 0x00c0, 0x491b, 0x6838, 0xa07d,
+ 0x0040, 0x491b, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x127e,
+ 0x0f7e, 0x2091, 0x2200, 0x027f, 0x1078, 0x1999, 0x00c0, 0x491e,
+ 0x127f, 0x1078, 0x4e78, 0x0d7f, 0x0f7f, 0x007c, 0x127f, 0x6843,
+ 0x0000, 0x7803, 0x0002, 0x780c, 0xa015, 0x0040, 0x4930, 0x6a3a,
+ 0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x491b,
+ 0x683a, 0x6836, 0x0078, 0x492a, 0x601c, 0xa084, 0x0007, 0x1079,
+ 0x493a, 0x007c, 0x4942, 0x4944, 0x4b83, 0x4c1b, 0x4944, 0x4b83,
+ 0x4c1b, 0x4942, 0x1078, 0x1286, 0x157e, 0x137e, 0x147e, 0x0c7e,
+ 0x0f7e, 0x6004, 0xa08a, 0x0030, 0x10c8, 0x1286, 0x6118, 0x2178,
+ 0x79a0, 0xa1f8, 0x21d3, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061,
+ 0x0100, 0x619a, 0x1079, 0x4962, 0x0f7f, 0x0c7f, 0x147f, 0x137f,
+ 0x157f, 0x007c, 0x4994, 0x49cc, 0x49e4, 0x4a1d, 0x4a4a, 0x4a52,
+ 0x4a73, 0x4a84, 0x4a95, 0x4a9d, 0x4aae, 0x4a9d, 0x4af6, 0x4a84,
+ 0x4b17, 0x4b1f, 0x4a95, 0x4b1f, 0x4b30, 0x4992, 0x4992, 0x4992,
+ 0x4992, 0x4992, 0x4992, 0x4992, 0x4992, 0x4992, 0x4992, 0x4992,
+ 0x4992, 0x5018, 0x502d, 0x4992, 0x4992, 0x4992, 0x4992, 0x4a73,
+ 0x4a9d, 0x4992, 0x49e4, 0x4a1d, 0x4992, 0x54eb, 0x4a9d, 0x4992,
+ 0x550e, 0x4a9d, 0x1078, 0x1286, 0x20a1, 0x020b, 0x1078, 0x4b45,
+ 0x20a3, 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x6f51, 0x6804,
+ 0xd084, 0x0040, 0x49ae, 0x6828, 0x20a3, 0x0000, 0x017e, 0x1078,
+ 0x1fb7, 0x21a2, 0x017f, 0x0d7f, 0x0078, 0x49b3, 0x0d7f, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6,
+ 0x20a9, 0x0004, 0x2099, 0x6f01, 0x53a6, 0x20a3, 0x0000, 0x6030,
+ 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x001c, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b45,
+ 0x20a3, 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084,
+ 0x00ff, 0x20a2, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6, 0x60c3,
+ 0x0010, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b45,
+ 0x20a3, 0x0300, 0x20a3, 0x0000, 0x2099, 0x70a0, 0x20a9, 0x0008,
+ 0x53a6, 0x20a9, 0x0004, 0x2099, 0x6f05, 0x53a6, 0x20a9, 0x0004,
+ 0x2099, 0x6f01, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0,
+ 0x49fd, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4a03, 0x2099,
+ 0x70a8, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000,
+ 0x00f0, 0x4a0e, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4a14,
+ 0x60c3, 0x0074, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4b45, 0x20a3, 0x2010, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3,
+ 0x2000, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e,
+ 0x2079, 0x6f51, 0x7904, 0x0f7f, 0xd1ac, 0x00c0, 0x4a39, 0xa085,
+ 0x0020, 0xd1a4, 0x0040, 0x4a3e, 0xa085, 0x0010, 0xa085, 0x0002,
+ 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078,
+ 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b45, 0x20a3, 0x5000,
+ 0x0078, 0x49ea, 0x20a1, 0x020b, 0x1078, 0x4b45, 0x20a3, 0x2110,
+ 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
+ 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b64, 0x20a3,
+ 0x0200, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
+ 0x0004, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078, 0x4b64,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00,
+ 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b, 0x1078,
+ 0x4b64, 0x20a3, 0x0200, 0x0078, 0x49ea, 0x20a1, 0x020b, 0x1078,
+ 0x4b64, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810,
+ 0x20a2, 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c, 0x0d7e, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3,
+ 0x0800, 0x7818, 0x2068, 0x6894, 0xa086, 0x0014, 0x00c0, 0x4ad4,
+ 0x6998, 0xa184, 0xc000, 0x00c0, 0x4ad0, 0xd1ec, 0x0040, 0x4acc,
+ 0x20a3, 0x2100, 0x0078, 0x4ad6, 0x20a3, 0x0100, 0x0078, 0x4ad6,
+ 0x20a3, 0x0400, 0x0078, 0x4ad6, 0x20a3, 0x0700, 0xa006, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x6f51, 0x7904,
+ 0x0f7f, 0xd1ac, 0x00c0, 0x4ae6, 0xa085, 0x0020, 0xd1a4, 0x0040,
+ 0x4aeb, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2,
+ 0x60c3, 0x0014, 0x1078, 0x4f31, 0x0d7f, 0x007c, 0x20a1, 0x020b,
+ 0x1078, 0x4b64, 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x4f31, 0x007c, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0200, 0x0078, 0x499a, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3,
+ 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c,
+ 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a1, 0x020b, 0x1078, 0x4b64,
+ 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000,
+ 0x60c3, 0x0008, 0x1078, 0x4f31, 0x007c, 0x027e, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0129, 0x20a3, 0x0000, 0x1078, 0x4f20,
+ 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x027f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1,
+ 0x4000, 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
+ 0x22a2, 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x4f20, 0x22a2,
+ 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085,
+ 0x1048, 0x1286, 0xa08a, 0x008c, 0x10c8, 0x1286, 0x6118, 0x2178,
+ 0x79a0, 0xa1f8, 0x21d3, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061,
+ 0x0100, 0x619a, 0xa082, 0x0085, 0x1079, 0x4ba1, 0x0f7f, 0x0c7f,
+ 0x007c, 0x4baa, 0x4bb5, 0x4bcf, 0x4ba8, 0x4ba8, 0x4ba8, 0x4baa,
+ 0x1078, 0x1286, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4be2, 0x60c3,
+ 0x0000, 0x1078, 0x4f31, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4bf5, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
+ 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x000c, 0x1078, 0x4f31, 0x147f, 0x007c, 0x147e,
+ 0x20a1, 0x020b, 0x1078, 0x4c08, 0x20a3, 0x0003, 0x20a3, 0x0300,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x4f31,
+ 0x147f, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3,
+ 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
+ 0x0009, 0x20a3, 0x0000, 0x0078, 0x4b56, 0x027e, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x8400, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x4b75,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x8500, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3,
+ 0x0000, 0x0078, 0x4b75, 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a,
+ 0x0040, 0x1048, 0x1286, 0xa08a, 0x0050, 0x10c8, 0x1286, 0x7918,
+ 0x2160, 0x61a0, 0xa1e0, 0x21d3, 0x2c0c, 0xa18c, 0x00ff, 0x2061,
+ 0x0100, 0x619a, 0xa082, 0x0040, 0x1079, 0x4c39, 0x0f7f, 0x0c7f,
+ 0x007c, 0x4c4b, 0x4cfd, 0x4cbe, 0x4e0c, 0x4c49, 0x4c49, 0x4c49,
+ 0x4c49, 0x4c49, 0x4c49, 0x4c49, 0x51ba, 0x51cb, 0x51dc, 0x51ed,
+ 0x4c49, 0x1078, 0x1286, 0x0d7e, 0x157e, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4c9e, 0x7910, 0x2168, 0x6944, 0xa18c, 0x00ff, 0x21a2,
+ 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c, 0xa184, 0x0006, 0x8004,
+ 0x20a2, 0xd1ac, 0x0040, 0x4c68, 0x20a3, 0x0002, 0x0078, 0x4c74,
+ 0xd1b4, 0x0040, 0x4c6f, 0x20a3, 0x0001, 0x0078, 0x4c74, 0x20a3,
+ 0x0000, 0x2230, 0x0078, 0x4c76, 0x6a80, 0x6e7c, 0x20a9, 0x0008,
+ 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2, 0x8000, 0x00f0, 0x4c7a,
+ 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1, 0x9080, 0x6014, 0xa084,
+ 0x0004, 0xa085, 0x0009, 0x6016, 0x2001, 0x70d2, 0x2003, 0x07d0,
+ 0x2001, 0x70d1, 0x2003, 0x0009, 0x2001, 0x70d7, 0x2003, 0x0002,
+ 0x1078, 0x14b5, 0x147f, 0x157f, 0x0d7f, 0x007c, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294,
+ 0x00ff, 0x2202, 0x8217, 0xa006, 0x20a3, 0x0600, 0x6198, 0x21a2,
+ 0x20a2, 0x6130, 0x21a2, 0x20a3, 0x0829, 0x20a2, 0x22a2, 0x20a2,
+ 0x2fa2, 0x20a3, 0xffff, 0x20a2, 0x20a2, 0x007c, 0x0d7e, 0x157e,
+ 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4cde, 0x7810, 0x2068,
+ 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2,
+ 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x1078,
+ 0x4f31, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e, 0x20e1,
+ 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0500, 0x6298, 0x22a2, 0x20a3,
+ 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000, 0x1078,
+ 0x4f20, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3,
+ 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e,
+ 0x147e, 0x20a1, 0x020b, 0x1078, 0x4ded, 0x7810, 0x2068, 0xa016,
+ 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084, 0xf000,
+ 0x00c0, 0x4d1a, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x4d22,
+ 0x0078, 0x4d1d, 0xa006, 0x1079, 0x4d22, 0x147f, 0x137f, 0x157f,
+ 0x0d7f, 0x007c, 0x4d2c, 0x4d8e, 0x4d92, 0x4db5, 0x4dc2, 0x4dd4,
+ 0x4dd8, 0x4d2a, 0x1078, 0x1286, 0x017e, 0x037e, 0x694c, 0xa18c,
+ 0x0003, 0xa186, 0x0000, 0x00c0, 0x4d3f, 0x6b78, 0x23a2, 0x6868,
+ 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x4db9, 0xa186,
+ 0x0001, 0x00c0, 0x4d89, 0x6b78, 0x23a2, 0x6868, 0x20a2, 0x6864,
+ 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2, 0x2009,
+ 0x0018, 0xa384, 0x0300, 0x0040, 0x4d88, 0xd3c4, 0x0040, 0x4d5a,
+ 0x687c, 0xa108, 0xd3cc, 0x0040, 0x4d5f, 0x6874, 0xa108, 0x157e,
+ 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2, 0x8000,
+ 0x00f0, 0x4d64, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184, 0x0003,
+ 0x0040, 0x4d88, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1, 0x4000,
+ 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
+ 0x20a3, 0x0898, 0x20a2, 0x1078, 0x4f20, 0x22a2, 0x20a3, 0x0000,
+ 0x61c2, 0x037f, 0x017f, 0x1078, 0x4f31, 0x007c, 0x20a3, 0x0008,
+ 0x0078, 0x4db7, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2, 0x20a3,
+ 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a, 0x22a2,
+ 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x60c3, 0x0032, 0x1078, 0x4f31, 0x007c, 0x20a3, 0x0028, 0x22a2,
+ 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018, 0x1078,
+ 0x4f31, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
+ 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3,
+ 0x0020, 0x1078, 0x4f31, 0x007c, 0x20a3, 0x0008, 0x0078, 0x4db7,
+ 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff, 0x8001,
+ 0x00c0, 0x4de6, 0x22a2, 0x037f, 0x0078, 0x4db7, 0x20a3, 0x0800,
+ 0x22a2, 0x20a2, 0x037f, 0x0078, 0x4db9, 0x027e, 0x20e1, 0x9080,
+ 0x20e1, 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000,
+ 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000, 0x1078, 0x4f20,
0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000,
0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e, 0x137e, 0x147e,
- 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x5397,
- 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x539f,
- 0x539f, 0x53a1, 0x539f, 0x539f, 0x539f, 0x53c6, 0x539f, 0x1078,
- 0x12d5, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1,
- 0x020b, 0x2009, 0x0003, 0x1078, 0x53d0, 0x0d7e, 0x2069, 0x7651,
- 0x6804, 0xd0bc, 0x0040, 0x53bb, 0x682c, 0xa084, 0x00ff, 0x8007,
- 0x20a2, 0x0078, 0x53bd, 0x20a3, 0x3f00, 0x0d7f, 0x22a2, 0x22a2,
- 0x22a2, 0x60c3, 0x0001, 0x1078, 0x5520, 0x007c, 0x20a1, 0x020b,
- 0x2009, 0x0003, 0x1078, 0x53d0, 0x20a3, 0x7f00, 0x0078, 0x53be,
- 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028,
- 0x2004, 0xd0bc, 0x0040, 0x53ee, 0x0d7e, 0xa0e8, 0x7720, 0x2d6c,
- 0x6810, 0xa085, 0x0100, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7619,
- 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x53f6, 0x20a3, 0x0100,
- 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0888,
- 0xa18d, 0x0008, 0x21a2, 0x1078, 0x550f, 0x22a2, 0x20a3, 0x0000,
- 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x057e, 0x047e, 0x037e, 0x2061,
- 0x0100, 0x2071, 0x7600, 0x6130, 0x7818, 0x2068, 0x68a0, 0x2028,
- 0xd0bc, 0x00c0, 0x5422, 0xa080, 0x2303, 0x2014, 0xa294, 0x00ff,
- 0x0078, 0x5426, 0x6910, 0x6a14, 0x7364, 0x7468, 0x781c, 0xa086,
- 0x0006, 0x0040, 0x547a, 0xd5bc, 0x0040, 0x5436, 0xa185, 0x0100,
- 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x543c, 0x6063, 0x0100,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077, 0x0008,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070, 0x7014,
- 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c,
- 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582,
- 0x0080, 0x0048, 0x546e, 0x6a00, 0xd2f4, 0x0040, 0x546c, 0x6a14,
- 0xa294, 0x00ff, 0x0078, 0x546e, 0x2011, 0x0000, 0x629e, 0x6017,
- 0x0016, 0x1078, 0x45a2, 0x037f, 0x047f, 0x057f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c, 0xa084, 0x0003, 0xa086,
- 0x0002, 0x0040, 0x54c9, 0xd5bc, 0x0040, 0x548e, 0xa185, 0x0100,
- 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x5494, 0x6063, 0x0100,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0880, 0x6077, 0x0008,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7060, 0x608a, 0x705c,
- 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca, 0x686c, 0x60ce, 0x60ab,
- 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048,
- 0x54c4, 0x6a00, 0xd2f4, 0x0040, 0x54c2, 0x6a14, 0xa294, 0x00ff,
- 0x0078, 0x54c4, 0x2011, 0x0000, 0x629e, 0x6017, 0x0012, 0x0078,
- 0x5471, 0xd5bc, 0x0040, 0x54d4, 0xa185, 0x0700, 0x20a2, 0x6266,
- 0x636a, 0x646e, 0x0078, 0x54da, 0x6063, 0x0700, 0x6266, 0x606b,
+ 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079, 0x4e1f,
+ 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x4e27,
+ 0x4e27, 0x4e29, 0x4e27, 0x4e27, 0x4e27, 0x4e4e, 0x4e27, 0x1078,
+ 0x1286, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600, 0x7912, 0x20a1,
+ 0x020b, 0x2009, 0x0003, 0x1078, 0x4e58, 0x0d7e, 0x2069, 0x6f51,
+ 0x6804, 0xd0bc, 0x0040, 0x4e43, 0x682c, 0xa084, 0x00ff, 0x8007,
+ 0x20a2, 0x0078, 0x4e45, 0x20a3, 0x3f00, 0x0d7f, 0x22a2, 0x22a2,
+ 0x22a2, 0x60c3, 0x0001, 0x1078, 0x4f31, 0x007c, 0x20a1, 0x020b,
+ 0x2009, 0x0003, 0x1078, 0x4e58, 0x20a3, 0x7f00, 0x0078, 0x4e46,
+ 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x0100, 0x6298,
+ 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0888, 0xa18d,
+ 0x0008, 0x21a2, 0x1078, 0x4f20, 0x22a2, 0x20a3, 0x0000, 0x7a08,
+ 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c,
+ 0x0e7e, 0x0d7e, 0x0c7e, 0x2061, 0x0100, 0x2071, 0x6f00, 0x6130,
+ 0x7818, 0x2068, 0x68a0, 0xa080, 0x21d3, 0x2014, 0xa294, 0x00ff,
+ 0x781c, 0xa086, 0x0006, 0x0040, 0x4ebf, 0x6063, 0x0100, 0x6266,
+ 0x606b, 0x0000, 0x616e, 0x6073, 0x0809, 0x6077, 0x0008, 0x688c,
+ 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000,
+ 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810, 0x2070, 0x7014, 0x608a,
+ 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce,
+ 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017,
+ 0x0016, 0x1078, 0x41d5, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810,
+ 0x2070, 0x704c, 0xa084, 0x0003, 0xa086, 0x0002, 0x0040, 0x4ef4,
+ 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0880,
+ 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
+ 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7060,
+ 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca, 0x686c,
+ 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x629e,
+ 0x6017, 0x0012, 0x0078, 0x4eb9, 0x6063, 0x0700, 0x6266, 0x606b,
0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000, 0x688c, 0x8000,
0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00,
0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c,
0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af,
- 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048, 0x550a, 0x6a00,
- 0xd2f4, 0x0040, 0x5508, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x550a,
- 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078, 0x5471, 0x7a18,
- 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217,
- 0x007c, 0x0d7e, 0x2069, 0x7836, 0x6843, 0x0001, 0x0d7f, 0x007c,
- 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078, 0x552b,
- 0x1078, 0x4592, 0x007c, 0x007e, 0x6014, 0xa084, 0x0004, 0xa085,
- 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061, 0x0100,
- 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f, 0x007f,
- 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078, 0x459d, 0x2061,
- 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x557e,
- 0x1078, 0x5534, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e, 0x2061,
- 0x7836, 0x6128, 0xa192, 0x0002, 0x00c8, 0x556b, 0x8108, 0x612a,
- 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x5579, 0x1078, 0x4592, 0x1078,
- 0x552b, 0x0078, 0x5579, 0x6124, 0xa1e5, 0x0000, 0x0040, 0x5576,
- 0x1078, 0x7572, 0x2009, 0x0014, 0x1078, 0x5bdb, 0x0c7f, 0x0078,
- 0x5579, 0x027f, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x1078, 0x3535,
- 0x0078, 0x5579, 0x0c7e, 0x0d7e, 0x0e7e, 0x017e, 0x027e, 0x1078,
- 0x45ab, 0x2071, 0x7836, 0x713c, 0x81ff, 0x0040, 0x55ac, 0x2061,
- 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040, 0x55b2,
- 0x6803, 0x1000, 0x6803, 0x0000, 0x037e, 0x2019, 0x0001, 0x1078,
- 0x571a, 0x037f, 0x713c, 0x2160, 0x1078, 0x7572, 0x2009, 0x004a,
- 0x1078, 0x5bdb, 0x0078, 0x55ac, 0x027f, 0x017f, 0x0e7f, 0x0d7f,
- 0x0c7f, 0x007c, 0x7144, 0xa192, 0x0002, 0x00c8, 0x559c, 0x8108,
- 0x7146, 0x1078, 0x45a2, 0x0078, 0x55ac, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018,
- 0x2068, 0x6ca0, 0x2071, 0x7836, 0x7018, 0x2068, 0x8dff, 0x0040,
- 0x55e9, 0x68a0, 0xa406, 0x0040, 0x55d9, 0x6854, 0x2068, 0x0078,
- 0x55ce, 0x6010, 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f,
- 0x2d60, 0x1078, 0x38ab, 0x0040, 0x55e9, 0x1078, 0x58b4, 0xa085,
- 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4f8e,
- 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
- 0x60c3, 0x0008, 0x1078, 0x5520, 0x147f, 0x157f, 0x007c, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0200, 0x20a3,
- 0x0000, 0x20a9, 0x0006, 0x2011, 0x7640, 0x2019, 0x7641, 0x23a6,
- 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x5617, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x5520, 0x147f,
- 0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b,
- 0x1078, 0x4fe5, 0x1078, 0x4ffc, 0x7810, 0x007e, 0xa080, 0x0015,
- 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, 0xa080, 0x0004,
- 0x8003, 0x60c2, 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078,
- 0x5520, 0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x4f8e, 0x20a3, 0x6200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x5520,
- 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7836, 0x700c, 0x2060, 0x8cff, 0x0040, 0x567f,
- 0x1078, 0x6a79, 0x00c0, 0x5676, 0x1078, 0x5e09, 0x600c, 0x007e,
- 0x1078, 0x5bb4, 0x1078, 0x58b4, 0x0c7f, 0x0078, 0x566d, 0x700f,
- 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c,
- 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e,
- 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
- 0x7836, 0x7024, 0x2060, 0x8cff, 0x0040, 0x56d8, 0x1078, 0x5534,
- 0x68c3, 0x0000, 0x1078, 0x459d, 0x2009, 0x0013, 0x1078, 0x5bdb,
- 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x56bb, 0x6827, 0x0004,
- 0x7804, 0xa084, 0x4000, 0x0040, 0x56cd, 0x7803, 0x1000, 0x7803,
- 0x0000, 0x0078, 0x56cd, 0xd084, 0x0040, 0x56c2, 0x6827, 0x0001,
- 0x0078, 0x56c4, 0x00f0, 0x56aa, 0x7804, 0xa084, 0x1000, 0x0040,
- 0x56cd, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f,
- 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
- 0x2001, 0x7600, 0x2004, 0xa096, 0x0001, 0x0040, 0x5710, 0xa096,
- 0x0004, 0x0040, 0x5710, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
- 0x34fc, 0x1078, 0x4520, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040,
- 0x56fe, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5710,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5710, 0xd084, 0x0040,
- 0x5705, 0x6827, 0x0001, 0x0078, 0x5707, 0x00f0, 0x56ed, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x5710, 0x7803, 0x0100, 0x7803, 0x0000,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079,
- 0x0140, 0x2071, 0x7836, 0x703c, 0x2060, 0x8cff, 0x0040, 0x5768,
- 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x45ab,
- 0x1078, 0x1bf1, 0xa39d, 0x0000, 0x00c0, 0x5742, 0x2009, 0x0049,
- 0x1078, 0x5bdb, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x5755,
- 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5767, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x0078, 0x5767, 0xd094, 0x0040, 0x575c,
- 0x6827, 0x0002, 0x0078, 0x575e, 0x00f0, 0x5744, 0x7804, 0xa084,
- 0x1000, 0x0040, 0x5767, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x7836,
- 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
- 0x2069, 0x7836, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x7836, 0x7614, 0x2660,
- 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x57c6, 0x601c, 0xa206,
- 0x00c0, 0x57c1, 0x7014, 0xac36, 0x00c0, 0x57a0, 0x660c, 0x7616,
- 0x7010, 0xac36, 0x00c0, 0x57ae, 0x2c00, 0xaf36, 0x0040, 0x57ac,
- 0x2f00, 0x7012, 0x0078, 0x57ae, 0x7013, 0x0000, 0x660c, 0x067e,
- 0x2c00, 0xaf06, 0x0040, 0x57b7, 0x7e0e, 0x0078, 0x57b8, 0x2678,
- 0x600f, 0x0000, 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x0c7f, 0x0078,
- 0x5793, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5793, 0x127f, 0x007f,
- 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
- 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x580f, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x580f, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x580f,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x51c7, 0x7810, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078,
- 0x58bf, 0x60c3, 0x0020, 0x1078, 0x5520, 0x147f, 0x157f, 0x007c,
- 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4,
- 0x00c0, 0x5827, 0xd1bc, 0x00c0, 0x5871, 0x0078, 0x58b1, 0x2009,
- 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140,
- 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040,
- 0x5868, 0x6020, 0xd0b4, 0x0040, 0x5868, 0x6024, 0xd094, 0x00c0,
- 0x5868, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5868,
- 0x00f0, 0x5834, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130,
- 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91,
- 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094,
- 0x00c0, 0x5867, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x585e, 0x027f,
- 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078,
- 0x58b1, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e,
- 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084,
- 0x4000, 0x0040, 0x58aa, 0x6020, 0xd0bc, 0x0040, 0x58aa, 0x2104,
- 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x58aa, 0x00f0, 0x587e,
- 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff,
- 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001,
- 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0,
- 0x58a4, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b,
- 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x7836, 0x7020,
- 0xa005, 0x0040, 0x58bd, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9,
- 0x0008, 0x20a2, 0x00f0, 0x58c1, 0x20a2, 0x20a2, 0x007c, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7836, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001,
- 0x87ff, 0x0040, 0x5957, 0x8cff, 0x0040, 0x5957, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x5952, 0x88ff, 0x0040, 0x58ee, 0x2800, 0xac06,
- 0x00c0, 0x5952, 0x2039, 0x0000, 0x0078, 0x58f2, 0x6018, 0xa206,
- 0x00c0, 0x5952, 0x7024, 0xac06, 0x00c0, 0x5920, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x591b, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x1078, 0x59e4, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x5910, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5918, 0x6827, 0x0001,
- 0x037f, 0x0078, 0x5920, 0x6003, 0x0009, 0x630a, 0x0078, 0x5952,
- 0x7014, 0xac36, 0x00c0, 0x5926, 0x660c, 0x7616, 0x7010, 0xac36,
- 0x00c0, 0x5934, 0x2c00, 0xaf36, 0x0040, 0x5932, 0x2f00, 0x7012,
- 0x0078, 0x5934, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
- 0x0040, 0x593d, 0x7e0e, 0x0078, 0x593e, 0x2678, 0x600f, 0x0000,
- 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x5948, 0x1078, 0x74a8,
- 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x88ff, 0x00c0, 0x5961, 0x0c7f,
- 0x0078, 0x58d8, 0x2c78, 0x600c, 0x2060, 0x0078, 0x58d8, 0xa006,
- 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5958,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x7836, 0x7638, 0x2660, 0x2678, 0x8cff,
- 0x0040, 0x59d3, 0x601c, 0xa086, 0x0006, 0x00c0, 0x59ce, 0x88ff,
- 0x0040, 0x5988, 0x2800, 0xac06, 0x00c0, 0x59ce, 0x0078, 0x598c,
- 0x6018, 0xa206, 0x00c0, 0x59ce, 0x703c, 0xac06, 0x00c0, 0x599e,
- 0x037e, 0x2019, 0x0001, 0x1078, 0x571a, 0x7033, 0x0000, 0x703f,
- 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36,
- 0x00c0, 0x59a4, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x59b2,
- 0x2c00, 0xaf36, 0x0040, 0x59b0, 0x2f00, 0x7036, 0x0078, 0x59b2,
- 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x59bb,
- 0x7e0e, 0x0078, 0x59bc, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
- 0x1078, 0x68e3, 0x0040, 0x59c6, 0x1078, 0x74a8, 0x1078, 0x6a4c,
- 0x88ff, 0x00c0, 0x59dd, 0x0c7f, 0x0078, 0x5977, 0x2c78, 0x600c,
- 0x2060, 0x0078, 0x5977, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f,
- 0xa8c5, 0x0001, 0x0078, 0x59d4, 0x0e7e, 0x2071, 0x7836, 0x2001,
- 0x7600, 0x2004, 0xa086, 0x0002, 0x00c0, 0x59f2, 0x7007, 0x0005,
- 0x0078, 0x59f4, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e,
+ 0x95d5, 0x60d7, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078, 0x4eb9,
+ 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202,
+ 0x8217, 0x007c, 0x0d7e, 0x2069, 0x70b6, 0x6843, 0x0001, 0x0d7f,
+ 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x1078,
+ 0x4f3c, 0x1078, 0x41c5, 0x007c, 0x007e, 0x6014, 0xa084, 0x0004,
+ 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e, 0x2061,
+ 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016, 0x0c7f,
+ 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078, 0x41d0,
+ 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000, 0x0040,
+ 0x4f9a, 0x1078, 0x4f45, 0x6803, 0x1000, 0x6803, 0x0000, 0x0c7e,
+ 0x2061, 0x70b6, 0x6128, 0xa192, 0x0002, 0x00c8, 0x4f87, 0x8108,
+ 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x4f95, 0x1078, 0x41c5,
+ 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0, 0x4f83, 0x6017,
+ 0x0012, 0x0078, 0x4f95, 0x1078, 0x4f3c, 0x0078, 0x4f95, 0x6124,
+ 0xa1e5, 0x0000, 0x0040, 0x4f92, 0x1078, 0x6e16, 0x2009, 0x0014,
+ 0x1078, 0x55c8, 0x0c7f, 0x0078, 0x4f95, 0x027f, 0x017f, 0x0d7f,
+ 0x0c7f, 0x007c, 0x1078, 0x31f5, 0x0078, 0x4f95, 0x0c7e, 0x0d7e,
+ 0x0e7e, 0x017e, 0x027e, 0x1078, 0x41de, 0x2071, 0x70b6, 0x713c,
+ 0x81ff, 0x0040, 0x4fd9, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904,
+ 0x017e, 0x017f, 0xa194, 0x4000, 0x0040, 0x4fdf, 0x6017, 0x0010,
+ 0x7144, 0xa192, 0x0002, 0x00c8, 0x4fd1, 0x8108, 0x7146, 0x1078,
+ 0x41d5, 0x713c, 0xa188, 0x0007, 0x210c, 0xa18e, 0x0006, 0x00c0,
+ 0x4fcd, 0x6017, 0x0012, 0x0078, 0x4fd9, 0x6017, 0x0016, 0x0078,
+ 0x4fd9, 0x1078, 0x6e16, 0x2009, 0x004a, 0x1078, 0x55c8, 0x0078,
+ 0x4fd9, 0x027f, 0x017f, 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x1078,
+ 0x41d5, 0x0078, 0x4fd9, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x057e,
+ 0x047e, 0x007e, 0x127e, 0x2091, 0x8000, 0x6018, 0x2068, 0x6ca0,
+ 0x2071, 0x70b6, 0x7018, 0x2068, 0x8dff, 0x0040, 0x500f, 0x68a0,
+ 0xa406, 0x0040, 0x4fff, 0x6854, 0x2068, 0x0078, 0x4ff4, 0x6010,
+ 0x2060, 0x643c, 0x6540, 0x6644, 0xa6b4, 0x000f, 0x2d60, 0x1078,
+ 0x356b, 0x0040, 0x500f, 0x1078, 0x52a1, 0xa085, 0x0001, 0x127f,
+ 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c,
+ 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4b45, 0x20a3, 0x0f00,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008,
+ 0x1078, 0x4f31, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4b64, 0x20a3, 0x0200, 0x20a3, 0x0000, 0x20a9,
+ 0x0006, 0x2011, 0x6f40, 0x2019, 0x6f41, 0x23a6, 0x22a6, 0xa398,
+ 0x0002, 0xa290, 0x0002, 0x00f0, 0x503d, 0x20a3, 0x0000, 0x20a3,
+ 0x0000, 0x60c3, 0x001c, 0x1078, 0x4f31, 0x147f, 0x157f, 0x007c,
+ 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6,
+ 0x700c, 0x2060, 0x8cff, 0x0040, 0x506c, 0x1078, 0x632a, 0x00c0,
+ 0x5063, 0x1078, 0x579c, 0x600c, 0x007e, 0x1078, 0x55a1, 0x1078,
+ 0x52a1, 0x0c7f, 0x0078, 0x505a, 0x700f, 0x0000, 0x700b, 0x0000,
+ 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c, 0x127e, 0x157e, 0x0f7e,
+ 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e, 0x2091, 0x8000,
+ 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x70b6, 0x7024, 0x2060,
+ 0x8cff, 0x0040, 0x50c5, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078,
+ 0x41d0, 0x2009, 0x0013, 0x1078, 0x55c8, 0x20a9, 0x01f4, 0x6824,
+ 0xd094, 0x0040, 0x50a8, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000,
+ 0x0040, 0x50ba, 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x50ba,
+ 0xd084, 0x0040, 0x50af, 0x6827, 0x0001, 0x0078, 0x50b1, 0x00f0,
+ 0x5097, 0x7804, 0xa084, 0x1000, 0x0040, 0x50ba, 0x7803, 0x0100,
+ 0x7803, 0x0000, 0x6824, 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f,
+ 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x2001, 0x6f00, 0x2004,
+ 0xa096, 0x0001, 0x0040, 0x50fd, 0xa096, 0x0004, 0x0040, 0x50fd,
+ 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x31bc, 0x1078, 0x4153,
+ 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x50eb, 0x6827, 0x0004,
+ 0x7804, 0xa084, 0x4000, 0x0040, 0x50fd, 0x7803, 0x1000, 0x7803,
+ 0x0000, 0x0078, 0x50fd, 0xd084, 0x0040, 0x50f2, 0x6827, 0x0001,
+ 0x0078, 0x50f4, 0x00f0, 0x50da, 0x7804, 0xa084, 0x1000, 0x0040,
+ 0x50fd, 0x7803, 0x0100, 0x7803, 0x0000, 0x007f, 0x017f, 0x027f,
+ 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x127e,
+ 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e, 0x007e,
+ 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x70b6,
+ 0x703c, 0x2060, 0x8cff, 0x0040, 0x5155, 0x6817, 0x0010, 0x68cb,
+ 0x0000, 0x68c7, 0x0000, 0x1078, 0x41de, 0x1078, 0x1b66, 0xa39d,
+ 0x0000, 0x00c0, 0x512f, 0x2009, 0x0049, 0x1078, 0x55c8, 0x20a9,
+ 0x03e8, 0x6824, 0xd094, 0x0040, 0x5142, 0x6827, 0x0004, 0x7804,
+ 0xa084, 0x4000, 0x0040, 0x5154, 0x7803, 0x1000, 0x7803, 0x0000,
+ 0x0078, 0x5154, 0xd094, 0x0040, 0x5149, 0x6827, 0x0002, 0x0078,
+ 0x514b, 0x00f0, 0x5131, 0x7804, 0xa084, 0x1000, 0x0040, 0x5154,
+ 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f, 0x027f,
+ 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c, 0x0d7e,
+ 0x127e, 0x2091, 0x8000, 0x2069, 0x70b6, 0x6a06, 0x127f, 0x0d7f,
+ 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x70b6, 0x6a32,
+ 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, 0x007e,
+ 0x127e, 0x2071, 0x70b6, 0x7614, 0x2660, 0x2678, 0x2091, 0x8000,
+ 0x8cff, 0x0040, 0x51b3, 0x601c, 0xa206, 0x00c0, 0x51ae, 0x7014,
+ 0xac36, 0x00c0, 0x518d, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0,
+ 0x519b, 0x2c00, 0xaf36, 0x0040, 0x5199, 0x2f00, 0x7012, 0x0078,
+ 0x519b, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040,
+ 0x51a4, 0x7e0e, 0x0078, 0x51a5, 0x2678, 0x600f, 0x0000, 0x1078,
+ 0x62fd, 0x1078, 0x52a1, 0x0c7f, 0x0078, 0x5180, 0x2c78, 0x600c,
+ 0x2060, 0x0078, 0x5180, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0e7f,
+ 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x4c9e,
+ 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3,
+ 0x4000, 0x0078, 0x51fc, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078,
+ 0x4c9e, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
+ 0x20a3, 0x2000, 0x0078, 0x51fc, 0x157e, 0x147e, 0x20a1, 0x020b,
+ 0x1078, 0x4c9e, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a3, 0x0400, 0x0078, 0x51fc, 0x157e, 0x147e, 0x20a1,
+ 0x020b, 0x1078, 0x4c9e, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
+ 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078, 0x52ac, 0x60c3, 0x0020,
+ 0x1078, 0x4f31, 0x147f, 0x157f, 0x007c, 0x127e, 0x0c7e, 0x2091,
+ 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4, 0x00c0, 0x5214, 0xd1bc,
+ 0x00c0, 0x525e, 0x0078, 0x529e, 0x2009, 0x017f, 0x200b, 0x00a1,
+ 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009,
+ 0x0169, 0x6804, 0xa084, 0x4000, 0x0040, 0x5255, 0x6020, 0xd0b4,
+ 0x0040, 0x5255, 0x6024, 0xd094, 0x00c0, 0x5255, 0x2104, 0xa084,
+ 0x000f, 0xa086, 0x0004, 0x00c0, 0x5255, 0x00f0, 0x5221, 0x027e,
+ 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, 0xa10d,
+ 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91, 0x6043, 0x0001, 0x6043,
+ 0x0000, 0x608a, 0x628e, 0x6024, 0xd094, 0x00c0, 0x5254, 0x6a04,
+ 0xa294, 0x4000, 0x00c0, 0x524b, 0x027f, 0x0d7f, 0x007f, 0x157f,
+ 0x2009, 0x017f, 0x200b, 0x0000, 0x0078, 0x529e, 0x2009, 0x017f,
+ 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140, 0x20a9,
+ 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040, 0x5297,
+ 0x6020, 0xd0bc, 0x0040, 0x5297, 0x2104, 0xa084, 0x000f, 0xa086,
+ 0x0004, 0x00c0, 0x5297, 0x00f0, 0x526b, 0x027e, 0x6164, 0xa18c,
+ 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c,
+ 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001, 0x6043, 0x0000, 0x608a,
+ 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x5291, 0x027f, 0x0d7f,
+ 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0c7f, 0x127f,
+ 0x007c, 0x0e7e, 0x2071, 0x70b6, 0x7020, 0xa005, 0x0040, 0x52aa,
+ 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9, 0x0008, 0x20a2, 0x00f0,
+ 0x52ae, 0x20a2, 0x20a2, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
+ 0x077e, 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6,
+ 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0040, 0x5344,
+ 0x8cff, 0x0040, 0x5344, 0x601c, 0xa086, 0x0006, 0x00c0, 0x533f,
+ 0x88ff, 0x0040, 0x52db, 0x2800, 0xac06, 0x00c0, 0x533f, 0x2039,
+ 0x0000, 0x0078, 0x52df, 0x6018, 0xa206, 0x00c0, 0x533f, 0x7024,
+ 0xac06, 0x00c0, 0x530d, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040,
+ 0x5308, 0x6817, 0x0008, 0x68c3, 0x0000, 0x1078, 0x53d1, 0x7027,
+ 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040,
+ 0x52fd, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824,
+ 0xd084, 0x0040, 0x5305, 0x6827, 0x0001, 0x037f, 0x0078, 0x530d,
+ 0x6003, 0x0009, 0x630a, 0x0078, 0x533f, 0x7014, 0xac36, 0x00c0,
+ 0x5313, 0x660c, 0x7616, 0x7010, 0xac36, 0x00c0, 0x5321, 0x2c00,
+ 0xaf36, 0x0040, 0x531f, 0x2f00, 0x7012, 0x0078, 0x5321, 0x7013,
+ 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x532a, 0x7e0e,
+ 0x0078, 0x532b, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x5335, 0x1078, 0x6d4c, 0x1078, 0x62fd, 0x1078,
+ 0x52a1, 0x88ff, 0x00c0, 0x534e, 0x0c7f, 0x0078, 0x52c5, 0x2c78,
+ 0x600c, 0x2060, 0x0078, 0x52c5, 0xa006, 0x127f, 0x007f, 0x067f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000,
+ 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5345, 0x0f7e, 0x0e7e, 0x0d7e,
0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7836, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5a34,
- 0x2200, 0xac06, 0x00c0, 0x5a2f, 0x7038, 0xac36, 0x00c0, 0x5a12,
- 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5a20, 0x2c00, 0xaf36,
- 0x0040, 0x5a1e, 0x2f00, 0x7036, 0x0078, 0x5a20, 0x7037, 0x0000,
- 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5a28, 0x7e0e, 0x0078, 0x5a29,
- 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5a34, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x5a05, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7836, 0x760c,
- 0x2660, 0x2678, 0x8cff, 0x0040, 0x5acd, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x5ac8, 0x7024, 0xac06, 0x00c0, 0x5a7b,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5a7b, 0x1078, 0x5534,
- 0x68c3, 0x0000, 0x1078, 0x59e4, 0x7027, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5a72, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5a7a,
- 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x5a81, 0x660c,
- 0x760e, 0x7008, 0xac36, 0x00c0, 0x5a8f, 0x2c00, 0xaf36, 0x0040,
- 0x5a8d, 0x2f00, 0x700a, 0x0078, 0x5a8f, 0x700b, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5a98, 0x7e0e, 0x0078, 0x5a99,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6a65, 0x00c0, 0x5aa3, 0x1078,
- 0x22b1, 0x0078, 0x5abf, 0x1078, 0x6a79, 0x00c0, 0x5aab, 0x1078,
- 0x5e09, 0x0078, 0x5abf, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040,
- 0x5abf, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5ad5, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x6003,
- 0x0000, 0x1078, 0x6a4c, 0x1078, 0x58b4, 0x0c7f, 0x0078, 0x5a4a,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5a4a, 0x127f, 0x007f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006,
- 0x00c0, 0x5ab6, 0x1078, 0x74a8, 0x0078, 0x5abf, 0x037e, 0x157e,
- 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e,
- 0x2123, 0x00c0, 0x5aef, 0x8210, 0x8000, 0x0078, 0x5ae6, 0xa005,
- 0x0040, 0x5af9, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8,
- 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1,
- 0x020b, 0x1078, 0x5005, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3,
- 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c, 0x20a3,
- 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004, 0x20a3,
- 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x5520, 0x0d7f,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x5005, 0x20a3, 0x0210, 0x20a3,
- 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0018, 0x1078, 0x5520, 0x007c, 0x2061, 0x7d00,
- 0x2a70, 0x7060, 0x7046, 0x704b, 0x7d00, 0x007c, 0x0e7e, 0x127e,
- 0x2071, 0x7600, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048,
- 0x5b80, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5b6c,
- 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5b68, 0x0078, 0x5b5b,
- 0x2061, 0x7d00, 0x0078, 0x5b5b, 0x6003, 0x0008, 0x8529, 0x7546,
- 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5b7c, 0x754a, 0xa085,
- 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7d00, 0x0078, 0x5b77,
- 0xa006, 0x0078, 0x5b79, 0x0e7e, 0x2071, 0x7600, 0x7544, 0xa582,
- 0x0001, 0x0048, 0x5bb1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000,
- 0x0040, 0x5b9e, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5b9a,
- 0x0078, 0x5b8d, 0x2061, 0x7d00, 0x0078, 0x5b8d, 0x6003, 0x0008,
- 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5bad,
- 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7d00, 0x0078,
- 0x5ba9, 0xa006, 0x0078, 0x5bab, 0xac82, 0x7d00, 0x1048, 0x12d5,
- 0x2001, 0x7615, 0x2004, 0xac02, 0x10c8, 0x12d5, 0xa006, 0x6006,
- 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003,
- 0x0000, 0x2061, 0x7600, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001,
- 0x0040, 0x5bd3, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c,
- 0x127f, 0x0078, 0x5bd2, 0x601c, 0xa084, 0x000f, 0x0079, 0x5be0,
- 0x5be9, 0x5bf1, 0x5c0d, 0x5c29, 0x6af6, 0x6b12, 0x6b2e, 0x5be9,
- 0x5bf1, 0xa18e, 0x0047, 0x00c0, 0x5bf0, 0xa016, 0x1078, 0x1572,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5bfb, 0x067f, 0x007c, 0x5c0b, 0x5cf2, 0x5e24, 0x5c0b, 0x5e7b,
- 0x5c0b, 0x5c0b, 0x5c0b, 0x5ca1, 0x6127, 0x5c0b, 0x5c0b, 0x5c0b,
- 0x5c0b, 0x5c0b, 0x5c0b, 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x12d5, 0x1079, 0x5c17, 0x067f, 0x007c, 0x5c27,
- 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x5c27, 0x6597,
- 0x665d, 0x5c27, 0x65b0, 0x6609, 0x65b0, 0x6609, 0x5c27, 0x1078,
- 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5c33, 0x067f, 0x007c, 0x5c43, 0x6165, 0x620b, 0x62cd, 0x6421,
- 0x5c43, 0x5c43, 0x5c43, 0x6143, 0x654c, 0x6550, 0x5c43, 0x5c43,
- 0x5c43, 0x5c43, 0x6576, 0x1078, 0x12d5, 0x20a9, 0x000e, 0x2e98,
- 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
- 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5c53, 0x0e7e,
- 0x1078, 0x68e3, 0x0040, 0x5c6a, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x5bb4, 0x007c, 0x0d7e, 0x037e,
- 0x7330, 0xa386, 0x0200, 0x00c0, 0x5c7b, 0x6018, 0x2068, 0x6813,
- 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, 0x5c85, 0x2068,
- 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, 0x5bb4, 0x037f,
- 0x0d7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
- 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x5c9e, 0x6018, 0x2068, 0x7038,
+ 0x70b6, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x53c0, 0x601c,
+ 0xa086, 0x0006, 0x00c0, 0x53bb, 0x88ff, 0x0040, 0x5375, 0x2800,
+ 0xac06, 0x00c0, 0x53bb, 0x0078, 0x5379, 0x6018, 0xa206, 0x00c0,
+ 0x53bb, 0x703c, 0xac06, 0x00c0, 0x538b, 0x037e, 0x2019, 0x0001,
+ 0x1078, 0x5107, 0x7033, 0x0000, 0x703f, 0x0000, 0x7043, 0x0000,
+ 0x7047, 0x0000, 0x037f, 0x7038, 0xac36, 0x00c0, 0x5391, 0x660c,
+ 0x763a, 0x7034, 0xac36, 0x00c0, 0x539f, 0x2c00, 0xaf36, 0x0040,
+ 0x539d, 0x2f00, 0x7036, 0x0078, 0x539f, 0x7037, 0x0000, 0x660c,
+ 0x067e, 0x2c00, 0xaf06, 0x0040, 0x53a8, 0x7e0e, 0x0078, 0x53a9,
+ 0x2678, 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040,
+ 0x53b3, 0x1078, 0x6d4c, 0x1078, 0x62fd, 0x88ff, 0x00c0, 0x53ca,
+ 0x0c7f, 0x0078, 0x5364, 0x2c78, 0x600c, 0x2060, 0x0078, 0x5364,
+ 0xa006, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078,
+ 0x53c1, 0x0e7e, 0x2071, 0x70b6, 0x2001, 0x6f00, 0x2004, 0xa086,
+ 0x0002, 0x00c0, 0x53df, 0x7007, 0x0005, 0x0078, 0x53e1, 0x7007,
+ 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x067e, 0x027e,
+ 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x70b6, 0x2c10, 0x7638,
+ 0x2660, 0x2678, 0x8cff, 0x0040, 0x5421, 0x2200, 0xac06, 0x00c0,
+ 0x541c, 0x7038, 0xac36, 0x00c0, 0x53ff, 0x660c, 0x763a, 0x7034,
+ 0xac36, 0x00c0, 0x540d, 0x2c00, 0xaf36, 0x0040, 0x540b, 0x2f00,
+ 0x7036, 0x0078, 0x540d, 0x7037, 0x0000, 0x660c, 0x2c00, 0xaf06,
+ 0x0040, 0x5415, 0x7e0e, 0x0078, 0x5416, 0x2678, 0x600f, 0x0000,
+ 0xa085, 0x0001, 0x0078, 0x5421, 0x2c78, 0x600c, 0x2060, 0x0078,
+ 0x53f2, 0x127f, 0x007f, 0x027f, 0x067f, 0x0c7f, 0x0e7f, 0x0f7f,
+ 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x007e, 0x127e,
+ 0x2091, 0x8000, 0x2071, 0x70b6, 0x760c, 0x2660, 0x2678, 0x8cff,
+ 0x0040, 0x54ba, 0x6018, 0xa080, 0x0028, 0x2004, 0xa206, 0x00c0,
+ 0x54b5, 0x7024, 0xac06, 0x00c0, 0x5468, 0x2069, 0x0100, 0x68c0,
+ 0xa005, 0x0040, 0x5468, 0x1078, 0x4f45, 0x68c3, 0x0000, 0x1078,
+ 0x53d1, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
+ 0x1000, 0x0040, 0x545f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
+ 0x0100, 0x6824, 0xd084, 0x0040, 0x5467, 0x6827, 0x0001, 0x037f,
+ 0x700c, 0xac36, 0x00c0, 0x546e, 0x660c, 0x760e, 0x7008, 0xac36,
+ 0x00c0, 0x547c, 0x2c00, 0xaf36, 0x0040, 0x547a, 0x2f00, 0x700a,
+ 0x0078, 0x547c, 0x700b, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
+ 0x0040, 0x5485, 0x7e0e, 0x0078, 0x5486, 0x2678, 0x600f, 0x0000,
+ 0x1078, 0x6316, 0x00c0, 0x5490, 0x1078, 0x2192, 0x0078, 0x54ac,
+ 0x1078, 0x632a, 0x00c0, 0x5498, 0x1078, 0x579c, 0x0078, 0x54ac,
+ 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x54ac, 0x601c, 0xa086,
+ 0x0003, 0x00c0, 0x54c2, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
+ 0x1078, 0x36ec, 0x1078, 0x62f0, 0x6003, 0x0000, 0x1078, 0x62fd,
+ 0x1078, 0x52a1, 0x0c7f, 0x0078, 0x5437, 0x2c78, 0x600c, 0x2060,
+ 0x0078, 0x5437, 0x127f, 0x007f, 0x067f, 0x0c7f, 0x0d7f, 0x0e7f,
+ 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x54a3, 0x1078,
+ 0x6d4c, 0x0078, 0x54ac, 0x037e, 0x157e, 0x137e, 0x147e, 0x3908,
+ 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e, 0x206c, 0x00c0, 0x54dc,
+ 0x8210, 0x8000, 0x0078, 0x54d3, 0xa005, 0x0040, 0x54e6, 0x20a9,
+ 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8, 0x53a3, 0x147f, 0x137f,
+ 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x4b64,
+ 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3, 0x0014, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x514c, 0x20a3, 0x4f47, 0x20a3, 0x4943,
+ 0x20a3, 0x2020, 0x20a3, 0x0004, 0x20a3, 0x7878, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x1078, 0x4f31, 0x0d7f, 0x007c, 0x20a1, 0x020b,
+ 0x1078, 0x4b64, 0x20a3, 0x0210, 0x20a3, 0x0018, 0x20a3, 0x0800,
+ 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000,
+ 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7810, 0xa084,
+ 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0018,
+ 0x1078, 0x4f31, 0x007c, 0x2061, 0x7500, 0x2a70, 0x7060, 0x7046,
+ 0x704b, 0x7500, 0x007c, 0x0e7e, 0x127e, 0x2071, 0x6f00, 0x2091,
+ 0x8000, 0x7544, 0xa582, 0x0001, 0x0048, 0x556d, 0x7048, 0x2060,
+ 0x6000, 0xa086, 0x0000, 0x0040, 0x5559, 0xace0, 0x0008, 0x7054,
+ 0xac02, 0x00c8, 0x5555, 0x0078, 0x5548, 0x2061, 0x7500, 0x0078,
+ 0x5548, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054,
+ 0xa502, 0x00c8, 0x5569, 0x754a, 0xa085, 0x0001, 0x127f, 0x0e7f,
+ 0x007c, 0x704b, 0x7500, 0x0078, 0x5564, 0xa006, 0x0078, 0x5566,
+ 0x0e7e, 0x2071, 0x6f00, 0x7544, 0xa582, 0x0001, 0x0048, 0x559e,
+ 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x558b, 0xace0,
+ 0x0008, 0x7054, 0xac02, 0x00c8, 0x5587, 0x0078, 0x557a, 0x2061,
+ 0x7500, 0x0078, 0x557a, 0x6003, 0x0008, 0x8529, 0x7546, 0xaca8,
+ 0x0008, 0x7054, 0xa502, 0x00c8, 0x559a, 0x754a, 0xa085, 0x0001,
+ 0x0e7f, 0x007c, 0x704b, 0x7500, 0x0078, 0x5596, 0xa006, 0x0078,
+ 0x5598, 0xac82, 0x7500, 0x1048, 0x1286, 0x2001, 0x6f15, 0x2004,
+ 0xac02, 0x10c8, 0x1286, 0xa006, 0x6006, 0x600a, 0x600e, 0x6012,
+ 0x6016, 0x601a, 0x601f, 0x0000, 0x6003, 0x0000, 0x2061, 0x6f00,
+ 0x6044, 0x8000, 0x6046, 0xa086, 0x0001, 0x0040, 0x55c0, 0x007c,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x0078, 0x55bf,
+ 0x601c, 0xa084, 0x0007, 0x0079, 0x55cd, 0x55d5, 0x55dd, 0x55f9,
+ 0x5615, 0x63a7, 0x63c3, 0x63df, 0x55d5, 0xa18e, 0x0047, 0x00c0,
+ 0x55dc, 0xa016, 0x1078, 0x1523, 0x007c, 0x067e, 0x6000, 0xa0b2,
+ 0x0010, 0x10c8, 0x1286, 0x1079, 0x55e7, 0x067f, 0x007c, 0x55f7,
+ 0x56c2, 0x57ab, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x5671,
+ 0x5a2d, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x55f7, 0x1078,
+ 0x1286, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1286, 0x1079,
+ 0x5603, 0x067f, 0x007c, 0x5613, 0x5613, 0x5613, 0x5613, 0x5613,
+ 0x5613, 0x5613, 0x5613, 0x5e9d, 0x5f63, 0x5613, 0x5eb6, 0x5f0f,
+ 0x5eb6, 0x5f0f, 0x5613, 0x1078, 0x1286, 0x067e, 0x6000, 0xa0b2,
+ 0x0010, 0x10c8, 0x1286, 0x1079, 0x561f, 0x067f, 0x007c, 0x562f,
+ 0x5a6b, 0x5b11, 0x5bd3, 0x5d27, 0x562f, 0x562f, 0x562f, 0x5a49,
+ 0x5e52, 0x5e56, 0x562f, 0x562f, 0x562f, 0x562f, 0x5e7c, 0x1078,
+ 0x1286, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0, 0x53a3, 0x20a9,
+ 0x0006, 0x3310, 0x3420, 0x9398, 0x94a0, 0x3318, 0x3428, 0x222e,
+ 0x2326, 0xa290, 0x0002, 0xa5a8, 0x0002, 0xa398, 0x0002, 0xa4a0,
+ 0x0002, 0x00f0, 0x563f, 0x0e7e, 0x1078, 0x61dc, 0x0040, 0x5656,
+ 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x0e7f, 0x1078,
+ 0x55a1, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
+ 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x566e, 0x6018, 0x2068, 0x7038,
0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, 0x0d7f, 0x0078,
- 0x5c5f, 0x2100, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x0079, 0x5ca8,
- 0x5cda, 0x5ce6, 0x5cda, 0x5cda, 0x5cda, 0x5cda, 0x5cd8, 0x5cd8,
- 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cda,
- 0x5cd8, 0x5cda, 0x5cda, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x5cda, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8, 0x5cd8,
- 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x4824, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x4824, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c,
- 0x127f, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6,
- 0x0013, 0x00c0, 0x5cfe, 0x2008, 0x0079, 0x5d87, 0xa1b6, 0x0027,
- 0x00c0, 0x5d54, 0x1078, 0x4b33, 0x6004, 0x1078, 0x6a65, 0x0040,
- 0x5d17, 0x1078, 0x6a79, 0x0040, 0x5d4c, 0xa08e, 0x0021, 0x0040,
- 0x5d50, 0xa08e, 0x0022, 0x0040, 0x5d4c, 0x0078, 0x5d47, 0x1078,
- 0x22b1, 0x2001, 0x0007, 0x1078, 0x3783, 0x6018, 0xa080, 0x0028,
- 0x200c, 0x1078, 0x5e09, 0xa186, 0x007e, 0x00c0, 0x5d2d, 0x2001,
- 0x762f, 0x2014, 0xa295, 0x0001, 0x2202, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x4914, 0x1078, 0x4857, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x5d3e, 0x1078, 0x3958, 0x0c7f, 0x2c08,
- 0x1078, 0x7326, 0x037f, 0x027f, 0x017f, 0x1078, 0x37bf, 0x1078,
- 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078, 0x5e09, 0x0078, 0x5d47,
- 0x1078, 0x5e18, 0x0078, 0x5d47, 0xa186, 0x0014, 0x00c0, 0x5d4b,
- 0x1078, 0x4b33, 0x1078, 0x228f, 0x1078, 0x6a65, 0x00c0, 0x5d74,
- 0x1078, 0x22b1, 0x6018, 0xa080, 0x0028, 0x200c, 0x1078, 0x5e09,
- 0xa186, 0x007e, 0x00c0, 0x5d72, 0x2001, 0x762f, 0x200c, 0xa18d,
- 0x0001, 0x2102, 0x0078, 0x5d47, 0x1078, 0x6a79, 0x00c0, 0x5d7c,
- 0x1078, 0x5e09, 0x0078, 0x5d47, 0x6004, 0xa08e, 0x0021, 0x0040,
- 0x5d78, 0xa08e, 0x0022, 0x1040, 0x5e18, 0x0078, 0x5d47, 0x5db9,
- 0x5dbb, 0x5dbf, 0x5dc3, 0x5dc7, 0x5dcb, 0x5db7, 0x5db7, 0x5db7,
- 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7,
- 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7,
- 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5dcf, 0x5dd5, 0x5db7,
- 0x5ddf, 0x5dd5, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5dd5,
- 0x5dd5, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x5db7, 0x1078,
- 0x12d5, 0x0078, 0x5dd5, 0x2001, 0x000b, 0x0078, 0x5de8, 0x2001,
- 0x0003, 0x0078, 0x5de8, 0x2001, 0x0005, 0x0078, 0x5de8, 0x2001,
- 0x0001, 0x0078, 0x5de8, 0x2001, 0x0009, 0x0078, 0x5de8, 0x1078,
- 0x12d5, 0x0078, 0x5de7, 0x1078, 0x3783, 0x1078, 0x4b33, 0x6003,
- 0x0002, 0x6017, 0x0028, 0x1078, 0x4c2c, 0x0078, 0x5de7, 0x1078,
- 0x4b33, 0x6003, 0x0004, 0x6017, 0x0028, 0x1078, 0x4c2c, 0x007c,
- 0x1078, 0x3783, 0x1078, 0x4b33, 0x6003, 0x0002, 0x037e, 0x2019,
- 0x765c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x5dfa, 0x2019, 0x0028,
- 0x0078, 0x5e03, 0x8007, 0xa09a, 0x0004, 0x0048, 0x5df6, 0x8003,
- 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x4c2c, 0x0078,
- 0x5de7, 0x0e7e, 0x1078, 0x68e3, 0x0040, 0x5e16, 0x6010, 0x2070,
- 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f, 0x007c,
- 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103,
- 0x7023, 0x8001, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0x6604,
- 0xa6b6, 0x0028, 0x00c0, 0x5e38, 0x1078, 0x6aae, 0x0078, 0x5e6a,
- 0x6604, 0xa6b6, 0x0029, 0x00c0, 0x5e41, 0x1078, 0x6ac8, 0x0078,
- 0x5e6a, 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x5e4a, 0x1078, 0x5c45,
- 0x0078, 0x5e6a, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x5e53, 0x1078,
- 0x5c8a, 0x0078, 0x5e6a, 0x6604, 0xa6b6, 0x0022, 0x00c0, 0x5e5c,
- 0x1078, 0x5c6e, 0x0078, 0x5e6a, 0xa1b6, 0x0015, 0x00c0, 0x5e64,
- 0x1079, 0x5e6f, 0x0078, 0x5e6a, 0xa1b6, 0x0016, 0x00c0, 0x5e6b,
- 0x1079, 0x5fac, 0x007c, 0x1078, 0x5be9, 0x0078, 0x5e6a, 0x5e93,
- 0x5e96, 0x5e93, 0x5ed7, 0x5e93, 0x5f48, 0x5e93, 0x5e93, 0x5e93,
- 0x5f84, 0x5e93, 0x5f9a, 0xa1b6, 0x0048, 0x0040, 0x5e87, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0x0e7e,
- 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x0e7f,
- 0x1078, 0x5bb4, 0x007c, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071,
- 0x7600, 0x7078, 0xa086, 0x0074, 0x00c0, 0x5ec0, 0x1078, 0x72fa,
- 0x00c0, 0x5eb2, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x5ec4, 0x0d7f,
- 0x2001, 0x0006, 0x1078, 0x3783, 0x1078, 0x22b1, 0x1078, 0x5bb4,
- 0x0078, 0x5ec2, 0x2001, 0x000a, 0x1078, 0x3783, 0x1078, 0x22b1,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4824, 0x0078, 0x5ec2,
- 0x1078, 0x5f38, 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x5ed6,
- 0x2001, 0x0000, 0x1078, 0x376f, 0x2069, 0x7651, 0x6804, 0xd0a4,
- 0x0040, 0x5ed6, 0x2001, 0x0006, 0x1078, 0x3791, 0x007c, 0x0d7e,
- 0x2011, 0x761e, 0x2204, 0xa086, 0x0074, 0x00c0, 0x5f34, 0x1078,
- 0x6079, 0x6018, 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e,
- 0x0040, 0x5eff, 0xa286, 0x0080, 0x00c0, 0x5f28, 0x6813, 0x00ff,
- 0x6817, 0xfffc, 0x6010, 0xa005, 0x0040, 0x5f1e, 0x2068, 0x6807,
- 0x0000, 0x6837, 0x0103, 0x6833, 0x0200, 0x0078, 0x5f1e, 0x0e7e,
- 0x0f7e, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x762f, 0x2e04,
- 0xa085, 0x0003, 0x2072, 0x2071, 0x7b80, 0x2079, 0x0100, 0x2e04,
- 0xa084, 0x00ff, 0x2069, 0x7619, 0x206a, 0x78e6, 0x8e70, 0x2e04,
- 0x2069, 0x761a, 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001, 0x0006,
- 0x1078, 0x3783, 0x1078, 0x22b1, 0x1078, 0x5bb4, 0x0078, 0x5f36,
- 0x2001, 0x0004, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4824, 0x0078, 0x5f36, 0x1078, 0x5f38, 0x0d7f, 0x007c,
- 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x0040, 0x5f43, 0x2001,
- 0x0007, 0x1078, 0x3783, 0x1078, 0x22b1, 0x1078, 0x5bb4, 0x007c,
- 0x0e7e, 0x2071, 0x7600, 0x7078, 0xa086, 0x0014, 0x00c0, 0x5f7e,
- 0x7000, 0xa086, 0x0003, 0x00c0, 0x5f5b, 0x6010, 0xa005, 0x00c0,
- 0x5f5b, 0x1078, 0x2d80, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3853,
- 0x1078, 0x5ec4, 0x0d7f, 0x1078, 0x6083, 0x00c0, 0x5f7e, 0x2001,
- 0x0006, 0x1078, 0x3783, 0x0e7e, 0x6010, 0xa005, 0x0040, 0x5f77,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0200, 0x0e7f,
- 0x1078, 0x22b1, 0x1078, 0x5bb4, 0x0078, 0x5f82, 0x1078, 0x5e09,
- 0x1078, 0x5f38, 0x0e7f, 0x007c, 0x2011, 0x761e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x5f97, 0x2001, 0x0002, 0x1078, 0x3783, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x4824, 0x0078, 0x5f99, 0x1078,
- 0x5f38, 0x007c, 0x2011, 0x761e, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x5fa9, 0x2001, 0x0007, 0x1078, 0x3783, 0x1078, 0x5bb4, 0x0078,
- 0x5fab, 0x1078, 0x5f38, 0x007c, 0x5e93, 0x5fb8, 0x5e93, 0x5fde,
- 0x5e93, 0x602c, 0x5e93, 0x5e93, 0x5e93, 0x6041, 0x5e93, 0x6054,
- 0x0c7e, 0x1078, 0x6067, 0x00c0, 0x5fcd, 0x2001, 0x0000, 0x1078,
- 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x4824, 0x0078, 0x5fdc, 0x2009, 0x7b8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x5fda, 0x1078, 0x5bb4,
- 0x0078, 0x5fdc, 0x1078, 0x5f38, 0x0c7f, 0x007c, 0x1078, 0x6076,
- 0x00c0, 0x5ff2, 0x2001, 0x0000, 0x1078, 0x376f, 0x2001, 0x0002,
- 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4824,
- 0x0078, 0x6014, 0x1078, 0x5e09, 0x2009, 0x7b8e, 0x2134, 0xa6b4,
- 0x00ff, 0xa686, 0x0005, 0x0040, 0x6015, 0x2009, 0x7b8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x6012, 0xa686, 0x0009,
- 0x0040, 0x6015, 0x2001, 0x0004, 0x1078, 0x3783, 0x1078, 0x5bb4,
- 0x0078, 0x6014, 0x1078, 0x5f38, 0x007c, 0x0d7e, 0x6018, 0x2068,
- 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x6027, 0x8001, 0x6842,
- 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x6014, 0x1078,
- 0x228f, 0x0d7f, 0x0078, 0x6012, 0x1078, 0x6076, 0x00c0, 0x603c,
- 0x2001, 0x0004, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4824, 0x0078, 0x6040, 0x1078, 0x5e09, 0x1078, 0x5f38,
- 0x007c, 0x1078, 0x6076, 0x00c0, 0x6051, 0x2001, 0x0008, 0x1078,
- 0x3783, 0x6003, 0x0001, 0x6007, 0x0005, 0x1078, 0x4824, 0x0078,
- 0x6053, 0x1078, 0x5f38, 0x007c, 0x1078, 0x6076, 0x00c0, 0x6064,
- 0x2001, 0x000a, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x4824, 0x0078, 0x6066, 0x1078, 0x5f38, 0x007c, 0x2009,
- 0x7b8e, 0x2104, 0xa086, 0x0003, 0x00c0, 0x6075, 0x2009, 0x7b8f,
- 0x2104, 0xa084, 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001,
- 0x007c, 0x0c7e, 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x37e9,
- 0x017f, 0x0c7f, 0x007c, 0x0e7e, 0x2071, 0x7b8c, 0x7004, 0xa086,
- 0x0014, 0x00c0, 0x60a6, 0x7008, 0xa086, 0x0800, 0x00c0, 0x60a6,
- 0x700c, 0xd0ec, 0x0040, 0x60a4, 0xa084, 0x0f00, 0xa086, 0x0100,
- 0x00c0, 0x60a4, 0x7024, 0xd0a4, 0x0040, 0x60a4, 0xd08c, 0x0040,
- 0x60a4, 0xa006, 0x0078, 0x60a6, 0xa085, 0x0001, 0x0e7f, 0x007c,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x783f, 0x252c, 0x2021, 0x7845,
- 0x2424, 0x2061, 0x7d00, 0x2071, 0x7600, 0x7244, 0x7060, 0xa202,
- 0x00c8, 0x60fd, 0x1078, 0x7504, 0x0040, 0x60f5, 0x671c, 0xa786,
- 0x0001, 0x0040, 0x60f5, 0xa786, 0x0007, 0x0040, 0x60f5, 0x2500,
- 0xac06, 0x0040, 0x60f5, 0x2400, 0xac06, 0x0040, 0x60f5, 0x0c7e,
- 0x6000, 0xa086, 0x0004, 0x00c0, 0x60df, 0x1078, 0x1676, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x60f2, 0xa786, 0x0003, 0x00c0,
- 0x6107, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3a2c,
- 0x1078, 0x6a3f, 0x1078, 0x6a4c, 0x0c7f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x00c8, 0x60fd, 0x0078, 0x60bd, 0x127f, 0x007f, 0x027f,
- 0x047f, 0x057f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x60e9, 0x1078, 0x74a8, 0x0078, 0x60f2, 0x220c,
- 0x2304, 0xa106, 0x00c0, 0x611a, 0x8210, 0x8318, 0x00f0, 0x610f,
- 0xa006, 0x007c, 0x2304, 0xa102, 0x0048, 0x6122, 0x2001, 0x0001,
- 0x0078, 0x6124, 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004,
- 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x1078, 0x6a65, 0x0040, 0x6136,
- 0x1078, 0x6a79, 0x0040, 0x613f, 0x0078, 0x6138, 0x1078, 0x22b1,
- 0x1078, 0x4b33, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078,
- 0x5e09, 0x0078, 0x6138, 0xa182, 0x0040, 0x0079, 0x6147, 0x6157,
- 0x6157, 0x6157, 0x6157, 0x6157, 0x6157, 0x6157, 0x6157, 0x6157,
- 0x6157, 0x6157, 0x6159, 0x6159, 0x6159, 0x6159, 0x6157, 0x1078,
- 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x47d7, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0,
- 0x616e, 0x6004, 0xa082, 0x0040, 0x0079, 0x61e4, 0xa186, 0x0027,
- 0x00c0, 0x618b, 0x1078, 0x4b33, 0x1078, 0x228f, 0x0d7e, 0x6110,
- 0x2168, 0x1078, 0x68e3, 0x0040, 0x6185, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x0d7f, 0x1078, 0x5bb4,
- 0x1078, 0x4c2c, 0x007c, 0xa186, 0x0014, 0x00c0, 0x6194, 0x6004,
- 0xa082, 0x0040, 0x0079, 0x61b4, 0xa186, 0x0047, 0x10c0, 0x12d5,
- 0x2001, 0x0109, 0x2004, 0xd084, 0x0040, 0x61b1, 0x127e, 0x2091,
- 0x2200, 0x007e, 0x017e, 0x027e, 0x1078, 0x4698, 0x027f, 0x017f,
- 0x007f, 0x127f, 0x6000, 0xa086, 0x0002, 0x00c0, 0x61b1, 0x0078,
- 0x620b, 0x1078, 0x5be9, 0x007c, 0x61c6, 0x61c4, 0x61c4, 0x61c4,
- 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61c4, 0x61dd,
- 0x61dd, 0x61dd, 0x61dd, 0x61c4, 0x1078, 0x12d5, 0x1078, 0x4b33,
- 0x0d7e, 0x6110, 0x2168, 0x1078, 0x68e3, 0x0040, 0x61d7, 0x6837,
- 0x0103, 0x684b, 0x0006, 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x0d7f,
- 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078, 0x4b33, 0x1078,
- 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x61f6, 0x61f4, 0x61f4, 0x61f4,
- 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x61f4, 0x6204,
- 0x6204, 0x6204, 0x6204, 0x61f4, 0x1078, 0x12d5, 0x1078, 0x4b33,
- 0x6003, 0x0002, 0x1078, 0x4c2c, 0x6010, 0xa088, 0x0013, 0x2104,
- 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, 0x4b33, 0x6003, 0x000f,
- 0x1078, 0x4c2c, 0x007c, 0xa182, 0x0040, 0x0079, 0x620f, 0x621f,
- 0x621f, 0x621f, 0x621f, 0x621f, 0x6221, 0x62aa, 0x62c2, 0x621f,
- 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x621f, 0x1078,
- 0x12d5, 0x0e7e, 0x0d7e, 0x2071, 0x7b8c, 0x6110, 0x2168, 0x7614,
- 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x628e, 0xa68c, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6253, 0xa186, 0x0028, 0x00c0, 0x623d, 0x1078,
- 0x6a53, 0x684b, 0x001c, 0x0078, 0x6255, 0xd6dc, 0x0040, 0x6248,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6255,
- 0xd6d4, 0x0040, 0x6253, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6255, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46,
- 0xa01e, 0xd6c4, 0x0040, 0x6268, 0x7328, 0x732c, 0x6b56, 0x037e,
- 0x2308, 0x2019, 0x7b98, 0xad90, 0x0019, 0x1078, 0x66cc, 0x037f,
- 0xd6cc, 0x0040, 0x629e, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8,
- 0x627c, 0x2071, 0x7b98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d,
- 0x1078, 0x66cc, 0x0078, 0x629e, 0x6838, 0xd0fc, 0x0040, 0x6285,
- 0x2009, 0x0020, 0x695a, 0x0078, 0x6271, 0x0f7e, 0x2d78, 0x1078,
- 0x6664, 0x0f7f, 0x1078, 0x66b9, 0x0078, 0x62a0, 0x684b, 0x0000,
- 0x6837, 0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x629e, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x629e, 0x1078, 0x6412, 0x1078, 0x3a2c,
- 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078,
- 0x5bb4, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7b8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x4843, 0x1078,
- 0x4cec, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18,
- 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x62d1, 0x62e1, 0x62e1, 0x62e1, 0x62e1, 0x62e1, 0x62e3, 0x637a,
- 0x62e1, 0x62e1, 0x6390, 0x63f2, 0x62e1, 0x62e1, 0x62e1, 0x62e1,
- 0x63f9, 0x1078, 0x12d5, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x7b8c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x6375, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x6304,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x6375,
- 0x1078, 0x132f, 0x1040, 0x12d5, 0x2d00, 0x784a, 0x7f4c, 0xc7cd,
- 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840,
- 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x633e,
- 0xa186, 0x0028, 0x00c0, 0x6328, 0x684b, 0x001c, 0x0078, 0x6340,
- 0xd6dc, 0x0040, 0x6333, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6340, 0xd6d4, 0x0040, 0x633e, 0x684b, 0x0007,
- 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6340, 0x684b, 0x0000,
- 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040,
- 0x6355, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7b98,
- 0xad90, 0x0019, 0x1078, 0x66cc, 0x037f, 0xd6cc, 0x0040, 0x6375,
- 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x6369, 0x2071, 0x7b98,
- 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x66cc, 0x0078,
- 0x6375, 0x7838, 0xd0fc, 0x0040, 0x6372, 0x2009, 0x0020, 0x695a,
- 0x0078, 0x635e, 0x2d78, 0x1078, 0x6664, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7b8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x5519, 0x007c,
- 0x0d7e, 0x6003, 0x0002, 0x1078, 0x4bdb, 0x1078, 0x4cec, 0x6110,
- 0x2168, 0x694c, 0xd1e4, 0x0040, 0x63f0, 0xd1cc, 0x0040, 0x63cb,
- 0x6948, 0x6838, 0xd0fc, 0x0040, 0x63c3, 0x017e, 0x684c, 0x007e,
- 0x6850, 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020,
- 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x63b2,
- 0x157f, 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078,
- 0x1358, 0x0078, 0x63ee, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078,
- 0x66b9, 0x0078, 0x63ee, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x63ea, 0xa086, 0x0028, 0x00c0, 0x63dc,
- 0x684b, 0x001c, 0x0078, 0x63ec, 0xd1dc, 0x0040, 0x63e3, 0x684b,
- 0x0015, 0x0078, 0x63ec, 0xd1d4, 0x0040, 0x63ea, 0x684b, 0x0007,
- 0x0078, 0x63ec, 0x684b, 0x0000, 0x1078, 0x3a2c, 0x1078, 0x5bb4,
- 0x0d7f, 0x007c, 0x6003, 0x0002, 0x1078, 0x4bdb, 0x1078, 0x4cec,
- 0x007c, 0x1078, 0x4bdb, 0x1078, 0x228f, 0x0d7e, 0x6110, 0x2168,
- 0x1078, 0x68e3, 0x0040, 0x640c, 0x6837, 0x0103, 0x684b, 0x0029,
- 0x1078, 0x3a2c, 0x1078, 0x6a3f, 0x0d7f, 0x1078, 0x5bb4, 0x1078,
- 0x4cec, 0x007c, 0x684b, 0x0015, 0xd1fc, 0x0040, 0x641e, 0x684b,
- 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x6425, 0x6435, 0x6435, 0x6435,
- 0x6435, 0x6435, 0x6437, 0x6435, 0x64db, 0x64e3, 0x6435, 0x6435,
- 0x6435, 0x6435, 0x6435, 0x6435, 0x6435, 0x1078, 0x12d5, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x7b8c, 0x6110, 0x2178, 0x7614,
- 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x64cd, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x6458, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x64ca, 0x1078, 0x132f, 0x1040, 0x12d5,
- 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103,
- 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
- 0x00ff, 0xa186, 0x0002, 0x0040, 0x6493, 0xa186, 0x0028, 0x00c0,
- 0x647d, 0x684b, 0x001c, 0x0078, 0x6495, 0xd6dc, 0x0040, 0x6488,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6495,
- 0xd6d4, 0x0040, 0x6493, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6495, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
- 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x64aa, 0x7328, 0x732c,
- 0x6b56, 0x037e, 0x2308, 0x2019, 0x7b98, 0xad90, 0x0019, 0x1078,
- 0x66cc, 0x037f, 0xd6cc, 0x0040, 0x64ca, 0x7124, 0x695a, 0xa192,
- 0x0021, 0x00c8, 0x64be, 0x2071, 0x7b98, 0x831c, 0x2300, 0xae18,
- 0xad90, 0x001d, 0x1078, 0x66cc, 0x0078, 0x64ca, 0x7838, 0xd0fc,
- 0x0040, 0x64c7, 0x2009, 0x0020, 0x695a, 0x0078, 0x64b3, 0x2d78,
- 0x1078, 0x6664, 0xd6dc, 0x00c0, 0x64d0, 0xa006, 0x0078, 0x64d4,
- 0x2001, 0x0001, 0x7218, 0x731c, 0x1078, 0x15b6, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
- 0x1078, 0x1572, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168,
- 0x694c, 0xd1e4, 0x0040, 0x654a, 0xd1cc, 0x0040, 0x651a, 0x6948,
- 0x6838, 0xd0fc, 0x0040, 0x6512, 0x017e, 0x684c, 0x007e, 0x6850,
- 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e,
- 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6501, 0x157f,
- 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1358,
- 0x0078, 0x6548, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078, 0x66b9,
- 0x0078, 0x6548, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6539, 0xa086, 0x0028, 0x00c0, 0x652b, 0x684b,
- 0x001c, 0x0078, 0x6546, 0xd1dc, 0x0040, 0x6532, 0x684b, 0x0015,
- 0x0078, 0x6546, 0xd1d4, 0x0040, 0x6539, 0x684b, 0x0007, 0x0078,
- 0x6546, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0040, 0x6546, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x6546, 0x1078, 0x6412, 0x1078, 0x3a2c,
- 0x1078, 0x5bb4, 0x0d7f, 0x007c, 0x1078, 0x4b33, 0x0078, 0x6552,
- 0x1078, 0x4bdb, 0x1078, 0x68e3, 0x0040, 0x6569, 0x0d7e, 0x6110,
- 0x2168, 0x6837, 0x0103, 0x2009, 0x760c, 0x210c, 0xd18c, 0x00c0,
- 0x6572, 0xd184, 0x00c0, 0x656e, 0x6108, 0x694a, 0x1078, 0x3a2c,
- 0x0d7f, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x684b, 0x0004,
- 0x0078, 0x6566, 0x684b, 0x0004, 0x0078, 0x6566, 0xa182, 0x0040,
- 0x0079, 0x657a, 0x658a, 0x658a, 0x658a, 0x658a, 0x658a, 0x658c,
- 0x658a, 0x658f, 0x658a, 0x658a, 0x658a, 0x658a, 0x658a, 0x658a,
- 0x658a, 0x658a, 0x1078, 0x12d5, 0x1078, 0x5bb4, 0x007c, 0x007e,
- 0x027e, 0xa016, 0x1078, 0x1572, 0x027f, 0x007f, 0x007c, 0xa182,
- 0x0085, 0x0079, 0x659b, 0x65a4, 0x65a2, 0x65a2, 0x65a2, 0x65a2,
- 0x65a2, 0x65a2, 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078,
- 0x47d7, 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c,
- 0xa186, 0x0013, 0x00c0, 0x65ba, 0x6004, 0xa082, 0x0085, 0x2008,
- 0x0079, 0x65ee, 0xa186, 0x0027, 0x00c0, 0x65db, 0x1078, 0x4b33,
- 0x1078, 0x228f, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040,
- 0x65d1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3a2c, 0x1078,
- 0x6a3f, 0x0d7f, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078,
- 0x5be9, 0x0078, 0x65d6, 0xa186, 0x0014, 0x00c0, 0x65d7, 0x1078,
- 0x4b33, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x65d1,
- 0x6837, 0x0103, 0x684b, 0x0006, 0x0078, 0x65cd, 0x65f7, 0x65f5,
- 0x65f5, 0x65f5, 0x65f5, 0x65f5, 0x6600, 0x1078, 0x12d5, 0x1078,
- 0x4b33, 0x6017, 0x0014, 0x6003, 0x000c, 0x1078, 0x4c2c, 0x007c,
- 0x1078, 0x4b33, 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x4c2c,
- 0x007c, 0xa182, 0x008c, 0x00c8, 0x6613, 0xa182, 0x0085, 0x0048,
- 0x6613, 0x0079, 0x6616, 0x1078, 0x5be9, 0x007c, 0x661d, 0x661d,
- 0x661d, 0x661d, 0x661f, 0x663e, 0x661d, 0x1078, 0x12d5, 0x0d7e,
- 0x1078, 0x6a3f, 0x1078, 0x68e3, 0x0040, 0x663a, 0x6010, 0x2068,
- 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x6632, 0x684b, 0x0006,
- 0x0078, 0x6636, 0x684b, 0x0005, 0x1078, 0x6af2, 0x6847, 0x0000,
- 0x1078, 0x3a2c, 0x1078, 0x5bb4, 0x0d7f, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x6659, 0x6837, 0x0103, 0x6850,
- 0xd0b4, 0x0040, 0x664f, 0x684b, 0x0006, 0x0078, 0x6653, 0x684b,
- 0x0005, 0x1078, 0x6af2, 0x6847, 0x0000, 0x1078, 0x3a2c, 0x1078,
- 0x6a3f, 0x0d7f, 0x1078, 0x5bb4, 0x007c, 0x1078, 0x4b33, 0x1078,
- 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e,
- 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, 0x6670, 0x0078, 0x6672,
- 0x2009, 0x0100, 0x2130, 0x2069, 0x7b98, 0x831c, 0x2300, 0xad18,
- 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, 0x66cc, 0xa6b2, 0x0020,
- 0x7804, 0xa06d, 0x0040, 0x6686, 0x1078, 0x1358, 0x1078, 0x132f,
- 0x0040, 0x66b0, 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20,
- 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x669c, 0x2608, 0xad90, 0x000f,
- 0x1078, 0x66cc, 0x0078, 0x66b0, 0xa6b2, 0x003c, 0x2009, 0x003c,
- 0x2d78, 0xad90, 0x000f, 0x1078, 0x66cc, 0x0078, 0x6686, 0x0f7f,
- 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x66b5,
- 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f,
- 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x66ca, 0x6804, 0xa07d, 0x0040,
- 0x66c8, 0x6807, 0x0000, 0x1078, 0x3a2c, 0x2f68, 0x0078, 0x66bd,
- 0x1078, 0x3a2c, 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040,
- 0x66d2, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x66d4, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x601c, 0xa084, 0x000f, 0x1079, 0x66e7, 0x127f, 0x007c, 0x66f6,
- 0x66ef, 0x66f1, 0x670f, 0x66ef, 0x66f1, 0x66f1, 0x66f1, 0x1078,
- 0x12d5, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x670c, 0xa00e, 0x2001, 0x0005,
- 0x1078, 0x3abc, 0x1078, 0x6af2, 0x1078, 0x3a2c, 0x1078, 0x5bb4,
- 0xa085, 0x0001, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x670a, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6717, 0x007c, 0x6727,
- 0x6744, 0x6729, 0x6755, 0x6740, 0x6727, 0x66f1, 0x66f6, 0x66f6,
- 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x66f1, 0x1078,
- 0x12d5, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x6732,
- 0x1078, 0x6af2, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
- 0x0002, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0xa085, 0x0001, 0x007c,
- 0x1078, 0x1676, 0x0078, 0x6729, 0x0e7e, 0x2071, 0x7836, 0x7024,
- 0xac06, 0x00c0, 0x674d, 0x1078, 0x5688, 0x1078, 0x55bd, 0x0e7f,
- 0x00c0, 0x6729, 0x1078, 0x66f1, 0x007c, 0x037e, 0x0e7e, 0x2071,
- 0x7836, 0x703c, 0xac06, 0x00c0, 0x6765, 0x2019, 0x0000, 0x1078,
- 0x571a, 0x0e7f, 0x037f, 0x0078, 0x6729, 0x1078, 0x59f6, 0x0e7f,
- 0x037f, 0x00c0, 0x6729, 0x1078, 0x66f1, 0x007c, 0x0c7e, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x6776, 0x0c7f, 0x007c, 0x6785, 0x67e2,
- 0x6887, 0x6789, 0x6785, 0x6785, 0x7188, 0x5bb4, 0x67e2, 0x1078,
- 0x6a79, 0x00c0, 0x6785, 0x1078, 0x5e09, 0x007c, 0x6017, 0x0001,
- 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6791,
- 0x007c, 0x67a1, 0x67a3, 0x67c3, 0x67d5, 0x67d5, 0x67a1, 0x6785,
- 0x6785, 0x6785, 0x67d5, 0x67d5, 0x67a1, 0x67a1, 0x67a1, 0x67a1,
- 0x67df, 0x1078, 0x12d5, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xc0b5,
- 0x7052, 0x2071, 0x7836, 0x7024, 0xac06, 0x0040, 0x67bf, 0x1078,
- 0x55bd, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6017,
- 0x0014, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0e7f, 0x007c, 0x6017,
- 0x0001, 0x0078, 0x67bd, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xc0b5,
- 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
- 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x007c, 0x0d7e, 0x6017, 0x0001,
- 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c, 0x1078,
- 0x5bb4, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x67ea, 0x007c, 0x67fa, 0x6786, 0x67fc, 0x67fa, 0x67fc, 0x67fa,
- 0x67fa, 0x67fa, 0x677f, 0x677f, 0x67fa, 0x67fa, 0x67fa, 0x67fa,
- 0x67fa, 0x67fa, 0x1078, 0x12d5, 0x0d7e, 0x6018, 0x2068, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x12d5, 0x1079,
- 0x680a, 0x007c, 0x6816, 0x6835, 0x6816, 0x6835, 0x6816, 0x6835,
- 0x6818, 0x6821, 0x6816, 0x6835, 0x6816, 0x682e, 0x1078, 0x12d5,
- 0x6004, 0xa08e, 0x0004, 0x0040, 0x6830, 0xa08e, 0x0002, 0x0040,
- 0x6830, 0x6004, 0x1078, 0x6a79, 0x0040, 0x687f, 0xa08e, 0x0021,
- 0x0040, 0x6883, 0xa08e, 0x0022, 0x0040, 0x687f, 0x1078, 0x228f,
- 0x1078, 0x5e09, 0x1078, 0x5bb4, 0x007c, 0x0c7e, 0x0d7e, 0x6104,
- 0xa186, 0x0016, 0x0040, 0x686f, 0xa186, 0x0002, 0x00c0, 0x685e,
- 0x6018, 0x2068, 0x68a0, 0xd0bc, 0x00c0, 0x685e, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x685e, 0x8001, 0x6842, 0x6013, 0x0000,
- 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x5b4e, 0x0040, 0x685e,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x686f, 0x0d7f, 0x0c7f,
- 0x1078, 0x5e09, 0x1078, 0x228f, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x22b1, 0x127f, 0x0e7f, 0x1078, 0x5bb4, 0x007c, 0x2001,
- 0x0002, 0x1078, 0x3783, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078,
- 0x4824, 0x1078, 0x4c2c, 0x0d7f, 0x0c7f, 0x0078, 0x686e, 0x1078,
- 0x5e09, 0x0078, 0x6832, 0x1078, 0x5e18, 0x0078, 0x6832, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x688f, 0x007c, 0x689f,
- 0x689f, 0x689f, 0x689f, 0x689f, 0x689f, 0x689f, 0x689f, 0x689f,
- 0x6785, 0x689f, 0x6786, 0x68a1, 0x6786, 0x68aa, 0x689f, 0x1078,
- 0x12d5, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078, 0x47d7, 0x1078,
- 0x4c2c, 0x007c, 0x1078, 0x6a3f, 0x1078, 0x68e3, 0x0040, 0x68cc,
- 0x1078, 0x228f, 0x0d7e, 0x1078, 0x68e3, 0x0040, 0x68bf, 0x6010,
- 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x3a2c, 0x0d7f,
- 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4824,
- 0x1078, 0x4c2c, 0x0078, 0x68ce, 0x1078, 0x5bb4, 0x007c, 0xa284,
- 0x0007, 0x00c0, 0x68e0, 0xa282, 0x7d00, 0x0048, 0x68e0, 0x2001,
- 0x7615, 0x2004, 0xa202, 0x00c8, 0x68e0, 0xa085, 0x0001, 0x007c,
- 0xa006, 0x0078, 0x68df, 0x027e, 0x0e7e, 0x2071, 0x7600, 0x6210,
- 0x7058, 0xa202, 0x0048, 0x68f5, 0x705c, 0xa202, 0x00c8, 0x68f5,
- 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078, 0x68f2,
- 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2061,
- 0x7d00, 0x2071, 0x7600, 0x7344, 0x7060, 0xa302, 0x00c8, 0x691e,
- 0x601c, 0xa206, 0x00c0, 0x6916, 0x1078, 0x6a79, 0x00c0, 0x6912,
- 0x1078, 0x5e09, 0x0c7e, 0x1078, 0x5bb4, 0x0c7f, 0xace0, 0x0008,
- 0x7054, 0xac02, 0x00c8, 0x691e, 0x0078, 0x6903, 0x127f, 0x007f,
- 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0x127e,
- 0x2091, 0x8000, 0xa188, 0x7720, 0x210c, 0x81ff, 0x0040, 0x694b,
- 0x2061, 0x7d00, 0x2071, 0x7600, 0x7344, 0x7060, 0xa302, 0x00c8,
- 0x694b, 0x6018, 0xa106, 0x00c0, 0x6945, 0x1078, 0x228f, 0x017e,
- 0x0c7e, 0x1078, 0x5bb4, 0x0c7f, 0x017f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x0048, 0x6939, 0x127f, 0x017f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b4e,
- 0x057f, 0x0040, 0x6969, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009,
- 0x004b, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6965, 0x0c7e, 0x057e, 0x127e, 0x2091,
- 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5b4e, 0x057f, 0x0040, 0x6993,
- 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078,
- 0x3958, 0x0c7f, 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078,
- 0x7326, 0x2009, 0x004c, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f,
- 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x698f, 0x0c7e, 0x057e,
- 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5b4e, 0x057f,
- 0x0040, 0x69be, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
- 0x0c7e, 0x2560, 0x1078, 0x3958, 0x0c7f, 0x1078, 0x4914, 0x1078,
- 0x4857, 0x2c08, 0x1078, 0x7326, 0x2009, 0x004d, 0x1078, 0x5bdb,
+ 0x564b, 0x2100, 0xa1b2, 0x0030, 0x10c8, 0x1286, 0x0079, 0x5678,
+ 0x56aa, 0x56b6, 0x56aa, 0x56aa, 0x56aa, 0x56aa, 0x56a8, 0x56a8,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56aa,
+ 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x56aa, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8, 0x56a8,
+ 0x1078, 0x1286, 0x6003, 0x0001, 0x6106, 0x1078, 0x4445, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x007c, 0x6003, 0x0001,
+ 0x6106, 0x1078, 0x4445, 0x127e, 0x2091, 0x8000, 0x1078, 0x484d,
+ 0x127f, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x1286, 0xa1b6,
+ 0x0013, 0x00c0, 0x56ce, 0x2008, 0x0079, 0x5724, 0xa1b6, 0x0027,
+ 0x00c0, 0x570c, 0x1078, 0x4754, 0x6004, 0x1078, 0x6316, 0x0040,
+ 0x56df, 0x1078, 0x632a, 0x0040, 0x5708, 0x0078, 0x5703, 0x1078,
+ 0x2192, 0x2001, 0x0007, 0x1078, 0x3443, 0x6018, 0xa080, 0x0028,
+ 0x200c, 0x017e, 0x027e, 0x037e, 0x2110, 0x2019, 0x0028, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x0c7e, 0x6018, 0xa065, 0x0040, 0x56fa,
+ 0x1078, 0x3618, 0x0c7f, 0x2c08, 0x1078, 0x6bca, 0x037f, 0x027f,
+ 0x017f, 0x1078, 0x347f, 0x1078, 0x55a1, 0x1078, 0x484d, 0x007c,
+ 0x1078, 0x579c, 0x0078, 0x5703, 0xa186, 0x0014, 0x1078, 0x4754,
+ 0x1078, 0x2174, 0x1078, 0x6316, 0x00c0, 0x571a, 0x1078, 0x2192,
+ 0x0078, 0x5703, 0x1078, 0x632a, 0x00c0, 0x5722, 0x1078, 0x579c,
+ 0x0078, 0x5703, 0x0078, 0x5703, 0x5756, 0x5758, 0x575c, 0x5760,
+ 0x5764, 0x5768, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x576c, 0x5772, 0x5754, 0x5754, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x5772, 0x5772, 0x5754, 0x5754,
+ 0x5754, 0x5754, 0x5754, 0x5754, 0x1078, 0x1286, 0x0078, 0x5772,
+ 0x2001, 0x000b, 0x0078, 0x577b, 0x2001, 0x0003, 0x0078, 0x577b,
+ 0x2001, 0x0005, 0x0078, 0x577b, 0x2001, 0x0001, 0x0078, 0x577b,
+ 0x2001, 0x0009, 0x0078, 0x577b, 0x1078, 0x1286, 0x0078, 0x577a,
+ 0x1078, 0x3443, 0x1078, 0x4754, 0x6003, 0x0002, 0x6017, 0x0028,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x3443, 0x1078, 0x4754, 0x6003,
+ 0x0002, 0x037e, 0x2019, 0x6f5c, 0x2304, 0xa084, 0xff00, 0x00c0,
+ 0x578d, 0x2019, 0x0028, 0x0078, 0x5796, 0x8007, 0xa09a, 0x0004,
+ 0x0048, 0x5789, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316, 0x037f,
+ 0x1078, 0x484d, 0x0078, 0x577a, 0x0e7e, 0x1078, 0x61dc, 0x0040,
+ 0x57a9, 0x6010, 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033,
+ 0x0100, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084,
+ 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x1286, 0x6604, 0xa6b6,
+ 0x0028, 0x00c0, 0x57bf, 0x1078, 0x635f, 0x0078, 0x57e8, 0x6604,
+ 0xa6b6, 0x0029, 0x00c0, 0x57c8, 0x1078, 0x6379, 0x0078, 0x57e8,
+ 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x57d1, 0x1078, 0x5631, 0x0078,
+ 0x57e8, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x57da, 0x1078, 0x565a,
+ 0x0078, 0x57e8, 0xa1b6, 0x0015, 0x00c0, 0x57e2, 0x1079, 0x57ed,
+ 0x0078, 0x57e8, 0xa1b6, 0x0016, 0x00c0, 0x57e9, 0x1079, 0x58b6,
+ 0x007c, 0x1078, 0x55d5, 0x0078, 0x57e8, 0x57f9, 0x57fc, 0x57f9,
+ 0x583d, 0x57f9, 0x5865, 0x57f9, 0x57f9, 0x57f9, 0x588e, 0x57f9,
+ 0x58a4, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071, 0x6f00, 0x7070,
+ 0xa086, 0x0074, 0x00c0, 0x5826, 0x1078, 0x6ba2, 0x00c0, 0x5818,
+ 0x0d7e, 0x6018, 0x2068, 0x1078, 0x582a, 0x0d7f, 0x2001, 0x0006,
+ 0x1078, 0x3443, 0x1078, 0x2192, 0x1078, 0x55a1, 0x0078, 0x5828,
+ 0x2001, 0x000a, 0x1078, 0x3443, 0x1078, 0x2192, 0x6003, 0x0001,
+ 0x6007, 0x0001, 0x1078, 0x4445, 0x0078, 0x5828, 0x1078, 0x5855,
+ 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x583c, 0x2001, 0x0000,
+ 0x1078, 0x342f, 0x2069, 0x6f51, 0x6804, 0xd0a4, 0x0040, 0x583c,
+ 0x2001, 0x0006, 0x1078, 0x3451, 0x007c, 0x2011, 0x6f1c, 0x2204,
+ 0xa086, 0x0074, 0x00c0, 0x5852, 0x1078, 0x597f, 0x2001, 0x0004,
+ 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0003, 0x1078, 0x4445,
+ 0x0078, 0x5854, 0x1078, 0x5855, 0x007c, 0x2001, 0x6f00, 0x2004,
+ 0xa086, 0x0003, 0x0040, 0x5860, 0x2001, 0x0007, 0x1078, 0x3443,
+ 0x1078, 0x55a1, 0x1078, 0x2192, 0x007c, 0x0e7e, 0x2071, 0x6f00,
+ 0x7070, 0xa086, 0x0014, 0x00c0, 0x588a, 0x7000, 0xa086, 0x0003,
+ 0x00c0, 0x5874, 0x1078, 0x2a40, 0x0d7e, 0x6018, 0x2068, 0x1078,
+ 0x3513, 0x1078, 0x582a, 0x0d7f, 0x1078, 0x5989, 0x00c0, 0x588a,
+ 0x2001, 0x0006, 0x1078, 0x3443, 0x1078, 0x55a1, 0x1078, 0x2192,
+ 0x0078, 0x588c, 0x1078, 0x5855, 0x0e7f, 0x007c, 0x2011, 0x6f1c,
+ 0x2204, 0xa086, 0x0014, 0x00c0, 0x58a1, 0x2001, 0x0002, 0x1078,
+ 0x3443, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4445, 0x0078,
+ 0x58a3, 0x1078, 0x5855, 0x007c, 0x2011, 0x6f1c, 0x2204, 0xa086,
+ 0x0004, 0x00c0, 0x58b3, 0x2001, 0x0007, 0x1078, 0x3443, 0x1078,
+ 0x55a1, 0x0078, 0x58b5, 0x1078, 0x5855, 0x007c, 0x57f9, 0x58c2,
+ 0x57f9, 0x58e8, 0x57f9, 0x5934, 0x57f9, 0x57f9, 0x57f9, 0x5947,
+ 0x57f9, 0x595a, 0x0c7e, 0x1078, 0x596d, 0x00c0, 0x58d7, 0x2001,
+ 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443, 0x6003,
+ 0x0001, 0x6007, 0x0002, 0x1078, 0x4445, 0x0078, 0x58e6, 0x2009,
+ 0x738f, 0x2104, 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x58e4,
+ 0x1078, 0x55a1, 0x0078, 0x58e6, 0x1078, 0x5855, 0x0c7f, 0x007c,
+ 0x1078, 0x597c, 0x00c0, 0x58fc, 0x2001, 0x0000, 0x1078, 0x342f,
+ 0x2001, 0x0002, 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4445, 0x0078, 0x591c, 0x2009, 0x738e, 0x2134, 0xa6b4,
+ 0x00ff, 0xa686, 0x0005, 0x0040, 0x591d, 0x2009, 0x738f, 0x2104,
+ 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x591a, 0xa686, 0x0009,
+ 0x0040, 0x591d, 0x2001, 0x0004, 0x1078, 0x3443, 0x1078, 0x55a1,
+ 0x0078, 0x591c, 0x1078, 0x5855, 0x007c, 0x0d7e, 0x6018, 0x2068,
+ 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x592f, 0x8001, 0x6842,
+ 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x591c, 0x1078,
+ 0x2174, 0x0d7f, 0x0078, 0x591a, 0x1078, 0x597c, 0x00c0, 0x5944,
+ 0x2001, 0x0004, 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0003,
+ 0x1078, 0x4445, 0x0078, 0x5946, 0x1078, 0x5855, 0x007c, 0x1078,
+ 0x597c, 0x00c0, 0x5957, 0x2001, 0x0008, 0x1078, 0x3443, 0x6003,
+ 0x0001, 0x6007, 0x0005, 0x1078, 0x4445, 0x0078, 0x5959, 0x1078,
+ 0x5855, 0x007c, 0x1078, 0x597c, 0x00c0, 0x596a, 0x2001, 0x000a,
+ 0x1078, 0x3443, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4445,
+ 0x0078, 0x596c, 0x1078, 0x5855, 0x007c, 0x2009, 0x738e, 0x2104,
+ 0xa086, 0x0003, 0x00c0, 0x597b, 0x2009, 0x738f, 0x2104, 0xa084,
+ 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001, 0x007c, 0x0c7e,
+ 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x34a9, 0x017f, 0x0c7f,
+ 0x007c, 0x0e7e, 0x2071, 0x738c, 0x7004, 0xa086, 0x0014, 0x00c0,
+ 0x59ac, 0x7008, 0xa086, 0x0800, 0x00c0, 0x59ac, 0x700c, 0xd0ec,
+ 0x0040, 0x59aa, 0xa084, 0x0f00, 0xa086, 0x0100, 0x00c0, 0x59aa,
+ 0x7024, 0xd0a4, 0x0040, 0x59aa, 0xd08c, 0x0040, 0x59aa, 0xa006,
+ 0x0078, 0x59ac, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x0e7e, 0x0d7e,
+ 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e, 0x127e, 0x2091,
+ 0x8000, 0x2029, 0x70bf, 0x252c, 0x2021, 0x70c5, 0x2424, 0x2061,
+ 0x7500, 0x2071, 0x6f00, 0x7244, 0x7060, 0xa202, 0x00c8, 0x5a03,
+ 0x1078, 0x6da8, 0x0040, 0x59fb, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x59fb, 0xa786, 0x0007, 0x0040, 0x59fb, 0x2500, 0xac06, 0x0040,
+ 0x59fb, 0x2400, 0xac06, 0x0040, 0x59fb, 0x0c7e, 0x6000, 0xa086,
+ 0x0004, 0x00c0, 0x59e5, 0x1078, 0x1627, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x59f8, 0xa786, 0x0003, 0x00c0, 0x5a0d, 0x6837,
+ 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x62f0,
+ 0x1078, 0x62fd, 0x0c7f, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8,
+ 0x5a03, 0x0078, 0x59c3, 0x127f, 0x007f, 0x027f, 0x047f, 0x057f,
+ 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0,
+ 0x59ef, 0x1078, 0x6d4c, 0x0078, 0x59f8, 0x220c, 0x2304, 0xa106,
+ 0x00c0, 0x5a20, 0x8210, 0x8318, 0x00f0, 0x5a15, 0xa006, 0x007c,
+ 0x2304, 0xa102, 0x0048, 0x5a28, 0x2001, 0x0001, 0x0078, 0x5a2a,
+ 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004, 0xa08a, 0x0030,
+ 0x10c8, 0x1286, 0x1078, 0x6316, 0x0040, 0x5a3c, 0x1078, 0x632a,
+ 0x0040, 0x5a45, 0x0078, 0x5a3e, 0x1078, 0x2192, 0x1078, 0x4754,
+ 0x1078, 0x55a1, 0x1078, 0x484d, 0x007c, 0x1078, 0x579c, 0x0078,
+ 0x5a3e, 0xa182, 0x0040, 0x0079, 0x5a4d, 0x5a5d, 0x5a5d, 0x5a5d,
+ 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d, 0x5a5d,
+ 0x5a5f, 0x5a5f, 0x5a5f, 0x5a5f, 0x5a5d, 0x1078, 0x1286, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x43f8, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x484d, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x5a74, 0x6004,
+ 0xa082, 0x0040, 0x0079, 0x5aea, 0xa186, 0x0027, 0x00c0, 0x5a91,
+ 0x1078, 0x4754, 0x1078, 0x2174, 0x0d7e, 0x6110, 0x2168, 0x1078,
+ 0x61dc, 0x0040, 0x5a8b, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078,
+ 0x36ec, 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x55a1, 0x1078, 0x484d,
+ 0x007c, 0xa186, 0x0014, 0x00c0, 0x5a9a, 0x6004, 0xa082, 0x0040,
+ 0x0079, 0x5aba, 0xa186, 0x0047, 0x10c0, 0x1286, 0x2001, 0x0109,
+ 0x2004, 0xd084, 0x0040, 0x5ab7, 0x127e, 0x2091, 0x2200, 0x007e,
+ 0x017e, 0x027e, 0x1078, 0x42cb, 0x027f, 0x017f, 0x007f, 0x127f,
+ 0x6000, 0xa086, 0x0002, 0x00c0, 0x5ab7, 0x0078, 0x5b11, 0x1078,
+ 0x55d5, 0x007c, 0x5acc, 0x5aca, 0x5aca, 0x5aca, 0x5aca, 0x5aca,
+ 0x5aca, 0x5aca, 0x5aca, 0x5aca, 0x5aca, 0x5ae3, 0x5ae3, 0x5ae3,
+ 0x5ae3, 0x5aca, 0x1078, 0x1286, 0x1078, 0x4754, 0x0d7e, 0x6110,
+ 0x2168, 0x1078, 0x61dc, 0x0040, 0x5add, 0x6837, 0x0103, 0x684b,
+ 0x0006, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x55a1,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x4754, 0x1078, 0x55a1, 0x1078,
+ 0x484d, 0x007c, 0x5afc, 0x5afa, 0x5afa, 0x5afa, 0x5afa, 0x5afa,
+ 0x5afa, 0x5afa, 0x5afa, 0x5afa, 0x5afa, 0x5b0a, 0x5b0a, 0x5b0a,
+ 0x5b0a, 0x5afa, 0x1078, 0x1286, 0x1078, 0x4754, 0x6003, 0x0002,
+ 0x1078, 0x484d, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400,
+ 0x200a, 0x007c, 0x1078, 0x4754, 0x6003, 0x000f, 0x1078, 0x484d,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x5b15, 0x5b25, 0x5b25, 0x5b25,
+ 0x5b25, 0x5b25, 0x5b27, 0x5bb0, 0x5bc8, 0x5b25, 0x5b25, 0x5b25,
+ 0x5b25, 0x5b25, 0x5b25, 0x5b25, 0x5b25, 0x1078, 0x1286, 0x0e7e,
+ 0x0d7e, 0x2071, 0x738c, 0x6110, 0x2168, 0x7614, 0xa6b4, 0x0fff,
+ 0x86ff, 0x0040, 0x5b94, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040,
+ 0x5b59, 0xa186, 0x0028, 0x00c0, 0x5b43, 0x1078, 0x6304, 0x684b,
+ 0x001c, 0x0078, 0x5b5b, 0xd6dc, 0x0040, 0x5b4e, 0x684b, 0x0015,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5b5b, 0xd6d4, 0x0040,
+ 0x5b59, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5b5b, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46, 0xa01e, 0xd6c4,
+ 0x0040, 0x5b6e, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019,
+ 0x7398, 0xad90, 0x0019, 0x1078, 0x5fd2, 0x037f, 0xd6cc, 0x0040,
+ 0x5ba4, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x5b82, 0x2071,
+ 0x7398, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x5fd2,
+ 0x0078, 0x5ba4, 0x6838, 0xd0fc, 0x0040, 0x5b8b, 0x2009, 0x0020,
+ 0x695a, 0x0078, 0x5b77, 0x0f7e, 0x2d78, 0x1078, 0x5f6a, 0x0f7f,
+ 0x1078, 0x5fbf, 0x0078, 0x5ba6, 0x684b, 0x0000, 0x6837, 0x0103,
+ 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x5ba4, 0x6810, 0x6914, 0xa115,
+ 0x0040, 0x5ba4, 0x1078, 0x5d18, 0x1078, 0x36ec, 0x6218, 0x2268,
+ 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078, 0x55a1, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x191c, 0x1078, 0x4464, 0x1078, 0x48fd, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1523, 0x007c, 0xa182, 0x0040, 0x0079, 0x5bd7, 0x5be7,
+ 0x5be7, 0x5be7, 0x5be7, 0x5be7, 0x5be9, 0x5c80, 0x5be7, 0x5be7,
+ 0x5c96, 0x5cf8, 0x5be7, 0x5be7, 0x5be7, 0x5be7, 0x5cff, 0x1078,
+ 0x1286, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x738c, 0x6110,
+ 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e,
+ 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x5c7b,
+ 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x5c0a, 0x7018, 0x7862,
+ 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x5c7b, 0x1078, 0x12e0,
+ 0x1040, 0x1286, 0x2d00, 0x784a, 0x7f4c, 0xc7cd, 0x7f4e, 0x6837,
+ 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46,
+ 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x5c44, 0xa186, 0x0028,
+ 0x00c0, 0x5c2e, 0x684b, 0x001c, 0x0078, 0x5c46, 0xd6dc, 0x0040,
+ 0x5c39, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5c46, 0xd6d4, 0x0040, 0x5c44, 0x684b, 0x0007, 0x7318, 0x6b62,
+ 0x731c, 0x6b5e, 0x0078, 0x5c46, 0x684b, 0x0000, 0x6f4e, 0x7850,
+ 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x5c5b, 0x7328,
+ 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7398, 0xad90, 0x0019,
+ 0x1078, 0x5fd2, 0x037f, 0xd6cc, 0x0040, 0x5c7b, 0x7124, 0x695a,
+ 0xa192, 0x0021, 0x00c8, 0x5c6f, 0x2071, 0x7398, 0x831c, 0x2300,
+ 0xae18, 0xad90, 0x001d, 0x1078, 0x5fd2, 0x0078, 0x5c7b, 0x7838,
+ 0xd0fc, 0x0040, 0x5c78, 0x2009, 0x0020, 0x695a, 0x0078, 0x5c64,
+ 0x2d78, 0x1078, 0x5f6a, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f, 0x007c,
+ 0x0f7e, 0x6003, 0x0003, 0x2079, 0x738c, 0x7c04, 0x7b00, 0x7e0c,
+ 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a, 0x7d0e, 0x0f7f,
+ 0x2c10, 0x1078, 0x191c, 0x1078, 0x4f2a, 0x007c, 0x0d7e, 0x6003,
+ 0x0002, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x6110, 0x2168, 0x694c,
+ 0xd1e4, 0x0040, 0x5cf6, 0xd1cc, 0x0040, 0x5cd1, 0x6948, 0x6838,
+ 0xd0fc, 0x0040, 0x5cc9, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e,
+ 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8,
+ 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x5cb8, 0x157f, 0x007f,
+ 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1309, 0x0078,
+ 0x5cf4, 0x017e, 0x1078, 0x1309, 0x0d7f, 0x1078, 0x5fbf, 0x0078,
+ 0x5cf4, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002,
+ 0x0040, 0x5cf0, 0xa086, 0x0028, 0x00c0, 0x5ce2, 0x684b, 0x001c,
+ 0x0078, 0x5cf2, 0xd1dc, 0x0040, 0x5ce9, 0x684b, 0x0015, 0x0078,
+ 0x5cf2, 0xd1d4, 0x0040, 0x5cf0, 0x684b, 0x0007, 0x0078, 0x5cf2,
+ 0x684b, 0x0000, 0x1078, 0x36ec, 0x1078, 0x55a1, 0x0d7f, 0x007c,
+ 0x6003, 0x0002, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x007c, 0x1078,
+ 0x47fc, 0x1078, 0x2174, 0x0d7e, 0x6110, 0x2168, 0x1078, 0x61dc,
+ 0x0040, 0x5d12, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x36ec,
+ 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x55a1, 0x1078, 0x48fd, 0x007c,
+ 0x684b, 0x0015, 0xd1fc, 0x0040, 0x5d24, 0x684b, 0x0007, 0x8002,
+ 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e, 0x007c, 0xa182,
+ 0x0040, 0x0079, 0x5d2b, 0x5d3b, 0x5d3b, 0x5d3b, 0x5d3b, 0x5d3b,
+ 0x5d3d, 0x5d3b, 0x5de1, 0x5de9, 0x5d3b, 0x5d3b, 0x5d3b, 0x5d3b,
+ 0x5d3b, 0x5d3b, 0x5d3b, 0x1078, 0x1286, 0x077e, 0x0f7e, 0x0e7e,
+ 0x0d7e, 0x2071, 0x738c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff,
+ 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211,
+ 0x6a3e, 0x86ff, 0x0040, 0x5dd3, 0xa694, 0xff00, 0xa284, 0x0c00,
+ 0x0040, 0x5d5e, 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300,
+ 0x0040, 0x5dd0, 0x1078, 0x12e0, 0x1040, 0x1286, 0x2d00, 0x784a,
+ 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a,
+ 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186,
+ 0x0002, 0x0040, 0x5d99, 0xa186, 0x0028, 0x00c0, 0x5d83, 0x684b,
+ 0x001c, 0x0078, 0x5d9b, 0xd6dc, 0x0040, 0x5d8e, 0x684b, 0x0015,
+ 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x5d9b, 0xd6d4, 0x0040,
+ 0x5d99, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078,
+ 0x5d9b, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856,
+ 0xa01e, 0xd6c4, 0x0040, 0x5db0, 0x7328, 0x732c, 0x6b56, 0x037e,
+ 0x2308, 0x2019, 0x7398, 0xad90, 0x0019, 0x1078, 0x5fd2, 0x037f,
+ 0xd6cc, 0x0040, 0x5dd0, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8,
+ 0x5dc4, 0x2071, 0x7398, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d,
+ 0x1078, 0x5fd2, 0x0078, 0x5dd0, 0x7838, 0xd0fc, 0x0040, 0x5dcd,
+ 0x2009, 0x0020, 0x695a, 0x0078, 0x5db9, 0x2d78, 0x1078, 0x5f6a,
+ 0xd6dc, 0x00c0, 0x5dd6, 0xa006, 0x0078, 0x5dda, 0x2001, 0x0001,
+ 0x7218, 0x731c, 0x1078, 0x1567, 0x0d7f, 0x0e7f, 0x0f7f, 0x077f,
+ 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1523,
+ 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168, 0x694c, 0xd1e4,
+ 0x0040, 0x5e50, 0xd1cc, 0x0040, 0x5e20, 0x6948, 0x6838, 0xd0fc,
+ 0x0040, 0x5e18, 0x017e, 0x684c, 0x007e, 0x6850, 0x007e, 0xad90,
+ 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e, 0x21a8, 0x2304,
+ 0x2012, 0x8318, 0x8210, 0x00f0, 0x5e07, 0x157f, 0x007f, 0x6852,
+ 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1309, 0x0078, 0x5e4e,
+ 0x017e, 0x1078, 0x1309, 0x0d7f, 0x1078, 0x5fbf, 0x0078, 0x5e4e,
+ 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186, 0x0002, 0x0040,
+ 0x5e3f, 0xa086, 0x0028, 0x00c0, 0x5e31, 0x684b, 0x001c, 0x0078,
+ 0x5e4c, 0xd1dc, 0x0040, 0x5e38, 0x684b, 0x0015, 0x0078, 0x5e4c,
+ 0xd1d4, 0x0040, 0x5e3f, 0x684b, 0x0007, 0x0078, 0x5e4c, 0x684b,
+ 0x0000, 0x684c, 0xd0ac, 0x0040, 0x5e4c, 0x6810, 0x6914, 0xa115,
+ 0x0040, 0x5e4c, 0x1078, 0x5d18, 0x1078, 0x36ec, 0x1078, 0x55a1,
+ 0x0d7f, 0x007c, 0x1078, 0x4754, 0x0078, 0x5e58, 0x1078, 0x47fc,
+ 0x1078, 0x61dc, 0x0040, 0x5e6f, 0x0d7e, 0x6110, 0x2168, 0x6837,
+ 0x0103, 0x2009, 0x6f0c, 0x210c, 0xd18c, 0x00c0, 0x5e78, 0xd184,
+ 0x00c0, 0x5e74, 0x6108, 0x694a, 0x1078, 0x36ec, 0x0d7f, 0x1078,
+ 0x55a1, 0x1078, 0x484d, 0x007c, 0x684b, 0x0004, 0x0078, 0x5e6c,
+ 0x684b, 0x0004, 0x0078, 0x5e6c, 0xa182, 0x0040, 0x0079, 0x5e80,
+ 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e92, 0x5e90, 0x5e95,
+ 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90, 0x5e90,
+ 0x1078, 0x1286, 0x1078, 0x55a1, 0x007c, 0x007e, 0x027e, 0xa016,
+ 0x1078, 0x1523, 0x027f, 0x007f, 0x007c, 0xa182, 0x0085, 0x0079,
+ 0x5ea1, 0x5eaa, 0x5ea8, 0x5ea8, 0x5ea8, 0x5ea8, 0x5ea8, 0x5ea8,
+ 0x1078, 0x1286, 0x6003, 0x0001, 0x6106, 0x1078, 0x43f8, 0x127e,
+ 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x007c, 0xa186, 0x0013,
+ 0x00c0, 0x5ec0, 0x6004, 0xa082, 0x0085, 0x2008, 0x0079, 0x5ef4,
+ 0xa186, 0x0027, 0x00c0, 0x5ee1, 0x1078, 0x4754, 0x1078, 0x2174,
+ 0x0d7e, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x5ed7, 0x6837,
+ 0x0103, 0x684b, 0x0029, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x0d7f,
+ 0x1078, 0x55a1, 0x1078, 0x484d, 0x007c, 0x1078, 0x55d5, 0x0078,
+ 0x5edc, 0xa186, 0x0014, 0x00c0, 0x5edd, 0x1078, 0x4754, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x5ed7, 0x6837, 0x0103,
+ 0x684b, 0x0006, 0x0078, 0x5ed3, 0x5efd, 0x5efb, 0x5efb, 0x5efb,
+ 0x5efb, 0x5efb, 0x5f06, 0x1078, 0x1286, 0x1078, 0x4754, 0x6017,
+ 0x0014, 0x6003, 0x000c, 0x1078, 0x484d, 0x007c, 0x1078, 0x4754,
+ 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x484d, 0x007c, 0xa182,
+ 0x008c, 0x00c8, 0x5f19, 0xa182, 0x0085, 0x0048, 0x5f19, 0x0079,
+ 0x5f1c, 0x1078, 0x55d5, 0x007c, 0x5f23, 0x5f23, 0x5f23, 0x5f23,
+ 0x5f25, 0x5f44, 0x5f23, 0x1078, 0x1286, 0x0d7e, 0x1078, 0x62f0,
+ 0x1078, 0x61dc, 0x0040, 0x5f40, 0x6010, 0x2068, 0x6837, 0x0103,
+ 0x6850, 0xd0b4, 0x0040, 0x5f38, 0x684b, 0x0006, 0x0078, 0x5f3c,
+ 0x684b, 0x0005, 0x1078, 0x63a3, 0x6847, 0x0000, 0x1078, 0x36ec,
+ 0x1078, 0x55a1, 0x0d7f, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x5f5f, 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040,
+ 0x5f55, 0x684b, 0x0006, 0x0078, 0x5f59, 0x684b, 0x0005, 0x1078,
+ 0x63a3, 0x6847, 0x0000, 0x1078, 0x36ec, 0x1078, 0x62f0, 0x0d7f,
+ 0x1078, 0x55a1, 0x007c, 0x1078, 0x4754, 0x1078, 0x55a1, 0x1078,
+ 0x484d, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e, 0x2029, 0x0001,
+ 0xa182, 0x0101, 0x00c8, 0x5f76, 0x0078, 0x5f78, 0x2009, 0x0100,
+ 0x2130, 0x2069, 0x7398, 0x831c, 0x2300, 0xad18, 0x2009, 0x0020,
+ 0xaf90, 0x001d, 0x1078, 0x5fd2, 0xa6b2, 0x0020, 0x7804, 0xa06d,
+ 0x0040, 0x5f8c, 0x1078, 0x1309, 0x1078, 0x12e0, 0x0040, 0x5fb6,
+ 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20, 0x7c06, 0xa68a,
+ 0x003d, 0x00c8, 0x5fa2, 0x2608, 0xad90, 0x000f, 0x1078, 0x5fd2,
+ 0x0078, 0x5fb6, 0xa6b2, 0x003c, 0x2009, 0x003c, 0x2d78, 0xad90,
+ 0x000f, 0x1078, 0x5fd2, 0x0078, 0x5f8c, 0x0f7f, 0x852f, 0xa5ad,
+ 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x5fbb, 0x0f7f, 0x852f,
+ 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f, 0x007c, 0x0f7e,
+ 0x8dff, 0x0040, 0x5fd0, 0x6804, 0xa07d, 0x0040, 0x5fce, 0x6807,
+ 0x0000, 0x1078, 0x36ec, 0x2f68, 0x0078, 0x5fc3, 0x1078, 0x36ec,
+ 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040, 0x5fd8, 0x8108,
+ 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318, 0x8210, 0x00f0,
+ 0x5fda, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000, 0x601c, 0xa084,
+ 0x0007, 0x1079, 0x5fed, 0x127f, 0x007c, 0x5ffc, 0x5ff5, 0x5ff7,
+ 0x6015, 0x5ff5, 0x5ff7, 0x5ff7, 0x5ff7, 0x1078, 0x1286, 0xa006,
+ 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010, 0x2068, 0x1078,
+ 0x61dc, 0x0040, 0x6012, 0xa00e, 0x2001, 0x0005, 0x1078, 0x377c,
+ 0x1078, 0x63a3, 0x1078, 0x36ec, 0x1078, 0x55a1, 0xa085, 0x0001,
+ 0x0d7f, 0x007c, 0xa006, 0x0078, 0x6010, 0x6000, 0xa08a, 0x0010,
+ 0x10c8, 0x1286, 0x1079, 0x601d, 0x007c, 0x602d, 0x604a, 0x602f,
+ 0x605b, 0x6046, 0x602d, 0x5ff7, 0x5ffc, 0x5ffc, 0x5ff7, 0x5ff7,
+ 0x5ff7, 0x5ff7, 0x5ff7, 0x5ff7, 0x5ff7, 0x1078, 0x1286, 0x0d7e,
+ 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x6038, 0x1078, 0x63a3,
+ 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x1078,
+ 0x43f8, 0x1078, 0x484d, 0xa085, 0x0001, 0x007c, 0x1078, 0x1627,
+ 0x0078, 0x602f, 0x0e7e, 0x2071, 0x70b6, 0x7024, 0xac06, 0x00c0,
+ 0x6053, 0x1078, 0x5075, 0x1078, 0x4fe3, 0x0e7f, 0x00c0, 0x602f,
+ 0x1078, 0x5ff7, 0x007c, 0x037e, 0x0e7e, 0x2071, 0x70b6, 0x703c,
+ 0xac06, 0x00c0, 0x6067, 0x2019, 0x0000, 0x1078, 0x5107, 0x1078,
+ 0x53e3, 0x0e7f, 0x037f, 0x00c0, 0x602f, 0x1078, 0x5ff7, 0x007c,
+ 0x0c7e, 0x601c, 0xa084, 0x0007, 0x1079, 0x6078, 0x0c7f, 0x007c,
+ 0x6086, 0x60e3, 0x6180, 0x608a, 0x6086, 0x6086, 0x6a30, 0x55a1,
+ 0x1078, 0x632a, 0x00c0, 0x6086, 0x1078, 0x579c, 0x007c, 0x6017,
+ 0x0001, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1286, 0x1079,
+ 0x6092, 0x007c, 0x60a2, 0x60a4, 0x60c4, 0x60d6, 0x60d6, 0x60a2,
+ 0x6086, 0x6086, 0x6086, 0x60d6, 0x60d6, 0x60a2, 0x60a2, 0x60a2,
+ 0x60a2, 0x60e0, 0x1078, 0x1286, 0x0e7e, 0x6010, 0x2070, 0x7050,
+ 0xc0b5, 0x7052, 0x2071, 0x70b6, 0x7024, 0xac06, 0x0040, 0x60c0,
+ 0x1078, 0x4fe3, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
+ 0x6017, 0x0014, 0x1078, 0x43f8, 0x1078, 0x484d, 0x0e7f, 0x007c,
+ 0x6017, 0x0001, 0x0078, 0x60be, 0x0d7e, 0x6010, 0x2068, 0x6850,
+ 0xc0b5, 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
+ 0x0002, 0x1078, 0x43f8, 0x1078, 0x484d, 0x007c, 0x0d7e, 0x6017,
+ 0x0001, 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c,
+ 0x1078, 0x55a1, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1286,
+ 0x1079, 0x60eb, 0x007c, 0x60fb, 0x6087, 0x60fd, 0x60fb, 0x60fb,
+ 0x60fb, 0x60fb, 0x60fb, 0x6080, 0x6080, 0x60fb, 0x60fb, 0x60fb,
+ 0x60fb, 0x60fb, 0x60fb, 0x1078, 0x1286, 0x0d7e, 0x6018, 0x2068,
+ 0x6804, 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x1286,
+ 0x1079, 0x610b, 0x007c, 0x6117, 0x6132, 0x6117, 0x6132, 0x6117,
+ 0x6132, 0x6119, 0x6122, 0x6117, 0x6132, 0x6117, 0x6127, 0x1078,
+ 0x1286, 0x6004, 0xa08e, 0x0004, 0x0040, 0x6129, 0xa08e, 0x0002,
+ 0x0040, 0x6129, 0x6004, 0x1078, 0x632a, 0x0040, 0x617c, 0x1078,
+ 0x2174, 0x1078, 0x632a, 0x00c0, 0x612f, 0x1078, 0x579c, 0x1078,
+ 0x55a1, 0x007c, 0x0c7e, 0x0d7e, 0x6104, 0xa186, 0x0016, 0x0040,
+ 0x616c, 0xa186, 0x0002, 0x00c0, 0x6157, 0x6018, 0x2068, 0x6840,
+ 0xa084, 0x00ff, 0xa005, 0x0040, 0x6157, 0x8001, 0x6842, 0x6013,
+ 0x0000, 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x553b, 0x0040,
+ 0x6157, 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x616c, 0x0d7f,
+ 0x0c7f, 0x1078, 0x632a, 0x00c0, 0x615f, 0x1078, 0x579c, 0x1078,
+ 0x2174, 0x0e7e, 0x127e, 0x2091, 0x8000, 0x1078, 0x2192, 0x127f,
+ 0x0e7f, 0x1078, 0x55a1, 0x007c, 0x2001, 0x0002, 0x1078, 0x3443,
+ 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4445, 0x1078, 0x484d,
+ 0x0d7f, 0x0c7f, 0x0078, 0x616b, 0x1078, 0x579c, 0x0078, 0x612f,
+ 0x6000, 0xa08a, 0x0010, 0x10c8, 0x1286, 0x1079, 0x6188, 0x007c,
+ 0x6198, 0x6198, 0x6198, 0x6198, 0x6198, 0x6198, 0x6198, 0x6198,
+ 0x6198, 0x6086, 0x6198, 0x6087, 0x619a, 0x6087, 0x61a3, 0x6198,
+ 0x1078, 0x1286, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078, 0x43f8,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x62f0, 0x1078, 0x61dc, 0x0040,
+ 0x61c5, 0x1078, 0x2174, 0x0d7e, 0x1078, 0x61dc, 0x0040, 0x61b8,
+ 0x6010, 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x36ec,
+ 0x0d7f, 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
+ 0x4445, 0x1078, 0x484d, 0x0078, 0x61c7, 0x1078, 0x55a1, 0x007c,
+ 0xa284, 0x0007, 0x00c0, 0x61d9, 0xa282, 0x7500, 0x0048, 0x61d9,
+ 0x2001, 0x6f15, 0x2004, 0xa202, 0x00c8, 0x61d9, 0xa085, 0x0001,
+ 0x007c, 0xa006, 0x0078, 0x61d8, 0x027e, 0x0e7e, 0x2071, 0x6f00,
+ 0x6210, 0x7058, 0xa202, 0x0048, 0x61ee, 0x705c, 0xa202, 0x00c8,
+ 0x61ee, 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078,
+ 0x61eb, 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000,
+ 0x2061, 0x7500, 0x2071, 0x6f00, 0x7344, 0x7060, 0xa302, 0x00c8,
+ 0x6217, 0x601c, 0xa206, 0x00c0, 0x620f, 0x1078, 0x632a, 0x00c0,
+ 0x620b, 0x1078, 0x579c, 0x0c7e, 0x1078, 0x55a1, 0x0c7f, 0xace0,
+ 0x0008, 0x7054, 0xac02, 0x00c8, 0x6217, 0x0078, 0x61fc, 0x127f,
+ 0x007f, 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0c7e, 0x057e, 0x127e,
+ 0x2091, 0x8000, 0x0c7e, 0x1078, 0x553b, 0x057f, 0x0040, 0x6236,
+ 0x6612, 0x651a, 0x601f, 0x0003, 0x2009, 0x004b, 0x1078, 0x55c8,
+ 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
+ 0x6232, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
+ 0x1078, 0x553b, 0x057f, 0x0040, 0x6260, 0x6013, 0x0000, 0x651a,
+ 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078, 0x3618, 0x0c7f, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078, 0x6bca, 0x2009, 0x004c,
+ 0x1078, 0x55c8, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c,
+ 0xa006, 0x0078, 0x625c, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000,
+ 0x62a0, 0x0c7e, 0x1078, 0x553b, 0x057f, 0x0040, 0x628b, 0x6612,
+ 0x651a, 0x601f, 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078,
+ 0x3618, 0x0c7f, 0x1078, 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078,
+ 0x6bca, 0x2009, 0x004d, 0x1078, 0x55c8, 0xa085, 0x0001, 0x127f,
+ 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6287, 0x0c7e, 0x057e,
+ 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x553b, 0x057f,
+ 0x0040, 0x62b6, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
+ 0x0c7e, 0x2560, 0x1078, 0x3618, 0x0c7f, 0x1078, 0x4535, 0x1078,
+ 0x4478, 0x2c08, 0x1078, 0x6bca, 0x2009, 0x004e, 0x1078, 0x55c8,
0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x69ba, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
- 0x1078, 0x5b4e, 0x057f, 0x0040, 0x69e9, 0x6612, 0x651a, 0x601f,
- 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x3958, 0x0c7f,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078, 0x7326, 0x2009,
- 0x004e, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x69e5, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x6a05, 0x660a, 0x611a,
- 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x5bdb,
- 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6a02,
- 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b4e, 0x017f,
- 0x0040, 0x6a21, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012,
- 0x2009, 0x0021, 0x1078, 0x5bdb, 0xa085, 0x0001, 0x127f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6a1e, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5b4e, 0x017f, 0x0040, 0x6a3c, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x5bdb, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6a39, 0x027e,
- 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x6a49, 0x8211,
- 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f, 0x0007,
- 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x7652,
- 0x2634, 0xd6e4, 0x0040, 0x6a61, 0x6618, 0x2660, 0x6e44, 0x1078,
- 0x3890, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, 0x017e, 0x6004,
- 0xa08e, 0x0002, 0x0040, 0x6a76, 0xa08e, 0x0003, 0x0040, 0x6a76,
- 0xa08e, 0x0004, 0x0040, 0x6a76, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0000, 0x0040, 0x6a8e,
- 0xa08e, 0x001f, 0x0040, 0x6a8e, 0xa08e, 0x0028, 0x0040, 0x6a8e,
- 0xa08e, 0x0029, 0x0040, 0x6a8e, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5b4e,
- 0x017f, 0x0040, 0x6aab, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012,
- 0x1078, 0x228f, 0x2009, 0x0028, 0x1078, 0x5bdb, 0xa085, 0x0001,
- 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6aa8, 0xa186, 0x0015,
- 0x00c0, 0x6ac3, 0x2011, 0x761e, 0x2204, 0xa086, 0x0074, 0x00c0,
- 0x6ac3, 0x1078, 0x6079, 0x6003, 0x0001, 0x6007, 0x0029, 0x1078,
- 0x4824, 0x0078, 0x6ac7, 0x1078, 0x5e09, 0x1078, 0x5bb4, 0x007c,
- 0xa186, 0x0015, 0x00c0, 0x6ae5, 0x2011, 0x761e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x6ae5, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3853,
- 0x0d7f, 0x1078, 0x6083, 0x00c0, 0x6ae5, 0x2001, 0x0006, 0x1078,
- 0x3783, 0x1078, 0x5c5f, 0x0078, 0x6ae9, 0x1078, 0x5e09, 0x1078,
- 0x5bb4, 0x007c, 0x6848, 0xa086, 0x0005, 0x00c0, 0x6af1, 0x1078,
- 0x6af2, 0x007c, 0x6850, 0xc0ad, 0x6852, 0x007c, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6b00, 0x067f, 0x007c,
- 0x6b10, 0x6ce7, 0x6dc8, 0x6b10, 0x6b10, 0x6b10, 0x6b10, 0x6b10,
- 0x6b4a, 0x6e36, 0x6b10, 0x6b10, 0x6b10, 0x6b10, 0x6b10, 0x6b10,
- 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5,
- 0x1079, 0x6b1c, 0x067f, 0x007c, 0x6b2c, 0x7137, 0x6b2c, 0x6b2c,
- 0x6b2c, 0x6b2c, 0x6b2c, 0x6b2c, 0x7112, 0x7181, 0x6b2c, 0x6b2c,
- 0x6b2c, 0x6b2c, 0x6b2c, 0x6b2c, 0x1078, 0x12d5, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6b38, 0x067f, 0x007c,
- 0x6b48, 0x6f83, 0x6ff5, 0x7017, 0x7063, 0x6b48, 0x6b48, 0x70bd,
- 0x6e42, 0x70fa, 0x70fe, 0x6b48, 0x6b48, 0x6b48, 0x6b48, 0x6b48,
- 0x1078, 0x12d5, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x2100, 0x0079,
- 0x6b51, 0x6b81, 0x6c5e, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81,
- 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81,
- 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81, 0x6b81,
- 0x6b83, 0x6bb2, 0x6bbd, 0x6be5, 0x6beb, 0x6c1f, 0x6c57, 0x6b81,
- 0x6b81, 0x6c66, 0x6b81, 0x6b81, 0x6c6d, 0x6c74, 0x6b81, 0x6b81,
- 0x6b81, 0x6b81, 0x6b81, 0x6c91, 0x6b81, 0x6b81, 0x6c9c, 0x6b81,
- 0x6b81, 0x1078, 0x12d5, 0x1078, 0x39d8, 0x6618, 0x0c7e, 0x2660,
- 0x1078, 0x37e9, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
- 0xa082, 0x0006, 0x0048, 0x6ba4, 0x1078, 0x7262, 0x00c0, 0x6bdf,
- 0x1078, 0x7200, 0x00c0, 0x6ba0, 0x6007, 0x0008, 0x0078, 0x6c59,
- 0x6007, 0x0009, 0x0078, 0x6c59, 0x1078, 0x73f7, 0x0040, 0x6bae,
- 0x1078, 0x7262, 0x0040, 0x6b98, 0x0078, 0x6bdf, 0x6013, 0x1900,
- 0x0078, 0x6ba0, 0x6106, 0x1078, 0x71c2, 0x6007, 0x0006, 0x0078,
- 0x6c59, 0x6007, 0x0007, 0x0078, 0x6c59, 0x0d7e, 0x6618, 0x2668,
- 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6bcf,
- 0xa686, 0x0004, 0x0040, 0x6bcf, 0x0d7f, 0x0078, 0x6bdf, 0x1078,
- 0x72c0, 0x00c0, 0x6bda, 0x1078, 0x3853, 0x6007, 0x000a, 0x0d7f,
- 0x0078, 0x6c59, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x6c59, 0x1078,
- 0x228f, 0x6007, 0x0001, 0x0078, 0x6c59, 0x1078, 0x228f, 0x6007,
- 0x000c, 0x0078, 0x6c59, 0x1078, 0x39d8, 0x6618, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x6c0c, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6bdf, 0x1078, 0x72cf,
- 0x00c0, 0x6c06, 0x6007, 0x000e, 0x0078, 0x6c59, 0x1078, 0x228f,
- 0x6007, 0x000f, 0x0078, 0x6c59, 0x1078, 0x73f7, 0x0040, 0x6c19,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6bfe, 0x0078,
- 0x6bdf, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6c59, 0x1078,
- 0x39d8, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082,
- 0x0006, 0x0048, 0x6c44, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x00c0, 0x6bdf, 0x1078, 0x72fa, 0x00c0, 0x6c3e, 0x1078, 0x7200,
- 0x00c0, 0x6c3e, 0x6007, 0x0010, 0x0078, 0x6c59, 0x1078, 0x228f,
- 0x6007, 0x0011, 0x0078, 0x6c59, 0x1078, 0x73f7, 0x0040, 0x6c51,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6c32, 0x0078,
- 0x6bdf, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6c59, 0x6007,
- 0x0012, 0x6003, 0x0001, 0x1078, 0x4824, 0x007c, 0x6007, 0x0001,
- 0x6003, 0x0001, 0x1078, 0x4824, 0x0078, 0x6c5d, 0x6007, 0x0020,
- 0x6003, 0x0001, 0x1078, 0x4824, 0x007c, 0x6007, 0x0023, 0x6003,
- 0x0001, 0x1078, 0x4824, 0x007c, 0x017e, 0x027e, 0x2011, 0x7b88,
- 0x2214, 0x2c08, 0x1078, 0x74bf, 0x00c0, 0x6c85, 0x2160, 0x6007,
- 0x0026, 0x6013, 0x1700, 0x0078, 0x6c8a, 0x1078, 0x5bb4, 0x2160,
- 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4824, 0x027f, 0x017f,
- 0x007c, 0x6106, 0x1078, 0x6ca3, 0x6007, 0x002b, 0x0078, 0x6c59,
- 0x6007, 0x002c, 0x0078, 0x6c59, 0x6106, 0x1078, 0x6ca8, 0x6007,
- 0x002e, 0x0078, 0x6c59, 0x0d7e, 0x1078, 0x6cce, 0x0d7f, 0x007c,
- 0x0d7e, 0x1078, 0x6cdd, 0x00c0, 0x6cc7, 0x680c, 0xa08c, 0xff00,
- 0x6824, 0xa084, 0x00ff, 0xa115, 0x6212, 0xd1e4, 0x0040, 0x6cbc,
- 0x2009, 0x0001, 0x0078, 0x6cc3, 0xd1ec, 0x0040, 0x6cc7, 0x2009,
- 0x0000, 0xa294, 0x00ff, 0x1078, 0x22d3, 0x0078, 0x6ccb, 0xa085,
- 0x0001, 0x0078, 0x6ccc, 0xa006, 0x0d7f, 0x007c, 0x2069, 0x7b8d,
- 0x6800, 0xa082, 0x0010, 0x00c8, 0x6cdb, 0x6013, 0x0000, 0xa085,
- 0x0001, 0x0078, 0x6cdc, 0xa006, 0x007c, 0x6013, 0x0000, 0x2069,
- 0x7b8c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x007c, 0x6004,
- 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6, 0x0013, 0x00c0, 0x6cf3,
- 0x2008, 0x0079, 0x6d06, 0xa1b6, 0x0027, 0x0040, 0x6cfb, 0xa1b6,
- 0x0014, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, 0x3791, 0x1078,
- 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c, 0x007c, 0x6d36, 0x6d38,
- 0x6d36, 0x6d36, 0x6d36, 0x6d38, 0x6d40, 0x6da3, 0x6d66, 0x6da3,
- 0x6d7a, 0x6da3, 0x6d40, 0x6da3, 0x6d9b, 0x6da3, 0x6d9b, 0x6da3,
- 0x6da3, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36,
- 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6d36, 0x6da3, 0x6d36,
- 0x6d36, 0x6da3, 0x6d36, 0x6da3, 0x6da3, 0x6d36, 0x6d36, 0x6d36,
- 0x6d36, 0x6da3, 0x6da3, 0x6d36, 0x6da3, 0x6da3, 0x1078, 0x12d5,
- 0x1078, 0x4b33, 0x6003, 0x0002, 0x1078, 0x4c2c, 0x0078, 0x6da9,
- 0x0f7e, 0x2079, 0x7651, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6da3,
- 0x2001, 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783,
- 0x1078, 0x4b33, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
- 0x1078, 0x4824, 0x1078, 0x4c2c, 0x0c7e, 0x6118, 0x2160, 0x2009,
- 0x0001, 0x1078, 0x452d, 0x0c7f, 0x0078, 0x6da9, 0x6618, 0x0d7e,
+ 0x62b2, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x553b,
+ 0x017f, 0x0040, 0x62d2, 0x660a, 0x611a, 0x601f, 0x0001, 0x2d00,
+ 0x6012, 0x2009, 0x001f, 0x1078, 0x55c8, 0xa085, 0x0001, 0x127f,
+ 0x0c7f, 0x007c, 0xa006, 0x0078, 0x62cf, 0x0c7e, 0x127e, 0x2091,
+ 0x8000, 0x0c7e, 0x1078, 0x553b, 0x017f, 0x0040, 0x62ed, 0x611a,
+ 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x55c8,
+ 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x62ea,
+ 0x027e, 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x62fa,
+ 0x8211, 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f,
+ 0x0007, 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e, 0x0d7e, 0x2031,
+ 0x6f52, 0x2634, 0xd6e4, 0x0040, 0x6312, 0x6618, 0x2660, 0x6e44,
+ 0x1078, 0x3550, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, 0x017e,
+ 0x6004, 0xa08e, 0x0002, 0x0040, 0x6327, 0xa08e, 0x0003, 0x0040,
+ 0x6327, 0xa08e, 0x0004, 0x0040, 0x6327, 0xa085, 0x0001, 0x017f,
+ 0x007f, 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0000, 0x0040,
+ 0x633f, 0xa08e, 0x001f, 0x0040, 0x633f, 0xa08e, 0x0028, 0x0040,
+ 0x633f, 0xa08e, 0x0029, 0x0040, 0x633f, 0xa085, 0x0001, 0x017f,
+ 0x007f, 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078,
+ 0x553b, 0x017f, 0x0040, 0x635c, 0x611a, 0x601f, 0x0001, 0x2d00,
+ 0x6012, 0x1078, 0x2174, 0x2009, 0x0028, 0x1078, 0x55c8, 0xa085,
+ 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6359, 0xa186,
+ 0x0015, 0x00c0, 0x6374, 0x2011, 0x6f1c, 0x2204, 0xa086, 0x0074,
+ 0x00c0, 0x6374, 0x1078, 0x597f, 0x6003, 0x0001, 0x6007, 0x0029,
+ 0x1078, 0x4445, 0x0078, 0x6378, 0x1078, 0x579c, 0x1078, 0x55a1,
+ 0x007c, 0xa186, 0x0015, 0x00c0, 0x6396, 0x2011, 0x6f1c, 0x2204,
+ 0xa086, 0x0014, 0x00c0, 0x6396, 0x0d7e, 0x6018, 0x2068, 0x1078,
+ 0x3513, 0x0d7f, 0x1078, 0x5989, 0x00c0, 0x6396, 0x2001, 0x0006,
+ 0x1078, 0x3443, 0x1078, 0x564b, 0x0078, 0x639a, 0x1078, 0x579c,
+ 0x1078, 0x55a1, 0x007c, 0x6848, 0xa086, 0x0005, 0x00c0, 0x63a2,
+ 0x1078, 0x63a3, 0x007c, 0x6850, 0xc0ad, 0x6852, 0x007c, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1286, 0x1079, 0x63b1, 0x067f,
+ 0x007c, 0x63c1, 0x658f, 0x6670, 0x63c1, 0x63c1, 0x63c1, 0x63c1,
+ 0x63c1, 0x63fb, 0x66d6, 0x63c1, 0x63c1, 0x63c1, 0x63c1, 0x63c1,
+ 0x63c1, 0x1078, 0x1286, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8,
+ 0x1286, 0x1079, 0x63cd, 0x067f, 0x007c, 0x63dd, 0x69df, 0x63dd,
+ 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x69ba, 0x6a29, 0x63dd,
+ 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x63dd, 0x1078, 0x1286, 0x067e,
+ 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x1286, 0x1079, 0x63e9, 0x067f,
+ 0x007c, 0x63f9, 0x6827, 0x6899, 0x68bb, 0x690b, 0x63f9, 0x63f9,
+ 0x6965, 0x66e2, 0x69a2, 0x69a6, 0x63f9, 0x63f9, 0x63f9, 0x63f9,
+ 0x63f9, 0x1078, 0x1286, 0xa1b2, 0x0030, 0x10c8, 0x1286, 0x2100,
+ 0x0079, 0x6402, 0x6432, 0x650f, 0x6432, 0x6432, 0x6432, 0x6432,
+ 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432,
+ 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432, 0x6432,
+ 0x6432, 0x6434, 0x6463, 0x646e, 0x6496, 0x649c, 0x64d0, 0x6508,
+ 0x6432, 0x6432, 0x6517, 0x6432, 0x6432, 0x6432, 0x651e, 0x6432,
+ 0x6432, 0x6432, 0x6432, 0x6432, 0x6539, 0x6432, 0x6432, 0x6544,
+ 0x6432, 0x6432, 0x1078, 0x1286, 0x1078, 0x3698, 0x6618, 0x0c7e,
+ 0x2660, 0x1078, 0x34a9, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684,
+ 0x00ff, 0xa082, 0x0006, 0x0048, 0x6455, 0x1078, 0x6b09, 0x00c0,
+ 0x6490, 0x1078, 0x6aa7, 0x00c0, 0x6451, 0x6007, 0x0008, 0x0078,
+ 0x650a, 0x6007, 0x0009, 0x0078, 0x650a, 0x1078, 0x6c9b, 0x0040,
+ 0x645f, 0x1078, 0x6b09, 0x0040, 0x6449, 0x0078, 0x6490, 0x6013,
+ 0x1900, 0x0078, 0x6451, 0x6106, 0x1078, 0x6a6a, 0x6007, 0x0006,
+ 0x0078, 0x650a, 0x6007, 0x0007, 0x0078, 0x650a, 0x0d7e, 0x6618,
+ 0x2668, 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040,
+ 0x6480, 0xa686, 0x0004, 0x0040, 0x6480, 0x0d7f, 0x0078, 0x6490,
+ 0x1078, 0x6b67, 0x00c0, 0x648b, 0x1078, 0x3513, 0x6007, 0x000a,
+ 0x0d7f, 0x0078, 0x650a, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x650a,
+ 0x1078, 0x2174, 0x6007, 0x0001, 0x0078, 0x650a, 0x1078, 0x2174,
+ 0x6007, 0x000c, 0x0078, 0x650a, 0x1078, 0x3698, 0x6618, 0xa6b0,
+ 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x64bd,
+ 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6490, 0x1078,
+ 0x6b76, 0x00c0, 0x64b7, 0x6007, 0x000e, 0x0078, 0x650a, 0x1078,
+ 0x2174, 0x6007, 0x000f, 0x0078, 0x650a, 0x1078, 0x6c9b, 0x0040,
+ 0x64ca, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64af,
+ 0x0078, 0x6490, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x650a,
+ 0x1078, 0x3698, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
+ 0xa082, 0x0006, 0x0048, 0x64f5, 0xa6b4, 0xff00, 0x8637, 0xa686,
+ 0x0006, 0x00c0, 0x6490, 0x1078, 0x6ba2, 0x00c0, 0x64ef, 0x1078,
+ 0x6aa7, 0x00c0, 0x64ef, 0x6007, 0x0010, 0x0078, 0x650a, 0x1078,
+ 0x2174, 0x6007, 0x0011, 0x0078, 0x650a, 0x1078, 0x6c9b, 0x0040,
+ 0x6502, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x64e3,
+ 0x0078, 0x6490, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x650a,
+ 0x6007, 0x0012, 0x6003, 0x0001, 0x1078, 0x4445, 0x007c, 0x6007,
+ 0x0001, 0x6003, 0x0001, 0x1078, 0x4445, 0x0078, 0x650e, 0x6007,
+ 0x0020, 0x6003, 0x0001, 0x1078, 0x4445, 0x007c, 0x017e, 0x027e,
+ 0x2011, 0x7388, 0x2214, 0x2c08, 0x1078, 0x6d63, 0x00c0, 0x652f,
+ 0x2160, 0x6007, 0x0026, 0x6013, 0x1700, 0x0078, 0x6532, 0x2160,
+ 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4445, 0x027f, 0x017f,
+ 0x007c, 0x6106, 0x1078, 0x654b, 0x6007, 0x002b, 0x0078, 0x650a,
+ 0x6007, 0x002c, 0x0078, 0x650a, 0x6106, 0x1078, 0x6550, 0x6007,
+ 0x002e, 0x0078, 0x650a, 0x0d7e, 0x1078, 0x6576, 0x0d7f, 0x007c,
+ 0x0d7e, 0x1078, 0x6585, 0x00c0, 0x656f, 0x680c, 0xa08c, 0xff00,
+ 0x6824, 0xa084, 0x00ff, 0xa115, 0x6212, 0xd1e4, 0x0040, 0x6564,
+ 0x2009, 0x0001, 0x0078, 0x656b, 0xd1ec, 0x0040, 0x656f, 0x2009,
+ 0x0000, 0xa294, 0x00ff, 0x1078, 0x21a3, 0x0078, 0x6573, 0xa085,
+ 0x0001, 0x0078, 0x6574, 0xa006, 0x0d7f, 0x007c, 0x2069, 0x738d,
+ 0x6800, 0xa082, 0x0010, 0x00c8, 0x6583, 0x6013, 0x0000, 0xa085,
+ 0x0001, 0x0078, 0x6584, 0xa006, 0x007c, 0x6013, 0x0000, 0x2069,
+ 0x738c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x007c, 0x6004,
+ 0xa0b2, 0x0030, 0x10c8, 0x1286, 0xa1b6, 0x0013, 0x00c0, 0x659b,
+ 0x2008, 0x0079, 0x65ae, 0xa1b6, 0x0027, 0x0040, 0x65a3, 0xa1b6,
+ 0x0014, 0x10c0, 0x1286, 0x2001, 0x0007, 0x1078, 0x3451, 0x1078,
+ 0x4754, 0x1078, 0x62fd, 0x1078, 0x484d, 0x007c, 0x65de, 0x65e0,
+ 0x65de, 0x65de, 0x65de, 0x65e0, 0x65e8, 0x664b, 0x660e, 0x664b,
+ 0x6622, 0x664b, 0x65e8, 0x664b, 0x6643, 0x664b, 0x6643, 0x664b,
+ 0x664b, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de,
+ 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x65de, 0x664b, 0x65de,
+ 0x65de, 0x65de, 0x65de, 0x664b, 0x664b, 0x65de, 0x65de, 0x65de,
+ 0x65de, 0x664b, 0x664b, 0x65de, 0x664b, 0x664b, 0x1078, 0x1286,
+ 0x1078, 0x4754, 0x6003, 0x0002, 0x1078, 0x484d, 0x0078, 0x6651,
+ 0x0f7e, 0x2079, 0x6f51, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x664b,
+ 0x2001, 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443,
+ 0x1078, 0x4754, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
+ 0x1078, 0x4445, 0x1078, 0x484d, 0x0c7e, 0x6118, 0x2160, 0x2009,
+ 0x0001, 0x1078, 0x4160, 0x0c7f, 0x0078, 0x6651, 0x6618, 0x0d7e,
0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x6da3, 0xa686, 0x0004, 0x0040, 0x6da3, 0x2001, 0x0004,
- 0x0078, 0x6da1, 0x2001, 0x7600, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x6d83, 0x1078, 0x2d80, 0x2001, 0x0006, 0x1078, 0x6daa, 0x6618,
+ 0x0040, 0x664b, 0xa686, 0x0004, 0x0040, 0x664b, 0x2001, 0x0004,
+ 0x0078, 0x6649, 0x2001, 0x6f00, 0x2004, 0xa086, 0x0003, 0x00c0,
+ 0x662b, 0x1078, 0x2a40, 0x2001, 0x0006, 0x1078, 0x6652, 0x6618,
0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x6da3, 0x2001, 0x0006, 0x0078, 0x6da1, 0x2001,
- 0x0004, 0x0078, 0x6da1, 0x2001, 0x0006, 0x1078, 0x6daa, 0x0078,
- 0x6da3, 0x1078, 0x3791, 0x1078, 0x4b33, 0x1078, 0x5bb4, 0x1078,
- 0x4c2c, 0x007c, 0x017e, 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184,
- 0x0040, 0x6dc5, 0x6104, 0xa18e, 0x000a, 0x00c0, 0x6dbd, 0x699c,
- 0xd1a4, 0x00c0, 0x6dbd, 0x2001, 0x0007, 0x1078, 0x3783, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x1078, 0x22b1, 0x0d7f, 0x017f, 0x007c,
+ 0x0006, 0x0040, 0x664b, 0x2001, 0x0006, 0x0078, 0x6649, 0x2001,
+ 0x0004, 0x0078, 0x6649, 0x2001, 0x0006, 0x1078, 0x6652, 0x0078,
+ 0x664b, 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x55a1, 0x1078,
+ 0x484d, 0x007c, 0x017e, 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184,
+ 0x0040, 0x666d, 0x6104, 0xa18e, 0x000a, 0x00c0, 0x6665, 0x699c,
+ 0xd1a4, 0x00c0, 0x6665, 0x2001, 0x0007, 0x1078, 0x3443, 0x2001,
+ 0x0000, 0x1078, 0x342f, 0x1078, 0x2192, 0x0d7f, 0x017f, 0x007c,
0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0xff00, 0x8007, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0xa1b6, 0x0015, 0x00c0, 0x6ddc,
- 0x1079, 0x6de3, 0x0078, 0x6de2, 0xa1b6, 0x0016, 0x10c0, 0x12d5,
- 0x1079, 0x6e1b, 0x007c, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x5e93,
- 0x5e93, 0x5e93, 0x6def, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x0f7e,
- 0x2079, 0x7651, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6e0b, 0x2001,
- 0x0000, 0x1078, 0x376f, 0x2001, 0x0002, 0x1078, 0x3783, 0x601f,
- 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4824, 0x1078,
- 0x4c2c, 0x0078, 0x6e1a, 0x2011, 0x7b83, 0x220c, 0x017e, 0x0c7e,
- 0x1078, 0x37d7, 0x00c0, 0x6e1a, 0x1078, 0x35db, 0x0c7f, 0x017f,
- 0x1078, 0x5bb4, 0x007c, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x5e93,
- 0x5e93, 0x5e93, 0x6e27, 0x5e93, 0x5e93, 0x5e93, 0x5e93, 0x1078,
- 0x6076, 0x00c0, 0x6e33, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
- 0x4824, 0x0078, 0x6e35, 0x1078, 0x5bb4, 0x007c, 0x6004, 0xa08a,
- 0x0030, 0x10c8, 0x12d5, 0x1078, 0x4b33, 0x1078, 0x6a4c, 0x1078,
- 0x4c2c, 0x007c, 0xa182, 0x0040, 0x0079, 0x6e46, 0x6e56, 0x6e56,
- 0x6e56, 0x6e56, 0x6e58, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56,
- 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x1078, 0x12d5,
+ 0xa0b2, 0x000c, 0x10c8, 0x1286, 0xa1b6, 0x0015, 0x00c0, 0x6684,
+ 0x1079, 0x668b, 0x0078, 0x668a, 0xa1b6, 0x0016, 0x10c0, 0x1286,
+ 0x1079, 0x66bb, 0x007c, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x57f9,
+ 0x57f9, 0x57f9, 0x6697, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x0f7e,
+ 0x2079, 0x6f51, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x66b3, 0x2001,
+ 0x0000, 0x1078, 0x342f, 0x2001, 0x0002, 0x1078, 0x3443, 0x601f,
+ 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4445, 0x1078,
+ 0x484d, 0x0078, 0x66ba, 0x2011, 0x7383, 0x220c, 0x1078, 0x329b,
+ 0x1078, 0x55a1, 0x007c, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x57f9,
+ 0x57f9, 0x57f9, 0x66c7, 0x57f9, 0x57f9, 0x57f9, 0x57f9, 0x1078,
+ 0x597c, 0x00c0, 0x66d3, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
+ 0x4445, 0x0078, 0x66d5, 0x1078, 0x55a1, 0x007c, 0x6004, 0xa08a,
+ 0x0030, 0x10c8, 0x1286, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078,
+ 0x484d, 0x007c, 0xa182, 0x0040, 0x0079, 0x66e6, 0x66f6, 0x66f6,
+ 0x66f6, 0x66f6, 0x66f8, 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x66f6,
+ 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x66f6, 0x1078, 0x1286,
0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e, 0x027e, 0x6106, 0x2071,
- 0x7b80, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x6ec9, 0xa486, 0x2000,
- 0x0040, 0x6e88, 0xa486, 0x0400, 0x0040, 0x6e88, 0x7130, 0xa18c,
- 0x00ff, 0xa182, 0x0010, 0x00c8, 0x6f5b, 0x0c7e, 0x1078, 0x45be,
- 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6f3c, 0x1078,
- 0x467c, 0x0040, 0x6f67, 0xa295, 0x0200, 0x6a02, 0x0078, 0x6e8e,
- 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x4666, 0x1078, 0x132f,
- 0x1040, 0x12d5, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803,
+ 0x7380, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x6769, 0xa486, 0x2000,
+ 0x0040, 0x6728, 0xa486, 0x0400, 0x0040, 0x6728, 0x7130, 0xa18c,
+ 0x00ff, 0xa182, 0x0010, 0x00c8, 0x67fb, 0x0c7e, 0x1078, 0x41f1,
+ 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x67dc, 0x1078,
+ 0x42af, 0x0040, 0x6807, 0xa295, 0x0200, 0x6a02, 0x0078, 0x672e,
+ 0x2009, 0x0001, 0x2011, 0x0200, 0x1078, 0x4299, 0x1078, 0x12e0,
+ 0x1040, 0x1286, 0x6003, 0x0007, 0x2d00, 0x6837, 0x010d, 0x6803,
0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00, 0x685e, 0x6018, 0x2078,
0x78a0, 0x8007, 0x7130, 0xa18c, 0x00ff, 0xa10d, 0x6946, 0x684f,
- 0x0000, 0x6857, 0x0036, 0x1078, 0x3a2c, 0xa486, 0x2000, 0x00c0,
- 0x6eb7, 0x2019, 0x0017, 0x1078, 0x7484, 0x0078, 0x6f29, 0xa486,
- 0x0400, 0x00c0, 0x6ec1, 0x2019, 0x0002, 0x1078, 0x7484, 0x0078,
- 0x6f29, 0xa486, 0x0200, 0x00c0, 0x6ec7, 0x1078, 0x7475, 0x0078,
- 0x6f29, 0x7130, 0xa184, 0xff00, 0x00c0, 0x6f7b, 0xa18c, 0x00ff,
- 0xa182, 0x0010, 0x00c8, 0x6f7b, 0x0c7e, 0x1078, 0x45be, 0x2c68,
- 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6f7f, 0xa284, 0x0300,
- 0x00c0, 0x6f77, 0x6804, 0xa005, 0x0040, 0x6f67, 0x8001, 0x6806,
- 0x6003, 0x0007, 0x1078, 0x1314, 0x0040, 0x6f30, 0x6013, 0x0000,
+ 0x0000, 0x6857, 0x0036, 0x1078, 0x36ec, 0xa486, 0x2000, 0x00c0,
+ 0x6757, 0x2019, 0x0017, 0x1078, 0x6d28, 0x0078, 0x67c9, 0xa486,
+ 0x0400, 0x00c0, 0x6761, 0x2019, 0x0002, 0x1078, 0x6d28, 0x0078,
+ 0x67c9, 0xa486, 0x0200, 0x00c0, 0x6767, 0x1078, 0x6d19, 0x0078,
+ 0x67c9, 0x7130, 0xa184, 0xff00, 0x00c0, 0x681f, 0xa18c, 0x00ff,
+ 0xa182, 0x0010, 0x00c8, 0x681f, 0x0c7e, 0x1078, 0x41f1, 0x2c68,
+ 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x6823, 0xa284, 0x0300,
+ 0x00c0, 0x681b, 0x6804, 0xa005, 0x0040, 0x6807, 0x8001, 0x6806,
+ 0x6003, 0x0007, 0x1078, 0x12c5, 0x0040, 0x67d0, 0x6013, 0x0000,
0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000, 0x2c00, 0x684a,
0x6018, 0x2078, 0x78a0, 0x8007, 0xa10d, 0x6946, 0x6853, 0x003d,
- 0x7044, 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x6f0b, 0x684f,
- 0x0040, 0x0078, 0x6f15, 0xa086, 0x0001, 0x00c0, 0x6f13, 0x684f,
- 0x0080, 0x0078, 0x6f15, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001,
- 0x7b90, 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210,
- 0x00f0, 0x6f1b, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078,
- 0x3a2c, 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c,
- 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x47d7,
- 0x1078, 0x4c2c, 0x0078, 0x6f29, 0x2069, 0x7b92, 0x2d04, 0xa084,
- 0xff00, 0xa086, 0x1200, 0x00c0, 0x6f5b, 0x2069, 0x7b80, 0x686c,
+ 0x7044, 0xa084, 0x0003, 0xa086, 0x0002, 0x00c0, 0x67ab, 0x684f,
+ 0x0040, 0x0078, 0x67b5, 0xa086, 0x0001, 0x00c0, 0x67b3, 0x684f,
+ 0x0080, 0x0078, 0x67b5, 0x684f, 0x0000, 0x20a9, 0x000a, 0x2001,
+ 0x7390, 0xad90, 0x0015, 0x200c, 0x810f, 0x2112, 0x8000, 0x8210,
+ 0x00f0, 0x67bb, 0x200c, 0x6982, 0x8000, 0x200c, 0x697e, 0x1078,
+ 0x36ec, 0x027f, 0x047f, 0x157f, 0x0f7f, 0x0e7f, 0x0d7f, 0x007c,
+ 0x6013, 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x43f8,
+ 0x1078, 0x484d, 0x0078, 0x67c9, 0x2069, 0x7392, 0x2d04, 0xa084,
+ 0xff00, 0xa086, 0x1200, 0x00c0, 0x67fb, 0x2069, 0x7380, 0x686c,
0xa084, 0x00ff, 0x017e, 0x6110, 0xa18c, 0x0700, 0xa10d, 0x6112,
- 0x017f, 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x47d7, 0x1078,
- 0x4c2c, 0x0078, 0x6f29, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007,
- 0x0041, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0078, 0x6f29, 0x6013,
- 0x0300, 0x0078, 0x6f6d, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007,
- 0x0041, 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0078, 0x6f29, 0x6013,
- 0x0500, 0x0078, 0x6f6d, 0x6013, 0x0600, 0x0078, 0x6f3c, 0x6013,
- 0x0200, 0x0078, 0x6f3c, 0xa186, 0x0013, 0x00c0, 0x6f95, 0x6004,
- 0xa08a, 0x0040, 0x1048, 0x12d5, 0xa08a, 0x0050, 0x10c8, 0x12d5,
- 0xa082, 0x0040, 0x2008, 0x0079, 0x6fc6, 0xa186, 0x0047, 0x00c0,
- 0x6f9b, 0x0078, 0x6ff5, 0xa186, 0x0027, 0x0040, 0x6fa3, 0xa186,
- 0x0014, 0x10c0, 0x12d5, 0x6004, 0xa082, 0x0040, 0x2008, 0x0079,
- 0x6fa9, 0x6fb9, 0x6fbb, 0x6fbb, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9,
- 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9, 0x6fb9,
- 0x6fb9, 0x1078, 0x12d5, 0x2001, 0x0007, 0x1078, 0x3791, 0x1078,
- 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c, 0x007c, 0x6fd6, 0x6fe6,
- 0x6fdf, 0x6fef, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6,
- 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x6fd6, 0x1078, 0x12d5,
- 0x6010, 0xa088, 0x0013, 0x2104, 0xa085, 0x0400, 0x200a, 0x1078,
- 0x4b33, 0x6003, 0x0002, 0x1078, 0x4c2c, 0x007c, 0x1078, 0x4b33,
- 0x1078, 0x463f, 0x1078, 0x5bb4, 0x1078, 0x4c2c, 0x007c, 0x1078,
- 0x4b33, 0x2009, 0x0041, 0x0078, 0x70bd, 0xa182, 0x0040, 0x0079,
- 0x6ff9, 0x7009, 0x700b, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009,
- 0x700c, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009, 0x7009,
- 0x7009, 0x1078, 0x12d5, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0xa182,
- 0x0040, 0x0079, 0x701b, 0x702b, 0x702b, 0x702b, 0x702b, 0x702b,
- 0x702b, 0x702b, 0x702b, 0x702b, 0x702d, 0x7050, 0x702b, 0x702b,
- 0x702b, 0x702b, 0x7050, 0x1078, 0x12d5, 0x1078, 0x4bdb, 0x1078,
- 0x4cec, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc, 0x0040, 0x7043,
- 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0040, 0x7049, 0x2009, 0x0041,
- 0x0d7f, 0x0078, 0x70bd, 0x6003, 0x0007, 0x1078, 0x463f, 0x0d7f,
- 0x007c, 0x1078, 0x463f, 0x1078, 0x5bb4, 0x0d7f, 0x0078, 0x7048,
- 0x037e, 0x1078, 0x4bdb, 0x1078, 0x4cec, 0x6010, 0x0d7e, 0x2068,
- 0x2019, 0x0004, 0x1078, 0x74a8, 0x1078, 0x6a4c, 0x6017, 0x0028,
- 0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x7071, 0x6004,
- 0xa086, 0x0042, 0x10c0, 0x12d5, 0x1078, 0x4b33, 0x1078, 0x4c2c,
- 0x007c, 0xa186, 0x0027, 0x0040, 0x7079, 0xa186, 0x0014, 0x00c0,
- 0x7089, 0x6004, 0xa086, 0x0042, 0x10c0, 0x12d5, 0x2001, 0x0007,
- 0x1078, 0x3791, 0x1078, 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x708d, 0x709d, 0x709d, 0x709d,
- 0x709d, 0x709d, 0x709d, 0x709d, 0x709f, 0x70ab, 0x709d, 0x709d,
- 0x709d, 0x709d, 0x709d, 0x709d, 0x709d, 0x1078, 0x12d5, 0x037e,
- 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572,
+ 0x017f, 0x6003, 0x0001, 0x6007, 0x0043, 0x1078, 0x43f8, 0x1078,
+ 0x484d, 0x0078, 0x67c9, 0x6013, 0x0200, 0x6003, 0x0001, 0x6007,
+ 0x0041, 0x1078, 0x43f8, 0x1078, 0x484d, 0x0078, 0x67c9, 0xa284,
+ 0x0004, 0x00c0, 0x680f, 0x6013, 0x0300, 0x0078, 0x6811, 0x6013,
+ 0x0100, 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x43f8, 0x1078,
+ 0x484d, 0x0078, 0x67c9, 0x6013, 0x0500, 0x0078, 0x6811, 0x6013,
+ 0x0600, 0x0078, 0x67dc, 0x6013, 0x0200, 0x0078, 0x67dc, 0xa186,
+ 0x0013, 0x00c0, 0x6839, 0x6004, 0xa08a, 0x0040, 0x1048, 0x1286,
+ 0xa08a, 0x0050, 0x10c8, 0x1286, 0xa082, 0x0040, 0x2008, 0x0079,
+ 0x686a, 0xa186, 0x0047, 0x00c0, 0x683f, 0x0078, 0x6899, 0xa186,
+ 0x0027, 0x0040, 0x6847, 0xa186, 0x0014, 0x10c0, 0x1286, 0x6004,
+ 0xa082, 0x0040, 0x2008, 0x0079, 0x684d, 0x685d, 0x685f, 0x685f,
+ 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x685d,
+ 0x685d, 0x685d, 0x685d, 0x685d, 0x685d, 0x1078, 0x1286, 0x2001,
+ 0x0007, 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078,
+ 0x484d, 0x007c, 0x687a, 0x688a, 0x6883, 0x6893, 0x687a, 0x687a,
+ 0x687a, 0x687a, 0x687a, 0x687a, 0x687a, 0x687a, 0x687a, 0x687a,
+ 0x687a, 0x687a, 0x1078, 0x1286, 0x6010, 0xa088, 0x0013, 0x2104,
+ 0xa085, 0x0400, 0x200a, 0x1078, 0x4754, 0x6003, 0x0002, 0x1078,
+ 0x484d, 0x007c, 0x1078, 0x4754, 0x1078, 0x4272, 0x1078, 0x55a1,
+ 0x1078, 0x484d, 0x007c, 0x1078, 0x4754, 0x2009, 0x0041, 0x0078,
+ 0x6965, 0xa182, 0x0040, 0x0079, 0x689d, 0x68ad, 0x68af, 0x68ad,
+ 0x68ad, 0x68ad, 0x68ad, 0x68ad, 0x68b0, 0x68ad, 0x68ad, 0x68ad,
+ 0x68ad, 0x68ad, 0x68ad, 0x68ad, 0x68ad, 0x1078, 0x1286, 0x007c,
+ 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
+ 0x1078, 0x1523, 0x007c, 0xa182, 0x0040, 0x0079, 0x68bf, 0x68cf,
+ 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68cf,
+ 0x68d1, 0x68f4, 0x68cf, 0x68cf, 0x68cf, 0x68cf, 0x68f4, 0x1078,
+ 0x1286, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x6010, 0x0d7e, 0x2068,
+ 0x684c, 0xd0fc, 0x0040, 0x68e7, 0xa08c, 0x0003, 0xa18e, 0x0002,
+ 0x0040, 0x68ed, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6965, 0x6003,
+ 0x0007, 0x1078, 0x4272, 0x0d7f, 0x007c, 0x1078, 0x4272, 0x1078,
+ 0x55a1, 0x0d7f, 0x0078, 0x68ec, 0x037e, 0x2019, 0x0001, 0x1078,
+ 0x5107, 0x1078, 0x47fc, 0x1078, 0x48fd, 0x6010, 0x0d7e, 0x2068,
+ 0x2019, 0x0004, 0x1078, 0x6d4c, 0x1078, 0x62fd, 0x6017, 0x0028,
+ 0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x6919, 0x6004,
+ 0xa086, 0x0042, 0x10c0, 0x1286, 0x1078, 0x4754, 0x1078, 0x484d,
+ 0x007c, 0xa186, 0x0027, 0x0040, 0x6921, 0xa186, 0x0014, 0x00c0,
+ 0x6931, 0x6004, 0xa086, 0x0042, 0x10c0, 0x1286, 0x2001, 0x0007,
+ 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078, 0x484d,
+ 0x007c, 0xa182, 0x0040, 0x0079, 0x6935, 0x6945, 0x6945, 0x6945,
+ 0x6945, 0x6945, 0x6945, 0x6945, 0x6947, 0x6953, 0x6945, 0x6945,
+ 0x6945, 0x6945, 0x6945, 0x6945, 0x6945, 0x1078, 0x1286, 0x037e,
+ 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1523,
0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e, 0x2068, 0x684c, 0xd0fc,
- 0x0040, 0x70b7, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x70bd, 0x6003,
- 0x0007, 0x1078, 0x463f, 0x0d7f, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x70c1, 0x70d1, 0x70d3, 0x70df, 0x70eb, 0x70d1, 0x70d1, 0x70d1,
- 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1, 0x70d1,
- 0x70d1, 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x47d7,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x4c2c, 0x127f, 0x007c, 0x6003,
- 0x0001, 0x6106, 0x1078, 0x47d7, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4c2c, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078,
- 0x19a7, 0x127e, 0x2091, 0x8000, 0x1078, 0x4843, 0x1078, 0x4cec,
- 0x127f, 0x007c, 0x1078, 0x4b33, 0x0078, 0x7100, 0x1078, 0x4bdb,
- 0x6110, 0x81ff, 0x0040, 0x710d, 0x0d7e, 0x2168, 0x037e, 0x2019,
- 0x0029, 0x1078, 0x74a8, 0x037f, 0x0d7f, 0x1078, 0x6a4c, 0x1078,
- 0x4c2c, 0x007c, 0xa182, 0x0085, 0x0079, 0x7116, 0x711d, 0x711d,
- 0x711d, 0x711f, 0x711d, 0x711d, 0x711d, 0x1078, 0x12d5, 0x027e,
- 0x0e7e, 0x2071, 0x7b80, 0x7220, 0x1078, 0x73c2, 0x0040, 0x712c,
- 0x6007, 0x0086, 0x0078, 0x712e, 0x6007, 0x0087, 0x6003, 0x0001,
- 0x1078, 0x47d7, 0x1078, 0x4c2c, 0x0e7f, 0x027f, 0x007c, 0xa186,
- 0x0013, 0x00c0, 0x7148, 0x6004, 0xa08a, 0x0085, 0x1048, 0x12d5,
- 0xa08a, 0x008c, 0x10c8, 0x12d5, 0xa082, 0x0085, 0x0079, 0x715b,
- 0xa186, 0x0027, 0x0040, 0x7150, 0xa186, 0x0014, 0x10c0, 0x12d5,
- 0x2001, 0x0007, 0x1078, 0x3791, 0x1078, 0x4b33, 0x1078, 0x6a4c,
- 0x1078, 0x4c2c, 0x007c, 0x7162, 0x7164, 0x7164, 0x7162, 0x7162,
- 0x7162, 0x7162, 0x1078, 0x12d5, 0x1078, 0x4b33, 0x1078, 0x5bb4,
- 0x1078, 0x4c2c, 0x007c, 0xa182, 0x0085, 0x1048, 0x12d5, 0xa182,
- 0x008c, 0x10c8, 0x12d5, 0xa182, 0x0085, 0x0079, 0x7177, 0x717e,
- 0x717e, 0x717e, 0x7180, 0x717e, 0x717e, 0x717e, 0x1078, 0x12d5,
- 0x007c, 0x1078, 0x4b33, 0x1078, 0x6a4c, 0x1078, 0x4c2c, 0x007c,
- 0x037e, 0x2019, 0x000b, 0x1078, 0x7191, 0x601f, 0x0006, 0x037f,
+ 0x0040, 0x695f, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x6965, 0x6003,
+ 0x0007, 0x1078, 0x4272, 0x0d7f, 0x007c, 0xa182, 0x0040, 0x0079,
+ 0x6969, 0x6979, 0x697b, 0x6987, 0x6993, 0x6979, 0x6979, 0x6979,
+ 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979, 0x6979,
+ 0x6979, 0x1078, 0x1286, 0x6003, 0x0001, 0x6106, 0x1078, 0x43f8,
+ 0x127e, 0x2091, 0x8000, 0x1078, 0x484d, 0x127f, 0x007c, 0x6003,
+ 0x0001, 0x6106, 0x1078, 0x43f8, 0x127e, 0x2091, 0x8000, 0x1078,
+ 0x484d, 0x127f, 0x007c, 0x6003, 0x0003, 0x6106, 0x2c10, 0x1078,
+ 0x191c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4464, 0x1078, 0x48fd,
+ 0x127f, 0x007c, 0x1078, 0x4754, 0x0078, 0x69a8, 0x1078, 0x47fc,
+ 0x6110, 0x81ff, 0x0040, 0x69b5, 0x0d7e, 0x2168, 0x037e, 0x2019,
+ 0x0029, 0x1078, 0x6d4c, 0x037f, 0x0d7f, 0x1078, 0x62fd, 0x1078,
+ 0x484d, 0x007c, 0xa182, 0x0085, 0x0079, 0x69be, 0x69c5, 0x69c5,
+ 0x69c5, 0x69c7, 0x69c5, 0x69c5, 0x69c5, 0x1078, 0x1286, 0x027e,
+ 0x0e7e, 0x2071, 0x7380, 0x7220, 0x1078, 0x6c66, 0x0040, 0x69d4,
+ 0x6007, 0x0086, 0x0078, 0x69d6, 0x6007, 0x0087, 0x6003, 0x0001,
+ 0x1078, 0x43f8, 0x1078, 0x484d, 0x0e7f, 0x027f, 0x007c, 0xa186,
+ 0x0013, 0x00c0, 0x69f0, 0x6004, 0xa08a, 0x0085, 0x1048, 0x1286,
+ 0xa08a, 0x008c, 0x10c8, 0x1286, 0xa082, 0x0085, 0x0079, 0x6a03,
+ 0xa186, 0x0027, 0x0040, 0x69f8, 0xa186, 0x0014, 0x10c0, 0x1286,
+ 0x2001, 0x0007, 0x1078, 0x3451, 0x1078, 0x4754, 0x1078, 0x62fd,
+ 0x1078, 0x484d, 0x007c, 0x6a0a, 0x6a0c, 0x6a0c, 0x6a0a, 0x6a0a,
+ 0x6a0a, 0x6a0a, 0x1078, 0x1286, 0x1078, 0x4754, 0x1078, 0x55a1,
+ 0x1078, 0x484d, 0x007c, 0xa182, 0x0085, 0x1048, 0x1286, 0xa182,
+ 0x008c, 0x10c8, 0x1286, 0xa182, 0x0085, 0x0079, 0x6a1f, 0x6a26,
+ 0x6a26, 0x6a26, 0x6a28, 0x6a26, 0x6a26, 0x6a26, 0x1078, 0x1286,
+ 0x007c, 0x1078, 0x4754, 0x1078, 0x62fd, 0x1078, 0x484d, 0x007c,
+ 0x037e, 0x2019, 0x000b, 0x1078, 0x6a39, 0x601f, 0x0006, 0x037f,
0x007c, 0x127e, 0x037e, 0x087e, 0x2091, 0x8000, 0x2c40, 0x1078,
- 0x58c7, 0x00c0, 0x71be, 0x1078, 0x5968, 0x00c0, 0x71be, 0x6000,
- 0xa086, 0x0000, 0x0040, 0x71be, 0x601c, 0xa086, 0x0007, 0x0040,
- 0x71be, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x71b1, 0x1078,
- 0x1676, 0x6010, 0x2068, 0x1078, 0x68e3, 0x0040, 0x71b9, 0x1078,
- 0x74a8, 0x0d7f, 0x6013, 0x0000, 0x601f, 0x0007, 0x087f, 0x037f,
- 0x127f, 0x007c, 0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7b80,
- 0x7838, 0xa08c, 0x00ff, 0x783c, 0x1078, 0x2059, 0x00c0, 0x71f9,
- 0x017e, 0x0c7e, 0x1078, 0x37d7, 0x00c0, 0x71f9, 0x2011, 0x7b90,
- 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x610f, 0x00c0, 0x71f9,
- 0x017f, 0x027f, 0x027e, 0x017e, 0x2019, 0x0029, 0x1078, 0x5a3c,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x017f, 0x1078, 0x7326, 0x1078,
- 0x3958, 0x017f, 0x1078, 0x35db, 0x6612, 0x6516, 0xa006, 0x0078,
- 0x71fb, 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c,
- 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x761e, 0x2104, 0xa086, 0x0074,
- 0x00c0, 0x7257, 0x2069, 0x7b8e, 0x690c, 0xa182, 0x0100, 0x0048,
- 0x7247, 0x6908, 0xa184, 0x8000, 0x0040, 0x7253, 0xa184, 0x0800,
- 0x0040, 0x7253, 0x6910, 0xa18a, 0x0001, 0x0048, 0x724b, 0x6914,
- 0x2069, 0x7bae, 0x6904, 0x81ff, 0x00c0, 0x723f, 0x690c, 0xa182,
- 0x0100, 0x0048, 0x7247, 0x6908, 0x81ff, 0x00c0, 0x7243, 0x6910,
- 0xa18a, 0x0001, 0x0048, 0x724b, 0x6918, 0xa18a, 0x0001, 0x0048,
- 0x7253, 0x0078, 0x725d, 0x6013, 0x0100, 0x0078, 0x7259, 0x6013,
- 0x0300, 0x0078, 0x7259, 0x6013, 0x0500, 0x0078, 0x7259, 0x6013,
- 0x0700, 0x0078, 0x7259, 0x6013, 0x0900, 0x0078, 0x7259, 0x6013,
- 0x0b00, 0x0078, 0x7259, 0x6013, 0x0f00, 0x0078, 0x7259, 0x6013,
- 0x2d00, 0xa085, 0x0001, 0x0078, 0x725e, 0xa006, 0x017f, 0x0d7f,
- 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218,
- 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040, 0x7286,
- 0xa286, 0x0004, 0x0040, 0x7286, 0xa394, 0xff00, 0x8217, 0xa286,
- 0x0006, 0x0040, 0x7286, 0xa286, 0x0004, 0x0040, 0x7286, 0x0c7e,
- 0x2d60, 0x1078, 0x37e9, 0x0c7f, 0x0078, 0x72b9, 0x2011, 0x7b96,
- 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x610f, 0x00c0, 0x72ba,
- 0x2011, 0x7b9a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x610f,
- 0x00c0, 0x72ba, 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227,
- 0xa006, 0x2009, 0x7652, 0x210c, 0xd1a4, 0x0040, 0x72ae, 0x2009,
- 0x0029, 0x1078, 0x74ec, 0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029,
- 0x1078, 0x4914, 0x1078, 0x4857, 0x2c08, 0x1078, 0x7326, 0x017f,
- 0x047f, 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c,
- 0x0d7e, 0x2069, 0x7b8e, 0x6800, 0xa086, 0x0800, 0x0040, 0x72cc,
- 0x6013, 0x0000, 0x0078, 0x72cd, 0xa006, 0x0d7f, 0x007c, 0x0c7e,
- 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, 0x7b8c, 0x7930,
- 0x7834, 0x1078, 0x2059, 0x00c0, 0x72f3, 0x1078, 0x37d7, 0x00c0,
- 0x72f3, 0x2011, 0x7b90, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x610f, 0x00c0, 0x72f3, 0x2011, 0x7b94, 0xac98, 0x0006, 0x20a9,
- 0x0004, 0x1078, 0x610f, 0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f,
+ 0x52b4, 0x00c0, 0x6a66, 0x1078, 0x5355, 0x00c0, 0x6a66, 0x6000,
+ 0xa086, 0x0000, 0x0040, 0x6a66, 0x601c, 0xa086, 0x0007, 0x0040,
+ 0x6a66, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6a59, 0x1078,
+ 0x1627, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x6a61, 0x1078,
+ 0x6d4c, 0x0d7f, 0x6013, 0x0000, 0x601f, 0x0007, 0x087f, 0x037f,
+ 0x127f, 0x007c, 0x0f7e, 0x0c7e, 0x037e, 0x157e, 0x2079, 0x7380,
+ 0x7838, 0xa084, 0x00ff, 0xa005, 0x00c0, 0x6aa2, 0x783c, 0x1078,
+ 0x1fb0, 0x017e, 0x0c7e, 0x1078, 0x3497, 0x00c0, 0x6aa0, 0x2011,
+ 0x7390, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a15, 0x00c0,
+ 0x6aa0, 0x017f, 0x027f, 0x027e, 0x017e, 0x2019, 0x0029, 0x1078,
+ 0x5429, 0x1078, 0x4535, 0x1078, 0x4478, 0x017f, 0x1078, 0x6bca,
+ 0x1078, 0x3618, 0x017f, 0x1078, 0x329b, 0xa006, 0x0078, 0x6aa2,
+ 0x0c7f, 0x017f, 0x157f, 0x037f, 0x0c7f, 0x0f7f, 0x007c, 0x0c7e,
+ 0x0d7e, 0x017e, 0x2009, 0x6f1c, 0x2104, 0xa086, 0x0074, 0x00c0,
+ 0x6afe, 0x2069, 0x738e, 0x690c, 0xa182, 0x0100, 0x0048, 0x6aee,
+ 0x6908, 0xa184, 0x8000, 0x0040, 0x6afa, 0xa184, 0x0800, 0x0040,
+ 0x6afa, 0x6910, 0xa18a, 0x0001, 0x0048, 0x6af2, 0x6914, 0x2069,
+ 0x73ae, 0x6904, 0x81ff, 0x00c0, 0x6ae6, 0x690c, 0xa182, 0x0100,
+ 0x0048, 0x6aee, 0x6908, 0x81ff, 0x00c0, 0x6aea, 0x6910, 0xa18a,
+ 0x0001, 0x0048, 0x6af2, 0x6918, 0xa18a, 0x0001, 0x0048, 0x6afa,
+ 0x0078, 0x6b04, 0x6013, 0x0100, 0x0078, 0x6b00, 0x6013, 0x0300,
+ 0x0078, 0x6b00, 0x6013, 0x0500, 0x0078, 0x6b00, 0x6013, 0x0700,
+ 0x0078, 0x6b00, 0x6013, 0x0900, 0x0078, 0x6b00, 0x6013, 0x0b00,
+ 0x0078, 0x6b00, 0x6013, 0x0f00, 0x0078, 0x6b00, 0x6013, 0x2d00,
+ 0xa085, 0x0001, 0x0078, 0x6b05, 0xa006, 0x017f, 0x0d7f, 0x0c7f,
+ 0x007c, 0x0c7e, 0x0d7e, 0x027e, 0x037e, 0x157e, 0x6218, 0x2268,
+ 0x6b04, 0xa394, 0x00ff, 0xa286, 0x0006, 0x0040, 0x6b2d, 0xa286,
+ 0x0004, 0x0040, 0x6b2d, 0xa394, 0xff00, 0x8217, 0xa286, 0x0006,
+ 0x0040, 0x6b2d, 0xa286, 0x0004, 0x0040, 0x6b2d, 0x0c7e, 0x2d60,
+ 0x1078, 0x34a9, 0x0c7f, 0x0078, 0x6b60, 0x2011, 0x7396, 0xad98,
+ 0x000a, 0x20a9, 0x0004, 0x1078, 0x5a15, 0x00c0, 0x6b61, 0x2011,
+ 0x739a, 0xad98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x5a15, 0x00c0,
+ 0x6b61, 0x047e, 0x017e, 0x6aa0, 0xa294, 0x00ff, 0x8227, 0xa006,
+ 0x2009, 0x6f52, 0x210c, 0xd1a4, 0x0040, 0x6b55, 0x2009, 0x0029,
+ 0x1078, 0x6d90, 0x6800, 0xc0e5, 0x6802, 0x2019, 0x0029, 0x1078,
+ 0x4535, 0x1078, 0x4478, 0x2c08, 0x1078, 0x6bca, 0x017f, 0x047f,
+ 0xa006, 0x157f, 0x037f, 0x027f, 0x0d7f, 0x0c7f, 0x007c, 0x0d7e,
+ 0x2069, 0x738e, 0x6800, 0xa086, 0x0800, 0x0040, 0x6b73, 0x6013,
+ 0x0000, 0x0078, 0x6b74, 0xa006, 0x0d7f, 0x007c, 0x0c7e, 0x0f7e,
+ 0x017e, 0x027e, 0x037e, 0x157e, 0x2079, 0x738c, 0x7830, 0xa00d,
+ 0x00c0, 0x6b9b, 0x7834, 0x1078, 0x1fb0, 0x1078, 0x3497, 0x00c0,
+ 0x6b9b, 0x2011, 0x7390, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x5a15, 0x00c0, 0x6b9b, 0x2011, 0x7394, 0xac98, 0x0006, 0x20a9,
+ 0x0004, 0x1078, 0x5a15, 0x157f, 0x037f, 0x027f, 0x017f, 0x0f7f,
0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e, 0x027e, 0x037e, 0x157e,
- 0x2011, 0x7b83, 0x2204, 0x8211, 0x220c, 0x1078, 0x2059, 0x00c0,
- 0x731f, 0x1078, 0x37d7, 0x00c0, 0x731f, 0x2011, 0x7b96, 0xac98,
- 0x000a, 0x20a9, 0x0004, 0x1078, 0x610f, 0x00c0, 0x731f, 0x2011,
- 0x7b9a, 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x610f, 0x157f,
- 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x057e, 0x047e, 0x027e, 0x127e, 0x2091, 0x8000,
- 0x2029, 0x783f, 0x252c, 0x2021, 0x7845, 0x2424, 0x2061, 0x7d00,
- 0x2071, 0x7600, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x738b,
- 0x2100, 0xac06, 0x0040, 0x7381, 0x1078, 0x7504, 0x0040, 0x7381,
- 0x671c, 0xa786, 0x0001, 0x0040, 0x73a0, 0xa786, 0x0007, 0x0040,
- 0x7381, 0x2500, 0xac06, 0x0040, 0x7381, 0x2400, 0xac06, 0x0040,
- 0x7381, 0x1078, 0x7518, 0x00c0, 0x7381, 0x0d7e, 0x6000, 0xa086,
- 0x0004, 0x00c0, 0x7367, 0x017e, 0x1078, 0x1676, 0x017f, 0x6010,
- 0x2068, 0x1078, 0x68e3, 0x0040, 0x737e, 0xa786, 0x0003, 0x00c0,
- 0x7394, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x017e, 0x1078,
- 0x6aea, 0x1078, 0x3a2c, 0x017f, 0x1078, 0x6a3f, 0x0d7f, 0x1078,
- 0x6a4c, 0xace0, 0x0008, 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8,
- 0x738b, 0x0078, 0x7338, 0x127f, 0x027f, 0x047f, 0x057f, 0x067f,
- 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786, 0x0006, 0x00c0, 0x7371,
- 0xa386, 0x0005, 0x0040, 0x7381, 0x1078, 0x74a8, 0x0078, 0x737e,
- 0x1078, 0x7518, 0x00c0, 0x7381, 0xa180, 0x0001, 0x2004, 0xa086,
- 0x0018, 0x00c0, 0x7381, 0x6000, 0xa086, 0x0002, 0x00c0, 0x7381,
- 0x1078, 0x6a65, 0x0040, 0x73bc, 0x1078, 0x6a79, 0x00c0, 0x7381,
- 0x1078, 0x5e09, 0x0078, 0x73be, 0x1078, 0x22b1, 0x1078, 0x6a4c,
- 0x0078, 0x7381, 0x0c7e, 0x0e7e, 0x017e, 0x2c08, 0x2170, 0x1078,
- 0x74bf, 0x017f, 0x0040, 0x73d1, 0x601c, 0xa084, 0x000f, 0x1079,
- 0x73d4, 0x0e7f, 0x0c7f, 0x007c, 0x73dc, 0x73dc, 0x73dc, 0x73dc,
- 0x73dc, 0x73dc, 0x73de, 0x73dc, 0xa006, 0x007c, 0x047e, 0x017e,
- 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4, 0x00ff, 0x8427, 0x2c00,
- 0x2009, 0x0020, 0x1078, 0x74ec, 0x017f, 0x047f, 0x037e, 0x2019,
- 0x0002, 0x1078, 0x7191, 0x037f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0001, 0x1078, 0x376f, 0x157e, 0x017e, 0x027e, 0x037e, 0x20a9,
- 0x0004, 0x2019, 0x7605, 0x2011, 0x7b96, 0x1078, 0x610f, 0x037f,
- 0x027f, 0x017f, 0x157f, 0xa005, 0x007c, 0x0f7e, 0x0e7e, 0x0c7e,
- 0x077e, 0x067e, 0x027e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7d00,
- 0x2079, 0x0001, 0x8fff, 0x0040, 0x7468, 0x2071, 0x7600, 0x7644,
- 0x7060, 0x8001, 0xa602, 0x00c8, 0x7468, 0x88ff, 0x0040, 0x742e,
- 0x2800, 0xac06, 0x00c0, 0x745e, 0x2079, 0x0000, 0x1078, 0x7504,
- 0x0040, 0x745e, 0x2400, 0xac06, 0x0040, 0x745e, 0x671c, 0xa786,
- 0x0006, 0x00c0, 0x745e, 0xa786, 0x0007, 0x0040, 0x745e, 0x88ff,
- 0x00c0, 0x7446, 0x6018, 0xa206, 0x00c0, 0x745e, 0x0d7e, 0x6000,
- 0xa086, 0x0004, 0x00c0, 0x744e, 0x1078, 0x1676, 0x6010, 0x2068,
- 0x1078, 0x68e3, 0x0040, 0x7458, 0x047e, 0x1078, 0x74a8, 0x047f,
- 0x0d7f, 0x1078, 0x6a4c, 0x88ff, 0x00c0, 0x7471, 0xace0, 0x0008,
- 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8, 0x7468, 0x0078, 0x741a,
- 0xa006, 0x127f, 0x027f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x0f7f,
- 0x007c, 0xa8c5, 0x0001, 0x0078, 0x7469, 0x087e, 0x2041, 0x0000,
- 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078, 0x58c7, 0x1078, 0x5968,
- 0x1078, 0x740d, 0x087f, 0x007c, 0x027e, 0x047e, 0x087e, 0x0c7e,
- 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x037e,
- 0x1078, 0x37d7, 0x00c0, 0x749d, 0x2c10, 0x2041, 0x0000, 0x1078,
- 0x58c7, 0x1078, 0x5968, 0x1078, 0x740d, 0x037f, 0x017f, 0x8108,
- 0x00f0, 0x748e, 0x157f, 0x0c7f, 0x087f, 0x047f, 0x027f, 0x007c,
- 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x74bc, 0x6800, 0xa07d, 0x0040,
- 0x74b9, 0x6803, 0x0000, 0x6b52, 0x1078, 0x3a2c, 0x2f68, 0x0078,
- 0x74ad, 0x6b52, 0x1078, 0x3a2c, 0x0f7f, 0x017f, 0x007c, 0x0e7e,
- 0x047e, 0x037e, 0x2061, 0x7d00, 0x2071, 0x7600, 0x7444, 0x7060,
- 0x8001, 0xa402, 0x00c8, 0x74e7, 0x2100, 0xac06, 0x0040, 0x74d9,
- 0x6000, 0xa086, 0x0000, 0x0040, 0x74d9, 0x6008, 0xa206, 0x0040,
- 0x74e3, 0xace0, 0x0008, 0x2001, 0x7615, 0x2004, 0xac02, 0x00c8,
- 0x74e7, 0x0078, 0x74c4, 0xa085, 0x0001, 0x0078, 0x74e8, 0xa006,
- 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e, 0x007e, 0x1078, 0x132f,
- 0x007f, 0x1040, 0x12d5, 0x6837, 0x010d, 0x6803, 0x0000, 0x683b,
- 0x0000, 0x685b, 0x0000, 0x685e, 0x6956, 0x6c46, 0x684f, 0x0000,
- 0x1078, 0x3a2c, 0x0d7f, 0x007c, 0x6700, 0xa786, 0x0000, 0x0040,
- 0x7517, 0xa786, 0x0001, 0x0040, 0x7517, 0xa786, 0x000a, 0x0040,
- 0x7517, 0xa786, 0x0009, 0x0040, 0x7517, 0xa085, 0x0001, 0x007c,
- 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206, 0x0e7f, 0x007c, 0x127e,
- 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7640, 0xd5a4, 0x0040,
- 0x752c, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x7532, 0x7030,
- 0x8000, 0x7032, 0xd5ac, 0x0040, 0x7539, 0x2071, 0x764a, 0x1078,
- 0x7568, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e,
- 0x2091, 0x8000, 0x2071, 0x7640, 0xd5a4, 0x0040, 0x754a, 0x7034,
- 0x8000, 0x7036, 0xd5b4, 0x0040, 0x7550, 0x7030, 0x8000, 0x7032,
- 0xd5ac, 0x0040, 0x7557, 0x2071, 0x764a, 0x1078, 0x7568, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
- 0x2071, 0x7642, 0x1078, 0x7568, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x2e04, 0x8000, 0x2072, 0x00c8, 0x7571, 0x8e70, 0x2e04, 0x8000,
- 0x2072, 0x007c, 0x0e7e, 0x2071, 0x7640, 0x1078, 0x7568, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x7644, 0x1078, 0x7568, 0x0e7f, 0x007c,
- 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
- 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000,
- 0x59e7
-};
-#define ISP2100_CODE_LENGTH 0x6591
-#endif
-#if defined(ISP2100_FABRIC) && defined(ISP2100_SCCLUN)
-/************************************************************************
- * *
- * --- ISP2100 Initiator/Target Firmware --- *
- * with Fabric support (Public Loop) and *
- * with expanded LUN addressing. *
- * *
- * *
- ************************************************************************
- * *
- * NOTICE *
- * *
- * COPYRIGHT 1998 QLOGIC CORPORATION *
- * ALL RIGHTS RESERVED *
- * *
- * This computer program is CONFIDENTIAL and contains TRADE SECRETS of *
- * QLOGIC CORPORATION. The receipt or possession of this program does *
- * not convey any rights to reproduce or disclose its contents, or to *
- * manufacture, use, or sell anything that it may describe, in whole or *
- * in part, without the specific written consent of QLOGIC CORPORATION. *
- * Any reproduction of this program without the express written consent *
- * of QLOGIC CORPORATION is a violation of the copyright laws and may *
- * subject you to civil liability and criminal prosecution. *
- * *
- ************************************************************************
- */
-/*
- * Firmware Version 1.15.07 (14:40 Oct 13, 1998)
- */
-
-static const u_int16_t ISP2100_RISC_CODE[] = {
- 0x0078, 0x1029, 0x0000, 0x669c, 0x0000, 0x2043, 0x4f50, 0x5952,
- 0x4947, 0x4854, 0x2031, 0x3939, 0x3620, 0x514c, 0x4f47, 0x4943,
- 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
- 0x3231, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056,
- 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3135, 0x2020, 0x2020,
- 0x2400, 0x20c1, 0x0021, 0x20a1, 0x769c, 0x2009, 0x0000, 0x20a9,
- 0x0764, 0x41a4, 0x3400, 0x20c9, 0x7bff, 0x2091, 0x2000, 0x2059,
- 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x2074, 0x2051, 0x7700,
- 0x2a70, 0x705b, 0x9600, 0x705f, 0xffff, 0x7057, 0x95f9, 0x7063,
- 0x0300, 0x1078, 0x1282, 0x20a1, 0x7e00, 0x715c, 0x810d, 0x810d,
- 0x810d, 0x810d, 0xa18c, 0x000f, 0x2001, 0x0007, 0xa112, 0xa00e,
- 0x21a8, 0x41a4, 0x3400, 0x8211, 0x00c0, 0x1058, 0x715c, 0x3400,
- 0xa102, 0x0040, 0x1068, 0x0048, 0x1068, 0x20a8, 0xa00e, 0x41a4,
- 0x1078, 0x1249, 0x1078, 0x136e, 0x1078, 0x14f3, 0x1078, 0x19a0,
- 0x1078, 0x35ed, 0x1078, 0x5c66, 0x1078, 0x12f9, 0x1078, 0x2403,
- 0x1078, 0x3d28, 0x1078, 0x3b00, 0x1078, 0x4569, 0x1078, 0x1e2f,
- 0x1078, 0x47a9, 0x1078, 0x4249, 0x1078, 0x1d4e, 0x1078, 0x1e0e,
- 0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x109d, 0x7820, 0xa086,
- 0x0002, 0x00c0, 0x109d, 0x7823, 0x4000, 0x0068, 0x1095, 0x781b,
- 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, 0x7003, 0x0000,
- 0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, 0xa08e, 0x0003,
- 0x00c0, 0x10bd, 0x1078, 0x2d63, 0x1078, 0x242b, 0x1078, 0x3d78,
- 0x1078, 0x3beb, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x10c1, 0x1078, 0x4581, 0x0078, 0x10a4, 0x1079, 0x10c5, 0x0078,
- 0x10aa, 0x1078, 0x5938, 0x0078, 0x10b9, 0x10cf, 0x10d0, 0x114b,
- 0x10cd, 0x11c6, 0x1246, 0x1247, 0x1248, 0x1078, 0x12d5, 0x007c,
- 0x127e, 0x0f7e, 0x2091, 0x8000, 0x1078, 0x2e88, 0x2079, 0x0100,
- 0x7844, 0xa005, 0x00c0, 0x113c, 0x2011, 0x351a, 0x1078, 0x4643,
- 0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, 0x8010,
- 0x73b8, 0x1078, 0x2d20, 0x1078, 0x5783, 0x2011, 0x0004, 0x1078,
- 0x6a18, 0x1078, 0x3a9a, 0x70c7, 0x0000, 0x70bf, 0x0000, 0x70c3,
- 0x0000, 0x1078, 0x113f, 0x2011, 0x0000, 0x2079, 0x7751, 0x7804,
- 0xd0ac, 0x0040, 0x1104, 0xc295, 0x70a4, 0xa005, 0x0040, 0x1109,
- 0xc29d, 0x72be, 0xa296, 0x0004, 0x0040, 0x112a, 0x2011, 0x0001,
- 0x1078, 0x6a18, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x0f7f, 0x1078, 0x2124, 0x2011, 0x0005, 0x1078, 0x5892, 0x1078,
- 0x4d50, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x127f,
- 0x0078, 0x113e, 0x708b, 0x0000, 0x708f, 0xffff, 0x7003, 0x0002,
- 0x2011, 0x0005, 0x1078, 0x5892, 0x1078, 0x4d50, 0x0c7e, 0x2061,
- 0x0100, 0x60e3, 0x0008, 0x0c7f, 0x0f7f, 0x127f, 0x007c, 0x0c7e,
- 0x20a9, 0x0082, 0x2009, 0x007e, 0x1078, 0x37ee, 0x8108, 0x00f0,
- 0x1144, 0x0c7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x708c, 0xa086,
- 0xffff, 0x0040, 0x1159, 0x1078, 0x2124, 0x1078, 0x4d50, 0x0078,
- 0x11c4, 0x70bc, 0xd09c, 0x0040, 0x1181, 0xd084, 0x0040, 0x1181,
- 0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c,
- 0x0040, 0x1181, 0x70c0, 0xa086, 0xffff, 0x0040, 0x117d, 0x1078,
- 0x2219, 0x1078, 0x4d50, 0x2011, 0x0001, 0x2019, 0x0000, 0x1078,
- 0x2251, 0x1078, 0x4d50, 0x0078, 0x11c4, 0x70c4, 0xa005, 0x00c0,
- 0x11c4, 0x7088, 0xa005, 0x00c0, 0x11c4, 0x2001, 0x7752, 0x2004,
- 0xd0ac, 0x0040, 0x11a7, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009,
- 0x0000, 0x017e, 0x1078, 0x3806, 0x00c0, 0x119a, 0x6000, 0xd0ec,
- 0x00c0, 0x11a2, 0x017f, 0x8108, 0x00f0, 0x1191, 0x0c7f, 0x157f,
- 0x0078, 0x11a7, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x11c4, 0x7003,
- 0x0003, 0x708f, 0xffff, 0x2001, 0x0000, 0x1078, 0x1fff, 0x1078,
- 0x2d9e, 0x2001, 0x7937, 0x2004, 0xa086, 0x0005, 0x00c0, 0x11bc,
- 0x2011, 0x0000, 0x1078, 0x5892, 0x2011, 0x0000, 0x1078, 0x589c,
- 0x1078, 0x4d50, 0x1078, 0x4e10, 0x127f, 0x007c, 0x017e, 0x0f7e,
- 0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x7940, 0xa18c, 0x0010,
- 0x7942, 0x7924, 0xd1b4, 0x0040, 0x11d7, 0x7827, 0x0040, 0xd19c,
- 0x0040, 0x11dc, 0x7827, 0x0008, 0x007e, 0x037e, 0x157e, 0x7900,
- 0xa18a, 0x0003, 0x0050, 0x1202, 0x7954, 0xd1ac, 0x00c0, 0x1202,
- 0x2009, 0x00f8, 0x1078, 0x35bc, 0x7843, 0x0090, 0x7843, 0x0010,
- 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x11fa, 0x7824, 0xd0ac,
- 0x00c0, 0x1236, 0x00f0, 0x11f2, 0x2001, 0x0001, 0x1078, 0x1fff,
- 0x0078, 0x123f, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0008,
- 0x00e0, 0x1208, 0x2091, 0x6000, 0x00f0, 0x1208, 0x7853, 0x0400,
- 0x782f, 0x0000, 0x2009, 0x00f8, 0x1078, 0x35bc, 0x20a9, 0x000e,
- 0x0005, 0x00f0, 0x1218, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843,
- 0x0010, 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040,
- 0x122d, 0x7824, 0xd0ac, 0x00c0, 0x1236, 0x8319, 0x00c0, 0x1223,
- 0x2001, 0x0001, 0x1078, 0x1fff, 0x0078, 0x123d, 0x7828, 0xc09d,
- 0x782a, 0x7827, 0x0008, 0x7827, 0x0040, 0x7853, 0x0400, 0x157f,
- 0x037f, 0x007f, 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c,
- 0x007c, 0x2a70, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048,
- 0x1255, 0x704f, 0xffff, 0x0078, 0x1257, 0x704f, 0x0000, 0x7053,
- 0xffff, 0x7067, 0x0000, 0x706b, 0x0000, 0x2061, 0x7920, 0x6003,
- 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013,
- 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, 0x07d0, 0x2061,
- 0x7928, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, 0x0000, 0x600f,
- 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, 0x0001, 0x601f,
- 0x0000, 0x007c, 0x1078, 0x12a8, 0x2011, 0x0000, 0x81ff, 0x0040,
- 0x12a7, 0xa186, 0x0001, 0x00c0, 0x1297, 0x705f, 0x8fff, 0x7057,
- 0x8601, 0x7063, 0x0100, 0x705b, 0x8600, 0x0078, 0x12a5, 0xa186,
- 0x0002, 0x00c0, 0x129f, 0x2011, 0x0000, 0x0078, 0x12a5, 0xa186,
- 0x0005, 0x00c0, 0x12a5, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c,
- 0x2009, 0x0000, 0x2011, 0x0000, 0x1078, 0x12cf, 0x2019, 0xaaaa,
- 0x2061, 0xffff, 0x2362, 0x2c24, 0x2061, 0x7fff, 0x2c04, 0xa406,
- 0x0040, 0x12bd, 0xc18d, 0x0078, 0x12ca, 0xc185, 0x2011, 0x0001,
- 0x1078, 0x12cf, 0x2061, 0xffff, 0x2362, 0x2c04, 0xa306, 0x00c0,
- 0x12ca, 0xc195, 0x2011, 0x0001, 0x1078, 0x12cf, 0x007c, 0x3800,
- 0xa084, 0xfffc, 0xa205, 0x20c0, 0x007c, 0x2091, 0x8000, 0x0068,
- 0x12d7, 0x007e, 0x017e, 0x2079, 0x0000, 0x7818, 0xa084, 0x0000,
- 0x00c0, 0x12dd, 0x017f, 0x792e, 0x007f, 0x782a, 0x007f, 0x7826,
- 0x3900, 0x783a, 0x7823, 0x8002, 0x781b, 0x0001, 0x2091, 0x5000,
- 0x2091, 0x4080, 0x2079, 0x7700, 0x7803, 0x0005, 0x0078, 0x12f6,
- 0x007c, 0x2071, 0x7700, 0x7158, 0x712e, 0x2021, 0x0001, 0xa190,
- 0x002d, 0xa298, 0x002d, 0x0048, 0x130f, 0x705c, 0xa302, 0x00c8,
- 0x130f, 0x220a, 0x2208, 0x2310, 0x8420, 0x0078, 0x1301, 0x200b,
- 0x0000, 0x749e, 0x74a2, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x2071, 0x7700, 0x70a0, 0xa0ea, 0x0010, 0x00c8, 0x1322, 0xa06e,
- 0x0078, 0x132c, 0x8001, 0x70a2, 0x702c, 0x2068, 0x2d04, 0x702e,
- 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e,
- 0x2071, 0x7700, 0x127e, 0x2091, 0x8000, 0x70a0, 0x8001, 0x00c8,
- 0x133c, 0xa06e, 0x0078, 0x1345, 0x70a2, 0x702c, 0x2068, 0x2d04,
- 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, 0x127f, 0x0e7f, 0x007c,
- 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7700, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x127f, 0x0e7f, 0x007c,
- 0x8dff, 0x0040, 0x1364, 0x6804, 0x6807, 0x0000, 0x007e, 0x1078,
- 0x1348, 0x0d7f, 0x0078, 0x1358, 0x007c, 0x0e7e, 0x2071, 0x7700,
- 0x70a0, 0xa08a, 0x0010, 0xa00d, 0x0e7f, 0x007c, 0x0e7e, 0x2071,
- 0x7959, 0x7007, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x2071,
- 0x0000, 0x7010, 0xa085, 0x8004, 0x7012, 0x0e7f, 0x007c, 0x0e7e,
- 0x2270, 0x700b, 0x0000, 0x2071, 0x7959, 0x7018, 0xa088, 0x7962,
- 0x220a, 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0,
- 0x1397, 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x2071, 0x7959, 0x7004, 0xa005, 0x00c0, 0x13a6,
- 0x0f7e, 0x2079, 0x0010, 0x1078, 0x13a8, 0x0f7f, 0x0e7f, 0x007c,
- 0x7000, 0x0079, 0x13ab, 0x13af, 0x1419, 0x1436, 0x1436, 0x7018,
- 0x711c, 0xa106, 0x00c0, 0x13b7, 0x7007, 0x0000, 0x007c, 0x0d7e,
- 0xa180, 0x7962, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007,
- 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c,
- 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804,
- 0x0d7f, 0xd084, 0x0040, 0x13d9, 0x7007, 0x0001, 0x1078, 0x13de,
- 0x007c, 0x7007, 0x0002, 0x1078, 0x13f4, 0x007c, 0x017e, 0x027e,
- 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x13e9, 0x2110,
- 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e,
- 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c,
- 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1408, 0x2110, 0xa006,
- 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803,
- 0x0001, 0x3300, 0x7016, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0x77e5, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b,
- 0x77e0, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e,
- 0x157e, 0x2001, 0x7814, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026,
- 0x2001, 0x7815, 0x20ac, 0x53a6, 0x2099, 0x7816, 0x20a1, 0x0018,
- 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000,
- 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b,
- 0x7811, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e,
- 0x2071, 0x7959, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002,
- 0xd1fc, 0x0040, 0x1479, 0xa18c, 0x0700, 0x0040, 0x1476, 0x7008,
- 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, 0x1479, 0x7004, 0x1079,
- 0x147d, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x13a8, 0x1485, 0x14a7,
- 0x14c1, 0x14ea, 0x1483, 0x0078, 0x1483, 0x137e, 0x147e, 0x157e,
- 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x7010, 0x20a8,
- 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, 0x137f, 0x700c, 0xa005,
- 0x0040, 0x14ae, 0x1078, 0x13de, 0x007c, 0x7008, 0xa080, 0x0002,
- 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x13a8, 0x007c, 0x700c,
- 0xa005, 0x0040, 0x14ae, 0x1078, 0x13f4, 0x007c, 0x0d7e, 0x7008,
- 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c,
- 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x13a8,
- 0x007c, 0x137e, 0x147e, 0x157e, 0x2001, 0x77e3, 0x2004, 0xa080,
- 0x000d, 0x20a0, 0x2099, 0x0014, 0x7803, 0x0040, 0x20a9, 0x0020,
- 0x53a5, 0x2001, 0x77e5, 0x2004, 0xd0bc, 0x0040, 0x14e0, 0x2001,
- 0x77ee, 0x2004, 0xa080, 0x000d, 0x20a0, 0x20a9, 0x0020, 0x53a5,
- 0x157f, 0x147f, 0x137f, 0x7007, 0x0000, 0x1078, 0x3e21, 0x1078,
- 0x13a8, 0x007c, 0x2001, 0x7813, 0x2003, 0x0100, 0x7007, 0x0000,
- 0x1078, 0x13a8, 0x007c, 0x127e, 0x2091, 0x2100, 0x2079, 0x0030,
- 0x2071, 0x796a, 0x7003, 0x0000, 0x700f, 0x7970, 0x7013, 0x7970,
- 0x780f, 0x0070, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079,
- 0x1509, 0x1511, 0x1557, 0x1511, 0x1511, 0x1511, 0x153c, 0x1520,
- 0x1515, 0xa085, 0x0001, 0x0078, 0x1571, 0x684c, 0xd0bc, 0x0040,
- 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x155f,
- 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x1511, 0x684c, 0xd0bc,
- 0x0040, 0x1511, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0x6858, 0x0078, 0x1567, 0xa18c, 0x00ff, 0xa186, 0x0015,
- 0x00c0, 0x1511, 0x684c, 0xd0ac, 0x0040, 0x1511, 0x6804, 0x681a,
- 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004,
- 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x1567, 0x684c,
- 0xd0ac, 0x0040, 0x1511, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c,
- 0x000f, 0xa188, 0x1c5c, 0x210c, 0x6932, 0x2d08, 0x691a, 0x6826,
- 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a,
- 0x2004, 0x82ff, 0x0040, 0x158c, 0xa280, 0x0004, 0x0d7e, 0x206c,
- 0x684c, 0xd0dc, 0x00c0, 0x1588, 0x1078, 0x1504, 0x10c0, 0x12d5,
- 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, 0x027e,
- 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, 0x00c0,
- 0x15a0, 0x7206, 0x2001, 0x15b4, 0x007e, 0x2260, 0x0078, 0x16cc,
- 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182,
- 0x798b, 0x0048, 0x15ad, 0x2009, 0x7970, 0x710e, 0x7000, 0xa005,
- 0x00c0, 0x15b4, 0x1078, 0x16b5, 0x127f, 0x007c, 0x127e, 0x027e,
- 0x037e, 0x0c7e, 0x007e, 0x2091, 0x2100, 0x007f, 0x047f, 0x037f,
- 0x027f, 0x0d7e, 0x0c7e, 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e,
- 0xa005, 0x0040, 0x1608, 0x6808, 0xa005, 0x0040, 0x166e, 0x7000,
- 0xa005, 0x00c0, 0x15d5, 0x0078, 0x1602, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x1672, 0x7004, 0xa406, 0x00c0, 0x1602, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x0040, 0x15eb, 0x047e, 0x1078, 0x17a5, 0x047f,
- 0x2460, 0x0078, 0x15cb, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0,
- 0x15de, 0x7804, 0xa084, 0x6000, 0x0040, 0x15fc, 0xa086, 0x6000,
- 0x0040, 0x15fc, 0x0078, 0x15de, 0x7803, 0x0004, 0x7003, 0x0000,
- 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5cfb, 0x0078, 0x1672,
- 0x6808, 0xa005, 0x0040, 0x166e, 0x7000, 0xa005, 0x00c0, 0x1612,
- 0x0078, 0x166e, 0x700c, 0x7110, 0xa106, 0x00c0, 0x161b, 0x7004,
- 0xa406, 0x00c0, 0x166e, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040,
- 0x1628, 0x047e, 0x1078, 0x17a5, 0x047f, 0x2460, 0x0078, 0x1608,
- 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x161b, 0x2001, 0x0005,
- 0x2004, 0xd08c, 0x00c0, 0x1621, 0x7804, 0xa084, 0x6000, 0x0040,
- 0x163f, 0xa086, 0x6000, 0x0040, 0x163f, 0x0078, 0x161b, 0x7007,
- 0x0000, 0xa016, 0x2218, 0x7000, 0xa08e, 0x0001, 0x0040, 0x1660,
- 0xa08e, 0x0002, 0x00c0, 0x166e, 0x0c7e, 0x0e7e, 0x6818, 0x2060,
- 0x1078, 0x1c31, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, 0x165c,
- 0x7308, 0x720c, 0x0078, 0x165e, 0x7310, 0x7214, 0x0e7f, 0x0c7f,
- 0x7820, 0xa318, 0x7824, 0xa211, 0x6810, 0xa300, 0x6812, 0x6814,
- 0xa201, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, 0x2009, 0x0048,
- 0x1078, 0x5cfb, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, 0x0e7e,
- 0x2071, 0x796a, 0x7000, 0xa086, 0x0000, 0x0040, 0x16b2, 0x7004,
- 0xac06, 0x00c0, 0x16a3, 0x2079, 0x0030, 0x7804, 0xd0fc, 0x00c0,
- 0x169f, 0x2001, 0x0207, 0x2004, 0xd09c, 0x00c0, 0x1685, 0x7803,
- 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1691, 0x7803, 0x0002, 0x7803,
- 0x0009, 0x7003, 0x0003, 0x7007, 0x0000, 0x0078, 0x16a3, 0x1078,
- 0x17a5, 0x0078, 0x167a, 0x157e, 0x20a9, 0x0009, 0x2009, 0x7970,
- 0x2104, 0xac06, 0x00c0, 0x16ad, 0x200a, 0xa188, 0x0003, 0x00f0,
- 0x16a8, 0x157f, 0x0e7f, 0x0f7f, 0x007c, 0x700c, 0x7110, 0xa106,
- 0x00c0, 0x16bd, 0x7003, 0x0000, 0x007c, 0x2104, 0x7006, 0x2060,
- 0x8108, 0x211c, 0x8108, 0x2124, 0x8108, 0xa182, 0x798b, 0x0048,
- 0x16cb, 0x2009, 0x7970, 0x7112, 0x8cff, 0x00c0, 0x16eb, 0x7908,
- 0xd1ec, 0x00c0, 0x16df, 0x1078, 0x197e, 0x0040, 0x16df, 0x7803,
- 0x0009, 0x7904, 0xd1fc, 0x0040, 0x16d9, 0x7803, 0x0006, 0x7007,
- 0x0000, 0x1078, 0x197e, 0x0040, 0x1712, 0x7803, 0x0019, 0x7003,
- 0x0003, 0x0078, 0x1712, 0x6010, 0x2068, 0x2d58, 0x6828, 0xa406,
- 0x00c0, 0x16f6, 0x682c, 0xa306, 0x0040, 0x16fa, 0x1078, 0x1c7c,
- 0x00c0, 0x16cf, 0x684c, 0xd0f4, 0x00c0, 0x16cf, 0x6824, 0x2050,
- 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x2009,
- 0x0011, 0x1078, 0x1713, 0x0040, 0x1711, 0x2009, 0x0001, 0x1078,
- 0x1713, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x17a0, 0xa03e, 0x2730,
- 0x6850, 0xd0fc, 0x00c0, 0x1732, 0x0d7e, 0x2804, 0xac68, 0x2900,
- 0x0079, 0x1722, 0x1782, 0x1742, 0x1742, 0x1782, 0x1782, 0x177a,
- 0x1782, 0x1742, 0x1782, 0x1748, 0x1748, 0x1782, 0x1782, 0x1782,
- 0x1771, 0x1748, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20,
- 0x0d7e, 0xd99c, 0x0040, 0x1785, 0x2804, 0xac68, 0x6f08, 0x6e0c,
- 0x0078, 0x1785, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1785,
- 0x7b0c, 0xd3bc, 0x0040, 0x1769, 0x7004, 0x0e7e, 0x2070, 0x701c,
- 0x0e7f, 0xa086, 0x0008, 0x00c0, 0x1769, 0x7b08, 0xa39c, 0x0fff,
- 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, 0x82ff, 0x00c0, 0x1764, 0x6810,
- 0xa302, 0x0048, 0x1764, 0x6b10, 0x2011, 0x0000, 0x2468, 0x0078,
- 0x176b, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0078,
- 0x1785, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e,
- 0x00c0, 0x1782, 0x0d7f, 0x1078, 0x1c18, 0x00c0, 0x1713, 0xa00e,
- 0x0078, 0x17a0, 0x0d7f, 0x1078, 0x12d5, 0x7b22, 0x7a26, 0x7d32,
- 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, 0x7002, 0x0d7f,
- 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x2300, 0x6b10,
- 0xa302, 0x6812, 0x2200, 0x6a14, 0xa203, 0x6816, 0x1078, 0x1c18,
- 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5, 0x127e, 0x2091, 0x2100,
- 0x007e, 0x017e, 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002,
- 0xa184, 0x0700, 0x00c0, 0x17a3, 0xa184, 0x0003, 0xa086, 0x0003,
- 0x0040, 0x17a3, 0x7000, 0x0079, 0x17bd, 0x17c5, 0x17c7, 0x189b,
- 0x18ff, 0x1916, 0x17c5, 0x17c5, 0x17c5, 0x1078, 0x12d5, 0x8001,
- 0x7002, 0xa184, 0x0880, 0x00c0, 0x17dc, 0x8aff, 0x0040, 0x183b,
- 0x2009, 0x0001, 0x1078, 0x1713, 0x0040, 0x1928, 0x2009, 0x0001,
- 0x1078, 0x1713, 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000,
- 0xd1dc, 0x0040, 0x1827, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x7820,
- 0x686e, 0xa31a, 0x7824, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x7820,
- 0x6910, 0xa100, 0x6812, 0x7824, 0x6914, 0xa101, 0x6816, 0x037f,
- 0x027f, 0x7830, 0x681e, 0x7834, 0x6822, 0x1078, 0x1c31, 0x2a00,
- 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x6850,
- 0xc0fd, 0x6852, 0x6808, 0x8001, 0x680a, 0x00c0, 0x1819, 0x684c,
- 0xd0e4, 0x0040, 0x1819, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078,
- 0x5cfb, 0x7808, 0xd0ec, 0x00c0, 0x1823, 0x7803, 0x0009, 0x7003,
- 0x0004, 0x0078, 0x1928, 0x1078, 0x16b5, 0x0078, 0x1928, 0x057e,
- 0x7d0c, 0xd5bc, 0x00c0, 0x182e, 0x1078, 0x7648, 0x057f, 0x1078,
- 0x192c, 0x697c, 0x6912, 0x6980, 0x6916, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005,
- 0x00c0, 0x1853, 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0,
- 0x184f, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x5cfb, 0x1078,
- 0x16b5, 0x0078, 0x1928, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914,
- 0xa183, 0x0000, 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa188,
- 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, 0x8004, 0x8004,
- 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x195b, 0x7803, 0x0004,
- 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, 0x0040, 0x1874,
- 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0070, 0x7004, 0x7007,
- 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x5cfb, 0x1078, 0x197e,
- 0x0040, 0x184f, 0x7908, 0xd1ec, 0x00c0, 0x1892, 0x2009, 0x0009,
- 0x0078, 0x1894, 0x2009, 0x0019, 0x7902, 0x7803, 0x0009, 0x7003,
- 0x0003, 0x0078, 0x1928, 0x8001, 0x7002, 0xd194, 0x0040, 0x18ad,
- 0x7804, 0xd0fc, 0x00c0, 0x17ad, 0x8aff, 0x0040, 0x1928, 0x2009,
- 0x0001, 0x1078, 0x1713, 0x0078, 0x1928, 0xa184, 0x0880, 0x00c0,
- 0x18ba, 0x8aff, 0x0040, 0x1928, 0x2009, 0x0001, 0x1078, 0x1713,
- 0x0078, 0x1928, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1dc, 0x0040,
- 0x18ee, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x1c31, 0x0d7e,
- 0x0f7e, 0x2d78, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x18de,
- 0x6808, 0x2008, 0xa31a, 0x680c, 0xa213, 0x7810, 0xa100, 0x7812,
- 0x690c, 0x7814, 0xa101, 0x7816, 0x0078, 0x18ea, 0x6810, 0x2008,
- 0xa31a, 0x6814, 0xa213, 0x7810, 0xa100, 0x7812, 0x6914, 0x7814,
- 0xa101, 0x7816, 0x0f7f, 0x0d7f, 0x0078, 0x17e7, 0x057e, 0x7d0c,
- 0x1078, 0x7648, 0x057f, 0x1078, 0x192c, 0x697c, 0x6912, 0x6980,
- 0x6916, 0x7803, 0x0009, 0x7003, 0x0003, 0x0078, 0x1928, 0x7803,
- 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, 0x0040, 0x1912, 0x6808,
- 0x8001, 0x680a, 0x00c0, 0x1912, 0x7004, 0x2060, 0x2009, 0x0048,
- 0x1078, 0x5cfb, 0x1078, 0x16b5, 0x0078, 0x1928, 0x7803, 0x0004,
- 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, 0xa005, 0x0040, 0x1912,
- 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, 0x6b2c, 0x1078, 0x16cc,
- 0x017f, 0x007f, 0x127f, 0x007c, 0x1078, 0x193d, 0x20e1, 0x9028,
- 0x700f, 0x7970, 0x7013, 0x7970, 0x2001, 0x015d, 0x200c, 0x810a,
- 0x2102, 0x2001, 0x0138, 0x2202, 0x007c, 0x2001, 0x0138, 0x2014,
- 0x2003, 0x0000, 0x2021, 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc,
- 0x00c0, 0x195a, 0x2001, 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0,
- 0x195a, 0x2001, 0x0111, 0x201c, 0x83ff, 0x00c0, 0x195a, 0x8421,
- 0x00c0, 0x1944, 0x007c, 0x3c00, 0x007e, 0x0e7e, 0x2071, 0x0200,
- 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x193d, 0x20e1, 0x7000,
- 0x7324, 0x7420, 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f,
- 0x712e, 0x702f, 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001,
- 0x0138, 0x2202, 0x0e7f, 0x007f, 0x20e0, 0x007c, 0x3c00, 0x007e,
- 0x7908, 0xa18c, 0x0fff, 0xa182, 0x0009, 0x0048, 0x198b, 0xa085,
- 0x0001, 0x0078, 0x199d, 0x2001, 0x020a, 0x81ff, 0x0040, 0x1996,
- 0x20e1, 0x6000, 0x200c, 0x200c, 0x200c, 0x200c, 0x20e1, 0x7000,
- 0x200c, 0x200c, 0x7003, 0x0000, 0xa006, 0x007f, 0x20e0, 0x007c,
- 0x0e7e, 0x2071, 0x798b, 0x7003, 0x0000, 0x0e7f, 0x007c, 0x0d7e,
- 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1a22, 0x6934,
- 0xa184, 0x0007, 0x0079, 0x19b4, 0x19bc, 0x1a0d, 0x19bc, 0x19bc,
- 0x19bc, 0x19f2, 0x19cf, 0x19be, 0x1078, 0x12d5, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1a15, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x19bc, 0x684c, 0xd0b4,
- 0x0040, 0x1b24, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, 0x6812,
- 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0x0078, 0x1a1e, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, 0x1a22,
- 0x684c, 0xd0b4, 0x0040, 0x1b24, 0x6804, 0x681a, 0xa080, 0x000d,
- 0x2004, 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6958,
- 0xa006, 0x682e, 0x682a, 0x0078, 0x1a1e, 0x684c, 0xd0b4, 0x0040,
- 0x17a1, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, 0x6834,
- 0xa084, 0x000f, 0xa080, 0x1c5c, 0x2004, 0x6832, 0x6926, 0x684c,
- 0xc0dd, 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, 0x7804,
- 0xd0fc, 0x10c0, 0x1b28, 0x0e7e, 0x0d7e, 0x2071, 0x798b, 0x7000,
- 0xa005, 0x00c0, 0x1a9e, 0x0c7e, 0x7206, 0xa280, 0x0004, 0x205c,
- 0x7004, 0x2068, 0x6818, 0x0d7e, 0x2068, 0x686c, 0x7812, 0x6890,
- 0x0f7e, 0x20e1, 0x9040, 0x2079, 0x0200, 0x781a, 0x2079, 0x0100,
- 0x8004, 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, 0x6824, 0x2050, 0x6818,
- 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, 0x000f, 0x6908, 0xa184,
- 0x0007, 0x0040, 0x1a60, 0x017e, 0x2009, 0x0008, 0xa102, 0x017f,
- 0xa108, 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, 0x0000, 0x781e,
- 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, 0x6814, 0xa106,
- 0x00c0, 0x1a77, 0x6928, 0x6810, 0xa106, 0x0040, 0x1a84, 0x037e,
- 0x047e, 0x6b14, 0x6c10, 0x1078, 0x1c7c, 0x047f, 0x037f, 0x0040,
- 0x1a84, 0x0c7f, 0x0078, 0x1a9e, 0x8aff, 0x00c0, 0x1a8c, 0x0c7f,
- 0xa085, 0x0001, 0x0078, 0x1a9e, 0x127e, 0x2091, 0x8000, 0x2079,
- 0x0020, 0x2009, 0x0001, 0x1078, 0x1aa2, 0x0040, 0x1a9b, 0x2009,
- 0x0001, 0x1078, 0x1aa2, 0x127f, 0x0c7f, 0xa006, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, 0x037e, 0x027e,
- 0x8aff, 0x0040, 0x1b1d, 0x700c, 0x7214, 0xa202, 0x7010, 0x7218,
- 0xa203, 0x0048, 0x1b1c, 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0,
- 0x1acf, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1abf, 0x1afe,
- 0x1adf, 0x1adf, 0x1afe, 0x1afe, 0x1af6, 0x1afe, 0x1adf, 0x1afe,
- 0x1ae5, 0x1ae5, 0x1afe, 0x1afe, 0x1afe, 0x1aed, 0x1ae5, 0xc0fc,
- 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1b02,
- 0x0d7e, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x6b08,
- 0x6a0c, 0x6d00, 0x6c04, 0x0078, 0x1b01, 0x6b10, 0x6a14, 0x6d00,
- 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x1b01, 0x0d7f, 0x0d7e, 0x6834,
- 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1afe, 0x0d7f, 0x1078,
- 0x1c18, 0x00c0, 0x1aa8, 0xa00e, 0x0078, 0x1b1d, 0x0d7f, 0x1078,
- 0x12d5, 0x0d7f, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e,
- 0x7902, 0x7000, 0x8000, 0x7002, 0x6828, 0xa300, 0x682a, 0x682c,
- 0xa201, 0x682e, 0x700c, 0xa300, 0x700e, 0x7010, 0xa201, 0x7012,
- 0x1078, 0x1c18, 0x0078, 0x1b1d, 0xa006, 0x027f, 0x037f, 0x047f,
- 0x057f, 0x067f, 0x077f, 0x007c, 0x1078, 0x12d5, 0x1078, 0x12d5,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, 0x0e7e, 0x0d7e,
- 0x0c7e, 0x2079, 0x0020, 0x2071, 0x798b, 0x2b68, 0x6818, 0x2060,
- 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, 0x1b26, 0x7000,
- 0x0079, 0x1b42, 0x1be9, 0x1b46, 0x1bb6, 0x1be7, 0x8001, 0x7002,
- 0xd19c, 0x00c0, 0x1b5a, 0x8aff, 0x0040, 0x1b79, 0x2009, 0x0001,
- 0x1078, 0x1aa2, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078, 0x1aa2,
- 0x0078, 0x1be9, 0x7803, 0x0004, 0xd194, 0x0040, 0x1b6a, 0x6850,
- 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1b6f, 0x684c, 0xc0f5, 0x684e,
- 0x0078, 0x1b6f, 0x1078, 0x1c31, 0x6850, 0xc0fd, 0x6852, 0x2a00,
- 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, 0x0000, 0x0078,
- 0x1be9, 0x711c, 0x81ff, 0x0040, 0x1b8f, 0x7918, 0x7922, 0x7827,
- 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, 0x700c, 0xa100,
- 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, 0x1be9, 0x0f7e,
- 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, 0x0100, 0x7a14,
- 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x7820, 0xd0bc, 0x00c0,
- 0x1b9d, 0x79c8, 0x007f, 0xa102, 0x78ca, 0x79c4, 0x007f, 0xa102,
- 0x78c6, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f,
- 0x7803, 0x0008, 0x7003, 0x0000, 0x0078, 0x1be9, 0x8001, 0x7002,
- 0xd194, 0x0040, 0x1bcb, 0x7804, 0xd0fc, 0x00c0, 0x1b38, 0xd19c,
- 0x00c0, 0x1be5, 0x8aff, 0x0040, 0x1be9, 0x2009, 0x0001, 0x1078,
- 0x1aa2, 0x0078, 0x1be9, 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078,
- 0x1c31, 0x0d7e, 0x2804, 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1bde,
- 0x6808, 0xa31a, 0x680c, 0xa213, 0x0078, 0x1be2, 0x6810, 0xa31a,
- 0x6814, 0xa213, 0x0d7f, 0x0078, 0x1b6a, 0x0078, 0x1b6a, 0x1078,
- 0x12d5, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f,
- 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x798b, 0x7000, 0xa086, 0x0000,
- 0x0040, 0x1c15, 0x2079, 0x0020, 0x20e1, 0x9040, 0x7804, 0xd0fc,
- 0x0040, 0x1bfc, 0x1078, 0x1b28, 0x7000, 0xa086, 0x0000, 0x00c0,
- 0x1bfc, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, 0x1c0b, 0x20e1,
- 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x0f7f, 0x007c,
- 0x8840, 0x2804, 0xa005, 0x00c0, 0x1c2c, 0x6004, 0xa005, 0x0040,
- 0x1c2e, 0x681a, 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c5c,
- 0x2044, 0x88ff, 0x1040, 0x12d5, 0x8a51, 0x007c, 0x2051, 0x0000,
- 0x007c, 0x8a50, 0x8841, 0x2804, 0xa005, 0x00c0, 0x1c4b, 0x2c00,
- 0xad06, 0x0040, 0x1c40, 0x6000, 0xa005, 0x00c0, 0x1c40, 0x2d00,
- 0x2060, 0x681a, 0x6034, 0xa084, 0x000f, 0xa080, 0x1c6c, 0x2044,
- 0x88ff, 0x1040, 0x12d5, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019,
- 0x001d, 0x0021, 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b,
- 0x0021, 0x0027, 0x0000, 0x0000, 0x0000, 0x1c51, 0x1c4d, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c51, 0x0000, 0x1c58, 0x1c55, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c58, 0x0000, 0x1c53, 0x1c53, 0x0000,
- 0x0000, 0x1c5b, 0x0000, 0x1c53, 0x0000, 0x1c59, 0x1c59, 0x0000,
- 0x0000, 0x0000, 0x1c5b, 0x1c59, 0x0a7e, 0x097e, 0x087e, 0x6858,
- 0xa055, 0x0040, 0x1d19, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0,
- 0x1c5c, 0xa986, 0x0007, 0x0040, 0x1c95, 0xa986, 0x000e, 0x0040,
- 0x1c95, 0xa986, 0x000f, 0x00c0, 0x1c99, 0x605c, 0xa422, 0x6060,
- 0xa31a, 0x2804, 0xa045, 0x00c0, 0x1ca7, 0x0050, 0x1ca1, 0x0078,
- 0x1d19, 0x6004, 0xa065, 0x0040, 0x1d19, 0x0078, 0x1c84, 0x2804,
- 0xa005, 0x0040, 0x1cc5, 0xac68, 0xd99c, 0x00c0, 0x1cb5, 0x6808,
- 0xa422, 0x680c, 0xa31b, 0x0078, 0x1cb9, 0x6810, 0xa422, 0x6814,
- 0xa31b, 0x0048, 0x1ce4, 0x2300, 0xa405, 0x0040, 0x1ccb, 0x8a51,
- 0x0040, 0x1d19, 0x8840, 0x0078, 0x1ca7, 0x6004, 0xa065, 0x0040,
- 0x1d19, 0x0078, 0x1c84, 0x8a51, 0x0040, 0x1d19, 0x8840, 0x2804,
- 0xa005, 0x00c0, 0x1cde, 0x6004, 0xa065, 0x0040, 0x1d19, 0x6034,
- 0xa0cc, 0x000f, 0xa9c0, 0x1c5c, 0x2804, 0x2040, 0x2b68, 0x6850,
- 0xc0fc, 0x6852, 0x0078, 0x1d11, 0x8422, 0x8420, 0x831a, 0xa399,
- 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0,
- 0x1cff, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048,
- 0x12d5, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x1d0b, 0x6910,
- 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x12d5, 0x6800,
- 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd,
- 0x6852, 0x2c00, 0x681a, 0x007f, 0x007f, 0x007f, 0xa006, 0x0078,
- 0x1d1e, 0x087f, 0x097f, 0x0a7f, 0xa085, 0x0001, 0x007c, 0x2001,
- 0x0005, 0x2004, 0xa084, 0x0007, 0x0079, 0x1d26, 0x1d2e, 0x1d2f,
- 0x1d32, 0x1d35, 0x1d3a, 0x1d3d, 0x1d42, 0x1d47, 0x007c, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x17a5, 0x007c, 0x1078, 0x17a5, 0x1078,
- 0x1b28, 0x007c, 0x1078, 0x145e, 0x007c, 0x1078, 0x1b28, 0x1078,
- 0x145e, 0x007c, 0x1078, 0x17a5, 0x1078, 0x145e, 0x007c, 0x1078,
- 0x17a5, 0x1078, 0x1b28, 0x1078, 0x145e, 0x007c, 0x127e, 0x2091,
- 0x2300, 0x2079, 0x0200, 0x2071, 0x7c80, 0x2069, 0x7700, 0x2009,
- 0x0004, 0x7912, 0x7817, 0x0004, 0x1078, 0x202c, 0x781b, 0x0002,
- 0x20e1, 0x8700, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x781c,
- 0xa084, 0x0007, 0x0079, 0x1d6c, 0x1d90, 0x1d74, 0x1d78, 0x1d7c,
- 0x1d82, 0x1d86, 0x1d8a, 0x1d8e, 0x1078, 0x4252, 0x0078, 0x1d90,
- 0x1078, 0x4281, 0x0078, 0x1d90, 0x1078, 0x4252, 0x1078, 0x4281,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x0078, 0x1d90, 0x1078, 0x1d92, 0x0078, 0x1d90, 0x1078, 0x1d92,
- 0x127f, 0x007c, 0x007e, 0x017e, 0x027e, 0x7930, 0xa184, 0x0003,
- 0x0040, 0x1d9c, 0x1078, 0x12d5, 0xa184, 0x0030, 0x0040, 0x1dad,
- 0x6a00, 0xa286, 0x0003, 0x00c0, 0x1da7, 0x1078, 0x12d5, 0x1078,
- 0x3553, 0x20e1, 0x9010, 0x0078, 0x1db9, 0xa184, 0x00c0, 0x0040,
- 0x1db3, 0x1078, 0x12d5, 0xa184, 0x0300, 0x0040, 0x1db9, 0x20e1,
- 0x9020, 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, 0x0e7e,
- 0x0f7e, 0x2071, 0x7700, 0x7128, 0x2001, 0x7923, 0x2102, 0x2001,
- 0x792b, 0x2102, 0xa182, 0x0211, 0x00c8, 0x1dd2, 0x2009, 0x0008,
- 0x0078, 0x1dfc, 0xa182, 0x0259, 0x00c8, 0x1dda, 0x2009, 0x0007,
- 0x0078, 0x1dfc, 0xa182, 0x02c1, 0x00c8, 0x1de2, 0x2009, 0x0006,
- 0x0078, 0x1dfc, 0xa182, 0x0349, 0x00c8, 0x1dea, 0x2009, 0x0005,
- 0x0078, 0x1dfc, 0xa182, 0x0421, 0x00c8, 0x1df2, 0x2009, 0x0004,
- 0x0078, 0x1dfc, 0xa182, 0x0581, 0x00c8, 0x1dfa, 0x2009, 0x0003,
- 0x0078, 0x1dfc, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, 0xa182,
- 0x0005, 0x00c8, 0x1e06, 0x7916, 0x0078, 0x1e08, 0x7817, 0x0004,
- 0x1078, 0x202c, 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x127e, 0x2091,
- 0x2200, 0x2061, 0x0100, 0x2071, 0x7700, 0x6024, 0x6026, 0x6033,
- 0x00ef, 0x60e7, 0x0000, 0x60eb, 0x00ef, 0x60e3, 0x0008, 0x604b,
- 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007,
- 0x0caf, 0x600f, 0x00ff, 0x602b, 0x002f, 0x127f, 0x007c, 0x2001,
- 0x772d, 0x2003, 0x0000, 0x2001, 0x772c, 0x2003, 0x0001, 0x007c,
- 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x027e, 0x6124, 0xa184,
- 0x002c, 0x00c0, 0x1e47, 0xa184, 0x0007, 0x0079, 0x1e4d, 0xa195,
- 0x0004, 0xa284, 0x0007, 0x0079, 0x1e4d, 0x1e79, 0x1e55, 0x1e59,
- 0x1e5d, 0x1e63, 0x1e67, 0x1e6d, 0x1e73, 0x1078, 0x47bc, 0x0078,
- 0x1e79, 0x1078, 0x48ab, 0x0078, 0x1e79, 0x1078, 0x48ab, 0x1078,
- 0x47bc, 0x0078, 0x1e79, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078,
- 0x47bc, 0x1078, 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x48ab, 0x1078,
- 0x1e7e, 0x0078, 0x1e79, 0x1078, 0x48ab, 0x1078, 0x47bc, 0x1078,
- 0x1e7e, 0x027f, 0x017f, 0x007f, 0x127f, 0x007c, 0xd1ac, 0x0040,
- 0x1f32, 0x017e, 0x047e, 0x0c7e, 0x644c, 0x74ba, 0xa48c, 0xff00,
- 0xa196, 0xff00, 0x0040, 0x1ead, 0x6030, 0xa084, 0x00ff, 0x810f,
- 0xa116, 0x0040, 0x1ead, 0x7130, 0xd18c, 0x00c0, 0x1ead, 0x2011,
- 0x7752, 0x2214, 0xd2ec, 0x0040, 0x1ea1, 0xc18d, 0x7132, 0x0078,
- 0x1ead, 0x6240, 0xa294, 0x0010, 0x0040, 0x1eef, 0x6248, 0xa294,
- 0xff00, 0xa296, 0xff00, 0x00c0, 0x1eef, 0x037e, 0x73b8, 0x2011,
- 0x8013, 0x1078, 0x2d20, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011,
- 0x7752, 0x220c, 0xd1a4, 0x0040, 0x1ed7, 0x017e, 0x2009, 0x0001,
- 0x2011, 0x0100, 0x1078, 0x478a, 0x2019, 0x000e, 0x1078, 0x758f,
- 0xa484, 0x00ff, 0xa080, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f,
- 0x8127, 0xa006, 0x2009, 0x000e, 0x1078, 0x75f7, 0x017f, 0xd1ac,
- 0x00c0, 0x1ee0, 0x2019, 0x0004, 0x1078, 0x226d, 0x0078, 0x1eef,
- 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x1078, 0x3806, 0x00c0,
- 0x1eeb, 0x1078, 0x35f9, 0x8108, 0x00f0, 0x1ee5, 0x157f, 0x0c7f,
- 0x047f, 0x6043, 0x0000, 0x2009, 0x00f7, 0x1078, 0x35bc, 0x0f7e,
- 0x2079, 0x7949, 0x783c, 0xa086, 0x0000, 0x0040, 0x1f07, 0x6027,
- 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x0000, 0x0f7f,
- 0x2011, 0x0003, 0x1078, 0x5892, 0x2011, 0x0002, 0x1078, 0x589c,
- 0x1078, 0x57a8, 0x1078, 0x46c0, 0x037e, 0x2019, 0x0000, 0x1078,
- 0x583a, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, 0x7700, 0x2014,
- 0xa296, 0x0004, 0x00c0, 0x1f2a, 0xd19c, 0x00c0, 0x1f2a, 0x6228,
- 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x7720, 0x2003, 0x0000,
- 0x6027, 0x0020, 0xd194, 0x0040, 0x1fd3, 0x0f7e, 0x2079, 0x7949,
- 0x783c, 0xa086, 0x0001, 0x00c0, 0x1f56, 0x017e, 0x6027, 0x0004,
- 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000, 0x7803, 0x0000,
- 0x2079, 0x7936, 0x7807, 0x0000, 0x7833, 0x0000, 0x1078, 0x4d50,
- 0x1078, 0x4e10, 0x017f, 0x0f7f, 0x0078, 0x1fd3, 0x0f7f, 0x017e,
- 0x6220, 0xd2b4, 0x0040, 0x1f8b, 0x1078, 0x46c0, 0x1078, 0x5656,
- 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804, 0xa084, 0x4000,
- 0x0040, 0x1f6e, 0x6803, 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e,
- 0x2061, 0x7936, 0x6028, 0xa09a, 0x0002, 0x00c8, 0x1f7e, 0x8000,
- 0x602a, 0x0c7f, 0x1078, 0x5648, 0x0078, 0x1fd2, 0x2019, 0x793f,
- 0x2304, 0xa065, 0x0040, 0x1f88, 0x2009, 0x0027, 0x1078, 0x5cfb,
- 0x0c7f, 0x0078, 0x1fd2, 0xd2bc, 0x0040, 0x1fd2, 0x1078, 0x46ce,
- 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, 0x2069, 0x0140, 0x6804,
- 0xa084, 0x4000, 0x0040, 0x1fa0, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0d7f, 0x0c7e, 0x2061, 0x7936, 0x6044, 0xa09a, 0x0002, 0x00c8,
- 0x1fc1, 0x8000, 0x6046, 0x603c, 0x0c7f, 0xa005, 0x0040, 0x1fd2,
- 0x1078, 0x46c5, 0xa080, 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0,
- 0x1fbd, 0x6017, 0x0012, 0x0078, 0x1fd2, 0x6017, 0x0016, 0x0078,
- 0x1fd2, 0x037e, 0x2019, 0x0001, 0x1078, 0x583a, 0x037f, 0x2019,
- 0x7945, 0x2304, 0xa065, 0x0040, 0x1fd1, 0x2009, 0x004f, 0x1078,
- 0x5cfb, 0x0c7f, 0x017f, 0xd19c, 0x0040, 0x1ffb, 0x017e, 0x6028,
- 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, 0x5892, 0x2011, 0x0002,
- 0x1078, 0x589c, 0x1078, 0x57a8, 0x1078, 0x46c0, 0x037e, 0x2019,
- 0x0000, 0x1078, 0x583a, 0x037f, 0x60e3, 0x0000, 0x1078, 0x7666,
- 0x1078, 0x7684, 0x2001, 0x7700, 0x2003, 0x0004, 0x6027, 0x0008,
- 0x1078, 0x11c6, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, 0x007e,
- 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7700, 0x71b0, 0x70b2, 0xa116, 0x0040, 0x2025, 0x81ff, 0x0040,
- 0x2017, 0x2011, 0x8011, 0x1078, 0x2d20, 0x0078, 0x2025, 0x2011,
- 0x8012, 0x1078, 0x2d20, 0x037e, 0x0c7e, 0x2061, 0x0100, 0x2019,
- 0x0028, 0x1078, 0x226d, 0x0c7f, 0x037f, 0x127f, 0x0f7f, 0x0e7f,
- 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, 0x0f7e, 0x007e, 0x027e,
- 0x2061, 0x0100, 0xa190, 0x2047, 0x2204, 0x60f2, 0xa192, 0x0005,
- 0x00c8, 0x203e, 0xa190, 0x2050, 0x0078, 0x2040, 0x2011, 0x2054,
- 0x2204, 0x60ee, 0x027f, 0x007f, 0x0f7f, 0x0c7f, 0x007c, 0x0840,
- 0x0840, 0x0840, 0x0580, 0x0420, 0x0348, 0x02c0, 0x0258, 0x0210,
- 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x0140, 0x00f8, 0x00d0, 0x00b0,
- 0x00a0, 0x2028, 0x2130, 0xa094, 0xff00, 0x00c0, 0x2062, 0x81ff,
- 0x0040, 0x2066, 0x1078, 0x4405, 0x0078, 0x206d, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0xff00, 0x810f, 0xa006, 0x007c, 0xa080, 0x2303,
- 0x200c, 0xa18c, 0x00ff, 0x007c, 0x2094, 0x2098, 0x209c, 0x20a2,
- 0x20a8, 0x20ae, 0x20b4, 0x20bc, 0x20c4, 0x20ca, 0x20d0, 0x20d8,
- 0x20e0, 0x20e8, 0x20f0, 0x20fa, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104, 0x2104,
- 0x2104, 0x2104, 0x2104, 0x2104, 0x107e, 0x007e, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38,
- 0x1078, 0x1d1f, 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1d1f, 0x1078, 0x1d64, 0x0078, 0x211d,
- 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f, 0x1078, 0x1d64,
- 0x0078, 0x211d, 0x107e, 0x007e, 0x1078, 0x1e38, 0x1078, 0x1d1f,
- 0x1078, 0x1d64, 0x0078, 0x211d, 0x0005, 0x0078, 0x2104, 0xb084,
- 0x003c, 0x8004, 0x8004, 0x0079, 0x210d, 0x211d, 0x209a, 0x209e,
- 0x20a4, 0x20aa, 0x20b0, 0x20b6, 0x20be, 0x20c6, 0x20cc, 0x20d2,
- 0x20da, 0x20e2, 0x20ea, 0x20f2, 0x20fc, 0x0008, 0x2107, 0x007f,
- 0x107f, 0x2091, 0x8001, 0x007c, 0x0c7e, 0x027e, 0x2041, 0x007e,
- 0x70bc, 0xd09c, 0x0040, 0x212e, 0x2041, 0x007f, 0x2001, 0x010c,
- 0x203c, 0x727c, 0x82ff, 0x0040, 0x2179, 0x037e, 0x738c, 0xa38e,
- 0xffff, 0x00c0, 0x213d, 0x2019, 0x0001, 0x8314, 0xa2e0, 0x7dc0,
- 0x2c04, 0xa38c, 0x0001, 0x0040, 0x214a, 0xa084, 0xff00, 0x8007,
- 0x0078, 0x214c, 0xa084, 0x00ff, 0xa70e, 0x0040, 0x216e, 0xa08e,
- 0x00ff, 0x0040, 0x2174, 0x2009, 0x0000, 0x1078, 0x2059, 0x1078,
- 0x37cb, 0x00c0, 0x2171, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x00c0, 0x2168, 0x1078, 0x21cb, 0x0040, 0x2171, 0x0078, 0x216e,
- 0x1078, 0x22cf, 0x1078, 0x21f2, 0x0040, 0x2171, 0x8318, 0x0078,
- 0x213d, 0x738e, 0x0078, 0x2176, 0x708f, 0xffff, 0x037f, 0x0078,
- 0x21c8, 0xa780, 0x2303, 0x203c, 0xa7bc, 0xff00, 0x873f, 0x708c,
- 0xa096, 0xffff, 0x0040, 0x218b, 0xa812, 0x00c8, 0x219b, 0x708f,
- 0xffff, 0x0078, 0x21c5, 0x2009, 0x0000, 0x70bc, 0xd09c, 0x0040,
- 0x2196, 0xd094, 0x0040, 0x2196, 0x2009, 0x007e, 0x2100, 0xa802,
- 0x20a8, 0x0078, 0x219f, 0x2008, 0x2810, 0xa202, 0x20a8, 0x2700,
- 0x157e, 0x017e, 0xa106, 0x0040, 0x21bc, 0x1078, 0x37cb, 0x00c0,
- 0x21c5, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x21b6,
- 0x1078, 0x21cb, 0x0040, 0x21c5, 0x0078, 0x21bc, 0x1078, 0x22cf,
- 0x1078, 0x21f2, 0x0040, 0x21c5, 0x017f, 0x8108, 0x157f, 0x00f0,
- 0x219f, 0x708f, 0xffff, 0x0078, 0x21c8, 0x017f, 0x157f, 0x718e,
- 0x027f, 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68,
- 0x1078, 0x5c6e, 0x0040, 0x21ed, 0x2d00, 0x601a, 0x601f, 0x0001,
- 0x2001, 0x0000, 0x1078, 0x379a, 0x2001, 0x0000, 0x1078, 0x37ae,
- 0x127e, 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009,
- 0x0004, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f,
- 0x017f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5c6e, 0x0040, 0x2214, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x127e,
- 0x2091, 0x8000, 0x7088, 0x8000, 0x708a, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5cfb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x027e, 0x2009, 0x0080, 0x1078, 0x37cb, 0x00c0,
- 0x2227, 0x1078, 0x222a, 0x0040, 0x2227, 0x70c3, 0xffff, 0x027f,
- 0x0c7f, 0x007c, 0x017e, 0x077e, 0x0d7e, 0x0c7e, 0x2c68, 0x1078,
- 0x5c6e, 0x0040, 0x224c, 0x2d00, 0x601a, 0x601f, 0x0001, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x127e,
- 0x2091, 0x8000, 0x70c4, 0x8000, 0x70c6, 0x127f, 0x2009, 0x0002,
- 0x1078, 0x5cfb, 0xa085, 0x0001, 0x0c7f, 0x0d7f, 0x077f, 0x017f,
- 0x007c, 0x0c7e, 0x0d7e, 0x2009, 0x007f, 0x1078, 0x37cb, 0x00c0,
- 0x226a, 0x2c68, 0x1078, 0x5c6e, 0x0040, 0x226a, 0x2d00, 0x601a,
- 0x6312, 0x601f, 0x0001, 0x620a, 0x2009, 0x0022, 0x1078, 0x5cfb,
- 0xa085, 0x0001, 0x0d7f, 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x067e,
- 0x037e, 0x027e, 0x1078, 0x4a3f, 0x1078, 0x49ef, 0x1078, 0x61c8,
- 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e, 0x1078, 0x3806, 0x00c0,
- 0x2285, 0x1078, 0x39f0, 0x1078, 0x35f9, 0x017f, 0x8108, 0x00f0,
- 0x227c, 0x027f, 0x037f, 0x067f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e,
- 0x0c7e, 0x037e, 0x027e, 0x017e, 0x6218, 0x2270, 0x72a0, 0x027e,
- 0x2019, 0x0029, 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08, 0x1078,
- 0x7431, 0x017f, 0x2e60, 0x1078, 0x39f0, 0xa186, 0x007f, 0x0040,
- 0x22ab, 0x1078, 0x35f9, 0x017f, 0x027f, 0x037f, 0x0c7f, 0x0e7f,
- 0x007c, 0x0e7e, 0x007e, 0x6018, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x00c0, 0x22c5, 0x2071, 0x7700, 0x7088, 0xa005, 0x0040, 0x22c2,
- 0x8001, 0x708a, 0x007f, 0x0e7f, 0x007c, 0x2071, 0x7700, 0x70c4,
- 0xa005, 0x0040, 0x22c2, 0x8001, 0x70c6, 0x0078, 0x22c2, 0x6000,
- 0xc08c, 0x6002, 0x007c, 0x0e7e, 0x0c7e, 0x037e, 0x027e, 0x017e,
- 0x157e, 0x81ff, 0x00c0, 0x22e0, 0x20a9, 0x0001, 0x0078, 0x22e4,
- 0x20a9, 0x007f, 0x2011, 0x0000, 0x027e, 0xa2e0, 0x7820, 0x2c64,
- 0x8cff, 0x0040, 0x22f6, 0x2019, 0x0029, 0x1078, 0x4a38, 0x1078,
- 0x497b, 0x2c08, 0x1078, 0x7431, 0x1078, 0x39f0, 0x027f, 0x8210,
- 0x00f0, 0x22e4, 0x027e, 0x027f, 0x157f, 0x017f, 0x027f, 0x037f,
- 0x0c7f, 0x0e7f, 0x007c, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1,
- 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3,
- 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9,
- 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6,
- 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac,
- 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f,
- 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488,
- 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76,
- 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c,
- 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c,
- 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151,
- 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46,
- 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034,
- 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a,
- 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d,
- 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902,
- 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500,
- 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000,
- 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000,
- 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400,
- 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00,
- 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000,
- 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100,
- 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00,
- 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600,
- 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200,
- 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
- 0x8000, 0x8000, 0x8000, 0x2071, 0x776d, 0x7003, 0x0002, 0xa006,
- 0x7012, 0x7016, 0x703a, 0x703e, 0x7033, 0x777d, 0x7037, 0x777d,
- 0x7007, 0x0001, 0x2061, 0x77bd, 0x6003, 0x0002, 0x007c, 0x0090,
- 0x242a, 0x0068, 0x242a, 0x2071, 0x776d, 0x2b78, 0x7818, 0xd084,
- 0x00c0, 0x242a, 0x2a60, 0x7820, 0xa08e, 0x0069, 0x00c0, 0x2511,
- 0x0079, 0x24ae, 0x007c, 0x2071, 0x776d, 0x7004, 0x0079, 0x2430,
- 0x2434, 0x2435, 0x243f, 0x2451, 0x007c, 0x0090, 0x243e, 0x0068,
- 0x243e, 0x2b78, 0x7818, 0xd084, 0x0040, 0x245d, 0x007c, 0x2b78,
- 0x2061, 0x77bd, 0x6008, 0xa08e, 0x0100, 0x0040, 0x244c, 0xa086,
- 0x0200, 0x0040, 0x2509, 0x007c, 0x7014, 0x2068, 0x2a60, 0x7018,
- 0x007a, 0x7010, 0x2068, 0x6834, 0xa086, 0x0103, 0x0040, 0x2459,
- 0x007c, 0x2a60, 0x2b78, 0x7018, 0x007a, 0x2a60, 0x7820, 0xa08a,
- 0x0040, 0x00c8, 0x2466, 0x61b0, 0x0079, 0x246e, 0x2100, 0xa08a,
- 0x0036, 0x00c8, 0x2505, 0x61b0, 0x0079, 0x24ae, 0x24e7, 0x2519,
- 0x2521, 0x2525, 0x252d, 0x2533, 0x2537, 0x2540, 0x2544, 0x254c,
- 0x2550, 0x2505, 0x2505, 0x2505, 0x2554, 0x2505, 0x2564, 0x257b,
- 0x2592, 0x260e, 0x2613, 0x2640, 0x269a, 0x26ab, 0x26c9, 0x26fc,
- 0x2706, 0x2713, 0x2726, 0x2740, 0x2749, 0x2786, 0x278c, 0x2505,
- 0x279c, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x27a0, 0x27a6,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x27ae, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x27bb, 0x27c1,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x254c, 0x2550,
- 0x2505, 0x2505, 0x27d3, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505,
- 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2505, 0x2820, 0x28ed,
- 0x2901, 0x2908, 0x296b, 0x29c6, 0x29d1, 0x2a10, 0x2a1f, 0x2a2e,
- 0x2a31, 0x27d7, 0x2a5a, 0x2aa1, 0x2aae, 0x2ba0, 0x2c86, 0x2cad,
- 0x2dab, 0x2db9, 0x2dc6, 0x2e00, 0x713c, 0x0078, 0x24e7, 0x2021,
- 0x4000, 0x1078, 0x2cfa, 0x127e, 0x2091, 0x8000, 0x0068, 0x24f4,
- 0x7818, 0xd084, 0x0040, 0x24f7, 0x127f, 0x0078, 0x24eb, 0x781b,
- 0x0001, 0x7c22, 0x7926, 0x7a2a, 0x7b2e, 0x2091, 0x4080, 0x7007,
- 0x0001, 0x2091, 0x5000, 0x127f, 0x007c, 0x2021, 0x4001, 0x0078,
- 0x24e9, 0x2021, 0x4002, 0x0078, 0x24e9, 0x2021, 0x4003, 0x0078,
- 0x24e9, 0x2021, 0x4005, 0x0078, 0x24e9, 0x2021, 0x4006, 0x0078,
- 0x24e9, 0xa02e, 0x2520, 0x7b28, 0x7a2c, 0x7824, 0x7930, 0x0078,
- 0x2d09, 0x7823, 0x0004, 0x7824, 0x007a, 0xa02e, 0x2520, 0x7b28,
- 0x7a2c, 0x7824, 0x7930, 0x0078, 0x2d0d, 0x7924, 0x7828, 0x2114,
- 0x200a, 0x0078, 0x24e7, 0x7924, 0x2114, 0x0078, 0x24e7, 0x2099,
- 0x0009, 0x20a1, 0x0009, 0x20a9, 0x0007, 0x53a3, 0x0078, 0x24e7,
- 0x7824, 0x2060, 0x0078, 0x2556, 0x2009, 0x0001, 0x2011, 0x000f,
- 0x2019, 0x0007, 0x0078, 0x24e7, 0x7d38, 0x7c3c, 0x0078, 0x251b,
- 0x7d38, 0x7c3c, 0x0078, 0x2527, 0x2061, 0x1000, 0x610c, 0xa006,
- 0x2c14, 0xa200, 0x8c60, 0x8109, 0x00c0, 0x2558, 0x2010, 0xa005,
- 0x0040, 0x24e7, 0x0078, 0x250d, 0x2061, 0x7751, 0x7824, 0x7930,
- 0xa11a, 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604a, 0x6142,
- 0x782c, 0x6052, 0x7828, 0x6056, 0xa006, 0x605a, 0x605e, 0x1078,
- 0x3d43, 0x0078, 0x24e7, 0x2061, 0x7751, 0x7824, 0x7930, 0xa11a,
- 0x00c8, 0x2515, 0x8019, 0x0040, 0x2515, 0x604e, 0x6146, 0x782c,
- 0x6062, 0x7828, 0x6066, 0xa006, 0x606a, 0x606e, 0x1078, 0x3b19,
- 0x0078, 0x24e7, 0xa02e, 0x2520, 0x81ff, 0x00c0, 0x2511, 0x7924,
- 0x7b28, 0x7a2c, 0x20a9, 0x0005, 0x20a1, 0x7774, 0x41a1, 0x1078,
- 0x2cbf, 0x0040, 0x2511, 0x2009, 0x0020, 0x1078, 0x2d09, 0x701b,
- 0x25aa, 0x007c, 0x6834, 0x2008, 0xa084, 0x00ff, 0xa096, 0x0011,
- 0x0040, 0x25b6, 0xa096, 0x0019, 0x00c0, 0x2511, 0x810f, 0xa18c,
- 0x00ff, 0x0040, 0x2511, 0x710e, 0x700c, 0x8001, 0x0040, 0x25e7,
- 0x700e, 0x1078, 0x2cbf, 0x0040, 0x2511, 0x2009, 0x0020, 0x2061,
- 0x77bd, 0x6224, 0x6328, 0x642c, 0x6530, 0xa290, 0x0040, 0xa399,
- 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x1078, 0x2d09, 0x701b,
- 0x25da, 0x007c, 0x6834, 0xa084, 0x00ff, 0xa096, 0x0002, 0x0040,
- 0x25e5, 0xa096, 0x000a, 0x00c0, 0x2511, 0x0078, 0x25bc, 0x7010,
- 0x2068, 0x6838, 0xc0fd, 0x683a, 0x1078, 0x36fe, 0x00c0, 0x25f5,
- 0x7007, 0x0003, 0x701b, 0x25f7, 0x007c, 0x1078, 0x3bdc, 0x127e,
- 0x2091, 0x8000, 0x20a9, 0x0005, 0x2099, 0x7774, 0x530a, 0x2100,
- 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0xad80,
- 0x000d, 0x2009, 0x0020, 0x127f, 0x0078, 0x2d0d, 0x6198, 0x7824,
- 0x609a, 0x0078, 0x24e7, 0x2091, 0x8000, 0x7823, 0x4000, 0x7827,
- 0x4953, 0x782b, 0x5020, 0x782f, 0x2020, 0x2009, 0x017f, 0x2104,
- 0x7832, 0x3f00, 0x7836, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
- 0x603c, 0x8007, 0xa205, 0x783a, 0x2009, 0x04fd, 0x2104, 0x783e,
- 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2071, 0x0010,
- 0x20c1, 0x00f0, 0xa08a, 0x0003, 0x00c8, 0x0427, 0x0078, 0x0423,
- 0x81ff, 0x00c0, 0x2511, 0x7924, 0x810f, 0xa18c, 0x00ff, 0x1078,
- 0x3806, 0x00c0, 0x2515, 0x7e38, 0xa684, 0x3fff, 0xa082, 0x4000,
- 0x0048, 0x2654, 0x0078, 0x2515, 0x7c28, 0x7d2c, 0x1078, 0x39b7,
- 0xd28c, 0x00c0, 0x265f, 0x1078, 0x394b, 0x0078, 0x2661, 0x1078,
- 0x3985, 0x00c0, 0x268b, 0x2061, 0x7e00, 0x127e, 0x2091, 0x8000,
- 0x6000, 0xa086, 0x0000, 0x0040, 0x2679, 0x6010, 0xa06d, 0x0040,
- 0x2679, 0x683c, 0xa406, 0x00c0, 0x2679, 0x6840, 0xa506, 0x0040,
- 0x2684, 0x127f, 0xace0, 0x0008, 0x2001, 0x7715, 0x2004, 0xac02,
- 0x00c8, 0x2511, 0x0078, 0x2665, 0x1078, 0x67fd, 0x127f, 0x0040,
- 0x2511, 0x0078, 0x24e7, 0xa00e, 0x2001, 0x0005, 0x1078, 0x3bdc,
- 0x127e, 0x2091, 0x8000, 0x1078, 0x6c12, 0x1078, 0x3b4c, 0x127f,
- 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cd7, 0x0040,
- 0x2515, 0x1078, 0x388f, 0x0040, 0x2511, 0x1078, 0x39c4, 0x0040,
- 0x2511, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2ce9,
- 0x0040, 0x2515, 0x1078, 0x3a2b, 0x0040, 0x2511, 0x2019, 0x0005,
- 0x1078, 0x39e5, 0x0040, 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2515, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4650, 0x0078,
- 0x24e7, 0x127e, 0x2091, 0x8000, 0x81ff, 0x00c0, 0x26f6, 0x2029,
- 0x00ff, 0x644c, 0x2400, 0xa506, 0x0040, 0x26f0, 0x2508, 0x1078,
- 0x3806, 0x00c0, 0x26f0, 0x1078, 0x3a2b, 0x0040, 0x2511, 0x2019,
- 0x0004, 0x1078, 0x39e5, 0x0040, 0x26f6, 0x7824, 0xa08a, 0x1000,
- 0x00c8, 0x26f9, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4650,
- 0x8529, 0x00c8, 0x26d2, 0x127f, 0x0078, 0x24e7, 0x127f, 0x0078,
- 0x2511, 0x127f, 0x0078, 0x2515, 0x1078, 0x2cd7, 0x0040, 0x2515,
- 0x1078, 0x38fc, 0x1078, 0x39b7, 0x0078, 0x24e7, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x38eb, 0x1078,
- 0x39b7, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cd7,
- 0x0040, 0x2515, 0x1078, 0x3988, 0x0040, 0x2511, 0x1078, 0x3747,
- 0x1078, 0x3944, 0x1078, 0x39b7, 0x0078, 0x24e7, 0x1078, 0x2cd7,
- 0x0040, 0x2515, 0x1078, 0x388f, 0x0040, 0x2511, 0x62a0, 0x2019,
- 0x0005, 0x0c7e, 0x1078, 0x39f0, 0x0c7f, 0x1078, 0x4a38, 0x1078,
- 0x497b, 0x2c08, 0x1078, 0x7431, 0x1078, 0x39b7, 0x0078, 0x24e7,
- 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x39b7, 0x2208, 0x0078,
- 0x24e7, 0x157e, 0x0d7e, 0x0e7e, 0x2069, 0x77ff, 0x6810, 0x6914,
- 0xa10a, 0x00c8, 0x2755, 0x2009, 0x0000, 0x6816, 0x2011, 0x0000,
- 0x2019, 0x0000, 0x20a9, 0x007e, 0x2069, 0x7820, 0x2d04, 0xa075,
- 0x0040, 0x276a, 0x704c, 0x1078, 0x2774, 0xa210, 0x7080, 0x1078,
- 0x2774, 0xa318, 0x8d68, 0x00f0, 0x275e, 0x2300, 0xa218, 0x0e7f,
- 0x0d7f, 0x157f, 0x0078, 0x24e7, 0x0f7e, 0x017e, 0xa07d, 0x0040,
- 0x2783, 0x2001, 0x0000, 0x8000, 0x2f0c, 0x81ff, 0x0040, 0x2783,
- 0x2178, 0x0078, 0x277b, 0x017f, 0x0f7f, 0x007c, 0x2069, 0x77ff,
- 0x6910, 0x629c, 0x0078, 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x614c,
- 0xa190, 0x2303, 0x2214, 0xa294, 0x00ff, 0x6068, 0xa084, 0xff00,
- 0xa215, 0x6364, 0x0078, 0x24e7, 0x613c, 0x6240, 0x0078, 0x24e7,
- 0x1078, 0x2ce9, 0x0040, 0x2515, 0x0078, 0x24e7, 0x1078, 0x2ce9,
- 0x0040, 0x2515, 0x6244, 0x6338, 0x0078, 0x24e7, 0x613c, 0x6240,
- 0x7824, 0x603e, 0x7b28, 0x6342, 0x2069, 0x7751, 0x831f, 0xa305,
- 0x6816, 0x0078, 0x24e7, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x0078,
- 0x24e7, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x7828, 0xa00d, 0x0040,
- 0x2515, 0x782c, 0xa005, 0x0040, 0x2515, 0x6244, 0x6146, 0x6338,
- 0x603a, 0x0078, 0x24e7, 0x7d38, 0x7c3c, 0x0078, 0x2594, 0x7824,
- 0xa09c, 0x00ff, 0xa39a, 0x0003, 0x00c8, 0x2511, 0x624c, 0xa084,
- 0xff00, 0x8007, 0xa206, 0x00c0, 0x27ef, 0x2001, 0x7740, 0x2009,
- 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d0d, 0x81ff,
- 0x00c0, 0x2511, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x6004, 0xa084,
- 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2511, 0x0c7e, 0x1078, 0x2cbf,
- 0x0c7f, 0x0040, 0x2511, 0x6837, 0x0000, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x6b0c, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2811,
- 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511, 0xad80, 0x000e,
- 0x2009, 0x000c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d0d,
- 0x1078, 0x2cbf, 0x0040, 0x2511, 0x2009, 0x001c, 0x7a2c, 0x7b28,
- 0x7c3c, 0x7d38, 0x1078, 0x2d09, 0x701b, 0x282f, 0x007c, 0xade8,
- 0x000d, 0x6800, 0xa005, 0x0040, 0x2515, 0x6804, 0xd0ac, 0x0040,
- 0x283c, 0xd0a4, 0x0040, 0x2515, 0xd094, 0x0040, 0x2847, 0x0c7e,
- 0x2061, 0x0100, 0x6104, 0xa18c, 0xffdf, 0x6106, 0x0c7f, 0xd08c,
- 0x0040, 0x2852, 0x0c7e, 0x2061, 0x0100, 0x6104, 0xa18d, 0x0010,
- 0x6106, 0x0c7f, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0002, 0x0048,
- 0x2867, 0xd084, 0x0040, 0x2867, 0x6a28, 0xa28a, 0x007f, 0x00c8,
- 0x2515, 0xa288, 0x2303, 0x210c, 0xa18c, 0x00ff, 0x6152, 0xd0dc,
- 0x0040, 0x2870, 0x6828, 0xa08a, 0x007f, 0x00c8, 0x2515, 0x604e,
- 0x6808, 0xa08a, 0x0100, 0x0048, 0x2515, 0xa08a, 0x0841, 0x00c8,
- 0x2515, 0xa084, 0x0007, 0x00c0, 0x2515, 0x680c, 0xa005, 0x0040,
- 0x2515, 0x6810, 0xa005, 0x0040, 0x2515, 0x6848, 0x6940, 0xa10a,
- 0x00c8, 0x2515, 0x8001, 0x0040, 0x2515, 0x684c, 0x6944, 0xa10a,
- 0x00c8, 0x2515, 0x8001, 0x0040, 0x2515, 0x20a9, 0x001c, 0x2d98,
- 0x2069, 0x7751, 0x2da0, 0x53a3, 0x6814, 0xa08c, 0x00ff, 0x613e,
- 0x8007, 0xa084, 0x00ff, 0x6042, 0x1078, 0x3d43, 0x1078, 0x3b19,
- 0x6000, 0xa086, 0x0000, 0x00c0, 0x28eb, 0x6808, 0x602a, 0x1078,
- 0x1dbe, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217,
- 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0040,
- 0x28cb, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217,
- 0x831f, 0x0078, 0x28cd, 0xa084, 0xf0ff, 0x6006, 0x610a, 0x620e,
- 0x6312, 0x1078, 0x46dc, 0x0c7e, 0x2061, 0x0100, 0x602f, 0x0040,
- 0x602f, 0x0000, 0x0c7f, 0x60b4, 0xa005, 0x0040, 0x28e7, 0x6003,
- 0x0001, 0x2091, 0x301d, 0x1078, 0x3553, 0x0078, 0x28eb, 0x6003,
- 0x0004, 0x2091, 0x301d, 0x0078, 0x24e7, 0x6000, 0xa086, 0x0000,
- 0x0040, 0x2511, 0x2069, 0x7751, 0x7830, 0x6842, 0x7834, 0x6846,
- 0x2d00, 0x2009, 0x001c, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078,
- 0x2d0d, 0x81ff, 0x00c0, 0x2511, 0x1078, 0x3553, 0x0078, 0x24e7,
- 0x81ff, 0x00c0, 0x2511, 0x617c, 0x81ff, 0x0040, 0x2922, 0x703f,
- 0x0000, 0x2001, 0x7dc0, 0x2009, 0x0040, 0x7a2c, 0x7b28, 0x7c3c,
- 0x7d38, 0x127e, 0x2091, 0x8000, 0x1078, 0x2d0d, 0x701b, 0x24e4,
- 0x127f, 0x007c, 0x703f, 0x0001, 0x0d7e, 0x2069, 0x7dc0, 0x20a9,
- 0x0040, 0x20a1, 0x7dc0, 0x2019, 0xffff, 0x43a4, 0x654c, 0xa588,
- 0x2303, 0x210c, 0xa18c, 0x00ff, 0x216a, 0xa00e, 0x2011, 0x0002,
- 0x2100, 0xa506, 0x0040, 0x2954, 0x1078, 0x3806, 0x00c0, 0x2954,
- 0x6014, 0x821c, 0x0048, 0x294c, 0xa398, 0x7dc0, 0xa085, 0xff00,
- 0x8007, 0x201a, 0x0078, 0x2953, 0xa398, 0x7dc0, 0x2324, 0xa4a4,
- 0xff00, 0xa405, 0x201a, 0x8210, 0x8108, 0xa182, 0x0080, 0x00c8,
- 0x295b, 0x0078, 0x2938, 0x8201, 0x8007, 0x2d0c, 0xa105, 0x206a,
- 0x0d7f, 0x20a9, 0x0040, 0x20a1, 0x7dc0, 0x2099, 0x7dc0, 0x1078,
- 0x359c, 0x0078, 0x2911, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x0c7e,
- 0x1078, 0x2cbf, 0x0c7f, 0x0040, 0x2511, 0x2001, 0x7752, 0x2004,
- 0xd0b4, 0x0040, 0x2998, 0x6000, 0xd08c, 0x00c0, 0x2998, 0x6004,
- 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2998, 0x6837, 0x0000,
- 0x6838, 0xc0fd, 0x683a, 0x1078, 0x6b44, 0x0040, 0x2511, 0x7007,
- 0x0003, 0x701b, 0x2994, 0x007c, 0x1078, 0x2ce9, 0x0040, 0x2515,
- 0x20a9, 0x002b, 0x2c98, 0xade8, 0x0002, 0x2da0, 0x53a3, 0x20a9,
- 0x0002, 0xac80, 0x0004, 0x2098, 0xad80, 0x0004, 0x20a0, 0x1078,
- 0x359c, 0x20a9, 0x0004, 0xac80, 0x0006, 0x2098, 0xad80, 0x0006,
- 0x20a0, 0x1078, 0x359c, 0x20a9, 0x0004, 0xac80, 0x000a, 0x2098,
- 0xad80, 0x000a, 0x20a0, 0x1078, 0x359c, 0x2d00, 0x2009, 0x002b,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x0078, 0x2d0d, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x39cf, 0x0078,
- 0x24e7, 0x81ff, 0x00c0, 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2515, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x1078, 0x3a2b, 0x0040,
- 0x2511, 0x2019, 0x0004, 0x1078, 0x39e5, 0x7924, 0x810f, 0x7a28,
- 0x1078, 0x29ec, 0x0078, 0x24e7, 0xa186, 0x00ff, 0x0040, 0x29f4,
- 0x1078, 0x2a04, 0x0078, 0x2a03, 0x2029, 0x007e, 0x2061, 0x7700,
- 0x644c, 0x2400, 0xa506, 0x0040, 0x2a00, 0x2508, 0x1078, 0x2a04,
- 0x8529, 0x00c8, 0x29f9, 0x007c, 0x1078, 0x3806, 0x00c0, 0x2a0f,
- 0x2200, 0x8003, 0x800b, 0x810b, 0xa108, 0x1078, 0x4650, 0x007c,
- 0x81ff, 0x00c0, 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078,
- 0x388f, 0x0040, 0x2511, 0x1078, 0x39da, 0x0078, 0x24e7, 0x81ff,
- 0x00c0, 0x2511, 0x1078, 0x2cd7, 0x0040, 0x2515, 0x1078, 0x388f,
- 0x0040, 0x2511, 0x1078, 0x39c4, 0x0078, 0x24e7, 0x6100, 0x0078,
- 0x24e7, 0x1078, 0x2ce9, 0x0040, 0x2515, 0x6004, 0xa086, 0x0707,
- 0x0040, 0x2515, 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x2511, 0x0d7e, 0xace8, 0x000a, 0x7924, 0xd184, 0x0040, 0x2a4a,
- 0xace8, 0x0006, 0x680c, 0x8007, 0x783e, 0x6808, 0x8007, 0x783a,
- 0x6b04, 0x831f, 0x6a00, 0x8217, 0x0d7f, 0x6100, 0xa18c, 0x0200,
- 0x0078, 0x24e7, 0x7824, 0xa084, 0x00ff, 0xa086, 0x00ff, 0x0040,
- 0x2a64, 0x81ff, 0x00c0, 0x2511, 0x7828, 0xa08a, 0x1000, 0x00c8,
- 0x2515, 0x7924, 0xa18c, 0xff00, 0x810f, 0xa186, 0x00ff, 0x0040,
- 0x2a78, 0xa182, 0x007f, 0x00c8, 0x2515, 0x2100, 0x1078, 0x206e,
- 0x027e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x2061, 0x7949, 0x601b,
- 0x0000, 0x601f, 0x0000, 0x2061, 0x0100, 0x6030, 0xa084, 0x00ff,
- 0x810f, 0xa105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
- 0x001e, 0x2011, 0x3578, 0x1078, 0x46d3, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0x7a28, 0x1078, 0x29ec, 0x127f, 0x0c7f, 0x027f, 0x0078,
- 0x24e7, 0x7924, 0xa18c, 0xff00, 0x810f, 0x0c7e, 0x1078, 0x37cb,
- 0x2c08, 0x0c7f, 0x00c0, 0x2515, 0x0078, 0x24e7, 0x81ff, 0x00c0,
- 0x2511, 0x60bc, 0xd09c, 0x0040, 0x2511, 0x1078, 0x2cbf, 0x0040,
- 0x2511, 0x6823, 0x0000, 0x7924, 0x7a2c, 0x7b28, 0x7c3c, 0x7d38,
- 0x1078, 0x2d09, 0x701b, 0x2ac5, 0x007c, 0x2009, 0x0080, 0x1078,
- 0x3806, 0x00c0, 0x2ad2, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006,
- 0x0040, 0x2ad6, 0x2021, 0x400a, 0x0078, 0x24e9, 0x0d7e, 0xade8,
- 0x000d, 0x6900, 0x6a08, 0x6b0c, 0x6c10, 0x6d14, 0x6e18, 0x6820,
- 0xa0be, 0x0100, 0x0040, 0x2b48, 0xa0be, 0x0112, 0x0040, 0x2b48,
- 0xa0be, 0x0113, 0x0040, 0x2b48, 0xa0be, 0x0114, 0x0040, 0x2b48,
- 0xa0be, 0x0117, 0x0040, 0x2b48, 0xa0be, 0x011a, 0x0040, 0x2b48,
- 0xa0be, 0x0121, 0x0040, 0x2b3e, 0xa0be, 0x0131, 0x0040, 0x2b3e,
- 0xa0be, 0x0171, 0x0040, 0x2b48, 0xa0be, 0x0173, 0x0040, 0x2b48,
- 0xa0be, 0x01a1, 0x00c0, 0x2b11, 0x6830, 0x8007, 0x6832, 0x0078,
- 0x2b4e, 0xa0be, 0x0212, 0x0040, 0x2b44, 0xa0be, 0x0213, 0x0040,
- 0x2b44, 0xa0be, 0x0214, 0x0040, 0x2b36, 0xa0be, 0x0217, 0x0040,
- 0x2b30, 0xa0be, 0x021a, 0x00c0, 0x2b2a, 0x6838, 0x8007, 0x683a,
- 0x0078, 0x2b48, 0xa0be, 0x0300, 0x0040, 0x2b48, 0x0078, 0x2511,
- 0xad80, 0x0010, 0x20a9, 0x0007, 0x1078, 0x2b7c, 0xad80, 0x000e,
- 0x20a9, 0x0001, 0x1078, 0x2b7c, 0x0078, 0x2b48, 0xad80, 0x000c,
- 0x1078, 0x2b8a, 0x0078, 0x2b4e, 0xad80, 0x000e, 0x1078, 0x2b8a,
- 0xad80, 0x000c, 0x20a9, 0x0001, 0x1078, 0x2b7c, 0x0c7e, 0x1078,
- 0x2cbf, 0x0040, 0x2b71, 0x6837, 0x0119, 0x684f, 0x0020, 0x685b,
- 0x0001, 0x810b, 0x697e, 0x6883, 0x0000, 0x6a86, 0x6b8a, 0x6c8e,
- 0x6d92, 0x6996, 0x689b, 0x0000, 0x0c7f, 0x0d7f, 0x6837, 0x0000,
- 0x1078, 0x6b28, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2b75,
- 0x007c, 0x0c7f, 0x0d7f, 0x0078, 0x2511, 0x6820, 0xa086, 0x8001,
- 0x0040, 0x2511, 0x0078, 0x24e7, 0x017e, 0x2008, 0x2044, 0x8000,
- 0x204c, 0x8000, 0x290a, 0x8108, 0x280a, 0x8108, 0x00f0, 0x2b7e,
- 0x017f, 0x007c, 0x017e, 0x0a7e, 0x0b7e, 0x2008, 0x2044, 0x8000,
- 0x204c, 0x8000, 0x2054, 0x8000, 0x205c, 0x2b0a, 0x8108, 0x2a0a,
- 0x8108, 0x290a, 0x8108, 0x280a, 0x0b7f, 0x0a7f, 0x017f, 0x007c,
- 0x81ff, 0x00c0, 0x2511, 0x7924, 0x2140, 0xa18c, 0xff00, 0x810f,
- 0xa182, 0x0080, 0x0048, 0x2515, 0xa182, 0x00ff, 0x00c8, 0x2515,
- 0x7a2c, 0x7b28, 0x6064, 0xa306, 0x00c0, 0x2bc1, 0x6068, 0xa246,
- 0xa8c4, 0xff00, 0x0040, 0x2515, 0xa206, 0x00c0, 0x2bc1, 0x0078,
- 0x2515, 0x0c7e, 0x1078, 0x2c2a, 0x2c68, 0x0c7f, 0x0040, 0x2be8,
- 0xa0c6, 0x4000, 0x00c0, 0x2bce, 0x0078, 0x2be5, 0xa0c6, 0x4007,
- 0x00c0, 0x2bd5, 0x2408, 0x0078, 0x2be5, 0xa0c6, 0x4008, 0x00c0,
- 0x2bdd, 0x2708, 0x2610, 0x0078, 0x2be5, 0xa0c6, 0x4009, 0x00c0,
- 0x2be3, 0x0078, 0x2be5, 0x2001, 0x4006, 0x2020, 0x0078, 0x24e9,
- 0x017e, 0x0b7e, 0x0c7e, 0x0e7e, 0x2c70, 0x1078, 0x5c6e, 0x0040,
- 0x2c18, 0x2d00, 0x601a, 0x2e58, 0x0e7f, 0x0e7e, 0x0c7e, 0x1078,
- 0x2cbf, 0x0c7f, 0x2b70, 0x0040, 0x2511, 0x6837, 0x0000, 0x2d00,
- 0x6012, 0x601f, 0x0001, 0x2001, 0x0000, 0x1078, 0x379a, 0x2001,
- 0x0002, 0x1078, 0x37ae, 0x127e, 0x2091, 0x8000, 0x7088, 0x8000,
- 0x708a, 0x127f, 0x2009, 0x0002, 0x1078, 0x5cfb, 0xa085, 0x0001,
- 0x0e7f, 0x0c7f, 0x0b7f, 0x017f, 0x0040, 0x2511, 0x7007, 0x0003,
- 0x701b, 0x2c23, 0x007c, 0x6830, 0xa086, 0x0100, 0x00c0, 0x24e7,
- 0x0078, 0x2511, 0x0e7e, 0x0d7e, 0x2029, 0x0000, 0x2021, 0x0080,
- 0x20a9, 0x007f, 0x2071, 0x78a0, 0x2e04, 0xa005, 0x00c0, 0x2c3e,
- 0x2100, 0xa406, 0x0040, 0x2c7b, 0x0078, 0x2c6f, 0x2068, 0x6f10,
- 0x2700, 0xa306, 0x00c0, 0x2c60, 0x6e14, 0x2600, 0xa206, 0x00c0,
- 0x2c60, 0x2400, 0xa106, 0x00c0, 0x2c5c, 0x2d60, 0xd884, 0x0040,
- 0x2c81, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2c81,
- 0x2001, 0x4000, 0x0078, 0x2c82, 0x2001, 0x4007, 0x0078, 0x2c82,
- 0x2400, 0xa106, 0x00c0, 0x2c6f, 0x6e14, 0x87ff, 0x00c0, 0x2c6b,
- 0x86ff, 0x0040, 0x2c7b, 0x2001, 0x4008, 0x0078, 0x2c82, 0x8420,
- 0x8e70, 0x00f0, 0x2c34, 0x2001, 0x4009, 0x0078, 0x2c82, 0x2001,
- 0x0001, 0x0078, 0x2c82, 0x1078, 0x37cb, 0x00c0, 0x2c77, 0x6312,
- 0x6216, 0xa006, 0xa005, 0x0d7f, 0x0e7f, 0x007c, 0x81ff, 0x00c0,
- 0x2511, 0x1078, 0x2cbf, 0x0040, 0x2511, 0x6837, 0x0000, 0x7824,
- 0xa005, 0x0040, 0x2515, 0xa096, 0x00ff, 0x0040, 0x2c9b, 0xa092,
- 0x0004, 0x00c8, 0x2515, 0x2010, 0x2d18, 0x1078, 0x2251, 0x0040,
- 0x2511, 0x7007, 0x0003, 0x701b, 0x2ca6, 0x007c, 0x6830, 0xa086,
- 0x0100, 0x0040, 0x2511, 0x0078, 0x24e7, 0x7924, 0xa18c, 0xff00,
- 0x810f, 0xa182, 0x0080, 0x0048, 0x2515, 0xa182, 0x00ff, 0x00c8,
- 0x2515, 0x1078, 0x6a44, 0x1078, 0x37ee, 0x0078, 0x24e7, 0x1078,
- 0x1314, 0x0040, 0x2cd6, 0xa006, 0x6802, 0x7010, 0xa005, 0x00c0,
- 0x2cce, 0x2d00, 0x7012, 0x7016, 0x0078, 0x2cd4, 0x7014, 0x6802,
- 0x2060, 0x2d00, 0x6006, 0x7016, 0xad80, 0x000d, 0x007c, 0x7924,
- 0x810f, 0xa18c, 0x00ff, 0x1078, 0x3806, 0x00c0, 0x2ce6, 0x7e28,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x0048, 0x2ce7, 0xa066, 0x8cff,
- 0x007c, 0x7e24, 0x860f, 0xa18c, 0x00ff, 0x1078, 0x3806, 0x00c0,
- 0x2cf7, 0xa6b4, 0x00ff, 0xa682, 0x4000, 0x0048, 0x2cf8, 0xa066,
- 0x8cff, 0x007c, 0x017e, 0x7110, 0x81ff, 0x0040, 0x2d05, 0x2168,
- 0x6904, 0x1078, 0x1348, 0x0078, 0x2cfc, 0x7112, 0x7116, 0x017f,
- 0x007c, 0x2031, 0x0001, 0x0078, 0x2d0f, 0x2031, 0x0000, 0x2061,
- 0x77bd, 0x6606, 0x6112, 0x600e, 0x6226, 0x632a, 0x642e, 0x6532,
- 0x2c10, 0x1078, 0x137f, 0x7007, 0x0002, 0x701b, 0x24e7, 0x007c,
- 0x0f7e, 0x127e, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x777b,
- 0x2004, 0xa005, 0x00c0, 0x2d3b, 0x0068, 0x2d3b, 0x7818, 0xd084,
- 0x00c0, 0x2d3b, 0x781b, 0x0001, 0x7a22, 0x7b26, 0x7c2a, 0x2091,
- 0x4080, 0x0078, 0x2d60, 0x017e, 0x0c7e, 0x0e7e, 0x2071, 0x776d,
- 0x7138, 0xa182, 0x0008, 0x0048, 0x2d49, 0x7030, 0x2060, 0x0078,
- 0x2d5a, 0x7030, 0xa0e0, 0x0008, 0xac82, 0x77bd, 0x0048, 0x2d52,
- 0x2061, 0x777d, 0x2c00, 0x7032, 0x81ff, 0x00c0, 0x2d58, 0x7036,
- 0x8108, 0x713a, 0x2262, 0x6306, 0x640a, 0x0e7f, 0x0c7f, 0x017f,
- 0x127f, 0x0f7f, 0x007c, 0x0e7e, 0x2071, 0x776d, 0x7038, 0xa005,
- 0x0040, 0x2d9c, 0x127e, 0x2091, 0x8000, 0x0068, 0x2d9b, 0x0f7e,
- 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x2d9a, 0x0c7e, 0x781b,
- 0x0001, 0x7034, 0x2060, 0x2c04, 0x7822, 0x6004, 0x7826, 0x6008,
- 0x782a, 0x2091, 0x4080, 0x7038, 0x8001, 0x703a, 0xa005, 0x00c0,
- 0x2d90, 0x7033, 0x777d, 0x7037, 0x777d, 0x0c7f, 0x0078, 0x2d9a,
- 0xac80, 0x0008, 0xa0fa, 0x77bd, 0x0048, 0x2d98, 0x2001, 0x777d,
- 0x7036, 0x0c7f, 0x0f7f, 0x127f, 0x0e7f, 0x007c, 0x027e, 0x2001,
- 0x7752, 0x2004, 0xd0c4, 0x0040, 0x2da9, 0x2011, 0x8014, 0x1078,
- 0x2d20, 0x027f, 0x007c, 0x81ff, 0x00c0, 0x2511, 0x127e, 0x2091,
- 0x8000, 0x6030, 0xc08d, 0x6032, 0x1078, 0x3553, 0x127f, 0x0078,
- 0x24e7, 0x7824, 0x2008, 0xa18c, 0xfffd, 0x00c0, 0x2dc4, 0x61c8,
- 0xa10d, 0x61ca, 0x0078, 0x24e7, 0x0078, 0x2515, 0x81ff, 0x00c0,
- 0x2511, 0x6000, 0xa086, 0x0003, 0x00c0, 0x2511, 0x2001, 0x7752,
- 0x2004, 0xd0a4, 0x00c0, 0x2511, 0x1078, 0x2ce9, 0x0040, 0x2515,
- 0x6004, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x2de3, 0x7828,
- 0xa005, 0x0040, 0x24e7, 0x0c7e, 0x1078, 0x2cbf, 0x0c7f, 0x0040,
- 0x2511, 0x6837, 0x0000, 0x6833, 0x0000, 0x6838, 0xc0fd, 0x683a,
- 0x1078, 0x6bb1, 0x0040, 0x2511, 0x7007, 0x0003, 0x701b, 0x2df9,
- 0x007c, 0x6830, 0xa086, 0x0100, 0x0040, 0x2511, 0x0078, 0x24e7,
- 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x00c0, 0x2511, 0x7f24,
- 0x7a2c, 0x7b28, 0x7c3c, 0x7d38, 0x1078, 0x2cbf, 0x0040, 0x2511,
- 0x2009, 0x0000, 0x2031, 0x0000, 0x7023, 0x0000, 0x702f, 0x0000,
- 0xad80, 0x0005, 0x7026, 0x20a0, 0x1078, 0x3806, 0x00c0, 0x2e46,
- 0x6004, 0xa0c6, 0x0707, 0x0040, 0x2e46, 0xa084, 0x00ff, 0xa0c6,
- 0x0006, 0x00c0, 0x2e46, 0x87ff, 0x0040, 0x2e39, 0xac80, 0x0006,
- 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3, 0x1078, 0x2b8a, 0x0078,
- 0x2e42, 0xac80, 0x000a, 0x2098, 0x3400, 0x20a9, 0x0004, 0x53a3,
- 0x1078, 0x2b8a, 0x21a2, 0x94a0, 0xa6b0, 0x0005, 0x8108, 0xa186,
- 0x007e, 0x0040, 0x2e51, 0xa686, 0x0028, 0x0040, 0x2e5a, 0x0078,
- 0x2e1c, 0x86ff, 0x00c0, 0x2e58, 0x7120, 0x810b, 0x0078, 0x24e7,
- 0x702f, 0x0001, 0x711e, 0x7020, 0xa600, 0x7022, 0x772a, 0x2061,
- 0x77bd, 0x6007, 0x0000, 0x6612, 0x7024, 0x600e, 0x6226, 0x632a,
- 0x642e, 0x6532, 0x2c10, 0x1078, 0x137f, 0x7007, 0x0002, 0x701b,
- 0x2e72, 0x007c, 0x702c, 0xa005, 0x00c0, 0x2e84, 0x711c, 0x7024,
- 0x20a0, 0x7728, 0x2031, 0x0000, 0x2061, 0x77bd, 0x6224, 0x6328,
- 0x642c, 0x6530, 0x0078, 0x2e1c, 0x7120, 0x810b, 0x0078, 0x24e7,
- 0x127e, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071, 0x7700, 0x6044,
- 0xd0a4, 0x00c0, 0x2eb1, 0xd084, 0x0040, 0x2e9a, 0x1078, 0x2fd8,
- 0x0078, 0x2ead, 0xd08c, 0x0040, 0x2ea1, 0x1078, 0x2eef, 0x0078,
- 0x2ead, 0xd094, 0x0040, 0x2ea8, 0x1078, 0x2ed2, 0x0078, 0x2ead,
- 0xd09c, 0x0040, 0x2ead, 0x1078, 0x2ebb, 0x0e7f, 0x0c7f, 0x127f,
- 0x007c, 0x017e, 0x6128, 0xd19c, 0x00c0, 0x2eb8, 0xc19d, 0x612a,
- 0x017f, 0x0078, 0x2ead, 0x6043, 0x0040, 0x6043, 0x0000, 0x706f,
- 0x0000, 0x7087, 0x0001, 0x70a7, 0x0000, 0x2009, 0x7dc0, 0x200b,
- 0x0000, 0x7073, 0x000f, 0x2009, 0x000f, 0x2011, 0x3513, 0x1078,
- 0x46d3, 0x007c, 0x7070, 0xa005, 0x00c0, 0x2eee, 0x2011, 0x3513,
- 0x1078, 0x4643, 0x6043, 0x0020, 0x6043, 0x0000, 0x6044, 0xd08c,
- 0x00c0, 0x2eea, 0x7083, 0x0000, 0x6043, 0x0090, 0x6043, 0x0010,
- 0x0078, 0x2eee, 0x7077, 0x0000, 0x0078, 0x2eee, 0x007c, 0x7074,
- 0xa08a, 0x0003, 0x00c8, 0x2ef8, 0x1079, 0x2efb, 0x0078, 0x2efa,
- 0x1078, 0x12d5, 0x007c, 0x2efe, 0x2f4d, 0x2fd7, 0x0f7e, 0x7077,
- 0x0001, 0x20e1, 0xa000, 0x20e1, 0x8700, 0x1078, 0x1dbe, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x2079, 0x7c00, 0x207b, 0x2200, 0x7807,
- 0x00ef, 0x780b, 0x0000, 0x780f, 0x00ef, 0x7813, 0x0138, 0x7817,
- 0x0000, 0x781b, 0x0000, 0x781f, 0x0000, 0x7823, 0xffff, 0x7827,
- 0xffff, 0x782b, 0x0000, 0x782f, 0x0000, 0x2079, 0x7c0c, 0x207b,
- 0x1101, 0x7807, 0x0000, 0x2099, 0x7705, 0x20a1, 0x7c0e, 0x20a9,
- 0x0004, 0x53a3, 0x2079, 0x7c12, 0x207b, 0x0000, 0x7807, 0x0000,
- 0x2099, 0x7c00, 0x20a1, 0x020b, 0x20a9, 0x0014, 0x53a6, 0x60c3,
- 0x000c, 0x600f, 0x0000, 0x1078, 0x353a, 0x0f7f, 0x707b, 0x0000,
- 0x6043, 0x0008, 0x6043, 0x0000, 0x007c, 0x0d7e, 0x7078, 0x707b,
- 0x0000, 0xa025, 0x0040, 0x2fc1, 0x6020, 0xd0b4, 0x00c0, 0x2fbf,
- 0x7184, 0x81ff, 0x0040, 0x2fa8, 0xa486, 0x000c, 0x00c0, 0x2fb3,
- 0xa480, 0x0018, 0x8004, 0x20a8, 0x2011, 0x7c80, 0x2019, 0x7c00,
- 0x220c, 0x2304, 0xa106, 0x00c0, 0x2f7f, 0x8210, 0x8318, 0x00f0,
- 0x2f68, 0x6043, 0x0004, 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043,
- 0x0006, 0x7077, 0x0002, 0x7083, 0x0002, 0x0078, 0x2fbf, 0x2069,
- 0x7c80, 0x6930, 0xa18e, 0x1101, 0x00c0, 0x2fb3, 0x6834, 0xa005,
- 0x00c0, 0x2fb3, 0x6900, 0xa18c, 0x00ff, 0x00c0, 0x2f93, 0x6804,
- 0xa005, 0x0040, 0x2fa8, 0x2011, 0x7c8e, 0x2019, 0x7705, 0x20a9,
- 0x0004, 0x220c, 0x2304, 0xa102, 0x0048, 0x2fa6, 0x00c0, 0x2fb3,
- 0x8210, 0x8318, 0x00f0, 0x2f99, 0x0078, 0x2fb3, 0x7087, 0x0000,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b,
- 0x20a9, 0x0014, 0x53a6, 0x6043, 0x0008, 0x6043, 0x0000, 0x6020,
- 0xd0b4, 0x00c0, 0x2fbf, 0x60c3, 0x000c, 0x1078, 0x353a, 0x0d7f,
- 0x007c, 0x6020, 0xd0b4, 0x00c0, 0x2fbf, 0x60c3, 0x000c, 0x2011,
- 0x7940, 0x2013, 0x0000, 0x707b, 0x0000, 0x20e1, 0x9080, 0x60a3,
- 0x0056, 0x60a7, 0x9575, 0x1078, 0x564d, 0x0078, 0x2fbf, 0x007c,
- 0x7080, 0xa08a, 0x001d, 0x00c8, 0x2fe1, 0x1079, 0x2fe4, 0x0078,
- 0x2fe3, 0x1078, 0x12d5, 0x007c, 0x3008, 0x3017, 0x3048, 0x305d,
- 0x308d, 0x30b5, 0x30e5, 0x310f, 0x313f, 0x3165, 0x31b0, 0x31d2,
- 0x31f6, 0x320c, 0x3232, 0x3245, 0x324e, 0x3267, 0x3295, 0x32bd,
- 0x32eb, 0x3315, 0x335a, 0x338f, 0x33b1, 0x33ef, 0x3413, 0x342c,
- 0x3439, 0x7003, 0x0007, 0x6004, 0xa084, 0xfff9, 0x6006, 0x007c,
- 0x608b, 0xbc94, 0x608f, 0xf0f0, 0x6043, 0x0002, 0x7083, 0x0001,
- 0x2009, 0x07d0, 0x2011, 0x351a, 0x1078, 0x4636, 0x007c, 0x0f7e,
- 0x7078, 0xa086, 0x0014, 0x00c0, 0x3046, 0x6043, 0x0000, 0x6020,
- 0xd0b4, 0x00c0, 0x3046, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1102,
- 0x00c0, 0x3044, 0x7834, 0xa005, 0x00c0, 0x3044, 0x7a38, 0xd2fc,
- 0x0040, 0x303a, 0x70a4, 0xa005, 0x00c0, 0x303a, 0x1078, 0x35d3,
- 0x70a7, 0x0001, 0x2011, 0x351a, 0x1078, 0x4643, 0x7083, 0x0010,
- 0x1078, 0x324e, 0x0078, 0x3046, 0x707b, 0x0000, 0x0f7f, 0x007c,
- 0x7083, 0x0003, 0x6043, 0x0004, 0x1078, 0x35a4, 0x20a3, 0x1102,
- 0x20a3, 0x0000, 0x20a9, 0x000a, 0x20a3, 0x0000, 0x00f0, 0x3054,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x308b, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x3087, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1102, 0x00c0,
- 0x3087, 0x7834, 0xa005, 0x00c0, 0x3087, 0x7a38, 0xd2fc, 0x0040,
- 0x3081, 0x70a4, 0xa005, 0x00c0, 0x3081, 0x1078, 0x35d3, 0x70a7,
- 0x0001, 0x7083, 0x0004, 0x1078, 0x308d, 0x0078, 0x308b, 0x7083,
- 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0005, 0x1078,
- 0x35a4, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e,
- 0x706c, 0xa005, 0x00c0, 0x30a7, 0x714c, 0xa186, 0xffff, 0x0040,
- 0x30a7, 0x1078, 0x34de, 0x0040, 0x30a7, 0x1078, 0x35d3, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x30e3, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x30df, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1103, 0x00c0,
- 0x30df, 0x7834, 0xa005, 0x00c0, 0x30df, 0x7a38, 0xd2fc, 0x0040,
- 0x30d9, 0x70a4, 0xa005, 0x00c0, 0x30d9, 0x1078, 0x35d3, 0x70a7,
- 0x0001, 0x7083, 0x0006, 0x1078, 0x30e5, 0x0078, 0x30e3, 0x7083,
- 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0007, 0x1078,
- 0x35a4, 0x20a3, 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e,
- 0x706c, 0xa005, 0x00c0, 0x3101, 0x7150, 0xa186, 0xffff, 0x0040,
- 0x3101, 0xa180, 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x34de, 0x20a9, 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x313d, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0014, 0x00c0, 0x3139, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1104, 0x00c0, 0x3139, 0x7834, 0xa005, 0x00c0, 0x3139, 0x7a38,
- 0xd2fc, 0x0040, 0x3133, 0x70a4, 0xa005, 0x00c0, 0x3133, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x7083, 0x0008, 0x1078, 0x313f, 0x0078,
- 0x313d, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083,
- 0x0009, 0x1078, 0x35a4, 0x20a3, 0x1105, 0x20a3, 0x0100, 0x3430,
- 0x706c, 0xa005, 0x00c0, 0x3152, 0x1078, 0x3448, 0x0040, 0x3162,
- 0x0078, 0x315c, 0x20a9, 0x0008, 0x2099, 0x7c8e, 0x26a0, 0x53a6,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x353a,
- 0x0078, 0x3164, 0x1078, 0x3001, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x31ae, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x31aa, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1105, 0x00c0,
- 0x31aa, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x3193, 0x7a38,
- 0xd2fc, 0x0040, 0x318b, 0x70a4, 0xa005, 0x00c0, 0x318b, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x707f, 0x0001, 0x7083, 0x000a, 0x1078,
- 0x31b0, 0x0078, 0x31ae, 0xa005, 0x00c0, 0x31aa, 0x7a38, 0xd2fc,
- 0x0040, 0x31a2, 0x70a4, 0xa005, 0x00c0, 0x31a2, 0x1078, 0x35d3,
- 0x70a7, 0x0001, 0x707f, 0x0000, 0x7083, 0x000e, 0x1078, 0x3232,
- 0x0078, 0x31ae, 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c,
- 0x7083, 0x000b, 0x2011, 0x7c0e, 0x22a0, 0x20a9, 0x0040, 0x2019,
- 0xffff, 0x43a4, 0x20a9, 0x0002, 0x2009, 0x0000, 0x41a4, 0x1078,
- 0x35a4, 0x20a3, 0x1106, 0x20a3, 0x0000, 0x6030, 0xa085, 0x0100,
- 0x2012, 0x2298, 0x20a9, 0x0042, 0x53a6, 0x60c3, 0x0084, 0x1078,
- 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040, 0x31f4, 0x2011,
- 0x351a, 0x1078, 0x4643, 0xa086, 0x0084, 0x00c0, 0x31f0, 0x2079,
- 0x7c80, 0x7a30, 0xa296, 0x1106, 0x00c0, 0x31f0, 0x7834, 0xa005,
- 0x00c0, 0x31f0, 0x7083, 0x000c, 0x1078, 0x31f6, 0x0078, 0x31f4,
- 0x7083, 0x0002, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x000d,
- 0x1078, 0x35a4, 0x20a3, 0x1107, 0x20a3, 0x0000, 0x2099, 0x7c8e,
- 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0084, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005, 0x0040,
- 0x3230, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0084, 0x00c0,
- 0x322c, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1107, 0x00c0, 0x322c,
- 0x7834, 0xa005, 0x00c0, 0x322c, 0x1078, 0x3596, 0x7083, 0x000e,
- 0x1078, 0x3232, 0x0078, 0x3230, 0x7083, 0x0002, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x7083, 0x000f, 0x707b, 0x0000, 0x608b, 0xbc85,
- 0x608f, 0xb5b5, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0,
- 0x2011, 0x351a, 0x1078, 0x4636, 0x007c, 0x7078, 0xa005, 0x0040,
- 0x324d, 0x2011, 0x351a, 0x1078, 0x4643, 0x007c, 0x7083, 0x0011,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b,
- 0x7478, 0xa480, 0x0018, 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004,
- 0x20a8, 0x53a6, 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x3293, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0014, 0x00c0, 0x3291, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1103, 0x00c0, 0x3291, 0x7834, 0xa005, 0x00c0, 0x3291, 0x7a38,
- 0xd2fc, 0x0040, 0x328b, 0x70a4, 0xa005, 0x00c0, 0x328b, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x7083, 0x0012, 0x1078, 0x3295, 0x0078,
- 0x3293, 0x707b, 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0013, 0x1078,
- 0x35b0, 0x20a3, 0x1103, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e,
- 0x706c, 0xa005, 0x00c0, 0x32af, 0x714c, 0xa186, 0xffff, 0x0040,
- 0x32af, 0x1078, 0x34de, 0x0040, 0x32af, 0x1078, 0x35d3, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x32e9, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x32e7, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1104, 0x00c0,
- 0x32e7, 0x7834, 0xa005, 0x00c0, 0x32e7, 0x7a38, 0xd2fc, 0x0040,
- 0x32e1, 0x70a4, 0xa005, 0x00c0, 0x32e1, 0x1078, 0x35d3, 0x70a7,
- 0x0001, 0x7083, 0x0014, 0x1078, 0x32eb, 0x0078, 0x32e9, 0x707b,
- 0x0000, 0x0f7f, 0x007c, 0x7083, 0x0015, 0x1078, 0x35b0, 0x20a3,
- 0x1104, 0x20a3, 0x0000, 0x3430, 0x2011, 0x7c8e, 0x706c, 0xa006,
- 0x00c0, 0x3307, 0x7150, 0xa186, 0xffff, 0x0040, 0x3307, 0xa180,
- 0x2303, 0x200c, 0xa18c, 0xff00, 0x810f, 0x1078, 0x34de, 0x20a9,
- 0x0008, 0x2298, 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x0014, 0x1078, 0x353a, 0x007c, 0x0f7e, 0x7078, 0xa005,
- 0x0040, 0x3358, 0x2011, 0x351a, 0x1078, 0x4643, 0xa086, 0x0014,
- 0x00c0, 0x3356, 0x2079, 0x7c80, 0x7a30, 0xa296, 0x1105, 0x00c0,
- 0x3356, 0x7834, 0x2011, 0x0100, 0xa21e, 0x00c0, 0x333f, 0x7a38,
- 0xd2fc, 0x0040, 0x333b, 0x70a4, 0xa005, 0x00c0, 0x333b, 0x1078,
- 0x35d3, 0x70a7, 0x0001, 0x707f, 0x0001, 0x0078, 0x3350, 0xa005,
- 0x00c0, 0x3356, 0x7a38, 0xd2fc, 0x0040, 0x334e, 0x70a4, 0xa005,
- 0x00c0, 0x334e, 0x1078, 0x35d3, 0x70a7, 0x0001, 0x707f, 0x0000,
- 0x7083, 0x0016, 0x1078, 0x335a, 0x0078, 0x3358, 0x707b, 0x0000,
- 0x0f7f, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80,
- 0x20a1, 0x020b, 0x20a9, 0x000e, 0x53a6, 0x3430, 0x2011, 0x7c8e,
- 0x707c, 0xa005, 0x0040, 0x3370, 0x7083, 0x0017, 0x0078, 0x3372,
- 0x7083, 0x001b, 0x706c, 0xa005, 0x00c0, 0x337c, 0x1078, 0x3448,
- 0x0040, 0x338c, 0x0078, 0x3386, 0x20a9, 0x0008, 0x2099, 0x7c8e,
- 0x26a0, 0x53a6, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014,
- 0x1078, 0x353a, 0x0078, 0x338e, 0x1078, 0x3001, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x33af, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0084, 0x00c0, 0x33ad, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1106, 0x00c0, 0x33ad, 0x7834, 0xa005, 0x00c0, 0x33ad, 0x7083,
- 0x0018, 0x1078, 0x33b1, 0x0078, 0x33af, 0x707b, 0x0000, 0x0f7f,
- 0x007c, 0x7083, 0x0019, 0x1078, 0x35b0, 0x20a3, 0x1106, 0x20a3,
- 0x0000, 0x3430, 0x2099, 0x7c8e, 0x2039, 0x7c0e, 0x27a0, 0x20a9,
- 0x0040, 0x53a3, 0x2728, 0x2514, 0x8207, 0xa084, 0x00ff, 0x8000,
- 0x2018, 0xa294, 0x00ff, 0x8007, 0xa205, 0x202a, 0x6030, 0x2310,
- 0x8214, 0xa2a0, 0x7c0e, 0x2414, 0xa38c, 0x0001, 0x0040, 0x33dc,
- 0xa294, 0xff00, 0x0078, 0x33df, 0xa294, 0x00ff, 0x8007, 0xa215,
- 0x2222, 0x2798, 0x26a0, 0x20a9, 0x0040, 0x53a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0084, 0x1078, 0x353a, 0x007c, 0x0f7e,
- 0x7078, 0xa005, 0x0040, 0x3411, 0x2011, 0x351a, 0x1078, 0x4643,
- 0xa086, 0x0084, 0x00c0, 0x340f, 0x2079, 0x7c80, 0x7a30, 0xa296,
- 0x1107, 0x00c0, 0x340f, 0x7834, 0xa005, 0x00c0, 0x340f, 0x1078,
- 0x3596, 0x7083, 0x001a, 0x1078, 0x3413, 0x0078, 0x3411, 0x707b,
- 0x0000, 0x0f7f, 0x007c, 0x7083, 0x001b, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b, 0x7478, 0xa480, 0x0018,
- 0xa080, 0x0007, 0xa084, 0x03f8, 0x8004, 0x20a8, 0x53a6, 0x60c3,
- 0x0084, 0x1078, 0x353a, 0x007c, 0x7078, 0xa005, 0x0040, 0x3438,
- 0x2011, 0x351a, 0x1078, 0x4643, 0x7083, 0x001c, 0x1078, 0x3439,
- 0x007c, 0x707b, 0x0000, 0x608b, 0xbc85, 0x608f, 0xb5b5, 0x6043,
- 0x0001, 0x2009, 0x07d0, 0x2011, 0x351a, 0x1078, 0x4636, 0x007c,
- 0x087e, 0x097e, 0x2029, 0x7752, 0x252c, 0x20a9, 0x0008, 0x2041,
- 0x7c0e, 0x28a0, 0x2099, 0x7c8e, 0x53a3, 0x20a9, 0x0008, 0x2011,
- 0x0007, 0xd5d4, 0x0040, 0x345e, 0x2011, 0x0000, 0x2800, 0xa200,
- 0x200c, 0xa1a6, 0xffff, 0x00c0, 0x3470, 0xd5d4, 0x0040, 0x346b,
- 0x8210, 0x0078, 0x346c, 0x8211, 0x00f0, 0x345e, 0x0078, 0x34d5,
- 0x82ff, 0x00c0, 0x3482, 0xd5d4, 0x0040, 0x347c, 0xa1a6, 0x3fff,
- 0x0040, 0x3468, 0x0078, 0x3480, 0xa1a6, 0x3fff, 0x0040, 0x34d5,
- 0xa18d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0040,
- 0x348b, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0040, 0x3492, 0x8423,
- 0x0078, 0x3493, 0x8424, 0x00c8, 0x34a0, 0xd5d4, 0x0040, 0x349b,
- 0x8319, 0x0078, 0x349c, 0x8318, 0x00f0, 0x348c, 0x0078, 0x34d5,
- 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x00f0, 0x34a4, 0x2328,
- 0x8529, 0xa2be, 0x0007, 0x0040, 0x34b8, 0x007e, 0x2039, 0x0007,
- 0x2200, 0xa73a, 0x007f, 0x27a8, 0xa5a8, 0x0010, 0x00f0, 0x34b4,
- 0x754e, 0xa5c8, 0x2303, 0x292c, 0xa5ac, 0x00ff, 0x6532, 0x60e7,
- 0x0000, 0x65ea, 0x2018, 0x2304, 0xa405, 0x201a, 0x706f, 0x0001,
- 0x26a0, 0x2898, 0x20a9, 0x0008, 0x53a6, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0xa085, 0x0001, 0x0078, 0x34db, 0xa006, 0x0078, 0x34db,
- 0xa006, 0x1078, 0x12d5, 0x097f, 0x087f, 0x007c, 0x2118, 0x2021,
- 0x0000, 0x2001, 0x0007, 0xa39a, 0x0010, 0x0048, 0x34eb, 0x8420,
- 0x8001, 0x0078, 0x34e3, 0x2118, 0x84ff, 0x0040, 0x34f4, 0xa39a,
- 0x0010, 0x8421, 0x00c0, 0x34ef, 0x2021, 0x0001, 0x83ff, 0x0040,
- 0x34fd, 0x8423, 0x8319, 0x00c0, 0x34f9, 0xa238, 0x2704, 0xa42c,
- 0x00c0, 0x3512, 0xa405, 0x203a, 0x714e, 0xa1a0, 0x2303, 0x242c,
- 0xa5ac, 0x00ff, 0x6532, 0x60e7, 0x0000, 0x65ea, 0x706f, 0x0001,
- 0xa084, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7700, 0x7073, 0x0000,
- 0x0e7f, 0x007c, 0x0e7e, 0x0f7e, 0x2079, 0x0100, 0x2071, 0x0140,
- 0x1078, 0x5656, 0x7004, 0xa084, 0x4000, 0x0040, 0x352b, 0x7003,
- 0x1000, 0x7003, 0x0000, 0x127e, 0x2091, 0x8000, 0x2071, 0x7720,
- 0x2073, 0x0000, 0x7843, 0x0090, 0x7843, 0x0010, 0x127f, 0x0f7f,
- 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x2011, 0x7940, 0x2013,
- 0x0000, 0x707b, 0x0000, 0x127f, 0x20e1, 0x9080, 0x60a3, 0x0056,
- 0x60a7, 0x9575, 0x1078, 0x564d, 0x2009, 0x07d0, 0x2011, 0x351a,
- 0x1078, 0x46d3, 0x007c, 0x017e, 0x027e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x2009, 0x00f7, 0x1078, 0x35bc, 0x2061, 0x7949, 0x601b,
- 0x0000, 0x601f, 0x0000, 0x2061, 0x7700, 0x6003, 0x0001, 0x2061,
- 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x001e, 0x2011,
- 0x3578, 0x1078, 0x4636, 0x127f, 0x0c7f, 0x027f, 0x017f, 0x007c,
- 0x0e7e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x0100, 0x1078,
- 0x5656, 0x2071, 0x0140, 0x7004, 0xa084, 0x4000, 0x0040, 0x358c,
- 0x7003, 0x1000, 0x7003, 0x0000, 0x2001, 0x0001, 0x1078, 0x1fff,
- 0x1078, 0x3553, 0x127f, 0x007f, 0x0e7f, 0x007c, 0x20a9, 0x0040,
- 0x20a1, 0x7dc0, 0x2099, 0x7c8e, 0x3304, 0x8007, 0x20a2, 0x9398,
- 0x94a0, 0x00f0, 0x359c, 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x2099, 0x7c00, 0x20a1, 0x020b, 0x20a9, 0x000c, 0x53a6, 0x007c,
- 0x20e1, 0x9080, 0x20e1, 0x4000, 0x2099, 0x7c80, 0x20a1, 0x020b,
- 0x20a9, 0x000c, 0x53a6, 0x007c, 0x0c7e, 0x007e, 0x2061, 0x0100,
- 0x810f, 0x2001, 0x772c, 0x2004, 0xa005, 0x00c0, 0x35cd, 0x6030,
- 0xa084, 0x00ff, 0xa105, 0x0078, 0x35cf, 0xa185, 0x00f7, 0x604a,
- 0x007f, 0x0c7f, 0x007c, 0x017e, 0x047e, 0x2001, 0x7752, 0x2004,
- 0xd0a4, 0x0040, 0x35e6, 0xa006, 0x2020, 0x2009, 0x002a, 0x1078,
- 0x75f7, 0x2001, 0x770c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a,
- 0x1078, 0x226d, 0x047f, 0x017f, 0x007c, 0x157e, 0x20a9, 0x00ff,
- 0x2009, 0x7820, 0xa006, 0x200a, 0x8108, 0x00f0, 0x35f3, 0x157f,
- 0x007c, 0x0d7e, 0x037e, 0x157e, 0x137e, 0x147e, 0x2069, 0x7751,
- 0xa006, 0x6002, 0x6007, 0x0707, 0x600a, 0x600e, 0x6012, 0xa198,
- 0x2303, 0x231c, 0xa39c, 0x00ff, 0x6316, 0x20a9, 0x0004, 0xac98,
- 0x0006, 0x23a0, 0x40a4, 0x20a9, 0x0004, 0xac98, 0x000a, 0x23a0,
- 0x40a4, 0x603e, 0x6042, 0x604e, 0x6052, 0x6056, 0x605a, 0x605e,
- 0x6062, 0x6066, 0x606a, 0x606e, 0x6072, 0x6076, 0x607a, 0x607e,
- 0x6082, 0x6086, 0x608a, 0x608e, 0x6092, 0x6096, 0x609a, 0x609e,
- 0x61a2, 0x0d7e, 0x60a4, 0xa06d, 0x0040, 0x3638, 0x1078, 0x1348,
- 0x60a7, 0x0000, 0x60a8, 0xa06d, 0x0040, 0x3640, 0x1078, 0x1348,
- 0x60ab, 0x0000, 0x0d7f, 0xa006, 0x604a, 0x6810, 0x603a, 0x680c,
- 0x6046, 0x6814, 0xa084, 0x00ff, 0x6042, 0x147f, 0x137f, 0x157f,
- 0x037f, 0x0d7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x6944, 0x6e48,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8, 0x36f1, 0xa18c, 0xff00,
- 0x810f, 0xa182, 0x00ff, 0x00c8, 0x36f7, 0x2001, 0x770c, 0x2004,
- 0xa084, 0x0003, 0x00c0, 0x36da, 0xa188, 0x7820, 0x2104, 0xa065,
- 0x0040, 0x36d0, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006, 0x00c0,
- 0x36d6, 0x60a4, 0xa00d, 0x0040, 0x3681, 0x1078, 0x3a16, 0x0040,
- 0x36ca, 0x60a8, 0xa00d, 0x0040, 0x369b, 0x1078, 0x3a66, 0x00c0,
- 0x369b, 0x694c, 0xd1fc, 0x00c0, 0x3691, 0x1078, 0x378b, 0x0078,
- 0x36c5, 0x1078, 0x375c, 0x694c, 0xd1ec, 0x00c0, 0x36c5, 0x1078,
- 0x38eb, 0x0078, 0x36c5, 0x694c, 0xa184, 0xa000, 0x0040, 0x36b5,
- 0xd1ec, 0x0040, 0x36ae, 0xd1fc, 0x0040, 0x36aa, 0x1078, 0x38fc,
- 0x0078, 0x36b1, 0x1078, 0x38fc, 0x0078, 0x36b5, 0xd1fc, 0x0040,
- 0x36b5, 0x1078, 0x375c, 0x0078, 0x36c5, 0x6050, 0xa00d, 0x0040,
- 0x36c0, 0x2d00, 0x200a, 0x6803, 0x0000, 0x6052, 0x0078, 0x36c5,
- 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x1078, 0x491a, 0xa006,
- 0x127f, 0x007c, 0x2001, 0x0005, 0x2009, 0x0000, 0x0078, 0x36fb,
- 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x36fb, 0xa082, 0x0006,
- 0x0048, 0x3679, 0x2009, 0x770c, 0x210c, 0xd18c, 0x0040, 0x36e4,
- 0x2001, 0x0004, 0x0078, 0x36ed, 0xd184, 0x0040, 0x36eb, 0x2001,
- 0x0004, 0x0078, 0x36ed, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
- 0x36fb, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078, 0x36fb, 0x2001,
- 0x0029, 0x2009, 0x0000, 0xa005, 0x127f, 0x007c, 0x6944, 0x6e48,
- 0xa684, 0x3fff, 0xa082, 0x4000, 0x00c8, 0x3741, 0xa18c, 0xff00,
- 0x810f, 0xa182, 0x00ff, 0x00c8, 0x3731, 0xa188, 0x7820, 0x2104,
- 0xa065, 0x0040, 0x3731, 0x6004, 0xa084, 0x00ff, 0xa08e, 0x0006,
- 0x00c0, 0x3737, 0x684c, 0xd0ec, 0x0040, 0x3724, 0x1078, 0x38fc,
- 0x1078, 0x375c, 0x0078, 0x372c, 0x1078, 0x375c, 0x684c, 0xd0fc,
- 0x0040, 0x372c, 0x1078, 0x38eb, 0x1078, 0x3944, 0xa006, 0x0078,
- 0x3745, 0x2001, 0x0028, 0x2009, 0x0000, 0x0078, 0x3745, 0xa082,
- 0x0006, 0x0048, 0x371a, 0x2001, 0x0029, 0x2009, 0x0000, 0x0078,
- 0x3745, 0x2001, 0x0029, 0x2009, 0x0000, 0xa005, 0x007c, 0x127e,
- 0x2091, 0x8000, 0x6050, 0xa00d, 0x0040, 0x3755, 0x2d00, 0x200a,
- 0x6803, 0x0000, 0x6052, 0x127f, 0x007c, 0x2d00, 0x6052, 0x604e,
- 0x6803, 0x0000, 0x0078, 0x3753, 0x127e, 0x2091, 0x8000, 0x604c,
- 0xa005, 0x0040, 0x3768, 0x6802, 0x2d00, 0x604e, 0x127f, 0x007c,
- 0x2d00, 0x6052, 0x604e, 0x6803, 0x0000, 0x0078, 0x3766, 0x127e,
- 0x2091, 0x8000, 0x604c, 0xa06d, 0x0040, 0x377d, 0x6800, 0xa005,
- 0x00c0, 0x377b, 0x6052, 0x604e, 0xad05, 0x127f, 0x007c, 0x604c,
- 0xa06d, 0x0040, 0x378a, 0x6800, 0xa005, 0x00c0, 0x3788, 0x6052,
- 0x604e, 0xad05, 0x007c, 0x6803, 0x0000, 0x6084, 0xa00d, 0x0040,
- 0x3795, 0x2d00, 0x200a, 0x6086, 0x007c, 0x2d00, 0x6086, 0x6082,
- 0x0078, 0x3794, 0x127e, 0x0c7e, 0x027e, 0x2091, 0x8000, 0x6218,
- 0x2260, 0x6200, 0xa005, 0x0040, 0x37a8, 0xc285, 0x0078, 0x37a9,
- 0xc284, 0x6202, 0x027f, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e,
- 0x2091, 0x8000, 0x6218, 0x2260, 0x6204, 0xa294, 0xff00, 0xa215,
- 0x6206, 0x0c7f, 0x127f, 0x007c, 0x127e, 0x0c7e, 0x2091, 0x8000,
- 0x6218, 0x2260, 0x6204, 0xa294, 0x00ff, 0x8007, 0xa215, 0x6206,
- 0x0c7f, 0x127f, 0x007c, 0x027e, 0xa182, 0x00ff, 0x0048, 0x37d4,
- 0xa085, 0x0001, 0x0078, 0x37ec, 0xa190, 0x7820, 0x2204, 0xa065,
- 0x00c0, 0x37eb, 0x017e, 0x0d7e, 0x1078, 0x1314, 0x2d60, 0x0d7f,
- 0x017f, 0x0040, 0x37d0, 0x2c00, 0x2012, 0x60a7, 0x0000, 0x60ab,
- 0x0000, 0x1078, 0x35f9, 0xa006, 0x027f, 0x007c, 0x027e, 0xa182,
- 0x00ff, 0x0048, 0x37f7, 0xa085, 0x0001, 0x0078, 0x3804, 0x0d7e,
- 0xa190, 0x7820, 0x2204, 0xa06d, 0x0040, 0x3802, 0x2013, 0x0000,
- 0x1078, 0x1348, 0x0d7f, 0xa006, 0x027f, 0x007c, 0x017e, 0xa182,
- 0x00ff, 0x0048, 0x380f, 0xa085, 0x0001, 0x0078, 0x3816, 0xa188,
- 0x7820, 0x2104, 0xa065, 0x0040, 0x380b, 0xa006, 0x017f, 0x007c,
- 0x0d7e, 0x157e, 0x137e, 0x147e, 0x600b, 0x0000, 0x600f, 0x0000,
- 0x6000, 0xc08c, 0x6002, 0x2069, 0x7c8e, 0x6808, 0x605e, 0x6810,
- 0x6062, 0x6138, 0xa10a, 0x0048, 0x382e, 0x603a, 0x6814, 0x6066,
- 0x2099, 0x7c96, 0xac88, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x53a3,
- 0x2099, 0x7c9a, 0xac88, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x53a3,
- 0x2069, 0x7cae, 0x6808, 0x606a, 0x690c, 0x616e, 0x6810, 0x6072,
- 0x6818, 0x6076, 0xa182, 0x0211, 0x00c8, 0x3852, 0x2009, 0x0008,
- 0x0078, 0x387c, 0xa182, 0x0259, 0x00c8, 0x385a, 0x2009, 0x0007,
- 0x0078, 0x387c, 0xa182, 0x02c1, 0x00c8, 0x3862, 0x2009, 0x0006,
- 0x0078, 0x387c, 0xa182, 0x0349, 0x00c8, 0x386a, 0x2009, 0x0005,
- 0x0078, 0x387c, 0xa182, 0x0421, 0x00c8, 0x3872, 0x2009, 0x0004,
- 0x0078, 0x387c, 0xa182, 0x0581, 0x00c8, 0x387a, 0x2009, 0x0003,
- 0x0078, 0x387c, 0x2009, 0x0002, 0x6192, 0x147f, 0x137f, 0x157f,
- 0x0d7f, 0x007c, 0x0e7e, 0x2071, 0x7c8d, 0x2e04, 0x6896, 0x2071,
- 0x7c8e, 0x7004, 0x689a, 0x701c, 0x689e, 0x0e7f, 0x007c, 0x0d7e,
- 0x127e, 0x2091, 0x8000, 0x60a4, 0xa06d, 0x0040, 0x38b3, 0x6900,
- 0x81ff, 0x00c0, 0x38c7, 0x6a04, 0xa282, 0x0010, 0x00c8, 0x38cc,
- 0xad88, 0x0004, 0x20a9, 0x0010, 0x2104, 0xa086, 0xffff, 0x0040,
- 0x38ae, 0x8108, 0x00f0, 0x38a4, 0x1078, 0x12d5, 0x260a, 0x8210,
- 0x6a06, 0x0078, 0x38c7, 0x1078, 0x1314, 0x0040, 0x38cc, 0x2d00,
- 0x60a6, 0x6803, 0x0000, 0xad88, 0x0004, 0x20a9, 0x0010, 0x200b,
- 0xffff, 0x8108, 0x00f0, 0x38bf, 0x6807, 0x0001, 0x6e12, 0xa085,
- 0x0001, 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x38c9, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3a0f, 0x00c0, 0x38e9, 0x200b, 0xffff,
- 0x0d7e, 0x60a4, 0x2068, 0x6804, 0xa08a, 0x0002, 0x0048, 0x38e4,
- 0x8001, 0x6806, 0x0078, 0x38e8, 0x1078, 0x1348, 0x60a7, 0x0000,
- 0x0d7f, 0x127f, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a7b,
- 0x0078, 0x38f4, 0x1078, 0x3747, 0x1078, 0x3988, 0x00c0, 0x38f2,
- 0x1078, 0x3944, 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
- 0x60a8, 0xa06d, 0x0040, 0x3920, 0x6950, 0x81ff, 0x00c0, 0x3934,
- 0x6a54, 0xa282, 0x0010, 0x00c8, 0x3941, 0xad88, 0x0018, 0x20a9,
- 0x0010, 0x2104, 0xa086, 0xffff, 0x0040, 0x391b, 0x8108, 0x00f0,
- 0x3911, 0x1078, 0x12d5, 0x260a, 0x8210, 0x6a56, 0x0078, 0x3934,
- 0x1078, 0x1314, 0x0040, 0x3941, 0x2d00, 0x60aa, 0x6853, 0x0000,
- 0xad88, 0x0018, 0x20a9, 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0,
- 0x392c, 0x6857, 0x0001, 0x6e62, 0x0078, 0x3938, 0x1078, 0x378b,
- 0x1078, 0x394e, 0x00c0, 0x3936, 0xa085, 0x0001, 0x127f, 0x0d7f,
- 0x007c, 0xa006, 0x0078, 0x393e, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x491a, 0x127f, 0x007c, 0xa01e, 0x0078, 0x3950, 0x2019, 0x0001,
- 0xa00e, 0x127e, 0x2091, 0x8000, 0x604c, 0x2068, 0x6000, 0xd0dc,
- 0x00c0, 0x396e, 0x8dff, 0x0040, 0x3983, 0x83ff, 0x0040, 0x3966,
- 0x6848, 0xa606, 0x0040, 0x3973, 0x0078, 0x396e, 0x683c, 0xa406,
- 0x00c0, 0x396e, 0x6840, 0xa506, 0x0040, 0x3973, 0x2d08, 0x6800,
- 0x2068, 0x0078, 0x395a, 0x6a00, 0x604c, 0xad06, 0x00c0, 0x397b,
- 0x624e, 0x0078, 0x397e, 0xa180, 0x0000, 0x2202, 0x82ff, 0x00c0,
- 0x3983, 0x6152, 0x8dff, 0x127f, 0x007c, 0xa01e, 0x0078, 0x398a,
- 0x2019, 0x0001, 0xa00e, 0x6080, 0x2068, 0x8dff, 0x0040, 0x39b6,
- 0x83ff, 0x0040, 0x3999, 0x6848, 0xa606, 0x0040, 0x39a6, 0x0078,
- 0x39a1, 0x683c, 0xa406, 0x00c0, 0x39a1, 0x6840, 0xa506, 0x0040,
- 0x39a6, 0x2d08, 0x6800, 0x2068, 0x0078, 0x398d, 0x6a00, 0x6080,
- 0xad06, 0x00c0, 0x39ae, 0x6282, 0x0078, 0x39b1, 0xa180, 0x0000,
- 0x2202, 0x82ff, 0x00c0, 0x39b6, 0x6186, 0x8dff, 0x007c, 0x1078,
- 0x3a0f, 0x00c0, 0x39bd, 0x2011, 0x0001, 0x1078, 0x3a5f, 0x00c0,
- 0x39c3, 0xa295, 0x0002, 0x007c, 0x1078, 0x3a97, 0x0040, 0x39cc,
- 0x1078, 0x6ae1, 0x0078, 0x39ce, 0xa085, 0x0001, 0x007c, 0x1078,
- 0x3a97, 0x0040, 0x39d7, 0x1078, 0x6a70, 0x0078, 0x39d9, 0xa085,
- 0x0001, 0x007c, 0x1078, 0x3a97, 0x0040, 0x39e2, 0x1078, 0x6ab6,
- 0x0078, 0x39e4, 0xa085, 0x0001, 0x007c, 0x1078, 0x3a97, 0x0040,
- 0x39ed, 0x1078, 0x6a8c, 0x0078, 0x39ef, 0xa085, 0x0001, 0x007c,
- 0x127e, 0x007e, 0x0d7e, 0x2091, 0x8000, 0x6080, 0xa06d, 0x0040,
- 0x3a07, 0x6800, 0x007e, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000,
- 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x007f, 0x0078, 0x39f6, 0x6083,
- 0x0000, 0x6087, 0x0000, 0x0d7f, 0x007f, 0x127f, 0x007c, 0x60a4,
- 0xa00d, 0x00c0, 0x3a16, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x2170,
- 0x7000, 0xa005, 0x00c0, 0x3a29, 0x20a9, 0x0010, 0xae88, 0x0004,
- 0x2104, 0xa606, 0x0040, 0x3a29, 0x8108, 0x00f0, 0x3a20, 0xa085,
- 0x0001, 0x0e7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x60a4,
- 0xa06d, 0x00c0, 0x3a39, 0x1078, 0x1314, 0x0040, 0x3a4b, 0x2d00,
- 0x60a6, 0x6803, 0x0001, 0x6807, 0x0000, 0xad88, 0x0004, 0x20a9,
- 0x0010, 0x200b, 0xffff, 0x8108, 0x00f0, 0x3a41, 0xa085, 0x0001,
- 0x127f, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x3a48, 0x0d7e, 0x127e,
- 0x2091, 0x8000, 0x60a4, 0xa06d, 0x0040, 0x3a5c, 0x60a7, 0x0000,
- 0x1078, 0x1348, 0xa085, 0x0001, 0x127f, 0x0d7f, 0x007c, 0x60a8,
- 0xa00d, 0x00c0, 0x3a66, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x2170,
- 0x7050, 0xa005, 0x00c0, 0x3a79, 0x20a9, 0x0010, 0xae88, 0x0018,
- 0x2104, 0xa606, 0x0040, 0x3a79, 0x8108, 0x00f0, 0x3a70, 0xa085,
- 0x0001, 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x3a5f,
- 0x00c0, 0x3a95, 0x200b, 0xffff, 0x0d7e, 0x60a8, 0x2068, 0x6854,
- 0xa08a, 0x0002, 0x0048, 0x3a90, 0x8001, 0x6856, 0x0078, 0x3a94,
- 0x1078, 0x1348, 0x60ab, 0x0000, 0x0d7f, 0x127f, 0x007c, 0x609c,
- 0xd0a4, 0x007c, 0x0f7e, 0x2079, 0x7751, 0x7804, 0xd0a4, 0x0040,
- 0x3ac3, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x3806, 0x00c0, 0x3ab7, 0x6004, 0xa084, 0xff00, 0x8007,
- 0xa086, 0x0006, 0x00c0, 0x3ab7, 0x6000, 0xc0ed, 0x6002, 0x017f,
- 0x8108, 0x00f0, 0x3aa7, 0x0c7f, 0x157f, 0x2009, 0x07d0, 0x2011,
- 0x3ac5, 0x1078, 0x46d3, 0x0f7f, 0x007c, 0x2011, 0x3ac5, 0x1078,
- 0x4643, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x017e,
- 0x1078, 0x3806, 0x00c0, 0x3af1, 0x6000, 0xd0ec, 0x0040, 0x3af1,
- 0x047e, 0x62a0, 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x0029,
- 0x1078, 0x75f7, 0x6000, 0xc0e5, 0xc0ec, 0x6002, 0x2019, 0x0029,
- 0x1078, 0x4a38, 0x1078, 0x497b, 0x2009, 0x0000, 0x1078, 0x7431,
- 0x047f, 0x017f, 0x8108, 0x00f0, 0x3acf, 0x0c7f, 0x157f, 0x007c,
- 0x0c7e, 0x6018, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x0c7f, 0x007c,
- 0x2071, 0x77ff, 0x7003, 0x0001, 0x7007, 0x0000, 0x7013, 0x0000,
- 0x7017, 0x0000, 0x701b, 0x0000, 0x701f, 0x0000, 0x704b, 0x0001,
- 0x704f, 0x0000, 0x705b, 0x0020, 0x705f, 0x0040, 0x707f, 0x0000,
- 0x007c, 0x0e7e, 0x2071, 0x77ff, 0x684c, 0xa005, 0x00c0, 0x3b27,
- 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078, 0x3b4a, 0x6a60,
- 0x7236, 0x6b64, 0x733a, 0x6868, 0x703e, 0x7076, 0x686c, 0x7042,
- 0x707a, 0x684c, 0x702e, 0x6844, 0x7032, 0x2009, 0x000d, 0x200a,
- 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084, 0xffc0, 0xa210,
- 0x2100, 0xa319, 0x726e, 0x7372, 0x7028, 0xc084, 0x702a, 0x7007,
- 0x0001, 0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x6838, 0xd0fc, 0x00c0,
- 0x3b9d, 0x6804, 0xa00d, 0x0040, 0x3b6b, 0x0d7e, 0x0e7e, 0x2071,
- 0x7700, 0x027e, 0xa016, 0x702c, 0x2168, 0x6904, 0x206a, 0x8210,
- 0x2d00, 0x81ff, 0x00c0, 0x3b5c, 0x702e, 0x70a0, 0xa200, 0x70a2,
- 0x027f, 0x0e7f, 0x0d7f, 0x2071, 0x77ff, 0x701c, 0xa005, 0x00c0,
- 0x3bae, 0x0068, 0x3bac, 0x2071, 0x7751, 0x7004, 0xd09c, 0x0040,
- 0x3bac, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3bbf, 0x6948, 0x6844,
- 0xa105, 0x00c0, 0x3b9f, 0x2009, 0x8020, 0x2071, 0x0000, 0x7018,
- 0xd084, 0x00c0, 0x3bac, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a,
- 0x701b, 0x0001, 0x2091, 0x4080, 0x2071, 0x7700, 0x702c, 0x206a,
- 0x2d00, 0x702e, 0x70a0, 0x8000, 0x70a2, 0x0e7f, 0x007c, 0x6844,
- 0xa086, 0x0100, 0x00c0, 0x3bac, 0x6868, 0xa005, 0x00c0, 0x3bac,
- 0x2009, 0x8020, 0x0078, 0x3b85, 0x2071, 0x77ff, 0x2d08, 0x206b,
- 0x0000, 0x7010, 0x8000, 0x7012, 0x7018, 0xa06d, 0x711a, 0x0040,
- 0x3bbc, 0x6902, 0x0078, 0x3bbd, 0x711e, 0x0078, 0x3b9d, 0xa18c,
- 0x00ff, 0xa186, 0x0017, 0x0040, 0x3bcd, 0xa186, 0x001e, 0x0040,
- 0x3bcd, 0xa18e, 0x001f, 0x00c0, 0x3bac, 0x684c, 0xd0cc, 0x0040,
- 0x3bac, 0x6850, 0xa084, 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3bac,
- 0x2009, 0x8021, 0x0078, 0x3b85, 0x007e, 0x6837, 0x0103, 0x20a9,
- 0x001c, 0xad80, 0x0011, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x007f,
- 0x684a, 0x6952, 0x007c, 0x2071, 0x77ff, 0x7004, 0x0079, 0x3bf0,
- 0x3bf8, 0x3c07, 0x3c97, 0x3c98, 0x3ca8, 0x3cae, 0x3bf9, 0x3c85,
- 0x007c, 0x127e, 0x2091, 0x8000, 0x0068, 0x3c06, 0x2009, 0x000d,
- 0x7030, 0x200a, 0x2091, 0x4080, 0x7007, 0x0001, 0x127f, 0x701c,
- 0xa06d, 0x0040, 0x3c84, 0x0e7e, 0x2071, 0x7751, 0x7004, 0xd09c,
- 0x0040, 0x3c66, 0x6934, 0xa186, 0x0103, 0x00c0, 0x3c3c, 0x6948,
- 0x6844, 0xa105, 0x00c0, 0x3c59, 0x2009, 0x8020, 0x127e, 0x2091,
- 0x8000, 0x0068, 0x3c38, 0x2071, 0x0000, 0x7018, 0xd084, 0x00c0,
- 0x3c38, 0x7122, 0x683c, 0x7026, 0x6840, 0x702a, 0x701b, 0x0001,
- 0x2091, 0x4080, 0x127f, 0x0e7f, 0x1078, 0x3ce1, 0x0078, 0x3c84,
- 0x127f, 0x0e7f, 0x0078, 0x3c84, 0xa18c, 0x00ff, 0xa186, 0x0017,
- 0x0040, 0x3c4a, 0xa186, 0x001e, 0x0040, 0x3c4a, 0xa18e, 0x001f,
- 0x00c0, 0x3c66, 0x684c, 0xd0cc, 0x0040, 0x3c66, 0x6850, 0xa084,
- 0x00ff, 0xa086, 0x0001, 0x00c0, 0x3c66, 0x2009, 0x8021, 0x0078,
- 0x3c1e, 0x6844, 0xa086, 0x0100, 0x00c0, 0x3c66, 0x6868, 0xa005,
- 0x00c0, 0x3c66, 0x2009, 0x8020, 0x0078, 0x3c1e, 0x0e7f, 0x1078,
- 0x3cf5, 0x0040, 0x3c84, 0x700f, 0x0001, 0x6934, 0xa184, 0x00ff,
- 0xa086, 0x0003, 0x00c0, 0x3c7b, 0x810f, 0xa18c, 0x00ff, 0x8101,
- 0x0040, 0x3c7b, 0x710e, 0x7007, 0x0003, 0x1078, 0x3d15, 0x7050,
- 0xa086, 0x0100, 0x0040, 0x3c98, 0x007c, 0x701c, 0xa06d, 0x0040,
- 0x3c96, 0x1078, 0x3cf5, 0x0040, 0x3c96, 0x7007, 0x0003, 0x1078,
- 0x3d15, 0x7050, 0xa086, 0x0100, 0x0040, 0x3c98, 0x007c, 0x007c,
- 0x7050, 0xa09e, 0x0100, 0x00c0, 0x3ca1, 0x7007, 0x0004, 0x0078,
- 0x3ca8, 0xa086, 0x0200, 0x00c0, 0x3ca7, 0x7007, 0x0005, 0x007c,
- 0x1078, 0x3caf, 0x7006, 0x1078, 0x3ce1, 0x007c, 0x007c, 0x702c,
- 0x7130, 0x8108, 0xa102, 0x0048, 0x3cbc, 0xa00e, 0x7034, 0x706e,
- 0x7038, 0x7072, 0x0078, 0x3cc6, 0x706c, 0xa080, 0x0040, 0x706e,
- 0x00c8, 0x3cc6, 0x7070, 0xa081, 0x0000, 0x7072, 0x7132, 0x700c,
- 0x8001, 0x700e, 0x00c0, 0x3cda, 0x127e, 0x2091, 0x8000, 0x0068,
- 0x3cdd, 0x2001, 0x000d, 0x2102, 0x2091, 0x4080, 0x2001, 0x0001,
- 0x127f, 0x007c, 0x2001, 0x0007, 0x007c, 0x2001, 0x0006, 0x127f,
- 0x007c, 0x701c, 0xa06d, 0x0040, 0x3cf4, 0x127e, 0x2091, 0x8000,
- 0x7010, 0x8001, 0x7012, 0x2d04, 0x701e, 0xa005, 0x00c0, 0x3cf1,
- 0x701a, 0x127f, 0x1078, 0x1348, 0x007c, 0x2019, 0x000d, 0x2304,
- 0x230c, 0xa10e, 0x0040, 0x3d04, 0x2304, 0x230c, 0xa10e, 0x0040,
- 0x3d04, 0xa006, 0x0078, 0x3d14, 0x732c, 0x8319, 0x7130, 0xa102,
- 0x00c0, 0x3d0e, 0x2300, 0xa005, 0x0078, 0x3d14, 0x0048, 0x3d13,
- 0xa302, 0x0078, 0x3d14, 0x8002, 0x007c, 0x2d00, 0x7026, 0xa080,
- 0x000d, 0x7056, 0x7053, 0x0000, 0x127e, 0x2091, 0x8000, 0x2009,
- 0x7959, 0x2104, 0xc08d, 0x200a, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x2071, 0x77cd, 0x7003, 0x0000, 0x7007, 0x0000, 0x700f, 0x0000,
- 0x702b, 0x0001, 0x704f, 0x0000, 0x7053, 0x0001, 0x705f, 0x0020,
- 0x7063, 0x0040, 0x7083, 0x0000, 0x708b, 0x0000, 0x708f, 0x0001,
- 0x70bf, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x77cd, 0x6848, 0xa005,
- 0x00c0, 0x3d51, 0x7028, 0xc085, 0x702a, 0xa085, 0x0001, 0x0078,
- 0x3d76, 0x6a50, 0x7236, 0x6b54, 0x733a, 0x6858, 0x703e, 0x707a,
- 0x685c, 0x7042, 0x707e, 0x6848, 0x702e, 0x6840, 0x7032, 0x2009,
- 0x000c, 0x200a, 0x8007, 0x8006, 0x8006, 0xa08c, 0x003f, 0xa084,
- 0xffc0, 0xa210, 0x2100, 0xa319, 0x7272, 0x7376, 0x7028, 0xc084,
- 0x702a, 0x7007, 0x0001, 0x700f, 0x0000, 0xa006, 0x0e7f, 0x007c,
- 0x2b78, 0x2071, 0x77cd, 0x7004, 0x1079, 0x3dd6, 0x700c, 0x0079,
- 0x3d81, 0x3d86, 0x3d7b, 0x3d7b, 0x3d7b, 0x3d7b, 0x007c, 0x700c,
- 0x0079, 0x3d8a, 0x3d8f, 0x3dd4, 0x3dd4, 0x3dd5, 0x3dd5, 0x7830,
- 0x7930, 0xa106, 0x0040, 0x3d99, 0x7830, 0x7930, 0xa106, 0x00c0,
- 0x3dbf, 0x7030, 0xa10a, 0x0040, 0x3dbf, 0x00c8, 0x3da1, 0x712c,
- 0xa10a, 0xa18a, 0x0002, 0x00c8, 0x3dc0, 0x1078, 0x1314, 0x0040,
- 0x3dbf, 0x2d00, 0x705a, 0x7063, 0x0040, 0x2001, 0x0003, 0x7057,
- 0x0000, 0x127e, 0x007e, 0x2091, 0x8000, 0x2009, 0x7959, 0x2104,
- 0xc085, 0x200a, 0x007f, 0x700e, 0x127f, 0x1078, 0x1399, 0x007c,
- 0x1078, 0x1314, 0x0040, 0x3dbf, 0x2d00, 0x705a, 0x1078, 0x1314,
- 0x00c0, 0x3dcc, 0x0078, 0x3dab, 0x2d00, 0x7086, 0x7063, 0x0080,
- 0x2001, 0x0004, 0x0078, 0x3daf, 0x007c, 0x007c, 0x3de7, 0x3de8,
- 0x3e1f, 0x3e20, 0x3dd4, 0x3e56, 0x3e5b, 0x3e92, 0x3e93, 0x3eae,
- 0x3eaf, 0x3eb0, 0x3eb1, 0x3eb2, 0x3eb3, 0x3f1c, 0x3f46, 0x007c,
- 0x700c, 0x0079, 0x3deb, 0x3df0, 0x3df3, 0x3e03, 0x3e1e, 0x3e1e,
- 0x1078, 0x3d87, 0x007c, 0x127e, 0x8001, 0x700e, 0x7058, 0x007e,
- 0x1078, 0x4228, 0x0040, 0x3e00, 0x2091, 0x8000, 0x1078, 0x3d87,
- 0x0d7f, 0x0078, 0x3e0c, 0x127e, 0x8001, 0x700e, 0x1078, 0x4228,
- 0x7058, 0x2068, 0x7084, 0x705a, 0x6803, 0x0000, 0x6807, 0x0000,
- 0x6834, 0xa084, 0x00ff, 0xa08a, 0x0020, 0x00c8, 0x3e1b, 0x1079,
- 0x3e36, 0x127f, 0x007c, 0x127f, 0x1078, 0x3eb4, 0x007c, 0x007c,
- 0x007c, 0x0e7e, 0x2071, 0x77cd, 0x700c, 0x0079, 0x3e27, 0x3e2c,
- 0x3e2c, 0x3e2c, 0x3e2e, 0x3e32, 0x0e7f, 0x007c, 0x700f, 0x0001,
- 0x0078, 0x3e34, 0x700f, 0x0002, 0x0e7f, 0x007c, 0x3eb4, 0x3eb4,
- 0x3ed0, 0x3eb4, 0x3fbb, 0x3eb4, 0x3eb4, 0x3eb4, 0x3eb4, 0x3eb4,
- 0x3ed0, 0x3ffa, 0x4044, 0x409d, 0x40b1, 0x3eb4, 0x3eb4, 0x3eec,
- 0x3ed0, 0x3eb4, 0x3eb4, 0x3f02, 0x413c, 0x415a, 0x3eb4, 0x3eec,
- 0x3eb4, 0x3eb4, 0x3eb4, 0x3eb4, 0x3f02, 0x415a, 0x7020, 0x2068,
- 0x1078, 0x1348, 0x007c, 0x700c, 0x0079, 0x3e5e, 0x3e63, 0x3e66,
- 0x3e76, 0x3e91, 0x3e91, 0x1078, 0x3d87, 0x007c, 0x127e, 0x8001,
- 0x700e, 0x7058, 0x007e, 0x1078, 0x4228, 0x0040, 0x3e73, 0x2091,
- 0x8000, 0x1078, 0x3d87, 0x0d7f, 0x0078, 0x3e7f, 0x127e, 0x8001,
- 0x700e, 0x1078, 0x4228, 0x7058, 0x2068, 0x7084, 0x705a, 0x6803,
- 0x0000, 0x6807, 0x0000, 0x6834, 0xa084, 0x00ff, 0xa08a, 0x001a,
- 0x00c8, 0x3e8e, 0x1079, 0x3e94, 0x127f, 0x007c, 0x127f, 0x1078,
- 0x3eb4, 0x007c, 0x007c, 0x007c, 0x3eb4, 0x3ed0, 0x3fa5, 0x3eb4,
- 0x3ed0, 0x3eb4, 0x3ed0, 0x3ed0, 0x3eb4, 0x3ed0, 0x3fa5, 0x3ed0,
- 0x3ed0, 0x3ed0, 0x3ed0, 0x3ed0, 0x3eb4, 0x3ed0, 0x3fa5, 0x3eb4,
- 0x3eb4, 0x3ed0, 0x3eb4, 0x3eb4, 0x3eb4, 0x3ed0, 0x007c, 0x007c,
- 0x007c, 0x007c, 0x007c, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084,
- 0x00ff, 0xc0d5, 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3b4c,
- 0x127f, 0x007c, 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0e5,
- 0x683a, 0x127e, 0x2091, 0x8000, 0x1078, 0x3b4c, 0x127f, 0x007c,
- 0x7007, 0x0001, 0x6838, 0xa084, 0x00ff, 0xc0ed, 0x683a, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x3b4c, 0x127f, 0x007c, 0x7007, 0x0001,
- 0x6838, 0xa084, 0x00ff, 0xc0dd, 0x683a, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x3b4c, 0x127f, 0x007c, 0x6834, 0x8007, 0xa084, 0x00ff,
- 0x0040, 0x3ec2, 0x8001, 0x00c0, 0x3ef9, 0x7007, 0x0001, 0x0078,
- 0x3f82, 0x7007, 0x0006, 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b,
- 0x3f82, 0x007c, 0x2d00, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa080,
- 0x0024, 0x2098, 0x20a1, 0x77f8, 0x53a3, 0x6858, 0x7012, 0xa082,
- 0x0401, 0x00c8, 0x3ede, 0x6884, 0xa08a, 0x0003, 0x00c8, 0x3ede,
- 0xa080, 0x3f73, 0x2004, 0x70c6, 0x7010, 0xa015, 0x0040, 0x3f66,
- 0x1078, 0x1314, 0x00c0, 0x3f27, 0x7007, 0x000f, 0x007c, 0x2d00,
- 0x7022, 0x70c4, 0x2060, 0x6000, 0x6836, 0x6004, 0xad00, 0x7096,
- 0x6008, 0xa20a, 0x00c8, 0x3f36, 0xa00e, 0x2200, 0x7112, 0x620c,
- 0x8003, 0x800b, 0xa296, 0x0004, 0x0040, 0x3f3f, 0xa108, 0x719a,
- 0x810b, 0x719e, 0xae90, 0x0022, 0x1078, 0x137f, 0x7090, 0xa08e,
- 0x0100, 0x0040, 0x3f5a, 0xa086, 0x0200, 0x0040, 0x3f52, 0x7007,
- 0x0010, 0x007c, 0x7020, 0x2068, 0x1078, 0x1348, 0x7014, 0x2068,
- 0x0078, 0x3ede, 0x7020, 0x2068, 0x7018, 0x6802, 0x6807, 0x0000,
- 0x2d08, 0x2068, 0x6906, 0x711a, 0x0078, 0x3f1c, 0x7014, 0x2068,
- 0x7007, 0x0001, 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x0040,
- 0x4177, 0x0078, 0x3f82, 0x3f76, 0x3f7a, 0x3f7e, 0x0002, 0x0011,
- 0x0007, 0x0004, 0x000a, 0x000f, 0x0005, 0x0006, 0x0012, 0x000f,
- 0x0005, 0x0006, 0x2009, 0x772c, 0x210c, 0x81ff, 0x00c0, 0x3f9f,
- 0x6838, 0xa084, 0x00ff, 0x683a, 0x6853, 0x0000, 0x1078, 0x3653,
- 0x00c0, 0x3f93, 0x007c, 0x1078, 0x3bdc, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x127f, 0x0078, 0x3f92, 0x2001,
- 0x0028, 0x2009, 0x0000, 0x0078, 0x3f93, 0x7018, 0x6802, 0x2d08,
- 0x2068, 0x6906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0040, 0x3fb4,
- 0x7007, 0x0006, 0x0078, 0x3fba, 0x7014, 0x2068, 0x7007, 0x0001,
- 0x7048, 0x107a, 0x007c, 0x7007, 0x0001, 0x6944, 0x810f, 0xa18c,
- 0x00ff, 0x6848, 0xa084, 0x00ff, 0x20a9, 0x0001, 0xa096, 0x0001,
- 0x0040, 0x3fe4, 0x2009, 0x0000, 0x20a9, 0x007e, 0xa096, 0x0002,
- 0x0040, 0x3fe4, 0xa005, 0x00c0, 0x3ff7, 0x6944, 0x810f, 0xa18c,
- 0x00ff, 0x1078, 0x3806, 0x00c0, 0x3ff7, 0x067e, 0x6e50, 0x1078,
- 0x38cf, 0x067f, 0x0078, 0x3ff7, 0x047e, 0x2011, 0x770c, 0x2224,
- 0xc484, 0xc48c, 0x2412, 0x047f, 0x0c7e, 0x1078, 0x3806, 0x00c0,
- 0x3ff3, 0x1078, 0x3a4e, 0x8108, 0x00f0, 0x3fed, 0x0c7f, 0x1078,
- 0x1348, 0x007c, 0x127e, 0x2091, 0x8000, 0x7007, 0x0001, 0x2001,
- 0x7752, 0x2004, 0xd0a4, 0x0040, 0x403b, 0x2009, 0x0000, 0x1078,
- 0x4244, 0x6100, 0xd184, 0x0040, 0x4020, 0x6858, 0xa084, 0x00ff,
- 0x00c0, 0x403e, 0x6000, 0xd084, 0x0040, 0x403b, 0x6004, 0xa005,
- 0x00c0, 0x4041, 0x6003, 0x0000, 0x600b, 0x0000, 0x0078, 0x4038,
- 0x2011, 0x0001, 0x6860, 0xa005, 0x00c0, 0x4028, 0x2001, 0x001e,
- 0x8000, 0x6016, 0x6858, 0xa084, 0x00ff, 0x0040, 0x403b, 0x6006,
- 0x6858, 0x8007, 0xa084, 0x00ff, 0x0040, 0x403b, 0x600a, 0x6202,
- 0x127f, 0x0078, 0x4217, 0x127f, 0x0078, 0x420f, 0x127f, 0x0078,
- 0x4207, 0x127f, 0x0078, 0x420b, 0x127e, 0x2091, 0x8000, 0x7007,
- 0x0001, 0x2001, 0x7752, 0x2004, 0xd0a4, 0x0040, 0x409a, 0x2009,
- 0x0000, 0x1078, 0x4244, 0x6000, 0xa084, 0x0001, 0x0040, 0x409a,
- 0x6204, 0x6308, 0x6c48, 0xa484, 0x0003, 0x0040, 0x4072, 0x6958,
- 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x406b, 0x2100, 0xa210, 0x0048,
- 0x4097, 0x0078, 0x4072, 0x8001, 0x00c0, 0x4097, 0x2100, 0xa212,
- 0x0048, 0x4097, 0xa484, 0x000c, 0x0040, 0x408c, 0x6958, 0x810f,
- 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0, 0x4084, 0x2100, 0xa318,
- 0x0048, 0x4097, 0x0078, 0x408c, 0xa082, 0x0004, 0x00c0, 0x4097,
- 0x2100, 0xa31a, 0x0048, 0x4097, 0x6860, 0xa005, 0x0040, 0x4092,
- 0x8000, 0x6016, 0x6206, 0x630a, 0x127f, 0x0078, 0x4217, 0x127f,
- 0x0078, 0x4213, 0x127f, 0x0078, 0x420f, 0x127e, 0x2091, 0x8000,
- 0x7007, 0x0001, 0x2009, 0x0000, 0x1078, 0x4244, 0x6308, 0x8318,
- 0x0048, 0x40ae, 0x630a, 0x127f, 0x0078, 0x4225, 0x127f, 0x0078,
- 0x4213, 0x127e, 0x0c7e, 0x2091, 0x8000, 0x7007, 0x0001, 0x684c,
- 0xd0ac, 0x0040, 0x40c7, 0x2009, 0x0000, 0x0c7e, 0x1078, 0x46e1,
- 0x6000, 0x2001, 0xfcff, 0x6002, 0x0c7f, 0x0078, 0x40fe, 0x6858,
- 0xa005, 0x0040, 0x4113, 0x685c, 0xa065, 0x0040, 0x410f, 0x2001,
- 0x772c, 0x2004, 0xa005, 0x0040, 0x40d9, 0x1078, 0x6b6c, 0x0078,
- 0x40df, 0x6013, 0x0400, 0x2009, 0x0041, 0x1078, 0x5cfb, 0x6958,
- 0xa18c, 0xe600, 0xa186, 0x2000, 0x0040, 0x40f6, 0xa186, 0x0400,
- 0x0040, 0x40f6, 0x2009, 0x0000, 0x0c7e, 0x1078, 0x46e1, 0x6000,
- 0xa084, 0xfdff, 0x6002, 0x0c7f, 0x0078, 0x40fe, 0x027e, 0x2009,
- 0x0000, 0x2011, 0xfdff, 0x1078, 0x478a, 0x027f, 0x684c, 0xd0c4,
- 0x0040, 0x410b, 0x2009, 0x0000, 0x1078, 0x46e1, 0x6008, 0x8000,
- 0x0048, 0x410b, 0x600a, 0x0c7f, 0x127f, 0x0078, 0x4217, 0x0c7f,
- 0x127f, 0x0078, 0x420f, 0x6954, 0xa186, 0x002a, 0x00c0, 0x411f,
- 0x2001, 0x770c, 0x200c, 0xc194, 0x2102, 0x0078, 0x40fe, 0xa186,
- 0x0020, 0x0040, 0x4134, 0xa186, 0x0029, 0x00c0, 0x410f, 0x6944,
- 0xa18c, 0xff00, 0x810f, 0x1078, 0x3806, 0x00c0, 0x40fe, 0x6000,
- 0xc0e4, 0x6002, 0x0078, 0x40fe, 0x685c, 0xa065, 0x0040, 0x410f,
- 0x6017, 0x0014, 0x0078, 0x40fe, 0x2009, 0x0000, 0x1078, 0x4244,
- 0x6000, 0xa084, 0x0001, 0x0040, 0x4156, 0x2091, 0x8000, 0x6204,
- 0x8210, 0x0048, 0x4150, 0x6206, 0x2091, 0x8001, 0x0078, 0x4225,
- 0x2091, 0x8001, 0x6853, 0x0016, 0x0078, 0x421e, 0x6853, 0x0007,
- 0x0078, 0x421e, 0x6834, 0x8007, 0xa084, 0x00ff, 0x00c0, 0x4164,
- 0x1078, 0x3ec2, 0x0078, 0x4176, 0x2030, 0x8001, 0x00c0, 0x416e,
- 0x7007, 0x0001, 0x1078, 0x4177, 0x0078, 0x4176, 0x7007, 0x0006,
- 0x7012, 0x2d00, 0x7016, 0x701a, 0x704b, 0x4177, 0x007c, 0x0e7e,
- 0x2009, 0x772c, 0x210c, 0x81ff, 0x00c0, 0x41f9, 0x2009, 0x770c,
- 0x210c, 0xd194, 0x00c0, 0x4203, 0x6848, 0x2070, 0xae82, 0x7e00,
- 0x0048, 0x41e8, 0x2001, 0x7715, 0x2004, 0xae02, 0x00c8, 0x41e8,
- 0x2009, 0x0000, 0x1078, 0x4244, 0x6100, 0xa184, 0x0001, 0x0040,
- 0x41ce, 0xa184, 0x0100, 0x00c0, 0x41ec, 0xa184, 0x0200, 0x00c0,
- 0x41f0, 0x601c, 0xa005, 0x00c0, 0x41f4, 0x711c, 0xa186, 0x0006,
- 0x00c0, 0x41d3, 0x6853, 0x0000, 0x6803, 0x0000, 0x2d08, 0x127e,
- 0x2091, 0x8000, 0x7010, 0xa005, 0x00c0, 0x41c5, 0x7112, 0x7018,
- 0xa065, 0x0040, 0x41f8, 0x6000, 0xd0e4, 0x00c0, 0x41fd, 0x2e60,
- 0x1078, 0x46ea, 0x127f, 0x0e7f, 0x007c, 0x2068, 0x6800, 0xa005,
- 0x00c0, 0x41c5, 0x6902, 0x127f, 0x0e7f, 0x007c, 0x0e7f, 0x6853,
- 0x0006, 0x0078, 0x421e, 0x6944, 0xa18c, 0xff00, 0x810f, 0x1078,
- 0x3806, 0x00c0, 0x41fe, 0x6000, 0xd0e4, 0x00c0, 0x41fe, 0x711c,
- 0xa186, 0x0007, 0x00c0, 0x41e8, 0x6853, 0x0002, 0x0078, 0x4200,
- 0x6853, 0x0008, 0x0078, 0x4200, 0x6853, 0x000e, 0x0078, 0x4200,
- 0x6853, 0x0017, 0x0078, 0x4200, 0x6853, 0x0035, 0x0078, 0x4200,
- 0x127f, 0x6853, 0x0028, 0x0078, 0x4200, 0x127f, 0x6853, 0x0029,
- 0x0e7f, 0x0078, 0x421e, 0x6853, 0x002a, 0x0078, 0x4200, 0x2009,
- 0x003e, 0x0078, 0x4219, 0x2009, 0x0004, 0x0078, 0x4219, 0x2009,
- 0x0006, 0x0078, 0x4219, 0x2009, 0x0016, 0x0078, 0x4219, 0x2009,
- 0x0001, 0x6854, 0xa084, 0xff00, 0xa105, 0x6856, 0x2091, 0x8000,
- 0x1078, 0x3b4c, 0x2091, 0x8001, 0x007c, 0x1078, 0x1348, 0x007c,
- 0x702c, 0x7130, 0x8108, 0xa102, 0x0048, 0x4235, 0xa00e, 0x7034,
- 0x7072, 0x7038, 0x7076, 0x0078, 0x4241, 0x7070, 0xa080, 0x0040,
- 0x7072, 0x00c8, 0x4241, 0x7074, 0xa081, 0x0000, 0x7076, 0xa085,
- 0x0001, 0x7932, 0x7132, 0x007c, 0x0d7e, 0x1078, 0x46e1, 0x0d7f,
- 0x007c, 0x0d7e, 0x2011, 0x0004, 0x2204, 0xa085, 0x8002, 0x2012,
- 0x0d7f, 0x007c, 0x20e1, 0x0002, 0x3d08, 0x20e1, 0x2000, 0x3d00,
- 0xa084, 0x7000, 0x0040, 0x4260, 0xa086, 0x1000, 0x00c0, 0x427c,
- 0x20e1, 0x0004, 0x3d60, 0xd1bc, 0x00c0, 0x4267, 0x3e60, 0xac84,
- 0x0007, 0x00c0, 0x427c, 0xac82, 0x7e00, 0x0048, 0x427c, 0x6854,
- 0xac02, 0x00c8, 0x427c, 0x2009, 0x0047, 0x1078, 0x5cfb, 0x7a1c,
- 0xd284, 0x00c0, 0x4252, 0x007c, 0xa016, 0x1078, 0x1572, 0x0078,
- 0x4277, 0x157e, 0x137e, 0x147e, 0x20e1, 0x3000, 0x3d20, 0x3e28,
- 0xa584, 0x0070, 0x00c0, 0x42aa, 0xa484, 0x7000, 0xa086, 0x1000,
- 0x00c0, 0x42aa, 0x1078, 0x42b7, 0x0040, 0x42aa, 0x20e1, 0x3000,
- 0x7828, 0x7828, 0x1078, 0x42d5, 0x147f, 0x137f, 0x157f, 0x2009,
- 0x793e, 0x2104, 0xa005, 0x00c0, 0x42a6, 0x007c, 0x1078, 0x4d50,
- 0x0078, 0x42a5, 0x1078, 0x762a, 0x1078, 0x42b7, 0x20e1, 0x3000,
- 0x7828, 0x7828, 0x147f, 0x137f, 0x157f, 0x0078, 0x42a5, 0xa484,
- 0x01ff, 0x687a, 0xa005, 0x0040, 0x42c9, 0xa080, 0x001f, 0xa084,
- 0x03f8, 0x80ac, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a, 0x53a5,
- 0x007c, 0x20a9, 0x000c, 0x20e1, 0x1000, 0x2ea0, 0x2099, 0x020a,
- 0x53a5, 0xa085, 0x0001, 0x0078, 0x42c8, 0x7000, 0xa084, 0xff00,
- 0xa08c, 0xf000, 0x8007, 0xa196, 0x0000, 0x00c0, 0x42e2, 0x0078,
- 0x4456, 0x007c, 0xa196, 0x2000, 0x00c0, 0x42f3, 0x6900, 0xa18e,
- 0x0001, 0x00c0, 0x42ef, 0x1078, 0x2e88, 0x0078, 0x42e1, 0x1078,
- 0x42fb, 0x0078, 0x42e1, 0xa196, 0x8000, 0x00c0, 0x42e1, 0x1078,
- 0x44dc, 0x0078, 0x42e1, 0x0c7e, 0x7110, 0xa18c, 0xff00, 0x810f,
- 0xa196, 0x0001, 0x0040, 0x4308, 0xa196, 0x0023, 0x00c0, 0x43fd,
- 0xa08e, 0x0023, 0x00c0, 0x4339, 0x1078, 0x4553, 0x0040, 0x43fd,
- 0x7124, 0x610a, 0x7030, 0xa08e, 0x0200, 0x00c0, 0x4321, 0x7034,
- 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0015, 0x1078, 0x5cfb, 0x0078,
- 0x43fd, 0xa08e, 0x0210, 0x00c0, 0x432b, 0x2009, 0x0015, 0x1078,
- 0x5cfb, 0x0078, 0x43fd, 0xa08e, 0x0100, 0x00c0, 0x43fd, 0x7034,
- 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0016, 0x1078, 0x5cfb, 0x0078,
- 0x43fd, 0xa08e, 0x0022, 0x00c0, 0x43fd, 0x7030, 0xa08e, 0x0300,
- 0x00c0, 0x434a, 0x7034, 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0017,
- 0x0078, 0x43c9, 0xa08e, 0x0500, 0x00c0, 0x4356, 0x7034, 0xa005,
- 0x00c0, 0x43fd, 0x2009, 0x0018, 0x0078, 0x43c9, 0xa08e, 0x2010,
- 0x00c0, 0x435e, 0x2009, 0x0019, 0x0078, 0x43c9, 0xa08e, 0x2110,
- 0x00c0, 0x4366, 0x2009, 0x001a, 0x0078, 0x43c9, 0xa08e, 0x5200,
- 0x00c0, 0x4372, 0x7034, 0xa005, 0x00c0, 0x43fd, 0x2009, 0x001b,
- 0x0078, 0x43c9, 0xa08e, 0x5000, 0x00c0, 0x437e, 0x7034, 0xa005,
- 0x00c0, 0x43fd, 0x2009, 0x001c, 0x0078, 0x43c9, 0xa08e, 0x1200,
- 0x00c0, 0x438a, 0x7034, 0xa005, 0x00c0, 0x43fd, 0x2009, 0x0024,
- 0x0078, 0x43c9, 0xa08c, 0xff00, 0xa18e, 0x2400, 0x00c0, 0x4394,
- 0x2009, 0x002d, 0x0078, 0x43c9, 0xa08c, 0xff00, 0xa18e, 0x5300,
- 0x00c0, 0x439e, 0x2009, 0x002a, 0x0078, 0x43c9, 0xa08e, 0x0f00,
- 0x00c0, 0x43a6, 0x2009, 0x0020, 0x0078, 0x43c9, 0xa08e, 0x5300,
- 0x00c0, 0x43ac, 0x0078, 0x43c7, 0xa08e, 0x6104, 0x00c0, 0x43c7,
- 0x2011, 0x7c8d, 0x8208, 0x2204, 0xa082, 0x0004, 0x20a8, 0x95ac,
- 0x95ac, 0x2011, 0x8015, 0x211c, 0x8108, 0x2124, 0x1078, 0x2d20,
- 0x8108, 0x00f0, 0x43b9, 0x2009, 0x0023, 0x0078, 0x43c9, 0x2009,
- 0x001d, 0x017e, 0x2011, 0x7c83, 0x2204, 0x8211, 0x220c, 0x1078,
- 0x2059, 0x00c0, 0x43ff, 0x1078, 0x37cb, 0x00c0, 0x43ff, 0x6612,
- 0x6516, 0x86ff, 0x0040, 0x43ef, 0x017f, 0x017e, 0xa186, 0x0017,
- 0x00c0, 0x43ef, 0x6864, 0xa606, 0x00c0, 0x43ef, 0x6868, 0xa506,
- 0xa084, 0xff00, 0x00c0, 0x43ef, 0x6000, 0xc0f5, 0x6002, 0x0c7e,
- 0x1078, 0x5c6e, 0x0040, 0x4402, 0x017f, 0x611a, 0x601f, 0x0004,
- 0x7120, 0x610a, 0x017f, 0x1078, 0x5cfb, 0x0c7f, 0x007c, 0x017f,
- 0x0078, 0x43fd, 0x0c7f, 0x0078, 0x43ff, 0x0e7e, 0x0d7e, 0x2028,
- 0x2130, 0xa696, 0x00ff, 0x00c0, 0x4425, 0xa596, 0xfffd, 0x00c0,
- 0x4415, 0x2009, 0x007f, 0x0078, 0x4452, 0xa596, 0xfffe, 0x00c0,
- 0x441d, 0x2009, 0x007e, 0x0078, 0x4452, 0xa596, 0xfffc, 0x00c0,
- 0x4425, 0x2009, 0x0080, 0x0078, 0x4452, 0x2011, 0x0000, 0x2021,
- 0x007e, 0x20a9, 0x0082, 0x2071, 0x789e, 0x2e1c, 0x83ff, 0x00c0,
- 0x4437, 0x82ff, 0x00c0, 0x4446, 0x2410, 0x0078, 0x4446, 0x2368,
- 0x6b10, 0x007e, 0x2100, 0xa31e, 0x007f, 0x00c0, 0x4446, 0x6b14,
- 0xa31e, 0x00c0, 0x4446, 0x2408, 0x0078, 0x4452, 0x8420, 0x8e70,
- 0x00f0, 0x442d, 0x82ff, 0x00c0, 0x4451, 0xa085, 0x0001, 0x0078,
- 0x4453, 0x2208, 0xa006, 0x0d7f, 0x0e7f, 0x007c, 0xa084, 0x0007,
- 0x0079, 0x445b, 0x007c, 0x4463, 0x4463, 0x4463, 0x4463, 0x4463,
- 0x4464, 0x447d, 0x44c5, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x447c,
- 0x7120, 0x2160, 0xac8c, 0x0007, 0x00c0, 0x447c, 0xac8a, 0x7e00,
- 0x0048, 0x447c, 0x6854, 0xac02, 0x00c8, 0x447c, 0x7124, 0x610a,
- 0x2009, 0x0046, 0x1078, 0x5cfb, 0x007c, 0x0c7e, 0x7110, 0xd1bc,
- 0x00c0, 0x44c3, 0x2011, 0x7c83, 0x2204, 0x8211, 0x220c, 0x1078,
- 0x2059, 0x00c0, 0x44c3, 0x1078, 0x3806, 0x00c0, 0x44c3, 0x6204,
- 0xa294, 0xff00, 0x8217, 0xa286, 0x0006, 0x00c0, 0x44a8, 0x0c7e,
- 0x1078, 0x5c6e, 0x017f, 0x0040, 0x44c3, 0x611a, 0x601f, 0x0006,
- 0x7120, 0x610a, 0x2009, 0x0044, 0x1078, 0x5cfb, 0x0078, 0x44c3,
- 0x0c7e, 0x1078, 0x5c6e, 0x017f, 0x0040, 0x44c3, 0x611a, 0x601f,
- 0x0004, 0x7120, 0x610a, 0xa286, 0x0004, 0x00c0, 0x44bb, 0x6007,
- 0x0005, 0x0078, 0x44bd, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078,
- 0x4948, 0x1078, 0x4d50, 0x0c7f, 0x007c, 0x7110, 0xd1bc, 0x0040,
- 0x44db, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0, 0x44db, 0xac82,
- 0x7e00, 0x0048, 0x44db, 0x6854, 0xac02, 0x00c8, 0x44db, 0x2009,
- 0x0045, 0x1078, 0x5cfb, 0x007c, 0x7110, 0xa18c, 0xff00, 0x810f,
- 0xa18e, 0x0000, 0x00c0, 0x44ec, 0xa084, 0x000f, 0xa08a, 0x0006,
- 0x10c8, 0x12d5, 0x1079, 0x44ed, 0x007c, 0x44f3, 0x44f4, 0x44f3,
- 0x44f3, 0x4535, 0x4544, 0x007c, 0x7110, 0xd1bc, 0x00c0, 0x4534,
- 0x700c, 0x7108, 0x1078, 0x2059, 0x00c0, 0x4534, 0x1078, 0x37cb,
- 0x00c0, 0x4534, 0x6612, 0x6516, 0x6204, 0xa294, 0xff00, 0x8217,
- 0xa286, 0x0006, 0x00c0, 0x451d, 0x0c7e, 0x1078, 0x5c6e, 0x017f,
- 0x0040, 0x4534, 0x611a, 0x601f, 0x0005, 0x7120, 0x610a, 0x2009,
- 0x0088, 0x1078, 0x5cfb, 0x0078, 0x4534, 0x0c7e, 0x1078, 0x5c6e,
- 0x017f, 0x0040, 0x4534, 0x611a, 0x601f, 0x0004, 0x7120, 0x610a,
- 0xa286, 0x0004, 0x00c0, 0x4530, 0x2009, 0x0005, 0x0078, 0x4532,
- 0x2009, 0x0001, 0x1078, 0x5cfb, 0x007c, 0x7110, 0xd1bc, 0x0040,
- 0x4543, 0x1078, 0x4553, 0x0040, 0x4543, 0x7124, 0x610a, 0x2009,
- 0x0089, 0x1078, 0x5cfb, 0x007c, 0x7110, 0xd1bc, 0x0040, 0x4552,
- 0x1078, 0x4553, 0x0040, 0x4552, 0x7124, 0x610a, 0x2009, 0x008a,
- 0x1078, 0x5cfb, 0x007c, 0x7020, 0x2060, 0xac84, 0x0007, 0x00c0,
- 0x4566, 0xac82, 0x7e00, 0x0048, 0x4566, 0x2001, 0x7715, 0x2004,
- 0xac02, 0x00c8, 0x4566, 0xa085, 0x0001, 0x007c, 0xa006, 0x0078,
- 0x4565, 0x2071, 0x7949, 0x7003, 0x0003, 0x700f, 0x0361, 0xa006,
- 0x701a, 0x7012, 0x7017, 0x7e00, 0x7007, 0x0000, 0x7026, 0x702b,
- 0x5663, 0x7032, 0x7037, 0x56a4, 0x703b, 0x0002, 0x703f, 0x0000,
- 0x007c, 0x2071, 0x7949, 0x00e0, 0x4630, 0x2091, 0x6000, 0x700c,
- 0x8001, 0x700e, 0x00c0, 0x45f9, 0x700f, 0x0361, 0x7007, 0x0001,
- 0x127e, 0x2091, 0x8000, 0x7138, 0x8109, 0x713a, 0x00c0, 0x45f7,
- 0x703b, 0x0002, 0x2009, 0x0100, 0x2104, 0xa082, 0x0003, 0x00c8,
- 0x45f7, 0x703c, 0xa086, 0x0001, 0x00c0, 0x45d4, 0x0d7e, 0x2069,
- 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x45b2, 0x6803, 0x1000,
- 0x0078, 0x45b9, 0x6804, 0xa084, 0x1000, 0x0040, 0x45b9, 0x6803,
- 0x0100, 0x6803, 0x0000, 0x703f, 0x0000, 0x2069, 0x7936, 0x6804,
- 0xa082, 0x0006, 0x00c0, 0x45c6, 0x6807, 0x0000, 0x6830, 0xa082,
- 0x0003, 0x00c0, 0x45cd, 0x6833, 0x0000, 0x1078, 0x4d50, 0x1078,
- 0x4e10, 0x0d7f, 0x0078, 0x45f7, 0x0d7e, 0x2069, 0x7700, 0x6944,
- 0x6860, 0xa102, 0x00c8, 0x45f6, 0x2069, 0x7936, 0x6804, 0xa086,
- 0x0000, 0x00c0, 0x45f6, 0x6830, 0xa086, 0x0000, 0x00c0, 0x45f6,
- 0x703f, 0x0001, 0x6807, 0x0006, 0x6833, 0x0003, 0x2069, 0x0100,
- 0x6830, 0x689e, 0x2069, 0x0140, 0x6803, 0x0600, 0x0d7f, 0x0078,
- 0x45fc, 0x127e, 0x2091, 0x8000, 0x7024, 0xa00d, 0x0040, 0x460d,
- 0x7020, 0x8001, 0x7022, 0x00c0, 0x460d, 0x7023, 0x0009, 0x8109,
- 0x7126, 0x00c0, 0x460d, 0x7028, 0x107a, 0x7030, 0xa00d, 0x0040,
- 0x461e, 0x702c, 0x8001, 0x702e, 0x00c0, 0x461e, 0x702f, 0x0009,
- 0x8109, 0x7132, 0x00c0, 0x461e, 0x7034, 0x107a, 0x7018, 0xa00d,
- 0x0040, 0x462f, 0x7008, 0x8001, 0x700a, 0x00c0, 0x462f, 0x700b,
- 0x0009, 0x8109, 0x711a, 0x00c0, 0x462f, 0x701c, 0x107a, 0x127f,
- 0x7004, 0x0079, 0x4633, 0x465a, 0x465b, 0x4677, 0x0e7e, 0x2071,
- 0x7949, 0x7018, 0xa005, 0x00c0, 0x4641, 0x711a, 0x721e, 0x700b,
- 0x0009, 0x0e7f, 0x007c, 0x0e7e, 0x007e, 0x2071, 0x7949, 0x701c,
- 0xa206, 0x00c0, 0x464d, 0x701a, 0x701e, 0x007f, 0x0e7f, 0x007c,
- 0x0e7e, 0x2071, 0x7949, 0x6088, 0xa102, 0x0048, 0x4658, 0x618a,
- 0x0e7f, 0x007c, 0x007c, 0x7110, 0x1078, 0x3806, 0x00c0, 0x466d,
- 0x6088, 0x8001, 0x0048, 0x466d, 0x608a, 0x00c0, 0x466d, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x8108, 0xa182, 0x00ff,
- 0x0048, 0x4675, 0xa00e, 0x7007, 0x0002, 0x7112, 0x007c, 0x7014,
- 0x2060, 0x127e, 0x2091, 0x8000, 0x6014, 0xa005, 0x0040, 0x46a6,
- 0x8001, 0x6016, 0x00c0, 0x46a6, 0x611c, 0xa186, 0x0003, 0x0040,
- 0x468d, 0xa186, 0x0006, 0x00c0, 0x46a4, 0x6010, 0x2068, 0x6854,
- 0xa08a, 0x199a, 0x0048, 0x46a4, 0xa082, 0x1999, 0x6856, 0xa08a,
- 0x199a, 0x0048, 0x469d, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b,
- 0xa108, 0x6116, 0x0078, 0x46a6, 0x1078, 0x688e, 0x127f, 0xac88,
- 0x0008, 0x7116, 0x2001, 0x7716, 0x2004, 0xa102, 0x0048, 0x46b4,
- 0x7017, 0x7e00, 0x7007, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7949,
- 0x7027, 0x07d0, 0x7023, 0x0009, 0x703b, 0x0002, 0x0e7f, 0x007c,
- 0x2001, 0x7952, 0x2003, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7949,
- 0x7033, 0x07d0, 0x702f, 0x0009, 0x0e7f, 0x007c, 0x2011, 0x7955,
- 0x2013, 0x0000, 0x007c, 0x0e7e, 0x2071, 0x7949, 0x711a, 0x721e,
- 0x700b, 0x0009, 0x0e7f, 0x007c, 0x0c7e, 0x2061, 0x79da, 0x0c7f,
- 0x007c, 0xa184, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x79da,
- 0x2060, 0x007c, 0x6854, 0xa08a, 0x199a, 0x0048, 0x46f1, 0x2001,
- 0x1999, 0xa005, 0x00c0, 0x4701, 0x6944, 0x0c7e, 0x1078, 0x46e1,
- 0x6014, 0x0c7f, 0xa005, 0x00c0, 0x4706, 0x2001, 0x001e, 0x0078,
- 0x4706, 0xa08e, 0xffff, 0x00c0, 0x4706, 0xa006, 0x8003, 0x800b,
- 0x810b, 0xa108, 0x6116, 0x684c, 0xa08c, 0x00c0, 0xa18e, 0x00c0,
- 0x0040, 0x4741, 0xd0b4, 0x00c0, 0x471d, 0xd0bc, 0x00c0, 0x472f,
- 0x2009, 0x0006, 0x1078, 0x4764, 0x007c, 0xd0fc, 0x0040, 0x472a,
- 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x475d, 0xa08e, 0x0000,
- 0x00c0, 0x475d, 0x2009, 0x0043, 0x1078, 0x5cfb, 0x007c, 0xd0fc,
- 0x0040, 0x473c, 0xa084, 0x0003, 0xa08e, 0x0003, 0x0040, 0x475d,
- 0xa08e, 0x0000, 0x00c0, 0x475d, 0x2009, 0x0042, 0x1078, 0x5cfb,
- 0x007c, 0xd0fc, 0x0040, 0x4753, 0xa084, 0x0003, 0xa08e, 0x0003,
- 0x0040, 0x475d, 0xa08e, 0x0002, 0x0040, 0x4757, 0x2009, 0x0041,
- 0x1078, 0x5cfb, 0x007c, 0x1078, 0x4762, 0x0078, 0x4752, 0x2009,
- 0x0043, 0x1078, 0x5cfb, 0x0078, 0x4752, 0x2009, 0x0004, 0x1078,
- 0x4764, 0x007c, 0x2009, 0x0001, 0x6010, 0xa0ec, 0xf000, 0x0040,
- 0x4789, 0x2068, 0x6952, 0x6800, 0x6012, 0xa186, 0x0001, 0x00c0,
- 0x4783, 0x694c, 0xa18c, 0x8100, 0xa18e, 0x8100, 0x00c0, 0x4783,
- 0x0c7e, 0x2009, 0x0000, 0x1078, 0x46e1, 0x6204, 0x8210, 0x0048,
- 0x4782, 0x6206, 0x0c7f, 0x1078, 0x3b4c, 0x6010, 0xa06d, 0x10c0,
- 0x46ea, 0x007c, 0x157e, 0x0c7e, 0x20a9, 0x0010, 0x2061, 0x79da,
- 0x6000, 0x81ff, 0x0040, 0x4797, 0xa205, 0x0078, 0x4798, 0xa204,
- 0x6002, 0xace0, 0x0008, 0x00f0, 0x4790, 0x0c7f, 0x157f, 0x007c,
- 0x6808, 0xa005, 0x0040, 0x47a8, 0x8001, 0x680a, 0xa085, 0x0001,
- 0x007c, 0x127e, 0x2091, 0x2200, 0x2079, 0x7936, 0x127f, 0x0d7e,
- 0x2069, 0x7936, 0x6803, 0x0005, 0x2069, 0x0004, 0x2d04, 0xa085,
- 0x8001, 0x206a, 0x0d7f, 0x007c, 0x0c7e, 0x6027, 0x0001, 0x7804,
- 0xa084, 0x0007, 0x0079, 0x47c4, 0x47ce, 0x47f3, 0x484e, 0x47d4,
- 0x47f3, 0x47cc, 0x47cc, 0x47cc, 0x1078, 0x12d5, 0x1078, 0x46c0,
- 0x1078, 0x4d50, 0x0c7f, 0x007c, 0x62c0, 0x82ff, 0x00c0, 0x47da,
- 0x0c7f, 0x007c, 0x2011, 0x351a, 0x1078, 0x4643, 0x7828, 0xa092,
- 0x0002, 0x00c8, 0x47e9, 0x8000, 0x782a, 0x1078, 0x354a, 0x0078,
- 0x47d8, 0x1078, 0x351a, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b,
- 0x0000, 0x0078, 0x47d8, 0x1078, 0x46c0, 0x3c00, 0x007e, 0x2011,
- 0x0209, 0x20e1, 0x4000, 0x2214, 0x007f, 0x20e0, 0x82ff, 0x0040,
- 0x4811, 0x62c0, 0x82ff, 0x00c0, 0x4811, 0x782b, 0x0000, 0x7824,
- 0xa065, 0x1040, 0x12d5, 0x2009, 0x0013, 0x1078, 0x5cfb, 0x0c7f,
- 0x007c, 0x3900, 0xa082, 0x7a7a, 0x00c8, 0x4818, 0x1078, 0x5bfe,
- 0x0c7e, 0x7824, 0xa065, 0x1040, 0x12d5, 0x7804, 0xa086, 0x0004,
- 0x0040, 0x4893, 0x7828, 0xa092, 0x2710, 0x00c8, 0x482e, 0x8000,
- 0x782a, 0x0c7f, 0x1078, 0x5648, 0x0078, 0x480f, 0x6104, 0xa186,
- 0x0003, 0x00c0, 0x4845, 0x0e7e, 0x2071, 0x7700, 0x70c8, 0x0e7f,
- 0xd08c, 0x0040, 0x4845, 0x0c7e, 0x0e7e, 0x2061, 0x0100, 0x2071,
- 0x7700, 0x1078, 0x3553, 0x0e7f, 0x0c7f, 0x1078, 0x767d, 0x2009,
- 0x0014, 0x1078, 0x5cfb, 0x0c7f, 0x0078, 0x480f, 0x2001, 0x7952,
- 0x2003, 0x0000, 0x62c0, 0x82ff, 0x00c0, 0x4862, 0x782b, 0x0000,
- 0x7824, 0xa065, 0x1040, 0x12d5, 0x2009, 0x0013, 0x1078, 0x5d49,
- 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x3900, 0xa082, 0x7a7a, 0x00c8,
- 0x486b, 0x1078, 0x5bfe, 0x7824, 0xa005, 0x1040, 0x12d5, 0x781c,
- 0xa06d, 0x1040, 0x12d5, 0x6800, 0xc0dc, 0x6802, 0x7924, 0x2160,
- 0x1078, 0x5cd4, 0x693c, 0x81ff, 0x1040, 0x12d5, 0x8109, 0x693e,
- 0x6854, 0xa015, 0x0040, 0x4887, 0x7a1e, 0x0078, 0x4889, 0x7918,
- 0x791e, 0x7807, 0x0000, 0x7827, 0x0000, 0x0d7f, 0x0c7f, 0x1078,
- 0x4d50, 0x0078, 0x4860, 0x6104, 0xa186, 0x0002, 0x0040, 0x489e,
- 0xa186, 0x0004, 0x0040, 0x489e, 0x0078, 0x4822, 0x7808, 0xac06,
- 0x0040, 0x4822, 0x1078, 0x4c57, 0x1078, 0x4948, 0x0c7f, 0x1078,
- 0x4d50, 0x0078, 0x480f, 0x0c7e, 0x6027, 0x0002, 0x2011, 0x7955,
- 0x2013, 0x0000, 0x62c8, 0x82ff, 0x00c0, 0x48c5, 0x62c4, 0x82ff,
- 0x00c0, 0x48c5, 0x793c, 0xa1e5, 0x0000, 0x0040, 0x48c3, 0x2009,
- 0x0049, 0x1078, 0x5cfb, 0x0c7f, 0x007c, 0x3908, 0xa192, 0x7a7a,
- 0x00c8, 0x48cc, 0x1078, 0x5bfe, 0x6017, 0x0010, 0x793c, 0x81ff,
- 0x0040, 0x48c3, 0x7944, 0xa192, 0x7530, 0x00c8, 0x48eb, 0x8108,
- 0x7946, 0x1078, 0x46c5, 0x793c, 0xa188, 0x0007, 0x210c, 0xa18e,
- 0x0006, 0x00c0, 0x48e7, 0x6017, 0x0012, 0x0078, 0x48c3, 0x6017,
- 0x0016, 0x0078, 0x48c3, 0x037e, 0x2019, 0x0001, 0x1078, 0x583a,
- 0x037f, 0x1078, 0x767d, 0x793c, 0x2160, 0x2009, 0x004a, 0x1078,
- 0x5cfb, 0x0078, 0x48c3, 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091,
- 0x8000, 0x600f, 0x0000, 0x2c08, 0x2061, 0x7936, 0x6020, 0x8000,
- 0x6022, 0x6010, 0xa005, 0x0040, 0x4916, 0xa080, 0x0003, 0x2102,
- 0x6112, 0x127f, 0x0c7f, 0x017f, 0x007f, 0x007c, 0x6116, 0x6112,
- 0x0078, 0x4911, 0x0d7e, 0x2069, 0x7936, 0x6000, 0xd0d4, 0x0040,
- 0x492f, 0x6820, 0x8000, 0x6822, 0xa086, 0x0001, 0x00c0, 0x492a,
- 0x2c00, 0x681e, 0x6804, 0xa084, 0x0007, 0x0079, 0x4d58, 0xc0d5,
- 0x6002, 0x6818, 0xa005, 0x0040, 0x4941, 0x6056, 0x605b, 0x0000,
- 0x007e, 0x2c00, 0x681a, 0x0d7f, 0x685a, 0x2069, 0x7936, 0x0078,
- 0x4921, 0x6056, 0x605a, 0x2c00, 0x681a, 0x681e, 0x0078, 0x4921,
- 0x007e, 0x017e, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x600f, 0x0000,
- 0x2c08, 0x2061, 0x7936, 0x6020, 0x8000, 0x6022, 0x6008, 0xa005,
- 0x0040, 0x4963, 0xa080, 0x0003, 0x2102, 0x610a, 0x127f, 0x0c7f,
- 0x017f, 0x007f, 0x007c, 0x610e, 0x610a, 0x0078, 0x495e, 0x0c7e,
- 0x600f, 0x0000, 0x2c08, 0x2061, 0x7936, 0x6034, 0xa005, 0x0040,
- 0x4977, 0xa080, 0x0003, 0x2102, 0x6136, 0x0c7f, 0x007c, 0x613a,
- 0x6136, 0x0078, 0x4975, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e,
- 0x027e, 0x007e, 0x127e, 0x2071, 0x7936, 0x7638, 0x2660, 0x2678,
- 0x2091, 0x8000, 0x8cff, 0x0040, 0x49dd, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x49d8, 0x703c, 0xac06, 0x00c0, 0x499d,
- 0x6003, 0x000a, 0x630a, 0x0078, 0x49d8, 0x7038, 0xac36, 0x00c0,
- 0x49a3, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x49b1, 0x2c00,
- 0xaf36, 0x0040, 0x49af, 0x2f00, 0x7036, 0x0078, 0x49b1, 0x7037,
- 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x49ba, 0x7e0e,
- 0x0078, 0x49bb, 0x2678, 0x600f, 0x0000, 0x1078, 0x6a03, 0x0040,
- 0x49d3, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x49e6,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6c0a, 0x1078,
- 0x3b4c, 0x1078, 0x6b5f, 0x1078, 0x6b6c, 0x0c7f, 0x0078, 0x498a,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x498a, 0x127f, 0x007f, 0x027f,
- 0x067f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x49c8, 0x1078, 0x75b3, 0x0078, 0x49d3, 0x007e,
- 0x067e, 0x0c7e, 0x0d7e, 0x0f7e, 0x2031, 0x0000, 0x127e, 0x2091,
- 0x8000, 0x2079, 0x7936, 0x7838, 0xa065, 0x0040, 0x4a26, 0x600c,
- 0x007e, 0x600f, 0x0000, 0x783c, 0xac06, 0x00c0, 0x4a0d, 0x6003,
- 0x000a, 0x630a, 0x2c30, 0x0078, 0x4a23, 0x1078, 0x6a03, 0x0040,
- 0x4a21, 0x6010, 0x2068, 0x601c, 0xa086, 0x0003, 0x00c0, 0x4a2f,
- 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3b4c, 0x1078,
- 0x6b5f, 0x1078, 0x6b6c, 0x007f, 0x0078, 0x49fc, 0x7e3a, 0x7e36,
- 0x127f, 0x0f7f, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x601c,
- 0xa086, 0x0006, 0x00c0, 0x4a18, 0x1078, 0x75b3, 0x0078, 0x4a21,
- 0x027e, 0x1078, 0x4a4c, 0x1078, 0x4ae5, 0x027f, 0x007c, 0x0f7e,
- 0x127e, 0x2079, 0x7936, 0x2091, 0x8000, 0x1078, 0x4b7c, 0x1078,
- 0x4be4, 0x127f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7936, 0x7614,
- 0x2660, 0x2678, 0x8cff, 0x0040, 0x4ad4, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x4acf, 0x7024, 0xac06, 0x00c0, 0x4a92,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4a8d, 0x1078, 0x5656,
- 0x68c3, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4a82, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4a8a,
- 0x6827, 0x0001, 0x037f, 0x0078, 0x4a92, 0x6003, 0x0009, 0x630a,
- 0x0078, 0x4acf, 0x7014, 0xac36, 0x00c0, 0x4a98, 0x660c, 0x7616,
- 0x7010, 0xac36, 0x00c0, 0x4aa6, 0x2c00, 0xaf36, 0x0040, 0x4aa4,
- 0x2f00, 0x7012, 0x0078, 0x4aa6, 0x7013, 0x0000, 0x660c, 0x067e,
- 0x2c00, 0xaf06, 0x0040, 0x4aaf, 0x7e0e, 0x0078, 0x4ab0, 0x2678,
- 0x600f, 0x0000, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x4ac8,
- 0x601c, 0xa086, 0x0003, 0x00c0, 0x4adc, 0x6837, 0x0103, 0x6b4a,
- 0x6847, 0x0000, 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x1078, 0x6b5f,
- 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x0c7f, 0x0078, 0x4a5a, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x4a5a, 0x127f, 0x007f, 0x067f, 0x0c7f,
- 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0,
- 0x4abd, 0x1078, 0x75b3, 0x0078, 0x4ac8, 0x0c7e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0xa280, 0x7820, 0x2004, 0xa065, 0x0040, 0x4b78,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x067e, 0x2071, 0x7936, 0x6654, 0x7018,
- 0xac06, 0x00c0, 0x4afc, 0x761a, 0x701c, 0xac06, 0x00c0, 0x4b08,
- 0x86ff, 0x00c0, 0x4b07, 0x7018, 0x701e, 0x0078, 0x4b08, 0x761e,
- 0x6058, 0xa07d, 0x0040, 0x4b0d, 0x7e56, 0xa6ed, 0x0000, 0x0040,
- 0x4b13, 0x2f00, 0x685a, 0x6057, 0x0000, 0x605b, 0x0000, 0x6000,
- 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x377f, 0x0040, 0x4b74, 0x7624,
- 0x86ff, 0x0040, 0x4b64, 0xa680, 0x0004, 0x2004, 0xad06, 0x00c0,
- 0x4b64, 0x0d7e, 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x4b5b,
- 0x1078, 0x5656, 0x68c3, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000,
- 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x4b44,
- 0x6803, 0x0100, 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084,
- 0x0040, 0x4b4c, 0x6827, 0x0001, 0x037f, 0x0d7f, 0x0c7e, 0x603c,
- 0xa005, 0x0040, 0x4b55, 0x8001, 0x603e, 0x2660, 0x1078, 0x6b6c,
- 0x0c7f, 0x0078, 0x4b64, 0x0d7f, 0x0c7e, 0x2660, 0x6003, 0x0009,
- 0x630a, 0x0c7f, 0x0078, 0x4b1b, 0x8dff, 0x0040, 0x4b70, 0x6837,
- 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x6c0a, 0x1078, 0x3b4c,
- 0x1078, 0x59d4, 0x0078, 0x4b1b, 0x067f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x127f, 0x007f, 0x0c7f, 0x007c, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
- 0x2031, 0x0000, 0x7814, 0xa065, 0x0040, 0x4bd4, 0x600c, 0x007e,
- 0x600f, 0x0000, 0x7824, 0xac06, 0x00c0, 0x4bb9, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x4bb3, 0x1078, 0x5656, 0x68c3, 0x0000,
- 0x1078, 0x5b04, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x4ba8, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x4bb0, 0x6827, 0x0001,
- 0x037f, 0x0078, 0x4bb9, 0x6003, 0x0009, 0x630a, 0x2c30, 0x0078,
- 0x4bd1, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x4bcd, 0x601c,
- 0xa086, 0x0003, 0x00c0, 0x4bdb, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x1078, 0x6b6c, 0x1078,
- 0x59d4, 0x007f, 0x0078, 0x4b83, 0x7e16, 0x7e12, 0x0d7f, 0x0c7f,
- 0x067f, 0x007f, 0x007c, 0x601c, 0xa086, 0x0006, 0x00c0, 0x4bc4,
- 0x1078, 0x75b3, 0x0078, 0x4bcd, 0x007e, 0x067e, 0x0c7e, 0x0d7e,
- 0x7818, 0xa065, 0x0040, 0x4c50, 0x6054, 0x007e, 0x6057, 0x0000,
- 0x605b, 0x0000, 0x6000, 0xc0d4, 0xc0dc, 0x6002, 0x1078, 0x377f,
- 0x0040, 0x4c4d, 0x7e24, 0x86ff, 0x0040, 0x4c3f, 0xa680, 0x0004,
- 0x2004, 0xad06, 0x00c0, 0x4c3f, 0x0d7e, 0x2069, 0x0100, 0x68c0,
- 0xa005, 0x0040, 0x4c36, 0x1078, 0x5656, 0x68c3, 0x0000, 0x1078,
- 0x5b04, 0x7827, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04, 0xa384,
- 0x1000, 0x0040, 0x4c1f, 0x6803, 0x0100, 0x6803, 0x0000, 0x2069,
- 0x0100, 0x6824, 0xd084, 0x0040, 0x4c27, 0x6827, 0x0001, 0x037f,
- 0x0d7f, 0x0c7e, 0x603c, 0xa005, 0x0040, 0x4c30, 0x8001, 0x603e,
- 0x2660, 0x1078, 0x6b6c, 0x0c7f, 0x0078, 0x4c3f, 0x0d7f, 0x0c7e,
- 0x2660, 0x6003, 0x0009, 0x630a, 0x0c7f, 0x0078, 0x4bf6, 0x8dff,
- 0x0040, 0x4c49, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078,
- 0x3b4c, 0x1078, 0x59d4, 0x0078, 0x4bf6, 0x007f, 0x0078, 0x4be9,
- 0x781e, 0x781a, 0x0d7f, 0x0c7f, 0x067f, 0x007f, 0x007c, 0x0e7e,
- 0x0c7e, 0x2071, 0x7936, 0x7004, 0xa084, 0x0007, 0x0079, 0x4c60,
- 0x4c6a, 0x4c6d, 0x4c86, 0x4ca2, 0x4ce7, 0x4c6a, 0x4c6a, 0x4c68,
- 0x1078, 0x12d5, 0x0c7f, 0x0e7f, 0x007c, 0x7024, 0xa065, 0x0040,
- 0x4c7b, 0x7020, 0x8001, 0x7022, 0x600c, 0xa015, 0x0040, 0x4c82,
- 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x0c7f,
- 0x0e7f, 0x007c, 0x7216, 0x7212, 0x0078, 0x4c7b, 0x6018, 0x2060,
- 0x1078, 0x377f, 0x6000, 0xc0dc, 0x6002, 0x7020, 0x8001, 0x7022,
- 0x0040, 0x4c97, 0x6054, 0xa015, 0x0040, 0x4c9e, 0x721e, 0x7007,
- 0x0000, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7218, 0x721e,
- 0x0078, 0x4c97, 0x7024, 0xa065, 0x0040, 0x4ce4, 0x700c, 0xac06,
- 0x00c0, 0x4cb9, 0x1078, 0x59d4, 0x600c, 0xa015, 0x0040, 0x4cb5,
- 0x720e, 0x600f, 0x0000, 0x0078, 0x4ce2, 0x720e, 0x720a, 0x0078,
- 0x4ce2, 0x7014, 0xac06, 0x00c0, 0x4ccc, 0x1078, 0x59d4, 0x600c,
- 0xa015, 0x0040, 0x4cc8, 0x7216, 0x600f, 0x0000, 0x0078, 0x4ce2,
- 0x7216, 0x7212, 0x0078, 0x4ce2, 0x6018, 0x2060, 0x1078, 0x377f,
- 0x6000, 0xc0dc, 0x6002, 0x1078, 0x59d4, 0x701c, 0xa065, 0x0040,
- 0x4ce2, 0x6054, 0xa015, 0x0040, 0x4ce0, 0x721e, 0x0078, 0x4ce2,
- 0x7218, 0x721e, 0x7027, 0x0000, 0x0c7f, 0x0e7f, 0x007c, 0x7024,
- 0xa065, 0x0040, 0x4cf4, 0x1078, 0x59d4, 0x600c, 0xa015, 0x0040,
- 0x4cfb, 0x720e, 0x600f, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000,
- 0x0c7f, 0x0e7f, 0x007c, 0x720e, 0x720a, 0x0078, 0x4cf4, 0x0d7e,
- 0x2069, 0x7936, 0x6830, 0xa084, 0x0003, 0x0079, 0x4d07, 0x4d0d,
- 0x4d0f, 0x4d35, 0x4d0d, 0x1078, 0x12d5, 0x0d7f, 0x007c, 0x0c7e,
- 0x6840, 0xa086, 0x0001, 0x0040, 0x4d2b, 0x683c, 0xa065, 0x0040,
- 0x4d20, 0x600c, 0xa015, 0x0040, 0x4d27, 0x6a3a, 0x600f, 0x0000,
- 0x6833, 0x0000, 0x683f, 0x0000, 0x0c7f, 0x0d7f, 0x007c, 0x683a,
- 0x6836, 0x0078, 0x4d20, 0x6843, 0x0000, 0x6838, 0xa065, 0x0040,
- 0x4d20, 0x6003, 0x0003, 0x0078, 0x4d20, 0x0c7e, 0x6843, 0x0000,
- 0x6847, 0x0000, 0x683c, 0xa065, 0x0040, 0x4d4d, 0x600c, 0xa015,
- 0x0040, 0x4d49, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0078,
- 0x4d4d, 0x683f, 0x0000, 0x683a, 0x6836, 0x0c7f, 0x0d7f, 0x007c,
- 0x0d7e, 0x2069, 0x7936, 0x6804, 0xa084, 0x0007, 0x0079, 0x4d58,
- 0x4d62, 0x4dff, 0x4dff, 0x4dff, 0x4dff, 0x4e01, 0x4dff, 0x4d60,
- 0x1078, 0x12d5, 0x6820, 0xa005, 0x00c0, 0x4d68, 0x0d7f, 0x007c,
- 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4d77, 0x6807, 0x0004, 0x6826,
- 0x682b, 0x0000, 0x1078, 0x4e47, 0x0c7f, 0x0d7f, 0x007c, 0x6814,
- 0xa065, 0x0040, 0x4d85, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000,
- 0x1078, 0x4e47, 0x0c7f, 0x0d7f, 0x007c, 0x0e7e, 0x037e, 0x6a1c,
- 0xa2f5, 0x0000, 0x0040, 0x4dfa, 0x704c, 0xa00d, 0x0040, 0x4d94,
- 0x7088, 0xa005, 0x0040, 0x4dac, 0x7054, 0xa075, 0x0040, 0x4d9d,
- 0xa20e, 0x0040, 0x4dfa, 0x0078, 0x4da2, 0x6818, 0xa20e, 0x0040,
- 0x4dfa, 0x2070, 0x704c, 0xa00d, 0x0040, 0x4d94, 0x7088, 0xa005,
- 0x00c0, 0x4d94, 0x2e00, 0x681e, 0x733c, 0x7038, 0xa302, 0x00c8,
- 0x4d94, 0x1078, 0x5ca3, 0x0040, 0x4dfa, 0x8318, 0x733e, 0x6112,
- 0x2e10, 0x621a, 0xa180, 0x0015, 0x2004, 0xa08a, 0x199a, 0x0048,
- 0x4dc3, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0xa318, 0x6316,
- 0x037f, 0x0f7e, 0x2c78, 0x71a0, 0xd1bc, 0x0040, 0x4ddc, 0x7100,
- 0xd1f4, 0x0040, 0x4dd8, 0x7114, 0xa18c, 0x00ff, 0x0078, 0x4de1,
- 0x2009, 0x0000, 0x0078, 0x4de1, 0xa1e0, 0x2303, 0x2c0c, 0xa18c,
- 0x00ff, 0x2061, 0x0100, 0x619a, 0x1078, 0x5298, 0x7300, 0xc3dd,
- 0x7302, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x781f,
- 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x0f7f, 0x0e7f, 0x0c7f,
- 0x0d7f, 0x007c, 0x037f, 0x0e7f, 0x0c7f, 0x0078, 0x4df8, 0x0d7f,
- 0x007c, 0x0c7e, 0x680c, 0xa065, 0x0040, 0x4e0d, 0x6807, 0x0004,
- 0x6826, 0x682b, 0x0000, 0x1078, 0x4e47, 0x0c7f, 0x0d7f, 0x007c,
- 0x0f7e, 0x0d7e, 0x2069, 0x7936, 0x6830, 0xa086, 0x0000, 0x00c0,
- 0x4e2e, 0x6838, 0xa07d, 0x0040, 0x4e2e, 0x6833, 0x0001, 0x683e,
- 0x6847, 0x0000, 0x127e, 0x0f7e, 0x2091, 0x2200, 0x027f, 0x1078,
- 0x1a24, 0x00c0, 0x4e31, 0x127f, 0x1078, 0x552b, 0x0d7f, 0x0f7f,
- 0x007c, 0x127f, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0xa015,
- 0x0040, 0x4e43, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, 0x683f,
- 0x0000, 0x0078, 0x4e2e, 0x683a, 0x6836, 0x0078, 0x4e3d, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x4e4d, 0x007c, 0x4e56, 0x4e5b, 0x5162,
- 0x5258, 0x4e5b, 0x5162, 0x5258, 0x4e56, 0x4e5b, 0x1078, 0x4c57,
- 0x1078, 0x4d50, 0x007c, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0f7e,
- 0x6004, 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x6118, 0x2178, 0x79a0,
- 0xd1bc, 0x0040, 0x4e78, 0x7900, 0xd1f4, 0x0040, 0x4e74, 0x7914,
- 0xa18c, 0x00ff, 0x0078, 0x4e7d, 0x2009, 0x0000, 0x0078, 0x4e7d,
- 0xa1f8, 0x2303, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100,
- 0x619a, 0x1079, 0x4e89, 0x0f7f, 0x0c7f, 0x147f, 0x137f, 0x157f,
- 0x007c, 0x4ebb, 0x4ef3, 0x4f0b, 0x4f8a, 0x4fb7, 0x4fbf, 0x4fe0,
- 0x4ff1, 0x5002, 0x500a, 0x501b, 0x500a, 0x5063, 0x4ff1, 0x5084,
- 0x508c, 0x5002, 0x508c, 0x509d, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9,
- 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9, 0x4eb9,
- 0x5712, 0x5727, 0x574a, 0x576e, 0x4fe0, 0x4eb9, 0x4fe0, 0x500a,
- 0x4eb9, 0x4f0b, 0x4f8a, 0x4eb9, 0x5c1e, 0x500a, 0x4eb9, 0x5c41,
- 0x500a, 0x1078, 0x12d5, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3,
- 0x5200, 0x20a3, 0x0000, 0x0d7e, 0x2069, 0x7751, 0x6804, 0xd084,
- 0x0040, 0x4ed5, 0x6828, 0x20a3, 0x0000, 0x017e, 0x1078, 0x206e,
- 0x21a2, 0x017f, 0x0d7f, 0x0078, 0x4eda, 0x0d7f, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a9, 0x0004, 0x2099, 0x7705, 0x53a6, 0x20a9,
- 0x0004, 0x2099, 0x7701, 0x53a6, 0x20a3, 0x0000, 0x6030, 0xa084,
- 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c,
- 0x1078, 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3,
- 0x0500, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x6030, 0xa084, 0x00ff,
- 0x20a2, 0x20a9, 0x0004, 0x2099, 0x7705, 0x53a6, 0x60c3, 0x0010,
- 0x1078, 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x7818,
- 0xa080, 0x0028, 0x2004, 0xa086, 0x007e, 0x00c0, 0x4f1e, 0x20a3,
- 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0078, 0x4f20, 0x20a3, 0x0300,
- 0x20a3, 0x0000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa086, 0x007e,
- 0x00c0, 0x4f59, 0x2099, 0x7920, 0x33a6, 0x9398, 0x33a6, 0x9398,
- 0x3304, 0xa084, 0x3fff, 0x20a2, 0x9398, 0x33a6, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a9, 0x0004,
- 0x2099, 0x7705, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7701, 0x53a6,
- 0x20a9, 0x0010, 0x20a3, 0x0000, 0x00f0, 0x4f4a, 0x2099, 0x7928,
- 0x33a6, 0x20a9, 0x0007, 0x20a3, 0x0000, 0x00f0, 0x4f53, 0x0078,
- 0x4f79, 0x2099, 0x7920, 0x20a9, 0x0008, 0x53a6, 0x20a9, 0x0004,
- 0x2099, 0x7705, 0x53a6, 0x20a9, 0x0004, 0x2099, 0x7701, 0x53a6,
- 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4f6a, 0x20a9, 0x0008,
- 0x20a3, 0x0000, 0x00f0, 0x4f70, 0x2099, 0x7928, 0x20a9, 0x0008,
- 0x53a6, 0x20a9, 0x0008, 0x20a3, 0x0000, 0x00f0, 0x4f7b, 0x20a9,
- 0x000a, 0x20a3, 0x0000, 0x00f0, 0x4f81, 0x60c3, 0x0074, 0x1078,
- 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3, 0x2010,
- 0x20a3, 0x0014, 0x20a3, 0x0800, 0x20a3, 0x2000, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x0f7e, 0x2079, 0x7751, 0x7904,
- 0x0f7f, 0xd1ac, 0x00c0, 0x4fa6, 0xa085, 0x0020, 0xd1a4, 0x0040,
- 0x4fab, 0xa085, 0x0010, 0xa085, 0x0002, 0x20a2, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x5642, 0x007c, 0x20a1,
- 0x020b, 0x1078, 0x50b2, 0x20a3, 0x5000, 0x0078, 0x4f20, 0x20a1,
- 0x020b, 0x1078, 0x50b2, 0x20a3, 0x2110, 0x20a3, 0x0014, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0014, 0x1078, 0x5642, 0x007c,
- 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x5642,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00, 0x60c3, 0x0008, 0x1078,
- 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200,
- 0x0078, 0x4f20, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0100,
- 0x20a3, 0x0000, 0x20a3, 0x0003, 0x7810, 0x20a2, 0x60c3, 0x0008,
- 0x1078, 0x5642, 0x007c, 0x0d7e, 0x20a1, 0x020b, 0x1078, 0x5129,
- 0x20a3, 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0800, 0x7818, 0x2068,
- 0x6894, 0xa086, 0x0014, 0x00c0, 0x5041, 0x6998, 0xa184, 0xc000,
- 0x00c0, 0x503d, 0xd1ec, 0x0040, 0x5039, 0x20a3, 0x2100, 0x0078,
- 0x5043, 0x20a3, 0x0100, 0x0078, 0x5043, 0x20a3, 0x0400, 0x0078,
- 0x5043, 0x20a3, 0x0700, 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2,
- 0x20a2, 0x0f7e, 0x2079, 0x7751, 0x7904, 0x0f7f, 0xd1ac, 0x00c0,
- 0x5053, 0xa085, 0x0020, 0xd1a4, 0x0040, 0x5058, 0xa085, 0x0010,
- 0xa085, 0x0002, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x0014, 0x1078,
- 0x5642, 0x0d7f, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3,
- 0x0210, 0x20a3, 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x60c3,
- 0x0014, 0x1078, 0x5642, 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129,
- 0x20a3, 0x0200, 0x0078, 0x4ec1, 0x20a1, 0x020b, 0x1078, 0x5129,
- 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0x0003, 0x20a3, 0x2a00,
- 0x60c3, 0x0008, 0x1078, 0x5642, 0x007c, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0100, 0x20a3,
- 0x0000, 0x20a3, 0x000b, 0x20a3, 0x0000, 0x60c3, 0x0008, 0x1078,
- 0x5642, 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
- 0xa080, 0x0028, 0x2014, 0xa286, 0x007e, 0x00c0, 0x50c5, 0x20a3,
- 0x22ff, 0x20a3, 0xfffe, 0x0078, 0x50f3, 0xa286, 0x007f, 0x00c0,
- 0x50d0, 0x0d7e, 0x20a3, 0x22ff, 0x20a3, 0xfffd, 0x0078, 0x50e7,
- 0xd2bc, 0x0040, 0x50ef, 0xa286, 0x0080, 0x0d7e, 0x00c0, 0x50de,
- 0x20a3, 0x22ff, 0x20a3, 0xfffc, 0x0078, 0x50e7, 0xa2e8, 0x7820,
- 0x2d6c, 0x6810, 0xa085, 0x2200, 0x20a2, 0x6814, 0x20a2, 0x2069,
- 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x50f7, 0x20a3,
- 0x2200, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3,
- 0x0129, 0x20a3, 0x0000, 0x1078, 0x5631, 0x22a2, 0x20a3, 0x0000,
- 0x2fa2, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x20a3, 0x02ff,
- 0x2011, 0xfffc, 0x22a2, 0x0d7e, 0x2069, 0x7719, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x20a3, 0x2029, 0x20a3, 0x0000, 0x0078, 0x50fb,
- 0x20a3, 0x0100, 0x20a3, 0x0000, 0x20a3, 0xfc02, 0x20a3, 0x0000,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x5148, 0x0d7e, 0xa0e8,
- 0x7820, 0x2d6c, 0x6810, 0xa085, 0x2300, 0x20a2, 0x6814, 0x20a2,
- 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5150,
- 0x20a3, 0x2300, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0198, 0x20a3, 0x0000, 0x1078, 0x5631, 0x22a2, 0x20a3,
- 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x027f, 0x007c, 0x0c7e, 0x0f7e, 0x6004, 0xa08a, 0x0085, 0x1048,
- 0x12d5, 0xa08a, 0x008c, 0x10c8, 0x12d5, 0x6118, 0x2178, 0x79a0,
- 0xd1bc, 0x0040, 0x5180, 0x7900, 0xd1f4, 0x0040, 0x517c, 0x7914,
- 0xa18c, 0x00ff, 0x0078, 0x5185, 0x2009, 0x0000, 0x0078, 0x5185,
- 0xa1f8, 0x2303, 0x2f0c, 0xa18c, 0x00ff, 0x2c78, 0x2061, 0x0100,
- 0x619a, 0xa082, 0x0085, 0x1079, 0x5190, 0x0f7f, 0x0c7f, 0x007c,
- 0x5199, 0x51a4, 0x51be, 0x5197, 0x5197, 0x5197, 0x5199, 0x1078,
- 0x12d5, 0x147e, 0x20a1, 0x020b, 0x1078, 0x51d1, 0x60c3, 0x0000,
- 0x1078, 0x5642, 0x147f, 0x007c, 0x147e, 0x20a1, 0x020b, 0x1078,
- 0x51fe, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000,
- 0x60c3, 0x000c, 0x1078, 0x5642, 0x147f, 0x007c, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x522b, 0x20a3, 0x0003, 0x20a3, 0x0300, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x0004, 0x1078, 0x5642, 0x147f,
- 0x007c, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x51f0, 0x0d7e, 0xa0e8,
- 0x7820, 0x2d6c, 0x6810, 0xa085, 0x8100, 0x20a2, 0x6814, 0x20a2,
- 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x51f8,
- 0x20a3, 0x8100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0009, 0x20a3, 0x0000, 0x0078, 0x50fb, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xa092,
- 0x007e, 0x0048, 0x521d, 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810,
- 0xa085, 0x8400, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6,
- 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5225, 0x20a3, 0x8400, 0x6298,
- 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3,
- 0x0000, 0x0078, 0x5154, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000,
- 0x7818, 0xa080, 0x0028, 0x2004, 0xa092, 0x007e, 0x0048, 0x524a,
- 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810, 0xa085, 0x8500, 0x20a2,
- 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f,
- 0x0078, 0x5252, 0x20a3, 0x8500, 0x6298, 0x22a2, 0x20a3, 0x0000,
- 0x6230, 0x22a2, 0x20a3, 0x00d1, 0x20a3, 0x0000, 0x0078, 0x5154,
- 0x0c7e, 0x0f7e, 0x2c78, 0x7804, 0xa08a, 0x0040, 0x1048, 0x12d5,
- 0xa08a, 0x0050, 0x10c8, 0x12d5, 0x7918, 0x2160, 0x61a0, 0xd1bc,
- 0x0040, 0x5277, 0x6100, 0xd1f4, 0x0040, 0x5273, 0x6114, 0xa18c,
- 0x00ff, 0x0078, 0x527c, 0x2009, 0x0000, 0x0078, 0x527c, 0xa1e0,
- 0x2303, 0x2c0c, 0xa18c, 0x00ff, 0x2061, 0x0100, 0x619a, 0xa082,
- 0x0040, 0x1079, 0x5286, 0x0f7f, 0x0c7f, 0x007c, 0x5298, 0x537e,
- 0x5326, 0x54a6, 0x5296, 0x5296, 0x5296, 0x5296, 0x5296, 0x5296,
- 0x5296, 0x58ed, 0x58fe, 0x590f, 0x5920, 0x5296, 0x1078, 0x12d5,
- 0x0d7e, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7910,
- 0x2168, 0x6948, 0x21a2, 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x694c,
- 0xa184, 0x0006, 0x8004, 0x20a2, 0xd1ac, 0x0040, 0x52b3, 0x20a3,
- 0x0002, 0x0078, 0x52bf, 0xd1b4, 0x0040, 0x52ba, 0x20a3, 0x0001,
- 0x0078, 0x52bf, 0x20a3, 0x0000, 0x2230, 0x0078, 0x52c1, 0x6a80,
- 0x6e7c, 0x20a9, 0x0008, 0xad80, 0x0017, 0x200c, 0x810f, 0x21a2,
- 0x8000, 0x00f0, 0x52c5, 0x22a2, 0x26a2, 0x60c3, 0x0020, 0x20e1,
- 0x9080, 0x6014, 0xa084, 0x0004, 0xa085, 0x0009, 0x6016, 0x2001,
- 0x7952, 0x2003, 0x07d0, 0x2001, 0x7951, 0x2003, 0x0009, 0x2001,
- 0x7957, 0x2003, 0x0002, 0x1078, 0x1504, 0x147f, 0x157f, 0x0d7f,
- 0x007c, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7a18, 0xa280, 0x0023,
- 0x2014, 0x8210, 0xa294, 0x00ff, 0x2202, 0x8217, 0x7818, 0xa080,
- 0x0028, 0x2004, 0xd0bc, 0x0040, 0x530f, 0x0d7e, 0xa0e8, 0x7820,
- 0x2d6c, 0x6810, 0xa085, 0x0600, 0x20a2, 0x6814, 0x20a2, 0x2069,
- 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5317, 0x20a3,
- 0x0600, 0x6198, 0x21a2, 0x20a3, 0x0000, 0x6130, 0x21a2, 0x20a3,
- 0x0829, 0x20a3, 0x0000, 0x22a2, 0x20a3, 0x0000, 0x2fa2, 0x20a3,
- 0xffff, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x5346, 0x7810, 0x2068,
- 0x6860, 0x20a2, 0x685c, 0x20a2, 0x6880, 0x20a2, 0x687c, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x60c3, 0x000c, 0x1078,
- 0x5642, 0x147f, 0x137f, 0x157f, 0x0d7f, 0x007c, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x0040, 0x5364, 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810, 0xa085,
- 0x0500, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x536c, 0x20a3, 0x0500, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0889, 0x20a3, 0x0000,
- 0x1078, 0x5631, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x546e, 0x7810, 0x2068,
- 0xa016, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x7810, 0xa084,
- 0xf000, 0x00c0, 0x539b, 0x7810, 0xa084, 0x0700, 0x8007, 0x1079,
- 0x53a3, 0x0078, 0x539e, 0xa006, 0x1079, 0x53a3, 0x147f, 0x137f,
- 0x157f, 0x0d7f, 0x007c, 0x53ad, 0x540f, 0x5413, 0x5436, 0x5443,
- 0x5455, 0x5459, 0x53ab, 0x1078, 0x12d5, 0x017e, 0x037e, 0x694c,
- 0xa18c, 0x0003, 0xa186, 0x0000, 0x00c0, 0x53c0, 0x6b78, 0x23a2,
- 0x6868, 0x20a2, 0x6864, 0x20a2, 0x037f, 0x017f, 0x0078, 0x543a,
- 0xa186, 0x0001, 0x00c0, 0x540a, 0x6b78, 0x23a2, 0x6868, 0x20a2,
- 0x6864, 0x20a2, 0x22a2, 0x6874, 0x20a2, 0x22a2, 0x687c, 0x20a2,
- 0x2009, 0x0018, 0xa384, 0x0300, 0x0040, 0x5409, 0xd3c4, 0x0040,
- 0x53db, 0x687c, 0xa108, 0xd3cc, 0x0040, 0x53e0, 0x6874, 0xa108,
- 0x157e, 0x20a9, 0x000d, 0xad80, 0x0020, 0x201c, 0x831f, 0x23a2,
- 0x8000, 0x00f0, 0x53e5, 0x157f, 0x22a2, 0x22a2, 0x22a2, 0xa184,
- 0x0003, 0x0040, 0x5409, 0x20a1, 0x020b, 0x20e1, 0x9080, 0x20e1,
- 0x4000, 0x20a3, 0x0700, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230,
- 0x22a2, 0x20a3, 0x0898, 0x20a2, 0x1078, 0x5631, 0x22a2, 0x20a3,
- 0x0000, 0x61c2, 0x037f, 0x017f, 0x1078, 0x5642, 0x007c, 0x20a3,
- 0x0008, 0x0078, 0x5438, 0x20a3, 0x0302, 0x22a2, 0x22a2, 0x22a2,
- 0x20a3, 0x0012, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x20a3, 0x7000, 0x20a3, 0x0500, 0x22a2, 0x20a3, 0x000a,
- 0x22a2, 0x22a2, 0x20a3, 0x2500, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x60c3, 0x0032, 0x1078, 0x5642, 0x007c, 0x20a3, 0x0028,
- 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0018,
- 0x1078, 0x5642, 0x007c, 0x20a3, 0x0100, 0x22a2, 0x22a2, 0x22a2,
- 0x22a2, 0x22a2, 0x20a3, 0x0008, 0x22a2, 0x22a2, 0x22a2, 0x22a2,
- 0x60c3, 0x0020, 0x1078, 0x5642, 0x007c, 0x20a3, 0x0008, 0x0078,
- 0x5438, 0x037e, 0x7b10, 0xa384, 0xff00, 0x7812, 0xa384, 0x00ff,
- 0x8001, 0x00c0, 0x5467, 0x22a2, 0x037f, 0x0078, 0x5438, 0x20a3,
- 0x0800, 0x22a2, 0x20a2, 0x037f, 0x0078, 0x543a, 0x027e, 0x20e1,
- 0x9080, 0x20e1, 0x4000, 0x7818, 0xa080, 0x0028, 0x2004, 0xd0bc,
- 0x0040, 0x548c, 0x0d7e, 0xa0e8, 0x7820, 0x2d6c, 0x6810, 0xa085,
- 0x0700, 0x20a2, 0x6814, 0x20a2, 0x2069, 0x7719, 0x2da6, 0x8d68,
- 0x2da6, 0x0d7f, 0x0078, 0x5494, 0x20a3, 0x0700, 0x6298, 0x22a2,
- 0x20a3, 0x0000, 0x6230, 0x22a2, 0x20a3, 0x0898, 0x20a3, 0x0000,
- 0x1078, 0x5631, 0x22a2, 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2,
- 0x20a3, 0x0000, 0x20a3, 0x0000, 0x027f, 0x007c, 0x0d7e, 0x157e,
- 0x137e, 0x147e, 0x017e, 0x037e, 0x7810, 0xa084, 0x0700, 0x8007,
- 0x1079, 0x54b9, 0x037f, 0x017f, 0x147f, 0x137f, 0x157f, 0x0d7f,
- 0x007c, 0x54c1, 0x54c1, 0x54c3, 0x54c1, 0x54c1, 0x54c1, 0x54e8,
- 0x54c1, 0x1078, 0x12d5, 0x7910, 0xa18c, 0xf8ff, 0xa18d, 0x0600,
- 0x7912, 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x54f2, 0x0d7e,
- 0x2069, 0x7751, 0x6804, 0xd0bc, 0x0040, 0x54dd, 0x682c, 0xa084,
- 0x00ff, 0x8007, 0x20a2, 0x0078, 0x54df, 0x20a3, 0x3f00, 0x0d7f,
- 0x22a2, 0x22a2, 0x22a2, 0x60c3, 0x0001, 0x1078, 0x5642, 0x007c,
- 0x20a1, 0x020b, 0x2009, 0x0003, 0x1078, 0x54f2, 0x20a3, 0x7f00,
- 0x0078, 0x54e0, 0x027e, 0x20e1, 0x9080, 0x20e1, 0x4000, 0x7818,
- 0xa080, 0x0028, 0x2004, 0xd0bc, 0x0040, 0x5510, 0x0d7e, 0xa0e8,
- 0x7820, 0x2d6c, 0x6810, 0xa085, 0x0100, 0x20a2, 0x6814, 0x20a2,
- 0x2069, 0x7719, 0x2da6, 0x8d68, 0x2da6, 0x0d7f, 0x0078, 0x5518,
- 0x20a3, 0x0100, 0x6298, 0x22a2, 0x20a3, 0x0000, 0x6230, 0x22a2,
- 0x20a3, 0x0888, 0xa18d, 0x0008, 0x21a2, 0x1078, 0x5631, 0x22a2,
- 0x20a3, 0x0000, 0x7a08, 0x22a2, 0x2fa2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x027f, 0x007c, 0x0e7e, 0x0d7e, 0x0c7e, 0x057e, 0x047e,
- 0x037e, 0x2061, 0x0100, 0x2071, 0x7700, 0x6130, 0x7818, 0x2068,
- 0x68a0, 0x2028, 0xd0bc, 0x00c0, 0x5544, 0xa080, 0x2303, 0x2014,
- 0xa294, 0x00ff, 0x0078, 0x5548, 0x6910, 0x6a14, 0x7364, 0x7468,
- 0x781c, 0xa086, 0x0006, 0x0040, 0x559c, 0xd5bc, 0x0040, 0x5558,
- 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x555e,
- 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0809,
- 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
- 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7810,
- 0x2070, 0x7014, 0x608a, 0x7010, 0x608e, 0x700c, 0x60c6, 0x7008,
- 0x60ca, 0x686c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
- 0x0000, 0xa582, 0x0080, 0x0048, 0x5590, 0x6a00, 0xd2f4, 0x0040,
- 0x558e, 0x6a14, 0xa294, 0x00ff, 0x0078, 0x5590, 0x2011, 0x0000,
- 0x629e, 0x6017, 0x0016, 0x1078, 0x46c5, 0x037f, 0x047f, 0x057f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0x7810, 0x2070, 0x704c, 0xa084,
- 0x0003, 0xa086, 0x0002, 0x0040, 0x55eb, 0xd5bc, 0x0040, 0x55b0,
- 0xa185, 0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x0078, 0x55b6,
- 0x6063, 0x0100, 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0880,
- 0x6077, 0x0008, 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007,
- 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7060,
- 0x608a, 0x705c, 0x608e, 0x7080, 0x60c6, 0x707c, 0x60ca, 0x686c,
- 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582,
- 0x0080, 0x0048, 0x55e6, 0x6a00, 0xd2f4, 0x0040, 0x55e4, 0x6a14,
- 0xa294, 0x00ff, 0x0078, 0x55e6, 0x2011, 0x0000, 0x629e, 0x6017,
- 0x0012, 0x0078, 0x5593, 0xd5bc, 0x0040, 0x55f6, 0xa185, 0x0700,
- 0x20a2, 0x6266, 0x636a, 0x646e, 0x0078, 0x55fc, 0x6063, 0x0700,
- 0x6266, 0x606b, 0x0000, 0x616e, 0x6073, 0x0898, 0x6077, 0x0000,
- 0x688c, 0x8000, 0xa084, 0x00ff, 0x688e, 0x8007, 0x607a, 0x607f,
- 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082, 0x7014, 0x608a, 0x7010,
- 0x608e, 0x700c, 0x60c6, 0x7008, 0x60ca, 0x686c, 0x60ce, 0x60ab,
- 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xa582, 0x0080, 0x0048,
- 0x562c, 0x6a00, 0xd2f4, 0x0040, 0x562a, 0x6a14, 0xa294, 0x00ff,
- 0x0078, 0x562c, 0x2011, 0x0000, 0x629e, 0x6017, 0x0016, 0x0078,
- 0x5593, 0x7a18, 0xa280, 0x0023, 0x2014, 0x8210, 0xa294, 0x00ff,
- 0x2202, 0x8217, 0x007c, 0x0d7e, 0x2069, 0x7936, 0x6843, 0x0001,
- 0x0d7f, 0x007c, 0x20e1, 0x9080, 0x60a3, 0x0056, 0x60a7, 0x9575,
- 0x1078, 0x564d, 0x1078, 0x46b5, 0x007c, 0x007e, 0x6014, 0xa084,
- 0x0004, 0xa085, 0x0009, 0x6016, 0x007f, 0x007c, 0x007e, 0x0c7e,
- 0x2061, 0x0100, 0x6014, 0xa084, 0x0004, 0xa085, 0x0008, 0x6016,
- 0x0c7f, 0x007f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x027e, 0x1078,
- 0x46c0, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x56a0, 0x1078, 0x5656, 0x6803, 0x1000, 0x6803, 0x0000,
- 0x0c7e, 0x2061, 0x7936, 0x6128, 0xa192, 0x0002, 0x00c8, 0x568d,
- 0x8108, 0x612a, 0x6124, 0x0c7f, 0x81ff, 0x0040, 0x569b, 0x1078,
- 0x46b5, 0x1078, 0x564d, 0x0078, 0x569b, 0x6124, 0xa1e5, 0x0000,
- 0x0040, 0x5698, 0x1078, 0x767d, 0x2009, 0x0014, 0x1078, 0x5cfb,
- 0x0c7f, 0x0078, 0x569b, 0x027f, 0x017f, 0x0d7f, 0x0c7f, 0x007c,
- 0x1078, 0x3553, 0x0078, 0x569b, 0x0c7e, 0x0d7e, 0x0e7e, 0x017e,
- 0x027e, 0x1078, 0x46ce, 0x2071, 0x7936, 0x713c, 0x81ff, 0x0040,
- 0x56ce, 0x2061, 0x0100, 0x2069, 0x0140, 0x6904, 0xa194, 0x4000,
- 0x0040, 0x56d4, 0x6803, 0x1000, 0x6803, 0x0000, 0x037e, 0x2019,
- 0x0001, 0x1078, 0x583a, 0x037f, 0x713c, 0x2160, 0x1078, 0x767d,
- 0x2009, 0x004a, 0x1078, 0x5cfb, 0x0078, 0x56ce, 0x027f, 0x017f,
- 0x0e7f, 0x0d7f, 0x0c7f, 0x007c, 0x7144, 0xa192, 0x0002, 0x00c8,
- 0x56be, 0x8108, 0x7146, 0x1078, 0x46c5, 0x0078, 0x56ce, 0x0e7e,
- 0x0d7e, 0x0c7e, 0x067e, 0x057e, 0x047e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x6018, 0x2068, 0x6ca0, 0x2071, 0x7936, 0x7018, 0x2068,
- 0x8dff, 0x0040, 0x5709, 0x68a0, 0xa406, 0x0040, 0x56fb, 0x6854,
- 0x2068, 0x0078, 0x56f0, 0x6010, 0x2060, 0x643c, 0x6540, 0x6e48,
- 0x2d60, 0x1078, 0x394b, 0x0040, 0x5709, 0x1078, 0x59d4, 0xa085,
- 0x0001, 0x127f, 0x007f, 0x047f, 0x057f, 0x067f, 0x0c7f, 0x0d7f,
- 0x0e7f, 0x007c, 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x50b2,
- 0x20a3, 0x0f00, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x7808, 0x20a2,
- 0x60c3, 0x0008, 0x1078, 0x5642, 0x147f, 0x157f, 0x007c, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200, 0x20a3,
- 0x0000, 0x20a9, 0x0006, 0x2011, 0x7740, 0x2019, 0x7741, 0x23a6,
- 0x22a6, 0xa398, 0x0002, 0xa290, 0x0002, 0x00f0, 0x5737, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x60c3, 0x001c, 0x1078, 0x5642, 0x147f,
- 0x157f, 0x007c, 0x157e, 0x147e, 0x017e, 0x027e, 0x20a1, 0x020b,
- 0x1078, 0x5109, 0x1078, 0x5120, 0x7810, 0x007e, 0xa080, 0x0015,
- 0x2098, 0x7808, 0xa088, 0x0002, 0x21a8, 0x53a6, 0xa080, 0x0004,
- 0x8003, 0x60c2, 0x007f, 0xa080, 0x0001, 0x2004, 0x7812, 0x1078,
- 0x5642, 0x027f, 0x017f, 0x147f, 0x157f, 0x007c, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x50b2, 0x20a3, 0x6200, 0x20a3, 0x0000,
- 0x20a3, 0x0000, 0x7808, 0x20a2, 0x60c3, 0x0008, 0x1078, 0x5642,
- 0x147f, 0x157f, 0x007c, 0x0e7e, 0x0c7e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7936, 0x700c, 0x2060, 0x8cff, 0x0040, 0x579f,
- 0x1078, 0x6b99, 0x00c0, 0x5796, 0x1078, 0x5f29, 0x600c, 0x007e,
- 0x1078, 0x5cd4, 0x1078, 0x59d4, 0x0c7f, 0x0078, 0x578d, 0x700f,
- 0x0000, 0x700b, 0x0000, 0x127f, 0x007f, 0x0c7f, 0x0e7f, 0x007c,
- 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x027e, 0x017e,
- 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
- 0x7936, 0x7024, 0x2060, 0x8cff, 0x0040, 0x57f8, 0x1078, 0x5656,
- 0x68c3, 0x0000, 0x1078, 0x46c0, 0x2009, 0x0013, 0x1078, 0x5cfb,
- 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040, 0x57db, 0x6827, 0x0004,
- 0x7804, 0xa084, 0x4000, 0x0040, 0x57ed, 0x7803, 0x1000, 0x7803,
- 0x0000, 0x0078, 0x57ed, 0xd084, 0x0040, 0x57e2, 0x6827, 0x0001,
- 0x0078, 0x57e4, 0x00f0, 0x57ca, 0x7804, 0xa084, 0x1000, 0x0040,
- 0x57ed, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824, 0x007f, 0x017f,
- 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f, 0x127f, 0x007c,
- 0x2001, 0x7700, 0x2004, 0xa096, 0x0001, 0x0040, 0x5830, 0xa096,
- 0x0004, 0x0040, 0x5830, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011,
- 0x351a, 0x1078, 0x4643, 0x20a9, 0x01f4, 0x6824, 0xd094, 0x0040,
- 0x581e, 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5830,
- 0x7803, 0x1000, 0x7803, 0x0000, 0x0078, 0x5830, 0xd084, 0x0040,
- 0x5825, 0x6827, 0x0001, 0x0078, 0x5827, 0x00f0, 0x580d, 0x7804,
- 0xa084, 0x1000, 0x0040, 0x5830, 0x7803, 0x0100, 0x7803, 0x0000,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x127e, 0x157e, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x027e, 0x017e, 0x007e, 0x2091, 0x8000, 0x2069, 0x0100, 0x2079,
- 0x0140, 0x2071, 0x7936, 0x703c, 0x2060, 0x8cff, 0x0040, 0x5888,
- 0x6817, 0x0010, 0x68cb, 0x0000, 0x68c7, 0x0000, 0x1078, 0x46ce,
- 0x1078, 0x1bf1, 0xa39d, 0x0000, 0x00c0, 0x5862, 0x2009, 0x0049,
- 0x1078, 0x5cfb, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0040, 0x5875,
- 0x6827, 0x0004, 0x7804, 0xa084, 0x4000, 0x0040, 0x5887, 0x7803,
- 0x1000, 0x7803, 0x0000, 0x0078, 0x5887, 0xd094, 0x0040, 0x587c,
- 0x6827, 0x0002, 0x0078, 0x587e, 0x00f0, 0x5864, 0x7804, 0xa084,
- 0x1000, 0x0040, 0x5887, 0x7803, 0x0100, 0x7803, 0x0000, 0x6824,
- 0x007f, 0x017f, 0x027f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x157f,
- 0x127f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000, 0x2069, 0x7936,
- 0x6a06, 0x127f, 0x0d7f, 0x007c, 0x0d7e, 0x127e, 0x2091, 0x8000,
- 0x2069, 0x7936, 0x6a32, 0x127f, 0x0d7f, 0x007c, 0x0f7e, 0x0e7e,
- 0x0c7e, 0x067e, 0x007e, 0x127e, 0x2071, 0x7936, 0x7614, 0x2660,
- 0x2678, 0x2091, 0x8000, 0x8cff, 0x0040, 0x58e6, 0x601c, 0xa206,
- 0x00c0, 0x58e1, 0x7014, 0xac36, 0x00c0, 0x58c0, 0x660c, 0x7616,
- 0x7010, 0xac36, 0x00c0, 0x58ce, 0x2c00, 0xaf36, 0x0040, 0x58cc,
- 0x2f00, 0x7012, 0x0078, 0x58ce, 0x7013, 0x0000, 0x660c, 0x067e,
- 0x2c00, 0xaf06, 0x0040, 0x58d7, 0x7e0e, 0x0078, 0x58d8, 0x2678,
- 0x600f, 0x0000, 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x0c7f, 0x0078,
- 0x58b3, 0x2c78, 0x600c, 0x2060, 0x0078, 0x58b3, 0x127f, 0x007f,
- 0x067f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x157e, 0x147e, 0x20a1,
- 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2, 0xa006, 0x20a2, 0x20a2,
- 0x20a2, 0x20a2, 0x20a3, 0x4000, 0x0078, 0x592f, 0x157e, 0x147e,
- 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2, 0xa006, 0x20a2,
- 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x2000, 0x0078, 0x592f, 0x157e,
- 0x147e, 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2, 0xa006,
- 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0400, 0x0078, 0x592f,
- 0x157e, 0x147e, 0x20a1, 0x020b, 0x1078, 0x52e9, 0x7810, 0x20a2,
- 0xa006, 0x20a2, 0x20a2, 0x20a2, 0x20a2, 0x20a3, 0x0200, 0x1078,
- 0x59df, 0x60c3, 0x0020, 0x1078, 0x5642, 0x147f, 0x157f, 0x007c,
- 0x127e, 0x0c7e, 0x2091, 0x8000, 0x2061, 0x0100, 0x6120, 0xd1b4,
- 0x00c0, 0x5947, 0xd1bc, 0x00c0, 0x5991, 0x0078, 0x59d1, 0x2009,
- 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e, 0x2069, 0x0140,
- 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084, 0x4000, 0x0040,
- 0x5988, 0x6020, 0xd0b4, 0x0040, 0x5988, 0x6024, 0xd094, 0x00c0,
- 0x5988, 0x2104, 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x5988,
- 0x00f0, 0x5954, 0x027e, 0x6198, 0xa18c, 0x00ff, 0x8107, 0x6130,
- 0xa18c, 0x00ff, 0xa10d, 0x6088, 0x628c, 0x618e, 0x608b, 0xbc91,
- 0x6043, 0x0001, 0x6043, 0x0000, 0x608a, 0x628e, 0x6024, 0xd094,
- 0x00c0, 0x5987, 0x6a04, 0xa294, 0x4000, 0x00c0, 0x597e, 0x027f,
- 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b, 0x0000, 0x0078,
- 0x59d1, 0x2009, 0x017f, 0x200b, 0x00a1, 0x157e, 0x007e, 0x0d7e,
- 0x2069, 0x0140, 0x20a9, 0x001e, 0x2009, 0x0169, 0x6804, 0xa084,
- 0x4000, 0x0040, 0x59ca, 0x6020, 0xd0bc, 0x0040, 0x59ca, 0x2104,
- 0xa084, 0x000f, 0xa086, 0x0004, 0x00c0, 0x59ca, 0x00f0, 0x599e,
- 0x027e, 0x6164, 0xa18c, 0x00ff, 0x8107, 0x6130, 0xa18c, 0x00ff,
- 0xa10d, 0x6088, 0x628c, 0x608b, 0xbc91, 0x618e, 0x6043, 0x0001,
- 0x6043, 0x0000, 0x608a, 0x628e, 0x6a04, 0xa294, 0x4000, 0x00c0,
- 0x59c4, 0x027f, 0x0d7f, 0x007f, 0x157f, 0x2009, 0x017f, 0x200b,
- 0x0000, 0x0c7f, 0x127f, 0x007c, 0x0e7e, 0x2071, 0x7936, 0x7020,
- 0xa005, 0x0040, 0x59dd, 0x8001, 0x7022, 0x0e7f, 0x007c, 0x20a9,
- 0x0008, 0x20a2, 0x00f0, 0x59e1, 0x20a2, 0x20a2, 0x007c, 0x0f7e,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x067e, 0x007e, 0x127e, 0x2091,
- 0x8000, 0x2071, 0x7936, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001,
- 0x87ff, 0x0040, 0x5a77, 0x8cff, 0x0040, 0x5a77, 0x601c, 0xa086,
- 0x0006, 0x00c0, 0x5a72, 0x88ff, 0x0040, 0x5a0e, 0x2800, 0xac06,
- 0x00c0, 0x5a72, 0x2039, 0x0000, 0x0078, 0x5a12, 0x6018, 0xa206,
- 0x00c0, 0x5a72, 0x7024, 0xac06, 0x00c0, 0x5a40, 0x2069, 0x0100,
- 0x68c0, 0xa005, 0x0040, 0x5a3b, 0x6817, 0x0008, 0x68c3, 0x0000,
- 0x1078, 0x5b04, 0x7027, 0x0000, 0x037e, 0x2069, 0x0140, 0x6b04,
- 0xa384, 0x1000, 0x0040, 0x5a30, 0x6803, 0x0100, 0x6803, 0x0000,
- 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5a38, 0x6827, 0x0001,
- 0x037f, 0x0078, 0x5a40, 0x6003, 0x0009, 0x630a, 0x0078, 0x5a72,
- 0x7014, 0xac36, 0x00c0, 0x5a46, 0x660c, 0x7616, 0x7010, 0xac36,
- 0x00c0, 0x5a54, 0x2c00, 0xaf36, 0x0040, 0x5a52, 0x2f00, 0x7012,
- 0x0078, 0x5a54, 0x7013, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06,
- 0x0040, 0x5a5d, 0x7e0e, 0x0078, 0x5a5e, 0x2678, 0x600f, 0x0000,
- 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x5a68, 0x1078, 0x75b3,
- 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x88ff, 0x00c0, 0x5a81, 0x0c7f,
- 0x0078, 0x59f8, 0x2c78, 0x600c, 0x2060, 0x0078, 0x59f8, 0xa006,
- 0x127f, 0x007f, 0x067f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x007c, 0x6017, 0x0000, 0x0c7f, 0xa8c5, 0x0001, 0x0078, 0x5a78,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e,
- 0x2091, 0x8000, 0x2071, 0x7936, 0x7638, 0x2660, 0x2678, 0x8cff,
- 0x0040, 0x5af3, 0x601c, 0xa086, 0x0006, 0x00c0, 0x5aee, 0x88ff,
- 0x0040, 0x5aa8, 0x2800, 0xac06, 0x00c0, 0x5aee, 0x0078, 0x5aac,
- 0x6018, 0xa206, 0x00c0, 0x5aee, 0x703c, 0xac06, 0x00c0, 0x5abe,
- 0x037e, 0x2019, 0x0001, 0x1078, 0x583a, 0x7033, 0x0000, 0x703f,
- 0x0000, 0x7043, 0x0000, 0x7047, 0x0000, 0x037f, 0x7038, 0xac36,
- 0x00c0, 0x5ac4, 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5ad2,
- 0x2c00, 0xaf36, 0x0040, 0x5ad0, 0x2f00, 0x7036, 0x0078, 0x5ad2,
- 0x7037, 0x0000, 0x660c, 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5adb,
- 0x7e0e, 0x0078, 0x5adc, 0x2678, 0x600f, 0x0000, 0x6010, 0x2068,
- 0x1078, 0x6a03, 0x0040, 0x5ae6, 0x1078, 0x75b3, 0x1078, 0x6b6c,
- 0x88ff, 0x00c0, 0x5afd, 0x0c7f, 0x0078, 0x5a97, 0x2c78, 0x600c,
- 0x2060, 0x0078, 0x5a97, 0xa006, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x6017, 0x0000, 0x0c7f,
- 0xa8c5, 0x0001, 0x0078, 0x5af4, 0x0e7e, 0x2071, 0x7936, 0x2001,
- 0x7700, 0x2004, 0xa086, 0x0002, 0x00c0, 0x5b12, 0x7007, 0x0005,
- 0x0078, 0x5b14, 0x7007, 0x0000, 0x0e7f, 0x007c, 0x0f7e, 0x0e7e,
- 0x0c7e, 0x067e, 0x027e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071,
- 0x7936, 0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0040, 0x5b54,
- 0x2200, 0xac06, 0x00c0, 0x5b4f, 0x7038, 0xac36, 0x00c0, 0x5b32,
- 0x660c, 0x763a, 0x7034, 0xac36, 0x00c0, 0x5b40, 0x2c00, 0xaf36,
- 0x0040, 0x5b3e, 0x2f00, 0x7036, 0x0078, 0x5b40, 0x7037, 0x0000,
- 0x660c, 0x2c00, 0xaf06, 0x0040, 0x5b48, 0x7e0e, 0x0078, 0x5b49,
- 0x2678, 0x600f, 0x0000, 0xa085, 0x0001, 0x0078, 0x5b54, 0x2c78,
- 0x600c, 0x2060, 0x0078, 0x5b25, 0x127f, 0x007f, 0x027f, 0x067f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x0d7e, 0x0c7e,
- 0x067e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2071, 0x7936, 0x760c,
- 0x2660, 0x2678, 0x8cff, 0x0040, 0x5bed, 0x6018, 0xa080, 0x0028,
- 0x2004, 0xa206, 0x00c0, 0x5be8, 0x7024, 0xac06, 0x00c0, 0x5b9b,
- 0x2069, 0x0100, 0x68c0, 0xa005, 0x0040, 0x5b9b, 0x1078, 0x5656,
- 0x68c3, 0x0000, 0x1078, 0x5b04, 0x7027, 0x0000, 0x037e, 0x2069,
- 0x0140, 0x6b04, 0xa384, 0x1000, 0x0040, 0x5b92, 0x6803, 0x0100,
- 0x6803, 0x0000, 0x2069, 0x0100, 0x6824, 0xd084, 0x0040, 0x5b9a,
- 0x6827, 0x0001, 0x037f, 0x700c, 0xac36, 0x00c0, 0x5ba1, 0x660c,
- 0x760e, 0x7008, 0xac36, 0x00c0, 0x5baf, 0x2c00, 0xaf36, 0x0040,
- 0x5bad, 0x2f00, 0x700a, 0x0078, 0x5baf, 0x700b, 0x0000, 0x660c,
- 0x067e, 0x2c00, 0xaf06, 0x0040, 0x5bb8, 0x7e0e, 0x0078, 0x5bb9,
- 0x2678, 0x600f, 0x0000, 0x1078, 0x6b85, 0x00c0, 0x5bc3, 0x1078,
- 0x22b1, 0x0078, 0x5bdf, 0x1078, 0x6b99, 0x00c0, 0x5bcb, 0x1078,
- 0x5f29, 0x0078, 0x5bdf, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040,
- 0x5bdf, 0x601c, 0xa086, 0x0003, 0x00c0, 0x5bf5, 0x6837, 0x0103,
- 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x6003,
- 0x0000, 0x1078, 0x6b6c, 0x1078, 0x59d4, 0x0c7f, 0x0078, 0x5b6a,
- 0x2c78, 0x600c, 0x2060, 0x0078, 0x5b6a, 0x127f, 0x007f, 0x067f,
- 0x0c7f, 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x601c, 0xa086, 0x0006,
- 0x00c0, 0x5bd6, 0x1078, 0x75b3, 0x0078, 0x5bdf, 0x037e, 0x157e,
- 0x137e, 0x147e, 0x3908, 0xa006, 0xa190, 0x0020, 0x221c, 0xa39e,
- 0x2123, 0x00c0, 0x5c0f, 0x8210, 0x8000, 0x0078, 0x5c06, 0xa005,
- 0x0040, 0x5c19, 0x20a9, 0x0020, 0x2198, 0xa110, 0x22a0, 0x22c8,
- 0x53a3, 0x147f, 0x137f, 0x157f, 0x037f, 0x007c, 0x0d7e, 0x20a1,
- 0x020b, 0x1078, 0x5129, 0x20a3, 0x0200, 0x20a3, 0x0014, 0x60c3,
- 0x0014, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x514c, 0x20a3,
- 0x4f47, 0x20a3, 0x4943, 0x20a3, 0x2020, 0x20a3, 0x0004, 0x20a3,
- 0x7878, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x1078, 0x5642, 0x0d7f,
- 0x007c, 0x20a1, 0x020b, 0x1078, 0x5129, 0x20a3, 0x0210, 0x20a3,
- 0x0018, 0x20a3, 0x0800, 0x7810, 0xa084, 0xff00, 0x20a2, 0x20a3,
- 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x7810, 0xa084, 0x00ff, 0x20a2, 0x20a3, 0x0000, 0x20a3,
- 0x0000, 0x60c3, 0x0018, 0x1078, 0x5642, 0x007c, 0x2061, 0x7e00,
- 0x2a70, 0x7060, 0x7046, 0x704b, 0x7e00, 0x007c, 0x0e7e, 0x127e,
- 0x2071, 0x7700, 0x2091, 0x8000, 0x7544, 0xa582, 0x0001, 0x0048,
- 0x5ca0, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000, 0x0040, 0x5c8c,
- 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5c88, 0x0078, 0x5c7b,
- 0x2061, 0x7e00, 0x0078, 0x5c7b, 0x6003, 0x0008, 0x8529, 0x7546,
- 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5c9c, 0x754a, 0xa085,
- 0x0001, 0x127f, 0x0e7f, 0x007c, 0x704b, 0x7e00, 0x0078, 0x5c97,
- 0xa006, 0x0078, 0x5c99, 0x0e7e, 0x2071, 0x7700, 0x7544, 0xa582,
- 0x0001, 0x0048, 0x5cd1, 0x7048, 0x2060, 0x6000, 0xa086, 0x0000,
- 0x0040, 0x5cbe, 0xace0, 0x0008, 0x7054, 0xac02, 0x00c8, 0x5cba,
- 0x0078, 0x5cad, 0x2061, 0x7e00, 0x0078, 0x5cad, 0x6003, 0x0008,
- 0x8529, 0x7546, 0xaca8, 0x0008, 0x7054, 0xa502, 0x00c8, 0x5ccd,
- 0x754a, 0xa085, 0x0001, 0x0e7f, 0x007c, 0x704b, 0x7e00, 0x0078,
- 0x5cc9, 0xa006, 0x0078, 0x5ccb, 0xac82, 0x7e00, 0x1048, 0x12d5,
- 0x2001, 0x7715, 0x2004, 0xac02, 0x10c8, 0x12d5, 0xa006, 0x6006,
- 0x600a, 0x600e, 0x6012, 0x6016, 0x601a, 0x601f, 0x0000, 0x6003,
- 0x0000, 0x2061, 0x7700, 0x6044, 0x8000, 0x6046, 0xa086, 0x0001,
- 0x0040, 0x5cf3, 0x007c, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50,
- 0x127f, 0x0078, 0x5cf2, 0x601c, 0xa084, 0x000f, 0x0079, 0x5d00,
- 0x5d09, 0x5d11, 0x5d2d, 0x5d49, 0x6c16, 0x6c32, 0x6c4e, 0x5d09,
- 0x5d11, 0xa18e, 0x0047, 0x00c0, 0x5d10, 0xa016, 0x1078, 0x1572,
- 0x007c, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5d1b, 0x067f, 0x007c, 0x5d2b, 0x5e12, 0x5f44, 0x5d2b, 0x5f9b,
- 0x5d2b, 0x5d2b, 0x5d2b, 0x5dc1, 0x6247, 0x5d2b, 0x5d2b, 0x5d2b,
- 0x5d2b, 0x5d2b, 0x5d2b, 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2,
- 0x0010, 0x10c8, 0x12d5, 0x1079, 0x5d37, 0x067f, 0x007c, 0x5d47,
- 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x5d47, 0x66b7,
- 0x677d, 0x5d47, 0x66d0, 0x6729, 0x66d0, 0x6729, 0x5d47, 0x1078,
- 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x5d53, 0x067f, 0x007c, 0x5d63, 0x6285, 0x632b, 0x63ed, 0x6541,
- 0x5d63, 0x5d63, 0x5d63, 0x6263, 0x666c, 0x6670, 0x5d63, 0x5d63,
- 0x5d63, 0x5d63, 0x6696, 0x1078, 0x12d5, 0x20a9, 0x000e, 0x2e98,
- 0x6010, 0x20a0, 0x53a3, 0x20a9, 0x0006, 0x3310, 0x3420, 0x9398,
- 0x94a0, 0x3318, 0x3428, 0x222e, 0x2326, 0xa290, 0x0002, 0xa5a8,
- 0x0002, 0xa398, 0x0002, 0xa4a0, 0x0002, 0x00f0, 0x5d73, 0x0e7e,
- 0x1078, 0x6a03, 0x0040, 0x5d8a, 0x6010, 0x2070, 0x7007, 0x0000,
- 0x7037, 0x0103, 0x0e7f, 0x1078, 0x5cd4, 0x007c, 0x0d7e, 0x037e,
- 0x7330, 0xa386, 0x0200, 0x00c0, 0x5d9b, 0x6018, 0x2068, 0x6813,
- 0x00ff, 0x6817, 0xfffd, 0x6010, 0xa005, 0x0040, 0x5da5, 0x2068,
- 0x6807, 0x0000, 0x6837, 0x0103, 0x6b32, 0x1078, 0x5cd4, 0x037f,
- 0x0d7f, 0x007c, 0x0d7e, 0x20a9, 0x000e, 0x2e98, 0x6010, 0x20a0,
- 0x53a3, 0xa1b6, 0x0015, 0x00c0, 0x5dbe, 0x6018, 0x2068, 0x7038,
- 0x680a, 0x703c, 0x680e, 0x6800, 0xc08d, 0x6802, 0x0d7f, 0x0078,
- 0x5d7f, 0x2100, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x0079, 0x5dc8,
- 0x5dfa, 0x5e06, 0x5dfa, 0x5dfa, 0x5dfa, 0x5dfa, 0x5df8, 0x5df8,
- 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5dfa,
- 0x5df8, 0x5dfa, 0x5dfa, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x5dfa, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8, 0x5df8,
- 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x4948, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x4948, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50,
- 0x127f, 0x007c, 0x6004, 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6,
- 0x0013, 0x00c0, 0x5e1e, 0x2008, 0x0079, 0x5ea7, 0xa1b6, 0x0027,
- 0x00c0, 0x5e74, 0x1078, 0x4c57, 0x6004, 0x1078, 0x6b85, 0x0040,
- 0x5e37, 0x1078, 0x6b99, 0x0040, 0x5e6c, 0xa08e, 0x0021, 0x0040,
- 0x5e70, 0xa08e, 0x0022, 0x0040, 0x5e6c, 0x0078, 0x5e67, 0x1078,
- 0x22b1, 0x2001, 0x0007, 0x1078, 0x37ae, 0x6018, 0xa080, 0x0028,
- 0x200c, 0x1078, 0x5f29, 0xa186, 0x007e, 0x00c0, 0x5e4d, 0x2001,
- 0x772f, 0x2014, 0xa295, 0x0001, 0x2202, 0x017e, 0x027e, 0x037e,
- 0x2110, 0x2019, 0x0028, 0x1078, 0x4a38, 0x1078, 0x497b, 0x0c7e,
- 0x6018, 0xa065, 0x0040, 0x5e5e, 0x1078, 0x39f0, 0x0c7f, 0x2c08,
- 0x1078, 0x7431, 0x037f, 0x027f, 0x017f, 0x1078, 0x37ee, 0x1078,
- 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078, 0x5f29, 0x0078, 0x5e67,
- 0x1078, 0x5f38, 0x0078, 0x5e67, 0xa186, 0x0014, 0x00c0, 0x5e6b,
- 0x1078, 0x4c57, 0x1078, 0x228f, 0x1078, 0x6b85, 0x00c0, 0x5e94,
- 0x1078, 0x22b1, 0x6018, 0xa080, 0x0028, 0x200c, 0x1078, 0x5f29,
- 0xa186, 0x007e, 0x00c0, 0x5e92, 0x2001, 0x772f, 0x200c, 0xa18d,
- 0x0001, 0x2102, 0x0078, 0x5e67, 0x1078, 0x6b99, 0x00c0, 0x5e9c,
- 0x1078, 0x5f29, 0x0078, 0x5e67, 0x6004, 0xa08e, 0x0021, 0x0040,
- 0x5e98, 0xa08e, 0x0022, 0x1040, 0x5f38, 0x0078, 0x5e67, 0x5ed9,
- 0x5edb, 0x5edf, 0x5ee3, 0x5ee7, 0x5eeb, 0x5ed7, 0x5ed7, 0x5ed7,
- 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7,
- 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7,
- 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5eef, 0x5ef5, 0x5ed7,
- 0x5eff, 0x5ef5, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ef5,
- 0x5ef5, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x5ed7, 0x1078,
- 0x12d5, 0x0078, 0x5ef5, 0x2001, 0x000b, 0x0078, 0x5f08, 0x2001,
- 0x0003, 0x0078, 0x5f08, 0x2001, 0x0005, 0x0078, 0x5f08, 0x2001,
- 0x0001, 0x0078, 0x5f08, 0x2001, 0x0009, 0x0078, 0x5f08, 0x1078,
- 0x12d5, 0x0078, 0x5f07, 0x1078, 0x37ae, 0x1078, 0x4c57, 0x6003,
- 0x0002, 0x6017, 0x0028, 0x1078, 0x4d50, 0x0078, 0x5f07, 0x1078,
- 0x4c57, 0x6003, 0x0004, 0x6017, 0x0028, 0x1078, 0x4d50, 0x007c,
- 0x1078, 0x37ae, 0x1078, 0x4c57, 0x6003, 0x0002, 0x037e, 0x2019,
- 0x775c, 0x2304, 0xa084, 0xff00, 0x00c0, 0x5f1a, 0x2019, 0x0028,
- 0x0078, 0x5f23, 0x8007, 0xa09a, 0x0004, 0x0048, 0x5f16, 0x8003,
- 0x801b, 0x831b, 0xa318, 0x6316, 0x037f, 0x1078, 0x4d50, 0x0078,
- 0x5f07, 0x0e7e, 0x1078, 0x6a03, 0x0040, 0x5f36, 0x6010, 0x2070,
- 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0100, 0x0e7f, 0x007c,
- 0x0e7e, 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103,
- 0x7023, 0x8001, 0x0e7f, 0x007c, 0x0d7e, 0x6618, 0x2668, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0x6604,
- 0xa6b6, 0x0028, 0x00c0, 0x5f58, 0x1078, 0x6bce, 0x0078, 0x5f8a,
- 0x6604, 0xa6b6, 0x0029, 0x00c0, 0x5f61, 0x1078, 0x6be8, 0x0078,
- 0x5f8a, 0x6604, 0xa6b6, 0x001f, 0x00c0, 0x5f6a, 0x1078, 0x5d65,
- 0x0078, 0x5f8a, 0x6604, 0xa6b6, 0x0000, 0x00c0, 0x5f73, 0x1078,
- 0x5daa, 0x0078, 0x5f8a, 0x6604, 0xa6b6, 0x0022, 0x00c0, 0x5f7c,
- 0x1078, 0x5d8e, 0x0078, 0x5f8a, 0xa1b6, 0x0015, 0x00c0, 0x5f84,
- 0x1079, 0x5f8f, 0x0078, 0x5f8a, 0xa1b6, 0x0016, 0x00c0, 0x5f8b,
- 0x1079, 0x60cc, 0x007c, 0x1078, 0x5d09, 0x0078, 0x5f8a, 0x5fb3,
- 0x5fb6, 0x5fb3, 0x5ff7, 0x5fb3, 0x6068, 0x5fb3, 0x5fb3, 0x5fb3,
- 0x60a4, 0x5fb3, 0x60ba, 0xa1b6, 0x0048, 0x0040, 0x5fa7, 0x20e1,
- 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0x0e7e,
- 0xacf0, 0x0004, 0x2e74, 0x7000, 0x2070, 0x7037, 0x0103, 0x0e7f,
- 0x1078, 0x5cd4, 0x007c, 0x0005, 0x0005, 0x007c, 0x0e7e, 0x2071,
- 0x7700, 0x7078, 0xa086, 0x0074, 0x00c0, 0x5fe0, 0x1078, 0x7405,
- 0x00c0, 0x5fd2, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x5fe4, 0x0d7f,
- 0x2001, 0x0006, 0x1078, 0x37ae, 0x1078, 0x22b1, 0x1078, 0x5cd4,
- 0x0078, 0x5fe2, 0x2001, 0x000a, 0x1078, 0x37ae, 0x1078, 0x22b1,
- 0x6003, 0x0001, 0x6007, 0x0001, 0x1078, 0x4948, 0x0078, 0x5fe2,
- 0x1078, 0x6058, 0x0e7f, 0x007c, 0x6800, 0xd084, 0x0040, 0x5ff6,
- 0x2001, 0x0000, 0x1078, 0x379a, 0x2069, 0x7751, 0x6804, 0xd0a4,
- 0x0040, 0x5ff6, 0x2001, 0x0006, 0x1078, 0x37bc, 0x007c, 0x0d7e,
- 0x2011, 0x771e, 0x2204, 0xa086, 0x0074, 0x00c0, 0x6054, 0x1078,
- 0x6199, 0x6018, 0x2068, 0xa080, 0x0028, 0x2014, 0xa286, 0x007e,
- 0x0040, 0x601f, 0xa286, 0x0080, 0x00c0, 0x6048, 0x6813, 0x00ff,
- 0x6817, 0xfffc, 0x6010, 0xa005, 0x0040, 0x603e, 0x2068, 0x6807,
- 0x0000, 0x6837, 0x0103, 0x6833, 0x0200, 0x0078, 0x603e, 0x0e7e,
- 0x0f7e, 0x6813, 0x00ff, 0x6817, 0xfffe, 0x2071, 0x772f, 0x2e04,
- 0xa085, 0x0003, 0x2072, 0x2071, 0x7c80, 0x2079, 0x0100, 0x2e04,
- 0xa084, 0x00ff, 0x2069, 0x7719, 0x206a, 0x78e6, 0x8e70, 0x2e04,
- 0x2069, 0x771a, 0x206a, 0x78ea, 0x0f7f, 0x0e7f, 0x2001, 0x0006,
- 0x1078, 0x37ae, 0x1078, 0x22b1, 0x1078, 0x5cd4, 0x0078, 0x6056,
- 0x2001, 0x0004, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4948, 0x0078, 0x6056, 0x1078, 0x6058, 0x0d7f, 0x007c,
- 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x0040, 0x6063, 0x2001,
- 0x0007, 0x1078, 0x37ae, 0x1078, 0x22b1, 0x1078, 0x5cd4, 0x007c,
- 0x0e7e, 0x2071, 0x7700, 0x7078, 0xa086, 0x0014, 0x00c0, 0x609e,
- 0x7000, 0xa086, 0x0003, 0x00c0, 0x607b, 0x6010, 0xa005, 0x00c0,
- 0x607b, 0x1078, 0x2d9e, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3882,
- 0x1078, 0x5fe4, 0x0d7f, 0x1078, 0x61a3, 0x00c0, 0x609e, 0x2001,
- 0x0006, 0x1078, 0x37ae, 0x0e7e, 0x6010, 0xa005, 0x0040, 0x6097,
- 0x2070, 0x7007, 0x0000, 0x7037, 0x0103, 0x7033, 0x0200, 0x0e7f,
- 0x1078, 0x22b1, 0x1078, 0x5cd4, 0x0078, 0x60a2, 0x1078, 0x5f29,
- 0x1078, 0x6058, 0x0e7f, 0x007c, 0x2011, 0x771e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x60b7, 0x2001, 0x0002, 0x1078, 0x37ae, 0x6003,
- 0x0001, 0x6007, 0x0001, 0x1078, 0x4948, 0x0078, 0x60b9, 0x1078,
- 0x6058, 0x007c, 0x2011, 0x771e, 0x2204, 0xa086, 0x0004, 0x00c0,
- 0x60c9, 0x2001, 0x0007, 0x1078, 0x37ae, 0x1078, 0x5cd4, 0x0078,
- 0x60cb, 0x1078, 0x6058, 0x007c, 0x5fb3, 0x60d8, 0x5fb3, 0x60fe,
- 0x5fb3, 0x614c, 0x5fb3, 0x5fb3, 0x5fb3, 0x6161, 0x5fb3, 0x6174,
- 0x0c7e, 0x1078, 0x6187, 0x00c0, 0x60ed, 0x2001, 0x0000, 0x1078,
- 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007,
- 0x0002, 0x1078, 0x4948, 0x0078, 0x60fc, 0x2009, 0x7c8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x60fa, 0x1078, 0x5cd4,
- 0x0078, 0x60fc, 0x1078, 0x6058, 0x0c7f, 0x007c, 0x1078, 0x6196,
- 0x00c0, 0x6112, 0x2001, 0x0000, 0x1078, 0x379a, 0x2001, 0x0002,
- 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4948,
- 0x0078, 0x6134, 0x1078, 0x5f29, 0x2009, 0x7c8e, 0x2134, 0xa6b4,
- 0x00ff, 0xa686, 0x0005, 0x0040, 0x6135, 0x2009, 0x7c8f, 0x2104,
- 0xa084, 0xff00, 0xa086, 0x1900, 0x00c0, 0x6132, 0xa686, 0x0009,
- 0x0040, 0x6135, 0x2001, 0x0004, 0x1078, 0x37ae, 0x1078, 0x5cd4,
- 0x0078, 0x6134, 0x1078, 0x6058, 0x007c, 0x0d7e, 0x6018, 0x2068,
- 0x6840, 0xa084, 0x00ff, 0xa005, 0x0040, 0x6147, 0x8001, 0x6842,
- 0x6017, 0x000a, 0x6007, 0x0016, 0x0d7f, 0x0078, 0x6134, 0x1078,
- 0x228f, 0x0d7f, 0x0078, 0x6132, 0x1078, 0x6196, 0x00c0, 0x615c,
- 0x2001, 0x0004, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0003,
- 0x1078, 0x4948, 0x0078, 0x6160, 0x1078, 0x5f29, 0x1078, 0x6058,
- 0x007c, 0x1078, 0x6196, 0x00c0, 0x6171, 0x2001, 0x0008, 0x1078,
- 0x37ae, 0x6003, 0x0001, 0x6007, 0x0005, 0x1078, 0x4948, 0x0078,
- 0x6173, 0x1078, 0x6058, 0x007c, 0x1078, 0x6196, 0x00c0, 0x6184,
- 0x2001, 0x000a, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0001,
- 0x1078, 0x4948, 0x0078, 0x6186, 0x1078, 0x6058, 0x007c, 0x2009,
- 0x7c8e, 0x2104, 0xa086, 0x0003, 0x00c0, 0x6195, 0x2009, 0x7c8f,
- 0x2104, 0xa084, 0xff00, 0xa086, 0x2a00, 0x007c, 0xa085, 0x0001,
- 0x007c, 0x0c7e, 0x017e, 0xac88, 0x0006, 0x2164, 0x1078, 0x3818,
- 0x017f, 0x0c7f, 0x007c, 0x0e7e, 0x2071, 0x7c8c, 0x7004, 0xa086,
- 0x0014, 0x00c0, 0x61c6, 0x7008, 0xa086, 0x0800, 0x00c0, 0x61c6,
- 0x700c, 0xd0ec, 0x0040, 0x61c4, 0xa084, 0x0f00, 0xa086, 0x0100,
- 0x00c0, 0x61c4, 0x7024, 0xd0a4, 0x0040, 0x61c4, 0xd08c, 0x0040,
- 0x61c4, 0xa006, 0x0078, 0x61c6, 0xa085, 0x0001, 0x0e7f, 0x007c,
- 0x0e7e, 0x0d7e, 0x0c7e, 0x077e, 0x057e, 0x047e, 0x027e, 0x007e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x793f, 0x252c, 0x2021, 0x7945,
- 0x2424, 0x2061, 0x7e00, 0x2071, 0x7700, 0x7244, 0x7060, 0xa202,
- 0x00c8, 0x621d, 0x1078, 0x760f, 0x0040, 0x6215, 0x671c, 0xa786,
- 0x0001, 0x0040, 0x6215, 0xa786, 0x0007, 0x0040, 0x6215, 0x2500,
- 0xac06, 0x0040, 0x6215, 0x2400, 0xac06, 0x0040, 0x6215, 0x0c7e,
- 0x6000, 0xa086, 0x0004, 0x00c0, 0x61ff, 0x1078, 0x1676, 0x6010,
- 0x2068, 0x1078, 0x6a03, 0x0040, 0x6212, 0xa786, 0x0003, 0x00c0,
- 0x6227, 0x6837, 0x0103, 0x6b4a, 0x6847, 0x0000, 0x1078, 0x3b4c,
- 0x1078, 0x6b5f, 0x1078, 0x6b6c, 0x0c7f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x00c8, 0x621d, 0x0078, 0x61dd, 0x127f, 0x007f, 0x027f,
- 0x047f, 0x057f, 0x077f, 0x0c7f, 0x0d7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x6209, 0x1078, 0x75b3, 0x0078, 0x6212, 0x220c,
- 0x2304, 0xa106, 0x00c0, 0x623a, 0x8210, 0x8318, 0x00f0, 0x622f,
- 0xa006, 0x007c, 0x2304, 0xa102, 0x0048, 0x6242, 0x2001, 0x0001,
- 0x0078, 0x6244, 0x2001, 0x0000, 0xa18d, 0x0001, 0x007c, 0x6004,
- 0xa08a, 0x0030, 0x10c8, 0x12d5, 0x1078, 0x6b85, 0x0040, 0x6256,
- 0x1078, 0x6b99, 0x0040, 0x625f, 0x0078, 0x6258, 0x1078, 0x22b1,
- 0x1078, 0x4c57, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078,
- 0x5f29, 0x0078, 0x6258, 0xa182, 0x0040, 0x0079, 0x6267, 0x6277,
- 0x6277, 0x6277, 0x6277, 0x6277, 0x6277, 0x6277, 0x6277, 0x6277,
- 0x6277, 0x6277, 0x6279, 0x6279, 0x6279, 0x6279, 0x6277, 0x1078,
- 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078, 0x48fb, 0x127e, 0x2091,
- 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c, 0xa186, 0x0013, 0x00c0,
- 0x628e, 0x6004, 0xa082, 0x0040, 0x0079, 0x6304, 0xa186, 0x0027,
- 0x00c0, 0x62ab, 0x1078, 0x4c57, 0x1078, 0x228f, 0x0d7e, 0x6110,
- 0x2168, 0x1078, 0x6a03, 0x0040, 0x62a5, 0x6837, 0x0103, 0x684b,
- 0x0029, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x0d7f, 0x1078, 0x5cd4,
- 0x1078, 0x4d50, 0x007c, 0xa186, 0x0014, 0x00c0, 0x62b4, 0x6004,
- 0xa082, 0x0040, 0x0079, 0x62d4, 0xa186, 0x0047, 0x10c0, 0x12d5,
- 0x2001, 0x0109, 0x2004, 0xd084, 0x0040, 0x62d1, 0x127e, 0x2091,
- 0x2200, 0x007e, 0x017e, 0x027e, 0x1078, 0x47bc, 0x027f, 0x017f,
- 0x007f, 0x127f, 0x6000, 0xa086, 0x0002, 0x00c0, 0x62d1, 0x0078,
- 0x632b, 0x1078, 0x5d09, 0x007c, 0x62e6, 0x62e4, 0x62e4, 0x62e4,
- 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62e4, 0x62fd,
- 0x62fd, 0x62fd, 0x62fd, 0x62e4, 0x1078, 0x12d5, 0x1078, 0x4c57,
- 0x0d7e, 0x6110, 0x2168, 0x1078, 0x6a03, 0x0040, 0x62f7, 0x6837,
- 0x0103, 0x684b, 0x0006, 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x0d7f,
- 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078, 0x4c57, 0x1078,
- 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x6316, 0x6314, 0x6314, 0x6314,
- 0x6314, 0x6314, 0x6314, 0x6314, 0x6314, 0x6314, 0x6314, 0x6324,
- 0x6324, 0x6324, 0x6324, 0x6314, 0x1078, 0x12d5, 0x1078, 0x4c57,
- 0x6003, 0x0002, 0x1078, 0x4d50, 0x6010, 0xa088, 0x0013, 0x2104,
- 0xa085, 0x0400, 0x200a, 0x007c, 0x1078, 0x4c57, 0x6003, 0x000f,
- 0x1078, 0x4d50, 0x007c, 0xa182, 0x0040, 0x0079, 0x632f, 0x633f,
- 0x633f, 0x633f, 0x633f, 0x633f, 0x6341, 0x63ca, 0x63e2, 0x633f,
- 0x633f, 0x633f, 0x633f, 0x633f, 0x633f, 0x633f, 0x633f, 0x1078,
- 0x12d5, 0x0e7e, 0x0d7e, 0x2071, 0x7c8c, 0x6110, 0x2168, 0x7614,
- 0xa6b4, 0x0fff, 0x86ff, 0x0040, 0x63ae, 0xa68c, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6373, 0xa186, 0x0028, 0x00c0, 0x635d, 0x1078,
- 0x6b73, 0x684b, 0x001c, 0x0078, 0x6375, 0xd6dc, 0x0040, 0x6368,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6375,
- 0xd6d4, 0x0040, 0x6373, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6375, 0x684b, 0x0000, 0x6837, 0x0103, 0x6e46,
- 0xa01e, 0xd6c4, 0x0040, 0x6388, 0x7328, 0x732c, 0x6b56, 0x037e,
- 0x2308, 0x2019, 0x7c98, 0xad90, 0x0019, 0x1078, 0x67ec, 0x037f,
- 0xd6cc, 0x0040, 0x63be, 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8,
- 0x639c, 0x2071, 0x7c98, 0x831c, 0x2300, 0xae18, 0xad90, 0x001d,
- 0x1078, 0x67ec, 0x0078, 0x63be, 0x6838, 0xd0fc, 0x0040, 0x63a5,
- 0x2009, 0x0020, 0x695a, 0x0078, 0x6391, 0x0f7e, 0x2d78, 0x1078,
- 0x6784, 0x0f7f, 0x1078, 0x67d9, 0x0078, 0x63c0, 0x684b, 0x0000,
- 0x6837, 0x0103, 0x6e46, 0x684c, 0xd0ac, 0x0040, 0x63be, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x63be, 0x1078, 0x6532, 0x1078, 0x3b4c,
- 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x0d7f, 0x0e7f, 0x1078,
- 0x5cd4, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7c8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x4967, 0x1078,
- 0x4e10, 0x007c, 0x6003, 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18,
- 0x3e20, 0x2c10, 0x1078, 0x1572, 0x007c, 0xa182, 0x0040, 0x0079,
- 0x63f1, 0x6401, 0x6401, 0x6401, 0x6401, 0x6401, 0x6403, 0x649a,
- 0x6401, 0x6401, 0x64b0, 0x6512, 0x6401, 0x6401, 0x6401, 0x6401,
- 0x6519, 0x1078, 0x12d5, 0x077e, 0x0f7e, 0x0e7e, 0x0d7e, 0x2071,
- 0x7c8c, 0x6110, 0x2178, 0x7614, 0xa6b4, 0x0fff, 0x7e46, 0x7f4c,
- 0xc7e5, 0x7f4e, 0x6218, 0x2268, 0x6a3c, 0x8211, 0x6a3e, 0x86ff,
- 0x0040, 0x6495, 0xa694, 0xff00, 0xa284, 0x0c00, 0x0040, 0x6424,
- 0x7018, 0x7862, 0x701c, 0x785e, 0xa284, 0x0300, 0x0040, 0x6495,
- 0x1078, 0x132f, 0x1040, 0x12d5, 0x2d00, 0x784a, 0x7f4c, 0xc7cd,
- 0x7f4e, 0x6837, 0x0103, 0x7838, 0x683a, 0x783c, 0x683e, 0x7840,
- 0x6842, 0x6e46, 0xa68c, 0x00ff, 0xa186, 0x0002, 0x0040, 0x645e,
- 0xa186, 0x0028, 0x00c0, 0x6448, 0x684b, 0x001c, 0x0078, 0x6460,
- 0xd6dc, 0x0040, 0x6453, 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x6460, 0xd6d4, 0x0040, 0x645e, 0x684b, 0x0007,
- 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x6460, 0x684b, 0x0000,
- 0x6f4e, 0x7850, 0x6852, 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040,
- 0x6475, 0x7328, 0x732c, 0x6b56, 0x037e, 0x2308, 0x2019, 0x7c98,
- 0xad90, 0x0019, 0x1078, 0x67ec, 0x037f, 0xd6cc, 0x0040, 0x6495,
- 0x7124, 0x695a, 0xa192, 0x0021, 0x00c8, 0x6489, 0x2071, 0x7c98,
- 0x831c, 0x2300, 0xae18, 0xad90, 0x001d, 0x1078, 0x67ec, 0x0078,
- 0x6495, 0x7838, 0xd0fc, 0x0040, 0x6492, 0x2009, 0x0020, 0x695a,
- 0x0078, 0x647e, 0x2d78, 0x1078, 0x6784, 0x0d7f, 0x0e7f, 0x0f7f,
- 0x077f, 0x007c, 0x0f7e, 0x6003, 0x0003, 0x2079, 0x7c8c, 0x7c04,
- 0x7b00, 0x7e0c, 0x7d08, 0x6010, 0x2078, 0x7c12, 0x7b16, 0x7e0a,
- 0x7d0e, 0x0f7f, 0x2c10, 0x1078, 0x19a7, 0x1078, 0x563b, 0x007c,
- 0x0d7e, 0x6003, 0x0002, 0x1078, 0x4cff, 0x1078, 0x4e10, 0x6110,
- 0x2168, 0x694c, 0xd1e4, 0x0040, 0x6510, 0xd1cc, 0x0040, 0x64eb,
- 0x6948, 0x6838, 0xd0fc, 0x0040, 0x64e3, 0x017e, 0x684c, 0x007e,
- 0x6850, 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020,
- 0x157e, 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x64d2,
- 0x157f, 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078,
- 0x1358, 0x0078, 0x650e, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078,
- 0x67d9, 0x0078, 0x650e, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff,
- 0xa186, 0x0002, 0x0040, 0x650a, 0xa086, 0x0028, 0x00c0, 0x64fc,
- 0x684b, 0x001c, 0x0078, 0x650c, 0xd1dc, 0x0040, 0x6503, 0x684b,
- 0x0015, 0x0078, 0x650c, 0xd1d4, 0x0040, 0x650a, 0x684b, 0x0007,
- 0x0078, 0x650c, 0x684b, 0x0000, 0x1078, 0x3b4c, 0x1078, 0x5cd4,
- 0x0d7f, 0x007c, 0x6003, 0x0002, 0x1078, 0x4cff, 0x1078, 0x4e10,
- 0x007c, 0x1078, 0x4cff, 0x1078, 0x228f, 0x0d7e, 0x6110, 0x2168,
- 0x1078, 0x6a03, 0x0040, 0x652c, 0x6837, 0x0103, 0x684b, 0x0029,
- 0x1078, 0x3b4c, 0x1078, 0x6b5f, 0x0d7f, 0x1078, 0x5cd4, 0x1078,
- 0x4e10, 0x007c, 0x684b, 0x0015, 0xd1fc, 0x0040, 0x653e, 0x684b,
- 0x0007, 0x8002, 0x8000, 0x810a, 0xa189, 0x0000, 0x6962, 0x685e,
- 0x007c, 0xa182, 0x0040, 0x0079, 0x6545, 0x6555, 0x6555, 0x6555,
- 0x6555, 0x6555, 0x6557, 0x6555, 0x65fb, 0x6603, 0x6555, 0x6555,
- 0x6555, 0x6555, 0x6555, 0x6555, 0x6555, 0x1078, 0x12d5, 0x077e,
- 0x0f7e, 0x0e7e, 0x0d7e, 0x2071, 0x7c8c, 0x6110, 0x2178, 0x7614,
- 0xa6b4, 0x0fff, 0x7e46, 0x7f4c, 0xc7e5, 0x7f4e, 0x6218, 0x2268,
- 0x6a3c, 0x8211, 0x6a3e, 0x86ff, 0x0040, 0x65ed, 0xa694, 0xff00,
- 0xa284, 0x0c00, 0x0040, 0x6578, 0x7018, 0x7862, 0x701c, 0x785e,
- 0xa284, 0x0300, 0x0040, 0x65ea, 0x1078, 0x132f, 0x1040, 0x12d5,
- 0x2d00, 0x784a, 0x7f4c, 0xa7bd, 0x0200, 0x7f4e, 0x6837, 0x0103,
- 0x7838, 0x683a, 0x783c, 0x683e, 0x7840, 0x6842, 0x6e46, 0xa68c,
- 0x00ff, 0xa186, 0x0002, 0x0040, 0x65b3, 0xa186, 0x0028, 0x00c0,
- 0x659d, 0x684b, 0x001c, 0x0078, 0x65b5, 0xd6dc, 0x0040, 0x65a8,
- 0x684b, 0x0015, 0x7318, 0x6b62, 0x731c, 0x6b5e, 0x0078, 0x65b5,
- 0xd6d4, 0x0040, 0x65b3, 0x684b, 0x0007, 0x7318, 0x6b62, 0x731c,
- 0x6b5e, 0x0078, 0x65b5, 0x684b, 0x0000, 0x6f4e, 0x7850, 0x6852,
- 0x7854, 0x6856, 0xa01e, 0xd6c4, 0x0040, 0x65ca, 0x7328, 0x732c,
- 0x6b56, 0x037e, 0x2308, 0x2019, 0x7c98, 0xad90, 0x0019, 0x1078,
- 0x67ec, 0x037f, 0xd6cc, 0x0040, 0x65ea, 0x7124, 0x695a, 0xa192,
- 0x0021, 0x00c8, 0x65de, 0x2071, 0x7c98, 0x831c, 0x2300, 0xae18,
- 0xad90, 0x001d, 0x1078, 0x67ec, 0x0078, 0x65ea, 0x7838, 0xd0fc,
- 0x0040, 0x65e7, 0x2009, 0x0020, 0x695a, 0x0078, 0x65d3, 0x2d78,
- 0x1078, 0x6784, 0xd6dc, 0x00c0, 0x65f0, 0xa006, 0x0078, 0x65f4,
- 0x2001, 0x0001, 0x7218, 0x731c, 0x1078, 0x15b6, 0x0d7f, 0x0e7f,
- 0x0f7f, 0x077f, 0x007c, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10,
- 0x1078, 0x1572, 0x007c, 0x0d7e, 0x6003, 0x0002, 0x6110, 0x2168,
- 0x694c, 0xd1e4, 0x0040, 0x666a, 0xd1cc, 0x0040, 0x663a, 0x6948,
- 0x6838, 0xd0fc, 0x0040, 0x6632, 0x017e, 0x684c, 0x007e, 0x6850,
- 0x007e, 0xad90, 0x000d, 0xa198, 0x000d, 0x2009, 0x0020, 0x157e,
- 0x21a8, 0x2304, 0x2012, 0x8318, 0x8210, 0x00f0, 0x6621, 0x157f,
- 0x007f, 0x6852, 0x007f, 0x684e, 0x017f, 0x2168, 0x1078, 0x1358,
- 0x0078, 0x6668, 0x017e, 0x1078, 0x1358, 0x0d7f, 0x1078, 0x67d9,
- 0x0078, 0x6668, 0x6837, 0x0103, 0x6944, 0xa184, 0x00ff, 0xa186,
- 0x0002, 0x0040, 0x6659, 0xa086, 0x0028, 0x00c0, 0x664b, 0x684b,
- 0x001c, 0x0078, 0x6666, 0xd1dc, 0x0040, 0x6652, 0x684b, 0x0015,
- 0x0078, 0x6666, 0xd1d4, 0x0040, 0x6659, 0x684b, 0x0007, 0x0078,
- 0x6666, 0x684b, 0x0000, 0x684c, 0xd0ac, 0x0040, 0x6666, 0x6810,
- 0x6914, 0xa115, 0x0040, 0x6666, 0x1078, 0x6532, 0x1078, 0x3b4c,
- 0x1078, 0x5cd4, 0x0d7f, 0x007c, 0x1078, 0x4c57, 0x0078, 0x6672,
- 0x1078, 0x4cff, 0x1078, 0x6a03, 0x0040, 0x6689, 0x0d7e, 0x6110,
- 0x2168, 0x6837, 0x0103, 0x2009, 0x770c, 0x210c, 0xd18c, 0x00c0,
- 0x6692, 0xd184, 0x00c0, 0x668e, 0x6108, 0x694a, 0x1078, 0x3b4c,
- 0x0d7f, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x684b, 0x0004,
- 0x0078, 0x6686, 0x684b, 0x0004, 0x0078, 0x6686, 0xa182, 0x0040,
- 0x0079, 0x669a, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66ac,
- 0x66aa, 0x66af, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66aa, 0x66aa,
- 0x66aa, 0x66aa, 0x1078, 0x12d5, 0x1078, 0x5cd4, 0x007c, 0x007e,
- 0x027e, 0xa016, 0x1078, 0x1572, 0x027f, 0x007f, 0x007c, 0xa182,
- 0x0085, 0x0079, 0x66bb, 0x66c4, 0x66c2, 0x66c2, 0x66c2, 0x66c2,
- 0x66c2, 0x66c2, 0x1078, 0x12d5, 0x6003, 0x0001, 0x6106, 0x1078,
- 0x48fb, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c,
- 0xa186, 0x0013, 0x00c0, 0x66da, 0x6004, 0xa082, 0x0085, 0x2008,
- 0x0079, 0x670e, 0xa186, 0x0027, 0x00c0, 0x66fb, 0x1078, 0x4c57,
- 0x1078, 0x228f, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040,
- 0x66f1, 0x6837, 0x0103, 0x684b, 0x0029, 0x1078, 0x3b4c, 0x1078,
- 0x6b5f, 0x0d7f, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x1078,
- 0x5d09, 0x0078, 0x66f6, 0xa186, 0x0014, 0x00c0, 0x66f7, 0x1078,
- 0x4c57, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x66f1,
- 0x6837, 0x0103, 0x684b, 0x0006, 0x0078, 0x66ed, 0x6717, 0x6715,
- 0x6715, 0x6715, 0x6715, 0x6715, 0x6720, 0x1078, 0x12d5, 0x1078,
- 0x4c57, 0x6017, 0x0014, 0x6003, 0x000c, 0x1078, 0x4d50, 0x007c,
- 0x1078, 0x4c57, 0x6017, 0x0014, 0x6003, 0x000e, 0x1078, 0x4d50,
- 0x007c, 0xa182, 0x008c, 0x00c8, 0x6733, 0xa182, 0x0085, 0x0048,
- 0x6733, 0x0079, 0x6736, 0x1078, 0x5d09, 0x007c, 0x673d, 0x673d,
- 0x673d, 0x673d, 0x673f, 0x675e, 0x673d, 0x1078, 0x12d5, 0x0d7e,
- 0x1078, 0x6b5f, 0x1078, 0x6a03, 0x0040, 0x675a, 0x6010, 0x2068,
- 0x6837, 0x0103, 0x6850, 0xd0b4, 0x0040, 0x6752, 0x684b, 0x0006,
- 0x0078, 0x6756, 0x684b, 0x0005, 0x1078, 0x6c12, 0x6847, 0x0000,
- 0x1078, 0x3b4c, 0x1078, 0x5cd4, 0x0d7f, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6a03, 0x0040, 0x6779, 0x6837, 0x0103, 0x6850,
- 0xd0b4, 0x0040, 0x676f, 0x684b, 0x0006, 0x0078, 0x6773, 0x684b,
- 0x0005, 0x1078, 0x6c12, 0x6847, 0x0000, 0x1078, 0x3b4c, 0x1078,
- 0x6b5f, 0x0d7f, 0x1078, 0x5cd4, 0x007c, 0x1078, 0x4c57, 0x1078,
- 0x5cd4, 0x1078, 0x4d50, 0x007c, 0x057e, 0x067e, 0x0d7e, 0x0f7e,
- 0x2029, 0x0001, 0xa182, 0x0101, 0x00c8, 0x6790, 0x0078, 0x6792,
- 0x2009, 0x0100, 0x2130, 0x2069, 0x7c98, 0x831c, 0x2300, 0xad18,
- 0x2009, 0x0020, 0xaf90, 0x001d, 0x1078, 0x67ec, 0xa6b2, 0x0020,
- 0x7804, 0xa06d, 0x0040, 0x67a6, 0x1078, 0x1358, 0x1078, 0x132f,
- 0x0040, 0x67d0, 0x8528, 0x6837, 0x0110, 0x683b, 0x0000, 0x2d20,
- 0x7c06, 0xa68a, 0x003d, 0x00c8, 0x67bc, 0x2608, 0xad90, 0x000f,
- 0x1078, 0x67ec, 0x0078, 0x67d0, 0xa6b2, 0x003c, 0x2009, 0x003c,
- 0x2d78, 0xad90, 0x000f, 0x1078, 0x67ec, 0x0078, 0x67a6, 0x0f7f,
- 0x852f, 0xa5ad, 0x0003, 0x7d36, 0xa5ac, 0x0000, 0x0078, 0x67d5,
- 0x0f7f, 0x852f, 0xa5ad, 0x0003, 0x7d36, 0x0d7f, 0x067f, 0x057f,
- 0x007c, 0x0f7e, 0x8dff, 0x0040, 0x67ea, 0x6804, 0xa07d, 0x0040,
- 0x67e8, 0x6807, 0x0000, 0x1078, 0x3b4c, 0x2f68, 0x0078, 0x67dd,
- 0x1078, 0x3b4c, 0x0f7f, 0x007c, 0x157e, 0xa184, 0x0001, 0x0040,
- 0x67f2, 0x8108, 0x810c, 0x21a8, 0x2304, 0x8007, 0x2012, 0x8318,
- 0x8210, 0x00f0, 0x67f4, 0x157f, 0x007c, 0x127e, 0x2091, 0x8000,
- 0x601c, 0xa084, 0x000f, 0x1079, 0x6807, 0x127f, 0x007c, 0x6816,
- 0x680f, 0x6811, 0x682f, 0x680f, 0x6811, 0x6811, 0x6811, 0x1078,
- 0x12d5, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0x0d7e, 0x6010,
- 0x2068, 0x1078, 0x6a03, 0x0040, 0x682c, 0xa00e, 0x2001, 0x0005,
- 0x1078, 0x3bdc, 0x1078, 0x6c12, 0x1078, 0x3b4c, 0x1078, 0x5cd4,
- 0xa085, 0x0001, 0x0d7f, 0x007c, 0xa006, 0x0078, 0x682a, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6837, 0x007c, 0x6847,
- 0x6864, 0x6849, 0x6875, 0x6860, 0x6847, 0x6811, 0x6816, 0x6816,
- 0x6811, 0x6811, 0x6811, 0x6811, 0x6811, 0x6811, 0x6811, 0x1078,
- 0x12d5, 0x0d7e, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x6852,
- 0x1078, 0x6c12, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f,
- 0x0002, 0x1078, 0x48fb, 0x1078, 0x4d50, 0xa085, 0x0001, 0x007c,
- 0x1078, 0x1676, 0x0078, 0x6849, 0x0e7e, 0x2071, 0x7936, 0x7024,
- 0xac06, 0x00c0, 0x686d, 0x1078, 0x57a8, 0x1078, 0x56df, 0x0e7f,
- 0x00c0, 0x6849, 0x1078, 0x6811, 0x007c, 0x037e, 0x0e7e, 0x2071,
- 0x7936, 0x703c, 0xac06, 0x00c0, 0x6885, 0x2019, 0x0000, 0x1078,
- 0x583a, 0x0e7f, 0x037f, 0x0078, 0x6849, 0x1078, 0x5b16, 0x0e7f,
- 0x037f, 0x00c0, 0x6849, 0x1078, 0x6811, 0x007c, 0x0c7e, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x6896, 0x0c7f, 0x007c, 0x68a5, 0x6902,
- 0x69a7, 0x68a9, 0x68a5, 0x68a5, 0x7293, 0x5cd4, 0x6902, 0x1078,
- 0x6b99, 0x00c0, 0x68a5, 0x1078, 0x5f29, 0x007c, 0x6017, 0x0001,
- 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x68b1,
- 0x007c, 0x68c1, 0x68c3, 0x68e3, 0x68f5, 0x68f5, 0x68c1, 0x68a5,
- 0x68a5, 0x68a5, 0x68f5, 0x68f5, 0x68c1, 0x68c1, 0x68c1, 0x68c1,
- 0x68ff, 0x1078, 0x12d5, 0x0e7e, 0x6010, 0x2070, 0x7050, 0xc0b5,
- 0x7052, 0x2071, 0x7936, 0x7024, 0xac06, 0x0040, 0x68df, 0x1078,
- 0x56df, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002, 0x6017,
- 0x0014, 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0e7f, 0x007c, 0x6017,
- 0x0001, 0x0078, 0x68dd, 0x0d7e, 0x6010, 0x2068, 0x6850, 0xc0b5,
- 0x6852, 0x0d7f, 0x6007, 0x0085, 0x6003, 0x000b, 0x601f, 0x0002,
- 0x1078, 0x48fb, 0x1078, 0x4d50, 0x007c, 0x0d7e, 0x6017, 0x0001,
- 0x6010, 0x2068, 0x6850, 0xc0b5, 0x6852, 0x0d7f, 0x007c, 0x1078,
- 0x5cd4, 0x007c, 0x6000, 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079,
- 0x690a, 0x007c, 0x691a, 0x68a6, 0x691c, 0x691a, 0x691c, 0x691a,
- 0x691a, 0x691a, 0x689f, 0x689f, 0x691a, 0x691a, 0x691a, 0x691a,
- 0x691a, 0x691a, 0x1078, 0x12d5, 0x0d7e, 0x6018, 0x2068, 0x6804,
- 0xa084, 0x00ff, 0x0d7f, 0xa08a, 0x000c, 0x10c8, 0x12d5, 0x1079,
- 0x692a, 0x007c, 0x6936, 0x6955, 0x6936, 0x6955, 0x6936, 0x6955,
- 0x6938, 0x6941, 0x6936, 0x6955, 0x6936, 0x694e, 0x1078, 0x12d5,
- 0x6004, 0xa08e, 0x0004, 0x0040, 0x6950, 0xa08e, 0x0002, 0x0040,
- 0x6950, 0x6004, 0x1078, 0x6b99, 0x0040, 0x699f, 0xa08e, 0x0021,
- 0x0040, 0x69a3, 0xa08e, 0x0022, 0x0040, 0x699f, 0x1078, 0x228f,
- 0x1078, 0x5f29, 0x1078, 0x5cd4, 0x007c, 0x0c7e, 0x0d7e, 0x6104,
- 0xa186, 0x0016, 0x0040, 0x698f, 0xa186, 0x0002, 0x00c0, 0x697e,
- 0x6018, 0x2068, 0x68a0, 0xd0bc, 0x00c0, 0x697e, 0x6840, 0xa084,
- 0x00ff, 0xa005, 0x0040, 0x697e, 0x8001, 0x6842, 0x6013, 0x0000,
- 0x601f, 0x0007, 0x6017, 0x0398, 0x1078, 0x5c6e, 0x0040, 0x697e,
- 0x2d00, 0x601a, 0x601f, 0x0001, 0x0078, 0x698f, 0x0d7f, 0x0c7f,
- 0x1078, 0x5f29, 0x1078, 0x228f, 0x0e7e, 0x127e, 0x2091, 0x8000,
- 0x1078, 0x22b1, 0x127f, 0x0e7f, 0x1078, 0x5cd4, 0x007c, 0x2001,
- 0x0002, 0x1078, 0x37ae, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078,
- 0x4948, 0x1078, 0x4d50, 0x0d7f, 0x0c7f, 0x0078, 0x698e, 0x1078,
- 0x5f29, 0x0078, 0x6952, 0x1078, 0x5f38, 0x0078, 0x6952, 0x6000,
- 0xa08a, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x69af, 0x007c, 0x69bf,
- 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf, 0x69bf,
- 0x68a5, 0x69bf, 0x68a6, 0x69c1, 0x68a6, 0x69ca, 0x69bf, 0x1078,
- 0x12d5, 0x6007, 0x008b, 0x6003, 0x000d, 0x1078, 0x48fb, 0x1078,
- 0x4d50, 0x007c, 0x1078, 0x6b5f, 0x1078, 0x6a03, 0x0040, 0x69ec,
- 0x1078, 0x228f, 0x0d7e, 0x1078, 0x6a03, 0x0040, 0x69df, 0x6010,
- 0x2068, 0x6837, 0x0103, 0x684b, 0x0006, 0x1078, 0x3b4c, 0x0d7f,
- 0x601f, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x1078, 0x4948,
- 0x1078, 0x4d50, 0x0078, 0x69ee, 0x1078, 0x5cd4, 0x007c, 0xa284,
- 0x0007, 0x00c0, 0x6a00, 0xa282, 0x7e00, 0x0048, 0x6a00, 0x2001,
- 0x7715, 0x2004, 0xa202, 0x00c8, 0x6a00, 0xa085, 0x0001, 0x007c,
- 0xa006, 0x0078, 0x69ff, 0x027e, 0x0e7e, 0x2071, 0x7700, 0x6210,
- 0x7058, 0xa202, 0x0048, 0x6a15, 0x705c, 0xa202, 0x00c8, 0x6a15,
- 0xa085, 0x0001, 0x0e7f, 0x027f, 0x007c, 0xa006, 0x0078, 0x6a12,
- 0x0e7e, 0x0c7e, 0x037e, 0x007e, 0x127e, 0x2091, 0x8000, 0x2061,
- 0x7e00, 0x2071, 0x7700, 0x7344, 0x7060, 0xa302, 0x00c8, 0x6a3e,
- 0x601c, 0xa206, 0x00c0, 0x6a36, 0x1078, 0x6b99, 0x00c0, 0x6a32,
- 0x1078, 0x5f29, 0x0c7e, 0x1078, 0x5cd4, 0x0c7f, 0xace0, 0x0008,
- 0x7054, 0xac02, 0x00c8, 0x6a3e, 0x0078, 0x6a23, 0x127f, 0x007f,
- 0x037f, 0x0c7f, 0x0e7f, 0x007c, 0x0e7e, 0x0c7e, 0x017e, 0x127e,
- 0x2091, 0x8000, 0xa188, 0x7820, 0x210c, 0x81ff, 0x0040, 0x6a6b,
- 0x2061, 0x7e00, 0x2071, 0x7700, 0x7344, 0x7060, 0xa302, 0x00c8,
- 0x6a6b, 0x6018, 0xa106, 0x00c0, 0x6a65, 0x1078, 0x228f, 0x017e,
- 0x0c7e, 0x1078, 0x5cd4, 0x0c7f, 0x017f, 0xace0, 0x0008, 0x7054,
- 0xac02, 0x0048, 0x6a59, 0x127f, 0x017f, 0x0c7f, 0x0e7f, 0x007c,
- 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5c6e,
- 0x057f, 0x0040, 0x6a89, 0x6612, 0x651a, 0x601f, 0x0003, 0x2009,
- 0x004b, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6a85, 0x0c7e, 0x057e, 0x127e, 0x2091,
- 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5c6e, 0x057f, 0x0040, 0x6ab3,
- 0x6013, 0x0000, 0x651a, 0x601f, 0x0003, 0x0c7e, 0x2560, 0x1078,
- 0x39f0, 0x0c7f, 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08, 0x1078,
- 0x7431, 0x2009, 0x004c, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f,
- 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6aaf, 0x0c7e, 0x057e,
- 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e, 0x1078, 0x5c6e, 0x057f,
- 0x0040, 0x6ade, 0x6612, 0x651a, 0x601f, 0x0003, 0x2019, 0x0005,
- 0x0c7e, 0x2560, 0x1078, 0x39f0, 0x0c7f, 0x1078, 0x4a38, 0x1078,
- 0x497b, 0x2c08, 0x1078, 0x7431, 0x2009, 0x004d, 0x1078, 0x5cfb,
- 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f, 0x007c, 0xa006, 0x0078,
- 0x6ada, 0x0c7e, 0x057e, 0x127e, 0x2091, 0x8000, 0x62a0, 0x0c7e,
- 0x1078, 0x5c6e, 0x057f, 0x0040, 0x6b09, 0x6612, 0x651a, 0x601f,
- 0x0003, 0x2019, 0x0005, 0x0c7e, 0x2560, 0x1078, 0x39f0, 0x0c7f,
- 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08, 0x1078, 0x7431, 0x2009,
- 0x004e, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f, 0x057f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6b05, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5c6e, 0x017f, 0x0040, 0x6b25, 0x660a, 0x611a,
- 0x601f, 0x0001, 0x2d00, 0x6012, 0x2009, 0x001f, 0x1078, 0x5cfb,
- 0xa085, 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6b22,
- 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5c6e, 0x017f,
- 0x0040, 0x6b41, 0x660a, 0x611a, 0x601f, 0x0008, 0x2d00, 0x6012,
- 0x2009, 0x0021, 0x1078, 0x5cfb, 0xa085, 0x0001, 0x127f, 0x0c7f,
- 0x007c, 0xa006, 0x0078, 0x6b3e, 0x0c7e, 0x127e, 0x2091, 0x8000,
- 0x0c7e, 0x1078, 0x5c6e, 0x017f, 0x0040, 0x6b5c, 0x611a, 0x601f,
- 0x0001, 0x2d00, 0x6012, 0x2009, 0x0000, 0x1078, 0x5cfb, 0xa085,
- 0x0001, 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6b59, 0x027e,
- 0x0d7e, 0x6218, 0x2268, 0x6a3c, 0x82ff, 0x0040, 0x6b69, 0x8211,
- 0x6a3e, 0x0d7f, 0x027f, 0x007c, 0x6013, 0x0000, 0x601f, 0x0007,
- 0x6017, 0x0014, 0x007c, 0x067e, 0x0c7e, 0x0d7e, 0x2031, 0x7752,
- 0x2634, 0xd6e4, 0x0040, 0x6b81, 0x6618, 0x2660, 0x6e48, 0x1078,
- 0x38fc, 0x0d7f, 0x0c7f, 0x067f, 0x007c, 0x007e, 0x017e, 0x6004,
- 0xa08e, 0x0002, 0x0040, 0x6b96, 0xa08e, 0x0003, 0x0040, 0x6b96,
- 0xa08e, 0x0004, 0x0040, 0x6b96, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x007e, 0x017e, 0x6004, 0xa08e, 0x0000, 0x0040, 0x6bae,
- 0xa08e, 0x001f, 0x0040, 0x6bae, 0xa08e, 0x0028, 0x0040, 0x6bae,
- 0xa08e, 0x0029, 0x0040, 0x6bae, 0xa085, 0x0001, 0x017f, 0x007f,
- 0x007c, 0x0c7e, 0x127e, 0x2091, 0x8000, 0x0c7e, 0x1078, 0x5c6e,
- 0x017f, 0x0040, 0x6bcb, 0x611a, 0x601f, 0x0001, 0x2d00, 0x6012,
- 0x1078, 0x228f, 0x2009, 0x0028, 0x1078, 0x5cfb, 0xa085, 0x0001,
- 0x127f, 0x0c7f, 0x007c, 0xa006, 0x0078, 0x6bc8, 0xa186, 0x0015,
- 0x00c0, 0x6be3, 0x2011, 0x771e, 0x2204, 0xa086, 0x0074, 0x00c0,
- 0x6be3, 0x1078, 0x6199, 0x6003, 0x0001, 0x6007, 0x0029, 0x1078,
- 0x4948, 0x0078, 0x6be7, 0x1078, 0x5f29, 0x1078, 0x5cd4, 0x007c,
- 0xa186, 0x0015, 0x00c0, 0x6c05, 0x2011, 0x771e, 0x2204, 0xa086,
- 0x0014, 0x00c0, 0x6c05, 0x0d7e, 0x6018, 0x2068, 0x1078, 0x3882,
- 0x0d7f, 0x1078, 0x61a3, 0x00c0, 0x6c05, 0x2001, 0x0006, 0x1078,
- 0x37ae, 0x1078, 0x5d7f, 0x0078, 0x6c09, 0x1078, 0x5f29, 0x1078,
- 0x5cd4, 0x007c, 0x6848, 0xa086, 0x0005, 0x00c0, 0x6c11, 0x1078,
- 0x6c12, 0x007c, 0x6850, 0xc0ad, 0x6852, 0x007c, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6c20, 0x067f, 0x007c,
- 0x6c30, 0x6e07, 0x6ee8, 0x6c30, 0x6c30, 0x6c30, 0x6c30, 0x6c30,
- 0x6c6a, 0x6f56, 0x6c30, 0x6c30, 0x6c30, 0x6c30, 0x6c30, 0x6c30,
- 0x1078, 0x12d5, 0x067e, 0x6000, 0xa0b2, 0x0010, 0x10c8, 0x12d5,
- 0x1079, 0x6c3c, 0x067f, 0x007c, 0x6c4c, 0x7242, 0x6c4c, 0x6c4c,
- 0x6c4c, 0x6c4c, 0x6c4c, 0x6c4c, 0x721d, 0x728c, 0x6c4c, 0x6c4c,
- 0x6c4c, 0x6c4c, 0x6c4c, 0x6c4c, 0x1078, 0x12d5, 0x067e, 0x6000,
- 0xa0b2, 0x0010, 0x10c8, 0x12d5, 0x1079, 0x6c58, 0x067f, 0x007c,
- 0x6c68, 0x708e, 0x7100, 0x7122, 0x716e, 0x6c68, 0x6c68, 0x71c8,
- 0x6f62, 0x7205, 0x7209, 0x6c68, 0x6c68, 0x6c68, 0x6c68, 0x6c68,
- 0x1078, 0x12d5, 0xa1b2, 0x0030, 0x10c8, 0x12d5, 0x2100, 0x0079,
- 0x6c71, 0x6ca1, 0x6d7e, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1,
- 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1,
- 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1, 0x6ca1,
- 0x6ca3, 0x6cd2, 0x6cdd, 0x6d05, 0x6d0b, 0x6d3f, 0x6d77, 0x6ca1,
- 0x6ca1, 0x6d86, 0x6ca1, 0x6ca1, 0x6d8d, 0x6d94, 0x6ca1, 0x6ca1,
- 0x6ca1, 0x6ca1, 0x6ca1, 0x6db1, 0x6ca1, 0x6ca1, 0x6dbc, 0x6ca1,
- 0x6ca1, 0x1078, 0x12d5, 0x1078, 0x3af8, 0x6618, 0x0c7e, 0x2660,
- 0x1078, 0x3818, 0x0c7f, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff,
- 0xa082, 0x0006, 0x0048, 0x6cc4, 0x1078, 0x736d, 0x00c0, 0x6cff,
- 0x1078, 0x730b, 0x00c0, 0x6cc0, 0x6007, 0x0008, 0x0078, 0x6d79,
- 0x6007, 0x0009, 0x0078, 0x6d79, 0x1078, 0x7502, 0x0040, 0x6cce,
- 0x1078, 0x736d, 0x0040, 0x6cb8, 0x0078, 0x6cff, 0x6013, 0x1900,
- 0x0078, 0x6cc0, 0x6106, 0x1078, 0x72cd, 0x6007, 0x0006, 0x0078,
- 0x6d79, 0x6007, 0x0007, 0x0078, 0x6d79, 0x0d7e, 0x6618, 0x2668,
- 0x6e04, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6cef,
- 0xa686, 0x0004, 0x0040, 0x6cef, 0x0d7f, 0x0078, 0x6cff, 0x1078,
- 0x73cb, 0x00c0, 0x6cfa, 0x1078, 0x3882, 0x6007, 0x000a, 0x0d7f,
- 0x0078, 0x6d79, 0x6007, 0x000b, 0x0d7f, 0x0078, 0x6d79, 0x1078,
- 0x228f, 0x6007, 0x0001, 0x0078, 0x6d79, 0x1078, 0x228f, 0x6007,
- 0x000c, 0x0078, 0x6d79, 0x1078, 0x3af8, 0x6618, 0xa6b0, 0x0001,
- 0x2634, 0xa684, 0x00ff, 0xa082, 0x0006, 0x0048, 0x6d2c, 0xa6b4,
- 0xff00, 0x8637, 0xa686, 0x0006, 0x00c0, 0x6cff, 0x1078, 0x73da,
- 0x00c0, 0x6d26, 0x6007, 0x000e, 0x0078, 0x6d79, 0x1078, 0x228f,
- 0x6007, 0x000f, 0x0078, 0x6d79, 0x1078, 0x7502, 0x0040, 0x6d39,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6d1e, 0x0078,
- 0x6cff, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6d79, 0x1078,
- 0x3af8, 0x6618, 0xa6b0, 0x0001, 0x2634, 0xa684, 0x00ff, 0xa082,
- 0x0006, 0x0048, 0x6d64, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x00c0, 0x6cff, 0x1078, 0x7405, 0x00c0, 0x6d5e, 0x1078, 0x730b,
- 0x00c0, 0x6d5e, 0x6007, 0x0010, 0x0078, 0x6d79, 0x1078, 0x228f,
- 0x6007, 0x0011, 0x0078, 0x6d79, 0x1078, 0x7502, 0x0040, 0x6d71,
- 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006, 0x0040, 0x6d52, 0x0078,
- 0x6cff, 0x6013, 0x1900, 0x6007, 0x0009, 0x0078, 0x6d79, 0x6007,
- 0x0012, 0x6003, 0x0001, 0x1078, 0x4948, 0x007c, 0x6007, 0x0001,
- 0x6003, 0x0001, 0x1078, 0x4948, 0x0078, 0x6d7d, 0x6007, 0x0020,
- 0x6003, 0x0001, 0x1078, 0x4948, 0x007c, 0x6007, 0x0023, 0x6003,
- 0x0001, 0x1078, 0x4948, 0x007c, 0x017e, 0x027e, 0x2011, 0x7c88,
- 0x2214, 0x2c08, 0x1078, 0x75ca, 0x00c0, 0x6da5, 0x2160, 0x6007,
- 0x0026, 0x6013, 0x1700, 0x0078, 0x6daa, 0x1078, 0x5cd4, 0x2160,
- 0x6007, 0x0025, 0x6003, 0x0001, 0x1078, 0x4948, 0x027f, 0x017f,
- 0x007c, 0x6106, 0x1078, 0x6dc3, 0x6007, 0x002b, 0x0078, 0x6d79,
- 0x6007, 0x002c, 0x0078, 0x6d79, 0x6106, 0x1078, 0x6dc8, 0x6007,
- 0x002e, 0x0078, 0x6d79, 0x0d7e, 0x1078, 0x6dee, 0x0d7f, 0x007c,
- 0x0d7e, 0x1078, 0x6dfd, 0x00c0, 0x6de7, 0x680c, 0xa08c, 0xff00,
- 0x6824, 0xa084, 0x00ff, 0xa115, 0x6212, 0xd1e4, 0x0040, 0x6ddc,
- 0x2009, 0x0001, 0x0078, 0x6de3, 0xd1ec, 0x0040, 0x6de7, 0x2009,
- 0x0000, 0xa294, 0x00ff, 0x1078, 0x22d3, 0x0078, 0x6deb, 0xa085,
- 0x0001, 0x0078, 0x6dec, 0xa006, 0x0d7f, 0x007c, 0x2069, 0x7c8d,
- 0x6800, 0xa082, 0x0010, 0x00c8, 0x6dfb, 0x6013, 0x0000, 0xa085,
- 0x0001, 0x0078, 0x6dfc, 0xa006, 0x007c, 0x6013, 0x0000, 0x2069,
- 0x7c8c, 0x6808, 0xa084, 0xff00, 0xa086, 0x0800, 0x007c, 0x6004,
- 0xa0b2, 0x0030, 0x10c8, 0x12d5, 0xa1b6, 0x0013, 0x00c0, 0x6e13,
- 0x2008, 0x0079, 0x6e26, 0xa1b6, 0x0027, 0x0040, 0x6e1b, 0xa1b6,
- 0x0014, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, 0x37bc, 0x1078,
- 0x4c57, 0x1078, 0x6b6c, 0x1078, 0x4d50, 0x007c, 0x6e56, 0x6e58,
- 0x6e56, 0x6e56, 0x6e56, 0x6e58, 0x6e60, 0x6ec3, 0x6e86, 0x6ec3,
- 0x6e9a, 0x6ec3, 0x6e60, 0x6ec3, 0x6ebb, 0x6ec3, 0x6ebb, 0x6ec3,
- 0x6ec3, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56,
- 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6e56, 0x6ec3, 0x6e56,
- 0x6e56, 0x6ec3, 0x6e56, 0x6ec3, 0x6ec3, 0x6e56, 0x6e56, 0x6e56,
- 0x6e56, 0x6ec3, 0x6ec3, 0x6e56, 0x6ec3, 0x6ec3, 0x1078, 0x12d5,
- 0x1078, 0x4c57, 0x6003, 0x0002, 0x1078, 0x4d50, 0x0078, 0x6ec9,
- 0x0f7e, 0x2079, 0x7751, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6ec3,
- 0x2001, 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae,
- 0x1078, 0x4c57, 0x601f, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
- 0x1078, 0x4948, 0x1078, 0x4d50, 0x0c7e, 0x6118, 0x2160, 0x2009,
- 0x0001, 0x1078, 0x4650, 0x0c7f, 0x0078, 0x6ec9, 0x6618, 0x0d7e,
- 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686, 0x0006,
- 0x0040, 0x6ec3, 0xa686, 0x0004, 0x0040, 0x6ec3, 0x2001, 0x0004,
- 0x0078, 0x6ec1, 0x2001, 0x7700, 0x2004, 0xa086, 0x0003, 0x00c0,
- 0x6ea3, 0x1078, 0x2d9e, 0x2001, 0x0006, 0x1078, 0x6eca, 0x6618,
- 0x0d7e, 0x2668, 0x6e04, 0x0d7f, 0xa6b4, 0xff00, 0x8637, 0xa686,
- 0x0006, 0x0040, 0x6ec3, 0x2001, 0x0006, 0x0078, 0x6ec1, 0x2001,
- 0x0004, 0x0078, 0x6ec1, 0x2001, 0x0006, 0x1078, 0x6eca, 0x0078,
- 0x6ec3, 0x1078, 0x37bc, 0x1078, 0x4c57, 0x1078, 0x5cd4, 0x1078,
- 0x4d50, 0x007c, 0x017e, 0x0d7e, 0x6118, 0x2168, 0x6900, 0xd184,
- 0x0040, 0x6ee5, 0x6104, 0xa18e, 0x000a, 0x00c0, 0x6edd, 0x699c,
- 0xd1a4, 0x00c0, 0x6edd, 0x2001, 0x0007, 0x1078, 0x37ae, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x1078, 0x22b1, 0x0d7f, 0x017f, 0x007c,
- 0x0d7e, 0x6618, 0x2668, 0x6804, 0xa084, 0xff00, 0x8007, 0x0d7f,
- 0xa0b2, 0x000c, 0x10c8, 0x12d5, 0xa1b6, 0x0015, 0x00c0, 0x6efc,
- 0x1079, 0x6f03, 0x0078, 0x6f02, 0xa1b6, 0x0016, 0x10c0, 0x12d5,
- 0x1079, 0x6f3b, 0x007c, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3,
- 0x5fb3, 0x5fb3, 0x6f0f, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x0f7e,
- 0x2079, 0x7751, 0x7804, 0x0f7f, 0xd0ac, 0x00c0, 0x6f2b, 0x2001,
- 0x0000, 0x1078, 0x379a, 0x2001, 0x0002, 0x1078, 0x37ae, 0x601f,
- 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x1078, 0x4948, 0x1078,
- 0x4d50, 0x0078, 0x6f3a, 0x2011, 0x7c83, 0x220c, 0x017e, 0x0c7e,
- 0x1078, 0x3806, 0x00c0, 0x6f3a, 0x1078, 0x35f9, 0x0c7f, 0x017f,
- 0x1078, 0x5cd4, 0x007c, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3,
- 0x5fb3, 0x5fb3, 0x6f47, 0x5fb3, 0x5fb3, 0x5fb3, 0x5fb3, 0x1078,
- 0x6196, 0x00c0, 0x6f53, 0x6003, 0x0001, 0x6007, 0x0001, 0x1078,
- 0x4948, 0x0078, 0x6f55, 0x1078, 0x5cd4, 0x007c, 0x6004, 0xa08a,
- 0x0030, 0x10c8, 0x12d5, 0x1078, 0x4c57, 0x1078, 0x6b6c, 0x1078,
- 0x4d50, 0x007c, 0xa182, 0x0040, 0x0079, 0x6f66, 0x6f76, 0x6f76,
- 0x6f76, 0x6f76, 0x6f78, 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x6f76,
- 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x6f76, 0x1078, 0x12d5,
- 0x0d7e, 0x0e7e, 0x0f7e, 0x157e, 0x047e, 0x027e, 0x6106, 0x2071,
- 0x7c80, 0x7444, 0xa4a4, 0xe600, 0x0040, 0x6fdc, 0x2009, 0x0000,
- 0x0c7e, 0x1078, 0x46e1, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001,
- 0x0040, 0x7047, 0x1078, 0x47a0, 0x0040, 0x7072, 0xa295, 0x0200,
- 0x6a02, 0x0078, 0x6fa1, 0x2009, 0x0001, 0x2011, 0x0200, 0x1078,
- 0x478a, 0x1078, 0x132f, 0x1040, 0x12d5, 0x6003, 0x0007, 0x2d00,
- 0x6837, 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x6c5a, 0x2c00,
- 0x685e, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0x694a, 0xa084,
- 0xff00, 0x6846, 0x684f, 0x0000, 0x6857, 0x0036, 0x1078, 0x3b4c,
- 0xa486, 0x2000, 0x00c0, 0x6fca, 0x2019, 0x0017, 0x1078, 0x758f,
- 0x0078, 0x7034, 0xa486, 0x0400, 0x00c0, 0x6fd4, 0x2019, 0x0002,
- 0x1078, 0x758f, 0x0078, 0x7034, 0xa486, 0x0200, 0x00c0, 0x6fda,
- 0x1078, 0x7580, 0x0078, 0x7034, 0x2009, 0x0000, 0x0c7e, 0x1078,
- 0x46e1, 0x2c68, 0x0c7f, 0x6a00, 0xa284, 0x0001, 0x0040, 0x708a,
- 0xa284, 0x0300, 0x00c0, 0x7082, 0x6804, 0xa005, 0x0040, 0x7072,
- 0x8001, 0x6806, 0x6003, 0x0007, 0x1078, 0x1314, 0x0040, 0x703b,
- 0x6013, 0x0000, 0x6803, 0x0000, 0x6837, 0x0116, 0x683b, 0x0000,
- 0x2c00, 0x684a, 0x6018, 0x2078, 0x78a0, 0x8007, 0x7130, 0x6986,
- 0x6846, 0x6853, 0x003d, 0x7044, 0xa084, 0x0003, 0xa086, 0x0002,
- 0x00c0, 0x7016, 0x684f, 0x0040, 0x0078, 0x7020, 0xa086, 0x0001,
- 0x00c0, 0x701e, 0x684f, 0x0080, 0x0078, 0x7020, 0x684f, 0x0000,
- 0x20a9, 0x000a, 0x2001, 0x7c90, 0xad90, 0x0015, 0x200c, 0x810f,
- 0x2112, 0x8000, 0x8210, 0x00f0, 0x7026, 0x200c, 0x6982, 0x8000,
- 0x200c, 0x697e, 0x1078, 0x3b4c, 0x027f, 0x047f, 0x157f, 0x0f7f,
- 0x0e7f, 0x0d7f, 0x007c, 0x6013, 0x0100, 0x6003, 0x0001, 0x6007,
- 0x0041, 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0078, 0x7034, 0x2069,
- 0x7c92, 0x2d04, 0xa084, 0xff00, 0xa086, 0x1200, 0x00c0, 0x7066,
- 0x2069, 0x7c80, 0x686c, 0xa084, 0x00ff, 0x017e, 0x6110, 0xa18c,
- 0x0700, 0xa10d, 0x6112, 0x017f, 0x6003, 0x0001, 0x6007, 0x0043,
- 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0078, 0x7034, 0x6013, 0x0200,
- 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x48fb, 0x1078, 0x4d50,
- 0x0078, 0x7034, 0x6013, 0x0300, 0x0078, 0x7078, 0x6013, 0x0100,
- 0x6003, 0x0001, 0x6007, 0x0041, 0x1078, 0x48fb, 0x1078, 0x4d50,
- 0x0078, 0x7034, 0x6013, 0x0500, 0x0078, 0x7078, 0x6013, 0x0600,
- 0x0078, 0x7047, 0x6013, 0x0200, 0x0078, 0x7047, 0xa186, 0x0013,
- 0x00c0, 0x70a0, 0x6004, 0xa08a, 0x0040, 0x1048, 0x12d5, 0xa08a,
- 0x0050, 0x10c8, 0x12d5, 0xa082, 0x0040, 0x2008, 0x0079, 0x70d1,
- 0xa186, 0x0047, 0x00c0, 0x70a6, 0x0078, 0x7100, 0xa186, 0x0027,
- 0x0040, 0x70ae, 0xa186, 0x0014, 0x10c0, 0x12d5, 0x6004, 0xa082,
- 0x0040, 0x2008, 0x0079, 0x70b4, 0x70c4, 0x70c6, 0x70c6, 0x70c4,
- 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x70c4,
- 0x70c4, 0x70c4, 0x70c4, 0x70c4, 0x1078, 0x12d5, 0x2001, 0x0007,
- 0x1078, 0x37bc, 0x1078, 0x4c57, 0x1078, 0x6b6c, 0x1078, 0x4d50,
- 0x007c, 0x70e1, 0x70f1, 0x70ea, 0x70fa, 0x70e1, 0x70e1, 0x70e1,
- 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1, 0x70e1,
- 0x70e1, 0x1078, 0x12d5, 0x6010, 0xa088, 0x0013, 0x2104, 0xa085,
- 0x0400, 0x200a, 0x1078, 0x4c57, 0x6003, 0x0002, 0x1078, 0x4d50,
- 0x007c, 0x1078, 0x4c57, 0x1078, 0x4762, 0x1078, 0x5cd4, 0x1078,
- 0x4d50, 0x007c, 0x1078, 0x4c57, 0x2009, 0x0041, 0x0078, 0x71c8,
- 0xa182, 0x0040, 0x0079, 0x7104, 0x7114, 0x7116, 0x7114, 0x7114,
- 0x7114, 0x7114, 0x7114, 0x7117, 0x7114, 0x7114, 0x7114, 0x7114,
- 0x7114, 0x7114, 0x7114, 0x7114, 0x1078, 0x12d5, 0x007c, 0x6003,
- 0x0004, 0x6110, 0x20e1, 0x0005, 0x3d18, 0x3e20, 0x2c10, 0x1078,
- 0x1572, 0x007c, 0xa182, 0x0040, 0x0079, 0x7126, 0x7136, 0x7136,
- 0x7136, 0x7136, 0x7136, 0x7136, 0x7136, 0x7136, 0x7136, 0x7138,
- 0x715b, 0x7136, 0x7136, 0x7136, 0x7136, 0x715b, 0x1078, 0x12d5,
- 0x1078, 0x4cff, 0x1078, 0x4e10, 0x6010, 0x0d7e, 0x2068, 0x684c,
- 0xd0fc, 0x0040, 0x714e, 0xa08c, 0x0003, 0xa18e, 0x0002, 0x0040,
- 0x7154, 0x2009, 0x0041, 0x0d7f, 0x0078, 0x71c8, 0x6003, 0x0007,
- 0x1078, 0x4762, 0x0d7f, 0x007c, 0x1078, 0x4762, 0x1078, 0x5cd4,
- 0x0d7f, 0x0078, 0x7153, 0x037e, 0x1078, 0x4cff, 0x1078, 0x4e10,
- 0x6010, 0x0d7e, 0x2068, 0x2019, 0x0004, 0x1078, 0x75b3, 0x1078,
- 0x6b6c, 0x6017, 0x0028, 0x0d7f, 0x037f, 0x007c, 0xa186, 0x0013,
- 0x00c0, 0x717c, 0x6004, 0xa086, 0x0042, 0x10c0, 0x12d5, 0x1078,
- 0x4c57, 0x1078, 0x4d50, 0x007c, 0xa186, 0x0027, 0x0040, 0x7184,
- 0xa186, 0x0014, 0x00c0, 0x7194, 0x6004, 0xa086, 0x0042, 0x10c0,
- 0x12d5, 0x2001, 0x0007, 0x1078, 0x37bc, 0x1078, 0x4c57, 0x1078,
- 0x6b6c, 0x1078, 0x4d50, 0x007c, 0xa182, 0x0040, 0x0079, 0x7198,
- 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71aa,
- 0x71b6, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8, 0x71a8,
- 0x1078, 0x12d5, 0x037e, 0x047e, 0x20e1, 0x0005, 0x3d18, 0x3e20,
- 0x2c10, 0x1078, 0x1572, 0x047f, 0x037f, 0x007c, 0x6010, 0x0d7e,
- 0x2068, 0x684c, 0xd0fc, 0x0040, 0x71c2, 0x2009, 0x0041, 0x0d7f,
- 0x0078, 0x71c8, 0x6003, 0x0007, 0x1078, 0x4762, 0x0d7f, 0x007c,
- 0xa182, 0x0040, 0x0079, 0x71cc, 0x71dc, 0x71de, 0x71ea, 0x71f6,
- 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x71dc,
- 0x71dc, 0x71dc, 0x71dc, 0x71dc, 0x1078, 0x12d5, 0x6003, 0x0001,
- 0x6106, 0x1078, 0x48fb, 0x127e, 0x2091, 0x8000, 0x1078, 0x4d50,
- 0x127f, 0x007c, 0x6003, 0x0001, 0x6106, 0x1078, 0x48fb, 0x127e,
- 0x2091, 0x8000, 0x1078, 0x4d50, 0x127f, 0x007c, 0x6003, 0x0003,
- 0x6106, 0x2c10, 0x1078, 0x19a7, 0x127e, 0x2091, 0x8000, 0x1078,
- 0x4967, 0x1078, 0x4e10, 0x127f, 0x007c, 0x1078, 0x4c57, 0x0078,
- 0x720b, 0x1078, 0x4cff, 0x6110, 0x81ff, 0x0040, 0x7218, 0x0d7e,
- 0x2168, 0x037e, 0x2019, 0x0029, 0x1078, 0x75b3, 0x037f, 0x0d7f,
- 0x1078, 0x6b6c, 0x1078, 0x4d50, 0x007c, 0xa182, 0x0085, 0x0079,
- 0x7221, 0x7228, 0x7228, 0x7228, 0x722a, 0x7228, 0x7228, 0x7228,
- 0x1078, 0x12d5, 0x027e, 0x0e7e, 0x2071, 0x7c80, 0x7220, 0x1078,
- 0x74cd, 0x0040, 0x7237, 0x6007, 0x0086, 0x0078, 0x7239, 0x6007,
- 0x0087, 0x6003, 0x0001, 0x1078, 0x48fb, 0x1078, 0x4d50, 0x0e7f,
- 0x027f, 0x007c, 0xa186, 0x0013, 0x00c0, 0x7253, 0x6004, 0xa08a,
- 0x0085, 0x1048, 0x12d5, 0xa08a, 0x008c, 0x10c8, 0x12d5, 0xa082,
- 0x0085, 0x0079, 0x7266, 0xa186, 0x0027, 0x0040, 0x725b, 0xa186,
- 0x0014, 0x10c0, 0x12d5, 0x2001, 0x0007, 0x1078, 0x37bc, 0x1078,
- 0x4c57, 0x1078, 0x6b6c, 0x1078, 0x4d50, 0x007c, 0x726d, 0x726f,
- 0x726f, 0x726d, 0x726d, 0x726d, 0x726d, 0x1078, 0x12d5, 0x1078,
- 0x4c57, 0x1078, 0x5cd4, 0x1078, 0x4d50, 0x007c, 0xa182, 0x0085,
- 0x1048, 0x12d5, 0xa182, 0x008c, 0x10c8, 0x12d5, 0xa182, 0x0085,
- 0x0079, 0x7282, 0x7289, 0x7289, 0x7289, 0x728b, 0x7289, 0x7289,
- 0x7289, 0x1078, 0x12d5, 0x007c, 0x1078, 0x4c57, 0x1078, 0x6b6c,
- 0x1078, 0x4d50, 0x007c, 0x037e, 0x2019, 0x000b, 0x1078, 0x729c,
- 0x601f, 0x0006, 0x037f, 0x007c, 0x127e, 0x037e, 0x087e, 0x2091,
- 0x8000, 0x2c40, 0x1078, 0x59e7, 0x00c0, 0x72c9, 0x1078, 0x5a88,
- 0x00c0, 0x72c9, 0x6000, 0xa086, 0x0000, 0x0040, 0x72c9, 0x601c,
- 0xa086, 0x0007, 0x0040, 0x72c9, 0x0d7e, 0x6000, 0xa086, 0x0004,
- 0x00c0, 0x72bc, 0x1078, 0x1676, 0x6010, 0x2068, 0x1078, 0x6a03,
- 0x0040, 0x72c4, 0x1078, 0x75b3, 0x0d7f, 0x6013, 0x0000, 0x601f,
- 0x0007, 0x087f, 0x037f, 0x127f, 0x007c, 0x0f7e, 0x0c7e, 0x037e,
- 0x157e, 0x2079, 0x7c80, 0x7838, 0xa08c, 0x00ff, 0x783c, 0x1078,
- 0x2059, 0x00c0, 0x7304, 0x017e, 0x0c7e, 0x1078, 0x3806, 0x00c0,
- 0x7304, 0x2011, 0x7c90, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x622f, 0x00c0, 0x7304, 0x017f, 0x027f, 0x027e, 0x017e, 0x2019,
- 0x0029, 0x1078, 0x5b5c, 0x1078, 0x4a38, 0x1078, 0x497b, 0x017f,
- 0x1078, 0x7431, 0x1078, 0x39f0, 0x017f, 0x1078, 0x35f9, 0x6612,
- 0x6516, 0xa006, 0x0078, 0x7306, 0x0c7f, 0x017f, 0x157f, 0x037f,
- 0x0c7f, 0x0f7f, 0x007c, 0x0c7e, 0x0d7e, 0x017e, 0x2009, 0x771e,
- 0x2104, 0xa086, 0x0074, 0x00c0, 0x7362, 0x2069, 0x7c8e, 0x690c,
- 0xa182, 0x0100, 0x0048, 0x7352, 0x6908, 0xa184, 0x8000, 0x0040,
- 0x735e, 0xa184, 0x0800, 0x0040, 0x735e, 0x6910, 0xa18a, 0x0001,
- 0x0048, 0x7356, 0x6914, 0x2069, 0x7cae, 0x6904, 0x81ff, 0x00c0,
- 0x734a, 0x690c, 0xa182, 0x0100, 0x0048, 0x7352, 0x6908, 0x81ff,
- 0x00c0, 0x734e, 0x6910, 0xa18a, 0x0001, 0x0048, 0x7356, 0x6918,
- 0xa18a, 0x0001, 0x0048, 0x735e, 0x0078, 0x7368, 0x6013, 0x0100,
- 0x0078, 0x7364, 0x6013, 0x0300, 0x0078, 0x7364, 0x6013, 0x0500,
- 0x0078, 0x7364, 0x6013, 0x0700, 0x0078, 0x7364, 0x6013, 0x0900,
- 0x0078, 0x7364, 0x6013, 0x0b00, 0x0078, 0x7364, 0x6013, 0x0f00,
- 0x0078, 0x7364, 0x6013, 0x2d00, 0xa085, 0x0001, 0x0078, 0x7369,
- 0xa006, 0x017f, 0x0d7f, 0x0c7f, 0x007c, 0x0c7e, 0x0d7e, 0x027e,
- 0x037e, 0x157e, 0x6218, 0x2268, 0x6b04, 0xa394, 0x00ff, 0xa286,
- 0x0006, 0x0040, 0x7391, 0xa286, 0x0004, 0x0040, 0x7391, 0xa394,
- 0xff00, 0x8217, 0xa286, 0x0006, 0x0040, 0x7391, 0xa286, 0x0004,
- 0x0040, 0x7391, 0x0c7e, 0x2d60, 0x1078, 0x3818, 0x0c7f, 0x0078,
- 0x73c4, 0x2011, 0x7c96, 0xad98, 0x000a, 0x20a9, 0x0004, 0x1078,
- 0x622f, 0x00c0, 0x73c5, 0x2011, 0x7c9a, 0xad98, 0x0006, 0x20a9,
- 0x0004, 0x1078, 0x622f, 0x00c0, 0x73c5, 0x047e, 0x017e, 0x6aa0,
- 0xa294, 0x00ff, 0x8227, 0xa006, 0x2009, 0x7752, 0x210c, 0xd1a4,
- 0x0040, 0x73b9, 0x2009, 0x0029, 0x1078, 0x75f7, 0x6800, 0xc0e5,
- 0x6802, 0x2019, 0x0029, 0x1078, 0x4a38, 0x1078, 0x497b, 0x2c08,
- 0x1078, 0x7431, 0x017f, 0x047f, 0xa006, 0x157f, 0x037f, 0x027f,
- 0x0d7f, 0x0c7f, 0x007c, 0x0d7e, 0x2069, 0x7c8e, 0x6800, 0xa086,
- 0x0800, 0x0040, 0x73d7, 0x6013, 0x0000, 0x0078, 0x73d8, 0xa006,
- 0x0d7f, 0x007c, 0x0c7e, 0x0f7e, 0x017e, 0x027e, 0x037e, 0x157e,
- 0x2079, 0x7c8c, 0x7930, 0x7834, 0x1078, 0x2059, 0x00c0, 0x73fe,
- 0x1078, 0x3806, 0x00c0, 0x73fe, 0x2011, 0x7c90, 0xac98, 0x000a,
- 0x20a9, 0x0004, 0x1078, 0x622f, 0x00c0, 0x73fe, 0x2011, 0x7c94,
- 0xac98, 0x0006, 0x20a9, 0x0004, 0x1078, 0x622f, 0x157f, 0x037f,
- 0x027f, 0x017f, 0x0f7f, 0x0c7f, 0x007c, 0x0c7e, 0x007e, 0x017e,
- 0x027e, 0x037e, 0x157e, 0x2011, 0x7c83, 0x2204, 0x8211, 0x220c,
- 0x1078, 0x2059, 0x00c0, 0x742a, 0x1078, 0x3806, 0x00c0, 0x742a,
- 0x2011, 0x7c96, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078, 0x622f,
- 0x00c0, 0x742a, 0x2011, 0x7c9a, 0xac98, 0x0006, 0x20a9, 0x0004,
- 0x1078, 0x622f, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f, 0x0c7f,
- 0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e, 0x027e,
- 0x127e, 0x2091, 0x8000, 0x2029, 0x793f, 0x252c, 0x2021, 0x7945,
- 0x2424, 0x2061, 0x7e00, 0x2071, 0x7700, 0x7644, 0x7060, 0x8001,
- 0xa602, 0x00c8, 0x7496, 0x2100, 0xac06, 0x0040, 0x748c, 0x1078,
- 0x760f, 0x0040, 0x748c, 0x671c, 0xa786, 0x0001, 0x0040, 0x74ab,
- 0xa786, 0x0007, 0x0040, 0x748c, 0x2500, 0xac06, 0x0040, 0x748c,
- 0x2400, 0xac06, 0x0040, 0x748c, 0x1078, 0x7623, 0x00c0, 0x748c,
- 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x7472, 0x017e, 0x1078,
- 0x1676, 0x017f, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x7489,
- 0xa786, 0x0003, 0x00c0, 0x749f, 0x6837, 0x0103, 0x6b4a, 0x6847,
- 0x0000, 0x017e, 0x1078, 0x6c0a, 0x1078, 0x3b4c, 0x017f, 0x1078,
- 0x6b5f, 0x0d7f, 0x1078, 0x6b6c, 0xace0, 0x0008, 0x2001, 0x7715,
- 0x2004, 0xac02, 0x00c8, 0x7496, 0x0078, 0x7443, 0x127f, 0x027f,
- 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c, 0xa786,
- 0x0006, 0x00c0, 0x747c, 0xa386, 0x0005, 0x0040, 0x748c, 0x1078,
- 0x75b3, 0x0078, 0x7489, 0x1078, 0x7623, 0x00c0, 0x748c, 0xa180,
- 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0, 0x748c, 0x6000, 0xa086,
- 0x0002, 0x00c0, 0x748c, 0x1078, 0x6b85, 0x0040, 0x74c7, 0x1078,
- 0x6b99, 0x00c0, 0x748c, 0x1078, 0x5f29, 0x0078, 0x74c9, 0x1078,
- 0x22b1, 0x1078, 0x6b6c, 0x0078, 0x748c, 0x0c7e, 0x0e7e, 0x017e,
- 0x2c08, 0x2170, 0x1078, 0x75ca, 0x017f, 0x0040, 0x74dc, 0x601c,
- 0xa084, 0x000f, 0x1079, 0x74df, 0x0e7f, 0x0c7f, 0x007c, 0x74e7,
- 0x74e7, 0x74e7, 0x74e7, 0x74e7, 0x74e7, 0x74e9, 0x74e7, 0xa006,
- 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, 0x0028, 0x2024, 0xa4a4,
- 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x1078, 0x75f7, 0x017f,
- 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, 0x729c, 0x037f, 0xa085,
- 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x379a, 0x157e, 0x017e,
- 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x7705, 0x2011, 0x7c96,
- 0x1078, 0x622f, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005, 0x007c,
- 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e, 0x2091,
- 0x8000, 0x2061, 0x7e00, 0x2079, 0x0001, 0x8fff, 0x0040, 0x7573,
- 0x2071, 0x7700, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8, 0x7573,
- 0x88ff, 0x0040, 0x7539, 0x2800, 0xac06, 0x00c0, 0x7569, 0x2079,
- 0x0000, 0x1078, 0x760f, 0x0040, 0x7569, 0x2400, 0xac06, 0x0040,
- 0x7569, 0x671c, 0xa786, 0x0006, 0x00c0, 0x7569, 0xa786, 0x0007,
- 0x0040, 0x7569, 0x88ff, 0x00c0, 0x7551, 0x6018, 0xa206, 0x00c0,
- 0x7569, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x7559, 0x1078,
- 0x1676, 0x6010, 0x2068, 0x1078, 0x6a03, 0x0040, 0x7563, 0x047e,
- 0x1078, 0x75b3, 0x047f, 0x0d7f, 0x1078, 0x6b6c, 0x88ff, 0x00c0,
- 0x757c, 0xace0, 0x0008, 0x2001, 0x7715, 0x2004, 0xac02, 0x00c8,
- 0x7573, 0x0078, 0x7525, 0xa006, 0x127f, 0x027f, 0x067f, 0x077f,
- 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078, 0x7574,
- 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218, 0x1078,
- 0x59e7, 0x1078, 0x5a88, 0x1078, 0x7518, 0x087f, 0x007c, 0x027e,
- 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007f, 0x2009,
- 0x0000, 0x017e, 0x037e, 0x1078, 0x3806, 0x00c0, 0x75a8, 0x2c10,
- 0x2041, 0x0000, 0x1078, 0x59e7, 0x1078, 0x5a88, 0x1078, 0x7518,
- 0x037f, 0x017f, 0x8108, 0x00f0, 0x7599, 0x157f, 0x0c7f, 0x087f,
- 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040, 0x75c7,
- 0x6800, 0xa07d, 0x0040, 0x75c4, 0x6803, 0x0000, 0x6b52, 0x1078,
- 0x3b4c, 0x2f68, 0x0078, 0x75b8, 0x6b52, 0x1078, 0x3b4c, 0x0f7f,
- 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7e00, 0x2071,
- 0x7700, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x75f2, 0x2100,
- 0xac06, 0x0040, 0x75e4, 0x6000, 0xa086, 0x0000, 0x0040, 0x75e4,
- 0x6008, 0xa206, 0x0040, 0x75ee, 0xace0, 0x0008, 0x2001, 0x7715,
- 0x2004, 0xac02, 0x00c8, 0x75f2, 0x0078, 0x75cf, 0xa085, 0x0001,
- 0x0078, 0x75f3, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c, 0x0d7e,
- 0x007e, 0x1078, 0x132f, 0x007f, 0x1040, 0x12d5, 0x6837, 0x010d,
- 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e, 0x6956,
- 0x6c46, 0x684f, 0x0000, 0x1078, 0x3b4c, 0x0d7f, 0x007c, 0x6700,
- 0xa786, 0x0000, 0x0040, 0x7622, 0xa786, 0x0001, 0x0040, 0x7622,
- 0xa786, 0x000a, 0x0040, 0x7622, 0xa786, 0x0009, 0x0040, 0x7622,
- 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0, 0xa206,
- 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071,
- 0x7740, 0xd5a4, 0x0040, 0x7637, 0x7034, 0x8000, 0x7036, 0xd5b4,
- 0x0040, 0x763d, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x7644,
- 0x2071, 0x774a, 0x1078, 0x7673, 0x0e7f, 0x007f, 0x127f, 0x007c,
- 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7740, 0xd5a4,
- 0x0040, 0x7655, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040, 0x765b,
- 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x7662, 0x2071, 0x774a,
- 0x1078, 0x7673, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e, 0x007e,
- 0x0e7e, 0x2091, 0x8000, 0x2071, 0x7742, 0x1078, 0x7673, 0x0e7f,
- 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8, 0x767c,
- 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071, 0x7740,
- 0x1078, 0x7673, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x7744, 0x1078,
- 0x7673, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010,
- 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000,
- 0x2000, 0x4000, 0x8000, 0xb2be
+ 0x2011, 0x7383, 0x2204, 0x1078, 0x1fb0, 0x1078, 0x3497, 0x00c0,
+ 0x6bc3, 0x2011, 0x7396, 0xac98, 0x000a, 0x20a9, 0x0004, 0x1078,
+ 0x5a15, 0x00c0, 0x6bc3, 0x2011, 0x739a, 0xac98, 0x0006, 0x20a9,
+ 0x0004, 0x1078, 0x5a15, 0x157f, 0x037f, 0x027f, 0x017f, 0x007f,
+ 0x0c7f, 0x007c, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x057e, 0x047e,
+ 0x027e, 0x127e, 0x2091, 0x8000, 0x2029, 0x70bf, 0x252c, 0x2021,
+ 0x70c5, 0x2424, 0x2061, 0x7500, 0x2071, 0x6f00, 0x7644, 0x7060,
+ 0x8001, 0xa602, 0x00c8, 0x6c2f, 0x2100, 0xac06, 0x0040, 0x6c25,
+ 0x1078, 0x6da8, 0x0040, 0x6c25, 0x671c, 0xa786, 0x0001, 0x0040,
+ 0x6c44, 0xa786, 0x0007, 0x0040, 0x6c25, 0x2500, 0xac06, 0x0040,
+ 0x6c25, 0x2400, 0xac06, 0x0040, 0x6c25, 0x1078, 0x6dbc, 0x00c0,
+ 0x6c25, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6c0b, 0x017e,
+ 0x1078, 0x1627, 0x017f, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040,
+ 0x6c22, 0xa786, 0x0003, 0x00c0, 0x6c38, 0x6837, 0x0103, 0x6b4a,
+ 0x6847, 0x0000, 0x017e, 0x1078, 0x639b, 0x1078, 0x36ec, 0x017f,
+ 0x1078, 0x62f0, 0x0d7f, 0x1078, 0x62fd, 0xace0, 0x0008, 0x2001,
+ 0x6f15, 0x2004, 0xac02, 0x00c8, 0x6c2f, 0x0078, 0x6bdc, 0x127f,
+ 0x027f, 0x047f, 0x057f, 0x067f, 0x077f, 0x0c7f, 0x0e7f, 0x007c,
+ 0xa786, 0x0006, 0x00c0, 0x6c15, 0xa386, 0x0005, 0x0040, 0x6c25,
+ 0x1078, 0x6d4c, 0x0078, 0x6c22, 0x1078, 0x6dbc, 0x00c0, 0x6c25,
+ 0xa180, 0x0001, 0x2004, 0xa086, 0x0018, 0x00c0, 0x6c25, 0x6000,
+ 0xa086, 0x0002, 0x00c0, 0x6c25, 0x1078, 0x6316, 0x0040, 0x6c60,
+ 0x1078, 0x632a, 0x00c0, 0x6c25, 0x1078, 0x579c, 0x0078, 0x6c62,
+ 0x1078, 0x2192, 0x1078, 0x62fd, 0x0078, 0x6c25, 0x0c7e, 0x0e7e,
+ 0x017e, 0x2c08, 0x2170, 0x1078, 0x6d63, 0x017f, 0x0040, 0x6c75,
+ 0x601c, 0xa084, 0x0007, 0x1079, 0x6c78, 0x0e7f, 0x0c7f, 0x007c,
+ 0x6c80, 0x6c80, 0x6c80, 0x6c80, 0x6c80, 0x6c80, 0x6c82, 0x6c80,
+ 0xa006, 0x007c, 0x047e, 0x017e, 0x7018, 0xa080, 0x0028, 0x2024,
+ 0xa4a4, 0x00ff, 0x8427, 0x2c00, 0x2009, 0x0020, 0x1078, 0x6d90,
+ 0x017f, 0x047f, 0x037e, 0x2019, 0x0002, 0x1078, 0x6a39, 0x037f,
+ 0xa085, 0x0001, 0x007c, 0x2001, 0x0001, 0x1078, 0x342f, 0x157e,
+ 0x017e, 0x027e, 0x037e, 0x20a9, 0x0004, 0x2019, 0x6f05, 0x2011,
+ 0x7396, 0x1078, 0x5a15, 0x037f, 0x027f, 0x017f, 0x157f, 0xa005,
+ 0x007c, 0x0f7e, 0x0e7e, 0x0c7e, 0x077e, 0x067e, 0x027e, 0x127e,
+ 0x2091, 0x8000, 0x2061, 0x7500, 0x2079, 0x0001, 0x8fff, 0x0040,
+ 0x6d0c, 0x2071, 0x6f00, 0x7644, 0x7060, 0x8001, 0xa602, 0x00c8,
+ 0x6d0c, 0x88ff, 0x0040, 0x6cd2, 0x2800, 0xac06, 0x00c0, 0x6d02,
+ 0x2079, 0x0000, 0x1078, 0x6da8, 0x0040, 0x6d02, 0x2400, 0xac06,
+ 0x0040, 0x6d02, 0x671c, 0xa786, 0x0006, 0x00c0, 0x6d02, 0xa786,
+ 0x0007, 0x0040, 0x6d02, 0x88ff, 0x00c0, 0x6cea, 0x6018, 0xa206,
+ 0x00c0, 0x6d02, 0x0d7e, 0x6000, 0xa086, 0x0004, 0x00c0, 0x6cf2,
+ 0x1078, 0x1627, 0x6010, 0x2068, 0x1078, 0x61dc, 0x0040, 0x6cfc,
+ 0x047e, 0x1078, 0x6d4c, 0x047f, 0x0d7f, 0x1078, 0x62fd, 0x88ff,
+ 0x00c0, 0x6d15, 0xace0, 0x0008, 0x2001, 0x6f15, 0x2004, 0xac02,
+ 0x00c8, 0x6d0c, 0x0078, 0x6cbe, 0xa006, 0x127f, 0x027f, 0x067f,
+ 0x077f, 0x0c7f, 0x0e7f, 0x0f7f, 0x007c, 0xa8c5, 0x0001, 0x0078,
+ 0x6d0d, 0x087e, 0x2041, 0x0000, 0x2c20, 0x2019, 0x0002, 0x6218,
+ 0x1078, 0x52b4, 0x1078, 0x5355, 0x1078, 0x6cb1, 0x087f, 0x007c,
+ 0x027e, 0x047e, 0x087e, 0x0c7e, 0x157e, 0x2c20, 0x20a9, 0x007e,
+ 0x2009, 0x0000, 0x017e, 0x037e, 0x1078, 0x3497, 0x00c0, 0x6d41,
+ 0x2c10, 0x2041, 0x0000, 0x1078, 0x52b4, 0x1078, 0x5355, 0x1078,
+ 0x6cb1, 0x037f, 0x017f, 0x8108, 0x00f0, 0x6d32, 0x157f, 0x0c7f,
+ 0x087f, 0x047f, 0x027f, 0x007c, 0x017e, 0x0f7e, 0x8dff, 0x0040,
+ 0x6d60, 0x6800, 0xa07d, 0x0040, 0x6d5d, 0x6803, 0x0000, 0x6b52,
+ 0x1078, 0x36ec, 0x2f68, 0x0078, 0x6d51, 0x6b52, 0x1078, 0x36ec,
+ 0x0f7f, 0x017f, 0x007c, 0x0e7e, 0x047e, 0x037e, 0x2061, 0x7500,
+ 0x2071, 0x6f00, 0x7444, 0x7060, 0x8001, 0xa402, 0x00c8, 0x6d8b,
+ 0x2100, 0xac06, 0x0040, 0x6d7d, 0x6000, 0xa086, 0x0000, 0x0040,
+ 0x6d7d, 0x6008, 0xa206, 0x0040, 0x6d87, 0xace0, 0x0008, 0x2001,
+ 0x6f15, 0x2004, 0xac02, 0x00c8, 0x6d8b, 0x0078, 0x6d68, 0xa085,
+ 0x0001, 0x0078, 0x6d8c, 0xa006, 0x037f, 0x047f, 0x0e7f, 0x007c,
+ 0x0d7e, 0x007e, 0x1078, 0x12e0, 0x007f, 0x1040, 0x1286, 0x6837,
+ 0x010d, 0x6803, 0x0000, 0x683b, 0x0000, 0x685b, 0x0000, 0x685e,
+ 0x6956, 0x6c46, 0x684f, 0x0000, 0x1078, 0x36ec, 0x0d7f, 0x007c,
+ 0x6700, 0xa786, 0x0000, 0x0040, 0x6dbb, 0xa786, 0x0001, 0x0040,
+ 0x6dbb, 0xa786, 0x000a, 0x0040, 0x6dbb, 0xa786, 0x0009, 0x0040,
+ 0x6dbb, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x6018, 0x2070, 0x70a0,
+ 0xa206, 0x0e7f, 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000,
+ 0x2071, 0x6f40, 0xd5a4, 0x0040, 0x6dd0, 0x7034, 0x8000, 0x7036,
+ 0xd5b4, 0x0040, 0x6dd6, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040,
+ 0x6ddd, 0x2071, 0x6f4a, 0x1078, 0x6e0c, 0x0e7f, 0x007f, 0x127f,
+ 0x007c, 0x127e, 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6f40,
+ 0xd5a4, 0x0040, 0x6dee, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0040,
+ 0x6df4, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0040, 0x6dfb, 0x2071,
+ 0x6f4a, 0x1078, 0x6e0c, 0x0e7f, 0x007f, 0x127f, 0x007c, 0x127e,
+ 0x007e, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x6f42, 0x1078, 0x6e0c,
+ 0x0e7f, 0x007f, 0x127f, 0x007c, 0x2e04, 0x8000, 0x2072, 0x00c8,
+ 0x6e15, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x007c, 0x0e7e, 0x2071,
+ 0x6f40, 0x1078, 0x6e0c, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x6f44,
+ 0x1078, 0x6e0c, 0x0e7f, 0x007c, 0x0001, 0x0002, 0x0004, 0x0008,
+ 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800,
+ 0x1000, 0x2000, 0x4000, 0x8000, 0x40d5
};
-#define ISP2100_CODE_LENGTH 0x669c
+#define ISP2100_CODE_LENGTH 0x5e35
#endif
diff --git a/sys/dev/isp/asm_sbus.h b/sys/dev/isp/asm_sbus.h
index b5df5f5d2403d..d81f3b9e4d849 100644
--- a/sys/dev/isp/asm_sbus.h
+++ b/sys/dev/isp/asm_sbus.h
@@ -1,14 +1,45 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: asm_sbus.h,v 1.2 1998/04/14 17:43:24 mjacob Exp $ */
/*
* SBus Qlogic Host Adapter Firmware Tables
- * Copyright (c) 1996, 1997, 1998 by Qlogic Corporation
*
+ *---------------------------------------
+ * Copyright (c) 1997, 1998 by Matthew Jacob
+ * NASA/Ames Research Center
+ * All rights reserved.
+ *---------------------------------------
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice immediately at the beginning of the file, without modification,
+ * this list of conditions, and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
* Version 1.24 Initiator Firmware (Aug 8, 1996)
+ *
+ * [from Qlogic]
*/
#define ISP_CODE_ORG 0x1000
-#if 0
#define ISP_CODE_VERSION 1*1024+24
static const u_int16_t ISP_RISC_CODE[] = {
0x0078, 0x1030, 0x0000, 0x231f, 0x0000, 0x12ff, 0x2043, 0x4f50,
@@ -1137,1169 +1168,3 @@ static const u_int16_t ISP_RISC_CODE[] = {
0x331b, 0x2019, 0x2626, 0x7b22, 0x7b26, 0x007c, 0xae5b
};
#define ISP_CODE_LENGTH 0x231f
-#endif
-#if 1
-/*
- * Version 1.31.00 ISP1000 Initiator RISC firmware
- */
-#define ISP_CODE_VERSION 1*1024+31
-static const u_int16_t ISP_RISC_CODE[] = {
- 0x0078, 0x1030, 0xa5e3, 0x241a, 0x0001, 0x12ff, 0x2043, 0x4f50,
- 0x5952, 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932,
- 0x2c31, 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749,
- 0x4320, 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049,
- 0x5350, 0x3130, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520,
- 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3331, 0x2020,
- 0x2071, 0x0010, 0x70c3, 0x0004, 0x20c9, 0x3fff, 0x2089, 0x10ca,
- 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0001,
- 0x3f00, 0x70d6, 0x2031, 0x0030, 0x2079, 0x3500, 0x7863, 0x0000,
- 0x2fa0, 0x2009, 0x012b, 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4,
- 0x8109, 0x00c0, 0x104d, 0x789b, 0x0101, 0x780b, 0x0002, 0x780f,
- 0x0002, 0x784f, 0x0bb8, 0x2069, 0x3540, 0x00a8, 0x106c, 0x681b,
- 0x003c, 0x2009, 0x1313, 0xa18c, 0xff00, 0x3700, 0xa084, 0x00ff,
- 0xa105, 0x20b8, 0x0078, 0x106e, 0x681b, 0x0028, 0x6807, 0x0007,
- 0x680b, 0x00fa, 0x680f, 0x0008, 0x6813, 0x0005, 0x681f, 0x0000,
- 0x6823, 0x0006, 0x6817, 0x0008, 0x6827, 0x0000, 0x2069, 0x3600,
- 0x2011, 0x0020, 0x2009, 0x0010, 0x680b, 0x0c19, 0x680f, 0x0019,
- 0x6803, 0xdd00, 0x6807, 0x001a, 0x6a1a, 0x2d00, 0xa0e8, 0x0008,
- 0xa290, 0x0004, 0x8109, 0x00c0, 0x1084, 0x2069, 0x3680, 0x20a9,
- 0x0080, 0x6837, 0x0000, 0x680b, 0x0040, 0x6817, 0x0064, 0x681f,
- 0x0002, 0xade8, 0x0010, 0x0070, 0x10a7, 0x0078, 0x1099, 0x1078,
- 0x1a42, 0x1078, 0x2f3d, 0x1078, 0x168b, 0x1078, 0x33bb, 0x3200,
- 0xa085, 0x000d, 0x2090, 0x70c3, 0x0000, 0x0090, 0x10be, 0x70c0,
- 0xa086, 0x0002, 0x00c0, 0x10be, 0x1078, 0x11be, 0x1078, 0x10ee,
- 0x1078, 0x1821, 0x1078, 0x19b2, 0x1078, 0x3280, 0x1078, 0x1787,
- 0x0078, 0x10be, 0x10d2, 0x10d4, 0x1b9f, 0x1b9f, 0x2f9b, 0x2f9b,
- 0x1b9f, 0x1b9f, 0x0078, 0x10d2, 0x0078, 0x10d4, 0x0078, 0x10d6,
- 0x0078, 0x10d8, 0x7008, 0x800c, 0x00c8, 0x10e9, 0x7007, 0x0002,
- 0xa08c, 0x000c, 0x00c0, 0x10ea, 0x8004, 0x8004, 0x00c8, 0x10e9,
- 0x087a, 0x097a, 0x70c3, 0x4002, 0x0078, 0x11c1, 0x0068, 0x1133,
- 0x7814, 0xa005, 0x00c0, 0x10f8, 0x0010, 0x1134, 0x0078, 0x1133,
- 0x2009, 0x3568, 0x2104, 0xa005, 0x00c0, 0x1133, 0x7814, 0xa086,
- 0x0001, 0x00c0, 0x1105, 0x1078, 0x1540, 0x7817, 0x0000, 0x2009,
- 0x356f, 0x2104, 0xa065, 0x0040, 0x1121, 0x2009, 0x356a, 0x211c,
- 0x8108, 0x2114, 0x8108, 0x2104, 0xa210, 0xa399, 0x0000, 0x2009,
- 0x001c, 0x6083, 0x0103, 0x1078, 0x161b, 0x00c0, 0x112d, 0x1078,
- 0x1682, 0x2009, 0x356f, 0x200b, 0x0000, 0x2009, 0x3569, 0x2104,
- 0x200b, 0x0000, 0xa005, 0x0040, 0x1131, 0x2001, 0x4005, 0x0078,
- 0x11c0, 0x0078, 0x11be, 0x007c, 0x2061, 0x0000, 0x6018, 0xa084,
- 0x0001, 0x0040, 0x113c, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000,
- 0x70cb, 0x0000, 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0,
- 0x118c, 0x2038, 0x0079, 0x114c, 0x11be, 0x1209, 0x11d7, 0x1209,
- 0x125a, 0x125a, 0x11ce, 0x159a, 0x1265, 0x11ca, 0x11db, 0x11dd,
- 0x11df, 0x11e1, 0x159f, 0x11ca, 0x126b, 0x1287, 0x154e, 0x1594,
- 0x11e3, 0x1475, 0x1497, 0x14b1, 0x14da, 0x142e, 0x143c, 0x1450,
- 0x1464, 0x12f3, 0x11ca, 0x12a3, 0x12aa, 0x12af, 0x12b4, 0x12ba,
- 0x12bf, 0x12c4, 0x12c9, 0x12ce, 0x12d2, 0x12e7, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x12ff, 0x1308, 0x1317, 0x133d, 0x1347,
- 0x134e, 0x137a, 0x1389, 0x1398, 0x13aa, 0x1413, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x1423, 0xa0bc, 0xffa0, 0x00c0, 0x11ca,
- 0x2038, 0xa084, 0x001f, 0x0079, 0x1195, 0x11ca, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca,
- 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x11ca, 0x15f7,
- 0x1601, 0x1605, 0x1613, 0x11ca, 0x11ca, 0x72ca, 0x71c6, 0x2001,
- 0x4006, 0x0078, 0x11c0, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000,
- 0x70c2, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x2091,
- 0x4080, 0x007c, 0x70c3, 0x4001, 0x0078, 0x11c1, 0x2099, 0x0041,
- 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0078, 0x11be, 0x70c4,
- 0x70c3, 0x0004, 0x007a, 0x0078, 0x11be, 0x0078, 0x11be, 0x0078,
- 0x11be, 0x0078, 0x11be, 0x2091, 0x8000, 0x70c3, 0x0000, 0x70c7,
- 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0001, 0x3f00,
- 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031, 0x0030, 0x2059,
- 0x1000, 0x2029, 0x0457, 0x2051, 0x0470, 0x2061, 0x0472, 0x20b9,
- 0xffff, 0x20c1, 0x0000, 0x2091, 0x5000, 0x2091, 0x4080, 0x0078,
- 0x0455, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, 0x2098, 0x2031,
- 0x0030, 0x81ff, 0x0040, 0x11be, 0x7007, 0x0004, 0x731a, 0x721e,
- 0x2051, 0x0012, 0x2049, 0x1238, 0x2041, 0x11be, 0x7003, 0x0002,
- 0xa786, 0x0001, 0x00c0, 0x122a, 0x2049, 0x1246, 0x2041, 0x1252,
- 0x7003, 0x0003, 0x7017, 0x0000, 0x810b, 0x7112, 0x00c8, 0x1232,
- 0x7017, 0x0001, 0x7007, 0x0001, 0xa786, 0x0001, 0x0040, 0x1246,
- 0x700c, 0xa084, 0x007f, 0x8004, 0x2009, 0x0020, 0xa102, 0x0942,
- 0x094a, 0x20a8, 0x26a0, 0x53a6, 0x0078, 0x10da, 0x700c, 0xa084,
- 0x007f, 0x0040, 0x1246, 0x80ac, 0x0048, 0x1246, 0x2698, 0x53a5,
- 0x0078, 0x10da, 0x700c, 0xa084, 0x007f, 0x80ac, 0x2698, 0x53a5,
- 0x0078, 0x11be, 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0,
- 0x1262, 0x200a, 0x72ca, 0x0078, 0x11bd, 0x70c7, 0x0001, 0x70cb,
- 0x001f, 0x0078, 0x11be, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6,
- 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x1281, 0x8001, 0x7872,
- 0x7a7a, 0x7b7e, 0x7c76, 0x7898, 0xa084, 0xfffc, 0x789a, 0x0078,
- 0x1285, 0x7898, 0xa085, 0x0001, 0x789a, 0x0078, 0x11be, 0x70c4,
- 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, 0x74d6, 0xa005,
- 0x0040, 0x129d, 0x8001, 0x7886, 0x7a8e, 0x7b92, 0x7c8a, 0x7898,
- 0xa084, 0xfcff, 0x789a, 0x0078, 0x12a1, 0x7898, 0xa085, 0x0100,
- 0x789a, 0x0078, 0x11be, 0x2009, 0x3559, 0x210c, 0x2011, 0x015c,
- 0x0078, 0x11bc, 0x2009, 0x3541, 0x210c, 0x0078, 0x11bd, 0x2009,
- 0x3542, 0x210c, 0x0078, 0x11bd, 0x2061, 0x3540, 0x610c, 0x6210,
- 0x0078, 0x11bc, 0x2009, 0x3545, 0x210c, 0x0078, 0x11bd, 0x2009,
- 0x3546, 0x210c, 0x0078, 0x11bd, 0x2009, 0x3547, 0x210c, 0x0078,
- 0x11bd, 0x2009, 0x3548, 0x210c, 0x0078, 0x11bd, 0x7908, 0x7a0c,
- 0x0078, 0x11bc, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003,
- 0x8003, 0xa0e8, 0x3600, 0x6a00, 0x6804, 0xa084, 0x0008, 0x0040,
- 0x12e4, 0x6b08, 0x0078, 0x12e5, 0x6b0c, 0x0078, 0x11bb, 0x77c4,
- 0x1078, 0x169c, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001,
- 0x2708, 0x0078, 0x11bb, 0x77c4, 0x1078, 0x169c, 0x2091, 0x8000,
- 0x6908, 0x6a18, 0x6b10, 0x2091, 0x8001, 0x0078, 0x11bb, 0x71c4,
- 0xa182, 0x0010, 0x00c8, 0x11b6, 0x1078, 0x1ac6, 0x0078, 0x11bb,
- 0x71c4, 0xa182, 0x0010, 0x00c8, 0x11b6, 0x2011, 0x3541, 0x2204,
- 0x007e, 0x2112, 0x1078, 0x1a7f, 0x017f, 0x0078, 0x11bd, 0x71c4,
- 0x2011, 0x1335, 0x20a9, 0x0008, 0x2204, 0xa106, 0x0040, 0x1327,
- 0x8210, 0x0070, 0x1325, 0x0078, 0x131c, 0x0078, 0x11b6, 0xa292,
- 0x1335, 0x027e, 0x2011, 0x3542, 0x2204, 0x2112, 0x017f, 0x007e,
- 0x1078, 0x1a8b, 0x017f, 0x0078, 0x11bd, 0x03e8, 0x00fa, 0x01f4,
- 0x02ee, 0x0064, 0x0019, 0x0032, 0x004b, 0x2061, 0x3540, 0x610c,
- 0x6210, 0x70c4, 0x600e, 0x70c8, 0x6012, 0x0078, 0x11bc, 0x2061,
- 0x3540, 0x6114, 0x70c4, 0x6016, 0x0078, 0x11bd, 0x71c4, 0x2011,
- 0x0004, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x1367, 0x2011,
- 0x0005, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040, 0x1367, 0x2011,
- 0x0006, 0x2019, 0x1313, 0xa186, 0x003c, 0x00c0, 0x11b6, 0x2061,
- 0x3540, 0x6018, 0x007e, 0x611a, 0xa39c, 0xff00, 0x3700, 0xa084,
- 0x00ff, 0xa305, 0x20b8, 0x1078, 0x1a9c, 0x1078, 0x33bb, 0x017f,
- 0x0078, 0x11bd, 0x71c4, 0xa184, 0xffcf, 0x00c0, 0x11b6, 0x2011,
- 0x3547, 0x2204, 0x2112, 0x007e, 0x1078, 0x1abe, 0x017f, 0x0078,
- 0x11bd, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x11b6, 0x2011, 0x3548,
- 0x2204, 0x007e, 0x2112, 0x1078, 0x1aad, 0x017f, 0x0078, 0x11bd,
- 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x11b5, 0xa284, 0xfffd,
- 0x00c0, 0x11b5, 0x2100, 0x7908, 0x780a, 0x2200, 0x7a0c, 0x780e,
- 0x0078, 0x11bc, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003,
- 0x8003, 0xa0e8, 0x3600, 0x2019, 0x0000, 0x72c8, 0x6800, 0x007e,
- 0xa226, 0x0040, 0x13d9, 0x6a02, 0xa484, 0x2000, 0x0040, 0x13c2,
- 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x13c8, 0xa39d, 0x0008,
- 0xa484, 0x4000, 0x0040, 0x13d9, 0x810f, 0xa284, 0x4000, 0x0040,
- 0x13d5, 0x1078, 0x1ae0, 0x0078, 0x13d9, 0x1078, 0x1ad2, 0x0078,
- 0x13d9, 0x72cc, 0x82ff, 0x0040, 0x140b, 0x6808, 0xa206, 0x0040,
- 0x140b, 0xa2a4, 0x00ff, 0x2061, 0x3540, 0x6118, 0xa186, 0x0028,
- 0x0040, 0x13f2, 0xa186, 0x0032, 0x0040, 0x13f8, 0xa186, 0x003c,
- 0x0040, 0x13fe, 0xa482, 0x0064, 0x0048, 0x1408, 0x0078, 0x1402,
- 0xa482, 0x0050, 0x0048, 0x1408, 0x0078, 0x1402, 0xa482, 0x0043,
- 0x0048, 0x1408, 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x0078, 0x11b7,
- 0x6a0a, 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c,
- 0x71c4, 0x0078, 0x11bb, 0x77c4, 0x1078, 0x169c, 0x2091, 0x8000,
- 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e,
- 0x2708, 0x0078, 0x11bb, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010,
- 0x00c8, 0x11b6, 0x1078, 0x1aee, 0x0078, 0x11bb, 0x77c4, 0x1078,
- 0x169c, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0002, 0x6a0a, 0x2091,
- 0x8001, 0x2708, 0x0078, 0x11bc, 0x77c4, 0x1078, 0x169c, 0x2091,
- 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0040,
- 0x144b, 0x1078, 0x1a23, 0x2091, 0x8001, 0x2708, 0x0078, 0x11bc,
- 0x77c4, 0x1078, 0x169c, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0004,
- 0x6a0a, 0x6804, 0xa005, 0x0040, 0x145f, 0x1078, 0x1a23, 0x2091,
- 0x8001, 0x2708, 0x0078, 0x11bc, 0x77c4, 0x2041, 0x0001, 0x2049,
- 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, 0x16a9, 0x2091,
- 0x8001, 0x2708, 0x6a08, 0x0078, 0x11bc, 0x77c4, 0x72c8, 0x73cc,
- 0x77c6, 0x72ca, 0x73ce, 0x1078, 0x1722, 0x00c0, 0x1493, 0x6818,
- 0xa005, 0x0040, 0x148d, 0x2708, 0x1078, 0x1afe, 0x00c0, 0x148d,
- 0x7817, 0xffff, 0x2091, 0x8001, 0x007c, 0x2091, 0x8001, 0x2001,
- 0x4005, 0x0078, 0x11c0, 0x2091, 0x8001, 0x0078, 0x11be, 0x77c4,
- 0x77c6, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091,
- 0x8000, 0x1078, 0x16a9, 0x2061, 0x3540, 0x60a3, 0x0003, 0x67b6,
- 0x60a7, 0x0000, 0x7817, 0xffff, 0x2091, 0x8001, 0x1078, 0x1a23,
- 0x007c, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2091,
- 0x8000, 0x2061, 0x3540, 0x60a3, 0x0002, 0x60a7, 0x0000, 0x67b6,
- 0x7817, 0xffff, 0x1078, 0x1a23, 0x2091, 0x8001, 0x2041, 0x0021,
- 0x2049, 0x0004, 0x2051, 0x0010, 0x2091, 0x8000, 0x1078, 0x16a9,
- 0x70c8, 0x6836, 0x8738, 0xa784, 0x0007, 0x00c0, 0x14ce, 0x2091,
- 0x8001, 0x007c, 0x7898, 0xa084, 0x0003, 0x00c0, 0x14fe, 0x2039,
- 0x0000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x1078,
- 0x169c, 0x2091, 0x8000, 0x6808, 0xa80d, 0x690a, 0x2091, 0x8001,
- 0x8738, 0xa784, 0x0007, 0x00c0, 0x14e7, 0xa7bc, 0xff00, 0x873f,
- 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x14e7, 0x2091, 0x8000,
- 0x2069, 0x0100, 0x6830, 0xa084, 0x0040, 0x0040, 0x1527, 0x684b,
- 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004, 0x0040, 0x1514,
- 0x0070, 0x1514, 0x0078, 0x150b, 0x684b, 0x0009, 0x20a9, 0x0014,
- 0x6848, 0xa084, 0x0001, 0x0040, 0x1521, 0x0070, 0x1521, 0x0078,
- 0x1518, 0x20a9, 0x00fa, 0x0070, 0x1527, 0x0078, 0x1523, 0x2079,
- 0x3500, 0x7817, 0x0001, 0x2061, 0x3540, 0x60a3, 0x0001, 0x60a7,
- 0x0000, 0x60c3, 0x000f, 0x7898, 0xa085, 0x0002, 0x789a, 0x6808,
- 0xa084, 0xfffd, 0x680a, 0x681b, 0x0046, 0x2091, 0x8001, 0x007c,
- 0x7898, 0xa084, 0xfffd, 0x789a, 0xa084, 0x0001, 0x00c0, 0x154a,
- 0x1078, 0x176a, 0x71c4, 0x71c6, 0x794a, 0x007c, 0x74c4, 0x73c8,
- 0x72cc, 0x74c6, 0x73ca, 0x72ce, 0x2079, 0x3500, 0x2009, 0x0040,
- 0x1078, 0x1679, 0x0040, 0x1590, 0x1078, 0x1649, 0x0040, 0x1564,
- 0x1078, 0x1682, 0x0078, 0x1590, 0x6010, 0x2091, 0x8001, 0x7817,
- 0xffff, 0x2009, 0x3568, 0x200b, 0x0005, 0x8108, 0x200b, 0x0000,
- 0x8108, 0x230a, 0x8108, 0x220a, 0x8108, 0x240a, 0x8108, 0x200a,
- 0x8108, 0x200b, 0x0000, 0x8108, 0x2c0a, 0xa02e, 0x2530, 0x0e7e,
- 0x1078, 0x2f16, 0x0e7f, 0x6592, 0x65a2, 0x6696, 0x66a6, 0x60ab,
- 0x0000, 0x60af, 0x0000, 0x2091, 0x8001, 0x1078, 0x1a23, 0x007c,
- 0x70c3, 0x4005, 0x0078, 0x11c1, 0x71c4, 0x70c7, 0x0000, 0x7906,
- 0x0078, 0x11be, 0x71c4, 0x71c6, 0x2168, 0x0078, 0x15a1, 0x2069,
- 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x00c0,
- 0x15a3, 0xa285, 0x0000, 0x00c0, 0x15b1, 0x70c3, 0x4000, 0x0078,
- 0x15b3, 0x70c3, 0x4003, 0x70ca, 0x0078, 0x11c1, 0x71c4, 0x72c8,
- 0x73cc, 0x2100, 0xa184, 0xfffc, 0x00c0, 0x11ca, 0x2100, 0x0079,
- 0x15c1, 0x15d8, 0x15ed, 0x15ef, 0x15f1, 0x70c3, 0x4003, 0x71ce,
- 0x72d2, 0x73d6, 0x0078, 0x15d4, 0x70c3, 0x4000, 0x70cf, 0x0000,
- 0x70d3, 0x0000, 0x70d7, 0x0000, 0x77c6, 0x71ca, 0x0078, 0x11be,
- 0x2031, 0x15f3, 0x2624, 0x8630, 0x2412, 0x2204, 0xa446, 0x00c0,
- 0x15c5, 0xa484, 0xffff, 0x00c0, 0x15da, 0x2031, 0x15f3, 0x8210,
- 0x8319, 0xa384, 0xffff, 0x00c0, 0x15da, 0x0078, 0x15cc, 0x0078,
- 0x15cc, 0x0078, 0x15cc, 0x5555, 0xaaaa, 0xffff, 0x0000, 0x7960,
- 0x71c6, 0x71c4, 0xa182, 0x0003, 0x00c8, 0x11b6, 0x7962, 0x0078,
- 0x11be, 0x7960, 0x71c6, 0x0078, 0x11be, 0x7954, 0x71c6, 0x71c4,
- 0x7956, 0x7958, 0x71ca, 0x71c8, 0x795a, 0x795c, 0x71ce, 0x71cc,
- 0x795e, 0x0078, 0x11be, 0x7954, 0x71c6, 0x7958, 0x71ca, 0x795c,
- 0x71ce, 0x0078, 0x11be, 0x700c, 0xa084, 0x007f, 0x0040, 0x1627,
- 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x1622, 0x7017,
- 0x0000, 0x7112, 0x721a, 0x731e, 0x8108, 0x810c, 0x81a9, 0x8c98,
- 0x20a1, 0x0030, 0x6080, 0x20a2, 0x53a6, 0x780c, 0xa085, 0x0000,
- 0x7002, 0x7007, 0x0001, 0x7108, 0x8104, 0x00c8, 0x163b, 0x7007,
- 0x0002, 0xa184, 0x000c, 0x710c, 0xa184, 0x0300, 0x7003, 0x0000,
- 0x007c, 0x700c, 0xa084, 0x007f, 0x0040, 0x1655, 0x7007, 0x0004,
- 0x7004, 0xa084, 0x0004, 0x00c0, 0x1650, 0x7017, 0x0000, 0x7112,
- 0x721a, 0x731e, 0x2099, 0x0030, 0x8108, 0x81ac, 0x780c, 0xa085,
- 0x0001, 0x7002, 0x7007, 0x0001, 0x7008, 0x800c, 0x00c8, 0x1664,
- 0x7007, 0x0002, 0xa08c, 0x000c, 0x00c0, 0x1676, 0x710c, 0xa184,
- 0x0300, 0x00c0, 0x1676, 0x2ca0, 0x53a5, 0xa006, 0x7003, 0x0000,
- 0x007c, 0x7850, 0xa065, 0x0040, 0x1681, 0x2c04, 0x7852, 0x2063,
- 0x0000, 0x007c, 0x0f7e, 0x2079, 0x3500, 0x7850, 0x2062, 0x2c00,
- 0x7852, 0x0f7f, 0x007c, 0x2011, 0x4000, 0x7a52, 0x2019, 0x015c,
- 0x8319, 0x0040, 0x1699, 0xa280, 0x002f, 0x2012, 0x2010, 0x0078,
- 0x1690, 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784,
- 0x0007, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e8, 0x3680,
- 0x007c, 0x1078, 0x169c, 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808,
- 0xa084, 0xffef, 0xa80d, 0x690a, 0x2009, 0x354f, 0x210c, 0x6804,
- 0xa005, 0x0040, 0x16c6, 0xa116, 0x00c0, 0x16c6, 0x2060, 0x6000,
- 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x16c9, 0x2009, 0x0000,
- 0x017e, 0x6804, 0xa065, 0x0040, 0x16d8, 0x6000, 0x6806, 0x1078,
- 0x16e9, 0x1078, 0x17d5, 0x6810, 0x8001, 0x6812, 0x00c0, 0x16c9,
- 0x017f, 0x6902, 0x6906, 0x007c, 0xa065, 0x0040, 0x16e8, 0x6098,
- 0x609b, 0x0000, 0x2008, 0x1078, 0x1682, 0x2100, 0x0078, 0x16dc,
- 0x007c, 0x6003, 0x0103, 0x20a9, 0x001c, 0xac80, 0x0004, 0x20a0,
- 0x2001, 0x0000, 0x40a4, 0x6828, 0x6016, 0x682c, 0x601e, 0x007c,
- 0x0e7e, 0x2071, 0x3540, 0x7040, 0xa08c, 0x0080, 0x00c0, 0x1706,
- 0xa088, 0x3580, 0x2d0a, 0x8000, 0x7042, 0xa006, 0x0e7f, 0x007c,
- 0x0e7e, 0x2071, 0x3540, 0x2009, 0x3580, 0x7240, 0x8221, 0x8211,
- 0x0048, 0x1720, 0x2104, 0x8108, 0xad06, 0x00c0, 0x170f, 0x8119,
- 0x211e, 0x8108, 0x8318, 0x8211, 0x00c8, 0x1718, 0x7442, 0xa006,
- 0x0e7f, 0x007c, 0x1078, 0x169c, 0x2091, 0x8000, 0x6804, 0x781e,
- 0xa065, 0x0040, 0x1769, 0x0078, 0x1733, 0x2c00, 0x781e, 0x6000,
- 0xa065, 0x0040, 0x1769, 0x600c, 0xa306, 0x00c0, 0x172d, 0x6008,
- 0xa206, 0x00c0, 0x172d, 0x2c28, 0x2001, 0x354f, 0x2004, 0xac06,
- 0x0040, 0x1769, 0x6804, 0xac06, 0x00c0, 0x1750, 0x6000, 0x2060,
- 0x6806, 0xa005, 0x00c0, 0x1750, 0x6803, 0x0000, 0x0078, 0x175a,
- 0x6400, 0x781c, 0x2060, 0x6402, 0xa486, 0x0000, 0x00c0, 0x175a,
- 0x2c00, 0x6802, 0x2560, 0x1078, 0x16e9, 0x6017, 0x0005, 0x601f,
- 0x0020, 0x1078, 0x17d5, 0x6810, 0x8001, 0x6812, 0x2001, 0xffff,
- 0xa005, 0x007c, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049, 0x0004,
- 0x2051, 0x0008, 0x2091, 0x8000, 0x1078, 0x16a9, 0x8738, 0xa784,
- 0x0007, 0x00c0, 0x1774, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f,
- 0xa784, 0x0f00, 0x00c0, 0x1774, 0x2091, 0x8001, 0x007c, 0x2061,
- 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1794, 0x78ac, 0x78af,
- 0x0000, 0xa005, 0x00c0, 0x1795, 0x007c, 0xa08c, 0xfff0, 0x0040,
- 0x179b, 0x1078, 0x1b81, 0x0079, 0x179d, 0x17ad, 0x17af, 0x17b5,
- 0x17b9, 0x17ad, 0x17bd, 0x17ad, 0x17ad, 0x17ad, 0x17ad, 0x17c3,
- 0x17c7, 0x17ad, 0x17ad, 0x17ad, 0x17ad, 0x1078, 0x1b81, 0x1078,
- 0x176a, 0x2001, 0x8001, 0x0078, 0x17cd, 0x2001, 0x8003, 0x0078,
- 0x17cd, 0x2001, 0x8004, 0x0078, 0x17cd, 0x1078, 0x176a, 0x2001,
- 0x8006, 0x0078, 0x17cd, 0x2001, 0x800c, 0x0078, 0x17cd, 0x1078,
- 0x176a, 0x2001, 0x800d, 0x0078, 0x17cd, 0x70c2, 0x2061, 0x0000,
- 0x601b, 0x0001, 0x2091, 0x4080, 0x007c, 0x2c04, 0x6082, 0x2c08,
- 0x2063, 0x0000, 0x7864, 0x8000, 0x7866, 0x7868, 0xa005, 0x796a,
- 0x0040, 0x17e5, 0x2c02, 0x0078, 0x17e6, 0x796e, 0x007c, 0x0c7e,
- 0x2061, 0x3500, 0x6883, 0x0103, 0x2d08, 0x206b, 0x0000, 0x6064,
- 0x8000, 0x6066, 0x6068, 0xa005, 0x616a, 0x0040, 0x17fa, 0x2d02,
- 0x0078, 0x17fb, 0x616e, 0x0c7f, 0x007c, 0x1078, 0x180e, 0x0040,
- 0x180d, 0x0c7e, 0x6098, 0xa065, 0x0040, 0x1808, 0x1078, 0x16dc,
- 0x0c7f, 0x609b, 0x0000, 0x1078, 0x1682, 0x007c, 0x786c, 0xa065,
- 0x0040, 0x1820, 0x2091, 0x8000, 0x7864, 0x8001, 0x7866, 0x2c04,
- 0x786e, 0xa005, 0x00c0, 0x181e, 0x786a, 0x8000, 0x2091, 0x8001,
- 0x007c, 0x7898, 0xa005, 0x00c0, 0x186f, 0x7974, 0x70d0, 0x0005,
- 0x0005, 0x72d0, 0xa206, 0x00c0, 0x1826, 0x2200, 0xa106, 0x00c0,
- 0x183d, 0x7804, 0xa005, 0x0040, 0x186f, 0x7807, 0x0000, 0x0068,
- 0x186f, 0x2091, 0x4080, 0x0078, 0x186f, 0x1078, 0x1679, 0x0040,
- 0x186f, 0x7a7c, 0x7b78, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399,
- 0x0000, 0x2009, 0x0040, 0x1078, 0x1649, 0x0040, 0x1866, 0x1078,
- 0x1682, 0x7880, 0x8000, 0x7882, 0xa086, 0x0002, 0x00c0, 0x186f,
- 0x2091, 0x8000, 0x78af, 0x0002, 0x7883, 0x0000, 0x7898, 0xa085,
- 0x0003, 0x789a, 0x2091, 0x8001, 0x0078, 0x186f, 0x7883, 0x0000,
- 0x1078, 0x199c, 0x6000, 0xa084, 0x0007, 0x0079, 0x1870, 0x007c,
- 0x1878, 0x1887, 0x18a7, 0x1878, 0x18b9, 0x1878, 0x1878, 0x1878,
- 0x2039, 0x0400, 0x78a8, 0xa705, 0x78aa, 0x6004, 0xa705, 0x6006,
- 0x1078, 0x18f7, 0x6018, 0x78a6, 0x1078, 0x1984, 0x007c, 0x78a8,
- 0xa084, 0x0100, 0x0040, 0x188e, 0x0078, 0x1878, 0x78ab, 0x0000,
- 0x6000, 0x8007, 0xa084, 0x00ff, 0x789e, 0x8001, 0x609b, 0x0000,
- 0x0040, 0x18a4, 0x1078, 0x18f7, 0x0040, 0x18a4, 0x78a8, 0xa085,
- 0x0100, 0x78aa, 0x0078, 0x18a6, 0x1078, 0x191b, 0x007c, 0x78a8,
- 0xa08c, 0x0e00, 0x00c0, 0x18b0, 0xa084, 0x0100, 0x00c0, 0x18b2,
- 0x0078, 0x1878, 0x1078, 0x18f7, 0x00c0, 0x18b8, 0x1078, 0x191b,
- 0x007c, 0x78a8, 0xa084, 0x0100, 0x0040, 0x18c0, 0x0078, 0x1878,
- 0x78ab, 0x0000, 0x6710, 0x20a9, 0x0001, 0x6014, 0xa084, 0x00ff,
- 0xa005, 0x0040, 0x18dd, 0xa7bc, 0xff00, 0x20a9, 0x0008, 0xa08e,
- 0x0001, 0x0040, 0x18dd, 0x2039, 0x0000, 0x20a9, 0x0080, 0xa08e,
- 0x0002, 0x0040, 0x18dd, 0x0078, 0x18f4, 0x1078, 0x169c, 0x2d00,
- 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, 0x6808, 0xa084,
- 0xffde, 0x680a, 0x2d00, 0xa080, 0x0010, 0x2068, 0x2091, 0x8001,
- 0x0070, 0x18f4, 0x0078, 0x18e0, 0x1078, 0x1682, 0x007c, 0x78a0,
- 0xa06d, 0x00c0, 0x1902, 0x2c00, 0x78a2, 0x78a6, 0x609b, 0x0000,
- 0x0078, 0x190e, 0x2c00, 0x689a, 0x609b, 0x0000, 0x78a2, 0x2d00,
- 0x6002, 0x78a4, 0xad06, 0x00c0, 0x190e, 0x6002, 0x789c, 0x8001,
- 0x789e, 0x00c0, 0x191a, 0x78a8, 0xa084, 0x0000, 0x78aa, 0x78a4,
- 0x2060, 0xa006, 0x007c, 0xa02e, 0x2530, 0x6118, 0xa184, 0x0060,
- 0x619e, 0x0040, 0x1927, 0x0e7e, 0x1078, 0x2f16, 0x0e7f, 0x6592,
- 0x65a2, 0x6696, 0x66a6, 0x60ab, 0x0000, 0x60af, 0x0000, 0x6710,
- 0x1078, 0x169c, 0x2091, 0x8000, 0x6808, 0xa084, 0x0001, 0x0040,
- 0x1949, 0x2091, 0x8001, 0x1078, 0x16e9, 0x2091, 0x8000, 0x1078,
- 0x17d5, 0x2091, 0x8001, 0x78a3, 0x0000, 0x78a7, 0x0000, 0x0078,
- 0x1983, 0x6020, 0xa096, 0x0001, 0x00c0, 0x1950, 0x8000, 0x6022,
- 0x6a10, 0x6814, 0x2091, 0x8001, 0xa202, 0x0048, 0x195f, 0x0040,
- 0x195f, 0x2039, 0x0200, 0x1078, 0x1984, 0x0078, 0x1983, 0x2c08,
- 0x2091, 0x8000, 0x6800, 0xa065, 0x0040, 0x1967, 0x6102, 0x6902,
- 0x00c0, 0x196b, 0x6906, 0x2160, 0x6003, 0x0000, 0x6810, 0x8000,
- 0x6812, 0x2091, 0x8001, 0x6808, 0xa08c, 0x0040, 0x0040, 0x197d,
- 0xa086, 0x0040, 0x680a, 0x1078, 0x16f8, 0x1078, 0x1a23, 0x78a7,
- 0x0000, 0x78a3, 0x0000, 0x007c, 0x6004, 0xa705, 0x6006, 0x2091,
- 0x8000, 0x1078, 0x17d5, 0x2091, 0x8001, 0x78a4, 0xa065, 0x0040,
- 0x1997, 0x6098, 0x78a6, 0x609b, 0x0000, 0x0078, 0x1987, 0x78a3,
- 0x0000, 0x78a7, 0x0000, 0x007c, 0x7970, 0x7874, 0x8000, 0xa10a,
- 0x00c8, 0x19a3, 0xa006, 0x7876, 0x70d2, 0x7804, 0xa005, 0x0040,
- 0x19b1, 0x8001, 0x7806, 0x00c0, 0x19b1, 0x0068, 0x19b1, 0x2091,
- 0x4080, 0x007c, 0x0068, 0x19cc, 0x2029, 0x0000, 0x786c, 0xa065,
- 0x0040, 0x19c7, 0x1078, 0x19cd, 0x0040, 0x19c7, 0x057e, 0x1078,
- 0x19e3, 0x057f, 0x00c0, 0x19c7, 0x8528, 0x0078, 0x19b6, 0x85ff,
- 0x0040, 0x19cc, 0x2091, 0x4080, 0x007c, 0x7b84, 0x7988, 0x72d4,
- 0x0005, 0x0005, 0x70d4, 0xa206, 0x00c0, 0x19cf, 0x2200, 0xa102,
- 0x00c0, 0x19dd, 0x2300, 0xa005, 0x007c, 0x0048, 0x19e1, 0xa302,
- 0x007c, 0x8002, 0x007c, 0x1078, 0x1a15, 0x2009, 0x001c, 0x6024,
- 0xa005, 0x0040, 0x19ed, 0x2009, 0x0040, 0x1078, 0x161b, 0x0040,
- 0x1a06, 0x7894, 0x8000, 0x7896, 0xa086, 0x0002, 0x00c0, 0x1a14,
- 0x2091, 0x8000, 0x78af, 0x0003, 0x7897, 0x0000, 0x7898, 0xa085,
- 0x0300, 0x789a, 0x2091, 0x8001, 0x0078, 0x1a14, 0x7897, 0x0000,
- 0x1078, 0x17fd, 0x7984, 0x7888, 0x8000, 0xa10a, 0x00c8, 0x1a11,
- 0xa006, 0x788a, 0x70d6, 0xa006, 0x007c, 0x8107, 0x8004, 0x8004,
- 0x7a90, 0x7b8c, 0xa210, 0xa399, 0x0000, 0x007c, 0x2009, 0x3568,
- 0x2091, 0x8000, 0x200a, 0x0f7e, 0x2079, 0x0100, 0x2009, 0x3540,
- 0x2091, 0x8000, 0x2104, 0xa086, 0x0000, 0x00c0, 0x1a3e, 0x2009,
- 0x3512, 0x2104, 0xa005, 0x00c0, 0x1a3e, 0x7830, 0xa084, 0x00c0,
- 0x00c0, 0x1a3e, 0x0018, 0x1a3e, 0x781b, 0x0044, 0x2091, 0x8001,
- 0x0f7f, 0x007c, 0x127e, 0x2091, 0x2300, 0x2071, 0x3540, 0x2079,
- 0x0100, 0x2019, 0x2ddb, 0x20a1, 0x012b, 0x2304, 0xa005, 0x0040,
- 0x1a5a, 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398, 0x53a6, 0x3318,
- 0x0078, 0x1a4d, 0x789b, 0x0020, 0x20a9, 0x0010, 0x78af, 0x0000,
- 0x78af, 0x0220, 0x0070, 0x1a66, 0x0078, 0x1a5e, 0x7003, 0x0000,
- 0x1078, 0x1b65, 0x7004, 0xa084, 0x000f, 0xa085, 0x6280, 0x7806,
- 0x780f, 0x9200, 0x7843, 0x00d8, 0x7853, 0x0080, 0x780b, 0x0008,
- 0x7047, 0x357f, 0x7043, 0x0000, 0x127f, 0x2000, 0x007c, 0xa18c,
- 0x000f, 0x2011, 0x0101, 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012,
- 0x1078, 0x1b65, 0x007c, 0x2011, 0x0101, 0x20a9, 0x0009, 0x810b,
- 0x0070, 0x1a94, 0x0078, 0x1a8f, 0xa18c, 0x0e00, 0x2204, 0xa084,
- 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2009, 0x0101, 0x20a9, 0x0005,
- 0x8213, 0x0070, 0x1aa5, 0x0078, 0x1aa0, 0xa294, 0x00e0, 0x2104,
- 0xa084, 0xff1f, 0xa205, 0x200a, 0x007c, 0x2011, 0x0101, 0x20a9,
- 0x000c, 0x810b, 0x0070, 0x1ab6, 0x0078, 0x1ab1, 0xa18c, 0xf000,
- 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x007c, 0x2011, 0x0102,
- 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, 0x007c, 0x8103, 0x8003,
- 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x62ac, 0x63ac,
- 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061,
- 0x0100, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x0c7f, 0x007c,
- 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a,
- 0x60a4, 0xa085, 0x0020, 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003,
- 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0x62ae,
- 0x2010, 0x60a4, 0x63ae, 0x2018, 0x0c7f, 0x007c, 0x2091, 0x8000,
- 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040, 0x1b43, 0x2061, 0x3f80,
- 0x1078, 0x1b4b, 0x0040, 0x1b31, 0x20a9, 0x0000, 0x2061, 0x3e80,
- 0x0c7e, 0x1078, 0x1b4b, 0x0040, 0x1b1d, 0x0c7f, 0x8c60, 0x0070,
- 0x1b1b, 0x0078, 0x1b10, 0x0078, 0x1b43, 0x007f, 0xa082, 0x3e80,
- 0x2071, 0x3540, 0x70ba, 0x601c, 0xa085, 0x0800, 0x601e, 0x71b6,
- 0x60a7, 0x0000, 0x2001, 0x0004, 0x70a2, 0x1078, 0x1a1e, 0x0078,
- 0x1b3f, 0x2071, 0x3540, 0x601c, 0xa085, 0x0800, 0x601e, 0x71b6,
- 0x60a7, 0x0000, 0x2001, 0x0006, 0x70a2, 0x1078, 0x1a1e, 0x2001,
- 0x0000, 0x0078, 0x1b45, 0x2001, 0x0001, 0x2091, 0x8001, 0xa005,
- 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005, 0x0040, 0x1b62, 0x2060,
- 0x600c, 0xa306, 0x00c0, 0x1b5f, 0x6008, 0xa206, 0x00c0, 0x1b5f,
- 0x6010, 0xa106, 0x00c0, 0x1b5f, 0xa006, 0x0078, 0x1b64, 0x6000,
- 0x0078, 0x1b4c, 0xa085, 0x0001, 0x007c, 0x2011, 0x3541, 0x220c,
- 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204, 0xa084, 0x0100, 0x0040,
- 0x1b80, 0x2019, 0x0112, 0x201b, 0x1000, 0x2021, 0x013a, 0x2122,
- 0x2013, 0x0080, 0x2013, 0x008c, 0x2013, 0x0000, 0x201b, 0x0000,
- 0x007c, 0x0068, 0x1b81, 0x007e, 0x2071, 0x0000, 0x7018, 0xa084,
- 0x0001, 0x00c0, 0x1b86, 0x007f, 0x2e08, 0x2071, 0x0010, 0x70ca,
- 0x007f, 0x70c6, 0x70c3, 0x8002, 0x2071, 0x0000, 0x701b, 0x0001,
- 0x2091, 0x4080, 0x007f, 0x2070, 0x007f, 0x0078, 0x1b9d, 0x107e,
- 0x007e, 0x127e, 0x2091, 0x2300, 0x7f3c, 0x7e58, 0x7c30, 0x7d38,
- 0xa594, 0x003f, 0xa484, 0x4000, 0x0040, 0x1bb4, 0xa784, 0x007c,
- 0x00c0, 0x2da7, 0x1078, 0x1b81, 0xa49c, 0x000f, 0xa382, 0x0004,
- 0x0050, 0x1bbc, 0x1078, 0x1b81, 0x8507, 0xa084, 0x000f, 0x0079,
- 0x1bc1, 0x1fed, 0x209d, 0x20c3, 0x22e9, 0x2576, 0x25be, 0x25f5,
- 0x2670, 0x26ca, 0x274f, 0x1be7, 0x1bd1, 0x1e56, 0x1f20, 0x2555,
- 0x1bd1, 0x1078, 0x1b81, 0x0018, 0x1ba4, 0x127f, 0x2091, 0x8001,
- 0x007f, 0x107f, 0x007c, 0x7003, 0x0000, 0x703f, 0x0000, 0x7030,
- 0xa005, 0x0040, 0x1be5, 0x7033, 0x0000, 0x0018, 0x1ba4, 0x705c,
- 0xa005, 0x00c0, 0x1ca5, 0x70a0, 0xa084, 0x0007, 0x0079, 0x1bf0,
- 0x1cd1, 0x1bf8, 0x1c06, 0x1c27, 0x1c4d, 0x1c79, 0x1c77, 0x1bf8,
- 0x7808, 0xa084, 0xfffd, 0x780a, 0x2009, 0x0046, 0x1078, 0x241b,
- 0x00c0, 0x1c04, 0x7003, 0x0004, 0x0078, 0x1bd3, 0x1078, 0x2d69,
- 0x00c0, 0x1c25, 0x70b4, 0x8007, 0x789b, 0x007e, 0x78aa, 0x789b,
- 0x0010, 0x78ab, 0x000c, 0x789b, 0x0060, 0x78ab, 0x0001, 0x785b,
- 0x0004, 0x2009, 0x00f7, 0x1078, 0x2419, 0x00c0, 0x1c25, 0x7003,
- 0x0004, 0x70c3, 0x000f, 0x7033, 0x3570, 0x0078, 0x1bd3, 0x1078,
- 0x2d69, 0x00c0, 0x1c4b, 0x71b4, 0x8107, 0x789b, 0x007e, 0x78aa,
- 0x789b, 0x0010, 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab,
- 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b, 0x0004, 0x2009,
- 0x00f7, 0x1078, 0x2419, 0x00c0, 0x1c4b, 0x7003, 0x0004, 0x70c3,
- 0x000f, 0x7033, 0x3570, 0x0078, 0x1bd3, 0x1078, 0x2d69, 0x00c0,
- 0x1c75, 0x71b4, 0x8107, 0x789b, 0x007e, 0x78aa, 0x789b, 0x0010,
- 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0020, 0x71b8,
- 0x79aa, 0x78ab, 0x000d, 0x789b, 0x0060, 0x78ab, 0x0004, 0x785b,
- 0x0004, 0x2009, 0x00f7, 0x1078, 0x2419, 0x00c0, 0x1c75, 0x7003,
- 0x0004, 0x70c3, 0x000f, 0x7033, 0x3570, 0x0078, 0x1bd3, 0x0078,
- 0x1c27, 0x1078, 0x2d69, 0x00c0, 0x1bd3, 0x70bc, 0x2068, 0x789b,
- 0x0010, 0x6f10, 0x1078, 0x2cac, 0x2c50, 0x6810, 0x007e, 0x8007,
- 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3600, 0x2048,
- 0x0c7e, 0x2060, 0x704a, 0x6000, 0x704e, 0x6004, 0x7052, 0x0c7f,
- 0x007f, 0xa084, 0x0007, 0xa085, 0x0080, 0x78aa, 0x6e18, 0x2041,
- 0x0001, 0x2001, 0x0004, 0x0078, 0x1dcc, 0x1078, 0x2d69, 0x00c0,
- 0x1bd3, 0x789b, 0x0010, 0x705c, 0x2068, 0x6f10, 0x1078, 0x2cac,
- 0x2c50, 0x6008, 0xa085, 0x0010, 0x600a, 0x6820, 0xa005, 0x0040,
- 0x1cc1, 0xa082, 0x0006, 0x0048, 0x1cbf, 0x0078, 0x1cc1, 0x6823,
- 0x0005, 0x6810, 0xa084, 0x0007, 0xa085, 0x0080, 0x78aa, 0x2031,
- 0x0020, 0x2041, 0x0001, 0x1078, 0x2dc8, 0x2001, 0x0003, 0x0078,
- 0x1dcc, 0x0018, 0x1ba4, 0x7440, 0xa485, 0x0000, 0x0040, 0x1ceb,
- 0xa080, 0x3580, 0x2030, 0x7144, 0x8108, 0xa12a, 0x0048, 0x1ce2,
- 0x2009, 0x3580, 0x2164, 0x6504, 0x85ff, 0x00c0, 0x1cf8, 0x8421,
- 0x00c0, 0x1cdc, 0x7146, 0x7003, 0x0000, 0x703f, 0x0000, 0x0078,
- 0x1bd3, 0x7640, 0xa6b0, 0x3580, 0x7144, 0x2600, 0x0078, 0x1ce7,
- 0x7146, 0x2568, 0x2558, 0x753e, 0x2c50, 0x6034, 0xa085, 0x0000,
- 0x00c0, 0x1cf5, 0x6708, 0x7736, 0xa784, 0x013f, 0x0040, 0x1d2a,
- 0xa784, 0x0021, 0x00c0, 0x1cf5, 0xa784, 0x0002, 0x0040, 0x1d17,
- 0xa784, 0x0004, 0x0040, 0x1cf5, 0xa7bc, 0xfffb, 0x670a, 0xa784,
- 0x0008, 0x00c0, 0x1cf5, 0xa784, 0x0010, 0x00c0, 0x1cf5, 0xa784,
- 0x0100, 0x0040, 0x1d2a, 0x6018, 0xa005, 0x00c0, 0x1cf5, 0xa7bc,
- 0xfeff, 0x670a, 0x681f, 0x0000, 0x6e18, 0xa684, 0x000e, 0x6118,
- 0x0040, 0x1d3a, 0x601c, 0xa102, 0x0048, 0x1d3d, 0x0040, 0x1d3d,
- 0x0078, 0x1cf1, 0x81ff, 0x00c0, 0x1cf1, 0xa784, 0x0080, 0x00c0,
- 0x1d43, 0x700c, 0x6022, 0xa7bc, 0xff7f, 0x670a, 0x6b10, 0x8307,
- 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3600, 0x2060,
- 0x2048, 0x704a, 0x6000, 0x704e, 0x6004, 0x7052, 0x2a60, 0x0018,
- 0x1ba4, 0x789b, 0x0010, 0xa046, 0x1078, 0x2d69, 0x00c0, 0x1bd3,
- 0x6b10, 0xa39c, 0x0007, 0xa39d, 0x00c0, 0x704c, 0xa084, 0x8000,
- 0x0040, 0x1d6e, 0xa684, 0x0001, 0x0040, 0x1d74, 0xa39c, 0xffbf,
- 0xa684, 0x000e, 0x00c0, 0x2901, 0xa684, 0x0010, 0x0040, 0x1d7e,
- 0xa39d, 0x0020, 0xa684, 0x000e, 0x00c0, 0x2907, 0x7baa, 0x8840,
- 0xa684, 0x000e, 0x00c0, 0x1d89, 0xa7bd, 0x0010, 0x670a, 0x0078,
- 0x1dca, 0x714c, 0xa18c, 0x0800, 0x0040, 0x290d, 0x2011, 0x0021,
- 0x8004, 0x8004, 0x0048, 0x1da0, 0x2011, 0x0022, 0x8004, 0x0048,
- 0x1da0, 0x2011, 0x0020, 0x8004, 0x0048, 0x1da0, 0x0040, 0x1dca,
- 0x7aaa, 0x8840, 0x1078, 0x2d82, 0x6a10, 0x610c, 0x8108, 0xa18c,
- 0x00ff, 0xa1e0, 0x3e80, 0x2c64, 0x8cff, 0x0040, 0x1dc1, 0x6010,
- 0xa206, 0x00c0, 0x1dab, 0x60b4, 0x8001, 0x60b6, 0x00c0, 0x1da6,
- 0x0c7e, 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078,
- 0x1cd1, 0x1078, 0x2d69, 0x00c0, 0x1bd3, 0x2a60, 0x610e, 0x79aa,
- 0x8840, 0x712e, 0x2001, 0x0001, 0x007e, 0x7150, 0xa184, 0x0018,
- 0x0040, 0x1de0, 0xa184, 0x0010, 0x0040, 0x1dda, 0x1078, 0x2ad7,
- 0x00c0, 0x1de0, 0xa184, 0x0008, 0x0040, 0x1de0, 0x1078, 0x29f1,
- 0x007f, 0x7002, 0xa68c, 0x0060, 0x88ff, 0x0040, 0x1de9, 0xa18d,
- 0x0004, 0x795a, 0x69b2, 0x789b, 0x0060, 0x2800, 0x78aa, 0x789b,
- 0x0061, 0x6814, 0xa085, 0x8000, 0x6816, 0x78aa, 0x157e, 0x137e,
- 0x147e, 0x20a1, 0x012c, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80,
- 0x000a, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6810, 0x8007,
- 0x789b, 0x007e, 0x78aa, 0x6d90, 0x7dd6, 0x7dde, 0x6e94, 0x7ed2,
- 0x7eda, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x1e18, 0x0098, 0x1e20,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x2d82, 0x0078, 0x1bdb,
- 0x7200, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x1e2d, 0x781b,
- 0x0049, 0x1078, 0x2d82, 0x0078, 0x1e3e, 0x6ab0, 0xa295, 0x2000,
- 0x7a5a, 0x781b, 0x0049, 0x1078, 0x2d82, 0x7200, 0x2500, 0xa605,
- 0x0040, 0x1e3e, 0xa284, 0x0007, 0x1079, 0x1e4c, 0xad80, 0x0008,
- 0x7032, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x1e4a, 0x6018,
- 0x8000, 0x601a, 0x0078, 0x1bd3, 0x1e54, 0x30f3, 0x30f3, 0x30e2,
- 0x30f3, 0x1e54, 0x1e54, 0x1e54, 0x1078, 0x1b81, 0x7808, 0xa084,
- 0xfffd, 0x780a, 0x0f7e, 0x2079, 0x3500, 0x7898, 0x0f7f, 0xa084,
- 0x0001, 0x0040, 0x1e7c, 0x70a0, 0xa086, 0x0001, 0x00c0, 0x1e6b,
- 0x70a2, 0x0078, 0x1f04, 0x70a0, 0xa086, 0x0005, 0x00c0, 0x1e7a,
- 0x70bc, 0x2068, 0x6817, 0x0004, 0x6813, 0x0000, 0x681c, 0xa085,
- 0x0008, 0x681e, 0x70a3, 0x0000, 0x157e, 0x2011, 0x0004, 0x71a0,
- 0xa186, 0x0001, 0x0040, 0x1e9e, 0xa186, 0x0007, 0x00c0, 0x1e8e,
- 0x2009, 0x352b, 0x200b, 0x0005, 0x0078, 0x1e9e, 0x2009, 0x3513,
- 0x2104, 0x2009, 0x3512, 0x200a, 0x2009, 0x352b, 0x200b, 0x0001,
- 0x70a3, 0x0000, 0x70a7, 0x0001, 0x0078, 0x1ea0, 0x70a3, 0x0000,
- 0x1078, 0x2eca, 0x20a9, 0x0010, 0x2039, 0x0000, 0x1078, 0x2bb1,
- 0xa7b8, 0x0100, 0x0070, 0x1eae, 0x0078, 0x1ea6, 0x7000, 0x2020,
- 0x0079, 0x1eb2, 0x1ee0, 0x1ec9, 0x1ec9, 0x1ebc, 0x1ee0, 0x1ee0,
- 0x1eba, 0x1eba, 0x1078, 0x1b81, 0x2021, 0x3557, 0x2404, 0xa005,
- 0x0040, 0x1ec9, 0xad06, 0x00c0, 0x1ec9, 0x6800, 0x2022, 0x0078,
- 0x1ed9, 0x681c, 0xa084, 0x0001, 0x00c0, 0x1ed5, 0x6f10, 0x1078,
- 0x2cac, 0x1078, 0x28e4, 0x0078, 0x1ed9, 0x7054, 0x2060, 0x6800,
- 0x6002, 0x6a16, 0x681c, 0xa085, 0x0008, 0x681e, 0x1078, 0x17e7,
- 0x2021, 0x3f80, 0x1078, 0x1f0a, 0x2021, 0x3557, 0x1078, 0x1f0a,
- 0x20a9, 0x0000, 0x2021, 0x3e80, 0x1078, 0x1f0a, 0x8420, 0x0070,
- 0x1ef3, 0x0078, 0x1eec, 0x20a9, 0x0080, 0x2061, 0x3680, 0x6018,
- 0x6110, 0xa102, 0x6012, 0x601b, 0x0000, 0xace0, 0x0010, 0x0070,
- 0x1f03, 0x0078, 0x1ef7, 0x157f, 0x7003, 0x0000, 0x703f, 0x0000,
- 0x0078, 0x1bd3, 0x047e, 0x2404, 0xa005, 0x0040, 0x1f1c, 0x2068,
- 0x6800, 0x007e, 0x6a16, 0x681c, 0xa085, 0x0008, 0x681e, 0x1078,
- 0x17e7, 0x007f, 0x0078, 0x1f0c, 0x047f, 0x2023, 0x0000, 0x007c,
- 0xa282, 0x0003, 0x0050, 0x1f26, 0x1078, 0x1b81, 0x2300, 0x0079,
- 0x1f29, 0x1f2c, 0x1f9f, 0x1fad, 0xa282, 0x0002, 0x0040, 0x1f32,
- 0x1078, 0x1b81, 0x70a0, 0x70a3, 0x0000, 0x70c3, 0x0000, 0x0079,
- 0x1f39, 0x1f41, 0x1f41, 0x1f43, 0x1f77, 0x2913, 0x1f41, 0x1f77,
- 0x1f41, 0x1078, 0x1b81, 0x77b4, 0x1078, 0x2bb1, 0x77b4, 0xa7bc,
- 0x0f00, 0x1078, 0x2cac, 0x6018, 0xa005, 0x0040, 0x1f6e, 0x2021,
- 0x3f80, 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x1fc8, 0x0040,
- 0x1f6e, 0x157e, 0x20a9, 0x0000, 0x2021, 0x3e80, 0x047e, 0x2009,
- 0x0004, 0x2011, 0x0010, 0x1078, 0x1fc8, 0x047f, 0x0040, 0x1f6d,
- 0x8420, 0x0070, 0x1f6d, 0x0078, 0x1f5e, 0x157f, 0x8738, 0xa784,
- 0x0007, 0x00c0, 0x1f49, 0x0078, 0x1bdb, 0x0078, 0x1bdb, 0x77b4,
- 0x1078, 0x2cac, 0x6018, 0xa005, 0x0040, 0x1f9d, 0x2021, 0x3f80,
- 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x1fc8, 0x0040, 0x1f9d,
- 0x157e, 0x20a9, 0x0000, 0x2021, 0x3e80, 0x047e, 0x2009, 0x0005,
- 0x2011, 0x0020, 0x1078, 0x1fc8, 0x047f, 0x0040, 0x1f9c, 0x8420,
- 0x0070, 0x1f9c, 0x0078, 0x1f8d, 0x157f, 0x0078, 0x1bdb, 0x2200,
- 0x0079, 0x1fa2, 0x1fa5, 0x1fa7, 0x1fa7, 0x1078, 0x1b81, 0x70a3,
- 0x0000, 0x70a7, 0x0001, 0x0078, 0x1bd3, 0x2200, 0x0079, 0x1fb0,
- 0x1fb5, 0x1fa7, 0x1fb3, 0x1078, 0x1b81, 0x1078, 0x2428, 0x7000,
- 0xa086, 0x0001, 0x00c0, 0x28ba, 0x1078, 0x28fa, 0x6008, 0xa084,
- 0xffef, 0x600a, 0x1078, 0x28ad, 0x0040, 0x28ba, 0x0078, 0x1cd1,
- 0x2404, 0xa005, 0x0040, 0x1fe9, 0x2068, 0x2d04, 0x007e, 0x6810,
- 0xa706, 0x0040, 0x1fd7, 0x2d20, 0x007f, 0x0078, 0x1fc9, 0x007f,
- 0x2022, 0x6916, 0x681c, 0xa205, 0x681e, 0x1078, 0x17e7, 0x6010,
- 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x28fa,
- 0x007c, 0xa085, 0x0001, 0x0078, 0x1fe8, 0x2300, 0x0079, 0x1ff0,
- 0x1ff5, 0x1ff3, 0x2038, 0x1078, 0x1b81, 0x78e4, 0xa005, 0x00d0,
- 0x2018, 0x0018, 0x2018, 0x2008, 0xa084, 0x0030, 0x00c0, 0x2004,
- 0x781b, 0x0049, 0x0078, 0x1bd3, 0x78ec, 0xa084, 0x0003, 0x0040,
- 0x2000, 0x2100, 0xa084, 0x0007, 0x0079, 0x200e, 0x2026, 0x202c,
- 0x2020, 0x2016, 0x2d63, 0x2d63, 0x2016, 0x2032, 0x1078, 0x1b81,
- 0x7000, 0xa005, 0x0040, 0x1bdb, 0x2001, 0x0003, 0x0078, 0x22fd,
- 0x1078, 0x2b94, 0x781b, 0x0055, 0x0078, 0x1bd3, 0x1078, 0x2b94,
- 0x781b, 0x00dc, 0x0078, 0x1bd3, 0x1078, 0x2b94, 0x781b, 0x00e3,
- 0x0078, 0x1bd3, 0x1078, 0x2b94, 0x781b, 0x009d, 0x0078, 0x1bd3,
- 0xa584, 0x000f, 0x00c0, 0x2062, 0x1078, 0x2428, 0x7000, 0x0079,
- 0x2041, 0x2049, 0x2056, 0x2049, 0x28ba, 0x204b, 0x28ba, 0x2049,
- 0x2049, 0x1078, 0x1b81, 0x71a0, 0x70a3, 0x0000, 0xa186, 0x0004,
- 0x00c0, 0x2054, 0x0078, 0x2913, 0x0078, 0x28ba, 0x1078, 0x28fa,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x28ad, 0x0040, 0x28ba,
- 0x0078, 0x1cd1, 0x78e4, 0xa005, 0x00d0, 0x2018, 0x0018, 0x2018,
- 0x2008, 0xa084, 0x0030, 0x00c0, 0x2071, 0x781b, 0x0049, 0x0078,
- 0x1bd3, 0x78ec, 0xa084, 0x0003, 0x0040, 0x206d, 0x2100, 0xa184,
- 0x0007, 0x0079, 0x207b, 0x208b, 0x2091, 0x2085, 0x2083, 0x2d63,
- 0x2d63, 0x2083, 0x2d5b, 0x1078, 0x1b81, 0x1078, 0x2b9c, 0x781b,
- 0x0055, 0x0078, 0x1bd3, 0x1078, 0x2b9c, 0x781b, 0x00dc, 0x0078,
- 0x1bd3, 0x1078, 0x2b9c, 0x781b, 0x00e3, 0x0078, 0x1bd3, 0x1078,
- 0x2b9c, 0x781b, 0x009d, 0x0078, 0x1bd3, 0x2300, 0x0079, 0x20a0,
- 0x20a5, 0x20a3, 0x20a7, 0x1078, 0x1b81, 0x0078, 0x2670, 0x6817,
- 0x0008, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x2670,
- 0x78ec, 0xa084, 0x0003, 0x0040, 0x2670, 0xa184, 0x0007, 0x0079,
- 0x20b9, 0x2026, 0x202c, 0x2020, 0x2d3b, 0x2d63, 0x2d63, 0x20c1,
- 0x2d5b, 0x1078, 0x1b81, 0xa282, 0x0005, 0x0050, 0x20c9, 0x1078,
- 0x1b81, 0x2300, 0x0079, 0x20cc, 0x20cf, 0x22d1, 0x22dd, 0x2200,
- 0x0079, 0x20d2, 0x20d7, 0x20d9, 0x20ec, 0x20d7, 0x22b6, 0x1078,
- 0x1b81, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa082, 0x0020,
- 0x0048, 0x2b75, 0xa08a, 0x0004, 0x00c8, 0x2b75, 0x0079, 0x20e8,
- 0x2b75, 0x2b75, 0x2b75, 0x2b17, 0x789b, 0x0018, 0x79a8, 0xa184,
- 0x0080, 0x0040, 0x2101, 0xa184, 0x0018, 0x0040, 0x20fd, 0x0078,
- 0x2b75, 0x7000, 0xa005, 0x00c0, 0x20f7, 0x2011, 0x0003, 0x0078,
- 0x275d, 0xa184, 0x00ff, 0xa08a, 0x0010, 0x00c8, 0x2b75, 0x0079,
- 0x2109, 0x211b, 0x2119, 0x2131, 0x2133, 0x21c5, 0x2b75, 0x2b75,
- 0x21c7, 0x2b75, 0x2b75, 0x22b2, 0x22b2, 0x2b75, 0x2b75, 0x2b75,
- 0x22b4, 0x1078, 0x1b81, 0xa684, 0x1000, 0x0040, 0x2128, 0x2001,
- 0x0300, 0x8000, 0x8000, 0x783a, 0x781b, 0x009a, 0x0078, 0x1bd3,
- 0x6814, 0xa084, 0x8000, 0x0040, 0x212f, 0x6817, 0x0003, 0x0078,
- 0x2d3b, 0x1078, 0x1b81, 0x691c, 0x691e, 0xa684, 0x1800, 0x00c0,
- 0x214d, 0x681c, 0xa084, 0x0001, 0x00c0, 0x2155, 0x6814, 0xa086,
- 0x0008, 0x00c0, 0x2145, 0x6817, 0x0000, 0xa684, 0x0400, 0x0040,
- 0x21c1, 0x781b, 0x0058, 0x0078, 0x1bd3, 0xa684, 0x1000, 0x0040,
- 0x2155, 0x781b, 0x0058, 0x0078, 0x1bd3, 0xa684, 0x0060, 0x0040,
- 0x21bd, 0xa684, 0x0800, 0x0040, 0x21bd, 0xa684, 0x8000, 0x00c0,
- 0x2163, 0x0078, 0x217d, 0xa6b4, 0x7fff, 0x7e5a, 0x6eb2, 0x789b,
- 0x0074, 0x7aac, 0x79ac, 0x78ac, 0x801b, 0x00c8, 0x2170, 0x8000,
- 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b94, 0x2100, 0xa302,
- 0x68ae, 0x6b90, 0x2200, 0xa303, 0x68aa, 0xa684, 0x4000, 0x0040,
- 0x2185, 0xa6b4, 0xbfff, 0x7e5a, 0x6eb2, 0x7000, 0xa086, 0x0003,
- 0x00c0, 0x2192, 0x1078, 0x2f3d, 0x1078, 0x30e2, 0x781b, 0x0067,
- 0x0078, 0x1bd3, 0xa006, 0x1078, 0x3197, 0x6aac, 0x69a8, 0x6c94,
- 0x6b90, 0x2200, 0xa105, 0x0040, 0x21a1, 0x2200, 0xa422, 0x2100,
- 0xa31b, 0x7cd2, 0x7bd6, 0x2300, 0xa405, 0x00c0, 0x21af, 0xa6b5,
- 0x4000, 0x7e5a, 0x6eb2, 0x781b, 0x0067, 0x0078, 0x1bd3, 0x781b,
- 0x0067, 0x2200, 0xa115, 0x00c0, 0x21b9, 0x1078, 0x30f3, 0x0078,
- 0x1bd3, 0x1078, 0x3120, 0x0078, 0x1bd3, 0x781b, 0x006a, 0x0078,
- 0x1bd3, 0x781b, 0x0058, 0x0078, 0x1bd3, 0x1078, 0x1b81, 0x0078,
- 0x2224, 0x691c, 0xa184, 0x0100, 0x0040, 0x21df, 0xa18c, 0xfeff,
- 0x691e, 0x0c7e, 0x7048, 0x2060, 0x6000, 0xa084, 0xefff, 0x6002,
- 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x2213, 0xa184,
- 0x0200, 0x0040, 0x2213, 0xa18c, 0xfdff, 0x691e, 0x0c7e, 0x7048,
- 0x2060, 0x6000, 0xa084, 0xdfff, 0x6002, 0x6004, 0xa084, 0xffef,
- 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2213,
- 0x1078, 0x2ca8, 0x1078, 0x29f1, 0x88ff, 0x0040, 0x2213, 0x789b,
- 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684,
- 0x0400, 0x00c0, 0x220f, 0x781b, 0x0055, 0x0078, 0x1bd3, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x221c,
- 0x781b, 0x0058, 0x0078, 0x1bd3, 0x781b, 0x006a, 0x0078, 0x1bd3,
- 0x0078, 0x2b7b, 0x0078, 0x2b7b, 0x2019, 0x0000, 0x7990, 0xa18c,
- 0x0007, 0x0040, 0x2222, 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff,
- 0xa286, 0x0001, 0x00c0, 0x2247, 0x2300, 0x7ca8, 0xa400, 0x2018,
- 0xa102, 0x0040, 0x223f, 0x0048, 0x223f, 0x0078, 0x2241, 0x0078,
- 0x21c9, 0x24a8, 0x7aa8, 0x00f0, 0x2241, 0x0078, 0x222d, 0xa284,
- 0x00f0, 0xa086, 0x0020, 0x00c0, 0x22a3, 0x8318, 0x8318, 0x2300,
- 0xa102, 0x0040, 0x2257, 0x0048, 0x2257, 0x0078, 0x22a0, 0xa286,
- 0x0023, 0x0040, 0x2222, 0x6818, 0xa084, 0xfff1, 0x681a, 0x7e58,
- 0xa684, 0xfff1, 0xa085, 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085,
- 0x0010, 0x600a, 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48,
- 0x0c7f, 0xa184, 0x0010, 0x0040, 0x227b, 0x1078, 0x2ca8, 0x1078,
- 0x2ad7, 0x0078, 0x228a, 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008,
- 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2213, 0x1078, 0x2ca8,
- 0x1078, 0x29f1, 0x88ff, 0x0040, 0x2213, 0x789b, 0x0060, 0x2800,
- 0x78aa, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x229c,
- 0x781b, 0x0055, 0x0078, 0x1bd3, 0x781b, 0x0069, 0x0078, 0x1bd3,
- 0x7aa8, 0x0078, 0x222d, 0x8318, 0x2300, 0xa102, 0x0040, 0x22ac,
- 0x0048, 0x22ac, 0x0078, 0x222d, 0xa284, 0x0080, 0x00c0, 0x2b81,
- 0x0078, 0x2b7b, 0x0078, 0x2b81, 0x0078, 0x2b75, 0x789b, 0x0018,
- 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0040, 0x22c1, 0x1078,
- 0x1b81, 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a,
- 0x0004, 0x00c8, 0x2b75, 0x0079, 0x22cd, 0x2b75, 0x2944, 0x2b75,
- 0x2a72, 0xa282, 0x0000, 0x00c0, 0x22d7, 0x1078, 0x1b81, 0x1078,
- 0x2b94, 0x781b, 0x0069, 0x0078, 0x1bd3, 0xa282, 0x0003, 0x00c0,
- 0x22e3, 0x1078, 0x1b81, 0x1078, 0x2ba4, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0xa282, 0x0004, 0x0050, 0x22ef, 0x1078, 0x1b81, 0x2300,
- 0x0079, 0x22f2, 0x22f5, 0x23d2, 0x2403, 0xa286, 0x0003, 0x0040,
- 0x22fb, 0x1078, 0x1b81, 0x2001, 0x0000, 0x703a, 0x7000, 0xa084,
- 0x0007, 0x0079, 0x2303, 0x230b, 0x230d, 0x230d, 0x2513, 0x253b,
- 0x24dd, 0x230b, 0x230b, 0x1078, 0x1b81, 0xa684, 0x1000, 0x00c0,
- 0x2315, 0x1078, 0x2eca, 0x0040, 0x23ac, 0x7868, 0xa08c, 0x00ff,
- 0x0040, 0x235d, 0xa186, 0x0008, 0x00c0, 0x232c, 0x1078, 0x28fa,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x28ad, 0x0040, 0x235d,
- 0x1078, 0x2eca, 0x0078, 0x2344, 0xa186, 0x0028, 0x00c0, 0x235d,
- 0x1078, 0x2eca, 0x6008, 0xa084, 0xffef, 0x600a, 0x6018, 0xa005,
- 0x0040, 0x2344, 0x8001, 0x601a, 0xa005, 0x0040, 0x2344, 0x8001,
- 0xa005, 0x0040, 0x2344, 0x601e, 0x681c, 0xa084, 0x0001, 0x0040,
- 0x1bdb, 0x681c, 0xa084, 0xfffe, 0x681e, 0x7054, 0x0c7e, 0x2060,
- 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802, 0xa005, 0x2d00, 0x00c0,
- 0x235a, 0x6002, 0x6006, 0x0078, 0x1bdb, 0x017e, 0x1078, 0x2428,
- 0x017f, 0xa684, 0xdf00, 0x681a, 0x6827, 0x0000, 0x6f10, 0x81ff,
- 0x0040, 0x23ac, 0xa186, 0x0002, 0x00c0, 0x23a4, 0xa684, 0x0800,
- 0x00c0, 0x237a, 0xa684, 0x0060, 0x0040, 0x237a, 0x78d8, 0x7adc,
- 0x682e, 0x6a2a, 0x8717, 0xa294, 0x000f, 0x8213, 0x8213, 0x8213,
- 0xa290, 0x3600, 0xa290, 0x0000, 0x221c, 0xa384, 0x0100, 0x00c0,
- 0x238b, 0x0078, 0x2391, 0x8210, 0x2204, 0xa085, 0x0018, 0x2012,
- 0x8211, 0xa384, 0x0400, 0x0040, 0x239e, 0x689c, 0xa084, 0x0100,
- 0x00c0, 0x239e, 0x1078, 0x249c, 0x0078, 0x1bdb, 0x6008, 0xa085,
- 0x0002, 0x600a, 0x0078, 0x23ac, 0xa186, 0x0018, 0x0040, 0x23ac,
- 0xa186, 0x0014, 0x0040, 0x1bdb, 0x6912, 0x6814, 0xa084, 0x8000,
- 0x0040, 0x23b4, 0x7038, 0x6816, 0xa68c, 0xdf00, 0x691a, 0x1078,
- 0x28eb, 0x1078, 0x28fa, 0x00c0, 0x23c1, 0x6008, 0xa084, 0xffef,
- 0x600a, 0x681c, 0xa084, 0x0001, 0x00c0, 0x23ca, 0x1078, 0x28e4,
- 0x0078, 0x23ce, 0x7054, 0x2060, 0x6800, 0x6002, 0x1078, 0x17e7,
- 0x0078, 0x1bdb, 0xa282, 0x0004, 0x0048, 0x23d8, 0x1078, 0x1b81,
- 0x2200, 0x0079, 0x23db, 0x23df, 0x23e1, 0x23ee, 0x23e1, 0x1078,
- 0x1b81, 0x7000, 0xa086, 0x0005, 0x0040, 0x23ea, 0x1078, 0x2b94,
- 0x781b, 0x0069, 0x781b, 0x006a, 0x0078, 0x1bd3, 0x7890, 0x8007,
- 0x8001, 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c,
- 0x00ff, 0xa186, 0x0003, 0x0040, 0x23ff, 0x0078, 0x2b75, 0x781b,
- 0x006a, 0x0078, 0x1bd3, 0x681c, 0xa085, 0x0004, 0x681e, 0x82ff,
- 0x00c0, 0x240e, 0x1078, 0x2b94, 0x0078, 0x2415, 0x8211, 0x0040,
- 0x2413, 0x1078, 0x1b81, 0x1078, 0x2ba4, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0x1078, 0x2d82, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2425,
- 0x0018, 0x2425, 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c,
- 0xa684, 0x0060, 0x00c0, 0x2432, 0x682f, 0x0000, 0x682b, 0x0000,
- 0x0078, 0x249b, 0xa684, 0x0800, 0x00c0, 0x2441, 0x68b0, 0xa084,
- 0x4800, 0xa635, 0xa684, 0x0800, 0x00c0, 0x2441, 0x1078, 0x2eca,
- 0x007c, 0xa684, 0x0020, 0x0040, 0x246d, 0x78d0, 0x8003, 0x00c8,
- 0x244f, 0xa006, 0x1078, 0x3197, 0x78d4, 0x1078, 0x31fc, 0xa684,
- 0x4000, 0x0040, 0x2459, 0x682f, 0x0000, 0x682b, 0x0000, 0x0078,
- 0x243e, 0x68b0, 0xa084, 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0,
- 0x2453, 0x7038, 0xa005, 0x00c0, 0x2467, 0x703b, 0x0007, 0x79d8,
- 0x7adc, 0x692e, 0x6a2a, 0x0078, 0x243e, 0xa684, 0x4000, 0x0040,
- 0x2477, 0x682f, 0x0000, 0x682b, 0x0000, 0x0078, 0x243e, 0x68b0,
- 0xa084, 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, 0x2471, 0x7038,
- 0xa005, 0x00c0, 0x2485, 0x703b, 0x0007, 0x79d8, 0x7adc, 0x78d0,
- 0x80f3, 0x00c8, 0x248c, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291,
- 0x0000, 0x692e, 0x6a2a, 0x2100, 0xa205, 0x00c0, 0x2499, 0x0078,
- 0x243e, 0x1078, 0x3197, 0x007c, 0xa384, 0x0200, 0x0040, 0x24a4,
- 0x6008, 0xa085, 0x0002, 0x600a, 0x6817, 0x0006, 0x6a28, 0x692c,
- 0x6a3a, 0x693e, 0x682b, 0x0300, 0x682f, 0x0000, 0x6833, 0x2000,
- 0x6893, 0x0000, 0x6897, 0x0020, 0x7000, 0x0079, 0x24b7, 0x24bf,
- 0x24c1, 0x24ca, 0x24bf, 0x24bf, 0x24bf, 0x24bf, 0x24bf, 0x1078,
- 0x1b81, 0x681c, 0xa084, 0x0001, 0x00c0, 0x24ca, 0x1078, 0x28e4,
- 0x0078, 0x24d0, 0x7054, 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60,
- 0x2021, 0x3557, 0x2404, 0xa005, 0x0040, 0x24d9, 0x2020, 0x0078,
- 0x24d2, 0x2d22, 0x206b, 0x0000, 0x007c, 0x77b4, 0x1078, 0x2bb1,
- 0xa7bc, 0x0f00, 0x1078, 0x2cac, 0x6018, 0xa005, 0x0040, 0x250c,
- 0x0d7e, 0x2001, 0x3f90, 0x2068, 0x0d7f, 0x2021, 0x3f80, 0x2009,
- 0x0004, 0x2011, 0x0010, 0x1078, 0x1fc8, 0x0040, 0x250c, 0x157e,
- 0x20a9, 0x0000, 0x2021, 0x3e80, 0x047e, 0x2009, 0x0004, 0x2011,
- 0x0010, 0x1078, 0x1fc8, 0x047f, 0x0040, 0x250b, 0x8420, 0x0070,
- 0x250b, 0x0078, 0x24fc, 0x157f, 0x8738, 0xa784, 0x0007, 0x00c0,
- 0x24e2, 0x0078, 0x1bdb, 0x1078, 0x28eb, 0x1078, 0x28fa, 0x6827,
- 0x0000, 0x789b, 0x000e, 0x6f10, 0x6813, 0x0002, 0x1078, 0x31cd,
- 0xa684, 0x0800, 0x0040, 0x2528, 0x6918, 0xa18d, 0x2000, 0x691a,
- 0x6814, 0xa084, 0x8000, 0x0040, 0x252f, 0x6817, 0x0000, 0x2021,
- 0x3557, 0x6800, 0x2022, 0x6a38, 0x693c, 0x6a2a, 0x692e, 0x1078,
- 0x17e7, 0x0078, 0x1bdb, 0x1078, 0x2428, 0x6827, 0x0000, 0x789b,
- 0x000e, 0x6f10, 0x1078, 0x2d87, 0xa08c, 0x00ff, 0x6912, 0x6814,
- 0xa084, 0x8000, 0x0040, 0x254e, 0x7038, 0x6816, 0xa68c, 0xdf00,
- 0x691a, 0x70a3, 0x0000, 0x0078, 0x1bdb, 0xa006, 0x1078, 0x2eca,
- 0x6813, 0x0000, 0x6817, 0x0001, 0xa68c, 0xdf00, 0x691a, 0x6827,
- 0x0000, 0x7000, 0x0079, 0x2564, 0x256c, 0x256e, 0x256e, 0x2570,
- 0x2570, 0x2570, 0x256c, 0x256c, 0x1078, 0x1b81, 0x1078, 0x28fa,
- 0x6008, 0xa084, 0xffef, 0x600a, 0x0078, 0x28c5, 0x2300, 0x0079,
- 0x2579, 0x257c, 0x257e, 0x25bc, 0x1078, 0x1b81, 0x7000, 0x0079,
- 0x2581, 0x2589, 0x258b, 0x258b, 0x2596, 0x258b, 0x259d, 0x2589,
- 0x2589, 0x1078, 0x1b81, 0xa684, 0x2000, 0x00c0, 0x2596, 0xa6b5,
- 0x2000, 0x7e5a, 0x1078, 0x30f3, 0x0078, 0x2d3b, 0x6814, 0xa084,
- 0x8000, 0x0040, 0x259d, 0x6817, 0x0007, 0x2009, 0x3518, 0x210c,
- 0xa186, 0x0000, 0x0040, 0x25b2, 0xa186, 0x0001, 0x0040, 0x25b6,
- 0x2009, 0x352b, 0x200b, 0x000b, 0x70a3, 0x0001, 0x781b, 0x0046,
- 0x0078, 0x1bd3, 0x781b, 0x00dd, 0x0078, 0x1bd3, 0x2009, 0x352b,
- 0x200b, 0x000a, 0x0078, 0x1bd3, 0x1078, 0x1b81, 0x2300, 0x0079,
- 0x25c1, 0x25c4, 0x25c6, 0x25e9, 0x1078, 0x1b81, 0x7000, 0x0079,
- 0x25c9, 0x25d1, 0x25d3, 0x25d3, 0x25de, 0x25d3, 0x25e5, 0x25d1,
- 0x25d1, 0x1078, 0x1b81, 0xa684, 0x2000, 0x00c0, 0x25de, 0xa6b5,
- 0x2000, 0x7e5a, 0x1078, 0x30f3, 0x0078, 0x2d3b, 0x6814, 0xa084,
- 0x8000, 0x0040, 0x25e5, 0x6817, 0x0007, 0x781b, 0x00e4, 0x0078,
- 0x1bd3, 0x681c, 0xa085, 0x0004, 0x681e, 0xa6b5, 0x0800, 0x1078,
- 0x2b94, 0x781b, 0x0069, 0x0078, 0x1bd3, 0x2300, 0x0079, 0x25f8,
- 0x25fb, 0x25fd, 0x25ff, 0x1078, 0x1b81, 0x1078, 0x1b81, 0xa684,
- 0x0400, 0x00c0, 0x261e, 0x782b, 0x3009, 0x789b, 0x0060, 0x78ab,
- 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 0xa184, 0x0020, 0x0040,
- 0x2616, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x261a, 0x2001, 0x0014,
- 0x0078, 0x22fd, 0xa184, 0x0007, 0x0079, 0x2656, 0x7a90, 0xa294,
- 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0040, 0x2654, 0x789b,
- 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 0x2645, 0x7ba8, 0x7ba8,
- 0xa386, 0x0001, 0x00c0, 0x2638, 0x2009, 0xfff7, 0x0078, 0x263e,
- 0xa386, 0x0003, 0x00c0, 0x2645, 0x2009, 0xffef, 0x0c7e, 0x7048,
- 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab,
- 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x691c, 0xa18c,
- 0xfdff, 0xa18c, 0xfeff, 0x691e, 0x0078, 0x2d3b, 0x2026, 0x202c,
- 0x2660, 0x2668, 0x265e, 0x265e, 0x265e, 0x2d3b, 0x1078, 0x1b81,
- 0x691c, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x691e, 0x0078, 0x2d43,
- 0x691c, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x691e, 0x0078, 0x2d3b,
- 0x79e4, 0xa184, 0x0030, 0x0040, 0x267a, 0x78ec, 0xa084, 0x0003,
- 0x00c0, 0x2682, 0x6814, 0xa085, 0x8000, 0x6816, 0x2001, 0x0014,
- 0x0078, 0x22fd, 0xa184, 0x0007, 0x0079, 0x2686, 0x2d3b, 0x2d3b,
- 0x268e, 0x2d3b, 0x2d63, 0x2d63, 0x2d3b, 0x2d3b, 0xa684, 0x0400,
- 0x00c0, 0x26bf, 0x681c, 0xa084, 0x0001, 0x0040, 0x2d43, 0xa68c,
- 0x2060, 0xa18c, 0xfffb, 0x795a, 0x69b2, 0x789b, 0x0060, 0x78ab,
- 0x0000, 0x789b, 0x0061, 0x6814, 0xa085, 0x8000, 0x6816, 0x78aa,
- 0x157e, 0x137e, 0x147e, 0x20a1, 0x012c, 0x789b, 0x0000, 0x8000,
- 0x80ac, 0xad80, 0x000a, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f,
- 0x6810, 0x8007, 0x789b, 0x007e, 0x78aa, 0x0078, 0x2d43, 0x6814,
- 0xa084, 0x8000, 0x0040, 0x26c6, 0x6817, 0x0008, 0x781b, 0x00d8,
- 0x0078, 0x1bd3, 0x2300, 0x0079, 0x26cd, 0x26d2, 0x274d, 0x26d0,
- 0x1078, 0x1b81, 0x7000, 0xa084, 0x0007, 0x0079, 0x26d7, 0x26df,
- 0x26e1, 0x26fd, 0x26df, 0x26df, 0x24dd, 0x26df, 0x26df, 0x1078,
- 0x1b81, 0x691c, 0xa18d, 0x0001, 0x691e, 0x6800, 0x6006, 0xa005,
- 0x00c0, 0x26eb, 0x6002, 0x6818, 0xa084, 0x000e, 0x0040, 0x26f7,
- 0x7014, 0x68b6, 0x712c, 0xa188, 0x3e80, 0x0078, 0x26f9, 0x2009,
- 0x3f80, 0x2104, 0x6802, 0x2d0a, 0x7156, 0x6eb2, 0xa684, 0x0060,
- 0x0040, 0x274b, 0xa684, 0x0800, 0x00c0, 0x270f, 0xa684, 0x7fff,
- 0x68b2, 0x6890, 0x6894, 0x1078, 0x2eca, 0x0078, 0x274b, 0xa684,
- 0x0020, 0x0040, 0x2721, 0xa006, 0x1078, 0x3197, 0x78d0, 0x8003,
- 0x00c8, 0x271d, 0x78d4, 0x1078, 0x31fc, 0x79d8, 0x7adc, 0x0078,
- 0x2725, 0x1078, 0x2cb9, 0x1078, 0x3197, 0xa684, 0x8000, 0x0040,
- 0x274b, 0xa684, 0x7fff, 0x68b2, 0x789b, 0x0074, 0x1078, 0x2d87,
- 0x2010, 0x1078, 0x2d87, 0x2008, 0xa684, 0x0020, 0x00c0, 0x2743,
- 0x1078, 0x2d87, 0x801b, 0x00c8, 0x273e, 0x8000, 0xa084, 0x003f,
- 0xa108, 0xa291, 0x0000, 0x6b94, 0x2100, 0xa302, 0x68ae, 0x6b90,
- 0x2200, 0xa303, 0x68aa, 0x0078, 0x1bdb, 0x0078, 0x2b81, 0x7033,
- 0x0000, 0xa282, 0x0005, 0x0050, 0x2757, 0x1078, 0x1b81, 0x2300,
- 0x0079, 0x275a, 0x275d, 0x2767, 0x278a, 0x2200, 0x0079, 0x2760,
- 0x2765, 0x2b81, 0x2765, 0x27b3, 0x2804, 0x1078, 0x1b81, 0x7000,
- 0xa086, 0x0001, 0x00c0, 0x2774, 0x1078, 0x28fa, 0x1078, 0x2eca,
- 0x7034, 0x600a, 0x0078, 0x2779, 0x7000, 0xa086, 0x0003, 0x0040,
- 0x276e, 0x7003, 0x0005, 0x2001, 0x3f90, 0x2068, 0x703e, 0x7032,
- 0x2200, 0x0079, 0x2783, 0x2b81, 0x2788, 0x27b3, 0x2788, 0x2b81,
- 0x1078, 0x1b81, 0x7000, 0xa086, 0x0001, 0x00c0, 0x2797, 0x1078,
- 0x28fa, 0x1078, 0x2eca, 0x7034, 0x600a, 0x0078, 0x279c, 0x7000,
- 0xa086, 0x0003, 0x0040, 0x2791, 0x7003, 0x0005, 0x2001, 0x3f90,
- 0x2068, 0x703e, 0x7032, 0x2200, 0x0079, 0x27a6, 0x27ad, 0x27ab,
- 0x27ad, 0x27ab, 0x27ad, 0x1078, 0x1b81, 0x1078, 0x2ba4, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x7000, 0xa086, 0x0001, 0x00c0, 0x27c0,
- 0x1078, 0x28fa, 0x1078, 0x2eca, 0x7034, 0x600a, 0x0078, 0x27c5,
- 0x7000, 0xa086, 0x0003, 0x0040, 0x27ba, 0x7003, 0x0002, 0x7a80,
- 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x0007, 0xa215,
- 0x2069, 0x3f80, 0x2d04, 0x2d08, 0x7156, 0x2068, 0xa005, 0x0040,
- 0x27e0, 0x6810, 0xa206, 0x0040, 0x27f9, 0x6800, 0x0078, 0x27d3,
- 0x7003, 0x0005, 0x2001, 0x3f90, 0x2068, 0x703e, 0x7032, 0x157e,
- 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, 0x0070, 0x27f1, 0x0078,
- 0x27ea, 0x157f, 0x6a12, 0x68b3, 0x0700, 0x681f, 0x0800, 0x6823,
- 0x0003, 0x6eb0, 0x7e5a, 0x681c, 0xa084, 0x0c00, 0x0040, 0x285a,
- 0x1078, 0x2b9c, 0x0078, 0x285a, 0x7000, 0xa086, 0x0001, 0x00c0,
- 0x2811, 0x1078, 0x28fa, 0x1078, 0x2eca, 0x7034, 0x600a, 0x0078,
- 0x2816, 0x7000, 0xa086, 0x0003, 0x0040, 0x280b, 0x7003, 0x0002,
- 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x0007,
- 0xa215, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0xa1e8, 0x3e80, 0x2d04,
- 0x2d08, 0x7156, 0x2068, 0xa005, 0x0040, 0x2835, 0x6810, 0xa206,
- 0x0040, 0x284e, 0x6800, 0x0078, 0x2828, 0x7003, 0x0005, 0x2001,
- 0x3f90, 0x2068, 0x703e, 0x7032, 0x157e, 0x20a9, 0x002f, 0x2003,
- 0x0000, 0x8000, 0x0070, 0x2846, 0x0078, 0x283f, 0x157f, 0x6a12,
- 0x68b3, 0x0700, 0x681f, 0x0800, 0x6823, 0x0003, 0x6eb0, 0x7e5a,
- 0x681c, 0xa084, 0x0c00, 0x0040, 0x285a, 0x1078, 0x2b98, 0x7e58,
- 0x0078, 0x285a, 0x027e, 0x8207, 0xa084, 0x000f, 0x8003, 0x8003,
- 0x8003, 0xa080, 0x3600, 0x2060, 0x704a, 0x6000, 0x704e, 0x6004,
- 0x7052, 0xa684, 0x0060, 0x0040, 0x2891, 0x6b94, 0x6c90, 0x69a8,
- 0x68ac, 0xa105, 0x00c0, 0x287f, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde,
- 0xa6b4, 0xb7ff, 0x7e5a, 0x1078, 0x30f3, 0x0078, 0x2891, 0x68ac,
- 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x0040, 0x2891, 0x7bd2,
- 0x7bda, 0x7cd6, 0x7cde, 0x68ac, 0xa6b4, 0xbfff, 0x7e5a, 0x1078,
- 0x3120, 0x077f, 0x1078, 0x2cac, 0x2009, 0x006a, 0xa684, 0x0008,
- 0x0040, 0x289c, 0x2009, 0x0069, 0xa6b5, 0x2000, 0x7e5a, 0x791a,
- 0x2d00, 0x703e, 0x8207, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
- 0xa080, 0x3600, 0x2048, 0x0078, 0x1bd3, 0x6020, 0xa005, 0x0040,
- 0x28b9, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 0x600a, 0x7010,
- 0x6026, 0x007c, 0xa006, 0x1078, 0x2eca, 0x6813, 0x0000, 0x6817,
- 0x0001, 0x681f, 0x0040, 0x681b, 0x0100, 0x7000, 0xa084, 0x0007,
- 0x0079, 0x28ca, 0x28d2, 0x28d4, 0x28d4, 0x28e0, 0x28dc, 0x28d2,
- 0x28d2, 0x28d2, 0x1078, 0x1b81, 0x1078, 0x28eb, 0x1078, 0x28e4,
- 0x1078, 0x17e7, 0x0078, 0x1bdb, 0x70a3, 0x0000, 0x0078, 0x1bdb,
- 0x6817, 0x0000, 0x0078, 0x2513, 0x6800, 0xa005, 0x00c0, 0x28e9,
- 0x6002, 0x6006, 0x007c, 0x6010, 0xa005, 0x0040, 0x28f4, 0x8001,
- 0x00d0, 0x28f4, 0x1078, 0x1b81, 0x6012, 0x6008, 0xa084, 0xffef,
- 0x600a, 0x007c, 0x6018, 0xa005, 0x0040, 0x2900, 0x8001, 0x601a,
- 0x007c, 0x1078, 0x2d82, 0x6817, 0x0018, 0x0078, 0x2931, 0x1078,
- 0x2d82, 0x6817, 0x0019, 0x0078, 0x2931, 0x1078, 0x2d82, 0x6817,
- 0x001a, 0x0078, 0x2931, 0x77b4, 0x1078, 0x2cac, 0x71b8, 0xa18c,
- 0x00ff, 0xa1e8, 0x3e80, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0,
- 0x2923, 0x0078, 0x1bdb, 0x6810, 0x72b4, 0xa206, 0x0040, 0x292b,
- 0x6800, 0x0078, 0x291c, 0x6800, 0x200a, 0x6817, 0x0005, 0x70bf,
- 0x0000, 0x1078, 0x28eb, 0x681c, 0xa084, 0x0001, 0x00c0, 0x293a,
- 0x1078, 0x28e4, 0x1078, 0x28fa, 0x681b, 0x0000, 0x681f, 0x0020,
- 0x1078, 0x17e7, 0x0078, 0x1bdb, 0xa282, 0x0003, 0x00c0, 0x2b75,
- 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x691c, 0xa18d,
- 0x0080, 0x691e, 0xa184, 0x0100, 0x0040, 0x29a4, 0xa18c, 0xfeff,
- 0x691e, 0xa6b4, 0x00ff, 0x0040, 0x298e, 0xa682, 0x000f, 0x0048,
- 0x2965, 0x0040, 0x2965, 0x2031, 0x000f, 0x852b, 0x852b, 0x1078,
- 0x2c2f, 0x0040, 0x296f, 0x1078, 0x2a3e, 0x0078, 0x2997, 0x1078,
- 0x2bea, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078,
- 0x2a62, 0x0c7f, 0x691c, 0xa18d, 0x0100, 0x691e, 0x7e58, 0xa6b5,
- 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x298a, 0x781b, 0x0055,
- 0x0078, 0x1bd3, 0x781b, 0x0069, 0x0078, 0x1bd3, 0x0c7e, 0x2960,
- 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x2a62, 0x0c7f, 0x7e58,
- 0xa684, 0x0400, 0x00c0, 0x29a0, 0x781b, 0x0058, 0x0078, 0x1bd3,
- 0x781b, 0x006a, 0x0078, 0x1bd3, 0x0c7e, 0x7048, 0x2060, 0x6100,
- 0xa18c, 0x1000, 0x0040, 0x29e4, 0x6208, 0x8217, 0xa294, 0x00ff,
- 0xa282, 0x000f, 0x0048, 0x29b8, 0x0040, 0x29b8, 0x2011, 0x000f,
- 0x2600, 0xa202, 0x00c8, 0x29bd, 0x2230, 0x6208, 0xa294, 0x00ff,
- 0x7018, 0xa086, 0x0028, 0x00c0, 0x29cd, 0xa282, 0x0019, 0x00c8,
- 0x29d3, 0x2011, 0x0019, 0x0078, 0x29d3, 0xa282, 0x000c, 0x00c8,
- 0x29d3, 0x2011, 0x000c, 0x2200, 0xa502, 0x00c8, 0x29d8, 0x2228,
- 0x1078, 0x2bee, 0x852b, 0x852b, 0x1078, 0x2c2f, 0x0040, 0x29e4,
- 0x1078, 0x2a3e, 0x0078, 0x29e8, 0x1078, 0x2bea, 0x1078, 0x2a62,
- 0x7858, 0xa085, 0x0004, 0x785a, 0x0c7f, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0x0c7e, 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x2a0c,
- 0x6010, 0xa084, 0x000f, 0x00c0, 0x2a06, 0xa18c, 0x0002, 0x00c0,
- 0x2a06, 0xa18c, 0xfff5, 0x6106, 0x0c7f, 0x007c, 0x2011, 0x0032,
- 0x2019, 0x0000, 0x0078, 0x2a2e, 0x6208, 0xa294, 0x00ff, 0x7018,
- 0xa086, 0x0028, 0x00c0, 0x2a1c, 0xa282, 0x0019, 0x00c8, 0x2a22,
- 0x2011, 0x0019, 0x0078, 0x2a22, 0xa282, 0x000c, 0x00c8, 0x2a22,
- 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000f,
- 0x0048, 0x2a2e, 0x0040, 0x2a2e, 0x2019, 0x000f, 0x78ab, 0x0001,
- 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005,
- 0x681c, 0xa085, 0x0100, 0x681e, 0x0c7f, 0x007c, 0x0c7e, 0x7148,
- 0x2160, 0x2008, 0xa084, 0xfff0, 0xa635, 0x7e86, 0x6018, 0x789a,
- 0x7eae, 0x6612, 0x78a4, 0xa084, 0xfff8, 0xa18c, 0x0007, 0xa105,
- 0x78a6, 0x6016, 0x788a, 0xa6b4, 0x000f, 0x8637, 0x8204, 0x8004,
- 0xa084, 0x00ff, 0xa605, 0x600e, 0x6004, 0xa084, 0xfff5, 0x6006,
- 0x0c7f, 0x007c, 0x0c7e, 0x7048, 0x2060, 0x6018, 0x789a, 0x78a4,
- 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 0xa084, 0xfff0, 0x7886,
- 0x0c7f, 0x007c, 0xa282, 0x0002, 0x00c0, 0x2b75, 0x7aa8, 0x691c,
- 0xa18d, 0x0080, 0x691e, 0xa184, 0x0200, 0x0040, 0x2ab7, 0xa18c,
- 0xfdff, 0x691e, 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8, 0x2b75,
- 0x1078, 0x2afe, 0x1078, 0x2a62, 0xa980, 0x0001, 0x200c, 0x1078,
- 0x2ca8, 0x1078, 0x29f1, 0x88ff, 0x0040, 0x2aaa, 0x789b, 0x0060,
- 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400,
- 0x00c0, 0x2aa6, 0x781b, 0x0055, 0x0078, 0x1bd3, 0x781b, 0x0069,
- 0x0078, 0x1bd3, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x2ab3, 0x781b,
- 0x0058, 0x0078, 0x1bd3, 0x781b, 0x006a, 0x0078, 0x1bd3, 0xa282,
- 0x0002, 0x00c8, 0x2abf, 0xa284, 0x0001, 0x0040, 0x2ac9, 0x7148,
- 0xa188, 0x0000, 0x210c, 0xa18c, 0x2000, 0x00c0, 0x2ac9, 0x2011,
- 0x0000, 0x1078, 0x2bdc, 0x1078, 0x2afe, 0x1078, 0x2a62, 0x7858,
- 0xa085, 0x0004, 0x785a, 0x781b, 0x0069, 0x0078, 0x1bd3, 0x0c7e,
- 0x027e, 0x2960, 0x6000, 0x2011, 0x0001, 0xa084, 0x2000, 0x00c0,
- 0x2aee, 0x6014, 0xa084, 0x0040, 0x00c0, 0x2aec, 0xa18c, 0xffef,
- 0x6106, 0xa006, 0x0078, 0x2afb, 0x2011, 0x0000, 0x78ab, 0x0001,
- 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x681c,
- 0xa085, 0x0200, 0x681e, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7048,
- 0x2060, 0x82ff, 0x0040, 0x2b06, 0x2011, 0x0040, 0x6018, 0xa080,
- 0x0002, 0x789a, 0x78a4, 0xa084, 0xffbf, 0xa205, 0x78a6, 0x6016,
- 0x788a, 0x6004, 0xa084, 0xffef, 0x6006, 0x0c7f, 0x007c, 0x007e,
- 0x7000, 0xa086, 0x0003, 0x0040, 0x2b20, 0x007f, 0x0078, 0x2b23,
- 0x007f, 0x0078, 0x2b71, 0xa684, 0x0020, 0x0040, 0x2b71, 0x7888,
- 0xa084, 0x0040, 0x0040, 0x2b71, 0x78a8, 0x8001, 0x0040, 0x2b30,
- 0x7bb8, 0xa384, 0x003f, 0x831b, 0x00c8, 0x2b37, 0x8000, 0xa005,
- 0x0040, 0x2b58, 0x831b, 0x00c8, 0x2b40, 0x8001, 0x0040, 0x2b6d,
- 0xa006, 0x1078, 0x3197, 0x78b4, 0x1078, 0x31fc, 0x0078, 0x2b71,
- 0xa684, 0x4000, 0x0040, 0x2b58, 0x78b8, 0x801b, 0x00c8, 0x2b51,
- 0x8000, 0xa084, 0x003f, 0x00c0, 0x2b6d, 0xa6b4, 0xbfff, 0x7e5a,
- 0x79d8, 0x7adc, 0x2001, 0x0001, 0xa108, 0x00c8, 0x2b61, 0xa291,
- 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x1078, 0x3197, 0x781b,
- 0x0067, 0x1078, 0x3061, 0x0078, 0x1bd3, 0x781b, 0x0067, 0x0078,
- 0x1bd3, 0x781b, 0x006a, 0x0078, 0x1bd3, 0x1078, 0x2ba8, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x1078, 0x2b94, 0x781b, 0x0069, 0x0078,
- 0x1bd3, 0x6823, 0x0002, 0x1078, 0x2b9c, 0x691c, 0xa18d, 0x0020,
- 0x691e, 0x6814, 0xa084, 0x8000, 0x0040, 0x2b90, 0x6817, 0x0005,
- 0x781b, 0x0069, 0x0078, 0x1bd3, 0x2001, 0x0005, 0x0078, 0x2baa,
- 0x2001, 0x000c, 0x0078, 0x2baa, 0x2001, 0x0006, 0x0078, 0x2baa,
- 0x2001, 0x000d, 0x0078, 0x2baa, 0x2001, 0x0009, 0x0078, 0x2baa,
- 0x2001, 0x0007, 0x789b, 0x007f, 0x78aa, 0xa6b5, 0x0008, 0x7e5a,
- 0x007c, 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703,
- 0xa0e0, 0x3600, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x000f,
- 0x0040, 0x2bca, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004, 0xa085,
- 0x0008, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040,
- 0x0040, 0x2bda, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004, 0xa085,
- 0x0010, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001,
- 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab,
- 0x0004, 0x007c, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b, 0x0010,
- 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7eaa,
- 0x789b, 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007, 0xa084,
- 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4, 0xa18c,
- 0xfff0, 0x2001, 0x3546, 0x2004, 0xa082, 0x0028, 0x0040, 0x2c18,
- 0x2021, 0x2c8f, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 0x2c1e,
- 0x2021, 0x2c9b, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064,
- 0x2404, 0xa084, 0xfff0, 0xa106, 0x0040, 0x2c2d, 0x8420, 0x2300,
- 0xa210, 0x0070, 0x2c2d, 0x0078, 0x2c20, 0x157f, 0x007c, 0x157e,
- 0x2011, 0x3546, 0x2214, 0xa282, 0x0032, 0x0048, 0x2c43, 0x0040,
- 0x2c47, 0x2021, 0x2c81, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011,
- 0x0032, 0x0078, 0x2c57, 0xa282, 0x0028, 0x0040, 0x2c4f, 0x2021,
- 0x2c8f, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 0x2c55, 0x2021,
- 0x2c9b, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064, 0x2200,
- 0xa502, 0x0040, 0x2c67, 0x0048, 0x2c67, 0x8420, 0x2300, 0xa210,
- 0x0070, 0x2c64, 0x0078, 0x2c57, 0x157f, 0xa006, 0x007c, 0x157f,
- 0xa582, 0x0064, 0x00c8, 0x2c70, 0x7808, 0xa085, 0x0070, 0x780a,
- 0x78ec, 0xa084, 0x0300, 0x0040, 0x2c7e, 0x2404, 0xa09e, 0x1201,
- 0x00c0, 0x2c7e, 0x2001, 0x2101, 0x0078, 0x2c7f, 0x2404, 0xa005,
- 0x007c, 0x1201, 0x3002, 0x3202, 0x4203, 0x4403, 0x5404, 0x5604,
- 0x6605, 0x6805, 0x7806, 0x7a06, 0x0a07, 0x0c07, 0x0e07, 0x3202,
- 0x4202, 0x5202, 0x6202, 0x7202, 0x6605, 0x7605, 0x7805, 0x7a05,
- 0x7c05, 0x7e05, 0x7f05, 0x2202, 0x3202, 0x4202, 0x5202, 0x5404,
- 0x6404, 0x7404, 0x7604, 0x7804, 0x7a04, 0x7c04, 0x7e04, 0x7f04,
- 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 0x0f00, 0x800c, 0xa784,
- 0x0007, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e0, 0x3680,
- 0x007c, 0x79d8, 0x7adc, 0x78d0, 0x801b, 0x00c8, 0x2cc0, 0x8000,
- 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x007c, 0x0f7e, 0x2079,
- 0x0100, 0x2009, 0x3540, 0x2091, 0x8000, 0x2104, 0x0079, 0x2cd0,
- 0x2d02, 0x2cda, 0x2cda, 0x2cda, 0x2cda, 0x2cda, 0x2cd8, 0x2cd8,
- 0x1078, 0x1b81, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004, 0x00c0,
- 0x2cdc, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x00c0, 0x2ce3,
- 0x68b0, 0xa085, 0x4000, 0x68b2, 0x7858, 0xa085, 0x4000, 0x785a,
- 0x7830, 0xa084, 0x0080, 0x00c0, 0x2d02, 0x0018, 0x2d02, 0x6818,
- 0xa084, 0x0020, 0x00c0, 0x2d00, 0x781b, 0x00dd, 0x0078, 0x2d02,
- 0x781b, 0x00e4, 0x2091, 0x8001, 0x0f7f, 0x007c, 0x0c7e, 0x6810,
- 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0, 0x3600,
- 0x6004, 0xa084, 0x000a, 0x00c0, 0x2d39, 0x6108, 0xa194, 0xff00,
- 0x0040, 0x2d39, 0xa18c, 0x00ff, 0x2001, 0x0019, 0xa106, 0x0040,
- 0x2d28, 0x2001, 0x0032, 0xa106, 0x0040, 0x2d2c, 0x0078, 0x2d30,
- 0x2009, 0x0020, 0x0078, 0x2d32, 0x2009, 0x003f, 0x0078, 0x2d32,
- 0x2011, 0x0000, 0x2100, 0xa205, 0x600a, 0x6004, 0xa085, 0x0002,
- 0x6006, 0x0c7f, 0x007c, 0x781b, 0x006a, 0x0078, 0x1bd3, 0x781b,
- 0x0069, 0x0078, 0x1bd3, 0x781b, 0x0058, 0x0078, 0x1bd3, 0x781b,
- 0x0055, 0x0078, 0x1bd3, 0x781b, 0x00dd, 0x0078, 0x1bd3, 0x781b,
- 0x00dc, 0x0078, 0x1bd3, 0x781b, 0x00e4, 0x0078, 0x1bd3, 0x781b,
- 0x00e3, 0x0078, 0x1bd3, 0x781b, 0x009e, 0x0078, 0x1bd3, 0x781b,
- 0x009d, 0x0078, 0x1bd3, 0x70a3, 0x0001, 0x781b, 0x0046, 0x0078,
- 0x1bd3, 0x007e, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2d80, 0x7808,
- 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec,
- 0xa084, 0x0021, 0x0040, 0x2d80, 0x7808, 0xa085, 0x0002, 0x780a,
- 0x007f, 0x007c, 0x7808, 0xa085, 0x0002, 0x780a, 0x007c, 0x7830,
- 0xa084, 0x0040, 0x00c0, 0x2d87, 0x0098, 0x2d90, 0x78ac, 0x007c,
- 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005,
- 0x78ec, 0xa084, 0x0021, 0x0040, 0x2d9f, 0x0098, 0x2d9d, 0x78ac,
- 0x007e, 0x7808, 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, 0xa784,
- 0x0070, 0x0040, 0x2dab, 0x6817, 0x0003, 0x7858, 0xa084, 0x3f00,
- 0x681a, 0x682f, 0x0000, 0x682b, 0x0000, 0x784b, 0x0008, 0x78e4,
- 0xa005, 0x00d0, 0x2018, 0xa084, 0x0020, 0x0040, 0x2018, 0x78ec,
- 0xa084, 0x0003, 0x0040, 0x2018, 0x0018, 0x2018, 0x0078, 0x2b7b,
- 0x0c7e, 0x6810, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
- 0xa080, 0x3600, 0x2060, 0x2048, 0x704a, 0x6000, 0x704e, 0x6004,
- 0x7052, 0x0c7f, 0x007c, 0x0020, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
- 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0062, 0x0009, 0x0014,
- 0x0014, 0x9847, 0x0014, 0x0014, 0x98f5, 0x98e7, 0x0014, 0x0014,
- 0x0080, 0x00bf, 0x0100, 0x0402, 0x2008, 0xf880, 0xa20a, 0x0014,
- 0x300b, 0xa20c, 0x0014, 0xa200, 0x8838, 0x817e, 0x842a, 0x84a0,
- 0x3806, 0x8839, 0x28c2, 0x9cc3, 0xa805, 0x0864, 0xa83b, 0x3008,
- 0x28c1, 0x9cc3, 0xa201, 0x300c, 0x2847, 0x8161, 0x846a, 0x8000,
- 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, 0x9ca0, 0xa8f3, 0x0864,
- 0xa829, 0x300c, 0xa801, 0x3008, 0x28e1, 0x9ca0, 0x280d, 0xa204,
- 0x64c0, 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677,
- 0xa80f, 0x786e, 0x883e, 0xa80c, 0x282b, 0xa205, 0x64a0, 0x67a0,
- 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, 0x8677, 0xa801, 0x883e,
- 0x2069, 0x28c1, 0x9cc3, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8dc,
- 0xa207, 0x0014, 0xa203, 0x8000, 0x84a8, 0x85a4, 0x1872, 0x849a,
- 0x883c, 0x1fe2, 0xf601, 0xa208, 0x856e, 0x866f, 0x0704, 0x3008,
- 0x9ca0, 0x0014, 0xa202, 0x8000, 0x85a4, 0x3009, 0x84a8, 0x19e2,
- 0xf848, 0x8174, 0x86eb, 0x85eb, 0x872e, 0x87a9, 0x883f, 0x08e6,
- 0xa8f1, 0xf861, 0xa8e8, 0xf801, 0x0014, 0xf881, 0x0016, 0x85b2,
- 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, 0x8532, 0xf221, 0x0014,
- 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, 0xa206, 0x6865, 0x817f,
- 0x842a, 0x1dc1, 0x8823, 0x0016, 0x6042, 0x8008, 0xa8fa, 0x8000,
- 0x84a4, 0x8160, 0x842a, 0xf021, 0x3008, 0x84a8, 0x1dc6, 0x20d7,
- 0x8822, 0x0016, 0x8000, 0x2848, 0x1011, 0xa8fc, 0x3008, 0x8000,
- 0xa000, 0x2802, 0x1011, 0xa8fd, 0xa887, 0x3008, 0x283d, 0x1011,
- 0xa8fd, 0xa209, 0x0017, 0x300c, 0x8000, 0x85a4, 0x1de2, 0xdac1,
- 0x0014, 0x26e0, 0x873a, 0xfaa2, 0x19f2, 0x1fe2, 0x0014, 0xa20b,
- 0x0014, 0xa20d, 0x817e, 0x842a, 0x84a0, 0x3806, 0x0210, 0x9ccd,
- 0x0704, 0x0000, 0x127e, 0x2091, 0x2200, 0x2049, 0x2eca, 0x7000,
- 0x7204, 0xa205, 0x720c, 0xa215, 0x7008, 0xa084, 0xfffd, 0xa205,
- 0x0040, 0x2edc, 0x0078, 0x2ee1, 0x7003, 0x0000, 0x127f, 0x2000,
- 0x007c, 0x7000, 0xa084, 0x0001, 0x00c0, 0x2f0f, 0x7108, 0x8104,
- 0x00c8, 0x2eee, 0x1078, 0x2fab, 0x0078, 0x2ee6, 0x700c, 0xa08c,
- 0x007f, 0x0040, 0x2f0f, 0x7004, 0x8004, 0x00c8, 0x2f06, 0x7014,
- 0xa005, 0x00c0, 0x2f02, 0x7010, 0xa005, 0x0040, 0x2f06, 0xa102,
- 0x00c8, 0x2ee6, 0x7007, 0x0010, 0x0078, 0x2f0f, 0x8aff, 0x0040,
- 0x2f0f, 0x1078, 0x316e, 0x00c0, 0x2f09, 0x0040, 0x2ee6, 0x1078,
- 0x2f59, 0x7003, 0x0000, 0x127f, 0x2000, 0x007c, 0x6424, 0x84ff,
- 0x0040, 0x2f33, 0x2c70, 0x2039, 0x2f38, 0x2704, 0xae68, 0x680c,
- 0xa630, 0x6808, 0xa529, 0x8421, 0x0040, 0x2f33, 0x8738, 0x2704,
- 0xa005, 0x00c0, 0x2f1e, 0x7098, 0xa075, 0x0040, 0x2f33, 0x2039,
- 0x2f35, 0x0078, 0x2f1d, 0x007c, 0x0000, 0x0004, 0x0008, 0x000c,
- 0x0010, 0x0014, 0x0018, 0x001c, 0x0000, 0x127e, 0x2091, 0x2200,
- 0x2079, 0x3500, 0x2071, 0x0010, 0x7007, 0x000a, 0x7007, 0x0002,
- 0x7003, 0x0000, 0x2071, 0x0020, 0x7007, 0x000a, 0x7007, 0x0002,
- 0x7003, 0x0000, 0x2049, 0x0000, 0x78b3, 0x0000, 0x127f, 0x2000,
- 0x007c, 0x2049, 0x2f59, 0x7004, 0x8004, 0x00c8, 0x2f85, 0x7007,
- 0x0012, 0x7108, 0x7008, 0xa106, 0x00c0, 0x2f61, 0xa184, 0x0030,
- 0x0040, 0x2f6e, 0xa086, 0x0030, 0x00c0, 0x2f61, 0x7000, 0xa084,
- 0x0001, 0x00c0, 0x2f85, 0x7008, 0xa084, 0x000c, 0x00c0, 0x2f83,
- 0x710c, 0xa184, 0x0300, 0x00c0, 0x2f83, 0xa184, 0x007f, 0x00c0,
- 0x2f59, 0x0078, 0x2f85, 0x6817, 0x0003, 0x7007, 0x0012, 0x7007,
- 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0, 0x2f89, 0x7007, 0x0012,
- 0x7108, 0x8104, 0x0048, 0x2f8e, 0x78b3, 0x0000, 0x7003, 0x0000,
- 0x2049, 0x0000, 0x007c, 0x107e, 0x007e, 0x127e, 0x157e, 0x2091,
- 0x2200, 0x7108, 0x1078, 0x2fab, 0x157f, 0x127f, 0x2091, 0x8001,
- 0x007f, 0x107f, 0x007c, 0x7204, 0x2118, 0x7108, 0x700c, 0xa084,
- 0x0300, 0x00c0, 0x2fed, 0xa184, 0x000c, 0x00c0, 0x2fed, 0x8213,
- 0x8213, 0x8213, 0x8213, 0xa284, 0x0100, 0xa10d, 0x810b, 0x810b,
- 0x810f, 0xa184, 0x0007, 0x0079, 0x2fc5, 0x2fcf, 0x2fdf, 0x2fed,
- 0x2fdf, 0x3001, 0x3001, 0x2fed, 0x2fff, 0x1078, 0x1b81, 0x7007,
- 0x0002, 0x8aff, 0x00c0, 0x2fd8, 0x2049, 0x0000, 0x0078, 0x2fdc,
- 0x1078, 0x316e, 0x00c0, 0x2fd8, 0x78b3, 0x0000, 0x007c, 0x7007,
- 0x0002, 0x8aff, 0x00c0, 0x2fe6, 0x0078, 0x2fea, 0x1078, 0x316e,
- 0x00c0, 0x2fe6, 0x78b3, 0x0000, 0x007c, 0x7007, 0x0002, 0x1078,
- 0x2f59, 0x1078, 0x2cc6, 0x6814, 0xa084, 0x8000, 0x0040, 0x2ffa,
- 0x6817, 0x0002, 0x007c, 0x1078, 0x1b81, 0x1078, 0x1b81, 0x1078,
- 0x3053, 0x7210, 0x7114, 0x700c, 0xa09c, 0x007f, 0x2800, 0xa300,
- 0xa211, 0xa189, 0x0000, 0x78b0, 0xa005, 0x0040, 0x3013, 0x78b3,
- 0x0000, 0x0078, 0x3036, 0x1078, 0x3053, 0x2704, 0x2c58, 0xac60,
- 0x630c, 0x2200, 0xa322, 0x6308, 0x2100, 0xa31b, 0x2400, 0xa305,
- 0x0040, 0x302c, 0x00c8, 0x302c, 0x8412, 0x8210, 0x830a, 0xa189,
- 0x0000, 0x2b60, 0x0078, 0x3013, 0x2b60, 0x8a07, 0xa7ba, 0x2f35,
- 0xa73d, 0x2c00, 0x6882, 0x6f86, 0x6c8e, 0x6b8a, 0x7007, 0x0012,
- 0x1078, 0x2f59, 0x007c, 0x8738, 0x2704, 0xa005, 0x00c0, 0x3047,
- 0x6098, 0xa005, 0x0040, 0x3050, 0x2060, 0x2039, 0x2f35, 0x8a51,
- 0x0040, 0x304f, 0x7008, 0xa084, 0x00c0, 0xa086, 0x00c0, 0x007c,
- 0x2051, 0x0000, 0x007c, 0x8a50, 0x8739, 0x2704, 0xa004, 0x00c0,
- 0x3060, 0x2039, 0x2f3b, 0x6000, 0xa064, 0x00c0, 0x3060, 0x2d60,
- 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x6880, 0x2060,
- 0x6884, 0x6b88, 0x6c8c, 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff,
- 0xa0b8, 0x2f35, 0x7e08, 0xa6b5, 0x000c, 0x6818, 0xa084, 0x0040,
- 0x0040, 0x307c, 0xa6b5, 0x0001, 0x0f7e, 0x2079, 0x0100, 0x7858,
- 0x0f7f, 0xa084, 0x0040, 0x0040, 0x308b, 0xa684, 0x0001, 0x00c0,
- 0x308b, 0xa6b5, 0x0001, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
- 0x00c0, 0x308d, 0x7000, 0xa005, 0x0040, 0x3098, 0x1078, 0x1b81,
- 0x2400, 0xa305, 0x00c0, 0x309e, 0x0078, 0x30db, 0x2c58, 0x2704,
- 0xac60, 0x6004, 0xa400, 0x007e, 0x701a, 0x6000, 0xa301, 0x701e,
- 0x2009, 0x04fd, 0x2104, 0xa086, 0x04fd, 0x007f, 0x00c0, 0x30cb,
- 0xa084, 0x0001, 0x0040, 0x30cb, 0xa684, 0x0001, 0x00c0, 0x30cb,
- 0x7013, 0x0001, 0x7017, 0x0000, 0x7602, 0x7007, 0x0001, 0x78b3,
- 0x0001, 0xa4a0, 0x0001, 0xa399, 0x0000, 0x6004, 0xa400, 0x701a,
- 0x6000, 0xa301, 0x701e, 0x620c, 0x2400, 0xa202, 0x7012, 0x6208,
- 0x2300, 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078,
- 0x303b, 0x0078, 0x30dd, 0x1078, 0x316e, 0x00c0, 0x30db, 0x127f,
- 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x7007,
- 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x30e9, 0x7003, 0x0008,
- 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f,
- 0x2049, 0x30f3, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0,
- 0x30fc, 0x7000, 0xa005, 0x0040, 0x3107, 0x1078, 0x1b81, 0x7e08,
- 0xa6b5, 0x000c, 0x6818, 0xa084, 0x0040, 0x0040, 0x3111, 0xa6b5,
- 0x0001, 0x6824, 0xa005, 0x0040, 0x311d, 0x2050, 0x2039, 0x2f38,
- 0x2d60, 0x1078, 0x316e, 0x00c0, 0x3119, 0x127f, 0x2000, 0x007c,
- 0x127e, 0x007e, 0x017e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x037f,
- 0x047f, 0x7e08, 0xa6b5, 0x000c, 0x6818, 0xa084, 0x0040, 0x0040,
- 0x3133, 0xa6b5, 0x0001, 0x2049, 0x3120, 0x6824, 0xa055, 0x0040,
- 0x316b, 0x2d70, 0x2e60, 0x2039, 0x2f38, 0x2704, 0xae68, 0x680c,
- 0xa422, 0x6808, 0xa31b, 0x0048, 0x3158, 0x8a51, 0x00c0, 0x314a,
- 0x1078, 0x1b81, 0x8738, 0x2704, 0xa005, 0x00c0, 0x313e, 0x7098,
- 0xa075, 0x2060, 0x0040, 0x316b, 0x2039, 0x2f35, 0x0078, 0x313d,
- 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x690c, 0x2400, 0xa122,
- 0x6908, 0x2300, 0xa11b, 0x00c8, 0x3167, 0x1078, 0x1b81, 0x2071,
- 0x0020, 0x0078, 0x308b, 0x127f, 0x2000, 0x007c, 0x7008, 0xa084,
- 0x00c0, 0xa086, 0x00c0, 0x0040, 0x3196, 0x2704, 0xac08, 0x2104,
- 0x701e, 0x8108, 0x2104, 0x701a, 0x8108, 0x2104, 0x7016, 0x8108,
- 0x2104, 0x7012, 0x0f7e, 0x2079, 0x0100, 0x7858, 0x0f7f, 0xa084,
- 0x0040, 0x0040, 0x3191, 0xa684, 0x0001, 0x00c0, 0x3191, 0xa6b5,
- 0x0001, 0x7602, 0x7007, 0x0001, 0x1078, 0x303b, 0x007c, 0x127e,
- 0x007e, 0x0d7e, 0x2091, 0x2200, 0x2049, 0x3197, 0x0d7f, 0x087f,
- 0x7108, 0xa184, 0x00c0, 0x00c0, 0x31ad, 0x6824, 0xa005, 0x0040,
- 0x31bd, 0x0078, 0x2ee1, 0x0078, 0x31bd, 0x7108, 0x8104, 0x00c8,
- 0x31b5, 0x1078, 0x2fab, 0x0078, 0x31a0, 0x7007, 0x0010, 0x7108,
- 0x8104, 0x00c8, 0x31b7, 0x1078, 0x2fab, 0x7008, 0xa086, 0x0002,
- 0x00c0, 0x31a0, 0x7000, 0xa005, 0x00c0, 0x31a0, 0x7003, 0x0000,
- 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 0x127e, 0x147e, 0x137e,
- 0x157e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x31cd, 0xad80,
- 0x0010, 0x20a0, 0x2099, 0x0031, 0x700c, 0xa084, 0x007f, 0x6826,
- 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0040, 0x31eb,
- 0x8000, 0x80ac, 0x53a5, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
- 0x00c0, 0x31ed, 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f,
- 0x147f, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091,
- 0x2200, 0x0d7f, 0x2049, 0x31fc, 0x6880, 0x2060, 0x6884, 0x6b88,
- 0x6c8c, 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff, 0xa0b8, 0x2f35,
- 0x7e08, 0xa6b5, 0x0004, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
- 0x00c0, 0x3215, 0x2c58, 0x2704, 0xac60, 0x6004, 0xa400, 0x701a,
- 0x6000, 0xa301, 0x701e, 0x7013, 0x0001, 0x7017, 0x0000, 0x7602,
- 0x7007, 0x0001, 0x007f, 0x8007, 0x2009, 0x0031, 0x200a, 0x00a0,
- 0x322f, 0x7108, 0x7007, 0x0002, 0x810c, 0x00c8, 0x322f, 0x810c,
- 0x0048, 0x323c, 0x0078, 0x2fed, 0xa4a0, 0x0001, 0xa399, 0x0000,
- 0x6b8a, 0x6c8e, 0x7007, 0x0004, 0x2049, 0x0000, 0x7003, 0x0000,
- 0x127f, 0x2000, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086,
- 0x818e, 0x00c8, 0x3254, 0xa200, 0x00f0, 0x324f, 0x8086, 0x818e,
- 0x007c, 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x327a, 0xa11a,
- 0x00c8, 0x327a, 0x8213, 0x818d, 0x0048, 0x326d, 0xa11a, 0x00c8,
- 0x326e, 0x00f0, 0x3262, 0x0078, 0x3272, 0xa11a, 0x2308, 0x8210,
- 0x00f0, 0x3262, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f,
- 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x3276,
- 0x00e0, 0x32c2, 0x2091, 0x6000, 0x7820, 0x8001, 0x7822, 0x00c0,
- 0x32bc, 0x7824, 0x7822, 0x2091, 0x8000, 0x2069, 0x3540, 0x6800,
- 0xa084, 0x0007, 0x0040, 0x32a4, 0xa086, 0x0002, 0x0040, 0x32a4,
- 0x6830, 0xa00d, 0x0040, 0x32a4, 0x2104, 0xa005, 0x0040, 0x32a4,
- 0x8001, 0x200a, 0x0040, 0x3372, 0x2061, 0x3680, 0x20a9, 0x0080,
- 0x6034, 0xa005, 0x0040, 0x32b6, 0x8001, 0x6036, 0x00c0, 0x32b6,
- 0x6010, 0xa005, 0x0040, 0x32b6, 0x1078, 0x1a23, 0xace0, 0x0010,
- 0x0070, 0x32bc, 0x0078, 0x32a8, 0x1078, 0x32d7, 0x1078, 0x32c5,
- 0x1078, 0x32fc, 0x2091, 0x8001, 0x007c, 0x783c, 0x8001, 0x783e,
- 0x00c0, 0x32d6, 0x7840, 0x783e, 0x7848, 0xa005, 0x0040, 0x32d6,
- 0x8001, 0x784a, 0x00c0, 0x32d6, 0x1078, 0x1a23, 0x007c, 0x7834,
- 0x8001, 0x7836, 0x00c0, 0x32fb, 0x7838, 0x7836, 0x2091, 0x8000,
- 0x7844, 0xa005, 0x00c0, 0x32e6, 0x2001, 0x0101, 0x8001, 0x7846,
- 0xa080, 0x3e80, 0x2040, 0x2004, 0xa065, 0x0040, 0x32fb, 0x6020,
- 0xa005, 0x0040, 0x32f7, 0x8001, 0x6022, 0x0040, 0x332b, 0x6000,
- 0x2c40, 0x0078, 0x32ec, 0x007c, 0x7828, 0x8001, 0x782a, 0x00c0,
- 0x332a, 0x782c, 0x782a, 0x7830, 0xa005, 0x00c0, 0x3309, 0x2001,
- 0x0080, 0x8001, 0x7832, 0x8003, 0x8003, 0x8003, 0x8003, 0xa090,
- 0x3680, 0xa298, 0x0002, 0x2304, 0xa084, 0x0008, 0x0040, 0x332a,
- 0xa290, 0x0009, 0x2204, 0xa005, 0x0040, 0x3322, 0x8001, 0x2012,
- 0x00c0, 0x332a, 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080, 0x201a,
- 0x1078, 0x1a23, 0x007c, 0x2069, 0x3540, 0x6800, 0xa005, 0x0040,
- 0x3335, 0x683c, 0xac06, 0x0040, 0x3372, 0x6017, 0x0006, 0x60b0,
- 0xa084, 0x3f00, 0x601a, 0x601c, 0xa084, 0x00ff, 0xa085, 0x0060,
- 0x601e, 0x6000, 0x2042, 0x6710, 0x6fb6, 0x1078, 0x169c, 0x6818,
- 0xa005, 0x0040, 0x334d, 0x8001, 0x681a, 0x6808, 0xa084, 0xffef,
- 0x680a, 0x6810, 0x8001, 0x00d0, 0x3357, 0x1078, 0x1b81, 0x6812,
- 0x602f, 0x0000, 0x602b, 0x0000, 0x2c68, 0x1078, 0x17e7, 0x2069,
- 0x3540, 0x2001, 0x0006, 0x68a2, 0x7944, 0xa184, 0x0100, 0x00c0,
- 0x336d, 0x69ba, 0x2001, 0x0004, 0x68a2, 0x1078, 0x1a1e, 0x2091,
- 0x8001, 0x007c, 0x2009, 0x354f, 0x2164, 0x2069, 0x0100, 0x6017,
- 0x0006, 0x6858, 0xa084, 0x3f00, 0x601a, 0x601c, 0xa084, 0x00ff,
- 0xa085, 0x0048, 0x601e, 0x602f, 0x0000, 0x602b, 0x0000, 0x6830,
- 0xa084, 0x0040, 0x0040, 0x33ac, 0x684b, 0x0004, 0x20a9, 0x0014,
- 0x6848, 0xa084, 0x0004, 0x0040, 0x3399, 0x0070, 0x3399, 0x0078,
- 0x3390, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001,
- 0x0040, 0x33a6, 0x0070, 0x33a6, 0x0078, 0x339d, 0x20a9, 0x00fa,
- 0x0070, 0x33ac, 0x0078, 0x33a8, 0x6808, 0xa084, 0xfffd, 0x680a,
- 0x681b, 0x0046, 0x2009, 0x3568, 0x200b, 0x0007, 0x784c, 0x784a,
- 0x2091, 0x8001, 0x007c, 0x2079, 0x3500, 0x1078, 0x3404, 0x1078,
- 0x33cc, 0x1078, 0x33e1, 0x1078, 0x33f6, 0x7833, 0x0000, 0x7847,
- 0x0000, 0x784b, 0x0000, 0x007c, 0x2019, 0x000a, 0x2011, 0x3546,
- 0x2204, 0xa086, 0x0032, 0x0040, 0x33de, 0x2019, 0x000c, 0x2204,
- 0xa086, 0x003c, 0x0040, 0x33de, 0x2019, 0x0008, 0x7b2a, 0x7b2e,
- 0x007c, 0x2019, 0x0030, 0x2011, 0x3546, 0x2204, 0xa086, 0x0032,
- 0x0040, 0x33f3, 0x2019, 0x0039, 0x2204, 0xa086, 0x003c, 0x0040,
- 0x33f3, 0x2019, 0x0027, 0x7b36, 0x7b3a, 0x007c, 0x2019, 0x000d,
- 0x2011, 0x3546, 0x2204, 0xa086, 0x003c, 0x0040, 0x3401, 0x2019,
- 0x000a, 0x7b3e, 0x7b42, 0x007c, 0x2019, 0x2faf, 0x2011, 0x3546,
- 0x2204, 0xa086, 0x0032, 0x0040, 0x3416, 0x2019, 0x3971, 0x2204,
- 0xa086, 0x003c, 0x0040, 0x3416, 0x2019, 0x2626, 0x7b22, 0x7b26,
- 0x007c, 0xda3e
-};
-#define ISP_CODE_LENGTH 0x241a
-#endif
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index 1b8b9d893a7ee..b93775007e833 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -1,5 +1,4 @@
-/* $Id: isp.c,v 1.10 1999/01/10 02:55:10 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Machine and OS Independent (well, as best as possible)
* code for the Qlogic ISP SCSI adapters.
@@ -52,7 +51,7 @@
#include <dev/isp/isp_freebsd.h>
#endif
#ifdef __linux__
-#include "isp_linux.h"
+#include <isp_linux.h>
#endif
/*
@@ -64,7 +63,7 @@
/*
* Local static data
*/
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
static const char tgtiqd[36] = {
0x03, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x51, 0x4C, 0x4F, 0x47, 0x49, 0x43, 0x20, 0x20,
@@ -89,16 +88,11 @@ static const char tgtiqd[36] = {
/*
* Local function prototypes.
*/
-static int isp_parse_async __P((struct ispsoftc *, int));
+static int isp_parse_async __P((struct ispsoftc *, u_int16_t));
static int isp_handle_other_response
__P((struct ispsoftc *, ispstatusreq_t *, u_int8_t *));
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
static int isp_modify_lun __P((struct ispsoftc *, int, int, int));
-static void isp_notify_ack __P((struct ispsoftc *, void *));
-static void isp_handle_atio __P((struct ispsoftc *, void *));
-static void isp_handle_atio2 __P((struct ispsoftc *, void *));
-static void isp_handle_ctio __P((struct ispsoftc *, void *));
-static void isp_handle_ctio2 __P((struct ispsoftc *, void *));
#endif
static void isp_parse_status
__P((struct ispsoftc *, ispstatusreq_t *, ISP_SCSI_XFER_T *));
@@ -107,7 +101,7 @@ static void isp_fw_state __P((struct ispsoftc *));
static void isp_dumpregs __P((struct ispsoftc *, const char *));
static void isp_dumpxflist __P((struct ispsoftc *));
static void isp_prtstst __P((ispstatusreq_t *));
-static char *isp2100_fw_statename __P((int));
+static char *isp2100_fw_statename __P((u_int8_t));
static void isp_mboxcmd __P((struct ispsoftc *, mbreg_t *));
static void isp_update __P((struct ispsoftc *));
@@ -128,7 +122,7 @@ isp_reset(isp)
{
static char once = 1;
mbreg_t mbs;
- int loops, i, dodnld = 1, deadchip;
+ int loops, i, dodnld = 1;
char *revname;
isp->isp_state = ISP_NILSTATE;
@@ -139,26 +133,16 @@ isp_reset(isp)
* here.
*/
isp->isp_dblev = DFLT_DBLEVEL;
- deadchip = ISP_READ(isp, HCCR) & HCCR_RESET;
- if (deadchip) {
- ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
- if (ISP_READ(isp, HCCR) & HCCR_RESET) {
- isp_dumpregs(isp, "still reset after release");
- SYS_DELAY(1000);
- } else {
- deadchip = 1;
- }
- }
-
if (isp->isp_type & ISP_HA_FC) {
revname = "2100";
} else {
sdparam *sdp = isp->isp_param;
- i = ISP_READ(isp, BIU_CONF0) & BIU_CONF0_HW_MASK;
- switch (i) {
+
+ int rev = ISP_READ(isp, BIU_CONF0) & BIU_CONF0_HW_MASK;
+ switch (rev) {
default:
PRINTF("%s: unknown chip rev. 0x%x- assuming a 1020\n",
- isp->isp_name, i);
+ isp->isp_name, rev);
/* FALLTHROUGH */
case 1:
revname = "1020";
@@ -195,20 +179,16 @@ isp_reset(isp)
* Try and figure out if we're connected to a differential bus.
* You have to pause the RISC processor to read SXP registers.
*/
- if (deadchip == 0) {
- ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE);
- i = 100;
- while ((ISP_READ(isp, HCCR) & HCCR_PAUSE) == 0) {
- SYS_DELAY(20);
- if (--i == 0) {
- isp_dumpregs(isp,
- "cannot stop RISC processor");
- i = -1;
- break;
- }
+ ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE);
+ i = 100;
+ while ((ISP_READ(isp, HCCR) & HCCR_PAUSE) == 0) {
+ SYS_DELAY(20);
+ if (--i == 0) {
+ PRINTF("%s: unable to pause RISC processor\n",
+ isp->isp_name);
+ i = -1;
+ break;
}
- } else {
- i = 0;
}
if (i > 0) {
if (isp->isp_bustype != ISP_BT_SBUS) {
@@ -243,10 +223,9 @@ isp_reset(isp)
sdp->isp_clock = 40;
}
/*
- * Restart processor, if necessary.
+ * Restart processor
*/
- if (deadchip == 0)
- ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
+ ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
}
/*
* Machine dependent clock (if set) overrides
@@ -264,7 +243,7 @@ isp_reset(isp)
*/
ISP_RESET0(isp);
- if (once == 1 && deadchip == 0) {
+ if (once == 1) {
once = 0;
/*
* Get the current running firmware revision out of the
@@ -285,7 +264,6 @@ isp_reset(isp)
}
}
-
/*
* Hit the chip over the head with hammer,
* and give the ISP a chance to recover.
@@ -353,21 +331,9 @@ isp_reset(isp)
ISP_WRITE(isp, HCCR, HCCR_CMD_RESET);
SYS_DELAY(100);
- /*
- * Establish some initial burst rate thingies
- * (only for the 1XX0 boards). This really should
- * be done later after fetching from NVRAM.
- */
if (isp->isp_type & ISP_HA_SCSI) {
- u_int16_t conf1 = isp->isp_mdvec->dv_conf1;
- /*
- * Busted FIFO. Turn off all but burst enables.
- */
- if (isp->isp_type == ISP_HA_SCSI_1040A) {
- conf1 &= BIU_BURST_ENABLE;
- }
- ISP_SETBITS(isp, BIU_CONF1, conf1);
- if (conf1 & BIU_BURST_ENABLE) {
+ ISP_SETBITS(isp, BIU_CONF1, isp->isp_mdvec->dv_conf1);
+ if (isp->isp_mdvec->dv_conf1 & BIU_BURST_ENABLE) {
ISP_SETBITS(isp, CDMA_CONF, DMA_ENABLE_BURST);
ISP_SETBITS(isp, DDMA_CONF, DMA_ENABLE_BURST);
}
@@ -740,7 +706,7 @@ isp_fibre_init(isp)
fcparam *fcp;
isp_icb_t *icbp;
mbreg_t mbs;
- int count, loopid;
+ int count;
u_int8_t lwfs;
fcp = isp->isp_param;
@@ -749,41 +715,16 @@ isp_fibre_init(isp)
PRINTF("%s: can't setup DMA for mailboxes\n", isp->isp_name);
return;
}
- /*
- * For systems that don't have BIOS methods for which
- * we can easily change the NVRAM based loopid, we'll
- * override that here. Note that when we initialize
- * the firmware we may get back a different loopid than
- * we asked for anyway. XXX This is probably not the
- * best way to figure this out XXX
- */
-#ifndef __i386__
- loopid = DEFAULT_LOOPID;
-#else
- loopid = fcp->isp_loopid;
-#endif
-
icbp = (isp_icb_t *) fcp->isp_scratch;
- MEMZERO(icbp, sizeof (*icbp));
+ bzero(icbp, sizeof (*icbp));
icbp->icb_version = ICB_VERSION1;
-#ifdef ISP_TARGET_MODE
- fcp->isp_fwoptions = ICBOPT_TGT_ENABLE|ICBOPT_INI_TGTTYPE;
-#else
+
fcp->isp_fwoptions = 0;
-#endif
- fcp->isp_fwoptions |= ICBOPT_INI_ADISC|ICBOPT_FAIRNESS;
- fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE;
- fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS;
-#ifdef CHECKME
- fcp->isp_fwoptions |= ICBOPT_USE_PORTNAME;
-#endif
-#ifdef THIS_WORKED
- /*
- * This has unhappiness in target mode
- */
- fcp->isp_fwoptions |= ICBOPT_FULL_LOGIN;
+#ifdef ISP2100_TARGET_MODE
+ fcp->isp_fwoptions |= ICBOPT_TGT_ENABLE | ICBOPT_INI_TGTTYPE;
+ icbp->icb_iqdevtype = 0x23; /* DPQ_SUPPORTED/PROCESSOR */
#endif
icbp->icb_fwoptions = fcp->isp_fwoptions;
icbp->icb_maxfrmlen = fcp->isp_maxfrmlen;
@@ -796,13 +737,9 @@ isp_fibre_init(isp)
icbp->icb_execthrottle = fcp->isp_execthrottle;
icbp->icb_retry_delay = fcp->isp_retry_delay;
icbp->icb_retry_count = fcp->isp_retry_count;
- icbp->icb_hardaddr = loopid;
MAKE_NODE_NAME_FROM_WWN(icbp->icb_nodename, fcp->isp_wwn);
- if (icbp->icb_fwoptions & ICBOPT_USE_PORTNAME) {
- u_int64_t portname = fcp->isp_wwn | (2LL << 56);
- MAKE_NODE_NAME_FROM_WWN(icbp->icb_nodename, portname);
- }
+
icbp->icb_rqstqlen = RQUEST_QUEUE_LEN;
icbp->icb_rsltqlen = RESULT_QUEUE_LEN;
icbp->icb_rqstaddr[RQRSP_ADDR0015] =
@@ -851,15 +788,24 @@ isp_fibre_init(isp)
isp->isp_residx = 0;
/*
- * Wait up to 5 seconds for FW to go to READY state.
+ * Wait up to 12 seconds for FW to go to READY state.
+ * This used to be 3 seconds, but that lost.
+ *
+ * This is all very much not right. The problem here
+ * is that the cable may not be plugged in, or there
+ * may be many many members of the loop that haven't
+ * been logged into.
+ *
+ * This model of doing things doesn't support dynamic
+ * attachment, so we just plain lose (for now).
*/
lwfs = FW_CONFIG_WAIT;
for (count = 0; count < 12000; count++) {
isp_fw_state(isp);
if (lwfs != fcp->isp_fwstate) {
PRINTF("%s: Firmware State %s -> %s\n",
- isp->isp_name, isp2100_fw_statename((int)lwfs),
- isp2100_fw_statename((int)fcp->isp_fwstate));
+ isp->isp_name, isp2100_fw_statename(lwfs),
+ isp2100_fw_statename(fcp->isp_fwstate));
lwfs = fcp->isp_fwstate;
}
if (fcp->isp_fwstate == FW_READY) {
@@ -882,14 +828,16 @@ isp_fibre_init(isp)
}
fcp->isp_loopid = mbs.param[1];
fcp->isp_alpa = mbs.param[2];
- PRINTF("%s: Loop ID %d, ALPA 0x%x\n", isp->isp_name,
+ PRINTF("%s: Loop ID 0x%x, ALPA 0x%x\n", isp->isp_name,
fcp->isp_loopid, fcp->isp_alpa);
isp->isp_state = ISP_INITSTATE;
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
DISABLE_INTS(isp);
- if (isp_modify_lun(isp, 0, 1, 1)) {
- PRINTF("%s: failed to enable target mode\n",
- isp->isp_name);
+ if (isp->isp_fwrev >= ISP_FW_REV(1, 13)) {
+ if (isp_modify_lun(isp, 0, 1, 1)) {
+ PRINTF("%s: failed to establish target mode\n",
+ isp->isp_name);
+ }
}
ENABLE_INTS(isp);
#endif
@@ -900,6 +848,29 @@ isp_fibre_init(isp)
}
/*
+ * Free any associated resources prior to decommissioning and
+ * set the card to a known state (so it doesn't wake up and kick
+ * us when we aren't expecting it to).
+ *
+ * Locks are held before coming here.
+ */
+void
+isp_uninit(isp)
+ struct ispsoftc *isp;
+{
+ /*
+ * Leave with interrupts disabled.
+ */
+ DISABLE_INTS(isp);
+
+ /*
+ * Stop the watchdog timer (if started).
+ */
+ STOP_WATCHDOG(isp_watch, isp);
+}
+
+
+/*
* Start a command. Locking is assumed done in the caller.
*/
@@ -964,7 +935,7 @@ ispscsicmd(xs)
u_int8_t niptr;
ispmarkreq_t *marker = (ispmarkreq_t *) reqp;
- MEMZERO((void *) marker, sizeof (*marker));
+ bzero((void *) marker, sizeof (*marker));
marker->req_header.rqs_entry_count = 1;
marker->req_header.rqs_entry_type = RQSTYPE_MARKER;
marker->req_modifier = SYNC_ALL;
@@ -991,7 +962,7 @@ ispscsicmd(xs)
iptr = niptr;
}
- MEMZERO((void *) reqp, UZSIZE);
+ bzero((void *) reqp, UZSIZE);
reqp->req_header.rqs_entry_count = 1;
if (isp->isp_type & ISP_HA_FC) {
reqp->req_header.rqs_entry_type = RQSTYPE_T2RQS;
@@ -1046,19 +1017,12 @@ ispscsicmd(xs)
reqp->req_flags = 0;
}
}
+ reqp->req_lun_trn = XS_LUN(xs);
reqp->req_target = XS_TGT(xs);
if (isp->isp_type & ISP_HA_SCSI) {
- reqp->req_lun_trn = XS_LUN(xs);
reqp->req_cdblen = XS_CDBLEN(xs);
- } else {
-#ifdef SCCLUN
- reqp->req_scclun = XS_LUN(xs);
-#else
- reqp->req_lun_trn = XS_LUN(xs);
-#endif
-
}
- MEMCPY(reqp->req_cdb, XS_CDBP(xs), XS_CDBLEN(xs));
+ bcopy((void *)XS_CDBP(xs), reqp->req_cdb, XS_CDBLEN(xs));
IDPRINTF(5, ("%s(%d.%d): START%d cmd 0x%x datalen %d\n", isp->isp_name,
XS_TGT(xs), XS_LUN(xs), reqp->req_header.rqs_seqno,
@@ -1158,18 +1122,7 @@ isp_control(isp, ctl, arg)
break;
}
mbs.param[0] = MBOX_ABORT;
-#ifdef SCCLUN
- if (isp->isp_type & ISP_HA_FC) {
- mbs.param[1] = XS_TGT(xs) << 8;
- mbs.param[4] = 0;
- mbs.param[5] = 0;
- mbs.param[6] = XS_LUN(xs);
- } else {
- mbs.param[1] = XS_TGT(xs) << 8 | XS_LUN(xs);
- }
-#else
- mbs.param[1] = XS_TGT(xs) << 8 | XS_LUN(xs);
-#endif
+ mbs.param[1] = XS_TGT(xs) | XS_LUN(xs);
mbs.param[2] = (i+1) >> 16;
mbs.param[3] = (i+1) & 0xffff;
isp_mboxcmd(isp, &mbs);
@@ -1227,7 +1180,7 @@ isp_intr(arg)
if (ISP_READ(isp, BIU_SEMA) & 1) {
u_int16_t mbox = ISP_READ(isp, OUTMAILBOX0);
- if (isp_parse_async(isp, (int) mbox))
+ if (isp_parse_async(isp, mbox))
return (1);
ISP_WRITE(isp, BIU_SEMA, 0);
}
@@ -1319,14 +1272,14 @@ isp_intr(arg)
XS_STS(xs) = sp->req_scsi_status & 0xff;
if (isp->isp_type & ISP_HA_SCSI) {
if (sp->req_state_flags & RQSF_GOT_SENSE) {
- MEMCPY(XS_SNSP(xs), sp->req_sense_data,
+ bcopy(sp->req_sense_data, XS_SNSP(xs),
XS_SNSLEN(xs));
XS_SNS_IS_VALID(xs);
}
} else {
if (XS_STS(xs) == SCSI_CHECK) {
XS_SNS_IS_VALID(xs);
- MEMCPY(XS_SNSP(xs), sp->req_sense_data,
+ bcopy(sp->req_sense_data, XS_SNSP(xs),
XS_SNSLEN(xs));
sp->req_state_flags |= RQSF_GOT_SENSE;
}
@@ -1346,9 +1299,8 @@ isp_intr(arg)
} else {
PRINTF("%s: unknown return %x\n", isp->isp_name,
sp->req_header.rqs_entry_type);
- if (XS_NOERR(xs)) {
+ if (XS_NOERR(xs))
XS_SETERR(xs, HBA_BOTCH);
- }
}
if (isp->isp_type & ISP_HA_SCSI) {
XS_RESID(xs) = sp->req_resid;
@@ -1368,8 +1320,7 @@ isp_intr(arg)
*/
if (XS_STS(xs) == SCSI_CHECK && !(XS_IS_SNS_VALID(xs))) {
if (XS_NOERR(xs)) {
- PRINTF("%s: ARQ failure for target %d lun %d\n",
- isp->isp_name, XS_TGT(xs), XS_LUN(xs));
+ PRINTF("%s: ARQ Failure\n", isp->isp_name);
XS_SETERR(xs, HBA_ARQFAIL);
}
}
@@ -1389,8 +1340,9 @@ isp_intr(arg)
}
ISP_WRITE(isp, INMAILBOX5, optr);
- if (isp->isp_nactive > 0)
- isp->isp_nactive--;
+ isp->isp_nactive--;
+ if (isp->isp_nactive < 0)
+ isp->isp_nactive = 0;
complist[ndone++] = xs; /* defer completion call until later */
}
/*
@@ -1417,15 +1369,12 @@ isp_intr(arg)
static int
isp_parse_async(isp, mbox)
struct ispsoftc *isp;
- int mbox;
+ u_int16_t mbox;
{
switch (mbox) {
case ASYNC_BUS_RESET:
PRINTF("%s: SCSI bus reset detected\n", isp->isp_name);
isp->isp_sendmarker = 1;
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
break;
case ASYNC_SYSTEM_ERROR:
@@ -1452,16 +1401,10 @@ isp_parse_async(isp, mbox)
case ASYNC_TIMEOUT_RESET:
PRINTF("%s: timeout initiated SCSI bus reset\n", isp->isp_name);
isp->isp_sendmarker = 1;
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
break;
- case ASYNC_DEVICE_RESET:
- PRINTF("%s: device reset\n", isp->isp_name);
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
+ case ASYNC_UNSPEC_TMODE:
+ PRINTF("%s: mystery async target completion\n", isp->isp_name);
break;
case ASYNC_EXTMSG_UNDERRUN:
@@ -1497,7 +1440,6 @@ isp_parse_async(isp, mbox)
break;
case ASYNC_CTIO_DONE:
- /* Should only occur when Fast Posting Set for 2100s */
PRINTF("%s: CTIO done\n", isp->isp_name);
break;
@@ -1515,9 +1457,6 @@ isp_parse_async(isp, mbox)
case ASYNC_LOOP_RESET:
PRINTF("%s: Loop RESET\n", isp->isp_name);
-#ifdef ISP_TARGET_MODE
- isp_notify_ack(isp, NULL);
-#endif
break;
case ASYNC_PDB_CHANGED:
@@ -1544,122 +1483,62 @@ isp_handle_other_response(isp, sp, optrp)
u_int8_t iptr, optr;
int reqsize = 0;
void *ireqp = NULL;
-#ifdef ISP_TARGET_MODE
- union {
- at_entry_t *atio;
- at2_entry_t *at2io;
- ct_entry_t *ctio;
- ct2_entry_t *ct2io;
- lun_entry_t *lunen;
- in_entry_t *inot;
- in_fcentry_t *inot_fc;
- na_entry_t *nack;
- na_fcentry_t *nack_fc;
- void *voidp;
-#define atio un.atio
-#define at2io un.at2io
-#define ctio un.ctio
-#define ct2io un.ct2io
-#define lunen un.lunen
-#define inot un.inot
-#define inot_fc un.inot_fc
-#define nack un.nack
-#define nack_fc un.nack_fc
- } un;
-
- un.voidp = sp;
-#endif
-
switch (sp->req_header.rqs_entry_type) {
case RQSTYPE_REQUEST:
return (-1);
-#ifdef ISP_TARGET_MODE
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
case RQSTYPE_NOTIFY_ACK:
{
- static const char *f =
- "%s: Notify Ack Status 0x%x Sequence Id 0x%x\n"
- /*
- * The ISP is acknowleding our ack of an Immediate Notify.
- */
- if (isp->isp_type & ISP_HA_FC) {
- PRINTF(f, isp->isp_name,
- nack_fc->na-status, nack_fc->na_seqid);
- } else {
- PRINTF(f, isp->isp_name,
- nack->na_status, nack->na_seqid);
- }
+ ispnotify_t *spx = (ispnotify_t *) sp;
+ PRINTF("%s: Immediate Notify Ack %d.%d Status 0x%x Sequence "
+ "0x%x\n", isp->isp_name, spx->req_initiator, spx->req_lun,
+ spx->req_status, spx->req_sequence);
break;
}
case RQSTYPE_NOTIFY:
{
- u_int16_t seqid, status;
-
- /*
- * Either the ISP received a SCSI message it cannot handle
- * or some other out of band condition (e.g., Port Logout)
- * or it is returning an Immediate Notify entry we sent.
- */
- if (isp->isp_type & ISP_HA_FC) {
- status = inot_fc->status;
- seqid = inot_fc->in_seqid;
- } else {
- status = inot->status;
- seqid = inot->seqid & 0xff;
- }
- PRINTF("%s: Immediate Notify Status 0x%x Sequence Id 0x%x\n",
- isp->isp_name, status, seqid);
-
- switch (status) {
- case IN_MSG_RECEIVED:
- case IN_IDE_RECEIVED:
- ptisp_got_msg(ptp, &inot);
- break;
- case IN_RSRC_UNAVAIL:
- PRINTF("%s: Firmware out of ATIOs\n", isp->isp_name);
- break;
- case IN_ABORT_TASK:
- PRINTF("%s: Abort Task iid %d rx_id 0x%x\n",
- inot_fc->in_iid, seqid);
- break;
- case IN_PORT_LOGOUT:
- PRINTF("%s: Port Logout for Initiator %d\n",
- isp->isp_name, inot_fc->in_iid);
- break;
- default:
- PRINTF("%s: bad status (0x%x) in Immediate Notify\n",
- isp->isp_name, status);
- break;
-
- }
- isp_notify_ack(isp, un.voidp);
- reqsize = 0;
+ ispnotify_t *spx = (ispnotify_t *) sp;
+
+ PRINTF("%s: Notify loopid %d to lun %d req_status 0x%x "
+ "req_task_flags 0x%x seq 0x%x\n", isp->isp_name, spx->req_initiator, spx->req_lun, spx->req_status,
+ spx->req_task_flags, spx->req_sequence);
+ reqsize = sizeof (*spx);
+ spx->req_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
+ spx->req_header.rqs_entry_count = 1;
+ spx->req_header.rqs_flags = 0;
+ spx->req_header.rqs_seqno = isp->isp_seqno++;
+ spx->req_handle = (spx->req_initiator<<16) | RQSTYPE_NOTIFY_ACK;
+ if (spx->req_status == IN_RSRC_UNAVAIL)
+ spx->req_flags = LUN_INCR_CMD;
+ else if (spx->req_status == IN_NOCAP)
+ spx->req_flags = LUN_INCR_IMMED;
+ else {
+ reqsize = 0;
+ }
+ ireqp = spx;
break;
}
case RQSTYPE_ENABLE_LUN:
- case RQSTYPE_MODIFY_LUN:
- if (lunen->req_status != 1) {
- PRINTF("%s: ENABLE/MODIFY LUN returned status 0x%x\n",
- isp->isp_name, lunen->req_status);
+ {
+ isplun_t *ip = (isplun_t *) sp;
+ if (ip->req_status != 1) {
+ PRINTF("%s: ENABLE LUN returned status 0x%x\n",
+ isp->isp_name, ip->req_status);
}
break;
+ }
case RQSTYPE_ATIO2:
{
fcparam *fcp = isp->isp_param;
ispctiot2_t local, *ct2 = NULL;
ispatiot2_t *at2 = (ispatiot2_t *) sp;
- int s, lun;
+ int s;
-#ifdef SCCLUN
- lun = at2->req_scclun;
-#else
- lun = at2->req_lun;
-#endif
- PRINTF("%s: atio2 loopid %d for lun %d rxid 0x%x flags0x%x "
- "tflags0x%x ecodes0x%x rqstatus0x%x\n", isp->isp_name,
- at2->req_initiator, lun, at2->req_rxid,
- at2->req_flags, at2->req_taskflags, at2->req_execodes,
- at2->req_status);
+ PRINTF("%s: atio2 loopid %d for lun %d rxid 0x%x flags 0x%x "
+ "task flags 0x%x exec codes 0x%x\n", isp->isp_name,
+ at2->req_initiator, at2->req_lun, at2->req_rxid,
+ at2->req_flags, at2->req_taskflags, at2->req_execodes);
switch (at2->req_status & ~ATIO_SENSEVALID) {
case ATIO_PATH_INVALID:
@@ -1692,15 +1571,13 @@ isp_handle_other_response(isp, sp, optrp)
}
PRINTF("%s: datalen %d cdb0=0x%x\n", isp->isp_name,
at2->req_datalen, at2->req_cdb[0]);
- MEMZERO((void *) ct2, sizeof (*ct2));
+ bzero ((void *) ct2, sizeof (*ct2));
ct2->req_header.rqs_entry_type = RQSTYPE_CTIO2;
ct2->req_header.rqs_entry_count = 1;
ct2->req_header.rqs_flags = 0;
ct2->req_header.rqs_seqno = isp->isp_seqno++;
- ct2->req_handle = (at2->req_initiator << 16) | lun;
-#ifndef SCCLUN
- ct2->req_lun = lun;
-#endif
+ ct2->req_handle = (at2->req_initiator << 16) | at2->req_lun;
+ ct2->req_lun = at2->req_lun;
ct2->req_initiator = at2->req_initiator;
ct2->req_rxid = at2->req_rxid;
@@ -1718,16 +1595,16 @@ isp_handle_other_response(isp, sp, optrp)
ct2->req_seg_count = 1;
if (at2->req_cdb[0] == 0x12) {
s = sizeof(tgtiqd);
- MEMCPY(fcp->isp_scratch, tgtiqd, s);
+ bcopy((void *)tgtiqd, fcp->isp_scratch, s);
} else {
s = at2->req_datalen;
- MEMZERO(fcp->isp_scratch, s);
+ bzero(fcp->isp_scratch, s);
}
ct2->req_m.mode0.req_dataseg[0].ds_base =
fcp->isp_scdma;
ct2->req_m.mode0.req_dataseg[0].ds_count = s;
ct2->req_m.mode0.req_datalen = s;
-#if 1
+#if 0
if (at2->req_datalen < s) {
ct2->req_m.mode1.req_scsi_status |=
CTIO2_RESP_VALID|CTIO2_RSPOVERUN;
@@ -1741,7 +1618,7 @@ isp_handle_other_response(isp, sp, optrp)
default: /* ALL OTHERS */
ct2->req_flags |= CTIO_NODATA | CTIO2_SMODE1;
ct2->req_m.mode1.req_scsi_status = 0;
-#if 1
+#if 0
if (at2->req_datalen) {
ct2->req_m.mode1.req_scsi_status |=
CTIO2_RSPUNDERUN;
@@ -1773,8 +1650,9 @@ isp_handle_other_response(isp, sp, optrp)
ct2->req_m.mode1.req_sense_len = 18;
ct2->req_m.mode1.req_scsi_status |=
at2->req_scsi_status;
- MEMCPY(ct2->req_m.mode1.req_response,
- at2->req_sense, sizeof (at2->req_sense));
+ bcopy((void *)at2->req_sense,
+ (void *)ct2->req_m.mode1.req_response,
+ sizeof (at2->req_sense));
}
break;
}
@@ -1801,15 +1679,6 @@ isp_handle_other_response(isp, sp, optrp)
ireqp = at2;
break;
}
-#undef atio
-#undef at2io
-#undef ctio
-#undef ct2io
-#undef lunen
-#undef inot
-#undef inot_fc
-#undef nack
-#undef nack_fc
#endif
default:
PRINTF("%s: other response type %x\n", isp->isp_name,
@@ -1826,7 +1695,7 @@ isp_handle_other_response(isp, sp, optrp)
PRINTF("%s: Request Queue Overflow other response\n",
isp->isp_name);
} else {
- MEMCPY(reqp, ireqp, reqsize);
+ bcopy(ireqp, reqp, reqsize);
ISP_WRITE(isp, INMAILBOX4, iptr);
isp->isp_reqidx = iptr;
}
@@ -1834,37 +1703,7 @@ isp_handle_other_response(isp, sp, optrp)
return (0);
}
-#ifdef ISP_TARGET_MODE
-
-static void isp_tmd_newcmd_dflt __P((void *, tmd_cmd_t *));
-static void isp_tmd_event_dflt __P((void *, int));
-static void isp_tmd_notify_dflt __P((void *, tmd_notify_t *));
-
-static void isp_tgt_data_xfer __P ((tmd_cmd_t *));
-static void isp_tgt_endcmd __P ((tmd_cmd_t *, u_int8_t));
-static void isp_tgt_done __P ((tmd_cmd_t *));
-
-static void
-isp_tmd_newcmd_dflt(arg0, cmdp)
- void *arg0;
- tmd_cmd_t *cmdp;
-{
-}
-
-static void
-isp_tmd_event_dflt(arg0, event)
- void *arg0;
- int event;
-{
-}
-
-static void
-isp_tmd_notify_dflt(arg0, npt)
- void *arg0;
- tmd_notify_t *npt;
-{
-}
-
+#if defined(ISP2100_TARGET_MODE) || defined(ISP_TARGET_MODE)
/*
* Locks held, and ints disabled (if FC).
*
@@ -1890,14 +1729,13 @@ isp_modify_lun(isp, lun, icnt, ccnt)
return (-1);
}
- MEMZERO((void *) ip, sizeof (*ip));
+ bzero((void *) ip, sizeof (*ip));
ip->req_header.rqs_entry_type = RQSTYPE_ENABLE_LUN;
ip->req_header.rqs_entry_count = 1;
+ ip->req_header.rqs_flags = 0;
ip->req_header.rqs_seqno = isp->isp_seqno++;
ip->req_handle = RQSTYPE_ENABLE_LUN;
- if (isp->isp_type & ISP_HA_SCSI) {
- ip->req_lun = lun;
- }
+ ip->req_lun = lun;
ip->req_cmdcount = ccnt;
ip->req_imcount = icnt;
ip->req_timeout = 0; /* default 30 seconds */
@@ -1905,263 +1743,6 @@ isp_modify_lun(isp, lun, icnt, ccnt)
isp->isp_reqidx = iptr;
return (0);
}
-
-static void
-isp_notify_ack(isp, ptrp)
- struct ispsoftc *isp;
- void *ptrp;
-{
- void *reqp;
- u_int8_t iptr, optr;
- union {
- na_fcentry_t _naf;
- na_entry_t _nas;
- } un;
-
- MEMZERO((caddr_t)&un, sizeof (un));
- un._nas.na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK;
- un._nas.na_header.rqs_entry_count = 1;
-
- if (isp->isp_type & ISP_HA_FC) {
- na_fcentry_t *na = &un._nas;
- if (ptrp) {
- in_fcentry_t *inp = ptrp;
- na->na_iid = inp->in_iid;
- na->na_lun = inp->in_lun;
- na->na_task_flags = inp->in_task_flags;
- na->na_seqid = inp->in_seqid;
- na->na_status = inp->in_status;
- } else {
- na->na_flags = NAFC_RST_CLRD;
- }
- } else {
- na_entry_t *na = &un._nas;
- if (ptrp) {
- in_entry_t *inp = ptrp;
- na->na_iid = inp->in_iid;
- na->na_lun = inp->in_lun;
- na->na_tgt = inp->in_tgt;
- na->na_seqid = inp->in_seqid;
- } else {
- na->na_flags = NA_RST_CLRD;
- }
- }
- optr = isp->isp_reqodx = ISP_READ(isp, OUTMAILBOX4);
- iptr = isp->isp_reqidx;
- reqp = (void *) ISP_QUEUE_ENTRY(isp->isp_rquest, iptr);
- iptr = ISP_NXT_QENTRY(iptr, RQUEST_QUEUE_LEN);
- if (iptr == optr) {
- PRINTF("%s: Request Queue Overflow For isp_notify_ack\n",
- isp->isp_name);
- } else {
- MEMCPY(reqp, ireqp, sizeof (un));
- ISP_WRITE(isp, INMAILBOX4, iptr);
- isp->isp_reqidx = iptr;
- }
-}
-
-/*
- * These are dummy stubs for now until the outside framework is plugged in.
- */
-
-static void
-isp_handle_atio (isp, aep)
- struct ispsoftc *isp;
- at_entry_t *aep;
-{
- int status, connected;
- tmd_cmd_t local, *cdp = &local;
-
- /*
- * Get the ATIO status and see if we're still connected.
- */
- status = aep->at_status;
- connected = ((aep->at_flags & AT_NODISC) != 0);
-
- PRINTF("%s: ATIO status=0x%x, connected=%d\n", isp->isp_name,
- status, connected);
-
- /*
- * The firmware status (except for the SenseValid bit) indicates
- * why this ATIO was sent to us.
- * If SenseValid is set, the firware has recommended Sense Data.
- * If the Disconnects Disabled bit is set in the flags field,
- * we're still connected on the SCSI bus - i.e. the initiator
- * did not set DiscPriv in the identify message. We don't care
- * about this so it's ignored.
- */
- switch(status & ~TGTSVALID) {
- case AT_PATH_INVALID:
- /*
- * ATIO rejected by the firmware due to disabled lun.
- */
- PRINTF("%s: Firmware rejected ATIO for disabled lun %d\n",
- isp->isp_name, aep->at_lun);
- break;
-
- case AT_PHASE_ERROR:
- /*
- * Bus Pase Sequence error.
- *
- * The firmware should have filled in the correct
- * sense data.
- */
-
-
- if (status & TGTSVALID) {
- MEMCPY(&cdp->cd_sensedata, aep->at_sense,
- sizeof (cdp->cd_sensedata));
- PRINTF("%s: Bus Phase Sequence error key 0x%x\n",
- isp->isp_name, cdp->cd_sensedata[2] & 0xf);
- } else {
- PRINTF("%s: Bus Phase Sequence With No Sense\n",
- isp->isp_name);
- }
- (*isp->isp_tmd_newcmd)(isp, cdp);
- break;
-
- case AT_NOCAP:
- /*
- * Requested Capability not available
- * We sent an ATIO that overflowed the firmware's
- * command resource count.
- */
- PRINTF("%s: Firmware rejected ATIO, command count overflow\n",
- isp->isp_name);
- break;
-
- case AT_BDR_MSG:
- /*
- * If we send an ATIO to the firmware to increment
- * its command resource count, and the firmware is
- * recovering from a Bus Device Reset, it returns
- * the ATIO with this status.
- */
- PRINTF("%s: ATIO returned with BDR received\n", isp->isp_name);
- break;
-
- case AT_CDB:
- /*
- * New CDB
- */
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = aep->at_tgt;
- cdp->cd_lun = aep->at_lun;
- cdp->cd_tagtype = aep->at_tag_type;
- cdp->cd_tagval = aep->at_tag_val;
- MEMCPY(cdp->cd_cdb, aep->at_cdb, 16);
- PRINTF("%s: CDB 0x%x itl %d/%d/%d\n", isp->isp_name,
- cdp->cd_cdb[0], cdp->cd_iid, cdp->cd_tgt, cdp->cd_lun);
- (*isp->isp_tmd_newcmd)(isp, cdp);
- break;
-
- default:
- PRINTF("%s: Unknown status (0x%x) in ATIO\n",
- isp->isp_name, status);
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = aep->at_tgt;
- cdp->cd_lun = aep->at_lun;
- cdp->cd_tagtype = aep->at_tag_type;
- cdp->cd_tagval = aep->at_tag_val;
- isp_tgtcmd_done(cdp);
- break;
- }
-}
-
-static void
-isp_handle_atio2(isp, aep)
- struct ispsoftc *isp;
- at2_entry_t *aep;
-{
- int status;
- tmd_cmd_t local, *cdp = &local;
-
- /*
- * Get the ATIO2 status.
- */
- status = aep->at_status;
- PRINTD("%s: ATIO2 status=0x%x\n", status);
-
- /*
- * The firmware status (except for the SenseValid bit) indicates
- * why this ATIO was sent to us.
- * If SenseValid is set, the firware has recommended Sense Data.
- */
- switch(status & ~TGTSVALID) {
- case AT_PATH_INVALID:
- /*
- * ATIO rejected by the firmware due to disabled lun.
- */
- PRINTF("%s: Firmware rejected ATIO2 for disabled lun %d\n",
- isp->isp_name, aep->at_lun);
- break;
-
- case AT_NOCAP:
- /*
- * Requested Capability not available
- * We sent an ATIO that overflowed the firmware's
- * command resource count.
- */
- PRINTF("%s: Firmware rejected ATIO2, command count overflow\n",
- isp->isp_name);
- break;
-
- case AT_BDR_MSG:
- /*
- * If we send an ATIO to the firmware to increment
- * its command resource count, and the firmware is
- * recovering from a Bus Device Reset, it returns
- * the ATIO with this status.
- */
- PRINTF("%s: ATIO2 returned with BDR rcvd\n", isp->isp_name);
- break;
-
- case AT_CDB:
- /*
- * New CDB
- */
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = 0;
- cdp->cd_lun = aep->at_lun;
- MEMCPY(cdp->cd_cdb, aep->at_cdb, 16);
- cdp->cd_rxid = aep->at_rxid;
- cdp->cp_origdlen = aep->at_datalen;
- cdp->cp_totbytes = 0;
- PRINTF("%s: CDB 0x%x rx_id 0x%x itl %d/%d/%d dlen %d\n",
- isp->isp_name, cdp->cd_cdb[0], cdp->cd_tagval, cdp->cd_iid,
- cdp->cd_tgt, cdp->cd_lun, aep->at_datalen);
- (*isp->isp_tmd_newcmd)(isp, cdp);
- break;
-
- default:
- PRINTF("%s: Unknown status (0x%x) in ATIO2\n",
- isp->isp_name, status);
- cdp->cd_hba = isp;
- cdp->cd_iid = aep->at_iid;
- cdp->cd_tgt = aep->at_tgt;
- cdp->cd_lun = aep->at_lun;
- cdp->cp_rxid = aep->at_rxid;
- isp_tgtcmd_done(cdp);
- break;
- }
-}
-
-static void
-isp_handle_ctio(isp, cep)
- struct ispsoftc *isp;
- ct_entry_t *aep;
-{
-}
-
-static void
-isp_handle_ctio2(isp, cep)
- struct ispsoftc *isp;
- at2_entry_t *aep;
-{
-}
#endif
static void
@@ -2288,7 +1869,7 @@ isp_parse_status(isp, sp, xs)
break;
case RQCS_UNEXP_BUS_FREE:
- PRINTF("%s: target %d lun %d had an unexpected bus free\n",
+ PRINTF("%s: target %d lun %d had unexeptected bus free\n",
isp->isp_name, XS_TGT(xs), XS_LUN(xs));
break;
@@ -2323,17 +1904,8 @@ isp_parse_status(isp, sp, xs)
break;
case RQCS_QUEUE_FULL:
- PRINTF("%s: internal queues full for target %d lun %d "
- "status 0x%x\n", isp->isp_name, XS_TGT(xs), XS_LUN(xs),
- XS_STS(xs));
- /*
- * If QFULL or some other status byte is set, then this
- * isn't an error, per se.
- */
- if (XS_STS(xs) != 0) {
- XS_SETERR(xs, HBA_NOERROR);
- return;
- }
+ PRINTF("%s: internal queues full for target %d lun %d\n",
+ isp->isp_name, XS_TGT(xs), XS_LUN(xs));
break;
case RQCS_PHASE_SKIPPED:
@@ -2556,29 +2128,6 @@ isp_mboxcmd(isp, mbp)
}
- /*
- * Check for variants
- */
-#ifdef SCCLUN
- if (isp->isp_type & ISP_HA_FC) {
- switch (mbp->param[0]) {
- case MBOX_ABORT:
- inparam = 7;
- break;
- case MBOX_ABORT_DEVICE:
- case MBOX_START_QUEUE:
- case MBOX_STOP_QUEUE:
- case MBOX_SINGLE_STEP_QUEUE:
- case MBOX_ABORT_QUEUE:
- case MBOX_GET_DEV_QUEUE_STATUS:
- inparam = 3;
- break;
- default:
- break;
- }
- }
-#endif
-
command_known:
/*
@@ -2597,7 +2146,7 @@ command_known:
isp->isp_name, ISP_READ(isp, BIU_ISR));
if (ISP_READ(isp, BIU_SEMA) & 1) {
u_int16_t mbox = ISP_READ(isp, OUTMAILBOX0);
- if (isp_parse_async(isp, (int) mbox))
+ if (isp_parse_async(isp, mbox))
return;
ISP_WRITE(isp, BIU_SEMA, 0);
}
@@ -2726,13 +2275,8 @@ command_known:
isp->isp_name, opcode);
break;
- /*
- * Be silent about these...
- */
-
case ASYNC_LOOP_UP:
case ASYNC_LIP_OCCURRED:
- case ASYNC_PDB_CHANGED:
break;
default:
@@ -2850,7 +2394,6 @@ again:
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
if (mbs.param[0] == ASYNC_LIP_OCCURRED ||
- mbs.param[0] == ASYNC_PDB_CHANGED ||
mbs.param[0] == ASYNC_LOOP_UP) {
if (once++ < 2) {
goto again;
@@ -3106,14 +2649,59 @@ isp_restart(isp)
if (XS_NULL(xs)) {
continue;
}
- if (isp->isp_nactive > 0)
- isp->isp_nactive--;
+ isp->isp_nactive--;
+ if (isp->isp_nactive < 0) {
+ isp->isp_nactive = 0;
+ }
XS_RESID(xs) = XS_XFRLEN(xs);
XS_SETERR(xs, HBA_BUSRESET);
XS_CMD_DONE(xs);
}
}
+void
+isp_watch(arg)
+ void *arg;
+{
+ int i;
+ struct ispsoftc *isp = arg;
+ ISP_SCSI_XFER_T *xs;
+ ISP_LOCKVAL_DECL;
+
+ /*
+ * Look for completely dead commands (but not polled ones).
+ */
+ ISP_ILOCK(isp);
+ for (i = 0; i < RQUEST_QUEUE_LEN; i++) {
+ if ((xs = (ISP_SCSI_XFER_T *) isp->isp_xflist[i]) == NULL) {
+ continue;
+ }
+ if (XS_TIME(xs) == 0) {
+ continue;
+ }
+ XS_TIME(xs) -= (WATCH_INTERVAL * 1000);
+ /*
+ * Avoid later thinking that this
+ * transaction is not being timed.
+ * Then give ourselves to watchdog
+ * periods of grace.
+ */
+ if (XS_TIME(xs) == 0)
+ XS_TIME(xs) = 1;
+ else if (XS_TIME(xs) > -(2 * WATCH_INTERVAL * 1000)) {
+ continue;
+ }
+ if (isp_control(isp, ISPCTL_ABORT_CMD, xs)) {
+ PRINTF("%s: isp_watch failed to abort command\n",
+ isp->isp_name);
+ isp_restart(isp);
+ break;
+ }
+ }
+ ISP_IUNLOCK(isp);
+ RESTART_WATCHDOG(isp_watch, isp);
+}
+
/*
* Miscellaneous debug statements.
*/
@@ -3159,7 +2747,7 @@ isp_prtstst(sp)
static char *
isp2100_fw_statename(state)
- int state;
+ u_int8_t state;
{
switch(state) {
case FW_CONFIG_WAIT: return "Config Wait";
@@ -3232,9 +2820,9 @@ isp_read_nvram(isp)
if (isp->isp_type & ISP_HA_SCSI) {
sdparam *sdp = (sdparam *) isp->isp_param;
+ /* XXX CHECK THIS FOR SANITY XXX */
sdp->isp_fifo_threshold =
- ISP_NVRAM_FIFO_THRESHOLD(nvram_data) |
- (ISP_NVRAM_FIFO_THRESHOLD_128(nvram_data) << 2);
+ ISP_NVRAM_FIFO_THRESHOLD(nvram_data);
sdp->isp_initiator_id =
ISP_NVRAM_INITIATOR_ID(nvram_data);
@@ -3276,6 +2864,8 @@ isp_read_nvram(isp)
sdp->isp_tag_aging =
ISP_NVRAM_TAG_AGE_LIMIT(nvram_data);
+ /* XXX ISP_NVRAM_FIFO_THRESHOLD_128 XXX */
+
sdp->isp_selection_timeout =
ISP_NVRAM_SELECTION_TIMEOUT(nvram_data);
@@ -3284,12 +2874,6 @@ isp_read_nvram(isp)
sdp->isp_fast_mttr = ISP_NVRAM_FAST_MTTR_ENABLE(nvram_data);
-#if 0
- PRINTF("%s: fifo_threshold = 0x%x cbena%d dbena%d\n",
- isp->isp_name, sdp->isp_fifo_threshold,
- sdp->isp_cmd_dma_burst_enable,
- sdp->isp_data_dma_burst_enabl);
-#endif
for (i = 0; i < 16; i++) {
sdp->isp_devparam[i].dev_enable =
ISP_NVRAM_TGT_DEVICE_ENABLE(nvram_data, i);
@@ -3364,9 +2948,8 @@ isp_read_nvram(isp)
fcp->isp_wwn = wwnstore.full64;
wwnstore.full64 = ISP2100_NVRAM_BOOT_NODE_NAME(nvram_data);
if (wwnstore.full64 != 0) {
- PRINTF("%s: BOOT DEVICE WWN 0x%08x%08x\n",
- isp->isp_name, wwnstore.wds.hi32,
- wwnstore.wds.lo32);
+ PRINTF("%s: BOOT DEVICE WWN 0x%08x%08x\n", isp->isp_name,
+ wwnstore.wds.hi32, wwnstore.wds.lo32);
}
fcp->isp_maxalloc =
ISP2100_NVRAM_MAXIOCBALLOCATION(nvram_data);
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c
index 21d1acd172b9d..654c17cc90e8d 100644
--- a/sys/dev/isp/isp_freebsd.c
+++ b/sys/dev/isp/isp_freebsd.c
@@ -1,5 +1,4 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $FreeBSD$ */
/*
* Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
*
@@ -42,7 +41,8 @@ static void isp_poll __P((struct cam_sim *));
static void isp_action __P((struct cam_sim *, union ccb *));
void
-isp_attach(struct ispsoftc *isp)
+isp_attach(isp)
+ struct ispsoftc *isp;
{
struct ccb_setasync csa;
struct cam_devq *devq;
@@ -96,7 +96,11 @@ isp_attach(struct ispsoftc *isp)
}
static void
-isp_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
+isp_async(cbarg, code, path, arg)
+ void *cbarg;
+ u_int32_t code;
+ struct cam_path *path;
+ void *arg;
{
struct cam_sim *sim;
struct ispsoftc *isp;
@@ -130,14 +134,17 @@ isp_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
}
static void
-isp_poll(struct cam_sim *sim)
+isp_poll(sim)
+ struct cam_sim *sim;
{
isp_intr((struct ispsoftc *) cam_sim_softc(sim));
}
static void
-isp_action(struct cam_sim *sim, union ccb *ccb)
+isp_action(sim, ccb)
+ struct cam_sim *sim;
+ union ccb *ccb;
{
int s, tgt, error;
struct ispsoftc *isp;
@@ -188,13 +195,8 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
} else {
if (ccb->ccb_h.target_id > (MAX_FC_TARG-1)) {
ccb->ccb_h.status = CAM_PATH_INVALID;
-#ifdef SCCLUN
} else if (ccb->ccb_h.target_lun > 15) {
ccb->ccb_h.status = CAM_PATH_INVALID;
-#else
- } else if (ccb->ccb_h.target_lun > 65535) {
- ccb->ccb_h.status = CAM_PATH_INVALID;
-#endif
}
}
if (ccb->ccb_h.status == CAM_PATH_INVALID) {
@@ -205,14 +207,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
break;
}
- CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_INFO,
- ("cdb[0]=0x%x dlen%d\n",
- (ccb->ccb_h.flags & CAM_CDB_POINTER)?
- ccb->csio.cdb_io.cdb_ptr[0]:
- ccb->csio.cdb_io.cdb_bytes[0], ccb->csio.dxfer_len));
-
s = splcam();
- DISABLE_INTS(isp);
switch (ispscsicmd((ISP_SCSI_XFER_T *) ccb)) {
case CMD_QUEUED:
ccb->ccb_h.status |= CAM_SIM_QUEUED;
@@ -240,7 +235,6 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
xpt_done(ccb);
break;
}
- ENABLE_INTS(isp);
splx(s);
break;
@@ -484,26 +478,28 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
cpi->max_target = MAX_FC_TARG-1;
cpi->initiator_id =
((fcparam *)isp->isp_param)->isp_loopid;
-#ifdef SCCLUN
- cpi->max_lun = (1 << 16) - 1;
-#else
- cpi->max_lun = (1 << 4) - 1;
-#endif
+ /*
+ * XXX: actually, this is not right if we have
+ * XXX: 1.14 F/W and the second level lun addressing
+ * XXX: in place. It's also probably not right
+ * XXX: even for 1.13 f/w.
+ */
+ cpi->max_lun = 15;
} else {
cpi->initiator_id =
((sdparam *)isp->isp_param)->isp_initiator_id;
cpi->max_target = MAX_TARGETS-1;
if (isp->isp_fwrev >= ISP_FW_REV(7, 55)) {
-#if 0
/*
* Too much breakage.
*/
- cpi->max_lun = (1 << 5) - 1;
+#if 0
+ cpi->max_lun = 31;
#else
- cpi->max_lun = (1 << 3) - 1;
+ cpi->max_lun = 7;
#endif
} else {
- cpi->max_lun = (1 << 3) - 1;
+ cpi->max_lun = 7;
}
}
@@ -522,50 +518,11 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
break;
}
}
-
-#define ISPDDB (CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB)
-void
-isp_done(struct ccb_scsiio *sccb)
-{
- struct ispsoftc *isp = XS_ISP(sccb);
-
- if (XS_NOERR(sccb))
- XS_SETERR(sccb, CAM_REQ_CMP);
- sccb->ccb_h.status &= ~CAM_STATUS_MASK;
- sccb->ccb_h.status |= sccb->ccb_h.spriv_field0;
- if ((sccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP &&
- (sccb->scsi_status != SCSI_STATUS_OK)) {
- sccb->ccb_h.status &= ~CAM_STATUS_MASK;
- sccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
- }
- if ((sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
- if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
- IDPRINTF(3, ("%s: freeze devq %d.%d ccbstat 0x%x\n",
- isp->isp_name, sccb->ccb_h.target_id,
- sccb->ccb_h.target_lun, sccb->ccb_h.status));
- xpt_freeze_devq(sccb->ccb_h.path, 1);
- sccb->ccb_h.status |= CAM_DEV_QFRZN;
- }
- }
- if (isp->isp_osinfo.simqfrozen) {
- sccb->ccb_h.status |= CAM_RELEASE_SIMQ;
- isp->isp_osinfo.simqfrozen = 0;
- }
- sccb->ccb_h.status &= ~CAM_SIM_QUEUED;
- if (CAM_DEBUGGED(sccb->ccb_h.path, ISPDDB) &&
- (sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
- xpt_print_path(sccb->ccb_h.path);
- printf("cam completion status 0x%x\n", sccb->ccb_h.status);
- }
- xpt_done((union ccb *) sccb);
-}
-
#else
static void ispminphys __P((struct buf *));
static u_int32_t isp_adapter_info __P((int));
static int ispcmd __P((ISP_SCSI_XFER_T *));
-static void isp_watch __P((void *arg));
static struct scsi_adapter isp_switch = {
ispcmd, ispminphys, 0, 0, isp_adapter_info, "isp", { 0, 0 }
@@ -580,7 +537,8 @@ static int isp_poll __P((struct ispsoftc *, ISP_SCSI_XFER_T *, int));
* Complete attachment of hardware, include subdevices.
*/
void
-isp_attach(struct ispsoftc *isp)
+isp_attach(isp)
+ struct ispsoftc *isp;
{
struct scsibus_data *scbus;
@@ -589,7 +547,6 @@ isp_attach(struct ispsoftc *isp)
return;
}
isp->isp_state = ISP_RUNSTATE;
- START_WATCHDOG(isp);
isp->isp_osinfo._link.adapter_unit = isp->isp_osinfo.unit;
isp->isp_osinfo._link.adapter_softc = isp;
@@ -626,7 +583,8 @@ isp_attach(struct ispsoftc *isp)
*/
static void
-ispminphys(struct buf *bp)
+ispminphys(bp)
+ struct buf *bp;
{
/*
* Only the 10X0 has a 24 bit limit.
@@ -637,7 +595,8 @@ ispminphys(struct buf *bp)
}
static u_int32_t
-isp_adapter_info(int unit)
+isp_adapter_info(unit)
+ int unit;
{
/*
* XXX: FIND ISP BASED UPON UNIT AND GET REAL QUEUE LIMIT FROM THAT
@@ -646,7 +605,8 @@ isp_adapter_info(int unit)
}
static int
-ispcmd(ISP_SCSI_XFER_T *xs)
+ispcmd(xs)
+ ISP_SCSI_XFER_T *xs;
{
struct ispsoftc *isp;
int r;
@@ -683,7 +643,10 @@ ispcmd(ISP_SCSI_XFER_T *xs)
}
static int
-isp_poll(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs, int mswait)
+isp_poll(isp, xs, mswait)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *xs;
+ int mswait;
{
while (mswait) {
@@ -698,74 +661,4 @@ isp_poll(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs, int mswait)
}
return (1);
}
-
-static void
-isp_watch(void *arg)
-{
- int i;
- struct ispsoftc *isp = arg;
- ISP_SCSI_XFER_T *xs;
- ISP_ILOCKVAL_DECL;
-
- /*
- * Look for completely dead commands (but not polled ones).
- */
- ISP_ILOCK(isp);
- for (i = 0; i < RQUEST_QUEUE_LEN; i++) {
- if ((xs = (ISP_SCSI_XFER_T *) isp->isp_xflist[i]) == NULL) {
- continue;
- }
- if (XS_TIME(xs) == 0) {
- continue;
- }
- XS_TIME(xs) -= (WATCH_INTERVAL * 1000);
- /*
- * Avoid later thinking that this
- * transaction is not being timed.
- * Then give ourselves to watchdog
- * periods of grace.
- */
- if (XS_TIME(xs) == 0)
- XS_TIME(xs) = 1;
- else if (XS_TIME(xs) > -(2 * WATCH_INTERVAL * 1000)) {
- continue;
- }
- if (isp_control(isp, ISPCTL_ABORT_CMD, xs)) {
- printf("%s: isp_watch failed to abort command\n",
- isp->isp_name);
- isp_restart(isp);
- break;
- }
- }
- RESTART_WATCHDOG(isp_watch, arg);
- ISP_IUNLOCK(isp);
-}
#endif
-
-/*
- * Free any associated resources prior to decommissioning and
- * set the card to a known state (so it doesn't wake up and kick
- * us when we aren't expecting it to).
- *
- * Locks are held before coming here.
- */
-void
-isp_uninit(struct ispsoftc *isp)
-{
- ISP_ILOCKVAL_DECL;
- ISP_ILOCK(isp);
- /*
- * Leave with interrupts disabled.
- */
- DISABLE_INTS(isp);
-
- /*
- * Turn off the watchdog (if active).
- */
- STOP_WATCHDOG(isp_watch, isp);
-
- /*
- * And out...
- */
- ISP_IUNLOCK(isp);
-}
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h
index 3e2e84328fc76..6677b7c29bf95 100644
--- a/sys/dev/isp/isp_freebsd.h
+++ b/sys/dev/isp/isp_freebsd.h
@@ -1,5 +1,4 @@
-/* $Id: isp_freebsd.h,v 1.8 1999/01/10 02:51:06 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions (non CAM version)
*---------------------------------------
@@ -36,7 +35,7 @@
#define _ISP_FREEBSD_H
#define ISP_PLATFORM_VERSION_MAJOR 0
-#define ISP_PLATFORM_VERSION_MINOR 98
+#define ISP_PLATFORM_VERSION_MINOR 97
#include <sys/param.h>
@@ -80,11 +79,7 @@ struct isposinfo {
#define IDPRINTF(lev, x) if (isp->isp_dblev >= lev) printf x
#define DFLT_DBLEVEL 1
-#define MEMZERO BZERO
-#define MEMCPY(dst, src, amt) bcopy((src), (dst), (amt))
-
#define ISP_LOCKVAL_DECL int isp_spl_save
-#define ISP_ILOCKVAL_DECL ISP_LOCKVAL_DECL
#define ISP_UNLOCK(isp) (void) splx(isp_spl_save)
#define ISP_LOCK(isp) isp_spl_save = splbio()
#define ISP_ILOCK(isp) ISP_LOCK(isp)
@@ -103,7 +98,7 @@ struct isposinfo {
#define XS_STS(xs) (xs)->status
#define XS_TIME(xs) (xs)->timeout
#define XS_SNSP(xs) (&(xs)->sense)
-#define XS_SNSLEN(xs) (sizeof((xs)->sense))
+#define XS_SNSLEN(xs) (sizeof (xs)->sense)
#define XS_SNSKEY(xs) ((xs)->sense.ext.extended.flags)
#define HBA_NOERROR XS_NOERROR
@@ -135,15 +130,18 @@ struct isposinfo {
/*
* Our default tag
*/
-#define XS_KINDOF_TAG(xs) REQFLAG_STAG
+#define XS_KINDOF_TAG(xs) REQFLAG_OTAG
#define CMD_COMPLETE COMPLETE
#define CMD_EAGAIN TRY_AGAIN_LATER
#define CMD_QUEUED SUCCESSFULLY_QUEUED
+
+
#define isp_name isp_osinfo.name
+
#define SYS_DELAY(x) DELAY(x)
#define WATCH_INTERVAL 30
@@ -161,7 +159,6 @@ struct isposinfo {
#define RESTART_WATCHDOG(f, s) START_WATCHDOG(f, s)
extern void isp_attach __P((struct ispsoftc *));
-extern void isp_uninit __P((struct ispsoftc *));
#define PVS "Qlogic ISP Driver, FreeBSD Non-Cam"
diff --git a/sys/dev/isp/isp_freebsd_cam.h b/sys/dev/isp/isp_freebsd_cam.h
index 7649a15511a1d..383b0078f7d13 100644
--- a/sys/dev/isp/isp_freebsd_cam.h
+++ b/sys/dev/isp/isp_freebsd_cam.h
@@ -1,5 +1,4 @@
-/* $Id: isp_freebsd_cam.h,v 1.11 1999/01/10 02:51:06 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions (CAM version)
*---------------------------------------
@@ -69,6 +68,7 @@ struct isposinfo {
int unit;
struct cam_sim *sim;
struct cam_path *path;
+ struct callout_handle watchid;
volatile char simqfrozen;
};
@@ -89,9 +89,6 @@ struct isposinfo {
#define PRINTF printf
#define IDPRINTF(lev, x) if (isp->isp_dblev >= lev) printf x
-#define MEMZERO bzero
-#define MEMCPY(dst, src, amt) bcopy((src), (dst), (amt))
-
#ifdef CAMDEBUG
#define DFLT_DBLEVEL 2
#else
@@ -99,7 +96,6 @@ struct isposinfo {
#endif
#define ISP_LOCKVAL_DECL int isp_spl_save
-#define ISP_ILOCKVAL_DECL ISP_LOCKVAL_DECL
#define ISP_UNLOCK(isp) (void) splx(isp_spl_save)
#define ISP_LOCK(isp) isp_spl_save = splcam()
#define ISP_ILOCK(isp) ISP_LOCK(isp)
@@ -119,7 +115,7 @@ struct isposinfo {
#define XS_STS(ccb) (ccb)->scsi_status
#define XS_TIME(ccb) (ccb)->ccb_h.timeout
#define XS_SNSP(ccb) (&(ccb)->sense_data)
-#define XS_SNSLEN(ccb) imin((sizeof((ccb)->sense_data)), ccb->sense_len)
+#define XS_SNSLEN(ccb) imin((sizeof (ccb)->sense_data), ccb->sense_len)
#define XS_SNSKEY(ccb) ((ccb)->sense_data.flags & 0xf)
/*
@@ -148,8 +144,32 @@ struct isposinfo {
#define XS_NOERR(ccb) \
((ccb)->ccb_h.spriv_field0 == CAM_REQ_INPROG)
-extern void isp_done(struct ccb_scsiio *);
-#define XS_CMD_DONE(sccb) isp_done(sccb)
+#define XS_CMD_DONE(sccb) \
+ if (XS_NOERR((sccb))) \
+ XS_SETERR((sccb), CAM_REQ_CMP); \
+ (sccb)->ccb_h.status &= ~CAM_STATUS_MASK; \
+ (sccb)->ccb_h.status |= (sccb)->ccb_h.spriv_field0; \
+ if (((sccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP && \
+ (sccb)->scsi_status != SCSI_STATUS_OK) { \
+ (sccb)->ccb_h.status &= ~CAM_STATUS_MASK; \
+ (sccb)->ccb_h.status |= CAM_SCSI_STATUS_ERROR; \
+ } \
+ if (((sccb)->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { \
+ if (((sccb)->ccb_h.status & CAM_DEV_QFRZN) == 0) { \
+ struct ispsoftc *isp = XS_ISP((sccb)); \
+ IDPRINTF(3, ("%s: freeze devq %d.%d ccbstat 0x%x\n",\
+ isp->isp_name, (sccb)->ccb_h.target_id, \
+ (sccb)->ccb_h.target_lun, (sccb)->ccb_h.status)); \
+ xpt_freeze_devq((sccb)->ccb_h.path, 1); \
+ (sccb)->ccb_h.status |= CAM_DEV_QFRZN; \
+ } \
+ } \
+ if ((XS_ISP((sccb)))->isp_osinfo.simqfrozen) { \
+ (sccb)->ccb_h.status |= CAM_RELEASE_SIMQ; \
+ (XS_ISP((sccb)))->isp_osinfo.simqfrozen = 0; \
+ } \
+ (sccb)->ccb_h.status &= ~CAM_SIM_QUEUED; \
+ xpt_done((union ccb *)(sccb))
#define XS_IS_CMD_DONE(ccb) \
(((ccb)->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG)
@@ -174,8 +194,14 @@ extern void isp_done(struct ccb_scsiio *);
#define CMD_QUEUED 2
#define SYS_DELAY(x) DELAY(x)
-#define STOP_WATCHDOG(f, s)
+
+#define WATCH_INTERVAL 30
+#define START_WATCHDOG(f, s) \
+ (s)->isp_osinfo.watchid = timeout(f, s, WATCH_INTERVAL * hz), \
+ s->isp_dogactive = 1
+#define STOP_WATCHDOG(f, s) untimeout(f, s, (s)->isp_osinfo.watchid),\
+ (s)->isp_dogactive = 0
+#define RESTART_WATCHDOG(f, s) START_WATCHDOG(f, s)
extern void isp_attach __P((struct ispsoftc *));
-extern void isp_uninit __P((struct ispsoftc *));
#endif /* _ISP_FREEBSD_CAM_H */
diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h
index 24de5aebf94c8..b3f82a7821d51 100644
--- a/sys/dev/isp/ispmbox.h
+++ b/sys/dev/isp/ispmbox.h
@@ -1,5 +1,4 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: ispmbox.h,v 1.7 1998/09/14 23:23:26 mjacob Exp $ */
/*
* Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters.
*
@@ -154,7 +153,7 @@ typedef struct {
#define ASYNC_RSP_XFER_ERR 0x8004
#define ASYNC_QWAKEUP 0x8005
#define ASYNC_TIMEOUT_RESET 0x8006
-#define ASYNC_DEVICE_RESET 0x8007
+#define ASYNC_UNSPEC_TMODE 0x8007
#define ASYNC_EXTMSG_UNDERRUN 0x800A
#define ASYNC_SCAM_INT 0x800B
#define ASYNC_HUNG_SCSI 0x800C
@@ -168,7 +167,7 @@ typedef struct {
#define ASYNC_LOOP_UP 0x8011
#define ASYNC_LOOP_DOWN 0x8012
#define ASYNC_LOOP_RESET 0x8013
-#define ASYNC_PDB_CHANGED 0x8014
+#define ASYNC_PDB_CHANGED 0x8014 /* Port Database Changed */
#define ASYNC_CHANGE_NOTIFY 0x8015
/*
@@ -242,7 +241,7 @@ typedef struct {
u_int16_t req_cdblen;
#define req_modifier req_cdblen /* marker packet */
u_int16_t req_flags;
- u_int16_t req_reserved;
+ u_int16_t _res1;
u_int16_t req_time;
u_int16_t req_seg_count;
u_int8_t req_cdb[12];
@@ -260,7 +259,7 @@ typedef struct {
u_int8_t req_lun_trn;
u_int8_t req_target;
#endif
- u_int16_t req_scclun;
+ u_int16_t _res1;
u_int16_t req_flags;
u_int16_t _res2;
u_int16_t req_time;
@@ -425,7 +424,169 @@ typedef struct {
#define RQSTF_NEGOTIATION 0x0080
/*
- * FC (ISP2100) specific initialization data structures
+ * Target Mode Structures
+ */
+/*
+ * Used for Enable LUN and Modify Lun types.
+ * (for FC, pre-1.14 FW layout revision).
+ */
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t _reserved0;
+ u_int8_t req_lun; /* HOST->FW: LUN to enable */
+#else
+ u_int8_t req_lun; /* HOST->FW: LUN to enable */
+ u_int8_t _reserved0;
+#endif
+ u_int16_t _reserved1[3];
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t _reserved2;
+ u_int8_t req_status; /* FW->HOST: Status of Request */
+ u_int8_t req_imcount; /* HOST->FW: Immediate Notify Count */
+ u_int8_t req_cmdcount; /* HOST->FW: ATIO Count */
+#else
+ u_int8_t req_status; /* FW->HOST: Status of Request */
+ u_int8_t _reserved2;
+ u_int8_t req_cmdcount; /* HOST->FW: ATIO Count */
+ u_int8_t req_imcount; /* HOST->FW: Immediate Notify Count */
+#endif
+ u_int16_t _reserved3;
+ u_int16_t req_timeout; /* HOST->FW: Lun timeout value */
+} isplun_t;
+/* inbound status */
+#define LUN_OKAY 0x01
+#define LUN_ERR 0x04
+#define LUN_NOCAP 0x16
+#define LUN_ENABLED 0x3e
+/* outbound flags */
+#define LUN_INCR_CMD 0x0001
+#define LUN_DECR_CMD 0x0002
+#define LUN_INCR_IMMED 0x0100
+#define LUN_DECR_IMMED 0x0200
+
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_initiator;
+ u_int8_t req_lun;
+#else
+ u_int8_t req_lun;
+ u_int8_t req_initiator;
+#endif
+ u_int16_t req_flags; /* NOTIFY_ACK only */
+ u_int16_t _reserved1[2];
+ u_int16_t req_status;
+ u_int16_t req_task_flags;
+ u_int16_t req_sequence;
+} ispnotify_t;
+
+#define IN_NOCAP 0x16
+#define IN_IDE_RECEIVED 0x33
+#define IN_RSRC_UNAVAIL 0x34
+#define IN_MSG_RECEIVED 0x36
+
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_initiator;
+ u_int8_t req_lun;
+#else
+ u_int8_t req_lun;
+ u_int8_t req_initiator;
+#endif
+ u_int16_t req_rxid;
+ u_int16_t req_flags;
+ u_int16_t req_status;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_taskcodes;
+ u_int8_t _reserved0;
+ u_int8_t req_execodes;
+ u_int8_t req_taskflags;
+#else
+ u_int8_t _reserved0;
+ u_int8_t req_taskcodes;
+ u_int8_t req_taskflags;
+ u_int8_t req_execodes;
+#endif
+ u_int8_t req_cdb[16];
+ u_int32_t req_datalen;
+ u_int16_t req_scclun;
+ u_int16_t _reserved1;;
+ u_int16_t req_scsi_status;
+ u_int8_t req_sense[18];
+} ispatiot2_t;
+
+#define ATIO_PATH_INVALID 0x07
+#define ATIO_PHASE_ERROR 0x14
+#define ATIO_NOCAP 0x16
+#define ATIO_BDR_MSG 0x17
+#define ATIO_CDB_RECEIVED 0x3d
+
+#define ATIO_SENSEVALID 0x80
+
+/*
+ * Continue Target I/O, type 2
+ */
+typedef struct {
+ isphdr_t req_header;
+ u_int32_t req_handle;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_int8_t req_initiator;
+ u_int8_t req_lun;
+#else
+ u_int8_t req_lun;
+ u_int8_t req_initiator;
+#endif
+ u_int16_t req_rxid;
+ u_int16_t req_flags;
+ u_int16_t req_status;
+ u_int16_t req_timeout;
+ u_int16_t req_seg_count; /* data segment count */
+ u_int8_t req_reloff[4]; /* relative offset */
+ u_int8_t req_resid[4]; /* residual */
+ u_int8_t _reserved0[4];
+ union { /* should be offset 0x20 */
+ struct {
+ u_int16_t _reserved0;
+ u_int16_t req_scsi_status;
+ u_int32_t req_datalen;
+ ispds_t req_dataseg[ISP_RQDSEG_T2];
+ } mode0;
+ struct {
+ u_int16_t req_sense_len;
+ u_int16_t req_scsi_status;
+ u_int32_t req_response_length;
+ u_int8_t req_response[26];
+ } mode1;
+ struct {
+ u_int16_t _reserved0[2];
+ u_int32_t req_datalen;
+ ispds_t req_fcpiudata;
+ } mode2;
+ } req_m;
+} ispctiot2_t;
+
+#define CTIO_SEND_STATUS 0x8000
+#define CTIO_SEND_DATA 0x0040 /* To initiator */
+#define CTIO_RECV_DATA 0x0080
+#define CTIO_NODATA 0x00C0
+
+#define CTIO2_SMODE0 0x0000
+#define CTIO2_SMODE1 0x0001
+#define CTIO2_SMODE2 0x0002
+
+#define CTIO2_RESP_VALID 0x0100
+#define CTIO2_STATUS_VALID 0x0200
+#define CTIO2_RSPOVERUN 0x0400
+#define CTIO2_RSPUNDERUN 0x0800
+
+
+/*
+ * FC (ISP2100) specific data structures
*/
/*
@@ -498,6 +659,16 @@ typedef struct {
#define RQRSP_ADDR4863 3
+#if BYTE_ORDER == BIG_ENDIAN
+#define ICB_NNM0 6
+#define ICB_NNM1 7
+#define ICB_NNM2 4
+#define ICB_NNM3 5
+#define ICB_NNM4 2
+#define ICB_NNM5 3
+#define ICB_NNM6 0
+#define ICB_NNM7 1
+#else
#define ICB_NNM0 7
#define ICB_NNM1 6
#define ICB_NNM2 5
@@ -506,6 +677,7 @@ typedef struct {
#define ICB_NNM5 2
#define ICB_NNM6 1
#define ICB_NNM7 0
+#endif
#define MAKE_NODE_NAME_FROM_WWN(array, wwn) \
array[ICB_NNM0] = (u_int8_t) ((wwn >> 0) & 0xff), \
@@ -517,425 +689,4 @@ typedef struct {
array[ICB_NNM6] = (u_int8_t) ((wwn >> 48) & 0xff), \
array[ICB_NNM7] = (u_int8_t) ((wwn >> 56) & 0xff)
-/*
- * Target Mode Structures
- */
-#define TGTSVALID 0x80 /* scsi status & sense data valid */
-#define SUGGSENSELEN 18
-
-/*
- * Structure for Enable Lun and Modify Lun queue entries
- */
-typedef struct {
- isphdr_t le_header;
- u_int32_t le_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t le_lun;
- u_int8_t le_rsvd;
- u_int8_t le_ops; /* Modify LUN only */
- u_int8_t le_tgt; /* Not for FC */
-#endif
- u_int32_t le_flags; /* Not for FC */
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t le_status;
- u_int8_t le_rsvd2;
- u_int8_t le_cmd_count;
- u_int8_t le_in_count;
- u_int8_t le_cdb6len; /* Not for FC */
- u_int8_t le_cdb7len; /* Not for FC */
-#endif
- u_int16_t le_timeout;
- u_int16_t le_reserved[20];
-} lun_entry_t;
-
-/*
- * le_flags values
- */
-#define LUN_TQAE 0x00000001 /* Tagged Queue Action Enable */
-#define LUN_DSSM 0x01000000 /* Disable Sending SDP Message */
-#define LUN_DM 0x40000000 /* Disconnects Mandatory */
-
-/*
- * le_ops values
- */
-#define LUN_CCINCR 0x01 /* increment command count */
-#define LUN_CCDECR 0x02 /* decrement command count */
-#define LUN_ININCR 0x40 /* increment immed. notify count */
-#define LUN_INDECR 0x80 /* decrement immed. notify count */
-
-/*
- * le_status values
- */
-#define LUN_ERR 0x04 /* request completed with error */
-#define LUN_INVAL 0x06 /* invalid request */
-#define LUN_NOCAP 0x16 /* can't provide requested capability */
-#define LUN_ENABLED 0x3E /* LUN already enabled */
-
-/*
- * Immediate Notify Entry structure
- */
-#define IN_MSGLEN 8 /* 8 bytes */
-#define IN_RSVDLEN 8 /* 8 words */
-typedef struct {
- isphdr_t in_header;
- u_int32_t in_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t in_lun; /* lun */
- u_int8_t in_iid; /* initiator */
- u_int8_t in_rsvd;
- u_int8_t in_tgt; /* target */
-#endif
- u_int32_t in_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t in_status;
- u_int8_t in_rsvd2;
- u_int8_t in_tag_val; /* tag value */
- u_int8_t in_tag_type; /* tag type */
-#endif
- u_int16_t in_seqid; /* sequence id */
- u_int8_t in_msg[IN_MSGLEN]; /* SCSI message bytes */
- u_int16_t in_reserved[IN_RSVDLEN];
- u_int8_t in_sense[SUGGSENSELEN]; /* suggested sense data */
-} in_entry_t;
-
-typedef struct {
- isphdr_t in_header;
- u_int32_t in_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t in_lun; /* lun */
- u_int8_t in_iid; /* initiator */
-#endif
- u_int16_t in_rsvd;
- u_int32_t in_rsvd2;
- u_int16_t in_status;
- u_int16_t in_task_flags;
- u_int16_t in_seqid; /* sequence id */
-} in_fcentry_t;
-
-/*
- * Values for the in_status field
- */
-#define IN_NO_RCAP 0x16 /* requested capability not available */
-#define IN_IDE_RECEIVED 0x33 /* Initiator Detected Error msg received */
-#define IN_RSRC_UNAVAIL 0x34 /* resource unavailable */
-#define IN_MSG_RECEIVED 0x36 /* SCSI message received */
-#define IN_PORT_LOGOUT 0x29 /* port has logged out (FC) */
-#define IN_ABORT_TASK 0x20 /* task named in RX_ID is being aborted (FC) */
-
-/*
- * Notify Acknowledge Entry structure
- */
-#define NA_RSVDLEN 22
-typedef struct {
- isphdr_t na_header;
- u_int32_t na_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t na_lun; /* lun */
- u_int8_t na_iid; /* initiator */
- u_int8_t na_rsvd;
- u_int8_t na_tgt; /* target */
-#endif
- u_int32_t na_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t na_status;
- u_int8_t na_event;
-#endif
- u_int16_t na_seqid; /* sequence id */
- u_int16_t na_reserved[NA_RSVDLEN];
-} na_entry_t;
-
-/*
- * Value for the na_event field
- */
-#define NA_RST_CLRD 0x80 /* Clear an async event notification */
-
-#define NA2_RSVDLEN 21
-typedef struct {
- isphdr_t na_header;
- u_int32_t na_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t na_lun; /* lun */
- u_int8_t na_iid; /* initiator */
-#endif
- u_int16_t na_rsvd;
- u_int16_t na_flags;
- u_int16_t na_rsvd2;
- u_int16_t na_status;
- u_int16_t na_task_flags;
- u_int16_t na_seqid; /* sequence id */
- u_int16_t na_reserved[NA2_RSVDLEN];
-} na_fcentry_t;
-#define NAFC_RST_CLRD 0x40
-
-/*
- * Value for the na_event field
- */
-#define NA_RST_CLRD 0x80 /* Clear an async event notification */
-/*
- * Accept Target I/O Entry structure
- */
-#define ATIO_CDBLEN 26
-
-typedef struct {
- isphdr_t at_header;
- u_int32_t at_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_lun; /* lun */
- u_int8_t at_iid; /* initiator */
- u_int8_t at_cdblen; /* cdb length */
- u_int8_t at_tgt; /* target */
-#endif
- u_int32_t at_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_status; /* firmware status */
- u_int8_t at_scsi_status; /* scsi status */
- u_int8_t at_tag_val; /* tag value */
- u_int8_t at_tag_type; /* tag type */
-#endif
- u_int8_t at_cdb[ATIO_CDBLEN]; /* received CDB */
- u_int8_t at_sense[SUGGSENSELEN]; /* suggested sense data */
-} at_entry_t;
-
-/*
- * at_flags values
- */
-#define AT_NODISC 0x00008000 /* disconnect disabled */
-#define AT_TQAE 0x00000001 /* Tagged Queue Action enabled */
-
-/*
- * at_status values
- */
-#define AT_PATH_INVALID 0x07 /* ATIO sent to firmware for disabled lun */
-#define AT_PHASE_ERROR 0x14 /* Bus phase sequence error */
-#define AT_NOCAP 0x16 /* Requested capability not available */
-#define AT_BDR_MSG 0x17 /* Bus Device Reset msg received */
-#define AT_CDB 0x3D /* CDB received */
-
-/*
- * Accept Target I/O Entry structure, Type 2
- */
-#define ATIO2_CDBLEN 16
-
-typedef struct {
- isphdr_t at_header;
- u_int32_t at_reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_lun; /* lun */
- u_int8_t at_iid; /* initiator */
-#endif
- u_int16_t at_rxid; /* response ID */
- u_int16_t at_flags;
- u_int16_t at_status; /* firmware status */
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t at_reserved1;
- u_int8_t at_taskcodes;
- u_int8_t at_taskflags;
- u_int8_t at_execodes;
-#endif
- u_int8_t at_cdb[ATIO2_CDBLEN]; /* received CDB */
- u_int32_t at_datalen; /* allocated data len */
- u_int16_t at_scclun;
- u_int16_t at_reserved3;
- u_int16_t at_scsi_status;
- u_int8_t at_sense[SUGGSENSELEN]; /* suggested sense data */
-} at2_entry_t;
-
-#define ATIO2_TC_ATTR_MASK 0x7
-#define ATIO2_TC_ATTR_SIMPLEQ 0
-#define ATIO2_TC_ATTR_HEADOFQ 1
-#define ATIO2_TC_ATTR_ORDERED 2
-#define ATIO2_TC_ATTR_ACAQ 4
-#define ATIO2_TC_ATTR_UNTAGGED 5
-#define TC2TT(code) \
- (((code) == ATIO2_TC_ATTR_SIMPLEQ)? 0x20 : \
- (((code) == ATIO2_TC_ATTR_HEADOFQ)? 0x21 : \
- (((code) == ATIO2_TC_ATTR_ORDERED)? 0x22 : \
- (((code) == ATIO2_TC_ATTR_ACAQ)? 0x24 : 0))))
-
-
-/*
- * Continue Target I/O Entry structure
- * Request from driver. The response from the
- * ISP firmware is the same except that the last 18
- * bytes are overwritten by suggested sense data if
- * the 'autosense valid' bit is set in the status byte.
- */
-typedef struct {
- isphdr_t ct_header;
- u_int32_t ct_reserved;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t ct_lun; /* lun */
- u_int8_t ct_iid; /* initiator id */
- u_int8_t ct_rsvd;
- u_int8_t ct_tgt; /* our target id */
-#endif
- u_int32_t ct_flags;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t ct_status; /* isp status */
- u_int8_t ct_scsi_status; /* scsi status */
- u_int8_t ct_tag_val; /* tag value */
- u_int8_t ct_tag_type; /* tag type */
-#endif
- u_int32_t ct_xfrlen; /* transfer length */
- u_int32_t ct_resid; /* residual length */
- u_int16_t ct_timeout;
- u_int16_t ct_seg_count;
- ispds_t ct_dataseg[ISP_RQDSEG];
-} ct_entry_t;
-
-/*
- * ct_flags values
- */
-#define CT_TQAE 0x00000001 /* Tagged Queue Action enable */
-#define CT_DATA_IN 0x00000040 /* Data direction */
-#define CT_DATA_OUT 0x00000080 /* Data direction */
-#define CT_NO_DATA 0x000000C0 /* Data direction */
-#define CT_DATAMASK 0x000000C0 /* Data direction */
-#define CT_NODISC 0x00008000 /* Disconnects disabled */
-#define CT_DSDP 0x01000000 /* Disable Save Data Pointers */
-#define CT_SENDRDP 0x04000000 /* Send Restore Pointers msg */
-#define CT_SENDSTATUS 0x80000000 /* Send SCSI status byte */
-
-/*
- * ct_status values
- * - set by the firmware when it returns the CTIO
- */
-#define CT_OK 0x01 /* completed without error */
-#define CT_ABORTED 0x02 /* aborted by host */
-#define CT_ERR 0x04 /* see sense data for error */
-#define CT_INVAL 0x06 /* request for disabled lun */
-#define CT_NOPATH 0x07 /* invalid ITL nexus */
-#define CT_INVRXID 0x08 /* (FC only) Invalid RX_ID */
-#define CT_RSELTMO 0x0A /* reselection timeout after 2 tries */
-#define CT_TIMEOUT 0x0B /* timed out */
-#define CT_RESET 0x0E /* SCSI Bus Reset occurred */
-#define CT_PHASE_ERROR 0x14 /* Bus phase sequence error */
-#define CT_BDR_MSG 0x17 /* Bus Device Reset msg received */
-#define CT_TERMINATED 0x19 /* due to Terminate Transfer mbox cmd */
-#define CT_LOGOUT 0x29 /* port logout not acknowledged yet */
-#define CT_NOACK 0x35 /* Outstanding Immed. Notify. entry */
-
-/*
- * When the firmware returns a CTIO entry, it may overwrite the last
- * part of the structure with sense data. This starts at offset 0x2E
- * into the entry, which is in the middle of ct_dataseg[1]. Rather
- * than define a new struct for this, I'm just using the sense data
- * offset.
- */
-#define CTIO_SENSE_OFFSET 0x2E
-
-/*
- * Entry length in u_longs. All entries are the same size so
- * any one will do as the numerator.
- */
-#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(u_int32_t))
-
-/*
- * QLA2100 CTIO (type 2) entry
- */
-#define MAXRESPLEN 26
-typedef struct {
- isphdr_t ct_header;
- u_int32_t ct_reserved;
-#if BYTE_ORDER == BIG_ENDIAN
-#else
- u_int8_t ct_lun; /* lun */
- u_int8_t ct_iid; /* initiator id */
-#endif
- u_int16_t ct_rxid; /* response ID */
- u_int16_t ct_flags;
- u_int16_t ct_status; /* isp status */
- u_int16_t ct_timeout;
- u_int16_t ct_seg_count;
- u_int32_t ct_reloff; /* relative offset */
- u_int32_t ct_resid; /* residual length */
- union {
- /*
- * The three different modes that the target driver
- * can set the CTIO2 up as.
- *
- * The first is for sending FCP_DATA_IUs as well as
- * (optionally) sending a terminal SCSI status FCP_RSP_IU.
- *
- * The second is for sending SCSI sense data in an FCP_RSP_IU.
- * Note that no FCP_DATA_IUs will be sent.
- *
- * The third is for sending FCP_RSP_IUs as built specifically
- * in system memory as located by the isp_dataseg.
- */
- struct {
- u_int32_t _reserved;
- u_int16_t _reserved2;
- u_int16_t ct_scsi_status;
- u_int32_t ct_xfrlen;
- ispds_t ct_dataseg[ISP_RQDSEG_T2];
- } m0;
- struct {
- u_int16_t _reserved;
- u_int16_t _reserved2;
- u_int16_t ct_senselen;
- u_int16_t ct_scsi_status;
- u_int16_t ct_resplen;
- u_int8_t ct_resp[MAXRESPLEN];
- } m1;
- struct {
- u_int32_t _reserved;
- u_int16_t _reserved2;
- u_int16_t _reserved3;
- u_int32_t ct_datalen;
- ispds_t ct_fcp_rsp_iudata;
- } m2;
- /*
- * CTIO2 returned from F/W...
- */
- struct {
- u_int32_t _reserved[4];
- u_int16_t ct_scsi_status;
- u_int8_t ct_sense[SUGGSENSELEN];
- } fw;
- } rsp;
-} ct2_entry_t;
-/*
- * ct_flags values for CTIO2
- */
-#define CT2_FLAG_MMASK 0x0003
-#define CT2_FLAG_MODE0 0x0000
-#define CT2_FLAG_MODE1 0x0001
-#define CT2_FLAG_MODE2 0x0002
-#define CT2_DATA_IN CT_DATA_IN
-#define CT2_DATA_OUT CT_DATA_OUT
-#define CT2_NO_DATA CT_NO_DATA
-#define CT2_DATAMASK CT_DATA_MASK
-#define CT2_CCINCR 0x0100
-#define CT2_FASTPOST 0x0200
-#define CT2_SENDSTATUS 0x8000
-
-/*
- * ct_status values are (mostly) the same as that for ct_entry.
- */
-
-/*
- * ct_scsi_status values- the low 8 bits are the normal SCSI status
- * we know and love. The upper 8 bits are validity markers for FCP_RSP_IU
- * fields.
- */
-#define CT2_RSPLEN_VALID 0x0100
-#define CT2_SNSLEN_VALID 0x0200
-#define CT2_DATA_OVER 0x0400
-#define CT2_DATA_UNDER 0x0800
-
#endif /* _ISPMBOX_H */
diff --git a/sys/dev/isp/ispreg.h b/sys/dev/isp/ispreg.h
index 122a2976db1b6..a953bc1896542 100644
--- a/sys/dev/isp/ispreg.h
+++ b/sys/dev/isp/ispreg.h
@@ -1,5 +1,4 @@
-/* $Id: $ */
-/* release_12_28_98_A */
+/* $Id: ispreg.h,v 1.6 1998/09/08 01:09:46 mjacob Exp $ */
/*
* Machine Independent (well, as best as possible) register
* definitions for Qlogic ISP SCSI adapters.
@@ -671,7 +670,7 @@
(((u_int64_t)(c)[23]) << 16) | \
(((u_int64_t)(c)[24]) << 8) | \
(((u_int64_t)(c)[25]) << 0))
-#define ISP2100_NVRAM_HARDLOOPID(c) (c)[26]
+#define ISP2100_NVRAM_HARDLOOPID(c) (c)[24]
#define ISP2100_NVRAM_HBA_DISABLE(c) ISPBSMX(c, 70, 0, 0x01)
#define ISP2100_NVRAM_BIOS_DISABLE(c) ISPBSMX(c, 70, 1, 0x01)
diff --git a/sys/dev/isp/ispvar.h b/sys/dev/isp/ispvar.h
index 222f77e9e9051..d1aeade78e4c9 100644
--- a/sys/dev/isp/ispvar.h
+++ b/sys/dev/isp/ispvar.h
@@ -1,5 +1,4 @@
-/* $Id: ispvar.h,v 1.7 1998/12/28 19:22:27 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* Soft Definitions for for Qlogic ISP SCSI adapters.
*
@@ -44,11 +43,11 @@
#include <dev/isp/ispmbox.h>
#endif
#ifdef __linux__
-#include "ispmbox.h"
+#include <ispmbox.h>
#endif
#define ISP_CORE_VERSION_MAJOR 1
-#define ISP_CORE_VERSION_MINOR 5
+#define ISP_CORE_VERSION_MINOR 3
/*
* Vector for MD code to provide specific services.
@@ -78,7 +77,6 @@ struct ispmdvec {
#define MAX_TARGETS 16
#define MAX_FC_TARG 126
-#define DEFAULT_LOOPID 113
/* queue length must be a power of two */
#define QENTRY_LEN 64
@@ -99,7 +97,7 @@ typedef struct {
isp_data_line_active_neg: 1,
isp_cmd_dma_burst_enable: 1,
isp_data_dma_burst_enabl: 1,
- isp_fifo_threshold : 3,
+ isp_fifo_threshold : 2,
isp_diffmode : 1,
isp_fast_mttr : 1,
isp_initiator_id : 4,
@@ -177,42 +175,6 @@ typedef struct {
#define FW_REINIT 0x0006
#define FW_NON_PART 0x0007
-#ifdef ISP_TARGET_MODE
-/*
- * Some temporary Target Mode definitions
- */
-typedef struct tmd_cmd {
- u_int8_t cd_iid; /* initiator */
- u_int8_t cd_tgt; /* target */
- u_int8_t cd_lun; /* LUN for this command */
- u_int8_t cd_state;
- u_int8_t cd_cdb[16]; /* command bytes */
- u_int8_t cd_sensedata[20];
- u_int16_t cd_rxid;
- u_int32_t cd_datalen;
- u_int32_t cd_totbytes;
- void * cd_hba;
-} tmd_cmd_t;
-
-/*
- * Async Target Mode Event Definitions
- */
-#define TMD_BUS_RESET 0
-#define TMD_BDR 1
-
-/*
- * Immediate Notify data structure.
- */
-#define NOTIFY_MSGLEN 5
-typedef struct {
- u_int8_t nt_iid; /* initiator */
- u_int8_t nt_tgt; /* target */
- u_int8_t nt_lun; /* LUN for this command */
- u_int8_t nt_msg[NOTIFY_MSGLEN]; /* SCSI message byte(s) */
-} tmd_notify_t;
-
-#endif
-
/*
* Soft Structure per host adapter
*/
@@ -228,7 +190,7 @@ struct ispsoftc {
struct ispmdvec * isp_mdvec;
/*
- * Mostly nonvolatile state, debugging, etc..
+ * State, debugging, etc..
*/
u_int : 8,
@@ -281,28 +243,6 @@ struct ispsoftc {
volatile caddr_t isp_result;
u_int32_t isp_rquest_dma;
u_int32_t isp_result_dma;
-
-#ifdef ISP_TARGET_MODE
- /*
- * Vectors for handling target mode support.
- *
- * isp_tmd_newcmd is for feeding a newly arrived command to some
- * upper layer.
- *
- * isp_tmd_event is for notifying some upper layer that an event has
- * occurred that is not necessarily tied to any target (e.g., a SCSI
- * Bus Reset).
- *
- * isp_tmd_notify is for notifying some upper layer that some
- * event is now occurring that is either pertinent for a specific
- * device or for a specific command (e.g., BDR or ABORT TAG).
- *
- * It is left undefined (for now) how pools of commands are managed.
- */
- void (*isp_tmd_newcmd) __P((void *, tmd_cmd_t *));
- void (*isp_tmd_event) __P((void *, int));
- void (*isp_tmd_notify) __P((void *, tmd_notify_t *));
-#endif
};
/*
@@ -388,6 +328,11 @@ void isp_reset __P((struct ispsoftc *));
void isp_init __P((struct ispsoftc *));
/*
+ * Free any associated resources prior to decommissioning.
+ */
+void isp_uninit __P((struct ispsoftc *));
+
+/*
* Reset the ISP and call completion for any orphaned commands.
*/
void isp_restart __P((struct ispsoftc *));
@@ -398,6 +343,11 @@ void isp_restart __P((struct ispsoftc *));
int isp_intr __P((void *));
/*
+ * Watchdog Routine
+ */
+void isp_watch __P((void *));
+
+/*
* Command Entry Point
*/
int32_t ispscsicmd __P((ISP_SCSI_XFER_T *));
diff --git a/sys/dev/kbd/atkbd.c b/sys/dev/kbd/atkbd.c
deleted file mode 100644
index 653e2955ffee4..0000000000000
--- a/sys/dev/kbd/atkbd.c
+++ /dev/null
@@ -1,1313 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: atkbd.c,v 1.2 1999/01/13 11:19:19 yokota Exp $
- */
-
-#include "atkbd.h"
-#include "opt_kbd.h"
-#include "opt_devfs.h"
-
-#if NATKBD > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/fcntl.h>
-#include <sys/malloc.h>
-
-#include <dev/kbd/kbdreg.h>
-#include <dev/kbd/atkbdreg.h>
-#include <dev/kbd/atkbdcreg.h>
-
-#ifndef __i386__
-
-#include <isa/isareg.h>
-
-#define ATKBD_SOFTC(unit) \
- ((atkbd_softc_t *)devclass_get_softc(atkbd_devclass, unit))
-
-#else /* __i386__ */
-
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-
-extern struct isa_driver atkbddriver; /* XXX: a kludge; see below */
-
-static atkbd_softc_t *atkbd_softc[NATKBD];
-
-#define ATKBD_SOFTC(unit) atkbd_softc[(unit)]
-
-#endif /* __i386__ */
-
-static timeout_t atkbd_timeout;
-
-#ifdef KBD_INSTALL_CDEV
-
-static d_open_t atkbdopen;
-static d_close_t atkbdclose;
-static d_read_t atkbdread;
-static d_ioctl_t atkbdioctl;
-static d_poll_t atkbdpoll;
-
-static struct cdevsw atkbd_cdevsw = {
- atkbdopen, atkbdclose, atkbdread, nowrite,
- atkbdioctl, nostop, nullreset, nodevtotty,
- atkbdpoll, nommap, NULL, ATKBD_DRIVER_NAME,
- NULL, -1,
-};
-
-#endif /* KBD_INSTALL_CDEV */
-
-#ifdef __i386__
-
-atkbd_softc_t
-*atkbd_get_softc(int unit)
-{
- atkbd_softc_t *sc;
-
- if (unit >= sizeof(atkbd_softc)/sizeof(atkbd_softc[0]))
- return NULL;
- sc = atkbd_softc[unit];
- if (sc == NULL) {
- sc = atkbd_softc[unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return NULL;
- bzero(sc, sizeof(*sc));
- }
- return sc;
-}
-
-#endif /* __i386__ */
-
-int
-atkbd_probe_unit(int unit, atkbd_softc_t *sc, int port, int irq, int flags)
-{
- keyboard_switch_t *sw;
- int args[2];
-
- if (sc->flags & ATKBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(ATKBD_DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- args[0] = port;
- args[1] = irq;
- return (*sw->probe)(unit, &sc->kbd, args, flags);
-}
-
-int
-atkbd_attach_unit(int unit, atkbd_softc_t *sc)
-{
- keyboard_switch_t *sw;
- int error;
-
- if (sc->flags & ATKBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(ATKBD_DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- /* reset, initialize and enable the device */
- error = (*sw->init)(sc->kbd);
- if (error)
- return ENXIO;
- (*sw->enable)(sc->kbd);
-
-#ifdef KBD_INSTALL_CDEV
- /* attach a virtual keyboard cdev */
- error = kbd_attach(makedev(0, ATKBD_MKMINOR(unit)), sc->kbd,
- &atkbd_cdevsw);
- if (error)
- return error;
-#endif
-
- /*
- * This is a kludge to compensate for lost keyboard interrupts.
- * A similar code used to be in syscons. See below. XXX
- */
- atkbd_timeout(sc->kbd);
-
- if (bootverbose)
- (*sw->diag)(sc->kbd, bootverbose);
-
- sc->flags |= ATKBD_ATTACHED;
- return 0;
-}
-
-static void
-atkbd_timeout(void *arg)
-{
- keyboard_t *kbd;
- int s;
-
- /* The following comments are extracted from syscons.c (1.287) */
- /*
- * With release 2.1 of the Xaccel server, the keyboard is left
- * hanging pretty often. Apparently an interrupt from the
- * keyboard is lost, and I don't know why (yet).
- * This ugly hack calls scintr if input is ready for the keyboard
- * and conveniently hides the problem. XXX
- */
- /*
- * Try removing anything stuck in the keyboard controller; whether
- * it's a keyboard scan code or mouse data. `scintr()' doesn't
- * read the mouse data directly, but `kbdio' routines will, as a
- * side effect.
- */
- s = spltty();
- kbd = (keyboard_t *)arg;
- if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) {
- /*
- * We have seen the lock flag is not set. Let's reset
- * the flag early, otherwise the LED update routine fails
- * which may want the lock during the interrupt routine.
- */
- (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE);
- if ((*kbdsw[kbd->kb_index]->check_char)(kbd))
- (*kbdsw[kbd->kb_index]->intr)(kbd);
- }
- splx(s);
- timeout(atkbd_timeout, arg, hz/10);
-}
-
-/* cdev driver functions */
-
-#ifdef KBD_INSTALL_CDEV
-
-static int
-atkbdopen(dev_t dev, int flag, int mode, struct proc *p)
-{
- atkbd_softc_t *sc;
- int unit;
-
- unit = ATKBD_UNIT(dev);
- if ((unit >= NATKBD) || ((sc = ATKBD_SOFTC(unit)) == NULL))
- return ENXIO;
- if (mode & (FWRITE | O_CREAT | O_APPEND | O_TRUNC))
- return ENODEV;
-
- /* FIXME: set the initial input mode (K_XLATE?) and lock state? */
- return genkbdopen(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-atkbdclose(dev_t dev, int flag, int mode, struct proc *p)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdclose(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-atkbdread(dev_t dev, struct uio *uio, int flag)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdread(&sc->gensc, sc->kbd, uio, flag);
-}
-
-static int
-atkbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdioctl(&sc->gensc, sc->kbd, cmd, arg, flag, p);
-}
-
-static int
-atkbdpoll(dev_t dev, int event, struct proc *p)
-{
- atkbd_softc_t *sc;
-
- sc = ATKBD_SOFTC(ATKBD_UNIT(dev));
- return genkbdpoll(&sc->gensc, sc->kbd, event, p);
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/* LOW-LEVEL */
-
-#include <machine/limits.h>
-#include <machine/console.h>
-#include <machine/clock.h>
-
-#define ATKBD_DEFAULT 0
-
-typedef struct atkbd_state {
- KBDC kbdc; /* keyboard controller */
- /* XXX: don't move this field; pcvt
- * expects `kbdc' to be the first
- * field in this structure. */
- int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */
- int ks_flags; /* flags */
-#define COMPOSE (1 << 0)
- int ks_state; /* shift/lock key state */
- int ks_accents; /* accent key index (> 0) */
- u_int ks_composed_char; /* composed char code (> 0) */
- u_char ks_prefix; /* AT scan code prefix */
-} atkbd_state_t;
-
-/* keyboard driver declaration */
-static int atkbd_configure(int flags);
-static kbd_probe_t atkbd_probe;
-static kbd_init_t atkbd_init;
-static kbd_term_t atkbd_term;
-static kbd_intr_t atkbd_intr;
-static kbd_test_if_t atkbd_test_if;
-static kbd_enable_t atkbd_enable;
-static kbd_disable_t atkbd_disable;
-static kbd_read_t atkbd_read;
-static kbd_check_t atkbd_check;
-static kbd_read_char_t atkbd_read_char;
-static kbd_check_char_t atkbd_check_char;
-static kbd_ioctl_t atkbd_ioctl;
-static kbd_lock_t atkbd_lock;
-static kbd_clear_state_t atkbd_clear_state;
-static kbd_get_state_t atkbd_get_state;
-static kbd_set_state_t atkbd_set_state;
-
-keyboard_switch_t atkbdsw = {
- atkbd_probe,
- atkbd_init,
- atkbd_term,
- atkbd_intr,
- atkbd_test_if,
- atkbd_enable,
- atkbd_disable,
- atkbd_read,
- atkbd_check,
- atkbd_read_char,
- atkbd_check_char,
- atkbd_ioctl,
- atkbd_lock,
- atkbd_clear_state,
- atkbd_get_state,
- atkbd_set_state,
- genkbd_get_fkeystr,
- genkbd_diag,
-};
-
-KEYBOARD_DRIVER(atkbd, atkbdsw, atkbd_configure);
-
-/* local functions */
-static int setup_kbd_port(KBDC kbdc, int port, int intr);
-static int get_kbd_echo(KBDC kbdc);
-static int probe_keyboard(KBDC kbdc, int flags);
-static int init_keyboard(KBDC kbdc, int *type, int flags);
-static int write_kbd(KBDC kbdc, int command, int data);
-static int get_kbd_id(KBDC kbdc);
-
-/* local variables */
-
-/* the initial key map, accent map and fkey strings */
-#include <dev/kbd/kbdtables.h>
-
-/* structures for the default keyboard */
-static keyboard_t default_kbd;
-static atkbd_state_t default_kbd_state;
-static keymap_t default_keymap;
-static accentmap_t default_accentmap;
-static fkeytab_t default_fkeytab[NUM_FKEYS];
-
-/*
- * The back door to the keyboard driver!
- * This function is called by the console driver, via the kbdio module,
- * to tickle keyboard drivers when the low-level console is being initialized.
- * Almost nothing in the kernel has been initialied yet. Try to probe
- * keyboards if possible.
- * NOTE: because of the way the low-level conole is initialized, this routine
- * may be called more than once!!
- */
-static int
-atkbd_configure(int flags)
-{
- keyboard_t *kbd;
- KBDC kbdc;
- int arg[2];
-#ifdef __i386__
- struct isa_device *dev;
-
- /* XXX: a kludge to obtain the device configuration flags */
- dev = find_isadev(isa_devtab_tty, &atkbddriver, 0);
- if (dev != NULL)
- flags |= dev->id_flags;
-#endif
-
- /* probe the keyboard controller */
- atkbdc_configure();
-
- /* probe the default keyboard */
- arg[0] = -1;
- arg[1] = -1;
- if (atkbd_probe(ATKBD_DEFAULT, &kbd, arg, flags))
- return 0;
-
- /* initialize it */
- kbdc = ((atkbd_state_t *)kbd->kb_data)->kbdc;
- if (!(flags & KB_CONF_PROBE_ONLY) && !KBD_IS_INITIALIZED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, flags)
- && (flags & KB_CONF_FAIL_IF_NO_KBD))
- return 0;
- KBD_INIT_DONE(kbd);
- }
-
- /* and register */
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return 0;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 1; /* return the number of found keyboards */
-}
-
-/* low-level functions */
-
-/* initialize the keyboard_t structure and try to detect a keyboard */
-static int
-atkbd_probe(int unit, keyboard_t **kbdp, void *arg, int flags)
-{
- keyboard_t *kbd;
- atkbd_state_t *state;
- keymap_t *keymap;
- accentmap_t *accmap;
- fkeytab_t *fkeymap;
- int fkeymap_size;
- KBDC kbdc;
- int *data = (int *)arg;
-
- /* XXX */
- if (unit == ATKBD_DEFAULT) {
- *kbdp = kbd = &default_kbd;
- if (KBD_IS_PROBED(kbd))
- return 0;
- state = &default_kbd_state;
- keymap = &default_keymap;
- accmap = &default_accentmap;
- fkeymap = default_fkeytab;
- fkeymap_size =
- sizeof(default_fkeytab)/sizeof(default_fkeytab[0]);
- } else if (*kbdp == NULL) {
- *kbdp = kbd = malloc(sizeof(*kbd), M_DEVBUF, M_NOWAIT);
- if (kbd == NULL)
- return ENOMEM;
- bzero(kbd, sizeof(*kbd));
- state = malloc(sizeof(*state), M_DEVBUF, M_NOWAIT);
- keymap = malloc(sizeof(key_map), M_DEVBUF, M_NOWAIT);
- accmap = malloc(sizeof(accent_map), M_DEVBUF, M_NOWAIT);
- fkeymap = malloc(sizeof(fkey_tab), M_DEVBUF, M_NOWAIT);
- fkeymap_size = sizeof(fkey_tab)/sizeof(fkey_tab[0]);
- if ((state == NULL) || (keymap == NULL) || (accmap == NULL)
- || (fkeymap == NULL)) {
- if (state != NULL)
- free(state, M_DEVBUF);
- if (keymap != NULL)
- free(keymap, M_DEVBUF);
- if (accmap != NULL)
- free(accmap, M_DEVBUF);
- if (fkeymap != NULL)
- free(fkeymap, M_DEVBUF);
- free(kbd, M_DEVBUF);
- return ENOMEM;
- }
- bzero(state, sizeof(*state));
- } else if (KBD_IS_PROBED(*kbdp)) {
- return 0;
- } else {
- kbd = *kbdp;
- state = (atkbd_state_t *)kbd->kb_data;
- bzero(state, sizeof(*state));
- keymap = kbd->kb_keymap;
- accmap = kbd->kb_accentmap;
- fkeymap = kbd->kb_fkeytab;
- fkeymap_size = kbd->kb_fkeytab_size;
- }
-
- state->kbdc = kbdc = kbdc_open(data[0]);
- if (kbdc == NULL)
- return ENXIO;
- kbd_init_struct(kbd, ATKBD_DRIVER_NAME, KB_OTHER, unit, flags, data[0],
- IO_KBDSIZE);
- bcopy(&key_map, keymap, sizeof(key_map));
- bcopy(&accent_map, accmap, sizeof(accent_map));
- bcopy(fkey_tab, fkeymap,
- imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab)));
- kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size);
- kbd->kb_data = (void *)state;
-
- if (probe_keyboard(kbdc, flags)) {
- if (flags & KB_CONF_FAIL_IF_NO_KBD)
- return ENXIO;
- } else {
- KBD_FOUND_DEVICE(kbd);
- }
- atkbd_clear_state(kbd);
- state->ks_mode = K_XLATE;
- /*
- * FIXME: set the initial value for lock keys in ks_state
- * according to the BIOS data?
- */
-
- KBD_PROBE_DONE(kbd);
- return 0;
-}
-
-/* reset and initialize the device */
-static int
-atkbd_init(keyboard_t *kbd)
-{
- KBDC kbdc;
-
- if ((kbd == NULL) || !KBD_IS_PROBED(kbd))
- return ENXIO; /* shouldn't happen */
- kbdc = ((atkbd_state_t *)kbd->kb_data)->kbdc;
- if (kbdc == NULL)
- return ENXIO; /* shouldn't happen */
-
- if (!KBD_IS_INITIALIZED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, kbd->kb_config)
- && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD))
- return ENXIO;
- atkbd_ioctl(kbd, KDSETLED,
- (caddr_t)&((atkbd_state_t *)(kbd->kb_data))->ks_state);
- KBD_INIT_DONE(kbd);
- }
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return ENXIO;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 0;
-}
-
-/* finish using this keyboard */
-static int
-atkbd_term(keyboard_t *kbd)
-{
- kbd_unregister(kbd);
- return 0;
-}
-
-/* keyboard interrupt routine */
-static int
-atkbd_intr(keyboard_t *kbd)
-{
- atkbd_state_t *state;
- int c;
-
- if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
- /* let the callback function to process the input */
- (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,
- kbd->kb_callback.kc_arg);
- } else {
- /* read and discard the input; no one is waiting for input */
- do {
- c = atkbd_read_char(kbd, FALSE);
- } while (c != NOKEY);
-
- if (!KBD_HAS_DEVICE(kbd)) {
- /*
- * The keyboard was not detected before;
- * it must have been reconnected!
- */
- state = (atkbd_state_t *)kbd->kb_data;
- init_keyboard(state->kbdc, &kbd->kb_type,
- kbd->kb_config);
- atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state);
- KBD_FOUND_DEVICE(kbd);
- }
- }
- return 0;
-}
-
-/* test the interface to the device */
-static int
-atkbd_test_if(keyboard_t *kbd)
-{
- int error;
- int s;
-
- error = 0;
- empty_both_buffers(((atkbd_state_t *)kbd->kb_data)->kbdc, 10);
- s = spltty();
- if (!test_controller(((atkbd_state_t *)kbd->kb_data)->kbdc))
- error = EIO;
- else if (test_kbd_port(((atkbd_state_t *)kbd->kb_data)->kbdc) != 0)
- error = EIO;
- splx(s);
-
- return error;
-}
-
-/*
- * Enable the access to the device; until this function is called,
- * the client cannot read from the keyboard.
- */
-static int
-atkbd_enable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_ACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* disallow the access to the device */
-static int
-atkbd_disable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_DEACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* read one byte from the keyboard if it's allowed */
-static int
-atkbd_read(keyboard_t *kbd, int wait)
-{
- int c;
-
- if (wait)
- c = read_kbd_data(((atkbd_state_t *)kbd->kb_data)->kbdc);
- else
- c = read_kbd_data_no_wait(((atkbd_state_t *)kbd->kb_data)->kbdc);
- return (KBD_IS_ACTIVE(kbd) ? c : -1);
-}
-
-/* check if data is waiting */
-static int
-atkbd_check(keyboard_t *kbd)
-{
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- return kbdc_data_ready(((atkbd_state_t *)kbd->kb_data)->kbdc);
-}
-
-/* read char from the keyboard */
-static u_int
-atkbd_read_char(keyboard_t *kbd, int wait)
-{
- atkbd_state_t *state;
- u_int action;
- int scancode;
- int keycode;
-
- state = (atkbd_state_t *)kbd->kb_data;
-next_code:
- /* do we have a composed char to return? */
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0)) {
- action = state->ks_composed_char;
- state->ks_composed_char = 0;
- if (action > UCHAR_MAX)
- return ERRKEY;
- return action;
- }
-
- /* see if there is something in the keyboard port */
- if (wait) {
- do {
- scancode = read_kbd_data(state->kbdc);
- } while (scancode == -1);
- } else {
- scancode = read_kbd_data_no_wait(state->kbdc);
- if (scancode == -1)
- return NOKEY;
- }
-
- /* return the byte as is for the K_RAW mode */
- if (state->ks_mode == K_RAW)
- return scancode;
-
- /* translate the scan code into a keycode */
- keycode = scancode & 0x7F;
- switch (state->ks_prefix) {
- case 0x00: /* normal scancode */
- switch(scancode) {
- case 0xB8: /* left alt (compose key) released */
- if (state->ks_flags & COMPOSE) {
- state->ks_flags &= ~COMPOSE;
- if (state->ks_composed_char > UCHAR_MAX)
- state->ks_composed_char = 0;
- }
- break;
- case 0x38: /* left alt (compose key) pressed */
- if (!(state->ks_flags & COMPOSE)) {
- state->ks_flags |= COMPOSE;
- state->ks_composed_char = 0;
- }
- break;
- case 0xE0:
- case 0xE1:
- state->ks_prefix = scancode;
- goto next_code;
- }
- break;
- case 0xE0: /* 0xE0 prefix */
- state->ks_prefix = 0;
- switch (keycode) {
- case 0x1C: /* right enter key */
- keycode = 0x59;
- break;
- case 0x1D: /* right ctrl key */
- keycode = 0x5A;
- break;
- case 0x35: /* keypad divide key */
- keycode = 0x5B;
- break;
- case 0x37: /* print scrn key */
- keycode = 0x5C;
- break;
- case 0x38: /* right alt key (alt gr) */
- keycode = 0x5D;
- break;
- case 0x47: /* grey home key */
- keycode = 0x5E;
- break;
- case 0x48: /* grey up arrow key */
- keycode = 0x5F;
- break;
- case 0x49: /* grey page up key */
- keycode = 0x60;
- break;
- case 0x4B: /* grey left arrow key */
- keycode = 0x61;
- break;
- case 0x4D: /* grey right arrow key */
- keycode = 0x62;
- break;
- case 0x4F: /* grey end key */
- keycode = 0x63;
- break;
- case 0x50: /* grey down arrow key */
- keycode = 0x64;
- break;
- case 0x51: /* grey page down key */
- keycode = 0x65;
- break;
- case 0x52: /* grey insert key */
- keycode = 0x66;
- break;
- case 0x53: /* grey delete key */
- keycode = 0x67;
- break;
- /* the following 3 are only used on the MS "Natural" keyboard */
- case 0x5b: /* left Window key */
- keycode = 0x69;
- break;
- case 0x5c: /* right Window key */
- keycode = 0x6a;
- break;
- case 0x5d: /* menu key */
- keycode = 0x6b;
- break;
- default: /* ignore everything else */
- goto next_code;
- }
- break;
- case 0xE1: /* 0xE1 prefix */
- state->ks_prefix = 0;
- if (keycode == 0x1D)
- state->ks_prefix = 0x1D;
- goto next_code;
- /* NOT REACHED */
- case 0x1D: /* pause / break */
- state->ks_prefix = 0;
- if (keycode != 0x45)
- goto next_code;
- keycode = 0x68;
- break;
- }
-
- /* return the key code in the K_CODE mode */
- if (state->ks_mode == K_CODE)
- return (keycode | (scancode & 0x80));
-
- /* compose a character code */
- if (state->ks_flags & COMPOSE) {
- switch (scancode) {
- /* key pressed, process it */
- case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x40;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x47;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x4E;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x52: /* keypad 0 */
- state->ks_composed_char *= 10;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
-
- /* key released, no interest here */
- case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */
- case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */
- case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */
- case 0xD2: /* keypad 0 */
- goto next_code;
-
- case 0x38: /* left alt key */
- break;
-
- default:
- if (state->ks_composed_char > 0) {
- state->ks_flags &= ~COMPOSE;
- state->ks_composed_char = 0;
- return ERRKEY;
- }
- break;
- }
- }
-
- /* keycode to key action */
- action = genkbd_keyaction(kbd, keycode, scancode & 0x80,
- &state->ks_state, &state->ks_accents);
- if (action == NOKEY)
- goto next_code;
- else
- return action;
-}
-
-/* check if char is waiting */
-static int
-atkbd_check_char(keyboard_t *kbd)
-{
- atkbd_state_t *state;
-
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- state = (atkbd_state_t *)kbd->kb_data;
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0))
- return TRUE;
- return kbdc_data_ready(state->kbdc);
-}
-
-/* some useful control functions */
-static int
-atkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
-{
- /* trasnlate LED_XXX bits into the device specific bits */
- static u_char ledmap[8] = {
- 0, 4, 2, 6, 1, 5, 3, 7,
- };
- atkbd_state_t *state = kbd->kb_data;
- int error;
- int s;
- int i;
-
- s = spltty();
- switch (cmd) {
-
- case KDGKBMODE: /* get keyboard mode */
- *(int *)arg = state->ks_mode;
- break;
- case KDSKBMODE: /* set keyboard mode */
- switch (*(int *)arg) {
- case K_XLATE:
- if (state->ks_mode != K_XLATE) {
- /* make lock key state and LED state match */
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= KBD_LED_VAL(kbd);
- }
- /* FALL THROUGH */
- case K_RAW:
- case K_CODE:
- if (state->ks_mode != *(int *)arg) {
- atkbd_clear_state(kbd);
- state->ks_mode = *(int *)arg;
- }
- break;
- default:
- splx(s);
- return EINVAL;
- }
- break;
-
- case KDGETLED: /* get keyboard LED */
- *(int *)arg = KBD_LED_VAL(kbd);
- break;
- case KDSETLED: /* set keyboard LED */
- /* NOTE: lock key state in ks_state won't be changed */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- i = *(int *)arg;
- /* replace CAPS LED with ALTGR LED for ALTGR keyboards */
- if (kbd->kb_keymap->n_keys > ALTGR_OFFSET) {
- if (i & ALKED)
- i |= CLKED;
- else
- i &= ~CLKED;
- }
- if (KBD_HAS_DEVICE(kbd)) {
- error = write_kbd(state->kbdc, KBDC_SET_LEDS,
- ledmap[i & LED_MASK]);
- if (error) {
- splx(s);
- return error;
- }
- }
- KBD_LED_VAL(kbd) = *(int *)arg;
- break;
-
- case KDGKBSTATE: /* get lock key state */
- *(int *)arg = state->ks_state & LOCK_MASK;
- break;
- case KDSKBSTATE: /* set lock key state */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= *(int *)arg;
- splx(s);
- /* set LEDs and quit */
- return atkbd_ioctl(kbd, KDSETLED, arg);
-
- case KDSETRAD: /* set keyboard repeat rate */
- splx(s);
- if (!KBD_HAS_DEVICE(kbd))
- return 0;
- return write_kbd(state->kbdc, KBDC_SET_TYPEMATIC,
- *(int *)arg);
-
- case PIO_KEYMAP: /* set keyboard translation table */
- case PIO_KEYMAPENT: /* set keyboard translation table entry */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- state->ks_accents = 0;
- /* FALL THROUGH */
- default:
- splx(s);
- return genkbd_commonioctl(kbd, cmd, arg);
- }
-
- splx(s);
- return 0;
-}
-
-/* lock the access to the keyboard */
-static int
-atkbd_lock(keyboard_t *kbd, int lock)
-{
- return kbdc_lock(((atkbd_state_t *)kbd->kb_data)->kbdc, lock);
-}
-
-/* clear the internal state of the keyboard */
-static void
-atkbd_clear_state(keyboard_t *kbd)
-{
- atkbd_state_t *state;
-
- state = (atkbd_state_t *)kbd->kb_data;
- state->ks_flags = 0;
- state->ks_state &= LOCK_MASK; /* preserve locking key state */
- state->ks_accents = 0;
- state->ks_composed_char = 0;
-#if 0
- state->ks_prefix = 0; /* XXX */
-#endif
-}
-
-/* save the internal state */
-static int
-atkbd_get_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len == 0)
- return sizeof(atkbd_state_t);
- if (len < sizeof(atkbd_state_t))
- return -1;
- bcopy(kbd->kb_data, buf, sizeof(atkbd_state_t));
- return 0;
-}
-
-/* set the internal state */
-static int
-atkbd_set_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len < sizeof(atkbd_state_t))
- return ENOMEM;
- if (((atkbd_state_t *)kbd->kb_data)->kbdc
- != ((atkbd_state_t *)buf)->kbdc)
- return ENOMEM;
- bcopy(buf, kbd->kb_data, sizeof(atkbd_state_t));
- return 0;
-}
-
-/* local functions */
-
-static int
-setup_kbd_port(KBDC kbdc, int port, int intr)
-{
- if (!set_controller_command_byte(kbdc,
- KBD_KBD_CONTROL_BITS,
- ((port) ? KBD_ENABLE_KBD_PORT : KBD_DISABLE_KBD_PORT)
- | ((intr) ? KBD_ENABLE_KBD_INT : KBD_DISABLE_KBD_INT)))
- return 1;
- return 0;
-}
-
-static int
-get_kbd_echo(KBDC kbdc)
-{
- /* enable the keyboard port, but disable the keyboard intr. */
- if (setup_kbd_port(kbdc, TRUE, FALSE))
- /* CONTROLLER ERROR: there is very little we can do... */
- return ENXIO;
-
- /* see if something is present */
- write_kbd_command(kbdc, KBDC_ECHO);
- if (read_kbd_data(kbdc) != KBD_ECHO) {
- empty_both_buffers(kbdc, 10);
- test_controller(kbdc);
- test_kbd_port(kbdc);
- return ENXIO;
- }
-
- /* enable the keyboard port and intr. */
- if (setup_kbd_port(kbdc, TRUE, TRUE)) {
- /*
- * CONTROLLER ERROR
- * This is serious; the keyboard intr is left disabled!
- */
- return ENXIO;
- }
-
- return 0;
-}
-
-static int
-probe_keyboard(KBDC kbdc, int flags)
-{
- /*
- * Don't try to print anything in this function. The low-level
- * console may not have been initialized yet...
- */
- int err;
- int c;
- int m;
-
- if (!kbdc_lock(kbdc, TRUE)) {
- /* driver error? */
- return ENXIO;
- }
-
- /* flush any noise in the buffer */
- empty_both_buffers(kbdc, 10);
-
- /* save the current keyboard controller command byte */
- m = kbdc_get_device_mask(kbdc) & ~KBD_KBD_CONTROL_BITS;
- c = get_controller_command_byte(kbdc);
- if (c == -1) {
- /* CONTROLLER ERROR */
- kbdc_set_device_mask(kbdc, m);
- kbdc_lock(kbdc, FALSE);
- return ENXIO;
- }
-
- /*
- * The keyboard may have been screwed up by the boot block.
- * We may just be able to recover from error by testing the controller
- * and the keyboard port. The controller command byte needs to be
- * saved before this recovery operation, as some controllers seem
- * to set the command byte to particular values.
- */
- test_controller(kbdc);
- test_kbd_port(kbdc);
-
- err = get_kbd_echo(kbdc);
- if (err == 0) {
- kbdc_set_device_mask(kbdc, m | KBD_KBD_CONTROL_BITS);
- } else {
- if (c != -1)
- /* try to restore the command byte as before */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_set_device_mask(kbdc, m);
- }
-
- kbdc_lock(kbdc, FALSE);
- return err;
-}
-
-static int
-init_keyboard(KBDC kbdc, int *type, int flags)
-{
- int codeset;
- int id;
- int c;
-
- if (!kbdc_lock(kbdc, TRUE)) {
- /* driver error? */
- return EIO;
- }
-
- /* save the current controller command byte */
- empty_both_buffers(kbdc, 10);
- c = get_controller_command_byte(kbdc);
- if (c == -1) {
- /* CONTROLLER ERROR */
- kbdc_lock(kbdc, FALSE);
- printf("atkbd: unable to get the current command byte value.\n");
- return EIO;
- }
- if (bootverbose)
- printf("atkbd: the current kbd controller command byte %04x\n",
- c);
-#if 0
- /* override the keyboard lock switch */
- c |= KBD_OVERRIDE_KBD_LOCK;
-#endif
-
- /* enable the keyboard port, but disable the keyboard intr. */
- if (setup_kbd_port(kbdc, TRUE, FALSE)) {
- /* CONTROLLER ERROR: there is very little we can do... */
- printf("atkbd: unable to set the command byte.\n");
- kbdc_lock(kbdc, FALSE);
- return EIO;
- }
-
- /*
- * Check if we have an XT keyboard before we attempt to reset it.
- * The procedure assumes that the keyboard and the controller have
- * been set up properly by BIOS and have not been messed up
- * during the boot process.
- */
- codeset = -1;
- if (flags & KB_CONF_ALT_SCANCODESET)
- /* the user says there is a XT keyboard */
- codeset = 1;
-#ifdef KBD_DETECT_XT_KEYBOARD
- else if ((c & KBD_TRANSLATION) == 0) {
- /* SET_SCANCODE_SET is not always supported; ignore error */
- if (send_kbd_command_and_data(kbdc, KBDC_SET_SCANCODE_SET, 0)
- == KBD_ACK)
- codeset = read_kbd_data(kbdc);
- }
- if (bootverbose)
- printf("atkbd: scancode set %d\n", codeset);
-#endif /* KBD_DETECT_XT_KEYBOARD */
-
- *type = KB_OTHER;
- id = get_kbd_id(kbdc);
- switch(id) {
- case 0x41ab:
- case 0x83ab:
- *type = KB_101;
- break;
- case -1: /* AT 84 keyboard doesn't return ID */
- *type = KB_84;
- break;
- default:
- break;
- }
- if (bootverbose)
- printf("atkbd: keyboard ID 0x%x (%d)\n", id, *type);
-
- /* reset keyboard hardware */
- if (!(flags & KB_CONF_NO_RESET) && !reset_kbd(kbdc)) {
- /*
- * KEYBOARD ERROR
- * Keyboard reset may fail either because the keyboard
- * doen't exist, or because the keyboard doesn't pass
- * the self-test, or the keyboard controller on the
- * motherboard and the keyboard somehow fail to shake hands.
- * It is just possible, particularly in the last case,
- * that the keyoard controller may be left in a hung state.
- * test_controller() and test_kbd_port() appear to bring
- * the keyboard controller back (I don't know why and how,
- * though.)
- */
- empty_both_buffers(kbdc, 10);
- test_controller(kbdc);
- test_kbd_port(kbdc);
- /*
- * We could disable the keyboard port and interrupt... but,
- * the keyboard may still exist (see above).
- */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_lock(kbdc, FALSE);
- if (bootverbose)
- printf("atkbd: failed to reset the keyboard.\n");
- return EIO;
- }
-
- /*
- * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
- * such as those on the IBM ThinkPad laptop computers can be used
- * with the standard console driver.
- */
- if (codeset == 1) {
- if (send_kbd_command_and_data(kbdc,
- KBDC_SET_SCANCODE_SET, codeset) == KBD_ACK) {
- /* XT kbd doesn't need scan code translation */
- c &= ~KBD_TRANSLATION;
- } else {
- /*
- * KEYBOARD ERROR
- * The XT kbd isn't usable unless the proper scan
- * code set is selected.
- */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_lock(kbdc, FALSE);
- printf("atkbd: unable to set the XT keyboard mode.\n");
- return EIO;
- }
- }
-
-#ifdef __alpha__
- if (send_kbd_command_and_data(
- kbdc, KBDC_SET_SCANCODE_SET, 2) != KBD_ACK) {
- printf("atkbd: can't set translation.\n");
-
- }
- c |= KBD_TRANSLATION;
-#endif
-
- /* enable the keyboard port and intr. */
- if (!set_controller_command_byte(kbdc,
- KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
- (c & (KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK))
- | KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
- /*
- * CONTROLLER ERROR
- * This is serious; we are left with the disabled
- * keyboard intr.
- */
- set_controller_command_byte(kbdc, 0xff, c);
- kbdc_lock(kbdc, FALSE);
- printf("atkbd: unable to enable the keyboard port and intr.\n");
- return EIO;
- }
-
- kbdc_lock(kbdc, FALSE);
- return 0;
-}
-
-static int
-write_kbd(KBDC kbdc, int command, int data)
-{
- int s;
-
- /* prevent the timeout routine from polling the keyboard */
- if (!kbdc_lock(kbdc, TRUE))
- return EBUSY;
-
- /* disable the keyboard and mouse interrupt */
- s = spltty();
-#if 0
- c = get_controller_command_byte(kbdc);
- if ((c == -1)
- || !set_controller_command_byte(kbdc,
- kbdc_get_device_mask(kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- kbdc_lock(kbdc, FALSE);
- splx(s);
- return EIO;
- }
- /*
- * Now that the keyboard controller is told not to generate
- * the keyboard and mouse interrupts, call `splx()' to allow
- * the other tty interrupts. The clock interrupt may also occur,
- * but the timeout routine (`scrn_timer()') will be blocked
- * by the lock flag set via `kbdc_lock()'
- */
- splx(s);
-#endif
-
- if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK)
- send_kbd_command(kbdc, KBDC_ENABLE_KBD);
-
-#if 0
- /* restore the interrupts */
- if (!set_controller_command_byte(kbdc,
- kbdc_get_device_mask(kbdc),
- c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
- /* CONTROLLER ERROR */
- }
-#else
- splx(s);
-#endif
- kbdc_lock(kbdc, FALSE);
-
- return 0;
-}
-
-static int
-get_kbd_id(KBDC kbdc)
-{
- int id1, id2;
-
- empty_both_buffers(kbdc, 10);
- id1 = id2 = -1;
- if (send_kbd_command(kbdc, KBDC_SEND_DEV_ID) != KBD_ACK)
- return -1;
-
- DELAY(10000); /* 10 msec delay */
- id1 = read_kbd_data(kbdc);
- if (id1 != -1)
- id2 = read_kbd_data(kbdc);
-
- if ((id1 == -1) || (id2 == -1)) {
- empty_both_buffers(kbdc, 10);
- test_controller(kbdc);
- test_kbd_port(kbdc);
- return -1;
- }
- return ((id2 << 8) | id1);
-}
-
-#endif /* NATKBD > 0 */
diff --git a/sys/dev/kbd/atkbdreg.h b/sys/dev/kbd/atkbdreg.h
deleted file mode 100644
index 9f20eeea5f3d7..0000000000000
--- a/sys/dev/kbd/atkbdreg.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: $
- */
-
-#ifndef _DEV_KBD_ATKBDREG_H_
-#define _DEV_KBD_ATKBDREG_H_
-
-#define ATKBD_DRIVER_NAME "atkbd"
-#define ATKBD_UNIT(dev) minor(dev)
-#define ATKBD_MKMINOR(unit) (unit)
-
-/* device configuration flags (atkbdprobe, atkbdattach) */
-#define KB_CONF_FAIL_IF_NO_KBD (1 << 0) /* don't install if no kbd is found */
-#define KB_CONF_NO_RESET (1 << 1) /* don't reset the keyboard */
-#define KB_CONF_ALT_SCANCODESET (1 << 2) /* assume the XT type keyboard */
-
-#ifdef KERNEL
-
-typedef struct atkbd_softc {
- short flags;
-#define ATKBD_ATTACHED (1 << 0)
- keyboard_t *kbd;
-#ifdef KBD_INSTALL_CDEV
- genkbd_softc_t gensc;
-#endif
-} atkbd_softc_t;
-
-#ifdef __i386__
-atkbd_softc_t *atkbd_get_softc(int unit);
-#endif
-int atkbd_probe_unit(int unit, atkbd_softc_t *sc,
- int port, int irq, int flags);
-int atkbd_attach_unit(int unit, atkbd_softc_t *sc);
-
-#endif /* KERNEL */
-
-#endif /* !_DEV_KBD_ATKBDREG_H_ */
diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c
deleted file mode 100644
index e8c638327f909..0000000000000
--- a/sys/dev/kbd/kbd.c
+++ /dev/null
@@ -1,1198 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: kbd.c,v 1.2 1999/01/12 10:35:58 yokota Exp $
- */
-
-#include "kbd.h"
-#include "opt_kbd.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/poll.h>
-#include <sys/vnode.h>
-#include <sys/uio.h>
-
-#include <machine/console.h>
-
-#include <dev/kbd/kbdreg.h>
-
-/* local arrays */
-
-/*
- * We need at least one entry each in order to initialize a keyboard
- * for the kernel console. The arrays will be increased dynamically
- * when necessary.
- */
-
-static int keyboards = 1;
-static keyboard_t *kbd_ini;
-static keyboard_t **keyboard = &kbd_ini;
-static keyboard_switch_t *kbdsw_ini;
- keyboard_switch_t **kbdsw = &kbdsw_ini;
-
-#ifdef KBD_INSTALL_CDEV
-
-#define ARRAY_DELTA 4
-
-static struct cdevsw *kbdcdevsw_ini;
-static struct cdevsw **kbdcdevsw = &kbdcdevsw_ini;
-
-static void
-kbd_realloc_array(void)
-{
- keyboard_t **new_kbd;
- keyboard_switch_t **new_kbdsw;
- struct cdevsw **new_cdevsw;
- int newsize;
- int s;
-
- s = spltty();
- newsize = ((keyboards + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA;
- new_kbd = malloc(sizeof(*new_kbd)*newsize, M_DEVBUF, M_NOWAIT);
- new_kbdsw = malloc(sizeof(*new_kbdsw)*newsize, M_DEVBUF, M_NOWAIT);
- new_cdevsw = malloc(sizeof(*new_cdevsw)*newsize, M_DEVBUF, M_NOWAIT);
- bzero(new_kbd, sizeof(*new_kbd)*newsize);
- bzero(new_kbdsw, sizeof(*new_kbdsw)*newsize);
- bzero(new_cdevsw, sizeof(*new_cdevsw)*newsize);
- bcopy(keyboard, new_kbd, sizeof(*keyboard)*keyboards);
- bcopy(kbdsw, new_kbdsw, sizeof(*kbdsw)*keyboards);
- bcopy(kbdcdevsw, new_cdevsw, sizeof(*kbdcdevsw)*keyboards);
- if (keyboards > 1) {
- free(keyboard, M_DEVBUF);
- free(kbdsw, M_DEVBUF);
- free(kbdcdevsw, M_DEVBUF);
- }
- keyboard = new_kbd;
- kbdsw = new_kbdsw;
- kbdcdevsw = new_cdevsw;
- keyboards = newsize;
- splx(s);
-
- if (bootverbose)
- printf("kbd: new array size %d\n", keyboards);
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/*
- * Low-level keyboard driver functions
- * Keyboard subdrivers, such as the AT keyboard driver and the USB keyboard
- * driver, call these functions to initialize the keyboard_t structure
- * and register it to the virtual keyboard driver `kbd'.
- */
-
-/* initialize the keyboard_t structure */
-void
-kbd_init_struct(keyboard_t *kbd, char *name, int type, int unit, int config,
- int port, int port_size)
-{
- kbd->kb_flags = KB_NO_DEVICE; /* device has not been found */
- kbd->kb_name = name;
- kbd->kb_type = type;
- kbd->kb_unit = unit;
- kbd->kb_config = config;
- kbd->kb_led = 0; /* unknown */
- kbd->kb_io_base = port;
- kbd->kb_io_size = port_size;
- kbd->kb_data = NULL;
- kbd->kb_keymap = NULL;
- kbd->kb_accentmap = NULL;
- kbd->kb_fkeytab = NULL;
- kbd->kb_fkeytab_size = 0;
-}
-
-void
-kbd_set_maps(keyboard_t *kbd, keymap_t *keymap, accentmap_t *accmap,
- fkeytab_t *fkeymap, int fkeymap_size)
-{
- kbd->kb_keymap = keymap;
- kbd->kb_accentmap = accmap;
- kbd->kb_fkeytab = fkeymap;
- kbd->kb_fkeytab_size = fkeymap_size;
-}
-
-/* register a keyboard and associate it with a function table */
-int
-kbd_register(keyboard_t *kbd)
-{
- keyboard_driver_t **list;
- keyboard_driver_t *p;
- int index;
-
- for (index = 0; index < keyboards; ++index) {
- if (keyboard[index] == NULL)
- break;
- }
- if (index >= keyboards)
- return -1;
-
- kbd->kb_index = index;
- KBD_UNBUSY(kbd);
- KBD_VALID(kbd);
- kbd->kb_active = 0; /* disabled until someone calls kbd_enable() */
- kbd->kb_token = NULL;
- kbd->kb_callback.kc_func = NULL;
- kbd->kb_callback.kc_arg = NULL;
-
- list = (keyboard_driver_t **)kbddriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, kbd->kb_name) == 0) {
- keyboard[index] = kbd;
- kbdsw[index] = p->kbdsw;
- return index;
- }
- }
-
- return -1;
-}
-
-int
-kbd_unregister(keyboard_t *kbd)
-{
- int error;
- int s;
-
- if ((kbd->kb_index < 0) || (kbd->kb_index >= keyboards))
- return ENOENT;
- if (keyboard[kbd->kb_index] != kbd)
- return ENOENT;
-
- s = spltty();
- if (KBD_IS_BUSY(kbd)) {
- error = (*kbd->kb_callback.kc_func)(kbd, KBDIO_UNLOADING,
- kbd->kb_callback.kc_arg);
- if (error) {
- splx(s);
- return error;
- }
- if (KBD_IS_BUSY(kbd)) {
- splx(s);
- return EBUSY;
- }
- }
- KBD_INVALID(kbd);
- keyboard[kbd->kb_index] = NULL;
- kbdsw[kbd->kb_index] = NULL;
-
- splx(s);
- return 0;
-}
-
-/* find a funciton table by the driver name */
-keyboard_switch_t
-*kbd_get_switch(char *driver)
-{
- keyboard_driver_t **list;
- keyboard_driver_t *p;
-
- list = (keyboard_driver_t **)kbddriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (strcmp(p->name, driver) == 0)
- return p->kbdsw;
- }
-
- return NULL;
-}
-
-/*
- * Keyboard client functions
- * Keyboard clients, such as the console driver `syscons' and the keyboard
- * cdev driver, use these functions to claim and release a keyboard for
- * exclusive use.
- */
-
-/* find the keyboard specified by a driver name and a unit number */
-int
-kbd_find_keyboard(char *driver, int unit)
-{
- int i;
-
- for (i = 0; i < keyboards; ++i) {
- if (keyboard[i] == NULL)
- continue;
- if (!KBD_IS_VALID(keyboard[i]))
- continue;
- if (strcmp("*", driver) && strcmp(keyboard[i]->kb_name, driver))
- continue;
- if ((unit != -1) && (keyboard[i]->kb_unit != unit))
- continue;
- return i;
- }
- return -1;
-}
-
-/* allocate a keyboard */
-int
-kbd_allocate(char *driver, int unit, void *id, kbd_callback_func_t *func,
- void *arg)
-{
- int index;
- int s;
-
- if (func == NULL)
- return -1;
-
- s = spltty();
- index = kbd_find_keyboard(driver, unit);
- if (index >= 0) {
- if (KBD_IS_BUSY(keyboard[index])) {
- splx(s);
- return -1;
- }
- keyboard[index]->kb_token = id;
- KBD_BUSY(keyboard[index]);
- keyboard[index]->kb_callback.kc_func = func;
- keyboard[index]->kb_callback.kc_arg = arg;
- (*kbdsw[index]->clear_state)(keyboard[index]);
- }
- splx(s);
- return index;
-}
-
-int
-kbd_release(keyboard_t *kbd, void *id)
-{
- int error;
- int s;
-
- s = spltty();
- if (!KBD_IS_VALID(kbd) || !KBD_IS_BUSY(kbd)) {
- error = EINVAL;
- } else if (kbd->kb_token != id) {
- error = EPERM;
- } else {
- kbd->kb_token = NULL;
- KBD_UNBUSY(kbd);
- kbd->kb_callback.kc_func = NULL;
- kbd->kb_callback.kc_arg = NULL;
- (*kbdsw[kbd->kb_index]->clear_state)(kbd);
- error = 0;
- }
- splx(s);
- return error;
-}
-
-int
-kbd_change_callback(keyboard_t *kbd, void *id, kbd_callback_func_t *func,
- void *arg)
-{
- int error;
- int s;
-
- s = spltty();
- if (!KBD_IS_VALID(kbd) || !KBD_IS_BUSY(kbd)) {
- error = EINVAL;
- } else if (kbd->kb_token != id) {
- error = EPERM;
- } else if (func == NULL) {
- error = EINVAL;
- } else {
- kbd->kb_callback.kc_func = func;
- kbd->kb_callback.kc_arg = arg;
- error = 0;
- }
- splx(s);
- return error;
-}
-
-/* get a keyboard structure */
-keyboard_t
-*kbd_get_keyboard(int index)
-{
- if ((index < 0) || (index >= keyboards))
- return NULL;
- if (!KBD_IS_VALID(keyboard[index]))
- return NULL;
- return keyboard[index];
-}
-
-/*
- * The back door for the console driver; configure keyboards
- * This function is for the kernel console to initialize keyboards
- * at very early stage.
- */
-
-int
-kbd_configure(int flags)
-{
- keyboard_driver_t **list;
- keyboard_driver_t *p;
-
- list = (keyboard_driver_t **)kbddriver_set.ls_items;
- while ((p = *list++) != NULL) {
- if (p->configure != NULL)
- (*p->configure)(flags);
- }
-
- return 0;
-}
-
-#ifdef KBD_INSTALL_CDEV
-
-/*
- * Virtual keyboard cdev driver functions
- * The virtual keyboard driver dispatches driver functions to
- * appropriate subdrivers.
- */
-
-#define KBD_UNIT(dev) minor(dev)
-
-static d_open_t kbdopen;
-static d_close_t kbdclose;
-static d_read_t kbdread;
-static d_write_t kbdwrite;
-static d_ioctl_t kbdioctl;
-static d_reset_t kbdreset;
-static d_devtotty_t kbddevtotty;
-static d_poll_t kbdpoll;
-static d_mmap_t kbdmmap;
-
-#define CDEV_MAJOR 112
-
-static struct cdevsw kbd_cdevsw = {
- kbdopen, kbdclose, kbdread, kbdwrite, /* ??? */
- kbdioctl, nullstop, kbdreset, kbddevtotty,
- kbdpoll, kbdmmap, nostrategy, "kbd",
- NULL, -1, nodump, nopsize,
-};
-
-static void
-vkbdattach(void *arg)
-{
- static int kbd_devsw_installed = FALSE;
- dev_t dev;
-
- if (!kbd_devsw_installed) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &kbd_cdevsw, NULL);
- kbd_devsw_installed = TRUE;
- }
-}
-
-PSEUDO_SET(vkbdattach, kbd);
-
-int
-kbd_attach(dev_t dev, keyboard_t *kbd, struct cdevsw *cdevsw)
-{
- int s;
-
- if (kbd->kb_index >= keyboards)
- return EINVAL;
- if (keyboard[kbd->kb_index] != kbd)
- return EINVAL;
-
- s = spltty();
- kbd->kb_minor = minor(dev);
- kbdcdevsw[kbd->kb_index] = cdevsw;
- splx(s);
-
- /* XXX: DEVFS? */
-
- if (kbd->kb_index + 1 >= keyboards)
- kbd_realloc_array();
-
- printf("kbd%d at %s%d\n", kbd->kb_index, kbd->kb_name, kbd->kb_unit);
- return 0;
-}
-
-int
-kbd_detach(dev_t dev, keyboard_t *kbd, struct cdevsw *cdevsw)
-{
- int s;
-
- if (kbd->kb_index >= keyboards)
- return EINVAL;
- if (keyboard[kbd->kb_index] != kbd)
- return EINVAL;
- if (kbdcdevsw[kbd->kb_index] != cdevsw)
- return EINVAL;
-
- s = spltty();
- (*kbdsw[kbd->kb_index]->term)(kbd);
- kbdcdevsw[kbd->kb_index] = NULL;
- splx(s);
- return 0;
-}
-
-static int
-kbdopen(dev_t dev, int flag, int mode, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (unit >= keyboards)
- return ENXIO;
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- if (KBD_IS_BUSY(keyboard[unit]))
- return EBUSY;
- return (*kbdcdevsw[unit]->d_open)(makedev(0, keyboard[unit]->kb_minor),
- flag, mode, p);
-}
-
-static int
-kbdclose(dev_t dev, int flag, int mode, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_close)(makedev(0, keyboard[unit]->kb_minor),
- flag, mode, p);
-}
-
-static int
-kbdread(dev_t dev, struct uio *uio, int flag)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_read)(makedev(0, keyboard[unit]->kb_minor),
- uio, flag);
-}
-
-static int
-kbdwrite(dev_t dev, struct uio *uio, int flag)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_write)(makedev(0, keyboard[unit]->kb_minor),
- uio, flag);
-}
-
-static int
-kbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_ioctl)(makedev(0, keyboard[unit]->kb_minor),
- cmd, arg, flag, p);
-}
-
-static int
-kbdreset(dev_t dev)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_reset)(makedev(0, keyboard[unit]->kb_minor));
-}
-
-static struct tty
-*kbddevtotty(dev_t dev)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return NULL;
- return (*kbdcdevsw[unit]->d_devtotty)(makedev(0, keyboard[unit]->kb_minor));
-}
-
-static int
-kbdpoll(dev_t dev, int event, struct proc *p)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_poll)(makedev(0, keyboard[unit]->kb_minor),
- event, p);
-}
-
-static int
-kbdmmap(dev_t dev, vm_offset_t offset, int nprot)
-{
- int unit;
-
- unit = KBD_UNIT(dev);
- if (kbdcdevsw[unit] == NULL)
- return ENXIO;
- return (*kbdcdevsw[unit]->d_mmap)(makedev(0, keyboard[unit]->kb_minor),
- offset, nprot);
-}
-
-/*
- * Generic keyboard cdev driver functions
- * Keyboard subdrivers may call these functions to implement common
- * driver functions.
- */
-
-#define KB_QSIZE 512
-#define KB_BUFSIZE 64
-
-static kbd_callback_func_t genkbd_event;
-
-int
-genkbdopen(genkbd_softc_t *sc, keyboard_t *kbd, int mode, int flag,
- struct proc *p)
-{
- int s;
- int i;
-
- s = spltty();
- if (!KBD_IS_VALID(kbd)) {
- splx(s);
- return ENXIO;
- }
- i = kbd_allocate(kbd->kb_name, kbd->kb_unit, sc,
- genkbd_event, (void *)sc);
- if (i < 0) {
- splx(s);
- return EBUSY;
- }
- /* assert(i == kbd->kb_index) */
- /* assert(kbd == kbd_get_keyboard(i)) */
-
- /*
- * NOTE: even when we have successfully claimed a keyboard,
- * the device may still be missing (!KBD_HAS_DEVICE(kbd)).
- */
-
-#if 0
- bzero(&sc->gkb_q, sizeof(sc->gkb_q));
-#endif
- clist_alloc_cblocks(&sc->gkb_q, KB_QSIZE, KB_QSIZE/2); /* XXX */
- sc->gkb_rsel.si_flags = 0;
- sc->gkb_rsel.si_pid = 0;
- splx(s);
-
- return 0;
-}
-
-int
-genkbdclose(genkbd_softc_t *sc, keyboard_t *kbd, int mode, int flag,
- struct proc *p)
-{
- int s;
-
- /*
- * NOTE: the device may have already become invalid.
- * !KBD_IS_VALID(kbd)
- */
- s = spltty();
- kbd_release(kbd, (void *)sc);
-#if 0
- clist_free_cblocks(&sc->gkb_q);
-#endif
- splx(s);
-
- return 0;
-}
-
-int
-genkbdread(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio, int flag)
-{
- u_char buffer[KB_BUFSIZE];
- int len;
- int error;
- int s;
-
- /* wait for input */
- s = spltty();
- while (sc->gkb_q.c_cc == 0) {
- if (!KBD_IS_VALID(kbd)) {
- splx(s);
- return EIO;
- }
- if (flag & IO_NDELAY) {
- splx(s);
- return EWOULDBLOCK;
- }
- sc->gkb_flags |= KB_ASLEEP;
- error = tsleep((caddr_t)sc, PZERO | PCATCH, "kbdrea", 0);
- if (error) {
- sc->gkb_flags &= ~KB_ASLEEP;
- splx(s);
- return error;
- }
- }
- splx(s);
-
- /* copy as much input as possible */
- error = 0;
- while (uio->uio_resid > 0) {
- len = imin(uio->uio_resid, sizeof(buffer));
- len = q_to_b(&sc->gkb_q, buffer, len);
- if (len <= 0)
- break;
- error = uiomove(buffer, len, uio);
- if (error)
- break;
- }
-
- return error;
-}
-
-int
-genkbdwrite(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio, int flag)
-{
- if (!KBD_IS_VALID(kbd))
- return ENXIO;
- return ENODEV;
-}
-
-int
-genkbdioctl(genkbd_softc_t *sc, keyboard_t *kbd, u_long cmd, caddr_t arg,
- int flag, struct proc *p)
-{
- int error;
-
- if (kbd == NULL) /* XXX */
- return ENXIO;
- if (!KBD_IS_VALID(kbd))
- return ENXIO;
- error = (*kbdsw[kbd->kb_index]->ioctl)(kbd, cmd, arg);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-}
-
-int
-genkbdpoll(genkbd_softc_t *sc, keyboard_t *kbd, int events, struct proc *p)
-{
- int revents;
- int s;
-
- revents = 0;
- s = spltty();
- if (events & (POLLIN | POLLRDNORM)) {
- if ((sc->gkb_q.c_cc > 0) || !KBD_IS_VALID(kbd))
- revents |= (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->gkb_rsel);
- }
- splx(s);
- return revents;
-}
-
-static int
-genkbd_event(keyboard_t *kbd, int event, void *arg)
-{
- genkbd_softc_t *sc;
- size_t len;
- u_char *cp;
- int mode;
- int c;
-
- /* assert(KBD_IS_VALID(kbd)) */
- sc = (genkbd_softc_t *)arg;
-
- switch (event) {
- case KBDIO_KEYINPUT:
- break;
- case KBDIO_UNLOADING:
- /* the keyboard is going... */
- kbd_release(kbd, (void *)sc);
- return 0;
- default:
- return EINVAL;
- }
-
- /* obtain the current key input mode */
- if ((*kbdsw[kbd->kb_index]->ioctl)(kbd, KDGKBMODE, (caddr_t)&mode))
- mode = K_XLATE;
-
- /* read all pending input */
- while ((*kbdsw[kbd->kb_index]->check_char)(kbd)) {
- c = (*kbdsw[kbd->kb_index]->read_char)(kbd, FALSE);
- if (c == NOKEY)
- continue;
- if (c == ERRKEY) /* XXX: ring bell? */
- continue;
- if (!KBD_IS_BUSY(kbd))
- /* the device is not open, discard the input */
- continue;
-
- /* store the byte as is for K_RAW and K_CODE modes */
- if (mode != K_XLATE) {
- putc(KEYCHAR(c), &sc->gkb_q);
- continue;
- }
-
- /* K_XLATE */
- if (c & RELKEY) /* key release is ignored */
- continue;
-
- /* process special keys; most of them are just ignored... */
- if (c & SPCLKEY) {
- switch (KEYCHAR(c)) {
- /* locking keys */
- case NLK: case CLK: case SLK: case ALK:
- /* shift keys */
- case LSH: case RSH: case LCTR: case RCTR:
- case LALT: case RALT: case ASH: case META:
- /* other special keys */
- case NOP: case SPSC: case RBT: case SUSP:
- case STBY: case DBG: case NEXT:
- /* ignore them... */
- continue;
- case BTAB: /* a backtab: ESC [ Z */
- putc(0x1b, &sc->gkb_q);
- putc('[', &sc->gkb_q);
- putc('Z', &sc->gkb_q);
- continue;
- }
- }
-
- /* normal chars, normal chars with the META, function keys */
- switch (KEYFLAGS(c)) {
- case 0: /* a normal char */
- putc(KEYCHAR(c), &sc->gkb_q);
- break;
- case MKEY: /* the META flag: prepend ESC */
- putc(0x1b, &sc->gkb_q);
- putc(KEYCHAR(c), &sc->gkb_q);
- break;
- case FKEY | SPCLKEY: /* a function key, return string */
- cp = (*kbdsw[kbd->kb_index]->get_fkeystr)(kbd,
- KEYCHAR(c), &len);
- if (cp != NULL) {
- while (len-- > 0)
- putc(*cp++, &sc->gkb_q);
- }
- break;
- }
- }
-
- /* wake up sleeping/polling processes */
- if (sc->gkb_q.c_cc > 0) {
- if (sc->gkb_flags & KB_ASLEEP) {
- sc->gkb_flags &= ~KB_ASLEEP;
- wakeup((caddr_t)sc);
- }
- selwakeup(&sc->gkb_rsel);
- }
-
- return 0;
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/*
- * Generic low-level keyboard functions
- * The low-level functions in the keyboard subdriver may use these
- * functions.
- */
-
-int
-genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
-{
- keyarg_t *keyp;
- fkeyarg_t *fkeyp;
- int s;
- int i;
-
- s = spltty();
- switch (cmd) {
-
- case KDGKBINFO: /* get keyboard information */
- ((keyboard_info_t *)arg)->kb_index = kbd->kb_index;
- i = imin(strlen(kbd->kb_name) + 1,
- sizeof(((keyboard_info_t *)arg)->kb_name));
- bcopy(kbd->kb_name, ((keyboard_info_t *)arg)->kb_name, i);
- ((keyboard_info_t *)arg)->kb_unit = kbd->kb_unit;
- ((keyboard_info_t *)arg)->kb_type = kbd->kb_type;
- ((keyboard_info_t *)arg)->kb_config = kbd->kb_config;
- ((keyboard_info_t *)arg)->kb_flags = kbd->kb_flags;
- break;
-
- case KDGKBTYPE: /* get keyboard type */
- *(int *)arg = kbd->kb_type;
- break;
-
- case GIO_KEYMAP: /* get keyboard translation table */
- bcopy(kbd->kb_keymap, arg, sizeof(*kbd->kb_keymap));
- break;
- case PIO_KEYMAP: /* set keyboard translation table */
- bzero(kbd->kb_accentmap, sizeof(*kbd->kb_accentmap));
- bcopy(arg, kbd->kb_keymap, sizeof(*kbd->kb_keymap));
- break;
-
- case GIO_KEYMAPENT: /* get keyboard translation table entry */
- keyp = (keyarg_t *)arg;
- if (keyp->keynum >= sizeof(kbd->kb_keymap->key)
- /sizeof(kbd->kb_keymap->key[0])) {
- splx(s);
- return EINVAL;
- }
- bcopy(&kbd->kb_keymap->key[keyp->keynum], &keyp->key,
- sizeof(keyp->key));
- break;
- case PIO_KEYMAPENT: /* set keyboard translation table entry */
- keyp = (keyarg_t *)arg;
- if (keyp->keynum >= sizeof(kbd->kb_keymap->key)
- /sizeof(kbd->kb_keymap->key[0])) {
- splx(s);
- return EINVAL;
- }
- bcopy(&keyp->key, &kbd->kb_keymap->key[keyp->keynum],
- sizeof(keyp->key));
- break;
-
- case GIO_DEADKEYMAP: /* get accent key translation table */
- bcopy(kbd->kb_accentmap, arg, sizeof(*kbd->kb_accentmap));
- break;
- case PIO_DEADKEYMAP: /* set accent key translation table */
- bcopy(arg, kbd->kb_accentmap, sizeof(*kbd->kb_accentmap));
- break;
-
- case GETFKEY: /* get functionkey string */
- fkeyp = (fkeyarg_t *)arg;
- if (fkeyp->keynum >= kbd->kb_fkeytab_size) {
- splx(s);
- return EINVAL;
- }
- bcopy(kbd->kb_fkeytab[fkeyp->keynum].str, fkeyp->keydef,
- kbd->kb_fkeytab[fkeyp->keynum].len);
- fkeyp->flen = kbd->kb_fkeytab[fkeyp->keynum].len;
- break;
- case SETFKEY: /* set functionkey string */
- fkeyp = (fkeyarg_t *)arg;
- if (fkeyp->keynum >= kbd->kb_fkeytab_size) {
- splx(s);
- return EINVAL;
- }
- kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK);
- bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str,
- kbd->kb_fkeytab[fkeyp->keynum].len);
- break;
-
- default:
- splx(s);
- return ENOIOCTL;
- }
-
- splx(s);
- return 0;
-}
-
-/* get a pointer to the string associated with the given function key */
-u_char
-*genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len)
-{
- if (kbd == NULL)
- return NULL;
- fkey -= F_FN;
- if (fkey > kbd->kb_fkeytab_size)
- return NULL;
- *len = kbd->kb_fkeytab[fkey].len;
- return kbd->kb_fkeytab[fkey].str;
-}
-
-/* diagnostic dump */
-static char
-*get_kbd_type_name(int type)
-{
- static struct {
- int type;
- char *name;
- } name_table[] = {
- { KB_84, "AT 84" },
- { KB_101, "AT 101/102" },
- { KB_OTHER, "generic" },
- };
- int i;
-
- for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) {
- if (type == name_table[i].type)
- return name_table[i].name;
- }
- return "unknown";
-}
-
-void
-genkbd_diag(keyboard_t *kbd, int level)
-{
- if (level > 0) {
- printf("kbd%d: %s%d, %s (%d), config:0x%x, flags:0x%x",
- kbd->kb_index, kbd->kb_name, kbd->kb_unit,
- get_kbd_type_name(kbd->kb_type), kbd->kb_type,
- kbd->kb_config, kbd->kb_flags);
- if (kbd->kb_io_base > 0)
- printf(", port:0x%x-0x%x", kbd->kb_io_base,
- kbd->kb_io_base + kbd->kb_io_size - 1);
- printf("\n");
- }
-}
-
-#define set_lockkey_state(k, s, l) \
- if (!((s) & l ## DOWN)) { \
- int i; \
- (s) |= l ## DOWN; \
- (s) ^= l ## ED; \
- i = (s) & LOCK_MASK; \
- (*kbdsw[(k)->kb_index]->ioctl)((k), KDSETLED, (caddr_t)&i); \
- }
-
-static u_int
-save_accent_key(keyboard_t *kbd, u_int key, int *accents)
-{
- int i;
-
- /* make an index into the accent map */
- i = key - F_ACC + 1;
- if ((i > kbd->kb_accentmap->n_accs)
- || (kbd->kb_accentmap->acc[i - 1].accchar == 0)) {
- /* the index is out of range or pointing to an empty entry */
- *accents = 0;
- return ERRKEY;
- }
-
- /*
- * If the same accent key has been hit twice, produce the accent char
- * itself.
- */
- if (i == *accents) {
- key = kbd->kb_accentmap->acc[i - 1].accchar;
- *accents = 0;
- return key;
- }
-
- /* remember the index and wait for the next key */
- *accents = i;
- return NOKEY;
-}
-
-static u_int
-make_accent_char(keyboard_t *kbd, u_int ch, int *accents)
-{
- struct acc_t *acc;
- int i;
-
- acc = &kbd->kb_accentmap->acc[*accents - 1];
- *accents = 0;
-
- /*
- * If the accent key is followed by the space key,
- * produce the accent char itself.
- */
- if (ch == ' ')
- return acc->accchar;
-
- /* scan the accent map */
- for (i = 0; i < NUM_ACCENTCHARS; ++i) {
- if (acc->map[i][0] == 0) /* end of table */
- break;
- if (acc->map[i][0] == ch)
- return acc->map[i][1];
- }
- /* this char cannot be accented... */
- return ERRKEY;
-}
-
-int
-genkbd_keyaction(keyboard_t *kbd, int keycode, int up, int *shiftstate,
- int *accents)
-{
- struct keyent_t *key;
- int state = *shiftstate;
- int action;
- int f;
- int i;
-
- f = state & (AGRS | ALKED);
- if ((f == AGRS1) || (f == AGRS2) || (f == ALKED))
- keycode += ALTGR_OFFSET;
- key = &kbd->kb_keymap->key[keycode];
- i = ((state & SHIFTS) ? 1 : 0)
- | ((state & CTLS) ? 2 : 0)
- | ((state & ALTS) ? 4 : 0);
- if (((key->flgs & FLAG_LOCK_C) && (state & CLKED))
- || ((key->flgs & FLAG_LOCK_N) && (state & NLKED)) )
- i ^= 1;
-
- action = key->map[i];
- if (up) { /* break: key released */
- if (key->spcl & (0x80 >> i)) {
- /* special keys */
- switch (action) {
- case LSH:
- state &= ~SHIFTS1;
- break;
- case RSH:
- state &= ~SHIFTS2;
- break;
- case LCTR:
- state &= ~CTLS1;
- break;
- case RCTR:
- state &= ~CTLS2;
- break;
- case LALT:
- state &= ~ALTS1;
- break;
- case RALT:
- state &= ~ALTS2;
- break;
- case ASH:
- state &= ~AGRS1;
- break;
- case META:
- state &= ~METAS1;
- break;
- case NLK:
- state &= ~NLKDOWN;
- break;
- case CLK:
-#ifndef PC98
- state &= ~CLKDOWN;
-#else
- state &= ~CLKED;
- i = state & LOCK_MASK;
- (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED,
- (caddr_t)&i);
-#endif
- break;
- case SLK:
- state &= ~SLKDOWN;
- break;
- case ALK:
- state &= ~ALKDOWN;
- break;
- }
- *shiftstate = state;
- return (SPCLKEY | RELKEY | action);
- }
- /* release events of regular keys are not reported */
- return NOKEY;
- } else { /* make: key pressed */
- if (key->spcl & (0x80 >> i)) {
- /* special keys */
- switch (action) {
- /* LOCKING KEYS */
- case NLK:
- set_lockkey_state(kbd, state, NLK);
- break;
- case CLK:
-#ifndef PC98
- set_lockkey_state(kbd, state, CLK);
-#else
- state |= CLKED;
- i = state & LOCK_MASK;
- (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED,
- (caddr_t)&i);
-#endif
- break;
- case SLK:
- set_lockkey_state(kbd, state, SLK);
- break;
- case ALK:
- set_lockkey_state(kbd, state, ALK);
- break;
- /* NON-LOCKING KEYS */
- case SPSC: case RBT: case SUSP: case STBY:
- case DBG: case NEXT:
- *accents = 0;
- break;
- case BTAB:
- *accents = 0;
- action |= BKEY;
- break;
- case LSH:
- state |= SHIFTS1;
- break;
- case RSH:
- state |= SHIFTS2;
- break;
- case LCTR:
- state |= CTLS1;
- break;
- case RCTR:
- state |= CTLS2;
- break;
- case LALT:
- state |= ALTS1;
- break;
- case RALT:
- state |= ALTS2;
- break;
- case ASH:
- state |= AGRS1;
- break;
- case META:
- state |= METAS1;
- break;
- default:
- /* is this an accent (dead) key? */
- if (action >= F_ACC && action <= L_ACC) {
- action = save_accent_key(kbd, action,
- accents);
- switch (action) {
- case NOKEY:
- case ERRKEY:
- return action;
- default:
- if (state & METAS)
- return (action | MKEY);
- else
- return action;
- }
- /* NOT REACHED */
- }
- /* other special keys */
- if (*accents > 0) {
- *accents = 0;
- return ERRKEY;
- }
- if (action >= F_FN && action <= L_FN)
- action |= FKEY;
- /* XXX: return fkey string for the FKEY? */
- }
- *shiftstate = state;
- return (SPCLKEY | action);
- } else {
- /* regular keys */
- if (*accents > 0) {
- /* make an accented char */
- action = make_accent_char(kbd, action, accents);
- if (action == ERRKEY)
- return action;
- }
- if (state & METAS)
- action |= MKEY;
- return action;
- }
- }
- /* NOT REACHED */
-}
diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h
deleted file mode 100644
index d5920196507d4..0000000000000
--- a/sys/dev/kbd/kbdreg.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: kbdreg.h,v 1.1 1999/01/09 02:44:50 yokota Exp $
- */
-
-#ifndef _DEV_KBD_KBDREG_H_
-#define _DEV_KBD_KBDREG_H_
-
-/* forward declarations */
-typedef struct keyboard keyboard_t;
-struct keymap;
-struct accentmap;
-struct fkeytab;
-
-/* call back funcion */
-typedef int kbd_callback_func_t(keyboard_t *kbd, int event,
- void *arg);
-/* event types */
-#define KBDIO_KEYINPUT 0
-#define KBDIO_UNLOADING 1
-
-typedef struct keyboard_callback {
- kbd_callback_func_t *kc_func;
- void *kc_arg;
-} keyboard_callback_t;
-
-/* keyboard */
-struct keyboard {
- /* the following fields are managed by kbdio */
- int kb_index; /* kbdio index# */
- int kb_minor; /* minor number of the sub-device */
- int kb_flags; /* internal flags */
-#define KB_VALID (1 << 16) /* this entry is valid */
-#define KB_NO_DEVICE (1 << 17) /* device not present */
-#define KB_PROBED (1 << 18) /* device probed */
-#define KB_INITIALIZED (1 << 19) /* device initialized */
-#define KB_REGISTERED (1 << 20) /* device registered to kbdio */
-#define KB_BUSY (1 << 21) /* device used by a client */
- int kb_active; /* 0: inactive */
- void *kb_token; /* id of the current client */
- keyboard_callback_t kb_callback;/* callback function */
-
- /*
- * Device configuration flags:
- * The upper 16 bits are common between various keyboard devices.
- * The lower 16 bits are device-specific.
- */
- int kb_config;
-#define KB_CONF_PROBE_ONLY (1 << 16) /* probe only, don't initialize */
-
- /* the following fields are set up by the driver */
- char *kb_name; /* driver name */
- int kb_unit; /* unit # */
- int kb_type; /* KB_84, KB_101, KB_OTHER,... */
- int kb_io_base; /* port# if any */
- int kb_io_size; /* # of occupied port */
- int kb_led; /* LED status */
- struct keymap *kb_keymap; /* key map */
- struct accentmap *kb_accentmap; /* accent map */
- struct fkeytab *kb_fkeytab; /* function key strings */
- int kb_fkeytab_size;/* # of function key strings */
- void *kb_data; /* the driver's private data */
-};
-
-#define KBD_IS_VALID(k) ((k)->kb_flags & KB_VALID)
-#define KBD_VALID(k) ((k)->kb_flags |= KB_VALID)
-#define KBD_INVALID(k) ((k)->kb_flags &= ~KB_VALID)
-#define KBD_HAS_DEVICE(k) (!((k)->kb_flags & KB_NO_DEVICE))
-#define KBD_FOUND_DEVICE(k) ((k)->kb_flags &= ~KB_NO_DEVICE)
-#define KBD_IS_PROBED(k) ((k)->kb_flags & KB_PROBED)
-#define KBD_PROBE_DONE(k) ((k)->kb_flags |= KB_PROBED)
-#define KBD_IS_INITIALIZED(k) ((k)->kb_flags & KB_INITIALIZED)
-#define KBD_INIT_DONE(k) ((k)->kb_flags |= KB_INITIALIZED)
-#define KBD_IS_CONFIGURED(k) ((k)->kb_flags & KB_REGISTERED)
-#define KBD_CONFIG_DONE(k) ((k)->kb_flags |= KB_REGISTERED)
-#define KBD_IS_BUSY(k) ((k)->kb_flags & KB_BUSY)
-#define KBD_BUSY(k) ((k)->kb_flags |= KB_BUSY)
-#define KBD_UNBUSY(k) ((k)->kb_flags &= ~KB_BUSY)
-#define KBD_IS_ACTIVE(k) ((k)->kb_active)
-#define KBD_ACTIVATE(k) (++(k)->kb_active)
-#define KBD_DEACTIVATE(k) (--(k)->kb_active)
-#define KBD_LED_VAL(k) ((k)->kb_led)
-
-/* keyboard function table */
-typedef int kbd_probe_t(int unit, keyboard_t **kbdp, void *arg,
- int flags);
-typedef int kbd_init_t(keyboard_t *kbd);
-typedef int kbd_term_t(keyboard_t *kbd);
-typedef int kbd_intr_t(keyboard_t *kbd);
-typedef int kbd_test_if_t(keyboard_t *kbd);
-typedef int kbd_enable_t(keyboard_t *kbd);
-typedef int kbd_disable_t(keyboard_t *kbd);
-typedef int kbd_read_t(keyboard_t *kbd, int wait);
-typedef int kbd_check_t(keyboard_t *kbd);
-typedef u_int kbd_read_char_t(keyboard_t *kbd, int wait);
-typedef int kbd_check_char_t(keyboard_t *kbd);
-typedef int kbd_ioctl_t(keyboard_t *kbd, u_long cmd, caddr_t data);
-typedef int kbd_lock_t(keyboard_t *kbd, int lock);
-typedef void kbd_clear_state_t(keyboard_t *kbd);
-typedef int kbd_get_state_t(keyboard_t *kbd, void *buf, size_t len);
-typedef int kbd_set_state_t(keyboard_t *kbd, void *buf, size_t len);
-typedef u_char *kbd_get_fkeystr_t(keyboard_t *kbd, int fkey,
- size_t *len);
-typedef void kbd_diag_t(keyboard_t *kbd, int level);
-
-typedef struct keyboard_switch {
- kbd_probe_t *probe;
- kbd_init_t *init;
- kbd_term_t *term;
- kbd_intr_t *intr;
- kbd_test_if_t *test_if;
- kbd_enable_t *enable;
- kbd_disable_t *disable;
- kbd_read_t *read;
- kbd_check_t *check;
- kbd_read_char_t *read_char;
- kbd_check_char_t *check_char;
- kbd_ioctl_t *ioctl;
- kbd_lock_t *lock;
- kbd_clear_state_t *clear_state;
- kbd_get_state_t *get_state;
- kbd_set_state_t *set_state;
- kbd_get_fkeystr_t *get_fkeystr;
- kbd_diag_t *diag;
-} keyboard_switch_t;
-
-/* keyboard driver */
-typedef struct keyboard_driver {
- char *name;
- keyboard_switch_t *kbdsw;
- int (*configure)(int); /* backdoor for the console driver */
-} keyboard_driver_t;
-
-#ifdef KERNEL
-
-#define KEYBOARD_DRIVER(name, sw, config) \
- static struct keyboard_driver name##_driver = { \
- #name, &sw, config \
- }; \
- DATA_SET(kbddriver_set, name##_driver);
-
-/* global variables */
-extern keyboard_switch_t **kbdsw;
-extern struct linker_set kbddriver_set;
-
-/* functions for the keyboard driver */
-int kbd_register(keyboard_t *kbd);
-int kbd_unregister(keyboard_t *kbd);
-keyboard_switch_t *kbd_get_switch(char *driver);
-void kbd_init_struct(keyboard_t *kbd, char *name, int type,
- int unit, int config, int port,
- int port_size);
-void kbd_set_maps(keyboard_t *kbd, struct keymap *keymap,
- struct accentmap *accmap,
- struct fkeytab *fkeymap, int fkeymap_size);
-
-/* functions for the keyboard client */
-int kbd_allocate(char *driver, int unit, void *id,
- kbd_callback_func_t *func, void *arg);
-int kbd_release(keyboard_t *kbd, void *id);
-int kbd_change_callback(keyboard_t *kbd, void *id,
- kbd_callback_func_t *func, void *arg);
-int kbd_find_keyboard(char *driver, int unit);
-keyboard_t *kbd_get_keyboard(int index);
-
-/* a back door for the console driver to tickle the keyboard driver XXX */
-int kbd_configure(int flags);
- /* see `kb_config' above for flag bit definitions */
-
-#ifdef KBD_INSTALL_CDEV
-
-/* virtual keyboard cdev driver functions */
-
-int kbd_attach(dev_t dev, keyboard_t *kbd,
- struct cdevsw *sw);
-int kbd_detach(dev_t dev, keyboard_t *kbd,
- struct cdevsw *sw);
-
-/* generic keyboard cdev driver functions */
-
-typedef struct genkbd_softc {
- int gkb_flags; /* flag/status bits */
-#define KB_ASLEEP (1 << 0)
- struct clist gkb_q; /* input queue */
- struct selinfo gkb_rsel;
-} genkbd_softc_t;
-
-int genkbdopen(genkbd_softc_t *sc, keyboard_t *kbd, int flag, int mode,
- struct proc *p);
-int genkbdclose(genkbd_softc_t *sc, keyboard_t *kbd, int flag, int mode,
- struct proc *p);
-int genkbdread(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio,
- int flag);
-int genkbdwrite(genkbd_softc_t *sc, keyboard_t *kbd, struct uio *uio,
- int flag);
-int genkbdioctl(genkbd_softc_t *sc, keyboard_t *kbd, u_long cmd,
- caddr_t arg, int flag, struct proc *p);
-int genkbdpoll(genkbd_softc_t *sc, keyboard_t *kbd, int event,
- struct proc *p);
-
-#endif /* KBD_INSTALL_CDEV */
-
-/* generic low-level keyboard functions */
-
-/* shift key state */
-#define SHIFTS1 (1 << 16)
-#define SHIFTS2 (1 << 17)
-#define SHIFTS (SHIFTS1 | SHIFTS2)
-#define CTLS1 (1 << 18)
-#define CTLS2 (1 << 19)
-#define CTLS (CTLS1 | CTLS2)
-#define ALTS1 (1 << 20)
-#define ALTS2 (1 << 21)
-#define ALTS (ALTS1 | ALTS2)
-#define AGRS1 (1 << 22)
-#define AGRS2 (1 << 23)
-#define AGRS (AGRS1 | AGRS2)
-#define METAS1 (1 << 24)
-#define METAS2 (1 << 25)
-#define METAS (METAS1 | METAS2)
-#define NLKDOWN (1 << 26)
-#define SLKDOWN (1 << 27)
-#define CLKDOWN (1 << 28)
-#define ALKDOWN (1 << 29)
-/* lock key state (defined in machine/console.h) */
-/*
-#define CLKED LED_CAP
-#define NLKED LED_NUM
-#define SLKED LED_SCR
-#define ALKED (1 << 3)
-#define LOCK_MASK (CLKED | NLKED | SLKED | ALKED)
-#define LED_CAP (1 << 0)
-#define LED_NUM (1 << 1)
-#define LED_SCR (1 << 2)
-#define LED_MASK (LED_CAP | LED_NUM | LED_SCR)
-*/
-
-kbd_get_fkeystr_t genkbd_get_fkeystr;
-kbd_diag_t genkbd_diag;
-
-int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg);
-int genkbd_keyaction(keyboard_t *kbd, int keycode, int down,
- int *shiftstate, int *accents);
-
-#endif /* KERNEL */
-
-#endif /* !_DEV_KBD_KBDREG_H_ */
diff --git a/sys/dev/kbd/kbdtables.h b/sys/dev/kbd/kbdtables.h
deleted file mode 100644
index c0d4663a6eacd..0000000000000
--- a/sys/dev/kbd/kbdtables.h
+++ /dev/null
@@ -1,1332 +0,0 @@
-/*-
- * Copyright (c) 1992-1998 Søren Schmidt
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer,
- * without modification, immediately at the beginning of the file.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: kbdtables.h,v 1.41 1998/09/15 18:16:37 sos Exp $
- */
-
-#define SET8 0x80 /* set eight bit on */
-
-#ifdef PC98
-#define NO_ACCENTCHARS
-/* PC-9801 keymap by kuribo@isl.melco.co.jp */
-static keymap_t key_map = { 0x80, /* PC98 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=01 */ '1', '!', '!', '!', '1', '!', '!', '!', 0x00, 0x00,
-/* sc=02 */ '2', '\"', 0x1A, 0x1A, '2', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=03 */ '3', '#', 0x1B, 0x1B, '3', '#', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=04 */ '4', '$', 0x1C, 0x1C, '4', '$', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=05 */ '5', '%', 0x1D, 0x1D, '5', '%', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=06 */ '6', '&', 0x1E, 0x1E, '6', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=07 */ '7', '\'', 0x1F, 0x1F, '7', '&', '&', '&', 0x00, 0x00,
-/* sc=08 */ '8', '(', 0x7F, 0x7F, '8', '*', 0x08, 0x08, 0x00, 0x00,
-/* sc=09 */ '9', ')', '9', '9', '9', '(', '(', '(', 0x00, 0x00,
-/* sc=0a */ '0', NOP, '0', '0', '0', ')', ')', ')', 0x40, 0x00,
-/* sc=0b */ '-', '=', '-', '-', '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=0c */ '^', '`', 0x1E, 0x1E, '=', '+', '+', '+', 0x00, 0x00,
-/* sc=0d */ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
-/* sc=0f */ '\t', '\t', '\t', '\t', '\t', '\t', '\t', '\t', 0x00, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ '@', '~', 0x00, 0x00, '[', '{', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=1b */ '[', '{', 0x1B, 0x1B, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ '\r', '\r', '\n', '\n', '\r', '\r', '\n', '\n', 0x00, 0x00,
-/* sc=1d */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1e */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=1f */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=20 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=21 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=22 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=23 */ 'j', 'J', '\n', '\n', 'j', 'J', '\n', '\n', 0x00, 0x01,
-/* sc=24 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=25 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=26 */ ';', '+', ';', ';', ';', ':', ';', ';', 0x00, 0x00,
-/* sc=27 */ ':', '*', ':', ':', '\'', '\"', '\'', '\'', 0x00, 0x00,
-/* sc=28 */ ']', '}', 0x1D, 0x1D, '`', '~', '~', '~', 0x00, 0x00,
-/* sc=29 */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2a */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2b */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2c */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=2d */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=2e */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=2f */ 'm', 'M', '\r', '\r', 'm', 'M', '\r', '\r', 0x00, 0x01,
-/* sc=30 */ ',', '<', '<', '<', ',', '<', '<', '<', 0x00, 0x00,
-/* sc=31 */ '.', '>', '>', '>', '.', '>', '>', '>', 0x00, 0x00,
-/* sc=32 */ '/', '?', 0x7F, 0x7F, '/', '?', 0x7F, 0x7F, 0x00, 0x00,
-/* sc=33 */ NOP, '_', 0x1F, 0x1F, '\\', '|', 0x1C, 0x1C, 0x80, 0x00,
-/* sc=34 */ ' ', ' ', 0x00, 0x00, ' ', ' ', 0x00, 0x00, 0x00, 0x00,
-/* sc=35 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
-/* sc=36 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=37 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=38 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=39 */ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, RBT, RBT, 0x03, 0x02,
-/* sc=3a */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=3b */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=3c */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=3d */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=3e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=3f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=40 */ '-', '-', '-', '-', '-', '-', '-', '-', 0x00, 0x00,
-/* sc=41 */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x00,
-/* sc=42 */ '7', '7', '7', '7', '7', '7', '7', '7', 0x00, 0x00,
-/* sc=43 */ '8', '8', '8', '8', '8', '8', '8', '8', 0x00, 0x00,
-/* sc=44 */ '9', '9', '9', '9', '9', '9', '9', '9', 0x00, 0x00,
-/* sc=45 */ '*', '*', '*', '*', '*', '*', '*', '*', 0x00, 0x00,
-/* sc=46 */ '4', '4', '4', '4', '4', '4', '4', '4', 0x00, 0x00,
-/* sc=47 */ '5', '5', '5', '5', '5', '5', '5', '5', 0x00, 0x00,
-/* sc=48 */ '6', '6', '6', '6', '6', '6', '6', '6', 0x00, 0x00,
-/* sc=49 */ '+', '+', '+', '+', '+', '+', '+', '+', 0x00, 0x00,
-/* sc=4a */ '1', '1', '1', '1', '1', '1', '1', '1', 0x00, 0x00,
-/* sc=4b */ '2', '2', '2', '2', '2', '2', '2', '2', 0x00, 0x00,
-/* sc=4c */ '3', '3', '3', '3', '3', '3', '3', '3', 0x00, 0x00,
-/* sc=4d */ '=', '=', '=', '=', '=', '=', '=', '=', 0x00, 0x00,
-/* sc=4e */ '0', '0', '0', '0', '0', '0', '0', '0', 0x00, 0x00,
-/* sc=4f */ ',', ',', ',', ',', ',', ',', ',', ',', 0x00, 0x00,
-/* sc=50 */ '.', '.', '.', '.', '.', '.', '.', '.', 0x00, 0x00,
-/* sc=51 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
-/* sc=52 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=53 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=54 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=58 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=59 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=60 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=61 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=62 */ F( 1), F(13), F(25), F(37), S( 1), S( 1), S( 1), S( 1), 0xFF, 0x00,
-/* sc=63 */ F( 2), F(14), F(26), F(38), S( 2), S( 2), S( 2), S( 2), 0xFF, 0x00,
-/* sc=64 */ F( 3), F(15), F(27), F(39), S( 3), S( 3), S( 3), S( 3), 0xFF, 0x00,
-/* sc=65 */ F( 4), F(16), F(28), F(40), S( 4), S( 4), S( 4), S( 4), 0xFF, 0x00,
-/* sc=66 */ F( 5), F(17), F(29), F(41), S( 5), S( 5), S( 5), S( 5), 0xFF, 0x00,
-/* sc=67 */ F( 6), F(18), F(30), F(42), S( 6), S( 6), S( 6), S( 6), 0xFF, 0x00,
-/* sc=68 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=69 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=6a */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=6b */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=6c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=70 */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=71 */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=72 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=73 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=74 */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=75 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=76 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=77 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=78 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=79 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-};
-#endif
-
-#ifdef DKKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* DK iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '1', '!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, 0x9E, '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', 0xA4, NOP, NOP, '$', 0xA4, NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '&', NOP, NOP, '6', '&', NOP, NOP, 0x33, 0x00,
-/* sc=08 */ '7', '/', NOP, NOP, '{', '/', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ '8', '(', 0x1B, 0x1B, '[', '(', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=0a */ '9', ')', 0x1D, 0x1D, ']', ')', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '}', '=', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '+', '?', NOP, NOP, '+', '?', NOP, NOP, 0x33, 0x00,
-/* sc=0d */ '\'', '`', NOP, NOP, '|', '`', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xE5, 0xC5, NOP, NOP, 0x86, 0x8F, NOP, NOP, 0x33, 0x01,
-/* sc=1b */ '"', '^', 0x1E, 0x1E, '~', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xE6, 0xC6, NOP, NOP, 0x91, 0x92, NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xF8, 0xD8, NOP, NOP, 0x9B, 0x9D, NOP, NOP, 0x33, 0x01,
-/* sc=29 */ 0xBD, 0xA7, NOP, NOP, 0xBD, 0xA7, NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\'', '*', NOP, NOP, '\'', '*', NOP, NOP, 0x33, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, ',', ';', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, '.', ':', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', '*', '*', '*', '*', '*', '*', 0x00, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', 0x1C, 0x1C, '\\', '>', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x00, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef UKKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* uk iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '`', '`', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', 0xA3, NOP, NOP, '#', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '^', 0x1E, 0x1E, '^', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '&', NOP, NOP, '[', '[', 0x1B, 0x1B, 0x30, 0x00,
-/* sc=09 */ '8', '*', NOP, NOP, '8', '*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', '(', NOP, NOP, ']', ']', 0x1D, 0x1D, 0x30, 0x00,
-/* sc=0b */ '0', ')', NOP, NOP, '{', '{', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, '|', '|', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, '}', '}', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ '[', '{', 0x1B, 0x1B, '[', '{', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=1b */ ']', '}', 0x1D, 0x1D, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ ';', ':', NOP, NOP, ';', ':', NOP, NOP, 0x33, 0x00,
-/* sc=28 */ '\'', '@', 0x00, 0x00, '\'', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=29 */ '\\', '|', 0x1C, 0x1C, '\\', '\\', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '#', '~', NOP, NOP, '~', '~', NOP, NOP, 0x33, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', '<', NOP, NOP, ',', '<', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', '>', NOP, NOP, '.', '>', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '/', '?', NOP, NOP, '/', '?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef GRKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* german iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '`', '`', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', 0xA7, NOP, NOP, '#', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '&', 0x1E, 0x1E, '^', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '/', 0x1B, 0x1B, '[', '[', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '8', '(', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', ')', 0x1D, 0x1D, ']', ']', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '{', '{', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ 0xDF, '?', NOP, NOP, '|', '|', NOP, NOP, 0x33, 0x00,
-/* sc=0d */ 0x92, 0x93, NOP, NOP, '\'', '`', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xFC, 0xDC, 0x1B, 0x1B, '[', '{', 0x1B, 0x1B, 0x00, 0x01,
-/* sc=1b */ '+', '*', 0x1D, 0x1D, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xF6, 0xD6, NOP, NOP, 0xF6, 0xD6, NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xE4, 0xC4, NOP, NOP, 0xE4, 0xC4, NOP, NOP, 0x33, 0x01,
-/* sc=29 */ '<', '>', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '#', '^', 0x1E, 0x1E, '`', '~', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=2c */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, ',', ';', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, '.', ':', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef SWKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* swedish iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, 0xA3, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, 0xA4, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=07 */ '6', '&', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=08 */ '7', '/', NOP, NOP, '{', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '[', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0a */ '9', ')', NOP, NOP, ']', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '}', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0c */ '+', '?', NOP, NOP, '\\', NOP, 0x1C, NOP, 0x35, 0x00,
-/* sc=0d */ 0x180, '`', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xE5, 0xC5, NOP, NOP, '}', ']', NOP, NOP, 0x33, 0x01,
-/* sc=1b */ 0xA8, '^', NOP, NOP, '~', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xF6, 0xD6, NOP, NOP, '|', '\\', NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xE4, 0xC4, NOP, NOP, '{', '[', NOP, NOP, 0x33, 0x01,
-/* sc=29 */ 0xA7, 0xBD, NOP, NOP, '\\', '|', NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\'', '*', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, NOP, '<', NOP, NOP, 0x3B, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, NOP, '>', NOP, NOP, 0x3B, 0x00,
-/* sc=35 */ '-', '_', 0x1F, NOP, '/', '?', NOP, NOP, 0x13, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', NOP, NOP, '|', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#ifdef RUKEYMAP
-#define NO_ACCENTCHARS
-static keymap_t key_map = { 0xEC, /* keys number */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * -------------------------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, NOP, NOP, SET8|0x1B, SET8|0x1B, DBG, NOP, 0x33, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, SET8|'1', SET8|'!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '@', 0x00, 0x00, SET8|'2', SET8|'@', SET8|0x00, SET8|0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, SET8|'3', SET8|'#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, SET8|'4', SET8|'$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, SET8|'5', SET8|'%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '^', 0x1E, 0x1E, SET8|'6', SET8|'^', SET8|0x1E, SET8|0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '&', NOP, NOP, SET8|'7', SET8|'&', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ '8', '*', NOP, NOP, SET8|'8', SET8|'*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', '(', NOP, NOP, SET8|'9', SET8|'(', NOP, NOP, 0x33, 0x00,
-/* sc=0b */ '0', ')', NOP, NOP, SET8|'0', SET8|')', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, SET8|'-', SET8|'_', SET8|0x1F, SET8|0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, SET8|'=', SET8|'+', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, SET8|0x08, SET8|0x08, SET8|0x7F, SET8|0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, SET8|0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, SET8|'q', SET8|'Q', SET8|0x11, SET8|0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, SET8|'w', SET8|'W', SET8|0x17, SET8|0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, SET8|'e', SET8|'E', SET8|0x05, SET8|0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, SET8|'r', SET8|'R', SET8|0x12, SET8|0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, SET8|'t', SET8|'T', SET8|0x14, SET8|0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, SET8|'y', SET8|'Y', SET8|0x19, SET8|0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, SET8|'u', SET8|'U', SET8|0x15, SET8|0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, SET8|'i', SET8|'I', SET8|0x09, SET8|0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, SET8|'o', SET8|'O', SET8|0x0F, SET8|0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, SET8|'p', SET8|'P', SET8|0x10, SET8|0x10, 0x00, 0x01,
-/* sc=1a */ '[', '{', 0x1B, 0x1B, SET8|'[', SET8|'{', SET8|0x1B, SET8|0x1B, 0x00, 0x00,
-/* sc=1b */ ']', '}', 0x1D, 0x1D, SET8|']', SET8|'}', SET8|0x1D, SET8|0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, SET8|'a', SET8|'A', SET8|0x01, SET8|0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, SET8|'s', SET8|'S', SET8|0x13, SET8|0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, SET8|'d', SET8|'D', SET8|0x04, SET8|0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, SET8|'f', SET8|'F', SET8|0x06, SET8|0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, SET8|'g', SET8|'G', SET8|0x07, SET8|0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, SET8|'h', SET8|'H', SET8|0x08, SET8|0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, SET8|'j', SET8|'J', SET8|0x0A, SET8|0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, SET8|'k', SET8|'K', SET8|0x0B, SET8|0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, SET8|'l', SET8|'L', SET8|0x0C, SET8|0x0C, 0x00, 0x01,
-/* sc=27 */ ';', ':', NOP, NOP, SET8|';', SET8|':', NOP, NOP, 0x33, 0x00,
-/* sc=28 */ '\'', '"', NOP, NOP, SET8|'\'', SET8|'"', NOP, NOP, 0x33, 0x00,
-/* sc=29 */ '`', '~', NOP, NOP, SET8|'`', SET8|'~', NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\\', '|', 0x1C, 0x1C, SET8|'\\', SET8|'|', SET8|0x1C, SET8|0x1C, 0x00, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, SET8|'z', SET8|'Z', SET8|0x1A, SET8|0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, SET8|'x', SET8|'X', SET8|0x18, SET8|0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, SET8|'c', SET8|'C', SET8|0x03, SET8|0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, SET8|'v', SET8|'V', SET8|0x16, SET8|0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, SET8|'b', SET8|'B', SET8|0x02, SET8|0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, SET8|'n', SET8|'N', SET8|0x0E, SET8|0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, SET8|'m', SET8|'M', SET8|0x0D, SET8|0x0D, 0x00, 0x01,
-/* sc=33 */ ',', '<', NOP, NOP, SET8|',', SET8|'<', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', '>', NOP, NOP, SET8|'.', SET8|'>', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '/', '?', NOP, NOP, SET8|'/', SET8|'?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, SET8|'*', SET8|'*', SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', SET8|' ', SET8|' ', SUSP, SET8|' ', 0x00, 0x00,
-/* sc=3a */ ALK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', SET8|'7', SET8|'7', SET8|'7', SET8|'7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', SET8|'8', SET8|'8', SET8|'8', SET8|'8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', SET8|'9', SET8|'9', SET8|'9', SET8|'9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', SET8|'-', SET8|'-', SET8|'-', SET8|'-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', SET8|'4', SET8|'4', SET8|'4', SET8|'4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', SET8|'5', SET8|'5', SET8|'5', SET8|'5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', SET8|'6', SET8|'6', SET8|'6', SET8|'6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', SET8|'+', SET8|'+', SET8|'+', SET8|'+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', SET8|'1', SET8|'1', SET8|'1', SET8|'1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', SET8|'2', SET8|'2', SET8|'2', SET8|'2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', SET8|'3', SET8|'3', SET8|'3', SET8|'3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', SET8|'0', SET8|'0', SET8|'0', SET8|'0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', SET8|'.', SET8|'.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ ALK, ALK, ALK, ALK, ALK, ALK, ALK, ALK, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', NOP, NOP, SET8|'/', SET8|'/', NOP, NOP, 0x33, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-/* sc=6c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=6f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=70 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=71 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=72 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=73 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=74 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=75 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=76 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=77 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=78 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=79 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=7f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* extended (ALTGR LOCK keys) */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, NOP, NOP, SET8|0x1B, SET8|0x1B, DBG, NOP, 0x33, 0x00,
-/* sc=02 */ '!', '1', NOP, NOP, SET8|'1', SET8|'!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '"', '2', 0x00, 0x00, SET8|'2', SET8|'@', SET8|0x00, SET8|0x00, 0x00, 0x00,
-/* sc=04 */ '\'', '3', NOP, NOP, SET8|'3', SET8|'#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '*', '4', NOP, NOP, SET8|'4', SET8|'$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ ':', '5', NOP, NOP, SET8|'5', SET8|'%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ ',', '6', 0x1E, 0x1E, SET8|'6', SET8|'^', SET8|0x1E, SET8|0x1E, 0x00, 0x00,
-/* sc=08 */ '.', '7', NOP, NOP, SET8|'7', SET8|'&', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ ';', '8', NOP, NOP, SET8|'8', SET8|'*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '(', '9', NOP, NOP, SET8|'9', SET8|'(', NOP, NOP, 0x33, 0x00,
-/* sc=0b */ ')', '0', NOP, NOP, SET8|'0', SET8|')', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, SET8|'-', SET8|'_', SET8|0x1F, SET8|0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, SET8|'=', SET8|'+', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, SET8|0x08, SET8|0x08, SET8|0x7F, SET8|0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, SET8|0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 0xca, 0xea, 0x11, 0x11, SET8|'q', SET8|'Q', SET8|0x11, SET8|0x11, 0x00, 0x01,
-/* sc=11 */ 0xc3, 0xe3, 0x17, 0x17, SET8|'w', SET8|'W', SET8|0x17, SET8|0x17, 0x00, 0x01,
-/* sc=12 */ 0xd5, 0xf5, 0x05, 0x05, SET8|'e', SET8|'E', SET8|0x05, SET8|0x05, 0x00, 0x01,
-/* sc=13 */ 0xcb, 0xeb, 0x12, 0x12, SET8|'r', SET8|'R', SET8|0x12, SET8|0x12, 0x00, 0x01,
-/* sc=14 */ 0xc5, 0xe5, 0x14, 0x14, SET8|'t', SET8|'T', SET8|0x14, SET8|0x14, 0x00, 0x01,
-/* sc=15 */ 0xce, 0xee, 0x19, 0x19, SET8|'y', SET8|'Y', SET8|0x19, SET8|0x19, 0x00, 0x01,
-/* sc=16 */ 0xc7, 0xe7, 0x15, 0x15, SET8|'u', SET8|'U', SET8|0x15, SET8|0x15, 0x00, 0x01,
-/* sc=17 */ 0xdb, 0xfb, 0x09, 0x09, SET8|'i', SET8|'I', SET8|0x09, SET8|0x09, 0x00, 0x01,
-/* sc=18 */ 0xdd, 0xfd, 0x0F, 0x0F, SET8|'o', SET8|'O', SET8|0x0F, SET8|0x0F, 0x00, 0x01,
-/* sc=19 */ 0xda, 0xfa, 0x10, 0x10, SET8|'p', SET8|'P', SET8|0x10, SET8|0x10, 0x00, 0x01,
-/* sc=1a */ 0xc8, 0xe8, 0x1B, 0x1B, SET8|'[', SET8|'{', SET8|0x1B, SET8|0x1B, 0x00, 0x01,
-/* sc=1b */ 0xdf, 0xff, 0x1D, 0x1D, SET8|']', SET8|'}', SET8|0x1D, SET8|0x1D, 0x00, 0x01,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 0xc6, 0xe6, 0x01, 0x01, SET8|'a', SET8|'A', SET8|0x01, SET8|0x01, 0x00, 0x01,
-/* sc=1f */ 0xd9, 0xf9, 0x13, 0x13, SET8|'s', SET8|'S', SET8|0x13, SET8|0x13, 0x00, 0x01,
-/* sc=20 */ 0xd7, 0xf7, 0x04, 0x04, SET8|'d', SET8|'D', SET8|0x04, SET8|0x04, 0x00, 0x01,
-/* sc=21 */ 0xc1, 0xe1, 0x06, 0x06, SET8|'f', SET8|'F', SET8|0x06, SET8|0x06, 0x00, 0x01,
-/* sc=22 */ 0xd0, 0xf0, 0x07, 0x07, SET8|'g', SET8|'G', SET8|0x07, SET8|0x07, 0x00, 0x01,
-/* sc=23 */ 0xd2, 0xf2, 0x08, 0x08, SET8|'h', SET8|'H', SET8|0x08, SET8|0x08, 0x00, 0x01,
-/* sc=24 */ 0xcf, 0xef, 0x0A, 0x0A, SET8|'j', SET8|'J', SET8|0x0A, SET8|0x0A, 0x00, 0x01,
-/* sc=25 */ 0xcc, 0xec, 0x0B, 0x0B, SET8|'k', SET8|'K', SET8|0x0B, SET8|0x0B, 0x00, 0x01,
-/* sc=26 */ 0xc4, 0xe4, 0x0C, 0x0C, SET8|'l', SET8|'L', SET8|0x0C, SET8|0x0C, 0x00, 0x01,
-/* sc=27 */ 0xd6, 0xf6, NOP, NOP, SET8|';', SET8|':', NOP, NOP, 0x33, 0x01,
-/* sc=28 */ 0xdc, 0xfc, NOP, NOP, SET8|'\'', SET8|'"', NOP, NOP, 0x33, 0x01,
-/* sc=29 */ 0xa3, 0xb3, NOP, NOP, SET8|'`', SET8|'~', NOP, NOP, 0x33, 0x01,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\\', '|', 0x1C, 0x1C, SET8|'\\', SET8|'|', SET8|0x1C, SET8|0x1C, 0x00, 0x00,
-/* sc=2c */ 0xd1, 0xf1, 0x1A, 0x1A, SET8|'z', SET8|'Z', SET8|0x1A, SET8|0x1A, 0x00, 0x01,
-/* sc=2d */ 0xde, 0xfe, 0x18, 0x18, SET8|'x', SET8|'X', SET8|0x18, SET8|0x18, 0x00, 0x01,
-/* sc=2e */ 0xd3, 0xf3, 0x03, 0x03, SET8|'c', SET8|'C', SET8|0x03, SET8|0x03, 0x00, 0x01,
-/* sc=2f */ 0xcd, 0xed, 0x16, 0x16, SET8|'v', SET8|'V', SET8|0x16, SET8|0x16, 0x00, 0x01,
-/* sc=30 */ 0xc9, 0xe9, 0x02, 0x02, SET8|'b', SET8|'B', SET8|0x02, SET8|0x02, 0x00, 0x01,
-/* sc=31 */ 0xd4, 0xf4, 0x0E, 0x0E, SET8|'n', SET8|'N', SET8|0x0E, SET8|0x0E, 0x00, 0x01,
-/* sc=32 */ 0xd8, 0xf8, 0x0D, 0x0D, SET8|'m', SET8|'M', SET8|0x0D, SET8|0x0D, 0x00, 0x01,
-/* sc=33 */ 0xc2, 0xe2, NOP, NOP, SET8|',', SET8|'<', NOP, NOP, 0x33, 0x01,
-/* sc=34 */ 0xc0, 0xe0, NOP, NOP, SET8|'.', SET8|'>', NOP, NOP, 0x33, 0x01,
-/* sc=35 */ '/', '?', NOP, NOP, SET8|'/', SET8|'?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, SET8|'*', SET8|'*', SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', SET8|' ', SET8|' ', SUSP, SET8|' ', 0x00, 0x00,
-/* sc=3a */ ALK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', SET8|'7', SET8|'7', SET8|'7', SET8|'7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', SET8|'8', SET8|'8', SET8|'8', SET8|'8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', SET8|'9', SET8|'9', SET8|'9', SET8|'9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', SET8|'-', SET8|'-', SET8|'-', SET8|'-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', SET8|'4', SET8|'4', SET8|'4', SET8|'4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', SET8|'5', SET8|'5', SET8|'5', SET8|'5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', SET8|'6', SET8|'6', SET8|'6', SET8|'6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', SET8|'+', SET8|'+', SET8|'+', SET8|'+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', SET8|'1', SET8|'1', SET8|'1', SET8|'1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', SET8|'2', SET8|'2', SET8|'2', SET8|'2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', SET8|'3', SET8|'3', SET8|'3', SET8|'3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', SET8|'0', SET8|'0', SET8|'0', SET8|'0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', SET8|'.', SET8|'.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ ALK, ALK, ALK, ALK, ALK, ALK, ALK, ALK, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0A, 0x0A, SET8|0x0D, SET8|0x0D, SET8|0x0A, SET8|0x0A, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', NOP, NOP, SET8|'/', SET8|'/', NOP, NOP, 0x33, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-
-#endif
-
-#ifdef ESKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x69, /* spanish iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x00, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '|', '|', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, '@', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', 0xB7, NOP, NOP, '#', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '4', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '5', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '&', 0x1E, 0x1E, 0xAC, 0xAC, 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '/', 0x1B, 0x1B, '7', '7', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '8', '8', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', ')', 0x1D, 0x1D, '8', '8', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '9', '9', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '\'', '?', NOP, NOP, '\'', '\'', NOP, NOP, 0x33, 0x00,
-/* sc=0d */ 0xA1, 0xBF, NOP, NOP, '\'', '`', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 0xE9, 0xC9, 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 0xFA, 0xDA, 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 0xED, 0xCD, 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 0xF3, 0xD3, 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ DGRA, DCIR, 0x1B, 0x1B, '[', '[', 0x1B, 0x1B, 0xC0, 0x01,
-/* sc=1b */ '+', '*', 0x1D, 0x1D, ']', '[', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 0xE1, 0xC1, 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xF1, 0xD1, NOP, NOP, '~', NOP, NOP, NOP, 0x37, 0x01,
-/* sc=28 */ DACU, DUML, NOP, NOP, '{', '}', NOP, NOP, 0xF3, 0x01,
-/* sc=29 */ 0xBA, 0xAA, 0x1C, 0x1C, '\\', '\\', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ 0xE7, 0xC7, 0x1E, 0x1E, '}', '}', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x19, 0x19, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, ',', ';', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, '.', ':', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', NEXT, NEXT, '*', '*', NEXT, NEXT, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x00, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', 0x1C, 0x1C, '\\', '>', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ '*', '*', '*', '*', '*', '*', '*', '*', 0x00, 0x02,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(54), F(54), F(54), F(54), F(54), F(54), RBT, F(54), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-};
-#endif
-
-#ifdef ISKEYMAP
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* icelandic iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=03 */ '2', '"', 0x00, 0x00, NOP, NOP, 0x00, 0x00, 0x0C, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, 0xA3, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, 0xA4, NOP, NOP, NOP, 0x37, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=07 */ '6', '&', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=08 */ '7', '/', NOP, NOP, '{', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=09 */ '8', '(', NOP, NOP, '[', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0a */ '9', ')', NOP, NOP, ']', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0b */ '0', '=', NOP, NOP, '}', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=0c */ 0xF6, 0xD6, NOP, NOP, '\\', NOP, 0x1C, NOP, 0x35, 0x00,
-/* sc=0d */ '-', '_', NOP, NOP, NOP, NOP, NOP, NOP, 0x3F, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, '@', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ 0xF0, 0xD0, NOP, NOP, '}', ']', NOP, NOP, 0x33, 0x01,
-/* sc=1b */ '\'', '?', NOP, NOP, '~', NOP, NOP, NOP, 0x00, 0x01,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 0xDF, 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ 0xE6, 0xC6, NOP, NOP, '|', '\\', NOP, NOP, 0x33, 0x01,
-/* sc=28 */ DACU, DACU, NOP, NOP, DTIL, '[', NOP, NOP, 0xFB, 0x01,
-/* sc=29 */ DRIN, DDIA, NOP, NOP, DCIR, '*', NOP, NOP, 0xFB, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '+', '*', NOP, NOP, '`', '*', NOP, NOP, 0x00, 0x01,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', ';', NOP, NOP, NOP, '<', NOP, NOP, 0x3B, 0x00,
-/* sc=34 */ '.', ':', NOP, NOP, NOP, '>', NOP, NOP, 0x3B, 0x00,
-/* sc=35 */ 0xFE, 0xDE, 0x1F, NOP, '/', '?', NOP, NOP, 0x13, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, 0x13, 0x13, NLK, NLK, 0x13, 0x13, 0xCC, 0x00,
-/* sc=46 */ SLK, SLK, 0x7F, 0x7F, SLK, SLK, 0x7F, 0x7F, 0xCC, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', 0x1F, 0x1F, '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', 0x1E, 0x1E, '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ '<', '>', NOP, NOP, '|', NOP, NOP, NOP, 0x37, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0xFF, 0x02,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x02,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#if !defined(DKKEYMAP) && !defined(UKKEYMAP) && !defined(GRKEYMAP) && !defined(SWKEYMAP) && !defined(RUKEYMAP) && !defined(ISKEYMAP) && !defined(ESKEYMAP) && !defined(PC98)
-#define ISO_ACCENTCHARS
-static keymap_t key_map = { 0x6C, /* US iso8859 keymap */
-/* alt
- * scan cntrl alt alt cntrl
- * code base shift cntrl shift alt shift cntrl shift spcl flgs
- * ---------------------------------------------------------------------------
- */
-/* sc=00 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=01 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
-/* sc=02 */ '1', '!', NOP, NOP, '1', '!', NOP, NOP, 0x33, 0x00,
-/* sc=03 */ '2', '@', 0x00, 0x00, '2', '@', 0x00, 0x00, 0x00, 0x00,
-/* sc=04 */ '3', '#', NOP, NOP, '3', '#', NOP, NOP, 0x33, 0x00,
-/* sc=05 */ '4', '$', NOP, NOP, '4', '$', NOP, NOP, 0x33, 0x00,
-/* sc=06 */ '5', '%', NOP, NOP, '5', '%', NOP, NOP, 0x33, 0x00,
-/* sc=07 */ '6', '^', 0x1E, 0x1E, '6', '^', 0x1E, 0x1E, 0x00, 0x00,
-/* sc=08 */ '7', '&', NOP, NOP, '7', '&', NOP, NOP, 0x33, 0x00,
-/* sc=09 */ '8', '*', NOP, NOP, '8', '*', NOP, NOP, 0x33, 0x00,
-/* sc=0a */ '9', '(', NOP, NOP, '9', '(', NOP, NOP, 0x33, 0x00,
-/* sc=0b */ '0', ')', NOP, NOP, '0', ')', NOP, NOP, 0x33, 0x00,
-/* sc=0c */ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, 0x00, 0x00,
-/* sc=0d */ '=', '+', NOP, NOP, '=', '+', NOP, NOP, 0x33, 0x00,
-/* sc=0e */ 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, 0x00,
-/* sc=0f */ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, 0x77, 0x00,
-/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
-/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
-/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
-/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
-/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
-/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
-/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
-/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
-/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
-/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
-/* sc=1a */ '[', '{', 0x1B, 0x1B, '[', '{', 0x1B, 0x1B, 0x00, 0x00,
-/* sc=1b */ ']', '}', 0x1D, 0x1D, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
-/* sc=1c */ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, 0x00, 0x00,
-/* sc=1d */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
-/* sc=1e */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
-/* sc=1f */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
-/* sc=20 */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
-/* sc=21 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
-/* sc=22 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
-/* sc=23 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
-/* sc=24 */ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, 0x00, 0x01,
-/* sc=25 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
-/* sc=26 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
-/* sc=27 */ ';', ':', NOP, NOP, ';', ':', NOP, NOP, 0x33, 0x00,
-/* sc=28 */ '\'', '"', NOP, NOP, '\'', '"', NOP, NOP, 0x33, 0x00,
-/* sc=29 */ '`', '~', NOP, NOP, '`', '~', NOP, NOP, 0x33, 0x00,
-/* sc=2a */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
-/* sc=2b */ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
-/* sc=2c */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
-/* sc=2d */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
-/* sc=2e */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
-/* sc=2f */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
-/* sc=30 */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
-/* sc=31 */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
-/* sc=32 */ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, 0x00, 0x01,
-/* sc=33 */ ',', '<', NOP, NOP, ',', '<', NOP, NOP, 0x33, 0x00,
-/* sc=34 */ '.', '>', NOP, NOP, '.', '>', NOP, NOP, 0x33, 0x00,
-/* sc=35 */ '/', '?', NOP, NOP, '/', '?', NOP, NOP, 0x33, 0x00,
-/* sc=36 */ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, 0xFF, 0x00,
-/* sc=37 */ '*', '*', 0x0A, 0x0A, '*', '*', 0x0A, 0x0A, 0x33, 0x00,
-/* sc=38 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
-/* sc=39 */ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', 0x02, 0x00,
-/* sc=3a */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
-/* sc=3b */ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11), 0xFF, 0x00,
-/* sc=3c */ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12), 0xFF, 0x00,
-/* sc=3d */ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13), 0xFF, 0x00,
-/* sc=3e */ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14), 0xFF, 0x00,
-/* sc=3f */ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15), 0xFF, 0x00,
-/* sc=40 */ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16), 0xFF, 0x00,
-/* sc=41 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
-/* sc=42 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
-/* sc=43 */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
-/* sc=44 */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
-/* sc=45 */ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, 0xFF, 0x00,
-/* sc=46 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=47 */ F(49), '7', '7', '7', '7', '7', '7', '7', 0x80, 0x02,
-/* sc=48 */ F(50), '8', '8', '8', '8', '8', '8', '8', 0x80, 0x02,
-/* sc=49 */ F(51), '9', '9', '9', '9', '9', '9', '9', 0x80, 0x02,
-/* sc=4a */ F(52), '-', '-', '-', '-', '-', '-', '-', 0x80, 0x02,
-/* sc=4b */ F(53), '4', '4', '4', '4', '4', '4', '4', 0x80, 0x02,
-/* sc=4c */ F(54), '5', '5', '5', '5', '5', '5', '5', 0x80, 0x02,
-/* sc=4d */ F(55), '6', '6', '6', '6', '6', '6', '6', 0x80, 0x02,
-/* sc=4e */ F(56), '+', '+', '+', '+', '+', '+', '+', 0x80, 0x02,
-/* sc=4f */ F(57), '1', '1', '1', '1', '1', '1', '1', 0x80, 0x02,
-/* sc=50 */ F(58), '2', '2', '2', '2', '2', '2', '2', 0x80, 0x02,
-/* sc=51 */ F(59), '3', '3', '3', '3', '3', '3', '3', 0x80, 0x02,
-/* sc=52 */ F(60), '0', '0', '0', '0', '0', '0', '0', 0x80, 0x02,
-/* sc=53 */ 0x7F, '.', '.', '.', '.', '.', RBT, RBT, 0x03, 0x02,
-/* sc=54 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=57 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
-/* sc=58 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
-/* sc=59 */ 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x00, 0x00,
-/* sc=5a */ RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, RCTR, 0xFF, 0x00,
-/* sc=5b */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x00,
-/* sc=5c */ NEXT, NOP, DBG, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
-/* sc=5d */ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, 0xFF, 0x00,
-/* sc=5e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
-/* sc=5f */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
-/* sc=60 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
-/* sc=61 */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
-/* sc=62 */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
-/* sc=63 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
-/* sc=64 */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
-/* sc=65 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=66 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
-/* sc=67 */ F(61), F(61), F(61), F(61), F(61), F(61), RBT, F(61), 0xFF, 0x00,
-/* sc=68 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
-/* sc=69 */ F(62), F(62), F(62), F(62), F(62), F(62), F(62), F(62), 0xFF, 0x00,
-/* sc=6a */ F(63), F(63), F(63), F(63), F(63), F(63), F(63), F(63), 0xFF, 0x00,
-/* sc=6b */ F(64), F(64), F(64), F(64), F(64), F(64), F(64), F(64), 0xFF, 0x00,
-};
-#endif
-
-#if defined(NO_ACCENTCHARS)
-static accentmap_t accent_map = { 0, /* empty accent map */
- {
- { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 },
- { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 },
- }
-};
-#endif
-
-#if defined(ISO_ACCENTCHARS)
-static accentmap_t accent_map = { 15, /* iso8859 accent map */
- {
- /* dgra=0 */
- { '`', { { 'a',0xe0 }, { 'A',0xc0 }, { 'e',0xe8 }, { 'E',0xc8 },
- { 'i',0xec }, { 'I',0xcc }, { 'o',0xf2 }, { 'O',0xd2 },
- { 'u',0xf9 }, { 'U',0xd9 }, }, },
- /* dacu=1 */
- { 0xb4, { { 'a',0xe1 }, { 'A',0xc1 }, { 'e',0xe9 }, { 'E',0xc9 },
- { 'i',0xed }, { 'I',0xcd }, { 'o',0xf3 }, { 'O',0xd3 },
- { 'u',0xfa }, { 'U',0xda }, { 'y',0xfd }, { 'Y',0xdd }, }, },
- /* dcir=2 */
- { '^', { { 'a',0xe2 }, { 'A',0xc2 }, { 'e',0xea }, { 'E',0xca },
- { 'i',0xee }, { 'I',0xce }, { 'o',0xf4 }, { 'O',0xd4 },
- { 'u',0xfb }, { 'U',0xdb }, }, },
- /* dtil=3 */
- { '~', { { 'a',0xe3 }, { 'A',0xc3 }, { 'n',0xf1 }, { 'N',0xd1 },
- { 'o',0xf5 }, { 'O',0xd5 }, }, },
- /* dmac=4 */
- { 0 },
- /* dbre=5 */
- { 0 },
- /* ddot=6 */
- { 0 },
- /* duml=7 */
- { 0xa8, { { 'a',0xe4 }, { 'A',0xc4 }, { 'e',0xeb }, { 'E',0xcb },
- { 'i',0xef }, { 'I',0xcf }, { 'o',0xf6 }, { 'O',0xd6 },
- { 'u',0xfc }, { 'U',0xdc }, { 'y',0xff }, }, },
- /* dsla=8 */
- { 0 },
- /* drin=9 */
- { 0xb0, { { 'a',0xe5 }, { 'A',0xc5 }, }, },
- /* dced=10 */
- { 0xb8, { { 'c',0xe7 }, { 'C',0xc7 }, }, },
- /* dapo=11 */
- { 0 },
- /* ddac=12 */
- { 0 },
- /* dogo=13 */
- { 0 },
- /* dcar=14 */
- { 0 },
- }
-};
-#endif /* ISO_ACCENTCHARS */
-
-static fkeytab_t fkey_tab[96] = {
-/* 01-04 */ {"\033[M", 3}, {"\033[N", 3}, {"\033[O", 3}, {"\033[P", 3},
-/* 05-08 */ {"\033[Q", 3}, {"\033[R", 3}, {"\033[S", 3}, {"\033[T", 3},
-/* 09-12 */ {"\033[U", 3}, {"\033[V", 3}, {"\033[W", 3}, {"\033[X", 3},
-/* 13-16 */ {"\033[Y", 3}, {"\033[Z", 3}, {"\033[a", 3}, {"\033[b", 3},
-/* 17-20 */ {"\033[c", 3}, {"\033[d", 3}, {"\033[e", 3}, {"\033[f", 3},
-/* 21-24 */ {"\033[g", 3}, {"\033[h", 3}, {"\033[i", 3}, {"\033[j", 3},
-/* 25-28 */ {"\033[k", 3}, {"\033[l", 3}, {"\033[m", 3}, {"\033[n", 3},
-/* 29-32 */ {"\033[o", 3}, {"\033[p", 3}, {"\033[q", 3}, {"\033[r", 3},
-/* 33-36 */ {"\033[s", 3}, {"\033[t", 3}, {"\033[u", 3}, {"\033[v", 3},
-/* 37-40 */ {"\033[w", 3}, {"\033[x", 3}, {"\033[y", 3}, {"\033[z", 3},
-/* 41-44 */ {"\033[@", 3}, {"\033[[", 3}, {"\033[\\",3}, {"\033[]", 3},
-/* 45-48 */ {"\033[^", 3}, {"\033[_", 3}, {"\033[`", 3}, {"\033[{", 3},
-/* 49-52 */ {"\033[H", 3}, {"\033[A", 3}, {"\033[I", 3}, {"-" , 1},
-/* 53-56 */ {"\033[D", 3}, {"\033[E", 3}, {"\033[C", 3}, {"+" , 1},
-/* 57-60 */ {"\033[F", 3}, {"\033[B", 3}, {"\033[G", 3}, {"\033[L", 3},
-/* 61-64 */ {"\177", 1}, {"\033[J", 3}, {"\033[~", 3}, {"\033[}", 3},
-/* 65-68 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 69-72 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 73-76 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 77-80 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 81-84 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 85-88 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 89-92 */ {"", 0} , {"", 0} , {"", 0} , {"", 0} ,
-/* 93-96 */ {"", 0} , {"", 0} , {"", 0} , {"", 0}
-};
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
deleted file mode 100644
index ece467c1a5aab..0000000000000
--- a/sys/dev/pci/ohci_pci.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * USB Open Host Controller driver.
- *
- * OHCI spec: http://www.intel.com/design/usb/ohci11d.pdf
- * USB spec: http://www.teleport.com/cgi-bin/mailmerge.cgi/~usb/cgiform.tpl
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/queue.h>
-
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-
-#define PCI_CLASS_SERIALBUS 0x0c000000
-#define PCI_SUBCLASS_COMMUNICATIONS_SERIAL 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_FIREWIRE 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_ACCESS 0x00010000
-#define PCI_SUBCLASS_SERIALBUS_SSA 0x00020000
-#define PCI_SUBCLASS_SERIALBUS_USB 0x00030000
-#define PCI_SUBCLASS_SERIALBUS_FIBER 0x00040000
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_mem.h>
-
-#include <dev/usb/ohcireg.h>
-#include <dev/usb/ohcivar.h>
-
-#define PCI_INTERFACE(d) (((d) >> 8) & 0xff)
-#define PCI_SUBCLASS(d) ((d) & PCI_SUBCLASS_MASK)
-#define PCI_CLASS(d) ((d) & PCI_CLASS_MASK)
-
-#define PCI_VENDOR(d) ((d) & 0xffff)
-#define PCI_DEVICE(d) (((d) >> 8) & 0xffff)
-
-#define PCI_OHCI_VENDORID_ALI 0x10b9
-#define PCI_OHCI_VENDORID_SIS 0x1039
-
-#define PCI_OHCI_DEVICEID_ALADDIN_V 0x523710b9
-static const char ohci_device_aladdin_v[] = "AcerLabs M5237 (Aladdin-V) USB Host Controller";
-static const char ohci_device_generic[] = "OHCI USB Host Controller (generic)";
-
-#define PCI_OHCI_BASE_REG 0x10
-
-static const char *ohci_pci_probe __P((pcici_t, pcidi_t));
-static void ohci_pci_attach __P((pcici_t, int));
-
-u_long ohci_count = 0; /* global counter for nr. of devices found */
-
-static struct pci_device ohci_pci_device = {
- "ohci",
- ohci_pci_probe,
- ohci_pci_attach,
- &ohci_count,
- NULL
-};
-
-DATA_SET(pcidevice_set, ohci_pci_device);
-
-static const char *
-ohci_pci_probe(pcici_t config_id, pcidi_t device_id)
-{
- u_int32_t class;
-
- if (device_id == PCI_OHCI_DEVICEID_ALADDIN_V) {
- return (ohci_device_aladdin_v);
- } else {
- class = pci_conf_read(config_id, PCI_CLASS_REG);
- if ( (PCI_CLASS(class) == PCI_CLASS_SERIALBUS)
- && (PCI_SUBCLASS(class) == PCI_SUBCLASS_SERIALBUS_USB)
- && (PCI_INTERFACE(class) == PCI_INTERFACE_OHCI)) {
- return(ohci_device_generic);
- }
- }
-
- return NULL; /* dunno */
-}
-
-static void
-ohci_pci_attach(pcici_t config_id, int unit)
-{
- int id;
- usbd_status r;
- ohci_softc_t *sc = NULL;
- vm_offset_t pbase;
-
- sc = malloc(sizeof(ohci_softc_t), M_DEVBUF, M_NOWAIT);
- /* Do not free it below, intr might use the sc */
- if ( sc == NULL ) {
- printf("usb%d: could not allocate memory", unit);
- return;
- }
- memset(sc, 0, sizeof(ohci_softc_t));
-
- if(!pci_map_mem(config_id, PCI_CBMEM,
- (vm_offset_t *)&sc->sc_iobase, &pbase)) {
- printf("usb%d: could not map memory\n", unit);
- return;
- }
- sc->unit = unit;
-
- if ( !pci_map_int(config_id, (pci_inthand_t *)ohci_intr,
- (void *) sc, &bio_imask)) {
- printf("usb%d: could not map irq\n", unit);
- return;
- }
-
- /* Figure out vendor for root hub descriptor. */
- id = pci_conf_read(config_id, PCI_ID_REG);
- if (PCI_VENDOR(id) == PCI_OHCI_VENDORID_ALI)
- sprintf(sc->sc_vendor, "AcerLabs");
- else if (PCI_VENDOR(id) == PCI_OHCI_VENDORID_SIS)
- sprintf(sc->sc_vendor, "SiS");
- else
- sprintf(sc->sc_vendor, "(0x%04x)", PCI_VENDOR(id));
-
- /* We add a child to the root bus. After PCI configuration
- * has completed the root bus will start to probe and
- * attach all the devices attached to it, including our new
- * kid.
- *
- * FIXME Sometime in the future the UHCI controller itself will
- * become a kid of PCI device and this device add will no longer
- * be necessary.
- *
- * See README for an elaborate description of the bus
- * structure in spe.
- */
- sc->sc_bus.bdev = device_add_child(root_bus, "usb", unit, sc);
- if (!sc->sc_bus.bdev) {
- printf("%s%d: could not add USB device to root bus\n",
- device_get_name(sc->sc_bus.bdev),
- device_get_unit(sc->sc_bus.bdev));
- return;
- }
-
- r = ohci_init(sc);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("usb%d: init failed, error=%d\n", unit, r);
- device_delete_child(root_bus, sc->sc_bus.bdev);
- return;
- }
-
- switch(id) {
- case PCI_OHCI_DEVICEID_ALADDIN_V:
- device_set_desc(sc->sc_bus.bdev, ohci_device_aladdin_v);
- break;
- default:
- printf("(New OHCI DeviceId=0x%08x)\n", id);
- device_set_desc(sc->sc_bus.bdev, ohci_device_generic);
- }
-
- return;
-}
diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c
deleted file mode 100644
index 083540f4b7921..0000000000000
--- a/sys/dev/pci/uhci_pci.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/* FreeBSD $Id: uhci_pci.c,v 1.7 1999/01/06 19:55:49 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/queue.h>
-
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-
-#define PCI_CLASS_SERIALBUS 0x0c000000
-#define PCI_SUBCLASS_COMMUNICATIONS_SERIAL 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_FIREWIRE 0x00000000
-#define PCI_SUBCLASS_SERIALBUS_ACCESS 0x00010000
-#define PCI_SUBCLASS_SERIALBUS_SSA 0x00020000
-#define PCI_SUBCLASS_SERIALBUS_USB 0x00030000
-#define PCI_SUBCLASS_SERIALBUS_FIBER 0x00040000
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_mem.h>
-
-#include <dev/usb/uhcireg.h>
-#include <dev/usb/uhcivar.h>
-
-#define PCI_INTERFACE(d) (((d)>>8)&0xff)
-#define PCI_SUBCLASS(d) ((d)&PCI_SUBCLASS_MASK)
-#define PCI_CLASS(d) ((d)&PCI_CLASS_MASK)
-
-#define PCI_VENDOR(d) ((d)&0xffff)
-#define PCI_DEVICE(d) (((d)>>8)&0xffff)
-
-#define PCI_UHCI_VENDORID_INTEL 0x8086
-#define PCI_UHCI_VENDORID_VIA 0x1106
-
-#define PCI_UHCI_DEVICEID_PIIX3 0x70208086ul
-static const char *uhci_device_piix3 = "Intel 82371SB USB Host Controller";
-#define PCI_UHCI_DEVICEID_PIIX4 0x71128086ul
-#define PCI_UHCI_DEVICEID_PIIX4E 0x71128086ul /* no separate step */
-static const char *uhci_device_piix4 = "Intel 82371AB/EB USB Host Controller";
-#define PCI_UHCI_DEVICEID_VT83C572 0x30381106ul
-static const char *uhci_device_vt83c572 = "VIA 83C572 USB Host Controller";
-static const char *uhci_device_generic = "UHCI USB Controller (generic)";
-
-#define PCI_UHCI_BASE_REG 0x20
-
-static const char *uhci_pci_probe __P((pcici_t, pcidi_t));
-static void uhci_pci_attach __P((pcici_t, int));
-
-u_long uhci_count = 0; /* global counter for nr. of devices found */
-
-static struct pci_device uhci_pci_device = {
- "uhci",
- uhci_pci_probe,
- uhci_pci_attach,
- &uhci_count,
- NULL
-};
-
-DATA_SET(pcidevice_set, uhci_pci_device);
-
-
-static const char *
-uhci_pci_probe(pcici_t config_id, pcidi_t device_id)
-{
- u_int32_t class;
-
- if (device_id == PCI_UHCI_DEVICEID_PIIX3) {
- return (uhci_device_piix3);
- } else if (device_id == PCI_UHCI_DEVICEID_PIIX4) {
- return (uhci_device_piix4);
- } else if (device_id == PCI_UHCI_DEVICEID_VT83C572) {
- return (uhci_device_vt83c572);
- } else {
- class = pci_conf_read(config_id, PCI_CLASS_REG);
- if ( PCI_CLASS(class) == PCI_CLASS_SERIALBUS
- && PCI_SUBCLASS(class) == PCI_SUBCLASS_SERIALBUS_USB
- && PCI_INTERFACE(class) == PCI_INTERFACE_UHCI) {
- return (uhci_device_generic);
- }
- }
-
- return NULL; /* dunno... */
-}
-
-static void
-uhci_pci_attach(pcici_t config_id, int unit)
-{
- int id;
- char *typestr;
- usbd_status r;
- uhci_softc_t *sc = NULL;
-
- sc = malloc(sizeof(uhci_softc_t), M_DEVBUF, M_NOWAIT);
- /* Do not free it below, intr might use the sc */
- if ( sc == NULL ) {
- printf("usb%d: could not allocate memory", unit);
- return;
- }
- memset(sc, 0, sizeof(uhci_softc_t));
-
- sc->sc_iobase = pci_conf_read(config_id,PCI_UHCI_BASE_REG) & 0xffe0;
- sc->unit = unit;
-
- if ( !pci_map_int(config_id, (pci_inthand_t *)uhci_intr,
- (void *) sc, &bio_imask)) {
- printf("usb%d: could not map irq\n", unit);
- return;
- }
-
-#ifndef USBVERBOSE
- if (bootverbose)
-#endif
- {
- switch(pci_conf_read(config_id, PCI_USBREV) & PCI_USBREV_MASK) {
- case PCI_USBREV_PRE_1_0:
- typestr = "pre 1.0";
- break;
- case PCI_USBREV_1_0:
- typestr = "1.0";
- break;
- default:
- typestr = "unknown";
- break;
- }
- printf("usb%d: USB version %s, interrupting at %d\n", unit,
- typestr,
- (int)pci_conf_read(config_id,PCI_INTERRUPT_REG) & 0xff);
- }
-
- /* Figure out vendor for root hub descriptor. */
- id = pci_conf_read(config_id, PCI_ID_REG);
- if (PCI_VENDOR(id) == PCI_UHCI_VENDORID_INTEL)
- sprintf(sc->sc_vendor, "Intel");
- else if (PCI_VENDOR(id) == PCI_UHCI_VENDORID_VIA)
- sprintf(sc->sc_vendor, "VIA");
- else
- sprintf(sc->sc_vendor, "(0x%04x)", PCI_VENDOR(id));
-
- /* We add a child to the root bus. After PCI configuration
- * has completed the root bus will start to probe and
- * attach all the devices attached to it, including our new
- * kid.
- *
- * FIXME Sometime in the future the UHCI controller itself will
- * become a kid of PCI device and this device add will no longer
- * be necessary.
- *
- * See README for an elaborate description of the bus
- * structure in spe.
- */
- sc->sc_bus.bdev = device_add_child(root_bus, "usb", unit, sc);
- if (!sc->sc_bus.bdev) {
- printf("%s%d: could not add USB device to root bus\n",
- device_get_name(sc->sc_bus.bdev),
- device_get_unit(sc->sc_bus.bdev));
- return;
- }
-
- r = uhci_init(sc);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s%d: init failed, error=%d\n",
- device_get_name(sc->sc_bus.bdev),
- device_get_unit(sc->sc_bus.bdev),
- r);
- device_delete_child(root_bus, sc->sc_bus.bdev);
- return;
- }
-
- switch (id) {
- case PCI_UHCI_DEVICEID_PIIX3:
- device_set_desc(sc->sc_bus.bdev, uhci_device_piix3);
- break;
- case PCI_UHCI_DEVICEID_PIIX4:
- device_set_desc(sc->sc_bus.bdev, uhci_device_piix4);
- break;
- case PCI_UHCI_DEVICEID_VT83C572:
- device_set_desc(sc->sc_bus.bdev, uhci_device_vt83c572);
- break;
- default:
- printf("(New UHCI DeviceId=0x%08x)\n", id);
- device_set_desc(sc->sc_bus.bdev, uhci_device_generic);
- }
-
- return;
-}
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c
index 7d64cd24fef6c..4bee255fd5a64 100644
--- a/sys/dev/ppbus/if_plip.c
+++ b/sys/dev/ppbus/if_plip.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*
* From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
- * $Id: if_plip.c,v 1.6 1998/11/07 14:35:41 nsouch Exp $
+ * $Id: if_plip.c,v 1.3 1998/08/17 01:05:23 bde Exp $
*/
/*
@@ -129,9 +129,7 @@
#define LPIPTBLSIZE 256 /* Size of octet translation table */
-#ifndef DEBUG
#define DEBUG
-#endif
#ifndef DEBUG
#define lprintf (void)
@@ -336,16 +334,17 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
}
if (((ifp->if_flags & IFF_UP)) && (!(ifp->if_flags & IFF_RUNNING))) {
- /* XXX
+ /*
+ * Try to allocate the ppbus as soon as possible
+ * With ppbus allocation, interrupts are enabled
+ * Now IFF_UP means that we own the bus
+ *
+ * XXX
* Should the request be interruptible?
*/
if ((error = ppb_request_bus(&sc->lp_dev, PPB_WAIT|PPB_INTR)))
return (error);
- /* Now IFF_UP means that we own the bus */
-
- ppb_set_mode(&sc->lp_dev, PPB_COMPATIBLE);
-
if (lpinittables()) {
ppb_release_bus(&sc->lp_dev);
return ENOBUFS;
@@ -394,13 +393,6 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
}
break;
- case SIOCGIFMEDIA:
- /*
- * No ifmedia support at this stage; maybe use it
- * in future for eg. protocol selection.
- */
- return EINVAL;
-
default:
lprintf("LP:ioctl(0x%lx)\n", cmd);
return EINVAL;
@@ -427,7 +419,7 @@ clpoutbyte (u_char byte, int spin, struct ppb_device *dev)
static __inline int
clpinbyte (int spin, struct ppb_device *dev)
{
- u_char c, cl;
+ int c, cl;
while((ppb_rstr(dev) & CLPIP_SHAKE))
if(!--spin) {
diff --git a/sys/dev/ppbus/immio.c b/sys/dev/ppbus/immio.c
index 67054f79bea2e..630707cb0ad02 100644
--- a/sys/dev/ppbus/immio.c
+++ b/sys/dev/ppbus/immio.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: immio.c,v 1.4 1998/10/31 11:35:21 nsouch Exp $
+ * $Id: immio.c,v 1.2 1998/09/20 14:41:54 nsouch Exp $
*
*/
@@ -47,8 +47,6 @@
#include <sys/kernel.h>
#endif /*KERNEL */
-#include "opt_vpo.h"
-
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/ppb_msq.h>
#include <dev/ppbus/vpoio.h>
@@ -288,13 +286,9 @@ imm_disconnect(struct vpoio_data *vpo, int *connected, int release_bus)
ppb_MS_microseq(&vpo->vpo_dev, cpp_microseq, &ret);
- if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x38)) {
- if (bootverbose)
- printf("imm%d: (disconnect) s1=0x%x s2=0x%x, s3=0x%x\n",
- vpo->vpo_unit, s1 & 0xff, s2 & 0xff, s3 & 0xff);
- if (connected)
- *connected = VP0_ECONNECT;
- }
+ if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x38) &&
+ connected)
+ *connected = VP0_ECONNECT;
if (release_bus)
return (ppb_release_bus(&vpo->vpo_dev));
@@ -340,13 +334,9 @@ imm_connect(struct vpoio_data *vpo, int how, int *disconnected, int request_bus)
ppb_MS_microseq(&vpo->vpo_dev, cpp_microseq, &ret);
- if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x30)) {
- if (bootverbose)
- printf("imm%d: (connect) s1=0x%x s2=0x%x, s3=0x%x\n",
- vpo->vpo_unit, s1 & 0xff, s2 & 0xff, s3 & 0xff);
- if (disconnected)
- *disconnected = VP0_ECONNECT;
- }
+ if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x30)
+ && disconnected)
+ *disconnected = VP0_ECONNECT;
return (0);
}
diff --git a/sys/dev/ppbus/lpbb.c b/sys/dev/ppbus/lpbb.c
deleted file mode 100644
index cd8ff244a0c61..0000000000000
--- a/sys/dev/ppbus/lpbb.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/*-
- * Copyright (c) 1998 Nicolas Souchu, Marc Bouget
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: lpbb.c,v 1.3 1998/12/07 21:58:16 archie Exp $
- *
- */
-
-/*
- * I2C Bit-Banging over parallel port
- *
- * See the Official Philips interface description in lpbb(4)
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
-
-#include <machine/clock.h>
-
-#include <dev/ppbus/ppbconf.h>
-
-#include <dev/iicbus/iiconf.h>
-#include <dev/iicbus/iicbus.h>
-
-#include "iicbb_if.h"
-
-/* iicbus softc */
-struct lpbb_softc {
-
- struct ppb_device lpbb_dev;
-};
-
-static int lpbb_detect(struct lpbb_softc *);
-
-static int lpbb_probe(device_t);
-static int lpbb_attach(device_t);
-static void lpbb_print_child(device_t, device_t);
-
-static int lpbb_callback(device_t, int, caddr_t *);
-static void lpbb_setlines(device_t, int, int);
-static int lpbb_getdataline(device_t);
-static int lpbb_reset(device_t, u_char, u_char, u_char *);
-
-static devclass_t lpbb_devclass;
-
-static device_method_t lpbb_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, lpbb_probe),
- DEVMETHOD(device_attach, lpbb_attach),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, lpbb_print_child),
-
- /* iicbb interface */
- DEVMETHOD(iicbb_callback, lpbb_callback),
- DEVMETHOD(iicbb_setlines, lpbb_setlines),
- DEVMETHOD(iicbb_getdataline, lpbb_getdataline),
- DEVMETHOD(iicbb_reset, lpbb_reset),
-
- { 0, 0 }
-};
-
-static driver_t lpbb_driver = {
- "lpbb",
- lpbb_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct lpbb_softc),
-};
-
-/*
- * Make ourselves visible as a ppbus driver
- */
-static struct ppb_device *lpbb_ppb_probe(struct ppb_data *ppb);
-static int lpbb_ppb_attach(struct ppb_device *dev);
-
-#define MAXLPBB 8 /* XXX not much better! */
-static struct lpbb_softc *lpbbdata[MAXLPBB];
-static int nlpbb = 0;
-
-#ifdef KERNEL
-
-static struct ppb_driver lpbbdriver = {
- lpbb_ppb_probe, lpbb_ppb_attach, "lpbb"
-};
-DATA_SET(ppbdriver_set, lpbbdriver);
-
-#endif /* KERNEL */
-
-static int
-lpbb_probe(device_t dev)
-{
- struct lpbb_softc *sc = lpbbdata[device_get_unit(dev)];
- struct lpbb_softc *scdst = (struct lpbb_softc *)device_get_softc(dev);
-
- /* XXX copy softc. Yet, ppbus device is sc->lpbb_dev, but will be
- * dev->parent when ppbus will be ported to the new bus architecture */
- bcopy(sc, scdst, sizeof(struct lpbb_softc));
-
- device_set_desc(dev, "parallel I2C bit-banging interface");
-
- /* probe done by ppbus initialization */
- return (0);
-}
-
-static int
-lpbb_attach(device_t dev)
-{
- device_t bitbang, iicbus;
-
- /* add generic bit-banging code */
- bitbang = device_add_child(dev, "iicbb", -1, NULL);
-
- /* add the iicbus to the tree */
- iicbus = iicbus_alloc_bus(bitbang);
-
- device_probe_and_attach(bitbang);
-
- /* XXX should be in iicbb_attach! */
- device_probe_and_attach(iicbus);
-
- return (0);
-}
-
-/*
- * lppbb_ppb_probe()
- */
-static struct ppb_device *
-lpbb_ppb_probe(struct ppb_data *ppb)
-{
- struct lpbb_softc *sc;
-
- sc = (struct lpbb_softc *) malloc(sizeof(struct lpbb_softc),
- M_TEMP, M_NOWAIT);
- if (!sc) {
- printf("lpbb: cannot malloc!\n");
- return (0);
- }
- bzero(sc, sizeof(struct lpbb_softc));
-
- lpbbdata[nlpbb] = sc;
-
- /*
- * ppbus dependent initialisation.
- */
- sc->lpbb_dev.id_unit = nlpbb;
- sc->lpbb_dev.name = lpbbdriver.name;
- sc->lpbb_dev.ppb = ppb;
- sc->lpbb_dev.intr = 0;
-
- if (!lpbb_detect(sc)) {
- free(sc, M_TEMP);
- return (NULL);
- }
-
- /* Ok, go to next device on next probe */
- nlpbb ++;
-
- /* XXX wrong according to new bus architecture. ppbus needs to be
- * ported
- */
- return (&sc->lpbb_dev);
-}
-
-static int
-lpbb_ppb_attach(struct ppb_device *dev)
-{
- /* add the parallel port I2C interface to the bus tree */
- if (!device_add_child(root_bus, "lpbb", dev->id_unit, NULL))
- return (0);
-
- return (1);
-}
-
-static int
-lpbb_callback(device_t dev, int index, caddr_t *data)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
- int error = 0;
- int how;
-
- switch (index) {
- case IIC_REQUEST_BUS:
- /* request the ppbus */
- how = *(int *)data;
- error = ppb_request_bus(&sc->lpbb_dev, how);
- break;
-
- case IIC_RELEASE_BUS:
- /* release the ppbus */
- error = ppb_release_bus(&sc->lpbb_dev);
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-#define SDA_out 0x80
-#define SCL_out 0x08
-#define SDA_in 0x80
-#define SCL_in 0x08
-#define ALIM 0x20
-#define I2CKEY 0x50
-
-static int getSDA(struct lpbb_softc *sc)
-{
-if((ppb_rstr(&sc->lpbb_dev)&SDA_in)==SDA_in)
- return 1;
-else
- return 0;
-}
-
-static void setSDA(struct lpbb_softc *sc, char val)
-{
-if(val==0)
- ppb_wdtr(&sc->lpbb_dev, (u_char)SDA_out);
-else
- ppb_wdtr(&sc->lpbb_dev, (u_char)~SDA_out);
-}
-
-static void setSCL(struct lpbb_softc *sc, unsigned char val)
-{
-if(val==0)
- ppb_wctr(&sc->lpbb_dev, (u_char)(ppb_rctr(&sc->lpbb_dev)&~SCL_out));
-else
- ppb_wctr(&sc->lpbb_dev, (u_char)(ppb_rctr(&sc->lpbb_dev)|SCL_out));
-}
-
-static int lpbb_detect(struct lpbb_softc *sc)
-{
- if (ppb_request_bus(&sc->lpbb_dev, PPB_DONTWAIT)) {
- printf("lpbb: can't allocate ppbus\n");
- return (0);
- }
-
- /* reset bus */
- setSDA(sc, 1);
- setSCL(sc, 1);
-
- if ((ppb_rstr(&sc->lpbb_dev) & I2CKEY) ||
- ((ppb_rstr(&sc->lpbb_dev) & ALIM) != ALIM)) {
-
- ppb_release_bus(&sc->lpbb_dev);
- return (0);
- }
-
- ppb_release_bus(&sc->lpbb_dev);
-
- return (1);
-}
-
-static int
-lpbb_reset(device_t dev, u_char speed, u_char addr, u_char * oldaddr)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
-
- /* reset bus */
- setSDA(sc, 1);
- setSCL(sc, 1);
-
- return (IIC_ENOADDR);
-}
-
-static void
-lpbb_setlines(device_t dev, int ctrl, int data)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
-
- setSCL(sc, ctrl);
- setSDA(sc, data);
-}
-
-static int
-lpbb_getdataline(device_t dev)
-{
- struct lpbb_softc *sc = (struct lpbb_softc *)device_get_softc(dev);
-
- return (getSDA(sc));
-}
-
-static void
-lpbb_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
-DRIVER_MODULE(lpbb, root, lpbb_driver, lpbb_devclass, 0, 0);
diff --git a/sys/dev/ppbus/nlpt.c b/sys/dev/ppbus/nlpt.c
index 89d6c7f5a5a34..2a48eb4a2b766 100644
--- a/sys/dev/ppbus/nlpt.c
+++ b/sys/dev/ppbus/nlpt.c
@@ -47,7 +47,7 @@
*
* from: unknown origin, 386BSD 0.1
* From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
- * $Id: nlpt.c,v 1.11 1998/12/04 22:00:33 archie Exp $
+ * $Id: nlpt.c,v 1.9 1998/08/03 19:14:31 msmith Exp $
*/
/*
@@ -81,19 +81,12 @@
#endif /*KERNEL*/
#include <dev/ppbus/ppbconf.h>
-#include <dev/ppbus/ppb_1284.h>
#include <dev/ppbus/nlpt.h>
-#include "opt_nlpt.h"
-
#ifndef NLPT_DEBUG
-#define nlprintf(args)
+#define nlprintf (void)
#else
-#define nlprintf(args) \
- do { \
- if (nlptflag) \
- printf args; \
- } while (0)
+#define nlprintf if (nlptflag) printf
static int volatile nlptflag = 1;
#endif
@@ -102,7 +95,6 @@ static int volatile nlptflag = 1;
#define LPTOUTMAX 1 /* maximal timeout 1 s */
#define LPPRI (PZERO+8)
#define BUFSIZE 1024
-#define BUFSTATSIZE 32
#define LPTUNIT(s) ((s)&0x03)
#define LPTFLAGS(s) ((s)&0xfc)
@@ -167,12 +159,11 @@ DATA_SET(ppbdriver_set, nlptdriver);
static d_open_t nlptopen;
static d_close_t nlptclose;
static d_write_t nlptwrite;
-static d_read_t nlptread;
static d_ioctl_t nlptioctl;
#define CDEV_MAJOR 16
static struct cdevsw nlpt_cdevsw =
- { nlptopen, nlptclose, nlptread, nlptwrite, /*16*/
+ { nlptopen, nlptclose, noread, nlptwrite, /*16*/
nlptioctl, nullstop, nullreset, nodevtotty, /* lpt */
seltrue, nommap, nostrat, LPT_NAME, NULL, -1 };
@@ -181,9 +172,6 @@ lpt_request_ppbus(struct lpt_data *sc, int how)
{
int error;
- if (sc->sc_state & HAVEBUS)
- return (0);
-
/* we have the bus only if the request succeded */
if ((error = ppb_request_bus(&sc->lpt_dev, how)) == 0)
sc->sc_state |= HAVEBUS;
@@ -194,10 +182,13 @@ lpt_request_ppbus(struct lpt_data *sc, int how)
static int
lpt_release_ppbus(struct lpt_data *sc)
{
- ppb_release_bus(&sc->lpt_dev);
- sc->sc_state &= ~HAVEBUS;
+ int error;
+
+ /* we do not have the bus only if the request succeeded */
+ if ((error = ppb_release_bus(&sc->lpt_dev)) == 0)
+ sc->sc_state &= ~HAVEBUS;
- return (0);
+ return (error);
}
/*
@@ -216,7 +207,7 @@ nlpt_port_test(struct lpt_data *sc, u_char data, u_char mask)
temp = ppb_rdtr(&sc->lpt_dev) & mask;
}
while (temp != data && --timeout);
- nlprintf(("out=%x\tin=%x\ttout=%d\n", data, temp, timeout));
+ nlprintf("out=%x\tin=%x\ttout=%d\n", data, temp, timeout);
return (temp == data);
}
@@ -377,15 +368,15 @@ nlptattach(struct ppb_device *dev)
ppb_wctr(&sc->lpt_dev, LPC_NINIT);
/* check if we can use interrupt, should be done by ppc stuff */
- nlprintf(("oldirq %x\n", sc->sc_irq));
+ nlprintf("oldirq %x\n", sc->sc_irq);
if (ppb_get_irq(&sc->lpt_dev)) {
sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
printf(LPT_NAME "%d: Interrupt-driven port\n", dev->id_unit);
} else {
sc->sc_irq = 0;
- nlprintf((LPT_NAME "%d: Polled port\n", dev->id_unit));
+ nlprintf(LPT_NAME "%d: Polled port\n", dev->id_unit);
}
- nlprintf(("irq %x\n", sc->sc_irq));
+ nlprintf("irq %x\n", sc->sc_irq);
lpt_release_ppbus(sc);
@@ -407,7 +398,7 @@ nlptout(void *arg)
struct lpt_data *sc = arg;
int pl;
- nlprintf(("T %x ", ppb_rstr(&sc->lpt_dev)));
+ nlprintf ("T %x ", ppb_rstr(&sc->lpt_dev));
if (sc->sc_state & OPEN) {
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
@@ -444,7 +435,7 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
struct lpt_data *sc;
int s;
- int trys, err;
+ int trys;
u_int unit = LPTUNIT(minor(dev));
if ((unit >= nlpt))
@@ -453,7 +444,7 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
sc = lptdata[unit];
if (sc->sc_state) {
- nlprintf((LPT_NAME ": still open %x\n", sc->sc_state));
+ nlprintf(LPT_NAME ": still open %x\n", sc->sc_state);
return(EBUSY);
} else
sc->sc_state |= LPTINIT;
@@ -467,11 +458,12 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
}
/* request the ppbus only if we don't have it already */
- if (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
- return (err);
+ if ((sc->sc_state & HAVEBUS) == 0 &&
+ lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
+ return (EINTR);
s = spltty();
- nlprintf((LPT_NAME " flags 0x%x\n", sc->sc_flags));
+ nlprintf(LPT_NAME " flags 0x%x\n", sc->sc_flags);
/* set IRQ status according to ENABLE_IRQ flag */
if (sc->sc_irq & LP_ENABLE_IRQ)
@@ -497,7 +489,7 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
if (trys++ >= LPINITRDY*4) {
splx(s);
sc->sc_state = 0;
- nlprintf(("status %x\n", ppb_rstr(&sc->lpt_dev)));
+ nlprintf ("status %x\n", ppb_rstr(&sc->lpt_dev) );
lpt_release_ppbus(sc);
return (EBUSY);
@@ -530,7 +522,6 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
sc->sc_state = OPEN;
sc->sc_inbuf = geteblk(BUFSIZE);
- sc->sc_statbuf = geteblk(BUFSTATSIZE);
sc->sc_xfercnt = 0;
splx(s);
@@ -538,14 +529,14 @@ nlptopen(dev_t dev, int flags, int fmt, struct proc *p)
lpt_release_ppbus(sc);
/* only use timeout if using interrupt */
- nlprintf(("irq %x\n", sc->sc_irq));
+ nlprintf("irq %x\n", sc->sc_irq);
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout(nlptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
}
- nlprintf(("opened.\n"));
+ nlprintf("opened.\n");
return(0);
}
@@ -564,7 +555,8 @@ nlptclose(dev_t dev, int flags, int fmt, struct proc *p)
if(sc->sc_flags & LP_BYPASS)
goto end_close;
- if (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
+ if ((sc->sc_state & HAVEBUS) == 0 &&
+ (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR)))
return (err);
sc->sc_state &= ~OPEN;
@@ -581,7 +573,6 @@ nlptclose(dev_t dev, int flags, int fmt, struct proc *p)
ppb_wctr(&sc->lpt_dev, LPC_NINIT);
brelse(sc->sc_inbuf);
- brelse(sc->sc_statbuf);
end_close:
/* release the bus anyway */
@@ -589,7 +580,7 @@ end_close:
sc->sc_state = 0;
sc->sc_xfercnt = 0;
- nlprintf(("closed.\n"));
+ nlprintf("closed.\n");
return(0);
}
@@ -607,7 +598,7 @@ nlpt_pushbytes(struct lpt_data *sc)
int spin, err, tic;
char ch;
- nlprintf(("p"));
+ nlprintf("p");
/* loop for every character .. */
while (sc->sc_xfercnt > 0) {
/* printer data */
@@ -654,40 +645,6 @@ nlpt_pushbytes(struct lpt_data *sc)
}
/*
- * nlptread --retrieve printer status in IEEE1284 NIBBLE mode
- */
-
-static int
-nlptread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct lpt_data *sc = lptdata[LPTUNIT(minor(dev))];
- int error = 0, len;
-
- if ((error = ppb_1284_negociate(&sc->lpt_dev, PPB_NIBBLE, 0)))
- return (error);
-
- /* read data in an other buffer, read/write may be simultaneous */
- len = 0;
- while (uio->uio_resid) {
- if ((error = ppb_1284_read(&sc->lpt_dev, PPB_NIBBLE,
- sc->sc_statbuf->b_data, min(BUFSTATSIZE,
- uio->uio_resid), &len))) {
- goto error;
- }
-
- if (!len)
- goto error; /* no more data */
-
- if ((error = uiomove(sc->sc_statbuf->b_data, len, uio)))
- goto error;
- }
-
-error:
- ppb_1284_terminate(&sc->lpt_dev);
- return (error);
-}
-
-/*
* nlptwrite --copy a line from user space to a local buffer, then call
* putc to get the chars moved to the output queue.
*
@@ -699,7 +656,6 @@ nlptwrite(dev_t dev, struct uio *uio, int ioflag)
{
register unsigned n;
int pl, err;
- u_int unit = LPTUNIT(minor(dev));
struct lpt_data *sc = lptdata[LPTUNIT(minor(dev))];
if(sc->sc_flags & LP_BYPASS) {
@@ -708,46 +664,26 @@ nlptwrite(dev_t dev, struct uio *uio, int ioflag)
}
/* request the ppbus only if we don't have it already */
- if (err = lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
- return (err);
+ if ((sc->sc_state & HAVEBUS) == 0 &&
+ lpt_request_ppbus(sc, PPB_WAIT|PPB_INTR))
+ return (EINTR);
sc->sc_state &= ~INTERRUPTED;
while ((n = min(BUFSIZE, uio->uio_resid)) != 0) {
sc->sc_cp = sc->sc_inbuf->b_data ;
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
-
- if (sc->sc_irq & LP_ENABLE_EXT) {
- /* try any extended mode */
- err = ppb_write(&sc->lpt_dev, sc->sc_cp,
- sc->sc_xfercnt, 0);
- switch (err) {
- case 0:
- /* if not all data was sent, we could rely
- * on polling for the last bytes */
- sc->sc_xfercnt = 0;
- break;
- case EINTR:
- sc->sc_state |= INTERRUPTED;
- return(err);
- case EINVAL:
- /* advanced mode not avail */
- log(LOG_NOTICE, LPT_NAME "%d: advanced mode not avail, polling\n", unit);
- break;
- default:
- return(err);
- }
- } else while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
- nlprintf(("i"));
+ while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
+ nlprintf("i");
/* if the printer is ready for a char, */
/* give it one */
if ((sc->sc_state & OBUSY) == 0){
- nlprintf(("\nC %d. ", sc->sc_xfercnt));
+ nlprintf("\nC %d. ", sc->sc_xfercnt);
pl = spltty();
nlpt_intr(sc->lpt_unit);
(void) splx(pl);
}
- nlprintf(("W "));
+ nlprintf("W ");
if (sc->sc_state & OBUSY)
if ((err = tsleep((caddr_t)sc,
LPPRI|PCATCH, LPT_NAME "write", 0))) {
@@ -755,10 +691,9 @@ nlptwrite(dev_t dev, struct uio *uio, int ioflag)
return(err);
}
}
-
/* check to see if we must do a polled write */
if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
- nlprintf(("p"));
+ nlprintf("p");
err = nlpt_pushbytes(sc);
@@ -806,7 +741,7 @@ nlpt_intr(int unit)
if (sc->sc_xfercnt) {
/* send char */
- /*nlprintf(("%x ", *sc->sc_cp)); */
+ /*nlprintf("%x ", *sc->sc_cp); */
ppb_wdtr(&sc->lpt_dev, *sc->sc_cp++) ;
ppb_wctr(&sc->lpt_dev, sc->sc_control|LPC_STB);
/* DELAY(X) */
@@ -824,7 +759,7 @@ nlpt_intr(int unit)
if(!(sc->sc_state & INTERRUPTED))
wakeup((caddr_t)sc);
- nlprintf(("w "));
+ nlprintf("w ");
return;
} else { /* check for error */
if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
@@ -832,7 +767,7 @@ nlpt_intr(int unit)
sc->sc_state |= EERROR;
/* nlptout() will jump in and try to restart. */
}
- nlprintf(("sts %x ", sts));
+ nlprintf("sts %x ", sts);
}
static void
@@ -870,35 +805,15 @@ nlptioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
* this gets syslog'd.
*/
old_sc_irq = sc->sc_irq;
- switch(*(int*)data) {
- case 0:
+ if(*(int*)data == 0)
sc->sc_irq &= (~LP_ENABLE_IRQ);
- break;
- case 1:
- sc->sc_irq &= (~LP_ENABLE_EXT);
+ else
sc->sc_irq |= LP_ENABLE_IRQ;
- break;
- case 2:
- /* classic irq based transfer and advanced
- * modes are in conflict
- */
- sc->sc_irq &= (~LP_ENABLE_IRQ);
- sc->sc_irq |= LP_ENABLE_EXT;
- break;
- case 3:
- sc->sc_irq &= (~LP_ENABLE_EXT);
- break;
- default:
- break;
- }
-
if (old_sc_irq != sc->sc_irq )
- log(LOG_NOTICE, LPT_NAME "%d: switched to %s %s mode\n",
+ log(LOG_NOTICE, LPT_NAME "%d: switched to %s mode\n",
unit,
(sc->sc_irq & LP_ENABLE_IRQ)?
- "interrupt-driven":"polled",
- (sc->sc_irq & LP_ENABLE_EXT)?
- "extended":"standard");
+ "interrupt-driven":"polled");
} else /* polled port */
error = EOPNOTSUPP;
break;
diff --git a/sys/dev/ppbus/nlpt.h b/sys/dev/ppbus/nlpt.h
index 31292b9f7ed7b..b0b3df6457a78 100644
--- a/sys/dev/ppbus/nlpt.h
+++ b/sys/dev/ppbus/nlpt.h
@@ -27,7 +27,7 @@
* @(#)lptreg.h 1.1 (Berkeley) 12/19/90
* Id: lptreg.h,v 1.6 1997/02/22 09:36:52 peter Exp
*
- * $Id: nlpt.h,v 1.2 1997/08/16 14:05:32 msmith Exp $
+ * $Id: nlpt.h,v 1.1 1997/08/14 13:57:40 msmith Exp $
*/
#ifndef __NLPT_H
#define __NLPT_H
@@ -61,15 +61,13 @@ struct lpt_data {
#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
#define LP_BYPASS 0x80 /* bypass printer ready checks */
struct buf *sc_inbuf;
- struct buf *sc_statbuf;
short sc_xfercnt ;
char sc_primed;
char *sc_cp ;
- u_short sc_irq ; /* IRQ status of port */
+ u_char sc_irq ; /* IRQ status of port */
#define LP_HAS_IRQ 0x01 /* we have an irq available */
#define LP_USE_IRQ 0x02 /* we are using our irq */
#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
-#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
u_char sc_backoff ; /* time to call lptout() again */
#ifdef DEVFS
diff --git a/sys/dev/ppbus/ppb_1284.c b/sys/dev/ppbus/ppb_1284.c
index 5da5fa3eac3ad..56524d1052e7b 100644
--- a/sys/dev/ppbus/ppb_1284.c
+++ b/sys/dev/ppbus/ppb_1284.c
@@ -23,15 +23,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_1284.c,v 1.7 1999/01/10 12:04:54 nsouch Exp $
+ * $Id: ppb_1284.c,v 1.5 1998/09/13 18:26:26 nsouch Exp $
*
*/
-/*
- * General purpose routines for the IEEE1284-1994 Standard
- */
-
-#include "opt_ppb_1284.h"
+#include "opt_debug_1284.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -46,414 +42,24 @@
*
* Wait for the peripherial up to 40ms
*/
-static int
-do_1284_wait(struct ppb_device *dev, char mask, char status)
-{
- return (ppb_poll_device(dev, 4, mask, status, PPB_NOINTR | PPB_POLL));
-}
-
-static int
-do_peripheral_wait(struct ppb_device *dev, char mask, char status)
-{
- return (ppb_poll_device(dev, 100, mask, status, PPB_NOINTR | PPB_POLL));
-}
-
-#define nibble2char(s) (((s & ~nACK) >> 3) | (~s & nBUSY) >> 4)
-
-/*
- * ppb_1284_reset_error()
- *
- * Unconditionaly reset the error field
- */
-static int
-ppb_1284_reset_error(struct ppb_device *dev, int state)
-{
- dev->ppb->error = PPB_NO_ERROR;
- dev->ppb->state = state;
-
- return (0);
-}
-
-/*
- * ppb_1284_get_state()
- *
- * Get IEEE1284 state
- */
-static int
-ppb_1284_get_state(struct ppb_device *dev)
-{
- return (dev->ppb->state);
-}
-
-/*
- * ppb_1284_set_state()
- *
- * Change IEEE1284 state if no error occured
- */
-static int
-ppb_1284_set_state(struct ppb_device *dev, int state)
-{
- /* call ppb_1284_reset_error() if you absolutly want to change
- * the state from PPB_ERROR to another */
- if ((dev->ppb->state != PPB_ERROR) &&
- (dev->ppb->error == PPB_NO_ERROR)) {
- dev->ppb->state = state;
- dev->ppb->error = PPB_NO_ERROR;
- }
-
- return (0);
-}
-
-static int
-ppb_1284_set_error(struct ppb_device *dev, int error, int event)
-{
- /* do not accumulate errors */
- if ((dev->ppb->error == PPB_NO_ERROR) &&
- (dev->ppb->state != PPB_ERROR)) {
- dev->ppb->error = error;
- dev->ppb->state = PPB_ERROR;
- }
-
-#ifdef DEBUG_1284
- printf("ppb1284: error=%d status=0x%x event=%d\n", error,
- ppb_rstr(dev) & 0xff, event);
-#endif
-
- return (0);
-}
-
-/*
- * ppb_request_mode()
- *
- * Converts mode+options into ext. value
- */
-static int
-ppb_request_mode(int mode, int options)
-{
- int request_mode = 0;
-
- if (options & PPB_EXTENSIBILITY_LINK) {
- request_mode = EXT_LINK_1284_NORMAL;
-
- } else {
- switch (mode) {
- case PPB_NIBBLE:
- request_mode = (options & PPB_REQUEST_ID) ?
- NIBBLE_1284_REQUEST_ID :
- NIBBLE_1284_NORMAL;
- break;
- case PPB_PS2:
- request_mode = (options & PPB_REQUEST_ID) ?
- BYTE_1284_REQUEST_ID :
- BYTE_1284_NORMAL;
- break;
- case PPB_ECP:
- if (options & PPB_USE_RLE)
- request_mode = (options & PPB_REQUEST_ID) ?
- ECP_1284_RLE_REQUEST_ID :
- ECP_1284_RLE;
- else
- request_mode = (options & PPB_REQUEST_ID) ?
- ECP_1284_REQUEST_ID :
- ECP_1284_NORMAL;
- break;
- case PPB_EPP:
- request_mode = EPP_1284_NORMAL;
- break;
- default:
- panic("%s: unsupported mode %d\n", __FUNCTION__, mode);
- }
- }
-
- return (request_mode);
-}
-
-/*
- * ppb_peripheral_negociate()
- *
- * Negociate the peripheral side
- */
-int
-ppb_peripheral_negociate(struct ppb_device *dev, int mode, int options)
-{
- int spin, request_mode, error = 0;
- char r;
-
- ppb_set_mode(dev, PPB_COMPATIBLE);
- ppb_1284_set_state(dev, PPB_PERIPHERAL_NEGOCIATION);
-
- /* compute ext. value */
- request_mode = ppb_request_mode(mode, options);
-
- /* wait host */
- spin = 10;
- while (spin-- && (ppb_rstr(dev) & nBUSY))
- DELAY(1);
-
- /* check termination */
- if (!(ppb_rstr(dev) & SELECT) || !spin) {
- error = ENODEV;
- goto error;
- }
-
- /* Event 4 - read ext. value */
- r = ppb_rdtr(dev);
-
- /* nibble mode is not supported */
- if ((r == (char)request_mode) ||
- (r == NIBBLE_1284_NORMAL)) {
-
- /* Event 5 - restore direction bit, no data avail */
- ppb_wctr(dev, (STROBE | nINIT) & ~(SELECTIN));
- DELAY(1);
-
- /* Event 6 */
- ppb_wctr(dev, (nINIT) & ~(SELECTIN | STROBE));
-
- if (r == NIBBLE_1284_NORMAL) {
-#ifdef DEBUG_1284
- printf("R");
-#endif
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 4);
- error = EINVAL;
- goto error;
- } else {
- ppb_1284_set_state(dev, PPB_PERIPHERAL_IDLE);
- switch (r) {
- case BYTE_1284_NORMAL:
- ppb_set_mode(dev, PPB_BYTE);
- break;
- default:
- break;
- }
-#ifdef DEBUG_1284
- printf("A");
-#endif
- /* negociation succeeds */
- }
- } else {
- /* Event 5 - mode not supported */
- ppb_wctr(dev, SELECTIN);
- DELAY(1);
-
- /* Event 6 */
- ppb_wctr(dev, (SELECTIN) & ~(STROBE | nINIT));
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 4);
-
-#ifdef DEBUG_1284
- printf("r");
-#endif
- error = EINVAL;
- goto error;
- }
-
- return (0);
-
-error:
- ppb_peripheral_terminate(dev, PPB_WAIT);
- return (error);
-}
-
-/*
- * ppb_peripheral_terminate()
- *
- * Terminate peripheral transfer side
- *
- * Always return 0 in compatible mode
- */
-int
-ppb_peripheral_terminate(struct ppb_device *dev, int how)
-{
- int error = 0;
-
-#ifdef DEBUG_1284
- printf("t");
-#endif
-
- ppb_1284_set_state(dev, PPB_PERIPHERAL_TERMINATION);
-
- /* Event 22 - wait up to host response time (1s) */
- if ((error = do_peripheral_wait(dev, SELECT | nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 22);
- goto error;
- }
-
- /* Event 24 */
- ppb_wctr(dev, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN));
-
- /* Event 25 - wait up to host response time (1s) */
- if ((error = do_peripheral_wait(dev, nBUSY, nBUSY))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 25);
- goto error;
- }
-
- /* Event 26 */
- ppb_wctr(dev, (SELECTIN | nINIT | STROBE) & ~(AUTOFEED));
- DELAY(1);
- /* Event 27 */
- ppb_wctr(dev, (SELECTIN | nINIT) & ~(STROBE | AUTOFEED));
-
- /* Event 28 - wait up to host response time (1s) */
- if ((error = do_peripheral_wait(dev, nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 28);
- goto error;
- }
-
-error:
- ppb_set_mode(dev, PPB_COMPATIBLE);
- ppb_1284_set_state(dev, PPB_FORWARD_IDLE);
-
- return (0);
-}
-
-/*
- * byte_peripheral_outbyte()
- *
- * Write 1 byte in BYTE mode
- */
-static int
-byte_peripheral_outbyte(struct ppb_device *dev, char *buffer, int last)
-{
- int error = 0;
-
- /* Event 7 */
- if ((error = do_1284_wait(dev, nBUSY, nBUSY))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 7);
- goto error;
- }
-
- /* check termination */
- if (!(ppb_rstr(dev) & SELECT)) {
- ppb_peripheral_terminate(dev, PPB_WAIT);
- goto error;
- }
-
- /* Event 15 - put byte on data lines */
-#ifdef DEBUG_1284
- printf("B");
-#endif
- ppb_wdtr(dev, *buffer);
-
- /* Event 9 */
- ppb_wctr(dev, (AUTOFEED | STROBE) & ~(nINIT | SELECTIN));
-
- /* Event 10 - wait data read */
- if ((error = do_peripheral_wait(dev, nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 16);
- goto error;
- }
-
- /* Event 11 */
- if (!last) {
- ppb_wctr(dev, (AUTOFEED) & ~(nINIT | STROBE | SELECTIN));
- } else {
- ppb_wctr(dev, (nINIT) & ~(STROBE | SELECTIN | AUTOFEED));
- }
-
-#if 0
- /* Event 16 - wait strobe */
- if ((error = do_peripheral_wait(dev, nACK | nBUSY, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 16);
- goto error;
- }
-#endif
-
- /* check termination */
- if (!(ppb_rstr(dev) & SELECT)) {
- ppb_peripheral_terminate(dev, PPB_WAIT);
- goto error;
- }
-
-error:
- return (error);
-}
-
-/*
- * byte_peripheral_write()
- *
- * Write n bytes in BYTE mode
- */
int
-byte_peripheral_write(struct ppb_device *dev, char *buffer, int len, int *sent)
+do_1284_wait(struct ppb_device *dev, char mask, char status)
{
- int error = 0, i;
+ int i;
char r;
- ppb_1284_set_state(dev, PPB_PERIPHERAL_TRANSFER);
-
- /* wait forever, the remote host is master and should initiate
- * termination
- */
- for (i=0; i<len; i++) {
- /* force remote nFAULT low to release the remote waiting
- * process, if any
- */
- r = ppb_rctr(dev);
- ppb_wctr(dev, r & ~nINIT);
-
-#ifdef DEBUG_1284
- printf("y");
-#endif
- /* Event 7 */
- error = ppb_poll_device(dev, PPB_FOREVER, nBUSY, nBUSY,
- PPB_INTR);
-
- if (error && error != EWOULDBLOCK)
- goto error;
-
-#ifdef DEBUG_1284
- printf("b");
-#endif
- if ((error = byte_peripheral_outbyte(dev, buffer+i, (i == len-1))))
- goto error;
+ /* try up to 5ms */
+ for (i = 0; i < 20; i++) {
+ r = ppb_rstr(dev);
+ DELAY(25);
+ if ((r & mask) == status)
+ return (0);
}
-error:
- if (!error)
- ppb_1284_set_state(dev, PPB_PERIPHERAL_IDLE);
- *sent = i;
- return (error);
+ return (ppb_poll_device(dev, 4, mask, status, PPB_NOINTR));
}
-/*
- * byte_1284_inbyte()
- *
- * Read 1 byte in BYTE mode
- */
-int
-byte_1284_inbyte(struct ppb_device *dev, char *buffer)
-{
- int error = 0;
-
- /* Event 7 - ready to take data (nAUTO low) */
- ppb_wctr(dev, (PCD | nINIT | AUTOFEED) & ~(STROBE | SELECTIN));
-
- /* Event 9 - peripheral set nAck low */
- if ((error = do_1284_wait(dev, nACK, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 9);
- goto error;
- }
-
- /* read the byte */
- *buffer = ppb_rdtr(dev);
-
- /* Event 10 - data received, can't accept more */
- ppb_wctr(dev, (nINIT) & ~(AUTOFEED | STROBE | SELECTIN));
-
- /* Event 11 - peripheral ack */
- if ((error = do_1284_wait(dev, nACK, nACK))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 11);
- goto error;
- }
-
- /* Event 16 - strobe */
- ppb_wctr(dev, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN));
- DELAY(3);
- ppb_wctr(dev, (nINIT) & ~(AUTOFEED | STROBE | SELECTIN));
-
-error:
- return (error);
-}
+#define nibble2char(s) (((s & ~nACK) >> 3) | (~s & nBUSY) >> 4)
/*
* nibble_1284_inbyte()
@@ -467,379 +73,126 @@ nibble_1284_inbyte(struct ppb_device *dev, char *buffer)
int i, error;
for (i = 0; i < 2; i++) {
+ /* ready to take data (nAUTO low) */
+ ppb_wctr(dev, AUTOFEED & ~(STROBE | SELECTIN));
- /* Event 7 - ready to take data (nAUTO low) */
- ppb_wctr(dev, (nINIT | AUTOFEED) & ~(STROBE | SELECTIN));
-
- /* Event 8 - peripheral writes the first nibble */
-
- /* Event 9 - peripheral set nAck low */
- if ((error = do_1284_wait(dev, nACK, 0))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 9);
- goto error;
- }
+ if ((error = do_1284_wait(dev, nACK, 0)))
+ return (error);
/* read nibble */
nibble[i] = ppb_rstr(dev);
- /* Event 10 - ack, nibble received */
- ppb_wctr(dev, nINIT & ~(AUTOFEED | STROBE | SELECTIN));
+ /* ack, not ready for another nibble */
+ ppb_wctr(dev, 0 & ~(AUTOFEED | STROBE | SELECTIN));
- /* Event 11 - wait ack from peripherial */
- if ((error = do_1284_wait(dev, nACK, nACK))) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 11);
- goto error;
- }
+ /* wait ack from peripherial */
+ if ((error = do_1284_wait(dev, nACK, nACK)))
+ return (error);
}
*buffer = ((nibble2char(nibble[1]) << 4) & 0xf0) |
(nibble2char(nibble[0]) & 0x0f);
-error:
- return (error);
-}
-
-/*
- * spp_1284_read()
- *
- * Read in IEEE1284 NIBBLE/BYTE mode
- */
-int
-spp_1284_read(struct ppb_device *dev, int mode, char *buffer, int max, int *read)
-{
- int error = 0, len = 0;
- int terminate_after_transfer = 1;
- int state;
-
- *read = len = 0;
-
- state = ppb_1284_get_state(dev);
-
- switch (state) {
- case PPB_FORWARD_IDLE:
- if ((error = ppb_1284_negociate(dev, mode, 0)))
- return (error);
- break;
-
- case PPB_REVERSE_IDLE:
- terminate_after_transfer = 0;
- break;
-
- default:
- ppb_1284_terminate(dev);
- if ((error = ppb_1284_negociate(dev, mode, 0)))
- return (error);
- break;
- }
-
- while ((len < max) && !(ppb_rstr(dev) & (nFAULT))) {
-
- ppb_1284_set_state(dev, PPB_REVERSE_TRANSFER);
-
-#ifdef DEBUG_1284
- printf("B");
-#endif
-
- switch (mode) {
- case PPB_NIBBLE:
- /* read a byte, error means no more data */
- if (nibble_1284_inbyte(dev, buffer+len))
- goto end_while;
- break;
- case PPB_BYTE:
- if (byte_1284_inbyte(dev, buffer+len))
- goto end_while;
- break;
- default:
- error = EINVAL;
- goto end_while;
- }
- len ++;
- }
-end_while:
-
- if (!error)
- ppb_1284_set_state(dev, PPB_REVERSE_IDLE);
-
- *read = len;
-
- if (terminate_after_transfer || error)
- ppb_1284_terminate(dev);
-
- return (error);
+ return (0);
}
/*
- * ppb_1284_read_id()
- *
+ * nibble_1284_sync()
*/
-int
-ppb_1284_read_id(struct ppb_device *dev, int mode, char *buffer,
- int max, int *read)
+void
+nibble_1284_sync(struct ppb_device *dev)
{
- int error = 0;
+ char ctr;
- /* fill the buffer with 0s */
- bzero(buffer, max);
+ ctr = ppb_rctr(dev);
- switch (mode) {
- case PPB_NIBBLE:
- case PPB_ECP:
- if ((error = ppb_1284_negociate(dev, PPB_NIBBLE, PPB_REQUEST_ID)))
- return (error);
- error = spp_1284_read(dev, PPB_NIBBLE, buffer, max, read);
- break;
- case PPB_BYTE:
- if ((error = ppb_1284_negociate(dev, PPB_BYTE, PPB_REQUEST_ID)))
- return (error);
- error = spp_1284_read(dev, PPB_BYTE, buffer, max, read);
- break;
- default:
- panic("%s: unsupported mode %d\n", __FUNCTION__, mode);
- }
+ ppb_wctr(dev, (ctr & ~AUTOFEED) | SELECTIN);
+ if (do_1284_wait(dev, nACK, 0))
+ return;
- ppb_1284_terminate(dev);
- return (error);
-}
+ ppb_wctr(dev, ctr | AUTOFEED);
+ do_1284_wait(dev, nACK, nACK);
-/*
- * ppb_1284_read()
- *
- * IEEE1284 read
- */
-int
-ppb_1284_read(struct ppb_device *dev, int mode, char *buffer,
- int max, int *read)
-{
- int error = 0;
+ ppb_wctr(dev, (ctr & ~AUTOFEED) | SELECTIN);
- switch (mode) {
- case PPB_NIBBLE:
- case PPB_BYTE:
- error = spp_1284_read(dev, mode, buffer, max, read);
- break;
- default:
- return (EINVAL);
- }
-
- return (error);
+ return;
}
/*
* ppb_1284_negociate()
*
- * IEEE1284 negociation phase
- *
* Normal nibble mode or request device id mode (see ppb_1284.h)
- *
- * After negociation, nFAULT is low if data is available
*/
int
-ppb_1284_negociate(struct ppb_device *dev, int mode, int options)
+ppb_1284_negociate(struct ppb_device *dev, int mode)
{
int error;
- int request_mode;
+ int phase = 0;
-#ifdef DEBUG_1284
- printf("n");
-#endif
-
- if (ppb_1284_get_state(dev) >= PPB_PERIPHERAL_NEGOCIATION)
- ppb_peripheral_terminate(dev, PPB_WAIT);
-
- if (ppb_1284_get_state(dev) != PPB_FORWARD_IDLE)
- ppb_1284_terminate(dev);
-
-#ifdef DEBUG_1284
- printf("%d", mode);
-#endif
-
- /* ensure the host is in compatible mode */
- ppb_set_mode(dev, PPB_COMPATIBLE);
-
- /* reset error to catch the actual negociation error */
- ppb_1284_reset_error(dev, PPB_FORWARD_IDLE);
-
- /* calculate ext. value */
- request_mode = ppb_request_mode(mode, options);
-
- /* default state */
ppb_wctr(dev, (nINIT | SELECTIN) & ~(STROBE | AUTOFEED));
DELAY(1);
- /* enter negociation phase */
- ppb_1284_set_state(dev, PPB_NEGOCIATION);
-
- /* Event 0 - put the exten. value on the data lines */
- ppb_wdtr(dev, request_mode);
-
-#ifdef PERIPH_1284
- /* request remote host attention */
- ppb_wctr(dev, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN));
- DELAY(1);
- ppb_wctr(dev, (nINIT) & ~(STROBE | AUTOFEED | SELECTIN));
-#else
+ ppb_wdtr(dev, mode);
DELAY(1);
-#endif /* !PERIPH_1284 */
-
- /* Event 1 - enter IEEE1284 mode */
ppb_wctr(dev, (nINIT | AUTOFEED) & ~(STROBE | SELECTIN));
-#ifdef PERIPH_1284
- /* ignore the PError line, wait a bit more, remote host's
- * interrupts don't respond fast enough */
- if (ppb_poll_device(dev, 40, nACK | SELECT | nFAULT,
- SELECT | nFAULT, PPB_NOINTR | PPB_POLL)) {
- ppb_1284_set_error(dev, PPB_NOT_IEEE1284, 2);
- error = ENODEV;
- goto error;
- }
-#else
- /* Event 2 - trying IEEE1284 dialog */
- if (do_1284_wait(dev, nACK | PERROR | SELECT | nFAULT,
- PERROR | SELECT | nFAULT)) {
- ppb_1284_set_error(dev, PPB_NOT_IEEE1284, 2);
- error = ENODEV;
+ if ((error = do_1284_wait(dev, nACK | PERROR | SELECT | nFAULT,
+ PERROR | SELECT | nFAULT)))
goto error;
- }
-#endif /* !PERIPH_1284 */
- /* Event 3 - latch the ext. value to the peripheral */
+ phase = 1;
+
ppb_wctr(dev, (nINIT | STROBE | AUTOFEED) & ~SELECTIN);
- DELAY(1);
+ DELAY(5);
- /* Event 4 - IEEE1284 device recognized */
ppb_wctr(dev, nINIT & ~(SELECTIN | AUTOFEED | STROBE));
- /* Event 6 - waiting for status lines */
- if (do_1284_wait(dev, nACK, nACK)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 6);
- error = EBUSY;
+#if 0 /* not respected by most devices */
+ if ((error = do_1284_wait(dev, nACK, nACK)))
goto error;
- }
-
- /* Event 7 - quering result consider nACK not to misunderstand
- * a remote computer terminate sequence */
- if (options & PPB_EXTENSIBILITY_LINK) {
-
- /* XXX not fully supported yet */
- ppb_1284_terminate(dev);
- return (0);
- }
- if (request_mode == NIBBLE_1284_NORMAL) {
- if (do_1284_wait(dev, nACK | SELECT, nACK)) {
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 7);
- error = ENODEV;
- goto error;
- }
- } else {
- if (do_1284_wait(dev, nACK | SELECT, SELECT | nACK)) {
- ppb_1284_set_error(dev, PPB_MODE_UNSUPPORTED, 7);
- error = ENODEV;
+ if (mode == 0)
+ if ((error = do_1284_wait(dev, SELECT, 0)))
goto error;
- }
- }
-
- switch (mode) {
- case PPB_NIBBLE:
- case PPB_PS2:
- /* enter reverse idle phase */
- ppb_1284_set_state(dev, PPB_REVERSE_IDLE);
- break;
- case PPB_ECP:
- /* negociation ok, now setup the communication */
- ppb_1284_set_state(dev, PPB_SETUP);
- ppb_wctr(dev, (nINIT | AUTOFEED) & ~(SELECTIN | STROBE));
-
-#ifdef PERIPH_1284
- /* ignore PError line */
- if (do_1284_wait(dev, nACK | SELECT | nBUSY,
- nACK | SELECT | nBUSY)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 30);
- error = ENODEV;
- goto error;
- }
-#else
- if (do_1284_wait(dev, nACK | SELECT | PERROR | nBUSY,
- nACK | SELECT | PERROR | nBUSY)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 30);
- error = ENODEV;
+ else
+ if ((error = do_1284_wait(dev, SELECT, SELECT)))
goto error;
- }
-#endif /* !PERIPH_1284 */
-
- /* ok, the host enters the ForwardIdle state */
- ppb_1284_set_state(dev, PPB_ECP_FORWARD_IDLE);
- break;
- case PPB_EPP:
- ppb_1284_set_state(dev, PPB_EPP_IDLE);
- break;
-
- default:
- panic("%s: unknown mode (%d)!", __FUNCTION__, mode);
- }
- ppb_set_mode(dev, mode);
+#endif
return (0);
error:
- ppb_1284_terminate(dev);
+ if (bootverbose)
+ printf("%s: status=0x%x %d\n", __FUNCTION__, ppb_rstr(dev), phase);
return (error);
}
-/*
- * ppb_1284_terminate()
- *
- * IEEE1284 termination phase, return code should ignored since the host
- * is _always_ in compatible mode after ppb_1284_terminate()
- */
int
-ppb_1284_terminate(struct ppb_device *dev)
+ppb_1284_terminate(struct ppb_device *dev, int how)
{
+ int error;
-#ifdef DEBUG_1284
- printf("T");
-#endif
-
- /* do not reset error here to keep the error that
- * may occured before the ppb_1284_terminate() call */
- ppb_1284_set_state(dev, PPB_TERMINATION);
+ switch (how) {
+ case VALID_STATE:
-#ifdef PERIPH_1284
- /* request remote host attention */
- ppb_wctr(dev, (nINIT | STROBE | SELECTIN) & ~(AUTOFEED));
- DELAY(1);
-#endif /* PERIPH_1284 */
+ ppb_wctr(dev, SELECTIN & ~(STROBE | AUTOFEED));
- /* Event 22 - set nSelectin low and nAutoFeed high */
- ppb_wctr(dev, (nINIT | SELECTIN) & ~(STROBE | AUTOFEED));
+ if ((error = do_1284_wait(dev, nACK | nBUSY | nFAULT, nFAULT)))
+ return (error);
- /* Event 24 - waiting for peripheral, Xflag ignored */
- if (do_1284_wait(dev, nACK | nBUSY | nFAULT, nFAULT)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 24);
- goto error;
- }
+ ppb_wctr(dev, (SELECTIN | AUTOFEED) & ~STROBE);
- /* Event 25 - set nAutoFd low */
- ppb_wctr(dev, (nINIT | SELECTIN | AUTOFEED) & ~STROBE);
+ if ((error = do_1284_wait(dev, nACK, nACK)))
+ return (error);
- /* Event 26 - compatible mode status is set */
+ ppb_wctr(dev, SELECTIN & ~(STROBE | AUTOFEED));
+ break;
- /* Event 27 - peripheral set nAck high */
- if (do_1284_wait(dev, nACK, nACK)) {
- ppb_1284_set_error(dev, PPB_TIMEOUT, 27);
+ default:
+ return (EINVAL);
}
- /* Event 28 - end termination, return to idle phase */
- ppb_wctr(dev, (nINIT | SELECTIN) & ~(STROBE | AUTOFEED));
-
-error:
- /* return to compatible mode */
- ppb_set_mode(dev, PPB_COMPATIBLE);
- ppb_1284_set_state(dev, PPB_FORWARD_IDLE);
-
return (0);
}
diff --git a/sys/dev/ppbus/ppb_1284.h b/sys/dev/ppbus/ppb_1284.h
index ea009b7d381dd..1cc98d4614a52 100644
--- a/sys/dev/ppbus/ppb_1284.h
+++ b/sys/dev/ppbus/ppb_1284.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_1284.h,v 1.3 1998/09/13 18:26:26 nsouch Exp $
+ * $Id: ppb_1284.h,v 1.2 1998/08/03 19:14:31 msmith Exp $
*
*/
#ifndef __1284_H
@@ -66,59 +66,20 @@
#define Intr nACK
/* request mode values */
-#define NIBBLE_1284_NORMAL 0x0
-#define NIBBLE_1284_REQUEST_ID 0x4
-#define BYTE_1284_NORMAL 0x1
-#define BYTE_1284_REQUEST_ID 0x5
-#define ECP_1284_NORMAL 0x10
-#define ECP_1284_REQUEST_ID 0x14
-#define ECP_1284_RLE 0x30
-#define ECP_1284_RLE_REQUEST_ID 0x34
-#define EPP_1284_NORMAL 0x40
-#define EXT_LINK_1284_NORMAL 0x80
-
-/* ieee1284 mode options */
-#define PPB_REQUEST_ID 0x1
-#define PPB_USE_RLE 0x2
-#define PPB_EXTENSIBILITY_LINK 0x4
-
-/* ieee1284 errors */
-#define PPB_NO_ERROR 0
-#define PPB_MODE_UNSUPPORTED 1 /* mode not supported by peripheral */
-#define PPB_NOT_IEEE1284 2 /* not an IEEE1284 compliant periph. */
-#define PPB_TIMEOUT 3 /* timeout */
-#define PPB_INVALID_MODE 4 /* current mode is incorrect */
-
-/* ieee1284 host side states */
-#define PPB_ERROR 0
-#define PPB_FORWARD_IDLE 1
-#define PPB_NEGOCIATION 2
-#define PPB_SETUP 3
-#define PPB_ECP_FORWARD_IDLE 4
-#define PPB_FWD_TO_REVERSE 5
-#define PPB_REVERSE_IDLE 6
-#define PPB_REVERSE_TRANSFER 7
-#define PPB_REVERSE_TO_FWD 8
-#define PPB_EPP_IDLE 9
-#define PPB_TERMINATION 10
-
-/* peripheral side states */
-#define PPB_PERIPHERAL_NEGOCIATION 11
-#define PPB_PERIPHERAL_IDLE 12
-#define PPB_PERIPHERAL_TRANSFER 13
-#define PPB_PERIPHERAL_TERMINATION 14
+#define NIBBLE_1284_NORMAL 0
+#define NIBBLE_1284_REQUEST_ID 4
-extern int nibble_1284_inbyte(struct ppb_device *, char *);
-extern int byte_1284_inbyte(struct ppb_device *, char *);
-extern int spp_1284_read(struct ppb_device *, int, char *, int, int *);
+/* how to terminate */
+#define VALID_STATE 0
+#define IMMEDIATE 1
+
+extern int do_1284_wait(struct ppb_device *, char, char);
-extern int ppb_1284_negociate(struct ppb_device *, int, int);
-extern int ppb_1284_terminate(struct ppb_device *);
-extern int ppb_1284_read_id(struct ppb_device *, int, char *, int, int *);
-extern int ppb_1284_read(struct ppb_device *, int, char *, int, int *);
+extern int nibble_1284_inbyte(struct ppb_device *, char *);
+extern void nibble_1284_sync(struct ppb_device *);
+extern int nibble_1284_mode(struct ppb_device *, int);
-extern int ppb_peripheral_terminate(struct ppb_device *, int);
-extern int ppb_peripheral_negociate(struct ppb_device *, int, int);
-extern int byte_peripheral_write(struct ppb_device *, char *, int, int *);
+extern int ppb_1284_negociate(struct ppb_device *, int);
+extern int ppb_1284_terminate(struct ppb_device *, int how);
#endif
diff --git a/sys/dev/ppbus/ppb_base.c b/sys/dev/ppbus/ppb_base.c
index 83fc26ef02948..7555b24f752e5 100644
--- a/sys/dev/ppbus/ppb_base.c
+++ b/sys/dev/ppbus/ppb_base.c
@@ -23,13 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_base.c,v 1.5 1998/09/13 18:26:26 nsouch Exp $
+ * $Id: ppb_base.c,v 1.4 1998/08/03 19:14:31 msmith Exp $
*
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <machine/clock.h>
#include <dev/ppbus/ppbconf.h>
@@ -71,39 +70,28 @@ int
ppb_poll_device(struct ppb_device *dev, int max,
char mask, char status, int how)
{
- int i, j, error;
- char r;
-
- /* try at least up to 10ms */
- for (j = 0; j < ((how & PPB_POLL) ? max : 1); j++) {
- for (i = 0; i < 10000; i++) {
- r = ppb_rstr(dev);
- DELAY(1);
- if ((r & mask) == status)
- return (0);
- }
- }
+ int i, error;
- if (!(how & PPB_POLL)) {
- for (i = 0; max == PPB_FOREVER || i < max-1; i++) {
+ for (i = 0; i < max; i++) {
if ((ppb_rstr(dev) & mask) == status)
return (0);
switch (how) {
case PPB_NOINTR:
/* wait 10 ms */
- tsleep((caddr_t)dev, PPBPRI, "ppbpoll", hz/100);
+ if ((error = tsleep((caddr_t)dev, PPBPRI,
+ "ppbpoll", hz/100)))
+ return (error);
break;
case PPB_INTR:
default:
/* wait 10 ms */
if ((error = tsleep((caddr_t)dev, PPBPRI | PCATCH,
- "ppbpoll", hz/100)) != EWOULDBLOCK)
+ "ppbpoll", hz/100)))
return (error);
break;
}
- }
}
return (EWOULDBLOCK);
@@ -120,31 +108,16 @@ ppb_set_mode(struct ppb_device *dev, int mode)
struct ppb_data *ppb = dev->ppb;
int old_mode = ppb_get_mode(dev);
- if ((*ppb->ppb_link->adapter->setmode)(
- ppb->ppb_link->adapter_unit, mode))
+ if ((*ppb->ppb_link->adapter->setmode)(dev->id_unit, mode))
return (-1);
/* XXX yet device mode = ppbus mode = chipset mode */
- dev->mode = ppb->mode = (mode & PPB_MASK);
+ dev->mode = ppb->mode = mode;
return (old_mode);
}
/*
- * ppb_write()
- *
- * Write charaters to the port
- */
-int
-ppb_write(struct ppb_device *dev, char *buf, int len, int how)
-{
- struct ppb_data *ppb = dev->ppb;
-
- return (ppb->ppb_link->adapter->write(ppb->ppb_link->adapter_unit,
- buf, len, how));
-}
-
-/*
* ppb_reset_epp_timeout()
*
* Reset the EPP timeout bit in the status register
@@ -157,7 +130,7 @@ ppb_reset_epp_timeout(struct ppb_device *dev)
if (ppb->ppb_owner != dev)
return (EACCES);
- (*ppb->ppb_link->adapter->reset_epp_timeout)(ppb->ppb_link->adapter_unit);
+ (*ppb->ppb_link->adapter->reset_epp_timeout)(dev->id_unit);
return (0);
}
@@ -175,7 +148,7 @@ ppb_ecp_sync(struct ppb_device *dev)
if (ppb->ppb_owner != dev)
return (EACCES);
- (*ppb->ppb_link->adapter->ecp_sync)(ppb->ppb_link->adapter_unit);
+ (*ppb->ppb_link->adapter->ecp_sync)(dev->id_unit);
return (0);
}
diff --git a/sys/dev/ppbus/ppb_msq.c b/sys/dev/ppbus/ppb_msq.c
index addcf041ab487..7e631e4945216 100644
--- a/sys/dev/ppbus/ppb_msq.c
+++ b/sys/dev/ppbus/ppb_msq.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_msq.c,v 1.3 1998/09/20 14:41:54 nsouch Exp $
+ * $Id: ppb_msq.c,v 1.2 1998/09/13 18:26:26 nsouch Exp $
*
*/
#include <machine/stdarg.h>
@@ -272,19 +272,9 @@ ppb_MS_microseq(struct ppb_device *dev, struct ppb_microseq *msq, int *ret)
xfer = mode2xfer(dev, mi->opcode);
/* figure out if we should use ieee1284 code */
- if (!xfer->loop) {
- if (mi->opcode == MS_OP_PUT) {
- if ((error = ppb->ppb_link->adapter->write(
- ppb->ppb_link->adapter_unit,
- (char *)mi->arg[0].p,
- mi->arg[1].i, 0)))
- goto error;
-
- INCR_PC;
- goto next;
- } else
- panic("%s: IEEE1284 read not supported", __FUNCTION__);
- }
+ if (!xfer->loop)
+ panic("%s: IEEE1284 code not supported",
+ __FUNCTION__);
/* XXX should use ppb_MS_init_msq() */
initxfer[0].arg[0].p = mi->arg[0].p;
@@ -319,12 +309,10 @@ ppb_MS_microseq(struct ppb_device *dev, struct ppb_microseq *msq, int *ret)
* is unknown here
*/
if ((error = ppb->ppb_link->adapter->exec_microseq(
- ppb->ppb_link->adapter_unit,
- &mi)))
+ dev->id_unit, &mi)))
goto error;
break;
}
- next:
}
error:
return (error);
diff --git a/sys/dev/ppbus/ppb_msq.h b/sys/dev/ppbus/ppb_msq.h
index 4bba2997ac257..cdc815408d7fc 100644
--- a/sys/dev/ppbus/ppb_msq.h
+++ b/sys/dev/ppbus/ppb_msq.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppb_msq.h,v 1.2 1998/09/13 18:26:26 nsouch Exp $
+ * $Id: ppb_msq.h,v 1.1.2.7 1998/06/20 19:03:47 son Exp $
*
*/
#ifndef __PPB_MSQ_H
@@ -34,7 +34,7 @@
*/
/* microsequence parameter descriptor */
-#define MS_INS_MASK 0x00ff /* mask to retrieve the instruction position < 256 XXX */
+#define MS_INS_MASK 0x00ff /* mask to retrieve the instruction position */
#define MS_ARG_MASK 0x0f00 /* mask to retrieve the argument number */
#define MS_TYP_MASK 0xf000 /* mask to retrieve the type of the param */
diff --git a/sys/dev/ppbus/ppbconf.c b/sys/dev/ppbus/ppbconf.c
index 01ac663a22528..86ebe024e6066 100644
--- a/sys/dev/ppbus/ppbconf.c
+++ b/sys/dev/ppbus/ppbconf.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1997, 1998, 1999 Nicolas Souchu
+ * Copyright (c) 1997, 1998 Nicolas Souchu
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,12 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppbconf.c,v 1.12 1999/01/11 21:22:41 nsouch Exp $
+ * $Id: ppbconf.c,v 1.7 1998/09/13 18:26:26 nsouch Exp $
*
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
#include <vm/vm.h>
@@ -37,8 +37,6 @@
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/ppb_1284.h>
-#include "opt_ppb_1284.h"
-
LIST_HEAD(, ppb_data) ppbdata; /* list of existing ppbus */
/*
@@ -82,30 +80,15 @@ ppb_alloc_bus(void)
return(ppb);
}
-#define PPB_PNP_PRINTER 0
-#define PPB_PNP_MODEM 1
-#define PPB_PNP_NET 2
-#define PPB_PNP_HDC 3
-#define PPB_PNP_PCMCIA 4
-#define PPB_PNP_MEDIA 5
-#define PPB_PNP_FDC 6
-#define PPB_PNP_PORTS 7
-#define PPB_PNP_SCANNER 8
-#define PPB_PNP_DIGICAM 9
-
-#ifndef DONTPROBE_1284
-
static char *pnp_tokens[] = {
"PRINTER", "MODEM", "NET", "HDC", "PCMCIA", "MEDIA",
"FDC", "PORTS", "SCANNER", "DIGICAM", "", NULL };
-#if 0
static char *pnp_classes[] = {
"printer", "modem", "network device",
"hard disk", "PCMCIA", "multimedia device",
"floppy disk", "ports", "scanner",
"digital camera", "unknown device", NULL };
-#endif
/*
* search_token()
@@ -151,40 +134,75 @@ search_token(char *str, int slen, char *token)
* Returns the class id. of the peripherial, -1 otherwise
*/
static int
-ppb_pnp_detect(struct ppb_data *ppb, struct ppb_device *pnpdev)
+ppb_pnp_detect(struct ppb_data *ppb)
{
- char *token, *class = 0;
+ char *token, *q, *class = 0;
int i, len, error;
int class_id = -1;
char str[PPB_PnP_STRING_SIZE+1];
+ struct ppb_device pnpdev; /* temporary device to perform I/O */
- printf("Probing for PnP devices on ppbus%d:\n",
+ /* initialize the pnpdev structure for future use */
+ bzero(&pnpdev, sizeof(pnpdev));
+
+ pnpdev.ppb = ppb;
+
+ if (bootverbose)
+ printf("ppb: <PnP> probing devices on ppbus %d...\n",
ppb->ppb_link->adapter_unit);
-
- if ((error = ppb_1284_read_id(pnpdev, PPB_NIBBLE, str,
- PPB_PnP_STRING_SIZE, &len)))
+
+ if (ppb_request_bus(&pnpdev, PPB_DONTWAIT)) {
+ if (bootverbose)
+ printf("ppb: <PnP> cannot allocate ppbus!\n");
+ return (-1);
+ }
+
+ if ((error = ppb_1284_negociate(&pnpdev, NIBBLE_1284_REQUEST_ID))) {
+ if (bootverbose)
+ printf("ppb: <PnP> ppb_1284_negociate()=%d\n", error);
+
goto end_detect;
+ }
+
+ len = 0;
+ for (q=str; !(ppb_rstr(&pnpdev) & PERROR); q++) {
+ if ((error = nibble_1284_inbyte(&pnpdev, q))) {
+ if (bootverbose) {
+ *q = '\0';
+ printf("ppb: <PnP> len=%d, %s\n", len, str);
+ printf("ppb: <PnP> nibble_1284_inbyte()=%d\n",
+ error);
+ }
+ goto end_detect;
+ }
-#ifdef DEBUG_1284
- printf("ppb: <PnP> %d characters: ", len);
- for (i = 0; i < len; i++)
- printf("%c(0x%x) ", str[i], str[i]);
- printf("\n");
-#endif
+ if (len++ >= PPB_PnP_STRING_SIZE) {
+ printf("ppb: <PnP> not space left!\n");
+ goto end_detect;
+ }
+ }
+ *q = '\0';
+
+ nibble_1284_sync(&pnpdev);
+
+ if (bootverbose) {
+ printf("ppb: <PnP> %d characters: ", len);
+ for (i = 0; i < len; i++)
+ printf("0x%x ", str[i]);
+ printf("\n");
+ }
/* replace ';' characters by '\0' */
for (i = 0; i < len; i++)
str[i] = (str[i] == ';') ? '\0' : str[i];
- if ((token = search_token(str, len, "MFG")) != NULL ||
- (token = search_token(str, len, "MANUFACTURER")) != NULL)
+ if ((token = search_token(str, len, "MFG")) != NULL)
printf("ppbus%d: <%s", ppb->ppb_link->adapter_unit,
search_token(token, UNKNOWN_LENGTH, ":") + 1);
else
printf("ppbus%d: <unknown", ppb->ppb_link->adapter_unit);
- if ((token = search_token(str, len, "MDL")) != NULL ||
- (token = search_token(str, len, "MODEL")) != NULL)
+ if ((token = search_token(str, len, "MDL")) != NULL)
printf(" %s",
search_token(token, UNKNOWN_LENGTH, ":") + 1);
else
@@ -205,8 +223,7 @@ ppb_pnp_detect(struct ppb_data *ppb, struct ppb_device *pnpdev)
printf(" %s", class);
}
- if ((token = search_token(str, len, "CMD")) != NULL ||
- (token = search_token(str, len, "COMMAND")) != NULL)
+ if ((token = search_token(str, len, "CMD")) != NULL)
printf(" %s",
search_token(token, UNKNOWN_LENGTH, ":") + 1);
@@ -224,120 +241,13 @@ ppb_pnp_detect(struct ppb_data *ppb, struct ppb_device *pnpdev)
class_id = PPB_PnP_UNKNOWN;
end_detect:
- return (class_id);
-}
-
-/*
- * ppb_scan_bus()
- *
- * Scan the ppbus for IEEE1284 compliant devices
- */
-static int
-ppb_scan_bus(struct ppb_data *ppb)
-{
- struct ppb_device pnpdev; /* temporary device to perform I/O */
- int error = 0;
-
- /* initialize the pnpdev structure for future use */
- bzero(&pnpdev, sizeof(pnpdev));
- pnpdev.ppb = ppb;
-
- if ((error = ppb_request_bus(&pnpdev, PPB_DONTWAIT))) {
- if (bootverbose)
- printf("ppb: cannot allocate ppbus!\n");
-
- return (error);
- }
-
- /* try all IEEE1284 modes, for one device only
- *
- * XXX We should implement the IEEE1284.3 standard to detect
- * daisy chained devices
- */
-
- error = ppb_1284_negociate(&pnpdev, PPB_NIBBLE, PPB_REQUEST_ID);
+ if ((error = ppb_1284_terminate(&pnpdev, VALID_STATE)) && bootverbose)
+ printf("ppb: ppb_1284_terminate()=%d\n", error);
- if ((ppb->state == PPB_ERROR) && (ppb->error == PPB_NOT_IEEE1284))
- goto end_scan;
-
- ppb_1284_terminate(&pnpdev);
-
- printf("ppb%d: IEEE1284 device found ", ppb->ppb_link->adapter_unit);
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_NIBBLE, 0))) {
- printf("/NIBBLE");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_PS2, 0))) {
- printf("/PS2");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP, 0))) {
- printf("/ECP");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP, PPB_USE_RLE))) {
- printf("/ECP_RLE");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_EPP, 0))) {
- printf("/EPP");
- ppb_1284_terminate(&pnpdev);
- }
-
- /* try more IEEE1284 modes */
- if (bootverbose) {
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_NIBBLE,
- PPB_REQUEST_ID))) {
- printf("/NIBBLE_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_PS2,
- PPB_REQUEST_ID))) {
- printf("/PS2_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP,
- PPB_REQUEST_ID))) {
- printf("/ECP_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_ECP,
- PPB_REQUEST_ID | PPB_USE_RLE))) {
- printf("/ECP_RLE_ID");
- ppb_1284_terminate(&pnpdev);
- }
-
- if (!(error = ppb_1284_negociate(&pnpdev, PPB_COMPATIBLE,
- PPB_EXTENSIBILITY_LINK))) {
- printf("/Extensibility Link");
- ppb_1284_terminate(&pnpdev);
- }
- }
-
- printf("\n");
-
- /* detect PnP devices */
- ppb->class_id = ppb_pnp_detect(ppb, &pnpdev);
-
- ppb_release_bus(&pnpdev);
-
- return (0);
-
-end_scan:
ppb_release_bus(&pnpdev);
- return (error);
+ return (class_id);
}
-#endif /* !DONTPROBE_1284 */
-
/*
* ppb_attachdevs()
*
@@ -347,16 +257,18 @@ end_scan:
int
ppb_attachdevs(struct ppb_data *ppb)
{
+ int error;
struct ppb_device *dev;
struct ppb_driver **p_drvpp, *p_drvp;
LIST_INIT(&ppb->ppb_devs); /* initialise device/driver list */
p_drvpp = (struct ppb_driver **)ppbdriver_set.ls_items;
-#ifndef DONTPROBE_1284
- /* detect IEEE1284 compliant devices */
- ppb_scan_bus(ppb);
-#endif /* !DONTPROBE_1284 */
+/* XXX wait for ieee1284 good support */
+#if 0
+ /* detect PnP devices */
+ ppb->class_id = ppb_pnp_detect(ppb);
+#endif
/*
* Blindly try all probes here. Later we should look at
diff --git a/sys/dev/ppbus/ppbconf.h b/sys/dev/ppbus/ppbconf.h
index c47e4ab7d04dd..80efe282a62b3 100644
--- a/sys/dev/ppbus/ppbconf.h
+++ b/sys/dev/ppbus/ppbconf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppbconf.h,v 1.10 1999/01/10 12:04:55 nsouch Exp $
+ * $Id: ppbconf.h,v 1.8 1998/09/13 18:26:26 nsouch Exp $
*
*/
#ifndef __PPBCONF_H
@@ -47,12 +47,7 @@
#define PPB_EPP 0x4 /* EPP mode, 32 bit */
#define PPB_ECP 0x8 /* ECP mode */
-/* mode aliases */
-#define PPB_SPP PPB_NIBBLE|PPB_PS2
-#define PPB_BYTE PPB_PS2
-
-#define PPB_MASK 0x0f
-#define PPB_OPTIONS_MASK 0xf0
+#define PPB_SPP PPB_NIBBLE|PPB_PS2
#define PPB_IS_EPP(mode) (mode & PPB_EPP)
#define PPB_IN_EPP_MODE(dev) (PPB_IS_EPP (ppb_get_mode (dev)))
@@ -108,8 +103,6 @@ struct ppb_status {
#define PPB_NOINTR 0
#define PPB_WAIT 0x1
#define PPB_INTR 0x2
-#define PPB_POLL 0x4
-#define PPB_FOREVER -1
/*
* Microsequence stuff.
@@ -151,14 +144,14 @@ struct ppb_context {
struct microseq *curmsq; /* currently executed microseqence */
};
+
struct ppb_device {
int id_unit; /* unit of the device */
char *name; /* name of the device */
ushort mode; /* current mode of the device */
- ushort avm; /* available IEEE1284 modes of
- * the device */
+ ushort avm; /* available modes of the device */
struct ppb_context ctx; /* context of the device */
@@ -191,8 +184,6 @@ struct ppb_adapter {
int (*exec_microseq)(int, struct ppb_microseq **);
int (*setmode)(int, int);
- int (*read)(int, char *, int, int);
- int (*write)(int, char *, int, int);
void (*outsb_epp)(int, char *, int);
void (*outsw_epp)(int, char *, int);
@@ -201,12 +192,12 @@ struct ppb_adapter {
void (*insw_epp)(int, char *, int);
void (*insl_epp)(int, char *, int);
- u_char (*r_dtr)(int);
- u_char (*r_str)(int);
- u_char (*r_ctr)(int);
- u_char (*r_epp)(int);
- u_char (*r_ecr)(int);
- u_char (*r_fifo)(int);
+ char (*r_dtr)(int);
+ char (*r_str)(int);
+ char (*r_ctr)(int);
+ char (*r_epp)(int);
+ char (*r_ecr)(int);
+ char (*r_fifo)(int);
void (*w_dtr)(int, char);
void (*w_str)(int, char);
@@ -239,7 +230,7 @@ struct ppb_link {
/*
* Maximum size of the PnP info string
*/
-#define PPB_PnP_STRING_SIZE 256 /* XXX */
+#define PPB_PnP_STRING_SIZE 128 /* XXX */
/*
* Parallel Port Bus structure.
@@ -259,11 +250,10 @@ struct ppb_data {
#define PPB_PnP_UNKNOWN 10
int class_id; /* not a PnP device if class_id < 0 */
- int state; /* current IEEE1284 state */
- int error; /* last IEEE1284 error */
-
ushort mode; /* IEEE 1284-1994 mode
* NIBBLE, PS2, EPP or ECP */
+ ushort avm; /* IEEE 1284-1994 available
+ * modes */
struct ppb_link *ppb_link; /* link to the adapter */
struct ppb_device *ppb_owner; /* device which owns the bus */
@@ -304,7 +294,6 @@ extern int ppb_ecp_sync(struct ppb_device *);
extern int ppb_get_status(struct ppb_device *, struct ppb_status *);
extern int ppb_set_mode(struct ppb_device *, int);
-extern int ppb_write(struct ppb_device *, char *, int, int);
/*
* These are defined as macros for speedup.
diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c
index e0072f3e4cda8..f742e4b56fae5 100644
--- a/sys/dev/ppbus/ppi.c
+++ b/sys/dev/ppbus/ppi.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppi.c,v 1.8 1998/12/07 21:58:16 archie Exp $
+ * $Id: ppi.c,v 1.6 1998/01/02 09:30:39 msmith Exp $
*
*/
#include "ppi.h"
@@ -34,35 +34,18 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#include <sys/uio.h>
#include <sys/malloc.h>
#include <sys/fcntl.h>
-#include <machine/clock.h>
-
#include <dev/ppbus/ppbconf.h>
-#include <dev/ppbus/ppb_msq.h>
-
-#include "opt_ppb_1284.h"
-
-#ifdef PERIPH_1284
-#include <dev/ppbus/ppb_1284.h>
-#endif
-
#include <dev/ppbus/ppi.h>
-#define BUFSIZE 512
struct ppi_data {
int ppi_unit;
int ppi_flags;
#define HAVE_PPBUS (1<<0)
-#define HAD_PPBUS (1<<1)
-
- int ppi_count;
- int ppi_mode; /* IEEE1284 mode */
- char ppi_buffer[BUFSIZE];
struct ppb_device ppi_dev;
};
@@ -87,41 +70,13 @@ DATA_SET(ppbdriver_set, ppidriver);
static d_open_t ppiopen;
static d_close_t ppiclose;
static d_ioctl_t ppiioctl;
-static d_write_t ppiwrite;
-static d_read_t ppiread;
#define CDEV_MAJOR 82
static struct cdevsw ppi_cdevsw =
- { ppiopen, ppiclose, ppiread, ppiwrite, /* 82 */
+ { ppiopen, ppiclose, noread, nowrite, /* 82 */
ppiioctl, nullstop, nullreset, nodevtotty,
seltrue, nommap, nostrat, "ppi", NULL, -1 };
-#ifdef PERIPH_1284
-
-static void
-ppi_enable_intr(struct ppi_data *ppi)
-{
- char r;
-
- r = ppb_rctr(&ppi->ppi_dev);
- ppb_wctr(&ppi->ppi_dev, r | IRQENABLE);
-
- return;
-}
-
-static void
-ppi_disable_intr(struct ppi_data *ppi)
-{
- char r;
-
- r = ppb_rctr(&ppi->ppi_dev);
- ppb_wctr(&ppi->ppi_dev, r & ~IRQENABLE);
-
- return;
-}
-
-#endif /* PERIPH_1284 */
-
/*
* ppiprobe()
*/
@@ -161,6 +116,8 @@ ppiprobe(struct ppb_data *ppb)
static int
ppiattach(struct ppb_device *dev)
{
+ struct ppi_data *ppi = ppidata[dev->id_unit];
+
/*
* Report ourselves
*/
@@ -170,72 +127,9 @@ ppiattach(struct ppb_device *dev)
return (1);
}
-/*
- * Cable
- * -----
- *
- * Use an IEEE1284 compliant (DB25/DB25) cable with the following tricks:
- *
- * nStrobe <-> nAck 1 <-> 10
- * nAutofd <-> Busy 11 <-> 14
- * nSelectin <-> Select 17 <-> 13
- * nInit <-> nFault 15 <-> 16
- *
- */
static void
ppiintr(int unit)
{
-#ifdef PERIPH_1284
- struct ppi_data *ppi = ppidata[unit];
-
- ppi_disable_intr(ppi);
-
- switch (ppi->ppi_dev.ppb->state) {
-
- /* accept IEEE1284 negociation then wakeup an waiting process to
- * continue negociation at process level */
- case PPB_FORWARD_IDLE:
- /* Event 1 */
- if ((ppb_rstr(&ppi->ppi_dev) & (SELECT | nBUSY)) ==
- (SELECT | nBUSY)) {
- /* IEEE1284 negociation */
-#ifdef DEBUG_1284
- printf("N");
-#endif
-
- /* Event 2 - prepare for reading the ext. value */
- ppb_wctr(&ppi->ppi_dev, (PCD | STROBE | nINIT) & ~SELECTIN);
-
- ppi->ppi_dev.ppb->state = PPB_NEGOCIATION;
-
- } else {
-#ifdef DEBUG_1284
- printf("0x%x", ppb_rstr(&ppi->ppi_dev));
-#endif
- ppb_peripheral_terminate(&ppi->ppi_dev, PPB_DONTWAIT);
- break;
- }
-
- /* wake up any process waiting for negociation from
- * remote master host */
-
- /* XXX should set a variable to warn the process about
- * the interrupt */
-
- wakeup(ppi);
- break;
- default:
-#ifdef DEBUG_1284
- printf("?%d", ppi->ppi_dev.ppb->state);
-#endif
- ppi->ppi_dev.ppb->state = PPB_FORWARD_IDLE;
- ppb_set_mode(&ppi->ppi_dev, PPB_COMPATIBLE);
- break;
- }
-
- ppi_enable_intr(ppi);
-#endif /* PERIPH_1284 */
-
return;
}
@@ -249,16 +143,11 @@ ppiopen(dev_t dev, int flags, int fmt, struct proc *p)
if (unit >= nppi)
return (ENXIO);
- if (!(ppi->ppi_flags & HAVE_PPBUS)) {
- if ((res = ppb_request_bus(&ppi->ppi_dev,
- (flags & O_NONBLOCK) ? PPB_DONTWAIT :
- (PPB_WAIT | PPB_INTR))))
+ if (!(ppi->ppi_flags & HAVE_PPBUS))
+ if ((res = ppb_request_bus(&ppi->ppi_dev, (flags & O_NONBLOCK) ? PPB_DONTWAIT : (PPB_WAIT | PPB_INTR))))
return (res);
- ppi->ppi_flags |= HAVE_PPBUS;
- }
- ppi->ppi_count += 1;
-
+ ppi->ppi_flags |= HAVE_PPBUS;
return (0);
}
@@ -268,206 +157,12 @@ ppiclose(dev_t dev, int flags, int fmt, struct proc *p)
u_int unit = minor(dev);
struct ppi_data *ppi = ppidata[unit];
- ppi->ppi_count --;
- if (!ppi->ppi_count) {
-
-#ifdef PERIPH_1284
- switch (ppi->ppi_dev.ppb->state) {
- case PPB_PERIPHERAL_IDLE:
- ppb_peripheral_terminate(&ppi->ppi_dev, 0);
- break;
- case PPB_REVERSE_IDLE:
- case PPB_EPP_IDLE:
- case PPB_ECP_FORWARD_IDLE:
- default:
- ppb_1284_terminate(&ppi->ppi_dev);
- break;
- }
-#endif /* PERIPH_1284 */
-
+ if (ppi->ppi_flags & HAVE_PPBUS)
ppb_release_bus(&ppi->ppi_dev);
- ppi->ppi_flags &= ~HAVE_PPBUS;
- }
-
+ ppi->ppi_flags &= ~HAVE_PPBUS;
return (0);
}
-/*
- * ppiread()
- *
- * IEEE1284 compliant read.
- *
- * First, try negociation to BYTE then NIBBLE mode
- * If no data is available, wait for it otherwise transfer as much as possible
- */
-static int
-ppiread(dev_t dev, struct uio *uio, int ioflag)
-{
-#ifdef PERIPH_1284
- u_int unit = minor(dev);
- struct ppi_data *ppi = ppidata[unit];
- int len, error = 0;
-
- switch (ppi->ppi_dev.ppb->state) {
- case PPB_PERIPHERAL_IDLE:
- ppb_peripheral_terminate(&ppi->ppi_dev, 0);
- /* fall throught */
-
- case PPB_FORWARD_IDLE:
- /* if can't negociate NIBBLE mode then try BYTE mode,
- * the peripheral may be a computer
- */
- if ((ppb_1284_negociate(&ppi->ppi_dev,
- ppi->ppi_mode = PPB_NIBBLE, 0))) {
-
- /* XXX Wait 2 seconds to let the remote host some
- * time to terminate its interrupt
- */
- tsleep(ppi, PPBPRI, "ppiread", 2*hz);
-
- if ((error = ppb_1284_negociate(&ppi->ppi_dev,
- ppi->ppi_mode = PPB_BYTE, 0)))
- return (error);
- }
- break;
-
- case PPB_REVERSE_IDLE:
- case PPB_EPP_IDLE:
- case PPB_ECP_FORWARD_IDLE:
- default:
- break;
- }
-
-#ifdef DEBUG_1284
- printf("N");
-#endif
- /* read data */
- len = 0;
- while (uio->uio_resid) {
- if ((error = ppb_1284_read(&ppi->ppi_dev, ppi->ppi_mode,
- ppi->ppi_buffer, min(BUFSIZE, uio->uio_resid),
- &len))) {
- goto error;
- }
-
- if (!len)
- goto error; /* no more data */
-
-#ifdef DEBUG_1284
- printf("d");
-#endif
- if ((error = uiomove(ppi->ppi_buffer, len, uio)))
- goto error;
- }
-
-error:
-
-#else /* PERIPH_1284 */
- int error = ENODEV;
-#endif
-
- return (error);
-}
-
-/*
- * ppiwrite()
- *
- * IEEE1284 compliant write
- *
- * Actually, this is the peripheral side of a remote IEEE1284 read
- *
- * The first part of the negociation (IEEE1284 device detection) is
- * done at interrupt level, then the remaining is done by the writing
- * process
- *
- * Once negociation done, transfer data
- */
-static int
-ppiwrite(dev_t dev, struct uio *uio, int ioflag)
-{
-#ifdef PERIPH_1284
- u_int unit = minor(dev);
- struct ppi_data *ppi = ppidata[unit];
- struct ppb_data *ppb = ppi->ppi_dev.ppb;
- int len, error = 0, sent;
-
-#if 0
- int ret;
-
- #define ADDRESS MS_PARAM(0, 0, MS_TYP_PTR)
- #define LENGTH MS_PARAM(0, 1, MS_TYP_INT)
-
- struct ppb_microseq msq[] = {
- { MS_OP_PUT, { MS_UNKNOWN, MS_UNKNOWN, MS_UNKNOWN } },
- MS_RET(0)
- };
-
- /* negociate ECP mode */
- if (ppb_1284_negociate(&ppi->ppi_dev, PPB_ECP, 0)) {
- printf("ppiwrite: ECP negociation failed\n");
- }
-
- while (!error && (len = min(uio->uio_resid, BUFSIZE))) {
- uiomove(ppi->ppi_buffer, len, uio);
-
- ppb_MS_init_msq(msq, 2, ADDRESS, ppi->ppi_buffer, LENGTH, len);
-
- error = ppb_MS_microseq(&ppi->ppi_dev, msq, &ret);
- }
-#endif
-
- /* we have to be peripheral to be able to send data, so
- * wait for the appropriate state
- */
- if (ppb->state < PPB_PERIPHERAL_NEGOCIATION)
- ppb_1284_terminate(&ppi->ppi_dev);
-
- while (ppb->state != PPB_PERIPHERAL_IDLE) {
- /* XXX should check a variable before sleeping */
-#ifdef DEBUG_1284
- printf("s");
-#endif
-
- ppi_enable_intr(ppi);
-
- /* sleep until IEEE1284 negociation starts */
- error = tsleep(ppi, PCATCH | PPBPRI, "ppiwrite", 0);
-
- switch (error) {
- case 0:
- /* negociate peripheral side with BYTE mode */
- ppb_peripheral_negociate(&ppi->ppi_dev, PPB_BYTE, 0);
- break;
- case EWOULDBLOCK:
- break;
- default:
- goto error;
- }
- }
-#ifdef DEBUG_1284
- printf("N");
-#endif
-
- /* negociation done, write bytes to master host */
- while (len = min(uio->uio_resid, BUFSIZE)) {
- uiomove(ppi->ppi_buffer, len, uio);
- if ((error = byte_peripheral_write(&ppi->ppi_dev,
- ppi->ppi_buffer, len, &sent)))
- goto error;
-#ifdef DEBUG_1284
- printf("d");
-#endif
- }
-
-error:
-
-#else /* PERIPH_1284 */
- int error = ENODEV;
-#endif
-
- return (error);
-}
-
static int
ppiioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
@@ -515,6 +210,7 @@ ppiioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
case PPISFIFO: /* write FIFO */
ppb_wfifo(&ppi->ppi_dev, *val);
break;
+
default:
error = ENOTTY;
break;
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index 95b255cb1bb31..9d1f20d9e04bc 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: pps.c,v 1.11 1998/08/24 16:31:27 phk Exp $
+ * $Id: pps.c,v 1.10 1998/08/03 19:14:31 msmith Exp $
*
* This driver implements a draft-mogul-pps-api-02.txt PPS source.
*
@@ -153,6 +153,7 @@ ppsintr(int unit)
{
struct pps_data *sc = softc[unit];
struct timespec tc;
+ struct timeval tv;
nanotime(&tc);
if (!(ppb_rstr(&sc->pps_dev) & nACK))
@@ -170,8 +171,6 @@ ppsintr(int unit)
sc->ppsinfo.assert_sequence++;
#ifdef PPS_SYNC
if (sc->ppsparam.mode & PPS_HARDPPSONASSERT) {
- struct timeval tv;
-
tv.tv_sec = tc.tv_sec;
tv.tv_usec = tc.tv_nsec / 1000;
hardpps(&tv, tv.tv_usec);
diff --git a/sys/dev/ppbus/vpo.c b/sys/dev/ppbus/vpo.c
index 17b67c5f632d7..0585a497cd9b3 100644
--- a/sys/dev/ppbus/vpo.c
+++ b/sys/dev/ppbus/vpo.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vpo.c,v 1.10 1999/01/09 18:05:46 nsouch Exp $
+ * $Id: vpo.c,v 1.4 1997/09/01 00:51:52 bde Exp $
*
*/
@@ -51,8 +51,6 @@
#include <sys/kernel.h>
#endif /*KERNEL */
-#include "opt_vpo.h"
-
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/vpoio.h>
@@ -159,6 +157,7 @@ vpoprobe(struct ppb_data *ppb)
static int
vpoattach(struct ppb_device *dev)
{
+ struct scsibus_data *scbus;
struct vpo_data *vpo = vpodata[dev->id_unit];
struct cam_devq *devq;
@@ -212,11 +211,9 @@ vpoattach(struct ppb_device *dev)
static void
vpo_intr(struct vpo_data *vpo, struct ccb_scsiio *csio)
{
- int errno; /* error in errno.h */
+
+ int i, errno; /* error in errno.h */
int s;
-#ifdef VP0_DEBUG
- int i;
-#endif
s = splcam();
@@ -413,10 +410,6 @@ vpo_action(struct cam_sim *sim, union ccb *ccb)
printf("vpo%d: XPT_PATH_INQ request\n", vpo->vpo_unit);
#endif
cpi->version_num = 1; /* XXX??? */
- cpi->hba_inquiry = 0;
- cpi->target_sprt = 0;
- cpi->hba_misc = 0;
- cpi->hba_eng_cnt = 0;
cpi->max_target = 7;
cpi->max_lun = 0;
cpi->initiator_id = VP0_INITIATOR;
diff --git a/sys/dev/ppbus/vpoio.c b/sys/dev/ppbus/vpoio.c
index 54791ee44dcc7..a416efefb8ef9 100644
--- a/sys/dev/ppbus/vpoio.c
+++ b/sys/dev/ppbus/vpoio.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vpoio.c,v 1.4 1998/12/07 21:58:16 archie Exp $
+ * $Id: vpoio.c,v 1.2 1998/09/13 18:26:26 nsouch Exp $
*
*/
@@ -41,8 +41,6 @@
#include <sys/kernel.h>
#endif /*KERNEL */
-#include "opt_vpo.h"
-
#include <dev/ppbus/ppbconf.h>
#include <dev/ppbus/ppb_msq.h>
#include <dev/ppbus/vpoio.h>
@@ -286,13 +284,8 @@ vpoio_connect(struct vpoio_data *vpo, int how)
int error;
int ret;
- if ((error = ppb_request_bus(&vpo->vpo_dev, how))) {
-
-#ifdef VP0_DEBUG
- printf("%s: can't request bus!\n", __FUNCTION__);
-#endif
+ if ((error = ppb_request_bus(&vpo->vpo_dev, how)))
return error;
- }
if (PPB_IN_EPP_MODE(&vpo->vpo_dev))
ppb_MS_microseq(&vpo->vpo_dev, connect_epp_microseq, &ret);
@@ -444,8 +437,8 @@ vpoio_outstr(struct vpoio_data *vpo, char *buffer, int size)
ppb_wctr(&vpo->vpo_dev,
H_AUTO | H_nSELIN | H_INIT | H_STROBE);
}
+ /* ppb_ecp_sync(&vpo->vpo_dev); */
#endif
- ppb_ecp_sync(&vpo->vpo_dev);
return (error);
}
@@ -456,7 +449,10 @@ vpoio_outstr(struct vpoio_data *vpo, char *buffer, int size)
static int
vpoio_instr(struct vpoio_data *vpo, char *buffer, int size)
{
+
+ register int k;
int error = 0;
+ int r, mode, epp;
ppb_MS_exec(&vpo->vpo_dev, MS_OP_GET, buffer, size, MS_UNKNOWN, &error);
@@ -483,8 +479,8 @@ vpoio_instr(struct vpoio_data *vpo, char *buffer, int size)
ppb_wctr(&vpo->vpo_dev, PCD |
H_AUTO | H_nSELIN | H_INIT | H_STROBE);
}
+ /* ppb_ecp_sync(&vpo->vpo_dev); */
#endif
- ppb_ecp_sync(&vpo->vpo_dev);
return (error);
}
@@ -492,6 +488,7 @@ vpoio_instr(struct vpoio_data *vpo, char *buffer, int size)
static char
vpoio_select(struct vpoio_data *vpo, int initiator, int target)
{
+ register int k;
int ret;
struct ppb_microseq select_microseq[] = {
@@ -708,10 +705,6 @@ vpoio_reset_bus(struct vpoio_data *vpo)
{
/* first, connect to the drive */
if (vpoio_connect(vpo, PPB_WAIT|PPB_INTR) || !vpoio_in_disk_mode(vpo)) {
-
-#ifdef VP0_DEBUG
- printf("%s: not in disk mode!\n", __FUNCTION__);
-#endif
/* release ppbus */
vpoio_disconnect(vpo);
return (1);
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index b5d29194430eb..94719fb83ad68 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smb.c,v 1.5 1999/01/09 18:08:23 nsouch Exp $
+ * $Id: smb.c,v 1.2 1998/09/04 17:53:42 nsouch Exp $
*
*/
#include <sys/param.h>
@@ -119,6 +119,8 @@ smb_probe(device_t dev)
static int
smb_attach(device_t dev)
{
+ struct smb_softc *sc = (struct smb_softc *)device_get_softc(dev);
+
return (0);
}
@@ -157,9 +159,24 @@ smbclose(dev_t dev, int flags, int fmt, struct proc *p)
static int
smbwrite(dev_t dev, struct uio * uio, int ioflag)
{
- /* not supported */
+ device_t smbdev = IIC_DEVICE(minor(dev));
+ struct smb_softc *sc = IIC_SOFTC(minor(dev));
+ int error, count;
- return (EINVAL);
+ if (!sc || !smbdev)
+ return (EINVAL);
+
+ if (sc->sc_count == 0)
+ return (EINVAL);
+
+ count = min(uio->uio_resid, BUFSIZE);
+ uiomove(sc->sc_buffer, count, uio);
+
+ /* we consider the command char as the first character to send */
+ smbus_bwrite(device_get_parent(smbdev), sc->sc_addr,
+ sc->sc_buffer[0], count-1, sc->sc_buffer+1);
+
+ return (0);
}
static int
@@ -180,62 +197,65 @@ smbioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
int error = 0;
struct smbcmd *s = (struct smbcmd *)data;
- if (!sc || !s)
+ if (!sc)
return (EINVAL);
switch (cmd) {
case SMB_QUICK_WRITE:
- error=smbus_quick(parent, s->slave, SMB_QWRITE);
+ smbus_quick(parent, sc->sc_addr, SMB_QWRITE);
goto end;
case SMB_QUICK_READ:
- error=smbus_quick(parent, s->slave, SMB_QREAD);
+ smbus_quick(parent, sc->sc_addr, SMB_QREAD);
goto end;
};
+ if (!s)
+ return (EINVAL);
+
switch (cmd) {
case SMB_SENDB:
- error=smbus_sendb(parent, s->slave, s->cmd);
+ smbus_sendb(parent, sc->sc_addr, s->cmd);
break;
case SMB_RECVB:
- error=smbus_recvb(parent, s->slave, &s->cmd);
+ smbus_recvb(parent, sc->sc_addr, &s->cmd);
break;
case SMB_WRITEB:
- error=smbus_writeb(parent, s->slave, s->cmd, s->data.byte);
+ smbus_writeb(parent, sc->sc_addr, s->cmd, s->data.byte);
break;
case SMB_WRITEW:
- error=smbus_writew(parent, s->slave, s->cmd, s->data.word);
+ smbus_writew(parent, sc->sc_addr, s->cmd, s->data.word);
break;
case SMB_READB:
if (s->data.byte_ptr)
- error=smbus_readb(parent, s->slave, s->cmd,
+ smbus_readb(parent, sc->sc_addr, s->cmd,
s->data.byte_ptr);
break;
case SMB_READW:
if (s->data.word_ptr)
- error=smbus_readw(parent, s->slave, s->cmd, s->data.word_ptr);
+ smbus_readw(parent, sc->sc_addr, s->cmd, s->data.word_ptr);
break;
case SMB_PCALL:
if (s->data.process.rdata)
- error=smbus_pcall(parent, s->slave, s->cmd,
+ smbus_pcall(parent, sc->sc_addr, s->cmd,
s->data.process.sdata, s->data.process.rdata);
break;
case SMB_BWRITE:
if (s->count && s->data.byte_ptr)
- error=smbus_bwrite(parent, s->slave, s->cmd, s->count,
+ smbus_bwrite(parent, sc->sc_addr, s->cmd, s->count,
s->data.byte_ptr);
break;
case SMB_BREAD:
if (s->count && s->data.byte_ptr)
- error=smbus_bread(parent, s->slave, s->cmd, s->count,
+ smbus_bread(parent, sc->sc_addr, s->cmd, s->count,
s->data.byte_ptr);
break;
diff --git a/sys/dev/smbus/smbconf.c b/sys/dev/smbus/smbconf.c
index 458916f8e8e8e..60798f5c82ddb 100644
--- a/sys/dev/smbus/smbconf.c
+++ b/sys/dev/smbus/smbconf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbconf.c,v 1.3 1998/11/22 22:01:42 nsouch Exp $
+ * $Id: smbconf.c,v 1.1.1.2 1998/08/13 15:16:57 son Exp $
*
*/
#include <sys/param.h>
@@ -65,29 +65,10 @@ smbus_alloc_bus(device_t parent)
/* add the bus to the parent */
child = device_add_child(parent, "smbus", -1, NULL);
- return (child);
-}
-
-static int
-smbus_poll(struct smbus_softc *sc, int how)
-{
- int error;
-
- switch (how) {
- case (SMB_WAIT | SMB_INTR):
- error = tsleep(sc, SMBPRI|PCATCH, "smbreq", 0);
- break;
-
- case (SMB_WAIT | SMB_NOINTR):
- error = tsleep(sc, SMBPRI, "smbreq", 0);
- break;
-
- default:
- return (EWOULDBLOCK);
- break;
- }
+ if (child)
+ device_set_desc(child, "System Management Bus");
- return (error);
+ return (child);
}
/*
@@ -103,20 +84,25 @@ smbus_request_bus(device_t bus, device_t dev, int how)
struct smbus_softc *sc = (struct smbus_softc *)device_get_softc(bus);
int s, error = 0;
- /* first, ask the underlying layers if the request is ok */
- do {
- error = SMBUS_CALLBACK(device_get_parent(bus),
- SMB_REQUEST_BUS, (caddr_t)&how);
- if (error)
- error = smbus_poll(sc, how);
- } while (error);
-
while (!error) {
s = splhigh();
if (sc->owner) {
splx(s);
- error = smbus_poll(sc, how);
+ switch (how) {
+ case (SMB_WAIT | SMB_INTR):
+ error = tsleep(sc, SMBPRI|PCATCH, "smbreq", 0);
+ break;
+
+ case (SMB_WAIT | SMB_NOINTR):
+ error = tsleep(sc, SMBPRI, "smbreq", 0);
+ break;
+
+ default:
+ return (EWOULDBLOCK);
+ break;
+ }
+
} else {
sc->owner = dev;
@@ -137,13 +123,7 @@ int
smbus_release_bus(device_t bus, device_t dev)
{
struct smbus_softc *sc = (struct smbus_softc *)device_get_softc(bus);
- int s, error;
-
- /* first, ask the underlying layers if the release is ok */
- error = SMBUS_CALLBACK(device_get_parent(bus), SMB_RELEASE_BUS, NULL);
-
- if (error)
- return (error);
+ int s;
s = splhigh();
if (sc->owner != dev) {
@@ -168,7 +148,7 @@ smbus_release_bus(device_t bus, device_t dev)
u_char
smbus_get_addr(device_t dev)
{
- uintptr_t addr;
+ u_long addr;
device_t parent = device_get_parent(dev);
BUS_READ_IVAR(parent, dev, SMBUS_IVAR_ADDR, &addr);
diff --git a/sys/dev/smbus/smbconf.h b/sys/dev/smbus/smbconf.h
index 0a442ec9633ae..10fc3bcb011ca 100644
--- a/sys/dev/smbus/smbconf.h
+++ b/sys/dev/smbus/smbconf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbconf.h,v 1.1.1.1 1998/09/03 20:52:54 nsouch Exp $
+ * $Id: smbconf.h,v 1.1.1.2 1998/08/13 15:16:58 son Exp $
*/
#ifndef __SMBONF_H
#define __SMBONF_H
@@ -43,18 +43,10 @@
#define SMB_INTR 0x2
/*
- * callback index
- */
-#define SMB_REQUEST_BUS 0x1
-#define SMB_RELEASE_BUS 0x2
-
-/*
* SMB bus errors
*/
#define SMB_ENOERR 0x0
#define SMB_EBUSERR 0x1
-#define SMB_ENOTSUPP 0x2
-#define SMB_ENOACK 0x3
/*
* How Quick command is executed
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c
index ca067103c43e3..f9f787d3a4719 100644
--- a/sys/dev/smbus/smbus.c
+++ b/sys/dev/smbus/smbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbus.c,v 1.6 1998/12/28 19:07:51 nsouch Exp $
+ * $Id: smbus.c,v 1.1.1.2 1998/08/13 15:16:58 son Exp $
*
*/
#include <sys/param.h>
@@ -46,6 +46,7 @@
*/
struct smbus_device {
const char *smbd_name; /* device name */
+ const u_char smbd_addr; /* address of the device */
const char *smbd_desc; /* device descriptor */
};
@@ -53,7 +54,7 @@ struct smbus_device {
* list of known devices
*/
struct smbus_device smbus_children[] = {
- { "smb", "SMBus general purpose I/O" },
+ { "smb", 0, "General Call" },
{ NULL, 0 }
};
@@ -65,10 +66,7 @@ static devclass_t smbus_devclass;
static int smbus_probe(device_t);
static int smbus_attach(device_t);
static void smbus_print_child(device_t, device_t);
-
-#if 0
static int smbus_read_ivar(device_t , device_t, int, u_long *);
-#endif
static device_method_t smbus_methods[] = {
/* device interface */
@@ -79,8 +77,10 @@ static device_method_t smbus_methods[] = {
/* bus interface */
DEVMETHOD(bus_print_child, smbus_print_child),
- DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
+ DEVMETHOD(bus_read_ivar, smbus_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
+ DEVMETHOD(bus_create_intr, bus_generic_create_intr),
+ DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
{ 0, 0 }
};
@@ -100,7 +100,14 @@ static driver_t smbus_driver = {
static int
smbus_probe(device_t dev)
{
- device_set_desc(dev, "System Management Bus");
+ struct smbus_device *smbdev;
+ device_t child;
+
+ for (smbdev = smbus_children; smbdev->smbd_name; smbdev++) {
+
+ child = device_add_child(dev, smbdev->smbd_name, -1, smbdev);
+ device_set_desc(child, smbdev->smbd_desc);
+ }
return (0);
}
@@ -108,20 +115,10 @@ smbus_probe(device_t dev)
static int
smbus_attach(device_t dev)
{
- struct smbus_device *smbdev;
+ struct smbus_softc *sc = device_get_softc(dev);
+ device_t parent = device_get_parent(dev);
- /* add known devices */
- for (smbdev = smbus_children; smbdev->smbd_name; smbdev++) {
- device_t child;
-
- if (devclass_find(smbdev->smbd_name)) {
- child = device_add_child(dev, smbdev->smbd_name,
- -1, smbdev);
- device_set_desc(child, smbdev->smbd_desc);
- } else if (bootverbose)
- printf("smbus: %s devclass not found\n",
- smbdev->smbd_name);
- }
+ printf("Probing for devices on the SMB bus:\n");
bus_generic_attach(dev);
return (0);
@@ -136,27 +133,25 @@ smbus_generic_intr(device_t dev, u_char devaddr, char low, char high)
static void
smbus_print_child(device_t bus, device_t dev)
{
+ struct smbus_device* smbdev = DEVTOSMBUS(dev);
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
+ printf(" on %s%d addr 0x%x", device_get_name(bus),
+ device_get_unit(bus), smbdev->smbd_addr);
return;
}
-#if 0
static int
smbus_read_ivar(device_t bus, device_t dev, int index, u_long* result)
{
struct smbus_device* smbdev = DEVTOSMBUS(dev);
switch (index) {
- default:
+ case SMBUS_IVAR_ADDR:
+ *result = smbdev->smbd_addr;
break;
}
return (ENOENT);
}
-#endif
DRIVER_MODULE(smbus, iicsmb, smbus_driver, smbus_devclass, 0, 0);
-DRIVER_MODULE(smbus, bti2c, smbus_driver, smbus_devclass, 0, 0);
-DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0);
-DRIVER_MODULE(smbus, smbv, smbus_driver, smbus_devclass, 0, 0);
diff --git a/sys/dev/smbus/smbus_if.m b/sys/dev/smbus/smbus_if.m
index 3e118811b5b06..3c9ee5a0ecc1d 100644
--- a/sys/dev/smbus/smbus_if.m
+++ b/sys/dev/smbus/smbus_if.m
@@ -23,13 +23,13 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: smbus_if.m,v 1.3 1998/11/07 14:56:04 nsouch Exp $
+# $Id: smbus_if.m,v 1.1.1.2 1998/08/13 15:16:58 son Exp $
#
-INTERFACE smbus;
+INTERFACE smbus
#
-# Interpret interrupt
+# Interprete interrupt
#
METHOD void intr {
device_t dev;
@@ -40,15 +40,6 @@ METHOD void intr {
};
#
-# smbus callback
-#
-METHOD int callback {
- device_t dev;
- int index;
- caddr_t data;
-};
-
-#
# Quick command
#
METHOD int quick {
@@ -129,7 +120,7 @@ METHOD int pcall {
#
# Block Write command
#
-METHOD int bwrite {
+METHODE int bwrite {
device_t dev;
u_char slave;
char cmd;
@@ -140,7 +131,7 @@ METHOD int bwrite {
#
# Block Read command
#
-METHOD int bread {
+METHODE int bread {
device_t dev;
u_char slave;
char cmd;
diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c
deleted file mode 100644
index 8374028974709..0000000000000
--- a/sys/dev/syscons/scvidctl.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/*-
- * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: scvidctl.c,v 1.6 1999/01/11 03:18:26 yokota Exp $
- */
-
-#include "sc.h"
-#include "opt_syscons.h"
-
-#if NSC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/signalvar.h>
-#include <sys/tty.h>
-#include <sys/kernel.h>
-
-#ifdef __i386__
-#include <machine/apm_bios.h>
-#endif
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/syscons/syscons.h>
-
-/* for compatibility with previous versions */
-typedef struct old_video_adapter {
- int va_index;
- int va_type;
- int va_flags;
-#define V_ADP_COLOR (1<<0)
-#define V_ADP_MODECHANGE (1<<1)
-#define V_ADP_STATESAVE (1<<2)
-#define V_ADP_STATELOAD (1<<3)
-#define V_ADP_FONT (1<<4)
-#define V_ADP_PALETTE (1<<5)
-#define V_ADP_BORDER (1<<6)
-#define V_ADP_VESA (1<<7)
- int va_crtc_addr;
- u_int va_window; /* virtual address */
- size_t va_window_size;
- size_t va_window_gran;
- u_int va_buffer; /* virtual address */
- size_t va_buffer_size;
- int va_initial_mode;
- int va_initial_bios_mode;
- int va_mode;
-} old_video_adapter_t;
-
-#define OLD_CONS_ADPINFO _IOWR('c', 101, old_video_adapter_t)
-
-/* variables */
-extern scr_stat *cur_console;
-extern int fonts_loaded;
-extern int sc_history_size;
-extern u_char palette[];
-
-int
-sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
- int fontsize)
-{
- video_info_t info;
- int error;
- int s;
- int i;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
- return ENODEV;
-
- /* adjust argument values */
- if (fontsize <= 0)
- fontsize = info.vi_cheight;
- if (fontsize < 14) {
- fontsize = 8;
- if (!(fonts_loaded & FONT_8))
- return EINVAL;
- } else if (fontsize >= 16) {
- fontsize = 16;
- if (!(fonts_loaded & FONT_16))
- return EINVAL;
- } else {
- fontsize = 14;
- if (!(fonts_loaded & FONT_14))
- return EINVAL;
- }
- if ((xsize <= 0) || (xsize > info.vi_width))
- xsize = info.vi_width;
- if ((ysize <= 0) || (ysize > info.vi_height))
- ysize = info.vi_height;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- if (scp->history != NULL)
- i = imax(scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize), 0);
- else
- i = 0;
- /*
- * This is a kludge to fend off scrn_update() while we
- * muck around with scp. XXX
- */
- scp->status |= UNKNOWN_MODE;
- scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
- scp->mode = mode;
- scp->font_size = fontsize;
- scp->xsize = xsize;
- scp->ysize = ysize;
- scp->xoff = 0;
- scp->yoff = 0;
- scp->xpixel = scp->xsize*8;
- scp->ypixel = scp->ysize*fontsize;
-
- /* allocate buffers */
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
- sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
- splx(s);
-
- if (scp == cur_console)
- set_mode(scp);
- scp->status &= ~UNKNOWN_MODE;
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_col != scp->xsize
- || tp->t_winsize.ws_row != scp->ysize) {
- tp->t_winsize.ws_col = scp->xsize;
- tp->t_winsize.ws_row = scp->ysize;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
-{
- video_info_t info;
- int error;
- int s;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
- return ENODEV;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE);
- scp->status &= ~PIXEL_MODE;
- scp->mode = mode;
- scp->xoff = 0;
- scp->yoff = 0;
- scp->xpixel = info.vi_width;
- scp->ypixel = info.vi_height;
- scp->xsize = info.vi_width/8;
- scp->ysize = info.vi_height/info.vi_cheight;
- scp->font_size = FONT_NONE;
- /* move the mouse cursor at the center of the screen */
- sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
- splx(s);
-
- if (scp == cur_console)
- set_mode(scp);
- /* clear_graphics();*/
- scp->status &= ~UNKNOWN_MODE;
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_xpixel != scp->xpixel
- || tp->t_winsize.ws_ypixel != scp->ypixel) {
- tp->t_winsize.ws_xpixel = scp->xpixel;
- tp->t_winsize.ws_ypixel = scp->ypixel;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
- int fontsize)
-{
- video_info_t info;
- int error;
- int s;
- int i;
-
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
- return ENODEV; /* this shouldn't happen */
-
-#ifdef SC_VIDEO_DEBUG
- if (scp->scr_buf != NULL) {
- printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
- scp->mode, xsize, ysize, fontsize);
- }
-#endif
-
- /* adjust argument values */
- if ((fontsize <= 0) || (fontsize == FONT_NONE))
- fontsize = info.vi_cheight;
- if (fontsize < 14) {
- fontsize = 8;
- if (!(fonts_loaded & FONT_8))
- return EINVAL;
- } else if (fontsize >= 16) {
- fontsize = 16;
- if (!(fonts_loaded & FONT_16))
- return EINVAL;
- } else {
- fontsize = 14;
- if (!(fonts_loaded & FONT_14))
- return EINVAL;
- }
- if (xsize <= 0)
- xsize = info.vi_width/8;
- if (ysize <= 0)
- ysize = info.vi_height/fontsize;
-
-#ifdef SC_VIDEO_DEBUG
- if (scp->scr_buf != NULL) {
- printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
- scp->mode, xsize, ysize, fontsize);
- printf("set_pixel_mode(): window:%x, %dx%d, xoff:%d, yoff:%d\n",
- scp->adp->va_window, info.vi_width, info.vi_height,
- (info.vi_width/8 - xsize)/2,
- (info.vi_height/fontsize - ysize)/2);
- }
-#endif
-
- if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
- return EINVAL;
-
- /* only 16 color, 4 plane modes are supported XXX */
- if ((info.vi_depth != 4) || (info.vi_planes != 4))
- return ENODEV;
-
- /*
- * set_pixel_mode() currently does not support video modes whose
- * memory size is larger than 64K. Because such modes require
- * bank switching to access the entire screen. XXX
- */
- if (info.vi_width*info.vi_height/8 > info.vi_window_size)
- return ENODEV;
-
- /* stop screen saver, etc */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-
- /* set up scp */
- if (scp->history != NULL)
- i = imax(scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize), 0);
- else
- i = 0;
- scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
- scp->status &= ~(GRAPHICS_MODE | MOUSE_ENABLED);
- scp->xsize = xsize;
- scp->ysize = ysize;
- scp->font_size = fontsize;
- scp->xoff = (scp->xpixel/8 - xsize)/2;
- scp->yoff = (scp->ypixel/fontsize - ysize)/2;
-
- /* allocate buffers */
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
- sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
- splx(s);
-
- if (scp == cur_console)
- set_border(scp, scp->border);
-
- scp->status &= ~UNKNOWN_MODE;
-
-#ifdef SC_VIDEO_DEBUG
- printf("set_pixel_mode(): status:%x\n", scp->status);
-#endif
-
- if (tp == NULL)
- return 0;
- if (tp->t_winsize.ws_col != scp->xsize
- || tp->t_winsize.ws_row != scp->ysize) {
- tp->t_winsize.ws_col = scp->xsize;
- tp->t_winsize.ws_row = scp->ysize;
- pgsignal(tp->t_pgrp, SIGWINCH, 1);
- }
-
- return 0;
-}
-
-int
-sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- scr_stat *scp;
- int error;
- int s;
-
- scp = sc_get_scr_stat(tp->t_dev);
-
- switch (cmd) {
-
- case CONS_CURRENT: /* get current adapter type */
- if (scp->adp == NULL)
- return ENODEV;
- *(int *)data = scp->adp->va_type;
- return 0;
-
- case CONS_CURRENTADP: /* get current adapter index */
- *(int *)data = scp->ad;
- return 0;
-
- case OLD_CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
- return ENODEV;
- ((old_video_adapter_t *)data)->va_index = scp->adp->va_index;
- ((old_video_adapter_t *)data)->va_type = scp->adp->va_type;
- ((old_video_adapter_t *)data)->va_flags = scp->adp->va_flags;
- ((old_video_adapter_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((old_video_adapter_t *)data)->va_window = scp->adp->va_window;
- ((old_video_adapter_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((old_video_adapter_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((old_video_adapter_t *)data)->va_buffer = scp->adp->va_buffer;
- ((old_video_adapter_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((old_video_adapter_t *)data)->va_mode = scp->adp->va_mode;
- ((old_video_adapter_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((old_video_adapter_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
- return 0;
-
- case CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
- return ENODEV;
- ((video_adapter_info_t *)data)->va_index = scp->adp->va_index;
- ((video_adapter_info_t *)data)->va_type = scp->adp->va_type;
- bcopy(scp->adp->va_name, ((video_adapter_info_t *)data)->va_name,
- imin(strlen(scp->adp->va_name) + 1,
- sizeof(((video_adapter_info_t *)data)->va_name)));
- ((video_adapter_info_t *)data)->va_unit = scp->adp->va_unit;
- ((video_adapter_info_t *)data)->va_flags = scp->adp->va_flags;
- ((video_adapter_info_t *)data)->va_io_base = scp->adp->va_io_base;
- ((video_adapter_info_t *)data)->va_io_size = scp->adp->va_io_size;
- ((video_adapter_info_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((video_adapter_info_t *)data)->va_mem_base = scp->adp->va_mem_base;
- ((video_adapter_info_t *)data)->va_mem_size = scp->adp->va_mem_size;
- ((video_adapter_info_t *)data)->va_window = scp->adp->va_window;
- ((video_adapter_info_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((video_adapter_info_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((video_adapter_info_t *)data)->va_buffer = scp->adp->va_buffer;
- ((video_adapter_info_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((video_adapter_info_t *)data)->va_mode = scp->adp->va_mode;
- ((video_adapter_info_t *)data)->va_mode_flags = scp->adp->va_mode_flags;
- ((video_adapter_info_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((video_adapter_info_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
- return 0;
-
- case CONS_GET: /* get current video mode */
- *(int *)data = scp->mode;
- return 0;
-
- case CONS_MODEINFO: /* get mode information */
- return ((*vidsw[scp->ad]->get_info)(scp->adp,
- ((video_info_t *)data)->vi_mode, (video_info_t *)data)
- ? ENODEV : 0);
-
- case CONS_FINDMODE: /* find a matching video mode */
- return ((*vidsw[scp->ad]->query_mode)(scp->adp, (video_info_t *)data)
- ? ENODEV : 0);
-
- case CONS_SETWINORG:
- return ((*vidsw[scp->ad]->set_win_org)(scp->adp, *(u_int *)data)
- ? ENODEV : 0);
-
- /* generic text modes */
- case SW_TEXT_80x25: case SW_TEXT_80x30:
- case SW_TEXT_80x43: case SW_TEXT_80x50:
- case SW_TEXT_80x60:
- /* FALL THROUGH */
-
- /* VGA TEXT MODES */
- case SW_VGA_C40x25:
- case SW_VGA_C80x25: case SW_VGA_M80x25:
- case SW_VGA_C80x30: case SW_VGA_M80x30:
- case SW_VGA_C80x50: case SW_VGA_M80x50:
- case SW_VGA_C80x60: case SW_VGA_M80x60:
- case SW_B40x25: case SW_C40x25:
- case SW_B80x25: case SW_C80x25:
- case SW_ENH_B40x25: case SW_ENH_C40x25:
- case SW_ENH_B80x25: case SW_ENH_C80x25:
- case SW_ENH_B80x43: case SW_ENH_C80x43:
- case SW_EGAMONO80x25:
-
-#ifdef PC98
- /* PC98 TEXT MODES */
- case SW_PC98_80x25:
- case SW_PC98_80x30:
-#endif
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
-
- /* GRAPHICS MODES */
- case SW_BG320: case SW_BG640:
- case SW_CG320: case SW_CG320_D: case SW_CG640_E:
- case SW_CG640x350: case SW_ENH_CG640:
- case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
- case SW_VGA_MODEX:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
- return ENODEV;
- return sc_set_graphics_mode(scp, tp, cmd & 0xff);
-
- case KDSETMODE: /* set current mode of this (virtual) console */
- switch (*(int *)data) {
- case KD_TEXT: /* switch to TEXT (known) mode */
- /*
- * If scp->mode is of graphics modes, we don't know which
- * text mode to switch back to...
- */
- if (scp->status & GRAPHICS_MODE)
- return EINVAL;
- /* restore fonts & palette ! */
-#if 0
- if (ISFONTAVAIL(scp->adp->va_flags)
- && !(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- /*
- * FONT KLUDGE
- * Don't load fonts for now... XXX
- */
- if (fonts_loaded & FONT_8)
- copy_font(scp, LOAD, 8, font_8);
- if (fonts_loaded & FONT_14)
- copy_font(scp, LOAD, 14, font_14);
- if (fonts_loaded & FONT_16)
- copy_font(scp, LOAD, 16, font_16);
- }
-#endif
- load_palette(scp->adp, palette);
-
- /* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
-
- /* FALL THROUGH */
-
- case KD_TEXT1: /* switch to TEXT (known) mode */
- /*
- * If scp->mode is of graphics modes, we don't know which
- * text/pixel mode to switch back to...
- */
- if (scp->status & GRAPHICS_MODE)
- return EINVAL;
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
-#ifndef PC98
- scp->status |= UNKNOWN_MODE;
- splx(s);
- /* no restore fonts & palette */
- if (scp == cur_console)
- set_mode(scp);
- sc_clear_screen(scp);
- scp->status &= ~UNKNOWN_MODE;
-#else /* PC98 */
- scp->status &= ~UNKNOWN_MODE;
- /* no restore fonts & palette */
- if (scp == cur_console)
- set_mode(scp);
- sc_clear_screen(scp);
- splx(s);
-#endif /* PC98 */
- return 0;
-
- case KD_PIXEL: /* pixel (raster) display */
- if (!(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- return EINVAL;
- if (scp->status & GRAPHICS_MODE)
- return sc_set_pixel_mode(scp, tp, scp->xsize, scp->ysize,
- scp->font_size);
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
- scp->status |= (UNKNOWN_MODE | PIXEL_MODE);
- splx(s);
- if (scp == cur_console) {
- set_mode(scp);
- load_palette(scp->adp, palette);
- }
- sc_clear_screen(scp);
- scp->status &= ~UNKNOWN_MODE;
- return 0;
-
- case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
- s = spltty();
- if ((error = sc_clean_up(scp))) {
- splx(s);
- return error;
- }
- scp->status |= UNKNOWN_MODE;
- splx(s);
-#ifdef PC98
- if (scp == cur_console)
- set_mode(scp);
-#endif
- return 0;
-
- default:
- return EINVAL;
- }
- /* NOT REACHED */
-
- case KDRASTER: /* set pixel (raster) display mode */
- if (ISUNKNOWNSC(scp) || ISTEXTSC(scp))
- return ENODEV;
- return sc_set_pixel_mode(scp, tp, ((int *)data)[0], ((int *)data)[1],
- ((int *)data)[2]);
-
- case KDGETMODE: /* get current mode of this (virtual) console */
- /*
- * From the user program's point of view, KD_PIXEL is the same
- * as KD_TEXT...
- */
- *data = ISGRAPHSC(scp) ? KD_GRAPHICS : KD_TEXT;
- return 0;
-
- case KDSBORDER: /* set border color of this (virtual) console */
- scp->border = *data;
- if (scp == cur_console)
- set_border(scp, scp->border);
- return 0;
- }
-
- return ENOIOCTL;
-}
-
-#endif /* NSC > 0 */
diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c
deleted file mode 100644
index ea04a05b67e56..0000000000000
--- a/sys/dev/usb/hid.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* $NetBSD: hid.c,v 1.7 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: hid.c,v 1.5 1999/01/07 23:31:29 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__FreeBSD__)
-#include <sys/bus.h>
-#endif
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/hid.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-static void hid_clear_local __P((struct hid_item *));
-
-#define MAXUSAGE 100
-struct hid_data {
- u_char *start;
- u_char *end;
- u_char *p;
- struct hid_item cur;
- int32_t usages[MAXUSAGE];
- int nu;
- int minset;
- int multi;
- int multimax;
- int kindset;
-};
-
-static void
-hid_clear_local(c)
- struct hid_item *c;
-{
- c->usage = 0;
- c->usage_minimum = 0;
- c->usage_maximum = 0;
- c->designator_index = 0;
- c->designator_minimum = 0;
- c->designator_maximum = 0;
- c->string_index = 0;
- c->string_minimum = 0;
- c->string_maximum = 0;
- c->set_delimiter = 0;
-}
-
-struct hid_data *
-hid_start_parse(d, len, kindset)
- void *d;
- int len;
- int kindset;
-{
- struct hid_data *s;
-
- s = malloc(sizeof *s, M_TEMP, M_WAITOK);
- memset(s, 0, sizeof *s);
- s->start = s->p = d;
- s->end = (char *)d + len;
- s->kindset = kindset;
- return (s);
-}
-
-void
-hid_end_parse(s)
- struct hid_data *s;
-{
- while (s->cur.next) {
- struct hid_item *hi = s->cur.next->next;
- free(s->cur.next, M_TEMP);
- s->cur.next = hi;
- }
- free(s, M_TEMP);
-}
-
-int
-hid_get_item(s, h)
- struct hid_data *s;
- struct hid_item *h;
-{
- struct hid_item *c = &s->cur;
- int bTag, bType, bSize;
- u_char *data;
- int32_t dval;
- u_char *p;
- struct hid_item *hi;
- int i;
-
- top:
- if (s->multimax) {
- if (s->multi < s->multimax) {
- c->usage = s->usages[min(s->multi, s->nu-1)];
- s->multi++;
- *h = *c;
- c->loc.pos += c->loc.size;
- h->next = 0;
- return (1);
- } else {
- c->loc.count = s->multimax;
- s->multimax = 0;
- s->nu = 0;
- hid_clear_local(c);
- }
- }
- for (;;) {
- p = s->p;
- if (p >= s->end)
- return (0);
-
- bSize = *p++;
- if (bSize == 0xfe) {
- /* long item */
- bSize = *p++;
- bSize |= *p++ << 8;
- bTag = *p++;
- data = p;
- p += bSize;
- bType = 0xff; /* XXX what should it be */
- } else {
- /* short item */
- bTag = bSize >> 4;
- bType = (bSize >> 2) & 3;
- bSize &= 3;
- if (bSize == 3) bSize = 4;
- data = p;
- p += bSize;
- }
- s->p = p;
- switch(bSize) {
- case 0:
- dval = 0;
- break;
- case 1:
- dval = (int8_t)*data++;
- break;
- case 2:
- dval = *data++;
- dval |= *data++ << 8;
- dval = (int16_t)dval;
- break;
- case 4:
- dval = *data++;
- dval |= *data++ << 8;
- dval |= *data++ << 16;
- dval |= *data++ << 24;
- break;
- default:
- printf("BAD LENGTH %d\n", bSize);
- continue;
- }
-
- switch (bType) {
- case 0: /* Main */
- switch (bTag) {
- case 8: /* Input */
- if (!(s->kindset & (1 << hid_input)))
- continue;
- c->kind = hid_input;
- c->flags = dval;
- ret:
- if (c->flags & HIO_VARIABLE) {
- s->multimax = c->loc.count;
- s->multi = 0;
- c->loc.count = 1;
- if (s->minset) {
- for (i = c->usage_minimum;
- i <= c->usage_maximum;
- i++) {
- s->usages[s->nu] = i;
- if (s->nu < MAXUSAGE-1)
- s->nu++;
- }
- s->minset = 0;
- }
- goto top;
- } else {
- *h = *c;
- h->next = 0;
- c->loc.pos +=
- c->loc.size * c->loc.count;
- hid_clear_local(c);
- s->minset = 0;
- return (1);
- }
- case 9: /* Output */
- if (!(s->kindset & (1 << hid_output)))
- continue;
- c->kind = hid_output;
- c->flags = dval;
- goto ret;
- case 10: /* Collection */
- c->kind = hid_collection;
- c->collection = dval;
- c->collevel++;
- *h = *c;
- hid_clear_local(c);
- s->nu = 0;
- return (1);
- case 11: /* Feature */
- if (!(s->kindset & (1 << hid_feature)))
- continue;
- c->kind = hid_feature;
- c->flags = dval;
- goto ret;
- case 12: /* End collection */
- c->kind = hid_endcollection;
- c->collevel--;
- *h = *c;
- hid_clear_local(c);
- s->nu = 0;
- return (1);
- default:
- printf("Main bTag=%d\n", bTag);
- break;
- }
- break;
- case 1: /* Global */
- switch (bTag) {
- case 0:
- c->_usage_page = dval << 16;
- break;
- case 1:
- c->logical_minimum = dval;
- break;
- case 2:
- c->logical_maximum = dval;
- break;
- case 3:
- c->physical_maximum = dval;
- break;
- case 4:
- c->physical_maximum = dval;
- break;
- case 5:
- c->unit_exponent = dval;
- break;
- case 6:
- c->unit = dval;
- break;
- case 7:
- c->loc.size = dval;
- break;
- case 8:
- c->report_ID = dval;
- break;
- case 9:
- c->loc.count = dval;
- break;
- case 10: /* Push */
- hi = malloc(sizeof *hi, M_TEMP, M_WAITOK);
- *hi = s->cur;
- c->next = hi;
- break;
- case 11: /* Pop */
- hi = c->next;
- s->cur = *hi;
- free(hi, M_TEMP);
- break;
- default:
- printf("Global bTag=%d\n", bTag);
- break;
- }
- break;
- case 2: /* Local */
- switch (bTag) {
- case 0:
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage = dval;
- if (s->nu < MAXUSAGE)
- s->usages[s->nu++] = dval;
- /* else XXX */
- break;
- case 1:
- s->minset = 1;
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage_minimum = dval;
- break;
- case 2:
- if (bSize == 1)
- dval = c->_usage_page | (dval&0xff);
- else if (bSize == 2)
- dval = c->_usage_page | (dval&0xffff);
- c->usage_maximum = dval;
- break;
- case 3:
- c->designator_index = dval;
- break;
- case 4:
- c->designator_minimum = dval;
- break;
- case 5:
- c->designator_maximum = dval;
- break;
- case 7:
- c->string_index = dval;
- break;
- case 8:
- c->string_minimum = dval;
- break;
- case 9:
- c->string_maximum = dval;
- break;
- case 10:
- c->set_delimiter = dval;
- break;
- default:
- printf("Local bTag=%d\n", bTag);
- break;
- }
- break;
- default:
- printf("default bType=%d\n", bType);
- break;
- }
- }
-}
-
-int
-hid_report_size(buf, len, k, idp)
- void *buf;
- int len;
- enum hid_kind k;
- u_int8_t *idp;
-{
- struct hid_data *d;
- struct hid_item h;
- int size, id;
-
- id = 0;
- for (d = hid_start_parse(buf, len, 1<<k); hid_get_item(d, &h); )
- if (h.report_ID)
- id = h.report_ID;
- hid_end_parse(d);
- size = h.loc.pos;
- if (id) {
- size += 8;
- *idp = id; /* XXX wrong */
- } else
- *idp = 0;
- return ((size + 7) / 8);
-}
-
-int
-hid_locate(desc, size, u, k, loc, flags)
- void *desc;
- int size;
- u_int32_t u;
- enum hid_kind k;
- struct hid_location *loc;
- u_int32_t *flags;
-{
- struct hid_data *d;
- struct hid_item h;
-
- for (d = hid_start_parse(desc, size, 1<<k); hid_get_item(d, &h); ) {
- if (h.kind == k && !(h.flags & HIO_CONST) && h.usage == u) {
- if (loc)
- *loc = h.loc;
- if (flags)
- *flags = h.flags;
- hid_end_parse(d);
- return (1);
- }
- }
- hid_end_parse(d);
- loc->size = 0;
- return (0);
-}
-
-u_long
-hid_get_data(buf, loc)
- u_char *buf;
- struct hid_location *loc;
-{
- u_int hpos = loc->pos;
- u_int hsize = loc->size;
- u_int32_t data;
- int i, s;
-
- DPRINTFN(10, ("hid_get_data: loc %d/%d\n", hpos, hsize));
-
- if (hsize == 0)
- return (0);
-
- data = 0;
- s = hpos / 8;
- for (i = hpos; i < hpos+hsize; i += 8)
- data |= buf[i / 8] << ((i / 8 - s) * 8);
- data >>= hpos % 8;
- data &= (1 << hsize) - 1;
- hsize = 32 - hsize;
- /* Sign extend */
- data = ((int32_t)data << hsize) >> hsize;
- DPRINTFN(10,("hid_get_data: loc %d/%d = %lu\n",
- loc->pos, loc->size, (long)data));
- return (data);
-}
-
-int
-hid_is_collection(desc, size, usage)
- void *desc;
- int size;
- u_int32_t usage;
-{
- struct hid_data *hd;
- struct hid_item hi;
- int r;
-
- hd = hid_start_parse(desc, size, hid_input);
- if (!hd)
- return (0);
-
- r = hid_get_item(hd, &hi) &&
- hi.kind == hid_collection &&
- hi.usage == usage;
- hid_end_parse(hd);
- return (r);
-}
diff --git a/sys/dev/usb/hid.h b/sys/dev/usb/hid.h
deleted file mode 100644
index 0529701d72a2e..0000000000000
--- a/sys/dev/usb/hid.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $NetBSD: hid.h,v 1.3 1998/11/25 22:32:04 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-enum hid_kind {
- hid_input, hid_output, hid_feature, hid_collection, hid_endcollection
-};
-
-struct hid_location {
- u_int32_t size;
- u_int32_t count;
- u_int32_t pos;
-};
-
-struct hid_item {
- /* Global */
- int32_t _usage_page;
- int32_t logical_minimum;
- int32_t logical_maximum;
- int32_t physical_minimum;
- int32_t physical_maximum;
- int32_t unit_exponent;
- int32_t unit;
- int32_t report_ID;
- /* Local */
- int32_t usage;
- int32_t usage_minimum;
- int32_t usage_maximum;
- int32_t designator_index;
- int32_t designator_minimum;
- int32_t designator_maximum;
- int32_t string_index;
- int32_t string_minimum;
- int32_t string_maximum;
- int32_t set_delimiter;
- /* Misc */
- int32_t collection;
- int collevel;
- enum hid_kind kind;
- u_int32_t flags;
- /* Location */
- struct hid_location loc;
- /* */
- struct hid_item *next;
-};
-
-struct hid_data *hid_start_parse __P((void *d, int len, int kindset));
-void hid_end_parse __P((struct hid_data *s));
-int hid_get_item __P((struct hid_data *s, struct hid_item *h));
-int hid_report_size __P((void *buf, int len, enum hid_kind k, u_int8_t *id));
-int hid_locate __P((void *desc, int size, u_int32_t usage,
- enum hid_kind kind, struct hid_location *loc,
- u_int32_t *flags));
-u_long hid_get_data __P((u_char *buf, struct hid_location *loc));
-int hid_is_collection __P((void *desc, int size, u_int32_t usage));
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
deleted file mode 100644
index 1cb64b33769ad..0000000000000
--- a/sys/dev/usb/ohci.c
+++ /dev/null
@@ -1,2228 +0,0 @@
-/* $NetBSD: ohci.c,v 1.23 1999/01/07 02:06:05 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * USB Open Host Controller driver.
- *
- * OHCI spec: http://www.intel.com/design/usb/ohci11d.pdf
- * USB spec: http://www.teleport.com/cgi-bin/mailmerge.cgi/~usb/cgiform.tpl
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-#include <sys/queue.h>
-#include <sys/select.h>
-
-#include <machine/bus.h>
-#include <machine/endian.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/usb_mem.h>
-
-#include <dev/usb/ohcireg.h>
-#include <dev/usb/ohcivar.h>
-
-#if defined(__FreeBSD__)
-#include <machine/clock.h>
-
-#define delay(d) DELAY(d)
-
-#endif
-
-/*
- * The OHCI controller is little endian, so on big endian machines
- * the data strored in memory needs to be swapped.
- */
-#if BYTE_ORDER == BIG_ENDIAN
-#define LE(x) (bswap32(x))
-#else
-#define LE(x) (x)
-#endif
-
-struct ohci_pipe;
-
-ohci_soft_ed_t *ohci_alloc_sed __P((ohci_softc_t *));
-void ohci_free_sed __P((ohci_softc_t *, ohci_soft_ed_t *));
-
-ohci_soft_td_t *ohci_alloc_std __P((ohci_softc_t *));
-void ohci_free_std __P((ohci_softc_t *, ohci_soft_td_t *));
-
-usbd_status ohci_open __P((usbd_pipe_handle));
-void ohci_poll __P((struct usbd_bus *));
-void ohci_waitintr __P((ohci_softc_t *, usbd_request_handle));
-void ohci_rhsc __P((ohci_softc_t *, usbd_request_handle));
-void ohci_process_done __P((ohci_softc_t *, ohci_physaddr_t));
-void ohci_ii_done __P((ohci_softc_t *, usbd_request_handle));
-void ohci_ctrl_done __P((ohci_softc_t *, usbd_request_handle));
-void ohci_intr_done __P((ohci_softc_t *, usbd_request_handle));
-void ohci_bulk_done __P((ohci_softc_t *, usbd_request_handle));
-
-usbd_status ohci_device_request __P((usbd_request_handle reqh));
-void ohci_add_ed __P((ohci_soft_ed_t *, ohci_soft_ed_t *));
-void ohci_rem_ed __P((ohci_soft_ed_t *, ohci_soft_ed_t *));
-void ohci_hash_add_td __P((ohci_softc_t *, ohci_soft_td_t *));
-void ohci_hash_rem_td __P((ohci_softc_t *, ohci_soft_td_t *));
-ohci_soft_td_t *ohci_hash_find_td __P((ohci_softc_t *, ohci_physaddr_t));
-
-usbd_status ohci_root_ctrl_transfer __P((usbd_request_handle));
-usbd_status ohci_root_ctrl_start __P((usbd_request_handle));
-void ohci_root_ctrl_abort __P((usbd_request_handle));
-void ohci_root_ctrl_close __P((usbd_pipe_handle));
-
-usbd_status ohci_root_intr_transfer __P((usbd_request_handle));
-usbd_status ohci_root_intr_start __P((usbd_request_handle));
-void ohci_root_intr_abort __P((usbd_request_handle));
-void ohci_root_intr_close __P((usbd_pipe_handle));
-
-usbd_status ohci_device_ctrl_transfer __P((usbd_request_handle));
-usbd_status ohci_device_ctrl_start __P((usbd_request_handle));
-void ohci_device_ctrl_abort __P((usbd_request_handle));
-void ohci_device_ctrl_close __P((usbd_pipe_handle));
-
-usbd_status ohci_device_bulk_transfer __P((usbd_request_handle));
-usbd_status ohci_device_bulk_start __P((usbd_request_handle));
-void ohci_device_bulk_abort __P((usbd_request_handle));
-void ohci_device_bulk_close __P((usbd_pipe_handle));
-
-usbd_status ohci_device_intr_transfer __P((usbd_request_handle));
-usbd_status ohci_device_intr_start __P((usbd_request_handle));
-void ohci_device_intr_abort __P((usbd_request_handle));
-void ohci_device_intr_close __P((usbd_pipe_handle));
-usbd_status ohci_device_setintr __P((ohci_softc_t *sc,
- struct ohci_pipe *pipe, int ival));
-
-int ohci_str __P((usb_string_descriptor_t *, int, char *));
-
-void ohci_timeout __P((void *));
-void ohci_rhsc_able __P((ohci_softc_t *, int));
-
-#ifdef USB_DEBUG
-ohci_softc_t *thesc;
-void ohci_dumpregs __P((ohci_softc_t *));
-void ohci_dump_tds __P((ohci_soft_td_t *));
-void ohci_dump_td __P((ohci_soft_td_t *));
-void ohci_dump_ed __P((ohci_soft_ed_t *));
-#endif
-
-#if defined(__NetBSD__)
-#define OWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x))
-#define OREAD4(sc, r) bus_space_read_4((sc)->iot, (sc)->ioh, (r))
-#define OREAD2(sc, r) bus_space_read_2((sc)->iot, (sc)->ioh, (r))
-#elif defined(__FreeBSD__)
-#define OWRITE4(sc, r, x) *(u_int32_t *) ((sc)->sc_iobase + (r)) = x
-#define OREAD4(sc, r) (*(u_int32_t *) ((sc)->sc_iobase + (r)))
-#define OREAD2(sc, r) (*(u_int16_t *) ((sc)->sc_iobase + (r)))
-#endif
-
-/* Reverse the bits in a value 0 .. 31 */
-static u_int8_t revbits[OHCI_NO_INTRS] =
- { 0x00, 0x10, 0x08, 0x18, 0x04, 0x14, 0x0c, 0x1c,
- 0x02, 0x12, 0x0a, 0x1a, 0x06, 0x16, 0x0e, 0x1e,
- 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d,
- 0x03, 0x13, 0x0b, 0x1b, 0x07, 0x17, 0x0f, 0x1f };
-
-struct ohci_pipe {
- struct usbd_pipe pipe;
- ohci_soft_ed_t *sed;
- ohci_soft_td_t *tail;
- /* Info needed for different pipe kinds. */
- union {
- /* Control pipe */
- struct {
- usb_dma_t datadma;
- usb_dma_t reqdma;
- u_int length;
- ohci_soft_td_t *setup, *xfer, *stat;
- } ctl;
- /* Interrupt pipe */
- struct {
- usb_dma_t datadma;
- int nslots;
- int pos;
- } intr;
- /* Bulk pipe */
- struct {
- usb_dma_t datadma;
- u_int length;
- } bulk;
- } u;
-};
-
-#define OHCI_INTR_ENDPT 1
-
-struct usbd_methods ohci_root_ctrl_methods = {
- ohci_root_ctrl_transfer,
- ohci_root_ctrl_start,
- ohci_root_ctrl_abort,
- ohci_root_ctrl_close,
- 0,
-};
-
-struct usbd_methods ohci_root_intr_methods = {
- ohci_root_intr_transfer,
- ohci_root_intr_start,
- ohci_root_intr_abort,
- ohci_root_intr_close,
- 0,
-};
-
-struct usbd_methods ohci_device_ctrl_methods = {
- ohci_device_ctrl_transfer,
- ohci_device_ctrl_start,
- ohci_device_ctrl_abort,
- ohci_device_ctrl_close,
- 0,
-};
-
-struct usbd_methods ohci_device_intr_methods = {
- ohci_device_intr_transfer,
- ohci_device_intr_start,
- ohci_device_intr_abort,
- ohci_device_intr_close,
-};
-
-struct usbd_methods ohci_device_bulk_methods = {
- ohci_device_bulk_transfer,
- ohci_device_bulk_start,
- ohci_device_bulk_abort,
- ohci_device_bulk_close,
- 0,
-};
-
-ohci_soft_ed_t *
-ohci_alloc_sed(sc)
- ohci_softc_t *sc;
-{
- ohci_soft_ed_t *sed;
- usbd_status r;
- int i, offs;
- usb_dma_t dma;
-
- if (!sc->sc_freeeds) {
- DPRINTFN(2, ("ohci_alloc_sed: allocating chunk\n"));
- sed = malloc(sizeof(ohci_soft_ed_t) * OHCI_ED_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!sed)
- return 0;
- r = usb_allocmem(sc->sc_dmatag, OHCI_ED_SIZE * OHCI_ED_CHUNK,
- OHCI_ED_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(sed, M_USBDEV);
- return 0;
- }
- for(i = 0; i < OHCI_ED_CHUNK; i++, sed++) {
- offs = i * OHCI_ED_SIZE;
- sed->physaddr = DMAADDR(&dma) + offs;
- sed->ed = (ohci_ed_t *)
- ((char *)KERNADDR(&dma) + offs);
- sed->next = sc->sc_freeeds;
- sc->sc_freeeds = sed;
- }
- }
- sed = sc->sc_freeeds;
- sc->sc_freeeds = sed->next;
- memset(sed->ed, 0, OHCI_ED_SIZE);
- sed->next = 0;
- return sed;
-}
-
-void
-ohci_free_sed(sc, sed)
- ohci_softc_t *sc;
- ohci_soft_ed_t *sed;
-{
- sed->next = sc->sc_freeeds;
- sc->sc_freeeds = sed;
-}
-
-ohci_soft_td_t *
-ohci_alloc_std(sc)
- ohci_softc_t *sc;
-{
- ohci_soft_td_t *std;
- usbd_status r;
- int i, offs;
- usb_dma_t dma;
-
- if (!sc->sc_freetds) {
- DPRINTFN(2, ("ohci_alloc_std: allocating chunk\n"));
- std = malloc(sizeof(ohci_soft_td_t) * OHCI_TD_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!std)
- return 0;
- r = usb_allocmem(sc->sc_dmatag, OHCI_TD_SIZE * OHCI_TD_CHUNK,
- OHCI_TD_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(std, M_USBDEV);
- return 0;
- }
- for(i = 0; i < OHCI_TD_CHUNK; i++, std++) {
- offs = i * OHCI_TD_SIZE;
- std->physaddr = DMAADDR(&dma) + offs;
- std->td = (ohci_td_t *)
- ((char *)KERNADDR(&dma) + offs);
- std->nexttd = sc->sc_freetds;
- sc->sc_freetds = std;
- }
- }
- std = sc->sc_freetds;
- sc->sc_freetds = std->nexttd;
- memset(std->td, 0, OHCI_TD_SIZE);
- std->nexttd = 0;
- return (std);
-}
-
-void
-ohci_free_std(sc, std)
- ohci_softc_t *sc;
- ohci_soft_td_t *std;
-{
- std->nexttd = sc->sc_freetds;
- sc->sc_freetds = std;
-}
-
-usbd_status
-ohci_init(sc)
- ohci_softc_t *sc;
-{
- ohci_soft_ed_t *sed, *psed;
- usbd_status r;
- int rev;
- int i;
- u_int32_t s, ctl, ival, hcr, fm, per;
-
- DPRINTF(("ohci_init: start\n"));
- rev = OREAD4(sc, OHCI_REVISION);
- printf("%s: OHCI version %d.%d%s\n", USBDEVNAME(sc->sc_bus.bdev),
- OHCI_REV_HI(rev), OHCI_REV_LO(rev),
- OHCI_REV_LEGACY(rev) ? ", legacy support" : "");
- if (OHCI_REV_HI(rev) != 1 || OHCI_REV_LO(rev) != 0) {
- printf("%s: unsupported OHCI revision\n",
- USBDEVNAME(sc->sc_bus.bdev));
- return (USBD_INVAL);
- }
-
- for (i = 0; i < OHCI_HASH_SIZE; i++)
- LIST_INIT(&sc->sc_hash_tds[i]);
-
- /* Allocate the HCCA area. */
- r = usb_allocmem(sc->sc_dmatag, OHCI_HCCA_SIZE,
- OHCI_HCCA_ALIGN, &sc->sc_hccadma);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- sc->sc_hcca = (struct ohci_hcca *)KERNADDR(&sc->sc_hccadma);
- memset(sc->sc_hcca, 0, OHCI_HCCA_SIZE);
-
- sc->sc_eintrs = OHCI_NORMAL_INTRS;
-
- sc->sc_ctrl_head = ohci_alloc_sed(sc);
- if (!sc->sc_ctrl_head) {
- r = USBD_NOMEM;
- goto bad1;
- }
- sc->sc_ctrl_head->ed->ed_flags |= LE(OHCI_ED_SKIP);
- sc->sc_bulk_head = ohci_alloc_sed(sc);
- if (!sc->sc_bulk_head) {
- r = USBD_NOMEM;
- goto bad2;
- }
- sc->sc_bulk_head->ed->ed_flags |= LE(OHCI_ED_SKIP);
-
- /* Allocate all the dummy EDs that make up the interrupt tree. */
- for (i = 0; i < OHCI_NO_EDS; i++) {
- sed = ohci_alloc_sed(sc);
- if (!sed) {
- while (--i >= 0)
- ohci_free_sed(sc, sc->sc_eds[i]);
- r = USBD_NOMEM;
- goto bad3;
- }
- /* All ED fields are set to 0. */
- sc->sc_eds[i] = sed;
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if (i != 0) {
- psed = sc->sc_eds[(i-1) / 2];
- sed->next = psed;
- sed->ed->ed_nexted = LE(psed->physaddr);
- }
- }
- /*
- * Fill HCCA interrupt table. The bit reversal is to get
- * the tree set up properly to spread the interrupts.
- */
- for (i = 0; i < OHCI_NO_INTRS; i++)
- sc->sc_hcca->hcca_interrupt_table[revbits[i]] =
- LE(sc->sc_eds[OHCI_NO_EDS-OHCI_NO_INTRS+i]->physaddr);
-
- /* Determine in what context we are running. */
- ctl = OREAD4(sc, OHCI_CONTROL);
- if (ctl & OHCI_IR) {
- /* SMM active, request change */
- DPRINTF(("ohci_init: SMM active, request owner change\n"));
- s = OREAD4(sc, OHCI_COMMAND_STATUS);
- OWRITE4(sc, OHCI_COMMAND_STATUS, s | OHCI_OCR);
- for (i = 0; i < 100 && (ctl & OHCI_IR); i++) {
- delay(1000);
- ctl = OREAD4(sc, OHCI_CONTROL);
- }
- if ((ctl & OHCI_IR) == 0) {
- printf("%s: SMM does not respond, resetting\n",
- USBDEVNAME(sc->sc_bus.bdev));
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
- goto reset;
- }
- } else if ((ctl & OHCI_HCFS_MASK) != OHCI_HCFS_RESET) {
- /* BIOS started controller. */
- DPRINTF(("ohci_init: BIOS active\n"));
- if ((ctl & OHCI_HCFS_MASK) != OHCI_HCFS_OPERATIONAL) {
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_OPERATIONAL);
- delay(USB_RESUME_DELAY * 1000);
- }
- } else {
- DPRINTF(("ohci_init: cold started\n"));
- reset:
- /* Controller was cold started. */
- delay(USB_BUS_RESET_DELAY * 1000);
- }
-
- /*
- * This reset should not be necessary according to the OHCI spec, but
- * without it some controllers do not start.
- */
- DPRINTF(("%s: resetting\n", USBDEVNAME(sc->sc_bus.bdev)));
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
- delay(USB_BUS_RESET_DELAY * 1000);
-
- /* We now own the host controller and the bus has been reset. */
- ival = OHCI_GET_IVAL(OREAD4(sc, OHCI_FM_INTERVAL));
-
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_HCR); /* Reset HC */
- /* Nominal time for a reset is 10 us. */
- for (i = 0; i < 10; i++) {
- delay(10);
- hcr = OREAD4(sc, OHCI_COMMAND_STATUS) & OHCI_HCR;
- if (!hcr)
- break;
- }
- if (hcr) {
- printf("%s: reset timeout\n", USBDEVNAME(sc->sc_bus.bdev));
- r = USBD_IOERROR;
- goto bad3;
- }
-#ifdef USB_DEBUG
- thesc = sc;
- if (ohcidebug > 15)
- ohci_dumpregs(sc);
-#endif
-
- /* The controller is now in suspend state, we have 2ms to finish. */
-
- /* Set up HC registers. */
- OWRITE4(sc, OHCI_HCCA, DMAADDR(&sc->sc_hccadma));
- OWRITE4(sc, OHCI_CONTROL_HEAD_ED, sc->sc_ctrl_head->physaddr);
- OWRITE4(sc, OHCI_BULK_HEAD_ED, sc->sc_bulk_head->physaddr);
- OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS);
- OWRITE4(sc, OHCI_INTERRUPT_ENABLE, sc->sc_eintrs | OHCI_MIE);
- ctl = OREAD4(sc, OHCI_CONTROL);
- ctl &= ~(OHCI_CBSR_MASK | OHCI_LES | OHCI_HCFS_MASK | OHCI_IR);
- ctl |= OHCI_PLE | OHCI_IE | OHCI_CLE | OHCI_BLE |
- OHCI_RATIO_1_4 | OHCI_HCFS_OPERATIONAL;
- /* And finally start it! */
- OWRITE4(sc, OHCI_CONTROL, ctl);
-
- /*
- * The controller is now OPERATIONAL. Set a some final
- * registers that should be set earlier, but that the
- * controller ignores when in the SUSPEND state.
- */
- fm = (OREAD4(sc, OHCI_FM_INTERVAL) & OHCI_FIT) ^ OHCI_FIT;
- fm |= OHCI_FSMPS(ival) | ival;
- OWRITE4(sc, OHCI_FM_INTERVAL, fm);
- per = OHCI_PERIODIC(ival); /* 90% periodic */
- OWRITE4(sc, OHCI_PERIODIC_START, per);
-
- OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */
-
- sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
-
-#ifdef USB_DEBUG
- if (ohcidebug > 5)
- ohci_dumpregs(sc);
-#endif
-
- /* Set up the bus struct. */
- sc->sc_bus.open_pipe = ohci_open;
- sc->sc_bus.pipe_size = sizeof(struct ohci_pipe);
- sc->sc_bus.do_poll = ohci_poll;
-
- return (USBD_NORMAL_COMPLETION);
-
- bad3:
- ohci_free_sed(sc, sc->sc_ctrl_head);
- bad2:
- ohci_free_sed(sc, sc->sc_bulk_head);
- bad1:
- usb_freemem(sc->sc_dmatag, &sc->sc_hccadma);
- return (r);
-}
-
-#ifdef USB_DEBUG
-void ohcidump(void);
-void ohcidump(void) { ohci_dumpregs(thesc); }
-
-void
-ohci_dumpregs(sc)
- ohci_softc_t *sc;
-{
- printf("ohci_dumpregs: rev=0x%08x control=0x%08x command=0x%08x\n",
- OREAD4(sc, OHCI_REVISION),
- OREAD4(sc, OHCI_CONTROL),
- OREAD4(sc, OHCI_COMMAND_STATUS));
- printf(" intrstat=0x%08x intre=0x%08x intrd=0x%08x\n",
- OREAD4(sc, OHCI_INTERRUPT_STATUS),
- OREAD4(sc, OHCI_INTERRUPT_ENABLE),
- OREAD4(sc, OHCI_INTERRUPT_DISABLE));
- printf(" hcca=0x%08x percur=0x%08x ctrlhd=0x%08x\n",
- OREAD4(sc, OHCI_HCCA),
- OREAD4(sc, OHCI_PERIOD_CURRENT_ED),
- OREAD4(sc, OHCI_CONTROL_HEAD_ED));
- printf(" ctrlcur=0x%08x bulkhd=0x%08x bulkcur=0x%08x\n",
- OREAD4(sc, OHCI_CONTROL_CURRENT_ED),
- OREAD4(sc, OHCI_BULK_HEAD_ED),
- OREAD4(sc, OHCI_BULK_CURRENT_ED));
- printf(" done=0x%08x fmival=0x%08x fmrem=0x%08x\n",
- OREAD4(sc, OHCI_DONE_HEAD),
- OREAD4(sc, OHCI_FM_INTERVAL),
- OREAD4(sc, OHCI_FM_REMAINING));
- printf(" fmnum=0x%08x perst=0x%08x lsthrs=0x%08x\n",
- OREAD4(sc, OHCI_FM_NUMBER),
- OREAD4(sc, OHCI_PERIODIC_START),
- OREAD4(sc, OHCI_LS_THRESHOLD));
- printf(" desca=0x%08x descb=0x%08x stat=0x%08x\n",
- OREAD4(sc, OHCI_RH_DESCRIPTOR_A),
- OREAD4(sc, OHCI_RH_DESCRIPTOR_B),
- OREAD4(sc, OHCI_RH_STATUS));
- printf(" port1=0x%08x port2=0x%08x\n",
- OREAD4(sc, OHCI_RH_PORT_STATUS(1)),
- OREAD4(sc, OHCI_RH_PORT_STATUS(2)));
- printf(" HCCA: frame_number=0x%04x done_head=0x%08x\n",
- LE(sc->sc_hcca->hcca_frame_number),
- LE(sc->sc_hcca->hcca_done_head));
-}
-#endif
-
-int
-ohci_intr(p)
- void *p;
-{
- ohci_softc_t *sc = p;
- u_int32_t intrs = 0, eintrs;
- ohci_physaddr_t done;
-
- /* In case the interrupt occurs before initialization has completed. */
- if (sc == NULL || sc->sc_hcca == NULL) { /* NWH added sc==0 */
-#ifdef DIAGNOSTIC
- printf("ohci_intr: sc->sc_hcca == NULL\n");
-#endif
- return (0);
- }
-
- done = LE(sc->sc_hcca->hcca_done_head);
- if (done != 0) {
- sc->sc_hcca->hcca_done_head = 0;
- if (done & ~OHCI_DONE_INTRS)
- intrs = OHCI_WDH;
- if (done & OHCI_DONE_INTRS)
- intrs |= OREAD4(sc, OHCI_INTERRUPT_STATUS);
- } else
- intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS);
- if (!intrs)
- return (0);
- intrs &= ~OHCI_MIE;
- OWRITE4(sc, OHCI_INTERRUPT_STATUS, intrs); /* Acknowledge */
- eintrs = intrs & sc->sc_eintrs;
- if (!eintrs)
- return (0);
-
- sc->sc_intrs++;
- DPRINTFN(7, ("ohci_intr: sc=%p intrs=%x(%x) eintr=%x\n",
- sc, (u_int)intrs, OREAD4(sc, OHCI_INTERRUPT_STATUS),
- (u_int)eintrs));
-
- if (eintrs & OHCI_SO) {
- printf("%s: scheduling overrun\n",USBDEVNAME(sc->sc_bus.bdev));
- /* XXX do what */
- intrs &= ~OHCI_SO;
- }
- if (eintrs & OHCI_WDH) {
- ohci_process_done(sc, done &~ OHCI_DONE_INTRS);
- intrs &= ~OHCI_WDH;
- }
- if (eintrs & OHCI_RD) {
- /* XXX process resume detect */
- }
- if (eintrs & OHCI_UE) {
- printf("%s: unrecoverable error, controller halted\n",
- USBDEVNAME(sc->sc_bus.bdev));
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
- /* XXX what else */
- }
- if (eintrs & OHCI_RHSC) {
- ohci_rhsc(sc, sc->sc_intrreqh);
- intrs &= ~OHCI_RHSC;
-
- /*
- * Disable RHSC interrupt for now, because it will be
- * on until the port has been reset.
- */
- ohci_rhsc_able(sc, 0);
- }
-
- /* Block unprocessed interrupts. XXX */
- OWRITE4(sc, OHCI_INTERRUPT_DISABLE, intrs);
- sc->sc_eintrs &= ~intrs;
-
- return (1);
-}
-
-void
-ohci_rhsc_able(sc, on)
- ohci_softc_t *sc;
- int on;
-{
- DPRINTFN(4, ("ohci_rhsc_able: on=%d\n", on));
- if (on) {
- sc->sc_eintrs |= OHCI_RHSC;
- OWRITE4(sc, OHCI_INTERRUPT_ENABLE, OHCI_RHSC);
- } else {
- sc->sc_eintrs &= ~OHCI_RHSC;
- OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_RHSC);
- }
-}
-
-#ifdef USB_DEBUG
-char *ohci_cc_strs[] = {
- "NO_ERROR",
- "CRC",
- "BIT_STUFFING",
- "DATA_TOGGLE_MISMATCH",
- "STALL",
- "DEVICE_NOT_RESPONDING",
- "PID_CHECK_FAILURE",
- "UNEXPECTED_PID",
- "DATA_OVERRUN",
- "DATA_UNDERRUN",
- "BUFFER_OVERRUN",
- "BUFFER_UNDERRUN",
- "NOT_ACCESSED",
-};
-#endif
-
-void
-ohci_process_done(sc, done)
- ohci_softc_t *sc;
- ohci_physaddr_t done;
-{
- ohci_soft_td_t *std = NULL, *sdone;
- usbd_request_handle reqh;
- int len, cc;
-
- DPRINTFN(10,("ohci_process_done: done=0x%08lx\n", (u_long)done));
-
- /* Reverse the done list. */
- for (sdone = 0; done; done = LE(std->td->td_nexttd)) {
- std = ohci_hash_find_td(sc, done);
- std->dnext = sdone;
- sdone = std;
- }
-
-#ifdef USB_DEBUG
- if (ohcidebug > 10) {
- printf("ohci_process_done: TD done:\n");
- ohci_dump_tds(sdone);
- }
-#endif
-
- for (std = sdone; std; std = std->dnext) {
- reqh = std->reqh;
- DPRINTFN(10, ("ohci_process_done: std=%p reqh=%p hcpriv=%p\n",
- std, reqh, reqh->hcpriv));
- cc = OHCI_TD_GET_CC(LE(std->td->td_flags));
- if (cc == OHCI_CC_NO_ERROR) {
- if (std->td->td_cbp == 0)
- len = std->len;
- else
- len = LE(std->td->td_be) -
- LE(std->td->td_cbp) + 1;
- /*
- * Only do a callback on the last stage of a transfer.
- * Others have hcpriv = 0.
- */
- if ((reqh->pipe->endpoint->edesc->bmAttributes &
- UE_XFERTYPE) == UE_CONTROL) {
- /* For a control transfer the length is in
- * the xfer stage */
- if (reqh->hcpriv == std) {
- reqh->status = USBD_NORMAL_COMPLETION;
- ohci_ii_done(sc, reqh);
- } else
- reqh->actlen = len;
- } else {
- if (reqh->hcpriv == std) {
- reqh->actlen = len;
- reqh->status = USBD_NORMAL_COMPLETION;
- ohci_ii_done(sc, reqh);
- }
- }
- } else {
- ohci_soft_td_t *p, *n;
- struct ohci_pipe *opipe =
- (struct ohci_pipe *)reqh->pipe;
- DPRINTFN(-1,("ohci_process_done: error cc=%d (%s)\n",
- OHCI_TD_GET_CC(LE(std->td->td_flags)),
- ohci_cc_strs[OHCI_TD_GET_CC(LE(std->td->td_flags))]));
- /*
- * Endpoint is halted. First unlink all the TDs
- * belonging to the failed transfer, and then restart
- * the endpoint.
- */
- for (p = std->nexttd; p->reqh == reqh; p = n) {
- n = p->nexttd;
- ohci_hash_rem_td(sc, p);
- ohci_free_std(sc, p);
- }
- /* clear halt */
- opipe->sed->ed->ed_headp = LE(p->physaddr);
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
-
- if (cc == OHCI_CC_STALL)
- reqh->status = USBD_STALLED;
- else
- reqh->status = USBD_IOERROR;
- ohci_ii_done(sc, reqh);
- }
- ohci_hash_rem_td(sc, std);
- ohci_free_std(sc, std);
- }
-}
-
-void
-ohci_ii_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- switch (reqh->pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_CONTROL:
- ohci_ctrl_done(sc, reqh);
- usb_start_next(reqh->pipe);
- break;
- case UE_INTERRUPT:
- ohci_intr_done(sc, reqh);
- break;
- case UE_BULK:
- ohci_bulk_done(sc, reqh);
- usb_start_next(reqh->pipe);
- break;
- case UE_ISOCHRONOUS:
- printf("ohci_process_done: ISO done?\n");
- usb_start_next(reqh->pipe);
- break;
- }
-
- /* And finally execute callback. */
- reqh->xfercb(reqh);
-}
-
-void
-ohci_ctrl_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- u_int len = opipe->u.ctl.length;
- usb_dma_t *dma;
-
- DPRINTFN(10,("ohci_ctrl_done: reqh=%p\n", reqh));
-
- if (!reqh->isreq) {
- panic("ohci_ctrl_done: not a request\n");
- return;
- }
-
- if (len != 0) {
- dma = &opipe->u.ctl.datadma;
- if (reqh->request.bmRequestType & UT_READ)
- memcpy(reqh->buffer, KERNADDR(dma), len);
- usb_freemem(sc->sc_dmatag, dma);
- }
- usb_untimeout(ohci_timeout, reqh, reqh->timo_handle);
-}
-
-void
-ohci_intr_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usb_dma_t *dma;
- ohci_soft_ed_t *sed = opipe->sed;
- ohci_soft_td_t *xfer, *tail;
-
-
- DPRINTFN(10,("ohci_intr_done: reqh=%p, actlen=%d\n",
- reqh, reqh->actlen));
-
- dma = &opipe->u.intr.datadma;
- memcpy(reqh->buffer, KERNADDR(dma), reqh->actlen);
-
- if (reqh->pipe->intrreqh == reqh) {
- xfer = opipe->tail;
- tail = ohci_alloc_std(sc); /* XXX should reuse TD */
- if (!tail) {
- reqh->status = USBD_NOMEM;
- return;
- }
- tail->reqh = 0;
-
- xfer->td->td_flags = LE(
- OHCI_TD_IN | OHCI_TD_NOCC |
- OHCI_TD_SET_DI(1) | OHCI_TD_TOGGLE_CARRY);
- if (reqh->flags & USBD_SHORT_XFER_OK)
- xfer->td->td_flags |= LE(OHCI_TD_R);
- xfer->td->td_cbp = LE(DMAADDR(dma));
- xfer->nexttd = tail;
- xfer->td->td_nexttd = LE(tail->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + reqh->length - 1);
- xfer->len = reqh->length;
- xfer->reqh = reqh;
-
- reqh->hcpriv = xfer;
-
- ohci_hash_add_td(sc, xfer);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
- } else {
- usb_freemem(sc->sc_dmatag, dma);
- usb_start_next(reqh->pipe);
- }
-}
-
-void
-ohci_bulk_done(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usb_dma_t *dma;
-
-
- DPRINTFN(10,("ohci_bulk_done: reqh=%p, actlen=%d\n",
- reqh, reqh->actlen));
-
- dma = &opipe->u.bulk.datadma;
- if (reqh->request.bmRequestType & UT_READ)
- memcpy(reqh->buffer, KERNADDR(dma), reqh->actlen);
- usb_freemem(sc->sc_dmatag, dma);
- usb_untimeout(ohci_timeout, reqh, reqh->timo_handle);
-}
-
-void
-ohci_rhsc(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe;
- struct ohci_pipe *opipe;
- u_char *p;
- int i, m;
- int hstatus;
-
- hstatus = OREAD4(sc, OHCI_RH_STATUS);
- DPRINTF(("ohci_rhsc: sc=%p reqh=%p hstatus=0x%08x\n",
- sc, reqh, hstatus));
-
- if (reqh == 0) {
- /* Just ignore the change. */
- return;
- }
-
- pipe = reqh->pipe;
- opipe = (struct ohci_pipe *)pipe;
-
- p = KERNADDR(&opipe->u.intr.datadma);
- m = min(sc->sc_noport, reqh->length * 8 - 1);
- memset(p, 0, reqh->length);
- for (i = 1; i <= m; i++) {
- if (OREAD4(sc, OHCI_RH_PORT_STATUS(i)) >> 16)
- p[i/8] |= 1 << (i%8);
- }
- DPRINTF(("ohci_rhsc: change=0x%02x\n", *p));
- reqh->actlen = reqh->length;
- reqh->status = USBD_NORMAL_COMPLETION;
- reqh->xfercb(reqh);
-
- if (reqh->pipe->intrreqh != reqh) {
- sc->sc_intrreqh = 0;
- usb_freemem(sc->sc_dmatag, &opipe->u.intr.datadma);
- usb_start_next(reqh->pipe);
- }
-}
-
-/*
- * Wait here until controller claims to have an interrupt.
- * Then call ohci_intr and return. Use timeout to avoid waiting
- * too long.
- */
-void
-ohci_waitintr(sc, reqh)
- ohci_softc_t *sc;
- usbd_request_handle reqh;
-{
- int timo = reqh->timeout;
- int usecs;
- u_int32_t intrs;
-
- reqh->status = USBD_IN_PROGRESS;
- for (usecs = timo * 1000000 / hz; usecs > 0; usecs -= 1000) {
- usb_delay_ms(&sc->sc_bus, 1);
- intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS) & sc->sc_eintrs;
- DPRINTFN(15,("ohci_waitintr: 0x%04x\n", intrs));
-#ifdef USB_DEBUG
- if (ohcidebug > 15)
- ohci_dumpregs(sc);
-#endif
- if (intrs) {
- ohci_intr(sc);
- if (reqh->status != USBD_IN_PROGRESS)
- return;
- }
- }
-
- /* Timeout */
- DPRINTF(("ohci_waitintr: timeout\n"));
- reqh->status = USBD_TIMEOUT;
- ohci_ii_done(sc, reqh);
- /* XXX should free TD */
-}
-
-void
-ohci_poll(bus)
- struct usbd_bus *bus;
-{
- ohci_softc_t *sc = (ohci_softc_t *)bus;
-
- if (OREAD4(sc, OHCI_INTERRUPT_STATUS) & sc->sc_eintrs)
- ohci_intr(sc);
-}
-
-usbd_status
-ohci_device_request(reqh)
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usb_device_request_t *req = &reqh->request;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- int addr = dev->address;
- ohci_soft_td_t *setup, *xfer = 0, *stat, *next, *tail;
- ohci_soft_ed_t *sed;
- usb_dma_t *dmap;
- int isread;
- int len;
- usbd_status r;
- int s;
-
- isread = req->bmRequestType & UT_READ;
- len = UGETW(req->wLength);
-
- DPRINTFN(3,("ohci_device_control type=0x%02x, request=0x%02x, "
- "wValue=0x%04x, wIndex=0x%04x len=%d, addr=%d, endpt=%d\n",
- req->bmRequestType, req->bRequest, UGETW(req->wValue),
- UGETW(req->wIndex), len, addr,
- opipe->pipe.endpoint->edesc->bEndpointAddress));
-
- setup = opipe->tail;
- stat = ohci_alloc_std(sc);
- if (!stat) {
- r = USBD_NOMEM;
- goto bad1;
- }
- tail = ohci_alloc_std(sc);
- if (!tail) {
- r = USBD_NOMEM;
- goto bad2;
- }
- tail->reqh = 0;
-
- sed = opipe->sed;
- dmap = &opipe->u.ctl.datadma;
- opipe->u.ctl.length = len;
-
- /* Update device address and length since they may have changed. */
- /* XXX This only needs to be done once, but it's too early in open. */
- sed->ed->ed_flags = LE(
- (LE(sed->ed->ed_flags) & ~(OHCI_ED_ADDRMASK | OHCI_ED_MAXPMASK)) |
- OHCI_ED_SET_FA(addr) |
- OHCI_ED_SET_MAXP(UGETW(opipe->pipe.endpoint->edesc->wMaxPacketSize)));
-
- /* Set up data transaction */
- if (len != 0) {
- xfer = ohci_alloc_std(sc);
- if (!xfer) {
- r = USBD_NOMEM;
- goto bad3;
- }
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad4;
- xfer->td->td_flags = LE(
- (isread ? OHCI_TD_IN : OHCI_TD_OUT) | OHCI_TD_NOCC |
- OHCI_TD_TOGGLE_1 | OHCI_TD_NOINTR |
- (reqh->flags & USBD_SHORT_XFER_OK ? OHCI_TD_R : 0));
- xfer->td->td_cbp = LE(DMAADDR(dmap));
- xfer->nexttd = stat;
- xfer->td->td_nexttd = LE(stat->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + len - 1);
- xfer->len = len;
- xfer->reqh = reqh;
-
- next = xfer;
- } else
- next = stat;
-
- memcpy(KERNADDR(&opipe->u.ctl.reqdma), req, sizeof *req);
- if (!isread && len != 0)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
- setup->td->td_flags = LE(OHCI_TD_SETUP | OHCI_TD_NOCC |
- OHCI_TD_TOGGLE_0 | OHCI_TD_NOINTR);
- setup->td->td_cbp = LE(DMAADDR(&opipe->u.ctl.reqdma));
- setup->nexttd = next;
- setup->td->td_nexttd = LE(next->physaddr);
- setup->td->td_be = LE(LE(setup->td->td_cbp) + sizeof *req - 1);
- setup->len = 0; /* XXX The number of byte we count */
- setup->reqh = reqh;
-
- stat->td->td_flags = LE(
- (isread ? OHCI_TD_OUT : OHCI_TD_IN) | OHCI_TD_NOCC |
- OHCI_TD_TOGGLE_1 | OHCI_TD_SET_DI(1));
- stat->td->td_cbp = 0;
- stat->nexttd = tail;
- stat->td->td_nexttd = LE(tail->physaddr);
- stat->td->td_be = 0;
- stat->len = 0;
- stat->reqh = reqh;
-
- reqh->hcpriv = stat;
-
-#if USB_DEBUG
- if (ohcidebug > 5) {
- printf("ohci_device_request:\n");
- ohci_dump_ed(sed);
- ohci_dump_tds(setup);
- }
-#endif
-
- /* Insert ED in schedule */
- s = splusb();
- ohci_hash_add_td(sc, setup);
- if (len != 0)
- ohci_hash_add_td(sc, xfer);
- ohci_hash_add_td(sc, stat);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(ohci_timeout, reqh,
- MS_TO_TICKS(reqh->timeout), reqh->timo_handle);
- }
- splx(s);
-
-#if USB_DEBUG
- if (ohcidebug > 5) {
- delay(5000);
- printf("ohci_device_request: status=%x\n",
- OREAD4(sc, OHCI_COMMAND_STATUS));
- ohci_dump_ed(sed);
- ohci_dump_tds(setup);
- }
-#endif
-
- return (USBD_NORMAL_COMPLETION);
-
- bad4:
- ohci_free_std(sc, xfer);
- bad3:
- ohci_free_std(sc, tail);
- bad2:
- ohci_free_std(sc, stat);
- bad1:
- return (r);
-}
-
-/*
- * Add an ED to the schedule. Called at splusb().
- */
-void
-ohci_add_ed(sed, head)
- ohci_soft_ed_t *sed;
- ohci_soft_ed_t *head;
-{
- sed->next = head->next;
- sed->ed->ed_nexted = head->ed->ed_nexted;
- head->next = sed;
- head->ed->ed_nexted = LE(sed->physaddr);
-}
-
-/*
- * Remove an ED from the schedule. Called at splusb().
- */
-void
-ohci_rem_ed(sed, head)
- ohci_soft_ed_t *sed;
- ohci_soft_ed_t *head;
-{
- ohci_soft_ed_t *p;
-
- /* XXX */
- for (p = head; p && p->next != sed; p = p->next)
- ;
- if (!p)
- panic("ohci_rem_ed: ED not found\n");
- p->next = sed->next;
- p->ed->ed_nexted = sed->ed->ed_nexted;
-}
-
-/*
- * When a transfer is completed the TD is added to the done queue by
- * the host controller. This queue is the processed by software.
- * Unfortunately the queue contains the physical address of the TD
- * and we have no simple way to translate this back to a kernel address.
- * To make the translation possible (and fast) we use a hash table of
- * TDs currently in the schedule. The physical address is used as the
- * hash value.
- */
-
-#define HASH(a) (((a) >> 4) % OHCI_HASH_SIZE)
-/* Called at splusb() */
-void
-ohci_hash_add_td(sc, std)
- ohci_softc_t *sc;
- ohci_soft_td_t *std;
-{
- int h = HASH(std->physaddr);
-
- LIST_INSERT_HEAD(&sc->sc_hash_tds[h], std, hnext);
-}
-
-/* Called at splusb() */
-void
-ohci_hash_rem_td(sc, std)
- ohci_softc_t *sc;
- ohci_soft_td_t *std;
-{
- LIST_REMOVE(std, hnext);
-}
-
-ohci_soft_td_t *
-ohci_hash_find_td(sc, a)
- ohci_softc_t *sc;
- ohci_physaddr_t a;
-{
- int h = HASH(a);
- ohci_soft_td_t *std;
-
- for (std = LIST_FIRST(&sc->sc_hash_tds[h]);
- std != 0;
- std = LIST_NEXT(std, hnext))
- if (std->physaddr == a)
- return (std);
- panic("ohci_hash_find_td: addr 0x%08lx not found\n", (u_long)a);
-}
-
-void
-ohci_timeout(addr)
- void *addr;
-{
-#if 0
- usbd_request_handle *reqh = addr;
- int s;
-
- DPRINTF(("ohci_timeout: reqh=%p\n", reqh));
- s = splusb();
- /* XXX need to inactivate TD before calling interrupt routine */
- ohci_XXX_done(reqh);
- splx(s);
-#endif
-}
-
-#ifdef USB_DEBUG
-void
-ohci_dump_tds(std)
- ohci_soft_td_t *std;
-{
- for (; std; std = std->nexttd)
- ohci_dump_td(std);
-}
-
-void
-ohci_dump_td(std)
- ohci_soft_td_t *std;
-{
- printf("TD(%p) at %08lx: %b delay=%d ec=%d cc=%d\ncbp=0x%08lx "
- "nexttd=0x%08lx be=0x%08lx\n",
- std, (u_long)std->physaddr,
- (int)LE(std->td->td_flags),
- "\20\23R\24OUT\25IN\31TOG1\32SETTOGGLE",
- OHCI_TD_GET_DI(LE(std->td->td_flags)),
- OHCI_TD_GET_EC(LE(std->td->td_flags)),
- OHCI_TD_GET_CC(LE(std->td->td_flags)),
- (u_long)LE(std->td->td_cbp),
- (u_long)LE(std->td->td_nexttd), (u_long)LE(std->td->td_be));
-}
-
-void
-ohci_dump_ed(sed)
- ohci_soft_ed_t *sed;
-{
- printf("ED(%p) at %08lx: addr=%d endpt=%d maxp=%d %b\ntailp=0x%08lx "
- "headp=%b nexted=0x%08lx\n",
- sed, (u_long)sed->physaddr,
- OHCI_ED_GET_FA(LE(sed->ed->ed_flags)),
- OHCI_ED_GET_EN(LE(sed->ed->ed_flags)),
- OHCI_ED_GET_MAXP(LE(sed->ed->ed_flags)),
- (int)LE(sed->ed->ed_flags),
- "\20\14OUT\15IN\16LOWSPEED\17SKIP\20ISO",
- (u_long)LE(sed->ed->ed_tailp),
- (int)LE(sed->ed->ed_headp), "\20\1HALT\2CARRY",
- (u_long)LE(sed->ed->ed_nexted));
-}
-#endif
-
-usbd_status
-ohci_open(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_device_handle dev = pipe->device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc;
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- u_int8_t addr = dev->address;
- ohci_soft_ed_t *sed;
- ohci_soft_td_t *std;
- usbd_status r;
- int s;
-
- DPRINTFN(1, ("ohci_open: pipe=%p, addr=%d, endpt=%d (%d)\n",
- pipe, addr, ed->bEndpointAddress, sc->sc_addr));
- if (addr == sc->sc_addr) {
- switch (ed->bEndpointAddress) {
- case USB_CONTROL_ENDPOINT:
- pipe->methods = &ohci_root_ctrl_methods;
- break;
- case UE_IN | OHCI_INTR_ENDPT:
- pipe->methods = &ohci_root_intr_methods;
- break;
- default:
- return (USBD_INVAL);
- }
- } else {
- sed = ohci_alloc_sed(sc);
- if (sed == 0)
- goto bad0;
- std = ohci_alloc_std(sc);
- if (std == 0)
- goto bad1;
- opipe->sed = sed;
- opipe->tail = std;
- sed->ed->ed_flags = LE(
- OHCI_ED_SET_FA(addr) |
- OHCI_ED_SET_EN(ed->bEndpointAddress) |
- OHCI_ED_DIR_TD |
- (dev->lowspeed ? OHCI_ED_SPEED : 0) |
- ((ed->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS ?
- OHCI_ED_FORMAT_ISO : OHCI_ED_FORMAT_GEN) |
- OHCI_ED_SET_MAXP(UGETW(ed->wMaxPacketSize)));
- sed->ed->ed_headp = sed->ed->ed_tailp = LE(std->physaddr);
-
- switch (ed->bmAttributes & UE_XFERTYPE) {
- case UE_CONTROL:
- pipe->methods = &ohci_device_ctrl_methods;
- r = usb_allocmem(sc->sc_dmatag,
- sizeof(usb_device_request_t),
- 0, &opipe->u.ctl.reqdma);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad;
- s = splusb();
- ohci_add_ed(sed, sc->sc_ctrl_head);
- splx(s);
- break;
- case UE_INTERRUPT:
- pipe->methods = &ohci_device_intr_methods;
- return (ohci_device_setintr(sc, opipe, ed->bInterval));
- case UE_ISOCHRONOUS:
- printf("ohci_open: open iso unimplemented\n");
- return (USBD_XXX);
- case UE_BULK:
- pipe->methods = &ohci_device_bulk_methods;
- s = splusb();
- ohci_add_ed(sed, sc->sc_bulk_head);
- splx(s);
- break;
- }
- }
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- ohci_free_std(sc, std);
- bad1:
- ohci_free_sed(sc, sed);
- bad0:
- return (USBD_NOMEM);
-
-}
-
-/*
- * Data structures and routines to emulate the root hub.
- */
-usb_device_descriptor_t ohci_devd = {
- USB_DEVICE_DESCRIPTOR_SIZE,
- UDESC_DEVICE, /* type */
- {0x00, 0x01}, /* USB version */
- UCLASS_HUB, /* class */
- USUBCLASS_HUB, /* subclass */
- 0, /* protocol */
- 64, /* max packet */
- {0},{0},{0x00,0x01}, /* device id */
- 1,2,0, /* string indicies */
- 1 /* # of configurations */
-};
-
-usb_config_descriptor_t ohci_confd = {
- USB_CONFIG_DESCRIPTOR_SIZE,
- UDESC_CONFIG,
- {USB_CONFIG_DESCRIPTOR_SIZE +
- USB_INTERFACE_DESCRIPTOR_SIZE +
- USB_ENDPOINT_DESCRIPTOR_SIZE},
- 1,
- 1,
- 0,
- UC_SELF_POWERED,
- 0 /* max power */
-};
-
-usb_interface_descriptor_t ohci_ifcd = {
- USB_INTERFACE_DESCRIPTOR_SIZE,
- UDESC_INTERFACE,
- 0,
- 0,
- 1,
- UCLASS_HUB,
- USUBCLASS_HUB,
- 0,
- 0
-};
-
-usb_endpoint_descriptor_t ohci_endpd = {
- USB_ENDPOINT_DESCRIPTOR_SIZE,
- UDESC_ENDPOINT,
- UE_IN | OHCI_INTR_ENDPT,
- UE_INTERRUPT,
- {8, 0}, /* max packet */
- 255
-};
-
-usb_hub_descriptor_t ohci_hubd = {
- USB_HUB_DESCRIPTOR_SIZE,
- UDESC_HUB,
- 0,
- {0,0},
- 0,
- 0,
- {0},
-};
-
-int
-ohci_str(p, l, s)
- usb_string_descriptor_t *p;
- int l;
- char *s;
-{
- int i;
-
- if (l == 0)
- return (0);
- p->bLength = 2 * strlen(s) + 2;
- if (l == 1)
- return (1);
- p->bDescriptorType = UDESC_STRING;
- l -= 2;
- for (i = 0; s[i] && l > 1; i++, l -= 2)
- USETW2(p->bString[i], 0, s[i]);
- return (2*i+2);
-}
-
-/*
- * Simulate a hardware hub by handling all the necessary requests.
- */
-usbd_status
-ohci_root_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_root_ctrl_start(reqh));
-}
-
-usbd_status
-ohci_root_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- ohci_softc_t *sc = (ohci_softc_t *)reqh->pipe->device->bus;
- usb_device_request_t *req;
- void *buf;
- int port, i;
- int len, value, index, l, totlen = 0;
- usb_port_status_t ps;
- usb_hub_descriptor_t hubd;
- usbd_status r;
- u_int32_t v;
-
- if (!reqh->isreq)
- /* XXX panic */
- return (USBD_INVAL);
- req = &reqh->request;
- buf = reqh->buffer;
-
- DPRINTFN(4,("ohci_root_ctrl_control type=0x%02x request=%02x\n",
- req->bmRequestType, req->bRequest));
-
- len = UGETW(req->wLength);
- value = UGETW(req->wValue);
- index = UGETW(req->wIndex);
-#define C(x,y) ((x) | ((y) << 8))
- switch(C(req->bRequest, req->bmRequestType)) {
- case C(UR_CLEAR_FEATURE, UT_WRITE_DEVICE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT):
- /*
- * DEVICE_REMOTE_WAKEUP and ENDPOINT_HALT are no-ops
- * for the integrated root hub.
- */
- break;
- case C(UR_GET_CONFIG, UT_READ_DEVICE):
- if (len > 0) {
- *(u_int8_t *)buf = sc->sc_conf;
- totlen = 1;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE):
- DPRINTFN(8,("ohci_root_ctrl_control wValue=0x%04x\n", value));
- switch(value >> 8) {
- case UDESC_DEVICE:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_DEVICE_DESCRIPTOR_SIZE);
- memcpy(buf, &ohci_devd, l);
- break;
- case UDESC_CONFIG:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_CONFIG_DESCRIPTOR_SIZE);
- memcpy(buf, &ohci_confd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_INTERFACE_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &ohci_ifcd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_ENDPOINT_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &ohci_endpd, l);
- break;
- case UDESC_STRING:
- if (len == 0)
- break;
- *(u_int8_t *)buf = 0;
- totlen = 1;
- switch (value & 0xff) {
- case 1: /* Vendor */
- totlen = ohci_str(buf, len, sc->sc_vendor);
- break;
- case 2: /* Product */
- totlen = ohci_str(buf, len, "OHCI root hub");
- break;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- case C(UR_GET_INTERFACE, UT_READ_INTERFACE):
- if (len > 0) {
- *(u_int8_t *)buf = 0;
- totlen = 1;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_DEVICE):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus,UDS_SELF_POWERED);
- totlen = 2;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_INTERFACE):
- case C(UR_GET_STATUS, UT_READ_ENDPOINT):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus, 0);
- totlen = 2;
- }
- break;
- case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
- if (value >= USB_MAX_DEVICES) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_addr = value;
- break;
- case C(UR_SET_CONFIG, UT_WRITE_DEVICE):
- if (value != 0 && value != 1) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_conf = value;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_DEVICE):
- case C(UR_SET_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_SET_FEATURE, UT_WRITE_ENDPOINT):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_INTERFACE, UT_WRITE_INTERFACE):
- break;
- case C(UR_SYNCH_FRAME, UT_WRITE_ENDPOINT):
- break;
- /* Hub requests */
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_OTHER):
- DPRINTFN(8, ("ohci_root_ctrl_control: UR_CLEAR_PORT_FEATURE "
- "port=%d feature=%d\n",
- index, value));
- if (index < 1 || index > sc->sc_noport) {
- r = USBD_IOERROR;
- goto ret;
- }
- port = OHCI_RH_PORT_STATUS(index);
- switch(value) {
- case UHF_PORT_ENABLE:
- OWRITE4(sc, port, UPS_CURRENT_CONNECT_STATUS);
- break;
- case UHF_PORT_SUSPEND:
- OWRITE4(sc, port, UPS_OVERCURRENT_INDICATOR);
- break;
- case UHF_PORT_POWER:
- OWRITE4(sc, port, UPS_LOW_SPEED);
- break;
- case UHF_C_PORT_CONNECTION:
- OWRITE4(sc, port, UPS_C_CONNECT_STATUS << 16);
- break;
- case UHF_C_PORT_ENABLE:
- OWRITE4(sc, port, UPS_C_PORT_ENABLED << 16);
- break;
- case UHF_C_PORT_SUSPEND:
- OWRITE4(sc, port, UPS_C_SUSPEND << 16);
- break;
- case UHF_C_PORT_OVER_CURRENT:
- OWRITE4(sc, port, UPS_C_OVERCURRENT_INDICATOR << 16);
- break;
- case UHF_C_PORT_RESET:
- OWRITE4(sc, port, UPS_C_PORT_RESET << 16);
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- switch(value) {
- case UHF_C_PORT_CONNECTION:
- case UHF_C_PORT_ENABLE:
- case UHF_C_PORT_SUSPEND:
- case UHF_C_PORT_OVER_CURRENT:
- case UHF_C_PORT_RESET:
- /* Enable RHSC interrupt if condition is cleared. */
- if ((OREAD4(sc, port) >> 16) == 0)
- ohci_rhsc_able(sc, 1);
- break;
- default:
- break;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE):
- if (value != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- v = OREAD4(sc, OHCI_RH_DESCRIPTOR_A);
- hubd = ohci_hubd;
- hubd.bNbrPorts = sc->sc_noport;
- USETW(hubd.wHubCharacteristics,
- (v & OHCI_NPS ? UHD_PWR_NO_SWITCH :
- v & OHCI_PSM ? UHD_PWR_GANGED : UHD_PWR_INDIVIDUAL)
- /* XXX overcurrent */
- );
- hubd.bPwrOn2PwrGood = OHCI_GET_POTPGT(v);
- v = OREAD4(sc, OHCI_RH_DESCRIPTOR_B);
- for (i = 0, l = sc->sc_noport; l > 0; i++, l -= 8, v >>= 8)
- hubd.DeviceRemovable[i++] = (u_int8_t)v;
- hubd.bDescLength = USB_HUB_DESCRIPTOR_SIZE + i;
- l = min(len, hubd.bDescLength);
- totlen = l;
- memcpy(buf, &hubd, l);
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE):
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- memset(buf, 0, len); /* ? XXX */
- totlen = len;
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_OTHER):
- DPRINTFN(8,("ohci_root_ctrl_transfer: get port status i=%d\n",
- index));
- if (index < 1 || index > sc->sc_noport) {
- r = USBD_IOERROR;
- goto ret;
- }
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- v = OREAD4(sc, OHCI_RH_PORT_STATUS(index));
- DPRINTFN(8,("ohci_root_ctrl_transfer: port status=0x%04x\n",
- v));
- USETW(ps.wPortStatus, v);
- USETW(ps.wPortChange, v >> 16);
- l = min(len, sizeof ps);
- memcpy(buf, &ps, l);
- totlen = l;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_CLASS_DEVICE):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_OTHER):
- if (index < 1 || index > sc->sc_noport) {
- r = USBD_IOERROR;
- goto ret;
- }
- port = OHCI_RH_PORT_STATUS(index);
- switch(value) {
- case UHF_PORT_ENABLE:
- OWRITE4(sc, port, UPS_PORT_ENABLED);
- break;
- case UHF_PORT_SUSPEND:
- OWRITE4(sc, port, UPS_SUSPEND);
- break;
- case UHF_PORT_RESET:
- DPRINTFN(5,("ohci_root_ctrl_transfer: reset port %d\n",
- index));
- OWRITE4(sc, port, UPS_RESET);
- for (i = 0; i < 10; i++) {
- usb_delay_ms(&sc->sc_bus, 10);
- if ((OREAD4(sc, port) & UPS_RESET) == 0)
- break;
- }
- DPRINTFN(8,("ohci port %d reset, status = 0x%04x\n",
- index, OREAD4(sc, port)));
- break;
- case UHF_PORT_POWER:
- DPRINTFN(2,("ohci_root_ctrl_transfer: set port power "
- "%d\n", index));
- OWRITE4(sc, port, UPS_PORT_POWER);
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- reqh->actlen = totlen;
- r = USBD_NORMAL_COMPLETION;
- ret:
- reqh->status = r;
- reqh->xfercb(reqh);
- usb_start_next(reqh->pipe);
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a root control request. */
-void
-ohci_root_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* Nothing to do, all transfers are synchronous. */
-}
-
-/* Close the root pipe. */
-void
-ohci_root_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- DPRINTF(("ohci_root_ctrl_close\n"));
-}
-
-usbd_status
-ohci_root_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_root_intr_start(reqh));
-}
-
-usbd_status
-ohci_root_intr_start(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- struct ohci_pipe *upipe = (struct ohci_pipe *)pipe;
- usb_dma_t *dmap;
- usbd_status r;
- int len;
-
- len = reqh->length;
- dmap = &upipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- sc->sc_intrreqh = reqh;
-
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a root interrupt request. */
-void
-ohci_root_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- /* No need to abort. */
-}
-
-/* Close the root pipe. */
-void
-ohci_root_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- sc->sc_intrreqh = 0;
-
- DPRINTF(("ohci_root_intr_close\n"));
-}
-
-/************************/
-
-usbd_status
-ohci_device_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_device_ctrl_start(reqh));
-}
-
-usbd_status
-ohci_device_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- ohci_softc_t *sc = (ohci_softc_t *)reqh->pipe->device->bus;
- usbd_status r;
-
- if (!reqh->isreq) {
- /* XXX panic */
- printf("ohci_device_ctrl_transfer: not a request\n");
- return (USBD_INVAL);
- }
-
- r = ohci_device_request(reqh);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- if (sc->sc_bus.use_polling)
- ohci_waitintr(sc, reqh);
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a device control request. */
-void
-ohci_device_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is donw */
- /* XXX call done */
-}
-
-/* Close a device control pipe. */
-void
-ohci_device_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- ohci_soft_ed_t *sed = opipe->sed;
- int s;
-
- s = splusb();
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if ((LE(sed->ed->ed_tailp) & OHCI_TAILMASK) != LE(sed->ed->ed_headp))
- usb_delay_ms(&sc->sc_bus, 2);
- ohci_rem_ed(sed, sc->sc_ctrl_head);
- splx(s);
- ohci_free_std(sc, opipe->tail);
- ohci_free_sed(sc, opipe->sed);
- /* XXX free other resources */
-}
-
-/************************/
-
-usbd_status
-ohci_device_bulk_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_device_bulk_start(reqh));
-}
-
-usbd_status
-ohci_device_bulk_start(reqh)
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- int addr = dev->address;
- ohci_soft_td_t *xfer, *tail;
- ohci_soft_ed_t *sed;
- usb_dma_t *dmap;
- usbd_status r;
- int s, len, isread;
-
- if (reqh->isreq) {
- /* XXX panic */
- printf("ohci_device_bulk_transfer: a request\n");
- return (USBD_INVAL);
- }
-
- len = reqh->length;
- dmap = &opipe->u.bulk.datadma;
- isread = reqh->pipe->endpoint->edesc->bEndpointAddress & UE_IN;
- sed = opipe->sed;
-
- opipe->u.bulk.length = len;
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
-
- tail = ohci_alloc_std(sc);
- if (!tail) {
- r = USBD_NOMEM;
- goto ret2;
- }
- tail->reqh = 0;
-
- /* Update device address */
- sed->ed->ed_flags = LE(
- (LE(sed->ed->ed_flags) & ~OHCI_ED_ADDRMASK) |
- OHCI_ED_SET_FA(addr));
-
- /* Set up data transaction */
- xfer = opipe->tail;
- xfer->td->td_flags = LE(
- (isread ? OHCI_TD_IN : OHCI_TD_OUT) | OHCI_TD_NOCC |
- OHCI_TD_SET_DI(1) | OHCI_TD_TOGGLE_CARRY |
- (reqh->flags & USBD_SHORT_XFER_OK ? OHCI_TD_R : 0));
- xfer->td->td_cbp = LE(DMAADDR(dmap));
- xfer->nexttd = tail;
- xfer->td->td_nexttd = LE(tail->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + len - 1);
- xfer->len = len;
- xfer->reqh = reqh;
-
- reqh->hcpriv = xfer;
-
- if (!isread)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
- /* Insert ED in schedule */
- s = splusb();
- ohci_hash_add_td(sc, xfer);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
- OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(ohci_timeout, reqh,
- MS_TO_TICKS(reqh->timeout), reqh->timo_handle);
- }
- splx(s);
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-/* Abort a device bulk request. */
-void
-ohci_device_bulk_abort(reqh)
- usbd_request_handle reqh;
-{
-#if 0
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if ((LE(sed->ed->ed_tailp) & OHCI_TAILMASK) != LE(sed->ed->ed_headp))
- usb_delay_ms(reqh->pipe->device->bus, 2);
-#endif
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is done */
- /* XXX call done */
-}
-
-/* Close a device bulk pipe. */
-void
-ohci_device_bulk_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- int s;
-
- s = splusb();
- ohci_rem_ed(opipe->sed, sc->sc_bulk_head);
- splx(s);
- ohci_free_std(sc, opipe->tail);
- ohci_free_sed(sc, opipe->sed);
- /* XXX free other resources */
-}
-
-/************************/
-
-usbd_status
-ohci_device_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (ohci_device_intr_start(reqh));
-}
-
-usbd_status
-ohci_device_intr_start(reqh)
- usbd_request_handle reqh;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)reqh->pipe;
- usbd_device_handle dev = opipe->pipe.device;
- ohci_softc_t *sc = (ohci_softc_t *)dev->bus;
- ohci_soft_ed_t *sed = opipe->sed;
- ohci_soft_td_t *xfer, *tail;
- usb_dma_t *dmap;
- usbd_status r;
- int len;
- int s;
-
- DPRINTFN(3, ("ohci_device_intr_transfer: reqh=%p buf=%p len=%d "
- "flags=%d priv=%p\n",
- reqh, reqh->buffer, reqh->length, reqh->flags, reqh->priv));
-
- if (reqh->isreq)
- panic("ohci_device_intr_transfer: a request\n");
-
- len = reqh->length;
- dmap = &opipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- xfer = opipe->tail;
- tail = ohci_alloc_std(sc);
- if (!tail) {
- r = USBD_NOMEM;
- goto ret1;
- }
- tail->reqh = 0;
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
-
- xfer->td->td_flags = LE(
- OHCI_TD_IN | OHCI_TD_NOCC |
- OHCI_TD_SET_DI(1) | OHCI_TD_TOGGLE_CARRY);
- if (reqh->flags & USBD_SHORT_XFER_OK)
- xfer->td->td_flags |= LE(OHCI_TD_R);
- xfer->td->td_cbp = LE(DMAADDR(dmap));
- xfer->nexttd = tail;
- xfer->td->td_nexttd = LE(tail->physaddr);
- xfer->td->td_be = LE(LE(xfer->td->td_cbp) + len - 1);
- xfer->len = len;
- xfer->reqh = reqh;
-
- reqh->hcpriv = xfer;
-
-#if USB_DEBUG
- if (ohcidebug > 5) {
- printf("ohci_device_intr_transfer:\n");
- ohci_dump_ed(sed);
- ohci_dump_tds(xfer);
- }
-#endif
-
- /* Insert ED in schedule */
- s = splusb();
- ohci_hash_add_td(sc, xfer);
- sed->ed->ed_tailp = LE(tail->physaddr);
- opipe->tail = tail;
-#if 0
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(ohci_timeout, reqh,
- MS_TO_TICKS(reqh->timeout), reqh->timo_handle);
- }
-#endif
- sed->ed->ed_flags &= LE(~OHCI_ED_SKIP);
-
-#ifdef USB_DEBUG
- if (ohcidebug > 5) {
- delay(5000);
- printf("ohci_device_intr_transfer: status=%x\n",
- OREAD4(sc, OHCI_COMMAND_STATUS));
- ohci_dump_ed(sed);
- ohci_dump_tds(xfer);
- }
-#endif
- /* moved splx(s) because of indefinite printing of TD's */
- splx(s);
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- ohci_free_std(sc, xfer);
- ret1:
- return (r);
-}
-
-/* Abort a device control request. */
-void
-ohci_device_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is done */
- if (reqh->pipe->intrreqh == reqh) {
- DPRINTF(("ohci_device_intr_abort: remove\n"));
- reqh->pipe->intrreqh = 0;
- ohci_intr_done((ohci_softc_t *)reqh->pipe->device->bus, reqh);
- }
-}
-
-/* Close a device interrupt pipe. */
-void
-ohci_device_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct ohci_pipe *opipe = (struct ohci_pipe *)pipe;
- ohci_softc_t *sc = (ohci_softc_t *)pipe->device->bus;
- int nslots = opipe->u.intr.nslots;
- int pos = opipe->u.intr.pos;
- int j;
- ohci_soft_ed_t *p, *sed = opipe->sed;
- int s;
-
- DPRINTFN(1,("ohci_device_intr_close: pipe=%p nslots=%d pos=%d\n",
- pipe, nslots, pos));
- s = splusb();
- sed->ed->ed_flags |= LE(OHCI_ED_SKIP);
- if ((sed->ed->ed_tailp & LE(OHCI_TAILMASK)) != sed->ed->ed_headp)
- usb_delay_ms(&sc->sc_bus, 2);
-
- for (p = sc->sc_eds[pos]; p && p->next != sed; p = p->next)
- ;
- if (!p)
- panic("ohci_device_intr_close: ED not found\n");
- p->next = sed->next;
- p->ed->ed_nexted = sed->ed->ed_nexted;
- splx(s);
-
- for (j = 0; j < nslots; j++)
- --sc->sc_bws[pos * nslots + j];
-
- ohci_free_std(sc, opipe->tail);
- ohci_free_sed(sc, opipe->sed);
- /* XXX free other resources */
-}
-
-usbd_status
-ohci_device_setintr(sc, opipe, ival)
- ohci_softc_t *sc;
- struct ohci_pipe *opipe;
- int ival;
-{
- int i, j, s, best;
- u_int npoll, slow, shigh, nslots;
- u_int bestbw, bw;
- ohci_soft_ed_t *hsed, *sed = opipe->sed;
-
- DPRINTFN(2, ("ohci_setintr: pipe=%p\n", opipe));
- if (ival == 0) {
- printf("ohci_setintr: 0 interval\n");
- return (USBD_INVAL);
- }
-
- npoll = OHCI_NO_INTRS;
- while (npoll > ival)
- npoll /= 2;
- DPRINTFN(2, ("ohci_setintr: ival=%d npoll=%d\n", ival, npoll));
-
- /*
- * We now know which level in the tree the ED must go into.
- * Figure out which slot has most bandwidth left over.
- * Slots to examine:
- * npoll
- * 1 0
- * 2 1 2
- * 4 3 4 5 6
- * 8 7 8 9 10 11 12 13 14
- * N (N-1) .. (N-1+N-1)
- */
- slow = npoll-1;
- shigh = slow + npoll;
- nslots = OHCI_NO_INTRS / npoll;
- for (best = i = slow, bestbw = ~0; i < shigh; i++) {
- bw = 0;
- for (j = 0; j < nslots; j++)
- bw += sc->sc_bws[i * nslots + j];
- if (bw < bestbw) {
- best = i;
- bestbw = bw;
- }
- }
- DPRINTFN(2, ("ohci_setintr: best=%d(%d..%d) bestbw=%d\n",
- best, slow, shigh, bestbw));
-
- s = splusb();
- hsed = sc->sc_eds[best];
- sed->next = hsed->next;
- sed->ed->ed_nexted = hsed->ed->ed_nexted;
- hsed->next = sed;
- hsed->ed->ed_nexted = LE(sed->physaddr);
- splx(s);
-
- for (j = 0; j < nslots; j++)
- ++sc->sc_bws[best * nslots + j];
- opipe->u.intr.nslots = nslots;
- opipe->u.intr.pos = best;
-
- DPRINTFN(5, ("ohci_setintr: returns %p\n", opipe));
- return (USBD_NORMAL_COMPLETION);
-}
-
diff --git a/sys/dev/usb/ohcireg.h b/sys/dev/usb/ohcireg.h
deleted file mode 100644
index bd44e8be40711..0000000000000
--- a/sys/dev/usb/ohcireg.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/* $NetBSD: ohcireg.h,v 1.7 1998/12/10 23:16:47 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DEV_PCI_OHCIREG_H_
-#define _DEV_PCI_OHCIREG_H_
-
-/*** PCI config registers ***/
-
-#define PCI_CBMEM 0x10 /* configuration base memory */
-
-#define PCI_INTERFACE_OHCI 0x10
-
-/*** OHCI registers */
-
-#define OHCI_REVISION 0x00 /* OHCI revision # */
-#define OHCI_REV_LO(rev) ((rev)&0xf)
-#define OHCI_REV_HI(rev) (((rev)>>4)&0xf)
-#define OHCI_REV_LEGACY(rev) ((rev) & 0x100)
-
-#define OHCI_CONTROL 0x04
-#define OHCI_CBSR_MASK 0x00000003 /* Control/Bulk Service Ratio */
-#define OHCI_RATIO_1_1 0x00000000
-#define OHCI_RATIO_1_2 0x00000001
-#define OHCI_RATIO_1_3 0x00000002
-#define OHCI_RATIO_1_4 0x00000003
-#define OHCI_PLE 0x00000004 /* Periodic List Enable */
-#define OHCI_IE 0x00000008 /* Isochronous Enable */
-#define OHCI_CLE 0x00000010 /* Control List Enable */
-#define OHCI_BLE 0x00000020 /* Bulk List Enable */
-#define OHCI_HCFS_MASK 0x000000c0 /* HostControllerFunctionalState */
-#define OHCI_HCFS_RESET 0x00000000
-#define OHCI_HCFS_RESUME 0x00000040
-#define OHCI_HCFS_OPERATIONAL 0x00000080
-#define OHCI_HCFS_SUSPEND 0x000000c0
-#define OHCI_IR 0x00000100 /* Interrupt Routing */
-#define OHCI_RWC 0x00000200 /* Remote Wakeup Connected */
-#define OHCI_RWE 0x00000400 /* Remote Wakeup Enabled */
-#define OHCI_COMMAND_STATUS 0x08
-#define OHCI_HCR 0x00000001 /* Host Controller Reset */
-#define OHCI_CLF 0x00000002 /* Control List Filled */
-#define OHCI_BLF 0x00000004 /* Bulk List Filled */
-#define OHCI_OCR 0x00000008 /* Ownership Change Request */
-#define OHCI_SOC_MASK 0x00030000 /* Scheduling Overrun Count */
-#define OHCI_INTERRUPT_STATUS 0x0c
-#define OHCI_SO 0x00000001 /* Scheduling Overrun */
-#define OHCI_WDH 0x00000002 /* Writeback Done Head */
-#define OHCI_SF 0x00000004 /* Start of Frame */
-#define OHCI_RD 0x00000008 /* Resume Detected */
-#define OHCI_UE 0x00000010 /* Unrecoverable Error */
-#define OHCI_FNO 0x00000020 /* Frame Number Overflow */
-#define OHCI_RHSC 0x00000040 /* Root Hub Status Change */
-#define OHCI_OC 0x40000000 /* Ownership Change */
-#define OHCI_MIE 0x80000000 /* Master Interrupt Enable */
-#define OHCI_INTERRUPT_ENABLE 0x10
-#define OHCI_INTERRUPT_DISABLE 0x14
-#define OHCI_HCCA 0x18
-#define OHCI_PERIOD_CURRENT_ED 0x1c
-#define OHCI_CONTROL_HEAD_ED 0x20
-#define OHCI_CONTROL_CURRENT_ED 0x24
-#define OHCI_BULK_HEAD_ED 0x28
-#define OHCI_BULK_CURRENT_ED 0x2c
-#define OHCI_DONE_HEAD 0x30
-#define OHCI_FM_INTERVAL 0x34
-#define OHCI_GET_IVAL(s) ((s) & 0x3fff)
-#define OHCI_GET_FSMPS(s) (((s) >> 16) & 0x7fff)
-#define OHCI_FIT 0x80000000
-#define OHCI_FM_REMAINING 0x38
-#define OHCI_FM_NUMBER 0x3c
-#define OHCI_PERIODIC_START 0x40
-#define OHCI_LS_THRESHOLD 0x44
-#define OHCI_RH_DESCRIPTOR_A 0x48
-#define OHCI_GET_NDP(s) ((s) & 0xff)
-#define OHCI_PSM 0x0100 /* Power Switching Mode */
-#define OHCI_NPS 0x0200 /* No Power Switching */
-#define OHCI_GET_POTPGT(s) ((s) >> 24)
-#define OHCI_RH_DESCRIPTOR_B 0x4c
-#define OHCI_RH_STATUS 0x50
-#define OHCI_LPS 0x00000001 /* Local Power Status */
-#define OHCI_OCI 0x00000002 /* OverCurrent Indicator */
-#define OHCI_DRWE 0x00008000 /* Device Remote Wakeup Enable */
-#define OHCI_LPSC 0x00010000 /* Local Power Status Change */
-#define OHCI_CCIC 0x00020000 /* OverCurrent Indicator Change */
-#define OHCI_CRWE 0x80000000 /* Clear Remote Wakeup Enable */
-#define OHCI_RH_PORT_STATUS(n) (0x50 + (n)*4) /* 1 based indexing */
-
-#define OHCI_LES (OHCI_PLE | OHCI_IE | OHCI_CLE | OHCI_BLE)
-#define OHCI_ALL_INTRS (OHCI_SO | OHCI_WDH | OHCI_SF | OHCI_RD | OHCI_UE | \
- OHCI_FNO | OHCI_RHSC | OHCI_OC)
-#define OHCI_NORMAL_INTRS (OHCI_SO | OHCI_WDH | OHCI_RD | OHCI_UE | OHCI_RHSC)
-
-#define OHCI_FSMPS(i) (((i-210)*6/7) << 16)
-#define OHCI_PERIODIC(i) ((i)*9/10)
-
-typedef u_int32_t ohci_physaddr_t;
-
-#define OHCI_NO_INTRS 32
-struct ohci_hcca {
- ohci_physaddr_t hcca_interrupt_table[OHCI_NO_INTRS];
- u_int32_t hcca_frame_number;
- ohci_physaddr_t hcca_done_head;
-#define OHCI_DONE_INTRS 1
-};
-#define OHCI_HCCA_SIZE 256
-#define OHCI_HCCA_ALIGN 256
-
-typedef struct {
- u_int32_t ed_flags;
-#define OHCI_ED_GET_FA(s) ((s) & 0x7f)
-#define OHCI_ED_ADDRMASK 0x0000007f
-#define OHCI_ED_SET_FA(s) (s)
-#define OHCI_ED_GET_EN(s) (((s) >> 7) & 0xf)
-#define OHCI_ED_SET_EN(s) ((s) << 7)
-#define OHCI_ED_DIR_MASK 0x00001800
-#define OHCI_ED_DIR_TD 0x00000000
-#define OHCI_ED_DIR_OUT 0x00000800
-#define OHCI_ED_DIR_IN 0x00001000
-#define OHCI_ED_SPEED 0x00002000
-#define OHCI_ED_SKIP 0x00004000
-#define OHCI_ED_FORMAT_GEN 0x00000000
-#define OHCI_ED_FORMAT_ISO 0x00008000
-#define OHCI_ED_GET_MAXP(s) (((s) >> 16) & 0x07ff)
-#define OHCI_ED_SET_MAXP(s) ((s) << 16)
-#define OHCI_ED_MAXPMASK (0x7ff << 16)
- ohci_physaddr_t ed_tailp;
-#define OHCI_HALTED 0x00000002
-#define OHCI_TOGGLECARRY 0x00000001
-#define OHCI_TAILMASK 0xfffffffc
- ohci_physaddr_t ed_headp;
- ohci_physaddr_t ed_nexted;
-} ohci_ed_t;
-#define OHCI_ED_SIZE 16
-#define OHCI_ED_ALIGN 16
-
-typedef struct {
- u_int32_t td_flags;
-#define OHCI_TD_R 0x00040000 /* Buffer Rounding */
-#define OHCI_TD_DP_MASK 0x00180000 /* Direction / PID */
-#define OHCI_TD_SETUP 0x00000000
-#define OHCI_TD_OUT 0x00080000
-#define OHCI_TD_IN 0x00100000
-#define OHCI_TD_GET_DI(x) (((x) >> 21) & 7) /* Delay Interrupt */
-#define OHCI_TD_SET_DI(x) ((x) << 21)
-#define OHCI_TD_NOINTR 0x00e00000
-#define OHCI_TD_TOGGLE_CARRY 0x00000000
-#define OHCI_TD_TOGGLE_0 0x02000000
-#define OHCI_TD_TOGGLE_1 0x03000000
-#define OHCI_TD_GET_EC(x) (((x) >> 26) & 3) /* Error Count */
-#define OHCI_TD_GET_CC(x) ((x) >> 28) /* Condition Code */
-#define OHCI_TD_NOCC 0xf0000000
- ohci_physaddr_t td_cbp; /* Current Buffer Pointer */
- ohci_physaddr_t td_nexttd; /* Next TD */
- ohci_physaddr_t td_be; /* Buffer End */
-} ohci_td_t;
-#define OHCI_TD_SIZE 16
-#define OHCI_TD_ALIGN 16
-
-#define OHCI_CC_NO_ERROR 0
-#define OHCI_CC_CRC 1
-#define OHCI_CC_BIT_STUFFING 2
-#define OHCI_CC_DATA_TOGGLE_MISMATCH 3
-#define OHCI_CC_STALL 4
-#define OHCI_CC_DEVICE_NOT_RESPONDING 5
-#define OHCI_CC_PID_CHECK_FAILURE 6
-#define OHCI_CC_UNEXPECTED_PID 7
-#define OHCI_CC_DATA_OVERRUN 8
-#define OHCI_CC_DATA_UNDERRUN 9
-#define OHCI_CC_BUFFER_OVERRUN 12
-#define OHCI_CC_BUFFER_UNDERRUN 13
-#define OHCI_CC_NOT_ACCESSED 15
-
-#endif /* _DEV_PCI_OHCIREG_H_ */
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
deleted file mode 100644
index db8631f7976e1..0000000000000
--- a/sys/dev/usb/ohcivar.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $NetBSD: ohcivar.h,v 1.4 1998/12/26 12:53:01 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-typedef struct ohci_soft_ed {
- ohci_ed_t *ed;
- struct ohci_soft_ed *next;
- ohci_physaddr_t physaddr;
-} ohci_soft_ed_t;
-#define OHCI_ED_CHUNK 256
-
-typedef struct ohci_soft_td {
- ohci_td_t *td;
- struct ohci_soft_td *nexttd; /* mirrors nexttd in TD */
- struct ohci_soft_td *dnext; /* next in done list */
- ohci_physaddr_t physaddr;
- LIST_ENTRY(ohci_soft_td) hnext;
- /*ohci_soft_ed_t *sed;*/
- usbd_request_handle reqh;
- u_int16_t len;
-} ohci_soft_td_t;
-#define OHCI_TD_CHUNK 256
-
-#define OHCI_NO_EDS (2*OHCI_NO_INTRS-1)
-
-#define OHCI_HASH_SIZE 128
-
-typedef struct ohci_softc {
- struct usbd_bus sc_bus; /* base device */
-#if defined(__NetBSD__)
- void *sc_ih; /* interrupt vectoring */
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
-
- bus_dma_tag_t sc_dmatag; /* DMA tag */
- /* XXX should keep track of all DMA memory */
-
-#elif defined(__FreeBSD__)
- int sc_iobase;
- int unit;
-#endif /* __FreeBSD__ */
-
- usb_dma_t sc_hccadma;
- struct ohci_hcca *sc_hcca;
- ohci_soft_ed_t *sc_eds[OHCI_NO_EDS];
- u_int sc_bws[OHCI_NO_INTRS];
-
- u_int32_t sc_eintrs;
- ohci_soft_ed_t *sc_ctrl_head;
- ohci_soft_ed_t *sc_bulk_head;
-
- LIST_HEAD(, ohci_soft_td) sc_hash_tds[OHCI_HASH_SIZE];
-
- int sc_noport;
- u_int8_t sc_addr; /* device address */
- u_int8_t sc_conf; /* device configuration */
-
- ohci_soft_ed_t *sc_freeeds;
- ohci_soft_td_t *sc_freetds;
-
- usbd_request_handle sc_intrreqh;
-
- int sc_intrs;
- char sc_vendor[16];
-} ohci_softc_t;
-
-usbd_status ohci_init __P((ohci_softc_t *));
-int ohci_intr __P((void *));
-
-#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ohcidebug) printf x
-#define DPRINTFN(n,x) if (ohcidebug>(n)) printf x
-extern int ohcidebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
deleted file mode 100644
index 749cad455f3f3..0000000000000
--- a/sys/dev/usb/ucom.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* $NetBSD: ucom.c,v 1.6 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <dev/usb/usb_port.h>
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/hid.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ucomdebug) printf x
-#define DPRINTFN(n,x) if (ucomdebug>(n)) printf x
-int ucomdebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct ucom_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
-};
-
-void ucom_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void ucom_disco __P((void *));
-
-USB_DECLARE_DRIVER(ucom);
-
-USB_MATCH(ucom)
-{
- USB_MATCH_START(ucom, uaa);
- usb_interface_descriptor_t *id;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (id &&
- id->bInterfaceClass != UCLASS_CDC ||
- id->bInterfaceSubClass != USUBCLASS_ABSTRACT_CONTROL_MODEL)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_IFACESUBCLASS);
-}
-
-USB_ATTACH(ucom)
-{
- USB_ATTACH_START(ucom, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- char devinfo[1024];
-
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-ucom_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-#endif
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(ucom, uhub, ucom_driver, ucom_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
deleted file mode 100644
index f739b4b642c95..0000000000000
--- a/sys/dev/usb/ugen.c
+++ /dev/null
@@ -1,985 +0,0 @@
-/* $NetBSD: ugen.c,v 1.11 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#include <sys/fcntl.h>
-#include <sys/filio.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ugendebug) printf x
-#define DPRINTFN(n,x) if (ugendebug>(n)) printf x
-int ugendebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct ugen_endpoint {
- struct ugen_softc *sc;
- usb_endpoint_descriptor_t *edesc;
- usbd_interface_handle iface;
- int state;
-#define UGEN_OPEN 0x01 /* device is open */
-#define UGEN_ASLP 0x02 /* waiting for data */
-#define UGEN_SHORT_OK 0x04 /* short xfers are OK */
- usbd_pipe_handle pipeh;
- struct clist q;
- struct selinfo rsel;
- void *ibuf;
-};
-
-#define UGEN_CHUNK 128 /* chunk size for read */
-#define UGEN_IBSIZE 1020 /* buffer size */
-#define UGEN_BBSIZE 1024
-
-struct ugen_softc {
- bdevice sc_dev; /* base device */
- struct usbd_device *sc_udev;
-
- struct ugen_endpoint sc_endpoints[USB_MAX_ENDPOINTS][2];
-#define OUT 0 /* index order is important, from UE_OUT */
-#define IN 1 /* from UE_IN */
-
- int sc_disconnected; /* device is gone */
-};
-
-int ugenopen __P((dev_t, int, int, struct proc *));
-int ugenclose __P((dev_t, int, int, struct proc *p));
-int ugenread __P((dev_t, struct uio *uio, int));
-int ugenwrite __P((dev_t, struct uio *uio, int));
-int ugenioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-int ugenpoll __P((dev_t, int, struct proc *));
-void ugenintr __P((usbd_request_handle reqh, usbd_private_handle addr,
- usbd_status status));
-void ugen_disco __P((void *));
-
-#define UGEN_CDEV_MAJOR 114
-
-int ugen_set_config __P((struct ugen_softc *sc, int configno));
-usb_config_descriptor_t *ugen_get_cdesc __P((struct ugen_softc *sc, int index,
- int *lenp));
-usbd_status ugen_set_interface __P((struct ugen_softc *, int, int));
-int ugen_get_alt_index __P((struct ugen_softc *sc, int ifaceidx));
-
-#define UGENUNIT(n) (((n) >> 4) & 0xf)
-#define UGENENDPOINT(n) ((n) & 0xf)
-
-USB_DECLARE_DRIVER(ugen);
-
-USB_MATCH(ugen)
-{
- USB_MATCH_START(ugen, uaa);
-
- if (uaa->usegeneric)
- return (UMATCH_GENERIC);
- else
- return (UMATCH_NONE);
-}
-
-USB_ATTACH(ugen)
-{
- USB_ATTACH_START(ugen, sc, uaa);
- char devinfo[1024];
- usbd_status r;
- int conf;
-
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
-
- sc->sc_udev = uaa->device;
- conf = 1; /* XXX should not hard code 1 */
- r = ugen_set_config(sc, conf);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: setting configuration %d failed\n",
- USBDEVNAME(sc->sc_dev), conf);
- sc->sc_disconnected = 1;
- USB_ATTACH_ERROR_RETURN;
- }
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-int
-ugen_set_config(sc, configno)
- struct ugen_softc *sc;
- int configno;
-{
- usbd_device_handle dev = sc->sc_udev;
- usbd_interface_handle iface;
- usb_endpoint_descriptor_t *ed;
- struct ugen_endpoint *sce;
- u_int8_t niface, nendpt;
- int ifaceno, endptno, endpt;
- usbd_status r;
-
- DPRINTFN(1,("ugen_set_config: %s to configno %d, sc=%p\n",
- USBDEVNAME(sc->sc_dev), configno, sc));
- if (usbd_get_config_descriptor(dev)->bConfigurationValue != configno) {
- /* Avoid setting the current value. */
- r = usbd_set_config_no(dev, configno, 0);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- }
-
- r = usbd_interface_count(dev, &niface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- memset(sc->sc_endpoints, 0, sizeof sc->sc_endpoints);
- for (ifaceno = 0; ifaceno < niface; ifaceno++) {
- DPRINTFN(1,("ugen_set_config: ifaceno %d\n", ifaceno));
- r = usbd_device2interface_handle(dev, ifaceno, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- r = usbd_endpoint_count(iface, &nendpt);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- for (endptno = 0; endptno < nendpt; endptno++) {
- ed = usbd_interface2endpoint_descriptor(iface,endptno);
- endpt = ed->bEndpointAddress;
- sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)]
- [UE_GET_IN(endpt)];
- DPRINTFN(1,("ugen_set_config: endptno %d, endpt=0x%02x"
- "(%d,%d), sce=%p\n",
- endptno, endpt, UE_GET_ADDR(endpt),
- UE_GET_IN(endpt), sce));
- sce->sc = sc;
- sce->edesc = ed;
- sce->iface = iface;
- }
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-ugen_disco(p)
- void *p;
-{
- struct ugen_softc *sc = p;
- sc->sc_disconnected = 1;
-}
-
-int
-ugenopen(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- int unit = UGENUNIT(dev);
- int endpt = UGENENDPOINT(dev);
- usb_endpoint_descriptor_t *edesc;
- struct ugen_endpoint *sce;
- int dir, isize;
- usbd_status r;
-
- USB_GET_SC_OPEN(ugen, unit, sc);
- DPRINTFN(5, ("ugenopen: flag=%d, mode=%d, unit=%d endpt=%d\n",
- flag, mode, unit, endpt));
-
- if (sc->sc_disconnected)
- return (EIO);
-
- if (endpt == USB_CONTROL_ENDPOINT) {
- /*if ((flag & (FWRITE|FREAD)) != (FWRITE|FREAD))
- return (EACCES);*/
- sce = &sc->sc_endpoints[USB_CONTROL_ENDPOINT][OUT];
- if (sce->state & UGEN_OPEN)
- return (EBUSY);
- } else {
- switch (flag & (FWRITE|FREAD)) {
- case FWRITE:
- dir = OUT;
- break;
- case FREAD:
- dir = IN;
- break;
- default:
- return (EACCES);
- }
- sce = &sc->sc_endpoints[endpt][dir];
- DPRINTFN(5, ("ugenopen: sc=%p, endpt=%d, dir=%d, sce=%p\n",
- sc, endpt, dir, sce));
- if (sce->state & UGEN_OPEN)
- return (EBUSY);
- edesc = sce->edesc;
- if (!edesc)
- return (ENXIO);
- switch (edesc->bmAttributes & UE_XFERTYPE) {
- case UE_INTERRUPT:
- isize = UGETW(edesc->wMaxPacketSize);
- if (isize == 0) /* shouldn't happen */
- return (EINVAL);
- sce->ibuf = malloc(isize, M_USB, M_WAITOK);
- DPRINTFN(5, ("ugenopen: intr endpt=%d,isize=%d\n",
- endpt, isize));
-#if defined(__NetBSD__)
- if (clalloc(&sce->q, UGEN_IBSIZE, 0) == -1)
- return (ENOMEM);
-#elif defined(__FreeBSD__)
- clist_alloc_cblocks(&sce->q, UGEN_IBSIZE, 0);
-#endif
- r = usbd_open_pipe_intr(sce->iface,
- edesc->bEndpointAddress,
- USBD_SHORT_XFER_OK, &sce->pipeh, sce,
- sce->ibuf, isize, ugenintr);
- if (r != USBD_NORMAL_COMPLETION) {
- free(sce->ibuf, M_USB);
-#if defined(__NetBSD__)
- clfree(&sce->q);
-#elif defined(__FreeBSD__)
- clist_free_cblocks(&sce->q);
-#endif
- return (EIO);
- }
- usbd_set_disco(sce->pipeh, ugen_disco, sc);
- DPRINTFN(5, ("ugenopen: interrupt open done\n"));
- break;
- case UE_BULK:
- r = usbd_open_pipe(sce->iface,
- edesc->bEndpointAddress, 0,
- &sce->pipeh);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- break;
- case UE_CONTROL:
- case UE_ISOCHRONOUS:
- return (EINVAL);
- }
- }
- sce->state |= UGEN_OPEN;
- return (0);
-}
-
-int
-ugenclose(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce;
- int dir;
-
- DPRINTFN(5, ("ugenclose: flag=%d, mode=%d\n", flag, mode));
- if (sc->sc_disconnected)
- return (EIO);
-
- if (endpt == USB_CONTROL_ENDPOINT) {
- DPRINTFN(5, ("ugenclose: close control\n"));
- sc->sc_endpoints[endpt][OUT].state = 0;
- return (0);
- }
-
- flag = FWRITE | FREAD; /* XXX bug if generic open/close */
-
- /* The open modes have been joined, so check for both modes. */
- for (dir = OUT; dir <= IN; dir++) {
- if (flag & (dir == OUT ? FWRITE : FREAD)) {
- sce = &sc->sc_endpoints[endpt][dir];
- if (!sce || !sce->pipeh) /* XXX */
- continue; /* XXX */
- DPRINTFN(5, ("ugenclose: endpt=%d dir=%d sce=%p\n",
- endpt, dir, sce));
- sce->state = 0;
-
- usbd_abort_pipe(sce->pipeh);
- usbd_close_pipe(sce->pipeh);
- sce->pipeh = 0;
-
- if (sce->ibuf) {
- free(sce->ibuf, M_USB);
- sce->ibuf = 0;
- }
- }
- }
-
- return (0);
-}
-
-int
-ugenread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][IN];
- u_int32_t n, tn;
- char buf[UGEN_BBSIZE];
- usbd_request_handle reqh;
- usbd_status r;
- int s;
- int error = 0;
- u_char buffer[UGEN_CHUNK];
-
- DPRINTFN(5, ("ugenread: %d:%d\n", UGENUNIT(dev), UGENENDPOINT(dev)));
- if (sc->sc_disconnected)
- return (EIO);
-
-#ifdef DIAGNOSTIC
- if (!sce->edesc) {
- printf("ugenread: no edesc\n");
- return (EIO);
- }
- if (!sce->pipeh) {
- printf("ugenread: no pipe\n");
- return (EIO);
- }
-#endif
-
- switch (sce->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_INTERRUPT:
- /* Block until activity occured. */
- s = splusb();
- while (sce->q.c_cc == 0) {
- if (flag & IO_NDELAY) {
- splx(s);
- return (EWOULDBLOCK);
- }
- sce->state |= UGEN_ASLP;
- DPRINTFN(5, ("ugenread: sleep on %p\n", sc));
- error = tsleep((caddr_t)sce, PZERO | PCATCH,
- "ugenri", 0);
- DPRINTFN(5, ("ugenread: woke, error=%d\n", error));
- if (error) {
- sce->state &= ~UGEN_ASLP;
- splx(s);
- return (error);
- }
- }
- splx(s);
-
- /* Transfer as many chunks as possible. */
- while (sce->q.c_cc > 0 && uio->uio_resid > 0) {
- n = min(sce->q.c_cc, uio->uio_resid);
- if (n > sizeof(buffer))
- n = sizeof(buffer);
-
- /* Remove a small chunk from the input queue. */
- q_to_b(&sce->q, buffer, n);
- DPRINTFN(5, ("ugenread: got %d chars\n", n));
-
- /* Copy the data to the user process. */
- error = uiomove(buffer, n, uio);
- if (error)
- break;
- }
- break;
- case UE_BULK:
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (ENOMEM);
- while ((n = min(UGEN_BBSIZE, uio->uio_resid)) != 0) {
- DPRINTFN(1, ("ugenread: start transfer %d bytes\n", n));
- tn = n;
- r = usbd_bulk_transfer(reqh, sce->pipeh, 0, buf,
- &tn, "ugenrb");
- if (r != USBD_NORMAL_COMPLETION) {
- if (r == USBD_INTERRUPTED)
- error = EINTR;
- else
- error = EIO;
- break;
- }
- DPRINTFN(1, ("ugenread: got %d bytes\n", tn));
- error = uiomove(buf, tn, uio);
- if (error || tn < n)
- break;
- }
- usbd_free_request(reqh);
- break;
- default:
- return (ENXIO);
- }
-
- return (error);
-}
-
-int
-ugenwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][OUT];
- size_t n;
- int error = 0;
- char buf[UGEN_BBSIZE];
- usbd_request_handle reqh;
- usbd_status r;
-
- if (sc->sc_disconnected)
- return (EIO);
-
-#ifdef DIAGNOSTIC
- if (!sce->edesc) {
- printf("ugenwrite: no edesc\n");
- return (EIO);
- }
- if (!sce->pipeh) {
- printf("ugenwrite: no pipe\n");
- return (EIO);
- }
-#endif
-
- DPRINTF(("ugenwrite\n"));
- switch (sce->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_BULK:
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (EIO);
- while ((n = min(UGEN_BBSIZE, uio->uio_resid)) != 0) {
- error = uiomove(buf, n, uio);
- if (error)
- break;
- DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n));
- r = usbd_bulk_transfer(reqh, sce->pipeh, 0, buf,
- &n, "ugenwb");
- if (r != USBD_NORMAL_COMPLETION) {
- if (r == USBD_INTERRUPTED)
- error = EINTR;
- else
- error = EIO;
- break;
- }
- }
- usbd_free_request(reqh);
- break;
- default:
- return (ENXIO);
- }
- return (error);
-}
-
-
-void
-ugenintr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct ugen_endpoint *sce = addr;
- /*struct ugen_softc *sc = sce->sc;*/
- usbd_private_handle priv;
- void *buffer;
- u_int32_t count;
- usbd_status xstatus;
- u_char *ibuf;
-
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ugenintr: status=%d\n", status));
- usbd_clear_endpoint_stall_async(sce->pipeh);
- return;
- }
-
- (void)usbd_get_request_status(reqh, &priv, &buffer, &count, &xstatus);
- ibuf = sce->ibuf;
-
- DPRINTFN(5, ("ugenintr: reqh=%p status=%d count=%d\n",
- reqh, xstatus, count));
- DPRINTFN(5, (" data = %02x %02x %02x\n",
- ibuf[0], ibuf[1], ibuf[2]));
-
- (void)b_to_q(ibuf, count, &sce->q);
-
- if (sce->state & UGEN_ASLP) {
- sce->state &= ~UGEN_ASLP;
- DPRINTFN(5, ("ugen_intr: waking %p\n", sce));
- wakeup((caddr_t)sce);
- }
- selwakeup(&sce->rsel);
-}
-
-usbd_status
-ugen_set_interface(sc, ifaceidx, altno)
- struct ugen_softc *sc;
- int ifaceidx, altno;
-{
- usbd_interface_handle iface;
- usb_endpoint_descriptor_t *ed;
- usbd_status r;
- struct ugen_endpoint *sce;
- u_int8_t niface, nendpt, endptno, endpt;
-
- DPRINTFN(15, ("ugen_set_interface %d %d\n", ifaceidx, altno));
-
- r = usbd_interface_count(sc->sc_udev, &niface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (ifaceidx < 0 || ifaceidx >= niface)
- return (USBD_INVAL);
-
- r = usbd_device2interface_handle(sc->sc_udev, ifaceidx, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- r = usbd_endpoint_count(iface, &nendpt);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- for (endptno = 0; endptno < nendpt; endptno++) {
- ed = usbd_interface2endpoint_descriptor(iface,endptno);
- endpt = ed->bEndpointAddress;
- sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)][UE_GET_IN(endpt)];
- sce->sc = 0;
- sce->edesc = 0;
- sce->iface = 0;
- }
-
- /* change setting */
- r = usbd_set_interface(iface, altno);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- r = usbd_endpoint_count(iface, &nendpt);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- for (endptno = 0; endptno < nendpt; endptno++) {
- ed = usbd_interface2endpoint_descriptor(iface,endptno);
- endpt = ed->bEndpointAddress;
- sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)][UE_GET_IN(endpt)];
- sce->sc = sc;
- sce->edesc = ed;
- sce->iface = iface;
- }
- return (0);
-}
-
-/* Retrieve a complete descriptor for a certain device and index. */
-usb_config_descriptor_t *
-ugen_get_cdesc(sc, index, lenp)
- struct ugen_softc *sc;
- int index;
- int *lenp;
-{
- usb_config_descriptor_t *cdesc, *tdesc, cdescr;
- int len;
- usbd_status r;
-
- if (index == USB_CURRENT_CONFIG_INDEX) {
- tdesc = usbd_get_config_descriptor(sc->sc_udev);
- len = UGETW(tdesc->wTotalLength);
- if (lenp)
- *lenp = len;
- cdesc = malloc(len, M_TEMP, M_WAITOK);
- memcpy(cdesc, tdesc, len);
- DPRINTFN(5,("ugen_get_cdesc: current, len=%d\n", len));
- } else {
- r = usbd_get_config_desc(sc->sc_udev, index, &cdescr);
- if (r != USBD_NORMAL_COMPLETION)
- return (0);
- len = UGETW(cdescr.wTotalLength);
- DPRINTFN(5,("ugen_get_cdesc: index=%d, len=%d\n", index, len));
- if (lenp)
- *lenp = len;
- cdesc = malloc(len, M_TEMP, M_WAITOK);
- r = usbd_get_config_desc_full(sc->sc_udev, index, cdesc, len);
- if (r != USBD_NORMAL_COMPLETION) {
- free(cdesc, M_TEMP);
- return (0);
- }
- }
- return (cdesc);
-}
-
-int
-ugen_get_alt_index(sc, ifaceidx)
- struct ugen_softc *sc;
- int ifaceidx;
-{
- usbd_interface_handle iface;
- usbd_status r;
-
- r = usbd_device2interface_handle(sc->sc_udev, ifaceidx, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (-1);
- return (usbd_get_interface_altindex(iface));
-}
-
-int
-ugenioctl(dev, cmd, addr, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t addr;
- int flag;
- struct proc *p;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- int endpt = UGENENDPOINT(dev);
- struct ugen_endpoint *sce;
- usbd_status r;
- usbd_interface_handle iface;
- struct usb_config_desc *cd;
- usb_config_descriptor_t *cdesc;
- struct usb_interface_desc *id;
- usb_interface_descriptor_t *idesc;
- struct usb_endpoint_desc *ed;
- usb_endpoint_descriptor_t *edesc;
- struct usb_alt_interface *ai;
- struct usb_string_desc *si;
- u_int8_t conf, alt;
-
- DPRINTFN(5, ("ugenioctl: cmd=%08lx\n", cmd));
- if (sc->sc_disconnected)
- return (EIO);
-
- switch (cmd) {
- case FIONBIO:
- /* All handled in the upper FS layer. */
- return (0);
- case USB_SET_SHORT_XFER:
- /* This flag only affects read */
- sce = &sc->sc_endpoints[endpt][IN];
-#ifdef DIAGNOSTIC
- if (!sce->pipeh) {
- printf("ugenioctl: no pipe\n");
- return (EIO);
- }
-#endif
- if (*(int *)addr)
- sce->state |= UGEN_SHORT_OK;
- else
- sce->state &= ~UGEN_SHORT_OK;
- return (0);
- default:
- break;
- }
-
- if (endpt != USB_CONTROL_ENDPOINT)
- return (EINVAL);
-
- switch (cmd) {
-#ifdef USB_DEBUG
- case USB_SETDEBUG:
- ugendebug = *(int *)addr;
- break;
-#endif
- case USB_GET_CONFIG:
- r = usbd_get_config(sc->sc_udev, &conf);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- *(int *)addr = conf;
- break;
- case USB_SET_CONFIG:
- if (!(flag & FWRITE))
- return (EPERM);
- r = ugen_set_config(sc, *(int *)addr);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- break;
- case USB_GET_ALTINTERFACE:
- ai = (struct usb_alt_interface *)addr;
- r = usbd_device2interface_handle(sc->sc_udev,
- ai->interface_index, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- idesc = usbd_get_interface_descriptor(iface);
- if (!idesc)
- return (EIO);
- ai->alt_no = idesc->bAlternateSetting;
- break;
- case USB_SET_ALTINTERFACE:
- if (!(flag & FWRITE))
- return (EPERM);
- ai = (struct usb_alt_interface *)addr;
- r = usbd_device2interface_handle(sc->sc_udev,
- ai->interface_index, &iface);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- r = ugen_set_interface(sc, ai->interface_index, ai->alt_no);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- break;
- case USB_GET_NO_ALT:
- ai = (struct usb_alt_interface *)addr;
- cdesc = ugen_get_cdesc(sc, ai->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- idesc = usbd_find_idesc(cdesc, ai->interface_index, 0);
- if (!idesc)
- return (EINVAL);
- ai->alt_no = usbd_get_no_alts(cdesc, idesc->bInterfaceNumber);
- break;
- case USB_GET_DEVICE_DESC:
- *(usb_device_descriptor_t *)addr =
- *usbd_get_device_descriptor(sc->sc_udev);
- break;
- case USB_GET_CONFIG_DESC:
- cd = (struct usb_config_desc *)addr;
- cdesc = ugen_get_cdesc(sc, cd->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- cd->desc = *cdesc;
- free(cdesc, M_TEMP);
- break;
- case USB_GET_INTERFACE_DESC:
- id = (struct usb_interface_desc *)addr;
- cdesc = ugen_get_cdesc(sc, id->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- if (id->config_index == USB_CURRENT_CONFIG_INDEX &&
- id->alt_index == USB_CURRENT_ALT_INDEX)
- alt = ugen_get_alt_index(sc, id->interface_index);
- else
- alt = id->alt_index;
- idesc = usbd_find_idesc(cdesc, id->interface_index, alt);
- if (!idesc) {
- free(cdesc, M_TEMP);
- return (EINVAL);
- }
- id->desc = *idesc;
- free(cdesc, M_TEMP);
- break;
- case USB_GET_ENDPOINT_DESC:
- ed = (struct usb_endpoint_desc *)addr;
- cdesc = ugen_get_cdesc(sc, ed->config_index, 0);
- if (!cdesc)
- return (EINVAL);
- if (ed->config_index == USB_CURRENT_CONFIG_INDEX &&
- ed->alt_index == USB_CURRENT_ALT_INDEX)
- alt = ugen_get_alt_index(sc, ed->interface_index);
- else
- alt = ed->alt_index;
- edesc = usbd_find_edesc(cdesc, ed->interface_index,
- alt, ed->endpoint_index);
- if (!edesc) {
- free(cdesc, M_TEMP);
- return (EINVAL);
- }
- ed->desc = *edesc;
- free(cdesc, M_TEMP);
- break;
- case USB_GET_FULL_DESC:
- {
- int len;
- struct iovec iov;
- struct uio uio;
- struct usb_full_desc *fd = (struct usb_full_desc *)addr;
- int error;
-
- cdesc = ugen_get_cdesc(sc, fd->config_index, &len);
- if (len > fd->size)
- len = fd->size;
- iov.iov_base = (caddr_t)fd->data;
- iov.iov_len = len;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_resid = len;
- uio.uio_offset = 0;
- uio.uio_segflg = UIO_USERSPACE;
- uio.uio_rw = UIO_READ;
- uio.uio_procp = p;
- error = uiomove((caddr_t)cdesc, len, &uio);
- free(cdesc, M_TEMP);
- return (error);
- }
- case USB_GET_STRING_DESC:
- si = (struct usb_string_desc *)addr;
- r = usbd_get_string_desc(sc->sc_udev, si->string_index,
- si->language_id, &si->desc);
- if (r != USBD_NORMAL_COMPLETION)
- return (EINVAL);
- break;
- case USB_DO_REQUEST:
- {
- struct usb_ctl_request *ur = (void *)addr;
- int len = UGETW(ur->request.wLength);
- struct iovec iov;
- struct uio uio;
- void *ptr = 0;
- usbd_status r;
- int error = 0;
-
- if (!(flag & FWRITE))
- return (EPERM);
- /* Avoid requests that would damage the bus integrity. */
- if ((ur->request.bmRequestType == UT_WRITE_DEVICE &&
- ur->request.bRequest == UR_SET_ADDRESS) ||
- (ur->request.bmRequestType == UT_WRITE_DEVICE &&
- ur->request.bRequest == UR_SET_CONFIG) ||
- (ur->request.bmRequestType == UT_WRITE_INTERFACE &&
- ur->request.bRequest == UR_SET_INTERFACE))
- return (EINVAL);
-
- if (len < 0 || len > 32767)
- return (EINVAL);
- if (len != 0) {
- iov.iov_base = (caddr_t)ur->data;
- iov.iov_len = len;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_resid = len;
- uio.uio_offset = 0;
- uio.uio_segflg = UIO_USERSPACE;
- uio.uio_rw =
- ur->request.bmRequestType & UT_READ ?
- UIO_READ : UIO_WRITE;
- uio.uio_procp = p;
- ptr = malloc(len, M_TEMP, M_WAITOK);
- if (uio.uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- r = usbd_do_request_flags(sc->sc_udev, &ur->request,
- ptr, ur->flags, &ur->actlen);
- if (r) {
- error = EIO;
- goto ret;
- }
- if (len != 0) {
- if (uio.uio_rw == UIO_READ) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- ret:
- if (ptr)
- free(ptr, M_TEMP);
- return (error);
- }
- case USB_GET_DEVICEINFO:
- usbd_fill_deviceinfo(sc->sc_udev,
- (struct usb_device_info *)addr);
- break;
- default:
- return (EINVAL);
- }
- return (0);
-}
-
-int
-ugenpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
- /* XXX */
- struct ugen_endpoint *sce;
- int revents = 0;
- int s;
-
- if (sc->sc_disconnected)
- return (EIO);
-
- sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN];
-#ifdef DIAGNOSTIC
- if (!sce->edesc) {
- printf("ugenwrite: no edesc\n");
- return (EIO);
- }
- if (!sce->pipeh) {
- printf("ugenpoll: no pipe\n");
- return (EIO);
- }
-#endif
- s = splusb();
- switch (sce->edesc->bmAttributes & UE_XFERTYPE) {
- case UE_INTERRUPT:
- if (events & (POLLIN | POLLRDNORM)) {
- if (sce->q.c_cc > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sce->rsel);
- }
- break;
- case UE_BULK:
- /*
- * We have no easy way of determining if a read will
- * yield any data or a write will happen.
- * Pretend they will.
- */
- revents |= events &
- (POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM);
- break;
- default:
- break;
- }
- splx(s);
- return (revents);
-}
-
-#if defined(__FreeBSD__)
-static int
-ugen_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-
-DRIVER_MODULE(ugen, uhub, ugen_driver, ugen_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
deleted file mode 100644
index 707bfe3795ba8..0000000000000
--- a/sys/dev/usb/uhci.c
+++ /dev/null
@@ -1,2620 +0,0 @@
-/* $NetBSD: uhci.c,v 1.22 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: uhci.c,v 1.6 1999/01/07 23:31:33 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * USB Universal Host Controller driver.
- * Handles PIIX3 and PIIX4.
- *
- * Data sheets: ftp://download.intel.com/design/intarch/datashts/29055002.pdf
- * ftp://download.intel.com/design/intarch/datashts/29056201.pdf
- * UHCI spec: http://www.intel.com/design/usb/uhci11d.pdf
- * USB spec: http://www.teleport.com/cgi-bin/mailmerge.cgi/~usb/cgiform.tpl
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-#include <sys/queue.h>
-#include <sys/select.h>
-
-#include <machine/bus.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_mem.h>
-#include <dev/usb/usb_quirks.h>
-
-#include <dev/usb/uhcireg.h>
-#include <dev/usb/uhcivar.h>
-
-#if defined(__FreeBSD__)
-#include <machine/clock.h>
-
-#define delay(d) DELAY(d)
-#endif
-
-#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
-
-struct uhci_pipe {
- struct usbd_pipe pipe;
- uhci_intr_info_t *iinfo;
- int newtoggle;
- /* Info needed for different pipe kinds. */
- union {
- /* Control pipe */
- struct {
- uhci_soft_qh_t *sqh;
- usb_dma_t reqdma;
- usb_dma_t datadma;
- uhci_soft_td_t *setup, *stat;
- u_int length;
- } ctl;
- /* Interrupt pipe */
- struct {
- usb_dma_t datadma;
- int npoll;
- uhci_soft_qh_t **qhs;
- } intr;
- /* Bulk pipe */
- struct {
- uhci_soft_qh_t *sqh;
- usb_dma_t datadma;
- u_int length;
- int isread;
- } bulk;
- /* Iso pipe */
- struct iso {
- u_int bufsize;
- u_int nbuf;
- usb_dma_t *bufs;
- uhci_soft_td_t **stds;
- } iso;
- } u;
-};
-
-/*
- * The uhci_intr_info free list can be global since they contain
- * no dma specific data. The other free lists do.
- */
-LIST_HEAD(, uhci_intr_info) uhci_ii_free;
-
-void uhci_busreset __P((uhci_softc_t *));
-usbd_status uhci_run __P((uhci_softc_t *, int run));
-uhci_soft_td_t *uhci_alloc_std __P((uhci_softc_t *));
-void uhci_free_std __P((uhci_softc_t *, uhci_soft_td_t *));
-uhci_soft_qh_t *uhci_alloc_sqh __P((uhci_softc_t *));
-void uhci_free_sqh __P((uhci_softc_t *, uhci_soft_qh_t *));
-uhci_intr_info_t *uhci_alloc_intr_info __P((uhci_softc_t *));
-void uhci_free_intr_info __P((uhci_intr_info_t *ii));
-#if 0
-void uhci_enter_ctl_q __P((uhci_softc_t *, uhci_soft_qh_t *,
- uhci_intr_info_t *));
-void uhci_exit_ctl_q __P((uhci_softc_t *, uhci_soft_qh_t *));
-#endif
-
-void uhci_free_std_chain __P((uhci_softc_t *,
- uhci_soft_td_t *, uhci_soft_td_t *));
-usbd_status uhci_alloc_std_chain __P((struct uhci_pipe *, uhci_softc_t *,
- int, int, int, usb_dma_t *,
- uhci_soft_td_t **,
- uhci_soft_td_t **));
-void uhci_timo __P((void *));
-void uhci_waitintr __P((uhci_softc_t *, usbd_request_handle));
-void uhci_check_intr __P((uhci_softc_t *, uhci_intr_info_t *));
-void uhci_ii_done __P((uhci_intr_info_t *, int));
-void uhci_timeout __P((void *));
-void uhci_wakeup_ctrl __P((void *, int, int, void *, int));
-void uhci_lock_frames __P((uhci_softc_t *));
-void uhci_unlock_frames __P((uhci_softc_t *));
-void uhci_add_ctrl __P((uhci_softc_t *, uhci_soft_qh_t *));
-void uhci_add_bulk __P((uhci_softc_t *, uhci_soft_qh_t *));
-void uhci_remove_ctrl __P((uhci_softc_t *, uhci_soft_qh_t *));
-void uhci_remove_bulk __P((uhci_softc_t *, uhci_soft_qh_t *));
-int uhci_str __P((usb_string_descriptor_t *, int, char *));
-
-void uhci_wakeup_cb __P((usbd_request_handle reqh));
-
-usbd_status uhci_device_ctrl_transfer __P((usbd_request_handle));
-usbd_status uhci_device_ctrl_start __P((usbd_request_handle));
-void uhci_device_ctrl_abort __P((usbd_request_handle));
-void uhci_device_ctrl_close __P((usbd_pipe_handle));
-usbd_status uhci_device_intr_transfer __P((usbd_request_handle));
-usbd_status uhci_device_intr_start __P((usbd_request_handle));
-void uhci_device_intr_abort __P((usbd_request_handle));
-void uhci_device_intr_close __P((usbd_pipe_handle));
-usbd_status uhci_device_bulk_transfer __P((usbd_request_handle));
-usbd_status uhci_device_bulk_start __P((usbd_request_handle));
-void uhci_device_bulk_abort __P((usbd_request_handle));
-void uhci_device_bulk_close __P((usbd_pipe_handle));
-usbd_status uhci_device_isoc_transfer __P((usbd_request_handle));
-usbd_status uhci_device_isoc_start __P((usbd_request_handle));
-void uhci_device_isoc_abort __P((usbd_request_handle));
-void uhci_device_isoc_close __P((usbd_pipe_handle));
-usbd_status uhci_device_isoc_setbuf __P((usbd_pipe_handle, u_int, u_int));
-
-usbd_status uhci_root_ctrl_transfer __P((usbd_request_handle));
-usbd_status uhci_root_ctrl_start __P((usbd_request_handle));
-void uhci_root_ctrl_abort __P((usbd_request_handle));
-void uhci_root_ctrl_close __P((usbd_pipe_handle));
-usbd_status uhci_root_intr_transfer __P((usbd_request_handle));
-usbd_status uhci_root_intr_start __P((usbd_request_handle));
-void uhci_root_intr_abort __P((usbd_request_handle));
-void uhci_root_intr_close __P((usbd_pipe_handle));
-
-usbd_status uhci_open __P((usbd_pipe_handle));
-void uhci_poll __P((struct usbd_bus *));
-
-usbd_status uhci_device_request __P((usbd_request_handle reqh));
-void uhci_ctrl_done __P((uhci_intr_info_t *ii));
-void uhci_bulk_done __P((uhci_intr_info_t *ii));
-
-void uhci_add_intr __P((uhci_softc_t *, int, uhci_soft_qh_t *));
-void uhci_remove_intr __P((uhci_softc_t *, int, uhci_soft_qh_t *));
-usbd_status uhci_device_setintr __P((uhci_softc_t *sc,
- struct uhci_pipe *pipe, int ival));
-void uhci_intr_done __P((uhci_intr_info_t *ii));
-void uhci_isoc_done __P((uhci_intr_info_t *ii));
-
-#ifdef USB_DEBUG
-static void uhci_dumpregs __P((uhci_softc_t *));
-void uhci_dump_tds __P((uhci_soft_td_t *));
-void uhci_dump_qh __P((uhci_soft_qh_t *));
-void uhci_dump __P((void));
-void uhci_dump_td __P((uhci_soft_td_t *));
-#endif
-
-#if defined(__NetBSD__)
-#define UWRITE2(sc, r, x) bus_space_write_2((sc)->iot, (sc)->ioh, (r), (x))
-#define UWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x))
-#define UREAD2(sc, r) bus_space_read_2((sc)->iot, (sc)->ioh, (r))
-#define UREAD4(sc, r) bus_space_read_4((sc)->iot, (sc)->ioh, (r))
-#elif defined(__FreeBSD__)
-#define UWRITE2(sc,r,x) outw((sc)->sc_iobase + (r), (x))
-#define UWRITE4(sc,r,x) outl((sc)->sc_iobase + (r), (x))
-#define UREAD2(sc,r) inw((sc)->sc_iobase + (r))
-#define UREAD4(sc,r) inl((sc)->sc_iobase + (r))
-#endif
-
-#define UHCICMD(sc, cmd) UWRITE2(sc, UHCI_CMD, cmd)
-#define UHCISTS(sc) UREAD2(sc, UHCI_STS)
-
-#define UHCI_RESET_TIMEOUT 100 /* reset timeout */
-
-#define UHCI_CURFRAME(sc) (UREAD2(sc, UHCI_FRNUM) & UHCI_FRNUM_MASK)
-
-#define UHCI_INTR_ENDPT 1
-
-struct usbd_methods uhci_root_ctrl_methods = {
- uhci_root_ctrl_transfer,
- uhci_root_ctrl_start,
- uhci_root_ctrl_abort,
- uhci_root_ctrl_close,
- 0,
-};
-
-struct usbd_methods uhci_root_intr_methods = {
- uhci_root_intr_transfer,
- uhci_root_intr_start,
- uhci_root_intr_abort,
- uhci_root_intr_close,
- 0,
-};
-
-struct usbd_methods uhci_device_ctrl_methods = {
- uhci_device_ctrl_transfer,
- uhci_device_ctrl_start,
- uhci_device_ctrl_abort,
- uhci_device_ctrl_close,
- 0,
-};
-
-struct usbd_methods uhci_device_intr_methods = {
- uhci_device_intr_transfer,
- uhci_device_intr_start,
- uhci_device_intr_abort,
- uhci_device_intr_close,
- 0,
-};
-
-struct usbd_methods uhci_device_bulk_methods = {
- uhci_device_bulk_transfer,
- uhci_device_bulk_start,
- uhci_device_bulk_abort,
- uhci_device_bulk_close,
- 0,
-};
-
-struct usbd_methods uhci_device_isoc_methods = {
- uhci_device_isoc_transfer,
- uhci_device_isoc_start,
- uhci_device_isoc_abort,
- uhci_device_isoc_close,
- uhci_device_isoc_setbuf,
-};
-
-void
-uhci_busreset(sc)
- uhci_softc_t *sc;
-{
- UHCICMD(sc, UHCI_CMD_GRESET); /* global reset */
- usb_delay_ms(&sc->sc_bus, USB_BUS_RESET_DELAY); /* wait a little */
- UHCICMD(sc, 0); /* do nothing */
-}
-
-usbd_status
-uhci_init(sc)
- uhci_softc_t *sc;
-{
- usbd_status r;
- int i, j;
- uhci_soft_qh_t *csqh, *bsqh, *sqh;
- uhci_soft_td_t *std;
- usb_dma_t dma;
- static int uhci_global_init_done = 0;
-
- DPRINTFN(1,("uhci_init: start\n"));
-
- if (!uhci_global_init_done) {
- uhci_global_init_done = 1;
- LIST_INIT(&uhci_ii_free);
- }
-
-#if defined(USB_DEBUG)
- if (uhcidebug > 2)
- uhci_dumpregs(sc);
-#endif
-
- uhci_run(sc, 0); /* stop the controller */
- UWRITE2(sc, UHCI_INTR, 0); /* disable interrupts */
-
- /* Allocate and initialize real frame array. */
- r = usb_allocmem(sc->sc_dmatag,
- UHCI_FRAMELIST_COUNT * sizeof(uhci_physaddr_t),
- UHCI_FRAMELIST_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- sc->sc_pframes = KERNADDR(&dma);
- UWRITE2(sc, UHCI_FRNUM, 0); /* set frame number to 0 */
- UWRITE4(sc, UHCI_FLBASEADDR, DMAADDR(&dma)); /* set frame list */
-
- uhci_busreset(sc);
-
- /* Allocate the dummy QH where bulk traffic will be queued. */
- bsqh = uhci_alloc_sqh(sc);
- if (!bsqh)
- return (USBD_NOMEM);
- bsqh->qh->qh_hlink = UHCI_PTR_T; /* end of QH chain */
- bsqh->qh->qh_elink = UHCI_PTR_T;
- sc->sc_bulk_start = sc->sc_bulk_end = bsqh;
-
- /* Allocate the dummy QH where control traffic will be queued. */
- csqh = uhci_alloc_sqh(sc);
- if (!csqh)
- return (USBD_NOMEM);
- csqh->qh->hlink = bsqh;
- csqh->qh->qh_hlink = bsqh->physaddr | UHCI_PTR_Q;
- csqh->qh->qh_elink = UHCI_PTR_T;
- sc->sc_ctl_start = sc->sc_ctl_end = csqh;
-
- /*
- * Make all (virtual) frame list pointers point to the interrupt
- * queue heads and the interrupt queue heads at the control
- * queue head and point the physical frame list to the virtual.
- */
- for(i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- std = uhci_alloc_std(sc);
- sqh = uhci_alloc_sqh(sc);
- if (!std || !sqh)
- return (USBD_NOMEM);
- std->td->link.sqh = sqh;
- std->td->td_link = sqh->physaddr | UHCI_PTR_Q;
- std->td->td_status = UHCI_TD_IOS; /* iso, inactive */
- std->td->td_token = 0;
- std->td->td_buffer = 0;
- sqh->qh->hlink = csqh;
- sqh->qh->qh_hlink = csqh->physaddr | UHCI_PTR_Q;
- sqh->qh->elink = 0;
- sqh->qh->qh_elink = UHCI_PTR_T;
- sc->sc_vframes[i].htd = std;
- sc->sc_vframes[i].etd = std;
- sc->sc_vframes[i].hqh = sqh;
- sc->sc_vframes[i].eqh = sqh;
- for (j = i;
- j < UHCI_FRAMELIST_COUNT;
- j += UHCI_VFRAMELIST_COUNT)
- sc->sc_pframes[j] = std->physaddr;
- }
-
- LIST_INIT(&sc->sc_intrhead);
-
- /* Set up the bus struct. */
- sc->sc_bus.open_pipe = uhci_open;
- sc->sc_bus.pipe_size = sizeof(struct uhci_pipe);
- sc->sc_bus.do_poll = uhci_poll;
-
- DPRINTFN(1,("uhci_init: enabling\n"));
- UWRITE2(sc, UHCI_INTR, UHCI_INTR_TOCRCIE | UHCI_INTR_RIE |
- UHCI_INTR_IOCE | UHCI_INTR_SPIE); /* enable interrupts */
-
- return (uhci_run(sc, 1)); /* and here we go... */
-}
-
-#ifdef USB_DEBUG
-static void
-uhci_dumpregs(sc)
- uhci_softc_t *sc;
-{
- printf("%s; regs: cmd=%04x, sts=%04x, intr=%04x, frnum=%04x, "
- "flbase=%08x, sof=%04x, portsc1=%04x, portsc2=%04x\n",
- USBDEVNAME(sc->sc_bus.bdev),
- UREAD2(sc, UHCI_CMD),
- UREAD2(sc, UHCI_STS),
- UREAD2(sc, UHCI_INTR),
- UREAD2(sc, UHCI_FRNUM),
- UREAD2(sc, UHCI_FLBASEADDR),
- UREAD2(sc, UHCI_SOF),
- UREAD2(sc, UHCI_PORTSC1),
- UREAD2(sc, UHCI_PORTSC2));
-}
-
-int uhci_longtd = 1;
-
-void
-uhci_dump_td(p)
- uhci_soft_td_t *p;
-{
- printf("TD(%p) at %08lx = 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n",
- p, (long)p->physaddr,
- (long)p->td->td_link,
- (long)p->td->td_status,
- (long)p->td->td_token,
- (long)p->td->td_buffer);
- if (uhci_longtd)
- printf(" %b %b,errcnt=%d,actlen=%d pid=%02x,addr=%d,endpt=%d,"
- "D=%d,maxlen=%d\n",
- (int)p->td->td_link,
- "\20\1T\2Q\3VF",
- (int)p->td->td_status,
- "\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
- "STALLED\30ACTIVE\31IOC\32ISO\33LS\36SPD",
- UHCI_TD_GET_ERRCNT(p->td->td_status),
- UHCI_TD_GET_ACTLEN(p->td->td_status),
- UHCI_TD_GET_PID(p->td->td_token),
- UHCI_TD_GET_DEVADDR(p->td->td_token),
- UHCI_TD_GET_ENDPT(p->td->td_token),
- UHCI_TD_GET_DT(p->td->td_token),
- UHCI_TD_GET_MAXLEN(p->td->td_token));
-}
-
-void
-uhci_dump_qh(p)
- uhci_soft_qh_t *p;
-{
- printf("QH(%p) at %08x: hlink=%08x elink=%08x\n", p, (int)p->physaddr,
- p->qh->qh_hlink, p->qh->qh_elink);
-}
-
-
-#if 0
-void
-uhci_dump()
-{
- uhci_softc_t *sc = uhci;
-
- uhci_dumpregs(sc);
- printf("intrs=%d\n", sc->sc_intrs);
- printf("framelist[i].link = %08x\n", sc->sc_framelist[0].link);
- uhci_dump_qh(sc->sc_ctl_start->qh->hlink);
-}
-#endif
-
-void
-uhci_dump_tds(std)
- uhci_soft_td_t *std;
-{
- uhci_soft_td_t *p;
-
- for(p = std; p; p = p->td->link.std)
- uhci_dump_td(p);
-}
-#endif
-
-/*
- * This routine is executed periodically and simulates interrupts
- * from the root controller interrupt pipe for port status change.
- */
-void
-uhci_timo(addr)
- void *addr;
-{
- usbd_request_handle reqh = addr;
- usbd_pipe_handle pipe = reqh->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- int s;
- u_char *p;
-
- DPRINTFN(15, ("uhci_timo\n"));
-
- p = KERNADDR(&upipe->u.intr.datadma);
- p[0] = 0;
- if (UREAD2(sc, UHCI_PORTSC1) & (UHCI_PORTSC_CSC|UHCI_PORTSC_OCIC))
- p[0] |= 1<<1;
- if (UREAD2(sc, UHCI_PORTSC2) & (UHCI_PORTSC_CSC|UHCI_PORTSC_OCIC))
- p[0] |= 1<<2;
- s = splusb();
- if (p[0] != 0) {
- reqh->actlen = 1;
- reqh->status = USBD_NORMAL_COMPLETION;
- reqh->xfercb(reqh);
- }
- if (reqh->pipe->intrreqh == reqh) {
- usb_timeout(uhci_timo, reqh, sc->sc_ival, reqh->timo_handle);
- } else {
- usb_freemem(sc->sc_dmatag, &upipe->u.intr.datadma);
- usb_start_next(reqh->pipe);
- }
- splx(s);
-}
-
-
-void
-uhci_lock_frames(sc)
- uhci_softc_t *sc;
-{
- int s = splusb();
- while (sc->sc_vflock) {
- sc->sc_vflock |= UHCI_WANT_LOCK;
- tsleep(&sc->sc_vflock, PRIBIO, "uhcqhl", 0);
- }
- sc->sc_vflock = UHCI_HAS_LOCK;
- splx(s);
-}
-
-void
-uhci_unlock_frames(sc)
- uhci_softc_t *sc;
-{
- int s = splusb();
- sc->sc_vflock &= ~UHCI_HAS_LOCK;
- if (sc->sc_vflock & UHCI_WANT_LOCK)
- wakeup(&sc->sc_vflock);
- splx(s);
-}
-
-/*
- * Allocate an interrupt information struct. A free list is kept
- * for fast allocation.
- */
-uhci_intr_info_t *
-uhci_alloc_intr_info(sc)
- uhci_softc_t *sc;
-{
- uhci_intr_info_t *ii;
-
- ii = LIST_FIRST(&uhci_ii_free);
- if (ii)
- LIST_REMOVE(ii, list);
- else {
- ii = malloc(sizeof(uhci_intr_info_t), M_USBDEV, M_NOWAIT);
- }
- ii->sc = sc;
- return ii;
-}
-
-void
-uhci_free_intr_info(ii)
- uhci_intr_info_t *ii;
-{
- LIST_INSERT_HEAD(&uhci_ii_free, ii, list); /* and put on free list */
-}
-
-/* Add control QH, called at splusb(). */
-void
-uhci_add_ctrl(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_qh_t *eqh;
-
- DPRINTFN(10, ("uhci_add_ctrl: sqh=%p\n", sqh));
- eqh = sc->sc_ctl_end->qh;
- sqh->qh->hlink = eqh->hlink;
- sqh->qh->qh_hlink = eqh->qh_hlink;
- eqh->hlink = sqh;
- eqh->qh_hlink = sqh->physaddr | UHCI_PTR_Q;
- sc->sc_ctl_end = sqh;
-}
-
-/* Remove control QH, called at splusb(). */
-void
-uhci_remove_ctrl(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_soft_qh_t *pqh;
-
- DPRINTFN(10, ("uhci_remove_ctrl: sqh=%p\n", sqh));
- for (pqh = sc->sc_ctl_start; pqh->qh->hlink != sqh; pqh=pqh->qh->hlink)
-#if defined(DIAGNOSTIC) || defined(USB_DEBUG)
- if (pqh->qh->qh_hlink & UHCI_PTR_T) {
- printf("uhci_remove_ctrl: QH not found\n");
- return;
- }
-#else
- ;
-#endif
- pqh->qh->hlink = sqh->qh->hlink;
- pqh->qh->qh_hlink = sqh->qh->qh_hlink;
- if (sc->sc_ctl_end == sqh)
- sc->sc_ctl_end = pqh;
-}
-
-/* Add bulk QH, called at splusb(). */
-void
-uhci_add_bulk(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_qh_t *eqh;
-
- DPRINTFN(10, ("uhci_add_bulk: sqh=%p\n", sqh));
- eqh = sc->sc_bulk_end->qh;
- sqh->qh->hlink = eqh->hlink;
- sqh->qh->qh_hlink = eqh->qh_hlink;
- eqh->hlink = sqh;
- eqh->qh_hlink = sqh->physaddr | UHCI_PTR_Q;
- sc->sc_bulk_end = sqh;
-}
-
-/* Remove bulk QH, called at splusb(). */
-void
-uhci_remove_bulk(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- uhci_soft_qh_t *pqh;
-
- DPRINTFN(10, ("uhci_remove_bulk: sqh=%p\n", sqh));
- for (pqh = sc->sc_bulk_start;
- pqh->qh->hlink != sqh;
- pqh = pqh->qh->hlink)
-#if defined(DIAGNOSTIC) || defined(USB_DEBUG)
- if (pqh->qh->qh_hlink & UHCI_PTR_T) {
- printf("uhci_remove_bulk: QH not found\n");
- return;
- }
-#else
- ;
-#endif
- pqh->qh->hlink = sqh->qh->hlink;
- pqh->qh->qh_hlink = sqh->qh->qh_hlink;
- if (sc->sc_bulk_end == sqh)
- sc->sc_bulk_end = pqh;
-}
-
-int
-uhci_intr(p)
- void *p;
-{
- uhci_softc_t *sc = p;
- int status, ret;
- uhci_intr_info_t *ii;
-
- sc->sc_intrs++;
-#if defined(USB_DEBUG)
- if (uhcidebug > 9) {
- printf("uhci_intr %p\n", sc);
- uhci_dumpregs(sc);
- }
-#endif
- status = UREAD2(sc, UHCI_STS);
- ret = 0;
- if (status & UHCI_STS_USBINT) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_USBINT); /* acknowledge */
- ret = 1;
- }
- if (status & UHCI_STS_USBEI) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_USBEI); /* acknowledge */
- ret = 1;
- }
- if (status & UHCI_STS_RD) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_RD); /* acknowledge */
- printf("%s: resume detect\n", USBDEVNAME(sc->sc_bus.bdev));
- ret = 1;
- }
- if (status & UHCI_STS_HSE) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_HSE); /* acknowledge */
- printf("%s: Host System Error\n", USBDEVNAME(sc->sc_bus.bdev));
- ret = 1;
- }
- if (status & UHCI_STS_HCPE) {
- UWRITE2(sc, UHCI_STS, UHCI_STS_HCPE); /* acknowledge */
- printf("%s: Host System Error\n", USBDEVNAME(sc->sc_bus.bdev));
- ret = 1;
- }
- if (status & UHCI_STS_HCH)
- printf("%s: controller halted\n", USBDEVNAME(sc->sc_bus.bdev));
- if (!ret)
- return 0;
-
- /*
- * Interrupts on UHCI really suck. When the host controller
- * interrupts because a transfer is completed there is no
- * way of knowing which transfer it was. You can scan down
- * the TDs and QHs of the previous frame to limit the search,
- * but that assumes that the interrupt was not delayed by more
- * than 1 ms, which may not always be true (e.g. after debug
- * output on a slow console).
- * We scan all interrupt descriptors to see if any have
- * completed.
- */
- for (ii = LIST_FIRST(&sc->sc_intrhead); ii; ii = LIST_NEXT(ii, list))
- uhci_check_intr(sc, ii);
-
- DPRINTFN(10, ("uhci_intr: exit\n"));
- return 1;
-}
-
-/* Check for an interrupt. */
-void
-uhci_check_intr(sc, ii)
- uhci_softc_t *sc;
- uhci_intr_info_t *ii;
-{
- struct uhci_pipe *upipe;
- uhci_soft_td_t *std, *lstd;
- u_int32_t status;
-
- DPRINTFN(15, ("uhci_check_intr: ii=%p\n", ii));
-#ifdef DIAGNOSTIC
- if (!ii) {
- printf("uhci_check_intr: no ii? %p\n", ii);
- return;
- }
-#endif
- if (!ii->stdstart)
- return;
- lstd = ii->stdend;
-#ifdef DIAGNOSTIC
- if (!lstd) {
- printf("uhci_check_intr: std==0\n");
- return;
- }
-#endif
- /* If the last TD is still active the whole transfer probably is. */
- if (lstd->td->td_status & UHCI_TD_ACTIVE) {
- DPRINTFN(15, ("uhci_check_intr: active ii=%p\n", ii));
- for (std = ii->stdstart; std != lstd; std = std->td->link.std){
- status = std->td->td_status;
- if ((status & UHCI_TD_STALLED) ||
- (status & (UHCI_TD_SPD | UHCI_TD_ACTIVE)) ==
- UHCI_TD_SPD)
- goto done;
- }
- DPRINTFN(15, ("uhci_check_intr: ii=%p std=%p still active\n",
- ii, ii->stdstart));
- return;
- }
- done:
- upipe = (struct uhci_pipe *)ii->reqh->pipe;
- upipe->pipe.endpoint->toggle = upipe->newtoggle;
- uhci_ii_done(ii, 0);
- usb_untimeout(uhci_timeout, ii, ii->timeout_handle);
-}
-
-void
-uhci_ii_done(ii, timo)
- uhci_intr_info_t *ii;
- int timo;
-{
- usbd_request_handle reqh = ii->reqh;
- uhci_soft_td_t *std;
- u_int32_t tst;
- int len, status, attr;
-
- DPRINTFN(10, ("uhci_ii_done: ii=%p ready %d\n", ii, timo));
-
-#ifdef DIAGNOSTIC
- {
- int s = splhigh();
- if (ii->isdone) {
- printf("uhci_ii_done: is done!\n");
- splx(s);
- return;
- }
- ii->isdone = 1;
- splx(s);
- }
-#endif
-
- /* The transfer is done, compute length and status. */
- /* XXX Should stop at first inactive to get toggle right. */
- /* XXX Is this correct for control xfers? */
- for (len = status = 0, std = ii->stdstart;
- std != 0;
- std = std->td->link.std) {
- tst = std->td->td_status;
- status |= tst;
-#ifdef USB_DEBUG
- if ((tst & UHCI_TD_ERROR) && uhcidebug) {
- printf("uhci_ii_done: intr error TD:\n");
- uhci_dump_td(std);
- }
-#endif
- if (UHCI_TD_GET_PID(std->td->td_token) != UHCI_TD_PID_SETUP)
- len += UHCI_TD_GET_ACTLEN(tst);
- }
- status &= UHCI_TD_ERROR;
- DPRINTFN(10, ("uhci_check_intr: len=%d, status=0x%x\n", len, status));
- if (status != 0) {
- DPRINTFN(-1+(status==UHCI_TD_STALLED),
- ("uhci_ii_done: error, addr=%d, endpt=0x%02x, "
- "status 0x%b\n",
- reqh->pipe->device->address,
- reqh->pipe->endpoint->edesc->bEndpointAddress,
- (int)status,
- "\20\22BITSTUFF\23CRCTO\24NAK\25BABBLE\26DBUFFER\27"
- "STALLED\30ACTIVE"));
- if (status == UHCI_TD_STALLED)
- reqh->status = USBD_STALLED;
- else
- reqh->status = USBD_IOERROR; /* more info XXX */
- reqh->actlen = 0;
- } else {
- reqh->status = USBD_NORMAL_COMPLETION;
- reqh->actlen = len;
- }
- if (timo) {
- /* We got a timeout. Make sure transaction is not active. */
- reqh->status = USBD_TIMEOUT;
- for (std = ii->stdstart; std != 0; std = std->td->link.std)
- std->td->td_status &= ~UHCI_TD_ACTIVE;
- /* XXX should we wait 1 ms */
- }
- DPRINTFN(5, ("uhci_ii_done: calling handler ii=%p\n", ii));
-
- attr = reqh->pipe->endpoint->edesc->bmAttributes;
- switch (attr & UE_XFERTYPE) {
- case UE_CONTROL:
- uhci_ctrl_done(ii);
- usb_start_next(reqh->pipe);
- break;
- case UE_ISOCHRONOUS:
- uhci_isoc_done(ii);
- usb_start_next(reqh->pipe);
- break;
- case UE_BULK:
- uhci_bulk_done(ii);
- usb_start_next(reqh->pipe);
- break;
- case UE_INTERRUPT:
- uhci_intr_done(ii);
- break;
- }
-
- /* And finally execute callback. */
- reqh->xfercb(reqh);
-}
-
-/*
- * Called when a request does not complete.
- */
-void
-uhci_timeout(addr)
- void *addr;
-{
- uhci_intr_info_t *ii = addr;
- int s;
-
- DPRINTF(("uhci_timeout: ii=%p\n", ii));
- s = splusb();
- uhci_ii_done(ii, 1);
- splx(s);
-}
-
-/*
- * Wait here until controller claims to have an interrupt.
- * Then call uhci_intr and return. Use timeout to avoid waiting
- * too long.
- * Only used during boot when interrupts are not enabled yet.
- */
-void
-uhci_waitintr(sc, reqh)
- uhci_softc_t *sc;
- usbd_request_handle reqh;
-{
- int timo = reqh->timeout;
- int usecs;
- uhci_intr_info_t *ii;
-
- DPRINTFN(10,("uhci_waitintr: timeout = %ds\n", timo));
-
- reqh->status = USBD_IN_PROGRESS;
- for (usecs = timo * 1000000 / hz; usecs > 0; usecs -= 1000) {
- usb_delay_ms(&sc->sc_bus, 1);
- DPRINTFN(10,("uhci_waitintr: 0x%04x\n", UREAD2(sc, UHCI_STS)));
- if (UREAD2(sc, UHCI_STS) & UHCI_STS_USBINT) {
- uhci_intr(sc);
- if (reqh->status != USBD_IN_PROGRESS)
- return;
- }
- }
-
- /* Timeout */
- DPRINTF(("uhci_waitintr: timeout\n"));
- for (ii = LIST_FIRST(&sc->sc_intrhead);
- ii && ii->reqh != reqh;
- ii = LIST_NEXT(ii, list))
- ;
- if (ii)
- uhci_ii_done(ii, 1);
- else
- panic("uhci_waitintr: lost intr_info\n");
-}
-
-void
-uhci_poll(bus)
- struct usbd_bus *bus;
-{
- uhci_softc_t *sc = (uhci_softc_t *)bus;
-
- if (UREAD2(sc, UHCI_STS) & UHCI_STS_USBINT)
- uhci_intr(sc);
-}
-
-#if 0
-void
-uhci_reset(p)
- void *p;
-{
- uhci_softc_t *sc = p;
- int n;
-
- UHCICMD(sc, UHCI_CMD_HCRESET);
- /* The reset bit goes low when the controller is done. */
- for (n = 0; n < UHCI_RESET_TIMEOUT &&
- (UREAD2(sc, UHCI_CMD) & UHCI_CMD_HCRESET); n++)
- delay(100);
- if (n >= UHCI_RESET_TIMEOUT)
- printf("%s: controller did not reset\n",
- USBDEVNAME(sc->sc_bus.bdev));
-}
-#endif
-
-usbd_status
-uhci_run(sc, run)
- uhci_softc_t *sc;
- int run;
-{
- int s, n, running;
-
- run = run != 0;
- s = splusb();
- running = !(UREAD2(sc, UHCI_STS) & UHCI_STS_HCH);
- if (run == running) {
- splx(s);
- return (USBD_NORMAL_COMPLETION);
- }
- UWRITE2(sc, UHCI_CMD, run ? UHCI_CMD_RS : 0);
- for(n = 0; n < 10; n++) {
- running = !(UREAD2(sc, UHCI_STS) & UHCI_STS_HCH);
- /* return when we've entered the state we want */
- if (run == running) {
- splx(s);
- return (USBD_NORMAL_COMPLETION);
- }
- usb_delay_ms(&sc->sc_bus, 1);
- }
- splx(s);
- printf("%s: cannot %s\n", USBDEVNAME(sc->sc_bus.bdev),
- run ? "start" : "stop");
- return (USBD_IOERROR);
-}
-
-/*
- * Memory management routines.
- * uhci_alloc_std allocates TDs
- * uhci_alloc_sqh allocates QHs
- * These two routines do their own free list management,
- * partly for speed, partly because allocating DMAable memory
- * has page size granularaity so much memory would be wasted if
- * only one TD/QH (32 bytes) was placed in each allocated chunk.
- */
-
-uhci_soft_td_t *
-uhci_alloc_std(sc)
- uhci_softc_t *sc;
-{
- uhci_soft_td_t *std;
- usbd_status r;
- int i;
- usb_dma_t dma;
-
- if (!sc->sc_freetds) {
- DPRINTFN(2,("uhci_alloc_std: allocating chunk\n"));
- std = malloc(sizeof(uhci_soft_td_t) * UHCI_TD_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!std)
- return (0);
- r = usb_allocmem(sc->sc_dmatag, UHCI_TD_SIZE * UHCI_TD_CHUNK,
- UHCI_TD_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(std, M_USBDEV);
- return (0);
- }
- for(i = 0; i < UHCI_TD_CHUNK; i++, std++) {
- std->physaddr = DMAADDR(&dma) + i * UHCI_TD_SIZE;
- std->td = (uhci_td_t *)
- ((char *)KERNADDR(&dma) + i * UHCI_TD_SIZE);
- std->td->link.std = sc->sc_freetds;
- sc->sc_freetds = std;
- }
- }
- std = sc->sc_freetds;
- sc->sc_freetds = std->td->link.std;
- memset(std->td, 0, UHCI_TD_SIZE);
- return std;
-}
-
-void
-uhci_free_std(sc, std)
- uhci_softc_t *sc;
- uhci_soft_td_t *std;
-{
-#ifdef DIAGNOSTIC
-#define TD_IS_FREE 0x12345678
- if (std->td->td_token == TD_IS_FREE) {
- printf("uhci_free_std: freeing free TD %p\n", std);
- return;
- }
- std->td->td_token = TD_IS_FREE;
-#endif
- std->td->link.std = sc->sc_freetds;
- sc->sc_freetds = std;
-}
-
-uhci_soft_qh_t *
-uhci_alloc_sqh(sc)
- uhci_softc_t *sc;
-{
- uhci_soft_qh_t *sqh;
- usbd_status r;
- int i, offs;
- usb_dma_t dma;
-
- if (!sc->sc_freeqhs) {
- DPRINTFN(2, ("uhci_alloc_sqh: allocating chunk\n"));
- sqh = malloc(sizeof(uhci_soft_qh_t) * UHCI_QH_CHUNK,
- M_USBDEV, M_NOWAIT);
- if (!sqh)
- return 0;
- r = usb_allocmem(sc->sc_dmatag, UHCI_QH_SIZE * UHCI_QH_CHUNK,
- UHCI_QH_ALIGN, &dma);
- if (r != USBD_NORMAL_COMPLETION) {
- free(sqh, M_USBDEV);
- return 0;
- }
- for(i = 0; i < UHCI_QH_CHUNK; i++, sqh++) {
- offs = i * UHCI_QH_SIZE;
- sqh->physaddr = DMAADDR(&dma) + offs;
- sqh->qh = (uhci_qh_t *)
- ((char *)KERNADDR(&dma) + offs);
- sqh->qh->hlink = sc->sc_freeqhs;
- sc->sc_freeqhs = sqh;
- }
- }
- sqh = sc->sc_freeqhs;
- sc->sc_freeqhs = sqh->qh->hlink;
- memset(sqh->qh, 0, UHCI_QH_SIZE);
- return (sqh);
-}
-
-void
-uhci_free_sqh(sc, sqh)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
-{
- sqh->qh->hlink = sc->sc_freeqhs;
- sc->sc_freeqhs = sqh;
-}
-
-#if 0
-/*
- * Enter a list of transfers onto a control queue.
- * Called at splusb()
- */
-void
-uhci_enter_ctl_q(sc, sqh, ii)
- uhci_softc_t *sc;
- uhci_soft_qh_t *sqh;
- uhci_intr_info_t *ii;
-{
- DPRINTFN(5, ("uhci_enter_ctl_q: sqh=%p\n", sqh));
-
-}
-#endif
-
-void
-uhci_free_std_chain(sc, std, stdend)
- uhci_softc_t *sc;
- uhci_soft_td_t *std;
- uhci_soft_td_t *stdend;
-{
- uhci_soft_td_t *p;
-
- for (; std != stdend; std = p) {
- p = std->td->link.std;
- uhci_free_std(sc, std);
- }
-}
-
-usbd_status
-uhci_alloc_std_chain(upipe, sc, len, rd, spd, dma, sp, ep)
- struct uhci_pipe *upipe;
- uhci_softc_t *sc;
- int len, rd, spd;
- usb_dma_t *dma;
- uhci_soft_td_t **sp, **ep;
-{
- uhci_soft_td_t *p, *lastp;
- uhci_physaddr_t lastlink;
- int i, ntd, l, tog, maxp;
- u_int32_t status;
- int addr = upipe->pipe.device->address;
- int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
-
- DPRINTFN(15, ("uhci_alloc_std_chain: addr=%d endpt=%d len=%d ls=%d "
- "spd=%d\n", addr, endpt, len,
- upipe->pipe.device->lowspeed, spd));
- if (len == 0) {
- *sp = *ep = 0;
- DPRINTFN(-1,("uhci_alloc_std_chain: len=0\n"));
- return (USBD_NORMAL_COMPLETION);
- }
- maxp = UGETW(upipe->pipe.endpoint->edesc->wMaxPacketSize);
- if (maxp == 0) {
- printf("uhci_alloc_std_chain: maxp=0\n");
- return (USBD_INVAL);
- }
- ntd = (len + maxp - 1) / maxp;
- tog = upipe->pipe.endpoint->toggle;
- if (ntd % 2 == 0)
- tog ^= 1;
- upipe->newtoggle = tog ^ 1;
- lastp = 0;
- lastlink = UHCI_PTR_T;
- ntd--;
- status = UHCI_TD_SET_ERRCNT(2) | UHCI_TD_ACTIVE;
- if (upipe->pipe.device->lowspeed)
- status |= UHCI_TD_LS;
- if (spd)
- status |= UHCI_TD_SPD;
- for (i = ntd; i >= 0; i--) {
- p = uhci_alloc_std(sc);
- if (!p) {
- uhci_free_std_chain(sc, lastp, 0);
- return (USBD_NOMEM);
- }
- p->td->link.std = lastp;
- p->td->td_link = lastlink;
- lastp = p;
- lastlink = p->physaddr;
- p->td->td_status = status;
- if (i == ntd) {
- /* last TD */
- l = len % maxp;
- if (l == 0) l = maxp;
- *ep = p;
- } else
- l = maxp;
- p->td->td_token =
- rd ? UHCI_TD_IN (l, endpt, addr, tog) :
- UHCI_TD_OUT(l, endpt, addr, tog);
- p->td->td_buffer = DMAADDR(dma) + i * maxp;
- tog ^= 1;
- }
- *sp = lastp;
- /*upipe->pipe.endpoint->toggle = tog;*/
- DPRINTFN(10, ("uhci_alloc_std_chain: oldtog=%d newtog=%d\n",
- upipe->pipe.endpoint->toggle, upipe->newtoggle));
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-uhci_device_bulk_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_device_bulk_start(reqh));
-}
-
-usbd_status
-uhci_device_bulk_start(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- uhci_intr_info_t *ii = upipe->iinfo;
- uhci_soft_td_t *xfer, *xferend;
- uhci_soft_qh_t *sqh;
- usb_dma_t *dmap;
- usbd_status r;
- int len, isread;
- int s;
-
- DPRINTFN(3, ("uhci_device_bulk_transfer: reqh=%p buf=%p len=%d "
- "flags=%d\n",
- reqh, reqh->buffer, reqh->length, reqh->flags));
-
- if (reqh->isreq)
- panic("uhci_device_bulk_transfer: a request\n");
-
- len = reqh->length;
- dmap = &upipe->u.bulk.datadma;
- isread = reqh->pipe->endpoint->edesc->bEndpointAddress & UE_IN;
- sqh = upipe->u.bulk.sqh;
-
- upipe->u.bulk.isread = isread;
- upipe->u.bulk.length = len;
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
- r = uhci_alloc_std_chain(upipe, sc, len, isread,
- reqh->flags & USBD_SHORT_XFER_OK,
- dmap, &xfer, &xferend);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
- xferend->td->td_status |= UHCI_TD_IOC;
-
- if (!isread && len != 0)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_bulk_transfer: xfer(1)\n");
- uhci_dump_tds(xfer);
- }
-#endif
-
- /* Set up interrupt info. */
- ii->reqh = reqh;
- ii->stdstart = xfer;
- ii->stdend = xferend;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
-
- sqh->qh->elink = xfer;
- sqh->qh->qh_elink = xfer->physaddr;
- sqh->intr_info = ii;
-
- s = splusb();
- uhci_add_bulk(sc, sqh);
- LIST_INSERT_HEAD(&sc->sc_intrhead, ii, list);
-
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(uhci_timeout, ii,
- MS_TO_TICKS(reqh->timeout), ii->timeout_handle);
- }
- splx(s);
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_bulk_transfer: xfer(2)\n");
- uhci_dump_tds(xfer);
- }
-#endif
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- if (len != 0)
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-/* Abort a device bulk request. */
-void
-uhci_device_bulk_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1);/* make sure it is done */
- /* XXX call done */
-}
-
-/* Close a device bulk pipe. */
-void
-uhci_device_bulk_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
-
- uhci_free_sqh(sc, upipe->u.bulk.sqh);
- uhci_free_intr_info(upipe->iinfo);
- /* XXX free other resources */
-}
-
-usbd_status
-uhci_device_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_device_ctrl_start(reqh));
-}
-
-usbd_status
-uhci_device_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- uhci_softc_t *sc = (uhci_softc_t *)reqh->pipe->device->bus;
- usbd_status r;
-
- if (!reqh->isreq)
- panic("uhci_device_ctrl_transfer: not a request\n");
-
- r = uhci_device_request(reqh);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- if (sc->sc_bus.use_polling)
- uhci_waitintr(sc, reqh);
- return (USBD_IN_PROGRESS);
-}
-
-usbd_status
-uhci_device_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_device_intr_start(reqh));
-}
-
-usbd_status
-uhci_device_intr_start(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- uhci_intr_info_t *ii = upipe->iinfo;
- uhci_soft_td_t *xfer, *xferend;
- uhci_soft_qh_t *sqh;
- usb_dma_t *dmap;
- usbd_status r;
- int len, i;
- int s;
-
- DPRINTFN(3, ("uhci_device_intr_transfer: reqh=%p buf=%p len=%d "
- "flags=%d\n",
- reqh, reqh->buffer, reqh->length, reqh->flags));
-
- if (reqh->isreq)
- panic("uhci_device_intr_transfer: a request\n");
-
- len = reqh->length;
- dmap = &upipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
- r = uhci_alloc_std_chain(upipe, sc, len, 1,
- reqh->flags & USBD_SHORT_XFER_OK,
- dmap, &xfer, &xferend);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
- xferend->td->td_status |= UHCI_TD_IOC;
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_intr_transfer: xfer(1)\n");
- uhci_dump_tds(xfer);
- uhci_dump_qh(upipe->u.intr.qhs[0]);
- }
-#endif
-
- s = splusb();
- /* Set up interrupt info. */
- ii->reqh = reqh;
- ii->stdstart = xfer;
- ii->stdend = xferend;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
-
- DPRINTFN(10,("uhci_device_intr_transfer: qhs[0]=%p\n",
- upipe->u.intr.qhs[0]));
- for (i = 0; i < upipe->u.intr.npoll; i++) {
- sqh = upipe->u.intr.qhs[i];
- sqh->qh->elink = xfer;
- sqh->qh->qh_elink = xfer->physaddr;
- }
- splx(s);
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_intr_transfer: xfer(2)\n");
- uhci_dump_tds(xfer);
- uhci_dump_qh(upipe->u.intr.qhs[0]);
- }
-#endif
-
- return (USBD_IN_PROGRESS);
-
- ret2:
- if (len != 0)
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-/* Abort a device control request. */
-void
-uhci_device_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 1); /* make sure it is done */
- /* XXX call done */
-}
-
-/* Close a device control pipe. */
-void
-uhci_device_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
-
- uhci_free_intr_info(upipe->iinfo);
- /* XXX free other resources */
-}
-
-/* Abort a device interrupt request. */
-void
-uhci_device_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe;
-
- DPRINTFN(1, ("uhci_device_intr_abort: reqh=%p\n", reqh));
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 2); /* make sure it is done */
- if (reqh->pipe->intrreqh == reqh) {
- DPRINTF(("uhci_device_intr_abort: remove\n"));
- reqh->pipe->intrreqh = 0;
- upipe = (struct uhci_pipe *)reqh->pipe;
- uhci_intr_done(upipe->u.intr.qhs[0]->intr_info);
- }
-}
-
-/* Close a device interrupt pipe. */
-void
-uhci_device_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- int i, s, npoll;
-
- upipe->iinfo->stdstart = 0; /* inactive */
-
- /* Unlink descriptors from controller data structures. */
- npoll = upipe->u.intr.npoll;
- uhci_lock_frames(sc);
- for (i = 0; i < npoll; i++)
- uhci_remove_intr(sc, upipe->u.intr.qhs[i]->pos,
- upipe->u.intr.qhs[i]);
- uhci_unlock_frames(sc);
-
- /*
- * We now have to wait for any activity on the physical
- * descriptors to stop.
- */
- usb_delay_ms(&sc->sc_bus, 2);
-
- for(i = 0; i < npoll; i++)
- uhci_free_sqh(sc, upipe->u.intr.qhs[i]);
- free(upipe->u.intr.qhs, M_USB);
-
- s = splusb();
- LIST_REMOVE(upipe->iinfo, list); /* remove from active list */
- splx(s);
- uhci_free_intr_info(upipe->iinfo);
-
- /* XXX free other resources */
-}
-
-usbd_status
-uhci_device_request(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usb_device_request_t *req = &reqh->request;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- int addr = dev->address;
- int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
- uhci_intr_info_t *ii = upipe->iinfo;
- uhci_soft_td_t *setup, *xfer, *stat, *next, *xferend;
- uhci_soft_qh_t *sqh;
- usb_dma_t *dmap;
- int len;
- u_int32_t ls;
- usbd_status r;
- int isread;
- int s;
-
- DPRINTFN(3,("uhci_device_control type=0x%02x, request=0x%02x, "
- "wValue=0x%04x, wIndex=0x%04x len=%d, addr=%d, endpt=%d\n",
- req->bmRequestType, req->bRequest, UGETW(req->wValue),
- UGETW(req->wIndex), UGETW(req->wLength),
- addr, endpt));
-
- ls = dev->lowspeed ? UHCI_TD_LS : 0;
- isread = req->bmRequestType & UT_READ;
- len = UGETW(req->wLength);
-
- setup = upipe->u.ctl.setup;
- stat = upipe->u.ctl.stat;
- sqh = upipe->u.ctl.sqh;
- dmap = &upipe->u.ctl.datadma;
-
- /* Set up data transaction */
- if (len != 0) {
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret1;
- upipe->pipe.endpoint->toggle = 1;
- r = uhci_alloc_std_chain(upipe, sc, len, isread,
- reqh->flags & USBD_SHORT_XFER_OK,
- dmap, &xfer, &xferend);
- if (r != USBD_NORMAL_COMPLETION)
- goto ret2;
- next = xfer;
- xferend->td->link.std = stat;
- xferend->td->td_link = stat->physaddr;
- } else {
- next = stat;
- }
- upipe->u.ctl.length = len;
-
- memcpy(KERNADDR(&upipe->u.ctl.reqdma), req, sizeof *req);
- if (!isread && len != 0)
- memcpy(KERNADDR(dmap), reqh->buffer, len);
-
- setup->td->link.std = next;
- setup->td->td_link = next->physaddr;
- setup->td->td_status = UHCI_TD_SET_ERRCNT(2) | ls | UHCI_TD_ACTIVE;
- setup->td->td_token = UHCI_TD_SETUP(sizeof *req, endpt, addr);
- setup->td->td_buffer = DMAADDR(&upipe->u.ctl.reqdma);
-
- stat->td->link.std = 0;
- stat->td->td_link = UHCI_PTR_T;
- stat->td->td_status = UHCI_TD_SET_ERRCNT(2) | ls |
- UHCI_TD_ACTIVE | UHCI_TD_IOC;
- stat->td->td_token =
- isread ? UHCI_TD_OUT(0, endpt, addr, 1) :
- UHCI_TD_IN (0, endpt, addr, 1);
- stat->td->td_buffer = 0;
-
-#ifdef USB_DEBUG
- if (uhcidebug > 20) {
- printf("uhci_device_request: setup\n");
- uhci_dump_td(setup);
- printf("uhci_device_request: stat\n");
- uhci_dump_td(stat);
- }
-#endif
-
- /* Set up interrupt info. */
- ii->reqh = reqh;
- ii->stdstart = setup;
- ii->stdend = stat;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
-
- sqh->qh->elink = setup;
- sqh->qh->qh_elink = setup->physaddr;
- sqh->intr_info = ii;
-
- s = splusb();
- uhci_add_ctrl(sc, sqh);
- LIST_INSERT_HEAD(&sc->sc_intrhead, ii, list);
-#ifdef USB_DEBUG
- if (uhcidebug > 12) {
- uhci_soft_td_t *std;
- uhci_soft_qh_t *xqh;
- uhci_soft_qh_t *sxqh;
- int maxqh = 0;
- uhci_physaddr_t link;
- printf("uhci_enter_ctl_q: follow from [0]\n");
- for (std = sc->sc_vframes[0].htd, link = 0;
- (link & UHCI_PTR_Q) == 0;
- std = std->td->link.std) {
- link = std->td->td_link;
- uhci_dump_td(std);
- }
- for (sxqh = xqh = (uhci_soft_qh_t *)std;
- xqh;
- xqh = (maxqh++ == 5 || xqh->qh->hlink==sxqh ||
- xqh->qh->hlink==xqh ? NULL : xqh->qh->hlink)) {
- uhci_dump_qh(xqh);
- uhci_dump_qh(sxqh);
- }
- printf("Enqueued QH:\n");
- uhci_dump_qh(sqh);
- uhci_dump_tds(sqh->qh->elink);
- }
-#endif
- if (reqh->timeout && !sc->sc_bus.use_polling) {
- usb_timeout(uhci_timeout, ii,
- MS_TO_TICKS(reqh->timeout), ii->timeout_handle);
- }
- splx(s);
-
- return (USBD_NORMAL_COMPLETION);
-
- ret2:
- if (len != 0)
- usb_freemem(sc->sc_dmatag, dmap);
- ret1:
- return (r);
-}
-
-usbd_status
-uhci_device_isoc_transfer(reqh)
- usbd_request_handle reqh;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
-#ifdef USB_DEBUG
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
-#endif
-
- DPRINTFN(1,("uhci_device_isoc_transfer: sc=%p\n", sc));
- if (upipe->u.iso.bufsize == 0)
- return (USBD_INVAL);
-
- /* XXX copy data */
- return (USBD_XXX);
-}
-
-usbd_status
-uhci_device_isoc_start(reqh)
- usbd_request_handle reqh;
-{
- return (USBD_XXX);
-}
-
-void
-uhci_device_isoc_abort(reqh)
- usbd_request_handle reqh;
-{
- /* XXX Can't abort a single request. */
-}
-
-void
-uhci_device_isoc_close(pipe)
- usbd_pipe_handle pipe;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- struct iso *iso;
- int i;
-
- /*
- * Make sure all TDs are marked as inactive.
- * Wait for completion.
- * Unschedule.
- * Deallocate.
- */
- iso = &upipe->u.iso;
-
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++)
- iso->stds[i]->td->td_status &= ~UHCI_TD_ACTIVE;
- usb_delay_ms(&sc->sc_bus, 2); /* wait for completion */
-
- uhci_lock_frames(sc);
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- uhci_soft_td_t *std, *vstd;
-
- std = iso->stds[i];
- for (vstd = sc->sc_vframes[i % UHCI_VFRAMELIST_COUNT].htd;
- vstd && vstd->td->link.std != std;
- vstd = vstd->td->link.std)
- ;
- if (!vstd) {
- /*panic*/
- printf("uhci_device_isoc_close: %p not found\n", std);
- uhci_unlock_frames(sc);
- return;
- }
- vstd->td->link = std->td->link;
- vstd->td->td_link = std->td->td_link;
- uhci_free_std(sc, std);
- }
- uhci_unlock_frames(sc);
-
- for (i = 0; i < iso->nbuf; i++)
- usb_freemem(sc->sc_dmatag, &iso->bufs[i]);
- free(iso->stds, M_USB);
- free(iso->bufs, M_USB);
-
- /* XXX what else? */
-}
-
-usbd_status
-uhci_device_isoc_setbuf(pipe, bufsize, nbuf)
- usbd_pipe_handle pipe;
- u_int bufsize;
- u_int nbuf;
-{
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usbd_device_handle dev = upipe->pipe.device;
- uhci_softc_t *sc = (uhci_softc_t *)dev->bus;
- int addr = upipe->pipe.device->address;
- int endpt = upipe->pipe.endpoint->edesc->bEndpointAddress;
- int rd = upipe->pipe.endpoint->edesc->bEndpointAddress & UE_IN;
- struct iso *iso;
- int i;
- usbd_status r;
-
- /*
- * For simplicity the number of buffers must fit nicely in the frame
- * list.
- */
- if (UHCI_VFRAMELIST_COUNT % nbuf != 0)
- return (USBD_INVAL);
-
- iso = &upipe->u.iso;
- iso->bufsize = bufsize;
- iso->nbuf = nbuf;
-
- /* Allocate memory for buffers. */
- iso->bufs = malloc(nbuf * sizeof(usb_dma_t), M_USB, M_WAITOK);
- iso->stds = malloc(UHCI_VFRAMELIST_COUNT * sizeof (uhci_soft_td_t *),
- M_USB, M_WAITOK);
-
- for (i = 0; i < nbuf; i++) {
- r = usb_allocmem(sc->sc_dmatag, bufsize, 0, &iso->bufs[i]);
- if (r != USBD_NORMAL_COMPLETION) {
- nbuf = i;
- goto bad1;
- }
- }
-
- /* Allocate the TDs. */
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- iso->stds[i] = uhci_alloc_std(sc);
- if (iso->stds[i] == 0)
- goto bad2;
- }
-
- /* XXX check schedule */
-
- /* XXX interrupts */
-
- /* Insert TDs into schedule, all marked inactive. */
- uhci_lock_frames(sc);
- for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++) {
- uhci_soft_td_t *std, *vstd;
-
- std = iso->stds[i];
- std->td->td_status = UHCI_TD_IOS; /* iso, inactive */
- std->td->td_token =
- rd ? UHCI_TD_IN (0, endpt, addr, 0) :
- UHCI_TD_OUT(0, endpt, addr, 0);
- std->td->td_buffer = DMAADDR(&iso->bufs[i % nbuf]);
-
- vstd = sc->sc_vframes[i % UHCI_VFRAMELIST_COUNT].htd;
- std->td->link = vstd->td->link;
- std->td->td_link = vstd->td->td_link;
- vstd->td->link.std = std;
- vstd->td->td_link = std->physaddr;
- }
- uhci_unlock_frames(sc);
-
- return (USBD_NORMAL_COMPLETION);
-
- bad2:
- while (--i >= 0)
- uhci_free_std(sc, iso->stds[i]);
- bad1:
- for (i = 0; i < nbuf; i++)
- usb_freemem(sc->sc_dmatag, &iso->bufs[i]);
- free(iso->stds, M_USB);
- free(iso->bufs, M_USB);
- return (USBD_NOMEM);
-}
-
-void
-uhci_isoc_done(ii)
- uhci_intr_info_t *ii;
-{
-}
-
-void
-uhci_intr_done(ii)
- uhci_intr_info_t *ii;
-{
- uhci_softc_t *sc = ii->sc;
- usbd_request_handle reqh = ii->reqh;
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- usb_dma_t *dma;
- uhci_soft_qh_t *sqh;
- int i, npoll;
-
- DPRINTFN(5, ("uhci_intr_done: length=%d\n", reqh->actlen));
-
- dma = &upipe->u.intr.datadma;
- memcpy(reqh->buffer, KERNADDR(dma), reqh->actlen);
- npoll = upipe->u.intr.npoll;
- for(i = 0; i < npoll; i++) {
- sqh = upipe->u.intr.qhs[i];
- sqh->qh->elink = 0;
- sqh->qh->qh_elink = UHCI_PTR_T;
- }
- uhci_free_std_chain(sc, ii->stdstart, 0);
-
- /* XXX Wasteful. */
- if (reqh->pipe->intrreqh == reqh) {
- uhci_soft_td_t *xfer, *xferend;
-
- /* This alloc cannot fail since we freed the chain above. */
- uhci_alloc_std_chain(upipe, sc, reqh->length, 1,
- reqh->flags & USBD_SHORT_XFER_OK,
- dma, &xfer, &xferend);
- xferend->td->td_status |= UHCI_TD_IOC;
-
-#ifdef USB_DEBUG
- if (uhcidebug > 10) {
- printf("uhci_device_intr_done: xfer(1)\n");
- uhci_dump_tds(xfer);
- uhci_dump_qh(upipe->u.intr.qhs[0]);
- }
-#endif
-
- ii->stdstart = xfer;
- ii->stdend = xferend;
-#ifdef DIAGNOSTIC
- ii->isdone = 0;
-#endif
- for (i = 0; i < npoll; i++) {
- sqh = upipe->u.intr.qhs[i];
- sqh->qh->elink = xfer;
- sqh->qh->qh_elink = xfer->physaddr;
- }
- } else {
- usb_freemem(sc->sc_dmatag, dma);
- ii->stdstart = 0; /* mark as inactive */
- usb_start_next(reqh->pipe);
- }
-}
-
-/* Deallocate request data structures */
-void
-uhci_ctrl_done(ii)
- uhci_intr_info_t *ii;
-{
- uhci_softc_t *sc = ii->sc;
- usbd_request_handle reqh = ii->reqh;
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- u_int len = upipe->u.ctl.length;
- usb_dma_t *dma;
- uhci_td_t *htd = ii->stdstart->td;
-
-#ifdef DIAGNOSTIC
- if (!reqh->isreq)
- panic("uhci_ctrl_done: not a request\n");
-#endif
-
- LIST_REMOVE(ii, list); /* remove from active list */
-
- uhci_remove_ctrl(sc, upipe->u.ctl.sqh);
-
- if (len != 0) {
- dma = &upipe->u.ctl.datadma;
- if (reqh->request.bmRequestType & UT_READ)
- memcpy(reqh->buffer, KERNADDR(dma), len);
- uhci_free_std_chain(sc, htd->link.std, ii->stdend);
- usb_freemem(sc->sc_dmatag, dma);
- }
- DPRINTFN(5, ("uhci_ctrl_done: length=%d\n", reqh->actlen));
-}
-
-/* Deallocate request data structures */
-void
-uhci_bulk_done(ii)
- uhci_intr_info_t *ii;
-{
- uhci_softc_t *sc = ii->sc;
- usbd_request_handle reqh = ii->reqh;
- struct uhci_pipe *upipe = (struct uhci_pipe *)reqh->pipe;
- u_int len = upipe->u.bulk.length;
- usb_dma_t *dma;
- uhci_td_t *htd = ii->stdstart->td;
-
- LIST_REMOVE(ii, list); /* remove from active list */
-
- uhci_remove_bulk(sc, upipe->u.bulk.sqh);
-
- if (len != 0) {
- dma = &upipe->u.bulk.datadma;
- if (upipe->u.bulk.isread && len != 0)
- memcpy(reqh->buffer, KERNADDR(dma), len);
- uhci_free_std_chain(sc, htd->link.std, 0);
- usb_freemem(sc->sc_dmatag, dma);
- }
- DPRINTFN(4, ("uhci_bulk_done: length=%d\n", reqh->actlen));
- /* XXX compute new toggle */
-}
-
-/* Add interrupt QH, called with vflock. */
-void
-uhci_add_intr(sc, n, sqh)
- uhci_softc_t *sc;
- int n;
- uhci_soft_qh_t *sqh;
-{
- struct uhci_vframe *vf = &sc->sc_vframes[n];
- uhci_qh_t *eqh;
-
- DPRINTFN(4, ("uhci_add_intr: n=%d sqh=%p\n", n, sqh));
- eqh = vf->eqh->qh;
- sqh->qh->hlink = eqh->hlink;
- sqh->qh->qh_hlink = eqh->qh_hlink;
- eqh->hlink = sqh;
- eqh->qh_hlink = sqh->physaddr | UHCI_PTR_Q;
- vf->eqh = sqh;
- vf->bandwidth++;
-}
-
-/* Remove interrupt QH, called with vflock. */
-void
-uhci_remove_intr(sc, n, sqh)
- uhci_softc_t *sc;
- int n;
- uhci_soft_qh_t *sqh;
-{
- struct uhci_vframe *vf = &sc->sc_vframes[n];
- uhci_soft_qh_t *pqh;
-
- DPRINTFN(4, ("uhci_remove_intr: n=%d sqh=%p\n", n, sqh));
-
- for (pqh = vf->hqh; pqh->qh->hlink != sqh; pqh = pqh->qh->hlink)
-#if defined(DIAGNOSTIC) || defined(USB_DEBUG)
- if (pqh->qh->qh_hlink & UHCI_PTR_T) {
- printf("uhci_remove_intr: QH not found\n");
- return;
- }
-#else
- ;
-#endif
- pqh->qh->hlink = sqh->qh->hlink;
- pqh->qh->qh_hlink = sqh->qh->qh_hlink;
- if (vf->eqh == sqh)
- vf->eqh = pqh;
- vf->bandwidth--;
-}
-
-usbd_status
-uhci_device_setintr(sc, upipe, ival)
- uhci_softc_t *sc;
- struct uhci_pipe *upipe;
- int ival;
-{
- uhci_soft_qh_t *sqh;
- int i, npoll, s;
- u_int bestbw, bw, bestoffs, offs;
-
- DPRINTFN(2, ("uhci_setintr: pipe=%p\n", upipe));
- if (ival == 0) {
- printf("uhci_setintr: 0 interval\n");
- return (USBD_INVAL);
- }
-
- if (ival > UHCI_VFRAMELIST_COUNT)
- ival = UHCI_VFRAMELIST_COUNT;
- npoll = (UHCI_VFRAMELIST_COUNT + ival - 1) / ival;
- DPRINTFN(2, ("uhci_setintr: ival=%d npoll=%d\n", ival, npoll));
-
- upipe->u.intr.npoll = npoll;
- upipe->u.intr.qhs =
- malloc(npoll * sizeof(uhci_soft_qh_t *), M_USB, M_WAITOK);
-
- /*
- * Figure out which offset in the schedule that has most
- * bandwidth left over.
- */
-#define MOD(i) ((i) & (UHCI_VFRAMELIST_COUNT-1))
- for (bestoffs = offs = 0, bestbw = ~0; offs < ival; offs++) {
- for (bw = i = 0; i < npoll; i++)
- bw += sc->sc_vframes[MOD(i * ival + offs)].bandwidth;
- if (bw < bestbw) {
- bestbw = bw;
- bestoffs = offs;
- }
- }
- DPRINTFN(1, ("uhci_setintr: bw=%d offs=%d\n", bestbw, bestoffs));
-
- upipe->iinfo->stdstart = 0;
- for(i = 0; i < npoll; i++) {
- upipe->u.intr.qhs[i] = sqh = uhci_alloc_sqh(sc);
- sqh->qh->elink = 0;
- sqh->qh->qh_elink = UHCI_PTR_T;
- sqh->pos = MOD(i * ival + bestoffs);
- sqh->intr_info = upipe->iinfo;
- }
-#undef MOD
-
- s = splusb();
- LIST_INSERT_HEAD(&sc->sc_intrhead, upipe->iinfo, list);
- splx(s);
-
- uhci_lock_frames(sc);
- /* Enter QHs into the controller data structures. */
- for(i = 0; i < npoll; i++)
- uhci_add_intr(sc, upipe->u.intr.qhs[i]->pos,
- upipe->u.intr.qhs[i]);
- uhci_unlock_frames(sc);
-
- DPRINTFN(5, ("uhci_setintr: returns %p\n", upipe));
- return (USBD_NORMAL_COMPLETION);
-}
-
-/* Open a new pipe. */
-usbd_status
-uhci_open(pipe)
- usbd_pipe_handle pipe;
-{
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc;
- usbd_status r;
-
- DPRINTFN(1, ("uhci_open: pipe=%p, addr=%d, endpt=%d (%d)\n",
- pipe, pipe->device->address,
- ed->bEndpointAddress, sc->sc_addr));
- if (pipe->device->address == sc->sc_addr) {
- switch (ed->bEndpointAddress) {
- case USB_CONTROL_ENDPOINT:
- pipe->methods = &uhci_root_ctrl_methods;
- break;
- case UE_IN | UHCI_INTR_ENDPT:
- pipe->methods = &uhci_root_intr_methods;
- break;
- default:
- return (USBD_INVAL);
- }
- } else {
- upipe->iinfo = uhci_alloc_intr_info(sc);
- if (upipe->iinfo == 0)
- return (USBD_NOMEM);
- switch (ed->bmAttributes & UE_XFERTYPE) {
- case UE_CONTROL:
- pipe->methods = &uhci_device_ctrl_methods;
- upipe->u.ctl.sqh = uhci_alloc_sqh(sc);
- if (upipe->u.ctl.sqh == 0)
- goto bad;
- upipe->u.ctl.setup = uhci_alloc_std(sc);
- if (upipe->u.ctl.setup == 0) {
- uhci_free_sqh(sc, upipe->u.ctl.sqh);
- goto bad;
- }
- upipe->u.ctl.stat = uhci_alloc_std(sc);
- if (upipe->u.ctl.stat == 0) {
- uhci_free_sqh(sc, upipe->u.ctl.sqh);
- uhci_free_std(sc, upipe->u.ctl.setup);
- goto bad;
- }
- r = usb_allocmem(sc->sc_dmatag,
- sizeof(usb_device_request_t),
- 0, &upipe->u.ctl.reqdma);
- if (r != USBD_NORMAL_COMPLETION) {
- uhci_free_sqh(sc, upipe->u.ctl.sqh);
- uhci_free_std(sc, upipe->u.ctl.setup);
- uhci_free_std(sc, upipe->u.ctl.stat);
- goto bad;
- }
- break;
- case UE_INTERRUPT:
- pipe->methods = &uhci_device_intr_methods;
- return (uhci_device_setintr(sc, upipe, ed->bInterval));
- case UE_ISOCHRONOUS:
- pipe->methods = &uhci_device_isoc_methods;
- upipe->u.iso.nbuf = 0;
- return (USBD_NORMAL_COMPLETION);
- case UE_BULK:
- pipe->methods = &uhci_device_bulk_methods;
- upipe->u.bulk.sqh = uhci_alloc_sqh(sc);
- if (upipe->u.bulk.sqh == 0)
- goto bad;
- break;
- }
- }
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- uhci_free_intr_info(upipe->iinfo);
- return (USBD_NOMEM);
-}
-
-/*
- * Data structures and routines to emulate the root hub.
- */
-usb_device_descriptor_t uhci_devd = {
- USB_DEVICE_DESCRIPTOR_SIZE,
- UDESC_DEVICE, /* type */
- {0x00, 0x01}, /* USB version */
- UCLASS_HUB, /* class */
- USUBCLASS_HUB, /* subclass */
- 0, /* protocol */
- 64, /* max packet */
- {0},{0},{0x00,0x01}, /* device id */
- 1,2,0, /* string indicies */
- 1 /* # of configurations */
-};
-
-usb_config_descriptor_t uhci_confd = {
- USB_CONFIG_DESCRIPTOR_SIZE,
- UDESC_CONFIG,
- {USB_CONFIG_DESCRIPTOR_SIZE +
- USB_INTERFACE_DESCRIPTOR_SIZE +
- USB_ENDPOINT_DESCRIPTOR_SIZE},
- 1,
- 1,
- 0,
- UC_SELF_POWERED,
- 0 /* max power */
-};
-
-usb_interface_descriptor_t uhci_ifcd = {
- USB_INTERFACE_DESCRIPTOR_SIZE,
- UDESC_INTERFACE,
- 0,
- 0,
- 1,
- UCLASS_HUB,
- USUBCLASS_HUB,
- 0,
- 0
-};
-
-usb_endpoint_descriptor_t uhci_endpd = {
- USB_ENDPOINT_DESCRIPTOR_SIZE,
- UDESC_ENDPOINT,
- UE_IN | UHCI_INTR_ENDPT,
- UE_INTERRUPT,
- {8},
- 255
-};
-
-usb_hub_descriptor_t uhci_hubd_piix = {
- USB_HUB_DESCRIPTOR_SIZE,
- UDESC_HUB,
- 2,
- { UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL, 0 },
- 50, /* power on to power good */
- 0,
- { 0x00 }, /* both ports are removable */
-};
-
-int
-uhci_str(p, l, s)
- usb_string_descriptor_t *p;
- int l;
- char *s;
-{
- int i;
-
- if (l == 0)
- return (0);
- p->bLength = 2 * strlen(s) + 2;
- if (l == 1)
- return (1);
- p->bDescriptorType = UDESC_STRING;
- l -= 2;
- for (i = 0; s[i] && l > 1; i++, l -= 2)
- USETW2(p->bString[i], 0, s[i]);
- return (2*i+2);
-}
-
-/*
- * Simulate a hardware hub by handling all the necessary requests.
- */
-usbd_status
-uhci_root_ctrl_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_root_ctrl_start(reqh));
-}
-
-usbd_status
-uhci_root_ctrl_start(reqh)
- usbd_request_handle reqh;
-{
- uhci_softc_t *sc = (uhci_softc_t *)reqh->pipe->device->bus;
- usb_device_request_t *req;
- void *buf;
- int port, x;
- int len, value, index, status, change, l, totlen = 0;
- usb_port_status_t ps;
- usbd_status r;
-
- if (!reqh->isreq)
- panic("uhci_root_ctrl_transfer: not a request\n");
- req = &reqh->request;
- buf = reqh->buffer;
-
- DPRINTFN(2,("uhci_root_ctrl_control type=0x%02x request=%02x\n",
- req->bmRequestType, req->bRequest));
-
- len = UGETW(req->wLength);
- value = UGETW(req->wValue);
- index = UGETW(req->wIndex);
-#define C(x,y) ((x) | ((y) << 8))
- switch(C(req->bRequest, req->bmRequestType)) {
- case C(UR_CLEAR_FEATURE, UT_WRITE_DEVICE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT):
- /*
- * DEVICE_REMOTE_WAKEUP and ENDPOINT_HALT are no-ops
- * for the integrated root hub.
- */
- break;
- case C(UR_GET_CONFIG, UT_READ_DEVICE):
- if (len > 0) {
- *(u_int8_t *)buf = sc->sc_conf;
- totlen = 1;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE):
- DPRINTFN(2,("uhci_root_ctrl_control wValue=0x%04x\n", value));
- switch(value >> 8) {
- case UDESC_DEVICE:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_DEVICE_DESCRIPTOR_SIZE);
- memcpy(buf, &uhci_devd, l);
- break;
- case UDESC_CONFIG:
- if ((value & 0xff) != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- totlen = l = min(len, USB_CONFIG_DESCRIPTOR_SIZE);
- memcpy(buf, &uhci_confd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_INTERFACE_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &uhci_ifcd, l);
- buf = (char *)buf + l;
- len -= l;
- l = min(len, USB_ENDPOINT_DESCRIPTOR_SIZE);
- totlen += l;
- memcpy(buf, &uhci_endpd, l);
- break;
- case UDESC_STRING:
- if (len == 0)
- break;
- *(u_int8_t *)buf = 0;
- totlen = 1;
- switch (value & 0xff) {
- case 1: /* Vendor */
- totlen = uhci_str(buf, len, sc->sc_vendor);
- break;
- case 2: /* Product */
- totlen = uhci_str(buf, len, "UHCI root hub");
- break;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- case C(UR_GET_INTERFACE, UT_READ_INTERFACE):
- if (len > 0) {
- *(u_int8_t *)buf = 0;
- totlen = 1;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_DEVICE):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus,UDS_SELF_POWERED);
- totlen = 2;
- }
- break;
- case C(UR_GET_STATUS, UT_READ_INTERFACE):
- case C(UR_GET_STATUS, UT_READ_ENDPOINT):
- if (len > 1) {
- USETW(((usb_status_t *)buf)->wStatus, 0);
- totlen = 2;
- }
- break;
- case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
- if (value >= USB_MAX_DEVICES) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_addr = value;
- break;
- case C(UR_SET_CONFIG, UT_WRITE_DEVICE):
- if (value != 0 && value != 1) {
- r = USBD_IOERROR;
- goto ret;
- }
- sc->sc_conf = value;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_DEVICE):
- case C(UR_SET_FEATURE, UT_WRITE_INTERFACE):
- case C(UR_SET_FEATURE, UT_WRITE_ENDPOINT):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_INTERFACE, UT_WRITE_INTERFACE):
- break;
- case C(UR_SYNCH_FRAME, UT_WRITE_ENDPOINT):
- break;
- /* Hub requests */
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_OTHER):
- DPRINTFN(3, ("uhci_root_ctrl_control: UR_CLEAR_PORT_FEATURE "
- "port=%d feature=%d\n",
- index, value));
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- switch(value) {
- case UHF_PORT_ENABLE:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_PE);
- break;
- case UHF_PORT_SUSPEND:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_SUSP);
- break;
- case UHF_PORT_RESET:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_PR);
- break;
- case UHF_C_PORT_CONNECTION:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_CSC);
- break;
- case UHF_C_PORT_ENABLE:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_POEDC);
- break;
- case UHF_C_PORT_OVER_CURRENT:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_OCIC);
- break;
- case UHF_C_PORT_RESET:
- sc->sc_isreset = 0;
- r = USBD_NORMAL_COMPLETION;
- goto ret;
- case UHF_PORT_CONNECTION:
- case UHF_PORT_OVER_CURRENT:
- case UHF_PORT_POWER:
- case UHF_PORT_LOW_SPEED:
- case UHF_C_PORT_SUSPEND:
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- case C(UR_GET_BUS_STATE, UT_READ_CLASS_OTHER):
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- if (len > 0) {
- *(u_int8_t *)buf =
- (UREAD2(sc, port) & UHCI_PORTSC_LS) >>
- UHCI_PORTSC_LS_SHIFT;
- totlen = 1;
- }
- break;
- case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE):
- if (value != 0) {
- r = USBD_IOERROR;
- goto ret;
- }
- l = min(len, USB_HUB_DESCRIPTOR_SIZE);
- totlen = l;
- memcpy(buf, &uhci_hubd_piix, l);
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE):
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- memset(buf, 0, len);
- totlen = len;
- break;
- case C(UR_GET_STATUS, UT_READ_CLASS_OTHER):
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- if (len != 4) {
- r = USBD_IOERROR;
- goto ret;
- }
- x = UREAD2(sc, port);
- status = change = 0;
- if (x & UHCI_PORTSC_CCS )
- status |= UPS_CURRENT_CONNECT_STATUS;
- if (x & UHCI_PORTSC_CSC )
- change |= UPS_C_CONNECT_STATUS;
- if (x & UHCI_PORTSC_PE )
- status |= UPS_PORT_ENABLED;
- if (x & UHCI_PORTSC_POEDC)
- change |= UPS_C_PORT_ENABLED;
- if (x & UHCI_PORTSC_OCI )
- status |= UPS_OVERCURRENT_INDICATOR;
- if (x & UHCI_PORTSC_OCIC )
- change |= UPS_C_OVERCURRENT_INDICATOR;
- if (x & UHCI_PORTSC_SUSP )
- status |= UPS_SUSPEND;
- if (x & UHCI_PORTSC_LSDA )
- status |= UPS_LOW_SPEED;
- status |= UPS_PORT_POWER;
- if (sc->sc_isreset)
- change |= UPS_C_PORT_RESET;
- USETW(ps.wPortStatus, status);
- USETW(ps.wPortChange, change);
- l = min(len, sizeof ps);
- memcpy(buf, &ps, l);
- totlen = l;
- break;
- case C(UR_SET_DESCRIPTOR, UT_WRITE_CLASS_DEVICE):
- r = USBD_IOERROR;
- goto ret;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_DEVICE):
- break;
- case C(UR_SET_FEATURE, UT_WRITE_CLASS_OTHER):
- if (index == 1)
- port = UHCI_PORTSC1;
- else if (index == 2)
- port = UHCI_PORTSC2;
- else {
- r = USBD_IOERROR;
- goto ret;
- }
- switch(value) {
- case UHF_PORT_ENABLE:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_PE);
- break;
- case UHF_PORT_SUSPEND:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_SUSP);
- break;
- case UHF_PORT_RESET:
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_PR);
- usb_delay_ms(&sc->sc_bus, 10);
- UWRITE2(sc, port, x & ~UHCI_PORTSC_PR);
- delay(100);
- x = UREAD2(sc, port);
- UWRITE2(sc, port, x | UHCI_PORTSC_PE);
- delay(100);
- DPRINTFN(3,("uhci port %d reset, status = 0x%04x\n",
- index, UREAD2(sc, port)));
- sc->sc_isreset = 1;
- break;
- case UHF_C_PORT_CONNECTION:
- case UHF_C_PORT_ENABLE:
- case UHF_C_PORT_OVER_CURRENT:
- case UHF_PORT_CONNECTION:
- case UHF_PORT_OVER_CURRENT:
- case UHF_PORT_POWER:
- case UHF_PORT_LOW_SPEED:
- case UHF_C_PORT_SUSPEND:
- case UHF_C_PORT_RESET:
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- break;
- default:
- r = USBD_IOERROR;
- goto ret;
- }
- reqh->actlen = totlen;
- r = USBD_NORMAL_COMPLETION;
- ret:
- reqh->status = r;
- reqh->xfercb(reqh);
- usb_start_next(reqh->pipe);
- return (USBD_IN_PROGRESS);
-}
-
-/* Abort a root control request. */
-void
-uhci_root_ctrl_abort(reqh)
- usbd_request_handle reqh;
-{
- /* Nothing to do, all transfers are syncronous. */
-}
-
-/* Close the root pipe. */
-void
-uhci_root_ctrl_close(pipe)
- usbd_pipe_handle pipe;
-{
- usb_untimeout(uhci_timo, pipe->intrreqh, pipe->intrreqh->timo_handle);
- DPRINTF(("uhci_root_ctrl_close\n"));
-}
-
-/* Abort a root interrupt request. */
-void
-uhci_root_intr_abort(reqh)
- usbd_request_handle reqh;
-{
- usb_untimeout(uhci_timo, reqh, reqh->timo_handle);
-}
-
-usbd_status
-uhci_root_intr_transfer(reqh)
- usbd_request_handle reqh;
-{
- int s;
- usbd_status r;
-
- s = splusb();
- r = usb_insert_transfer(reqh);
- splx(s);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- else
- return (uhci_root_intr_start(reqh));
-}
-
-/* Start a transfer on the root interrupt pipe */
-usbd_status
-uhci_root_intr_start(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
- uhci_softc_t *sc = (uhci_softc_t *)pipe->device->bus;
- struct uhci_pipe *upipe = (struct uhci_pipe *)pipe;
- usb_dma_t *dmap;
- usbd_status r;
- int len;
-
- DPRINTFN(3, ("uhci_root_intr_transfer: reqh=%p buf=%p len=%d "
- "flags=%d\n",
- reqh, reqh->buffer, reqh->length, reqh->flags));
-
- len = reqh->length;
- dmap = &upipe->u.intr.datadma;
- if (len == 0)
- return (USBD_INVAL); /* XXX should it be? */
-
- r = usb_allocmem(sc->sc_dmatag, len, 0, dmap);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- sc->sc_ival = MS_TO_TICKS(reqh->pipe->endpoint->edesc->bInterval);
- usb_timeout(uhci_timo, reqh, sc->sc_ival, reqh->timo_handle);
- return (USBD_IN_PROGRESS);
-}
-
-/* Close the root interrupt pipe. */
-void
-uhci_root_intr_close(pipe)
- usbd_pipe_handle pipe;
-{
- usb_untimeout(uhci_timo, pipe->intrreqh, pipe->intrreqh->timo_handle);
- DPRINTF(("uhci_root_intr_close\n"));
-}
diff --git a/sys/dev/usb/uhcireg.h b/sys/dev/usb/uhcireg.h
deleted file mode 100644
index 9c8ef008b2b70..0000000000000
--- a/sys/dev/usb/uhcireg.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* $NetBSD: uhcireg.h,v 1.5 1998/12/27 23:40:52 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DEV_PCI_UHCIREG_H_
-#define _DEV_PCI_UHCIREG_H_
-
-/*** PCI config registers ***/
-
-#define PCI_USBREV 0x60 /* USB protocol revision */
-#define PCI_USBREV_MASK 0xff
-#define PCI_USBREV_PRE_1_0 0x00
-#define PCI_USBREV_1_0 0x10
-
-#define PCI_CBIO 0x20 /* configuration base IO */
-
-#define PCI_INTERFACE_UHCI 0x00
-
-/*** UHCI registers ***/
-
-#define UHCI_CMD 0x00
-#define UHCI_CMD_RS 0x0001
-#define UHCI_CMD_HCRESET 0x0002
-#define UHCI_CMD_GRESET 0x0004
-#define UHCI_CMD_EGSM 0x0008
-#define UHCI_CMD_FGR 0x0010
-#define UHCI_CMD_SWDBG 0x0020
-#define UHCI_CMD_CF 0x0040
-#define UHCI_CMD_MAXP 0x0080
-
-#define UHCI_STS 0x02
-#define UHCI_STS_USBINT 0x0001
-#define UHCI_STS_USBEI 0x0002
-#define UHCI_STS_RD 0x0004
-#define UHCI_STS_HSE 0x0008
-#define UHCI_STS_HCPE 0x0010
-#define UHCI_STS_HCH 0x0020
-
-#define UHCI_INTR 0x04
-#define UHCI_INTR_TOCRCIE 0x0001
-#define UHCI_INTR_RIE 0x0002
-#define UHCI_INTR_IOCE 0x0004
-#define UHCI_INTR_SPIE 0x0008
-
-#define UHCI_FRNUM 0x06
-#define UHCI_FRNUM_MASK 0x03ff
-
-
-#define UHCI_FLBASEADDR 0x08
-
-#define UHCI_SOF 0x0c
-#define UHCI_SOF_MASK 0x7f
-
-#define UHCI_PORTSC1 0x010
-#define UHCI_PORTSC2 0x012
-#define UHCI_PORTSC_CCS 0x0001
-#define UHCI_PORTSC_CSC 0x0002
-#define UHCI_PORTSC_PE 0x0004
-#define UHCI_PORTSC_POEDC 0x0008
-#define UHCI_PORTSC_LS 0x0030
-#define UHCI_PORTSC_LS_SHIFT 4
-#define UHCI_PORTSC_RD 0x0040
-#define UHCI_PORTSC_LSDA 0x0100
-#define UHCI_PORTSC_PR 0x0200
-#define UHCI_PORTSC_OCI 0x0400
-#define UHCI_PORTSC_OCIC 0x0800
-#define UHCI_PORTSC_SUSP 0x1000
-
-#define UHCI_FRAMELIST_COUNT 1024
-#define UHCI_FRAMELIST_ALIGN 4096
-
-#define UHCI_TD_ALIGN 16
-#define UHCI_QH_ALIGN 16
-
-typedef u_int32_t uhci_physaddr_t;
-#define UHCI_PTR_T 0x00000001
-#define UHCI_PTR_Q 0x00000002
-#define UHCI_PTR_VF 0x00000004
-
-typedef union {
- struct uhci_soft_qh *sqh;
- struct uhci_soft_td *std;
-} uhci_soft_td_qh_t;
-
-/*
- * The Queue Heads and Transfer Descriptors and accessed
- * by both the CPU and the USB controller which runs
- * concurrently. This means that they have to be accessed
- * with great care. As long as the data structures are
- * not linked into the controller's frame list they cannot
- * be accessed by it and anything goes. As soon as a
- * TD is accessible by the controller it "owns" the td_status
- * field; it will not be written by the CPU. Similarly
- * the controller "owns" the qh_elink field.
- */
-
-typedef struct {
- uhci_physaddr_t td_link;
- u_int32_t td_status;
-#define UHCI_TD_GET_ACTLEN(s) (((s) + 1) & 0x3ff)
-#define UHCI_TD_ZERO_ACTLEN(t) ((t) | 0x3ff)
-#define UHCI_TD_BITSTUFF 0x00020000
-#define UHCI_TD_CRCTO 0x00040000
-#define UHCI_TD_NAK 0x00080000
-#define UHCI_TD_BABBLE 0x00100000
-#define UHCI_TD_DBUFFER 0x00200000
-#define UHCI_TD_STALLED 0x00400000
-#define UHCI_TD_ACTIVE 0x00800000
-#define UHCI_TD_IOC 0x01000000
-#define UHCI_TD_IOS 0x02000000
-#define UHCI_TD_LS 0x04000000
-#define UHCI_TD_GET_ERRCNT(s) (((s) >> 27) & 3)
-#define UHCI_TD_SET_ERRCNT(n) ((n) << 27)
-#define UHCI_TD_SPD 0x20000000
- u_int32_t td_token;
-#define UHCI_TD_PID_IN 0x00000069
-#define UHCI_TD_PID_OUT 0x000000e1
-#define UHCI_TD_PID_SETUP 0x0000002d
-#define UHCI_TD_GET_PID(s) ((s) & 0xff)
-#define UHCI_TD_SET_DEVADDR(a) ((a) << 8)
-#define UHCI_TD_GET_DEVADDR(s) (((s) >> 8) & 0x7f)
-#define UHCI_TD_SET_ENDPT(e) (((e)&0xf) << 15)
-#define UHCI_TD_GET_ENDPT(s) (((s) >> 15) & 0xf)
-#define UHCI_TD_SET_DT(t) ((t) << 19)
-#define UHCI_TD_GET_DT(s) (((s) >> 19) & 1)
-#define UHCI_TD_SET_MAXLEN(l) (((l)-1) << 21)
-#define UHCI_TD_GET_MAXLEN(s) ((((s) >> 21) + 1) & 0x7ff)
-#define UHCI_TD_MAXLEN_MASK 0xffe00000
- u_int32_t td_buffer;
- uhci_soft_td_qh_t link; /* soft version of the td_link field */
- /* padding to 32 bytes */
-} uhci_td_t;
-#define UHCI_TD_SIZE 32
-
-#define UHCI_TD_ERROR (UHCI_TD_BITSTUFF|UHCI_TD_CRCTO|UHCI_TD_BABBLE|UHCI_TD_DBUFFER|UHCI_TD_STALLED)
-
-#define UHCI_TD_SETUP(len, endp, dev) (UHCI_TD_SET_MAXLEN(len) | \
- UHCI_TD_SET_ENDPT(endp) | UHCI_TD_SET_DEVADDR(dev) | UHCI_TD_PID_SETUP)
-#define UHCI_TD_OUT(len, endp, dev, dt) (UHCI_TD_SET_MAXLEN(len) | \
- UHCI_TD_SET_ENDPT(endp) | UHCI_TD_SET_DEVADDR(dev) | \
- UHCI_TD_PID_OUT | UHCI_TD_SET_DT(dt))
-#define UHCI_TD_IN(len, endp, dev, dt) (UHCI_TD_SET_MAXLEN(len) | \
- UHCI_TD_SET_ENDPT(endp) | UHCI_TD_SET_DEVADDR(dev) | UHCI_TD_PID_IN | \
- UHCI_TD_SET_DT(dt))
-
-typedef struct {
- uhci_physaddr_t qh_hlink;
- uhci_physaddr_t qh_elink;
- struct uhci_soft_qh *hlink; /* soft version of qh_hlink */
- struct uhci_soft_td *elink; /* soft version of qh_elink */
- /* padding to 32 bytes */
-} uhci_qh_t;
-#define UHCI_QH_SIZE 32
-
-#endif /* _DEV_PCI_UHCIREG_H_ */
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
deleted file mode 100644
index 7143c42fbf0d1..0000000000000
--- a/sys/dev/usb/uhcivar.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* $NetBSD: uhcivar.h,v 1.5 1998/12/26 12:53:02 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * To avoid having 1024 TDs for each isochronous transfer we introduce
- * a virtual frame list. Every UHCI_VFRAMELIST_COUNT entries in the real
- * frame list points to a non-active TD. These, in turn, which form the
- * starts of the virtual frame list. This also has the advantage that it
- * simplifies linking in/out TD/QH in the schedule.
- * Furthermore, initially each of the inactive TDs point to an inactive
- * QH that forms the start of the interrupt traffic for that slot.
- * Each of these QHs point to the same QH that is the start of control
- * traffic.
- *
- * UHCI_VFRAMELIST_COUNT should be a power of 2 and <= UHCI_FRAMELIST_COUNT.
- */
-#define UHCI_VFRAMELIST_COUNT 128
-
-typedef struct uhci_soft_qh uhci_soft_qh_t;
-typedef struct uhci_soft_td uhci_soft_td_t;
-
-/*
- * An interrupt info struct contains the information needed to
- * execute a requested routine when the controller generates an
- * interrupt. Since we cannot know which transfer generated
- * the interrupt all structs are linked together so they can be
- * searched at interrupt time.
- */
-typedef struct uhci_intr_info {
- struct uhci_softc *sc;
- usbd_request_handle reqh;
- uhci_soft_td_t *stdstart;
- uhci_soft_td_t *stdend;
- LIST_ENTRY(uhci_intr_info) list;
-#if defined(__FreeBSD__)
- struct callout_handle timeout_handle;
-#endif /* defined(__FreeBSD__) */
-#ifdef DIAGNOSTIC
- int isdone;
-#endif
-} uhci_intr_info_t;
-
-/*
- * Extra information that we need for a TD.
- */
-struct uhci_soft_td {
- uhci_td_t *td; /* The real TD */
- uhci_physaddr_t physaddr; /* and its physical address. */
-};
-#define UHCI_TD_CHUNK 128 /*(PAGE_SIZE / UHCI_TD_SIZE)*/
-
-/*
- * Extra information that we need for a QH.
- */
-struct uhci_soft_qh {
- uhci_qh_t *qh; /* The real QH */
- uhci_physaddr_t physaddr; /* and its physical address. */
- int pos; /* Timeslot position */
- uhci_intr_info_t *intr_info; /* Who to call on completion. */
-};
-#define UHCI_QH_CHUNK 128 /*(PAGE_SIZE / UHCI_QH_SIZE)*/
-
-/* Only used for buffer free list. */
-struct uhci_buffer {
- struct uhci_buffer *next;
-};
-#define UHCI_BUFFER_SIZE 64
-#define UHCI_BUFFER_CHUNK 64 /*(PAGE_SIZE / UHCI_BUFFER_SIZE)*/
-
-/*
- * Information about an entry in the virtial frame list.
- */
-struct uhci_vframe {
- uhci_soft_td_t *htd; /* pointer to dummy TD */
- uhci_soft_td_t *etd; /* pointer to last TD */
- uhci_soft_qh_t *hqh; /* pointer to dummy QH */
- uhci_soft_qh_t *eqh; /* pointer to last QH */
- u_int bandwidth; /* max bandwidth used by this frame */
-};
-
-typedef struct uhci_softc {
- struct usbd_bus sc_bus; /* base device */
-#if defined(__NetBSD__)
- void *sc_ih; /* interrupt vectoring */
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
-
- bus_dma_tag_t sc_dmatag; /* DMA tag */
- /* XXX should keep track of all DMA memory */
-#elif defined(__FreeBSD__)
- int sc_iobase;
- int unit;
-#endif /* defined(__FreeBSD__) */
-
- uhci_physaddr_t *sc_pframes;
- struct uhci_vframe sc_vframes[UHCI_VFRAMELIST_COUNT];
-
- uhci_soft_qh_t *sc_ctl_start; /* dummy QH for control */
- uhci_soft_qh_t *sc_ctl_end; /* last control QH */
- uhci_soft_qh_t *sc_bulk_start; /* dummy QH for bulk */
- uhci_soft_qh_t *sc_bulk_end; /* last bulk transfer */
-
- uhci_soft_td_t *sc_freetds;
- uhci_soft_qh_t *sc_freeqhs;
- struct uhci_buffer *sc_freebuffers;
-
- u_int8_t sc_addr; /* device address */
- u_int8_t sc_conf; /* device configuration */
-
- char sc_isreset;
-
- int sc_intrs;
- LIST_HEAD(, uhci_intr_info) sc_intrhead;
-
- /* Info for the root hub interrupt channel. */
- int sc_ival;
-
- char sc_vflock;
-#define UHCI_HAS_LOCK 1
-#define UHCI_WANT_LOCK 2
-
-#if defined(__NetBSD__)
- usb_dma_t *sc_mallocs;
-#endif
-
- char sc_vendor[16];
-} uhci_softc_t;
-
-usbd_status uhci_init __P((uhci_softc_t *));
-int uhci_intr __P((void *));
-#if 0
-void uhci_reset __P((void *));
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (uhcidebug) printf x
-#define DPRINTFN(n,x) if (uhcidebug>(n)) printf x
-extern int uhcidebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
deleted file mode 100644
index 26c0e5b5b20f6..0000000000000
--- a/sys/dev/usb/uhid.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/* $NetBSD: uhid.c,v 1.14 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/filio.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/hid.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (uhiddebug) printf x
-#define DPRINTFN(n,x) if (uhiddebug>(n)) printf x
-int uhiddebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct uhid_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
- usbd_pipe_handle sc_intrpipe; /* interrupt pipe */
- int sc_ep_addr;
-
- int sc_isize;
- int sc_osize;
- int sc_fsize;
- u_int8_t sc_iid;
- u_int8_t sc_oid;
- u_int8_t sc_fid;
-
- char *sc_ibuf;
- char *sc_obuf;
-
- void *sc_repdesc;
- int sc_repdesc_size;
-
- struct clist sc_q;
- struct selinfo sc_rsel;
- u_char sc_state; /* driver state */
-#define UHID_OPEN 0x01 /* device is open */
-#define UHID_ASLP 0x02 /* waiting for device data */
-#define UHID_NEEDCLEAR 0x04 /* needs clearing endpoint stall */
-#define UHID_IMMED 0x08 /* return read data immediately */
- int sc_disconnected; /* device is gone */
-};
-
-#define UHIDUNIT(dev) (minor(dev))
-#define UHID_CHUNK 128 /* chunk size for read */
-#define UHID_BSIZE 1020 /* buffer size */
-
-int uhidopen __P((dev_t, int, int, struct proc *));
-int uhidclose __P((dev_t, int, int, struct proc *p));
-int uhidread __P((dev_t, struct uio *uio, int));
-int uhidwrite __P((dev_t, struct uio *uio, int));
-int uhidioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-int uhidpoll __P((dev_t, int, struct proc *));
-void uhid_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void uhid_disco __P((void *));
-
-USB_DECLARE_DRIVER(uhid);
-
-USB_MATCH(uhid)
-{
- USB_MATCH_START(uhid, uaa);
- usb_interface_descriptor_t *id;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id || id->bInterfaceClass != UCLASS_HID)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_GENERIC);
-}
-
-USB_ATTACH(uhid)
-{
- USB_ATTACH_START(uhid, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- usb_endpoint_descriptor_t *ed;
- int size;
- void *desc;
- usbd_status r;
- char devinfo[1024];
-
- sc->sc_disconnected = 1;
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed) {
- printf("%s: could not read endpoint descriptor\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- DPRINTFN(10,("uhid_attach: bLength=%d bDescriptorType=%d "
- "bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
- " bInterval=%d\n",
- ed->bLength, ed->bDescriptorType,
- ed->bEndpointAddress & UE_ADDR,
- ed->bEndpointAddress & UE_IN ? "in" : "out",
- ed->bmAttributes & UE_XFERTYPE,
- UGETW(ed->wMaxPacketSize), ed->bInterval));
-
- if ((ed->bEndpointAddress & UE_IN) != UE_IN ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: unexpected endpoint\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- sc->sc_ep_addr = ed->bEndpointAddress;
- sc->sc_disconnected = 0;
-
- r = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_USB);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- (void)usbd_set_idle(iface, 0, 0);
-
- sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid);
- sc->sc_osize = hid_report_size(desc, size, hid_output, &sc->sc_oid);
- sc->sc_fsize = hid_report_size(desc, size, hid_feature, &sc->sc_fid);
-
- sc->sc_repdesc = desc;
- sc->sc_repdesc_size = size;
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-uhid_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-#endif
-
-void
-uhid_disco(p)
- void *p;
-{
- struct uhid_softc *sc = p;
-
- DPRINTF(("ums_hid: sc=%p\n", sc));
- usbd_abort_pipe(sc->sc_intrpipe);
- sc->sc_disconnected = 1;
-}
-
-void
-uhid_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct uhid_softc *sc = addr;
-
- DPRINTFN(5, ("uhid_intr: status=%d\n", status));
- DPRINTFN(5, ("uhid_intr: data = %02x %02x %02x\n",
- sc->sc_ibuf[0], sc->sc_ibuf[1], sc->sc_ibuf[2]));
-
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("uhid_intr: status=%d\n", status));
- sc->sc_state |= UHID_NEEDCLEAR;
- return;
- }
-
- (void) b_to_q(sc->sc_ibuf, sc->sc_isize, &sc->sc_q);
-
- if (sc->sc_state & UHID_ASLP) {
- sc->sc_state &= ~UHID_ASLP;
- DPRINTFN(5, ("uhid_intr: waking %p\n", sc));
- wakeup((caddr_t)sc);
- }
- selwakeup(&sc->sc_rsel);
-}
-
-int
-uhidopen(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- usbd_status r;
- USB_GET_SC_OPEN(uhid, UHIDUNIT(dev), sc);
-
- if (!sc)
- return (ENXIO);
-
- DPRINTF(("uhidopen: sc=%p, disco=%d\n", sc, sc->sc_disconnected));
-
- if (sc->sc_disconnected)
- return (EIO);
-
- if (sc->sc_state & UHID_OPEN)
- return (EBUSY);
-
-#if defined(__NetBSD__)
- if (clalloc(&sc->sc_q, UHID_BSIZE, 0) == -1)
- return (ENOMEM);
-#elif defined(__FreeBSD__)
- clist_alloc_cblocks(&sc->sc_q, UHID_BSIZE, 0);
-#endif
-
- sc->sc_state |= UHID_OPEN;
- sc->sc_state &= ~UHID_IMMED;
-
- sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_WAITOK);
- sc->sc_obuf = malloc(sc->sc_osize, M_USB, M_WAITOK);
-
- /* Set up interrupt pipe. */
- r = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
- USBD_SHORT_XFER_OK,
- &sc->sc_intrpipe, sc, sc->sc_ibuf,
- sc->sc_isize, uhid_intr);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("uhidopen: usbd_open_pipe_intr failed, "
- "error=%d\n",r));
- sc->sc_state &= ~UHID_OPEN;
- return (EIO);
- }
- usbd_set_disco(sc->sc_intrpipe, uhid_disco, sc);
-
- return (0);
-}
-
-int
-uhidclose(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTF(("uhidclose: sc=%p\n", sc));
-
- /* Disable interrupts. */
- usbd_abort_pipe(sc->sc_intrpipe);
- usbd_close_pipe(sc->sc_intrpipe);
-
- sc->sc_state &= ~UHID_OPEN;
-
-#if defined(__NetBSD__)
- clfree(&sc->sc_q);
-#elif defined(__FreeBSD__)
- clist_free_cblocks(&sc->sc_q);
-#endif
-
- free(sc->sc_ibuf, M_USB);
- free(sc->sc_obuf, M_USB);
-
- return (0);
-}
-
-int
-uhidread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- int s;
- int error = 0;
- size_t length;
- u_char buffer[UHID_CHUNK];
- usbd_status r;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTFN(1, ("uhidread\n"));
- if (sc->sc_state & UHID_IMMED) {
- DPRINTFN(1, ("uhidread immed\n"));
-
- r = usbd_get_report(sc->sc_iface, UHID_INPUT_REPORT,
- sc->sc_iid, sc->sc_ibuf, sc->sc_isize);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- return (uiomove(buffer, sc->sc_isize, uio));
- }
-
- s = splusb();
- while (sc->sc_q.c_cc == 0) {
- if (flag & IO_NDELAY) {
- splx(s);
- return EWOULDBLOCK;
- }
- sc->sc_state |= UHID_ASLP;
- DPRINTFN(5, ("uhidread: sleep on %p\n", sc));
- error = tsleep((caddr_t)sc, PZERO | PCATCH, "uhidrea", 0);
- DPRINTFN(5, ("uhidread: woke, error=%d\n", error));
- if (error) {
- sc->sc_state &= ~UHID_ASLP;
- splx(s);
- return (error);
- }
- if (sc->sc_state & UHID_NEEDCLEAR) {
- DPRINTFN(-1,("uhidread: clearing stall\n"));
- sc->sc_state &= ~UHID_NEEDCLEAR;
- usbd_clear_endpoint_stall(sc->sc_intrpipe);
- }
- }
- splx(s);
-
- /* Transfer as many chunks as possible. */
- while (sc->sc_q.c_cc > 0 && uio->uio_resid > 0) {
- length = min(sc->sc_q.c_cc, uio->uio_resid);
- if (length > sizeof(buffer))
- length = sizeof(buffer);
-
- /* Remove a small chunk from the input queue. */
- (void) q_to_b(&sc->sc_q, buffer, length);
- DPRINTFN(5, ("uhidread: got %d chars\n", length));
-
- /* Copy the data to the user process. */
- if ((error = uiomove(buffer, length, uio)) != 0)
- break;
- }
-
- return (error);
-}
-
-int
-uhidwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- int error;
- int size;
- usbd_status r;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTFN(1, ("uhidwrite\n"));
-
- size = sc->sc_osize;
- error = 0;
- while (uio->uio_resid > 0) {
- if (uio->uio_resid != size)
- return (0);
- if ((error = uiomove(sc->sc_obuf, size, uio)) != 0)
- break;
- if (sc->sc_oid)
- r = usbd_set_report(sc->sc_iface, UHID_OUTPUT_REPORT,
- sc->sc_obuf[0],
- sc->sc_obuf+1, size-1);
- else
- r = usbd_set_report(sc->sc_iface, UHID_OUTPUT_REPORT,
- 0, sc->sc_obuf, size);
- if (r != USBD_NORMAL_COMPLETION) {
- error = EIO;
- break;
- }
- }
- return (error);
-}
-
-int
-uhidioctl(dev, cmd, addr, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t addr;
- int flag;
- struct proc *p;
-{
- struct usb_ctl_report_desc *rd;
- struct usb_ctl_report *re;
- int size, id;
- usbd_status r;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- DPRINTFN(2, ("uhidioctl: cmd=%lx\n", cmd));
- switch (cmd) {
- case FIONBIO:
- /* All handled in the upper FS layer. */
- break;
-
- case USB_GET_REPORT_DESC:
- rd = (struct usb_ctl_report_desc *)addr;
- size = min(sc->sc_repdesc_size, sizeof rd->data);
- rd->size = size;
- memcpy(rd->data, sc->sc_repdesc, size);
- break;
-
- case USB_SET_IMMED:
- if (*(int *)addr) {
- /* XXX should read into ibuf, but does it matter */
- r = usbd_get_report(sc->sc_iface, UHID_INPUT_REPORT,
- sc->sc_iid, sc->sc_ibuf,
- sc->sc_isize);
- if (r != USBD_NORMAL_COMPLETION)
- return (EOPNOTSUPP);
-
- sc->sc_state |= UHID_IMMED;
- } else
- sc->sc_state &= ~UHID_IMMED;
- break;
-
- case USB_GET_REPORT:
- re = (struct usb_ctl_report *)addr;
- switch (re->report) {
- case UHID_INPUT_REPORT:
- size = sc->sc_isize;
- id = sc->sc_iid;
- break;
- case UHID_OUTPUT_REPORT:
- size = sc->sc_osize;
- id = sc->sc_oid;
- break;
- case UHID_FEATURE_REPORT:
- size = sc->sc_fsize;
- id = sc->sc_fid;
- break;
- default:
- return (EINVAL);
- }
- r = usbd_get_report(sc->sc_iface, re->report, id,
- re->data, size);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- break;
-
- default:
- return (EINVAL);
- }
- return (0);
-}
-
-int
-uhidpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- int revents = 0;
- int s;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
-
- if (sc->sc_disconnected)
- return (EIO);
-
- s = splusb();
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
- if (events & (POLLIN | POLLRDNORM)) {
- if (sc->sc_q.c_cc > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->sc_rsel);
- }
-
- splx(s);
- return (revents);
-}
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
deleted file mode 100644
index 40ff36317addc..0000000000000
--- a/sys/dev/usb/uhub.c
+++ /dev/null
@@ -1,521 +0,0 @@
-/* $NetBSD: uhub.c,v 1.14 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdivar.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-extern char *usbd_error_strs[];
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct uhub_softc {
- bdevice sc_dev; /* base device */
- usbd_device_handle sc_hub; /* USB device */
- usbd_pipe_handle sc_ipipe; /* interrupt pipe */
- u_int8_t sc_status[1]; /* XXX more ports */
- u_char sc_running;
-};
-
-usbd_status uhub_init_port __P((struct usbd_port *));
-void uhub_disconnect __P((struct usbd_port *up));
-usbd_status uhub_explore __P((usbd_device_handle hub));
-void uhub_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-
-/*void uhub_disco __P((void *));*/
-
-USB_DECLARE_DRIVER(uhub);
-
-#if defined(__FreeBSD__)
-devclass_t uhubroot_devclass;
-
-static device_method_t uhubroot_methods[] = {
- DEVMETHOD(device_probe, uhub_match),
- DEVMETHOD(device_attach, uhub_attach),
- /* detach is not allowed for a root hub */
- {0,0}
-};
-
-static driver_t uhubroot_driver = {
- "uhub",
- uhubroot_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct uhub_softc)
-};
-#endif
-
-#if defined(__NetBSD__)
-struct cfattach uhub_uhub_ca = {
- sizeof(struct uhub_softc), uhub_match, uhub_attach
-};
-#endif
-
-USB_MATCH(uhub)
-{
- USB_MATCH_START(uhub, uaa);
- usb_device_descriptor_t *dd = usbd_get_device_descriptor(uaa->device);
-
- DPRINTFN(5,("uhub_match, dd=%p\n", dd));
- /*
- * The subclass for hubs seems to be 0 for some and 1 for others,
- * so we just ignore the subclass.
- */
- if (uaa->iface == 0 && dd->bDeviceClass == UCLASS_HUB)
- return (UMATCH_DEVCLASS_DEVSUBCLASS);
- return (UMATCH_NONE);
-}
-
-USB_ATTACH(uhub)
-{
- USB_ATTACH_START(uhub, sc, uaa);
- usbd_device_handle dev = uaa->device;
- char devinfo[1024];
- usbd_status r;
- struct usbd_hub *hub;
- usb_device_request_t req;
- usb_hub_descriptor_t hubdesc;
- int p, port, nports, nremov;
- usbd_interface_handle iface;
- usb_endpoint_descriptor_t *ed;
-
- DPRINTFN(1,("uhub_attach\n"));
- sc->sc_hub = dev;
- usbd_devinfo(dev, 1, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
-
- r = usbd_set_config_index(dev, 0, 1);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("%s: configuration failed, error=%d(%s)\n",
- USBDEVNAME(sc->sc_dev), r, usbd_error_strs[r]));
- USB_ATTACH_ERROR_RETURN;
- }
-
- if (dev->depth > USB_HUB_MAX_DEPTH) {
- printf("%s: hub depth (%d) exceeded, hub ignored\n",
- USBDEVNAME(sc->sc_dev), USB_HUB_MAX_DEPTH);
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* Get hub descriptor. */
- req.bmRequestType = UT_READ_CLASS_DEVICE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE);
- DPRINTFN(1,("usb_init_hub: getting hub descriptor\n"));
- r = usbd_do_request(dev, &req, &hubdesc);
- nports = hubdesc.bNbrPorts;
- if (r == USBD_NORMAL_COMPLETION && nports > 7) {
- USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE + (nports+1) / 8);
- r = usbd_do_request(dev, &req, &hubdesc);
- }
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("%s: getting hub descriptor failed, error=%d(%s)\n",
- USBDEVNAME(sc->sc_dev), r, usbd_error_strs[r]));
- USB_ATTACH_ERROR_RETURN;
- }
-
- for (nremov = 0, port = 1; port <= nports; port++)
- if (!UHD_NOT_REMOV(&hubdesc, port))
- nremov++;
- printf("%s: %d port%s with %d removable, %s powered\n",
- USBDEVNAME(sc->sc_dev), nports, nports != 1 ? "s" : "",
- nremov, dev->self_powered ? "self" : "bus");
-
-
- hub = malloc(sizeof(*hub) + (nports-1) * sizeof(struct usbd_port),
- M_USB, M_NOWAIT);
- if (hub == 0)
- USB_ATTACH_ERROR_RETURN;
- dev->hub = hub;
- dev->hub->hubsoftc = sc;
- hub->explore = uhub_explore;
- hub->hubdesc = hubdesc;
-
- DPRINTFN(1,("usbhub_init_hub: selfpowered=%d, parent=%p, "
- "parent->selfpowered=%d\n",
- dev->self_powered, dev->powersrc->parent,
- dev->powersrc->parent ?
- dev->powersrc->parent->self_powered : 0));
- if (!dev->self_powered && dev->powersrc->parent &&
- !dev->powersrc->parent->self_powered) {
- printf("%s: bus powered hub connected to bus powered hub, "
- "ignored\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* Set up interrupt pipe. */
- r = usbd_device2interface_handle(dev, 0, &iface);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: no interface handle\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (ed == 0) {
- printf("%s: no endpoint descriptor\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- if ((ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: bad interrupt endpoint\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- r = usbd_open_pipe_intr(iface, ed->bEndpointAddress,USBD_SHORT_XFER_OK,
- &sc->sc_ipipe, sc, sc->sc_status,
- sizeof(sc->sc_status),
- uhub_intr);
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: cannot open interrupt pipe\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* Wait with power off for a while. */
- usbd_delay_ms(dev, USB_POWER_DOWN_TIME);
-
- for (p = 0; p < nports; p++) {
- struct usbd_port *up = &hub->ports[p];
- up->device = 0;
- up->parent = dev;
- up->portno = p+1;
- r = uhub_init_port(up);
- if (r != USBD_NORMAL_COMPLETION)
- printf("%s: init of port %d failed\n",
- USBDEVNAME(sc->sc_dev), up->portno);
- }
- sc->sc_running = 1;
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-uhub_detach(device_t self)
-{
- struct uhub_softc *sc = device_get_softc(self);
- int nports = sc->sc_hub->hub->hubdesc.bNbrPorts;
- int p;
-
- for (p = 0; p < nports; p++) {
- struct usbd_port *up = &sc->sc_hub->hub->ports[p];
- if (up->device)
- uhub_disconnect(up);
- }
-
- free(sc->sc_hub->hub, M_USB);
-
- return 0;
-}
-#endif
-
-usbd_status
-uhub_init_port(up)
- struct usbd_port *up;
-{
- int port = up->portno;
- usbd_device_handle dev = up->parent;
- usbd_status r;
- u_int16_t pstatus;
-
- r = usbd_get_port_status(dev, port, &up->status);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- pstatus = UGETW(up->status.wPortStatus);
- DPRINTF(("usbd_init_port: adding hub port=%d status=0x%04x "
- "change=0x%04x\n",
- port, pstatus, UGETW(up->status.wPortChange)));
- if ((pstatus & UPS_PORT_POWER) == 0) {
- /* Port lacks power, turn it on */
-
- /* First let the device go through a good power cycle, */
- usbd_delay_ms(dev, USB_PORT_POWER_DOWN_TIME);
-
- /* then turn the power on. */
- r = usbd_set_port_feature(dev, port, UHF_PORT_POWER);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- r = usbd_get_port_status(dev, port, &up->status);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- DPRINTF(("usb_init_port: turn on port %d power status=0x%04x "
- "change=0x%04x\n",
- port, UGETW(up->status.wPortStatus),
- UGETW(up->status.wPortChange)));
- /* Wait for stable power. */
- usbd_delay_ms(dev, dev->hub->hubdesc.bPwrOn2PwrGood *
- UHD_PWRON_FACTOR);
- }
- if (dev->self_powered)
- /* Self powered hub, give ports maximum current. */
- up->power = USB_MAX_POWER;
- else
- up->power = USB_MIN_POWER;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-uhub_explore(dev)
- usbd_device_handle dev;
-{
- usb_hub_descriptor_t *hd = &dev->hub->hubdesc;
- struct uhub_softc *sc = dev->hub->hubsoftc;
- struct usbd_port *up;
- usbd_status r;
- int port;
- int change, status;
-
- DPRINTFN(10, ("uhub_explore dev=%p addr=%d\n", dev, dev->address));
-
- if (!sc->sc_running)
- return (USBD_NOT_STARTED);
-
- /* Ignore hubs that are too deep. */
- if (dev->depth > USB_HUB_MAX_DEPTH)
- return (USBD_TOO_DEEP);
-
- for(port = 1; port <= hd->bNbrPorts; port++) {
- up = &dev->hub->ports[port-1];
- r = usbd_get_port_status(dev, port, &up->status);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("uhub_explore: get port status failed, "
- "error=%d(%s)\n",
- r, usbd_error_strs[r]));
- continue;
- }
- status = UGETW(up->status.wPortStatus);
- change = UGETW(up->status.wPortChange);
- DPRINTFN(5, ("uhub_explore: port %d status 0x%04x 0x%04x\n",
- port, status, change));
- if (change & UPS_C_PORT_ENABLED) {
- usbd_clear_port_feature(dev, port, UHF_C_PORT_ENABLE);
- if (status & UPS_PORT_ENABLED) {
- printf("%s: illegal enable change, port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- } else {
- /* Port error condition. */
- if (up->restartcnt++ < USBD_RESTART_MAX) {
- printf("%s: port error, restarting "
- "port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- goto disco;
- } else {
- printf("%s: port error, giving up "
- "port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- }
- }
- }
- if (!(change & UPS_C_CONNECT_STATUS)) {
- /* No status change, just do recursive explore. */
- if (up->device && up->device->hub)
- up->device->hub->explore(up->device);
- continue;
- }
- DPRINTF(("uhub_explore: status change hub=%d port=%d\n",
- dev->address, port));
- usbd_clear_port_feature(dev, port, UHF_C_PORT_CONNECTION);
- usbd_clear_port_feature(dev, port, UHF_C_PORT_ENABLE);
- /*
- * If there is already a device on the port the change status
- * must mean that is has disconnected. Looking at the
- * current connect status is not enough to figure this out
- * since a new unit may have been connected before we handle
- * the disconnect.
- */
- disco:
- if (up->device) {
- /* Disconnected */
- DPRINTF(("uhub_explore: device %d disappeared "
- "on port %d\n",
- up->device->address, port));
- uhub_disconnect(up);
- usbd_clear_port_feature(dev, port,
- UHF_C_PORT_CONNECTION);
- }
- if (!(status & UPS_CURRENT_CONNECT_STATUS))
- continue;
-
- /* Connected */
- up->restartcnt = 0;
-
- /* Wait for maximum device power up time. */
- usbd_delay_ms(dev, USB_PORT_POWERUP_DELAY);
-
- /* Reset port, which implies enabling it. */
- if (usbd_reset_port(dev, port, &up->status) !=
- USBD_NORMAL_COMPLETION)
- continue;
-
- /* Get device info and set its address. */
- r = usbd_new_device(&sc->sc_dev, dev->bus,
- dev->depth + 1, status & UPS_LOW_SPEED,
- port, up);
- /* XXX retry a few times? */
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1,("uhub_explore: usb_new_device failed, "
- "error=%d(%s)\n", r, usbd_error_strs[r]));
- /* Avoid addressing problems by disabling. */
- /* usbd_reset_port(dev, port, &up->status); */
-/* XXX
- * What should we do. The device may or may not be at its
- * assigned address. In any case we'd like to ignore it.
- * Maybe the port should be disabled until the device is
- * disconnected.
- */
- if (r == USBD_SET_ADDR_FAILED || 1) {/* XXX */
- /* The unit refused to accept a new
- * address, and since we cannot leave
- * at 0 we have to disable the port
- * instead. */
- printf("%s: device problem, disabling "
- "port %d\n",
- USBDEVNAME(sc->sc_dev), port);
- usbd_clear_port_feature(dev, port,
- UHF_PORT_ENABLE);
- /* Make sure we don't try to restart it. */
- up->restartcnt = USBD_RESTART_MAX;
- }
- } else {
- if (up->device->hub)
- up->device->hub->explore(up->device);
- }
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-uhub_disconnect(up)
- struct usbd_port *up;
-{
- usbd_device_handle dev = up->device;
- usbd_pipe_handle p, n;
- int i;
- struct softc { bdevice sc_dev; }; /* all softc begin like this */
-
- DPRINTFN(3,("uhub_disconnect: up=%p dev=%p port=%d\n",
- up, dev, up->portno));
-
- printf("%s: at %s port %d (addr %d) disconnected\n",
- USBDEVNAME(((struct softc *)dev->softc)->sc_dev),
- USBDEVNAME(((struct uhub_softc *)up->parent->softc)->sc_dev),
- up->portno, dev->address);
-
- if (!dev->cdesc) {
- /* Partially attached device, just drop it. */
- dev->bus->devices[dev->address] = 0;
- up->device = 0;
- return;
- }
-
- for (i = 0; i < dev->cdesc->bNumInterface; i++) {
- for (p = LIST_FIRST(&dev->ifaces[i].pipes); p; p = n) {
- n = LIST_NEXT(p, next);
- if (p->disco)
- p->disco(p->discoarg);
- usbd_abort_pipe(p);
- usbd_close_pipe(p);
- }
- }
-
- /* XXX Free all data structures and disable further I/O. */
- if (dev->hub) {
- struct usbd_port *rup;
- int p, nports;
-
- DPRINTFN(3,("usb_disconnect: hub, recursing\n"));
- nports = dev->hub->hubdesc.bNbrPorts;
- for(p = 0; p < nports; p++) {
- rup = &dev->hub->ports[p];
- if (rup->device)
- uhub_disconnect(rup);
- }
- }
-
- dev->bus->devices[dev->address] = 0;
- up->device = 0;
- /* XXX free */
-#if defined(__FreeBSD__)
- device_delete_child(
- device_get_parent(((struct softc *)dev->softc)->sc_dev),
- ((struct softc *)dev->softc)->sc_dev);
-#endif
-}
-
-void
-uhub_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct uhub_softc *sc = addr;
-
- DPRINTFN(5,("uhub_intr: sc=%p\n", sc));
- if (status != USBD_NORMAL_COMPLETION)
- usbd_clear_endpoint_stall_async(sc->sc_ipipe);
- else
- usb_needs_explore(sc->sc_hub->bus);
-}
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(uhub, usb, uhubroot_driver, uhubroot_devclass, 0, 0);
-DRIVER_MODULE(uhub, uhub, uhub_driver, uhub_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
deleted file mode 100644
index 0d54e01f3ac1f..0000000000000
--- a/sys/dev/usb/ukbd.c
+++ /dev/null
@@ -1,680 +0,0 @@
-/* $NetBSD: ukbd.c,v 1.22 1999/01/09 12:10:36 drochner Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Information about USB keyboard can be found in the USB HID spec.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <machine/clock.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/hid.h>
-
-#if defined(__NetBSD__)
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wskbdvar.h>
-#include <dev/wscons/wsksymdef.h>
-#include <dev/wscons/wsksymvar.h>
-#include <dev/wscons/wskbdmap_mfii.h>
-
-#include "opt_pckbd_layout.h"
-#include "opt_wsdisplay_compat.h"
-
-#elif defined(__FreeBSD__)
-#include <machine/clock.h>
-#define delay(d) DELAY(d)
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ukbddebug) printf x
-#define DPRINTFN(n,x) if (ukbddebug>(n)) printf x
-int ukbddebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define UPROTO_BOOT_KEYBOARD 1
-
-#define NKEYCODE 6
-
-#define NUM_LOCK 0x01
-#define CAPS_LOCK 0x02
-#define SCROLL_LOCK 0x04
-
-struct ukbd_data {
- u_int8_t modifiers;
-#define MOD_CONTROL_L 0x01
-#define MOD_CONTROL_R 0x10
-#define MOD_SHIFT_L 0x02
-#define MOD_SHIFT_R 0x20
-#define MOD_ALT_L 0x04
-#define MOD_ALT_R 0x40
-#define MOD_WIN_L 0x08
-#define MOD_WIN_R 0x80
- u_int8_t reserved;
- u_int8_t keycode[NKEYCODE];
-};
-
-#define PRESS 0
-#define RELEASE 0x100
-
-#define NMOD 6
-static struct {
- int mask, key;
-} ukbd_mods[NMOD] = {
- { MOD_CONTROL_L, 29 },
- { MOD_CONTROL_R, 58 },
- { MOD_SHIFT_L, 42 },
- { MOD_SHIFT_R, 54 },
- { MOD_ALT_L, 56 },
- { MOD_ALT_R, 184 },
-};
-
-#define NN 0 /* no translation */
-/*
- * Translate USB keycodes to US keyboard AT scancodes.
- * Scancodes >= 128 represent EXTENDED keycodes.
- */
-static u_int8_t ukbd_trtab[256] = {
- 0, 0, 0, 0, 30, 48, 46, 32, /* 00 - 07 */
- 18, 33, 34, 35, 23, 36, 37, 38, /* 08 - 0F */
- 50, 49, 24, 25, 16, 19, 31, 20, /* 10 - 17 */
- 22, 47, 17, 45, 21, 44, 2, 3, /* 18 - 1F */
- 4, 5, 6, 7, 8, 9, 10, 11, /* 20 - 27 */
- 28, 1, 14, 15, 57, 12, 13, 26, /* 28 - 2F */
- 27, 43, NN, 39, 40, 41, 51, 52, /* 30 - 37 */
- 53, 58, 59, 60, 61, 62, 63, 64, /* 38 - 3F */
- 65, 66, 67, 68, 87, 88, 170, 70, /* 40 - 47 */
- 127, 210, 199, 201, 211, 207, 209, 205, /* 48 - 4F */
- 203, 208, 200, 69, 181, 55, 74, 78, /* 50 - 57 */
- 156, 79, 80, 81, 75, 76, 77, 71, /* 58 - 5F */
- 72, 73, 82, 83, NN, NN, NN, NN, /* 60 - 67 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 68 - 6F */
- NN, NN, NN, NN, NN, NN, 221, NN, /* 70 - 77 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 78 - 7F */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 80 - 87 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 88 - 8F */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 90 - 97 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* 98 - 9F */
- NN, NN, NN, NN, NN, NN, NN, NN, /* A0 - A7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* A8 - AF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* B0 - B7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* B8 - BF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* C0 - C7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* C8 - CF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* D0 - D7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* D8 - DF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* E0 - E7 */
- NN, NN, NN, 219, NN, NN, NN, 220, /* E8 - EF */
- NN, NN, NN, NN, NN, NN, NN, NN, /* F0 - F7 */
- NN, NN, NN, NN, NN, NN, NN, NN, /* F8 - FF */
-};
-
-#define KEY_ERROR 0x01
-
-#define MAXKEYS (NMOD+2*NKEYCODE)
-
-struct ukbd_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
- usbd_pipe_handle sc_intrpipe; /* interrupt pipe */
- int sc_ep_addr;
-
- struct ukbd_data sc_ndata;
- struct ukbd_data sc_odata;
-
- char sc_enabled;
- char sc_disconnected; /* device is gone */
-
- int sc_leds;
-#if defined(__NetBSD__)
- struct device *sc_wskbddev;
-#ifdef WSDISPLAY_COMPAT_RAWKBD
-#define REP_DELAY1 400
-#define REP_DELAYN 100
- int sc_rawkbd;
- int sc_nrep;
- char sc_rep[MAXKEYS];
-#endif
-
- int sc_polling;
- int sc_pollchar;
-#endif
-};
-
-#define UKBDUNIT(dev) (minor(dev))
-#define UKBD_CHUNK 128 /* chunk size for read */
-#define UKBD_BSIZE 1020 /* buffer size */
-
-void ukbd_cngetc __P((void *, u_int *, int *));
-void ukbd_cnpollc __P((void *, int));
-
-#if defined(__NetBSD__)
-const struct wskbd_consops ukbd_consops = {
- ukbd_cngetc,
- ukbd_cnpollc,
-};
-#endif
-
-void ukbd_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void ukbd_disco __P((void *));
-
-int ukbd_enable __P((void *, int));
-void ukbd_set_leds __P((void *, int));
-#if defined(__NetBSD__)
-int ukbd_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
-int ukbd_cnattach __P((void *v));
-void ukbd_rawrepeat __P((void *v));
-
-const struct wskbd_accessops ukbd_accessops = {
- ukbd_enable,
- ukbd_set_leds,
- ukbd_ioctl,
-#if 0
- ukbd_cnattach,
-#endif
-};
-
-const struct wskbd_mapdata ukbd_keymapdata = {
- pckbd_keydesctab,
-#ifdef PCKBD_LAYOUT
- PCKBD_LAYOUT,
-#else
- KB_US,
-#endif
-};
-#endif
-
-USB_DECLARE_DRIVER(ukbd);
-
-USB_MATCH(ukbd)
-{
- USB_MATCH_START(ukbd, uaa);
- usb_interface_descriptor_t *id;
-
- /* Check that this is a keyboard that speaks the boot protocol. */
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id ||
- id->bInterfaceClass != UCLASS_HID ||
- id->bInterfaceSubClass != USUBCLASS_BOOT ||
- id->bInterfaceProtocol != UPROTO_BOOT_KEYBOARD)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
-}
-
-USB_ATTACH(ukbd)
-{
- USB_ATTACH_START(ukbd, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- usb_endpoint_descriptor_t *ed;
- usbd_status r;
- char devinfo[1024];
-#if defined(__NetBSD__)
- struct wskbddev_attach_args a;
-#endif
-
- sc->sc_disconnected = 1;
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed) {
- printf("%s: could not read endpoint descriptor\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- DPRINTFN(10,("ukbd_attach: bLength=%d bDescriptorType=%d "
- "bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
- " bInterval=%d\n",
- ed->bLength, ed->bDescriptorType,
- ed->bEndpointAddress & UE_ADDR,
- ed->bEndpointAddress & UE_IN ? "in" : "out",
- ed->bmAttributes & UE_XFERTYPE,
- UGETW(ed->wMaxPacketSize), ed->bInterval));
-
- if ((ed->bEndpointAddress & UE_IN) != UE_IN ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: unexpected endpoint\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- if ((usbd_get_quirks(uaa->device)->uq_flags & UQ_NO_SET_PROTO) == 0) {
- r = usbd_set_protocol(iface, 0);
- DPRINTFN(5, ("ukbd_attach: protocol set\n"));
- if (r != USBD_NORMAL_COMPLETION) {
- printf("%s: set protocol failed\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- }
-
- /* Ignore if SETIDLE fails since it is not crucial. */
- usbd_set_idle(iface, 0, 0);
-
- sc->sc_ep_addr = ed->bEndpointAddress;
- sc->sc_disconnected = 0;
-
-#if defined(__NetBSD__)
- a.console = 0;
-
- a.keymap = &ukbd_keymapdata;
-
- a.accessops = &ukbd_accessops;
- a.accesscookie = sc;
-
- /* Flash the leds; no real purpose, just shows we're alive. */
- ukbd_set_leds(sc, WSKBD_LED_SCROLL | WSKBD_LED_NUM | WSKBD_LED_CAPS);
- usbd_delay_ms(uaa->device, 300);
- ukbd_set_leds(sc, 0);
-
- sc->sc_wskbddev = config_found(self, &a, wskbddevprint);
-
-#elif defined(__FreeBSD__)
- /* XXX why waste CPU in delay() ? */
- /* It's alive! IT'S ALIVE! Do a little song and dance. */
- ukbd_set_leds(sc, NUM_LOCK);
- delay(15000);
- ukbd_set_leds(sc, CAPS_LOCK);
- delay(20000);
- ukbd_set_leds(sc, SCROLL_LOCK);
- delay(30000);
- ukbd_set_leds(sc, CAPS_LOCK);
- delay(50000);
- ukbd_set_leds(sc, NUM_LOCK);
-
- ukbd_enable(sc, 1);
-#endif
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-int
-ukbd_detach(device_t self)
-{
- struct ukbd_softc *sc = device_get_softc(self);
- char *devinfo = (char *) device_get_desc(self);
-
- if (sc->sc_enabled)
- return (ENXIO);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
-
- return (0);
-}
-#endif
-
-void
-ukbd_disco(p)
- void *p;
-{
- struct ukbd_softc *sc = p;
-
- DPRINTF(("ukbd_disco: sc=%p\n", sc));
- usbd_abort_pipe(sc->sc_intrpipe);
- sc->sc_disconnected = 1;
-}
-
-int
-ukbd_enable(v, on)
- void *v;
- int on;
-{
- struct ukbd_softc *sc = v;
- usbd_status r;
-
- if (on) {
- /* Set up interrupt pipe. */
- if (sc->sc_enabled)
- return (EBUSY);
-
- sc->sc_enabled = 1;
- r = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
- USBD_SHORT_XFER_OK,
- &sc->sc_intrpipe, sc, &sc->sc_ndata,
- sizeof(sc->sc_ndata), ukbd_intr);
- if (r != USBD_NORMAL_COMPLETION)
- return (EIO);
- usbd_set_disco(sc->sc_intrpipe, ukbd_disco, sc);
- } else {
- /* Disable interrupts. */
- usbd_abort_pipe(sc->sc_intrpipe);
- usbd_close_pipe(sc->sc_intrpipe);
-
- sc->sc_enabled = 0;
- }
-
- return (0);
-}
-
-void
-ukbd_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct ukbd_softc *sc = addr;
- struct ukbd_data *ud = &sc->sc_ndata;
- int mod, omod;
- int ibuf[MAXKEYS]; /* chars events */
- int nkeys, i, j;
- int key, c;
-#define ADDKEY(c) ibuf[nkeys++] = (c)
-
- DPRINTFN(5, ("ukbd_intr: status=%d\n", status));
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ukbd_intr: status=%d\n", status));
- usbd_clear_endpoint_stall_async(sc->sc_intrpipe);
- return;
- }
-
- DPRINTFN(5, (" mod=0x%02x key0=0x%02x key1=0x%02x\n",
- ud->modifiers, ud->keycode[0], ud->keycode[1]));
-
- if (ud->keycode[0] == KEY_ERROR)
- return; /* ignore */
- nkeys = 0;
- mod = ud->modifiers;
- omod = sc->sc_odata.modifiers;
- if (mod != omod)
- for (i = 0; i < NMOD; i++)
- if (( mod & ukbd_mods[i].mask) !=
- (omod & ukbd_mods[i].mask))
- ADDKEY(ukbd_mods[i].key |
- (mod & ukbd_mods[i].mask
- ? PRESS : RELEASE));
- if (memcmp(ud->keycode, sc->sc_odata.keycode, NKEYCODE) != 0) {
- /* Check for released keys. */
- for (i = 0; i < NKEYCODE; i++) {
- key = sc->sc_odata.keycode[i];
- if (key == 0)
- continue;
- for (j = 0; j < NKEYCODE; j++)
- if (key == ud->keycode[j])
- goto rfound;
- c = ukbd_trtab[key];
- if (c)
- ADDKEY(c | RELEASE);
- rfound:
- ;
- }
-
- /* Check for pressed keys. */
- for (i = 0; i < NKEYCODE; i++) {
- key = ud->keycode[i];
- if (key == 0)
- continue;
- for (j = 0; j < NKEYCODE; j++)
- if (key == sc->sc_odata.keycode[j])
- goto pfound;
- c = ukbd_trtab[key];
- DPRINTFN(2,("ukbd_intr: press key=0x%02x -> 0x%02x\n",
- key, c));
- if (c)
- ADDKEY(c | PRESS);
- pfound:
- ;
- }
- }
- sc->sc_odata = *ud;
-
- if (nkeys == 0)
- return;
-
-#if defined(__NetBSD__)
- if (sc->sc_polling) {
- DPRINTFN(1,("ukbd_intr: pollchar = 0x%02x\n", ibuf[0]));
- if (nkeys > 0)
- sc->sc_pollchar = ibuf[0]; /* XXX lost keys? */
- return;
- }
-#ifdef WSDISPLAY_COMPAT_RAWKBD
- if (sc->sc_rawkbd) {
- char cbuf[MAXKEYS * 2];
- int npress;
-
- for (npress = i = j = 0; i < nkeys; i++, j++) {
- c = ibuf[i];
- if (c & 0x80)
- cbuf[j++] = 0xe0;
- cbuf[j] = c & 0x7f;
- if (c & RELEASE)
- cbuf[j] |= 0x80;
- else {
- /* remember keys for autorepeat */
- if (c & 0x80)
- sc->sc_rep[npress++] = 0xe0;
- sc->sc_rep[npress++] = c & 0x7f;
- }
- }
- wskbd_rawinput(sc->sc_wskbddev, cbuf, j);
- untimeout(ukbd_rawrepeat, sc);
- if (npress != 0) {
- sc->sc_nrep = npress;
- timeout(ukbd_rawrepeat, sc, hz * REP_DELAY1 / 1000);
- }
- return;
- }
-#endif
-
- for (i = 0; i < nkeys; i++) {
- c = ibuf[i];
- wskbd_input(sc->sc_wskbddev,
- c & RELEASE ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN,
- c & 0xff);
- }
-#elif defined(__FreeBSD__)
- /* XXX shouldn't the keys be used? */
- for (i = 0; i < nkeys; i++) {
- c = ibuf[i];
- printf("%c (%d) %s ",
- ((c&0xff) < 32 || (c&0xff) > 126? '.':(c&0xff)), c,
- (c&RELEASE? "released":"pressed"));
- if (ud->modifiers)
- printf("mod = 0x%04x ", ud->modifiers);
- for (i = 0; i < NKEYCODE; i++)
- if (ud->keycode[i])
- printf("%d ", ud->keycode[i]);
- printf("\n");
- }
-#endif
-}
-
-void
-ukbd_set_leds(v, leds)
- void *v;
- int leds;
-{
- struct ukbd_softc *sc = v;
- u_int8_t res;
-
- DPRINTF(("ukbd_set_leds: sc=%p leds=%d\n", sc, leds));
-
- sc->sc_leds = leds;
-#if defined(__NetBSD__)
- res = 0;
- if (leds & WSKBD_LED_SCROLL)
- res |= SCROLL_LOCK;
- if (leds & WSKBD_LED_NUM)
- res |= NUM_LOCK;
- if (leds & WSKBD_LED_CAPS)
- res |= CAPS_LOCK;
-#elif defined(__FreeBSD__)
- res = leds;
-#endif
- usbd_set_report_async(sc->sc_iface, UHID_OUTPUT_REPORT, 0, &res, 1);
-}
-
-#if defined(__NetBSD__)
-
-#ifdef WSDISPLAY_COMPAT_RAWKBD
-void
-ukbd_rawrepeat(v)
- void *v;
-{
- struct ukbd_softc *sc = v;
-
- wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep);
- timeout(ukbd_rawrepeat, sc, hz * REP_DELAYN / 1000);
-}
-#endif
-
-int
-ukbd_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct ukbd_softc *sc = v;
-
- switch (cmd) {
- case WSKBDIO_GTYPE:
- *(int *)data = WSKBD_TYPE_USB;
- return (0);
- case WSKBDIO_SETLEDS:
- ukbd_set_leds(v, *(int *)data);
- return (0);
- case WSKBDIO_GETLEDS:
- *(int *)data = sc->sc_leds;
- return (0);
-#ifdef WSDISPLAY_COMPAT_RAWKBD
- case WSKBDIO_SETMODE:
- DPRINTF(("ukbd_ioctl: set raw = %d\n", *(int *)data));
- sc->sc_rawkbd = *(int *)data == WSKBD_RAW;
- untimeout(ukbd_rawrepeat, sc);
- return (0);
-#endif
- }
- return (-1);
-}
-
-/* Console interface. */
-void
-ukbd_cngetc(v, type, data)
- void *v;
- u_int *type;
- int *data;
-{
- struct ukbd_softc *sc = v;
- usbd_lock_token s;
- int c;
-
- DPRINTFN(1,("ukbd_cngetc: enter\n"));
- s = usbd_lock();
- sc->sc_polling = 1;
- sc->sc_pollchar = -1;
- while(sc->sc_pollchar == -1)
- usbd_dopoll(sc->sc_iface);
- sc->sc_polling = 0;
- c = sc->sc_pollchar;
- *type = c & RELEASE ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
- *data = c & 0xff;
- usbd_unlock(s);
- DPRINTFN(1,("ukbd_cngetc: return 0x%02x\n", c));
-}
-
-void
-ukbd_cnpollc(v, on)
- void *v;
- int on;
-{
- struct ukbd_softc *sc = v;
-
- DPRINTFN(2,("ukbd_cnpollc: sc=%p on=%d\n", v, on));
-
- usbd_set_polling(sc->sc_iface, on);
-}
-
-int
-ukbd_cnattach(v)
- void *v;
-{
- struct ukbd_softc *sc = v;
-
- DPRINTF(("ukbd_cnattach: sc=%p\n", sc));
- wskbd_cnattach(&ukbd_consops, sc, &ukbd_keymapdata);
- return (0);
-}
-
-#endif /* NetBSD */
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(ukbd, uhub, ukbd_driver, ukbd_devclass, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
deleted file mode 100644
index 074fe04893335..0000000000000
--- a/sys/dev/usb/ulpt.c
+++ /dev/null
@@ -1,451 +0,0 @@
-/* $NetBSD: ulpt.c,v 1.10 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/syslog.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#define TIMEOUT hz*16 /* wait up to 16 seconds for a ready */
-#define STEP hz/4
-
-#define LPTPRI (PZERO+8)
-#define ULPT_BSIZE 1024
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (ulptdebug) printf x
-#define DPRINTFN(n,x) if (ulptdebug>(n)) printf x
-int ulptdebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define UR_GET_DEVICE_ID 0
-#define UR_GET_PORT_STATUS 1
-#define UR_SOFT_RESET 2
-
-#define LPS_NERR 0x08 /* printer no error */
-#define LPS_SELECT 0x10 /* printer selected */
-#define LPS_NOPAPER 0x20 /* printer out of paper */
-#define LPS_INVERT (LPS_SELECT|LPS_NERR)
-#define LPS_MASK (LPS_SELECT|LPS_NERR|LPS_NOPAPER)
-
-struct ulpt_softc {
- bdevice sc_dev;
- usbd_device_handle sc_udev; /* device */
- usbd_interface_handle sc_iface; /* interface */
- int sc_ifaceno;
- usbd_pipe_handle sc_bulkpipe; /* bulk pipe */
- int sc_bulk;
-
- u_char sc_state;
-#define ULPT_OPEN 0x01 /* device is open */
-#define ULPT_OBUSY 0x02 /* printer is busy doing output */
-#define ULPT_INIT 0x04 /* waiting to initialize for open */
- u_char sc_flags;
-#if defined(__NetBSD__)
-#define ULPT_NOPRIME 0x40 /* don't prime on open */
-#elif defined(__FreeBSD__)
-/* values taken from i386/isa/lpt.c */
-#define ULPT_POS_INIT 0x04 /* if we are a postive init signal */
-#define ULPT_POS_ACK 0x08 /* if we are a positive going ack */
-#define ULPT_NOPRIME 0x10 /* don't prime the printer at all */
-#define ULPT_PRIMEOPEN 0x20 /* prime on every open */
-#define ULPT_AUTOLF 0x40 /* tell printer to do an automatic lf */
-#define ULPT_BYPASS 0x80 /* bypass printer ready checks */
-#endif
- u_char sc_laststatus;
-};
-
-#if defined(__NetBSD__)
-int ulptopen __P((dev_t, int, int, struct proc *));
-int ulptclose __P((dev_t, int, int, struct proc *p));
-int ulptwrite __P((dev_t, struct uio *uio, int));
-int ulptioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-#elif defined(__FreeBSD__)
-static d_open_t ulptopen;
-static d_close_t ulptclose;
-static d_write_t ulptwrite;
-static d_ioctl_t ulptioctl;
-
-#define ULPT_CDEV_MAJOR 113
-
-static struct cdevsw ulpt_cdevsw = {
- ulptopen, ulptclose, noread, ulptwrite,
- ulptioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, nostrat,
- "ulpt", NULL, -1
-};
-#endif
-
-int ulpt_status __P((struct ulpt_softc *));
-void ulpt_reset __P((struct ulpt_softc *));
-int ulpt_statusmsg __P((u_char, struct ulpt_softc *));
-
-#if defined(__NetBSD__)
-#define ULPTUNIT(s) (minor(s) & 0x1f)
-#define ULPTFLAGS(s) (minor(s) & 0xe0)
-#elif defined(__FreeBSD__)
-/* defines taken from i386/isa/lpt.c */
-#define ULPTUNIT(s) (minor(s) & 0x03)
-#define ULPTFLAGS(s) (minor(s) & 0xfc)
-#endif
-
-USB_DECLARE_DRIVER(ulpt);
-
-USB_MATCH(ulpt)
-{
- USB_MATCH_START(ulpt, uaa);
- usb_interface_descriptor_t *id;
-
- DPRINTFN(10,("ulpt_match\n"));
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (id &&
- id->bInterfaceClass == UCLASS_PRINTER &&
- id->bInterfaceSubClass == USUBCLASS_PRINTER &&
- (id->bInterfaceProtocol == UPROTO_PRINTER_UNI ||
- id->bInterfaceProtocol == UPROTO_PRINTER_BI))
- return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
- return (UMATCH_NONE);
-}
-
-USB_ATTACH(ulpt)
-{
- USB_ATTACH_START(ulpt, sc, uaa);
- usbd_device_handle dev = uaa->device;
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id = usbd_get_interface_descriptor(iface);
-#if 0
- usb_config_descriptor_t *cd = usbd_get_config_descriptor(dev);
- usb_device_request_t req;
-#endif
- char devinfo[1024];
- usb_endpoint_descriptor_t *ed;
- usbd_status r;
-
- DPRINTFN(10,("ulpt_attach: sc=%p\n", sc));
- usbd_devinfo(dev, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- /* Figure out which endpoint is the bulk out endpoint. */
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed)
- goto nobulk;
- if ((ed->bEndpointAddress & UE_IN) != UE_OUT ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_BULK) {
- /* In case we are using a bidir protocol... */
- ed = usbd_interface2endpoint_descriptor(iface, 1);
- if (!ed)
- goto nobulk;
- if ((ed->bEndpointAddress & UE_IN) != UE_OUT ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_BULK)
- goto nobulk;
- }
- sc->sc_bulk = ed->bEndpointAddress;
- DPRINTFN(10, ("ulpt_attach: bulk=%d\n", sc->sc_bulk));
-
- sc->sc_iface = iface;
- r = usbd_interface2device_handle(iface, &sc->sc_udev);
- if (r != USBD_NORMAL_COMPLETION)
- USB_ATTACH_ERROR_RETURN;
- sc->sc_ifaceno = id->bInterfaceNumber;
-
-#if 0
-XXX needs a different way to read the id string since the length
-is unknown. usbd_do_request() returns error on a short transfer.
- req.bmRequestType = UT_READ_CLASS_INTERFACE;
- req.bRequest = UR_GET_DEVICE_ID;
- USETW(req.wValue, cd->bConfigurationValue);
- USETW2(req.wIndex, id->bInterfaceNumber, id->bAlternateSetting);
- USETW(req.wLength, sizeof devinfo - 1);
- r = usbd_do_request(dev, &req, devinfo);
- if (r == USBD_NORMAL_COMPLETION) {
- int len;
- char *idstr;
- len = (devinfo[0] << 8) | (devinfo[1] & 0xff);
- /* devinfo now contains an IEEE-1284 device ID */
- idstr = devinfo+2;
- idstr[len] = 0;
- printf("%s: device id <%s>\n", USBDEVNAME(sc->sc_dev), idstr);
- } else {
- printf("%s: cannot get device id\n", USBDEVNAME(sc->sc_dev));
- }
-#endif
-
- USB_ATTACH_SUCCESS_RETURN;
-
- nobulk:
- printf("%s: could not find bulk endpoint\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
-}
-
-int
-ulpt_status(sc)
- struct ulpt_softc *sc;
-{
- usb_device_request_t req;
- usbd_status r;
- u_char status;
-
- req.bmRequestType = UT_READ_CLASS_INTERFACE;
- req.bRequest = UR_GET_PORT_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, sc->sc_ifaceno);
- USETW(req.wLength, 1);
- r = usbd_do_request(sc->sc_udev, &req, &status);
- DPRINTFN(1, ("ulpt_status: status=0x%02x r=%d\n", status, r));
- if (r == USBD_NORMAL_COMPLETION)
- return (status);
- else
- return (0);
-}
-
-void
-ulpt_reset(sc)
- struct ulpt_softc *sc;
-{
- usb_device_request_t req;
-
- DPRINTFN(1, ("ulpt_reset\n"));
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_SOFT_RESET;
- USETW(req.wValue, 0);
- USETW(req.wIndex, sc->sc_ifaceno);
- USETW(req.wLength, 0);
- (void)usbd_do_request(sc->sc_udev, &req, 0);
-}
-
-/*
- * Reset the printer, then wait until it's selected and not busy.
- */
-int
-ulptopen(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- u_char flags = ULPTFLAGS(dev);
- usbd_status r;
- int spin, error;
- USB_GET_SC_OPEN(ulpt, ULPTUNIT(dev), sc);
-
- if (!sc || !sc->sc_iface)
- return ENXIO;
-
- if (sc->sc_state)
- return EBUSY;
-
- sc->sc_state = ULPT_INIT;
- sc->sc_flags = flags;
- DPRINTF(("ulptopen: flags=0x%x\n", (unsigned)flags));
-
-#if USB_DEBUG && defined(__FreeBSD__)
- /* Ignoring these flags might not be a good idea */
- if ((flags ^ ULPT_NOPRIME) != 0)
- DPRINTF(("flags ignored: %b\n", flags,
- "\20\3POS_INIT\4POS_ACK\6PRIME_OPEN\7AUTOLF\10BYPASS"));
-#endif
- if ((flags & ULPT_NOPRIME) == 0)
- ulpt_reset(sc);
-
- for (spin = 0; (ulpt_status(sc) & LPS_SELECT) == 0; spin += STEP) {
- if (spin >= TIMEOUT) {
- sc->sc_state = 0;
- return EBUSY;
- }
-
- /* wait 1/4 second, give up if we get a signal */
- error = tsleep((caddr_t)sc, LPTPRI | PCATCH, "ulptop", STEP);
- if (error != EWOULDBLOCK) {
- sc->sc_state = 0;
- return error;
- }
- }
-
- r = usbd_open_pipe(sc->sc_iface, sc->sc_bulk, 0, &sc->sc_bulkpipe);
- if (r != USBD_NORMAL_COMPLETION) {
- sc->sc_state = 0;
- return (EIO);
- }
-
- sc->sc_state = ULPT_OPEN;
-
- DPRINTF(("ulptopen: done\n"));
- return (0);
-}
-
-int
-ulpt_statusmsg(status, sc)
- u_char status;
- struct ulpt_softc *sc;
-{
- u_char new;
-
- status = (status ^ LPS_INVERT) & LPS_MASK;
- new = status & ~sc->sc_laststatus;
- sc->sc_laststatus = status;
-
- if (new & LPS_SELECT)
- log(LOG_NOTICE, "%s: offline\n", USBDEVNAME(sc->sc_dev));
- else if (new & LPS_NOPAPER)
- log(LOG_NOTICE, "%s: out of paper\n", USBDEVNAME(sc->sc_dev));
- else if (new & LPS_NERR)
- log(LOG_NOTICE, "%s: output error\n", USBDEVNAME(sc->sc_dev));
-
- return status;
-}
-
-int
-ulptclose(dev, flag, mode, p)
- dev_t dev;
- int flag;
- int mode;
- struct proc *p;
-{
- USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
-
- usbd_close_pipe(sc->sc_bulkpipe);
-
- sc->sc_state = 0;
-
- DPRINTF(("ulptclose: closed\n"));
- return (0);
-}
-
-int
-ulptwrite(dev, uio, flags)
- dev_t dev;
- struct uio *uio;
- int flags;
-{
- size_t n;
- int error = 0;
- char buf[ULPT_BSIZE];
- usbd_request_handle reqh;
- usbd_status r;
- USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
-
- DPRINTF(("ulptwrite\n"));
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (ENOMEM);
- while ((n = min(ULPT_BSIZE, uio->uio_resid)) != 0) {
- ulpt_statusmsg(ulpt_status(sc), sc);
- error = uiomove(buf, n, uio);
- if (error)
- break;
- /* XXX use callback to enable interrupt? */
- r = usbd_setup_request(reqh, sc->sc_bulkpipe, 0, buf, n,
- 0, USBD_NO_TIMEOUT, 0);
- if (r != USBD_NORMAL_COMPLETION) {
- error = EIO;
- break;
- }
- DPRINTFN(1, ("ulptwrite: transfer %d bytes\n", n));
- r = usbd_sync_transfer(reqh);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ulptwrite: error=%d\n", r));
- usbd_clear_endpoint_stall(sc->sc_bulkpipe);
- error = EIO;
- break;
- }
- }
- usbd_free_request(reqh);
- return (error);
-}
-
-int
-ulptioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- int error = 0;
-
- switch (cmd) {
- default:
- error = ENODEV;
- }
-
- return error;
-}
-
-#if defined(__FreeBSD__)
-static int
-ulpt_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- return 0;
-}
-
-CDEV_DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass,
- ULPT_CDEV_MAJOR, ulpt_cdevsw, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
deleted file mode 100644
index 16bfae25ae168..0000000000000
--- a/sys/dev/usb/umodem.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* $NetBSD: umodem.c,v 1.5 1999/01/08 11:58:25 augustss Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/device.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbcdc.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (umodemdebug) printf x
-#define DPRINTFN(n,x) if (umodemdebug>(n)) printf x
-int umodemdebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-struct umodem_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_ctl; /* control interface */
- usbd_interface_handle sc_data; /* data interface */
- uByte cmCaps;
- uByte acmCaps;
-};
-
-void umodem_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void umodem_disco __P((void *));
-
-USB_DECLARE_DRIVER(umodem);
-
-USB_MATCH(umodem)
-{
- USB_MATCH_START(umodem, uaa);
-
- usb_interface_descriptor_t *id;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id ||
- id->bInterfaceClass != UCLASS_CDC ||
- id->bInterfaceSubClass != USUBCLASS_ABSTRACT_CONTROL_MODEL ||
- id->bInterfaceProtocol != UPROTO_CDC_AT)
- return (UMATCH_NONE);
- return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
-}
-
-USB_ATTACH(umodem)
-{
- USB_ATTACH_START(umodem, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- char devinfo[1024];
-
- sc->sc_ctl = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__FreeBSD__)
-static int
-umodem_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
-
- return 0;
-}
-#endif
-
-#if defined(__FreeBSD__)
-DRIVER_MODULE(umodem, uhub, umodem_driver, umodem_devclass, usbd_driver_load,0);
-#endif
-
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
deleted file mode 100644
index e92d027ec0db3..0000000000000
--- a/sys/dev/usb/ums.c
+++ /dev/null
@@ -1,720 +0,0 @@
-/* $NetBSD: ums.c,v 1.19 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/conf.h>
-#endif
-#include <sys/tty.h>
-#include <sys/file.h>
-#include <sys/select.h>
-#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/poll.h>
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-#include <dev/usb/hid.h>
-
-#if defined(__NetBSD__)
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wsmousevar.h>
-#elif defined(__FreeBSD__)
-#include <machine/mouse.h>
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (umsdebug) printf x
-#define DPRINTFN(n,x) if (umsdebug>(n)) printf x
-int umsdebug = 6;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define UMSUNIT(s) (minor(s)&0x1f)
-
-#define PS2LBUTMASK x01
-#define PS2RBUTMASK x02
-#define PS2MBUTMASK x04
-#define PS2BUTMASK 0x0f
-
-#define QUEUE_BUFSIZE 240 /* MUST be divisible by 3 _and_ 4 */
-
-struct ums_softc {
- bdevice sc_dev; /* base device */
- usbd_interface_handle sc_iface; /* interface */
- usbd_pipe_handle sc_intrpipe; /* interrupt pipe */
- int sc_ep_addr;
-
- u_char *sc_ibuf;
- u_int8_t sc_iid;
- int sc_isize;
- struct hid_location sc_loc_x, sc_loc_y, sc_loc_z;
- struct hid_location *sc_loc_btn;
-
- int sc_enabled;
- int sc_disconnected; /* device is gone */
-
- int flags; /* device configuration */
-#define UMS_Z 0x01 /* z direction available */
- int nbuttons;
-#define MAX_BUTTONS 7 /* chosen because sc_buttons is u_char */
-
-#if defined(__NetBSD__)
- u_char sc_buttons; /* mouse button status */
- struct device *sc_wsmousedev;
-#elif defined(__FreeBSD__)
- u_char qbuf[QUEUE_BUFSIZE]; /* must be divisable by 3&4 */
- u_char dummy[100]; /* XXX just for safety and for now */
- int qcount, qhead, qtail;
- mousehw_t hw;
- mousemode_t mode;
- mousestatus_t status;
-
- int state;
-# define UMS_ASLEEP 0x01 /* readFromDevice is waiting */
-# define UMS_SELECT 0x02 /* select is waiting */
- struct selinfo rsel; /* process waiting in select */
-#endif
-};
-
-#define MOUSE_FLAGS_MASK (HIO_CONST|HIO_RELATIVE)
-#define MOUSE_FLAGS (HIO_RELATIVE)
-
-void ums_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
-void ums_disco __P((void *));
-
-static int ums_enable __P((void *));
-static void ums_disable __P((void *));
-
-#if defined(__NetBSD__)
-static int ums_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
-
-const struct wsmouse_accessops ums_accessops = {
- ums_enable,
- ums_ioctl,
- ums_disable,
-};
-
-#elif defined(__FreeBSD__)
-static d_open_t ums_open;
-static d_close_t ums_close;
-static d_read_t ums_read;
-static d_ioctl_t ums_ioctl;
-static d_poll_t ums_poll;
-
-#define UMS_CDEV_MAJOR 111
-
-static struct cdevsw ums_cdevsw = {
- ums_open, ums_close, ums_read, nowrite,
- ums_ioctl, nostop, nullreset, nodevtotty,
- ums_poll, nommap, nostrat,
- "ums", NULL, -1
-};
-#endif
-
-USB_DECLARE_DRIVER(ums);
-
-USB_MATCH(ums)
-{
- USB_MATCH_START(ums, uaa);
- usb_interface_descriptor_t *id;
- int size, ret;
- void *desc;
- usbd_status r;
-
- if (!uaa->iface)
- return (UMATCH_NONE);
- id = usbd_get_interface_descriptor(uaa->iface);
- if (!id || id->bInterfaceClass != UCLASS_HID)
- return (UMATCH_NONE);
-
- r = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_TEMP);
- if (r != USBD_NORMAL_COMPLETION)
- return (UMATCH_NONE);
-
- if (hid_is_collection(desc, size,
- HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
- ret = UMATCH_IFACECLASS;
- else
- ret = UMATCH_NONE;
-
- free(desc, M_TEMP);
- return (ret);
-}
-
-USB_ATTACH(ums)
-{
- USB_ATTACH_START(ums, sc, uaa);
- usbd_interface_handle iface = uaa->iface;
- usb_interface_descriptor_t *id;
- usb_endpoint_descriptor_t *ed;
-#if defined(__NetBSD__)
- struct wsmousedev_attach_args a;
-#endif
- int size;
- void *desc;
- usbd_status r;
- char devinfo[1024];
- u_int32_t flags;
- int i;
- struct hid_location loc_btn;
-
- sc->sc_disconnected = 1;
- sc->sc_iface = iface;
- id = usbd_get_interface_descriptor(iface);
- usbd_devinfo(uaa->device, 0, devinfo);
- USB_ATTACH_SETUP;
- printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev),
- devinfo, id->bInterfaceClass, id->bInterfaceSubClass);
- ed = usbd_interface2endpoint_descriptor(iface, 0);
- if (!ed) {
- printf("%s: could not read endpoint descriptor\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- DPRINTFN(10,("ums_attach: bLength=%d bDescriptorType=%d "
- "bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
- " bInterval=%d\n",
- ed->bLength, ed->bDescriptorType,
- ed->bEndpointAddress & UE_ADDR,
- ed->bEndpointAddress & UE_IN ? "in" : "out",
- ed->bmAttributes & UE_XFERTYPE,
- UGETW(ed->wMaxPacketSize), ed->bInterval));
-
- if ((ed->bEndpointAddress & UE_IN) != UE_IN ||
- (ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
- printf("%s: unexpected endpoint\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
-
- r = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_TEMP);
- if (r != USBD_NORMAL_COMPLETION)
- USB_ATTACH_ERROR_RETURN;
-
- if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
- hid_input, &sc->sc_loc_x, &flags)) {
- printf("%s: mouse has no X report\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
- printf("%s: X report 0x%04x not supported\n",
- USBDEVNAME(sc->sc_dev), flags);
- USB_ATTACH_ERROR_RETURN;
- }
-
- if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
- hid_input, &sc->sc_loc_y, &flags)) {
- printf("%s: mouse has no Y report\n", USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
- printf("%s: Y report 0x%04x not supported\n",
- USBDEVNAME(sc->sc_dev), flags);
- USB_ATTACH_ERROR_RETURN;
- }
-
- /* try to guess the Z activator: first check Z, then WHEEL */
- if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Z),
- hid_input, &sc->sc_loc_z, &flags) ||
- hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
- hid_input, &sc->sc_loc_z, &flags)) {
- if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
- sc->sc_loc_z.size = 0; /* Bad Z coord, ignore it */
- } else {
-#if defined(__FreeBSD__)
-#ifdef USBVERBOSE
- printf("%s: Z dir. ignored due to bugs in ums.c\n",
- USBDEVNAME(sc->sc_dev));
-#endif
-#else
- sc->flags |= UMS_Z;
-#endif
- }
- }
-
- /* figure out the number of buttons */
- for (i = 1; i <= MAX_BUTTONS; i++)
- if (!hid_locate(desc, size, HID_USAGE2(HUP_BUTTON, i),
- hid_input, &loc_btn, 0))
- break;
- sc->nbuttons = i - 1;
- sc->sc_loc_btn = malloc(sizeof(struct hid_location)*sc->nbuttons,
- M_USBDEV, M_NOWAIT);
- if (!sc->sc_loc_btn)
- USB_ATTACH_ERROR_RETURN;
-
- printf("%s: %d buttons%s\n", USBDEVNAME(sc->sc_dev),
- sc->nbuttons, (sc->flags & UMS_Z? " and Z dir." : ""));
-
- for (i = 1; i <= sc->nbuttons; i++)
- hid_locate(desc, size, HID_USAGE2(HUP_BUTTON, i),
- hid_input, &sc->sc_loc_btn[i-1], 0);
-
- sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid);
- sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT);
- if (!sc->sc_ibuf) {
- free(sc->sc_loc_btn, M_USB);
- USB_ATTACH_ERROR_RETURN;
- }
-
- sc->sc_ep_addr = ed->bEndpointAddress;
- sc->sc_disconnected = 0;
- free(desc, M_TEMP);
-
-#ifdef USB_DEBUG
- DPRINTF(("ums_attach: sc=%p\n", sc));
- DPRINTF(("ums_attach: X\t%d/%d\n",
- sc->sc_loc_x.pos, sc->sc_loc_x.size));
- DPRINTF(("ums_attach: Y\t%d/%d\n",
- sc->sc_loc_x.pos, sc->sc_loc_x.size));
- if (sc->flags & UMS_Z)
- DPRINTF(("ums_attach: Z\t%d/%d\n",
- sc->sc_loc_z.pos, sc->sc_loc_z.size));
- for (i = 1; i <= sc->nbuttons; i++) {
- DPRINTF(("ums_attach: B%d\t%d/%d\n",
- i, sc->sc_loc_btn[i-1].pos,sc->sc_loc_btn[i-1].size));
- }
- DPRINTF(("ums_attach: size=%d, id=%d\n", sc->sc_isize, sc->sc_iid));
-#endif
-
-#if defined(__NetBSD__)
- a.accessops = &ums_accessops;
- a.accesscookie = sc;
-
- sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
-#elif defined(__FreeBSD__)
- sc->hw.buttons = 2; /* XXX hw&mode values are bogus */
- sc->hw.iftype = MOUSE_IF_PS2;
- sc->hw.type = MOUSE_MOUSE;
- if (sc->flags & UMS_Z)
- sc->hw.model = MOUSE_MODEL_INTELLI;
- else
- sc->hw.model = MOUSE_MODEL_GENERIC;
- sc->hw.hwid = 0;
- sc->mode.protocol = MOUSE_PROTO_PS2;
- sc->mode.rate = -1;
- sc->mode.resolution = MOUSE_RES_DEFAULT;
- sc->mode.accelfactor = 1;
- sc->mode.level = 0;
- if (sc->flags & UMS_Z) {
- sc->mode.packetsize = MOUSE_INTELLI_PACKETSIZE;
- sc->mode.syncmask[0] = 0xc8;
- } else {
- sc->mode.packetsize = MOUSE_PS2_PACKETSIZE;
- sc->mode.syncmask[0] = 0xc0;
- }
- sc->mode.syncmask[1] = 0;
-
- sc->status.flags = 0;
- sc->status.button = sc->status.obutton = 0;
- sc->status.dx = sc->status.dy = sc->status.dz = 0;
-
- sc->rsel.si_flags = 0;
- sc->rsel.si_pid = 0;
-#endif
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-
-#if defined(__FreeBSD__)
-static int
-ums_detach(device_t self)
-{
- struct ums_softc *sc = device_get_softc(self);
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
- free(sc->sc_loc_btn, M_USB);
- free(sc->sc_ibuf, M_USB);
-
- return 0;
-}
-#endif
-
-void
-ums_disco(p)
- void *p;
-{
- struct ums_softc *sc = p;
-
- DPRINTF(("ums_disco: sc=%p\n", sc));
- usbd_abort_pipe(sc->sc_intrpipe);
- sc->sc_disconnected = 1;
-}
-
-void
-ums_intr(reqh, addr, status)
- usbd_request_handle reqh;
- usbd_private_handle addr;
- usbd_status status;
-{
- struct ums_softc *sc = addr;
- u_char *ibuf;
- int dx, dy, dz;
- u_char buttons = 0;
- int i;
-
-#if defined(__NetBSD__)
-#define UMS_BUT(i) ((i) == 1 || (i) == 2 ? 3 - (i) : i)
-#elif defined(__FreeBSD__)
-#define UMS_BUT(i) (i)
-#endif
-
- DPRINTFN(5, ("ums_intr: sc=%p status=%d\n", sc, status));
- DPRINTFN(5, ("ums_intr: data = %02x %02x %02x\n",
- sc->sc_ibuf[0], sc->sc_ibuf[1], sc->sc_ibuf[2]));
-
- if (status == USBD_CANCELLED)
- return;
-
- if (status != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ums_intr: status=%d\n", status));
- usbd_clear_endpoint_stall_async(sc->sc_intrpipe);
- return;
- }
-
- ibuf = sc->sc_ibuf;
- if (sc->sc_iid) {
- if (*ibuf++ != sc->sc_iid)
- return;
- }
-
- dx = hid_get_data(ibuf, &sc->sc_loc_x);
- dy = -hid_get_data(ibuf, &sc->sc_loc_y);
- dz = hid_get_data(ibuf, &sc->sc_loc_z);
- for (i = 0; i < sc->nbuttons; i++)
- if (hid_get_data(ibuf, &sc->sc_loc_btn[i]))
- buttons |= (1 << UMS_BUT(i));
-
-#if defined(__NetBSD__)
- if (dx || dy || buttons != sc->sc_buttons) {
- DPRINTFN(10, ("ums_intr: x:%d y:%d z:%d buttons:0x%x\n",
- dx, dy, dz, buttons));
- sc->sc_buttons = buttons;
- if (sc->sc_wsmousedev)
- wsmouse_input(sc->sc_wsmousedev, buttons, dx, dy, dz);
-#elif defined(__FreeBSD__)
- if (dx || dy || (sc->flags & UMS_Z && dz)
- || buttons != sc->status.button) {
- DPRINTFN(5, ("ums_intr: x:%d y:%d z:%d buttons:0x%x\n",
- dx, dy, dz, buttons));
-
- sc->status.button = buttons;
- sc->status.dx += dx;
- sc->status.dy += dy;
- sc->status.dz += dz;
-
- /* Discard data in case of full buffer */
- if (sc->qcount == sizeof(sc->qbuf)) {
- DPRINTF(("Buffer full, discarded packet"));
- return;
- }
-
- sc->qbuf[sc->qhead] = MOUSE_PS2_SYNC;
- if (dx < 0)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_XNEG;
- if (dx > 255 || dx < -255)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_XOVERFLOW;
- if (dy < 0)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_YNEG;
- if (dy > 255 || dy < -255)
- sc->qbuf[sc->qhead] |= MOUSE_PS2_YOVERFLOW;
- sc->qbuf[sc->qhead++] |= buttons;
- sc->qbuf[sc->qhead++] = dx;
- sc->qbuf[sc->qhead++] = dy;
- sc->qcount += 3;
- if (sc->flags & UMS_Z) {
- sc->qbuf[sc->qhead++] = dz;
- sc->qcount++;
- }
-#ifdef USB_DEBUG
- if (sc->qhead > sizeof(sc->qbuf))
- DPRINTF(("Buffer overrun! %d %d\n",
- sc->qhead, sizeof(sc->qbuf)));
-#endif
- /* wrap round at end of buffer */
- if (sc->qhead >= sizeof(sc->qbuf))
- sc->qhead = 0;
-
- /* someone waiting for data */
- if (sc->state & UMS_ASLEEP) {
- DPRINTF(("Waking up %p\n", sc));
- wakeup(sc);
- }
- if (sc->state & UMS_SELECT) {
- DPRINTF(("Waking up select %p\n", &sc->rsel));
- selwakeup(&sc->rsel);
- }
-#endif
- }
-}
-
-
-static int
-ums_enable(v)
- void *v;
-{
- struct ums_softc *sc = v;
-
- usbd_status r;
-
- if (sc->sc_enabled)
- return EBUSY;
-
- sc->sc_enabled = 1;
-#if defined(__NetBSD__)
- sc->sc_buttons = 0;
-#elif defined(__FreeBSD__)
- sc->qcount = 0;
- sc->qhead = sc->qtail = 0;
- sc->status.flags = 0;
- sc->status.button = sc->status.obutton = 0;
- sc->status.dx = sc->status.dy = sc->status.dz = 0;
-#endif
-
- /* Set up interrupt pipe. */
- r = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
- USBD_SHORT_XFER_OK, &sc->sc_intrpipe, sc,
- sc->sc_ibuf, sc->sc_isize, ums_intr);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("ums_enable: usbd_open_pipe_intr failed, error=%d\n",
- r));
- sc->sc_enabled = 0;
- return (EIO);
- }
- usbd_set_disco(sc->sc_intrpipe, ums_disco, sc);
- return (0);
-}
-
-static void
-ums_disable(v)
- void *v;
-{
- struct ums_softc *sc = v;
-
- /* Disable interrupts. */
- usbd_abort_pipe(sc->sc_intrpipe);
- usbd_close_pipe(sc->sc_intrpipe);
-
- sc->sc_enabled = 0;
-
-#if defined(USBVERBOSE) && defined(__FreeBSD__)
- if (sc->qcount != 0)
- DPRINTF(("Discarded %d bytes in queue\n", sc->qcount));
-#endif
-}
-
-#if defined(__NetBSD__)
-static int
-ums_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-
-{
- switch (cmd) {
- case WSMOUSEIO_GTYPE:
- *(u_int *)data = WSMOUSE_TYPE_USB;
- return (0);
- }
-
- return (-1);
-}
-
-#elif defined(__FreeBSD__)
-static int
-ums_open(dev_t dev, int flag, int fmt, struct proc *p)
-{
- USB_GET_SC_OPEN(ums, UMSUNIT(dev), sc);
-
- return ums_enable(sc);
-}
-
-static int
-ums_close(dev_t dev, int flag, int fmt, struct proc *p)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
-
- if (sc->sc_enabled)
- ums_disable(sc);
-
- return 0;
-}
-
-static int
-ums_read(dev_t dev, struct uio *uio, int flag)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
- int s;
- char buf[sizeof(sc->qbuf)];
- int l = 0;
- int error;
-
- s = splusb();
- while (sc->qcount == 0 ) {
- /* NWH XXX non blocking I/O ??
- if (non blocking I/O ) {
- splx(s);
- return EWOULDBLOCK;
- } else {
- */
- sc->state |= UMS_ASLEEP;
- error = tsleep(sc, PZERO | PCATCH, "umsrea", 0);
- sc->state &= ~UMS_ASLEEP;
- if (error) {
- splx(s);
- return error;
- }
- }
-
- while ((sc->qcount > 0) && (uio->uio_resid > 0)) {
- l = (sc->qcount < uio->uio_resid? sc->qcount:uio->uio_resid);
- if (l > sizeof(buf))
- l = sizeof(buf);
- if (l > sizeof(sc->qbuf) - sc->qtail) /* transfer till end of buf */
- l = sizeof(sc->qbuf) - sc->qtail;
-
- splx(s);
- uiomove(&sc->qbuf[sc->qtail], l, uio);
- s = splusb();
-
- if ( sc->qcount - l < 0 ) {
- DPRINTF(("qcount below 0, count=%d l=%d\n", sc->qcount, l));
- sc->qcount = l;
- }
- sc->qcount -= l; /* remove the bytes from the buffer */
- sc->qtail = (sc->qtail + l) % sizeof(sc->qbuf);
- }
- splx(s);
-
- return 0;
-}
-
-static int
-ums_poll(dev_t dev, int events, struct proc *p)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
- int revents = 0;
- int s;
-
- s = splusb();
- if (events & (POLLIN | POLLRDNORM)) {
- if (sc->qcount) {
- revents = events & (POLLIN | POLLRDNORM);
- } else {
- sc->state |= UMS_SELECT;
- selrecord(p, &sc->rsel);
- sc->state &= ~UMS_SELECT;
- }
- }
- splx(s);
-
- return revents;
-}
-
-int
-ums_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
-{
- USB_GET_SC(ums, UMSUNIT(dev), sc);
- int error = 0;
- int s;
-
- switch(cmd) {
- case MOUSE_GETHWINFO:
- *(mousehw_t *)addr = sc->hw;
- break;
- case MOUSE_GETMODE:
- *(mousemode_t *)addr = sc->mode;
- break;
- case MOUSE_GETLEVEL:
- *(int *)addr = sc->mode.level;
- break;
- case MOUSE_GETSTATUS: {
- mousestatus_t *status = (mousestatus_t *) addr;
-
- s = splusb();
- *status = sc->status;
- sc->status.obutton = sc->status.button;
- sc->status.button = 0;
- sc->status.dx = sc->status.dy = sc->status.dz = 0;
- splx(s);
-
- if (status->dx || status->dy || status->dz)
- status->flags |= MOUSE_POSCHANGED;
- if (status->button != status->obutton)
- status->flags |= MOUSE_BUTTONSCHANGED;
- break;
- }
- default:
- error = ENOTTY;
- }
-
- return error;
-}
-#endif
-
-#if defined(__FreeBSD__)
-CDEV_DRIVER_MODULE(ums, uhub, ums_driver, ums_devclass,
- UMS_CDEV_MAJOR, ums_cdevsw, usbd_driver_load, 0);
-#endif
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
deleted file mode 100644
index 70c75166b2662..0000000000000
--- a/sys/dev/usb/usb.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/* $NetBSD: usb.c,v 1.11 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * USB specifications and other documentation can be found at
- * http://www.usb.org/developers/data/ and
- * http://www.usb.org/developers/index.html .
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/ioccom.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#endif
-#include <sys/poll.h>
-#include <sys/proc.h>
-#include <sys/select.h>
-
-#include <dev/usb/usb.h>
-
-#if defined(__FreeBSD__)
-MALLOC_DEFINE(M_USB, "USB", "USB");
-MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device");
-
-#include "usb_if.h"
-#endif /* defined(__FreeBSD__) */
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-int usbdebug = 1;
-int uhcidebug = 1;
-int ohcidebug = 1;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-#define USBUNIT(dev) (minor(dev))
-
-struct usb_softc {
- bdevice sc_dev; /* base device */
- usbd_bus_handle sc_bus; /* USB controller */
- struct usbd_port sc_port; /* dummy port for root hub */
- char sc_running;
- char sc_exploring;
- struct selinfo sc_consel; /* waiting for connect change */
-};
-
-#if defined(__NetBSD__)
-int usbopen __P((dev_t, int, int, struct proc *));
-int usbclose __P((dev_t, int, int, struct proc *));
-int usbioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-int usbpoll __P((dev_t, int, struct proc *));
-
-#elif defined(__FreeBSD__)
-d_open_t usbopen;
-d_close_t usbclose;
-d_ioctl_t usbioctl;
-int usbpoll __P((dev_t, int, struct proc *));
-
-struct cdevsw usb_cdevsw = {
- usbopen, usbclose, noread, nowrite,
- usbioctl, nullstop, nullreset, nodevtotty,
- usbpoll, nommap, nostrat,
- "usb", NULL, -1
-};
-#endif
-
-usbd_status usb_discover __P((struct usb_softc *));
-
-USB_DECLARE_DRIVER_INIT(usb, DEVMETHOD(bus_print_child, usbd_print_child));
-
-USB_MATCH(usb)
-{
- DPRINTF(("usbd_match\n"));
- return (UMATCH_GENERIC);
-}
-
-USB_ATTACH(usb)
-{
-#if defined(__NetBSD__)
- struct usb_softc *sc = (struct usb_softc *)self;
-#elif defined(__FreeBSD__)
- struct usb_softc *sc = device_get_softc(self);
- void *aux = device_get_ivars(self);
-#endif
- usbd_device_handle dev;
- usbd_status r;
-
-#if defined(__NetBSD__)
- printf("\n");
-#elif defined(__FreeBSD__)
- sc->sc_dev = self;
-#endif
-
- DPRINTF(("usbd_attach\n"));
- usbd_init();
- sc->sc_bus = aux;
- sc->sc_bus->usbctl = sc;
- sc->sc_running = 1;
- sc->sc_bus->use_polling = 1;
- sc->sc_port.power = USB_MAX_POWER;
- r = usbd_new_device(&sc->sc_dev, sc->sc_bus, 0, 0, 0, &sc->sc_port);
-
- if (r == USBD_NORMAL_COMPLETION) {
- dev = sc->sc_port.device;
- if (!dev->hub) {
- sc->sc_running = 0;
- printf("%s: root device is not a hub\n",
- USBDEVNAME(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
- }
- sc->sc_bus->root_hub = dev;
- dev->hub->explore(sc->sc_bus->root_hub);
- } else {
- printf("%s: root hub problem, error=%d\n",
- USBDEVNAME(sc->sc_dev), r);
- sc->sc_running = 0;
- }
- sc->sc_bus->use_polling = 0;
-
- USB_ATTACH_SUCCESS_RETURN;
-}
-
-#if defined(__NetBSD__)
-int
-usbctlprint(aux, pnp)
- void *aux;
- const char *pnp;
-{
- /* only "usb"es can attach to host controllers */
- if (pnp)
- printf("usb at %s", pnp);
-
- return (UNCONF);
-}
-#endif
-
-int
-usbopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- USB_GET_SC_OPEN(usb, USBUNIT(dev), sc);
-
- if (sc == 0 || !sc->sc_running)
- return (ENXIO);
-
- return (0);
-}
-
-int
-usbclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- return (0);
-}
-
-int
-usbioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- USB_GET_SC(usb, USBUNIT(dev), sc);
-
- if (sc == 0 || !sc->sc_running)
- return (ENXIO);
- switch (cmd) {
-#ifdef USB_DEBUG
- case USB_SETDEBUG:
- usbdebug = uhcidebug = ohcidebug = *(int *)data;
- break;
-#endif
- case USB_DISCOVER:
- usb_discover(sc);
- break;
- case USB_REQUEST:
- {
- struct usb_ctl_request *ur = (void *)data;
- int len = UGETW(ur->request.wLength);
- struct iovec iov;
- struct uio uio;
- void *ptr = 0;
- int addr = ur->addr;
- usbd_status r;
- int error = 0;
-
- DPRINTF(("usbioctl: USB_REQUEST addr=%d len=%d\n", addr, len));
- if (len < 0 || len > 32768)
- return (EINVAL);
- if (addr < 0 || addr >= USB_MAX_DEVICES ||
- sc->sc_bus->devices[addr] == 0)
- return (EINVAL);
- if (len != 0) {
- iov.iov_base = (caddr_t)ur->data;
- iov.iov_len = len;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_resid = len;
- uio.uio_offset = 0;
- uio.uio_segflg = UIO_USERSPACE;
- uio.uio_rw =
- ur->request.bmRequestType & UT_READ ?
- UIO_READ : UIO_WRITE;
- uio.uio_procp = p;
- ptr = malloc(len, M_TEMP, M_WAITOK);
- if (uio.uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- r = usbd_do_request_flags(sc->sc_bus->devices[addr],
- &ur->request, ptr,
- ur->flags, &ur->actlen);
- if (r) {
- error = EIO;
- goto ret;
- }
- if (len != 0) {
- if (uio.uio_rw == UIO_READ) {
- error = uiomove(ptr, len, &uio);
- if (error)
- goto ret;
- }
- }
- ret:
- if (ptr)
- free(ptr, M_TEMP);
- return (error);
- }
-
- case USB_DEVICEINFO:
- {
- struct usb_device_info *di = (void *)data;
- int addr = di->addr;
- usbd_device_handle dev;
-
- if (addr < 1 || addr >= USB_MAX_DEVICES)
- return (EINVAL);
- dev = sc->sc_bus->devices[addr];
- if (dev == 0)
- return (ENXIO);
- usbd_fill_deviceinfo(dev, di);
- break;
- }
-
- case USB_DEVICESTATS:
- *(struct usb_device_stats *)data = sc->sc_bus->stats;
- break;
-
- default:
- return (ENXIO);
- }
- return (0);
-}
-
-int
-usbpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- int revents, s;
- USB_GET_SC(usb, USBUNIT(dev), sc);
-
- DPRINTFN(2, ("usbpoll: sc=%p events=0x%x\n", sc, events));
- s = splusb();
- revents = 0;
- if (events & (POLLOUT | POLLWRNORM))
- if (sc->sc_bus->needs_explore)
- revents |= events & (POLLOUT | POLLWRNORM);
- DPRINTFN(2, ("usbpoll: revents=0x%x\n", revents));
- if (revents == 0) {
- if (events & (POLLOUT | POLLWRNORM)) {
- DPRINTFN(2, ("usbpoll: selrecord\n"));
- selrecord(p, &sc->sc_consel);
- }
- }
- splx(s);
- return (revents);
-}
-
-#if 0
-int
-usb_bus_count()
-{
- int i, n;
-
- for (i = n = 0; i < usb_cd.cd_ndevs; i++)
- if (usb_cd.cd_devs[i])
- n++;
- return (n);
-}
-#endif
-
-#if defined(__NetBSD__)
-usbd_status
-usb_get_bus_handle(n, h)
- int n;
- usbd_bus_handle *h;
-{
- int i;
-
- for (i = 0; i < usb_cd.cd_ndevs; i++)
- if (usb_cd.cd_devs[i] && n-- == 0) {
- *h = usb_cd.cd_devs[i];
- return (USBD_NORMAL_COMPLETION);
- }
- return (USBD_INVAL);
-}
-#endif
-
-usbd_status
-usb_discover(sc)
- struct usb_softc *sc;
-{
- int s;
-
- /* Explore device tree from the root */
- /* We need mutual exclusion while traversing the device tree. */
- s = splusb();
- while (sc->sc_exploring)
- tsleep(&sc->sc_exploring, PRIBIO, "usbdis", 0);
- sc->sc_exploring = 1;
- sc->sc_bus->needs_explore = 0;
- splx(s);
-
- sc->sc_bus->root_hub->hub->explore(sc->sc_bus->root_hub);
-
- s = splusb();
- sc->sc_exploring = 0;
- wakeup(&sc->sc_exploring);
- splx(s);
- /* XXX should we start over if sc_needsexplore is set again? */
- return (0);
-}
-
-void
-usb_needs_explore(bus)
- usbd_bus_handle bus;
-{
- bus->needs_explore = 1;
- selwakeup(&bus->usbctl->sc_consel);
-}
-
-#if defined(__FreeBSD__)
-int
-usb_detach(device_t self)
-{
- char *devinfo = (char *) device_get_desc(self);
-
- if (devinfo) {
- device_set_desc(self, NULL);
- free(devinfo, M_USB);
- }
-
- return (0);
-}
-
-DRIVER_MODULE(usb, root, usb_driver, usb_devclass, 0, 0);
-#endif
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
deleted file mode 100644
index 17f0f0eeed715..0000000000000
--- a/sys/dev/usb/usb.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/* $NetBSD: usb.h,v 1.17 1999/01/03 01:09:18 augustss Exp $ */
-/* FreeBSD $Id: usb.h,v 1.6 1999/01/07 23:31:37 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef _USB_H_
-#define _USB_H_
-
-#include <sys/types.h>
-#if defined(__NetBSD__)
-#include <sys/ioctl.h>
-#endif
-
-#if defined(__NetBSD__)
-#if defined(_KERNEL)
-#include <dev/usb/usb_port.h>
-#endif /* _KERNEL */
-
-#elif defined(__FreeBSD__)
-#include <sys/malloc.h>
-
-#if defined(KERNEL)
-MALLOC_DECLARE(M_USB);
-MALLOC_DECLARE(M_USBDEV);
-
-#include <dev/usb/usb_port.h>
-#endif /* KERNEL */
-#endif /* __FreeBSD__ */
-
-
-#define USB_MAX_DEVICES 128
-#define USB_START_ADDR 0
-
-#define USB_CONTROL_ENDPOINT 0
-#define USB_MAX_ENDPOINTS 16
-
-#define USB_FRAMES_PER_SECOND 1000
-
-/*
- * The USB records contain some unaligned little-endian word
- * components. The U[SG]ETW macros take care of both the alignment
- * and endian problem and should always be used to access 16 bit
- * values.
- */
-typedef u_int8_t uByte;
-typedef u_int8_t uWord[2];
-#define UGETW(w) ((w)[0] | ((w)[1] << 8))
-#define USETW(w,v) ((w)[0] = (u_int8_t)(v), (w)[1] = (u_int8_t)((v) >> 8))
-#define USETW2(w,h,l) ((w)[0] = (u_int8_t)(l), (w)[1] = (u_int8_t)(h))
-typedef u_int8_t uDWord[4];
-#define UGETDW(w) ((w)[0] | ((w)[1] << 8) | ((w)[2] << 16) | ((w)[3] << 24))
-#define USETDW(w,v) ((w)[0] = (u_int8_t)(v), \
- (w)[1] = (u_int8_t)((v) >> 8), \
- (w)[2] = (u_int8_t)((v) >> 16), \
- (w)[3] = (u_int8_t)((v) >> 24))
-/*
- * On little-endian machines that can handle unanliged accesses
- * (e.g. i386) these macros can be replaced by the following.
- */
-#if 0
-#define UGETW(w) (*(u_int16_t *)(w))
-#define USETW(w,v) (*(u_int16_t *)(w) = (v))
-#endif
-
-typedef struct {
- uByte bmRequestType;
- uByte bRequest;
- uWord wValue;
- uWord wIndex;
- uWord wLength;
-} usb_device_request_t;
-
-#define UT_WRITE 0x00
-#define UT_READ 0x80
-#define UT_STANDARD 0x00
-#define UT_CLASS 0x20
-#define UT_VENDOR 0x40
-#define UT_DEVICE 0x00
-#define UT_INTERFACE 0x01
-#define UT_ENDPOINT 0x02
-#define UT_OTHER 0x03
-
-#define UT_READ_DEVICE (UT_READ | UT_STANDARD | UT_DEVICE)
-#define UT_READ_INTERFACE (UT_READ | UT_STANDARD | UT_INTERFACE)
-#define UT_READ_ENDPOINT (UT_READ | UT_STANDARD | UT_ENDPOINT)
-#define UT_WRITE_DEVICE (UT_WRITE | UT_STANDARD | UT_DEVICE)
-#define UT_WRITE_INTERFACE (UT_WRITE | UT_STANDARD | UT_INTERFACE)
-#define UT_WRITE_ENDPOINT (UT_WRITE | UT_STANDARD | UT_ENDPOINT)
-#define UT_READ_CLASS_DEVICE (UT_READ | UT_CLASS | UT_DEVICE)
-#define UT_READ_CLASS_INTERFACE (UT_READ | UT_CLASS | UT_INTERFACE)
-#define UT_READ_CLASS_OTHER (UT_READ | UT_CLASS | UT_OTHER)
-#define UT_WRITE_CLASS_DEVICE (UT_WRITE | UT_CLASS | UT_DEVICE)
-#define UT_WRITE_CLASS_INTERFACE (UT_WRITE | UT_CLASS | UT_INTERFACE)
-#define UT_WRITE_CLASS_OTHER (UT_WRITE | UT_CLASS | UT_OTHER)
-#define UT_READ_VENDOR_DEVICE (UT_READ | UT_VENDOR | UT_DEVICE)
-#define UT_READ_VENDOR_INTERFACE (UT_READ | UT_VENDOR | UT_INTERFACE)
-#define UT_READ_VENDOR_OTHER (UT_READ | UT_VENDOR | UT_OTHER)
-#define UT_WRITE_VENDOR_DEVICE (UT_WRITE | UT_VENDOR | UT_DEVICE)
-#define UT_WRITE_VENDOR_INTERFACE (UT_WRITE | UT_VENDOR | UT_INTERFACE)
-#define UT_WRITE_VENDOR_OTHER (UT_WRITE | UT_VENDOR | UT_OTHER)
-
-/* Requests */
-#define UR_GET_STATUS 0x00
-#define UR_CLEAR_FEATURE 0x01
-#define UR_SET_FEATURE 0x03
-#define UR_SET_ADDRESS 0x05
-#define UR_GET_DESCRIPTOR 0x06
-#define UDESC_DEVICE 1
-#define UDESC_CONFIG 2
-#define UDESC_STRING 3
-#define UDESC_INTERFACE 4
-#define UDESC_ENDPOINT 5
-#define UR_SET_DESCRIPTOR 0x07
-#define UR_GET_CONFIG 0x08
-#define UR_SET_CONFIG 0x09
-#define UR_GET_INTERFACE 0x0a
-#define UR_SET_INTERFACE 0x0b
-#define UR_SYNCH_FRAME 0x0c
-
-/* Feature numbers */
-#define UF_ENDPOINT_HALT 0
-#define UF_DEVICE_REMOTE_WAKEUP 1
-
-#define USB_MAX_IPACKET 8 /* maximum size of the initial packet */
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
-} usb_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uWord bcdUSB;
- uByte bDeviceClass;
- uByte bDeviceSubClass;
- uByte bDeviceProtocol;
- uByte bMaxPacketSize;
- /* The fields below are not part of the initial descriptor. */
- uWord idVendor;
- uWord idProduct;
- uWord bcdDevice;
- uByte iManufacturer;
- uByte iProduct;
- uByte iSerialNumber;
- uByte bNumConfigurations;
-} usb_device_descriptor_t;
-#define USB_DEVICE_DESCRIPTOR_SIZE 18
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uWord wTotalLength;
- uByte bNumInterface;
- uByte bConfigurationValue;
- uByte iConfiguration;
- uByte bmAttributes;
-#define UC_BUS_POWERED 0x80
-#define UC_SELF_POWERED 0x40
-#define UC_REMOTE_WAKEUP 0x20
- uByte bMaxPower; /* max current in 2 mA units */
-#define UC_POWER_FACTOR 2
-} usb_config_descriptor_t;
-#define USB_CONFIG_DESCRIPTOR_SIZE 9
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bInterfaceNumber;
- uByte bAlternateSetting;
- uByte bNumEndpoints;
- uByte bInterfaceClass;
- uByte bInterfaceSubClass;
- uByte bInterfaceProtocol;
- uByte iInterface;
-} usb_interface_descriptor_t;
-#define USB_INTERFACE_DESCRIPTOR_SIZE 9
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bEndpointAddress;
-#define UE_IN 0x80
-#define UE_OUT 0x00
-#define UE_ADDR 0x0f
-#define UE_GET_ADDR(a) ((a) & UE_ADDR)
-#define UE_GET_IN(a) (((a) >> 7) & 1)
- uByte bmAttributes;
-#define UE_XFERTYPE 0x03
-#define UE_CONTROL 0x00
-#define UE_ISOCHRONOUS 0x01
-#define UE_BULK 0x02
-#define UE_INTERRUPT 0x03
-#define UE_ISO_TYPE 0x0c
-#define UE_ISO_ASYNC 0x04
-#define UE_ISO_ADAPT 0x08
-#define UE_ISO_SYNC 0x0c
- uWord wMaxPacketSize;
- uByte bInterval;
-} usb_endpoint_descriptor_t;
-#define USB_ENDPOINT_DESCRIPTOR_SIZE 7
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uWord bString[127];
-} usb_string_descriptor_t;
-#define USB_MAX_STRING_LEN 128
-#define USB_LANGUAGE_TABLE 0 /* # of the string language id table */
-
-/* Hub specific request */
-#define UR_GET_BUS_STATE 0x02
-
-/* Hub features */
-#define UHF_C_HUB_LOCAL_POWER 0
-#define UHF_C_HUB_OVER_CURRENT 1
-#define UHF_PORT_CONNECTION 0
-#define UHF_PORT_ENABLE 1
-#define UHF_PORT_SUSPEND 2
-#define UHF_PORT_OVER_CURRENT 3
-#define UHF_PORT_RESET 4
-#define UHF_PORT_POWER 8
-#define UHF_PORT_LOW_SPEED 9
-#define UHF_C_PORT_CONNECTION 16
-#define UHF_C_PORT_ENABLE 17
-#define UHF_C_PORT_SUSPEND 18
-#define UHF_C_PORT_OVER_CURRENT 19
-#define UHF_C_PORT_RESET 20
-
-typedef struct {
- uByte bDescLength;
- uByte bDescriptorType;
- uByte bNbrPorts;
- uWord wHubCharacteristics;
-#define UHD_PWR 0x03
-#define UHD_PWR_GANGED 0x00
-#define UHD_PWR_INDIVIDUAL 0x01
-#define UHD_PWR_NO_SWITCH 0x02
-#define UHD_COMPOUND 0x04
-#define UHD_OC 0x18
-#define UHD_OC_GLOBAL 0x00
-#define UHD_OC_INDIVIDUAL 0x08
-#define UHD_OC_NONE 0x10
- uByte bPwrOn2PwrGood; /* delay in 2 ms units */
-#define UHD_PWRON_FACTOR 2
- uByte bHubContrCurrent;
- uByte DeviceRemovable[32]; /* max 255 ports */
-#define UHD_NOT_REMOV(desc, i) \
- (((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1)
- /* deprecated uByte PortPowerCtrlMask[]; */
-} usb_hub_descriptor_t;
-#define USB_HUB_DESCRIPTOR_SIZE 8
-
-typedef struct {
- uWord wStatus;
-/* Device status flags */
-#define UDS_SELF_POWERED 0x0001
-#define UDS_REMOTE_WAKEUP 0x0002
-/* Endpoint status flags */
-#define UES_HALT 0x0001
-} usb_status_t;
-
-typedef struct {
- uWord wHubStatus;
-#define UHS_LOCAL_POWER 0x0001
-#define UHS_OVER_CURRENT 0x0002
- uWord wHubChange;
-} usb_hub_status_t;
-
-typedef struct {
- uWord wPortStatus;
-#define UPS_CURRENT_CONNECT_STATUS 0x0001
-#define UPS_PORT_ENABLED 0x0002
-#define UPS_SUSPEND 0x0004
-#define UPS_OVERCURRENT_INDICATOR 0x0008
-#define UPS_RESET 0x0010
-#define UPS_PORT_POWER 0x0100
-#define UPS_LOW_SPEED 0x0200
- uWord wPortChange;
-#define UPS_C_CONNECT_STATUS 0x0001
-#define UPS_C_PORT_ENABLED 0x0002
-#define UPS_C_SUSPEND 0x0004
-#define UPS_C_OVERCURRENT_INDICATOR 0x0008
-#define UPS_C_PORT_RESET 0x0010
-} usb_port_status_t;
-
-#define UDESC_CS_DEVICE 0x21
-#define UDESC_CS_CONFIG 0x22
-#define UDESC_CS_STRING 0x23
-#define UDESC_CS_INTERFACE 0x24
-#define UDESC_CS_ENDPOINT 0x25
-
-#define UDESC_HUB 0x29
-
-#define UCLASS_UNSPEC 0
-#define UCLASS_AUDIO 1
-#define USUBCLASS_AUDIOCONTROL 1
-#define USUBCLASS_AUDIOSTREAM 2
-#define UCLASS_CDC 2 /* communication */
-#define USUBCLASS_ABSTRACT_CONTROL_MODEL 2
-#define UPROTO_CDC_AT 1
-#define UCLASS_HID 3
-#define USUBCLASS_BOOT 1
-#define UCLASS_PRINTER 7
-#define USUBCLASS_PRINTER 1
-#define UPROTO_PRINTER_UNI 1
-#define UPROTO_PRINTER_BI 2
-#define UCLASS_HUB 9
-#define USUBCLASS_HUB 0
-#define UCLASS_DATA 10
-
-#define USB_HUB_MAX_DEPTH 5
-
-/*
- * Minimum time a device needs to be powered down to go through
- * a power cycle. XXX Are these time in the spec?
- */
-#define USB_POWER_DOWN_TIME 200 /* ms */
-#define USB_PORT_POWER_DOWN_TIME 100 /* ms */
-
-#if 0
-/* These are the values from the spec. */
-#define USB_PORT_RESET_DELAY 10 /* ms */
-#define USB_PORT_RESET_SETTLE 10 /* ms */
-#define USB_PORT_POWERUP_DELAY 100 /* ms */
-#define USB_SET_ADDRESS_SETTLE 2 /* ms */
-#else
-/* Allow for marginal (i.e. non-conforming) devices. */
-#define USB_PORT_RESET_DELAY 20 /* ms */
-#define USB_PORT_RESET_RECOVERY 50 /* ms */
-#define USB_PORT_POWERUP_DELAY 200 /* ms */
-#define USB_SET_ADDRESS_SETTLE 10 /* ms */
-#endif
-
-#define USB_MIN_POWER 100 /* mA */
-#define USB_MAX_POWER 500 /* mA */
-
-
-#define USB_BUS_RESET_DELAY 100 /* ms XXX?*/
-#define USB_RESUME_DELAY 10 /* ms XXX?*/
-
-/*** ioctl() related stuff ***/
-
-struct usb_ctl_request {
- int addr;
- usb_device_request_t request;
- void *data;
- int flags;
-/* XXX must match flags in usbdi.h */
-#define USBD_SHORT_XFER_OK 0x04
- int actlen; /* actual length transferred */
-};
-
-struct usb_alt_interface {
- int config_index;
- int interface_index;
- int alt_no;
-};
-
-#define USB_CURRENT_CONFIG_INDEX (-1)
-#define USB_CURRENT_ALT_INDEX (-1)
-
-struct usb_config_desc {
- int config_index;
- usb_config_descriptor_t desc;
-};
-
-struct usb_interface_desc {
- int config_index;
- int interface_index;
- int alt_index;
- usb_interface_descriptor_t desc;
-};
-
-struct usb_endpoint_desc {
- int config_index;
- int interface_index;
- int alt_index;
- int endpoint_index;
- usb_endpoint_descriptor_t desc;
-};
-
-struct usb_full_desc {
- int config_index;
- u_int size;
- u_char *data;
-};
-
-struct usb_string_desc {
- int string_index;
- int language_id;
- usb_string_descriptor_t desc;
-};
-
-struct usb_ctl_report_desc {
- int size;
- u_char data[1024]; /* filled data size will vary */
-};
-
-struct usb_device_info {
- u_int8_t addr; /* device address */
- char product[USB_MAX_STRING_LEN];
- char vendor[USB_MAX_STRING_LEN];
- char revision[8];
- u_int16_t productNo;
- u_int16_t vendorNo;
- u_int8_t class;
- u_int8_t config;
- u_int8_t lowspeed;
- int power; /* power consumption in mA, 0 if selfpowered */
- int nports;
- u_int8_t ports[16];/* hub only: addresses of devices on ports */
-#define USB_PORT_ENABLED 0xff
-#define USB_PORT_SUSPENDED 0xfe
-#define USB_PORT_POWERED 0xfd
-#define USB_PORT_DISABLED 0xfc
-};
-
-struct usb_ctl_report {
- int report;
- u_char data[1024]; /* filled data size will vary */
-};
-
-struct usb_device_stats {
- u_long requests[4]; /* indexed by transfer type UE_* */
-};
-
-/* USB controller */
-#define USB_REQUEST _IOWR('U', 1, struct usb_ctl_request)
-#define USB_SETDEBUG _IOW ('U', 2, int)
-#define USB_DISCOVER _IO ('U', 3)
-#define USB_DEVICEINFO _IOWR('U', 4, struct usb_device_info)
-#define USB_DEVICESTATS _IOR ('U', 5, struct usb_device_stats)
-
-/* Generic HID device */
-#define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc)
-#define USB_SET_IMMED _IOW ('U', 22, int)
-#define USB_GET_REPORT _IOWR('U', 23, struct usb_ctl_report)
-
-/* Generic USB device */
-#define USB_GET_CONFIG _IOR ('U', 100, int)
-#define USB_SET_CONFIG _IOW ('U', 101, int)
-#define USB_GET_ALTINTERFACE _IOWR('U', 102, struct usb_alt_interface)
-#define USB_SET_ALTINTERFACE _IOWR('U', 103, struct usb_alt_interface)
-#define USB_GET_NO_ALT _IOWR('U', 104, struct usb_alt_interface)
-#define USB_GET_DEVICE_DESC _IOR ('U', 105, usb_device_descriptor_t)
-#define USB_GET_CONFIG_DESC _IOWR('U', 106, struct usb_config_desc)
-#define USB_GET_INTERFACE_DESC _IOWR('U', 107, struct usb_interface_desc)
-#define USB_GET_ENDPOINT_DESC _IOWR('U', 108, struct usb_endpoint_desc)
-#define USB_GET_FULL_DESC _IOWR('U', 109, struct usb_full_desc)
-#define USB_GET_STRING_DESC _IOWR('U', 110, struct usb_string_desc)
-#define USB_DO_REQUEST _IOWR('U', 111, struct usb_ctl_request)
-#define USB_GET_DEVICEINFO _IOR ('U', 112, struct usb_device_info)
-#define USB_SET_SHORT_XFER _IOW ('U', 113, int)
-
-#endif /* _USB_H_ */
diff --git a/sys/dev/usb/usb_if.m b/sys/dev/usb/usb_if.m
deleted file mode 100644
index fa5649c555dad..0000000000000
--- a/sys/dev/usb/usb_if.m
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (c) 1992-1998 Nick Hibma <hibma@skylink.it>
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer,
-# without modification, immediately at the beginning of the file.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# $Id$
-#
-
-# USB interface description
-#
-
-INTERFACE usb;
-
-# The device should start probing for new children again
-#
-METHOD int reconfigure {
- device_t dev;
-};
-
diff --git a/sys/dev/usb/usb_mem.h b/sys/dev/usb/usb_mem.h
deleted file mode 100644
index f6ffb96879457..0000000000000
--- a/sys/dev/usb/usb_mem.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $NetBSD: usb_mem.h,v 1.4 1999/01/09 12:16:54 augustss Exp $ */
-/* FreeBSD $Id: usb_mem.h,v 1.4 1999/01/07 23:31:38 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if defined(__NetBSD__)
-typedef struct usb_block_dma {
- bus_dma_tag_t tag;
- bus_dmamap_t map;
- caddr_t kaddr;
- bus_dma_segment_t segs[1];
- int nsegs;
- size_t size;
- size_t align;
- int fullblock;
- LIST_ENTRY(usb_block_dma) next;
-} usb_dma_block_t;
-
-typedef struct {
- usb_dma_block_t *block;
- u_int offs;
-} usb_dma_t;
-
-#define DMAADDR(dma) ((dma)->block->segs[0].ds_addr + (dma)->offs)
-#define KERNADDR(dma) ((void *)((dma)->block->kaddr + (dma)->offs))
-
-usbd_status usb_allocmem __P((bus_dma_tag_t, size_t, size_t, usb_dma_t *));
-void usb_freemem __P((bus_dma_tag_t, usb_dma_t *));
-
-#elif defined(__FreeBSD__)
-
-/*
- * FreeBSD does not have special functions for dma memory, so let's keep it
- * simple for now.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/queue.h>
-#include <sys/proc.h>
-#include <sys/buf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <machine/pmap.h> /* for vtophys */
-
-typedef void * usb_dma_t;
-
-#define usb_allocmem(t,s,a,p) (*(p) = malloc(s, M_USB, M_NOWAIT), (*(p) == NULL? USBD_NOMEM: USBD_NORMAL_COMPLETION))
-#define usb_freemem(t,p) (free(*(p), M_USB))
-
-#define DMAADDR(dma) (vtophys(*(dma)))
-#define KERNADDR(dma) ((void *) *(dma))
-#endif
-
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
deleted file mode 100644
index d7bd4f0040ddf..0000000000000
--- a/sys/dev/usb/usb_port.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/* $NetBSD: usb_port.h,v 1.5 1999/01/08 11:58:25 augustss Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-/*
- * Macro's to cope with the differences between operating systems.
- */
-
-/*
- * NetBSD
- */
-
-#if defined(__NetBSD__)
-#include "opt_usbverbose.h"
-
-#define USBDEVNAME(bdev) ((bdev).dv_xname)
-
-typedef struct device bdevice; /* base device */
-
-#define usb_timeout(f, d, t, h) timeout((f), (d), (t))
-#define usb_untimeout(f, d, h) untimeout((f), (d))
-
-#define USB_DECLARE_DRIVER_INIT(dname, _2) \
-int __CONCAT(dname,_match) __P((struct device *, struct cfdata *, void *)); \
-void __CONCAT(dname,_attach) __P((struct device *, struct device *, void *)); \
-\
-extern struct cfdriver __CONCAT(dname,_cd); \
-\
-struct cfattach __CONCAT(dname,_ca) = { \
- sizeof(struct __CONCAT(dname,_softc)), \
- __CONCAT(dname,_match), \
- __CONCAT(dname,_attach) \
-}
-
-#define USB_MATCH(dname) \
-int \
-__CONCAT(dname,_match)(parent, match, aux) \
- struct device *parent; \
- struct cfdata *match; \
- void *aux;
-
-#define USB_MATCH_START(dname, uaa) \
- struct usb_attach_arg *uaa = aux
-
-#define USB_ATTACH(dname) \
-void \
-__CONCAT(dname,_attach)(parent, self, aux) \
- struct device *parent; \
- struct device *self; \
- void *aux;
-
-#define USB_ATTACH_START(dname, sc, uaa) \
- struct __CONCAT(dname,_softc) *sc = \
- (struct __CONCAT(dname,_softc) *)self; \
- struct usb_attach_arg *uaa = aux
-
-/* Returns from attach */
-#define USB_ATTACH_ERROR_RETURN return
-#define USB_ATTACH_SUCCESS_RETURN return
-
-#define USB_ATTACH_SETUP printf("\n")
-
-#define USB_GET_SC_OPEN(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc; \
- if (unit >= __CONCAT(dname,_cd).cd_ndevs) \
- return (ENXIO); \
- sc = __CONCAT(dname,_cd).cd_devs[unit]; \
- if (!sc) \
- return (ENXIO)
-
-#define USB_GET_SC(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = __CONCAT(dname,_cd).cd_devs[unit]
-
-#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
- ((dev)->softc = config_found_sm(parent, args, print, sub))
-
-
-
-
-#elif defined(__FreeBSD__)
-/*
- * FreeBSD
- */
-
-#include "opt_usb.h"
-/*
- * The following is not a type def to avoid error messages
- * because of includes in the wrong order.
- */
-#define bdevice device_t
-#define USBDEVNAME(bdev) usbd_devname(&bdev)
-
-/* XXX Change this when FreeBSD has memset
- */
-#define memset(d, v, s) \
- do{ \
- if ((v) == 0) \
- bzero((d), (s)); \
- else \
- panic("Non zero filler for memset, cannot handle!"); \
- } while (0)
-
-
-#define usb_timeout(f, d, t, h) ((h) = timeout((f), (d), (t)))
-#define usb_untimeout(f, d, h) untimeout((f), (d), (h))
-
-#define USB_DECLARE_DRIVER_INIT(dname, init...) \
-static device_probe_t __CONCAT(dname,_match); \
-static device_attach_t __CONCAT(dname,_attach); \
-static device_detach_t __CONCAT(dname,_detach); \
-\
-static devclass_t __CONCAT(dname,_devclass); \
-\
-static device_method_t __CONCAT(dname,_methods)[] = { \
- DEVMETHOD(device_probe, __CONCAT(dname,_match)), \
- DEVMETHOD(device_attach, __CONCAT(dname,_attach)), \
- DEVMETHOD(device_detach, __CONCAT(dname,_detach)), \
- init, \
- {0,0} \
-}; \
-\
-static driver_t __CONCAT(dname,_driver) = { \
- #dname, \
- __CONCAT(dname,_methods), \
- DRIVER_TYPE_MISC, \
- sizeof(struct __CONCAT(dname,_softc)) \
-}
-
-#define USB_MATCH(dname) \
-static int \
-__CONCAT(dname,_match)(device_t device)
-
-#define USB_MATCH_START(dname, uaa) \
- struct usb_attach_arg *uaa = device_get_ivars(device)
-
-#define USB_ATTACH(dname) \
-static int \
-__CONCAT(dname,_attach)(device_t self)
-
-#define USB_ATTACH_START(dname, sc, uaa) \
- struct __CONCAT(dname,_softc) *sc = device_get_softc(self); \
- struct usb_attach_arg *uaa = device_get_ivars(self)
-
-/* Returns from attach */
-#define USB_ATTACH_ERROR_RETURN return ENXIO
-#define USB_ATTACH_SUCCESS_RETURN return 0
-
-#define USB_ATTACH_SETUP \
- usbd_device_set_desc(self, devinfo); \
- sc->sc_dev = self
-
-#define USB_GET_SC_OPEN(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = \
- devclass_get_softc(__CONCAT(dname,_devclass), unit); \
- if (!sc) \
- return (ENXIO)
-
-#define USB_GET_SC(dname, unit, sc) \
- struct __CONCAT(dname,_softc) *sc = \
- devclass_get_softc(__CONCAT(dname,_devclass), unit)
-
-#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
- (device_probe_and_attach((bdev)) == 0 ? ((dev)->softc = (bdev)) : 0)
-
-/* conversion from one type of queue to the other */
-#define SIMPLEQ_REMOVE_HEAD STAILQ_REMOVE_HEAD_UNTIL
-#define SIMPLEQ_INSERT_HEAD STAILQ_INSERT_HEAD
-#define SIMPLEQ_INSERT_TAIL STAILQ_INSERT_TAIL
-#define SIMPLEQ_NEXT STAILQ_NEXT
-#define SIMPLEQ_FIRST STAILQ_FIRST
-#define SIMPLEQ_HEAD STAILQ_HEAD
-#define SIMPLEQ_INIT STAILQ_INIT
-#define SIMPLEQ_ENTRY STAILQ_ENTRY
-
-#endif /* __FreeBSD__ */
-
-
-
-#define USB_DECLARE_DRIVER(dname) \
- USB_DECLARE_DRIVER_INIT(dname, {0,0} )
diff --git a/sys/dev/usb/usb_quirks.c b/sys/dev/usb/usb_quirks.c
deleted file mode 100644
index e7c8208abce19..0000000000000
--- a/sys/dev/usb/usb_quirks.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* $NetBSD: usb_quirks.c,v 1.8 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: usb_quirks.c,v 1.5 1999/01/07 23:31:39 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#if defined(__FreeBSD__)
-#include <sys/bus.h>
-#endif
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#ifdef USB_DEBUG
-extern int usbdebug;
-#endif
-
-struct usbd_quirk_entry {
- u_int16_t idVendor;
- u_int16_t idProduct;
- u_int16_t bcdDevice;
- struct usbd_quirks quirks;
-} quirks[] = {
- { USB_VENDOR_GENIUS, USB_PRODUCT_GENIUS_NICHE, 0x100, { UQ_NO_SET_PROTO}},
- { USB_VENDOR_INSIDEOUT,USB_PRODUCT_INSIDEOUT_EDGEPORT4,
- 0x094, { UQ_SWAP_UNICODE}},
- { USB_VENDOR_UNIXTAR, USB_PRODUCT_UNIXTAR_UTUSB41, 0x100, { UQ_HUB_POWER }},
- { USB_VENDOR_BTC, USB_PRODUCT_BTC_BTC7932, 0x100, { UQ_NO_STRINGS }},
- { USB_VENDOR_ADS, USB_PRODUCT_ADS_ENET, 0x002, { UQ_NO_STRINGS }},
- { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1, 0x101, { UQ_NO_STRINGS }},
- { USB_VENDOR_JAZZ, USB_PRODUCT_JAZZ_J6502, 0x0a2, { UQ_BAD_ADC }},
- { 0, 0, 0, { 0 } }
-};
-
-struct usbd_quirks usbd_no_quirk = { 0 };
-
-struct usbd_quirks *
-usbd_find_quirk(d)
- usb_device_descriptor_t *d;
-{
- struct usbd_quirk_entry *t;
-
- for (t = quirks; t->idVendor != 0; t++) {
- if (t->idVendor == UGETW(d->idVendor) &&
- t->idProduct == UGETW(d->idProduct) &&
- t->bcdDevice == UGETW(d->bcdDevice))
- break;
- }
-#ifdef USB_DEBUG
- if (usbdebug && t->quirks.uq_flags)
- printf("usbd_find_quirk 0x%04x/0x%04x/%x: %d\n",
- UGETW(d->idVendor), UGETW(d->idProduct),
- UGETW(d->bcdDevice), t->quirks.uq_flags);
-#endif
- return (&t->quirks);
-}
diff --git a/sys/dev/usb/usb_quirks.h b/sys/dev/usb/usb_quirks.h
deleted file mode 100644
index 07935d58143f6..0000000000000
--- a/sys/dev/usb/usb_quirks.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* $NetBSD: usb_quirks.h,v 1.5 1998/12/29 15:23:59 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-struct usbd_quirks {
- u_int32_t uq_flags; /* Device problems: */
-#define UQ_NO_SET_PROTO 0x01 /* cannot handle SET PROTOCOL. */
-#define UQ_SWAP_UNICODE 0x02 /* has some Unicode strings swapped. */
-#define UQ_HUB_POWER 0x04 /* does not respond correctly to get
- device status; use get hub status. */
-#define UQ_NO_STRINGS 0x08 /* string descriptors are broken. */
-#define UQ_BAD_ADC 0x10 /* bad audio spec version number. */
-};
-
-extern struct usbd_quirks usbd_no_quirk;
-
-struct usbd_quirks *usbd_find_quirk __P((usb_device_descriptor_t *));
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
deleted file mode 100644
index d903c07951642..0000000000000
--- a/sys/dev/usb/usb_subr.c
+++ /dev/null
@@ -1,1127 +0,0 @@
-/* $NetBSD: usb_subr.c,v 1.27 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: usb_subr.c,v 1.6 1999/01/07 23:31:40 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#elif defined(__FreeBSD__)
-#include <sys/module.h>
-#include <sys/bus.h>
-#endif
-#include <sys/proc.h>
-#include <sys/select.h>
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdivar.h>
-#include <dev/usb/usbdevs.h>
-#include <dev/usb/usb_quirks.h>
-
-#if defined(__FreeBSD__)
-#include <machine/clock.h>
-#define delay(d) DELAY(d)
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-static usbd_status usbd_set_config __P((usbd_device_handle, int));
-char *usbd_get_string __P((usbd_device_handle, int, char *));
-int usbd_getnewaddr __P((usbd_bus_handle bus));
-#if defined(__NetBSD__)
-int usbd_print __P((void *aux, const char *pnp));
-int usbd_submatch __P((bdevice *, struct cfdata *cf, void *));
-#endif
-void usbd_free_iface_data __P((usbd_device_handle dev, int ifcno));
-void usbd_kill_pipe __P((usbd_pipe_handle));
-usbd_status usbd_probe_and_attach
- __P((bdevice *parent, usbd_device_handle dev, int port, int addr));
-
-
-#ifdef USBVERBOSE
-typedef u_int16_t usb_vendor_id_t;
-typedef u_int16_t usb_product_id_t;
-
-/*
- * Descriptions of of known vendors and devices ("products").
- */
-struct usb_knowndev {
- usb_vendor_id_t vendor;
- usb_product_id_t product;
- int flags;
- char *vendorname, *productname;
-};
-#define USB_KNOWNDEV_NOPROD 0x01 /* match on vendor only */
-
-#include <dev/usb/usbdevs_data.h>
-#endif /* USBVERBOSE */
-
-#ifdef USB_DEBUG
-char *usbd_error_strs[] = {
- "NORMAL_COMPLETION",
- "IN_PROGRESS",
- "PENDING_REQUESTS",
- "NOT_STARTED",
- "INVAL",
- "IS_IDLE",
- "NOMEM",
- "CANCELLED",
- "BAD_ADDRESS",
- "IN_USE",
- "INTERFACE_NOT_ACTIVE",
- "NO_ADDR",
- "SET_ADDR_FAILED",
- "NO_POWER",
- "TOO_DEEP",
- "IOERROR",
- "NOT_CONFIGURED",
- "TIMEOUT",
- "SHORT_XFER",
- "STALLED",
- "XXX",
-};
-#endif
-
-usbd_status
-usbd_get_string_desc(dev, sindex, langid, sdesc)
- usbd_device_handle dev;
- int sindex;
- int langid;
- usb_string_descriptor_t *sdesc;
-{
- usb_device_request_t req;
- usbd_status r;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW2(req.wValue, UDESC_STRING, sindex);
- USETW(req.wIndex, langid);
- USETW(req.wLength, 1); /* only size byte first */
- r = usbd_do_request(dev, &req, sdesc);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- USETW(req.wLength, sdesc->bLength); /* the whole string */
- return (usbd_do_request(dev, &req, sdesc));
-}
-
-char *
-usbd_get_string(dev, si, buf)
- usbd_device_handle dev;
- int si;
- char *buf;
-{
- int swap = dev->quirks->uq_flags & UQ_SWAP_UNICODE;
- usb_string_descriptor_t us;
- char *s;
- int i, n;
- u_int16_t c;
- usbd_status r;
-
- if (si == 0)
- return (0);
- if (dev->quirks->uq_flags & UQ_NO_STRINGS)
- return (0);
- if (dev->langid == USBD_NOLANG) {
- /* Set up default language */
- r = usbd_get_string_desc(dev, USB_LANGUAGE_TABLE, 0, &us);
- if (r != USBD_NORMAL_COMPLETION || us.bLength < 4) {
- dev->langid = 0; /* Well, just pick English then */
- } else {
- /* Pick the first language as the default. */
- dev->langid = UGETW(us.bString[0]);
- }
- }
- r = usbd_get_string_desc(dev, si, dev->langid, &us);
- if (r != USBD_NORMAL_COMPLETION)
- return (0);
- s = buf;
- n = us.bLength / 2 - 1;
- for (i = 0; i < n; i++) {
- c = UGETW(us.bString[i]);
- /* Convert from Unicode, handle buggy strings. */
- if ((c & 0xff00) == 0)
- *s++ = c;
- else if ((c & 0x00ff) == 0 && swap)
- *s++ = c >> 8;
- else
- *s++ = '?';
- }
- *s++ = 0;
- return buf;
-}
-
-void
-usbd_devinfo_vp(dev, v, p)
- usbd_device_handle dev;
- char *v, *p;
-{
- usb_device_descriptor_t *udd = &dev->ddesc;
- char *vendor = 0, *product = 0;
-#ifdef USBVERBOSE
- struct usb_knowndev *kdp;
-#endif
-
- vendor = usbd_get_string(dev, udd->iManufacturer, v);
- product = usbd_get_string(dev, udd->iProduct, p);
-#ifdef USBVERBOSE
- if (!vendor) {
- for(kdp = usb_knowndevs;
- kdp->vendorname != NULL;
- kdp++) {
- if (kdp->vendor == UGETW(udd->idVendor) &&
- (kdp->product == UGETW(udd->idProduct) ||
- (kdp->flags & USB_KNOWNDEV_NOPROD) != 0))
- break;
- }
- if (kdp->vendorname == NULL)
- vendor = product = NULL;
- else {
- vendor = kdp->vendorname;
- product = (kdp->flags & USB_KNOWNDEV_NOPROD) == 0 ?
- kdp->productname : NULL;
- }
- }
-#endif
- if (vendor)
- strcpy(v, vendor);
- else
- sprintf(v, "vendor 0x%04x", UGETW(udd->idVendor));
- if (product)
- strcpy(p, product);
- else
- sprintf(p, "product 0x%04x", UGETW(udd->idProduct));
-}
-
-int
-usbd_printBCD(cp, bcd)
- char *cp;
- int bcd;
-{
- return (sprintf(cp, "%x.%02x", bcd >> 8, bcd & 0xff));
-}
-
-void
-usbd_devinfo(dev, showclass, cp)
- usbd_device_handle dev;
- int showclass;
- char *cp;
-{
- usb_device_descriptor_t *udd = &dev->ddesc;
- char vendor[USB_MAX_STRING_LEN];
- char product[USB_MAX_STRING_LEN];
- int bcdDevice, bcdUSB;
-
- usbd_devinfo_vp(dev, vendor, product);
- cp += sprintf(cp, "%s %s", vendor, product);
- if (showclass)
- cp += sprintf(cp, ", class %d/%d",
- udd->bDeviceClass, udd->bDeviceSubClass);
- bcdUSB = UGETW(udd->bcdUSB);
- bcdDevice = UGETW(udd->bcdDevice);
- cp += sprintf(cp, ", rev ");
- cp += usbd_printBCD(cp, bcdUSB);
- *cp++ = '/';
- cp += usbd_printBCD(cp, bcdDevice);
- cp += sprintf(cp, ", addr %d", dev->address);
- *cp = 0;
-}
-
-/* Delay for a certain number of ms */
-void
-usb_delay_ms(bus, ms)
- usbd_bus_handle bus;
- u_int ms;
-{
- /* Wait at least two clock ticks so we know the time has passed. */
- if (bus->use_polling)
- delay((ms+1) * 1000);
- else
- tsleep(&ms, PRIBIO, "usbdly", (ms*hz+999)/1000 + 1);
-}
-
-/* Delay given a device handle. */
-void
-usbd_delay_ms(dev, ms)
- usbd_device_handle dev;
- u_int ms;
-{
- usb_delay_ms(dev->bus, ms);
-}
-
-usbd_status
-usbd_reset_port(dev, port, ps)
- usbd_device_handle dev;
- int port;
- usb_port_status_t *ps;
-{
- usb_device_request_t req;
- usbd_status r;
- int n;
-
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_SET_FEATURE;
- USETW(req.wValue, UHF_PORT_RESET);
- USETW(req.wIndex, port);
- USETW(req.wLength, 0);
- r = usbd_do_request(dev, &req, 0);
- DPRINTFN(1,("usbd_reset_port: port %d reset done, error=%d(%s)\n",
- port, r, usbd_error_strs[r]));
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- n = 10;
- do {
- /* Wait for device to recover from reset. */
- usbd_delay_ms(dev, USB_PORT_RESET_DELAY);
- r = usbd_get_port_status(dev, port, ps);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("usbd_reset_port: get status failed %d\n",r));
- return (r);
- }
- } while ((UGETW(ps->wPortChange) & UPS_C_PORT_RESET) == 0 && --n > 0);
- if (n == 0) {
- printf("usbd_reset_port: timeout\n");
- return (USBD_IOERROR);
- }
- r = usbd_clear_port_feature(dev, port, UHF_C_PORT_RESET);
-#ifdef USB_DEBUG
- if (r != USBD_NORMAL_COMPLETION)
- DPRINTF(("usbd_reset_port: clear port feature failed %d\n",r));
-#endif
-
- /* Wait for the device to recover from reset. */
- usbd_delay_ms(dev, USB_PORT_RESET_RECOVERY);
- return (r);
-}
-
-usb_interface_descriptor_t *
-usbd_find_idesc(cd, ifaceidx, altidx)
- usb_config_descriptor_t *cd;
- int ifaceidx;
- int altidx;
-{
- char *p = (char *)cd;
- char *end = p + UGETW(cd->wTotalLength);
- usb_interface_descriptor_t *d;
- int curidx, lastidx, curaidx = 0;
-
- for (curidx = lastidx = -1; p < end; ) {
- d = (usb_interface_descriptor_t *)p;
- DPRINTFN(4,("usbd_find_idesc: idx=%d(%d) altidx=%d(%d) len=%d "
- "type=%d\n",
- ifaceidx, curidx, altidx, curaidx,
- d->bLength, d->bDescriptorType));
- if (d->bLength == 0) /* bad descriptor */
- break;
- p += d->bLength;
- if (p <= end && d->bDescriptorType == UDESC_INTERFACE) {
- if (d->bInterfaceNumber != lastidx) {
- lastidx = d->bInterfaceNumber;
- curidx++;
- curaidx = 0;
- } else
- curaidx++;
- if (ifaceidx == curidx && altidx == curaidx)
- return (d);
- }
- }
- return (0);
-}
-
-usb_endpoint_descriptor_t *
-usbd_find_edesc(cd, ifaceidx, altidx, endptidx)
- usb_config_descriptor_t *cd;
- int ifaceidx;
- int altidx;
- int endptidx;
-{
- char *p = (char *)cd;
- char *end = p + UGETW(cd->wTotalLength);
- usb_interface_descriptor_t *d;
- usb_endpoint_descriptor_t *e;
- int curidx;
-
- d = usbd_find_idesc(cd, ifaceidx, altidx);
- if (!d)
- return (0);
- if (endptidx >= d->bNumEndpoints) /* quick exit */
- return (0);
-
- curidx = -1;
- for (p = (char *)d + d->bLength; p < end; ) {
- e = (usb_endpoint_descriptor_t *)p;
- if (e->bLength == 0) /* bad descriptor */
- break;
- p += e->bLength;
- if (p <= end && e->bDescriptorType == UDESC_INTERFACE)
- return (0);
- if (p <= end && e->bDescriptorType == UDESC_ENDPOINT) {
- curidx++;
- if (curidx == endptidx)
- return (e);
- }
- }
- return (0);
-}
-
-usbd_status
-usbd_fill_iface_data(dev, ifaceidx, altidx)
- usbd_device_handle dev;
- int ifaceidx;
- int altidx;
-{
- usbd_interface_handle ifc = &dev->ifaces[ifaceidx];
- char *p, *end;
- int endpt, nendpt;
-
- DPRINTFN(4,("usbd_fill_iface_data: ifaceidx=%d altidx=%d\n",
- ifaceidx, altidx));
- ifc->device = dev;
- ifc->idesc = usbd_find_idesc(dev->cdesc, ifaceidx, altidx);
- if (ifc->idesc == 0)
- return (USBD_INVAL);
- ifc->index = ifaceidx;
- ifc->altindex = altidx;
- nendpt = ifc->idesc->bNumEndpoints;
- DPRINTFN(10,("usbd_fill_iface_data: found idesc n=%d\n", nendpt));
- if (nendpt != 0) {
- ifc->endpoints = malloc(nendpt * sizeof(struct usbd_endpoint),
- M_USB, M_NOWAIT);
- if (ifc->endpoints == 0)
- return (USBD_NOMEM);
- } else
- ifc->endpoints = 0;
- ifc->priv = 0;
- p = (char *)ifc->idesc + ifc->idesc->bLength;
- end = (char *)dev->cdesc + UGETW(dev->cdesc->wTotalLength);
-#define ed ((usb_endpoint_descriptor_t *)p)
- for (endpt = 0; endpt < nendpt; endpt++) {
- DPRINTFN(10,("usbd_fill_iface_data: endpt=%d\n", endpt));
- for (; p < end; p += ed->bLength) {
- ed = (usb_endpoint_descriptor_t *)p;
- DPRINTFN(10,("usbd_fill_iface_data: p=%p end=%p "
- "len=%d type=%d\n",
- p, end, ed->bLength, ed->bDescriptorType));
- if (p + ed->bLength <= end && ed->bLength != 0 &&
- ed->bDescriptorType == UDESC_ENDPOINT)
- goto found;
- if (ed->bDescriptorType == UDESC_INTERFACE ||
- ed->bLength == 0)
- break;
- }
- /* passed end, or bad desc */
- goto bad;
- found:
- ifc->endpoints[endpt].edesc = ed;
- ifc->endpoints[endpt].state = USBD_ENDPOINT_ACTIVE;
- ifc->endpoints[endpt].refcnt = 0;
- ifc->endpoints[endpt].toggle = 0;
- p += ed->bLength;
- }
-#undef ed
- LIST_INIT(&ifc->pipes);
- ifc->state = USBD_INTERFACE_ACTIVE;
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- free(ifc->endpoints, M_USB);
- return (USBD_INVAL);
-}
-
-void
-usbd_free_iface_data(dev, ifcno)
- usbd_device_handle dev;
- int ifcno;
-{
- usbd_interface_handle ifc = &dev->ifaces[ifcno];
- if (ifc->endpoints)
- free(ifc->endpoints, M_USB);
-}
-
-static usbd_status
-usbd_set_config(dev, conf)
- usbd_device_handle dev;
- int conf;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_DEVICE;
- req.bRequest = UR_SET_CONFIG;
- USETW(req.wValue, conf);
- USETW(req.wIndex, 0);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_set_config_no(dev, no, msg)
- usbd_device_handle dev;
- int no;
- int msg;
-{
- int index;
- usb_config_descriptor_t cd;
- usbd_status r;
-
- DPRINTFN(5,("usbd_set_config_no: %d\n", no));
- /* Figure out what config index to use. */
- for (index = 0; index < dev->ddesc.bNumConfigurations; index++) {
- r = usbd_get_config_desc(dev, index, &cd);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (cd.bConfigurationValue == no)
- return (usbd_set_config_index(dev, index, msg));
- }
- return (USBD_INVAL);
-}
-
-usbd_status
-usbd_set_config_index(dev, index, msg)
- usbd_device_handle dev;
- int index;
- int msg;
-{
- usb_status_t ds;
- usb_hub_status_t hs;
- usb_config_descriptor_t cd, *cdp;
- usbd_status r;
- int ifcidx, nifc, len, selfpowered, power;
-
- DPRINTFN(5,("usbd_set_config_index: dev=%p index=%d\n", dev, index));
-
- /* XXX check that all interfaces are idle */
- if (dev->config != 0) {
- DPRINTF(("usbd_set_config_index: free old config\n"));
- /* Free all configuration data structures. */
- nifc = dev->cdesc->bNumInterface;
- for (ifcidx = 0; ifcidx < nifc; ifcidx++)
- usbd_free_iface_data(dev, ifcidx);
- free(dev->ifaces, M_USB);
- free(dev->cdesc, M_USB);
- dev->ifaces = 0;
- dev->cdesc = 0;
- dev->config = 0;
- dev->state = USBD_DEVICE_ADDRESSED;
- }
-
- /* Figure out what config number to use. */
- r = usbd_get_config_desc(dev, index, &cd);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- len = UGETW(cd.wTotalLength);
- cdp = malloc(len, M_USB, M_NOWAIT);
- if (cdp == 0)
- return (USBD_NOMEM);
- r = usbd_get_desc(dev, UDESC_CONFIG, index, len, cdp);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad;
- if (cdp->bDescriptorType != UDESC_CONFIG) {
- DPRINTFN(-1,("usbd_set_config_index: bad desc %d\n",
- cdp->bDescriptorType));
- r = USBD_INVAL;
- goto bad;
- }
- selfpowered = 0;
- if (cdp->bmAttributes & UC_SELF_POWERED) {
- /* May be self powered. */
- if (cdp->bmAttributes & UC_BUS_POWERED) {
- /* Must ask device. */
- if (dev->quirks->uq_flags & UQ_HUB_POWER) {
- /* Buggy hub, use hub descriptor. */
- r = usbd_get_hub_status(dev, &hs);
- if (r == USBD_NORMAL_COMPLETION &&
- !(UGETW(hs.wHubStatus) & UHS_LOCAL_POWER))
- selfpowered = 1;
- } else {
- r = usbd_get_device_status(dev, &ds);
- if (r == USBD_NORMAL_COMPLETION &&
- (UGETW(ds.wStatus) & UDS_SELF_POWERED))
- selfpowered = 1;
- }
- DPRINTF(("usbd_set_config_index: status=0x%04x, "
- "error=%d(%s)\n",
- UGETW(ds.wStatus), r, usbd_error_strs[r]));
- } else
- selfpowered = 1;
- }
- DPRINTF(("usbd_set_config_index: (addr %d) attr=0x%02x, "
- "selfpowered=%d, power=%d, powerquirk=%x\n",
- dev->address, cdp->bmAttributes,
- selfpowered, cdp->bMaxPower * 2,
- dev->quirks->uq_flags & UQ_HUB_POWER));
-#ifdef USB_DEBUG
- if (!dev->powersrc) {
- printf("usbd_set_config_index: No power source?\n");
- return (USBD_IOERROR);
- }
-#endif
- power = cdp->bMaxPower * 2;
- if (power > dev->powersrc->power) {
- /* XXX print nicer message. */
- if (msg)
- printf("%s: device addr %d (config %d) exceeds power "
- "budget, %d mA > %d mA\n",
- USBDEVNAME(dev->bus->bdev), dev->address,
- cdp->bConfigurationValue,
- power, dev->powersrc->power);
- r = USBD_NO_POWER;
- goto bad;
- }
- dev->power = power;
- dev->self_powered = selfpowered;
-
- DPRINTF(("usbd_set_config_index: set config %d\n",
- cdp->bConfigurationValue));
- r = usbd_set_config(dev, cdp->bConfigurationValue);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("usbd_set_config_index: setting config=%d failed, "
- "error=%d(%s)\n",
- cdp->bConfigurationValue, r, usbd_error_strs[r]));
- goto bad;
- }
- DPRINTF(("usbd_set_config_index: setting new config %d\n",
- cdp->bConfigurationValue));
- nifc = cdp->bNumInterface;
- dev->ifaces = malloc(nifc * sizeof(struct usbd_interface),
- M_USB, M_NOWAIT);
- if (dev->ifaces == 0) {
- r = USBD_NOMEM;
- goto bad;
- }
- DPRINTFN(5,("usbd_set_config_index: dev=%p cdesc=%p\n", dev, cdp));
- dev->cdesc = cdp;
- dev->config = cdp->bConfigurationValue;
- dev->state = USBD_DEVICE_CONFIGURED;
- for (ifcidx = 0; ifcidx < nifc; ifcidx++) {
- r = usbd_fill_iface_data(dev, ifcidx, 0);
- if (r != USBD_NORMAL_COMPLETION) {
- while (--ifcidx >= 0)
- usbd_free_iface_data(dev, ifcidx);
- goto bad;
- }
- }
-
- return (USBD_NORMAL_COMPLETION);
-
- bad:
- free(cdp, M_USB);
- return (r);
-}
-
-/* XXX add function for alternate settings */
-
-usbd_status
-usbd_setup_pipe(dev, iface, ep, pipe)
- usbd_device_handle dev;
- usbd_interface_handle iface;
- struct usbd_endpoint *ep;
- usbd_pipe_handle *pipe;
-{
- usbd_pipe_handle p;
- usbd_status r;
-
- DPRINTFN(1,("usbd_setup_pipe: dev=%p iface=%p ep=%p pipe=%p\n",
- dev, iface, ep, pipe));
- p = malloc(dev->bus->pipe_size, M_USB, M_NOWAIT);
- if (p == 0)
- return (USBD_NOMEM);
- p->device = dev;
- p->iface = iface;
- p->state = USBD_PIPE_ACTIVE;
- p->endpoint = ep;
- ep->refcnt++;
- p->refcnt = 1;
- p->intrreqh = 0;
- p->running = 0;
- SIMPLEQ_INIT(&p->queue);
- r = dev->bus->open_pipe(p);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1,("usbd_setup_pipe: endpoint=0x%x failed, error=%d"
- "(%s)\n",
- ep->edesc->bEndpointAddress, r, usbd_error_strs[r]));
- free(p, M_USB);
- return (r);
- }
- *pipe = p;
- return (USBD_NORMAL_COMPLETION);
-}
-
-/* Abort the device control pipe. */
-void
-usbd_kill_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- pipe->methods->close(pipe);
- pipe->endpoint->refcnt--;
- free(pipe, M_USB);
-}
-
-int
-usbd_getnewaddr(bus)
- usbd_bus_handle bus;
-{
- int addr;
-
- for (addr = 1; addr < USB_MAX_DEVICES; addr++)
- if (bus->devices[addr] == 0)
- return (addr);
- return (-1);
-}
-
-
-usbd_status
-usbd_probe_and_attach(parent, dev, port, addr)
- bdevice *parent;
- usbd_device_handle dev;
- int port;
- int addr;
-{
- struct usb_attach_arg uaa;
- usb_device_descriptor_t *dd = &dev->ddesc;
- int r, found, i, confi, nifaces;
- usbd_interface_handle ifaces[256]; /* 256 is the absolute max */
-
-#if defined(__FreeBSD__)
-/* XXX uaa is a static var. Not a problem as it _should_ be used only
- * during probe and attach. Should be changed however
- */
- bdevice bdev;
- bdev = device_add_child(*parent, NULL, -1, &uaa);
- if (!bdev) {
- printf("%s: Device creation failed\n", USBDEVNAME(dev->bus->bdev));
- return (USBD_INVAL);
- }
-#endif
-
- uaa.device = dev;
- uaa.iface = 0;
- uaa.ifaces = 0;
- uaa.nifaces = 0;
- uaa.usegeneric = 0;
- uaa.port = port;
- uaa.configno = UHUB_UNK_CONFIGURATION;
- uaa.ifaceno = UHUB_UNK_INTERFACE;
-
- /* First try with device specific drivers. */
- if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print, usbd_submatch))
- return (USBD_NORMAL_COMPLETION);
-
- DPRINTF(("usbd_probe_and_attach: no device specific driver found\n"));
-
- /* Next try with interface drivers. */
- for (confi = 0; confi < dd->bNumConfigurations; confi++) {
- DPRINTFN(1,("usbd_probe_and_attach: trying config idx=%d\n",
- confi));
- r = usbd_set_config_index(dev, confi, 1);
- if (r != USBD_NORMAL_COMPLETION) {
-#ifdef USB_DEBUG
- DPRINTF(("%s: port %d, set config at addr %d failed, "
- "error=%d(%s)\n", USBDEVNAME(*parent), port,
- addr, r, usbd_error_strs[r]));
-#else
- printf("%s: port %d, set config at addr %d failed\n",
- USBDEVNAME(*parent), port, addr);
-#endif
-#if defined(__FreeBSD__)
- device_delete_child(*parent, bdev);
-#endif
- return (r);
- }
- nifaces = dev->cdesc->bNumInterface;
- uaa.configno = dev->cdesc->bConfigurationValue;
- for (i = 0; i < nifaces; i++)
- ifaces[i] = &dev->ifaces[i];
- uaa.ifaces = ifaces;
- uaa.nifaces = nifaces;
- for (found = i = 0; i < nifaces; i++) {
- if (!ifaces[i])
- continue; /* interface already claimed */
- uaa.iface = ifaces[i];
- uaa.ifaceno = ifaces[i]->idesc->bInterfaceNumber;
- if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print,
- usbd_submatch)) {
- found++;
- ifaces[i] = 0; /* consumed */
- }
- }
- if (found != 0)
- return (USBD_NORMAL_COMPLETION);
- }
- /* No interfaces were attached in any of the configurations. */
- if (dd->bNumConfigurations > 1)/* don't change if only 1 config */
- usbd_set_config_index(dev, 0, 0);
-
- DPRINTF(("usbd_probe_and_attach: no interface drivers found\n"));
-
- /* Finally try the generic driver. */
- uaa.iface = 0;
- uaa.usegeneric = 1;
- uaa.configno = UHUB_UNK_CONFIGURATION;
- uaa.ifaceno = UHUB_UNK_INTERFACE;
- if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print, usbd_submatch))
- return (USBD_NORMAL_COMPLETION);
-
- /*
- * The generic attach failed, but leave the device as it is.
- * We just did not find any drivers, that's all. The device is
- * fully operational and not harming anyone.
- */
- DPRINTF(("usbd_probe_and_attach: generic attach failed\n"));
-#if defined(__FreeBSD__)
-/*
- * XXX should we delete the child again? Left for now to avoid dangling
- * references.
- device_delete_child(*parent, bdev);
-*/
-#endif
- return (USBD_NORMAL_COMPLETION);
-}
-
-
-
-/*
- * Called when a new device has been put in the powered state,
- * but not yet in the addressed state.
- * Get initial descriptor, set the address, get full descriptor,
- * and attach a driver.
- */
-usbd_status
-usbd_new_device(parent, bus, depth, lowspeed, port, up)
- bdevice *parent;
- usbd_bus_handle bus;
- int depth;
- int lowspeed;
- int port;
- struct usbd_port *up;
-{
- usbd_device_handle dev;
- usb_device_descriptor_t *dd;
- usbd_status r;
- int addr;
- int i;
-
- DPRINTF(("usbd_new_device bus=%p depth=%d lowspeed=%d\n",
- bus, depth, lowspeed));
- addr = usbd_getnewaddr(bus);
- if (addr < 0) {
- printf("%s: No free USB addresses, new device ignored.\n",
- USBDEVNAME(bus->bdev));
- return (USBD_NO_ADDR);
- }
-
- dev = malloc(sizeof *dev, M_USB, M_NOWAIT);
- if (dev == 0)
- return (USBD_NOMEM);
- memset(dev, 0, sizeof(*dev));
-
- dev->bus = bus;
-
- /* Set up default endpoint handle. */
- dev->def_ep.edesc = &dev->def_ep_desc;
- dev->def_ep.state = USBD_ENDPOINT_ACTIVE;
-
- /* Set up default endpoint descriptor. */
- dev->def_ep_desc.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE;
- dev->def_ep_desc.bDescriptorType = UDESC_ENDPOINT;
- dev->def_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT;
- dev->def_ep_desc.bmAttributes = UE_CONTROL;
- USETW(dev->def_ep_desc.wMaxPacketSize, USB_MAX_IPACKET);
- dev->def_ep_desc.bInterval = 0;
-
- dev->state = USBD_DEVICE_DEFAULT;
- dev->quirks = &usbd_no_quirk;
- dev->address = USB_START_ADDR;
- dev->ddesc.bMaxPacketSize = 0;
- dev->lowspeed = lowspeed != 0;
- dev->depth = depth;
- dev->powersrc = up;
- dev->langid = USBD_NOLANG;
-
- /* Establish the the default pipe. */
- r = usbd_setup_pipe(dev, 0, &dev->def_ep, &dev->default_pipe);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_remove_device(dev, up);
- return (r);
- }
-
- up->device = dev;
- dd = &dev->ddesc;
- /* Try a few times in case the device is slow (i.e. outside specs.) */
- for (i = 0; i < 5; i++) {
- /* Get the first 8 bytes of the device descriptor. */
- r = usbd_get_desc(dev, UDESC_DEVICE, 0, USB_MAX_IPACKET, dd);
- if (r == USBD_NORMAL_COMPLETION)
- break;
- usbd_delay_ms(dev, 200);
- }
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1, ("usbd_new_device: addr=%d, getting first desc "
- "failed\n",
- addr));
- usbd_remove_device(dev, up);
- return (r);
- }
-
- if (dd->bDescriptorType != UDESC_DEVICE) {
- /* Illegal device descriptor */
- DPRINTFN(-1,("usbd_new_device: illegal descriptor %d\n",
- dd->bDescriptorType));
- usbd_remove_device(dev, up);
- return (USBD_INVAL);
- }
-
- DPRINTF(("usbd_new_device: adding unit addr=%d, rev=%02x, class=%d, "
- "subclass=%d, protocol=%d, maxpacket=%d, ls=%d\n",
- addr,UGETW(dd->bcdUSB), dd->bDeviceClass, dd->bDeviceSubClass,
- dd->bDeviceProtocol, dd->bMaxPacketSize, dev->lowspeed));
-
- USETW(dev->def_ep_desc.wMaxPacketSize, dd->bMaxPacketSize);
-
- /* Get the full device descriptor. */
- r = usbd_get_device_desc(dev, dd);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
- "failed\n", addr));
- usbd_remove_device(dev, up);
- return (r);
- }
-
- /* Figure out what's wrong with this device. */
- dev->quirks = usbd_find_quirk(dd);
-
- /* Set the address */
- r = usbd_set_address(dev, addr);
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTFN(-1,("usb_new_device: set address %d failed\n",addr));
- r = USBD_SET_ADDR_FAILED;
- usbd_remove_device(dev, up);
- return (r);
- }
- /* Allow device time to set new address */
- usbd_delay_ms(dev, USB_SET_ADDRESS_SETTLE);
-
- dev->address = addr; /* New device address now */
- dev->state = USBD_DEVICE_ADDRESSED;
- bus->devices[addr] = dev;
-
- /* Assume 100mA bus powered for now. Changed when configured. */
- dev->power = USB_MIN_POWER;
- dev->self_powered = 0;
-
- DPRINTF(("usbd_new_device: new dev (addr %d), dev=%p, parent=%p\n",
- addr, dev, parent));
-
- r = usbd_probe_and_attach(parent, dev, port, addr);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_remove_device(dev, up);
- return (r);
- }
-
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-usbd_remove_device(dev, up)
- usbd_device_handle dev;
- struct usbd_port *up;
-{
- DPRINTF(("usbd_remove_device: %p\n", dev));
-
- if (dev->default_pipe)
- usbd_kill_pipe(dev->default_pipe);
- up->device = 0;
- dev->bus->devices[dev->address] = 0;
-
- free(dev, M_USB);
-}
-
-#if defined(__NetBSD__)
-int
-usbd_print(aux, pnp)
- void *aux;
- const char *pnp;
-{
- struct usb_attach_arg *uaa = aux;
- char devinfo[1024];
-
- DPRINTFN(15, ("usbd_print dev=%p\n", uaa->device));
- if (pnp) {
- if (!uaa->usegeneric)
- return (QUIET);
- usbd_devinfo(uaa->device, 1, devinfo);
- printf("%s, %s", devinfo, pnp);
- }
- if (uaa->port != 0)
- printf(" port %d", uaa->port);
- if (uaa->configno != UHUB_UNK_CONFIGURATION)
- printf(" configuration %d", uaa->configno);
- if (uaa->ifaceno != UHUB_UNK_INTERFACE)
- printf(" interface %d", uaa->ifaceno);
- return (UNCONF);
-}
-
-int
-usbd_submatch(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct usb_attach_arg *uaa = aux;
-
- if ((uaa->port != 0 &&
- cf->uhubcf_port != UHUB_UNK_PORT &&
- cf->uhubcf_port != uaa->port) ||
- (uaa->configno != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != uaa->configno) ||
- (uaa->ifaceno != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != uaa->ifaceno))
- return 0;
- return ((*cf->cf_attach->ca_match)(parent, cf, aux));
-}
-#endif
-
-usbd_status
-usb_insert_transfer(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
- usbd_interface_handle iface = pipe->iface;
-
- if (pipe->state == USBD_PIPE_IDLE ||
- (iface && iface->state == USBD_INTERFACE_IDLE))
- return (USBD_IS_IDLE);
- SIMPLEQ_INSERT_TAIL(&pipe->queue, reqh, next);
- if (pipe->state != USBD_PIPE_ACTIVE ||
- (iface && iface->state != USBD_INTERFACE_ACTIVE))
- return (USBD_NOT_STARTED);
- if (pipe->running)
- return (USBD_IN_PROGRESS);
- pipe->running = 1;
- return (USBD_NORMAL_COMPLETION);
-}
-
-void
-usb_start_next(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_request_handle reqh;
- usbd_status r;
-
-#ifdef DIAGNOSTIC
- if (SIMPLEQ_FIRST(&pipe->queue) == 0) {
- printf("usb_start_next: empty\n");
- return;
- }
-#endif
-
- /* First remove remove old */
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, SIMPLEQ_FIRST(&pipe->queue), next);
- if (pipe->state != USBD_PIPE_ACTIVE) {
- pipe->running = 0;
- return;
- }
- reqh = SIMPLEQ_FIRST(&pipe->queue);
- DPRINTFN(5, ("usb_start_next: start reqh=%p\n", reqh));
- if (!reqh)
- pipe->running = 0;
- else {
- r = pipe->methods->start(reqh);
- if (r != USBD_IN_PROGRESS) {
- printf("usb_start_next: error=%d\n", r);
- pipe->running = 0;
- /* XXX do what? */
- }
- }
-}
-
-void
-usbd_fill_deviceinfo(dev, di)
- usbd_device_handle dev;
- struct usb_device_info *di;
-{
- struct usbd_port *p;
- int i, r, s;
-
- di->config = dev->config;
- usbd_devinfo_vp(dev, di->vendor, di->product);
- usbd_printBCD(di->revision, UGETW(dev->ddesc.bcdDevice));
- di->vendorNo = UGETW(dev->ddesc.idVendor);
- di->productNo = UGETW(dev->ddesc.idProduct);
- di->class = dev->ddesc.bDeviceClass;
- di->power = dev->self_powered ? 0 : dev->power;
- di->lowspeed = dev->lowspeed;
- di->addr = dev->address;
- if (dev->hub) {
- for (i = 0;
- i < sizeof(di->ports) / sizeof(di->ports[0]) &&
- i < dev->hub->hubdesc.bNbrPorts;
- i++) {
- p = &dev->hub->ports[i];
- if (p->device)
- r = p->device->address;
- else {
- s = UGETW(p->status.wPortStatus);
- if (s & UPS_PORT_ENABLED)
- r = USB_PORT_ENABLED;
- else if (s & UPS_SUSPEND)
- r = USB_PORT_SUSPENDED;
- else if (s & UPS_PORT_POWER)
- r = USB_PORT_POWERED;
- else
- r = USB_PORT_DISABLED;
- }
- di->ports[i] = r;
- }
- di->nports = dev->hub->hubdesc.bNbrPorts;
- } else
- di->nports = 0;
-}
diff --git a/sys/dev/usb/usbcdc.h b/sys/dev/usb/usbcdc.h
deleted file mode 100644
index 3d3eb818f1b2e..0000000000000
--- a/sys/dev/usb/usbcdc.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $NetBSD: usbcdc.h,v 1.3 1999/01/03 01:09:18 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _USBCDC_H_
-#define _USBCDC_H_
-
-#define UDESCSUB_CDC_HEADER 0
-#define UDESCSUB_CDC_CM 1 /* Call Management */
-#define UDESCSUB_CDC_ACM 2 /* Abstract Control Model */
-#define UDESCSUB_CDC_DLM 3 /* Direct Line Management */
-#define UDESCSUB_CDC_TRF 4 /* Telephone Ringer */
-#define UDESCSUB_CDC_TCLSR 5 /* Telephone Call ... */
-#define UDESCSUB_CDC_UNION 6
-#define UDESCSUB_CDC_CS 7 /* Country Selection */
-#define UDESCSUB_CDC_TOM 8 /* Telephone Operational Modes */
-#define UDESCSUB_CDC_USBT 9 /* USB Terminal */
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uWord bcdCDC;
-} usb_cdc_header_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uByte bmCapabilities;
-#define USB_CDC_CM_DOES_CM 0x01
-#define USB_CDC_CM_CM_OVER_DATA 0x02
- uByte bDataInterface;
-} usb_cdc_cm_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uByte bmCapabilities;
-#define USB_CDC_ACM_HAS_FEATURE 0x01
-#define USB_CDC_ACM_HAS_LINE 0x02
-#define USB_CDC_ACM_HAS_BREAK 0x04
-#define USB_CDC_ACM_HAS_NETWORK_CONN 0x08
-} usb_cdc_acm_descriptor_t;
-
-typedef struct {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uByte bMasterInterface;
- uByte bSlaveInterface[1];
-} usb_cdc_union_descriptor_t;
-
-#define UCDC_SEND_ENCAPSULATED_COMMAND 0x00
-#define UCDC_GET_ENCAPSULATED_RESPONSE 0x01
-#define UCDC_SET_COMM_FEATURE 0x02
-#define UCDC_GET_COMM_FEATURE 0x03
-#define UCDC_ABSTRACT_STATE 0x01
-#define UCDC_COUNTRY_SETTING 0x02
-#define UCDC_CLEAR_COMM_FEATURE 0x04
-#define UCDC_SET_LINE_CODING 0x20
-#define UCDC_GET_LINE_CODING 0x21
-
-typedef struct {
- uWord wState;
-#define UCDC_IDLE_SETTING 0x0001
-#define UCDC_DATA_MULTIPLEXED 0x0002
-} usb_cdc_abstract_state_t;
-
-typedef struct {
- uDWord dwDTERate;
- uByte bCharFormat;
-#define UCDC_STOP_BIT_1 0
-#define UCDC_STOP_BIT_1_5 1
-#define UCDC_STOP_BIT_2 2
- uByte bParityType;
-#define UCDC_PARITY_NONE 0
-#define UCDC_PARITY_ODD 1
-#define UCDC_PARITY_EVEN 2
-#define UCDC_PARITY_MARK 3
-#define UCDC_PARITY_SPACE 4
- uByte bDataBits;
-} usb_cdc_line_state_t;
-
-typedef struct {
- uByte bmRequestType;
-#define UCDC_NOTIFICATION 0xa1
- uByte bNotification;
-#define UCDC_N_NETWORK_CONNECTION 0x00
-#define UCDC_N_RESPONSE_AVAILABLE 0x01
-#define UCDC_N_AUX_JACK_HOOK_STATE 0x08
-#define UCDC_N_RING_DETECT 0x09
-#define UCDC_N_SERIAL_STATE 0x20
-#define UCDC_N_CALL_STATE_CHANGED 0x28
-#define UCDC_N_LINE_STATE_CHANGED 0x29
-#define UCDC_N_CONNECTION_SPEED_CHANGE 0x2a
- uWord wValue;
- uWord wIndex;
- uWord wLength;
- uByte data[16];
-} usb_cdc_notification_t;
-#define UCDC_NOTIFICATION_LENGTH 8
-
-#endif /* _USBCDC_H_ */
diff --git a/sys/dev/usb/usbdevs.h b/sys/dev/usb/usbdevs.h
deleted file mode 100644
index 24398066a8c92..0000000000000
--- a/sys/dev/usb/usbdevs.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/* $FreeBSD$ */
-
-/*
- * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- *
- * generated from:
- * NetBSD: usbdevs,v 1.19 1999/01/08 11:18:38 augustss Exp
- */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * List of known USB vendors
- */
-
-#define USB_VENDOR_NEC 0x0409 /* NEC */
-#define USB_VENDOR_KODAK 0x040a /* Eastman Kodak */
-/* Computer Access Technology Corporation */
-#define USB_VENDOR_CATC 0x0423 /* CATC */
-#define USB_VENDOR_NANAO 0x0440 /* Nanao */
-#define USB_VENDOR_UNIXTAR 0x0451 /* Unixtar */
-#define USB_VENDOR_GENIUS 0x0458 /* Genius */
-#define USB_VENDOR_MICROSOFT 0x045e /* Microsoft */
-#define USB_VENDOR_KENSINGTON 0x0461 /* Kensington */
-#define USB_VENDOR_CHERRY 0x046a /* Cherry */
-/* Behavior Technology Corporation */
-#define USB_VENDOR_BTC 0x046e /* BTC */
-#define USB_VENDOR_PHILIPS 0x0471 /* Philips */
-#define USB_VENDOR_CONNECTIX 0x0478 /* Connectix */
-#define USB_VENDOR_ACER 0x04a5 /* Acer Peripherals */
-#define USB_VENDOR_CYPRESS 0x04b4 /* Cypress Semiconductor */
-#define USB_VENDOR_3COM 0x04c1 /* 3Com */
-#define USB_VENDOR_SHUTTLE 0x04e6 /* Shuttle Technology */
-#define USB_VENDOR_JAZZ 0x04fa /* Jazz */
-#define USB_VENDOR_ATEN 0x0557 /* ATen */
-#define USB_VENDOR_PERACOM 0x0565 /* Peracom */
-#define USB_VENDOR_EIZO 0x056d /* EIZO */
-#define USB_VENDOR_AGILER 0x056e /* Agiler */
-#define USB_VENDOR_BELKIN 0x05ab /* Belkin */
-#define USB_VENDOR_LOGITECH 0x05ac /* Logitech */
-#define USB_VENDOR_EIZONANAO 0x05e7 /* EIZO Nanao */
-#define USB_VENDOR_CHIC 0x05fe /* Chic Technology */
-#define USB_VENDOR_ADS 0x06e1 /* ADS Technologies */
-#define USB_VENDOR_PLX 0x10b5 /* PLX */
-#define USB_VENDOR_ENTREGA 0x1645 /* Entrega */
-#define USB_VENDOR_INSIDEOUT 0x1608 /* Inside Out Networks */
-#define USB_VENDOR_INTEL 0x8086 /* Intel */
-
-/*
- * List of known products. Grouped by vendor.
- */
-
-/* NEC products */
-#define USB_PRODUCT_NEC_HUB 0x55aa /* hub */
-#define USB_PRODUCT_NEC_HUB_B 0x55ab /* hub */
-
-/* Kodak products */
-#define USB_PRODUCT_KODAK_DC260 0x0110 /* Digital Science DC260 */
-
-/* CATC products */
-#define USB_PRODUCT_CATC_ANDROMEDA 0x1237 /* Andromeda hub */
-
-/* Unixtar products */
-#define USB_PRODUCT_UNIXTAR_UTUSB41 0x1446 /* UT-USB41 hub */
-
-/* Genius products */
-#define USB_PRODUCT_GENIUS_NICHE 0x0001 /* Niche mouse */
-#define USB_PRODUCT_GENIUS_FLIGHT2000 0x1004 /* Flight 2000 joystick */
-
-/* Microsoft products */
-#define USB_PRODUCT_MICROSOFT_INTELLIMOUSE 0x0009 /* IntelliMouse */
-
-/* Kensington products */
-#define USB_PRODUCT_KENSINGTON_MOUSEINABOX 0x4d02 /* Mouse-in-a-Box */
-
-/* Cherry products */
-#define USB_PRODUCT_CHERRY_MY3000KBD 0x0001 /* My3000 keyboard */
-#define USB_PRODUCT_CHERRY_MY3000HUB 0x0003 /* My3000 hub */
-
-/* Behavior Technology Corporation products */
-#define USB_PRODUCT_BTC_BTC7932 0x6782 /* Keyboard with mouse port */
-
-/* Philips products */
-#define USB_PRODUCT_PHILIPS_DSS 0x0101 /* DSS 350 Digital Speaker System */
-#define USB_PRODUCT_PHILIPS_HUB 0x0201 /* hub */
-
-/* Connectix products */
-#define USB_PRODUCT_CONNECTIX_QUICKCAM 0x0001 /* QuickCam */
-
-/* Acer products */
-#define USB_PRODUCT_ACER_ACERSCAN_C310U 0x12a6 /* Acerscan C310U */
-
-/* Cypress Semiconduuctor products */
-#define USB_PRODUCT_CYPRESS_MOUSE 0x0001 /* mouse */
-
-/* 3Com products */
-#define USB_PRODUCT_3COM_USR56K 0x3021 /* U.S.Robotics 56000 Voice USB Modem */
-
-/* Shuttle Technology products */
-#define USB_PRODUCT_SHUTTLE_EUSB 0x0001 /* E-USB Bridge */
-
-/* Jazz products */
-#define USB_PRODUCT_JAZZ_J6502 0x4201 /* J-6502 speakers */
-
-/* ATen products */
-#define USB_PRODUCT_ATEN_UC1284 0x2001 /* Parallel printer adapter */
-
-/* Peracom products */
-#define USB_PRODUCT_PERACOM_SERIAL1 0x0001 /* Serial Converter */
-
-/* EIZO products */
-#define USB_PRODUCT_EIZO_HUB 0x0000 /* hub */
-#define USB_PRODUCT_EIZO_MONITOR 0x0001 /* monitor */
-
-/* Agiler products */
-#define USB_PRODUCT_AGILER_MOUSE29UO 0x0002 /* mouse 29UO */
-
-/* Belkin products */
-#define USB_PRODUCT_BELKIN_F5U002 0x0002 /* Parallel printer adapter */
-
-/* Logitech products */
-#define USB_PRODUCT_LOGITECH_M2452 0x0203 /* M2452 keyboard */
-#define USB_PRODUCT_LOGITECH_M4848 0x0301 /* M4848 mouse */
-
-/* Chic Technology products */
-#define USB_PRODUCT_CHIC_MOUSE1 0x0001 /* mouse */
-
-/* ADS products */
-#define USB_PRODUCT_ADS_ENET 0x0008 /* Ethernet adapter */
-
-/* PLX products */
-#define USB_PRODUCT_PLX_TESTBOARD 0x9060 /* test board */
-
-#define USB_PRODUCT_ENTREGA_CENTRONICS 0x0006 /* Centronics connector */
-#define USB_PRODUCT_ENTREGA_SERIAL 0x8001 /* DB25 Serial connector */
-
-/* Inside Out Networks products */
-#define USB_PRODUCT_INSIDEOUT_EDGEPORT4 0x0001 /* EdgePort/4 serial ports */
-
-/* Intel products */
-#define USB_PRODUCT_INTEL_TESTBOARD 0x9890 /* 82930 test board */
diff --git a/sys/dev/usb/usbdevs_data.h b/sys/dev/usb/usbdevs_data.h
deleted file mode 100644
index a6815eb6c9da6..0000000000000
--- a/sys/dev/usb/usbdevs_data.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/* $FreeBSD$ */
-
-/*
- * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- *
- * generated from:
- * NetBSD: usbdevs,v 1.19 1999/01/08 11:18:38 augustss Exp
- */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-struct usb_knowndev usb_knowndevs[] = {
- {
- USB_VENDOR_NEC, USB_PRODUCT_NEC_HUB,
- 0,
- "NEC",
- "hub",
- },
- {
- USB_VENDOR_NEC, USB_PRODUCT_NEC_HUB_B,
- 0,
- "NEC",
- "hub",
- },
- {
- USB_VENDOR_KODAK, USB_PRODUCT_KODAK_DC260,
- 0,
- "Eastman Kodak",
- "Digital Science DC260",
- },
- {
- USB_VENDOR_CATC, USB_PRODUCT_CATC_ANDROMEDA,
- 0,
- "CATC",
- "Andromeda hub",
- },
- {
- USB_VENDOR_UNIXTAR, USB_PRODUCT_UNIXTAR_UTUSB41,
- 0,
- "Unixtar",
- "UT-USB41 hub",
- },
- {
- USB_VENDOR_GENIUS, USB_PRODUCT_GENIUS_NICHE,
- 0,
- "Genius",
- "Niche mouse",
- },
- {
- USB_VENDOR_GENIUS, USB_PRODUCT_GENIUS_FLIGHT2000,
- 0,
- "Genius",
- "Flight 2000 joystick",
- },
- {
- USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_INTELLIMOUSE,
- 0,
- "Microsoft",
- "IntelliMouse",
- },
- {
- USB_VENDOR_KENSINGTON, USB_PRODUCT_KENSINGTON_MOUSEINABOX,
- 0,
- "Kensington",
- "Mouse-in-a-Box",
- },
- {
- USB_VENDOR_CHERRY, USB_PRODUCT_CHERRY_MY3000KBD,
- 0,
- "Cherry",
- "My3000 keyboard",
- },
- {
- USB_VENDOR_CHERRY, USB_PRODUCT_CHERRY_MY3000HUB,
- 0,
- "Cherry",
- "My3000 hub",
- },
- {
- USB_VENDOR_BTC, USB_PRODUCT_BTC_BTC7932,
- 0,
- "BTC",
- "Keyboard with mouse port",
- },
- {
- USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_DSS,
- 0,
- "Philips",
- "DSS 350 Digital Speaker System",
- },
- {
- USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_HUB,
- 0,
- "Philips",
- "hub",
- },
- {
- USB_VENDOR_CONNECTIX, USB_PRODUCT_CONNECTIX_QUICKCAM,
- 0,
- "Connectix",
- "QuickCam",
- },
- {
- USB_VENDOR_ACER, USB_PRODUCT_ACER_ACERSCAN_C310U,
- 0,
- "Acer Peripherals",
- "Acerscan C310U",
- },
- {
- USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_MOUSE,
- 0,
- "Cypress Semiconductor",
- "mouse",
- },
- {
- USB_VENDOR_3COM, USB_PRODUCT_3COM_USR56K,
- 0,
- "3Com",
- "U.S.Robotics 56000 Voice USB Modem",
- },
- {
- USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB,
- 0,
- "Shuttle Technology",
- "E-USB Bridge",
- },
- {
- USB_VENDOR_JAZZ, USB_PRODUCT_JAZZ_J6502,
- 0,
- "Jazz",
- "J-6502 speakers",
- },
- {
- USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC1284,
- 0,
- "ATen",
- "Parallel printer adapter",
- },
- {
- USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1,
- 0,
- "Peracom",
- "Serial Converter",
- },
- {
- USB_VENDOR_EIZO, USB_PRODUCT_EIZO_HUB,
- 0,
- "EIZO",
- "hub",
- },
- {
- USB_VENDOR_EIZO, USB_PRODUCT_EIZO_MONITOR,
- 0,
- "EIZO",
- "monitor",
- },
- {
- USB_VENDOR_AGILER, USB_PRODUCT_AGILER_MOUSE29UO,
- 0,
- "Agiler",
- "mouse 29UO",
- },
- {
- USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U002,
- 0,
- "Belkin",
- "Parallel printer adapter",
- },
- {
- USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_M2452,
- 0,
- "Logitech",
- "M2452 keyboard",
- },
- {
- USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_M4848,
- 0,
- "Logitech",
- "M4848 mouse",
- },
- {
- USB_VENDOR_CHIC, USB_PRODUCT_CHIC_MOUSE1,
- 0,
- "Chic Technology",
- "mouse",
- },
- {
- USB_VENDOR_ADS, USB_PRODUCT_ADS_ENET,
- 0,
- "ADS Technologies",
- "Ethernet adapter",
- },
- {
- USB_VENDOR_PLX, USB_PRODUCT_PLX_TESTBOARD,
- 0,
- "PLX",
- "test board",
- },
- {
- USB_VENDOR_ENTREGA, USB_PRODUCT_ENTREGA_CENTRONICS,
- 0,
- "Entrega",
- "Centronics connector",
- },
- {
- USB_VENDOR_ENTREGA, USB_PRODUCT_ENTREGA_SERIAL,
- 0,
- "Entrega",
- "DB25 Serial connector",
- },
- {
- USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4,
- 0,
- "Inside Out Networks",
- "EdgePort/4 serial ports",
- },
- {
- USB_VENDOR_INTEL, USB_PRODUCT_INTEL_TESTBOARD,
- 0,
- "Intel",
- "82930 test board",
- },
- {
- USB_VENDOR_NEC, 0,
- USB_KNOWNDEV_NOPROD,
- "NEC",
- NULL,
- },
- {
- USB_VENDOR_KODAK, 0,
- USB_KNOWNDEV_NOPROD,
- "Eastman Kodak",
- NULL,
- },
- {
- USB_VENDOR_CATC, 0,
- USB_KNOWNDEV_NOPROD,
- "CATC",
- NULL,
- },
- {
- USB_VENDOR_NANAO, 0,
- USB_KNOWNDEV_NOPROD,
- "Nanao",
- NULL,
- },
- {
- USB_VENDOR_UNIXTAR, 0,
- USB_KNOWNDEV_NOPROD,
- "Unixtar",
- NULL,
- },
- {
- USB_VENDOR_GENIUS, 0,
- USB_KNOWNDEV_NOPROD,
- "Genius",
- NULL,
- },
- {
- USB_VENDOR_MICROSOFT, 0,
- USB_KNOWNDEV_NOPROD,
- "Microsoft",
- NULL,
- },
- {
- USB_VENDOR_KENSINGTON, 0,
- USB_KNOWNDEV_NOPROD,
- "Kensington",
- NULL,
- },
- {
- USB_VENDOR_CHERRY, 0,
- USB_KNOWNDEV_NOPROD,
- "Cherry",
- NULL,
- },
- {
- USB_VENDOR_BTC, 0,
- USB_KNOWNDEV_NOPROD,
- "BTC",
- NULL,
- },
- {
- USB_VENDOR_PHILIPS, 0,
- USB_KNOWNDEV_NOPROD,
- "Philips",
- NULL,
- },
- {
- USB_VENDOR_CONNECTIX, 0,
- USB_KNOWNDEV_NOPROD,
- "Connectix",
- NULL,
- },
- {
- USB_VENDOR_ACER, 0,
- USB_KNOWNDEV_NOPROD,
- "Acer Peripherals",
- NULL,
- },
- {
- USB_VENDOR_CYPRESS, 0,
- USB_KNOWNDEV_NOPROD,
- "Cypress Semiconductor",
- NULL,
- },
- {
- USB_VENDOR_3COM, 0,
- USB_KNOWNDEV_NOPROD,
- "3Com",
- NULL,
- },
- {
- USB_VENDOR_SHUTTLE, 0,
- USB_KNOWNDEV_NOPROD,
- "Shuttle Technology",
- NULL,
- },
- {
- USB_VENDOR_JAZZ, 0,
- USB_KNOWNDEV_NOPROD,
- "Jazz",
- NULL,
- },
- {
- USB_VENDOR_ATEN, 0,
- USB_KNOWNDEV_NOPROD,
- "ATen",
- NULL,
- },
- {
- USB_VENDOR_PERACOM, 0,
- USB_KNOWNDEV_NOPROD,
- "Peracom",
- NULL,
- },
- {
- USB_VENDOR_EIZO, 0,
- USB_KNOWNDEV_NOPROD,
- "EIZO",
- NULL,
- },
- {
- USB_VENDOR_AGILER, 0,
- USB_KNOWNDEV_NOPROD,
- "Agiler",
- NULL,
- },
- {
- USB_VENDOR_BELKIN, 0,
- USB_KNOWNDEV_NOPROD,
- "Belkin",
- NULL,
- },
- {
- USB_VENDOR_LOGITECH, 0,
- USB_KNOWNDEV_NOPROD,
- "Logitech",
- NULL,
- },
- {
- USB_VENDOR_EIZONANAO, 0,
- USB_KNOWNDEV_NOPROD,
- "EIZO Nanao",
- NULL,
- },
- {
- USB_VENDOR_CHIC, 0,
- USB_KNOWNDEV_NOPROD,
- "Chic Technology",
- NULL,
- },
- {
- USB_VENDOR_ADS, 0,
- USB_KNOWNDEV_NOPROD,
- "ADS Technologies",
- NULL,
- },
- {
- USB_VENDOR_PLX, 0,
- USB_KNOWNDEV_NOPROD,
- "PLX",
- NULL,
- },
- {
- USB_VENDOR_ENTREGA, 0,
- USB_KNOWNDEV_NOPROD,
- "Entrega",
- NULL,
- },
- {
- USB_VENDOR_INSIDEOUT, 0,
- USB_KNOWNDEV_NOPROD,
- "Inside Out Networks",
- NULL,
- },
- {
- USB_VENDOR_INTEL, 0,
- USB_KNOWNDEV_NOPROD,
- "Intel",
- NULL,
- },
- { 0, 0, 0, NULL, NULL, }
-};
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
deleted file mode 100644
index e1ed20a0f8a72..0000000000000
--- a/sys/dev/usb/usbdi.c
+++ /dev/null
@@ -1,1294 +0,0 @@
-/* $NetBSD: usbdi.c,v 1.20 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdi.c,v 1.7 1999/01/07 23:31:42 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#else
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#endif
-#include <sys/malloc.h>
-#include <sys/proc.h>
-
-#include <dev/usb/usb.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbdivar.h>
-
-#if defined(__FreeBSD__)
-#include "usb_if.h"
-#endif
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-static usbd_status usbd_ar_pipe __P((usbd_pipe_handle pipe));
-static usbd_status usbd_ar_iface __P((usbd_interface_handle iface));
-static void usbd_transfer_cb __P((usbd_request_handle reqh));
-static void usbd_sync_transfer_cb __P((usbd_request_handle reqh));
-static usbd_status usbd_do_transfer __P((usbd_request_handle reqh));
-void usbd_do_request_async_cb
- __P((usbd_request_handle, usbd_private_handle, usbd_status));
-
-static SIMPLEQ_HEAD(, usbd_request) usbd_free_requests;
-
-#if defined(__FreeBSD__)
-#define USB_CDEV_MAJOR 108
-
-extern struct cdevsw usb_cdevsw;
-#endif
-
-usbd_status
-usbd_open_pipe(iface, address, flags, pipe)
- usbd_interface_handle iface;
- u_int8_t address;
- u_int8_t flags;
- usbd_pipe_handle *pipe;
-{
- usbd_pipe_handle p;
- struct usbd_endpoint *ep;
- usbd_status r;
- int i;
-
- if (iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- for (i = 0; i < iface->idesc->bNumEndpoints; i++) {
- ep = &iface->endpoints[i];
- if (ep->edesc->bEndpointAddress == address)
- goto found;
- }
- return (USBD_BAD_ADDRESS);
- found:
- if ((flags & USBD_EXCLUSIVE_USE) &&
- ep->refcnt != 0)
- return (USBD_IN_USE);
- r = usbd_setup_pipe(iface->device, iface, ep, &p);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- LIST_INSERT_HEAD(&iface->pipes, p, next);
- *pipe = p;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_open_pipe_intr(iface, address, flags, pipe, priv, buffer, length, cb)
- usbd_interface_handle iface;
- u_int8_t address;
- u_int8_t flags;
- usbd_pipe_handle *pipe;
- usbd_private_handle priv;
- void *buffer;
- u_int32_t length;
- usbd_callback cb;
-{
- usbd_status r;
- usbd_request_handle reqh;
- usbd_pipe_handle ipipe;
-
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (USBD_NOMEM);
- r = usbd_open_pipe(iface, address, USBD_EXCLUSIVE_USE, &ipipe);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad1;
- r = usbd_setup_request(reqh, ipipe, priv, buffer, length,
- USBD_XFER_IN | flags, USBD_NO_TIMEOUT, cb);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad2;
- ipipe->intrreqh = reqh;
- r = usbd_transfer(reqh);
- *pipe = ipipe;
- if (r != USBD_IN_PROGRESS)
- goto bad3;
- return (USBD_NORMAL_COMPLETION);
-
- bad3:
- ipipe->intrreqh = 0;
- bad2:
- usbd_close_pipe(ipipe);
- bad1:
- usbd_free_request(reqh);
- return r;
-}
-
-usbd_status
-usbd_open_pipe_iso(iface, address, flags, pipe, priv, bufsize, nbuf, cb)
- usbd_interface_handle iface;
- u_int8_t address;
- u_int8_t flags;
- usbd_pipe_handle *pipe;
- usbd_private_handle priv;
- u_int32_t bufsize;
- u_int32_t nbuf;
- usbd_callback cb;
-{
- usbd_status r;
- usbd_pipe_handle p;
-
- r = usbd_open_pipe(iface, address, USBD_EXCLUSIVE_USE, &p);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!p->methods->isobuf) {
- usbd_close_pipe(p);
- return (USBD_INVAL);
- }
- r = p->methods->isobuf(p, bufsize, nbuf);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_close_pipe(p);
- return (r);
- }
- *pipe = p;
- return r;
-}
-
-usbd_status
-usbd_close_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- if (--pipe->refcnt != 0)
- return (USBD_NORMAL_COMPLETION);
- if (SIMPLEQ_FIRST(&pipe->queue) != 0)
- return (USBD_PENDING_REQUESTS);
- LIST_REMOVE(pipe, next);
- pipe->endpoint->refcnt--;
- pipe->methods->close(pipe);
- if (pipe->intrreqh)
- usbd_free_request(pipe->intrreqh);
- free(pipe, M_USB);
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_transfer(reqh)
- usbd_request_handle reqh;
-{
- reqh->xfercb = usbd_transfer_cb;
- return (usbd_do_transfer(reqh));
-}
-
-static usbd_status
-usbd_do_transfer(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
-
- DPRINTFN(10,("usbd_do_transfer: reqh=%p\n", reqh));
- reqh->done = 0;
- return (pipe->methods->transfer(reqh));
-}
-
-usbd_request_handle
-usbd_alloc_request()
-{
- usbd_request_handle reqh;
-
- reqh = SIMPLEQ_FIRST(&usbd_free_requests);
- if (reqh)
- SIMPLEQ_REMOVE_HEAD(&usbd_free_requests, reqh, next);
- else
- reqh = malloc(sizeof(*reqh), M_USB, M_NOWAIT);
- if (!reqh)
- return (0);
- memset(reqh, 0, sizeof *reqh);
- return (reqh);
-}
-
-usbd_status
-usbd_free_request(reqh)
- usbd_request_handle reqh;
-{
- SIMPLEQ_INSERT_HEAD(&usbd_free_requests, reqh, next);
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_setup_request(reqh, pipe, priv, buffer, length, flags, timeout, callback)
- usbd_request_handle reqh;
- usbd_pipe_handle pipe;
- usbd_private_handle priv;
- void *buffer;
- u_int32_t length;
- u_int16_t flags;
- u_int32_t timeout;
- void (*callback) __P((usbd_request_handle,
- usbd_private_handle,
- usbd_status));
-{
- reqh->pipe = pipe;
- reqh->isreq = 0;
- reqh->priv = priv;
- reqh->buffer = buffer;
- reqh->length = length;
- reqh->actlen = 0;
- reqh->flags = flags;
- reqh->callback = callback;
- reqh->status = USBD_NOT_STARTED;
- reqh->retries = 1;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_setup_device_request(reqh, req)
- usbd_request_handle reqh;
- usb_device_request_t *req;
-{
- reqh->isreq = 1;
- reqh->request = *req;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_setup_default_request(reqh, dev, priv, timeout, req, buffer,
- length, flags, callback)
- usbd_request_handle reqh;
- usbd_device_handle dev;
- usbd_private_handle priv;
- u_int32_t timeout;
- usb_device_request_t *req;
- void *buffer;
- u_int32_t length;
- u_int16_t flags;
- void (*callback) __P((usbd_request_handle,
- usbd_private_handle,
- usbd_status));
-{
- reqh->pipe = dev->default_pipe;
- reqh->priv = priv;
- reqh->buffer = buffer;
- reqh->length = length;
- reqh->actlen = 0;
- reqh->flags = flags;
- reqh->timeout = timeout;
- reqh->status = USBD_NOT_STARTED;
- reqh->callback = callback;
- reqh->request = *req;
- reqh->isreq = 1;
- reqh->retries = 1;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_set_request_timeout(reqh, timeout)
- usbd_request_handle reqh;
- u_int32_t timeout;
-{
- reqh->timeout = timeout;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_request_status(reqh, priv, buffer, count, status)
- usbd_request_handle reqh;
- usbd_private_handle *priv;
- void **buffer;
- u_int32_t *count;
- usbd_status *status;
-{
- *priv = reqh->priv;
- *buffer = reqh->buffer;
- *count = reqh->actlen;
- *status = reqh->status;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_request_device_data(reqh, req)
- usbd_request_handle reqh;
- usb_device_request_t *req;
-{
- if (!reqh->isreq)
- return (USBD_INVAL);
- *req = reqh->request;
- return (USBD_NORMAL_COMPLETION);
-}
-
-#if 0
-usb_descriptor_t *
-usbd_get_descriptor(iface, desc_type)
- usbd_interface_handle *iface;
- u_int8_t desc_type;
-XX
-#endif
-
-usb_config_descriptor_t *
-usbd_get_config_descriptor(dev)
- usbd_device_handle dev;
-{
- return (dev->cdesc);
-}
-
-usb_interface_descriptor_t *
-usbd_get_interface_descriptor(iface)
- usbd_interface_handle iface;
-{
- return (iface->idesc);
-}
-
-usb_device_descriptor_t *
-usbd_get_device_descriptor(dev)
- usbd_device_handle dev;
-{
- return (&dev->ddesc);
-}
-
-usb_endpoint_descriptor_t *
-usbd_interface2endpoint_descriptor(iface, index)
- usbd_interface_handle iface;
- u_int8_t index;
-{
- if (index >= iface->idesc->bNumEndpoints)
- return (0);
- return (iface->endpoints[index].edesc);
-}
-
-usbd_status
-usbd_set_configuration(dev, conf)
- usbd_device_handle dev;
- u_int8_t conf;
-{
- return usbd_set_config_no(dev, conf, 0);
-}
-
-usbd_status
-usbd_retry_request(reqh, retry_count)
- usbd_request_handle reqh;
- u_int32_t retry_count;
-{
- usbd_status r;
-
- r = usbd_set_pipe_state(reqh->pipe, USBD_PIPE_ACTIVE);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- reqh->retries = retry_count;
- return (usbd_transfer(reqh));
-}
-
-usbd_status
-usbd_abort_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_status r;
- int s, st;
-
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- s = splusb();
- st = pipe->state;
- r = usbd_ar_pipe(pipe);
- pipe->state = st;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_abort_interface(iface)
- usbd_interface_handle iface;
-{
- usbd_status r;
- int s, st;
-
- s = splusb();
- st = iface->state;
- r = usbd_ar_iface(iface);
- iface->state = st;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_reset_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_status r;
- int s;
-
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- s = splusb();
- r = usbd_ar_pipe(pipe);
- /* XXX anything else */
- pipe->state = USBD_PIPE_ACTIVE;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_reset_interface(iface)
- usbd_interface_handle iface;
-{
- usbd_status r;
- int s;
-
- s = splusb();
- r = usbd_ar_iface(iface);
- /* XXX anything else */
- iface->state = USBD_INTERFACE_ACTIVE;
- splx(s);
- return (r);
-}
-
-usbd_status
-usbd_clear_endpoint_stall(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_device_handle dev = pipe->device;
- usb_device_request_t req;
- usbd_status r;
-
- req.bmRequestType = UT_WRITE_ENDPOINT;
- req.bRequest = UR_CLEAR_FEATURE;
- USETW(req.wValue, UF_ENDPOINT_HALT);
- USETW(req.wIndex, pipe->endpoint->edesc->bEndpointAddress);
- USETW(req.wLength, 0);
- r = usbd_do_request(dev, &req, 0);
-#if 0
-XXX should we do this?
- if (r == USBD_NORMAL_COMPLETION) {
- pipe->state = USBD_PIPE_ACTIVE;
- /* XXX activate pipe */
- }
-#endif
- return (r);
-}
-
-usbd_status
-usbd_clear_endpoint_stall_async(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_device_handle dev = pipe->device;
- usb_device_request_t req;
- usbd_status r;
-
- req.bmRequestType = UT_WRITE_ENDPOINT;
- req.bRequest = UR_CLEAR_FEATURE;
- USETW(req.wValue, UF_ENDPOINT_HALT);
- USETW(req.wIndex, pipe->endpoint->edesc->bEndpointAddress);
- USETW(req.wLength, 0);
- r = usbd_do_request_async(dev, &req, 0);
- return (r);
-}
-
-usbd_status
-usbd_set_pipe_state(pipe, state)
- usbd_pipe_handle pipe;
- usbd_pipe_state state;
-{
- int s;
- usbd_status r;
- usbd_request_handle reqh;
-
- if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
- return (USBD_INTERFACE_NOT_ACTIVE);
- if (state != USBD_PIPE_ACTIVE &&
- state != USBD_PIPE_STALLED &&
- state != USBD_PIPE_IDLE)
- return (USBD_INVAL);
- pipe->state = state;
- r = USBD_NORMAL_COMPLETION;
- if (state == USBD_PIPE_ACTIVE) {
- s = splusb();
- if (!pipe->running) {
- reqh = SIMPLEQ_FIRST(&pipe->queue);
- if (reqh != 0) {
- pipe->running = 1;
- splx(s);
- r = pipe->methods->start(reqh);
- } else
- splx(s);
- } else
- splx(s);
- }
- return (r);
-}
-
-usbd_status
-usbd_get_pipe_state(pipe, state, endpoint_state, request_count)
- usbd_pipe_handle pipe;
- usbd_pipe_state *state;
- u_int32_t *endpoint_state;
- u_int32_t *request_count;
-{
- int n;
- usbd_request_handle r;
-
- *state = pipe->state;
- *endpoint_state = pipe->endpoint->state;
- for (r = SIMPLEQ_FIRST(&pipe->queue), n = 0;
- r != 0;
- r = SIMPLEQ_NEXT(r, next), n++)
- ;
- *request_count = n;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_set_interface_state(iface, state)
- usbd_interface_handle iface;
- usbd_interface_state state;
-{
- int ps;
- usbd_pipe_handle p;
-
- if (state == USBD_INTERFACE_ACTIVE)
- ps = USBD_PIPE_ACTIVE;
- else if (state == USBD_INTERFACE_STALLED)
- ps = USBD_PIPE_STALLED;
- else if (state == USBD_INTERFACE_IDLE)
- ps = USBD_PIPE_IDLE;
- else
- return (USBD_INVAL);
- iface->state = USBD_INTERFACE_ACTIVE; /* to allow setting the pipe */
- for (p = LIST_FIRST(&iface->pipes); p != 0; p = LIST_NEXT(p, next))
- usbd_set_pipe_state(p, ps);
- iface->state = state;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_interface_state(iface, state)
- usbd_interface_handle iface;
- usbd_interface_state *state;
-{
- *state = iface->state;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_device_state(dev, state)
- usbd_device_handle dev;
- usbd_device_state *state;
-{
- *state = dev->state;
- return (USBD_NORMAL_COMPLETION);
-}
-
-#if 0
-usbd_status
-usbd_set_device_state(dev, state)
- usbd_device_handle dev;
- usbd_device_state state;
-X
-#endif
-
-usbd_status
-usbd_device_address(dev, address)
- usbd_device_handle dev;
- u_int8_t *address;
-{
- *address = dev->address;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_endpoint_address(pipe, address)
- usbd_pipe_handle pipe;
- u_int8_t *address;
-{
- *address = pipe->endpoint->edesc->bEndpointAddress;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_endpoint_count(iface, count)
- usbd_interface_handle iface;
- u_int8_t *count;
-{
- *count = iface->idesc->bNumEndpoints;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_interface_count(dev, count)
- usbd_device_handle dev;
- u_int8_t *count;
-{
- if (!dev->cdesc)
- return (USBD_NOT_CONFIGURED);
- *count = dev->cdesc->bNumInterface;
- return (USBD_NORMAL_COMPLETION);
-}
-
-#if 0
-u_int8_t
-usbd_bus_count()
-{
- return (usb_bus_count());
-}
-#endif
-
-#if defined(__NetBSD__)
-usbd_status
-usbd_get_bus_handle(index, bus)
- u_int8_t index;
- usbd_bus_handle *bus;
-{
- return (usb_get_bus_handle(index, bus));
-}
-#endif
-
-usbd_status
-usbd_get_root_hub(bus, dev)
- usbd_bus_handle bus;
- usbd_device_handle *dev;
-{
- *dev = bus->root_hub;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_port_count(dev, nports)
- usbd_device_handle dev;
- u_int8_t *nports;
-{
- if (dev->hub == 0)
- return (USBD_INVAL);
- *nports = dev->hub->hubdesc.bNbrPorts;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_hub2device_handle(dev, port, devp)
- usbd_device_handle dev;
- u_int8_t port;
- usbd_device_handle *devp;
-{
- if (dev->hub == 0 || port >= dev->hub->hubdesc.bNbrPorts ||
- dev->hub->ports[port].device == 0)
- return (USBD_INVAL);
- *devp = dev->hub->ports[port].device;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_request2pipe_handle(reqh, pipe)
- usbd_request_handle reqh;
- usbd_pipe_handle *pipe;
-{
- *pipe = reqh->pipe;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_pipe2interface_handle(pipe, iface)
- usbd_pipe_handle pipe;
- usbd_interface_handle *iface;
-{
- *iface = pipe->iface;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_interface2device_handle(iface, dev)
- usbd_interface_handle iface;
- usbd_device_handle *dev;
-{
- *dev = iface->device;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_device2bus_handle(dev, bus)
- usbd_device_handle dev;
- usbd_bus_handle *bus;
-{
- *bus = dev->bus;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_device2interface_handle(dev, ifaceno, iface)
- usbd_device_handle dev;
- u_int8_t ifaceno;
- usbd_interface_handle *iface;
-{
- if (!dev->cdesc)
- return (USBD_NOT_CONFIGURED);
- if (ifaceno >= dev->cdesc->bNumInterface)
- return (USBD_INVAL);
- *iface = &dev->ifaces[ifaceno];
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_set_interface_private_handle(iface, priv)
- usbd_interface_handle iface;
- usbd_private_handle priv;
-{
- iface->priv = priv;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_interface_private_handle(iface, priv)
- usbd_interface_handle iface;
- usbd_private_handle *priv;
-{
- *priv = iface->priv;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_reference_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- pipe->refcnt++;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_dereference_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- pipe->refcnt--;
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_lock_token
-usbd_lock()
-{
- return (splusb());
-}
-
-void
-usbd_unlock(tok)
- usbd_lock_token tok;
-{
- splx(tok);
-}
-
-/* XXXX use altno */
-usbd_status
-usbd_set_interface(iface, altidx)
- usbd_interface_handle iface;
- int altidx;
-{
- usb_device_request_t req;
- usbd_status r;
-
- if (LIST_FIRST(&iface->pipes) != 0)
- return (USBD_IN_USE);
-
- if (iface->endpoints)
- free(iface->endpoints, M_USB);
- iface->endpoints = 0;
- iface->idesc = 0;
- iface->state = USBD_INTERFACE_IDLE;
-
- r = usbd_fill_iface_data(iface->device, iface->index, altidx);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
-
- req.bmRequestType = UT_WRITE_INTERFACE;
- req.bRequest = UR_SET_INTERFACE;
- USETW(req.wValue, iface->idesc->bAlternateSetting);
- USETW(req.wIndex, iface->idesc->bInterfaceNumber);
- USETW(req.wLength, 0);
- return usbd_do_request(iface->device, &req, 0);
-}
-
-int
-usbd_get_no_alts(cdesc, ifaceno)
- usb_config_descriptor_t *cdesc;
- int ifaceno;
-{
- char *p = (char *)cdesc;
- char *end = p + UGETW(cdesc->wTotalLength);
- usb_interface_descriptor_t *d;
- int n;
-
- for (n = 0; p < end; p += d->bLength) {
- d = (usb_interface_descriptor_t *)p;
- if (p + d->bLength <= end &&
- d->bDescriptorType == UDESC_INTERFACE &&
- d->bInterfaceNumber == ifaceno)
- n++;
- }
- return (n);
-}
-
-int
-usbd_get_interface_altindex(iface)
- usbd_interface_handle iface;
-{
- return (iface->altindex);
-}
-
-usbd_status
-usbd_get_interface(iface, aiface)
- usbd_interface_handle iface;
- u_int8_t *aiface;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_INTERFACE;
- req.bRequest = UR_GET_INTERFACE;
- USETW(req.wValue, 0);
- USETW(req.wIndex, iface->idesc->bInterfaceNumber);
- USETW(req.wLength, 1);
- return usbd_do_request(iface->device, &req, aiface);
-}
-
-/*** Internal routines ***/
-
-/* Dequeue all pipe operations, called at splusb(). */
-static usbd_status
-usbd_ar_pipe(pipe)
- usbd_pipe_handle pipe;
-{
- usbd_request_handle reqh;
-
-#if 0
- for (;;) {
- reqh = SIMPLEQ_FIRST(&pipe->queue);
- if (reqh == 0)
- break;
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
- reqh->status = USBD_CANCELLED;
- if (reqh->callback)
- reqh->callback(reqh, reqh->priv, reqh->status);
- }
-#else
- while ((reqh = SIMPLEQ_FIRST(&pipe->queue))) {
- pipe->methods->abort(reqh);
- SIMPLEQ_REMOVE_HEAD(&pipe->queue, reqh, next);
- }
-#endif
- return (USBD_NORMAL_COMPLETION);
-}
-
-/* Dequeue all interface operations, called at splusb(). */
-static usbd_status
-usbd_ar_iface(iface)
- usbd_interface_handle iface;
-{
- usbd_pipe_handle p;
- usbd_status r, ret = USBD_NORMAL_COMPLETION;
-
- for (p = LIST_FIRST(&iface->pipes); p != 0; p = LIST_NEXT(p, next)) {
- r = usbd_ar_pipe(p);
- if (r != USBD_NORMAL_COMPLETION)
- ret = r;
- }
- return (ret);
-}
-
-static int usbd_global_init_done = 0;
-
-void
-usbd_init()
-{
-#if defined(__FreeBSD__)
- dev_t dev;
-#endif
-
- if (!usbd_global_init_done) {
- usbd_global_init_done = 1;
- SIMPLEQ_INIT(&usbd_free_requests);
-
-#if defined(__FreeBSD__)
- dev = makedev(USB_CDEV_MAJOR, 0);
- cdevsw_add(&dev, &usb_cdevsw, NULL);
-#endif
- }
-}
-
-static void
-usbd_transfer_cb(reqh)
- usbd_request_handle reqh;
-{
- usbd_pipe_handle pipe = reqh->pipe;
-
- /* Count completed transfers. */
- ++pipe->device->bus->stats.requests
- [pipe->endpoint->edesc->bmAttributes & UE_XFERTYPE];
-
- /* XXX check retry count */
- reqh->done = 1;
- if (reqh->status == USBD_NORMAL_COMPLETION &&
- reqh->actlen < reqh->length &&
- !(reqh->flags & USBD_SHORT_XFER_OK)) {
- DPRINTFN(-1, ("usbd_transfer_cb: short xfer %d<%d (bytes)\n",
- reqh->actlen, reqh->length));
- reqh->status = USBD_SHORT_XFER;
- }
- if (reqh->callback)
- reqh->callback(reqh, reqh->priv, reqh->status);
-}
-
-static void
-usbd_sync_transfer_cb(reqh)
- usbd_request_handle reqh;
-{
- usbd_transfer_cb(reqh);
- if (!reqh->pipe->device->bus->use_polling)
- wakeup(reqh);
-}
-
-/* Like usbd_transfer(), but waits for completion. */
-usbd_status
-usbd_sync_transfer(reqh)
- usbd_request_handle reqh;
-{
- usbd_status r;
- int s;
-
- reqh->xfercb = usbd_sync_transfer_cb;
- r = usbd_do_transfer(reqh);
- if (r != USBD_IN_PROGRESS)
- return (r);
- s = splusb();
- if (!reqh->done) {
- if (reqh->pipe->device->bus->use_polling)
- panic("usbd_sync_transfer: not done\n");
- tsleep(reqh, PRIBIO, "usbsyn", 0);
- }
- splx(s);
- return (reqh->status);
-}
-
-usbd_status
-usbd_do_request(dev, req, data)
- usbd_device_handle dev;
- usb_device_request_t *req;
- void *data;
-{
- return (usbd_do_request_flags(dev, req, data, 0, 0));
-}
-
-usbd_status
-usbd_do_request_flags(dev, req, data, flags, actlen)
- usbd_device_handle dev;
- usb_device_request_t *req;
- void *data;
- u_int16_t flags;
- int *actlen;
-{
- usbd_request_handle reqh;
- usbd_status r;
-
-#ifdef DIAGNOSTIC
- if (!curproc) {
- printf("usbd_do_request: not in process context\n");
- return (USBD_XXX);
- }
-#endif
-
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (USBD_NOMEM);
- r = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, req, data,
- UGETW(req->wLength), flags, 0);
- if (r != USBD_NORMAL_COMPLETION)
- goto bad;
- r = usbd_sync_transfer(reqh);
-#if defined(USB_DEBUG) || defined(DIAGNOSTIC)
- if (reqh->actlen > reqh->length)
- printf("usbd_do_request: overrun addr=%d type=0x%02x req=0x"
- "%02x val=%d index=%d rlen=%d length=%d actlen=%d\n",
- dev->address, reqh->request.bmRequestType,
- reqh->request.bRequest, UGETW(reqh->request.wValue),
- UGETW(reqh->request.wIndex),
- UGETW(reqh->request.wLength),
- reqh->length, reqh->actlen);
-#endif
- if (actlen)
- *actlen = reqh->actlen;
- if (r == USBD_STALLED) {
- /*
- * The control endpoint has stalled. Control endpoints
- * should not halt, but some may do so anyway so clear
- * any halt condition.
- */
- usb_device_request_t treq;
- usb_status_t status;
- u_int16_t s;
- usbd_status nr;
-
- treq.bmRequestType = UT_READ_ENDPOINT;
- treq.bRequest = UR_GET_STATUS;
- USETW(treq.wValue, 0);
- USETW(treq.wIndex, 0);
- USETW(treq.wLength, sizeof(usb_status_t));
- nr = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, &treq, &status,
- sizeof(usb_status_t), 0, 0);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- nr = usbd_sync_transfer(reqh);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- s = UGETW(status.wStatus);
- DPRINTF(("usbd_do_request: status = 0x%04x\n", s));
- if (!(s & UES_HALT))
- goto bad;
- treq.bmRequestType = UT_WRITE_ENDPOINT;
- treq.bRequest = UR_CLEAR_FEATURE;
- USETW(treq.wValue, UF_ENDPOINT_HALT);
- USETW(treq.wIndex, 0);
- USETW(treq.wLength, 0);
- nr = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, &treq, &status,
- 0, 0, 0);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- nr = usbd_sync_transfer(reqh);
- if (nr != USBD_NORMAL_COMPLETION)
- goto bad;
- }
-
- bad:
- usbd_free_request(reqh);
- return (r);
-}
-
-void
-usbd_do_request_async_cb(reqh, priv, status)
- usbd_request_handle reqh;
- usbd_private_handle priv;
- usbd_status status;
-{
-#if defined(USB_DEBUG) || defined(DIAGNOSTIC)
- if (reqh->actlen > reqh->length)
- printf("usbd_do_request: overrun addr=%d type=0x%02x req=0x"
- "%02x val=%d index=%d rlen=%d length=%d actlen=%d\n",
- reqh->pipe->device->address,
- reqh->request.bmRequestType,
- reqh->request.bRequest, UGETW(reqh->request.wValue),
- UGETW(reqh->request.wIndex),
- UGETW(reqh->request.wLength),
- reqh->length, reqh->actlen);
-#endif
- usbd_free_request(reqh);
-}
-
-/*
- * Execute a request without waiting for completion.
- * Can be used from interrupt context.
- */
-usbd_status
-usbd_do_request_async(dev, req, data)
- usbd_device_handle dev;
- usb_device_request_t *req;
- void *data;
-{
- usbd_request_handle reqh;
- usbd_status r;
-
- reqh = usbd_alloc_request();
- if (reqh == 0)
- return (USBD_NOMEM);
- r = usbd_setup_default_request(
- reqh, dev, 0, USBD_DEFAULT_TIMEOUT, req, data,
- UGETW(req->wLength), 0, usbd_do_request_async_cb);
- if (r != USBD_NORMAL_COMPLETION) {
- usbd_free_request(reqh);
- return (r);
- }
- r = usbd_transfer(reqh);
- if (r != USBD_IN_PROGRESS)
- return (r);
- return (USBD_NORMAL_COMPLETION);
-}
-
-struct usbd_quirks *
-usbd_get_quirks(dev)
- usbd_device_handle dev;
-{
- return (dev->quirks);
-}
-
-void
-usbd_set_disco(p, hdl, data)
- usbd_pipe_handle p;
- void (*hdl) __P((void *));
- void *data;
-{
- p->disco = hdl;
- p->discoarg = data;
-}
-
-/* XXX do periodic free() of free list */
-
-/*
- * Called from keyboard driver when in polling mode.
- */
-void
-usbd_dopoll(iface)
- usbd_interface_handle iface;
-{
- iface->device->bus->do_poll(iface->device->bus);
-}
-
-void
-usbd_set_polling(iface, on)
- usbd_interface_handle iface;
- int on;
-{
- iface->device->bus->use_polling = on;
-}
-
-
-usb_endpoint_descriptor_t *
-usbd_get_endpoint_descriptor(iface, address)
- usbd_interface_handle iface;
- u_int8_t address;
-{
- struct usbd_endpoint *ep;
- int i;
-
- for (i = 0; i < iface->idesc->bNumEndpoints; i++) {
- ep = &iface->endpoints[i];
- if (ep->edesc->bEndpointAddress == address)
- return (iface->endpoints[i].edesc);
- }
- return (0);
-}
-
-#if defined(__FreeBSD__)
-void
-usbd_print_child(device_t parent, device_t child)
-{
- /*
- struct usb_softc *sc = device_get_softc(child);
- */
-
- printf(" at %s%d", device_get_name(parent), device_get_unit(parent));
-
- /* XXX How do we get to the usbd_device_handle???
- usbd_device_handle dev = invalidadosch;
-
- printf(" addr %d", dev->addr);
-
- if (bootverbose) {
- if (dev->lowspeed)
- printf(", lowspeed");
- if (dev->self_powered)
- printf(", self powered");
- else
- printf(", %dmA", dev->power);
- printf(", config %d", dev->config);
- }
- */
-}
-
-/* Reconfigure all the USB busses in the system. */
-int
-usbd_driver_load(module_t mod, int what, void *arg)
-{
- devclass_t usb_devclass = devclass_find("usb");
- devclass_t ugen_devclass = devclass_find("ugen");
- device_t *devlist;
- int devcount;
- int error;
-
- switch (what) {
- case MOD_LOAD:
- case MOD_UNLOAD:
- if (!usb_devclass)
- return 0; /* just ignore call */
-
- if (ugen_devclass) {
- /* detach devices from generic driver if possible */
- error = devclass_get_devices(ugen_devclass, &devlist,
- &devcount);
- if (!error)
- for (devcount--; devcount >= 0; devcount--)
- (void)DEVICE_DETACH(devlist[devcount]);
- }
-
- error = devclass_get_devices(usb_devclass, &devlist, &devcount);
- if (error)
- return 0; /* XXX maybe transient, or error? */
-
- for (devcount--; devcount >= 0; devcount--)
- USB_RECONFIGURE(devlist[devcount]);
-
- free(devlist, M_TEMP);
- return 0;
- }
-
- return 0; /* nothing to do by us */
-}
-
-/* Set the description of the device including a malloc and copy. */
-void
-usbd_device_set_desc(device_t device, char *devinfo)
-{
- size_t l;
- char *desc;
-
- if ( devinfo ) {
- l = strlen(devinfo);
- desc = malloc(l+1, M_USB, M_NOWAIT);
- if (desc)
- memcpy(desc, devinfo, l+1);
- } else
- desc = NULL;
-
- device_set_desc(device, desc);
-}
-
-char *
-usbd_devname(bdevice *bdev)
-{
- static char buf[20];
- /* XXX a static buffer is not exactly a good idea, but the only
- * thing that goes wrong is the string that is being printed
- */
-
- sprintf(buf, "%s%d", device_get_name(*bdev), device_get_unit(*bdev));
- return (buf);
-}
-
-#endif
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
deleted file mode 100644
index 88db91f8cb006..0000000000000
--- a/sys/dev/usb/usbdi.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/* $NetBSD: usbdi.h,v 1.16 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdi.h,v 1.4 1999/01/07 23:31:43 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-typedef struct usbd_bus *usbd_bus_handle;
-typedef struct usbd_device *usbd_device_handle;
-typedef struct usbd_interface *usbd_interface_handle;
-typedef struct usbd_pipe *usbd_pipe_handle;
-typedef struct usbd_request *usbd_request_handle;
-typedef void *usbd_private_handle;
-
-typedef enum {
- USBD_ENDPOINT_ACTIVE,
- USBD_ENDPOINT_STALLED,
-} usbd_endpoint_state;
-
-typedef enum {
- USBD_PIPE_ACTIVE,
- USBD_PIPE_STALLED,
- USBD_PIPE_IDLE,
-} usbd_pipe_state;
-
-typedef enum {
- USBD_INTERFACE_ACTIVE,
- USBD_INTERFACE_STALLED,
- USBD_INTERFACE_IDLE,
-} usbd_interface_state;
-
-typedef enum {
- USBD_DEVICE_ATTACHED,
- USBD_DEVICE_POWERED,
- USBD_DEVICE_DEFAULT,
- USBD_DEVICE_ADDRESSED,
- USBD_DEVICE_CONFIGURED,
- USBD_DEVICE_SUSPENDED,
-} usbd_device_state;
-
-typedef enum {
- USBD_NORMAL_COMPLETION = 0,
- USBD_IN_PROGRESS,
- /* errors */
- USBD_PENDING_REQUESTS,
- USBD_NOT_STARTED,
- USBD_INVAL,
- USBD_IS_IDLE,
- USBD_NOMEM,
- USBD_CANCELLED,
- USBD_BAD_ADDRESS,
- USBD_IN_USE,
- USBD_INTERFACE_NOT_ACTIVE,
- USBD_NO_ADDR,
- USBD_SET_ADDR_FAILED,
- USBD_NO_POWER,
- USBD_TOO_DEEP,
- USBD_IOERROR,
- USBD_NOT_CONFIGURED,
- USBD_TIMEOUT,
- USBD_SHORT_XFER,
- USBD_STALLED,
- USBD_INTERRUPTED,
-
- USBD_XXX,
-} usbd_status;
-
-typedef int usbd_lock_token;
-
-typedef void (*usbd_callback) __P((usbd_request_handle, usbd_private_handle,
- usbd_status));
-
-/* Open flags */
-#define USBD_EXCLUSIVE_USE 0x01
-
-/* Request flags */
-#define USBD_XFER_OUT 0x01
-#define USBD_XFER_IN 0x02
-#define USBD_SHORT_XFER_OK 0x04
-
-#define USBD_NO_TIMEOUT 0
-#define USBD_DEFAULT_TIMEOUT 5000 /* ms = 5 s */
-
-usbd_status usbd_open_pipe
- __P((usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe));
-usbd_status usbd_close_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_transfer __P((usbd_request_handle req));
-usbd_request_handle usbd_alloc_request __P((void));
-usbd_status usbd_free_request __P((usbd_request_handle reqh));
-usbd_status usbd_setup_request
- __P((usbd_request_handle reqh, usbd_pipe_handle pipe,
- usbd_private_handle priv, void *buffer,
- u_int32_t length, u_int16_t flags, u_int32_t timeout,
- usbd_callback));
-usbd_status usbd_setup_device_request
- __P((usbd_request_handle reqh, usb_device_request_t *req));
-usbd_status usbd_setup_default_request
- __P((usbd_request_handle reqh, usbd_device_handle dev,
- usbd_private_handle priv, u_int32_t timeout,
- usb_device_request_t *req, void *buffer,
- u_int32_t length, u_int16_t flags, usbd_callback));
-usbd_status usbd_set_request_timeout
- __P((usbd_request_handle reqh, u_int32_t timeout));
-usbd_status usbd_get_request_status
- __P((usbd_request_handle reqh, usbd_private_handle *priv,
- void **buffer, u_int32_t *count, usbd_status *status));
-usbd_status usbd_request_device_data
- __P((usbd_request_handle reqh, usb_device_request_t *req));
-usb_descriptor_t *usbd_get_descriptor
- __P((usbd_interface_handle *iface, u_int8_t desc_type));
-usb_endpoint_descriptor_t *usbd_interface2endpoint_descriptor
- __P((usbd_interface_handle iface, u_int8_t address));
-usbd_status usbd_set_configuration
- __P((usbd_device_handle dev, u_int8_t conf));
-usbd_status usbd_retry_request
- __P((usbd_request_handle reqh, u_int32_t retry_count));
-usbd_status usbd_abort_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_abort_interface __P((usbd_interface_handle iface));
-usbd_status usbd_reset_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_reset_interface __P((usbd_interface_handle iface));
-usbd_status usbd_clear_endpoint_stall __P((usbd_pipe_handle pipe));
-usbd_status usbd_clear_endpoint_stall_async __P((usbd_pipe_handle pipe));
-usbd_status usbd_set_pipe_state
- __P((usbd_pipe_handle pipe, usbd_pipe_state state));
-usbd_status usbd_get_pipe_state
- __P((usbd_pipe_handle pipe, usbd_pipe_state *state,
- u_int32_t *endpoint_state, u_int32_t *request_count));
-usbd_status usbd_set_interface_state
- __P((usbd_interface_handle iface, usbd_interface_state state));
-usbd_status usbd_get_interface_state
- __P((usbd_interface_handle iface, usbd_interface_state *state));
-usbd_status usbd_get_device_state
- __P((usbd_device_handle dev, usbd_device_state *state));
-usbd_status usbd_set_device_state
- __P((usbd_device_handle dev, usbd_device_state state));
-usbd_status usbd_device_address
- __P((usbd_device_handle dev, u_int8_t *address));
-usbd_status usbd_endpoint_address
- __P((usbd_pipe_handle dev, u_int8_t *address));
-usbd_status usbd_endpoint_count
- __P((usbd_interface_handle dev, u_int8_t *count));
-usbd_status usbd_interface_count
- __P((usbd_device_handle dev, u_int8_t *count));
-#if 0
-u_int8_t usbd_bus_count __P((void));
-#endif
-usbd_status usbd_get_bus_handle __P((u_int8_t index, usbd_bus_handle *bus));
-usbd_status usbd_get_root_hub
- __P((usbd_bus_handle bus, usbd_device_handle *dev));
-usbd_status usbd_port_count __P((usbd_device_handle hub, u_int8_t *nports));
-usbd_status usbd_hub2device_handle
- __P((usbd_device_handle hub, u_int8_t port, usbd_device_handle *dev));
-usbd_status usbd_request2pipe_handle
- __P((usbd_request_handle reqh, usbd_pipe_handle *pipe));
-usbd_status usbd_pipe2interface_handle
- __P((usbd_pipe_handle pipe, usbd_interface_handle *iface));
-usbd_status usbd_interface2device_handle
- __P((usbd_interface_handle iface, usbd_device_handle *dev));
-usbd_status usbd_device2bus_handle
- __P((usbd_device_handle dev, usbd_bus_handle *bus));
-usbd_status usbd_device2interface_handle
- __P((usbd_device_handle dev, u_int8_t ifaceno,
- usbd_interface_handle *iface));
-usbd_status usbd_set_interface_private_handle
- __P((usbd_interface_handle iface, usbd_private_handle priv));
-usbd_status usbd_get_interface_private_handle
- __P((usbd_interface_handle iface, usbd_private_handle *priv));
-usbd_status usbd_reference_pipe __P((usbd_pipe_handle pipe));
-usbd_status usbd_dereference_pipe __P((usbd_pipe_handle pipe));
-usbd_lock_token usbd_lock __P((void));
-void usbd_unlock __P((usbd_lock_token tok));
-
-/* Non-standard */
-usbd_status usbd_sync_transfer __P((usbd_request_handle req));
-usbd_status usbd_open_pipe_intr
- __P((usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe,
- usbd_private_handle priv, void *buffer,
- u_int32_t length, usbd_callback));
-usbd_status usbd_open_pipe_iso
- __P((usbd_interface_handle iface, u_int8_t address,
- u_int8_t flags, usbd_pipe_handle *pipe,
- usbd_private_handle priv, u_int32_t bufsize, u_int32_t nbuf,
- usbd_callback));
-usbd_status usbd_do_request
- __P((usbd_device_handle pipe, usb_device_request_t *req, void *data));
-usbd_status usbd_do_request_async
- __P((usbd_device_handle pipe, usb_device_request_t *req, void *data));
-usbd_status usbd_do_request_flags
- __P((usbd_device_handle pipe, usb_device_request_t *req,
- void *data, u_int16_t flags, int *));
-usb_interface_descriptor_t *usbd_get_interface_descriptor
- __P((usbd_interface_handle iface));
-usb_config_descriptor_t *usbd_get_config_descriptor
- __P((usbd_device_handle dev));
-usb_device_descriptor_t *usbd_get_device_descriptor
- __P((usbd_device_handle dev));
-usbd_status usbd_set_interface __P((usbd_interface_handle, int));
-int usbd_get_no_alts __P((usb_config_descriptor_t *, int));
-usbd_status usbd_get_interface
- __P((usbd_interface_handle iface, u_int8_t *aiface));
-void usbd_fill_deviceinfo
- __P((usbd_device_handle dev, struct usb_device_info *di));
-int usbd_get_interface_altindex __P((usbd_interface_handle iface));
-
-usb_interface_descriptor_t *usbd_find_idesc
- __P((usb_config_descriptor_t *cd, int iindex, int ano));
-usb_endpoint_descriptor_t *usbd_find_edesc
- __P((usb_config_descriptor_t *cd, int ifaceidx, int altidx,
- int endptidx));
-
-void usbd_dopoll __P((usbd_interface_handle));
-void usbd_set_polling __P((usbd_interface_handle iface, int on));
-
-/* NetBSD attachment information */
-
-/* Attach data */
-struct usb_attach_arg {
- int port;
- int configno;
- int ifaceno;
- usbd_device_handle device; /* current device */
- usbd_interface_handle iface; /* current interface */
- int usegeneric;
- usbd_interface_handle *ifaces; /* all interfaces */
- int nifaces; /* number of interfaces */
-};
-
-#if defined(__NetBSD__)
-/* Match codes. */
-/* First five codes is for a whole device. */
-#define UMATCH_VENDOR_PRODUCT_REV 14
-#define UMATCH_VENDOR_PRODUCT 13
-#define UMATCH_VENDOR_DEVCLASS_DEVPROTO 12
-#define UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO 11
-#define UMATCH_DEVCLASS_DEVSUBCLASS 10
-/* Next six codes are for interfaces. */
-#define UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE 9
-#define UMATCH_VENDOR_PRODUCT_CONF_IFACE 8
-#define UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO 7
-#define UMATCH_VENDOR_IFACESUBCLASS 6
-#define UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO 5
-#define UMATCH_IFACECLASS_IFACESUBCLASS 4
-#define UMATCH_IFACECLASS 3
-#define UMATCH_IFACECLASS_GENERIC 2
-/* Generic driver */
-#define UMATCH_GENERIC 1
-/* No match */
-#define UMATCH_NONE 0
-
-#elif defined(__FreeBSD__)
-/* FreeBSD needs values less than zero */
-/* for the moment disabled
-#define UMATCH_VENDOR_PRODUCT_REV -14
-#define UMATCH_VENDOR_PRODUCT -13
-#define UMATCH_VENDOR_DEVCLASS_DEVPROTO -12
-#define UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO -11
-#define UMATCH_DEVCLASS_DEVSUBCLASS -10
-#define UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE -9
-#define UMATCH_VENDOR_PRODUCT_CONF_IFACE -8
-#define UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO -7
-#define UMATCH_VENDOR_IFACESUBCLASS -6
-#define UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO -5
-#define UMATCH_IFACECLASS_IFACESUBCLASS -4
-#define UMATCH_IFACECLASS -3
-#define UMATCH_IFACECLASS_GENERIC -2
-#define UMATCH_GENERIC -1
-#define UMATCH_NONE ENXIO
-
-* For the moment we use Yes/No answers with appropriate
-* sorting in the config file
-*/
-#define UMATCH_VENDOR_PRODUCT_REV 0
-#define UMATCH_VENDOR_PRODUCT 0
-#define UMATCH_VENDOR_DEVCLASS_DEVPROTO 0
-#define UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO 0
-#define UMATCH_DEVCLASS_DEVSUBCLASS 0
-#define UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE 0
-#define UMATCH_VENDOR_PRODUCT_CONF_IFACE 0
-#define UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO 0
-#define UMATCH_VENDOR_IFACESUBCLASS 0
-#define UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO 0
-#define UMATCH_IFACECLASS_IFACESUBCLASS 0
-#define UMATCH_IFACECLASS 0
-#define UMATCH_IFACECLASS_GENERIC 0
-#define UMATCH_GENERIC 0
-#define UMATCH_NONE ENXIO
-
-
-#endif
-
-void usbd_devinfo __P((usbd_device_handle, int, char *));
-struct usbd_quirks *usbd_get_quirks __P((usbd_device_handle));
-void usbd_set_disco __P((usbd_pipe_handle, void (*)(void *), void *));
-usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor
- __P((usbd_interface_handle iface, u_int8_t address));
-
-#if defined(__FreeBSD__)
-int usbd_driver_load __P((module_t mod, int what, void *arg));
-void usbd_device_set_desc __P((device_t device, char *devinfo));
-char *usbd_devname(bdevice *bdev);
-bus_print_child_t usbd_print_child;
-#endif
-
-/* XXX */
-#define splusb splbio
-#define IPL_USB IPL_BIO
-/* XXX */
-
diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c
deleted file mode 100644
index fbb7a809ef40f..0000000000000
--- a/sys/dev/usb/usbdi_util.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/* $NetBSD: usbdi_util.c,v 1.13 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdi_util.c,v 1.5 1999/01/07 23:31:43 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/proc.h>
-#if defined(__FreeBSD__)
-#include <sys/bus.h>
-#endif
-
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-
-#ifdef USB_DEBUG
-#define DPRINTF(x) if (usbdebug) printf x
-#define DPRINTFN(n,x) if (usbdebug>(n)) printf x
-extern int usbdebug;
-#else
-#define DPRINTF(x)
-#define DPRINTFN(n,x)
-#endif
-
-usbd_status
-usbd_get_desc(dev, type, index, len, desc)
- usbd_device_handle dev;
- int type, index;
- int len;
- void *desc;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW2(req.wValue, type, index);
- USETW(req.wIndex, 0);
- USETW(req.wLength, len);
- return (usbd_do_request(dev, &req, desc));
-}
-
-usbd_status
-usbd_get_config_desc(dev, conf, d)
- usbd_device_handle dev;
- int conf;
- usb_config_descriptor_t *d;
-{
- usbd_status r;
-
- DPRINTFN(3,("usbd_get_config_desc: conf=%d\n", conf));
- r = usbd_get_desc(dev, UDESC_CONFIG, conf,
- USB_CONFIG_DESCRIPTOR_SIZE, d);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (d->bDescriptorType != UDESC_CONFIG) {
- DPRINTFN(-1,("usbd_get_config_desc: conf %d, bad desc %d\n",
- conf, d->bDescriptorType));
- return (USBD_INVAL);
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_config_desc_full(dev, conf, d, size)
- usbd_device_handle dev;
- int conf;
- void *d;
- int size;
-{
- DPRINTFN(3,("usbd_get_config_desc_full: conf=%d\n", conf));
- return (usbd_get_desc(dev, UDESC_CONFIG, conf, size, d));
-}
-
-usbd_status
-usbd_get_device_desc(dev, d)
- usbd_device_handle dev;
- usb_device_descriptor_t *d;
-{
- DPRINTFN(3,("usbd_get_device_desc:\n"));
- return (usbd_get_desc(dev, UDESC_DEVICE,
- 0, USB_DEVICE_DESCRIPTOR_SIZE, d));
-}
-
-usbd_status
-usbd_get_device_status(dev, st)
- usbd_device_handle dev;
- usb_status_t *st;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, sizeof(usb_status_t));
- return (usbd_do_request(dev, &req, st));
-}
-
-usbd_status
-usbd_get_hub_status(dev, st)
- usbd_device_handle dev;
- usb_hub_status_t *st;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_CLASS_DEVICE;
- req.bRequest = UR_GET_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, sizeof(usb_hub_status_t));
- return (usbd_do_request(dev, &req, st));
-}
-
-usbd_status
-usbd_set_address(dev, addr)
- usbd_device_handle dev;
- int addr;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_DEVICE;
- req.bRequest = UR_SET_ADDRESS;
- USETW(req.wValue, addr);
- USETW(req.wIndex, 0);
- USETW(req.wLength, 0);
- return usbd_do_request(dev, &req, 0);
-}
-
-usbd_status
-usbd_get_port_status(dev, port, ps)
- usbd_device_handle dev;
- int port;
- usb_port_status_t *ps;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_CLASS_OTHER;
- req.bRequest = UR_GET_STATUS;
- USETW(req.wValue, 0);
- USETW(req.wIndex, port);
- USETW(req.wLength, sizeof *ps);
- return (usbd_do_request(dev, &req, ps));
-}
-
-usbd_status
-usbd_clear_port_feature(dev, port, sel)
- usbd_device_handle dev;
- int port, sel;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_CLEAR_FEATURE;
- USETW(req.wValue, sel);
- USETW(req.wIndex, port);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_set_port_feature(dev, port, sel)
- usbd_device_handle dev;
- int port, sel;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_WRITE_CLASS_OTHER;
- req.bRequest = UR_SET_FEATURE;
- USETW(req.wValue, sel);
- USETW(req.wIndex, port);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-
-usbd_status
-usbd_set_protocol(iface, report)
- usbd_interface_handle iface;
- int report;
-{
- usb_interface_descriptor_t *id = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_protocol: iface=%p, report=%d, endpt=%d\n",
- iface, report, id->bInterfaceNumber));
- if (!id)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!id)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_PROTOCOL;
- USETW(req.wValue, report);
- USETW(req.wIndex, id->bInterfaceNumber);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_set_report(iface, type, id, data, len)
- usbd_interface_handle iface;
- int type;
- int id;
- void *data;
- int len;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_report: len=%d\n", len));
- if (!ifd)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_REPORT;
- USETW2(req.wValue, type, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, len);
- return (usbd_do_request(dev, &req, data));
-}
-
-usbd_status
-usbd_set_report_async(iface, type, id, data, len)
- usbd_interface_handle iface;
- int type;
- int id;
- void *data;
- int len;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_report_async: len=%d\n", len));
- if (!ifd)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_REPORT;
- USETW2(req.wValue, type, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, len);
- return (usbd_do_request_async(dev, &req, data));
-}
-
-usbd_status
-usbd_get_report(iface, type, id, data, len)
- usbd_interface_handle iface;
- int type;
- int id;
- void *data;
- int len;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_report: len=%d\n", len));
- if (!id)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_READ_CLASS_INTERFACE;
- req.bRequest = UR_GET_REPORT;
- USETW2(req.wValue, type, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, len);
- return (usbd_do_request(dev, &req, data));
-}
-
-usbd_status
-usbd_set_idle(iface, duration, id)
- usbd_interface_handle iface;
- int duration;
- int id;
-{
- usb_interface_descriptor_t *ifd = usbd_get_interface_descriptor(iface);
- usbd_device_handle dev;
- usb_device_request_t req;
- usbd_status r;
-
- DPRINTFN(4, ("usbd_set_idle: %d %d\n", duration, id));
- if (!ifd)
- return (USBD_IOERROR);
- r = usbd_interface2device_handle(iface, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- if (!ifd)
- return (USBD_INVAL);
- req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
- req.bRequest = UR_SET_IDLE;
- USETW2(req.wValue, duration, id);
- USETW(req.wIndex, ifd->bInterfaceNumber);
- USETW(req.wLength, 0);
- return (usbd_do_request(dev, &req, 0));
-}
-
-usbd_status
-usbd_get_report_descriptor(dev, ifcno, repid, size, d)
- usbd_device_handle dev;
- int ifcno;
- int repid;
- int size;
- void *d;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_INTERFACE;
- req.bRequest = UR_GET_DESCRIPTOR;
- USETW2(req.wValue, UDESC_REPORT, repid);
- USETW(req.wIndex, ifcno);
- USETW(req.wLength, size);
- return (usbd_do_request(dev, &req, d));
-}
-
-usb_hid_descriptor_t *
-usbd_get_hid_descriptor(ifc)
- usbd_interface_handle ifc;
-{
- usb_interface_descriptor_t *idesc = usbd_get_interface_descriptor(ifc);
- usbd_device_handle dev;
- usb_config_descriptor_t *cdesc;
- usb_hid_descriptor_t *hd;
- char *p, *end;
- usbd_status r;
-
- if (!idesc)
- return (0);
- r = usbd_interface2device_handle(ifc, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (0);
- cdesc = usbd_get_config_descriptor(dev);
-
- p = (char *)idesc + idesc->bLength;
- end = (char *)cdesc + UGETW(cdesc->wTotalLength);
-
- for (; p < end; p += hd->bLength) {
- hd = (usb_hid_descriptor_t *)p;
- if (p + hd->bLength <= end && hd->bDescriptorType == UDESC_HID)
- return (hd);
- if (hd->bDescriptorType == UDESC_INTERFACE)
- break;
- }
- return (0);
-}
-
-usbd_status
-usbd_alloc_report_desc(ifc, descp, sizep, mem)
- usbd_interface_handle ifc;
- void **descp;
- int *sizep;
-#if defined(__NetBSD__)
- int mem;
-#elif defined(__FreeBSD__)
- struct malloc_type *mem;
-#endif
-
-{
- usb_interface_descriptor_t *id;
- usb_hid_descriptor_t *hid;
- usbd_device_handle dev;
- usbd_status r;
-
- r = usbd_interface2device_handle(ifc, &dev);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- id = usbd_get_interface_descriptor(ifc);
- if (!id)
- return (USBD_INVAL);
- hid = usbd_get_hid_descriptor(ifc);
- if (!hid)
- return (USBD_IOERROR);
- *sizep = UGETW(hid->descrs[0].wDescriptorLength);
- *descp = malloc(*sizep, mem, M_NOWAIT);
- if (!*descp)
- return (USBD_NOMEM);
- /* XXX should not use 0 Report ID */
- r = usbd_get_report_descriptor(dev, id->bInterfaceNumber, 0,
- *sizep, *descp);
- if (r != USBD_NORMAL_COMPLETION) {
- free(*descp, mem);
- return (r);
- }
- return (USBD_NORMAL_COMPLETION);
-}
-
-usbd_status
-usbd_get_config(dev, conf)
- usbd_device_handle dev;
- u_int8_t *conf;
-{
- usb_device_request_t req;
-
- req.bmRequestType = UT_READ_DEVICE;
- req.bRequest = UR_GET_CONFIG;
- USETW(req.wValue, 0);
- USETW(req.wIndex, 0);
- USETW(req.wLength, 1);
- return (usbd_do_request(dev, &req, conf));
-}
-
-static void usbd_bulk_transfer_cb __P((usbd_request_handle reqh,
- usbd_private_handle priv, usbd_status status));
-static void
-usbd_bulk_transfer_cb(reqh, priv, status)
- usbd_request_handle reqh;
- usbd_private_handle priv;
- usbd_status status;
-{
- wakeup(reqh);
-}
-
-usbd_status
-usbd_bulk_transfer(reqh, pipe, flags, buf, size, lbl)
- usbd_request_handle reqh;
- usbd_pipe_handle pipe;
- u_int16_t flags;
- void *buf;
- u_int32_t *size;
- char *lbl;
-{
- usbd_private_handle priv;
- void *buffer;
- usbd_status r;
- int s, error;
-
- r = usbd_setup_request(reqh, pipe, 0, buf, *size,
- flags, USBD_NO_TIMEOUT, usbd_bulk_transfer_cb);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
- DPRINTFN(1, ("usbd_bulk_transfer: start transfer %d bytes\n", *size));
- s = splusb(); /* don't want callback until tsleep() */
- r = usbd_transfer(reqh);
- if (r != USBD_IN_PROGRESS) {
- splx(s);
- return (r);
- }
- error = tsleep((caddr_t)reqh, PZERO | PCATCH, lbl, 0);
- splx(s);
- if (error) {
- usbd_abort_pipe(pipe);
- return (USBD_INTERRUPTED);
- }
- usbd_get_request_status(reqh, &priv, &buffer, size, &r);
- DPRINTFN(1,("usbd_bulk_transfer: transferred %d\n", *size));
- if (r != USBD_NORMAL_COMPLETION) {
- DPRINTF(("usbd_bulk_transfer: error=%d\n", r));
- usbd_clear_endpoint_stall(pipe);
- }
- return (r);
-}
-
diff --git a/sys/dev/usb/usbdi_util.h b/sys/dev/usb/usbdi_util.h
deleted file mode 100644
index f5d700d1d91ce..0000000000000
--- a/sys/dev/usb/usbdi_util.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $NetBSD: usbdi_util.h,v 1.12 1999/01/01 15:25:57 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-usbd_status usbd_get_desc __P((usbd_device_handle dev, int type,
- int index, int len, void *desc));
-usbd_status usbd_get_config_desc __P((usbd_device_handle, int,
- usb_config_descriptor_t *));
-usbd_status usbd_get_config_desc_full __P((usbd_device_handle, int,
- void *, int));
-usbd_status usbd_get_device_desc __P((usbd_device_handle dev,
- usb_device_descriptor_t *d));
-usbd_status usbd_set_address __P((usbd_device_handle dev, int addr));
-usbd_status usbd_get_port_status __P((usbd_device_handle,
- int, usb_port_status_t *));
-usbd_status usbd_set_port_feature __P((usbd_device_handle dev, int, int));
-usbd_status usbd_clear_port_feature __P((usbd_device_handle, int, int));
-usbd_status usbd_get_device_status __P((usbd_device_handle,usb_status_t*));
-usbd_status usbd_get_hub_status __P((usbd_device_handle dev,
- usb_hub_status_t *st));
-usbd_status usbd_set_protocol __P((usbd_interface_handle dev, int report));
-usbd_status usbd_get_report_descriptor
- __P((usbd_device_handle dev, int ifcno, int repid, int size, void *d));
-struct usb_hid_descriptor *usbd_get_hid_descriptor
- __P((usbd_interface_handle ifc));
-usbd_status usbd_set_report
- __P((usbd_interface_handle iface,int type,int id,void *data,int len));
-usbd_status usbd_set_report_async
- __P((usbd_interface_handle iface,int type,int id,void *data,int len));
-usbd_status usbd_get_report
- __P((usbd_interface_handle iface,int type,int id,void *data,int len));
-usbd_status usbd_set_idle
- __P((usbd_interface_handle iface, int duration, int id));
-#if defined(__NetBSD__)
-usbd_status usbd_alloc_report_desc
- __P((usbd_interface_handle ifc, void **descp, int *sizep, int mem));
-#elif defined(__FreeBSD__)
-usbd_status usbd_alloc_report_desc
- __P((usbd_interface_handle ifc, void **descp, int *sizep, struct malloc_type * mem));
-#endif
-usbd_status usbd_get_config
- __P((usbd_device_handle dev, u_int8_t *conf));
-usbd_status usbd_get_string_desc
- __P((usbd_device_handle dev, int sindex, int langid,
- usb_string_descriptor_t *sdesc));
-void usbd_delay_ms __P((usbd_device_handle, u_int));
-
-
-usbd_status usbd_set_config_no
- __P((usbd_device_handle dev, int no, int msg));
-usbd_status usbd_set_config_index
- __P((usbd_device_handle dev, int index, int msg));
-
-usbd_status usbd_bulk_transfer
- __P((usbd_request_handle reqh, usbd_pipe_handle pipe, u_int16_t flags,
- void *buf, u_int32_t *size, char *lbl));
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
deleted file mode 100644
index 7c89b777e3d03..0000000000000
--- a/sys/dev/usb/usbdivar.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/* $NetBSD: usbdivar.h,v 1.16 1999/01/08 11:58:26 augustss Exp $ */
-/* FreeBSD $Id: usbdivar.h,v 1.6 1999/01/07 23:31:45 n_hibma Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-struct usbd_request;
-struct usbd_pipe;
-
-struct usbd_endpoint {
- usb_endpoint_descriptor_t *edesc;
- usbd_endpoint_state state;
- int refcnt;
- int toggle; /* XXX */
-};
-
-typedef void (*usbd_xfercb)__P((usbd_request_handle req));
-
-struct usbd_methods {
- usbd_status (*transfer)__P((usbd_request_handle reqh));
- usbd_status (*start)__P((usbd_request_handle reqh));
- void (*abort)__P((usbd_request_handle reqh));
- void (*close)__P((usbd_pipe_handle pipe));
- usbd_status (*isobuf)__P((usbd_pipe_handle pipe,
- u_int32_t bufsize,u_int32_t nbuf));
-};
-
-struct usbd_port {
- usb_port_status_t status;
- u_int16_t power; /* mA of current on port */
- u_int8_t portno;
- u_int8_t restartcnt;
-#define USBD_RESTART_MAX 5
- struct usbd_device *device;
- struct usbd_device *parent; /* The ports hub */
-};
-
-struct usbd_hub {
- usbd_status (*explore)__P((usbd_device_handle hub));
- void *hubsoftc;
- usb_hub_descriptor_t hubdesc;
- struct usbd_port ports[1];
-};
-
-struct usb_softc;
-
-/*****/
-
-struct usbd_bus {
- /* Filled by HC driver */
- bdevice bdev; /* base device, host adapter */
- usbd_status (*open_pipe)__P((struct usbd_pipe *pipe));
- u_int32_t pipe_size; /* size of a pipe struct */
- void (*do_poll)__P((struct usbd_bus *));
- /* Filled by usb driver */
- struct usbd_device *root_hub;
- usbd_device_handle devices[USB_MAX_DEVICES];
- char needs_explore;/* a hub a signalled a change */
- char use_polling;
- struct usb_softc *usbctl;
- struct usb_device_stats stats;
-};
-
-struct usbd_device {
- struct usbd_bus *bus;
- usbd_device_state state;
- struct usbd_pipe *default_pipe;
- u_int8_t address;
- u_int8_t depth;
- u_int8_t lowspeed;
- u_int16_t power;
- u_int8_t self_powered;
- int config;
- int langid; /* language to use for strings */
-#define USBD_NOLANG (-1)
- struct usbd_port *powersrc;
- struct usbd_endpoint def_ep; /* for pipe 0 */
- usb_endpoint_descriptor_t def_ep_desc; /* for pipe 0 */
- struct usbd_interface *ifaces;
- usb_device_descriptor_t ddesc;
- usb_config_descriptor_t *cdesc; /* full config descr */
- struct usbd_quirks *quirks;
- struct usbd_hub *hub; /* only if this is a hub */
- void *softc; /* device softc if attached */
-};
-
-struct usbd_interface {
- struct usbd_device *device;
- usbd_interface_state state;
- usb_interface_descriptor_t *idesc;
- int index;
- int altindex;
- struct usbd_endpoint *endpoints;
- void *priv;
- LIST_HEAD(, usbd_pipe) pipes;
-};
-
-struct usbd_pipe {
- struct usbd_interface *iface;
- struct usbd_device *device;
- struct usbd_endpoint *endpoint;
- usbd_pipe_state state;
- int32_t refcnt;
- char running;
- SIMPLEQ_HEAD(, usbd_request) queue;
- LIST_ENTRY(usbd_pipe) next;
-
- void (*disco) __P((void *));
- void *discoarg;
-
- usbd_request_handle intrreqh; /* used for repeating requests */
-
- /* Filled by HC driver. */
- struct usbd_methods *methods;
-};
-
-struct usbd_request {
- struct usbd_pipe *pipe;
- void *priv;
- void *buffer;
- u_int32_t length;
- u_int32_t actlen;
- u_int16_t flags;
- u_int32_t timeout;
- usbd_status status;
- usbd_callback callback;
- usbd_xfercb xfercb;
- u_int32_t retries;
- char done;
-
- usb_device_request_t request;
- u_int8_t isreq;
-
- SIMPLEQ_ENTRY(usbd_request) next;
-
- void *hcpriv; /* XXX private use by the HC driver */
-
-#if defined(__FreeBSD__)
- struct callout_handle timo_handle;
-#endif
-};
-
-void usbd_init __P((void));
-
-/* Routines from usb_subr.c */
-int usbctlprint __P((void *, const char *));
-void usb_delay_ms __P((usbd_bus_handle, u_int));
-void usbd_devinfo_vp __P((usbd_device_handle, char *, char *));
-usbd_status usbd_reset_port __P((usbd_device_handle dev,
- int port, usb_port_status_t *ps));
-usbd_status usbd_setup_pipe __P((usbd_device_handle dev,
- usbd_interface_handle iface,
- struct usbd_endpoint *,
- usbd_pipe_handle *pipe));
-usbd_status usbd_new_device __P((bdevice *parent,
- usbd_bus_handle bus, int depth,
- int lowspeed, int port,
- struct usbd_port *));
-void usbd_remove_device __P((usbd_device_handle,
- struct usbd_port *));
-int usbd_printBCD __P((char *cp, int bcd));
-usbd_status usb_insert_transfer __P((usbd_request_handle reqh));
-void usb_start_next __P((usbd_pipe_handle pipe));
-usbd_status usbd_fill_iface_data __P((usbd_device_handle dev,
- int i, int a));
-
-/* Routines from usb.c */
-int usb_bus_count __P((void));
-usbd_status usb_get_bus_handle __P((int, usbd_bus_handle *));
-void usb_needs_explore __P((usbd_bus_handle));
-
-/* Locator stuff. */
-
-#if defined(__NetBSD__)
-#include "locators.h"
-#elif defined(__FreeBSD__)
-/* XXX these values are used to statically bind some elements in the USB tree
- * to specific driver instances. This should be somehow emulated in FreeBSD
- * but can be done later on.
- * The values are copied from the files.usb file in the NetBSD sources.
- */
-#define UHUBCF_PORT_DEFAULT -1
-#define UHUBCF_CONFIGURATION_DEFAULT -1
-#define UHUBCF_INTERFACE_DEFAULT -1
-#endif
-
-#define uhubcf_port cf_loc[UHUBCF_PORT]
-#define uhubcf_configuration cf_loc[UHUBCF_CONFIGURATION]
-#define uhubcf_interface cf_loc[UHUBCF_INTERFACE]
-#define UHUB_UNK_PORT UHUBCF_PORT_DEFAULT /* wildcarded 'port' */
-#define UHUB_UNK_CONFIGURATION UHUBCF_CONFIGURATION_DEFAULT /* wildcarded 'configuration' */
-#define UHUB_UNK_INTERFACE UHUBCF_INTERFACE_DEFAULT /* wildcarded 'interface' */
-
diff --git a/sys/dev/usb/usbhid.h b/sys/dev/usb/usbhid.h
deleted file mode 100644
index edec4130e1473..0000000000000
--- a/sys/dev/usb/usbhid.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* $NetBSD: usbhid.h,v 1.3 1998/12/26 12:53:04 augustss Exp $ */
-/* FreeBSD $Id$ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss@carlstedt.se) at
- * Carlstedt Research & Technology.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef _USBHID_H_
-#define _USBHID_H_
-
-#define UR_GET_HID_DESCRIPTOR 0x06
-#define UDESC_HID 0x21
-#define UDESC_REPORT 0x22
-#define UDESC_PHYSICAL 0x23
-#define UR_SET_HID_DESCRIPTOR 0x07
-#define UR_GET_REPORT 0x01
-#define UR_SET_REPORT 0x09
-#define UR_GET_IDLE 0x02
-#define UR_SET_IDLE 0x0a
-#define UR_GET_PROTOCOL 0x03
-#define UR_SET_PROTOCOL 0x0b
-
-typedef struct usb_hid_descriptor {
- uByte bLength;
- uByte bDescriptorType;
- uWord bcdHID;
- uByte bCountryCode;
- uByte bNumDescriptors;
- struct {
- uByte bDescriptorType;
- uWord wDescriptorLength;
- } descrs[1];
-} usb_hid_descriptor_t;
-#define USB_HID_DESCRIPTOR_SIZE(n) (9+(n)*3)
-
-/* Usage pages */
-#define HUP_GENERIC_DESKTOP 0x0001
-#define HUP_SIMULATION 0x0002
-#define HUP_LEDS 0x0008
-#define HUP_BUTTON 0x0009
-
-/* Usages, generic desktop */
-#define HUG_POINTER 0x0001
-#define HUG_MOUSE 0x0002
-#define HUG_JOYSTICK 0x0004
-#define HUG_GAME_PAD 0x0005
-#define HUG_KEYBOARD 0x0006
-#define HUG_KEYPAD 0x0007
-#define HUG_X 0x0030
-#define HUG_Y 0x0031
-#define HUG_Z 0x0032
-#define HUG_RX 0x0033
-#define HUG_RY 0x0034
-#define HUG_RZ 0x0035
-#define HUG_SLIDER 0x0036
-#define HUG_DIAL 0x0037
-#define HUG_WHEEL 0x0038
-#define HUG_HAT_SWITCH 0x0039
-#define HUG_COUNTED_BUFFER 0x003a
-#define HUG_BYTE_COUNT 0x003b
-#define HUG_MOTION_WAKEUP 0x003c
-#define HUG_VX 0x0040
-#define HUG_VY 0x0041
-#define HUG_VZ 0x0042
-#define HUG_VBRX 0x0043
-#define HUG_VBRY 0x0044
-#define HUG_VBRZ 0x0045
-#define HUG_VNO 0x0046
-#define HUG_SYSTEM_CONTROL 0x0080
-#define HUG_SYSTEM_POWER_DOWN 0x0081
-#define HUG_SYSTEM_SLEEP 0x0082
-#define HUG_SYSTEM_WAKEUP 0x0083
-#define HUG_SYSTEM_CONTEXT_MENU 0x0084
-#define HUG_SYSTEM_MAIN_MENU 0x0085
-#define HUG_SYSTEM_APP_MENU 0x0086
-#define HUG_SYSTEM_MENU_HELP 0x0087
-#define HUG_SYSTEM_MENU_EXIT 0x0088
-#define HUG_SYSTEM_MENU_SELECT 0x0089
-#define HUG_SYSTEM_MENU_RIGHT 0x008a
-#define HUG_SYSTEM_MENU_LEFT 0x008b
-#define HUG_SYSTEM_MENU_UP 0x008c
-#define HUG_SYSTEM_MENU_DOWN 0x008d
-
-#define HID_USAGE2(p,u) (((p) << 16) | u)
-
-#define UHID_INPUT_REPORT 0x01
-#define UHID_OUTPUT_REPORT 0x02
-#define UHID_FEATURE_REPORT 0x03
-
-/* Bits in the input/output/feature items */
-#define HIO_CONST 0x001
-#define HIO_VARIABLE 0x002
-#define HIO_RELATIVE 0x004
-#define HIO_WRAP 0x008
-#define HIO_NONLINEAR 0x010
-#define HIO_NOPREF 0x020
-#define HIO_NULLSTATE 0x040
-#define HIO_VOLATILE 0x080
-#define HIO_BUFBYTES 0x100
-
-#endif /* _USBHID_H_ */
diff --git a/sys/dev/vinum/Makefile b/sys/dev/vinum/Makefile
deleted file mode 100644
index 363aa7a1e1b5f..0000000000000
--- a/sys/dev/vinum/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# $Id: Makefile,v 1.4 1998/12/28 04:56:22 peter Exp $
-
-.PATH: ${.CURDIR}/../../sys/dev/ccd
-KMOD= vinum_mod
-SRCS= vinum.c vinum.h vnode_if.h parser.c config.c io.c util.c vinumhdr.h request.h \
- state.c memory.c request.c lock.c vinumext.h vinumio.h vinumkw.h \
- vinumstate.h vinumvar.h revive.c vinumioctl.c interrupt.c
-NOMAN=
-PSEUDO_LKM=
-CFLAGS = -I${.CURDIR} -O -g -DVINUMDEBUG -Wall -Wno-unused -Wno-parentheses
-
-CLEANFILES+= vinum.h vnode_if.h vnode_if.c
-
-all:
-
-# We don't need this, but the Makefile wants it
-vinum.h:
- touch $@
-
-state.h: maketabs vinumstate.h
- ./maketabs >state.h
-
-maketabs: maketabs.c
- ${CC} -g -o maketabs maketabs.c
-
-.include <bsd.kmod.mk>
diff --git a/sys/dev/vinum/makestatetext b/sys/dev/vinum/makestatetext
deleted file mode 100755
index 02a927e4e3080..0000000000000
--- a/sys/dev/vinum/makestatetext
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/sh
-# Make statetexts.h from vinumstate.h
-# $Id: makestatetext,v 1.5 1999/01/15 07:30:45 grog Exp grog $
-infile=vinumstate.h
-ofile=statetexts.h
-cat > $ofile <<FOO
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called \`\`Berkeley
- * License'':
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * This software is provided \`\`as is'', and any express or implied
- * warranties, including, but not limited to, the implied warranties of
- * merchantability and fitness for a particular purpose are disclaimed.
- * In no event shall the company or contributors be liable for any
- * direct, indirect, incidental, special, exemplary, or consequential
- * damages (including, but not limited to, procurement of substitute
- * goods or services; loss of use, data, or profits; or business
- * interruption) however caused and on any theory of liability, whether
- * in contract, strict liability, or tort (including negligence or
- * otherwise) arising in any way out of the use of this software, even if
- * advised of the possibility of such damage.
- *
- */
-
-FOO
-
-echo >>$ofile "/* Created by $0 on" `date`. "Do not edit */"
-echo >>$ofile
-echo >>$ofile "/* Drive state texts */"
-echo >>$ofile "char *drivestatetext [] =
- { "
-egrep -e 'drive_[A-z0-9]*,' <$infile | grep -v = | sed 's: *drive_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-
-/* Subdisk state texts */
-char *sdstatetext [] =
- {
-FOO
-egrep -e 'sd_[A-z0-9]*,' $infile | grep -v = | sed 's: *sd_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-
-/* Plex state texts */
-char *plexstatetext [] =
- {
-FOO
-egrep -e 'plex_[A-z0-9]*,' $infile | grep -v = | sed 's: *plex_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-
-/* Volume state texts */
-char *volstatetext [] =
- {
-FOO
-egrep -e 'volume_[A-z0-9]*,' $infile | grep -v = | sed 's: *volume_\([^,]*\).*: \"\1\",:' >>$ofile
-cat <<FOO >> $ofile
- };
-FOO
diff --git a/sys/dev/vinum/vinumdaemon.c b/sys/dev/vinum/vinumdaemon.c
deleted file mode 100644
index 23f3213f4cec7..0000000000000
--- a/sys/dev/vinum/vinumdaemon.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/* daemon.c: kernel part of Vinum daemon */
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * This software is provided ``as is'', and any express or implied
- * warranties, including, but not limited to, the implied warranties of
- * merchantability and fitness for a particular purpose are disclaimed.
- * In no event shall the company or contributors be liable for any
- * direct, indirect, incidental, special, exemplary, or consequential
- * damages (including, but not limited to, procurement of substitute
- * goods or services; loss of use, data, or profits; or business
- * interruption) however caused and on any theory of liability, whether
- * in contract, strict liability, or tort (including negligence or
- * otherwise) arising in any way out of the use of this software, even if
- * advised of the possibility of such damage.
- *
- * $Id: vinumdaemon.c,v 1.3 1999/01/18 04:32:50 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "vinumhdr.h"
-#include "request.h"
-
-#ifdef VINUMDEBUG
-#include <sys/reboot.h>
-#endif
-
-/* declarations */
-void recover_io(struct request *rq);
-
-struct daemonq *daemonq; /* daemon's work queue */
-struct daemonq *dqend; /* and the end of the queue */
-int daemon_options = 0; /* options */
-
-void
-vinum_daemon(void)
-{
- struct daemonq *request;
- int s;
-
- daemon_save_config(); /* start by saving the configuration */
- while (1) {
- tsleep(&vinum_daemon, PRIBIO, "vinum", 0); /* wait for something to happen */
-
- while (daemonq != NULL) { /* we have work to do, */
- s = splhigh(); /* don't get interrupted here */
- request = daemonq; /* get the request */
- daemonq = daemonq->next; /* and detach it */
- if (daemonq == NULL) /* got to the end, */
- dqend = NULL; /* no end any more */
- splx(s);
-
- switch (request->type) {
- /* We had an I/O error on a request. Go through the
- * request and try to salvage it */
- case daemonrq_ioerror:
- if (daemon_options & daemon_verbose) {
- struct request *rq = request->info.rq;
-
- printf("vinumd: recovering I/O request: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
- (u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
- rq->bp->b_dev,
- rq->bp->b_blkno,
- rq->bp->b_bcount);
- }
- recover_io(request->info.rq); /* the failed request */
- break;
-
- /* Write the config to disk. We could end up with
- * quite a few of these in a row. Only honour the
- * last one */
- case daemonrq_saveconfig:
- if ((daemonq == NULL) /* no more requests */
- ||(daemonq->type != daemonrq_saveconfig)) { /* or the next isn't the same */
- if ((daemon_options & daemon_noupdate) == 0) { /* we can do it */
- if (daemon_options & daemon_verbose)
- printf("vinumd: saving config\n");
- daemon_save_config(); /* save it */
- }
- }
- break;
-
- case daemonrq_return: /* been told to stop */
- if (daemon_options & daemon_verbose)
- printf("vinumd: stopping\n");
- daemon_options |= daemon_stopped; /* note that we've stopped */
- wakeup(vinum_daemon); /* in case somebody's waiting for us to stop */
- return;
- break;
-
- case daemonrq_ping: /* tell the caller we're here */
- if (daemon_options & daemon_verbose)
- printf("vinumd: ping reply\n");
- wakeup(&vinum_finddaemon); /* wake up the caller */
- break;
-
- case daemonrq_init: /* initialize a plex */
- /* XXX */
- case daemonrq_revive: /* revive a subdisk */
- /* XXX */
- default:
- printf("Invalid request\n");
- break;
- }
- Free(request);
- }
- }
-}
-
-/* Recover a failed I/O operation.
-
- * The correct way to do this is to examine the request and determine
- * how to recover each individual failure. In the case of a write,
- * this could be as simple as doing nothing: the defective drives may
- * already be down, and there may be nothing else to do. In case of
- * a read, it will be necessary to retry if there are alternative
- * copies of the data.
- *
- * The easy way (here) is just to reissue the request. This will take
- * a little longer, but nothing like as long as the failure will have
- * taken.
- *
- */
-void
-recover_io(struct request *rq)
-{
- vinumstrategy(rq->bp); /* reissue the command */
-}
-
-/* Functions called to interface with the daemon */
-
-/* queue a request for the daemon */
-void
-queue_daemon_request(enum daemonrq type, union daemoninfo info)
-{
- int s;
-
- struct daemonq *qelt = (struct daemonq *) Malloc(sizeof(struct daemonq));
- qelt->next = NULL; /* end of the chain */
- qelt->type = type;
- qelt->info = info;
- s = splhigh();
- if (daemonq) { /* something queued already */
- dqend->next = qelt;
- dqend = qelt;
- } else { /* queue is empty, */
- daemonq = qelt; /* this is the whole queue */
- dqend = qelt;
- }
- splx(s);
- wakeup(&vinum_daemon); /* and give the dæmon a kick */
-}
-
-/* see if the daemon is running. Return 0 (no error)
- * if it is, ESRCH otherwise */
-
-int
-vinum_finddaemon()
-{
- int result;
-
- int i;
-
- for (i = 0; i < 2; i++) { /* try twice */
- queue_daemon_request(daemonrq_ping, NULL); /* queue a ping */
- do
- result = tsleep(&vinum_finddaemon, PUSER, "recolte", 20 * hz);
- while (result == ERESTART); /* let it finish */
- }
-
- if (result) /* will be EWOULDBLOCK or EINTR */
- return ESRCH; /* no process */
- return 0;
-}
-
-int
-vinum_setdaemonopts(int options)
-{
- daemon_options = options;
- return 0;
-}
diff --git a/sys/dev/vinum/vinumrevive.c b/sys/dev/vinum/vinumrevive.c
deleted file mode 100644
index e7cc3dd33a4d8..0000000000000
--- a/sys/dev/vinum/vinumrevive.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * This software is provided ``as is'', and any express or implied
- * warranties, including, but not limited to, the implied warranties of
- * merchantability and fitness for a particular purpose are disclaimed.
- * In no event shall the company or contributors be liable for any
- * direct, indirect, incidental, special, exemplary, or consequential
- * damages (including, but not limited to, procurement of substitute
- * goods or services; loss of use, data, or profits; or business
- * interruption) however caused and on any theory of liability, whether
- * in contract, strict liability, or tort (including negligence or
- * otherwise) arising in any way out of the use of this software, even if
- * advised of the possibility of such damage.
- *
- * $Id: vinumrevive.c,v 1.6 1999/01/17 06:20:44 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
-
-/* revive a block of a subdisk. Return an error
- * indication. EAGAIN means successful copy, but
- * that more blocks remain to be copied. EINVAL means
- * that the subdisk isn't associated with a plex (which
- * means a programming error if we get here at all;
- * FIXME)
- * XXX We should specify a block size here. At the moment,
- * just take a default value. FIXME */
-int
-revive_block(int sdno)
-{
- struct sd *sd;
- struct plex *plex;
- struct volume *vol;
- struct buf *bp;
- int error = EAGAIN;
- int size; /* size of revive block, bytes */
- int s; /* priority level */
- daddr_t plexblkno; /* lblkno in plex */
-
- plexblkno = 0; /* to keep the compiler happy */
- sd = &SD[sdno];
- if (sd->plexno < 0) /* no plex? */
- return EINVAL;
- plex = &PLEX[sd->plexno]; /* point to plex */
- if (plex->volno >= 0)
- vol = &VOL[plex->volno];
- else
- vol = NULL;
-
- if (sd->revive_blocksize == 0) {
- if (plex->stripesize != 0) /* we're striped, don't revive more than */
- sd->revive_blocksize = min(DEFAULT_REVIVE_BLOCKSIZE, /* one block at a time */
- plex->stripesize << DEV_BSHIFT);
- else
- sd->revive_blocksize = DEFAULT_REVIVE_BLOCKSIZE;
- }
- size = min(sd->revive_blocksize >> DEV_BSHIFT, sd->sectors - sd->revived) << DEV_BSHIFT;
-
- s = splbio();
-
- bp = geteblk(size); /* Get a buffer */
- if (bp == NULL) {
- splx(s);
- return ENOMEM;
- }
- if (bp->b_qindex != 0) /* on a queue, */
- bremfree(bp); /* remove it XXX how can this happen? */
- splx(s);
-
- /* Amount to transfer: block size, unless it
- * would overlap the end */
- bp->b_bufsize = size;
- bp->b_bcount = bp->b_bufsize;
- bp->b_resid = 0;
-
- /* Now decide where to read from */
-
- switch (plex->organization) {
- daddr_t stripeoffset; /* offset in stripe */
-
- case plex_concat:
- plexblkno = sd->revived + sd->plexoffset; /* corresponding address in plex */
- break;
-
- case plex_striped:
- stripeoffset = sd->revived % plex->stripesize; /* offset from beginning of stripe */
- plexblkno = sd->plexoffset /* base */
- + (sd->revived - stripeoffset) * plex->subdisks /* offset to beginning of stripe */
- + sd->revived % plex->stripesize; /* offset from beginning of stripe */
- break;
-
- case plex_raid5:
- case plex_disorg: /* to keep the compiler happy */
- }
-
- {
- bp->b_blkno = plexblkno; /* start here */
- if (vol != NULL) /* it's part of a volume, */
- /* First, read the data from the volume. We don't
- * care which plex, that's bre's job */
- bp->b_dev = VINUMBDEV(plex->volno, 0, 0, VINUM_VOLUME_TYPE); /* create the device number */
- else /* it's an unattached plex */
- bp->b_dev = VINUMRBDEV(sd->plexno, VINUM_RAWPLEX_TYPE); /* create the device number */
-
- bp->b_flags = B_BUSY | B_READ; /* either way, read it */
- vinumstart(bp, 1);
- biowait(bp);
- }
- if (bp->b_flags & B_ERROR)
- error = bp->b_error;
- else
- /* Now write to the subdisk */
- {
- s = splbio();
- if (bp->b_qindex != 0) /* on a queue, */
- bremfree(bp); /* remove it */
- splx(s);
-
- bp->b_dev = VINUMRBDEV(sdno, VINUM_RAWSD_TYPE); /* create the device number */
- bp->b_flags = B_BUSY | B_ORDERED; /* and make this an ordered write */
- bp->b_resid = 0x0;
- bp->b_blkno = sd->revived; /* write it to here */
- sdio(bp); /* perform the I/O */
- biowait(bp);
- if (bp->b_flags & B_ERROR)
- error = bp->b_error;
- else {
- sd->revived += bp->b_bcount >> DEV_BSHIFT; /* moved this much further down */
- if (sd->revived >= sd->sectors) { /* finished */
- sd->revived = 0;
- set_sd_state(sdno, sd_up, setstate_force); /* bring the sd up */
- printf("vinum: %s is %s\n", sd->name, sd_state(sd->state));
- save_config(); /* and save the updated configuration */
- error = 0; /* we're done */
- }
- }
- while (sd->waitlist) { /* we have waiting requests */
-#if VINUMDEBUG
- struct request *rq = sd->waitlist;
-
- if (debug & DEBUG_REVIVECONFLICT)
- printf("Relaunch revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
- rq->sdno,
- (u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
- rq->bp->b_dev,
- rq->bp->b_blkno,
- rq->bp->b_bcount);
-#endif
- launch_requests(sd->waitlist, 1); /* do them now */
- sd->waitlist = sd->waitlist->next; /* and move on to the next */
- }
- }
- if (bp->b_qindex == 0) /* not on a queue, */
- brelse(bp); /* is this kosher? */
- return error;
-}
diff --git a/sys/dev/vinum/vinumstate.c b/sys/dev/vinum/vinumstate.c
deleted file mode 100644
index 8d44fecfcdf2d..0000000000000
--- a/sys/dev/vinum/vinumstate.c
+++ /dev/null
@@ -1,843 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998
- * Nan Yang Computer Services Limited. All rights reserved.
- *
- * This software is distributed under the so-called ``Berkeley
- * License'':
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * This software is provided ``as is'', and any express or implied
- * warranties, including, but not limited to, the implied warranties of
- * merchantability and fitness for a particular purpose are disclaimed.
- * In no event shall the company or contributors be liable for any
- * direct, indirect, incidental, special, exemplary, or consequential
- * damages (including, but not limited to, procurement of substitute
- * goods or services; loss of use, data, or profits; or business
- * interruption) however caused and on any theory of liability, whether
- * in contract, strict liability, or tort (including negligence or
- * otherwise) arising in any way out of the use of this software, even if
- * advised of the possibility of such damage.
- *
- * $Id: vinumstate.c,v 2.10 1999/01/17 06:19:23 grog Exp grog $
- */
-
-#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
-
-/* Update drive state */
-/* Return 1 if the state changes, otherwise 0 */
-int
-set_drive_state(int driveno, enum drivestate newstate, enum setstateflags flags)
-{
- struct drive *drive = &DRIVE[driveno];
- int oldstate = drive->state;
- int sdno;
-
- if (drive->state == drive_unallocated) /* no drive to do anything with, */
- return 0;
-
- if (newstate != oldstate) { /* don't change it if it's not different */
- if ((newstate == drive_down) /* the drive's going down */
- &&(!(flags & setstate_force))
- && (drive->opencount != 0)) /* we can't do it */
- return 0; /* don't do it */
- drive->state = newstate; /* set the state */
- if (drive->label.name[0] != '\0') /* we have a name, */
- printf("vinum: drive %s is %s\n", drive->label.name, drive_state(drive->state));
- if ((drive->state == drive_up)
- && (drive->vp == NULL)) /* should be open, but we're not */
- init_drive(drive, 1); /* which changes the state again */
- if (newstate != oldstate) { /* state has changed */
- for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) { /* find this drive's subdisks */
- if (SD[sdno].driveno == driveno) /* belongs to this drive */
- update_sd_state(sdno); /* update the state */
- }
- }
- if ((flags & setstate_configuring) == 0) /* configuring? */
- save_config(); /* no: save the updated configuration now */
- return 1;
- }
- return 0;
-}
-
-/* Try to set the subdisk state. Return 1 if state changed to
- * what we wanted, -1 if it changed to something else, and 0
- * if no change.
- *
- * This routine is called both from the user (up, down states
- * only) and internally.
- */
-int
-set_sd_state(int sdno, enum sdstate newstate, enum setstateflags flags)
-{
- struct sd *sd = &SD[sdno];
- struct plex *plex;
- struct volume *vol;
- int oldstate = sd->state;
- int status = 1; /* status to return */
-
- if ((newstate == oldstate)
- || (sd->state == sd_unallocated)) /* no subdisk to do anything with, */
- return 0;
-
- if (sd->driveoffset < 0) { /* not allocated space */
- sd->state = sd_down;
- if (newstate != sd_down) {
- if (sd->plexno >= 0)
- sdstatemap(&PLEX[sd->plexno]); /* count up subdisks */
- return -1;
- }
- } else { /* space allocated */
- switch (newstate) {
- case sd_down:
- if ((!flags & setstate_force) /* but gently */
- &&(sd->plexno >= 0)) /* and we're attached to a plex, */
- return 0; /* don't do it */
- break;
-
- case sd_up:
- if (DRIVE[sd->driveno].state != drive_up) /* can't bring the sd up if the drive isn't, */
- return 0; /* not even by force */
- switch (sd->state) {
- case sd_crashed:
- case sd_down: /* been down, no data lost */
- if ((sd->plexno >= 0) /* we're associated with a plex */
- &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
- ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
- break; /* do it */
- /* XXX Get this right: make sure that other plexes in
- * the volume cover this address space, otherwise
- * we make this one sd_up.
- *
- * Do we even want this any more?
- */
- sd->state = sd_reborn; /* here it is again */
- printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(newstate));
- status = -1;
- break;
-
- case sd_init: /* brand new */
- if (flags & setstate_configuring) /* we're doing this while configuring */
- break;
- /* otherwise it's like being empty */
- /* FALLTHROUGH */
-
- case sd_empty:
- if ((sd->plexno >= 0) /* we're associated with a plex */
- &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
- ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
- break;
- /* Otherwise it's just out of date */
- /* FALLTHROUGH */
-
- case sd_stale: /* out of date info, need reviving */
- case sd_obsolete:
- /* 1. If the subdisk is not part of a plex, bring it up, don't revive.
-
- * 2. If the subdisk is part of a one-plex volume or an unattached plex,
- * and it's not RAID-5, we *can't revive*. The subdisk doesn't
- * change its state.
- *
- * 3. If the subdisk is part of a one-plex volume or an unattached plex,
- * and it's RAID-5, but more than one subdisk is down, we *still
- * can't revive*. The subdisk doesn't change its state.
- *
- * 4. If the subdisk is part of a multi-plex volume, we'll change to
- * reviving and let the revive routines find out whether it will work
- * or not. If they don't, the revive stops with an error message,
- * but the state doesn't change (FWIW).*/
- if (sd->plexno < 0) /* no plex associated, */
- break; /* bring it up */
- plex = &PLEX[sd->plexno];
- if (plex->volno >= 0) /* have a volume */
- vol = &VOL[plex->volno];
- else
- vol = NULL;
- if (((vol == NULL) /* no volume */ ||(vol->plexes == 1)) /* or only one plex in volume */
- &&((plex->organization != plex_raid5) /* or it's a RAID-5 plex */
- ||(plex->sddowncount > 1))) /* with more than one subdisk down, */
- return 0; /* can't do it */
- sd->state = sd_reviving; /* put in reviving state */
- sd->revived = 0; /* nothing done yet */
- status = EAGAIN; /* need to repeat */
- break;
-
- /* XXX This is silly. We need to be able to
- * bring the subdisk up when it's finished
- * initializing, but not from the user. We
- * use the same ioctl in each case, but Vinum(8)
- * doesn't supply the -f flag, so we use that
- * to decide whether to do it or not */
- case sd_initializing:
- if (flags & setstate_force)
- break; /* do it if we have to */
- return 0; /* no */
-
- case sd_reviving:
- if (flags & setstate_force) /* insist, */
- break;
- return EAGAIN; /* no, try again */
-
- default: /* can't do it */
- /* There's no way to bring subdisks up directly from
- * other states. First they need to be initialized
- * or revived */
- return 0;
- }
- break;
-
- default: /* other ones, only internal with force */
- if (flags & setstate_force == 0) /* no force? What's this? */
- return 0; /* don't do it */
- }
- }
- if (status == 1) { /* we can do it, */
- sd->state = newstate;
- printf("vinum: %s is %s\n", sd->name, sd_state(sd->state));
- } else /* we don't get here with status 0 */
- printf("vinum: %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(newstate));
- if (sd->plexno >= 0) /* we belong to a plex */
- update_plex_state(sd->plexno); /* update plex state */
- if ((flags & setstate_configuring) == 0) /* save config now */
- save_config();
- return status;
-}
-
-/* Set the state of a plex dependent on its subdisks.
- * This time round, we'll let plex state just reflect
- * aggregate subdisk state, so this becomes an order of
- * magnitude less complicated. In particular, ignore
- * the requested state.
- */
-int
-set_plex_state(int plexno, enum plexstate state, enum setstateflags flags)
-{
- struct plex *plex; /* point to our plex */
- enum plexstate oldstate;
- enum volplexstate vps; /* how do we compare with the other plexes? */
-
- plex = &PLEX[plexno]; /* point to our plex */
- oldstate = plex->state;
-
- if ((plex->state == plex_unallocated) /* or no plex to do anything with, */
- ||((state == oldstate) /* or we're already there */
- &&(state != plex_up))) /* and it's not up */
- return 0;
-
- vps = vpstate(plex); /* how do we compare with the other plexes? */
-
- switch (state) {
- /* We can't bring the plex up, even by force,
- * unless it's ready. update_plex_state
- * checks that */
- case plex_up: /* bring the plex up */
- update_plex_state(plex->plexno); /* it'll come up if it can */
- break;
-
- case plex_down: /* want to take it down */
- if (((vps == volplex_onlyus) /* we're the only one up */
- ||(vps == volplex_onlyusup)) /* we're the only one up */
- &&(!(flags & setstate_force))) /* and we don't want to use force */
- return 0; /* can't do it */
- plex->state = state; /* do it */
- invalidate_subdisks(plex, sd_down); /* and down all up subdisks */
- break;
-
- /* This is only requested internally.
- * Trust ourselves */
- case plex_faulty:
- plex->state = state; /* do it */
- invalidate_subdisks(plex, sd_crashed); /* and crash all up subdisks */
- break;
-
- case plex_initializing:
- /* XXX consider what safeguards we need here */
- if ((flags & setstate_force) == 0)
- return 0;
- plex->state = state; /* do it */
- break;
-
- /* What's this? */
- default:
- return 0;
- }
- if (plex->state != oldstate) /* we've changed, */
- printf("vinum: %s is %s\n", plex->name, plex_state(plex->state)); /* tell them about it */
- /* Now see what we have left, and whether
- * we're taking the volume down */
- if (plex->volno >= 0) /* we have a volume */
- update_volume_state(plex->volno); /* update its state */
- if ((flags & setstate_configuring) == 0) /* save config now */
- save_config(); /* yes: save the updated configuration */
- return 1;
-}
-
-/* Update the state of a plex dependent on its plexes. */
-int
-set_volume_state(int volno, enum volumestate state, enum setstateflags flags)
-{
- struct volume *vol = &VOL[volno]; /* point to our volume */
-
- if ((vol->state == state) /* we're there already */
- ||(vol->state == volume_unallocated)) /* or no volume to do anything with, */
- return 0;
-
- if (state == volume_up) /* want to come up */
- update_volume_state(volno);
- else if (state == volume_down) { /* want to go down */
- if ((vol->opencount == 0) /* not open */
- ||((flags & setstate_force) != 0)) { /* or we're forcing */
- vol->state = volume_down;
- printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
- if ((flags & setstate_configuring) == 0) /* save config now */
- save_config(); /* yes: save the updated configuration */
- return 1;
- }
- }
- return 0; /* no change */
-}
-
-/* Set the state of a subdisk based on its environment */
-void
-update_sd_state(int sdno)
-{
- struct sd *sd;
- struct drive *drive;
- enum sdstate oldstate;
-
- sd = &SD[sdno];
- oldstate = sd->state;
- drive = &DRIVE[sd->driveno];
-
- if (drive->state == drive_up) {
- switch (sd->state) {
- case sd_down:
- case sd_crashed:
- sd->state = sd_reborn; /* back up again with no loss */
- break;
-
- default:
- break;
- }
- } else { /* down or worse */
- switch (sd->state) {
- case sd_up:
- case sd_reborn:
- case sd_reviving:
- sd->state = sd_crashed; /* lost our drive */
- break;
-
- default:
- break;
- }
- }
- if (sd->state != oldstate) /* state has changed, */
- printf("vinum: %s is %s\n", sd->name, sd_state(sd->state)); /* say so */
- if (sd->plexno >= 0) /* we're part of a plex, */
- update_plex_state(sd->plexno); /* update its state */
-}
-
-/* Set the state of a plex based on its environment */
-void
-update_plex_state(int plexno)
-{
- struct plex *plex; /* point to our plex */
- enum plexstate oldstate;
- enum volplexstate vps; /* how do we compare with the other plexes? */
- enum sdstates statemap; /* get a map of the subdisk states */
-
- plex = &PLEX[plexno]; /* point to our plex */
- oldstate = plex->state;
-
- vps = vpstate(plex); /* how do we compare with the other plexes? */
- statemap = sdstatemap(plex); /* get a map of the subdisk states */
-
- if (statemap == sd_upstate) /* all subdisks ready for action */
- /* All the subdisks are up. This also means that
- * they are consistent, so we can just bring
- * the plex up */
- plex->state = plex_up; /* go for it */
- else if (statemap == sd_emptystate) { /* nothing done yet */
- if (((vps & (volplex_otherup | volplex_onlyus)) == 0) /* nothing is up */ &&(plex->state == plex_init) /* we're brand spanking new */
- &&(plex->volno >= 0) /* and we have a volume */
- &&(VOL[plex->volno].flags & VF_CONFIG_SETUPSTATE)) { /* and we consider that up */
- /* Conceptually, an empty plex does not contain valid data,
- * but normally we'll see this state when we have just
- * created a plex, and it's either consistent from earlier,
- * or we don't care about the previous contents (we're going
- * to create a file system or use it for swap).
- *
- * We need to do this in one swell foop: on the next call
- * we will no longer be just empty.
- *
- * This code assumes that all the other plexes are also
- * capable of coming up (i.e. all the sds are up), but
- * that's OK: we'll come back to this function for the remaining
- * plexes in the volume. */
- struct volume *vol = &VOL[plex->volno];
- int plexno;
-
- for (plexno = 0; plexno < vol->plexes; plexno++)
- PLEX[vol->plex[plexno]].state = plex_up;
- } else if (vps & volplex_otherup == 0) { /* no other plexes up */
- int sdno;
-
- plex->state = plex_up; /* we can call that up */
- for (sdno = 0; sdno < plex->subdisks; sdno++) { /* change the subdisks to up state */
- SD[plex->sdnos[sdno]].state = sd_up;
- printf("vinum: %s is up\n", SD[plex->sdnos[sdno]].name); /* tell them about it */
- }
- } else
- plex->state = plex_faulty; /* no, it's down */
- } else if (statemap & (sd_upstate | sd_rebornstate) == statemap) /* all up or reborn */
- plex->state = plex_flaky;
- else if (statemap & (sd_upstate | sd_rebornstate)) /* some up or reborn */
- plex->state = plex_corrupt; /* corrupt */
- else if (statemap & sd_initstate) /* some subdisks initializing */
- plex->state = plex_initializing;
- else /* nothing at all up */
- plex->state = plex_faulty;
-
- if (plex->state != oldstate) /* state has changed, */
- printf("vinum: %s is %s\n", plex->name, plex_state(plex->state)); /* tell them about it */
- if (plex->volno >= 0) /* we're part of a volume, */
- update_volume_state(plex->volno); /* update its state */
-}
-
-/* Set volume state based on its components */
-void
-update_volume_state(int volno)
-{
- struct volume *vol; /* our volume */
- int plexno;
- enum volumestate oldstate;
-
- vol = &VOL[volno]; /* point to our volume */
- oldstate = vol->state;
-
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- struct plex *plex = &PLEX[vol->plex[plexno]]; /* point to the plex */
- if (plex->state >= plex_corrupt) { /* something accessible, */
- vol->state = volume_up;
- break;
- }
- }
- if (plexno == vol->plexes) /* didn't find an up plex */
- vol->state = volume_down;
-
- if (vol->state != oldstate) { /* state changed */
- printf("vinum: %s is %s\n", vol->name, volume_state(vol->state));
- save_config(); /* save the updated configuration */
- }
-}
-
-/* Called from request routines when they find
- * a subdisk which is not kosher. Decide whether
- * it warrants changing the state. Return
- * REQUEST_DOWN if we can't use the subdisk,
- * REQUEST_OK if we can. */
-/* A prior version of this function checked the plex
- * state as well. At the moment, consider plex states
- * information for the user only. We'll ignore them
- * and use the subdisk state only. The last version of
- * this file with the old logic was 2.7. XXX */
-enum requeststatus
-checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend)
-{
- struct plex *plex = &PLEX[sd->plexno];
- int writeop = (rq->bp->b_flags & B_READ) == 0; /* note if we're writing */
-
- switch (sd->state) {
- /* We shouldn't get called if the subdisk is up */
- case sd_up:
- return REQUEST_OK;
-
- case sd_reviving:
- /* Access to a reviving subdisk depends on the
- * organization of the plex:
-
- * - If it's concatenated, access the subdisk up to its current
- * revive point. If we want to write to the subdisk overlapping the
- * current revive block, set the conflict flag in the request, asking
- * the caller to put the request on the wait list, which will be
- * attended to by revive_block when it's done.
- * - if it's striped, we can't do it (we could do some hairy
- * calculations, but it's unlikely to work).
- * - if it's RAID-5, we can do it as long as only one
- * subdisk is down */
- if (plex->state == plex_striped) /* plex is striped, */
- return REQUEST_DOWN; /* can't access it now */
- if (diskaddr > (sd->revived
- + sd->plexoffset
- + (sd->revive_blocksize >> DEV_BSHIFT))) /* we're beyond the end */
- return REQUEST_DOWN; /* don't take the sd down again... */
- else if (diskend > (sd->revived + sd->plexoffset)) { /* we finish beyond the end */
- if (writeop) {
- rq->flags |= XFR_REVIVECONFLICT; /* note a potential conflict */
- rq->sdno = sd->sdno; /* and which sd last caused it */
- } else
- return REQUEST_DOWN; /* can't read this yet */
- }
- return REQUEST_OK;
-
- case sd_reborn:
- if (writeop)
- return REQUEST_OK; /* always write to a reborn disk */
- else /* don't allow a read */
- /* Handle the mapping. We don't want to reject
- * a read request to a reborn subdisk if that's
- * all we have. XXX */
- return REQUEST_DOWN;
-
- case sd_down:
- if (writeop) /* writing to a consistent down disk */
- set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
- return REQUEST_DOWN; /* and it's down one way or another */
-
- case sd_crashed:
- if (writeop) /* writing to a consistent down disk */
- set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
- return REQUEST_DOWN; /* and it's down one way or another */
-
- default:
- return REQUEST_DOWN;
- }
-}
-
-/* return a state map for the subdisks of a plex */
-enum sdstates
-sdstatemap(struct plex *plex)
-{
- int sdno;
- enum sdstates statemap = 0; /* note the states we find */
-
- plex->sddowncount = 0; /* no subdisks down yet */
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- struct sd *sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
-
- switch (sd->state) {
- case sd_empty:
- statemap |= sd_emptystate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_init:
- statemap |= sd_initstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_down:
- statemap |= sd_downstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_crashed:
- statemap |= sd_crashedstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_obsolete:
- statemap |= sd_obsolete;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_stale:
- statemap |= sd_stalestate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_reborn:
- statemap |= sd_rebornstate;
- break;
-
- case sd_up:
- statemap |= sd_upstate;
- break;
-
- case sd_initializing:
- statemap |= sd_initstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- break;
-
- case sd_unallocated:
- case sd_uninit:
- case sd_reviving:
- statemap |= sd_otherstate;
- (plex->sddowncount)++; /* another unusable subdisk */
- }
- }
- return statemap;
-}
-
-/* determine the state of the volume relative to this plex */
-enum volplexstate
-vpstate(struct plex *plex)
-{
- struct volume *vol;
- enum volplexstate state = volplex_onlyusdown; /* state to return */
- int plexno;
-
- if (plex->volno < 0) /* not associated with a volume */
- return volplex_onlyusdown; /* assume the worst */
-
- vol = &VOL[plex->volno]; /* point to our volume */
- for (plexno = 0; plexno < vol->plexes; plexno++) {
- if (&PLEX[vol->plex[plexno]] == plex) { /* us */
-#if RAID5
- if (PLEX[vol->plex[plexno]].state >= plex_degraded) /* are we up? */
- state |= volplex_onlyus; /* yes */
-#else
- if (PLEX[vol->plex[plexno]].state >= plex_flaky) /* are we up? */
- state |= volplex_onlyus; /* yes */
-#endif
- } else {
-#if RAID5
- if (PLEX[vol->plex[plexno]].state >= plex_degraded) /* not us */
- state |= volplex_otherup; /* and when they were up, they were up */
- else
- state |= volplex_alldown; /* and when they were down, they were down */
-#else
- if (PLEX[vol->plex[plexno]].state >= plex_flaky) /* not us */
- state |= volplex_otherup; /* and when they were up, they were up */
- else
- state |= volplex_alldown; /* and when they were down, they were down */
-#endif
- }
- }
- return state; /* and when they were only halfway up */
-} /* they were neither up nor down */
-
-/* Check if all bits b are set in a */
-int allset(int a, int b);
-
-int
-allset(int a, int b)
-{
- return (a & b) == b;
-}
-
-/* Invalidate the subdisks belonging to a plex */
-void
-invalidate_subdisks(struct plex *plex, enum sdstate state)
-{
- int sdno;
-
- for (sdno = 0; sdno < plex->subdisks; sdno++) { /* for each subdisk */
- struct sd *sd = &SD[plex->sdnos[sdno]];
-
- switch (sd->state) {
- case sd_unallocated:
- case sd_uninit:
- case sd_init:
- case sd_initializing:
- case sd_empty:
- case sd_obsolete:
- case sd_stale:
- case sd_crashed:
- case sd_down:
- break;
-
- case sd_reviving:
- case sd_reborn:
- case sd_up:
- set_sd_state(plex->sdnos[sdno], state, setstate_force);
- }
- }
-}
-
-/* Start an object, in other words do what we can to get it up.
- * This is called from vinumioctl (VINUMSTART).
- * Return error indications via ioctl_reply
- */
-void
-start_object(struct vinum_ioctl_msg *data)
-{
- int status;
- int objindex = data->index; /* data gets overwritten */
- struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
- enum setstateflags flags;
-
- if (data->force != 0) /* are we going to use force? */
- flags = setstate_force; /* yes */
- else
- flags = setstate_none; /* no */
-
- switch (data->type) {
- case drive_object:
- status = set_drive_state(objindex, drive_up, flags);
- if (DRIVE[objindex].state != drive_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- break;
-
- case sd_object:
- if (SD[objindex].state == sd_reviving) { /* reviving, */
- ioctl_reply->error = revive_block(objindex); /* revive another block */
- ioctl_reply->msg[0] = '\0'; /* no comment */
- return;
- }
- status = set_sd_state(objindex, sd_up, flags); /* set state */
- if (status == EAGAIN) { /* first revive, */
- ioctl_reply->error = revive_block(objindex); /* revive the first block */
- ioctl_reply->error = EAGAIN;
- } else {
- if (SD[objindex].state != sd_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- }
- break;
-
- case plex_object:
- status = set_plex_state(objindex, plex_up, flags);
- if (PLEX[objindex].state != plex_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- break;
-
- case volume_object:
- status = set_volume_state(objindex, volume_up, flags);
- if (VOL[objindex].state != volume_up) /* set status on whether we really did it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
- break;
-
- default:
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "Invalid object type");
- return;
- }
- /* There's no point in saying anything here:
- * the userland program does it better */
- ioctl_reply->msg[0] = '\0';
-}
-
-/* Stop an object, in other words do what we can to get it down
- * This is called from vinumioctl (VINUMSTOP).
- * Return error indications via ioctl_reply.
- */
-void
-stop_object(struct vinum_ioctl_msg *data)
-{
- int status = 1;
- int objindex = data->index; /* save the number from change */
- struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
-
- switch (data->type) {
- case drive_object:
- status = set_drive_state(objindex, drive_down, data->force);
- break;
-
- case sd_object:
- status = set_sd_state(objindex, sd_down, data->force);
- break;
-
- case plex_object:
- status = set_plex_state(objindex, plex_down, data->force);
- break;
-
- case volume_object:
- status = set_volume_state(objindex, volume_down, data->force);
- break;
-
- default:
- ioctl_reply->error = EINVAL;
- strcpy(ioctl_reply->msg, "Invalid object type");
- return;
- }
- ioctl_reply->msg[0] = '\0';
- if (status == 0) /* couldn't do it */
- ioctl_reply->error = EINVAL;
- else
- ioctl_reply->error = 0;
-}
-
-/* VINUM_SETSTATE ioctl: set an object state
- * msg is the message passed by the user */
-void
-setstate(struct vinum_ioctl_msg *msg)
-{
- int sdno;
- struct sd *sd;
- struct plex *plex;
- struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) msg; /* format for returning replies */
-
- switch (msg->state) {
- case object_down:
- stop_object(msg);
- break;
-
- case object_initializing:
- switch (msg->type) {
- case sd_object:
- sd = &SD[msg->index];
- if ((msg->index >= vinum_conf.subdisks_used)
- || (sd->state == sd_unallocated)) {
- sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
- ioctl_reply->error = EFAULT;
- return;
- }
- set_sd_state(msg->index, sd_initializing, msg->force);
- if (sd->state != sd_initializing) {
- strcpy(ioctl_reply->msg, "Can't set state");
- ioctl_reply->error = EINVAL;
- } else
- ioctl_reply->error = 0;
- break;
-
- case plex_object:
- plex = &PLEX[msg->index];
- if ((msg->index >= vinum_conf.plexes_used)
- || (plex->state == plex_unallocated)) {
- sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
- ioctl_reply->error = EFAULT;
- return;
- }
- set_plex_state(msg->index, plex_initializing, msg->force);
- if (plex->state != plex_initializing) {
- strcpy(ioctl_reply->msg, "Can't set state");
- ioctl_reply->error = EINVAL;
- } else {
- ioctl_reply->error = 0;
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- sd = &SD[plex->sdnos[sdno]];
- set_sd_state(plex->sdnos[sdno], sd_initializing, msg->force);
- if (sd->state != sd_initializing) {
- strcpy(ioctl_reply->msg, "Can't set state");
- ioctl_reply->error = EINVAL;
- break;
- }
- }
- }
- break;
-
- default:
- strcpy(ioctl_reply->msg, "Invalid object");
- ioctl_reply->error = EINVAL;
- }
- break;
-
- case object_up:
- start_object(msg);
- }
-}
diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c
index b1d056fc8ba58..df8a606578ded 100644
--- a/sys/dev/vx/if_vx.c
+++ b/sys/dev/vx/if_vx.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_vx.c,v 1.18 1998/07/13 09:52:53 bde Exp $
+ * $Id: if_vx.c,v 1.17 1998/06/07 17:09:51 dfr Exp $
*
*/
@@ -131,6 +131,7 @@ static void vxsetfilter __P((struct vx_softc *));
static void vxgetlink __P((struct vx_softc *));
static void vxsetlink __P((struct vx_softc *));
/* int vxbusyeeprom __P((struct vx_softc *)); */
+/* void vxintr __P((void *)); */
struct vx_softc *
vxalloc(unit)
@@ -639,11 +640,10 @@ vxtxstat(sc)
}
void
-vxintr(voidsc)
- void *voidsc;
+vxintr(sc)
+ struct vx_softc *sc;
{
register short status;
- struct vx_softc *sc = voidsc;
struct ifnet *ifp = &sc->arpcom.ac_if;
for (;;) {
diff --git a/sys/dev/vx/if_vxreg.h b/sys/dev/vx/if_vxreg.h
index 688da0374649d..99708af18509e 100644
--- a/sys/dev/vx/if_vxreg.h
+++ b/sys/dev/vx/if_vxreg.h
@@ -452,5 +452,5 @@ extern struct vx_softc *vxalloc __P((int));
extern void vxfree __P((struct vx_softc *));
extern int vxattach __P((struct vx_softc *));
extern void vxstop __P((struct vx_softc *));
-extern void vxintr __P((void *));
+extern void vxintr __P((struct vx_softc *));
extern int vxbusyeeprom __P((struct vx_softc *));
diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c
index 0d4dfe3621fcd..21b9165542b6c 100644
--- a/sys/gnu/ext2fs/ext2_alloc.c
+++ b/sys/gnu/ext2fs/ext2_alloc.c
@@ -232,6 +232,7 @@ return ENOSPC;
daddr_t start_lbn, end_lbn, soff, eoff, newblk, blkno;
struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
int i, len, start_lvl, end_lvl, pref, ssize;
+ struct timeval tv;
vp = ap->a_vp;
ip = VTOI(vp);
@@ -338,8 +339,10 @@ return ENOSPC;
bwrite(sbp);
} else {
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- if (!doasyncfree)
- UFS_UPDATE(vp, 1);
+ if (!doasyncfree) {
+ gettime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, MNT_WAIT);
+ }
}
if (ssize < len)
if (doasyncfree)
diff --git a/sys/gnu/ext2fs/ext2_extern.h b/sys/gnu/ext2fs/ext2_extern.h
index 317f540af1e1b..0afd890403a16 100644
--- a/sys/gnu/ext2fs/ext2_extern.h
+++ b/sys/gnu/ext2fs/ext2_extern.h
@@ -62,7 +62,7 @@ int ext2_reallocblks __P((struct vop_reallocblks_args *));
int ext2_reclaim __P((struct vop_reclaim_args *));
void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t));
int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
-int ext2_update __P((struct vnode *, int));
+int ext2_update __P((struct vnode *, struct timeval *, struct timeval *, int));
int ext2_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int ext2_vfree __P((struct vnode *, ino_t, int));
int ext2_lookup __P((struct vop_cachedlookup_args *));
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c
index b287c16488575..4699d4d51dc00 100644
--- a/sys/gnu/ext2fs/ext2_inode.c
+++ b/sys/gnu/ext2fs/ext2_inode.c
@@ -80,8 +80,10 @@ ext2_init(struct vfsconf *vfsp)
* set, then wait for the write to complete.
*/
int
-ext2_update(vp, waitfor)
+ext2_update(vp, access, modify, waitfor)
struct vnode *vp;
+ struct timeval *access;
+ struct timeval *modify;
int waitfor;
{
register struct ext2_sb_info *fs;
@@ -140,7 +142,8 @@ ext2_truncate(vp, length, flags, cred, p)
register struct ext2_sb_info *fs;
struct buf *bp;
int offset, size, level;
- long count, nblocks, blocksreleased = 0;
+ long count, nblocks, vflags, blocksreleased = 0;
+ struct timeval tv;
register int i;
int aflags, error, allerror;
off_t osize;
@@ -154,6 +157,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
return EFBIG;
oip = VTOI(ovp);
+ getmicrotime(&tv);
if (ovp->v_type == VLNK &&
oip->i_size < ovp->v_mount->mnt_maxsymlinklen) {
#if DIAGNOSTIC
@@ -163,11 +167,11 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
if (oip->i_size == length) {
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 0));
+ return (UFS_UPDATE(ovp, &tv, &tv, 0));
}
#if QUOTA
if (error = getinoquota(oip))
@@ -197,7 +201,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
/*
* Shorten the size of the file. If the file is not being
@@ -253,8 +257,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- allerror = UFS_UPDATE(ovp, 1);
-
+ if (error = UFS_UPDATE(ovp, &tv, &tv, MNT_WAIT))
+ allerror = error;
/*
* Having written the new inode to disk, save its new configuration
* and put back the old block pointers long enough to process them.
@@ -264,9 +268,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks);
bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks);
oip->i_size = osize;
- error = vtruncbuf(ovp, cred, p, length, (int)fs->s_blocksize);
- if (error && (allerror == 0))
- allerror = error;
+ vflags = ((length > 0) ? V_SAVE : 0) | V_SAVEMETA;
+ allerror = vinvalbuf(ovp, vflags, cred, p, 0, 0);
/*
* Indirect blocks first.
@@ -345,8 +348,8 @@ done:
for (i = 0; i < NDADDR; i++)
if (newblks[i] != oip->i_db[i])
panic("itrunc2");
- if (length == 0 && (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) ||
- !TAILQ_EMPTY(&ovp->v_cleanblkhd)))
+ if (length == 0 &&
+ (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first))
panic("itrunc3");
#endif /* DIAGNOSTIC */
/*
diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c
index d5881e2e6f49d..7efe39afe4a01 100644
--- a/sys/gnu/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/ext2fs/ext2_readwrite.c
@@ -173,6 +173,7 @@ WRITE(ap)
daddr_t lbn;
off_t osize;
int blkoffset, error, flags, ioflag, resid, size, xfersize;
+ struct timeval tv;
ioflag = ap->a_ioflag;
uio = ap->a_uio;
@@ -288,7 +289,9 @@ WRITE(ap)
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
- } else if (resid > uio->uio_resid && (ioflag & IO_SYNC))
- error = UFS_UPDATE(vp, 1);
+ } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) {
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
+ }
return (error);
}
diff --git a/sys/gnu/ext2fs/ext2_subr.c b/sys/gnu/ext2fs/ext2_subr.c
index ed48acf46734e..30da6a7300cbd 100644
--- a/sys/gnu/ext2fs/ext2_subr.c
+++ b/sys/gnu/ext2fs/ext2_subr.c
@@ -52,11 +52,7 @@
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
-#include "opt_ddb.h"
-
-#ifdef DDB
-void ext2_checkoverlap __P((struct buf *, struct inode *));
-#endif
+static void ext2_checkoverlap __P((struct buf *, struct inode *));
/*
* Return buffer with the contents of block "offset" from the beginning of
@@ -92,8 +88,9 @@ ext2_blkatoff(vp, offset, res, bpp)
return (0);
}
+#include "opt_ddb.h"
#ifdef DDB
-void
+static void
ext2_checkoverlap(bp, ip)
struct buf *bp;
struct inode *ip;
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index ea756b5a6ddd6..11045341bdf96 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -276,8 +276,7 @@ ext2_mount(mp, path, data, ndp, p)
vrele(devvp);
return (ENOTBLK);
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
vrele(devvp);
return (ENXIO);
}
@@ -893,6 +892,7 @@ ext2_sync(mp, waitfor, cred, p)
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct ext2_sb_info *fs;
+ struct timeval tv;
int error, allerror = 0;
fs = ump->um_e2fs;
@@ -918,7 +918,8 @@ loop:
if (vp->v_type == VNON ||
(ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
- (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) {
+ (vp->v_dirtyblkhd.lh_first == NULL ||
+ waitfor == MNT_LAZY)) {
simple_unlock(&vp->v_interlock);
continue;
}
@@ -1170,7 +1171,7 @@ ext2_sbupdate(mp, waitfor)
register struct ext2_sb_info *fs = mp->um_e2fs;
register struct ext2_super_block *es = fs->s_es;
register struct buf *bp;
- int error = 0;
+ int i, error = 0;
/*
printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no");
*/
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index f3b9bcc171096..07e94b84ef9f6 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -182,6 +182,7 @@ ext2_fsync(ap)
{
register struct vnode *vp = ap->a_vp;
register struct buf *bp;
+ struct timeval tv;
struct buf *nbp;
int s;
@@ -196,8 +197,8 @@ ext2_fsync(ap)
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -221,14 +222,15 @@ loop:
tsleep(&vp->v_numoutput, PRIBIO + 1, "e2fsyn", 0);
}
#if DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("ext2_fsync: dirty", vp);
goto loop;
}
#endif
}
splx(s);
- return (UFS_UPDATE(ap->a_vp, ap->a_waitfor == MNT_WAIT));
+ getmicrotime(&tv);
+ return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
/*
@@ -318,6 +320,7 @@ ext2_link(ap)
struct componentname *cnp = ap->a_cnp;
struct proc *p = cnp->cn_proc;
struct inode *ip;
+ struct timeval tv;
int error;
#ifdef DIAGNOSTIC
@@ -346,7 +349,8 @@ ext2_link(ap)
}
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(vp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
if (!error)
error = ext2_direnter(ip, tdvp, cnp);
if (error) {
@@ -385,6 +389,7 @@ ext2_rename(ap)
struct proc *p = fcnp->cn_proc;
struct inode *ip, *xp, *dp;
struct dirtemplate dirbuf;
+ struct timeval tv;
int doingdirectory = 0, oldparent = 0, newparent = 0;
int error = 0;
u_char namlen;
@@ -522,7 +527,8 @@ abortit:
*/
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- if (error = UFS_UPDATE(fvp, 1)) {
+ getmicrotime(&tv);
+ if (error = UFS_UPDATE(fvp, &tv, &tv, 1)) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
@@ -583,7 +589,7 @@ abortit:
}
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(tdvp, 1);
+ error = UFS_UPDATE(tdvp, &tv, &tv, 1);
if (error)
goto bad;
}
@@ -592,7 +598,7 @@ abortit:
if (doingdirectory && newparent) {
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
- (void)UFS_UPDATE(tdvp, 1);
+ (void)UFS_UPDATE(tdvp, &tv, &tv, 1);
}
goto bad;
}
@@ -801,6 +807,7 @@ ext2_mkdir(ap)
register struct inode *ip, *dp;
struct vnode *tvp;
struct dirtemplate dirtemplate, *dtp;
+ struct timeval tv;
int error, dmode;
#ifdef DIAGNOSTIC
@@ -889,7 +896,8 @@ ext2_mkdir(ap)
ip->i_nlink = 2;
if (cnp->cn_flags & ISWHITEOUT)
ip->i_flags |= UF_OPAQUE;
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
/*
* Bump link count in parent directory
@@ -899,7 +907,7 @@ ext2_mkdir(ap)
*/
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(dvp, 1);
+ error = UFS_UPDATE(dvp, &tv, &tv, 1);
if (error)
goto bad;
@@ -1069,6 +1077,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
struct componentname *cnp;
{
register struct inode *ip, *pdir;
+ struct timeval tv;
struct vnode *tvp;
int error;
@@ -1161,7 +1170,8 @@ ext2_makeinode(mode, dvp, vpp, cnp)
/*
* Make sure inode goes to disk before directory entry.
*/
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
if (error)
goto bad;
error = ext2_direnter(ip, dvp, cnp);
diff --git a/sys/gnu/i386/fpemul/fpu_entry.c b/sys/gnu/i386/fpemul/fpu_entry.c
index 0db5288e4c1e8..bde2ef6dc977a 100644
--- a/sys/gnu/i386/fpemul/fpu_entry.c
+++ b/sys/gnu/i386/fpemul/fpu_entry.c
@@ -55,7 +55,7 @@
*
* W. Metzenthen June 1994.
*
- * $Id: fpu_entry.c,v 1.18 1998/11/15 15:33:50 bde Exp $
+ * $Id: fpu_entry.c,v 1.14 1998/08/16 01:21:48 bde Exp $
*
*/
@@ -483,18 +483,48 @@ if (--lookahead_limit)
return (0); /* --pink-- */
}
+#ifdef LKM
+MOD_MISC(gnufpu);
static int
-gnufpu_modevent(module_t mod, int type, void *unused)
+gnufpu_load(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate) {
+ printf("Math emulator already present\n");
+ return EBUSY;
+ }
+ pmath_emulate = math_emulate;
+ return 0;
+}
+
+static int
+gnufpu_unload(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate != math_emulate) {
+ printf("Cannot unload another math emulator\n");
+ return EACCES;
+ }
+ pmath_emulate = 0;
+ return 0;
+}
+
+int
+gnufpu_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(gnufpu, lkmtp, cmd, ver, gnufpu_load, gnufpu_unload,
+ lkm_nullcmd);
+}
+#else /* !LKM */
+
+static int
+gnufpu_modevent(module_t mod, modeventtype_t type, void *unused)
{
switch (type) {
case MOD_LOAD:
if (pmath_emulate) {
printf("Another Math emulator already present\n");
return EACCES;
- }
- pmath_emulate = math_emulate;
- if (bootverbose)
- printf("GPL Math emulator present\n");
+ } else
+ pmath_emulate = math_emulate;
break;
case MOD_UNLOAD:
if (pmath_emulate != math_emulate) {
@@ -502,8 +532,6 @@ gnufpu_modevent(module_t mod, int type, void *unused)
return EACCES;
}
pmath_emulate = 0;
- if (bootverbose)
- printf("GPL Math emulator unloaded\n");
break;
default:
break;
@@ -516,4 +544,6 @@ moduledata_t gnufpumod = {
gnufpu_modevent,
0
};
-DECLARE_MODULE(gnufpu, gnufpumod, SI_SUB_DRIVERS, SI_ORDER_ANY);
+DECLARE_MODULE(gnufpu, gnufpu_modevent, SI_SUB_PSEUDO, SI_ORDER_ANY);
+
+#endif /* LKM */
diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c
index 7aeb2583bf0df..aac272582aa29 100644
--- a/sys/gnu/i386/isa/dgb.c
+++ b/sys/gnu/i386/isa/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.40 1998/08/23 08:26:39 bde Exp $
+ * dgb.c $Id: dgb.c,v 1.39 1998/08/16 01:21:49 bde Exp $
*
* Digiboard driver.
*
@@ -407,8 +407,10 @@ dgbprobe(dev)
struct isa_device *dev;
{
struct dgb_softc *sc= &dgb_softc[dev->id_unit];
- int i, v;
+ int i, v, t;
u_long win_size; /* size of vizible memory window */
+ u_char *mem;
+ int addr;
int unit=dev->id_unit;
sc->unit=dev->id_unit;
@@ -523,6 +525,7 @@ dgbattach(dev)
int addr;
struct dgb_p *port;
volatile struct board_chan *bc;
+ struct global_data *gd;
int shrinkmem;
int nfails;
ushort *pstat;
@@ -1280,6 +1283,7 @@ dgbpoll(unit_c)
int rhead, rtail;
int whead, wtail;
int size;
+ int c=0;
u_char *ptr;
int ocount;
int ibuf_full,obuf_full;
@@ -1508,6 +1512,7 @@ dgbpoll(unit_c)
setwin(sc,0);
}
}
+ end_of_buffer: ;
}
bc->idata=1; /* require event on incoming data */
@@ -1952,6 +1957,7 @@ dgbparam(tp, t)
struct termios *t;
{
int dev=tp->t_dev;
+ int mynor=minor(dev);
int unit=MINOR_TO_UNIT(dev);
int pnum=MINOR_TO_PORT(dev);
struct dgb_softc *sc=&dgb_softc[unit];
@@ -1962,7 +1968,7 @@ dgbparam(tp, t)
int mval;
int iflag;
int hflow;
- int cs;
+ int s,cs;
BoardMemWinState ws=bmws_get();
@@ -2164,6 +2170,7 @@ dgbstop(tp, rw)
struct dgb_p *port;
struct dgb_softc *sc;
volatile struct board_chan *bc;
+ int head;
int s;
BoardMemWinState ws=bmws_get();
diff --git a/sys/gnu/i386/isa/dgm.c b/sys/gnu/i386/isa/dgm.c
index 8b0ca1ff4e782..eca931ae8639a 100644
--- a/sys/gnu/i386/isa/dgm.c
+++ b/sys/gnu/i386/isa/dgm.c
@@ -1,5 +1,5 @@
/*-
- * $Id: dgm.c,v 1.5 1998/08/23 08:26:40 bde Exp $
+ * $Id: dgm.c,v 1.4 1998/08/16 01:21:49 bde Exp $
*
* This driver and the associated header files support the ISA PC/Xem
* Digiboards. Its evolutionary roots are described below.
@@ -381,7 +381,9 @@ dgmprobe(dev)
struct isa_device *dev;
{
struct dgm_softc *sc= &dgm_softc[dev->id_unit];
- int i, v;
+ int i, v, t;
+ u_char *mem;
+ int addr;
int unit=dev->id_unit;
sc->unit=dev->id_unit;
@@ -447,9 +449,14 @@ dgmattach(dev)
int addr;
struct dgm_p *port;
volatile struct board_chan *bc;
+ struct global_data *gd;
int shrinkmem;
+ int nfails;
+ ushort *pstat;
int lowwater;
static int nports=0;
+ char ch;
+ int stuff;
if(sc->status!=ENABLED) {
DPRINT2(DB_EXCEPT,"dbg%d: try to attach a disabled card\n",unit);
@@ -1080,6 +1087,7 @@ dgmpoll(unit_c)
int rhead, rtail;
int whead, wtail;
int size;
+ int c=0;
u_char *ptr;
int ocount;
int ibuf_full,obuf_full;
@@ -1308,6 +1316,7 @@ dgmpoll(unit_c)
setwin(sc,0);
}
}
+ end_of_buffer: ;
}
bc->idata=1; /* require event on incoming data */
@@ -1752,6 +1761,7 @@ dgmparam(tp, t)
struct termios *t;
{
int dev=tp->t_dev;
+ int mynor=minor(dev);
int unit=MINOR_TO_UNIT(dev);
int pnum=MINOR_TO_PORT(dev);
struct dgm_softc *sc=&dgm_softc[unit];
@@ -1762,7 +1772,7 @@ dgmparam(tp, t)
int mval;
int iflag;
int hflow;
- int cs;
+ int s,cs;
BoardMemWinState ws=bmws_get();
@@ -1965,6 +1975,7 @@ dgmstop(tp, rw)
struct dgm_p *port;
struct dgm_softc *sc;
volatile struct board_chan *bc;
+ int head;
int s;
BoardMemWinState ws=bmws_get();
diff --git a/sys/gnu/i386/isa/sound/awe_wave.c b/sys/gnu/i386/isa/sound/awe_wave.c
index 1bffbf5a4654d..3dc591e635cd8 100644
--- a/sys/gnu/i386/isa/sound/awe_wave.c
+++ b/sys/gnu/i386/isa/sound/awe_wave.c
@@ -74,11 +74,11 @@
static int debug_mode = 0;
#ifdef AWE_DEBUG_ON
-#define AWE_DEBUG(LVL,XXX) {if (debug_mode > LVL) { XXX; }}
+#define DEBUG(LVL,XXX) {if (debug_mode > LVL) { XXX; }}
#define ERRMSG(XXX) {if (debug_mode) { XXX; }}
#define FATALERR(XXX) XXX
#else
-#define AWE_DEBUG(LVL,XXX) /**/
+#define DEBUG(LVL,XXX) /**/
#define ERRMSG(XXX) XXX
#define FATALERR(XXX) XXX
#endif
@@ -578,7 +578,7 @@ int attach_awe(void)
/* intialize AWE32 hardware */
awe_initialize();
- snprintf(awe_info.name, sizeof(awe_info.name), "AWE32-%s (RAM%dk)",
+ sprintf(awe_info.name, "AWE32-%s (RAM%dk)",
AWEDRV_VERSION, awe_mem_size/1024);
#ifdef __FreeBSD__
printk("awe0: <SoundBlaster EMU8000 MIDI (RAM%dk)>", awe_mem_size/1024);
@@ -806,7 +806,7 @@ awe_release_region(void)
static void
awe_initialize(void)
{
- AWE_DEBUG(0,printk("AWE32: initializing..\n"));
+ DEBUG(0,printk("AWE32: initializing..\n"));
/* initialize hardware configuration */
awe_poke(AWE_HWCF1, 0x0059);
@@ -1300,7 +1300,7 @@ awe_note_on(int voice)
temp = FX_BYTE(fx, fx_lay, AWE_FX_CHORUS, vp->parm.chorus);
temp = (temp <<24) | (unsigned int)addr;
awe_poke_dw(AWE_CSL(voice), temp);
- AWE_DEBUG(4,printk("AWE32: [-- loopend=%x/%x]\n", vp->loopend, addr));
+ DEBUG(4,printk("AWE32: [-- loopend=%x/%x]\n", vp->loopend, addr));
/* Q & current address (Q 4bit value, MSB) */
addr = vp->start - 1;
@@ -1309,7 +1309,7 @@ awe_note_on(int voice)
temp = FX_BYTE(fx, fx_lay, AWE_FX_FILTERQ, vp->parm.filterQ);
temp = (temp<<28) | (unsigned int)addr;
awe_poke_dw(AWE_CCCA(voice), temp);
- AWE_DEBUG(4,printk("AWE32: [-- startaddr=%x/%x]\n", vp->start, addr));
+ DEBUG(4,printk("AWE32: [-- startaddr=%x/%x]\n", vp->start, addr));
/* reset volume */
awe_poke_dw(AWE_VTFT(voice), 0x0000FFFF);
@@ -1385,7 +1385,7 @@ awe_exclusive_off(int voice)
if (i != voice && IS_PLAYING(i) &&
voices[i].sample && voices[i].ch == voices[voice].ch &&
voices[i].sample->exclusiveClass == exclass) {
- AWE_DEBUG(4,printk("AWE32: [exoff(%d)]\n", i));
+ DEBUG(4,printk("AWE32: [exoff(%d)]\n", i));
awe_terminate(i);
awe_voice_init(i, TRUE);
}
@@ -1403,7 +1403,7 @@ awe_set_pitch(int voice, int forced)
{
if (IS_NO_EFFECT(voice) && !forced) return;
awe_poke(AWE_IP(voice), voices[voice].apitch);
- AWE_DEBUG(3,printk("AWE32: [-- pitch=%x]\n", voices[voice].apitch));
+ DEBUG(3,printk("AWE32: [-- pitch=%x]\n", voices[voice].apitch));
}
/* calculate & change pitch */
@@ -1486,7 +1486,7 @@ awe_set_pan(int voice, int forced)
temp = (temp<<24) | (unsigned int)addr;
awe_poke_dw(AWE_PSST(voice), temp);
voices[voice].apan = temp;
- AWE_DEBUG(4,printk("AWE32: [-- loopstart=%x/%x]\n", vp->loopstart, addr));
+ DEBUG(4,printk("AWE32: [-- loopstart=%x/%x]\n", vp->loopstart, addr));
}
}
@@ -1584,26 +1584,26 @@ awe_calc_pitch(int voice)
if ((ap = vp->sample) == NULL)
return;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
/* calculate offset */
if (ap->fixkey >= 0) {
- AWE_DEBUG(3,printk("AWE32: p-> fixkey(%d) tune(%d)\n", ap->fixkey, ap->tune));
+ DEBUG(3,printk("AWE32: p-> fixkey(%d) tune(%d)\n", ap->fixkey, ap->tune));
offset = (ap->fixkey - ap->root) * 4096 / 12;
} else {
- AWE_DEBUG(3,printk("AWE32: p(%d)-> root(%d) tune(%d)\n", vp->note, ap->root, ap->tune));
+ DEBUG(3,printk("AWE32: p(%d)-> root(%d) tune(%d)\n", vp->note, ap->root, ap->tune));
offset = (vp->note - ap->root) * 4096 / 12;
- AWE_DEBUG(4,printk("AWE32: p-> ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> ofs=%d\n", offset));
}
offset = (offset * ap->scaleTuning) / 100;
- AWE_DEBUG(4,printk("AWE32: p-> scale* ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> scale* ofs=%d\n", offset));
offset += ap->tune * 4096 / 1200;
- AWE_DEBUG(4,printk("AWE32: p-> tune+ ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> tune+ ofs=%d\n", offset));
if (cp->bender != 0) {
- AWE_DEBUG(3,printk("AWE32: p-> bend(%d) %d\n", voice, cp->bender));
+ DEBUG(3,printk("AWE32: p-> bend(%d) %d\n", voice, cp->bender));
/* (819200: 1 semitone) ==> (4096: 12 semitones) */
offset += cp->bender * cp->bender_range / 2400;
}
@@ -1616,7 +1616,7 @@ awe_calc_pitch(int voice)
/* 0xe000: root pitch */
vp->apitch = 0xe000 + ap->rate_offset + offset;
- AWE_DEBUG(4,printk("AWE32: p-> sum aofs=%x, rate_ofs=%d\n", vp->apitch, ap->rate_offset));
+ DEBUG(4,printk("AWE32: p-> sum aofs=%x, rate_ofs=%d\n", vp->apitch, ap->rate_offset));
if (vp->apitch > 0xffff)
vp->apitch = 0xffff;
if (vp->apitch < 0)
@@ -1643,7 +1643,7 @@ awe_calc_pitch_from_freq(int voice, int freq)
if ((ap = vp->sample) == NULL)
return;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
@@ -1696,7 +1696,7 @@ awe_calc_volume(int voice)
ap = vp->sample;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
@@ -1714,7 +1714,7 @@ awe_calc_volume(int voice)
if (vol > 255) vol = 255;
vp->avol = vol;
- AWE_DEBUG(3,printk("AWE32: [-- voice(%d) vol=%x]\n", voice, vol));
+ DEBUG(3,printk("AWE32: [-- voice(%d) vol=%x]\n", voice, vol));
}
@@ -1985,7 +1985,7 @@ awe_kill_note(int dev, int voice, int note, int velocity)
{
int i, v2, key;
- AWE_DEBUG(2,printk("AWE32: [off(%d) nt=%d vl=%d]\n", voice, note, velocity));
+ DEBUG(2,printk("AWE32: [off(%d) nt=%d vl=%d]\n", voice, note, velocity));
if (! voice_in_range(voice))
return RET_ERROR(EINVAL);
@@ -2044,7 +2044,7 @@ awe_start_note(int dev, int voice, int note, int velocity)
{
int i, key, state, volonly;
- AWE_DEBUG(2,printk("AWE32: [on(%d) nt=%d vl=%d]\n", voice, note, velocity));
+ DEBUG(2,printk("AWE32: [on(%d) nt=%d vl=%d]\n", voice, note, velocity));
if (! voice_in_range(voice))
return RET_ERROR(EINVAL);
@@ -2171,7 +2171,7 @@ awe_set_instr(int dev, int voice, int instr_no)
cinfo->def_vrec = awe_search_instr(misc_modes[AWE_MD_DEF_BANK], instr_no);
if (cinfo->vrec < 0 && cinfo->def_vrec < 0) {
- AWE_DEBUG(1,printk("AWE32 Warning: can't find instrument %d\n", instr_no));
+ DEBUG(1,printk("AWE32 Warning: can't find instrument %d\n", instr_no));
}
cinfo->instr = instr_no;
@@ -2346,7 +2346,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_REMOVE_LAST_SAMPLES:
- AWE_DEBUG(0,printk("AWE32: remove last samples\n"));
+ DEBUG(0,printk("AWE32: remove last samples\n"));
if (locked_sf_id > 0)
awe_remove_samples(locked_sf_id);
break;
@@ -2368,7 +2368,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
if (p1 & 0x80) i = FX_FLAG_ADD;
p1 &= 0x3f;
if (p1 < AWE_FX_END) {
- AWE_DEBUG(0,printk("AWE32: effects (%d) %d %d\n", voice, p1, p2));
+ DEBUG(0,printk("AWE32: effects (%d) %d %d\n", voice, p1, p2));
if (i == FX_FLAG_SET)
FX_SET(fx, p1, p2);
else if (i == FX_FLAG_ADD)
@@ -2376,7 +2376,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
else
FX_UNSET(fx, p1);
if (i != FX_FLAG_OFF && parm_defs[p1].realtime) {
- AWE_DEBUG(0,printk("AWE32: fx_realtime (%d)\n", voice));
+ DEBUG(0,printk("AWE32: fx_realtime (%d)\n", voice));
awe_voice_change(voice, parm_defs[p1].realtime);
}
}
@@ -2402,7 +2402,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_INITIAL_VOLUME:
- AWE_DEBUG(0,printk("AWE32: init attenuation %d\n", p1));
+ DEBUG(0,printk("AWE32: init attenuation %d\n", p1));
if (p2 == 0) /* absolute value */
init_atten = (short)p1;
else /* relative value */
@@ -2422,18 +2422,18 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_CHANNEL_MODE:
- AWE_DEBUG(0,printk("AWE32: channel mode = %d\n", p1));
+ DEBUG(0,printk("AWE32: channel mode = %d\n", p1));
playing_mode = p1;
awe_reset(0);
break;
case _AWE_DRUM_CHANNELS:
- AWE_DEBUG(0,printk("AWE32: drum flags = %x\n", p1));
+ DEBUG(0,printk("AWE32: drum flags = %x\n", p1));
drum_flags = *(unsigned int*)&event[4];
break;
case _AWE_MISC_MODE:
- AWE_DEBUG(0,printk("AWE32: misc mode = %d %d\n", p1, p2));
+ DEBUG(0,printk("AWE32: misc mode = %d %d\n", p1, p2));
if (p1 > AWE_MD_VERSION && p1 < AWE_MD_END)
misc_modes[p1] = p2;
break;
@@ -2443,7 +2443,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
default:
- AWE_DEBUG(0,printk("AWE32: hw control cmd=%d voice=%d\n", cmd, voice));
+ DEBUG(0,printk("AWE32: hw control cmd=%d voice=%d\n", cmd, voice));
break;
}
}
@@ -2455,7 +2455,7 @@ awe_aftertouch(int dev, int voice, int pressure)
{
int note;
- AWE_DEBUG(2,printk("AWE32: [after(%d) %d]\n", voice, pressure));
+ DEBUG(2,printk("AWE32: [after(%d) %d]\n", voice, pressure));
if (! voice_in_range(voice))
return;
@@ -2492,7 +2492,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
switch (ctrl_num) {
case CTL_BANK_SELECT: /* MIDI control #0 */
- AWE_DEBUG(2,printk("AWE32: [bank(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [bank(%d) %d]\n", voice, value));
if (MULTI_LAYER_MODE() && IS_DRUM_CHANNEL(voice) &&
!misc_modes[AWE_MD_TOGGLE_DRUM_BANK])
break;
@@ -2505,7 +2505,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
case CTL_MODWHEEL: /* MIDI control #1 */
- AWE_DEBUG(2,printk("AWE32: [modwheel(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [modwheel(%d) %d]\n", voice, value));
i = value * misc_modes[AWE_MD_MOD_SENSE] / 1200;
FX_ADD(&cinfo->fx, AWE_FX_LFO1_PITCH, i);
awe_voice_change(voice, awe_fx_fmmod);
@@ -2514,14 +2514,14 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
case CTRL_PITCH_BENDER: /* SEQ1 V2 contorl */
- AWE_DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, value));
/* zero centered */
cinfo->bender = value;
awe_voice_change(voice, awe_set_voice_pitch);
break;
case CTRL_PITCH_BENDER_RANGE: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [range(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [range(%d) %d]\n", voice, value));
/* value = sense x 100 */
cinfo->bender_range = value;
/* no audible pitch change yet.. */
@@ -2531,14 +2531,14 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
if (SINGLE_LAYER_MODE())
value /= 128;
case CTRL_EXPRESSION: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [expr(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [expr(%d) %d]\n", voice, value));
/* 0 - 127 */
cinfo->expression_vol = value;
awe_voice_change(voice, awe_set_voice_vol);
break;
case CTL_PAN: /* MIDI control #10 */
- AWE_DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, value));
/* (0-127) -> signed 8bit */
cinfo->panning = value * 2 - 128;
if (misc_modes[AWE_MD_REALTIME_PAN])
@@ -2549,19 +2549,19 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
if (SINGLE_LAYER_MODE())
value = (value * 100) / 16383;
case CTRL_MAIN_VOLUME: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [mainvol(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [mainvol(%d) %d]\n", voice, value));
/* 0 - 127 */
cinfo->main_vol = value;
awe_voice_change(voice, awe_set_voice_vol);
break;
case CTL_EXT_EFF_DEPTH: /* reverb effects: 0-127 */
- AWE_DEBUG(2,printk("AWE32: [reverb(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [reverb(%d) %d]\n", voice, value));
FX_SET(&cinfo->fx, AWE_FX_REVERB, value * 2);
break;
case CTL_CHORUS_DEPTH: /* chorus effects: 0-127 */
- AWE_DEBUG(2,printk("AWE32: [chorus(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [chorus(%d) %d]\n", voice, value));
FX_SET(&cinfo->fx, AWE_FX_CHORUS, value * 2);
break;
@@ -2588,7 +2588,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
default:
- AWE_DEBUG(0,printk("AWE32: [control(%d) ctrl=%d val=%d]\n",
+ DEBUG(0,printk("AWE32: [control(%d) ctrl=%d val=%d]\n",
voice, ctrl_num, value));
break;
}
@@ -2612,7 +2612,7 @@ awe_panning(int dev, int voice, int value)
cinfo = &channels[voice];
cinfo->panning = value;
- AWE_DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, cinfo->panning));
+ DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, cinfo->panning));
if (misc_modes[AWE_MD_REALTIME_PAN])
awe_voice_change(voice, awe_set_pan);
}
@@ -2623,7 +2623,7 @@ static void
awe_volume_method(int dev, int mode)
{
/* not impremented */
- AWE_DEBUG(0,printk("AWE32: [volmethod mode=%d]\n", mode));
+ DEBUG(0,printk("AWE32: [volmethod mode=%d]\n", mode));
}
@@ -2656,7 +2656,7 @@ awe_bender(int dev, int voice, int value)
/* convert to zero centered value */
cinfo = &channels[voice];
cinfo->bender = value - 8192;
- AWE_DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, cinfo->bender));
+ DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, cinfo->bender));
awe_voice_change(voice, awe_set_voice_pitch);
}
@@ -3341,7 +3341,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_LOOP_BACK)
smp->mode_flags |= AWE_SAMPLE_REVERSE_LOOP;
- AWE_DEBUG(0,printk("AWE32: [sample %d mode %x]\n", patch.instr_no, smp->mode_flags));
+ DEBUG(0,printk("AWE32: [sample %d mode %x]\n", patch.instr_no, smp->mode_flags));
if (patch.mode & WAVE_16_BITS) {
/* convert to word offsets */
smp->size /= 2;
@@ -3369,7 +3369,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
rec->tune = -(note % 100);
rec->low = freq_to_note(patch.low_note) / 100;
rec->high = freq_to_note(patch.high_note) / 100;
- AWE_DEBUG(1,printk("AWE32: [gus base offset=%d, note=%d, range=%d-%d(%lu-%lu)]\n",
+ DEBUG(1,printk("AWE32: [gus base offset=%d, note=%d, range=%d-%d(%lu-%lu)]\n",
rec->rate_offset, note,
rec->low, rec->high,
patch.low_note, patch.high_note));
@@ -3402,7 +3402,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
rec->parm.voldcysus = (calc_gus_sustain(patch.env_offset[2]) << 8) |
calc_parm_decay(decay);
rec->parm.volrelease = 0x8000 | calc_parm_decay(release);
- AWE_DEBUG(2,printk("AWE32: [gusenv atk=%d, hld=%d, dcy=%d, rel=%d]\n", attack, hold, decay, release));
+ DEBUG(2,printk("AWE32: [gusenv atk=%d, hld=%d, dcy=%d, rel=%d]\n", attack, hold, decay, release));
rec->attenuation = calc_gus_attenuation(patch.env_offset[0]);
}
@@ -3410,7 +3410,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_TREMOLO) {
int rate = (patch.tremolo_rate * 1000 / 38) / 42;
rec->parm.tremfrq = ((patch.tremolo_depth / 2) << 8) | rate;
- AWE_DEBUG(2,printk("AWE32: [gusenv tremolo rate=%d, dep=%d, tremfrq=%x]\n",
+ DEBUG(2,printk("AWE32: [gusenv tremolo rate=%d, dep=%d, tremfrq=%x]\n",
patch.tremolo_rate, patch.tremolo_depth,
rec->parm.tremfrq));
}
@@ -3418,7 +3418,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_VIBRATO) {
int rate = (patch.vibrato_rate * 1000 / 38) / 42;
rec->parm.fm2frq2 = ((patch.vibrato_depth / 6) << 8) | rate;
- AWE_DEBUG(2,printk("AWE32: [gusenv vibrato rate=%d, dep=%d, tremfrq=%x]\n",
+ DEBUG(2,printk("AWE32: [gusenv vibrato rate=%d, dep=%d, tremfrq=%x]\n",
patch.tremolo_rate, patch.tremolo_depth,
rec->parm.tremfrq));
}
@@ -3806,7 +3806,7 @@ awe_setup_voice(int dev, int voice, int chn)
if (voice < 0 || voice >= awe_max_voices)
return;
- AWE_DEBUG(2,printk("AWE32: [setup(%d) ch=%d]\n", voice, chn));
+ DEBUG(2,printk("AWE32: [setup(%d) ch=%d]\n", voice, chn));
channels[chn].expression_vol = info->controllers[CTL_EXPRESSION];
channels[chn].main_vol = info->controllers[CTL_MAIN_VOLUME];
channels[chn].panning =
@@ -3841,7 +3841,7 @@ awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
level = (int)IOCTL_IN(arg);
level = ((level & 0xff) + (level >> 8)) / 2;
- AWE_DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
+ DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
if (IO_WRITE_CHECK(cmd)) {
switch (cmd & 0xff) {
@@ -4121,7 +4121,7 @@ awe_init_fm(void)
if (awe_mem_size <= 0)
return;
#endif
- AWE_DEBUG(3,printk("AWE32: initializing FM\n"));
+ DEBUG(3,printk("AWE32: initializing FM\n"));
/* Initialize the last two channels for DRAM refresh and producing
the reverb and chorus effects for Yamaha OPL-3 synthesizer */
@@ -4280,7 +4280,7 @@ awe_detect_base(int addr)
return 0;
if ((awe_peek(AWE_HWCF2) & 0x0003) != 0x0003)
return 0;
- AWE_DEBUG(0,printk("AWE32 found at %x\n", awe_base));
+ DEBUG(0,printk("AWE32 found at %x\n", awe_base));
return 1;
}
@@ -4292,7 +4292,7 @@ awe_detect(void)
for (base = 0x620; base <= 0x680; base += 0x20)
if (awe_detect_base(base))
return 1;
- AWE_DEBUG(0,printk("AWE32 not found\n"));
+ DEBUG(0,printk("AWE32 not found\n"));
return 0;
}
return 1;
@@ -4351,7 +4351,7 @@ awe_check_dram(void)
}
awe_close_dram();
- AWE_DEBUG(0,printk("AWE32: %d Kbytes memory detected\n", awe_mem_size));
+ DEBUG(0,printk("AWE32: %d Kbytes memory detected\n", awe_mem_size));
/* convert to Kbytes */
awe_mem_size *= 1024;
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c
index 42515c8d5cf30..c871151c7ae04 100644
--- a/sys/i386/apm/apm.c
+++ b/sys/i386/apm/apm.c
@@ -15,7 +15,7 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.76 1998/12/04 21:28:39 archie Exp $
+ * $Id: apm.c,v 1.73 1998/07/06 06:29:03 imp Exp $
*/
#include "opt_devfs.h"
@@ -29,7 +29,6 @@
#endif /*DEVFS*/
#include <sys/systm.h>
#include <sys/time.h>
-#include <sys/reboot.h>
#include <i386/isa/isa_device.h>
#include <machine/apm_bios.h>
#include <machine/segments.h>
@@ -246,13 +245,12 @@ apm_display(int newstate)
/*
* Turn off the entire system.
*/
-static void
-apm_power_off(int howto, void *junk)
+void
+apm_power_off(void)
{
u_long eax, ebx, ecx, edx;
- /* Not halting powering off, or not active */
- if (!(howto & RB_POWEROFF) || !apm_softc.active)
+ if (!apm_softc.active)
return;
eax = (APM_BIOS << 8) | APM_SETPWSTATE;
ebx = PMDV_ALLDEV;
@@ -795,7 +793,7 @@ apmattach(struct isa_device *dvp)
sc->ds_base = (apm_ds_base << 4) + APM_KERNBASE;
sc->cs32_limit = apm_cs32_limit - 1;
if (apm_cs16_limit == 0)
- apm_cs16_limit = apm_cs32_limit;
+ apm_cs16_limit == apm_cs32_limit;
sc->cs16_limit = apm_cs16_limit - 1;
sc->ds_limit = apm_ds_limit - 1;
sc->cs_entry = apm_cs_entry;
@@ -905,9 +903,6 @@ apmattach(struct isa_device *dvp)
apm_event_enable();
- /* Power the system off using APM */
- at_shutdown_pri(apm_power_off, NULL, SHUTDOWN_FINAL, SHUTDOWN_PRI_LAST);
-
sc->initialized = 1;
#ifdef DEVFS
diff --git a/sys/i386/boot/Makefile b/sys/i386/boot/Makefile
index dc8ad32a5f6a3..a075627ba2496 100644
--- a/sys/i386/boot/Makefile
+++ b/sys/i386/boot/Makefile
@@ -1,5 +1,5 @@
-# $Id: Makefile,v 1.29 1997/07/10 21:58:43 joerg Exp $
+# $Id: Makefile,v 1.28 1997/02/22 09:29:58 peter Exp $
-SUBDIR= cdboot dosboot kzipboot netboot rawboot
+SUBDIR= biosboot cdboot dosboot kzipboot netboot rawboot
.include <bsd.subdir.mk>
diff --git a/sys/i386/boot/Makefile.inc b/sys/i386/boot/Makefile.inc
index 520458a2126b6..2b92805e79772 100644
--- a/sys/i386/boot/Makefile.inc
+++ b/sys/i386/boot/Makefile.inc
@@ -1,7 +1,5 @@
-# $Id: Makefile.inc,v 1.3 1998/12/30 10:05:56 bde Exp $
+# $Id$
-BINDIR?= /usr/mdec
-CFLAGS+= -aout
.if exists(${.CURDIR}/../../../../include)
CFLAGS+= -nostdinc -I${.CURDIR}/../../../../include
.endif
diff --git a/sys/i386/boot/biosboot/Makefile b/sys/i386/boot/biosboot/Makefile
index e4feaf98de984..cf517706cdb92 100644
--- a/sys/i386/boot/biosboot/Makefile
+++ b/sys/i386/boot/biosboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.67 1998/11/21 21:07:17 ache Exp $
+# $Id: Makefile,v 1.65 1998/09/15 09:59:57 gibbs Exp $
#
PROG= boot
@@ -6,6 +6,7 @@ PROG= boot
SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S
SRCS+= probe_keyboard.c io.c disk.c sys.c
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-mno-486 \
@@ -59,8 +60,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
@@ -81,11 +82,19 @@ boot2: boot.nohdr
all: boot1 boot2
install:
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- boot1 boot2 ${DESTDIR}${BINDIR}/
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot1 ${DESTDIR}${BINDIR}/boot1
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot2 ${DESTDIR}${BINDIR}/boot2
+ for i in da fd wd od vn wfd ; do \
+ ( cd ${DESTDIR}${BINDIR} ; \
+ rm -f boot$${i} $${i}boot ; \
+ ln -s boot1 $${i}boot ; \
+ ln -s boot2 boot$${i} ; ) \
+ done
install-boothelp:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
${.CURDIR}/boot.help ${DESTDIR}/
.include <bsd.kern.mk>
diff --git a/sys/i386/boot/biosboot/README.serial b/sys/i386/boot/biosboot/README.serial
index 732e4787e35ce..f00d7d0f2d111 100644
--- a/sys/i386/boot/biosboot/README.serial
+++ b/sys/i386/boot/biosboot/README.serial
@@ -105,7 +105,7 @@ To boot FreeBSD in serial console mode, you must do the following:
higher priority console). This replaces the COMCONSOLE option.
Example:
- device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
+ device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4 vector siointr
If the flags were not set, you need to run UserConfig (on a different
console) or recompile the kernel.
@@ -185,7 +185,7 @@ CAVEATS:
`flags' for the serial port you want to use. For example, if you
want to make COM2 the console:
- device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3
+ device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3 vector siointr
The console flags for the other serial ports should not be set.
o Recompile both the boot blocks and the kernel.
@@ -193,4 +193,4 @@ CAVEATS:
from the new kernel.
-$Id: README.serial,v 1.9 1997/06/16 06:32:51 charnier Exp $
+$Id: README.serial,v 1.8 1997/06/09 05:10:54 bde Exp $
diff --git a/sys/i386/boot/biosboot/probe_keyboard.c b/sys/i386/boot/biosboot/probe_keyboard.c
index 7856d586a58ff..951d92bcc57fb 100644
--- a/sys/i386/boot/biosboot/probe_keyboard.c
+++ b/sys/i386/boot/biosboot/probe_keyboard.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp $
+ * $Id:$
*/
#include <sys/types.h>
@@ -31,8 +31,7 @@
#include <machine/cpufunc.h>
#include <i386/isa/isa.h>
-
-#include <dev/kbd/atkbdcreg.h>
+#include <i386/isa/kbdio.h>
#include "boot.h"
diff --git a/sys/i386/boot/cdboot/Makefile b/sys/i386/boot/cdboot/Makefile
index b59e851fd870a..4c01c44b33730 100644
--- a/sys/i386/boot/cdboot/Makefile
+++ b/sys/i386/boot/cdboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 1998/03/12 12:26:47 bde Exp $
+# $Id: Makefile,v 1.3 1997/07/21 16:12:52 bde Exp $
#
PROG= boot
@@ -8,6 +8,7 @@ SRCS+= probe_keyboard.c io.c cdrom.c malloc.c
.PATH: ${.CURDIR}/../biosboot
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-mno-486 \
@@ -46,6 +47,10 @@ CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
CLEANFILES+= boot.img boot.nohdr boot.strip
LDFLAGS+= -N -T 0 -nostdlib
+#LINKS= ${BINDIR}/sdboot ${BINDIR}/wdboot\
+# ${BINDIR}/sdboot ${BINDIR}/fdboot\
+# ${BINDIR}/bootsd ${BINDIR}/bootwd\
+# ${BINDIR}/bootsd ${BINDIR}/bootfd
NOSHARED= YES
NOMAN=
STRIP=
@@ -63,8 +68,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
diff --git a/sys/i386/boot/dosboot/Makefile b/sys/i386/boot/dosboot/Makefile
index 26c0d0bf04aac..d73363f3eb52a 100644
--- a/sys/i386/boot/dosboot/Makefile
+++ b/sys/i386/boot/dosboot/Makefile
@@ -1,8 +1,9 @@
-# $Id: Makefile,v 1.4 1997/02/22 09:30:28 peter Exp $
+# $Id$
#
MPROG= fbsdboot.exe
CLEANFILES+= ${MPROG}
+BINDIR= /usr/mdec
BINMODE= 444
NOMAN=
STRIP=
diff --git a/sys/i386/boot/dosboot/disklabe.h b/sys/i386/boot/dosboot/disklabe.h
index 81a7c06af6d69..d550d47bcc1f2 100644
--- a/sys/i386/boot/dosboot/disklabe.h
+++ b/sys/i386/boot/dosboot/disklabe.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)disklabel.h 8.1 (Berkeley) 6/2/93
- * $Id: disklabe.h,v 1.4 1997/02/22 09:30:46 peter Exp $
+ * $Id$
*/
#ifndef _SYS_DISKLABEL_H_
@@ -100,7 +100,7 @@ struct disklabel {
* the disklabel is read off the disk or in-core copy.
* d_boot0 and d_boot1 are the (optional) names of the
* primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
+ * as found in /usr/mdec. These are returned when using
* getdiskbyname(3) to retrieve the values from /etc/disktab.
*/
#if defined(KERNEL) || defined(STANDALONE)
diff --git a/sys/i386/boot/kzipboot/Makefile b/sys/i386/boot/kzipboot/Makefile
index c1dc06009dad9..74eb39347480a 100644
--- a/sys/i386/boot/kzipboot/Makefile
+++ b/sys/i386/boot/kzipboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 1998/05/27 08:06:33 sos Exp $
+# $Id: Makefile,v 1.8 1998/03/07 10:48:10 eivind Exp $
PROG= kztail.o kzhead.o
BINMODE = 444 # target is a relocatable object
@@ -21,9 +21,9 @@ CFLAGS+= -DKADDR=$(KADDR) -DCSEG=$(CSEG)
CFLAGS+= -DKZIP -DCOMCONSOLE=0x3F8
kztail.o: ${OBJS_KZTAIL}
- $(LD) -aout -r -x -o kztail.o $(OBJS_KZTAIL)
+ $(LD) -r -x -o kztail.o $(OBJS_KZTAIL)
kzhead.o: ${OBJS_KZHEAD}
- $(LD) -aout -r -x -o kzhead.o $(OBJS_KZHEAD)
+ $(LD) -r -x -o kzhead.o $(OBJS_KZHEAD)
.include <bsd.prog.mk>
diff --git a/sys/i386/boot/kzipboot/malloc.c b/sys/i386/boot/kzipboot/malloc.c
index 052e5e357dbbd..cf51be721a517 100644
--- a/sys/i386/boot/kzipboot/malloc.c
+++ b/sys/i386/boot/kzipboot/malloc.c
@@ -36,8 +36,9 @@
extern unsigned char *storage;
void *
-kzipmalloc(nbytes)
+malloc(nbytes, junk1, junk2) /* junk? not used */
size_t nbytes;
+ int junk1, junk2;
{
unsigned char *p = storage;
storage += nbytes;
@@ -50,7 +51,8 @@ kzipmalloc(nbytes)
}
void
-kzipfree(cp)
+free(cp, junk) /* junk not used */
void *cp;
+ int junk;
{
}
diff --git a/sys/i386/boot/netboot/Makefile b/sys/i386/boot/netboot/Makefile
index 2d50c65a58e76..ec81713c1d049 100644
--- a/sys/i386/boot/netboot/Makefile
+++ b/sys/i386/boot/netboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.21 1998/11/28 08:03:24 joerg Exp $
+# $Id: Makefile,v 1.18 1998/06/30 11:10:24 phk Exp $
#
# Makefile for NETBOOT
#
@@ -30,6 +30,7 @@ PROG= nb8390.com nb3c509.com nb8390.rom nb3c509.rom
# Order is very important on the SRCS line for this prog
SRCS= start2.S main.c misc.c bootmenu.c rpc.c
+BINDIR= /usr/mdec
BINMODE= 555
#CFLAGS= -O2 -DNFS -DROMSIZE=${ROMSIZE} -DRELOC=${RELOCADDR} -DASK_BOOT
CFLAGS= -O2 -DNFS -DROMSIZE=${ROMSIZE} -DRELOC=${RELOCADDR} # -DASK_BOOT
@@ -40,12 +41,10 @@ NS8390= -DINCLUDE_NE
#NS8390+= -DINCLUDE_3COM -D_3COM_BASE=0x300
CLEANFILES+= netboot.com
CLEANFILES+= makerom start2.ro 3c509.o ns8390.o
-ROMLDFLAGS= ${LDFLAGS} -aout -N -T ${RELOCADDR} -e _start -nostdlib
+ROMLDFLAGS= ${LDFLAGS} -N -T ${RELOCADDR} -e _start -nostdlib
NOSHARED= YES
MAN8= netboot.8
-SIZE= size -aout
STRIP=
-STRIPCMD= strip -aout
ROMSIZE=16384
RELOCADDR=0x90000
@@ -66,27 +65,27 @@ makerom: makerom.c
nb8390.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} ns8390.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb3c509.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} 3c509.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb8390.com: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} ns8390.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
nb3c509.com: start2.o ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} 3c509.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
diff --git a/sys/i386/boot/rawboot/Makefile b/sys/i386/boot/rawboot/Makefile
index 061b6959ecf76..5b2729f0a61a8 100644
--- a/sys/i386/boot/rawboot/Makefile
+++ b/sys/i386/boot/rawboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/03/12 12:26:49 bde Exp $
+# $Id: Makefile,v 1.10 1998/03/07 10:48:15 eivind Exp $
#
PROG= boot
@@ -9,6 +9,7 @@ SRCS+= probe_keyboard.c io.c disk.c sys.c
.PATH: ${.CURDIR}/../biosboot
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-DRAWBOOT \
@@ -62,8 +63,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
index 76781f47b02a7..1b64ab682db20 100644
--- a/sys/i386/conf/GENERIC
+++ b/sys/i386/conf/GENERIC
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC,v 1.142 1999/01/09 18:12:07 wpaul Exp $
+# $Id: GENERIC,v 1.124 1998/10/10 08:13:58 jkh Exp $
machine "i386"
cpu "I386_CPU"
@@ -42,40 +42,36 @@ options VISUAL_USERCONFIG #visual boot -c editor
config kernel root on wd0
-# To make an SMP kernel, the next two are needed
-#options SMP # Symmetric MultiProcessor Kernel
-#options APIC_IO # Symmetric (APIC) I/O
-# Optionally these may need tweaked, (defaults shown):
-#options NCPU=2 # number of CPUs
-#options NBUS=4 # number of busses
-#options NAPIC=1 # number of IO APICs
-#options NINTR=24 # number of INTs
-
controller isa0
controller eisa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 2
options "CMD640" # work around CMD640 chip deficiency
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
disk wd0 at wdc0 drive 0
disk wd1 at wdc0 drive 1
-controller wdc1 at isa? port "IO_WD2" bio irq 15
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
disk wd2 at wdc1 drive 0
disk wd3 at wdc1 drive 1
options ATAPI #Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
-device acd0 #IDE CD-ROM
+device wcd0 #IDE CD-ROM
device wfd0 #IDE Floppy (e.g. LS-120)
-# A single entry for any of these controllers (ncr, ahb, ahc) is
+# A single entry for any of these controllers (ncr, ahb, ahc, amd) is
# sufficient for any number of installed devices.
controller ncr0
+#controller amd0
controller ahb0
controller ahc0
controller isp0
@@ -89,7 +85,11 @@ controller adv0 at isa? port ? cam irq ?
controller adw0
controller bt0 at isa? port ? cam irq ?
controller aha0 at isa? port ? cam irq ?
-#controller aic0 at isa? port 0x340 bio irq 11
+#controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
+#controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#controller nca1 at isa? port 0x350 bio irq 5 vector ncaintr
+#controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr
controller scbus0
@@ -101,33 +101,23 @@ device pass0
device cd0 #Only need one of these, the code dynamically grows
-device wt0 at isa? port 0x300 bio irq 5 drq 1
-device mcd0 at isa? port 0x300 bio irq 10
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
controller matcd0 at isa? port 0x230 bio
device scd0 at isa? port 0x230 bio
-# atkbdc0 controlls both the keyboard and the PS/2 mouse
-controller atkbdc0 at isa? port IO_KBD tty
-device atkbd0 at isa? tty irq 1
-device psm0 at isa? tty irq 12
-
-device vga0 at isa? port ? conflicts
-
-# splash screen/screen saver
-pseudo-device splash
-
# syscons is the default console driver, resembling an SCO console
-device sc0 at isa? tty
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
-#device vt0 at isa? tty
+#device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
#options XSERVER # support for X server
#options FAT_CURSOR # start with block cursor
# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
#options PCVT_SCANSET=2 # IBM keyboards are non-std
-device npx0 at isa? port IO_NPX irq 13
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
#
# Laptop support (see LINT for more options)
@@ -139,40 +129,36 @@ device apm0 at isa? disable flags 0x31 # Advanced Power Management
#device pcic0 at card?
#device pcic1 at card?
-device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4
-device sio1 at isa? port "IO_COM2" tty irq 3
-device sio2 at isa? disable port "IO_COM3" tty irq 5
-device sio3 at isa? disable port "IO_COM4" tty irq 9
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
-device lpt0 at isa? port? tty irq 7
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
# Right now it appears that the ie0 must be probed before ep0. See
# revision 1.20 of this file.
-device ax0
device de0
device fxp0
-device mx0
-device pn0
-device rl0
device tl0
device tx0
-device vr0
device vx0
-device wb0
device xl0
-device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000
-device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000
-device ep0 at isa? port 0x300 net irq 10
-device ex0 at isa? port? net irq?
-device fe0 at isa? port 0x300 net irq ?
-device le0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device lnc0 at isa? port 0x280 net irq 10 drq 0
-device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000
-device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000
-device cs0 at isa? port 0x300 net irq ?
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
pseudo-device loop
pseudo-device ether
@@ -195,27 +181,4 @@ options SYSVSHM
# aware of the legal and administrative consequences of enabling this
# option. The number of devices determines the maximum number of
# simultaneous BPF clients programs runnable.
-#pseudo-device bpfilter 4 #Berkeley packet filter
-
-
-# USB support
-#controller uhci0
-#controller ohci0
-#controller usb0
-#
-# for the moment we have to specify the priorities of the device
-# drivers explicitly by the ordering in the list below. This will
-# be changed in the future.
-#
-#device ums0
-#device ukbd0
-#device ulpt0
-#device uhub0
-#device ucom0
-#device umodem0
-#device hid0
-#device ugen0
-
-#
-#options USB_DEBUG
-#options USBVERBOSE
+#pseudo-device bpfilter 4 #Berkeley packet filter
diff --git a/sys/i386/conf/GENERICupgrade b/sys/i386/conf/GENERICupgrade
new file mode 100644
index 0000000000000..83e9619456c82
--- /dev/null
+++ b/sys/i386/conf/GENERICupgrade
@@ -0,0 +1,176 @@
+#
+# GENERICupgrade (a copy of GENERIC)
+#
+# This config file is used by the aout->elf transition build on systems
+# not running a 3.0-CURRENT kernel. Unless a kernel is built and installed
+# as part of the upgrade, the system will be hosed by the installation
+# of the 3.0 binaries and subsequent reboot. If the transition build is
+# being perfomed on a machine for which this config file is inappropriate,
+# it should be replaced with a suitable one prior to performing the upgrade.
+#
+# $Id: GENERICupgrade,v 1.2 1998/09/16 17:44:37 phk Exp $
+
+machine "i386"
+cpu "I386_CPU"
+cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident GENERIC
+maxusers 32
+
+options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root device
+options FFS_ROOT #FFS usable as root device [keep this!]
+options NFS_ROOT #NFS usable as root device
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+config kernel root on wd0
+
+controller isa0
+controller eisa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 2
+
+options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
+disk wd0 at wdc0 drive 0
+disk wd1 at wdc0 drive 1
+
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
+disk wd2 at wdc1 drive 0
+disk wd3 at wdc1 drive 1
+
+options ATAPI #Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+device wfd0 #IDE Floppy (e.g. LS-120)
+
+# A single entry for any of these controllers (ncr, ahb, ahc, amd) is
+# sufficient for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahb0
+controller ahc0
+controller isp0
+
+# This controller offers a number of configuration options, too many to
+# document here - see the LINT file in this directory and look up the
+# dpt0 entry there for much fuller documentation on this. The options
+# line following dpt0 here is also currently a *required* option for it.
+# controller dpt0
+# options DPT_MEASURE_PERFORMANCE
+
+controller adv0 at isa? port ? cam irq ?
+controller bt0 at isa? port ? cam irq ?
+controller aha0 at isa? port ? cam irq ?
+#controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
+#controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#controller nca1 at isa? port 0x350 bio irq 5 vector ncaintr
+#controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
+
+controller matcd0 at isa? port 0x230 bio
+
+device scd0 at isa? port 0x230 bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
+# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
+#device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
+#options XSERVER # support for X server
+#options FAT_CURSOR # start with block cursor
+# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
+#options PCVT_SCANSET=2 # IBM keyboards are non-std
+
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
+device lpt1 at isa? port? tty
+device mse0 at isa? port 0x23c tty irq 5 vector mseintr
+
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+device xl0
+
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT
index 762e124d525a5..db48f5f82bdd3 100644
--- a/sys/i386/conf/LINT
+++ b/sys/i386/conf/LINT
@@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
-# $Id: LINT,v 1.538 1999/01/20 03:29:51 msmith Exp $
+# $Id: LINT,v 1.486 1998/10/10 09:25:12 obrien Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@@ -178,10 +178,6 @@ cpu "I686_CPU" # aka Pentium Pro(tm)
# executed. This should be included for ALL kernels that won't run
# on a Pentium.
#
-# NO_MEMORY_HOLE is an optimisation for systems with AMD K6 processors
-# which indicates that the 15-16MB range is *definitely* not being
-# occupied by an ISA memory hole.
-#
# NOTE 1: The options, CPU_BTB_EN, CPU_LOOP_EN, CPU_IORT,
# CPU_LOOP_ENand CPU_RSTK_EN should not be used becasue of CPU bugs.
# These options may crash your system.
@@ -232,12 +228,6 @@ options GPL_MATH_EMULATE #Support for x87 emulation via
options "COMPAT_43"
#
-# Statically compile in the i386 a.out LKM compatability support.
-# Also available as an KLD module.
-#
-options LKM
-
-#
# Allow user-mode programs to manipulate their local descriptor tables.
# This option is required for the WINE Windows(tm) emulator, and is
# not used by anything else (that we know of).
@@ -297,29 +287,12 @@ options GDB_REMOTE_CHAT
options KTRACE #kernel tracing
#
-# The INVARIANTS option is used in a number of source files to enable
+# The DIAGNOSTIC option is used in a number of source files to enable
# extra sanity checking of internal structures. This support is not
# enabled by default because of the extra time it would take to check
# for these conditions, which can only occur as a result of
# programming errors.
#
-options INVARIANTS
-
-#
-# The INVARIANT_SUPPORT option makes us compile in support for
-# verifying some of the internal structures. It is a prerequisite for
-# 'INVARIANTS', as enabling 'INVARIANTS' will make these functions be
-# called. The intent is that you can set 'INVARIANTS' for single
-# source files (by changing the source file or specifying it on the
-# command line) if you have 'INVARIANT_SUPPORT' enabled.
-#
-options INVARIANT_SUPPORT
-
-#
-# The DIAGNOSTIC option is used to enable extra debugging information
-# from some parts of the kernel. As this makes everything more noisy,
-# it is disabled by default.
-#
options DIAGNOSTIC
#
@@ -344,7 +317,7 @@ options UCONSOLE
# XXX - this doesn't belong here either
options USERCONFIG #boot -c editor
-options INTRO_USERCONFIG #imply -c and show intro screen
+options USERCONFIG_BOOT #imply -c and parse info area
options VISUAL_USERCONFIG #visual boot -c editor
#####################################################################
@@ -408,7 +381,7 @@ pseudo-device ether #Generic Ethernet
pseudo-device fddi #Generic FDDI
pseudo-device sppp #Generic Synchronous PPP
pseudo-device loop #Network loopback device
-pseudo-device bpfilter 4 #Berkeley packet filter
+pseudo-device bpfilter 4 #Berkeley packet filter
pseudo-device disc #Discard device
pseudo-device tun 1 #Tunnel driver (user process ppp(8))
pseudo-device sl 2 #Serial Line IP
@@ -460,7 +433,7 @@ options MROUTING # Multicast routing
options IPFIREWALL #firewall
options IPFIREWALL_VERBOSE #print information about
# dropped packets
-options IPFIREWALL_FORWARD #enable transparent proxy support
+options IPFIREWALL_FORWARD #enable xparent proxy support
options "IPFIREWALL_VERBOSE_LIMIT=100" #limit verbosity
options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default
options IPDIVERT #divert sockets
@@ -469,19 +442,6 @@ options IPFILTER_LOG #ipfilter logging
#options IPFILTER_LKM #kernel support for ip_fil.o LKM
options TCPDEBUG
-# ICMP_BANDLIM enables icmp error response bandwidth limiting. You
-# typically want this option as it will help protect the machine from
-# D.O.S. packet attacks.
-#
-options "ICMP_BANDLIM"
-
-# DUMMYNET enables the "dummynet" bandwidth limiter. You need
-# IPFIREWALL as well. See the dummynet(4) manpage for more info.
-# BRIDGE enables bridging between ethernet cards -- see bridge(4).
-# You can use IPFIREWALL and dummynet together with bridging.
-options DUMMYNET
-options BRIDGE
-
#
# ATM (HARP version) options
#
@@ -554,15 +514,14 @@ options NFS_ROOT #NFS usable as root device
# Also, 'options MFS' is currently incompatible with DEVFS.
options DEVFS #devices filesystem
-# Soft updates is technique for improving file system speed and
-# making abrupt shutdown less risky. It is not enabled by default due
-# to copyright restraints on the code that implement it.
-#
-# Read .../../ufs/ffs/README.softupdates to learn what you need to
-# do to enable this. ../../../contrib/sys/softupdates/README gives
-# more details on how they actually work.
-#
+# Allow the FFS to use Softupdates technology.
+# To do this you need to copy the two files
+# /sys/ufs/ffs/softdep.h and /sys/ufs/ffs/ffs_softdep.c
+# from /usr/src/contrib/sys/softupdates
+# and understand the licensing restrictions.
+# You should also check on the FreeBSD website for newer versions.
#options SOFTUPDATES
+# (we can't actually enable it because the files may not be present)
# Make space in the kernel for a MFS root filesystem. Define to the number
# of kilobytes to reserve for the filesystem.
@@ -768,8 +727,6 @@ pseudo-device gzip #Exec gzipped a.out's
pseudo-device vn #Vnode driver (turns a file into a device)
pseudo-device snp 3 #Snoop device - to look at pty/vty/etc..
pseudo-device ccd 4 #Concatenated disk driver
-pseudo-device vinum #Vinum concat/mirror/raid driver
-options VINUMDEBUG #enable Vinum debugging hooks
# These are only for watching for bitrot in old tty code.
# broken
@@ -835,55 +792,22 @@ options "TUNE_1542"
options PPS_SYNC
-# If you see the "calcru: negative time of %ld usec for pid %d (%s)\n"
-# message you probably have some broken sw/hw which disables interrupts
-# for too long. You can make the system more resistant to this by
-# choosing a high value for NTIMECOUNTER. The default is 5, there
-# is no upper limit but more than a couple of hundred are not productive.
-
-options "NTIMECOUNTER=20"
-
# Enable PnP support in the kernel. This allows you to automaticly
# attach to PnP cards for drivers that support it and allows you to
# configure cards from USERCONFIG. See pnp(4) for more info.
controller pnp0
-# The keyboard controller; it controlls the keyboard and the PS/2 mouse.
-controller atkbdc0 at isa? port IO_KBD tty
-
-# The AT keyboard
-device atkbd0 at isa? tty irq 1
-
-# `flags' for atkbd:
-# 0x01 Force detection of keyboard, else we always assume a keyboard
-# 0x02 Don't reset keyboard, useful for some newer ThinkPads
-# 0x04 Old-style (XT) keyboard support, useful for older ThinkPads
-
-# PS/2 mouse
-device psm0 at isa? tty irq 12
-
-# Options for psm:
-options PSM_HOOKAPM #hook the APM resume event, useful
- #for some laptops
-options PSM_RESETAFTERSUSPEND #reset the device at the resume event
-
-# The video card driver.
-device vga0 at isa? port ? conflicts
-
-# Splash screen at start up! Screen savers require this too.
-pseudo-device splash
-
# The pcvt console driver (vt220 compatible).
-device vt0 at isa? tty
+device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
options XSERVER # support for running an X server.
options FAT_CURSOR # start with block cursor
# This PCVT option is for keyboards such as those used on IBM ThinkPad laptops
options PCVT_SCANSET=2 # IBM keyboards are non-std
# The syscons console driver (sco color console compatible).
-device sc0 at isa? tty
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
options MAXCONS=16 # number of virtual consoles
-options VGA_SLOW_IOACCESS # do byte-wide i/o's to TS and GDC regs
+options SLOW_VGA # do byte-wide i/o's to TS and GDC regs
options "STD8X16FONT" # Compile font in
makeoptions "STD8X16FONT"="cp850"
options SC_HISTORY_SIZE=200 # number of history buffer lines
@@ -903,6 +827,9 @@ options VESA # needs VM86 defined too!!
# 0x02 Use a 'blink' cursor
# 0x04 Use a 'underline' cursor
# 0x06 Use a 'blinking underline' (destructive) cursor
+# 0x08 Force detection of keyboard, else we always assume a keyboard
+# 0x10 Old-style (XT) keyboard support, useful for older ThinkPads
+# 0x20 Don't reset keyboard, useful for some newer ThinkPads
# 0x40 Make the bell quiet if it is rung in the backgroud vty.
#
@@ -911,7 +838,7 @@ options VESA # needs VM86 defined too!!
# buggy. If it is not configured then you *must* configure math emulation
# (see above). If both npx0 and emulation are configured, then only npx0
# is used (provided it works).
-device npx0 at isa? port IO_NPX iosiz 0x0 flags 0x0 irq 13
+device npx0 at isa? port "IO_NPX" iosiz 0x0 flags 0x0 irq 13 vector npxintr
#
# `flags' for npx0:
@@ -945,7 +872,7 @@ device npx0 at isa? port IO_NPX iosiz 0x0 flags 0x0 irq 13
#
#
-# SCSI host adapters: `aha', `aic', `bt'
+# SCSI host adapters: `aha', `aic', `bt', `nca'
#
# adv: All Narrow SCSI bus AdvanSys controllers.
# adw: Second Generation AdvanSys controllers including the ADV940UW.
@@ -953,6 +880,10 @@ device npx0 at isa? port IO_NPX iosiz 0x0 flags 0x0 irq 13
# ahc: Adaptec 274x/284x/294x
# aic: Adaptec 152x and sound cards using the Adaptec AIC-6360 (slow!)
# bt: Most Buslogic controllers
+# nca: ProAudioSpectrum cards using the NCR 5380 or Trantor T130
+# uha: UltraStor ULTRA 14F/24F/34F
+# sea: Seagate ST01/02 8 bit controller (slow!)
+# wds: Western Digital WD7000 controller (no scatter/gather!).
#
# Note that the order is important in order for Buslogic cards to be
# probed correctly.
@@ -962,9 +893,17 @@ controller bt0 at isa? port "IO_BT0" cam irq ?
controller adv0 at isa? port ? cam irq ?
controller adw0
controller aha0 at isa? port ? cam irq ?
+#!CAM# controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
-#!CAM# controller aic0 at isa? port 0x340 bio irq 11
+#!CAM# controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#!CAM# controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#!CAM# controller nca1 at isa? port 0x1f84
+#!CAM# controller nca2 at isa? port 0x1f8c
+#!CAM# controller nca3 at isa? port 0x1e88
+#!CAM# controller nca4 at isa? port 0x350 bio irq 5 vector ncaintr
+#!CAM# controller sea0 at isa? bio irq 5 iomem 0xdc000 iosiz 0x2000 vector seaintr
+#!CAM# controller wds0 at isa? port 0x350 bio irq 15 drq 6 vector wdsintr
#
# ST-506, ESDI, and IDE hard disks: `wdc' and `wd'
@@ -988,7 +927,7 @@ controller aha0 at isa? port ? cam irq ?
# specification with the low 16 bits for drive 0, and the high 16 bits
# for drive 1.
# e.g.:
-#controller wdc0 at isa? port "IO_WD1" bio irq 14 flags 0x00ff8004
+#controller wdc0 at isa? port "IO_WD1" bio irq 14 flags 0x00ff8004 vector wdintr
#
# specifies that drive 0 will be allowed to probe for 32 bit transfers and
# a maximum multi-sector transfer of 4 sectors, and drive 1 will not be
@@ -999,11 +938,11 @@ controller aha0 at isa? port ? cam irq ?
# mode (for example, it is a 2nd IDE PCI interface), then use config line(s)
# such as:
#
-#controller wdc2 at isa? port "0" bio irq ? flags 0xa0ffa0ff
+#controller wdc2 at isa? port "0" bio irq ? flags 0xa0ffa0ff vector wdintr
#disk wd4 at wdc2 drive 0
#disk wd5 at wdc2 drive 1
#
-#controller wdc3 at isa? port "0" bio irq ? flags 0xa0ffa0ff
+#controller wdc3 at isa? port "0" bio irq ? flags 0xa0ffa0ff vector wdintr
#disk wd6 at wdc3 drive 0
#disk wd7 at wdc3 drive 1
#
@@ -1012,10 +951,10 @@ controller aha0 at isa? port ? cam irq ?
# entries. These are automatically filled in by the IDE/PCI support.
#
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
disk wd0 at wdc0 drive 0
disk wd1 at wdc0 drive 1
-controller wdc1 at isa? port "IO_WD2" bio irq 15
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
disk wd2 at wdc1 drive 0
disk wd3 at wdc1 drive 1
@@ -1033,17 +972,13 @@ options "CMD640" #Enable work around for CMD640 h/w bug
options ATAPI #Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
-#
-# This option allow you to override the default probe time for IDE
-# devices, to get a faster probe. Setting this below 10000 violate
-# the IDE specs, but may still work for you (it will work for most
-# people).
-#
-options IDE_DELAY=8000 # Be optimistic about Joe IDE device
-
+# Use either the acd or the wcd device, not both!
# IDE CD-ROM & CD-R/RW driver - requires wdc controller and ATAPI option
device acd0
+# IDE CD-ROM driver - requires wdc controller and ATAPI option
+device wcd0
+
# IDE floppy driver - requires wdc controller and ATAPI option
device wfd0
@@ -1054,46 +989,49 @@ device wst0
#
# Standard floppy disk controllers and floppy tapes: `fdc', `fd', and `ft'
#
-controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
#
# FDC_DEBUG enables floppy debugging. Since the debug output is huge, you
# gotta turn it actually on by setting the variable fd_debug with DDB,
# however.
options FDC_DEBUG
-# FDC_YE enables support for the floppies used on the Libretto. This is a
-# pcmcia floppy. You will also need to add
-#card "Y-E DATA" "External FDD"
-# config 0x4 "fdc0" 10
-# to your pccard.conf file.
-options FDC_YE
# This option is undocumented on purpose.
options FDC_PRINT_BOGUS_CHIPTYPE
#
# Activate this line instead of the fdc0 line above if you happen to
# have an Insight floppy tape. Probing them proved to be dangerous
# for people with floppy disks only, so it's "hidden" behind a flag:
-#controller fdc0 at isa? port "IO_FD1" bio flags 1 irq 6 drq 2
+#controller fdc0 at isa? port "IO_FD1" bio flags 1 irq 6 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
+tape ft0 at fdc0 drive 2
+
#
-# Other standard PC hardware: `lpt', `mse', `sio', etc.
+# Other standard PC hardware: `lpt', `mse', `psm', `sio', etc.
#
# lpt: printer port
# lpt specials:
-# The port may be specified as ?. This will cause the
-# driver to scan the BIOS port list.
-# The irq clause may be omitted. This will force the port
-# into polling mode.
+# port can be specified as ?, this will cause the driver to scan
+# the BIOS port list;
+# the irq and vector clauses may be omitted, this
+# will force the port into polling mode.
# mse: Logitech and ATI InPort bus mouse ports
+# psm: PS/2 mouse port [note: conflicts with sc0/vt0, thus "conflicts" keywd]
# sio: serial ports (see sio(4))
-device lpt0 at isa? port? tty irq 7
-device lpt1 at isa? port "IO_LPT3" tty irq 5
-device mse0 at isa? port 0x23c tty irq 5
+device lpt0 at isa? port? tty irq 7 vector lptintr
+device lpt1 at isa? port "IO_LPT3" tty irq 5 vector lptintr
+device mse0 at isa? port 0x23c tty irq 5 vector mseintr
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
-device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
+# Options for psm:
+options PSM_HOOKAPM #hook the APM resume event, useful
+ #for some laptops
+options PSM_RESETAFTERSUSPEND #reset the device at the resume event
+
+device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4 vector siointr
#
# `flags' for serial drivers that support consoles (only for sio now):
@@ -1107,7 +1045,6 @@ device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
# 0x20 force this unit to be the console (unless there is another
# higher priority console). This replaces the COMCONSOLE option.
# 0x40 reserve this unit for low level console operations. Do not
-# access the device in any normal way.
#
# PnP `flags' (set via userconfig using pnp x flags y)
# 0x1 disable probing of this device. Used to prevent your modem
@@ -1122,6 +1059,7 @@ options CONSPEED=9600 #default speed for serial console (default 9600)
# Options for sio:
options COM_ESP #code for Hayes ESP
options COM_MULTIPORT #code for some cards with shared IRQs
+options DSI_SOFT_MODEM #code for DSI Softmodems
options "EXTRA_SIO=2" #number of extra sio ports to allocate
# Other flags for sio that aren't documented in the man page.
@@ -1137,13 +1075,11 @@ options "EXTRA_SIO=2" #number of extra sio ports to allocate
# ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503
# el: 3Com 3C501 (slow!)
# ep: 3Com 3C509 (buggy)
-# ex: Intel EtherExpress Pro/10 and other i82595-based adapters
# fe: Fujitsu MB86960A/MB86965A Ethernet
# ie: AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210; Intel EtherExpress
# le: Digital Equipment EtherWorks 2 and EtherWorks 3 (DEPCA, DE100,
# DE101, DE200, DE201, DE202, DE203, DE204, DE205, DE422)
-# lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 & Am79C960)
-# rdp: RealTek RTL 8002-based pocket ethernet adapters
+# lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL)
# sr: RISCom/N2 hdlc sync 1/2 port V.35/X.21 serial driver (requires sppp)
# wl: Lucent Wavelan (ISA card only).
# ze: IBM/National Semiconductor PCMCIA ethernet controller.
@@ -1152,27 +1088,27 @@ options "EXTRA_SIO=2" #number of extra sio ports to allocate
# attribute memory)
#
-device ar0 at isa? port 0x300 net irq 10 iomem 0xd0000
-device cs0 at isa? port 0x300 net irq ?
-device cx0 at isa? port 0x240 net irq 15 drq 7
-device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000
-device el0 at isa? port 0x300 net irq 9
-device ep0 at isa? port 0x300 net irq 10
-device ex0 at isa? port? net irq?
-device fe0 at isa? port 0x300 net irq ?
-device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device ie1 at isa? port 0x360 net irq 7 iomem 0xd0000
-device le0 at isa? port 0x300 net irq 5 iomem 0xd0000
-device lnc0 at isa? port 0x280 net irq 10 drq 0
-device rdp0 at isa? port 0x378 net irq 7 flags 2
-device sr0 at isa? port 0x300 net irq 5 iomem 0xd0000
+device ar0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector arintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
+device cx0 at isa? port 0x240 net irq 15 drq 7 vector cxintr
+device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000 vector edintr
+device eg0 at isa? port 0x310 net irq 5 vector egintr
+device el0 at isa? port 0x300 net irq 9 vector elintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device ie0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector ieintr
+device ie1 at isa? port 0x360 net irq 7 iomem 0xd0000 vector ieintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x300 net irq 10 drq 0 vector lncintr
+device sr0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector srintr
options WLCACHE # enables the signal-strength cache
options WLDEBUG # enables verbose debugging output
-device wl0 at isa? port 0x300 net irq ?
+device wl0 at isa? port 0x300 net irq ? vector wlintr
# We can (bogusly) include both the dedicated PCCARD drivers and the generic
# support when COMPILING_LINT.
-device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000
-device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000
+device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
#
# ATM related options
@@ -1218,10 +1154,9 @@ options NATM #native ATM
#
# pcm: PCM audio through various sound cards.
#
-# This has support for a large number of new audio cards, based on
-# CS423x, OPTi931, Yamaha OPL-SAx, and also for SB16, GusPnP.
-# For more information about this driver and supported cards,
-# see the pcm.4 man page and /sys/i386/isa/snd/CARDS.
+# This is the work in progress from Luigi Rizzo. This has support for
+# CS423x based cards, OPTi931, SB16 PnP, GusPnP. For more information
+# about this driver, take a look at sys/i386/isa/snd/README.
#
# The flags of the device tells the device a bit more info about the
# device that normally is obtained through the PnP interface.
@@ -1259,30 +1194,30 @@ options NATM #native ATM
# below for an alternate which may work better for some cards.
#
controller snd0
-device pas0 at isa? port 0x388 irq 10 drq 6
-device sb0 at isa? port 0x220 irq 5 drq 1
+device pas0 at isa? port 0x388 irq 10 drq 6 vector pasintr
+device sb0 at isa? port 0x220 irq 5 drq 1 vector sbintr
device sbxvi0 at isa? drq 5
device sbmidi0 at isa? port 0x330
device awe0 at isa? port 0x620
-device gus0 at isa? port 0x220 irq 12 drq 1
-#device gus0 at isa? port 0x220 irq 12 drq 1 flags 0x3
-device mss0 at isa? port 0x530 irq 10 drq 1
-device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08
-device sscape0 at isa? port 0x330 irq 9 drq 0
-device trix0 at isa? port 0x330 irq 6 drq 0
-device sscape_mss0 at isa? port 0x534 irq 5 drq 1
+device gus0 at isa? port 0x220 irq 12 drq 1 vector gusintr
+#device gus0 at isa? port 0x220 irq 12 drq 1 flags 0x3 vector gusintr
+device mss0 at isa? port 0x530 irq 10 drq 1 vector adintr
+device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08 vector adintr
+device sscape0 at isa? port 0x330 irq 9 drq 0 vector sscapeintr
+device trix0 at isa? port 0x330 irq 6 drq 0 vector sscapeintr
+device sscape_mss0 at isa? port 0x534 irq 5 drq 1 vector sndintr
device opl0 at isa? port 0x388
device mpu0 at isa? port 0x330 irq 6 drq 0
-device uart0 at isa? port 0x330 irq 5
+device uart0 at isa? port 0x330 irq 5 vector "m6850intr"
# Luigi's snd code (use INSTEAD of snd0 and all VOXWARE drivers!).
# You may also wish to enable the pnp controller with this, for pnp
# sound cards.
#
-#device pcm0 at isa? port ? tty irq 10 drq 1 flags 0x0
+#device pcm0 at isa? port ? tty irq 10 drq 1 flags 0x0 vector pcmintr
# Not controlled by `snd'
-device pca0 at isa? port "IO_TIMER1" tty
+device pca0 at isa? port IO_TIMER1 tty
#
# Miscellaneous hardware:
@@ -1296,6 +1231,7 @@ device pca0 at isa? port "IO_TIMER1" tty
# spigot: The Creative Labs Video Spigot video-acquisition board
# meteor: Matrox Meteor video capture board
# bktr: Brooktree bt848/848a/849/878/879 family video capture and TV Tuner board
+# alog: Industrial Computer Source AIO8-P driver
# cy: Cyclades serial driver
# dgb: Digiboard PC/Xi and PC/Xe series driver (ALPHA QUALITY!)
# dgm: Digiboard PC/Xem driver
@@ -1389,33 +1325,34 @@ device pca0 at isa? port "IO_TIMER1" tty
# Brumby: flags 2 iosiz 0x4000
# Stallion: flags 1 iosiz 0x10000
-device mcd0 at isa? port 0x300 bio irq 10
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
# for the Sony CDU31/33A CDROM
device scd0 at isa? port 0x230 bio
# for the SoundBlaster 16 multicd - up to 4 devices
controller matcd0 at isa? port 0x230 bio
-device wt0 at isa? port 0x300 bio irq 5 drq 1
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
device ctx0 at isa? port 0x230 iomem 0xd0000
-device spigot0 at isa? port 0xad6 irq 15 iomem 0xee000
+device spigot0 at isa? port 0xad6 irq 15 iomem 0xee000 vector spigintr
device apm0 at isa?
device gp0 at isa? port 0x2c0 tty
device gsc0 at isa? port "IO_GSC1" tty drq 3
-device joy0 at isa? port IO_GAME
-device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000
-options CY_PCI_FASTINTR # Use with cy_pci unless irq is shared
+device joy0 at isa? port "IO_GAME"
+device alog0 at isa? port 0x260 tty irq 5 vector alogintr
+device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000 vector cyintr
device dgb0 at isa? port 0x220 iomem 0xfc0000 iosiz ? tty
device dgm0 at isa? port 0x104 iomem 0xd00000 iosiz ? tty
-device labpc0 at isa? port 0x260 tty irq 5
-device rc0 at isa? port 0x220 tty irq 12
+device labpc0 at isa? port 0x260 tty irq 5 vector labpcintr
+device rc0 at isa? port 0x220 tty irq 12 vector rcintr
device rp0 at isa? port 0x280 tty
# the port and irq for tw0 are fictitious
-device tw0 at isa? port 0x380 tty irq 11
+device tw0 at isa? port 0x380 tty irq 11 vector twintr
device si0 at isa? iomem 0xd0000 tty irq 12
-device asc0 at isa? port "IO_ASC1" tty drq 3 irq 10
-device stl0 at isa? port 0x2a0 tty irq 10
+device asc0 at isa? port IO_ASC1 tty drq 3 irq 10 vector ascintr
+device bqu0 at isa? port 0x150
+device stl0 at isa? port 0x2a0 tty irq 10 vector stlintr
device stli0 at isa? port 0x2a0 tty iomem 0xcc000 flags 23 iosiz 0x1000
# You are unlikely to have the hardware for loran0 <phk@FreeBSD.org>
-device loran0 at isa? port ? tty irq 5
+device loran0 at isa? port ? tty irq 5 vector loranintr
# HOT1 Xilinx 6200 card (www.vcc.com)
device xrpu0
@@ -1468,9 +1405,11 @@ options "EISA_SLOTS=12"
# nd 1040B PCI SCSI host adapters, as well as the Qlogic ISP 2100
# FC/AL Host Adapter.
#
-# The `ax' device provides support for PCI fast ethernet adapters
-# based on the ASIX Electronics AX88140A chip, including the Alfa
-# Inc. GFC2204.
+# The `amd' device provides support for the Tekram DC-390 and 390T
+# SCSI host adapters, but is expected to work with any AMD 53c974
+# PCI SCSI chip and the AMD Ethernet+SCSI Combo chip, after some
+# local patches were applied to the sources (that had originally
+# been written by Tekram and limited to work with their SCSI cards).
#
# The `de' device provides support for the Digital Equipment DC21040
# self-contained Ethernet adapter.
@@ -1478,22 +1417,6 @@ options "EISA_SLOTS=12"
# The `fxp' device provides support for the Intel EtherExpress Pro/100B
# PCI Fast Ethernet adapters.
#
-# The `mx' device provides support for various fast ethernet adapters
-# based on the Macronix 98713, 987615 ans 98725 series chips.
-#
-# The `pn' device provides support for various fast ethernet adapters
-# based on the Lite-On 82c168 and 82c169 PNIC chips, including the
-# LinkSys LNE100TX, the NetGear FA310TX rev. D1 and the Matrox
-# FastNIC 10/100.
-#
-# The 'rl' device provides support for PCI fast ethernet adapters based
-# on the RealTek 8129/8139 chipset. Note that the RealTek driver defaults
-# to useing programmed I/O to do register accesses because memory mapped
-# mode seems to cause severe lockups on SMP hardware. This driver also
-# supports the Accton EN1207D `Cheetah' adapter, which uses a chip called
-# the MPX 5030/5038, which is either a RealTek in disguise or a RealTek
-# workalike.
-#
# The 'tl' device provides support for the Texas Instruments TNETE100
# series 'ThunderLAN' cards and integrated ethernet controllers. This
# includes several Compaq Netelligent 10/100 cards and the built-in
@@ -1503,18 +1426,10 @@ options "EISA_SLOTS=12"
#
# The `tx' device provides support for the SMC 9432TX cards.
#
-# The `vr' device provides support for various fast ethernet adapters
-# based on the VIA Technologies VT3043 `Rhine I' and VT86C100A `Rhine II'
-# chips, including the D-Link DFE530TX.
-#
# The `vx' device provides support for the 3Com 3C590 and 3C595
# early support
#
-# The `wb' device provides support for various fast ethernet adapters
-# based on the Winbond W89C840F chip. Note: this is not the same as
-# the Winbond W89C940F, which is an NE2000 clone.
-#
-# The `xl' device provides support for the 3Com 3c900, 3c905 and
+# The `xl' driver provides support for the 3Com 3c900, 3c905 and
# 3c905B (Fast) Etherlink XL cards and integrated controllers. This
# includes the integrated 3c905B-TX chips in certain Dell Optiplex and
# Dell Precision desktop machines and the integrated 3c905-TX chips
@@ -1559,26 +1474,15 @@ controller pci0
controller ahc1
controller ncr0
controller isp0
-device ax0
+#!CAM# controller amd0
device de0
device fxp0
-device mx0
-device pn0
-device rl0
device tl0
device tx0
-device vr0
device vx0
-device wb0
device xl0
device fpa0
device meteor0
-
-# Brooktree driver has been ported to the new I2C framework. Thus,
-# you'll need at least iicbus, iicbb and smbus. iic/smb are only needed if you
-# want to control other I2C slaves connected to the external connector of
-# some cards.
-#
device bktr0
#
@@ -1619,8 +1523,7 @@ options POWERFAIL_NMI # make it beep instead of panicing
# smb standard io
#
# Supported interfaces:
-# iicsmb I2C to SMB bridge with any iicbus interface
-# bktr brooktree848 I2C hardware interface
+# iicsmb I2C to SMB bridge
#
controller smbus0
@@ -1638,135 +1541,16 @@ device smb0 at smbus?
#
# Supported interfaces:
# pcf Philips PCF8584 ISA-bus controller
-# bktr brooktree848 I2C software interface
-#
-# Other:
-# iicbb generic I2C bit-banging code (needed by lpbb, bktr)
#
controller iicbus0
-controller iicbb0
device ic0 at iicbus?
device iic0 at iicbus?
device iicsmb0 at iicbus?
-controller pcf0 at isa? port 0x320 net irq 5
+controller pcf0 at isa? port 0x320 net irq 5 vector pcfintr
-# ISDN4BSD section
-
-# i4b passive ISDN cards support (isic - I4b Siemens Isdn Chipset driver)
-# note that the ``options'' and ``device'' lines must BOTH be defined !
-#
-# Non-PnP Cards:
-# --------------
-#
-# Teles S0/8 or Niccy 1008
-options "TEL_S0_8"
-#device isic0 at isa? iomem 0xd0000 net irq 5 flags 1
-#
-# Teles S0/16 or Creatix ISDN-S0 or Niccy 1016
-options "TEL_S0_16"
-#device isic0 at isa? port 0xd80 iomem 0xd0000 net irq 5 flags 2
-#
-# Teles S0/16.3
-options "TEL_S0_16_3"
-#device isic0 at isa? port 0xd80 net irq 5 flags 3
-#
-# AVM A1 or AVM Fritz!Card
-options "AVM_A1"
-#device isic0 at isa? port 0x340 net irq 5 flags 4
-#
-# USRobotics Sportster ISDN TA intern
-options "USR_STI"
-#device isic0 at isa? port 0x268 net irq 5 flags 7
-#
-# ITK ix1 Micro
-options "ITKIX1"
-#device isic0 at isa? port 0x398 net irq 10 flags 18
-#
-# PnP-Cards:
-# ----------
-#
-# Teles S0/16.3 PnP
-options "TEL_S0_16_3_P"
-#device isic0 at isa? port ? net irq ?
-#
-# Creatix ISDN-S0 P&P
-options "CRTX_S0_P"
-#device isic0 at isa? port ? net irq ?
-#
-# Dr. Neuhaus Niccy Go@
-options "DRN_NGO"
-#device isic0 at isa? port ? net irq ?
-#
-# Sedlbauer Win Speed
-options "SEDLBAUER"
-#device isic0 at isa? port ? net irq ?
-#
-# Dynalink IS64PH
-options "DYNALINK"
-#device isic0 at isa? port ? net irq ?
-#
-# ELSA QuickStep 1000pro ISA
-options "ELSA_QS1ISA"
-#device isic0 at isa? port ? net irq ?
-#
-# PCI-Cards:
-# ----------
-#
-# ELSA QuickStep 1000pro PCI
-options "ELSA_QS1PCI"
-#device isic0
-#
-# PCMCIA-Cards:
-# -------------
#
-# AVM PCMCIA Fritz!Card
-options "AVM_A1_PCMCIA"
-device isic0 at isa? port 0x340 net irq 5 flags 10
-#
-# Active Cards:
-# -------------
-#
-# Stollmann Tina-dd control device
-device tina0 at isa? port 0x260 net irq 10
-#
-# ISDN Protocol Stack
-# -------------------
-#
-# Q.921 / layer 2 - i4b passive cards D channel handling
-pseudo-device "i4bq921"
-#
-# Q.931 / layer 3 - i4b passive cards D channel handling
-pseudo-device "i4bq931"
-#
-# layer 4 - i4b common passive and active card handling
-pseudo-device "i4b"
-#
-# ISDN devices
-# ------------
-#
-# userland driver to do ISDN tracing (for passive cards only)
-pseudo-device "i4btrc" 4
-#
-# userland driver to control the whole thing
-pseudo-device "i4bctl"
-#
-# userland driver for access to raw B channel
-pseudo-device "i4brbch" 4
-#
-# userland driver for telephony
-pseudo-device "i4btel" 2
-#
-# network driver for IP over raw HDLC ISDN
-pseudo-device "i4bipr" 4
-# enable VJ header compression detection for ipr i/f
-options IPR_VJ
-#
-# network driver for sync PPP over ISDN
-pseudo-device "i4bisppp" 4
-
-
# Parallel-Port Bus
#
# Parallel port bus support is provided by the `ppbus' device.
@@ -1781,7 +1565,6 @@ pseudo-device "i4bisppp" 4
# plip Parallel network interface
# ppi General-purpose I/O ("Geek Port")
# pps Pulse per second Timing Interface
-# lpbb Philips official parallel port I2C bit-banging interface
#
# Supported interfaces:
# ppc ISA-bus parallel port interfaces.
@@ -1792,9 +1575,8 @@ device nlpt0 at ppbus?
device plip0 at ppbus?
device ppi0 at ppbus?
device pps0 at ppbus?
-device lpbb0 at ppbus?
-controller ppc0 at isa? disable port ? tty irq 7
+controller ppc0 at isa? disable port ? tty irq 7 vector ppcintr
# Kernel BOOTP support
@@ -1837,21 +1619,6 @@ options "PMAP_SHPGPERPROC=201"
#
#options NO_SWAPPING
-# Set the number of sf_bufs to allocate. sf_bufs are virtual buffers
-# for sendfile(2) that are used to map file VM pages, and normally
-# default to a quantity that is roughly 16*MAXUSERS+512. You would
-# typically want about 4 of these for each simultaneous file send.
-#
-options "NSFBUFS=1024"
-
-#
-# Enable extra debugging code for locks. This include storing the
-# filename and line of whatever aquired the lock in the lock itself,
-# and changing a number of function calls to pass around the relevant
-# data. This is not at all useful unless you are debugging lock code.
-#
-options DEBUG_LOCKS
-
# More undocumented options for linting.
options CLK_CALIBRATION_LOOP
@@ -1861,7 +1628,6 @@ options CLUSTERDEBUG
options COMPAT_LINUX
options CPU_UPGRADE_HW_CACHE
options DEBUG
-options DEBUG_VFS_LOCKS
options "DEBUG_1284"
#options DISABLE_PSE
options "EXT2FS"
@@ -1918,7 +1684,6 @@ options SHMSEG=9
options SI_DEBUG
options SIMPLELOCK_DEBUG
options SPX_HACK
-options VFS_BIO_DEBUG
# The 'dpt' driver provides support for DPT controllers (http://www.dpt.com/).
# These have hardware RAID-{0,1,5} support, and do multi-initiator I/O.
@@ -1977,35 +1742,3 @@ options DPT_RESET_HBA
# Don't EVER set this without having talked to Simon Shapiro on the phone
# first.
options DPT_SHUTDOWN_SLEEP=500
-
-# USB support
-# UHCI controller
-controller uhci0
-# OHCI controller
-controller ohci0
-# General USB code (mandatory for USB)
-controller usb0
-#
-# for the moment we have to specify the priorities of the device
-# drivers explicitly by the ordering in the list below. This will
-# be changed in the future.
-#
-# USB mouse
-device ums0
-# USB keyboard
-device ukbd0
-# USB printer
-device ulpt0
-# USB hub (kind of mandatory, no other driver is available for the root hub)
-device uhub0
-# USB communications driver
-device ucom0
-# USB modem driver
-device umodem0
-# Human Interface Device (anything with buttons and dials)
-device hid0
-# Generic USB device driver
-device ugen0
-#
-options USB_DEBUG
-options USBVERBOSE
diff --git a/sys/i386/conf/LKM b/sys/i386/conf/LKM
index d29ac86e78843..4e123a617455b 100644
--- a/sys/i386/conf/LKM
+++ b/sys/i386/conf/LKM
@@ -2,7 +2,7 @@
# LKM - verification kernel for LKMs. This is not intended to be run
# on any real hardware, only to make it possible to test-link LKMs.
#
-# $Id: LKM,v 1.2 1998/10/22 12:23:04 bde Exp $
+# $Id$
#
##
@@ -23,7 +23,7 @@ options FFS
# missing NPX...
controller isa0
# npx is mandated by config(8)
-device npx0 at isa? port IO_NPX irq 13
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
##
# Requirements for various LKMs
@@ -32,7 +32,7 @@ device npx0 at isa? port IO_NPX irq 13
#
# Options required for the ATAPI LKM
#
-controller wdc0 at isa? port "IO_WD1" bio irq 14
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
options ATAPI
@@ -59,13 +59,13 @@ controller card0
# Cascading requirement from card0 - any device that have a DATA_SET of
# pccarddrv_set
-device sio0 at isa? port "IO_COM1" tty irq 4
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
#
# For the screensavers
#
-device sc0 at isa? port IO_KBD tty irq 1
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
#
diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386
index 226f7475e625a..449064d45cf21 100644
--- a/sys/i386/conf/Makefile.i386
+++ b/sys/i386/conf/Makefile.i386
@@ -1,7 +1,7 @@
# Makefile.i386 -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
-# $Id: Makefile.i386,v 1.135 1999/01/17 21:17:27 peter Exp $
+# $Id: Makefile.i386,v 1.125 1998/09/30 12:14:39 peter Exp $
#
# Makefile for FreeBSD
#
@@ -17,9 +17,9 @@
#
# Which version of config(8) is required.
-%VERSREQ= 300009
+%VERSREQ= 300007
-KERNFORMAT?= elf
+KERNFORMAT?= aout
STD8X16FONT?= iso
@@ -74,8 +74,8 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} $<
DRIVER_S= ${CC} -c -x ${ASM_CFLAGS} $<
PROFILE_C= ${CC} -c ${CFLAGS} $<
-GEN_CFILES= ${I386}/i386/genassym.c
-# setdef0.c and setdef1.c are intentionally
+GEN_CFILES= ${I386}/i386/genassym.c ${I386}/i386/gensetdefs.c
+# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally
# omitted from SYSTEM_CFILES. They include setdefs.h, a header which
# is generated from all of ${OBJS}. We don't want to have to compile
# everything just to do a make depend.
@@ -86,7 +86,14 @@ SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS}
SYMORDER_EXCLUDE=-x symbols.exclude
.endif
SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET}
-.if ${KERNFORMAT} == aout || ${KERNFORMAT} == aoutkld
+.if ${KERNFORMAT} == aout
+SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
+SYSTEM_LD= @${LD} -aout -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
+SYSTEM_LD_TAIL= @echo rearranging symbols; \
+ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \
+ size -aout ${.TARGET} ; chmod 755 ${.TARGET}
+.endif
+.if ${KERNFORMAT} == aoutkld
SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
SYSTEM_LD= @${LD} -aout -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @echo rearranging symbols; \
@@ -94,8 +101,9 @@ SYSTEM_LD_TAIL= @echo rearranging symbols; \
size -aout ${.TARGET} ; chmod 755 ${.TARGET}
.endif
.if ${KERNFORMAT} == elf
+# kld compatable export of symbols.
SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \
- setdef1.o hack.So
+ setdef1.o hack.so
SYSTEM_LD= @${LD} -elf -Bdynamic -T $S/i386/conf/kernel.script \
-export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
@@ -117,14 +125,9 @@ SYSTEM_DEP+= $S/i386/conf/kernel.script
%CLEAN
-.if !exists(.depend)
-${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h}
-.endif
-
clean:
- rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \
- kernel linterrs makelinks param.c setdef[01].c setdefs.h \
- symbols.exclude symbols.sort tags \
+ rm -f *.o *.so *.ko *.s eddep errs genassym gensetdefs kernel linterrs \
+ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \
vers.c vnode_if.c vnode_if.h ${CLEAN}
#lint: /tmp param.c
@@ -148,21 +151,26 @@ locore.o: ${I386}/i386/locore.s assym.s
# This is a hack. BFD "optimizes" away dynamic mode if there are no
# dynamic references. We could probably do a '-Bforcedynamic' mode like
# in the a.out ld. For now, this works.
-hack.So: Makefile
+hack.so: Makefile
touch hack.c
- ${CC} -elf -shared -nostdlib hack.c -o hack.So
+ ${CC} -elf -shared -nostdlib hack.c -o hack.so
rm -f hack.c
.endif
-setdef0.o: setdef0.c setdefs.h
+setdef0.o: ${I386}/i386/setdef0.c setdefs.h
${NORMAL_C}
-setdef1.o: setdef1.c setdefs.h
+setdef1.o: ${I386}/i386/setdef1.c setdefs.h
${NORMAL_C}
-setdef0.c setdef1.c setdefs.h: ${OBJS}
- @echo generating linker set emulation glue for ELF
- @gensetdefs ${OBJS}
+setdefs.h: gensetdefs ${OBJS}
+ ./gensetdefs ${OBJS} >setdefs.h
+
+gensetdefs: gensetdefs.o
+ ${CC} ${GEN_CFLAGS} gensetdefs.o -o ${.TARGET}
+
+gensetdefs.o: ${I386}/i386/gensetdefs.c
+ ${CC} -c ${GEN_CFLAGS} ${I386}/i386/gensetdefs.c
# this rule stops ./assym.s in .depend from causing problems
./assym.s: assym.s
@@ -176,7 +184,7 @@ genassym.o: ${I386}/i386/genassym.c
genassym: genassym.o
${CC} ${GEN_CFLAGS} genassym.o -o ${.TARGET}
-${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
+${SYSTEM_OBJS} genassym.o gensetdefs.o vers.o: opt_global.h
# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical.
depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND}
@@ -207,16 +215,6 @@ install:
echo "You must first build your kernel before trying to install." ; \
exit 1 ; \
fi
-.if ${KERNFORMAT} == "elf" && !defined(FORCE)
- @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \
- echo "WARNING: You are about to install an ELF kernel for the first time!" ; \
- echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \
- echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \
- echo "http://www.freebsd.org/~peter/elfday.html for information." ; \
- echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \
- exit 1 ; \
- fi
-.endif
.if exists(${DESTDIR}/kernel)
chflags noschg ${DESTDIR}/kernel
mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old
diff --git a/sys/i386/conf/PCCARD b/sys/i386/conf/PCCARD
new file mode 100644
index 0000000000000..ef0b6e7ae7fe8
--- /dev/null
+++ b/sys/i386/conf/PCCARD
@@ -0,0 +1,114 @@
+#
+# PCCARD -- GENERIC laptop support
+#
+# For more information read the handbook part System Administration ->
+# Configuring the FreeBSD Kernel -> The Configuration File.
+# The handbook is available in /usr/share/doc/handbook or online as
+# latest version from the FreeBSD World Wide Web server
+# <URL:http://www.FreeBSD.ORG/>
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is present in the ./LINT configuration file. If you are
+# in doubt as to the purpose or necessity of a line, check first in LINT.
+#
+# $Id: PCCARD,v 1.6 1998/09/25 17:34:48 peter Exp $
+
+machine "i386"
+cpu "I386_CPU"
+cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident PCCARD
+maxusers 10
+
+options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+config kernel root on wd0
+
+controller isa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+
+options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
+disk wd0 at wdc0 drive 0
+
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
+
+options ATAPI #Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+
+#controller aic0 at isa? port 0x340 cam irq 11 vector aicintr
+
+#controller scbus0
+
+#device da0
+
+#device sa0
+
+#device cd0 #Only need one of these, the code dynamically grows
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+controller card0
+device pcic0 at card?
+device pcic1 at card?
+
+options PCIC_RESUME_RESET # reset after resume
+
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
+
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
+options PSM_HOOKAPM #hook the APM resume event
+options PSM_RESETAFTERSUSPEND #reset the device at the resume event
+
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+# iijppp uses tun instead of ppp device
+#pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
diff --git a/sys/i386/conf/SMP-GENERIC b/sys/i386/conf/SMP-GENERIC
new file mode 100644
index 0000000000000..c31ed1cccb392
--- /dev/null
+++ b/sys/i386/conf/SMP-GENERIC
@@ -0,0 +1,201 @@
+#
+# SMP-GENERIC -- Smp machine with WD/AHx/NCR/BTx family disks
+#
+# For more information read the handbook part System Administration ->
+# Configuring the FreeBSD Kernel -> The Configuration File.
+# The handbook is available in /usr/share/doc/handbook or online as
+# latest version from the FreeBSD World Wide Web server
+# <URL:http://www.FreeBSD.ORG/>
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is present in the ./LINT configuration file. If you are
+# in doubt as to the purpose or necessity of a line, check first in LINT.
+#
+# $Id: SMP-GENERIC,v 1.16 1998/09/25 17:34:48 peter Exp $
+
+machine "i386"
+# SMP does NOT support 386/486 CPUs.
+#cpu "I386_CPU"
+#cpu "I486_CPU"
+
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident SMP-GENERIC
+maxusers 32
+
+# Create a SMP capable kernel (mandatory options):
+options SMP # Symmetric MultiProcessor Kernel
+options APIC_IO # Symmetric (APIC) I/O
+
+# Optional, these are the defaults:
+#options NCPU=2 # number of CPUs
+#options NBUS=4 # number of busses
+#options NAPIC=1 # number of IO APICs
+#options NINTR=24 # number of INTs
+
+# Lets always enable the kernel debugger for SMP.
+options DDB
+
+# SMP shouldn't need x87 emulation, disable by default.
+#options MATH_EMULATE #Support for x87 emulation
+
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options FFS_ROOT #FFS usable as root device [keep this!]
+options MFS #Memory Filesystem
+options MFS_ROOT #MFS usable as root device, "MFS" req'ed
+options NFS #Network Filesystem
+options NFS_ROOT #NFS usable as root device, "NFS" req'ed
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root. "CD9660" req'ed
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+config kernel root on wd0
+
+controller isa0
+controller eisa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 2
+
+options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr
+disk wd0 at wdc0 drive 0
+disk wd1 at wdc0 drive 1
+
+controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr
+disk wd2 at wdc1 drive 0
+disk wd3 at wdc1 drive 1
+
+options ATAPI #Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+device wfd0 #IDE Floppy (e.g. LS-120)
+
+# A single entry for any of these controllers (ncr, ahb, ahc, amd) is
+# sufficient for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahb0
+controller ahc0
+controller isp0
+
+# This controller offers a number of configuration options, too many to
+# document here - see the LINT file in this directory and look up the
+# dpt0 entry there for much fuller documentation on this.
+controller dpt0
+
+controller adv0 at isa? port ? cam irq ?
+controller adw0
+controller bt0 at isa? port ? cam irq ?
+controller aha0 at isa? port ? cam irq ?
+#controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr
+#controller aic0 at isa? port 0x340 bio irq 11 vector aicintr
+#controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr
+#controller nca1 at isa? port 0x350 bio irq 5 vector ncaintr
+#controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr
+device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr
+
+controller matcd0 at isa? port 0x230 bio
+
+device scd0 at isa? port 0x230 bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr
+# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
+#device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint
+#options XSERVER # support for X server
+#options FAT_CURSOR # start with block cursor
+# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
+#options PCVT_SCANSET=2 # IBM keyboards are non-std
+
+device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr
+device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
+device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr
+device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr
+
+device lpt0 at isa? port? tty irq 7 vector lptintr
+
+device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+device xl0
+
+device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr
+device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr
+device ep0 at isa? port 0x300 net irq 10 vector epintr
+device ex0 at isa? port? net irq? vector exintr
+device fe0 at isa? port 0x300 net irq ? vector feintr
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
+device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr
+device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr
+device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr
+device cs0 at isa? port 0x300 net irq ? vector csintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
+
+# The `bpfilter' pseudo-device enables the Berkeley Packet Filter. Be
+# aware of the legal and administrative consequences of enabling this
+# option. The number of devices determines the maximum number of
+# simultaneous BPF clients programs runnable.
+#pseudo-device bpfilter 4 #Berkeley packet filter
diff --git a/sys/i386/conf/devices.i386 b/sys/i386/conf/devices.i386
index b8d866441c5f2..ccba4ecc30b16 100644
--- a/sys/i386/conf/devices.i386
+++ b/sys/i386/conf/devices.i386
@@ -1,6 +1,6 @@
# This file tells what major numbers the various possible swap devices have.
#
-# $Id: devices.i386,v 1.14 1998/09/15 10:01:13 gibbs Exp $
+# $Id: devices.i386,v 1.13 1998/02/17 11:33:31 sos Exp $
#
wd 0
wfd 1
@@ -13,5 +13,5 @@ mcd 7
vn 15
scd 16
pcd 17
-acd 19
+wcd 19
wst 24
diff --git a/sys/i386/conf/files.i386 b/sys/i386/conf/files.i386
index 6993be0c5023f..a343f19635fbf 100644
--- a/sys/i386/conf/files.i386
+++ b/sys/i386/conf/files.i386
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $Id: files.i386,v 1.219 1999/01/19 11:31:22 yokota Exp $
+# $Id: files.i386,v 1.205 1998/09/20 06:04:55 bde Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -24,17 +24,6 @@ font8x16.o optional std8x16font \
no-implicit-rule before-depend \
clean "${STD8X16FONT}-8x16 font8x16.c"
#
-dev/fb/fb.c optional fb device-driver
-dev/fb/fb.c optional vga device-driver
-dev/fb/splash.c optional splash
-dev/kbd/atkbd.c optional atkbd device-driver
-dev/kbd/atkbdc.c optional atkbdc device-driver
-dev/kbd/kbd.c optional atkbd device-driver
-dev/kbd/kbd.c optional kbd device-driver
-#dev/kbd/kbd.c optional ukbd device-driver
-dev/syscons/syscons.c optional sc device-driver
-dev/syscons/scvidctl.c optional sc device-driver
-dev/syscons/scvesactl.c optional sc device-driver
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
i386/eisa/dpt_eisa.c optional eisa dpt device-driver
@@ -108,8 +97,8 @@ i386/isa/adv_isa.c optional adv device-driver
i386/isa/aha_isa.c optional aha device-driver
#i386/isa/aic6360.c optional aic device-driver
i386/isa/aic_isa.c optional aic device-driver
-i386/isa/atkbd_isa.c optional atkbd device-driver
-i386/isa/atkbdc_isa.c optional atkbdc device-driver
+i386/isa/alog.c optional alog device-driver
+i386/isa/b004.c optional bqu device-driver
i386/isa/bt_isa.c optional bt device-driver
i386/isa/clock.c standard
i386/isa/cronyx.c optional cx device-driver
@@ -120,6 +109,7 @@ i386/isa/diskslice_machdep.c standard
i386/isa/elink.c optional ep device-driver
i386/isa/elink.c optional ie device-driver
i386/isa/fd.c optional fd device-driver
+i386/isa/ft.c optional ft device-driver
i386/isa/gpib.c optional gp device-driver
i386/isa/asc.c optional asc device-driver
i386/isa/gsc.c optional gsc device-driver
@@ -127,6 +117,7 @@ i386/isa/if_ar.c optional ar device-driver
i386/isa/if_cs.c optional cs device-driver
i386/isa/if_cx.c optional cx device-driver
i386/isa/if_ed.c optional ed device-driver
+i386/isa/if_eg.c optional eg device-driver
i386/isa/if_el.c optional el device-driver
i386/isa/if_ep.c optional ep device-driver
i386/isa/if_ex.c optional ex device-driver
@@ -134,7 +125,6 @@ i386/isa/if_fe.c optional fe device-driver
i386/isa/if_ie.c optional ie device-driver
i386/isa/if_le.c optional le device-driver
i386/isa/if_lnc.c optional lnc device-driver
-i386/isa/if_rdp.c optional rdp device-driver
i386/isa/if_sr.c optional sr device-driver
i386/isa/if_wl.c optional wl device-driver
i386/isa/if_ze.c optional ze device-driver
@@ -145,11 +135,15 @@ i386/isa/intr_machdep.c standard
i386/isa/isa.c optional isa device-driver
i386/isa/istallion.c optional stli device-driver
i386/isa/joy.c optional joy device-driver
+i386/isa/kbdio.c optional psm device-driver
+i386/isa/kbdio.c optional sc device-driver
+i386/isa/kbdio.c optional vt device-driver
i386/isa/loran.c optional loran device-driver
i386/isa/lpt.c optional lpt device-driver
i386/isa/labpc.c optional labpc device-driver
i386/isa/mcd.c optional mcd device-driver
i386/isa/mse.c optional mse device-driver
+#i386/isa/ncr5380.c optional nca device-driver
i386/isa/npx.c mandatory npx device-driver
i386/isa/pcaudio.c optional pca device-driver
i386/isa/matcd/matcd.c optional matcd device-driver
@@ -171,6 +165,7 @@ i386/isa/random_machdep.c standard
i386/isa/rc.c optional rc device-driver
i386/isa/rp.c optional rp device-driver
i386/isa/scd.c optional scd device-driver
+#i386/isa/seagate.c optional sea device-driver
i386/isa/si.c optional si device-driver
i386/isa/si2_z280.c optional si device-driver
i386/isa/si3_t225.c optional si device-driver
@@ -244,16 +239,21 @@ i386/isa/sound/cs4232.c optional css device-driver
i386/isa/spigot.c optional spigot device-driver
i386/isa/spkr.c optional speaker device-driver
i386/isa/stallion.c optional stl device-driver
-i386/isa/syscons_isa.c optional sc device-driver
-i386/isa/vesa.c optional vga device-driver
-i386/isa/vga_isa.c optional vga device-driver
+i386/isa/syscons.c optional sc device-driver
+i386/isa/scvidctl.c optional sc device-driver
+i386/isa/scvesactl.c optional sc device-driver
+i386/isa/videoio.c optional sc device-driver
+i386/isa/vesa.c optional sc device-driver
i386/isa/tw.c optional tw device-driver
+#i386/isa/ultra14f.c optional uha device-driver
i386/isa/wd.c optional wdc device-driver
i386/isa/wd.c optional wd device-driver
i386/isa/atapi.c optional atapi device-driver
i386/isa/atapi-cd.c optional acd device-driver
+i386/isa/wcd.c optional wcd device-driver
i386/isa/wfd.c optional wfd device-driver
i386/isa/wst.c optional wst device-driver
+i386/isa/wd7000.c optional wds device-driver
i386/isa/wt.c optional wt device-driver
i386/linux/imgact_linux.c optional compat_linux
i386/linux/linux_dummy.c optional compat_linux
@@ -269,30 +269,6 @@ i386/linux/linux_stats.c optional compat_linux
i386/linux/linux_sysent.c optional compat_linux
i386/linux/linux_sysvec.c optional compat_linux
i386/linux/linux_util.c optional compat_linux
-i4b/layer1/i4b_isic.c optional isic device-driver
-i4b/layer1/i4b_isic_isa.c optional isic device-driver
-i4b/layer1/i4b_isic_pnp.c optional isic device-driver
-i4b/layer1/i4b_isic_pci.c optional isic device-driver
-i4b/layer1/i4b_isic_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_isac.c optional isic device-driver
-i4b/layer1/i4b_hscx.c optional isic device-driver
-i4b/layer1/i4b_l1.c optional isic device-driver
-i4b/layer1/i4b_l1fsm.c optional isic device-driver
-i4b/layer1/i4b_bchan.c optional isic device-driver
-i4b/layer1/i4b_tel_s08.c optional isic device-driver
-i4b/layer1/i4b_tel_s016.c optional isic device-driver
-i4b/layer1/i4b_tel_s0163.c optional isic device-driver
-i4b/layer1/i4b_tel_s0P.c optional isic device-driver
-i4b/layer1/i4b_ctx_s0P.c optional isic device-driver
-i4b/layer1/i4b_avm_a1.c optional isic device-driver
-i4b/layer1/i4b_avm_fritz_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_usr_sti.c optional isic device-driver
-i4b/layer1/i4b_itk_ix1.c optional isic device-driver
-i4b/layer1/i4b_drn_ngo.c optional isic device-driver
-i4b/layer1/i4b_sws.c optional isic device-driver
-i4b/layer1/i4b_dynalink.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1i.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1p.c optional isic device-driver
libkern/bcd.c standard
libkern/divdi3.c standard
libkern/inet_ntoa.c standard
@@ -347,5 +323,4 @@ gnu/i386/fpemul/wm_sqrt.s optional gpl_math_emulate
gnu/i386/isa/dgb.c optional dgb device-driver
gnu/i386/isa/dgm.c optional dgm device-driver
gnu/i386/isa/sound/awe_wave.c optional awe device-driver
-pci/es1370.c optional pcm device-driver
pci/ide_pci.c optional wd device-driver
diff --git a/sys/i386/conf/majors.i386 b/sys/i386/conf/majors.i386
index 822d908cf0b5d..7b56d1d9cdc4e 100644
--- a/sys/i386/conf/majors.i386
+++ b/sys/i386/conf/majors.i386
@@ -1,4 +1,4 @@
-$Id: majors.i386,v 1.64 1999/01/14 03:47:55 msmith Exp $
+$Id: majors.i386,v 1.49 1998/09/15 10:01:14 gibbs Exp $
Hopefully, this list will one day be obsoleted by DEVFS, but for now
this is the current allocation of device major numbers.
@@ -32,7 +32,7 @@ blkdev name comments
16 scd Sony CDROM interface
17 matcd Matsushita/Panasonic/Creative(SB) CDROM interface
18 ata "device independent" ATA/IDE driver
-19 acdb ATAPI CDROM client of "ata"
+19 wcdb ATAPI CDROM client of "ata"
21 ccd concatenated disk
22 gd Geometry disk.
24 wstb ATAPI tape client of "ata"
@@ -40,9 +40,6 @@ blkdev name comments
26 sw VM internal swap device
27 myx Mylex RAID (ulf@alameda.net)
28 fla M-Systems DiskOnChip(r)
-29 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-100 ?? entries from 100-127 are reserved for local use
-127 ?? entries from 100-127 are reserved for local use
chrdev name comments
0 cn console
@@ -114,7 +111,7 @@ chrdev name comments
66 labpc National Instruments LabPC
67 meteor Matrox Meteor video capture
68 si Specialix SI/XIO (peter@freebsd.org)
-69 acd ATAPI CDROM client of "ata"
+69 wcd ATAPI CDROM client of "ata"
71 asc AmiScan driver
72 stl Stallion (cd1400 based) (gerg@stallion.oz.au)
73 ?? was qcam
@@ -128,9 +125,9 @@ chrdev name comments
81 rp RocketPort/Steve Gericke <steveg@comtrol.com>
82 ppi Generic Parallel I/O <Nicolas.Souchu@prism.uvsq.fr>
83 can CAN16-2 CAN-PC Interface
-84 dtfp Datum Time and Frequency processor (louie@UU.NET)
+84 ttxt Unitext teletext decoder (arg@arg1.demon.co.uk)
85 vesa VESA support device (j_mini@efn.org)
-86 alog Industrial Computer Source AIO8-P driver (deprecated)
+86 alog Industrial Computer Source AIO8-P driver
87 wfd ATAPI floppy client of "ata"
88 dpt DPT RAID Controller <shimon@i-connect.net>
89 pps Pulse-Per-Second timing interface
@@ -152,12 +149,3 @@ chrdev name comments
105 iic I2C bus generic i/o
106 smb System Management Bus generic i/o
107 3dfx 3Dfx driver (shocking@prth.pgs.com)
-108 usb Universal Serial Bus (nick.hibma@jrc.it)
-109 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-110 ses SCSI Environmental Services driver (mjacob@feral.com)
-111 ums USB Mouse (nick.hibma@jrc.it)
-112 kbd keyboard
-113 ulpt USB Printer (nick.hibma@jrc.it)
-114 ugen USB Generic device (nick.hibma@jrc.it)
-200 ?? entries from 200-255 are reserved for local use
-255 ?? entries from 200-255 are reserved for local use
diff --git a/sys/i386/conf/options.i386 b/sys/i386/conf/options.i386
index 2704d563788d0..9cb9eb8c9e021 100644
--- a/sys/i386/conf/options.i386
+++ b/sys/i386/conf/options.i386
@@ -1,7 +1,6 @@
-# $Id: options.i386,v 1.102 1999/01/10 17:41:33 nsouch Exp $
+# $Id: options.i386,v 1.89 1998/09/25 17:34:48 peter Exp $
DISABLE_PSE
-IDE_DELAY
USER_LDT
MATH_EMULATE opt_math_emulate.h
GPL_MATH_EMULATE opt_math_emulate.h
@@ -14,8 +13,6 @@ LINUX opt_dontuse.h
DEBUG_LINUX opt_linux.h
-PPC_DEBUG opt_ppc.h
-
SHOW_BUSYBUFS
TUNE_1542
PANIC_REBOOT_WAIT_TIME opt_panic.h
@@ -28,13 +25,19 @@ BREAK_TO_DEBUGGER opt_comconsole.h
CONSPEED opt_comconsole.h
COM_ESP opt_sio.h
COM_MULTIPORT opt_sio.h
+DSI_SOFT_MODEM opt_sio.h
EXTRA_SIO opt_sio.h
I586_PMC_GUPROF opt_i586_guprof.h
WLCACHE opt_wavelan.h
WLDEBUG opt_wavelan.h
-# i386 SMP options
+# These two SMP options have dramatic implications all over the kernel
+SMP opt_global.h
APIC_IO opt_global.h
+
+# Standard SMP options
+NCPU opt_smp.h
+NBUS opt_smp.h
NAPIC opt_smp.h
NINTR opt_smp.h
@@ -58,7 +61,6 @@ CPU_UPGRADE_HW_CACHE opt_cpu.h
CPU_WT_ALLOC opt_cpu.h
CYRIX_CACHE_WORKS opt_cpu.h
CYRIX_CACHE_REALLY_WORKS opt_cpu.h
-NO_MEMORY_HOLE opt_cpu.h
# The CPU type affects the endian conversion functions all over the kernel.
I386_CPU opt_global.h
@@ -66,26 +68,16 @@ I486_CPU opt_global.h
I586_CPU opt_global.h
I686_CPU opt_global.h
+SC_SPLASH_SCREEN opt_syscons.h
MAXCONS opt_syscons.h
-# obsolete, use VGA_SLOW_IOACCESS
-#SLOW_VGA opt_syscons.h
+SLOW_VGA opt_syscons.h
STD8X16FONT opt_syscons.h
SC_HISTORY_SIZE opt_syscons.h
SC_DISABLE_REBOOT opt_syscons.h
SC_MOUSE_CHAR opt_syscons.h
-# obsolete, use VGA_ALT_SEQACCESS
-#SC_ALT_SEQACCESS opt_syscons.h
-
-FB_INSTALL_CDEV opt_fb.h
-
-VGA_ALT_SEQACCESS opt_vga.h
-VGA_DEBUG opt_vga.h
-VGA_NO_FONT_LOADING opt_vga.h
-VGA_NO_MODE_CHANGE opt_vga.h
-VGA_SLOW_IOACCESS opt_vga.h
+SC_ALT_SEQACCESS opt_syscons.h
VESA opt_vesa.h
-VESA_DEBUG opt_vesa.h
PSM_HOOKAPM opt_psm.h
PSM_RESETAFTERSUSPEND opt_psm.h
@@ -93,11 +85,10 @@ PSM_DEBUG opt_psm.h
PCIC_RESUME_RESET opt_pcic.h
-KBD_INSTALL_CDEV opt_kbd.h
-KBD_MAXRETRY opt_kbd.h
-KBD_MAXWAIT opt_kbd.h
-KBD_RESETDELAY opt_kbd.h
-KBDIO_DEBUG opt_kbd.h
+KBD_RESETDELAY opt_kbdio.h
+KBD_MAXRETRY opt_kbdio.h
+KBD_MAXWAIT opt_kbdio.h
+KBDIO_DEBUG opt_kbdio.h
ATAPI opt_atapi.h
ATAPI_STATIC opt_atapi.h
@@ -106,13 +97,12 @@ CMD640 opt_wd.h
USERCONFIG opt_userconfig.h
VISUAL_USERCONFIG opt_userconfig.h
-INTRO_USERCONFIG opt_userconfig.h
+USERCONFIG_BOOT opt_userconfig.h
EISA_SLOTS opt_eisa.h
FDC_DEBUG opt_fdc.h
FDC_PRINT_BOGUS_CHIPTYPE opt_fdc.h
-FDC_YE opt_fdc.h
# pcvt(4) has a bunch of options
FAT_CURSOR opt_pcvt.h
@@ -136,39 +126,3 @@ GUS_IRQ opt_sound.h
# Video spigot
SPIGOT_UNSECURE opt_spigot.h
-# -------------------------------
-# isdn4bsd: passive ISA cards
-# -------------------------------
-TEL_S0_8 opt_i4b.h
-TEL_S0_16 opt_i4b.h
-TEL_S0_16_3 opt_i4b.h
-AVM_A1 opt_i4b.h
-USR_STI opt_i4b.h
-ITKIX1 opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive ISA PnP cards
-# -------------------------------
-CRTX_S0_P opt_i4b.h
-DRN_NGO opt_i4b.h
-TEL_S0_16_3_P opt_i4b.h
-SEDLBAUER opt_i4b.h
-DYNALINK opt_i4b.h
-ELSA_QS1ISA opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCI cards
-# -------------------------------
-ELSA_QS1PCI opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCMCIA cards
-# -------------------------------
-AVM_A1_PCMCIA opt_i4b.h
-# -------------------------------
-# isdn4bsd: misc options
-# -------------------------------
-# temporary workaround for SMP machines
-I4B_SMP_WORKAROUND opt_i4b.h
-# enable VJ compression code for ipr i/f
-IPR_VJ opt_i4b.h
-# -------------------------------
-# EOF
-# -------------------------------
diff --git a/sys/i386/eisa/adv_eisa.c b/sys/i386/eisa/adv_eisa.c
index 87ff8dd276fd4..77b2a92684323 100644
--- a/sys/i386/eisa/adv_eisa.c
+++ b/sys/i386/eisa/adv_eisa.c
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adv_eisa.c,v 1.1 1998/09/15 07:05:39 gibbs Exp $
+ * $Id$
*/
#include "eisa.h"
@@ -76,9 +76,9 @@ static int adveisaattach(struct eisa_device *e_dev);
* The overrun buffer shared amongst all EISA adapters.
*/
static u_int8_t* overrun_buf;
-static bus_dma_tag_t overrun_dmat;
-static bus_dmamap_t overrun_dmamap;
-static bus_addr_t overrun_physbase;
+bus_dma_tag_t overrun_dmat;
+bus_dmamap_t overrun_dmamap;
+bus_addr_t overrun_physbase;
static struct eisa_driver adv_eisa_driver =
{
diff --git a/sys/i386/eisa/ahc_eisa.c b/sys/i386/eisa/ahc_eisa.c
index 039878da4bf08..d69159ecaca0e 100644
--- a/sys/i386/eisa/ahc_eisa.c
+++ b/sys/i386/eisa/ahc_eisa.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahc_eisa.c,v 1.3 1998/10/15 18:21:50 gibbs Exp $
+ * $Id: ahc_eisa.c,v 1.2 1998/10/09 17:42:28 gibbs Exp $
*/
#include "eisa.h"
@@ -44,7 +44,6 @@
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
#include <cam/scsi/scsi_all.h>
#include <dev/aic7xxx/aic7xxx.h>
diff --git a/sys/i386/eisa/eisaconf.c b/sys/i386/eisa/eisaconf.c
index e1eee615d1412..11418e70bf671 100644
--- a/sys/i386/eisa/eisaconf.c
+++ b/sys/i386/eisa/eisaconf.c
@@ -28,14 +28,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: eisaconf.c,v 1.36 1998/12/04 22:54:46 archie Exp $
+ * $Id: eisaconf.c,v 1.34 1998/02/09 06:08:09 eivind Exp $
*/
#include "opt_eisa.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
#include <machine/limits.h>
@@ -350,7 +350,7 @@ eisa_reg_end(e_dev)
{
char string[25];
- snprintf(string, sizeof(string), " on %s0 slot %d",
+ sprintf(string, " on %s0 slot %d",
mainboard_drv.name,
e_dev->ioconf.slot);
eisa_reg_print(e_dev, string, NULL);
@@ -432,7 +432,7 @@ eisa_reg_intr(e_dev, irq, func, arg, maskptr, shared)
return EPERM;
}
- snprintf(string, sizeof(string), " irq %d", irq);
+ sprintf(string, " irq %d", irq);
eisa_reg_print(e_dev, string, reg_state.num_interrupts ?
&separator : NULL);
reg_state.num_interrupts++;
diff --git a/sys/i386/eisa/if_fea.c b/sys/i386/eisa/if_fea.c
index fd9447e2c009c..4113b1ac7ca0e 100644
--- a/sys/i386/eisa/if_fea.c
+++ b/sys/i386/eisa/if_fea.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_fea.c,v 1.12 1999/01/01 12:35:47 bde Exp $
+ * $Id: if_fea.c,v 1.9 1998/02/20 13:11:46 bde Exp $
*/
/*
@@ -205,9 +205,9 @@ pdq_eisa_attach(
irq = TAILQ_FIRST(&ed->ioconf.irqs)->irq_no;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
+ sc = (pdq_softc_t *) malloc(sizeof(*sc), M_DEVBUF, M_WAITOK);
if (sc == NULL) {
- printf("fea%ld: malloc failed!\n", ed->unit);
+ printf("fea%d: malloc failed!\n", sc->sc_if.if_unit);
return -1;
}
pdqs_eisa[ed->unit] = sc;
diff --git a/sys/i386/eisa/if_vx_eisa.c b/sys/i386/eisa/if_vx_eisa.c
index b46fc752b95ef..fcee846452a20 100644
--- a/sys/i386/eisa/if_vx_eisa.c
+++ b/sys/i386/eisa/if_vx_eisa.c
@@ -159,7 +159,7 @@ vx_eisa_attach(e_dev)
level_intr = FALSE;
- if (eisa_reg_intr(e_dev, irq, vxintr, (void *) sc, &net_imask,
+ if (eisa_reg_intr(e_dev, irq, (void (*)(void *)) vxintr, (void *) sc, &net_imask,
/* shared == */ level_intr)) {
vxfree(sc);
return -1;
@@ -172,7 +172,7 @@ vx_eisa_attach(e_dev)
if (eisa_enable_intr(e_dev, irq)) {
vxfree(sc);
- eisa_release_intr(e_dev, irq, vxintr);
+ eisa_release_intr(e_dev, irq, (void (*)(void *)) vxintr);
return -1;
}
return 0;
diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c
index 528e27061277f..dd97021f36673 100644
--- a/sys/i386/i386/autoconf.c
+++ b/sys/i386/i386/autoconf.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
- * $Id: autoconf.c,v 1.110 1998/10/26 07:05:34 bde Exp $
+ * $Id: autoconf.c,v 1.108 1998/10/05 21:09:21 obrien Exp $
*/
/*
@@ -92,24 +92,23 @@
#include <pci/pcivar.h>
#endif
+#include "card.h"
+#if NCARD > 0
+#include <pccard/driver.h>
+#endif
+
+#include "scbus.h"
+
#include <sys/bus.h>
-static void configure_first __P((void *));
static void configure __P((void *));
-static void configure_final __P((void *));
+SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure, NULL)
static void configure_finish __P((void));
static void configure_start __P((void));
static int setdumpdev __P((dev_t dev));
static void setroot __P((void));
-SYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL);
-/* SI_ORDER_SECOND is hookable */
-SYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL);
-/* SI_ORDER_MIDDLE is hookable */
-SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL);
-
-
#if defined(CD9660) || defined(CD9660_ROOT)
#include <sys/fcntl.h>
@@ -172,6 +171,8 @@ find_cdrom_root()
}
#endif /* CD9660 || CD9660_ROOT */
+extern void xpt_init __P((void));
+
#ifdef MFS_ROOT
extern u_char *mfs_getimage __P((void));
#endif
@@ -179,6 +180,9 @@ extern u_char *mfs_getimage __P((void));
static void
configure_start()
{
+#if NSCBUS > 0
+ xpt_init();
+#endif
}
static void
@@ -190,17 +194,12 @@ configure_finish()
* Determine i/o configuration for a machine.
*/
static void
-configure_first(dummy)
- void *dummy;
-{
-
- configure_start(); /* DDB hook? */
-}
-
-static void
configure(dummy)
void *dummy;
{
+ int i;
+
+ configure_start();
/* Allow all routines to decide for themselves if they want intrs */
/*
@@ -256,15 +255,13 @@ configure(dummy)
* at splhigh()), but we want at least bio interrupts to work.
*/
safepri = cpl;
-}
-static void
-configure_final(dummy)
- void *dummy;
-{
- int i;
+#if NCARD > 0
+ /* After everyone else has a chance at grabbing resources */
+ pccard_configure();
+#endif
- configure_finish(); /* DDB hook? */
+ configure_finish();
cninit_finish();
@@ -410,7 +407,9 @@ setdumpdev(dev)
return (0);
}
maj = major(dev);
- if (maj >= nblkdev || bdevsw[maj] == NULL)
+ if (maj >= nblkdev)
+ return (ENXIO);
+ if (bdevsw[maj] == NULL)
return (ENXIO); /* XXX is this right? */
if (bdevsw[maj]->d_psize == NULL)
return (ENXIO); /* XXX should be ENODEV ? */
@@ -453,7 +452,7 @@ setroot()
if (boothowto & RB_DFLTROOT || (bootdev & B_MAGICMASK) != B_DEVMAGIC)
return;
majdev = B_TYPE(bootdev);
- if (majdev >= nblkdev || bdevsw[majdev] == NULL)
+ if (bdevsw[majdev] == NULL)
return;
unit = B_UNIT(bootdev);
slice = B_SLICE(bootdev);
diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c
index 30571e558e159..d35967e18f44f 100644
--- a/sys/i386/i386/busdma_machdep.c
+++ b/sys/i386/i386/busdma_machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: busdma_machdep.c,v 1.11 1998/10/13 08:24:33 dg Exp $
+ * $Id: busdma_machdep.c,v 1.10 1998/10/07 03:38:14 gibbs Exp $
*/
#include <sys/param.h>
@@ -435,45 +435,38 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
seg = 1;
sg->ds_len = 0;
- {
- /*
- * note: nextpaddr not used on first loop
- */
- vm_offset_t nextpaddr = 0;
+ do {
+ bus_size_t size;
+ vm_offset_t nextpaddr; /* GCC warning expected */
- do {
- bus_size_t size;
+ paddr = pmap_kextract(vaddr);
+ size = PAGE_SIZE - (paddr & PAGE_MASK);
+ if (size > buflen)
+ size = buflen;
- paddr = pmap_kextract(vaddr);
- size = PAGE_SIZE - (paddr & PAGE_MASK);
- if (size > buflen)
- size = buflen;
-
- if (map->pagesneeded != 0
- && run_filter(dmat, paddr)) {
- paddr = add_bounce_page(dmat, map,
- vaddr, size);
- }
+ if (map->pagesneeded != 0
+ && run_filter(dmat, paddr)) {
+ paddr = add_bounce_page(dmat, map, vaddr, size);
+ }
- if (sg->ds_len == 0) {
- sg->ds_addr = paddr;
- sg->ds_len = size;
- } else if (paddr == nextpaddr) {
- sg->ds_len += size;
- } else {
- /* Go to the next segment */
- sg++;
- seg++;
- if (seg > dmat->nsegments)
- break;
- sg->ds_addr = paddr;
- sg->ds_len = size;
- }
- vaddr += size;
- nextpaddr = paddr + size;
- buflen -= size;
- } while (buflen > 0);
- }
+ if (sg->ds_len == 0) {
+ sg->ds_addr = paddr;
+ sg->ds_len = size;
+ } else if (paddr == nextpaddr) {
+ sg->ds_len += size;
+ } else {
+ /* Go to the next segment */
+ sg++;
+ seg++;
+ if (seg > dmat->nsegments)
+ break;
+ sg->ds_addr = paddr;
+ sg->ds_len = size;
+ }
+ vaddr += size;
+ nextpaddr = paddr + size;
+ buflen -= size;
+ } while (buflen > 0);
if (buflen != 0) {
printf("bus_dmamap_load: Too many segs! buf_len = 0x%lx\n",
diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c
index 581ff3f9c1dda..1482c61855571 100644
--- a/sys/i386/i386/cons.c
+++ b/sys/i386/i386/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.59 1998/08/23 08:26:40 bde Exp $
+ * $Id: cons.c,v 1.58 1998/06/07 17:09:58 dfr Exp $
*/
#include "opt_devfs.h"
@@ -57,6 +57,23 @@
#include <machine/cpu.h>
#include <machine/cons.h>
+/* XXX this should be config(8)ed. */
+#include "sc.h"
+#include "vt.h"
+#include "sio.h"
+static struct consdev constab[] = {
+#if NSC > 0
+ { sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc },
+#endif
+#if NVT > 0
+ { pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc },
+#endif
+#if NSIO > 0
+ { siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc },
+#endif
+ { 0 },
+};
+
static d_open_t cnopen;
static d_close_t cnclose;
static d_read_t cnread;
@@ -74,7 +91,7 @@ static struct cdevsw cn_cdevsw = {
};
static dev_t cn_dev_t; /* seems to be never really used */
-SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
+SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
&cn_dev_t, sizeof cn_dev_t, "T,dev_t", "");
static int cn_mute;
@@ -95,22 +112,16 @@ static struct tty *cn_tp; /* physical console tty struct */
static void *cn_devfs_token; /* represents the devfs entry */
#endif /* DEVFS */
-CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL);
-
void
cninit()
{
struct consdev *best_cp, *cp;
- struct consdev **list;
/*
* Find the first console with the highest priority.
*/
best_cp = NULL;
- list = (struct consdev **)cons_set.ls_items;
- while ((cp = *list++) != NULL) {
- if (cp->cn_probe == NULL)
- continue;
+ for (cp = constab; cp->cn_probe; cp++) {
(*cp->cn_probe)(cp);
if (cp->cn_pri > CN_DEAD &&
(best_cp == NULL || cp->cn_pri > best_cp->cn_pri))
diff --git a/sys/i386/i386/cons.h b/sys/i386/i386/cons.h
index 1656b1261d47a..76bc0739facae 100644
--- a/sys/i386/i386/cons.h
+++ b/sys/i386/i386/cons.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.2 (Berkeley) 5/9/91
- * $Id: cons.h,v 1.18 1999/01/07 14:14:11 yokota Exp $
+ * $Id: cons.h,v 1.16 1997/04/01 16:13:31 bde Exp $
*/
#ifndef _MACHINE_CONS_H_
@@ -49,6 +49,30 @@ typedef int cn_getc_t __P((dev_t));
typedef int cn_checkc_t __P((dev_t));
typedef void cn_putc_t __P((dev_t, int));
+#ifdef KERNEL
+/*
+ * XXX public functions in drivers should be declared in headers produced
+ * by `config', not here.
+ */
+cn_probe_t pccnprobe;
+cn_init_t pccninit;
+cn_getc_t pccngetc;
+cn_checkc_t pccncheckc;
+cn_putc_t pccnputc;
+
+cn_probe_t sccnprobe;
+cn_init_t sccninit;
+cn_getc_t sccngetc;
+cn_checkc_t sccncheckc;
+cn_putc_t sccnputc;
+
+cn_probe_t siocnprobe;
+cn_init_t siocninit;
+cn_getc_t siocngetc;
+cn_checkc_t siocncheckc;
+cn_putc_t siocnputc;
+#endif /* KERNEL */
+
struct consdev {
cn_probe_t *cn_probe;
/* probe hardware and fill in consdev info */
@@ -72,15 +96,8 @@ struct consdev {
#define CN_REMOTE 3 /* serial interface with remote bit set */
#ifdef KERNEL
-extern struct linker_set cons_set;
extern int cons_unavail;
-#define CONS_DRIVER(name, probe, init, getc, checkc, putc) \
- static struct consdev name##_consdev = { \
- probe, init, getc, checkc, putc \
- }; \
- DATA_SET(cons_set, name##_consdev)
-
/* Other kernel entry points. */
int cncheckc __P((void));
int cngetc __P((void));
diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c
index 7f01f1d735e69..3f5f893a677c1 100644
--- a/sys/i386/i386/db_interface.c
+++ b/sys/i386/i386/db_interface.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_interface.c,v 1.42 1998/12/14 05:34:33 dillon Exp $
+ * $Id: db_interface.c,v 1.40 1998/06/08 08:43:20 dfr Exp $
*/
/*
@@ -69,7 +69,7 @@ kdb_trap(type, code, regs)
int type, code;
register struct i386_saved_state *regs;
{
- volatile int ddb_mode = !(boothowto & RB_GDB);
+ int ddb_mode = !(boothowto & RB_GDB);
/*
* XXX try to do nothing if the console is in graphics mode.
@@ -295,12 +295,11 @@ db_write_bytes(addr, size, data)
* Move this to machdep.c and allow it to be called if any debugger is
* installed.
*/
-volatile int in_Debugger = 0;
-
void
Debugger(msg)
const char *msg;
{
+ static volatile u_char in_Debugger;
/*
* XXX
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index aad9d89fa2b88..eae2f4fcbbb11 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: elf_machdep.c,v 1.3 1998/10/16 03:54:59 peter Exp $
+ * $Id: elf_machdep.c,v 1.2 1998/10/09 20:38:03 peter Exp $
*/
#include <sys/param.h>
@@ -42,7 +42,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym)
{
Elf_Addr relocbase = (Elf_Addr) lf->address;
Elf_Addr *where;
- Elf_Addr addr;
+ Elf_Addr addr, tmp_value;
Elf_Addr addend;
Elf_Word rtype;
const Elf_Rel *rel;
diff --git a/sys/i386/i386/gensetdefs.c b/sys/i386/i386/gensetdefs.c
new file mode 100644
index 0000000000000..21029168d5aae
--- /dev/null
+++ b/sys/i386/i386/gensetdefs.c
@@ -0,0 +1,313 @@
+/*-
+ * Copyright (c) 1997 John D. Polstra.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#include <sys/types.h>
+#include <machine/elf.h>
+
+#include <err.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define HASHSIZE 1009u /* Number of hash chains. */
+#define PREFIX ".set." /* Section name prefix for linker sets. */
+
+/* One entry in the hash table. */
+typedef struct hashent {
+ struct hashent *next; /* Next entry with the same hash. */
+ char *name; /* Name of the linker set. */
+ size_t size; /* Size in bytes. */
+} hashent;
+
+/* Allocate storage for "count" objects of type "type". */
+#define NEW(type, count) ((type *) xmalloc((count) * sizeof(type)))
+
+static hashent *hashtab[HASHSIZE]; /* Hash chain heads. */
+
+static void enter(const char *, size_t);
+static int enter_sets(const char *);
+static unsigned int hash(const char *);
+static hashent *merge(void);
+static int my_byte_order(void);
+static void *xmalloc(size_t);
+static char *xstrdup(const char *);
+
+/*
+ * This is a special-purpose program to generate the linker set definitions
+ * needed when building an ELF kernel. Its arguments are the names of
+ * ELF object files. It scans the section names of the object files,
+ * building a table of those that begin with ".set.", which represent
+ * linker sets. Finally, for each set "foo" with "count" elements, it
+ * writes a line "DEFINE_SET(foo, count);" to the standard output.
+ */
+int
+main(int argc, char **argv)
+{
+ int i;
+ int status = EXIT_SUCCESS;
+ hashent *list;
+
+ for (i = 1; i < argc; i++)
+ if (enter_sets(argv[i]) == -1)
+ status = EXIT_FAILURE;
+
+ list = merge();
+ while (list != NULL) {
+ hashent *next;
+
+ printf("DEFINE_SET(%s, %lu);\n", list->name,
+ (unsigned long) (list->size / sizeof (void *)));
+ next = list->next;
+ free(list->name);
+ free(list);
+ list = next;
+ }
+
+ return (status);
+}
+
+/*
+ * Enter the given string into the hash table, if it is not already there.
+ * Each hash chain is kept sorted, so that it will be easy to merge the
+ * chains to get a single sorted list.
+ */
+static void
+enter(const char *name, size_t size)
+{
+ int c;
+ hashent *entp;
+ hashent **linkp;
+ hashent *newp;
+
+ linkp = &hashtab[hash(name) % HASHSIZE];
+ while ((entp = *linkp) != NULL && (c = strcmp(name, entp->name)) > 0)
+ linkp = &entp->next;
+
+ if (entp == NULL || c != 0) { /* Not found; create a new entry. */
+ newp = NEW(hashent, 1);
+ newp->name = xstrdup(name);
+ newp->size = 0;
+ newp->next = entp;
+ *linkp = newp;
+ entp = newp;
+ }
+
+ entp->size += size;
+}
+
+/*
+ * Return a hash value for the given string.
+ */
+static unsigned int
+hash(const char *s)
+{
+ unsigned char ch;
+ unsigned int h = 0;
+
+ while((ch = *s) != '\0') {
+ h = 9*h + ch;
+ s++;
+ }
+ return (h);
+}
+
+/*
+ * Enter the linker sets from the given ELF object file. Returns 0 on
+ * success, or -1 if an error occurred.
+ */
+static int
+enter_sets(const char *filename)
+{
+ int i;
+ FILE *iop;
+ Elf32_Shdr *shdr;
+ char *shstr;
+ Elf32_Ehdr ehdr;
+
+ if ((iop = fopen(filename, "rb")) == NULL) {
+ warn("%s", filename);
+ return (-1);
+ }
+ if (fread(&ehdr, sizeof ehdr, 1, iop) != 1 ||
+ ehdr.e_ident[EI_MAG0] != ELFMAG0 ||
+ ehdr.e_ident[EI_MAG1] != ELFMAG1 ||
+ ehdr.e_ident[EI_MAG2] != ELFMAG2 ||
+ ehdr.e_ident[EI_MAG3] != ELFMAG3) {
+ warnx("%s: not an ELF file", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_ident[EI_VERSION] != EV_CURRENT) {
+ warnx("%s: unsupported ELF version", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_ident[EI_DATA] != my_byte_order()) {
+ warnx("%s: unsupported byte order", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_shoff == 0) {
+ warnx("%s: no section table", filename);
+ fclose(iop);
+ return (-1);
+ }
+ if (ehdr.e_shstrndx == SHN_UNDEF) {
+ warnx("%s: no section name string table", filename);
+ fclose(iop);
+ return (-1);
+ }
+
+ shdr = NEW(Elf32_Shdr, ehdr.e_shnum);
+ if (fseek(iop, ehdr.e_shoff, SEEK_SET) == -1) {
+ warn("%s", filename);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+ if (fread(shdr, sizeof *shdr, ehdr.e_shnum, iop) != ehdr.e_shnum) {
+ warnx("%s: truncated section table", filename);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+
+ shstr = NEW(char, shdr[ehdr.e_shstrndx].sh_size);
+ if (fseek(iop, shdr[ehdr.e_shstrndx].sh_offset, SEEK_SET) == -1) {
+ warn("%s", filename);
+ free(shstr);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+ if (fread(shstr, sizeof *shstr, shdr[ehdr.e_shstrndx].sh_size, iop) !=
+ shdr[ehdr.e_shstrndx].sh_size) {
+ warnx("%s: truncated section name string table", filename);
+ free(shstr);
+ free(shdr);
+ fclose(iop);
+ return (-1);
+ }
+
+ for (i = 1; i < ehdr.e_shnum; i++) {
+ const char *name = shstr + shdr[i].sh_name;
+
+ if (strncmp(name, PREFIX, sizeof (PREFIX) - 1) == 0)
+ enter(name + sizeof (PREFIX) - 1, shdr[i].sh_size);
+ }
+
+ free(shstr);
+ free(shdr);
+ fclose(iop);
+ return (0);
+}
+
+/*
+ * Destructively merge all the sorted hash chains into a single sorted
+ * list, and return a pointer to its first element.
+ */
+static hashent *
+merge(void)
+{
+ unsigned int numchains = HASHSIZE;
+
+ while (numchains > 1) { /* More merging to do. */
+ unsigned int lo = 0;
+ /*
+ * Merge chains pairwise from the outside in, halving the
+ * number of chains.
+ */
+ while (numchains - lo >= 2) {
+ hashent **linkp = &hashtab[lo];
+ hashent *l1 = hashtab[lo++];
+ hashent *l2 = hashtab[--numchains];
+
+ while (l1 != NULL && l2 != NULL) {
+ if (strcmp(l1->name, l2->name) < 0) {
+ *linkp = l1;
+ linkp = &l1->next;
+ l1 = l1->next;
+ } else {
+ *linkp = l2;
+ linkp = &l2->next;
+ l2 = l2->next;
+ }
+ }
+ *linkp = l1==NULL ? l2 : l1;
+ }
+ }
+
+ return (hashtab[0]);
+}
+
+/*
+ * Determine the host byte order.
+ */
+static int
+my_byte_order(void)
+{
+ static unsigned short s = 0xbbaa;
+ int byte0;
+
+ byte0 = *(unsigned char *)&s;
+ if (byte0 == 0xaa)
+ return (ELFDATA2LSB);
+ else if (byte0 == 0xbb)
+ return (ELFDATA2MSB);
+ else
+ return (ELFDATANONE);
+}
+
+/*
+ * Allocate a chunk of memory and return a pointer to it. Die if the
+ * malloc fails.
+ */
+static void *
+xmalloc(size_t size)
+{
+ void *p;
+
+ p = malloc(size);
+ if (p == NULL)
+ err(EXIT_FAILURE, "malloc");
+ return (p);
+}
+
+/*
+ * Duplicate a string and return a pointer to the copy. Die if there is
+ * not enough memory.
+ */
+static char *
+xstrdup(const char *s)
+{
+ int size;
+
+ size = strlen(s) + 1;
+ return (memcpy(xmalloc(size), s, size));
+}
diff --git a/sys/i386/i386/i386-gdbstub.c b/sys/i386/i386/i386-gdbstub.c
index 25e283897da55..0c5f82bb4f61a 100644
--- a/sys/i386/i386/i386-gdbstub.c
+++ b/sys/i386/i386/i386-gdbstub.c
@@ -153,9 +153,6 @@ strcpy (char *dst, const char *src)
/* XXX sio always uses its major with minor 0 no matter what we specify. */
#define REMOTE_DEV 0
-cn_getc_t siocngetc;
-cn_putc_t siocnputc;
-
static int
putDebugChar (int c) /* write a single character */
{
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index 146db244a836c..98b9edf708d02 100644
--- a/sys/i386/i386/identcpu.c
+++ b/sys/i386/i386/identcpu.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.56 1999/01/09 13:07:18 bde Exp $
+ * $Id: identcpu.c,v 1.51 1998/07/11 07:45:28 bde Exp $
*/
#include "opt_cpu.h"
@@ -59,17 +59,17 @@
#define IDENTBLUE_IBMCPU 1
#define IDENTBLUE_CYRIXM2 2
-/* XXX - should be in header file: */
-void printcpuinfo(void);
+/* XXX - should be in header file */
+void i486_bzero __P((void *buf, size_t len));
+
+void printcpuinfo(void); /* XXX should be in different header file */
void finishidentcpu(void);
void earlysetcpuclass(void);
#if defined(I586_CPU) && defined(CPU_WT_ALLOC)
void enable_K5_wt_alloc(void);
void enable_K6_wt_alloc(void);
-void enable_K6_2_wt_alloc(void);
#endif
void panicifcpuunsupported(void);
-
static void identifycyrix(void);
static void print_AMD_info(void);
static void print_AMD_assoc(int i);
@@ -106,13 +106,13 @@ do_cpuid(u_int ax, u_int *p)
{
__asm __volatile(
".byte 0x0f, 0xa2;"
- "movl %%eax, (%2);"
- "movl %%ebx, 4(%2);"
- "movl %%ecx, 8(%2);"
- "movl %%edx, 12(%2);"
- : "=a" (ax)
- : "0" (ax), "S" (p)
- : "bx", "cx", "dx"
+ "movl %%eax, (%%esi);"
+ "movl %%ebx, (4)(%%esi);"
+ "movl %%ecx, (8)(%%esi);"
+ "movl %%edx, (12)(%%esi);"
+ :
+ : "a" (ax), "S" (p)
+ : "ax", "bx", "cx", "dx"
);
}
@@ -291,13 +291,9 @@ printcpuinfo(void)
if ((cpu_id & 0xf00) == 0x500) {
if (((cpu_id & 0x0f0) > 0)
&& ((cpu_id & 0x0f0) < 0x60)
- && ((cpu_id & 0x00f) > 3))
+ && ((cpu_id & 0x00f) > 3)) {
enable_K5_wt_alloc();
- else if (((cpu_id & 0x0f0) > 0x80)
- || (((cpu_id & 0x0f0) == 0x80)
- && (cpu_id & 0x00f) > 0x07))
- enable_K6_2_wt_alloc();
- else if ((cpu_id & 0x0f0) > 0x50)
+ } else if ((cpu_id & 0x0f0) > 0x50)
enable_K6_wt_alloc();
}
#endif
@@ -843,7 +839,6 @@ static void
print_AMD_info(void)
{
u_int regs[4];
- quad_t amd_whcr;
do_cpuid(0x80000000, regs);
if (regs[0] >= 0x80000005) {
@@ -861,33 +856,4 @@ print_AMD_info(void)
printf(", %d lines/tag", (regs[3] >> 8) & 0xff);
print_AMD_assoc((regs[3] >> 16) & 0xff);
}
- if (((cpu_id & 0xf00) == 0x500)
- && (((cpu_id & 0x0f0) > 0x80)
- || (((cpu_id & 0x0f0) == 0x80)
- && (cpu_id & 0x00f) > 0x07))) {
- /* K6-2(new core [Stepping 8-F]), K6-3 or later */
- amd_whcr = rdmsr(0xc0000082);
- if (!(amd_whcr & (0x3ff << 22))) {
- printf("Write Allocate Disable\n");
- } else {
- printf("Write Allocate Enable Limit: %dM bytes\n",
- (u_int32_t)((amd_whcr & (0x3ff << 22)) >> 22) * 4);
- printf("Write Allocate 15-16M bytes: %s\n",
- (amd_whcr & (1 << 16)) ? "Enable" : "Disable");
- }
- } else if (((cpu_id & 0xf00) == 0x500)
- && ((cpu_id & 0x0f0) > 0x50)) {
- /* K6, K6-2(old core) */
- amd_whcr = rdmsr(0xc0000082);
- if (!(amd_whcr & (0x7f << 1))) {
- printf("Write Allocate Disable\n");
- } else {
- printf("Write Allocate Enable Limit: %dM bytes\n",
- (u_int32_t)((amd_whcr & (0x7f << 1)) >> 1) * 4);
- printf("Write Allocate 15-16M bytes: %s\n",
- (amd_whcr & 0x0001) ? "Enable" : "Disable");
- printf("Hardware Write Allocate Control: %s\n",
- (amd_whcr & 0x0100) ? "Enable" : "Disable");
- }
- }
}
diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c
index d64f4eefedd1a..9f1f2a9b7190e 100644
--- a/sys/i386/i386/initcpu.c
+++ b/sys/i386/i386/initcpu.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: initcpu.c,v 1.16 1998/12/27 23:23:26 msmith Exp $
+ * $Id: initcpu.c,v 1.13 1998/05/16 14:38:10 kato Exp $
*/
#include "opt_cpu.h"
@@ -44,7 +44,6 @@ void initializecpu(void);
#if defined(I586_CPU) && defined(CPU_WT_ALLOC)
void enable_K5_wt_alloc(void);
void enable_K6_wt_alloc(void);
-void enable_K6_2_wt_alloc(void);
#endif
#ifdef I486_CPU
@@ -617,18 +616,20 @@ enable_K6_wt_alloc(void)
#endif
/* Don't assume that memory size is aligned with 4M. */
if (Maxmem > 0)
- size = ((Maxmem >> 8) + 3) >> 2;
+ size = Maxmem / 256;
else
size = 0;
+ size = (size + 3) / 4;
/* Limit is 508M bytes. */
- if (size > 0x7f)
- size = 0x7f;
- whcr = (rdmsr(0xc0000082) & ~(0x7fLL << 1)) | (size << 1);
+ if (size > 127)
+ size = 127;
+ whcr = rdmsr(0xc0000082);
+ whcr &= ~0x00feLL;
+ whcr |= (size << 1);
-#if defined(PC98) || defined(NO_MEMORY_HOLE)
- if (whcr & (0x7fLL << 1)) {
#ifdef PC98
+ if (whcr & 0x00feLL) {
/*
* If bit 2 of port 0x43b is 0, disable wrte allocate for the
* 15-16M range.
@@ -636,7 +637,6 @@ enable_K6_wt_alloc(void)
if (!(inb(0x43b) & 4))
whcr &= ~0x0001LL;
else
-#endif
whcr |= 0x0001LL;
}
#else
@@ -644,69 +644,7 @@ enable_K6_wt_alloc(void)
* There is no way to know wheter 15-16M hole exists or not.
* Therefore, we disable write allocate for this range.
*/
- whcr &= ~0x0001LL;
-#endif
- wrmsr(0x0c0000082, whcr);
-
- write_eflags(eflags);
- enable_intr();
-}
-
-void
-enable_K6_2_wt_alloc(void)
-{
- quad_t size;
- u_int64_t whcr;
- u_long eflags;
-
- eflags = read_eflags();
- disable_intr();
- wbinvd();
-
-#ifdef CPU_DISABLE_CACHE
- /*
- * Certain K6-2 box becomes unstable when write allocation is
- * enabled.
- */
- /*
- * The AMD-K6 processer provides the 64-bit Test Register 12(TR12),
- * but only the Cache Inhibit(CI) (bit 3 of TR12) is suppported.
- * All other bits in TR12 have no effect on the processer's operation.
- * The I/O Trap Restart function (bit 9 of TR12) is always enabled
- * on the AMD-K6.
- */
- wrmsr(0x0000000e, (u_int64_t)0x0008);
-#endif
- /* Don't assume that memory size is aligned with 4M. */
- if (Maxmem > 0)
- size = ((Maxmem >> 8) + 3) >> 2;
- else
- size = 0;
-
- /* Limit is 4092M bytes. */
- if (size > 0x3fff)
- size = 0x3ff;
- whcr = (rdmsr(0xc0000082) & ~(0x3ffLL << 22)) | (size << 22);
-
-#if defined(PC98) || defined(NO_MEMORY_HOLE)
- if (whcr & (0x3ffLL << 22)) {
-#ifdef PC98
- /*
- * If bit 2 of port 0x43b is 0, disable wrte allocate for the
- * 15-16M range.
- */
- if (!(inb(0x43b) & 4))
- whcr &= ~(1LL << 16);
- else
-#endif
- whcr |= 1LL << 16;
- }
-#else
- /*
- * There is no way to know wheter 15-16M hole exists or not.
- * Therefore, we disable write allocate for this range.
- */
- whcr &= ~(1LL << 16);
+ whcr &= 0x00feLL;
#endif
wrmsr(0x0c0000082, whcr);
@@ -723,8 +661,7 @@ DB_SHOW_COMMAND(cyrixreg, cyrixreg)
{
u_long eflags;
u_int cr0;
- u_char ccr1, ccr2, ccr3;
- u_char ccr0 = 0, ccr4 = 0, ccr5 = 0, pcr0 = 0;
+ u_char ccr0, ccr1, ccr2, ccr3, ccr4, ccr5, pcr0;
cr0 = rcr0();
if (strcmp(cpu_vendor,"CyrixInstead") == 0) {
diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s
index 42955056d4239..f6f735d9f2ed9 100644
--- a/sys/i386/i386/locore.s
+++ b/sys/i386/i386/locore.s
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
- * $Id: locore.s,v 1.117 1998/11/03 21:07:50 msmith Exp $
+ * $Id: locore.s,v 1.115 1998/10/09 23:36:25 peter Exp $
*
* originally from: locore.s, by William F. Jolitz
*
@@ -206,9 +206,9 @@ NON_GPROF_ENTRY(btext)
#ifdef PC98
jmp 1f
- .globl CNAME(pc98_system_parameter)
+ .globl _pc98_system_parameter
.org 0x400
-CNAME(pc98_system_parameter):
+_pc98_system_parameter:
.space 0x240 /* BIOS parameter block */
1:
/* save SYSTEM PARAMETER for resume (NS/T or other) */
@@ -599,6 +599,15 @@ olddiskboot:
movl 12(%ebp),%eax
movl %eax,R(_bootdev)
+#if defined(USERCONFIG_BOOT) && defined(USERCONFIG)
+ movl $0x10200, %esi
+ movl $R(_userconfig_from_boot),%edi
+ movl $512,%ecx
+ cld
+ rep
+ movsb
+#endif /* USERCONFIG_BOOT */
+
ret
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 1bd6f6c5f04ae..06db0703bc201 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.321 1999/01/09 15:41:49 bde Exp $
+ * $Id: machdep.c,v 1.312 1998/10/09 00:31:06 msmith Exp $
*/
#include "apm.h"
@@ -109,6 +109,9 @@
#include <net/netisr.h>
#endif
+#if NAPM > 0
+#include <machine/apm_bios.h>
+#endif
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/clock.h>
@@ -159,9 +162,9 @@ SYSCTL_INT(_debug, OID_AUTO, tlb_flush_count,
#endif
#ifdef PC98
-static int ispc98 = 1;
+int ispc98 = 1;
#else
-static int ispc98 = 0;
+int ispc98 = 0;
#endif
SYSCTL_INT(_machdep, OID_AUTO, ispc98, CTLFLAG_RD, &ispc98, 0, "");
@@ -410,12 +413,6 @@ again:
*/
{
vm_offset_t mb_map_size;
- int xclusters;
-
- /* Allow override of NMBCLUSTERS from the kernel environment */
- if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
- xclusters > nmbclusters)
- nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
@@ -439,8 +436,14 @@ again:
}
#if defined(USERCONFIG)
- userconfig();
- cninit(); /* the preferred console may have changed */
+#if defined(USERCONFIG_BOOT)
+ if (1) {
+#else
+ if (boothowto & RB_CONFIG) {
+#endif
+ userconfig();
+ cninit(); /* the preferred console may have changed */
+ }
#endif
printf("avail memory = %d (%dK bytes)\n", ptoa(cnt.v_free_count),
@@ -532,11 +535,7 @@ sendsig(catcher, sig, mask, code)
* and the stack can not be grown. useracc will return FALSE
* if access is denied.
*/
-#ifdef VM_STACK
- if ((grow_stack (p, (int)fp) == FALSE) ||
-#else
if ((grow(p, (int)fp) == FALSE) ||
-#endif
(useracc((caddr_t)fp, sizeof(struct sigframe), B_WRITE) == FALSE)) {
/*
* Process has trashed its stack; give it an illegal
@@ -631,7 +630,7 @@ sendsig(catcher, sig, mask, code)
}
regs->tf_esp = (int)fp;
- regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
regs->tf_es = _udatasel;
@@ -795,6 +794,17 @@ cpu_halt(void)
}
/*
+ * Turn the power off.
+ */
+void
+cpu_power_down(void)
+{
+#if NAPM > 0
+ apm_power_off();
+#endif
+}
+
+/*
* Clear registers on exec
*/
void
@@ -1235,7 +1245,7 @@ init386(first)
setidt(11, &IDTVEC(missing), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(12, &IDTVEC(stk), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(13, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
- setidt(14, &IDTVEC(page), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+ setidt(14, &IDTVEC(page), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(15, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(16, &IDTVEC(fpu), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(17, &IDTVEC(align), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
@@ -1626,7 +1636,7 @@ f00f_hack(void *unused) {
if (!has_f00f_bug)
return;
- printf("Intel Pentium detected, installing workaround for F00F bug\n");
+ printf("Intel Pentium F00F detected, installing workaround\n");
r_idt.rd_limit = sizeof(idt) - 1;
diff --git a/sys/i386/i386/math_emulate.c b/sys/i386/i386/math_emulate.c
index a7077bd0df5dc..df44b5f75182c 100644
--- a/sys/i386/i386/math_emulate.c
+++ b/sys/i386/i386/math_emulate.c
@@ -6,7 +6,7 @@
* [expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj]
*
* from: 386BSD 0.1
- * $Id: math_emulate.c,v 1.31 1998/11/15 15:33:50 bde Exp $
+ * $Id: math_emulate.c,v 1.27 1998/07/15 09:01:18 bde Exp $
*/
/*
@@ -117,10 +117,7 @@ math_emulate(struct trapframe * info)
(u_long)oldeip);
panic("?Math emulation needed in kernel?");
}
- /* completely ignore an operand-size prefix */
- if (get_fs_byte((char *) info->tf_eip) == 0x66)
- info->tf_eip++;
- code = get_fs_word((unsigned short *) info->tf_eip);
+ code = get_fs_word((unsigned short *) oldeip);
bswapw(code);
code &= 0x7ff;
I387.fip = oldeip;
@@ -1543,18 +1540,46 @@ int_to_real(const temp_int * a, temp_real * b)
}
}
+#ifdef LKM
+MOD_MISC(fpu);
+static int
+fpu_load(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate) {
+ printf("Math emulator already present\n");
+ return EBUSY;
+ }
+ pmath_emulate = math_emulate;
+ return 0;
+}
+
+static int
+fpu_unload(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate != math_emulate) {
+ printf("Cannot unload another math emulator\n");
+ return EACCES;
+ }
+ pmath_emulate = 0;
+ return 0;
+}
+
+int
+fpu_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(fpu, lkmtp, cmd, ver, fpu_load, fpu_unload, lkm_nullcmd);
+}
+#else /* !LKM */
+
static int
-fpu_modevent(module_t mod, int type, void *unused)
+fpu_modevent(module_t mod, modeventtype_t type, void *unused)
{
switch (type) {
case MOD_LOAD:
- if (pmath_emulate) {
+ if (pmath_emulate)
printf("Another Math emulator already present\n");
- return EBUSY;
- }
- pmath_emulate = math_emulate;
- if (bootverbose)
- printf("Math emulator present\n");
+ else
+ pmath_emulate = math_emulate;
break;
case MOD_UNLOAD:
if (pmath_emulate != math_emulate) {
@@ -1562,9 +1587,6 @@ fpu_modevent(module_t mod, int type, void *unused)
return EACCES;
}
pmath_emulate = 0;
- if (bootverbose)
- printf("Math emulator unloaded\n");
- break;
default:
break;
}
@@ -1575,4 +1597,6 @@ moduledata_t fpumod = {
fpu_modevent,
0
};
-DECLARE_MODULE(fpu, fpumod, SI_SUB_DRIVERS, SI_ORDER_ANY);
+DECLARE_MODULE(fpu, fpumod, SI_SUB_PSEUDO, SI_ORDER_ANY);
+
+#endif /* LKM */
diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c
index 1994f12ce5382..d26b9ee5ebf5c 100644
--- a/sys/i386/i386/mem.c
+++ b/sys/i386/i386/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.52 1998/06/21 11:33:29 bde Exp $
+ * $Id: mem.c,v 1.51 1998/06/07 17:10:02 dfr Exp $
*/
/*
@@ -381,7 +381,7 @@ mmrw(dev, uio, flags)
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, int nprot)
+memmmap(dev_t dev, int offset, int nprot)
{
switch (minor(dev))
{
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 569f04baf6597..adf5131b1d84c 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp_machdep.c,v 1.87 1999/01/12 00:19:31 eivind Exp $
+ * $Id: mp_machdep.c,v 1.82 1998/10/10 09:38:02 kato Exp $
*/
#include "opt_smp.h"
@@ -1009,8 +1009,8 @@ fix_mp_table(void)
{
int x;
int id;
- int bus_0 = 0; /* Stop GCC warning */
- int bus_pci = 0; /* Stop GCC warning */
+ int bus_0;
+ int bus_pci;
int num_pci_bus;
/*
@@ -1197,26 +1197,11 @@ lookup_bus_type(char *name)
static int
int_entry(int_entry_ptr entry, int intr)
{
- int apic;
-
io_apic_ints[intr].int_type = entry->int_type;
io_apic_ints[intr].int_flags = entry->int_flags;
io_apic_ints[intr].src_bus_id = entry->src_bus_id;
io_apic_ints[intr].src_bus_irq = entry->src_bus_irq;
- if (entry->dst_apic_id == 255) {
- /* This signal goes to all IO APICS. Select an IO APIC
- with sufficient number of interrupt pins */
- for (apic = 0; apic < mp_napics; apic++)
- if (((io_apic_read(apic, IOAPIC_VER) &
- IOART_VER_MAXREDIR) >> MAXREDIRSHIFT) >=
- entry->dst_apic_int)
- break;
- if (apic < mp_napics)
- io_apic_ints[intr].dst_apic_id = IO_TO_ID(apic);
- else
- io_apic_ints[intr].dst_apic_id = entry->dst_apic_id;
- } else
- io_apic_ints[intr].dst_apic_id = entry->dst_apic_id;
+ io_apic_ints[intr].dst_apic_id = entry->dst_apic_id;
io_apic_ints[intr].dst_apic_int = entry->dst_apic_int;
return 1;
@@ -1388,13 +1373,11 @@ int
undirect_isa_irq(int rirq)
{
#if defined(READY)
- if (bootverbose)
- printf("Freeing redirected ISA irq %d.\n", rirq);
+ printf("Freeing redirected ISA irq %d.\n", rirq);
/** FIXME: tickle the MB redirector chip */
return ???;
#else
- if (bootverbose)
- printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq);
+ printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq);
return 0;
#endif /* READY */
}
@@ -2200,12 +2183,12 @@ SYSCTL_INT(_machdep, OID_AUTO, forward_irq_enabled, CTLFLAG_RW,
&forward_irq_enabled, 0, "");
/* Enable forwarding of a signal to a process running on a different CPU */
-static int forward_signal_enabled = 1;
+int forward_signal_enabled = 1;
SYSCTL_INT(_machdep, OID_AUTO, forward_signal_enabled, CTLFLAG_RW,
&forward_signal_enabled, 0, "");
/* Enable forwarding of roundrobin to all other cpus */
-static int forward_roundrobin_enabled = 1;
+int forward_roundrobin_enabled = 1;
SYSCTL_INT(_machdep, OID_AUTO, forward_roundrobin_enabled, CTLFLAG_RW,
&forward_roundrobin_enabled, 0, "");
@@ -2218,6 +2201,7 @@ void ap_init(void);
void
ap_init()
{
+ u_int temp;
u_int apic_id;
smp_cpus++;
diff --git a/sys/i386/i386/perfmon.c b/sys/i386/i386/perfmon.c
index 0720c62ea0f20..d79527e3d37c5 100644
--- a/sys/i386/i386/perfmon.c
+++ b/sys/i386/i386/perfmon.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: perfmon.c,v 1.16 1998/12/07 21:58:18 archie Exp $
+ * $Id: perfmon.c,v 1.14 1997/12/28 17:33:01 phk Exp $
*/
#include <sys/param.h>
@@ -41,17 +41,13 @@
static int perfmon_inuse;
static int perfmon_cpuok;
-#ifndef SMP
static int msr_ctl[NPMC];
-#endif
static int msr_pmc[NPMC];
static unsigned int ctl_shadow[NPMC];
static quad_t pmc_shadow[NPMC]; /* used when ctr is stopped on P5 */
static int (*writectl)(int);
-#ifndef SMP
static int writectl5(int);
static int writectl6(int);
-#endif
/*
* Must be called after cpu_class is set up.
@@ -199,7 +195,6 @@ perfmon_reset(int pmc)
return EBUSY;
}
-#ifndef SMP
/*
* Unfortunately, the performance-monitoring registers are laid out
* differently in the P5 and P6. We keep everything in P6 format
@@ -250,7 +245,6 @@ writectl5(int pmc)
wrmsr(msr_ctl[0], newval);
return 0; /* XXX should check for unimplemented bits */
}
-#endif /* !SMP */
/*
* Now the user-mode interface, called from a subdevice of mem.c.
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 66c9b632f1c0b..2be04c8eeabfb 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.218 1999/01/09 21:41:22 dt Exp $
+ * $Id: pmap.c,v 1.208 1998/09/04 13:10:34 ache Exp $
*/
/*
@@ -184,14 +184,6 @@ static caddr_t CADDR2;
static pt_entry_t *msgbufmap;
struct msgbuf *msgbufp=0;
-/*
- * PPro_vmtrr
- */
-struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR];
-
-/* AIO support */
-extern struct vmspace *aiovmspace;
-
#ifdef SMP
extern char prv_CPAGE1[], prv_CPAGE2[], prv_CPAGE3[];
extern pt_entry_t *prv_CMAP1, *prv_CMAP2, *prv_CMAP3;
@@ -297,9 +289,7 @@ pmap_bootstrap(firstaddr, loadaddr)
{
vm_offset_t va;
pt_entry_t *pte;
-#ifdef SMP
int i, j;
-#endif
avail_start = firstaddr;
@@ -469,7 +459,7 @@ getmtrr()
{
int i;
- if (cpu_class == CPUCLASS_686) {
+ if (cpu == CPU_686) {
for(i = 0; i < NPPROVMTRR; i++) {
PPro_vmtrr[i].base = rdmsr(PPRO_VMTRRphysBase0 + i * 2);
PPro_vmtrr[i].mask = rdmsr(PPRO_VMTRRphysMask0 + i * 2);
@@ -482,7 +472,7 @@ putmtrr()
{
int i;
- if (cpu_class == CPUCLASS_686) {
+ if (cpu == CPU_686) {
wbinvd();
for(i = 0; i < NPPROVMTRR; i++) {
wrmsr(PPRO_VMTRRphysBase0 + i * 2, PPro_vmtrr[i].base);
@@ -495,7 +485,7 @@ void
pmap_setvidram(void)
{
#if 0
- if (cpu_class == CPUCLASS_686) {
+ if (cpu == CPU_686) {
wbinvd();
/*
* Set memory between 0-640K to be WB
@@ -518,7 +508,7 @@ pmap_setdevram(unsigned long long basea, vm_offset_t sizea)
unsigned long long base;
unsigned long long mask;
- if (cpu_class != CPUCLASS_686)
+ if (cpu != CPU_686)
return;
free = -1;
@@ -606,11 +596,6 @@ pmap_init(phys_start, phys_end)
int initial_pvs;
/*
- * object for kernel page table pages
- */
- kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
-
- /*
* calculate the number of pv_entries needed
*/
vm_first_phys = phys_avail[0];
@@ -644,6 +629,10 @@ pmap_init(phys_start, phys_end)
pvinit = (struct pv_entry *) kmem_alloc(kernel_map,
initial_pvs * sizeof (struct pv_entry));
zbootinit(pvzone, "PV ENTRY", sizeof (struct pv_entry), pvinit, pv_npg);
+ /*
+ * object for kernel page table pages
+ */
+ kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
/*
* Now it is safe to enable pv_table recording.
@@ -734,6 +723,19 @@ invltlb_1pg( vm_offset_t va) {
}
}
+static PMAP_INLINE void
+invltlb_2pg( vm_offset_t va1, vm_offset_t va2) {
+#if defined(I386_CPU)
+ if (cpu_class == CPUCLASS_386) {
+ invltlb();
+ } else
+#endif
+ {
+ invlpg(va1);
+ invlpg(va2);
+ }
+}
+
static unsigned *
get_ptbase(pmap)
pmap_t pmap;
@@ -1044,7 +1046,7 @@ pmap_dispose_proc(p)
*(ptek + i) = 0;
if ((oldpte & PG_G) || (cpu_class > CPUCLASS_386))
invlpg((vm_offset_t) p->p_addr + i * PAGE_SIZE);
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
vm_page_free(m);
}
@@ -1071,7 +1073,8 @@ pmap_swapout_proc(p)
if ((m = vm_page_lookup(upobj, i)) == NULL)
panic("pmap_swapout_proc: upage already missing???");
m->dirty = VM_PAGE_BITS_ALL;
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
+ vm_page_deactivate(m);
pmap_kremove( (vm_offset_t) p->p_addr + PAGE_SIZE * i);
}
}
@@ -1121,6 +1124,7 @@ pmap_swapin_proc(p)
*/
static int
_pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m) {
+ int s;
while (vm_page_sleep(m, "pmuwpt", NULL));
@@ -1251,6 +1255,7 @@ pmap_pinit(pmap)
/*
* allocate the page directory page
*/
+retry:
ptdpg = vm_page_grab( pmap->pm_pteobj, PTDPTDI,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
@@ -1284,6 +1289,7 @@ pmap_release_free_page(pmap, p)
struct pmap *pmap;
vm_page_t p;
{
+ int s;
unsigned *pde = (unsigned *) pmap->pm_pdir;
/*
* This code optimizes the case of freeing non-busy
@@ -1322,8 +1328,6 @@ pmap_release_free_page(pmap, p)
if (pmap->pm_ptphint && (pmap->pm_ptphint->pindex == p->pindex))
pmap->pm_ptphint = NULL;
- p->wire_count--;
- cnt.v_wire_count--;
vm_page_free_zero(p);
return 1;
}
@@ -1558,10 +1562,6 @@ pmap_growkernel(vm_offset_t addr)
*pmap_pde(pmap, kernel_vm_end) = newpdir;
}
}
- if (aiovmspace != NULL) {
- pmap = &aiovmspace->vm_pmap;
- *pmap_pde(pmap, kernel_vm_end) = newpdir;
- }
*pmap_pde(kernel_pmap, kernel_vm_end) = newpdir;
kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
}
@@ -2426,6 +2426,7 @@ pmap_object_init_pt(pmap, addr, object, pindex, size, limit)
((addr & (NBPDR - 1)) == 0) &&
((size & (NBPDR - 1)) == 0) ) {
int i;
+ int s;
vm_page_t m[1];
unsigned int ptepindex;
int npdes;
@@ -2818,7 +2819,7 @@ pmap_zero_page(phys)
cpu_invlpg(&prv_CPAGE3);
#if defined(I686_CPU)
- if (cpu_class == CPUCLASS_686)
+ if (cpu == CPU_686)
i686_pagezero(&prv_CPAGE3);
else
#endif
@@ -2839,7 +2840,7 @@ pmap_zero_page(phys)
}
#if defined(I686_CPU)
- if (cpu_class == CPUCLASS_686)
+ if (cpu == CPU_686)
i686_pagezero(CADDR2);
else
#endif
@@ -3193,7 +3194,7 @@ pmap_phys_address(ppn)
int
pmap_ts_referenced(vm_offset_t pa)
{
- register pv_entry_t pv, pvf, pvn;
+ register pv_entry_t pv;
pv_table_t *ppv;
unsigned *pte;
int s;
@@ -3214,11 +3215,9 @@ pmap_ts_referenced(vm_offset_t pa)
/*
* Not found, check current mappings returning immediately if found.
*/
- pvf = 0;
- for (pv = TAILQ_FIRST(&ppv->pv_list); pv && pv != pvf; pv = pvn) {
- if (!pvf)
- pvf = pv;
- pvn = TAILQ_NEXT(pv, pv_list);
+ for (pv = TAILQ_FIRST(&ppv->pv_list);
+ pv;
+ pv = TAILQ_NEXT(pv, pv_list)) {
TAILQ_REMOVE(&ppv->pv_list, pv, pv_list);
/*
@@ -3493,7 +3492,7 @@ pmap_pid_dump(int pid) {
#if defined(DEBUG)
static void pads __P((pmap_t pm));
-void pmap_pvdump __P((vm_offset_t pa));
+static void pmap_pvdump __P((vm_offset_t pa));
/* print address space of pmap*/
static void
@@ -3520,7 +3519,7 @@ pads(pm)
}
-void
+static void
pmap_pvdump(pa)
vm_offset_t pa;
{
diff --git a/sys/i386/include/i4b_tel_ioctl.h b/sys/i386/i386/setdef0.c
index b7f0f73cd92a5..e57ce17f05156 100644
--- a/sys/i386/include/i4b_tel_ioctl.h
+++ b/sys/i386/i386/setdef0.c
@@ -1,5 +1,6 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
+/*-
+ * Copyright (c) 1997 John D. Polstra
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -22,31 +23,27 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- *---------------------------------------------------------------------------
- *
- * i4b_tel_ioctl.h telephony interface ioctls
- * ------------------------------------------
- *
- * $Id: i4b_tel_ioctl.h,v 1.5 1998/12/14 10:31:58 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:37:36 1998]
- *
- *---------------------------------------------------------------------------*/
+ * $Id: setdef0.c,v 1.1 1997/04/22 06:55:28 jdp Exp $
+ */
-#ifndef _I4B_TEL_IOCTL_H_
-#define _I4B_TEL_IOCTL_H_
+#ifdef __ELF__
-/* supported audio format conversions for /dev/i4btelXX devices */
+#include <sys/param.h>
+#include <sys/kernel.h>
-#define CVT_NONE 0 /* no format conversion */
-#define CVT_ALAW2ULAW 1 /* kernel A-law, userland mu-law */
-
-/*---------------------------------------------------------------------------*
- * get / set audio format
- *---------------------------------------------------------------------------*/
+/*
+ * DEFINE_SET creates the section and label for a set, and emits the
+ * count word at the front of it.
+ */
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".globl " #set); \
+ __asm__(".type " #set ",@object"); \
+ __asm__(".p2align 2"); \
+ __asm__(#set ":"); \
+ __asm__(".long " #count); \
+ __asm__(".previous")
-#define I4B_TEL_GETAUDIOFMT _IOR('A', 0, int)
-#define I4B_TEL_SETAUDIOFMT _IOW('A', 1, int)
-#define I4B_TEL_EMPTYINPUTQUEUE _IOW('A', 2, int)
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
-#endif /* _I4B_TEL_IOCTL_H_ */
+#endif /* __ELF__ */
diff --git a/sys/i386/isa/atkbdc_isa.c b/sys/i386/i386/setdef1.c
index c547a405600b6..c9dd23458cdc0 100644
--- a/sys/i386/isa/atkbdc_isa.c
+++ b/sys/i386/i386/setdef1.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1999 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
+ * Copyright (c) 1997 John D. Polstra
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,9 +10,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -26,58 +23,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: $
+ * $Id: setdef1.c,v 1.1 1997/04/22 06:55:28 jdp Exp $
*/
-#include "atkbdc.h"
-#include "opt_kbd.h"
+#ifdef __ELF__
-#if NATKBDC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-
-#include <dev/kbd/atkbdcreg.h>
-
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-
-static int atkbdc_probe(struct isa_device *dev);
-static int atkbdc_attach(struct isa_device *dev);
-
-struct isa_driver atkbdcdriver = {
- atkbdc_probe,
- atkbdc_attach,
- ATKBDC_DRIVER_NAME,
- 0,
-};
-
-static int
-atkbdc_probe(struct isa_device *dev)
-{
- atkbdc_softc_t *sc;
- int error;
-
- sc = atkbdc_get_softc(dev->id_unit);
- if (sc == NULL)
- return 0;
-
- error = atkbdc_probe_unit(sc, dev->id_unit, dev->id_iobase);
- if (error)
- return 0;
- if (dev->id_iobase <= 0)
- dev->id_iobase = sc->port;
- return IO_KBDSIZE;
-}
+/*
+ * DEFINE_SET emits the NULL terminator for a set.
+ */
+#define DEFINE_SET(set, count) \
+ __asm__(".section .set." #set ",\"aw\""); \
+ __asm__(".long 0"); \
+ __asm__(".previous")
-static int
-atkbdc_attach(struct isa_device *dev)
-{
- atkbdc_softc_t *sc;
-
- sc = atkbdc_get_softc(dev->id_unit);
- return ((sc == NULL) ? 0 : 1);
-}
+#include "setdefs.h" /* Contains a `DEFINE_SET' for each set */
-#endif /* NATKBDC > 0 */
+#endif /* __ELF__ */
diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s
index 5ed5780c6a835..d1e77c8a4413b 100644
--- a/sys/i386/i386/support.s
+++ b/sys/i386/i386/support.s
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: support.s,v 1.59 1998/05/11 02:13:43 dyson Exp $
+ * $Id: support.s,v 1.58 1997/12/14 02:11:09 dyson Exp $
*/
#include "npx.h"
@@ -398,6 +398,7 @@ ENTRY(fillw)
ret
ENTRY(bcopyb)
+bcopyb:
pushl %esi
pushl %edi
movl 12(%esp),%esi
diff --git a/sys/i386/i386/swapgeneric.c b/sys/i386/i386/swapgeneric.c
index 7cc6e4b029cf4..5575e6223f87d 100644
--- a/sys/i386/i386/swapgeneric.c
+++ b/sys/i386/i386/swapgeneric.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91
- * $Id: swapgeneric.c,v 1.24 1998/09/15 10:03:43 gibbs Exp $
+ * $Id: swapgeneric.c,v 1.23 1998/02/20 13:37:37 bde Exp $
*/
#include <sys/param.h>
@@ -138,8 +138,7 @@ bad:
unit = 0;
for (gc = genericconf; gc->gc_name; gc++) {
for (bd = 0; bd < nblkdev; bd++) {
- if (bdevsw[bd] != NULL &&
- strcmp(bdevsw[bd]->d_name, gc->gc_name) == 0) {
+ if (!strcmp(bdevsw[bd]->d_name, gc->gc_name)) {
printf("root on %s0\n", bdevsw[bd]->d_name);
goto found;
}
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c
index 63804abe0d469..0f569f25f1a42 100644
--- a/sys/i386/i386/sys_machdep.c
+++ b/sys/i386/i386/sys_machdep.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
- * $Id: sys_machdep.c,v 1.37 1998/08/24 02:28:15 bde Exp $
+ * $Id: sys_machdep.c,v 1.36 1998/08/18 07:46:58 msmith Exp $
*
*/
@@ -124,6 +124,7 @@ i386_extend_pcb(struct proc *p)
int i, offset;
u_long *addr;
struct pcb_ext *ext;
+ struct segment_descriptor sd;
struct soft_segment_descriptor ssd = {
0, /* segment base address (overwritten) */
ctob(IOPAGES + 1) - 1, /* length */
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index 42b0c85c23295..c4935d0160a76 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.132 1998/12/28 23:02:56 msmith Exp $
+ * $Id: trap.c,v 1.127 1998/04/28 18:15:04 eivind Exp $
*/
/*
@@ -93,10 +93,6 @@
#include <machine/vm86.h>
#endif
-#ifdef DDB
- extern int in_Debugger, debugger_on_panic;
-#endif
-
#include "isa.h"
#include "npx.h"
@@ -108,8 +104,8 @@ extern void trap __P((struct trapframe frame));
extern int trapwrite __P((unsigned addr));
extern void syscall __P((struct trapframe frame));
-static int trap_pfault __P((struct trapframe *, int, vm_offset_t));
-static void trap_fatal __P((struct trapframe *, vm_offset_t));
+static int trap_pfault __P((struct trapframe *, int));
+static void trap_fatal __P((struct trapframe *));
void dblfault_handler __P((void));
extern inthand_t IDTVEC(syscall);
@@ -220,46 +216,9 @@ trap(frame)
struct proc *p = curproc;
u_quad_t sticks = 0;
int i = 0, ucode = 0, type, code;
- vm_offset_t eva;
-
- if (!(frame.tf_eflags & PSL_I)) {
- /*
- * Buggy application or kernel code has disabled interrupts
- * and then trapped. Enabling interrupts now is wrong, but
- * it is better than running with interrupts disabled until
- * they are accidentally enabled later.
- */
- type = frame.tf_trapno;
- if (ISPL(frame.tf_cs) == SEL_UPL || (frame.tf_eflags & PSL_VM))
- printf(
- "pid %ld (%s): trap %d with interrupts disabled\n",
- (long)curproc->p_pid, curproc->p_comm, type);
- else if (type != T_BPTFLT && type != T_TRCTRAP)
- /*
- * XXX not quite right, since this may be for a
- * multiple fault in user mode.
- */
- printf("kernel trap %d with interrupts disabled\n",
- type);
- enable_intr();
- }
-
- eva = 0;
- if (frame.tf_trapno == T_PAGEFLT) {
- /*
- * For some Cyrix CPUs, %cr2 is clobbered by interrupts.
- * This problem is worked around by using an interrupt
- * gate for the pagefault handler. We are finally ready
- * to read %cr2 and then must reenable interrupts.
- *
- * XXX this should be in the switch statement, but the
- * NO_FOOF_HACK and VM86 goto and ifdefs obfuscate the
- * flow of control too much for this to be obviously
- * correct.
- */
- eva = rcr2();
- enable_intr();
- }
+#ifdef DEBUG
+ u_long eva;
+#endif
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
restart:
@@ -286,7 +245,7 @@ restart:
*/
case T_PROTFLT:
case T_SEGNPFLT:
- trap_fatal(&frame, eva);
+ trap_fatal(&frame);
return;
case T_TRCTRAP:
type = T_BPTFLT; /* kernel breakpoint */
@@ -355,7 +314,7 @@ restart:
break;
case T_PAGEFLT: /* page fault */
- i = trap_pfault(&frame, TRUE, eva);
+ i = trap_pfault(&frame, TRUE);
if (i == -1)
return;
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
@@ -434,7 +393,7 @@ kernel_trap:
switch (type) {
case T_PAGEFLT: /* page fault */
- (void) trap_pfault(&frame, FALSE, eva);
+ (void) trap_pfault(&frame, FALSE);
return;
case T_DNA:
@@ -582,7 +541,7 @@ kernel_trap:
#endif /* NISA > 0 */
}
- trap_fatal(&frame, eva);
+ trap_fatal(&frame);
return;
}
@@ -593,11 +552,12 @@ kernel_trap:
trapsignal(p, i, ucode);
#ifdef DEBUG
+ eva = rcr2();
if (type <= MAX_TRAP_MSG) {
uprintf("fatal process exception: %s",
trap_msg[type]);
if ((type == T_PAGEFLT) || (type == T_PROTFLT))
- uprintf(", fault VA = 0x%lx", (u_long)eva);
+ uprintf(", fault VA = 0x%lx", eva);
uprintf("\n");
}
#endif
@@ -615,16 +575,16 @@ out:
* debugging code.
*/
static int
-trap_pfault(frame, usermode, eva)
+trap_pfault(frame, usermode)
struct trapframe *frame;
int usermode;
- vm_offset_t eva;
{
vm_offset_t va;
struct vmspace *vm = NULL;
vm_map_t map = 0;
int rv = 0;
vm_prot_t ftype;
+ int eva;
struct proc *p = curproc;
if (frame->tf_err & PGEX_W)
@@ -632,7 +592,9 @@ trap_pfault(frame, usermode, eva)
else
ftype = VM_PROT_READ;
- va = trunc_page(eva);
+ eva = rcr2();
+ va = trunc_page((vm_offset_t)eva);
+
if (va < VM_MIN_KERNEL_ADDRESS) {
vm_offset_t v;
vm_page_t mpte;
@@ -641,7 +603,7 @@ trap_pfault(frame, usermode, eva)
(!usermode && va < VM_MAXUSER_ADDRESS &&
(intr_nesting_level != 0 || curpcb == NULL ||
curpcb->pcb_onfault == NULL))) {
- trap_fatal(frame, eva);
+ trap_fatal(frame);
return (-1);
}
@@ -665,8 +627,8 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
-#ifndef VM_STACK
- if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@@ -674,20 +636,6 @@ trap_pfault(frame, usermode, eva)
}
}
-#else
- /* grow_stack returns false only if va falls into
- * a growable stack region and the stack growth
- * fails. It returns true if va was not within
- * a growable stack region, or if the stack
- * growth succeeded.
- */
- if (!grow_stack (p, va)) {
- rv = KERN_FAILURE;
- --p->p_lock;
- goto nogo;
- }
-#endif
-
/* Fault in the user page: */
rv = vm_fault(map, va, ftype,
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
@@ -716,7 +664,7 @@ nogo:
frame->tf_eip = (int)curpcb->pcb_onfault;
return (0);
}
- trap_fatal(frame, eva);
+ trap_fatal(frame);
return (-1);
}
@@ -728,19 +676,21 @@ nogo:
#endif
int
-trap_pfault(frame, usermode, eva)
+trap_pfault(frame, usermode)
struct trapframe *frame;
int usermode;
- vm_offset_t eva;
{
vm_offset_t va;
struct vmspace *vm = NULL;
vm_map_t map = 0;
int rv = 0;
vm_prot_t ftype;
+ int eva;
struct proc *p = curproc;
- va = trunc_page(eva);
+ eva = rcr2();
+ va = trunc_page((vm_offset_t)eva);
+
if (va >= KERNBASE) {
/*
* Don't allow user-mode faults in kernel address space.
@@ -790,27 +740,14 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
-#ifndef VM_STACK
- if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
goto nogo;
}
}
-#else
- /* grow_stack returns false only if va falls into
- * a growable stack region and the stack growth
- * fails. It returns true if va was not within
- * a growable stack region, or if the stack
- * growth succeeded.
- */
- if (!grow_stack (p, va)) {
- rv = KERN_FAILURE;
- --p->p_lock;
- goto nogo;
- }
-#endif
/* Fault in the user page: */
rv = vm_fault(map, va, ftype,
@@ -832,7 +769,7 @@ nogo:
frame->tf_eip = (int)curpcb->pcb_onfault;
return (0);
}
- trap_fatal(frame, eva);
+ trap_fatal(frame);
return (-1);
}
@@ -843,15 +780,15 @@ nogo:
}
static void
-trap_fatal(frame, eva)
+trap_fatal(frame)
struct trapframe *frame;
- vm_offset_t eva;
{
- int code, type, ss, esp;
+ int code, type, eva, ss, esp;
struct soft_segment_descriptor softseg;
code = frame->tf_err;
type = frame->tf_trapno;
+ eva = rcr2();
sdtossd(&gdt[IDXSEL(frame->tf_cs & 0xffff)].sd, &softseg);
if (type <= MAX_TRAP_MSG)
@@ -934,7 +871,7 @@ trap_fatal(frame, eva)
return;
#endif
#ifdef DDB
- if ((debugger_on_panic || in_Debugger) && kdb_trap(type, 0, frame))
+ if (kdb_trap (type, 0, frame))
return;
#endif
printf("trap number = %d\n", type);
@@ -998,19 +935,13 @@ int trapwrite(addr)
++p->p_lock;
-#ifndef VM_STACK
- if ((caddr_t)va >= vm->vm_maxsaddr && va < USRSTACK) {
+ if ((caddr_t)va >= vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
if (!grow(p, va)) {
--p->p_lock;
return (1);
}
}
-#else
- if (!grow_stack (p, va)) {
- --p->p_lock;
- return (1);
- }
-#endif
/*
* fault the data page
diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c
index c505d71e0e79e..a6361ebaf7b18 100644
--- a/sys/i386/i386/userconfig.c
+++ b/sys/i386/i386/userconfig.c
@@ -46,7 +46,7 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
- ** $Id: userconfig.c,v 1.125 1999/01/14 23:43:22 bde Exp $
+ ** $Id: userconfig.c,v 1.111 1998/10/06 07:34:26 msmith Exp $
**/
/**
@@ -113,8 +113,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/reboot.h>
-#include <sys/linker.h>
-#include <sys/sysctl.h>
#include <machine/cons.h>
#include <machine/md_var.h>
@@ -133,156 +131,36 @@ static MALLOC_DEFINE(M_DEVL, "isa_devlist", "isa_device lists in userconfig()");
static struct isa_device *isa_devlist; /* list read by dset to extract changes */
+#ifdef USERCONFIG_BOOT
+char userconfig_from_boot[512] = "";
static int userconfig_boot_parsing; /* set if we are reading from the boot instructions */
-#define putchar(x) cnputc(x)
-
-static int
-sysctl_machdep_uc_devlist SYSCTL_HANDLER_ARGS
-{
- struct isa_device *id;
- int error=0;
- char name[8];
-
- if(!req->oldptr) {
- /* Only sizing */
- id=isa_devlist;
- while(id) {
- error+=sizeof(struct isa_device)+8;
- id=id->id_next;
- }
- return(SYSCTL_OUT(req,0,error));
- } else {
- /* Output the data. The buffer is filled with consecutive
- * struct isa_device and char buf[8], containing the name
- * (not guaranteed to end with '\0').
- */
- id=isa_devlist;
- while(id) {
- error=sysctl_handle_opaque(oidp,id,
- sizeof(struct isa_device),req);
- if(error) return(error);
- strncpy(name,id->id_driver->name,8);
- error=sysctl_handle_opaque(oidp,name,
- 8,req);
- if(error) return(error);
- id=id->id_next;
- }
- return(0);
- }
-}
-
-SYSCTL_PROC( _machdep, OID_AUTO, uc_devlist, CTLFLAG_RD,
- 0, 0, sysctl_machdep_uc_devlist, "A",
- "List of ISA devices changed in UserConfig");
-
-/*
-** Obtain command input.
-**
-** Initially, input is read from a possibly-loaded script.
-** At the end of the script, or if no script is supplied,
-** behaviour is determined by the RB_CONFIG (-c) flag. If
-** the flag is set, user input is read from the console; if
-** unset, the 'quit' command is invoked and userconfig
-** will exit.
-**
-** Note that quit commands encountered in the script will be
-** ignored if the RB_CONFIG flag is supplied.
-*/
static int
getchar(void)
{
- static const char *asp;
- static int assize; /* use of int for -ve magic value */
- static int autocheck = 0;
- caddr_t autoentry, autoattr;
- int c = 0;
- static int intro = 0;
-
- /* Look for loaded userconfig script */
- if (autocheck == 0)
- {
- autocheck = 1;
- autoentry = preload_search_by_type("userconfig_script");
- if (autoentry != NULL)
- {
- /* We have one, get size and data */
- assize = 0;
- if ((autoattr = preload_search_info(autoentry, MODINFO_SIZE)) != NULL)
- assize = (size_t)*(u_int32_t *)autoattr;
- asp = NULL;
- if ((autoattr = preload_search_info(autoentry, MODINFO_ADDR)) != NULL)
- asp = *(const char **)autoattr;
- /* sanity check */
- if ((assize == 0) || (asp == NULL)) {
- assize = 0;
- asp = NULL;
- }
- }
- }
+ static char *next = userconfig_from_boot;
- if (assize > 0)
- {
- /* Consume character from loaded userconfig script, display */
- userconfig_boot_parsing = 1;
- c = *asp;
- asp++;
- assize--;
-
- } else if (assize == 0) {
-
-#ifdef INTRO_USERCONFIG
- if (intro == 0)
- {
- /*
- * We don't want intro if we just executed a
- * script (userconfig_boot_parsing==1), otherwise
- * we would always block here waiting for user input.
- */
- intro = 1;
- if (userconfig_boot_parsing == 0)
- {
- /* userconfig_boot_parsing will be set to 1 on next pass,
- * which will allow using 'intro' in the middle of other
- * userconfig_script commands.
- */
- c = 'i';
- asp = "ntro\n";
- assize = strlen(asp);
- } else {
- userconfig_boot_parsing = 0;
- assize=-1;
- }
-#else
- userconfig_boot_parsing = 0;
- if (!(boothowto & RB_CONFIG))
- {
- /* don't want to drop to interpreter */
- c = 'q';
- asp = "uit\n";
- assize = strlen(asp);
-#endif
- userconfig_boot_parsing = 0;
+ if (next == userconfig_from_boot) {
+ if (strncmp(next, "USERCONFIG\n", 11)) {
+ next++;
+ strcpy(next, "intro\n");
} else {
- /* Only display signon banner if we are about to go interactive */
- if (!intro)
- printf("\nFreeBSD Kernel Configuration Utility - Version 1.2\n"
- " Type \"help\" for help"
-#ifdef VISUAL_USERCONFIG
- " or \"visual\" to go to the visual\n"
- " configuration interface (requires MGA/VGA display or\n"
- " serial terminal capable of displaying ANSI graphics)"
-#endif
- ".\n");
- assize = -1;
+ next += 11;
}
+ }
+ if (*next) {
+ userconfig_boot_parsing = 1;
+ return (*next++);
+ } else {
+ userconfig_boot_parsing = 0;
+ return cngetc();
}
- if (assize < 0) {
- /* No script, read from the keyboard */
- c = cngetc();
- }
- return(c);
}
+#else /* !USERCONFIG_BOOT */
+#define getchar() cngetc()
+#endif /* USERCONFIG_BOOT */
+
+#define putchar(x) cnputc(x)
#ifndef FALSE
#define FALSE (0)
@@ -392,16 +270,10 @@ static DEV_INFO device_info[] = {
{"vx", "3COM 3C590/3C595 Ethernet adapters", 0, CLS_NETWORK},
{"ze", "IBM/National Semiconductor PCMCIA Ethernet adapter",0, CLS_NETWORK},
{"zp", "3COM PCMCIA Etherlink III Ethernet adapter", 0, CLS_NETWORK},
-{"ax", "ASIC AX88140A ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"de", "DEC DC21040 Ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"fpa", "DEC DEFPA PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
-{"rl", "RealTek 8129/8139 ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"mx", "Macronix PMAC ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"pn", "Lite-On 82c168/82c169 PNIC adapter", FLG_FIXED, CLS_NETWORK},
-{"tl", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"vr", "VIA Rhine/Rhine II ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"wb", "Winbond W89C840F ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"xl", "3COM 3C90x PCI ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"tlc", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"xl", "3COM 3C90x PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
{"sio", "8250/16450/16550 Serial port", 0, CLS_COMMS},
{"cx", "Cronyx/Sigma multiport sync/async adapter",0, CLS_COMMS},
@@ -2066,17 +1938,15 @@ static void
helpscreen(void)
{
int topline = 0; /* where we are in the text */
- int c, delta = 1;
+ int line, c, delta = 1;
char prompt[80];
for (;;) /* loop until user quits */
{
- int line = 0;
-
/* display help text */
if (delta)
{
- clear(); /* remove everything else */
+ clear(); /* remove everything else */
for (line = topline;
(line < (topline + 24)) && (helptext[line]);
line++)
@@ -2516,7 +2386,7 @@ visuserconfig(void)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: userconfig.c,v 1.125 1999/01/14 23:43:22 bde Exp $
+ * $Id: userconfig.c,v 1.111 1998/10/06 07:34:26 msmith Exp $
*/
#include "scbus.h"
@@ -2569,7 +2439,7 @@ static int set_device_enable(CmdParm *);
static int set_device_disable(CmdParm *);
static int quitfunc(CmdParm *);
static int helpfunc(CmdParm *);
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
static int introfunc(CmdParm *);
#endif
@@ -2607,12 +2477,10 @@ static CmdParm dev_parms[] = {
{ -1, {} },
};
-#if NPNP > 0
static CmdParm string_arg[] = {
{ PARM_STRING, {} },
{ -1, {} },
};
-#endif
#if NEISA > 0
static CmdParm int_arg[] = {
@@ -2632,7 +2500,7 @@ static Cmd CmdList[] = {
{ "ex", quitfunc, NULL }, /* exit (quit) */
{ "f", set_device_flags, int_parms }, /* flags dev mask */
{ "h", helpfunc, NULL }, /* help */
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
{ "intro", introfunc, NULL }, /* intro screen */
#endif
{ "iom", set_device_mem, addr_parms }, /* iomem dev addr */
@@ -2661,6 +2529,16 @@ userconfig(void)
int rval;
Cmd *cmd;
+ printf("\nFreeBSD Kernel Configuration Utility - Version 1.1\n"
+ " Type \"help\" for help"
+#ifdef VISUAL_USERCONFIG
+ " or \"visual\" to go to the visual\n"
+ " configuration interface (requires MGA/VGA display or\n"
+ " serial terminal capable of displaying ANSI graphics)"
+#endif
+ ".\n");
+
+
while (1) {
printf("config> ");
cngets(input, 80);
@@ -2970,6 +2848,7 @@ set_num_eisa_slots(CmdParm *parms)
static int
quitfunc(CmdParm *parms)
{
+#ifdef USERCONFIG_BOOT
/*
* If kernel config supplied, and we are parsing it, and -c also supplied,
* ignore a quit command, This provides a safety mechanism to allow
@@ -2977,6 +2856,7 @@ quitfunc(CmdParm *parms)
*/
if ((boothowto & RB_CONFIG) && userconfig_boot_parsing)
return 0;
+#endif
return 1;
}
@@ -3019,7 +2899,7 @@ helpfunc(CmdParm *parms)
return 0;
}
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
#if defined (VISUAL_USERCONFIG)
static void
@@ -3153,10 +3033,7 @@ introfunc(CmdParm *parms)
return visuserconfig();
else {
putxy(0, 1, "Type \"help\" for help or \"quit\" to exit.");
- /* enable quitfunc */
- userconfig_boot_parsing=0;
move (0, 3);
- boothowto |= RB_CONFIG; /* force -c */
return 0;
}
break;
@@ -3185,14 +3062,12 @@ lspnp ()
"mem 0x%x 0x%x 0x%x 0x%x";
char buf[256];
if (lineno >= 23) {
- if (!userconfig_boot_parsing) {
- printf("<More> ");
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ printf("<More> ");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0 || first)
@@ -3238,13 +3113,11 @@ lsdevtab(struct isa_device *dt)
if (lineno >= 23) {
printf("<More> ");
- if (!userconfig_boot_parsing) {
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0) {
diff --git a/sys/i386/i386/vm86.c b/sys/i386/i386/vm86.c
index 3a536e2d9a6a7..eef835b188668 100644
--- a/sys/i386/i386/vm86.c
+++ b/sys/i386/i386/vm86.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vm86.c,v 1.18 1998/09/29 22:06:33 ache Exp $
+ * $Id: vm86.c,v 1.17 1998/09/29 20:36:31 ache Exp $
*/
#include "opt_vm86.h"
@@ -359,6 +359,7 @@ vm86_initialize(void)
struct vm86_layout *vml = (struct vm86_layout *)vm86paddr;
struct pcb *pcb;
struct pcb_ext *ext;
+ struct segment_descriptor sd;
struct soft_segment_descriptor ssd = {
0, /* segment base address (overwritten) */
0, /* length (overwritten) */
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index d0bdc9393b55e..de8b52cc466b7 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.114 1998/12/16 15:21:51 bde Exp $
+ * $Id: vm_machdep.c,v 1.111 1998/09/28 03:34:39 tegge Exp $
*/
#include "npx.h"
@@ -507,7 +507,6 @@ cpu_reset_real()
while(1);
}
-#ifndef VM_STACK
/*
* Grow the user stack to allow for 'sp'. This version grows the stack in
* chunks of SGROWSIZ.
@@ -521,10 +520,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
- if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
- return (1);
+ if ((caddr_t)sp <= vm->vm_maxsaddr || (unsigned)sp >= (unsigned)USRSTACK)
+ return (1);
- nss = roundup(USRSTACK - sp, PAGE_SIZE);
+ nss = roundup(USRSTACK - (unsigned)sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);
@@ -560,27 +559,10 @@ grow(p, sp)
return (1);
}
-#else
-int
-grow_stack(p, sp)
- struct proc *p;
- u_int sp;
-{
- int rv;
-
- rv = vm_map_growstack (p, sp);
- if (rv != KERN_SUCCESS)
- return (0);
-
- return (1);
-}
-#endif
-
static int cnt_prezero;
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
+SYSCTL_INT(_machdep, OID_AUTO, cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
/*
* Implement the pre-zeroed page mechanism.
diff --git a/sys/i386/ibcs2/ibcs2_errno.c b/sys/i386/ibcs2/ibcs2_errno.c
index b2e78c9053b55..657985926eadc 100644
--- a/sys/i386/ibcs2/ibcs2_errno.c
+++ b/sys/i386/ibcs2/ibcs2_errno.c
@@ -29,10 +29,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/errno.h>
#include <i386/ibcs2/ibcs2_errno.h>
-int bsd_to_ibcs2_errno[ELAST + 1] = {
+int bsd_to_ibcs2_errno[] = {
0, /* 0 */
IBCS2_EPERM, /* 1 */
IBCS2_ENOENT, /* 2 */
@@ -117,8 +116,5 @@ int bsd_to_ibcs2_errno[ELAST + 1] = {
0, /* 81 */
IBCS2_EIDRM, /* 82 */
IBCS2_ENOMSG, /* 83 */
- IBCS2_EOVERFLOW, /* 84 */
- 0, /* 85 */
- IBCS2_EILSEQ, /* 86 */
};
diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c
index c7f109a3cb9d0..e52bd2cdf7420 100644
--- a/sys/i386/ibcs2/ibcs2_socksys.c
+++ b/sys/i386/ibcs2/ibcs2_socksys.c
@@ -146,7 +146,7 @@ ibcs2_getipdomainname(p, uap)
int len;
/* Get the domain name */
- snprintf(hname, sizeof(hname), "%s", hostname);
+ strcpy(hname, hostname);
dptr = index(hname, '.');
if ( dptr )
dptr++;
@@ -177,7 +177,7 @@ ibcs2_setipdomainname(p, uap)
return EINVAL;
/* Get the host's unqualified name (strip off the domain) */
- snprintf(hname, sizeof(hname), "%s", hostname);
+ strcpy(hname, hostname);
ptr = index(hname, '.');
if ( ptr != NULL ) {
ptr++;
diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c
index d3bf6ae077d27..febf4d2552d88 100644
--- a/sys/i386/ibcs2/ibcs2_stat.c
+++ b/sys/i386/ibcs2/ibcs2_stat.c
@@ -221,19 +221,20 @@ ibcs2_utssys(p, uap)
struct ibcs2_utsname sut;
bzero(&sut, ibcs2_utsname_len);
- strncpy(sut.sysname,
- IBCS2_UNAME_SYSNAME, sizeof(sut.sysname) - 1);
- strncpy(sut.release,
- IBCS2_UNAME_RELEASE, sizeof(sut.release) - 1);
- strncpy(sut.version,
- IBCS2_UNAME_VERSION, sizeof(sut.version) - 1);
- strncpy(machine_name, hostname, sizeof(machine_name) - 1);
- machine_name[sizeof(machine_name) - 1] = 0;
+ strncpy(sut.sysname, IBCS2_UNAME_SYSNAME, sizeof(sut.sysname));
+ strncpy(sut.release, IBCS2_UNAME_RELEASE, sizeof(sut.release));
+ strncpy(sut.version, IBCS2_UNAME_VERSION, sizeof(sut.version));
+ strncpy(machine_name, hostname, sizeof(machine_name));
p = index(machine_name, '.');
if ( p )
*p = '\0';
- strncpy(sut.nodename, machine_name, sizeof(sut.nodename) - 1);
- strncpy(sut.machine, machine, sizeof(sut.machine) - 1);
+ strncpy(sut.nodename, machine_name, sizeof(sut.nodename));
+ strncpy(sut.machine, machine, sizeof(sut.machine));
+ sut.sysname[sizeof(sut.sysname)-1] = '\0';
+ sut.release[sizeof(sut.release)-1] = '\0';
+ sut.version[sizeof(sut.version)-1] = '\0';
+ sut.nodename[sizeof(sut.nodename)-1] = '\0';
+ sut.machine[sizeof(sut.machine)-1] = '\0';
DPRINTF(("IBCS2 uname: sys=%s rel=%s ver=%s node=%s mach=%s\n",
sut.sysname, sut.release, sut.version, sut.nodename,
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c
index bc0fa61e3bdeb..2a10b0e1eaae2 100644
--- a/sys/i386/ibcs2/ibcs2_sysvec.c
+++ b/sys/i386/ibcs2/ibcs2_sysvec.c
@@ -27,12 +27,10 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ibcs2_sysvec.c,v 1.12 1998/12/14 18:53:47 dt Exp $
+ * $Id: ibcs2_sysvec.c,v 1.7 1998/04/28 18:15:05 eivind Exp $
*/
#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
#include <sys/sysent.h>
#include <sys/signalvar.h>
#include <i386/ibcs2/ibcs2_syscall.h>
@@ -49,7 +47,7 @@ struct sysentvec ibcs2_svr3_sysvec = {
0xFF,
NSIG,
bsd_to_ibcs2_sig,
- ELAST + 1,
+ ELAST,
bsd_to_ibcs2_errno,
0, /* trap-to-signal translation function */
0, /* fixup */
@@ -60,20 +58,3 @@ struct sysentvec ibcs2_svr3_sysvec = {
"IBCS2 COFF",
NULL /* we don't have a COFF coredump function */
};
-
-/*
- * Create an "ibcs2" module that does nothing but allow checking for
- * the presence of the subsystem.
- */
-static int
-ibcs2_modevent(module_t mod, int type, void *unused)
-{
- /* Do not care */
- return 0;
-}
-moduledata_t ibcs2_mod = {
- "ibcs2",
- ibcs2_modevent,
- 0
-};
-DECLARE_MODULE(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
diff --git a/sys/i386/ibcs2/ibcs2_util.h b/sys/i386/ibcs2/ibcs2_util.h
index 4ef390f64ffbe..e616234cb245c 100644
--- a/sys/i386/ibcs2/ibcs2_util.h
+++ b/sys/i386/ibcs2/ibcs2_util.h
@@ -61,7 +61,7 @@ static __inline caddr_t
stackgap_init()
{
#define szsigcode (*(curproc->p_sysent->sv_szsigcode))
- return (caddr_t)(PS_STRINGS - szsigcode - SPARE_USRSPACE);
+ return (caddr_t)(((caddr_t)PS_STRINGS) - szsigcode - SPARE_USRSPACE);
}
static __inline void *
diff --git a/sys/i386/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c
index 8ab55563384e5..0677edec6a2f3 100644
--- a/sys/i386/ibcs2/ibcs2_xenix.c
+++ b/sys/i386/ibcs2/ibcs2_xenix.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ibcs2_xenix.c,v 1.16 1998/08/16 01:21:49 bde Exp $
+ * $Id: ibcs2_xenix.c,v 1.15 1998/06/02 05:39:07 dyson Exp $
*/
#include <sys/param.h>
@@ -157,22 +157,14 @@ xenix_utsname(struct proc *p, struct xenix_utsname_args *uap)
DPRINTF(("IBCS2: 'xenix sco_utsname'\n"));
bzero(&ibcs2_sco_uname, sizeof(struct ibcs2_sco_utsname));
- strncpy(ibcs2_sco_uname.sysname, ostype,
- sizeof(ibcs2_sco_uname.sysname) - 1);
- strncpy(ibcs2_sco_uname.nodename, hostname,
- sizeof(ibcs2_sco_uname.nodename) - 1);
- strncpy(ibcs2_sco_uname.release, osrelease,
- sizeof(ibcs2_sco_uname.release) - 1);
- strncpy(ibcs2_sco_uname.kernelid, version,
- sizeof(ibcs2_sco_uname.kernelid) - 1);
- strncpy(ibcs2_sco_uname.machine, machine,
- sizeof(ibcs2_sco_uname.machine) - 1);
- strncpy(ibcs2_sco_uname.bustype, "ISA/EISA",
- sizeof(ibcs2_sco_uname.bustype) - 1);
- strncpy(ibcs2_sco_uname.sysserial, "no charge",
- sizeof(ibcs2_sco_uname.sysserial) - 1);
- strncpy(ibcs2_sco_uname.numusers, "unlim",
- sizeof(ibcs2_sco_uname.numusers) - 1);
+ strncpy(ibcs2_sco_uname.sysname, ostype, 8);
+ strncpy(ibcs2_sco_uname.nodename, hostname, 8);
+ strncpy(ibcs2_sco_uname.release, osrelease, 15);
+ strncpy(ibcs2_sco_uname.kernelid, version, 19);
+ strncpy(ibcs2_sco_uname.machine, machine, 8);
+ bcopy("ISA/EISA", ibcs2_sco_uname.bustype, 8);
+ bcopy("no charge", ibcs2_sco_uname.sysserial, 9);
+ bcopy("unlim", ibcs2_sco_uname.numusers, 8);
ibcs2_sco_uname.sysorigin = 0xFFFF;
ibcs2_sco_uname.sysoem = 0xFFFF;
ibcs2_sco_uname.numcpu = 1;
diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c
index 3632b7415e3d1..7793f4cc42a56 100644
--- a/sys/i386/ibcs2/imgact_coff.c
+++ b/sys/i386/ibcs2/imgact_coff.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_coff.c,v 1.33 1998/10/16 03:55:00 peter Exp $
+ * $Id: imgact_coff.c,v 1.32 1998/10/13 08:24:36 dg Exp $
*/
#include <sys/param.h>
@@ -475,7 +475,7 @@ exec_coff_imgact(imgp)
/*
* Tell kern_execve.c about it, with a little help from the linker.
* Since `const' objects end up in the text segment, TEXT_SET is the
- * correct directive to use.
+ * correct directive to use. Do not staticize; used by coff LKM.
*/
-static const struct execsw coff_execsw = { exec_coff_imgact, "coff" };
+const struct execsw coff_execsw = { exec_coff_imgact, "coff" };
EXEC_SET(coff, coff_execsw);
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index 9d7494e0fc120..52dad0bf856d6 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ansi.h 8.2 (Berkeley) 1/4/94
- * $Id: ansi.h,v 1.15 1998/06/14 14:00:47 bde Exp $
+ * $Id: ansi.h,v 1.14 1998/01/08 00:27:30 alex Exp $
*/
#ifndef _MACHINE_ANSI_H_
@@ -54,6 +54,9 @@
#define _BSD_SSIZE_T_ int /* byte count or error */
#define _BSD_TIME_T_ long /* time()... */
#define _BSD_TIMER_T_ int /* timer_gettime()... */
+#define _BSD_UINT8_T_ unsigned char /* unsigned exactly 8 bits */
+#define _BSD_UINT16_T_ unsigned short /* unsigned exactly 16 bits */
+#define _BSD_UINT32_T_ unsigned int /* unsigned exactly 32 bits */
#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
/*
@@ -106,18 +109,5 @@ typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
#endif
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-
-typedef int __intptr_t;
-typedef unsigned int __uintptr_t;
#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/i386/include/apm_bios.h b/sys/i386/include/apm_bios.h
index 43028b370113e..616e36a2e894d 100644
--- a/sys/i386/include/apm_bios.h
+++ b/sys/i386/include/apm_bios.h
@@ -12,7 +12,7 @@
*
* Aug, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm_bios.h,v 1.20 1998/07/06 06:29:05 imp Exp $
+ * $Id: apm_bios.h,v 1.19 1997/11/12 04:12:51 jdp Exp $
*/
#ifndef _MACHINE_APM_BIOS_H_
@@ -160,6 +160,7 @@ struct apmhook *apm_hook_establish (int apmh, struct apmhook *);
void apm_hook_disestablish (int apmh, struct apmhook *);
void apm_cpu_idle(void);
void apm_cpu_busy(void);
+void apm_power_off(void);
#endif /* KERNEL */
diff --git a/sys/i386/include/console.h b/sys/i386/include/console.h
index c79759c356bd8..7f70bcaa052bb 100644
--- a/sys/i386/include/console.h
+++ b/sys/i386/include/console.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: console.h,v 1.42 1999/01/01 14:38:28 des Exp $
+ * $Id: console.h,v 1.40 1998/09/23 09:58:45 yokota Exp $
*/
#ifndef _MACHINE_CONSOLE_H_
@@ -52,7 +52,6 @@
#define KDSETLED _IO('K', 66 /*, int */)
#define KDSETRAD _IO('K', 67 /*, int */)
#define KDRASTER _IOW('K', 100, scr_size_t)
-#define KDGKBINFO _IOR('K', 101, keyboard_info_t)
#define GETFKEY _IOWR('k', 0, fkeyarg_t)
#define SETFKEY _IOWR('k', 1, fkeyarg_t)
@@ -62,8 +61,6 @@
#define PIO_KEYMAP _IOW('k', 7, keymap_t)
#define GIO_DEADKEYMAP _IOR('k', 8, accentmap_t)
#define PIO_DEADKEYMAP _IOW('k', 9, accentmap_t)
-#define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t)
-#define PIO_KEYMAPENT _IOW('k', 11, keyarg_t)
#define GIO_ATTR _IOR('a', 0, int)
#define GIO_COLOR _IOR('c', 0, int)
@@ -89,14 +86,11 @@
#define CONS_GETINFO _IOWR('c', 73, vid_info_t)
#define CONS_GETVERS _IOR('c', 74, int)
#define CONS_CURRENTADP _IOR('c', 100, int)
-#define CONS_ADPINFO _IOWR('c', 101, video_adapter_info_t)
+#define CONS_ADPINFO _IOWR('c', 101, video_adapter_t)
#define CONS_MODEINFO _IOWR('c', 102, video_info_t)
#define CONS_FINDMODE _IOWR('c', 103, video_info_t)
#define CONS_SETWINORG _IO('c', 104 /* u_int */)
-#define CONS_SETKBD _IO('c', 110 /* int */)
-#define CONS_RELKBD _IO('c', 111)
-
/* CONS_SAVERMODE */
#define CONS_LKM_SAVER 0
#define CONS_USR_SAVER 1
@@ -195,11 +189,9 @@ struct mouse_info {
#define NLKED 2 /* Num locked */
#define SLKED 4 /* Scroll locked */
#define ALKED 8 /* AltGr locked */
-#define LOCK_MASK (CLKED | NLKED | SLKED | ALKED)
#define LED_CAP 1 /* Caps lock LED */
#define LED_NUM 2 /* Num lock LED */
#define LED_SCR 4 /* Scroll lock LED */
-#define LED_MASK (LED_CAP | LED_NUM | LED_SCR)
/* possible flag values */
#define FLAG_LOCK_O 0
@@ -212,7 +204,7 @@ struct mouse_info {
#ifndef _KEYMAP_DECLARED
#define _KEYMAP_DECLARED
-struct keyent_t {
+struct key_t {
u_char map[NUM_STATES];
u_char spcl;
u_char flgs;
@@ -220,17 +212,10 @@ struct keyent_t {
struct keymap {
u_short n_keys;
- struct keyent_t key[NUM_KEYS];
+ struct key_t key[NUM_KEYS];
};
typedef struct keymap keymap_t;
-
-struct keyarg {
- u_short keynum;
- struct keyent_t key;
-};
-
-typedef struct keyarg keyarg_t;
#endif /* !_KEYMAP_DECLARED */
#define NUM_DEADKEYS 15 /* number of accent keys */
@@ -289,9 +274,6 @@ struct ssaver {
struct video_adapter {
int va_index;
int va_type;
- char *va_name;
- int va_unit;
- int va_minor;
int va_flags;
#define V_ADP_COLOR (1<<0)
#define V_ADP_MODECHANGE (1<<1)
@@ -301,14 +283,7 @@ struct video_adapter {
#define V_ADP_PALETTE (1<<5)
#define V_ADP_BORDER (1<<6)
#define V_ADP_VESA (1<<7)
-#define V_ADP_PROBED (1<<16)
-#define V_ADP_INITIALIZED (1<<17)
-#define V_ADP_REGISTERED (1<<18)
- int va_io_base;
- int va_io_size;
int va_crtc_addr;
- int va_mem_base;
- int va_mem_size;
u_int va_window; /* virtual address */
size_t va_window_size;
size_t va_window_gran;
@@ -317,30 +292,6 @@ struct video_adapter {
int va_initial_mode;
int va_initial_bios_mode;
int va_mode;
- int va_mode_flags; /* copy of vi_flags */
- void *va_token;
-};
-
-struct video_adapter_info {
- int va_index;
- int va_type;
- char va_name[16];
- int va_unit;
- int va_flags;
- int va_io_base;
- int va_io_size;
- int va_crtc_addr;
- int va_mem_base;
- int va_mem_size;
- u_int va_window; /* virtual address */
- size_t va_window_size;
- size_t va_window_gran;
- u_int va_buffer; /* virtual address */
- size_t va_buffer_size;
- int va_initial_mode;
- int va_initial_bios_mode;
- int va_mode;
- int va_mode_flags;
};
#define V_ADP_PRIMARY 0
@@ -352,7 +303,7 @@ struct video_info {
int vi_flags;
#define V_INFO_COLOR (1<<0)
#define V_INFO_GRAPHICS (1<<1)
-#define V_INFO_LINEAR (1<<2)
+#define V_INFO_LENEAR (1<<2)
#define V_INFO_VESA (1<<3)
int vi_width;
int vi_height;
@@ -368,15 +319,6 @@ struct video_info {
/* XXX pixel format, memory model,... */
};
-struct keyboard_info {
- int kb_index; /* kbdio index# */
- char kb_name[16]; /* driver name */
- int kb_unit; /* unit# */
- int kb_type; /* KB_84, KB_101, KB_OTHER,... */
- int kb_config; /* device configuration flags */
- int kb_flags; /* internal flags */
-};
-
typedef struct accentmap accentmap_t;
typedef struct fkeytab fkeytab_t;
typedef struct fkeyarg fkeyarg_t;
@@ -388,9 +330,7 @@ typedef struct {char fnt8x14[14*256];} fnt14_t;
typedef struct {char fnt8x16[16*256];} fnt16_t;
typedef struct ssaver ssaver_t;
typedef struct video_adapter video_adapter_t;
-typedef struct video_adapter_info video_adapter_info_t;
typedef struct video_info video_info_t;
-typedef struct keyboard_info keyboard_info_t;
typedef struct {int scr_size[3];} scr_size_t;
/* defines for "special" keys (spcl bit set in keymap) */
@@ -448,13 +388,6 @@ typedef struct {int scr_size[3];} scr_size_t;
#define MKEY 0x400 /* meta key marker (prepend ESC)*/
#define BKEY 0x800 /* backtab (ESC [ Z) */
-#define SPCLKEY 0x8000 /* special key */
-#define RELKEY 0x4000 /* key released */
-#define ERRKEY 0x2000 /* error */
-
-#define KEYCHAR(c) ((c) & 0x00ff)
-#define KEYFLAGS(c) ((c) & ~0x00ff)
-
/* video mode definitions */
#define M_B40x25 0 /* black & white 40 columns */
#define M_C40x25 1 /* color 40 columns */
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index ce6bf05890017..977003cb5c238 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.84 1999/01/08 19:51:02 bde Exp $
+ * $Id: cpufunc.h,v 1.80 1998/07/11 04:58:25 bde Exp $
*/
/*
@@ -40,6 +40,15 @@
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <machine/lock.h>
+
+#if defined(SWTCH_OPTIM_STATS)
+extern int tlb_flush_count;
+#endif
+
#define readb(va) (*(volatile u_int8_t *) (va))
#define readw(va) (*(volatile u_int16_t *) (va))
#define readl(va) (*(volatile u_int32_t *) (va))
@@ -50,14 +59,6 @@
#ifdef __GNUC__
-#ifdef SMP
-#include <machine/lock.h> /* XXX */
-#endif
-
-#ifdef SWTCH_OPTIM_STATS
-extern int tlb_flush_count; /* XXX */
-#endif
-
static __inline void
breakpoint(void)
{
@@ -68,17 +69,13 @@ static __inline void
disable_intr(void)
{
__asm __volatile("cli" : : : "memory");
-#ifdef SMP
MPINTR_LOCK();
-#endif
}
static __inline void
enable_intr(void)
{
-#ifdef SMP
MPINTR_UNLOCK();
-#endif
__asm __volatile("sti");
}
@@ -194,27 +191,24 @@ static __inline void
insb(u_int port, void *addr, size_t cnt)
{
__asm __volatile("cld; rep; insb"
- : "=D" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port)
- : "memory");
+ : : "d" (port), "D" (addr), "c" (cnt)
+ : "di", "cx", "memory");
}
static __inline void
insw(u_int port, void *addr, size_t cnt)
{
__asm __volatile("cld; rep; insw"
- : "=D" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port)
- : "memory");
+ : : "d" (port), "D" (addr), "c" (cnt)
+ : "di", "cx", "memory");
}
static __inline void
insl(u_int port, void *addr, size_t cnt)
{
__asm __volatile("cld; rep; insl"
- : "=D" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port)
- : "memory");
+ : : "d" (port), "D" (addr), "c" (cnt)
+ : "di", "cx", "memory");
}
static __inline void
@@ -223,11 +217,11 @@ invd(void)
__asm __volatile("invd");
}
-#if defined(SMP) && defined(KERNEL)
+#ifdef KERNEL
+#ifdef SMP
/*
- * When using APIC IPI's, invlpg() is not simply the invlpg instruction
- * (this is a bug) and the inlining cost is prohibitive since the call
+ * When using APIC IPI's, the inlining cost is prohibitive since the call
* executes into the IPI transmission system.
*/
void invlpg __P((u_int addr));
@@ -236,7 +230,7 @@ void invltlb __P((void));
static __inline void
cpu_invlpg(void *addr)
{
- __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
+ __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
}
static __inline void
@@ -253,15 +247,15 @@ cpu_invltlb(void)
++tlb_flush_count;
#endif
}
-
-#else /* !(SMP && KERNEL) */
+#else /* !SMP */
static __inline void
invlpg(u_int addr)
{
- __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
+ __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
}
+
static __inline void
invltlb(void)
{
@@ -272,12 +266,13 @@ invltlb(void)
*/
__asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp)
: : "memory");
-#ifdef SWTCH_OPTIM_STATS
+#if defined(SWTCH_OPTIM_STATS)
++tlb_flush_count;
#endif
}
-#endif /* SMP && KERNEL */
+#endif /* SMP */
+#endif /* KERNEL */
static __inline u_short
inw(u_int port)
@@ -327,24 +322,24 @@ static __inline void
outsb(u_int port, const void *addr, size_t cnt)
{
__asm __volatile("cld; rep; outsb"
- : "=S" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port));
+ : : "d" (port), "S" (addr), "c" (cnt)
+ : "si", "cx");
}
static __inline void
outsw(u_int port, const void *addr, size_t cnt)
{
__asm __volatile("cld; rep; outsw"
- : "=S" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port));
+ : : "d" (port), "S" (addr), "c" (cnt)
+ : "si", "cx");
}
static __inline void
outsl(u_int port, const void *addr, size_t cnt)
{
__asm __volatile("cld; rep; outsl"
- : "=S" (addr), "=c" (cnt)
- : "0" (addr), "1" (cnt), "d" (port));
+ : : "d" (port), "S" (addr), "c" (cnt)
+ : "si", "cx");
}
static __inline void
@@ -399,7 +394,7 @@ rdtsc(void)
}
static __inline void
-setbits(volatile u_int *addr, u_int bits)
+setbits(volatile unsigned *addr, u_int bits)
{
__asm __volatile(
#ifdef SMP
@@ -452,7 +447,7 @@ u_int64_t rdmsr __P((u_int msr));
u_int64_t rdpmc __P((u_int pmc));
u_int64_t rdtsc __P((void));
u_int read_eflags __P((void));
-void setbits __P((volatile u_int *addr, u_int bits));
+void setbits __P((volatile unsigned *addr, u_int bits));
void wbinvd __P((void));
void write_eflags __P((u_int ef));
void wrmsr __P((u_int msr, u_int64_t newval));
@@ -466,5 +461,6 @@ void ltr __P((u_short sel));
u_int rcr0 __P((void));
u_int rcr3 __P((void));
u_int rcr4 __P((void));
+void i686_pagezero __P((void *addr));
#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/sys/i386/include/elf.h b/sys/i386/include/elf.h
index 93f486bf2d021..5605b6fb3f84b 100644
--- a/sys/i386/include/elf.h
+++ b/sys/i386/include/elf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elf.h,v 1.4 1998/09/14 20:30:12 jdp Exp $
+ * $Id: elf.h,v 1.3 1998/08/16 03:03:31 jdp Exp $
*/
#ifndef _MACHINE_ELF_H_
@@ -40,8 +40,6 @@
#define ELF_ARCH EM_386
-#define ELF_MACHINE_OK(x) ((x) == EM_386 || (x) == EM_486)
-
/*
* Auxiliary vector entries for passing information to the interpreter.
*
diff --git a/sys/i386/include/i4b_cause.h b/sys/i386/include/i4b_cause.h
deleted file mode 100644
index 439db4e2bcc4b..0000000000000
--- a/sys/i386/include/i4b_cause.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_cause.h - causes and cause handling for i4b
- * -----------------------------------------------
- *
- * $Id: i4b_cause.h,v 1.8 1998/12/05 18:05:55 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:36:30 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_CAUSE_H_
-#define _I4B_CAUSE_H_
-
-/*---------------------------------------------------------------------------*
- * ISDN4BSD internal causes specification
- *---------------------------------------------------------------------------*/
-
-#define CAUSE_VAL 0x000000ff /* cause value */
-#define CAUSE_TYPE 0x0000ff00 /* cause type */
-#define CAUSET_Q850 0 /* value coded according to Q.850 */
-#define CAUSET_I4B 1 /* i4b protocol independent causes*/
-
-#define GET_CAUSE_VAL(cause) ((cause) & 0xff)
-#define SET_CAUSE_VAL(dest, val) ((dest) = ((dest & 0xffffff00) | \
- (val & 0x000000ff)))
-
-#define GET_CAUSE_TYPE(cause) (((cause) >> 8) & 0xff)
-#define SET_CAUSE_TYPE(dest, type) ((dest) = ((dest & 0xffff00ff) | \
- ((type << 8) & 0x0000ff00)))
-
-#define SET_CAUSE_TV(dest, type, val) ((dest) = ((val & 0x000000ff) | \
- ((type << 8) & 0x0000ff00)))
-
-/* CAUSET_I4B - protocol independent cause values */
-
-#define CAUSE_I4B_NORMAL 0 /* normal call clearing */
-#define CAUSE_I4B_BUSY 1 /* user busy */
-#define CAUSE_I4B_NOCHAN 2 /* circuit/channel not available*/
-#define CAUSE_I4B_INCOMP 3 /* incompatible source/dest */
-#define CAUSE_I4B_REJECT 4 /* call rejected */
-#define CAUSE_I4B_OOO 5 /* destination out of order */
-#define CAUSE_I4B_TMPFAIL 6 /* temporary failure */
-#define CAUSE_I4B_L1ERROR 7 /* L1 error / persistent deact */
-#define CAUSE_I4B_MAX 8
-
-/* CAUSET_Q850 - causes defined in Q.850 */
-
-#define CAUSE_Q850_SHUTDN 0x00 /* normal D-channel shutdown */
-#define CAUSE_Q850_NUNALLC 0x01 /* Unallocated (unassigned) number */
-#define CAUSE_Q850_NRTTN 0x02 /* No route to specified transit network */
-#define CAUSE_Q850_NRTDST 0x03 /* No route to destination */
-#define CAUSE_Q850_SSINFTN 0x04 /* Send special information tone */
-#define CAUSE_Q850_MDIALTP 0x05 /* Misdialled trunk prefix */
-#define CAUSE_Q850_CHUNACC 0x06 /* Channel unacceptable */
-#define CAUSE_Q850_CALLAWD 0x07 /* Call awarded and being delivered in an established channel */
-#define CAUSE_Q850_PREEMPT 0x08 /* Preemption */
-#define CAUSE_Q850_PREECRR 0x09 /* Preemption - circuit reserved for reuse */
-#define CAUSE_Q850_NCCLR 0x10 /* Normal call clearing */
-#define CAUSE_Q850_USRBSY 0x11 /* User busy */
-#define CAUSE_Q850_NOUSRRSP 0x12 /* No user responding */
-#define CAUSE_Q850_NOANSWR 0x13 /* No answer from user (user alerted) */
-#define CAUSE_Q850_SUBSABS 0x14 /* Subscriber absent */
-#define CAUSE_Q850_CALLREJ 0x15 /* Call rejected */
-#define CAUSE_Q850_NUCHNG 0x16 /* Number changed */
-#define CAUSE_Q850_NONSELUC 0x1A /* Non-selected user clearing */
-#define CAUSE_Q850_DSTOOORDR 0x1B /* Destination out of order */
-#define CAUSE_Q850_INVNUFMT 0x1C /* Invalid number format */
-#define CAUSE_Q850_FACREJ 0x1D /* Facility rejected */
-#define CAUSE_Q850_STENQRSP 0x1E /* Response to STATUS ENQUIRY */
-#define CAUSE_Q850_NORMUNSP 0x1F /* Normal, unspecified */
-#define CAUSE_Q850_NOCAVAIL 0x22 /* No circuit / channel available */
-#define CAUSE_Q850_NETOOORDR 0x26 /* Network out of order */
-#define CAUSE_Q850_PFMCDOOSERV 0x27 /* Permanent frame mode connection out of service */
-#define CAUSE_Q850_PFMCOPER 0x28 /* Permanent frame mode connection operational */
-#define CAUSE_Q850_TMPFAIL 0x29 /* Temporary failure */
-#define CAUSE_Q850_SWEQCONG 0x2A /* Switching equipment congestion */
-#define CAUSE_Q850_ACCINFDIS 0x2B /* Access information discarded */
-#define CAUSE_Q850_REQCNOTAV 0x2C /* Requested circuit/channel not available */
-#define CAUSE_Q850_PRECALBLK 0x2E /* Precedence call blocked */
-#define CAUSE_Q850_RESUNAVAIL 0x2F /* Resources unavailable, unspecified */
-#define CAUSE_Q850_QOSUNAVAIL 0x31 /* Quality of service unavailable */
-#define CAUSE_Q850_REQSERVNS 0x32 /* Requested facility not subscribed */
-#define CAUSE_Q850_OCBARRCUG 0x35 /* Outgoing calls barred within CUG */
-#define CAUSE_Q850_ICBARRCUG 0x36 /* Incoming calls barred within CUG */
-#define CAUSE_Q850_BCAPNAUTH 0x39 /* Bearer capability not authorized */
-#define CAUSE_Q850_BCAPNAVAIL 0x3A /* Bearer capability not presently available */
-#define CAUSE_Q850_INCSTOACISC 0x3E /* Inconsistenciy in designated outgoing access information and subscriber class */
-#define CAUSE_Q850_SOONOTAVAIL 0x3F /* Service or option not available, unspecified */
-#define CAUSE_Q850_BCAPNOTIMPL 0x41 /* Bearer capability not implemented */
-#define CAUSE_Q850_CHTYPNIMPL 0x42 /* Channel type not implemented */
-#define CAUSE_Q850_REQFACNIMPL 0x45 /* Requested facility not implemented */
-#define CAUSE_Q850_ORDINBCAVL 0x46 /* Only restricted digital information bearer capability is available */
-#define CAUSE_Q850_SOONOTIMPL 0x4F /* Service or option not implemented, unspecified */
-#define CAUSE_Q850_INVCLRFVAL 0x51 /* Invalid call reference value */
-#define CAUSE_Q850_IDCHDNOEX 0x52 /* Identified channel does not exist */
-#define CAUSE_Q850_SUSCAEXIN 0x53 /* A suspended call exists, but this call identity does not */
-#define CAUSE_Q850_CLIDINUSE 0x54 /* Call identity in use */
-#define CAUSE_Q850_NOCLSUSP 0x55 /* No call suspended */
-#define CAUSE_Q850_CLIDCLRD 0x56 /* Call having the requested call identity has been cleared */
-#define CAUSE_Q850_UNOTMEMCUG 0x57 /* User not member of CUG */
-#define CAUSE_Q850_INCDEST 0x58 /* Incompatible destination */
-#define CAUSE_Q850_NONEXCUG 0x5A /* Non-existent CUG */
-#define CAUSE_Q850_INVNTWSEL 0x5B /* Invalid transit network selection */
-#define CAUSE_Q850_INVMSG 0x5F /* Invalid message, unspecified */
-#define CAUSE_Q850_MIEMISS 0x60 /* Mandatory information element is missing */
-#define CAUSE_Q850_MSGTNI 0x61 /* Message type non-existent or not implemented */
-#define CAUSE_Q850_MSGNCMPT 0x62 /* Message not compatible with call state or message type non-existent or not implemented */
-#define CAUSE_Q850_IENENI 0x63 /* Information element/parameter non-existent or not implemented */
-#define CAUSE_Q850_INVIEC 0x64 /* Invalid information element contents */
-#define CAUSE_Q850_MSGNCWCS 0x65 /* Message not compatible with call state */
-#define CAUSE_Q850_RECOTIMEXP 0x66 /* Recovery on timer expiry */
-#define CAUSE_Q850_PARMNENIPO 0x67 /* Parameter non-existent or not implemented, passed on */
-#define CAUSE_Q850_MSGUNRDPRM 0x6E /* Message with unrecognized parameter, discarded */
-#define CAUSE_Q850_PROTERR 0x6F /* Protocol error, unspecified */
-#define CAUSE_Q850_INTWRKU 0x7F /* Interworking, unspecified */
-
-#define CAUSE_Q850_MAX 128
-
-#endif /* _I4B_CAUSE_H_ */
diff --git a/sys/i386/include/i4b_debug.h b/sys/i386/include/i4b_debug.h
deleted file mode 100644
index 33e6315ba285a..0000000000000
--- a/sys/i386/include/i4b_debug.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_debug.h - i4b debug header file
- * -----------------------------------
- *
- * $Id: i4b_debug.h,v 1.14 1998/12/05 18:05:57 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:36:47 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#define DO_I4B_DEBUG /* enable debugging code inclusion */
-
-#undef DO_I4B_MAXDEBUG /* enable ALL debug messages by default */
-
-#ifdef DO_I4B_DEBUG
-
-extern unsigned int i4b_l1_debug;
-extern unsigned int i4b_l2_debug;
-extern unsigned int i4b_l3_debug;
-extern unsigned int i4b_l4_debug;
-
-#define DBGL1(bits, routine, what) \
- if(bits & i4b_l1_debug) \
- { \
- printf("i4b-L1-%s: ", routine); \
- printf what ; \
- }
-
-#define DBGL2(bits, routine, what) \
- if(bits & i4b_l2_debug) \
- { \
- printf("i4b-L2-%s: ", routine); \
- printf what ; \
- }
-
-#define DBGL3(bits, routine, what) \
- if(bits & i4b_l3_debug) \
- { \
- printf("i4b-L3-%s: ", routine); \
- printf what ; \
- }
-
-#define DBGL4(bits, routine, what) \
- if(bits & i4b_l4_debug) \
- { \
- printf("i4b-L4-%s: ", routine); \
- printf what ; \
- }
-#else /* !DO_I4B_DEBUG */
-
-#define DBGL1(bits, routine, what);
-#define DBGL2(bits, routine, what);
-#define DBGL3(bits, routine, what);
-#define DBGL4(bits, routine, what);
-
-#endif /* DO_I4B_DEBUG */
-
-/* Layer 1 */
-
-#define L1_ERROR 0x0001 /* general error message*/
-#define L1_PRIM 0x0002 /* interlayer primitives*/
-#define L1_BCHAN 0x0004 /* B channel action */
-#define L1_H_ERR 0x0008 /* HSCX errors */
-#define L1_H_IRQ 0x0010 /* HSCX IRQ messages */
-#define L1_I_ERR 0x0020 /* ISAC errors */
-#define L1_I_MSG 0x0040 /* ISAC messages */
-#define L1_I_SETUP 0x0080 /* ISAC setup messages */
-#define L1_F_MSG 0x0100 /* FSM messages */
-#define L1_F_ERR 0x0200 /* FSM error messages */
-#define L1_T_MSG 0x0400 /* Timer messages */
-#define L1_T_ERR 0x0800 /* Timer error messages */
-#define L1_H_XFRERR 0x1000 /* HSCX data xfer error */
-#define L1_I_CICO 0x2000 /* ISAC command in/out */
-
-#define L1_DEBUG_MAX 0x3fef /* all messages on except IRQ! */
-#define L1_DEBUG_ERR (L1_H_ERR | L1_I_ERR | L1_F_ERR | L1_T_ERR | L1_ERROR)
-
-#ifndef L1_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L1_DEBUG_DEFAULT L1_DEBUG_MAX
-#else
-#define L1_DEBUG_DEFAULT L1_DEBUG_ERR
-#endif
-#endif
-
-/* Layer 2 */
-
-#define L2_ERROR 0x0001 /* general error message */
-#define L2_PRIM 0x0002 /* interlayer primitives */
-#define L2_U_MSG 0x0004 /* U frame messages */
-#define L2_U_ERR 0x0008 /* U frame error messages */
-#define L2_S_MSG 0x0010 /* S frame messages */
-#define L2_S_ERR 0x0020 /* S frame error messages */
-#define L2_I_MSG 0x0040 /* I frame messages */
-#define L2_I_ERR 0x0080 /* I frame error messages */
-#define L2_F_MSG 0x0100 /* FSM messages */
-#define L2_F_ERR 0x0200 /* FSM error messages */
-#define L2_T_MSG 0x0400 /* timer messages */
-#define L2_T_ERR 0x0800 /* timer error messages */
-#define L2_TEI_MSG 0x1000 /* TEI messages */
-#define L2_TEI_ERR 0x2000 /* TEI error messages */
-
-#define L2_DEBUG_MAX 0x3fff /* all messages on */
-#define L2_DEBUG_ERR (L2_ERROR | L2_I_ERR | L2_F_ERR | L2_T_ERR | L2_S_ERR | L2_TEI_ERR | L2_U_ERR )
-
-#ifndef L2_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L2_DEBUG_DEFAULT L2_DEBUG_MAX
-#else
-#define L2_DEBUG_DEFAULT L2_DEBUG_ERR
-#endif
-#endif
-
-/* Layer 3 */
-
-#define L3_ERR 0x0001 /* general error message */
-#define L3_MSG 0x0002 /* general message */
-#define L3_F_MSG 0x0004 /* FSM messages */
-#define L3_F_ERR 0x0008 /* FSM error messages */
-#define L3_T_MSG 0x0010 /* timer messages */
-#define L3_T_ERR 0x0020 /* timer error messages */
-#define L3_P_MSG 0x0040 /* protocol messages */
-#define L3_P_ERR 0x0080 /* protocol error messages */
-#define L3_A_MSG 0x0100 /* AOC messages */
-#define L3_A_ERR 0x0200 /* AOC error messages */
-#define L3_PRIM 0x0400 /* messages exchanged */
-
-#define L3_DEBUG_MAX 0x07ff /* all messages on */
-#define L3_DEBUG_ERR (L3_ERR | L3_F_ERR | L3_T_ERR | L3_P_ERR | L3_A_ERR)
-
-#ifndef L3_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L3_DEBUG_DEFAULT L3_DEBUG_MAX
-#else
-#define L3_DEBUG_DEFAULT L3_DEBUG_ERR
-#endif
-#endif
-
-/* Layer 4 */
-
-#define L4_ERR 0x0001 /* general error message */
-#define L4_MSG 0x0002 /* general message */
-#define L4_TIMO 0x0004 /* b channel idle timeout msgs */
-#define L4_DIALST 0x0008 /* network driver dial states */
-#define L4_IPRDBG 0x0010 /* ipr driver debug messages */
-#define L4_RBCHDBG 0x0020 /* rbch driver debug messages */
-
-#define L4_DEBUG_MAX 0x003f /* all messages on */
-#define L4_DEBUG_ERR (L4_ERR)
-
-#ifndef L4_DEBUG_DEFAULT
-#ifdef DO_I4B_MAXDEBUG
-#define L4_DEBUG_DEFAULT L4_DEBUG_MAX
-#else
-#define L4_DEBUG_DEFAULT L4_DEBUG_ERR
-#endif
-#endif
-
-/*---------------------------------------------------------------------------*
- * ioctl via /dev/i4bctl:
- * get/set current debug bits settings
- *---------------------------------------------------------------------------*/
-
-typedef struct {
- unsigned int l1;
- unsigned int l2;
- unsigned int l3;
- unsigned int l4;
-} ctl_debug_t;
-
-#define I4B_CTL_GET_DEBUG _IOR('C', 0, ctl_debug_t)
-
-#define I4B_CTL_SET_DEBUG _IOW('C', 1, ctl_debug_t)
-
-/*---------------------------------------------------------------------------*
- * get hscx statistics
- *---------------------------------------------------------------------------*/
-
-typedef struct {
- int unit; /* controller number */
- int chan; /* channel number */
- int vfr;
- int rdo;
- int crc;
- int rab;
- int xdu;
- int rfo;
-} hscxstat_t;
-
-#define I4B_CTL_GET_HSCXSTAT _IOWR('C', 2, hscxstat_t)
-
-#define I4B_CTL_CLR_HSCXSTAT _IOW('C', 3, hscxstat_t)
-
-/* EOF */
diff --git a/sys/i386/include/i4b_ioctl.h b/sys/i386/include/i4b_ioctl.h
deleted file mode 100644
index 17e945f173efa..0000000000000
--- a/sys/i386/include/i4b_ioctl.h
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ioctl.h - messages kernel <--> userland
- * -------------------------------------------
- *
- * $Id: i4b_ioctl.h,v 1.58 1998/12/22 19:48:24 hm Exp $
- *
- * last edit-date: [Tue Dec 22 20:33:46 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IOCTL_H_
-#define _I4B_IOCTL_H_
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#ifndef _MACHINE_TYPES_H_
-#include <machine/types.h>
-#endif /* _MACHINE_TYPES_H_ */
-#endif /* __FreeBSD__ */
-
-/*---------------------------------------------------------------------------*
- * version and release number for isdn4bsd package
- *---------------------------------------------------------------------------*/
-#define VERSION 0 /* version number */
-#define REL 70 /* release number */
-#define STEP 00 /* release step */
-
-/*---------------------------------------------------------------------------*
- * date/time format in i4b log messages
- * ------------------------------------
- * Being year 2000 clean is not easy with the current state of the
- * ANSI C library standard and it's implementation for some locales.
- * You might like to use the "%c" format of "strftime" sometimes,
- * but this breaks Y2K in some locales. Also the old standard logfile
- * format "%d.%m.%y %H:%M:%S" is non compliant.
- * NetBSD's current toolset warns about this problems, and we compile
- * with -Werror, so this problems need to be resolved.
- *---------------------------------------------------------------------------*/
-#define I4B_TIME_FORMAT "%d.%m.%Y %H:%M:%S"
-
-/*---------------------------------------------------------------------------*
- * max number of controllers in system
- *---------------------------------------------------------------------------*/
-#define MAX_CONTROLLERS 8 /* max number of controllers */
-
-/*---------------------------------------------------------------------------*
- * controller types
- *---------------------------------------------------------------------------*/
-#define CTRL_INVALID (-1) /* invalid, error */
-#define CTRL_UNKNOWN 0 /* unknown controller type */
-#define CTRL_PASSIVE 1 /* passive ISDN controller cards*/
-#define CTRL_DAIC 2 /* Diehl active controller cards*/
-#define CTRL_NUMTYPES 3 /* number of controller types */
-
-/*---------------------------------------------------------------------------*
- * card types for CTRL_PASSIVE
- *---------------------------------------------------------------------------*/
-#define CARD_TYPEP_INVAL (-1) /* invalid, error */
-#define CARD_TYPEP_UNK 0 /* unknown */
-#define CARD_TYPEP_8 1 /* Teles, S0/8 */
-#define CARD_TYPEP_16 2 /* Teles, S0/16 */
-#define CARD_TYPEP_16_3 3 /* Teles, S0/16.3 */
-#define CARD_TYPEP_AVMA1 4 /* AVM A1 or AVM Fritz!Card */
-#define CARD_TYPEP_163P 5 /* Teles, S0/16.3 PnP */
-#define CARD_TYPEP_CS0P 6 /* Creatix, S0 PnP */
-#define CARD_TYPEP_USRTA 7 /* US Robotics ISDN TA internal */
-#define CARD_TYPEP_DRNNGO 8 /* Dr. Neuhaus Niccy GO@ */
-#define CARD_TYPEP_SWS 9 /* Sedlbauer Win Speed */
-#define CARD_TYPEP_DYNALINK 10 /* Dynalink IS64PH */
-#define CARD_TYPEP_BLMASTER 11 /* ISDN Blaster / ISDN Master */
-#define CARD_TYPEP_PCFRITZ 12 /* AVM PCMCIA Fritz!Card */
-#define CARD_TYPEP_ELSAQS1ISA 13 /* ELSA QuickStep 1000pro ISA */
-#define CARD_TYPEP_ELSAQS1PCI 14 /* ELSA QuickStep 1000pro PCI */
-#define CARD_TYPEP_SIEMENSITALK 15 /* Siemens I-Talk */
-#define CARD_TYPEP_ELSAMLIMC 16 /* ELSA MicroLink ISDN/MC */
-#define CARD_TYPEP_ELSAMLMCALL 17 /* ELSA MicroLink MCall */
-#define CARD_TYPEP_ITKIX1 18 /* ITK ix1 micro */
-
-/*
- * in case you add support for more cards, please update:
- *
- * isdnd: support.c, name_of_controller()
- * diehl/diehlctl: main.c, listall()
- *
- * and adjust CARD_TYPEP_MAX below.
- */
-
-#define CARD_TYPEP_MAX 18 /* max type */
-
-/*---------------------------------------------------------------------------*
- * card types for CTRL_DAIC
- *---------------------------------------------------------------------------*/
-#define CARD_TYPEA_DAIC_UNK 0
-#define CARD_TYPEA_DAIC_S 1
-#define CARD_TYPEA_DAIC_SX 2
-#define CARD_TYPEA_DAIC_SCOM 3
-#define CARD_TYPEA_DAIC_QUAD 4
-
-/*---------------------------------------------------------------------------*
- * max length of some strings
- *---------------------------------------------------------------------------*/
-#define TELNO_MAX 41 /* max length of a telephone number (+ '\0') */
-#define DISPLAY_MAX 91 /* max length of display information (+ '\0') */
-#define DATETIME_MAX 21 /* max length of datetime information (+ '\0')*/
-
-/*---------------------------------------------------------------------------*
- * in case the src or dst telephone number is empty
- *---------------------------------------------------------------------------*/
-#define TELNO_EMPTY "NotAvailable"
-
-/*---------------------------------------------------------------------------*
- * B channel parameters
- *---------------------------------------------------------------------------*/
-#define BCH_MAX_DATALEN 2048 /* max length of a B channel frame */
-
-/*---------------------------------------------------------------------------*
- * userland driver types
- * ---------------------
- * a "driver" is defined here as a piece of software interfacing an
- * ISDN B channel with a userland service, such as IP, Telephony etc.
- *---------------------------------------------------------------------------*/
-#define BDRV_RBCH 0 /* raw b-channel interface driver */
-#define BDRV_TEL 1 /* telephone (speech) interface driver */
-#define BDRV_IPR 2 /* IP over raw HDLC interface driver */
-#define BDRV_ISPPP 3 /* sync Kernel PPP interface driver */
-
-/*---------------------------------------------------------------------------*
- * B channel protocol
- *---------------------------------------------------------------------------*/
-#define BPROT_NONE 0 /* no protocol at all, raw data */
-#define BPROT_RHDLC 1 /* raw HDLC: flag, data, crc, flag */
-
-/*---------------------------------------------------------------------------*
- * causes data type
- *---------------------------------------------------------------------------*/
-typedef unsigned int cause_t; /* 32 bit unsigned int */
-
-/*---------------------------------------------------------------------------*
- * call descriptor id (cdid) definitions
- *---------------------------------------------------------------------------*/
-#define CDID_UNUSED 0 /* cdid is invalid and unused */
-#define CDID_MAX 99999 /* highest valid cdid, wraparound to 1 */
-
-
-/****************************************************************************
-
- outgoing call:
- --------------
-
- userland kernel
- -------- ------
-
- CDID_REQ ----------------->
-
- <------------------ cdid
-
- CONNECT_REQ -------------->
-
- <------------------ PROCEEDING_IND (if connect req ok)
-
- <------------------ CONNECT_ACTIVE_IND (if connection ok)
-
- or
-
- <------------------ DISCONNECT_IND (if connection failed)
-
-
-
- incoming call:
- --------------
-
- userland kernel
- -------- ------
-
- <------------------ CONNECT_IND
-
- CONNECT_RESP ------------->
-
- <------------------ CONNECT_ACTIVE_IND (if accepted)
-
-
-
- active disconnect:
- ------------------
-
- userland kernel
- -------- ------
-
- DISCONNECT_REQ ------------>
-
- <------------------ DISCONNECT_IND
-
-
- passive disconnect:
- -------------------
-
- userland kernel
- -------- ------
-
- <------------------ DISCONNECT_IND
-
-
-****************************************************************************/
-
-
-/*===========================================================================*
- *===========================================================================*
- * "read" messages from kernel -> userland
- *===========================================================================*
- *===========================================================================*/
-
-
-/*---------------------------------------------------------------------------*
- * message header, included in every message
- *---------------------------------------------------------------------------*/
-typedef struct {
- char type; /* message identifier */
-#define MSG_CONNECT_IND 'a'
-#define MSG_CONNECT_ACTIVE_IND 'b'
-#define MSG_DISCONNECT_IND 'c'
-#define MSG_DIALOUT_IND 'd'
-#define MSG_IDLE_TIMEOUT_IND 'e'
-#define MSG_ACCT_IND 'f'
-#define MSG_CHARGING_IND 'g'
-#define MSG_PROCEEDING_IND 'h'
-#define MSG_ALERT_IND 'i'
-#define MSG_DRVRDISC_REQ 'j'
-#define MSG_L12STAT_IND 'k'
-#define MSG_TEIASG_IND 'l'
-#define MSG_PDEACT_IND 'm'
-#define MSG_NEGCOMP_IND 'n'
-#define MSG_IFSTATE_CHANGED_IND 'o'
- int cdid; /* call descriptor id */
-} msg_hdr_t;
-
-/*---------------------------------------------------------------------------*
- * connect indication
- * indicates incoming connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller number */
- int channel; /* channel number */
-#define CHAN_B1 0 /* this _must_ be 0, HSCX B1 is also 0 */
-#define CHAN_B2 1 /* this _must_ be 1, HSCX B2 is also 1 */
-#define CHAN_ANY (-1) /* outgoing, not possible for incoming */
-#define CHAN_NO (-2) /* call waiting (CW) for incoming */
- int bprot; /* b channel protocot, see BPROT_XXX */
- char dst_telno[TELNO_MAX]; /* destination telno */
- char src_telno[TELNO_MAX]; /* source telno */
- int scr_ind;/* screening indicator */
-#define SCR_NONE 0 /* no screening indicator transmitted */
-#define SCR_USR_NOSC 1 /* screening user provided, not screened*/
-#define SCR_USR_PASS 2 /* screening user provided, verified & passed */
-#define SCR_USR_FAIL 3 /* screening user provided, verified & failed */
-#define SCR_NET 4 /* screening network provided */
- char display[DISPLAY_MAX]; /* content of display IE*/
-} msg_connect_ind_t;
-
-/*---------------------------------------------------------------------------*
- * connect active indication
- * indicates active connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller number actually used */
- int channel; /* channel number actually used */
- char datetime[DATETIME_MAX]; /* content of date/time IE */
-} msg_connect_active_ind_t;
-
-/*---------------------------------------------------------------------------*
- * disconnect indication
- * indicates a disconnect
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- cause_t cause; /* cause code */
-} msg_disconnect_ind_t;
-
-/*---------------------------------------------------------------------------*
- * negotiation complete
- * indicates an interface is completely up & running
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
-} msg_negcomplete_ind_t;
-
-/*---------------------------------------------------------------------------*
- * interface changes internal state
- * indicates an interface has somehow switched its FSM
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int state; /* new interface state */
-} msg_ifstatechg_ind_t;
-
-/*---------------------------------------------------------------------------*
- * initiate a call to a remote site
- * i.e. the IP driver got a packet and wants a connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
-} msg_dialout_ind_t;
-
-/*---------------------------------------------------------------------------*
- * idle timeout disconnect sent indication
- * kernel has sent disconnect request because of b-ch idle
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
-} msg_idle_timeout_ind_t;
-
-/*---------------------------------------------------------------------------*
- * accounting information from userland interface driver to daemon
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int accttype; /* accounting type */
-#define ACCT_DURING 0
-#define ACCT_FINAL 1
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
- int ioutbytes; /* ISDN # of bytes sent */
- int iinbytes; /* ISDN # of bytes received */
- int outbps; /* bytes per sec out */
- int inbps; /* bytes per sec in */
- int outbytes; /* driver # of bytes sent */
- int inbytes; /* driver # of bytes received */
-} msg_accounting_ind_t;
-
-/*---------------------------------------------------------------------------*
- * charging information from isdn driver to daemon
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int units; /* number of units */
- int units_type; /* type of units info */
-#define CHARGE_INVALID 0 /* invalid, unknown */
-#define CHARGE_AOCD 1 /* advice of charge during call */
-#define CHARGE_AOCE 2 /* advice of charge at end of call */
-#define CHARGE_CALC 3 /* locally calculated from rates information */
-} msg_charging_ind_t;
-
-/*---------------------------------------------------------------------------*
- * call proceeding indication
- * indicates outgoing SETUP has been acknowleged
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller number actually used */
- int channel; /* channel number actually used */
-} msg_proceeding_ind_t;
-
-/*---------------------------------------------------------------------------*
- * alert indication
- * indicates remote user side "rings"
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
-} msg_alert_ind_t;
-
-/*---------------------------------------------------------------------------*
- * driver requests to disconnect line
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
-} msg_drvrdisc_req_t;
-
-/*---------------------------------------------------------------------------*
- * state of layer 1/2
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller unit */
- int layer; /* layer number (1/2) */
-#define LAYER_ONE 1
-#define LAYER_TWO 2
- int state; /* state info */
-#define LAYER_IDLE 0
-#define LAYER_ACTIVE 1
-} msg_l12stat_ind_t;
-
-/*---------------------------------------------------------------------------*
- * TEI assignment messages
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller unit */
- int tei; /* TEI or -1 if invalid */
-} msg_teiasg_ind_t;
-
-/*---------------------------------------------------------------------------*
- * persistent deactivation state of stack
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int controller; /* controller unit */
- int numactive; /* number of active connections */
-} msg_pdeact_ind_t;
-
-
-/*===========================================================================*
- *===========================================================================*
- * "ioctl" messages from userland -> kernel
- *===========================================================================*
- *===========================================================================*/
-
-
-/*---------------------------------------------------------------------------*
- * request a unique cdid (to setup an outgoing call)
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
-} msg_cdid_req_t;
-
-#define I4B_CDID_REQ _IOWR('4', 0, int)
-
-/*---------------------------------------------------------------------------*
- * connect request
- * requests an outgoing connection
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- int controller; /* controller to use */
- int channel; /* channel to use */
- int txdelay; /* tx delay after connect */
- int bprot; /* b channel protocol */
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int unitlen_time; /* length of a charging unit */
- int idle_time; /* time without activity on b ch */
- int earlyhup_time; /* safety area at end of unit */
- int unitlen_method; /* how to calculate the unitlength */
-#define ULEN_METHOD_STATIC 0 /* use unitlen_time value (see above) */
-#define ULEN_METHOD_DYNAMIC 1 /* use AOCD */
- char dst_telno[TELNO_MAX]; /* destination telephone no */
- char src_telno[TELNO_MAX]; /* source telephone number */
-} msg_connect_req_t;
-
-#define I4B_CONNECT_REQ _IOW('4', 1, msg_connect_req_t)
-
-/*---------------------------------------------------------------------------*
- * connect response
- * this is the answer to an incoming connect indication
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- int response; /* what to do with incoming call */
-#define SETUP_RESP_DNTCRE 0 /* dont care, call is not for me */
-#define SETUP_RESP_REJECT 1 /* reject call */
-#define SETUP_RESP_ACCEPT 2 /* accept call */
- cause_t cause; /* cause for case SETUP_RESP_REJECT */
- /* the following are only used for SETUP_RESP_ACCEPT !! */
- int txdelay; /* tx delay after connect */
- int bprot; /* B chan protocol */
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int max_idle_time; /* max time without activity on b ch */
-} msg_connect_resp_t;
-
-#define I4B_CONNECT_RESP _IOW('4', 2, msg_connect_resp_t)
-
-/*---------------------------------------------------------------------------*
- * disconnect request
- * active disconnect request
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- cause_t cause; /* protocol independent cause */
-} msg_discon_req_t;
-
-#define I4B_DISCONNECT_REQ _IOW('4', 3, msg_discon_req_t)
-
-/*---------------------------------------------------------------------------*
- * controller info request
- *---------------------------------------------------------------------------*/
-typedef struct {
- int controller; /* controller number */
- int ncontroller; /* number of controllers in system */
- int ctrl_type; /* controller type passive/active */
- int card_type; /* brand / version */
- int tei; /* tei controller probably has */
-} msg_ctrl_info_req_t;
-
-#define I4B_CTRL_INFO_REQ _IOWR('4', 4, msg_ctrl_info_req_t)
-
-/*---------------------------------------------------------------------------*
- * dialout response
- * status report to driver who requested a dialout
- *---------------------------------------------------------------------------*/
-typedef struct {
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int stat; /* state of dialout request */
-#define DSTAT_NONE 0
-#define DSTAT_TFAIL 1 /* transient failure */
-#define DSTAT_PFAIL 2 /* permanent failure */
-#define DSTAT_INONLY 3 /* no outgoing dials allowed */
-} msg_dialout_resp_t;
-
-#define I4B_DIALOUT_RESP _IOW('4', 5, msg_dialout_resp_t)
-
-/*---------------------------------------------------------------------------*
- * timeout value update
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
- int unitlen_time; /* length of a charging unit */
- int idle_time; /* time without activity on b ch */
- int earlyhup_time; /* safety area at end of unit */
-} msg_timeout_upd_t;
-
-#define I4B_TIMEOUT_UPD _IOW('4', 6, msg_timeout_upd_t)
-
-/*---------------------------------------------------------------------------*
- * soft enable/disable
- *---------------------------------------------------------------------------*/
-typedef struct {
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- int updown; /* what to do */
-#define SOFT_ENA 0 /* enable interface */
-#define SOFT_DIS 1 /* disable interface */
-} msg_updown_ind_t;
-
-#define I4B_UPDOWN_IND _IOW('4', 7, msg_updown_ind_t)
-
-/*---------------------------------------------------------------------------*
- * send alert request
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call descriptor id */
-} msg_alert_req_t;
-
-#define I4B_ALERT_REQ _IOW('4', 8, msg_alert_req_t)
-
-/*---------------------------------------------------------------------------*
- * request version and release info from kernel part
- *---------------------------------------------------------------------------*/
-typedef struct {
- int version; /* version number */
- int release; /* release number */
- int step; /* release step number */
-} msg_vr_req_t;
-
-#define I4B_VR_REQ _IOR('4', 9, msg_vr_req_t)
-
-/*---------------------------------------------------------------------------*
- * Protocol download to active cards
- *---------------------------------------------------------------------------*/
-struct isdn_dr_prot {
- size_t bytecount; /* length of code */
- u_int8_t *microcode; /* pointer to microcode */
-};
-
-struct isdn_download_request {
- int controller; /* controller number */
- int numprotos; /* number of protocols in 'protocols' */
- struct isdn_dr_prot *protocols;
-};
-
-#define I4B_CTRL_DOWNLOAD _IOW('4', 100, struct isdn_download_request)
-
-/*---------------------------------------------------------------------------*
- * Generic diagnostic interface for active cards
- *---------------------------------------------------------------------------*/
-struct isdn_diagnostic_request {
- int controller; /* controller number */
- u_int32_t cmd; /* diagnostic command to execute */
- size_t in_param_len; /* length of additional input parameter */
- void *in_param; /* optional input parameter */
- size_t out_param_len; /* available output space */
- void *out_param; /* output data goes here */
-};
-
-#define I4B_ACTIVE_DIAGNOSTIC _IOW('4', 102, struct isdn_diagnostic_request)
-
-#endif /* _I4B_IOCTL_H_ */
diff --git a/sys/i386/include/i4b_trace.h b/sys/i386/include/i4b_trace.h
deleted file mode 100644
index 07e08daa075cb..0000000000000
--- a/sys/i386/include/i4b_trace.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_trace.h - header file for trace data read device
- * ----------------------------------------------------
- *
- * $Id: i4b_trace.h,v 1.5 1998/12/05 18:06:01 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:37:49 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_TRACE_H_
-#define _I4B_TRACE_H_
-
-/*---------------------------------------------------------------------------*
- * structure of the header at the beginning of every trace mbuf
- *---------------------------------------------------------------------------*/
-typedef struct {
- int length; /* length of the following mbuf */
- int unit; /* controller unit number */
- int type; /* type of channel */
-#define TRC_CH_I 0 /* Layer 1 INFO's */
-#define TRC_CH_D 1 /* D channel */
-#define TRC_CH_B1 2 /* B1 channel */
-#define TRC_CH_B2 3 /* B2 channel */
- int dir; /* direction */
-#define FROM_TE 0 /* user -> network */
-#define FROM_NT 1 /* network -> user */
- int trunc; /* # of truncated bytes (frame > MCLBYTES) */
- unsigned int count; /* frame count for this unit/type */
- struct timeval time; /* timestamp for this frame */
-} i4b_trace_hdr_t;
-
-#define INFO0 0 /* layer 1 */
-#define INFO1_8 1
-#define INFO1_10 2
-#define INFO2 3
-#define INFO3 4
-#define INFO4_8 5
-#define INFO4_10 6
-
-/*---------------------------------------------------------------------------*
- * ioctl via /dev/i4btrc device(s):
- * get/set current trace flag settings
- *---------------------------------------------------------------------------*/
-
-#define I4B_TRC_GET _IOR('T', 0, int) /* get trace settings */
-#define I4B_TRC_SET _IOW('T', 1, int) /* set trace settings */
-
-#define TRACE_OFF 0x00 /* tracing off */
-#define TRACE_I 0x01 /* trace L1 INFO's on */
-#define TRACE_D_TX 0x02 /* trace D channel on */
-#define TRACE_D_RX 0x04 /* trace D channel on */
-#define TRACE_B_TX 0x08 /* trace B channel on */
-#define TRACE_B_RX 0x10 /* trace B channel on */
-
-typedef struct {
- int rxunit; /* unit # for rx frames */
- int rxflags; /* d and/or b channel */
- int txunit; /* unit # for tx frames */
- int txflags; /* d and/or b channel */
-} i4b_trace_setupa_t;
-
-#define I4B_TRC_SETA _IOW('T', 2, i4b_trace_setupa_t) /* set analyze mode */
-#define I4B_TRC_RESETA _IOW('T', 3, int) /* reset analyze mode */
-
-#endif /* _I4B_TRACE_H_ */
diff --git a/sys/i386/include/iic.h b/sys/i386/include/iic.h
index 6649821e0240a..174432611c0c9 100644
--- a/sys/i386/include/iic.h
+++ b/sys/i386/include/iic.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iic.h,v 1.1 1998/09/03 21:00:08 nsouch Exp $
+ * $Id: iic.h,v 1.1.2.1 1998/07/17 00:54:01 son Exp $
*
*/
#ifndef __IIC_H
@@ -31,17 +31,10 @@
#include <sys/ioccom.h>
-struct iiccmd {
- u_char slave;
- int count;
- int last;
- char *buf;
-};
-
-#define I2CSTART _IOW('i', 1, struct iiccmd) /* start condition */
-#define I2CSTOP _IO('i', 2) /* stop condition */
-#define I2CRSTCARD _IOW('i', 3, struct iiccmd) /* reset the card */
-#define I2CWRITE _IOW('i', 4, struct iiccmd) /* send data */
-#define I2CREAD _IOW('i', 5, struct iiccmd) /* receive data */
+#define I2CSTART _IO('i', 1) /* start condition */
+#define I2CSTOP _IO('i', 2) /* stop condition */
+#define I2CADDRESS _IOW('i', 3, long) /* address bus */
+#define I2CRSTCARD _IOW('i', 4, long) /* reset the card */
#endif
+
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index fd7bcfd2c661f..a565266783452 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: md_var.h,v 1.27 1998/10/30 05:41:15 msmith Exp $
+ * $Id: md_var.h,v 1.25 1998/09/14 22:43:40 jdp Exp $
*/
#ifndef _MACHINE_MD_VAR_H_
@@ -38,12 +38,7 @@
extern int Maxmem;
extern u_int atdevbase; /* offset in virtual memory of ISA io mem */
-extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
extern int busdma_swi_pending;
-extern int (*copyin_vector) __P((const void *udaddr, void *kaddr,
- size_t len));
-extern int (*copyout_vector) __P((const void *kaddr, void *udaddr,
- size_t len));
extern u_int cpu_feature;
extern u_int cpu_high;
extern u_int cpu_id;
@@ -56,7 +51,6 @@ extern int need_post_dma_flush;
#endif
extern void (*netisrs[32]) __P((void));
extern int nfs_diskless_valid;
-extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
extern char sigcode[];
extern int szsigcode;
@@ -68,6 +62,7 @@ struct fpreg;
void bcopyb __P((const void *from, void *to, size_t len));
void busdma_swi __P((void));
void cpu_halt __P((void));
+void cpu_power_down __P((void));
void cpu_reset __P((void));
void cpu_switch_load_fs __P((void)) __asm(__STRING(cpu_switch_load_fs));
void cpu_switch_load_gs __P((void)) __asm(__STRING(cpu_switch_load_gs));
@@ -80,12 +75,6 @@ void doreti_popl_es_fault __P((void)) __asm(__STRING(doreti_popl_es_fault));
int fill_fpregs __P((struct proc *, struct fpreg *));
int fill_regs __P((struct proc *p, struct reg *regs));
void fillw __P((int /*u_short*/ pat, void *base, size_t cnt));
-void i486_bzero __P((void *buf, size_t len));
-void i586_bcopy __P((const void *from, void *to, size_t len));
-void i586_bzero __P((void *buf, size_t len));
-int i586_copyin __P((const void *udaddr, void *kaddr, size_t len));
-int i586_copyout __P((const void *kaddr, void *udaddr, size_t len));
-void i686_pagezero __P((void *addr));
int is_physical_memory __P((vm_offset_t addr));
u_long kvtop __P((void *addr));
void setidt __P((int idx, alias_for_inthand_t *func, int typ, int dpl,
diff --git a/sys/i386/include/mouse.h b/sys/i386/include/mouse.h
index b6ecef777bee4..27ec8e1fe94ab 100644
--- a/sys/i386/include/mouse.h
+++ b/sys/i386/include/mouse.h
@@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mouse.h,v 1.10 1998/06/14 20:05:22 ahasty Exp $
+ * $Id: mouse.h,v 1.9 1997/12/07 08:08:50 yokota Exp $
*/
#ifndef _MACHINE_MOUSE_H_
@@ -113,7 +113,6 @@ typedef struct mousehw {
#define MOUSE_MODEL_THINK 5
#define MOUSE_MODEL_EASYSCROLL 6
#define MOUSE_MODEL_MOUSEMANPLUS 7
-#define MOUSE_MODEL_KIDSPAD 8
typedef struct mousemode {
int protocol; /* MOUSE_PROTO_XXX */
@@ -141,7 +140,6 @@ typedef struct mousemode {
#define MOUSE_PROTO_THINK 11 /* Kensignton Thinking Mouse, 3/4 bytes */
#define MOUSE_PROTO_SYSMOUSE 12 /* /dev/sysmouse */
#define MOUSE_PROTO_X10MOUSEREM 13 /* X10 MouseRemote, 3 bytes */
-#define MOUSE_PROTO_KIDSPAD 14 /* Genius Kidspad */
#define MOUSE_RES_UNKNOWN (-1)
#define MOUSE_RES_DEFAULT 0
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index ce0043945af6d..e03b9ad66f7b9 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)param.h 5.8 (Berkeley) 6/28/91
- * $Id: param.h,v 1.47 1998/10/13 08:24:37 dg Exp $
+ * $Id: param.h,v 1.46 1998/09/09 01:21:25 jdp Exp $
*/
#ifndef _MACHINE_PARAM_H_
@@ -54,7 +54,11 @@
* that are supported on the architecture.
*/
#define OBJFORMAT_NAMES "elf", "aout"
+#ifdef __ELF__
#define OBJFORMAT_DEFAULT "elf"
+#else
+#define OBJFORMAT_DEFAULT "aout"
+#endif
#ifdef SMP
#define NCPUS 2
diff --git a/sys/i386/include/pc/vesa.h b/sys/i386/include/pc/vesa.h
index 16b07098aad14..0f4dd6b931716 100644
--- a/sys/i386/include/pc/vesa.h
+++ b/sys/i386/include/pc/vesa.h
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: vesa.h,v 1.3 1999/01/08 12:57:06 yokota Exp $
+ * $Id: vesa.h,v 1.1 1998/09/15 18:16:37 sos Exp $
*/
#ifndef _MACHINE_PC_VESA_H
@@ -115,6 +115,10 @@ struct vesa_mode
int vesa_load_ioctl(void);
int vesa_unload_ioctl(void);
+#ifndef VESA_MODULE
+int vesa_load(void);
+#endif
+
#endif /* KERNEL */
#endif /* !_MACHINE_PC_VESA_H */
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index 5251be3890c79..25bfc624c8eb4 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -42,7 +42,7 @@
*
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
- * $Id: pmap.h,v 1.56 1998/06/21 14:08:27 mckay Exp $
+ * $Id: pmap.h,v 1.55 1998/05/11 01:05:59 dyson Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -237,10 +237,9 @@ typedef struct pv_entry {
#define NPPROVMTRR 8
#define PPRO_VMTRRphysBase0 0x200
#define PPRO_VMTRRphysMask0 0x201
-struct ppro_vmtrr {
+struct {
u_int64_t base, mask;
-};
-extern struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR];
+} PPro_vmtrr[NPPROVMTRR];
extern caddr_t CADDR1;
extern pt_entry_t *CMAP1;
diff --git a/sys/i386/include/resource.h b/sys/i386/include/resource.h
deleted file mode 100644
index 0307182216902..0000000000000
--- a/sys/i386/include/resource.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _MACHINE_RESOURCE_H_
-#define _MACHINE_RESOURCE_H_ 1
-
-/*
- * Definitions of resource types for Intel Architecture machines
- * with support for legacy ISA devices and drivers.
- */
-
-#define SYS_RES_IRQ 1
-#define SYS_RES_DRQ 2
-#define SYS_RES_MEMORY 3
-#define SYS_RES_IOPORT 4
-
-#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/i386/include/smb.h b/sys/i386/include/smb.h
index e0ebef8b2dd4c..1338a15658b7d 100644
--- a/sys/i386/include/smb.h
+++ b/sys/i386/include/smb.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smb.h,v 1.1 1998/09/03 21:00:08 nsouch Exp $
+ * $Id: smb.h,v 1.1 1998/08/13 17:13:20 son Exp $
*
*/
#ifndef __SMB_H
@@ -34,7 +34,6 @@
struct smbcmd {
char cmd;
int count;
- u_char slave;
union {
char byte;
short word;
@@ -49,8 +48,8 @@ struct smbcmd {
} data;
};
-#define SMB_QUICK_WRITE _IOW('i', 1, struct smbcmd)
-#define SMB_QUICK_READ _IOW('i', 2, struct smbcmd)
+#define SMB_QUICK_WRITE _IO('i', 1)
+#define SMB_QUICK_READ _IO('i', 2)
#define SMB_SENDB _IOW('i', 3, struct smbcmd)
#define SMB_RECVB _IOW('i', 4, struct smbcmd)
#define SMB_WRITEB _IOW('i', 5, struct smbcmd)
diff --git a/sys/i386/include/types.h b/sys/i386/include/types.h
index f28d633cbd3c3..fa4d88f9cbc2a 100644
--- a/sys/i386/include/types.h
+++ b/sys/i386/include/types.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)types.h 8.3 (Berkeley) 1/5/94
- * $Id: types.h,v 1.15 1998/07/14 05:09:43 bde Exp $
+ * $Id: types.h,v 1.14 1998/07/10 02:27:15 bde Exp $
*/
#ifndef _MACHINE_TYPES_H_
@@ -52,16 +52,33 @@ typedef __int64_t vm_ooffset_t;
typedef unsigned int vm_pindex_t;
typedef unsigned int vm_size_t;
-typedef __int32_t register_t;
+/*
+ * Basic integral types. Omit the typedef if
+ * not possible for a machine/compiler combination.
+ */
+typedef __signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+typedef __int64_t int64_t;
+typedef __uint64_t u_int64_t;
+
+typedef int32_t register_t;
+typedef int32_t ufs_daddr_t;
#ifdef KERNEL
typedef int intfptr_t;
typedef unsigned int uintfptr_t;
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+typedef __uint64_t uoff_t;
#endif
/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
+typedef u_int32_t intrmask_t;
/* Interrupt handler function type. */
typedef void inthand2_t __P((void *_cookie));
diff --git a/sys/i386/isa/README.le b/sys/i386/isa/README.le
index a8c33c194b3c3..52e4df590588f 100644
--- a/sys/i386/isa/README.le
+++ b/sys/i386/isa/README.le
@@ -1,4 +1,4 @@
-$Id: README.le,v 1.4 1997/02/22 09:35:49 peter Exp $
+$Id$
----------------
@@ -38,7 +38,7 @@ i386/conf/files.i386 file.
After that is done you will need to edit your config file (in
i386/conf) and a line similar to:
-device le0 at isa? port 0x300 net irq 5 iomem 0xd0000
+device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr
[The above line assumes the board is still at the factory defaults.]
Change the port, irq, and iomem value if needed to your configuration.
diff --git a/sys/i386/isa/README.stl b/sys/i386/isa/README.stl
index 84e8ab66dd90d..20b62f701a913 100644
--- a/sys/i386/isa/README.stl
+++ b/sys/i386/isa/README.stl
@@ -328,7 +328,7 @@ i386/isa/stallion.c optional stl device-driver
- enter a line for each board that you want to use. For stallion.c
boards entries should look like:
-device stl0 at isa? port 0x2a0 tty irq 10
+device stl0 at isa? port 0x2a0 tty irq 10 vector stlintr
For istallion.c boards, the entries should look like:
diff --git a/sys/i386/isa/adv_isa.c b/sys/i386/isa/adv_isa.c
index 7e9b84de9481a..09fe9f281926e 100644
--- a/sys/i386/isa/adv_isa.c
+++ b/sys/i386/isa/adv_isa.c
@@ -44,7 +44,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adv_isa.c,v 1.7 1998/11/10 06:44:54 gibbs Exp $
+ * $Id: adv_isa.c,v 1.5 1998/10/10 00:44:12 imp Exp $
*/
#include <sys/param.h>
@@ -71,9 +71,9 @@
* The overrun buffer shared amongst all ISA/VL adapters.
*/
static u_int8_t* overrun_buf;
-static bus_dma_tag_t overrun_dmat;
-static bus_dmamap_t overrun_dmamap;
-static bus_addr_t overrun_physbase;
+bus_dma_tag_t overrun_dmat;
+bus_dmamap_t overrun_dmamap;
+bus_addr_t overrun_physbase;
/* Possible port addresses an ISA or VL adapter can live at */
u_int16_t adv_isa_ioports[] =
@@ -122,7 +122,7 @@ advisaprobe(struct isa_device *id)
if (id->id_iobase > 0) {
for (;port_index <= max_port_index; port_index++)
- if (id->id_iobase <= adv_isa_ioports[port_index])
+ if (id->id_iobase >= adv_isa_ioports[port_index])
break;
if ((port_index > max_port_index)
|| (id->id_iobase != adv_isa_ioports[port_index])) {
diff --git a/sys/i386/isa/aha_isa.c b/sys/i386/isa/aha_isa.c
index 94266790e87f6..5f81ea183bdaa 100644
--- a/sys/i386/isa/aha_isa.c
+++ b/sys/i386/isa/aha_isa.c
@@ -28,14 +28,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aha_isa.c,v 1.5 1998/11/10 06:44:54 gibbs Exp $
+ * $Id: aha_isa.c,v 1.3 1998/10/10 00:44:12 imp Exp $
*/
-#include "pnp.h"
-
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <machine/bus_pio.h>
#include <machine/bus.h>
@@ -45,13 +42,9 @@
#include <cam/scsi/scsi_all.h>
-#if NPNP > 0
-#include <i386/isa/pnp.h>
-#endif
-
-static int aha_isa_probe(struct isa_device *dev);
-static int aha_isa_attach(struct isa_device *dev);
-static void aha_isa_intr(void *unit);
+static int aha_isa_probe __P((struct isa_device *dev));
+static int aha_isa_attach __P((struct isa_device *dev));
+static void aha_isa_intr __P((void *unit));
struct isa_driver ahadriver =
{
@@ -75,18 +68,41 @@ aha_isa_probe(dev)
*/
struct aha_softc *aha;
int port_index;
- int max_port_index;
+ int max_port_index;
- aha = NULL;
+ /*
+ * We ignore the unit number assigned by config to allow
+ * consistant numbering between PCI/EISA/ISA devices.
+ * This is a total kludge until we have a configuration
+ * manager.
+ */
+ dev->id_unit = aha_unit;
+ aha = NULL;
+ port_index = 0;
+ max_port_index = AHA_NUM_ISAPORTS - 1;
/*
* Bound our board search if the user has
* specified an exact port.
*/
- aha_find_probe_range(dev->id_iobase, &port_index, &max_port_index);
-
- if (port_index < 0)
- return 0;
+ if (dev->id_iobase > 0) {
+ for (;port_index <= max_port_index; port_index++)
+ if (dev->id_iobase >= aha_isa_ports[port_index].addr)
+ break;
+ if ((port_index > max_port_index)
+ || (dev->id_iobase != aha_isa_ports[port_index].addr)) {
+ printf("
+aha_isa_probe: Invalid baseport of 0x%x specified.
+aha_isa_probe: Nearest valid baseport is 0x%x.
+aha_isa_probe: Failing probe.\n",
+ dev->id_iobase,
+ (port_index <= max_port_index)
+ ? aha_isa_ports[port_index].addr
+ : aha_isa_ports[max_port_index].addr);
+ return 0;
+ }
+ max_port_index = port_index;
+ }
/* Attempt to find an adapter */
for (;port_index <= max_port_index; port_index++) {
@@ -94,7 +110,7 @@ aha_isa_probe(dev)
u_int ioport;
int error;
- ioport = aha_iop_from_bio(port_index);
+ ioport = aha_isa_ports[port_index].addr;
/*
* Ensure this port has not already been claimed already
@@ -102,7 +118,7 @@ aha_isa_probe(dev)
*/
if (aha_check_probed_iop(ioport) != 0)
continue;
- dev->id_iobase = ioport;
+ dev->id_iobase = aha_isa_ports[port_index].addr;
if (haveseen_isadev(dev, CC_IOADDR | CC_QUIET))
continue;
@@ -125,7 +141,7 @@ aha_isa_probe(dev)
* Determine our IRQ, and DMA settings and
* export them to the configuration system.
*/
- error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
+ error = aha_cmd(aha, BOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
(u_int8_t*)&config_data, sizeof(config_data),
DEFAULT_CMD_TIMEOUT);
if (error != 0) {
@@ -150,7 +166,6 @@ aha_isa_probe(dev)
printf("aha_isa_probe: Invalid DMA setting "
"detected for adapter at 0x%x. "
"Failing probe\n", ioport);
- return (0);
}
dev->id_irq = (config_data.irq << 9);
dev->id_intr = aha_isa_intr;
@@ -213,79 +228,3 @@ aha_isa_intr(void *unit)
struct aha_softc* arg = aha_softcs[(int)unit];
aha_intr((void *)arg);
}
-
-/*
- * support PnP cards if we are using 'em
- */
-
-#if NPNP > 0
-
-static char *ahapnp_probe(u_long csn, u_long vend_id);
-static void ahapnp_attach(u_long csn, u_long vend_id, char *name,
- struct isa_device *dev);
-static u_long nahapnp = NAHA;
-
-static struct pnp_device ahapnp = {
- "ahapnp",
- ahapnp_probe,
- ahapnp_attach,
- &nahapnp,
- &bio_imask
-};
-DATA_SET (pnpdevice_set, ahapnp);
-
-static char *
-ahapnp_probe(u_long csn, u_long vend_id)
-{
- struct pnp_cinfo d;
- char *s = NULL;
-
- if (vend_id != AHA1542_PNP && vend_id != AHA1542_PNPCOMPAT)
- return (NULL);
-
- read_pnp_parms(&d, 0);
- if (d.enable == 0 || d.flags & 1) {
- printf("CSN %lu is disabled.\n", csn);
- return (NULL);
- }
- s = "Adaptec 1542CP";
-
- return (s);
-}
-
-static void
-ahapnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
-{
- struct pnp_cinfo d;
- struct isa_device *dvp;
-
- if (dev->id_unit >= NAHATOT)
- return;
-
- if (read_pnp_parms(&d, 0) == 0) {
- printf("failed to read pnp parms\n");
- return;
- }
-
- write_pnp_parms(&d, 0);
-
- enable_pnp_card();
-
- dev->id_iobase = d.port[0];
- dev->id_irq = (1 << d.irq[0]);
- dev->id_intr = aha_intr;
- dev->id_drq = d.drq[0];
-
- if (dev->id_driver == NULL) {
- dev->id_driver = &ahadriver;
- dvp = find_isadev(isa_devtab_tty, &ahadriver, 0);
- if (dvp != NULL)
- dev->id_id = dvp->id_id;
- }
-
- if ((dev->id_alive = aha_isa_probe(dev)) != 0)
- aha_isa_attach(dev);
- else
- printf("aha%d: probe failed\n", dev->id_unit);
-}
-#endif
diff --git a/sys/i386/isa/aic6360.c b/sys/i386/isa/aic6360.c
index e0f946d3d993a..2b28abcebcd56 100644
--- a/sys/i386/isa/aic6360.c
+++ b/sys/i386/isa/aic6360.c
@@ -32,7 +32,7 @@
*/
/*
- * $Id: aic6360.c,v 1.42 1998/10/22 05:58:38 bde Exp $
+ * $Id: aic6360.c,v 1.40 1998/04/15 17:45:12 bde Exp $
*
* Acknowledgements: Many of the algorithms used in this driver are
* inspired by the work of Julian Elischer (julian@tfs.com) and
@@ -663,7 +663,6 @@ static int aic_find __P((struct aic_data *));
static void aic_done __P((struct acb *));
static void aic_dataout __P((struct aic_data *aic));
static void aic_datain __P((struct aic_data *aic));
-static ointhand2_t aicintr;
static int32_t aic_scsi_cmd __P((struct scsi_xfer *));
static int aic_poll __P((struct aic_data *aic, struct acb *));
void aic_add_timeout __P((struct acb *, int));
@@ -715,7 +714,6 @@ static struct scsi_device aic_dev = {
#include "card.h"
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -723,7 +721,16 @@ static int aic_card_intr __P((struct pccard_devinfo *));
static int aicinit __P((struct pccard_devinfo *));
static void aicunload __P((struct pccard_devinfo *));
-PCCARD_MODULE(aic, aicinit, aicunload, aic_card_intr, 0, bio_imask);
+static struct pccard_device aic_info = {
+ "aic",
+ aicinit,
+ aicunload,
+ aic_card_intr,
+ 0, /* Attributes - presently unused */
+ &bio_imask
+};
+
+DATA_SET(pccarddrv_set, aic_info);
/*
* Initialize the device - called from Slot manager.
@@ -960,7 +967,6 @@ aicattach(dev)
struct scsibus_data *scbus;
AIC_TRACE(("aicattach\n"));
- dev->id_ointr = aicintr;
aic->state = 0;
aic_scsi_reset(aic);
aic_init(aic); /* Init chip and driver */
@@ -2129,7 +2135,7 @@ aic_datain(aic)
* 2) doesn't support synchronous transfers properly (yet)
*/
-static void
+void
aicintr(int unit)
{
struct aic_data *aic = aicdata[unit];
diff --git a/sys/i386/isa/alog.c b/sys/i386/isa/alog.c
new file mode 100644
index 0000000000000..8fbe5768811a9
--- /dev/null
+++ b/sys/i386/isa/alog.c
@@ -0,0 +1,663 @@
+/*
+ * Copyright (c) 1998 Scottibox
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Industrial Computer Source model AIO8-P
+ * 8 channel, moderate speed analog to digital converter board with
+ * 128 channel MUX capability via daisy chained AT-16P units
+ * alog.c, character device driver, last revised January 6 1998
+ * See http://www.scottibox.com
+ * http://www.indcompsrc.com/products/data/html/aio8g-p.html
+ * http://www.indcompsrc.com/products/data/html/at16-p.html
+ *
+ * Written by: Jamil J. Weatherbee <jamil@scottibox.com>
+ *
+ */
+
+
+/* Include Files */
+
+#include "alog.h"
+#if NALOG > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/conf.h>
+#include <sys/fcntl.h>
+#include <sys/malloc.h>
+#include <sys/poll.h>
+#include <sys/vnode.h>
+#include <sys/filio.h>
+#include <i386/isa/isa_device.h>
+#include <sys/alogio.h>
+#include <sys/dataacq.h>
+
+#include "opt_devfs.h"
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif
+
+/* Local Defines */
+
+/* Tests have shown that increasing the fifo size
+ * beyond 64 entries for this particular piece of hardware is
+ * unproductive */
+
+#ifdef ALOG_FIFOSIZE
+#define FIFOSIZE ALOG_FIFOSIZE
+#else
+#define FIFOSIZE 64
+#endif
+
+#ifdef ALOG_FIFO_TRIGGER
+#define DEFAULT_FIFO_TRIGGER ALOG_FIFO_TRIGGER
+#else
+#define DEFAULT_FIFO_TRIGGER 1
+#endif
+
+#ifdef ALOG_CHANNELS
+#define NUMCHANNELS ALOG_CHANNELS
+#else
+#define NUMCHANNELS 128
+#endif
+
+#ifdef ALOG_TIMO
+#define READTIMO ALOG_TIMO
+#else
+#define READTIMO (MAX_MICRO_PERIOD*NUMCHANNELS/500000*hz)
+#endif
+
+#define CDEV_MAJOR 86
+#define NUMPORTS 8
+#define MAXUNITS 2
+#define NUMIMUXES 8
+
+#define ADLOW 0x0
+#define ADHIGH 0x1
+#define STATUS 0x2
+#define CNTR0 0x4
+#define CNTR1 0x5
+#define CNTR2 0x6
+#define CNTRCNTRL 0x7
+
+#define DEVFORMAT "alog%d%c%d"
+#define CLOCK2FREQ 4.165
+#define MIN_MICRO_PERIOD 25
+#define MAX_MICRO_PERIOD (65535/CLOCK2FREQ*PRIMARY_STATES)
+#define DEFAULT_MICRO_PERIOD MAX_MICRO_PERIOD
+#define READMAXTRIG 0.75*FIFOSIZE
+#define ALOGPRI PRIBIO
+#define ALOGMSG "alogio"
+
+#define PRIMARY_STATES 2 /* Setup and conversion are clock tick consuming */
+#define STATE_SETUP 0
+#define STATE_CONVERT 1
+#define STATE_READ 2
+
+/* Notes on interrupt driven A/D conversion:
+ * On the AIO8-P, interrupt driven conversion (the only type supported by this
+ * driver) is facilitated through 8253 timer #2. In order for interrrupts to
+ * be generated you must connect line 6 to line 24 (counter 2 output to
+ * interrupt input) and line 23 to line 29 (counter 2 gate to +5VDC).
+ * Due to the design of the AIO8-P this precludes the use of programmable
+ * gain control.
+ */
+
+/* mode bits for the status register */
+
+#define EOC 0x80
+#define IEN 0x08
+#define IMUXMASK 0x07
+#define EMUXMASK 0xf0
+
+/* mode bits for counter controller */
+
+#define LD2MODE4 0xb8
+
+/* Minor allocations:
+ * UCCCCMMM
+ * U: board unit (0-1)
+ * CCCC: external multiplexer channel (0-15) (on AT-16P units)
+ * MMM: internal multiplexer channel (0-7) (on AIO8-P card)
+ */
+
+#define UNIT(dev) ((minor(dev) & 0x80) >> 7)
+#define CHANNEL(dev) (minor(dev) & 0x7f)
+#define EMUX(chan) ((chan & 0x78) >> 3)
+#define EMUXMAKE(chan) ((chan & 0x78) << 1)
+#define IMUX(chan) (chan & 0x07)
+#define LMINOR(unit, chan) ((unit << 7)+chan)
+
+/* port statuses */
+
+#define STATUS_UNUSED 0
+#define STATUS_INUSE 1
+#define STATUS_STOPPED 2
+#define STATUS_INIT 3
+
+/* Type definitions */
+
+typedef struct
+{
+ short status; /* the status of this chan */
+ struct selinfo readpoll; /* the poll() info */
+ u_short fifo[FIFOSIZE]; /* fifo for this chan */
+ int fifostart, fifoend; /* the ptrs showing where info is stored in fifo */
+ int fifosize, fifotrig; /* the current and trigger size of the fifo */
+ void *devfs_token; /* the devfs token for this chan */
+ int nextchan;
+} talog_chan;
+
+typedef struct
+{
+ struct isa_device *isaunit; /* ptr to isa device information */
+ talog_chan chan[NUMCHANNELS]; /* the device nodes */
+ int curchan; /* the current chan being intr handled */
+ int firstchan; /* the first chan to go to in list */
+ int state; /* is the node in setup or convert mode */
+ long microperiod; /* current microsecond period setting */
+ u_char perlo, perhi; /* current values to send to clock 2 after every intr */
+
+} talog_unit;
+
+/* Function Prototypes */
+
+static int alog_probe (struct isa_device *idp); /* Check for alog board */
+static int alog_attach (struct isa_device *idp); /* Take alog board */
+static int sync_clock2 (int unit, long period); /* setup clock 2 period */
+static int putfifo (talog_chan *pchan, u_short fifoent);
+static int alog_open (dev_t dev, int oflags, int devtype, struct proc *p);
+static int alog_close (dev_t dev, int fflag, int devtype, struct proc *p);
+static int alog_ioctl (dev_t dev, u_long cmd, caddr_t data,
+ int fflag, struct proc *p);
+static int alog_read (dev_t dev, struct uio *uio, int ioflag);
+static int alog_poll (dev_t dev, int events, struct proc *p);
+
+/* Global Data */
+
+static int alog_devsw_installed = 0; /* Protect against reinit multiunit */
+static talog_unit *alog_unit[NALOG]; /* data structs for each unit */
+
+/* Character device switching structure */
+static struct cdevsw alog_cdevsw = { alog_open, alog_close, alog_read,
+ nowrite, alog_ioctl, nostop, noreset,
+ nodevtotty, alog_poll, nommap,
+ nostrategy, "alog", NULL, -1 };
+
+/* Structure expected to tell how to probe and attach the driver
+ * Must be published externally (cannot be static) */
+struct isa_driver alogdriver = { alog_probe, alog_attach, "alog", 0 };
+
+
+/* handle the ioctls */
+static int alog_ioctl (dev_t dev, u_long cmd, caddr_t data,
+ int fflag, struct proc *p)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s;
+
+ switch (cmd)
+ {
+ case FIONBIO: return 0; /* this allows for non-blocking ioctls */
+
+ case AD_NCHANS_GET: *(int *)data = NUMCHANNELS;
+ return 0;
+ case AD_FIFOSIZE_GET: *(int *)data = FIFOSIZE;
+ return 0;
+
+ case AD_FIFO_TRIGGER_GET: s = spltty();
+ *(int *)data = info->chan[chan].fifotrig;
+ splx(s);
+ return 0;
+
+ case AD_FIFO_TRIGGER_SET:
+ s = spltty();
+ if ((*(int *)data < 1) || (*(int *)data > FIFOSIZE))
+ {
+ splx(s);
+ return EPERM;
+ }
+ info->chan[chan].fifotrig = *(int *)data;
+ splx(s);
+ return 0;
+
+ case AD_STOP: s = spltty();
+ info->chan[chan].status = STATUS_STOPPED;
+ splx(s);
+ return 0;
+
+ case AD_START: s = spltty();
+ info->chan[chan].status = STATUS_INUSE;
+ splx(s);
+ return 0;
+
+ case AD_MICRO_PERIOD_SET:
+ s = spltty();
+ if (sync_clock2 (unit, *(long *) data))
+ {
+ splx(s);
+ return EPERM;
+ }
+ splx(s);
+ return 0;
+
+ case AD_MICRO_PERIOD_GET: s = spltty();
+ *(long *)data = info->microperiod;
+ splx(s);
+ return 0;
+
+ }
+
+ return ENOTTY;
+}
+
+
+/* handle poll() based read polling */
+static int alog_poll (dev_t dev, int events, struct proc *p)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s;
+
+ s = spltty();
+ if (events & (POLLIN | POLLRDNORM)) /* if polling for any/normal data */
+ if (info->chan[chan].fifosize >= info->chan[chan].fifotrig)
+ {
+ splx(s);
+
+ return events & (POLLIN | POLLRDNORM); /* ready for any/read */
+ }
+ else
+ {
+ /* record this request */
+ selrecord (p, &(info->chan[chan].readpoll));
+ splx(s);
+ return 0; /* not ready, yet */
+ }
+
+ splx(s);
+ return 0; /* not ready (any I never will be) */
+}
+
+
+/* how to read from the board */
+static int alog_read (dev_t dev, struct uio *uio, int ioflag)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s, oldtrig, toread, err = 0;
+
+ s = spltty();
+
+ oldtrig = info->chan[chan].fifotrig; /* save official trigger value */
+ while (uio->uio_resid >= sizeof(u_short)) /* while uio has space */
+ {
+ if (!info->chan[chan].fifosize) /* if we have an empty fifo */
+ {
+ if (ioflag & IO_NDELAY) /* exit if we are non-blocking */
+ { err = EWOULDBLOCK;
+ break;
+ }
+ /* Start filling fifo on first blocking read */
+ if (info->chan[chan].status == STATUS_INIT)
+ info->chan[chan].status = STATUS_INUSE;
+ /* temporarily adjust the fifo trigger to be optimal size */
+ info->chan[chan].fifotrig =
+ min (READMAXTRIG, uio->uio_resid / sizeof(u_short));
+ /* lets sleep until we have some io available or timeout */
+ err = tsleep (&(info->chan[chan].fifo), ALOGPRI | PCATCH, ALOGMSG,
+ info->chan[chan].fifotrig*READTIMO);
+ if (err == EWOULDBLOCK)
+ { printf (DEVFORMAT ": read timeout\n", unit,
+ 'a'+EMUX(chan), IMUX(chan));
+ }
+ if (err == ERESTART) err = EINTR; /* don't know how to restart */
+ if (err) break; /* exit if any kind of error or signal */
+ }
+
+ /* ok, now if we got here there is something to read from the fifo */
+
+ /* calculate how many entries we can read out from the fifostart
+ * pointer */
+ toread = min (uio->uio_resid / sizeof(u_short),
+ min (info->chan[chan].fifosize,
+ FIFOSIZE - info->chan[chan].fifostart));
+ /* perform the move, if there is an error then exit */
+ if (err = uiomove((caddr_t)
+ &(info->chan[chan].fifo[info->chan[chan].fifostart]),
+ toread * sizeof(u_short), uio)) break;
+ info->chan[chan].fifosize -= toread; /* fifo this much smaller */
+ info->chan[chan].fifostart += toread; /* we got this many more */
+ if (info->chan[chan].fifostart == FIFOSIZE)
+ info->chan[chan].fifostart = 0; /* wrap around fifostart */
+
+ }
+ info->chan[chan].fifotrig = oldtrig; /* restore trigger changes */
+ splx(s);
+ return err;
+}
+
+
+/* open a channel */
+static int alog_open (dev_t dev, int oflags, int devtype, struct proc *p)
+{
+ int unit = UNIT(dev); /* get unit no */
+ int chan = CHANNEL(dev); /* get channel no */
+ talog_unit *info;
+ int s; /* priority */
+ int cur;
+
+ if ((unit >= NALOG) || (unit >= MAXUNITS) || (chan >= NUMCHANNELS))
+ return ENXIO; /* unit and channel no ok ? */
+ if (!alog_unit[unit]) return ENXIO; /* unit attached */
+ info = alog_unit[unit]; /* ok, this is valid now */
+
+ if (info->chan[chan].status) return EBUSY; /* channel busy */
+ if (oflags & FREAD)
+ {
+ s=spltty();
+ info->chan[chan].status = STATUS_INIT; /* channel open, read waiting */
+ info->chan[chan].fifostart = info->chan[chan].fifoend =
+ info->chan[chan].fifosize = 0;/* fifo empty */
+ info->chan[chan].fifotrig = DEFAULT_FIFO_TRIGGER;
+ if (info->firstchan < 0) /* if empty chain */
+ {
+ info->firstchan = info->curchan = chan; /* rev up the list */
+ info->chan[chan].nextchan = -1; /* end of the list */
+ }
+ else /* non empty list must insert */
+ {
+ if (chan < info->firstchan) /* this one must become first in list */
+ {
+ info->chan[chan].nextchan = info->firstchan;
+ info->firstchan = chan;
+ }
+ else /* insert this one as second - last in chan list */
+ {
+ cur = info->firstchan;
+
+ /* traverse list as long as cur is less than chan and cur is
+ * not last in list */
+ while ((info->chan[cur].nextchan < chan) &&
+ (info->chan[cur].nextchan >= 0))
+ cur = info->chan[cur].nextchan;
+
+ /* now cur should point to the entry right before yours */
+ info->chan[chan].nextchan = info->chan[cur].nextchan;
+ info->chan[cur].nextchan = chan; /* insert yours in */
+ }
+ }
+ splx(s);
+ return 0; /* open successful */
+ }
+ return EPERM; /* this is a read only device */
+}
+
+
+/* close a channel */
+static int alog_close (dev_t dev, int fflag, int devtype, struct proc *p)
+{
+ int unit = UNIT(dev);
+ int chan = CHANNEL(dev);
+ talog_unit *info = alog_unit[unit];
+ int s;
+ int cur;
+
+ s = spltty();
+ info->chan[chan].status = STATUS_UNUSED;
+
+ /* what if we are in the middle of a conversion ?
+ * then smoothly get us out of it: */
+ if (info->curchan == chan)
+ { /* if we are last in list set curchan to first in list */
+ if ((info->curchan = info->chan[chan].nextchan) < 0)
+ info->curchan = info->firstchan;
+
+ info->state = STATE_SETUP;
+ }
+
+ /* if this is the first channel, then make the second channel the first
+ * channel (note that if this is also the only channel firstchan becomes
+ * -1 and so the list is marked as empty */
+
+ if (chan == info->firstchan)
+ info->firstchan = info->chan[chan].nextchan;
+ else /* ok, so there must be at least 2 channels (and it is not the first) */
+ {
+ cur = info->firstchan;
+
+ /* find the entry before it (which must exist if you are closing) */
+ while (info->chan[cur].nextchan < chan)
+ cur = info->chan[cur].nextchan;
+ /* at this point we must have the entry before ours */
+ info->chan[cur].nextchan = info->chan[chan].nextchan; /* give our link */
+
+ }
+
+ splx(s);
+
+ return 0; /* close always successful */
+}
+
+
+/* The probing routine - returns number of bytes needed */
+static int alog_probe (struct isa_device *idp)
+{
+ int unit = idp->id_unit; /* this device unit number */
+ int iobase = idp->id_iobase; /* the base address of the unit */
+ int addr;
+
+ if ((unit < 0) || (unit >= NALOG) || (unit >= MAXUNITS))
+ {
+ printf ("alog: invalid unit number (%d)\n", unit);
+ return 0;
+ }
+
+ /* the unit number is ok, lets check if used */
+ if (alog_unit[unit])
+ {
+ printf ("alog: unit (%d) already attached\n", unit);
+ return 0;
+ }
+
+ if (inb (iobase+STATUS) & EOC) return 0; /* End of conv bit should be 0 */
+ for (addr=0; addr<NUMIMUXES; addr++)
+ {
+ outb (iobase+STATUS, EMUXMASK|addr);/* output ones to upper nibbl+addr */
+ /* get back a zero in MSB and the addr where you put it */
+ if ((inb (iobase+STATUS) & (EOC|IMUXMASK)) != addr) return 0;
+ }
+
+ return NUMPORTS; /* this device needs this many ports */
+}
+
+
+/* setup the info structure correctly for reloading clock 2 after interrupt */
+static int sync_clock2 (int unit, long period)
+{
+ int clockper;
+ talog_unit *info = alog_unit[unit];
+
+ if ((period > MAX_MICRO_PERIOD) || (period < MIN_MICRO_PERIOD))
+ return -1; /* error period too long */
+ info->microperiod = period; /* record the period */
+ clockper = (CLOCK2FREQ * period) / PRIMARY_STATES;
+ info->perlo = clockper & 0xff; /* least sig byte of clock period */
+ info->perhi = ((clockper & 0xff00) >> 8); /* most sig byte of clock period */
+ return 0;
+}
+
+
+/* The attachment routine - returns true on success */
+static int alog_attach (struct isa_device *idp)
+{
+ int unit = idp->id_unit; /* this device unit number */
+ int iobase = idp->id_iobase; /* the base address of the unit */
+ talog_unit *info; /* pointer to driver specific info for unit */
+ int chan; /* the channel used for creating devfs nodes */
+
+ if (!(info = malloc(sizeof(*info), M_DEVBUF, M_NOWAIT)))
+ {
+ printf ("alog%d: cannot allocate driver storage\n", unit);
+ return 0;
+ }
+ alog_unit[unit] = info; /* make sure to save the pointer */
+ bzero (info, sizeof(*info)); /* clear info structure to all false */
+ info->isaunit = idp; /* store ptr to isa device information */
+ sync_clock2 (unit, DEFAULT_MICRO_PERIOD); /* setup perlo and perhi */
+ info->firstchan = -1; /* channel lists are empty */
+
+ /* insert devfs nodes */
+
+#ifdef DEVFS
+ for (chan=0; chan<NUMCHANNELS; chan++)
+ info->chan[chan].devfs_token =
+ devfs_add_devswf(&alog_cdevsw, LMINOR(unit, chan), DV_CHR,
+ UID_ROOT, GID_WHEEL, 0400, DEVFORMAT,
+ unit, 'a'+EMUX(chan), IMUX(chan));
+#endif
+
+ printf ("alog%d: %d channels, %d bytes/FIFO, %d entry trigger\n",
+ unit, NUMCHANNELS, FIFOSIZE*sizeof(u_short),
+ DEFAULT_FIFO_TRIGGER);
+ alogintr (unit); /* start the periodic interrupting process */
+ return 1; /* obviously successful */
+}
+
+
+/* Unit interrupt handling routine (interrupts generated by clock 2) */
+void alogintr (int unit)
+{
+ talog_unit *info = alog_unit[unit];
+ int iobase = info->isaunit->id_iobase;
+ u_short fifoent;
+
+
+ if (info->firstchan >= 0) /* ? is there even a chan list to traverse */
+ switch (info->state)
+ {
+ case STATE_READ:
+ if (info->chan[info->curchan].status == STATUS_INUSE)
+ {
+ if (inb (iobase+STATUS) & EOC) /* check that conversion finished */
+ printf (DEVFORMAT ": incomplete conversion\n", unit,
+ 'a'+EMUX(info->curchan), IMUX(info->curchan));
+ else /* conversion is finished (should always be) */
+ {
+ fifoent = (inb (iobase+ADHIGH) << 8) +
+ inb (iobase+ADLOW);
+ if (putfifo(&(info->chan[info->curchan]), fifoent))
+ {
+ printf (DEVFORMAT ": fifo overflow\n", unit,
+ 'a'+EMUX(info->curchan), IMUX(info->curchan));
+ }
+ if (info->chan[info->curchan].fifosize >=
+ info->chan[info->curchan].fifotrig)
+ {
+ /* if we've reached trigger levels */
+ selwakeup (&(info->chan[info->curchan].readpoll));
+ wakeup (&(info->chan[info->curchan].fifo));
+ }
+ }
+ }
+ /* goto setup state for next channel on list */
+ if ((info->curchan = info->chan[info->curchan].nextchan) < 0)
+ info->curchan = info->firstchan;
+ /* notice lack of break here this implys a STATE_SETUP */
+ case STATE_SETUP: /* set the muxes and let them settle */
+#if NUMCHANNELS > NUMIMUXES /* only do this if using external muxes */
+ outb (iobase+STATUS,
+ EMUXMAKE(info->curchan) | IMUX(info->curchan) | IEN);
+ info->state = STATE_CONVERT;
+ break;
+#endif
+ case STATE_CONVERT:
+ outb (iobase+STATUS,
+ EMUXMAKE(info->curchan) | IMUX(info->curchan) | IEN);
+ outb (iobase+ADHIGH, 0); /* start the conversion */
+ info->state = STATE_READ;
+ break;
+ }
+ else /* this is kind of like an idle mode */
+ {
+ outb (iobase+STATUS, IEN); /* no list keep getting interrupts though */
+ /* since we have no open channels spin clock rate down to
+ * minimum to save interrupt overhead */
+ outb (iobase+CNTRCNTRL, LD2MODE4); /* counter 2 to mode 4 strobe */
+ outb (iobase+CNTR2, 0xff); /* longest period we can generate */
+ outb (iobase+CNTR2, 0xff);
+ return;
+ }
+ outb (iobase+CNTRCNTRL, LD2MODE4); /* counter 2 to mode 4 strobe */
+ outb (iobase+CNTR2, info->perlo); /* low part of the period count */
+ outb (iobase+CNTR2, info->perhi); /* high part of the period count */
+}
+
+
+/* this will put an entry in fifo, returns 1 if the first item in
+ * fifo was wiped (overflow) or 0 if everything went fine */
+static int putfifo (talog_chan *pchan, u_short fifoent)
+{
+ pchan->fifo[pchan->fifoend] = fifoent; /* insert the entry in */
+ pchan->fifoend++; /* one more in fifo */
+ if (pchan->fifoend == FIFOSIZE) pchan->fifoend = 0; /* wrap around */
+ /* note: I did intend to write over the oldest entry on overflow */
+ if (pchan->fifosize == FIFOSIZE) /* overflowing state already */
+ {
+ pchan->fifostart++;
+ if (pchan->fifostart == FIFOSIZE) pchan->fifostart = 0;
+ return 1; /* we overflowed */
+ }
+ pchan->fifosize++; /* actually one bigger, else same size */
+ return 0; /* went in just fine */
+}
+
+
+/* Driver initialization */
+static void alog_drvinit (void *unused)
+{
+ dev_t dev; /* Type for holding device major/minor numbers (int) */
+
+ if (!alog_devsw_installed)
+ {
+ dev = makedev (CDEV_MAJOR, 0); /* description of device major */
+ cdevsw_add (&dev, &alog_cdevsw, NULL); /* put driver in cdev table */
+ alog_devsw_installed=1;
+ }
+}
+
+/* System initialization call instance */
+
+SYSINIT (alogdev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR,
+ alog_drvinit,NULL);
+
+#endif
diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c
index 1a801b08fa69f..fe8dba69d73e4 100644
--- a/sys/i386/isa/asc.c
+++ b/sys/i386/isa/asc.c
@@ -34,7 +34,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
- * $Id: asc.c,v 1.31 1998/08/12 18:16:38 bde Exp $
+ * $Id: asc.c,v 1.30 1998/06/07 17:10:13 dfr Exp $
*/
#include "asc.h"
@@ -188,8 +188,6 @@ static int ascprobe (struct isa_device *isdp);
static int ascattach(struct isa_device *isdp);
struct isa_driver ascdriver = { ascprobe, ascattach, "asc" };
-static ointhand2_t ascintr;
-
static d_open_t ascopen;
static d_close_t ascclose;
static d_read_t ascread;
@@ -450,7 +448,6 @@ ascattach(struct isa_device *isdp)
int unit = isdp->id_unit;
struct asc_unit *scu = unittab + unit;
- isdp->id_ointr = ascintr;
scu->flags |= FLAG_DEBUG;
printf("asc%d: [GI1904/Trust Ami-Scan Grey/Color]\n", unit);
@@ -500,7 +497,7 @@ ascattach(struct isa_device *isdp)
*** ascintr
*** the interrupt routine, at the end of DMA...
***/
-static void
+void
ascintr(int unit)
{
struct asc_unit *scu = unittab + unit;
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c
index f475fa5083b83..62c168c8d2d37 100644
--- a/sys/i386/isa/atapi-cd.c
+++ b/sys/i386/isa/atapi-cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.6 1998/12/07 21:58:20 archie Exp $
+ * $Id: atapi-cd.c,v 1.2 1998/10/08 06:41:44 sos Exp $
*/
#include "wdc.h"
@@ -94,6 +94,7 @@ static void acd_done(struct acd *, struct buf *, int, struct atapires);
static int acd_read_toc(struct acd *);
static int acd_request_wait(struct acd *, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, char *, int);
static void acd_describe(struct acd *);
+static int acd_open(dev_t, int, int);
static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char);
static int acd_eject(struct acd *, int);
static void acd_select_slot(struct acd *);
@@ -261,11 +262,11 @@ acd_describe(struct acd *cdp)
printf("acd%d: drive speed ", cdp->lun);
if (cdp->cap.cur_speed != cdp->cap.max_speed)
printf("%d - ", cdp->cap.cur_speed * 1000 / 1024);
- printf("%dKB/sec", cdp->cap.max_speed * 1000 / 1024);
+ printf("%dKb/sec", cdp->cap.max_speed * 1000 / 1024);
if (cdp->cap.buf_size)
- printf(", %dKB cache\n", cdp->cap.buf_size);
+ printf(", %dKb cache\n", cdp->cap.buf_size);
- printf("acd%d: supported read types:", cdp->lun);
+ printf("acd%d: supported read types:", cdp->lun);
comma = 0;
if (cdp->cap.read_cdr) {
printf(" CD-R"); comma = 1;
@@ -442,12 +443,16 @@ acdclose(dev_t dev, int flags, int fmt, struct proc *p)
static int
acdread(dev_t dev, struct uio *uio, int ioflag)
{
+ struct acd *cdp = acdtab[dkunit(dev)];
+
return physio(acdstrategy, NULL, dev, 1, minphys, uio);
}
static int
acdwrite(dev_t dev, struct uio *uio, int ioflag)
{
+ struct acd *cdp = acdtab[dkunit(dev)];
+
return physio(acdstrategy, NULL, dev, 0, minphys, uio);
}
@@ -1147,7 +1152,7 @@ acd_read_toc(struct acd *cdp)
else
printf("%ld:%ld audio ", cdp->info.volsize / 75 / 60,
cdp->info.volsize / 75 % 60);
- printf("(%ld sectors (%ld bytes)), %d tracks\n",
+ printf("(%ld sectors (%d bytes)), %d tracks\n",
cdp->info.volsize, cdp->info.blksize,
cdp->toc.hdr.ending_track - cdp->toc.hdr.starting_track + 1);
}
@@ -1284,6 +1289,7 @@ acd_open_track(struct acd *cdp, struct wormio_prepare_track *ptp)
{
struct write_param param;
struct atapires result;
+ int error;
result = atapi_request_wait(cdp->ata, cdp->unit, ATAPI_MODE_SENSE,
0, 0x05, 0, 0, 0, 0,
@@ -1569,6 +1575,8 @@ static acd_devsw_installed = 0;
static void
acd_drvinit(void *unused)
{
+ dev_t dev;
+
if (!acd_devsw_installed) {
cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &acd_cdevsw);
acd_devsw_installed = 1;
diff --git a/sys/i386/isa/atapi.c b/sys/i386/isa/atapi.c
index 9b3090d8bd203..44cdc4e235017 100644
--- a/sys/i386/isa/atapi.c
+++ b/sys/i386/isa/atapi.c
@@ -88,7 +88,7 @@
* You will need to make at least three routines: open(), close(),
* strategy() and possibly ioctl().
* 2. Make attach() routine, which should allocate all the needed data
- * structures and print the device description string (see xxxattach()).
+ * structures and print the device description string (see wcdattach()).
* 3. Add an appropriate case to the switch in atapi_attach() routine,
* call attach() routine of the new driver here. Add the appropriate
* #include line at the top of attach.c.
@@ -104,6 +104,7 @@
#ifndef ATAPI_MODULE
# include "acd.h"
+# include "wcd.h"
# include "wfd.h"
# include "wst.h"
/* # include "wmd.h" -- add your driver here */
@@ -169,8 +170,11 @@ static int atapi_io (struct atapi *ata, struct atapicmd *ac);
static int atapi_start_cmd (struct atapi *ata, struct atapicmd *ac);
static int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac);
+static void atapi_poll_dsc(struct atapi *ata);
+
extern int wdstart (int ctrlr);
extern int acdattach(struct atapi*, int, struct atapi_params*, int);
+extern int wcdattach(struct atapi*, int, struct atapi_params*, int);
extern int wfdattach(struct atapi*, int, struct atapi_params*, int);
extern int wstattach(struct atapi*, int, struct atapi_params*, int);
@@ -300,9 +304,17 @@ int atapi_attach (int ctlr, int unit, int port)
ata->attached[unit] = 1;
return (1);
#else
+#if NWCD > 0
+ /* ATAPI CD-ROM drives */
+ if (wcdattach (ata, unit, ap, ata->debug) < 0)
+ break;
+ ata->attached[unit] = 1;
+ return (1);
+#else
printf ("wdc%d: ATAPI CD-ROMs not configured\n", ctlr);
break;
#endif
+#endif
case AT_TYPE_TAPE: /* streaming tape */
#if NWST > 0
@@ -368,7 +380,7 @@ static char *cmdname (u_char cmd)
case 0xbd: return ("ATAPI_MECH_STATUS");
case 0xbe: return ("READ_CD");
}
- snprintf (buf, sizeof(buf), "[0x%x]", cmd);
+ sprintf (buf, "[0x%x]", cmd);
return (buf);
}
@@ -652,8 +664,8 @@ int atapi_start_cmd (struct atapi *ata, struct atapicmd *ac)
*/
int atapi_wait_cmd (struct atapi *ata, struct atapicmd *ac)
{
- /* Wait for DRQ from 100 usec to 3 msec for slow devices */
- int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 100;
+ /* Wait for DRQ from 50 usec to 3 msec for slow devices */
+ int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 50;
int ireason = 0, phase = 0;
/* Wait for command phase. */
diff --git a/sys/i386/isa/atapi.h b/sys/i386/isa/atapi.h
index 19733257f93c4..dce85fbc883bd 100644
--- a/sys/i386/isa/atapi.h
+++ b/sys/i386/isa/atapi.h
@@ -226,8 +226,8 @@ struct atapidrv { /* delayed attach info */
};
struct buf;
-struct dmy;
-typedef void atapi_callback_t(struct dmy *, struct buf *, int, struct atapires);
+struct wcd;
+typedef void atapi_callback_t(struct wcd *, struct buf *, int, struct atapires);
struct atapicmd { /* ATAPI command block */
struct atapicmd *next; /* next command in queue */
diff --git a/sys/i386/isa/atkbd_isa.c b/sys/i386/isa/atkbd_isa.c
deleted file mode 100644
index 9cd06297ef712..0000000000000
--- a/sys/i386/isa/atkbd_isa.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: atkbd_isa.c,v 1.1 1999/01/09 02:44:40 yokota Exp $
- */
-
-#include "atkbd.h"
-#include "opt_kbd.h"
-
-#if NATKBD > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/tty.h>
-
-#include <dev/kbd/kbdreg.h>
-#include <dev/kbd/atkbdreg.h>
-
-#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-
-static int atkbdprobe(struct isa_device *dev);
-static int atkbdattach(struct isa_device *dev);
-static ointhand2_t atkbd_isa_intr;
-
-struct isa_driver atkbddriver = {
- atkbdprobe,
- atkbdattach,
- ATKBD_DRIVER_NAME,
- 0,
-};
-
-static int
-atkbdprobe(struct isa_device *dev)
-{
- atkbd_softc_t *sc;
- int error;
-
- sc = atkbd_get_softc(dev->id_unit);
- if (sc == NULL)
- return 0;
-
- /* try to find a keyboard */
- error = atkbd_probe_unit(dev->id_unit, sc, dev->id_iobase,
- dev->id_irq, dev->id_flags);
- if (error)
- return 0;
-
- /* declare our interrupt handler */
- dev->id_ointr = atkbd_isa_intr;
-
- return -1;
-}
-
-static int
-atkbdattach(struct isa_device *dev)
-{
- atkbd_softc_t *sc;
-
- sc = atkbd_get_softc(dev->id_unit);
- if (sc == NULL)
- return 0;
-
- return ((atkbd_attach_unit(dev->id_unit, sc)) ? 0 : 1);
-}
-
-static void
-atkbd_isa_intr(int unit)
-{
- keyboard_t *kbd;
-
- kbd = atkbd_get_softc(unit)->kbd;
- (*kbdsw[kbd->kb_index]->intr)(kbd);
-}
-
-#endif /* NATKBD > 0 */
diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c
new file mode 100644
index 0000000000000..5a9357da471ee
--- /dev/null
+++ b/sys/i386/isa/b004.c
@@ -0,0 +1,669 @@
+/*
+ * FreeBSD device driver for B004-compatible Transputer boards.
+ *
+ * based on Linux version Copyright (C) 1993 by Christoph Niemann
+ *
+ * Rewritten for FreeBSD by
+ * Luigi Rizzo (luigi@iet.unipi.it) and
+ * Lorenzo Vicisano (l.vicisano@iet.unipi.it)
+ * Dipartimento di Ingegneria dell'Informazione
+ * Universita` di Pisa
+ * via Diotisalvi 2, 56126 Pisa, ITALY
+ * 14 september 1994
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christoph Niemann,
+ * Luigi Rizzo and Lorenzo Vicisano - Dipartimento di Ingegneria
+ * dell'Informazione
+ * 4. The names of these contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * NOTE NOTE NOTE
+ * The assembler version is still under development.
+ */
+
+/* #define USE_ASM */
+
+#include "bqu.h"
+#if NBQU > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/uio.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+
+#include "opt_devfs.h"
+
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+
+#include <machine/clock.h>
+
+#include <i386/isa/b004.h>
+#include <i386/isa/isa_device.h>
+
+#define IOCTL_OUT(arg, ret) *(int*)arg = ret
+
+#define B004PRI (PZERO+8)
+
+#define B004_CHANCE 8
+
+/*
+ * Define these symbols if you want to debug the code.
+ */
+#undef B004_DEBUG
+#undef B004_DEBUG_2
+
+#ifdef B004_DEBUG
+static u_char d_inb(u_int port);
+static void d_outb(u_int port, u_char data);
+
+#define out(port,data) d_outb(port, data)
+#define in(a) d_inb(((u_int)a))
+#else
+#define out(port, data) outb(port,data)
+#define in(port) inb(((u_int)port))
+#endif B004_DEBUG
+
+#ifdef B004_DEBUG
+#define DEB(x) x
+#define NO_DEB(x) /* */
+#else
+#define DEB(x) /* */
+#define NO_DEB(x) x
+#endif
+
+#ifdef B004_DEBUG_2
+#define DEB2(x) x
+#else
+#define DEB2(x)
+#endif
+
+static int bquprobe(struct isa_device *idp);
+static int bquattach(struct isa_device *idp);
+
+
+struct isa_driver bqudriver = {
+ bquprobe, bquattach, "bqu"
+};
+
+static d_open_t bquopen;
+static d_close_t bquclose;
+static d_read_t bquread;
+static d_write_t bquwrite;
+static d_ioctl_t bquioctl;
+static d_poll_t bqupoll;
+
+#define CDEV_MAJOR 8
+static struct cdevsw bqu_cdevsw =
+ { bquopen, bquclose, bquread, bquwrite, /*8*/
+ bquioctl, nostop, nullreset, nodevtotty,/* tputer */
+ bqupoll, nommap, NULL, "bqu", NULL, -1 };
+
+static int b004_sleep; /* wait address */
+
+static struct b004_struct b004_table[NBQU];
+
+static int first_time=1;
+
+/*
+ * At these addresses the driver will search for B004-compatible boards
+ */
+static int
+b004_base_addresses[B004_CHANCE] = {
+ /* 0x150, 0x170, 0x190, 0x200, 0x300, 0x320, 0x340, 0x360 */
+ 0x150, 0x190, 0, 0, 0, 0, 0, 0
+};
+
+#ifdef B004_DEBUG
+static void
+d_outb(u_int port, u_char data)
+{
+
+ printf("OUT 0x%x TO 0x%x\n",data,port);
+ outb(port,data);
+}
+
+static u_char
+d_inb(u_int port)
+{
+u_char ap;
+ ap=inb(port);
+ printf("INPUT 0x%x FROM 0x%x\n",ap,port);
+ return(ap);
+}
+#endif
+
+static int
+detected(int base)
+{
+ int i;
+ for(i=0;i<NBQU;i++)
+ if ((B004_F(i) & B004_EXIST) && (B004_BASE(i)==base)) return 1;
+ return (0);
+}
+
+#define b004_delay(a) DELAY(10000)
+
+/*
+ * static void bqureset(): reset transputer network.
+ *
+ */
+
+static void
+bqureset( const int dev_min )
+{
+ DEB(printf("B004 resetting transputer at link %d.\n", dev_min);)
+ out(B004_BASE(dev_min)+B004_ANALYSE_OFFSET, B004_DEASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_DEASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_ASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_DEASSERT_RESET);
+ b004_delay(dev_min);
+
+ DEB(printf("B004 reset done.\n");)
+}
+
+/*
+ * static void bquanalyse(): switch transputer network to analyse mode.
+ *
+ */
+
+static void
+bquanalyse( const int dev_min )
+{
+ DEB(printf("B004 analysing transputer at link %d.\n", dev_min);)
+
+ out(B004_BASE(dev_min) + B004_ANALYSE_OFFSET, B004_DEASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_ANALYSE_OFFSET, B004_ASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_ASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_RESET_OFFSET, B004_DEASSERT_RESET);
+ b004_delay(dev_min);
+
+ out(B004_BASE(dev_min) + B004_ANALYSE_OFFSET, B004_DEASSERT_ANALYSE);
+ b004_delay(dev_min);
+
+ DEB(printf("B004 switching to analyse-mode done.\n");)
+}
+
+
+/****************************************************************************
+ *
+ * int bquread() - read bytes from the link interface.
+ *
+ * At first, the driver checks if the link-interface is ready to send a byte
+ * to the PC. If not, this check is repeated up to B004_MAXTRY times.
+ * If the link-interface is not ready after this loop, the driver sleeps for
+ * an NO=1 ticks and then checks the link-interface again.
+ * If the interface is still not ready, repeats as above incrementing NO.
+ * Once almost one byte is read N0 is set to 1.
+ * If B004_TIMEOUT != 0 and the link-interface is not ready for more than
+ * B004_TIMEOUT ticks read aborts returnig with the number of bytes read
+ * or with an error if no byte was read.
+ *
+ * By default, B004_TIMEOUT is = 0 (read is blocking)
+ *
+ *****************************************************************************/
+
+static int
+bquread(dev_t dev, struct uio *uio, int flag)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ int timeout=B004_TIMEOUT(dev_min);
+ int Timeout=timeout;
+ int idr=B004_IDR(dev_min);
+ int isr=B004_ISR(dev_min);
+ char buffer[B004_MAX_BYTES];
+
+ if ( uio->uio_resid < 0) {
+ DEB(printf("B004: invalid count for reading = %d.\n", uio->uio_resid);)
+ return EINVAL;
+ }
+
+ while ( uio->uio_resid ) {
+ int sleep_ticks=0;
+ char *p, *last, *lim;
+ int i, end = min(B004_MAX_BYTES,uio->uio_resid);
+ lim= &buffer[end];
+ for (p= buffer; p<lim;) {
+ last=p;
+ /*** try to read as much as possible ***/
+#ifdef USE_ASM
+ /* assembly code uses a very tight loop, with
+ * BX= data port, DX= address port, CX=count, ES:DI=p, AL=data, AH=1
+ * SI=retry counter
+ */
+ __asm__ (
+ "movl %1, %%edx\n\t" /* isr */
+ "movl %2, %%ebx\n\t" /* idr */
+ "movl %3, %%edi\n" /* p */
+ "movl %4, %%ecx\n\t" /* lim */
+ "subl %%edi, %%ecx\n\t"
+
+ "push %%es\n\t"
+ "movw %%ss, %%ax\n\t" /** prepare ES, DF for transfer */
+ "movw %%ax, %%es\n\t"
+ "cld\n\t"
+ "movb $1, %%ah\n\t"
+
+ "1:\tinb %%dx, %%al\n\t"
+ "testb %%ah, %%al\n\t"
+ "jz 2f\n\t"
+ "xchgl %%edx, %%ebx\n\t"
+ "insb\n\t"
+ "xchgl %%edx, %%ebx\n"
+ "2:\tloop 1b\n\t"
+
+ "pop %%es\n\t"
+ "movl %%edi, %0\n\t" /* store p */
+ : /* out */ "=g" (p)
+ : /* in */ "g" (isr), "g" (idr), "g" (p), "g" (lim)
+ : /* regs */ "eax", "ebx", "edx", "ecx", "edi");
+#else
+ for (i=lim - p; i-- ;)
+ if (inb(isr)&B004_READBYTE) *p++ =(char) inb(idr);
+#endif
+ if (last!=p) {
+ sleep_ticks = 0;
+ } else {
+ /*** no new data read, must sleep ***/
+ sleep_ticks= (sleep_ticks<20 ? sleep_ticks+1 : sleep_ticks);
+ if (Timeout) {
+ if (timeout <=0) {
+ DEB2(printf("Read : TIMEOUT OCCURRED XXXXXXXXXXX\n");)
+ break;
+ }
+ if (timeout < sleep_ticks) sleep_ticks=timeout;
+ timeout -= sleep_ticks;
+ }
+ DEB2(printf("Read: SLEEPING FOR %d TICKS XXXXX\n",sleep_ticks);)
+ if (tsleep((caddr_t)&b004_sleep, B004PRI | PCATCH,
+ "b004_rd", sleep_ticks)!=EWOULDBLOCK) return 1;
+ }
+ }
+ if (p != buffer) {
+ uiomove((caddr_t)buffer, p - buffer, uio);
+ }
+ if( (Timeout) && (timeout <= 0) )
+ break;
+ }
+ return 0;
+} /* bquread() */
+
+
+/*
+ * int bquwrite() - write to the link interface.
+ */
+
+static int
+bquwrite(dev_t dev, struct uio *uio, int flag)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ int i, end;
+ int timeout=B004_TIMEOUT(dev_min);
+ int Timeout=timeout;
+ int odr=B004_ODR(dev_min);
+ int osr=B004_OSR(dev_min);
+ char buffer[B004_MAX_BYTES];
+
+ if ( uio->uio_resid < 0) {
+ DEB(printf("B004 invalid argument for writing: count = %d.\n", uio->uio_resid);)
+ return EINVAL;
+ }
+
+ while ( uio->uio_resid ) {
+ int sleep_ticks=0;
+ char *p, *last, *lim;
+ end = min(B004_MAX_BYTES,uio->uio_resid);
+ uiomove((caddr_t)buffer, end, uio);
+
+ lim= &buffer[end];
+ for (p= &buffer[0]; p<lim;) {
+ last=p;
+#ifdef USE_ASM
+ /* assembly code uses a very tight loop, with
+ * BX= data port, DX= address port, CX=count, DS:SI=p, AL=data, AH=1
+ * DI= retry counter
+ * Unfortunately, C is almost as fast as this!
+ */
+ __asm__ (
+ "movl %1, %%edx\n\t" /* osr */
+ "movl %2, %%ebx\n\t" /* odr */
+ "movl %3, %%esi\n" /* p */
+ "movl %4, %%ecx\n\t" /* lim */
+ "subl %%esi, %%ecx\n\t"
+
+ "push %%ds\n\t"
+ "movw %%ss, %%ax\n\t" /** prepare DS, DF for transfer */
+ "movw %%ax, %%ds\n\t"
+ "cld\n\t"
+ "movb $1, %%ah\n\t"
+ "movw $100, %%di\n\t"
+
+ "1:\tinb %%dx, %%al\n\t"
+ "testb %%ah, %%al\n\t"
+ "jz 2f\n\t"
+ "xchgl %%edx, %%ebx\n\t"
+ "outsb\n\t"
+ "xchgl %%edx, %%ebx\n\t"
+ "loop 1b\n\t"
+ "jmp 3f\n"
+
+ "2:\tdec %%di\n\t"
+ "jnc 1b\n\t"
+
+ "3:\tpop %%ds\n"
+ "movl %%esi, %0\n\t" /* store p */
+ : /* out */ "=g" (p)
+ : /* in */ "g" (osr), "g" (odr), "g" (p), "g" (lim)
+ : /* regs */ "eax", "ebx", "edx", "ecx", "esi", "edi");
+#else
+ for (i=lim - p; i-- ; ) {
+ if (inb(osr)&B004_WRITEBYTE) outb(odr, *p++);
+ }
+#endif
+ if (p != last ) {
+ sleep_ticks=0;
+ } else {
+ sleep_ticks= (sleep_ticks<20 ? sleep_ticks+1 : sleep_ticks);
+ if (Timeout) {
+ if (timeout <=0) {
+ DEB2(printf("Write : TIMEOUT OCCURRED XXXXXXXXXXX\n");)
+ uio->uio_resid += (lim - p);
+ break;
+ }
+ if (timeout < sleep_ticks) sleep_ticks=timeout;
+ timeout -= sleep_ticks;
+ }
+ DEB2(printf("Write: SLEEPING FOR %d TICKS XXXXXXX\n",sleep_ticks);)
+ if (tsleep((caddr_t)&b004_sleep, B004PRI | PCATCH,
+ "b004_rd", sleep_ticks)!=EWOULDBLOCK) return 1;
+ }
+ }
+ if( (Timeout) && (timeout <= 0) )
+ break;
+ }
+ return 0;
+} /* bquwrite() */
+
+/*
+ * int bquopen() -- open the link-device.
+ *
+ */
+
+static int
+bquopen(dev_t dev, int flags, int fmt, struct proc *p)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ if (dev_min >= NBQU) {
+ DEB(printf("B004 not opened, minor number >= %d.\n", NBQU);)
+ return ENXIO;
+ }
+ if ((B004_F(dev_min) & B004_EXIST) == 0) {
+ DEB(printf("B004 not opened, board %d does not exist.\n", dev_min);)
+ return ENXIO;
+ }
+ if (B004_F(dev_min) & B004_BUSY) {
+ DEB(printf("B004 not opened, board busy (minor = %d).\n", dev_min);)
+ return EBUSY;
+ }
+ B004_F(dev_min) |= B004_BUSY;
+ B004_TIMEOUT(dev_min) = 0;
+ DEB(printf( "B004 opened, minor = %d.\n", dev_min );)
+ return 0;
+} /* bquopen() */
+
+
+/*
+ * int b004close() -- close the link device.
+ */
+
+static int
+bquclose(dev_t dev, int flags, int fmt, struct proc *p)
+{
+ unsigned int dev_min = minor(dev) & 7;
+
+ if (dev_min >= NBQU) {
+ DEB(printf("B004 not released, minor number >= %d.\n", NBQU);)
+ return ENXIO;
+ }
+ B004_F(dev_min) &= ~B004_BUSY;
+ DEB(printf("B004(%d) released.\n", dev_min );)
+ return 0;
+}
+
+static int
+bqupoll(dev_t dev, int events, struct proc *p)
+{
+ /* still unimplemented */
+ return(seltrue(dev, events, p));
+}
+
+/*
+ * int bquioctl()
+ *
+ * Supported functions:
+ * - reset
+ * - analyse
+ * - test error flag
+ * - set timeout
+ */
+
+static int
+bquioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
+{
+ unsigned int dev_min = minor(dev) & 7;
+ int result = 0;
+
+ if (dev_min >= NBQU) {
+ DEB(printf("B004 ioctl exit, minor >= %d.\n", NBQU );)
+ return ENODEV;
+ }
+
+ if ((B004_F(dev_min) & B004_EXIST) == 0) {
+ DEB(printf("B004 ioctl exit, (B004_F & B004_EXIST) == 0.\n" );)
+ return ENODEV;
+ }
+
+ switch ( cmd ) {
+ case B004RESET: /* reset transputer */
+ bqureset(dev_min);
+ DEB(printf("B004 ioctl B004RESET, done\n" );)
+ break;
+ case B004WRITEABLE: /* can we write a byte to the C012 ? */
+ IOCTL_OUT (addr, ((in(B004_OSR(dev_min))&B004_WRITEBYTE) != 0 ));
+ break;
+ case B004READABLE: /* can we read a byte from C012 ? */
+ IOCTL_OUT (addr, ((in(B004_ISR(dev_min)) & B004_READBYTE) != 0 ));
+ break;
+ case B004ANALYSE: /* switch transputer to analyse mode */
+ bquanalyse(dev_min);
+ break;
+ case B004ERROR: /* test error-flag */
+ IOCTL_OUT (addr,
+ ((inb(B004_BASE(dev_min)+B004_ERROR_OFFSET) &
+ B004_TEST_ERROR) ? 0 : 1));
+ break;
+ case B004TIMEOUT: /* set, retrieve timeout for writing & reading*/
+ B004_TIMEOUT(dev_min) = *((int *)addr);
+ break;
+ default: result = EINVAL;
+ }
+ return result;
+} /* bquioctl() */
+
+
+static int
+bquattach(struct isa_device *idp)
+{
+ int unit = idp->id_unit;
+ struct b004_struct *bp;
+ int i;
+
+#ifdef DEVFS
+#define BQU_UID 66
+#define BQU_GID 66
+#define BQU_PERM 0600
+ bp = &b004_table[unit];
+ for ( i = 0; i < 8; i++) {
+#ifdef NOTYET
+ /* if (we've done all the ports found) break; */
+#endif
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttyba%d", i);
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i+64, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttybb%d", i);
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i+128, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttybc%d", i);
+ bp->devfs_token[i][0]=
+ devfs_add_devswf(&bqu_cdevsw, i+192, DV_CHR, BQU_UID,
+ BQU_GID, BQU_PERM, "ttybd%d", unit);
+ }
+#endif
+ return 1;
+}
+
+/*
+ * int bquprobe
+ *
+ * Initializes the driver. It tries to detect the hardware
+ * and sets up all relevant data-structures.
+ */
+
+static int
+bquprobe(struct isa_device *idp)
+{
+ unsigned int test;
+ unsigned int dev_min = idp->id_unit;
+ int i,found = 0;
+ /* After a reset it should be possible to write a byte to
+ the B004. So let'S do a reset and then test the output status
+ register
+ */
+#ifdef undef
+ printf(
+ "bquprobe::\nIOBASE 0x%x\nIRQ %d\nDRQ %d\nMSIZE %d\nUNIT %d\nFLAGS"
+ "x0%x\nALIVE %d\n",idp->id_iobase,idp->id_irq,
+ idp->id_drq,idp->id_msize,idp->id_unit,idp->id_flags,idp->id_alive);
+#endif
+ if(first_time){
+ for(i=0;i<NBQU;i++) B004_F(i) &= ~B004_EXIST;
+ first_time=0;
+ }
+
+ if(dev_min >= NBQU) return (0); /* No more descriptors */
+ if ((idp->id_iobase < 0x100) || (idp->id_iobase >= 0x1000))
+ idp->id_iobase=0; /* Dangerous isa addres ) */
+
+ for (test = 0; (test < B004_CHANCE); test++) {
+ if((idp->id_iobase==0)&&((!b004_base_addresses[test])||
+ detected(b004_base_addresses[test])))
+ continue;
+ idp->id_iobase=b004_base_addresses[test];
+
+ DEB(printf("Probing device %d at address 0x%x\n",dev_min,
+ idp->id_iobase);
+ )
+ b004_delay(test);
+ B004_F(dev_min) = 0;
+ B004_TIMEOUT(dev_min) = B004_INIT_TIMEOUT;
+ B004_BASE(dev_min) = idp->id_iobase;
+ B004_ODR(dev_min) = B004_BASE(dev_min) + B004_ODR_OFFSET;
+ B004_ISR(dev_min) = B004_BASE(dev_min) + B004_ISR_OFFSET;
+ B004_OSR(dev_min) = B004_BASE(dev_min) + B004_OSR_OFFSET;
+ bqureset(dev_min);
+
+ for (i = 0; i < B004_MAXTRY; i++)
+ if ( in(B004_OSR(dev_min)) == B004_WRITEBYTE) {
+ B004_F(dev_min) |= B004_EXIST;
+ out(B004_BASE(dev_min) + B008_INT_OFFSET, 0);
+ b004_delay(test);
+ if (in(B004_BASE(dev_min) + B008_INT_OFFSET) & 0x0f == 0)
+ B004_BOARDTYPE(dev_min) = B008;
+ else
+ B004_BOARDTYPE(dev_min) = B004;
+ printf("bqu%d at 0x0%x (polling) is a B00%s\n",
+ dev_min,B004_IDR(dev_min),
+ (B004_BOARDTYPE(dev_min) == B004) ? "4" : "8");
+ found = 1;
+ break;
+ }
+ if(!found) {
+ idp->id_iobase=0;
+ }
+ else break;
+
+ }
+
+ if (!found){
+ DEB(printf("b004probe(): no B004-board found.\n"));
+ return (0);
+ }
+
+ idp->id_maddr=NULL;
+ idp->id_irq=0;
+ if(B004_BOARDTYPE(dev_min) == B004)
+ return(18);
+ else
+ return(20);
+} /* bquprobe() */
+
+
+static bqu_devsw_installed = 0;
+
+static void
+bqu_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! bqu_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev,&bqu_cdevsw, NULL);
+ bqu_devsw_installed = 1;
+ }
+}
+
+SYSINIT(bqudev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bqu_drvinit,NULL)
+
+
+#endif /* NBQU */
diff --git a/sys/i386/isa/b004.h b/sys/i386/isa/b004.h
new file mode 100644
index 0000000000000..8ae161f025277
--- /dev/null
+++ b/sys/i386/isa/b004.h
@@ -0,0 +1,154 @@
+/*
+ * b004.h
+ *
+ * Based on the Linux driver, by
+ * Christoph Niemann (niemann@swt.ruhr-uni-bochum.de)
+ *
+ * Ported to FreeBSD by Luigi Rizzo (luigi@iet.unipi.it)
+ * and Lorenzo Vicisano (l.vicisano@iet.unipi.it)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christoph Niemann,
+ * Luigi Rizzo and Lorenzo Vicisano - Dipartimento di Ingegneria
+ * dell'Informazione
+ * 4. The names of these contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Works for FreeBSD 1.1.5
+ */
+
+#ifndef _I386_ISA_B004_H_
+#define _I386_ISA_B004_H_
+
+#include <sys/ioccom.h>
+
+/*
+ * device status FLAGS
+ */
+#define B004_EXIST 0x0001 /* Is a B004-Board with at least one
+ Transputer present ? */
+#define B004_BUSY 0x0002 /* Is the B004-board in use ? */
+
+/*
+ * IOCTL numbers
+ */
+#define B004RESET _IO ('Q', 0)
+ /* Reset transputer(s) */
+#define B004WRITEABLE _IOR ('Q', 1, int)
+ /* Return C012 Output Ready */
+#define B004READABLE _IOR ('Q', 2, int)
+ /* Return C012 Data Present */
+#define B004ANALYSE _IO ('Q', 3)
+ /* Switch transputer(s) to ANALYSE mode */
+#define B004ERROR _IOR ('Q', 4, int)
+ /* Return 1 on ERROR set */
+#define B004TIMEOUT _IOW ('Q', 5, int)
+ /* Set TIMEOUT for subsequent writing or
+ reading call, value in ticks, initial
+ 0 = no timeout (read/write blocking)
+ "open" sets timeout to 0 */
+
+
+#define B004_INIT_TIMEOUT 0 /* No timeout yet */
+
+/*
+ * Registers DISPLACEMENT
+ */
+#define B004_IDR_OFFSET 0 /* Input Data Register */
+#define B004_ODR_OFFSET 1 /* Output Data Register */
+#define B004_ISR_OFFSET 2 /* Input Status Register */
+#define B004_OSR_OFFSET 3 /* Output Status Register */
+#define B004_RESET_OFFSET 16 /* Reset/Error Register */
+#define B004_ERROR_OFFSET B004_RESET_OFFSET
+#define B004_ANALYSE_OFFSET 17 /* Analyse Register */
+#define B008_DMA_OFFSET 18 /* B008: DMA request register */
+#define B008_INT_OFFSET 19 /* B008: Interrupt control reg */
+
+struct b004_struct {
+ int flags; /* various flags */
+ int idr; /* address of the input data register */
+ int odr; /* address if the output data register */
+ int isr; /* address of the input status register */
+ int osr; /* address of the output status register */
+ unsigned int timeout; /* timeout for writing/reading the link */
+ int boardtype; /* what kind of board is installed */
+ void *devfs_token[8][4]; /* tokens for 4 types for 8 ports */
+};
+
+/*
+ * Id's for the supported boards
+ */
+#define B004 1
+#define B008 2
+
+/*
+ * Defines for easier access to the b004_table.
+ */
+#define B004_F(minor) b004_table[minor].flags
+#define B004_TIMEOUT(minor) b004_table[minor].timeout
+#define B004_BASE(minor) B004_IDR(minor)
+#define B004_IDR(minor) b004_table[minor].idr
+#define B004_ODR(minor) b004_table[minor].odr
+#define B004_ISR(minor) b004_table[minor].isr
+#define B004_OSR(minor) b004_table[minor].osr
+#define B004_WAIT(minor) b004_table[minor].wait
+#define B004_BOARDTYPE(minor) b004_table[minor].boardtype
+
+/*
+ * Additional defines for B008-boards
+ */
+#define B008_DMA(minor) b004_table[minor].int
+#define B008_INT(minor) b004_table[minor].dma
+
+/*
+ * Number of tries to access isr or osr before reading or writing sleeps
+ */
+#define B004_MAXTRY 200
+
+/*
+ * Maximum number of bytes to transfer at once
+ */
+#define B004_MAX_BYTES 2048
+
+/*
+ * bit defines for C012 status ports at base + 2/3
+ * accessed with B004_IS, B004_OS, which gets the byte...
+ */
+#define B004_READBYTE 1
+#define B004_WRITEBYTE 1
+
+/*
+ * bit defines for C012 reset/error port at base + 16
+ */
+#define B004_ASSERT_RESET 0x01 /* resetting the transputer */
+#define B004_DEASSERT_RESET 0x00
+#define B004_TEST_ERROR 0x01 /* for testing the transputer's error flag */
+
+/*
+ * bit defines for C012 analyse port at base + 17
+ */
+#define B004_ASSERT_ANALYSE 0x01 /* switch transputer to analyse-mode */
+#define B004_DEASSERT_ANALYSE 0x00
+
+#endif /* !_I386_ISA_B004_H_ */
diff --git a/sys/i386/isa/bs/bs.c b/sys/i386/isa/bs/bs.c
index 1f93746404328..fc543851f09da 100644
--- a/sys/i386/isa/bs/bs.c
+++ b/sys/i386/isa/bs/bs.c
@@ -39,30 +39,21 @@
#include <i386/isa/bs/bsif.h>
#endif
-#include <cam/cam.h>
-#include <cam/cam_ccb.h>
-#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
-#include <cam/cam_debug.h>
-
-#include <cam/scsi/scsi_all.h>
-#include <cam/scsi/scsi_message.h>
-
/*****************************************************************
* Inline phase funcs
*****************************************************************/
/* static inline declare */
static BS_INLINE struct targ_info *bs_reselect __P((struct bs_softc *));
-static BS_INLINE void bs_sat_continue __P((struct bs_softc *, struct targ_info *, struct bsccb *));
-static BS_INLINE struct targ_info *bs_selected __P((struct bs_softc *, struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_sat_continue __P((struct bs_softc *, struct targ_info *, struct ccb *));
+static BS_INLINE struct targ_info *bs_selected __P((struct bs_softc *, struct targ_info *, struct ccb *));
static BS_INLINE u_int8_t bs_read_1byte __P((struct bs_softc *));
static BS_INLINE void bs_write_1byte __P((struct bs_softc *, u_int8_t));
-static BS_INLINE void bs_commandout __P((struct bs_softc *, struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_commandout __P((struct bs_softc *, struct targ_info *, struct ccb *));
static BS_INLINE void bs_status_check __P((struct bs_softc *, struct targ_info *));
static BS_INLINE void bs_msgin __P((struct bs_softc *, struct targ_info *));
-static BS_INLINE void bs_msgout __P((struct bs_softc *, struct targ_info *, struct bsccb *));
-static BS_INLINE void bs_disconnect_phase __P((struct bs_softc *, struct targ_info *, struct bsccb *));
-static void bs_phase_error __P((struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_msgout __P((struct bs_softc *, struct targ_info *, struct ccb *));
+static BS_INLINE void bs_disconnect_phase __P((struct bs_softc *, struct targ_info *, struct ccb *));
+static void bs_phase_error __P((struct targ_info *, struct ccb *));
static int bs_scsi_cmd_poll_internal __P((struct targ_info *));
static int bs_xfer __P((struct bs_softc *, char *, int));
static void bs_io_xfer __P((struct targ_info *));
@@ -73,153 +64,99 @@ static void bs_msg_reject __P((struct targ_info *));
static void bshoststart __P((struct bs_softc *, struct targ_info *));
/*****************************************************************
- * SIM interface
+ * Julian scsi interface
*****************************************************************/
-void
-bs_scsi_cmd(struct cam_sim *sim, union ccb *ccb)
+XSBS_INT32T
+bs_scsi_cmd(xs)
+ struct scsi_xfer *xs;
{
- struct bs_softc *bsc = (struct bs_softc *) cam_sim_softc(sim);
- int s, target = (u_int) (ccb->ccb_h.target_id);
+ struct bs_softc *bsc = (struct bs_softc *) xs->sc_link->adapter_softc;
+ int s, target = (u_int) (xs->sc_link->target);
struct targ_info *ti;
- struct bsccb *cb;
-
- switch (ccb->ccb_h.func_code) {
- case XPT_SCSI_IO: /* Execute the requested I/O operation */
- ti = bsc->sc_ti[target];
- if ((cb = bs_get_ccb()) == NULL) {
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
- xpt_done(ccb);
- return;
+ struct ccb *cb;
+ u_int flags = xs->flags;
+
+ if (xs->bp == NULL && (bsc->sc_openf & (1 << target)) == 0)
+ {
+ s = splbio();
+ xs->error = XS_DRIVER_STUFFUP;
+ xs->flags |= XSBS_ITSDONE;
+ scsi_done(xs);
+ splx(s);
+ return COMPLETE;
+ }
+
+ ti = bsc->sc_ti[target];
+ if ((cb = bs_get_ccb(flags & XSBS_SCSI_NOSLEEP)) == NULL)
+ return TRY_AGAIN_LATER;
+
+ /* make up ccb! */
+ cb->xs = xs;
+ cb->lun = xs->sc_link->lun;
+ cb->cmd = (u_int8_t *) xs->cmd;
+ cb->cmdlen = (int) xs->cmdlen;
+ cb->data = (u_int8_t *) xs->data;
+ cb->datalen = (int) xs->datalen;
+ cb->rcnt = 0;
+ cb->msgoutlen = 0;
+ cb->flags = (flags & XSBS_SCSI_POLL) ? BSFORCEIOPOLL : 0;
+ bs_targ_flags(ti, cb);
+ cb->tcmax = (xs->timeout >> 10);
+ if (cb->tcmax < BS_DEFAULT_TIMEOUT_SECOND)
+ cb->tcmax = BS_DEFAULT_TIMEOUT_SECOND;
+
+#ifdef BS_ADDRESS_CHECK
+ /* XXX:
+ * Sanity check, however this is critical!
+ * NetBSD 1.0: WRONG
+ * NetBSD 1.1: OK
+ * FreeBSD: WRONG
+ */
+ if ((caddr_t) cb->data < (caddr_t) KERNBASE)
+ {
+ u_int8_t *altbp;
+
+ altbp = (u_int8_t *) malloc(cb->datalen, M_DEVBUF, M_NOWAIT);
+ if (altbp == NULL)
+ {
+ bs_free_ccb(cb);
+ return TRY_AGAIN_LATER;
}
- /* make up ccb! */
- cb->ccb = ccb;
- cb->lun = ccb->ccb_h.target_lun;
- cb->cmd = ccb->csio.cdb_io.cdb_bytes;
- cb->cmdlen = (int) ccb->csio.cdb_len;
- cb->data = ccb->csio.data_ptr;
- cb->datalen = (int) ccb->csio.dxfer_len;
- cb->rcnt = 0;
- cb->msgoutlen = 0;
- cb->bsccb_flags = 0;
- bs_targ_flags(ti, cb);
- cb->tcmax = 0;/*(xs->timeout >> 10); default HN2*/
- if (cb->tcmax < BS_DEFAULT_TIMEOUT_SECOND)
- cb->tcmax = BS_DEFAULT_TIMEOUT_SECOND;
+ if (flags & SCSI_DATA_OUT)
+ bcopy(cb->data, altbp, cb->datalen);
+ else
+ bzero(altbp, cb->datalen);
- s = splbio();
+ cb->data = (u_int8_t *) altbp;
+ cb->flags |= BSALTBUF;
+ }
+#endif /* BS_ADDRESS_CHECK */
+
+ s = splbio();
- TAILQ_INSERT_TAIL(&ti->ti_ctab, cb, ccb_chain);
+ TAILQ_INSERT_TAIL(&ti->ti_ctab, cb, ccb_chain);
- if (ti->ti_phase == FREE) {
- if (ti->ti_state == BS_TARG_START)
+ if (ti->ti_phase == FREE)
+ {
+ if (ti->ti_state == BS_TARG_START)
+ {
+ if ((flags & XSBS_SCSI_POLL) == 0)
bs_start_syncmsg(ti, NULL, BS_SYNCMSG_ASSERT);
- bscmdstart(ti, BSCMDSTART);
}
+ bscmdstart(ti, BSCMDSTART);
+ }
+ if ((flags & XSBS_SCSI_POLL) == 0)
+ {
splx(s);
- break;
- case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */
- case XPT_EN_LUN: /* Enable LUN as a target */
- case XPT_TARGET_IO: /* Execute target I/O request */
- case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */
- case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/
- case XPT_ABORT: /* Abort the specified CCB */
- /* XXX Implement */
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- break;
- case XPT_SET_TRAN_SETTINGS:
- /* XXX Implement */
- ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
- xpt_done(ccb);
- break;
- case XPT_GET_TRAN_SETTINGS: {
- struct ccb_trans_settings *cts;
- struct targ_info *ti;
- /*int s;*/
-
- cts = &ccb->cts;
- ti = bsc->sc_ti[ccb->ccb_h.target_id];
- /*s = splcam();*/
- if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
- if (ti->ti_cfgflags & BS_SCSI_DISC)
- cts->flags = CCB_TRANS_DISC_ENB;
- else
- cts->flags = 0;
- if (ti->ti_cfgflags & BS_SCSI_QTAG)
- cts->flags |= CCB_TRANS_TAG_ENB;
- cts->sync_period = ti->ti_syncnow.period;
- cts->sync_offset = ti->ti_syncnow.offset;
- cts->bus_width = 0;/*HN2*/
-
- cts->valid = CCB_TRANS_SYNC_RATE_VALID
- | CCB_TRANS_SYNC_OFFSET_VALID
- | CCB_TRANS_BUS_WIDTH_VALID
- | CCB_TRANS_DISC_VALID
- | CCB_TRANS_TQ_VALID;
- ccb->ccb_h.status = CAM_REQ_CMP;
- } else
- ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-
- /*splx(s);*/
- xpt_done(ccb);
- break;
- }
- case XPT_CALC_GEOMETRY: { /* not yet HN2 */
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
-
- ccg = &ccb->ccg;
- size_mb = ccg->volume_size
- / ((1024L * 1024L) / ccg->block_size);
-
- ccg->heads = 8;
- ccg->secs_per_track = 34;
-
- secs_per_cylinder = ccg->heads * ccg->secs_per_track;
- ccg->cylinders = ccg->volume_size / secs_per_cylinder;
- ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_done(ccb);
- break;
- }
- case XPT_RESET_BUS: /* Reset the specified SCSI bus */
- bshw_chip_reset(bsc); /* XXX need perfect RESET? */
- ccb->ccb_h.status = CAM_REQ_CMP;
- xpt_done(ccb);
- break;
- case XPT_TERM_IO: /* Terminate the I/O process */
- /* XXX Implement */
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- break;
- case XPT_PATH_INQ: { /* Path routing inquiry */
- struct ccb_pathinq *cpi = &ccb->cpi;
-
- cpi->version_num = 1; /* XXX??? */
- cpi->hba_inquiry = PI_SDTR_ABLE;
- cpi->target_sprt = 0;
- cpi->hba_misc = 0;
- cpi->hba_eng_cnt = 0;
- cpi->max_target = NTARGETS - 1;
- cpi->max_lun = 7;
- cpi->initiator_id = bsc->sc_hostid;
- cpi->bus_id = cam_sim_bus(sim);
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "NEC", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
- cpi->unit_number = cam_sim_unit(sim);
- cpi->ccb_h.status = CAM_REQ_CMP;
- xpt_done(ccb);
- break;
- }
- default:
-/*printf("bs: non support func_code = %d ", ccb->ccb_h.func_code);*/
- ccb->ccb_h.status = CAM_REQ_INVALID;
- xpt_done(ccb);
- break;
+ return SUCCESSFULLY_QUEUED;
}
+
+ bs_scsi_cmd_poll(ti, cb);
+ splx(s);
+
+ return COMPLETE;
}
/**************************************************
@@ -233,7 +170,7 @@ bscmdstart(ti, flags)
struct targ_info *ti;
int flags;
{
- struct bsccb *cb;
+ struct ccb *cb;
struct bs_softc *bsc = ti->ti_bsc;
if ((cb = ti->ti_ctab.tqh_first) == NULL)
@@ -249,9 +186,9 @@ bscmdstart(ti, flags)
ti->ti_scsp.datalen = cb->datalen;
ti->ti_scsp.seglen = 0;
if (cb->rcnt)
- cb->bsccb_flags &= ~(BSSAT | BSLINK);
+ cb->flags &= ~(BSSAT | BSLINK);
ti->ti_flags &= ~BSCFLAGSMASK;
- ti->ti_flags |= cb->bsccb_flags & BSCFLAGSMASK;
+ ti->ti_flags |= cb->flags & BSCFLAGSMASK;
cb->tc = cb->tcmax;
/* GO GO */
@@ -274,13 +211,13 @@ bscmdstart(ti, flags)
return 1;
}
-struct bsccb *
+struct ccb *
bscmddone(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
- union ccb *ccb;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
+ struct scsi_xfer *xs;
int error;
if (ti->ti_state == BS_TARG_SYNCH)
@@ -296,12 +233,12 @@ bscmddone(ti)
do
{
- ccb = cb->ccb;
- error = CAM_REQ_CMP;
+ xs = cb->xs;
+ error = XS_NOERROR;
- if (cb->bsccb_flags & (BSITSDONE | BSSENSECCB | BSCASTAT))
+ if (cb->flags & (BSITSDONE | BSSENSECCB | BSCASTAT))
{
- if (cb->bsccb_flags & BSSENSECCB)
+ if (cb->flags & BSSENSECCB)
{
cb->error &= ~BSDMAABNORMAL;
if (cb->error == 0)
@@ -309,17 +246,18 @@ bscmddone(ti)
ti->ti_flags |= BSERROROK;
}
- else if (cb->bsccb_flags & BSCASTAT)
+ else if (cb->flags & BSCASTAT)
{
if (ti->ti_flags & BSCASTAT)
{
ti->ti_flags &= ~BSCASTAT;
- error = CAM_AUTOSNS_VALID|CAM_SCSI_STATUS_ERROR;
- if (ccb)
- ccb->csio.sense_data = ti->sense;/* XXX may not be csio.... */
+ error = XS_SENSE;
+ if (xs)
+ xs->sense = ti->sense;
}
else
- error = CAM_AUTOSENSE_FAIL;
+ error = XS_DRIVER_STUFFUP;
+
ti->ti_flags |= BSERROROK;
} else
bs_panic(bsc, "internal error");
@@ -333,11 +271,11 @@ bscmddone(ti)
if (cb->rcnt >= bsc->sc_retry || (cb->error & BSFATALIO))
{
if (cb->error & (BSSELTIMEOUT | BSTIMEOUT))
- error = CAM_CMD_TIMEOUT;
+ error = XS_TIMEOUT;
else if (cb->error & BSTARGETBUSY)
- error = CAM_SCSI_STATUS_ERROR;
+ error = XS_BUSY;
else
- error = CAM_REQ_CMP_ERR;
+ error = XS_DRIVER_STUFFUP;
break;
}
@@ -345,7 +283,7 @@ bscmddone(ti)
{
/* must clear the target's sense state */
cb->rcnt++;
- cb->bsccb_flags |= (BSITSDONE | BSCASTAT);
+ cb->flags |= (BSITSDONE | BSCASTAT);
cb->error &= ~BSREQSENSE;
return bs_request_sense(ti);
}
@@ -357,15 +295,16 @@ bscmddone(ti)
cb->error &= ~BSDMAABNORMAL;
continue;
}
- if (/*(xs && xs->bp) || can't know whether bufferd i/o or not */
- (cb->error & BSSELTIMEOUT) == 0)
+
+ if ((xs && xs->bp) || (cb->error & BSSELTIMEOUT) == 0)
bs_debug_print(bsc, ti);
+
cb->rcnt++;
return cb;
}
#ifdef BS_DIAG
- cb->bsccb_flags |= BSITSDONE;
+ cb->flags |= BSITSDONE;
#endif /* BS_DIAG */
if (bsc->sc_poll)
{
@@ -376,18 +315,28 @@ bscmddone(ti)
TAILQ_REMOVE(&ti->ti_ctab, cb, ccb_chain);
- if (ccb)
+ if (xs)
{
- ccb->ccb_h.status = error;
- ccb->csio.scsi_status = ti->ti_status;/*XXX*/
- xpt_done(ccb);
+#ifdef BS_ADDRESS_CHECK
+ if (cb->flags & BSALTBUF)
+ {
+ if (xs->flags & SCSI_DATA_IN)
+ bcopy(cb->data, xs->data, cb->datalen);
+ free(cb->data, M_DEVBUF);
+ }
+#endif /* BS_ADDRESS_CHECK */
+
+ if ((xs->error = error) == XS_NOERROR)
+ xs->resid = 0;
+ xs->flags |= XSBS_ITSDONE;
+ scsi_done(xs);
}
bs_free_ccb(cb);
cb = ti->ti_ctab.tqh_first;
}
- while (cb != NULL && (cb->bsccb_flags & BSITSDONE) != 0);
+ while (cb != NULL && (cb->flags & BSITSDONE) != 0);
/* complete */
return NULL;
@@ -404,7 +353,7 @@ bshoststart(bsc, ti)
struct bs_softc *bsc;
struct targ_info *ti;
{
- struct bsccb *cb;
+ struct ccb *cb;
int s;
if (bsc->sc_flags & BSINACTIVE)
@@ -427,7 +376,7 @@ again:
}
#ifdef BS_DIAG
- if (cb->bsccb_flags & BSITSDONE)
+ if (cb->flags & BSITSDONE)
bs_panic(bsc, "bshoststart: already done");
if (bsc->sc_nexus || (ti->ti_flags & BSNEXUS))
@@ -546,7 +495,7 @@ static BS_INLINE struct targ_info *
bs_selected(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
if (bsc->sc_busstat != BSR_SELECTED)
@@ -638,7 +587,7 @@ static BS_INLINE void
bs_sat_continue(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
BS_SETUP_PHASE(SATRESEL);
@@ -771,7 +720,7 @@ static BS_INLINE void
bs_commandout(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
u_int8_t scsi_cmd[16];
int len;
@@ -831,7 +780,7 @@ bs_quick_abort(ti, msg)
struct targ_info *ti;
u_int msg;
{
- struct bsccb *cb;
+ struct ccb *cb;
if ((cb = ti->ti_ctab.tqh_first) == NULL)
return;
@@ -867,7 +816,7 @@ bs_msgin_ext(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
int count;
u_int reqlen;
u_int32_t *ptr;
@@ -940,14 +889,14 @@ bs_msg_reject(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
char *s = "unexpected msg reject";
switch (ti->ti_ophase)
{
case CMDPHASE:
s = "cmd rejected";
- cb->bsccb_flags &= ~BSLINK;
+ cb->flags &= ~BSLINK;
BS_SETUP_MSGPHASE(IOCOMPLETED);
break;
@@ -955,7 +904,7 @@ bs_msg_reject(ti)
if (ti->ti_msgout & 0x80)
{
s = "identify msg rejected";
- cb->bsccb_flags &= ~BSDISC;
+ cb->flags &= ~BSDISC;
BS_SETUP_MSGPHASE(IOCOMPLETED);
}
else if (ti->ti_msgout == MSG_EXTEND)
@@ -1090,7 +1039,7 @@ static BS_INLINE void
bs_msgout(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
u_int8_t msg[MAXMSGLEN + 1];
@@ -1165,7 +1114,7 @@ static BS_INLINE void
bs_disconnect_phase(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
switch (bsc->sc_msgphase)
@@ -1237,7 +1186,7 @@ struct bs_err bs_cmderr[] = {
static void
bs_phase_error(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
struct bs_softc *bsc = ti->ti_bsc;
struct bs_err *pep;
@@ -1293,13 +1242,13 @@ bs_phase_error(ti, cb)
/**************************************************
* ### SCSI PHASE SEQUENCER ###
**************************************************/
-static BS_INLINE void bs_ack_wait __P((struct bs_softc *, struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_ack_wait __P((struct bs_softc *, struct targ_info *, struct ccb *));
static BS_INLINE void
bs_ack_wait(bsc, ti, cb)
struct bs_softc *bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
int wc = bsc->sc_wc;
@@ -1338,7 +1287,7 @@ bs_sequencer(bsc)
struct bs_softc *bsc;
{
register struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
/**************************************************
* Check reset
@@ -1423,7 +1372,7 @@ bs_sequencer(bsc)
default:
/* XXX:
- * check check check for safety !!
+ * check check check for safty !!
*/
if (bsc->sc_selwait)
{
@@ -1582,7 +1531,7 @@ bs_scsi_cmd_poll_internal(cti)
{
struct bs_softc *bsc = cti->ti_bsc;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
int i, waits, delay_count;
bsc->sc_poll++;
@@ -1601,7 +1550,7 @@ bs_scsi_cmd_poll_internal(cti)
{
ti->ti_flags |= BSFORCEIOPOLL;
if ((cb = ti->ti_ctab.tqh_first) != NULL)
- cb->bsccb_flags |= BSFORCEIOPOLL;
+ cb->flags |= BSFORCEIOPOLL;
}
}
@@ -1630,7 +1579,7 @@ bs_scsi_cmd_poll_internal(cti)
int
bs_scsi_cmd_poll(cti, targetcb)
struct targ_info *cti;
- struct bsccb *targetcb;
+ struct ccb *targetcb;
{
struct bs_softc *bsc = cti->ti_bsc;
struct targ_info *ti;
diff --git a/sys/i386/isa/bs/bs_isa.c b/sys/i386/isa/bs/bs_isa.c
index 644dc0e8a14fb..7215de65cc480 100644
--- a/sys/i386/isa/bs/bs_isa.c
+++ b/sys/i386/isa/bs/bs_isa.c
@@ -59,8 +59,7 @@ bs_args_copy(bsc, ia, hw)
bsc->sm_offset = 0;
bsc->sc_cfgflags = DVCFG_MINOR(ia->ia_cfgflags);
- snprintf(bsc->sc_dvname, sizeof(bsc->sc_dvname),
- "%s", bsc->sc_dev.dv_xname);
+ strcpy(bsc->sc_dvname, bsc->sc_dev.dv_xname);
}
static int
diff --git a/sys/i386/isa/bs/bsfunc.c b/sys/i386/isa/bs/bsfunc.c
index c92b706769336..47dfe84788f80 100644
--- a/sys/i386/isa/bs/bsfunc.c
+++ b/sys/i386/isa/bs/bsfunc.c
@@ -51,7 +51,7 @@ int bs_debug_flag = 0;
static void bs_print_syncmsg __P((struct targ_info *, char*));
static void bs_timeout_target __P((struct targ_info *));
-static void bs_kill_msg __P((struct bsccb *cb));
+static void bs_kill_msg __P((struct ccb *cb));
static int bs_start_target __P((struct targ_info *));
static int bs_check_target __P((struct targ_info *));
@@ -59,8 +59,8 @@ static int bs_check_target __P((struct targ_info *));
/*************************************************************
* CCB
************************************************************/
-GENERIC_CCB_STATIC_ALLOC(bs, bsccb)
-GENERIC_CCB(bs, bsccb, ccb_chain)
+GENERIC_CCB_STATIC_ALLOC(bs, ccb)
+GENERIC_CCB(bs, ccb, ccb_chain)
/*************************************************************
* TIMEOUT
@@ -87,7 +87,7 @@ bstimeout(arg)
{
struct bs_softc *bsc = (struct bs_softc *) arg;
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
int s;
s = splbio();
@@ -126,7 +126,7 @@ bstimeout(arg)
*************************************************/
static u_int8_t cmd_unit_ready[6];
-struct bsccb *
+struct ccb *
bs_make_internal_ccb(ti, lun, cmd, cmdlen, data, datalen, flags, timeout)
struct targ_info *ti;
u_int lun;
@@ -137,19 +137,19 @@ bs_make_internal_ccb(ti, lun, cmd, cmdlen, data, datalen, flags, timeout)
u_int flags;
int timeout;
{
- struct bsccb *cb;
+ struct ccb *cb;
- if ((cb = bs_get_ccb()) == NULL)
+ if ((cb = bs_get_ccb(XSBS_SCSI_NOSLEEP)) == NULL)
bs_panic(ti->ti_bsc, "can not get ccb mem");
- cb->ccb = NULL;
+ cb->xs = NULL;
cb->lun = lun;
cb->cmd = (cmd ? cmd : cmd_unit_ready);
cb->cmdlen = (cmd ? cmdlen : sizeof(cmd_unit_ready));
cb->data = data;
cb->datalen = (data ? datalen : 0);
cb->msgoutlen = 0;
- cb->bsccb_flags = flags & BSCFLAGSMASK;
+ cb->flags = flags & BSCFLAGSMASK;
bs_targ_flags(ti, cb);
cb->rcnt = 0;
cb->tcmax = (timeout > BS_DEFAULT_TIMEOUT_SECOND ? timeout :
@@ -160,11 +160,11 @@ bs_make_internal_ccb(ti, lun, cmd, cmdlen, data, datalen, flags, timeout)
return cb;
}
-struct bsccb *
+struct ccb *
bs_make_msg_ccb(ti, lun, cb, msg, timex)
struct targ_info *ti;
u_int lun;
- struct bsccb *cb;
+ struct ccb *cb;
struct msgbase *msg;
u_int timex;
{
@@ -175,7 +175,7 @@ bs_make_msg_ccb(ti, lun, cb, msg, timex)
cb = bs_make_internal_ccb(ti, lun, NULL, 0, NULL, 0,
flags, timex);
else
- cb->bsccb_flags |= flags & BSCFLAGSMASK;
+ cb->flags |= flags & BSCFLAGSMASK;
cb->msgoutlen = msg->msglen;
bcopy(msg->msg, cb->msgout, msg->msglen);
@@ -189,7 +189,7 @@ bs_send_msg(ti, lun, msg, timex)
struct msgbase *msg;
int timex;
{
- struct bsccb *cb;
+ struct ccb *cb;
cb = bs_make_msg_ccb(ti, lun, NULL, msg, timex);
bscmdstart(ti, BSCMDSTART);
@@ -198,7 +198,7 @@ bs_send_msg(ti, lun, msg, timex)
static void
bs_kill_msg(cb)
- struct bsccb *cb;
+ struct ccb *cb;
{
cb->msgoutlen = 0;
}
@@ -206,11 +206,11 @@ bs_kill_msg(cb)
/**************************************************
* MAKE SENSE CCB
**************************************************/
-struct bsccb *
+struct ccb *
bs_request_sense(ti)
struct targ_info *ti;
{
- struct bsccb *cb;
+ struct ccb *cb;
bzero(ti->scsi_cmd, sizeof(struct scsi_sense));
bzero(&ti->sense, sizeof(struct scsi_sense_data));
@@ -223,7 +223,7 @@ bs_request_sense(ti)
sizeof(struct scsi_sense_data),
BSFORCEIOPOLL,
BS_DEFAULT_TIMEOUT_SECOND);
- cb->bsccb_flags |= BSSENSECCB;
+ cb->flags |= BSSENSECCB;
return cb;
}
@@ -234,7 +234,7 @@ bs_request_sense(ti)
int
bs_start_syncmsg(ti, cb, flag)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
int flag;
{
struct syncdata *negp, *maxp;
@@ -308,7 +308,7 @@ bs_print_syncmsg(ti, s)
int
bs_analyze_syncmsg(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
struct bs_softc *bsc = ti->ti_bsc;
u_int8_t ans = ti->ti_syncnow.state;
@@ -411,13 +411,13 @@ bs_reset_device(ti)
}
/* send abort msg */
-struct bsccb *
+struct ccb *
bs_force_abort(ti)
struct targ_info *ti;
{
struct bs_softc *bsc = ti->ti_bsc;
struct msgbase msg;
- struct bsccb *cb = ti->ti_ctab.tqh_first;
+ struct ccb *cb = ti->ti_ctab.tqh_first;
u_int lun;
if (cb)
@@ -523,7 +523,7 @@ bs_reset_nexus(bsc)
struct bs_softc *bsc;
{
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
bsc->sc_flags &= ~(BSRESET | BSUNDERRESET);
if (bsc->sc_poll)
@@ -575,7 +575,7 @@ bs_reset_nexus(bsc)
for ( ; cb; cb = cb->ccb_chain.tqe_next)
{
bs_kill_msg(cb);
- cb->bsccb_flags &= ~(BSITSDONE | BSCASTAT);
+ cb->flags &= ~(BSITSDONE | BSCASTAT);
cb->error = 0;
}
@@ -597,15 +597,19 @@ static int
bs_start_target(ti)
struct targ_info *ti;
{
- struct bsccb *cb;
- struct scsi_start_stop_unit cmd;
+ struct ccb *cb;
+ struct scsi_start_stop cmd;
- bzero(&cmd, sizeof(struct scsi_start_stop_unit));
+ bzero(&cmd, sizeof(struct scsi_start_stop));
+#ifdef __NetBSD__
cmd.opcode = START_STOP;
+#else
+ cmd.op_code = START_STOP;
+#endif
cmd.how = SSS_START;
ti->ti_lun = 0;
cb = bs_make_internal_ccb(ti, 0, (u_int8_t *) &cmd,
- sizeof(struct scsi_start_stop_unit),
+ sizeof(struct scsi_start_stop),
NULL, 0, BSFORCEIOPOLL, BS_MOTOR_TIMEOUT);
bscmdstart(ti, BSCMDSTART);
return bs_scsi_cmd_poll(ti, cb);
@@ -619,7 +623,7 @@ bs_check_target(ti)
struct bs_softc *bsc = ti->ti_bsc;
struct scsi_inquiry scsi_cmd;
struct scsi_inquiry_data scsi_inquiry_data;
- struct bsccb *cb;
+ struct ccb *cb;
int count, retry = bsc->sc_retry;
int s, error = COMPLETE;
@@ -629,7 +633,11 @@ bs_check_target(ti)
/* inquiry */
bzero(&scsi_cmd, sizeof(scsi_cmd));
+#ifdef __NetBSD__
scsi_cmd.opcode = INQUIRY;
+#else
+ scsi_cmd.op_code = INQUIRY;
+#endif
scsi_cmd.length = sizeof(struct scsi_inquiry_data);
cb = bs_make_internal_ccb(ti, 0,
(u_int8_t *) &scsi_cmd, sizeof(scsi_cmd),
@@ -654,7 +662,7 @@ bs_check_target(ti)
goto done;
}
- if (cb->bsccb_flags & BSCASTAT)
+ if (cb->flags & BSCASTAT)
bs_printf(ti, "check", "could not clear CA state");
ti->ti_error = 0;
@@ -889,7 +897,7 @@ bs_debug_print(bsc, ti)
struct bs_softc *bsc;
struct targ_info *ti;
{
- struct bsccb *cb;
+ struct ccb *cb;
/* host stat */
printf("%s <DEBUG INFO> nexus %lx bs %lx bus status %lx \n",
@@ -913,7 +921,7 @@ bs_debug_print(bsc, ti)
sp->datalen, (u_long) sp->data, sp->seglen);
if (cb)
printf("odatalen %x flags %x\n",
- cb->datalen, cb->bsccb_flags);
+ cb->datalen, cb->flags);
else
printf("\n");
printf("error flags %b\n", ti->ti_error, BSERRORBITS);
diff --git a/sys/i386/isa/bs/bsfunc.h b/sys/i386/isa/bs/bsfunc.h
index 13c06868d04cb..5658a27fd60a4 100644
--- a/sys/i386/isa/bs/bsfunc.h
+++ b/sys/i386/isa/bs/bsfunc.h
@@ -44,22 +44,22 @@ struct targ_info *bs_init_target_info __P((struct bs_softc *, int));
/* msg op */
int bs_send_msg __P((struct targ_info *, u_int, struct msgbase *, int));
-struct bsccb *bs_request_sense __P((struct targ_info *));
+struct ccb *bs_request_sense __P((struct targ_info *));
/* sync msg op */
-int bs_start_syncmsg __P((struct targ_info *, struct bsccb *, int));
+int bs_start_syncmsg __P((struct targ_info *, struct ccb *, int));
int bs_send_syncmsg __P((struct targ_info *));
-int bs_analyze_syncmsg __P((struct targ_info *, struct bsccb *));
+int bs_analyze_syncmsg __P((struct targ_info *, struct ccb *));
/* reset device */
void bs_scsibus_start __P((struct bs_softc *));
void bs_reset_nexus __P((struct bs_softc *));
-struct bsccb *bs_force_abort __P((struct targ_info *));
+struct ccb *bs_force_abort __P((struct targ_info *));
void bs_reset_device __P((struct targ_info *));
/* ccb */
-struct bsccb *bs_make_internal_ccb __P((struct targ_info *, u_int, u_int8_t *, u_int, u_int8_t *, u_int, u_int, int));
-struct bsccb *bs_make_msg_ccb __P((struct targ_info *, u_int, struct bsccb *, struct msgbase *, u_int));
+struct ccb *bs_make_internal_ccb __P((struct targ_info *, u_int, u_int8_t *, u_int, u_int8_t *, u_int, u_int, int));
+struct ccb *bs_make_msg_ccb __P((struct targ_info *, u_int, struct ccb *, struct msgbase *, u_int));
/* misc funcs */
void bs_printf __P((struct targ_info *, char *, char *));
@@ -77,9 +77,9 @@ void bs_debug_print __P((struct bs_softc *, struct targ_info *));
static BS_INLINE int bs_check_sat __P((struct targ_info *));
static BS_INLINE int bs_check_smit __P((struct targ_info *));
static BS_INLINE int bs_check_disc __P((struct targ_info *));
-static BS_INLINE int bs_check_link __P((struct targ_info *, struct bsccb *));
+static BS_INLINE int bs_check_link __P((struct targ_info *, struct ccb *));
static BS_INLINE u_int8_t bs_identify_msg __P((struct targ_info *));
-static BS_INLINE void bs_targ_flags __P((struct targ_info *, struct bsccb *));
+static BS_INLINE void bs_targ_flags __P((struct targ_info *, struct ccb *));
static BS_INLINE int
bs_check_disc(ti)
@@ -108,13 +108,13 @@ bs_check_smit(ti)
static BS_INLINE int
bs_check_link(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
- struct bsccb *nextcb;
+ struct ccb *nextcb;
return ((ti->ti_flags & BSLINK) &&
(nextcb = cb->ccb_chain.tqe_next) &&
- (nextcb->bsccb_flags & BSLINK));
+ (nextcb->flags & BSLINK));
}
static BS_INLINE u_int8_t
@@ -128,17 +128,17 @@ bs_identify_msg(ti)
static BS_INLINE void
bs_targ_flags(ti, cb)
struct targ_info *ti;
- struct bsccb *cb;
+ struct ccb *cb;
{
u_int cmf = (u_int) bshw_cmd[cb->cmd[0]];
- cb->bsccb_flags |= ((cmf & (BSSAT | BSSMIT | BSLINK)) | BSDISC);
- cb->bsccb_flags &= ti->ti_mflags;
+ cb->flags |= ((cmf & (BSSAT | BSSMIT | BSLINK)) | BSDISC);
+ cb->flags &= ti->ti_mflags;
if (cb->datalen < DEV_BSIZE)
- cb->bsccb_flags &= ~BSSMIT;
- if (cb->bsccb_flags & BSFORCEIOPOLL)
- cb->bsccb_flags &= ~(BSLINK | BSSMIT | BSSAT | BSDISC);
+ cb->flags &= ~BSSMIT;
+ if (cb->flags & BSFORCEIOPOLL)
+ cb->flags &= ~(BSLINK | BSSMIT | BSSAT | BSDISC);
}
/**************************************************
diff --git a/sys/i386/isa/bs/bshw.c b/sys/i386/isa/bs/bshw.c
index 2cfe06472eaef..9b6656916c0ec 100644
--- a/sys/i386/isa/bs/bshw.c
+++ b/sys/i386/isa/bs/bshw.c
@@ -385,7 +385,7 @@ bshw_setup_ctrl_reg(bsc, flags)
void
bshw_issue_satcmd(bsc, cb, link)
struct bs_softc *bsc;
- struct bsccb *cb;
+ struct ccb *cb;
int link;
{
int i;
diff --git a/sys/i386/isa/bs/bshw.h b/sys/i386/isa/bs/bshw.h
index 8c698438a4ad8..384cb0b0988a6 100644
--- a/sys/i386/isa/bs/bshw.h
+++ b/sys/i386/isa/bs/bshw.h
@@ -97,7 +97,7 @@ int bshw_board_probe __P((struct bs_softc *, u_int *, u_int *));
void bshw_lock __P((struct bs_softc *));
void bshw_unlock __P((struct bs_softc *));
void bshw_get_syncreg __P((struct bs_softc *));
-void bshw_issue_satcmd __P((struct bs_softc *, struct bsccb *, int));
+void bshw_issue_satcmd __P((struct bs_softc *, struct ccb *, int));
void bshw_print_port __P((struct bs_softc *));
void bs_lc_smit_xfer __P((struct targ_info *, u_int));
diff --git a/sys/i386/isa/bs/bshw_dma.c b/sys/i386/isa/bs/bshw_dma.c
index 5b32de740493a..b3683f6fb5fa3 100644
--- a/sys/i386/isa/bs/bshw_dma.c
+++ b/sys/i386/isa/bs/bshw_dma.c
@@ -101,7 +101,7 @@ bs_dma_xfer(ti, direction)
/* setup segaddr */
sp->segaddr = (u_int8_t *) phys;
/* setup seglen */
- endva = (vm_offset_t)round_page((unsigned long)(sp->data + sp->datalen));
+ endva = (vm_offset_t)round_page(sp->data + sp->datalen);
for (va = (vm_offset_t) sp->data; ; phys = nphys)
{
if ((va += BSHW_NBPG) >= endva)
diff --git a/sys/i386/isa/bs/bsif.c b/sys/i386/isa/bs/bsif.c
index 948d3b61fec2b..d9a8210c82319 100644
--- a/sys/i386/isa/bs/bsif.c
+++ b/sys/i386/isa/bs/bsif.c
@@ -42,15 +42,6 @@
#include <i386/isa/bs/bsif.h>
#endif /* __FreeBSD__ */
-#include <cam/cam.h>
-#include <cam/cam_ccb.h>
-#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
-#include <cam/cam_debug.h>
-
-#include <cam/scsi/scsi_all.h>
-#include <cam/scsi/scsi_message.h>
-
/**************************************************
* DEVICE DECLARE
**************************************************/
@@ -78,9 +69,7 @@ struct scsi_adapter pc98texa55bs = {
#ifdef __FreeBSD__
static int bsprobe __P((struct isa_device *));
-static void bs_poll(struct cam_sim *sim);
-static int bsattach(struct isa_device *);
-static ointhand2_t bsintr;
+static int bsattach __P((struct isa_device *));
static int bsprint __P((void *, const char *));
static void bs_scsi_minphys __P((struct buf *));
static int bs_dmarangecheck __P((caddr_t, unsigned));
@@ -90,7 +79,7 @@ struct isa_driver bsdriver = {
bsattach,
"bs"
};
-#if 0
+
struct scsi_device bs_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -99,14 +88,14 @@ struct scsi_device bs_dev = {
"bs",
0, {0, 0}
};
-#endif
+
u_int32_t
bs_adapter_info(unit)
int unit;
{
return (1);
}
-#if 0
+
static struct scsi_adapter pc98texa55bs = {
bs_scsi_cmd,
bs_scsi_minphys,
@@ -115,7 +104,7 @@ static struct scsi_adapter pc98texa55bs = {
bs_adapter_info,
"bs", {0, 0}
};
-#endif
+
static u_short pc98_irq_ball[16] = {
IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
IRQ8, IRQ9, IRQ10, IRQ11, IRQ12, IRQ13, IRQ14, IRQ15
@@ -168,7 +157,7 @@ bsprobe(dev)
else
bsc->sm_offset = (u_long) 0;
- snprintf(bsc->sc_dvname, sizeof(bsc->sc_dvname), "bs%d", unit);
+ sprintf(bsc->sc_dvname, "bs%d", unit);
if (dev->id_iobase == 0)
{
@@ -223,12 +212,6 @@ bsprint(aux, name)
}
#ifdef __FreeBSD__
-static void
-bs_poll(struct cam_sim *sim)
-{
- bs_sequencer(cam_sim_softc(sim));
-}
-
static int
bsattach(dev)
struct isa_device *dev;
@@ -236,37 +219,27 @@ bsattach(dev)
int unit = dev->id_unit;
struct bs_softc *bsc = bscdata[unit];
struct scsibus_data *scbus;
- struct cam_devq *devq;
- dev->id_ointr = bsintr;
+ bsc->sc_link.adapter_unit = unit;
+ bsc->sc_link.adapter_targ = bsc->sc_hostid;
+ bsc->sc_link.flags = SDEV_BOUNCE;
+ bsc->sc_link.opennings = XSMAX;
+ bsc->sc_link.adapter_softc = bsc;
+ bsc->sc_link.adapter = &pc98texa55bs;
+ bsc->sc_link.device = &bs_dev;
/*
- * CAM support HN2 MAX_START, MAX_TAGS xxxx
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
*/
- devq = cam_simq_alloc(256/*MAX_START*/);
- if (devq == NULL)
- return 0;
-
- bsc->sim = cam_sim_alloc(bs_scsi_cmd, bs_poll, "bs",
- bsc, unit, 1, 32/*MAX_TAGS*/, devq);
- if (bsc->sim == NULL) {
- cam_simq_free(devq);
+ scbus = scsi_alloc_bus();
+ if (!scbus)
return 0;
- }
-
- if (xpt_bus_register(bsc->sim, 0) != CAM_SUCCESS) {
- free(bsc->sim, M_DEVBUF);
- return 0;
- }
-
- if (xpt_create_path(&bsc->path, /*periph*/NULL,
- cam_sim_path(bsc->sim), CAM_TARGET_WILDCARD,
- CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
- xpt_bus_deregister(cam_sim_path(bsc->sim));
- cam_sim_free(bsc->sim, /*free_simq*/TRUE);
- free(bsc->sim, M_DEVBUF);
- return 0;
- }
+ scbus->adapter_link = &bsc->sc_link;
+ /*
+ * ask the adapter what subunits are present
+ */
+ scsi_attachdevs(scbus);
bs_start_timeout(bsc);
return 1;
}
@@ -283,7 +256,7 @@ bsintr(arg)
#endif /* __NetBSD__ */
#ifdef __FreeBSD__
-static void
+void
bsintr(unit)
int unit;
{
@@ -303,7 +276,7 @@ bs_scsi_minphys(bp)
bp->b_bcount = BSDMABUFSIZ;
minphys(bp);
}
-#if 0
+
XSBS_INT32T
bs_target_open(sc, cf)
struct scsi_link *sc;
@@ -323,7 +296,7 @@ bs_target_open(sc, cf)
bs_setup_ctrl(ti, (u_int)sc->quirks, flags);
return 0;
}
-#endif
+
/*****************************************************************
* BS MEMORY ALLOCATION INTERFACE
*****************************************************************/
@@ -386,7 +359,7 @@ static int bs_dmarangecheck(caddr_t va, unsigned length)
{
vm_offset_t phys, priorpage = 0, endva;
- endva = (vm_offset_t)round_page((unsigned long)(va+length));
+ endva = (vm_offset_t)round_page(va+length);
for (; va < (caddr_t)endva; va += PAGE_SIZE) {
phys = trunc_page(pmap_extract(pmap_kernel(), (vm_offset_t)va));
if (phys == 0)
diff --git a/sys/i386/isa/bs/bsif.h b/sys/i386/isa/bs/bsif.h
index 0c6347867656a..478944fcaea39 100644
--- a/sys/i386/isa/bs/bsif.h
+++ b/sys/i386/isa/bs/bsif.h
@@ -117,11 +117,9 @@
#include <machine/ipl.h>
#include <machine/dvcfg.h>
-#include <cam/scsi/scsi_all.h>
-#if 0
-#include <cam/scsi/scsiconf.h>
-#endif
-#include <cam/scsi/scsi_da.h>
+#include <scsi/scsi_all.h>
+#include <scsi/scsiconf.h>
+#include <scsi/scsi_disk.h>
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
@@ -175,8 +173,8 @@
* xs flags's abstraction (all currently used)
***************************************************/
#define XSBS_ITSDONE ITSDONE
-#ifdef __NetBSD__
#define XSBS_SCSI_NOSLEEP SCSI_NOSLEEP
+#ifdef __NetBSD__
#define XSBS_SCSI_POLL SCSI_POLL
#endif /* __NetBSD__ */
#ifdef __FreeBSD__
@@ -184,17 +182,20 @@
#endif /* __FreeBSD__ */
/***************************************************
+ * Special operations
+ ***************************************************/
+#ifdef __FreeBSD__
+#define BS_ADDRESS_CHECK
+#endif /* __FreeBSD__ */
+
+/***************************************************
* declare
***************************************************/
/* (I) common declare */
void bs_alloc_buf __P((struct targ_info *));
-#ifdef __NetBSD__
XSBS_INT32T bs_target_open __P((struct scsi_link *, struct cfdata *));
XSBS_INT32T bs_scsi_cmd __P((struct scsi_xfer *));
-#endif
-#ifdef __FreeBSD__
-void bs_scsi_cmd(struct cam_sim *sim, union ccb *ccb);
-#endif
+
extern int delaycount;
/* (II) os depend declare */
diff --git a/sys/i386/isa/bs/bsvar.h b/sys/i386/isa/bs/bsvar.h
index 9eea57a6065a8..9167c2d156183 100644
--- a/sys/i386/isa/bs/bsvar.h
+++ b/sys/i386/isa/bs/bsvar.h
@@ -92,7 +92,7 @@
* PARAMETER
**************************************************/
#define NTARGETS 8
-#define RETRIES 0 /* number of retries before giving up */
+#define RETRIES 4 /* number of retries before giving up */
#define HARDRETRIES 3
#define XSMAX 4
#define BSDMABUFSIZ 0x10000
@@ -240,7 +240,7 @@ struct sc_p {
#define BSERRORBITS "\020\014busy\013abnormal\012retry\011msgerr\010fatal\007seltimeout\006sense\005timeout\004statuserr\003parity\002cmderr\001dmaerr"
-/* bsccb bsccb_flags & targ_info flags & cmd flags*/
+/* ccb & targ_info flags & cmd flags*/
#define BSREAD 0x0001
#define BSSAT 0x0002
#define BSLINK 0x0004
@@ -258,14 +258,14 @@ struct sc_p {
#define BSCFLAGSMASK (0xffff)
-struct bsccb {
- TAILQ_ENTRY(bsccb) ccb_chain;
+struct ccb {
+ TAILQ_ENTRY(ccb) ccb_chain;
- union ccb *ccb; /* upper drivers info */
+ struct scsi_xfer *xs; /* upper drivers info */
u_int lun; /* lun */
- u_int bsccb_flags; /* control flags */
+ u_int flags; /* control flags */
int rcnt; /* retry counter of this ccb */
@@ -290,75 +290,75 @@ struct bsccb {
int tcmax;
};
-GENERIC_CCB_ASSERT(bs, bsccb)
+GENERIC_CCB_ASSERT(bs, ccb)
/* target info */
struct targ_info {
-/*0*/ TAILQ_ENTRY(targ_info) ti_tchain; /* targ_info link */
+ TAILQ_ENTRY(targ_info) ti_tchain; /* targ_info link */
-/*4*/ TAILQ_ENTRY(targ_info) ti_wchain; /* wait link */
+ TAILQ_ENTRY(targ_info) ti_wchain; /* wait link */
-/*8*/ struct bs_softc *ti_bsc; /* our controller */
-/*c*/ u_int ti_id; /* scsi id */
-/*10*/ u_int ti_lun; /* current lun */
+ struct bs_softc *ti_bsc; /* our controller */
+ u_int ti_id; /* scsi id */
+ u_int ti_lun; /* current lun */
-/*14*/ struct bsccbtab ti_ctab, ti_bctab; /* ccb */
+ struct ccbtab ti_ctab, ti_bctab; /* ccb */
#define BS_TARG_NULL 0
#define BS_TARG_CTRL 1
#define BS_TARG_START 2
#define BS_TARG_SYNCH 3
#define BS_TARG_RDY 4
-/*24*/ int ti_state; /* target state */
+ int ti_state; /* target state */
-/*28*/ u_int ti_cfgflags; /* target cfg flags */
+ u_int ti_cfgflags; /* target cfg flags */
-/*2c*/ u_int ti_flags; /* flags */
-/*30*/ u_int ti_mflags; /* flags masks */
+ u_int ti_flags; /* flags */
+ u_int ti_mflags; /* flags masks */
-/*34*/ u_int ti_error; /* error flags */
-/*38*/ u_int ti_herrcnt; /* hardware err retry counter */
+ u_int ti_error; /* error flags */
+ u_int ti_herrcnt; /* hardware err retry counter */
/*****************************************
* scsi phase data
*****************************************/
-/*3c*/ struct sc_p ti_scsp; /* saved scsi data pointer */
+ struct sc_p ti_scsp; /* saved scsi data pointer */
-/*50*/ enum scsi_phase ti_phase; /* scsi phase */
-/*54*/ enum scsi_phase ti_ophase; /* previous scsi phase */
+ enum scsi_phase ti_phase; /* scsi phase */
+ enum scsi_phase ti_ophase; /* previous scsi phase */
-/*58*/ u_int8_t ti_status; /* status in */
+ u_int8_t ti_status; /* status in */
-/*59*/ u_int8_t ti_msgin[MAXMSGLEN]; /* msgin buffer */
-/*64*/ int ti_msginptr;
+ u_int8_t ti_msgin[MAXMSGLEN]; /* msgin buffer */
+ int ti_msginptr;
-/*68*/ u_int8_t ti_msgout; /* last msgout byte */
-/*69*/ u_int8_t ti_emsgout; /* last msgout byte */
-/*6c*/ u_int ti_omsgoutlen; /* for retry msgout */
+ u_int8_t ti_msgout; /* last msgout byte */
+ u_int8_t ti_emsgout; /* last msgout byte */
+ u_int ti_omsgoutlen; /* for retry msgout */
-/*70*/ struct syncdata ti_syncmax; /* synch data (scsi) */
-/*72*/ struct syncdata ti_syncnow;
-/*74*/ u_int8_t ti_sync; /* synch val (chip) */
+ struct syncdata ti_syncmax; /* synch data (scsi) */
+ struct syncdata ti_syncnow;
+ u_int8_t ti_sync; /* synch val (chip) */
/*****************************************
* bounce buffer & smit data pointer
*****************************************/
-/*75*/ u_int8_t *bounce_phys;
-/*76*/ u_int8_t *bounce_addr;
-/*78*/ u_int bounce_size;
+ u_int8_t *bounce_phys;
+ u_int8_t *bounce_addr;
+ u_int bounce_size;
-/*7c*/ u_long sm_offset;
+ u_long sm_offset;
/*****************************************
* target inq data
*****************************************/
-/*79*/ u_int8_t targ_type;
-/*7a*/ u_int8_t targ_support;
+ u_int8_t targ_type;
+ u_int8_t targ_support;
/*****************************************
* generic scsi cmd buffer for this target
*****************************************/
-/*7b*/ u_int8_t scsi_cmd[12];
+ u_int8_t scsi_cmd[12];
struct scsi_sense_data sense;
};
@@ -371,6 +371,8 @@ struct bs_softc {
*****************************************/
OS_DEPEND_DEVICE_HEADER
+ OS_DEPEND_SCSI_HEADER
+
OS_DEPEND_MISC_HEADER
/*****************************************
@@ -431,7 +433,7 @@ struct bs_softc {
u_int sc_wc; /* weight count */
int sc_poll;
- struct bsccb *sc_outccb;
+ struct ccb *sc_outccb;
/*****************************************
* wd33c93 chip depend section
@@ -460,12 +462,6 @@ struct bs_softc {
*****************************************/
#define BS_DVNAME_LEN 16
u_char sc_dvname[BS_DVNAME_LEN];
-
- /*****************************************
- * CAM support
- *****************************************/
- struct cam_sim *sim;
- struct cam_path *path;
};
/*************************************************
@@ -500,10 +496,10 @@ extern int bs_debug_flag;
/*************************************************
* Function declare
*************************************************/
-int bs_scsi_cmd_internal __P((struct bsccb *, u_int));
-struct bsccb *bscmddone __P((struct targ_info *));
+int bs_scsi_cmd_internal __P((struct ccb *, u_int));
+struct ccb *bscmddone __P((struct targ_info *));
int bscmdstart __P((struct targ_info *, int));
-int bs_scsi_cmd_poll __P((struct targ_info *, struct bsccb *));
+int bs_scsi_cmd_poll __P((struct targ_info *, struct ccb *));
int bs_sequencer __P((struct bs_softc *));
void bs_poll_timeout __P((struct bs_softc *, char *));
@@ -511,9 +507,8 @@ void bs_poll_timeout __P((struct bs_softc *, char *));
* XXX
*************************************************/
/* misc error */
-#define COMPLETE 2
-#define NOTARGET (-2)
-#define HASERROR (-1)
+#define NOTARGET -2
+#define HASERROR -1
/* XXX: use scsi_message.h */
/* status */
diff --git a/sys/i386/isa/bt_isa.c b/sys/i386/isa/bt_isa.c
index f646f85bf1580..8009a36569d86 100644
--- a/sys/i386/isa/bt_isa.c
+++ b/sys/i386/isa/bt_isa.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt_isa.c,v 1.4 1998/10/12 18:53:33 imp Exp $
+ * $Id: bt_isa.c,v 1.3 1998/10/10 00:44:12 imp Exp $
*/
#include <sys/param.h>
@@ -86,10 +86,24 @@ bt_isa_probe(dev)
* Bound our board search if the user has
* specified an exact port.
*/
- bt_find_probe_range(dev->id_iobase, &port_index, &max_port_index);
-
- if (port_index < 0)
- return 0;
+ if (dev->id_iobase > 0) {
+ for (;port_index <= max_port_index; port_index++)
+ if (dev->id_iobase >= bt_isa_ports[port_index].addr)
+ break;
+ if ((port_index > max_port_index)
+ || (dev->id_iobase != bt_isa_ports[port_index].addr)) {
+ printf("
+bt_isa_probe: Invalid baseport of 0x%x specified.
+bt_isa_probe: Nearest valid baseport is 0x%x.
+bt_isa_probe: Failing probe.\n",
+ dev->id_iobase,
+ (port_index <= max_port_index)
+ ? bt_isa_ports[port_index].addr
+ : bt_isa_ports[max_port_index].addr);
+ return 0;
+ }
+ max_port_index = port_index;
+ }
/* Attempt to find an adapter */
for (;port_index <= max_port_index; port_index++) {
@@ -97,7 +111,7 @@ bt_isa_probe(dev)
u_int ioport;
int error;
- ioport = bt_iop_from_bio(port_index);
+ ioport = bt_isa_ports[port_index].addr;
/*
* Ensure this port has not already been claimed already
@@ -105,7 +119,7 @@ bt_isa_probe(dev)
*/
if (bt_check_probed_iop(ioport) != 0)
continue;
- dev->id_iobase = ioport;
+ dev->id_iobase = bt_isa_ports[port_index].addr;
if (haveseen_isadev(dev, CC_IOADDR | CC_QUIET))
continue;
@@ -155,7 +169,6 @@ bt_isa_probe(dev)
printf("bt_isa_probe: Invalid DMA setting "
"detected for adapter at 0x%x. "
"Failing probe\n", ioport);
- return (0);
}
} else {
/* VL DMA */
diff --git a/sys/i386/isa/ccbque.h b/sys/i386/isa/ccbque.h
index 0d9eeecb9f550..7530068d13954 100644
--- a/sys/i386/isa/ccbque.h
+++ b/sys/i386/isa/ccbque.h
@@ -36,6 +36,7 @@
#define _CCBQUE_H_
#define CCB_MWANTED 0x01
+#define CCB_WOK(fl) (((fl) == 0) ? M_WAITOK : M_NOWAIT)
/* (I) structure and prototype */
#define GENERIC_CCB_ASSERT(DEV, CCBTYPE) \
@@ -48,7 +49,7 @@ struct CCBTYPE##que { \
}; \
\
void DEV##_init_ccbque __P((int)); \
-struct CCBTYPE *DEV##_get_ccb __P((void)); \
+struct CCBTYPE *DEV##_get_ccb __P((int)); \
void DEV##_free_ccb __P((register struct CCBTYPE *));
/* (II) static allocated memory */
@@ -68,7 +69,8 @@ DEV##_init_ccbque(count) \
} \
\
struct CCBTYPE * \
-DEV##_get_ccb() \
+DEV##_get_ccb(flags) \
+ int flags; \
{ \
register struct CCBTYPE *cb; \
int s = splbio(); \
@@ -85,7 +87,7 @@ again: \
} \
else \
{ \
- cb = malloc(sizeof(*cb), M_DEVBUF, M_NOWAIT); \
+ cb = malloc(sizeof(*cb), M_DEVBUF, CCB_WOK(flags));\
if (cb != NULL) \
{ \
bzero(cb, sizeof(*cb)); \
@@ -95,6 +97,12 @@ again: \
CCBTYPE##que.count --; \
} \
\
+ if (flags == 0) \
+ { \
+ CCBTYPE##que.flags |= CCB_MWANTED; \
+ tsleep((caddr_t) &CCBTYPE##que.count, PRIBIO, "ccbwait", 0);\
+ goto again; \
+ } \
cb = NULL; \
\
out: \
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index d9bca71ad7c16..7515141cb1f6f 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.128 1998/10/23 10:46:20 phk Exp $
+ * $Id: clock.c,v 1.126 1998/09/20 03:47:54 bde Exp $
*/
/*
@@ -126,7 +126,7 @@ static void setup_8254_mixed_mode __P((void));
*/
#define TIMER0_MAX_FREQ 20000
-int adjkerntz; /* local offset from GMT in seconds */
+int adjkerntz; /* local offset from GMT in seconds */
int disable_rtc_set; /* disable resettodr() if != 0 */
u_int idelayed;
int statclock_disable;
@@ -137,7 +137,7 @@ u_int stat_imask = SWI_CLOCK_MASK;
u_int timer_freq = TIMER_FREQ;
int timer0_max_count;
u_int tsc_freq;
-int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
+int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
static int beeping = 0;
static u_int clk_imask = HWI_MASK | SWI_MASK;
@@ -173,7 +173,7 @@ static unsigned i8254_get_timecount __P((struct timecounter *tc));
static unsigned tsc_get_timecount __P((struct timecounter *tc));
static void set_timer_freq(u_int freq, int intr_freq);
-static struct timecounter tsc_timecounter = {
+static struct timecounter tsc_timecounter[3] = {
tsc_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -182,9 +182,9 @@ static struct timecounter tsc_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
- &tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
+ tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
-static struct timecounter i8254_timecounter = {
+static struct timecounter i8254_timecounter[3] = {
i8254_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -193,7 +193,7 @@ static struct timecounter i8254_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
- &i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
+ i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
static void
clkintr(struct clockframe frame)
@@ -751,8 +751,8 @@ startrtclock()
}
set_timer_freq(timer_freq, hz);
- i8254_timecounter.tc_frequency = timer_freq;
- init_timecounter(&i8254_timecounter);
+ i8254_timecounter[0].tc_frequency = timer_freq;
+ init_timecounter(i8254_timecounter);
#ifndef CLK_USE_TSC_CALIBRATION
if (tsc_freq != 0) {
@@ -801,16 +801,16 @@ startrtclock()
#endif /* NAPM > 0 */
if (tsc_present && tsc_freq != 0) {
- tsc_timecounter.tc_frequency = tsc_freq;
- init_timecounter(&tsc_timecounter);
+ tsc_timecounter[0].tc_frequency = tsc_freq;
+ init_timecounter(tsc_timecounter);
}
#endif /* !defined(SMP) */
}
/*
- * Initialize the time of day register, based on the time base which is, e.g.
- * from a filesystem.
+ * Initialize the time of day register, based on the time base which is, e.g.
+ * from a filesystem.
*/
void
inittodr(time_t base)
@@ -829,17 +829,17 @@ inittodr(time_t base)
splx(s);
}
- /* Look if we have a RTC present and the time is valid */
+ /* Look if we have a RTC present and the time is valid */
if (!(rtcin(RTC_STATUSD) & RTCSD_PWR))
goto wrong_time;
- /* wait for time update to complete */
- /* If RTCSA_TUP is zero, we have at least 244us before next update */
+ /* wait for time update to complete */
+ /* If RTCSA_TUP is zero, we have at least 244us before next update */
while (rtcin(RTC_STATUSA) & RTCSA_TUP);
days = 0;
#ifdef USE_RTC_CENTURY
- year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
+ year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
#else
year = readrtc(RTC_YEAR) + 1900;
if (year < 1970)
@@ -847,21 +847,21 @@ inittodr(time_t base)
#endif
if (year < 1970)
goto wrong_time;
- month = readrtc(RTC_MONTH);
- for (m = 1; m < month; m++)
- days += daysinmonth[m-1];
- if ((month > 2) && LEAPYEAR(year))
+ month = readrtc(RTC_MONTH);
+ for (m = 1; m < month; m++)
+ days += daysinmonth[m-1];
+ if ((month > 2) && LEAPYEAR(year))
days ++;
- days += readrtc(RTC_DAY) - 1;
+ days += readrtc(RTC_DAY) - 1;
yd = days;
for (y = 1970; y < year; y++)
- days += DAYSPERYEAR + LEAPYEAR(y);
+ days += DAYSPERYEAR + LEAPYEAR(y);
sec = ((( days * 24 +
readrtc(RTC_HRS)) * 60 +
readrtc(RTC_MIN)) * 60 +
readrtc(RTC_SEC));
- /* sec now contains the number of seconds, since Jan 1 1970,
- in the local time zone */
+ /* sec now contains the number of seconds, since Jan 1 1970,
+ in the local time zone */
sec += tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -877,12 +877,12 @@ inittodr(time_t base)
return;
wrong_time:
- printf("Invalid time in real time clock.\n");
- printf("Check and reset the date immediately!\n");
+ printf("Invalid time in real time clock.\n");
+ printf("Check and reset the date immediately!\n");
}
/*
- * Write system time back to RTC
+ * Write system time back to RTC
*/
void
resettodr()
@@ -900,7 +900,7 @@ resettodr()
/* Disable RTC updates and interrupts. */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in RTC */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -908,7 +908,7 @@ resettodr()
writertc(RTC_MIN, bin2bcd(tm%60)); tm /= 60; /* Write back Minutes */
writertc(RTC_HRS, bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
- /* We have now the days since 01-01-1970 in tm */
+ /* We have now the days since 01-01-1970 in tm */
writertc(RTC_WDAY, (tm+4)%7); /* Write back Weekday */
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
tm >= m;
@@ -1118,7 +1118,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
if (timer0_state != RELEASED)
return (EBUSY); /* too much trouble to handle */
set_timer_freq(freq, hz);
- i8254_timecounter.tc_frequency = freq;
+ i8254_timecounter[0].tc_frequency = freq;
}
return (error);
}
@@ -1138,7 +1138,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
if (error == 0 && req->newptr != NULL) {
tsc_freq = freq;
- tsc_timecounter.tc_frequency = tsc_freq;
+ tsc_timecounter[0].tc_frequency = tsc_freq;
}
return (error);
}
diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c
index 413302d504718..3e094ee8a6b53 100644
--- a/sys/i386/isa/ctx.c
+++ b/sys/i386/isa/ctx.c
@@ -8,7 +8,7 @@
* of this software, nor does the author assume any responsibility
* for damages incurred with its use.
*
- * $Id: ctx.c,v 1.28 1998/06/14 10:52:52 bde Exp $
+ * $Id: ctx.c,v 1.27 1998/06/07 17:10:15 dfr Exp $
*/
/*
@@ -196,12 +196,12 @@ ctxattach(struct isa_device * devp)
sr->iobase = devp->id_iobase;
sr->maddr = devp->id_maddr;
sr->msize = devp->id_msize;
+ return (1);
#ifdef DEVFS
sr->devfs_token =
devfs_add_devswf(&ctx_cdevsw, 0, DV_CHR, 0, 0, 0600,
"ctx%d", devp->id_unit);
#endif /* DEVFS */
- return (1);
}
static int
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index 9b00dabb8d638..b4fb32460fb7b 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -417,8 +417,7 @@ int cxioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case 8: o->iftype = c->board->if8type; break;
}
if (c->master != c->ifp)
- snprintf (o->master, sizeof(o->master),
- "%s%d", c->master->if_name,
+ sprintf (o->master, "%s%d", c->master->if_name,
c->master->if_unit);
else
*o->master = 0;
@@ -846,7 +845,7 @@ int cxrinta (cx_chan_t *c)
}
/* Discard exception characters. */
- if ((risr & RISA_SCMASK) && tp && (tp->t_iflag & IXON))
+ if ((risr & RISA_SCMASK) && (tp->t_iflag & IXON))
reoir |= REOI_DISCEXC;
/* Handle received data. */
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 794d4d690b929..3f765678f0c1b 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.82 1998/12/24 14:17:57 bde Exp $
+ * $Id: cy.c,v 1.70 1998/08/20 05:21:50 bde Exp $
*/
#include "opt_compat.h"
@@ -37,6 +37,8 @@
/*
* TODO:
+ * Implement BREAK.
+ * Fix overflows when closing line.
* Atomic COR change.
* Consoles.
*/
@@ -86,9 +88,6 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <i386/isa/isa_device.h>
#include <i386/isa/cyreg.h>
@@ -153,16 +152,6 @@
#define CD1400_xIVR_CHAN_SHIFT 3
#define CD1400_xIVR_CHAN 0x1F
-/*
- * ETC states. com->etc may also contain a hardware ETC command value,
- * meaning that execution of that command is pending.
- */
-#define ETC_NONE 0 /* we depend on bzero() setting this */
-#define ETC_BREAK_STARTING 1
-#define ETC_BREAK_STARTED 2
-#define ETC_BREAK_ENDING 3
-#define ETC_BREAK_ENDED 4
-
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
#define RS_IBUFSIZE 256
@@ -211,7 +200,6 @@
#define CS_DTR_OFF 0x10 /* DTR held off */
#define CS_ODONE 4 /* output completed */
#define CS_RTS_IFLOW 8 /* use RTS input flow control */
-#define CSE_ODONE 1 /* output transmitted */
static char const * const error_desc[] = {
#define CE_OVERRUN 0
@@ -243,10 +231,6 @@ struct com_s {
bool_t active_out; /* nonzero if the callout device is open */
#if 0
u_char cfcr_image; /* copy of value written to CFCR */
-#endif
- u_char etc; /* pending Embedded Transmit Command */
- u_char extra_state; /* more flag bits, separate for order trick */
-#if 0
u_char fifo_image; /* copy of value written to FIFO */
#endif
u_char gfrcr_image; /* copy of value read from GFRCR */
@@ -321,7 +305,6 @@ struct com_s {
u_int start_count; /* no. of calls to comstart() */
u_int start_real; /* no. of calls that did something */
#endif
- u_char car; /* CD1400 CAR shadow (if first unit in cd) */
u_char channel_control;/* CD1400 CCR control command shadow */
u_char cor[3]; /* CD1400 COR1-3 shadows */
u_char intr_enable; /* CD1400 SRER shadow */
@@ -352,15 +335,10 @@ struct com_s {
/* PCI driver entry point. */
int cyattach_common __P((cy_addr cy_iobase, int cy_align));
-ointhand2_t siointr;
static int cy_units __P((cy_addr cy_iobase, int cy_align));
static int sioattach __P((struct isa_device *dev));
-static void cd1400_channel_cmd __P((struct com_s *com, int cmd));
-static void cd1400_channel_cmd_wait __P((struct com_s *com));
-static void cd_etc __P((struct com_s *com, int etc));
-static int cd_getreg __P((struct com_s *com, int reg));
-static void cd_setreg __P((struct com_s *com, int reg, int val));
+static void cd1400_channel_cmd __P((cy_addr iobase, int cmd, int cy_align));
static timeout_t siodtrwakeup;
static void comhardclose __P((struct com_s *com));
#if 0
@@ -450,11 +428,11 @@ sioprobe(dev)
iobase = (cy_addr)dev->id_maddr;
/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
- cy_inb(iobase, CY16_RESET, 0); /* XXX? */
+ cd_inb(iobase, CY16_RESET, 0); /* XXX? */
DELAY(500); /* wait for the board to get its act together */
/* this is needed to get the board out of reset */
- cy_outb(iobase, CY_CLEAR_INTR, 0, 0);
+ cd_outb(iobase, CY_CLEAR_INTR, 0, 0);
DELAY(500);
return (cy_units(iobase, 0) == 0 ? 0 : -1);
@@ -528,7 +506,6 @@ sioattach(isdp)
printf("cy%d: attached as cy%d\n", isdp->id_unit, adapter);
isdp->id_unit = adapter; /* XXX */
}
- isdp->id_ointr = siointr;
isdp->id_ri_flags |= RI_FAST;
return (1);
}
@@ -601,7 +578,6 @@ cyattach_common(cy_iobase, cy_align)
com->cy_align = cy_align;
com->cy_iobase = cy_iobase;
com->iobase = iobase;
- com->car = ~CD1400_CAR_CHAN;
/*
* We don't use all the flags from <sys/ttydefaults.h> since they
@@ -664,7 +640,7 @@ cyattach_common(cy_iobase, cy_align)
}
/* ensure an edge for the next interrupt */
- cy_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
+ cd_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
return (adapter);
}
@@ -678,6 +654,7 @@ sioopen(dev, flag, mode, p)
{
struct com_s *com;
int error;
+ cy_addr iobase;
int mynor;
int s;
struct tty *tp;
@@ -747,25 +724,48 @@ open_top:
tp->t_ififosize = 2 * RS_IBUFSIZE;
tp->t_ispeedwat = (speed_t)-1;
tp->t_ospeedwat = (speed_t)-1;
-
- /* Encode per-board unit in LIVR for access in intr routines. */
- cd_setreg(com, CD1400_LIVR,
- (unit & CD1400_xIVR_CHAN) << CD1400_xIVR_CHAN_SHIFT);
-
- (void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
#if 0
+ (void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
com->poll = com->no_irq;
com->poll_output = com->loses_outints;
#endif
++com->wopeners;
+ iobase = com->iobase;
+
+ /* reset this channel */
+ cd_outb(iobase, CD1400_CAR, com->cy_align,
+ unit & CD1400_CAR_CHAN);
+ cd1400_channel_cmd(iobase, CD1400_CCR_CMDRESET, com->cy_align);
+
+ /*
+ * Resetting disables the transmitter and receiver as well as
+ * flushing the fifos so some of our cached state becomes
+ * invalid. The documentation suggests that all registers
+ * for the current channel are reset to defaults, but
+ * apparently none are. We wouldn't want DTR cleared.
+ */
+ com->channel_control = 0;
+
+ /* Encode per-board unit in LIVR for access in intr routines. */
+ cd_outb(iobase, CD1400_LIVR, com->cy_align,
+ (unit & CD1400_xIVR_CHAN) << CD1400_xIVR_CHAN_SHIFT);
+
+ /*
+ * raise dtr and generally set things up correctly. this
+ * has the side-effect of selecting the appropriate cd1400
+ * channel, to help us with subsequent channel control stuff
+ */
error = comparam(tp, &tp->t_termios);
--com->wopeners;
if (error != 0)
goto out;
+ /*
+ * XXX we should goto open_top if comparam() slept.
+ */
#if 0
if (com->hasfifo) {
/*
- * (Re)enable and flush fifos.
+ * (Re)enable and drain fifos.
*
* Certain SMC chips cause problems if the fifos
* are enabled while input is ready. Turn off the
@@ -797,21 +797,14 @@ open_top:
| IER_EMSC);
enable_intr();
#else /* !0 */
- /*
- * Flush fifos. This requires a full channel reset which
- * also disables the transmitter and receiver. Recover
- * from this.
- */
- cd1400_channel_cmd(com,
- CD1400_CCR_CMDRESET | CD1400_CCR_CHANRESET);
- cd1400_channel_cmd(com, com->channel_control);
-
+ /* XXX raise RTS too */
+ (void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
disable_intr();
com->prev_modem_status = com->last_modem_status
- = cd_getreg(com, CD1400_MSVR2);
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = CD1400_SRER_MDMCH | CD1400_SRER_RXDATA);
+ = cd_inb(iobase, CD1400_MSVR2, com->cy_align);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable
+ = CD1400_SRER_MDMCH | CD1400_SRER_RXDATA);
enable_intr();
#endif /* 0 */
/*
@@ -872,7 +865,6 @@ sioclose(dev, flag, mode, p)
com = com_addr(MINOR_TO_UNIT(mynor));
tp = com->tp;
s = spltty();
- cd_etc(com, CD1400_ETC_STOPBREAK);
(*linesw[tp->t_line].l_close)(tp, flag);
disc_optim(tp, &tp->t_termios, com);
siostop(tp, FREAD | FWRITE);
@@ -904,15 +896,9 @@ comhardclose(com)
com->poll_output = FALSE;
#endif
com->do_timestamp = 0;
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
#if 0
outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
-#else
- /* XXX */
- disable_intr();
- com->etc = ETC_NONE;
- cd_setreg(com, CD1400_COR2, com->cor[1] &= ~CD1400_COR2_ETC);
- enable_intr();
- cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF);
#endif
{
@@ -920,7 +906,8 @@ comhardclose(com)
outb(iobase + com_ier, 0);
#else
disable_intr();
- cd_setreg(com, CD1400_SRER, com->intr_enable = 0);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable = 0);
enable_intr();
#endif
tp = com->tp;
@@ -942,9 +929,10 @@ comhardclose(com)
com->channel_control = CD1400_CCR_CMDCHANCTL
| CD1400_CCR_XMTEN
| CD1400_CCR_RCVDIS;
- cd1400_channel_cmd(com, com->channel_control);
+ cd1400_channel_cmd(iobase, com->channel_control,
+ com->cy_align);
- if (com->dtr_wait != 0 && !(com->state & CS_DTR_OFF)) {
+ if (com->dtr_wait != 0) {
timeout(siodtrwakeup, com, com->dtr_wait);
com->state |= CS_DTR_OFF;
}
@@ -1064,16 +1052,16 @@ siointr(unit)
u_char recv_data;
u_char serv_type;
#ifdef PollMode
+ u_char save_car;
u_char save_rir;
#endif
#ifdef PollMode
save_rir = cd_inb(iobase, CD1400_RIR, cy_align);
+ save_car = cd_inb(iobase, CD1400_CAR, cy_align);
/* enter rx service */
cd_outb(iobase, CD1400_CAR, cy_align, save_rir);
- com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS)->car
- = save_rir & CD1400_CAR_CHAN;
serv_type = cd_inb(iobase, CD1400_RIVR, cy_align);
com = com_addr(baseu
@@ -1081,7 +1069,7 @@ siointr(unit)
& CD1400_xIVR_CHAN));
#else
/* ack receive service */
- serv_type = cy_inb(iobase, CY8_SVCACKR, cy_align);
+ serv_type = cy_inb(iobase, CY8_SVCACKR);
com = com_addr(baseu +
+ ((serv_type >> CD1400_xIVR_CHAN_SHIFT)
@@ -1229,6 +1217,7 @@ cont:
cd_outb(iobase, CD1400_RIR, cy_align,
save_rir
& ~(CD1400_RIR_RDIREQ | CD1400_RIR_RBUSY));
+ cd_outb(iobase, CD1400_CAR, cy_align, save_car);
#else
cd_outb(iobase, CD1400_EOSRR, cy_align, 0);
#endif
@@ -1237,6 +1226,7 @@ cont:
struct com_s *com;
u_char modem_status;
#ifdef PollMode
+ u_char save_car;
u_char save_mir;
#else
u_char vector;
@@ -1244,17 +1234,16 @@ cont:
#ifdef PollMode
save_mir = cd_inb(iobase, CD1400_MIR, cy_align);
+ save_car = cd_inb(iobase, CD1400_CAR, cy_align);
/* enter modem service */
cd_outb(iobase, CD1400_CAR, cy_align, save_mir);
- com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS)->car
- = save_mir & CD1400_CAR_CHAN;
com = com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS
+ (save_mir & CD1400_MIR_CHAN));
#else
/* ack modem service */
- vector = cy_inb(iobase, CY8_SVCACKM, cy_align);
+ vector = cy_inb(iobase, CY8_SVCACKM);
com = com_addr(baseu
+ ((vector >> CD1400_xIVR_CHAN_SHIFT)
@@ -1293,9 +1282,7 @@ cont:
cd_outb(iobase, CD1400_SRER,
cy_align,
com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ |= CD1400_SRER_TXRDY);
} else {
com->state &= ~CS_ODEVREADY;
if (com->intr_enable
@@ -1303,9 +1290,7 @@ cont:
cd_outb(iobase, CD1400_SRER,
cy_align,
com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ &= ~CD1400_SRER_TXRDY);
}
}
#endif
@@ -1316,6 +1301,7 @@ cont:
cd_outb(iobase, CD1400_MIR, cy_align,
save_mir
& ~(CD1400_MIR_RDIREQ | CD1400_MIR_RBUSY));
+ cd_outb(iobase, CD1400_CAR, cy_align, save_car);
#else
cd_outb(iobase, CD1400_EOSRR, cy_align, 0);
#endif
@@ -1323,6 +1309,7 @@ cont:
if (status & CD1400_SVRR_TXRDY) {
struct com_s *com;
#ifdef PollMode
+ u_char save_car;
u_char save_tir;
#else
u_char vector;
@@ -1330,106 +1317,22 @@ cont:
#ifdef PollMode
save_tir = cd_inb(iobase, CD1400_TIR, cy_align);
+ save_car = cd_inb(iobase, CD1400_CAR, cy_align);
/* enter tx service */
cd_outb(iobase, CD1400_CAR, cy_align, save_tir);
- com_addr(baseu + cyu * CD1400_NO_OF_CHANNELS)->car
- = save_tir & CD1400_CAR_CHAN;
-
com = com_addr(baseu
+ cyu * CD1400_NO_OF_CHANNELS
+ (save_tir & CD1400_TIR_CHAN));
#else
/* ack transmit service */
- vector = cy_inb(iobase, CY8_SVCACKT, cy_align);
+ vector = cy_inb(iobase, CY8_SVCACKT);
com = com_addr(baseu
+ ((vector >> CD1400_xIVR_CHAN_SHIFT)
& CD1400_xIVR_CHAN));
#endif
- if (com->etc != ETC_NONE) {
- if (com->intr_enable & CD1400_SRER_TXRDY) {
- /*
- * Here due to sloppy SRER_TXRDY
- * enabling. Ignore. Come back when
- * tx is empty.
- */
- cd_outb(iobase, CD1400_SRER, cy_align,
- com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
- goto terminate_tx_service;
- }
- switch (com->etc) {
- case CD1400_ETC_SENDBREAK:
- case CD1400_ETC_STOPBREAK:
- /*
- * Start the command. Come back on
- * next tx empty interrupt, hopefully
- * after command has been executed.
- */
- cd_outb(iobase, CD1400_COR2, cy_align,
- com->cor[1] |= CD1400_COR2_ETC);
- cd_outb(iobase, CD1400_TDR, cy_align,
- CD1400_ETC_CMD);
- cd_outb(iobase, CD1400_TDR, cy_align,
- com->etc);
- if (com->etc == CD1400_ETC_SENDBREAK)
- com->etc = ETC_BREAK_STARTING;
- else
- com->etc = ETC_BREAK_ENDING;
- goto terminate_tx_service;
- case ETC_BREAK_STARTING:
- /*
- * BREAK is now on. Continue with
- * SRER_TXMPTY processing, hopefully
- * don't come back.
- */
- com->etc = ETC_BREAK_STARTED;
- break;
- case ETC_BREAK_STARTED:
- /*
- * Came back due to sloppy SRER_TXMPTY
- * enabling. Hope again.
- */
- break;
- case ETC_BREAK_ENDING:
- /*
- * BREAK is now off. Continue with
- * SRER_TXMPTY processing and don't
- * come back. The SWI handler will
- * restart tx interrupts if necessary.
- */
- cd_outb(iobase, CD1400_COR2, cy_align,
- com->cor[1]
- &= ~CD1400_COR2_ETC);
- com->etc = ETC_BREAK_ENDED;
- if (!(com->state & CS_ODONE)) {
- com_events += LOTS_OF_EVENTS;
- com->state |= CS_ODONE;
- setsofttty();
- }
- break;
- case ETC_BREAK_ENDED:
- /*
- * Shouldn't get here. Hope again.
- */
- break;
- }
- }
- if (com->intr_enable & CD1400_SRER_TXMPTY) {
- if (!(com->extra_state & CSE_ODONE)) {
- com_events += LOTS_OF_EVENTS;
- com->extra_state |= CSE_ODONE;
- setsofttty();
- }
- cd_outb(iobase, CD1400_SRER, cy_align,
- com->intr_enable
- &= ~CD1400_SRER_TXMPTY);
- goto terminate_tx_service;
- }
if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
u_char *ioptr;
u_int ocount;
@@ -1457,24 +1360,9 @@ cont:
} else {
/* output just completed */
com->state &= ~CS_BUSY;
-
- /*
- * The setting of CSE_ODONE may be
- * stale here. We currently only
- * use it when CS_BUSY is set, and
- * fixing it when we clear CS_BUSY
- * is easiest.
- */
- if (com->extra_state & CSE_ODONE) {
- com_events -= LOTS_OF_EVENTS;
- com->extra_state &= ~CSE_ODONE;
- }
-
cd_outb(iobase, CD1400_SRER, cy_align,
com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ &= ~CD1400_SRER_TXRDY);
}
if (!(com->state & CS_ODONE)) {
com_events += LOTS_OF_EVENTS;
@@ -1487,11 +1375,11 @@ cont:
}
/* terminate service context */
-terminate_tx_service:
#ifdef PollMode
cd_outb(iobase, CD1400_TIR, cy_align,
save_tir
& ~(CD1400_TIR_RDIREQ | CD1400_TIR_RBUSY));
+ cd_outb(iobase, CD1400_CAR, cy_align, save_car);
#else
cd_outb(iobase, CD1400_EOSRR, cy_align, 0);
#endif
@@ -1499,7 +1387,7 @@ terminate_tx_service:
}
/* ensure an edge for the next interrupt */
- cy_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
+ cd_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0);
schedsofttty();
@@ -1524,6 +1412,7 @@ sioioctl(dev, cmd, data, flag, p)
{
struct com_s *com;
int error;
+ cy_addr iobase;
int mynor;
int s;
struct tty *tp;
@@ -1534,6 +1423,7 @@ sioioctl(dev, cmd, data, flag, p)
mynor = minor(dev);
com = com_addr(MINOR_TO_UNIT(mynor));
+ iobase = com->iobase;
if (mynor & CONTROL_MASK) {
struct termios *ct;
@@ -1609,21 +1499,17 @@ sioioctl(dev, cmd, data, flag, p)
splx(s);
return (error);
}
+ cd_outb(iobase, CD1400_CAR, com->cy_align,
+ MINOR_TO_UNIT(mynor) & CD1400_CAR_CHAN);
switch (cmd) {
- case TIOCSBRK:
#if 0
+ case TIOCSBRK:
outb(iobase + com_cfcr, com->cfcr_image |= CFCR_SBREAK);
-#else
- cd_etc(com, CD1400_ETC_SENDBREAK);
-#endif
break;
case TIOCCBRK:
-#if 0
outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
-#else
- cd_etc(com, CD1400_ETC_STOPBREAK);
-#endif
break;
+#endif /* 0 */
case TIOCSDTR:
(void)commctl(com, TIOCM_DTR, DMBIS);
break;
@@ -1689,6 +1575,7 @@ repeat:
u_char *buf;
struct com_s *com;
u_char *ibuf;
+ cy_addr iobase;
int incc;
struct tty *tp;
@@ -1747,8 +1634,11 @@ repeat:
outb(com->modem_ctl_port,
com->mcr_image |= MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image |= com->mcr_rts);
+ iobase = com->iobase,
+ cd_outb(iobase, CD1400_CAR, com->cy_align,
+ unit & CD1400_CAR_CHAN),
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image |= com->mcr_rts);
#endif
enable_intr();
com->ibuf = ibuf;
@@ -1768,25 +1658,12 @@ repeat:
(*linesw[tp->t_line].l_modem)
(tp, com->prev_modem_status & MSR_DCD);
}
- if (com->extra_state & CSE_ODONE) {
- disable_intr();
- com_events -= LOTS_OF_EVENTS;
- com->extra_state &= ~CSE_ODONE;
- enable_intr();
- if (!(com->state & CS_BUSY)) {
- tp->t_state &= ~TS_BUSY;
- ttwwakeup(com->tp);
- }
- if (com->etc != ETC_NONE) {
- if (com->etc == ETC_BREAK_ENDED)
- com->etc = ETC_NONE;
- wakeup(&com->etc);
- }
- }
if (com->state & CS_ODONE) {
disable_intr();
com_events -= LOTS_OF_EVENTS;
com->state &= ~CS_ODONE;
+ if (!(com->state & CS_BUSY))
+ com->tp->t_state &= ~TS_BUSY;
enable_intr();
(*linesw[tp->t_line].l_start)(tp);
}
@@ -1858,6 +1735,7 @@ comparam(tp, t)
u_long cy_clock;
int idivisor;
int iflag;
+ cy_addr iobase;
int iprescaler;
int itimeout;
int odivisor;
@@ -1883,19 +1761,21 @@ comparam(tp, t)
return (EINVAL);
/* parameters are OK, convert them to the com struct and the device */
+ iobase = com->iobase;
s = spltty();
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
if (odivisor == 0)
(void)commctl(com, TIOCM_DTR, DMBIC); /* hang up line */
else
(void)commctl(com, TIOCM_DTR, DMBIS);
if (idivisor != 0) {
- cd_setreg(com, CD1400_RBPR, idivisor);
- cd_setreg(com, CD1400_RCOR, iprescaler);
+ cd_outb(iobase, CD1400_RBPR, com->cy_align, idivisor);
+ cd_outb(iobase, CD1400_RCOR, com->cy_align, iprescaler);
}
if (odivisor != 0) {
- cd_setreg(com, CD1400_TBPR, odivisor);
- cd_setreg(com, CD1400_TCOR, oprescaler);
+ cd_outb(iobase, CD1400_TBPR, com->cy_align, odivisor);
+ cd_outb(iobase, CD1400_TCOR, com->cy_align, oprescaler);
}
/*
@@ -1908,20 +1788,20 @@ comparam(tp, t)
| (cflag & CREAD ? CD1400_CCR_RCVEN : CD1400_CCR_RCVDIS);
if (opt != com->channel_control) {
com->channel_control = opt;
- cd1400_channel_cmd(com, opt);
+ cd1400_channel_cmd(iobase, opt, com->cy_align);
}
#ifdef Smarts
/* set special chars */
/* XXX if one is _POSIX_VDISABLE, can't use some others */
if (t->c_cc[VSTOP] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR1, t->c_cc[VSTOP]);
+ cd_outb(iobase, CD1400_SCHR1, com->cy_align, t->c_cc[VSTOP]);
if (t->c_cc[VSTART] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR2, t->c_cc[VSTART]);
+ cd_outb(iobase, CD1400_SCHR2, com->cy_align, t->c_cc[VSTART]);
if (t->c_cc[VINTR] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR3, t->c_cc[VINTR]);
+ cd_outb(iobase, CD1400_SCHR3, com->cy_align, t->c_cc[VINTR]);
if (t->c_cc[VSUSP] != _POSIX_VDISABLE)
- cd_setreg(com, CD1400_SCHR4, t->c_cc[VSUSP]);
+ cd_outb(iobase, CD1400_SCHR4, com->cy_align, t->c_cc[VSUSP]);
#endif
/*
@@ -1968,14 +1848,14 @@ comparam(tp, t)
cor_change = 0;
if (opt != com->cor[0]) {
cor_change |= CD1400_CCR_COR1;
- cd_setreg(com, CD1400_COR1, com->cor[0] = opt);
+ cd_outb(iobase, CD1400_COR1, com->cy_align, com->cor[0] = opt);
}
/*
* Set receive time-out period, normally to max(one char time, 5 ms).
*/
if (t->c_ispeed == 0)
- itimeout = cd_getreg(com, CD1400_RTPR);
+ itimeout = cd_inb(iobase, CD1400_RTPR, com->cy_align);
else {
itimeout = (1000 * bits + t->c_ispeed - 1) / t->c_ispeed;
#ifdef SOFT_HOTCHAR
@@ -1991,7 +1871,7 @@ comparam(tp, t)
itimeout = t->c_cc[VTIME] * 10;
if (itimeout > 255)
itimeout = 255;
- cd_setreg(com, CD1400_RTPR, itimeout);
+ cd_outb(iobase, CD1400_RTPR, com->cy_align, itimeout);
/*
* set channel option register 2 -
@@ -2008,12 +1888,10 @@ comparam(tp, t)
if (cflag & CCTS_OFLOW)
opt |= CD1400_COR2_CCTS_OFLOW;
#endif
- disable_intr();
if (opt != com->cor[1]) {
cor_change |= CD1400_CCR_COR2;
- cd_setreg(com, CD1400_COR2, com->cor[1] = opt);
+ cd_outb(iobase, CD1400_COR2, com->cy_align, com->cor[1] = opt);
}
- enable_intr();
/*
* set channel option register 3 -
@@ -2030,12 +1908,13 @@ comparam(tp, t)
#endif
if (opt != com->cor[2]) {
cor_change |= CD1400_CCR_COR3;
- cd_setreg(com, CD1400_COR3, com->cor[2] = opt);
+ cd_outb(iobase, CD1400_COR3, com->cy_align, com->cor[2] = opt);
}
/* notify the CD1400 if COR1-3 have changed */
if (cor_change)
- cd1400_channel_cmd(com, CD1400_CCR_CMDCORCHG | cor_change);
+ cd1400_channel_cmd(iobase, CD1400_CCR_CMDCORCHG | cor_change,
+ com->cy_align);
/*
* set channel option register 4 -
@@ -2058,12 +1937,8 @@ comparam(tp, t)
opt |= CD1400_COR4_INLCR;
#endif
if (iflag & IGNBRK)
- opt |= CD1400_COR4_IGNBRK | CD1400_COR4_NOBRKINT;
- /*
- * The `-ignbrk -brkint parmrk' case is not handled by the hardware,
- * so only tell the hardware about -brkint if -parmrk.
- */
- if (!(iflag & (BRKINT | PARMRK)))
+ opt |= CD1400_COR4_IGNBRK;
+ if (!(iflag & BRKINT))
opt |= CD1400_COR4_NOBRKINT;
#if 0
/* XXX using this "intelligence" breaks reporting of overruns. */
@@ -2078,7 +1953,7 @@ comparam(tp, t)
#else
opt |= CD1400_COR4_PFO_EXCEPTION;
#endif
- cd_setreg(com, CD1400_COR4, opt);
+ cd_outb(iobase, CD1400_COR4, com->cy_align, opt);
/*
* set channel option register 5 -
@@ -2095,7 +1970,7 @@ comparam(tp, t)
if (t->c_oflag & OCRNL)
opt |= CD1400_COR5_OCRNL;
#endif
- cd_setreg(com, CD1400_COR5, opt);
+ cd_outb(iobase, CD1400_COR5, com->cy_align, opt);
/*
* We always generate modem status change interrupts for CD changes.
@@ -2117,7 +1992,7 @@ comparam(tp, t)
if (cflag & CCTS_OFLOW)
opt |= CD1400_MCOR1_CTSzd;
#endif
- cd_setreg(com, CD1400_MCOR1, opt);
+ cd_outb(iobase, CD1400_MCOR1, com->cy_align, opt);
/*
* set modem change option register 2
@@ -2128,7 +2003,7 @@ comparam(tp, t)
if (cflag & CCTS_OFLOW)
opt |= CD1400_MCOR2_CTSod;
#endif
- cd_setreg(com, CD1400_MCOR2, opt);
+ cd_outb(iobase, CD1400_MCOR2, com->cy_align, opt);
/*
* XXX should have done this long ago, but there is too much state
@@ -2156,8 +2031,8 @@ comparam(tp, t)
#if 0
outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image |= com->mcr_rts);
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image |= com->mcr_rts);
#endif
}
@@ -2188,16 +2063,12 @@ comparam(tp, t)
#endif
if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
if (!(com->intr_enable & CD1400_SRER_TXRDY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable |= CD1400_SRER_TXRDY);
} else {
if (com->intr_enable & CD1400_SRER_TXRDY)
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable &= ~CD1400_SRER_TXRDY);
}
enable_intr();
@@ -2211,6 +2082,7 @@ comstart(tp)
struct tty *tp;
{
struct com_s *com;
+ cy_addr iobase;
int s;
#ifdef CyDebug
bool_t started;
@@ -2219,6 +2091,7 @@ comstart(tp)
unit = DEV_TO_UNIT(tp->t_dev);
com = com_addr(unit);
+ iobase = com->iobase;
s = spltty();
#ifdef CyDebug
@@ -2227,29 +2100,26 @@ comstart(tp)
#endif
disable_intr();
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
if (tp->t_state & TS_TTSTOP) {
com->state &= ~CS_TTGO;
if (com->intr_enable & CD1400_SRER_TXRDY)
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXRDY
- | CD1400_SRER_TXMPTY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable &= ~CD1400_SRER_TXRDY);
} else {
com->state |= CS_TTGO;
if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)
&& !(com->intr_enable & CD1400_SRER_TXRDY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER, com->cy_align,
+ com->intr_enable |= CD1400_SRER_TXRDY);
}
if (tp->t_state & TS_TBLOCK) {
if (com->mcr_image & com->mcr_rts && com->state & CS_RTS_IFLOW)
#if 0
outb(com->modem_ctl_port, com->mcr_image &= ~MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image &= ~com->mcr_rts);
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image &= ~com->mcr_rts);
#endif
} else {
if (!(com->mcr_image & com->mcr_rts)
@@ -2258,8 +2128,8 @@ comstart(tp)
#if 0
outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS);
#else
- cd_setreg(com, com->mcr_rts_reg,
- com->mcr_image |= com->mcr_rts);
+ cd_outb(iobase, com->mcr_rts_reg, com->cy_align,
+ com->mcr_image |= com->mcr_rts);
#endif
}
enable_intr();
@@ -2294,11 +2164,10 @@ comstart(tp)
com->state |= CS_BUSY;
if (com->state >= (CS_BUSY | CS_TTGO
| CS_ODEVREADY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER,
+ com->cy_align,
+ com->intr_enable
+ |= CD1400_SRER_TXRDY);
}
enable_intr();
}
@@ -2324,11 +2193,10 @@ comstart(tp)
com->state |= CS_BUSY;
if (com->state >= (CS_BUSY | CS_TTGO
| CS_ODEVREADY))
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable
- & ~CD1400_SRER_TXMPTY
- | CD1400_SRER_TXRDY);
+ cd_outb(iobase, CD1400_SRER,
+ com->cy_align,
+ com->intr_enable
+ |= CD1400_SRER_TXRDY);
}
enable_intr();
}
@@ -2354,39 +2222,25 @@ siostop(tp, rw)
int rw;
{
struct com_s *com;
- bool_t wakeup_etc;
com = com_addr(DEV_TO_UNIT(tp->t_dev));
- wakeup_etc = FALSE;
disable_intr();
if (rw & FWRITE) {
com->obufs[0].l_queued = FALSE;
com->obufs[1].l_queued = FALSE;
- if (com->extra_state & CSE_ODONE) {
- com_events -= LOTS_OF_EVENTS;
- com->extra_state &= ~CSE_ODONE;
- if (com->etc != ETC_NONE) {
- if (com->etc == ETC_BREAK_ENDED)
- com->etc = ETC_NONE;
- wakeup_etc = TRUE;
- }
- }
- com->tp->t_state &= ~TS_BUSY;
if (com->state & CS_ODONE)
com_events -= LOTS_OF_EVENTS;
com->state &= ~(CS_ODONE | CS_BUSY);
+ com->tp->t_state &= ~TS_BUSY;
}
if (rw & FREAD) {
- /* XXX no way to reset only input fifo. */
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
enable_intr();
- if (wakeup_etc)
- wakeup(&com->etc);
- if (rw & FWRITE && com->etc == ETC_NONE)
- cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF);
comstart(tp);
+
+ /* XXX should clear h/w fifos too. */
}
static struct tty *
@@ -2411,9 +2265,11 @@ commctl(com, bits, how)
int bits;
int how;
{
+ cy_addr iobase;
int mcr;
int msr;
+ iobase = com->iobase;
if (how == DMGET) {
if (com->channel_control & CD1400_CCR_RCVEN)
bits |= TIOCM_LE;
@@ -2432,7 +2288,7 @@ commctl(com, bits, how)
* reading the status register doesn't clear pending modem
* status change interrupts.
*/
- msr = cd_getreg(com, CD1400_MSVR2);
+ msr = cd_inb(iobase, CD1400_MSVR2, com->cy_align);
if (msr & MSR_CTS)
bits |= TIOCM_CTS;
@@ -2454,18 +2310,18 @@ commctl(com, bits, how)
switch (how) {
case DMSET:
com->mcr_image = mcr;
- cd_setreg(com, CD1400_MSVR1, mcr);
- cd_setreg(com, CD1400_MSVR2, mcr);
+ cd_outb(iobase, CD1400_MSVR1, com->cy_align, mcr);
+ cd_outb(iobase, CD1400_MSVR2, com->cy_align, mcr);
break;
case DMBIS:
com->mcr_image = mcr = com->mcr_image | mcr;
- cd_setreg(com, CD1400_MSVR1, mcr);
- cd_setreg(com, CD1400_MSVR2, mcr);
+ cd_outb(iobase, CD1400_MSVR1, com->cy_align, mcr);
+ cd_outb(iobase, CD1400_MSVR2, com->cy_align, mcr);
break;
case DMBIC:
com->mcr_image = mcr = com->mcr_image & ~mcr;
- cd_setreg(com, CD1400_MSVR1, mcr);
- cd_setreg(com, CD1400_MSVR2, mcr);
+ cd_outb(iobase, CD1400_MSVR1, com->cy_align, mcr);
+ cd_outb(iobase, CD1400_MSVR2, com->cy_align, mcr);
break;
}
enable_intr();
@@ -2574,6 +2430,7 @@ disc_optim(tp, t, com)
struct com_s *com;
{
#ifndef SOFT_HOTCHAR
+ cy_addr iobase;
u_char opt;
#endif
@@ -2593,15 +2450,19 @@ disc_optim(tp, t, com)
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
com->hotchar = linesw[tp->t_line].l_hotchar;
#ifndef SOFT_HOTCHAR
+ iobase = com->iobase;
+ cd_outb(iobase, CD1400_CAR, com->cy_align, com->unit & CD1400_CAR_CHAN);
opt = com->cor[2] & ~CD1400_COR3_SCD34;
if (com->hotchar != 0) {
- cd_setreg(com, CD1400_SCHR3, com->hotchar);
- cd_setreg(com, CD1400_SCHR4, com->hotchar);
+ cd_outb(iobase, CD1400_SCHR3, com->cy_align, com->hotchar);
+ cd_outb(iobase, CD1400_SCHR4, com->cy_align, com->hotchar);
opt |= CD1400_COR3_SCD34;
}
if (opt != com->cor[2]) {
- cd_setreg(com, CD1400_COR3, com->cor[2] = opt);
- cd1400_channel_cmd(com, CD1400_CCR_CMDCORCHG | CD1400_CCR_COR3);
+ cd_outb(iobase, CD1400_COR3, com->cy_align, com->cor[2] = opt);
+ cd1400_channel_cmd(com->iobase,
+ CD1400_CCR_CMDCORCHG | CD1400_CCR_COR3,
+ com->cy_align);
}
#endif
}
@@ -2668,129 +2529,27 @@ comspeed(speed, cy_clock, prescaler_io)
}
static void
-cd1400_channel_cmd(com, cmd)
- struct com_s *com;
- int cmd;
-{
- cd1400_channel_cmd_wait(com);
- cd_setreg(com, CD1400_CCR, cmd);
- cd1400_channel_cmd_wait(com);
-}
-
-static void
-cd1400_channel_cmd_wait(com)
- struct com_s *com;
-{
- struct timeval start;
- struct timeval tv;
- long usec;
-
- if (cd_getreg(com, CD1400_CCR) == 0)
- return;
- microtime(&start);
- for (;;) {
- if (cd_getreg(com, CD1400_CCR) == 0)
- return;
- microtime(&tv);
- usec = 1000000 * (tv.tv_sec - start.tv_sec) +
- tv.tv_usec - start.tv_usec;
- if (usec >= 5000) {
- log(LOG_ERR,
- "cy%d: channel command timeout (%ld usec)\n",
- com->unit, usec);
- return;
- }
- }
-}
-
-static void
-cd_etc(com, etc)
- struct com_s *com;
- int etc;
-{
- /*
- * We can't change the hardware's ETC state while there are any
- * characters in the tx fifo, since those characters would be
- * interpreted as commands! Unputting characters from the fifo
- * is difficult, so we wait up to 12 character times for the fifo
- * to drain. The command will be delayed for up to 2 character
- * times for the tx to become empty. Unputting characters from
- * the tx holding and shift registers is impossible, so we wait
- * for the tx to become empty so that the command is sure to be
- * executed soon after we issue it.
- */
- disable_intr();
- if (com->etc == etc) {
- enable_intr();
- goto wait;
- }
- if (etc == CD1400_ETC_SENDBREAK
- && (com->etc == ETC_BREAK_STARTING
- || com->etc == ETC_BREAK_STARTED)
- || etc == CD1400_ETC_STOPBREAK
- && (com->etc == ETC_BREAK_ENDING || com->etc == ETC_BREAK_ENDED
- || com->etc == ETC_NONE)) {
- enable_intr();
- return;
- }
- com->etc = etc;
- cd_setreg(com, CD1400_SRER,
- com->intr_enable
- = com->intr_enable & ~CD1400_SRER_TXRDY | CD1400_SRER_TXMPTY);
- enable_intr();
-wait:
- while (com->etc == etc
- && tsleep(&com->etc, TTIPRI | PCATCH, "cyetc", 0) == 0)
- continue;
-}
-
-static int
-cd_getreg(com, reg)
- struct com_s *com;
- int reg;
-{
- struct com_s *basecom;
- u_char car;
- int cy_align;
- u_long ef;
+cd1400_channel_cmd(iobase, cmd, cy_align)
cy_addr iobase;
- int val;
-
- basecom = com_addr(com->unit & ~(CD1400_NO_OF_CHANNELS - 1));
- car = com->unit & CD1400_CAR_CHAN;
- cy_align = com->cy_align;
- iobase = com->iobase;
- ef = read_eflags();
- disable_intr();
- if (basecom->car != car)
- cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car);
- val = cd_inb(iobase, reg, cy_align);
- write_eflags(ef);
- return (val);
-}
-
-static void
-cd_setreg(com, reg, val)
- struct com_s *com;
- int reg;
- int val;
-{
- struct com_s *basecom;
- u_char car;
+ int cmd;
int cy_align;
- u_long ef;
- cy_addr iobase;
-
- basecom = com_addr(com->unit & ~(CD1400_NO_OF_CHANNELS - 1));
- car = com->unit & CD1400_CAR_CHAN;
- cy_align = com->cy_align;
- iobase = com->iobase;
- ef = read_eflags();
- disable_intr();
- if (basecom->car != car)
- cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car);
- cd_outb(iobase, reg, cy_align, val);
- write_eflags(ef);
+{
+ /* XXX hsu@clinet.fi: This is always more dependent on ISA bus speed,
+ as the card is probed every round? Replaced delaycount with 8k.
+ Either delaycount has to be implemented in FreeBSD or more sensible
+ way of doing these should be implemented. DELAY isn't enough here.
+ */
+ u_int maxwait = 5 * 8 * 1024; /* approx. 5 ms */
+
+ /* wait for processing of previous command to complete */
+ while (cd_inb(iobase, CD1400_CCR, cy_align) && maxwait--)
+ ;
+
+ if (!maxwait)
+ log(LOG_ERR, "cy: channel command timeout (%d loops) - arrgh\n",
+ 5 * 8 * 1024);
+
+ cd_outb(iobase, CD1400_CCR, cy_align, cmd);
}
#ifdef CyDebug
@@ -2814,15 +2573,17 @@ cystatus(unit)
iobase = com->iobase;
printf("\n");
printf("cd1400 base address:\\tt%p\n", iobase);
+ cd_outb(iobase, CD1400_CAR, com->cy_align, unit & CD1400_CAR_CHAN);
printf("saved channel_control:\t\t0x%02x\n", com->channel_control);
printf("saved cor1-3:\t\t\t0x%02x 0x%02x 0x%02x\n",
com->cor[0], com->cor[1], com->cor[2]);
printf("service request enable reg:\t0x%02x (0x%02x cached)\n",
- cd_getreg(com, CD1400_SRER), com->intr_enable);
+ cd_inb(iobase, CD1400_SRER, com->cy_align), com->intr_enable);
printf("service request register:\t0x%02x\n",
cd_inb(iobase, CD1400_SVRR, com->cy_align));
printf("modem status:\t\t\t0x%02x (0x%02x cached)\n",
- cd_getreg(com, CD1400_MSVR2), com->prev_modem_status);
+ cd_inb(iobase, CD1400_MSVR2, com->cy_align),
+ com->prev_modem_status);
printf("rx/tx/mdm interrupt registers:\t0x%02x 0x%02x 0x%02x\n",
cd_inb(iobase, CD1400_RIR, com->cy_align),
cd_inb(iobase, CD1400_TIR, com->cy_align),
diff --git a/sys/i386/isa/cyreg.h b/sys/i386/isa/cyreg.h
index baedda4175b2f..d98cfd80ece0a 100644
--- a/sys/i386/isa/cyreg.h
+++ b/sys/i386/isa/cyreg.h
@@ -26,50 +26,32 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cyreg.h,v 1.7 1998/08/13 19:03:22 bde Exp $
+ * $Id: cyreg.h,v 1.6 1998/08/13 13:54:10 bde Exp $
*/
/*
* Definitions for Cyclades Cyclom-Y serial boards.
*/
-/*
- * Cyclades register offsets. These are physical offsets for ISA boards
- * and physical offsets divided by 2 for PCI boards.
- */
-#define CY8_SVCACKR 0x100 /* (r) */
-#define CY8_SVCACKT 0x200 /* (r) */
-#define CY8_SVCACKM 0x300 /* (r) */
-#define CY16_RESET 0x1400 /* (r) */
-#define CY_CLEAR_INTR 0x1800 /* intr ack address (w) */
+#define CY8_SVCACKR 0x100
+#define CY8_SVCACKT 0x200
+#define CY8_SVCACKM 0x300
+#define CY16_RESET 0x0a00
+#define CY_CLEAR_INTR 0x0c00 /* intr ack address */
#define CY_MAX_CD1400s 8 /* for Cyclom-32Y */
#define CY_CLOCK(version) ((version) >= 0x48 ? 60000000 : 25000000)
#define CY_RTS_DTR_SWAPPED(version) ((version) >= 0x48)
-/*
- * The `cd' macros are for access to cd1400 registers. The `cy' macros
- * are for access to Cyclades registers. Both sets of macros scale the
- * register number to get an offset, but the scales are different for
- * mostly historical reasons.
- */
#ifdef CyDebug
-#define cd_inb(iobase, reg, cy_align) \
- (++cd_inbs, *((iobase) + (2 * (reg) << (cy_align))))
-#define cy_inb(iobase, reg, cy_align) \
- (++cy_inbs, *((iobase) + ((reg) << (cy_align))))
-#define cd_outb(iobase, reg, cy_align, val) \
- (++cd_outbs, (void)(*((iobase) + (2 * (reg) << (cy_align))) = (val)))
-#define cy_outb(iobase, reg, cy_align, val) \
- (++cy_outbs, (void)(*((iobase) + ((reg) << (cy_align))) = (val)))
+#define cd_inb(iobase, reg, cy_align) (++cd_inbs, *((iobase) + ((reg)*2 << (cy_align))))
+#define cy_inb(iobase, reg) (++cy_inbs, *((iobase) + (reg)))
+#define cd_outb(iobase, reg, cy_align, val) (++cd_outbs, (void)(*((iobase) + ((reg)*2 << (cy_align))) = (val)))
+#define cy_outb(iobase, reg, val) (++cy_outbs, (void)(*((iobase) + (reg)) = (val)))
#else
-#define cd_inb(iobase, reg, cy_align) \
- (*((iobase) + (2 * (reg) << (cy_align))))
-#define cy_inb(iobase, reg, cy_align) \
- (*((iobase) + ((reg) << (cy_align))))
-#define cd_outb(iobase, reg, cy_align, val) \
- ((void)(*((iobase) + (2 * (reg) << (cy_align))) = (val)))
-#define cy_outb(iobase, reg, cy_align, val) \
- ((void)(*((iobase) + ((reg) << (cy_align))) = (val)))
+#define cd_inb(iobase, reg, cy_align) (*((iobase) + ((reg)*2 << (cy_align))))
+#define cy_inb(iobase, reg) (*((iobase) + (reg)))
+#define cd_outb(iobase, reg, cy_align, val) ((void)(*((iobase) + ((reg)*2 << (cy_align))) = (val)))
+#define cy_outb(iobase, reg, val) ((void)(*((iobase) + (reg)) = (val)))
#endif
diff --git a/sys/i386/isa/diskslice_machdep.c b/sys/i386/isa/diskslice_machdep.c
index adfd39c52e949..ab9d4bac6948d 100644
--- a/sys/i386/isa/diskslice_machdep.c
+++ b/sys/i386/isa/diskslice_machdep.c
@@ -35,7 +35,7 @@
*
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: diskslice_machdep.c,v 1.31 1998/08/10 07:22:14 phk Exp $
+ * $Id: diskslice_machdep.c,v 1.30 1998/07/25 16:35:06 bde Exp $
*/
#include <sys/param.h>
@@ -405,7 +405,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c
index 9972a38f5c358..d04f98a1f388c 100644
--- a/sys/i386/isa/fd.c
+++ b/sys/i386/isa/fd.c
@@ -5,10 +5,6 @@
* This code is derived from software contributed to Berkeley by
* Don Ahn.
*
- * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)
- * aided by the Linux floppy driver modifications from David Bateman
- * (dbateman@eng.uts.edu.au).
- *
* Copyright (c) 1993, 1994 by
* jc@irbs.UUCP (John Capo)
* vak@zebub.msk.su (Serge Vakulenko)
@@ -47,10 +43,14 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.131 1999/01/15 09:15:27 bde Exp $
+ * $Id: fd.c,v 1.122 1998/09/15 08:15:28 gibbs Exp $
*
*/
+#include "ft.h"
+#if NFT < 1
+#undef NFDC
+#endif
#include "fd.h"
#include "opt_devfs.h"
#include "opt_fdc.h"
@@ -76,6 +76,10 @@
#include <i386/isa/fdc.h>
#include <i386/isa/rtc.h>
#include <machine/stdarg.h>
+#if NFT > 0
+#include <sys/ftape.h>
+#include <i386/isa/ftreg.h>
+#endif
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -85,10 +89,6 @@
/* configuration flags */
#define FDC_PRETEND_D0 (1 << 0) /* pretend drive 0 to be there */
-#ifdef FDC_YE
-#define FDC_IS_PCMCIA (1 << 1) /* if successful probe, then it's
- a PCMCIA device */
-#endif
/* internally used only, not really from CMOS: */
#define RTCFDT_144M_PRETENDED 0x1000
@@ -190,9 +190,15 @@ static struct fd_data {
* fdsu is the floppy drive unit number on that controller. (sub-unit) *
\***********************************************************************/
-#ifdef FDC_YE
-#include "card.h"
-static int yeattach(struct isa_device *);
+#if NFT > 0
+int ftopen(dev_t, int);
+int ftintr(ftu_t ftu);
+int ftclose(dev_t, int);
+void ftstrategy(struct buf *);
+int ftioctl(dev_t, unsigned long, caddr_t, int, struct proc *);
+int ftdump(dev_t);
+int ftsize(dev_t);
+int ftattach(struct isa_device *, struct isa_device *, int);
#endif
/* autoconfig functions */
@@ -215,7 +221,6 @@ static int fd_in(fdcu_t, int *);
static void fdstart(fdcu_t);
static timeout_t fd_iotimeout;
static timeout_t fd_pseudointr;
-static ointhand2_t fdintr;
static int fdstate(fdcu_t, fdc_p);
static int retrier(fdcu_t);
static int fdformat(dev_t, struct fd_formb *, struct proc *);
@@ -238,9 +243,6 @@ static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
#define MOTORWAIT 10
#define IOTIMEDOUT 11
#define RESETCOMPLETE 12
-#ifdef FDC_YE
-#define PIOREAD 13
-#endif
#ifdef FDC_DEBUG
static char const * const fdstates[] =
@@ -258,9 +260,6 @@ static char const * const fdstates[] =
"MOTORWAIT",
"IOTIMEDOUT",
"RESETCOMPLETE",
-#ifdef FDC_YE
-"PIOREAD",
-#endif
};
/* CAUTION: fd_debug causes huge amounts of logging output */
@@ -272,91 +271,6 @@ static int volatile fd_debug = 0;
#define TRACE1(arg1, arg2)
#endif /* FDC_DEBUG */
-#ifdef FDC_YE
-#if NCARD > 0
-#include <sys/select.h>
-#include <sys/module.h>
-#include <pccard/cardinfo.h>
-#include <pccard/driver.h>
-#include <pccard/slot.h>
-
-/*
- * PC-Card (PCMCIA) specific code.
- */
-static int yeinit(struct pccard_devinfo *); /* init device */
-static void yeunload(struct pccard_devinfo *); /* Disable driver */
-static int yeintr(struct pccard_devinfo *); /* Interrupt handler */
-
-PCCARD_MODULE(fdc, yeinit, yeunload, yeintr, 0, bio_imask);
-
-/*
- * this is the secret PIO data port (offset from base)
- */
-#define FDC_YE_DATAPORT 6
-
-/*
- * Initialize the device - called from Slot manager.
- */
-static int yeinit(struct pccard_devinfo *devi)
-{
- fdc_p fdc = &fdc_data[devi->isahd.id_unit];
-
- /* validate unit number. */
- if (devi->isahd.id_unit >= NFDC)
- return(ENODEV);
- fdc->baseport = devi->isahd.id_iobase;
- /*
- * reset controller
- */
- outb(fdc->baseport+FDOUT, 0);
- DELAY(100);
- outb(fdc->baseport+FDOUT, FDO_FRST);
-
- /*
- * wire into system
- */
- if (yeattach(&devi->isahd) == 0)
- return(ENXIO);
-
- return(0);
-}
-
-/*
- * yeunload - unload the driver and clear the table.
- * XXX TODO:
- * This is usually called when the card is ejected, but
- * can be caused by a modunload of a controller driver.
- * The idea is to reset the driver's view of the device
- * and ensure that any driver entry points such as
- * read and write do not hang.
- */
-static void yeunload(struct pccard_devinfo *devi)
-{
- if (fd_data[devi->isahd.id_unit].type == NO_TYPE)
- return;
-
- /*
- * this prevents Fdopen() and fdstrategy() from attempting
- * to access unloaded controller
- */
- fd_data[devi->isahd.id_unit].type = NO_TYPE;
-
- printf("fdc%d: unload\n", devi->isahd.id_unit);
-}
-
-/*
- * yeintr - Shared interrupt called from
- * front end of PC-Card handler.
- */
-static int yeintr(struct pccard_devinfo *devi)
-{
- fdintr((fdcu_t)devi->isahd.id_unit);
- return(1);
-}
-#endif /* NCARD > 0 */
-#endif /* FDC_YE */
-
-
/* autoconfig structure */
struct isa_driver fdcdriver = {
@@ -395,7 +309,7 @@ fdc_err(fdcu_t fdcu, const char *s)
printf("fdc%d: %s", fdcu, s);
else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX)
printf("fdc%d: too many errors, not logging any more\n",
- fdcu);
+ fdcu);
}
return FD_FAILED;
@@ -425,7 +339,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (out_fdc(fdcu, va_arg(ap, int)) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %x failed at out byte %d of %d\n",
cmd, n + 1, n_out);
return fdc_err(fdcu, msg);
@@ -438,7 +352,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (fd_in(fdcu, ptr) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %02x failed at in byte %d of %d\n",
cmd, n + 1, n_in);
return fdc_err(fdcu, msg);
@@ -600,14 +514,6 @@ fdprobe(struct isa_device *dev)
{
return(0);
}
-#ifdef FDC_YE
- /*
- * don't succeed on probe; wait
- * for PCCARD subsystem to do it
- */
- if (dev->id_flags & FDC_IS_PCMCIA)
- return(0);
-#endif
return (IO_FDCSIZE);
}
@@ -623,6 +529,9 @@ fdattach(struct isa_device *dev)
fdc_p fdc = fdc_data + fdcu;
fd_p fd;
int fdsu, st0, st3, i;
+#if NFT > 0
+ int unithasfd;
+#endif
struct isa_device *fdup;
int ic_type = 0;
#ifdef DEVFS
@@ -631,7 +540,6 @@ fdattach(struct isa_device *dev)
int typesize;
#endif
- dev->id_ointr = fdintr;
fdc->fdcu = fdcu;
fdc->flags |= FDC_ATTACHED;
fdc->dmachan = dev->id_drq;
@@ -649,7 +557,7 @@ fdattach(struct isa_device *dev)
continue;
fdu = fdup->id_unit;
fd = &fd_data[fdu];
- if (fdu >= (NFD))
+ if (fdu >= (NFD+NFT))
continue;
fdsu = fdup->id_physid;
/* look up what bios thinks we have */
@@ -666,8 +574,26 @@ fdattach(struct isa_device *dev)
}
/* is there a unit? */
if ((fdt == RTCFDT_NONE)
+#if NFT > 0
+ || (fdsu >= DRVS_PER_CTLR)) {
+#else
) {
fd->type = NO_TYPE;
+#endif
+#if NFT > 0
+ /* If BIOS says no floppy, or > 2nd device */
+ /* Probe for and attach a floppy tape. */
+ /* Tell FT if there was already a disk */
+ /* with this unit number found. */
+
+ unithasfd = 0;
+ if (fdu < NFD && fd->type != NO_TYPE)
+ unithasfd = 1;
+ if (ftattach(dev, fdup, unithasfd))
+ continue;
+ if (fdsu < DRVS_PER_CTLR)
+ fd->type = NO_TYPE;
+#endif
continue;
}
@@ -713,7 +639,7 @@ fdattach(struct isa_device *dev)
enable_fifo(fdc) == 0) {
printf("fdc%d: FIFO enabled", fdcu);
printf(", %d bytes threshold\n",
- fifo_threshold);
+ fifo_threshold);
}
}
if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
@@ -856,10 +782,10 @@ fdattach(struct isa_device *dev)
}
for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
+ fd->bdevs[1 + NUMDENS + i] = devfs_link(fd->bdevs[0],
"fd%d%c", fdu, 'a' + i);
fd->cdevs[1 + NUMDENS + i] =
- devfs_makelink(fd->cdevs[0],
+ devfs_link(fd->cdevs[0],
"rfd%d%c", fdu, 'a' + i);
}
#endif /* DEVFS */
@@ -878,138 +804,6 @@ fdattach(struct isa_device *dev)
-#ifdef FDC_YE
-/*
- * this is a subset of fdattach() optimized for the Y-E Data
- * PCMCIA floppy drive.
- */
-static int yeattach(struct isa_device *dev)
-{
- fdcu_t fdcu = dev->id_unit;
- fdc_p fdc = fdc_data + fdcu;
- fdsu_t fdsu = 0; /* assume 1 drive per YE controller */
- fdu_t fdu;
- fd_p fd;
- int st0, st3, i;
-#ifdef DEVFS
- int mynor;
- int typemynor;
- int typesize;
-#endif
- fdc->fdcu = fdcu;
- /*
- * the FDC_PCMCIA flag is used to to indicate special PIO is used
- * instead of DMA
- */
- fdc->flags = FDC_ATTACHED|FDC_PCMCIA;
- fdc->state = DEVIDLE;
- /* reset controller, turn motor off, clear fdout mirror reg */
- outb(fdc->baseport + FDOUT, ((fdc->fdout = 0)));
- bufq_init(&fdc->head);
- /*
- * assume 2 drives/ "normal" controller
- */
- fdu = fdcu * 2;
- if (fdu >= NFD) {
- printf("fdu %d >= NFD\n",fdu);
- return(0);
- };
- fd = &fd_data[fdu];
-
- set_motor(fdcu, fdsu, TURNON);
- DELAY(1000000); /* 1 sec */
- fdc->fdct = FDC_NE765;
-
- if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
- (st3 & NE7_ST3_T0)) {
- /* if at track 0, first seek inwards */
- /* seek some steps: */
- (void)fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0);
- DELAY(300000); /* ...wait a moment... */
- (void)fd_sense_int(fdc, 0, 0); /* make ctrlr happy */
- }
-
- /* If we're at track 0 first seek inwards. */
- if ((fd_sense_drive_status(fdc, &st3) == 0) && (st3 & NE7_ST3_T0)) {
- /* Seek some steps... */
- if (fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0) == 0) {
- /* ...wait a moment... */
- DELAY(300000);
- /* make ctrlr happy: */
- (void)fd_sense_int(fdc, 0, 0);
- }
- }
-
- for(i = 0; i < 2; i++) {
- /*
- * we must recalibrate twice, just in case the
- * heads have been beyond cylinder 76, since most
- * FDCs still barf when attempting to recalibrate
- * more than 77 steps
- */
- /* go back to 0: */
- if (fd_cmd(fdcu, 2, NE7CMD_RECAL, fdsu, 0) == 0) {
- /* a second being enough for full stroke seek*/
- DELAY(i == 0? 1000000: 300000);
-
- /* anything responding? */
- if (fd_sense_int(fdc, &st0, 0) == 0 &&
- (st0 & NE7_ST0_EC) == 0)
- break; /* already probed succesfully */
- }
- }
-
- set_motor(fdcu, fdsu, TURNOFF);
-
- if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */
- return(0);
-
- fd->track = FD_NO_TRACK;
- fd->fdc = fdc;
- fd->fdsu = fdsu;
- fd->options = 0;
- printf("fdc%d: 1.44MB 3.5in PCMCIA\n", fdcu);
- fd->type = FD_1440;
-
-#ifdef DEVFS
- mynor = fdcu << 6;
- fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d", fdu);
- fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d", fdu);
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- typemynor = mynor | FD_1440;
- typesize = fd_types[FD_1440 - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- fd->bdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_BLK, UID_ROOT, GID_OPERATOR,
- 0640, "fd%d.%d", fdu, typesize);
- fd->cdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640,"rfd%d.%d", fdu, typesize);
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] = devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fdu, 'a' + i);
- }
-#endif /* DEVFS */
- return (1);
-}
-#endif
-
/****************************************************************************/
/* motor control stuff */
/* remember to not deselect the drive we're working on */
@@ -1216,6 +1010,11 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p)
int type = FDTYPE(minor(dev));
fdc_p fdc;
+#if NFT > 0
+ /* check for a tape open */
+ if (type & F_TAPE_TYPE)
+ return(ftopen(dev, flags));
+#endif
/* check bounds */
if (fdu >= NFD)
return(ENXIO);
@@ -1289,6 +1088,12 @@ fdclose(dev_t dev, int flags, int mode, struct proc *p)
{
fdu_t fdu = FDUNIT(minor(dev));
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ if (type & F_TAPE_TYPE)
+ return ftclose(dev, flags);
+#endif
fd_data[fdu].flags &= ~FD_OPEN;
fd_data[fdu].options &= ~FDOPT_NORETRY;
@@ -1326,18 +1131,21 @@ fdstrategy(struct buf *bp)
fd = &fd_data[fdu];
fdc = fd->fdc;
fdcu = fdc->fdcu;
-#ifdef FDC_YE
- if (fd->type == NO_TYPE) {
- bp->b_error = ENXIO;
+
+#if NFT > 0
+ if (FDTYPE(minor(bp->b_dev)) & F_TAPE_TYPE) {
+ /* ft tapes do not (yet) support strategy i/o */
+ bp->b_error = ENODEV;
bp->b_flags |= B_ERROR;
- /*
- * I _refuse_ to use a goto
- */
- biodone(bp);
- return;
- };
+ goto bad;
+ }
+ /* check for controller already busy with tape */
+ if (fdc->flags & FDC_TAPE_BUSY) {
+ bp->b_error = EBUSY;
+ bp->b_flags |= B_ERROR;
+ goto bad;
+ }
#endif
-
fdblk = 128 << (fd->ft->secsize);
if (!(bp->b_flags & B_FORMAT)) {
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
@@ -1467,46 +1275,21 @@ fd_pseudointr(void *arg1)
* keep calling the state machine until it returns a 0 *
* ALWAYS called at SPLBIO *
\***********************************************************************/
-static void
+void
fdintr(fdcu_t fdcu)
{
fdc_p fdc = fdc_data + fdcu;
+#if NFT > 0
+ fdu_t fdu = fdc->fdu;
+
+ if (fdc->flags & FDC_TAPE_BUSY)
+ (ftintr(fdu));
+ else
+#endif
while(fdstate(fdcu, fdc))
;
}
-#ifdef FDC_YE
-/*
- * magic pseudo-DMA initialization for YE FDC. Sets count and
- * direction
- */
-#define SET_BCDR(wr,cnt,port) outb(port,(((cnt)-1) & 0xff)); \
- outb(port+1,((wr ? 0x80 : 0) | ((((cnt)-1) >> 8) & 0x7f)))
-
-/*
- * fdcpio(): perform programmed IO read/write for YE PCMCIA floppy
- */
-static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
-{
- u_char *cptr = (u_char *)addr;
- fdc_p fdc = &fdc_data[fdcu];
- int io = fdc->baseport;
-
- if (flags & B_READ) {
- if (fdc->state != PIOREAD) {
- fdc->state = PIOREAD;
- return(0);
- };
- SET_BCDR(0,count,io);
- insb(io+FDC_YE_DATAPORT,cptr,count);
- } else {
- outsb(io+FDC_YE_DATAPORT,cptr,count);
- SET_BCDR(0,count,io);
- };
- return(1);
-}
-#endif /* FDC_YE */
-
/***********************************************************************\
* The controller state machine. *
* if it returns a non zero value, it should be called again immediatly *
@@ -1514,6 +1297,7 @@ static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
static int
fdstate(fdcu_t fdcu, fdc_p fdc)
{
+ struct subdev *sd;
int read, format, head, i, sec = 0, sectrac, st0, cyl, st3;
unsigned blknum = 0, b_cylinder = 0;
fdu_t fdu = fdc->fdu;
@@ -1522,15 +1306,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
struct fd_formb *finfo = NULL;
size_t fdblk;
- bp = fdc->bp;
- if (bp == NULL) {
- bp = bufq_first(&fdc->head);
- if (bp != NULL) {
- bufq_remove(&fdc->head, bp);
- fdc->bp = bp;
- }
- }
- if (bp == NULL) {
+ bp = bufq_first(&fdc->head);
+ if(!bp) {
/***********************************************\
* nothing left for this controller to do *
* Force into the IDLE state, *
@@ -1704,11 +1481,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
}
fd->track = b_cylinder;
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
sectrac = fd->ft->sectrac;
sec = blknum % (sectrac * fd->ft->heads);
head = sec / sectrac;
@@ -1750,12 +1524,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
if(format)
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- bp->b_bcount);
-#endif
/* formatting */
if(fd_cmd(fdcu, 6,
NE7CMD_FORMAT,
@@ -1776,24 +1544,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
}
else
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA) {
- /*
- * this seems to be necessary even when
- * reading data
- */
- SET_BCDR(1,fdblk,fdc->baseport);
-
- /*
- * perform the write pseudo-DMA before
- * the WRITE command is sent
- */
- if (!read)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- fdblk);
- }
-#endif
if (fd_cmd(fdcu, 9,
(read ? NE7CMD_READ : NE7CMD_WRITE),
head << 2 | fdu, /* head & unit */
@@ -1814,37 +1564,9 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
return(retrier(fdcu));
}
}
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- /*
- * if this is a read, then simply await interrupt
- * before performing PIO
- */
- if (read && !fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,fdblk)) {
- fd->tohandle = timeout(fd_iotimeout,
- (caddr_t)fdcu, hz);
- return(0); /* will return later */
- };
-
- /*
- * write (or format) operation will fall through and
- * await completion interrupt
- */
-#endif
fdc->state = IOCOMPLETE;
fd->tohandle = timeout(fd_iotimeout, (caddr_t)fdcu, hz);
return(0); /* will return later */
-#ifdef FDC_YE
- case PIOREAD:
- /*
- * actually perform the PIO read. The IOCOMPLETE case
- * removes the timeout for us.
- */
- (void)fdcpio(fdcu,bp->b_flags,bp->b_data+fd->skip,fdblk);
- fdc->state = IOCOMPLETE;
- /* FALLTHROUGH */
-#endif
case IOCOMPLETE: /* IO DONE, post-analyze */
untimeout(fd_iotimeout, (caddr_t)fdcu, fd->tohandle);
@@ -1863,11 +1585,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
/* FALLTHROUGH */
case IOTIMEDOUT:
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
if (fdc->status[0] & NE7_ST0_IC)
{
if ((fdc->status[0] & NE7_ST0_IC) == NE7_ST0_IC_AT
@@ -1902,7 +1621,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
{
/* ALL DONE */
fd->skip = 0;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fd->device_stats,
bp->b_bcount - bp->b_resid,
@@ -2022,10 +1741,12 @@ static int
retrier(fdcu)
fdcu_t fdcu;
{
+ struct subdev *sd;
fdc_p fdc = fdc_data + fdcu;
register struct buf *bp;
+ int fdu;
- bp = fdc->bp;
+ bp = bufq_first(&fdc->head);
if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY)
goto fail;
@@ -2069,7 +1790,7 @@ retrier(fdcu)
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
bp->b_resid += bp->b_bcount - fdc->fd->skip;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fdc->fd->device_stats,
@@ -2178,6 +1899,14 @@ fdioctl(dev, cmd, addr, flag, p)
char buffer[DEV_BSIZE];
int error = 0;
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ /* check for a tape ioctl */
+ if (type & F_TAPE_TYPE)
+ return ftioctl(dev, cmd, addr, flag, p);
+#endif
+
fdblk = 128 << fd->ft->secsize;
switch (cmd)
diff --git a/sys/i386/isa/fdc.h b/sys/i386/isa/fdc.h
index 43bf9f8f5f4c4..fdaf694f8d35c 100644
--- a/sys/i386/isa/fdc.h
+++ b/sys/i386/isa/fdc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fdc.h,v 1.12 1998/12/12 08:16:01 imp Exp $
+ * $Id: fdc.h,v 1.10 1998/07/11 06:35:39 bde Exp $
*
*/
@@ -56,10 +56,6 @@ struct fdc_data
#define FDC_STAT_VALID 0x08
#define FDC_HAS_FIFO 0x10
#define FDC_NEEDS_RESET 0x20
-#ifdef FDC_YE
-#define FDC_PCMCIA 0x40
-#define FDC_UNLOADED 0x80
-#endif
struct fd_data *fd;
int fdu; /* the active drive */
int state;
@@ -68,8 +64,7 @@ struct fdc_data
u_int status[7]; /* copy of the registers */
enum fdc_type fdct; /* chip version of FDC */
int fdc_errs; /* number of logged errors */
- struct buf_queue_head head;
- struct buf *bp; /* active buffer */
+ struct buf_queue_head head; /* Head of buf chain */
};
/***********************************************************************\
diff --git a/sys/i386/isa/ft.c b/sys/i386/isa/ft.c
new file mode 100644
index 0000000000000..2b7fd5fa90e88
--- /dev/null
+++ b/sys/i386/isa/ft.c
@@ -0,0 +1,2580 @@
+/*
+ * Copyright (c) 1993, 1994 Steve Gerakines
+ *
+ * This is freely redistributable software. You may do anything you
+ * wish with it, so long as the above notice stays intact.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ft.c - QIC-40/80 floppy tape driver
+ * $Id: ft.c,v 1.37 1998/04/17 22:36:32 des Exp $
+ *
+ * 01/19/95 ++sg
+ * Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x.
+ *
+ * 06/07/94 v0.9 ++sg
+ * Tape stuck on segment problem should be gone. Re-wrote buffering
+ * scheme. Added support for drives that do not automatically perform
+ * seek load point. Can handle more wakeup types now and should correctly
+ * report most manufacturer names. Fixed places where unit 0 was being
+ * sent to the fdc instead of the actual unit number. Added ioctl support
+ * for an in-core badmap.
+ *
+ * 01/26/94 v0.3b - Jim Babb
+ * Got rid of the hard coded device selection. Moved (some of) the
+ * static variables into a structure for support of multiple devices.
+ * ( still has a way to go for 2 controllers - but closer )
+ * Changed the interface with fd.c so we no longer 'steal' its
+ * driver routine vectors.
+ *
+ * 10/30/93 v0.3
+ * Fixed a couple more bugs. Reading was sometimes looping when an
+ * an error such as address-mark-missing was encountered. Both
+ * reading and writing was having more backup-and-retries than was
+ * necessary. Added support to get hardware info. Updated for use
+ * with FreeBSD.
+ *
+ * 09/15/93 v0.2 pl01
+ * Fixed a bunch of bugs: extra isa_dmadone() in async_write() (shouldn't
+ * matter), fixed double buffering in async_req(), changed tape_end() in
+ * set_fdcmode() to reduce unexpected interrupts, changed end of track
+ * processing in async_req(), protected more of ftreq_rw() with an
+ * splbio(). Changed some of the ftreq_*() functions so that they wait
+ * for inactivity and then go, instead of aborting immediately.
+ *
+ * 08/07/93 v0.2 release
+ * Shifted from ftstrat to ioctl support for I/O. Streaming is now much
+ * more reliable. Added internal support for error correction, QIC-40,
+ * and variable length tapes. Random access of segments greatly
+ * improved. Formatting and verification support is close but still
+ * incomplete.
+ *
+ * 06/03/93 v0.1 Alpha release
+ * Hopefully the last re-write. Many bugs fixed, many remain.
+ */
+
+#include "ft.h"
+#if NFT > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/disklabel.h> /* temp. for dkunit() in fdc.h */
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/ftape.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#ifdef PC98
+#include <pc98/pc98/fdreg.h>
+#else
+#include <i386/isa/fdreg.h>
+#endif
+#include <i386/isa/fdc.h>
+#include <i386/isa/ftreg.h>
+
+extern int ftintr __P((ftu_t ftu));
+
+/* Enable or disable debugging messages. */
+#define FTDBGALL 0 /* 1 if you want everything */
+/*#define DPRT(a) printf a */
+#define DPRT(a)
+
+/* Constants private to the driver */
+#define FTPRI (PRIBIO) /* sleep priority */
+#define FTNBUFF 9 /* 8 for buffering, 1 for header */
+
+/* The following items are needed from the fd driver. */
+extern int in_fdc(int); /* read fdc registers */
+extern int out_fdc(int, int); /* write fdc registers */
+
+/* Flags in isadev struct */
+#define FT_PROBE 0x1 /* allow for "dangerous" tape probes */
+
+/* Type of tape attached */
+/* use numbers that don't interfere with the possible floppy types */
+#define NO_TYPE 0 /* (same as NO_TYPE in fd.c) */
+
+/* F_TAPE_TYPE must match value in fd.c */
+#define F_TAPE_TYPE 0x020 /* bit for ft->types to indicate tape */
+#define FT_NONE (F_TAPE_TYPE | 0) /* no method required */
+#define FT_MOUNTAIN (F_TAPE_TYPE | 1) /* mountain */
+#define FT_COLORADO (F_TAPE_TYPE | 2) /* colorado */
+#define FT_INSIGHT (F_TAPE_TYPE | 3) /* insight */
+
+/* Mode FDC is currently in: tape or disk */
+enum { FDC_TAPE_MODE, FDC_DISK_MODE };
+
+/* Command we are awaiting completion of */
+enum { FTCMD_NONE, FTCMD_RESET, FTCMD_RECAL, FTCMD_SEEK, FTCMD_READID };
+
+/* Tape interrupt status of current request */
+enum { FTSTS_NONE, FTSTS_SNOOZE, FTSTS_INTERRUPT, FTSTS_TIMEOUT };
+
+/* Tape I/O status */
+enum {
+ FTIO_READY, /* No I/O activity */
+ FTIO_READING, /* Currently reading blocks */
+ FTIO_RDAHEAD, /* Currently reading ahead */
+ FTIO_WRITING /* Buffers are being written */
+};
+
+/* Current tape mode */
+enum {
+ FTM_PRIMARY, /* Primary mode */
+ FTM_VERIFY, /* Verify mode */
+ FTM_FORMAT, /* Format mode */
+ FTM_DIAG1, /* Diagnostic mode 1 */
+ FTM_DIAG2 /* Diagnostic mode 2 */
+};
+
+/* Tape geometries table */
+static QIC_Geom ftgtbl[] = {
+ { 0, 0, "Unformatted", "Unknown", 0, 0, 0, 0, 0 }, /* XXX */
+ { 1, 1, "QIC-40", "205/550", 20, 68, 2176, 128, 21760 },
+ { 1, 2, "QIC-40", "307.5/550", 20, 102, 3264, 128, 32640 },
+ { 1, 3, "QIC-40", "295/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 1, 4, "QIC-40", "1100/550", 20, 365, 11680, 128, 32512 },
+ { 1, 5, "QIC-40", "1100/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 2, 1, "QIC-80", "205/550", 28, 100, 3200, 128, 19200 },
+ { 2, 2, "QIC-80", "307.5/550", 28, 150, 4800, 128, 19200 },
+ { 2, 3, "QIC-80", "295/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 2, 4, "QIC-80", "1100/550", 28, 537, 17184, 128, 32512 },
+ { 2, 5, "QIC-80", "1100/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 1, "QIC-500", "205/550", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 2, "QIC-500", "307.5/550", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 3, "QIC-500", "295/900", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 4, "QIC-500", "1100/550", 0, 0, 0, 0, 0 }, /* ??? */
+ { 3, 5, "QIC-500", "1100/900", 0, 0, 0, 0, 0 } /* ??? */
+};
+#define NGEOM (sizeof(ftgtbl) / sizeof(QIC_Geom))
+
+static QIC_Geom *ftg = NULL; /* Current tape's geometry */
+
+/*
+ * things relating to asynchronous commands
+ */
+static int awr_state; /* state of async write */
+static int ard_state; /* state of async read */
+static int arq_state; /* state of async request */
+static int async_retries; /* retries, one per invocation */
+static int async_func; /* function to perform */
+static int async_state; /* state current function is at */
+static int async_arg0; /* up to 3 arguments for async cmds */
+static int async_arg1; /**/
+static int async_arg2; /**/
+static int async_ret; /* return value */
+static struct _astk {
+ int over_func;
+ int over_state;
+ int over_retries;
+ int over_arg0;
+ int over_arg1;
+ int over_arg2;
+} astk[10];
+static struct _astk *astk_ptr = &astk[0]; /* Pointer to stack position */
+
+/* List of valid async (interrupt driven) tape support functions. */
+enum {
+ ACMD_NONE, /* no command */
+ ACMD_SEEK, /* command seek */
+ ACMD_STATUS, /* report status */
+ ACMD_STATE, /* wait for state bits to be true */
+ ACMD_SEEKSTS, /* perform command and wait for status */
+ ACMD_READID, /* read id */
+ ACMD_RUNBLK /* ready tape for I/O on the given block */
+};
+
+/* Call another asyncronous command from within async_cmd(). */
+#define CALL_ACMD(r,f,a,b,c) \
+ astk_ptr->over_retries = async_retries; \
+ astk_ptr->over_func = async_func; \
+ astk_ptr->over_state = (r); \
+ astk_ptr->over_arg0 = async_arg0; \
+ astk_ptr->over_arg1 = async_arg1; \
+ astk_ptr->over_arg2 = async_arg2; \
+ async_func = (f); async_state = 0; async_retries = 0; \
+ async_arg0=(a); async_arg1=(b); async_arg2=(c); \
+ astk_ptr++; \
+ goto restate
+
+/* Perform an asyncronous command from outside async_cmd(). */
+#define ACMD_FUNC(r,f,a,b,c) over_async = (r); astk_ptr = &astk[0]; \
+ async_func = (f); async_state = 0; async_retries = 0; \
+ async_arg0=(a); async_arg1=(b); async_arg2=(c); \
+ async_cmd(ftu); \
+ return
+
+/* Various wait channels */
+static char *wc_buff_avail = "bavail";
+static char *wc_buff_done = "bdone";
+static char *wc_iosts_change = "iochg";
+static char *wc_long_delay = "ldelay";
+static char *wc_intr_wait = "intrw";
+#define ftsleep(wc,to) tsleep((caddr_t)(wc),FTPRI,(wc),(to))
+
+/***********************************************************************\
+* Per controller structure. *
+\***********************************************************************/
+extern struct fdc_data fdc_data[NFDC];
+
+/***********************************************************************\
+* Per tape drive structure. *
+\***********************************************************************/
+static struct ft_data {
+ struct fdc_data *fdc; /* pointer to controller structure */
+ int ftsu; /* this units number on this controller */
+ int type; /* Drive type (Mountain, Colorado) */
+/* QIC_Geom *ftg; */ /* pointer to Current tape's geometry */
+ int flags;
+ int cmd_wait; /* Command we are awaiting completion of */
+ int sts_wait; /* Tape interrupt status of current request */
+ int io_sts; /* Tape I/O status */
+ int mode;
+ int pcn; /* present cylinder number */
+ int attaching; /* true when ft is attaching */
+ unsigned char *xptr; /* pointer to buffer blk to xfer */
+ int xcnt; /* transfer count */
+ int xblk; /* block number to transfer */
+ int xseg; /* segment being transferred */
+ SegReq *segh; /* Current I/O request */
+ SegReq *segt; /* Tail of queued I/O requests */
+ SegReq *doneh; /* Completed I/O request queue */
+ SegReq *donet; /* Completed I/O request tail */
+ SegReq *segfree; /* Free segments */
+ SegReq *hdr; /* Current tape header */
+ int nsegq; /* Segments on request queue */
+ int ndoneq; /* Segments on completed queue */
+ int nfreelist; /* Segments on free list */
+
+ /* the next 3 should be defines in 'flags' */
+ int active; /* TRUE if transfer is active */
+ int rdonly; /* TRUE if tape is read-only */
+ int newcart; /* TRUE if new cartridge detected */
+ int laststs; /* last reported status code */
+ int lastcfg; /* last reported QIC config */
+ int lasterr; /* last QIC error code */
+ int lastpos; /* last known segment number */
+ int moving; /* TRUE if tape is moving */
+ int rid[7]; /* read_id return values */
+ struct callout_handle tohandle;
+} *ft_data[NFT];
+
+/***********************************************************************\
+* Throughout this file the following conventions will be used: *
+* ft is a pointer to the ft_data struct for the drive in question *
+* fdc is a pointer to the fdc_data struct for the controller *
+* ftu is the tape drive unit number *
+* fdcu is the floppy controller unit number *
+* ftsu is the tape drive unit number on that controller. (sub-unit) *
+\***********************************************************************/
+
+
+
+#define id_physid id_scsiid /* this biotab field doubles as a field */
+ /* for the physical unit number on the controller */
+
+int ftopen(dev_t, int);
+int ftclose(dev_t, int);
+int ftioctl(dev_t, unsigned long, caddr_t, int, struct proc *);
+int ftattach(struct isa_device *, struct isa_device *, int);
+static timeout_t ft_timeout;
+static void async_cmd(ftu_t);
+static void async_req(ftu_t, int);
+static void async_read(ftu_t, int);
+static void async_write(ftu_t, int);
+static void tape_start(ftu_t, int);
+static void tape_end(ftu_t);
+static void tape_inactive(ftu_t);
+static int tape_cmd(ftu_t, int);
+static int tape_status(ftu_t);
+static int qic_status(ftu_t, int, int);
+static int ftreq_rewind(ftu_t);
+static int ftreq_hwinfo(ftu_t, QIC_HWInfo *);
+
+/*****************************************************************************/
+
+
+/*
+ * Allocate a segment I/O buffer from the free list.
+ */
+static SegReq *
+segio_alloc(ft_p ft)
+{
+ SegReq *r;
+
+ /* Grab first item from free list */
+ if ((r = ft->segfree) != NULL) {
+ ft->segfree = ft->segfree->next;
+ ft->nfreelist--;
+ }
+ DPRT(("segio_alloc: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+ return(r);
+}
+
+
+/*
+ * Queue a segment I/O request.
+ */
+static void
+segio_queue(ft_p ft, SegReq *sp)
+{
+ /* Put request on in process queue. */
+ if (ft->segt == NULL)
+ ft->segh = sp;
+ else
+ ft->segt->next = sp;
+ sp->next = NULL;
+ ft->segt = sp;
+ ft->nsegq++;
+ DPRT(("segio_queue: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+}
+
+
+/*
+ * Segment I/O completed, place on correct queue.
+ */
+static void
+segio_done(ft_p ft, SegReq *sp)
+{
+ /* First remove from current I/O queue */
+ ft->segh = sp->next;
+ if (ft->segh == NULL) ft->segt = NULL;
+ ft->nsegq--;
+
+ if (sp->reqtype == FTIO_WRITING) {
+ /* Place on free list */
+ sp->next = ft->segfree;
+ ft->segfree = sp;
+ ft->nfreelist++;
+ wakeup((caddr_t)wc_buff_avail);
+ DPRT(("segio_done: (w) nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+ } else {
+ /* Put on completed I/O queue */
+ if (ft->donet == NULL)
+ ft->doneh = sp;
+ else
+ ft->donet->next = sp;
+ sp->next = NULL;
+ ft->donet = sp;
+ ft->ndoneq++;
+ wakeup((caddr_t)wc_buff_done);
+ DPRT(("segio_done: (r) nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+ }
+}
+
+
+/*
+ * Take I/O request from finished queue to free queue.
+ */
+static void
+segio_free(ft_p ft, SegReq *sp)
+{
+ /* First remove from done queue */
+ ft->doneh = sp->next;
+ if (ft->doneh == NULL) ft->donet = NULL;
+ ft->ndoneq--;
+
+ /* Place on free list */
+ sp->next = ft->segfree;
+ ft->segfree = sp;
+ ft->nfreelist++;
+ wakeup((caddr_t)wc_buff_avail);
+ DPRT(("segio_free: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
+}
+
+/*
+ * Probe/attach floppy tapes.
+ */
+int
+ftattach(isadev, fdup, unithasfd)
+ struct isa_device *isadev, *fdup;
+ int unithasfd;
+{
+ fdcu_t fdcu = isadev->id_unit; /* fdc active unit */
+ fdc_p fdc = fdc_data + fdcu; /* pointer to controller structure */
+ ftu_t ftu = fdup->id_unit;
+ ft_p ft;
+ ftsu_t ftsu = fdup->id_physid;
+ QIC_HWInfo hw;
+ char *manu;
+
+ if (ftu >= NFT) return 0;
+ ft = ft_data[ftu] = malloc(sizeof *ft, M_DEVBUF, M_NOWAIT);
+ bzero(ft, sizeof *ft);
+ callout_handle_init(&ft->tohandle);
+
+ /* Probe for tape */
+ ft->attaching = 1;
+ ft->type = NO_TYPE;
+ ft->fdc = fdc;
+ ft->ftsu = ftsu;
+
+ /*
+ * FT_NONE - no method, just do it
+ */
+ tape_start(ftu, 0);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_NONE;
+ ftreq_hwinfo(ftu, &hw);
+ goto out;
+ }
+
+ /*
+ * FT_COLORADO - colorado style
+ */
+ tape_start(ftu, 0);
+ tape_cmd(ftu, QC_COL_ENABLE1);
+ tape_cmd(ftu, QC_COL_ENABLE2 + ftu);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_COLORADO;
+ ftreq_hwinfo(ftu, &hw);
+ tape_cmd(ftu, QC_COL_DISABLE);
+ goto out;
+ }
+
+ /*
+ * FT_MOUNTAIN - mountain style
+ */
+ tape_start(ftu, 0);
+ tape_cmd(ftu, QC_MTN_ENABLE1);
+ tape_cmd(ftu, QC_MTN_ENABLE2);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_MOUNTAIN;
+ ftreq_hwinfo(ftu, &hw);
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ goto out;
+ }
+
+ if(isadev->id_flags & FT_PROBE) {
+ /*
+ * Insight probe is dangerous, since it requires the motor being
+ * enabled and therefore risks attached floppy disk drives to jam.
+ * Probe only if explicitly requested by a flag 0x1 from config
+ */
+
+ /*
+ * FT_INSIGHT - insight style
+ *
+ * Since insight requires turning the drive motor on, we will not
+ * perform this probe if a floppy drive was already found with the
+ * the given unit and controller.
+ */
+ if (unithasfd) goto out;
+ tape_start(ftu, 1);
+ if (tape_status(ftu) >= 0) {
+ ft->type = FT_INSIGHT;
+ ftreq_hwinfo(ftu, &hw);
+ goto out;
+ }
+ }
+
+out:
+ tape_end(ftu);
+ if (ft->type != NO_TYPE) {
+ fdc->flags |= FDC_HASFTAPE;
+ switch(hw.hw_make) {
+ case 0x0000:
+ if (ft->type == FT_COLORADO) {
+ manu = "Colorado";
+ } else if (ft->type == FT_INSIGHT) {
+ manu = "Insight";
+ } else if (ft->type == FT_MOUNTAIN && hw.hw_model == 0x05) {
+ manu = "Archive";
+ } else if (ft->type == FT_MOUNTAIN) {
+ manu = "Mountain";
+ } else {
+ manu = "Unknown";
+ }
+ break;
+ case 0x0001:
+ manu = "Colorado";
+ break;
+ case 0x0005:
+ if (hw.hw_model >= 0x09) {
+ manu = "Conner";
+ } else {
+ manu = "Archive";
+ }
+ break;
+ case 0x0006:
+ manu = "Mountain";
+ break;
+ case 0x0007:
+ manu = "Wangtek";
+ break;
+ case 0x0222:
+ manu = "IOMega";
+ break;
+ default:
+ manu = "Unknown";
+ break;
+ }
+ printf("ft%d: %s tape\n", fdup->id_unit, manu);
+ }
+ ft->attaching = 0;
+ return(ft->type);
+}
+
+
+/*
+ * Perform common commands asynchronously.
+ */
+static void
+async_cmd(ftu_t ftu) {
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu;
+ int cmd, i, st0, st3, pcn;
+ static int bitn, retval, retpos, nbits, newcn;
+ static int wanttrk, wantblk, wantdir;
+ static int curtrk, curblk, curdir, curdiff;
+ static int errcnt = 0;
+
+restate:
+#if FTDBGALL
+ DPRT(("async_cmd state: func: %d state: %d\n", async_func, async_state));
+#endif
+ switch(async_func) {
+ case ACMD_SEEK:
+ /*
+ * Arguments:
+ * 0 - command to perform
+ */
+ switch (async_state) {
+ case 0:
+ cmd = async_arg0;
+#if FTDBGALL
+ DPRT(("===>async_seek cmd = %d\n", cmd));
+#endif
+ newcn = (cmd <= ft->pcn) ? ft->pcn - cmd : ft->pcn + cmd;
+ async_state = 1;
+ i = 0;
+ if (out_fdc(fdcu, NE7CMD_SEEK) < 0) i = 1;
+ if (!i && out_fdc(fdcu, ftu) < 0) i = 1;
+ if (!i && out_fdc(fdcu, newcn) < 0) i = 1;
+ if (i) {
+ if (++async_retries >= 10) {
+ DPRT(("ft%d: async_cmd command seek failed!!\n", ftu));
+ goto complete;
+ }
+ DPRT(("ft%d: async_cmd command seek retry...\n",ftu));
+ async_state = 0;
+ goto restate;
+ }
+ break;
+ case 1:
+ out_fdc(fdcu, NE7CMD_SENSEI);
+ st0 = in_fdc(fdcu);
+ pcn = in_fdc(fdcu);
+ if (st0 < 0 || pcn < 0 || newcn != pcn) {
+ if (++async_retries >= 10) {
+ DPRT(("ft%d: async_cmd seek retries exceeded\n",ftu));
+ goto complete;
+ }
+ DPRT(("ft%d: async_cmd command bad st0=$%02x pcn=$%02x\n",
+ ftu, st0, pcn));
+ async_state = 0;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10);
+ break;
+ }
+ if (st0 & 0x20) { /* seek done */
+ ft->pcn = pcn;
+ }
+#if FTDBGALL
+ else
+ DPRT(("ft%d: async_seek error st0 = $%02x pcn = %d\n",
+ ftu, st0, pcn));
+#endif
+ if (async_arg1) goto complete;
+ async_state = 2;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/50);
+ break;
+ case 2:
+ goto complete;
+ /* NOTREACHED */
+ }
+ break;
+
+ case ACMD_STATUS:
+ /*
+ * Arguments:
+ * 0 - command to issue report from
+ * 1 - number of bits
+ * modifies: bitn, retval, st3
+ */
+ switch (async_state) {
+ case 0:
+ bitn = 0;
+ retval = 0;
+ cmd = async_arg0;
+ nbits = async_arg1;
+ DPRT(("async_status got cmd = %d nbits = %d\n", cmd,nbits));
+ CALL_ACMD(5, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ /* NOTREACHED */
+ case 1:
+ out_fdc(fdcu, NE7CMD_SENSED);
+ out_fdc(fdcu, ftu);
+ st3 = in_fdc(fdcu);
+ if (st3 < 0) {
+ DPRT(("ft%d: async_status timed out on bit %d r=$%02x\n",
+ ftu,bitn,retval));
+ async_ret = -1;
+ goto complete;
+ }
+ if ((st3 & 0x10) != 0) retval |= (1 << bitn);
+ bitn++;
+ if (bitn >= (nbits+2)) {
+ if ((retval & 1) && (retval & (1 << (nbits+1)))) {
+ async_ret = (retval & ~(1<<(nbits+1))) >> 1;
+ if (async_arg0 == QC_STATUS && async_arg2 == 0 &&
+ (async_ret & (QS_ERROR|QS_NEWCART))) {
+ async_state = 2;
+ goto restate;
+ }
+ DPRT(("async status got $%04x ($%04x)\n", async_ret,retval));
+ } else {
+ DPRT(("ft%d: async_status failed: retval=$%04x nbits=%d\n",
+ ftu, retval,nbits));
+ async_ret = -2;
+ }
+ goto complete;
+ }
+ CALL_ACMD(1, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ /* NOTREACHED */
+ case 2:
+ if (async_ret & QS_NEWCART) ft->newcart = 1;
+ CALL_ACMD(3, ACMD_STATUS, QC_ERRCODE, 16, 1);
+ case 3:
+ ft->lasterr = async_ret;
+ if ((ft->lasterr & QS_NEWCART) == 0 && ft->lasterr) {
+ DPRT(("ft%d: QIC error %d occurred on cmd %d\n",
+ ftu, ft->lasterr & 0xff, ft->lasterr >> 8));
+ }
+ cmd = async_arg0;
+ nbits = async_arg1;
+ CALL_ACMD(4, ACMD_STATUS, QC_STATUS, 8, 1);
+ case 4:
+ goto complete;
+ case 5:
+ CALL_ACMD(6, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ case 6:
+ CALL_ACMD(7, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ case 7:
+ CALL_ACMD(8, ACMD_SEEK, QC_NEXTBIT, 0, 0);
+ case 8:
+ cmd = async_arg0;
+ CALL_ACMD(1, ACMD_SEEK, cmd, 0, 0);
+ }
+ break;
+
+ case ACMD_STATE:
+ /*
+ * Arguments:
+ * 0 - status bits to check
+ */
+ switch(async_state) {
+ case 0:
+ CALL_ACMD(1, ACMD_STATUS, QC_STATUS, 8, 0);
+ case 1:
+ if ((async_ret & async_arg0) != 0) goto complete;
+ async_state = 0;
+ if (++async_retries == 360) { /* 90 secs. */
+ DPRT(("ft%d: acmd_state exceeded retry count\n", ftu));
+ goto complete;
+ }
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/4);
+ break;
+ }
+ break;
+
+ case ACMD_SEEKSTS:
+ /*
+ * Arguments:
+ * 0 - command to perform
+ * 1 - status bits to check
+ * 2 - (optional) seconds to wait until completion
+ */
+ switch(async_state) {
+ case 0:
+ cmd = async_arg0;
+ async_retries = (async_arg2) ? (async_arg2 * 4) : 10;
+ CALL_ACMD(1, ACMD_SEEK, cmd, 0, 0);
+ case 1:
+ CALL_ACMD(2, ACMD_STATUS, QC_STATUS, 8, 0);
+ case 2:
+ if ((async_ret & async_arg1) != 0) goto complete;
+ if (--async_retries == 0) {
+ DPRT(("ft%d: acmd_seeksts retries exceeded\n", ftu));
+ goto complete;
+ }
+ async_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/4);
+ break;
+ }
+ break;
+
+ case ACMD_READID:
+ /*
+ * Arguments: (none)
+ */
+ switch(async_state) {
+ case 0:
+ if (!ft->moving) {
+ CALL_ACMD(4, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ /* NOTREACHED */
+ }
+ async_state = 1;
+ out_fdc(fdcu, 0x4a); /* READ_ID */
+ out_fdc(fdcu, ftu);
+ break;
+ case 1:
+ for (i = 0; i < 7; i++) ft->rid[i] = in_fdc(fdcu);
+ async_ret = (ft->rid[3]*ftg->g_fdtrk) +
+ (ft->rid[4]*ftg->g_fdside) + ft->rid[5] - 1;
+ DPRT(("readid st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d\n",
+ ft->rid[0], ft->rid[1], ft->rid[2], ft->rid[3],
+ ft->rid[4], ft->rid[5], async_ret));
+ if ((ft->rid[0] & 0xc0) != 0 || async_ret < 0) {
+ /*
+ * Method for retry:
+ * errcnt == 1 regular retry
+ * 2 microstep head 1
+ * 3 microstep head 2
+ * 4 microstep head back to 0
+ * 5 fail
+ */
+ if (++errcnt >= 5) {
+ DPRT(("ft%d: acmd_readid errcnt exceeded\n", fdcu));
+ async_ret = -2;
+ errcnt = 0;
+ goto complete;
+ }
+ if (errcnt == 1) {
+ ft->moving = 0;
+ CALL_ACMD(4, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ } else {
+ ft->moving = 0;
+ CALL_ACMD(4, ACMD_SEEKSTS, QC_STPAUSE, QS_READY, 0);
+ }
+ DPRT(("readid retry %d...\n", errcnt));
+ async_state = 0;
+ goto restate;
+ }
+ if ((async_ret % ftg->g_blktrk) == (ftg->g_blktrk-1)) {
+ DPRT(("acmd_readid detected last block on track\n"));
+ retpos = async_ret;
+ CALL_ACMD(2, ACMD_STATE, QS_BOT|QS_EOT, 0, 0);
+ /* NOTREACHED */
+ }
+ ft->lastpos = async_ret;
+ errcnt = 0;
+ goto complete;
+ /* NOTREACHED */
+ case 2:
+ CALL_ACMD(3, ACMD_STATE, QS_READY, 0, 0);
+ case 3:
+ ft->moving = 0;
+ async_ret = retpos+1;
+ goto complete;
+ case 4:
+ CALL_ACMD(5, ACMD_SEEK, QC_FORWARD, 0, 0);
+ case 5:
+ ft->moving = 1;
+ async_state = 0;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+ }
+ break;
+
+ case ACMD_RUNBLK:
+ /*
+ * Arguments:
+ * 0 - block number I/O will be performed on
+ *
+ * modifies: curpos
+ */
+ switch (async_state) {
+ case 0:
+ wanttrk = async_arg0 / ftg->g_blktrk;
+ wantblk = async_arg0 % ftg->g_blktrk;
+ wantdir = wanttrk & 1;
+ ft->moving = 0;
+ CALL_ACMD(1, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ case 1:
+ curtrk = wanttrk;
+ curdir = curtrk & 1;
+ DPRT(("Changing to track %d\n", wanttrk));
+ CALL_ACMD(2, ACMD_SEEK, QC_SEEKTRACK, 0, 0);
+ case 2:
+ cmd = wanttrk+2;
+ CALL_ACMD(3, ACMD_SEEKSTS, cmd, QS_READY, 0);
+ case 3:
+ CALL_ACMD(4, ACMD_STATUS, QC_STATUS, 8, 0);
+ case 4:
+ ft->laststs = async_ret;
+ if (wantblk == 0) {
+ curblk = 0;
+ cmd = (wantdir) ? QC_SEEKEND : QC_SEEKSTART;
+ CALL_ACMD(6, ACMD_SEEKSTS, cmd, QS_READY, 90);
+ }
+ if (ft->laststs & QS_BOT) {
+ DPRT(("Tape is at BOT\n"));
+ curblk = (wantdir) ? 4800 : 0;
+ async_state = 6;
+ goto restate;
+ }
+ if (ft->laststs & QS_EOT) {
+ DPRT(("Tape is at EOT\n"));
+ curblk = (wantdir) ? 0 : 4800;
+ async_state = 6;
+ goto restate;
+ }
+ CALL_ACMD(5, ACMD_READID, 0, 0, 0);
+ case 5:
+ if (async_ret < 0) {
+ ft->moving = 0;
+ ft->lastpos = -2;
+ if (async_ret == -2) {
+ CALL_ACMD(9, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ CALL_ACMD(1, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ curtrk = (async_ret+1) / ftg->g_blktrk;
+ curblk = (async_ret+1) % ftg->g_blktrk;
+ DPRT(("gotid: curtrk=%d wanttrk=%d curblk=%d wantblk=%d\n",
+ curtrk, wanttrk, curblk, wantblk));
+ if (curtrk != wanttrk) { /* oops! */
+ DPRT(("oops!! wrong track!\n"));
+ CALL_ACMD(1, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ async_state = 6;
+ goto restate;
+ case 6:
+ DPRT(("curtrk = %d nextblk = %d\n", curtrk, curblk));
+ if (curblk == wantblk) {
+ ft->lastpos = curblk - 1;
+ async_ret = ft->lastpos;
+ if (ft->moving) goto complete;
+ CALL_ACMD(7, ACMD_STATE, QS_READY, 0, 0);
+ }
+ if (curblk > wantblk) { /* passed it */
+ ft->moving = 0;
+ CALL_ACMD(10, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ }
+ if ((wantblk - curblk) <= 256) { /* approaching it */
+ CALL_ACMD(5, ACMD_READID, 0, 0, 0);
+ }
+ /* way up ahead */
+ ft->moving = 0;
+ CALL_ACMD(14, ACMD_SEEKSTS, QC_STOP, QS_READY, 0);
+ break;
+ case 7:
+ ft->moving = 1;
+ CALL_ACMD(8, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+ case 8:
+ async_state = 9;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+ case 9:
+ goto complete;
+ case 10:
+ curdiff = ((curblk - wantblk) / QCV_BLKSEG) + 2;
+ if (curdiff >= ftg->g_segtrk) curdiff = ftg->g_segtrk - 1;
+ DPRT(("pos %d past %d, reverse %d\n", curblk, wantblk, curdiff));
+ CALL_ACMD(11, ACMD_SEEK, QC_SEEKREV, 0, 0);
+ case 11:
+ DPRT(("reverse 1 done\n"));
+ CALL_ACMD(12, ACMD_SEEK, (curdiff & 0xf)+2, 0, 0);
+ case 12:
+ DPRT(("reverse 2 done\n"));
+ CALL_ACMD(13, ACMD_SEEKSTS, ((curdiff>>4)&0xf)+2, QS_READY, 90);
+ case 13:
+ CALL_ACMD(5, ACMD_READID, 0, 0, 0);
+ case 14:
+ curdiff = ((wantblk - curblk) / QCV_BLKSEG) - 2;
+ if (curdiff < 0) curdiff = 0;
+ DPRT(("pos %d before %d, forward %d\n", curblk, wantblk, curdiff));
+ CALL_ACMD(15, ACMD_SEEK, QC_SEEKFWD, 0, 0);
+ case 15:
+ DPRT(("forward 1 done\n"));
+ CALL_ACMD(16, ACMD_SEEK, (curdiff & 0xf)+2, 0, 0);
+ case 16:
+ DPRT(("forward 2 done\n"));
+ CALL_ACMD(13, ACMD_SEEKSTS, ((curdiff>>4)&0xf)+2, QS_READY, 90);
+ }
+ break;
+ }
+
+ return;
+
+complete:
+ if (astk_ptr != &astk[0]) {
+ astk_ptr--;
+ async_retries = astk_ptr->over_retries;
+ async_func = astk_ptr->over_func;
+ async_state = astk_ptr->over_state;
+ async_arg0 = astk_ptr->over_arg0;
+ async_arg1 = astk_ptr->over_arg1;
+ async_arg2 = astk_ptr->over_arg2;
+ goto restate;
+ }
+ async_func = ACMD_NONE;
+ async_state = 0;
+ switch (ft->io_sts) {
+ case FTIO_READY:
+ async_req(ftu, 2);
+ break;
+ case FTIO_READING:
+ case FTIO_RDAHEAD:
+ async_read(ftu, 2);
+ break;
+ case FTIO_WRITING:
+ async_write(ftu, 2);
+ break;
+ default:
+ DPRT(("ft%d: bad async_cmd ending I/O state!\n", ftu));
+ break;
+ }
+}
+
+
+/*
+ * Entry point for the async request processor.
+ */
+static void
+async_req(ftu_t ftu, int from)
+{
+ ft_p ft = ft_data[ftu];
+ SegReq *sp;
+ static int over_async, lastreq;
+ int cmd;
+
+ if (from == 2) arq_state = over_async;
+
+restate:
+ switch (arq_state) {
+ case 0: /* Process segment */
+ sp = ft->segh;
+ ft->io_sts = (sp == NULL) ? FTIO_READY : sp->reqtype;
+
+ if (ft->io_sts == FTIO_WRITING)
+ async_write(ftu, from);
+ else
+ async_read(ftu, from);
+ if (ft->io_sts != FTIO_READY) return;
+
+ /* Pull buffer from current I/O queue */
+ if (sp != NULL) {
+ lastreq = sp->reqtype;
+ segio_done(ft, sp);
+
+ /* If I/O cancelled, clear finished queue. */
+ if (sp->reqcan) {
+ while (ft->doneh != NULL)
+ segio_free(ft, ft->doneh);
+ lastreq = FTIO_READY;
+ }
+ } else
+ lastreq = FTIO_READY;
+
+ /* Detect end of track */
+ if (((ft->xblk / QCV_BLKSEG) % ftg->g_segtrk) == 0) {
+ ACMD_FUNC(2, ACMD_STATE, QS_BOT|QS_EOT, 0, 0);
+ }
+ arq_state = 1;
+ goto restate;
+
+ case 1: /* Next request */
+ /* If we have another request queued, start it running. */
+ if (ft->segh != NULL) {
+ sp = ft->segh;
+ sp->reqcrc = 0;
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = sp->reqblk;
+ ft->xseg = sp->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = sp->buff;
+ DPRT(("I/O reqblk = %d\n", ft->xblk));
+ goto restate;
+ }
+
+ /* If the last request was reading, do read ahead. */
+ if ((lastreq == FTIO_READING || lastreq == FTIO_RDAHEAD) &&
+ (sp = segio_alloc(ft)) != NULL) {
+ sp->reqtype = FTIO_RDAHEAD;
+ sp->reqblk = ft->xblk;
+ sp->reqseg = ft->xseg+1;
+ sp->reqcrc = 0;
+ sp->reqcan = 0;
+ segio_queue(ft, sp);
+ bzero(sp->buff, QCV_SEGSIZE);
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = sp->reqblk;
+ ft->xseg = sp->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = sp->buff;
+ DPRT(("Processing readahead reqblk = %d\n", ft->xblk));
+ goto restate;
+ }
+
+ if (ft->moving) {
+ DPRT(("No more I/O.. Stopping.\n"));
+ ft->moving = 0;
+ ACMD_FUNC(7, ACMD_SEEKSTS, QC_PAUSE, QS_READY, 0);
+ break;
+ }
+ arq_state = 7;
+ goto restate;
+
+ case 2: /* End of track */
+ ft->moving = 0;
+ ACMD_FUNC(3, ACMD_STATE, QS_READY, 0, 0);
+ break;
+
+ case 3:
+ DPRT(("async_req seek head to track %d\n", ft->xblk / ftg->g_blktrk));
+ ACMD_FUNC(4, ACMD_SEEK, QC_SEEKTRACK, 0, 0);
+ break;
+
+ case 4:
+ cmd = (ft->xblk / ftg->g_blktrk) + 2;
+ if (ft->segh != NULL) {
+ ACMD_FUNC(5, ACMD_SEEKSTS, cmd, QS_READY, 0);
+ } else {
+ ACMD_FUNC(7, ACMD_SEEKSTS, cmd, QS_READY, 0);
+ }
+ break;
+
+ case 5:
+ ft->moving = 1;
+ ACMD_FUNC(6, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+
+ case 6:
+ arq_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+
+ case 7:
+ /* Time to rest. */
+ ft->active = 0;
+ ft->lastpos = -2;
+
+ /* wakeup those who want an i/o chg */
+ wakeup((caddr_t)wc_iosts_change);
+ break;
+ }
+}
+
+
+/*
+ * Entry for async read.
+ */
+static void
+async_read(ftu_t ftu, int from)
+{
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+ int i, rddta[7];
+ int where;
+ static int over_async;
+ static int retries = 0;
+
+ if (from == 2) ard_state = over_async;
+
+restate:
+#if FTDBGALL
+ DPRT(("async_read: state: %d from = %d\n", ard_state, from));
+#endif
+ switch (ard_state) {
+ case 0: /* Start off */
+ /* If tape is not at desired position, stop and locate */
+ if (ft->lastpos != (ft->xblk-1)) {
+ DPRT(("ft%d: position unknown: lastpos:%d ft->xblk:%d\n",
+ ftu, ft->lastpos, ft->xblk));
+ ACMD_FUNC(1, ACMD_RUNBLK, ft->xblk, 0, 0);
+ }
+
+ /* Tape is in position but stopped. */
+ if (!ft->moving) {
+ DPRT(("async_read ******STARTING TAPE\n"));
+ ACMD_FUNC(3, ACMD_STATE, QS_READY, 0, 0);
+ }
+ ard_state = 1;
+ goto restate;
+
+ case 1: /* Start DMA */
+ /* Tape is now moving and in position-- start DMA now! */
+ isa_dmastart(B_READ, ft->xptr, QCV_BLKSIZE, 2);
+ out_fdc(fdcu, 0x66); /* read */
+ out_fdc(fdcu, ftu); /* unit */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdside) / ftg->g_fdtrk); /* cylinder */
+ out_fdc(fdcu, ft->xblk / ftg->g_fdside); /* head */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* sector */
+ out_fdc(fdcu, 0x03); /* 1K sectors */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* count */
+ out_fdc(fdcu, 0x74); /* gap length */
+ out_fdc(fdcu, 0xff); /* transfer size */
+ ard_state = 2;
+ break;
+
+ case 2: /* DMA completed */
+ /* Transfer complete, get status */
+ for (i = 0; i < 7; i++) rddta[i] = in_fdc(fdcu);
+ isa_dmadone(B_READ, ft->xptr, QCV_BLKSIZE, 2);
+
+#if FTDBGALL
+ /* Compute where the controller thinks we are */
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside)
+ + rddta[5]-1;
+ DPRT(("xfer done: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+
+ /* Check for errors */
+ if ((rddta[0] & 0xc0) != 0x00) {
+#if !FTDBGALL
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside)
+ + rddta[5]-1;
+ DPRT(("xd: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+ if ((rddta[1] & 0x04) == 0x04 && retries < 2) {
+ /* Probably wrong position */
+ DPRT(("async_read: doing retry %d\n", retries));
+ ft->lastpos = ft->xblk;
+ ard_state = 0;
+ retries++;
+ goto restate;
+ } else {
+ /* CRC/Address-mark/Data-mark, et. al. */
+ DPRT(("ft%d: CRC error on block %d\n", fdcu, ft->xblk));
+ ft->segh->reqcrc |= (1 << ft->xcnt);
+ }
+ }
+
+ /* Otherwise, transfer completed okay. */
+ retries = 0;
+ ft->lastpos = ft->xblk;
+ ft->xblk++;
+ ft->xcnt++;
+ ft->xptr += QCV_BLKSIZE;
+ if (ft->xcnt < QCV_BLKSEG && ft->segh->reqcan == 0) {
+ ard_state = 0;
+ goto restate;
+ }
+ DPRT(("Read done.. Cancel = %d\n", ft->segh->reqcan));
+ ft->io_sts = FTIO_READY;
+ break;
+
+ case 3:
+ ft->moving = 1;
+ ACMD_FUNC(4, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+
+ case 4:
+ ard_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+
+ default:
+ DPRT(("ft%d: bad async_read state %d!!\n", ftu, ard_state));
+ break;
+ }
+}
+
+
+/*
+ * Entry for async write. If from is 0, this came from the interrupt
+ * routine, if it's 1 then it was a timeout, if it's 2, then an
+ * async_cmd completed.
+ */
+static void
+async_write(ftu_t ftu, int from)
+{
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+ int i, rddta[7];
+ int where;
+ static int over_async;
+ static int retries = 0;
+
+ if (from == 2) awr_state = over_async;
+
+restate:
+#if FTDBGALL
+ DPRT(("async_write: state: %d from = %d\n", awr_state, from));
+#endif
+ switch (awr_state) {
+ case 0: /* Start off */
+ /* If tape is not at desired position, stop and locate */
+ if (ft->lastpos != (ft->xblk-1)) {
+ DPRT(("ft%d: position unknown: lastpos:%d ft->xblk:%d\n",
+ ftu, ft->lastpos, ft->xblk));
+ ACMD_FUNC(1, ACMD_RUNBLK, ft->xblk, 0, 0);
+ }
+
+ /* Tape is in position but stopped. */
+ if (!ft->moving) {
+ DPRT(("async_write ******STARTING TAPE\n"));
+ ACMD_FUNC(3, ACMD_STATE, QS_READY, 0, 0);
+ }
+ awr_state = 1;
+ goto restate;
+
+ case 1: /* Start DMA */
+ /* Tape is now moving and in position-- start DMA now! */
+ isa_dmastart(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
+ out_fdc(fdcu, 0x45); /* write */
+ out_fdc(fdcu, ftu); /* unit */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdside) / ftg->g_fdtrk); /* cyl */
+ out_fdc(fdcu, ft->xblk / ftg->g_fdside); /* head */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* sector */
+ out_fdc(fdcu, 0x03); /* 1K sectors */
+ out_fdc(fdcu, (ft->xblk % ftg->g_fdtrk) + 1); /* count */
+ out_fdc(fdcu, 0x74); /* gap length */
+ out_fdc(fdcu, 0xff); /* transfer size */
+ awr_state = 2;
+ break;
+
+ case 2: /* DMA completed */
+ /* Transfer complete, get status */
+ for (i = 0; i < 7; i++) rddta[i] = in_fdc(fdcu);
+ isa_dmadone(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
+
+#if FTDBGALL
+ /* Compute where the controller thinks we are */
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside) + rddta[5]-1;
+ DPRT(("xfer done: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+
+ /* Check for errors */
+ if ((rddta[0] & 0xc0) != 0x00) {
+#if !FTDBGALL
+ where = (rddta[3]*ftg->g_fdtrk) + (rddta[4]*ftg->g_fdside)
+ + rddta[5]-1;
+ DPRT(("xfer done: st0:%02x st1:%02x st2:%02x c:%d h:%d s:%d pos:%d want:%d\n",
+ rddta[0], rddta[1], rddta[2], rddta[3], rddta[4], rddta[5],
+ where, ft->xblk));
+#endif
+ if (retries < 3) {
+ /* Something happened -- try again */
+ DPRT(("async_write: doing retry %d\n", retries));
+ ft->lastpos = ft->xblk;
+ awr_state = 0;
+ retries++;
+ goto restate;
+ } else {
+ /*
+ * Retries failed. Note the unrecoverable error.
+ * Marking the block as bad is useless right now.
+ */
+ printf("ft%d: unrecoverable write error on block %d\n",
+ ftu, ft->xblk);
+ ft->segh->reqcrc |= (1 << ft->xcnt);
+ }
+ }
+
+ /* Otherwise, transfer completed okay. */
+ retries = 0;
+ ft->lastpos = ft->xblk;
+ ft->xblk++;
+ ft->xcnt++;
+ ft->xptr += QCV_BLKSIZE;
+ if (ft->xcnt < QCV_BLKSEG) {
+ awr_state = 0; /* next block */
+ goto restate;
+ }
+#if FTDBGALL
+ DPRT(("Write done.\n"));
+#endif
+ ft->io_sts = FTIO_READY;
+ break;
+
+ case 3:
+ ft->moving = 1;
+ ACMD_FUNC(4, ACMD_SEEK, QC_FORWARD, 0, 0);
+ break;
+
+ case 4:
+ awr_state = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
+ break;
+
+ default:
+ DPRT(("ft%d: bad async_write state %d!!\n", ftu, awr_state));
+ break;
+ }
+}
+
+
+/*
+ * Interrupt handler for active tape. Bounced off of fdintr().
+ */
+int
+ftintr(ftu_t ftu)
+{
+ int st0, pcn, i;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+ int s = splbio();
+
+ st0 = 0;
+ pcn = 0;
+
+ /* I/O segment transfer completed */
+ if (ft->active) {
+ if (async_func != ACMD_NONE) {
+ async_cmd(ftu);
+ splx(s);
+ return(1);
+ }
+#if FTDBGALL
+ DPRT(("Got request interrupt\n"));
+#endif
+ async_req(ftu, 0);
+ splx(s);
+ return(1);
+ }
+
+ /* Get interrupt status */
+ if (ft->cmd_wait != FTCMD_READID) {
+ out_fdc(fdcu, NE7CMD_SENSEI);
+ st0 = in_fdc(fdcu);
+ pcn = in_fdc(fdcu);
+ }
+
+ if (ft->cmd_wait == FTCMD_NONE || ft->sts_wait != FTSTS_SNOOZE) {
+huh_what:
+ printf("ft%d: unexpected interrupt; st0 = $%02x pcn = %d\n",
+ ftu, st0, pcn);
+ splx(s);
+ return(1);
+ }
+
+ switch (ft->cmd_wait) {
+ case FTCMD_RESET:
+ ft->sts_wait = FTSTS_INTERRUPT;
+ wakeup((caddr_t)wc_intr_wait);
+ break;
+ case FTCMD_RECAL:
+ case FTCMD_SEEK:
+ if (st0 & 0x20) { /* seek done */
+ ft->sts_wait = FTSTS_INTERRUPT;
+ ft->pcn = pcn;
+ wakeup((caddr_t)wc_intr_wait);
+ }
+#if FTDBGALL
+ else
+ DPRT(("ft%d: seek error st0 = $%02x pcn = %d\n",
+ ftu, st0, pcn));
+#endif
+ break;
+ case FTCMD_READID:
+ for (i = 0; i < 7; i++) ft->rid[i] = in_fdc(fdcu);
+ ft->sts_wait = FTSTS_INTERRUPT;
+ wakeup((caddr_t)wc_intr_wait);
+ break;
+
+ default:
+ goto huh_what;
+ }
+
+ splx(s);
+ return(1);
+}
+
+
+/*
+ * Interrupt timeout routine.
+ */
+static void
+ft_timeout(void *arg1)
+{
+ int s;
+ ftu_t ftu = (ftu_t)arg1;
+ ft_p ft = ft_data[ftu];
+
+ s = splbio();
+ if (ft->active) {
+ if (async_func != ACMD_NONE) {
+ async_cmd(ftu);
+ splx(s);
+ return;
+ }
+ async_req(ftu, 1);
+ } else {
+ ft->sts_wait = FTSTS_TIMEOUT;
+ wakeup((caddr_t)wc_intr_wait);
+ }
+ splx(s);
+}
+
+
+/*
+ * Wait for a particular interrupt to occur. ftintr() will wake us up
+ * if it sees what we want. Otherwise, time out and return error.
+ * Should always disable ints before trigger is sent and calling here.
+ */
+static int
+ftintr_wait(ftu_t ftu, int cmd, int ticks)
+{
+ int retries, st0, pcn;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ ft->cmd_wait = cmd;
+ ft->sts_wait = FTSTS_SNOOZE;
+
+ /* At attach time, we can't rely on having interrupts serviced */
+ if (ft->attaching) {
+ switch (cmd) {
+ case FTCMD_RESET:
+ DELAY(100);
+ ft->sts_wait = FTSTS_INTERRUPT;
+ goto intrdone;
+ case FTCMD_RECAL:
+ case FTCMD_SEEK:
+ for (retries = 0; retries < 10000; retries++) {
+ DELAY(150);
+ out_fdc(fdcu, NE7CMD_SENSEI);
+ st0 = in_fdc(fdcu);
+ if ((st0 & 0xc0) == 0x80) continue;
+ pcn = in_fdc(fdcu);
+ if (st0 & 0x20) {
+ ft->sts_wait = FTSTS_INTERRUPT;
+ ft->pcn = pcn;
+ goto intrdone;
+ }
+ }
+ break;
+ }
+ ft->sts_wait = FTSTS_TIMEOUT;
+ goto intrdone;
+ }
+
+ ftsleep(wc_intr_wait, ticks);
+
+intrdone:
+ if (ft->sts_wait == FTSTS_TIMEOUT) { /* timeout */
+#if FTDBGALL
+ if (ft->cmd_wait != FTCMD_RESET)
+ DPRT(("ft%d: timeout on command %d\n", ftu, ft->cmd_wait));
+#endif
+ ft->cmd_wait = FTCMD_NONE;
+ ft->sts_wait = FTSTS_NONE;
+ return(1);
+ }
+
+ /* got interrupt */
+ if (ft->attaching == 0 && ticks)
+ untimeout(ft_timeout, (caddr_t)ftu, ft->tohandle);
+ ft->cmd_wait = FTCMD_NONE;
+ ft->sts_wait = FTSTS_NONE;
+ return(0);
+}
+
+
+/*
+ * Recalibrate tape drive. Parameter totape is true, if we should
+ * recalibrate to tape drive settings.
+ */
+static int
+tape_recal(ftu_t ftu, int totape)
+{
+ int s;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ DPRT(("tape_recal start\n"));
+
+#ifdef PC98
+ outb(0xbe, FDP_FDDEXC | FDP_PORTEXC);
+#endif
+ out_fdc(fdcu, NE7CMD_SPECIFY);
+#ifdef PC98
+ out_fdc(fdcu, (totape) ? 0xEF : 0xCF);
+ out_fdc(fdcu, 0x02);
+#else
+ out_fdc(fdcu, (totape) ? 0xAD : 0xDF);
+ out_fdc(fdcu, 0x02);
+#endif
+
+ s = splbio();
+ out_fdc(fdcu, NE7CMD_RECAL);
+ out_fdc(fdcu, ftu);
+
+ if (ftintr_wait(ftu, FTCMD_RECAL, hz)) {
+ splx(s);
+ DPRT(("ft%d: recalibrate timeout\n", ftu));
+ return(1);
+ }
+ splx(s);
+
+ out_fdc(fdcu, NE7CMD_SPECIFY);
+#ifdef PC98
+ out_fdc(fdcu, (totape) ? 0xEF : 0xCF);
+ out_fdc(fdcu, 0x02);
+#else
+ out_fdc(fdcu, (totape) ? 0xFD : 0xDF);
+ out_fdc(fdcu, 0x02);
+#endif
+
+ DPRT(("tape_recal end\n"));
+ return(0);
+}
+
+/*
+ * Wait for a particular tape status to be met. If all is TRUE, then
+ * all states must be met, otherwise any state can be met.
+ */
+static int
+tape_state(ftu_t ftu, int all, int mask, int seconds)
+{
+ int r, tries, maxtries;
+
+ maxtries = (seconds) ? (4 * seconds) : 1;
+ for (tries = 0; tries < maxtries; tries++) {
+ r = tape_status(ftu);
+ if (r >= 0) {
+ if (all && (r & mask) == mask) return(r);
+ if ((r & mask) != 0) return(r);
+ }
+ if (seconds) ftsleep(wc_long_delay, hz/4);
+ }
+ DPRT(("ft%d: tape_state failed on mask=$%02x maxtries=%d\n",
+ ftu, mask, maxtries));
+ return(-1);
+}
+
+
+/*
+ * Send a QIC command to tape drive, wait for completion.
+ */
+static int
+tape_cmd(ftu_t ftu, int cmd)
+{
+ int newcn;
+ int retries = 0;
+ int s;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ DPRT(("===> tape_cmd: %d\n",cmd));
+ newcn = (cmd <= ft->pcn) ? ft->pcn - cmd : ft->pcn + cmd;
+
+retry:
+
+ /* Perform seek */
+ s = splbio();
+ out_fdc(fdcu, NE7CMD_SEEK);
+ out_fdc(fdcu, ftu);
+ out_fdc(fdcu, newcn);
+
+ if (ftintr_wait(ftu, FTCMD_SEEK, hz)) {
+ DPRT(("ft%d: tape_cmd seek timeout\n", ftu));
+redo:
+ splx(s);
+ if (++retries < 5) goto retry;
+ DPRT(("ft%d: tape_cmd seek failed!\n", ftu));
+ return(1);
+ }
+ splx(s);
+
+ if (ft->pcn != newcn) {
+ DPRT(("ft%d: bad seek in tape_cmd; pcn = %d newcn = %d\n",
+ ftu, ft->pcn, newcn));
+ goto redo;
+ }
+ DELAY(2500);
+ return(0);
+}
+
+
+/*
+ * Return status of tape drive
+ */
+static int
+tape_status(ftu_t ftu)
+{
+ int r, err, tries;
+ ft_p ft = ft_data[ftu];
+ int max = (ft->attaching) ? 2 : 3;
+
+ for (r = -1, tries = 0; r < 0 && tries < max; tries++)
+ r = qic_status(ftu, QC_STATUS, 8);
+ if (tries == max) return(-1);
+
+recheck:
+ DPRT(("tape_status got $%04x\n",r));
+ ft->laststs = r;
+
+ if (r & (QS_ERROR|QS_NEWCART)) {
+ err = qic_status(ftu, QC_ERRCODE, 16);
+ ft->lasterr = err;
+ if (r & QS_NEWCART) {
+ ft->newcart = 1;
+ /* If tape not referenced, do a seek load point. */
+ if ((r & QS_FMTOK) == 0 && !ft->attaching) {
+ tape_cmd(ftu, QC_SEEKLP);
+ do {
+ ftsleep(wc_long_delay, hz);
+ } while ((r = qic_status(ftu, QC_STATUS, 8)) < 0 ||
+ (r & (QS_READY|QS_CART)) == QS_CART);
+ goto recheck;
+ }
+ } else if (err && !ft->attaching) {
+ DPRT(("ft%d: QIC error %d occurred on cmd %d\n",
+ ftu, err & 0xff, err >> 8));
+ }
+ r = qic_status(ftu, QC_STATUS, 8);
+ ft->laststs = r;
+ DPRT(("tape_status got error code $%04x new sts = $%02x\n",err,r));
+ }
+
+ ft->rdonly = (r & QS_RDONLY);
+ return(r);
+}
+
+
+/*
+ * Transfer control to tape drive.
+ */
+static void
+tape_start(ftu_t ftu, int motor)
+{
+ ft_p ft = ft_data[ftu];
+ fdc_p fdc = ft->fdc;
+ int s, mbits;
+#ifndef PC98
+ static int mbmotor[] = { FDO_MOEN0, FDO_MOEN1, FDO_MOEN2, FDO_MOEN3 };
+#endif
+
+ s = splbio();
+ DPRT(("tape_start start\n"));
+
+ /* reset, dma disable */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_RST | FDO_FRY | FDO_AIE | FDO_MTON);
+#else
+ outb(fdc->baseport+FDOUT, 0x00);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ /* raise reset, enable DMA, motor on if needed */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_DMAE | FDO_MTON);
+#else
+ mbits = ftu & 3;
+ if (motor && ftu < 4)
+ mbits |= mbmotor[ftu];
+
+ outb(fdc->baseport+FDOUT, FDO_FRST | FDO_FDMAEN | mbits);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ splx(s);
+
+ tape_recal(ftu, 1);
+
+ /* set transfer speed */
+#ifndef PC98
+ outb(fdc->baseport+FDCTL, FDC_500KBPS);
+ DELAY(10);
+#endif
+
+ DPRT(("tape_start end\n"));
+}
+
+
+/*
+ * Transfer control back to floppy disks.
+ */
+static void
+tape_end(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+ fdc_p fdc = ft->fdc;
+ int s;
+
+ DPRT(("tape_end start\n"));
+ tape_recal(ftu, 0);
+
+ s = splbio();
+
+ /* reset, dma disable */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_RST | FDO_FRY | FDO_AIE | FDO_MTON);
+#else
+ outb(fdc->baseport+FDOUT, 0x00);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ /* raise reset, enable DMA */
+#ifdef PC98
+ outb(fdc->baseport+FDOUT, FDO_DMAE | FDO_MTON);
+#else
+ outb(fdc->baseport+FDOUT, FDO_FRST | FDO_FDMAEN);
+#endif
+ (void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
+
+ splx(s);
+
+ /* set transfer speed */
+#ifndef PC98
+ outb(fdc->baseport+FDCTL, FDC_500KBPS);
+ DELAY(10);
+#endif
+ fdc->flags &= ~FDC_TAPE_BUSY;
+
+ DPRT(("tape_end end\n"));
+}
+
+
+/*
+ * Wait for the driver to go inactive, cancel readahead if necessary.
+ */
+static void
+tape_inactive(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+ int s = splbio();
+
+ if (ft->segh != NULL) {
+ if (ft->segh->reqtype == FTIO_RDAHEAD) {
+ /* cancel read-ahead */
+ ft->segh->reqcan = 1;
+ } else if (ft->segh->reqtype == FTIO_WRITING && !ft->active) {
+ /* flush out any remaining writes */
+ DPRT(("Flushing write I/O chain\n"));
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = ft->segh->reqblk;
+ ft->xseg = ft->segh->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = ft->segh->buff;
+ ft->active = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
+ }
+ }
+ while (ft->active) ftsleep(wc_iosts_change, 0);
+ splx(s);
+}
+
+
+/*
+ * Get the geometry of the tape currently in the drive.
+ */
+static int
+ftgetgeom(ftu_t ftu)
+{
+ int r, i, tries;
+ int cfg, qic80, ext;
+ int sts, fmt, len;
+ ft_p ft = ft_data[ftu];
+
+ r = tape_status(ftu);
+
+ /* XXX fix me when format mode is finished */
+ if (r < 0 || (r & QS_CART) == 0 || (r & QS_FMTOK) == 0) {
+ DPRT(("ftgetgeom: no cart or not formatted 0x%04x\n",r));
+ ftg = NULL;
+ ft->newcart = 1;
+ return(0);
+ }
+
+ /* Report drive configuration */
+ for (cfg = -1, tries = 0; cfg < 0 && tries < 3; tries++)
+ cfg = qic_status(ftu, QC_CONFIG, 8);
+ if (tries == 3) {
+ DPRT(("ftgetgeom report config failed\n"));
+ ftg = NULL;
+ return(-1);
+ }
+ DPRT(("ftgetgeom report config got $%04x\n", cfg));
+ ft->lastcfg = cfg;
+
+ qic80 = cfg & QCF_QIC80;
+ ext = cfg & QCF_EXTRA;
+
+/*
+ * XXX - This doesn't seem to work on my Colorado Jumbo 250...
+ * if it works on your drive, I'd sure like to hear about it.
+ */
+#if 0
+ /* Report drive status */
+ for (sts = -1, tries = 0; sts < 0 && tries < 3; tries++)
+ sts = qic_status(ftu, QC_TSTATUS, 8);
+ if (tries == 3) {
+ DPRT(("ftgetgeom report tape status failed\n"));
+ ftg = NULL;
+ return(-1);
+ }
+ DPRT(("ftgetgeom report tape status got $%04x\n", sts));
+#else
+ /*
+ * XXX - Forge a fake tape status based upon the returned
+ * configuration, since the above command or code is broken
+ * for my drive and probably other older drives.
+ */
+ sts = 0;
+ sts = (qic80) ? QTS_QIC80 : QTS_QIC40;
+ sts |= (ext) ? QTS_LEN2 : QTS_LEN1;
+#endif
+
+ fmt = sts & QTS_FMMASK;
+ len = (sts & QTS_LNMASK) >> 4;
+
+ if (fmt > QCV_NFMT) {
+ ftg = NULL;
+ printf("ft%d: unsupported tape format\n", ftu);
+ return(-1);
+ }
+ if (len > QCV_NLEN) {
+ ftg = NULL;
+ printf("ft%d: unsupported tape length\n", ftu);
+ return(-1);
+ }
+
+ /* Look up geometry in the table */
+ for (i = 1; i < NGEOM; i++)
+ if (ftgtbl[i].g_fmtno == fmt && ftgtbl[i].g_lenno == len) break;
+ if (i == NGEOM) {
+ printf("ft%d: unknown tape geometry\n", ftu);
+ ftg = NULL;
+ return(-1);
+ }
+ ftg = &ftgtbl[i];
+ if (!ftg->g_trktape) {
+ printf("ft%d: unsupported format %s w/len %s\n",
+ ftu, ftg->g_fmtdesc, ftg->g_lendesc);
+ ftg = NULL;
+ return(-1);
+ }
+ DPRT(("Tape format is %s, length is %s\n", ftg->g_fmtdesc, ftg->g_lendesc));
+ ft->newcart = 0;
+ return(0);
+}
+
+
+/*
+ * Switch between tape/floppy. This will send the tape enable/disable
+ * codes for this drive's manufacturer.
+ */
+static int
+set_fdcmode(dev_t dev, int newmode)
+{
+ ftu_t ftu = FDUNIT(minor(dev));
+ ft_p ft = ft_data[ftu];
+ fdc_p fdc = ft->fdc;
+ static int havebufs = 0;
+ int i;
+ SegReq *sp, *rsp;
+
+ if (newmode == FDC_TAPE_MODE) {
+ /* Wake up the tape drive */
+ switch (ft->type) {
+ case NO_TYPE:
+ fdc->flags &= ~FDC_TAPE_BUSY;
+ return(ENXIO);
+ case FT_NONE:
+ tape_start(ftu, 0);
+ break;
+ case FT_COLORADO:
+ tape_start(ftu, 0);
+ if (tape_cmd(ftu, QC_COL_ENABLE1)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ if (tape_cmd(ftu, QC_COL_ENABLE2 + ftu)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ break;
+ case FT_MOUNTAIN:
+ tape_start(ftu, 0);
+ if (tape_cmd(ftu, QC_MTN_ENABLE1)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ if (tape_cmd(ftu, QC_MTN_ENABLE2)) {
+ tape_end(ftu);
+ return(EIO);
+ }
+ break;
+ case FT_INSIGHT:
+ tape_start(ftu, 1);
+ break;
+ default:
+ DPRT(("ft%d: bad tape type\n", ftu));
+ return(ENXIO);
+ }
+ if (tape_status(ftu) < 0) {
+ if (ft->type == FT_COLORADO)
+ tape_cmd(ftu, QC_COL_DISABLE);
+ else if (ft->type == FT_MOUNTAIN)
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ tape_end(ftu);
+ return(EIO);
+ }
+
+ /* Grab buffers from memory. */
+ if (!havebufs) {
+ ft->segh = ft->segt = NULL;
+ ft->doneh = ft->donet = NULL;
+ ft->segfree = NULL;
+ ft->hdr = NULL;
+ ft->nsegq = ft->ndoneq = ft->nfreelist = 0;
+ for (i = 0; i < FTNBUFF; i++) {
+ sp = malloc(sizeof(SegReq), M_DEVBUF, M_WAITOK);
+ if (sp == NULL) {
+ printf("ft%d: not enough memory for buffers\n", ftu);
+ for (sp=ft->segfree; sp != NULL; sp=sp->next)
+ free(sp, M_DEVBUF);
+ if (ft->type == FT_COLORADO)
+ tape_cmd(ftu, QC_COL_DISABLE);
+ else if (ft->type == FT_MOUNTAIN)
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ tape_end(ftu);
+ return(ENOMEM);
+ }
+ sp->reqtype = FTIO_READY;
+ sp->next = ft->segfree;
+ ft->segfree = sp;
+ ft->nfreelist++;
+ }
+ /* take one buffer for header */
+ ft->hdr = ft->segfree;
+ ft->segfree = ft->segfree->next;
+ ft->nfreelist--;
+ havebufs = 1;
+ }
+ ft->io_sts = FTIO_READY; /* tape drive is ready */
+ ft->active = 0; /* interrupt driver not active */
+ ft->moving = 0; /* tape not moving */
+ ft->rdonly = 0; /* tape read only */
+ ft->newcart = 0; /* new cartridge flag */
+ ft->lastpos = -1; /* tape is rewound */
+ async_func = ACMD_NONE; /* No async function */
+ tape_state(ftu, 0, QS_READY, 60);
+ tape_cmd(ftu, QC_RATE);
+ tape_cmd(ftu, QCF_RT500+2); /* 500K bps */
+ tape_state(ftu, 0, QS_READY, 60);
+ ft->mode = FTM_PRIMARY;
+ tape_cmd(ftu, QC_PRIMARY); /* Make sure we're in primary mode */
+ tape_state(ftu, 0, QS_READY, 60);
+ ftg = NULL; /* No geometry yet */
+ ftgetgeom(ftu); /* Get tape geometry */
+ ftreq_rewind(ftu); /* Make sure tape is rewound */
+ } else {
+ if (ft->type == FT_COLORADO)
+ tape_cmd(ftu, QC_COL_DISABLE);
+ else if (ft->type == FT_MOUNTAIN)
+ tape_cmd(ftu, QC_MTN_DISABLE);
+ tape_end(ftu);
+ ft->newcart = 0; /* clear new cartridge */
+ if (ft->hdr != NULL) free(ft->hdr, M_DEVBUF);
+ if (havebufs) {
+ for (sp = ft->segfree; sp != NULL;) {
+ rsp = sp; sp = sp->next;
+ free(rsp, M_DEVBUF);
+ }
+ for (sp = ft->segh; sp != NULL;) {
+ rsp = sp; sp = sp->next;
+ free(rsp, M_DEVBUF);
+ }
+ for (sp = ft->doneh; sp != NULL;) {
+ rsp = sp; sp = sp->next;
+ free(rsp, M_DEVBUF);
+ }
+ }
+ havebufs = 0;
+ }
+ return(0);
+}
+
+
+/*
+ * Perform a QIC status function.
+ */
+static int
+qic_status(ftu_t ftu, int cmd, int nbits)
+{
+ int st3, r, i;
+ ft_p ft = ft_data[ftu];
+ fdcu_t fdcu = ft->fdc->fdcu; /* fdc active unit */
+
+ if (tape_cmd(ftu, cmd)) {
+ DPRT(("ft%d: QIC status timeout\n", ftu));
+ return(-1);
+ }
+
+ /* Sense drive status */
+ out_fdc(fdcu, NE7CMD_SENSED);
+ out_fdc(fdcu, ftu);
+ st3 = in_fdc(fdcu);
+
+ if ((st3 & 0x10) == 0) { /* track 0 */
+ DPRT(("qic_status has dead drive... st3 = $%02x\n", st3));
+ return(-1);
+ }
+
+ for (i = r = 0; i <= nbits; i++) {
+ if (tape_cmd(ftu, QC_NEXTBIT)) {
+ DPRT(("ft%d: QIC status bit timed out on %d\n", ftu, i));
+ return(-1);
+ }
+
+ out_fdc(fdcu, NE7CMD_SENSED);
+ out_fdc(fdcu, ftu);
+ st3 = in_fdc(fdcu);
+ if (st3 < 0) {
+ DPRT(("ft%d: controller timed out on bit %d r=$%02x\n",
+ ftu, i, r));
+ return(-1);
+ }
+
+ r >>= 1;
+ if (i < nbits)
+ r |= ((st3 & 0x10) ? 1 : 0) << nbits;
+ else if ((st3 & 0x10) == 0) {
+ DPRT(("ft%d: qic status stop bit missing at %d, st3=$%02x r=$%04x\n",
+ ftu,i,st3,r));
+ return(-1);
+ }
+ }
+
+ DPRT(("qic_status returned $%02x\n", r));
+ return(r);
+}
+
+
+/*
+ * Open tape drive for use. Bounced off of Fdopen if tape minor is
+ * detected.
+ */
+int
+ftopen(dev_t dev, int arg2) {
+ ftu_t ftu = FDUNIT(minor(dev));
+ fdc_p fdc;
+
+ /* check bounds */
+ if (ftu >= NFT)
+ return(ENXIO);
+ if (!ft_data[ftu])
+ return(ENXIO);
+ fdc = ft_data[ftu]->fdc;
+ if ((fdc == NULL) || (ft_data[ftu]->type == NO_TYPE))
+ return(ENXIO);
+ /* check for controller already busy with tape */
+ if (fdc->flags & FDC_TAPE_BUSY)
+ return(EBUSY);
+ /* make sure we found a tape when probed */
+ if (!(fdc->flags & FDC_HASFTAPE))
+ return(ENODEV);
+ fdc->fdu = ftu;
+ fdc->flags |= FDC_TAPE_BUSY;
+ return(set_fdcmode(dev, FDC_TAPE_MODE)); /* try to switch to tape */
+}
+
+
+/*
+ * Close tape and return floppy controller to disk mode.
+ */
+int
+ftclose(dev_t dev, int flags)
+{
+ ftu_t ftu = FDUNIT(minor(dev));
+ ft_p ft = ft_data[ftu];
+
+
+ /* Wait for any remaining I/O activity to complete. */
+ tape_inactive(ftu);
+
+ ft->mode = FTM_PRIMARY;
+ tape_cmd(ftu, QC_PRIMARY);
+ tape_state(ftu, 0, QS_READY, 60);
+ ftreq_rewind(ftu);
+ return(set_fdcmode(dev, FDC_DISK_MODE)); /* Otherwise, close tape */
+}
+
+/*
+ * Read or write a segment.
+ */
+static int
+ftreq_rw(ftu_t ftu, unsigned long cmd, QIC_Segment *sr, struct proc *p)
+{
+ int r, i;
+ SegReq *sp;
+ int s;
+ long blk, bad, seg;
+ unsigned char *cp, *cp2;
+ ft_p ft = ft_data[ftu];
+
+ if (!ft->active && ft->segh == NULL) {
+ r = tape_status(ftu);
+ if ((r & QS_CART) == 0)
+ return(ENXIO); /* No cartridge */
+ if ((r & QS_FMTOK) == 0)
+ return(ENXIO); /* Not formatted */
+ tape_state(ftu, 0, QS_READY, 90);
+ }
+
+ if (ftg == NULL || ft->newcart) {
+ tape_inactive(ftu);
+ tape_state(ftu, 0, QS_READY, 90);
+ if (ftgetgeom(ftu) < 0)
+ return(ENXIO);
+ }
+
+ /* Write not allowed on a read-only tape. */
+ if (cmd == QIOWRITE && ft->rdonly)
+ return(EROFS);
+
+ /* Quick check of request and buffer. */
+ if (sr == NULL || sr->sg_data == NULL)
+ return(EINVAL);
+
+ /* Make sure requested track and segment is in range. */
+ if (sr->sg_trk >= ftg->g_trktape || sr->sg_seg >= ftg->g_segtrk)
+ return(EINVAL);
+
+ blk = sr->sg_trk * ftg->g_blktrk + sr->sg_seg * QCV_BLKSEG;
+ seg = sr->sg_trk * ftg->g_segtrk + sr->sg_seg;
+
+ s = splbio();
+ if (cmd == QIOREAD) {
+ /*
+ * See if the driver is reading ahead.
+ */
+ if (ft->doneh != NULL ||
+ (ft->segh != NULL && ft->segh->reqtype == FTIO_RDAHEAD)) {
+ /*
+ * Eat the completion queue and see if the request
+ * is already there.
+ */
+ while (ft->doneh != NULL) {
+ if (blk == ft->doneh->reqblk) {
+ sp = ft->doneh;
+ sp->reqtype = FTIO_READING;
+ sp->reqbad = sr->sg_badmap;
+ goto rddone;
+ }
+ segio_free(ft, ft->doneh);
+ }
+
+ /*
+ * Not on the completed queue, in progress maybe?
+ */
+ if (ft->segh != NULL && ft->segh->reqtype == FTIO_RDAHEAD &&
+ blk == ft->segh->reqblk) {
+ sp = ft->segh;
+ sp->reqtype = FTIO_READING;
+ sp->reqbad = sr->sg_badmap;
+ goto rdwait;
+ }
+ }
+
+ /* Wait until we're ready. */
+ tape_inactive(ftu);
+
+ /* Set up a new read request. */
+ sp = segio_alloc(ft);
+ sp->reqcrc = 0;
+ sp->reqbad = sr->sg_badmap;
+ sp->reqblk = blk;
+ sp->reqseg = seg;
+ sp->reqcan = 0;
+ sp->reqtype = FTIO_READING;
+ segio_queue(ft, sp);
+
+ /* Start the read request off. */
+ DPRT(("Starting read I/O chain\n"));
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = sp->reqblk;
+ ft->xseg = sp->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = sp->buff;
+ ft->active = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
+
+rdwait:
+ ftsleep(wc_buff_done, 0);
+
+rddone:
+ bad = sp->reqbad;
+ sr->sg_crcmap = sp->reqcrc & ~bad;
+
+ /* Copy out segment and discard bad mapped blocks. */
+ cp = sp->buff; cp2 = sr->sg_data;
+ for (i = 0; i < QCV_BLKSEG; cp += QCV_BLKSIZE, i++) {
+ if (bad & (1 << i)) continue;
+ copyout(cp, cp2, QCV_BLKSIZE);
+ cp2 += QCV_BLKSIZE;
+ }
+ segio_free(ft, sp);
+ } else {
+ if (ft->segh != NULL && ft->segh->reqtype != FTIO_WRITING)
+ tape_inactive(ftu);
+
+ /* Allocate a buffer and start tape if we're running low. */
+ sp = segio_alloc(ft);
+ if (!ft->active && (sp == NULL || ft->nfreelist <= 1)) {
+ DPRT(("Starting write I/O chain\n"));
+ arq_state = ard_state = awr_state = 0;
+ ft->xblk = ft->segh->reqblk;
+ ft->xseg = ft->segh->reqseg;
+ ft->xcnt = 0;
+ ft->xptr = ft->segh->buff;
+ ft->active = 1;
+ ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
+ }
+
+ /* Sleep until a buffer becomes available. */
+ while (sp == NULL) {
+ ftsleep(wc_buff_avail, 0);
+ sp = segio_alloc(ft);
+ }
+
+ /* Copy in segment and expand bad blocks. */
+ bad = sr->sg_badmap;
+ cp = sr->sg_data; cp2 = sp->buff;
+ for (i = 0; i < QCV_BLKSEG; cp2 += QCV_BLKSIZE, i++) {
+ if (bad & (1 << i)) continue;
+ copyin(cp, cp2, QCV_BLKSIZE);
+ cp += QCV_BLKSIZE;
+ }
+ sp->reqblk = blk;
+ sp->reqseg = seg;
+ sp->reqcan = 0;
+ sp->reqtype = FTIO_WRITING;
+ segio_queue(ft, sp);
+ }
+ splx(s);
+ return(0);
+}
+
+
+/*
+ * Rewind to beginning of tape
+ */
+static int
+ftreq_rewind(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+ tape_cmd(ftu, QC_SEEKSTART);
+ tape_state(ftu, 0, QS_READY, 90);
+ tape_cmd(ftu, QC_SEEKTRACK);
+ tape_cmd(ftu, 2);
+ tape_state(ftu, 0, QS_READY, 90);
+ ft->lastpos = -1;
+ ft->moving = 0;
+ return(0);
+}
+
+
+/*
+ * Move to logical beginning or end of track
+ */
+static int
+ftreq_trkpos(ftu_t ftu, int req)
+{
+ int curtrk, r, cmd;
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+
+ r = tape_status(ftu);
+ if ((r & QS_CART) == 0) return(ENXIO); /* No cartridge */
+ if ((r & QS_FMTOK) == 0) return(ENXIO); /* Not formatted */
+
+ if (ftg == NULL || ft->newcart) {
+ if (ftgetgeom(ftu) < 0) return(ENXIO);
+ }
+
+ curtrk = (ft->lastpos < 0) ? 0 : ft->lastpos / ftg->g_blktrk;
+ if (req == QIOBOT)
+ cmd = (curtrk & 1) ? QC_SEEKEND : QC_SEEKSTART;
+ else
+ cmd = (curtrk & 1) ? QC_SEEKSTART : QC_SEEKEND;
+ tape_cmd(ftu, cmd);
+ tape_state(ftu, 0, QS_READY, 90);
+ return(0);
+}
+
+
+/*
+ * Seek tape head to a particular track.
+ */
+static int
+ftreq_trkset(ftu_t ftu, int *trk)
+{
+ int r;
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+
+ r = tape_status(ftu);
+ if ((r & QS_CART) == 0) return(ENXIO); /* No cartridge */
+ if ((r & QS_FMTOK) == 0) return(ENXIO); /* Not formatted */
+ if (ftg == NULL || ft->newcart) {
+ if (ftgetgeom(ftu) < 0) return(ENXIO);
+ }
+
+ tape_cmd(ftu, QC_SEEKTRACK);
+ tape_cmd(ftu, *trk + 2);
+ tape_state(ftu, 0, QS_READY, 90);
+ return(0);
+}
+
+
+/*
+ * Start tape moving forward.
+ */
+static int
+ftreq_lfwd(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+ tape_cmd(ftu, QC_FORWARD);
+ ft->moving = 1;
+ return(0);
+}
+
+
+/*
+ * Stop the tape
+ */
+static int
+ftreq_stop(ftu_t ftu)
+{
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ tape_cmd(ftu, QC_STOP);
+ tape_state(ftu, 0, QS_READY, 90);
+ ft->moving = 0;
+ return(0);
+}
+
+
+/*
+ * Set the particular mode the drive should be in.
+ */
+static int
+ftreq_setmode(ftu_t ftu, int cmd)
+{
+ int r;
+ ft_p ft = ft_data[ftu];
+
+ tape_inactive(ftu);
+ r = tape_status(ftu);
+
+ switch(cmd) {
+ case QIOPRIMARY:
+ ft->mode = FTM_PRIMARY;
+ tape_cmd(ftu, QC_PRIMARY);
+ break;
+ case QIOFORMAT:
+ if (r & QS_RDONLY) return(ENXIO);
+ if ((r & QS_BOT) == 0) return(ENXIO);
+ tape_cmd(ftu, QC_FORMAT);
+ break;
+ case QIOVERIFY:
+ if ((r & QS_FMTOK) == 0) return(ENXIO); /* Not formatted */
+ tape_cmd(ftu, QC_VERIFY);
+ break;
+ }
+ tape_state(ftu, 0, QS_READY, 60);
+ return(0);
+}
+
+
+/*
+ * Return drive status bits
+ */
+static int
+ftreq_status(ftu_t ftu, unsigned long cmd, int *sts, struct proc *p)
+{
+ ft_p ft = ft_data[ftu];
+
+ if (ft->active)
+ *sts = ft->laststs & ~QS_READY;
+ else
+ *sts = tape_status(ftu);
+ return(0);
+}
+
+
+/*
+ * Return drive configuration bits
+ */
+static int
+ftreq_config(ftu_t ftu, unsigned long cmd, int *cfg, struct proc *p)
+{
+ int r, tries;
+ ft_p ft = ft_data[ftu];
+
+ if (ft->active)
+ r = ft->lastcfg;
+ else {
+ for (r = -1, tries = 0; r < 0 && tries < 3; tries++)
+ r = qic_status(ftu, QC_CONFIG, 8);
+ if (tries == 3) return(ENXIO);
+ }
+ *cfg = r;
+ return(0);
+}
+
+
+/*
+ * Return current tape's geometry.
+ */
+static int
+ftreq_geom(ftu_t ftu, QIC_Geom *g)
+{
+ tape_inactive(ftu);
+ if (ftg == NULL && ftgetgeom(ftu) < 0) return(ENXIO);
+ bcopy(ftg, g, sizeof(QIC_Geom));
+ return(0);
+}
+
+
+/*
+ * Return drive hardware information
+ */
+static int
+ftreq_hwinfo(ftu_t ftu, QIC_HWInfo *hwp)
+{
+ int tries;
+ int rom, vend;
+
+ tape_inactive(ftu);
+ bzero(hwp, sizeof(QIC_HWInfo));
+
+ for (rom = -1, tries = 0; rom < 0 && tries < 3; tries++)
+ rom = qic_status(ftu, QC_VERSION, 8);
+ if (rom > 0) {
+ hwp->hw_rombeta = (rom >> 7) & 0x01;
+ hwp->hw_romid = rom & 0x7f;
+ }
+
+ for (vend = -1, tries = 0; vend < 0 && tries < 3; tries++)
+ vend = qic_status(ftu, QC_VENDORID, 16);
+ if (vend > 0) {
+ hwp->hw_make = (vend >> 6) & 0x3ff;
+ hwp->hw_model = vend & 0x3f;
+ }
+
+ return(0);
+}
+
+
+/*
+ * Receive or Send the in-core header segment.
+ */
+static int
+ftreq_hdr(ftu_t ftu, unsigned long cmd, QIC_Segment *sp)
+{
+ ft_p ft = ft_data[ftu];
+ QIC_Header *h = (QIC_Header *)ft->hdr->buff;
+
+ if (sp == NULL || sp->sg_data == NULL) return(EINVAL);
+ if (cmd == QIOSENDHDR) {
+ copyin(sp->sg_data, ft->hdr->buff, QCV_SEGSIZE);
+ } else {
+ if (h->qh_sig != QCV_HDRMAGIC) return(EIO);
+ copyout(ft->hdr->buff, sp->sg_data, QCV_SEGSIZE);
+ }
+ return(0);
+}
+
+/*
+ * I/O functions.
+ */
+int
+ftioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, struct proc *p)
+{
+ ftu_t ftu = FDUNIT(minor(dev));
+
+ switch(cmd) {
+ case QIOREAD: /* Request reading a segment from tape. */
+ case QIOWRITE: /* Request writing a segment to tape. */
+ return(ftreq_rw(ftu, cmd, (QIC_Segment *)data, p));
+
+ case QIOREWIND: /* Rewind tape. */
+ return(ftreq_rewind(ftu));
+
+ case QIOBOT: /* Seek to logical beginning of track. */
+ case QIOEOT: /* Seek to logical end of track. */
+ return(ftreq_trkpos(ftu, cmd));
+
+ case QIOTRACK: /* Seek tape head to specified track. */
+ return(ftreq_trkset(ftu, (int *)data));
+
+ case QIOSEEKLP: /* Seek load point. */
+ goto badreq;
+
+ case QIOFORWARD: /* Move tape in logical forward direction. */
+ return(ftreq_lfwd(ftu));
+
+ case QIOSTOP: /* Causes tape to stop. */
+ return(ftreq_stop(ftu));
+
+ case QIOPRIMARY: /* Enter primary mode. */
+ case QIOFORMAT: /* Enter format mode. */
+ case QIOVERIFY: /* Enter verify mode. */
+ return(ftreq_setmode(ftu, cmd));
+
+ case QIOWRREF: /* Write reference burst. */
+ goto badreq;
+
+ case QIOSTATUS: /* Get drive status. */
+ return(ftreq_status(ftu, cmd, (int *)data, p));
+
+ case QIOCONFIG: /* Get tape configuration. */
+ return(ftreq_config(ftu, cmd, (int *)data, p));
+
+ case QIOGEOM:
+ return(ftreq_geom(ftu, (QIC_Geom *)data));
+
+ case QIOHWINFO:
+ return(ftreq_hwinfo(ftu, (QIC_HWInfo *)data));
+
+ case QIOSENDHDR:
+ case QIORECVHDR:
+ return(ftreq_hdr(ftu, cmd, (QIC_Segment *)data));
+ }
+badreq:
+ DPRT(("ft%d: unknown ioctl(%#lx) request\n", ftu, cmd));
+ return(ENXIO);
+}
+
+#endif
diff --git a/sys/i386/isa/ftreg.h b/sys/i386/isa/ftreg.h
new file mode 100644
index 0000000000000..eea78ec9ea5a0
--- /dev/null
+++ b/sys/i386/isa/ftreg.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 1993, 1994 Steve Gerakines
+ *
+ * This is freely redistributable software. You may do anything you
+ * wish with it, so long as the above notice stays intact.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ftreg.h - QIC-40/80 floppy tape driver header
+ * 06/03/94 v0.9
+ * Changed seek load point to QC_SEEKLP, added reqseg to SegReq structure.
+ *
+ * 10/30/93 v0.3
+ * More things will end up here. QC_VENDORID and QC_VERSION now used.
+ *
+ * 08/07/93 v0.2 release
+ * Things that should've been here in the first place were moved.
+ * Tape geometry and segment request types were added.
+ *
+ * 06/03/93 v0.1 Alpha release
+ * Initial revision. Many more things should be moved here.
+ */
+
+/* QIC-117 command set. */
+#define QC_RESET 1 /* reset */
+#define QC_NEXTBIT 2 /* report next bit */
+#define QC_PAUSE 3 /* pause */
+#define QC_STPAUSE 4 /* step pause */
+#define QC_TIMEOUT 5 /* alt timeout */
+#define QC_STATUS 6 /* report status */
+#define QC_ERRCODE 7 /* report error code */
+#define QC_CONFIG 8 /* report config */
+#define QC_VERSION 9 /* report version */
+#define QC_FORWARD 10 /* logical forward */
+#define QC_SEEKSTART 11 /* seek to track start */
+#define QC_SEEKEND 12 /* seek to track end */
+#define QC_SEEKTRACK 13 /* seek head to track */
+#define QC_SEEKLP 14 /* seek load point */
+#define QC_FORMAT 15 /* format mode */
+#define QC_WRITEREF 16 /* write reference */
+#define QC_VERIFY 17 /* verify mode */
+#define QC_STOP 18 /* stop tape */
+#define QC_STEPUP 21 /* step head up */
+#define QC_STEPDOWN 22 /* step head down */
+#define QC_SEEKREV 25 /* seek reverse */
+#define QC_SEEKFWD 26 /* seek forward */
+#define QC_RATE 27 /* select data rate */
+#define QC_DIAG1 28 /* diagnostic mode 1 */
+#define QC_DIAG2 29 /* diagnostic mode 2 */
+#define QC_PRIMARY 30 /* primary mode */
+#define QC_VENDORID 32 /* vendor id */
+#define QC_TSTATUS 33 /* report tape status */
+#define QC_EXTREV 34 /* extended skip reverse */
+#define QC_EXTFWD 35 /* extended skip forward */
+
+/* Colorado enable/disable. */
+#define QC_COL_ENABLE1 46 /* enable */
+#define QC_COL_ENABLE2 2 /* unit+2 */
+#define QC_COL_DISABLE 47 /* disable */
+
+/* Mountain enable/disable. */
+#define QC_MTN_ENABLE1 23 /* enable 1 */
+#define QC_MTN_ENABLE2 20 /* enable 2 */
+#define QC_MTN_DISABLE 24 /* disable */
+
+/* Segment I/O request. */
+typedef struct segq {
+ unsigned char buff[QCV_SEGSIZE];/* Segment data; first for alignment */
+ int reqtype; /* Request type */
+ long reqcrc; /* CRC Errors found */
+ long reqbad; /* Bad sector map */
+ long reqblk; /* Block request starts at */
+ long reqseg; /* Segment request is at */
+ int reqcan; /* Cancel read-ahead */
+ struct segq *next; /* Next request */
+} SegReq;
+
+typedef int ftu_t;
+typedef int ftsu_t;
+typedef struct ft_data *ft_p;
diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c
index 1fa83761b8535..44a97ea7c72e8 100644
--- a/sys/i386/isa/gsc.c
+++ b/sys/i386/isa/gsc.c
@@ -71,13 +71,9 @@
#define DMA1_READY 0x08
#ifdef GSCDEBUG
-#define lprintf(args) \
- do { \
- if (scu->flags & FLAG_DEBUG) \
- printf args; \
- } while (0)
+#define lprintf if(scu->flags & FLAG_DEBUG) printf
#else
-#define lprintf(args)
+#define lprintf (void)
#endif
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -230,16 +226,16 @@ lookup_geometry(struct gsc_geom geom, const struct gsc_unit *scu)
( ( geom.g_res != INVALID ) && ( tab.g_res == geom.g_res ) ) ||
( ( geom.s_res != INVALID ) && ( tab.s_res == geom.s_res ) ) )
{
- lprintf(("gsc.lookup_geometry: "
+ lprintf("gsc.lookup_geometry: "
"geometry lookup found: %ddpi, %ddpl\n",
- tab.dpi, tab.dpl));
+ tab.dpi, tab.dpl);
return i;
}
}
- lprintf(("gsc.lookup_geometry: "
+ lprintf("gsc.lookup_geometry: "
"geometry lookup failed on {%d, %d, 0x%02x, 0x%02x}\n",
- geom.dpi, geom.dpl, geom.g_res, geom.s_res));
+ geom.dpi, geom.dpl, geom.g_res, geom.s_res);
return INVALID;
}
@@ -257,7 +253,7 @@ get_geometry(const struct gsc_unit *scu)
{
struct gsc_geom geom = NEW_GEOM;
- lprintf(("gsc.get_geometry: get geometry at 0x%03x\n", scu->stat));
+ lprintf("gsc.get_geometry: get geometry at 0x%03x\n", scu->stat);
if ( ( geom.g_res = inb(scu->stat) ) == FAIL )
return INVALID;
@@ -280,18 +276,18 @@ buffer_allocate(struct gsc_unit *scu)
size = scu->blen * geomtab[scu->geometry].dpl / 8;
- lprintf(("gsc.buffer_allocate: need 0x%x bytes\n", size));
+ lprintf("gsc.buffer_allocate: need 0x%x bytes\n", size);
if ( size > MAX_BUFSIZE )
{
- lprintf(("gsc.buffer_allocate: 0x%x bytes are too much\n", size));
+ lprintf("gsc.buffer_allocate: 0x%x bytes are too much\n", size);
return ENOMEM;
}
scu->sbuf.size = size;
scu->sbuf.poi = size;
- lprintf(("gsc.buffer_allocate: ok\n"));
+ lprintf("gsc.buffer_allocate: ok\n");
return SUCCESS;
}
@@ -311,11 +307,11 @@ buffer_read(struct gsc_unit *scu)
int sps;
int delay;
- lprintf(("gsc.buffer_read: begin\n"));
+ lprintf("gsc.buffer_read: begin\n");
if (scu->ctrl_byte == INVALID)
{
- lprintf(("gsc.buffer_read: invalid ctrl_byte\n"));
+ lprintf("gsc.buffer_read: invalid ctrl_byte\n");
return EIO;
}
@@ -334,7 +330,7 @@ buffer_read(struct gsc_unit *scu)
if(delay >= scu->btime)
{
splx(sps);
- lprintf(("gsc.buffer_read: timeout\n"));
+ lprintf("gsc.buffer_read: timeout\n");
res = EWOULDBLOCK;
break;
}
@@ -350,16 +346,16 @@ buffer_read(struct gsc_unit *scu)
if(res != SUCCESS)
{
- lprintf(("gsc.buffer_read: aborted with %d\n", res));
+ lprintf("gsc.buffer_read: aborted with %d\n", res);
return res;
}
- lprintf(("gsc.buffer_read: invert buffer\n"));
+ lprintf("gsc.buffer_read: invert buffer\n");
for(p = scu->sbuf.base + scu->sbuf.size - 1; p >= scu->sbuf.base; p--)
*p = ~*p;
scu->sbuf.poi = 0;
- lprintf(("gsc.buffer_read: ok\n"));
+ lprintf("gsc.buffer_read: ok\n");
return SUCCESS;
}
@@ -388,25 +384,25 @@ gscprobe (struct isa_device *isdp)
scu->flags = FLAG_DEBUG;
- lprintf(("gsc%d.probe "
- "on iobase 0x%03x, irq %d, drq %d, addr %p, size %d\n",
+ lprintf("gsc%d.probe "
+ "on iobase 0x%03x, irq %d, drq %d, addr %d, size %d\n",
unit,
isdp->id_iobase,
isdp->id_irq,
isdp->id_drq,
isdp->id_maddr,
- isdp->id_msize));
+ isdp->id_msize);
if ( isdp->id_iobase < 0 )
{
- lprintf(("gsc%d.probe: no iobase given\n", unit));
+ lprintf("gsc%d.probe: no iobase given\n", unit);
return PROBE_FAIL;
}
stb = inb( GSC_STAT(isdp->id_iobase) );
if (stb == FAIL)
{
- lprintf(("gsc%d.probe: get status byte failed\n", unit));
+ lprintf("gsc%d.probe: get status byte failed\n", unit);
return PROBE_FAIL;
}
@@ -420,25 +416,25 @@ gscprobe (struct isa_device *isdp)
switch(stb & GSC_CNF_MASK) {
case GSC_CNF_DMA1:
- lprintf(("gsc%d.probe: DMA 1\n", unit));
+ lprintf("gsc%d.probe: DMA 1\n", unit);
scu->channel = 1;
break;
case GSC_CNF_DMA3:
- lprintf(("gsc%d.probe: DMA 3\n", unit));
+ lprintf("gsc%d.probe: DMA 3\n", unit);
scu->channel = 3;
break;
case GSC_CNF_IRQ3:
- lprintf(("gsc%d.probe: IRQ 3\n", unit));
+ lprintf("gsc%d.probe: IRQ 3\n", unit);
goto probe_noirq;
case GSC_CNF_IRQ5:
- lprintf(("gsc%d.probe: IRQ 5\n", unit));
+ lprintf("gsc%d.probe: IRQ 5\n", unit);
probe_noirq:
- lprintf(("gsc%d.probe: sorry, can't use IRQ yet\n", unit));
+ lprintf("gsc%d.probe: sorry, can't use IRQ yet\n", unit);
return PROBE_FAIL;
default:
- lprintf(("gsc%d.probe: invalid status byte 0x%02x\n", unit, (u_char) stb));
+ lprintf("gsc%d.probe: invalid status byte\n", unit, stb);
return PROBE_FAIL;
}
@@ -446,8 +442,8 @@ gscprobe (struct isa_device *isdp)
isdp->id_drq = scu->channel;
if (scu->channel != isdp->id_drq)
{
- lprintf(("gsc%d.probe: drq mismatch: config: %d; hardware: %d\n",
- unit, isdp->id_drq, scu->channel));
+ lprintf("gsc%d.probe: drq mismatch: config: %d; hardware: %d\n",
+ unit, isdp->id_drq, scu->channel);
return PROBE_FAIL;
}
@@ -455,7 +451,7 @@ gscprobe (struct isa_device *isdp)
scu->geometry = lookup_geometry(geom, scu);
if (scu->geometry == INVALID)
{
- lprintf(("gsc%d.probe: geometry lookup failed\n", unit));
+ lprintf("gsc%d.probe: geometry lookup failed\n", unit);
return PROBE_FAIL;
}
else
@@ -463,13 +459,13 @@ gscprobe (struct isa_device *isdp)
scu->ctrl_byte = geomtab[scu->geometry].s_res;
outb(scu->ctrl, scu->ctrl_byte | GSC_POWER_ON);
- lprintf(("gsc%d.probe: status 0x%02x, %ddpi\n",
- unit, stb, geomtab[scu->geometry].dpi));
+ lprintf("gsc%d.probe: status 0x%02x, %ddpi\n",
+ unit, stb, geomtab[scu->geometry].dpi);
outb(scu->ctrl, scu->ctrl_byte & ~GSC_POWER_ON);
}
- lprintf(("gsc%d.probe: ok\n", unit));
+ lprintf("gsc%d.probe: ok\n", unit);
scu->flags &= ~FLAG_DEBUG;
@@ -492,14 +488,14 @@ gscattach(struct isa_device *isdp)
scu->flags |= FLAG_DEBUG;
- lprintf(("gsc%d.attach: "
- "iobase 0x%03x, irq %d, drq %d, addr %p, size %d\n",
+ lprintf("gsc%d.attach: "
+ "iobase 0x%03x, irq %d, drq %d, addr %d, size %d\n",
unit,
isdp->id_iobase,
isdp->id_irq,
isdp->id_drq,
isdp->id_maddr,
- isdp->id_msize));
+ isdp->id_msize);
printf("gsc%d: GeniScan GS-4500 at %ddpi\n",
unit, geomtab[scu->geometry].dpi);
@@ -513,7 +509,7 @@ gscattach(struct isa_device *isdp)
0ul, 0xfffffful, 1ul, 0x10000ul);
if ( scu->sbuf.base == NULL )
{
- lprintf(("gsc%d.attach: buffer allocation failed\n", unit));
+ lprintf("gsc%d.attach: buffer allocation failed\n", unit);
return ATTACH_FAIL; /* XXX attach must not fail */
}
scu->sbuf.size = INVALID;
@@ -523,7 +519,7 @@ gscattach(struct isa_device *isdp)
scu->btime = TIMEOUT;
scu->flags |= ATTACHED;
- lprintf(("gsc%d.attach: ok\n", unit));
+ lprintf("gsc%d.attach: ok\n", unit);
scu->flags &= ~FLAG_DEBUG;
#ifdef DEVFS
#define GSC_UID 0
@@ -573,8 +569,8 @@ gscopen (dev_t dev, int flags, int fmt, struct proc *p)
scu = unittab + unit;
if ( !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.open: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.open: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
@@ -586,23 +582,23 @@ gscopen (dev_t dev, int flags, int fmt, struct proc *p)
switch(minor(dev) & FRMT_MASK) {
case FRMT_PBM:
scu->flags |= PBM_MODE;
- lprintf(("gsc%d.open: pbm mode\n", unit));
+ lprintf("gsc%d.open: pbm mode\n", unit);
break;
case FRMT_RAW:
- lprintf(("gsc%d.open: raw mode\n", unit));
+ lprintf("gsc%d.open: raw mode\n", unit);
scu->flags &= ~PBM_MODE;
break;
default:
- lprintf(("gsc%d.open: gray maps are not yet supported", unit));
+ lprintf("gsc%d.open: gray maps are not yet supported", unit);
return ENXIO;
}
- lprintf(("gsc%d.open: minor %d\n",
- unit, minor(dev)));
+ lprintf("gsc%d.open: minor %d\n",
+ unit, minor(dev));
if ( scu->flags & OPEN )
{
- lprintf(("gsc%d.open: already open", unit));
+ lprintf("gsc%d.open: already open", unit);
return EBUSY;
}
@@ -628,13 +624,13 @@ gscclose (dev_t dev, int flags, int fmt, struct proc *p)
int unit = UNIT(minor(dev));
struct gsc_unit *scu = unittab + unit;
- lprintf(("gsc%d.close: minor %d\n",
- unit, minor(dev)));
+ lprintf("gsc%d.close: minor %d\n",
+ unit, minor(dev));
if ( unit >= NGSC || !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.read: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.read: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
@@ -663,12 +659,12 @@ gscread (dev_t dev, struct uio *uio, int ioflag)
size_t nbytes;
int res;
- lprintf(("gsc%d.read: minor %d\n", unit, minor(dev)));
+ lprintf("gsc%d.read: minor %d\n", unit, minor(dev));
if ( unit >= NGSC || !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.read: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.read: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
@@ -691,8 +687,8 @@ gscread (dev_t dev, struct uio *uio, int ioflag)
sprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height);
scu->bcount = scu->height * width / 8;
- lprintf(("gsc%d.read: initializing pbm mode: `%s', bcount: 0x%x\n",
- unit, scu->sbuf.base, scu->bcount));
+ lprintf("gsc%d.read: initializing pbm mode: `%s', bcount: 0x%x\n",
+ unit, scu->sbuf.base, scu->bcount);
/* move header to end of sbuf */
for(p=scu->sbuf.base; *p; p++);
@@ -704,37 +700,37 @@ gscread (dev_t dev, struct uio *uio, int ioflag)
}
}
- lprintf(("gsc%d.read(before buffer_read): "
+ lprintf("gsc%d.read(before buffer_read): "
"size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
- unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount));
+ unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount);
if ( scu->sbuf.poi == scu->sbuf.size )
if ( (res = buffer_read(scu)) != SUCCESS )
return res;
- lprintf(("gsc%d.read(after buffer_read): "
+ lprintf("gsc%d.read(after buffer_read): "
"size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
- unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount));
+ unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount);
nbytes = MIN( uio->uio_resid, scu->sbuf.size - scu->sbuf.poi );
if ( (scu->flags & PBM_MODE) )
nbytes = MIN( nbytes, scu->bcount );
- lprintf(("gsc%d.read: transferring 0x%x bytes", unit, nbytes));
+ lprintf("gsc%d.read: transferring 0x%x bytes", nbytes);
res = uiomove(scu->sbuf.base + scu->sbuf.poi, nbytes, uio);
if ( res != SUCCESS )
{
- lprintf(("gsc%d.read: uiomove failed %d", unit, res));
+ lprintf("gsc%d.read: uiomove failed %d", unit, res);
return res;
}
scu->sbuf.poi += nbytes;
if ( scu->flags & PBM_MODE ) scu->bcount -= nbytes;
- lprintf(("gsc%d.read: size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
- unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount));
+ lprintf("gsc%d.read: size 0x%x, pointer 0x%x, bcount 0x%x, ok\n",
+ unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount);
return SUCCESS;
}
@@ -751,38 +747,38 @@ gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
int unit = UNIT(minor(dev));
struct gsc_unit *scu = unittab + unit;
- lprintf(("gsc%d.ioctl: minor %d\n",
- unit, minor(dev)));
+ lprintf("gsc%d.ioctl: minor %d\n",
+ unit, minor(dev));
if ( unit >= NGSC || !( scu->flags & ATTACHED ) )
{
- lprintf(("gsc%d.ioctl: unit was not attached successfully 0x%04x\n",
- unit, scu->flags));
+ lprintf("gsc%d.ioctl: unit was not attached successfully 0x04x\n",
+ unit, scu->flags);
return ENXIO;
}
switch(cmd) {
case GSC_SRESSW:
- lprintf(("gsc%d.ioctl:GSC_SRESSW\n", unit));
+ lprintf("gsc%d.ioctl:GSC_SRESSW\n", unit);
if ( scu->flags & READING )
{
- lprintf(("gsc%d:ioctl on already reading unit\n", unit));
+ lprintf("gsc%d:ioctl on already reading unit\n", unit);
return EBUSY;
}
scu->geometry = get_geometry(scu);
return SUCCESS;
case GSC_GRES:
*(int *)data=geomtab[scu->geometry].dpi;
- lprintf(("gsc%d.ioctl:GSC_GRES %ddpi\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GRES %ddpi\n", unit, *(int *)data);
return SUCCESS;
case GSC_GWIDTH:
*(int *)data=geomtab[scu->geometry].dpl;
- lprintf(("gsc%d.ioctl:GSC_GWIDTH %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GWIDTH %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SRES:
case GSC_SWIDTH:
- lprintf(("gsc%d.ioctl:GSC_SRES or GSC_SWIDTH %d\n",
- unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SRES or GSC_SWIDTH %d\n",
+ unit, *(int *)data);
{ int g;
struct gsc_geom geom = NEW_GEOM;
if ( cmd == GSC_SRES )
@@ -796,37 +792,37 @@ gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
}
case GSC_GHEIGHT:
*(int *)data=scu->height;
- lprintf(("gsc%d.ioctl:GSC_GHEIGHT %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GHEIGHT %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SHEIGHT:
- lprintf(("gsc%d.ioctl:GSC_SHEIGHT %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SHEIGHT %d\n", unit, *(int *)data);
if ( scu->flags & READING )
{
- lprintf(("gsc%d:ioctl on already reading unit\n", unit));
+ lprintf("gsc%d:ioctl on already reading unit\n", unit);
return EBUSY;
}
scu->height=*(int *)data;
return SUCCESS;
case GSC_GBLEN:
*(int *)data=scu->blen;
- lprintf(("gsc%d.ioctl:GSC_GBLEN %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GBLEN %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SBLEN:
- lprintf(("gsc%d.ioctl:GSC_SBLEN %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SBLEN %d\n", unit, *(int *)data);
if (*(int *)data * geomtab[scu->geometry].dpl / 8 > MAX_BUFSIZE)
{
- lprintf(("gsc%d:ioctl buffer size too high\n", unit));
+ lprintf("gsc%d:ioctl buffer size too high\n", unit);
return ENOMEM;
}
scu->blen=*(int *)data;
return SUCCESS;
case GSC_GBTIME:
*(int *)data = scu->btime / hz;
- lprintf(("gsc%d.ioctl:GSC_GBTIME %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_GBTIME %d\n", unit, *(int *)data);
return SUCCESS;
case GSC_SBTIME:
scu->btime = *(int *)data * hz;
- lprintf(("gsc%d.ioctl:GSC_SBTIME %d\n", unit, *(int *)data));
+ lprintf("gsc%d.ioctl:GSC_SBTIME %d\n", unit, *(int *)data);
return SUCCESS;
default: return ENOTTY;
}
diff --git a/sys/i386/isa/ic/cd1400.h b/sys/i386/isa/ic/cd1400.h
index ee9b9f27a4ddb..52081fe9b8368 100644
--- a/sys/i386/isa/ic/cd1400.h
+++ b/sys/i386/isa/ic/cd1400.h
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cd1400.h,v 1.4 1997/02/22 09:37:59 peter Exp $
+ * $Id$
*/
/*
@@ -99,7 +99,6 @@
#define CD1400_CCR_CMDRESET (1<<7) /* enables following: */
#define CD1400_CCR_FTF (1<<1) /* flush tx fifo */
#define CD1400_CCR_FULLRESET (1<<0) /* full reset */
-#define CD1400_CCR_CHANRESET 0 /* current channel */
#define CD1400_CCR_CMDCORCHG (1<<6) /* enables following: */
#define CD1400_CCR_COR3 (1<<3) /* COR3 changed */
#define CD1400_CCR_COR2 (1<<2) /* COR2 changed */
@@ -134,10 +133,6 @@
#define CD1400_COR2_IXANY (1<<7) /* implied XON mode */
#define CD1400_COR2_IXOFF (1<<6) /* in-band tx flow control */
#define CD1400_COR2_ETC (1<<5) /* embedded tx command */
-#define CD1400_ETC_CMD 0x00 /* start an ETC */
-#define CD1400_ETC_SENDBREAK 0x81
-#define CD1400_ETC_INSERTDELAY 0x82
-#define CD1400_ETC_STOPBREAK 0x83
#define CD1400_COR2_LLM (1<<4) /* local loopback mode */
#define CD1400_COR2_RLM (1<<3) /* remote loopback mode */
#define CD1400_COR2_RTSAO (1<<2) /* RTS auto output */
diff --git a/sys/i386/isa/ic/esp.h b/sys/i386/isa/ic/esp.h
index cc74b0b67720a..6621e6503917c 100644
--- a/sys/i386/isa/ic/esp.h
+++ b/sys/i386/isa/ic/esp.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: esp.h,v 1.4 1999/01/03 05:03:46 kato Exp $
+ * $Id$
*/
#ifndef _IC_ESP_H_
@@ -59,9 +59,6 @@
#define ESP_SETFLOWTYPE 0x08 /* set type of flow-control (2 bytes) */
#define ESP_SETRXFLOW 0x0a /* set Rx FIFO flow control levels (4 bytes) */
#define ESP_SETMODE 0x10 /* set board mode (1 byte) */
-#ifdef PC98
-#define ESP_SETCLOCK 0x23 /* set UART clock prescaler */
-#endif
/* Mode bits (ESP_SETMODE). */
#define ESP_MODE_FIFO 0x02 /* act like a 16550 (compatibility mode) */
diff --git a/sys/i386/isa/ic/ncr53400.h b/sys/i386/isa/ic/ncr53400.h
new file mode 100644
index 0000000000000..4a60f018826f4
--- /dev/null
+++ b/sys/i386/isa/ic/ncr53400.h
@@ -0,0 +1,49 @@
+/*
+ * Definitions for 53C400 SCSI-controller chip.
+ *
+ * Derived from Linux NCR-5380 generic driver sources (by Drew Eckhardt).
+ *
+ * Copyright (C) 1994 Serge Vakulenko (vak@cronyx.ru)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPERS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _IC_NCR_53C400_H_
+#define _IC_NCR_53C400_H_
+
+#define C400_CSR 0 /* rw - Control and Status Reg. */
+#define CSR_5380_ENABLE 0x80
+#define CSR_TRANSFER_DIRECTION 0x40
+#define CSR_TRANSFER_READY_INTR 0x20
+#define CSR_5380_INTR 0x10
+#define CSR_SHARED_INTR 0x08
+#define CSR_HOST_BUF_NOT_READY 0x04 /* read only */
+#define CSR_SCSI_BUF_READY 0x02 /* read only */
+#define CSR_5380_GATED_IRQ 0x01 /* read only */
+#define CSR_BITS "\20\1irq\2sbrdy\3hbrdy\4shintr\5intr\6tintr\7tdir\10enable"
+
+#define C400_CCR 1 /* rw - Clock Counter Reg. */
+#define C400_HBR 4 /* rw - Host Buffer Reg. */
+
+#define C400_5380_REG_OFFSET 8 /* Offset of 5380 registers. */
+
+#endif /* _IC_NCR_53C400_H_ */
diff --git a/sys/i386/isa/ic/ncr5380.h b/sys/i386/isa/ic/ncr5380.h
new file mode 100644
index 0000000000000..ce14fec3da2f9
--- /dev/null
+++ b/sys/i386/isa/ic/ncr5380.h
@@ -0,0 +1,90 @@
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ * Modified by Serge Vakulenko (vak@cronyx.ru)
+ *
+ * ncr_5380.h,v 1.2 1994/09/11 20:29:18 phk Exp
+ *
+ * Definitions for 5380 SCSI-controller chip.
+ *
+ * Derived from "NCR 53C80 Family SCSI Protocol Controller Data Manual"
+ */
+
+#ifndef _IC_NCR_5380_H_
+#define _IC_NCR_5380_H_
+
+#define C80_CSDR 0 /* ro - Current SCSI Data Reg. */
+#define C80_ODR 0 /* wo - Output Data Reg. */
+
+#define C80_ICR 1 /* rw - Initiator Command Reg. */
+#define ICR_ASSERT_RST 0x80
+#define ICR_ARBITRATION_IN_PROGRESS 0x40 /* read only */
+#define ICR_TRI_STATE_MODE 0x40 /* write only */
+#define ICR_LOST_ARBITRATION 0x20 /* read only */
+#define ICR_DIFF_ENABLE 0x20 /* write only */
+#define ICR_ASSERT_ACK 0x10
+#define ICR_ASSERT_BSY 0x08
+#define ICR_ASSERT_SEL 0x04
+#define ICR_ASSERT_ATN 0x02
+#define ICR_ASSERT_DATA_BUS 0x01
+#define ICR_BITS "\20\1dbus\2atn\3sel\4bsy\5ack\6arblost\7arb\10rst"
+
+/*
+ * The mask to use when doing read_modify_write on ICR.
+ */
+#define ICR_MASK (~(ICR_DIFF_ENABLE | ICR_TRI_STATE_MODE))
+
+#define C80_MR 2 /* rw - Mode Reg. */
+#define MR_BLOCK_MODE_DMA 0x80
+#define MR_TARGET_MODE 0x40
+#define MR_ENABLE_PARITY_CHECKING 0x20
+#define MR_ENABLE_PARITY_INTERRUPT 0x10
+#define MR_ENABLE_EOP_INTERRUPT 0x08
+#define MR_MONITOR_BUSY 0x04
+#define MR_DMA_MODE 0x02
+#define MR_ARBITRATE 0x01
+#define MR_BITS "\20\1arb\2dma\3mbusy\4eopintr\5parintr\6pcheck\7targ\10blk"
+
+#define C80_TCR 3 /* rw - Target Command Reg. */
+#define TCR_LAST_BYTE_SENT 0x80 /* read only */
+#define TCR_ASSERT_REQ 0x08
+#define TCR_ASSERT_MSG 0x04
+#define TCR_ASSERT_CD 0x02
+#define TCR_ASSERT_IO 0x01
+#define TCR_BITS "\20\1i/o\2c/d\3msg\4req\10lastbyte"
+
+#define C80_CSBR 4 /* ro - Current SCSI Bus Status Reg. */
+#define CSBR_RST 0x80
+#define CSBR_BSY 0x40
+#define CSBR_REQ 0x20
+#define CSBR_MSG 0x10
+#define CSBR_CD 0x08
+#define CSBR_IO 0x04
+#define CSBR_SEL 0x02
+#define CSBR_ACK 0x01
+#define CSBR_BITS "\20\1ack\2sel\3i/o\4c/d\5msg\6req\7bsy\10rst"
+
+#define C80_SER 4 /* wo - Select Enable Reg. */
+
+#define C80_BSR 5 /* ro - Bus and Status Reg. */
+#define BSR_END_OF_DMA_XFER 0x80
+#define BSR_DMA_REQUEST 0x40
+#define BSR_PARITY_ERROR 0x20
+#define BSR_INTERRUPT_REQUEST_ACTIVE 0x10
+#define BSR_PHASE_MISMATCH 0x08
+#define BSR_BUSY_ERROR 0x04
+#define BSR_ATN 0x02
+#define BSR_ACK 0x01
+#define BSR_BITS "\20\1ack\2atn\3busyerr\4pherr\5irq\6parerr\7drq\10dend"
+
+#define C80_SDSR 5 /* wo - Start DMA Send Reg. */
+#define C80_IDR 6 /* ro - Input Data Reg. */
+#define C80_SDTR 6 /* wo - Start DMA Target Receive Reg. */
+#define C80_RPIR 7 /* ro - Reset Parity/Interrupt Reg. */
+#define C80_SDIR 7 /* wo - Start DMA Initiator Receive Reg. */
+
+#endif /* _IC_NCR_5380_H_ */
diff --git a/sys/i386/isa/ic/ns16550.h b/sys/i386/isa/ic/ns16550.h
index b91f5fd2a8395..ba338886c764b 100644
--- a/sys/i386/isa/ic/ns16550.h
+++ b/sys/i386/isa/ic/ns16550.h
@@ -31,12 +31,25 @@
* SUCH DAMAGE.
*
* from: @(#)ns16550.h 7.1 (Berkeley) 5/9/91
- * $Id: ns16550.h,v 1.6 1999/01/03 05:03:46 kato Exp $
+ * $Id$
*/
/*
* NS16550 UART registers
*/
+#ifdef PC98
+#define com_data 0x000 /* data register (R/W) */
+#define com_dlbl 0x000 /* divisor latch low (W) */
+#define com_dlbh 0x100 /* divisor latch high (W) */
+#define com_ier 0x100 /* interrupt enable (W) */
+#define com_iir 0x200 /* interrupt identification (R) */
+#define com_fifo 0x200 /* FIFO control (W) */
+#define com_lctl 0x300 /* line control register (R/W) */
+#define com_cfcr 0x300 /* line control register (R/W) */
+#define com_mcr 0x400 /* modem control register (R/W) */
+#define com_lsr 0x500 /* line status register (R/W) */
+#define com_msr 0x600 /* modem status register (R/W) */
+#else /* IBM-PC */
#define com_data 0 /* data register (R/W) */
#define com_dlbl 0 /* divisor latch low (W) */
#define com_dlbh 1 /* divisor latch high (W) */
@@ -48,3 +61,4 @@
#define com_mcr 4 /* modem control register (R/W) */
#define com_lsr 5 /* line status register (R/W) */
#define com_msr 6 /* modem status register (R/W) */
+#endif /* PC98 */
diff --git a/sys/i386/isa/ic/rsa.h b/sys/i386/isa/ic/rsa.h
deleted file mode 100644
index e760e306cacc9..0000000000000
--- a/sys/i386/isa/ic/rsa.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*-
- * Copyright (c) 1999 FreeBSD Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: $
- */
-
-/*
- * RSA Mode Driver Data Sheet
- *
- * <<Register Map>>
- * Base + 0x00
- * Mode Select Register(Read/Write)
- * bit4=interrupt type(1: level, 0: edge)
- * bit3=Auto RTS-CTS Flow Control Enable
- * bit2=External FIFO Enable
- * bit1=Reserved(Default 0)Don't Change!!
- * bit0=Swap Upper 8byte and Lower 8byte in 16byte space.
- *
- * Base + 0x01
- * Interrupt Enable Register(Read/Write)
- * bit4=Hardware Timer Interrupt Enable
- * bit3=Character Time-Out Interrupt Enable
- * bit2=Tx FIFO Empty Interrupt Enable
- * bit1=Tx FIFO Half Full Interrupt Enable
- * bit0=Rx FIFO Half Full Interrupt Enable
- *
- * Base + 0x02
- * Status Read Register(Read)
- * bit7=Hardware Time Out Interrupt Status(1: True, 0: False)
- * bit6=Character Time Out Interrupt Status
- * bit5=Rx FIFO Full Flag(0: True, 1: False)
- * bit4=Rx FIFO Half Full Flag
- * bit3=Rx FIFO Empty Flag
- * bit2=Tx FIFO Full Flag
- * bit1=Tx FIFO Half Full Flag
- * bit0=Tx FIFO Empty Flag
- *
- * Base + 0x02
- * FIFO Reset Register(Write)
- * Reset Extrnal FIFO
- *
- * Base + 0x03
- * Timer Interval Value Set Register(Read/Write)
- * Range of n: 1-255
- * Interval Value: n * 0.2ms
- *
- * Base + 0x04
- * Timer Control Register(Read/Write)
- * bit0=Timer Enable
- *
- * Base + 0x08 - 0x0f
- * Same as UART 16550
- *
- * Special Regisgter in RSA Mode
- * UART Data Register(Base + 0x08)
- * Data transfer between Extrnal FIFO
- *
- * UART MCR(Base + 0x0c)
- * bit3(OUT2[MCR_IENABLE])=1: Diable 16550 to Rx FIFO transfer
- * bit2(OUT1[MCR_DRS])=1: Diable Tx FIFO to 16550 transfer
- *
- * <<Intrrupt and Intrrupt Reset>>
- * o Reciver Line Status(from UART16550)
- * Reset: Read LSR
- *
- * o Modem Status(from UART16550)
- * Reset: Read MSR
- *
- * o Rx FIFO Half Full(from Extrnal FIFO)
- * Reset: Read Rx FIFO under Hall Full
- *
- * o Character Time Out(from Extrnal FIFO)
- * Reset: Read Rx FIFO or SRR
- *
- * o Tx FIFO Empty(from Extrnal FIFO)
- * Reset: Write Tx FIFO or Read SRR
- *
- * o Tx FIFO Half Full(from Extrnal FIFO)
- * Reset: Write Tx FIFO until Hall Full or Read SRR
- *
- * o Hardware Timer(from Extrnal FIFO)
- * Reset: Disable Timer in TCR
- * Notes: If you want to use Timer for next intrrupt,
- * you must enable Timer in TCR
- *
- * <<Used Setting>>
- * Auto RTS-CTS: Enable or Disable
- * External FIFO: Enable
- * Swap 8bytes: Disable
- * Haredware Timer: Disable
- * interrupt type: edge
- * interrupt source:
- * Hareware Timer
- * Character Time Out
- * Tx FIFO Empty
- * Rx FIFO Half Full
- *
- */
-
-/* I/O-DATA RSA Serise Exrension Register */
-#define rsa_msr 0 /* Mode Status Register (R/W) */
-#define rsa_ier 1 /* Interrupt Enable Register (R/W) */
-#define rsa_srr 2 /* Status Read Register (R) */
-#define rsa_frr 2 /* FIFO Reset Register (W) */
-#define rsa_tivsr 3 /* Timer Interval Value Set Register (R/W) */
-#define rsa_tcr 4 /* Timer Control Register (W) */
diff --git a/sys/i386/isa/if_ar.c b/sys/i386/isa/if_ar.c
index a3fa4a28b37de..adebd22e54891 100644
--- a/sys/i386/isa/if_ar.c
+++ b/sys/i386/isa/if_ar.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ar.c,v 1.23 1998/10/22 05:58:38 bde Exp $
+ * $Id: if_ar.c,v 1.21 1998/06/21 14:53:10 bde Exp $
*/
/*
@@ -178,7 +178,6 @@ static int irqtable[16] = {
struct isa_driver ardriver = {arprobe, arattach, "arc"};
-static ointhand2_t arintr;
static void ar_xmit(struct ar_softc *sc);
static void arstart(struct ifnet *ifp);
static int arioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
@@ -297,7 +296,6 @@ arattach(struct isa_device *id)
int unit;
char *iface;
- id->id_ointr = arintr;
switch(hc->interface) {
default: iface = "UNKNOWN"; break;
case AR_IFACE_EIA_232: iface = "EIA-232"; break;
@@ -357,6 +355,13 @@ arattach(struct isa_device *id)
sppp_attach((struct ifnet *)&sc->ifsppp);
if_attach(ifp);
+ /*
+ * Shortcut the sppp tls/tlf actions to up/down events
+ * since our lower layer is always ready.
+ */
+ sc->ifsppp.pp_tls = sc->ifsppp.pp_up;
+ sc->ifsppp.pp_tlf = sc->ifsppp.pp_down;
+
#if NBPFILTER > 0
bpfattach(ifp, DLT_PPP, PPP_HEADER_LEN);
#endif
@@ -373,7 +378,7 @@ arattach(struct isa_device *id)
* See if there is other interrupts pending.
* Repeat until there is no more interrupts.
*/
-static void
+void
arintr(int unit)
{
struct ar_hardc *hc = &ar_hardc[unit];
diff --git a/sys/i386/isa/if_cs.c b/sys/i386/isa/if_cs.c
index 1ddfbca1888fb..1d044deaa36d1 100644
--- a/sys/i386/isa/if_cs.c
+++ b/sys/i386/isa/if_cs.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: if_cs.c,v 1.7 1998/12/07 21:58:21 archie Exp $
+ * $Id: if_cs.c,v 1.4 1998/08/27 22:41:18 msmith Exp $
*
* Device driver for Crystal Semiconductor CS8920 based ethernet
* adapters. By Maxim Bolotin and Oleg Sharoiko, 27-April-1997
@@ -100,9 +100,7 @@ static struct cs_softc {
} cs_softc[NCS];
-#if NPNP > 0
static u_long cs_unit = NCS;
-#endif
static int cs_recv_delay = 570;
SYSCTL_INT(_machdep, OID_AUTO, cs_recv_delay, CTLFLAG_RW, &cs_recv_delay, 0, "");
@@ -110,7 +108,6 @@ SYSCTL_INT(_machdep, OID_AUTO, cs_recv_delay, CTLFLAG_RW, &cs_recv_delay, 0, "")
static int cs_attach __P((struct cs_softc *, int, int));
static int cs_attach_isa __P((struct isa_device *));
static void cs_init __P((void *));
-static ointhand2_t csintr;
static int cs_ioctl __P((struct ifnet *, u_long, caddr_t));
static int cs_probe __P((struct isa_device *));
static int cs_cs89x0_probe __P((struct cs_softc *,
@@ -192,6 +189,7 @@ get_eeprom_cksum(int off, int len, int *buffer)
static int
wait_eeprom_ready(struct cs_softc *sc)
{
+ int timeout=1000;
DELAY ( 30000 ); /* XXX should we do some checks here ? */
return 0;
}
@@ -234,6 +232,7 @@ cs_duplex_auto(struct cs_softc *sc)
static int
enable_tp(struct cs_softc *sc)
{
+ int i;
int unit = sc->arpcom.ac_if.if_unit;
cs_writereg(sc->nic_addr, PP_LineCTL, sc->line_ctl & ~AUI_ONLY);
@@ -254,6 +253,7 @@ enable_tp(struct cs_softc *sc)
static int
send_test_pkt(struct cs_softc *sc)
{
+ int unit = sc->arpcom.ac_if.if_unit;
char test_packet[] = { 0,0,0,0,0,0, 0,0,0,0,0,0,
0, 46, /* A 46 in network order */
0, 0, /* DSAP=0 & SSAP=0 fields */
@@ -342,7 +342,7 @@ cs_cs89x0_probe(struct cs_softc *sc, u_int *dev_irq,
int *dev_drq, int iobase, int unit, int flags)
{
unsigned rev_type = 0;
- int i, irq=0;
+ int i, irq=0, result;
int eeprom_buff[CHKSUM_LEN];
int chip_type, pp_isaint, pp_isadma;
char chip_revision;
@@ -633,7 +633,6 @@ cs_attach_isa(struct isa_device *dev)
struct cs_softc *sc=&cs_softc[unit];
int flags=dev->id_flags;
- dev->id_ointr = csintr;
return cs_attach(sc, unit, flags);
}
@@ -645,7 +644,7 @@ cs_init(void *xsc)
{
struct cs_softc *sc=(struct cs_softc *)xsc;
struct ifnet *ifp = &sc->arpcom.ac_if;
- int i, s, rx_cfg;
+ int i, s, result, rx_cfg;
/* address not known */
if (TAILQ_EMPTY(&ifp->if_addrhead)) /* unlikely? XXX */
@@ -815,7 +814,7 @@ static void
csintr_sc(struct cs_softc *sc, int unit)
{
struct ifnet *ifp = &(sc->arpcom.ac_if);
- int status;
+ int status, s;
#ifdef CS_DEBUG
printf(CS_NAME"%1d: Interrupt.\n", unit);
@@ -872,7 +871,7 @@ csintr_sc(struct cs_softc *sc, int unit)
/*
* Handle interrupts
*/
-static void
+void
csintr(int unit)
{
struct cs_softc *sc = &cs_softc[unit];
@@ -1305,6 +1304,7 @@ csintr_pnp_add(struct cs_softc *sc, int unit)
static void
csintr_pnp(int unit)
{
+ struct cs_softc *sc;
struct csintr_list *intr;
for (intr=csintr_head; intr; intr=intr->next) {
@@ -1350,8 +1350,8 @@ cs_pnp_attach(u_long csn, u_long vend_id, char *name,
struct pnp_cinfo d;
int ldn = 0;
int iobase, unit, flags;
- u_int irq;
- int drq;
+ u_short irq;
+ short drq;
struct isa_device *dvp;
struct cs_softc *sc = malloc(sizeof *sc, M_DEVBUF, M_NOWAIT);
@@ -1367,7 +1367,7 @@ cs_pnp_attach(u_long csn, u_long vend_id, char *name,
irq = dev->id_irq = (1 << d.irq[0] );
drq = dev->id_drq = d.drq[0];
dev->id_maddr = 0;
- dev->id_ointr = csintr_pnp;
+ dev->id_intr = csintr_pnp;
flags = dev->id_flags = 0;
unit = dev->id_unit;
diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c
index d8e5999b97d5d..ded05ec339795 100644
--- a/sys/i386/isa/if_cx.c
+++ b/sys/i386/isa/if_cx.c
@@ -62,7 +62,6 @@ static int cxattach __P((struct isa_device *id));
static void cxput __P((cx_chan_t *c, char b));
static void cxsend __P((cx_chan_t *c));
static void cxrinth __P((cx_chan_t *c));
-static ointhand2_t cxintr;
static int cxtinth __P((cx_chan_t *c));
#ifdef DEBUG
@@ -231,8 +230,6 @@ cxattach (struct isa_device *id)
int i;
struct sppp *sp;
- id->id_ointr = cxintr;
-
/* Initialize the board structure. */
cx_init (b, unit, iobase, ffs(irq)-1, drq);
@@ -284,7 +281,13 @@ cxattach (struct isa_device *id)
/* Init routine is never called by upper level? */
sppp_attach (c->ifp);
if_attach (c->ifp);
+ /*
+ * Shortcut the sppp tls/tlf actions to up/down
+ * events since our lower layer is always ready.
+ */
sp = (struct sppp*) c->ifp;
+ sp->pp_tls = sp->pp_up;
+ sp->pp_tlf = sp->pp_down;
#if NBPFILTER > 0
/* If BPF is in the kernel, call the attach for it. */
bpfattach (c->ifp, DLT_PPP, PPP_HEADER_LEN);
@@ -704,7 +707,7 @@ cxtinth (cx_chan_t *c)
return (teoir);
}
-static void
+void
cxintr (int bnum)
{
cx_board_t *b = cxboard + bnum;
diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c
index 9133a485e758d..0fed19a155267 100644
--- a/sys/i386/isa/if_ed.c
+++ b/sys/i386/isa/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.147 1998/12/13 23:00:48 eivind Exp $
+ * $Id: if_ed.c,v 1.144 1998/08/24 02:28:15 bde Exp $
*/
/*
@@ -138,7 +138,6 @@ static int ed_attach __P((struct ed_softc *, int, int));
static int ed_attach_isa __P((struct isa_device *));
static void ed_init __P((void *));
-static ointhand2_t edintr;
static int ed_ioctl __P((struct ifnet *, u_long, caddr_t));
static int ed_probe __P((struct isa_device *));
static void ed_start __P((struct ifnet *));
@@ -194,7 +193,6 @@ static u_long ds_crc __P((u_char *ep));
#endif
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -205,7 +203,17 @@ static int edinit __P((struct pccard_devinfo *));
static void edunload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(ed, edinit, edunload, card_intr, 0, net_imask);
+static struct pccard_device ed_info = {
+ "ed",
+ edinit,
+ edunload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, ed_info);
/*
* Initialize the device - called from Slot manager.
@@ -1731,7 +1739,6 @@ ed_attach_isa(isa_dev)
struct ed_softc *sc = &ed_softc[unit];
int flags = isa_dev->id_flags;
- isa_dev->id_ointr = edintr;
return ed_attach(sc, unit, flags);
}
@@ -2560,7 +2567,7 @@ edintr_sc(sc)
}
}
-static void
+void
edintr(unit)
int unit;
{
@@ -3459,7 +3466,7 @@ edpnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = edintr;
+ dev->id_intr = edintr;
dev->id_drq = -1;
if (dev->id_driver == NULL) {
diff --git a/sys/i386/isa/if_eg.c b/sys/i386/isa/if_eg.c
new file mode 100644
index 0000000000000..7f68aa6429c75
--- /dev/null
+++ b/sys/i386/isa/if_eg.c
@@ -0,0 +1,789 @@
+/*
+ * Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Dean Huxley.
+ * 4. The name of Dean Huxley may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id: if_eg.c,v 1.27 1998/03/28 13:23:56 bde Exp $
+ *
+ * Support for 3Com 3c505 Etherlink+ card.
+ */
+
+/* To do:
+ * - multicast
+ * - promiscuous
+ */
+#include "eg.h"
+#include "bpfilter.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/sockio.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+
+#if NBPFILTER > 0
+#include <net/bpf.h>
+#endif
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#include <i386/isa/if_egreg.h>
+
+/* for debugging convenience */
+#ifdef EGDEBUG
+#define dprintf(x) printf x
+#else
+#define dprintf(x)
+#endif
+
+#define EG_INLEN 10
+#define EG_BUFLEN 0x0670
+
+/*
+ * Ethernet software status per interface.
+ */
+static struct eg_softc {
+ struct arpcom sc_arpcom; /* Ethernet common part */
+ int eg_cmd; /* Command register R/W */
+ int eg_ctl; /* Control register R/W (EG_CTL_*) */
+ int eg_stat; /* Status register R/O (EG_STAT_*) */
+ int eg_data; /* Data register R/W (16 bits) */
+ u_char eg_rom_major; /* Cards ROM version (major number) */
+ u_char eg_rom_minor; /* Cards ROM version (minor number) */
+ short eg_ram; /* Amount of RAM on the card */
+ u_char eg_pcb[64]; /* Primary Command Block buffer */
+ u_char eg_incount; /* Number of buffers currently used */
+ u_char *eg_inbuf; /* Incoming packet buffer */
+ u_char *eg_outbuf; /* Outgoing packet buffer */
+} eg_softc[NEG];
+
+static int egprobe (struct isa_device *);
+static int egattach (struct isa_device *);
+
+struct isa_driver egdriver = {
+ egprobe, egattach, "eg", 0
+};
+
+static void egprintpcb __P((struct eg_softc *sc));
+static void egprintstat __P((int b));
+static int egoutPCB __P((struct eg_softc *sc, int b));
+static int egreadPCBstat __P((struct eg_softc *sc, int statb));
+static int egreadPCBready __P((struct eg_softc *sc));
+static int egwritePCB __P((struct eg_softc *sc));
+static int egreadPCB __P((struct eg_softc *sc));
+static void eginit __P((struct eg_softc *sc));
+static int egioctl (struct ifnet *, u_long, caddr_t);
+static void egrecv(struct eg_softc *);
+static void egstart(struct ifnet *);
+static void egread __P((struct eg_softc *, caddr_t, int));
+static void egstop __P((struct eg_softc *));
+
+static void egwatchdog __P((struct ifnet *));
+static void egreset __P((struct eg_softc *));
+static struct mbuf *egget __P((struct eg_softc *, caddr_t, int));
+
+/*
+ * Support stuff
+ */
+
+static void
+egprintpcb(sc)
+ struct eg_softc *sc;
+{
+ int i;
+
+ for (i = 0; i < sc->eg_pcb[1] + 2; i++)
+ dprintf(("eg#: pcb[%2d] = %x\n", i, sc->eg_pcb[i]));
+}
+
+
+static void
+egprintstat(b)
+ u_char b;
+{
+ dprintf(("eg#: %s %s %s %s %s %s %s\n",
+ (b & EG_STAT_HCRE)?"HCRE":"",
+ (b & EG_STAT_ACRF)?"ACRF":"",
+ (b & EG_STAT_DIR )?"DIR ":"",
+ (b & EG_STAT_DONE)?"DONE":"",
+ (b & EG_STAT_ASF3)?"ASF3":"",
+ (b & EG_STAT_ASF2)?"ASF2":"",
+ (b & EG_STAT_ASF1)?"ASF1":""));
+}
+
+static int
+egoutPCB(sc, b)
+ struct eg_softc *sc;
+ u_char b;
+{
+ int i;
+
+ for (i=0; i < 4000; i++) {
+ if (inb(sc->eg_stat) & EG_STAT_HCRE) {
+ outb(sc->eg_cmd, b);
+ return 0;
+ }
+ DELAY(10);
+ }
+ dprintf(("eg#: egoutPCB failed\n"));
+ return 1;
+}
+
+static int
+egreadPCBstat(sc, statb)
+ struct eg_softc *sc;
+ u_char statb;
+{
+ int i;
+
+ for (i=0; i < 5000; i++) {
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) != EG_PCB_NULL)
+ break;
+ DELAY(10);
+ }
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) == statb)
+ return 0;
+ return 1;
+}
+
+static int
+egreadPCBready(sc)
+ struct eg_softc *sc;
+{
+ int i;
+
+ for (i=0; i < 10000; i++) {
+ if (inb(sc->eg_stat) & EG_STAT_ACRF)
+ return 0;
+ DELAY(5);
+ }
+ dprintf(("eg#: PCB read not ready\n"));
+ return 1;
+}
+
+static int
+egwritePCB(sc)
+ struct eg_softc *sc;
+{
+ int i;
+ u_char len;
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_NULL);
+
+ len = sc->eg_pcb[1] + 2;
+ for (i = 0; i < len; i++)
+ egoutPCB(sc, sc->eg_pcb[i]);
+
+ for (i=0; i < 4000; i++) {
+ if (inb(sc->eg_stat) & EG_STAT_HCRE)
+ break;
+ DELAY(10);
+ }
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_DONE);
+
+ egoutPCB(sc, len);
+
+ if (egreadPCBstat(sc, EG_PCB_ACCEPT))
+ return 1;
+ return 0;
+}
+
+static int
+egreadPCB(sc)
+ struct eg_softc *sc;
+{
+ int i;
+ u_char b;
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_NULL);
+
+ bzero(sc->eg_pcb, sizeof(sc->eg_pcb));
+
+ if (egreadPCBready(sc))
+ return 1;
+
+ sc->eg_pcb[0] = inb(sc->eg_cmd);
+
+ if (egreadPCBready(sc))
+ return 1;
+
+ sc->eg_pcb[1] = inb(sc->eg_cmd);
+
+ if (sc->eg_pcb[1] > 62) {
+ dprintf(("eg#: len %d too large\n", sc->eg_pcb[1]));
+ return 1;
+ }
+
+ for (i = 0; i < sc->eg_pcb[1]; i++) {
+ if (egreadPCBready(sc))
+ return 1;
+ sc->eg_pcb[2+i] = inb(sc->eg_cmd);
+ }
+ if (egreadPCBready(sc))
+ return 1;
+ if (egreadPCBstat(sc, EG_PCB_DONE))
+ return 1;
+ if ((b = inb(sc->eg_cmd)) != sc->eg_pcb[1] + 2) {
+ dprintf(("eg#: %d != %d\n", b, sc->eg_pcb[1] + 2));
+ return 1;
+ }
+
+ outb(sc->eg_ctl, (inb(sc->eg_ctl) & ~EG_PCB_STAT) | EG_PCB_ACCEPT);
+
+ return 0;
+}
+
+/*
+ * Real stuff
+ */
+
+static int
+egprobe(struct isa_device * id)
+{
+ struct eg_softc *sc = &eg_softc[id->id_unit];
+ int i;
+
+ if (id->id_iobase & ~0x07f0 != 0) {
+ dprintf(("eg#: Weird iobase %x\n", ia->ia_iobase));
+ return 0;
+ }
+
+ sc->eg_cmd = id->id_iobase + EG_COMMAND;
+ sc->eg_ctl = id->id_iobase + EG_CONTROL;
+ sc->eg_stat = id->id_iobase + EG_STATUS;
+ sc->eg_data = id->id_iobase + EG_DATA;
+
+ /* hard reset card */
+ outb(sc->eg_ctl, EG_CTL_RESET);
+ outb(sc->eg_ctl, 0);
+ for (i = 0; i < 1600; i++) {
+ DELAY(10000);
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) == EG_PCB_NULL)
+ break;
+ }
+ if ((inb(sc->eg_stat) & EG_PCB_STAT) != EG_PCB_NULL) {
+ dprintf(("eg#: eg: Reset failed\n"));
+ return 0;
+ }
+ sc->eg_pcb[0] = EG_CMD_GETINFO; /* Get Adapter Info */
+ sc->eg_pcb[1] = 0;
+ if (egwritePCB(sc) != 0)
+ return 0;
+
+ if (egreadPCB(sc) != 0) {
+ egprintpcb(sc);
+ return 0;
+ }
+
+ if (sc->eg_pcb[0] != EG_RSP_GETINFO || /* Get Adapter Info Response */
+ sc->eg_pcb[1] != 0x0a) {
+ egprintpcb(sc);
+ return 0;
+ }
+ sc->eg_rom_major = sc->eg_pcb[3];
+ sc->eg_rom_minor = sc->eg_pcb[2];
+ sc->eg_ram = sc->eg_pcb[6] | (sc->eg_pcb[7] << 8);
+
+ return 8;
+}
+
+static int
+egattach(struct isa_device *id)
+{
+ struct eg_softc *sc = &eg_softc[id->id_unit];
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ egstop(sc);
+
+ sc->eg_pcb[0] = EG_CMD_GETEADDR; /* Get Station address */
+ sc->eg_pcb[1] = 0;
+ if (egwritePCB(sc) != 0) {
+ dprintf(("eg#: write error\n"));
+ return 0;
+ }
+ if (egreadPCB(sc) != 0) {
+ dprintf(("eg#: read error\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+
+ /* check Get station address response */
+ if (sc->eg_pcb[0] != EG_RSP_GETEADDR || sc->eg_pcb[1] != 0x06) {
+ dprintf(("eg#: parse error\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+ bcopy(&sc->eg_pcb[2], sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN);
+
+ printf("eg%d: address %6D, type=3COM 3c505 (v%d.%02d, %dk)\n",
+ id->id_unit, sc->sc_arpcom.ac_enaddr, ":",
+ sc->eg_rom_major, sc->eg_rom_minor, sc->eg_ram);
+
+ sc->eg_pcb[0] = EG_CMD_SETEADDR; /* Set station address */
+ if (egwritePCB(sc) != 0) {
+ dprintf(("eg#: write error2\n"));
+ return 0;
+ }
+ if (egreadPCB(sc) != 0) {
+ dprintf(("eg#: read error2\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+ if (sc->eg_pcb[0] != EG_RSP_SETEADDR || sc->eg_pcb[1] != 0x02 ||
+ sc->eg_pcb[2] != 0 || sc->eg_pcb[3] != 0) {
+ dprintf(("eg#: parse error2\n"));
+ egprintpcb(sc);
+ return 0;
+ }
+
+ /* Initialize ifnet structure. */
+ ifp->if_softc = sc;
+ ifp->if_unit = id->id_unit;
+ ifp->if_name = "eg";
+ ifp->if_output = ether_output;
+ ifp->if_start = egstart;
+ ifp->if_ioctl = egioctl;
+ ifp->if_init = (if_init_f_t*)eginit;
+ ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
+ ifp->if_watchdog = egwatchdog;
+
+ /* Now we can attach the interface. */
+ if_attach(ifp);
+ ether_ifattach(ifp);
+
+#if NBPFILTER > 0
+ bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
+#endif
+
+ return 1;
+}
+
+static void
+eginit(struct eg_softc *sc)
+{
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ /* soft reset the board */
+ outb(sc->eg_ctl, EG_CTL_FLSH);
+ DELAY(100);
+ outb(sc->eg_ctl, EG_CTL_ATTN);
+ DELAY(100);
+ outb(sc->eg_ctl, 0);
+ DELAY(200);
+
+ sc->eg_pcb[0] = EG_CMD_CONFIG82586; /* Configure 82586 */
+ sc->eg_pcb[1] = 2;
+ sc->eg_pcb[2] = 3; /* receive broadcast & multicast */
+ sc->eg_pcb[3] = 0;
+#ifdef EGDEBUG
+ if (egwritePCB(sc) != 0)
+ dprintf(("eg#: write error3\n"));
+#endif
+
+ if (egreadPCB(sc) != 0) {
+ dprintf(("eg#: read error\n"));
+ egprintpcb(sc);
+ } else if (sc->eg_pcb[2] != 0 || sc->eg_pcb[3] != 0)
+ printf("eg%d: configure card command failed\n", ifp->if_unit);
+
+ if (sc->eg_inbuf == NULL)
+ sc->eg_inbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT);
+ sc->eg_incount = 0;
+
+ if (sc->eg_outbuf == NULL)
+ sc->eg_outbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT);
+
+ outb(sc->eg_ctl, EG_CTL_CMDE);
+
+ sc->eg_incount = 0;
+ egrecv(sc);
+
+ /* Interface is now `running', with no output active. */
+ ifp->if_flags |= IFF_RUNNING;
+ ifp->if_flags &= ~IFF_OACTIVE;
+
+ /* Attempt to start output, if any. */
+ egstart(ifp);
+}
+
+static void
+egrecv(sc)
+ struct eg_softc *sc;
+{
+
+ while (sc->eg_incount < EG_INLEN) {
+ sc->eg_pcb[0] = EG_CMD_RECVPACKET;
+ sc->eg_pcb[1] = 0x08;
+ sc->eg_pcb[2] = 0; /* address not used.. we send zero */
+ sc->eg_pcb[3] = 0;
+ sc->eg_pcb[4] = 0;
+ sc->eg_pcb[5] = 0;
+ sc->eg_pcb[6] = EG_BUFLEN & 0xff; /* our buffer size */
+ sc->eg_pcb[7] = (EG_BUFLEN >> 8) & 0xff;
+ sc->eg_pcb[8] = 0; /* timeout, 0 == none */
+ sc->eg_pcb[9] = 0;
+ if (egwritePCB(sc) != 0)
+ break;
+ sc->eg_incount++;
+ }
+}
+
+static void
+egstart(ifp)
+ struct ifnet *ifp;
+{
+ register struct eg_softc *sc = ifp->if_softc;
+ struct mbuf *m0, *m;
+ caddr_t buffer;
+ int len;
+ u_short *ptr;
+
+ /* Don't transmit if interface is busy or not running */
+ if ((ifp->if_flags & (IFF_RUNNING|IFF_OACTIVE)) != IFF_RUNNING)
+ return;
+
+loop:
+ /* Dequeue the next datagram. */
+ IF_DEQUEUE(&ifp->if_snd, m0);
+ if (m0 == 0)
+ return;
+
+ ifp->if_flags |= IFF_OACTIVE;
+
+ /* We need to use m->m_pkthdr.len, so require the header */
+ if ((m0->m_flags & M_PKTHDR) == 0)
+ panic("egstart: no header mbuf");
+ len = max(m0->m_pkthdr.len, ETHER_MIN_LEN);
+
+#if NBPFILTER > 0
+ if (ifp->if_bpf)
+ bpf_mtap(ifp, m0);
+#endif
+
+ sc->eg_pcb[0] = EG_CMD_SENDPACKET;
+ sc->eg_pcb[1] = 0x06;
+ sc->eg_pcb[2] = 0; /* address not used, we send zero */
+ sc->eg_pcb[3] = 0;
+ sc->eg_pcb[4] = 0;
+ sc->eg_pcb[5] = 0;
+ sc->eg_pcb[6] = len; /* length of packet */
+ sc->eg_pcb[7] = len >> 8;
+ if (egwritePCB(sc) != 0) {
+ dprintf(("eg#: egwritePCB in egstart failed\n"));
+ ifp->if_oerrors++;
+ ifp->if_flags &= ~IFF_OACTIVE;
+ goto loop;
+ }
+
+ buffer = sc->eg_outbuf;
+ for (m = m0; m != 0; m = m->m_next) {
+ bcopy(mtod(m, caddr_t), buffer, m->m_len);
+ buffer += m->m_len;
+ }
+
+ /* set direction bit: host -> adapter */
+ outb(sc->eg_ctl, inb(sc->eg_ctl) & ~EG_CTL_DIR);
+
+ for (ptr = (u_short *) sc->eg_outbuf; len > 0; len -= 2) {
+ outw(sc->eg_data, *ptr++);
+ while (!(inb(sc->eg_stat) & EG_STAT_HRDY))
+ ; /* XXX need timeout here */
+ }
+
+ m_freem(m0);
+}
+
+void
+egintr(int unit)
+{
+ register struct eg_softc *sc = &eg_softc[unit];
+ int i, len;
+ u_short *ptr;
+
+ while (inb(sc->eg_stat) & EG_STAT_ACRF) {
+ egreadPCB(sc);
+ switch (sc->eg_pcb[0]) {
+ case EG_RSP_RECVPACKET:
+ len = sc->eg_pcb[6] | (sc->eg_pcb[7] << 8);
+
+ /* Set direction bit : Adapter -> host */
+ outb(sc->eg_ctl, inb(sc->eg_ctl) | EG_CTL_DIR);
+
+ for (ptr = (u_short *) sc->eg_inbuf; len > 0; len -= 2) {
+ while (!(inb(sc->eg_stat) & EG_STAT_HRDY))
+ ;
+ *ptr++ = inw(sc->eg_data);
+ }
+
+ len = sc->eg_pcb[8] | (sc->eg_pcb[9] << 8);
+ egread(sc, sc->eg_inbuf, len);
+
+ sc->eg_incount--;
+ egrecv(sc);
+ break;
+
+ case EG_RSP_SENDPACKET:
+ if (sc->eg_pcb[6] || sc->eg_pcb[7]) {
+ dprintf(("eg#: packet dropped\n"));
+ sc->sc_arpcom.ac_if.if_oerrors++;
+ } else
+ sc->sc_arpcom.ac_if.if_opackets++;
+ sc->sc_arpcom.ac_if.if_collisions += sc->eg_pcb[8] & 0xf;
+ sc->sc_arpcom.ac_if.if_flags &= ~IFF_OACTIVE;
+ egstart(&sc->sc_arpcom.ac_if);
+ break;
+
+ case EG_RSP_GETSTATS:
+ dprintf(("eg#: Card Statistics\n"));
+ bcopy(&sc->eg_pcb[2], &i, sizeof(i));
+ dprintf(("eg#: Receive Packets %d\n", i));
+ bcopy(&sc->eg_pcb[6], &i, sizeof(i));
+ dprintf(("eg#: Transmit Packets %d\n", i));
+ dprintf(("eg#: CRC errors %d\n", *(short*) &sc->eg_pcb[10]));
+ dprintf(("eg#: alignment errors %d\n", *(short*) &sc->eg_pcb[12]));
+ dprintf(("eg#: no resources errors %d\n", *(short*) &sc->eg_pcb[14]));
+ dprintf(("eg#: overrun errors %d\n", *(short*) &sc->eg_pcb[16]));
+ break;
+
+ default:
+ dprintf(("eg#: egintr: Unknown response %x??\n",
+ sc->eg_pcb[0]));
+ egprintpcb(sc);
+ break;
+ }
+ }
+
+ return;
+}
+
+/*
+ * Pass a packet up to the higher levels.
+ */
+static void
+egread(sc, buf, len)
+ struct eg_softc *sc;
+ caddr_t buf;
+ int len;
+{
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf *m;
+ struct ether_header *eh;
+
+ if (len <= sizeof(struct ether_header) ||
+ len > ETHER_MAX_LEN) {
+ printf("eg#: invalid packet size %d; dropping\n", len);
+ ifp->if_ierrors++;
+ return;
+ }
+
+ /* Pull packet off interface. */
+ m = egget(sc, buf, len);
+ if (m == 0) {
+ ifp->if_ierrors++;
+ return;
+ }
+
+ ifp->if_ipackets++;
+
+ /* We assume the header fit entirely in one mbuf. */
+ eh = mtod(m, struct ether_header *);
+
+#if NBPFILTER > 0
+ /*
+ * Check if there's a BPF listener on this interface.
+ * If so, hand off the raw packet to BPF.
+ */
+ if (ifp->if_bpf) {
+ bpf_mtap(ifp, m);
+
+ /*
+ * Note that the interface cannot be in promiscuous mode if
+ * there are no BPF listeners. And if we are in promiscuous
+ * mode, we have to check if this packet is really ours.
+ */
+ if ((ifp->if_flags & IFF_PROMISC) &&
+ (eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
+ bcmp(eh->ether_dhost, sc->sc_arpcom.ac_enaddr,
+ sizeof(eh->ether_dhost)) != 0) {
+ m_freem(m);
+ return;
+ }
+ }
+#endif
+
+ /* We assume the header fit entirely in one mbuf. */
+ m_adj(m, sizeof(struct ether_header));
+ ether_input(ifp, eh, m);
+}
+
+/*
+ * convert buf into mbufs
+ */
+static struct mbuf *
+egget(sc, buf, totlen)
+ struct eg_softc *sc;
+ caddr_t buf;
+ int totlen;
+{
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf *top, **mp, *m;
+ int len;
+
+ MGETHDR(m, M_DONTWAIT, MT_DATA);
+ if (m == 0)
+ return 0;
+ m->m_pkthdr.rcvif = ifp;
+ m->m_pkthdr.len = totlen;
+ len = MHLEN;
+ top = 0;
+ mp = &top;
+
+ while (totlen > 0) {
+ if (top) {
+ MGET(m, M_DONTWAIT, MT_DATA);
+ if (m == 0) {
+ m_freem(top);
+ return 0;
+ }
+ len = MLEN;
+ }
+ if (totlen >= MINCLSIZE) {
+ MCLGET(m, M_DONTWAIT);
+ if (m->m_flags & M_EXT)
+ len = MCLBYTES;
+ }
+ m->m_len = len = min(totlen, len);
+ bcopy((caddr_t)buf, mtod(m, caddr_t), len);
+ buf += len;
+ totlen -= len;
+ *mp = m;
+ mp = &m->m_next;
+ }
+
+ return top;
+}
+
+static int
+egioctl(ifp, command, data)
+ register struct ifnet *ifp;
+ u_long command;
+ caddr_t data;
+{
+ struct eg_softc *sc = ifp->if_softc;
+ int s, error = 0;
+
+ s = splnet();
+
+ switch (command) {
+
+ case SIOCSIFADDR:
+ case SIOCGIFADDR:
+ case SIOCSIFMTU:
+ error = ether_ioctl(ifp, command, data);
+ break;
+
+ case SIOCSIFFLAGS:
+ if ((ifp->if_flags & IFF_UP) == 0 &&
+ (ifp->if_flags & IFF_RUNNING) != 0) {
+ /*
+ * If interface is marked down and it is running, then
+ * stop it.
+ */
+ egstop(sc);
+ ifp->if_flags &= ~IFF_RUNNING;
+ } else if ((ifp->if_flags & IFF_UP) != 0 &&
+ (ifp->if_flags & IFF_RUNNING) == 0) {
+ /*
+ * If interface is marked up and it is stopped, then
+ * start it.
+ */
+ eginit(sc);
+ } else {
+ sc->eg_pcb[0] = EG_CMD_GETSTATS;
+ sc->eg_pcb[1] = 0;
+#ifdef EGDEBUG
+ if (egwritePCB(sc) != 0)
+ dprintf(("eg#: write error\n"));
+#endif
+ /*
+ * XXX deal with flags changes:
+ * IFF_MULTICAST, IFF_PROMISC,
+ * IFF_LINK0, IFF_LINK1,
+ */
+ }
+ break;
+
+ default:
+ error = EINVAL;
+ break;
+ }
+
+ splx(s);
+ return error;
+}
+
+static void
+egreset(sc)
+ struct eg_softc *sc;
+{
+ int s;
+
+ dprintf(("eg#: egreset()\n"));
+ s = splnet();
+ egstop(sc);
+ eginit(sc);
+ splx(s);
+}
+
+static void
+egwatchdog(ifp)
+ struct ifnet *ifp;
+{
+ struct eg_softc *sc = ifp->if_softc;
+
+ log(LOG_ERR, "%s: device timeout\n", "eg#");
+ sc->sc_arpcom.ac_if.if_oerrors++;
+
+ egreset(sc);
+}
+
+static void
+egstop(sc)
+ register struct eg_softc *sc;
+{
+
+ outb(sc->eg_ctl, 0);
+}
diff --git a/sys/i386/isa/if_egreg.h b/sys/i386/isa/if_egreg.h
new file mode 100644
index 0000000000000..9067a58383d94
--- /dev/null
+++ b/sys/i386/isa/if_egreg.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 1993 Dean Huxley (dean@fsa.ca)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Dean Huxley.
+ * 4. The name of Dean Huxley may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Register offsets from base.
+ */
+#define EG_COMMAND 0x00
+#define EG_STATUS 0x02
+#define EG_DATA 0x04
+#define EG_CONTROL 0x06
+
+/*
+ * Host Control Register bits
+ * EG_CTL_ATTN - does a soft reset
+ * EG_CTL_FLSH - flushes the data register
+ * EG_CTL_RESET - does a hard reset
+ * EG_CTL_DMAE - Used with DIR bit, enables DMA transfers to/from data reg.
+ * EG_CTL_DIR - if clear then host -> adapter, if set then adapter -> host
+ * EG_CTL_TCEN - terminal count enable. enables host interrupt after DMA.
+ * EG_CTL_CMDE - command reg interrupt enable. (when it is written)
+ * EG_CTL_HSF1 - Host status flag 1
+ * EG_CTL_HSF2 - Host status flag 2
+ */
+
+#define EG_CTL_ATTN 0x80
+#define EG_CTL_FLSH 0x40
+#define EG_CTL_RESET (EG_CTL_ATTN|EG_CTL_FLSH)
+#define EG_CTL_DMAE 0x20
+#define EG_CTL_DIR 0x10
+#define EG_CTL_TCEN 0x08
+#define EG_CTL_CMDE 0x04
+#define EG_CTL_HSF2 0x02
+#define EG_CTL_HSF1 0x01
+
+/*
+ * Host Status Register bits
+ * EG_STAT_HRDY - Data Register ready
+ * EG_STAT_HCRE - Host Command Register empty
+ * EG_STAT_ACRF - Adapter Command register full
+ * EG_STAT_DIR - Direction flag, 0 = host -> adapter, 1 = adapter -> host
+ * EG_STAT_DONE - DMA done
+ * EG_STAT_ASF1 - Adapter status flag 1
+ * EG_STAT_ASF2 - Adapter status flag 2
+ * EG_STAT_ASF3 - Adapter status flag 3
+ */
+
+#define EG_STAT_HRDY 0x80
+#define EG_STAT_HCRE 0x40
+#define EG_STAT_ACRF 0x20
+#define EG_STAT_DIR 0x10
+#define EG_STAT_DONE 0x08
+#define EG_STAT_ASF3 0x04
+#define EG_STAT_ASF2 0x02
+#define EG_STAT_ASF1 0x01
+
+#define EG_PCB_NULL 0x00
+#define EG_PCB_ACCEPT 0x01
+#define EG_PCB_REJECT 0x02
+#define EG_PCB_DONE 0x03
+#define EG_PCB_STAT 0x03
+
+#define EG_CMD_CONFIG82586 0x02
+#define EG_CMD_GETEADDR 0x03
+#define EG_CMD_RECVPACKET 0x08
+#define EG_CMD_SENDPACKET 0x09
+#define EG_CMD_GETSTATS 0x0a
+#define EG_CMD_SETEADDR 0x10
+#define EG_CMD_GETINFO 0x11
+
+#define EG_RSP_CONFIG82586 0x32
+#define EG_RSP_GETEADDR 0x33
+#define EG_RSP_RECVPACKET 0x38
+#define EG_RSP_SENDPACKET 0x39
+#define EG_RSP_GETSTATS 0x3a
+#define EG_RSP_SETEADDR 0x40
+#define EG_RSP_GETINFO 0x41
diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c
index f8aad8e4d020f..6a3c32d1b83bd 100644
--- a/sys/i386/isa/if_el.c
+++ b/sys/i386/isa/if_el.c
@@ -6,7 +6,7 @@
*
* Questions, comments, bug reports and fixes to kimmel@cs.umass.edu.
*
- * $Id: if_el.c,v 1.39 1998/12/07 21:58:21 archie Exp $
+ * $Id: if_el.c,v 1.36 1998/06/07 17:10:28 dfr Exp $
*/
/* Except of course for the portions of code lifted from other FreeBSD
* drivers (mainly elread, elget and el_ioctl)
@@ -82,7 +82,6 @@ static void el_watchdog(struct ifnet *);
static void el_stop(int);
static int el_xmit(struct el_softc *,int);
-static ointhand2_t elintr;
static __inline void elread(struct el_softc *,caddr_t,int);
static struct mbuf *elget(caddr_t,int,int,struct ifnet *);
static __inline void el_hardreset(int);
@@ -146,29 +145,6 @@ el_probe(struct isa_device *idev)
}
}
-/* Do a hardware reset of the 3c501. Do not call until after el_probe()! */
-static __inline void
-el_hardreset(int unit)
-{
- register struct el_softc *sc;
- register int base;
- register int j;
-
- sc = &el_softc[unit];
- base = sc->el_base;
-
- /* First reset the board */
- outb(base+EL_AC,EL_AC_RESET);
- DELAY(5);
- outb(base+EL_AC,0);
-
- /* Then give it back its ethernet address. Thanks to the mach
- * source code for this undocumented goodie...
- */
- for(j=0;j<ETHER_ADDR_LEN;j++)
- outb(base+j,sc->arpcom.ac_enaddr[j]);
-}
-
/* Attach the interface to the kernel data structures. By the time
* this is called, we know that the card exists at the given I/O address.
* We still assume that the IRQ given is correct.
@@ -178,12 +154,13 @@ el_attach(struct isa_device *idev)
{
struct el_softc *sc;
struct ifnet *ifp;
+ struct ifaddr *ifa;
+ struct sockaddr_dl *sdl;
u_short base;
dprintf(("Attaching el%d...\n",idev->id_unit));
/* Get things pointing to the right places. */
- idev->id_ointr = elintr;
sc = &el_softc[idev->id_unit];
ifp = &sc->arpcom.ac_if;
base = sc->el_base;
@@ -243,6 +220,28 @@ static void el_stop(int unit)
outb(sc->el_base+EL_AC,0);
}
+/* Do a hardware reset of the 3c501. Do not call until after el_probe()! */
+static __inline void el_hardreset(int unit)
+{
+ register struct el_softc *sc;
+ register int base;
+ register int j;
+
+ sc = &el_softc[unit];
+ base = sc->el_base;
+
+ /* First reset the board */
+ outb(base+EL_AC,EL_AC_RESET);
+ DELAY(5);
+ outb(base+EL_AC,0);
+
+ /* Then give it back its ethernet address. Thanks to the mach
+ * source code for this undocumented goodie...
+ */
+ for(j=0;j<ETHER_ADDR_LEN;j++)
+ outb(base+j,sc->arpcom.ac_enaddr[j]);
+}
+
/* Initialize interface. */
static void
el_init(int unit)
@@ -406,8 +405,7 @@ el_start(struct ifnet *ifp)
* to the board. Call at splimp or interrupt, after downloading data!
* Returns 0 on success, non-0 on failure
*/
-static int
-el_xmit(struct el_softc *sc,int len)
+static int el_xmit(struct el_softc *sc,int len)
{
int gpl;
int i;
@@ -429,53 +427,8 @@ el_xmit(struct el_softc *sc,int len)
return(0);
}
-/* Pass a packet up to the higher levels. */
-static __inline void
-elread(struct el_softc *sc,caddr_t buf,int len)
-{
- register struct ether_header *eh;
- struct mbuf *m;
-
- eh = (struct ether_header *)buf;
-
-#if NBPFILTER > 0
- /*
- * Check if there's a bpf filter listening on this interface.
- * If so, hand off the raw packet to bpf.
- */
- if(sc->arpcom.ac_if.if_bpf) {
- bpf_tap(&sc->arpcom.ac_if, buf,
- len + sizeof(struct ether_header));
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no bpf listeners. And if el are in promiscuous
- * mode, el have to check if this packet is really ours.
- *
- * This test does not support multicasts.
- */
- if((sc->arpcom.ac_if.if_flags & IFF_PROMISC)
- && bcmp(eh->ether_dhost,sc->arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0
- && bcmp(eh->ether_dhost,etherbroadcastaddr,
- sizeof(eh->ether_dhost)) != 0)
- return;
- }
-#endif
-
- /*
- * Pull packet off interface.
- */
- m = elget(buf,len,0,&sc->arpcom.ac_if);
- if(m == 0)
- return;
-
- ether_input(&sc->arpcom.ac_if,eh,m);
-}
-
/* controller interrupt */
-static void
-elintr(int unit)
+void elintr(int unit)
{
register struct el_softc *sc;
register int base;
@@ -570,6 +523,49 @@ elintr(int unit)
return;
}
+/* Pass a packet up to the higher levels. */
+static __inline void elread(struct el_softc *sc,caddr_t buf,int len)
+{
+ register struct ether_header *eh;
+ struct mbuf *m;
+
+ eh = (struct ether_header *)buf;
+
+#if NBPFILTER > 0
+ /*
+ * Check if there's a bpf filter listening on this interface.
+ * If so, hand off the raw packet to bpf.
+ */
+ if(sc->arpcom.ac_if.if_bpf) {
+ bpf_tap(&sc->arpcom.ac_if, buf,
+ len + sizeof(struct ether_header));
+
+ /*
+ * Note that the interface cannot be in promiscuous mode if
+ * there are no bpf listeners. And if el are in promiscuous
+ * mode, el have to check if this packet is really ours.
+ *
+ * This test does not support multicasts.
+ */
+ if((sc->arpcom.ac_if.if_flags & IFF_PROMISC)
+ && bcmp(eh->ether_dhost,sc->arpcom.ac_enaddr,
+ sizeof(eh->ether_dhost)) != 0
+ && bcmp(eh->ether_dhost,etherbroadcastaddr,
+ sizeof(eh->ether_dhost)) != 0)
+ return;
+ }
+#endif
+
+ /*
+ * Pull packet off interface.
+ */
+ m = elget(buf,len,0,&sc->arpcom.ac_if);
+ if(m == 0)
+ return;
+
+ ether_input(&sc->arpcom.ac_if,eh,m);
+}
+
/*
* Pull read data off a interface.
* Len is length of data, with local net header stripped.
diff --git a/sys/i386/isa/if_ep.c b/sys/i386/isa/if_ep.c
index e325ada5b316c..80b8db4c3ca23 100644
--- a/sys/i386/isa/if_ep.c
+++ b/sys/i386/isa/if_ep.c
@@ -38,7 +38,7 @@
*/
/*
- * $Id: if_ep.c,v 1.77 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_ep.c,v 1.75 1998/06/07 17:10:28 dfr Exp $
*
* Promiscuous mode added and interrupt logic slightly changed
* to reduce the number of adapter failures. Transceiver select
@@ -118,7 +118,6 @@ static int ep_isa_attach __P((struct isa_device *));
static int epioctl __P((struct ifnet * ifp, u_long, caddr_t));
static void epinit __P((struct ep_softc *));
-static ointhand2_t epintr;
static void epread __P((struct ep_softc *));
void epreset __P((int));
static void epstart __P((struct ifnet *));
@@ -149,7 +148,6 @@ struct isa_driver epdriver = {
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -161,7 +159,16 @@ static int ep_pccard_attach __P((struct pccard_devinfo *));
static void ep_unload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(ep, ep_pccard_init, ep_unload, card_intr, 0, net_imask);
+static struct pccard_device ep_info = {
+ "ep",
+ ep_pccard_init,
+ ep_unload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask
+};
+
+DATA_SET(pccarddrv_set, ep_info);
/*
* Initialize the device - called from Slot manager.
@@ -531,7 +538,6 @@ ep_isa_attach(is)
u_short config;
int irq;
- is->id_ointr = epintr;
sc->ep_connectors = 0;
config = inw(IS_BASE + EP_W0_CONFIG_CTRL);
if (config & IS_AUI) {
@@ -894,7 +900,7 @@ readcheck:
goto startagain;
}
-static void
+void
epintr(unit)
int unit;
{
diff --git a/sys/i386/isa/if_ex.c b/sys/i386/isa/if_ex.c
index 2508bd735e225..f64ef74269b49 100644
--- a/sys/i386/isa/if_ex.c
+++ b/sys/i386/isa/if_ex.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ex.c,v 1.12 1998/06/07 17:10:30 dfr Exp $
+ * $Id: if_ex.c,v 1.11 1998/03/28 13:24:06 bde Exp $
*/
/*
@@ -119,7 +119,6 @@ static int ex_attach __P((struct isa_device *));
static void ex_init __P((void *));
static void ex_start __P((struct ifnet *));
static void ex_stop __P((int));
-static ointhand2_t exintr;
static int ex_ioctl __P((struct ifnet *, u_long, caddr_t));
static void ex_reset __P((int));
static void ex_watchdog __P((struct ifnet *));
@@ -255,8 +254,6 @@ int ex_attach(struct isa_device *dev)
DODEBUG(Start_End, printf("ex_attach%d: start\n", unit););
- dev->id_ointr = exintr;
-
/*
* Initialize the ifnet structure.
*/
@@ -568,7 +565,7 @@ void ex_stop(int unit)
}
-static void exintr(int unit)
+void exintr(int unit)
{
struct ex_softc *sc = &ex_sc[unit];
struct ifnet *ifp = &sc->arpcom.ac_if;
diff --git a/sys/i386/isa/if_fe.c b/sys/i386/isa/if_fe.c
index 94e4bef130944..85e948d88d207 100644
--- a/sys/i386/isa/if_fe.c
+++ b/sys/i386/isa/if_fe.c
@@ -21,10 +21,10 @@
*/
/*
- * $Id: if_fe.c,v 1.47 1999/01/12 00:36:29 eivind Exp $
+ * $Id: if_fe.c,v 1.41 1998/06/07 17:10:31 dfr Exp $
*
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
- * To be used with FreeBSD 3.x
+ * To be used with FreeBSD 2.x
* Contributed by M. Sekiguchi. <seki@sysrap.cs.fujitsu.co.jp>
*
* This version is intended to be a generic template for various
@@ -36,13 +36,12 @@
* other types of Ethernet cards, but the author is not sure whether
* they are useful.
*
- * This version also includes some alignments to support RE1000,
- * C-NET(98)P2 and so on. These cards are not for AT-compatibles,
- * but for NEC PC-98 bus -- a proprietary bus architecture available
- * only in Japan. Confusingly, it is different from the Microsoft's
- * PC98 architecture. :-{
- * Further work for PC-98 version will be available as a part of
- * FreeBSD(98) project.
+ * This version also includes some alignments for
+ * RE1000/RE1000+/ME1500 support. It is incomplete, however, since the
+ * cards are not for AT-compatibles. (They are for PC98 bus -- a
+ * proprietary bus architecture available only in Japan.) Further
+ * work for PC98 version will be available as a part of FreeBSD(98)
+ * project.
*
* This software is a derivative work of if_ed.c version 1.56 by David
* Greenman available as a part of FreeBSD 2.0 RELEASE source distribution.
@@ -59,14 +58,16 @@
/*
* TODO:
+ * o To support MBH10304 PC card. It is another MB8696x based
+ * PCMCIA Ethernet card by Fujitsu, which is not compatible with
+ * MBH10302.
+ * o To merge FreeBSD(98) efforts into a single source file.
* o To support ISA PnP auto configuration for FMV-183/184.
* o To reconsider mbuf usage.
* o To reconsider transmission buffer usage, including
* transmission buffer size (currently 4KB x 2) and pros-and-
* cons of multiple frame transmission.
* o To test IPX codes.
- * o To test FreeBSD3.0-current.
- * o To test BRIDGE codes.
*/
#include "fe.h"
@@ -79,12 +80,10 @@
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
+#include <sys/syslog.h>
#include <net/if.h>
#include <net/if_dl.h>
-#include <net/if_mib.h>
-#include <net/if_media.h>
-#include <net/if_types.h>
#ifdef INET
#include <netinet/in.h>
@@ -113,10 +112,6 @@
#include <net/bpf.h>
#endif
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include <machine/clock.h>
#include <i386/isa/isa_device.h>
@@ -127,7 +122,6 @@
#if NCARD > 0
#include <sys/kernel.h>
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -136,31 +130,36 @@
#include <i386/isa/if_fereg.h>
/*
- * Default settings for fe driver specific options.
- * They can be set in config file by "options" statements.
+ * This version of fe is an ISA device driver.
+ * Override the following macro to adapt it to another bus.
+ * (E.g., PC98.)
*/
+#define DEVICE struct isa_device
/*
- * Transmit just one packet per a "send" command to 86960.
- * This option is intended for performance test. An EXPERIMENTAL option.
+ * Default settings for fe driver specific options.
+ * They can be set in config file by "options" statements.
*/
-#ifndef FE_SINGLE_TRANSMISSION
-#define FE_SINGLE_TRANSMISSION 0
-#endif
/*
- * Maximum loops when interrupt.
- * This option prevents an infinite loop due to hardware failure.
- * (Some laptops make an infinite loop after PC-Card is ejected.)
+ * Debug control.
+ * 0: No debug at all. All debug specific codes are stripped off.
+ * 1: Silent. No debug messages are logged except emergent ones.
+ * 2: Brief. Lair events and/or important information are logged.
+ * 3: Detailed. Logs all information which *may* be useful for debugging.
+ * 4: Trace. All actions in the driver is logged. Super verbose.
*/
-#ifndef FE_MAX_LOOP
-#define FE_MAX_LOOP 0x800
+#ifndef FE_DEBUG
+#define FE_DEBUG 1
#endif
/*
- * If you define this option, 8-bit cards are also supported.
+ * Transmit just one packet per a "send" command to 86960.
+ * This option is intended for performance test. An EXPERIMENTAL option.
*/
-/*#define FE_8BIT_SUPPORT*/
+#ifndef FE_SINGLE_TRANSMISSION
+#define FE_SINGLE_TRANSMISSION 0
+#endif
/*
* Device configuration flags.
@@ -201,43 +200,32 @@ static struct fe_softc {
/* Used by config codes. */
/* Set by probe() and not modified in later phases. */
- char const * typestr; /* printable name of the interface. */
+ char * typestr; /* printable name of the interface. */
u_short iobase; /* base I/O address of the adapter. */
- u_short ioaddr [ MAXREGISTERS ]; /* I/O addresses of registers. */
+ u_short ioaddr [ MAXREGISTERS ]; /* I/O addresses of register. */
u_short txb_size; /* size of TX buffer, in bytes */
u_char proto_dlcr4; /* DLCR4 prototype. */
u_char proto_dlcr5; /* DLCR5 prototype. */
u_char proto_dlcr6; /* DLCR6 prototype. */
u_char proto_dlcr7; /* DLCR7 prototype. */
u_char proto_bmpr13; /* BMPR13 prototype. */
- u_char stability; /* How stable is this? */
- u_short priv_info; /* info specific to a vendor/model. */
- /* Vendor/model specific hooks. */
- void (*init)(struct fe_softc *); /* Just before fe_init(). */
- void (*stop)(struct fe_softc *); /* Just after fe_stop(). */
+ /* Vendor specific hooks. */
+ void ( * init )( struct fe_softc * ); /* Just before fe_init(). */
+ void ( * stop )( struct fe_softc * ); /* Just after fe_stop(). */
/* Transmission buffer management. */
u_short txb_free; /* free bytes in TX buffer */
u_char txb_count; /* number of packets in TX buffer */
u_char txb_sched; /* number of scheduled packets */
- /* Excessive collision counter (see fe_tint() for details.) */
+ /* Excessive collision counter (see fe_tint() for details. */
u_char tx_excolls; /* # of excessive collisions. */
/* Multicast address filter management. */
u_char filter_change; /* MARs must be changed ASAP. */
struct fe_filter filter;/* new filter value. */
- /* Network management. */
- struct ifmib_iso_8802_3 mibdata;
-
- /* Media information. */
- struct ifmedia media; /* used by if_media. */
- u_short mbitmap; /* bitmap for supported media; see bit2media */
- int defmedia; /* default media */
- void (* msel)(struct fe_softc *); /* media selector. */
-
} fe_softc[NFE];
#define sc_if arpcom.ac_if
@@ -247,40 +235,36 @@ static struct fe_softc {
/* Standard driver entry points. These can be static. */
static int fe_probe ( struct isa_device * );
static int fe_attach ( struct isa_device * );
-static void fe_init ( void * );
-static ointhand2_t feintr;
+static void fe_init ( int );
static int fe_ioctl ( struct ifnet *, u_long, caddr_t );
static void fe_start ( struct ifnet * );
+static void fe_reset ( int );
static void fe_watchdog ( struct ifnet * );
-static int fe_medchange ( struct ifnet * );
-static void fe_medstat ( struct ifnet *, struct ifmediareq * );
/* Local functions. Order of declaration is confused. FIXME. */
-static int fe_probe_ssi ( struct isa_device *, struct fe_softc * );
-static int fe_probe_jli ( struct isa_device *, struct fe_softc * );
-static int fe_probe_fmv ( struct isa_device *, struct fe_softc * );
-static int fe_probe_lnx ( struct isa_device *, struct fe_softc * );
-static int fe_probe_gwy ( struct isa_device *, struct fe_softc * );
-static int fe_probe_ubn ( struct isa_device *, struct fe_softc * );
-#ifdef PC98
-static int fe_probe_re1000 ( struct isa_device *, struct fe_softc * );
-static int fe_probe_cnet9ne( struct isa_device *, struct fe_softc * );
-#endif
+static int fe_probe_fmv ( DEVICE *, struct fe_softc * );
+static int fe_probe_ati ( DEVICE *, struct fe_softc * );
+static void fe_init_ati ( struct fe_softc * );
+static int fe_probe_gwy ( DEVICE *, struct fe_softc * );
#if NCARD > 0
-static int fe_probe_mbh ( struct isa_device *, struct fe_softc * );
-static int fe_probe_tdk ( struct isa_device *, struct fe_softc * );
+static int fe_probe_mbh ( DEVICE *, struct fe_softc * );
+static void fe_init_mbh ( struct fe_softc * );
+static int fe_probe_tdk ( DEVICE *, struct fe_softc * );
#endif
static int fe_get_packet ( struct fe_softc *, u_short );
-static void fe_stop ( struct fe_softc * );
+static void fe_stop ( int );
static void fe_tint ( struct fe_softc *, u_char );
static void fe_rint ( struct fe_softc *, u_char );
static void fe_xmit ( struct fe_softc * );
+static void fe_emptybuffer ( struct fe_softc * );
static void fe_write_mbufs ( struct fe_softc *, struct mbuf * );
+static struct fe_filter
+ fe_mcaf ( struct fe_softc * );
+static int fe_hash ( u_char * );
static void fe_setmode ( struct fe_softc * );
static void fe_loadmar ( struct fe_softc * );
-
-#ifdef DIAGNOSTIC
-static void fe_emptybuffer ( struct fe_softc * );
+#if FE_DEBUG >= 1
+static void fe_dump ( int, struct fe_softc *, char * );
#endif
/* Driver struct used in the config code. This must be public (external.) */
@@ -313,62 +297,6 @@ struct isa_driver fedriver =
*/
/*
- * Miscellaneous definitions not directly related to hardware.
- */
-
-/* Flags for stability. */
-#define UNSTABLE_IRQ 0x01 /* IRQ setting may be incorrect. */
-#define UNSTABLE_MAC 0x02 /* Probed MAC address may be incorrect. */
-#define UNSTABLE_TYPE 0x04 /* Probed vendor/model may be incorrect. */
-
-/* The following line must be delete when "net/if_media.h" support it. */
-#ifndef IFM_10_FL
-#define IFM_10_FL /* 13 */ IFM_10_5
-#endif
-
-#if 0
-/* Mapping between media bitmap (in fe_softc.mbitmap) and ifm_media. */
-static int const bit2media [] = {
-#define MB_HA 0x0001
- IFM_HDX | IFM_ETHER | IFM_AUTO,
-#define MB_HM 0x0002
- IFM_HDX | IFM_ETHER | IFM_MANUAL,
-#define MB_HT 0x0004
- IFM_HDX | IFM_ETHER | IFM_10_T,
-#define MB_H2 0x0008
- IFM_HDX | IFM_ETHER | IFM_10_2,
-#define MB_H5 0x0010
- IFM_HDX | IFM_ETHER | IFM_10_5,
-#define MB_HF 0x0020
- IFM_HDX | IFM_ETHER | IFM_10_FL,
-#define MB_FT 0x0040
- IFM_FDX | IFM_ETHER | IFM_10_T,
- /* More can be come here... */
- 0
-};
-#else
-/* Mapping between media bitmap (in fe_softc.mbitmap) and ifm_media. */
-static int const bit2media [] = {
-#define MB_HA 0x0001
- IFM_ETHER | IFM_AUTO,
-#define MB_HM 0x0002
- IFM_ETHER | IFM_MANUAL,
-#define MB_HT 0x0004
- IFM_ETHER | IFM_10_T,
-#define MB_H2 0x0008
- IFM_ETHER | IFM_10_2,
-#define MB_H5 0x0010
- IFM_ETHER | IFM_10_5,
-#define MB_HF 0x0020
- IFM_ETHER | IFM_10_FL,
-#define MB_FT 0x0040
- IFM_ETHER | IFM_10_T,
- /* More can be come here... */
- 0
-};
-#endif
-
-/*
* Routines to access contiguous I/O ports.
*/
@@ -393,50 +321,65 @@ outblk ( struct fe_softc * sc, int offs, u_char const * mem, int len )
/*
* PC-Card (PCMCIA) specific code.
*/
-static int feinit (struct pccard_devinfo *);
-static void feunload (struct pccard_devinfo *);
-static int fe_card_intr (struct pccard_devinfo *);
+static int feinit ( struct pccard_devinfo * );
+static void feunload ( struct pccard_devinfo * );
+static int fe_card_intr ( struct pccard_devinfo * );
-PCCARD_MODULE(fe, feinit, feunload, fe_card_intr, 0, net_imask);
+static struct pccard_device fe_info = {
+ "fe",
+ feinit,
+ feunload,
+ fe_card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* XXX - Should this also include tty_imask? */
+};
+
+DATA_SET(pccarddrv_set, fe_info);
/*
- * Initialize the device - called from Slot manager.
+ * Initialize the device - called from Slot manager.
*/
static int
feinit(struct pccard_devinfo *devi)
{
struct fe_softc *sc;
- /* validate unit number. */
- if (devi->isahd.id_unit >= NFE) return ENODEV;
-
- /* Prepare for the device probe process. */
+ /* validate unit number. */
+ if (devi->isahd.id_unit >= NFE)
+ return (ENODEV);
+ /*
+ * Probe the device. If a value is returned,
+ * the device was found at the location.
+ */
+#if FE_DEBUG >= 2
+ printf("Start Probe\n");
+#endif
+ /* Initialize "minimum" parts of our softc. */
sc = &fe_softc[devi->isahd.id_unit];
sc->sc_unit = devi->isahd.id_unit;
sc->iobase = devi->isahd.id_iobase;
- /*
- * When the feinit() is called, the devi->misc holds a
- * six-byte value set by the pccard daemon. If the
- * corresponding entry in /etc/pccard.conf has an "ether"
- * keyword, the value is the Ethernet MAC address extracted
- * from CIS area of the card. If the entry has no "ether"
- * keyword, the daemon fills the field with binary zero,
- * instead. We passes the value (either MAC address or zero)
- * to model-specific sub-probe routines through sc->sc_enaddr
- * (it actually is sc->sc_arpcom.ar_enaddr, BTW) so that the
- * sub-probe routies can use that info.
- */
- bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Probe for supported cards. */
- if (fe_probe_mbh(&devi->isahd, sc) == 0
- && fe_probe_tdk(&devi->isahd, sc) == 0) return ENXIO;
+ /* Use Ethernet address got from CIS, if one is available. */
+ if ((devi->misc[0] & 0x03) == 0x00
+ && (devi->misc[0] | devi->misc[1] | devi->misc[2]) != 0) {
+ /* Yes, it looks like a valid Ether address. */
+ bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
+ } else {
+ /* Indicate we have no Ether address in CIS. */
+ bzero(sc->sc_enaddr, ETHER_ADDR_LEN);
+ }
- /* We've got a supported card. Attach it, then. */
- if (fe_attach(&devi->isahd) == 0) return ENXIO;
+ /* Probe supported PC card models. */
+ if (fe_probe_tdk(&devi->isahd, sc) == 0 &&
+ fe_probe_mbh(&devi->isahd, sc) == 0)
+ return (ENXIO);
+#if FE_DEBUG >= 2
+ printf("Start attach\n");
+#endif
+ if (fe_attach(&devi->isahd) == 0)
+ return (ENXIO);
- return 0;
+ return (0);
}
/*
@@ -452,9 +395,8 @@ static void
feunload(struct pccard_devinfo *devi)
{
struct fe_softc *sc = &fe_softc[devi->isahd.id_unit];
- printf("fe%d: unload\n", sc->sc_unit);
- fe_stop(sc);
- if_down(&sc->arpcom.ac_if);
+ printf("fe%d: unload\n", devi->isahd.id_unit);
+ fe_stop(devi->isahd.id_unit);
}
/*
@@ -472,58 +414,117 @@ fe_card_intr(struct pccard_devinfo *devi)
/*
* Hardware probe routines.
- *
- * In older versions of this driver, we provided an automatic I/O
- * address detection. The features is, however, removed from this
- * version, for simplicity. Any comments?
*/
+/* How and where to probe; to support automatic I/O address detection. */
+struct fe_probe_list
+{
+ int ( * probe ) ( DEVICE *, struct fe_softc * );
+ u_short const * addresses;
+};
+
+/* Lists of possible addresses. */
+static u_short const fe_fmv_addr [] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340, 0 };
+static u_short const fe_ati_addr [] =
+ { 0x240, 0x260, 0x280, 0x2A0, 0x300, 0x320, 0x340, 0x380, 0 };
+
+static struct fe_probe_list const fe_probe_list [] =
+{
+ { fe_probe_fmv, fe_fmv_addr },
+ { fe_probe_ati, fe_ati_addr },
+ { fe_probe_gwy, NULL }, /* GWYs cannot be auto detected. */
+ { NULL, NULL }
+};
+
+
/*
- * Determine if the device is present at a specified I/O address. The
- * main entry to the driver.
+ * Determine if the device is present
+ *
+ * on entry:
+ * a pointer to an isa_device struct
+ * on exit:
+ * zero if device not found
+ * or number of i/o addresses used (if found)
*/
static int
-fe_probe (struct isa_device * dev)
+fe_probe ( DEVICE * dev )
{
struct fe_softc * sc;
+ int u;
int nports;
+ struct fe_probe_list const * list;
+ u_short const * addr;
+ u_short single [ 2 ];
-#ifdef DIAGNOSTIC
- if (dev->id_unit >= NFE) {
- printf("fe%d: too large unit number for the current config\n",
- dev->id_unit);
- return 0;
- }
-#endif
-
- /* Prepare for the softc struct. */
- sc = &fe_softc[dev->id_unit];
+ /* Initialize "minimum" parts of our softc. */
+ sc = &fe_softc[ dev->id_unit ];
sc->sc_unit = dev->id_unit;
- sc->iobase = dev->id_iobase;
- /* Probe for supported boards. */
- nports = 0;
-#ifdef PC98
- if (!nports) nports = fe_probe_re1000(dev, sc);
- if (!nports) nports = fe_probe_cnet9ne(dev, sc);
+ /* Probe each possibility, one at a time. */
+ for ( list = fe_probe_list; list->probe != NULL; list++ ) {
+
+ if ( dev->id_iobase != NO_IOADDR ) {
+ /* Probe one specific address. */
+ single[ 0 ] = dev->id_iobase;
+ single[ 1 ] = 0;
+ addr = single;
+ } else if ( list->addresses != NULL ) {
+ /* Auto detect. */
+ addr = list->addresses;
+ } else {
+ /* We need a list of addresses to do auto detect. */
+ continue;
+ }
+
+ /* Probe all possible addresses for the board. */
+ while ( *addr != 0 ) {
+
+ /* See if the address is already in use. */
+ for ( u = 0; u < NFE; u++ ) {
+ if ( fe_softc[u].iobase == *addr ) break;
+ }
+
+#if FE_DEBUG >= 3
+ if ( u == NFE ) {
+ log( LOG_INFO, "fe%d: probing %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else if ( u == sc->sc_unit ) {
+ log( LOG_INFO, "fe%d: re-probing %d at 0x%x?\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else {
+ log( LOG_INFO, "fe%d: skipping %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ }
#endif
- if (!nports) nports = fe_probe_ssi(dev, sc);
- if (!nports) nports = fe_probe_jli(dev, sc);
- if (!nports) nports = fe_probe_fmv(dev, sc);
- if (!nports) nports = fe_probe_lnx(dev, sc);
- if (!nports) nports = fe_probe_ubn(dev, sc);
- if (!nports) nports = fe_probe_gwy(dev, sc);
-
- /* We found supported board. */
- return nports;
+
+ /* Probe the address if it is free. */
+ if ( u == NFE || u == sc->sc_unit ) {
+
+ /* Probe an address. */
+ sc->iobase = *addr;
+ nports = list->probe( dev, sc );
+ if ( nports > 0 ) {
+ /* Found. */
+ dev->id_iobase = *addr;
+ return ( nports );
+ }
+ sc->iobase = 0;
+ }
+
+ /* Try next. */
+ addr++;
+ }
+ }
+
+ /* Probe failed. */
+ return ( 0 );
}
/*
* Check for specific bits in specific registers have specific values.
- * A common utility function called from various sub-probe routines.
*/
-
struct fe_simple_probe_struct
{
u_char port; /* Offset from the base I/O address. */
@@ -538,11 +539,9 @@ fe_simple_probe ( struct fe_softc const * sc,
struct fe_simple_probe_struct const * p;
for ( p = sp; p->mask != 0; p++ ) {
-#ifdef FE_DEBUG
- unsigned a = sc->ioaddr[p->port];
- printf("fe%d: Probing %02x (%04x): %02x (%02x, %02x): %s\n",
- sc->sc_unit, p->port, a, inb(a), p->mask, p->bits,
- (inb(a) & p->mask) == p->bits ? "OK" : "NG");
+#if FE_DEBUG >=2
+ printf("Probe Port:%x,Value:%x,Mask:%x.Bits:%x\n",
+ p->port,inb(sc->ioaddr[ p->port]),p->mask,p->bits);
#endif
if ( ( inb( sc->ioaddr[ p->port ] ) & p->mask ) != p->bits )
{
@@ -552,167 +551,40 @@ fe_simple_probe ( struct fe_softc const * sc,
return ( 1 );
}
-/* Test if a given 6 byte value is a valid Ethernet station (MAC)
- address. "Vendor" is an expected vendor code (first three bytes,)
- or a zero when nothing expected. */
-static int
-valid_Ether_p (u_char const * addr, unsigned vendor)
-{
-#ifdef FE_DEBUG
- printf("fe?: validating %6D against %06x\n", addr, ":", vendor);
-#endif
-
- /* All zero is not allowed as a vendor code. */
- if (addr[0] == 0 && addr[1] == 0 && addr[2] == 0) return 0;
-
- switch (vendor) {
- case 0x000000:
- /* Legal Ethernet address (stored in ROM) must have
- its Group and Local bits cleared. */
- if ((addr[0] & 0x03) != 0) return 0;
- break;
- case 0x020000:
- /* Same as above, but a local address is allowed in
- this context. */
- if ((addr[0] & 0x01) != 0) return 0;
- break;
- default:
- /* Make sure the vendor part matches if one is given. */
- if ( addr[0] != ((vendor >> 16) & 0xFF)
- || addr[1] != ((vendor >> 8) & 0xFF)
- || addr[2] != ((vendor ) & 0xFF)) return 0;
- break;
- }
-
- /* Host part must not be all-zeros nor all-ones. */
- if (addr[3] == 0xFF && addr[4] == 0xFF && addr[5] == 0xFF) return 0;
- if (addr[3] == 0x00 && addr[4] == 0x00 && addr[5] == 0x00) return 0;
-
- /* Given addr looks like an Ethernet address. */
- return 1;
-}
-
-/* Fill our softc struct with default value. */
-static void
-fe_softc_defaults (struct fe_softc *sc)
-{
- int i;
-
- /* Initialize I/O address re-mapping table for the standard
- (contiguous) register layout. This routine doesn't use
- ioaddr[], so the caller can safely override it after
- calling fe_softc_defaults, if needed. */
- for (i = 0; i < MAXREGISTERS; i++) sc->ioaddr[i] = sc->iobase + i;
-
- /* Prepare for typical register prototypes. We assume a
- "typical" board has <32KB> of <fast> SRAM connected with a
- <byte-wide> data lines. */
- sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
- sc->proto_dlcr5 = 0;
- sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
- | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
- sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
- sc->proto_bmpr13 = 0;
-
- /* Assume the probe process (to be done later) is stable. */
- sc->stability = 0;
-
- /* A typical board needs no hooks. */
- sc->init = NULL;
- sc->stop = NULL;
-
- /* Assume the board has no software-controllable media selection. */
- sc->mbitmap = MB_HM;
- sc->defmedia = MB_HM;
- sc->msel = NULL;
-}
-
-/* Common error reporting routine used in probe routines for
- "soft configured IRQ"-type boards. */
-static void
-fe_irq_failure (char const *name, int unit, int irq, char const *list)
-{
- printf("fe%d: %s board is detected, but %s IRQ was given\n",
- unit, name, (irq == NO_IRQ ? "no" : "invalid"));
- if (list != NULL) {
- printf("fe%d: specify an IRQ from %s in kernel config\n",
- unit, list);
- }
-}
-
-/*
- * Hardware (vendor) specific probe routines and hooks.
- */
-
-/*
- * Machine independent routines.
- */
-
-/*
- * Generic media selection scheme for MB86965 based boards.
- */
-static void
-fe_msel_965 (struct fe_softc *sc)
-{
- u_char b13;
-
- /* Find the appropriate bits for BMPR13 tranceiver control. */
- switch (IFM_SUBTYPE(sc->media.ifm_media)) {
- case IFM_AUTO: b13 = FE_B13_PORT_AUTO | FE_B13_TPTYPE_UTP; break;
- case IFM_10_T: b13 = FE_B13_PORT_TP | FE_B13_TPTYPE_UTP; break;
- default: b13 = FE_B13_PORT_AUI; break;
- }
-
- /* Write it into the register. It takes effect immediately. */
- outb(sc->ioaddr[FE_BMPR13], sc->proto_bmpr13 | b13);
-}
-
-/*
- * Fujitsu MB86965 JLI mode support routines.
- */
-
-/* Datasheet for 86965 explicitly states that it only supports serial
- * EEPROM with 16 words (32 bytes) capacity. (I.e., 93C06.) However,
- * ones with 64 words (128 bytes) are available in the marked, namely
- * 93C46, and are also fully compatible with 86965. It is known that
- * some boards (e.g., ICL) actually have 93C46 on them and use extra
- * storage to keep various config info. */
-#define JLI_EEPROM_SIZE 128
-
/*
* Routines to read all bytes from the config EEPROM through MB86965A.
- * It is a MicroWire (3-wire) serial EEPROM with 6-bit address.
- * (93C06 or 93C46.)
+ * I'm not sure what exactly I'm doing here... I was told just to follow
+ * the steps, and it worked. Could someone tell me why the following
+ * code works? (Or, why all similar codes I tried previously doesn't
+ * work.) FIXME.
*/
+
static void
-fe_strobe_eeprom_jli ( u_short bmpr16 )
+fe_strobe_eeprom ( u_short bmpr16 )
{
/*
- * We must guarantee 1us (or more) interval to access slow
+ * We must guarantee 800ns (or more) interval to access slow
* EEPROMs. The following redundant code provides enough
* delay with ISA timing. (Even if the bus clock is "tuned.")
* Some modification will be needed on faster busses.
*/
outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
}
static void
-fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
+fe_read_eeprom ( struct fe_softc * sc, u_char * data )
{
u_short bmpr16 = sc->ioaddr[ FE_BMPR16 ];
u_short bmpr17 = sc->ioaddr[ FE_BMPR17 ];
u_char n, val, bit;
- u_char save16, save17;
-
- /* Save the current value of the EEPROM interface registers. */
- save16 = inb(bmpr16);
- save17 = inb(bmpr17);
/* Read bytes from EEPROM; two bytes per an iteration. */
- for ( n = 0; n < JLI_EEPROM_SIZE / 2; n++ ) {
+ for ( n = 0; n < FE_EEPROM_SIZE / 2; n++ ) {
/* Reset the EEPROM interface. */
outb( bmpr16, 0x00 );
@@ -721,20 +593,20 @@ fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
/* Start EEPROM access. */
outb( bmpr16, FE_B16_SELECT );
outb( bmpr17, FE_B17_DATA );
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
- /* Pass the iteration count as well as a READ command. */
+ /* Pass the iteration count to the chip. */
val = 0x80 | n;
for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
outb( bmpr17, ( val & bit ) ? FE_B17_DATA : 0 );
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
}
outb( bmpr17, 0x00 );
/* Read a byte. */
val = 0;
for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
if ( inb( bmpr17 ) & FE_B17_DATA ) {
val |= bit;
}
@@ -744,7 +616,7 @@ fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
/* Read one more byte. */
val = 0;
for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- fe_strobe_eeprom_jli( bmpr16 );
+ fe_strobe_eeprom( bmpr16 );
if ( inb( bmpr17 ) & FE_B17_DATA ) {
val |= bit;
}
@@ -752,476 +624,278 @@ fe_read_eeprom_jli ( struct fe_softc * sc, u_char * data )
*data++ = val;
}
-#if 0
/* Reset the EEPROM interface, again. */
outb( bmpr16, 0x00 );
outb( bmpr17, 0x00 );
-#else
- /* Make sure to restore the original value of EEPROM interface
- registers, since we are not yet sure we have MB86965A on
- the address. */
- outb(bmpr17, save17);
- outb(bmpr16, save16);
-#endif
-#if 1
+#if FE_DEBUG >= 3
/* Report what we got. */
- if (bootverbose) {
- int i;
- data -= JLI_EEPROM_SIZE;
- for (i = 0; i < JLI_EEPROM_SIZE; i += 16) {
- printf("fe%d: EEPROM(JLI):%3x: %16D\n",
- sc->sc_unit, i, data + i, " ");
- }
- }
+ data -= FE_EEPROM_SIZE;
+ log( LOG_INFO, "fe%d: EEPROM:"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x\n",
+ sc->sc_unit,
+ data[ 0], data[ 1], data[ 2], data[ 3],
+ data[ 4], data[ 5], data[ 6], data[ 7],
+ data[ 8], data[ 9], data[10], data[11],
+ data[12], data[13], data[14], data[15],
+ data[16], data[17], data[18], data[19],
+ data[20], data[21], data[22], data[23],
+ data[24], data[25], data[26], data[27],
+ data[28], data[29], data[30], data[31] );
#endif
}
-static void
-fe_init_jli (struct fe_softc * sc)
-{
- /* "Reset" by writing into a magic location. */
- DELAY(200);
- outb(sc->ioaddr[0x1E], inb(sc->ioaddr[0x1E]));
- DELAY(300);
-}
-
/*
- * SSi 78Q8377A support routines.
+ * Hardware (vendor) specific probe routines.
*/
-#define SSI_EEPROM_SIZE 512
-#define SSI_DIN 0x01
-#define SSI_DAT 0x01
-#define SSI_CSL 0x02
-#define SSI_CLK 0x04
-#define SSI_EEP 0x10
-
/*
- * Routines to read all bytes from the config EEPROM through 78Q8377A.
- * It is a MicroWire (3-wire) serial EEPROM with 8-bit address. (I.e.,
- * 93C56 or 93C66.)
- *
- * As I don't have SSi manuals, (hmm, an old song again!) I'm not exactly
- * sure the following code is correct... It is just stolen from the
- * C-NET(98)P2 support routine in FreeBSD(98).
+ * Probe and initialization for Fujitsu FMV-180 series boards
*/
-
-static void
-fe_read_eeprom_ssi (struct fe_softc *sc, u_char *data)
+static int
+fe_probe_fmv ( DEVICE * dev, struct fe_softc * sc )
{
- u_short bmpr12 = sc->ioaddr[FE_DLCR12];
- u_char val, bit;
- int n;
- u_char save6, save7, save12;
-
- /* Save the current value for the DLCR registers we are about
- to destroy. */
- save6 = inb(sc->ioaddr[FE_DLCR6]);
- save7 = inb(sc->ioaddr[FE_DLCR7]);
-
- /* Put the 78Q8377A into a state that we can access the EEPROM. */
- outb(sc->ioaddr[FE_DLCR6],
- FE_D6_BBW_WORD | FE_D6_SBW_WORD | FE_D6_DLC_DISABLE);
- outb(sc->ioaddr[FE_DLCR7],
- FE_D7_BYTSWP_LH | FE_D7_RBS_BMPR | FE_D7_RDYPNS | FE_D7_POWER_UP);
-
- /* Save the current value for the BMPR12 register, too. */
- save12 = inb(bmpr12);
-
- /* Read bytes from EEPROM; two bytes per an iteration. */
- for ( n = 0; n < SSI_EEPROM_SIZE / 2; n++ ) {
-
- /* Start EEPROM access */
- outb(bmpr12, SSI_EEP);
- outb(bmpr12, SSI_EEP | SSI_CSL);
-
- /* Send the following four bits to the EEPROM in the
- specified order: a dummy bit, a start bit, and
- command bits (10) for READ. */
- outb(bmpr12, SSI_EEP | SSI_CSL );
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK ); /* 0 */
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_DAT);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK | SSI_DAT); /* 1 */
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_DAT);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK | SSI_DAT); /* 1 */
- outb(bmpr12, SSI_EEP | SSI_CSL );
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK ); /* 0 */
-
- /* Pass the iteration count to the chip. */
- for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- val = ( n & bit ) ? SSI_DAT : 0;
- outb(bmpr12, SSI_EEP | SSI_CSL | val);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK | val);
- }
-
- /* Read a byte. */
- val = 0;
- for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- outb(bmpr12, SSI_EEP | SSI_CSL);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK);
- if (inb(bmpr12) & SSI_DIN) val |= bit;
- }
- *data++ = val;
-
- /* Read one more byte. */
- val = 0;
- for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
- outb(bmpr12, SSI_EEP | SSI_CSL);
- outb(bmpr12, SSI_EEP | SSI_CSL | SSI_CLK);
- if (inb(bmpr12) & SSI_DIN) val |= bit;
- }
- *data++ = val;
-
- outb(bmpr12, SSI_EEP);
- }
+ int i, n;
- /* Reset the EEPROM interface. (For now.) */
- outb( bmpr12, 0x00 );
+ static u_short const baseaddr [ 8 ] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340 };
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ7, IRQ10, IRQ15 };
- /* Restore the saved register values, for the case that we
- didn't have 78Q8377A at the given address. */
- outb(sc->ioaddr[FE_BMPR12], save12);
- outb(sc->ioaddr[FE_DLCR7], save7);
- outb(sc->ioaddr[FE_DLCR6], save6);
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ /* { FE_DLCR5, 0x80, 0x00 }, Doesn't work. */
+ { FE_FMV0, 0x78, 0x50 }, /* ERRDY+PRRDY */
+ { FE_FMV1, 0xB0, 0x00 }, /* FMV-183/184 has 0x48 bits. */
+ { FE_FMV3, 0x7F, 0x00 },
#if 1
- /* Report what we got. */
- if (bootverbose) {
- int i;
- data -= SSI_EEPROM_SIZE;
- for (i = 0; i < SSI_EEPROM_SIZE; i += 16) {
- printf("fe%d: EEPROM(SSI):%3x: %16D\n",
- sc->sc_unit, i, data + i, " ");
- }
- }
+ /*
+ * Test *vendor* part of the station address for Fujitsu.
+ * The test will gain reliability of probe process, but
+ * it rejects FMV-180 clone boards manufactured by other vendors.
+ * We have to turn the test off when such cards are made available.
+ */
+ { FE_FMV4, 0xFF, 0x00 },
+ { FE_FMV5, 0xFF, 0x00 },
+ { FE_FMV6, 0xFF, 0x0E },
+#else
+ /*
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "no multicast" and "no local" even for
+ * unknown vendors.
+ */
+ { FE_FMV4, 0x03, 0x00 },
#endif
-}
-
-#define FE_SSI_EEP_IRQ 9 /* Irq ??? */
-#define FE_SSI_EEP_ADDR 16 /* Station(MAC) address */
-#define FE_SSI_EEP_DUPLEX 25 /* Duplex mode ??? */
-
-/*
- * TDK/LANX boards support routines.
- */
-
-/* AX012/AX013 equips an X24C01 chip, which has 128 bytes of memory cells. */
-#define LNX_EEPROM_SIZE 128
-
-/* Bit assignments and command definitions for the serial EEPROM
- interface register in LANX ASIC. */
-#define LNX_SDA_HI 0x08 /* Drive SDA line high (logical 1.) */
-#define LNX_SDA_LO 0x00 /* Drive SDA line low (logical 0.) */
-#define LNX_SDA_FL 0x08 /* Float (don't drive) SDA line. */
-#define LNX_SDA_IN 0x01 /* Mask for reading SDA line. */
-#define LNX_CLK_HI 0x04 /* Drive clock line high (active.) */
-#define LNX_CLK_LO 0x00 /* Drive clock line low (inactive.) */
-
-/* It is assumed that the CLK line is low and SDA is high (float) upon entry. */
-#define LNX_PH(D,K,N) \
- ((LNX_SDA_##D | LNX_CLK_##K) << N)
-#define LNX_CYCLE(D1,D2,D3,D4,K1,K2,K3,K4) \
- (LNX_PH(D1,K1,0)|LNX_PH(D2,K2,8)|LNX_PH(D3,K3,16)|LNX_PH(D4,K4,24))
-
-#define LNX_CYCLE_START LNX_CYCLE(HI,LO,LO,HI, HI,HI,LO,LO)
-#define LNX_CYCLE_STOP LNX_CYCLE(LO,LO,HI,HI, LO,HI,HI,LO)
-#define LNX_CYCLE_HI LNX_CYCLE(HI,HI,HI,HI, LO,HI,LO,LO)
-#define LNX_CYCLE_LO LNX_CYCLE(LO,LO,LO,HI, LO,HI,LO,LO)
-#define LNX_CYCLE_INIT LNX_CYCLE(LO,HI,HI,HI, LO,LO,LO,LO)
-
-static void
-fe_eeprom_cycle_lnx (u_short reg20, u_long cycle)
-{
- outb(reg20, (cycle ) & 0xFF);
- DELAY(15);
- outb(reg20, (cycle >> 8) & 0xFF);
- DELAY(15);
- outb(reg20, (cycle >> 16) & 0xFF);
- DELAY(15);
- outb(reg20, (cycle >> 24) & 0xFF);
- DELAY(15);
-}
+ { 0 }
+ };
-static u_char
-fe_eeprom_receive_lnx (u_short reg20)
-{
- u_char dat;
-
- outb(reg20, LNX_CLK_HI | LNX_SDA_FL);
- DELAY(15);
- dat = inb(reg20);
- outb(reg20, LNX_CLK_LO | LNX_SDA_FL);
- DELAY(15);
- return (dat & LNX_SDA_IN);
-}
+ /* "Hardware revision ID" */
+ int revision;
-static void
-fe_read_eeprom_lnx (struct fe_softc *sc, u_char *data)
-{
- int i;
- u_char n, bit, val;
- u_char save20;
- u_short reg20 = sc->ioaddr[0x14];
+ /*
+ * See if the specified address is possible for FMV-180 series.
+ */
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
+ }
+ if ( i == 8 ) return 0;
- save20 = inb(sc->ioaddr[0x14]);
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
- /* NOTE: DELAY() timing constants are approximately three
- times longer (slower) than the required minimum. This is
- to guarantee a reliable operation under some tough
- conditions... Fortunately, this routine is only called
- during the boot phase, so the speed is less important than
- stability. */
+ /* Simple probe. */
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
-#if 1
- /* Reset the X24C01's internal state machine and put it into
- the IDLE state. We usually don't need this, but *if*
- someone (e.g., probe routine of other driver) write some
- garbage into the register at 0x14, synchronization will be
- lost, and the normal EEPROM access protocol won't work.
- Moreover, as there are no easy way to reset, we need a
- _manoeuvre_ here. (It even lacks a reset pin, so pushing
- the RESET button on the PC doesn't help!) */
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_INIT);
- for (i = 0; i < 10; i++) {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_START);
- }
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_STOP);
- DELAY(10000);
+ /* Check if our I/O address matches config info. on EEPROM. */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IOS )
+ >> FE_FMV2_IOS_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) {
+#if 0
+ /* May not work on some revisions of the cards... FIXME. */
+ return 0;
+#else
+ /* Just log the fact and see what happens... FIXME. */
+ log( LOG_WARNING, "fe%d: strange I/O config?\n", sc->sc_unit );
#endif
+ }
- /* Issue a start condition. */
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_START);
+ /* Find the "hardware revision." */
+ revision = inb( sc->ioaddr[ FE_FMV1 ] ) & FE_FMV1_REV;
- /* Send seven bits of the starting address (zero, in this
- case) and a command bit for READ. */
- val = 0x01;
- for (bit = 0x80; bit != 0x00; bit >>= 1) {
- if (val & bit) {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_HI);
- } else {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_LO);
+ /* Determine the card type. */
+ sc->typestr = NULL;
+ switch ( inb( sc->ioaddr[ FE_FMV0 ] ) & FE_FMV0_MEDIA ) {
+ case 0:
+ /* No interface? This doesn't seem to be an FMV-180... */
+ return 0;
+ case FE_FMV0_MEDIUM_T:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-183";
+ break;
+ case 12:
+ sc->typestr = "FMV-183 (on-board)";
+ break;
}
- }
-
- /* Receive an ACK bit. */
- if (fe_eeprom_receive_lnx(reg20)) {
- /* ACK was not received. EEPROM is not present (i.e.,
- this board was not a TDK/LANX) or not working
- properly. */
- if (bootverbose) {
- printf("fe%d: no ACK received from EEPROM(LNX)\n",
- sc->sc_unit);
+ break;
+ case FE_FMV0_MEDIUM_T | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-181";
+ break;
+ case 1:
+ sc->typestr = "FMV-181A";
+ break;
}
- /* Clear the given buffer to indicate we could not get
- any info. and return. */
- bzero(data, LNX_EEPROM_SIZE);
- goto RET;
- }
-
- /* Read bytes from EEPROM. */
- for (n = 0; n < LNX_EEPROM_SIZE; n++) {
-
- /* Read a byte and store it into the buffer. */
- val = 0x00;
- for (bit = 0x80; bit != 0x00; bit >>= 1) {
- if (fe_eeprom_receive_lnx(reg20)) val |= bit;
+ break;
+ case FE_FMV0_MEDIUM_2:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 2)";
+ break;
}
- *data++ = val;
-
- /* Acknowledge if we have to read more. */
- if (n < LNX_EEPROM_SIZE - 1) {
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_LO);
+ break;
+ case FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 1)";
+ break;
}
- }
-
- /* Issue a STOP condition, de-activating the clock line.
- It will be safer to keep the clock line low than to leave
- it high. */
- fe_eeprom_cycle_lnx(reg20, LNX_CYCLE_STOP);
-
- RET:
- outb(sc->ioaddr[0x14], save20);
-
-#if 1
- /* Report what we got. */
- data -= LNX_EEPROM_SIZE;
- if (bootverbose) {
- for (i = 0; i < JLI_EEPROM_SIZE; i += 16) {
- printf("fe%d: EEPROM(LNX):%3x: %16D\n",
- sc->sc_unit, i, data + i, " ");
+ break;
+ case FE_FMV0_MEDIUM_2 | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-182";
+ break;
+ case 1:
+ sc->typestr = "FMV-182A";
+ break;
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 3)";
+ break;
}
+ break;
+ }
+ if ( sc->typestr == NULL ) {
+ /* Unknown card type... Hope the driver works. */
+ sc->typestr = "unknown FMV-180 version";
+ log( LOG_WARNING, "fe%d: %s: %x-%x-%x-%x\n",
+ sc->sc_unit, sc->typestr,
+ inb( sc->ioaddr[ FE_FMV0 ] ),
+ inb( sc->ioaddr[ FE_FMV1 ] ),
+ inb( sc->ioaddr[ FE_FMV2 ] ),
+ inb( sc->ioaddr[ FE_FMV3 ] ) );
}
-#endif
-}
-
-static void
-fe_init_lnx ( struct fe_softc * sc )
-{
- /* Reset the 86960. Do we need this? FIXME. */
- outb(sc->ioaddr[0x12], 0x06);
- DELAY(100);
- outb(sc->ioaddr[0x12], 0x07);
- DELAY(100);
-
- /* Setup IRQ control register on the ASIC. */
- outb(sc->ioaddr[0x14], sc->priv_info);
-}
-
-/*
- * Ungermann-Bass boards support routine.
- */
-static void
-fe_init_ubn ( struct fe_softc * sc )
-{
- /* Do we need this? FIXME. */
- outb(sc->ioaddr[FE_DLCR7],
- sc->proto_dlcr7 | FE_D7_RBS_BMPR | FE_D7_POWER_UP);
- outb(sc->ioaddr[0x18], 0x00);
- DELAY( 200 );
-
- /* Setup IRQ control register on the ASIC. */
- outb(sc->ioaddr[0x14], sc->priv_info);
-}
-
-/*
- * Machine dependent probe routines.
- */
-
-#ifdef PC98
-static int
-fe_probe_fmv ( struct isa_device * dev, struct fe_softc * sc )
-{
- /* PC-98 has no board of this architechture. */
- return 0;
-}
-
-/* ioaddr for RE1000/1000Plus - Very dirty! */
-static u_short ioaddr_re1000[MAXREGISTERS] = {
- 0x0000, 0x0001, 0x0200, 0x0201, 0x0400, 0x0401, 0x0600, 0x0601,
- 0x0800, 0x0801, 0x0a00, 0x0a01, 0x0c00, 0x0c01, 0x0e00, 0x0e01,
- 0x1000, 0x1200, 0x1400, 0x1600, 0x1800, 0x1a00, 0x1c00, 0x1e00,
- 0x1001, 0x1201, 0x1401, 0x1601, 0x1801, 0x1a01, 0x1c01, 0x1e01,
-};
-
-/*
- * Probe and initialization for Allied-Telesis RE1000 series.
- */
-static void
-fe_init_re1000 ( struct fe_softc * sc )
-{
- /* Setup IRQ control register on the ASIC. */
- outb(sc->ioaddr[FE_RE1000_IRQCONF], sc->priv_info);
-}
-
-static int
-fe_probe_re1000 ( struct isa_device * dev, struct fe_softc * sc )
-{
- int i, n;
- u_char sum;
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for RE1000. */
- /* [01]D[02468ACE] are allowed. */
- if ((sc->iobase & ~0x10E) != 0xD0) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
- /* Re-map ioaddr for RE1000. */
- for (i = 0; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ioaddr_re1000[i];
+ /*
+ * An FMV-180 has been proved.
+ * Determine which IRQ to be used.
+ *
+ * In this version, we give a priority to the kernel config file.
+ * If the EEPROM and config don't match, say it to the user for
+ * an attention.
+ */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IRS )
+ >> FE_FMV2_IRS_SHIFT;
+ if ( dev->id_irq == NO_IRQ ) {
+ /* Just use the probed value. */
+ dev->id_irq = irqmap[ n ];
+ } else if ( dev->id_irq != irqmap[ n ] ) {
+ /* Don't match. */
+ log( LOG_WARNING,
+ "fe%d: check IRQ in config; it may be incorrect\n",
+ sc->sc_unit );
+ }
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
+ /*
+ * Initialize constants in the per-line structure.
+ */
/* Get our station address from EEPROM. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
+ inblk( sc, FE_FMV4, sc->sc_enaddr, ETHER_ADDR_LEN );
- /* Make sure it is Allied-Telesis's. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x0000F4)) return 0;
-#if 1
- /* Calculate checksum. */
- sum = inb(sc->ioaddr[0x1e]);
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- sum ^= sc->sc_enaddr[i];
- }
- if (sum != 0) return 0;
-#endif
- /* Setup the board type. */
- sc->typestr = "RE1000";
-
- /* This looks like an RE1000 board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: n = 0x10; break;
- case IRQ5: n = 0x20; break;
- case IRQ6: n = 0x40; break;
- case IRQ12: n = 0x80; break;
- default:
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/12");
- return 0;
- }
- sc->priv_info = inb(sc->ioaddr[FE_RE1000_IRQCONF]) & 0x0f | n;
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
- /* Setup hooks. We need a special initialization procedure. */
- sc->init = fe_init_re1000;
+ /*
+ * Register values which (may) depend on board design.
+ *
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
- /* The I/O address range is fragmented in the RE1000.
- It occupies 2*16 I/O addresses, by the way. */
- return 2;
-}
+ /*
+ * Minimum initialization of the hardware.
+ * We write into registers; hope I/O ports have no
+ * overlap with other boards.
+ */
-/* JLI sub-probe for Allied-Telesis RE1000Plus/ME1500 series. */
-static u_short const *
-fe_probe_jli_re1000p (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- static u_short const irqmaps_re1000p [4] = { IRQ3, IRQ5, IRQ6, IRQ12 };
+ /* Initialize ASIC. */
+ outb( sc->ioaddr[ FE_FMV3 ], 0 );
+ outb( sc->ioaddr[ FE_FMV10 ], 0 );
- /* Make sure the EEPROM contains Allied-Telesis bit pattern. */
- if (eeprom[1] != 0xFF) return NULL;
- for (i = 2; i < 8; i++) if (eeprom[i] != 0xFF) return NULL;
- for (i = 14; i < 24; i++) if (eeprom[i] != 0xFF) return NULL;
+ /* Initialize 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
- /* Get our station address from EEPROM, and make sure the
- EEPROM contains Allied-Telesis's address. */
- bcopy(eeprom+8, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x0000F4)) return NULL;
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
- /* I don't know any sub-model identification. */
- sc->typestr = "RE1000Plus/ME1500";
+ /* "Refresh" hardware configuration. FIXME. */
+ outb( sc->ioaddr[ FE_FMV2 ], inb( sc->ioaddr[ FE_FMV2 ] ) );
+
+ /* Turn the "master interrupt control" flag of ASIC on. */
+ outb( sc->ioaddr[ FE_FMV3 ], FE_FMV3_IRQENB );
- /* Returns the IRQ table for the RE1000Plus. */
- return irqmaps_re1000p;
+ /*
+ * That's all. FMV-180 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
}
/*
- * Probe for Allied-Telesis RE1000Plus/ME1500 series.
+ * Probe and initialization for Allied-Telesis AT1700/RE2000 series.
*/
static int
-fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
+fe_probe_ati ( DEVICE * dev, struct fe_softc * sc )
{
int i, n;
- int irq;
- u_char eeprom [JLI_EEPROM_SIZE];
- u_short const * irqmap;
+ u_char eeprom [ FE_EEPROM_SIZE ];
+ u_char save16, save17;
- static u_short const baseaddr [8] =
- { 0x1D6, 0x1D8, 0x1DA, 0x1D4, 0x0D4, 0x0D2, 0x0D8, 0x0D0 };
+ static u_short const baseaddr [ 8 ] =
+ { 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300 };
+ static u_short const irqmaps [ 4 ][ 4 ] =
+ {
+ { IRQ3, IRQ4, IRQ5, IRQ9 },
+ { IRQ10, IRQ11, IRQ12, IRQ15 },
+ { IRQ3, IRQ11, IRQ5, IRQ15 },
+ { IRQ10, IRQ11, IRQ14, IRQ15 },
+ };
static struct fe_simple_probe_struct const probe_table [] = {
- /* { FE_DLCR1, 0x20, 0x00 }, Doesn't work. */
- { FE_DLCR2, 0x50, 0x00 },
+ { FE_DLCR2, 0x70, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
- /* { FE_DLCR5, 0x80, 0x00 }, Doesn't work. */
+ { FE_DLCR5, 0x80, 0x00 },
#if 0
{ FE_BMPR16, 0x1B, 0x00 },
{ FE_BMPR17, 0x7F, 0x00 },
@@ -1229,20 +903,28 @@ fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
{ 0 }
};
+ /* Assume we have 86965 and no need to restore these. */
+ save16 = 0;
+ save17 = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for ATI\n",
+ sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
/*
* See if the specified address is possible for MB86965A JLI mode.
*/
- for (i = 0; i < 8; i++) {
- if (baseaddr[i] == sc->iobase) break;
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
}
- if (i == 8) return 0;
+ if ( i == 8 ) goto NOTFOUND;
- /* Fill the softc struct with reasonable default. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for RE1000Plus. */
- for (i = 0; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ioaddr_re1000[i];
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
/*
* We should test if MB86965A is on the base address now.
@@ -1252,637 +934,35 @@ fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
* described in the Fujitsu document. On warm boot, however,
* we can predict almost nothing about register values.
*/
- if (!fe_simple_probe(sc, probe_table)) return 0;
+ if ( !fe_simple_probe( sc, probe_table ) ) goto NOTFOUND;
/* Check if our I/O address matches config info on 86965. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_ADDR) >> FE_B19_ADDR_SHIFT;
- if (baseaddr[n] != sc->iobase) return 0;
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_ADDR )
+ >> FE_B19_ADDR_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) goto NOTFOUND;
/*
- * We are now almost sure we have an MB86965 at the given
- * address. So, read EEPROM through it. We have to write
+ * We are now almost sure we have an AT1700 at the given
+ * address. So, read EEPROM through 86965. We have to write
* into LSI registers to read from EEPROM. I want to avoid it
* at this stage, but I cannot test the presence of the chip
* any further without reading EEPROM. FIXME.
*/
- fe_read_eeprom_jli(sc, eeprom);
-
- /* Make sure that config info in EEPROM and 86965 agree. */
- if (eeprom[FE_EEPROM_CONF] != inb(sc->ioaddr[FE_BMPR19])) {
- return 0;
- }
-
- /* Use 86965 media selection scheme, unless othewise
- specified. It is "AUTO always" and "select with BMPR13".
- This behaviour covers most of the 86965 based board (as
- minimum requirements.) It is backward compatible with
- previous versions, also. */
- sc->mbitmap = MB_HA;
- sc->defmedia = MB_HA;
- sc->msel = fe_msel_965;
-
- /* Perform board-specific probe. */
- if ((irqmap = fe_probe_jli_re1000p(sc, eeprom)) == NULL) return 0;
-
- /* Find the IRQ read from EEPROM. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_IRQ) >> FE_B19_IRQ_SHIFT;
- irq = irqmap[n];
-
- /* Try to determine IRQ setting. */
- if (dev->id_irq == NO_IRQ && irq == NO_IRQ) {
- /* The device must be configured with an explicit IRQ. */
- printf("fe%d: IRQ auto-detection does not work\n",
- sc->sc_unit);
- return 0;
- } else if (dev->id_irq == NO_IRQ && irq != NO_IRQ) {
- /* Just use the probed IRQ value. */
- dev->id_irq = irq;
- } else if (dev->id_irq != NO_IRQ && irq == NO_IRQ) {
- /* No problem. Go ahead. */
- } else if (dev->id_irq == irq) {
- /* Good. Go ahead. */
- } else {
- /* User must be warned in this case. */
- sc->stability |= UNSTABLE_IRQ;
- }
-
- /* Setup a hook, which resets te 86965 when the driver is being
- initialized. This may solve a nasty bug. FIXME. */
- sc->init = fe_init_jli;
-
- /* The I/O address range is fragmented in the RE1000Plus.
- It occupies 2*16 I/O addresses, by the way. */
- return 2;
-}
-
-/*
- * Probe and initialization for Contec C-NET(9N)E series.
- */
-
-/* TODO: Should be in "if_fereg.h" */
-#define FE_CNET9NE_INTR 0x10 /* Interrupt Mask? */
-
-static void
-fe_init_cnet9ne ( struct fe_softc * sc )
-{
- /* Enable interrupt? FIXME. */
- outb(sc->ioaddr[FE_CNET9NE_INTR], 0x10);
-}
-
-static int
-fe_probe_cnet9ne ( struct isa_device * dev, struct fe_softc * sc )
-{
- int i;
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
- static u_short ioaddr[MAXREGISTERS - 16] = {
- /* 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, */
- /* 0x008, 0x009, 0x00a, 0x00b, 0x00c, 0x00d, 0x00e, 0x00f, */
- 0x400, 0x402, 0x404, 0x406, 0x408, 0x40a, 0x40c, 0x40e,
- 0x401, 0x403, 0x405, 0x407, 0x409, 0x40b, 0x40d, 0x40f,
- };
-
- /* See if the specified I/O address is possible for C-NET(9N)E. */
- if (sc->iobase != 0x73D0) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for C-NET(9N)E. */
- for (i = 16; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ioaddr[i - 16];
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address from EEPROM. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Make sure it is Contec's. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x00804C)) return 0;
-
- /* Setup the board type. */
- sc->typestr = "C-NET(9N)E";
-
- /* C-NET(9N)E seems to work only IRQ5. FIXME. */
- if (dev->id_irq != IRQ5) {
- fe_irq_failure(sc->typestr, sc->sc_unit, dev->id_irq, "5");
- return 0;
- }
-
- /* We need an init hook to initialize ASIC before we start. */
- sc->init = fe_init_cnet9ne;
-
- /* C-NET(9N)E has 64KB SRAM. */
- sc->proto_dlcr6 = FE_D6_BUFSIZ_64KB | FE_D6_TXBSIZ_2x4KB
- | FE_D6_BBW_WORD | FE_D6_SBW_WORD | FE_D6_SRAM;
-
- /* The I/O address range is fragmented in the C-NET(9N)E.
- This is the number of regs at iobase. */
- return 16;
-}
-
-/*
- * Probe for Contec C-NET(98)P2 series.
- * (Logitec LAN-98TP/LAN-98T25P - parhaps)
- */
-static int
-fe_probe_ssi (struct isa_device *dev, struct fe_softc *sc)
-{
- u_char eeprom [SSI_EEPROM_SIZE];
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x08, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
- static u_short const irqmap[] = {
- /* INT0 INT1 INT2 */
- NO_IRQ, NO_IRQ, NO_IRQ, IRQ3 , NO_IRQ, IRQ5 , IRQ6 , NO_IRQ,
- NO_IRQ, IRQ9 , IRQ10 , NO_IRQ, IRQ12 , IRQ13 , NO_IRQ, NO_IRQ,
- /* INT3 INT41 INT5 INT6 */
- };
-
- /* See if the specified I/O address is possible for 78Q8377A. */
- /* [0-D]3D0 are allowed. */
- if ((sc->iobase & 0xFFF) != 0x3D0) return 0; /* XXX */
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a C-NET(98)P2 board here.) Don't
- remember to select BMPRs bofore reading EEPROM, since other
- register bank may be selected before the probe() is called. */
- fe_read_eeprom_ssi(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of Contec's. */
- if (!valid_Ether_p(eeprom+FE_SSI_EEP_ADDR, 0x00804C)) return 0;
- bcopy(eeprom+FE_SSI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Setup the board type. */
- sc->typestr = "C-NET(98)P2";
-
- /* Get IRQ configuration from EEPROM. */
- dev->id_irq = irqmap[eeprom[FE_SSI_EEP_IRQ]];
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/9/10/12/13");
- return 0;
- }
-
- /* Get Duplex-mode configuration from EEPROM. */
- sc->proto_dlcr4 |= (eeprom[FE_SSI_EEP_DUPLEX] & FE_D4_DSC);
-
- /* Fill softc struct accordingly. */
- sc->mbitmap = MB_HT;
- sc->defmedia = MB_HT;
-
- /* We have 16 registers. */
- return 16;
-}
-
-/*
- * Probe for TDK LAC-98012/013/025/9N011 - parhaps.
- */
-static int
-fe_probe_lnx (struct isa_device *dev, struct fe_softc *sc)
-{
-#ifndef FE_8BIT_SUPPORT
- printf("fe%d: skip LAC-98012/013(only 16-bit cards are supported)\n",
- sc->sc_unit);
- return 0;
-#else
- int i;
- u_char eeprom [LNX_EEPROM_SIZE];
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for TDK/LANX boards. */
- /* 0D0, 4D0, 8D0, and CD0 are allowed. */
- if ((sc->iobase & ~0xC00) != 0xD0) return 0;
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for LAC-98.
- * 0x000, 0x002, 0x004, 0x006, 0x008, 0x00a, 0x00c, 0x00e,
- * 0x100, 0x102, 0x104, 0x106, 0x108, 0x10a, 0x10c, 0x10e,
- * 0x200, 0x202, 0x204, 0x206, 0x208, 0x20a, 0x20c, 0x20e,
- * 0x300, 0x302, 0x304, 0x306, 0x308, 0x30a, 0x30c, 0x30e,
- */
- for (i = 0; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + ((i & 7) << 1) + ((i & 0x18) << 5);
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a LAC-98012/98013 board here.) */
- fe_read_eeprom_lnx(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of TDK/LANX's. */
- if (!valid_Ether_p(eeprom, 0x008098)) return 0;
- bcopy(eeprom, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* Setup the board type. */
- sc->typestr = "LAC-98012/98013";
-
- /* This looks like a TDK/LANX board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3 : sc->priv_info = 0x10 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ5 : sc->priv_info = 0x20 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ6 : sc->priv_info = 0x40 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ12: sc->priv_info = 0x80 | LNX_CLK_LO | LNX_SDA_HI; break;
- default:
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/12");
- return 0;
- }
-
- /* LAC-98's system bus width is 8-bit. */
- sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x2KB
- | FE_D6_BBW_BYTE | FE_D6_SBW_BYTE | FE_D6_SRAM_150ns;
-
- /* Setup hooks. We need a special initialization procedure. */
- sc->init = fe_init_lnx;
-
- /* The I/O address range is fragmented in the LAC-98.
- It occupies 16*4 I/O addresses, by the way. */
- return 16;
-#endif /* FE_8BIT_SUPPORT */
-}
-
-/*
- * Probe for Gateway Communications' old cards.
- * (both as Generic MB86960 probe routine)
- */
-static int
-fe_probe_gwy ( struct isa_device * dev, struct fe_softc * sc )
-{
- static struct fe_simple_probe_struct probe_table [] = {
- /* { FE_DLCR2, 0x70, 0x00 }, */
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* I'm not sure which address is possible, so accepts any. FIXME. */
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Does we need to re-map ioaddr? FIXME. */
-
- /* See if the card is on its address. */
- if ( !fe_simple_probe( sc, probe_table ) ) return 0;
-
- /* Get our station address from EEPROM. */
- inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
- if (!valid_Ether_p(sc->sc_enaddr, 0x000000)) return 0;
-
- /* Determine the card type. */
- sc->typestr = "Generic MB86960 Ethernet";
- if (valid_Ether_p(sc->sc_enaddr, 0x000061))
- sc->typestr = "Gateway Ethernet (Fujitsu chipset)";
-
- /* Gateway's board requires an explicit IRQ to work, since it
- is not possible to probe the setting of jumpers. */
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure(sc->typestr, sc->sc_unit, NO_IRQ, NULL);
- return 0;
- }
-
- /* We should change return value when re-mapping ioaddr. FIXME. */
- return 32;
-}
-
-/*
- * Probe for Ungermann-Bass Access/PC N98C+(Model 85152).
- */
-static int
-fe_probe_ubn (struct isa_device * dev, struct fe_softc * sc)
-{
- u_char sum;
- int i;
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for Access/PC. */
- /* [01][048C]D0 are allowed. */
- if ((sc->iobase & ~0x1C00) != 0xD0) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Re-map ioaddr for Access/PC N98C+.
- * 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007,
- * 0x008, 0x009, 0x00a, 0x00b, 0x00c, 0x00d, 0x00e, 0x00f,
- * 0x200, 0x201, 0x202, 0x203, 0x204, 0x205, 0x206, 0x207,
- * 0x208, 0x209, 0x20a, 0x20b, 0x20c, 0x20d, 0x20e, 0x20f,
- */
- for (i = 16; i < MAXREGISTERS; i++)
- sc->ioaddr[i] = sc->iobase + 0x200 - 16 + i;
-
- /* Simple probe. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address form ID ROM and make sure it is UBN's. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x00DD01)) return 0;
-#if 1
- /* Calculate checksum. */
- sum = inb(sc->ioaddr[0x1e]);
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- sum ^= sc->sc_enaddr[i];
- }
- if (sum != 0) return 0;
-#endif
- /* Setup the board type. */
- sc->typestr = "Access/PC";
-
- /* This looks like an AccessPC/N98C+ board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: sc->priv_info = 0x01; break;
- case IRQ5: sc->priv_info = 0x02; break;
- case IRQ6: sc->priv_info = 0x04; break;
- case IRQ12: sc->priv_info = 0x08; break;
- default:
- fe_irq_failure(sc->typestr,
- sc->sc_unit, dev->id_irq, "3/5/6/12");
- return 0;
- }
-
- /* Setup hooks. We need a special initialization procedure. */
- sc->init = fe_init_ubn;
-
- /* The I/O address range is fragmented in the Access/PC N98C+.
- This is the number of regs at iobase. */
- return 16;
-}
-
-#else /* !PC98 */
-/*
- * Probe and initialization for Fujitsu FMV-180 series boards
- */
+ save16 = inb( sc->ioaddr[ FE_BMPR16 ] );
+ save17 = inb( sc->ioaddr[ FE_BMPR17 ] );
+ fe_read_eeprom( sc, eeprom );
-static void
-fe_init_fmv (struct fe_softc *sc)
-{
- /* Initialize ASIC. */
- outb( sc->ioaddr[ FE_FMV3 ], 0 );
- outb( sc->ioaddr[ FE_FMV10 ], 0 );
+ /* Make sure the EEPROM is turned off. */
+ outb( sc->ioaddr[ FE_BMPR16 ], 0 );
+ outb( sc->ioaddr[ FE_BMPR17 ], 0 );
-#if 0
- /* "Refresh" hardware configuration. FIXME. */
- outb( sc->ioaddr[ FE_FMV2 ], inb( sc->ioaddr[ FE_FMV2 ] ) );
-#endif
-
- /* Turn the "master interrupt control" flag of ASIC on. */
- outb( sc->ioaddr[ FE_FMV3 ], FE_FMV3_IRQENB );
-}
-
-static void
-fe_msel_fmv184 (struct fe_softc *sc)
-{
- u_char port;
-
- /* FMV-184 has a special "register" to switch between AUI/BNC.
- Determine the value to write into the register, based on the
- user-specified media selection. */
- port = (IFM_SUBTYPE(sc->media.ifm_media) == IFM_10_2) ? 0x00 : 0x01;
-
- /* The register is #5 on exntesion register bank...
- (Details of the register layout is not yet discovered.) */
- outb(sc->ioaddr[0x1B], 0x46); /* ??? */
- outb(sc->ioaddr[0x1E], 0x04); /* select ex-reg #4. */
- outb(sc->ioaddr[0x1F], 0xC8); /* ??? */
- outb(sc->ioaddr[0x1E], 0x05); /* select ex-reg #5. */
- outb(sc->ioaddr[0x1F], port); /* Switch the media. */
- outb(sc->ioaddr[0x1E], 0x04); /* select ex-reg #4. */
- outb(sc->ioaddr[0x1F], 0x00); /* ??? */
- outb(sc->ioaddr[0x1B], 0x00); /* ??? */
-
- /* Make sure to select "external tranceiver" on MB86964. */
- outb(sc->ioaddr[FE_BMPR13], sc->proto_bmpr13 | FE_B13_PORT_AUI);
-}
-
-static int
-fe_probe_fmv ( struct isa_device * dev, struct fe_softc * sc )
-{
- int n;
-
- static u_short const irqmap [ 4 ] =
- { IRQ3, IRQ7, IRQ10, IRQ15 };
-
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR2, 0x71, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
-
- { FE_FMV0, 0x78, 0x50 }, /* ERRDY+PRRDY */
- { FE_FMV1, 0xB0, 0x00 }, /* FMV-183/4 has 0x48 bits. */
- { FE_FMV3, 0x7F, 0x00 },
-
- { 0 }
- };
-
- /* Board subtypes; it lists known FMV-180 variants. */
- struct subtype {
- u_short mcode;
- u_short mbitmap;
- u_short defmedia;
- char const * str;
- };
- static struct subtype const typelist [] = {
- { 0x0005, MB_HA|MB_HT|MB_H5, MB_HA, "FMV-181" },
- { 0x0105, MB_HA|MB_HT|MB_H5, MB_HA, "FMV-181A" },
- { 0x0003, MB_HM, MB_HM, "FMV-182" },
- { 0x0103, MB_HM, MB_HM, "FMV-182A" },
- { 0x0804, MB_HT, MB_HT, "FMV-183" },
- { 0x0C04, MB_HT, MB_HT, "FMV-183 (on-board)" },
- { 0x0803, MB_H2|MB_H5, MB_H2, "FMV-184" },
- { 0, MB_HA, MB_HA, "unknown FMV-180 (?)" },
- };
- struct subtype const * type;
-
- /* Media indicator and "Hardware revision ID" */
- u_short mcode;
-
- /* See if the specified address is possible for FMV-180
- series. 220, 240, 260, 280, 2A0, 2C0, 300, and 340 are
- allowed for all boards, and 200, 2E0, 320, 360, 380, 3A0,
- 3C0, and 3E0 for PnP boards. */
- if ((sc->iobase & ~0x1E0) != 0x200) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* Simple probe. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address from EEPROM, and make sure it is
- Fujitsu's. */
- inblk(sc, FE_FMV4, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x00000E)) return 0;
-
- /* Find the supported media and "hardware revision" to know
- the model identification. */
- mcode = (inb(sc->ioaddr[FE_FMV0]) & FE_FMV0_MEDIA)
- | ((inb(sc->ioaddr[FE_FMV1]) & FE_FMV1_REV) << 8);
-
- /* Determine the card type. */
- for (type = typelist; type->mcode != 0; type++) {
- if (type->mcode == mcode) break;
- }
- if (type->mcode == 0) {
- /* Unknown card type... Hope the driver works. */
- sc->stability |= UNSTABLE_TYPE;
- if (bootverbose) {
- printf("fe%d: unknown config: %x-%x-%x-%x\n",
- sc->sc_unit,
- inb(sc->ioaddr[FE_FMV0]),
- inb(sc->ioaddr[FE_FMV1]),
- inb(sc->ioaddr[FE_FMV2]),
- inb(sc->ioaddr[FE_FMV3]));
- }
- }
-
- /* Setup the board type and media information. */
- sc->typestr = type->str;
- sc->mbitmap = type->mbitmap;
- sc->defmedia = type->defmedia;
- sc->msel = fe_msel_965;
-
- if (type->mbitmap == (MB_H2 | MB_H5)) {
- /* FMV184 requires a special media selection procedure. */
- sc->msel = fe_msel_fmv184;
- }
-
- /*
- * An FMV-180 has been probed.
- * Determine which IRQ to be used.
- *
- * In this version, we give a priority to the kernel config file.
- * If the EEPROM and config don't match, say it to the user for
- * an attention.
- */
- n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IRS )
- >> FE_FMV2_IRS_SHIFT;
- if ( dev->id_irq == NO_IRQ ) {
- /* Just use the probed value. */
- dev->id_irq = irqmap[ n ];
- } else if ( dev->id_irq != irqmap[ n ] ) {
- /* Don't match. */
- sc->stability |= UNSTABLE_IRQ;
+ /* Make sure that config info in EEPROM and 86965 agree. */
+ if ( eeprom[ FE_EEPROM_CONF ] != inb( sc->ioaddr[ FE_BMPR19 ] ) ) {
+ goto NOTFOUND;
}
- /* We need an init hook to initialize ASIC before we start. */
- sc->init = fe_init_fmv;
-
- /*
- * That's all. FMV-180 occupies 32 I/O addresses, by the way.
- */
- return 32;
-}
-
-/*
- * Fujitsu MB86965 JLI mode probe routines.
- *
- * 86965 has a special operating mode called JLI (mode 0), under which
- * the chip interfaces with ISA bus with a software-programmable
- * configuration. (The Fujitsu document calls the feature "Plug and
- * play," but it is not compatible with the ISA-PnP spec. designed by
- * Intel and Microsoft.) Ethernet cards designed to use JLI are
- * almost same, but there are two things which require board-specific
- * probe routines: EEPROM layout and IRQ pin connection.
- *
- * JLI provides a handy way to access EEPROM which should contains the
- * chip configuration information (such as I/O port address) as well
- * as Ethernet station (MAC) address. The chip configuration info. is
- * stored on a fixed location. However, the station address can be
- * located anywhere in the EEPROM; it is up to the board designer to
- * determine the location. (The manual just says "somewhere in the
- * EEPROM.") The fe driver must somehow find out the correct
- * location.
- *
- * Another problem resides in the IRQ pin connection. JLI provides a
- * user to choose an IRQ from up to four predefined IRQs. The 86965
- * chip has a register to select one out of the four possibilities.
- * However, the selection is against the four IRQ pins on the chip.
- * (So-called IRQ-A, -B, -C and -D.) It is (again) up to the board
- * designer to determine which pin to connect which IRQ line on the
- * ISA bus. We need a vendor (or model, for some vendor) specific IRQ
- * mapping table.
- *
- * The routine fe_probe_jli() provides all probe and initialization
- * processes which are common to all JLI implementation, and sub-probe
- * routines supply board-specific actions.
- *
- * JLI sub-probe routine has the following template:
- *
- * u_short const * func (struct fe_softc * sc, u_char const * eeprom);
- *
- * where eeprom is a pointer to an array of 32 byte data read from the
- * config EEPROM on the board. It retuns an IRQ mapping table for the
- * board, when the corresponding implementation is detected. It
- * returns a NULL otherwise.
- *
- * Primary purpose of the functin is to analize the config EEPROM,
- * determine if it matches with the pattern of that of supported card,
- * and extract necessary information from it. One of the information
- * expected to be extracted from EEPROM is the Ethernet station (MAC)
- * address, which must be set to the softc table of the interface by
- * the board-specific routine.
- */
-
-/* JLI sub-probe for Allied-Telesyn/Allied-Telesis AT1700/RE2000 series. */
-static u_short const *
-fe_probe_jli_ati (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- static u_short const irqmaps_ati [4][4] =
- {
- { IRQ3, IRQ4, IRQ5, IRQ9 },
- { IRQ10, IRQ11, IRQ12, IRQ15 },
- { IRQ3, IRQ11, IRQ5, IRQ15 },
- { IRQ10, IRQ11, IRQ14, IRQ15 },
- };
-
- /* Make sure the EEPROM contains Allied-Telesis/Allied-Telesyn
- bit pattern. */
- if (eeprom[1] != 0x00) return NULL;
- for (i = 2; i < 8; i++) if (eeprom[i] != 0xFF) return NULL;
- for (i = 14; i < 24; i++) if (eeprom[i] != 0xFF) return NULL;
-
- /* Get our station address from EEPROM, and make sure the
- EEPROM contains ATI's address. */
- bcopy(eeprom+8, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x0000F4)) return NULL;
-
/*
- * The following model identification codes are stolen
+ * The following model identification codes are stolen from
* from the NetBSD port of the fe driver. My reviewers
* suggested minor revision.
*/
@@ -1891,604 +971,222 @@ fe_probe_jli_ati (struct fe_softc * sc, u_char const * eeprom)
switch (eeprom[FE_ATI_EEP_MODEL]) {
case FE_ATI_MODEL_AT1700T:
sc->typestr = "AT-1700T/RE2001";
- sc->mbitmap = MB_HT;
- sc->defmedia = MB_HT;
break;
case FE_ATI_MODEL_AT1700BT:
sc->typestr = "AT-1700BT/RE2003";
- sc->mbitmap = MB_HA | MB_HT | MB_H2;
break;
case FE_ATI_MODEL_AT1700FT:
sc->typestr = "AT-1700FT/RE2009";
- sc->mbitmap = MB_HA | MB_HT | MB_HF;
break;
case FE_ATI_MODEL_AT1700AT:
sc->typestr = "AT-1700AT/RE2005";
- sc->mbitmap = MB_HA | MB_HT | MB_H5;
break;
default:
- sc->typestr = "unknown AT-1700/RE2000";
- sc->stability |= UNSTABLE_TYPE | UNSTABLE_IRQ;
+ sc->typestr = "unknown AT-1700/RE2000 ?";
break;
}
-#if 0
- /* Should we extract default media from eeprom? Linux driver
- for AT1700 does it, although previous releases of FreeBSD
- don't. FIXME. */
- /* Determine the default media selection from the config
- EEPROM. The byte at offset EEP_MEDIA is believed to
- contain BMPR13 value to be set. We just ignore STP bit or
- squelch bit, since we don't support those. (It is
- intentional.) */
- switch (eeprom[FE_ATI_EEP_MEDIA] & FE_B13_PORT) {
- case FE_B13_AUTO:
- sc->defmedia = MB_HA;
- break;
- case FE_B13_TP:
- sc->defmedia = MB_HT;
- break;
- case FE_B13_AUI:
- sc->defmedia = sc->mbitmap & (MB_H2|MB_H5|MB_H5); /*XXX*/
- break;
- default:
- sc->defmedia = MB_HA;
- break;
- }
-
- /* Make sure the default media is compatible with the supported
- ones. */
- if ((sc->defmedia & sc->mbitmap) == 0) {
- if (sc->defmedia == MB_HA) {
- sc->defmedia = MB_HT;
- } else {
- sc->defmedia = MB_HA;
- }
- }
-#endif
-
/*
* Try to determine IRQ settings.
* Different models use different ranges of IRQs.
*/
- switch ((eeprom[FE_ATI_EEP_REVISION] & 0xf0)
- |(eeprom[FE_ATI_EEP_MAGIC] & 0x04)) {
- case 0x30: case 0x34: return irqmaps_ati[3];
- case 0x10: case 0x14:
- case 0x50: case 0x54: return irqmaps_ati[2];
- case 0x44: case 0x64: return irqmaps_ati[1];
- default: return irqmaps_ati[0];
- }
-}
-
-/* JLI sub-probe and msel hook for ICL Ethernet. */
-
-static void
-fe_msel_icl (struct fe_softc *sc)
-{
- u_char d4;
-
- /* Switch between UTP and "external tranceiver" as always. */
- fe_msel_965(sc);
-
- /* The board needs one more bit (on DLCR4) be set appropriately. */
- if (IFM_SUBTYPE(sc->media.ifm_media) == IFM_10_5) {
- d4 = sc->proto_dlcr4 | FE_D4_CNTRL;
- } else {
- d4 = sc->proto_dlcr4 & ~FE_D4_CNTRL;
- }
- outb(sc->ioaddr[FE_DLCR4], d4);
-}
-
-static u_short const *
-fe_probe_jli_icl (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- u_short defmedia;
- u_char d6;
- static u_short const irqmap_icl [4] = { IRQ9, IRQ10, IRQ5, IRQ15 };
-
- /* Make sure the EEPROM contains ICL bit pattern. */
- for (i = 24; i < 39; i++) {
- if (eeprom[i] != 0x20 && (eeprom[i] & 0xF0) != 0x30) return NULL;
- }
- for (i = 112; i < 122; i++) {
- if (eeprom[i] != 0x20 && (eeprom[i] & 0xF0) != 0x30) return NULL;
- }
-
- /* Make sure the EEPROM contains ICL's permanent station
- address. If it isn't, probably this board is not an
- ICL's. */
- if (!valid_Ether_p(eeprom+122, 0x00004B)) return NULL;
-
- /* Check if the "configured" Ethernet address in the EEPROM is
- valid. Use it if it is, or use the "permanent" address instead. */
- if (valid_Ether_p(eeprom+4, 0x020000)) {
- /* The configured address is valid. Use it. */
- bcopy(eeprom+4, sc->sc_enaddr, ETHER_ADDR_LEN);
- } else {
- /* The configured address is invalid. Use permanent. */
- bcopy(eeprom+122, sc->sc_enaddr, ETHER_ADDR_LEN);
- }
-
- /* Determine model and supported media. */
- switch (eeprom[0x5E]) {
- case 0:
- sc->typestr = "EtherTeam16i/COMBO";
- sc->mbitmap = MB_HA | MB_HT | MB_H5 | MB_H2;
- break;
- case 1:
- sc->typestr = "EtherTeam16i/TP";
- sc->mbitmap = MB_HT;
- break;
- case 2:
- sc->typestr = "EtherTeam16i/ErgoPro";
- sc->mbitmap = MB_HA | MB_HT | MB_H5;
- break;
- case 4:
- sc->typestr = "EtherTeam16i/DUO";
- sc->mbitmap = MB_HA | MB_HT | MB_H2;
- break;
- default:
- sc->typestr = "EtherTeam16i";
- sc->stability |= UNSTABLE_TYPE;
- if (bootverbose) {
- printf("fe%d: unknown model code %02x for EtherTeam16i\n",
- sc->sc_unit, eeprom[0x5E]);
- }
- break;
- }
-
- /* I'm not sure the following msel hook is required by all
- models or COMBO only... FIXME. */
- sc->msel = fe_msel_icl;
-
- /* Make the configured media selection the default media. */
- switch (eeprom[0x28]) {
- case 0: defmedia = MB_HA; break;
- case 1: defmedia = MB_H5; break;
- case 2: defmedia = MB_HT; break;
- case 3: defmedia = MB_H2; break;
- default:
- if (bootverbose) {
- printf("fe%d: unknown default media: %02x\n",
- sc->sc_unit, eeprom[0x28]);
- }
- defmedia = MB_HA;
- break;
- }
-
- /* Make sure the default media is compatible with the
- supported media. */
- if ((defmedia & sc->mbitmap) == 0) {
- if (bootverbose) {
- printf("fe%d: default media adjusted\n", sc->sc_unit);
- }
- defmedia = sc->mbitmap;
- }
-
- /* Keep the determined default media. */
- sc->defmedia = defmedia;
-
- /* ICL has "fat" models. We have to program 86965 to properly
- reflect the hardware. */
- d6 = sc->proto_dlcr6 & ~(FE_D6_BUFSIZ | FE_D6_BBW);
- switch ((eeprom[0x61] << 8) | eeprom[0x60]) {
- case 0x2008: d6 |= FE_D6_BUFSIZ_32KB | FE_D6_BBW_BYTE; break;
- case 0x4010: d6 |= FE_D6_BUFSIZ_64KB | FE_D6_BBW_WORD; break;
- default:
- /* We can't support it, since we don't know which bits
- to set in DLCR6. */
- printf("fe%d: unknown SRAM config for ICL\n", sc->sc_unit);
- return NULL;
- }
- sc->proto_dlcr6 = d6;
-
- /* Returns the IRQ table for the ICL board. */
- return irqmap_icl;
-}
-
-/* JLI sub-probe for RATOC REX-5586/5587. */
-static u_short const *
-fe_probe_jli_rex (struct fe_softc * sc, u_char const * eeprom)
-{
- int i;
- static u_short const irqmap_rex [4] = { IRQ3, IRQ4, IRQ5, NO_IRQ };
-
- /* Make sure the EEPROM contains RATOC's config pattern. */
- if (eeprom[1] != eeprom[0]) return NULL;
- for (i = 8; i < 32; i++) if (eeprom[i] != 0xFF) return NULL;
-
- /* Get our station address from EEPROM. Note that RATOC
- stores it "byte-swapped" in each word. (I don't know why.)
- So, we just can't use bcopy().*/
- sc->sc_enaddr[0] = eeprom[3];
- sc->sc_enaddr[1] = eeprom[2];
- sc->sc_enaddr[2] = eeprom[5];
- sc->sc_enaddr[3] = eeprom[4];
- sc->sc_enaddr[4] = eeprom[7];
- sc->sc_enaddr[5] = eeprom[6];
-
- /* Make sure the EEPROM contains RATOC's station address. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x00C0D0)) return NULL;
-
- /* I don't know any sub-model identification. */
- sc->typestr = "REX-5586/5587";
-
- /* Returns the IRQ for the RATOC board. */
- return irqmap_rex;
-}
-
-/* JLI sub-probe for Unknown board. */
-static u_short const *
-fe_probe_jli_unk (struct fe_softc * sc, u_char const * eeprom)
-{
- int i, n, romsize;
- static u_short const irqmap [4] = { NO_IRQ, NO_IRQ, NO_IRQ, NO_IRQ };
-
- /* The generic JLI probe considered this board has an 86965
- in JLI mode, but any other board-specific routines could
- not find the matching implementation. So, we "guess" the
- location by looking for a bit pattern which looks like a
- MAC address. */
-
- /* Determine how large the EEPROM is. */
- for (romsize = JLI_EEPROM_SIZE/2; romsize > 16; romsize >>= 1) {
- for (i = 0; i < romsize; i++) {
- if (eeprom[i] != eeprom[i+romsize]) break;
+ if ( dev->id_irq == NO_IRQ ) {
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_IRQ )
+ >> FE_B19_IRQ_SHIFT;
+ switch ( eeprom[ FE_ATI_EEP_REVISION ] & 0xf0 ) {
+ case 0x30:
+ dev->id_irq = irqmaps[ 3 ][ n ];
+ break;
+ case 0x10:
+ case 0x50:
+ dev->id_irq = irqmaps[ 2 ][ n ];
+ break;
+ case 0x40:
+ case 0x60:
+ if ( eeprom[ FE_ATI_EEP_MAGIC ] & 0x04 ) {
+ dev->id_irq = irqmaps[ 1 ][ n ];
+ } else {
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ }
+ break;
+ default:
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ break;
}
- if (i < romsize) break;
}
- romsize <<= 1;
-
- /* Look for a bit pattern which looks like a MAC address. */
- for (n = 2; n <= romsize - ETHER_ADDR_LEN; n += 2) {
- if (!valid_Ether_p(eeprom + n, 0x000000)) continue;
- }
-
- /* If no reasonable address was found, we can't go further. */
- if (n > romsize - ETHER_ADDR_LEN) return NULL;
- /* Extract our (guessed) station address. */
- bcopy(eeprom+n, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* We are not sure what type of board it is... */
- sc->typestr = "(unknown JLI)";
- sc->stability |= UNSTABLE_TYPE | UNSTABLE_MAC;
-
- /* Returns the totally unknown IRQ mapping table. */
- return irqmap;
-}
-
-/*
- * Probe and initialization for all JLI implementations.
- */
-
-static int
-fe_probe_jli (struct isa_device * dev, struct fe_softc * sc)
-{
- int i, n;
- int irq;
- u_char eeprom [JLI_EEPROM_SIZE];
- u_short const * irqmap;
-
- static u_short const baseaddr [8] =
- { 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300 };
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR1, 0x20, 0x00 },
- { FE_DLCR2, 0x50, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { FE_DLCR5, 0x80, 0x00 },
-#if 0
- { FE_BMPR16, 0x1B, 0x00 },
- { FE_BMPR17, 0x7F, 0x00 },
-#endif
- { 0 }
- };
/*
- * See if the specified address is possible for MB86965A JLI mode.
+ * Initialize constants in the per-line structure.
*/
- for (i = 0; i < 8; i++) {
- if (baseaddr[i] == sc->iobase) break;
- }
- if (i == 8) return 0;
- /* Fill the softc struct with reasonable default. */
- fe_softc_defaults(sc);
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_ATI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+#if 1
/*
- * We should test if MB86965A is on the base address now.
- * Unfortunately, it is very hard to probe it reliably, since
- * we have no way to reset the chip under software control.
- * On cold boot, we could check the "signature" bit patterns
- * described in the Fujitsu document. On warm boot, however,
- * we can predict almost nothing about register values.
+ * This test doesn't work well for AT1700 look-alike by
+ * other vendors.
*/
- if (!fe_simple_probe(sc, probe_table)) return 0;
+ /* Make sure the vendor part is for Allied-Telesis. */
+ if ( sc->sc_enaddr[ 0 ] != 0x00
+ || sc->sc_enaddr[ 1 ] != 0x00
+ || sc->sc_enaddr[ 2 ] != 0xF4 ) return 0;
- /* Check if our I/O address matches config info on 86965. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_ADDR) >> FE_B19_ADDR_SHIFT;
- if (baseaddr[n] != sc->iobase) return 0;
+#else
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+#endif
/*
- * We are now almost sure we have an MB86965 at the given
- * address. So, read EEPROM through it. We have to write
- * into LSI registers to read from EEPROM. I want to avoid it
- * at this stage, but I cannot test the presence of the chip
- * any further without reading EEPROM. FIXME.
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
*/
- fe_read_eeprom_jli(sc, eeprom);
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+#if 0 /* XXXX Should we use this? FIXME. */
+ sc->proto_bmpr13 = eeprom[ FE_ATI_EEP_MEDIA ];
+#else
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+#endif
- /* Make sure that config info in EEPROM and 86965 agree. */
- if (eeprom[FE_EEPROM_CONF] != inb(sc->ioaddr[FE_BMPR19])) {
- return 0;
- }
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "ATI found" );
+#endif
- /* Use 86965 media selection scheme, unless othewise
- specified. It is "AUTO always" and "select with BMPR13."
- This behaviour covers most of the 86965 based board (as
- minimum requirements.) It is backward compatible with
- previous versions, also. */
- sc->mbitmap = MB_HA;
- sc->defmedia = MB_HA;
- sc->msel = fe_msel_965;
-
- /* Perform board-specific probe, one by one. Note that the
- order of probe is important and should not be changed
- arbitrarily. */
- if ((irqmap = fe_probe_jli_ati(sc, eeprom)) == NULL
- && (irqmap = fe_probe_jli_rex(sc, eeprom)) == NULL
- && (irqmap = fe_probe_jli_icl(sc, eeprom)) == NULL
- && (irqmap = fe_probe_jli_unk(sc, eeprom)) == NULL) return 0;
-
- /* Find the IRQ read from EEPROM. */
- n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_IRQ) >> FE_B19_IRQ_SHIFT;
- irq = irqmap[n];
-
- /* Try to determine IRQ setting. */
- if (dev->id_irq == NO_IRQ && irq == NO_IRQ) {
- /* The device must be configured with an explicit IRQ. */
- printf("fe%d: IRQ auto-detection does not work\n",
- sc->sc_unit);
- return 0;
- } else if (dev->id_irq == NO_IRQ && irq != NO_IRQ) {
- /* Just use the probed IRQ value. */
- dev->id_irq = irq;
- } else if (dev->id_irq != NO_IRQ && irq == NO_IRQ) {
- /* No problem. Go ahead. */
- } else if (dev->id_irq == irq) {
- /* Good. Go ahead. */
- } else {
- /* User must be warned in this case. */
- sc->stability |= UNSTABLE_IRQ;
- }
+ /* Setup hooks. This may solves a nasty bug. FIXME. */
+ sc->init = fe_init_ati;
- /* Setup a hook, which resets te 86965 when the driver is being
- initialized. This may solve a nasty bug. FIXME. */
- sc->init = fe_init_jli;
+ /* Initialize 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_ati()" );
+#endif
/*
- * That's all. 86965 JLI occupies 32 I/O addresses, by the way.
+ * That's all. AT1700 occupies 32 I/O addresses, by the way.
*/
return 32;
-}
-
-/* Probe for TDK LAK-AX031, which is an SSi 78Q8377A based board. */
-
-static int
-fe_probe_ssi (struct isa_device *dev, struct fe_softc *sc)
-{
- u_char eeprom [SSI_EEPROM_SIZE];
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x08, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for 78Q8377A. */
- if ((sc->iobase & ~0x3F0) != 0x000) return 0;
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a LAK-AX031 board here.) Don't
- remember to select BMPRs bofore reading EEPROM, since other
- register bank may be selected before the probe() is called. */
- fe_read_eeprom_ssi(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of TDK's. */
- if (!valid_Ether_p(eeprom+FE_SSI_EEP_ADDR, 0x008098)) return 0;
- bcopy(eeprom+FE_SSI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* This looks like a TDK-AX031 board. It requires an explicit
- IRQ setting in config, since we currently don't know how we
- can find the IRQ value assigned by ISA PnP manager. */
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure("LAK-AX031", sc->sc_unit, dev->id_irq, NULL);
- return 0;
+ NOTFOUND:
+ /*
+ * We have no AT1700 at a given address.
+ * Restore BMPR16 and BMPR17 if we have destroyed them,
+ * hoping that the hardware on the address didn't get
+ * bad side effect.
+ */
+ if ( save16 != 0 | save17 != 0 ) {
+ outb( sc->ioaddr[ FE_BMPR16 ], save16 );
+ outb( sc->ioaddr[ FE_BMPR17 ], save17 );
}
-
- /* Fill softc struct accordingly. */
- sc->typestr = "LAK-AX031";
- sc->mbitmap = MB_HT;
- sc->defmedia = MB_HT;
-
- /* We have 16 registers. */
- return 16;
+ return ( 0 );
}
-/*
- * Probe and initialization for TDK/LANX LAC-AX012/013 boards.
- */
-static int
-fe_probe_lnx (struct isa_device *dev, struct fe_softc *sc)
+/* ATI specific initialization routine. */
+static void
+fe_init_ati ( struct fe_softc * sc )
{
- u_char eeprom [LNX_EEPROM_SIZE];
-
- static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for TDK/LANX boards. */
- /* 300, 320, 340, and 360 are allowed. */
- if ((sc->iobase & ~0x060) != 0x300) return 0;
-
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
+/*
+ * I've told that the following operation "Resets" the chip.
+ * Hope this solve a bug which hangs up the driver under
+ * heavy load... FIXME.
+ */
- /* See if the card is on its address. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* We now have to read the config EEPROM. We should be very
- careful, since doing so destroys a register. (Remember, we
- are not yet sure we have a LAC-AX012/AX013 board here.) */
- fe_read_eeprom_lnx(sc, eeprom);
-
- /* Make sure the Ethernet (MAC) station address is of TDK/LANX's. */
- if (!valid_Ether_p(eeprom, 0x008098)) return 0;
- bcopy(eeprom, sc->sc_enaddr, ETHER_ADDR_LEN);
-
- /* This looks like a TDK/LANX board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: sc->priv_info = 0x40 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ4: sc->priv_info = 0x20 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ5: sc->priv_info = 0x10 | LNX_CLK_LO | LNX_SDA_HI; break;
- case IRQ9: sc->priv_info = 0x80 | LNX_CLK_LO | LNX_SDA_HI; break;
- default:
- fe_irq_failure("LAC-AX012/AX013",
- sc->sc_unit, dev->id_irq, "3/4/5/9");
- return 0;
- }
+ /* Minimal initialization of 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
- /* Fill softc struct accordingly. */
- sc->typestr = "LAC-AX012/AX013";
- sc->init = fe_init_lnx;
+ /* "Reset" by wrting into an undocument register location. */
+ outb( sc->ioaddr[ 0x1F ], 0 );
- /* We have 32 registers. */
- return 32;
+ /* How long do we have to wait after the reset? FIXME. */
+ DELAY( 300 );
}
/*
* Probe and initialization for Gateway Communications' old cards.
*/
static int
-fe_probe_gwy ( struct isa_device * dev, struct fe_softc * sc )
+fe_probe_gwy ( DEVICE * dev, struct fe_softc * sc )
{
+ int i;
+
static struct fe_simple_probe_struct probe_table [] = {
- /* { FE_DLCR2, 0x70, 0x00 }, */
- { FE_DLCR2, 0x58, 0x00 },
+ { FE_DLCR2, 0x70, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR7, 0xC0, 0x00 },
+ /*
+ * Test *vendor* part of the address for Gateway.
+ * This test is essential to identify Gateway's cards.
+ * We shuld define some symbolic names for the
+ * following offsets. FIXME.
+ */
+ { 0x18, 0xFF, 0x00 },
+ { 0x19, 0xFF, 0x00 },
+ { 0x1A, 0xFF, 0x61 },
{ 0 }
};
- /* See if the specified I/O address is possible for Gateway boards. */
- if ((sc->iobase & ~0x1E0) != 0x200) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
-
- /* See if the card is on its address. */
- if ( !fe_simple_probe( sc, probe_table ) ) return 0;
-
- /* Get our station address from EEPROM. */
- inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
-
- /* Make sure it is Gateway Communication's. */
- if (!valid_Ether_p(sc->sc_enaddr, 0x000061)) return 0;
-
- /* Gateway's board requires an explicit IRQ to work, since it
- is not possible to probe the setting of jumpers. */
- if (dev->id_irq == NO_IRQ) {
- fe_irq_failure("Gateway Ethernet", sc->sc_unit, NO_IRQ, NULL);
- return 0;
+ /*
+ * We need explicit IRQ and supported address.
+ * I'm not sure which address and IRQ is possible for Gateway
+ * Ethernet family. The following accepts everything. FIXME.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
}
- /* Fill softc struct accordingly. */
- sc->typestr = "Gateway Ethernet (Fujitsu chipset)";
-
- /* That's all. The card occupies 32 I/O addresses, as always. */
- return 32;
-}
-
-/* Probe and initialization for Ungermann-Bass Network
- K.K. "Access/PC" boards. */
-static int
-fe_probe_ubn (struct isa_device * dev, struct fe_softc * sc)
-{
-#if 0
- u_char sum;
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
#endif
- static struct fe_simple_probe_struct const probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
- { FE_DLCR4, 0x08, 0x00 },
- { 0 }
- };
-
- /* See if the specified I/O address is possible for AccessPC/ISA. */
- if ((sc->iobase & ~0x0E0) != 0x300) return 0;
-
- /* Setup an I/O address mapping table and some others. */
- fe_softc_defaults(sc);
- /* Simple probe. */
- if (!fe_simple_probe(sc, probe_table)) return 0;
-
- /* Get our station address form ID ROM and make sure it is UBN's. */
- inblk(sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN);
- if (!valid_Ether_p(sc->sc_enaddr, 0x00DD01)) return 0;
-#if 0
- /* Calculate checksum. */
- sum = inb(sc->ioaddr[0x1e]);
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- sum ^= sc->sc_enaddr[i];
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
}
- if (sum != 0) return 0;
-#endif
- /* This looks like an AccessPC/ISA board. It requires an
- explicit IRQ setting in config. Make sure we have one,
- determining an appropriate value for the IRQ control
- register. */
- switch (dev->id_irq) {
- case IRQ3: sc->priv_info = 0x02; break;
- case IRQ4: sc->priv_info = 0x04; break;
- case IRQ5: sc->priv_info = 0x08; break;
- case IRQ10: sc->priv_info = 0x10; break;
- default:
- fe_irq_failure("Access/PC",
- sc->sc_unit, dev->id_irq, "3/4/5/10");
+
+ /* See if the card is on its address. */
+ if ( !fe_simple_probe( sc, probe_table ) ) {
return 0;
}
- /* Fill softc struct accordingly. */
- sc->typestr = "Access/PC";
- sc->init = fe_init_ubn;
+ /* Determine the card type. */
+ sc->typestr = "Gateway Ethernet w/ Fujitsu chipset";
- /* We have 32 registers. */
- return 32;
-}
-#endif /* PC98 */
+ /* Get our station address from EEPROM. */
+ inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
-#if NCARD > 0
-/*
- * Probe and initialization for Fujitsu MBH10302 PCMCIA Ethernet interface.
- * Note that this is for 10302 only; MBH10304 is handled by fe_probe_tdk().
- */
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 16KB, 100ns, byte-wide access.
+ * Transmission buffer: 2KB x 2.
+ * System bus interface: 16 bits.
+ * Make sure to clear out ID bits in DLCR7
+ * (They actually are Encoder/Decoder control in NICE.)
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_16KB | FE_D6_TXBSIZ_2x2KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
+ sc->proto_bmpr13 = 0;
-static void
-fe_init_mbh ( struct fe_softc * sc )
-{
/* Minimal initialization of 86960. */
DELAY( 200 );
outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
@@ -2498,63 +1196,142 @@ fe_init_mbh ( struct fe_softc * sc )
outb( sc->ioaddr[ FE_DLCR2 ], 0 );
outb( sc->ioaddr[ FE_DLCR3 ], 0 );
- /* Enable master interrupt flag. */
- outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_ENABLE );
+ /* That's all. The card occupies 32 I/O addresses, as always. */
+ return 32;
}
+#if NCARD > 0
+/*
+ * Probe and initialization for Fujitsu MBH10302 PCMCIA Ethernet interface.
+ * Note that this is for 10302 only; MBH10304 is handled by fe_probe_tdk().
+ */
static int
-fe_probe_mbh ( struct isa_device * dev, struct fe_softc * sc )
+fe_probe_mbh ( DEVICE * dev, struct fe_softc * sc )
{
+ int i,type;
+
static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x58, 0x00 },
+ { FE_DLCR0, 0x09, 0x00 },
+ { FE_DLCR2, 0x79, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
{ FE_DLCR6, 0xFF, 0xB6 },
+ /*
+ * The following location has the first byte of the card's
+ * Ethernet (MAC) address.
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "global" and "unicast" for any vendors'.
+ */
+ { FE_MBH10, 0x03, 0x00 },
+
+ /* Just a gap? Seems reliable, anyway. */
+ { 0x12, 0xFF, 0x00 },
+ { 0x13, 0xFF, 0x00 },
+ { 0x14, 0xFF, 0x00 },
+ { 0x15, 0xFF, 0x00 },
+ { 0x16, 0xFF, 0x00 },
+ { 0x17, 0xFF, 0x00 },
+#if 0
+ { 0x18, 0xFF, 0xFF },
+ { 0x19, 0xFF, 0xFF },
+#endif
+
{ 0 }
};
-#ifdef DIAGNOSTIC
- /* We need an explicit IRQ. */
- if (dev->id_irq == NO_IRQ) return 0;
+ /*
+ * We need explicit IRQ and supported address.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
#endif
- /* Ethernet MAC address should *NOT* have been given by pccardd,
- if this is a true MBH10302; i.e., Ethernet address must be
- "all-zero" upon entry. */
- if (sc->sc_enaddr[0] || sc->sc_enaddr[1] || sc->sc_enaddr[2] ||
- sc->sc_enaddr[3] || sc->sc_enaddr[4] || sc->sc_enaddr[5]) {
- return 0;
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
}
- /* Fill the softc struct with default values. */
- fe_softc_defaults(sc);
-
/*
* See if MBH10302 is on its address.
* I'm not sure the following probe code works. FIXME.
*/
if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+ /* Determine the card type. */
+ sc->typestr = "MBH10302 (PCMCIA)";
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
/* Get our station address from EEPROM. */
inblk( sc, FE_MBH10, sc->sc_enaddr, ETHER_ADDR_LEN );
/* Make sure we got a valid station address. */
- if (!valid_Ether_p(sc->sc_enaddr, 0)) return 0;
+ if ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) return 0;
- /* Determine the card type. */
- sc->typestr = "MBH10302 (PCMCIA)";
-
- /* We seems to need our own IDENT bits... FIXME. */
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
/* Setup hooks. We need a special initialization procedure. */
sc->init = fe_init_mbh;
/*
+ * Minimum initialization.
+ */
+
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if 1 /* FIXME. */
+ /* Initialize system bus interface and encoder/decoder operation. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_DISABLE );
+#endif
+
+ /*
* That's all. MBH10302 occupies 32 I/O addresses, by the way.
*/
return 32;
}
+/* MBH specific initialization routine. */
+static void
+fe_init_mbh ( struct fe_softc * sc )
+{
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* Enable master interrupt flag. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_ENABLE );
+}
+
/*
* Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface.
* by MASUI Kenji <masui@cs.titech.ac.jp>
@@ -2562,24 +1339,41 @@ fe_probe_mbh ( struct isa_device * dev, struct fe_softc * sc )
* (Contec uses TDK Ethenet chip -- hosokawa)
*
* This version of fe_probe_tdk has been rewrote to handle
- * *generic* PC card implementation of Fujitsu MB8696x family. The
- * name _tdk is just for a historical reason. :-)
+ * *generic* PC card implementation of Fujitsu MB8696x and compatibles.
+ * The name _tdk is just for a historical reason. <seki> :-)
*/
static int
-fe_probe_tdk ( struct isa_device * dev, struct fe_softc * sc )
+fe_probe_tdk ( DEVICE * dev, struct fe_softc * sc )
{
+ int i;
+
static struct fe_simple_probe_struct probe_table [] = {
- { FE_DLCR2, 0x50, 0x00 },
+ { FE_DLCR2, 0x70, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
/* { FE_DLCR5, 0x80, 0x00 }, Does not work well. */
{ 0 }
};
+ /* We need an IRQ. */
if ( dev->id_irq == NO_IRQ ) {
return ( 0 );
}
- fe_softc_defaults(sc);
+ /* Generic driver needs Ethernet address taken from CIS. */
+ if (sc->arpcom.ac_enaddr[0] == 0
+ && sc->arpcom.ac_enaddr[1] == 0
+ && sc->arpcom.ac_enaddr[2] == 0) {
+ return 0;
+ }
+
+ /* Setup an I/O address mapping table; we need only 16 ports. */
+ for (i = 0; i < 16; i++) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ /* Fill unused slots with a safe address. */
+ for (i = 16; i < MAXREGISTERS; i++) {
+ sc->ioaddr[i] = sc->iobase;
+ }
/*
* See if C-NET(PC)C is on its address.
@@ -2588,19 +1382,56 @@ fe_probe_tdk ( struct isa_device * dev, struct fe_softc * sc )
if ( !fe_simple_probe( sc, probe_table ) ) return 0;
/* Determine the card type. */
- sc->typestr = "Generic MB8696x/78Q837x Ethernet (PCMCIA)";
+ sc->typestr = "Generic MB8696x Ethernet (PCMCIA)";
/*
* Initialize constants in the per-line structure.
*/
- /* Make sure we got a valid station address. */
- if (!valid_Ether_p(sc->sc_enaddr, 0)) return 0;
+ /* The station address *must*be* already in sc_enaddr;
+ Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
/*
- * That's all. C-NET(PC)C occupies 16 I/O addresses.
- * XXX: Are there any card with 32 I/O addresses? FIXME.
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * XXX: Should we remove IDENT_NICE from DLCR7? Or,
+ * even add IDENT_EC instead? FIXME.
*/
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /* Minimul initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /*
+ * That's all. C-NET(PC)C occupies 16 I/O addresses.
+ *
+ * Some PC cards (e.g., TDK and Contec) have 16 I/O addresses,
+ * while some others (e.g., Fujitsu) have 32. Fortunately,
+ * this generic driver never accesses latter 16 ports in 32
+ * ports cards. So, we can assume the *generic* PC cards
+ * always have 16 ports.
+ *
+ * Moreover, PC card probe is isolated from ISA probe, and PC
+ * card probe routine doesn't use "# of ports" returned by this
+ * function. 16 v.s. 32 is not important now.
+ */
return 16;
}
#endif /* NCARD > 0 */
@@ -2609,15 +1440,12 @@ fe_probe_tdk ( struct isa_device * dev, struct fe_softc * sc )
* Install interface into kernel networking data structures
*/
static int
-fe_attach ( struct isa_device * dev )
+fe_attach ( DEVICE * dev )
{
#if NCARD > 0
static int already_ifattach[NFE];
#endif
struct fe_softc *sc = &fe_softc[dev->id_unit];
- int b;
-
- dev->id_ointr = feintr;
/*
* Initialize ifnet structure
@@ -2629,20 +1457,12 @@ fe_attach ( struct isa_device * dev )
sc->sc_if.if_start = fe_start;
sc->sc_if.if_ioctl = fe_ioctl;
sc->sc_if.if_watchdog = fe_watchdog;
- sc->sc_if.if_init = fe_init;
- sc->sc_if.if_linkmib = &sc->mibdata;
- sc->sc_if.if_linkmiblen = sizeof (sc->mibdata);
-
-#if 0 /* I'm not sure... */
- sc->mibdata.dot3Compliance = DOT3COMPLIANCE_COLLS;
-#endif
/*
- * Set fixed interface flags.
+ * Set default interface flags.
*/
sc->sc_if.if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-#if 1
/*
* Set maximum size of output queue, if it has not been set.
* It is done here as this driver may be started after the
@@ -2656,6 +1476,9 @@ fe_attach ( struct isa_device * dev )
if ( sc->sc_if.if_snd.ifq_maxlen == 0 ) {
sc->sc_if.if_snd.ifq_maxlen = ifqmaxlen;
}
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "attach()" );
#endif
#if FE_SINGLE_TRANSMISSION
@@ -2676,33 +1499,16 @@ fe_attach ( struct isa_device * dev )
case FE_D6_TXBSIZ_2x8KB: sc->txb_size = 8192; break;
default:
/* Oops, we can't work with single buffer configuration. */
- if (bootverbose) {
- printf("fe%d: strange TXBSIZ config; fixing\n",
- sc->sc_unit);
- }
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: strange TXBSIZ config; fixing\n",
+ sc->sc_unit );
+#endif
sc->proto_dlcr6 &= ~FE_D6_TXBSIZ;
sc->proto_dlcr6 |= FE_D6_TXBSIZ_2x2KB;
sc->txb_size = 2048;
break;
}
- /* Initialize the if_media interface. */
- ifmedia_init(&sc->media, 0, fe_medchange, fe_medstat );
- for (b = 0; bit2media[b] != 0; b++) {
- if (sc->mbitmap & (1 << b)) {
- ifmedia_add(&sc->media, bit2media[b], 0, NULL);
- }
- }
- for (b = 0; bit2media[b] != 0; b++) {
- if (sc->defmedia & (1 << b)) {
- ifmedia_set(&sc->media, bit2media[b]);
- break;
- }
- }
-#if 0 /* Turned off; this is called later, when the interface UPs. */
- fe_medchange(sc);
-#endif
-
/* Attach and stop the interface. */
#if NCARD > 0
if (already_ifattach[dev->id_unit] != 1) {
@@ -2712,14 +1518,14 @@ fe_attach ( struct isa_device * dev )
#else
if_attach(&sc->sc_if);
#endif
- fe_stop(sc);
+ fe_stop(sc->sc_unit); /* This changes the state to IDLE. */
ether_ifattach(&sc->sc_if);
/* Print additional info when attached. */
- printf("fe%d: address %6D, type %s%s\n", sc->sc_unit,
- sc->sc_enaddr, ":" , sc->typestr,
- (sc->proto_dlcr4 & FE_D4_DSC) ? ", full duplex" : "");
- if (bootverbose) {
+ printf( "fe%d: address %6D, type %s\n", sc->sc_unit,
+ sc->sc_enaddr, ":" , sc->typestr );
+#if FE_DEBUG >= 3
+ {
int buf, txb, bbw, sbw, ram;
buf = txb = bbw = sbw = ram = -1;
@@ -2746,42 +1552,29 @@ fe_attach ( struct isa_device * dev )
case FE_D6_SRAM_100ns: ram = 100; break;
case FE_D6_SRAM_150ns: ram = 150; break;
}
- printf("fe%d: SRAM %dKB %dbit %dns, TXB %dKBx2, %dbit I/O\n",
- sc->sc_unit, buf, bbw, ram, txb, sbw);
- }
- if (sc->stability & UNSTABLE_IRQ) {
- printf("fe%d: warning: IRQ number may be incorrect\n",
- sc->sc_unit);
- }
- if (sc->stability & UNSTABLE_MAC) {
- printf("fe%d: warning: above MAC address may be incorrect\n",
- sc->sc_unit);
- }
- if (sc->stability & UNSTABLE_TYPE) {
- printf("fe%d: warning: hardware type was not validated\n",
- sc->sc_unit);
+ printf( "fe%d: SRAM %dKB %dbit %dns, TXB %dKBx2, %dbit I/O\n",
+ sc->sc_unit, buf, bbw, ram, txb, sbw );
}
+#endif
#if NBPFILTER > 0
/* If BPF is in the kernel, call the attach for it. */
- bpfattach(&sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
+ bpfattach( &sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
#endif
return 1;
}
/*
- * Reset interface, after some (hardware) trouble is deteced.
+ * Reset interface.
*/
static void
-fe_reset (struct fe_softc *sc)
+fe_reset ( int unit )
{
- /* Record how many packets are lost by this accident. */
- sc->sc_if.if_oerrors += sc->txb_sched + sc->txb_count;
- sc->mibdata.dot3StatsInternalMacTransmitErrors++;
-
- /* Put the interface into known initial state. */
- fe_stop(sc);
- if (sc->sc_if.if_flags & IFF_UP) fe_init(sc);
+ /*
+ * Stop interface and re-initialize.
+ */
+ fe_stop(unit);
+ fe_init(unit);
}
/*
@@ -2791,12 +1584,17 @@ fe_reset (struct fe_softc *sc)
* if any, will be lost by stopping the interface.
*/
static void
-fe_stop (struct fe_softc *sc)
+fe_stop ( int unit )
{
+ struct fe_softc *sc = &fe_softc[unit];
int s;
s = splimp();
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "stop()" );
+#endif
+
/* Disable interrupts. */
outb( sc->ioaddr[ FE_DLCR2 ], 0x00 );
outb( sc->ioaddr[ FE_DLCR3 ], 0x00 );
@@ -2825,9 +1623,15 @@ fe_stop (struct fe_softc *sc)
/* MAR loading can be delayed. */
sc->filter_change = 0;
- /* Call a device-specific hook. */
+ /* Update config status also. */
+
+ /* Call a hook. */
if ( sc->stop ) sc->stop( sc );
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of stop()" );
+#endif
+
(void) splx(s);
}
@@ -2840,39 +1644,80 @@ fe_watchdog ( struct ifnet *ifp )
{
struct fe_softc *sc = (struct fe_softc *)ifp;
+#if FE_DEBUG >= 1
/* A "debug" message. */
- printf("fe%d: transmission timeout (%d+%d)%s\n",
- ifp->if_unit, sc->txb_sched, sc->txb_count,
- (ifp->if_flags & IFF_UP) ? "" : " when down");
+ log( LOG_ERR, "fe%d: transmission timeout (%d+%d)%s\n",
+ ifp->if_unit, sc->txb_sched, sc->txb_count,
+ ( ifp->if_flags & IFF_UP ) ? "" : " when down" );
if ( sc->sc_if.if_opackets == 0 && sc->sc_if.if_ipackets == 0 ) {
- printf("fe%d: wrong IRQ setting in config?\n", ifp->if_unit);
+ log( LOG_WARNING, "fe%d: wrong IRQ setting in config?\n",
+ ifp->if_unit );
+ }
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Record how many packets are lost by this accident. */
+ ifp->if_oerrors += sc->txb_sched + sc->txb_count;
+
+ /* Put the interface into known initial state. */
+ if ( ifp->if_flags & IFF_UP ) {
+ fe_reset( ifp->if_unit );
+ } else {
+ fe_stop( ifp->if_unit );
}
- fe_reset( sc );
}
/*
* Initialize device.
*/
static void
-fe_init (void * xsc)
+fe_init ( int unit )
{
- struct fe_softc *sc = xsc;
+ struct fe_softc *sc = &fe_softc[unit];
int s;
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init()" );
+#endif
+
/* We need an address. */
if (TAILQ_EMPTY(&sc->sc_if.if_addrhead)) { /* XXX unlikely */
-#ifdef DIAGNOSTIC
- printf("fe%d: init() without any address\n", sc->sc_unit);
+#if FE_DEBUG >= 1
+ log( LOG_ERR, "fe%d: init() without any address\n",
+ sc->sc_unit );
#endif
return;
}
+#if FE_DEBUG >= 1
+ /*
+ * Make sure we have a valid station address.
+ * The following test is applicable for any Ethernet interfaces.
+ * It can be done in somewhere common to all of them. FIXME.
+ */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x01 ) != 0
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) {
+ log( LOG_ERR, "fe%d: invalid station address (%6D)\n",
+ sc->sc_unit, sc->sc_enaddr, ":" );
+ return;
+ }
+#endif
+
/* Start initializing 86960. */
s = splimp();
- /* Call a hook before we start initializing the chip. */
+ /* Call a hook. */
if ( sc->init ) sc->init( sc );
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after init hook" );
+#endif
+
/*
* Make sure to disable the chip, also.
* This may also help re-programming the chip after
@@ -2914,19 +1759,23 @@ fe_init (void * xsc)
outb( sc->ioaddr[ FE_BMPR14 ], 0x00 );
outb( sc->ioaddr[ FE_BMPR15 ], 0x00 );
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just before enabling DLC" );
+#endif
+
/* Enable interrupts. */
outb( sc->ioaddr[ FE_DLCR2 ], FE_TMASK );
outb( sc->ioaddr[ FE_DLCR3 ], FE_RMASK );
- /* Select requested media, just before enabling DLC. */
- if (sc->msel) sc->msel(sc);
-
/* Enable transmitter and receiver. */
DELAY( 200 );
outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_ENABLE );
DELAY( 200 );
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just after enabling DLC" );
+#endif
+
/*
* Make sure to empty the receive buffer.
*
@@ -2945,16 +1794,24 @@ fe_init (void * xsc)
* The following message helps discovering the fact. FIXME.
*/
if ( !( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) ) {
- printf("fe%d: receive buffer has some data after reset\n",
- sc->sc_unit);
+ log( LOG_WARNING,
+ "fe%d: receive buffer has some data after reset\n",
+ sc->sc_unit );
+
fe_emptybuffer( sc );
}
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after ERB loop" );
+#endif
+
/* Do we need this here? Actually, no. I must be paranoia. */
outb( sc->ioaddr[ FE_DLCR0 ], 0xFF ); /* Clear all bits. */
outb( sc->ioaddr[ FE_DLCR1 ], 0xFF ); /* ditto. */
-#endif
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after FIXME" );
+#endif
/* Set 'running' flag, because we are now running. */
sc->sc_if.if_flags |= IFF_RUNNING;
@@ -2967,13 +1824,15 @@ fe_init (void * xsc)
*/
fe_setmode( sc );
-#if 0
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after setmode" );
+#endif
+
/* ...and attempt to start output queued packets. */
- /* TURNED OFF, because the semi-auto media prober wants to UP
- the interface keeping it idle. The upper layer will soon
- start the interface anyway, and there are no significant
- delay. */
fe_start( &sc->sc_if );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init() done" );
#endif
(void) splx(s);
@@ -3017,7 +1876,7 @@ fe_start ( struct ifnet *ifp )
struct fe_softc *sc = ifp->if_softc;
struct mbuf *m;
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 1
/* Just a sanity check. */
if ( ( sc->txb_count == 0 ) != ( sc->txb_free == sc->txb_size ) ) {
/*
@@ -3028,8 +1887,8 @@ fe_start ( struct ifnet *ifp )
* txb_count is zero if and only if txb_free is same
* as txb_size (which represents whole buffer.)
*/
- printf("fe%d: inconsistent txb variables (%d, %d)\n",
- sc->sc_unit, sc->txb_count, sc->txb_free);
+ log( LOG_ERR, "fe%d: inconsistent txb variables (%d, %d)\n",
+ sc->sc_unit, sc->txb_count, sc->txb_free );
/*
* So, what should I do, then?
*
@@ -3049,15 +1908,18 @@ fe_start ( struct ifnet *ifp )
}
#endif
+#if FE_DEBUG >= 1
/*
* First, see if there are buffered packets and an idle
* transmitter - should never happen at this point.
*/
if ( ( sc->txb_count > 0 ) && ( sc->txb_sched == 0 ) ) {
- printf("fe%d: transmitter idle with %d buffered packets\n",
- sc->sc_unit, sc->txb_count);
+ log( LOG_ERR,
+ "fe%d: transmitter idle with %d buffered packets\n",
+ sc->sc_unit, sc->txb_count );
fe_xmit( sc );
}
+#endif
/*
* Stop accepting more transmission packets temporarily, when
@@ -3179,41 +2041,17 @@ fe_droppacket ( struct fe_softc * sc, int len )
*/
if ( len > 12 ) {
/* Read 4 more bytes, and skip the rest of the packet. */
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- else
-#endif
- {
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
- outb( sc->ioaddr[ FE_BMPR14 ], FE_B14_SKIP );
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ outb( sc->ioaddr[ FE_BMPR14 ], FE_B14_SKIP );
} else {
/* We should not come here unless receiving RUNTs. */
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- for ( i = 0; i < len; i++ ) {
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- }
- else
-#endif
- {
- for ( i = 0; i < len; i += 2 ) {
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
+ for ( i = 0; i < len; i += 2 ) {
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
}
}
}
-#ifdef DIAGNOSTIC
/*
* Empty receiving buffer.
*/
@@ -3223,10 +2061,9 @@ fe_emptybuffer ( struct fe_softc * sc )
int i;
u_char saved_dlcr5;
-#ifdef FE_DEBUG
- printf("fe%d: emptying receive buffer\n", sc->sc_unit);
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: emptying receive buffer\n", sc->sc_unit );
#endif
-
/*
* Stop receiving packets, temporarily.
*/
@@ -3235,32 +2072,21 @@ fe_emptybuffer ( struct fe_softc * sc )
DELAY(1300);
/*
- * When we come here, the receive buffer management may
+ * When we come here, the receive buffer management should
* have been broken. So, we cannot use skip operation.
* Just discard everything in the buffer.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- for ( i = 0; i < 65536; i++ ) {
- if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
- ( void )inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- }
- else
-#endif
- {
- for ( i = 0; i < 65536; i += 2 ) {
- if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
- ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
+ for (i = 0; i < 32768; i++) {
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
}
/*
* Double check.
*/
if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) {
- printf("fe%d: could not empty receive buffer\n", sc->sc_unit);
+ log( LOG_ERR, "fe%d: could not empty receive buffer\n",
+ sc->sc_unit );
/* Hmm. What should I do if this happens? FIXME. */
}
@@ -3269,7 +2095,6 @@ fe_emptybuffer ( struct fe_softc * sc )
*/
outb( sc->ioaddr[ FE_DLCR5 ], saved_dlcr5 );
}
-#endif
/*
* Transmission interrupt handler
@@ -3291,8 +2116,14 @@ fe_tint ( struct fe_softc * sc, u_char tstat )
* are left unsent in transmission buffer.
*/
left = inb( sc->ioaddr[ FE_BMPR10 ] );
- printf("fe%d: excessive collision (%d/%d)\n",
- sc->sc_unit, left, sc->txb_sched);
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: excessive collision (%d/%d)\n",
+ sc->sc_unit, left, sc->txb_sched );
+#endif
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
/*
* Clear the collision flag (in 86960) here
@@ -3366,24 +2197,19 @@ fe_tint ( struct fe_softc * sc, u_char tstat )
col = 1;
}
sc->sc_if.if_collisions += col;
- if ( col == 1 ) {
- sc->mibdata.dot3StatsSingleCollisionFrames++;
- } else {
- sc->mibdata.dot3StatsMultipleCollisionFrames++;
- }
- sc->mibdata.dot3StatsCollFrequencies[col-1]++;
+#if FE_DEBUG >= 3
+ log( LOG_WARNING, "fe%d: %d collision(s) (%d)\n",
+ sc->sc_unit, col, sc->txb_sched );
+#endif
}
/*
* Update transmission statistics.
* Be sure to reflect number of excessive collisions.
*/
- col = sc->tx_excolls;
- sc->sc_if.if_opackets += sc->txb_sched - col;
- sc->sc_if.if_oerrors += col;
- sc->sc_if.if_collisions += col * 16;
- sc->mibdata.dot3StatsExcessiveCollisions += col;
- sc->mibdata.dot3StatsCollFrequencies[15] += col;
+ sc->sc_if.if_opackets += sc->txb_sched - sc->tx_excolls;
+ sc->sc_if.if_oerrors += sc->tx_excolls;
+ sc->sc_if.if_collisions += sc->tx_excolls * 16;
sc->txb_sched = 0;
/*
@@ -3415,28 +2241,18 @@ fe_rint ( struct fe_softc * sc, u_char rstat )
/*
* Update statistics if this interrupt is caused by an error.
- * Note that, when the system was not sufficiently fast, the
- * receive interrupt might not be acknowledged immediately. If
- * one or more errornous frames were received before this routine
- * was scheduled, they are ignored, and the following error stats
- * give less than real values.
*/
if ( rstat & ( FE_D1_OVRFLO | FE_D1_CRCERR
| FE_D1_ALGERR | FE_D1_SRTPKT ) ) {
- if ( rstat & FE_D1_OVRFLO )
- sc->mibdata.dot3StatsInternalMacReceiveErrors++;
- if ( rstat & FE_D1_CRCERR )
- sc->mibdata.dot3StatsFCSErrors++;
- if ( rstat & FE_D1_ALGERR )
- sc->mibdata.dot3StatsAlignmentErrors++;
-#if 0
- /* The reference MAC receiver defined in 802.3
- silently ignores short frames (RUNTs) without
- notifying upper layer. RFC 1650 (dot3 MIB) is
- based on the 802.3, and it has no stats entry for
- RUNTs... */
- if ( rstat & FE_D1_SRTPKT )
- sc->mibdata.dot3StatsFrameTooShorts++; /* :-) */
+#if FE_DEBUG >= 2
+ log( LOG_WARNING,
+ "fe%d: receive error: %s%s%s%s(%02x)\n",
+ sc->sc_unit,
+ rstat & FE_D1_OVRFLO ? "OVR " : "",
+ rstat & FE_D1_CRCERR ? "CRC " : "",
+ rstat & FE_D1_ALGERR ? "ALG " : "",
+ rstat & FE_D1_SRTPKT ? "LEN " : "",
+ rstat );
#endif
sc->sc_if.if_ierrors++;
}
@@ -3449,109 +2265,147 @@ fe_rint ( struct fe_softc * sc, u_char rstat )
* We limit the number of iterations to avoid infinite-loop.
* The upper bound is set to unrealistic high value.
*/
- for ( i = 0; i < FE_MAX_RECV_COUNT * 2; i++ ) {
+ for (i = 0; i < FE_MAX_RECV_COUNT * 2; i++) {
/* Stop the iteration if 86960 indicates no packets. */
- if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) return;
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
/*
- * Extract a receive status byte.
+ * Extract A receive status byte.
* As our 86960 is in 16 bit bus access mode, we have to
* use inw() to get the status byte. The significant
* value is returned in lower 8 bits.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- status = inb( sc->ioaddr[ FE_BMPR8 ] );
- ( void ) inb( sc->ioaddr[ FE_BMPR8 ] );
- }
- else
+ status = ( u_char )inw( sc->ioaddr[ FE_BMPR8 ] );
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: receive status = %04x\n",
+ sc->sc_unit, status );
#endif
- {
- status = ( u_char )inw( sc->ioaddr[ FE_BMPR8 ] );
- }
/*
* Extract the packet length.
* It is a sum of a header (14 bytes) and a payload.
* CRC has been stripped off by the 86960.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- len = inb( sc->ioaddr[ FE_BMPR8 ] );
- len |= ( inb( sc->ioaddr[ FE_BMPR8 ] ) << 8 );
+ len = inw( sc->ioaddr[ FE_BMPR8 ] );
+
+#if FE_DEBUG >= 1
+ /*
+ * If there was an error with the received packet, it
+ * must be an indication of out-of-sync on receive
+ * buffer, because we have programmed the 8696x to
+ * to discard errored packets, even when the interface
+ * is in promiscuous mode. We have to re-synchronize.
+ */
+ if (!(status & FE_RPH_GOOD)) {
+ log(LOG_ERR,
+ "fe%d: corrupted receive status byte (%02x)\n",
+ sc->arpcom.ac_if.if_unit, status);
+ sc->arpcom.ac_if.if_ierrors++;
+ fe_emptybuffer( sc );
+ break;
}
- else
#endif
- {
- len = inw( sc->ioaddr[ FE_BMPR8 ] );
- }
+#if FE_DEBUG >= 1
/*
- * AS our 86960 is programed to ignore errored frame,
- * we must not see any error indication in the
- * receive buffer. So, any error condition is a
- * serious error, e.g., out-of-sync of the receive
- * buffer pointers.
+ * MB86960 checks the packet length and drop big packet
+ * before passing it to us. There are no chance we can
+ * get big packets through it, even if they are actually
+ * sent over a line. Hence, if the length exceeds
+ * the specified limit, it means some serious failure,
+ * such as out-of-sync on receive buffer management.
+ *
+ * Same for short packets, since we have programmed
+ * 86960 to drop short packets.
*/
- if ( ( status & 0xF0 ) != 0x20
- || len > ETHER_MAX_LEN - ETHER_CRC_LEN
- || len < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
- printf("fe%d: RX buffer out-of-sync\n", sc->sc_unit);
+ if ( len > ETHER_MAX_LEN - ETHER_CRC_LEN
+ || len < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
+ log( LOG_WARNING,
+ "fe%d: received a %s packet? (%u bytes)\n",
+ sc->sc_unit,
+ len < ETHER_MIN_LEN - ETHER_CRC_LEN
+ ? "partial" : "big",
+ len );
sc->sc_if.if_ierrors++;
- sc->mibdata.dot3StatsInternalMacReceiveErrors++;
- fe_reset(sc);
- return;
+ fe_emptybuffer( sc );
+ break;
}
+#endif
/*
* Go get a packet.
*/
if ( fe_get_packet( sc, len ) < 0 ) {
- /*
- * Negative return from fe_get_packet()
- * indicates no available mbuf. We stop
- * receiving packets, even if there are more
- * in the buffer. We hope we can get more
- * mbuf next time.
- */
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "%s%d: out of mbuf;"
+ " dropping a packet (%u bytes)\n",
+ sc->sc_unit, len );
+#endif
+
+ /* Skip a packet, updating statistics. */
sc->sc_if.if_ierrors++;
- sc->mibdata.dot3StatsMissedFrames++;
fe_droppacket( sc, len );
- return;
+
+ /*
+ * Try extracting other packets, although they will
+ * cause out-of-mbuf error again. This is required
+ * to keep receiver interrupt comming.
+ * (Earlier versions had a bug on this point.)
+ */
+ continue;
}
/* Successfully received a packet. Update stat. */
sc->sc_if.if_ipackets++;
}
-
- /* Maximum number of frames has been received. Something
- strange is happening here... */
- printf("fe%d: unusual receive flood\n", sc->sc_unit);
- sc->mibdata.dot3StatsInternalMacReceiveErrors++;
- fe_reset(sc);
}
/*
* Ethernet interface interrupt processor
*/
-static void
+void
feintr ( int unit )
{
struct fe_softc *sc = &fe_softc[unit];
u_char tstat, rstat;
- int loop_count = FE_MAX_LOOP;
- /* Loop until there are no more new interrupt conditions. */
- while (loop_count-- > 0) {
+ /*
+ * Loop until there are no more new interrupt conditions.
+ */
+ for (;;) {
+
+#if FE_DEBUG >= 4
+ fe_dump( LOG_INFO, sc, "intr()" );
+#endif
+
/*
* Get interrupt conditions, masking unneeded flags.
*/
tstat = inb( sc->ioaddr[ FE_DLCR0 ] ) & FE_TMASK;
rstat = inb( sc->ioaddr[ FE_DLCR1 ] ) & FE_RMASK;
- if ( tstat == 0 && rstat == 0 ) return;
+
+#if FE_DEBUG >= 1
+ /* Test for a "dead-lock" condition. */
+ if ((rstat & FE_D1_PKTRDY) == 0
+ && (inb(sc->ioaddr[FE_DLCR5]) & FE_D5_BUFEMP) == 0
+ && (inb(sc->ioaddr[FE_DLCR1]) & FE_D1_PKTRDY) == 0) {
+ /*
+ * PKTRDY is off, while receive buffer is not empty.
+ * We did a double check to avoid a race condition...
+ * So, we should have missed an interrupt.
+ */
+ log(LOG_WARNING,
+ "fe%d: missed a receiver interrupt?\n",
+ sc->arpcom.ac_if.if_unit);
+ /* Simulate the missed interrupt condition. */
+ rstat |= FE_D1_PKTRDY;
+ }
+#endif
+
+ /* Stop processing if there are no interrupts to handle. */
+ if ( tstat == 0 && rstat == 0 ) break;
/*
* Reset the conditions we are acknowledging.
@@ -3560,7 +2414,8 @@ feintr ( int unit )
outb( sc->ioaddr[ FE_DLCR1 ], rstat );
/*
- * Handle transmitter interrupts.
+ * Handle transmitter interrupts. Handle these first because
+ * the receiver will reset the board under some conditions.
*/
if ( tstat ) {
fe_tint( sc, tstat );
@@ -3605,9 +2460,6 @@ feintr ( int unit )
}
}
-
- printf("fe%d: too many loops\n", sc->sc_unit);
- return;
}
/*
@@ -3618,32 +2470,148 @@ static int
fe_ioctl ( struct ifnet * ifp, u_long command, caddr_t data )
{
struct fe_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *)data;
int s, error = 0;
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: ioctl(%x)\n", sc->sc_unit, command );
+#endif
+
s = splimp();
switch (command) {
case SIOCSIFADDR:
+ {
+ struct ifaddr * ifa = ( struct ifaddr * )data;
+
+ sc->sc_if.if_flags |= IFF_UP;
+
+ switch (ifa->ifa_addr->sa_family) {
+#ifdef INET
+ case AF_INET:
+ fe_init( sc->sc_unit ); /* before arp_ifinit */
+ arp_ifinit( &sc->arpcom, ifa );
+ break;
+#endif
+#ifdef IPX
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_IPX:
+ {
+ register struct ipx_addr *ina
+ = &(IA_SIPX(ifa)->sipx_addr);
+
+ if (ipx_nullhost(*ina))
+ ina->x_host =
+ *(union ipx_host *) (sc->sc_enaddr); else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+#ifdef INET6
+ case AF_INET6:
+ /* IPV6 added by shin 96.2.6 */
+ fe_init(sc->sc_unit);
+ ndp6_ifinit(&sc->arpcom, ifa);
+ break;
+#endif
+#ifdef NS
+
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_NS:
+ {
+ register struct ns_addr *ina
+ = &(IA_SNS(ifa)->sns_addr);
+
+ if (ns_nullhost(*ina))
+ ina->x_host =
+ *(union ns_host *) (sc->sc_enaddr);
+ else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+ default:
+ fe_init( sc->sc_unit );
+ break;
+ }
+ break;
+ }
+
+#ifdef SIOCGIFADDR
case SIOCGIFADDR:
- case SIOCSIFMTU:
- /* Just an ordinary action. */
- error = ether_ioctl(ifp, command, data);
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+ struct sockaddr * sa = ( struct sockaddr * )&ifr->ifr_data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)sa->sa_data, ETHER_ADDR_LEN);
+ break;
+ }
+#endif
+
+#ifdef SIOCGIFPHYSADDR
+ case SIOCGIFPHYSADDR:
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)&ifr->ifr_data, ETHER_ADDR_LEN);
break;
+ }
+#endif
+#ifdef notdef
+#ifdef SIOCSIFPHYSADDR
+ case SIOCSIFPHYSADDR:
+ {
+ /*
+ * Set the physical (Ethernet) address of the interface.
+ * When and by whom is this command used? FIXME.
+ */
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)&ifr->ifr_data,
+ (caddr_t)sc->sc_enaddr, ETHER_ADDR_LEN);
+ fe_setlinkaddr( sc );
+ break;
+ }
+#endif
+#endif /* notdef */
+
+#ifdef SIOCSIFFLAGS
case SIOCSIFFLAGS:
+ {
/*
* Switch interface state between "running" and
* "stopped", reflecting the UP flag.
*/
if ( sc->sc_if.if_flags & IFF_UP ) {
if ( ( sc->sc_if.if_flags & IFF_RUNNING ) == 0 ) {
- fe_init(sc);
+ fe_init( sc->sc_unit );
}
} else {
if ( ( sc->sc_if.if_flags & IFF_RUNNING ) != 0 ) {
- fe_stop(sc);
+ fe_stop( sc->sc_unit );
}
}
@@ -3653,28 +2621,47 @@ fe_ioctl ( struct ifnet * ifp, u_long command, caddr_t data )
*/
fe_setmode( sc );
- /* Done. */
+#if FE_DEBUG >= 1
+ /* "ifconfig fe0 debug" to print register dump. */
+ if ( sc->sc_if.if_flags & IFF_DEBUG ) {
+ fe_dump( LOG_DEBUG, sc, "SIOCSIFFLAGS(DEBUG)" );
+ }
+#endif
break;
+ }
+#endif
+#ifdef SIOCADDMULTI
case SIOCADDMULTI:
case SIOCDELMULTI:
+ /*
+ * Multicast list has changed; set the hardware filter
+ * accordingly.
+ */
+ fe_setmode( sc );
+ error = 0;
+ break;
+#endif
+
+#ifdef SIOCSIFMTU
+ case SIOCSIFMTU:
+ {
/*
- * Multicast list has changed; set the hardware filter
- * accordingly.
+ * Set the interface MTU.
*/
- fe_setmode( sc );
- break;
+ struct ifreq * ifr = ( struct ifreq * )data;
- case SIOCSIFMEDIA:
- case SIOCGIFMEDIA:
- /* Let if_media to handle these commands and to call
- us back. */
- error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
+ if ( ifr->ifr_mtu > ETHERMTU ) {
+ error = EINVAL;
+ } else {
+ sc->sc_if.if_mtu = ifr->ifr_mtu;
+ }
break;
+ }
+#endif
default:
error = EINVAL;
- break;
}
(void) splx(s);
@@ -3746,20 +2733,11 @@ fe_get_packet ( struct fe_softc * sc, u_short len )
/* The following silliness is to make NFS happy */
m->m_data += NFS_MAGIC_OFFSET;
- /* Get (actually just point to) the header part. */
- eh = mtod(m, struct ether_header *);
-
/* Get a packet. */
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- insb( sc->ioaddr[ FE_BMPR8 ], eh, len );
- }
- else
-#endif
- {
- insw( sc->ioaddr[ FE_BMPR8 ], eh, ( len + 1 ) >> 1 );
- }
+ insw( sc->ioaddr[ FE_BMPR8 ], m->m_data, ( len + 1 ) >> 1 );
+
+ /* Get (actually just point to) the header part. */
+ eh = mtod( m, struct ether_header *);
#define ETHER_ADDR_IS_MULTICAST(A) (*(char *)(A) & 1)
@@ -3773,26 +2751,6 @@ fe_get_packet ( struct fe_softc * sc, u_short len )
}
#endif
-#ifdef BRIDGE
- if (do_bridge) {
- struct ifnet *ifp;
-
- ifp = bridge_in(m);
- if (ifp == BDG_DROP) {
- m_freem(m);
- return 0;
- }
- if (ifp != BDG_LOCAL)
- bdg_forward(&m, ifp); /* not local, need forwarding */
- if (ifp == BDG_LOCAL || ifp == BDG_BCAST || ifp == BDG_MCAST)
- goto getit;
- /* not local and not multicast, just drop it */
- if (m)
- m_freem(m);
- return 0;
- }
-#endif
-
/*
* Make sure this packet is (or may be) directed to us.
* That is, the packet is either unicasted to our address,
@@ -3815,9 +2773,22 @@ fe_get_packet ( struct fe_softc * sc, u_short len )
return 0;
}
-#ifdef BRIDGE
-getit:
+#if FE_DEBUG >= 3
+ if ( !ETHER_ADDR_IS_MULTICAST( eh->ether_dhost )
+ && bcmp( eh->ether_dhost, sc->sc_enaddr, ETHER_ADDR_LEN ) != 0 ) {
+ /*
+ * This packet was not for us. We can't be in promiscuous
+ * mode since the case was handled by above test.
+ * We found an error (of this driver.)
+ */
+ log( LOG_WARNING,
+ "fe%d: got an unwanted packet, dst = %6D\n",
+ sc->sc_unit, eh->ether_dhost , ":" );
+ m_freem( m );
+ return 0;
+ }
#endif
+
/* Strip off the Ethernet header. */
m->m_pkthdr.len -= sizeof ( struct ether_header );
m->m_len -= sizeof ( struct ether_header );
@@ -3849,23 +2820,26 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
static u_char padding [ ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_HDR_LEN ];
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 1
/* First, count up the total number of bytes to copy */
length = 0;
for ( mp = m; mp != NULL; mp = mp->m_next ) {
length += mp->m_len;
}
- /* Check if this matches the one in the packet header. */
- if ( length != m->m_pkthdr.len ) {
- printf("fe%d: packet length mismatch? (%d/%d)\n", sc->sc_unit,
- length, m->m_pkthdr.len);
- }
#else
/* Just use the length value in the packet header. */
length = m->m_pkthdr.len;
#endif
-#ifdef DIAGNOSTIC
+#if FE_DEBUG >= 2
+ /* Check if this matches the one in the packet header. */
+ if ( length != m->m_pkthdr.len ) {
+ log( LOG_WARNING, "fe%d: packet length mismatch? (%d/%d)\n",
+ sc->sc_unit, length, m->m_pkthdr.len );
+ }
+#endif
+
+#if FE_DEBUG >= 1
/*
* Should never send big packets. If such a packet is passed,
* it should be a bug of upper layer. We just ignore it.
@@ -3873,10 +2847,10 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
*/
if ( length < ETHER_HDR_LEN
|| length > ETHER_MAX_LEN - ETHER_CRC_LEN ) {
- printf("fe%d: got an out-of-spec packet (%u bytes) to send\n",
- sc->sc_unit, length);
+ log( LOG_ERR,
+ "fe%d: got an out-of-spec packet (%u bytes) to send\n",
+ sc->sc_unit, length );
sc->sc_if.if_oerrors++;
- sc->mibdata.dot3StatsInternalMacTransmitErrors++;
return;
}
#endif
@@ -3889,29 +2863,13 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
* packet in the transmission buffer, we can skip the
* padding process. It may gain performance slightly. FIXME.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- len = max( length, ETHER_MIN_LEN - ETHER_CRC_LEN );
- outb( addr_bmpr8, len & 0x00ff );
- outb( addr_bmpr8, ( len & 0xff00 ) >> 8 );
- }
- else
-#endif
- {
- outw( addr_bmpr8, max( length, ETHER_MIN_LEN - ETHER_CRC_LEN ) );
- }
+ outw( addr_bmpr8, max( length, ETHER_MIN_LEN - ETHER_CRC_LEN ) );
/*
* Update buffer status now.
* Truncate the length up to an even number, since we use outw().
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_WORD)
-#endif
- {
- length = ( length + 1 ) & ~1;
- }
+ length = ( length + 1 ) & ~1;
sc->txb_free -= FE_DATA_LEN_LEN + max( length, ETHER_MIN_LEN - ETHER_CRC_LEN);
sc->txb_count++;
@@ -3921,69 +2879,45 @@ fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
* only words. So that we require some extra code to patch
* over odd-length mbufs.
*/
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- /* 8-bit cards are easy. */
- for ( mp = m; mp != 0; mp = mp->m_next ) {
- if ( mp->m_len ) {
- outsb( addr_bmpr8, mtod(mp, caddr_t), mp->m_len );
- }
- }
- }
- else
-#endif
- {
- /* 16-bit cards are a pain. */
- savebyte = NO_PENDING_BYTE;
- for ( mp = m; mp != 0; mp = mp->m_next ) {
-
- /* Ignore empty mbuf. */
- len = mp->m_len;
- if ( len == 0 ) continue;
-
- /* Find the actual data to send. */
- data = mtod(mp, caddr_t);
-
- /* Finish the last byte. */
- if ( savebyte != NO_PENDING_BYTE ) {
- outw( addr_bmpr8, savebyte | ( *data << 8 ) );
- data++;
- len--;
- savebyte = NO_PENDING_BYTE;
- }
+ savebyte = NO_PENDING_BYTE;
+ for ( mp = m; mp != 0; mp = mp->m_next ) {
- /* output contiguous words */
- if (len > 1) {
- outsw( addr_bmpr8, data, len >> 1);
- data += len & ~1;
- len &= 1;
- }
+ /* Ignore empty mbuf. */
+ len = mp->m_len;
+ if ( len == 0 ) continue;
- /* Save a remaining byte, if there is one. */
- if ( len > 0 ) {
- savebyte = *data;
- }
- }
+ /* Find the actual data to send. */
+ data = mtod(mp, caddr_t);
- /* Spit the last byte, if the length is odd. */
+ /* Finish the last byte. */
if ( savebyte != NO_PENDING_BYTE ) {
- outw( addr_bmpr8, savebyte );
+ outw( addr_bmpr8, savebyte | ( *data << 8 ) );
+ data++;
+ len--;
+ savebyte = NO_PENDING_BYTE;
}
+
+ /* output contiguous words */
+ if (len > 1) {
+ outsw( addr_bmpr8, data, len >> 1);
+ data += len & ~1;
+ len &= 1;
+ }
+
+ /* Save a remaining byte, if there is one. */
+ if ( len > 0 ) {
+ savebyte = *data;
+ }
+ }
+
+ /* Spit the last byte, if the length is odd. */
+ if ( savebyte != NO_PENDING_BYTE ) {
+ outw( addr_bmpr8, savebyte );
}
/* Pad to the Ethernet minimum length, if the packet is too short. */
if ( length < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
-#ifdef FE_8BIT_SUPPORT
- if ((sc->proto_dlcr6 & FE_D6_BBW) == FE_D6_BBW_BYTE)
- {
- outsb( addr_bmpr8, padding, ETHER_MIN_LEN - ETHER_CRC_LEN - length );
- }
- else
-#endif
- {
- outsw( addr_bmpr8, padding, ( ETHER_MIN_LEN - ETHER_CRC_LEN - length ) >> 1);
- }
+ outsw( addr_bmpr8, padding, ( ETHER_MIN_LEN - ETHER_CRC_LEN - length ) >> 1);
}
}
@@ -4029,9 +2963,9 @@ fe_mcaf ( struct fe_softc *sc )
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-#ifdef FE_DEBUG
- printf("fe%d: hash(%6D) == %d\n",
- sc->sc_unit, enm->enm_addrlo , ":", index);
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: hash(%6D) == %d\n",
+ sc->sc_unit, enm->enm_addrlo , ":", index );
#endif
filter.data[index >> 3] |= 1 << (index & 7);
@@ -4078,6 +3012,10 @@ fe_setmode ( struct fe_softc *sc )
outb( sc->ioaddr[ FE_DLCR5 ],
sc->proto_dlcr5 | FE_D5_AFM0 | FE_D5_AFM1 );
sc->filter_change = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: promiscuous mode\n", sc->sc_unit );
+#endif
return;
}
@@ -4088,14 +3026,23 @@ fe_setmode ( struct fe_softc *sc )
/*
* Find the new multicast filter value.
+ * I'm not sure we have to handle modes other than MULTICAST.
+ * Who sets ALLMULTI? Who turns MULTICAST off? FIXME.
*/
if ( flags & IFF_ALLMULTI ) {
sc->filter = fe_filter_all;
- } else {
+ } else if ( flags & IFF_MULTICAST ) {
sc->filter = fe_mcaf( sc );
+ } else {
+ sc->filter = fe_filter_nothing;
}
sc->filter_change = 1;
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter: [%8D]\n",
+ sc->sc_unit, sc->filter.data, " " );
+#endif
+
/*
* We have to update the multicast filter in the 86960, A.S.A.P.
*
@@ -4104,6 +3051,9 @@ fe_setmode ( struct fe_softc *sc )
* DLC trashes all packets in both transmission and receive
* buffers when stopped.
*
+ * ... Are the above sentences correct? I have to check the
+ * manual of the MB86960A. FIXME.
+ *
* To reduce the packet loss, we delay the filter update
* process until buffers are empty.
*/
@@ -4120,6 +3070,9 @@ fe_setmode ( struct fe_softc *sc )
* the MARs. The new filter will be loaded by feintr()
* later.
*/
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: filter change delayed\n", sc->sc_unit );
+#endif
}
}
@@ -4157,45 +3110,36 @@ fe_loadmar ( struct fe_softc * sc )
/* We have just updated the filter. */
sc->filter_change = 0;
-}
-
-/* Change the media selection. */
-static int
-fe_medchange (struct ifnet *ifp)
-{
- struct fe_softc *sc = (struct fe_softc *)ifp->if_softc;
-#ifdef DIAGNOSTIC
- /* If_media should not pass any request for a media which this
- interface doesn't support. */
- int b;
-
- for (b = 0; bit2media[b] != 0; b++) {
- if (bit2media[b] == sc->media.ifm_media) break;
- }
- if (((1 << b) & sc->mbitmap) == 0) {
- printf("fe%d: got an unsupported media request (0x%x)\n",
- sc->sc_unit, sc->media.ifm_media);
- return EINVAL;
- }
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter changed\n", sc->sc_unit );
#endif
-
- /* We don't actually change media when the interface is down.
- fe_init() will do the job, instead. Should we also wait
- until the transmission buffer being empty? Changing the
- media when we are sending a frame will cause two garbages
- on wires, one on old media and another on new. FIXME */
- if (sc->sc_if.if_flags & IFF_UP) {
- if (sc->msel) sc->msel(sc);
- }
-
- return 0;
}
-/* I don't know how I can support media status callback... FIXME. */
+#if FE_DEBUG >= 1
static void
-fe_medstat (struct ifnet *ifp, struct ifmediareq *ifmr)
-{
- (void)ifp;
- (void)ifmr;
+fe_dump ( int level, struct fe_softc * sc, char * message )
+{
+ log( level, "fe%d: %s,"
+ " DLCR = %02x %02x %02x %02x %02x %02x %02x %02x,"
+ " BMPR = xx xx %02x %02x %02x %02x %02x %02x,"
+ " asic = %02x %02x %02x %02x %02x %02x %02x %02x"
+ " + %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ sc->sc_unit, message ? message : "registers",
+ inb( sc->ioaddr[ FE_DLCR0 ] ), inb( sc->ioaddr[ FE_DLCR1 ] ),
+ inb( sc->ioaddr[ FE_DLCR2 ] ), inb( sc->ioaddr[ FE_DLCR3 ] ),
+ inb( sc->ioaddr[ FE_DLCR4 ] ), inb( sc->ioaddr[ FE_DLCR5 ] ),
+ inb( sc->ioaddr[ FE_DLCR6 ] ), inb( sc->ioaddr[ FE_DLCR7 ] ),
+ inb( sc->ioaddr[ FE_BMPR10 ] ), inb( sc->ioaddr[ FE_BMPR11 ] ),
+ inb( sc->ioaddr[ FE_BMPR12 ] ), inb( sc->ioaddr[ FE_BMPR13 ] ),
+ inb( sc->ioaddr[ FE_BMPR14 ] ), inb( sc->ioaddr[ FE_BMPR15 ] ),
+ inb( sc->ioaddr[ 0x10 ] ), inb( sc->ioaddr[ 0x11 ] ),
+ inb( sc->ioaddr[ 0x12 ] ), inb( sc->ioaddr[ 0x13 ] ),
+ inb( sc->ioaddr[ 0x14 ] ), inb( sc->ioaddr[ 0x15 ] ),
+ inb( sc->ioaddr[ 0x16 ] ), inb( sc->ioaddr[ 0x17 ] ),
+ inb( sc->ioaddr[ 0x18 ] ), inb( sc->ioaddr[ 0x19 ] ),
+ inb( sc->ioaddr[ 0x1A ] ), inb( sc->ioaddr[ 0x1B ] ),
+ inb( sc->ioaddr[ 0x1C ] ), inb( sc->ioaddr[ 0x1D ] ),
+ inb( sc->ioaddr[ 0x1E ] ), inb( sc->ioaddr[ 0x1F ] ) );
}
+#endif
diff --git a/sys/i386/isa/if_fereg.h b/sys/i386/isa/if_fereg.h
index d9b943c5febff..2a26cbea10f1c 100644
--- a/sys/i386/isa/if_fereg.h
+++ b/sys/i386/isa/if_fereg.h
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: if_fereg.h,v 1.5 1997/02/22 09:36:28 peter Exp $ */
+/* $Id$ */
/*
* Registers on FMV-180 series' ISA bus interface ASIC.
@@ -116,3 +116,17 @@
/* IRQ configuration. */
#define FE_RE1000_IRQCONF 0x10
+#define FE_RE1000_IRQCONF_IRQ 0xf0
+#define FE_RE1000_IRQCONF_IRQSHIFT 4
+
+/* MAC (station) address. */
+#define FE_RE1000_MAC0 0x11
+#define FE_RE1000_MAC1 0x13
+#define FE_RE1000_MAC2 0x15
+#define FE_RE1000_MAC3 0x17
+#define FE_RE1000_MAC4 0x19
+#define FE_RE1000_MAC5 0x1B
+
+/* "Check sum" -- an xor of MAC0 through MAC5 */
+#define FE_RE1000_MACCHK 0x1D
+
diff --git a/sys/i386/isa/if_ie.c b/sys/i386/isa/if_ie.c
index 4b22ae52bc6cc..f894dc5407547 100644
--- a/sys/i386/isa/if_ie.c
+++ b/sys/i386/isa/if_ie.c
@@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ie.c,v 1.57 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_ie.c,v 1.55 1998/08/10 14:27:32 bde Exp $
*/
/*
@@ -176,7 +176,6 @@ static struct mbuf *last_not_for_us;
static int ieprobe(struct isa_device * dvp);
static int ieattach(struct isa_device * dvp);
-static ointhand2_t ieintr;
static int sl_probe(struct isa_device * dvp);
static int el_probe(struct isa_device * dvp);
static int ni_probe(struct isa_device * dvp);
@@ -790,8 +789,6 @@ ieattach(struct isa_device *dvp)
struct ifnet *ifp = &ie->arpcom.ac_if;
size_t allocsize;
- dvp->id_ointr = ieintr;
-
/*
* based on the amount of memory we have, allocate our tx and rx
* resources.
@@ -854,7 +851,7 @@ ieattach(struct isa_device *dvp)
/*
* What to do upon receipt of an interrupt.
*/
-static void
+void
ieintr(int unit)
{
register struct ie_softc *ie = &ie_softc[unit];
@@ -2261,9 +2258,7 @@ static int
ieioctl(struct ifnet *ifp, u_long command, caddr_t data)
{
struct ifaddr *ifa = (struct ifaddr *) data;
-#if defined(IPX) || defined(NS)
struct ie_softc *ie = ifp->if_softc;
-#endif
struct ifreq *ifr = (struct ifreq *) data;
int s, error = 0;
diff --git a/sys/i386/isa/if_le.c b/sys/i386/isa/if_le.c
index fb9492f384290..f6b89edf411f5 100644
--- a/sys/i386/isa/if_le.c
+++ b/sys/i386/isa/if_le.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_le.c,v 1.48 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_le.c,v 1.46 1998/07/15 09:38:09 bde Exp $
*/
/*
@@ -236,7 +236,6 @@ struct le_softc {
static int le_probe(struct isa_device *dvp);
static int le_attach(struct isa_device *dvp);
-static ointhand2_t le_intr;
static int le_ioctl(struct ifnet *ifp, u_long command, caddr_t data);
static void le_input(le_softc_t *sc, caddr_t seg1, size_t total_len,
size_t len2, caddr_t seg2);
@@ -355,7 +354,6 @@ le_attach(
le_softc_t *sc = &le_softc[dvp->id_unit];
struct ifnet *ifp = &sc->le_if;
- dvp->id_ointr = le_intr;
ifp->if_softc = sc;
ifp->if_mtu = ETHERMTU;
printf("%s%d: %s ethernet address %6D\n",
@@ -380,7 +378,7 @@ le_attach(
return 1;
}
-static void
+void
le_intr(
int unit)
{
@@ -1126,7 +1124,7 @@ lemac_start(
/*
* The first four bytes of each transmit buffer are for
* control information. The first byte is the control
- * byte, then the length (why not word aligned?), then
+ * byte, then the length (why not word aligned??), then
* the off to the buffer.
*/
diff --git a/sys/i386/isa/if_lnc.c b/sys/i386/isa/if_lnc.c
index 0e74247596c18..e31c600c823f5 100644
--- a/sys/i386/isa/if_lnc.c
+++ b/sys/i386/isa/if_lnc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1994-1998
+ * Copyright (c) 1995, 1996
* Paul Richards. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_lnc.c,v 1.50 1998/11/26 00:57:32 paul Exp $
+ * $Id: if_lnc.c,v 1.45 1998/08/24 02:28:15 bde Exp $
*/
/*
@@ -177,15 +177,14 @@ static int pcnet_probe __P((struct lnc_softc *sc));
static int lnc_attach_sc __P((struct lnc_softc *sc, int unit));
static int lnc_attach __P((struct isa_device *isa_dev));
static void lnc_init __P((struct lnc_softc *sc));
-static ointhand2_t lncintr;
static __inline int mbuf_to_buffer __P((struct mbuf *m, char *buffer));
static __inline struct mbuf *chain_to_cluster __P((struct mbuf *m));
static void lnc_start __P((struct ifnet *ifp));
static int lnc_ioctl __P((struct ifnet *ifp, u_long command, caddr_t data));
static void lnc_watchdog __P((struct ifnet *ifp));
#ifdef DEBUG
-void lnc_dump_state __P((struct lnc_softc *sc));
-void mbuf_dump_chain __P((struct mbuf *m));
+static void lnc_dump_state __P((struct lnc_softc *sc));
+static void mbuf_dump_chain __P((struct mbuf *m));
#endif
#if NPCI > 0
@@ -560,14 +559,13 @@ lnc_rint(struct lnc_softc *sc)
log(LOG_ERR, "lnc%d: Receive overflow error \n", unit);
}
} else if (flags & ENP) {
- if ((sc->arpcom.ac_if.if_flags & IFF_PROMISC)==0) {
/*
* FRAM and CRC are valid only if ENP
* is set and OFLO is not.
*/
if (flags & FRAM) {
LNCSTATS(fram)
- log(LOG_ERR, "lnc%d: Framing error\n", unit);
+ log(LOG_ERR, "lnc%d: Framming error\n", unit);
/*
* FRAM is only set if there's a CRC
* error so avoid multiple messages
@@ -576,7 +574,6 @@ lnc_rint(struct lnc_softc *sc)
LNCSTATS(crc)
log(LOG_ERR, "lnc%d: Receive CRC error\n", unit);
}
- }
}
/* Drop packet */
@@ -1276,10 +1273,8 @@ lnc_attach(struct isa_device * isa_dev)
{
int unit = isa_dev->id_unit;
struct lnc_softc *sc = &lnc_softc[unit];
- int result;
- isa_dev->id_ointr = lncintr;
- result = lnc_attach_sc (sc, unit);
+ int result = lnc_attach_sc (sc, unit);
if (result == 0)
return (0);
@@ -1311,7 +1306,7 @@ lnc_attach_ne2100_pci(int unit, unsigned iobase)
sc->bdp = iobase + PCNET_BDP;
sc->nic.ic = pcnet_probe(sc);
- if (sc->nic.ic >= PCnet_32) {
+ if (sc->nic.ic >= PCnet_PCI) {
sc->nic.ident = NE2100;
sc->nic.mem_mode = DMA_FIXED;
@@ -1597,7 +1592,7 @@ lncintr_sc(struct lnc_softc *sc)
}
}
-static void
+void
lncintr(int unit)
{
struct lnc_softc *sc = &lnc_softc[unit];
@@ -1896,7 +1891,7 @@ lnc_watchdog(struct ifnet *ifp)
}
#ifdef DEBUG
-void
+static void
lnc_dump_state(struct lnc_softc *sc)
{
int i;
@@ -1951,7 +1946,7 @@ lnc_dump_state(struct lnc_softc *sc)
outw(sc->rap, CSR0);
}
-void
+static void
mbuf_dump_chain(struct mbuf * m)
{
diff --git a/sys/i386/isa/if_lnc.h b/sys/i386/isa/if_lnc.h
index f281eaf13ab4e..8d9ffabdbdba6 100644
--- a/sys/i386/isa/if_lnc.h
+++ b/sys/i386/isa/if_lnc.h
@@ -1,36 +1,11 @@
-/*-
- * Copyright (c) 1994-1998
- * Paul Richards. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer,
- * verbatim and that no modifications are made prior to this
- * point in the file.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Paul Richards.
- * 4. The name Paul Richards may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY PAUL RICHARDS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL PAUL RICHARDS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+/*
+ * Copyright (c) 1994, Paul Richards. This software may be used, modified,
+ * copied, distributed, and sold, in both source and binary form provided
+ * that the above copyright and these terms are retained. Under no
+ * circumstances is the author responsible for the proper functioning
+ * of this software, nor does the author assume any responsibility
+ * for damages incurred with its use.
*
- * $Id: $
*/
#include <i386/isa/ic/Am7990.h>
diff --git a/sys/i386/isa/if_rdp.c b/sys/i386/isa/if_rdp.c
deleted file mode 100644
index 0d29b0aba602a..0000000000000
--- a/sys/i386/isa/if_rdp.c
+++ /dev/null
@@ -1,1456 +0,0 @@
-/*
- * Copyright 1998, Joerg Wunsch
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice unmodified, this list of conditions, and the following
- * disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: if_rdp.c,v 1.2 1998/12/21 18:11:10 joerg Exp $
- */
-
-/*
- * Device driver for RealTek RTL 8002 (`REDP') based pocket-ethernet
- * adapters, hooked up to a printer port. `rdp' is a shorthand for
- * REDP since some tools like netstat work best if the interface name
- * has no more than three letters.
- *
- * Driver configuration flags so far:
- * flags 0x1 -- assume 74S288 EEPROM (default 94C46)
- * flags 0x2 -- use `slow' mode (mode 3 of the packet driver, default 0)
- *
- * Maybe this driver will some day also work with the successor, RTL
- * 8012 (`AREDP'), which is unfortunately not fully register-
- * compatible with the 8002. The 8012 offers support for faster
- * transfer modi like bidirectional SPP and EPP, 64 K x 4 buffer
- * memory as opposed to 16 K x 4 for the 8002, a multicast filter, and
- * a builtin multiplexer that allows chaining a printer behind the
- * ethernet adapter.
- *
- * About the only documentation i've been able to find about the RTL
- * 8002 was the packet driver source code at ftp.realtek.com.tw, so
- * this driver is somewhat based on the way the packet driver handles
- * the chip. The exact author of the packet driver is unknown, the
- * only name that i could find in the source was someone called Chiu,
- * supposedly an employee of RealTek. So credits to them for that
- * piece of code which has proven valuable to me.
- *
- * Later on, Leo kuo <leo@realtek.com.tw> has been very helpful to me
- * by sending me a readable (PDF) file documenting the RTL 8012, which
- * helped me to also understand the 8002, as well as by providing me
- * with the source code of the 8012 packet driver that i haven't been
- * able to find on the FTP site. A big Thanks! goes here to RealTek
- * for this kind of service.
- */
-
-#include "rdp.h"
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/sockio.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/syslog.h>
-
-#include <net/ethernet.h>
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/if_dl.h>
-#include <net/if_mib.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <machine/clock.h>
-#include <machine/md_var.h>
-
-#include <i386/isa/isa_device.h>
-#include <i386/isa/icu.h>
-#include <i386/isa/if_rdpreg.h>
-#include <i386/isa/intr_machdep.h>
-
-#define IOCTL_CMD_T u_long
-
-/*
- * Debug levels (ORed together):
- * != 0 - general (bad packets etc.)
- * 2 - debug EEPROM IO
- * 4 - debug interrupt status
- */
-#undef DEBUG
-#define DEBUG 0
-
-/*
- * rdp_softc: per interface info and status
- */
-struct rdp_softc {
- struct arpcom arpcom; /*
- * Ethernet common, always goes first so
- * a rdp_softc * can be cast into an
- * arpcom * or into an ifnet *.
- */
-
- /*
- * local stuff, somewhat sorted by memory alignment class
- */
- u_short baseaddr; /* IO port address */
- u_short txsize; /* tx size for next (buffered) packet,
- * there's only one additional packet
- * we can buffer, thus a single variable
- * ought to be enough */
- int txbusy; /* tx is transmitting */
- int txbuffered; /* # of packets in tx buffer */
- int slow; /* use lpt_control to send data */
- u_char irqenbit; /* mirror of current Ctrl_IRQEN */
- /*
- * type of parameter EEPROM; device flags 0x1 selects 74S288
- */
- enum {
- EEPROM_93C46, EEPROM_74S288 /* or 82S123 */
- } eeprom;
-};
-
-static struct rdp_softc rdp_softc[NRDP];
-
-/*
- * Since there's no fixed location in the EEPROM about where to find
- * the ethernet hardware address, we drop a table of valid OUIs here,
- * and search through the EEPROM until we find a possible valid
- * Ethernet address. Only the first 16 bits of all possible OUIs are
- * recorded in the table (as obtained from
- * http://standards.ieee.org/regauth/oui/oui.txt).
- */
-
-static u_short allowed_ouis[] = {
- 0x0000, 0x0001, 0x0002, 0x0004, 0x0005, 0x0006, 0x0007,
- 0x0008, 0x0010, 0x001C, 0x0020, 0x0040, 0x0050, 0x0060,
- 0x0070, 0x0080, 0x0090, 0x009D, 0x00A0, 0x00AA, 0x00BB,
- 0x00C0, 0x00CF, 0x00DD, 0x00E0, 0x00E6, 0x0207, 0x021C,
- 0x0260, 0x0270, 0x029D, 0x02AA, 0x02BB, 0x02C0, 0x02CF,
- 0x02E6, 0x040A, 0x04E0, 0x0800, 0x08BB, 0x1000, 0x1100,
- 0x8000, 0xAA00
-};
-
-/*
- * ISA bus support.
- */
-static int rdp_probe __P((struct isa_device *));
-static int rdp_attach __P((struct isa_device *));
-
-/*
- * Required entry points.
- */
-static void rdp_init(void *);
-static int rdp_ioctl(struct ifnet *, IOCTL_CMD_T, caddr_t);
-static void rdp_start(struct ifnet *);
-static void rdp_reset(struct ifnet *);
-static void rdp_watchdog(struct ifnet *);
-static void rdpintr(int);
-
-/*
- * REDP private functions.
- */
-
-static void rdp_stop(struct rdp_softc *);
-static void rdp_rint(struct rdp_softc *);
-static void rdp_get_packet(struct rdp_softc *, unsigned);
-static u_short rdp_write_mbufs(struct rdp_softc *, struct mbuf *);
-static int rdp_gethwaddr_93c46(struct rdp_softc *, u_char *);
-static void rdp_gethwaddr_74s288(struct rdp_softc *, u_char *);
-static void rdp_93c46_cmd(struct rdp_softc *, u_short, unsigned);
-static u_short rdp_93c46_read(struct rdp_softc *);
-
-struct isa_driver rdpdriver = {
- rdp_probe,
- rdp_attach,
- "rdp",
- 1 /* we wanna get a chance before lptN */
-};
-
-/*
- * REDP-specific functions.
- *
- * They are inlined, thus go first in this file. Together with gcc's
- * usual optimization, these functions probably come close to the
- * packet driver's hand-optimized code. ;-)
- *
- * Comments are partially obtained from the packet driver as well.
- * Some of the function names contain register names which don't make
- * much sense for us, but i've kept them for easier reference in
- * comparision to the packet driver.
- *
- * Some of the functions are currently not used by the driver; it's
- * not quite clear whether we ever need them at all. They are
- * supposedly even slower than what is currently implemented as `slow'
- * mode. Right now, `fast' (default) mode is what the packet driver
- * calls mode 0, slow mode is mode 3 (writing through lpt_control,
- * reading twice).
- *
- * We should autoprobe the modi, as opposed to making them dependent
- * on a kernel configuration flag.
- */
-
-/*
- * read a nibble from rreg; end-of-data cmd is not issued;
- * used for general register read.
- *
- * Unlike the packet driver's version, i'm shifting the result
- * by 3 here (as opposed to within the caller's code) for clarity.
- * -- Joerg
- */
-static __inline u_char
-RdNib(struct rdp_softc *sc, u_char rreg)
-{
-
- outb(sc->baseaddr + lpt_data, EOC + rreg);
- outb(sc->baseaddr + lpt_data, RdAddr + rreg); /* write addr */
- (void)inb(sc->baseaddr + lpt_status);
- return (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
-}
-
-#if 0
-/*
- * read a byte from MAR register through lpt_data; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 4 + 5
- */
-static __inline u_char
-RdByte(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_data, RdAddr + MAR); /* cmd for low nibble */
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_data, RdAddr + MAR + HNib);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-
-
-/*
- * read a byte from MAR register through lpt_data; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 6 + 7
- */
-static __inline u_char
-RdByte1(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_data, RdAddr + MAR); /* cmd for low nibble */
- (void)inb(sc->baseaddr + lpt_status);
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_data, RdAddr + MAR + HNib);
- (void)inb(sc->baseaddr + lpt_status);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-#endif
-
-
-/*
- * read a byte from MAR register through lpt_control; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 0 + 1
- */
-static __inline u_char
-RdByteA1(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-
-
-/*
- * read a byte from MAR register through lpt_control; the low nibble is
- * read prior to the high one; end-of-read command is not issued; used
- * for remote DMA in mode 2 + 3
- */
-static __inline u_char
-RdByteA2(struct rdp_softc *sc)
-{
- u_char hinib, lonib;
-
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- (void)inb(sc->baseaddr + lpt_status);
- lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f;
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead);
- (void)inb(sc->baseaddr + lpt_status);
- hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0;
- return hinib + lonib;
-}
-
-/*
- * End-of-read cmd
- */
-static __inline void
-RdEnd(struct rdp_softc *sc, u_char rreg)
-{
-
- outb(sc->baseaddr + lpt_data, EOC + rreg);
-}
-
-/*
- * Write a nibble to a register; end-of-write is issued.
- * Used for general register write.
- */
-static __inline void
-WrNib(struct rdp_softc *sc, u_char wreg, u_char wdata)
-{
-
- /* prepare and write address */
- outb(sc->baseaddr + lpt_data, EOC + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- /* prepare and write data */
- outb(sc->baseaddr + lpt_data, WrAddr + wdata);
- outb(sc->baseaddr + lpt_data, wdata);
- outb(sc->baseaddr + lpt_data, wdata);
- /* end-of-write */
- outb(sc->baseaddr + lpt_data, EOC + wdata);
-}
-
-/*
- * Write a byte to a register; end-of-write is issued.
- * Used for general register write.
- */
-static __inline void
-WrByte(struct rdp_softc *sc, u_char wreg, u_char wdata)
-{
-
- /* prepare and write address */
- outb(sc->baseaddr + lpt_data, EOC + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- outb(sc->baseaddr + lpt_data, WrAddr + wreg);
- /* prepare and write low nibble */
- outb(sc->baseaddr + lpt_data, WrAddr + (wdata & 0x0F));
- outb(sc->baseaddr + lpt_data, (wdata & 0x0F));
- outb(sc->baseaddr + lpt_data, (wdata & 0x0F));
- /* prepare and write high nibble */
- wdata >>= 4;
- outb(sc->baseaddr + lpt_data, wdata);
- outb(sc->baseaddr + lpt_data, wdata + HNib);
- outb(sc->baseaddr + lpt_data, wdata + HNib);
- /* end-of-write */
- outb(sc->baseaddr + lpt_data, EOC + wdata + HNib);
-}
-
-/*
- * Write the byte to DRAM via lpt_data;
- * used for remote DMA write in mode 0 / 2 / 4
- */
-static __inline void
-WrByteALToDRAM(struct rdp_softc *sc, u_char val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_data, MkHi(val));
-}
-
-/*
- * Write the byte to DRAM via lpt_control;
- * used for remote DMA write in mode 1 / 3 / 5
- */
-static __inline void
-WrByteALToDRAMA(struct rdp_softc *sc, u_char val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit);
- outb(sc->baseaddr + lpt_data, val >> 4);
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit);
-}
-
-#if 0 /* they could be used for the RAM test */
-/*
- * Write the u_short to DRAM via lpt_data;
- * used for remote DMA write in mode 0 / 2 / 4
- */
-static __inline void
-WrWordbxToDRAM(struct rdp_softc *sc, u_short val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, (val & 0x0F) + HNib);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val + HNib);
-}
-
-
-/*
- * Write the u_short to DRAM via lpt_control;
- * used for remote DMA write in mode 1 / 3 / 5
- */
-static __inline void
-WrWordbxToDRAMA(struct rdp_softc *sc, u_short val)
-{
-
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, (val & 0x0F) + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val & 0x0F);
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit);
- val >>= 4;
- outb(sc->baseaddr + lpt_data, val + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit);
-}
-#endif
-
-
-/*
- * Determine if the device is present
- *
- * on entry:
- * a pointer to an isa_device struct
- * on exit:
- * 0 if device not found
- * or # of i/o addresses used (if found)
- */
-static int
-rdp_probe(struct isa_device *isa_dev)
-{
- int unit = isa_dev->id_unit;
- struct rdp_softc *sc = &rdp_softc[unit];
- u_char b1, b2;
- intrmask_t irqmap[3];
- u_char sval[3];
-
- if (unit < 0 || unit >= NRDP)
- return 0;
-
- sc->baseaddr = isa_dev->id_iobase;
- if (isa_dev->id_flags & 1)
- sc->eeprom = EEPROM_74S288;
- /* else defaults to 93C46 */
- if (isa_dev->id_flags & 2)
- sc->slow = 1;
-
- /* let R/WB = A/DB = CSB = high to be ready for next r/w cycle */
- outb(sc->baseaddr + lpt_data, 0xFF);
- /* DIR = 0 for write mode, IRQEN=0, SLCT=INIT=AUTOFEED=STB=high */
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- /* software reset */
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_RST));
- DELAY(2000);
- /* is EPLC alive? */
- b1 = RdNib(sc, CMR1);
- RdEnd(sc, CMR1);
- b2 = RdNib(sc, CMR2) & 0x0f;
- b2 |= RdNib(sc, CMR2 + HNib) << 4;
- RdEnd(sc, CMR2 + HNib);
- /*
- * After the reset, we expect CMR1 & 7 to be 1 (rx buffer empty),
- * and CMR2 & 0xf7 to be 0x20 (receive mode set to physical and
- * broadcasts).
- */
- if (bootverbose)
- printf("rdp%d: CMR1 = %#x, CMR2 = %#x\n", unit, b1, b2);
-
- if ((b1 & (CMR1_BUFE | CMR1_IRQ | CMR1_TRA)) != CMR1_BUFE
- || (b2 & ~CMR2_IRQINV) != CMR2_AM_PB)
- return 0;
-
- /*
- * We have found something that could be a RTL 80[01]2, now
- * see whether we can generate an interrupt.
- */
- disable_intr();
-
- /*
- * Test whether our configured IRQ is working.
- *
- * Set to no acception mode + IRQout, then enable RxE + TxE,
- * then cause RBER (by advancing the read pointer although
- * the read buffer is empty) to generate an interrupt.
- */
- WrByte(sc, CMR2, CMR2_IRQOUT);
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_TE | CMR1_RE));
- WrNib(sc, CMR1, CMR1_RDPAC);
- DELAY(1000);
-
- irqmap[0] = isa_irq_pending();
- sval[0] = inb(sc->baseaddr + lpt_status);
-
- /* allow IRQs to pass the parallel interface */
- outb(sc->baseaddr + lpt_control, Ctrl_IRQEN + Ctrl_SelData);
- DELAY(1000);
- /* generate interrupt */
- WrNib(sc, IMR + HNib, MkHi(ISR_RBER));
- DELAY(1000);
-
- irqmap[1] = isa_irq_pending();
- sval[1] = inb(sc->baseaddr + lpt_status);
-
- /* de-assert and disable IRQ */
- WrNib(sc, IMR + HNib, MkHi(0));
- (void)inb(sc->baseaddr + lpt_status); /* might be necessary to
- clear IRQ */
- DELAY(1000);
- irqmap[2] = isa_irq_pending();
- sval[2] = inb(sc->baseaddr + lpt_status);
-
- WrNib(sc, CMR1 + HNib, MkHi(0));
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- WrNib(sc, CMR2, CMR2_IRQINV);
-
- enable_intr();
-
- if (bootverbose)
- printf("rdp%d: irq maps / lpt status "
- "%#x/%#x - %#x/%#x - %#x/%#x (id_irq %#x)\n",
- unit, irqmap[0], sval[0], irqmap[1], sval[1],
- irqmap[2], sval[2], isa_dev->id_irq);
-
- if ((irqmap[1] & isa_dev->id_irq) == 0) {
- printf("rdp%d: configured IRQ (%d) cannot be asserted "
- "by device",
- unit, ffs(isa_dev->id_irq) - 1);
- if (irqmap[1])
- printf(" (probable IRQ: %d)", ffs(irqmap[1]) - 1);
- printf("\n");
- return 0;
- }
-
- /*
- * XXX should do RAMtest here
- */
-
- switch (sc->eeprom) {
- case EEPROM_93C46:
- if (rdp_gethwaddr_93c46(sc, sc->arpcom.ac_enaddr) == 0) {
- printf("rdp%d: failed to find a valid hardware "
- "address in EEPROM\n",
- unit);
- return 0;
- }
- break;
-
- case EEPROM_74S288:
- rdp_gethwaddr_74s288(sc, sc->arpcom.ac_enaddr);
- break;
- }
-
- return lpt_control + 1;
-}
-
-/*
- * Install interface into kernel networking data structures
- */
-static int
-rdp_attach(struct isa_device *isa_dev)
-{
- int unit = isa_dev->id_unit;
- struct rdp_softc *sc = &rdp_softc[unit];
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- isa_dev->id_ointr = rdpintr;
-
- /*
- * Reset interface
- */
- rdp_stop(sc);
-
- if (!ifp->if_name) {
- /*
- * Initialize ifnet structure
- */
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "rdp";
- ifp->if_output = ether_output;
- ifp->if_start = rdp_start;
- ifp->if_ioctl = rdp_ioctl;
- ifp->if_watchdog = rdp_watchdog;
- ifp->if_init = rdp_init;
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
-
- /*
- * Attach the interface
- */
- if_attach(ifp);
- ether_ifattach(ifp);
- }
-
- /*
- * Print additional info when attached
- */
- printf("%s%d: RealTek RTL%s pocket ethernet, EEPROM %s, %s mode\n",
- ifp->if_name, ifp->if_unit,
- "8002", /* hook for 8012 */
- sc->eeprom == EEPROM_93C46? "93C46": "74S288",
- sc->slow? "slow": "fast");
- printf("%s%d: address %6D\n", ifp->if_name, ifp->if_unit,
- sc->arpcom.ac_enaddr, ":");
-
- /*
- * If BPF is in the kernel, call the attach for it
- */
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- return 1;
-}
-
-/*
- * Reset interface.
- */
-static void
-rdp_reset(struct ifnet *ifp)
-{
- struct rdp_softc *sc = ifp->if_softc;
- int s;
-
- s = splimp();
-
- /*
- * Stop interface and re-initialize.
- */
- rdp_stop(sc);
- rdp_init(sc);
-
- (void) splx(s);
-}
-
-/*
- * Take interface offline.
- */
-static void
-rdp_stop(struct rdp_softc *sc)
-{
-
- sc->txbusy = sc->txbusy = 0;
-
- /* disable printer interface interrupts */
- sc->irqenbit = 0;
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- outb(sc->baseaddr + lpt_data, 0xff);
-
- /* reset the RTL 8002 */
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_RST));
- DELAY(100);
-}
-
-/*
- * Device timeout/watchdog routine. Entered if the device neglects to
- * generate an interrupt after a transmit has been started on it.
- */
-static void
-rdp_watchdog(struct ifnet *ifp)
-{
-
- log(LOG_ERR, "rdp%d: device timeout\n", ifp->if_unit);
- ifp->if_oerrors++;
-
- rdp_reset(ifp);
-}
-
-/*
- * Initialize device.
- */
-static void
-rdp_init(void *xsc)
-{
- struct rdp_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- int i, s;
- u_char reg;
-
- /* address not known */
- if (TAILQ_EMPTY(&ifp->if_addrhead))
- return;
-
- s = splimp();
-
- ifp->if_timer = 0;
-
- /* program ethernet ID into the chip */
- for (i = 0, reg = IDR0; i < 6; i++, reg++)
- WrByte(sc, reg, sc->arpcom.ac_enaddr[i]);
-
- /* set accept mode */
- WrNib(sc, CMR2 + HNib,
- MkHi((ifp->if_flags & IFF_PROMISC)? CMR2_AM_ALL: CMR2_AM_PB));
-
- /* enable tx and rx */
- WrNib(sc, CMR1 + HNib, MkHi(CMR1_TE | CMR1_RE));
-
- /* allow interrupts to happen */
- WrNib(sc, CMR2, CMR2_IRQOUT | CMR2_IRQINV);
- WrNib(sc, IMR, ISR_TOK | ISR_TER | ISR_ROK | ISR_RER);
- WrNib(sc, IMR + HNib, MkHi(ISR_RBER));
-
- /* allow IRQs to pass the parallel interface */
- sc->irqenbit = Ctrl_IRQEN;
- outb(sc->baseaddr + lpt_control, sc->irqenbit + Ctrl_SelData);
-
- /* clear all flags */
- sc->txbusy = sc->txbuffered = 0;
-
- /*
- * Set 'running' flag, and clear output active flag.
- */
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- /*
- * ...and attempt to start output
- */
- rdp_start(ifp);
-
- (void) splx(s);
-}
-
-/*
- * Start output on interface.
- * We make two assumptions here:
- * 1) that the current priority is set to splimp _before_ this code
- * is called *and* is returned to the appropriate priority after
- * return
- * 2) that the IFF_OACTIVE flag is checked before this code is called
- * (i.e. that the output part of the interface is idle)
- */
-static void
-rdp_start(struct ifnet *ifp)
-{
- struct rdp_softc *sc = ifp->if_softc;
- struct mbuf *m;
- int len;
-
-outloop:
-
- /*
- * See if there is room to put another packet in the buffer.
- */
- if (sc->txbuffered) {
- /*
- * No room. Indicate this to the outside world and exit.
- */
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
- IF_DEQUEUE(&ifp->if_snd, m);
- if (m == 0) {
- /*
- * We are using the !OACTIVE flag to indicate to the outside
- * world that we can accept an additional packet rather than
- * that the transmitter is _actually_ active. Indeed, the
- * transmitter may be active, but if we haven't filled all the
- * buffers with data then we still want to accept more.
- */
- ifp->if_flags &= ~IFF_OACTIVE;
- return;
- }
-
- /*
- * Copy the mbuf chain into the transmit buffer
- */
-
- len = rdp_write_mbufs(sc, m);
- if (len == 0)
- goto outloop;
-
- /* ensure minimal valid ethernet length */
- len = max(len, (ETHER_MIN_LEN-ETHER_CRC_LEN));
-
- /*
- * Actually start the transceiver. Set a timeout in case the
- * Tx interrupt never arrives.
- */
- if (!sc->txbusy) {
- WrNib(sc, TBCR1, len >> 8);
- WrByte(sc, TBCR0, len & 0xff);
- WrNib(sc, CMR1, CMR1_TRA);
- sc->txbusy = 1;
- ifp->if_timer = 2;
- } else {
- sc->txbuffered = 1;
- sc->txsize = len;
- }
-
- /*
- * Tap off here if there is a bpf listener.
- */
-#if NBPFILTER > 0
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- }
-#endif
-
- m_freem(m);
-
- /*
- * Loop back to the top to possibly buffer more packets
- */
- goto outloop;
-}
-
-/*
- * Process an ioctl request.
- */
-static int
-rdp_ioctl(struct ifnet *ifp, IOCTL_CMD_T command, caddr_t data)
-{
- struct rdp_softc *sc = ifp->if_softc;
- int s, error = 0;
-
- s = splimp();
-
- switch (command) {
-
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
-
- case SIOCSIFFLAGS:
- /*
- * If the interface is marked up and stopped, then start it.
- * If it is marked down and running, then stop it.
- */
- if (ifp->if_flags & IFF_UP) {
- if ((ifp->if_flags & IFF_RUNNING) == 0)
- rdp_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING) {
- rdp_stop(sc);
- ifp->if_flags &= ~IFF_RUNNING;
- }
- }
-
-#if NBPFILTER > 0
- /*
- * Promiscuous flag may have changed, propagage this
- * to the NIC.
- */
- if (ifp->if_flags & IFF_UP)
- WrNib(sc, CMR2 + HNib,
- MkHi((ifp->if_flags & IFF_PROMISC)?
- CMR2_AM_ALL: CMR2_AM_PB));
-
-#endif
- break;
-
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- /*
- * Multicast list has changed; we don't support it.
- */
- error = ENOTTY;
- break;
-
- default:
- error = EINVAL;
- }
- (void) splx(s);
- return (error);
-}
-
-/*
- * External interrupt service routine.
- */
-void
-rdpintr(int unit)
-{
- struct rdp_softc *sc = rdp_softc + unit;
- struct ifnet *ifp = (struct ifnet *)sc;
- u_char isr, tsr, rsr, colls;
-
- /* disable interrupts, so SD3 can be routed to the pin */
- sc->irqenbit = 0;
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- WrNib(sc, CMR2, CMR2_IRQINV);
- /*
- * loop until there are no more new interrupts
- */
- for (;;) {
- isr = RdNib(sc, ISR);
- isr |= RdNib(sc, ISR + HNib) << 4;
- RdEnd(sc, ISR + HNib);
-
- if (isr == 0)
- break;
-#if DEBUG & 4
- printf("rdp%d: ISR = %#x\n", unit, isr);
-#endif
-
- /*
- * Clear the pending interrupt bits.
- */
- WrNib(sc, ISR, isr & 0x0f);
- if (isr & 0xf0)
- WrNib(sc, ISR + HNib, MkHi(isr));
-
- /*
- * Handle transmitter interrupts.
- */
- if (isr & (ISR_TOK | ISR_TER)) {
- tsr = RdNib(sc, TSR);
- RdEnd(sc, TSR);
-#if DEBUG & 4
- if (isr & ISR_TER)
- printf("rdp%d: tsr %#x\n", unit, tsr);
-#endif
- if (tsr & TSR_TABT)
- ifp->if_oerrors++;
- else
- /*
- * Update total number of successfully
- * transmitted packets.
- */
- ifp->if_opackets++;
-
- if (tsr & TSR_COL) {
- colls = RdNib(sc, COLR);
- RdEnd(sc, COLR);
- ifp->if_collisions += colls;
- }
-
- /*
- * reset tx busy and output active flags
- */
- sc->txbusy = 0;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- /*
- * If we had already queued up another packet,
- * start sending it now.
- */
- if (sc->txbuffered) {
- WrNib(sc, TBCR1, sc->txsize >> 8);
- WrByte(sc, TBCR0, sc->txsize & 0xff);
- WrNib(sc, CMR1, CMR1_TRA);
- sc->txbusy = 1;
- sc->txbuffered = 0;
- ifp->if_timer = 2;
- } else {
- /*
- * clear watchdog timer
- */
- ifp->if_timer = 0;
- }
-
- }
-
- /*
- * Handle receiver interrupts
- */
- if (isr & (ISR_ROK | ISR_RER | ISR_RBER)) {
- rsr = RdNib(sc, RSR);
- rsr |= RdNib(sc, RSR + HNib) << 4;
- RdEnd(sc, RSR + HNib);
-#if DEBUG & 4
- if (isr & (ISR_RER | ISR_RBER))
- printf("rdp%d: rsr %#x\n", unit, rsr);
-#endif
-
- if (rsr & (RSR_PUN | RSR_POV)) {
- printf("rdp%d: rsr %#x, resetting\n",
- unit, rsr);
- rdp_reset(ifp);
- break;
- }
-
- if (rsr & RSR_BUFO)
- /*
- * CRC and FA errors are recorded in
- * rdp_rint() on a per-packet basis
- */
- ifp->if_ierrors++;
- if (isr & (ISR_ROK | ISR_RER))
- rdp_rint(sc);
- }
-
- /*
- * If it looks like the transmitter can take more data,
- * attempt to start output on the interface. This is done
- * after handling the receiver to give the receiver priority.
- */
- if ((ifp->if_flags & IFF_OACTIVE) == 0)
- rdp_start(ifp);
-
- }
- /* re-enable interrupts */
- WrNib(sc, CMR2, CMR2_IRQOUT | CMR2_IRQINV);
- sc->irqenbit = Ctrl_IRQEN;
- outb(sc->baseaddr + lpt_control, Ctrl_SelData + sc->irqenbit);
-}
-
-/*
- * Ethernet interface receiver interrupt.
- */
-static void
-rdp_rint(struct rdp_softc *sc)
-{
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct rdphdr rh;
- u_short len;
- size_t i;
- u_char *packet_ptr, b, status;
- int excessive_bad_pkts = 0;
-
- /*
- * Fetch the packets from the NIC's buffer.
- */
- for (;;) {
- b = RdNib(sc, CMR1);
- RdEnd(sc, CMR1);
-
- if (b & CMR1_BUFE)
- /* no more packets */
- break;
-
- /* first, obtain the buffer header */
-
- outb(sc->baseaddr + lpt_data, MAR + EOC); /* prepare addr */
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- outb(sc->baseaddr + lpt_data, MAR + RdAddr + HNib);
-
- packet_ptr = (u_char *)&rh;
- if (sc->slow)
- for (i = 0; i < sizeof rh; i++, packet_ptr++)
- *packet_ptr = RdByteA2(sc);
- else
- for (i = 0; i < sizeof rh; i++, packet_ptr++)
- *packet_ptr = RdByteA1(sc);
-
- RdEnd(sc, MAR + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
-
- len = rh.pktlen - ETHER_CRC_LEN;
- status = rh.status;
-
- if ((status & (RSR_ROK | RSR_CRC | RSR_FA)) != RSR_ROK ||
- len > (ETHER_MAX_LEN - ETHER_CRC_LEN) ||
- len < (ETHER_MIN_LEN - ETHER_CRC_LEN) ||
- len > MCLBYTES) {
-#if DEBUG
- printf("rdp%d: bad packet in buffer, "
- "len %d, status %#x\n",
- ifp->if_unit, (int)len, (int)status);
-#endif
- ifp->if_ierrors++;
- /* rx jump packet */
- WrNib(sc, CMR1, CMR1_RDPAC);
- if (++excessive_bad_pkts > 5) {
- /*
- * the chip seems to be stuck, we are
- * probably seeing the same bad packet
- * over and over again
- */
-#if DEBUG
- printf("rdp%d: resetting due to an "
- "excessive number of bad packets\n",
- ifp->if_unit);
-#endif
- rdp_reset(ifp);
- return;
- }
- continue;
- }
-
- /*
- * Go get packet.
- */
- excessive_bad_pkts = 0;
- rdp_get_packet(sc, len);
- ifp->if_ipackets++;
- }
-}
-
-/*
- * Retreive packet from NIC memory and send to the next level up via
- * ether_input(). If there is a BPF listener, give a copy to BPF,
- * too.
- */
-static void
-rdp_get_packet(struct rdp_softc *sc, unsigned len)
-{
- struct ether_header *eh;
- struct mbuf *m;
- u_char *packet_ptr;
- size_t s;
-
- /* Allocate a header mbuf */
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == NULL)
- return;
- m->m_pkthdr.rcvif = &sc->arpcom.ac_if;
- m->m_pkthdr.len = m->m_len = len;
-
- /*
- * We always put the received packet in a single buffer -
- * either with just an mbuf header or in a cluster attached
- * to the header. The +2 is to compensate for the alignment
- * fixup below.
- */
- if ((len + 2) > MHLEN) {
- /* Attach an mbuf cluster */
- MCLGET(m, M_DONTWAIT);
-
- /* Insist on getting a cluster */
- if ((m->m_flags & M_EXT) == 0) {
- m_freem(m);
- return;
- }
- }
-
- /*
- * The +2 is to longword align the start of the real packet.
- * This is important for NFS.
- */
- m->m_data += 2;
- eh = mtod(m, struct ether_header *);
-
- /*
- * Get packet, including link layer address, from interface.
- */
- outb(sc->baseaddr + lpt_control, Ctrl_LNibRead);
- outb(sc->baseaddr + lpt_data, RdAddr + MAR);
-
- packet_ptr = (u_char *)eh;
- if (sc->slow)
- for (s = 0; s < len; s++, packet_ptr++)
- *packet_ptr = RdByteA2(sc);
- else
- for (s = 0; s < len; s++, packet_ptr++)
- *packet_ptr = RdByteA1(sc);
-
- RdEnd(sc, MAR + HNib);
- outb(sc->baseaddr + lpt_control, Ctrl_SelData);
- WrNib(sc, CMR1, CMR1_RDPAC);
-
-#if NBPFILTER > 0
-
- /*
- * Check if there's a BPF listener on this interface. If so, hand off
- * the raw packet to bpf.
- */
- if (sc->arpcom.ac_if.if_bpf) {
- bpf_mtap(&sc->arpcom.ac_if, m);
-
- /*
- * Note that the interface cannot be in promiscuous mode if
- * there are no BPF listeners. And if we are in promiscuous
- * mode, we have to check if this packet is really ours.
- */
- if ((sc->arpcom.ac_if.if_flags & IFF_PROMISC) &&
- bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- return;
- }
- }
-#endif
-
- /*
- * Remove link layer address.
- */
- m->m_pkthdr.len = m->m_len = len - sizeof(struct ether_header);
- m->m_data += sizeof(struct ether_header);
-
- ether_input(&sc->arpcom.ac_if, eh, m);
- return;
-}
-
-/*
- * Write an mbuf chain to the NIC's tx buffer.
- */
-static u_short
-rdp_write_mbufs(struct rdp_softc *sc, struct mbuf *m)
-{
- u_short total_len;
- struct mbuf *mp;
- u_char *dp, b;
- int i;
-
- /* First, count up the total number of bytes to copy */
- for (total_len = 0, mp = m; mp; mp = mp->m_next)
- total_len += mp->m_len;
-
- if (total_len == 0)
- return 0;
-
- outb(sc->baseaddr + lpt_data, MAR | EOC);
-
- /*
- * Transfer the mbuf chain to the NIC memory.
- */
- if (sc->slow) {
- /* writing the first byte is complicated */
- outb(sc->baseaddr + lpt_control,
- Ctrl_LNibRead | sc->irqenbit);
- outb(sc->baseaddr + lpt_data, MAR | WrAddr);
- b = *(u_char *)m->m_data;
- outb(sc->baseaddr + lpt_data, (b & 0x0f) | 0x40);
- outb(sc->baseaddr + lpt_data, b & 0x0f);
- outb(sc->baseaddr + lpt_data, b >> 4);
- outb(sc->baseaddr + lpt_control,
- Ctrl_HNibRead | sc->irqenbit);
- /* advance the mbuf pointer */
- mp = m;
- m->m_len--;
- m->m_data++;
- /* write the remaining bytes */
- while (m) {
- for (i = 0, dp = (u_char *)m->m_data;
- i < m->m_len;
- i++, dp++)
- WrByteALToDRAMA(sc, *dp);
- m = m->m_next;
- }
- /*
- * restore old mbuf in case we have to hand it off to
- * BPF again
- */
- m = mp;
- m->m_len++;
- m->m_data--;
-
- /* the RTL 8002 requires an even byte-count remote DMA */
- if (total_len & 1)
- WrByteALToDRAMA(sc, 0);
- } else {
- outb(sc->baseaddr + lpt_data, MAR | WrAddr);
- while (m) {
- for (i = 0, dp = (u_char *)m->m_data;
- i < m->m_len;
- i++, dp++)
- WrByteALToDRAM(sc, *dp);
- m = m->m_next;
- }
-
- /* the RTL 8002 requires an even byte-count remote DMA */
- if (total_len & 1)
- WrByteALToDRAM(sc, 0);
- }
-
- outb(sc->baseaddr + lpt_data, 0xff);
- outb(sc->baseaddr + lpt_control,
- Ctrl_HNibRead | Ctrl_SelData | sc->irqenbit);
-
- return total_len;
-}
-
-/*
- * Read the designated ethernet hardware address out of a 93C46
- * (serial) EEPROM.
- * Note that the 93C46 uses 16-bit words in big-endian notation.
- */
-static int
-rdp_gethwaddr_93c46(struct rdp_softc *sc, u_char *etheraddr)
-{
- int i, magic;
- size_t j = 0;
- u_short w;
-
- WrNib(sc, CMR2, CMR2_PAGE | CMR2_IRQINV); /* select page 1 */
-
- /*
- * The original RealTek packet driver had the ethernet address
- * starting at EEPROM address 0. Other vendors seem to have
- * gone `creative' here -- while they didn't do anything else
- * than changing a few strings in the entire driver, compared
- * to the RealTek version, they also moved out the ethernet
- * address to a different location in the EEPROM, so the
- * original RealTek driver won't work correctly with them, and
- * vice versa. Sounds pretty cool, eh? $@%&!
- *
- * Anyway, we walk through the EEPROM, until we find some
- * allowable value based upon our table of IEEE OUI assignments.
- */
- for (i = magic = 0; magic < 3 && i < 32; i++) {
- /* read cmd (+ 6 bit address) */
- rdp_93c46_cmd(sc, 0x180 + i, 10);
- w = rdp_93c46_read(sc);
- switch (magic) {
- case 0:
- for (j = 0;
- j < sizeof allowed_ouis / sizeof(u_short);
- j++)
- if (w == allowed_ouis[j]) {
- etheraddr[0] = (w >> 8) & 0xff;
- etheraddr[1] = w & 0xff;
- magic++;
- break;
- }
- break;
-
- case 1:
- /*
- * If the first two bytes have been 00:00, we
- * discard the match iff the next two bytes
- * are also 00:00, so we won't get fooled by
- * an EEPROM that has been filled with zeros.
- * This in theory would disallow 64 K of legal
- * addresses assigned to Xerox, but it's
- * almost certain that those addresses haven't
- * been used for RTL80[01]2 chips anyway.
- */
- if ((etheraddr[0] | etheraddr[1]) == 0 && w == 0) {
- magic--;
- break;
- }
-
- etheraddr[2] = (w >> 8) & 0xff;
- etheraddr[3] = w & 0xff;
- magic++;
- break;
-
- case 2:
- etheraddr[4] = (w >> 8) & 0xff;
- etheraddr[5] = w & 0xff;
- magic++;
- break;
- }
- }
-
- WrNib(sc, CMR2, CMR2_IRQINV); /* back to page 0 */
-
- return magic == 3;
-}
-
-/*
- * Read the designated ethernet hardware address out of a 74S288
- * EEPROM.
- *
- * This is untested, since i haven't seen any adapter actually using
- * a 74S288. In the RTL 8012, only the serial EEPROM (94C46) is
- * supported anymore.
- */
-static void
-rdp_gethwaddr_74s288(struct rdp_softc *sc, u_char *etheraddr)
-{
- int i;
- u_char b;
-
- WrNib(sc, CMR2, CMR2_PAGE | CMR2_IRQINV); /* select page 1 */
-
- for (i = 0; i < 6; i++) {
- WrNib(sc, PCMR, i & 0x0f); /* lower 4 bit of addr */
- WrNib(sc, PCMR + HNib, HNib + 4); /* upper 2 bit addr + /CS */
- WrNib(sc, PCMR + HNib, HNib); /* latch data now */
- b = RdNib(sc, PDR) & 0x0f;
- b |= (RdNib(sc, PDR + HNib) & 0x0f) << 4;
- etheraddr[i] = b;
- }
-
- RdEnd(sc, PDR + HNib);
- WrNib(sc, CMR2, CMR2_IRQINV); /* reselect page 0 */
-}
-
-/*
- * Send nbits of data (starting with MSB) out to the 93c46 as a
- * command. Assumes register page 1 has already been selected.
- */
-static void
-rdp_93c46_cmd(struct rdp_softc *sc, u_short data, unsigned nbits)
-{
- u_short mask = 1 << (nbits - 1);
- unsigned i;
- u_char b;
-
-#if DEBUG & 2
- printf("rdp_93c46_cmd(): ");
-#endif
- for (i = 0; i < nbits; i++, mask >>= 1) {
- b = HNib + PCMR_SK + PCMR_CS;
- if (data & mask)
- b += PCMR_DO;
-#if DEBUG & 2
- printf("%d", b & 1);
-#endif
- WrNib(sc, PCMR + HNib, b);
- DELAY(1);
- WrNib(sc, PCMR + HNib, b & ~PCMR_SK);
- DELAY(1);
- }
-#if DEBUG & 2
- printf("\n");
-#endif
-}
-
-/*
- * Read one word of data from the 93c46. Actually, we have to read
- * 17 bits, and discard the very first bit. Assumes register page 1
- * to be selected as well.
- */
-static u_short
-rdp_93c46_read(struct rdp_softc *sc)
-{
- u_short data = 0;
- u_char b;
- int i;
-
-#if DEBUG & 2
- printf("rdp_93c46_read(): ");
-#endif
- for (i = 0; i < 17; i++) {
- WrNib(sc, PCMR + HNib, PCMR_SK + PCMR_CS + HNib);
- DELAY(1);
- WrNib(sc, PCMR + HNib, PCMR_CS + HNib);
- DELAY(1);
- b = RdNib(sc, PDR);
- data <<= 1;
- if (b & 1)
- data |= 1;
-#if DEBUG & 2
- printf("%d", b & 1);
-#endif
- RdEnd(sc, PDR);
- DELAY(1);
- }
-
-#if DEBUG & 2
- printf("\n");
-#endif
- /* end of cycle */
- WrNib(sc, PCMR + HNib, PCMR_SK + HNib);
- DELAY(1);
-
- return data;
-}
diff --git a/sys/i386/isa/if_rdpreg.h b/sys/i386/isa/if_rdpreg.h
deleted file mode 100644
index cab679a4bd3eb..0000000000000
--- a/sys/i386/isa/if_rdpreg.h
+++ /dev/null
@@ -1,187 +0,0 @@
-#ifndef IF_RDPREG_H
-#define IF_RDPREG_H 1
-/*
- * Copyright (c) 1998 Joerg Wunsch
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_rdpreg.h,v 1.1.1.1 1998/12/21 12:43:35 j Exp $
- */
-
-/*
- * Part of the definitions here has been copied over from the REDP
- * packet driver's REDPPD.INC file. This provides us with the same
- * set of acronyms as the packet driver is using.
- *
- * The packet driver had no copyright, and is believed to be in the
- * public domain. The author seems to be someone who calls himself
- * "Chiu", so that's the only acknowledgment i can give here.
- * Supposedly the author was someone from RealTek.
- */
-
-/*
- * We're hanging upon an LPT port, thus suck in the lpt defs as well.
- */
-#include <i386/isa/lptreg.h>
-
-struct rdphdr {
- /* RTL8002 header that is prepended to the actual packet */
- u_char unused2[2];
- u_short pktlen;
- u_char status; /* copy of RSR for this packet */
- u_char unused3[3];
-};
-
-/*
- *
- * 8 Data Modes are provided:
- *
- * +--------+---------------+-------------+
- * | Mode | Read | Write |
- * +--------+---------------+-------------+
- * | 0 | LptCtrl | LptData |
- * +--------+---------------+-------------+
- * | 1 | LptCtrl | LptCtrl |
- * +--------+---------------+-------------+
- * | 2 | LptCtrl*2 | LptData |
- * +--------+---------------+-------------+
- * | 3 | LptCtrl*2 | LptCtrl |
- * +--------+---------------+-------------+
- * | 4 | LptData | LptData |
- * +--------+---------------+-------------+
- * | 5 | LptData | LptCtrl |
- * +--------+---------------+-------------+
- * | 6 | LptData*2 | LptData |
- * +--------+---------------+-------------+
- * | 7 | LptData*2 | LptCtrl |
- * +--------+---------------+-------------+
- *
- * Right now, this driver only implements mode 0 (which ought to work
- * on any standard parallel interface).
- *
- */
-
-/*
- * Page 0 of EPLC registers
- */
-#define IDR0 0x00 /* Ethernet ID register (R/W) */
-#define IDR1 0x01
-#define IDR2 0x02
-#define IDR3 0x03
-#define IDR4 0x04
-#define IDR5 0x05
-#define TBCR0 0x06 /* transmit byte count (W), 11 bits valid */
-#define TBCR1 0x07
-#define TSR 0x08 /* transmit status (R), cleared upon next tx */
-# define TSR_TOK 1 /* transmit OK */
-# define TSR_TABT 2 /* transmit aborted (excessive collisions) */
-# define TSR_COL 4 /* collision detected */
-# define TSR_CDH 8 /* CD heartbeat detected */
-#define RSR 0x09 /*
- * receiver status (R), cleared upon next
- * received packet (but stored in rx buffer
- * header anyway)
- */
-# define RSR_ROK 1 /* receive OK */
-# define RSR_CRC 2 /* CRC error */
-# define RSR_FA 4 /* frame alignment error (not multiple of 8) */
-# define RSR_BUFO 0x10 /* rx buffer overflow, packet discarded */
-# define RSR_PUN 0x20 /* packet count underflow (jump command issued
- * but rx buffer was empty) */
-# define RSR_POV 0x40 /* packet count overflow (more than 254 (?)
- * packets still in buffer) */
-#define ISR 0x0A /* interrupt status register (R), writing
- * clears the written bits */
-# define ISR_TOK 1 /* transmission OK (~ TSR_TOK) */
-# define ISR_TER 2 /* transmitter error (~ TSR_TABT) */
-# define ISR_ROK 4 /* receive OK (~ RSR_ROK) */
-# define ISR_RER 8 /* receiver error (~ RSR_CRC|RSR_FA) */
-# define ISR_RBER 0x10 /* rx buffer overflow (POV|PUN|BUFO) */
-#define IMR 0x0B /* interrupt mask register (R/W), bit as ISR */
-#define CMR1 0x0C /* command register 1 (R/W) */
-# define CMR1_BUFE 1 /* (R) rx buffer empty */
-# define CMR1_IRQ 2 /* (R) interrupt request */
-# define CMR1_TRA 4 /* (R) transmission in progress */
- /* (W) transmit start */
-# define CMR1_TE 0x10 /* (R/W) transmitter enable */
-# define CMR1_RE 0x20 /* (R/W) receiver enable */
-# define CMR1_RST 0x40 /* (R/W) reset; sticks until reset completed */
-# define CMR1_RDPAC 1 /* (W) `rx jump packet', prepare for reading
- * next packet from ring buffer */
-# define CMR1_WRPAC 2 /* (W) `tx jump packet', packet in tx buffer
- * is complete and can be sent */
-# define CMR1_RETX 8 /* (W) retransmit (must be accomp'ed by TRA) */
-# define CMR1_MUX 0x80 /* (W) RTL8012: tell the printer MUX to
- * connect the output pins to the host */
-#define CMR2 0x0D /* command register 2 (R/W) */
-# define CMR2_IRQOUT 1 /* interrupt signal output enabled */
-# define CMR2_RAMTST 2 /* enable RAM test */
-# define CMR2_PAGE 4 /* select register page #1 */
-# define CMR2_IRQINV 8 /* make active IRQ `low' */
-# define CMR2_AMbits 0x30 /* address mode bits: */
-# define CMR2_AM_NONE 0x00 /* 0: accept nothing */
-# define CMR2_AM_PHYS 0x10 /* 1: only physical addr */
-# define CMR2_AM_PB 0x20 /* 2: phys + broadcast */
-# define CMR2_AM_ALL 0x30 /* 3: promiscuous */
-# define CMR2_LBK 0x40 /* enable loopback */
-# define CMR2_SER 0x80 /* save error packet */
-#define MAR 0x0E /* memory access register (?), used for
- * remote DMA to the 8002's buffer */
-#define PNR TBCR0 /* received packet number (R) */
-#define COLR TBCR1 /* collision count (R) (4 bit valid) */
-
-/*
- * Page 1 of EPLC registers -- EEPROM control
- */
-#define PCMR TBCR0 /* port command register */
-/* bits for 93C46 control -- add HNib */
-#define PCMR_SK 0x04 /* serial clock for EEPROM */
-#define PCMR_CS 0x02 /* chip select for EEPROM */
-#define PCMR_DO 0x01 /* DI to EEPROM */
-
-/* EEPROM data, nibbles for 74S288, bits for 93C46 */
-#define PDR TBCR1 /* DO from EEPROM, only bit 0 valid for
- * serial EEPROM */
-
-/*
- * The following definitionss define remote DMA command through LptCtrl
- */
-#define ATFD 3 /* ATFD bit in Lpt's Control register */
- /* -> ATFD bit is added for Xircom's MUX */
-#define Ctrl_LNibRead (0x08+ATFD) /* specify low nibble */
-#define Ctrl_HNibRead (0+ATFD) /* specify high nibble */
-#define Ctrl_SelData (0x04+ATFD) /* not through LptCtrl but through */
- /* LptData */
-#define Ctrl_IRQEN 0x10 /* set IRQEN of lpt control register */
-
-/* Here define constants to construct the required read/write commands */
-#define WrAddr 0x40 /* set address of EPLC write register */
-#define RdAddr 0x0C0 /* set address of EPLC read register */
-#define EOR 0x20 /* ORed to make 'end of read',set CSB=1 */
-#define EOW 0x0E0 /* end of write, R/WB=A/DB=CSB=1 */
-#define EOC 0x0E0 /* End Of r/w Command, R/WB=A/DB=CSB=1 */
-#define HNib 0x10
-
-#define MkHi(value) (((value) >> 4) | HNib)
-
-#endif /* IF_RDPREG_H */
diff --git a/sys/i386/isa/if_sr.c b/sys/i386/isa/if_sr.c
index b37e5633f387b..236bb42f0d1d4 100644
--- a/sys/i386/isa/if_sr.c
+++ b/sys/i386/isa/if_sr.c
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_sr.c,v 1.20 1999/01/18 21:23:47 julian Exp $
+ * $Id: if_sr.c,v 1.14 1998/06/17 13:54:56 bde Exp $
*/
/*
@@ -269,7 +269,6 @@ struct sr_hardc *srattach_pci(int unit, vm_offset_t plx_vaddr,
vm_offset_t sca_vaddr);
void srintr_hc(struct sr_hardc *hc);
-static ointhand2_t srintr;
static int srattach(struct sr_hardc *hc);
static void sr_xmit(struct sr_softc *sc);
static void srstart(struct ifnet *ifp);
@@ -572,8 +571,6 @@ srattach_isa(struct isa_device *id)
u_char mar;
struct sr_hardc *hc = &sr_hardc[id->id_unit];
- id->id_ointr = srintr;
-
outb(hc->iobase + SR_PCR, inb(hc->iobase + SR_PCR) | SR_PCR_SCARUN);
outb(hc->iobase + SR_PSR, inb(hc->iobase + SR_PSR) | SR_PSR_EN_SCA_DMA);
outb(hc->iobase + SR_MCR,
@@ -860,26 +857,24 @@ srattach(struct sr_hardc *hc)
}
/*
- * N2 Interrupt Service Routine.
- * Get the ISA interrupts.
- *
+ * N2 Interrupt Service Routine
+ *
* First figure out which SCA gave the interrupt.
- *
+ * Process it.
+ * See if there is other interrupts pending.
+ * Repeat until there no interrupts remain.
*/
-static void
+void
srintr(int unit)
-{
- struct sr_hardc *hc;
+{
+ struct sr_hardc *hc;
hc = &sr_hardc[unit];
srintr_hc(hc);
- return;
+ return;
}
-/*
- * PCI interrupts come straight here
- */
void
srintr_hc(struct sr_hardc *hc)
{
@@ -1315,6 +1310,13 @@ srioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
sc->ifsppp.pp_flags |= PP_KEEPALIVE;
sppp_attach(&sc->ifsppp.pp_if);
+ /*
+ * Shortcut the sppp tls/tlf actions to
+ * up/down events since our lower layer is
+ * always ready.
+ */
+ sc->ifsppp.pp_tls = sc->ifsppp.pp_up;
+ sc->ifsppp.pp_tlf = sc->ifsppp.pp_down;
}
sc->attached = sc->protocol;
@@ -1499,6 +1501,13 @@ sr_up(struct sr_softc *sc)
sc->ifsppp.pp_flags |= PP_KEEPALIVE;
sppp_attach(&sc->ifsppp.pp_if);
+ /*
+ * Shortcut the sppp tls/tlf actions to
+ * up/down events since our lower layer is
+ * always ready.
+ */
+ sc->ifsppp.pp_tls = sc->ifsppp.pp_up;
+ sc->ifsppp.pp_tlf = sc->ifsppp.pp_down;
}
sc->attached = sc->protocol;
diff --git a/sys/i386/isa/if_wl.c b/sys/i386/isa/if_wl.c
index 42fc0f91bf82b..66dbffd407867 100644
--- a/sys/i386/isa/if_wl.c
+++ b/sys/i386/isa/if_wl.c
@@ -1,4 +1,4 @@
-/* $Id: if_wl.c,v 1.19 1998/12/09 03:30:51 eivind Exp $ */
+/* $Id: if_wl.c,v 1.14 1998/08/20 05:49:59 msmith Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -81,7 +81,7 @@
*
* sample config:
*
- * device wl0 at isa? port 0x300 net irq ?
+ * device wl0 at isa? port 0x300 net irq ? vector wlintr
*
* Ifdefs:
* 1. WLDEBUG. (off) - if turned on enables IFF_DEBUG set via ifconfig debug
@@ -302,7 +302,6 @@ static void wlstart(struct ifnet *ifp);
static void wlinit(void *xsc);
static int wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
static timeout_t wlwatchdog;
-static ointhand2_t wlintr;
static void wlxmt(int unt, struct mbuf *m);
static int wldiag(int unt);
static int wlconfig(int unit);
@@ -311,6 +310,7 @@ static void wlmmcstat(int unit);
static u_short wlbldru(int unit);
static u_short wlmmcread(u_int base, u_short reg);
static void wlinitmmc(int unit);
+static void wlsetirq(int base, int irq);
static int wlhwrst(int unit);
static void wlrustrt(int unit);
static void wlbldcu(int unit);
@@ -331,7 +331,7 @@ static void wl_cache_store(int, int, struct ether_header *, struct mbuf *);
static void wl_cache_zero(int unit);
#endif
#ifdef MULTICAST
-# if defined(__FreeBSD__) && __FreeBSD_version < 300000
+# if __FreeBSD < 3
static int check_allmulti(int unit);
# endif
#endif
@@ -364,6 +364,7 @@ wlprobe(struct isa_device *id)
{
struct wl_softc *sc = &wl_softc[id->id_unit];
register short base = id->id_iobase;
+ int unit = id->id_unit;
char *str = "wl%d: board out of range [0..%d]\n";
u_char inbuf[100];
unsigned long oldpri;
@@ -442,7 +443,6 @@ wlattach(struct isa_device *id)
#ifdef WLDEBUG
printf("wlattach: base %x, unit %d\n", base, unit);
#endif
- id->id_ointr = wlintr;
sc->base = base;
sc->unit = unit;
sc->flags = 0;
@@ -494,7 +494,7 @@ wlattach(struct isa_device *id)
#endif
#if MULTICAST
ifp->if_flags |= IFF_MULTICAST;
-#endif /* MULTICAST */
+#endif MULTICAST
ifp->if_name = "wl";
ifp->if_unit = unit;
ifp->if_init = wlinit;
@@ -680,7 +680,7 @@ wlinit(void *xsc)
if (sc->wl_if.if_flags & IFF_DEBUG)
printf("wl%d: entered wlinit()\n",sc->unit);
#endif
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+#if __FreeBSD__ >= 3
if (ifp->if_addrhead.tqh_first == (struct ifaddr *)0) {
#else
if (ifp->if_addrlist == (struct ifaddr *)0) {
@@ -721,6 +721,8 @@ static int
wlhwrst(int unit)
{
register struct wl_softc *sc = WLSOFTC(unit);
+ int i;
+ short base = sc->base;
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
@@ -736,7 +738,7 @@ wlhwrst(int unit)
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
wlmmcstat(unit); /* Display MMC registers */
-#endif /* WLDEBUG */
+#endif WLDEBUG
wlbldcu(unit); /* set up command unit structures */
if (wldiag(unit) == 0)
@@ -1167,6 +1169,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
short base = sc->base;
short mode = 0;
int opri, error = 0;
+ u_short tmp;
struct proc *p = curproc; /* XXX */
int irq, irqval, i, isroot, size;
caddr_t up;
@@ -1254,7 +1257,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCADDMULTI:
case SIOCDELMULTI:
-#if defined(__FreeBSD__) && __FreeBSD_version < 300000
+#if __FreeBSD__ < 3
if (cmd == SIOCADDMULTI) {
error = ether_addmulti(ifr, &sc->wl_ac);
}
@@ -1284,7 +1287,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
#endif
break;
-#endif /* MULTICAST */
+#endif MULTICAST
/* DEVICE SPECIFIC */
@@ -1469,13 +1472,16 @@ wlwatchdog(void *vsc)
* output : either a packet is received, or a packet is transfered
*
*/
-static void
+void
wlintr(unit)
int unit;
{
register struct wl_softc *sc = &wl_softc[unit];
+ scb_t scb;
+ ac_t cb;
short base = sc->base;
- int ac_status;
+ int next, x, opri;
+ int i, ac_status;
u_short int_type, int_type1;
#ifdef WLDEBUG
@@ -1563,7 +1569,7 @@ int unit;
if (ac_status & TC_CARRIER) {
printf("wl%d: no carrier\n", unit);
}
-#endif /* notdef */
+#endif notdef
if (ac_status & TC_CLS) {
printf("wl%d: no CTS\n", unit);
}
@@ -1725,7 +1731,7 @@ wlrequeue(int unit, u_short fd_p)
#ifdef WLDEBUG
static int xmt_debug = 0;
-#endif /* WLDEBUG */
+#endif WLDEBUG
/*
* wlxmt:
@@ -1775,7 +1781,7 @@ wlxmt(int unit, struct mbuf *m)
printf("ether type %x\n", eh_p->ether_type);
}
}
-#endif /* WLDEBUG */
+#endif WLDEBUG
outw(PIOR0(base), OFFSET_TBD);
outw(PIOP0(base), 0); /* act_count */
outw(PIOR1(base), OFFSET_TBD + 4);
@@ -1830,13 +1836,13 @@ wlxmt(int unit, struct mbuf *m)
if (sc->wl_if.if_flags & IFF_DEBUG)
if (xmt_debug)
printf("mbuf+ L%d @%p ", count, (void *)mb_p);
-#endif /* WLDEBUG */
+#endif WLDEBUG
}
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
if (xmt_debug)
printf("CLEN = %d\n", clen);
-#endif /* WLDEBUG */
+#endif WLDEBUG
outw(PIOR0(base), tbd_p);
if (clen < ETHERMIN) {
outw(PIOP0(base), inw(PIOP0(base)) + ETHERMIN - clen);
@@ -1854,7 +1860,7 @@ wlxmt(int unit, struct mbuf *m)
printf("\n");
}
}
-#endif /* WLDEBUG */
+#endif WLDEBUG
outw(PIOR0(base), OFFSET_SCB + 2); /* address of scb_command */
/*
@@ -2031,7 +2037,7 @@ wlconfig(int unit)
short base = sc->base;
#if MULTICAST
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+#if __FreeBSD__ >= 3
struct ifmultiaddr *ifma;
u_char *addrp;
#else
@@ -2039,7 +2045,7 @@ wlconfig(int unit)
struct ether_multistep step;
#endif
int cnt = 0;
-#endif /* MULTICAST */
+#endif MULTICAST
#ifdef WLDEBUG
if (sc->wl_if.if_flags & IFF_DEBUG)
@@ -2100,7 +2106,7 @@ wlconfig(int unit)
outw(PIOP1(base), 0); /* ac_status */
outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */
outw(PIOR1(base), OFFSET_CU + 8);
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
+#if __FreeBSD__ >= 3
for (ifma = sc->wl_if.if_multiaddrs.lh_first; ifma;
ifma = ifma->ifma_link.le_next) {
if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -2151,7 +2157,7 @@ printf("mcast_addr[%d,%d,%d] %x %x %x %x %x %x\n", lo, hi, cnt,
outw(PIOP1(base), cnt * WAVELAN_ADDR_SIZE);
if(wlcmd(unit, "config()-mcaddress") == 0)
return 0;
-#endif /* MULTICAST */
+#endif MULTICAST
outw(PIOR1(base), OFFSET_CU);
outw(PIOP1(base), 0); /* ac_status */
@@ -2320,6 +2326,7 @@ static void
wlsftwsleaze(u_short *countp, u_char **mb_pp, struct mbuf **tm_pp, int unit)
{
struct mbuf *tm_p = *tm_pp;
+ u_char *mb_p = *mb_pp;
u_short count = 0;
u_char *cp = (u_char *) t_packet;
int len;
@@ -2378,6 +2385,10 @@ wlmmcread(u_int base, u_short reg)
static void
getsnr(int unit)
{
+ register struct wl_softc *sc = WLSOFTC(unit);
+ short base = sc->base;
+ register int s;
+
MMC_WRITE(MMC_FREEZE,1);
/*
* SNR retrieval procedure :
@@ -2549,7 +2560,7 @@ static
void wl_cache_store (int unit, int base, struct ether_header *eh,
struct mbuf *m)
{
- struct ip *ip = NULL; /* Avoid GCC warning */
+ struct ip *ip;
int i;
int signal, silence;
int w_insertcache; /* computed index for cache entry storage */
@@ -2671,7 +2682,7 @@ void wl_cache_store (int unit, int base, struct ether_header *eh,
*/
#ifdef MULTICAST
-#if defined(__FreeBSD__) && __FreeBSD_version < 300000 /* not required */
+#if __FreeBSD__ < 3 /* not required */
static int
check_allmulti(int unit)
{
diff --git a/sys/i386/isa/if_wl.h b/sys/i386/isa/if_wl.h
index 70d5d30cdb661..90801c38f8ab9 100644
--- a/sys/i386/isa/if_wl.h
+++ b/sys/i386/isa/if_wl.h
@@ -116,5 +116,5 @@ typedef struct {
outw(MMCR(WLSOFTC(unit)->base), \
(u_short)(((u_short)(val) << 8) | ((cmd) << 1) | 1))
-#endif /* _IF_WL_H */
+#endif _IF_WL_H
diff --git a/sys/i386/isa/if_ze.c b/sys/i386/isa/if_ze.c
index 3000e89eb8c95..2821470173de9 100644
--- a/sys/i386/isa/if_ze.c
+++ b/sys/i386/isa/if_ze.c
@@ -47,7 +47,7 @@
*/
/*
- * $Id: if_ze.c,v 1.55 1998/10/22 05:58:39 bde Exp $
+ * $Id: if_ze.c,v 1.53 1998/06/07 17:10:39 dfr Exp $
*/
/* XXX don't mix different PCCARD support code. */
@@ -168,7 +168,6 @@ static void ze_init __P((int unit));
static __inline void ze_xmit __P((struct ifnet *ifp));
static void ze_start __P((struct ifnet *ifp));
static __inline void ze_rint __P((int unit));
-static ointhand2_t zeintr;
static int ze_ioctl __P((struct ifnet *ifp, u_long command, caddr_t data));
static void ze_get_packet __P((struct ze_softc *sc, char *buf, int len));
static __inline char *ze_ring_copy __P((struct ze_softc *sc, char *src,
@@ -587,8 +586,6 @@ ze_attach(isa_dev)
struct ifnet *ifp = &sc->arpcom.ac_if;
int pl;
- isa_dev->id_ointr = zeintr;
-
/* PCMCIA card can be offlined. Reconfiguration is required */
if (isa_dev->id_reconfig) {
ze_reset(isa_dev->id_unit);
@@ -726,9 +723,7 @@ ze_watchdog(ifp)
#if 1
struct ze_softc *sc = (struct ze_softc *)ifp;
u_char isr, imr;
-#ifndef SMP
u_int imask;
-#endif
if(!(ifp->if_flags & IFF_UP))
return;
@@ -1150,7 +1145,7 @@ ze_rint(unit)
/*
* Ethernet interface interrupt processor
*/
-static void
+void
zeintr(unit)
int unit;
{
diff --git a/sys/i386/isa/if_zp.c b/sys/i386/isa/if_zp.c
index 11e562c8b6a92..b2e9ad8d4626b 100644
--- a/sys/i386/isa/if_zp.c
+++ b/sys/i386/isa/if_zp.c
@@ -34,7 +34,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp $
- * $Id: if_zp.c,v 1.48 1998/06/07 17:10:40 dfr Exp $
+ * $Id: if_zp.c,v 1.47 1998/05/26 02:28:18 jmb Exp $
*/
/*-
* TODO:
@@ -198,7 +198,6 @@ static int zpioctl __P((struct ifnet * ifp, u_long, caddr_t));
static u_short read_eeprom_data __P((int, int));
static void zpinit __P((int));
-static ointhand2_t zpintr;
static void zpmbuffill __P((void *));
static void zpmbufempty __P((struct zp_softc *));
static void zpread __P((struct zp_softc *));
@@ -485,8 +484,6 @@ zpattach(isa_dev)
u_short i;
int pl;
- isa_dev->id_ointr = zpintr;
-
/* PCMCIA card can be offlined. Reconfiguration is required */
if (isa_dev->id_reconfig) {
if (!isa_dev->id_alive && sc->last_alive) {
@@ -777,7 +774,7 @@ readcheck:
}
goto startagain;
}
-static void
+void
zpintr(unit)
int unit;
{
diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c
index 0254195f5ddb1..3f891f2af315d 100644
--- a/sys/i386/isa/intr_machdep.c
+++ b/sys/i386/isa/intr_machdep.c
@@ -34,15 +34,12 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: intr_machdep.c,v 1.15 1998/12/04 22:54:46 archie Exp $
+ * $Id: intr_machdep.c,v 1.13 1998/06/18 16:08:46 bde Exp $
*/
#include "opt_auto_eoi.h"
#include <sys/param.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <sys/systm.h>
#include <sys/syslog.h>
#include <machine/ipl.h>
@@ -328,7 +325,7 @@ find_device_id(int irq)
char *cp;
int free_id, id;
- snprintf(buf, sizeof(buf), "pci irq%d", irq);
+ sprintf(buf, "pci irq%d", irq);
cp = intrnames;
/* default to 0, which corresponds to clk0 */
free_id = 0;
diff --git a/sys/i386/isa/ipl_funcs.c b/sys/i386/isa/ipl_funcs.c
index 38b1945f7ac01..cd4628cad2359 100644
--- a/sys/i386/isa/ipl_funcs.c
+++ b/sys/i386/isa/ipl_funcs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ipl_funcs.c,v 1.13 1998/02/01 22:04:58 bde Exp $
+ * $Id: ipl_funcs.c,v 1.12 1998/01/15 07:34:01 gibbs Exp $
*/
#include <sys/types.h>
@@ -379,10 +379,9 @@ splx(unsigned ipl)
intrmask_t
splq(intrmask_t mask)
{
- intrmask_t tmp;
-#ifdef INTR_SPL
- intrmask_t tmp2;
+ intrmask_t tmp, tmp2;
+#ifdef INTR_SPL
for (;;) {
IFCPL_LOCK();
tmp = tmp2 = cpl;
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index 177024d17d6b1..eb280936bbfc6 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.116 1998/10/22 05:58:39 bde Exp $
+ * $Id: isa.c,v 1.114 1998/10/12 13:12:45 bde Exp $
*/
/*
@@ -513,7 +513,7 @@ config_isadev_c(isdp, mp, reconfig)
printf("%s%d", dp->name, isdp->id_unit);
if (id_alive != -1) {
if (isdp->id_iobase == -1)
- printf(" at");
+ printf(" at ?");
else {
printf(" at 0x%x", isdp->id_iobase);
if (isdp->id_iobase + id_alive - 1 !=
@@ -557,10 +557,7 @@ config_isadev_c(isdp, mp, reconfig)
isdp->id_alive = id_alive;
}
(*dp->attach)(isdp);
- if (isdp->id_irq != 0 && isdp->id_intr == NULL)
- printf("%s%d: irq with no handler\n",
- dp->name, isdp->id_unit);
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
#ifdef APIC_IO
/*
* Some motherboards use upper IRQs for traditional
@@ -597,7 +594,7 @@ config_isadev_c(isdp, mp, reconfig)
} else {
#if 0
/* This code has not been tested.... */
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
icu_unset(ffs(isdp->id_irq) - 1,
isdp->id_intr);
if (mp)
diff --git a/sys/i386/isa/isa.h b/sys/i386/isa/isa.h
index ea25f20604ee3..6ec3ae276d411 100644
--- a/sys/i386/isa/isa.h
+++ b/sys/i386/isa/isa.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
- * $Id: isa.h,v 1.21 1997/02/22 09:36:41 peter Exp $
+ * $Id$
*/
#ifdef PC98
@@ -147,7 +147,7 @@
#define IO_ISASIZES
#define IO_ASCSIZE 5 /* AmiScan GI1904-based hand scanner */
-#define IO_CGASIZE 12 /* CGA controllers */
+#define IO_CGASIZE 16 /* CGA controllers */
#define IO_COMSIZE 8 /* 8250, 16x50 com controllers */
#define IO_DMASIZE 16 /* 8237 DMA controllers */
#define IO_DPGSIZE 32 /* 74LS612 DMA page registers */
@@ -158,10 +158,9 @@
#define IO_ICUSIZE 16 /* 8259A interrupt controllers */
#define IO_KBDSIZE 16 /* 8042 Keyboard controllers */
#define IO_LPTSIZE 8 /* LPT controllers, some use only 4 */
-#define IO_MDASIZE 12 /* Monochrome display controllers */
+#define IO_MDASIZE 16 /* Monochrome display controllers */
#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
#define IO_PMPSIZE 2 /* 82347 power management peripheral */
-#define IO_PSMSIZE 5 /* 8042 Keyboard controllers */
#define IO_RTCSIZE 16 /* CMOS real time clock, NMI control */
#define IO_TMRSIZE 16 /* 8253 programmable timers */
#define IO_VGASIZE 16 /* VGA controllers */
diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h
index d23f701914e62..17aad1dd263d5 100644
--- a/sys/i386/isa/isa_device.h
+++ b/sys/i386/isa/isa_device.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
- * $Id: isa_device.h,v 1.56 1998/10/22 05:58:39 bde Exp $
+ * $Id: isa_device.h,v 1.54 1998/09/15 10:04:08 gibbs Exp $
*/
#ifndef _I386_ISA_ISA_DEVICE_H_
@@ -41,8 +41,6 @@
* ISA Bus Autoconfiguration
*/
-typedef void ointhand2_t __P((int unit));
-
/*
* Per device structure.
*
@@ -59,12 +57,7 @@ struct isa_device {
int id_drq; /* DMA request */
caddr_t id_maddr; /* physical i/o memory address on bus (if any)*/
int id_msize; /* size of i/o memory */
- union {
- inthand2_t *id_i;
- ointhand2_t *id_oi;
- } id_iu; /* interrupt interface routine */
-#define id_intr id_iu.id_i
-#define id_ointr id_iu.id_oi
+ inthand2_t *id_intr; /* interrupt interface routine */
int id_unit; /* unit number */
int id_flags; /* flags */
int id_scsiid; /* scsi id if needed */
@@ -130,6 +123,76 @@ int isa_dmastatus __P((int chan));
int isa_dmastop __P((int chan));
void reconfig_isadev __P((struct isa_device *isdp, u_int *mp));
+typedef void ointhand2_t __P((int unit));
+
+/*
+ * The "old" interrupt handlers really have type ointhand2_t although they
+ * appear to be declared as having type inthand2_t. However, if this
+ * header is included by ioconf.c, pretend that the handlers really have
+ * type inthand_t. Assume that `C' is defined only by ioconf.c.
+ */
+#ifndef C
+#define inthand2_t ointhand2_t
+#endif
+
+inthand2_t adintr;
+inthand2_t ahaintr;
+inthand2_t aicintr;
+inthand2_t alogintr;
+inthand2_t arintr;
+inthand2_t ascintr;
+#ifdef PC98
+inthand2_t bsintr;
+#endif
+inthand2_t csintr;
+inthand2_t cxintr;
+inthand2_t cyintr;
+inthand2_t edintr;
+inthand2_t egintr;
+inthand2_t elintr;
+inthand2_t epintr;
+inthand2_t exintr;
+inthand2_t fdintr;
+inthand2_t feintr;
+inthand2_t gusintr;
+inthand2_t ieintr;
+inthand2_t labpcintr;
+inthand2_t le_intr;
+inthand2_t lncintr;
+inthand2_t loranintr;
+inthand2_t lptintr;
+inthand2_t m6850intr;
+inthand2_t mcdintr;
+inthand2_t mseintr;
+inthand2_t ncaintr;
+inthand2_t npxintr;
+inthand2_t pasintr;
+inthand2_t pcmintr;
+inthand2_t pcrint;
+inthand2_t ppcintr;
+inthand2_t pcfintr;
+inthand2_t psmintr;
+inthand2_t rcintr;
+inthand2_t sbintr;
+inthand2_t scintr;
+inthand2_t seaintr;
+inthand2_t siointr;
+inthand2_t sndintr;
+inthand2_t spigintr;
+inthand2_t srintr;
+inthand2_t sscapeintr;
+inthand2_t stlintr;
+inthand2_t twintr;
+inthand2_t uhaintr;
+inthand2_t wdintr;
+inthand2_t wdsintr;
+inthand2_t wlintr;
+inthand2_t wtintr;
+inthand2_t zeintr;
+inthand2_t zpintr;
+
+#undef inthand2_t
+
#endif /* KERNEL */
#endif /* !_I386_ISA_ISA_DEVICE_H_ */
diff --git a/sys/i386/isa/istallion.c b/sys/i386/isa/istallion.c
index 51db908f9780c..d0d172d669863 100644
--- a/sys/i386/isa/istallion.c
+++ b/sys/i386/isa/istallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: istallion.c,v 1.22 1998/08/23 09:57:09 bde Exp $
+ * $Id: istallion.c,v 1.21 1998/08/23 08:26:40 bde Exp $
*/
/*****************************************************************************/
@@ -540,6 +540,7 @@ struct tty *stlidevtotty(dev_t dev);
* Internal function prototypes.
*/
static stliport_t *stli_dev2port(dev_t dev);
+static int stli_chksharemem(void);
static int stli_isaprobe(struct isa_device *idp);
static int stli_eisaprobe(struct isa_device *idp);
static int stli_mcaprobe(struct isa_device *idp);
@@ -3547,7 +3548,6 @@ static int stli_brdattach(stlibrd_t *brdp)
* FIX: need to start this optimization somewhere...
*/
-#ifdef notdef
static int stli_chksharemem()
{
stlibrd_t *brdp, *nxtbrdp;
@@ -3597,7 +3597,6 @@ static int stli_chksharemem()
return(0);
}
-#endif /* notdef */
/*****************************************************************************/
diff --git a/sys/dev/kbd/atkbdc.c b/sys/i386/isa/kbdio.c
index 0f61835f07634..71cde28278e16 100644
--- a/sys/dev/kbd/atkbdc.c
+++ b/sys/i386/isa/kbdio.c
@@ -1,6 +1,5 @@
/*-
- * Copyright (c) 1996-1999
- * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
+ * Copyright (c) 1996 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,32 +26,58 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: $
- * from kbdio.c,v 1.13 1998/09/25 11:55:46 yokota Exp
+ * $Id: kbdio.c,v 1.12 1998/02/13 07:09:38 bde Exp $
*/
-#include "atkbdc.h"
-#include "opt_kbd.h"
+#include "sc.h"
+#include "vt.h"
+#include "psm.h"
+#include "opt_kbdio.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
#include <sys/syslog.h>
-
#include <machine/clock.h>
+#include <i386/isa/kbdio.h>
-#include <dev/kbd/atkbdcreg.h>
+/*
+ * driver specific options: the following options may be set by
+ * `options' statements in the kernel configuration file.
+ */
-#ifndef __i386__
-#include <isa/isareg.h>
+/* retry count */
+#ifndef KBD_MAXRETRY
+#define KBD_MAXRETRY 3
+#endif
+
+/* timing parameters */
+#ifndef KBD_RESETDELAY
+#define KBD_RESETDELAY 200 /* wait 200msec after kbd/mouse reset */
+#endif
+#ifndef KBD_MAXWAIT
+#define KBD_MAXWAIT 5 /* wait 5 times at most after reset */
+#endif
+
+/* I/O recovery time */
+#ifdef PC98
+#define KBDC_DELAYTIME 37
+#define KBDD_DELAYTIME 37
#else
-#include <i386/isa/isa.h>
+#define KBDC_DELAYTIME 20
+#define KBDD_DELAYTIME 7
+#endif
+
+/* debug option */
+#ifndef KBDIO_DEBUG
+#define KBDIO_DEBUG 0
#endif
+/* end of driver specific options */
+
/* constants */
-#define MAXKBDC MAX(NATKBDC, 1)
+#define NKBDC MAX(MAX(NSC, NVT), NPSM)
+#define KBDQ_BUFSIZE 32
/* macros */
@@ -60,7 +85,7 @@
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
-#define kbdcp(p) ((atkbdc_softc_t *)(p))
+#define kbdcp(p) ((struct kbdc_softc *)(p))
#define nextq(i) (((i) + 1) % KBDQ_BUFSIZE)
#define availq(q) ((q)->head != (q)->tail)
#if KBDIO_DEBUG >= 2
@@ -71,116 +96,88 @@
/* local variables */
-/*
- * We always need at least one copy of the kbdc_softc struct for the
- * low-level console. As the low-level console accesses the keyboard
- * controller before kbdc, and all other devices, is probed, we
- * statically allocate one entry. XXX
- */
-static atkbdc_softc_t default_kbdc;
-static atkbdc_softc_t *atkbdc_softc[MAXKBDC] = { &default_kbdc };
+typedef struct _kqueue {
+ int head;
+ int tail;
+ unsigned char q[KBDQ_BUFSIZE];
+#if KBDIO_DEBUG >= 2
+ int call_count;
+ int qcount;
+ int max_qcount;
+#endif
+} kqueue;
+
+struct kbdc_softc {
+ int port; /* base port address */
+ int command_byte; /* current command byte value */
+ int command_mask; /* command byte mask bits for kbd/aux devices */
+ int lock; /* FIXME: XXX not quite a semaphore... */
+ kqueue kbd; /* keyboard data queue */
+ kqueue aux; /* auxiliary data queue */
+};
+
+static struct kbdc_softc kbdc_softc[NKBDC] = { { 0 }, };
static int verbose = KBDIO_DEBUG;
/* function prototypes */
-static int atkbdc_setup(atkbdc_softc_t *sc, int port);
+#ifndef PC98
static int addq(kqueue *q, int c);
static int removeq(kqueue *q);
-static int wait_while_controller_busy(atkbdc_softc_t *kbdc);
-static int wait_for_data(atkbdc_softc_t *kbdc);
-static int wait_for_kbd_data(atkbdc_softc_t *kbdc);
-static int wait_for_kbd_ack(atkbdc_softc_t *kbdc);
-static int wait_for_aux_data(atkbdc_softc_t *kbdc);
-static int wait_for_aux_ack(atkbdc_softc_t *kbdc);
-
-#if NATKBDC > 0
-
-atkbdc_softc_t
-*atkbdc_get_softc(int unit)
-{
- atkbdc_softc_t *sc;
-
- if (unit >= sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0]))
- return NULL;
- sc = atkbdc_softc[unit];
- if (sc == NULL) {
- sc = atkbdc_softc[unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return NULL;
- bzero(sc, sizeof(*sc));
- sc->port = -1; /* XXX */
- }
- return sc;
-}
-
-int
-atkbdc_probe_unit(atkbdc_softc_t *sc, int unit, int port)
-{
- return atkbdc_setup(sc, port);
-}
-
-#endif /* NATKBDC > 0 */
-
-/* the backdoor to the keyboard controller! XXX */
-int
-atkbdc_configure(void)
-{
- return atkbdc_setup(atkbdc_softc[0], -1);
-}
-
-static int
-atkbdc_setup(atkbdc_softc_t *sc, int port)
-{
- if (port <= 0)
- port = IO_KBD;
-
- if (sc->port <= 0) {
- sc->command_byte = -1;
- sc->command_mask = 0;
- sc->lock = FALSE;
- sc->kbd.head = sc->kbd.tail = 0;
- sc->aux.head = sc->aux.tail = 0;
-#if KBDIO_DEBUG >= 2
- sc->kbd.call_count = 0;
- sc->kbd.qcount = sc->kbd.max_qcount = 0;
- sc->aux.call_count = 0;
- sc->aux.qcount = sc->aux.max_qcount = 0;
+static int wait_while_controller_busy(struct kbdc_softc *kbdc);
+static int wait_for_data(struct kbdc_softc *kbdc);
+#endif
+static int wait_for_kbd_data(struct kbdc_softc *kbdc);
+#ifndef PC98
+static int wait_for_kbd_ack(struct kbdc_softc *kbdc);
+static int wait_for_aux_data(struct kbdc_softc *kbdc);
+static int wait_for_aux_ack(struct kbdc_softc *kbdc);
#endif
- }
- sc->port = port; /* may override the previous value */
- return 0;
-}
/* associate a port number with a KBDC */
KBDC
kbdc_open(int port)
{
+#ifdef PC98
+ if (NKBDC) {
+ /* PC-98 has only one keyboard I/F */
+ kbdc_softc[0].port = port;
+ kbdc_softc[0].lock = FALSE;
+ return (KBDC)&kbdc_softc[0];
+ }
+ return NULL; /* You didn't include sc driver in your config file */
+#else
int s;
int i;
- if (port <= 0)
- port = IO_KBD;
-
s = spltty();
- for (i = 0; i < sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0]); ++i) {
- if (atkbdc_softc[i] == NULL)
- continue;
- if (atkbdc_softc[i]->port == port) {
+ for (i = 0; i < NKBDC; ++i) {
+ if (kbdc_softc[i].port == port) {
splx(s);
- return (KBDC)atkbdc_softc[i];
+ return (KBDC) &kbdc_softc[i];
}
- if (atkbdc_softc[i]->port <= 0) {
- if (atkbdc_setup(atkbdc_softc[i], port))
- break;
+ if (kbdc_softc[i].port <= 0) {
+ kbdc_softc[i].port = port;
+ kbdc_softc[i].command_byte = -1;
+ kbdc_softc[i].command_mask = 0;
+ kbdc_softc[i].lock = FALSE;
+ kbdc_softc[i].kbd.head = kbdc_softc[i].kbd.tail = 0;
+ kbdc_softc[i].aux.head = kbdc_softc[i].aux.tail = 0;
+#if KBDIO_DEBUG >= 2
+ kbdc_softc[i].kbd.call_count = 0;
+ kbdc_softc[i].kbd.qcount = kbdc_softc[i].kbd.max_qcount = 0;
+ kbdc_softc[i].aux.call_count = 0;
+ kbdc_softc[i].aux.qcount = kbdc_softc[i].aux.max_qcount = 0;
+#endif
splx(s);
- return (KBDC)atkbdc_softc[i];
+ return (KBDC) &kbdc_softc[i];
}
}
splx(s);
return NULL;
+#endif
}
/*
@@ -237,10 +234,15 @@ kbdc_lock(KBDC p, int lock)
int
kbdc_data_ready(KBDC p)
{
+#ifdef PC98
+ return (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_ANY_BUFFER_FULL);
+#else
return (availq(&kbdcp(p)->kbd) || availq(&kbdcp(p)->aux)
|| (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_ANY_BUFFER_FULL));
+#endif
}
+#ifndef PC98
/* queuing functions */
static int
@@ -280,7 +282,7 @@ removeq(kqueue *q)
* device I/O routines
*/
static int
-wait_while_controller_busy(struct atkbdc_softc *kbdc)
+wait_while_controller_busy(struct kbdc_softc *kbdc)
{
/* CPU will stay inside the loop for 100msec at most */
int retry = 5000;
@@ -307,7 +309,7 @@ wait_while_controller_busy(struct atkbdc_softc *kbdc)
* the keyboard, or the aux device.
*/
static int
-wait_for_data(struct atkbdc_softc *kbdc)
+wait_for_data(struct kbdc_softc *kbdc)
{
/* CPU will stay inside the loop for 200msec at most */
int retry = 10000;
@@ -322,10 +324,11 @@ wait_for_data(struct atkbdc_softc *kbdc)
DELAY(KBDD_DELAYTIME);
return f;
}
+#endif /* !PC98 */
/* wait for data from the keyboard */
static int
-wait_for_kbd_data(struct atkbdc_softc *kbdc)
+wait_for_kbd_data(struct kbdc_softc *kbdc)
{
/* CPU will stay inside the loop for 200msec at most */
int retry = 10000;
@@ -334,10 +337,14 @@ wait_for_kbd_data(struct atkbdc_softc *kbdc)
while ((f = inb(port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL)
!= KBDS_KBD_BUFFER_FULL) {
+#ifdef PC98
+ DELAY(KBDD_DELAYTIME);
+#else
if (f == KBDS_AUX_BUFFER_FULL) {
DELAY(KBDD_DELAYTIME);
addq(&kbdc->aux, inb(port + KBD_DATA_PORT));
}
+#endif
DELAY(KBDC_DELAYTIME);
if (--retry < 0)
return 0;
@@ -346,12 +353,13 @@ wait_for_kbd_data(struct atkbdc_softc *kbdc)
return f;
}
+#ifndef PC98
/*
* wait for an ACK(FAh), RESEND(FEh), or RESET_FAIL(FCh) from the keyboard.
* queue anything else.
*/
static int
-wait_for_kbd_ack(struct atkbdc_softc *kbdc)
+wait_for_kbd_ack(struct kbdc_softc *kbdc)
{
/* CPU will stay inside the loop for 200msec at most */
int retry = 10000;
@@ -379,7 +387,7 @@ wait_for_kbd_ack(struct atkbdc_softc *kbdc)
/* wait for data from the aux device */
static int
-wait_for_aux_data(struct atkbdc_softc *kbdc)
+wait_for_aux_data(struct kbdc_softc *kbdc)
{
/* CPU will stay inside the loop for 200msec at most */
int retry = 10000;
@@ -405,7 +413,7 @@ wait_for_aux_data(struct atkbdc_softc *kbdc)
* queue anything else.
*/
static int
-wait_for_aux_ack(struct atkbdc_softc *kbdc)
+wait_for_aux_ack(struct kbdc_softc *kbdc)
{
/* CPU will stay inside the loop for 200msec at most */
int retry = 10000;
@@ -588,6 +596,7 @@ read_controller_data(KBDC p)
return -1; /* timeout */
return inb(kbdcp(p)->port + KBD_DATA_PORT);
}
+#endif /* !PC98 */
#if KBDIO_DEBUG >= 2
static int call = 0;
@@ -597,11 +606,12 @@ static int call = 0;
int
read_kbd_data(KBDC p)
{
+#ifndef PC98
#if KBDIO_DEBUG >= 2
if (++call > 2000) {
call = 0;
- log(LOG_DEBUG, "kbdc: kbd q: %d calls, max %d chars, "
- "aux q: %d calls, max %d chars\n",
+ log(LOG_DEBUG, "KBDIO: kbd q: %d calls, max %d chars, "
+ "aux q: %d calls, max %d chars\n",
kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
}
@@ -609,8 +619,12 @@ read_kbd_data(KBDC p)
if (availq(&kbdcp(p)->kbd))
return removeq(&kbdcp(p)->kbd);
+#endif /* !PC98 */
if (!wait_for_kbd_data(kbdcp(p)))
return -1; /* timeout */
+#ifdef PC98
+ DELAY(KBDC_DELAYTIME);
+#endif
return inb(kbdcp(p)->port + KBD_DATA_PORT);
}
@@ -622,11 +636,14 @@ read_kbd_data_no_wait(KBDC p)
{
int f;
+#ifdef PC98
+ f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
+#else
#if KBDIO_DEBUG >= 2
if (++call > 2000) {
call = 0;
- log(LOG_DEBUG, "kbdc: kbd q: %d calls, max %d chars, "
- "aux q: %d calls, max %d chars\n",
+ log(LOG_DEBUG, "KBDIO: kbd q: %d calls, max %d chars, "
+ "aux q: %d calls, max %d chars\n",
kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
}
@@ -640,6 +657,7 @@ read_kbd_data_no_wait(KBDC p)
addq(&kbdcp(p)->aux, inb(kbdcp(p)->port + KBD_DATA_PORT));
f = inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL;
}
+#endif /* PC98 */
if (f == KBDS_KBD_BUFFER_FULL) {
DELAY(KBDD_DELAYTIME);
return inb(kbdcp(p)->port + KBD_DATA_PORT);
@@ -647,6 +665,7 @@ read_kbd_data_no_wait(KBDC p)
return -1; /* no data */
}
+#ifndef PC98
/* read one byte from the aux device */
int
read_aux_data(KBDC p)
@@ -714,7 +733,7 @@ empty_kbd_buffer(KBDC p, int wait)
}
#if KBDIO_DEBUG >= 2
if ((c1 > 0) || (c2 > 0))
- log(LOG_DEBUG, "kbdc: %d:%d char read (empty_kbd_buffer)\n", c1, c2);
+ log(LOG_DEBUG, "kbdio: %d:%d char read (empty_kbd_buffer)\n", c1, c2);
#endif
emptyq(&kbdcp(p)->kbd);
@@ -753,7 +772,7 @@ empty_aux_buffer(KBDC p, int wait)
}
#if KBDIO_DEBUG >= 2
if ((c1 > 0) || (c2 > 0))
- log(LOG_DEBUG, "kbdc: %d:%d char read (empty_aux_buffer)\n", c1, c2);
+ log(LOG_DEBUG, "kbdio: %d:%d char read (empty_aux_buffer)\n", c1, c2);
#endif
emptyq(&kbdcp(p)->aux);
@@ -789,7 +808,7 @@ empty_both_buffers(KBDC p, int wait)
}
#if KBDIO_DEBUG >= 2
if ((c1 > 0) || (c2 > 0))
- log(LOG_DEBUG, "kbdc: %d:%d char read (empty_both_buffers)\n", c1, c2);
+ log(LOG_DEBUG, "kbdio: %d:%d char read (empty_both_buffers)\n", c1, c2);
#endif
emptyq(&kbdcp(p)->kbd);
@@ -815,7 +834,7 @@ reset_kbd(KBDC p)
emptyq(&kbdcp(p)->kbd);
c = read_controller_data(p);
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_KBD return code:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: RESET_KBD return code:%04x\n", c);
if (c == KBD_ACK) /* keyboard has agreed to reset itself... */
break;
}
@@ -830,7 +849,7 @@ reset_kbd(KBDC p)
break;
}
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_KBD status:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: RESET_KBD status:%04x\n", c);
if (c != KBD_RESET_DONE)
return FALSE;
return TRUE;
@@ -859,7 +878,7 @@ reset_aux_dev(KBDC p)
break;
}
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_AUX return code:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: RESET_AUX return code:%04x\n", c);
if (c == PSM_ACK) /* aux dev is about to reset... */
break;
}
@@ -874,13 +893,13 @@ reset_aux_dev(KBDC p)
break;
}
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_AUX status:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: RESET_AUX status:%04x\n", c);
if (c != PSM_RESET_DONE) /* reset status */
return FALSE;
c = read_aux_data(p); /* device ID */
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: RESET_AUX ID:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: RESET_AUX ID:%04x\n", c);
/* NOTE: we could check the device ID now, but leave it later... */
return TRUE;
}
@@ -911,7 +930,7 @@ test_controller(KBDC p)
break;
}
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: DIAGNOSE status:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: DIAGNOSE status:%04x\n", c);
return (c == KBD_DIAG_DONE);
}
@@ -937,7 +956,7 @@ test_kbd_port(KBDC p)
break;
}
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: TEST_KBD_PORT status:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: TEST_KBD_PORT status:%04x\n", c);
return c;
}
@@ -963,7 +982,7 @@ test_aux_port(KBDC p)
break;
}
if (verbose || bootverbose)
- log(LOG_DEBUG, "kbdc: TEST_AUX_PORT status:%04x\n", c);
+ log(LOG_DEBUG, "kbdio: TEST_AUX_PORT status:%04x\n", c);
return c;
}
@@ -1010,8 +1029,9 @@ set_controller_command_byte(KBDC p, int mask, int command)
kbdcp(p)->command_byte = command;
if (verbose)
- log(LOG_DEBUG, "kbdc: new command byte:%04x (set_controller...)\n",
+ log(LOG_DEBUG, "kbdio: new command byte:%04x (set_controller...)\n",
command);
return TRUE;
}
+#endif /* !PC98 */
diff --git a/sys/dev/kbd/atkbdcreg.h b/sys/i386/isa/kbdio.h
index 81b0ad35dce9d..b544681f5d571 100644
--- a/sys/dev/kbd/atkbdcreg.h
+++ b/sys/i386/isa/kbdio.h
@@ -1,6 +1,5 @@
/*-
- * Copyright (c) 1996-1999
- * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
+ * Copyright (c) 1996 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,22 +26,33 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: $
- * from kbdio.h,v 1.8 1998/09/25 11:55:46 yokota Exp
+ * $Id: kbdio.h,v 1.7 1997/12/07 08:09:15 yokota Exp $
*/
-#ifndef _DEV_KBD_ATKBDCREG_H_
-#define _DEV_KBD_ATKBDCREG_H_
+#ifndef _I386_ISA_KBDIO_H_
+#define _I386_ISA_KBDIO_H_
/* constants */
/* I/O ports */
+#ifdef PC98
+#define KBD_STATUS_PORT 2 /* status port, read */
+#define KBD_COMMAND_PORT 2 /* controller command port, write */
+#define KBD_DATA_PORT 0 /* data port, read/write
+ * also used as keyboard command
+ * and mouse command port
+ */
+#else
#define KBD_STATUS_PORT 4 /* status port, read */
#define KBD_COMMAND_PORT 4 /* controller command port, write */
#define KBD_DATA_PORT 0 /* data port, read/write
* also used as keyboard command
* and mouse command port
*/
+#endif /* PC98 */
+
+/* FIXME: `IO_PSMSIZE' should really be in `isa.h'. */
+#define IO_PSMSIZE (KBD_COMMAND_PORT - KBD_DATA_PORT + 1) /* 5 */
/* controller commands (sent to KBD_COMMAND_PORT) */
#define KBDC_SET_COMMAND_BYTE 0x0060
@@ -108,10 +118,17 @@
#define PSMD_MAX_RATE 255 /* FIXME: not sure if it's possible */
/* status bits (KBD_STATUS_PORT) */
+#ifdef PC98
+#define KBDS_BUFFER_FULL 0x0002
+#define KBDS_ANY_BUFFER_FULL 0x0002
+#define KBDS_KBD_BUFFER_FULL 0x0002
+#define KBDS_AUX_BUFFER_FULL 0x0002
+#else
#define KBDS_BUFFER_FULL 0x0021
#define KBDS_ANY_BUFFER_FULL 0x0001
#define KBDS_KBD_BUFFER_FULL 0x0001
#define KBDS_AUX_BUFFER_FULL 0x0021
+#endif
#define KBDS_INPUT_BUFFER_FULL 0x0002
/* return code */
@@ -135,112 +152,58 @@
#ifdef KERNEL
-#define ATKBDC_DRIVER_NAME "atkbdc"
-
-/*
- * driver specific options: the following options may be set by
- * `options' statements in the kernel configuration file.
- */
-
-/* retry count */
-#ifndef KBD_MAXRETRY
-#define KBD_MAXRETRY 3
+#ifndef TRUE
+#define TRUE 1
#endif
-
-/* timing parameters */
-#ifndef KBD_RESETDELAY
-#define KBD_RESETDELAY 200 /* wait 200msec after kbd/mouse reset */
+#ifndef FALSE
+#define FALSE 0
#endif
-#ifndef KBD_MAXWAIT
-#define KBD_MAXWAIT 5 /* wait 5 times at most after reset */
-#endif
-
-/* I/O recovery time */
-#define KBDC_DELAYTIME 20
-#define KBDD_DELAYTIME 7
-
-/* debug option */
-#ifndef KBDIO_DEBUG
-#define KBDIO_DEBUG 0
-#endif
-
-/* end of driver specific options */
/* types/structures */
-#define KBDQ_BUFSIZE 32
-
-typedef struct _kqueue {
- int head;
- int tail;
- unsigned char q[KBDQ_BUFSIZE];
-#if KBDIO_DEBUG >= 2
- int call_count;
- int qcount;
- int max_qcount;
-#endif
-} kqueue;
-
-typedef struct atkbdc_softc {
- int port; /* base port address */
- int command_byte; /* current command byte value */
- int command_mask; /* command byte mask bits for kbd/aux devices */
- int lock; /* FIXME: XXX not quite a semaphore... */
- kqueue kbd; /* keyboard data queue */
- kqueue aux; /* auxiliary data queue */
-} atkbdc_softc_t;
-
-enum kbdc_device_ivar {
- KBDC_IVAR_PORT,
- KBDC_IVAR_IRQ,
- KBDC_IVAR_FLAGS,
-};
-
typedef caddr_t KBDC;
/* function prototypes */
-atkbdc_softc_t *atkbdc_get_softc(int unit);
-int atkbdc_probe_unit(atkbdc_softc_t *sc, int unit, int port);
-int atkbdc_configure(void);
+KBDC kbdc_open __P((int port));
+
+int kbdc_lock __P((KBDC kbdc, int lock));
-KBDC kbdc_open(int port);
-int kbdc_lock(KBDC kbdc, int lock);
-int kbdc_data_ready(KBDC kbdc);
+int kbdc_data_ready __P((KBDC kbdc));
-int write_controller_command(KBDC kbdc,int c);
-int write_controller_data(KBDC kbdc,int c);
+int write_controller_command __P((KBDC kbdc,int c));
+int write_controller_data __P((KBDC kbdc,int c));
-int write_kbd_command(KBDC kbdc,int c);
-int write_aux_command(KBDC kbdc,int c);
-int send_kbd_command(KBDC kbdc,int c);
-int send_aux_command(KBDC kbdc,int c);
-int send_kbd_command_and_data(KBDC kbdc,int c,int d);
-int send_aux_command_and_data(KBDC kbdc,int c,int d);
+int write_kbd_command __P((KBDC kbdc,int c));
+int write_aux_command __P((KBDC kbdc,int c));
+int send_kbd_command __P((KBDC kbdc,int c));
+int send_aux_command __P((KBDC kbdc,int c));
+int send_kbd_command_and_data __P((KBDC kbdc,int c,int d));
+int send_aux_command_and_data __P((KBDC kbdc,int c,int d));
-int read_controller_data(KBDC kbdc);
-int read_kbd_data(KBDC kbdc);
-int read_kbd_data_no_wait(KBDC kbdc);
-int read_aux_data(KBDC kbdc);
-int read_aux_data_no_wait(KBDC kbdc);
+int read_controller_data __P((KBDC kbdc));
+int read_kbd_data __P((KBDC kbdc));
+int read_kbd_data_no_wait __P((KBDC kbdc));
+int read_aux_data __P((KBDC kbdc));
+int read_aux_data_no_wait __P((KBDC kbdc));
-void empty_kbd_buffer(KBDC kbdc, int t);
-void empty_aux_buffer(KBDC kbdc, int t);
-void empty_both_buffers(KBDC kbdc, int t);
+void empty_kbd_buffer __P((KBDC kbdc, int t));
+void empty_aux_buffer __P((KBDC kbdc, int t));
+void empty_both_buffers __P((KBDC kbdc, int t));
-int reset_kbd(KBDC kbdc);
-int reset_aux_dev(KBDC kbdc);
+int reset_kbd __P((KBDC kbdc));
+int reset_aux_dev __P((KBDC kbdc));
-int test_controller(KBDC kbdc);
-int test_kbd_port(KBDC kbdc);
-int test_aux_port(KBDC kbdc);
+int test_controller __P((KBDC kbdc));
+int test_kbd_port __P((KBDC kbdc));
+int test_aux_port __P((KBDC kbdc));
-int kbdc_get_device_mask(KBDC kbdc);
-void kbdc_set_device_mask(KBDC kbdc, int mask);
+int kbdc_get_device_mask __P((KBDC kbdc));
+void kbdc_set_device_mask __P((KBDC kbdc, int mask));
-int get_controller_command_byte(KBDC kbdc);
-int set_controller_command_byte(KBDC kbdc, int command, int flag);
+int get_controller_command_byte __P((KBDC kbdc));
+int set_controller_command_byte __P((KBDC kbdc, int command, int flag));
#endif /* KERNEL */
-#endif /* !_DEV_KBD_ATKBDCREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
diff --git a/sys/i386/isa/kbdtables.h b/sys/i386/isa/kbdtables.h
index c0d4663a6eacd..61376f48b919f 100644
--- a/sys/i386/isa/kbdtables.h
+++ b/sys/i386/isa/kbdtables.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: kbdtables.h,v 1.41 1998/09/15 18:16:37 sos Exp $
+ * $Id$
*/
#define SET8 0x80 /* set eight bit on */
@@ -93,8 +93,8 @@ static keymap_t key_map = { 0x80, /* PC98 keymap */
/* sc=33 */ NOP, '_', 0x1F, 0x1F, '\\', '|', 0x1C, 0x1C, 0x80, 0x00,
/* sc=34 */ ' ', ' ', 0x00, 0x00, ' ', ' ', 0x00, 0x00, 0x00, 0x00,
/* sc=35 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
-/* sc=36 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
-/* sc=37 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
+/* sc=36 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
+/* sc=37 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
/* sc=38 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
/* sc=39 */ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, RBT, RBT, 0x03, 0x02,
/* sc=3a */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c
index e893a21fbd40a..4e19b64b5658f 100644
--- a/sys/i386/isa/labpc.c
+++ b/sys/i386/isa/labpc.c
@@ -57,9 +57,7 @@
#include <sys/devfsext.h>
#endif /*DEVFS*/
-#ifdef LOUTB
#include <machine/clock.h>
-#endif
#include <i386/isa/isa_device.h>
@@ -298,7 +296,6 @@ static struct cdevsw labpc_cdevsw =
labpcioctl, nostop, nullreset, nodevtotty,
seltrue, nommap, labpcstrategy, "labpc", NULL, -1 };
-static ointhand2_t labpcintr;
static void start(struct ctlr *ctlr);
static void
@@ -399,7 +396,7 @@ labpcinit(void)
labpcs = malloc(NLABPC * sizeof(struct ctlr *), M_DEVBUF, M_NOWAIT);
if (labpcs)
{
- bzero(labpcs, NLABPC * sizeof(struct ctlr *));
+ bzero(labpcs, NLABPC * sizeof(struct cltr *));
return 1;
}
return 0;
@@ -408,7 +405,7 @@ labpcinit(void)
static int
labpcprobe(struct isa_device *dev)
{
- static int unit;
+ static unit;
struct ctlr scratch, *ctlr;
u_char status;
@@ -476,7 +473,6 @@ labpcattach(struct isa_device *dev)
{
struct ctlr *ctlr = labpcs[dev->id_unit];
- dev->id_ointr = labpcintr;
callout_handle_init(&ctlr->ch);
ctlr->sample_us = (1000000.0 / (double)LABPC_DEFAULT_HERZ) + .50;
reset(ctlr);
@@ -696,7 +692,7 @@ static void ad_intr(struct ctlr *ctlr)
}
}
-static void labpcintr(int unit)
+void labpcintr(int unit)
{
struct ctlr *ctlr = labpcs[unit];
(*ctlr->intr)(ctlr);
@@ -1098,7 +1094,7 @@ labpcioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *p)
}
-static int labpc_devsw_installed = 0;
+static labpc_devsw_installed = 0;
static void labpc_drvinit(void *unused)
{
diff --git a/sys/i386/isa/loran.c b/sys/i386/isa/loran.c
index d4dca4d24ed41..e92d793c4fb98 100644
--- a/sys/i386/isa/loran.c
+++ b/sys/i386/isa/loran.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: loran.c,v 1.13 1998/12/07 21:58:22 archie Exp $
+ * $Id: loran.c,v 1.7 1998/08/17 18:47:36 bde Exp $
*
* This device-driver helps the userland controlprogram for a LORAN-C
* receiver avoid monopolizing the CPU.
@@ -32,13 +32,13 @@
#include <i386/isa/isa_device.h>
#endif /* KERNEL */
-typedef TAILQ_HEAD(, datapoint) dphead_t;
-
struct datapoint {
- /* Fields used by kernel */
+ void *ident;
+ int index;
u_int64_t scheduled;
+ u_int delay;
u_int code;
- u_int fri;
+ u_int gri;
u_int agc;
u_int phase;
u_int width;
@@ -47,24 +47,16 @@ struct datapoint {
u_int qsig;
u_int ssig;
u_int64_t epoch;
+ struct timespec actual;
TAILQ_ENTRY(datapoint) list;
- u_char status;
- int vco;
- int bounce;
- pid_t pid;
- struct timespec when;
-
- int priority;
- dphead_t *home;
-
- /* Fields used only in userland */
- void *ident;
- int index;
double ival;
double qval;
double sval;
double mval;
-
+ u_char status;
+ u_int vco;
+ int count;
+ int remain;
};
/*
@@ -85,21 +77,14 @@ struct datapoint {
#define EN5 0x40 /* enable counter 5 bit */
#define ENG 0x80 /* enable gri bit */
-#define VCO_SHIFT 8 /* bits of fraction on VCO value */
-#define VCO (2048 << VCO_SHIFT) /* initial vco dac (0 V)*/
-
-
-#define PGUARD 990 /* program guard time (cycle) (990!) */
-
+#define VCO 2048 /* initial vco dac (0 V)*/
#ifdef KERNEL
-#define NLORAN 10 /* Allow ten minor devices */
-
-#define NDUMMY 4 /* How many idlers we want */
#define PORT 0x0300 /* controller port address */
+#define PGUARD 990 /* program guard time (cycle) (990!) */
#define GRI 800 /* pulse-group gate (cycle) */
@@ -198,24 +183,25 @@ struct datapoint {
/**********************************************************************/
-dphead_t minors[NLORAN], working, holding;
+static TAILQ_HEAD(qhead, datapoint) qdone, qready;
-static struct datapoint dummy[NDUMMY];
+static struct datapoint dummy;
static u_int64_t ticker;
static u_char par;
+static struct datapoint *this, *next;
+
static MALLOC_DEFINE(M_LORAN, "Loran", "Loran datapoints");
static int loranerror;
static char lorantext[80];
-static u_int vco_is;
-static u_int vco_should;
-static u_int vco_want;
-static u_int64_t vco_when;
-static int64_t vco_error;
+static u_int vco_is;
+static u_int vco_should;
+
+static int lorantc_magic;
/**********************************************************************/
@@ -227,8 +213,7 @@ static d_open_t loranopen;
static d_close_t loranclose;
static d_read_t loranread;
static d_write_t loranwrite;
-static ointhand2_t loranintr;
-extern struct timecounter loran_timecounter;
+extern struct timecounter loran_timecounter[];
/**********************************************************************/
@@ -243,10 +228,10 @@ loranprobe(struct isa_device *dvp)
}
u_short tg_init[] = { /* stc initialization vector */
- 0x0562, 12, 13, /* counter 1 (p0) Mode J */
- 0x0262, PGUARD, GRI, /* counter 2 (gri) Mode J */
+ 0x0562, 12, 13, /* counter 1 (p0) */
+ 0x0262, PGUARD, GRI, /* counter 2 (gri) */
0x8562, PCX, 5000 - PCX, /* counter 3 (pcx) */
- 0xc562, 0, STROBE, /* counter 4 (stb) Mode L */
+ 0xc562, 0, STROBE, /* counter 4 (stb) */
0x052a, 0, 0 /* counter 5 (out) */
};
@@ -272,37 +257,31 @@ loranattach(struct isa_device *isdp)
{
int i;
- isdp->id_ointr = loranintr;
-
/* We need to be a "fast-intr" */
isdp->id_ri_flags |= RI_FAST;
printf("loran0: LORAN-C Receiver\n");
- vco_should = VCO;
- vco_is = vco_should >> VCO_SHIFT;
- LOAD_DAC(DACA, vco_is);
+ vco_is = VCO;
+ LOAD_DAC(DACA, VCO);
init_tgc();
- init_timecounter(&loran_timecounter);
+ init_timecounter(loran_timecounter);
- TAILQ_INIT(&working);
- TAILQ_INIT(&holding);
- for (i = 0; i < NLORAN; i++) {
- TAILQ_INIT(&minors[i]);
-
- }
+ TAILQ_INIT(&qdone);
+ TAILQ_INIT(&qready);
- for (i = 0; i < NDUMMY; i++) {
- dummy[i].agc = 4095;
- dummy[i].code = 0xac;
- dummy[i].fri = PGUARD;
- dummy[i].phase = 50;
- dummy[i].width = 50;
- dummy[i].priority = 9999;
- TAILQ_INSERT_TAIL(&working, &dummy[i], list);
- }
+ dummy.agc = 4095;
+ dummy.code = 0xac;
+ dummy.delay = PGUARD - GRI;
+ dummy.gri = PGUARD;
+ dummy.phase = 50;
+ dummy.width = 50;
+
+ TAILQ_INSERT_HEAD(&qready, &dummy, list);
+ this = &dummy;
+ next = &dummy;
inb(ADC); /* Flush any old result */
outb(ADC, ADC_S);
@@ -316,18 +295,28 @@ loranattach(struct isa_device *isdp)
static int
loranopen (dev_t dev, int flags, int fmt, struct proc *p)
{
- int idx;
-
- idx = minor(dev);
- if (idx >= NLORAN)
- return (ENODEV);
+ u_long ef;
+ struct datapoint *this;
+ while (!TAILQ_EMPTY(&qdone)) {
+ ef = read_eflags();
+ disable_intr();
+ this = TAILQ_FIRST(&qdone);
+ TAILQ_REMOVE(&qdone, this, list);
+ write_eflags(ef);
+ FREE(this, M_LORAN);
+ }
+ init_tgc();
+ loranerror = 0;
return(0);
}
static int
loranclose(dev_t dev, int flags, int fmt, struct proc *p)
{
+ /*
+ * Lower ENG
+ */
return(0);
}
@@ -337,22 +326,19 @@ loranread(dev_t dev, struct uio * uio, int ioflag)
u_long ef;
struct datapoint *this;
int err, c;
- int idx;
-
- idx = minor(dev);
if (loranerror) {
printf("Loran0: %s", lorantext);
return(EIO);
}
- if (TAILQ_EMPTY(&minors[idx]))
- tsleep ((caddr_t)&minors[idx], PZERO + 8 |PCATCH, "loranrd", hz*2);
- if (TAILQ_EMPTY(&minors[idx]))
+ if (TAILQ_EMPTY(&qdone))
+ tsleep ((caddr_t)&qdone, PZERO + 8 |PCATCH, "loranrd", hz*2);
+ if (TAILQ_EMPTY(&qdone))
return(0);
- this = TAILQ_FIRST(&minors[idx]);
+ this = TAILQ_FIRST(&qdone);
ef = read_eflags();
disable_intr();
- TAILQ_REMOVE(&minors[idx], this, list);
+ TAILQ_REMOVE(&qdone, this, list);
write_eflags(ef);
c = imin(uio->uio_resid, (int)sizeof *this);
@@ -362,146 +348,92 @@ loranread(dev_t dev, struct uio * uio, int ioflag)
}
static void
-loranenqueue(struct datapoint *dp)
+loranenqueue(struct datapoint *this)
{
- struct datapoint *dpp, *dpn;
-
- while(dp) {
- /*
- * The first two elements on "working" are sacred,
- * they're already partly setup in hardware, so the
- * earliest slot we can use is #3
- */
- dpp = TAILQ_FIRST(&working);
- dpp = TAILQ_NEXT(dpp, list);
- dpn = TAILQ_NEXT(dpp, list);
- while (1) {
- /*
- * We cannot bump "dpp", so if "dp" overlaps it
- * skip a beat.
- * XXX: should use better algorithm ?
- */
- if (dpp->scheduled + PGUARD > dp->scheduled) {
- dp->scheduled += dp->fri;
- continue;
- }
-
- /*
- * If "dpn" will be done before "dp" wants to go,
- * we must look further down the list.
- */
- if (dpn && dpn->scheduled + PGUARD < dp->scheduled) {
- dpp = dpn;
- dpn = TAILQ_NEXT(dpp, list);
- continue;
- }
-
- /*
- * If at end of list, put "dp" there
- */
- if (!dpn) {
- TAILQ_INSERT_AFTER(&working, dpp, dp, list);
- break;
- }
-
- /*
- * If "dp" fits before "dpn", insert it there
- */
- if (dpn->scheduled > dp->scheduled + PGUARD) {
- TAILQ_INSERT_AFTER(&working, dpp, dp, list);
- break;
- }
-
- /*
- * If "dpn" is less important, bump it.
- */
- if (dp->priority < dpn->priority) {
- TAILQ_REMOVE(&working, dpn, list);
- TAILQ_INSERT_TAIL(&holding, dpn, list);
- dpn = TAILQ_NEXT(dpp, list);
- continue;
- }
-
- /*
- * "dpn" was more or equally important, "dp" must
- * take yet turn.
- */
- dp->scheduled += dp->fri;
- }
+ struct datapoint *p, *q;
+ u_long ef;
+ u_int64_t x;
+
+ if (this->scheduled < ticker) {
+ x = (ticker - this->scheduled) / (2 * this->gri);
+ this->scheduled += x * 2 * this->gri;
+ }
+
+ ef = read_eflags();
+ disable_intr();
- do {
- /*
- * If anything was bumped, put it back as best we can
- */
- if (TAILQ_EMPTY(&holding)) {
- dp = 0;
- break;
- }
- dp = TAILQ_FIRST(&holding);
- TAILQ_REMOVE(&holding, dp, list);
- if (dp->home) {
- if (!--dp->bounce) {
- TAILQ_INSERT_TAIL(dp->home, dp, list);
- wakeup((caddr_t)dp->home);
- dp = 0;
- }
- }
- } while (!dp);
+ p = TAILQ_FIRST(&qready);
+ while (1) {
+ while (this->scheduled < p->scheduled + PGUARD)
+ this->scheduled += 2 * this->gri;
+ q = TAILQ_NEXT(p, list);
+ if (!q) {
+ this->delay = this->scheduled - p->scheduled - GRI;
+ TAILQ_INSERT_TAIL(&qready, this, list);
+ break;
+ }
+ if (this->scheduled + PGUARD < q->scheduled) {
+ this->delay = this->scheduled - p->scheduled - GRI;
+ TAILQ_INSERT_BEFORE(q, this, list);
+ q->delay = q->scheduled - this->scheduled - GRI;
+ break;
+ }
+ p = q;
}
+ write_eflags(ef);
}
static int
loranwrite(dev_t dev, struct uio * uio, int ioflag)
{
- u_long ef;
int err = 0, c;
struct datapoint *this;
- int idx;
- u_int64_t dt;
-
- idx = minor(dev);
MALLOC(this, struct datapoint *, sizeof *this, M_LORAN, M_WAITOK);
c = imin(uio->uio_resid, (int)sizeof *this);
err = uiomove((caddr_t)this, c, uio);
- if (!err && this->fri == 0)
+ if (!err && this->gri == 0)
err = EINVAL;
- /* XXX more checks */
- this->home = &minors[idx];
- this->priority = idx;
- if (ticker > this->scheduled) {
- dt = ticker - this->scheduled;
- dt -= dt % this->fri;
- this->scheduled += dt;
- }
if (!err) {
- ef = read_eflags();
- disable_intr();
loranenqueue(this);
- write_eflags(ef);
- if (this->vco >= 0)
- vco_want = this->vco;
+ vco_should = this->vco;
} else {
FREE(this, M_LORAN);
}
return(err);
}
-static void
+void
loranintr(int unit)
{
u_long ef;
int status = 0, count = 0, i;
- struct datapoint *this, *next;
- int delay;
ef = read_eflags();
disable_intr();
- this = TAILQ_FIRST(&working);
- TAILQ_REMOVE(&working, this, list);
+ if (this != &dummy) {
+ outb(TGC, DSABDPS);
+ outb(TGC, TG_LOADDP + 0x12); /* hold counter #2 */
+ this->remain = -1;
+ i = 2;
+ for (i = 0; i < 2; i++) {
+ count = this->remain;
+ do {
+ outb(TGC, TG_SAVE + 0x12);
+ this->remain = inb(TGD) & 0xff;
+ this->remain |= inb(TGD) << 8;
+ } while (count == this->remain);
+ }
+ lorantc_magic = 1;
+ nanotime(&this->actual);
+ lorantc_magic = 0;
+ outb(TGC, TG_LOADDP + 0x0a);
+ this->count = inb(TGD);
+ this->count |= inb(TGD) << 8;
+ LOAD_9513(0x12, GRI)
+ }
- nanotime(&this->when);
this->ssig = inb(ADC);
par &= ~(ENG | IEN);
@@ -522,20 +454,30 @@ loranintr(int unit)
outb(ADC, ADC_S);
this->epoch = ticker;
- this->vco = vco_is;
- if (this->home) {
- TAILQ_INSERT_TAIL(this->home, this, list);
- wakeup((caddr_t)this->home);
- } else {
- loranenqueue(this);
+ if (this != &dummy) {
+ TAILQ_INSERT_TAIL(&qdone, this, list);
+ wakeup((caddr_t)&qdone);
}
- this = TAILQ_FIRST(&working);
- next = TAILQ_NEXT(this, list);
-
- delay = next->scheduled - this->scheduled;
- delay -= GRI;
+ if (next != &dummy || TAILQ_NEXT(next, list))
+ TAILQ_REMOVE(&qready, next, list);
+
+ this = next;
+ ticker += GRI;
+ ticker += this->delay;
+
+ next = TAILQ_FIRST(&qready);
+ if (!next) {
+ next = &dummy;
+ TAILQ_INSERT_HEAD(&qready, next, list);
+ } else if (next->delay + GRI > PGUARD * 2) {
+ next->delay -= PGUARD;
+ next = &dummy;
+ TAILQ_INSERT_HEAD(&qready, next, list);
+ }
+ if (next == &dummy)
+ next->scheduled = ticker + GRI + next->delay;
/* load this->params */
par &= ~(INTEG|GATE);
@@ -545,7 +487,7 @@ loranintr(int unit)
outb(CODE, this->code);
- LOAD_9513(0x0a, delay);
+ LOAD_9513(0x0a, next->delay);
/*
* We need to load this from the opposite register * due to some
@@ -557,17 +499,10 @@ loranintr(int unit)
outb(TGC, TG_LOADARM + 0x08);
LOAD_9513(0x14, this->width);
- vco_error += ((vco_is << VCO_SHIFT) - vco_should) * (ticker - vco_when);
- vco_should = vco_want;
- i = vco_should >> VCO_SHIFT;
- if (vco_error < 0)
- i++;
-
- if (vco_is != i) {
- LOAD_DAC(DACA, i);
- vco_is = i;
+ if (vco_is != vco_should) {
+ LOAD_DAC(DACA, vco_should);
+ vco_is = vco_should;
}
- vco_when = ticker;
this->status = inb(TGC);
#if 1
@@ -587,13 +522,15 @@ loranintr(int unit)
outb(PAR, par);
if (status) {
- snprintf(lorantext, sizeof(lorantext),
- "Missed: %02x %d %d this:%p next:%p (dummy=%p)\n",
- status, count, delay, this, next, &dummy);
+ sprintf(lorantext, "Missed: %02x %d %d this:%p next:%p (dummy=%p)\n",
+ status, count, next->delay, this, next, &dummy);
+ loranerror = 1;
+ }
+ if (next->delay < PGUARD - GRI) {
+ sprintf(lorantext, "Bogus: %02x %d %d\n",
+ status, count, next->delay);
loranerror = 1;
}
-
- ticker = this->scheduled;
write_eflags(ef);
}
@@ -605,11 +542,13 @@ loran_get_timecount(struct timecounter *tc)
{
unsigned count;
u_long ef;
+ u_int high, low;
ef = read_eflags();
disable_intr();
- outb(TGC, TG_SAVE + 0x10); /* save counter #5 */
+ if (!lorantc_magic)
+ outb(TGC, TG_SAVE + 0x10); /* save counter #5 */
outb(TGC, TG_LOADDP +0x15); /* hold counter #5 */
count = inb(TGD);
count |= inb(TGD) << 8;
@@ -618,7 +557,7 @@ loran_get_timecount(struct timecounter *tc)
return (count);
}
-static struct timecounter loran_timecounter = {
+static struct timecounter loran_timecounter[3] = {
loran_get_timecount, /* get_timecount */
0, /* no pps_poll */
0xffff, /* counter_mask */
@@ -627,7 +566,7 @@ static struct timecounter loran_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, loran_timecounter, CTLFLAG_RD,
- &loran_timecounter, sizeof(loran_timecounter), "S,timecounter", "");
+ loran_timecounter, sizeof(loran_timecounter), "S,timecounter", "");
/**********************************************************************/
diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c
index 2b5615817eafd..d9e1592c9ade2 100644
--- a/sys/i386/isa/lpt.c
+++ b/sys/i386/isa/lpt.c
@@ -46,7 +46,7 @@
* SUCH DAMAGE.
*
* from: unknown origin, 386BSD 0.1
- * $Id: lpt.c,v 1.71 1998/10/22 05:58:39 bde Exp $
+ * $Id: lpt.c,v 1.69 1998/06/07 17:10:44 dfr Exp $
*/
/*
@@ -189,12 +189,9 @@
#ifndef DEBUG
-#define lprintf(args)
+#define lprintf (void)
#else
-#define lprintf(args) do { \
- if (lptflag) \
- printf args; \
- } while (0)
+#define lprintf if (lptflag) printf
static int volatile lptflag = 1;
#endif
@@ -262,7 +259,6 @@ static struct lpt_softc {
static timeout_t lptout;
static int lptprobe (struct isa_device *dvp);
static int lptattach (struct isa_device *isdp);
-static ointhand2_t lptintr;
#ifdef INET
@@ -318,8 +314,8 @@ lpt_port_test (int port, u_char data, u_char mask)
temp = inb(port) & mask;
}
while (temp != data && --timeout);
- lprintf(("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
- port, data, temp, timeout));
+ lprintf("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
+ port, data, temp, timeout);
return (temp == data);
}
@@ -426,7 +422,6 @@ lptattach(struct isa_device *isdp)
struct lpt_softc *sc;
int unit;
- isdp->id_ointr = lptintr;
unit = isdp->id_unit;
sc = lpt_sc + unit;
sc->sc_port = isdp->id_iobase;
@@ -434,7 +429,7 @@ lptattach(struct isa_device *isdp)
outb(sc->sc_port+lpt_control, LPC_NINIT);
/* check if we can use interrupt */
- lprintf(("oldirq %x\n", sc->sc_irq));
+ lprintf("oldirq %x\n", sc->sc_irq);
if (isdp->id_irq) {
sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
printf("lpt%d: Interrupt-driven port\n", unit);
@@ -443,9 +438,9 @@ lptattach(struct isa_device *isdp)
#endif
} else {
sc->sc_irq = 0;
- lprintf(("lpt%d: Polled port\n", unit));
+ lprintf("lpt%d: Polled port\n", unit);
}
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
#ifdef DEVFS
/* XXX what to do about the flags in the minor number? */
@@ -483,7 +478,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
#endif
if (sc->sc_state) {
- lprintf(("lp: still open %x\n", sc->sc_state));
+ lprintf("lp: still open %x\n", sc->sc_state);
return(EBUSY);
} else
sc->sc_state |= INIT;
@@ -497,7 +492,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
}
s = spltty();
- lprintf(("lp flags 0x%x\n", sc->sc_flags));
+ lprintf("lp flags 0x%x\n", sc->sc_flags);
port = sc->sc_port;
/* set IRQ status according to ENABLE_IRQ flag */
@@ -524,7 +519,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
if (trys++ >= LPINITRDY*4) {
splx(s);
sc->sc_state = 0;
- lprintf(("status %x\n", inb(port+lpt_status)));
+ lprintf ("status %x\n", inb(port+lpt_status) );
return (EBUSY);
}
@@ -556,14 +551,14 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
splx(s);
/* only use timeout if using interrupt */
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout (lptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
}
- lprintf(("opened.\n"));
+ lprintf("opened.\n");
return(0);
}
@@ -573,7 +568,7 @@ lptout (void *arg)
struct lpt_softc *sc = arg;
int pl;
- lprintf(("T %x ", inb(sc->sc_port+lpt_status)));
+ lprintf ("T %x ", inb(sc->sc_port+lpt_status));
if (sc->sc_state & OPEN) {
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
@@ -630,7 +625,7 @@ lptclose(dev_t dev, int flags, int fmt, struct proc *p)
end_close:
sc->sc_state = 0;
sc->sc_xfercnt = 0;
- lprintf(("closed.\n"));
+ lprintf("closed.\n");
return(0);
}
@@ -649,7 +644,7 @@ pushbytes(struct lpt_softc * sc)
char ch;
int port = sc->sc_port;
- lprintf(("p"));
+ lprintf("p");
/* loop for every character .. */
while (sc->sc_xfercnt > 0) {
/* printer data */
@@ -720,16 +715,16 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
- lprintf(("i"));
+ lprintf("i");
/* if the printer is ready for a char, */
/* give it one */
if ((sc->sc_state & OBUSY) == 0){
- lprintf(("\nC %d. ", sc->sc_xfercnt));
+ lprintf("\nC %d. ", sc->sc_xfercnt);
pl = spltty();
lptintr(sc - lpt_sc);
(void) splx(pl);
}
- lprintf(("W "));
+ lprintf("W ");
if (sc->sc_state & OBUSY)
if ((err = tsleep ((caddr_t)sc,
LPPRI|PCATCH, "lpwrite", 0))) {
@@ -739,7 +734,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
}
/* check to see if we must do a polled write */
if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
- lprintf(("p"));
+ lprintf("p");
if((err = pushbytes(sc)))
return(err);
}
@@ -754,7 +749,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
* do checking for interrupted write call.
*/
-static void
+void
lptintr(int unit)
{
struct lpt_softc *sc = lpt_sc + unit;
@@ -784,7 +779,7 @@ lptintr(int unit)
if (sc->sc_xfercnt) {
/* send char */
- /*lprintf(("%x ", *sc->sc_cp)); */
+ /*lprintf("%x ", *sc->sc_cp); */
outb(port+lpt_data, *sc->sc_cp++) ;
outb(port+lpt_control, sc->sc_control|LPC_STB);
/* DELAY(X) */
@@ -801,7 +796,7 @@ lptintr(int unit)
sc->sc_state &= ~OBUSY;
if(!(sc->sc_state & INTERRUPTED))
wakeup((caddr_t)sc);
- lprintf(("w "));
+ lprintf("w ");
return;
} else { /* check for error */
if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
@@ -809,7 +804,7 @@ lptintr(int unit)
sc->sc_state |= ERROR;
/* lptout() will jump in and try to restart. */
}
- lprintf(("sts %x ", sts));
+ lprintf("sts %x ", sts);
}
static int
@@ -992,7 +987,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- lprintf(("LP:ioctl(0x%lx)\n", cmd));
+ lprintf("LP:ioctl(0x%lx)\n", cmd);
return EINVAL;
}
return 0;
@@ -1089,7 +1084,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1138,7 +1133,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1160,7 +1155,7 @@ lpintr (int unit)
err:
outb(lpt_data_port, 0);
- lprintf(("R"));
+ lprintf("R");
sc->sc_if.if_ierrors++;
sc->sc_iferrs++;
@@ -1224,7 +1219,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (ifp->if_flags & IFF_LINK0) {
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1284,7 +1279,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
nend:
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1293,7 +1288,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
(void) splx(s);
@@ -1301,7 +1296,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
}
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1326,7 +1321,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1354,7 +1349,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
diff --git a/sys/i386/isa/matcd/audio.c b/sys/i386/isa/matcd/audio.c
index b395fb410645b..a7891cb123624 100644
--- a/sys/i386/isa/matcd/audio.c
+++ b/sys/i386/isa/matcd/audio.c
@@ -213,7 +213,7 @@ static int matcd_pause(int ldrive, int cdrive, int controller, int action)
} /*<14>*/
unlockbus(controller, ldrive); /*<16>Release bus*/
- if ((z & MATCD_ST_AUDIOBSY) == 0 && /*<14>If drive is idle*/
+ if (z & MATCD_ST_AUDIOBSY==0 && /*<14>If drive is idle*/
cd->status==CD_AS_PLAY_IN_PROGRESS) { /*<14>but was playing*/
cd->status=CD_AS_PLAY_COMPLETED; /*<14>then its done*/
return(0);
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index 4f1943a589f96..adc8f8f1b73ca 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95";
static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV";
/* The proceeding strings may not be changed*/
-/* $Id: matcd.c,v 1.36 1998/07/15 10:11:21 bde Exp $ */
+/* $Id: matcd.c,v 1.35 1998/07/04 22:30:20 julian Exp $ */
/*---------------------------------------------------------------------------
Include declarations
@@ -437,7 +437,7 @@ static struct matcd_data {
void *rlc_devfs_token;
void *la_devfs_token;
void *lc_devfs_token;
-#endif /* DEVFS */
+#endif DEVFS
} matcd_data[TOTALDRIVES];
@@ -2445,7 +2445,7 @@ static int matcd_toc_entries(int ldrive, int cdrive, int controller,
struct cd_toc_entry *to;
int len,trk,i,z,port;
unsigned char cmd[MAXCMDSIZ];
- unsigned char data[8];
+ unsigned char data[5];
cd=&matcd_data[ldrive];
port=cd->iobase;
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index a24a79fca7aa3..0e3bd17eaae9d 100644
--- a/sys/i386/isa/mcd.c
+++ b/sys/i386/isa/mcd.c
@@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mcd.c,v 1.100 1998/07/13 09:53:01 bde Exp $
+ * $Id: mcd.c,v 1.99 1998/07/04 22:30:17 julian Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -178,7 +178,6 @@ static int mcd_send(int unit, int cmd,int nretrys);
static void hsg2msf(int hsg, bcd_t *msf);
static int msf2hsg(bcd_t *msf, int relative);
static int mcd_volinfo(int unit);
-static ointhand2_t mcdintr;
static int mcd_waitrdy(int port,int dly);
static timeout_t mcd_timeout;
static void mcd_doread(int state, struct mcd_mbx *mbxin);
@@ -250,7 +249,6 @@ int mcd_attach(struct isa_device *dev)
int unit = dev->id_unit;
struct mcd_data *cd = mcd_data + unit;
- dev->id_ointr = mcdintr;
cd->iobase = dev->id_iobase;
cd->flags |= MCDINIT;
mcd_soft_reset(unit);
@@ -979,7 +977,7 @@ mcd_volinfo(int unit)
return EINVAL;
}
-static void
+void
mcdintr(unit)
int unit;
{
diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c
index 6579de2d6a2a2..d907e4c0ac8e9 100644
--- a/sys/i386/isa/mse.c
+++ b/sys/i386/isa/mse.c
@@ -11,7 +11,7 @@
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * $Id: mse.c,v 1.38 1998/06/07 17:10:47 dfr Exp $
+ * $Id: mse.c,v 1.37 1998/01/24 02:54:22 eivind Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -87,7 +87,6 @@ static struct cdevsw mse_cdevsw =
mseioctl, nostop, nullreset, nodevtotty,/* mse */
msepoll, nommap, NULL, "mse", NULL, -1 };
-static ointhand2_t mseintr;
/*
* Software control structure for mouse. The sc_enablemouse(),
@@ -258,7 +257,6 @@ mseattach(idp)
int unit = idp->id_unit;
struct mse_softc *sc = &mse_sc[unit];
- idp->id_ointr = mseintr;
sc->sc_port = idp->id_iobase;
sc->mode.accelfactor = (idp->id_flags & MSE_CONFIG_ACCEL) >> 4;
#ifdef DEVFS
@@ -548,7 +546,7 @@ msepoll(dev, events, p)
/*
* mseintr: update mouse status. sc_deltax and sc_deltay are accumulative.
*/
-static void
+void
mseintr(unit)
int unit;
{
diff --git a/sys/i386/isa/ncr5380.c b/sys/i386/isa/ncr5380.c
new file mode 100644
index 0000000000000..e8978372bd01c
--- /dev/null
+++ b/sys/i386/isa/ncr5380.c
@@ -0,0 +1,1536 @@
+/*
+ * FreeBSD generic NCR-5380/NCR-53C400 SCSI driver
+ *
+ * Copyright (C) 1994 Serge Vakulenko (vak@cronyx.ru)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPERS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Tested on the following hardware:
+ * Adapter: Trantor T130
+ * Streamer: Archive Viper 150,
+ * CD-ROM: NEC CDR-25
+ */
+#undef DEBUG
+
+#include "nca.h"
+#if NNCA > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#include <i386/isa/ic/ncr5380.h>
+#include <i386/isa/ic/ncr53400.h>
+
+#include <scsi/scsiconf.h>
+
+#ifdef DEBUG
+# define PRINT(s) printf s
+#else
+# define PRINT(s) /*void*/
+#endif
+
+#define SCB_TABLE_SIZE 8 /* start with 8 scb entries in table */
+#define BLOCK_SIZE 512 /* size of READ/WRITE areas on SCSI card */
+#define HOST_SCSI_ADDR 7 /* address of the adapter on the SCSI bus */
+
+/*
+ * Defice config flags
+ */
+#define FLAG_NOPARITY 0x01 /* disable SCSI bus parity check */
+
+/*
+ * ProAudioSpectrum registers
+ */
+#define PAS16_DATA 8 /* Data Register */
+#define PAS16_STAT 9 /* Status Register */
+#define PAS16_STAT_DREQ 0x80 /* Pseudo-DMA ready bit */
+#define PAS16_REG(r) (((r) & 0xc) << 11 | ((r) & 3))
+
+static u_char pas16_irq_magic[] =
+ { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 };
+
+/*
+ * SCSI bus phases
+ */
+#define PHASE_MASK (CSBR_MSG | CSBR_CD | CSBR_IO)
+#define PHASE_DATAOUT 0
+#define PHASE_DATAIN CSBR_IO
+#define PHASE_CMDOUT CSBR_CD
+#define PHASE_STATIN (CSBR_CD | CSBR_IO)
+#define PHASE_MSGOUT (CSBR_MSG | CSBR_CD)
+#define PHASE_MSGIN (CSBR_MSG | CSBR_CD | CSBR_IO)
+#define PHASE_NAME(ph) phase_name[(ph)>>2]
+#define PHASE_TO_TCR(ph) ((ph) >> 2)
+
+static char *phase_name[] = {
+ "DATAOUT", "DATAIN", "CMDOUT", "STATIN",
+ "Phase4?", "Phase5?", "MSGOUT", "MSGIN",
+};
+
+/*
+ * SCSI message codes
+ */
+#define MSG_COMMAND_COMPLETE 0x00
+#define MSG_SAVE_POINTERS 0x02
+#define MSG_RESTORE_POINTERS 0x03
+#define MSG_DISCONNECT 0x04
+#define MSG_ABORT 0x06
+#define MSG_MESSAGE_REJECT 0x07
+#define MSG_NOP 0x08
+#define MSG_BUS_DEV_RESET 0x0c
+#define MSG_IDENTIFY(lun) (0xc0 | ((lun) & 0x7))
+#define MSG_ISIDENT(m) ((m) & 0x80)
+
+/*
+ * SCSI control block used to keep info about a scsi command
+ */
+typedef struct scb {
+ int flags; /* status of the instruction */
+#define SCB_FREE 0x00
+#define SCB_ACTIVE 0x01
+#define SCB_ABORTED 0x02
+#define SCB_TIMEOUT 0x04
+#define SCB_ERROR 0x08
+#define SCB_TIMECHK 0x10 /* we have set a timeout on this one */
+#define SCB_SENSE 0x20 /* sensed data available */
+#define SCB_TBUSY 0x40 /* target busy */
+ struct scb *next; /* in free list */
+ struct scsi_xfer *xfer; /* the scsi_xfer for this cmd */
+ u_char *data; /* position in data buffer so far */
+ int32_t datalen; /* bytes remaining to transfer */
+} scb_t;
+
+typedef enum {
+ CTLR_NONE,
+ CTLR_NCR_5380,
+ CTLR_NCR_53C400,
+ CTLR_PAS_16
+} ctlr_t;
+
+/*
+ * Data structure describing the target state.
+ */
+typedef struct {
+ u_char busy; /* mask of busy luns at device target */
+ u_long perrcnt; /* counter of target parity errors */
+} target_t;
+
+/*
+ * Data structure describing current status of the scsi bus. One for each
+ * controller card.
+ */
+typedef struct {
+ ctlr_t type; /* Seagate or Future Domain */
+ char *name; /* adapter name */
+
+ /* NCR-5380 controller registers */
+ u_short ODR; /* (wo-0) Output Data Register */
+ u_short CSDR; /* (ro-0) Current SCSI Data Register */
+ u_short ICR; /* (rw-1) Initiator Command Register */
+ u_short MR; /* (rw-2) Mode Register */
+ u_short TCR; /* (rw-3) Target Command Register */
+ u_short SER; /* (wo-4) Select Enable Register */
+ u_short CSBR; /* (ro-4) Current SCSI Bus Status Register */
+ u_short BSR; /* (ro-5) Bus and Status Register */
+ u_short SDSR; /* (wo-5) Start DMA Send Register */
+ u_short SDIR; /* (wo-7) Start DMA Initiator Receive Register */
+ u_short RPIR; /* (ro-7) Reset Parity/Interrupt Register */
+
+ /* NCR-53C400 controller registers */
+ u_short CSR; /* (rw-0) Control and Status Register */
+ u_short CCR; /* (rw-1) Clock Counter Register */
+ u_short HBR; /* (rw-4) Host Buffer Register */
+
+ /* ProAudioSpectrum controller registers */
+ u_short PDATA; /* (rw) Pseudo-DMA Data Register */
+ u_short PSTAT; /* (rw) Pseudo-DMA Status Register */
+
+ u_char scsi_addr; /* our scsi address, 0..7 */
+ u_char scsi_id; /* our scsi id mask */
+ u_char parity; /* parity flag: CMD_EN_PARITY or 0 */
+ u_char irq; /* IRQ number used or 0 if no IRQ */
+ u_int timeout_active : 1; /* timeout() active (requested) */
+
+ struct scsi_link sc_link; /* struct connecting different data */
+ scb_t *queue; /* waiting to be issued */
+ scb_t *disconnected_queue; /* waiting to reconnect */
+
+ int numscb; /* number of scsi control blocks */
+ scb_t *free_scb; /* free scb list */
+ scb_t scbs[SCB_TABLE_SIZE];
+
+ target_t target[8]; /* target state data */
+} adapter_t;
+
+static adapter_t ncadata[NNCA];
+
+#define IS_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &\
+ (1 << (b)->xfer->sc_link->lun))
+#define SET_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy |=\
+ (1 << (b)->xfer->sc_link->lun))
+#define CLEAR_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &=\
+ ~(1 << (b)->xfer->sc_link->lun))
+
+/*
+ * Wait for condition, given as an boolean expression.
+ * Print the message on timeout.
+ */
+#define WAITFOR(condition,count,message) {\
+ register u_long cnt = count; char *_msg = message;\
+ while (cnt-- && ! (condition)) continue;\
+ if (cnt == -1 && _msg)\
+ printf ("nca: %s timeout\n", _msg); }
+
+static int nca_probe (struct isa_device *dev);
+static int nca_attach (struct isa_device *dev);
+static int32_t nca_scsi_cmd (struct scsi_xfer *xs);
+static u_int32_t nca_adapter_info (int unit);
+static void nca_timeout (void *scb);
+static void ncaminphys (struct buf *bp);
+static void nca_done (adapter_t *z, scb_t *scb);
+static void nca_start (adapter_t *z);
+static void nca_information_transfer (adapter_t *z, scb_t *scb);
+static int nca_poll (adapter_t *z, scb_t *scb);
+static int nca_init (adapter_t *z);
+static int nca_reselect (adapter_t *z);
+static int nca_select (adapter_t *z, scb_t *scb);
+static int nca_abort (adapter_t *z, scb_t *scb);
+static void nca_send_abort (adapter_t *z);
+static u_char nca_msg_input (adapter_t *z);
+static void nca_tick (void *arg);
+static int nca_sense (adapter_t *z, scb_t *scb);
+static void nca_data_output (adapter_t *z, u_char **pdata, u_long *plen);
+static void nca_data_input (adapter_t *z, u_char **pdata, u_long *plen);
+static void nca_cmd_output (adapter_t *z, u_char *cmd, int cmdlen);
+static void nca_53400_dma_xfer (adapter_t *z, int r, u_char **dat, u_long *len);
+static void nca_pas_dma_xfer (adapter_t *z, int r, u_char **dat, u_long *len);
+
+static struct scsi_adapter nca_switch = {
+ nca_scsi_cmd, ncaminphys, 0, 0, nca_adapter_info, "nca", {0},
+};
+static struct scsi_device nca_dev = { NULL, NULL, NULL, NULL, "nca", 0, {0} };
+struct isa_driver ncadriver = { nca_probe, nca_attach, "nca" };
+
+/*
+ * Check if the device can be found at the port given and if so,
+ * detect the type of board. Set it up ready for further work.
+ * Takes the isa_dev structure from autoconf as an argument.
+ * Returns 1 if card recognized, 0 if errors.
+ */
+int nca_probe (struct isa_device *dev)
+{
+ adapter_t *z = &ncadata[dev->id_unit];
+ int i;
+
+ /* Init fields used by our routines */
+ z->parity = (dev->id_flags & FLAG_NOPARITY) ? 0 :
+ MR_ENABLE_PARITY_CHECKING;
+ z->scsi_addr = HOST_SCSI_ADDR;
+ z->scsi_id = 1 << z->scsi_addr;
+ z->irq = dev->id_irq ? ffs (dev->id_irq) - 1 : 0;
+ z->queue = 0;
+ z->disconnected_queue = 0;
+ for (i=0; i<8; i++)
+ z->target[i].busy = 0;
+
+ /* Link up the free list of scbs */
+ z->numscb = SCB_TABLE_SIZE;
+ z->free_scb = z->scbs;
+ for (i=1; i<SCB_TABLE_SIZE; i++)
+ z->scbs[i-1].next = z->scbs + i;
+ z->scbs[SCB_TABLE_SIZE-1].next = 0;
+
+ /* Try NCR 5380. */
+ z->type = CTLR_NCR_5380;
+ z->name = "NCR-5380";
+ z->ODR = dev->id_iobase + C80_ODR;
+ z->CSDR = dev->id_iobase + C80_CSDR;
+ z->ICR = dev->id_iobase + C80_ICR;
+ z->MR = dev->id_iobase + C80_MR;
+ z->TCR = dev->id_iobase + C80_TCR;
+ z->SER = dev->id_iobase + C80_SER;
+ z->CSBR = dev->id_iobase + C80_CSBR;
+ z->BSR = dev->id_iobase + C80_BSR;
+ z->SDSR = dev->id_iobase + C80_SDSR;
+ z->SDIR = dev->id_iobase + C80_SDIR;
+ z->RPIR = dev->id_iobase + C80_RPIR;
+ z->CSR = 0;
+ z->CCR = 0;
+ z->HBR = 0;
+ z->PDATA = 0;
+ z->PSTAT = 0;
+ if (nca_init (z) == 0)
+ return (8);
+
+ /* Try NCR 53C400. */
+ z->type = CTLR_NCR_53C400;
+ z->name = "NCR-53C400";
+ z->ODR = dev->id_iobase + C400_5380_REG_OFFSET + C80_ODR;
+ z->CSDR = dev->id_iobase + C400_5380_REG_OFFSET + C80_CSDR;
+ z->ICR = dev->id_iobase + C400_5380_REG_OFFSET + C80_ICR;
+ z->MR = dev->id_iobase + C400_5380_REG_OFFSET + C80_MR;
+ z->TCR = dev->id_iobase + C400_5380_REG_OFFSET + C80_TCR;
+ z->SER = dev->id_iobase + C400_5380_REG_OFFSET + C80_SER;
+ z->CSBR = dev->id_iobase + C400_5380_REG_OFFSET + C80_CSBR;
+ z->BSR = dev->id_iobase + C400_5380_REG_OFFSET + C80_BSR;
+ z->SDSR = dev->id_iobase + C400_5380_REG_OFFSET + C80_SDSR;
+ z->SDIR = dev->id_iobase + C400_5380_REG_OFFSET + C80_SDIR;
+ z->RPIR = dev->id_iobase + C400_5380_REG_OFFSET + C80_RPIR;
+ z->CSR = dev->id_iobase + C400_CSR;
+ z->CCR = dev->id_iobase + C400_CCR;
+ z->HBR = dev->id_iobase + C400_HBR;
+ z->PDATA = 0;
+ z->PSTAT = 0;
+ if (nca_init (z) == 0)
+ return (16);
+
+ /* Try ProAudioSpectrum-16. */
+ z->type = CTLR_PAS_16;
+ z->name = "ProAudioSpectrum"; /* changed later */
+ z->ODR = dev->id_iobase ^ PAS16_REG (C80_ODR);
+ z->CSDR = dev->id_iobase ^ PAS16_REG (C80_CSDR);
+ z->ICR = dev->id_iobase ^ PAS16_REG (C80_ICR);
+ z->MR = dev->id_iobase ^ PAS16_REG (C80_MR);
+ z->TCR = dev->id_iobase ^ PAS16_REG (C80_TCR);
+ z->SER = dev->id_iobase ^ PAS16_REG (C80_SER);
+ z->CSBR = dev->id_iobase ^ PAS16_REG (C80_CSBR);
+ z->BSR = dev->id_iobase ^ PAS16_REG (C80_BSR);
+ z->SDSR = dev->id_iobase ^ PAS16_REG (C80_SDSR);
+ z->SDIR = dev->id_iobase ^ PAS16_REG (C80_SDIR);
+ z->RPIR = dev->id_iobase ^ PAS16_REG (C80_RPIR);
+ z->CSR = 0;
+ z->CCR = 0;
+ z->HBR = 0;
+ z->PDATA = dev->id_iobase ^ PAS16_REG (PAS16_DATA);
+ z->PSTAT = dev->id_iobase ^ PAS16_REG (PAS16_STAT);
+ if (nca_init (z) == 0)
+ return (4);
+
+ bzero (z, sizeof (*z));
+ return (0);
+}
+
+/*
+ * Probe the adapter, and if found, reset the board and the scsi bus.
+ * Return 0 if the adapter found.
+ */
+int nca_init (adapter_t *z)
+{
+ int i, c;
+
+ if (z->type == CTLR_NCR_53C400) {
+ if (inb (z->CSR) == 0xFF)
+ return (100);
+
+ /* Reset 53C400. */
+ outb (z->CSR, CSR_5380_ENABLE);
+
+ /* Enable interrupts. */
+ outb (z->CSR, z->irq ? CSR_5380_INTR : 0);
+ }
+
+ if (z->type == CTLR_PAS_16) {
+ u_short base = z->PDATA & 0x3FF;
+
+ outb (0x9a01, 0xbc + (z-ncadata)); /* unit number */
+ outb (0x9a01, base >> 2);
+
+ if (inb (base^0x803) == 0xFF)
+ return (200);
+
+ if (inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF &&
+ inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF &&
+ inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF &&
+ inb (z->CSDR) == 0xFF && inb (z->CSDR^0x2000) == 0xFF)
+ return (201);
+
+ i = inb (base^0x803);
+ outb (base^0x803, i ^ 0xE0);
+ c = inb (base^0x803);
+ outb (base^0x803, 1);
+ if (i != c)
+ return (202);
+
+ /* Various magic. */
+ outb (base^0x4000, 0x30); /* Timeout counter */
+ outb (base^0x4001, 0x01); /* Reset TC */
+ outb (base^0xbc00, 0x01); /* 1 Wait state */
+ outb (base^0x8003, 0x4d); /* sysconfig_4 */
+ i = pas16_irq_magic[z->irq];
+ if (!i) {
+ z->irq = 0;
+ } else {
+ outb (base^0xf002, i << 4);
+ outb (base^0x8003, 0x6d); /* sysconfig_4 */
+ }
+
+ switch (inb (base^0xEC03) & 0xF) {
+ case 6: z->name = "ProAudioSpectrum-Plus"; break;
+ case 12: z->name = "ProAudioSpectrum-16D"; break;
+ case 14: z->name = "ProAudioSpectrum-CDPC"; break;
+ case 15: z->name = "ProAudioSpectrum-16"; break;
+ default: return (203);
+ }
+ }
+
+ /* Read RPI port, resetting parity/interrupt state. */
+ inb (z->RPIR);
+
+ /* Test BSR: parity error, interrupt request and busy loss state
+ * should be cleared. */
+ if (inb (z->BSR) & (BSR_PARITY_ERROR |
+ BSR_INTERRUPT_REQUEST_ACTIVE | BSR_BUSY_ERROR)) {
+ PRINT (("nca: invalid bsr[0x%x]=%b\n", z->BSR,
+ inb (z->BSR), BSR_BITS));
+ return (1);
+ }
+
+ /* Reset the SCSI bus. */
+ outb (z->ICR, ICR_ASSERT_RST);
+ outb (z->ODR, 0);
+ /* Hold reset for at least 25 microseconds. */
+ DELAY (25);
+ /* Check that status cleared. */
+ if (inb (z->CSBR) != CSBR_RST) {
+ PRINT (("nca: invalid csbr[0x%x]=%b\n", z->CSBR,
+ inb (z->CSBR), CSBR_BITS));
+ outb (z->ICR, 0);
+ return (2);
+ }
+ /* Clear reset. */
+ outb (z->ICR, 0);
+ /* Wait a Bus Clear Delay (800 ns + bus free delay 800 ns). */
+ DELAY (2);
+
+ /* Enable data drivers. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+
+ /* Check that data register is writable. */
+ for (i=0; i<256; ++i) {
+ outb (z->ODR, i);
+ DELAY (1);
+ if (inb (z->CSDR) != i) {
+ PRINT (("nca: ODR[0x%x] not writable: 0x%x should be 0x%x\n",
+ z->ODR, inb (z->CSDR), i));
+ outb (z->ICR, 0);
+ return (3);
+ }
+ }
+
+ /* Disable data drivers. */
+ outb (z->ICR, 0);
+
+ /* Check that data register is NOT writable. */
+ c = inb (z->CSDR);
+ for (i=0; i<256; ++i) {
+ outb (z->ODR, i);
+ DELAY (1);
+ if (inb (z->CSDR) != c) {
+ PRINT (("nca: ODR[0x%x] writable: 0x%x should be 0x%x\n",
+ z->ODR, inb (z->CSDR), c));
+ return (4);
+ }
+ }
+
+ /* Initialize the controller. */
+ outb (z->MR, z->parity);
+ outb (z->TCR, 0);
+ outb (z->SER, z->scsi_id);
+ return (0);
+}
+
+/*
+ * Attach all sub-devices we can find.
+ */
+int nca_attach (struct isa_device *dev)
+{
+ int unit = dev->id_unit;
+ adapter_t *z = &ncadata[unit];
+ struct scsibus_data *scbus;
+
+ printf ("nca%d: type %s%s\n", unit, z->name,
+ (dev->id_flags & FLAG_NOPARITY) ? ", no parity" : "");
+
+ /* fill in the prototype scsi_link */
+ z->sc_link.adapter_unit = unit;
+ z->sc_link.adapter_targ = z->scsi_addr;
+ z->sc_link.adapter_softc = z;
+ z->sc_link.adapter = &nca_switch;
+ z->sc_link.device = &nca_dev;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &z->sc_link;
+
+ /* ask the adapter what subunits are present */
+ scsi_attachdevs (scbus);
+
+ return (1);
+}
+
+/*
+ * Return some information to the caller about
+ * the adapter and its capabilities.
+ */
+u_int32_t nca_adapter_info (int unit)
+{
+ return (1);
+}
+
+void ncaminphys (struct buf *bp)
+{
+}
+
+/*
+ * Catch an interrupt from the adaptor.
+ */
+void ncaintr (int unit)
+{
+ adapter_t *z = &ncadata[unit];
+
+ PRINT (("nca%d: interrupt bsr=%b csbr=%b\n", unit,
+ inb (z->BSR), BSR_BITS, inb (z->CSBR), CSBR_BITS));
+ nca_start (z);
+ /* Reset interrupt state. */
+ inb (z->RPIR);
+}
+
+/*
+ * This routine is used in the case when we have no IRQ line (z->irq == 0).
+ * It is called every timer tick and polls for reconnect from target.
+ */
+void nca_tick (void *arg)
+{
+ adapter_t *z = arg;
+ int x = splbio ();
+
+ z->timeout_active = 0;
+ nca_start (z);
+ /* Reset interrupt state. */
+ inb (z->RPIR);
+ if (z->disconnected_queue && ! z->timeout_active) {
+ timeout (nca_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ splx (x);
+}
+
+/*
+ * Start a scsi operation given the command and the data address.
+ * Also needs the unit, target and lu. Get a free scb and set it up.
+ * Call send_scb. Either start timer or wait until done.
+ */
+int32_t nca_scsi_cmd (struct scsi_xfer *xs)
+{
+ int unit = xs->sc_link->adapter_unit, flags = xs->flags, x = 0;
+ adapter_t *z = (adapter_t *)xs->sc_link->adapter_softc;
+ scb_t *scb;
+
+ /* PRINT (("nca%d/%d/%d command 0x%x\n", unit, xs->sc_link->target,
+ xs->sc_link->lun, xs->cmd->opcode)); */
+ if (xs->bp)
+ flags |= SCSI_NOSLEEP;
+ if (flags & ITSDONE) {
+ printf ("nca%d: already done?", unit);
+ xs->flags &= ~ITSDONE;
+ }
+ if (! (flags & INUSE)) {
+ printf ("nca%d: not in use?", unit);
+ xs->flags |= INUSE;
+ }
+ if (flags & SCSI_RESET)
+ printf ("nca%d: SCSI_RESET not implemented\n", unit);
+
+ if (! (flags & SCSI_NOMASK))
+ x = splbio ();
+
+ /* Get a free scb.
+ * If we can and have to, sleep waiting for one to come free. */
+ while (! (scb = z->free_scb)) {
+ if (flags & SCSI_NOSLEEP) {
+ xs->error = XS_DRIVER_STUFFUP;
+ if (! (flags & SCSI_NOMASK))
+ splx (x);
+ return (TRY_AGAIN_LATER);
+ }
+ tsleep ((caddr_t)&z->free_scb, PRIBIO, "ncascb", 0);
+ }
+ /* Get scb from free list. */
+ z->free_scb = scb->next;
+ scb->next = 0;
+ scb->flags = SCB_ACTIVE;
+
+ /* Put all the arguments for the xfer in the scb */
+ scb->xfer = xs;
+ scb->datalen = xs->datalen;
+ scb->data = xs->data;
+
+ /* Setup the scb to contain necessary values.
+ * The interesting values can be read from the xs that is saved.
+ * I therefore think that the structure can be kept very small.
+ * The driver doesn't use DMA so the scatter/gather is not needed? */
+ if (! z->queue) {
+ scb->next = z->queue;
+ z->queue = scb;
+ } else {
+ scb_t *q;
+
+ for (q=z->queue; q->next; q=q->next)
+ continue;
+ q->next = scb;
+ scb->next = 0; /* placed at the end of the queue */
+ }
+
+ /* Try to send this command to the board. */
+ nca_start (z);
+
+ /* Usually return SUCCESSFULLY QUEUED. */
+ if (! (flags & SCSI_NOMASK)) {
+ splx (x);
+ if (xs->flags & ITSDONE)
+ /* Timeout timer not started, already finished.
+ * Tried to return COMPLETE but the machine hanged
+ * with this. */
+ return (SUCCESSFULLY_QUEUED);
+ xs->timeout_ch = timeout (nca_timeout, (caddr_t) scb,
+ (xs->timeout * hz) / 1000);
+ scb->flags |= SCB_TIMECHK;
+ PRINT (("nca%d/%d/%d command queued\n", unit,
+ xs->sc_link->target, xs->sc_link->lun));
+ return (SUCCESSFULLY_QUEUED);
+ }
+
+ /* If we can't use interrupts, poll on completion. */
+ if (! nca_poll (z, scb)) {
+ /* We timed out, so call the timeout handler manually,
+ * accounting for the fact that the clock is not running yet
+ * by taking out the clock queue entry it makes. */
+ nca_timeout ((void*) scb);
+
+ /* Because we are polling, take out the timeout entry
+ * nca_timeout made. */
+ untimeout (nca_timeout, (void*) scb, scb->xfer->timeout_ch);
+
+ if (! nca_poll (z, scb))
+ /* We timed out again... This is bad. Notice that
+ * this time there is no clock queue entry to remove. */
+ nca_timeout ((void*) scb);
+ }
+ /* PRINT (("nca%d/%d/%d command %s\n", unit,
+ xs->sc_link->target, xs->sc_link->lun,
+ xs->error ? "failed" : "done")); */
+ return (xs->error ? HAD_ERROR : COMPLETE);
+}
+
+/*
+ * Coroutine that runs as long as more work can be done.
+ * Both scsi_cmd() and intr() will try to start it in
+ * case it is not running.
+ * Always called with interrupts disabled.
+ */
+void nca_start (adapter_t *z)
+{
+ scb_t *q, *prev;
+again:
+ /* First check that if any device has tried
+ * a reconnect while we have done other things
+ * with interrupts disabled. */
+ if (nca_reselect (z))
+ goto again;
+
+ /* Search through the queue for a command
+ * destined for a target that's not busy. */
+ for (q=z->queue, prev=0; q; prev=q, q=q->next) {
+ /* Attempt to establish an I_T_L nexus here. */
+ if (IS_BUSY (z, q) || ! nca_select (z, q))
+ continue;
+
+ /* Remove the command from the issue queue. */
+ if (prev)
+ prev->next = q->next;
+ else
+ z->queue = q->next;
+ q->next = 0;
+
+ /* We are connected. Do the task. */
+ nca_information_transfer (z, q);
+ goto again;
+ }
+}
+
+void nca_timeout (void *arg)
+{
+ scb_t *scb = (scb_t*) arg;
+ int unit = scb->xfer->sc_link->adapter_unit;
+ adapter_t *z = (adapter_t *)scb->xfer->sc_link->adapter_softc;
+ int x = splbio ();
+
+ if (! (scb->xfer->flags & SCSI_NOMASK))
+ printf ("nca%d/%d/%d (%s%d) timed out\n", unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ scb->xfer->sc_link->device->name,
+ scb->xfer->sc_link->dev_unit);
+
+ /* If it has been through before, then a previous abort has failed,
+ * don't try abort again. */
+ if (! (scb->flags & SCB_ABORTED)) {
+ nca_abort (z, scb);
+ /* 2 seconds for the abort */
+ scb->xfer->timeout_ch = timeout (nca_timeout, (caddr_t)scb,
+ 2*hz);
+ scb->flags |= (SCB_ABORTED | SCB_TIMECHK);
+ } else {
+ /* abort timed out */
+ scb->flags |= SCB_ABORTED;
+ scb->xfer->retries = 0;
+ nca_done (z, scb);
+ }
+ splx (x);
+}
+
+static __inline void nca_sendbyte (adapter_t *z, u_char data)
+{
+ outb (z->ODR, data);
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_ACK);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 10000, "sendbyte");
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+}
+
+static __inline u_char nca_recvbyte (adapter_t *z)
+{
+ u_char data;
+
+ data = inb (z->CSDR);
+ outb (z->ICR, ICR_ASSERT_ACK);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 10000, "recvbyte");
+ outb (z->ICR, 0);
+ return (data);
+}
+
+/*
+ * Establish I_T_L or I_T_L_Q nexus for new or existing command
+ * including ARBITRATION, SELECTION, and initial message out
+ * for IDENTIFY and queue messages.
+ * Return 1 if selection succeded.
+ */
+int nca_select (adapter_t *z, scb_t *scb)
+{
+ /* Set the phase bits to 0, otherwise the NCR5380 won't drive the
+ * data bus during SELECTION. */
+ outb (z->TCR, 0);
+
+ /* Start arbitration. */
+ outb (z->ODR, z->scsi_id);
+ outb (z->MR, MR_ARBITRATE);
+
+ /* Wait for arbitration logic to complete (20 usec) */
+ WAITFOR (inb (z->ICR) & ICR_ARBITRATION_IN_PROGRESS, 200, 0);
+ if (! (inb (z->ICR) & ICR_ARBITRATION_IN_PROGRESS)) {
+ PRINT (("nca%d/%d/%d no arbitration progress, bsr=%b csbr=%b\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, inb (z->BSR), BSR_BITS,
+ inb (z->CSBR), CSBR_BITS));
+ outb (z->MR, z->parity);
+ return (0);
+ }
+ DELAY (3);
+
+ /* Check for lost arbitration. */
+ if ((inb (z->ICR) & ICR_LOST_ARBITRATION) ||
+ (inb (z->CSDR) >> 1 >> z->scsi_addr) ||
+ (inb (z->ICR) & ICR_LOST_ARBITRATION)) {
+ PRINT (("nca%d/%d/%d arbitration lost\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->MR, z->parity);
+ return (0);
+ }
+
+ outb (z->ICR, ICR_ASSERT_SEL);
+ if (inb (z->ICR) & ICR_LOST_ARBITRATION) {
+ PRINT (("nca%d/%d/%d arbitration lost after SEL\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->MR, z->parity);
+ return (0);
+ }
+ DELAY (2);
+
+ /* Start selection, asserting the host and target ID's on the bus. */
+ outb (z->SER, 0);
+ outb (z->ODR, z->scsi_id | (1 << scb->xfer->sc_link->target));
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_BSY |
+ ICR_ASSERT_SEL);
+
+ /* Finish arbitration, drop BSY. */
+ outb (z->MR, 0);
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_SEL |
+ ICR_ASSERT_ATN);
+ DELAY (1);
+
+ /* The SCSI specification calls for a 250 ms timeout for the actual
+ * selection. */
+ WAITFOR (inb (z->CSBR) & CSBR_BSY, 100000, 0);
+ if (! (inb (z->CSBR) & CSBR_BSY)) {
+ /* The target does not respond. Not an error, though. */
+ PRINT (("nca%d/%d/%d target does not respond\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+ scb->flags |= SCB_TIMEOUT;
+ return (0);
+ }
+
+ /* Clear SEL and SCSI id.
+ * Wait for start of REQ/ACK handshake. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS | ICR_ASSERT_ATN);
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, 0);
+ if (! (inb (z->CSBR) & CSBR_REQ)) {
+ PRINT (("nca%d/%d/%d timeout waiting for REQ\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+ scb->flags |= SCB_ERROR;
+ return (0);
+ }
+
+ /* Check for phase mismatch. */
+ if ((inb (z->CSBR) & PHASE_MASK) != PHASE_MSGOUT) {
+ /* This should not be taken as an error, but more like
+ * an unsupported feature!
+ * Should set a flag indicating that the target don't support
+ * messages, and continue without failure.
+ * (THIS IS NOT AN ERROR!) */
+ PRINT (("nca%d/%d/%d waiting for MSGOUT: invalid phase %s\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ PHASE_NAME (inb (z->CSBR) & PHASE_MASK)));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+ scb->flags |= SCB_ERROR;
+ return (0);
+ }
+
+ /* Allow disconnects. */
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGOUT));
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ nca_sendbyte (z, MSG_IDENTIFY (scb->xfer->sc_link->lun));
+ outb (z->ICR, 0);
+ outb (z->SER, z->scsi_id);
+ outb (z->MR, z->parity);
+
+ SET_BUSY (z, scb);
+ return (1);
+}
+
+int nca_reselect (adapter_t *z)
+{
+ scb_t *q = 0, *prev = 0;
+ u_char msg, target_mask, lun;
+again:
+ /* Wait for a device to win the reselection phase. */
+ /* Signals this by asserting the I/O signal. */
+ if ((inb (z->CSBR) & (CSBR_SEL | CSBR_IO | CSBR_BSY)) !=
+ (CSBR_SEL | CSBR_IO))
+ return (0);
+
+ /* The data bus contains original initiator id ORed with target id. */
+ /* See that we really are the initiator. */
+ target_mask = inb (z->CSDR);
+ if (! (target_mask & z->scsi_id)) {
+ PRINT (("nca%d reselect not for me: mask=0x%x, csbr=%b\n",
+ z->sc_link.adapter_unit, target_mask,
+ inb (z->CSBR), CSBR_BITS));
+ goto again;
+ }
+
+ /* Find target who won. */
+ /* Host responds by asserting the BSY signal. */
+ /* Target should respond by deasserting the SEL signal. */
+ target_mask &= ~z->scsi_id;
+ outb (z->ICR, ICR_ASSERT_BSY);
+ WAITFOR (! (inb (z->CSBR) & CSBR_SEL), 10000, "SEL deassert");
+
+ /* Remove the busy status. */
+ /* Target should set the MSGIN phase. */
+ outb (z->ICR, 0);
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 10000, "MSGIN");
+
+ /* Hope we get an IDENTIFY message. */
+ msg = nca_msg_input (z);
+ if (MSG_ISIDENT (msg)) {
+ /* Find the command corresponding to the I_T_L or I_T_L_Q
+ * nexus we just restablished, and remove it from
+ * the disconnected queue. */
+ lun = (msg & 7);
+ for (q=z->disconnected_queue; q; prev=q, q=q->next) {
+ if (target_mask != (1 << q->xfer->sc_link->target))
+ continue;
+ if (lun != q->xfer->sc_link->lun)
+ continue;
+ if (prev)
+ prev->next = q->next;
+ else
+ z->disconnected_queue = q->next;
+ q->next = 0;
+ PRINT (("nca%d/%d/%d reselect done\n",
+ z->sc_link.adapter_unit,
+ ffs (target_mask) - 1, lun));
+ nca_information_transfer (z, q);
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "reselect !busy");
+ return (1);
+ }
+ } else
+ printf ("nca%d reselect: expecting IDENTIFY, got 0x%x\n",
+ z->sc_link.adapter_unit, msg);
+
+ /* Since we have an established nexus that we can't
+ * do anything with, we must abort it. */
+ nca_send_abort (z);
+ PRINT (("nca%d reselect aborted\n", z->sc_link.adapter_unit));
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "reselect abort !busy");
+ goto again;
+}
+
+/*
+ * Send an abort to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int nca_abort (adapter_t *z, scb_t *scb)
+{
+ scb_t *q, **prev;
+
+ /* If the command hasn't been issued yet, we simply remove it
+ * from the issue queue. */
+ prev = &z->queue;
+ for (q=z->queue; q; q=q->next) {
+ if (scb == q) {
+ (*prev) = q->next;
+ q->next = 0;
+ return (1);
+ }
+ prev = &q->next;
+ }
+
+ /* If the command is currently disconnected from the bus,
+ * we reconnect the I_T_L or I_T_L_Q nexus associated with it,
+ * go into message out, and send an abort message. */
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb != q)
+ continue;
+
+ if (! nca_select (z, scb))
+ return (0);
+ nca_send_abort (z);
+
+ prev = &z->disconnected_queue;
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb == q) {
+ *prev = q->next;
+ q->next = 0;
+ /* Set some type of error result
+ * for the operation. */
+ return (1);
+ }
+ prev = &q->next;
+ }
+ }
+
+ /* Command not found in any queue. */
+ return (0);
+}
+
+/*
+ * The task accomplished, mark the i/o control block as done.
+ * Always called with interrupts disabled.
+ */
+void nca_done (adapter_t *z, scb_t *scb)
+{
+ struct scsi_xfer *xs = scb->xfer;
+
+ if (scb->flags & SCB_TIMECHK)
+ untimeout (nca_timeout, (caddr_t) scb, xs->timeout_ch);
+
+ /* How much of the buffer was not touched. */
+ xs->resid = scb->datalen;
+
+ if (scb->flags != SCB_ACTIVE && ! (xs->flags & SCSI_ERR_OK))
+ if (scb->flags & (SCB_TIMEOUT | SCB_ABORTED))
+ xs->error = XS_TIMEOUT;
+ else if (scb->flags & SCB_ERROR)
+ xs->error = XS_DRIVER_STUFFUP;
+ else if (scb->flags & SCB_TBUSY)
+ xs->error = XS_BUSY;
+ else if (scb->flags & SCB_SENSE)
+ xs->error = XS_SENSE;
+
+ xs->flags |= ITSDONE;
+
+ /* Free the control block. */
+ scb->next = z->free_scb;
+ z->free_scb = scb;
+ scb->flags = SCB_FREE;
+
+ /* If there were none, wake anybody waiting for one to come free,
+ * starting with queued entries. */
+ if (! scb->next)
+ wakeup ((caddr_t) &z->free_scb);
+
+ scsi_done (xs);
+}
+
+/*
+ * Wait for completion of command in polled mode.
+ * Always called with interrupts masked out.
+ */
+int nca_poll (adapter_t *z, scb_t *scb)
+{
+ int count;
+
+ for (count=0; count<30; ++count) {
+ DELAY (1000); /* delay for a while */
+ nca_start (z); /* retry operation */
+ if (scb->xfer->flags & ITSDONE)
+ return (1); /* all is done */
+ if (scb->flags & SCB_TIMEOUT)
+ return (0); /* no target present */
+ }
+ return (0);
+}
+
+/*
+ * Perform NCR-53C400 pseudo-dma data transfer.
+ */
+void nca_53400_dma_xfer (adapter_t *z, int read, u_char **pdata, u_long *plen)
+{
+ /* Set dma direction. */
+ outb (z->CSR, read ? CSR_TRANSFER_DIRECTION : 0);
+
+ /* Enable dma mode. */
+ outb (z->MR, MR_DMA_MODE | (read ? z->parity : 0));
+
+ /* Start dma transfer. */
+ outb (read ? z->SDIR : z->SDSR, 0);
+
+ /* Set up clock counter. */
+ outb (z->CCR, *plen/128);
+
+ for (; *plen>=128; *plen-=128, *pdata+=128) {
+ /* Wait for 53C400 host buffer ready. */
+ WAITFOR (! (inb (z->CSR) & CSR_HOST_BUF_NOT_READY), 100000, 0);
+ if (inb (z->CSR) & CSR_HOST_BUF_NOT_READY)
+ break;
+
+ /* Transfer 128 bytes of data. */
+ if (read)
+ insw (z->HBR, *pdata, 64);
+ else
+ outsw (z->HBR, *pdata, 64);
+ }
+
+ /* Wait for 5380 registers ready. */
+ WAITFOR (inb (z->CSR) & CSR_5380_ENABLE, 10000, 0);
+ if (! (inb (z->CSR) & CSR_5380_ENABLE)) {
+ /* Reset 53C400. */
+ PRINT (("nca%d: reset: pseudo-dma incomplete, csr=%b\n",
+ z->sc_link.adapter_unit, inb (z->CSR), CSR_BITS));
+ outb (z->CSR, CSR_5380_ENABLE);
+ outb (z->CSR, 0);
+ }
+
+ /* Wait for FIFO flush on write. */
+ if (! read)
+ WAITFOR (inb (z->TCR) & TCR_LAST_BYTE_SENT, 10000, "last byte");
+
+ /* Clear dma mode. */
+ outb (z->MR, z->parity);
+
+ /* Re-enable interrupts. */
+ outb (z->CSR, z->irq ? CSR_5380_INTR : 0);
+}
+
+/*
+ * Perform PAS-16 pseudo-dma data transfer.
+ */
+void nca_pas_dma_xfer (adapter_t *z, int read, u_char **pdata, u_long *plen)
+{
+ /* Enable dma mode. */
+ outb (z->MR, MR_DMA_MODE | (read ? z->parity : 0));
+
+ /* Start dma transfer. */
+ outb (read ? z->SDIR : z->SDSR, 0);
+
+ for (; *plen>=512; *plen-=512, *pdata+=512) {
+ /* Wait for pseudo-DMA request. */
+ WAITFOR (inb (z->PSTAT) & PAS16_STAT_DREQ, 10000, "pseudo-dma");
+ if (! (inb (z->PSTAT) & PAS16_STAT_DREQ))
+ break;
+
+ /* Transfer 512 bytes of data. */
+ if (read)
+ insb (z->PDATA, *pdata, 512);
+ else
+ outsb (z->PDATA, *pdata, 512);
+ }
+
+ /* Clear dma mode. */
+ outb (z->MR, z->parity);
+}
+
+/*
+ * Send data to the target.
+ */
+void nca_data_output (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ u_char *data = *pdata;
+ u_long len = *plen;
+
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ if (z->type == CTLR_NCR_53C400 && len%128 == 0)
+ /* Use NCR-53C400 pseudo-dma for data transfer. */
+ nca_53400_dma_xfer (z, 0, &data, &len);
+ else if (z->type == CTLR_PAS_16 && len%512 == 0)
+ /* Use PAS-16 pseudo-dma for data transfer. */
+ nca_pas_dma_xfer (z, 0, &data, &len);
+ else
+ for (;;) {
+ /* Check SCSI bus phase. */
+ u_char s = inb (z->CSBR) ^ (CSBR_BSY | PHASE_DATAOUT);
+ if (s & (CSBR_BSY | PHASE_MASK))
+ break;
+
+ /* Wait for REQ. */
+ if (! (s & CSBR_REQ))
+ continue;
+
+ /* Output data. */
+ outb (z->ODR, *data++);
+
+ /* Assert ACK and wait for REQ deassert,
+ * with irqs disabled. */
+ disable_intr ();
+ outb (z->ICR, ICR_ASSERT_ACK | ICR_ASSERT_DATA_BUS);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 1000, 0);
+ enable_intr ();
+
+ /* Deassert ACK. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ --len;
+ }
+ outb (z->ICR, 0);
+ PRINT (("nca (DATAOUT) send %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = data;
+}
+
+/*
+ * Receive data from the target.
+ */
+void nca_data_input (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ u_char *data = *pdata;
+ u_long len = *plen;
+
+ if (z->type == CTLR_NCR_53C400 && len%128 == 0)
+ /* Use NCR-53C400 pseudo-dma for data transfer. */
+ nca_53400_dma_xfer (z, 1, &data, &len);
+ else if (z->type == CTLR_PAS_16 && len%512 == 0)
+ /* Use PAS-16 pseudo-dma for data transfer. */
+ nca_pas_dma_xfer (z, 1, &data, &len);
+ else
+ for (;;) {
+ /* Check SCSI bus phase. */
+ u_char s = inb (z->CSBR) ^ (CSBR_BSY | PHASE_DATAIN);
+ if (s & (CSBR_BSY | PHASE_MASK))
+ break;
+
+ /* Wait for REQ. */
+ if (! (s & CSBR_REQ))
+ continue;
+
+ /* Input data. */
+ *data++ = inb (z->CSDR);
+
+ /* Assert ACK and wait for REQ deassert,
+ * with irqs disabled. */
+ disable_intr ();
+ outb (z->ICR, ICR_ASSERT_ACK);
+ WAITFOR (! (inb (z->CSBR) & CSBR_REQ), 1000, 0);
+ enable_intr ();
+
+ /* Deassert ACK. */
+ outb (z->ICR, 0);
+ --len;
+ }
+ PRINT (("nca (DATAIN) got %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = data;
+}
+
+/*
+ * Send the command to the target.
+ */
+void nca_cmd_output (adapter_t *z, u_char *cmd, int cmdlen)
+{
+ PRINT (("nca%d send command (%d bytes) ", z->sc_link.adapter_unit,
+ cmdlen));
+
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ while (cmdlen) {
+ /* Check for target disconnect. */
+ u_char sts = inb (z->CSBR);
+ if (! (sts & CSBR_BSY))
+ break;
+
+ /* Check for phase mismatch. */
+ if ((sts & PHASE_MASK) != PHASE_CMDOUT) {
+ printf ("nca: sending command: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ break;
+ }
+
+ /* Wait for REQ. */
+ if (! (sts & CSBR_REQ))
+ continue;
+
+ PRINT (("-%x", *cmd));
+ nca_sendbyte (z, *cmd++);
+ --cmdlen;
+ }
+ outb (z->ICR, 0);
+ PRINT (("\n"));
+}
+
+/*
+ * Send the message to the target.
+ */
+void nca_send_abort (adapter_t *z)
+{
+ u_char sts;
+
+ outb (z->ICR, ICR_ASSERT_ATN);
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 1000000, "abort message");
+ sts = inb (z->CSBR);
+ if (! (sts & CSBR_REQ))
+ goto ret;
+
+ /* Check for phase mismatch. */
+ if ((sts & PHASE_MASK) != PHASE_MSGOUT) {
+ printf ("nca: sending MSG_ABORT: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ goto ret;
+ }
+
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGOUT));
+ nca_sendbyte (z, MSG_ABORT);
+
+ PRINT (("nca%d send MSG_ABORT\n", z->sc_link.adapter_unit));
+ret: outb (z->ICR, 0);
+}
+
+/*
+ * Get the message from the target.
+ * Return the length of the received message.
+ */
+u_char nca_msg_input (adapter_t *z)
+{
+ u_char sts, msg;
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 1000000, "message input");
+ sts = inb (z->CSBR);
+ if (! (sts & CSBR_REQ))
+ return (MSG_ABORT);
+
+ /* Check for phase mismatch.
+ * Reached if the target decides that it has finished the transfer. */
+ if ((sts & PHASE_MASK) != PHASE_MSGIN) {
+ printf ("nca: sending message: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ return (MSG_ABORT);
+ }
+
+ /* Do actual transfer from SCSI bus to memory. */
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGIN));
+ msg = nca_recvbyte (z);
+ PRINT (("nca%d (MSG_INPUT) got 0x%x\n", z->sc_link.adapter_unit, msg));
+ return (msg);
+}
+
+/*
+ * Send request-sense op to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int nca_sense (adapter_t *z, scb_t *scb)
+{
+ u_char cmd[6], status, msg, *data;
+ u_long len;
+
+ /* Wait for target to disconnect. */
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "sense bus free");
+ if (inb (z->CSBR) & CSBR_BSY)
+ return (0);
+
+ /* Select the target again. */
+ if (! nca_select (z, scb))
+ return (0);
+
+ /* Wait for CMDOUT phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense CMDOUT");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_CMDOUT)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_CMDOUT));
+
+ /* Send command. */
+ len = sizeof (scb->xfer->sense);
+ cmd[0] = REQUEST_SENSE;
+ cmd[1] = scb->xfer->sc_link->lun << 5;
+ cmd[2] = 0;
+ cmd[3] = 0;
+ cmd[4] = len;
+ cmd[5] = 0;
+ nca_cmd_output (z, cmd, sizeof (cmd));
+
+ /* Wait for DATAIN phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense DATAIN");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_DATAIN)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_DATAIN));
+
+ data = (u_char*) &scb->xfer->sense;
+ nca_data_input (z, &data, &len);
+ PRINT (("nca%d sense %x-%x-%x-%x-%x-%x-%x-%x\n",
+ z->sc_link.adapter_unit, scb->xfer->sense.error_code,
+ scb->xfer->sense.ext.extended.segment,
+ scb->xfer->sense.ext.extended.flags,
+ scb->xfer->sense.ext.extended.info[0],
+ scb->xfer->sense.ext.extended.info[1],
+ scb->xfer->sense.ext.extended.info[2],
+ scb->xfer->sense.ext.extended.info[3],
+ scb->xfer->sense.ext.extended.extra_len));
+
+ /* Wait for STATIN phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense STATIN");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_STATIN)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_STATIN));
+
+ status = nca_recvbyte (z);
+
+ /* Wait for MSGIN phase. */
+ WAITFOR (inb (z->CSBR) & CSBR_REQ, 100000, "sense MSGIN");
+ if (! (inb (z->CSBR) & CSBR_REQ) ||
+ (inb (z->CSBR) & PHASE_MASK) != PHASE_MSGIN)
+ return (0);
+ outb (z->TCR, PHASE_TO_TCR (PHASE_MSGIN));
+
+ msg = nca_recvbyte (z);
+
+ if (status != 0 || msg != 0)
+ printf ("nca%d: bad sense status=0x%x, msg=0x%x\n",
+ z->sc_link.adapter_unit, status, msg);
+ return (1);
+}
+
+/*
+ * Do the transfer. We know we are connected. Update the flags,
+ * call nca_done when task accomplished. Dialog controlled by the target.
+ * Always called with interrupts disabled.
+ */
+void nca_information_transfer (adapter_t *z, scb_t *scb)
+{
+ u_char *data = scb->data; /* current data buffer */
+ u_long datalen = scb->datalen; /* current data transfer size */
+ register u_char sts;
+ u_char msg;
+
+ while ((sts = inb (z->CSBR)) & CSBR_BSY) {
+ /* We only have a valid SCSI phase when REQ is asserted. */
+ if (! (sts & CSBR_REQ))
+ continue;
+ if (inb (z->BSR) & BSR_PARITY_ERROR) {
+ int target = scb->xfer->sc_link->target;
+ if (++z->target[target].perrcnt <= 8)
+ printf ("nca%d/%d/%d parity error\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ if (z->target[target].perrcnt == 8)
+ printf ("nca%d/%d/%d too many parity errors, not logging any more\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ /* Clear parity error. */
+ inb (z->RPIR);
+ }
+ outb (z->TCR, PHASE_TO_TCR (sts & PHASE_MASK));
+ switch (sts & PHASE_MASK) {
+ case PHASE_DATAOUT:
+ if (datalen <= 0) {
+ printf ("nca%d/%d/%d data length underflow\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ /* send zero byte */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ nca_sendbyte (z, 0);
+ outb (z->ICR, 0);
+ break;
+ }
+ nca_data_output (z, &data, &datalen);
+ break;
+ case PHASE_DATAIN:
+ if (datalen <= 0) {
+ /* Get extra data. Some devices (e.g. CDROMs)
+ * use fixed-length blocks (e.g. 2k),
+ * even if we need less. */
+ PRINT (("@"));
+ nca_recvbyte (z);
+ break;
+ }
+ nca_data_input (z, &data, &datalen);
+ break;
+ case PHASE_CMDOUT:
+ nca_cmd_output (z, (u_char*) scb->xfer->cmd,
+ scb->xfer->cmdlen);
+ break;
+ case PHASE_STATIN:
+ scb->xfer->status = nca_recvbyte (z);
+ PRINT (("nca%d/%d/%d (STATIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ (u_char) scb->xfer->status));
+ break;
+ case PHASE_MSGOUT:
+ /* Send no-op message. */
+ outb (z->ICR, ICR_ASSERT_DATA_BUS);
+ nca_sendbyte (z, MSG_NOP);
+ outb (z->ICR, 0);
+ PRINT (("nca%d/%d/%d (MSGOUT) send NOP\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ break;
+ case PHASE_MSGIN:
+ /* Don't handle multi-byte messages here, because they
+ * should not be present here. */
+ msg = nca_recvbyte (z);
+ PRINT (("nca%d/%d/%d (MSGIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg));
+ switch (msg) {
+ case MSG_COMMAND_COMPLETE:
+ scb->data = data;
+ scb->datalen = datalen;
+ /* In the case of check-condition status,
+ * perform the request-sense op. */
+ switch (scb->xfer->status & 0x1e) {
+ case SCSI_CHECK:
+ if (nca_sense (z, scb))
+ scb->flags = SCB_SENSE;
+ break;
+ case SCSI_BUSY:
+ scb->flags = SCB_TBUSY;
+ break;
+ }
+ goto done;
+ case MSG_ABORT:
+ printf ("nca: command aborted by target\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_MESSAGE_REJECT:
+ printf ("nca: message rejected\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_DISCONNECT:
+ scb->next = z->disconnected_queue;
+ z->disconnected_queue = scb;
+ if (! z->irq && ! z->timeout_active) {
+ timeout (nca_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ PRINT (("nca%d/%d/%d disconnected\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ goto ret;
+ case MSG_SAVE_POINTERS:
+ scb->data = data;
+ scb->datalen = datalen;
+ break;
+ case MSG_RESTORE_POINTERS:
+ data = scb->data;
+ datalen = scb->datalen;
+ break;
+ default:
+ printf ("nca%d/%d/%d unknown message: 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg);
+ break;
+ }
+ break;
+ default:
+ printf ("nca: unknown phase: %b\n", sts, CSBR_BITS);
+ break;
+ }
+ }
+ printf ("nca%d/%d/%d unexpected target disconnect\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ scb->flags = SCB_ERROR;
+done:
+ CLEAR_BUSY (z, scb);
+ nca_done (z, scb);
+ret:
+ outb (z->ICR, 0);
+ outb (z->TCR, 0);
+ outb (z->SER, z->scsi_id);
+ WAITFOR (! (inb (z->CSBR) & CSBR_BSY), 100000, "xfer bus free");
+}
+#endif /* NNCA */
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 6bb4e0fa4d175..869111f5a708a 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.64 1998/12/14 19:16:17 bde Exp $
+ * $Id: npx.c,v 1.60 1998/04/19 15:39:26 bde Exp $
*/
#include "npx.h"
@@ -58,7 +58,9 @@
#include <machine/cputypes.h>
#include <machine/frame.h>
#include <machine/ipl.h>
+#ifndef SMP
#include <machine/md_var.h>
+#endif
#include <machine/pcb.h>
#include <machine/psl.h>
#ifndef SMP
@@ -84,7 +86,15 @@
#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2)
/* XXX - should be in header file. */
-ointhand2_t npxintr;
+extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
+extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
+extern int (*copyin_vector) __P((const void *udaddr, void *kaddr, size_t len));
+extern int (*copyout_vector) __P((const void *kaddr, void *udaddr, size_t len));
+
+void i586_bcopy __P((const void *from, void *to, size_t len));
+void i586_bzero __P((void *buf, size_t len));
+int i586_copyin __P((const void *udaddr, void *kaddr, size_t len));
+int i586_copyout __P((const void *kaddr, void *udaddr, size_t len));
#ifdef __GNUC__
@@ -135,17 +145,15 @@ SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint,
CTLFLAG_RD, &hw_float, 0,
"Floatingpoint instructions executed in hardware");
-#ifndef SMP
-static u_int npx0_imask = SWI_CLOCK_MASK;
-static struct gate_descriptor npx_idt_probeintr;
-static int npx_intrno;
-static volatile u_int npx_intrs_while_probing;
-static volatile u_int npx_traps_while_probing;
-#endif
+static u_int npx0_imask = SWI_CLOCK_MASK;
static bool_t npx_ex16;
static bool_t npx_exists;
+static struct gate_descriptor npx_idt_probeintr;
+static int npx_intrno;
+static volatile u_int npx_intrs_while_probing;
static bool_t npx_irq13;
+static volatile u_int npx_traps_while_probing;
#ifndef SMP
/*
@@ -240,10 +248,8 @@ static int
npxprobe1(dvp)
struct isa_device *dvp;
{
-#ifndef SMP
u_short control;
u_short status;
-#endif
/*
* Partially reset the coprocessor, if any. Some BIOS's don't reset
@@ -378,8 +384,6 @@ int
npxattach(dvp)
struct isa_device *dvp;
{
- dvp->id_ointr = npxintr;
-
/* The caller has printed "irq 13" for the npx_irq13 case. */
if (!npx_irq13) {
printf("npx%d: ", dvp->id_unit);
diff --git a/sys/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c
index 4f840619bf91b..e2b0c6557835e 100644
--- a/sys/i386/isa/pcaudio.c
+++ b/sys/i386/isa/pcaudio.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcaudio.c,v 1.44 1998/12/13 23:32:44 eivind Exp $
+ * $Id$
*/
#include "pca.h"
@@ -48,6 +48,11 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#define DSP_ULAW_NOT_WANTED
+#include <i386/isa/sound/ulaw.h>
+#define LINEAR_ALAW_NOT_WANTED
+#include <i386/isa/sound/alaw.h>
+
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -80,44 +85,6 @@ static char buffer2[BUF_SIZE];
static char buffer3[BUF_SIZE];
static char volume_table[256];
-#define DSP_ULAW_NOT_WANTED
-#include <i386/isa/snd/ulaw.h>
-
-static unsigned char alaw_linear[] = {
- 45, 214, 122, 133, 0, 255, 107, 149,
- 86, 171, 126, 129, 0, 255, 117, 138,
- 13, 246, 120, 135, 0, 255, 99, 157,
- 70, 187, 124, 131, 0, 255, 113, 142,
- 61, 198, 123, 132, 0, 255, 111, 145,
- 94, 163, 127, 128, 0, 255, 119, 136,
- 29, 230, 121, 134, 0, 255, 103, 153,
- 78, 179, 125, 130, 0, 255, 115, 140,
- 37, 222, 122, 133, 0, 255, 105, 151,
- 82, 175, 126, 129, 0, 255, 116, 139,
- 5, 254, 120, 135, 0, 255, 97, 159,
- 66, 191, 124, 131, 0, 255, 112, 143,
- 53, 206, 123, 132, 0, 255, 109, 147,
- 90, 167, 127, 128, 0, 255, 118, 137,
- 21, 238, 121, 134, 0, 255, 101, 155,
- 74, 183, 125, 130, 0, 255, 114, 141,
- 49, 210, 123, 133, 0, 255, 108, 148,
- 88, 169, 127, 129, 0, 255, 118, 138,
- 17, 242, 121, 135, 0, 255, 100, 156,
- 72, 185, 125, 131, 0, 255, 114, 142,
- 64, 194, 124, 132, 0, 255, 112, 144,
- 96, 161, 128, 128, 1, 255, 120, 136,
- 33, 226, 122, 134, 0, 255, 104, 152,
- 80, 177, 126, 130, 0, 255, 116, 140,
- 41, 218, 122, 133, 0, 255, 106, 150,
- 84, 173, 126, 129, 0, 255, 117, 139,
- 9, 250, 120, 135, 0, 255, 98, 158,
- 68, 189, 124, 131, 0, 255, 113, 143,
- 57, 202, 123, 132, 0, 255, 110, 146,
- 92, 165, 127, 128, 0, 255, 119, 137,
- 25, 234, 121, 134, 0, 255, 102, 154,
- 76, 181, 125, 130, 0, 255, 115, 141,
-};
-
#ifdef DEVFS
static void *pca_devfs_token;
static void *pcac_devfs_token;
@@ -194,7 +161,7 @@ pca_init(void)
pca_status.buf[1] = (unsigned char *)&buffer2[0];
pca_status.buf[2] = (unsigned char *)&buffer3[0];
pca_status.buffer = pca_status.buf[0];
- pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[2] = 0;
+ pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[3] = 0;
pca_status.current = 0;
pca_status.sample_rate = SAMPLE_RATE;
pca_status.scale = (pca_status.sample_rate << 8) / INTERRUPT_RATE;
@@ -563,4 +530,5 @@ static void pca_drvinit(void *unused)
SYSINIT(pcadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,pca_drvinit,NULL)
+
#endif
diff --git a/sys/i386/isa/pcf.c b/sys/i386/isa/pcf.c
index b3e11d8093e44..7b498d7e0afbc 100644
--- a/sys/i386/isa/pcf.c
+++ b/sys/i386/isa/pcf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pcf.c,v 1.5 1998/11/04 22:09:17 nsouch Exp $
+ * $Id: pcf.c,v 1.1.1.17 1998/08/29 17:04:23 son Exp $
*
*/
#include <sys/param.h>
@@ -41,7 +41,7 @@
#include <dev/iicbus/iiconf.h>
#include "iicbus_if.h"
-#define TIMEOUT 9999 /* XXX */
+#define TIMEOUT 99999 /* XXX */
/* Status bits of S1 register (read only) */
#define nBB 0x01 /* busy when low set/reset by STOP/START*/
@@ -67,15 +67,13 @@
#define SLAVE_TRANSMITTER 0x1
#define SLAVE_RECEIVER 0x2
-#define PCF_DEFAULT_ADDR 0xaa
-
struct pcf_softc {
int pcf_base; /* isa port */
- u_char pcf_addr; /* interface I2C address */
+ int pcf_count;
+ int pcf_own_address; /* own address */
int pcf_slave_mode; /* receiver or transmitter */
- int pcf_started; /* 1 if start condition sent */
device_t iicbus; /* the corresponding iicbus */
};
@@ -105,13 +103,12 @@ static int pcf_probe(device_t);
static int pcf_attach(device_t);
static void pcf_print_child(device_t, device_t);
-static int pcf_repeated_start(device_t, u_char, int);
-static int pcf_start(device_t, u_char, int);
+static int pcf_repeated_start(device_t, u_char);
+static int pcf_start(device_t, u_char);
static int pcf_stop(device_t);
-static int pcf_write(device_t, char *, int, int *, int);
-static int pcf_read(device_t, char *, int, int *, int, int);
-static ointhand2_t pcfintr;
-static int pcf_rst_card(device_t, u_char, u_char, u_char *);
+static int pcf_write(device_t, char *, int, int *);
+static int pcf_read(device_t, char *, int, int *);
+static int pcf_rst_card(device_t, u_char);
static device_method_t pcf_methods[] = {
/* device interface */
@@ -122,7 +119,6 @@ static device_method_t pcf_methods[] = {
DEVMETHOD(bus_print_child, pcf_print_child),
/* iicbus interface */
- DEVMETHOD(iicbus_callback, iicbus_null_callback),
DEVMETHOD(iicbus_repeated_start, pcf_repeated_start),
DEVMETHOD(iicbus_start, pcf_start),
DEVMETHOD(iicbus_stop, pcf_stop),
@@ -149,6 +145,7 @@ pcfprobe_isa(struct isa_device *dvp)
{
device_t pcfdev;
struct pcf_isa_softc *pcf;
+ int error;
if (npcf >= MAXPCF)
return (0);
@@ -171,6 +168,7 @@ pcfprobe_isa(struct isa_device *dvp)
if (!pcfdev)
goto error;
+end_probe:
return (1);
error:
@@ -181,7 +179,6 @@ error:
static int
pcfattach_isa(struct isa_device *isdp)
{
- isdp->id_ointr = pcfintr;
return (1); /* ok */
}
@@ -189,21 +186,16 @@ static int
pcf_probe(device_t pcfdev)
{
struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(pcfdev);
- int unit = device_get_unit(pcfdev);
-
- /* retrieve base address from isa initialization
- *
- * XXX should use ivars with isabus
- */
- pcf->pcf_base = pcfdata[unit]->pcf_base;
-
- /* reset the chip */
- pcf_rst_card(pcfdev, IIC_FASTEST, PCF_DEFAULT_ADDR, NULL);
/* XXX try do detect chipset */
device_set_desc(pcfdev, "PCF8584 I2C bus controller");
+ pcf->iicbus = iicbus_alloc_bus(pcfdev);
+
+ if (!pcf->iicbus)
+ return (EINVAL);
+
return (0);
}
@@ -211,8 +203,13 @@ static int
pcf_attach(device_t pcfdev)
{
struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(pcfdev);
+ int unit = device_get_unit(pcfdev);
- pcf->iicbus = iicbus_alloc_bus(pcfdev);
+ /* retrieve base address from isa initialization
+ *
+ * XXX should use ivars with isabus
+ */
+ pcf->pcf_base = pcfdata[unit]->pcf_base;
/* probe and attach the iicbus */
device_probe_and_attach(pcf->iicbus);
@@ -223,10 +220,8 @@ pcf_attach(device_t pcfdev)
static void
pcf_print_child(device_t bus, device_t dev)
{
- struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(bus);
-
printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), (int)pcf->pcf_addr);
+ device_get_unit(bus), iicbus_get_own_address(dev));
return;
}
@@ -296,39 +291,13 @@ static int pcf_stop(device_t pcfdev)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
- /*
- * Send STOP condition iff the START condition was previously sent.
- * STOP is sent only once even if a iicbus_stop() is called after
- * an iicbus_read()... see pcf_read(): the pcf needs to send the stop
- * before the last char is read.
- */
- if (pcf->pcf_started) {
- /* set stop condition and enable IT */
- PCF_SET_S1(pcf, PIN|ES0|ENI|STO|ACK);
-
- pcf->pcf_started = 0;
- }
+ /* set stop condition and enable IT */
+ PCF_SET_S1(pcf, PIN|ES0|ENI|STO|ACK);
return (0);
}
-
-static int pcf_noack(struct pcf_softc *pcf, int timeout)
-{
- int noack;
- int k = timeout/10;
-
- do {
- noack = PCF_GET_S1(pcf) & LRB;
- if (!noack)
- break;
- DELAY(10); /* XXX wait 10 us */
- } while (k--);
-
- return (noack);
-}
-
-static int pcf_repeated_start(device_t pcfdev, u_char slave, int timeout)
+static int pcf_repeated_start(device_t pcfdev, u_char slave)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int error = 0;
@@ -344,8 +313,8 @@ static int pcf_repeated_start(device_t pcfdev, u_char slave, int timeout)
if ((error = pcf_wait_byte(pcf)))
goto error;
- /* check for ack */
- if (pcf_noack(pcf, timeout)) {
+ /* check ACK */
+ if (PCF_GET_S1(pcf) & LRB) {
error = IIC_ENOACK;
goto error;
}
@@ -357,7 +326,7 @@ error:
return (error);
}
-static int pcf_start(device_t pcfdev, u_char slave, int timeout)
+static int pcf_start(device_t pcfdev, u_char slave)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int error = 0;
@@ -372,14 +341,12 @@ static int pcf_start(device_t pcfdev, u_char slave, int timeout)
/* START only */
PCF_SET_S1(pcf, PIN|ES0|STA|ACK);
- pcf->pcf_started = 1;
-
/* wait for address sent, polling */
if ((error = pcf_wait_byte(pcf)))
goto error;
- /* check for ACK */
- if (pcf_noack(pcf, timeout)) {
+ /* check ACK */
+ if (PCF_GET_S1(pcf) & LRB) {
error = IIC_ENOACK;
goto error;
}
@@ -391,7 +358,7 @@ error:
return (error);
}
-static void
+void
pcfintr(unit)
{
struct pcf_softc *pcf =
@@ -499,23 +466,19 @@ error:
return;
}
-static int pcf_rst_card(device_t pcfdev, u_char speed, u_char addr, u_char *oldaddr)
+static int pcf_rst_card(device_t pcfdev, u_char speed)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
-
- if (oldaddr)
- *oldaddr = pcf->pcf_addr;
+ u_char ownaddr;
/* retrieve own address from bus level */
- if (!addr)
- pcf->pcf_addr = PCF_DEFAULT_ADDR;
- else
- pcf->pcf_addr = addr;
+ if ((ownaddr = iicbus_get_own_address(pcf->iicbus)) == 0)
+ ownaddr = 0xaa;
PCF_SET_S1(pcf, PIN); /* initialize S1 */
/* own address S'O<>0 */
- PCF_SET_S0(pcf, pcf->pcf_addr >> 1);
+ PCF_SET_S0(pcf, ownaddr >> 1);
/* select clock register */
PCF_SET_S1(pcf, PIN|ES1);
@@ -546,7 +509,7 @@ static int pcf_rst_card(device_t pcfdev, u_char speed, u_char addr, u_char *olda
}
static int
-pcf_write(device_t pcfdev, char *buf, int len, int *sent, int timeout /* us */)
+pcf_write(device_t pcfdev, char *buf, int len, int *sent)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int bytes, error = 0;
@@ -560,12 +523,10 @@ pcf_write(device_t pcfdev, char *buf, int len, int *sent, int timeout /* us */)
PCF_SET_S0(pcf, *buf++);
- /* wait for the byte to be send */
if ((error = pcf_wait_byte(pcf)))
goto error;
- /* check if ack received */
- if (pcf_noack(pcf, timeout)) {
+ if (PCF_GET_S1(pcf) & LRB) {
error = IIC_ENOACK;
goto error;
}
@@ -586,8 +547,7 @@ error:
}
static int
-pcf_read(device_t pcfdev, char *buf, int len, int *read, int last,
- int delay /* us */)
+pcf_read(device_t pcfdev, char *buf, int len, int *read)
{
struct pcf_softc *pcf = DEVTOSOFTC(pcfdev);
int bytes, error = 0;
@@ -598,7 +558,7 @@ pcf_read(device_t pcfdev, char *buf, int len, int *read, int last,
/* trig the bus to get the first data byte in S0 */
if (len) {
- if (len == 1 && last)
+ if (len == 1)
/* just one byte to read */
PCF_SET_S1(pcf, ES0); /* no ack */
@@ -608,25 +568,26 @@ pcf_read(device_t pcfdev, char *buf, int len, int *read, int last,
bytes = 0;
while (len) {
- /* XXX delay needed here */
-
- /* wait for trigged byte */
if ((error = pcf_wait_byte(pcf))) {
pcf_stop(pcfdev);
goto error;
}
- if (len == 1 && last)
- /* ok, last data byte already in S0, no I2C activity
- * on next PCF_GET_S0() */
+ if (len == 1) {
+
+ /* ok, last data byte already in S0 */
pcf_stop(pcfdev);
- else if (len == 2 && last)
- /* next trigged byte with no ack */
- PCF_SET_S1(pcf, ES0);
+ *buf = PCF_GET_S0(pcf);
- /* receive byte, trig next byte */
- *buf++ = PCF_GET_S0(pcf);
+ } else {
+ if (len == 2)
+ /* next trigged byte with no ack */
+ PCF_SET_S1(pcf, ES0);
+
+ /* read last data byte, trig for next data byte */
+ *buf++ = PCF_GET_S0(pcf);
+ }
len --;
bytes ++;
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index cb557e10a468e..90758b2cf9459 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -114,19 +114,6 @@ static void vgapelinit(void); /* read initial VGA DAC palette */
static int pcvt_xmode_set(int on, struct proc *p); /* initialize for X mode */
#endif /* XSERVER && !PCVT_USL_VT_COMPAT */
-#ifdef _DEV_KBD_KBDREG_H_
-static void detect_kbd(void *arg);
-static kbd_callback_func_t pcevent;
-#endif
-
-static cn_probe_t pccnprobe;
-static cn_init_t pccninit;
-static cn_getc_t pccngetc;
-static cn_checkc_t pccncheckc;
-static cn_putc_t pccnputc;
-
-CONS_DRIVER(pc, pccnprobe, pccninit, pccngetc, pccncheckc, pccnputc);
-
static d_open_t pcopen;
static d_close_t pcclose;
static d_read_t pcread;
@@ -166,18 +153,17 @@ pcprobe(struct isa_device *dev)
#endif /* PCVT_NETBSD > 9 */
#endif /* PCVT_NETBSD > 100 */
{
-#ifdef _DEV_KBD_KBDREG_H_
- int i;
+#ifdef _I386_ISA_KBDIO_H_
+ kbdc = kbdc_open(IO_KBD);
- if (kbd == NULL) {
+ if(kbdc == NULL)
+ {
reset_keyboard = 0;
- kbd_configure(KB_CONF_PROBE_ONLY);
- i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)dev->id_unit);
- if ((i < 0) || ((kbd = kbd_get_keyboard(i)) == NULL))
- return (-1);
+ return 1;
}
+
reset_keyboard = 1; /* it's now safe to do kbd reset */
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
kbd_code_init();
@@ -185,9 +171,7 @@ pcprobe(struct isa_device *dev)
((struct isa_attach_args *)aux)->ia_iosize = 16;
return 1;
#else
-#ifdef _DEV_KBD_KBDREG_H_
- return (-1);
-#elif PCVT_NETBSD || PCVT_FREEBSD
+#if PCVT_NETBSD || PCVT_FREEBSD
return (16);
#else
return 1;
@@ -215,11 +199,6 @@ pcattach(struct isa_device *dev)
vt_coldmalloc(); /* allocate memory for screens */
-#ifdef _DEV_KBD_KBDREG_H_
- if (kbd == NULL)
- timeout(detect_kbd, (void *)dev->id_unit, hz*2);
-#endif /* _DEV_KBD_KBDREG_H_ */
-
#if PCVT_NETBSD || PCVT_FREEBSD
#if PCVT_NETBSD > 9
@@ -405,8 +384,6 @@ pcattach(struct isa_device *dev)
#else /* PCVT_NETBSD > 9 */
- dev->id_ointr = pcrint;
-
return 1;
#endif /* PCVT_NETBSD > 9 */
@@ -791,7 +768,7 @@ do_standard:
}
int
-pcmmap(Dev_t dev, vm_offset_t offset, int nprot)
+pcmmap(Dev_t dev, int offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;
@@ -862,51 +839,6 @@ pcvt_timeout(void *arg)
}
#endif
-#ifdef _DEV_KBD_KBDREG_H_
-static void
-detect_kbd(void *arg)
-{
- int unit = (int)arg;
- int i;
-
- if (kbd != NULL)
- return;
- i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)unit);
- if (i >= 0)
- kbd = kbd_get_keyboard(i);
- if (kbd != NULL)
- {
- reset_keyboard = 1; /* ok to reset the keyboard */
- kbd_code_init();
- return;
- }
- reset_keyboard = 0;
- timeout(detect_kbd, (void *)unit, hz*2);
-}
-
-int
-pcevent(keyboard_t *thiskbd, int event, void *arg)
-{
- int unit = (int)arg;
-
- if (thiskbd != kbd)
- return EINVAL; /* shouldn't happen */
-
- switch (event) {
- case KBDIO_KEYINPUT:
- pcrint(unit);
- return 0;
- case KBDIO_UNLOADING:
- reset_keyboard = 0;
- kbd = NULL;
- kbd_release(thiskbd, (void *)&kbd);
- timeout(detect_kbd, (void *)unit, hz*4);
- return 0;
- default:
- return EINVAL;
- }
-}
-#endif /* _DEV_KBD_KBDREG_H_ */
void
pcrint(int unit)
@@ -920,7 +852,7 @@ pcrint(int unit)
int s;
# endif
-# ifdef _DEV_KBD_KBDREG_H_
+# ifdef _I386_ISA_KBDIO_H_
int c;
# endif
@@ -928,6 +860,25 @@ pcrint(int unit)
u_char *cp;
#endif /* PCVT_KBD_FIFO */
+ /*
+ * in case the keyboard was not plugged in while booting, kbdc
+ * was set to NULL at that time. When a keyboard IRQ occurs and
+ * kbdc is NULL, the keyboard was probably reconnected to the
+ * keyboard controller and we have to initialize the keyboard.
+ */
+
+ if(kbdc == NULL)
+ {
+ kbdc = kbdc_open(IO_KBD);
+ if(kbdc == NULL)
+ {
+ reset_keyboard = 0;
+ return;
+ }
+ reset_keyboard = 1;
+ kbd_code_init();
+ }
+
#if PCVT_SCREENSAVER
pcvt_scrnsv_reset();
#endif /* PCVT_SCREENSAVER */
@@ -939,7 +890,7 @@ pcrint(int unit)
return;
}
-# ifndef _DEV_KBD_KBDREG_H_
+# ifndef _I386_ISA_KBDIO_H_
while (inb(CONTROLLER_CTRL) & STATUS_OUTPBF) /* check 8042 buffer */
{
ret = 1; /* got something */
@@ -948,11 +899,11 @@ pcrint(int unit)
dt = inb(CONTROLLER_DATA); /* get it 8042 data */
# else
- while ((c = (*kbdsw[kbd->kb_index]->read)(kbd, FALSE)) != -1)
+ while ((c = read_kbd_data_no_wait(kbdc)) != -1)
{
ret = 1; /* got something */
dt = c;
-# endif /* _DEV_KBD_KBDREG_H_ */
+# endif /* _I386_ISA_KBDIO_H_ */
if (pcvt_kbd_count >= PCVT_KBD_FIFO_SZ) /* fifo overflow ? */
{
@@ -1163,47 +1114,39 @@ consinit() /* init for kernel messages during boot */
#endif /* PCVT_NETBSD */
#if PCVT_FREEBSD > 205
-static void
+void
#else
int
#endif
pccnprobe(struct consdev *cp)
{
struct isa_device *dvp;
- int i;
- /*
- * Take control if we are the highest priority enabled display device.
- */
- dvp = find_display();
- if (dvp == NULL || dvp->id_driver != &vtdriver) {
- cp->cn_pri = CN_DEAD;
- return;
- }
-
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
+ kbdc = kbdc_open(IO_KBD);
/*
* Don't reset the keyboard via `kbdio' just yet.
* The system clock has not been calibrated...
*/
reset_keyboard = 0;
- if (kbd == NULL) {
- kbd_configure(KB_CONF_PROBE_ONLY);
- i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)dvp->id_unit);
- if (i >= 0)
- kbd = kbd_get_keyboard(i);
- }
-
#if PCVT_SCANSET == 2
/*
* Turn off scancode translation early so that UserConfig
* and DDB can read the keyboard.
*/
- empty_both_buffers(*(KBDC *)kbd->kb_data, 10);
- set_controller_command_byte(*(KBDC *)kbd->kb_data, KBD_TRANSLATION, 0);
+ empty_both_buffers(kbdc, 10);
+ set_controller_command_byte(kbdc, KBD_TRANSLATION, 0);
#endif /* PCVT_SCANSET == 2 */
+#endif /* _I386_ISA_KBDIO_H_ */
-#endif /* _DEV_KBD_KBDREG_H_ */
+ /*
+ * Take control if we are the highest priority enabled display device.
+ */
+ dvp = find_display();
+ if (dvp == NULL || dvp->id_driver != &vtdriver) {
+ cp->cn_pri = CN_DEAD;
+ return;
+ }
/* initialize required fields */
@@ -1226,7 +1169,7 @@ pccnprobe(struct consdev *cp)
}
#if PCVT_FREEBSD > 205
-static void
+void
#else
int
#endif
@@ -1239,7 +1182,7 @@ pccninit(struct consdev *cp)
}
#if PCVT_FREEBSD > 205
-static void
+void
#else
int
#endif
@@ -1273,7 +1216,7 @@ pccnputc(Dev_t dev, U_char c)
#endif
}
-static int
+int
pccngetc(Dev_t dev)
{
register int s;
@@ -1301,13 +1244,7 @@ pccngetc(Dev_t dev)
s = spltty(); /* block pcrint while we poll */
kbd_polling = 1;
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->enable)(kbd);
-#endif
cp = sgetc(0);
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->disable)(kbd);
-#endif
kbd_polling = 0;
splx(s);
c = *cp++;
@@ -1328,19 +1265,13 @@ pccngetc(Dev_t dev)
}
#if PCVT_FREEBSD >= 200
-static int
+int
pccncheckc(Dev_t dev)
{
char *cp;
int x = spltty();
kbd_polling = 1;
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->enable)(kbd);
-#endif
cp = sgetc(1);
-#ifdef _DEV_KBD_KBDREG_H_
- (*kbdsw[kbd->kb_index]->disable)(kbd);
-#endif
kbd_polling = 0;
splx(x);
return (cp == NULL ? -1 : *cp);
@@ -1579,7 +1510,7 @@ pcvt_xmode_set(int on, struct proc *p)
vsp->Crtat = vsp->Memory; /* operate in memory now */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#if PCVT_SCANSET == 2
/* put keyboard to return ancient PC scan codes */
@@ -1593,15 +1524,15 @@ pcvt_xmode_set(int on, struct proc *p)
#endif /* PCVT_USEKBDSEC */
#endif /* PCVT_SCANSET == 2 */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_SCANSET == 2
/* put keyboard to return ancient PC scan codes */
- set_controller_command_byte(*(KBDC *)kbd->kb_data,
+ set_controller_command_byte(kbdc,
KBD_TRANSLATION, KBD_TRANSLATION);
#endif /* PCVT_SCANSET == 2 */
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_NETBSD > 9
fp->tf_eflags |= PSL_IOPL;
@@ -1638,7 +1569,7 @@ pcvt_xmode_set(int on, struct proc *p)
pcvt_set_scrnsv_tmo(saved_scrnsv_tmo);
#endif /* PCVT_SCREENSAVER */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#if PCVT_SCANSET == 2
kbc_8042cmd(CONTR_WRITE);
@@ -1651,14 +1582,13 @@ pcvt_xmode_set(int on, struct proc *p)
#endif /* PCVT_USEKBDSEC */
#endif /* PCVT_SCANSET == 2 */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_SCANSET == 2
- set_controller_command_byte(*(KBDC *)kbd->kb_data,
- KBD_TRANSLATION, 0);
+ set_controller_command_byte(kbdc, KBD_TRANSLATION, 0);
#endif /* PCVT_SCANSET == 2 */
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
if(adaptor_type == MDA_ADAPTOR)
{
diff --git a/sys/i386/isa/pcvt/pcvt_hdr.h b/sys/i386/isa/pcvt/pcvt_hdr.h
index 2c9aac8a29c53..70c28919f4385 100644
--- a/sys/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/i386/isa/pcvt/pcvt_hdr.h
@@ -107,9 +107,7 @@
#endif /* PCVT_FREEBSD >= 200 */
#include <i386/isa/pcvt/pcvt_conf.h>
-
-#include <dev/kbd/kbdreg.h>
-#include <dev/kbd/atkbdcreg.h>
+#include <i386/isa/kbdio.h>
#if PCVT_NETBSD > 9
#include "device.h"
@@ -170,14 +168,6 @@
#include <machine/clock.h>
#include <machine/md_var.h>
#endif
-/*
- * The following values are defined in machine/console.h, but the header
- * file is not included here due to conflicts with pcvt_ioctl.h.
- */
-#define KDGKBTYPE _IOR('K', 64, int)
-#define KB_84 1
-#define KB_101 2
-#define KB_OTHER 3
#else /* PCVT_FREEBSD >= 200 */
#include "machine/pc/display.h"
#endif /* PCVT_FREEBSD >= 200 */
@@ -270,7 +260,7 @@ in the config file"
* Keyboard and Keyboard Controller
*---------------------------------------------------------------------------*/
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#define CONTROLLER_CTRL 0x64 /* W - command, R - status */
#define CONTROLLER_DATA 0x60 /* R/W - data */
@@ -318,7 +308,7 @@ in the config file"
#define KEYB_C_ECHO 0xee /* diagnostic, echo 0xee */
#define KEYB_C_LEDS 0xed /* set/reset numlock,capslock & scroll lock */
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
/* responses from the KEYBOARD (via the 8042 controller on mainboard..) */
@@ -1010,10 +1000,10 @@ u_char chargen_access = 0; /* synchronize access */
u_char keyboard_type = KB_UNKNOWN; /* type of keyboard */
u_char keyboard_is_initialized = 0; /* for ddb sanity */
u_char kbd_polling = 0; /* keyboard is being polled */
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
u_char reset_keyboard = 0; /* OK to reset keyboard */
-keyboard_t *kbd = NULL;
-#endif /* _DEV_KBD_KBDREG_H_ */
+KBDC kbdc = NULL; /* keyboard controller */
+#endif /* _I386_ISA_KBDIO_H_ */
#if PCVT_SHOWKEYS
u_char keyboard_show = 0; /* normal display */
@@ -1151,10 +1141,10 @@ extern u_char can_do_132col;
extern u_char vga_family;
extern u_char keyboard_is_initialized;
extern u_char kbd_polling;
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
extern u_char reset_keyboard;
-extern keyboard_t *kbd;
-#endif /* _DEV_KBD_KBDREG_H_ */
+extern KBDC kbdc;
+#endif /* _I386_ISA_KBDIO_H_ */
#if PCVT_SHOWKEYS
extern u_char keyboard_show;
@@ -1233,7 +1223,6 @@ int pccncheckc ( Dev_t dev );
int pccnputc ( Dev_t dev, U_char c );
#endif
-ointhand2_t pcrint;
void pcstart ( struct tty *tp );
void pcstop ( struct tty *tp, int flag );
@@ -1278,10 +1267,10 @@ void fkl_on ( struct video_state *svsp );
struct tty *get_pccons ( Dev_t dev );
void init_sfkl ( struct video_state *svsp );
void init_ufkl ( struct video_state *svsp );
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
int kbd_cmd ( int val );
int kbd_response ( void );
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
void kbd_code_init ( void );
void kbd_code_init1 ( void );
diff --git a/sys/i386/isa/pcvt/pcvt_kbd.c b/sys/i386/isa/pcvt/pcvt_kbd.c
index 50457dc16b5d7..579c1a23abb5b 100644
--- a/sys/i386/isa/pcvt/pcvt_kbd.c
+++ b/sys/i386/isa/pcvt/pcvt_kbd.c
@@ -91,9 +91,11 @@ static void doreset ( void );
static void ovlinit ( int force );
static void settpmrate ( int rate );
static void setlockkeys ( int snc );
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
static int kbc_8042cmd ( int val );
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#else
+static int set_keyboard_param( int command, int data );
+#endif /* !_I386_ISA_KBDIO_H_ */
static int getokeydef ( unsigned key, struct kbd_ovlkey *thisdef );
static int getckeydef ( unsigned key, struct kbd_ovlkey *thisdef );
static int rmkeydef ( int key );
@@ -168,7 +170,7 @@ do_vgapage(int page)
#define PCVT_UPDLED_LOSES_INTR 0 /* disabled for now */
-#if PCVT_UPDLED_LOSES_INTR || defined(_DEV_KBD_KBDREG_H_)
+#if PCVT_UPDLED_LOSES_INTR || defined(_I386_ISA_KBDIO_H_)
/*---------------------------------------------------------------------------*
* check for lost keyboard interrupts
@@ -201,7 +203,7 @@ static struct callout_handle lost_intr_ch =
static void
check_for_lost_intr (void *arg)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
lost_intr_timeout_queued = 0;
if (inb(CONTROLLER_CTRL) & STATUS_OUTPBF)
{
@@ -213,20 +215,19 @@ check_for_lost_intr (void *arg)
int opri;
lost_intr_timeout_queued = 0;
- if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) {
+ if (kbdc_lock(kbdc, TRUE)) {
opri = spltty ();
- (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE);
- if ((*kbdsw[kbd->kb_index]->check)(kbd))
+ kbdc_lock(kbdc, FALSE);
+ if (kbdc_data_ready(kbdc))
pcrint (0);
splx (opri);
}
-
lost_intr_ch = timeout(check_for_lost_intr, (void *)NULL, hz);
lost_intr_timeout_queued = 1;
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
-#endif /* PCVT_UPDLED_LOSES_INTR || defined(_DEV_KBD_KBDREG_H_) */
+#endif /* PCVT_UPDLED_LOSES_INTR || defined(_I386_ISA_KBDIO_H_) */
/*---------------------------------------------------------------------------*
* update keyboard led's
@@ -238,23 +239,16 @@ update_led(void)
/* Don't update LED's unless necessary. */
- int opri, new_ledstate;
+ int opri, new_ledstate, response1, response2;
opri = spltty();
-#ifndef _DEV_KBD_KBDREG_H_
new_ledstate = (vsp->scroll_lock) |
(vsp->num_lock * 2) |
(vsp->caps_lock * 4);
-#else
- new_ledstate = ((vsp->scroll_lock) ? LED_SCR : 0) |
- ((vsp->num_lock) ? LED_NUM : 0) |
- ((vsp->caps_lock) ? LED_CAP : 0);
-#endif /* _DEV_KBD_KBDREG_H_ */
if (new_ledstate != ledstate)
{
-#ifndef _DEV_KBD_KBDREG_H_
- int response1, response2;
+#ifndef _I386_ISA_KBDIO_H_
ledstate = LEDSTATE_UPDATE_PENDING;
@@ -301,20 +295,19 @@ update_led(void)
printf(
"Keyboard LED command not ACKed (responses %#x %#x)\n",
response1, response2);
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
- if (kbd == NULL) {
+ if (kbdc == NULL) {
ledstate = new_ledstate;
splx(opri);
} else {
ledstate = LEDSTATE_UPDATE_PENDING;
splx(opri);
- if ((*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED,
- (caddr_t)&new_ledstate) == 0)
+ if (set_keyboard_param(KBDC_SET_LEDS, new_ledstate) == 0)
ledstate = new_ledstate;
}
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_UPDLED_LOSES_INTR
if (lost_intr_timeout_queued)
@@ -326,7 +319,7 @@ update_led(void)
}
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
splx(opri);
#endif
@@ -339,22 +332,20 @@ update_led(void)
static void
settpmrate(int rate)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
tpmrate = rate & 0x7f;
if(kbd_cmd(KEYB_C_TYPEM) != 0)
printf("Keyboard TYPEMATIC command timeout\n");
else if(kbd_cmd(tpmrate) != 0)
printf("Keyboard TYPEMATIC data timeout\n");
#else
- if (kbd == NULL)
- return;
tpmrate = rate & 0x7f;
- if ((*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETRAD, (caddr_t)&tpmrate))
+ if (set_keyboard_param(KBDC_SET_TYPEMATIC, tpmrate) != 0)
printf("pcvt: failed to set keyboard TYPEMATIC.\n");
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
/*---------------------------------------------------------------------------*
* Pass command to keyboard controller (8042)
*---------------------------------------------------------------------------*/
@@ -416,7 +407,62 @@ kbd_response(void)
return ch;
}
-#endif /* _DEV_KBD_KBDREG_H_ */
+#else
+static int
+set_keyboard_param(int command, int data)
+{
+ int s;
+ int c;
+
+ if (kbdc == NULL)
+ return 1;
+
+ /* prevent the timeout routine from polling the keyboard */
+ if (!kbdc_lock(kbdc, TRUE))
+ return 1;
+
+ /* disable the keyboard and mouse interrupt */
+ s = spltty();
+#if 0
+ c = get_controller_command_byte(kbdc);
+ if ((c == -1)
+ || !set_controller_command_byte(kbdc,
+ kbdc_get_device_mask(kbdc),
+ KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
+ | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
+ /* CONTROLLER ERROR */
+ kbdc_lock(kbdc, FALSE);
+ splx(s);
+ return 1;
+ }
+ /*
+ * Now that the keyboard controller is told not to generate
+ * the keyboard and mouse interrupts, call `splx()' to allow
+ * the other tty interrupts. The clock interrupt may also occur,
+ * but the timeout routine (`scrn_timer()') will be blocked
+ * by the lock flag set via `kbdc_lock()'
+ */
+ splx(s);
+#endif
+
+ if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK)
+ send_kbd_command(kbdc, KBDC_ENABLE_KBD);
+
+#if 0
+ /* restore the interrupts */
+ if (!set_controller_command_byte(kbdc,
+ kbdc_get_device_mask(kbdc),
+ c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
+ /* CONTROLLER ERROR */
+ }
+#else
+ splx(s);
+#endif
+ kbdc_lock(kbdc, FALSE);
+
+ return 0;
+}
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_SCANSET > 1
/*---------------------------------------------------------------------------*
@@ -425,7 +471,7 @@ kbd_response(void)
void
kbd_emulate_pc(int do_emulation)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
int cmd, timeo = 10000;
cmd = COMMAND_SYSFLG|COMMAND_IRQEN; /* common base cmd */
@@ -443,9 +489,9 @@ kbd_emulate_pc(int do_emulation)
break;
outb(CONTROLLER_DATA, cmd);
#else
- set_controller_command_byte(*(KBDC *)kbd->kb_data, KBD_TRANSLATION,
+ set_controller_command_byte(kbdc, KBD_TRANSLATION,
(do_emulation) ? KBD_TRANSLATION : 0);
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
#endif /* PCVT_SCANSET > 1 */
@@ -461,7 +507,7 @@ kbd_emulate_pc(int do_emulation)
static
void doreset(void)
{
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
int again = 0;
int once = 0;
int response, opri;
@@ -622,8 +668,10 @@ r_entry:
#endif /* PCVT_KEYBDID */
-#else /* _DEV_KBD_KBDREG_H_ */
- int type;
+#else /* _I386_ISA_KBDIO_H_ */
+ int c;
+ int m;
+ int s;
if (!reset_keyboard) /* no, we are not ready to reset */
return;
@@ -633,11 +681,29 @@ r_entry:
lost_intr_timeout_queued = 0;
}
- if (kbd == NULL)
- return; /* shouldn't happen */
- (*kbdsw[kbd->kb_index]->init)(kbd);
+ if (kbdc == NULL)
+ kbdc = kbdc_open(IO_KBD);
- ledstate = LEDSTATE_UPDATE_PENDING;
+ if (!kbdc_lock(kbdc, TRUE)) /* strange, somebody got there first */
+ return;
+
+ /* remove any noise */
+ empty_both_buffers(kbdc, 10);
+
+ s = spltty();
+
+ /* save the current controller command byte */
+ m = kbdc_get_device_mask(kbdc) & ~KBD_KBD_CONTROL_BITS;
+ c = get_controller_command_byte(kbdc);
+ if (c == -1) {
+ /* CONTROLLER ERROR */
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ splx(s);
+ printf("pcvt: unable to get the command byte.\n");
+ return;
+ }
#if PCVT_USEKBDSEC /* security enabled */
@@ -657,33 +723,105 @@ r_entry:
#endif /* PCVT_USEKBDSEC */
- set_controller_command_byte(*(KBDC *)kbd->kb_data,
- KBD_OVERRIDE_KBD_LOCK | KBD_TRANSLATION, KBDINITCMD);
-
- keyboard_type = KB_MFII; /* force it .. */
+ /* disable the keyboard interrupt and the aux port and interrupt */
+ if (!set_controller_command_byte(kbdc,
+ KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
+ KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT | KBDINITCMD)) {
+ /* CONTROLLER ERROR: there is very little we can do... */
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ splx(s);
+ printf("pcvt: unable to set the command byte.\n");
+ return;
+ }
+ splx(s);
+
+ /* reset keyboard hardware */
+ ledstate = LEDSTATE_UPDATE_PENDING;
+ if (!reset_kbd(kbdc)) {
+ /* KEYBOARD ERROR */
+ empty_both_buffers(kbdc, 10);
+ test_controller(kbdc);
+ test_kbd_port(kbdc);
+ /*
+ * We could disable the keyboard port and interrupt now...
+ * but, the keyboard may still exist.
+ */
+ printf("pcvt: failed to reset the keyboard.\n");
+ /* try to restore the original command byte */
+ set_controller_command_byte(kbdc, 0xff, c);
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ return;
+ }
+
#if PCVT_KEYBDID
- type = KB_101;
- (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDGKBTYPE, (caddr_t)&type);
- switch (type)
- {
- case KB_84:
- keyboard_type = KB_AT;
- break;
- case KB_101:
- keyboard_type = KB_MFII;
- break;
- default:
- keyboard_type = KB_UNKNOWN;
- break;
+
+ keyboard_type = KB_UNKNOWN;
+ if (send_kbd_command(kbdc, KBDC_SEND_DEV_ID) == KBD_ACK) {
+ DELAY(10000); /* 10msec delay */
+ switch (read_kbd_data(kbdc)) {
+ case KEYB_R_MF2ID1:
+ switch (read_kbd_data(kbdc)) {
+ case KEYB_R_MF2ID2:
+ case KEYB_R_MF2ID2HP:
+ keyboard_type = KB_MFII;
+ break;
+ case -1:
+ default:
+ break;
+ }
+ break;
+ case -1:
+ keyboard_type = KB_AT;
+ /* fall through */
+ default:
+ /* XXX: should we read the second byte? */
+ empty_both_buffers(kbdc, 10); /* XXX */
+ break;
+ }
+ } else {
+ /*
+ * The send ID command failed. This error is considered
+ * benign, but may need recovery.
+ */
+ empty_both_buffers(kbdc, 10);
+ test_controller(kbdc);
+ test_kbd_port(kbdc);
}
+
+#else /* PCVT_KEYBDID */
+
+ keyboard_type = KB_MFII; /* force it .. */
+
#endif /* PCVT_KEYBDID */
+ /* enable the keyboard port and intr. */
+ if (!set_controller_command_byte(kbdc,
+ KBD_KBD_CONTROL_BITS,
+ KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * This is serious; we are left with the disabled
+ * keyboard intr.
+ */
+ printf("pcvt: failed to enable the keyboard port and intr.\n");
+ kbdc_set_device_mask(kbdc, m);
+ kbdc_lock(kbdc, FALSE);
+ kbdc = NULL;
+ return;
+ }
+
+ kbdc_set_device_mask(kbdc, m | KBD_KBD_CONTROL_BITS);
+ kbdc_lock(kbdc, FALSE);
+
update_led();
lost_intr_ch = timeout(check_for_lost_intr, (void *)NULL, hz);
lost_intr_timeout_queued = 1;
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
}
/*---------------------------------------------------------------------------*
@@ -1105,15 +1243,15 @@ sgetc(int noblock)
static char keybuf[2] = {0}; /* the second 0 is a delimiter! */
#endif /* XSERVER */
-#ifdef _DEV_KBD_KBDREG_H_
+#ifdef _I386_ISA_KBDIO_H_
int c;
-#endif /* _DEV_KBD_KBDREG_H_ */
+#endif /* _I386_ISA_KBDIO_H_ */
loop:
#ifdef XSERVER
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
#if PCVT_KBD_FIFO
@@ -1148,7 +1286,7 @@ loop:
#endif /* !PCVT_KBD_FIFO */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_KBD_FIFO
if (pcvt_kbd_count) {
@@ -1161,18 +1299,18 @@ loop:
} else
#endif /* PCVT_KBD_FIFO */
if (!noblock) {
- while ((c = (*kbdsw[kbd->kb_index]->read)(kbd, TRUE)) == -1)
+ while ((c = read_kbd_data(kbdc)) == -1)
;
dt = c;
} else {
- if ((c = (*kbdsw[kbd->kb_index]->read)(kbd, FALSE)) == -1)
+ if ((c = read_kbd_data_no_wait(kbdc)) == -1)
return NULL;
dt = c;
}
{
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
/*
* If x mode is active, only care for locking keys, then
@@ -1450,7 +1588,7 @@ no_mouse_event:
#else /* !XSERVER */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
# if PCVT_KBD_FIFO
@@ -1487,7 +1625,7 @@ no_mouse_event:
#endif /* !PCVT_KBD_FIFO */
-#else /* _DEV_KBD_KBDREG_H_ */
+#else /* _I386_ISA_KBDIO_H_ */
#if PCVT_KBD_FIFO
if (pcvt_kbd_count) {
@@ -1500,20 +1638,20 @@ no_mouse_event:
} else
#endif /* PCVT_KBD_FIFO */
if (!noblock) {
- while ((c = (*kbdsw[kbd->kb_index]->read)(kbd, TRUE)) == -1)
+ while ((c = read_kbd_data(kbdc)) == -1)
;
dt = c;
} else {
- if ((c = (*kbdsw[kbd->kb_index]->read)(kbd, FALSE)) == -1)
+ if ((c = read_kbd_data_no_wait(kbdc)) == -1)
return NULL;
dt = c;
}
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#endif /* !XSERVER */
-#ifndef _DEV_KBD_KBDREG_H_
+#ifndef _I386_ISA_KBDIO_H_
else
{
if(noblock)
@@ -1521,7 +1659,7 @@ no_mouse_event:
else
goto loop;
}
-#endif /* !_DEV_KBD_KBDREG_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
#if PCVT_SHOWKEYS
showkey (' ', dt);
diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c
index de7f938840e8a..3b0019103258d 100644
--- a/sys/i386/isa/pcvt/pcvt_sup.c
+++ b/sys/i386/isa/pcvt/pcvt_sup.c
@@ -261,7 +261,7 @@ vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag)
static void
vgapcvtid(struct pcvtid *data)
{
- snprintf(data->name, sizeof(data->name), "%s", PCVTIDNAME);
+ strcpy(data->name, PCVTIDNAME);
data->rmajor = PCVTIDMAJOR;
data->rminor = PCVTIDMINOR;
}
diff --git a/sys/i386/isa/pnp.c b/sys/i386/isa/pnp.c
index a3635cb2449d7..9b4bb55633742 100644
--- a/sys/i386/isa/pnp.c
+++ b/sys/i386/isa/pnp.c
@@ -23,12 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pnp.c,v 1.8 1998/11/21 01:54:50 archie Exp $
+ * $Id: pnp.c,v 1.5 1998/02/09 06:08:38 eivind Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h> /* for DATA_SET */
#include <sys/malloc.h>
#include <sys/interrupt.h>
#include <machine/clock.h>
@@ -373,9 +373,9 @@ config_pnp_device(pnp_id *p, int csn)
/* these are for autoconfigure a-la pci */
struct pnp_device *dvp, **dvpp;
- char *name = NULL;
+ char *name ;
- printf("CSN %d Vendor ID: %c%c%c%02x%02x [0x%08lx] Serial 0x%08lx Comp ID: %c%c%c%02x%02x [0x%08lx]\n",
+ printf("CSN %d Vendor ID: %c%c%c%02x%02x [0x%08x] Serial 0x%08x Comp ID: %c%c%c%02x%02x [0x%08x]\n",
csn,
((data[0] & 0x7c) >> 2) + '@',
(((data[0] & 0x03) << 3) | ((data[1] & 0xe0) >> 5)) + '@',
@@ -456,7 +456,7 @@ config_pnp_device(pnp_id *p, int csn)
nod->dev.id_driver->name ? nod->dev.id_driver->name : "unknown",
unit, dvp->pd_name, name, p->serial);
if (nod->dev.id_alive) {
- if (nod->dev.id_irq != 0 && nod->dev.id_intr != NULL) {
+ if (nod->dev.id_irq) {
/* the board uses interrupts. Register it. */
if (dvp->imask)
INTRMASK( *(dvp->imask), nod->dev.id_irq );
@@ -533,7 +533,7 @@ pnp_scan_resdata(pnp_id *p, int csn)
bcopy(resinfo, &p->comp_id, 4);
retval = TRUE;
if (bootverbose)
- printf("PnP: CSN %d COMP_DEVICE_ID = 0x%08lx\n", csn, p->comp_id);
+ printf("PnP: CSN %d COMP_DEVICE_ID = 0x%08x\n", csn, p->comp_id);
}
/*
* We found what we were looking for, or got an error from
diff --git a/sys/i386/isa/ppc.c b/sys/i386/isa/ppc.c
index bd6249b33a711..4dc6a44178d21 100644
--- a/sys/i386/isa/ppc.c
+++ b/sys/i386/isa/ppc.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppc.c,v 1.14 1999/01/10 12:04:53 nsouch Exp $
+ * $Id: ppc.c,v 1.8 1998/09/13 20:57:06 nsouch Exp $
*
*/
#include "ppc.h"
@@ -49,11 +49,6 @@
#include <i386/isa/ppcreg.h>
-#include "opt_ppc.h"
-
-#define LOG_PPC(function, ppc, string) \
- if (bootverbose) printf("%s: %s\n", function, string)
-
static int ppcprobe(struct isa_device *);
static int ppcattach(struct isa_device *);
@@ -66,7 +61,7 @@ static int nppc = 0;
static char *ppc_types[] = {
"SMC-like", "SMC FDC37C665GT", "SMC FDC37C666GT", "PC87332", "PC87306",
- "82091AA", "Generic", "W83877F", "W83877AF", "Winbond", "PC87334", 0
+ "82091AA", "Generic", "W83877F", "W83877AF", "Winbond", 0
};
/* list of available modes */
@@ -113,12 +108,12 @@ static void ppc_insw_epp(int unit, char *addr, int cnt) {
static void ppc_insl_epp(int unit, char *addr, int cnt) {
insl(ppcdata[unit]->ppc_base + PPC_EPP_DATA, addr, cnt); }
-static u_char ppc_rdtr(int unit) { return r_dtr(ppcdata[unit]); }
-static u_char ppc_rstr(int unit) { return r_str(ppcdata[unit]); }
-static u_char ppc_rctr(int unit) { return r_ctr(ppcdata[unit]); }
-static u_char ppc_repp(int unit) { return r_epp(ppcdata[unit]); }
-static u_char ppc_recr(int unit) { return r_ecr(ppcdata[unit]); }
-static u_char ppc_rfifo(int unit) { return r_fifo(ppcdata[unit]); }
+static char ppc_rdtr(int unit) { return r_dtr(ppcdata[unit]); }
+static char ppc_rstr(int unit) { return r_str(ppcdata[unit]); }
+static char ppc_rctr(int unit) { return r_ctr(ppcdata[unit]); }
+static char ppc_repp(int unit) { return r_epp(ppcdata[unit]); }
+static char ppc_recr(int unit) { return r_ecr(ppcdata[unit]); }
+static char ppc_rfifo(int unit) { return r_fifo(ppcdata[unit]); }
static void ppc_wdtr(int unit, char byte) { w_dtr(ppcdata[unit], byte); }
static void ppc_wstr(int unit, char byte) { w_str(ppcdata[unit], byte); }
@@ -129,15 +124,11 @@ static void ppc_wfifo(int unit, char byte) { w_fifo(ppcdata[unit], byte); }
static void ppc_reset_epp_timeout(int);
static void ppc_ecp_sync(int);
-static ointhand2_t ppcintr;
static int ppc_exec_microseq(int, struct ppb_microseq **);
static int ppc_generic_setmode(int, int);
static int ppc_smclike_setmode(int, int);
-static int ppc_read(int, char *, int, int);
-static int ppc_write(int, char *, int, int);
-
static struct ppb_adapter ppc_smclike_adapter = {
0, /* no intr handler, filled by chipset dependent code */
@@ -146,7 +137,7 @@ static struct ppb_adapter ppc_smclike_adapter = {
ppc_exec_microseq,
- ppc_smclike_setmode, ppc_read, ppc_write,
+ ppc_smclike_setmode,
ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
@@ -163,7 +154,7 @@ static struct ppb_adapter ppc_generic_adapter = {
ppc_exec_microseq,
- ppc_generic_setmode, ppc_read, ppc_write,
+ ppc_generic_setmode,
ppc_outsb_epp, ppc_outsw_epp, ppc_outsl_epp,
ppc_insb_epp, ppc_insw_epp, ppc_insl_epp,
@@ -181,11 +172,8 @@ ppc_ecp_sync(int unit) {
struct ppc_data *ppc = ppcdata[unit];
int i, r;
- if (!(ppc->ppc_avm & PPB_ECP))
- return;
-
r = r_ecr(ppc);
- if ((r & 0xe0) != PPC_ECR_EPP)
+ if ((r & 0xe0) != 0x80)
return;
for (i = 0; i < 100; i++) {
@@ -201,115 +189,13 @@ ppc_ecp_sync(int unit) {
return;
}
-/*
- * ppc_detect_fifo()
- *
- * Detect parallel port FIFO
- */
-static int
-ppc_detect_fifo(struct ppc_data *ppc)
+void
+ppcintr(int unit)
{
- char ecr_sav;
- char ctr_sav, ctr, cc;
- short i;
-
- /* save registers */
- ecr_sav = r_ecr(ppc);
- ctr_sav = r_ctr(ppc);
-
- /* enter ECP configuration mode, no interrupt, no DMA */
- w_ecr(ppc, 0xf4);
-
- /* read PWord size - transfers in FIFO mode must be PWord aligned */
- ppc->ppc_pword = (r_cnfgA(ppc) & PPC_PWORD_MASK);
-
- /* XXX 16 and 32 bits implementations not supported */
- if (ppc->ppc_pword != PPC_PWORD_8) {
- LOG_PPC(__FUNCTION__, ppc, "PWord not supported");
- goto error;
- }
-
- w_ecr(ppc, 0x34); /* byte mode, no interrupt, no DMA */
- ctr = r_ctr(ppc);
- w_ctr(ppc, ctr | PCD); /* set direction to 1 */
-
- /* enter ECP test mode, no interrupt, no DMA */
- w_ecr(ppc, 0xd4);
-
- /* flush the FIFO */
- for (i=0; i<1024; i++) {
- if (r_ecr(ppc) & PPC_FIFO_EMPTY)
- break;
- cc = r_fifo(ppc);
- }
-
- if (i >= 1024) {
- LOG_PPC(__FUNCTION__, ppc, "can't flush FIFO");
- goto error;
- }
-
- /* enable interrupts, no DMA */
- w_ecr(ppc, 0xd0);
-
- /* determine readIntrThreshold
- * fill the FIFO until serviceIntr is set
- */
- for (i=0; i<1024; i++) {
- w_fifo(ppc, (char)i);
- if (!ppc->ppc_rthr && (r_ecr(ppc) & PPC_SERVICE_INTR)) {
- /* readThreshold reached */
- ppc->ppc_rthr = i+1;
- }
- if (r_ecr(ppc) & PPC_FIFO_FULL) {
- ppc->ppc_fifo = i+1;
- break;
- }
- }
-
- if (i >= 1024) {
- LOG_PPC(__FUNCTION__, ppc, "can't fill FIFO");
- goto error;
- }
+ /* call directly upper code */
+ ppb_intr(&ppcdata[unit]->ppc_link);
- w_ecr(ppc, 0xd4); /* test mode, no interrupt, no DMA */
- w_ctr(ppc, ctr & ~PCD); /* set direction to 0 */
- w_ecr(ppc, 0xd0); /* enable interrupts */
-
- /* determine writeIntrThreshold
- * empty the FIFO until serviceIntr is set
- */
- for (i=ppc->ppc_fifo; i>0; i--) {
- if (r_fifo(ppc) != (char)(ppc->ppc_fifo-i)) {
- LOG_PPC(__FUNCTION__, ppc, "invalid data in FIFO");
- goto error;
- }
- if (r_ecr(ppc) & PPC_SERVICE_INTR) {
- /* writeIntrThreshold reached */
- ppc->ppc_wthr = ppc->ppc_fifo - i+1;
- }
- /* if FIFO empty before the last byte, error */
- if (i>1 && (r_ecr(ppc) & PPC_FIFO_EMPTY)) {
- LOG_PPC(__FUNCTION__, ppc, "data lost in FIFO");
- goto error;
- }
- }
-
- /* FIFO must be empty after the last byte */
- if (!(r_ecr(ppc) & PPC_FIFO_EMPTY)) {
- LOG_PPC(__FUNCTION__, ppc, "can't empty the FIFO");
- goto error;
- }
-
- w_ctr(ppc, ctr_sav);
- w_ecr(ppc, ecr_sav);
-
- return (0);
-
-error:
- w_ctr(ppc, ctr_sav);
- w_ecr(ppc, ecr_sav);
-
- return (EINVAL);
+ return;
}
static int
@@ -318,7 +204,7 @@ ppc_detect_port(struct ppc_data *ppc)
w_ctr(ppc, 0x0c); /* To avoid missing PS2 ports */
w_dtr(ppc, 0xaa);
- if (r_dtr(ppc) != 0xaa)
+ if (r_dtr(ppc) != (char) 0xaa)
return (0);
return (1);
@@ -334,44 +220,27 @@ ppc_detect_port(struct ppc_data *ppc)
*/
static int pc873xx_basetab[] = {0x0398, 0x026e, 0x015c, 0x002e, 0};
static int pc873xx_porttab[] = {0x0378, 0x03bc, 0x0278, 0};
-static int pc873xx_irqtab[] = {5, 7, 5, 0};
-
-static int pc873xx_regstab[] = {
- PC873_FER, PC873_FAR, PC873_PTR,
- PC873_FCR, PC873_PCR, PC873_PMC,
- PC873_TUP, PC873_SID, PC873_PNP0,
- PC873_PNP1, PC873_LPTBA, -1
-};
-
-static char *pc873xx_rnametab[] = {
- "FER", "FAR", "PTR", "FCR", "PCR",
- "PMC", "TUP", "SID", "PNP0", "PNP1",
- "LPTBA", NULL
-};
static int
ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never forced */
{
static int index = 0;
- int idport, irq;
- int ptr, pcr, val, i;
+ int base, idport;
+ int val;
while ((idport = pc873xx_basetab[index++])) {
/* XXX should check first to see if this location is already claimed */
/*
- * Pull the 873xx through the power-on ID cycle (2.2,1.).
- * We can't use this to locate the chip as it may already have
- * been used by the BIOS.
+ * Pull the 873xx through the power-on ID cycle (2.2,1.). We can't use this
+ * to locate the chip as it may already have been used by the BIOS.
*/
- (void)inb(idport); (void)inb(idport);
- (void)inb(idport); (void)inb(idport);
+ (void)inb(idport); (void)inb(idport); (void)inb(idport); (void)inb(idport);
/*
* Read the SID byte. Possible values are :
*
- * 01010xxx PC87334
* 0001xxxx PC87332
* 01110xxx PC87306
*/
@@ -381,27 +250,14 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for
ppc->ppc_type = NS_PC87332;
} else if ((val & 0xf8) == 0x70) {
ppc->ppc_type = NS_PC87306;
- } else if ((val & 0xf8) == 0x50) {
- ppc->ppc_type = NS_PC87334;
} else {
if (bootverbose && (val != 0xff))
printf("PC873xx probe at 0x%x got unknown ID 0x%x\n", idport, val);
continue ; /* not recognised */
}
-
- /* print registers */
- if (bootverbose) {
- printf("PC873xx");
- for (i=0; pc873xx_regstab[i] != -1; i++) {
- outb(idport, pc873xx_regstab[i]);
- printf(" %s=0x%x", pc873xx_rnametab[i],
- inb(idport + 1) & 0xff);
- }
- printf("\n");
- }
/*
- * We think we have one. Is it enabled and where we want it to be?
+ * We think we have one. Is it enabled and where we want it to be?
*/
outb(idport, PC873_FER);
val = inb(idport + 1);
@@ -419,168 +275,96 @@ ppc_pc873xx_detect(struct ppc_data *ppc, int chipset_mode) /* XXX mode never for
pc873xx_porttab[val], ppc->ppc_base);
continue;
}
-
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
-
- /* get irq settings */
- if (ppc->ppc_base == 0x378)
- irq = (ptr & PC873_LPTBIRQ7) ? 7 : 5;
- else
- irq = pc873xx_irqtab[val];
-
- if (bootverbose)
- printf("PC873xx irq %d at 0x%x\n", irq, ppc->ppc_base);
- /*
- * Check if irq settings are correct
+ /*
+ * This is the port we want. Can we dink with it to improve
+ * our chances?
*/
- if (irq != ppc->ppc_irq) {
- /*
- * If the chipset is not locked and base address is 0x378,
- * we have another chance
- */
- if (ppc->ppc_base == 0x378 && !(ptr & PC873_CFGLOCK)) {
- if (ppc->ppc_irq == 7) {
- outb(idport + 1, (ptr | PC873_LPTBIRQ7));
- outb(idport + 1, (ptr | PC873_LPTBIRQ7));
- } else {
- outb(idport + 1, (ptr & ~PC873_LPTBIRQ7));
- outb(idport + 1, (ptr & ~PC873_LPTBIRQ7));
- }
- if (bootverbose)
- printf("PC873xx irq set to %d\n", ppc->ppc_irq);
- } else {
- if (bootverbose)
- printf("PC873xx sorry, can't change irq setting\n");
+ outb(idport, PC873_PTR);
+ val = inb(idport + 1);
+ if (val & PC873_CFGLOCK) {
+ if (bootverbose)
+ printf("PC873xx locked\n");
+
+ /* work out what mode we're in */
+ ppc->ppc_avm |= PPB_NIBBLE; /* worst case */
+
+ outb(idport, PC873_PCR);
+ val = inb(idport + 1);
+ if ((val & PC873_EPPEN) && (val & PC873_EPP19)) {
+ outb(idport, PC873_PTR);
+ val = inb(idport + 1);
+ if (!(val & PC873_EPPRDIR)) {
+ ppc->ppc_avm |= PPB_EPP; /* As we would have done it anwyay */
}
+ } else if ((val & PC873_ECPEN) && (val & PC873_ECPCLK)) {
+ ppc->ppc_avm |= PPB_PS2; /* tolerable alternative */
+ }
} else {
- if (bootverbose)
- printf("PC873xx irq settings are correct\n");
- }
-
- outb(idport, PC873_PCR);
- pcr = inb(idport + 1);
-
- if ((ptr & PC873_CFGLOCK) || !chipset_mode) {
if (bootverbose)
- printf("PC873xx %s", (ptr & PC873_CFGLOCK)?"locked":"unlocked");
-
- ppc->ppc_avm |= PPB_NIBBLE;
- if (bootverbose)
- printf(", NIBBLE");
-
- if (pcr & PC873_EPPEN) {
- ppc->ppc_avm |= PPB_EPP;
-
+ printf("PC873xx unlocked, ");
+
+#if 0 /* broken */
+ /*
+ * Frob the zero-wait-state option if possible; it causes
+ * unreliable operation.
+ */
+ outb(idport, PC873_FCR);
+ val = inb(idport + 1);
+ if ((ppc->ppc_type == NS_PC87306) || /* we are a '306 */
+ !(val & PC873_ZWSPWDN)) { /* or pin _is_ ZWS */
+ val &= ~PC873_ZWS;
+ outb(idport + 1, val); /* must disable ZWS */
+ outb(idport + 1, val);
+
if (bootverbose)
- printf(", EPP");
-
- if (pcr & PC873_EPP19)
- ppc->ppc_epp = EPP_1_9;
- else
- ppc->ppc_epp = EPP_1_7;
+ printf("ZWS %s, ", (val & PC873_ZWS) ? "enabled" : "disabled");
+ }
- if ((ppc->ppc_type == NS_PC87332) && bootverbose) {
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
- if (ptr & PC873_EPPRDIR)
- printf(", Regular mode");
- else
- printf(", Automatic mode");
- }
- } else if (pcr & PC873_ECPEN) {
- ppc->ppc_avm |= PPB_ECP;
+#endif
+ if (bootverbose)
+ printf("reconfiguring for ");
+
+ /*
+ * if the chip is at 0x3bc, we can't use EPP as there's no room
+ * for the extra registers.
+ *
+ * XXX should we use ECP mode always and use the EPP submode?
+ */
+ if (ppc->ppc_base != 0x3bc) {
if (bootverbose)
- printf(", ECP");
+ printf("EPP 1.9\n");
+
+ /* configure for EPP 1.9 operation XXX should be configurable */
+ outb(idport, PC873_PCR);
+ val = inb(idport + 1);
+ val &= ~(PC873_ECPEN | PC873_ECPCLK); /* disable ECP */
+ val |= (PC873_EPPEN | PC873_EPP19); /* enable EPP */
+ outb(idport + 1, val);
+ outb(idport + 1, val);
+
+ /* enable automatic direction turnover */
+ outb(idport, PC873_PTR);
+ val = inb(idport + 1);
+ val &= ~PC873_EPPRDIR; /* disable "regular" direction change */
+ outb(idport + 1, val);
+ outb(idport + 1, val);
- if (pcr & PC873_ECPCLK) { /* XXX */
- ppc->ppc_avm |= PPB_PS2;
- if (bootverbose)
- printf(", PS/2");
- }
+ /* we are an EPP-32 port */
+ ppc->ppc_avm |= PPB_EPP;
} else {
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
- if (ptr & PC873_EXTENDED) {
- ppc->ppc_avm |= PPB_SPP;
- if (bootverbose)
- printf(", SPP");
- }
- }
- } else {
if (bootverbose)
- printf("PC873xx unlocked");
-
- if (chipset_mode & PPB_ECP) {
- if ((chipset_mode & PPB_EPP) && bootverbose)
- printf(", ECP+EPP not supported");
-
- pcr &= ~PC873_EPPEN;
- pcr |= (PC873_ECPEN | PC873_ECPCLK); /* XXX */
- outb(idport + 1, pcr);
- outb(idport + 1, pcr);
-
- if (bootverbose)
- printf(", ECP");
-
- } else if (chipset_mode & PPB_EPP) {
- pcr &= ~(PC873_ECPEN | PC873_ECPCLK);
- pcr |= (PC873_EPPEN | PC873_EPP19);
- outb(idport + 1, pcr);
- outb(idport + 1, pcr);
-
- ppc->ppc_epp = EPP_1_9; /* XXX */
-
- if (bootverbose)
- printf(", EPP1.9");
-
- /* enable automatic direction turnover */
- if (ppc->ppc_type == NS_PC87332) {
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
- ptr &= ~PC873_EPPRDIR;
- outb(idport + 1, ptr);
- outb(idport + 1, ptr);
-
- if (bootverbose)
- printf(", Automatic mode");
- }
- } else {
- pcr &= ~(PC873_ECPEN | PC873_ECPCLK | PC873_EPPEN);
- outb(idport + 1, pcr);
- outb(idport + 1, pcr);
-
- /* configure extended bit in PTR */
- outb(idport, PC873_PTR);
- ptr = inb(idport + 1);
-
- if (chipset_mode & PPB_PS2) {
- ptr |= PC873_EXTENDED;
-
- if (bootverbose)
- printf(", PS/2");
-
- } else {
- /* default to NIBBLE mode */
- ptr &= ~PC873_EXTENDED;
-
- if (bootverbose)
- printf(", NIBBLE");
- }
- outb(idport + 1, ptr);
- outb(idport + 1, ptr);
- }
+ printf("ECP\n");
+
+ /* configure as an ECP port to get bidirectional operation for now */
+ outb(idport, PC873_PCR);
+ outb(idport + 1, inb(idport + 1) | PC873_ECPEN | PC873_ECPCLK);
- ppc->ppc_avm = chipset_mode;
+ /* we look like a PS/2 port */
+ ppc->ppc_avm |= PPB_PS2;
+ }
}
- if (bootverbose)
- printf("\n");
-
- ppc->ppc_link.adapter = &ppc_generic_adapter;
- ppc_generic_setmode(ppc->ppc_unit, chipset_mode);
-
return(chipset_mode);
}
return(-1);
@@ -767,13 +551,6 @@ config:
ppc->ppc_avm = chipset_mode;
}
- /* set FIFO threshold to 16 */
- if (ppc->ppc_avm & PPB_ECP) {
- /* select CRA */
- outb(csr, 0xa);
- outb(cio, 16);
- }
-
end_detect:
if (bootverbose)
@@ -821,7 +598,7 @@ static int w83877f_hefs[] = { WINB_HEFERE, WINB_HEFRAS, WINB_HEFERE | WINB_HEFRA
static int
ppc_w83877f_detect(struct ppc_data *ppc, int chipset_mode)
{
- int i, j, efer;
+ int i, j, efer, base;
unsigned char r, hefere, hefras;
for (i = 0; i < 4; i ++) {
@@ -996,6 +773,8 @@ found:
static int
ppc_generic_detect(struct ppc_data *ppc, int chipset_mode)
{
+ char save_control;
+
/* default to generic */
ppc->ppc_link.adapter = &ppc_generic_adapter;
@@ -1004,14 +783,14 @@ ppc_generic_detect(struct ppc_data *ppc, int chipset_mode)
if (!chipset_mode) {
/* first, check for ECP */
- w_ecr(ppc, PPC_ECR_PS2);
- if ((r_ecr(ppc) & 0xe0) == PPC_ECR_PS2) {
+ w_ecr(ppc, 0x20);
+ if ((r_ecr(ppc) & 0xe0) == 0x20) {
ppc->ppc_avm |= PPB_ECP | PPB_SPP;
if (bootverbose)
printf(" ECP SPP");
/* search for SMC style ECP+EPP mode */
- w_ecr(ppc, PPC_ECR_EPP);
+ w_ecr(ppc, 0x80);
}
/* try to reset EPP timeout bit */
@@ -1031,7 +810,7 @@ ppc_generic_detect(struct ppc_data *ppc, int chipset_mode)
}
} else {
/* restore to standard mode */
- w_ecr(ppc, PPC_ECR_STD);
+ w_ecr(ppc, 0x0);
}
/* XXX try to detect NIBBLE and PS2 modes */
@@ -1083,25 +862,13 @@ ppc_detect(struct ppc_data *ppc, int chipset_mode) {
*
* after detection, the port must support running in compatible mode
*/
- if (ppc->ppc_flags & 0x40) {
- if (bootverbose)
- printf("ppc: chipset forced to generic\n");
-
- ppc->ppc_mode = ppc_generic_detect(ppc, chipset_mode);
-
- } else {
- for (i=0; chipset_detect[i] != NULL; i++) {
- if ((mode = chipset_detect[i](ppc, chipset_mode)) != -1) {
- ppc->ppc_mode = mode;
- break;
- }
+ for (i=0; chipset_detect[i] != NULL; i++) {
+ if ((mode = chipset_detect[i](ppc, chipset_mode)) != -1) {
+ ppc->ppc_mode = mode;
+ break;
}
}
- /* configure/detect ECP FIFO */
- if ((ppc->ppc_avm & PPB_ECP) && !(ppc->ppc_flags & 0x80))
- ppc_detect_fifo(ppc);
-
return (0);
}
@@ -1128,7 +895,7 @@ ppc_exec_microseq(int unit, struct ppb_microseq **p_msq)
struct ppb_microseq *stack = 0;
/* microsequence registers are equivalent to PC-like port registers */
-#define r_reg(register,ppc) (inb((ppc)->ppc_base + register))
+#define r_reg(register,ppc) ((char)inb((ppc)->ppc_base + register))
#define w_reg(register,ppc,byte) outb((ppc)->ppc_base + register, byte)
#define INCR_PC (mi ++) /* increment program counter */
@@ -1326,244 +1093,6 @@ ppc_exec_microseq(int unit, struct ppb_microseq **p_msq)
/* unreached */
}
-static void
-ppcintr(int unit)
-{
- struct ppc_data *ppc = ppcdata[unit];
- char ctr, ecr;
-
- ctr = r_ctr(ppc);
- ecr = r_ecr(ppc);
-
-#ifdef PPC_DEBUG
- printf("!");
-#endif
-
- /* don't use ecp mode with IRQENABLE set */
- if (ctr & IRQENABLE) {
- /* call upper code */
- ppb_intr(&ppc->ppc_link);
- return;
- }
-
- if (ctr & nFAULT) {
- if (ppc->ppc_irqstat & PPC_IRQ_nFAULT) {
-
- w_ecr(ppc, ecr | PPC_nFAULT_INTR);
- ppc->ppc_irqstat &= ~PPC_IRQ_nFAULT;
- } else {
- /* call upper code */
- ppb_intr(&ppc->ppc_link);
- return;
- }
- }
-
- if (ppc->ppc_irqstat & PPC_IRQ_DMA) {
- /* disable interrupts (should be done by hardware though) */
- w_ecr(ppc, ecr | PPC_SERVICE_INTR);
- ppc->ppc_irqstat &= ~PPC_IRQ_DMA;
- ecr = r_ecr(ppc);
-
- /* check if DMA completed */
- if ((ppc->ppc_avm & PPB_ECP) && (ecr & PPC_ENABLE_DMA)) {
-#ifdef PPC_DEBUG
- printf("a");
-#endif
- /* stop DMA */
- w_ecr(ppc, ecr & ~PPC_ENABLE_DMA);
- ecr = r_ecr(ppc);
-
- if (ppc->ppc_dmastat == PPC_DMA_STARTED) {
-#ifdef PPC_DEBUG
- printf("d");
-#endif
- isa_dmadone(
- ppc->ppc_dmaflags,
- ppc->ppc_dmaddr,
- ppc->ppc_dmacnt,
- ppc->ppc_dmachan);
-
- ppc->ppc_dmastat = PPC_DMA_COMPLETE;
-
- /* wakeup the waiting process */
- wakeup((caddr_t)ppc);
- }
- }
- } else if (ppc->ppc_irqstat & PPC_IRQ_FIFO) {
-
- /* classic interrupt I/O */
- ppc->ppc_irqstat &= ~PPC_IRQ_FIFO;
-
- }
-
- return;
-}
-
-static int
-ppc_read(int unit, char *buf, int len, int mode)
-{
- return (EINVAL);
-}
-
-/*
- * Call this function if you want to send data in any advanced mode
- * of your parallel port: FIFO, DMA
- *
- * If what you want is not possible (no ECP, no DMA...),
- * EINVAL is returned
- */
-static int
-ppc_write(int unit, char *buf, int len, int how)
-{
- struct ppc_data *ppc = ppcdata[unit];
- char ecr, ecr_sav, ctr, ctr_sav;
- int s, error = 0;
- int spin;
-
-#ifdef PPC_DEBUG
- printf("w");
-#endif
-
- ecr_sav = r_ecr(ppc);
- ctr_sav = r_ctr(ppc);
-
- /*
- * Send buffer with DMA, FIFO and interrupts
- */
- if (ppc->ppc_avm & PPB_ECP) {
-
- if (ppc->ppc_dmachan >= 0) {
-
- /* byte mode, no intr, no DMA, dir=0, flush fifo
- */
- ecr = PPC_ECR_STD | PPC_DISABLE_INTR;
- w_ecr(ppc, ecr);
-
- /* disable nAck interrupts */
- ctr = r_ctr(ppc);
- ctr &= ~IRQENABLE;
- w_ctr(ppc, ctr);
-
- ppc->ppc_dmaflags = 0;
- ppc->ppc_dmaddr = (caddr_t)buf;
- ppc->ppc_dmacnt = (u_int)len;
-
- switch (ppc->ppc_mode) {
- case PPB_COMPATIBLE:
- /* compatible mode with FIFO, no intr, DMA, dir=0 */
- ecr = PPC_ECR_FIFO | PPC_DISABLE_INTR | PPC_ENABLE_DMA;
- break;
- case PPB_ECP:
- ecr = PPC_ECR_ECP | PPC_DISABLE_INTR | PPC_ENABLE_DMA;
- break;
- default:
- error = EINVAL;
- goto error;
- }
-
- w_ecr(ppc, ecr);
- ecr = r_ecr(ppc);
-
- /* enter splhigh() not to be preempted
- * by the dma interrupt, we may miss
- * the wakeup otherwise
- */
- s = splhigh();
-
- ppc->ppc_dmastat = PPC_DMA_INIT;
-
- /* enable interrupts */
- ecr &= ~PPC_SERVICE_INTR;
- ppc->ppc_irqstat = PPC_IRQ_DMA;
- w_ecr(ppc, ecr);
-
- isa_dmastart(
- ppc->ppc_dmaflags,
- ppc->ppc_dmaddr,
- ppc->ppc_dmacnt,
- ppc->ppc_dmachan);
-#ifdef PPC_DEBUG
- printf("s%d", ppc->ppc_dmacnt);
-#endif
- ppc->ppc_dmastat = PPC_DMA_STARTED;
-
- /* Wait for the DMA completed interrupt. We hope we won't
- * miss it, otherwise a signal will be necessary to unlock the
- * process.
- */
- do {
- /* release CPU */
- error = tsleep((caddr_t)ppc,
- PPBPRI | PCATCH, "ppcdma", 0);
-
- } while (error == EWOULDBLOCK);
-
- splx(s);
-
- if (error) {
-#ifdef PPC_DEBUG
- printf("i");
-#endif
- /* stop DMA */
- isa_dmadone(
- ppc->ppc_dmaflags, ppc->ppc_dmaddr,
- ppc->ppc_dmacnt, ppc->ppc_dmachan);
-
- /* no dma, no interrupt, flush the fifo */
- w_ecr(ppc, PPC_ECR_RESET);
-
- ppc->ppc_dmastat = PPC_DMA_INTERRUPTED;
- goto error;
- }
-
- /* wait for an empty fifo */
- while (!(r_ecr(ppc) & PPC_FIFO_EMPTY)) {
-
- for (spin=100; spin; spin--)
- if (r_ecr(ppc) & PPC_FIFO_EMPTY)
- goto fifo_empty;
-#ifdef PPC_DEBUG
- printf("Z");
-#endif
- error = tsleep((caddr_t)ppc, PPBPRI | PCATCH, "ppcfifo", hz/100);
- if (error != EWOULDBLOCK) {
-#ifdef PPC_DEBUG
- printf("I");
-#endif
- /* no dma, no interrupt, flush the fifo */
- w_ecr(ppc, PPC_ECR_RESET);
-
- ppc->ppc_dmastat = PPC_DMA_INTERRUPTED;
- error = EINTR;
- goto error;
- }
- }
-
-fifo_empty:
- /* no dma, no interrupt, flush the fifo */
- w_ecr(ppc, PPC_ECR_RESET);
-
- } else
- error = EINVAL; /* XXX we should FIFO and
- * interrupts */
- } else
- error = EINVAL;
-
-error:
-
- /* PDRQ must be kept unasserted until nPDACK is
- * deasserted for a minimum of 350ns (SMC datasheet)
- *
- * Consequence may be a FIFO that never empty
- */
- DELAY(1);
-
- w_ecr(ppc, ecr_sav);
- w_ctr(ppc, ctr_sav);
-
- return (error);
-}
-
/*
* Configure current operating mode
*/
@@ -1571,34 +1100,32 @@ static int
ppc_generic_setmode(int unit, int mode)
{
struct ppc_data *ppc = ppcdata[unit];
- u_char ecr = 0;
+
+ /* back to compatible mode, XXX don't know yet what to do here */
+ if (mode == 0) {
+ ppc->ppc_mode = PPB_COMPATIBLE;
+ return (0);
+ }
/* check if mode is available */
- if (mode && !(ppc->ppc_avm & mode))
- return (EINVAL);
+ if (!(ppc->ppc_avm & mode))
+ return (EOPNOTSUPP);
/* if ECP mode, configure ecr register */
if (ppc->ppc_avm & PPB_ECP) {
- /* return to byte mode (keeping direction bit),
- * no interrupt, no DMA to be able to change to
- * ECP
- */
- w_ecr(ppc, PPC_ECR_RESET);
- ecr = PPC_DISABLE_INTR;
+ /* XXX disable DMA, enable interrupts */
if (mode & PPB_EPP)
- return (EINVAL);
- else if (mode & PPB_ECP)
- /* select ECP mode */
- ecr |= PPC_ECR_ECP;
+ return (EOPNOTSUPP);
else if (mode & PPB_PS2)
/* select PS2 mode with ECP */
- ecr |= PPC_ECR_PS2;
+ w_ecr(ppc, 0x20);
+ else if (mode & PPB_ECP)
+ /* select ECP mode */
+ w_ecr(ppc, 0x60);
else
- /* select COMPATIBLE/NIBBLE mode */
- ecr |= PPC_ECR_STD;
-
- w_ecr(ppc, ecr);
+ /* select standard parallel port mode */
+ w_ecr(ppc, 0x00);
}
ppc->ppc_mode = mode;
@@ -1606,50 +1133,42 @@ ppc_generic_setmode(int unit, int mode)
return (0);
}
-/*
- * The ppc driver is free to choose options like FIFO or DMA
- * if ECP mode is available.
- *
- * The 'RAW' option allows the upper drivers to force the ppc mode
- * even with FIFO, DMA available.
- */
int
ppc_smclike_setmode(int unit, int mode)
{
struct ppc_data *ppc = ppcdata[unit];
- u_char ecr = 0;
+
+ /* back to compatible mode, XXX don't know yet what to do here */
+ if (mode == 0) {
+ ppc->ppc_mode = PPB_COMPATIBLE;
+ return (0);
+ }
/* check if mode is available */
- if (mode && !(ppc->ppc_avm & mode))
- return (EINVAL);
+ if (!(ppc->ppc_avm & mode))
+ return (EOPNOTSUPP);
/* if ECP mode, configure ecr register */
if (ppc->ppc_avm & PPB_ECP) {
- /* return to byte mode (keeping direction bit),
- * no interrupt, no DMA to be able to change to
- * ECP or EPP mode
- */
- w_ecr(ppc, PPC_ECR_RESET);
- ecr = PPC_DISABLE_INTR;
+ /* XXX disable DMA, enable interrupts */
if (mode & PPB_EPP)
/* select EPP mode */
- ecr |= PPC_ECR_EPP;
- else if (mode & PPB_ECP)
- /* select ECP mode */
- ecr |= PPC_ECR_ECP;
+ w_ecr(ppc, 0x80);
else if (mode & PPB_PS2)
/* select PS2 mode with ECP */
- ecr |= PPC_ECR_PS2;
+ w_ecr(ppc, 0x20);
+ else if (mode & PPB_ECP)
+ /* select ECP mode */
+ w_ecr(ppc, 0x60);
else
- /* select COMPATIBLE/NIBBLE mode */
- ecr |= PPC_ECR_STD;
-
- w_ecr(ppc, ecr);
+ /* select standard parallel port mode */
+ w_ecr(ppc, 0x00);
}
ppc->ppc_mode = mode;
+
return (0);
}
@@ -1658,7 +1177,7 @@ ppc_smclike_setmode(int unit, int mode)
* Semantics of clearing EPP timeout bit.
* PC87332 - reading SPP_STR does it...
* SMC - write 1 to EPP timeout bit XXX
- * Others - (?) write 0 to EPP timeout bit
+ * Others - (???) write 0 to EPP timeout bit
*/
static void
ppc_reset_epp_timeout(int unit)
@@ -1678,6 +1197,7 @@ ppcprobe(struct isa_device *dvp)
{
static short next_bios_ppc = 0;
struct ppc_data *ppc;
+ int error;
/*
* If port not specified, use bios list.
@@ -1686,9 +1206,8 @@ ppcprobe(struct isa_device *dvp)
if((next_bios_ppc < BIOS_MAX_PPC) &&
(*(BIOS_PORTS+next_bios_ppc) != 0) ) {
dvp->id_iobase = *(BIOS_PORTS+next_bios_ppc++);
- if (bootverbose)
- printf("ppc: parallel port found at 0x%x\n",
- dvp->id_iobase);
+ printf("ppc: parallel port found at 0x%x\n",
+ dvp->id_iobase);
} else
return (0);
}
@@ -1712,9 +1231,6 @@ ppcprobe(struct isa_device *dvp)
ppc->ppc_unit = dvp->id_unit;
ppc->ppc_type = GENERIC;
- /* store boot flags */
- ppc->ppc_flags = dvp->id_flags;
-
ppc->ppc_mode = PPB_COMPATIBLE;
ppc->ppc_epp = (dvp->id_flags & 0x10) >> 4;
@@ -1722,9 +1238,7 @@ ppcprobe(struct isa_device *dvp)
* XXX Try and detect if interrupts are working
*/
if (!(dvp->id_flags & 0x20))
- ppc->ppc_irq = ffs(dvp->id_irq) - 1;
-
- ppc->ppc_dmachan = dvp->id_drq;
+ ppc->ppc_irq = (dvp->id_irq);
ppcdata[ppc->ppc_unit] = ppc;
nppc ++;
@@ -1742,6 +1256,8 @@ ppcprobe(struct isa_device *dvp)
if (ppc_detect(ppc, dvp->id_flags & 0xf))
goto error;
+end_probe:
+
return (1);
error:
@@ -1753,19 +1269,13 @@ ppcattach(struct isa_device *isdp)
{
struct ppc_data *ppc = ppcdata[isdp->id_unit];
struct ppb_data *ppbus;
+ char * mode;
printf("ppc%d: %s chipset (%s) in %s mode%s\n", ppc->ppc_unit,
ppc_types[ppc->ppc_type], ppc_avms[ppc->ppc_avm],
ppc_modes[ppc->ppc_mode], (PPB_IS_EPP(ppc->ppc_mode)) ?
ppc_epp_protocol[ppc->ppc_epp] : "");
- if (ppc->ppc_fifo)
- printf("ppc%d: FIFO with %d/%d/%d bytes threshold\n",
- ppc->ppc_unit, ppc->ppc_fifo, ppc->ppc_wthr,
- ppc->ppc_rthr);
-
- isdp->id_ointr = ppcintr;
-
/*
* Prepare ppbus data area for upper level code.
*/
@@ -1777,13 +1287,6 @@ ppcattach(struct isa_device *isdp)
ppc->ppc_link.ppbus = ppbus;
ppbus->ppb_link = &ppc->ppc_link;
- if ((ppc->ppc_avm & PPB_ECP) && (ppc->ppc_dmachan > 0)) {
-
- /* acquire the DMA channel forever */
- isa_dma_acquire(ppc->ppc_dmachan);
- isa_dmainit(ppc->ppc_dmachan, 1024); /* nlpt.BUFSIZE */
- }
-
/*
* Probe the ppbus and attach devices found.
*/
diff --git a/sys/i386/isa/ppcreg.h b/sys/i386/isa/ppcreg.h
index c847e6ccd218e..fe7e72480fe5e 100644
--- a/sys/i386/isa/ppcreg.h
+++ b/sys/i386/isa/ppcreg.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ppcreg.h,v 1.6 1999/01/10 12:04:53 nsouch Exp $
+ * $Id: ppcreg.h,v 1.3 1998/08/03 19:14:33 msmith Exp $
*
*/
#ifndef __PPCREG_H
@@ -32,17 +32,16 @@
/*
* Parallel Port Chipset type.
*/
-#define SMC_LIKE 0
-#define SMC_37C665GT 1
-#define SMC_37C666GT 2
-#define NS_PC87332 3
-#define NS_PC87306 4
-#define INTEL_820191AA 5 /* XXX not implemented */
-#define GENERIC 6
-#define WINB_W83877F 7
-#define WINB_W83877AF 8
-#define WINB_UNKNOWN 9
-#define NS_PC87334 10
+#define SMC_LIKE 0x0
+#define SMC_37C665GT 0x1
+#define SMC_37C666GT 0x2
+#define NS_PC87332 0x3
+#define NS_PC87306 0x4
+#define INTEL_820191AA 0x5 /* XXX not implemented */
+#define GENERIC 0x6
+#define WINB_W83877F 0x7
+#define WINB_W83877AF 0x8
+#define WINB_UNKNOWN 0x9
/*
* Generic structure to hold parallel port chipset info.
@@ -55,34 +54,6 @@ struct ppc_data {
int ppc_mode; /* chipset current mode */
int ppc_avm; /* chipset available modes */
-#define PPC_IRQ_NONE 0x0
-#define PPC_IRQ_nACK 0x1
-#define PPC_IRQ_DMA 0x2
-#define PPC_IRQ_FIFO 0x4
-#define PPC_IRQ_nFAULT 0x8
- int ppc_irqstat; /* remind irq settings */
-
-#define PPC_DMA_INIT 0x01
-#define PPC_DMA_STARTED 0x02
-#define PPC_DMA_COMPLETE 0x03
-#define PPC_DMA_INTERRUPTED 0x04
-#define PPC_DMA_ERROR 0x05
- int ppc_dmastat; /* dma state */
- int ppc_dmachan; /* dma channel */
- int ppc_dmaflags; /* dma transfer flags */
- caddr_t ppc_dmaddr; /* buffer address */
- u_int ppc_dmacnt; /* count of bytes sent with dma */
-
-#define PPC_PWORD_MASK 0x30
-#define PPC_PWORD_16 0x00
-#define PPC_PWORD_8 0x10
-#define PPC_PWORD_32 0x20
- char ppc_pword; /* PWord size */
- short ppc_fifo; /* FIFO threshold */
-
- short ppc_wthr; /* writeIntrThresold */
- short ppc_rthr; /* readIntrThresold */
-
#define ppc_base ppc_link.base
#define ppc_epp ppc_link.epp_protocol
#define ppc_irq ppc_link.id_irq
@@ -99,44 +70,25 @@ struct ppc_data {
* Parallel Port Chipset registers.
*/
#define PPC_SPP_DTR 0 /* SPP data register */
-#define PPC_ECP_A_FIFO 0 /* ECP Address fifo register */
#define PPC_SPP_STR 1 /* SPP status register */
#define PPC_SPP_CTR 2 /* SPP control register */
#define PPC_EPP_DATA 4 /* EPP data register (8, 16 or 32 bit) */
-#define PPC_ECP_D_FIFO 0x400 /* ECP Data fifo register */
-#define PPC_ECP_CNFGA 0x400 /* Configuration register A */
-#define PPC_ECP_CNFGB 0x401 /* Configuration register B */
+#define PPC_ECP_FIFO 0x400 /* ECP fifo register */
#define PPC_ECP_ECR 0x402 /* ECP extended control register */
-#define PPC_FIFO_EMPTY 0x1 /* ecr register - bit 0 */
-#define PPC_FIFO_FULL 0x2 /* ecr register - bit 1 */
-#define PPC_SERVICE_INTR 0x4 /* ecr register - bit 2 */
-#define PPC_ENABLE_DMA 0x8 /* ecr register - bit 3 */
-#define PPC_nFAULT_INTR 0x10 /* ecr register - bit 4 */
-#define PPC_ECR_STD 0x0
-#define PPC_ECR_PS2 0x20
-#define PPC_ECR_FIFO 0x40
-#define PPC_ECR_ECP 0x60
-#define PPC_ECR_EPP 0x80
-
-#define PPC_DISABLE_INTR (PPC_SERVICE_INTR | PPC_nFAULT_INTR)
-#define PPC_ECR_RESET (PPC_ECR_PS2 | PPC_DISABLE_INTR)
-
-#define r_dtr(ppc) (inb((ppc)->ppc_base + PPC_SPP_DTR))
-#define r_str(ppc) (inb((ppc)->ppc_base + PPC_SPP_STR))
-#define r_ctr(ppc) (inb((ppc)->ppc_base + PPC_SPP_CTR))
-#define r_epp(ppc) (inb((ppc)->ppc_base + PPC_EPP_DATA))
-#define r_cnfgA(ppc) (inb((ppc)->ppc_base + PPC_ECP_CNFGA))
-#define r_cnfgB(ppc) (inb((ppc)->ppc_base + PPC_ECP_CNFGB))
-#define r_ecr(ppc) (inb((ppc)->ppc_base + PPC_ECP_ECR))
-#define r_fifo(ppc) (inb((ppc)->ppc_base + PPC_ECP_D_FIFO))
+#define r_dtr(ppc) ((char)inb((ppc)->ppc_base + PPC_SPP_DTR))
+#define r_str(ppc) ((char)inb((ppc)->ppc_base + PPC_SPP_STR))
+#define r_ctr(ppc) ((char)inb((ppc)->ppc_base + PPC_SPP_CTR))
+#define r_epp(ppc) ((char)inb((ppc)->ppc_base + PPC_EPP_DATA))
+#define r_ecr(ppc) ((char)inb((ppc)->ppc_base + PPC_ECP_ECR))
+#define r_fifo(ppc) ((char)inb((ppc)->ppc_base + PPC_ECP_FIFO))
#define w_dtr(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_DTR, byte)
#define w_str(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_STR, byte)
#define w_ctr(ppc,byte) outb((ppc)->ppc_base + PPC_SPP_CTR, byte)
#define w_epp(ppc,byte) outb((ppc)->ppc_base + PPC_EPP_DATA, byte)
#define w_ecr(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_ECR, byte)
-#define w_fifo(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_D_FIFO, byte)
+#define w_fifo(ppc,byte) outb((ppc)->ppc_base + PPC_ECP_FIFO, byte)
/*
* Register defines for the PC873xx parts
@@ -148,8 +100,6 @@ struct ppc_data {
#define PC873_PTR 0x02
#define PC873_CFGLOCK (1<<6)
#define PC873_EPPRDIR (1<<7)
-#define PC873_EXTENDED (1<<7)
-#define PC873_LPTBIRQ7 (1<<3)
#define PC873_FCR 0x03
#define PC873_ZWS (1<<5)
#define PC873_ZWSPWDN (1<<6)
@@ -161,9 +111,6 @@ struct ppc_data {
#define PC873_PMC 0x06
#define PC873_TUP 0x07
#define PC873_SID 0x08
-#define PC873_PNP0 0x1b
-#define PC873_PNP1 0x1c
-#define PC873_LPTBA 0x19
/*
* Register defines for the SMC FDC37C66xGT parts
diff --git a/sys/i386/isa/prof_machdep.c b/sys/i386/isa/prof_machdep.c
index 60167ea8ae797..f2849ad1a9dda 100644
--- a/sys/i386/isa/prof_machdep.c
+++ b/sys/i386/isa/prof_machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: prof_machdep.c,v 1.10 1998/04/19 15:41:06 bde Exp $
+ * $Id: prof_machdep.c,v 1.9 1998/04/15 17:45:43 bde Exp $
*/
#ifdef GUPROF
@@ -171,8 +171,7 @@ cputime()
{
u_int count;
int delta;
-#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) && \
- defined(PERFMON) && defined(I586_PMC_GUPROF)
+#ifdef I586_PMC_GUPROF
u_quad_t event_count;
#endif
u_char high, low;
@@ -230,11 +229,9 @@ static int
sysctl_machdep_cputime_clock SYSCTL_HANDLER_ARGS
{
int clock;
- int error;
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
int event;
+ int error;
struct pmc pmc;
-#endif
clock = cputime_clock;
#if defined(PERFMON) && defined(I586_PMC_GUPROF)
diff --git a/sys/i386/isa/psm.c b/sys/i386/isa/psm.c
index ca85f57386d88..389b1b8828e27 100644
--- a/sys/i386/isa/psm.c
+++ b/sys/i386/isa/psm.c
@@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: psm.c,v 1.59 1999/01/11 03:18:23 yokota Exp $
+ * $Id: psm.c,v 1.54 1998/07/06 16:10:06 eivind Exp $
*/
/*
@@ -86,10 +86,8 @@
#include <machine/limits.h>
#include <machine/mouse.h>
-#include <dev/kbd/atkbdcreg.h>
-
-#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
+#include <i386/isa/kbdio.h>
/*
* Driver specific options: the following options may be set by
@@ -181,20 +179,20 @@ static struct psm_softc { /* Driver status information */
#define PSM_CONFIG_RESOLUTION 0x000f /* resolution */
#define PSM_CONFIG_ACCEL 0x00f0 /* acceleration factor */
#define PSM_CONFIG_NOCHECKSYNC 0x0100 /* disable sync. test */
-#define PSM_CONFIG_NOIDPROBE 0x0200 /* disable mouse model probe */
-#define PSM_CONFIG_NORESET 0x0400 /* don't reset the mouse */
-#define PSM_CONFIG_FORCETAP 0x0800 /* assume `tap' action exists */
-#define PSM_CONFIG_IGNPORTERROR 0x1000 /* ignore error in aux port test */
#define PSM_CONFIG_FLAGS (PSM_CONFIG_RESOLUTION \
| PSM_CONFIG_ACCEL \
- | PSM_CONFIG_NOCHECKSYNC \
- | PSM_CONFIG_NOIDPROBE \
- | PSM_CONFIG_NORESET \
- | PSM_CONFIG_FORCETAP \
- | PSM_CONFIG_IGNPORTERROR)
+ | PSM_CONFIG_NOCHECKSYNC)
/* other flags (flags) */
+/*
+ * Pass mouse data packet to the user land program `as is', even if
+ * the mouse has vendor-specific enhanced features and uses non-standard
+ * packet format. Otherwise manipulate the mouse data packet so that
+ * it can be recognized by the programs which can only understand
+ * the standard packet format.
+*/
+#define PSM_FLAGS_NATIVEMODE 0x0200
/* for backward compatibility */
#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t)
@@ -240,19 +238,14 @@ static int get_aux_id __P((KBDC));
static int set_mouse_sampling_rate __P((KBDC, int));
static int set_mouse_scaling __P((KBDC, int));
static int set_mouse_resolution __P((KBDC, int));
-#ifdef PSM_RESETAFTERSUSPEND
static int set_mouse_mode __P((KBDC));
-#endif /* PSM_RESETAFTERSUSPEND */
static int get_mouse_buttons __P((KBDC));
static int is_a_mouse __P((int));
static void recover_from_error __P((KBDC));
static int restore_controller __P((KBDC, int));
-#ifdef PSM_RESETAFTERSUSPEND
static int reinitialize __P((int, mousemode_t *));
-#endif
static int doopen __P((int, int));
static char *model_name(int);
-static ointhand2_t psmintr;
/* vendor specific features */
typedef int probefunc_t __P((struct psm_softc *));
@@ -287,7 +280,6 @@ static struct {
{ MOUSE_MODEL_GENERIC,
0xc0, MOUSE_PS2_PACKETSIZE, NULL, },
};
-#define GENERIC_MOUSE_ENTRY 6
/* device driver declarateion */
struct isa_driver psmdriver = { psmprobe, psmattach, "psm", FALSE };
@@ -435,7 +427,6 @@ set_mouse_resolution(KBDC kbdc, int val)
return ((res == PSM_ACK) ? val : -1);
}
-#ifdef PSM_RESETAFTERSUSPEND
/*
* NOTE: once `set_mouse_mode()' is called, the mouse device must be
* re-enabled by calling `enable_aux_dev()'
@@ -451,8 +442,6 @@ set_mouse_mode(KBDC kbdc)
return (res == PSM_ACK);
}
-#endif /* PSM_RESETAFTERSUSPEND */
-
static int
get_mouse_buttons(KBDC kbdc)
@@ -570,7 +559,6 @@ restore_controller(KBDC kbdc, int command_byte)
}
}
-#ifdef PSM_RESETAFTERSUSPEND
/*
* Re-initialize the aux port and device. The aux port must be enabled
* and its interrupt must be disabled before calling this routine.
@@ -598,28 +586,19 @@ reinitialize(int unit, mousemode_t *mode)
case -1: /* time out */
default: /* error */
recover_from_error(kbdc);
- if (sc->config & PSM_CONFIG_IGNPORTERROR)
- break;
log(LOG_ERR, "psm%d: the aux port is not functioning (%d).\n",
unit, i);
return FALSE;
}
- if (sc->config & PSM_CONFIG_NORESET) {
- /*
- * Don't try to reset the pointing device. It may possibly be
- * left in the unknown state, though...
- */
- } else {
- /*
- * NOTE: some controllers appears to hang the `keyboard' when
- * the aux port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(kbdc)) {
- recover_from_error(kbdc);
- log(LOG_ERR, "psm%d: failed to reset the aux device.\n", unit);
- return FALSE;
- }
+ /*
+ * NOTE: some controllers appears to hang the `keyboard' when
+ * the aux port doesn't exist and `PSMC_RESET_DEV' is issued.
+ */
+ if (!reset_aux_dev(kbdc)) {
+ recover_from_error(kbdc);
+ log(LOG_ERR, "psm%d: failed to reset the aux device.\n", unit);
+ return FALSE;
}
/*
@@ -632,19 +611,15 @@ reinitialize(int unit, mousemode_t *mode)
}
empty_both_buffers(kbdc, 10); /* remove stray data if any */
- if (sc->config & PSM_CONFIG_NOIDPROBE) {
- i = GENERIC_MOUSE_ENTRY;
- } else {
- /* FIXME: hardware ID, mouse buttons? */
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- log(LOG_ERR, "psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
+ /* FIXME: hardware ID, mouse buttons? */
+
+ /* other parameters */
+ for (i = 0; vendortype[i].probefunc != NULL; ++i) {
+ if ((*vendortype[i].probefunc)(sc)) {
+ if (verbose >= 2)
+ log(LOG_ERR, "psm%d: found %s\n",
+ unit, model_name(vendortype[i].model));
+ break;
}
}
@@ -677,7 +652,6 @@ reinitialize(int unit, mousemode_t *mode)
return TRUE;
}
-#endif /* PSM_RESETAFTERSUSPEND */
static int
doopen(int unit, int command_byte)
@@ -818,7 +792,6 @@ psmprobe(struct isa_device *dvp)
printf("psm%d: unable to set the command byte.\n", unit);
endprobe(0);
}
- write_controller_command(sc->kbdc, KBDC_ENABLE_AUX_PORT);
/*
* NOTE: `test_aux_port()' is designed to return with zero if the aux
@@ -849,8 +822,6 @@ psmprobe(struct isa_device *dvp)
case -1: /* time out */
default: /* error */
recover_from_error(sc->kbdc);
- if (sc->config & PSM_CONFIG_IGNPORTERROR)
- break;
restore_controller(sc->kbdc, command_byte);
if (verbose)
printf("psm%d: the aux port is not functioning (%d).\n",
@@ -858,25 +829,17 @@ psmprobe(struct isa_device *dvp)
endprobe(0);
}
- if (sc->config & PSM_CONFIG_NORESET) {
- /*
- * Don't try to reset the pointing device. It may possibly be
- * left in the unknown state, though...
- */
- } else {
- /*
- * NOTE: some controllers appears to hang the `keyboard' when the aux
- * port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(sc->kbdc)) {
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to reset the aux device.\n", unit);
- endprobe(0);
- }
+ /*
+ * NOTE: some controllers appears to hang the `keyboard' when the aux
+ * port doesn't exist and `PSMC_RESET_DEV' is issued.
+ */
+ if (!reset_aux_dev(sc->kbdc)) {
+ recover_from_error(sc->kbdc);
+ restore_controller(sc->kbdc, command_byte);
+ if (verbose)
+ printf("psm%d: failed to reset the aux device.\n", unit);
+ endprobe(0);
}
-
/*
* both the aux port and the aux device is functioning, see if the
* device can be enabled. NOTE: when enabled, the device will start
@@ -884,12 +847,11 @@ psmprobe(struct isa_device *dvp)
* the device can be enabled.
*/
if (!enable_aux_dev(sc->kbdc) || !disable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR */
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to enable the aux device.\n", unit);
- endprobe(0);
+ /* MOUSE ERROR */
+ restore_controller(sc->kbdc, command_byte);
+ if (verbose)
+ printf("psm%d: failed to enable the aux device.\n", unit);
+ endprobe(0);
}
/* save the default values after reset */
@@ -925,21 +887,16 @@ psmprobe(struct isa_device *dvp)
break;
}
- if (sc->config & PSM_CONFIG_NOIDPROBE) {
- sc->hw.buttons = 2;
- i = GENERIC_MOUSE_ENTRY;
- } else {
- /* # of buttons */
- sc->hw.buttons = get_mouse_buttons(sc->kbdc);
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- printf("psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
+ /* # of buttons */
+ sc->hw.buttons = get_mouse_buttons(sc->kbdc);
+
+ /* other parameters */
+ for (i = 0; vendortype[i].probefunc != NULL; ++i) {
+ if ((*vendortype[i].probefunc)(sc)) {
+ if (verbose >= 2)
+ printf("psm%d: found %s\n",
+ unit, model_name(vendortype[i].model));
+ break;
}
}
@@ -952,8 +909,6 @@ psmprobe(struct isa_device *dvp)
sc->dflt_mode.syncmask[0] = 0;
else
sc->dflt_mode.syncmask[0] = vendortype[i].syncmask;
- if (sc->config & PSM_CONFIG_FORCETAP)
- sc->mode.syncmask[0] &= ~MOUSE_PS2_TAP;
sc->dflt_mode.syncmask[1] = 0; /* syncbits */
sc->mode = sc->dflt_mode;
sc->mode.packetsize = vendortype[i].packetsize;
@@ -1013,7 +968,7 @@ psmprobe(struct isa_device *dvp)
psm_softc[unit] = sc;
kbdc_set_device_mask(sc->kbdc, mask | KBD_AUX_CONTROL_BITS);
kbdc_lock(sc->kbdc, FALSE);
- return ((dvp->id_iobase < 0) ? -1 : IO_PSMSIZE);
+ return (IO_PSMSIZE);
}
static int
@@ -1022,8 +977,6 @@ psmattach(struct isa_device *dvp)
int unit = dvp->id_unit;
struct psm_softc *sc = psm_softc[unit];
- dvp->id_ointr = psmintr;
-
if (sc == NULL) /* shouldn't happen */
return (0);
@@ -1709,7 +1662,7 @@ psmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
return error;
}
-static void
+void
psmintr(int unit)
{
/*
@@ -1778,9 +1731,6 @@ psmintr(int unit)
z = 0;
ms.obutton = sc->button; /* previous button state */
ms.button = butmap[c & MOUSE_PS2_BUTTONS];
- /* `tapping' action */
- if (sc->config & PSM_CONFIG_FORCETAP)
- ms.button |= ((c & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN;
switch (sc->hw.model) {
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index ae1108a8e1dae..e946c5876ef37 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -172,7 +172,6 @@ static int rc_rcsrt[16] = {
};
/* Static prototypes */
-static ointhand2_t rcintr;
static void rc_hwreset __P((int, int, unsigned int));
static int rc_test __P((int, int));
static void rc_discard_output __P((struct rc_chans *));
@@ -232,8 +231,6 @@ rcattach(dvp)
static int rc_started = 0;
struct tty *tp;
- dvp->id_ointr = rcintr;
-
/* Thorooughly test the device */
if (rcb->rcb_probed != RC_PROBED)
return 0;
@@ -281,8 +278,7 @@ rcattach(dvp)
}
/* RC interrupt handling */
-static void
-rcintr(unit)
+void rcintr(unit)
int unit;
{
register struct rc_softc *rcb = &rc_softc[unit];
diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c
index 28acaeec53bbb..847660e70c92d 100644
--- a/sys/i386/isa/rp.c
+++ b/sys/i386/isa/rp.c
@@ -768,7 +768,7 @@ void sDisInterrupts(CHANNEL_T *ChP,Word_t Flags)
static int rpprobe __P((struct isa_device *));
static int rpattach __P((struct isa_device *));
-static const char* rp_pciprobe(pcici_t tag, pcidi_t type);
+static char* rp_pciprobe(pcici_t tag, pcidi_t type);
static void rp_pciattach(pcici_t tag, int unit);
static u_long rp_pcicount;
@@ -809,11 +809,10 @@ static struct cdevsw rp_cdevsw = {
static int rp_controller_port = 0;
static int rp_num_ports_open = 0;
+static int rp_timeout;
static int ndevs = 0;
static int minor_to_unit[128];
-#if 0
static struct tty rp_tty[128];
-#endif
static int rp_num_ports[4]; /* Number of ports on each controller */
@@ -859,7 +858,7 @@ static _INLINE_ void rp_do_receive(struct rp_port *rp, struct tty *tp,
{
int spl;
unsigned int CharNStat;
- int ToRecv, ch;
+ int ToRecv, wRecv, ch;
ToRecv = sGetRxCnt(cp);
if(ToRecv == 0)
@@ -925,7 +924,7 @@ static _INLINE_ void rp_handle_port(struct rp_port *rp)
CHANNEL_t *cp;
struct tty *tp;
unsigned int IntMask, ChanStatus;
- /* int oldcts; */
+ int oldcts, ToRecv;
if(!rp)
return;
@@ -1007,7 +1006,7 @@ static void rp_do_poll(void *not_used)
timeout(rp_do_poll, (void *)NULL, POLL_INTERVAL);
}
-static const char*
+static char*
rp_pciprobe(pcici_t tag, pcidi_t type)
{
int vendor_id;
@@ -1024,8 +1023,9 @@ int
rpprobe(dev)
struct isa_device *dev;
{
+ struct isa_device *idev;
int controller, unit;
- int aiop, num_aiops;
+ int i, aiop, num_aiops;
unsigned int aiopio[MAX_AIOPS_PER_BOARD];
CONTROLLER_t *ctlp;
@@ -1070,7 +1070,7 @@ static void
rp_pciattach(pcici_t tag, int unit)
{
dev_t rp_dev;
- int success, oldspl;
+ int success, rpmajor, oldspl;
u_short iobase;
int num_ports, num_chan, num_aiops;
int aiop, chan, port;
@@ -1079,6 +1079,7 @@ rp_pciattach(pcici_t tag, int unit)
struct rp_port *rp;
struct tty *tty;
CONTROLLER_t *ctlp;
+ char status;
success = pci_map_port(tag, 0x10, &iobase);
if(!success)
@@ -1182,7 +1183,7 @@ struct isa_device *dev;
{
struct isa_device *idev;
dev_t rp_dev;
- int iobase, unit, /*rpmajor,*/ oldspl;
+ int iobase, unit, rpmajor, oldspl;
int num_ports, num_chan, num_aiops;
int aiop, chan, port;
int ChanStatus, line, i, count;
@@ -1190,6 +1191,7 @@ struct isa_device *dev;
struct rp_port *rp;
struct tty *tty;
CONTROLLER_t *ctlp;
+ char status;
iobase = dev->id_iobase;
unit = dev->id_unit;
@@ -1301,7 +1303,7 @@ rpopen(dev, flag, mode, p)
struct proc *p;
{
struct rp_port *rp;
- int unit, port, mynor, umynor, flags; /* SG */
+ int unit, i, port, mynor, umynor, flags; /* SG */
struct tty *tp;
int oldspl, error;
unsigned int IntMask, ChanStatus;
@@ -1448,7 +1450,7 @@ rpclose(dev, flag, mode, p)
int flag, mode;
struct proc *p;
{
- int oldspl, unit, mynor, umynor, port; /* SG */
+ int oldspl, unit, mynor, umynor, port, status, i; /* SG */
struct rp_port *rp;
struct tty *tp;
CHANNEL_t *cp;
@@ -1481,7 +1483,7 @@ rpclose(dev, flag, mode, p)
static void
rphardclose(struct rp_port *rp)
{
- int mynor;
+ int status, oldspl, mynor;
struct tty *tp;
CHANNEL_t *cp;
@@ -1523,7 +1525,7 @@ rpread(dev, uio, flag)
{
struct rp_port *rp;
struct tty *tp;
- int unit, mynor, umynor, port, error = 0; /* SG */
+ int unit, i, mynor, umynor, port, error = 0; /* SG */
umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
port = (minor(dev) & 0x1f); /* SG */
@@ -1547,7 +1549,7 @@ rpwrite(dev, uio, flag)
{
struct rp_port *rp;
struct tty *tp;
- int unit, mynor, port, umynor, error = 0; /* SG */
+ int unit, i, mynor, port, umynor, error = 0; /* SG */
umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
port = (minor(dev) & 0x1f); /* SG */
@@ -1592,8 +1594,9 @@ rpioctl(dev, cmd, data, flag, p)
CHANNEL_t *cp;
struct tty *tp;
int unit, mynor, port, umynor; /* SG */
- int oldspl;
- int error = 0;
+ int oldspl, cflag, iflag, oflag, lflag;
+ int i, error = 0;
+ char status;
int arg, flags, result, ChanStatus;
int oldcmd;
struct termios term, *t;
@@ -1801,9 +1804,9 @@ rpparam(tp, t)
{
struct rp_port *rp;
CHANNEL_t *cp;
- int unit, mynor, port, umynor; /* SG */
+ int unit, i, mynor, port, umynor; /* SG */
int oldspl, cflag, iflag, oflag, lflag;
- int ospeed;
+ int ospeed, flags;
umynor = (((minor(tp->t_dev) >> 16) -1) * 32); /* SG */
@@ -1939,10 +1942,10 @@ rpstart(tp)
struct rp_port *rp;
CHANNEL_t *cp;
struct clist *qp;
- int unit, mynor, port, umynor; /* SG */
- char ch, flags;
+ int unit, i, mynor, port, umynor; /* SG */
+ char status, ch, flags;
int spl, xmit_fifo_room;
- int count;
+ int count, ToRecv;
umynor = (((minor(tp->t_dev) >> 16) -1) * 32); /* SG */
@@ -1999,8 +2002,11 @@ rpstop(tp, flag)
{
struct rp_port *rp;
CHANNEL_t *cp;
+ struct clist *qp;
int unit, mynor, port, umynor; /* SG */
- int spl;
+ char status, ch;
+ int spl, xmit_fifo_room;
+ int i, count;
umynor = (((minor(tp->t_dev) >> 16) -1) * 32); /* SG */
port = (minor(tp->t_dev) & 0x1f); /* SG */
@@ -2038,7 +2044,7 @@ struct tty *
rpdevtotty(dev_t dev)
{
struct rp_port *rp;
- int unit, port, mynor, umynor; /* SG */
+ int unit, i, port, mynor, umynor; /* SG */
umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
port = (minor(dev) & 0x1f); /* SG */
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index 7eeca7b004c2d..15ad25ed505c9 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.40 1998/07/13 09:53:02 bde Exp $ */
+/* $Id: scd.c,v 1.39 1998/07/04 22:30:17 julian Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -201,8 +201,7 @@ static struct cdevsw scd_cdevsw = {
D_DISK, 0, -1 };
-static int
-scd_attach(struct isa_device *dev)
+int scd_attach(struct isa_device *dev)
{
int unit = dev->id_unit;
struct scd_data *cd = scd_data + unit;
@@ -695,13 +694,7 @@ scd_subchan(int unit, struct ioc_read_subchannel *sc)
return 0;
}
-static __inline void
-write_control(unsigned port, unsigned data)
-{
- outb(port + OREG_CONTROL, data);
-}
-
-static int
+int
scd_probe(struct isa_device *dev)
{
struct sony_drive_configuration drive_config;
@@ -1292,6 +1285,12 @@ read_toc(dev_t dev)
return 0;
}
+static __inline void
+write_control(unsigned port, unsigned data)
+{
+ outb(port + OREG_CONTROL, data);
+}
+
static void
init_drive(unsigned unit)
{
diff --git a/sys/dev/syscons/scvesactl.c b/sys/i386/isa/scvesactl.c
index 6f48630e276cf..aabfe1901b566 100644
--- a/sys/dev/syscons/scvesactl.c
+++ b/sys/i386/isa/scvesactl.c
@@ -23,21 +23,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: $
+ * $Id: scvesactl.c,v 1.5 1998/09/26 03:38:40 yokota Exp $
*/
#include "sc.h"
-#include "vga.h"
-#include "opt_syscons.h"
-#include "opt_vga.h"
#include "opt_vesa.h"
#include "opt_vm86.h"
-#ifdef VGA_NO_MODE_CHANGE
-#undef VESA
-#endif
-
-#if (NSC > 0 && NVGA > 0 && defined(VESA) && defined(VM86)) || defined(KLD_MODULE)
+#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE)
#include <sys/param.h>
#include <sys/systm.h>
@@ -49,8 +42,8 @@
#include <machine/console.h>
#include <machine/pc/vesa.h>
-#include <dev/fb/fbreg.h>
-#include <dev/syscons/syscons.h>
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
static d_ioctl_t *prev_user_ioctl;
@@ -59,7 +52,11 @@ vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
scr_stat *scp;
struct tty *tp;
+ video_info_t info;
+ video_adapter_t *adp;
int mode;
+ int error;
+ int s;
tp = scdevtotty(dev);
if (!tp)
@@ -72,7 +69,8 @@ vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case SW_TEXT_132x25: case SW_TEXT_132x30:
case SW_TEXT_132x43: case SW_TEXT_132x50:
case SW_TEXT_132x60:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
return ENODEV;
return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
@@ -82,9 +80,11 @@ vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case SW_VESA_C132x43:
case SW_VESA_C132x50:
case SW_VESA_C132x60:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
return ENODEV;
mode = (cmd & 0xff) + M_VESA_BASE;
+vesa_text:
return sc_set_text_mode(scp, tp, mode, 0, 0, 0);
/* graphics modes */
@@ -108,9 +108,11 @@ vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case SW_VESA_1280x1024: case SW_VESA_CG1280x1024:
case SW_VESA_32K_1280: case SW_VESA_64K_1280:
case SW_VESA_FULL_1280:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
return ENODEV;
mode = (cmd & 0xff) + M_VESA_BASE;
+vesa_graphics:
return sc_set_graphics_mode(scp, tp, mode);
}
@@ -140,4 +142,4 @@ vesa_unload_ioctl(void)
return 0;
}
-#endif /* (NSC > 0 && NVGA > 0 && VESA && VM86) || KLD_MODULE */
+#endif /* (NSC > 0 && VESA && VM86) || VESA_MODULE */
diff --git a/sys/pc98/pc98/scvidctl.c b/sys/i386/isa/scvidctl.c
index 77eba9811ce86..065dee28357a9 100644
--- a/sys/pc98/pc98/scvidctl.c
+++ b/sys/i386/isa/scvidctl.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: scvidctl.c,v 1.1 1998/12/16 14:57:37 kato Exp $
+ * $Id: scvidctl.c,v 1.4 1998/09/29 02:00:56 ache Exp $
*/
#include "sc.h"
@@ -40,37 +40,11 @@
#include <machine/apm_bios.h>
#include <machine/console.h>
-#include <dev/fb/fbreg.h>
-
-#include <pc98/pc98/syscons.h>
-
-/* for compatibility with previous versions */
-typedef struct old_video_adapter {
- int va_index;
- int va_type;
- int va_flags;
-#define V_ADP_COLOR (1<<0)
-#define V_ADP_MODECHANGE (1<<1)
-#define V_ADP_STATESAVE (1<<2)
-#define V_ADP_STATELOAD (1<<3)
-#define V_ADP_FONT (1<<4)
-#define V_ADP_PALETTE (1<<5)
-#define V_ADP_BORDER (1<<6)
-#define V_ADP_VESA (1<<7)
- int va_crtc_addr;
- u_int va_window; /* virtual address */
- size_t va_window_size;
- size_t va_window_gran;
- u_int va_buffer; /* virtual address */
- size_t va_buffer_size;
- int va_initial_mode;
- int va_initial_bios_mode;
- int va_mode;
-} old_video_adapter_t;
-
-#define OLD_CONS_ADPINFO _IOWR('c', 101, old_video_adapter_t)
-
-/* variables */
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
+
+/* video ioctl */
+
extern scr_stat *cur_console;
extern int fonts_loaded;
extern int sc_history_size;
@@ -80,13 +54,15 @@ int
sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
int fontsize)
{
+ video_adapter_t *adp;
video_info_t info;
int error;
int s;
int i;
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
+ if ((*biosvidsw.get_info)(scp->adp, mode, &info))
return ENODEV;
+ adp = get_adapter(scp);
/* adjust argument values */
if (fontsize <= 0)
@@ -132,14 +108,12 @@ sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
scp->font_size = fontsize;
scp->xsize = xsize;
scp->ysize = ysize;
- scp->xoff = 0;
- scp->yoff = 0;
scp->xpixel = scp->xsize*8;
scp->ypixel = scp->ysize*fontsize;
/* allocate buffers */
sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
+ if (ISMOUSEAVAIL(adp->va_flags))
sc_alloc_cut_buffer(scp, FALSE);
sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
splx(s);
@@ -163,12 +137,14 @@ sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
int
sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
{
+ video_adapter_t *adp;
video_info_t info;
int error;
int s;
- if ((*vidsw[scp->ad]->get_info)(scp->adp, mode, &info))
+ if ((*biosvidsw.get_info)(scp->adp, mode, &info))
return ENODEV;
+ adp = get_adapter(scp);
/* stop screen saver, etc */
s = spltty();
@@ -181,8 +157,6 @@ sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE);
scp->status &= ~PIXEL_MODE;
scp->mode = mode;
- scp->xoff = 0;
- scp->yoff = 0;
scp->xpixel = info.vi_width;
scp->ypixel = info.vi_height;
scp->xsize = info.vi_width/8;
@@ -213,13 +187,15 @@ int
sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
int fontsize)
{
+ video_adapter_t *adp;
video_info_t info;
int error;
int s;
int i;
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
+ if ((*biosvidsw.get_info)(scp->adp, scp->mode, &info))
return ENODEV; /* this shouldn't happen */
+ adp = get_adapter(scp);
#ifdef SC_VIDEO_DEBUG
if (scp->scr_buf != NULL) {
@@ -254,7 +230,7 @@ sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
printf("set_pixel_mode(): mode:%x, col:%d, row:%d, font:%d\n",
scp->mode, xsize, ysize, fontsize);
printf("set_pixel_mode(): window:%x, %dx%d, xoff:%d, yoff:%d\n",
- scp->adp->va_window, info.vi_width, info.vi_height,
+ adp->va_window, info.vi_width, info.vi_height,
(info.vi_width/8 - xsize)/2,
(info.vi_height/fontsize - ysize)/2);
}
@@ -298,7 +274,7 @@ sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
/* allocate buffers */
sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
+ if (ISMOUSEAVAIL(adp->va_flags))
sc_alloc_cut_buffer(scp, FALSE);
sc_alloc_history_buffer(scp, sc_history_size, i, FALSE);
splx(s);
@@ -328,6 +304,7 @@ int
sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
{
scr_stat *scp;
+ video_adapter_t *adp;
int error;
int s;
@@ -336,66 +313,19 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
switch (cmd) {
case CONS_CURRENT: /* get current adapter type */
- if (scp->adp == NULL)
- return ENODEV;
- *(int *)data = scp->adp->va_type;
+ adp = get_adapter(scp);
+ *(int *)data = adp->va_type;
return 0;
case CONS_CURRENTADP: /* get current adapter index */
- *(int *)data = scp->ad;
- return 0;
-
- case OLD_CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
- return ENODEV;
- ((old_video_adapter_t *)data)->va_index = scp->adp->va_index;
- ((old_video_adapter_t *)data)->va_type = scp->adp->va_type;
- ((old_video_adapter_t *)data)->va_flags = scp->adp->va_flags;
- ((old_video_adapter_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((old_video_adapter_t *)data)->va_window = scp->adp->va_window;
- ((old_video_adapter_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((old_video_adapter_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((old_video_adapter_t *)data)->va_buffer = scp->adp->va_buffer;
- ((old_video_adapter_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((old_video_adapter_t *)data)->va_mode = scp->adp->va_mode;
- ((old_video_adapter_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((old_video_adapter_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
+ *(int *)data = scp->adp;
return 0;
case CONS_ADPINFO: /* adapter information */
- if (scp->adp == NULL)
+ adp = (*biosvidsw.adapter)(((video_adapter_t *)data)->va_index);
+ if (adp == NULL)
return ENODEV;
- ((video_adapter_info_t *)data)->va_index = scp->adp->va_index;
- ((video_adapter_info_t *)data)->va_type = scp->adp->va_type;
- bcopy(scp->adp->va_name, ((video_adapter_info_t *)data)->va_name,
- imin(strlen(scp->adp->va_name) + 1,
- sizeof(((video_adapter_info_t *)data)->va_name)));
- ((video_adapter_info_t *)data)->va_unit = scp->adp->va_unit;
- ((video_adapter_info_t *)data)->va_flags = scp->adp->va_flags;
- ((video_adapter_info_t *)data)->va_io_base = scp->adp->va_io_base;
- ((video_adapter_info_t *)data)->va_io_size = scp->adp->va_io_size;
- ((video_adapter_info_t *)data)->va_crtc_addr = scp->adp->va_crtc_addr;
- ((video_adapter_info_t *)data)->va_mem_base = scp->adp->va_mem_base;
- ((video_adapter_info_t *)data)->va_mem_size = scp->adp->va_mem_size;
- ((video_adapter_info_t *)data)->va_window = scp->adp->va_window;
- ((video_adapter_info_t *)data)->va_window_size
- = scp->adp->va_window_size;
- ((video_adapter_info_t *)data)->va_window_gran
- = scp->adp->va_window_gran;
- ((video_adapter_info_t *)data)->va_buffer = scp->adp->va_buffer;
- ((video_adapter_info_t *)data)->va_buffer_size
- = scp->adp->va_buffer_size;
- ((video_adapter_info_t *)data)->va_mode = scp->adp->va_mode;
- ((video_adapter_info_t *)data)->va_mode_flags = scp->adp->va_mode_flags;
- ((video_adapter_info_t *)data)->va_initial_mode
- = scp->adp->va_initial_mode;
- ((video_adapter_info_t *)data)->va_initial_bios_mode
- = scp->adp->va_initial_bios_mode;
+ bcopy(adp, data, sizeof(*adp));
return 0;
case CONS_GET: /* get current video mode */
@@ -403,16 +333,16 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case CONS_MODEINFO: /* get mode information */
- return ((*vidsw[scp->ad]->get_info)(scp->adp,
+ return ((*biosvidsw.get_info)(scp->adp,
((video_info_t *)data)->vi_mode, (video_info_t *)data)
? ENODEV : 0);
case CONS_FINDMODE: /* find a matching video mode */
- return ((*vidsw[scp->ad]->query_mode)(scp->adp, (video_info_t *)data)
+ return ((*biosvidsw.query_mode)(scp->adp, (video_info_t *)data)
? ENODEV : 0);
case CONS_SETWINORG:
- return ((*vidsw[scp->ad]->set_win_org)(scp->adp, *(u_int *)data)
+ return ((*biosvidsw.set_win_org)(scp->adp, *(u_int *)data)
? ENODEV : 0);
/* generic text modes */
@@ -433,13 +363,8 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
case SW_ENH_B80x25: case SW_ENH_C80x25:
case SW_ENH_B80x43: case SW_ENH_C80x43:
case SW_EGAMONO80x25:
-
-#ifdef PC98
- /* PC98 TEXT MODES */
- case SW_PC98_80x25:
- case SW_PC98_80x30:
-#endif
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
return ENODEV;
return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0);
@@ -449,7 +374,8 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
case SW_CG640x350: case SW_ENH_CG640:
case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
case SW_VGA_MODEX:
- if (!(scp->adp->va_flags & V_ADP_MODECHANGE))
+ adp = get_adapter(scp);
+ if (!(adp->va_flags & V_ADP_MODECHANGE))
return ENODEV;
return sc_set_graphics_mode(scp, tp, cmd & 0xff);
@@ -464,7 +390,8 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
return EINVAL;
/* restore fonts & palette ! */
#if 0
- if (ISFONTAVAIL(scp->adp->va_flags)
+ adp = get_adapter(scp);
+ if (ISFONTAVAIL(adp->va_flags)
&& !(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
/*
* FONT KLUDGE
@@ -478,10 +405,10 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
copy_font(scp, LOAD, 16, font_16);
}
#endif
- load_palette(scp->adp, palette);
+ load_palette(scp, palette);
/* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
+ (*biosvidsw.set_hw_cursor)(scp->adp, -1, -1);
/* FALL THROUGH */
@@ -497,7 +424,6 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
splx(s);
return error;
}
-#ifndef PC98
scp->status |= UNKNOWN_MODE;
splx(s);
/* no restore fonts & palette */
@@ -505,14 +431,6 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
set_mode(scp);
sc_clear_screen(scp);
scp->status &= ~UNKNOWN_MODE;
-#else /* PC98 */
- scp->status &= ~UNKNOWN_MODE;
- /* no restore fonts & palette */
- if (scp == cur_console)
- set_mode(scp);
- sc_clear_screen(scp);
- splx(s);
-#endif /* PC98 */
return 0;
case KD_PIXEL: /* pixel (raster) display */
@@ -530,7 +448,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
splx(s);
if (scp == cur_console) {
set_mode(scp);
- load_palette(scp->adp, palette);
+ load_palette(scp, palette);
}
sc_clear_screen(scp);
scp->status &= ~UNKNOWN_MODE;
@@ -544,10 +462,6 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
}
scp->status |= UNKNOWN_MODE;
splx(s);
-#ifdef PC98
- if (scp == cur_console)
- set_mode(scp);
-#endif
return 0;
default:
@@ -572,7 +486,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
case KDSBORDER: /* set border color of this (virtual) console */
scp->border = *data;
if (scp == cur_console)
- set_border(scp, scp->border);
+ set_border(cur_console, scp->border);
return 0;
}
diff --git a/sys/i386/isa/seagate.c b/sys/i386/isa/seagate.c
new file mode 100644
index 0000000000000..8b2be3ff63d57
--- /dev/null
+++ b/sys/i386/isa/seagate.c
@@ -0,0 +1,1506 @@
+/*
+ * (Free/Net/386)BSD ST01/02, Future Domain TMC-885, TMC-950 SCSI driver for
+ * Julians SCSI-code
+ *
+ * Copyright 1994, Kent Palmkvist (kentp@isy.liu.se)
+ * Copyright 1994, Robert Knier (rknier@qgraph.com)
+ * Copyright 1992, 1994 Drew Eckhardt (drew@colorado.edu)
+ * Copyright 1994, Julian Elischer (julian@tfs.com)
+ * Copyright 1994-1995, Serge Vakulenko (vak@cronyx.ru)
+ * Copyright 1995 Stephen Hocking (sysseh@devetir.qld.gov.au)
+ *
+ * Others that has contributed by example code is
+ * Glen Overby (overby@cray.com)
+ * Tatu Yllnen
+ * Brian E Litzinger
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPERS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * kentp 940307 alpha version based on newscsi-03 version of Julians SCSI-code
+ * kentp 940314 Added possibility to not use messages
+ * rknier 940331 Added fast transfer code
+ * rknier 940407 Added assembler coded data transfers
+ * vak 941226 New probe algorithm, based on expected behaviour
+ * instead of BIOS signatures analysis, better timeout handling,
+ * new asm fragments for data input/output, target-dependent
+ * delays, device flags, polling mode, generic cleanup
+ * vak 950115 Added request-sense ops
+ * seh 950701 Fixed up Future Domain TMC-885 problems with disconnects,
+ * weird phases and the like. (we could probably investigate
+ * what the board's idea of the phases are, but that requires
+ * doco that I don't have). Note that it is slower than the
+ * 2.0R driver with both SEA_BLINDTRANSFER & SEA_ASSEMBLER
+ * defined by a factor of more than 2. I'll look at that later!
+ * seh 950712 The performance release 8^). Put in the blind transfer code
+ * from the 2.0R source. Don't use it by commenting out the
+ * SEA_BLINDTRANSFER below. Note that it only kicks in during
+ * DATAOUT or DATAIN and then only when the transfer is a
+ * multiple of BLOCK_SIZE bytes (512). Most devices fit into
+ * that category, with the possible exception of scanners and
+ * some of the older MO drives.
+ *
+ * $Id: seagate.c,v 1.30 1998/07/15 09:38:10 bde Exp $
+ */
+
+/*
+ * What should really be done:
+ *
+ * Restructure interrupt enable/disable code (runs too long with int disabled)
+ * Add code to handle Future Domain 840, 841, 880 and 881
+ * Add code to use tagged commands in SCSI2
+ * Add code to handle slow devices better (sleep if device not disconnecting)
+ * Fix unnecessary interrupts
+ */
+
+/* Note to users trying to share a disk between DOS and unix:
+ * The ST01/02 is a translating host-adapter. It is not giving DOS
+ * the same number of heads/tracks/sectors as specified by the disk.
+ * It is therefore important to look at what numbers DOS thinks the
+ * disk has. Use these to disklabel your disk in an appropriate manner
+ *
+ * About ST02+IDE coexistence: the original Seagate ST02
+ * BIOS cannot coexist with IDE or any other disk controller
+ * because it does not share BIOS disk drive numbers (80h, 81h)
+ * with others. New probing code allows using ST02 controller
+ * without BIOS: just unplug the ST02 BIOS chip from the board.
+ *
+ * Another problem is the floppy adapter on ST02 which could not be
+ * disabled by jumpers. I commonly use ST02 adapter as a cheap solution
+ * for atttaching the tape and CD-ROM drives, and an extra floppy controller
+ * is just a headache. I found a simple workaround: cutting off
+ * the AEN signal (A11 contact on ISA connector). AEN then goes high and
+ * disables the floppy adapter port address decoder.
+ *
+ * I also had a problem with ST02 conflicting with IDE during
+ * IDE data write phase. It seems than ST02 makes some noise
+ * on /IOW line. The /IOW line is used only for floppy controller
+ * part of ST02, and because I don't need it, I cut off the /IOW (contact B13)
+ * and it helped. (vak)
+ *
+ * Tested on the following hardware:
+ * Adapter: Seagate ST02
+ * Disk: HP D1686
+ * Streamers: Archive Viper 150, Wangtek 5525
+ * CD-ROMs: Toshiba XM-3401, NEC CDR-25
+ *
+ * Maximum data rate is about 270-280 kbytes/sec (on 386DX/40).
+ * (vak)
+ */
+#undef DEBUG
+
+#include "sea.h"
+#if NSEA > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+
+#include <i386/isa/isa_device.h>
+
+#include <scsi/scsiconf.h>
+
+#ifdef DEBUG
+# define PRINT(s) printf s
+#else
+# define PRINT(s) /*void*/
+#endif
+
+#define SCB_TABLE_SIZE 8 /* start with 8 scb entries in table */
+#define BLOCK_SIZE 512 /* size of READ/WRITE areas on SCSI card */
+#define HOST_SCSI_ADDR 7 /* address of the adapter on the SCSI bus */
+#define SEA_BLINDTRANSFER 1 /* for quicker than quick xfers */
+/*
+ * Define config flags
+ */
+#define FLAG_NOPARITY 0x01 /* disable SCSI bus parity check */
+
+/*
+ * Board CONTROL register
+ */
+#define CMD_RST 0x01 /* scsi reset */
+#define CMD_SEL 0x02 /* scsi select */
+#define CMD_BSY 0x04 /* scsi busy */
+#define CMD_ATTN 0x08 /* scsi attention */
+#define CMD_START_ARB 0x10 /* start arbitration bit */
+#define CMD_EN_PARITY 0x20 /* enable scsi parity generation */
+#define CMD_INTR 0x40 /* enable scsi interrupts */
+#define CMD_DRVR_ENABLE 0x80 /* scsi enable */
+
+/*
+ * Board STATUS register
+ */
+#define STAT_BSY 0x01 /* scsi busy */
+#define STAT_MSG 0x02 /* scsi msg */
+#define STAT_IO 0x04 /* scsi I/O */
+#define STAT_CD 0x08 /* scsi C/D */
+#define STAT_REQ 0x10 /* scsi req */
+#define STAT_SEL 0x20 /* scsi select */
+#define STAT_PARITY 0x40 /* parity error bit */
+#define STAT_ARB_CMPL 0x80 /* arbitration complete bit */
+#define STAT_BITS "\20\1bsy\2msg\3i/o\4c/d\5req\6sel\7parity\10arb"
+
+/*
+ * SCSI bus phases
+ */
+#define PHASE_MASK (STAT_MSG | STAT_CD | STAT_IO)
+#define PHASE_DATAOUT 0
+#define PHASE_DATAIN STAT_IO
+#define PHASE_CMDOUT STAT_CD
+#define PHASE_STATIN (STAT_CD | STAT_IO)
+#define PHASE_MSGOUT (STAT_MSG | STAT_CD)
+#define PHASE_MSGIN (STAT_MSG | STAT_CD | STAT_IO)
+#define PHASE_NAME(ph) phase_name[(ph)>>2]
+
+static char *phase_name[] = {
+ "DATAOUT", "Phase1?", "Phase2?", "Phase3?",
+ "DATAIN", "Phase5?", "Phase6?", "Phase7?",
+ "CMDOUT", "Phase9?", "MSGOUT", "Phase11?",
+ "STATIN", "Phase13?", "MSGIN", "Phase15?",
+};
+
+/*
+ * SCSI message codes
+ */
+#define MSG_COMMAND_COMPLETE 0x00
+#define MSG_SAVE_POINTERS 0x02
+#define MSG_RESTORE_POINTERS 0x03
+#define MSG_DISCONNECT 0x04
+#define MSG_ABORT 0x06
+#define MSG_MESSAGE_REJECT 0x07
+#define MSG_NOP 0x08
+#define MSG_BUS_DEV_RESET 0x0c
+#define MSG_IDENTIFY(lun) (0xc0 | ((lun) & 0x7))
+#define MSG_ISIDENT(m) ((m) & 0x80)
+
+/*
+ * SCSI control block used to keep info about a scsi command
+ */
+typedef struct scb {
+ int flags; /* status of the instruction */
+#define SCB_FREE 0x00
+#define SCB_ACTIVE 0x01
+#define SCB_ABORTED 0x02
+#define SCB_TIMEOUT 0x04
+#define SCB_ERROR 0x08
+#define SCB_TIMECHK 0x10 /* we have set a timeout on this one */
+#define SCB_SENSE 0x20 /* sensed data available */
+#define SCB_TBUSY 0x40 /* target busy */
+ struct scb *next; /* in free list */
+ struct scsi_xfer *xfer; /* the scsi_xfer for this cmd */
+ u_char *data; /* position in data buffer so far */
+ int32_t datalen; /* bytes remaining to transfer */
+} scb_t;
+
+typedef enum {
+ CTLR_NONE,
+ CTLR_SEAGATE,
+ CTLR_FUTURE_DOMAIN
+} ctlr_t;
+
+/*
+ * Flags for waiting for REQ deassert during some SCSI bus phases.
+ */
+typedef struct {
+ unsigned cmdout1 : 1; /* after CMDOUT[0] byte */
+ unsigned cmdout : 1; /* after CMDOUT[1..N] bytes */
+ unsigned msgout : 1; /* after MSGOUT byte */
+ unsigned statin : 1; /* after STATIN byte */
+} phase_t;
+
+/*
+ * Data structure describing the target state.
+ */
+typedef struct {
+ struct adapter *adapter; /* pointer to the adapter structure */
+ u_char busy; /* mask of busy luns at device target */
+ u_long perrcnt; /* counter of target parity errors */
+ phase_t ndelay; /* "don't delay" flags */
+ phase_t init; /* "initialized" flags */
+} target_t;
+
+/*
+ * Data structure describing current status of the scsi bus. One for each
+ * controller card.
+ */
+typedef struct adapter {
+ ctlr_t type; /* Seagate or Future Domain */
+ char *name; /* adapter name */
+ volatile u_char *addr; /* base address for card */
+
+ volatile u_char *CONTROL; /* address of control register */
+ volatile u_char *STATUS; /* address of status register */
+ volatile u_char *DATA; /* address of data register */
+
+ u_char scsi_addr; /* our scsi address, 0..7 */
+ u_char scsi_id; /* our scsi id mask */
+ u_char parity; /* parity flag: CMD_EN_PARITY or 0 */
+ u_char irq; /* IRQ number used or 0 if no IRQ */
+ u_int timeout_active : 1; /* timeout() active (requested) */
+
+ struct scsi_link sc_link; /* struct connecting different data */
+ scb_t *queue; /* waiting to be issued */
+ scb_t *disconnected_queue; /* waiting to reconnect */
+
+ int numscb; /* number of scsi control blocks */
+ scb_t *free_scb; /* free scb list */
+ scb_t scbs[SCB_TABLE_SIZE];
+
+ target_t target[8]; /* target state data */
+} adapter_t;
+
+static adapter_t seadata[NSEA];
+
+#define IS_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &\
+ (1 << (b)->xfer->sc_link->lun))
+#define SET_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy |=\
+ (1 << (b)->xfer->sc_link->lun))
+#define CLEAR_BUSY(a,b) ((a)->target[(b)->xfer->sc_link->target].busy &=\
+ ~(1 << (b)->xfer->sc_link->lun))
+
+/*
+ * Wait for condition, given as an boolean expression.
+ * Print the message on timeout.
+ */
+#define WAITFOR(condition,message) {\
+ register u_long cnt = 100000; char *_msg = message;\
+ while (cnt-- && ! (condition)) continue;\
+ if (cnt == -1 && _msg)\
+ printf ("sea: %s timeout\n", _msg); }
+
+#define WAITFOR10(condition,message) {\
+ register u_long cnt = 1000000; char *_msg = message;\
+ while (cnt-- && ! (condition)) continue;\
+ if (cnt == -1 && _msg)\
+ printf ("sea: %s timeout\n", _msg); }
+
+/*
+ * Seagate adapter does not support in hardware
+ * waiting for REQ deassert after transferring each data byte.
+ * We must do it in software.
+ * The problem is that some SCSI devices deassert REQ so fast that
+ * we can miss it. We the flag for each target sayind if we should (not)
+ * wait for REQ deassert. This flag is initialized when the first
+ * operation on the target is done.
+ * 1) Test if we don't need to wait for REQ deassert (`nodelay' flag).
+ * Initially the flag is off, i.e. wait. If the flag is set,
+ * go to the step 4.
+ * 2) Wait for REQ deassert (call sea_wait_for_req_deassert function).
+ * If REQ deassert got, go to the step 4. If REQ did not cleared
+ * during timeout period, go to the next step.
+ * 3) If `nodelay' flag did not initialized yet (`init' flag),
+ * then set `ndelay' flag.
+ * 4) Set `init' flag. Done.
+ */
+#define WAITREQ(t,op,cnt) {\
+ if (! (t)->ndelay.op &&\
+ ! sea_wait_for_req_deassert ((t)->adapter, cnt, #op) &&\
+ ! (t)->init.op)\
+ (t)->ndelay.op = 1;\
+ (t)->init.op = 1; }
+
+static int sea_probe (struct isa_device *dev);
+static int sea_detect (adapter_t *z, struct isa_device *dev);
+static int sea_attach (struct isa_device *dev);
+static int32_t sea_scsi_cmd (struct scsi_xfer *xs);
+static u_int32_t sea_adapter_info (int unit);
+static void sea_timeout (void *scb);
+static void seaminphys (struct buf *bp);
+static void sea_done (adapter_t *z, scb_t *scb);
+static void sea_start (adapter_t *z);
+static void sea_information_transfer (adapter_t *z, scb_t *scb);
+static int sea_poll (adapter_t *z, scb_t *scb);
+static int sea_init (adapter_t *z);
+static int sea_reselect (adapter_t *z);
+static int sea_select (volatile adapter_t *z, scb_t *scb);
+static int sea_abort (adapter_t *z, scb_t *scb);
+static void sea_send_abort (adapter_t *z);
+static u_char sea_msg_input (adapter_t *z);
+static void sea_tick (void *arg);
+static int sea_sense (adapter_t *z, scb_t *scb);
+static void sea_data_output (adapter_t *z, u_char **pdata, u_long *plen);
+static void sea_data_input (adapter_t *z, u_char **pdata, u_long *plen);
+static void sea_cmd_output (target_t *z, u_char *cmd, int cmdlen);
+
+static struct scsi_adapter sea_switch = {
+ sea_scsi_cmd, seaminphys, 0, 0, sea_adapter_info, "sea", {0},
+};
+static struct scsi_device sea_dev = { NULL, NULL, NULL, NULL, "sea", 0, {0} };
+struct isa_driver seadriver = { sea_probe, sea_attach, "sea" };
+
+/* FD TMC885's can't handle detach & re-attach */
+static int sea_select_cmd = CMD_DRVR_ENABLE | CMD_ATTN;
+
+/*
+ * Check if the device can be found at the port given and if so,
+ * detect the type of board. Set it up ready for further work.
+ * Takes the isa_dev structure from autoconf as an argument.
+ * Returns 1 if card recognized, 0 if errors.
+ */
+int sea_probe (struct isa_device *dev)
+{
+ adapter_t *z = &seadata[dev->id_unit];
+ static const int addrtab[] = {
+ 0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000, 0,
+ };
+ int i;
+
+ /* Init fields used by our routines */
+ z->parity = (dev->id_flags & FLAG_NOPARITY) ? 0 : CMD_EN_PARITY;
+ z->scsi_addr = HOST_SCSI_ADDR;
+ z->scsi_id = 1 << z->scsi_addr;
+ z->irq = dev->id_irq ? ffs (dev->id_irq) - 1 : 0;
+ z->queue = 0;
+ z->disconnected_queue = 0;
+ for (i=0; i<8; i++) {
+ z->target[i].adapter = z;
+ z->target[i].busy = 0;
+ }
+
+ /* Link up the free list of scbs */
+ z->numscb = SCB_TABLE_SIZE;
+ z->free_scb = z->scbs;
+ for (i=1; i<SCB_TABLE_SIZE; i++)
+ z->scbs[i-1].next = z->scbs + i;
+ z->scbs[SCB_TABLE_SIZE-1].next = 0;
+
+ /* Detect the adapter. */
+ dev->id_msize = 0x4000;
+ if (! dev->id_maddr)
+ for (i=0; addrtab[i]; ++i) {
+ dev->id_maddr = (u_char*) KERNBASE + addrtab[i];
+ if (sea_detect (z, dev))
+ return (1);
+ }
+ else if (sea_detect (z, dev))
+ return (1);
+
+ bzero (z, sizeof (*z));
+ return (0);
+}
+
+int sea_detect (adapter_t *z, struct isa_device *dev)
+{
+ z->addr = dev->id_maddr;
+
+ /* Try Seagate. */
+ z->type = CTLR_SEAGATE;
+ z->name = "Seagate ST01/ST02";
+ z->CONTROL = z->addr + 0x1a00; /* ST01/ST02 register offsets */
+ z->STATUS = z->addr + 0x1a00;
+ z->DATA = z->addr + 0x1c00;
+ if (sea_init (z) == 0)
+ return (1);
+
+ /* Try Future Domain. */
+ z->type = CTLR_FUTURE_DOMAIN;
+ z->name = "Future Domain TMC-885/TMC-950";
+ z->CONTROL = z->addr + 0x1c00; /* TMC-885/TMC-950 reg. offsets */
+ z->STATUS = z->addr + 0x1c00;
+ z->DATA = z->addr + 0x1e00;
+ /* FD TMC885's can't handle detach & re-attach */
+ sea_select_cmd = CMD_DRVR_ENABLE;
+ /* FD TMC-885 is supposed to be at id 6. How strange. */
+ z->scsi_addr = HOST_SCSI_ADDR - 1;
+ z->scsi_id = 1 << z->scsi_addr;
+ if (sea_init (z) == 0)
+ return (1);
+
+ return (0);
+}
+
+/*
+ * Probe the adapter, and if found, reset the board and the scsi bus.
+ * Return 0 if the adapter found.
+ */
+int sea_init (adapter_t *z)
+{
+ volatile u_char *p;
+ int i, c;
+
+ /* Check that STATUS..STATUS+200h are equal. */
+ p = z->STATUS;
+ c = *p;
+ if (c == 0xff)
+ return (2);
+ while (++p < z->STATUS+0x200)
+ if (*p != c)
+ return (3);
+
+ /* Check that DATA..DATA+200h are equal. */
+ for (p=z->DATA, c= *p++; p<z->DATA+0x200; ++p)
+ if (*p != c)
+ return (4);
+
+ /* Check that addr..addr+1800h are not writable. */
+ for (p=z->addr; p<z->addr+0x1800; ++p) {
+ c = *p;
+ *p = ~c;
+ if (*p == ~c) {
+ *p = c;
+ return (5);
+ }
+ }
+
+ /* Check that addr+1800h..addr+1880h are writable. */
+ for (p=z->addr+0x1800; p<z->addr+0x1880; ++p) {
+ c = *p;
+ *p = 0x55;
+ if (*p != 0x55) {
+ *p = c;
+ return (6);
+ }
+ *p = 0xaa;
+ if (*p != 0xaa) {
+ *p = c;
+ return (7);
+ }
+ }
+
+ /* Reset the scsi bus (I don't know if this is needed). */
+ *z->CONTROL = CMD_RST | CMD_DRVR_ENABLE | z->parity | CMD_INTR;
+ /* Hold reset for at least 25 microseconds. */
+ DELAY (25);
+ /* Check that status cleared. */
+ if (*z->STATUS != 0) {
+ *z->CONTROL = 0;
+ return (8);
+ }
+
+ /* Check that DATA register is writable. */
+ for (i=0; i<256; ++i) {
+ *z->DATA = i;
+ if (*z->DATA != i) {
+ *z->CONTROL = 0;
+ return (9);
+ }
+ }
+
+ /* Enable the adapter. */
+ *z->CONTROL = CMD_INTR | z->parity;
+ /* Wait a Bus Clear Delay (800 ns + bus free delay 800 ns). */
+ DELAY (10);
+
+ /* Check that DATA register is NOT writable. */
+ c = *z->DATA;
+ for (i=0; i<256; ++i) {
+ *z->DATA = i;
+ if (*z->DATA != c) {
+ *z->CONTROL = 0;
+ return (10);
+ }
+ }
+
+ return (0);
+}
+
+/*
+ * Attach all sub-devices we can find.
+ */
+int sea_attach (struct isa_device *dev)
+{
+ int unit = dev->id_unit;
+ adapter_t *z = &seadata[unit];
+ struct scsibus_data *scbus;
+
+ printf ("\nsea%d: type %s%s\n", unit, z->name,
+ (dev->id_flags & FLAG_NOPARITY) ? ", no parity" : "");
+
+ /* fill in the prototype scsi_link */
+ z->sc_link.adapter_unit = unit;
+ z->sc_link.adapter_targ = z->scsi_addr;
+ z->sc_link.adapter_softc = z;
+ z->sc_link.adapter = &sea_switch;
+ z->sc_link.device = &sea_dev;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &z->sc_link;
+
+ /* ask the adapter what subunits are present */
+ scsi_attachdevs (scbus);
+
+ return (1);
+}
+
+/*
+ * Return some information to the caller about
+ * the adapter and its capabilities.
+ */
+u_int32_t sea_adapter_info (int unit)
+{
+ return (1);
+}
+
+void seaminphys (struct buf *bp)
+{
+}
+
+/*
+ * Catch an interrupt from the adaptor.
+ */
+void seaintr (int unit)
+{
+ adapter_t *z = &seadata[unit];
+
+ PRINT (("sea%d: interrupt status=%b\n", unit, *z->STATUS, STAT_BITS));
+ sea_start (z);
+}
+
+/*
+ * This routine is used in the case when we have no IRQ line (z->irq == 0).
+ * It is called every timer tick and polls for reconnect from target.
+ */
+void sea_tick (void *arg)
+{
+ adapter_t *z = arg;
+ int x = splbio ();
+
+ z->timeout_active = 0;
+ sea_start (z);
+ if (z->disconnected_queue && ! z->timeout_active) {
+ timeout (sea_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ splx (x);
+}
+
+/*
+ * Start a scsi operation given the command and the data address.
+ * Also needs the unit, target and lu. Get a free scb and set it up.
+ * Call send_scb. Either start timer or wait until done.
+ */
+int32_t sea_scsi_cmd (struct scsi_xfer *xs)
+{
+ int flags = xs->flags, x = 0;
+ adapter_t *z = (adapter_t *)xs->sc_link->adapter_softc;
+ scb_t *scb;
+
+ PRINT (("sea%d/%d/%d command 0x%x\n", unit, xs->sc_link->target,
+ xs->sc_link->lun, xs->cmd->opcode));
+ if (xs->bp)
+ flags |= SCSI_NOSLEEP;
+ if (flags & ITSDONE) {
+ printf ("sea%d: already done?", xs->sc_link->adapter_unit);
+ xs->flags &= ~ITSDONE;
+ }
+ if (! (flags & INUSE)) {
+ printf ("sea%d: not in use?", xs->sc_link->adapter_unit);
+ xs->flags |= INUSE;
+ }
+ if (flags & SCSI_RESET)
+ printf ("sea%d: SCSI_RESET not implemented\n",
+ xs->sc_link->adapter_unit);
+
+ if (! (flags & SCSI_NOMASK))
+ x = splbio ();
+
+ /* Get a free scb.
+ * If we can and have to, sleep waiting for one to come free. */
+ while (! (scb = z->free_scb)) {
+ if (flags & SCSI_NOSLEEP) {
+ xs->error = XS_DRIVER_STUFFUP;
+ if (! (flags & SCSI_NOMASK))
+ splx (x);
+ return (TRY_AGAIN_LATER);
+ }
+ tsleep ((caddr_t)&z->free_scb, PRIBIO, "seascb", 0);
+ }
+ /* Get scb from free list. */
+ z->free_scb = scb->next;
+ scb->next = 0;
+ scb->flags = SCB_ACTIVE;
+
+ /* Put all the arguments for the xfer in the scb */
+ scb->xfer = xs;
+ scb->datalen = xs->datalen;
+ scb->data = xs->data;
+
+ /* Setup the scb to contain necessary values.
+ * The interesting values can be read from the xs that is saved.
+ * I therefore think that the structure can be kept very small.
+ * The driver doesn't use DMA so the scatter/gather is not needed? */
+ if (! z->queue) {
+ scb->next = z->queue;
+ z->queue = scb;
+ } else {
+ scb_t *q;
+
+ for (q=z->queue; q->next; q=q->next)
+ continue;
+ q->next = scb;
+ scb->next = 0; /* placed at the end of the queue */
+ }
+
+ /* Try to send this command to the board. */
+ sea_start (z);
+
+ /* Usually return SUCCESSFULLY QUEUED. */
+ if (! (flags & SCSI_NOMASK)) {
+ splx (x);
+ if (xs->flags & ITSDONE)
+ /* Timeout timer not started, already finished.
+ * Tried to return COMPLETE but the machine hanged
+ * with this. */
+ return (SUCCESSFULLY_QUEUED);
+ xs->timeout_ch = timeout (sea_timeout, (caddr_t) scb,
+ (xs->timeout * hz) / 1000);
+ scb->flags |= SCB_TIMECHK;
+ PRINT (("sea%d/%d/%d command queued\n",
+ xs->sc_link->adapter_unit,
+ xs->sc_link->target, xs->sc_link->lun));
+ return (SUCCESSFULLY_QUEUED);
+ }
+
+ /* If we can't use interrupts, poll on completion. */
+ if (! sea_poll (z, scb)) {
+ /* We timed out, so call the timeout handler manually,
+ * accounting for the fact that the clock is not running yet
+ * by taking out the clock queue entry it makes. */
+ sea_timeout ((void*) scb);
+
+ /* Because we are polling, take out the timeout entry
+ * sea_timeout made. */
+ untimeout (sea_timeout, (void*) scb, xs->timeout_ch);
+
+ if (! sea_poll (z, scb))
+ /* We timed out again... This is bad. Notice that
+ * this time there is no clock queue entry to remove. */
+ sea_timeout ((void*) scb);
+ }
+ PRINT (("sea%d/%d/%d command %s\n", xs->sc_link->adapter_unit,
+ xs->sc_link->target, xs->sc_link->lun,
+ xs->error ? "failed" : "done"));
+ return (xs->error ? HAD_ERROR : COMPLETE);
+}
+
+/*
+ * Coroutine that runs as long as more work can be done.
+ * Both scsi_cmd() and intr() will try to start it in
+ * case it is not running.
+ * Always called with interrupts disabled.
+ */
+void sea_start (adapter_t *z)
+{
+ scb_t *q, *prev;
+again:
+ /* First check that if any device has tried
+ * a reconnect while we have done other things
+ * with interrupts disabled. */
+ if (sea_reselect (z))
+ goto again;
+
+ /* Search through the queue for a command
+ * destined for a target that's not busy. */
+ for (q=z->queue, prev=0; q; prev=q, q=q->next) {
+ /* Attempt to establish an I_T_L nexus here. */
+ if (IS_BUSY (z, q) || ! sea_select (z, q))
+ continue;
+
+ /* Remove the command from the issue queue. */
+ if (prev)
+ prev->next = q->next;
+ else
+ z->queue = q->next;
+ q->next = 0;
+
+ /* We are connected. Do the task. */
+ sea_information_transfer (z, q);
+ goto again;
+ }
+}
+
+void sea_timeout (void *arg)
+{
+ scb_t *scb = (scb_t*) arg;
+ adapter_t *z = (adapter_t *)scb->xfer->sc_link->adapter_softc;
+ int x = splbio ();
+
+ if (! (scb->xfer->flags & SCSI_NOMASK))
+ printf ("sea%d/%d/%d (%s%d) timed out\n",
+ scb->xfer->sc_link->adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ scb->xfer->sc_link->device->name,
+ scb->xfer->sc_link->dev_unit);
+
+ /* If it has been through before, then a previous abort has failed,
+ * don't try abort again. */
+ if (! (scb->flags & SCB_ABORTED)) {
+ sea_abort (z, scb);
+ /* 2 seconds for the abort */
+ scb->xfer->timeout_ch = timeout (sea_timeout,
+ (caddr_t)scb, 2*hz);
+ scb->flags |= (SCB_ABORTED | SCB_TIMECHK);
+ } else {
+ /* abort timed out */
+ scb->flags |= SCB_ABORTED;
+ scb->xfer->retries = 0;
+ sea_done (z, scb);
+ }
+ splx (x);
+}
+
+/*
+ * Wait until REQ goes down. This is needed for some devices (CDROMs)
+ * after every MSGOUT, MSGIN, CMDOUT, STATIN request.
+ * Return true if REQ deassert found.
+ */
+static __inline int sea_wait_for_req_deassert (adapter_t *z, int cnt, char *msg)
+{
+ __asm __volatile ("
+ 1: testb $0x10, %2
+ jz 2f
+ loop 1b
+ 2:"
+ : "=c" (cnt) /* output */
+ : "0" (cnt), "m" (*z->STATUS)); /* input */
+ if (! cnt) {
+ PRINT (("sea%d (%s) timeout waiting for !REQ\n",
+ z->sc_link.adapter_unit, msg));
+ return (0);
+ }
+ /* PRINT (("sea_wait_for_req_deassert %s count=%d\n", msg, cnt)); */
+ return (1);
+}
+
+/*
+ * Establish I_T_L or I_T_L_Q nexus for new or existing command
+ * including ARBITRATION, SELECTION, and initial message out
+ * for IDENTIFY and queue messages.
+ * Return 1 if selection succeded.
+ */
+int sea_select (volatile adapter_t *z, scb_t *scb)
+{
+ /* Start arbitration. */
+ *z->CONTROL = z->parity | CMD_INTR;
+ *z->DATA = z->scsi_id;
+ *z->CONTROL = CMD_START_ARB | z->parity;
+
+ /* Wait for arbitration to complete. */
+ WAITFOR (*z->STATUS & STAT_ARB_CMPL, "arbitration");
+ if (! (*z->STATUS & STAT_ARB_CMPL)) {
+ if (*z->STATUS & STAT_SEL) {
+ printf ("sea: arbitration lost\n");
+ scb->flags |= SCB_ERROR;
+ } else {
+ printf ("sea: arbitration timeout\n");
+ scb->flags |= SCB_TIMEOUT;
+ }
+ *z->CONTROL = CMD_INTR | z->parity;
+ return (0);
+ }
+ DELAY (1);
+
+ *z->DATA = (1 << scb->xfer->sc_link->target) | z->scsi_id;
+ *z->CONTROL = sea_select_cmd | CMD_SEL | z->parity;
+ DELAY (2);
+
+ /* Wait for a bsy from target.
+ * If the target is not present on the bus, we get
+ * the timeout. Don't PRINT any message -- it's not an error. */
+ WAITFOR (*z->STATUS & STAT_BSY, 0);
+ if (! (*z->STATUS & STAT_BSY)) {
+ /* The target does not respond. Not an error, though. */
+ PRINT (("sea%d/%d/%d target does not respond\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ *z->CONTROL = CMD_INTR | z->parity;
+ scb->flags |= SCB_TIMEOUT;
+ return (0);
+ }
+
+ /* Try to make the target to take a message from us.
+ * Should start a MSGOUT phase. */
+ *z->CONTROL = sea_select_cmd | z->parity;
+ DELAY (15);
+ WAITFOR (*z->STATUS & STAT_REQ, 0);
+
+ if (z->type == CTLR_FUTURE_DOMAIN)
+ *z->CONTROL = CMD_INTR | z->parity | CMD_DRVR_ENABLE;
+
+ WAITFOR (*z->STATUS & STAT_REQ, 0);
+ if (! (*z->STATUS & STAT_REQ)) {
+ PRINT (("sea%d/%d/%d timeout waiting for REQ\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ scb->flags |= SCB_ERROR;
+ *z->CONTROL = CMD_INTR | z->parity;
+ return (0);
+ }
+
+ /* Check for phase mismatch. FD 885 always seems to get this wrong! */
+ if ((*z->STATUS & PHASE_MASK) != PHASE_MSGOUT && z->type != CTLR_FUTURE_DOMAIN) {
+ PRINT (("sea%d/%d/%d waiting for MSGOUT: invalid phase %s\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ PHASE_NAME (*z->STATUS & PHASE_MASK)));
+ scb->flags |= SCB_ERROR;
+ *z->CONTROL = CMD_INTR | z->parity;
+ return (0);
+ }
+
+ /* Allow disconnects. (except for FD controllers) */
+ if (z->type == CTLR_SEAGATE) {
+ *z->CONTROL = CMD_DRVR_ENABLE | z->parity;
+ *z->DATA = MSG_IDENTIFY (scb->xfer->sc_link->lun);
+ WAITREQ (&z->target[scb->xfer->sc_link->target], msgout, 1000);
+ }
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | z->parity;
+
+ SET_BUSY (z, scb);
+ return (1);
+}
+
+int sea_reselect (adapter_t *z)
+{
+ scb_t *q = 0, *prev = 0;
+ u_char msg, target_mask, lun;
+again:
+ /* Wait for a device to win the reselection phase. */
+ /* Signals this by asserting the I/O signal. */
+ if ((*z->STATUS & (STAT_SEL | STAT_IO | STAT_BSY)) !=
+ (STAT_SEL | STAT_IO))
+ return (0);
+
+ /* The data bus contains original initiator id ORed with target id. */
+ /* See that we really are the initiator. */
+ target_mask = *z->DATA;
+ if (! (target_mask & z->scsi_id)) {
+ PRINT (("sea%d reselect not for me: mask=0x%x, status=%b\n",
+ z->sc_link.adapter_unit, target_mask,
+ *z->STATUS, STAT_BITS));
+ goto again;
+ }
+
+ /* Find target who won. */
+ /* Host responds by asserting the BSY signal. */
+ /* Target should respond by deasserting the SEL signal. */
+ target_mask &= ~z->scsi_id;
+ *z->CONTROL = CMD_DRVR_ENABLE | CMD_BSY | z->parity | CMD_INTR;
+ WAITFOR (! (*z->STATUS & STAT_SEL), "reselection acknowledge");
+
+ /* Remove the busy status. */
+ /* Target should set the MSGIN phase. */
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | z->parity;
+ WAITFOR (*z->STATUS & STAT_REQ, "identify message");
+
+ /* Hope we get an IDENTIFY message. */
+ msg = sea_msg_input (z);
+ if (MSG_ISIDENT (msg)) {
+ /* Find the command corresponding to the I_T_L or I_T_L_Q
+ * nexus we just restablished, and remove it from
+ * the disconnected queue. */
+ lun = (msg & 7);
+ for (q=z->disconnected_queue; q; prev=q, q=q->next) {
+ if (target_mask != (1 << q->xfer->sc_link->target))
+ continue;
+ if (lun != q->xfer->sc_link->lun)
+ continue;
+ if (prev)
+ prev->next = q->next;
+ else
+ z->disconnected_queue = q->next;
+ q->next = 0;
+ PRINT (("sea%d/%d/%d reselect done\n",
+ z->sc_link.adapter_unit,
+ ffs (target_mask) - 1, lun));
+ sea_information_transfer (z, q);
+ WAITFOR (! (*z->STATUS & STAT_BSY), "reselect !busy");
+ return (1);
+ }
+ } else
+ printf ("sea%d reselect: expecting IDENTIFY, got 0x%x\n",
+ z->sc_link.adapter_unit, msg);
+
+ /* Since we have an established nexus that we can't
+ * do anything with, we must abort it. */
+ sea_send_abort (z);
+ PRINT (("sea%d reselect aborted\n", z->sc_link.adapter_unit));
+ WAITFOR (! (*z->STATUS & STAT_BSY), "bus free after reselect abort");
+ goto again;
+}
+
+/*
+ * Send an abort to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int sea_abort (adapter_t *z, scb_t *scb)
+{
+ scb_t *q, **prev;
+
+ /* If the command hasn't been issued yet, we simply remove it
+ * from the issue queue. */
+ prev = &z->queue;
+ for (q=z->queue; q; q=q->next) {
+ if (scb == q) {
+ (*prev) = q->next;
+ q->next = 0;
+ return (1);
+ }
+ prev = &q->next;
+ }
+
+ /* If the command is currently disconnected from the bus,
+ * we reconnect the I_T_L or I_T_L_Q nexus associated with it,
+ * go into message out, and send an abort message. */
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb != q)
+ continue;
+
+ if (! sea_select (z, scb))
+ return (0);
+ sea_send_abort (z);
+
+ prev = &z->disconnected_queue;
+ for (q=z->disconnected_queue; q; q=q->next) {
+ if (scb == q) {
+ *prev = q->next;
+ q->next = 0;
+ /* Set some type of error result
+ * for the operation. */
+ return (1);
+ }
+ prev = &q->next;
+ }
+ }
+
+ /* Command not found in any queue. */
+ return (0);
+}
+
+/*
+ * The task accomplished, mark the i/o control block as done.
+ * Always called with interrupts disabled.
+ */
+void sea_done (adapter_t *z, scb_t *scb)
+{
+ struct scsi_xfer *xs = scb->xfer;
+
+ if (scb->flags & SCB_TIMECHK)
+ untimeout (sea_timeout, (caddr_t) scb, xs->timeout_ch);
+
+ /* How much of the buffer was not touched. */
+ xs->resid = scb->datalen;
+
+ if (scb->flags != SCB_ACTIVE && ! (xs->flags & SCSI_ERR_OK))
+ if (scb->flags & (SCB_TIMEOUT | SCB_ABORTED))
+ xs->error = XS_TIMEOUT;
+ else if (scb->flags & SCB_ERROR)
+ xs->error = XS_DRIVER_STUFFUP;
+ else if (scb->flags & SCB_TBUSY)
+ xs->error = XS_BUSY;
+ else if (scb->flags & SCB_SENSE)
+ xs->error = XS_SENSE;
+
+ xs->flags |= ITSDONE;
+
+ /* Free the control block. */
+ scb->next = z->free_scb;
+ z->free_scb = scb;
+ scb->flags = SCB_FREE;
+
+ /* If there were none, wake anybody waiting for one to come free,
+ * starting with queued entries. */
+ if (! scb->next)
+ wakeup ((caddr_t) &z->free_scb);
+
+ scsi_done (xs);
+}
+
+/*
+ * Wait for completion of command in polled mode.
+ * Always called with interrupts masked out.
+ */
+int sea_poll (adapter_t *z, scb_t *scb)
+{
+ int count;
+
+ for (count=0; count<30; ++count) {
+ DELAY (1000); /* delay for a while */
+ sea_start (z); /* retry operation */
+ if (scb->xfer->flags & ITSDONE)
+ return (1); /* all is done */
+ if (scb->flags & SCB_TIMEOUT)
+ return (0); /* no target present */
+ }
+ return (0);
+}
+
+/*
+ * Send data to the target.
+ */
+void sea_data_output (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ volatile u_char *data = *pdata;
+ volatile u_int len = *plen;
+
+#ifdef SEA_BLINDTRANSFER
+ if (len && !(len % BLOCK_SIZE)) {
+ while (len) {
+ WAITFOR10 (*z->STATUS & STAT_REQ, "blind block read");
+ __asm __volatile ("
+ shr $2, %%ecx;
+ cld;
+ rep;
+ movsl; " : :
+ "D" (z->DATA), "S" (data), "c" (BLOCK_SIZE) :
+ "cx", "si", "di" );
+ data += BLOCK_SIZE;
+ len -= BLOCK_SIZE;
+ }
+ } else {
+#endif
+ __asm __volatile ("cld
+ 1: movb (%%ebx), %%al
+ xorb $1, %%al
+ testb $0xf, %%al
+ jnz 2f
+ testb $0x10, %%al
+ jz 1b
+ lodsb
+ movb %%al, (%%edi)
+ loop 1b
+ 2:"
+ : "=S" (data), "=c" (len) /* output */
+ : "D" (z->DATA), "b" (z->STATUS), /* input */
+ "0" (data), "1" (len)
+ : "eax", "ebx", "edi"); /* clobbered */
+#ifdef SEA_BLINDTRANSFER
+ }
+#endif
+ PRINT (("sea (DATAOUT) send %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = (u_char *)data;
+}
+
+/*
+ * Receive data from the target.
+ */
+void sea_data_input (adapter_t *z, u_char **pdata, u_long *plen)
+{
+ volatile u_char *data = *pdata;
+ volatile u_int len = *plen;
+
+#ifdef SEA_BLINDTRANSFER
+ if (len && !(len % BLOCK_SIZE)) {
+ while (len) {
+ WAITFOR10 (*z->STATUS & STAT_REQ, "blind block read");
+ __asm __volatile ("
+ shr $2, %%ecx;
+ cld;
+ rep;
+ movsl; " : :
+ "S" (z->DATA), "D" (data), "c" (BLOCK_SIZE) :
+ "cx", "si", "di" );
+ data += BLOCK_SIZE;
+ len -= BLOCK_SIZE;
+ }
+ } else {
+#endif
+ if (len >= 512) {
+ __asm __volatile (" cld
+ 1: movb (%%esi), %%al
+ xorb $5, %%al
+ testb $0xf, %%al
+ jnz 2f
+ testb $0x10, %%al
+ jz 1b
+ movb (%%ebx), %%al
+ stosb
+ loop 1b
+ 2:"
+ : "=D" (data), "=c" (len) /* output */
+ : "b" (z->DATA), "S" (z->STATUS),
+ "0" (data), "1" (len) /* input */
+ : "eax", "ebx", "esi"); /* clobbered */
+ } else {
+ __asm __volatile (" cld
+ 1: movb (%%esi), %%al
+ xorb $5, %%al
+ testb $0xf, %%al
+ jnz 2f
+ testb $0x10, %%al
+ jz 1b
+ movb (%%ebx), %%al
+ stosb
+ movb $1000, %%al
+ 3: testb $0x10, (%%esi)
+ jz 4f
+ dec %%al
+ jnz 3b
+ 4: loop 1b
+ 2:"
+ : "=D" (data), "=c" (len) /* output */
+ : "b" (z->DATA), "S" (z->STATUS),
+ "0" (data), "1" (len) /* input */
+ : "eax", "ebx", "esi"); /* clobbered */
+ }
+#ifdef SEA_BLINDTRANSFER
+ }
+#endif
+ PRINT (("sea (DATAIN) got %ld bytes\n", *plen - len));
+ *plen = len;
+ *pdata = (u_char *)data;
+}
+
+/*
+ * Send the command to the target.
+ */
+void sea_cmd_output (target_t *t, u_char *cmd, int cmdlen)
+{
+ adapter_t *z = t->adapter;
+
+ PRINT (("sea%d send command (%d bytes) ", z->sc_link.adapter_unit,
+ cmdlen));
+
+ PRINT (("%x", *cmd));
+ *z->DATA = *cmd++;
+ if (z->type == CTLR_SEAGATE)
+ WAITREQ (t, cmdout1, 10000);
+ --cmdlen;
+
+ while (cmdlen) {
+ /* Check for target disconnect. */
+ u_char sts = *z->STATUS;
+ if (! (sts & STAT_BSY))
+ break;
+
+ /* Check for phase mismatch. FD 885 seems to get this wrong! */
+ if ((sts & PHASE_MASK) != PHASE_CMDOUT && z->type != CTLR_FUTURE_DOMAIN) {
+ printf ("sea: sea_cmd_output: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ return;
+ }
+
+ /* Wait for REQ. */
+ if (! (sts & STAT_REQ))
+ continue;
+
+ PRINT (("-%x", *cmd));
+ *z->DATA = *cmd++;
+ if (z->type == CTLR_SEAGATE)
+ WAITREQ (t, cmdout, 1000);
+ --cmdlen;
+ }
+ PRINT (("\n"));
+}
+
+/*
+ * Send the message to the target.
+ */
+void sea_send_abort (adapter_t *z)
+{
+ u_char sts;
+
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | CMD_ATTN | z->parity;
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (*z->STATUS & STAT_REQ, "abort message");
+ sts = *z->STATUS;
+ if (! (sts & STAT_REQ))
+ goto ret;
+
+ /* Check for phase mismatch. */
+ if ((sts & PHASE_MASK) != PHASE_MSGOUT) {
+ printf ("sea: sending MSG_ABORT: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ goto ret;
+ }
+
+ *z->DATA = MSG_ABORT;
+ sea_wait_for_req_deassert (z, 1000, "MSG_OUTPUT");
+ PRINT (("sea%d send abort message\n", z->sc_link.adapter_unit));
+ret:
+ *z->CONTROL = CMD_INTR | CMD_DRVR_ENABLE | z->parity;
+}
+
+/*
+ * Get the message from the target.
+ * Return the length of the received message.
+ */
+u_char sea_msg_input (adapter_t *z)
+{
+ u_char sts, msg;
+
+ /* Wait for REQ, after which the phase bits will be valid. */
+ WAITFOR (*z->STATUS & STAT_REQ, "message input");
+ sts = *z->STATUS;
+ if (! (sts & STAT_REQ))
+ return (MSG_ABORT);
+
+ /* Check for phase mismatch.
+ * Reached if the target decides that it has finished the transfer. */
+ if ((sts & PHASE_MASK) != PHASE_MSGIN) {
+ printf ("sea: sea_msg_input: invalid phase %s\n",
+ PHASE_NAME (sts & PHASE_MASK));
+ return (MSG_ABORT);
+ }
+
+ /* Do actual transfer from SCSI bus to/from memory. */
+ msg = *z->DATA;
+ sea_wait_for_req_deassert (z, 1000, "MSG_INPUT");
+ PRINT (("sea%d (MSG_INPUT) got 0x%x\n", z->sc_link.adapter_unit, msg));
+ return (msg);
+}
+
+/*
+ * Send request-sense op to the target.
+ * Return 1 success, 0 on failure.
+ * Called on splbio level.
+ */
+int sea_sense (adapter_t *z, scb_t *scb)
+{
+ u_char cmd[6], status, msg, *data;
+ u_long len;
+
+ /* Wait for target to disconnect. */
+ WAITFOR (! (*z->STATUS & STAT_BSY), "sense bus free");
+ if (*z->STATUS & STAT_BSY)
+ return (0);
+
+ /* Select the target again. */
+ if (! sea_select (z, scb))
+ return (0);
+
+ /* Wait for CMDOUT phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense CMDOUT");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_CMDOUT)
+ return (0);
+
+ /* Send command. */
+ len = sizeof (scb->xfer->sense);
+ cmd[0] = REQUEST_SENSE;
+ cmd[1] = scb->xfer->sc_link->lun << 5;
+ cmd[2] = 0;
+ cmd[3] = 0;
+ cmd[4] = len;
+ cmd[5] = 0;
+ sea_cmd_output (&z->target[scb->xfer->sc_link->target],
+ cmd, sizeof (cmd));
+
+ /* Wait for DATAIN phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense DATAIN");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_DATAIN)
+ return (0);
+
+ data = (u_char*) &scb->xfer->sense;
+ sea_data_input (z, &data, &len);
+ PRINT (("sea%d sense %x-%x-%x-%x-%x-%x-%x-%x\n",
+ z->sc_link.adapter_unit, scb->xfer->sense.error_code,
+ scb->xfer->sense.ext.extended.segment,
+ scb->xfer->sense.ext.extended.flags,
+ scb->xfer->sense.ext.extended.info[0],
+ scb->xfer->sense.ext.extended.info[1],
+ scb->xfer->sense.ext.extended.info[2],
+ scb->xfer->sense.ext.extended.info[3],
+ scb->xfer->sense.ext.extended.extra_len));
+
+ /* Wait for STATIN phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense STATIN");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_STATIN)
+ return (0);
+
+ status = *z->DATA;
+
+ /* Wait for MSGIN phase. */
+ WAITFOR (*z->STATUS & STAT_REQ, "sense MSGIN");
+ if (! (*z->STATUS & STAT_REQ) ||
+ (*z->STATUS & PHASE_MASK) != PHASE_MSGIN)
+ return (0);
+
+ msg = *z->DATA;
+
+ if (status != 0 || msg != 0)
+ printf ("sea%d: bad sense status=0x%x, msg=0x%x\n",
+ z->sc_link.adapter_unit, status, msg);
+ return (1);
+}
+
+/*
+ * Do the transfer. We know we are connected. Update the flags,
+ * call sea_done when task accomplished. Dialog controlled by the target.
+ * Always called with interrupts disabled.
+ */
+void sea_information_transfer (adapter_t *z, scb_t *scb)
+{
+ u_char *data = scb->data; /* current data buffer */
+ u_long datalen = scb->datalen; /* current data transfer size */
+ target_t *t = &z->target[scb->xfer->sc_link->target];
+ register u_char sts;
+ u_char msg;
+
+ while ((sts = *z->STATUS) & STAT_BSY) {
+ /* We only have a valid SCSI phase when REQ is asserted. */
+ if (! (sts & STAT_REQ))
+ continue;
+ if (sts & STAT_PARITY) {
+ int target = scb->xfer->sc_link->target;
+ if (++z->target[target].perrcnt <= 8)
+ printf ("sea%d/%d/%d parity error\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ if (z->target[target].perrcnt == 8)
+ printf ("sea%d/%d/%d too many parity errors, not logging any more\n",
+ z->sc_link.adapter_unit, target,
+ scb->xfer->sc_link->lun);
+ }
+ switch (sts & PHASE_MASK) {
+ case PHASE_DATAOUT:
+ if (datalen <= 0) {
+ printf ("sea%d/%d/%d data length underflow\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ /* send zero byte */
+ *z->DATA = 0;
+ break;
+ }
+ sea_data_output (z, &data, &datalen);
+ break;
+ case PHASE_DATAIN:
+ if (datalen <= 0) {
+ /* Get extra data. Some devices (e.g. CDROMs)
+ * use fixed-length blocks (e.g. 2k),
+ * even if we need less. */
+ PRINT (("@"));
+ sts = *z->DATA;
+ break;
+ }
+ sea_data_input (z, &data, &datalen);
+ break;
+ case PHASE_CMDOUT:
+ sea_cmd_output (t, (u_char*) scb->xfer->cmd,
+ scb->xfer->cmdlen);
+ break;
+ case PHASE_STATIN:
+ scb->xfer->status = *z->DATA;
+ if (z->type == CTLR_SEAGATE)
+ WAITREQ (t, statin, 2000);
+ PRINT (("sea%d/%d/%d (STATIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun,
+ (u_char) scb->xfer->status));
+ break;
+ case PHASE_MSGOUT:
+ /* Send no-op message. */
+ *z->DATA = MSG_NOP;
+ sea_wait_for_req_deassert (z, 1000, "MSGOUT");
+ PRINT (("sea%d/%d/%d (MSGOUT) send NOP\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ break;
+ case PHASE_MSGIN:
+ /* Don't handle multi-byte messages here, because they
+ * should not be present here. */
+ msg = *z->DATA;
+ sea_wait_for_req_deassert (z, 2000, "MSGIN");
+ PRINT (("sea%d/%d/%d (MSGIN) got 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg));
+ switch (msg) {
+ case MSG_COMMAND_COMPLETE:
+ scb->data = data;
+ scb->datalen = datalen;
+ /* In the case of check-condition status,
+ * perform the request-sense op. */
+ switch (scb->xfer->status & 0x1e) {
+ case SCSI_CHECK:
+ if (sea_sense (z, scb))
+ scb->flags = SCB_SENSE;
+ break;
+ case SCSI_BUSY:
+ scb->flags = SCB_TBUSY;
+ break;
+ }
+ goto done;
+ case MSG_ABORT:
+ printf ("sea: command aborted by target\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_MESSAGE_REJECT:
+ printf ("sea: message rejected\n");
+ scb->flags = SCB_ABORTED;
+ goto done;
+ case MSG_DISCONNECT:
+ scb->next = z->disconnected_queue;
+ z->disconnected_queue = scb;
+ if (! z->irq && ! z->timeout_active) {
+ timeout (sea_tick, z, 1);
+ z->timeout_active = 1;
+ }
+ PRINT (("sea%d/%d/%d disconnected\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun));
+ goto ret;
+ case MSG_SAVE_POINTERS:
+ scb->data = data;
+ scb->datalen = datalen;
+ break;
+ case MSG_RESTORE_POINTERS:
+ data = scb->data;
+ datalen = scb->datalen;
+ break;
+ default:
+ printf ("sea%d/%d/%d unknown message: 0x%x\n",
+ z->sc_link.adapter_unit,
+ scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun, msg);
+ break;
+ }
+ break;
+ default:
+ printf ("sea: unknown phase: %b\n", sts, STAT_BITS);
+ break;
+ }
+ }
+ printf ("sea%d/%d/%d unexpected target disconnect\n",
+ z->sc_link.adapter_unit, scb->xfer->sc_link->target,
+ scb->xfer->sc_link->lun);
+ scb->flags = SCB_ERROR;
+done:
+ CLEAR_BUSY (z, scb);
+ sea_done (z, scb);
+ret:
+ *z->CONTROL = CMD_INTR | z->parity;
+}
+#endif /* NSEA */
diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c
index 230e387267610..4f91d8a443303 100644
--- a/sys/i386/isa/si.c
+++ b/sys/i386/isa/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.77 1998/08/23 10:12:12 bde Exp $
+ * $Id: si.c,v 1.76 1998/08/23 08:26:40 bde Exp $
*/
#ifndef lint
@@ -133,7 +133,7 @@ static u_long sipcieisacount = 0;
#if NPCI > 0
-static const char *sipciprobe __P((pcici_t, pcidi_t));
+static char *sipciprobe __P((pcici_t, pcidi_t));
static void sipciattach __P((pcici_t, int));
static struct pci_device sipcidev = {
@@ -316,7 +316,7 @@ static char *si_type[] = {
#if NPCI > 0
-static const char *
+static char *
sipciprobe(configid, deviceid)
pcici_t configid;
pcidi_t deviceid;
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index 7660965a930af..b0ad5fc67eea6 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.223 1999/01/12 01:04:37 eivind Exp $
+ * $Id: sio.c,v 1.214 1998/08/23 10:16:26 bde Exp $
*/
#include "opt_comconsole.h"
@@ -70,9 +70,6 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
@@ -86,7 +83,6 @@
#include "card.h"
#if NCARD > 0
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -314,7 +310,6 @@ static int sioattach __P((struct isa_device *dev));
static timeout_t siobusycheck;
static timeout_t siodtrwakeup;
static void comhardclose __P((struct com_s *com));
-static ointhand2_t siointr;
static void siointr1 __P((struct com_s *com));
static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
@@ -326,6 +321,9 @@ static timeout_t comwakeup;
static void disc_optim __P((struct tty *tp, struct termios *t,
struct com_s *com));
+#ifdef DSI_SOFT_MODEM
+static int LoadSoftModem __P((int unit,int base_io, u_long size, u_char *ptr));
+#endif /* DSI_SOFT_MODEM */
static char driver_name[] = "sio";
@@ -466,7 +464,17 @@ static int sioinit __P((struct pccard_devinfo *));
static void siounload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(sio, sioinit, siounload, card_intr, 0, tty_imask);
+static struct pccard_device sio_info = {
+ driver_name,
+ sioinit,
+ siounload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &tty_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, sio_info);
/*
* Initialize the device - called from Slot manager.
@@ -873,7 +881,6 @@ sioattach(isdp)
int s;
int unit;
- isdp->id_ointr = siointr;
isdp->id_ri_flags |= RI_FAST;
iobase = isdp->id_iobase;
unit = isdp->id_unit;
@@ -942,6 +949,12 @@ sioattach(isdp)
/* attempt to determine UART type */
printf("sio%d: type", unit);
+#ifdef DSI_SOFT_MODEM
+ if((inb(iobase+7) ^ inb(iobase+7)) & 0x80) {
+ printf(" Digicom Systems, Inc. SoftModem");
+ goto determined_type;
+ }
+#endif /* DSI_SOFT_MODEM */
#ifdef COM_MULTIPORT
if (!COM_ISMULTIPORT(isdp) && !COM_IIR_TXRDYBUG(isdp))
@@ -1456,7 +1469,7 @@ siodtrwakeup(chan)
wakeup(&com->dtr_wait);
}
-static void
+void
siointr(unit)
int unit;
{
@@ -1506,6 +1519,7 @@ siointr1(com)
u_char modem_status;
u_char *ioptr;
u_char recv_data;
+ u_char int_ident;
u_char int_ctl;
u_char int_ctl_new;
@@ -1729,6 +1743,34 @@ sioioctl(dev, cmd, data, flag, p)
case TIOCGWINSZ:
bzero(data, sizeof(struct winsize));
return (0);
+#ifdef DSI_SOFT_MODEM
+ /*
+ * Download micro-code to Digicom modem.
+ */
+ case TIOCDSIMICROCODE:
+ {
+ u_long l;
+ u_char *p,*pi;
+
+ pi = (u_char*)(*(caddr_t*)data);
+ error = copyin(pi,&l,sizeof l);
+ if(error)
+ {return error;};
+ pi += sizeof l;
+
+ p = malloc(l,M_TEMP,M_NOWAIT);
+ if(!p)
+ {return ENOBUFS;}
+ error = copyin(pi,p,l);
+ if(error)
+ {free(p,M_TEMP); return error;};
+ if(error = LoadSoftModem(
+ MINOR_TO_UNIT(mynor),iobase,l,p))
+ {free(p,M_TEMP); return error;}
+ free(p,M_TEMP);
+ return(0);
+ }
+#endif /* DSI_SOFT_MODEM */
default:
return (ENOTTY);
}
@@ -1993,9 +2035,11 @@ comparam(tp, t)
int divisor;
u_char dlbh;
u_char dlbl;
+ int error;
Port_t iobase;
int s;
int unit;
+ int txtimeout;
/* do historical conversions */
if (t->c_ispeed == 0)
@@ -2061,8 +2105,54 @@ comparam(tp, t)
outb(iobase + com_fifo, com->fifo_image);
}
+ /*
+ * Some UARTs lock up if the divisor latch registers are selected
+ * while the UART is doing output (they refuse to transmit anything
+ * more until given a hard reset). Fix this by stopping filling
+ * the device buffers and waiting for them to drain. Reading the
+ * line status port outside of siointr1() might lose some receiver
+ * error bits, but that is acceptable here.
+ */
+ disable_intr();
+retry:
+ com->state &= ~CS_TTGO;
+ txtimeout = tp->t_timeout;
+ enable_intr();
+ while ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY)) {
+ tp->t_state |= TS_SO_OCOMPLETE;
+ error = ttysleep(tp, TSA_OCOMPLETE(tp), TTIPRI | PCATCH,
+ "siotx", hz / 100);
+ if ( txtimeout != 0
+ && (!error || error == EAGAIN)
+ && (txtimeout -= hz / 100) <= 0
+ )
+ error = EIO;
+ if (com->gone)
+ error = ENODEV;
+ if (error != 0 && error != EAGAIN) {
+ if (!(tp->t_state & TS_TTSTOP)) {
+ disable_intr();
+ com->state |= CS_TTGO;
+ enable_intr();
+ }
+ splx(s);
+ return (error);
+ }
+ }
+
disable_intr(); /* very important while com_data is hidden */
+ /*
+ * XXX - clearing CS_TTGO is not sufficient to stop further output,
+ * because siopoll() calls comstart() which usually sets it again
+ * because TS_TTSTOP is clear. Setting TS_TTSTOP would not be
+ * sufficient, for similar reasons.
+ */
+ if ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY))
+ goto retry;
+
if (divisor != 0) {
outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
/*
@@ -2254,6 +2344,7 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_XMT_RST | com->fifo_image);
com->obufs[0].l_queued = FALSE;
@@ -2269,6 +2360,7 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_RCV_RST | com->fifo_image);
com_events -= (com->iptr - com->ibuf);
@@ -2479,18 +2571,6 @@ static void siocnclose __P((struct siocnstate *sp));
static void siocnopen __P((struct siocnstate *sp));
static void siocntxwait __P((void));
-/*
- * XXX: sciocnget() and sciocnputc() are not declared static, as they are
- * referred to from i386/i386/i386-gdbstub.c.
- */
-static cn_probe_t siocnprobe;
-static cn_init_t siocninit;
-static cn_checkc_t siocncheckc;
- cn_getc_t siocngetc;
- cn_putc_t siocnputc;
-
-CONS_DRIVER(sio, siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc);
-
static void
siocntxwait()
{
@@ -2612,7 +2692,7 @@ siocnclose(sp)
outb(iobase + com_ier, sp->ier);
}
-static void
+void
siocnprobe(cp)
struct consdev *cp;
{
@@ -2678,14 +2758,14 @@ siocnprobe(cp)
}
}
-static void
+void
siocninit(cp)
struct consdev *cp;
{
comconsole = DEV_TO_UNIT(cp->cn_dev);
}
-static int
+int
siocncheckc(dev)
dev_t dev;
{
@@ -2743,6 +2823,126 @@ siocnputc(dev, c)
splx(s);
}
+#ifdef DSI_SOFT_MODEM
+/*
+ * The magic code to download microcode to a "Connection 14.4+Fax"
+ * modem from Digicom Systems Inc. Very magic.
+ */
+
+#define DSI_ERROR(str) { ptr = str; goto error; }
+static int
+LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr)
+{
+ int int_c,int_k;
+ int data_0188, data_0187;
+
+ /*
+ * First see if it is a DSI SoftModem
+ */
+ if(!((inb(base_io+7) ^ inb(base_io+7)) & 0x80))
+ return ENODEV;
+
+ data_0188 = inb(base_io+4);
+ data_0187 = inb(base_io+3);
+ outb(base_io+3,0x80);
+ outb(base_io+4,0x0C);
+ outb(base_io+0,0x31);
+ outb(base_io+1,0x8C);
+ outb(base_io+7,0x10);
+ outb(base_io+7,0x19);
+
+ if(0x18 != (inb(base_io+7) & 0x1A))
+ DSI_ERROR("dsp bus not granted");
+
+ if(0x01 != (inb(base_io+7) & 0x01)) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x01 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program mem not granted");
+ }
+
+ int_c = 0;
+
+ while(1) {
+ if(int_c >= 7 || size <= 0x1800)
+ break;
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+ int_c++;
+ }
+
+ if(size > 0x1800) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+
+ while(size > 0x1800) {
+ for(int_k = 0 ; int_k < 0xC00; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ size -= 0x1800;
+ }
+
+ if(size < 0x1800) {
+ for(int_k=0;int_k<size/2;int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+
+ } else if (size > 0) {
+ if(int_c == 7) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ } else {
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+ }
+ outb(base_io+7,0x11);
+ outb(base_io+7,3);
+
+ outb(base_io+4,data_0188 & 0xfb);
+
+ outb(base_io+3,data_0187);
+
+ return 0;
+error:
+ printf("sio%d: DSI SoftModem microcode load failed: <%s>\n",unit,ptr);
+ outb(base_io+7,0x00); \
+ outb(base_io+3,data_0187); \
+ outb(base_io+4,data_0188); \
+ return EIO;
+}
+#endif /* DSI_SOFT_MODEM */
/*
* support PnP cards if we are using 'em
@@ -2820,7 +3020,7 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = siointr;
+ dev->id_intr = siointr;
dev->id_ri_flags = RI_FAST;
dev->id_drq = -1;
diff --git a/sys/i386/isa/sioreg.h b/sys/i386/isa/sioreg.h
index bec807b0de420..4a0c4cf87d8e1 100644
--- a/sys/i386/isa/sioreg.h
+++ b/sys/i386/isa/sioreg.h
@@ -31,15 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
- * $Id: sioreg.h,v 1.10 1997/06/04 16:25:15 pst Exp $
+ * $Id: sioreg.h,v 1.9 1997/06/04 04:52:40 pst Exp $
*/
/* 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier) */
#define COMBRD(x) (1843200 / (16*(x)))
-#ifdef PC98
-#define COMBRD_RSA(x) (14745600 / (16*(x)))
-#endif
/* interrupt enable register */
#define IER_ERXRDY 0x1
@@ -109,16 +106,6 @@
#define MSR_DDSR 0x02
#define MSR_DCTS 0x01
-#ifdef PC98
-/* Hardware extension mode register for RSB-2000/3000. */
-#define EMR_EXBUFF 0x04
-#define EMR_CTSFLW 0x08
-#define EMR_DSRFLW 0x10
-#define EMR_RTSFLW 0x20
-#define EMR_DTRFLW 0x40
-#define EMR_EFMODE 0x80
-#endif
-
/* speed to initialize to during chip tests */
#define SIO_TEST_SPEED 9600
diff --git a/sys/i386/isa/snd/CARDS b/sys/i386/isa/snd/CARDS
index 5757be3f14c4a..91ca79b682297 100644
--- a/sys/i386/isa/snd/CARDS
+++ b/sys/i386/isa/snd/CARDS
@@ -1,97 +1,37 @@
-In this file I will try to build a database of cards supported by
-this driver. I also include the command to use for manual configuration
-of the card in case your BIOS is not PnP-aware. Of course it is
-your responsibility to pick up free port ranges and irq and drq
-channels.
+In this file I will try to build a database of cards supported by this
+driver. I also include the command to use for manual configuration of
+the card in case your BIOS is not PnP-aware. Of course it is your
+responsibility to pick up free prot ranges and irq and drq channels.
For PnP cards, I also include the vendor_id and serial numbers of
-cards I have encountered. Underscores in the PnP id mean that
-(I believe) there is a large variety of values in those positions,
-and the code in the audio driver generally masks those bits.
+cards I have encountered. Underscores in the PnP id mean that there is
+a large variety of values in those positions.
Finally, where available, I have put the URL where you can find the
data sheets of the chip.
-To my knowledge, there are the following families of audio cards:
-
-* WSS (also called MSS) and clones:
- these are true full duplex cards, have a very nice architecture and
- are well documented. Chipsets implementing these functionalities
- are made from Crystal, Analog Devices, Yamaha, OPTI.
-
-* SB16 and clones:
- these cards have a higly asymmetric architecture, and are not very
- well suited to full duplex operation. Made by Creative, Realtek.
- There is no documentation on the newer codecs (Vibra16X and ALS100+),
- so they are not fully working.
-
-* ESS
- ESS builds cards that implement a superset of SB16. They are
- often capable of full duplex, but my driver does not support them
- other than in full duplex emulation. My fault, since documentation
- on these cards _is_ available.
-
-* PCI cards.
- There are a quite few PCI audio cards around based on a number of
- different chipsets. Some of them are documented (e.g. S3 Sonic
- Vibes, Ensoniq ES1370), some are not (e.g. Yamaha YMF724),
- work is in progress to support such cards. See the notes below.
- Note that CreativeLabs has recently (fall'97) acquired Ensoniq
- and the audio division of OPTI, both of which had a PCI audio
- chipset. I don't know if there are other manufacturers of PCI
- audio cards.
-
-Finally, some people wrote patches for the following chips:
-
- AD1816
- MAD16
- ESS
---------------------------
-CHIPSET:
- CS4235: PnP id 0x25__630e
- CS4236: PnP id 0x36__630e 0x35__630e
- CS4237: PnP id 0x37__630e
-MANUFACTURER:
- A/Open (or AcerOpen) AW32, AW35, AW37
- Also, integrated on the motherboard on some machines.
-
-DATA SHEETS:
+CS4236B: PnP id 0x35__630e
+CS4236: PnP id 0x36__630e
+CS4237: PnP id 0x37__630e
+
http://www.crystal.com/ 4237full.pdf
-PNP CONFIG:
pnp 1 0 os enable port0 0x534 port2 0x220 irq0 5 drq0 1 drq1 3
-COMMENTS:
- Work like a charm. All modes, including full duplex, supported in
+ work like a charm. All modes, including full duplex, supported in
MSS mode.
- Cards based on the 4237, and possibly the 4236 as well, connect
- the CD to AUX2. When used in MODE1/2 (as this driver does)
- there is no route in the input mixer from AUX2 to the ADC. So,
- to record directly from the CD, the only way is to set the
- input to SOUND_MASK_IMIX.
-
- Some machines with the cs4235 in non-pnp mode map the codec at 0x530
- instead of 0x534. For those machines you need an unusual config line
-
- device pcm0 at isa ? port 0x52C ...
+ NOTE: cards based on the 4237, and possibly the 4236 as well,
+ connect the CD to AUX2. When used in MODE1/2 (as this driver
+ does) there is no route in the input mixer from AUX2 to the
+ ADC. So, to record directly from the CD, the only way is
+ to set the input to SOUND_MASK_IMIX.
+CS4232: PnP id 0x3242630e
---------------------------
-CHIPSET:
- CS4232: PnP id 0x3242630e
-
-MANUFACTURER:
- ???
-
-DATA SHEETS:
- http://www.crystal.com/
-
-PNP CONFIG:
pnp 1 0 os enable port0 0x534 port2 0x220 irq0 5 drq0 1 drq1 3
-COMMENTS:
This chip is reported as broken in the OSS documentation. As a
matter of fact, on my Intel Zappa motherboard, I have problems in
make it use the secondary DMA channel. I have it working in
@@ -101,31 +41,10 @@ COMMENTS:
--------------------------
CHIPSET:
- AD1815/1816
-
-MANUFACTURER:
- Analog Devices
-
-DOCUMENTATION:
- http://www.analog.com
-
-COMMENTS:
- This is a chip for ISA-PnP cards, and so should be configured
- using the PnP interface. For full function configure port2,
- irq0, drq0 and drq1 of ldn0.
- The driver is contributed by German Tischler
-
-FORMATS:
- ALAW/ULAW/8bit/16bit(le)/16bit(be),8kHz-55.2kHz,full duplex
-
---------------------------
-CHIPSET:
OPTi931: PnP id 0x3109143e
- OPTi933: PnP id 0x3109143e (yes, it's the same)
MANUFACTURER:
ExpertColor MED931 (europe)
- Shuttle HOT-247 (uses the 933, $15 retail in the US)
DATA SHEETS:
http://www.opti.com/ opti931_21.pdf
@@ -171,7 +90,6 @@ MANUFACTURER:
DATA SHEETS:
http://www.creative.com sbhwpg.pdf or SBHWPG.EXE
- ftp://www.creaf.com/pub/creative/devinfo/ctsbhwpg.exe
PNP CONFIG:
pnp 1 0 os enable port0 0x220 irq0 5 drq0 1 drq1 5
@@ -238,8 +156,6 @@ MANUFACTURER:
DATA SHEETS:
http://www.yamaha.com ? YM711.pdf
- ftp://ftp.yamahayst.com/pub/Fax_Back_Doc/Sound
- http://www.imail.net.tw/qtronix/qumax_product_yamaha.htm
This is a huge file containing a few pages scanned and converted
to pdf. Not very detailed. Luckily, this chipset appears to do a
@@ -330,27 +246,11 @@ CHIPSET:
-------------------------
CHIPSET:
- es1370 (ensoniq)
- es1371 (ensoniq)
- used on SB64 PCI, Shuttle HOT-255, and maybe others
-
- A driver for this is in the works.
- see http://www.ensoniq.com/multimedia/semi_html/index.htm
- for documentation. See also http://alsa.jcu.cz/alsa/ for a Linux
- driver.
-
--------------------------
-CHIPSET:
- YMF724
- used on various Yamaha (WaveForce) and other cards.
-
- NOT SUPPORTED.
-
- There is no public docs on this card, the closest thing being
- http://www.imail.net.tw/qtronix/driver/qumax/yamaha/ds1e1110.pdf
- http://www.imail.net.tw/qtronix/qumax_product_yamaha.htm
- which however does not document how the card works in non-legacy
- mode and how to make it talk to the AC97 codec.
+ various PCI cards from Ensoniq, OPTI, CreativeLabs.
+ This code _cannot_ work on these cards as it is now, since I
+ don't think they can use the ISA DMA controller. As there are
+ no data sheets available for these PCI cards, none of them is
+ supported at the moment.
--------------------------------------------------------------------
diff --git a/sys/i386/isa/snd/README b/sys/i386/isa/snd/README
index e45bde7f2dbcf..289f0442ad2ec 100644
--- a/sys/i386/isa/snd/README
+++ b/sys/i386/isa/snd/README
@@ -38,7 +38,7 @@ CARDS:
The driver supports most clones of WSS, SB16 and SBPro cards.
This includes those based on the Crystal CS423x, OPTI931, GUSPnP,
Yamaha, SB16/32 (both plain ISA, PnP, and the various AWExx).
- Many PnP cards are directly recognized, for others you might need
+ Many PnP cards are directly recognised, for others you might need
manual configuration. See the file "CARDS" for more details.
APPLICATIONS:
@@ -69,7 +69,7 @@ APPLICATIONS:
controller pnp0 # this is required for PnP support
- device pcm0 at isa ? port? tty irq N drq D flags F
+ device pcm0 at isa ? port? tty irq N drq D flags F vector pcmintr
where
@@ -83,7 +83,7 @@ APPLICATIONS:
since this is unsupported at the moment...).
The code will probe for common port addresses (0x220, 0x240
- for SB and clones, 0x530 for WSS and clones), so you don't need
+ for SB and clonse, 0x530 for WSS and clones), so you don't need
to specify them if your system uses one of them. In case you
do, note that for WSS cards the code assumes that the board
occupies 8 IO addresses, the first four used to configure
@@ -95,13 +95,13 @@ APPLICATIONS:
You can use multiple sound cards, in which case you need more
lines like
- device pcm1 at isa ? port? tty irq N drq D flags F
- device pcm2 at isa ? port? tty irq N drq D flags F
+ device pcm1 at isa ? port? tty irq N drq D flags F vector pcmintr
+ device pcm2 at isa ? port? tty irq N drq D flags F vector pcmintr
...
EXAMPLES: a typical "device" line for the SB16 (full duplex) is
- device pcm0 at isa ? port? tty irq 5 drq 1 flags 0x15
+ device pcm0 at isa ? port? tty irq 5 drq 1 flags 0x15 vector pcmintr
The driver will check at the default addresses (or the one you
specify) which type of SoundBlaster you have (1.5, 2.0, 3.X
@@ -113,7 +113,7 @@ APPLICATIONS:
For a WSS-compatible codec (non PnP) working in full duplex using
dma channels 1 and 3, you can specify:
- device pcm0 at isa ? port 0x530 tty irq 7 drq 1 flags 0x13
+ device pcm0 at isa ? port 0x530 tty irq 7 drq 1 flags 0x13 vector pcmintr
(0x530 is a default if no port address is specified). The
"flags 0x13" specifies that you have a dual dma board with
@@ -130,9 +130,10 @@ APPLICATIONS:
For PnP cards, only the line for "pcm0" is needed (the code
will allocate entries for more cards if found), but IT MUST
- INCLUDE ALL FIELDS. You can use the following line:
+ INCLUDE ALL FIELDS, including "vector pcmintr". You can use
+ the following line:
- device pcm0 at isa ? port? tty irq 7 drq 1
+ device pcm0 at isa ? port? tty irq 7 drq 1 vector pcmintr
NOTE that:
- the parameters for the PnP device(s) will be read from the
@@ -199,7 +200,7 @@ Common mistakes:
expect. The mixer code still does not try to exploit the features of
each card, and it just provides basic functionalities.
---- ACKNOWLEDGMENTS ---
+--- ACKNWOLEDGEMENTS ---
Several people helped, directly or indirectly, in the development of
this driver. In particular I would like to thank:
@@ -213,12 +214,12 @@ this driver. In particular I would like to thank:
* Eric J. Schwertfeger for donating an ES1868 card for writing the
driver (which i haven't done yet...).
* and many people who had the patience to try the driver
- on their cards and report success/failure and useful
+ on their cards and report success/fauilure and useful
information.
It was certainly helpful to have the data sheets for some of the
devices I support available on the net, especially in the (unfortunately
-rare) cases where the data sheets matched the actual behavior of
+rare) cases where the data sheets matched the actual behaviour of
the product. Too bad that no one of the chip/card manufacturers I
have contacted by email regarding missing or inconsistent documentation
on their products did even care to reply to my messages.
diff --git a/sys/i386/isa/snd/ad1848.c b/sys/i386/isa/snd/ad1848.c
index 0284995397a40..16599d6ae1368 100644
--- a/sys/i386/isa/snd/ad1848.c
+++ b/sys/i386/isa/snd/ad1848.c
@@ -56,7 +56,7 @@
static int mss_probe(struct isa_device *dev);
static int mss_attach(struct isa_device *dev);
-d_open_t mss_open; /* this is a generic full-duplex open routine */
+static d_open_t mss_open;
static d_close_t mss_close;
static d_ioctl_t mss_ioctl;
static irq_proc_t mss_intr;
@@ -79,27 +79,6 @@ static void ad_write(snddev_info *d, int reg, u_char data);
static void ad_write_cnt(snddev_info *d, int reg, u_short data);
static int ad_read(snddev_info *d, int reg);
-#if NPNP > 0 /* the ad1816 is pnp only */
-/* ad1816 prototypes */
-
-/* IO primitives */
-static int ad1816_wait_init(snddev_info * d, int x);
-static u_short ad1816_read(snddev_info * d, u_int reg);
-static void ad1816_write(snddev_info * d, u_int reg, u_short data);
-/* intr and callback functions */
-static irq_proc_t ad1816_intr;
-static snd_callback_t ad1816_callback;
-/* device specific ioctl calls */
-static d_ioctl_t ad1816_ioctl;
-/* parameter set functions */
-static void ad1816_reinit(snddev_info * d);
-static int ad1816_mixer_set(snddev_info * d, int dev, int value);
-static int ad1816_set_recsrc(snddev_info * d, int mask);
-static void ad1816_mixer_reset(snddev_info * d);
-
-/* ad1816 prototypes end */
-#endif
-
/*
* device descriptors for the boards supported by this module.
*/
@@ -204,33 +183,6 @@ mss_probe_end:
return mss_detect(dev) ? 8 : 0 ; /* mss uses 8 regs */
}
-#if NPNP > 0
-static int
-ad1816_attach(struct isa_device *dev)
-{
- snddev_info *d = &(pcm_info[dev->id_unit]);
-
- dev->id_alive = 16; /* number of io ports */
-
- if (FULL_DUPLEX(d))
- d->audio_fmt |= AFMT_FULLDUPLEX;
-
- ad1816_write(d, 1, 0x2);/* disable interrupts */
- ad1816_write(d, 32, 0x90F0); /* SoundSystem Mode, split format */
-
- ad1816_write(d, 5, 0x8080); /* FM volume mute */
- ad1816_write(d, 6, 0x8080); /* I2S1 volume mute */
- ad1816_write(d, 7, 0x8080); /* I2S0 volume mute */
- ad1816_write(d, 17, 0x8888); /* VID Volume mute */
- ad1816_write(d, 20, 0x5050); /* Source select Mic & auto gain ctrl
- * off */
- /* adc gain is set to 0 */
- ad1816_reinit(d);
- ad1816_mixer_reset(d);
- return 0 ;
-}
-#endif /* NPNP */
-
/*
* the address passed as io_base for mss_attach is also the old
* MSS base address (e.g. 0x530). The codec is four locations ahead.
@@ -247,10 +199,6 @@ mss_attach(struct isa_device *dev)
d->name, dev->id_unit,
d->io_base, d->irq, d->dbuf_out.chan, d->dbuf_in.chan, dev->id_flags);
-#if NPNP > 0
- if (d->bd_id == MD_AD1816)
- return ad1816_attach(dev);
-#endif
dev->id_alive = 8 ; /* number of io ports */
/* should be already set but just in case... */
@@ -322,7 +270,7 @@ mss_attach(struct isa_device *dev)
return 0;
}
-int
+static int
mss_open(dev_t dev, int flags, int mode, struct proc * p)
{
int unit;
@@ -426,11 +374,7 @@ mss_close(dev_t dev, int flags, int mode, struct proc * p)
d->flags |= SND_F_CLOSING ;
splx(s); /* is this ok here ? */
snd_flush(d);
- /* Clear interrupt status */
- if ( d->bd_id == MD_AD1816 )
- outb(ad1816_int(d), 0);
- else
- outb(io_Status(d), 0);
+ outb(io_Status(d), 0); /* Clear interrupt status */
d->flags = 0 ;
}
return 0 ;
@@ -698,14 +642,12 @@ gus_write(int io_base, u_char reg, u_char value)
outb(io_base + 5, value);
}
-#if 0
static void
gus_writew(int io_base, u_char reg, u_short value)
{
outb(io_base + 3, reg);
outb(io_base + 4, value);
}
-#endif
static u_char
gus_read(int io_base, u_char reg)
@@ -714,14 +656,13 @@ gus_read(int io_base, u_char reg)
return inb(io_base+5);
}
-#if 0
static u_short
gus_readw(int io_base, u_char reg)
{
outb(io_base+3, reg);
return inw(io_base+4);
}
-#endif
+
/*
* AD_WAIT_INIT waits if we are initializing the board and
@@ -888,6 +829,22 @@ mss_set_recsrc(snddev_info *d, int mask)
}
/*
+ * mixer conversion table: from 0..100 scale to codec values
+ *
+ * I don't understand what's this for... maybe achieve a log-scale
+ * volume control ?
+ */
+
+static char mix_cvt[101] = {
+ 0, 1, 3, 7,10,13,16,19,21,23,26,28,30,32,34,35,37,39,40,42,
+ 43,45,46,47,49,50,51,52,53,55,56,57,58,59,60,61,62,63,64,65,
+ 65,66,67,68,69,70,70,71,72,73,73,74,75,75,76,77,77,78,79,79,
+ 80,81,81,82,82,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,
+ 91,91,92,92,93,93,94,94,95,95,96,96,96,97,97,98,98,98,99,99,
+ 100
+};
+
+/*
* there are differences in the mixer depending on the actual sound
* card.
*/
@@ -997,7 +954,7 @@ ad1848_mixer_reset(snddev_info *d)
case MD_YM0020:
/* set master volume to max */
- DDB(printf("set yamaha master volume to max\n"); )
+ DDB(printf("set yamaha master volume to max"); )
outb(0x370, 7) ;
outb(0x371, 0) ;
outb(0x370, 8) ;
@@ -1343,7 +1300,7 @@ mss_detect(struct isa_device *dev)
}
}
BVDDB(printf("mss_detect() - Detected %s\n", name));
- snprintf(d->name, sizeof(d->name), "%s", name);
+ strcpy(d->name, name);
dev->id_flags &= ~DV_F_DEV_MASK ;
dev->id_flags |= (d->bd_id << DV_F_DEV_SHIFT) & DV_F_DEV_MASK ;
return 1;
@@ -1426,12 +1383,11 @@ mss_reinit(snddev_info *d)
#if NPNP > 0
static char * cs423x_probe(u_long csn, u_long vend_id);
-static void
-cs423x_attach(u_long csn, u_long vend_id, char *name,
+static void cs423x_attach(u_long csn, u_long vend_id, char *name,
struct isa_device *dev);
static struct pnp_device cs423x = {
- "CS423x/Yamaha/AD1816",
+ "CS423x/Yamaha",
cs423x_probe,
cs423x_attach,
&nsnd, /* use this for all sound cards */
@@ -1446,9 +1402,7 @@ cs423x_probe(u_long csn, u_long vend_id)
u_long id = vend_id & 0xff00ffff;
if ( id == 0x3700630e )
s = "CS4237" ;
- else if ( id == 0x2500630e )
- s = "CS4235" ;
- else if ( id == 0x3600630e )
+ else if ( id == 0x3500630e || id == 0x3600630e )
s = "CS4236" ;
else if ( id == 0x3500630e )
s = "CS4236B" ;
@@ -1458,14 +1412,10 @@ cs423x_probe(u_long csn, u_long vend_id)
s = "Yamaha SA2";
else if ( id == 0x3000a865)
s = "Yamaha SA3";
- else if ( id == 0x0000a865)
+ else if (vend_id == 0x0000a865)
s = "Yamaha YMF719 OPL-SA3";
else if (vend_id == 0x8140d315)
s = "SoundscapeVIVO";
- else if (vend_id == 0x1114b250)
- s = "Terratec Soundsystem BASE 1";
- else if (vend_id == 0x50719304)
- s = "Generic AD1815";
if (s) {
struct pnp_cinfo d;
read_pnp_parms(&d, 0);
@@ -1494,26 +1444,7 @@ cs423x_attach(u_long csn, u_long vend_id, char *name,
return ;
}
snddev_last_probed = &tmp_d;
-
- /* AD1816 */
- if (vend_id == 0x1114b250 || vend_id == 0x50719304) {
- dev->id_alive = 16; /* number of io ports ? */
-
- tmp_d = mss_op_desc; /* copy it */
-
- tmp_d.ioctl = ad1816_ioctl;
- tmp_d.isr = ad1816_intr;
- tmp_d.callback = ad1816_callback;
- tmp_d.audio_fmt = AFMT_STEREO | AFMT_U8 |
- AFMT_A_LAW | AFMT_MU_LAW |
- AFMT_S16_LE | AFMT_S16_BE;
-
- dev->id_iobase = d.port[2];
- tmp_d.alt_base = d.port[0]; /* soundblaster comp. but we don't
- * use that */
- tmp_d.bd_id = MD_AD1816;
- strcpy(tmp_d.name, name);
- } else if (d.flags & DV_PNP_SBCODEC) { /* use sb-compatible codec */
+ if (d.flags & DV_PNP_SBCODEC) { /*** use sb-compatible codec ***/
dev->id_alive = 16 ; /* number of io ports ? */
tmp_d = sb_op_desc ;
if (vend_id==0x2000a865 || vend_id==0x3000a865 ||
@@ -1554,24 +1485,18 @@ cs423x_attach(u_long csn, u_long vend_id, char *name,
tmp_d.bd_id = MD_CS4237 ;
break;
- case 0x2500630e: /* AOpen AW37, CS4235 */
- tmp_d.bd_id = MD_CS4237 ;
- break ;
-
case 0x3500630e: /* CS4236B */
case 0x3600630e: /* CS4236 */
tmp_d.bd_id = MD_CS4236 ;
break;
default:
- tmp_d.bd_id = MD_CS4232; /* to short-circuit the
- * detect routine */
+ tmp_d.bd_id = MD_CS4232 ; /* to short-circuit the detect routine */
break;
}
- snprintf(tmp_d.name, sizeof(tmp_d.name), "%s", name);
+ strcpy(tmp_d.name, name);
tmp_d.audio_fmt |= AFMT_FULLDUPLEX ;
}
-
write_pnp_parms( &d, ldn );
enable_pnp_card();
@@ -1643,7 +1568,7 @@ opti931_attach(u_long csn, u_long vend_id, char *name,
snddev_last_probed = &tmp_d;
tmp_d = d.flags & DV_PNP_SBCODEC ? sb_op_desc : mss_op_desc ;
- snprintf(tmp_d.name, sizeof(tmp_d.name), "%s", name);
+ strcpy(tmp_d.name, name);
/*
* My MED3931 v.1.0 allocates 3 bytes for the config space,
@@ -1761,9 +1686,7 @@ opti925_attach(u_long csn, u_long vend_id, char *name,
pcmattach(dev);
}
-#if 0
static void gus_mem_cfg(snddev_info *tmp);
-#endif
static char *guspnp_probe(u_long csn, u_long vend_id);
static void guspnp_attach(u_long csn, u_long vend_id, char *name,
@@ -1851,7 +1774,7 @@ guspnp_attach(u_long csn, u_long vend_id, char *name,
gus_write(tmp_d.conf_base, 0x5b , tmp | 1 );
BVDDB(printf("GUS: silicon rev %c\n", 'A' + ( ( tmp & 0xf ) >> 4) );)
- snprintf(tmp_d.name, sizeof(tmp_d.name), "%s", name);
+ strcpy(tmp_d.name, name);
pcmattach(dev);
}
@@ -1896,440 +1819,5 @@ gus_mem_cfg(snddev_info *d)
}
#endif /* gus mem cfg... */
-static int
-ad1816_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
-{
- snddev_info *d;
- int unit;
-
- dev = minor(dev);
- unit = dev >> 4;
- d = &pcm_info[unit];
-
- if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) {
- cmd &= 0xff;
- if (cmd == SOUND_MIXER_RECSRC)
- return ad1816_set_recsrc(d, *(int *) arg);
- else
- return ad1816_mixer_set(d, cmd, *(int *) arg);
- }
- switch (cmd) { /* driver specific ioctls other than mixer
- * calls */
- /* ad1816 has special features */
- case AIOGCAP: /* get capabilities */
- {
- snd_capabilities *p = (snd_capabilities *) arg;
- p->rate_min = 4000;
- p->rate_max = 55200;
- p->bufsize = d->bufsize;
- p->formats = d->audio_fmt;
- p->mixers = 1;
- p->inputs = d->mix_devs;
- p->left = p->right = 100;
- return 0;
- }
- default:
- {
- return ENOSYS; /* fallback to default */
- }
- break;
- }
-}
-
-static int
-ad1816_callback(snddev_info * d, int reason)
-{
- int wr, cnt;
-
- wr = reason & SND_CB_WR;
- reason &= SND_CB_REASON_MASK;
-
- switch (reason) {
- case SND_CB_INIT:
- ad1816_reinit(d);
- reset_dbuf(&(d->dbuf_in), SND_CHAN_RD);
- reset_dbuf(&(d->dbuf_out), SND_CHAN_WR);
- return 1;
- break;
-
- case SND_CB_START:
- cnt = wr ? d->dbuf_out.dl : d->dbuf_in.dl;
-
- cnt /= 4;
- cnt--;
-
- /* start only if not already running */
- if (wr && !(inb(ad1816_play(d)) & AD1816_ENABLE)) {
- /* set dma counter */
- ad1816_write(d, 8, cnt); /* playback count */
- /* int enable */
- ad1816_write(d, 1, ad1816_read(d, 1) | 0x8000);
- /* enable playback */
- outb(ad1816_play(d), (inb(ad1816_play(d)) | AD1816_ENABLE));
- /* check if we succeeded */
- if (!(inb(ad1816_play(d)) & AD1816_ENABLE)) {
- printf("ad1816: failed to start write (playback) DMA !\n");
- }
- } else if (!wr && !(inb(ad1816_capt(d)) & AD1816_ENABLE)) {
- /* same for capture */
- ad1816_write(d, 10, cnt); /* capture count */
- ad1816_write(d, 1, ad1816_read(d, 1) | 0x4000); /* int */
- outb(ad1816_capt(d), (inb(ad1816_capt(d)) | AD1816_ENABLE)); /* CEN */
- if (!(inb(ad1816_capt(d)) & AD1816_ENABLE)) { /* check */
- printf("ad1816: failed to start read (capture) DMA !\n");
- }
- }
- break;
-
- case SND_CB_STOP:
- case SND_CB_ABORT: /* XXX check this... */
- /* we don't test here if it is running... */
- if (wr) {
- ad1816_write(d, 1, ad1816_read(d, 1) & ~0x8000);
- /* disable int */
- outb(ad1816_play(d), (inb(ad1816_play(d)) & ~AD1816_ENABLE));
- /* disable playback */
- if ((inb(ad1816_play(d)) & AD1816_ENABLE)) {
- printf("ad1816: failed to stop write (playback) DMA !\n");
- }
- ad1816_write(d, 8, 0); /* reset base counter */
- ad1816_write(d, 9, 0); /* reset cur counter */
- } else {
- /* same for capture */
- ad1816_write(d, 1, ad1816_read(d, 1) & ~0x4000);
- outb(ad1816_capt(d), (inb(ad1816_capt(d)) & ~AD1816_ENABLE));
- if ((inb(ad1816_capt(d)) & AD1816_ENABLE)) {
- printf("ad1816: failed to stop read (capture) DMA !\n");
- }
- ad1816_write(d, 10, 0);
- ad1816_write(d, 11, 0);
- }
- break;
- }
-
- return 0;
-}
-
-static void
-ad1816_intr(int unit)
-{
- snddev_info *d = &pcm_info[unit];
- unsigned char c, served = 0;
-
- /* get interupt status */
- c = inb(ad1816_int(d));
-
- /* check for stray interupts */
- if (c & ~(AD1816_INTRCI | AD1816_INTRPI)) {
- printf("ad1816: Stray interrupt 0x%x.\n", c);
- c = c & (AD1816_INTRCI | AD1816_INTRPI);
- outb(ad1816_int(d), c); /* ack it anyway */
- }
- /* check for capture interupt */
- if (d->dbuf_in.dl && (c & AD1816_INTRCI)) {
- outb(ad1816_int(d), c & ~AD1816_INTRCI); /* ack it */
- if (inb(ad1816_int(d)) & AD1816_INTRCI)
- printf("ad1816: Failed to clear cp int !!!\n");
- dsp_rdintr(d);
- served |= AD1816_INTRCI; /* cp served */
- }
- /* check for playback interupt */
- if (d->dbuf_out.dl && (c & AD1816_INTRPI)) {
- outb(ad1816_int(d), c & ~AD1816_INTRPI); /* ack it */
- if (inb(ad1816_int(d)) & AD1816_INTRPI != 0)
- printf("ad1816: Failed to clear pb int !!!\n");
- dsp_wrintr(d);
- served |= AD1816_INTRPI; /* pb served */
- }
- if (served == 0) {
- /* this probably means this is not a (working) ad1816 chip, */
- /* or an error in dma handling */
- printf("ad1816: raised an interrupt without reason 0x%x.\n", c);
- outb(ad1816_int(d), 0); /* Clear interrupt status anyway */
- }
-}
-
-static int
-ad1816_wait_init(snddev_info * d, int x)
-{
- int n = 0; /* to shut up the compiler... */
-
- for (; x--;)
- if (((n = (inb(ad1816_ale(d)) & AD1816_BUSY))) == 0)
- DELAY(10);
- else
- return n;
- printf("ad1816_wait_init failed 0x%02x.\n", inb(ad1816_ale(d)));
- return n;
-}
-
-static unsigned short
-ad1816_read(snddev_info * d, unsigned int reg)
-{
- int flags;
- u_short x;
-
- /* we don't want to be blocked here */
- flags = spltty();
- if (ad1816_wait_init(d, 100) == 0) {
- printf("ad1816_read: chip timeout before read.\n");
- return 0;
- }
- outb(ad1816_ale(d), (u_char) 0);
- outb(ad1816_ale(d), (u_char) (reg & AD1816_ALEMASK));
- if (ad1816_wait_init(d, 100) == 0) {
- printf("ad1816_read: chip timeout during read.\n");
- return 0;
- }
- x = (inb(ad1816_high(d)) << 8) | inb(ad1816_low(d));
- splx(flags);
- return x;
-}
-
-static void
-ad1816_write(snddev_info * d, unsigned int reg, unsigned short data)
-{
- int flags;
-
- flags = spltty();
- if (ad1816_wait_init(d, 100) == 0) {
- printf("ad1816_write: chip timeout before write.\n");
- return;
- }
- outb(ad1816_ale(d), (u_char) (reg & AD1816_ALEMASK));
- outb(ad1816_low(d), (u_char) (data & 0x000000ff));
- outb(ad1816_high(d), (u_char) ((data & 0x0000ff00) >> 8));
- splx(flags);
-}
-
-#if 0 /* unused right now..., and untested... */
-static void
-ad1816_mute(snddev_info * d)
-{
- ad1816_write(d, 14, ad1816_read(d, 14) | 0x8000 | 0x80);
-}
-
-static void
-ad1816_unmute(snddev_info * d)
-{
- ad1816_write(d, 14, ad1816_read(d, 14) & ~(0x8000 | 0x80));
-}
-#endif
-
-/* only one rec source is possible */
-
-static int
-ad1816_set_recsrc(snddev_info * d, int mask)
-{
- mask &= d->mix_rec_devs;
-
- switch (mask) {
- case SOUND_MASK_LINE:
- case SOUND_MASK_LINE3:
- ad1816_write(d, 20, (ad1816_read(d, 20) & ~0x7070) | 0x0000);
- break;
-
- case SOUND_MASK_CD:
- case SOUND_MASK_LINE1:
- ad1816_write(d, 20, (ad1816_read(d, 20) & ~0x7070) | 0x2020);
- break;
-
- case SOUND_MASK_MIC:
- default:
- ad1816_write(d, 20, (ad1816_read(d, 20) & ~0x7070) | 0x5050);
- }
-
- d->mix_recsrc = mask;
-
- return 0; /* success */
-}
-
-#define AD1816_MUTE 31 /* value for mute */
-
-static int
-ad1816_mixer_set(snddev_info * d, int dev, int value)
-{
- u_char left = (value & 0x000000ff);
- u_char right = (value & 0x0000ff00) >> 8;
- u_short reg = 0;
-
- if (dev > 31)
- return EINVAL;
-
- if (!(d->mix_devs & (1 << dev)))
- return EINVAL;
-
- if (left > 100)
- left = 100;
- if (right > 100)
- right = 100;
-
- d->mix_levels[dev] = left | (right << 8);
-
- /* Scale volumes */
- left = AD1816_MUTE - (AD1816_MUTE * left) / 100;
- right = AD1816_MUTE - (AD1816_MUTE * right) / 100;
-
- reg = (left << 8) | right;
-
- /* do channel selective muting if volume is zero */
- if (left == AD1816_MUTE)
- reg |= 0x8000;
- if (right == AD1816_MUTE)
- reg |= 0x0080;
-
- switch (dev) {
- case SOUND_MIXER_VOLUME: /* Register 14 master volume */
- ad1816_write(d, 14, reg);
- break;
- case SOUND_MIXER_CD: /* Register 15 cd */
- case SOUND_MIXER_LINE1:
- ad1816_write(d, 15, reg);
- break;
- case SOUND_MIXER_SYNTH: /* Register 16 synth */
- ad1816_write(d, 16, reg);
- break;
- case SOUND_MIXER_PCM: /* Register 4 pcm */
- ad1816_write(d, 4, reg);
- break;
- case SOUND_MIXER_LINE:
- case SOUND_MIXER_LINE3: /* Register 18 line in */
- ad1816_write(d, 18, reg);
- break;
- case SOUND_MIXER_MIC: /* Register 19 mic volume */
- ad1816_write(d, 19, reg & ~0xff); /* mic is mono */
- break;
- case SOUND_MIXER_IGAIN:
- /* and now to something completely different ... */
- ad1816_write(d, 20, ((ad1816_read(d, 20) & ~0x0f0f)
- | (((AD1816_MUTE - left) / 2) << 8) /* four bits of adc gain */
- | ((AD1816_MUTE - right) / 2)));
- break;
- default:
- printf("ad1816_mixer_set(): unknown device.\n");
- break;
- }
-
- return 0; /* success */
-}
-
-static void
-ad1816_mixer_reset(snddev_info * d)
-{
- int i;
-
- d->mix_devs = AD1816_MIXER_DEVICES;
- d->mix_rec_devs = AD1816_REC_DEVICES;
-
- for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
- if (d->mix_devs & (1 << i))
- ad1816_mixer_set(d, i, default_mixer_levels[i]);
- ad1816_set_recsrc(d, SOUND_MASK_MIC);
-}
-
-/* Set the playback and capture rates. */
-
-static int
-ad1816_speed(snddev_info * d)
-{
- RANGE(d->play_speed,4000,55200);
- RANGE(d->rec_speed,4000,55200);
-
- ad1816_write(d, 2, d->play_speed);
- ad1816_write(d, 3, d->rec_speed);
-
- return d->play_speed;
-}
-
-/*
- * ad1816_format checks that the format is supported (or defaults to AFMT_U8)
- * and sets the chip to the desired format.
- */
-
-static int
-ad1816_format(snddev_info * d)
-{
- int oldplay =inb(ad1816_play(d)) & ~AD1816_FORMASK;
- int oldrec = inb(ad1816_capt(d)) & ~AD1816_FORMASK;
- int play = (d->play_fmt & d->audio_fmt) ? d->play_fmt : AFMT_U8;
- int rec = (d->rec_fmt & d->audio_fmt) ? d->rec_fmt : AFMT_U8;
-
- /*
- * check that arg is one of the supported formats in d->format; otherwise
- * fallback to AFMT_U8
- */
-
- switch (play) {
- case AFMT_A_LAW:
- outb(ad1816_play(d), oldplay | AD1816_ALAW);
- break;
- case AFMT_MU_LAW:
- outb(ad1816_play(d), oldplay | AD1816_MULAW);
- break;
- case AFMT_S16_LE:
- outb(ad1816_play(d), oldplay | AD1816_S16LE);
- break;
- case AFMT_S16_BE:
- outb(ad1816_play(d), oldplay | AD1816_S16BE);
- break;
- default:
- /* unlikely to happen */
- printf("ad1816: unknown play format. defaulting to U8.\n");
- case AFMT_U8:
- outb(ad1816_play(d), oldplay | AD1816_U8);
- break;
- }
-
- switch (rec) {
- case AFMT_A_LAW:
- outb(ad1816_capt(d), oldrec | AD1816_ALAW);
- break;
- case AFMT_MU_LAW:
- outb(ad1816_capt(d), oldrec | AD1816_MULAW);
- break;
- case AFMT_S16_LE:
- outb(ad1816_capt(d), oldrec | AD1816_S16LE);
- break;
- case AFMT_S16_BE:
- outb(ad1816_capt(d), oldrec | AD1816_S16BE);
- break;
- default:
- printf("ad1816: unknown capture format. defaulting to U8.\n");
- case AFMT_U8:
- outb(ad1816_capt(d), oldrec | AD1816_U8);
- break;
- }
-
- d->play_fmt = play;
- d->rec_fmt = rec;
-
- return (play);
-}
-
-/*
- * ad1816_reinit resets codec registers
- */
-static void
-ad1816_reinit(snddev_info * d)
-{
- ad1816_write(d, 8, 0x0000); /* reset base and current counter */
- ad1816_write(d, 9, 0x0000); /* for playback and capture */
- ad1816_write(d, 10, 0x0000);
- ad1816_write(d, 11, 0x0000);
-
- if (d->flags & SND_F_STEREO) {
- outb((ad1816_play(d)), AD1816_STEREO); /* set playback to stereo */
- outb((ad1816_capt(d)), AD1816_STEREO); /* set capture to stereo */
- } else {
- outb((ad1816_play(d)), 0x00); /* set playback to mono */
- outb((ad1816_capt(d)), 0x00); /* set capture to mono */
- }
-
- ad1816_format(d);
- ad1816_speed(d);
-
- snd_set_blocksize(d); /* update blocksize if user did not force it */
-}
-
#endif /* NPNP > 0 */
#endif /* NPCM > 0 */
diff --git a/sys/i386/isa/snd/dmabuf.c b/sys/i386/isa/snd/dmabuf.c
index 66f94ac552675..c69435c2cd5d4 100644
--- a/sys/i386/isa/snd/dmabuf.c
+++ b/sys/i386/isa/snd/dmabuf.c
@@ -4,7 +4,7 @@
* This file implements the new DMA routines for the sound driver.
* AUTO DMA MODE (ISA DMA SIDE).
*
- * Copyright by Luigi Rizzo - 1997-99
+ * Copyright by Luigi Rizzo - 1997
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,7 +32,7 @@
*/
#include <i386/isa/snd/sound.h>
-#include <i386/isa/snd/ulaw.h>
+#include <i386/isa/sound/ulaw.h>
#define MIN_CHUNK_SIZE 256 /* for uiomove etc. */
#define DMA_ALIGN_THRESHOLD 4
@@ -108,10 +108,7 @@ dsp_wr_dmadone(snddev_info *d)
{
snd_dbuf *b = & (d->dbuf_out) ;
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(b);
+ dsp_wr_dmaupdate(b);
/*
* XXX here it would be more efficient to record if there
* actually is a sleeping process, but this should still work.
@@ -183,7 +180,7 @@ dsp_wrintr(snddev_info *d)
* This happens if the size has changed _and_ the new size
* is smaller, or it matches the blocksize.
*/
- if (l != b->dl && (b->dl == 0 || l<b->dl || l == d->play_blocksize) ) {
+ if (l != b->dl && (l < b->dl || l == d->play_blocksize) ) {
/* for any reason, size has changed. Stop and restart */
DEB(printf("wrintr: bsz change from %d to %d, rp %d rl %d\n",
b->dl, l, b->rp, b->rl));
@@ -194,10 +191,7 @@ dsp_wrintr(snddev_info *d)
* at high speed, it might well be that the count
* changes in the meantime. So we try to update b->rl
*/
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(b) ;
+ dsp_wr_dmaupdate(b) ;
l = min(b->rl, d->play_blocksize );
l &= DMA_ALIGN_MASK ; /* realign things */
b->dl = l; /* record previous transfer size */
@@ -258,10 +252,7 @@ dsp_write_body(snddev_info *d, struct uio *buf)
while ( (n = buf->uio_resid) ) {
l = min (n, bsz); /* at most n bytes ... */
s = spltty(); /* no interrupts here ... */
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(b);
+ dsp_wr_dmaupdate(b);
l = min( l, b->fl ); /* no more than avail. space */
DEB(printf("dsp_write_body: prepare %d bytes out of %d\n", l,n));
/*
@@ -415,10 +406,7 @@ dsp_rd_dmadone(snddev_info *d)
{
snd_dbuf *b = & (d->dbuf_in) ;
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(b);
+ dsp_rd_dmaupdate(b);
wakeup(b) ; /* wakeup possibly sleeping processes */
if (b->sel.si_pid &&
( !(d->flags & SND_F_HAS_SIZE) || b->rl >= d->rec_blocksize ) )
@@ -542,10 +530,7 @@ dsp_read_body(snddev_info *d, struct uio *buf)
DEB(printf("dsp_read_body: start waiting for %d bytes\n", n));
l = min (n, bsz);
s = spltty(); /* no interrupts here ! */
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(b);
+ dsp_rd_dmaupdate(b);
l = min( l, b->rl ); /* no more than avail. data */
if (l == 0) {
int timeout;
@@ -658,8 +643,7 @@ reset_dbuf(snd_dbuf *b, int chan)
chan = B_WRITE | B_RAW ;
else
chan = B_READ | B_RAW ;
- if (b->chan != 4 && b->chan < 8) /* XXX hack for pci... */
- isa_dmastart( chan , b->buf, b->bufsize, b->chan);
+ isa_dmastart( chan , b->buf, b->bufsize, b->chan);
}
/*
@@ -679,14 +663,10 @@ snd_sync(snddev_info *d, int chan, int threshold)
for (;;) {
s=spltty();
- if (d->special_dma)
- d->callback(d, (chan==1? SND_CB_WR:SND_CB_RD) | SND_CB_DMAUPDATE);
- else {
- if ( chan==1 )
- dsp_wr_dmaupdate(b);
- else
- dsp_rd_dmaupdate(b);
- }
+ if ( chan==1 )
+ dsp_wr_dmaupdate(b);
+ else
+ dsp_rd_dmaupdate(b);
if ( (chan == 1 && b->fl <= threshold) ||
(chan == 2 && b->rl <= threshold) ) {
ret = tsleep((caddr_t)b, PRIBIO|PCATCH, "sndsyn", 1);
@@ -721,15 +701,13 @@ dsp_wrabort(snddev_info *d, int restart)
d->flags &= ~ SND_F_WRITING ;
if (d->callback)
d->callback(d, SND_CB_WR | SND_CB_ABORT);
- if (!d->special_dma)
- isa_dmastop(b->chan) ;
+ isa_dmastop(b->chan) ;
dsp_wr_dmadone(d);
DEB(printf("dsp_wrabort: stopped, %d bytes left\n", b->rl));
}
missing = b->rl;
- if (!d->special_dma)
- isa_dmadone(B_WRITE, b->buf, b->bufsize, b->chan); /*free chan */
+ isa_dmadone(B_WRITE, b->buf, b->bufsize, b->chan); /*free chan */
reset_dbuf(b, restart ? SND_CHAN_WR : SND_CHAN_NONE);
splx(s);
return missing;
@@ -748,13 +726,11 @@ dsp_rdabort(snddev_info *d, int restart)
d->flags &= ~ SND_F_READING ;
if (d->callback)
d->callback(d, SND_CB_RD | SND_CB_ABORT);
- if (!d->special_dma)
- isa_dmastop(b->chan) ;
+ isa_dmastop(b->chan) ;
dsp_rd_dmadone(d);
}
missing = b->rl ;
- if (!d->special_dma)
- isa_dmadone(B_READ, b->buf, b->bufsize, b->chan);
+ isa_dmadone(B_READ, b->buf, b->bufsize, b->chan);
reset_dbuf(b, restart ? SND_CHAN_RD : SND_CHAN_NONE);
splx(s);
return missing;
@@ -782,10 +758,7 @@ snd_flush(snddev_info *d)
* still pending output data.
*/
ret = tsleep( (caddr_t)b, PRIBIO|PCATCH, "dmafl1", hz);
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE);
- else
- dsp_wr_dmaupdate(b);
+ dsp_wr_dmaupdate(b);
DEB( printf("snd_sync: now rl : fl %d : %d\n", b->rl, b->fl ) );
if (ret == EINTR) {
printf("tsleep returns %d\n", ret);
diff --git a/sys/i386/isa/snd/mss.h b/sys/i386/isa/snd/mss.h
index 20ceaaf9da0c1..54efc3cc21950 100644
--- a/sys/i386/isa/snd/mss.h
+++ b/sys/i386/isa/snd/mss.h
@@ -105,55 +105,6 @@ ahead.
#define BD_F_IRQ_OK 0x0002
#define BD_F_TMR_RUN 0x0004
-/* AD1816 register macros */
-
-#define ad1816_ale(d) ((d)->io_base+0) /* indirect reg access */
-#define ad1816_int(d) ((d)->io_base+1) /* interupt status */
-#define ad1816_low(d) ((d)->io_base+2) /* indirect low byte */
-#define ad1816_high(d) ((d)->io_base+3) /* indirect high byte */
-/* unused */
-#define ad1816_pioD(d) ((d)->io_base+4) /* PIO debug */
-#define ad1816_pios(d) ((d)->io_base+5) /* PIO status */
-#define ad1816_piod(d) ((d)->io_base+6) /* PIO data */
-/* end of unused */
-/* values for playback/capture config:
- bits: 0 enable/disable
- 1 pio/dma
- 2 stereo/mono
- 3 companded/linearPCM
- 4-5 format : 00 8bit linear (uncomp)
- 00 8bit mulaw (comp)
- 01 16bit le (uncomp)
- 01 8bit alaw (comp)
- 11 16bit be (uncomp)
-*/
-#define ad1816_play(d) ((d)->io_base+8) /* playback config */
-#define ad1816_capt(d) ((d)->io_base+9) /* capture config */
-
-#define AD1816_BUSY 0x80 /* chip is busy */
-#define AD1816_ALEMASK 0x3F /* mask for indirect adr. */
-/* unusud */
-#define AD1816_INTRSI 0x01 /* sb intr */
-#define AD1816_INTRGI 0x02 /* game intr */
-#define AD1816_INTRRI 0x04 /* ring intr */
-#define AD1816_INTRDI 0x08 /* dsp intr */
-#define AD1816_INTRVI 0x10 /* vol intr */
-#define AD1816_INTRTI 0x20 /* timer intr */
-/* used again */
-#define AD1816_INTRCI 0x40 /* capture intr */
-#define AD1816_INTRPI 0x80 /* playback intr */
-/* PIO stuff is not supplied here */
-/* playback / capture config */
-#define AD1816_ENABLE 0x01 /* enable pl/cp */
-#define AD1816_PIO 0x02 /* use pio */
-#define AD1816_STEREO 0x04
-#define AD1816_COMP 0x08 /* data is companded */
-#define AD1816_U8 0x00 /* 8 bit linear pcm */
-#define AD1816_MULAW 0x08 /* 8 bit mulaw */
-#define AD1816_ALAW 0x18 /* 8 bit alaw */
-#define AD1816_S16LE 0x10 /* 16 bit linear little endian */
-#define AD1816_S16BE 0x30 /* 16 bit linear big endian */
-#define AD1816_FORMASK 0x38 /* format mask */
/*
* sound/ad1848_mixer.h
@@ -274,12 +225,6 @@ MIX_NONE(SOUND_MIXER_LINE3),
SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD | \
SOUND_MASK_IGAIN | SOUND_MASK_LINE1 )
-#define AD1816_REC_DEVICES \
- (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
-
-#define AD1816_MIXER_DEVICES \
- (SOUND_MASK_VOLUME | SOUND_MASK_PCM | SOUND_MASK_SYNTH | \
- SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD | SOUND_MASK_IGAIN)
static u_short default_mixer_levels[SOUND_MIXER_NRDEVICES] = {
0x5a5a, /* Master Volume */
diff --git a/sys/i386/isa/snd/sb_dsp.c b/sys/i386/isa/snd/sb_dsp.c
index 3c77f1f12bc5c..96d0e626b420c 100644
--- a/sys/i386/isa/snd/sb_dsp.c
+++ b/sys/i386/isa/snd/sb_dsp.c
@@ -324,10 +324,18 @@ again:
if ( reason & 1 ) { /* possibly a write interrupt */
if ( d->dbuf_out.dl )
dsp_wrintr(d);
+ else {
+ if (PLAIN_SB16(d->bd_flags))
+ printf("WARNING: wrintr but write DMA inactive!\n");
+ }
}
if ( reason & 2 ) {
if ( d->dbuf_in.dl )
dsp_rdintr(d);
+ else {
+ if (PLAIN_SB16(d->bd_flags))
+ printf("WARNING: rdintr but read DMA inactive!\n");
+ }
}
if ( c & 2 )
inb(DSP_DATA_AVL16); /* 16-bit int ack */
@@ -337,7 +345,7 @@ again:
/*
* the sb16 might have multiple sources etc.
*/
- if ((d->bd_flags & BD_F_SB16) && (c & 3))
+ if (d->bd_flags & BD_F_SB16 && (c & 3) )
goto again;
}
@@ -382,6 +390,7 @@ sb_callback(snddev_info *d, int reason)
* the proper initialization for each one.
*/
if (PLAIN_SB16(d->bd_flags)) {
+ u_char c, c1 ;
/* the original SB16 (non-PnP, or PnP, or Vibra16C)
* can do full duplex using one 16-bit channel
@@ -427,63 +436,29 @@ sb_callback(snddev_info *d, int reason)
d->dbuf_in.chan = d->dbuf_out.chan;
d->dbuf_out.chan = c ;
}
- }
- else if (d->bd_flags & BD_F_ESS) {
- u_char c;
-
- DEB(printf("SND_CB_INIT, play_fmt == 0x%x, rec_fmt == 0x%x\n",
- (int) d->play_fmt, (int) d->rec_fmt));
-
- /* autoinit DMA mode */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb8, 0x04);
- else
- ess_write(d->io_base, 0xb8, 0x0e);
-
- c = (ess_read(d->io_base, 0xa8) & ~0x03) | 0x01;
- if ((d->flags & SND_F_STEREO) == 0)
- c++;
- ess_write(d->io_base, 0xa8, c); /* select mono/stereo */
- ess_write(d->io_base, 0xb9, 2); /* demand 4 bytes/transfer */
-
- switch (d->play_fmt ? d->play_fmt : d->rec_fmt) {
- case AFMT_S16_LE:
- if (d->flags & SND_F_STEREO) {
- /* 16 bit stereo */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x00);
- ess_write(d->io_base, 0xb7, 0x71);
- ess_write(d->io_base, 0xb7, 0xbc);
- }
- else {
- /* 16 bit mono */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x00);
- ess_write(d->io_base, 0xb7, 0x71);
- ess_write(d->io_base, 0xb7, 0xf4);
- }
- break;
- case AFMT_U8:
- if (d->flags & SND_F_STEREO) {
- /* 8 bit stereo */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x80);
- ess_write(d->io_base, 0xb7, 0x51);
- ess_write(d->io_base, 0xb7, 0x98);
- }
- else {
- /* 8 bit mono */
- if (d->play_fmt)
- ess_write(d->io_base, 0xb6, 0x80);
- ess_write(d->io_base, 0xb7, 0x51);
- ess_write(d->io_base, 0xb7, 0xd0);
- }
- break;
- }
- ess_write(d->io_base, 0xb1,
- ess_read(d->io_base, 0xb1) | 0x50);
- ess_write(d->io_base, 0xb2,
- ess_read(d->io_base, 0xb1) | 0x50);
+ } else if (d->bd_flags & BD_F_ESS) {
+ u_char c ;
+ if (d->play_fmt == 0) {
+ /* initialize for record */
+ static u_char cmd[] = {
+ 0x51,0xd0,0x71,0xf4,0x51,0x98,0x71,0xbc
+ };
+ ess_write(d->io_base, 0xb8, 0x0e);
+ c = ( ess_read(d->io_base, 0xa8) & 0xfc ) | 1 ;
+ if (d->flags & SND_F_STEREO)
+ c++ ;
+ ess_write(d->io_base, 0xa8, c);
+ ess_write(d->io_base, 0xb9, 2); /* 4bytes/transfer */
+ /*
+ * set format in b6, b7
+ */
+ } else {
+ /* initialize for play */
+ static u_char cmd[] = {
+ 0x80,0x51,0xd0,0x00,0x71,0xf4,
+ 0x80,0x51,0x98,0x00,0x71,0xbc
+ };
+ }
}
reset_dbuf(& (d->dbuf_in), SND_CHAN_RD );
reset_dbuf(& (d->dbuf_out), SND_CHAN_WR );
@@ -499,6 +474,7 @@ sb_callback(snddev_info *d, int reason)
* the second one takes the next...
* The default is to be ready for play.
*/
+ int swap = 0 ;
DEB(printf("start %s -- now dma %d:%d\n",
rd ? "rd" : "wr",
d->dbuf_out.chan, d->dbuf_in.chan););
@@ -544,18 +520,10 @@ sb_callback(snddev_info *d, int reason)
sb_cmd(d->io_base, c );
sb_cmd3(d->io_base, c1 , l - 1) ;
} else if (d->bd_flags & BD_F_ESS) {
- u_long fmt = rd ? d->rec_fmt : d->play_fmt;
-
- DEB(printf("SND_CB_START: %s (%d)\n", rd ? "rd" : "wr", l));
- if (fmt == AFMT_S16_LE)
- l >>= 1;
- l--;
- if (!rd)
- sb_cmd(d->io_base, DSP_CMD_SPKON);
- ess_write(d->io_base, 0xa4, l);
- ess_write(d->io_base, 0xa5, l >> 8);
- ess_write(d->io_base, 0xb8,
- ess_read(d->io_base, 0xb8) | (rd ? 0x0f : 0x05));
+ /* XXX this code is still incomplete */
+ sb_cmd2(d->io_base, 0xb8, rd ? 4 : 0xe ) ; /* auto dma */
+ sb_cmd2(d->io_base, 0xa8, d->flags & SND_F_STEREO ? 1 : 2) ;
+ sb_cmd2(d->io_base, 0xb9, 2) ; /* demand dma */
} else { /* SBPro -- stereo not supported */
u_char c ;
if (!rd)
@@ -586,7 +554,6 @@ sb_callback(snddev_info *d, int reason)
case SND_CB_STOP :
{
int cmd = DSP_CMD_DMAPAUSE_8 ; /* default: halt 8 bit chan */
- DEB(printf("SND_CB_XXX: reason 0x%x\n", reason));
if ( b->chan > 4
|| (rd && d->rec_fmt == AFMT_S16_LE)
|| (!rd && d->play_fmt == AFMT_S16_LE)
@@ -763,20 +730,14 @@ sb_dsp_init(snddev_info *d, struct isa_device *dev)
/* the ESS488 can be treated as an SBPRO */
printf("ESS488 (rev %d)\n", ess_minor & 0x0f);
break ;
- }
- else if (ess_major == 0x68 && (ess_minor & 0xf0) == 0x80) {
- int rev = ess_minor & 0xf;
-
- if (rev >= 8)
- printf("ESS1868 (rev %d)\n", rev);
- else
- printf("ESS688 (rev %d)\n", rev);
- d->bd_flags |= BD_F_ESS;
- d->audio_fmt |= AFMT_S16_LE;
-
- /* enable extended ESS mode */
- sb_cmd(d->io_base, 0xc6);
- break;
+ } else if (ess_major == 0x68 && (ess_minor & 0xf0) == 0x80) {
+ int rev = ess_minor & 0xf ;
+ if ( rev >= 8 )
+ printf("ESS1868 (rev %d)\n", rev);
+ else
+ printf("ESS688 (rev %d)\n", rev);
+ /* d->audio_fmt |= AFMT_S16_LE; */ /* not yet... */
+ break ; /* XXX */
} else {
printf("Unknown card 0x%x 0x%x -- hope it is SBPRO\n",
ess_major, ess_minor);
@@ -786,8 +747,7 @@ sb_dsp_init(snddev_info *d, struct isa_device *dev)
}
- snprintf(d->name, sizeof(d->name),
- fmt, (d->bd_id >> 8) &0xff, d->bd_id & 0xff);
+ sprintf(d->name, fmt, (d->bd_id >> 8) &0xff, d->bd_id & 0xff);
sb_mix_init(d);
}
@@ -878,9 +838,9 @@ sb_setmixer(int io_base, u_int port, u_int value)
u_long flags;
flags = spltty();
- outb(io_base + SB_MIX_ADDR, (u_char) (port & 0xff)); /* Select register */
+ outb(io_base + 4, (u_char) (port & 0xff)); /* Select register */
DELAY(10);
- outb(io_base + SB_MIX_DATA, (u_char) (value & 0xff));
+ outb(io_base + 5, (u_char) (value & 0xff));
DELAY(10);
splx(flags);
}
@@ -1228,6 +1188,7 @@ ess1868_attach(u_long csn, u_long vend_id, char *name,
{
struct pnp_cinfo d ;
snddev_info tmp_d ; /* patched copy of the basic snddev_info */
+ int the_irq = 0 ;
tmp_d = sb_op_desc;
snddev_last_probed = &tmp_d;
@@ -1256,12 +1217,10 @@ ess1868_attach(u_long csn, u_long vend_id, char *name,
dev->id_drq = d.drq[0] ; /* primary dma */
dev->id_irq = (1 << d.irq[0] ) ;
- dev->id_intr = (inthand2_t *)pcmintr ;
+ dev->id_intr = pcmintr ;
dev->id_flags = 0 /* DV_F_DUAL_DMA | (d.drq[1] ) */;
-#if 0
snddev_last_probed->probe(dev); /* not really necessary but doesn't harm */
-#endif
pcmattach(dev);
}
@@ -1339,7 +1298,7 @@ sb16pnp_attach(u_long csn, u_long vend_id, char *name,
dev->id_drq = d.drq[0] ; /* primary dma */
dev->id_irq = (1 << d.irq[0] ) ;
- dev->id_intr = (inthand2_t *)pcmintr ;
+ dev->id_intr = pcmintr ;
dev->id_flags = DV_F_DUAL_DMA | (d.drq[1] ) ;
pcm_info[dev->id_unit] = tmp_d; /* pcm_info[] will be reinitialized after */
diff --git a/sys/i386/isa/snd/sbcard.h b/sys/i386/isa/snd/sbcard.h
index 481719961a78e..92ec966107911 100644
--- a/sys/i386/isa/snd/sbcard.h
+++ b/sys/i386/isa/snd/sbcard.h
@@ -264,15 +264,15 @@ static u_char sb16_recmasks_L[SOUND_MIXER_NRDEVICES];
static u_char sb16_recmasks_R[SOUND_MIXER_NRDEVICES];
#else /* __SB_MIXER_C__ defined */
mixer_tab sbpro_mix = {
- PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 4, 4, 0x22, 0, 4),
+ PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
PMIX_ENT(SOUND_MIXER_BASS, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_TREBLE, 0x00, 0, 0, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 4, 4, 0x26, 0, 4),
- PMIX_ENT(SOUND_MIXER_PCM, 0x04, 4, 4, 0x04, 0, 4),
+ PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
+ PMIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
PMIX_ENT(SOUND_MIXER_SPEAKER, 0x00, 0, 0, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 4, 4, 0x2e, 0, 4),
- PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_CD, 0x28, 4, 4, 0x28, 0, 4),
+ PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
+ PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
PMIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0)
@@ -280,15 +280,15 @@ mixer_tab sbpro_mix = {
#ifdef __SGNXPRO__
mixer_tab sgnxpro_mix = {
- PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 4, 4, 0x22, 0, 4),
- PMIX_ENT(SOUND_MIXER_BASS, 0x46, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_TREBLE, 0x44, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 4, 4, 0x26, 0, 4),
- PMIX_ENT(SOUND_MIXER_PCM, 0x04, 4, 4, 0x04, 0, 4),
- PMIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 4, 4, 0x2e, 0, 4),
- PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 0, 3, 0x00, 0, 0),
- PMIX_ENT(SOUND_MIXER_CD, 0x28, 4, 4, 0x28, 0, 4),
+ PMIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4),
+ PMIX_ENT(SOUND_MIXER_BASS, 0x46, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_TREBLE, 0x44, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4),
+ PMIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4),
+ PMIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4),
+ PMIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0),
+ PMIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4),
PMIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0),
PMIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0),
diff --git a/sys/i386/isa/snd/sound.c b/sys/i386/isa/snd/sound.c
index 6a5a92d99a61c..ef724cd5121b3 100644
--- a/sys/i386/isa/snd/sound.c
+++ b/sys/i386/isa/snd/sound.c
@@ -229,7 +229,7 @@ synthprobe(struct isa_device * dev)
}
/*
- * this is the ISA part of the generic attach routine
+ * this is the generic attach routine
*/
int
@@ -238,8 +238,8 @@ pcmattach(struct isa_device * dev)
snddev_info *d = NULL ;
struct isa_device *dvp;
int stat = 0;
-
- dev->id_ointr = pcmintr;
+ dev_t isadev;
+ void *cookie;
if ( (dev->id_unit >= NPCM_MAX) || /* too many devs */
(snddev_last_probed == NULL) || /* last probe failed */
@@ -282,68 +282,19 @@ pcmattach(struct isa_device * dev)
isa_dma_acquire(d->dbuf_out.chan);
if (FULL_DUPLEX(d))
isa_dma_acquire(d->dbuf_in.chan);
-
-
- /*
- * should try and find a suitable value for id_id, otherwise
- * the interrupt is not registered and dispatched properly.
- * This is important for PnP devices, where "dev" is built on
- * the fly and many field are not initialized.
- */
- if (dev->id_driver == NULL) {
- dev->id_driver = &pcmdriver ;
- dvp=find_isadev(isa_devtab_tty, &pcmdriver, 0);
- if (dvp)
- dev->id_id = dvp->id_id;
- }
-
- /*
- * call the generic part of the attach
- */
- pcminit(d, dev->id_unit);
- /*
- * and finally, call the device attach routine
- * XXX I should probably use d->attach(dev)
- */
- stat = snddev_last_probed->attach(dev);
-#if 0
- /*
- * XXX hooks for synt support. Try probe and attach...
- */
- if (d->synth_base && opl3_probe(dev) ) {
- opl3_attach(dev);
- }
-#endif
- snddev_last_probed = NULL ;
-
- return stat ;
-}
-
-/*
- * This is the generic init routine
- */
-int
-pcminit(snddev_info *d, int unit)
-{
-#ifdef DEVFS
- void *cookie;
-#endif
- dev_t isadev;
-
- isadev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&isadev, &snd_cdevsw, NULL);
-
/*
* initialize standard parameters for the device. This can be
* overridden by device-specific configurations but better do
* here the generic things.
*/
- d->magic = MAGIC(unit); /* debugging... */
d->play_speed = d->rec_speed = 8000 ;
d->play_blocksize = d->rec_blocksize = 2048 ;
d->play_fmt = d->rec_fmt = AFMT_MU_LAW ;
+ isadev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&isadev, &snd_cdevsw, NULL);
+
#ifdef DEVFS
#ifndef GID_GAMES
#define GID_SND UID_ROOT
@@ -359,40 +310,70 @@ pcminit(snddev_info *d, int unit)
* Make links to first successfully probed unit.
* Attempts by later devices to make these links will fail.
*/
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "dsp%r", unit);
- if (cookie) devfs_makelink(cookie, "dsp");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "dsp%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "dsp");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP16,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "dspW%r", unit);
- if (cookie) devfs_makelink(cookie, "dspW");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "dspW%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "dspW");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_AUDIO,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "audio%r", unit);
- if (cookie) devfs_makelink(cookie, "audio");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "audio%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "audio");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_CTL,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "mixer%r", unit);
- if (cookie) devfs_makelink(cookie, "mixer");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "mixer%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "mixer");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_STATUS,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "sndstat%r", unit);
- if (cookie) devfs_makelink(cookie, "sndstat");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "sndstat%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "sndstat");
#if 0 /* these two are still unsupported... */
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_MIDIN,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "midi%r", unit);
- if (cookie) devfs_makelink(cookie, "midi");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "midi%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "midi");
- cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_SYNTH,
- DV_CHR, UID_SND, GID_SND, PERM_SND, "sequencer%r", unit);
- if (cookie) devfs_makelink(cookie, "sequencer");
+ cookie = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SYNTH,
+ DV_CHR, UID_SND, GID_SND, PERM_SND, "sequencer%r", dev->id_unit);
+ if (cookie) devfs_link(cookie, "sequencer");
#endif
#endif /* DEVFS */
+
+ /*
+ * should try and find a suitable value for id_id, otherwise
+ * the interrupt is not registered and dispatched properly.
+ * This is important for PnP devices, where "dev" is built on
+ * the fly and many field are not initialized.
+ */
+ if (dev->id_driver == NULL) {
+ dev->id_driver = &pcmdriver ;
+ dvp=find_isadev(isa_devtab_tty, &pcmdriver, 0);
+ if (dvp)
+ dev->id_id = dvp->id_id;
+ }
+
+ d->magic = MAGIC(dev->id_unit); /* debugging... */
+ /*
+ * and finally, call the device attach routine
+ * XXX I should probably use d->attach(dev)
+ */
+ stat = snddev_last_probed->attach(dev);
+#if 0
+ /*
+ * XXX hooks for synt support. Try probe and attach...
+ */
+ if (d->synth_base && opl3_probe(dev) ) {
+ opl3_attach(dev);
+ }
+#endif
+ snddev_last_probed = NULL ;
+
#if NAPM > 0
- init_sound_apm(unit);
+ init_sound_apm(dev->id_unit);
#endif
- return 0 ;
+ return stat ;
}
int midiattach(struct isa_device * dev) { return 0 ; }
@@ -605,14 +586,6 @@ sndread(dev_t i_dev, struct uio * buf, int flag)
return uiomove(p, l, buf) ;
}
- /*
- * XXX read from the ad1816 with a single DMA channel is unsupported.
- * This is really not the place for machine-dependent functions,
- * a proper device routine will be supplied in the future - luigi
- */
- if ((d->bd_id == MD_AD1816) && (!(FULL_DUPLEX(d))))
- return EIO;
-
if (d->read) /* device-specific read */
return d->read(i_dev, buf, flag);
@@ -810,12 +783,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
* we start with the new ioctl interface.
*/
case AIONWRITE : /* how many bytes can write ? */
- if (d->dbuf_out.dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(&(d->dbuf_out));
- }
+ if (d->dbuf_out.dl)
+ dsp_wr_dmaupdate(&(d->dbuf_out));
*(int *)arg = d->dbuf_out.fl;
break;
@@ -901,7 +870,7 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
break ;
case AIOSYNC:
- printf("AIOSYNC chan 0x%03lx pos %lu unimplemented\n",
+ printf("AIOSYNC chan 0x%03lx pos %d unimplemented\n",
((snd_sync_parm *)arg)->chan,
((snd_sync_parm *)arg)->pos);
break;
@@ -909,12 +878,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
* here follow the standard ioctls (filio.h etc.)
*/
case FIONREAD : /* get # bytes to read */
- if ( d->dbuf_in.dl ) {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(&(d->dbuf_in));
- }
+ if ( d->dbuf_in.dl )
+ dsp_rd_dmaupdate(&(d->dbuf_in));
*(int *)arg = d->dbuf_in.rl;
break;
@@ -1071,12 +1036,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
audio_buf_info *a = (audio_buf_info *)arg;
snd_dbuf *b = &(d->dbuf_in);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_rd_dmaupdate( b );
a->bytes = d->dbuf_in.fl ;
a->fragments = 1 ;
a->fragstotal = b->bufsize / d->rec_blocksize ;
@@ -1089,12 +1050,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
audio_buf_info *a = (audio_buf_info *)arg;
snd_dbuf *b = &(d->dbuf_out);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_wr_dmaupdate( b );
a->bytes = d->dbuf_out.fl ;
a->fragments = 1 ;
a->fragstotal = b->bufsize / d->play_blocksize ;
@@ -1106,12 +1063,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
count_info *a = (count_info *)arg;
snd_dbuf *b = &(d->dbuf_in);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_rd_dmaupdate( b );
a->bytes = b->total;
a->blocks = (b->total - b->prev_total +
d->rec_blocksize -1 ) / d->rec_blocksize ;
@@ -1124,12 +1077,8 @@ sndioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct proc * p)
{
count_info *a = (count_info *)arg;
snd_dbuf *b = &(d->dbuf_out);
- if (b->dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate( b );
- }
+ if (b->dl)
+ dsp_wr_dmaupdate( b );
a->bytes = b->total;
a->blocks = (b->total - b->prev_total
/* +d->play_blocksize -1*/ ) / d->play_blocksize ;
@@ -1217,12 +1166,8 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
/* XXX fix the test here for half duplex devices */
if (1 /* write is compatible with current mode */) {
flags = spltty();
- if (d->dbuf_out.dl) {
- if (d->special_dma)
- d->callback(d, SND_CB_WR | SND_CB_DMAUPDATE) ;
- else
- dsp_wr_dmaupdate(&(d->dbuf_out));
- }
+ if (d->dbuf_out.dl)
+ dsp_wr_dmaupdate(&(d->dbuf_out));
c = d->dbuf_out.fl ;
if (c < lim) /* no space available */
selrecord(p, & (d->wsel));
@@ -1239,12 +1184,8 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
flags = spltty();
if ( d->dbuf_in.dl == 0 ) /* dma idle, restart it */
dsp_rdintr(d);
- else {
- if (d->special_dma)
- d->callback(d, SND_CB_RD | SND_CB_DMAUPDATE) ;
- else
- dsp_rd_dmaupdate(&(d->dbuf_in));
- }
+ else
+ dsp_rd_dmaupdate(&(d->dbuf_in));
c = d->dbuf_in.rl ;
if (c < lim) /* no data available */
selrecord(p, & (d->rsel));
@@ -1283,7 +1224,7 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
#include <vm/vm_extern.h>
static int
-sndmmap(dev_t dev, vm_offset_t offset, int nprot)
+sndmmap(dev_t dev, int offset, int nprot)
{
snddev_info *d = get_snddev_info(dev, NULL);
@@ -1357,21 +1298,19 @@ init_status(snddev_info *d)
if (status_len != 0) /* only do init once */
return ;
- snprintf(status_buf, sizeof(status_buf),
+ sprintf(status_buf,
"FreeBSD Audio Driver (981002) " __DATE__ " " __TIME__ "\n"
"Installed devices:\n");
for (i = 0; i < NPCM_MAX; i++) {
if (pcm_info[i].open)
- snprintf(status_buf + strlen(status_buf),
- sizeof(status_buf) - strlen(status_buf),
+ sprintf(status_buf + strlen(status_buf),
"pcm%d: <%s> at 0x%x irq %d dma %d:%d\n",
i, pcm_info[i].name, pcm_info[i].io_base,
pcm_info[i].irq,
pcm_info[i].dbuf_out.chan, pcm_info[i].dbuf_in.chan);
if (midi_info[i].open)
- snprintf(status_buf + strlen(status_buf),
- sizeof(status_buf) - strlen(status_buf),
+ sprintf(status_buf + strlen(status_buf),
"midi%d: <%s> at 0x%x irq %d dma %d:%d\n",
i, midi_info[i].name, midi_info[i].io_base,
midi_info[i].irq,
@@ -1384,8 +1323,7 @@ init_status(snddev_info *d)
case 4 : s = "OPL4"; break;
}
- snprintf(status_buf + strlen(status_buf),
- sizeof(status_buf) - strlen(status_buf),
+ sprintf(status_buf + strlen(status_buf),
"sequencer%d: <%s> at 0x%x (not functional)\n",
i, s, pcm_info[i].synth_base);
}
@@ -1505,6 +1443,7 @@ change_bits(mixer_tab *t, u_char *regval, int dev, int chn, int newval)
* full-duplex)
*/
+#if 1
void
translate_bytes (u_char *table, u_char *buff, int n)
{
@@ -1516,5 +1455,22 @@ translate_bytes (u_char *table, u_char *buff, int n)
for (i = 0; i < n; ++i)
buff[i] = table[buff[i]];
}
+#else
+/* inline */
+void
+translate_bytes (const void *table, void *buff, int n)
+{
+ if (n > 0) {
+ __asm__ ( " cld\n"
+ "1: lodsb\n"
+ " xlatb\n"
+ " stosb\n"
+ " loop 1b\n":
+ : "b" (table), "c" (n), "D" (buff), "S" (buff)
+ : "bx", "cx", "di", "si", "ax");
+ }
+}
+
+#endif
#endif /* NPCM > 0 */
diff --git a/sys/i386/isa/snd/sound.h b/sys/i386/isa/snd/sound.h
index c404ce6503d4e..eea64c639f4c2 100644
--- a/sys/i386/isa/snd/sound.h
+++ b/sys/i386/isa/snd/sound.h
@@ -151,14 +151,6 @@ struct _snddev_info {
#define SND_CB_STOP 0x03 /* stop dma op */
#define SND_CB_ABORT 0x04 /* abort dma op */
#define SND_CB_INIT 0x05 /* init board parameters */
-
- /*
- * callback extensions
- */
-#define SND_CB_DMADONE 0x10
-#define SND_CB_DMAUPDATE 0x11
-#define SND_CB_DMASTOP 0x12
-
/* init can only be called with int enabled and
* no pending DMA activity.
*/
@@ -296,10 +288,6 @@ struct _snddev_info {
int synth_base ; /* base for the synth */
int synth_type ; /* type of synth */
void *device_data ; /* just in case it is needed...*/
- int special_dma ;
- /* when this is set, dsp_wr_dmaupdate etc.
- * are processed using callback extensions.
- */
} ;
/*
@@ -313,7 +301,6 @@ struct _snddev_info {
*/
#define MD_AD1848 0x91
#define MD_AD1845 0x92
-#define MD_AD1816 0x93
#define MD_CS4248 0xA1
#define MD_CS4231 0xA2
#define MD_CS4231A 0xA3
@@ -444,12 +431,9 @@ int pcmprobe(struct isa_device * dev);
int midiprobe(struct isa_device * dev);
int synthprobe(struct isa_device * dev);
int pcmattach(struct isa_device * dev);
-int pcminit(snddev_info *d, int unit);
int midiattach(struct isa_device * dev);
int synthattach(struct isa_device * dev);
-ointhand2_t pcmintr;
-
/*
* DMA buffer calls
*/
diff --git a/sys/i386/isa/snd/ulaw.h b/sys/i386/isa/snd/ulaw.h
deleted file mode 100644
index 4b9916f3063e3..0000000000000
--- a/sys/i386/isa/snd/ulaw.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * on entry: ulaw, on exit: unsigned 8 bit.
- */
-static unsigned char ulaw_dsp[] = {
- 3, 7, 11, 15, 19, 23, 27, 31,
- 35, 39, 43, 47, 51, 55, 59, 63,
- 66, 68, 70, 72, 74, 76, 78, 80,
- 82, 84, 86, 88, 90, 92, 94, 96,
- 98, 99, 100, 101, 102, 103, 104, 105,
- 106, 107, 108, 109, 110, 111, 112, 113,
- 113, 114, 114, 115, 115, 116, 116, 117,
- 117, 118, 118, 119, 119, 120, 120, 121,
- 121, 121, 122, 122, 122, 122, 123, 123,
- 123, 123, 124, 124, 124, 124, 125, 125,
- 125, 125, 125, 125, 126, 126, 126, 126,
- 126, 126, 126, 126, 127, 127, 127, 127,
- 127, 127, 127, 127, 127, 127, 127, 127,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 253, 249, 245, 241, 237, 233, 229, 225,
- 221, 217, 213, 209, 205, 201, 197, 193,
- 190, 188, 186, 184, 182, 180, 178, 176,
- 174, 172, 170, 168, 166, 164, 162, 160,
- 158, 157, 156, 155, 154, 153, 152, 151,
- 150, 149, 148, 147, 146, 145, 144, 143,
- 143, 142, 142, 141, 141, 140, 140, 139,
- 139, 138, 138, 137, 137, 136, 136, 135,
- 135, 135, 134, 134, 134, 134, 133, 133,
- 133, 133, 132, 132, 132, 132, 131, 131,
- 131, 131, 131, 131, 130, 130, 130, 130,
- 130, 130, 130, 130, 129, 129, 129, 129,
- 129, 129, 129, 129, 129, 129, 129, 129,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 128, 128, 128, 128, 128,
-};
-
-#ifndef DSP_ULAW_NOT_WANTED
-static unsigned char dsp_ulaw[] = {
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 2, 2, 2, 2, 3, 3, 3,
- 3, 4, 4, 4, 4, 5, 5, 5,
- 5, 6, 6, 6, 6, 7, 7, 7,
- 7, 8, 8, 8, 8, 9, 9, 9,
- 9, 10, 10, 10, 10, 11, 11, 11,
- 11, 12, 12, 12, 12, 13, 13, 13,
- 13, 14, 14, 14, 14, 15, 15, 15,
- 15, 16, 16, 17, 17, 18, 18, 19,
- 19, 20, 20, 21, 21, 22, 22, 23,
- 23, 24, 24, 25, 25, 26, 26, 27,
- 27, 28, 28, 29, 29, 30, 30, 31,
- 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 49, 51, 53, 55, 57, 59, 61,
- 63, 66, 70, 74, 78, 84, 92, 104,
- 254, 231, 219, 211, 205, 201, 197, 193,
- 190, 188, 186, 184, 182, 180, 178, 176,
- 175, 174, 173, 172, 171, 170, 169, 168,
- 167, 166, 165, 164, 163, 162, 161, 160,
- 159, 159, 158, 158, 157, 157, 156, 156,
- 155, 155, 154, 154, 153, 153, 152, 152,
- 151, 151, 150, 150, 149, 149, 148, 148,
- 147, 147, 146, 146, 145, 145, 144, 144,
- 143, 143, 143, 143, 142, 142, 142, 142,
- 141, 141, 141, 141, 140, 140, 140, 140,
- 139, 139, 139, 139, 138, 138, 138, 138,
- 137, 137, 137, 137, 136, 136, 136, 136,
- 135, 135, 135, 135, 134, 134, 134, 134,
- 133, 133, 133, 133, 132, 132, 132, 132,
- 131, 131, 131, 131, 130, 130, 130, 130,
- 129, 129, 129, 129, 128, 128, 128, 128,
-};
-#endif /* !DSP_ULAW_NOT_WANTED */
diff --git a/sys/i386/isa/sound/README.FREEBSD b/sys/i386/isa/sound/README.FREEBSD
index 9979d12fa8239..3603bfe040e90 100644
--- a/sys/i386/isa/sound/README.FREEBSD
+++ b/sys/i386/isa/sound/README.FREEBSD
@@ -90,7 +90,7 @@ Lugi also has Sujal's PnP driver .
This is my kernel configuration for my SB16 PnP:
controller snd0
-device sb0 at isa? port 0x220 irq 10 conflicts drq 3
+device sb0 at isa? port 0x220 irq 10 conflicts drq 3 vector sbintr
device sbxvi0 at isa? port? irq? drq 5 conflicts
device opl0 at isa? port 0x388 conflicts
device sbmidi0 at isa? port 0x300 irq? conflicts
@@ -123,13 +123,13 @@ To configure your guspnp PRO if you have a motherboard which supports
PnP:
controller snd0
- device gus0 at isa?
+ device gus0 at isa? vector gusintr
NONPNP CONFIGURATION
To configure your guspnp PRO if your motherboard does NOT support
PnP:
-device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3
+device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3 vector gusintr
the gus pnp is fully software configurable and the above configuration
diff --git a/sys/i386/isa/sound/ad1848.c b/sys/i386/isa/sound/ad1848.c
index 243ed78d1f518..fbd5051342708 100644
--- a/sys/i386/isa/sound/ad1848.c
+++ b/sys/i386/isa/sound/ad1848.c
@@ -914,6 +914,7 @@ ad1848_start_input(int dev, u_long buf, int count,
static int
ad1848_prepare_for_IO(int dev, int bsize, int bcount)
{
+ int timeout;
u_char fs, old_fs;
u_long flags;
ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc;
@@ -1439,13 +1440,11 @@ ad1848_init(char *name, int io_base, int irq,
outb(io_Status(devc), 0); /* Clear pending interrupts */
if (name != NULL && name[0] != 0)
- snprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
- sizeof(ad1848_pcm_operations[nr_ad1848_devs].name),
- "%s (%s)", name, devc->chip_name);
+ sprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
+ "%s (%s)", name, devc->chip_name);
else
- snprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
- sizeof(ad1848_pcm_operations[nr_ad1848_devs].name),
- "Generic audio codec (%s)", devc->chip_name);
+ sprintf(ad1848_pcm_operations[nr_ad1848_devs].name,
+ "Generic audio codec (%s)", devc->chip_name);
conf_printf2(ad1848_pcm_operations[nr_ad1848_devs].name,
devc->base, devc->irq, dma_playback, dma_capture);
diff --git a/sys/i386/isa/sound/audio.c b/sys/i386/isa/sound/audio.c
index d92dd49dc1645..31f952ea10fa9 100644
--- a/sys/i386/isa/sound/audio.c
+++ b/sys/i386/isa/sound/audio.c
@@ -57,6 +57,15 @@ static char *wr_dma_buf[MAX_AUDIO_DEV];
static int audio_format[MAX_AUDIO_DEV];
static int local_conversion[MAX_AUDIO_DEV];
+#if defined(NO_INLINE_ASM) || !defined(__i386__)
+static void
+translate_bytes(const u_char *table, u_char *buff, int n);
+
+#else
+extern __inline void
+translate_bytes(const void *table, void *buff, int n);
+#endif
+
static int
set_format(int dev, int fmt)
{
@@ -139,6 +148,7 @@ audio_release(int dev, struct fileinfo * file)
}
+#if defined(NO_INLINE_ASM) || !defined(__i386__)
static void
translate_bytes(const u_char *table, u_char *buff, int n)
{
@@ -151,6 +161,23 @@ translate_bytes(const u_char *table, u_char *buff, int n)
buff[i] = table[buff[i]];
}
+#else
+extern __inline void
+translate_bytes(const void *table, void *buff, int n)
+{
+ if (n > 0) {
+ __asm__("cld\n"
+ "1:\tlodsb\n\t"
+ "xlatb\n\t"
+ "stosb\n\t"
+ "loop 1b\n\t":
+ :"b"(table), "c"(n), "D"(buff), "S"(buff)
+ :"bx", "cx", "di", "si", "ax");
+ }
+}
+
+#endif
+
int
audio_write(int dev, struct fileinfo * file, snd_rw_buf * buf, int count)
{
diff --git a/sys/i386/isa/sound/dmabuf.c b/sys/i386/isa/sound/dmabuf.c
index 76494ad8dc686..613e30b862e5e 100644
--- a/sys/i386/isa/sound/dmabuf.c
+++ b/sys/i386/isa/sound/dmabuf.c
@@ -331,6 +331,7 @@ static int
dma_sync(int dev)
{
u_long flags;
+ int i = 0;
if (!audio_devs[dev]->go && (!audio_devs[dev]->enable_bits & PCM_ENABLE_OUTPUT))
return 0;
@@ -1154,6 +1155,8 @@ DMAbuf_outputintr(int dev, int event_type)
if (dmap->mapping_flags & DMA_MAP_MAPPED) {
/* mmapped access */
+ int p = dmap->fragment_size * dmap->qhead;
+
dmap->qhead = (dmap->qhead + 1) % dmap->nbufs;
dmap->qlen++; /* Yes increment it (don't decrement) */
dmap->flags &= ~DMA_ACTIVE;
diff --git a/sys/i386/isa/sound/gus_wave.c b/sys/i386/isa/sound/gus_wave.c
index 54d36cb531f0b..9b3ab0b48b4fc 100644
--- a/sys/i386/isa/sound/gus_wave.c
+++ b/sys/i386/isa/sound/gus_wave.c
@@ -4517,11 +4517,9 @@ gus_wave_init(struct address_info * hw_config)
}
if (gus_pnp_seen) {
- snprintf(gus_info.name, sizeof(gus_info.name),
- "Gravis %s (%dk)", model_num, (int) gus_mem_size / 1024);
+ sprintf(gus_info.name, "Gravis %s (%dk)", model_num, (int) gus_mem_size / 1024);
} else {
- snprintf(gus_info.name, sizeof(gus_info.name),
- "Gravis UltraSound %s (%dk)", model_num, (int) gus_mem_size / 1024);
+ sprintf(gus_info.name, "Gravis UltraSound %s (%dk)", model_num, (int) gus_mem_size / 1024);
}
conf_printf(gus_info.name, hw_config);
diff --git a/sys/i386/isa/sound/mmap_test.c b/sys/i386/isa/sound/mmap_test.c
index c6afae932d470..62de9dfed648c 100644
--- a/sys/i386/isa/sound/mmap_test.c
+++ b/sys/i386/isa/sound/mmap_test.c
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: mmap_test.c,v 1.2 1998/01/16 07:20:34 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <err.h>
diff --git a/sys/i386/isa/sound/mpu401.c b/sys/i386/isa/sound/mpu401.c
index 0bd1412b7b9e9..fdfb94d0b36d0 100644
--- a/sys/i386/isa/sound/mpu401.c
+++ b/sys/i386/isa/sound/mpu401.c
@@ -1002,8 +1002,7 @@ attach_mpu401(struct address_info * hw_config)
MPU_CAP_CLS | MPU_CAP_2PORT;
revision_char = (devc->revision == 0x7f) ? 'M' : ' ';
- snprintf(mpu_synth_info[num_midis].name,
- sizeof(mpu_synth_info[num_midis].name),
+ sprintf(mpu_synth_info[num_midis].name,
"MQX-%d%c MIDI Interface #%d",
ports,
revision_char,
@@ -1016,8 +1015,7 @@ attach_mpu401(struct address_info * hw_config)
devc->capabilities |= MPU_CAP_SYNC | MPU_CAP_FSK;
- snprintf(mpu_synth_info[num_midis].name,
- sizeof(mpu_synth_info[num_midis].name),
+ sprintf(mpu_synth_info[num_midis].name,
"MPU-401 %d.%d%c Midi interface #%d",
(int) (devc->version & 0xf0) >> 4,
devc->version & 0x0f,
diff --git a/sys/i386/isa/sound/pas2_card.c b/sys/i386/isa/sound/pas2_card.c
index dc78afa5cea70..06ab9f2e38c13 100644
--- a/sys/i386/isa/sound/pas2_card.c
+++ b/sys/i386/isa/sound/pas2_card.c
@@ -325,7 +325,7 @@ attach_pas_card(struct address_info * hw_config)
if ((pas_model = pas_read(CHIP_REV))) {
char temp[100];
- snprintf(temp, sizeof(temp),
+ sprintf(temp,
"%s rev %d", pas_model_names[(int) pas_model],
pas_read(BOARD_REV_ID));
conf_printf(temp, hw_config);
diff --git a/sys/i386/isa/sound/patmgr.c b/sys/i386/isa/sound/patmgr.c
index 752b2e95dedda..60f0ed639d905 100644
--- a/sys/i386/isa/sound/patmgr.c
+++ b/sys/i386/isa/sound/patmgr.c
@@ -181,7 +181,7 @@ pmgr_access(int dev, struct patmgr_info * rec)
if (mbox[dev])
printf(" PATMGR: Server %d mbox full. Why?\n", dev);
else {
- int chn;
+ int flag, chn;
rec->key = PM_K_COMMAND;
mbox[dev] = rec;
@@ -235,7 +235,7 @@ pmgr_inform(int dev, int event, u_long p1, u_long p2, u_long p3, u_long p4)
if (mbox[dev])
printf(" PATMGR: Server %d mbox full. Why?\n", dev);
else {
- int chn;
+ int flag, chn;
mbox[dev] = tmp_mbox;
mbox[dev]->key = PM_K_EVENT;
diff --git a/sys/i386/isa/sound/pcm86.c b/sys/i386/isa/sound/pcm86.c
index 9c16d9a44928e..0df86b1d31a9e 100644
--- a/sys/i386/isa/sound/pcm86.c
+++ b/sys/i386/isa/sound/pcm86.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pcm86.c,v 1.5 1998/12/04 22:54:50 archie Exp $
+ * $Id: pcm86.c,v 1.3 1997/02/22 09:38:14 peter Exp $
*/
/*
@@ -1890,8 +1890,7 @@ pcm86_detect(struct address_info *hw_config)
outb(opna_iobase + 2, 0x30);
/* Ok. Detection finished. */
- snprintf(pcm86_operations.name, sizeof(pcm86_operations.name),
- "%s", board_name[pcm_s.board_type]);
+ sprintf(pcm86_operations.name, board_name[pcm_s.board_type]);
pcm_initialized = NO;
pcm_s.irq = irq;
diff --git a/sys/i386/isa/sound/pss.c b/sys/i386/isa/sound/pss.c
index a6a5b65b14499..17acfb2b41725 100644
--- a/sys/i386/isa/sound/pss.c
+++ b/sys/i386/isa/sound/pss.c
@@ -348,7 +348,7 @@ attach_pss(struct address_info * hw_config)
#endif
pss_initialized = 1;
- snprintf(tmp, sizeof(tmp), "ECHO-PSS Rev. %d", id);
+ sprintf(tmp, "ECHO-PSS Rev. %d", id);
conf_printf(tmp, hw_config);
return;
diff --git a/sys/i386/isa/sound/sb16_dsp.c b/sys/i386/isa/sound/sb16_dsp.c
index e923176ed8753..ad9be54032ce8 100644
--- a/sys/i386/isa/sound/sb16_dsp.c
+++ b/sys/i386/isa/sound/sb16_dsp.c
@@ -197,6 +197,8 @@ sb16_dsp_ioctl(int dev, u_int cmd, ioctl_arg arg, int local)
static int
sb16_dsp_open(int dev, int mode)
{
+ int retval;
+
DEB(printf("sb16_dsp_open()\n"));
if (!sb16_dsp_ok) {
@@ -448,8 +450,8 @@ sb16_dsp_init(struct address_info * hw_config)
if (sbc_major < 4)
return; /* Not a SB16 */
- snprintf(sb16_dsp_operations.name, sizeof(sb16_dsp_operations.name),
- "SoundBlaster 16 %d.%d", sbc_major, sbc_minor);
+ sprintf(sb16_dsp_operations.name, "SoundBlaster 16 %d.%d",
+ sbc_major, sbc_minor);
conf_printf(sb16_dsp_operations.name, hw_config);
diff --git a/sys/i386/isa/sound/sb_dsp.c b/sys/i386/isa/sound/sb_dsp.c
index 2facd331139f0..1cf52c5369954 100644
--- a/sys/i386/isa/sound/sb_dsp.c
+++ b/sys/i386/isa/sound/sb_dsp.c
@@ -539,6 +539,8 @@ sb_dsp_halt_xfer(int dev)
static int
sb_dsp_open(int dev, int mode)
{
+ int retval;
+
if (!sb_dsp_ok) {
printf("SB Error: SoundBlaster board not installed\n");
return -(ENXIO);
@@ -1079,8 +1081,7 @@ sb_dsp_init(struct address_info * hw_config)
fmt = "SoundBlaster %d.%d" ;
}
- snprintf(sb_dsp_operations.name, sizeof(sb_dsp_operations.name),
- fmt, sbc_major, sbc_minor);
+ sprintf(sb_dsp_operations.name, fmt, sbc_major, sbc_minor);
conf_printf(sb_dsp_operations.name, hw_config);
#if defined(CONFIG_SB16) && defined(CONFIG_SBPRO)
diff --git a/sys/i386/isa/sound/sequencer.c b/sys/i386/isa/sound/sequencer.c
index 4990774833817..3639cf6f15c50 100644
--- a/sys/i386/isa/sound/sequencer.c
+++ b/sys/i386/isa/sound/sequencer.c
@@ -157,7 +157,7 @@ sequencer_read(int dev, struct fileinfo * file, snd_rw_buf * buf, int count)
flags = splhigh();
if (!iqlen) {
- int chn;
+ int flag, chn;
midi_sleeper = &chn;
diff --git a/sys/i386/isa/sound/sound.doc b/sys/i386/isa/sound/sound.doc
index 2340d6079c185..0b43822fa3828 100644
--- a/sys/i386/isa/sound/sound.doc
+++ b/sys/i386/isa/sound/sound.doc
@@ -1,4 +1,4 @@
-$Id: sound.doc,v 1.9 1998/10/22 15:37:35 bde Exp $
+$Id$
Instructions on using audio on a FreeBSD 2.1 (or 2.0-current) system.
See also /sys/i386/conf/LINT.
@@ -14,10 +14,10 @@ Uncomment one or more of these device entries, depending on what type of
sound card you have:
# ProAudioSpectrum PCM and Midi - for PAS
-#device pas0 at isa? port 0x388 irq 10 drq 6
+#device pas0 at isa? port 0x388 irq 10 drq 6 vector pasintr
# SoundBlaster DSP driver - for SB, SB Pro, SB16, PAS(emulating SB)
-#device sb0 at isa? port 0x220 irq 7 drq 1
+#device sb0 at isa? port 0x220 irq 7 drq 1 vector sbintr
# SoundBlaster 16 DSP driver - for SB16 - requires sb0 device
#device sbxvi0 at isa? drq 5
@@ -28,13 +28,13 @@ sound card you have:
# Gravis UltraSound - for GUS, GUS16, GUSMAX
# For cards that use 2 DMA Channels:
# drq = Write DMA Channel, flags = Read DMA Channel
-#device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3
+#device gus0 at isa? port 0x220 irq 11 drq 1 flags 0x3 vector gusintr
# Gravis UltraSound 16 bit option - for GUS16 - requires gus0
-#device gusxvi0 at isa? port 0x530 irq 7 drq 3
+#device gusxvi0 at isa? port 0x530 irq 7 drq 3 vector adintr
# MS Sound System (AD1848 Based Boards)
-#device mss0 at isa? port 0x530 irq 10 drq 1
+#device mss0 at isa? port 0x530 irq 10 drq 1 vector adintr
# Yamaha OPL-2/OPL-3 FM - for SB, SB Pro, SB16, PAS
#device opl0 at isa? port 0x388
@@ -43,7 +43,7 @@ sound card you have:
#device mpu0 at isa? port 0x330 irq 6 drq 0
# 6850 UART Midi
-#device uart0 at isa? port 0x330 irq 5
+#device uart0 at isa? port 0x330 irq 5 vector "m6850intr"
You may add one or more of the following depending on what you do and don't
want compiled into your kernel. Note: Excluding things with EXCLUDE_...
diff --git a/sys/i386/isa/sound/sound_calls.h b/sys/i386/isa/sound/sound_calls.h
index cb00e30926a3a..62d95487e6894 100644
--- a/sys/i386/isa/sound/sound_calls.h
+++ b/sys/i386/isa/sound/sound_calls.h
@@ -99,7 +99,6 @@ int sb_dsp_detect (struct address_info *hw_config);
void sb_dsp_init (struct address_info *hw_config);
void sb_dsp_disable_midi(void);
int sb_dsp_command (u_char val);
-ointhand2_t sbintr;
int sb_reset_dsp (void);
/* From sb16_dsp.c */
@@ -141,7 +140,6 @@ int probe_adlib(struct address_info *hw_config);
/* From pas_card.c */
void attach_pas_card(struct address_info *hw_config);
int probe_pas(struct address_info *hw_config);
-ointhand2_t pasintr;
int pas_set_intr(int mask);
int pas_remove_intr(int mask);
u_char pas_read(int ioaddr);
@@ -162,7 +160,7 @@ void pas_midi_interrupt(void);
void attach_gus_card(struct address_info * hw_config);
int probe_gus(struct address_info *hw_config);
int gus_set_midi_irq(int num);
-ointhand2_t gusintr;
+/*void gusintr(int irq); */
void attach_gus_db16(struct address_info * hw_config);
int probe_gus_db16(struct address_info *hw_config);
@@ -188,7 +186,6 @@ void mpuintr(int irq);
/* From uart6850.c */
void attach_uart6850(struct address_info * hw_config);
-ointhand2_t m6850intr;
int probe_uart6850(struct address_info *hw_config);
/* From opl3.c */
@@ -212,7 +209,6 @@ void sound_timer_syncinterval(u_int new_usecs);
/* From ad1848.c */
void ad1848_init (char *name, int io_base, int irq, int dma_playback, int dma_capture, int share_dma, sound_os_info *osp);
-ointhand2_t adintr;
int ad1848_detect (int io_base, int *flags, sound_os_info *osp);
#define AD_F_CS4231 0x0001 /* Returned if a CS4232 (or compatible) detected */
@@ -237,7 +233,6 @@ int probe_sscape (struct address_info *hw_config);
void attach_sscape (struct address_info *hw_config);
int probe_ss_mss(struct address_info *hw_config);
void attach_ss_mss(struct address_info * hw_config);
-ointhand2_t sscapeintr;
int pss_read (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
int pss_write (int dev, struct fileinfo *file, snd_rw_buf *buf, int count);
diff --git a/sys/i386/isa/sound/sound_timer.c b/sys/i386/isa/sound/sound_timer.c
index cef7596f0962e..8450b2d73503d 100644
--- a/sys/i386/isa/sound/sound_timer.c
+++ b/sys/i386/isa/sound/sound_timer.c
@@ -335,7 +335,7 @@ sound_timer_init(struct sound_lowlev_timer * t, char *name)
else
n = num_sound_timers++;
- snprintf(sound_timer.info.name, sizeof(sound_timer.info.name), "%s", name);
+ strcpy(sound_timer.info.name, name);
sound_timer_devs[n] = &sound_timer;
}
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c
index 3b6db0be26e53..52428b404e337 100644
--- a/sys/i386/isa/sound/soundcard.c
+++ b/sys/i386/isa/sound/soundcard.c
@@ -34,8 +34,6 @@
#endif /* DEVFS */
#if NSND > 0 /* from "snd.h" */
-#include "uart.h"
-
#include <vm/vm.h>
#include <vm/pmap.h>
#include <sys/mman.h>
@@ -132,8 +130,6 @@ struct isa_driver sscape_mssdriver = {sndprobe, sndattach, "sscape_mss"};
short ipri_to_irq(u_short ipri);
-static ointhand2_t sndintr;
-
u_long
get_time(void)
{
@@ -147,6 +143,7 @@ get_time(void)
static int
sndmmap( dev_t dev, int offset, int nprot )
{
+ int unit;
struct dma_buffparms * dmap;
dev = minor(dev) >> 4;
@@ -399,41 +396,8 @@ sndattach(struct isa_device * dev)
static int midi_initialized = 0;
static int seq_initialized = 0;
struct address_info hw_config;
- char *dname;
void *tmp;
-
- /*
- * Associate interrupt handlers with devices. XXX this may be incomplete.
- */
- dname = dev->id_driver->name;
-#if defined(CONFIG_AD1848)
- if (strcmp(dname, "css") == 0 || strcmp(dname, "gusxvi") == 0 ||
- strcmp(dname, "mss") == 0)
- dev->id_ointr = adintr;
-#endif
-#ifdef CONFIG_GUS
- if (strcmp(dname, "gus") == 0)
- dev->id_ointr = gusintr;
-#endif
-#ifdef CONFIG_PAS
- if (strcmp(dname, "pas") == 0)
- dev->id_ointr = pasintr;
-#endif
-#if NSB > 0 && (defined(CONFIG_MIDI) || defined(CONFIG_AUDIO))
- if (strcmp(dname, "sb") == 0)
- dev->id_ointr = sbintr;
-#endif
- if (strcmp(dname, "sscape_mss") == 0)
- dev->id_ointr = sndintr;
-#if NSSCAPE > 0
- if (strcmp(dname, "sscape") == 0 || strcmp(dname, "trix") == 0)
- dev->id_ointr = sscapeintr;
-#endif
-#if NUART > 0
- if (strcmp(dname, "uart0") == 0)
- dev->id_ointr = m6850intr;
-#endif
-
+
unit = driver_to_voxunit(dev->id_driver);
hw_config.io_base = dev->id_iobase;
hw_config.irq = ipri_to_irq(dev->id_irq);
@@ -499,35 +463,35 @@ sndattach(struct isa_device * dev)
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"sequencer%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "sequencer");
+ if (tmp) devfs_link(tmp, "sequencer");
} else if (dev->id_driver == &mpudriver ||
dev->id_driver == &sbmididriver ||
dev->id_driver == &uartdriver){
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"midi%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "midi");
+ if (tmp) devfs_link(tmp, "midi");
} else {
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"dsp%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "dsp");
+ if (tmp) devfs_link(tmp, "dsp");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"dspW%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "dspW");
+ if (tmp) devfs_link(tmp, "dspW");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"audio%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "audio");
+ if (tmp) devfs_link(tmp, "audio");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"mixer%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "mixer");
+ if (tmp) devfs_link(tmp, "mixer");
tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS,
DV_CHR, UID_SND, GID_SND, PERM_SND,
"sndstat%r", dev->id_unit);
- if (tmp) devfs_makelink(tmp, "sndstat");
+ if (tmp) devfs_link(tmp, "sndstat");
}
#endif /* DEVFS */
return TRUE;
@@ -612,7 +576,7 @@ snd_set_irq_handler(int int_lvl, void (*hndlr) (int), sound_os_info * osp)
return 1;
}
-static void
+void
sndintr(int unit)
{
if ( (unit >= MAX_UNIT) || (irq_proc[unit] == NULL) )
diff --git a/sys/i386/isa/sound/sscape.c b/sys/i386/isa/sound/sscape.c
index 28ef04467bcdd..bfd5abe8afd10 100644
--- a/sys/i386/isa/sound/sscape.c
+++ b/sys/i386/isa/sound/sscape.c
@@ -292,6 +292,7 @@ void
sscapeintr(int irq)
{
u_char bits, tmp;
+ static int debug = 0;
DEB(printf("sscapeintr(0x%02x)\n", (bits = sscape_read(devc, GA_INTSTAT_REG))));
if ((sscape_sleep_flag.mode & WK_SLEEP)) {
@@ -303,8 +304,6 @@ sscapeintr(int irq)
}
#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI)
if (bits & 0x01) {
- static int debug = 0;
-
mpuintr(irq);
if (debug++ > 10) { /* Temporary debugging hack */
sscape_write(devc, GA_INTENA_REG, 0x00); /* Disable all interr. */
@@ -455,6 +454,7 @@ sscape_download_boot(struct sscape_info * devc, u_char *block, int size, int fla
done = 0;
timeout_val = 100;
while (!done && timeout_val-- > 0) {
+ int resid;
int chn;
sscape_sleeper = &chn;
DO_SLEEP(chn, sscape_sleep_flag, 1);
@@ -733,8 +733,6 @@ sscape_audio_reset(int dev)
sscape_audio_halt(dev);
}
-
-#if !defined(EXCLUDE_NATIVE_PCM) && defined(CONFIG_AUDIO)
static struct audio_operations sscape_audio_operations =
{
"Not functional",
@@ -753,13 +751,14 @@ static struct audio_operations sscape_audio_operations =
NULL,
NULL
};
-#endif /* !defined(EXCLUDE_NATIVE_PCM) && defined(CONFIG_AUDIO) */
static int sscape_detected = 0;
void
attach_sscape(struct address_info * hw_config)
{
+ int my_dev;
+
#ifndef SSCAPE_REGS
/*
* Config register values for Spea/V7 Media FX and Ensoniq S-2000.
@@ -878,8 +877,6 @@ attach_sscape(struct address_info * hw_config)
#ifdef CONFIG_AUDIO
if (num_audiodevs < MAX_AUDIO_DEV) {
- int my_dev;
-
audio_devs[my_dev = num_audiodevs++] = &sscape_audio_operations;
audio_devs[my_dev]->dmachan1 = hw_config->dma;
audio_devs[my_dev]->buffsize = DSP_BUFFSIZE;
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c
index e0f33a79f6652..50aebba2f18ca 100644
--- a/sys/i386/isa/spigot.c
+++ b/sys/i386/isa/spigot.c
@@ -107,8 +107,6 @@ static struct cdevsw spigot_cdevsw =
spigot_ioctl, nostop, nullreset, nodevtotty,/* Spigot */
seltrue, spigot_mmap, NULL, "spigot", NULL, -1 };
-static ointhand2_t spigintr;
-
static int
spigot_probe(struct isa_device *devp)
{
@@ -135,7 +133,6 @@ spigot_attach(struct isa_device *devp)
int unit;
struct spigot_softc *ss= &spigot_softc[unit = devp->id_unit];
- devp->id_ointr = spigintr;
ss->maddr = kvtop(devp->id_maddr);
ss->irq = devp->id_irq;
#ifdef DEVFS
@@ -249,7 +246,7 @@ struct spigot_info *info;
* Interrupt procedure.
* Just call a user level interrupt routine.
*/
-static void
+void
spigintr(int unit)
{
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[unit];
@@ -259,7 +256,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[unit];
}
static int
-spigot_mmap(dev_t dev, vm_offset_t offset, int nprot)
+spigot_mmap(dev_t dev, int offset, int nprot)
{
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[0];
diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c
index e6697a17aaa1b..f85ae2eb26842 100644
--- a/sys/i386/isa/stallion.c
+++ b/sys/i386/isa/stallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: stallion.c,v 1.23 1998/10/22 05:58:40 bde Exp $
+ * $Id: stallion.c,v 1.21 1998/08/23 08:26:41 bde Exp $
*/
/*****************************************************************************/
@@ -467,7 +467,6 @@ static int stl_brdinit(stlbrd_t *brdp);
static int stl_initeio(stlbrd_t *brdp);
static int stl_initech(stlbrd_t *brdp);
static int stl_initports(stlbrd_t *brdp, stlpanel_t *panelp);
-static ointhand2_t stlintr;
static __inline void stl_txisr(stlpanel_t *panelp, int ioaddr);
static __inline void stl_rxisr(stlpanel_t *panelp, int ioaddr);
static __inline void stl_mdmisr(stlpanel_t *panelp, int ioaddr);
@@ -491,7 +490,7 @@ static int stl_clrportstats(stlport_t *portp, caddr_t data);
static stlport_t *stl_getport(int brdnr, int panelnr, int portnr);
#if NPCI > 0
-static const char *stlpciprobe(pcici_t tag, pcidi_t type);
+static char *stlpciprobe(pcici_t tag, pcidi_t type);
static void stlpciattach(pcici_t tag, int unit);
static void stlpciintr(void * arg);
#endif
@@ -635,8 +634,6 @@ static int stlattach(struct isa_device *idp)
idp->id_unit, idp->id_iobase);
#endif
- idp->id_ointr = stlintr;
-
brdp = (stlbrd_t *) malloc(sizeof(stlbrd_t), M_TTYS, M_NOWAIT);
if (brdp == (stlbrd_t *) NULL) {
printf("STALLION: failed to allocate memory (size=%d)\n",
@@ -673,7 +670,7 @@ static int stlattach(struct isa_device *idp)
* carefull here, since it looks sort like a Nat Semi IDE chip...
*/
-static const char *stlpciprobe(pcici_t tag, pcidi_t type)
+char *stlpciprobe(pcici_t tag, pcidi_t type)
{
unsigned long class;
@@ -1761,7 +1758,7 @@ static __inline void stl_mdmisr(stlpanel_t *panelp, int ioaddr)
* io register.
*/
-static void stlintr(int unit)
+void stlintr(int unit)
{
stlbrd_t *brdp;
stlpanel_t *panelp;
diff --git a/sys/dev/syscons/syscons.c b/sys/i386/isa/syscons.c
index ce71733f1584f..eba0d36dc0abd 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/i386/isa/syscons.c
@@ -25,20 +25,15 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.292 1999/01/17 14:23:15 yokota Exp $
+ * $Id: syscons.c,v 1.283 1998/10/01 11:39:18 yokota Exp $
*/
#include "sc.h"
-#include "splash.h"
-#ifdef __i386__
#include "apm.h"
-#endif
#include "opt_ddb.h"
#include "opt_devfs.h"
-#ifdef __i386__
#include "opt_vesa.h"
#include "opt_vm86.h"
-#endif
#include "opt_syscons.h"
#if NSC > 0
@@ -64,29 +59,21 @@
#include <machine/psl.h>
#include <machine/frame.h>
#include <machine/pc/display.h>
-#ifdef __i386__
#include <machine/pc/vesa.h>
#include <machine/apm_bios.h>
#include <machine/random.h>
-#endif
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
-#include <dev/kbd/kbdreg.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/vgareg.h>
-#include <dev/fb/splashreg.h>
-#include <dev/syscons/syscons.h>
-
-#ifndef __i386__
-#include <isa/isareg.h>
-#else
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
-#endif
+#include <i386/isa/kbdtables.h>
+#include <i386/isa/kbdio.h>
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
#if !defined(MAXCONS)
#define MAXCONS 16
@@ -132,6 +119,10 @@ typedef struct old_mouse_info {
} u;
} old_mouse_info_t;
+/* XXX use sc_bcopy where video memory is concerned */
+extern void generic_bcopy(const void *, void *, size_t);
+extern void generic_bzero(void *, size_t);
+
static default_attr user_default = {
(FG_LIGHTGREY | BG_BLACK) << 8,
(FG_BLACK | BG_LIGHTGREY) << 8
@@ -154,6 +145,8 @@ static scr_stat *new_scp, *old_scp;
static term_stat kernel_console;
static default_attr *current_default;
static int sc_flags;
+static int sc_port = IO_KBD;
+static KBDC sc_kbdc = NULL;
static char init_done = COLD;
static u_short sc_buffer[ROW*COL];
static char shutdown_in_progress = FALSE;
@@ -162,20 +155,25 @@ static char switch_in_progress = FALSE;
static char write_in_progress = FALSE;
static char blink_in_progress = FALSE;
static int blinkrate = 0;
-static int adapter = -1;
-static int keyboard = -1;
-static keyboard_t *kbd;
+ u_int crtc_addr = MONO_BASE;
+ char crtc_type = KD_MONO;
+static char crtc_vga = FALSE;
+static int adp_flags;
+static u_char shfts = 0, ctls = 0, alts = 0, agrs = 0, metas = 0;
+static u_char accents = 0;
+static u_char nlkcnt = 0, clkcnt = 0, slkcnt = 0, alkcnt = 0;
+static const u_int n_fkey_tab = sizeof(fkey_tab) / sizeof(*fkey_tab);
static int delayed_next_scr = FALSE;
static long scrn_blank_time = 0; /* screen saver timeout value */
-static int scrn_blanked = FALSE; /* screen saver active flag */
+ int scrn_blanked = 0; /* screen saver active flag */
static long scrn_time_stamp;
static int saver_mode = CONS_LKM_SAVER; /* LKM/user saver */
static int run_scrn_saver = FALSE; /* should run the saver? */
static int scrn_idle = FALSE; /* about to run the saver */
-static int scrn_saver_failed;
u_char scr_map[256];
u_char scr_rmap[256];
static int initial_video_mode; /* initial video mode # */
+static int bios_video_mode; /* video mode # set by BIOS */
int fonts_loaded = 0
#ifdef STD8X16FONT
| FONT_16
@@ -212,14 +210,10 @@ static int extra_history_size =
static void none_saver(int blank) { }
static void (*current_saver)(int blank) = none_saver;
+static void (*default_saver)(int blank) = none_saver;
d_ioctl_t *sc_user_ioctl;
static int sticky_splash = FALSE;
-static struct {
- u_int8_t cursor_start;
- u_int8_t cursor_end;
- u_int8_t shift_state;
- } bios_value;
/* OS specific stuff */
#ifdef not_yet_done
@@ -235,7 +229,7 @@ static struct tty sccons[MAXCONS+2];
#endif
#define SC_MOUSE 128
#define SC_CONSOLE 255
-vm_offset_t Crtat;
+u_short *Crtat;
static const int nsccons = MAXCONS+2;
#define WRAPHIST(scp, pointer, offset)\
@@ -243,61 +237,29 @@ static const int nsccons = MAXCONS+2;
+ (offset)) % (scp)->history_size))
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
-/* some useful macros */
-#define kbd_read_char(kbd, wait) \
- (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait))
-#define kbd_check_char(kbd) \
- (*kbdsw[(kbd)->kb_index]->check_char)((kbd))
-#define kbd_enable(kbd) \
- (*kbdsw[(kbd)->kb_index]->enable)((kbd))
-#define kbd_disable(kbd) \
- (*kbdsw[(kbd)->kb_index]->disable)((kbd))
-#define kbd_lock(kbd, lockf) \
- (*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf))
-#define kbd_ioctl(kbd, cmd, arg) \
- (((kbd) == NULL) ? \
- ENODEV : (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg)))
-#define kbd_clear_state(kbd) \
- (*kbdsw[(kbd)->kb_index]->clear_state)((kbd))
-#define kbd_get_fkeystr(kbd, fkey, len) \
- (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len))
-
/* prototypes */
-static kbd_callback_func_t sckbdevent;
+static int scattach(struct isa_device *dev);
static int scparam(struct tty *tp, struct termios *t);
-static int scvidprobe(int unit, int flags, int cons);
-static int sckbdprobe(int unit, int flags, int cons);
+static int scprobe(struct isa_device *dev);
+static int scvidprobe(int unit, int flags);
+static int sckbdprobe(int unit, int flags);
static void scstart(struct tty *tp);
static void scmousestart(struct tty *tp);
static void scinit(void);
static void scshutdown(int howto, void *arg);
-static u_int scgetc(keyboard_t *kbd, u_int flags);
+static u_int scgetc(u_int flags);
#define SCGETC_CN 1
#define SCGETC_NONBLOCK 2
-static int sccngetch(int flags);
static void sccnupdate(scr_stat *scp);
static scr_stat *alloc_scp(void);
static void init_scp(scr_stat *scp);
-static void get_bios_values(void);
static void sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark);
static int get_scr_num(void);
static timeout_t scrn_timer;
static void scrn_update(scr_stat *scp, int show_cursor);
-#if NSPLASH > 0
-static int scsplash_callback(int);
-static void scsplash_saver(int show);
-static int add_scrn_saver(void (*this_saver)(int));
-static int remove_scrn_saver(void (*this_saver)(int));
-static int set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border);
-static int restore_scrn_saver_mode(scr_stat *scp, int changemode);
+static void scrn_saver(void (*saver)(int), int blank);
static void stop_scrn_saver(void (*saver)(int));
static int wait_scrn_saver_stop(void);
-#define scsplash_stick(stick) (sticky_splash = (stick))
-#else /* !NSPLASH */
-#define stop_scrn_saver(saver)
-#define wait_scrn_saver_stop() 0
-#define scsplash_stick(stick)
-#endif /* NSPLASH */
static int switch_scr(scr_stat *scp, u_int next_scr);
static void exchange_scr(void);
static void scan_esc(scr_stat *scp, u_char c);
@@ -305,13 +267,13 @@ static void ansi_put(scr_stat *scp, u_char *buf, int len);
static void draw_cursor_image(scr_stat *scp);
static void remove_cursor_image(scr_stat *scp);
static void move_crsr(scr_stat *scp, int x, int y);
+static u_char *get_fstr(u_int c, u_int *len);
static void history_to_screen(scr_stat *scp);
static int history_up_line(scr_stat *scp);
static int history_down_line(scr_stat *scp);
static int mask2attr(struct term_stat *term);
-static int save_kbd_state(scr_stat *scp);
-static int update_kbd_state(int state, int mask);
-static int update_kbd_leds(int which);
+static void set_keyboard(int command, int data);
+static void update_leds(int which);
static void set_destructive_cursor(scr_stat *scp);
static void set_mouse_pos(scr_stat *scp);
static int skip_spc_right(scr_stat *scp, u_short *p);
@@ -329,32 +291,19 @@ static void draw_cutmarking(scr_stat *scp);
static void remove_cutmarking(scr_stat *scp);
static void do_bell(scr_stat *scp, int pitch, int duration);
static timeout_t blink_screen;
+#ifdef SC_SPLASH_SCREEN
+static void scsplash_init(scr_stat *scp);
+static void scsplash_term(scr_stat *scp);
+static void scsplash_saver(int show);
+#define scsplash_stick(stick) (sticky_splash = (stick))
+#else
+#define scsplash_stick(stick)
+#endif
-#define CDEV_MAJOR 12
-
-#ifdef __i386__
-
-static cn_probe_t sccnprobe;
-static cn_init_t sccninit;
-static cn_getc_t sccngetc;
-static cn_checkc_t sccncheckc;
-static cn_putc_t sccnputc;
-
-CONS_DRIVER(sc, sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc);
-
-#else /* !__i386__ */
-
-static cn_getc_t sccngetc;
-static cn_checkc_t sccncheckc;
-static cn_putc_t sccnputc;
-
-struct consdev sc_cons = {
- NULL, NULL, sccngetc, sccncheckc, sccnputc,
- NULL, makedev(CDEV_MAJOR, 0), CN_NORMAL,
+struct isa_driver scdriver = {
+ scprobe, scattach, "sc", 1
};
-#endif /* __i386__ */
-
static d_open_t scopen;
static d_close_t scclose;
static d_read_t scread;
@@ -362,7 +311,8 @@ static d_write_t scwrite;
static d_ioctl_t scioctl;
static d_mmap_t scmmap;
-struct cdevsw sc_cdevsw = {
+#define CDEV_MAJOR 12
+static struct cdevsw sc_cdevsw = {
scopen, scclose, scread, scwrite,
scioctl, nullstop, noreset, scdevtotty,
ttpoll, scmmap, nostrategy, "sc",
@@ -370,38 +320,11 @@ struct cdevsw sc_cdevsw = {
D_TTY,
};
-#ifdef __i386__
-
-#define fillw_io(p, b, c) fillw((p), (void *)(b), (c))
-
-#endif
-
-#ifdef __alpha__
-
-static void
-fillw(int pat, void *base, size_t cnt)
-{
- u_short *sp = base;
- while (cnt--)
- *sp++ = pat;
-}
-
-static void
-fillw_io(int pat, u_int32_t base, size_t cnt)
-{
- while (cnt--) {
- writew(base, pat);
- base += 2;
- }
-}
-
-#endif
-
static void
draw_cursor_image(scr_stat *scp)
{
u_short cursor_image;
- vm_offset_t ptr;
+ u_short *ptr;
u_short prev_image;
if (ISPIXELSC(scp)) {
@@ -410,12 +333,13 @@ draw_cursor_image(scr_stat *scp)
return;
}
- ptr = scp->adp->va_window + 2*(scp->cursor_pos - scp->scr_buf);
+ ptr = (u_short *)(get_adapter(scp)->va_window)
+ + (scp->cursor_pos - scp->scr_buf);
/* do we have a destructive cursor ? */
if (sc_flags & CHAR_CURSOR) {
prev_image = scp->cursor_saveunder;
- cursor_image = readw(ptr) & 0x00ff;
+ cursor_image = *ptr & 0x00ff;
if (cursor_image == DEAD_CHAR)
cursor_image = prev_image & 0x00ff;
cursor_image |= *(scp->cursor_pos) & 0xff00;
@@ -438,7 +362,7 @@ draw_cursor_image(scr_stat *scp)
cursor_image |= DEAD_CHAR;
}
} else {
- cursor_image = (readw(ptr) & 0x00ff) | *(scp->cursor_pos) & 0xff00;
+ cursor_image = (*(ptr) & 0x00ff) | *(scp->cursor_pos) & 0xff00;
scp->cursor_saveunder = cursor_image;
if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
if ((cursor_image & 0x7000) == 0x7000) {
@@ -452,7 +376,7 @@ draw_cursor_image(scr_stat *scp)
}
}
}
- writew(ptr, cursor_image);
+ *ptr = cursor_image;
}
static void
@@ -462,8 +386,9 @@ remove_cursor_image(scr_stat *scp)
sc_bcopy(scp, scp->scr_buf, scp->cursor_oldpos - scp->scr_buf,
scp->cursor_oldpos - scp->scr_buf, 0);
else
- writew(scp->adp->va_window + 2*(scp->cursor_oldpos - scp->scr_buf),
- scp->cursor_saveunder);
+ *((u_short *)(get_adapter(scp)->va_window)
+ + (scp->cursor_oldpos - scp->scr_buf))
+ = scp->cursor_saveunder;
}
static void
@@ -482,100 +407,258 @@ move_crsr(scr_stat *scp, int x, int y)
scp->cursor_pos = scp->scr_buf + scp->ypos * scp->xsize + scp->xpos;
}
-int
-sc_probe_unit(int unit, int flags)
+static int
+scprobe(struct isa_device *dev)
{
- if (!scvidprobe(unit, flags, FALSE)) {
+ if (!scvidprobe(dev->id_unit, dev->id_flags)) {
if (bootverbose)
- printf("sc%d: no video adapter is found.\n", unit);
- return ENXIO;
+ printf("sc%d: no video adapter is found.\n", dev->id_unit);
+ return (0);
}
- return ((sckbdprobe(unit, flags, FALSE)) ? 0 : ENXIO);
+#if defined(VESA) && defined(VM86)
+ if (vesa_load())
+ return FALSE;
+#endif
+
+ (*biosvidsw.diag)(bootverbose);
+
+ sc_port = dev->id_iobase;
+ if (sckbdprobe(dev->id_unit, dev->id_flags))
+ return (IO_KBDSIZE);
+ else
+ return ((dev->id_flags & DETECT_KBD) ? 0 : IO_KBDSIZE);
}
/* probe video adapters, return TRUE if found */
static int
-scvidprobe(int unit, int flags, int cons)
+scvidprobe(int unit, int flags)
{
video_adapter_t *adp;
- /*
- * Access the video adapter driver through the back door!
- * Video adapter drivers need to be configured before syscons.
- * However, when syscons is being probed as the low-level console,
- * they have not been initialized yet. We force them to initialize
- * themselves here. XXX
- */
- vid_configure(cons ? VIO_PROBE_ONLY : 0);
-
- /* allocate a frame buffer */
- if (adapter < 0) {
- adapter = vid_allocate("*", -1, (void *)&adapter);
- if (adapter < 0)
- return FALSE;
- }
- adp = vid_get_adapter(adapter); /* shouldn't fail */
-
- Crtat = adp->va_window;
+ /* do this test only once */
+ if (init_done != COLD)
+ return (crtc_type != -1);
+
+ if ((*biosvidsw.init)() <= 0)
+ return FALSE;
+ if ((adp = (*biosvidsw.adapter)(V_ADP_PRIMARY)) == NULL)
+ return FALSE;
+
+ crtc_type = adp->va_type;
+ crtc_vga = (crtc_type == KD_VGA);
+ crtc_addr = adp->va_crtc_addr;
+ Crtat = (u_short *)adp->va_window;
+ adp_flags = adp->va_flags;
initial_video_mode = adp->va_initial_mode;
+ bios_video_mode = adp->va_initial_bios_mode;
return TRUE;
}
/* probe the keyboard, return TRUE if found */
static int
-sckbdprobe(int unit, int flags, int cons)
+sckbdprobe(int unit, int flags)
{
- /* access the keyboard driver through the backdoor! */
- kbd_configure(cons ? KB_CONF_PROBE_ONLY : 0);
-
- /* allocate a keyboard and register the keyboard event handler */
- if (keyboard < 0) {
- keyboard = kbd_allocate("*", -1, (void *)&keyboard, sckbdevent, NULL);
- if (keyboard < 0)
- return FALSE;
+ int codeset;
+ int c = -1;
+ int m;
+ int res, id;
+
+ sc_kbdc = kbdc_open(sc_port);
+
+ if (!kbdc_lock(sc_kbdc, TRUE)) {
+ /* driver error? */
+ printf("sc%d: unable to lock the controller.\n", unit);
+ return ((flags & DETECT_KBD) ? FALSE : TRUE);
+ }
+
+ /* flush any noise in the buffer */
+ empty_both_buffers(sc_kbdc, 10);
+
+ /* save the current keyboard controller command byte */
+ m = kbdc_get_device_mask(sc_kbdc) & ~KBD_KBD_CONTROL_BITS;
+ c = get_controller_command_byte(sc_kbdc);
+ if (c == -1) {
+ /* CONTROLLER ERROR */
+ printf("sc%d: unable to get the current command byte value.\n", unit);
+ goto fail;
+ }
+ if (bootverbose)
+ printf("sc%d: the current keyboard controller command byte %04x\n",
+ unit, c);
+#if 0
+ /* override the keyboard lock switch */
+ c |= KBD_OVERRIDE_KBD_LOCK;
+#endif
+
+ /*
+ * The keyboard may have been screwed up by the boot block.
+ * We may just be able to recover from error by testing the controller
+ * and the keyboard port. The controller command byte needs to be saved
+ * before this recovery operation, as some controllers seem to set
+ * the command byte to particular values.
+ */
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+
+ /* enable the keyboard port, but disable the keyboard intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS,
+ KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * there is very little we can do...
+ */
+ printf("sc%d: unable to set the command byte.\n", unit);
+ goto fail;
+ }
+
+ /*
+ * Check if we have an XT keyboard before we attempt to reset it.
+ * The procedure assumes that the keyboard and the controller have
+ * been set up properly by BIOS and have not been messed up
+ * during the boot process.
+ */
+ codeset = -1;
+ if (flags & XT_KEYBD)
+ /* the user says there is a XT keyboard */
+ codeset = 1;
+#ifdef DETECT_XT_KEYBOARD
+ else if ((c & KBD_TRANSLATION) == 0) {
+ /* SET_SCANCODE_SET is not always supported; ignore error */
+ if (send_kbd_command_and_data(sc_kbdc, KBDC_SET_SCANCODE_SET, 0)
+ == KBD_ACK)
+ codeset = read_kbd_data(sc_kbdc);
+ }
+ if (bootverbose)
+ printf("sc%d: keyboard scancode set %d\n", unit, codeset);
+#endif /* DETECT_XT_KEYBOARD */
+
+ if (flags & KBD_NORESET) {
+ write_kbd_command(sc_kbdc, KBDC_ECHO);
+ if (read_kbd_data(sc_kbdc) != KBD_ECHO) {
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: failed to get response from the keyboard.\n",
+ unit);
+ goto fail;
+ }
+ } else {
+ /* reset keyboard hardware */
+ if (!reset_kbd(sc_kbdc)) {
+ /* KEYBOARD ERROR
+ * Keyboard reset may fail either because the keyboard doen't
+ * exist, or because the keyboard doesn't pass the self-test,
+ * or the keyboard controller on the motherboard and the keyboard
+ * somehow fail to shake hands. It is just possible, particularly
+ * in the last case, that the keyoard controller may be left
+ * in a hung state. test_controller() and test_kbd_port() appear
+ * to bring the keyboard controller back (I don't know why and
+ * how, though.)
+ */
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ /* We could disable the keyboard port and interrupt... but,
+ * the keyboard may still exist (see above).
+ */
+ if (bootverbose)
+ printf("sc%d: failed to reset the keyboard.\n", unit);
+ goto fail;
+ }
}
- kbd = kbd_get_keyboard(keyboard); /* shouldn't fail */
+ /*
+ * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
+ * such as those on the IBM ThinkPad laptop computers can be used
+ * with the standard console driver.
+ */
+ if (codeset == 1) {
+ if (send_kbd_command_and_data(
+ sc_kbdc, KBDC_SET_SCANCODE_SET, codeset) == KBD_ACK) {
+ /* XT kbd doesn't need scan code translation */
+ c &= ~KBD_TRANSLATION;
+ } else {
+ /* KEYBOARD ERROR
+ * The XT kbd isn't usable unless the proper scan code set
+ * is selected.
+ */
+ printf("sc%d: unable to set the XT keyboard mode.\n", unit);
+ goto fail;
+ }
+ }
+ /* enable the keyboard port and intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
+ (c & (KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK))
+ | KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * This is serious; we are left with the disabled keyboard intr.
+ */
+ printf("sc%d: unable to enable the keyboard port and intr.\n", unit);
+ goto fail;
+ }
+
+ /* Get the ID of the keyboard, if any */
+ empty_kbd_buffer(sc_kbdc, 5);
+ res = send_kbd_command(sc_kbdc, KBDC_SEND_DEV_ID);
+ if (res == KBD_ACK) {
+ /* 10ms delay */
+ DELAY(10000);
+ id = (read_kbd_data(sc_kbdc) << 8) | read_kbd_data(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: keyboard device ID: %04x\n", unit, id);
+ }
+
+ kbdc_set_device_mask(sc_kbdc, m | KBD_KBD_CONTROL_BITS),
+ kbdc_lock(sc_kbdc, FALSE);
return TRUE;
+
+fail:
+ if (c != -1)
+ /* try to restore the command byte as before, if possible */
+ set_controller_command_byte(sc_kbdc, 0xff, c);
+ kbdc_set_device_mask(sc_kbdc,
+ (flags & DETECT_KBD) ? m : m | KBD_KBD_CONTROL_BITS);
+ kbdc_lock(sc_kbdc, FALSE);
+ return FALSE;
}
#if NAPM > 0
static int
scresume(void *dummy)
{
- if (kbd != NULL)
- kbd_clear_state(kbd);
- return 0;
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ return 0;
}
#endif
-int
-sc_attach_unit(int unit, int flags)
+static int
+scattach(struct isa_device *dev)
{
scr_stat *scp;
-#if defined(VESA) && defined(VM86)
video_info_t info;
-#endif
dev_t cdev = makedev(CDEV_MAJOR, 0);
#ifdef DEVFS
int vc;
#endif
scinit();
- scp = console[0];
- sc_flags = flags;
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ sc_flags = dev->id_flags;
+ if (!ISFONTAVAIL(adp_flags))
sc_flags &= ~CHAR_CURSOR;
+ scp = console[0];
+
/* copy temporary buffer to final buffer */
scp->scr_buf = NULL;
sc_alloc_scr_buffer(scp, FALSE, FALSE);
bcopy(sc_buffer, scp->scr_buf, scp->xsize*scp->ysize*sizeof(u_short));
/* cut buffer is available only when the mouse pointer is used */
- if (ISMOUSEAVAIL(scp->adp->va_flags))
+ if (ISMOUSEAVAIL(adp_flags))
sc_alloc_cut_buffer(scp, FALSE);
/* initialize history buffer & pointers */
@@ -583,16 +666,15 @@ sc_attach_unit(int unit, int flags)
#if defined(VESA) && defined(VM86)
if ((sc_flags & VESA800X600)
- && ((*vidsw[scp->ad]->get_info)(scp->adp, M_VESA_800x600, &info) == 0)) {
-#if NSPLASH > 0
- splash_term(scp->adp);
+ && ((*biosvidsw.get_info)(scp->adp, M_VESA_800x600, &info) == 0)) {
+#ifdef SC_SPLASH_SCREEN
+ scsplash_term(scp);
#endif
sc_set_graphics_mode(scp, NULL, M_VESA_800x600);
sc_set_pixel_mode(scp, NULL, COL, ROW, 16);
initial_video_mode = M_VESA_800x600;
-#if NSPLASH > 0
- /* put up the splash again! */
- splash_init(scp->adp, scsplash_callback);
+#ifdef SC_SPLASH_SCREEN
+ scsplash_init(scp);
#endif
}
#endif /* VESA && VM86 */
@@ -604,25 +686,15 @@ sc_attach_unit(int unit, int flags)
/* get screen update going */
scrn_timer((void *)TRUE);
- /* set up the keyboard */
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
- update_kbd_state(scp->status, LOCK_MASK);
-
- if (bootverbose) {
- printf("sc%d:", unit);
- if (adapter >= 0)
- printf(" fb%d", adapter);
- if (keyboard >= 0)
- printf(" kbd%d", keyboard);
- printf("\n");
- }
- printf("sc%d: ", unit);
- switch(scp->adp->va_type) {
+ update_leds(scp->status);
+
+ printf("sc%d: ", dev->id_unit);
+ switch(crtc_type) {
case KD_VGA:
- printf("VGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
+ printf("VGA %s", (adp_flags & V_ADP_COLOR) ? "color" : "mono");
break;
case KD_EGA:
- printf("EGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
+ printf("EGA %s", (adp_flags & V_ADP_COLOR) ? "color" : "mono");
break;
case KD_CGA:
printf("CGA");
@@ -679,8 +751,6 @@ int
scopen(dev_t dev, int flag, int mode, struct proc *p)
{
struct tty *tp = scdevtotty(dev);
- keyarg_t key;
- int s;
if (!tp)
return(ENXIO);
@@ -692,9 +762,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
ttychars(tp);
/* Use the current setting of the <-- key as default VERASE. */
/* If the Delete key is preferable, an stty is necessary */
- key.keynum = 0x0e; /* how do we know this magic number... XXX */
- kbd_ioctl(kbd, GIO_KEYMAPENT, (caddr_t)&key);
- tp->t_cc[VERASE] = key.key.map[0];
+ tp->t_cc[VERASE] = key_map.key[0x0e].map[0];
tp->t_iflag = TTYDEF_IFLAG;
tp->t_oflag = TTYDEF_OFLAG;
tp->t_cflag = TTYDEF_CFLAG;
@@ -704,11 +772,6 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
(*linesw[tp->t_line].l_modem)(tp, 1);
if (minor(dev) == SC_MOUSE)
mouse_level = 0; /* XXX */
- if (minor(dev) < MAXCONS && console[minor(dev)]) {
- s = spltty();
- sc_clean_up(console[minor(dev)]);
- splx(s);
- }
}
else
if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
@@ -788,53 +851,38 @@ scwrite(dev_t dev, struct uio *uio, int flag)
return((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
-static int
-sckbdevent(keyboard_t *thiskbd, int event, void *arg)
+void
+scintr(int unit)
{
static struct tty *cur_tty;
- int c;
- size_t len;
+ int c, len;
u_char *cp;
- /* assert(thiskbd == kbd) */
-
- switch (event) {
- case KBDIO_KEYINPUT:
- break;
- case KBDIO_UNLOADING:
- kbd = NULL;
- kbd_release(thiskbd, (void *)&keyboard);
- return 0;
- default:
- return EINVAL;
- }
-
/*
* Loop while there is still input to get from the keyboard.
* I don't think this is nessesary, and it doesn't fix
* the Xaccel-2.1 keyboard hang, but it can't hurt. XXX
*/
- while ((c = scgetc(thiskbd, SCGETC_NONBLOCK)) != NOKEY) {
+ while ((c = scgetc(SCGETC_NONBLOCK)) != NOKEY) {
cur_tty = VIRTUAL_TTY(get_scr_num());
if (!(cur_tty->t_state & TS_ISOPEN))
if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN))
continue;
- switch (KEYFLAGS(c)) {
+ switch (c & 0xff00) {
case 0x0000: /* normal key */
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
break;
case FKEY: /* function key, return string */
- cp = kbd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
- if (cp != NULL) {
+ if (cp = get_fstr((u_int)c, (u_int *)&len)) {
while (len-- > 0)
- (*linesw[cur_tty->t_line].l_rint)(*cp++, cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(*cp++ & 0xFF, cur_tty);
}
break;
case MKEY: /* meta is active, prepend ESC */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
break;
case BKEY: /* backtab fixed sequence (esc [ Z) */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
@@ -844,12 +892,17 @@ sckbdevent(keyboard_t *thiskbd, int event, void *arg)
}
}
+#if 0
+ if (cur_console->status & MOUSE_ENABLED) {
+ cur_console->status &= ~MOUSE_VISIBLE;
+ remove_mouse_image(cur_console);
+ }
+#else
if (cur_console->status & MOUSE_VISIBLE) {
remove_mouse_image(cur_console);
cur_console->status &= ~MOUSE_VISIBLE;
}
-
- return 0;
+#endif
}
static int
@@ -869,6 +922,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
int i;
struct tty *tp;
scr_stat *scp;
+ video_adapter_t *adp;
int s;
tp = scdevtotty(dev);
@@ -894,7 +948,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case GIO_COLOR: /* is this a color console ? */
- *(int *)data = (scp->adp->va_flags & V_ADP_COLOR) ? 1 : 0;
+ *(int *)data = (adp_flags & V_ADP_COLOR) ? 1 : 0;
return 0;
case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
@@ -912,7 +966,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
else
sc_flags &= ~BLINK_CURSOR;
if ((*(int*)data) & 0x02) {
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
return ENXIO;
sc_flags |= CHAR_CURSOR;
} else
@@ -922,12 +976,10 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* are affected. Update the cursor in the current console...
*/
if (!ISGRAPHSC(cur_console)) {
- s = spltty();
remove_cursor_image(cur_console);
if (sc_flags & CHAR_CURSOR)
set_destructive_cursor(cur_console);
draw_cursor_image(cur_console);
- splx(s);
}
return 0;
@@ -989,7 +1041,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
mouse_info_t buf;
/* FIXME: */
- if (!ISMOUSEAVAIL(scp->adp->va_flags))
+ if (!ISMOUSEAVAIL(get_adapter(scp)->va_flags))
return ENODEV;
if (cmd == OLD_CONS_MOUSECTL) {
@@ -1252,7 +1304,8 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return EINVAL;
}
/* make screensaver happy */
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
return 0;
}
@@ -1373,9 +1426,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
ptr->mv_grfc.fore = 0; /* not supported */
ptr->mv_grfc.back = 0; /* not supported */
ptr->mv_ovscan = scp->border;
- if (scp == cur_console)
- save_kbd_state(scp);
- ptr->mk_keylock = scp->status & LOCK_MASK;
+ ptr->mk_keylock = scp->status & LOCK_KEY_MASK;
return 0;
}
return EINVAL;
@@ -1508,19 +1559,11 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return EINVAL;
case VT_ACTIVATE: /* switch to screen *data */
- s = spltty();
- sc_clean_up(cur_console);
- splx(s);
return switch_scr(scp, *(int *)data - 1);
case VT_WAITACTIVE: /* wait for switch to occur */
if (*(int *)data > MAXCONS || *(int *)data < 0)
return EINVAL;
- s = spltty();
- error = sc_clean_up(cur_console);
- splx(s);
- if (error)
- return error;
if (minor(dev) == *(int *)data - 1)
return 0;
if (*(int *)data == 0) {
@@ -1543,48 +1586,49 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return error;
if (securelevel > 0)
return EPERM;
-#ifdef __i386__
p->p_md.md_regs->tf_eflags |= PSL_IOPL;
-#endif
return 0;
case KDDISABIO: /* disallow io operations (default) */
-#ifdef __i386__
p->p_md.md_regs->tf_eflags &= ~PSL_IOPL;
-#endif
return 0;
case KDSKBSTATE: /* set keyboard state (locks) */
- if (*(int *)data & ~LOCK_MASK)
+ if (*(int *)data & ~LOCK_KEY_MASK)
return EINVAL;
- scp->status &= ~LOCK_MASK;
+ scp->status &= ~LOCK_KEY_MASK;
scp->status |= *(int *)data;
if (scp == cur_console)
- update_kbd_state(scp->status, LOCK_MASK);
+ update_leds(scp->status);
return 0;
case KDGKBSTATE: /* get keyboard state (locks) */
- if (scp == cur_console)
- save_kbd_state(scp);
- *(int *)data = scp->status & LOCK_MASK;
+ *(int *)data = scp->status & LOCK_KEY_MASK;
return 0;
case KDSETRAD: /* set keyboard repeat & delay rates */
if (*(int *)data & ~0x7f)
return EINVAL;
- error = kbd_ioctl(kbd, KDSETRAD, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ if (sc_kbdc != NULL)
+ set_keyboard(KBDC_SET_TYPEMATIC, *(int *)data);
+ return 0;
case KDSKBMODE: /* set keyboard mode */
switch (*(int *)data) {
- case K_XLATE: /* switch to XLT ascii mode */
case K_RAW: /* switch to RAW scancode mode */
+ scp->status &= ~KBD_CODE_MODE;
+ scp->status |= KBD_RAW_MODE;
+ return 0;
+
case K_CODE: /* switch to CODE mode */
- scp->kbd_mode = *(int *)data;
- if (scp == cur_console)
- kbd_ioctl(kbd, cmd, data);
+ scp->status &= ~KBD_RAW_MODE;
+ scp->status |= KBD_CODE_MODE;
+ return 0;
+
+ case K_XLATE: /* switch to XLT ascii mode */
+ if (scp == cur_console && scp->status & KBD_RAW_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ scp->status &= ~(KBD_RAW_MODE | KBD_CODE_MODE);
return 0;
default:
return EINVAL;
@@ -1592,15 +1636,10 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/* NOT REACHED */
case KDGKBMODE: /* get keyboard mode */
- *(int *)data = scp->kbd_mode;
+ *(int *)data = (scp->status & KBD_RAW_MODE) ? K_RAW :
+ ((scp->status & KBD_CODE_MODE) ? K_CODE : K_XLATE);
return 0;
- case KDGKBINFO:
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-
case KDMKTONE: /* sound the bell */
if (*(int*)data)
do_bell(scp, (*(int*)data)&0xffff,
@@ -1610,7 +1649,6 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case KIOCSOUND: /* make tone (*data) hz */
-#ifdef __i386__
if (scp == cur_console) {
if (*(int*)data) {
int pitch = timer_freq / *(int*)data;
@@ -1632,77 +1670,46 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
release_timer2();
}
}
-#endif /* __i386__ */
return 0;
case KDGKBTYPE: /* get keyboard type */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL) {
- /* always return something? XXX */
- *(int *)data = 0;
- }
+ *(int *)data = 0; /* type not known (yet) */
return 0;
case KDSETLED: /* set keyboard LED status */
- if (*(int *)data & ~LED_MASK) /* FIXME: LOCK_MASK? */
+ if (*(int *)data & ~LED_MASK)
return EINVAL;
scp->status &= ~LED_MASK;
scp->status |= *(int *)data;
if (scp == cur_console)
- update_kbd_leds(scp->status);
+ update_leds(scp->status);
return 0;
case KDGETLED: /* get keyboard LED status */
- if (scp == cur_console)
- save_kbd_state(scp);
*(int *)data = scp->status & LED_MASK;
return 0;
- case CONS_SETKBD: /* set the new keyboard */
- {
- keyboard_t *newkbd;
-
- s = spltty();
- newkbd = kbd_get_keyboard(*(int *)data);
- if (newkbd == NULL) {
- splx(s);
- return EINVAL;
- }
- error = 0;
- if (kbd != newkbd) {
- i = kbd_allocate(newkbd->kb_name, newkbd->kb_unit,
- (void *)&keyboard, sckbdevent, NULL);
- /* i == newkbd->kb_index */
- if (i >= 0) {
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- kbd_release(kbd, (void *)&keyboard);
- }
- kbd = kbd_get_keyboard(i); /* kbd == newkbd */
- keyboard = i;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- update_kbd_state(cur_console->status, LOCK_MASK);
- } else {
- error = EPERM; /* XXX */
- }
- }
- splx(s);
- return error;
+ case GETFKEY: /* get functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(&fkey_tab[ptr->keynum].str, ptr->keydef,
+ fkey_tab[ptr->keynum].len);
+ ptr->flen = fkey_tab[ptr->keynum].len;
+ return 0;
}
+ else
+ return EINVAL;
- case CONS_RELKBD: /* release the current keyboard */
- s = spltty();
- error = 0;
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- error = kbd_release(kbd, (void *)&keyboard);
- if (error == 0) {
- kbd = NULL;
- keyboard = -1;
- }
+ case SETFKEY: /* set functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str,
+ min(ptr->flen, MAXFK));
+ fkey_tab[ptr->keynum].len = min(ptr->flen, MAXFK);
+ return 0;
}
- splx(s);
- return error;
+ else
+ return EINVAL;
case GIO_SCRNMAP: /* get output translation table */
bcopy(&scr_map, data, sizeof(scr_map));
@@ -1714,19 +1721,27 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
scr_rmap[scr_map[i]] = i;
return 0;
- case GIO_KEYMAP: /* get keyboard translation table */
- case PIO_KEYMAP: /* set keyboard translation table */
- case GIO_DEADKEYMAP: /* get accent key translation table */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- case GETFKEY: /* get function key string */
- case SETFKEY: /* set function key string */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ case GIO_KEYMAP: /* get keyboard translation table */
+ bcopy(&key_map, data, sizeof(key_map));
+ return 0;
+
+ case PIO_KEYMAP: /* set keyboard translation table */
+ accents = 0;
+ bzero(&accent_map, sizeof(accent_map));
+ bcopy(data, &key_map, sizeof(key_map));
+ return 0;
+
+ case GIO_DEADKEYMAP: /* get accent key translation table */
+ bcopy(&accent_map, data, sizeof(accent_map));
+ return 0;
+
+ case PIO_DEADKEYMAP: /* set accent key translation table */
+ accents = 0;
+ bcopy(data, &accent_map, sizeof(accent_map));
+ return 0;
case PIO_FONT8x8: /* set 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
return ENXIO;
bcopy(data, font_8, 8*256);
fonts_loaded |= FONT_8;
@@ -1740,7 +1755,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case GIO_FONT8x8: /* get 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
return ENXIO;
if (fonts_loaded & FONT_8) {
bcopy(font_8, data, 8*256);
@@ -1750,7 +1765,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return ENXIO;
case PIO_FONT8x14: /* set 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
return ENXIO;
bcopy(data, font_14, 14*256);
fonts_loaded |= FONT_14;
@@ -1765,7 +1780,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case GIO_FONT8x14: /* get 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
return ENXIO;
if (fonts_loaded & FONT_14) {
bcopy(font_14, data, 14*256);
@@ -1775,7 +1790,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return ENXIO;
case PIO_FONT8x16: /* set 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
return ENXIO;
bcopy(data, font_16, 16*256);
fonts_loaded |= FONT_16;
@@ -1789,7 +1804,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case GIO_FONT8x16: /* get 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags))
return ENXIO;
if (fonts_loaded & FONT_16) {
bcopy(font_16, data, 16*256);
@@ -1856,12 +1871,7 @@ scmousestart(struct tty *tp)
splx(s);
}
-#if __i386__
-
-/* XXX kludge! */
-extern struct isa_driver scdriver;
-
-static void
+void
sccnprobe(struct consdev *cp)
{
struct isa_device *dvp;
@@ -1875,72 +1885,31 @@ sccnprobe(struct consdev *cp)
return;
}
- if (!scvidprobe(dvp->id_unit, dvp->id_flags, TRUE)) {
+ if (!scvidprobe(dvp->id_unit, dvp->id_flags)) {
cp->cn_pri = CN_DEAD;
return;
}
- sckbdprobe(dvp->id_unit, dvp->id_flags, TRUE);
/* initialize required fields */
cp->cn_dev = makedev(CDEV_MAJOR, SC_CONSOLE);
cp->cn_pri = CN_INTERNAL;
-}
-static void
-sccninit(struct consdev *cp)
-{
- scinit();
+ sc_kbdc = kbdc_open(sc_port);
}
-#else /* !__i386__ */
-
-extern struct consdev *cn_tab;
-
void
-sccnattach(void)
+sccninit(struct consdev *cp)
{
- if (!scvidprobe(0, 0, TRUE) || !sckbdprobe(0, 0, TRUE)) {
- return;
- }
-
scinit();
- cn_tab = &sc_cons;
}
-#endif /* __i386__ */
-
-static void
+void
sccnputc(dev_t dev, int c)
{
u_char buf[1];
+ int s;
scr_stat *scp = console[0];
term_stat save = scp->term;
- u_short *p;
- int s;
- int i;
-
- if (scp == cur_console && scp->status & SLKED) {
- scp->status &= ~SLKED;
- update_kbd_state(scp->status, SLKED);
- if (cur_console->status & BUFFER_SAVED) {
- p = cur_console->history_save;
- for (i = 0; i < cur_console->ysize; ++i) {
- bcopy(p, cur_console->scr_buf + (cur_console->xsize*i),
- cur_console->xsize*sizeof(u_short));
- p += cur_console->xsize;
- if (p + cur_console->xsize
- > cur_console->history + cur_console->history_size)
- p = cur_console->history;
- }
- cur_console->status &= ~BUFFER_SAVED;
- cur_console->history_head = cur_console->history_save;
- cur_console->status |= CURSOR_ENABLED;
- mark_all(cur_console);
- }
-#if 1 /* XXX */
- scstart(VIRTUAL_TTY(get_scr_num()));
-#endif
- }
scp->term = kernel_console;
current_default = &kernel_default;
@@ -1952,71 +1921,43 @@ sccnputc(dev_t dev, int c)
current_default = &user_default;
scp->term = save;
- s = spltty(); /* block sckbdevent and scrn_timer */
+ s = spltty(); /* block scintr and scrn_timer */
sccnupdate(scp);
splx(s);
}
-static int
+int
sccngetc(dev_t dev)
{
- return sccngetch(0);
-}
-
-static int
-sccncheckc(dev_t dev)
-{
- return sccngetch(SCGETC_NONBLOCK);
-}
-
-static int
-sccngetch(int flags)
-{
- int cur_mode;
- int s = spltty(); /* block sckbdevent and scrn_timer while we poll */
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
int c;
/*
* Stop the screen saver and update the screen if necessary.
* What if we have been running in the screen saver code... XXX
*/
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
sccnupdate(cur_console);
- if (kbd == NULL) {
- splx(s);
- return -1;
- }
-
- /*
- * Make sure the keyboard is accessible even when the kbd device
- * driver is disabled.
- */
- kbd_enable(kbd);
+ c = scgetc(SCGETC_CN);
+ splx(s);
+ return(c);
+}
- /* we shall always use the keyboard in the XLATE mode here */
- cur_mode = cur_console->kbd_mode;
- cur_console->kbd_mode = K_XLATE;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
+int
+sccncheckc(dev_t dev)
+{
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
+ int c;
- c = scgetc(kbd, SCGETC_CN | flags);
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ sccnupdate(cur_console);
- cur_console->kbd_mode = cur_mode;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- kbd_disable(kbd);
+ c = scgetc(SCGETC_CN | SCGETC_NONBLOCK);
splx(s);
-
- switch (KEYFLAGS(c)) {
- case 0: /* normal char */
- return KEYCHAR(c);
- case FKEY: /* function key */
- return c; /* XXX */
- case NOKEY:
- case ERRKEY:
- default:
- return -1;
- }
- /* NOT REACHED */
+ return(c == NOKEY ? -1 : c); /* c == -1 can't happen */
}
static void
@@ -2028,7 +1969,8 @@ sccnupdate(scr_stat *scp)
return;
if (panicstr || shutdown_in_progress) {
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
} else if (scp != cur_console) {
return;
}
@@ -2036,7 +1978,7 @@ sccnupdate(scr_stat *scp)
if (!run_scrn_saver)
scrn_idle = FALSE;
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
+ if (scp->status & SAVER_RUNNING)
stop_scrn_saver(current_saver);
if (scp != cur_console || blink_in_progress || switch_in_progress)
@@ -2071,7 +2013,6 @@ get_scr_num()
static void
scrn_timer(void *arg)
{
- static int kbd_interval = 0;
struct timeval tv;
scr_stat *scp;
int s;
@@ -2084,24 +2025,37 @@ scrn_timer(void *arg)
}
s = spltty();
- if ((kbd == NULL) && (sc_flags & AUTODETECT_KBD)) {
- /* try to allocate a keyboard automatically */
- if (++kbd_interval >= 25) {
- keyboard = kbd_allocate("*", -1, (void *)&keyboard,
- sckbdevent, NULL);
- if (keyboard >= 0) {
- kbd = kbd_get_keyboard(keyboard);
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- update_kbd_state(cur_console->status, LOCK_MASK);
- }
- kbd_interval = 0;
- }
+ /*
+ * With release 2.1 of the Xaccel server, the keyboard is left
+ * hanging pretty often. Apparently an interrupt from the
+ * keyboard is lost, and I don't know why (yet).
+ * This ugly hack calls scintr if input is ready for the keyboard
+ * and conveniently hides the problem. XXX
+ */
+ /* Try removing anything stuck in the keyboard controller; whether
+ * it's a keyboard scan code or mouse data. `scintr()' doesn't
+ * read the mouse data directly, but `kbdio' routines will, as a
+ * side effect.
+ */
+ if (kbdc_lock(sc_kbdc, TRUE)) {
+ /*
+ * We have seen the lock flag is not set. Let's reset the flag early;
+ * otherwise `update_led()' failes which may want the lock
+ * during `scintr()'.
+ */
+ kbdc_lock(sc_kbdc, FALSE);
+ if (kbdc_data_ready(sc_kbdc))
+ scintr(0);
}
+ scp = cur_console;
+
/* should we stop the screen saver? */
getmicrouptime(&tv);
- if (panicstr || shutdown_in_progress)
- sc_touch_scrn_saver();
+ if (panicstr || shutdown_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
if (run_scrn_saver) {
scrn_idle = (tv.tv_sec > scrn_time_stamp + scrn_blank_time);
} else {
@@ -2111,7 +2065,7 @@ scrn_timer(void *arg)
run_scrn_saver = TRUE;
}
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
+ if (scp->status & SAVER_RUNNING)
stop_scrn_saver(current_saver);
/* should we just return ? */
@@ -2123,14 +2077,13 @@ scrn_timer(void *arg)
}
/* Update the screen */
- scp = cur_console;
if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
scrn_update(scp, TRUE);
/* should we activate the screen saver? */
if ((saver_mode == CONS_LKM_SAVER) && scrn_idle)
- if (!ISGRAPHSC(scp) || scrn_blanked)
- (*current_saver)(TRUE);
+ if (!ISGRAPHSC(scp) || (scp->status & SAVER_RUNNING))
+ scrn_saver(current_saver, TRUE);
if (arg)
timeout(scrn_timer, (void *)TRUE, hz / 25);
@@ -2206,96 +2159,25 @@ scrn_update(scr_stat *scp, int show_cursor)
scp->start = scp->xsize*scp->ysize - 1;
}
-#if NSPLASH > 0
-
-static int
-scsplash_callback(int event)
-{
- int error;
-
- switch (event) {
- case SPLASH_INIT:
- scrn_saver_failed = FALSE;
- if (add_scrn_saver(scsplash_saver) == 0) {
- run_scrn_saver = TRUE;
- if (cold && !(boothowto & (RB_VERBOSE | RB_CONFIG))) {
- scsplash_stick(TRUE);
- (*current_saver)(TRUE);
- }
- }
- return 0;
-
- case SPLASH_TERM:
- if (current_saver == scsplash_saver) {
- scsplash_stick(FALSE);
- error = remove_scrn_saver(scsplash_saver);
- if (error)
- return error;
- }
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-static void
-scsplash_saver(int show)
-{
- static int busy = FALSE;
- scr_stat *scp;
-
- if (busy)
- return;
- busy = TRUE;
-
- scp = cur_console;
- if (show) {
- if (!scrn_saver_failed) {
- if (!scrn_blanked)
- set_scrn_saver_mode(scp, -1, NULL, 0);
- switch (splash(scp->adp, TRUE)) {
- case 0: /* succeeded */
- scrn_blanked = TRUE;
- break;
- case EAGAIN: /* try later */
- restore_scrn_saver_mode(scp, FALSE);
- break;
- default:
- scrn_saver_failed = TRUE;
- scsplash_stick(FALSE);
- printf("scsplash_saver(): failed to put up the image\n");
- restore_scrn_saver_mode(scp, TRUE);
- break;
- }
- }
- } else if (!sticky_splash) {
- if (scrn_blanked && (splash(scp->adp, FALSE) == 0)) {
- restore_scrn_saver_mode(scp, TRUE);
- scrn_blanked = FALSE;
- }
- }
- busy = FALSE;
-}
-
-static int
+int
add_scrn_saver(void (*this_saver)(int))
{
- int error;
-
- if (current_saver != none_saver) {
- error = remove_scrn_saver(current_saver);
- if (error)
- return error;
+#ifdef SC_SPLASH_SCREEN
+ if (current_saver == scsplash) {
+ scsplash_stick(FALSE);
+ stop_scrn_saver(scsplash);
}
+#endif
+ if (current_saver != default_saver)
+ return EBUSY;
run_scrn_saver = FALSE;
saver_mode = CONS_LKM_SAVER;
current_saver = this_saver;
return 0;
}
-static int
+int
remove_scrn_saver(void (*this_saver)(int))
{
if (current_saver != this_saver)
@@ -2308,81 +2190,35 @@ remove_scrn_saver(void (*this_saver)(int))
* before stopping the current saver, rather than blocking by `splXX()'.
*/
current_saver = none_saver;
- if (scrn_blanked)
+ if (scrn_blanked > 0)
stop_scrn_saver(this_saver);
- return (scrn_blanked ? EBUSY : 0);
-}
+ if (scrn_blanked > 0)
+ return EBUSY; /* XXX */
-static int
-set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border)
-{
- int s;
-
- /* assert(scp == cur_console) */
- s = spltty();
- scp->splash_save_mode = scp->mode;
- scp->splash_save_status = scp->status & (GRAPHICS_MODE | PIXEL_MODE);
- scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
- scp->status |= (UNKNOWN_MODE | SAVER_RUNNING);
- splx(s);
- if (mode < 0)
- return 0;
- scp->mode = mode;
- if (set_mode(scp) == 0) {
- if (scp->adp->va_mode_flags & V_INFO_GRAPHICS)
- scp->status |= GRAPHICS_MODE;
- if (pal != NULL)
- load_palette(scp->adp, pal);
- set_border(scp, border);
- return 0;
- } else {
- s = spltty();
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- splx(s);
- return 1;
- }
+ current_saver = default_saver;
+ return 0;
}
-static int
-restore_scrn_saver_mode(scr_stat *scp, int changemode)
+static void
+scrn_saver(void (*saver)(int), int blank)
{
- int mode;
- int status;
- int s;
+ static int busy = FALSE;
- /* assert(scp == cur_console) */
- s = spltty();
- mode = scp->mode;
- status = scp->status;
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- if (!changemode) {
- splx(s);
- return 0;
- }
- if (set_mode(scp) == 0) {
- load_palette(scp->adp, palette);
- splx(s);
- return 0;
- } else {
- scp->mode = mode;
- scp->status = status;
- splx(s);
- return 1;
- }
+ if (busy)
+ return;
+ busy = TRUE;
+ (*saver)(blank);
+ busy = FALSE;
}
static void
stop_scrn_saver(void (*saver)(int))
{
- (*saver)(FALSE);
+ scrn_saver(saver, FALSE);
run_scrn_saver = FALSE;
/* the screen saver may have chosen not to stop after all... */
- if (scrn_blanked)
+ if (scrn_blanked > 0)
return;
mark_all(cur_console);
@@ -2396,7 +2232,7 @@ wait_scrn_saver_stop(void)
{
int error = 0;
- while (scrn_blanked) {
+ while (scrn_blanked > 0) {
run_scrn_saver = FALSE;
error = tsleep((caddr_t)&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
run_scrn_saver = FALSE;
@@ -2406,15 +2242,6 @@ wait_scrn_saver_stop(void)
return error;
}
-#endif /* NSPLASH */
-
-void
-sc_touch_scrn_saver(void)
-{
- scsplash_stick(FALSE);
- run_scrn_saver = FALSE;
-}
-
void
sc_clear_screen(scr_stat *scp)
{
@@ -2430,9 +2257,10 @@ static int
switch_scr(scr_stat *scp, u_int next_scr)
{
/* delay switch if actively updating screen */
- if (scrn_blanked || write_in_progress || blink_in_progress) {
+ if (scrn_blanked > 0 || write_in_progress || blink_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
delayed_next_scr = next_scr+1;
- sc_touch_scrn_saver();
return 0;
}
@@ -2490,12 +2318,7 @@ switch_scr(scr_stat *scp, u_int next_scr)
static void
exchange_scr(void)
{
- /* save the current state of video and keyboard */
move_crsr(old_scp, old_scp->xpos, old_scp->ypos);
- if (old_scp->kbd_mode == K_XLATE)
- save_kbd_state(old_scp);
-
- /* set up the video for the new screen */
cur_console = new_scp;
if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp))
set_mode(new_scp);
@@ -2503,14 +2326,12 @@ exchange_scr(void)
if (ISTEXTSC(new_scp) && (sc_flags & CHAR_CURSOR))
set_destructive_cursor(new_scp);
if (ISGRAPHSC(old_scp))
- load_palette(new_scp->adp, palette);
+ load_palette(new_scp, palette);
+ if (old_scp->status & KBD_RAW_MODE || new_scp->status & KBD_RAW_MODE ||
+ old_scp->status & KBD_CODE_MODE || new_scp->status & KBD_CODE_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
set_border(new_scp, new_scp->border);
-
- /* set up the keyboard for the new screen */
- if (old_scp->kbd_mode != new_scp->kbd_mode)
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&new_scp->kbd_mode);
- update_kbd_state(new_scp->status, LOCK_MASK);
-
+ update_leds(new_scp->status);
delayed_next_scr = FALSE;
mark_all(new_scp);
}
@@ -2983,7 +2804,7 @@ scan_esc(scr_stat *scp, u_char c)
else
sc_flags &= ~BLINK_CURSOR;
if ((scp->term.param[0] & 0x02)
- && ISFONTAVAIL(scp->adp->va_flags))
+ && ISFONTAVAIL(get_adapter(scp)->va_flags))
sc_flags |= CHAR_CURSOR;
else
sc_flags &= ~CHAR_CURSOR;
@@ -2997,12 +2818,10 @@ scan_esc(scr_stat *scp, u_char c)
* are affected. Update the cursor in the current console...
*/
if (!ISGRAPHSC(cur_console)) {
- i = spltty();
remove_cursor_image(cur_console);
if (sc_flags & CHAR_CURSOR)
set_destructive_cursor(cur_console);
draw_cursor_image(cur_console);
- splx(i);
}
break;
@@ -3188,7 +3007,6 @@ outloop:
static void
scinit(void)
{
- video_adapter_t *adp;
int col;
int row;
u_int i;
@@ -3197,12 +3015,9 @@ scinit(void)
return;
init_done = WARM;
- get_bios_values();
-
- /* extract the hardware cursor location and hide the cursor for now */
- adp = vid_get_adapter(adapter);
- (*vidsw[adapter]->read_hw_cursor)(adp, &col, &row);
- (*vidsw[adapter]->set_hw_cursor)(adp, -1, -1);
+ /* extract the hardware cursor location and move it out of the way */
+ (*biosvidsw.read_hw_cursor)(V_ADP_PRIMARY, &col, &row);
+ (*biosvidsw.set_hw_cursor)(V_ADP_PRIMARY, -1, -1);
/* set up the first console */
current_default = &user_default;
@@ -3212,8 +3027,8 @@ scinit(void)
/* copy screen to temporary buffer */
if (ISTEXTSC(console[0]))
- bcopy_fromio(console[0]->adp->va_window, sc_buffer,
- console[0]->xsize * console[0]->ysize * sizeof(u_short));
+ generic_bcopy((ushort *)(get_adapter(console[0])->va_window), sc_buffer,
+ console[0]->xsize * console[0]->ysize * sizeof(u_short));
console[0]->scr_buf = console[0]->mouse_pos = console[0]->mouse_oldpos
= sc_buffer;
@@ -3241,7 +3056,7 @@ scinit(void)
}
/* Save font and palette */
- if (ISFONTAVAIL(cur_console->adp->va_flags)) {
+ if (ISFONTAVAIL(get_adapter(cur_console)->va_flags)) {
if (fonts_loaded & FONT_16) {
copy_font(cur_console, LOAD, 16, font_16);
} else {
@@ -3253,20 +3068,21 @@ scinit(void)
* FONT KLUDGE
* Always use the font page #0. XXX
*/
- (*vidsw[cur_console->ad]->show_font)(cur_console->adp, 0);
+ (*biosvidsw.show_font)(cur_console->adp, 0);
}
- save_palette(cur_console->adp, palette);
+ save_palette(cur_console, palette);
-#if NSPLASH > 0
- /* we are ready to put up the splash image! */
- splash_init(cur_console->adp, scsplash_callback);
+#ifdef SC_SPLASH_SCREEN
+ /* put up the splash. */
+ scsplash_init(cur_console);
#endif
}
static void
scshutdown(int howto, void *arg)
{
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
if (!cold && cur_console->smode.mode == VT_AUTO
&& console[0]->smode.mode == VT_AUTO)
switch_scr(cur_console, 0);
@@ -3278,7 +3094,6 @@ sc_clean_up(scr_stat *scp)
{
int error;
- sc_touch_scrn_saver();
if ((error = wait_scrn_saver_stop()))
return error;
scp->status &= ~MOUSE_VISIBLE;
@@ -3357,11 +3172,11 @@ static scr_stat
scp = (scr_stat *)malloc(sizeof(scr_stat), M_DEVBUF, M_WAITOK);
init_scp(scp);
sc_alloc_scr_buffer(scp, TRUE, TRUE);
- if (ISMOUSEAVAIL(scp->adp->va_flags))
+ if (ISMOUSEAVAIL(get_adapter(scp)->va_flags))
sc_alloc_cut_buffer(scp, TRUE);
sc_alloc_history_buffer(scp, sc_history_size, 0, TRUE);
/* SOS
- if (scp->adp->va_flags & V_ADP_MODECHANGE)
+ if (get_adapter(scp)->va_flags & V_ADP_MODECHANGE)
set_mode(scp);
*/
sc_clear_screen(scp);
@@ -3374,12 +3189,11 @@ init_scp(scr_stat *scp)
{
video_info_t info;
- scp->ad = adapter;
- scp->adp = vid_get_adapter(scp->ad);
- (*vidsw[scp->ad]->get_info)(scp->adp, initial_video_mode, &info);
+ scp->adp = V_ADP_PRIMARY;
+ (*biosvidsw.get_info)(scp->adp, initial_video_mode, &info);
scp->status = 0;
- scp->mode = initial_video_mode;
+ scp->mode = scp->initial_mode = initial_video_mode;
scp->scr_buf = NULL;
if (info.vi_flags & V_INFO_GRAPHICS) {
scp->status |= GRAPHICS_MODE;
@@ -3407,18 +3221,17 @@ init_scp(scr_stat *scp)
current_default->std_color;
scp->term.rev_color = current_default->rev_color;
scp->border = BG_BLACK;
- scp->cursor_start = bios_value.cursor_start;
- scp->cursor_end = bios_value.cursor_end;
+ scp->cursor_start = *(u_int8_t *)pa_to_va(0x461);
+ scp->cursor_end = *(u_int8_t *)pa_to_va(0x460);
scp->mouse_xpos = scp->xsize*8/2;
scp->mouse_ypos = scp->ysize*scp->font_size/2;
scp->mouse_cut_start = scp->mouse_cut_end = NULL;
scp->mouse_signal = 0;
scp->mouse_pid = 0;
scp->mouse_proc = NULL;
- scp->kbd_mode = K_XLATE;
scp->bell_pitch = BELL_PITCH;
scp->bell_duration = BELL_DURATION;
- scp->status |= (bios_value.shift_state & 0x20) ? NLKED : 0;
+ scp->status |= (*(u_int8_t *)pa_to_va(0x417) & 0x20) ? NLKED : 0;
scp->status |= CURSOR_ENABLED;
scp->pid = 0;
scp->proc = NULL;
@@ -3427,12 +3240,18 @@ init_scp(scr_stat *scp)
scp->history_size = imax(sc_history_size, scp->ysize) * scp->xsize;
}
-static void
-get_bios_values(void)
+static u_char
+*get_fstr(u_int c, u_int *len)
{
- bios_value.cursor_start = *(u_int8_t *)pa_to_va(0x461);
- bios_value.cursor_end = *(u_int8_t *)pa_to_va(0x460);
- bios_value.shift_state = *(u_int8_t *)pa_to_va(0x417);
+ u_int i;
+
+ if (!(c & FKEY))
+ return(NULL);
+ i = (c & 0xFF) - F_FN;
+ if (i > n_fkey_tab)
+ return(NULL);
+ *len = fkey_tab[i].len;
+ return(fkey_tab[i].str);
}
static void
@@ -3480,48 +3299,151 @@ history_down_line(scr_stat *scp)
* return NOKEY if there is nothing there.
*/
static u_int
-scgetc(keyboard_t *kbd, u_int flags)
+scgetc(u_int flags)
{
- u_int c;
- int this_scr;
- int f;
- int i;
-
- if (kbd == NULL)
- return NOKEY;
+ struct key_t *key;
+ u_char scancode, keycode;
+ u_int state, action;
+ int c;
+ static u_char esc_flag = 0, compose = 0;
+ static u_int chr = 0;
next_code:
- /* I don't like this, but... XXX */
- if (flags & SCGETC_CN)
- sccnupdate(cur_console);
/* first see if there is something in the keyboard port */
- for (;;) {
- c = kbd_read_char(kbd, !(flags & SCGETC_NONBLOCK));
- if (c == ERRKEY) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- } else if (c == NOKEY)
- return c;
- else
- break;
+ if (flags & SCGETC_NONBLOCK) {
+ c = read_kbd_data_no_wait(sc_kbdc);
+ if (c == -1)
+ return(NOKEY);
+ } else {
+ do {
+ c = read_kbd_data(sc_kbdc);
+ } while(c == -1);
}
+ scancode = (u_char)c;
/* make screensaver happy */
- if (!(c & RELKEY))
- sc_touch_scrn_saver();
+ if (!(scancode & 0x80)) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
-#ifdef __i386__
- if (!(flags & SCGETC_CN))
+ if (!(flags & SCGETC_CN)) {
/* do the /dev/random device a favour */
- add_keyboard_randomness(c);
-#endif
+ add_keyboard_randomness(scancode);
+
+ if (cur_console->status & KBD_RAW_MODE)
+ return scancode;
+ }
+
+ keycode = scancode & 0x7F;
+ switch (esc_flag) {
+ case 0x00: /* normal scancode */
+ switch(scancode) {
+ case 0xB8: /* left alt (compose key) */
+ if (compose) {
+ compose = 0;
+ if (chr > 255) {
+ do_bell(cur_console,
+ BELL_PITCH, BELL_DURATION);
+ chr = 0;
+ }
+ }
+ break;
+ case 0x38:
+ if (!compose) {
+ compose = 1;
+ chr = 0;
+ }
+ break;
+ case 0xE0:
+ case 0xE1:
+ esc_flag = scancode;
+ goto next_code;
+ }
+ break;
+ case 0xE0: /* 0xE0 prefix */
+ esc_flag = 0;
+ switch (keycode) {
+ case 0x1C: /* right enter key */
+ keycode = 0x59;
+ break;
+ case 0x1D: /* right ctrl key */
+ keycode = 0x5A;
+ break;
+ case 0x35: /* keypad divide key */
+ keycode = 0x5B;
+ break;
+ case 0x37: /* print scrn key */
+ keycode = 0x5C;
+ break;
+ case 0x38: /* right alt key (alt gr) */
+ keycode = 0x5D;
+ break;
+ case 0x47: /* grey home key */
+ keycode = 0x5E;
+ break;
+ case 0x48: /* grey up arrow key */
+ keycode = 0x5F;
+ break;
+ case 0x49: /* grey page up key */
+ keycode = 0x60;
+ break;
+ case 0x4B: /* grey left arrow key */
+ keycode = 0x61;
+ break;
+ case 0x4D: /* grey right arrow key */
+ keycode = 0x62;
+ break;
+ case 0x4F: /* grey end key */
+ keycode = 0x63;
+ break;
+ case 0x50: /* grey down arrow key */
+ keycode = 0x64;
+ break;
+ case 0x51: /* grey page down key */
+ keycode = 0x65;
+ break;
+ case 0x52: /* grey insert key */
+ keycode = 0x66;
+ break;
+ case 0x53: /* grey delete key */
+ keycode = 0x67;
+ break;
+
+ /* the following 3 are only used on the MS "Natural" keyboard */
+ case 0x5b: /* left Window key */
+ keycode = 0x69;
+ break;
+ case 0x5c: /* right Window key */
+ keycode = 0x6a;
+ break;
+ case 0x5d: /* menu key */
+ keycode = 0x6b;
+ break;
+ default: /* ignore everything else */
+ goto next_code;
+ }
+ break;
+ case 0xE1: /* 0xE1 prefix */
+ esc_flag = 0;
+ if (keycode == 0x1D)
+ esc_flag = 0x1D;
+ goto next_code;
+ /* NOT REACHED */
+ case 0x1D: /* pause / break */
+ esc_flag = 0;
+ if (keycode != 0x45)
+ goto next_code;
+ keycode = 0x68;
+ break;
+ }
- if (cur_console->kbd_mode != K_XLATE)
- return KEYCHAR(c);
+ if (!(flags & SCGETC_CN) && (cur_console->status & KBD_CODE_MODE))
+ return (keycode | (scancode & 0x80));
/* if scroll-lock pressed allow history browsing */
- if (!ISGRAPHSC(cur_console) && cur_console->history
- && cur_console->status & SLKED) {
+ if (cur_console->history && cur_console->status & SLKED) {
+ int i;
cur_console->status &= ~CURSOR_ENABLED;
if (!(cur_console->status & BUFFER_SAVED)) {
@@ -3541,81 +3463,170 @@ next_code:
cur_console->history_pos = cur_console->history_head;
history_to_screen(cur_console);
}
- switch (c) {
- /* FIXME: key codes */
- case SPCLKEY | FKEY | F(49): /* home key */
- remove_cutmarking(cur_console);
+ switch (scancode) {
+ case 0x47: /* home key */
cur_console->history_pos = cur_console->history_head;
history_to_screen(cur_console);
goto next_code;
- case SPCLKEY | FKEY | F(57): /* end key */
- remove_cutmarking(cur_console);
+ case 0x4F: /* end key */
cur_console->history_pos =
WRAPHIST(cur_console, cur_console->history_head,
cur_console->xsize*cur_console->ysize);
history_to_screen(cur_console);
goto next_code;
- case SPCLKEY | FKEY | F(50): /* up arrow key */
- remove_cutmarking(cur_console);
+ case 0x48: /* up arrow key */
if (history_up_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
goto next_code;
- case SPCLKEY | FKEY | F(58): /* down arrow key */
- remove_cutmarking(cur_console);
+ case 0x50: /* down arrow key */
if (history_down_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
goto next_code;
- case SPCLKEY | FKEY | F(51): /* page up key */
- remove_cutmarking(cur_console);
+ case 0x49: /* page up key */
for (i=0; i<cur_console->ysize; i++)
if (history_up_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
break;
}
goto next_code;
- case SPCLKEY | FKEY | F(59): /* page down key */
- remove_cutmarking(cur_console);
+ case 0x51: /* page down key */
for (i=0; i<cur_console->ysize; i++)
if (history_down_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
break;
}
goto next_code;
}
}
- /*
- * Process and consume special keys here. Return a plain char code
- * or a char code with the META flag or a function key code.
- */
- if (c & RELKEY) {
- /* key released */
- /* goto next_code */
+ if (compose) {
+ switch (scancode) {
+ /* key pressed process it */
+ case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */
+ chr = (scancode - 0x40) + chr*10;
+ goto next_code;
+ case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */
+ chr = (scancode - 0x47) + chr*10;
+ goto next_code;
+ case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */
+ chr = (scancode - 0x4E) + chr*10;
+ goto next_code;
+ case 0x52: /* keypad 0 */
+ chr *= 10;
+ goto next_code;
+
+ /* key release, no interest here */
+ case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */
+ case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */
+ case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */
+ case 0xD2: /* keypad 0 */
+ goto next_code;
+
+ case 0x38: /* left alt key */
+ break;
+ default:
+ if (chr) {
+ compose = chr = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ break;
+ }
+ }
+
+ state = (shfts ? 1 : 0 ) | (2 * (ctls ? 1 : 0)) | (4 * (alts ? 1 : 0));
+ if ((!agrs && (cur_console->status & ALKED))
+ || (agrs && !(cur_console->status & ALKED)))
+ keycode += ALTGR_OFFSET;
+ key = &key_map.key[keycode];
+ if ( ((key->flgs & FLAG_LOCK_C) && (cur_console->status & CLKED))
+ || ((key->flgs & FLAG_LOCK_N) && (cur_console->status & NLKED)) )
+ state ^= 1;
+
+ /* Check for make/break */
+ action = key->map[state];
+ if (scancode & 0x80) { /* key released */
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
+ case LSH:
+ shfts &= ~1;
+ break;
+ case RSH:
+ shfts &= ~2;
+ break;
+ case LCTR:
+ ctls &= ~1;
+ break;
+ case RCTR:
+ ctls &= ~2;
+ break;
+ case LALT:
+ alts &= ~1;
+ break;
+ case RALT:
+ alts &= ~2;
+ break;
+ case NLK:
+ nlkcnt = 0;
+ break;
+ case CLK:
+ clkcnt = 0;
+ break;
+ case SLK:
+ slkcnt = 0;
+ break;
+ case ASH:
+ agrs = 0;
+ break;
+ case ALK:
+ alkcnt = 0;
+ break;
+ case META:
+ metas = 0;
+ break;
+ }
+ }
+ if (chr && !compose) {
+ action = chr;
+ chr = 0;
+ return(action);
+ }
} else {
/* key pressed */
- if (c & SPCLKEY) {
- c &= ~SPCLKEY;
- switch (KEYCHAR(c)) {
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
/* LOCKING KEYS */
- case NLK: case CLK: case ALK:
+ case NLK:
+ if (!nlkcnt) {
+ nlkcnt++;
+ if (cur_console->status & NLKED)
+ cur_console->status &= ~NLKED;
+ else
+ cur_console->status |= NLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case CLK:
+ if (!clkcnt) {
+ clkcnt++;
+ if (cur_console->status & CLKED)
+ cur_console->status &= ~CLKED;
+ else
+ cur_console->status |= CLKED;
+ update_leds(cur_console->status);
+ }
break;
case SLK:
- kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&f);
- if (f & SLKED) {
- cur_console->status |= SLKED;
- } else {
+ if (!slkcnt) {
+ slkcnt++;
if (cur_console->status & SLKED) {
cur_console->status &= ~SLKED;
- if (cur_console->status & BUFFER_SAVED) {
+ if (cur_console->status & BUFFER_SAVED){
int i;
u_short *ptr = cur_console->history_save;
@@ -3637,64 +3648,73 @@ next_code:
}
scstart(VIRTUAL_TTY(get_scr_num()));
}
+ else
+ cur_console->status |= SLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case ALK:
+ if (!alkcnt) {
+ alkcnt++;
+ if (cur_console->status & ALKED)
+ cur_console->status &= ~ALKED;
+ else
+ cur_console->status |= ALKED;
+ update_leds(cur_console->status);
}
break;
/* NON-LOCKING KEYS */
case NOP:
- case LSH: case RSH: case LCTR: case RCTR:
- case LALT: case RALT: case ASH: case META:
break;
-
- case BTAB:
- return c;
-
case SPSC:
/* force activatation/deactivation of the screen saver */
- if (!scrn_blanked) {
+ accents = 0;
+ if (scrn_blanked <= 0) {
run_scrn_saver = TRUE;
scrn_time_stamp -= scrn_blank_time;
}
-#if NSPLASH > 0
+#ifdef SC_SPLASH_SCREEN
if (cold) {
/*
* While devices are being probed, the screen saver need
* to be invoked explictly. XXX
*/
- if (scrn_blanked) {
+ if (scrn_blanked > 0) {
scsplash_stick(FALSE);
stop_scrn_saver(current_saver);
} else {
if (!ISGRAPHSC(cur_console)) {
scsplash_stick(TRUE);
- (*current_saver)(TRUE);
+ scrn_saver(current_saver, TRUE);
}
}
}
-#endif /* NSPLASH */
+#endif
break;
-
case RBT:
#ifndef SC_DISABLE_REBOOT
+ accents = 0;
shutdown_nice();
#endif
break;
-
-#if NAPM > 0
case SUSP:
+#if NAPM > 0
+ accents = 0;
apm_suspend(PMST_SUSPEND);
+#endif
break;
+
case STBY:
+#if NAPM > 0
+ accents = 0;
apm_suspend(PMST_STANDBY);
- break;
-#else
- case SUSP:
- case STBY:
- break;
#endif
+ break;
case DBG:
-#ifdef DDB /* try to switch to console 0 */
+#ifdef DDB /* try to switch to console 0 */
+ accents = 0;
/*
* TRY to make sure the screen saver is stopped,
* and the screen is updated before switching to
@@ -3709,47 +3729,131 @@ next_code:
printf("No debugger in kernel\n");
#endif
break;
-
+ case LSH:
+ shfts |= 1;
+ break;
+ case RSH:
+ shfts |= 2;
+ break;
+ case LCTR:
+ ctls |= 1;
+ break;
+ case RCTR:
+ ctls |= 2;
+ break;
+ case LALT:
+ alts |= 1;
+ break;
+ case RALT:
+ alts |= 2;
+ break;
+ case ASH:
+ agrs = 1;
+ break;
+ case META:
+ metas = 1;
+ break;
case NEXT:
- this_scr = get_scr_num();
- for (i = this_scr + 1; i != this_scr; i = (i + 1)%MAXCONS) {
- struct tty *tp = VIRTUAL_TTY(i);
+ {
+ int next, this = get_scr_num();
+ accents = 0;
+ for (next = this+1; next != this; next = (next+1)%MAXCONS) {
+ struct tty *tp = VIRTUAL_TTY(next);
if (tp->t_state & TS_ISOPEN) {
- switch_scr(cur_console, i);
+ switch_scr(cur_console, next);
break;
}
}
+ }
break;
-
+ case BTAB:
+ accents = 0;
+ return(BKEY);
default:
- if (KEYCHAR(c) >= F_SCR && KEYCHAR(c) <= L_SCR) {
- switch_scr(cur_console, KEYCHAR(c) - F_SCR);
+ if (action >= F_ACC && action <= L_ACC) {
+ /* turn it into an index */
+ action -= F_ACC - 1;
+ if ((action > accent_map.n_accs)
+ || (accent_map.acc[action - 1].accchar == 0)) {
+ /*
+ * The index is out of range or pointing to an
+ * empty entry.
+ */
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ /*
+ * If the same accent key has been hit twice,
+ * produce the accent char itself.
+ */
+ if (action == accents) {
+ action = accent_map.acc[accents - 1].accchar;
+ accents = 0;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ /* remember the index and wait for the next key stroke */
+ accents = action;
break;
}
- /* assert(c & FKEY) */
- return c;
+ if (accents > 0) {
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ if (action >= F_SCR && action <= L_SCR) {
+ switch_scr(cur_console, action - F_SCR);
+ break;
+ }
+ if (action >= F_FN && action <= L_FN)
+ action |= FKEY;
+ return(action);
}
- /* goto next_code */
- } else {
- /* regular keys (maybe MKEY is set) */
- return c;
}
- }
+ else {
+ if (accents) {
+ struct acc_t *acc;
+ int i;
+ acc = &accent_map.acc[accents - 1];
+ accents = 0;
+ /*
+ * If the accent key is followed by the space key,
+ * produce the accent char itself.
+ */
+ if (action == ' ') {
+ action = acc->accchar;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ for (i = 0; i < NUM_ACCENTCHARS; ++i) {
+ if (acc->map[i][0] == 0) /* end of the map entry */
+ break;
+ if (acc->map[i][0] == action) {
+ action = acc->map[i][1];
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ }
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ if (metas)
+ action |= MKEY;
+ return(action);
+ }
+ }
goto next_code;
}
int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
+scmmap(dev_t dev, int offset, int nprot)
{
- struct tty *tp;
- struct scr_stat *scp;
-
- tp = scdevtotty(dev);
- if (!tp)
- return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
- return (*vidsw[scp->ad]->mmap)(scp->adp, offset);
+ if (offset > 0x20000 - PAGE_SIZE)
+ return -1;
+ return i386_btop((VIDEOMEM + offset));
}
/*
@@ -3781,64 +3885,82 @@ mask2attr(struct term_stat *term)
return attr;
}
-static int
-save_kbd_state(scr_stat *scp)
+static void
+set_keyboard(int command, int data)
{
- int state;
- int error;
+ int s;
+
+ if (sc_kbdc == NULL)
+ return;
+
+ /* prevent the timeout routine from polling the keyboard */
+ if (!kbdc_lock(sc_kbdc, TRUE))
+ return;
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error == 0) {
- scp->status &= ~LOCK_MASK;
- scp->status |= state;
+ /* disable the keyboard and mouse interrupt */
+ s = spltty();
+#if 0
+ c = get_controller_command_byte(sc_kbdc);
+ if ((c == -1)
+ || !set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
+ | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
+ /* CONTROLLER ERROR */
+ kbdc_lock(sc_kbdc, FALSE);
+ splx(s);
+ return;
}
- return error;
-}
+ /*
+ * Now that the keyboard controller is told not to generate
+ * the keyboard and mouse interrupts, call `splx()' to allow
+ * the other tty interrupts. The clock interrupt may also occur,
+ * but the timeout routine (`scrn_timer()') will be blocked
+ * by the lock flag set via `kbdc_lock()'
+ */
+ splx(s);
+#endif
-static int
-update_kbd_state(int new_bits, int mask)
-{
- int state;
- int error;
+ if (send_kbd_command_and_data(sc_kbdc, command, data) != KBD_ACK)
+ send_kbd_command(sc_kbdc, KBDC_ENABLE_KBD);
- if (mask != LOCK_MASK) {
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error)
- return error;
- state &= ~mask;
- state |= new_bits & mask;
- } else {
- state = new_bits & LOCK_MASK;
+#if 0
+ /* restore the interrupts */
+ if (!set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
+ /* CONTROLLER ERROR */
}
- error = kbd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+#else
+ splx(s);
+#endif
+ kbdc_lock(sc_kbdc, FALSE);
}
-static int
-update_kbd_leds(int which)
+static void
+update_leds(int which)
{
- int error;
+ static u_char xlate_leds[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
- which &= LOCK_MASK;
- error = kbd_ioctl(kbd, KDSETLED, (caddr_t)&which);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ /* replace CAPS led with ALTGR led for ALTGR keyboards */
+ if (key_map.n_keys > ALTGR_OFFSET) {
+ if (which & ALKED)
+ which |= CLKED;
+ else
+ which &= ~CLKED;
+ }
+
+ set_keyboard(KBDC_SET_LEDS, xlate_leds[which & LED_MASK]);
}
int
set_mode(scr_stat *scp)
{
video_info_t info;
+ video_adapter_t *adp;
/* reject unsupported mode */
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
+ if ((*biosvidsw.get_info)(scp->adp, scp->mode, &info))
return 1;
/* if this vty is not currently showing, do nothing */
@@ -3846,12 +3968,14 @@ set_mode(scr_stat *scp)
return 0;
/* setup video hardware for the given mode */
- (*vidsw[scp->ad]->set_mode)(scp->adp, scp->mode);
- Crtat = scp->adp->va_window;
+ adp = get_adapter(scp);
+ (*biosvidsw.set_mode)(scp->adp, scp->mode);
+ Crtat = (u_short *)adp->va_window;
if (!(scp->status & GRAPHICS_MODE)) {
/* load appropriate font */
- if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->adp->va_flags)) {
+ if (!(scp->status & PIXEL_MODE)
+ && ISFONTAVAIL(get_adapter(scp)->va_flags)) {
if (scp->font_size < 14) {
if (fonts_loaded & FONT_8)
copy_font(scp, LOAD, 8, font_8);
@@ -3863,24 +3987,23 @@ set_mode(scr_stat *scp)
copy_font(scp, LOAD, 14, font_14);
}
/*
- * FONT KLUDGE:
- * This is an interim kludge to display correct font.
- * Always use the font page #0 on the video plane 2.
- * Somehow we cannot show the font in other font pages on
- * some video cards... XXX
- */
- (*vidsw[scp->ad]->show_font)(scp->adp, 0);
+ * FONT KLUDGE:
+ * This is an interim kludge to display correct font.
+ * Always use the font page #0 on the video plane 2.
+ * Somehow we cannot show the font in other font pages on
+ * some video cards... XXX
+ */
+ (*biosvidsw.show_font)(scp->adp, 0);
}
mark_all(scp);
}
if (scp->status & PIXEL_MODE)
- bzero_io(scp->adp->va_window, scp->xpixel*scp->ypixel/8);
-
+ generic_bzero((u_char *)(adp->va_window), scp->xpixel*scp->ypixel/8);
set_border(scp, scp->border);
/* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
+ (*biosvidsw.set_hw_cursor)(scp->adp, -1, -1);
return 0;
}
@@ -3888,14 +4011,14 @@ set_mode(scr_stat *scp)
void
set_border(scr_stat *scp, int color)
{
- vm_offset_t p;
+ u_char *p;
int xoff;
int yoff;
int xlen;
int ylen;
int i;
- (*vidsw[scp->ad]->set_border)(scp->adp, color);
+ (*biosvidsw.set_border)(scp->adp, color);
if (scp->status & PIXEL_MODE) {
outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
@@ -3903,21 +4026,21 @@ set_border(scr_stat *scp, int color)
outw(GDCIDX, 0x0f01); /* set/reset enable */
outw(GDCIDX, 0xff08); /* bit mask */
outw(GDCIDX, (color << 8) | 0x00); /* set/reset */
- p = scp->adp->va_window;
+ p = (u_char *)(get_adapter(scp)->va_window);
xoff = scp->xoff;
yoff = scp->yoff*scp->font_size;
xlen = scp->xpixel/8;
ylen = scp->ysize*scp->font_size;
if (yoff > 0) {
- bzero_io(p, xlen*yoff);
- bzero_io(p + xlen*(yoff + ylen),
- xlen*scp->ypixel - xlen*(yoff + ylen));
+ generic_bzero(p, xlen*yoff);
+ generic_bzero(p + xlen*(yoff + ylen),
+ xlen*scp->ypixel - xlen*(yoff + ylen));
}
if (xoff > 0) {
for (i = 0; i < ylen; ++i) {
- bzero_io(p + xlen*(yoff + i), xoff);
- bzero_io(p + xlen*(yoff + i) + xoff + scp->xsize,
- xlen - xoff - scp->xsize);
+ generic_bzero(p + xlen*(yoff + i), xoff);
+ generic_bzero(p + xlen*(yoff + i) + xoff + scp->xsize,
+ xlen - xoff - scp->xsize);
}
}
outw(GDCIDX, 0x0000); /* set/reset */
@@ -3937,11 +4060,11 @@ copy_font(scr_stat *scp, int operation, int font_size, u_char *buf)
*/
font_loading_in_progress = TRUE;
if (operation == LOAD) {
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, buf, 0, 256);
+ (*biosvidsw.load_font)(scp->adp, 0, font_size, buf, 0, 256);
if (sc_flags & CHAR_CURSOR)
set_destructive_cursor(scp);
} else if (operation == SAVE) {
- (*vidsw[scp->ad]->save_font)(scp->adp, 0, font_size, buf, 0, 256);
+ (*biosvidsw.save_font)(scp->adp, 0, font_size, buf, 0, 256);
}
font_loading_in_progress = FALSE;
}
@@ -3952,10 +4075,9 @@ set_destructive_cursor(scr_stat *scp)
u_char cursor[32];
u_char *font_buffer;
int font_size;
- int crtc_addr;
int i;
- if (!ISFONTAVAIL(scp->adp->va_flags)
+ if (!ISFONTAVAIL(get_adapter(scp)->va_flags)
|| (scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
return;
@@ -3991,11 +4113,10 @@ set_destructive_cursor(scr_stat *scp)
(scp->cursor_start >= scp->font_size && i == scp->font_size - 1))
cursor[i] |= 0xff;
#if 1
- crtc_addr = scp->adp->va_crtc_addr;
while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ;
#endif
font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, cursor, DEAD_CHAR, 1);
+ (*biosvidsw.load_font)(scp->adp, 0, font_size, cursor, DEAD_CHAR, 1);
font_loading_in_progress = FALSE;
}
@@ -4249,10 +4370,10 @@ draw_mouse_image(scr_stat *scp)
{
u_short buffer[32];
u_short xoffset, yoffset;
- vm_offset_t crt_pos = scp->adp->va_window + 2*(scp->mouse_pos - scp->scr_buf);
+ u_short *crt_pos = (u_short *)(get_adapter(scp)->va_window)
+ + (scp->mouse_pos - scp->scr_buf);
u_char *font_buffer;
int font_size;
- int crtc_addr;
int i;
if (scp->font_size < 14) {
@@ -4300,21 +4421,20 @@ draw_mouse_image(scr_stat *scp)
#if 1
/* wait for vertical retrace to avoid jitter on some videocards */
- crtc_addr = scp->adp->va_crtc_addr;
while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ;
#endif
font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, 32, scp->mouse_cursor,
+ (*biosvidsw.load_font)(scp->adp, 0, 32, scp->mouse_cursor,
SC_MOUSE_CHAR, 4);
font_loading_in_progress = FALSE;
- writew(crt_pos, (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR);
- writew(crt_pos+2*scp->xsize,
- (*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2));
+ *(crt_pos) = (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR;
+ *(crt_pos+scp->xsize) =
+ (*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2);
if (scp->mouse_xpos < (scp->xsize-1)*8) {
- writew(crt_pos + 2, (*(scp->mouse_pos + 1) & 0xff00) | (SC_MOUSE_CHAR + 1));
- writew(crt_pos+2*scp->xsize + 2,
- (*(scp->mouse_pos + scp->xsize + 1) & 0xff00) | (SC_MOUSE_CHAR + 3));
+ *(crt_pos + 1) = (*(scp->mouse_pos + 1) & 0xff00) | (SC_MOUSE_CHAR + 1);
+ *(crt_pos+scp->xsize + 1) =
+ (*(scp->mouse_pos + scp->xsize + 1) & 0xff00) | (SC_MOUSE_CHAR + 3);
}
mark_for_update(scp, scp->mouse_pos - scp->scr_buf);
mark_for_update(scp, scp->mouse_pos + scp->xsize + 1 - scp->scr_buf);
@@ -4323,16 +4443,17 @@ draw_mouse_image(scr_stat *scp)
static void
remove_mouse_image(scr_stat *scp)
{
- vm_offset_t crt_pos;
+ u_short *crt_pos;
if (!ISTEXTSC(scp))
return;
- crt_pos = scp->adp->va_window + 2*(scp->mouse_oldpos - scp->scr_buf);
- writew(crt_pos, *(scp->mouse_oldpos));
- writew(crt_pos+2, *(scp->mouse_oldpos+1));
- writew(crt_pos+2*scp->xsize, *(scp->mouse_oldpos+scp->xsize));
- writew(crt_pos+2*scp->xsize+2, *(scp->mouse_oldpos+scp->xsize+1));
+ crt_pos = (u_short *)(get_adapter(scp)->va_window)
+ + (scp->mouse_oldpos - scp->scr_buf);
+ *(crt_pos) = *(scp->mouse_oldpos);
+ *(crt_pos+1) = *(scp->mouse_oldpos+1);
+ *(crt_pos+scp->xsize) = *(scp->mouse_oldpos+scp->xsize);
+ *(crt_pos+scp->xsize+1) = *(scp->mouse_oldpos+scp->xsize+1);
mark_for_update(scp, scp->mouse_oldpos - scp->scr_buf);
mark_for_update(scp, scp->mouse_oldpos + scp->xsize + 1 - scp->scr_buf);
}
@@ -4340,13 +4461,13 @@ remove_mouse_image(scr_stat *scp)
static void
draw_cutmarking(scr_stat *scp)
{
- vm_offset_t crt_pos;
+ u_short *crt_pos;
u_short *ptr;
u_short och, nch;
- crt_pos = scp->adp->va_window;
+ crt_pos = (u_short *)(get_adapter(scp)->va_window);
for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
- nch = och = readw(crt_pos + 2*(ptr - scp->scr_buf));
+ nch = och = *(crt_pos + (ptr - scp->scr_buf));
/* are we outside the selected area ? */
if ( ptr < (scp->mouse_cut_start > scp->mouse_cut_end ?
scp->mouse_cut_end : scp->mouse_cut_start) ||
@@ -4368,7 +4489,7 @@ draw_cutmarking(scr_stat *scp)
}
}
if (nch != och)
- writew(crt_pos + 2*(ptr - scp->scr_buf), nch);
+ *(crt_pos + (ptr - scp->scr_buf)) = nch;
}
}
@@ -4416,13 +4537,13 @@ blink_screen(void *arg)
}
else {
if (blink_in_progress & 1)
- fillw_io(kernel_default.std_color | scr_map[0x20],
- scp->adp->va_window,
- scp->xsize * scp->ysize);
+ fillw(kernel_default.std_color | scr_map[0x20],
+ (u_short *)(get_adapter(scp)->va_window),
+ scp->xsize * scp->ysize);
else
- fillw_io(kernel_default.rev_color | scr_map[0x20],
- scp->adp->va_window,
- scp->xsize * scp->ysize);
+ fillw(kernel_default.rev_color | scr_map[0x20],
+ (u_short *)(get_adapter(scp)->va_window),
+ scp->xsize * scp->ysize);
blink_in_progress--;
timeout(blink_screen, scp, hz / 10);
}
@@ -4432,8 +4553,8 @@ void
sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
{
u_char *font;
- vm_offset_t d;
- vm_offset_t e;
+ u_char volatile *d;
+ u_char *e;
u_char *f;
int font_size;
int line_length;
@@ -4443,8 +4564,8 @@ sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
u_char c;
if (ISTEXTSC(scp)) {
- bcopy_toio(p + from, scp->adp->va_window + 2*from,
- (to - from + 1)*sizeof(u_short));
+ generic_bcopy(p + from, (u_short *)(get_adapter(scp)->va_window) + from,
+ (to - from + 1)*sizeof(u_short));
} else /* if ISPIXELSC(scp) */ {
if (mark)
mark = 255;
@@ -4457,7 +4578,7 @@ sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
font = font_14;
line_length = scp->xpixel/8;
xsize = scp->xsize;
- d = scp->adp->va_window
+ d = (u_char *)(get_adapter(scp)->va_window)
+ scp->xoff + scp->yoff*font_size*line_length
+ (from%xsize) + font_size*line_length*(from/xsize);
@@ -4471,16 +4592,16 @@ sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
bg = (p[i] & 0xf000);
outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
outw(GDCIDX, 0xff08); /* bit mask */
- writeb(d, 0);
- c = readb(d); /* set the background color in the latch */
+ *d = 0;
+ c = *d; /* set the background color in the latch */
}
/* foreground color */
outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
- e = d;
+ e = (u_char *)d;
f = &font[(p[i] & 0x00ff)*font_size];
for (j = 0 ; j < font_size; j++, f++) {
outw(GDCIDX, ((*f^mark) << 8) | 0x08); /* bit mask */
- writeb(e, 0);
+ *e = 0;
e += line_length;
}
d++;
@@ -4526,4 +4647,42 @@ sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
}
}
+#ifdef SC_SPLASH_SCREEN
+
+static void
+scsplash_init(scr_stat *scp)
+{
+ video_info_t info;
+
+ if (scsplash_load(scp) == 0 && add_scrn_saver(scsplash_saver) == 0) {
+ default_saver = scsplash_saver;
+ scrn_blank_time = DEFAULT_BLANKTIME;
+ run_scrn_saver = TRUE;
+ if (!(boothowto & (RB_VERBOSE | RB_CONFIG))) {
+ scsplash_stick(TRUE);
+ scsplash_saver(TRUE);
+ }
+ }
+}
+
+static void
+scsplash_term(scr_stat *scp)
+{
+ default_saver = none_saver;
+ scsplash_stick(FALSE);
+ remove_scrn_saver(scsplash_saver);
+ scsplash_unload(scp);
+}
+
+static void
+scsplash_saver(int show)
+{
+ if (show)
+ scsplash(TRUE);
+ else if (!sticky_splash)
+ scsplash(FALSE);
+}
+
+#endif /* SC_SPLASH_SCREEN */
+
#endif /* NSC */
diff --git a/sys/dev/syscons/syscons.h b/sys/i386/isa/syscons.h
index 1a88a8c7b5ae9..0298cbbf2f400 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/i386/isa/syscons.h
@@ -25,11 +25,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.45 1999/01/11 03:18:29 yokota Exp $
+ * $Id: syscons.h,v 1.43 1998/09/29 02:00:57 ache Exp $
*/
-#ifndef _DEV_SYSCONS_SYSCONS_H_
-#define _DEV_SYSCONS_SYSCONS_H_
+#ifndef _I386_ISA_SYSCONS_H_
+#define _I386_ISA_SYSCONS_H_
/* vm things */
#define ISMAPPED(pa, width) \
@@ -52,7 +52,11 @@
}
/* status flags */
+#define LOCK_KEY_MASK 0x0000F
+#define LED_MASK 0x00007
#define UNKNOWN_MODE 0x00010
+#define KBD_RAW_MODE 0x00020
+#define KBD_CODE_MODE 0x00040
#define SWITCH_WAIT_REL 0x00080
#define SWITCH_WAIT_ACQ 0x00100
#define BUFFER_SAVED 0x00200
@@ -69,15 +73,11 @@
#define VISUAL_BELL 0x00001
#define BLINK_CURSOR 0x00002
#define CHAR_CURSOR 0x00004
-/* these options are now obsolete; use corresponding options for kbd driver */
-#if 0
#define DETECT_KBD 0x00008
#define XT_KEYBD 0x00010
#define KBD_NORESET 0x00020
-#endif
#define QUIET_BELL 0x00040
#define VESA800X600 0x00080
-#define AUTODETECT_KBD 0x00100
/* attribute flags */
#define NORMAL_ATTR 0x00
@@ -128,8 +128,7 @@ typedef struct term_stat {
} term_stat;
typedef struct scr_stat {
- int ad; /* video adapter index */
- video_adapter_t *adp; /* video adapter structure */
+ int adp; /* video adapter index */
u_short *scr_buf; /* buffer when off screen */
int xpos; /* current X position */
int ypos; /* current Y position */
@@ -146,7 +145,6 @@ typedef struct scr_stat {
int end; /* modified area end */
term_stat term; /* terminal emulation stuff */
int status; /* status (bitfield) */
- int kbd_mode; /* keyboard I/O mode */
u_short *cursor_pos; /* cursor buffer position */
u_short *cursor_oldpos; /* cursor old buffer position */
u_short cursor_saveunder; /* saved chars under cursor */
@@ -166,6 +164,7 @@ typedef struct scr_stat {
u_short bell_duration;
u_short bell_pitch;
u_char border; /* border color */
+ int initial_mode; /* initial mode */
int mode; /* mode */
pid_t pid; /* pid of controlling proc */
struct proc *proc; /* proc* of controlling proc */
@@ -175,11 +174,11 @@ typedef struct scr_stat {
u_short *history_pos; /* position shown on screen */
u_short *history_save; /* save area index */
int history_size; /* size of history buffer */
-#ifdef __i386__
struct apmhook r_hook; /* reconfiguration support */
-#endif
+#ifdef SC_SPLASH_SCREEN
int splash_save_mode; /* saved mode for splash screen */
int splash_save_status; /* saved status for splash screen */
+#endif
} scr_stat;
typedef struct default_attr {
@@ -204,9 +203,6 @@ typedef struct default_attr {
/* misc prototypes used by different syscons related LKM's */
/* syscons.c */
-int sc_probe_unit(int unit, int flags);
-int sc_attach_unit(int unit, int flags);
-
extern int (*sc_user_ioctl)(dev_t dev, u_long cmd, caddr_t data, int flag,
struct proc *p);
@@ -215,12 +211,13 @@ scr_stat *sc_get_scr_stat(dev_t dev);
void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image);
void set_border(scr_stat *scp, int color);
-#define save_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->save_palette)((adp), (pal))
-#define load_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->load_palette)((adp), (pal))
+#define save_palette(scp, pal) (*biosvidsw.save_palette)((scp)->adp, pal)
+#define load_palette(scp, pal) (*biosvidsw.load_palette)((scp)->adp, pal)
+#define get_adapter(scp) (*biosvidsw.adapter)((scp)->adp)
+
+int add_scrn_saver(void (*this)(int));
+int remove_scrn_saver(void (*this)(int));
-void sc_touch_scrn_saver(void);
void sc_clear_screen(scr_stat *scp);
void sc_move_mouse(scr_stat *scp, int x, int y);
int sc_clean_up(scr_stat *scp);
@@ -238,4 +235,11 @@ int sc_set_pixel_mode(scr_stat *scp, struct tty *tp,
int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
struct proc *p);
-#endif /* !_DEV_SYSCONS_SYSCONS_H_ */
+#ifdef SC_SPLASH_SCREEN
+/* splash.c */
+void scsplash(int);
+int scsplash_load(scr_stat *scp);
+int scsplash_unload(scr_stat *scp);
+#endif
+
+#endif /* !_I386_ISA_SYSCONS_H_ */
diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c
index ce98e65dfebe7..5c2a661ee810c 100644
--- a/sys/i386/isa/tw.c
+++ b/sys/i386/isa/tw.c
@@ -274,7 +274,6 @@ static void twdelayn(int n);
static void twsetuptimes(int *a);
static int wait_for_zero(struct tw_sc *sc);
static int twputpkt(struct tw_sc *sc, u_char *p);
-static ointhand2_t twintr;
static int twgetbytes(struct tw_sc *sc, u_char *p, int cnt);
static timeout_t twabortrcv;
static int twsend(struct tw_sc *sc, int h, int k, int cnt);
@@ -392,7 +391,6 @@ static int twattach(idp)
struct tw_sc *sc;
int unit;
- idp->id_ointr = twintr;
sc = &tw_sc[unit = idp->id_unit];
sc->sc_port = idp->id_iobase;
sc->sc_state = 0;
@@ -416,6 +414,7 @@ int twopen(dev, flag, mode, p)
{
struct tw_sc *sc = &tw_sc[TWUNIT(dev)];
int s;
+ int port;
s = spltty();
if(sc->sc_state == 0) {
@@ -436,6 +435,7 @@ int twclose(dev, flag, mode, p)
{
struct tw_sc *sc = &tw_sc[TWUNIT(dev)];
int s;
+ int port = sc->sc_port;
s = spltty();
sc->sc_state = 0;
@@ -918,7 +918,7 @@ tw_is_within(int value, int expected, int tolerance)
* reconstruct the transmission without having to poll.
*/
-static void twintr(unit)
+void twintr(unit)
int unit;
{
struct tw_sc *sc = &tw_sc[unit];
diff --git a/sys/i386/isa/ultra14f.c b/sys/i386/isa/ultra14f.c
new file mode 100644
index 0000000000000..8d01bef01fe2a
--- /dev/null
+++ b/sys/i386/isa/ultra14f.c
@@ -0,0 +1,1362 @@
+/*
+ * Ported for use with the UltraStor 14f by Gary Close (gclose@wvnvms.wvnet.edu)
+ * Slight fixes to timeouts to run with the 34F
+ * Thanks to Julian Elischer for advice and help with this port.
+ *
+ * Written by Julian Elischer (julian@tfs.com)
+ * for TRW Financial Systems for use under the MACH(2.5) operating system.
+ *
+ * TRW Financial Systems, in accordance with their agreement with Carnegie
+ * Mellon University, makes this software available to CMU to distribute
+ * or use in any manner that they see fit as long as this message is kept with
+ * the software. For this reason TFS also grants any other persons or
+ * organisations permission to use or modify this software.
+ *
+ * TFS supplies this software to be publicly redistributed
+ * on the understanding that TFS is not responsible for the correct
+ * functioning of this software in any circumstances.
+ *
+ * commenced: Sun Sep 27 18:14:01 PDT 1992
+ * slight mod to make work with 34F as well: Wed Jun 2 18:05:48 WST 1993
+ *
+ * today: Fri Jun 2 17:21:03 EST 1994
+ * added 24F support ++sg
+ *
+ * $Id: ultra14f.c,v 1.60 1998/06/08 09:47:37 bde Exp $
+ */
+
+#ifdef KERNEL /* don't laugh.. this compiles to a program too.. look */
+#include "uha.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/kernel.h>
+
+#include <machine/clock.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <i386/isa/isa_device.h>
+#endif /*KERNEL */
+#include <scsi/scsiconf.h>
+#include <scsi/scsi_debug.h>
+
+/* */
+
+#ifndef KERNEL
+#define NUHA 1
+#endif /*KERNEL */
+
+typedef struct {
+ unsigned char addr[4];
+} physaddr;
+typedef struct {
+ unsigned char len[4];
+} physlen;
+
+#define KVTOPHYS(x) vtophys(x)
+
+#define UHA_MSCP_MAX 32 /* store up to 32MSCPs at any one time
+ * MAX = ?
+ */
+#define MSCP_HASH_SIZE 32 /* when we have a physical addr. for
+ * a mscp and need to find the mscp in
+ * space, look it up in the hash table
+ */
+#define MSCP_HASH_SHIFT 9 /* only hash on multiples of 512 */
+#define MSCP_HASH(x) ((((long int)(x))>>MSCP_HASH_SHIFT) % MSCP_HASH_SIZE)
+
+#define UHA_NSEG 33 /* number of dma segments supported */
+
+/************************** board definitions *******************************/
+struct uha_reg
+{
+ int id; /* product id reg */
+ int type; /* product type reg */
+ int ectl; /* EISA expansion control bits */
+ int config; /* configuration bits */
+ int lmask; /* local doorbell mask reg */
+ int lint; /* local doorbell int/stat reg */
+ int smask; /* system doorbell mask reg */
+ int sint; /* system doorbell int/stat reg */
+ int ogmcmd; /* outgoing mail command */
+ int ogmptr; /* outgoing mail ptr */
+ int icmcmd; /* incoming mail command */
+ int icmptr; /* incoming mail ptr */
+};
+
+struct uha_bits
+{
+ /* uha_lint (read) */
+ unsigned char ldip;
+
+ /* uha_lint (write) */
+ unsigned char adrst;
+ unsigned char sbrst;
+ unsigned char asrst;
+ unsigned char abort;
+ unsigned char ogmint;
+
+ /* uha_sint (read) */
+ unsigned char sintp;
+ unsigned char abort_succ;
+ unsigned char abort_fail;
+
+ /* uha_sint (write) */
+ unsigned char abort_ack;
+ unsigned char icm_ack;
+};
+
+
+/*
+ * UHA_LINT bits (read)
+ */
+
+#define UHA_LDIP 0x80 /* local doorbell int pending */
+#define U24_LDIP 0x02
+
+/*
+ * UHA_LINT bits (write)
+ */
+
+#define UHA_ADRST 0x40 /* adapter soft reset */
+#define UHA_SBRST 0x20 /* scsi bus reset */
+#define UHA_ASRST 0x60 /* adapter and scsi reset */
+#define UHA_ABORT 0x10 /* abort MSCP */
+#define UHA_OGMINT 0x01 /* tell adapter to get mail */
+#define U24_SBRST 0x40 /* scsi bus reset */
+#define U24_ADRST 0x80 /* adapter soft reset */
+#define U24_ASRST 0xc0 /* adapter and scsi reset */
+#define U24_ABORT 0x10 /* same? */
+#define U24_OGMINT 0x02 /* enable OGM interrupt */
+
+/*
+ * UHA_SMASK bits (read)
+ */
+
+#define UHA_SINTEN 0x80 /* system doorbell interupt Enabled */
+#define UHA_ABORT_COMPLETE_EN 0x10 /* abort MSCP command complete int Enabled */
+#define UHA_ICM_ENABLED 0x01 /* ICM interrupt enabled */
+
+/*
+ * UHA_SMASK bits (write)
+ */
+
+#define UHA_ENSINT 0x80 /* enable system doorbell interrupt */
+#define UHA_EN_ABORT_COMPLETE 0x10 /* enable abort MSCP complete int */
+#define UHA_ENICM 0x01 /* enable ICM interrupt */
+
+/*
+ * UHA_SINT bits (read)
+ */
+
+#define UHA_SINTP 0x80 /* system doorbell int pending */
+#define UHA_ABORT_SUCC 0x10 /* abort MSCP successful */
+#define UHA_ABORT_FAIL 0x18 /* abort MSCP failed */
+#define U24_SINTP 0x02 /* system doorbell int pending */
+#define U24_ABORT_SUCC 0x10 /* same? */
+#define U24_ABORT_FAIL 0x18 /* same? */
+
+/*
+ * UHA_SINT bits (write)
+ */
+
+#define UHA_ABORT_ACK 0x18 /* acknowledge status and clear */
+#define UHA_ICM_ACK 0x01 /* acknowledge ICM and clear */
+#define U24_ABORT_ACK 0x18 /* same */
+#define U24_ICM_ACK 0x02 /* 24F acknowledge ICM and clear */
+
+/*
+ * UHA_CONF1 bits (read only)
+ */
+
+#define UHA_DMA_CH5 0x00 /* DMA channel 5 */
+#define UHA_DMA_CH6 0x40 /* 6 */
+#define UHA_DMA_CH7 0x80 /* 7 */
+#define UHA_IRQ15 0x00 /* IRQ 15 */
+#define UHA_IRQ14 0x10 /* 14 */
+#define UHA_IRQ11 0x20 /* 11 */
+#define UHA_IRQ10 0x30 /* 10 */
+
+#define EISA_CONFIG 0x0c80 /* Configuration base port */
+#define EISA_DISABLE 0x01 /* EISA disable bit */
+
+/*
+ * ha_status error codes
+ */
+
+#define UHA_NO_ERR 0x00 /* No error supposedly */
+#define UHA_SBUS_ABORT_ERR 0x84 /* scsi bus abort error */
+#define UHA_SBUS_TIMEOUT 0x91 /* scsi bus selection timeout */
+#define UHA_SBUS_OVER_UNDER 0x92 /* scsi bus over/underrun */
+#define UHA_BAD_SCSI_CMD 0x96 /* illegal scsi command */
+#define UHA_AUTO_SENSE_ERR 0x9b /* auto request sense err */
+#define UHA_SBUS_RES_ERR 0xa3 /* scsi bus reset error */
+#define UHA_BAD_SG_LIST 0xff /* invalid scatter gath list */
+
+struct uha_dma_seg {
+ physaddr addr;
+ physlen len;
+};
+
+struct mscp {
+ unsigned int opcode:3;
+#define U14_HAC 0x01 /* host adapter command */
+#define U14_TSP 0x02 /* target scsi pass through command */
+#define U14_SDR 0x04 /* scsi device reset */
+ unsigned int xdir:2; /* xfer direction */
+#define U14_SDET 0x00 /* determined by scsi command */
+#define U14_SDIN 0x01 /* scsi data in */
+#define U14_SDOUT 0x02 /* scsi data out */
+#define U14_NODATA 0x03 /* no data xfer */
+ unsigned int dcn:1; /* disable disconnect for this command */
+ unsigned int ca:1; /* cache control */
+ unsigned int sgth:1; /* scatter gather flag */
+ unsigned int target:3;
+ unsigned int chan:2; /* scsi channel (always 0 for 14f) */
+ unsigned int lun:3;
+ physaddr data;
+ physlen datalen;
+ physaddr link;
+ unsigned char link_id;
+ unsigned char sg_num; /*number of scat gath segs */
+ /*in s-g list if sg flag is */
+ /*set. starts at 1, 8bytes per */
+ unsigned char senselen;
+ unsigned char cdblen;
+ unsigned char cdb[12];
+ unsigned char ha_status;
+ unsigned char targ_status;
+ physaddr sense; /* if 0 no auto sense */
+ /*-----------------end of hardware supported fields----------------*/
+ struct mscp *next; /* in free list */
+ struct scsi_xfer *xs; /* the scsi_xfer for this cmd */
+ int flags;
+#define MSCP_FREE 0
+#define MSCP_ACTIVE 1
+#define MSCP_ABORTED 2
+ struct uha_dma_seg uha_dma[UHA_NSEG];
+ struct scsi_sense_data mscp_sense;
+ struct mscp *nexthash;
+ long int hashkey;
+};
+
+static struct uha_data {
+ int flags;
+#define UHA_INIT 0x01
+#define UHA_24F 0x02
+ int baseport;
+ struct mscp *mscphash[MSCP_HASH_SIZE];
+ struct mscp *free_mscp;
+ int unit;
+ int our_id; /* our scsi id */
+ int vect;
+ int dma;
+ int nummscps;
+ struct scsi_link sc_link;
+ struct uha_reg *ur;
+ struct uha_bits *ub;
+} *uhadata[NUHA];
+
+static int uha_abort __P((struct uha_data *uha, struct mscp *mscp));
+static u_int32_t uha_adapter_info __P((int unit));
+static int uha_attach __P((struct isa_device *dev));
+static void uha_done __P((struct uha_data *uha, struct mscp *mscp));
+static void uha_free_mscp __P((struct uha_data *uha, struct mscp *mscp,
+ int flags));
+static struct mscp *
+ uha_get_mscp __P((struct uha_data *uha, int flags));
+static int uha_init __P((struct uha_data *uha));
+static int uha24_init __P((struct uha_data *uha));
+static void uhaminphys __P((struct buf *bp));
+static struct mscp *
+ uha_mscp_phys_kv __P((struct uha_data *uha, long mscp_phys));
+static int uha_poll __P((struct uha_data *uha, int wait));
+#ifdef UHADEBUG
+static void uha_print_active_mscp __P((struct uha_data *uha));
+static void uha_print_mscp __P((struct mscp *mscp));
+#endif
+static int uhaprobe __P((struct isa_device *dev));
+static int32_t uha_scsi_cmd __P((struct scsi_xfer *xs));
+static void uha_send_mbox __P((struct uha_data *uha, struct mscp *mscp));
+static timeout_t
+ uha_timeout;
+
+static unsigned long int scratch;
+#define EISA_MAX_SLOTS 16 /* XXX This should go into a comon header */
+static int uha_slot; /* slot last board was found in */
+static int uha_unit;
+#define UHA_SHOWMSCPS 0x01
+#define UHA_SHOWINTS 0x02
+#define UHA_SHOWCMDS 0x04
+#define UHA_SHOWMISC 0x08
+#define FAIL 1
+#define SUCCESS 0
+#define PAGESIZ 4096
+
+#ifdef KERNEL
+struct isa_driver uhadriver =
+{
+ uhaprobe,
+ uha_attach,
+ "uha"
+};
+
+static struct scsi_adapter uha_switch =
+{
+ uha_scsi_cmd,
+ uhaminphys,
+ 0,
+ 0,
+ uha_adapter_info,
+ "uha",
+ { 0, 0 }
+};
+
+/* the below structure is so we have a default dev struct for out link struct */
+static struct scsi_device uha_dev =
+{
+ NULL, /* Use default error handler */
+ NULL, /* have a queue, served by this */
+ NULL, /* have no async handler */
+ NULL, /* Use default 'done' routine */
+ "uha",
+ 0,
+ { 0, 0 }
+};
+
+#endif /*KERNEL */
+
+#ifndef KERNEL
+main()
+{
+ printf("uha_data is %d bytes\n", sizeof(struct uha_data));
+ printf("mscp is %d bytes\n", sizeof(struct mscp));
+}
+
+#else /*KERNEL*/
+/*
+ * Function to send a command out through a mailbox
+ */
+static void
+uha_send_mbox(struct uha_data *uha, struct mscp *mscp)
+{
+ int spincount = 100000; /* 1s should be enough */
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+ int s = splbio();
+
+ while (--spincount) {
+ if ((inb(ur->lint) & ub->ldip) == 0)
+ break;
+ DELAY(100);
+ }
+ if (spincount == 0) {
+ printf("uha%d: uha_send_mbox, board is not responding\n",
+ uha->unit);
+ Debugger("ultra14f");
+ }
+ outl(ur->ogmptr, KVTOPHYS(mscp));
+ if (uha->flags & UHA_24F) outb(ur->ogmcmd, 1);
+ outb(ur->lint, ub->ogmint);
+ splx(s);
+}
+
+/*
+ * Function to send abort to 14f
+ */
+int
+uha_abort(struct uha_data *uha, struct mscp *mscp)
+{
+ int spincount = 100; /* 1 mSec */
+ int abortcount = 200000; /*2 secs */
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+ int s = splbio();
+
+ while (--spincount) {
+ if ((inb(ur->lint) & ub->ldip) == 0)
+ break;
+ DELAY(10);
+ }
+ if (spincount == 0) {
+ printf("uha%d: uha_abort, board is not responding\n", uha->unit);
+ Debugger("ultra14f");
+ }
+ outl(ur->ogmptr,KVTOPHYS(mscp));
+ if (uha->flags & UHA_24F) outb(ur->ogmcmd, 1);
+ outb(ur->lint, ub->abort);
+
+ while (--abortcount) {
+ if (inb(ur->sint) & ub->abort_fail)
+ break;
+ DELAY(10);
+ }
+ if (abortcount == 0) {
+ printf("uha%d: uha_abort, board is not responding\n", uha->unit);
+ Debugger("ultra14f");
+ }
+ if ((inb(ur->sint) & 0x10) != 0) {
+ outb(ur->sint, ub->abort_ack);
+ splx(s);
+ return (1);
+ } else {
+ outb(ur->sint, ub->abort_ack);
+ splx(s);
+ return (0);
+ }
+}
+
+/*
+ * Function to poll for command completion when in poll mode.
+ *
+ * wait = timeout in msec
+ */
+static int
+uha_poll(struct uha_data *uha, int wait)
+{
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+ int stport = ur->sint;
+
+ while (--wait) {
+ if (inb(stport) & ub->sintp)
+ break;
+ DELAY(1000); /* 1 mSec per loop */
+ }
+ if (wait == 0) {
+ printf("uha%d: uha_poll, board is not responding\n", uha->unit);
+ return (EIO);
+ }
+ uhaintr(uha->unit);
+ return (0);
+}
+
+/*
+ * Check if the device can be found at the port given and if so, set it up
+ * ready for further work as an argument, takes the isa_device structure
+ * from autoconf.c
+ */
+int
+uhaprobe(dev)
+ struct isa_device *dev;
+{
+ int unit = uha_unit;
+ struct uha_data *uha;
+
+ dev->id_unit = unit; /* XXX */
+
+ /*
+ * find unit and check we have that many defined
+ */
+ if (unit >= NUHA) {
+ printf("uha: unit number (%d) too high\n", unit);
+ return (0);
+ }
+ dev->id_unit = unit;
+
+ /*
+ * Allocate a storage area for us
+ */
+ if (uhadata[unit]) {
+ printf("uha%d: memory already allocated\n", unit);
+ return 0;
+ }
+ uha = malloc(sizeof(struct uha_data), M_TEMP, M_NOWAIT);
+ if (!uha) {
+ printf("uha%d: cannot malloc!\n", unit);
+ return 0;
+ }
+ bzero(uha, sizeof(struct uha_data));
+
+ uha->ur = malloc(sizeof(struct uha_reg), M_TEMP, M_NOWAIT);
+ if (!uha->ur) {
+ printf("uha%d: cannot malloc!\n", unit);
+ return 0;
+ }
+ bzero(uha->ur, sizeof(struct uha_reg));
+
+ uha->ub = malloc(sizeof(struct uha_bits), M_TEMP, M_NOWAIT);
+ if (!uha->ub) {
+ printf("uha%d: cannot malloc!\n", unit);
+ return 0;
+ }
+ bzero(uha->ub, sizeof(struct uha_bits));
+
+ uhadata[unit] = uha;
+ uha->unit = unit;
+ uha->baseport = dev->id_iobase;
+ /*
+ * Try initialise a unit at this location
+ * sets up dma and bus speed, loads uha->vect
+ */
+ if (uha_init(uha) != 0 && uha24_init(uha) != 0) {
+ uhadata[unit] = NULL;
+ free(uha->ur, M_TEMP);
+ free(uha->ub, M_TEMP);
+ free(uha, M_TEMP);
+ return (0);
+ }
+ /* if it's there put in its interrupt and DRQ vectors */
+ dev->id_irq = (1 << uha->vect);
+ dev->id_drq = uha->dma;
+ dev->id_iobase = uha->baseport;
+
+ uha_unit++;
+ return (16);
+}
+
+/*
+ * Attach all the sub-devices we can find
+ */
+int
+uha_attach(dev)
+ struct isa_device *dev;
+{
+ int unit = dev->id_unit;
+ struct uha_data *uha = uhadata[unit];
+ struct scsibus_data *scbus;
+
+ /*
+ * fill in the prototype scsi_link.
+ */
+ uha->sc_link.adapter_unit = unit;
+ uha->sc_link.adapter_targ = uha->our_id;
+ uha->sc_link.adapter_softc = uha;
+ uha->sc_link.adapter = &uha_switch;
+ uha->sc_link.device = &uha_dev;
+ uha->sc_link.flags = SDEV_BOUNCE;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &uha->sc_link;
+
+ /*
+ * ask the adapter what subunits are present
+ */
+ scsi_attachdevs(scbus);
+
+ return 1;
+}
+
+/*
+ * Return some information to the caller about
+ * the adapter and its capabilities
+ */
+u_int32_t
+uha_adapter_info(unit)
+ int unit;
+{
+ return (2); /* 2 outstanding requests at a time per device */
+}
+
+/*
+ * Catch an interrupt from the adaptor
+ */
+void
+uhaintr(unit)
+ int unit;
+{
+ struct uha_data *uha = uhadata[unit];
+ struct mscp *mscp;
+ u_char uhastat;
+ unsigned long int mboxval;
+ struct uha_reg *ur;
+ struct uha_bits *ub;
+ int port;
+
+ ur = uha->ur;
+ ub = uha->ub;
+ port = uha->baseport;
+
+#ifdef UHADEBUG
+ printf("uhaintr ");
+#endif /*UHADEBUG */
+
+ while ((uhastat = inb(ur->sint)) & ub->sintp) {
+ /*
+ * First get all the information and then
+ * acknowledge the interrupt
+ */
+ mboxval = inl(ur->icmptr);
+ outb(ur->sint, ub->icm_ack);
+ if (uha->flags & UHA_24F) outb(ur->icmcmd, 0);
+
+#ifdef UHADEBUG
+ printf("status = 0x%x ", uhastat);
+#endif /*UHADEBUG*/
+ /*
+ * Process the completed operation
+ */
+
+ mscp = uha_mscp_phys_kv(uha, mboxval);
+ if (!mscp) {
+ printf("uha: BAD MSCP RETURNED\n");
+ return; /* whatever it was, it'll timeout */
+ }
+ untimeout(uha_timeout, (caddr_t)mscp, mscp->xs->timeout_ch);
+
+ uha_done(uha, mscp);
+ }
+}
+
+/*
+ * We have a mscp which has been processed by the adaptor, now we look to see
+ * how the operation went.
+ */
+void
+uha_done(uha, mscp)
+ struct uha_data *uha;
+ struct mscp *mscp;
+{
+ struct scsi_sense_data *s1, *s2;
+ struct scsi_xfer *xs = mscp->xs;
+
+ SC_DEBUG(xs->sc_link, SDEV_DB2, ("uha_done\n"));
+ /*
+ * Otherwise, put the results of the operation
+ * into the xfer and call whoever started it
+ */
+ if (((mscp->ha_status != UHA_NO_ERR) || (mscp->targ_status != SCSI_OK))
+ && ((xs->flags & SCSI_ERR_OK) == 0)) {
+
+ s1 = &(mscp->mscp_sense);
+ s2 = &(xs->sense);
+
+ if (mscp->ha_status != UHA_NO_ERR) {
+ switch (mscp->ha_status) {
+ case UHA_SBUS_ABORT_ERR:
+ case UHA_SBUS_TIMEOUT: /* No sel response */
+ SC_DEBUG(xs->sc_link, SDEV_DB3,
+ ("abort or timeout; ha_status 0x%x\n",
+ mscp->ha_status));
+ xs->error = XS_TIMEOUT;
+ break;
+ case UHA_SBUS_OVER_UNDER:
+ SC_DEBUG(xs->sc_link, SDEV_DB3,
+ ("scsi bus xfer over/underrun\n"));
+ xs->error = XS_DRIVER_STUFFUP;
+ break;
+ default: /* Other scsi protocol messes */
+ xs->error = XS_DRIVER_STUFFUP;
+ printf("uha%d: unexpected ha_status 0x%x (target status 0x%x)\n",
+ uha->unit, mscp->ha_status,
+ mscp->targ_status);
+ break;
+ }
+ } else {
+ /* Target status problem */
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("target err 0x%x\n",
+ mscp->targ_status));
+ switch (mscp->targ_status) {
+ case 0x02:
+ *s2 = *s1;
+ xs->error = XS_SENSE;
+ break;
+ case 0x08:
+ xs->error = XS_BUSY;
+ break;
+ default:
+ printf("uha%d: unexpected targ_status 0x%x\n",
+ uha->unit, mscp->targ_status);
+ xs->error = XS_DRIVER_STUFFUP;
+ break;
+ }
+ }
+ }
+ else {
+ /* All went correctly OR errors expected */
+ xs->resid = 0;
+ xs->error = 0;
+ }
+ xs->flags |= ITSDONE;
+ uha_free_mscp(uha, mscp, xs->flags);
+ scsi_done(xs);
+}
+
+/*
+ * A mscp (and hence a mbx-out) is put onto the free list.
+ */
+void
+uha_free_mscp(uha, mscp, flags)
+ struct uha_data *uha;
+ struct mscp *mscp;
+ int flags;
+{
+ unsigned int opri = 0;
+
+ if (!(flags & SCSI_NOMASK))
+ opri = splbio();
+
+ mscp->next = uha->free_mscp;
+ uha->free_mscp = mscp;
+ mscp->flags = MSCP_FREE;
+ /*
+ * If there were none, wake abybody waiting for
+ * one to come free, starting with queued entries
+ */
+ if (!mscp->next) {
+ wakeup((caddr_t)&uha->free_mscp);
+ }
+ if (!(flags & SCSI_NOMASK))
+ splx(opri);
+}
+
+/*
+ * Get a free mscp
+ *
+ * If there are none, see if we can allocate a new one. If so, put it in the
+ * hash table too otherwise either return an error or sleep.
+ */
+static struct mscp *
+uha_get_mscp(uha, flags)
+ struct uha_data *uha;
+ int flags;
+{
+ unsigned opri = 0;
+ struct mscp *mscpp;
+ int hashnum;
+
+ if (!(flags & SCSI_NOMASK))
+ opri = splbio();
+ /*
+ * If we can and have to, sleep waiting for one to come free
+ * but only if we can't allocate a new one
+ */
+ while (!(mscpp = uha->free_mscp)) {
+ if (uha->nummscps < UHA_MSCP_MAX) {
+ if (mscpp = (struct mscp *)malloc(sizeof(struct mscp),
+ M_TEMP,
+ M_NOWAIT)) {
+ bzero(mscpp, sizeof(struct mscp));
+ uha->nummscps++;
+ mscpp->flags = MSCP_ACTIVE;
+ /*
+ * put in the phystokv hash table
+ * Never gets taken out.
+ */
+ mscpp->hashkey = KVTOPHYS(mscpp);
+ hashnum = MSCP_HASH(mscpp->hashkey);
+ mscpp->nexthash = uha->mscphash[hashnum];
+ uha->mscphash[hashnum] = mscpp;
+ } else {
+ printf("uha%d: Can't malloc MSCP\n", uha->unit);
+ }
+ goto gottit;
+ } else {
+ if (!(flags & SCSI_NOSLEEP)) {
+ tsleep((caddr_t)&uha->free_mscp, PRIBIO,
+ "uhamscp", 0);
+ }
+ }
+ }
+ if (mscpp) {
+ /* Get MSCP from from free list */
+ uha->free_mscp = mscpp->next;
+ mscpp->flags = MSCP_ACTIVE;
+ }
+ gottit:
+ if (!(flags & SCSI_NOMASK))
+ splx(opri);
+
+ return (mscpp);
+}
+
+/*
+ * given a physical address, find the mscp that it corresponds to.
+ */
+static struct mscp *
+uha_mscp_phys_kv(uha, mscp_phys)
+ struct uha_data *uha;
+ long int mscp_phys;
+{
+ int hashnum = MSCP_HASH(mscp_phys);
+ struct mscp *mscpp = uha->mscphash[hashnum];
+
+ while (mscpp) {
+ if (mscpp->hashkey == mscp_phys)
+ break;
+ mscpp = mscpp->nexthash;
+ }
+ return mscpp;
+}
+
+/*
+ * Start the board, ready for normal operation
+ */
+int
+uha_init(uha)
+ struct uha_data *uha;
+{
+ volatile unsigned char model;
+ volatile unsigned char submodel;
+ unsigned char config_reg1;
+ unsigned char config_reg2;
+ unsigned char dma_ch;
+ unsigned char irq_ch;
+ unsigned char uha_id;
+ int port = uha->baseport;
+ int resetcount = 4000; /* 4 secs? */
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+
+ /*
+ * Prepare to use a 14/34F.
+ */
+ ur->id = port + 0x04;
+ ur->type = port + 0x00; /* 24F only */
+ ur->ectl = port + 0x00; /* 24F only */
+ ur->config = port + 0x06; /* 0-1 for 14F */
+ ur->lmask = port + 0x00;
+ ur->lint = port + 0x01;
+ ur->smask = port + 0x02;
+ ur->sint = port + 0x03;
+ ur->ogmcmd = port + 0x00; /* 24F only */
+ ur->ogmptr = port + 0x08;
+ ur->icmcmd = port + 0x00; /* 24F only */
+ ur->icmptr = port + 0x0c;
+
+ ub->ldip = UHA_LDIP;
+ ub->adrst = UHA_ADRST;
+ ub->sbrst = UHA_SBRST;
+ ub->asrst = UHA_ASRST;
+ ub->abort = UHA_ABORT;
+ ub->ogmint = UHA_OGMINT;
+ ub->sintp = UHA_SINTP;
+ ub->abort_succ = UHA_ABORT_SUCC;
+ ub->abort_fail = UHA_ABORT_FAIL;
+ ub->abort_ack = UHA_ABORT_ACK;
+ ub->icm_ack = UHA_ICM_ACK;
+
+ model = inb(ur->id);
+ submodel = inb(ur->id + 1);
+ if ((model != 0x56) & (submodel != 0x40)) return(ENXIO);
+ printf("uha%d: reading board settings, ", uha->unit);
+
+ config_reg1 = inb(ur->config);
+ config_reg2 = inb(ur->config + 1);
+ dma_ch = (config_reg1 & 0xc0);
+ irq_ch = (config_reg1 & 0x30);
+ uha_id = (config_reg2 & 0x07);
+
+ switch (dma_ch) {
+ case UHA_DMA_CH5:
+ uha->dma = 5;
+ printf("dma=5 ");
+ break;
+ case UHA_DMA_CH6:
+ uha->dma = 6;
+ printf("dma=6 ");
+ break;
+ case UHA_DMA_CH7:
+ uha->dma = 7;
+ printf("dma=7 ");
+ break;
+ default:
+ printf("illegal dma jumper setting\n");
+ return (EIO);
+ }
+ switch (irq_ch) {
+ case UHA_IRQ10:
+ uha->vect = 10;
+ printf("int=10 ");
+ break;
+ case UHA_IRQ11:
+ uha->vect = 11;
+ printf("int=11 ");
+ break;
+ case UHA_IRQ14:
+ uha->vect = 14;
+ printf("int=14 ");
+ break;
+ case UHA_IRQ15:
+ uha->vect = 15;
+ printf("int=15 ");
+ break;
+ default:
+ printf("illegal int jumper setting\n");
+ return (EIO);
+ }
+
+ /* who are we on the scsi bus */
+ printf("id=%x\n", uha_id);
+ uha->our_id = uha_id;
+
+ /*
+ * Note that we are going and return (to probe)
+ */
+ outb(ur->lint, ub->asrst);
+ while (--resetcount) {
+ if (inb(ur->lint))
+ break;
+ DELAY(1000); /* 1 mSec per loop */
+ }
+ if (resetcount == 0) {
+ printf("uha%d: board timed out during reset\n", uha->unit);
+ return (ENXIO);
+ }
+ outb(ur->smask, 0x81); /* make sure interrupts are enabled */
+ uha->flags |= UHA_INIT;
+ return (0);
+}
+
+
+/*
+ * Initialize an Ultrastor 24F
+ */
+int
+uha24_init(uha)
+ struct uha_data *uha;
+{
+ unsigned char p0, p1, p2, p3, p5, p7;
+ unsigned char id[7], rev, haid;
+ int port = 0, irq;
+ int resetcount = 4000;
+ struct uha_reg *ur = uha->ur;
+ struct uha_bits *ub = uha->ub;
+
+ /* Search for the 24F's product ID */
+ uha_slot++;
+ while (uha_slot < EISA_MAX_SLOTS) {
+ /*
+ * Prepare to use a 24F.
+ */
+ port = EISA_CONFIG | (uha_slot << 12);
+ ur->id = port + 0x00;
+ ur->type = port + 0x02;
+ ur->ectl = port + 0x04;
+ ur->config = port + 0x05; /* 0-2 for 24F */
+ ur->lmask = port + 0x0c;
+ ur->lint = port + 0x0d;
+ ur->smask = port + 0x0e;
+ ur->sint = port + 0x0f;
+ ur->ogmcmd = port + 0x16;
+ ur->ogmptr = port + 0x17;
+ ur->icmcmd = port + 0x1b;
+ ur->icmptr = port + 0x1c;
+
+ ub->ldip = U24_LDIP;
+ ub->adrst = U24_ADRST;
+ ub->sbrst = U24_SBRST;
+ ub->asrst = U24_ASRST;
+ ub->abort = U24_ABORT;
+ ub->ogmint = U24_OGMINT;
+ ub->sintp = U24_SINTP;
+ ub->abort_succ = U24_ABORT_SUCC;
+ ub->abort_fail = U24_ABORT_FAIL;
+ ub->abort_ack = U24_ABORT_ACK;
+ ub->icm_ack = U24_ICM_ACK;
+
+ /*
+ * Make sure an EISA card is installed in this slot,
+ * and if it is make sure that the card is enabled.
+ */
+ outb(ur->id, 0xff);
+ p0 = inb(ur->id);
+ if ((p0 == 0xff) ||
+ ((p0 & 0x80) != 0) ||
+ ((inb(ur->ectl) & EISA_DISABLE) == 0)) {
+ uha_slot++;
+ continue;
+ }
+
+ /* Found an enabled card. Grab the product ID. */
+ p1 = inb(ur->id+1);
+ p2 = inb(ur->type);
+ p3 = inb(ur->type+1);
+ id[0] = 0x40 + ((p0 >> 2) & 0x1f);
+ id[1] = 0x40 + (((p0 & 0x03) << 3) | ((p1 >> 5) & 0x07));
+ id[2] = 0x40 + (p1 & 0x1f);
+ id[3] = hex2ascii((p2 >> 4) & 0x0f);
+ id[4] = hex2ascii(p2 & 0x0f);
+ id[5] = hex2ascii((p3 >> 4) & 0x0f);
+ id[6] = '\0';
+ rev = p3 & 0xf;
+
+ /* We only want the 24F product ID. */
+ if (!strcmp(id, "USC024")) break;
+ uha_slot++;
+ }
+ if (uha_slot == EISA_MAX_SLOTS) return(ENODEV);
+
+ /* We have the card! Grab remaining config. */
+ p5 = inb(ur->config);
+ p7 = inb(ur->config+2);
+
+ switch (p5 & 0xf0) {
+ case 0x10: irq = 15; break;
+ case 0x20: irq = 14; break;
+ case 0x40: irq = 11; break;
+ case 0x80: irq = 10; break;
+ default:
+ printf("uha%d: bad 24F irq\n", uha->unit);
+ return(ENXIO);
+ }
+
+ haid = (p7 & 0x07);
+ printf("uha%d: UltraStor 24F int=%d id=%d\n", uha->unit, irq, haid);
+
+ /* Issue SCSI and adapter reset */
+ outb(ur->lint, ub->asrst);
+ while (--resetcount) {
+ if (inb(ur->lint))
+ break;
+ DELAY(1000); /* 1 mSec per loop */
+ }
+ if (resetcount == 0) {
+ printf("uha%d: board timed out during reset\n", uha->unit);
+ return (ENXIO);
+ }
+ outb(ur->smask, 0xc2); /* make sure interrupts are enabled */
+ uha->flags |= (UHA_INIT | UHA_24F);
+ uha->baseport = port;
+ uha->our_id = haid;
+ uha->vect = irq;
+ uha->dma = -1;
+ return(0);
+}
+
+#ifndef min
+#define min(x,y) (x < y ? x : y)
+#endif /* min */
+
+void
+uhaminphys(bp)
+ struct buf *bp;
+{
+ if (bp->b_bcount > ((UHA_NSEG - 1) * PAGESIZ)) {
+ bp->b_bcount = ((UHA_NSEG - 1) * PAGESIZ);
+ }
+}
+
+/*
+ * start a scsi operation given the command and the data address. Also
+ * needs the unit, target and lu.
+ */
+static int32_t
+uha_scsi_cmd(xs)
+ struct scsi_xfer *xs;
+{
+ struct mscp *mscp;
+ struct uha_dma_seg *sg;
+ int seg; /* scatter gather seg being worked on */
+ int thiskv;
+ unsigned long int thisphys, nextphys;
+ int bytes_this_seg, bytes_this_page, datalen, flags;
+ struct uha_data *uha;
+ int s;
+ unsigned long int templen;
+
+ uha = (struct uha_data *)xs->sc_link->adapter_softc;
+ SC_DEBUG(xs->sc_link, SDEV_DB2, ("uha_scsi_cmd\n"));
+ /*
+ * get a mscp (mbox-out) to use. If the transfer
+ * is from a buf (possibly from interrupt time)
+ * then we can't allow it to sleep
+ */
+ flags = xs->flags;
+ if (xs->bp)
+ flags |= (SCSI_NOSLEEP); /* just to be sure */
+ if (flags & ITSDONE) {
+ printf("uha%d: Already done?", uha->unit);
+ xs->flags &= ~ITSDONE;
+ }
+ if (!(flags & INUSE)) {
+ printf("uha%d: Not in use?", uha->unit);
+ xs->flags |= INUSE;
+ }
+ if (!(mscp = uha_get_mscp(uha, flags))) {
+ xs->error = XS_DRIVER_STUFFUP;
+ return (TRY_AGAIN_LATER);
+ }
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("start mscp(%p)\n", mscp));
+ mscp->xs = xs;
+
+ /*
+ * Put all the arguments for the xfer in the mscp
+ */
+ if (flags & SCSI_RESET) {
+ mscp->opcode = 0x04;
+ mscp->ca = 0x01;
+ } else {
+ mscp->opcode = 0x02;
+ mscp->ca = 0x01;
+ }
+ if (flags & SCSI_DATA_IN) {
+ mscp->xdir = 0x01;
+ }
+ if (flags & SCSI_DATA_OUT) {
+ mscp->xdir = 0x02;
+ }
+#ifdef GOTTABEJOKING
+ if (xs->sc_link->lun != 0) {
+ xs->error = XS_DRIVER_STUFFUP;
+ uha_free_mscp(uha, mscp, flags);
+ return (HAD_ERROR);
+ }
+#endif
+ mscp->dcn = 0x00;
+ mscp->chan = 0x00;
+ mscp->target = xs->sc_link->target;
+ mscp->lun = xs->sc_link->lun;
+ mscp->link.addr[0] = 0x00;
+ mscp->link.addr[1] = 0x00;
+ mscp->link.addr[2] = 0x00;
+ mscp->link.addr[3] = 0x00;
+ mscp->link_id = 0x00;
+ mscp->cdblen = xs->cmdlen;
+ scratch = KVTOPHYS(&(mscp->mscp_sense));
+ mscp->sense.addr[0] = (scratch & 0xff);
+ mscp->sense.addr[1] = ((scratch >> 8) & 0xff);
+ mscp->sense.addr[2] = ((scratch >> 16) & 0xff);
+ mscp->sense.addr[3] = ((scratch >> 24) & 0xff);
+ mscp->senselen = sizeof(mscp->mscp_sense);
+ mscp->ha_status = 0x00;
+ mscp->targ_status = 0x00;
+
+ if (xs->datalen) { /* should use S/G only if not zero length */
+ scratch = KVTOPHYS(mscp->uha_dma);
+ mscp->data.addr[0] = (scratch & 0xff);
+ mscp->data.addr[1] = ((scratch >> 8) & 0xff);
+ mscp->data.addr[2] = ((scratch >> 16) & 0xff);
+ mscp->data.addr[3] = ((scratch >> 24) & 0xff);
+ sg = mscp->uha_dma;
+ seg = 0;
+ mscp->sgth = 0x01;
+
+#ifdef TFS
+ if (flags & SCSI_DATA_UIO) {
+ iovp = ((struct uio *) xs->data)->uio_iov;
+ datalen = ((struct uio *) xs->data)->uio_iovcnt;
+ xs->datalen = 0;
+ while ((datalen) && (seg < UHA_NSEG)) {
+ scratch = (unsigned long) iovp->iov_base;
+ sg->addr.addr[0] = (scratch & 0xff);
+ sg->addr.addr[1] = ((scratch >> 8) & 0xff);
+ sg->addr.addr[2] = ((scratch >> 16) & 0xff);
+ sg->addr.addr[3] = ((scratch >> 24) & 0xff);
+ xs->datalen += *(unsigned long *) sg->len.len = iovp->iov_len;
+ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("(0x%x@0x%x)",
+ iovp->iov_len,
+ iovp->iov_base));
+ sg++;
+ iovp++;
+ seg++;
+ datalen--;
+ }
+ } else
+#endif /*TFS */
+ {
+ /*
+ * Set up the scatter gather block
+ */
+
+ SC_DEBUG(xs->sc_link, SDEV_DB4,
+ ("%ld @%p:- ", xs->datalen, xs->data));
+ datalen = xs->datalen;
+ thiskv = (int) xs->data;
+ thisphys = KVTOPHYS(thiskv);
+ templen = 0;
+
+ while ((datalen) && (seg < UHA_NSEG)) {
+ bytes_this_seg = 0;
+
+ /* put in the base address */
+ sg->addr.addr[0] = (thisphys & 0xff);
+ sg->addr.addr[1] = ((thisphys >> 8) & 0xff);
+ sg->addr.addr[2] = ((thisphys >> 16) & 0xff);
+ sg->addr.addr[3] = ((thisphys >> 24) & 0xff);
+
+ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("0x%lx",
+ thisphys));
+
+ /* do it at least once */
+ nextphys = thisphys;
+ while ((datalen) && (thisphys == nextphys))
+ /*
+ * This page is contiguous (physically) with
+ * the the last, just extend the length
+ */
+ {
+ /* how far to the end of the page */
+ nextphys = (thisphys & (~(PAGESIZ - 1)))
+ + PAGESIZ;
+ bytes_this_page = nextphys - thisphys;
+ /**** or the data ****/
+ bytes_this_page = min(bytes_this_page
+ ,datalen);
+ bytes_this_seg += bytes_this_page;
+ datalen -= bytes_this_page;
+
+ /* get more ready for the next page */
+ thiskv = (thiskv & (~(PAGESIZ - 1)))
+ + PAGESIZ;
+ if (datalen)
+ thisphys = KVTOPHYS(thiskv);
+ }
+ /*
+ * next page isn't contiguous, finish the seg
+ */
+ SC_DEBUGN(xs->sc_link, SDEV_DB4,
+ ("(0x%x)", bytes_this_seg));
+ sg->len.len[0] = (bytes_this_seg & 0xff);
+ sg->len.len[1] = ((bytes_this_seg >> 8) & 0xff);
+ sg->len.len[2] = ((bytes_this_seg >> 16) & 0xff);
+ sg->len.len[3] = ((bytes_this_seg >> 24) & 0xff);
+ templen += bytes_this_seg;
+ sg++;
+ seg++;
+ }
+ }
+
+ /* end of iov/kv decision */
+ mscp->datalen.len[0] = (templen & 0xff);
+ mscp->datalen.len[1] = ((templen >> 8) & 0xff);
+ mscp->datalen.len[2] = ((templen >> 16) & 0xff);
+ mscp->datalen.len[3] = ((templen >> 24) & 0xff);
+ mscp->sg_num = seg;
+
+ SC_DEBUGN(xs->sc_link, SDEV_DB4, ("\n"));
+ if (datalen) { /* there's still data, must have run out of segs! */
+ printf("uha%d: uha_scsi_cmd, more than %d DMA segs\n",
+ uha->unit, UHA_NSEG);
+ xs->error = XS_DRIVER_STUFFUP;
+ uha_free_mscp(uha, mscp, flags);
+ return (HAD_ERROR);
+ }
+ } else { /* No data xfer, use non S/G values */
+ mscp->data.addr[0] = 0x00;
+ mscp->data.addr[1] = 0x00;
+ mscp->data.addr[2] = 0x00;
+ mscp->data.addr[3] = 0x00;
+ mscp->datalen.len[0] = 0x00;
+ mscp->datalen.len[1] = 0x00;
+ mscp->datalen.len[2] = 0x00;
+ mscp->datalen.len[3] = 0x00;
+ mscp->xdir = 0x03;
+ mscp->sgth = 0x00;
+ mscp->sg_num = 0x00;
+ }
+
+ /*
+ * Put the scsi command in the mscp and start it
+ */
+ bcopy(xs->cmd, mscp->cdb, xs->cmdlen);
+
+ /*
+ * Usually return SUCCESSFULLY QUEUED
+ */
+ if (!(flags & SCSI_NOMASK)) {
+ s = splbio();
+ uha_send_mbox(uha, mscp);
+ xs->timeout_ch = timeout(uha_timeout, (caddr_t)mscp,
+ (xs->timeout * hz) / 1000);
+ splx(s);
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n"));
+ return (SUCCESSFULLY_QUEUED);
+ }
+
+ /*
+ * If we can't use interrupts, poll on completion
+ */
+ uha_send_mbox(uha, mscp);
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_wait\n"));
+ do {
+ if (uha_poll(uha, xs->timeout)) {
+ if (!(xs->flags & SCSI_SILENT))
+ printf("uha%d: cmd fail\n", uha->unit);
+ if (!(uha_abort(uha, mscp))) {
+ printf("uha%d: abort failed in wait\n",
+ uha->unit);
+ uha_free_mscp(uha, mscp, flags);
+ }
+ xs->error = XS_DRIVER_STUFFUP;
+ return (HAD_ERROR);
+ }
+ }
+ while (!(xs->flags & ITSDONE)); /* something (?) else finished */
+ if (xs->error) {
+ return (HAD_ERROR);
+ }
+ return (COMPLETE);
+}
+
+static void
+uha_timeout(arg1)
+ void *arg1;
+{
+ struct mscp *mscp = (struct mscp *)arg1;
+ struct uha_data *uha;
+ int s = splbio();
+
+ uha = (struct uha_data *)mscp->xs->sc_link->adapter_softc;
+ printf("uha%d:%d:%d (%s%d) timed out ", uha->unit
+ ,mscp->xs->sc_link->target
+ ,mscp->xs->sc_link->lun
+ ,mscp->xs->sc_link->device->name
+ ,mscp->xs->sc_link->dev_unit);
+
+#ifdef UHADEBUG
+ uha_print_active_mscp(uha);
+#endif /*UHADEBUG */
+
+ if ((uha_abort(uha, mscp) != 1) || (mscp->flags = MSCP_ABORTED)) {
+ printf("AGAIN");
+ mscp->xs->retries = 0; /* I MEAN IT ! */
+ uha_done(uha, mscp);
+ } else { /* abort the operation that has timed out */
+ printf("\n");
+ mscp->xs->timeout_ch = timeout(uha_timeout, (caddr_t)mscp,
+ 2 * hz);
+ mscp->flags = MSCP_ABORTED;
+ }
+ splx(s);
+}
+
+#ifdef UHADEBUG
+void
+uha_print_mscp(mscp)
+ struct mscp *mscp;
+{
+ printf("mscp:%x op:%x cmdlen:%d senlen:%d\n"
+ ,mscp
+ ,mscp->opcode
+ ,mscp->cdblen
+ ,mscp->senselen);
+ printf(" sg:%d sgnum:%x datlen:%d hstat:%x tstat:%x flags:%x\n"
+ ,mscp->sgth
+ ,mscp->sg_num
+ ,mscp->datalen
+ ,mscp->ha_status
+ ,mscp->targ_status
+ ,mscp->flags);
+ show_scsi_cmd(mscp->xs);
+}
+
+void
+uha_print_active_mscp(struct uha_data *uha)
+{
+ struct mscp *mscp;
+ int i = 0;
+
+ while (i < MSCP_HASH_SIZE) {
+ mscp = uha->mscphash[i];
+ while (mscp) {
+ if (mscp->flags != MSCP_FREE) {
+ uha_print_mscp(mscp);
+ }
+ mscp = mscp->nexthash;
+ }
+ i++;
+ }
+}
+#endif /*UHADEBUG */
+#endif /*KERNEL */
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c
index a338fb59c2cfc..cfd1075bf04ef 100644
--- a/sys/i386/isa/vesa.c
+++ b/sys/i386/isa/vesa.c
@@ -23,25 +23,18 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: vesa.c,v 1.14 1999/01/16 12:56:00 yokota Exp $
+ * $Id: vesa.c,v 1.7 1998/10/01 11:39:18 yokota Exp $
*/
-#include "vga.h"
-#include "opt_vga.h"
+#include "sc.h"
#include "opt_vesa.h"
#include "opt_vm86.h"
-#include "opt_fb.h"
-#ifdef VGA_NO_MODE_CHANGE
-#undef VESA
-#endif
-
-#if (NVGA > 0 && defined(VESA) && defined(VM86)) || defined(KLD_MODULE)
+#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE)
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/module.h>
#include <sys/malloc.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -52,17 +45,14 @@
#include <machine/pc/bios.h>
#include <machine/pc/vesa.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/vgareg.h>
+#include <i386/isa/videoio.h>
-#ifndef __i386__
-#include <isa/isareg.h>
-#else
-#include <i386/isa/isa.h>
-#endif
+#ifdef VESA_MODULE
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
-#ifndef VESA_DEBUG
-#define VESA_DEBUG 0
+MOD_MISC(vesa);
#endif
/* VESA video adapter state buffer stub */
@@ -76,14 +66,11 @@ typedef struct adp_state adp_state_t;
/* VESA video adapter */
static video_adapter_t *vesa_adp = NULL;
static int vesa_state_buf_size = 0;
-#if 0
static void *vesa_state_buf = NULL;
-#endif
/* VESA functions */
-static int vesa_nop(void);
-static vi_probe_t vesa_probe;
static vi_init_t vesa_init;
+static vi_adapter_t vesa_adapter;
static vi_get_info_t vesa_get_info;
static vi_query_mode_t vesa_query_mode;
static vi_set_mode_t vesa_set_mode;
@@ -98,34 +85,17 @@ static vi_load_state_t vesa_load_state;
static vi_set_win_org_t vesa_set_origin;
static vi_read_hw_cursor_t vesa_read_hw_cursor;
static vi_set_hw_cursor_t vesa_set_hw_cursor;
-static vi_set_hw_cursor_shape_t vesa_set_hw_cursor_shape;
-static vi_mmap_t vesa_mmap;
static vi_diag_t vesa_diag;
-static video_switch_t vesavidsw = {
- vesa_probe,
- vesa_init,
- vesa_get_info,
- vesa_query_mode,
- vesa_set_mode,
- vesa_save_font,
- vesa_load_font,
- vesa_show_font,
- vesa_save_palette,
- vesa_load_palette,
- vesa_set_border,
- vesa_save_state,
- vesa_load_state,
- vesa_set_origin,
- vesa_read_hw_cursor,
- vesa_set_hw_cursor,
- vesa_set_hw_cursor_shape,
- (vi_blank_display_t *)vesa_nop,
- vesa_mmap,
+static struct vidsw vesavidsw = {
+ vesa_init, vesa_adapter, vesa_get_info, vesa_query_mode,
+ vesa_set_mode, vesa_save_font, vesa_load_font, vesa_show_font,
+ vesa_save_palette,vesa_load_palette,vesa_set_border,vesa_save_state,
+ vesa_load_state,vesa_set_origin,vesa_read_hw_cursor,vesa_set_hw_cursor,
vesa_diag,
};
-static video_switch_t *prevvidsw;
+static struct vidsw prevvidsw;
/* VESA BIOS video modes */
#define VESA_MAXMODES 64
@@ -148,14 +118,11 @@ static char *vesa_revstr = NULL;
/* local macros and functions */
#define BIOS_SADDRTOLADDR(p) ((((p) & 0xffff0000) >> 12) + ((p) & 0x0000ffff))
-static int int10_set_mode(int mode);
static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode);
static int vesa_bios_set_mode(int mode);
static int vesa_bios_set_dac(int bits);
-static int vesa_bios_save_palette(int start, int colors, u_char *palette,
- int bits);
-static int vesa_bios_load_palette(int start, int colors, u_char *palette,
- int bits);
+static int vesa_bios_save_palette(int start, int colors, u_char *palette);
+static int vesa_bios_load_palette(int start, int colors, u_char *palette);
#define STATE_SIZE 0
#define STATE_SAVE 1
#define STATE_LOAD 2
@@ -186,18 +153,6 @@ dump_buffer(u_char *buf, size_t len)
}
}
-/* INT 10 BIOS calls */
-static int
-int10_set_mode(int mode)
-{
- struct vm86frame vmf;
-
- bzero(&vmf, sizeof(vmf));
- vmf.vmf_eax = 0x0000 | mode;
- vm86_intcall(0x10, &vmf);
- return 0;
-}
-
/* VESA BIOS calls */
static int
vesa_bios_get_mode(int mode, struct vesa_mode *vmode)
@@ -241,13 +196,11 @@ vesa_bios_set_dac(int bits)
vmf.vmf_eax = 0x4f08;
vmf.vmf_ebx = (bits << 8);
err = vm86_intcall(0x10, &vmf);
- if ((err != 0) || (vmf.vmf_eax != 0x4f))
- return 6; /* XXX */
- return ((vmf.vmf_ebx >> 8) & 0x00ff);
+ return ((err != 0) || (vmf.vmf_eax != 0x4f));
}
static int
-vesa_bios_save_palette(int start, int colors, u_char *palette, int bits)
+vesa_bios_save_palette(int start, int colors, u_char *palette)
{
struct vm86frame vmf;
u_char *p;
@@ -267,18 +220,17 @@ vesa_bios_save_palette(int start, int colors, u_char *palette, int bits)
return 1;
}
- bits = 8 - bits;
for (i = 0; i < colors; ++i) {
- palette[i*3] = p[i*4 + 2] << bits;
- palette[i*3 + 1] = p[i*4 + 1] << bits;
- palette[i*3 + 2] = p[i*4] << bits;
+ palette[i*3] = p[i*4 + 1];
+ palette[i*3 + 1] = p[i*4 + 2];
+ palette[i*3 + 2] = p[i*4 + 3];
}
free(p, M_DEVBUF);
return 0;
}
static int
-vesa_bios_load_palette(int start, int colors, u_char *palette, int bits)
+vesa_bios_load_palette(int start, int colors, u_char *palette)
{
struct vm86frame vmf;
u_char *p;
@@ -286,12 +238,11 @@ vesa_bios_load_palette(int start, int colors, u_char *palette, int bits)
int i;
p = malloc(colors*4, M_DEVBUF, M_WAITOK);
- bits = 8 - bits;
for (i = 0; i < colors; ++i) {
- p[i*4] = palette[i*3 + 2] >> bits;
- p[i*4 + 1] = palette[i*3 + 1] >> bits;
- p[i*4 + 2] = palette[i*3] >> bits;
- p[i*4 + 3] = 0;
+ p[i*4] = 0;
+ p[i*4 + 1] = palette[i*3];
+ p[i*4 + 2] = palette[i*3 + 1];
+ p[i*4 + 3] = palette[i*3 + 2];
}
bzero(&vmf, sizeof(vmf));
@@ -367,7 +318,7 @@ vesa_translate_flags(u_int16_t vflags)
} ftable[] = {
{ V_MODECOLOR, V_INFO_COLOR, 0 },
{ V_MODEGRAPHICS, V_INFO_GRAPHICS, 0 },
- { V_MODELFB, V_INFO_LINEAR, 0 },
+ { V_MODELFB, V_INFO_LENEAR, 0 },
};
int flags;
int i;
@@ -398,6 +349,7 @@ vesa_bios_init(void)
static u_char buf[512];
struct vm86frame vmf;
struct vesa_mode vmode;
+ u_int32_t p;
int modes;
int err;
int i;
@@ -418,10 +370,8 @@ vesa_bios_init(void)
if ((err != 0) || (vmf.vmf_eax != 0x4f) || bcmp("VESA", buf, 4))
return 1;
vesa_adp_info = (struct vesa_info *)buf;
- if (bootverbose) {
- printf("VESA: information block\n");
+ if (bootverbose)
dump_buffer(buf, 64);
- }
if (vesa_adp_info->v_flags & V_NONVGA)
return 1;
@@ -504,101 +454,42 @@ vesa_clear_modes(video_info_t *info, int color)
}
}
-/* entry points */
+/* exported functions */
static int
-vesa_configure(int flags)
+vesa_init(void)
{
- video_adapter_t *adp;
int adapters;
- int error;
int i;
- if (vesa_init_done)
- return 0;
- if (flags & VIO_PROBE_ONLY)
- return 0; /* XXX */
-
- /*
- * If the VESA module has already been loaded, abort loading
- * the module this time.
- */
- for (i = 0; (adp = vid_get_adapter(i)) != NULL; ++i) {
- if (adp->va_flags & V_ADP_VESA)
- return ENXIO;
- if (adp->va_type == KD_VGA)
- break;
- }
- /*
- * The VGA adapter is not found. This is because either
- * 1) the VGA driver has not been initialized, or 2) the VGA card
- * is not present. If 1) is the case, we shall defer
- * initialization for now and try again later.
- */
- if (adp == NULL) {
- vga_sub_configure = vesa_configure;
- return ENODEV;
- }
-
- /* count number of registered adapters */
- for (++i; vid_get_adapter(i) != NULL; ++i)
- ;
- adapters = i;
-
- /* call VESA BIOS */
- vesa_adp = adp;
- if (vesa_bios_init()) {
- vesa_adp = NULL;
- return ENXIO;
- }
- vesa_adp->va_flags |= V_ADP_VESA;
-
- /* remove conflicting modes if we have more than one adapter */
- if (adapters > 1) {
- vesa_clear_modes(vesa_vmode,
- (vesa_adp->va_flags & V_ADP_COLOR) ?
- V_INFO_COLOR : 0);
- }
-
- if ((error = vesa_load_ioctl()) == 0) {
- prevvidsw = vidsw[vesa_adp->va_index];
- vidsw[vesa_adp->va_index] = &vesavidsw;
- vesa_init_done = TRUE;
- } else {
- vesa_adp = NULL;
- return error;
+ adapters = (*prevvidsw.init)();
+ for (i = 0; i < adapters; ++i) {
+ if ((vesa_adp = (*prevvidsw.adapter)(i)) == NULL)
+ continue;
+ if (vesa_adp->va_type == KD_VGA) {
+ vesa_adp->va_flags |= V_ADP_VESA;
+ return adapters;
+ }
}
-
- return 0;
-}
-
-static int
-vesa_nop(void)
-{
- return 0;
-}
-
-static int
-vesa_probe(int unit, video_adapter_t **adpp, void *arg, int flags)
-{
- return (*prevvidsw->probe)(unit, adpp, arg, flags);
+ vesa_adp = NULL;
+ return adapters;
}
-static int
-vesa_init(int unit, video_adapter_t *adp, int flags)
+static video_adapter_t
+*vesa_adapter(int ad)
{
- return (*prevvidsw->init)(unit, adp, flags);
+ return (*prevvidsw.adapter)(ad);
}
static int
-vesa_get_info(video_adapter_t *adp, int mode, video_info_t *info)
+vesa_get_info(int ad, int mode, video_info_t *info)
{
int i;
- if ((*prevvidsw->get_info)(adp, mode, info) == 0)
+ if ((*prevvidsw.get_info)(ad, mode, info) == 0)
return 0;
- if (adp != vesa_adp)
+ if (ad != vesa_adp->va_index)
return 1;
mode = vesa_map_gen_mode_num(vesa_adp->va_type,
@@ -615,13 +506,13 @@ vesa_get_info(video_adapter_t *adp, int mode, video_info_t *info)
}
static int
-vesa_query_mode(video_adapter_t *adp, video_info_t *info)
+vesa_query_mode(int ad, video_info_t *info)
{
int i;
- if ((i = (*prevvidsw->query_mode)(adp, info)) != -1)
+ if ((i = (*prevvidsw.query_mode)(ad, info)) != -1)
return i;
- if (adp != vesa_adp)
+ if (ad != vesa_adp->va_index)
return -1;
for (i = 0; vesa_vmode[i].vi_mode != EOT; ++i) {
@@ -653,19 +544,17 @@ vesa_query_mode(video_adapter_t *adp, video_info_t *info)
}
static int
-vesa_set_mode(video_adapter_t *adp, int mode)
+vesa_set_mode(int ad, int mode)
{
video_info_t info;
-#if 0
size_t len;
-#endif
- if (adp != vesa_adp)
- return (*prevvidsw->set_mode)(adp, mode);
+ if (ad != vesa_adp->va_index)
+ return (*prevvidsw.set_mode)(ad, mode);
mode = vesa_map_gen_mode_num(vesa_adp->va_type,
vesa_adp->va_flags & V_ADP_COLOR, mode);
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: set_mode(): %d(%x) -> %d(%x)\n",
vesa_adp->va_mode, vesa_adp->va_mode, mode, mode);
#endif
@@ -673,40 +562,37 @@ vesa_set_mode(video_adapter_t *adp, int mode)
* If the current mode is a VESA mode and the new mode is not,
* restore the state of the adapter first, so that non-standard,
* extended SVGA registers are set to the state compatible with
- * the standard VGA modes. Otherwise (*prevvidsw->set_mode)()
+ * the standard VGA modes. Otherwise (*prevvidsw.set_mode)()
* may not be able to set up the new mode correctly.
*/
if (VESA_MODE(vesa_adp->va_mode)) {
- if ((*prevvidsw->get_info)(adp, mode, &info) == 0) {
- int10_set_mode(vesa_adp->va_initial_bios_mode);
-#if 0
+ if ((*prevvidsw.get_info)(ad, mode, &info) == 0) {
/* assert(vesa_state_buf != NULL); */
if ((vesa_state_buf == NULL)
- || vesa_load_state(adp, vesa_state_buf))
+ || vesa_load_state(ad, vesa_state_buf))
return 1;
free(vesa_state_buf, M_DEVBUF);
vesa_state_buf = NULL;
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: restored\n");
#endif
-#endif /* 0 */
}
/*
- * once (*prevvidsw->get_info)() succeeded,
- * (*prevvidsw->set_mode)() below won't fail...
+ * once (*prevvidsw.get_info)() succeeded,
+ * (*prevvidsw.set_mode)() below won't fail...
*/
}
/* we may not need to handle this mode after all... */
- if ((*prevvidsw->set_mode)(adp, mode) == 0)
+ if ((*prevvidsw.set_mode)(ad, mode) == 0)
return 0;
/* is the new mode supported? */
- if (vesa_get_info(adp, mode, &info))
+ if (vesa_get_info(ad, mode, &info))
return 1;
/* assert(VESA_MODE(mode)); */
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: about to set a VESA mode...\n");
#endif
/*
@@ -714,38 +600,35 @@ vesa_set_mode(video_adapter_t *adp, int mode)
* so that the adapter state can be restored later when a non-VESA
* mode is to be set up. See above.
*/
-#if 0
if (!VESA_MODE(vesa_adp->va_mode) && (vesa_state_buf == NULL)) {
- len = vesa_save_state(adp, NULL, 0);
+ len = vesa_save_state(ad, NULL, 0);
vesa_state_buf = malloc(len, M_DEVBUF, M_WAITOK);
- if (vesa_save_state(adp, vesa_state_buf, len)) {
-#if VESA_DEBUG > 0
+ if (vesa_save_state(ad, vesa_state_buf, len)) {
+#ifdef SC_VIDEO_DEBUG
printf("VESA: state save failed! (len=%d)\n", len);
#endif
free(vesa_state_buf, M_DEVBUF);
vesa_state_buf = NULL;
return 1;
}
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: saved (len=%d)\n", len);
dump_buffer(vesa_state_buf, len);
#endif
}
-#endif /* 0 */
if (vesa_bios_set_mode(mode))
return 1;
-#if VESA_DEBUG > 0
+#ifdef SC_VIDEO_DEBUG
printf("VESA: mode set!\n");
#endif
vesa_adp->va_mode = mode;
- vesa_adp->va_mode_flags = info.vi_flags;
vesa_adp->va_flags &= ~V_ADP_COLOR;
vesa_adp->va_flags |=
(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
vesa_adp->va_crtc_addr =
- (vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
+ (vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_BASE : MONO_BASE;
vesa_adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
vesa_adp->va_window_size = info.vi_window_size;
vesa_adp->va_window_gran = info.vi_window_gran;
@@ -757,77 +640,58 @@ vesa_set_mode(video_adapter_t *adp, int mode)
vesa_adp->va_buffer_size = info.vi_buffer_size;
}
- /* move hardware cursor out of the way */
- (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
-
return 0;
}
static int
-vesa_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vesa_save_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
{
- return (*prevvidsw->save_font)(adp, page, fontsize, data, ch, count);
+ return (*prevvidsw.save_font)(ad, page, fontsize, data, ch, count);
}
static int
-vesa_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vesa_load_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
{
- return (*prevvidsw->load_font)(adp, page, fontsize, data, ch, count);
+ return (*prevvidsw.load_font)(ad, page, fontsize, data, ch, count);
}
static int
-vesa_show_font(video_adapter_t *adp, int page)
+vesa_show_font(int ad, int page)
{
- return (*prevvidsw->show_font)(adp, page);
+ return (*prevvidsw.show_font)(ad, page);
}
static int
-vesa_save_palette(video_adapter_t *adp, u_char *palette)
+vesa_save_palette(int ad, u_char *palette)
{
- int bits;
- int error;
-
- if ((adp == vesa_adp) && (vesa_adp_info->v_flags & V_DAC8)
- && ((bits = vesa_bios_set_dac(8)) > 6)) {
- error = vesa_bios_save_palette(0, 256, palette, bits);
- if (error == 0)
- return 0;
- vesa_bios_set_dac(6);
- }
+ if ((ad != vesa_adp->va_index) || !(vesa_adp_info->v_flags & V_DAC8)
+ || vesa_bios_set_dac(8))
+ return (*prevvidsw.save_palette)(ad, palette);
- return (*prevvidsw->save_palette)(adp, palette);
+ return vesa_bios_save_palette(0, 256, palette);
}
static int
-vesa_load_palette(video_adapter_t *adp, u_char *palette)
+vesa_load_palette(int ad, u_char *palette)
{
- int bits;
- int error;
-
- if ((adp == vesa_adp) && (vesa_adp_info->v_flags & V_DAC8)
- && ((bits = vesa_bios_set_dac(8)) > 6)) {
- error = vesa_bios_load_palette(0, 256, palette, bits);
- if (error == 0)
- return 0;
- vesa_bios_set_dac(6);
- }
+ if ((ad != vesa_adp->va_index) || !(vesa_adp_info->v_flags & V_DAC8)
+ || vesa_bios_set_dac(8))
+ return (*prevvidsw.load_palette)(ad, palette);
- return (*prevvidsw->load_palette)(adp, palette);
+ return vesa_bios_load_palette(0, 256, palette);
}
static int
-vesa_set_border(video_adapter_t *adp, int color)
+vesa_set_border(int ad, int color)
{
- return (*prevvidsw->set_border)(adp, color);
+ return (*prevvidsw.set_border)(ad, color);
}
static int
-vesa_save_state(video_adapter_t *adp, void *p, size_t size)
+vesa_save_state(int ad, void *p, size_t size)
{
- if (adp != vesa_adp)
- return (*prevvidsw->save_state)(adp, p, size);
+ if (ad != vesa_adp->va_index)
+ return (*prevvidsw.save_state)(ad, p, size);
if (vesa_state_buf_size == 0)
vesa_state_buf_size = vesa_bios_state_buf_size();
@@ -843,17 +707,18 @@ vesa_save_state(video_adapter_t *adp, void *p, size_t size)
}
static int
-vesa_load_state(video_adapter_t *adp, void *p)
+vesa_load_state(int ad, void *p)
{
- if ((adp != vesa_adp) || (((adp_state_t *)p)->sig != V_STATE_SIG))
- return (*prevvidsw->load_state)(adp, p);
+ if ((ad != vesa_adp->va_index)
+ || (((adp_state_t *)p)->sig != V_STATE_SIG))
+ return (*prevvidsw.load_state)(ad, p);
return vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs,
vesa_state_buf_size);
}
static int
-vesa_set_origin(video_adapter_t *adp, off_t offset)
+vesa_set_origin(int ad, off_t offset)
{
struct vm86frame vmf;
int err;
@@ -864,8 +729,8 @@ vesa_set_origin(video_adapter_t *adp, off_t offset)
* error checking is kept minimal and let the VESA BIOS to
* detect error.
*/
- if (adp != vesa_adp)
- return (*prevvidsw->set_win_org)(adp, offset);
+ if (ad != vesa_adp->va_index)
+ return (*prevvidsw.set_win_org)(ad, offset);
if (vesa_adp->va_window_gran == 0)
return 1;
@@ -878,45 +743,27 @@ vesa_set_origin(video_adapter_t *adp, off_t offset)
}
static int
-vesa_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
+vesa_read_hw_cursor(int ad, int *col, int *row)
{
- return (*prevvidsw->read_hw_cursor)(adp, col, row);
+ return (*prevvidsw.read_hw_cursor)(ad, col, row);
}
static int
-vesa_set_hw_cursor(video_adapter_t *adp, int col, int row)
+vesa_set_hw_cursor(int ad, int col, int row)
{
- return (*prevvidsw->set_hw_cursor)(adp, col, row);
+ return (*prevvidsw.set_hw_cursor)(ad, col, row);
}
static int
-vesa_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
- int celsize, int blink)
+vesa_diag(int level)
{
- return (*prevvidsw->set_hw_cursor_shape)(adp, base, height, celsize,
- blink);
-}
-
-static int
-vesa_mmap(video_adapter_t *adp, vm_offset_t offset)
-{
- return (*prevvidsw->mmap)(adp, offset);
-}
-
-static int
-vesa_diag(video_adapter_t *adp, int level)
-{
-#if VESA_DEBUG > 1
struct vesa_mode vmode;
+ u_int32_t p;
int i;
-#endif
-
- if (adp != vesa_adp)
- return 1;
-#ifndef KLD_MODULE
+#ifndef VESA_MODULE
/* call the previous handler first */
- (*prevvidsw->diag)(adp, level);
+ (*prevvidsw.diag)(level);
#endif
/* general adapter information */
@@ -946,7 +793,6 @@ vesa_diag(video_adapter_t *adp, int level)
printf("VESA: %s\n", vesa_revstr);
}
-#if VESA_DEBUG > 1
/* mode information */
for (i = 0;
(i < (M_VESA_MODE_MAX - M_VESA_BASE + 1))
@@ -981,40 +827,79 @@ vesa_diag(video_adapter_t *adp, int level)
printf("size:%dk, gran:%dk\n",
vmode.v_wsize, vmode.v_wgran);
}
-#endif
return 0;
}
/* module loading */
+#ifdef VESA_MODULE
static int
+vesa_load(struct lkm_table *lkmtp, int cmd)
+#else
+int
vesa_load(void)
+#endif
{
+ int adapters;
int error;
int s;
+ int i;
if (vesa_init_done)
return 0;
- /* locate a VGA adapter */
- s = spltty();
+ /*
+ * If the VESA module is statically linked to the kernel, or
+ * it has already been loaded, abort loading this module this time.
+ */
vesa_adp = NULL;
- error = vesa_configure(0);
+ adapters = (*biosvidsw.init)();
+ for (i = 0; i < adapters; ++i) {
+ if ((vesa_adp = (*biosvidsw.adapter)(i)) == NULL)
+ continue;
+ if (vesa_adp->va_flags & V_ADP_VESA)
+ return ENXIO;
+ if (vesa_adp->va_type == KD_VGA)
+ break;
+ }
+ /* if a VGA adapter is not found, abort */
+ if (i >= adapters)
+ return ENXIO;
+
+ if (vesa_bios_init())
+ return ENXIO;
+ vesa_adp->va_flags |= V_ADP_VESA;
+
+ /* remove conflicting modes if we have more than one adapter */
+ if (adapters > 1) {
+ vesa_clear_modes(vesa_vmode,
+ (vesa_adp->va_flags & V_ADP_COLOR) ?
+ V_INFO_COLOR : 0);
+ }
+
+#ifdef VESA_MODULE
+ s = spltty();
+#endif
+ if ((error = vesa_load_ioctl()) == 0) {
+ bcopy(&biosvidsw, &prevvidsw, sizeof(prevvidsw));
+ bcopy(&vesavidsw, &biosvidsw, sizeof(vesavidsw));
+ vesa_init_done = TRUE;
+ }
+#ifdef VESA_MODULE
splx(s);
-#ifdef KLD_MODULE
if (error == 0)
- vesa_diag(vesa_adp, bootverbose);
+ vesa_diag(bootverbose);
#endif
return error;
}
-#ifdef KLD_MODULE
+#ifdef VESA_MODULE
static int
-vesa_unload(void)
+vesa_unload(struct lkm_table *lkmtp, int cmd)
{
int error;
int s;
@@ -1029,42 +914,22 @@ vesa_unload(void)
s = spltty();
if ((error = vesa_unload_ioctl()) == 0) {
- if (vesa_adp != NULL)
+ if (vesa_adp)
vesa_adp->va_flags &= ~V_ADP_VESA;
- vidsw[vesa_adp->va_index] = prevvidsw;
+ bcopy(&prevvidsw, &biosvidsw, sizeof(biosvidsw));
}
splx(s);
return error;
}
-static int
-vesa_mod_event(module_t mod, int type, void *data)
+int
+vesa_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
- switch (type) {
- case MOD_LOAD:
- return vesa_load();
- case MOD_UNLOAD:
- return vesa_unload();
- default:
- break;
- }
- return 0;
+ MOD_DISPATCH(vesa, lkmtp, cmd, ver,
+ vesa_load, vesa_unload, lkm_nullcmd);
}
-static moduledata_t vesa_mod = {
- "vesa",
- vesa_mod_event,
- NULL,
-};
-
-DECLARE_MODULE(vesa, vesa_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
-
-#else /* KLD_MODULE */
-
-SYSINIT(vesa, SI_SUB_DRIVERS, SI_ORDER_MIDDLE,
- (void (*)(void *))vesa_load, NULL);
-
-#endif /* KLD_MODULE */
+#endif /* VESA_MODULE */
-#endif /* (NVGA > 0 && VESA && VM86) || KLD_MODULE */
+#endif /* (NSC > 0 && VESA && VM86) || VESA_MODULE */
diff --git a/sys/i386/isa/vga_isa.c b/sys/i386/isa/videoio.c
index 0aaab5c0d8a4a..571008051fb5d 100644
--- a/sys/i386/isa/vga_isa.c
+++ b/sys/i386/isa/videoio.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
+ * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
* Copyright (c) 1992-1998 Søren Schmidt
* All rights reserved.
*
@@ -26,252 +26,31 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: $
+ * $Id: videoio.c,v 1.5 1998/09/26 03:38:40 yokota Exp $
*/
-#include "vga.h"
-#include "opt_vga.h"
-#include "opt_fb.h"
-#include "opt_syscons.h" /* should be removed in the future, XXX */
+#include "sc.h"
+#include "opt_syscons.h"
-#if NVGA > 0
+#if NSC > 0
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/bus.h>
-#include <sys/malloc.h>
-
#include <vm/vm.h>
#include <vm/pmap.h>
+#include <machine/clock.h>
#include <machine/console.h>
#include <machine/md_var.h>
#include <machine/pc/bios.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/vgareg.h>
-
-#ifndef __i386__
-#include <isa/isareg.h>
-#include <isa/isavar.h>
-#else
#include <i386/isa/isa.h>
-#include <i386/isa/isa_device.h>
-#endif
-
-#define DRIVER_NAME "vga"
-
-/* cdev driver declaration */
-
-#define ISAVGA_UNIT(dev) minor(dev)
-#define ISAVGA_MKMINOR(unit) (unit)
-
-typedef struct isavga_softc {
- video_adapter_t *adp;
-} isavga_softc_t;
-
-#ifndef __i386__
-
-#define ISAVGA_SOFTC(unit) \
- ((isavga_softc_t *)devclass_get_softc(isavga_devclass, unit))
-
-devclass_t isavga_devclass;
-
-static int isavga_probe(device_t dev);
-static int isavga_attach(device_t dev);
-
-static device_method_t isavga_methods[] = {
- DEVMETHOD(device_probe, isavga_probe),
- DEVMETHOD(device_attach, isavga_attach),
- { 0, 0 }
-};
-
-static driver_t isavga_driver = {
- DRIVER_NAME,
- isavga_methods,
- DRIVER_TYPE_TTY,
- sizeof(isavga_softc_t),
-};
-
-#else /* __i386__ */
-
-#define ISAVGA_SOFTC(unit) (isavga_softc[unit])
-
-static isavga_softc_t *isavga_softc[NVGA];
-
-static int isavga_probe(struct isa_device *dev);
-static int isavga_attach(struct isa_device *dev);
-
-struct isa_driver vgadriver = {
- isavga_probe,
- isavga_attach,
- DRIVER_NAME,
- 0,
-};
-
-#endif /* __i386__ */
-
-static int isavga_probe_unit(int unit, isavga_softc_t *sc,
- int flags);
-static int isavga_attach_unit(int unit, isavga_softc_t *sc,
- int flags);
-
-#ifdef FB_INSTALL_CDEV
-
-static d_open_t isavgaopen;
-static d_close_t isavgaclose;
-static d_read_t isavgaread;
-static d_ioctl_t isavgaioctl;
-
-static struct cdevsw vga_cdevsw = {
- isavgaopen, isavgaclose, noread, nowrite, /* ?? */
- isavgaioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, NULL, DRIVER_NAME,
- NULL, -1, nodump, nopsize,
-};
-
-#endif /* FB_INSTALL_CDEV */
-
-#ifndef __i386__
-
-static int
-isavga_probe(device_t dev)
-{
- isavga_softc_t *sc;
-
- sc = device_get_softc(dev);
- return isavga_probe_unit(device_get_unit(dev), sc, isa_get_flags(dev));
-}
-
-static int
-isavga_attach(device_t dev)
-{
- isavga_softc_t *sc;
-
- sc = device_get_softc(dev);
- return isavga_attach_unit(device_get_unit(dev), sc, isa_get_flags(dev));
-}
-
-#else /* __i386__ */
-
-static int
-isavga_probe(struct isa_device *dev)
-{
- isavga_softc_t *sc;
- int error;
-
- if (dev->id_unit >= sizeof(isavga_softc)/sizeof(isavga_softc[0]))
- return 0;
- sc = isavga_softc[dev->id_unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return 0;
-
- error = isavga_probe_unit(dev->id_unit, sc, dev->id_flags);
- if (error) {
- isavga_softc[dev->id_unit] = NULL;
- free(sc, M_DEVBUF);
- return 0;
- }
-
- dev->id_iobase = sc->adp->va_io_base;
- dev->id_maddr = (caddr_t)BIOS_PADDRTOVADDR(sc->adp->va_mem_base);
- dev->id_msize = sc->adp->va_mem_size;
-
- return sc->adp->va_io_size;
-}
-
-static int
-isavga_attach(struct isa_device *dev)
-{
- isavga_softc_t *sc;
-
- if (dev->id_unit >= sizeof(isavga_softc)/sizeof(isavga_softc[0]))
- return 0;
- sc = isavga_softc[dev->id_unit];
- if (sc == NULL)
- return 0;
-
- return ((isavga_attach_unit(dev->id_unit, sc, dev->id_flags)) ? 0 : 1);
-}
-
-#endif /* __i386__ */
-
-static int
-isavga_probe_unit(int unit, isavga_softc_t *sc, int flags)
-{
- video_switch_t *sw;
-
- bzero(sc, sizeof(*sc));
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return 0;
- return (*sw->probe)(unit, &sc->adp, NULL, flags);
-}
-
-static int
-isavga_attach_unit(int unit, isavga_softc_t *sc, int flags)
-{
- video_switch_t *sw;
- int error;
-
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- error = (*sw->init)(unit, sc->adp, flags);
- if (error)
- return ENXIO;
-
-#ifdef FB_INSTALL_CDEV
- /* attach a virtual frame buffer device */
- error = fb_attach(makedev(0, ISAVGA_MKMINOR(unit)), scp->adp,
- &vga_cdevsw);
- if (error)
- return error;
-#endif /* FB_INSTALL_CDEV */
-
- if (bootverbose)
- (*sw->diag)(sc->adp, bootverbose);
-
- return 0;
-}
-
-/* LOW-LEVEL */
-
-#include <machine/clock.h>
-#include <machine/pc/vesa.h>
-
-#define probe_done(adp) ((adp)->va_flags & V_ADP_PROBED)
-#define init_done(adp) ((adp)->va_flags & V_ADP_INITIALIZED)
-#define config_done(adp) ((adp)->va_flags & V_ADP_REGISTERED)
-
-/* for compatibility with old kernel options */
-#ifdef SC_ALT_SEQACCESS
-#undef SC_ALT_SEQACCESS
-#undef VGA_ALT_SEQACCESS
-#define VGA_ALT_SEQACCESS 1
-#endif
-
-#ifdef SLOW_VGA
-#undef SLOW_VGA
-#undef VGA_SLOW_IOACCESS
-#define VGA_SLOW_IOACCESS 1
-#endif
-
-/* architecture dependent option */
-#ifdef __alpha__
-#define VGA_NO_BIOS 1
-#endif
+#include <i386/isa/videoio.h>
/* this should really be in `rtc.h' */
#define RTC_EQUIPMENT 0x14
-/* various sizes */
-#define V_MODE_MAP_SIZE (M_VGA_CG320 + 1)
-#define V_MODE_PARAM_SIZE 64
-
/* video adapter state buffer */
struct adp_state {
int sig;
@@ -294,169 +73,104 @@ typedef struct adp_state adp_state_t;
* will perform address conversion at run-time.
*/
static video_adapter_t adapter_init_value[] = {
- /* DCC_MONO */
- { 0, KD_MONO, "mda", 0, 0, 0, IO_MDA, IO_MDASIZE, MONO_CRTC,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE,
- 0, 0, 0, 7, 0, 0, NULL },
- /* DCC_CGA40 */
- { 0, KD_CGA, "cga", 0, 0, V_ADP_COLOR, IO_CGA, IO_CGASIZE, COLOR_CRTC,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
- /* DCC_CGA80 */
- { 0, KD_CGA, "cga", 0, 0, V_ADP_COLOR, IO_CGA, IO_CGASIZE, COLOR_CRTC,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
- /* DCC_EGAMONO */
- { 0, KD_EGA, "ega", 0, 0, 0, IO_MDA, 48, MONO_CRTC,
- EGA_BUF_BASE, EGA_BUF_SIZE, MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE,
- 0, 0, 0, 7, 0, 0, NULL },
- /* DCC_EGA40 */
- { 0, KD_EGA, "ega", 0, 0, V_ADP_COLOR, IO_MDA, 48, COLOR_CRTC,
- EGA_BUF_BASE, EGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
- /* DCC_EGA80 */
- { 0, KD_EGA, "ega", 0, 0, V_ADP_COLOR, IO_MDA, 48, COLOR_CRTC,
- EGA_BUF_BASE, EGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
- 0, 0, 0, 3, 0, 0, NULL },
+ { 0, KD_MONO, 0, MONO_BASE, 0xb0000, 32*1024, 32*1024, 0, 0, 0, 7, 0 },
+ { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
+ { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
+ { 0, KD_EGA, 0, MONO_BASE, 0xb0000, 32*1024, 32*1024, 0, 0, 0, 7, 0 },
+ { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
+ { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 },
};
-static video_adapter_t biosadapter[2];
-static int biosadapters = 0;
-
-/* video driver declarations */
-static int vga_configure(int flags);
- int (*vga_sub_configure)(int flags);
-static int vga_nop(void);
-static vi_probe_t vga_probe;
-static vi_init_t vga_init;
-static vi_get_info_t vga_get_info;
-static vi_query_mode_t vga_query_mode;
-static vi_set_mode_t vga_set_mode;
-static vi_save_font_t vga_save_font;
-static vi_load_font_t vga_load_font;
-static vi_show_font_t vga_show_font;
-static vi_save_palette_t vga_save_palette;
-static vi_load_palette_t vga_load_palette;
-static vi_set_border_t vga_set_border;
-static vi_save_state_t vga_save_state;
-static vi_load_state_t vga_load_state;
-static vi_set_win_org_t vga_set_origin;
-static vi_read_hw_cursor_t vga_read_hw_cursor;
-static vi_set_hw_cursor_t vga_set_hw_cursor;
-static vi_set_hw_cursor_shape_t vga_set_hw_cursor_shape;
-static vi_mmap_t vga_mmap;
-static vi_diag_t vga_diag;
-
-static video_switch_t vgavidsw = {
- vga_probe,
- vga_init,
- vga_get_info,
- vga_query_mode,
- vga_set_mode,
- vga_save_font,
- vga_load_font,
- vga_show_font,
- vga_save_palette,
- vga_load_palette,
- vga_set_border,
- vga_save_state,
- vga_load_state,
- vga_set_origin,
- vga_read_hw_cursor,
- vga_set_hw_cursor,
- vga_set_hw_cursor_shape,
- (vi_blank_display_t *)vga_nop,
- vga_mmap,
- vga_diag,
+static video_adapter_t adapter[V_MAX_ADAPTERS];
+static int adapters = 0;
+
+/* VGA function entries */
+static vi_init_t vid_init;
+static vi_adapter_t vid_adapter;
+static vi_get_info_t vid_get_info;
+static vi_query_mode_t vid_query_mode;
+static vi_set_mode_t vid_set_mode;
+static vi_save_font_t vid_save_font;
+static vi_load_font_t vid_load_font;
+static vi_show_font_t vid_show_font;
+static vi_save_palette_t vid_save_palette;
+static vi_load_palette_t vid_load_palette;
+static vi_set_border_t vid_set_border;
+static vi_save_state_t vid_save_state;
+static vi_load_state_t vid_load_state;
+static vi_set_win_org_t vid_set_origin;
+static vi_read_hw_cursor_t vid_read_hw_cursor;
+static vi_set_hw_cursor_t vid_set_hw_cursor;
+static vi_diag_t vid_diag;
+
+struct vidsw biosvidsw = {
+ vid_init, vid_adapter, vid_get_info, vid_query_mode,
+ vid_set_mode, vid_save_font, vid_load_font, vid_show_font,
+ vid_save_palette,vid_load_palette,vid_set_border,vid_save_state,
+ vid_load_state, vid_set_origin, vid_read_hw_cursor, vid_set_hw_cursor,
+ vid_diag,
};
-VIDEO_DRIVER(mda, vgavidsw, NULL);
-VIDEO_DRIVER(cga, vgavidsw, NULL);
-VIDEO_DRIVER(ega, vgavidsw, NULL);
-VIDEO_DRIVER(vga, vgavidsw, vga_configure);
-
/* VGA BIOS standard video modes */
#define EOT (-1)
#define NA (-2)
static video_info_t bios_vmode[] = {
/* CGA */
- { M_B40x25, V_INFO_COLOR, 40, 25, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_C40x25, V_INFO_COLOR, 40, 25, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_B80x25, V_INFO_COLOR, 80, 25, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_C80x25, V_INFO_COLOR, 80, 25, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
+ { M_B40x25, V_INFO_COLOR, 40, 25, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_C40x25, V_INFO_COLOR, 40, 25, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_B80x25, V_INFO_COLOR, 80, 25, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_C80x25, V_INFO_COLOR, 80, 25, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
/* EGA */
- { M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
+ { M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
/* VGA */
- { M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_VGA_M80x25, 0, 80, 25, 8, 16, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
+ { M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_M80x25, 0, 80, 25, 8, 16, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
/* MDA */
- { M_EGAMONO80x25, 0, 80, 25, 8, 14, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
+ { M_EGAMONO80x25, 0, 80, 25, 8, 14, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
/* EGA */
- { M_ENH_B80x43, V_INFO_COLOR, 80, 43, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
+ { M_ENH_B80x43, V_INFO_COLOR, 80, 43, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
/* VGA */
- { M_VGA_M80x30, 0, 80, 30, 8, 16, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_VGA_M80x50, 0, 80, 50, 8, 8, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_VGA_M80x60, 0, 80, 60, 8, 8, 2, 1,
- MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0 },
- { M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8, 8, 4, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
-#ifndef VGA_NO_MODE_CHANGE
+ { M_VGA_M80x30, 0, 80, 30, 8, 16, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_M80x50, 0, 80, 50, 8, 8, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_M80x60, 0, 80, 60, 8, 8, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 },
+ { M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
/* CGA */
- { M_BG320, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_CG320, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 2, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
- { M_BG640, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8, 8, 1, 1,
- CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0 },
+ { M_BG320, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_CG320, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
+ { M_BG640, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 200, 8, 8, 1, 1, 0xb8000, 32*1024, 32*1024, 0, 0 },
/* EGA */
- { M_CG320_D, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_CG640_E, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8, 8, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_EGAMONOAPA, V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, 64*1024, 0, 0 },
- { M_ENHMONOAPA2,V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_CG640x350, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 2, 2,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_ENH_CG640, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
+ { M_CG320_D, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_CG640_E, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 200, 8, 8, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_EGAMONOAPA, V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_ENHMONOAPA2,V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_CG640x350, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 2, 2, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_ENH_CG640, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
/* VGA */
- { M_BG640x480, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_CG640x480, V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_VGA_CG320, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8, 8, 8, 1,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
- { M_VGA_MODEX, V_INFO_COLOR | V_INFO_GRAPHICS, 320, 240, 8, 8, 8, 1,
- GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 },
-#endif /* VGA_NO_MODE_CHANGE */
+ { M_BG640x480, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 480, 8, 16, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_CG640x480, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 640, 480, 8, 16, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_VGA_CG320, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 200, 8, 8, 8, 1, 0xa0000, 64*1024, 64*1024, 0, 0 },
+ { M_VGA_MODEX, V_INFO_COLOR | V_INFO_GRAPHICS,
+ 320, 240, 8, 8, 8, 1, 0xa0000, 64*1024, 64*1024, 0, 0 },
{ EOT },
};
@@ -472,69 +186,40 @@ static int rows_offset = 1;
/* local macros and functions */
#define BIOS_SADDRTOLADDR(p) ((((p) & 0xffff0000) >> 12) + ((p) & 0x0000ffff))
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
static void map_mode_table(u_char *map[], u_char *table, int max);
-#endif
-static void clear_mode_map(video_adapter_t *adp, u_char *map[], int max,
- int color);
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
+static void clear_mode_map(int ad, u_char *map[], int max, int color);
static int map_mode_num(int mode);
-#endif
static int map_gen_mode_num(int type, int color, int mode);
static int map_bios_mode_num(int type, int color, int bios_mode);
static u_char *get_mode_param(int mode);
-#ifndef VGA_NO_BIOS
static void fill_adapter_param(int code, video_adapter_t *adp);
-#endif
static int verify_adapter(video_adapter_t *adp);
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
#define COMP_IDENTICAL 0
#define COMP_SIMILAR 1
#define COMP_DIFFERENT 2
static int comp_adpregs(u_char *buf1, u_char *buf2);
-#endif
-static int probe_adapters(void);
#define PARAM_BUFSIZE 6
static void set_font_mode(video_adapter_t *adp, u_char *buf);
static void set_normal_mode(video_adapter_t *adp, u_char *buf);
+static char *adapter_name(int type);
+static void dump_adp_info(int ad, video_adapter_t *adp, int level);
+static void dump_mode_info(int ad, video_info_t *info, int level);
static void dump_buffer(u_char *buf, size_t len);
-#define ISMAPPED(pa, width) \
+extern void generic_bcopy(const void *, void *, size_t);
+
+#define ISMAPPED(pa, width) \
(((pa) <= (u_long)0x1000 - (width)) \
|| ((pa) >= ISA_HOLE_START && (pa) <= 0x100000 - (width)))
-#define prologue(adp, flag, err) \
- if (!init_done || !((adp)->va_flags & (flag))) \
+#define prologue(ad, flag, err) \
+ if (!init_done \
+ || ((ad) < 0) || ((ad) >= adapters) \
+ || !(adapter[(ad)].va_flags & (flag))) \
return (err)
-/* a backdoor for the console driver */
-static int
-vga_configure(int flags)
-{
- int i;
-
- probe_adapters();
- for (i = 0; i < biosadapters; ++i) {
- if (!probe_done(&biosadapter[i]))
- continue;
- biosadapter[i].va_flags |= V_ADP_INITIALIZED;
- if (!config_done(&biosadapter[i])) {
- if (vid_register(&biosadapter[i]) < 0)
- continue;
- biosadapter[i].va_flags |= V_ADP_REGISTERED;
- }
- }
- if (vga_sub_configure != NULL)
- (*vga_sub_configure)(flags);
-
- return biosadapters;
-}
-
-/* local subroutines */
-
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
/* construct the mode parameter map */
static void
map_mode_table(u_char *map[], u_char *table, int max)
@@ -546,10 +231,9 @@ map_mode_table(u_char *map[], u_char *table, int max)
for(; i < V_MODE_MAP_SIZE; ++i)
map[i] = NULL;
}
-#endif /* !VGA_NO_BIOS && !VGA_NO_MODE_CHANGE */
static void
-clear_mode_map(video_adapter_t *adp, u_char *map[], int max, int color)
+clear_mode_map(int ad, u_char *map[], int max, int color)
{
video_info_t info;
int i;
@@ -559,14 +243,13 @@ clear_mode_map(video_adapter_t *adp, u_char *map[], int max, int color)
* by all adapters.
*/
for(i = 0; i < max; ++i) {
- if (vga_get_info(adp, i, &info))
+ if (vid_get_info(ad, i, &info))
continue;
if ((info.vi_flags & V_INFO_COLOR) != color)
map[i] = NULL;
}
}
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
/* map the non-standard video mode to a known mode number */
static int
map_mode_num(int mode)
@@ -593,7 +276,6 @@ map_mode_num(int mode)
}
return mode;
}
-#endif /* !VGA_NO_BIOS && !VGA_NO_MODE_CHANGE */
/* map a generic video mode to a known mode number */
static int
@@ -725,17 +407,14 @@ map_bios_mode_num(int type, int color, int bios_mode)
static u_char
*get_mode_param(int mode)
{
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
if (mode >= V_MODE_MAP_SIZE)
mode = map_mode_num(mode);
-#endif
if ((mode >= 0) && (mode < V_MODE_MAP_SIZE))
return mode_map[mode];
else
return NULL;
}
-#ifndef VGA_NO_BIOS
static void
fill_adapter_param(int code, video_adapter_t *adp)
{
@@ -765,21 +444,20 @@ fill_adapter_param(int code, video_adapter_t *adp)
adp[V_ADP_SECONDARY] = adapter_init_value[dcc[code].secondary];
}
}
-#endif /* VGA_NO_BIOS */
static int
verify_adapter(video_adapter_t *adp)
{
- volatile u_int16_t *buf;
- u_int16_t v;
+ u_short volatile *buf;
+ u_short v;
u_int32_t p;
- buf = (u_int16_t *)BIOS_PADDRTOVADDR(adp->va_window);
- v = readw(buf);
- writew(buf, 0xA55A);
- if (readw(buf) != 0xA55A)
+ buf = (u_short *)BIOS_PADDRTOVADDR(adp->va_window);
+ v = *buf;
+ *buf = (u_short) 0xA55A;
+ if (*buf != 0xA55A)
return 1;
- writew(buf, v);
+ *buf = v;
switch (adp->va_type) {
@@ -787,13 +465,11 @@ verify_adapter(video_adapter_t *adp)
outb(adp->va_crtc_addr, 7);
if (inb(adp->va_crtc_addr) == 7) {
adp->va_type = KD_VGA;
- adp->va_name = "vga";
adp->va_flags |= V_ADP_STATESAVE | V_ADP_PALETTE;
}
- adp->va_flags |= V_ADP_STATELOAD | V_ADP_BORDER;
+ adp->va_flags |= V_ADP_STATELOAD | V_ADP_FONT | V_ADP_BORDER;
/* the color adapter may be in the 40x25 mode... XXX */
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
/* get the BIOS video mode pointer */
p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x4a8);
p = BIOS_SADDRTOLADDR(p);
@@ -803,34 +479,20 @@ verify_adapter(video_adapter_t *adp)
if (ISMAPPED(p, V_MODE_PARAM_SIZE))
video_mode_ptr = (u_char *)BIOS_PADDRTOVADDR(p);
}
-#endif
break;
case KD_CGA:
adp->va_flags |= V_ADP_COLOR | V_ADP_BORDER;
/* may be in the 40x25 mode... XXX */
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- /* get the BIOS video mode pointer */
- p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x1d*4);
- p = BIOS_SADDRTOLADDR(p);
- video_mode_ptr2 = (u_char *)BIOS_PADDRTOVADDR(p);
-#endif
break;
case KD_MONO:
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- /* get the BIOS video mode pointer */
- p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x1d*4);
- p = BIOS_SADDRTOLADDR(p);
- video_mode_ptr2 = (u_char *)BIOS_PADDRTOVADDR(p);
-#endif
break;
}
return 0;
}
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
/* compare two parameter table entries */
static int
comp_adpregs(u_char *buf1, u_char *buf2)
@@ -870,11 +532,17 @@ comp_adpregs(u_char *buf1, u_char *buf2)
}
return (identical) ? COMP_IDENTICAL : COMP_SIMILAR;
}
-#endif /* !VGA_NO_BIOS && !VGA_NO_MODE_CHANGE */
-/* probe video adapters and return the number of detected adapters */
+/* entry points */
+
+/*
+ * init()
+ * Return the # of video adapters found; usually 1 or 0.
+ *
+ * all adapters
+ */
static int
-probe_adapters(void)
+vid_init(void)
{
video_adapter_t *adp;
video_info_t info;
@@ -883,7 +551,7 @@ probe_adapters(void)
/* do this test only once */
if (init_done)
- return biosadapters;
+ return adapters;
init_done = TRUE;
/*
@@ -906,98 +574,75 @@ probe_adapters(void)
*/
/*
- * Check rtc and BIOS data area.
+ * Check rtc and BIOS date area.
* XXX: we don't use BIOSDATA_EQUIPMENT, since it is not a dead
- * copy of RTC_EQUIPMENT. Bits 4 and 5 of ETC_EQUIPMENT are
+ * copy of RTC_EQUIPMENT. Bits 4 and 5 of the ETC_EQUIPMENT are
* zeros for EGA and VGA. However, the EGA/VGA BIOS sets
* these bits in BIOSDATA_EQUIPMENT according to the monitor
* type detected.
*/
-#ifndef VGA_NO_BIOS
switch ((rtcin(RTC_EQUIPMENT) >> 4) & 3) { /* bit 4 and 5 */
case 0:
/* EGA/VGA */
- fill_adapter_param(readb(BIOS_PADDRTOVADDR(0x488)) & 0x0f,
- biosadapter);
+ fill_adapter_param(*(u_int8_t *)BIOS_PADDRTOVADDR(0x488) & 0x0f,
+ adapter);
break;
case 1:
/* CGA 40x25 */
/* FIXME: switch to the 80x25 mode? XXX */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA40];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
+ adapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA40];
+ adapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
break;
case 2:
/* CGA 80x25 */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA80];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
+ adapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA80];
+ adapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
break;
case 3:
/* MDA */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
+ adapter[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
+ adapter[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
break;
}
-#else
- /* assume EGA/VGA? XXX */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_EGA80];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
-#endif /* VGA_NO_BIOS */
-
- biosadapters = 0;
- if (verify_adapter(&biosadapter[V_ADP_SECONDARY]) == 0) {
- ++biosadapters;
- biosadapter[V_ADP_SECONDARY].va_flags |= V_ADP_PROBED;
- biosadapter[V_ADP_SECONDARY].va_mode =
- biosadapter[V_ADP_SECONDARY].va_initial_mode =
- map_bios_mode_num(biosadapter[V_ADP_SECONDARY].va_type,
- biosadapter[V_ADP_SECONDARY].va_flags
- & V_ADP_COLOR,
- biosadapter[V_ADP_SECONDARY].va_initial_bios_mode);
+
+ adapters = 0;
+ if (verify_adapter(&adapter[V_ADP_SECONDARY]) == 0) {
+ ++adapters;
+ adapter[V_ADP_SECONDARY].va_mode =
+ adapter[V_ADP_SECONDARY].va_initial_mode =
+ map_bios_mode_num(adapter[V_ADP_SECONDARY].va_type,
+ adapter[V_ADP_SECONDARY].va_flags & V_ADP_COLOR,
+ adapter[V_ADP_SECONDARY].va_initial_bios_mode);
} else {
- biosadapter[V_ADP_SECONDARY].va_type = -1;
+ adapter[V_ADP_SECONDARY].va_type = -1;
}
- if (verify_adapter(&biosadapter[V_ADP_PRIMARY]) == 0) {
- ++biosadapters;
- biosadapter[V_ADP_PRIMARY].va_flags |= V_ADP_PROBED;
-#ifndef VGA_NO_BIOS
- biosadapter[V_ADP_PRIMARY].va_initial_bios_mode =
- readb(BIOS_PADDRTOVADDR(0x449));
-#else
- biosadapter[V_ADP_PRIMARY].va_initial_bios_mode = 3; /* XXX */
-#endif
- biosadapter[V_ADP_PRIMARY].va_mode =
- biosadapter[V_ADP_PRIMARY].va_initial_mode =
- map_bios_mode_num(biosadapter[V_ADP_PRIMARY].va_type,
- biosadapter[V_ADP_PRIMARY].va_flags & V_ADP_COLOR,
- biosadapter[V_ADP_PRIMARY].va_initial_bios_mode);
+ if (verify_adapter(&adapter[V_ADP_PRIMARY]) == 0) {
+ ++adapters;
+ adapter[V_ADP_PRIMARY].va_initial_bios_mode =
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x449);
+ adapter[V_ADP_PRIMARY].va_mode =
+ adapter[V_ADP_PRIMARY].va_initial_mode =
+ map_bios_mode_num(adapter[V_ADP_PRIMARY].va_type,
+ adapter[V_ADP_PRIMARY].va_flags & V_ADP_COLOR,
+ adapter[V_ADP_PRIMARY].va_initial_bios_mode);
} else {
- biosadapter[V_ADP_PRIMARY] = biosadapter[V_ADP_SECONDARY];
- biosadapter[V_ADP_SECONDARY].va_type = -1;
+ adapter[V_ADP_PRIMARY] = adapter[V_ADP_SECONDARY];
+ adapter[V_ADP_SECONDARY].va_type = -1;
}
- if (biosadapters == 0)
- return biosadapters;
-#if 0
- biosadapter[V_ADP_PRIMARY].va_index = V_ADP_PRIMARY;
- biosadapter[V_ADP_SECONDARY].va_index = V_ADP_SECONDARY;
-#endif
- biosadapter[V_ADP_PRIMARY].va_unit = V_ADP_PRIMARY;
- biosadapter[V_ADP_SECONDARY].va_unit = V_ADP_SECONDARY;
-
-#if 0 /* we don't need these... */
- fb_init_struct(&biosadapter[V_ADP_PRIMARY], ...);
- fb_init_struct(&biosadapter[V_ADP_SECONDARY], ...);
-#endif
+ if (adapters == 0)
+ return adapters;
+ adapter[V_ADP_PRIMARY].va_index = V_ADP_PRIMARY;
+ adapter[V_ADP_SECONDARY].va_index = V_ADP_SECONDARY;
#if 0
/*
* We cannot have two video adapter of the same type; there must be
* only one of color or mono adapter, or one each of them.
*/
- if (biosadapters > 1) {
- if (!((biosadapter[0].va_flags ^ biosadapter[1].va_flags)
- & V_ADP_COLOR))
+ if (adapters > 1) {
+ if (!((adapter[0].va_flags ^ adapter[1].va_flags) & V_ADP_COLOR))
/* we have two mono or color adapters!! */
- return (biosadapters = 0);
+ return (adapters = 0);
}
#endif
@@ -1006,36 +651,32 @@ probe_adapters(void)
* switching from pcvt using userconfig(). The registers are w/o
* for old hardware so it's too hard to relocate the active screen
* memory.
- * This must be done before vga_save_state() for VGA.
+ * This must be done before vid_save_state() for VGA.
*/
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr, 12);
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr, 13);
- outb(biosadapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr, 12);
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr, 13);
+ outb(adapter[V_ADP_PRIMARY].va_crtc_addr + 1, 0);
/* the video mode parameter table in EGA/VGA BIOS */
/* NOTE: there can be only one EGA/VGA, wheather color or mono,
* recognized by the video BIOS.
*/
- if ((biosadapter[V_ADP_PRIMARY].va_type == KD_EGA) ||
- (biosadapter[V_ADP_PRIMARY].va_type == KD_VGA)) {
- adp = &biosadapter[V_ADP_PRIMARY];
- } else if ((biosadapter[V_ADP_SECONDARY].va_type == KD_EGA) ||
- (biosadapter[V_ADP_SECONDARY].va_type == KD_VGA)) {
- adp = &biosadapter[V_ADP_SECONDARY];
+ if ((adapter[V_ADP_PRIMARY].va_type == KD_EGA) ||
+ (adapter[V_ADP_PRIMARY].va_type == KD_VGA)) {
+ adp = &adapter[V_ADP_PRIMARY];
+ } else if ((adapter[V_ADP_SECONDARY].va_type == KD_EGA) ||
+ (adapter[V_ADP_SECONDARY].va_type == KD_VGA)) {
+ adp = &adapter[V_ADP_SECONDARY];
} else {
adp = NULL;
}
bzero(mode_map, sizeof(mode_map));
if (adp != NULL) {
if (adp->va_type == KD_VGA) {
- vga_save_state(adp, &adpstate, sizeof(adpstate));
-#if defined(VGA_NO_BIOS) || defined(VGA_NO_MODE_CHANGE)
- mode_map[adp->va_initial_mode] = adpstate.regs;
- rows_offset = 1;
-#else /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
+ vid_save_state(adp - adapter, &adpstate, sizeof(adpstate));
if (video_mode_ptr == NULL) {
- mode_map[adp->va_initial_mode] = adpstate.regs;
+ mode_map[map_mode_num(adp->va_initial_mode)] = adpstate.regs;
rows_offset = 1;
} else {
/* discard the table if we are not familiar with it... */
@@ -1065,7 +706,8 @@ probe_adapters(void)
* for the initial mode and other modes which are
* based on the initial mode.
*/
- mode_map[adp->va_initial_mode] = adpstate.regs;
+ mode_map[map_mode_num(adp->va_initial_mode)] =
+ adpstate.regs;
rows_offset = adpstate.regs[1] + 1 - mp[1];
adpstate.regs[1] -= rows_offset - 1;
break;
@@ -1080,24 +722,16 @@ probe_adapters(void)
*/
video_mode_ptr = NULL;
bzero(mode_map, sizeof(mode_map));
- mode_map[adp->va_initial_mode] = adpstate.regs;
+ mode_map[map_mode_num(adp->va_initial_mode)] =
+ adpstate.regs;
rows_offset = 1;
break;
}
}
-#endif /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
-
-#ifndef VGA_NO_MODE_CHANGE
adp->va_flags |= V_ADP_MODECHANGE;
-#endif
-#ifndef VGA_NO_FONT_LOADING
- adp->va_flags |= V_ADP_FONT;
-#endif
} else if (adp->va_type == KD_EGA) {
-#if defined(VGA_NO_BIOS) || defined(VGA_NO_MODE_CHANGE)
- rows_offset = 1;
-#else /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
if (video_mode_ptr == NULL) {
+ adp->va_flags &= ~V_ADP_FONT;
rows_offset = 1;
} else {
map_mode_table(mode_map, video_mode_ptr, M_ENH_C80x25 + 1);
@@ -1105,74 +739,48 @@ probe_adapters(void)
mp = get_mode_param(adp->va_initial_mode);
if (mp != NULL) {
adp->va_flags |= V_ADP_MODECHANGE;
-#ifndef VGA_NO_FONT_LOADING
- adp->va_flags |= V_ADP_FONT;
-#endif
rows_offset = 1;
} else {
/*
* This is serious. We will not be able to switch video
* modes at all...
*/
+ adp->va_flags &= ~V_ADP_FONT;
video_mode_ptr = NULL;
bzero(mode_map, sizeof(mode_map));
rows_offset = 1;
}
}
-#endif /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
}
}
/* remove conflicting modes if we have more than one adapter */
- if (biosadapters > 1) {
- for (i = 0; i < biosadapters; ++i) {
- if (!(biosadapter[i].va_flags & V_ADP_MODECHANGE))
+ if (adapters > 1) {
+ for (i = 0; i < adapters; ++i) {
+ if (!(adapter[i].va_flags & V_ADP_MODECHANGE))
continue;
- clear_mode_map(&biosadapter[i], mode_map, M_VGA_CG320 + 1,
- (biosadapter[i].va_flags & V_ADP_COLOR) ?
+ clear_mode_map(i, mode_map, M_VGA_CG320 + 1,
+ (adapter[i].va_flags & V_ADP_COLOR) ?
V_INFO_COLOR : 0);
- if ((biosadapter[i].va_type == KD_VGA)
- || (biosadapter[i].va_type == KD_EGA)) {
- biosadapter[i].va_io_base =
- (biosadapter[i].va_flags & V_ADP_COLOR) ?
- IO_VGA : IO_MDA;
- biosadapter[i].va_io_size = 32;
- }
}
}
/* buffer address */
- vga_get_info(&biosadapter[V_ADP_PRIMARY],
- biosadapter[V_ADP_PRIMARY].va_initial_mode, &info);
- biosadapter[V_ADP_PRIMARY].va_mode_flags = info.vi_flags;
- biosadapter[V_ADP_PRIMARY].va_window = BIOS_PADDRTOVADDR(info.vi_window);
- biosadapter[V_ADP_PRIMARY].va_window_size = info.vi_window_size;
- biosadapter[V_ADP_PRIMARY].va_window_gran = info.vi_window_gran;
- if (info.vi_buffer_size == 0) {
- biosadapter[V_ADP_PRIMARY].va_buffer = 0;
- biosadapter[V_ADP_PRIMARY].va_buffer_size = 0;
- } else {
- biosadapter[V_ADP_PRIMARY].va_buffer
- = BIOS_PADDRTOVADDR(info.vi_buffer);
- biosadapter[V_ADP_PRIMARY].va_buffer_size = info.vi_buffer_size;
- }
-
- if (biosadapters > 1) {
- vga_get_info(&biosadapter[V_ADP_SECONDARY],
- biosadapter[V_ADP_SECONDARY].va_initial_mode, &info);
- biosadapter[V_ADP_SECONDARY].va_mode_flags = info.vi_flags;
- biosadapter[V_ADP_SECONDARY].va_window =
- BIOS_PADDRTOVADDR(info.vi_window);
- biosadapter[V_ADP_SECONDARY].va_window_size = info.vi_window_size;
- biosadapter[V_ADP_SECONDARY].va_window_gran = info.vi_window_gran;
- if (info.vi_buffer_size == 0) {
- biosadapter[V_ADP_SECONDARY].va_buffer = 0;
- biosadapter[V_ADP_SECONDARY].va_buffer_size = 0;
- } else {
- biosadapter[V_ADP_SECONDARY].va_buffer =
- BIOS_PADDRTOVADDR(info.vi_buffer);
- biosadapter[V_ADP_SECONDARY].va_buffer_size = info.vi_buffer_size;
- }
+ vid_get_info(V_ADP_PRIMARY,
+ adapter[V_ADP_PRIMARY].va_initial_mode, &info);
+ adapter[V_ADP_PRIMARY].va_window = BIOS_PADDRTOVADDR(info.vi_window);
+ adapter[V_ADP_PRIMARY].va_window_size = info.vi_window_size;
+ adapter[V_ADP_PRIMARY].va_window_gran = info.vi_window_gran;
+ adapter[V_ADP_PRIMARY].va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
+ adapter[V_ADP_PRIMARY].va_buffer_size = info.vi_buffer_size;
+ if (adapters > 1) {
+ vid_get_info(V_ADP_SECONDARY,
+ adapter[V_ADP_SECONDARY].va_initial_mode, &info);
+ adapter[V_ADP_SECONDARY].va_window = BIOS_PADDRTOVADDR(info.vi_window);
+ adapter[V_ADP_SECONDARY].va_window_size = info.vi_window_size;
+ adapter[V_ADP_SECONDARY].va_window_gran = info.vi_window_gran;
+ adapter[V_ADP_SECONDARY].va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
+ adapter[V_ADP_SECONDARY].va_buffer_size = info.vi_buffer_size;
}
/*
@@ -1186,49 +794,24 @@ probe_adapters(void)
* buffer size: *(u_int16_t *)BIOS_PADDRTOVADDR(0x44c);
*/
- return biosadapters;
-}
-
-/* entry points */
-
-static int
-vga_nop(void)
-{
- return 0;
-}
-
-static int
-vga_probe(int unit, video_adapter_t **adpp, void *arg, int flags)
-{
- probe_adapters();
- if (unit >= biosadapters)
- return ENXIO;
-
- *adpp = &biosadapter[unit];
-
- return 0;
+ return adapters;
}
-static int
-vga_init(int unit, video_adapter_t *adp, int flags)
+/*
+ * adapter();
+ * Return a pointer to the video_adapter structure of the requested
+ * adapter.
+ *
+ * all adapters
+ */
+static video_adapter_t
+*vid_adapter(int ad)
{
- if ((unit >= biosadapters) || (adp == NULL) || !probe_done(adp))
- return ENXIO;
-
- if (!init_done(adp)) {
- /* nothing to do really... */
- adp->va_flags |= V_ADP_INITIALIZED;
- }
-
- if (!config_done(adp)) {
- if (vid_register(adp) < 0)
- return ENXIO;
- adp->va_flags |= V_ADP_REGISTERED;
- }
- if (vga_sub_configure != NULL)
- (*vga_sub_configure)(0);
-
- return 0;
+ if (!init_done)
+ return NULL;
+ if ((ad < 0) || (ad >= adapters))
+ return NULL;
+ return &adapter[ad];
}
/*
@@ -1238,31 +821,31 @@ vga_init(int unit, video_adapter_t *adp, int flags)
* all adapters
*/
static int
-vga_get_info(video_adapter_t *adp, int mode, video_info_t *info)
+vid_get_info(int ad, int mode, video_info_t *info)
{
int i;
if (!init_done)
return 1;
+ if ((ad < 0) || (ad >= adapters))
+ return 1;
- mode = map_gen_mode_num(adp->va_type, adp->va_flags & V_ADP_COLOR, mode);
-#ifndef VGA_NO_MODE_CHANGE
- if (adp->va_flags & V_ADP_MODECHANGE) {
+ mode = map_gen_mode_num(adapter[ad].va_type,
+ adapter[ad].va_flags & V_ADP_COLOR, mode);
+ if (adapter[ad].va_flags & V_ADP_MODECHANGE) {
/*
* If the parameter table entry for this mode is not found,
* the mode is not supported...
*/
if (get_mode_param(mode) == NULL)
return 1;
- } else
-#endif /* VGA_NO_MODE_CHANGE */
- {
+ } else {
/*
* Even if we don't support video mode switching on this adapter,
* the information on the initial (thus current) video mode
* should be made available.
*/
- if (mode != adp->va_initial_mode)
+ if (mode != adapter[ad].va_initial_mode)
return 1;
}
@@ -1286,13 +869,15 @@ vga_get_info(video_adapter_t *adp, int mode, video_info_t *info)
* all adapters
*/
static int
-vga_query_mode(video_adapter_t *adp, video_info_t *info)
+vid_query_mode(int ad, video_info_t *info)
{
video_info_t buf;
int i;
if (!init_done)
return -1;
+ if ((ad < 0) || (ad >= adapters))
+ return -1;
for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
if (bios_vmode[i].vi_mode == NA)
@@ -1322,7 +907,7 @@ vga_query_mode(video_adapter_t *adp, video_info_t *info)
continue;
/* verify if this mode is supported on this adapter */
- if (vga_get_info(adp, bios_vmode[i].vi_mode, &buf))
+ if (vid_get_info(ad, bios_vmode[i].vi_mode, &buf))
continue;
return bios_vmode[i].vi_mode;
}
@@ -1336,17 +921,16 @@ vga_query_mode(video_adapter_t *adp, video_info_t *info)
* EGA/VGA
*/
static int
-vga_set_mode(video_adapter_t *adp, int mode)
+vid_set_mode(int ad, int mode)
{
-#ifndef VGA_NO_MODE_CHANGE
video_info_t info;
adp_state_t params;
- prologue(adp, V_ADP_MODECHANGE, 1);
+ prologue(ad, V_ADP_MODECHANGE, 1);
- mode = map_gen_mode_num(adp->va_type,
- adp->va_flags & V_ADP_COLOR, mode);
- if (vga_get_info(adp, mode, &info))
+ mode = map_gen_mode_num(adapter[ad].va_type,
+ adapter[ad].va_flags & V_ADP_COLOR, mode);
+ if (vid_get_info(ad, mode, &info))
return 1;
params.sig = V_STATE_SIG;
bcopy(get_mode_param(mode), params.regs, sizeof(params.regs));
@@ -1388,7 +972,7 @@ special_80x50:
case M_EGAMONO80x25:
setup_mode:
- vga_load_state(adp, &params);
+ vid_load_state(ad, &params);
break;
case M_VGA_MODEX:
@@ -1420,42 +1004,33 @@ setup_mode:
case M_BG640x480: case M_CG640x480: case M_VGA_CG320:
setup_grmode:
- vga_load_state(adp, &params);
+ vid_load_state(ad, &params);
break;
default:
return 1;
}
- adp->va_mode = mode;
- adp->va_mode_flags = info.vi_flags;
- adp->va_flags &= ~V_ADP_COLOR;
- adp->va_flags |=
+ adapter[ad].va_mode = mode;
+ adapter[ad].va_flags &= ~V_ADP_COLOR;
+ adapter[ad].va_flags |=
(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
- adp->va_crtc_addr =
- (adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
- adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
- adp->va_window_size = info.vi_window_size;
- adp->va_window_gran = info.vi_window_gran;
+ adapter[ad].va_crtc_addr =
+ (adapter[ad].va_flags & V_ADP_COLOR) ? COLOR_BASE : MONO_BASE;
+ adapter[ad].va_window = BIOS_PADDRTOVADDR(info.vi_window);
+ adapter[ad].va_window_size = info.vi_window_size;
+ adapter[ad].va_window_gran = info.vi_window_gran;
if (info.vi_buffer_size == 0) {
- adp->va_buffer = 0;
- adp->va_buffer_size = 0;
+ adapter[ad].va_buffer = 0;
+ adapter[ad].va_buffer_size = 0;
} else {
- adp->va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
- adp->va_buffer_size = info.vi_buffer_size;
+ adapter[ad].va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
+ adapter[ad].va_buffer_size = info.vi_buffer_size;
}
- /* move hardware cursor out of the way */
- (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
-
return 0;
-#else /* VGA_NO_MODE_CHANGE */
- return 1;
-#endif /* VGA_NO_MODE_CHANGE */
}
-#ifndef VGA_NO_FONT_LOADING
-
static void
set_font_mode(video_adapter_t *adp, u_char *buf)
{
@@ -1493,31 +1068,31 @@ set_font_mode(video_adapter_t *adp, u_char *buf)
inb(adp->va_crtc_addr + 6); /* reset flip-flop */
outb(ATC, 0x20); /* enable palette */
-#if VGA_SLOW_IOACCESS
-#ifdef VGA_ALT_SEQACCESS
+#if SLOW_VGA
+#ifdef SC_ALT_SEQACCESS
outb(TSIDX, 0x00); outb(TSREG, 0x01);
#endif
outb(TSIDX, 0x02); outb(TSREG, 0x04);
outb(TSIDX, 0x04); outb(TSREG, 0x07);
-#ifdef VGA_ALT_SEQACCESS
+#ifdef SC_ALT_SEQACCESS
outb(TSIDX, 0x00); outb(TSREG, 0x03);
#endif
outb(GDCIDX, 0x04); outb(GDCREG, 0x02);
outb(GDCIDX, 0x05); outb(GDCREG, 0x00);
outb(GDCIDX, 0x06); outb(GDCREG, 0x04);
-#else /* VGA_SLOW_IOACCESS */
-#ifdef VGA_ALT_SEQACCESS
+#else
+#ifdef SC_ALT_SEQACCESS
outw(TSIDX, 0x0100);
#endif
outw(TSIDX, 0x0402);
outw(TSIDX, 0x0704);
-#ifdef VGA_ALT_SEQACCESS
+#ifdef SC_ALT_SEQACCESS
outw(TSIDX, 0x0300);
#endif
outw(GDCIDX, 0x0204);
outw(GDCIDX, 0x0005);
outw(GDCIDX, 0x0406); /* addr = a0000, 64kb */
-#endif /* VGA_SLOW_IOACCESS */
+#endif
splx(s);
}
@@ -1535,44 +1110,42 @@ set_normal_mode(video_adapter_t *adp, u_char *buf)
inb(adp->va_crtc_addr + 6); /* reset flip-flop */
outb(ATC, 0x20); /* enable palette */
-#if VGA_SLOW_IOACCESS
-#ifdef VGA_ALT_SEQACCESS
+#if SLOW_VGA
+#ifdef SC_ALT_SEQACCESS
outb(TSIDX, 0x00); outb(TSREG, 0x01);
#endif
outb(TSIDX, 0x02); outb(TSREG, buf[0]);
outb(TSIDX, 0x04); outb(TSREG, buf[1]);
-#ifdef VGA_ALT_SEQACCESS
+#ifdef SC_ALT_SEQACCESS
outb(TSIDX, 0x00); outb(TSREG, 0x03);
#endif
outb(GDCIDX, 0x04); outb(GDCREG, buf[2]);
outb(GDCIDX, 0x05); outb(GDCREG, buf[3]);
- if (adp->va_crtc_addr == MONO_CRTC) {
+ if (adp->va_crtc_addr == MONO_BASE) {
outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x08);
} else {
outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x0c);
}
-#else /* VGA_SLOW_IOACCESS */
-#ifdef VGA_ALT_SEQACCESS
+#else
+#ifdef SC_ALT_SEQACCESS
outw(TSIDX, 0x0100);
#endif
outw(TSIDX, 0x0002 | (buf[0] << 8));
outw(TSIDX, 0x0004 | (buf[1] << 8));
-#ifdef VGA_ALT_SEQACCESS
+#ifdef SC_ALT_SEQACCESS
outw(TSIDX, 0x0300);
#endif
outw(GDCIDX, 0x0004 | (buf[2] << 8));
outw(GDCIDX, 0x0005 | (buf[3] << 8));
- if (adp->va_crtc_addr == MONO_CRTC)
+ if (adp->va_crtc_addr == MONO_BASE)
outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x08)<<8));
else
outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8));
-#endif /* VGA_SLOW_IOACCESS */
+#endif
splx(s);
}
-#endif /* VGA_NO_FONT_LOADING */
-
/*
* save_font():
* Read the font data in the requested font page from the video adapter.
@@ -1580,19 +1153,15 @@ set_normal_mode(video_adapter_t *adp, u_char *buf)
* EGA/VGA
*/
static int
-vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vid_save_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
{
-#ifndef VGA_NO_FONT_LOADING
u_char buf[PARAM_BUFSIZE];
+ u_char val = 0;
u_int32_t segment;
int c;
-#ifdef VGA_ALT_SEQACCESS
int s;
- u_char val = 0;
-#endif
- prologue(adp, V_ADP_FONT, 1);
+ prologue(ad, V_ADP_FONT, 1);
if (fontsize < 14) {
/* FONT_8 */
@@ -1609,12 +1178,12 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
if (page < 0 || page >= 8)
return 1;
- segment = FONT_BUF + 0x4000*page;
+ segment = VIDEOMEM + 0x4000*page;
if (page > 3)
segment -= 0xe000;
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) { /* what about EGA? XXX */
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) { /* what about EGA? XXX */
s = splhigh();
outb(TSIDX, 0x00); outb(TSREG, 0x01);
outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
@@ -1624,19 +1193,21 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
}
#endif
- set_font_mode(adp, buf);
+ set_font_mode(&adapter[ad], buf);
if (fontsize == 32) {
- bcopy_fromio((void *)(segment + ch*32), data, fontsize*count);
+ generic_bcopy((void *)BIOS_PADDRTOVADDR(segment + ch*32), data,
+ fontsize*count);
} else {
for (c = ch; count > 0; ++c, --count) {
- bcopy_fromio((void *)(segment + c*32), data, fontsize);
+ generic_bcopy((void *)BIOS_PADDRTOVADDR(segment + c*32), data,
+ fontsize);
data += fontsize;
}
}
- set_normal_mode(adp, buf);
+ set_normal_mode(&adapter[ad], buf);
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) {
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) {
s = splhigh();
outb(TSIDX, 0x00); outb(TSREG, 0x01);
outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */
@@ -1646,9 +1217,6 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
#endif
return 0;
-#else /* VGA_NO_FONT_LOADING */
- return 1;
-#endif /* VGA_NO_FONT_LOADING */
}
/*
@@ -1660,19 +1228,15 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
* EGA/VGA
*/
static int
-vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
- int ch, int count)
+vid_load_font(int ad, int page, int fontsize, u_char *data, int ch, int count)
{
-#ifndef VGA_NO_FONT_LOADING
u_char buf[PARAM_BUFSIZE];
+ u_char val = 0;
u_int32_t segment;
int c;
-#ifdef VGA_ALT_SEQACCESS
int s;
- u_char val = 0;
-#endif
- prologue(adp, V_ADP_FONT, 1);
+ prologue(ad, V_ADP_FONT, 1);
if (fontsize < 14) {
/* FONT_8 */
@@ -1689,12 +1253,12 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
if (page < 0 || page >= 8)
return 1;
- segment = FONT_BUF + 0x4000*page;
+ segment = VIDEOMEM + 0x4000*page;
if (page > 3)
segment -= 0xe000;
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) { /* what about EGA? XXX */
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) { /* what about EGA? XXX */
s = splhigh();
outb(TSIDX, 0x00); outb(TSREG, 0x01);
outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
@@ -1704,19 +1268,21 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
}
#endif
- set_font_mode(adp, buf);
+ set_font_mode(&adapter[ad], buf);
if (fontsize == 32) {
- bcopy_toio(data, (void *)(segment + ch*32), fontsize*count);
+ generic_bcopy(data, (void *)BIOS_PADDRTOVADDR(segment + ch*32),
+ fontsize*count);
} else {
for (c = ch; count > 0; ++c, --count) {
- bcopy_toio(data, (void *)(segment + c*32), fontsize);
+ generic_bcopy(data, (void *)BIOS_PADDRTOVADDR(segment + c*32),
+ fontsize);
data += fontsize;
}
}
- set_normal_mode(adp, buf);
+ set_normal_mode(&adapter[ad], buf);
-#ifdef VGA_ALT_SEQACCESS
- if (adp->va_type == KD_VGA) {
+#ifdef SC_ALT_SEQACCESS
+ if (adapter[ad].va_type == KD_VGA) {
s = splhigh();
outb(TSIDX, 0x00); outb(TSREG, 0x01);
outb(TSIDX, 0x01); outb(TSREG, val & 0xdf); /* enable screen */
@@ -1726,9 +1292,6 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
#endif
return 0;
-#else /* VGA_NO_FONT_LOADING */
- return 1;
-#endif /* VGA_NO_FONT_LOADING */
}
/*
@@ -1740,13 +1303,12 @@ vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
* EGA/VGA
*/
static int
-vga_show_font(video_adapter_t *adp, int page)
+vid_show_font(int ad, int page)
{
-#ifndef VGA_NO_FONT_LOADING
static u_char cg[] = { 0x00, 0x05, 0x0a, 0x0f, 0x30, 0x35, 0x3a, 0x3f };
int s;
- prologue(adp, V_ADP_FONT, 1);
+ prologue(ad, V_ADP_FONT, 1);
if (page < 0 || page >= 8)
return 1;
@@ -1755,9 +1317,6 @@ vga_show_font(video_adapter_t *adp, int page)
splx(s);
return 0;
-#else /* VGA_NO_FONT_LOADING */
- return 1;
-#endif /* VGA_NO_FONT_LOADING */
}
/*
@@ -1767,11 +1326,11 @@ vga_show_font(video_adapter_t *adp, int page)
* VGA
*/
static int
-vga_save_palette(video_adapter_t *adp, u_char *palette)
+vid_save_palette(int ad, u_char *palette)
{
int i;
- prologue(adp, V_ADP_PALETTE, 1);
+ prologue(ad, V_ADP_PALETTE, 1);
/*
* We store 8 bit values in the palette buffer, while the standard
@@ -1780,7 +1339,7 @@ vga_save_palette(video_adapter_t *adp, u_char *palette)
outb(PALRADR, 0x00);
for (i = 0; i < 256*3; ++i)
palette[i] = inb(PALDATA) << 2;
- inb(adp->va_crtc_addr + 6); /* reset flip/flop */
+ inb(adapter[ad].va_crtc_addr + 6); /* reset flip/flop */
return 0;
}
@@ -1791,17 +1350,17 @@ vga_save_palette(video_adapter_t *adp, u_char *palette)
* VGA
*/
static int
-vga_load_palette(video_adapter_t *adp, u_char *palette)
+vid_load_palette(int ad, u_char *palette)
{
int i;
- prologue(adp, V_ADP_PALETTE, 1);
+ prologue(ad, V_ADP_PALETTE, 1);
outb(PIXMASK, 0xff); /* no pixelmask */
outb(PALWADR, 0x00);
for (i = 0; i < 256*3; ++i)
outb(PALDATA, palette[i] >> 2);
- inb(adp->va_crtc_addr + 6); /* reset flip/flop */
+ inb(adapter[ad].va_crtc_addr + 6); /* reset flip/flop */
outb(ATC, 0x20); /* enable palette */
return 0;
}
@@ -1813,18 +1372,18 @@ vga_load_palette(video_adapter_t *adp, u_char *palette)
* CGA/EGA/VGA
*/
static int
-vga_set_border(video_adapter_t *adp, int color)
+vid_set_border(int ad, int color)
{
- prologue(adp, V_ADP_BORDER, 1);
+ prologue(ad, V_ADP_BORDER, 1);
- switch (adp->va_type) {
+ switch (adapter[ad].va_type) {
case KD_EGA:
case KD_VGA:
- inb(adp->va_crtc_addr + 6); /* reset flip-flop */
+ inb(adapter[ad].va_crtc_addr + 6); /* reset flip-flop */
outb(ATC, 0x31); outb(ATC, color & 0xff);
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 5, color & 0x0f); /* color select register */
+ outb(adapter[ad].va_crtc_addr + 5, color & 0x0f); /* color select register */
break;
case KD_MONO:
case KD_HERCULES:
@@ -1843,7 +1402,7 @@ vga_set_border(video_adapter_t *adp, int color)
* VGA
*/
static int
-vga_save_state(video_adapter_t *adp, void *p, size_t size)
+vid_save_state(int ad, void *p, size_t size)
{
video_info_t info;
u_char *buf;
@@ -1853,10 +1412,10 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size)
if (size == 0) {
/* return the required buffer size */
- prologue(adp, V_ADP_STATESAVE, 0);
+ prologue(ad, V_ADP_STATESAVE, 0);
return sizeof(adp_state_t);
} else {
- prologue(adp, V_ADP_STATESAVE, 1);
+ prologue(ad, V_ADP_STATESAVE, 1);
if (size < sizeof(adp_state_t))
return 1;
}
@@ -1864,7 +1423,7 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size)
((adp_state_t *)p)->sig = V_STATE_SIG;
buf = ((adp_state_t *)p)->regs;
bzero(buf, V_MODE_PARAM_SIZE);
- crtc_addr = adp->va_crtc_addr;
+ crtc_addr = adapter[ad].va_crtc_addr;
s = splhigh();
@@ -1895,7 +1454,7 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size)
splx(s);
#if 1
- if (vga_get_info(adp, adp->va_mode, &info) == 0) {
+ if (vid_get_info(ad, adapter[ad].va_mode, &info) == 0) {
if (info.vi_flags & V_INFO_GRAPHICS) {
buf[0] = info.vi_width/info.vi_cwidth; /* COLS */
buf[1] = info.vi_height/info.vi_cheight - 1; /* ROWS */
@@ -1906,15 +1465,15 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size)
buf[2] = info.vi_cheight; /* POINTS */
} else {
/* XXX: shouldn't be happening... */
- printf("vga%d: %s: failed to obtain mode info. (vga_save_state())\n",
- adp->va_unit, adp->va_name);
+ printf("video#%d: failed to obtain mode info. (vid_save_state())\n",
+ ad);
}
#else
- buf[0] = readb(BIOS_PADDRTOVADDR(0x44a)); /* COLS */
- buf[1] = readb(BIOS_PADDRTOVADDR(0x484)); /* ROWS */
- buf[2] = readb(BIOS_PADDRTOVADDR(0x485)); /* POINTS */
- buf[3] = readb(BIOS_PADDRTOVADDR(0x44c));
- buf[4] = readb(BIOS_PADDRTOVADDR(0x44d));
+ buf[0] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a); /* COLS */
+ buf[1] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x484); /* ROWS */
+ buf[2] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x485); /* POINTS */
+ buf[3] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x44c);
+ buf[4] = *(u_int8_t *)BIOS_PADDRTOVADDR(0x44d);
#endif
return 0;
@@ -1929,19 +1488,19 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size)
* EGA/VGA
*/
static int
-vga_load_state(video_adapter_t *adp, void *p)
+vid_load_state(int ad, void *p)
{
u_char *buf;
int crtc_addr;
int s;
int i;
- prologue(adp, V_ADP_STATELOAD, 1);
+ prologue(ad, V_ADP_STATELOAD, 1);
if (((adp_state_t *)p)->sig != V_STATE_SIG)
return 1;
buf = ((adp_state_t *)p)->regs;
- crtc_addr = adp->va_crtc_addr;
+ crtc_addr = adapter[ad].va_crtc_addr;
s = splhigh();
@@ -1970,17 +1529,15 @@ vga_load_state(video_adapter_t *adp, void *p)
inb(crtc_addr + 6); /* reset flip-flop */
outb(ATC, 0x20); /* enable palette */
-#ifndef VGA_NO_BIOS
- if (adp->va_unit == V_ADP_PRIMARY) {
- writeb(BIOS_PADDRTOVADDR(0x44a), buf[0]); /* COLS */
- writeb(BIOS_PADDRTOVADDR(0x484), buf[1] + rows_offset - 1); /* ROWS */
- writeb(BIOS_PADDRTOVADDR(0x485), buf[2]); /* POINTS */
+ if (ad == V_ADP_PRIMARY) {
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a) = buf[0]; /* COLS */
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x484) = buf[1] + rows_offset - 1; /* ROWS */
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x485) = buf[2]; /* POINTS */
#if 0
- writeb(BIOS_PADDRTOVADDR(0x44c), buf[3]);
- writeb(BIOS_PADDRTOVADDR(0x44d), buf[4]);
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44c) = buf[3];
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44d) = buf[4];
#endif
}
-#endif /* VGA_NO_BIOS */
splx(s);
return 0;
@@ -1991,7 +1548,7 @@ vga_load_state(video_adapter_t *adp, void *p)
* Change the origin (window mapping) of the banked frame buffer.
*/
static int
-vga_set_origin(video_adapter_t *adp, off_t offset)
+vid_set_origin(int ad, off_t offset)
{
/*
* The standard video modes do not require window mapping;
@@ -2007,25 +1564,24 @@ vga_set_origin(video_adapter_t *adp, off_t offset)
* all adapters
*/
static int
-vga_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
+vid_read_hw_cursor(int ad, int *col, int *row)
{
video_info_t info;
u_int16_t off;
- int s;
if (!init_done)
return 1;
+ if ((ad < 0) || (ad >= adapters))
+ return 1;
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
+ (*biosvidsw.get_info)(ad, adapter[ad].va_mode, &info);
if (info.vi_flags & V_INFO_GRAPHICS)
return 1;
- s = spltty();
- outb(adp->va_crtc_addr, 14);
- off = inb(adp->va_crtc_addr + 1);
- outb(adp->va_crtc_addr, 15);
- off = (off << 8) | inb(adp->va_crtc_addr + 1);
- splx(s);
+ outb(adapter[ad].va_crtc_addr, 14);
+ off = inb(adapter[ad].va_crtc_addr + 1);
+ outb(adapter[ad].va_crtc_addr, 15);
+ off = (off << 8) | inb(adapter[ad].va_crtc_addr + 1);
*row = off / info.vi_width;
*col = off % info.vi_width;
@@ -2035,113 +1591,96 @@ vga_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
/*
* set_hw_cursor():
- * Move the hardware text cursor. If col and row are both -1,
- * the cursor won't be shown.
+ * Move the hardware text cursor. If the requested position is (-1, -1),
+ * the text cursor won't be shown.
*
* all adapters
*/
static int
-vga_set_hw_cursor(video_adapter_t *adp, int col, int row)
+vid_set_hw_cursor(int ad, int col, int row)
{
video_info_t info;
u_int16_t off;
- int s;
if (!init_done)
return 1;
+ if ((ad < 0) || (ad >= adapters))
+ return 1;
- if ((col == -1) && (row == -1)) {
- off = -1;
- } else {
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
- if (info.vi_flags & V_INFO_GRAPHICS)
- return 1;
- off = row*info.vi_width + col;
- }
+ (*biosvidsw.get_info)(ad, adapter[ad].va_mode, &info);
+ if (info.vi_flags & V_INFO_GRAPHICS)
+ return 1;
- s = spltty();
- outb(adp->va_crtc_addr, 14);
- outb(adp->va_crtc_addr + 1, off >> 8);
- outb(adp->va_crtc_addr, 15);
- outb(adp->va_crtc_addr + 1, off & 0x00ff);
- splx(s);
+ if ((col == -1) || (row == -1))
+ off = 0xffff;
+ else
+ off = row*info.vi_width + col;
+ outb(adapter[ad].va_crtc_addr, 14);
+ outb(adapter[ad].va_crtc_addr + 1, off >> 8);
+ outb(adapter[ad].va_crtc_addr, 15);
+ outb(adapter[ad].va_crtc_addr + 1, off & 0x00ff);
return 0;
}
-/*
- * set_hw_cursor_shape():
- * Change the shape of the hardware text cursor. If the height is
- * zero or negative, the cursor won't be shown.
- *
- * all adapters
- */
-static int
-vga_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
- int celsize, int blink)
+static char
+*adapter_name(int type)
{
- int s;
-
- if (!init_done)
- return 1;
+ static struct {
+ int type;
+ char *name;
+ } names[] = {
+ { KD_MONO, "MDA" },
+ { KD_HERCULES, "Hercules" },
+ { KD_CGA, "CGA" },
+ { KD_EGA, "EGA" },
+ { KD_VGA, "VGA" },
+ { KD_PC98, "PC-98xx" },
+ { -1, "Unknown" },
+ };
+ int i;
- s = spltty();
- switch (adp->va_type) {
- case KD_VGA:
- case KD_CGA:
- case KD_MONO:
- case KD_HERCULES:
- default:
- if (height <= 0) {
- /* make the cursor invisible */
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, 32);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, 0);
- } else {
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, celsize - base - height);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, celsize - base - 1);
- }
- break;
- case KD_EGA:
- if (height <= 0) {
- /* make the cursor invisible */
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, celsize);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, 0);
- } else {
- outb(adp->va_crtc_addr, 10);
- outb(adp->va_crtc_addr + 1, celsize - base - height);
- outb(adp->va_crtc_addr, 11);
- outb(adp->va_crtc_addr + 1, celsize - base);
- }
- break;
- }
- splx(s);
+ for (i = 0; names[i].type != -1; ++i)
+ if (names[i].type == type)
+ break;
+ return names[i].name;
+}
- return 0;
+static void
+dump_adp_info(int ad, video_adapter_t *adp, int level)
+{
+ if (level <= 0)
+ return;
+
+ printf("video#%d: adapter type:%s (%d), flags:0x%x, CRTC:0x%x\n",
+ ad, adapter_name(adp->va_type), adp->va_type,
+ adp->va_flags, adp->va_crtc_addr);
+ printf("video#%d: init mode:%d, bios mode:%d, current mode:%d\n",
+ ad, adp->va_initial_mode, adp->va_initial_bios_mode, adp->va_mode);
+ printf("video#%d: window:0x%x size:%dk gran:%dk, buf:0x%x size:%dk\n",
+ ad,
+ adp->va_window, adp->va_window_size/1024, adp->va_window_gran/1024,
+ adp->va_buffer, adp->va_buffer_size/1024);
}
-/*
- * mmap():
- * Mmap frame buffer.
- *
- * all adapters
- */
-static int
-vga_mmap(video_adapter_t *adp, vm_offset_t offset)
+static void
+dump_mode_info(int ad, video_info_t *info, int level)
{
- if (offset > 0x20000 - PAGE_SIZE)
- return -1;
-#ifdef __i386__
- return i386_btop((VIDEO_BUF_BASE + offset));
-#endif
-#ifdef __alpha__
- return alpha_btop((VIDEO_BUF_BASE + offset));
-#endif
+ if (level <= 0)
+ return;
+
+ printf("video#%d: mode:%d, flags:0x%x ",
+ ad, info->vi_mode, info->vi_flags);
+ if (info->vi_flags & V_INFO_GRAPHICS)
+ printf("G %dx%dx%d, %d plane(s), font:%dx%d, ",
+ info->vi_width, info->vi_height,
+ info->vi_depth, info->vi_planes,
+ info->vi_cwidth, info->vi_cheight);
+ else
+ printf("T %dx%d, font:%dx%d, ",
+ info->vi_width, info->vi_height,
+ info->vi_cwidth, info->vi_cheight);
+ printf("win:0x%x\n", info->vi_window);
}
static void
@@ -2164,75 +1703,72 @@ dump_buffer(u_char *buf, size_t len)
* all adapters
*/
static int
-vga_diag(video_adapter_t *adp, int level)
+vid_diag(int level)
{
-#if FB_DEBUG > 1
video_info_t info;
-#endif
u_char *mp;
+ int ad;
+ int i;
if (!init_done)
return 1;
-#if FB_DEBUG > 1
-#ifndef VGA_NO_BIOS
- printf("vga: RTC equip. code:0x%02x, DCC code:0x%02x\n",
- rtcin(RTC_EQUIPMENT), readb(BIOS_PADDRTOVADDR(0x488)));
- printf("vga: CRTC:0x%x, video option:0x%02x, ",
- readw(BIOS_PADDRTOVADDR(0x463)),
- readb(BIOS_PADDRTOVADDR(0x487)));
- printf("rows:%d, cols:%d, font height:%d\n",
- readb(BIOS_PADDRTOVADDR(0x44a)),
- readb(BIOS_PADDRTOVADDR(0x484)) + 1,
- readb(BIOS_PADDRTOVADDR(0x485)));
-#endif /* VGA_NO_BIOS */
- printf("vga: param table EGA/VGA:%p", video_mode_ptr);
- printf(", CGA/MDA:%p\n", video_mode_ptr2);
- printf("vga: rows_offset:%d\n", rows_offset);
-#endif /* FB_DEBUG > 1 */
-
- fb_dump_adp_info(DRIVER_NAME, adp, level);
-
-#if FB_DEBUG > 1
- if (adp->va_flags & V_ADP_MODECHANGE) {
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
- if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
- continue;
- fb_dump_mode_info(DRIVER_NAME, adp, &bios_vmode[i], level);
- }
- } else {
- vga_get_info(adp, adp->va_initial_mode, &info); /* shouldn't fail */
- fb_dump_mode_info(DRIVER_NAME, adp, &info, level);
+ if (level > 0) {
+ printf("video: RTC equip. code:0x%02x, DCC code:0x%02x\n",
+ rtcin(RTC_EQUIPMENT), *(u_int8_t *)BIOS_PADDRTOVADDR(0x488));
+ printf("video: CRTC:0x%x, video option:0x%02x, ",
+ *(u_int16_t *)BIOS_PADDRTOVADDR(0x463),
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x487));
+ printf("rows:%d, cols:%d, font height:%d\n",
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a),
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x484) + 1,
+ *(u_int8_t *)BIOS_PADDRTOVADDR(0x485));
+ printf("video: param table EGA/VGA:%p, CGA/MDA:%p\n",
+ video_mode_ptr, video_mode_ptr2);
+ printf("video: rows_offset:%d\n", rows_offset);
}
-#endif /* FB_DEBUG > 1 */
-
- if ((adp->va_type != KD_EGA) && (adp->va_type != KD_VGA))
- return 0;
-#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE)
- if (video_mode_ptr == NULL)
- printf("vga%d: %s: WARNING: video mode switching is not "
- "fully supported on this adapter\n",
- adp->va_unit, adp->va_name);
-#endif
- if (level <= 0)
- return 0;
- if (adp->va_type == KD_VGA) {
- printf("VGA parameters upon power-up\n");
- dump_buffer(adpstate.regs, sizeof(adpstate.regs));
- printf("VGA parameters in BIOS for mode %d\n", adp->va_initial_mode);
- dump_buffer(adpstate2.regs, sizeof(adpstate2.regs));
- }
+ for (ad = 0; ad < adapters; ++ad) {
+ dump_adp_info(ad, &adapter[ad], level);
- mp = get_mode_param(adp->va_initial_mode);
- if (mp == NULL) /* this shouldn't be happening */
- return 0;
- printf("EGA/VGA parameters to be used for mode %d\n", adp->va_initial_mode);
- dump_buffer(mp, V_MODE_PARAM_SIZE);
+ if (!(adapter[ad].va_flags & V_ADP_MODECHANGE)) {
+ vid_get_info(ad, adapter[ad].va_initial_mode, &info);
+ dump_mode_info(ad, &info, level);
+ } else {
+ for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
+ if (bios_vmode[i].vi_mode == NA)
+ continue;
+ if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
+ continue;
+ dump_mode_info(ad, &bios_vmode[i], level);
+ }
+ }
+ if ((adapter[ad].va_type != KD_EGA) && (adapter[ad].va_type != KD_VGA))
+ continue;
+
+ if (video_mode_ptr == NULL)
+ printf("video#%d: WARNING: video mode switching is not fully supported on this adapter\n", ad);
+
+ if (level <= 0)
+ continue;
+
+ if (adapter[ad].va_type == KD_VGA) {
+ printf("VGA parameters upon power-up\n");
+ dump_buffer(adpstate.regs, sizeof(adpstate.regs));
+ printf("VGA parameters in BIOS for mode %d\n",
+ adapter[ad].va_initial_mode);
+ dump_buffer(adpstate2.regs, sizeof(adpstate2.regs));
+ }
+
+ mp = get_mode_param(adapter[ad].va_initial_mode);
+ if (mp == NULL) /* this shouldn't be happening */
+ continue;
+ printf("EGA/VGA parameters to be used for mode %d\n",
+ adapter[ad].va_initial_mode);
+ dump_buffer(mp, V_MODE_PARAM_SIZE);
+ }
return 0;
}
-#endif /* NVGA > 0 */
+#endif /* NSC > 0 */
diff --git a/sys/i386/isa/videoio.h b/sys/i386/isa/videoio.h
new file mode 100644
index 0000000000000..a79ffbe97babe
--- /dev/null
+++ b/sys/i386/isa/videoio.h
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id: videoio.h,v 1.1 1998/09/15 18:16:38 sos Exp $
+ */
+
+#ifndef _I386_ISA_VIDEOIO_H_
+#define _I386_ISA_VIDEOIO_H_
+
+#ifdef KERNEL
+
+#define V_MAX_ADAPTERS 2
+
+#define V_MODE_MAP_SIZE (M_VGA_CG320 + 1)
+#define V_MODE_PARAM_SIZE 64
+
+/* physical addresses */
+#define MONO_BUF BIOS_PADDRTOVADDR(0xb0000)
+#define CGA_BUF BIOS_PADDRTOVADDR(0xb8000)
+#define GRAPHICS_BUF BIOS_PADDRTOVADDR(0xa0000)
+#define VIDEOMEM 0x000A0000
+
+/* I/O port addresses */
+#define MONO_BASE 0x3B4 /* crt controller base mono */
+#define COLOR_BASE 0x3D4 /* crt controller base color */
+#define MISC 0x3C2 /* misc output register */
+#define ATC IO_VGA+0x00 /* attribute controller */
+#define TSIDX IO_VGA+0x04 /* timing sequencer idx */
+#define TSREG IO_VGA+0x05 /* timing sequencer data */
+#define PIXMASK IO_VGA+0x06 /* pixel write mask */
+#define PALRADR IO_VGA+0x07 /* palette read address */
+#define PALWADR IO_VGA+0x08 /* palette write address */
+#define PALDATA IO_VGA+0x09 /* palette data register */
+#define GDCIDX IO_VGA+0x0E /* graph data controller idx */
+#define GDCREG IO_VGA+0x0F /* graph data controller data */
+
+/* video function table */
+typedef int vi_init_t(void);
+typedef video_adapter_t *vi_adapter_t(int ad);
+typedef int vi_get_info_t(int ad, int mode, video_info_t *info);
+typedef int vi_query_mode_t(int ad, video_info_t *info);
+typedef int vi_set_mode_t(int ad, int mode);
+typedef int vi_save_font_t(int ad, int page, int size, u_char *data,
+ int c, int count);
+typedef int vi_load_font_t(int ad, int page, int size, u_char *data,
+ int c, int count);
+typedef int vi_show_font_t(int ad, int page);
+typedef int vi_save_palette_t(int ad, u_char *palette);
+typedef int vi_load_palette_t(int ad, u_char *palette);
+typedef int vi_set_border_t(int ad, int border);
+typedef int vi_save_state_t(int ad, void *p, size_t size);
+typedef int vi_load_state_t(int ad, void *p);
+typedef int vi_set_win_org_t(int ad, off_t offset);
+typedef int vi_read_hw_cursor_t(int ad, int *col, int *row);
+typedef int vi_set_hw_cursor_t(int ad, int col, int row);
+typedef int vi_diag_t(int level);
+
+struct vidsw {
+ vi_init_t *init; /* all */
+ vi_adapter_t *adapter; /* all */
+ vi_get_info_t *get_info; /* all */
+ vi_query_mode_t *query_mode; /* all */
+ vi_set_mode_t *set_mode; /* EGA/VGA */
+ vi_save_font_t *save_font; /* EGA/VGA */
+ vi_load_font_t *load_font; /* EGA/VGA */
+ vi_show_font_t *show_font; /* EGA/VGA */
+ vi_save_palette_t *save_palette; /* VGA */
+ vi_load_palette_t *load_palette; /* VGA */
+ vi_set_border_t *set_border; /* CGA/EGA/VGA */
+ vi_save_state_t *save_state; /* VGA */
+ vi_load_state_t *load_state; /* EGA/VGA */
+ vi_set_win_org_t *set_win_org; /* all */
+ vi_read_hw_cursor_t *read_hw_cursor; /* all */
+ vi_set_hw_cursor_t *set_hw_cursor; /* all */
+ vi_diag_t *diag; /* all */
+};
+
+extern struct vidsw biosvidsw;
+
+#endif /* KERNEL */
+
+#endif /* !_I386_ISA_VIDEOIO_H_ */
diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c
new file mode 100644
index 0000000000000..1f22bfc7c8219
--- /dev/null
+++ b/sys/i386/isa/wcd.c
@@ -0,0 +1,1399 @@
+/*
+ * IDE CD-ROM driver for FreeBSD.
+ * Supports ATAPI-compatible drives.
+ *
+ * Copyright (C) 1995 Cronyx Ltd.
+ * Author Serge Vakulenko, <vak@cronyx.ru>
+ *
+ * This software is distributed with NO WARRANTIES, not even the implied
+ * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Authors grant any other persons or organisations permission to use
+ * or modify this software as long as this message is kept with the software,
+ * all derivative works or modified versions.
+ *
+ * From: Version 1.9, Mon Oct 9 20:27:42 MSK 1995
+ * $Id: wcd.c,v 1.58 1998/09/08 20:57:47 sos Exp $
+ */
+
+#include "wdc.h"
+#include "wcd.h"
+#include "opt_atapi.h"
+#include "opt_devfs.h"
+
+#if NWCD > 0 && NWDC > 0 && defined (ATAPI)
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/devicestat.h>
+#include <sys/disklabel.h>
+#include <sys/cdio.h>
+#include <sys/conf.h>
+#include <sys/stat.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+
+#include <i386/isa/atapi.h>
+
+static d_open_t wcdopen;
+static d_read_t wcdread;
+static d_close_t wcdclose;
+static d_ioctl_t wcdioctl;
+static d_strategy_t wcdstrategy;
+
+#define CDEV_MAJOR 69
+#define BDEV_MAJOR 19
+static struct cdevsw wcd_cdevsw =
+ { wcdopen, wcdclose, wcdread, nowrite, /*69*/
+ wcdioctl, nostop, nullreset, nodevtotty,/* atapi */
+ seltrue, nommap, wcdstrategy, "wcd",
+ NULL, -1, nodump, nopsize,
+ D_DISK, 0, -1 };
+
+#ifndef ATAPI_STATIC
+static
+#endif
+int wcdattach(struct atapi*, int, struct atapi_params*, int);
+
+#define NUNIT 16 /* Max. number of devices */
+#define SECSIZE 2048 /* CD-ROM sector size in bytes */
+
+#define F_BOPEN 0x0001 /* The block device is opened */
+#define F_MEDIA_CHANGED 0x0002 /* The media have changed since open */
+#define F_DEBUG 0x0004 /* Print debug info */
+#define F_LOCKED 0x0008 /* This unit is locked (or should be) */
+
+/*
+ * Disc table of contents.
+ */
+#define MAXTRK 99
+struct toc {
+ struct ioc_toc_header hdr;
+ struct cd_toc_entry tab[MAXTRK+1]; /* One extra for the leadout */
+};
+
+/*
+ * Volume size info.
+ */
+struct volinfo {
+ u_long volsize; /* Volume size in blocks */
+ u_long blksize; /* Block size in bytes */
+};
+
+/*
+ * Current subchannel status.
+ */
+struct subchan {
+ u_char void0;
+ u_char audio_status;
+ u_short data_length;
+ u_char data_format;
+ u_char control;
+ u_char track;
+ u_char indx;
+ u_long abslba;
+ u_long rellba;
+};
+
+/*
+ * Audio Control Parameters Page
+ */
+struct audiopage {
+ /* Mode data header */
+ u_short data_length;
+ u_char medium_type;
+ u_char reserved1[5];
+
+ /* Audio control page */
+ u_char page_code;
+#define AUDIO_PAGE 0x0e
+#define AUDIO_PAGE_MASK 0x4e /* changeable values */
+ u_char param_len;
+ u_char flags;
+#define CD_PA_SOTC 0x02 /* mandatory */
+#define CD_PA_IMMED 0x04 /* always 1 */
+ u_char reserved3[3];
+ u_short lb_per_sec;
+ struct port_control {
+ u_char channels : 4;
+#define CHANNEL_0 1 /* mandatory */
+#define CHANNEL_1 2 /* mandatory */
+#define CHANNEL_2 4 /* optional */
+#define CHANNEL_3 8 /* optional */
+ u_char volume;
+ } port[4];
+};
+
+/*
+ * CD-ROM Capabilities and Mechanical Status Page
+ */
+struct cappage {
+ /* Mode data header */
+ u_short data_length;
+ u_char medium_type;
+#define MDT_UNKNOWN 0x00
+#define MDT_DATA_120 0x01
+#define MDT_AUDIO_120 0x02
+#define MDT_COMB_120 0x03
+#define MDT_PHOTO_120 0x04
+#define MDT_DATA_80 0x05
+#define MDT_AUDIO_80 0x06
+#define MDT_COMB_80 0x07
+#define MDT_PHOTO_80 0x08
+#define MDT_NO_DISC 0x70
+#define MDT_DOOR_OPEN 0x71
+#define MDT_FMT_ERROR 0x72
+ u_char reserved1[5];
+
+ /* Capabilities page */
+ u_char page_code;
+#define CAP_PAGE 0x2a
+ u_char param_len;
+ u_char reserved2[2];
+
+ u_int audio_play : 1; /* audio play supported */
+ u_int composite : 1; /* composite audio/video supported */
+ u_int dport1 : 1; /* digital audio on port 1 */
+ u_int dport2 : 1; /* digital audio on port 2 */
+ u_int mode2_form1 : 1; /* mode 2 form 1 (XA) read */
+ u_int mode2_form2 : 1; /* mode 2 form 2 format */
+ u_int multisession : 1; /* multi-session photo-CD */
+ u_int : 1;
+ u_int cd_da : 1; /* audio-CD read supported */
+ u_int cd_da_stream : 1; /* CD-DA streaming */
+ u_int rw : 1; /* combined R-W subchannels */
+ u_int rw_corr : 1; /* R-W subchannel data corrected */
+ u_int c2 : 1; /* C2 error pointers supported */
+ u_int isrc : 1; /* can return the ISRC info */
+ u_int upc : 1; /* can return the catalog number UPC */
+ u_int : 1;
+ u_int lock : 1; /* could be locked */
+ u_int locked : 1; /* current lock state */
+ u_int prevent : 1; /* prevent jumper installed */
+ u_int eject : 1; /* can eject */
+ u_int : 1;
+ u_int mech : 3; /* loading mechanism type */
+#define MECH_CADDY 0
+#define MECH_TRAY 1
+#define MECH_POPUP 2
+#define MECH_CHANGER 4
+#define MECH_CARTRIDGE 5
+ u_int sep_vol : 1; /* independent volume of channels */
+ u_int sep_mute : 1; /* independent mute of channels */
+ u_int : 6;
+
+ u_short max_speed; /* max raw data rate in bytes/1000 */
+ u_short max_vol_levels; /* number of discrete volume levels */
+ u_short buf_size; /* internal buffer size in bytes/1024 */
+ u_short cur_speed; /* current data rate in bytes/1000 */
+
+ /* Digital drive output format description (optional?) */
+ u_char reserved3;
+ u_int bckf : 1; /* data valid on failing edge of BCK */
+ u_int rch : 1; /* high LRCK indicates left channel */
+ u_int lsbf : 1; /* set if LSB first */
+ u_int dlen: 2;
+#define DLEN_32 0 /* 32 BCKs */
+#define DLEN_16 1 /* 16 BCKs */
+#define DLEN_24 2 /* 24 BCKs */
+#define DLEN_24_I2S 3 /* 24 BCKs (I2S) */
+ u_int : 3;
+ u_char reserved4[2];
+};
+
+/*
+ * CDROM changer mechanism status structure
+ */
+struct changer {
+ u_int current_slot : 5; /* active changer slot */
+ u_int mech_state : 2; /* current changer state */
+#define CH_READY 0
+#define CH_LOADING 1
+#define CH_UNLOADING 2
+#define CH_INITIALIZING 3
+ u_int fault : 1; /* fault in last operation */
+ u_int reserved0 : 5;
+ u_int cd_state : 3; /* current mechanism state */
+#define CD_IDLE 0
+#define CD_AUDIO_ACTIVE 1
+#define CD_AUDIO_SCAN 2
+#define CD_HOST_ACTIVE 3
+#define CD_NO_STATE 7
+ u_char current_lba[3]; /* current LBA */
+ u_char slots; /* number of available slots */
+ u_short table_length; /* slot table length */
+ struct {
+ u_int changed : 1; /* media has changed in this slot */
+ u_int unused : 6;
+ u_int present : 1; /* slot has a CD present */
+ u_char reserved0;
+ u_char reserved1;
+ u_char reserved2;
+ } slot[32];
+};
+
+struct wcd {
+ struct atapi *ata; /* Controller structure */
+ int unit; /* IDE bus drive unit */
+ int lun; /* Logical device unit */
+ int flags; /* Device state flags */
+ int refcnt; /* The number of raw opens */
+ struct buf_queue_head buf_queue;/* Queue of i/o requests */
+ struct atapi_params *param; /* Drive parameters table */
+ struct toc toc; /* Table of disc contents */
+ struct volinfo info; /* Volume size info */
+ struct audiopage au; /* Audio page info */
+ struct cappage cap; /* Capabilities page info */
+ struct audiopage aumask; /* Audio page mask */
+ struct subchan subchan; /* Subchannel info */
+ char description[80]; /* Device description */
+ struct changer *changer_info; /* changer info */
+ int slot; /* this lun's slot number */
+ struct devstat device_stats; /* devstat parameters */
+#ifdef DEVFS
+ void *ra_devfs_token;
+ void *rc_devfs_token;
+ void *a_devfs_token;
+ void *c_devfs_token;
+#endif
+};
+
+static struct wcd *wcdtab[NUNIT]; /* Drive info by unit number */
+static int wcdnlun = 0; /* Number of configured drives */
+
+static struct wcd *wcd_init_lun(struct atapi *ata, int unit,
+ struct atapi_params *ap, int lun);
+static void wcd_start (struct wcd *t);
+static void wcd_done (struct wcd *t, struct buf *bp, int resid,
+ struct atapires result);
+static void wcd_error (struct wcd *t, struct atapires result);
+static int wcd_read_toc (struct wcd *t);
+static int wcd_request_wait (struct wcd *t, u_char cmd, u_char a1, u_char a2,
+ u_char a3, u_char a4, u_char a5, u_char a6, u_char a7, u_char a8,
+ u_char a9, char *addr, int count);
+static void wcd_describe (struct wcd *t);
+static int wcd_setchan (struct wcd *t,
+ u_char c0, u_char c1, u_char c2, u_char c3);
+static int wcd_eject (struct wcd *t, int closeit);
+static void wcd_select_slot(struct wcd *cdp);
+
+/*
+ * Dump the array in hexadecimal format for debugging purposes.
+ */
+static void wcd_dump (int lun, char *label, void *data, int len)
+{
+ u_char *p = data;
+
+ printf ("wcd%d: %s %x", lun, label, *p++);
+ while (--len > 0)
+ printf ("-%x", *p++);
+ printf ("\n");
+}
+
+struct wcd *
+wcd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun)
+{
+ struct wcd *ptr;
+ ptr = malloc(sizeof(struct wcd), M_TEMP, M_NOWAIT);
+ if (!ptr)
+ return NULL;
+ bzero(ptr, sizeof(struct wcd));
+ bufq_init(&ptr->buf_queue);
+ ptr->ata = ata;
+ ptr->unit = unit;
+ ptr->lun = lun;
+ ptr->param = ap;
+ ptr->flags = F_MEDIA_CHANGED;
+ ptr->refcnt = 0;
+ ptr->slot = -1;
+ ptr->changer_info = NULL;
+#ifdef DEVFS
+ ptr->ra_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, 0),
+ DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
+ "rwcd%da", lun);
+ ptr->rc_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ DV_CHR, UID_ROOT, GID_OPERATOR, 0640,
+ "rwcd%dc", lun);
+ ptr->a_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, 0),
+ DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
+ "wcd%da", lun);
+ ptr->c_devfs_token =
+ devfs_add_devswf(&wcd_cdevsw, dkmakeminor(lun, 0, RAW_PART),
+ DV_BLK, UID_ROOT, GID_OPERATOR, 0640,
+ "wcd%dc", lun);
+#endif
+ /*
+ * Export the unit to the devstat interface.
+ */
+ devstat_add_entry(&ptr->device_stats, "wcd",
+ lun, SECSIZE,
+ DEVSTAT_NO_ORDERED_TAGS,
+ DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE);
+ return ptr;
+}
+
+#ifndef ATAPI_STATIC
+static
+#endif
+int
+wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug)
+{
+ struct wcd *cdp;
+ struct atapires result;
+ struct changer *chp;
+ int i;
+
+ if (wcdnlun >= NUNIT) {
+ printf ("wcd: too many units\n");
+ return (0);
+ }
+ if (!atapi_request_immediate) {
+ printf("wcd: configuration error, ATAPI core code not present!\n");
+ printf("wcd: check `options ATAPI_STATIC' in your kernel config file!\n");
+ return (0);
+ }
+ if ((cdp = wcd_init_lun(ata, unit, ap, wcdnlun)) == NULL) {
+ printf("wcd: out of memory\n");
+ return 0;
+ }
+ wcdtab[wcdnlun] = cdp;
+
+ if (debug) {
+ cdp->flags |= F_DEBUG;
+ /* Print params. */
+ wcd_dump (cdp->lun, "info", ap, sizeof *ap);
+ }
+
+ /* Get drive capabilities. */
+ result = atapi_request_immediate (ata, unit, ATAPI_MODE_SENSE,
+ 0, CAP_PAGE, 0, 0, 0, 0, sizeof (cdp->cap) >> 8, sizeof (cdp->cap),
+ 0, 0, 0, 0, 0, 0, 0, (char*) &cdp->cap, sizeof (cdp->cap));
+
+ /* Do it twice to avoid the stale media changed state. */
+ if (result.code == RES_ERR &&
+ (result.error & AER_SKEY) == AER_SK_UNIT_ATTENTION)
+ result = atapi_request_immediate (ata, unit, ATAPI_MODE_SENSE,
+ 0, CAP_PAGE, 0, 0, 0, 0, sizeof (cdp->cap) >> 8,
+ sizeof (cdp->cap), 0, 0, 0, 0, 0, 0, 0,
+ (char*) &cdp->cap, sizeof (cdp->cap));
+
+ /* Some drives have shorter capabilities page. */
+ if (result.code == RES_UNDERRUN)
+ result.code = 0;
+
+ if (result.code == 0) {
+ wcd_describe (cdp);
+ if (cdp->flags & F_DEBUG)
+ wcd_dump (cdp->lun, "cap", &cdp->cap, sizeof(cdp->cap));
+ }
+
+ /* If this is a changer device, allocate the neeeded lun's */
+ if (cdp->cap.mech == MECH_CHANGER) {
+ chp = malloc(sizeof(struct changer), M_TEMP, M_NOWAIT);
+ if (chp == NULL) {
+ printf("wcd: out of memory\n");
+ return 0;
+ }
+ bzero(chp, sizeof(struct changer));
+ result = atapi_request_immediate(ata, unit, ATAPI_MECH_STATUS,
+ 0, 0, 0, 0, 0, 0, 0,
+ sizeof(struct changer)> 8, sizeof(struct changer),
+ 0, 0, 0, 0, 0, 0,
+ (char*) chp, sizeof(struct changer));
+ if (cdp->flags & F_DEBUG) {
+ printf("result.code=%d curr=%02x slots=%d len=%d\n",
+ result.code, chp->current_slot, chp->slots,
+ htons(chp->table_length));
+ }
+ if (result.code == RES_UNDERRUN)
+ result.code = 0;
+ if (result.code == 0) {
+ chp->table_length = htons(chp->table_length);
+ for (i=0; i<chp->slots && wcdnlun<NUNIT; i++) {
+ if (i>0) {
+ cdp = wcd_init_lun(ata,unit,ap,wcdnlun);
+ if (cdp == NULL) {
+ printf("wcd: out of memory\n");
+ return 0;
+ }
+ }
+ cdp->slot = i;
+ cdp->changer_info = chp;
+ printf("wcd%d: changer slot %d %s\n",
+ wcdnlun,
+ i, (chp->slot[i].present ?
+ "disk present" : "no disk"));
+ wcdtab[wcdnlun++] = cdp;
+ }
+ if (wcdnlun >= NUNIT) {
+ printf ("wcd: too many units\n");
+ return (0);
+ }
+ }
+ }
+ else
+ wcdnlun++;
+ return (1);
+}
+
+void wcd_describe (struct wcd *t)
+{
+ char *m;
+
+ t->cap.max_speed = ntohs (t->cap.max_speed);
+ t->cap.max_vol_levels = ntohs (t->cap.max_vol_levels);
+ t->cap.buf_size = ntohs (t->cap.buf_size);
+ t->cap.cur_speed = ntohs (t->cap.cur_speed);
+
+ printf ("wcd%d: ", t->lun);
+ if (t->cap.cur_speed != t->cap.max_speed)
+ printf ("%d/", t->cap.cur_speed * 1000 / 1024);
+ printf ("%dKb/sec", t->cap.max_speed * 1000 / 1024);
+ if (t->cap.buf_size)
+ printf (", %dKb cache", t->cap.buf_size);
+
+ if (t->cap.audio_play)
+ printf (", audio play");
+ if (t->cap.max_vol_levels)
+ printf (", %d volume levels", t->cap.max_vol_levels);
+
+ switch (t->cap.mech) {
+ default: m = 0; break;
+ case MECH_CADDY: m = "caddy"; break;
+ case MECH_TRAY: m = "tray"; break;
+ case MECH_POPUP: m = "popup"; break;
+ case MECH_CHANGER: m = "changer"; break;
+ case MECH_CARTRIDGE: m = "cartridge"; break;
+ }
+ if (m)
+ printf (", %s%s", t->cap.eject ? "ejectable " : "", m);
+ else if (t->cap.eject)
+ printf (", eject");
+ printf ("\n");
+
+ if (t->cap.mech != MECH_CHANGER) {
+ printf ("wcd%d: ", t->lun);
+ switch (t->cap.medium_type) {
+ case MDT_UNKNOWN:
+ printf ("medium type unknown"); break;
+ case MDT_DATA_120:
+ printf ("120mm data disc loaded"); break;
+ case MDT_AUDIO_120:
+ printf ("120mm audio disc loaded"); break;
+ case MDT_COMB_120:
+ printf ("120mm data/audio disc loaded"); break;
+ case MDT_PHOTO_120:
+ printf ("120mm photo disc loaded"); break;
+ case MDT_DATA_80:
+ printf ("80mm data disc loaded"); break;
+ case MDT_AUDIO_80:
+ printf ("80mm audio disc loaded"); break;
+ case MDT_COMB_80:
+ printf ("80mm data/audio disc loaded"); break;
+ case MDT_PHOTO_80:
+ printf ("80mm photo disc loaded"); break;
+ case MDT_NO_DISC:
+ printf ("no disc inside"); break;
+ case MDT_DOOR_OPEN:
+ printf ("door open"); break;
+ case MDT_FMT_ERROR:
+ printf ("medium format error"); break;
+ default:
+ printf ("medium type=0x%x", t->cap.medium_type); break;
+ }
+ }
+ if (t->cap.lock)
+ printf (t->cap.locked ? ", locked" : ", unlocked");
+ if (t->cap.prevent)
+ printf (", lock protected");
+ printf ("\n");
+}
+
+static int
+wcdopen (dev_t dev, int flags, int fmt, struct proc *p)
+{
+ int lun = dkunit(dev);
+ struct wcd *t;
+
+ /* Check device number is legal and ATAPI driver is loaded. */
+ if (lun >= wcdnlun || ! atapi_request_immediate)
+ return (ENXIO);
+ t = wcdtab[lun];
+ /* On the first open, read the table of contents. */
+ if (! (t->flags & F_BOPEN) && ! t->refcnt) {
+ /* Read table of contents. */
+ if (wcd_read_toc (t) < 0)
+ return (EIO);
+
+ /* Lock the media. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ t->flags |= F_LOCKED;
+ }
+ if (fmt == S_IFCHR)
+ ++t->refcnt;
+ else
+ t->flags |= F_BOPEN;
+ return (0);
+}
+
+/*
+ * Close the device. Only called if we are the LAST
+ * occurence of an open device.
+ */
+static int
+wcdclose (dev_t dev, int flags, int fmt, struct proc *p)
+{
+ int lun = dkunit(dev);
+ struct wcd *t = wcdtab[lun];
+
+ if (fmt == S_IFBLK) {
+ /* If we were the last open of the entire device, release it. */
+ if (! t->refcnt)
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ t->flags &= ~(F_BOPEN|F_LOCKED);
+ } else {
+ /* If we were the last open of the entire device, release it. */
+ if (! (t->flags & F_BOPEN) && t->refcnt == 1)
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ t->flags &= ~F_LOCKED;
+ --t->refcnt;
+ }
+ return (0);
+}
+
+static int
+wcdread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(wcdstrategy, NULL, dev, 1, minphys, uio));
+}
+
+/*
+ * Actually translate the requested transfer into one the physical driver can
+ * understand. The transfer is described by a buf and will include only one
+ * physical transfer.
+ */
+void wcdstrategy (struct buf *bp)
+{
+ int lun = dkunit(bp->b_dev);
+ struct wcd *t = wcdtab[lun];
+ int x;
+
+ /* Can't ever write to a CD. */
+ if (! (bp->b_flags & B_READ)) {
+ bp->b_error = EROFS;
+ bp->b_flags |= B_ERROR;
+ biodone (bp);
+ return;
+ }
+
+ /* If it's a null transfer, return immediatly. */
+ if (bp->b_bcount == 0) {
+ bp->b_resid = 0;
+ biodone (bp);
+ return;
+ }
+
+ /* Process transfer request. */
+ bp->b_pblkno = bp->b_blkno;
+ bp->b_resid = bp->b_bcount;
+ x = splbio();
+
+ /* Place it in the queue of disk activities for this disk. */
+ bufqdisksort (&t->buf_queue, bp);
+
+ /* Tell the device to get going on the transfer if it's
+ * not doing anything, otherwise just wait for completion. */
+ wcd_start (t);
+ splx(x);
+}
+
+/*
+ * Look to see if there is a buf waiting for the device
+ * and that the device is not already busy. If both are true,
+ * It dequeues the buf and creates an ATAPI command to perform the
+ * transfer in the buf.
+ * The bufs are queued by the strategy routine (wcdstrategy).
+ * Must be called at the correct (splbio) level.
+ */
+static void wcd_start (struct wcd *t)
+{
+ struct buf *bp = bufq_first(&t->buf_queue);
+ u_long blkno, nblk;
+
+ /* See if there is a buf to do and we are not already doing one. */
+ if (! bp)
+ return;
+
+ /* Unqueue the request. */
+ bufq_remove(&t->buf_queue, bp);
+
+ /* Should reject all queued entries if media have changed. */
+ if (t->flags & F_MEDIA_CHANGED) {
+ bp->b_error = EIO;
+ bp->b_flags |= B_ERROR;
+ biodone (bp);
+ return;
+ }
+
+ /* Tell devstat we are starting on the transaction */
+ devstat_start_transaction(&t->device_stats);
+
+ wcd_select_slot(t);
+
+ /* We have a buf, now we should make a command
+ * First, translate the block to absolute and put it in terms of the
+ * logical blocksize of the device.
+ * What if something asks for 512 bytes not on a 2k boundary? */
+ blkno = bp->b_blkno / (SECSIZE / 512);
+ nblk = (bp->b_bcount + (SECSIZE - 1)) / SECSIZE;
+
+ atapi_request_callback (t->ata, t->unit, ATAPI_READ_BIG, 0,
+ blkno>>24, blkno>>16, blkno>>8, blkno, 0, nblk>>8, nblk, 0, 0,
+ 0, 0, 0, 0, 0, (u_char*) bp->b_data, bp->b_bcount,
+ wcd_done, t, bp);
+}
+
+static void wcd_done (struct wcd *t, struct buf *bp, int resid,
+ struct atapires result)
+{
+ if (result.code) {
+ wcd_error (t, result);
+ bp->b_error = EIO;
+ bp->b_flags |= B_ERROR;
+ } else
+ bp->b_resid = resid;
+
+ /* Tell devstat we have finished with the transaction */
+ devstat_end_transaction(&t->device_stats,
+ bp->b_bcount - bp->b_resid,
+ DEVSTAT_TAG_NONE,
+ (bp->b_flags & B_READ) ? DEVSTAT_READ : DEVSTAT_WRITE);
+ biodone (bp);
+ wcd_start (t);
+}
+
+static void wcd_error (struct wcd *t, struct atapires result)
+{
+ if (result.code != RES_ERR)
+ return;
+ switch (result.error & AER_SKEY) {
+ case AER_SK_NOT_READY:
+ if (result.error & ~AER_SKEY) {
+ /* Audio disc. */
+ printf ("wcd%d: cannot read audio disc\n", t->lun);
+ return;
+ }
+ /* Tray open. */
+ if (! (t->flags & F_MEDIA_CHANGED))
+ printf ("wcd%d: tray open\n", t->lun);
+ t->flags |= F_MEDIA_CHANGED;
+ return;
+
+ case AER_SK_UNIT_ATTENTION:
+ /* Media changed. */
+ if (! (t->flags & F_MEDIA_CHANGED))
+ printf ("wcd%d: media changed\n", t->lun);
+ t->flags |= F_MEDIA_CHANGED;
+ return;
+
+ case AER_SK_ILLEGAL_REQUEST:
+ /* Unknown command or invalid command arguments. */
+ if (t->flags & F_DEBUG)
+ printf ("wcd%d: invalid command\n", t->lun);
+ return;
+ }
+ printf ("wcd%d: i/o error, status=%b, error=%b\n", t->lun,
+ result.status, ARS_BITS, result.error, AER_BITS);
+}
+
+static int wcd_request_wait (struct wcd *t, u_char cmd, u_char a1, u_char a2,
+ u_char a3, u_char a4, u_char a5, u_char a6, u_char a7, u_char a8,
+ u_char a9, char *addr, int count)
+{
+ struct atapires result;
+
+ result = atapi_request_wait (t->ata, t->unit, cmd,
+ a1, a2, a3, a4, a5, a6, a7, a8, a9, 0, 0, 0, 0, 0, 0,
+ addr, count);
+ if (result.code) {
+ wcd_error (t, result);
+ return (EIO);
+ }
+ return (0);
+}
+
+static __inline void lba2msf (int lba, u_char *m, u_char *s, u_char *f)
+{
+ lba += 150; /* offset of first logical frame */
+ lba &= 0xffffff; /* negative lbas use only 24 bits */
+ *m = lba / (60 * 75);
+ lba %= (60 * 75);
+ *s = lba / 75;
+ *f = lba % 75;
+}
+
+/*
+ * Perform special action on behalf of the user.
+ * Knows about the internals of this device
+ */
+int wcdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
+{
+ int lun = dkunit(dev);
+ struct wcd *t = wcdtab[lun];
+ int error = 0;
+
+ if (t->flags & F_MEDIA_CHANGED)
+ switch (cmd) {
+ case CDIOCSETDEBUG:
+ case CDIOCCLRDEBUG:
+ case CDIOCRESET:
+ /* These ops are media change transparent. */
+ break;
+ default:
+ /* Read table of contents. */
+ wcd_read_toc (t);
+
+ /* Lock the media. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ t->flags |= F_LOCKED;
+ break;
+ }
+ switch (cmd) {
+ default:
+ return (ENOTTY);
+
+ case CDIOCSETDEBUG:
+ if (p->p_cred->pc_ucred->cr_uid)
+ return (EPERM);
+ t->flags |= F_DEBUG;
+ atapi_debug (t->ata, 1);
+ return 0;
+
+ case CDIOCCLRDEBUG:
+ if (p->p_cred->pc_ucred->cr_uid)
+ return (EPERM);
+ t->flags &= ~F_DEBUG;
+ atapi_debug (t->ata, 0);
+ return 0;
+
+ case CDIOCRESUME:
+ return wcd_request_wait (t, ATAPI_PAUSE,
+ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0);
+
+ case CDIOCPAUSE:
+ return wcd_request_wait (t, ATAPI_PAUSE,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCSTART:
+ return wcd_request_wait (t, ATAPI_START_STOP,
+ 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCSTOP:
+ return wcd_request_wait (t, ATAPI_START_STOP,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCALLOW:
+ wcd_select_slot(t);
+ t->flags &= ~F_LOCKED;
+ return wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCPREVENT:
+ wcd_select_slot(t);
+ t->flags |= F_LOCKED;
+ return wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCRESET:
+ if (p->p_cred->pc_ucred->cr_uid)
+ return (EPERM);
+ return wcd_request_wait (t, ATAPI_TEST_UNIT_READY,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ case CDIOCEJECT:
+ /* Don't allow eject if the device is opened
+ * by somebody (not us) in block mode. */
+ if ((t->flags & F_BOPEN) && t->refcnt)
+ return (EBUSY);
+ return wcd_eject (t, 0);
+
+ case CDIOCCLOSE:
+ if ((t->flags & F_BOPEN) && t->refcnt)
+ return (0);
+ return wcd_eject (t, 1);
+
+ case CDIOREADTOCHEADER:
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+ bcopy (&t->toc.hdr, addr, sizeof t->toc.hdr);
+ break;
+
+ case CDIOREADTOCENTRYS: {
+ struct ioc_read_toc_entry *te =
+ (struct ioc_read_toc_entry*) addr;
+ struct toc *toc = &t->toc;
+ struct toc buf;
+ u_long len;
+ u_char starting_track = te->starting_track;
+
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+
+ if ( te->data_len < sizeof(toc->tab[0])
+ || (te->data_len % sizeof(toc->tab[0])) != 0
+ || te->address_format != CD_MSF_FORMAT
+ && te->address_format != CD_LBA_FORMAT
+ )
+ return EINVAL;
+
+ if (starting_track == 0)
+ starting_track = toc->hdr.starting_track;
+ else if (starting_track == 170) /* Handle leadout request */
+ starting_track = toc->hdr.ending_track + 1;
+ else if (starting_track < toc->hdr.starting_track ||
+ starting_track > toc->hdr.ending_track + 1)
+ return (EINVAL);
+
+ len = ((toc->hdr.ending_track + 1 - starting_track) + 1) *
+ sizeof(toc->tab[0]);
+ if (te->data_len < len)
+ len = te->data_len;
+ if (len > sizeof(toc->tab))
+ return EINVAL;
+
+ /* Convert to MSF format, if needed. */
+ if (te->address_format == CD_MSF_FORMAT) {
+ struct cd_toc_entry *e;
+
+ buf = t->toc;
+ toc = &buf;
+ e = toc->tab + (toc->hdr.ending_track + 1 -
+ toc->hdr.starting_track) + 1;
+ while (--e >= toc->tab)
+ lba2msf (ntohl(e->addr.lba), &e->addr.msf.minute,
+ &e->addr.msf.second, &e->addr.msf.frame);
+ }
+ return copyout (toc->tab + starting_track -
+ toc->hdr.starting_track, te->data, len);
+ }
+ case CDIOREADTOCENTRY: {
+ struct ioc_read_toc_single_entry *te =
+ (struct ioc_read_toc_single_entry*) addr;
+ struct toc *toc = &t->toc;
+ struct toc buf;
+ u_char track = te->track;
+
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+
+ if (te->address_format != CD_MSF_FORMAT
+ && te->address_format != CD_LBA_FORMAT)
+ return EINVAL;
+
+ if (track == 0)
+ track = toc->hdr.starting_track;
+ else if (track == 170) /* Handle leadout request */
+ track = toc->hdr.ending_track + 1;
+ else if (track < toc->hdr.starting_track ||
+ track > toc->hdr.ending_track + 1)
+ return (EINVAL);
+
+ /* Convert to MSF format, if needed. */
+ if (te->address_format == CD_MSF_FORMAT) {
+ struct cd_toc_entry *e;
+
+ buf = t->toc;
+ toc = &buf;
+ e = toc->tab + (track - toc->hdr.starting_track);
+ lba2msf (ntohl(e->addr.lba), &e->addr.msf.minute,
+ &e->addr.msf.second, &e->addr.msf.frame);
+ }
+ bcopy(toc->tab + track - toc->hdr.starting_track,
+ &te->entry, sizeof(struct cd_toc_entry));
+ }
+ case CDIOCREADSUBCHANNEL: {
+ struct ioc_read_subchannel *args =
+ (struct ioc_read_subchannel*) addr;
+ struct cd_sub_channel_info data;
+ u_long len = args->data_len;
+ int abslba, rellba;
+
+ if (len > sizeof(data) ||
+ len < sizeof(struct cd_sub_channel_header))
+ return (EINVAL);
+
+ if (wcd_request_wait (t, ATAPI_READ_SUBCHANNEL, 0, 0x40, 1, 0,
+ 0, 0, sizeof (t->subchan) >> 8, sizeof (t->subchan),
+ 0, (char*)&t->subchan, sizeof (t->subchan)) != 0)
+ return (EIO);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "subchan", &t->subchan, sizeof t->subchan);
+
+ abslba = t->subchan.abslba;
+ rellba = t->subchan.rellba;
+ if (args->address_format == CD_MSF_FORMAT) {
+ lba2msf (ntohl(abslba),
+ &data.what.position.absaddr.msf.minute,
+ &data.what.position.absaddr.msf.second,
+ &data.what.position.absaddr.msf.frame);
+ lba2msf (ntohl(rellba),
+ &data.what.position.reladdr.msf.minute,
+ &data.what.position.reladdr.msf.second,
+ &data.what.position.reladdr.msf.frame);
+ } else {
+ data.what.position.absaddr.lba = abslba;
+ data.what.position.reladdr.lba = rellba;
+ }
+ data.header.audio_status = t->subchan.audio_status;
+ data.what.position.control = t->subchan.control & 0xf;
+ data.what.position.addr_type = t->subchan.control >> 4;
+ data.what.position.track_number = t->subchan.track;
+ data.what.position.index_number = t->subchan.indx;
+
+ return copyout (&data, args->data, len);
+ }
+ case CDIOCPLAYMSF: {
+ struct ioc_play_msf *args = (struct ioc_play_msf*) addr;
+
+ return wcd_request_wait (t, ATAPI_PLAY_MSF, 0, 0,
+ args->start_m, args->start_s, args->start_f,
+ args->end_m, args->end_s, args->end_f, 0, 0, 0);
+ }
+ case CDIOCPLAYBLOCKS: {
+ struct ioc_play_blocks *args = (struct ioc_play_blocks*) addr;
+
+ return wcd_request_wait (t, ATAPI_PLAY_BIG, 0,
+ args->blk >> 24 & 0xff, args->blk >> 16 & 0xff,
+ args->blk >> 8 & 0xff, args->blk & 0xff,
+ args->len >> 24 & 0xff, args->len >> 16 & 0xff,
+ args->len >> 8 & 0xff, args->len & 0xff, 0, 0);
+ }
+ case CDIOCPLAYTRACKS: {
+ struct ioc_play_track *args = (struct ioc_play_track*) addr;
+ u_long start, len;
+ int t1, t2;
+
+ if (! t->toc.hdr.ending_track)
+ return (EIO);
+
+ /* Ignore index fields,
+ * play from start_track to end_track inclusive. */
+ if (args->end_track < t->toc.hdr.ending_track+1)
+ ++args->end_track;
+ if (args->end_track > t->toc.hdr.ending_track+1)
+ args->end_track = t->toc.hdr.ending_track+1;
+ t1 = args->start_track - t->toc.hdr.starting_track;
+ t2 = args->end_track - t->toc.hdr.starting_track;
+ if (t1 < 0 || t2 < 0)
+ return (EINVAL);
+ start = ntohl(t->toc.tab[t1].addr.lba);
+ len = ntohl(t->toc.tab[t2].addr.lba) - start;
+
+ return wcd_request_wait (t, ATAPI_PLAY_BIG, 0,
+ start >> 24 & 0xff, start >> 16 & 0xff,
+ start >> 8 & 0xff, start & 0xff,
+ len >> 24 & 0xff, len >> 16 & 0xff,
+ len >> 8 & 0xff, len & 0xff, 0, 0);
+ }
+ case CDIOCGETVOL: {
+ struct ioc_vol *arg = (struct ioc_vol*) addr;
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0, AUDIO_PAGE,
+ 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au), 0,
+ (char*) &t->au, sizeof (t->au));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "au", &t->au, sizeof t->au);
+ if (t->au.page_code != AUDIO_PAGE)
+ return (EIO);
+ arg->vol[0] = t->au.port[0].volume;
+ arg->vol[1] = t->au.port[1].volume;
+ arg->vol[2] = t->au.port[2].volume;
+ arg->vol[3] = t->au.port[3].volume;
+ break;
+ }
+ case CDIOCSETVOL: {
+ struct ioc_vol *arg = (struct ioc_vol*) addr;
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0, AUDIO_PAGE,
+ 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au), 0,
+ (char*) &t->au, sizeof (t->au));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "au", &t->au, sizeof t->au);
+ if (t->au.page_code != AUDIO_PAGE)
+ return (EIO);
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0,
+ AUDIO_PAGE_MASK, 0, 0, 0, 0, sizeof (t->aumask) >> 8,
+ sizeof (t->aumask), 0, (char*) &t->aumask,
+ sizeof (t->aumask));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "mask", &t->aumask, sizeof t->aumask);
+
+ /* Sony-55E requires the data length field to be zeroed. */
+ t->au.data_length = 0;
+
+ t->au.port[0].channels = CHANNEL_0;
+ t->au.port[1].channels = CHANNEL_1;
+ t->au.port[0].volume = arg->vol[0] & t->aumask.port[0].volume;
+ t->au.port[1].volume = arg->vol[1] & t->aumask.port[1].volume;
+ t->au.port[2].volume = arg->vol[2] & t->aumask.port[2].volume;
+ t->au.port[3].volume = arg->vol[3] & t->aumask.port[3].volume;
+ return wcd_request_wait (t, ATAPI_MODE_SELECT, 0x10,
+ 0, 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au),
+ 0, (char*) &t->au, - sizeof (t->au));
+ }
+ case CDIOCSETPATCH: {
+ struct ioc_patch *arg = (struct ioc_patch*) addr;
+
+ return wcd_setchan (t, arg->patch[0], arg->patch[1],
+ arg->patch[2], arg->patch[3]);
+ }
+ case CDIOCSETMONO:
+ return wcd_setchan (t, CHANNEL_0 | CHANNEL_1,
+ CHANNEL_0 | CHANNEL_1, 0, 0);
+
+ case CDIOCSETSTERIO:
+ return wcd_setchan (t, CHANNEL_0, CHANNEL_1, 0, 0);
+
+ case CDIOCSETMUTE:
+ return wcd_setchan (t, 0, 0, 0, 0);
+
+ case CDIOCSETLEFT:
+ return wcd_setchan (t, CHANNEL_0, CHANNEL_0, 0, 0);
+
+ case CDIOCSETRIGHT:
+ return wcd_setchan (t, CHANNEL_1, CHANNEL_1, 0, 0);
+ }
+ return (error);
+}
+
+/*
+ * Read the entire TOC for the disc into our internal buffer.
+ */
+static int wcd_read_toc (struct wcd *t)
+{
+ int ntracks, len;
+ struct atapires result;
+
+ bzero (&t->toc, sizeof (t->toc));
+ bzero (&t->info, sizeof (t->info));
+
+ wcd_select_slot(t);
+
+ /* Check for the media.
+ * Do it twice to avoid the stale media changed state. */
+ result = atapi_request_wait (t->ata, t->unit, ATAPI_TEST_UNIT_READY,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ if (result.code == RES_ERR &&
+ (result.error & AER_SKEY) == AER_SK_UNIT_ATTENTION) {
+ t->flags |= F_MEDIA_CHANGED;
+ result = atapi_request_wait (t->ata, t->unit,
+ ATAPI_TEST_UNIT_READY, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ }
+ if (result.code) {
+ wcd_error (t, result);
+ return (EIO);
+ }
+ t->flags &= ~F_MEDIA_CHANGED;
+
+ /* First read just the header, so we know how long the TOC is. */
+ len = sizeof(struct ioc_toc_header) + sizeof(struct cd_toc_entry);
+ if (wcd_request_wait (t, ATAPI_READ_TOC, 0, 0, 0, 0, 0, 0,
+ len >> 8, len & 0xff, 0, (char*)&t->toc, len) != 0) {
+err: bzero (&t->toc, sizeof (t->toc));
+ return (0);
+ }
+
+ ntracks = t->toc.hdr.ending_track - t->toc.hdr.starting_track + 1;
+ if (ntracks <= 0 || ntracks > MAXTRK)
+ goto err;
+
+ /* Now read the whole schmeer. */
+ len = sizeof(struct ioc_toc_header) +
+ ntracks * sizeof(struct cd_toc_entry);
+ if (wcd_request_wait (t, ATAPI_READ_TOC, 0, 0, 0, 0, 0, 0,
+ len >> 8, len & 0xff, 0, (char*)&t->toc, len) & 0xff)
+ goto err;
+
+ NTOHS(t->toc.hdr.len);
+
+ /* Read disc capacity. */
+ if (wcd_request_wait (t, ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0,
+ 0, sizeof(t->info), 0, (char*)&t->info, sizeof(t->info)) != 0)
+ bzero (&t->info, sizeof (t->info));
+
+ /* make fake leadout entry */
+ t->toc.tab[ntracks].control = t->toc.tab[ntracks-1].control;
+ t->toc.tab[ntracks].addr_type = t->toc.tab[ntracks-1].addr_type;
+ t->toc.tab[ntracks].track = 170; /* magic */
+ t->toc.tab[ntracks].addr.lba = t->info.volsize;
+
+ NTOHL(t->info.volsize);
+ NTOHL(t->info.blksize);
+
+ /* Print the disc description string on every disc change.
+ * It would help to track the history of disc changes. */
+ if (t->info.volsize && t->toc.hdr.ending_track &&
+ (t->flags & F_MEDIA_CHANGED) && (t->flags & F_DEBUG)) {
+ printf ("wcd%d: ", t->lun);
+ if (t->toc.tab[0].control & 4)
+ printf ("%ldMB ", t->info.volsize / 512);
+ else
+ printf ("%ld:%ld audio ", t->info.volsize/75/60,
+ t->info.volsize/75%60);
+ printf ("(%ld sectors), %d tracks\n", t->info.volsize,
+ t->toc.hdr.ending_track - t->toc.hdr.starting_track + 1);
+ }
+ return (0);
+}
+
+/*
+ * Set up the audio channel masks.
+ */
+static int wcd_setchan (struct wcd *t,
+ u_char c0, u_char c1, u_char c2, u_char c3)
+{
+ int error;
+
+ error = wcd_request_wait (t, ATAPI_MODE_SENSE, 0, AUDIO_PAGE,
+ 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au), 0,
+ (char*) &t->au, sizeof (t->au));
+ if (error)
+ return (error);
+ if (t->flags & F_DEBUG)
+ wcd_dump (t->lun, "au", &t->au, sizeof t->au);
+ if (t->au.page_code != AUDIO_PAGE)
+ return (EIO);
+
+ /* Sony-55E requires the data length field to be zeroed. */
+ t->au.data_length = 0;
+
+ t->au.port[0].channels = c0;
+ t->au.port[1].channels = c1;
+ t->au.port[2].channels = c2;
+ t->au.port[3].channels = c3;
+ return wcd_request_wait (t, ATAPI_MODE_SELECT, 0x10,
+ 0, 0, 0, 0, 0, sizeof (t->au) >> 8, sizeof (t->au),
+ 0, (char*) &t->au, - sizeof (t->au));
+}
+
+static int wcd_eject (struct wcd *t, int closeit)
+{
+ struct atapires result;
+
+ wcd_select_slot(t);
+
+ /* Try to stop the disc. */
+ result = atapi_request_wait (t->ata, t->unit, ATAPI_START_STOP,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ if (result.code == RES_ERR &&
+ ((result.error & AER_SKEY) == AER_SK_NOT_READY ||
+ (result.error & AER_SKEY) == AER_SK_UNIT_ATTENTION)) {
+ int err;
+
+ if (!closeit)
+ return (0);
+ /*
+ * The disc was unloaded.
+ * Load it (close tray).
+ * Read the table of contents.
+ */
+ err = wcd_request_wait (t, ATAPI_START_STOP,
+ 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
+ if (err)
+ return (err);
+
+ /* Read table of contents. */
+ wcd_read_toc (t);
+
+ /* Lock the media. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ t->flags |= F_LOCKED;
+ return (0);
+ }
+
+ if (result.code) {
+ wcd_error (t, result);
+ return (EIO);
+ }
+
+ if (closeit)
+ return (0);
+
+ /* Give it some time to stop spinning. */
+ tsleep ((caddr_t)&lbolt, PRIBIO, "wcdej1", 0);
+ tsleep ((caddr_t)&lbolt, PRIBIO, "wcdej2", 0);
+
+ /* Unlock. */
+ wcd_request_wait (t, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ t->flags &= ~F_LOCKED;
+
+ /* Eject. */
+ t->flags |= F_MEDIA_CHANGED;
+ return wcd_request_wait (t, ATAPI_START_STOP,
+ 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0);
+}
+
+static void
+wcd_select_slot(struct wcd *cdp)
+{
+ if (cdp->slot < 0 || cdp->changer_info->current_slot == cdp->slot)
+ return;
+
+ /* Unlock (might not be needed but its cheaper than asking) */
+ wcd_request_wait (cdp, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ /* Unload the current media from player */
+ wcd_request_wait (cdp, ATAPI_LOAD_UNLOAD,
+ 0, 0, 0, 2, 0, 0, 0, cdp->changer_info->current_slot, 0, 0, 0);
+
+ /* load the wanted slot */
+ wcd_request_wait (cdp, ATAPI_LOAD_UNLOAD,
+ 0, 0, 0, 3, 0, 0, 0, cdp->slot, 0, 0, 0);
+
+ cdp->changer_info->current_slot = cdp->slot;
+
+ /* Lock the media if needed */
+ if (cdp->flags & F_LOCKED) {
+ wcd_request_wait (cdp, ATAPI_PREVENT_ALLOW,
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0);
+ }
+}
+
+#ifdef WCD_MODULE
+/*
+ * Loadable ATAPI CD-ROM driver stubs.
+ */
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+/*
+ * Construct lkm_dev structures (see lkm.h).
+ * Our bdevsw/cdevsw slot numbers are 19/69.
+ */
+
+
+MOD_DEV(wcd, LM_DT_BLOCK, BDEV_MAJOR, &wcd_cdevsw);
+MOD_DEV(rwcd, LM_DT_CHAR, CDEV_MAJOR, &wcd_cdevsw);
+
+/*
+ * Function called when loading the driver.
+ */
+int wcd_load (struct lkm_table *lkmtp, int cmd)
+{
+ struct atapi *ata;
+ int n, u;
+
+ if (! atapi_start)
+ /* No ATAPI driver available. */
+ return EPROTONOSUPPORT;
+ n = 0;
+ for (ata=atapi_tab; ata<atapi_tab+2; ++ata)
+ if (ata->port)
+ for (u=0; u<2; ++u)
+ /* Probing controller ata->ctrlr, unit u. */
+ if (ata->params[u] && ! ata->attached[u] &&
+ wcdattach (ata, u, ata->params[u],
+ ata->debug) >= 0)
+ {
+ /* Drive found. */
+ ata->attached[u] = 1;
+ ++n;
+ }
+ if (! n)
+ /* No IDE CD-ROMs found. */
+ return ENXIO;
+ return 0;
+}
+
+/*
+ * Function called when unloading the driver.
+ */
+int wcd_unload (struct lkm_table *lkmtp, int cmd)
+{
+ struct wcd **t;
+
+ for (t=wcdtab; t<wcdtab+wcdnlun; ++t)
+ if (((*t)->flags & F_BOPEN) || (*t)->refcnt)
+ /* The device is opened, cannot unload the driver. */
+ return EBUSY;
+ for (t=wcdtab; t<wcdtab+wcdnlun; ++t) {
+ (*t)->ata->attached[(*t)->unit] = 0;
+ free (*t, M_TEMP);
+ }
+ wcdnlun = 0;
+ bzero (wcdtab, sizeof(wcdtab));
+ return 0;
+}
+
+/*
+ * Dispatcher function for the module (load/unload/stat).
+ */
+int wcd_mod (struct lkm_table *lkmtp, int cmd, int ver)
+{
+ int err = 0;
+
+ if (ver != LKM_VERSION)
+ return EINVAL;
+
+ if (cmd == LKM_E_LOAD)
+ err = wcd_load (lkmtp, cmd);
+ else if (cmd == LKM_E_UNLOAD)
+ err = wcd_unload (lkmtp, cmd);
+ if (err)
+ return err;
+
+ /* XXX Poking around in the LKM internals like this is bad.
+ */
+ /* Register the cdevsw entry. */
+ lkmtp->private.lkm_dev = & MOD_PRIVATE(rwcd);
+ err = lkmdispatch (lkmtp, cmd);
+ if (err)
+ return err;
+
+ /* Register the bdevsw entry. */
+ lkmtp->private.lkm_dev = & MOD_PRIVATE(wcd);
+ return lkmdispatch (lkmtp, cmd);
+}
+#endif /* WCD_MODULE */
+
+static wcd_devsw_installed = 0;
+
+static void wcd_drvinit(void *unused)
+{
+
+ if( ! wcd_devsw_installed ) {
+ cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &wcd_cdevsw);
+ wcd_devsw_installed = 1;
+ }
+}
+
+SYSINIT(wcddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wcd_drvinit,NULL)
+
+
+#endif /* NWCD && NWDC && ATAPI */
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 488615575464f..6a5f73023a177 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.185 1999/01/16 01:06:23 bde Exp $
+ * $Id: wd.c,v 1.176 1998/09/15 08:15:30 gibbs Exp $
*/
/* TODO:
@@ -67,8 +67,8 @@
#include "opt_atapi.h"
#include "opt_devfs.h"
#include "opt_hw_wdog.h"
-#include "opt_ide_delay.h"
#include "opt_wd.h"
+#include "pci.h"
#include <sys/param.h>
#include <sys/dkbad.h>
@@ -106,11 +106,7 @@
extern void wdstart(int ctrlr);
-#ifdef IDE_DELAY
-#define TIMEOUT IDE_DELAY
-#else
#define TIMEOUT 10000
-#endif
#define RETRIES 5 /* number of retries before giving up */
#define RECOVERYTIME 500000 /* usec for controller to recover after err */
#define MAXTRANSFER 255 /* max size of transfer in sectors */
@@ -311,16 +307,19 @@ wdprobe(struct isa_device *dvp)
du->dk_ctrlr = dvp->id_unit;
interface = du->dk_ctrlr / 2;
du->dk_interface = interface;
- du->dk_port = dvp->id_iobase;
- if (wddma[interface].wdd_candma != NULL) {
- du->dk_dmacookie =
- wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr,
- du->dk_unit);
- du->dk_altport =
- wddma[interface].wdd_altiobase(du->dk_dmacookie);
- }
- if (du->dk_altport == 0)
+#if !defined(DISABLE_PCI_IDE) && (NPCI > 0)
+ if (wddma[interface].wdd_candma) {
+ du->dk_dmacookie = wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr);
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = wddma[interface].wdd_altiobase(du->dk_dmacookie);
+ } else {
+ du->dk_port = dvp->id_iobase;
du->dk_altport = du->dk_port + wd_ctlr;
+ }
+#else
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = du->dk_port + wd_ctlr;
+#endif
/* check if we have registers that work */
outb(du->dk_port + wd_sdh, WDSD_IBM); /* set unit 0 */
@@ -423,8 +422,6 @@ wdattach(struct isa_device *dvp)
struct disk *du;
struct wdparams *wp;
- dvp->id_intr = wdintr;
-
if (dvp->id_unit >= NWDC)
return (0);
@@ -665,17 +662,17 @@ wdstrategy(register struct buf *bp)
/* queue transfer on drive, activate drive and controller if idle */
s = splbio();
+ bufqdisksort(&drive_queue[lunit], bp);
+
+ if (wdutab[lunit].b_active == 0)
+ wdustart(du); /* start drive */
+
/* Pick up changes made by readdisklabel(). */
if (du->dk_flags & DKFL_LABELLING && du->dk_state > RECAL) {
wdsleep(du->dk_ctrlr, "wdlab");
du->dk_state = WANTOPEN;
}
- bufqdisksort(&drive_queue[lunit], bp);
-
- if (wdutab[lunit].b_active == 0)
- wdustart(du); /* start drive */
-
#ifdef CMD640
if (wdtab[du->dk_ctrlr_cmd640].b_active == 0)
#else
@@ -1033,12 +1030,11 @@ wdstart(int ctrlr)
*/
void
-wdintr(void *unitnum)
+wdintr(int unit)
{
register struct disk *du;
register struct buf *bp;
int dmastat = 0; /* Shut up GCC */
- int unit = (int)unitnum;
#ifdef CMD640
int ctrlr_atapi;
@@ -1087,7 +1083,8 @@ wdintr(void *unitnum)
if (du->dk_flags & (DKFL_DMA|DKFL_USEDMA)) {
/* XXX SMP boxes sometimes generate an early intr. Why? */
if ((wddma[du->dk_interface].wdd_dmastatus(du->dk_dmacookie) & WDDS_INTERRUPT)
- != 0)
+ == 0)
+ return;
dmastat = wddma[du->dk_interface].wdd_dmadone(du->dk_dmacookie);
}
@@ -1879,8 +1876,7 @@ failed:
* check drive's DMA capability
*/
if (wddma[du->dk_interface].wdd_candma) {
- du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(
- du->dk_port, du->dk_ctrlr, du->dk_unit);
+ du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(du->dk_port, du->dk_ctrlr);
/* does user want this? */
if ((du->cfg_flags & WDOPT_DMA) &&
/* have we got a DMA controller? */
@@ -2253,11 +2249,11 @@ static void
wderror(struct buf *bp, struct disk *du, char *mesg)
{
if (bp == NULL)
- printf("wd%d: %s", du->dk_lunit, mesg);
+ printf("wd%d: %s:\n", du->dk_lunit, mesg);
else
diskerr(bp, "wd", mesg, LOG_PRINTF, du->dk_skip,
dsgetlabel(bp->b_dev, du->dk_slices));
- printf(" (status %b error %b)\n",
+ printf("wd%d: status %b error %b\n", du->dk_lunit,
du->dk_status, WDCS_BITS, du->dk_error, WDERR_BITS);
}
diff --git a/sys/i386/isa/wd7000.c b/sys/i386/isa/wd7000.c
new file mode 100644
index 0000000000000..5722aeeed1cf6
--- /dev/null
+++ b/sys/i386/isa/wd7000.c
@@ -0,0 +1,725 @@
+/*
+ * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
+ * All rights reserved.
+ *
+ * Written by Olof Johansson (offe@ludd.luth.se) 1995.
+ * Based on code written by Theo de Raadt (deraadt@fsa.ca).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed at Ludd, University of Lule}.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ /* All bugs are subject to removal without further notice */
+
+/*
+ * offe 01/07/95
+ *
+ * This version of the driver _still_ doesn't implement scatter/gather for the
+ * WD7000-FASST2. This is due to the fact that my controller doesn't seem to
+ * support it. That, and the lack of documentation makes it impossible for
+ * me to implement it.
+ * What I've done instead is allocated a local buffer, contiguous buffer big
+ * enough to handle the requests. I haven't seen any read/write bigger than 64k,
+ * so I allocate a buffer of 64+16k. The data that needs to be DMA'd to/from
+ * the controller is copied to/from that buffer before/after the command is
+ * sent to the card.
+ */
+
+#include "wds.h"
+#if NWDS > 0
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/buf.h>
+
+#include <scsi/scsiconf.h>
+
+#include <machine/clock.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <i386/isa/isa_device.h>
+
+static struct scsi_device wds_dev =
+{
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "wds",
+ 0,
+ { 0, 0 }
+};
+
+/*
+ XXX THIS SHOULD BE FIXED!
+ I haven't got the KERNBASE-version to work, but on my system the kernel
+ is at virtual address 0xFxxxxxxx, responding to physical address
+ 0x0xxxxxxx.
+#define PHYSTOKV(x) ((x) + KERNBASE)
+*/
+#define PHYSTOKV(x) ((x) | 0xf0000000)
+#define KVTOPHYS(x) vtophys(x)
+/* 0x10000 (64k) should be enough. But just to be sure... */
+#define BUFSIZ 0x12000
+
+
+/* WD7000 registers */
+#define WDS_STAT 0 /* read */
+#define WDS_IRQSTAT 1 /* read */
+
+#define WDS_CMD 0 /* write */
+#define WDS_IRQACK 1 /* write */
+#define WDS_HCR 2 /* write */
+
+/* WDS_STAT (read) defs */
+#define WDS_IRQ 0x80
+#define WDS_RDY 0x40
+#define WDS_REJ 0x20
+#define WDS_INIT 0x10
+
+/* WDS_IRQSTAT (read) defs */
+#define WDSI_MASK 0xc0
+#define WDSI_ERR 0x00
+#define WDSI_MFREE 0x80
+#define WDSI_MSVC 0xc0
+
+/* WDS_CMD (write) defs */
+#define WDSC_NOOP 0x00
+#define WDSC_INIT 0x01
+#define WDSC_DISUNSOL 0x02
+#define WDSC_ENAUNSOL 0x03
+#define WDSC_IRQMFREE 0x04
+#define WDSC_SCSIRESETSOFT 0x05
+#define WDSC_SCSIRESETHARD 0x06
+#define WDSC_MSTART(m) (0x80 + (m))
+#define WDSC_MMSTART(m) (0xc0 + (m))
+
+/* WDS_HCR (write) defs */
+#define WDSH_IRQEN 0x08
+#define WDSH_DRQEN 0x04
+#define WDSH_SCSIRESET 0x02
+#define WDSH_ASCRESET 0x01
+
+struct wds_cmd {
+ u_char cmd;
+ u_char targ;
+ u_char scb[12]; /*u_char scb[12];*/
+ u_char stat;
+ u_char venderr;
+ u_char len[3];
+ u_char data[3];
+ u_char next[3];
+ u_char write;
+ u_char xx[6];
+};
+
+struct wds_req {
+ struct wds_cmd cmd;
+ struct wds_cmd sense;
+ struct scsi_xfer *sxp;
+ int busy, polled;
+ int done, ret, ombn;
+};
+
+#define WDSX_SCSICMD 0x00
+#define WDSX_OPEN_RCVBUF 0x80
+#define WDSX_RCV_CMD 0x81
+#define WDSX_RCV_DATA 0x82
+#define WDSX_RCV_DATASTAT 0x83
+#define WDSX_SND_DATA 0x84
+#define WDSX_SND_DATASTAT 0x85
+#define WDSX_SND_CMDSTAT 0x86
+#define WDSX_READINIT 0x88
+#define WDSX_READSCSIID 0x89
+#define WDSX_SETUNSOLIRQMASK 0x8a
+#define WDSX_GETUNSOLIRQMASK 0x8b
+#define WDSX_GETFIRMREV 0x8c
+#define WDSX_EXECDIAG 0x8d
+#define WDSX_SETEXECPARM 0x8e
+#define WDSX_GETEXECPARM 0x8f
+
+struct wds_mb {
+ u_char stat;
+ u_char addr[3];
+};
+/* ICMB status value */
+#define ICMB_OK 0x01
+#define ICMB_OKERR 0x02
+#define ICMB_ETIME 0x04
+#define ICMB_ERESET 0x05
+#define ICMB_ETARCMD 0x06
+#define ICMB_ERESEL 0x80
+#define ICMB_ESEL 0x81
+#define ICMB_EABORT 0x82
+#define ICMB_ESRESET 0x83
+#define ICMB_EHRESET 0x84
+
+struct wds_setup {
+ u_char cmd;
+ u_char scsi_id;
+ u_char buson_t;
+ u_char busoff_t;
+ u_char xx;
+ u_char mbaddr[3];
+ u_char nomb;
+ u_char nimb;
+};
+
+#define WDS_NOMB 8
+#define WDS_NIMB 8
+#define MAXSIMUL 8
+
+static int wdsunit=0;
+
+static u_char wds_data[NWDS][BUFSIZ];
+static u_char wds_data_in_use[NWDS];
+
+static struct wds {
+ int addr;
+ struct wds_req wdsr[MAXSIMUL];
+ struct wds_mb ombs[WDS_NOMB], imbs[WDS_NIMB];
+ struct scsi_link sc_link;
+} wds[NWDS];
+
+static int wdsprobe(struct isa_device *);
+static void wds_minphys(struct buf *);
+static struct wds_req *wdsr_alloc(int);
+static int32_t wds_scsi_cmd(struct scsi_xfer *);
+static u_int32_t wds_adapter_info(int);
+static int wds_done(int, struct wds_cmd *, u_char);
+static int wdsattach(struct isa_device *);
+static int wds_init(struct isa_device *);
+static int wds_cmd(int, u_char *, int);
+static void wds_wait(int, int, int);
+
+struct isa_driver wdsdriver =
+{
+ wdsprobe,
+ wdsattach,
+ "wds"
+};
+
+static struct scsi_adapter wds_switch =
+{
+ wds_scsi_cmd,
+ wds_minphys,
+ 0,
+ 0,
+ wds_adapter_info,
+ "wds",
+ {0,0}
+};
+
+int
+wdsprobe(struct isa_device *dev)
+{
+ if(wdsunit > NWDS)
+ return 0;
+
+ dev->id_unit = wdsunit; /* XXX WRONG! */
+ wds[wdsunit].addr = dev->id_iobase;
+
+ if(wds_init(dev) != 0)
+ return 0;
+ wdsunit++;
+ return 8;
+}
+
+void
+wds_minphys(struct buf *bp)
+{
+ if(bp->b_bcount > BUFSIZ)
+ bp->b_bcount = BUFSIZ;
+}
+
+struct wds_req *
+wdsr_alloc(int unit)
+{
+ struct wds_req *r;
+ int x;
+ int i;
+
+ r = NULL;
+ x = splbio();
+ for(i=0; i<MAXSIMUL; i++)
+ if(!wds[unit].wdsr[i].busy)
+ {
+ r = &wds[unit].wdsr[i];
+ r->busy = 1;
+ break;
+ }
+ if(!r)
+ {
+ splx(x);
+ return NULL;
+ }
+
+ r->ombn = -1;
+ for(i=0; i<WDS_NOMB; i++)
+ if(!wds[unit].ombs[i].stat)
+ {
+ wds[unit].ombs[i].stat = 1;
+ r->ombn = i;
+ break;
+ }
+ if(r->ombn == -1 )
+ {
+ r->busy = 0;
+ splx(x);
+ return NULL;
+ }
+ splx(x);
+ return r;
+}
+
+int32_t
+wds_scsi_cmd(struct scsi_xfer *sxp)
+{
+ struct wds_req *r;
+ int unit = sxp->sc_link->adapter_unit;
+ int base;
+ u_char c;
+ int i;
+
+ base = wds[unit].addr;
+
+ if( sxp->flags & SCSI_RESET)
+ {
+ printf("reset!\n");
+ return COMPLETE;
+ }
+
+ r = wdsr_alloc(unit);
+ if(r==NULL)
+ {
+ printf("no request slot available!\n");
+ sxp->error = XS_DRIVER_STUFFUP;
+ return TRY_AGAIN_LATER;
+ }
+ r->done = 0;
+ r->sxp = sxp;
+
+ if(sxp->flags & SCSI_DATA_UIO)
+ {
+ printf("UIO!\n");
+ sxp->error = XS_DRIVER_STUFFUP;
+ return TRY_AGAIN_LATER;
+ }
+
+ scsi_uto3b(KVTOPHYS(&r->cmd),wds[unit].ombs[r->ombn].addr);
+
+ bzero(&r->cmd, sizeof r->cmd);
+ r->cmd.cmd = WDSX_SCSICMD;
+ r->cmd.targ = (sxp->sc_link->target << 5) | sxp->sc_link->lun;
+ bcopy(sxp->cmd, &r->cmd.scb, sxp->cmdlen<12 ? sxp->cmdlen : 12);
+ scsi_uto3b(sxp->datalen, r->cmd.len);
+
+ if(wds_data_in_use[unit])
+ {
+ sxp->error = XS_DRIVER_STUFFUP;
+ return TRY_AGAIN_LATER;
+ }
+ else
+ wds_data_in_use[unit] = 1;
+
+ if(sxp->datalen && !(sxp->flags&SCSI_DATA_IN))
+ bcopy(sxp->data, wds_data[unit], sxp->datalen);
+
+ scsi_uto3b(sxp->datalen ? KVTOPHYS(wds_data[unit]) : 0, r->cmd.data);
+
+ r->cmd.write = (sxp->flags&SCSI_DATA_IN)? 0x80 : 0x00;
+
+ scsi_uto3b(KVTOPHYS(&r->sense),r->cmd.next);
+
+ bzero(&r->sense, sizeof r->sense);
+ r->sense.cmd = r->cmd.cmd;
+ r->sense.targ = r->cmd.targ;
+ r->sense.scb[0] = REQUEST_SENSE;
+ scsi_uto3b(KVTOPHYS(&sxp->sense),r->sense.data);
+ scsi_uto3b(sizeof(sxp->sense), r->sense.len);
+ r->sense.write = 0x80;
+
+ if(sxp->flags & SCSI_NOMASK)
+ {
+ outb(base+WDS_HCR, WDSH_DRQEN);
+ r->polled = 1;
+ } else
+ {
+ outb(base+WDS_HCR, WDSH_IRQEN|WDSH_DRQEN);
+ r->polled = 0;
+ }
+
+ c = WDSC_MSTART(r->ombn);
+
+ if( wds_cmd(base, &c, sizeof c) != 0)
+ {
+ printf("wds%d: unable to start outgoing mbox\n", unit);
+ r->busy = 0;
+ wds[unit].ombs[r->ombn].stat = 0;
+
+ return TRY_AGAIN_LATER;
+ }
+
+ if(sxp->flags & SCSI_NOMASK)
+ {
+ repoll:
+
+ i = 0;
+ while(!(inb(base+WDS_STAT) & WDS_IRQ))
+ {
+
+ DELAY(20000);
+ if(++i == 20)
+ {
+ outb(base + WDS_IRQACK, 0);
+ /*r->busy = 0;*/
+ sxp->error = XS_TIMEOUT;
+ return HAD_ERROR;
+ }
+ }
+ wdsintr(unit);
+ if(r->done)
+ {
+ r->sxp->flags |= ITSDONE;
+ r->busy = 0;
+ return r->ret;
+ }
+ goto repoll;
+ }
+
+ return SUCCESSFULLY_QUEUED;
+}
+
+u_int32_t
+wds_adapter_info(int unit)
+{
+ return 1;
+}
+
+void
+wdsintr(int unit)
+{
+ struct wds_cmd *pc, *vc;
+ struct wds_mb *in;
+ u_char stat;
+ u_char c;
+
+ if(!inb(wds[unit].addr+WDS_STAT) & WDS_IRQ)
+ {
+ outb(wds[unit].addr + WDS_IRQACK, 0);
+ return;
+ }
+
+ c = inb(wds[unit].addr + WDS_IRQSTAT);
+ if( (c&WDSI_MASK) == WDSI_MSVC)
+ {
+ c = c & ~WDSI_MASK;
+ in = &wds[unit].imbs[c];
+
+ pc = (struct wds_cmd *)scsi_3btou(in->addr);
+ vc = (struct wds_cmd *)PHYSTOKV((intptr_t)(void *)pc);
+ stat = in->stat;
+
+ wds_done(unit, vc, stat);
+ in->stat = 0;
+
+ outb(wds[unit].addr + WDS_IRQACK, 0);
+ }
+}
+
+int
+wds_done(int unit, struct wds_cmd *c, u_char stat)
+{
+ struct wds_req *r;
+ int i;
+
+ r = (struct wds_req *)NULL;
+
+ for(i=0; i<MAXSIMUL; i++)
+ if( c == &wds[unit].wdsr[i].cmd && !wds[unit].wdsr[i].done)
+ {
+ r = &wds[unit].wdsr[i];
+ break;
+ }
+ if(r == (struct wds_req *)NULL)
+ {
+ /* failed to find request! */
+ return 1;
+ }
+
+ r->done = 1;
+ wds[unit].ombs[r->ombn].stat = 0;
+ r->ret = HAD_ERROR;
+ switch(stat)
+ {
+ case ICMB_OK:
+ r->ret = COMPLETE;
+ if(r->sxp)
+ r->sxp->resid = 0;
+ break;
+ case ICMB_OKERR:
+ if(!(r->sxp->flags & SCSI_ERR_OK) && c->stat)
+ {
+ r->sxp->sense.error_code = c->venderr;
+ r->sxp->error=XS_SENSE;
+ }
+ else
+ r->sxp->error=XS_NOERROR;
+ r->ret = COMPLETE;
+ break;
+ case ICMB_ETIME:
+ r->sxp->error = XS_TIMEOUT;
+ r->ret = HAD_ERROR;
+ break;
+ case ICMB_ERESET:
+ case ICMB_ETARCMD:
+ case ICMB_ERESEL:
+ case ICMB_ESEL:
+ case ICMB_EABORT:
+ case ICMB_ESRESET:
+ case ICMB_EHRESET:
+ r->sxp->error = XS_DRIVER_STUFFUP;
+ r->ret = HAD_ERROR;
+ break;
+ }
+
+ if(r->sxp)
+ if(r->sxp->datalen && (r->sxp->flags&SCSI_DATA_IN))
+ bcopy(wds_data[unit],r->sxp->data,r->sxp->datalen);
+
+ wds_data_in_use[unit] = 0;
+
+ if(!r->polled)
+ {
+ r->sxp->flags |= ITSDONE;
+ scsi_done(r->sxp);
+ }
+
+ r->busy = 0;
+
+ return 0;
+}
+
+static int
+wds_getvers(int unit)
+{
+ struct wds_req *r;
+ int base;
+ u_char c;
+ int i;
+
+ base = wds[unit].addr;
+
+ r = wdsr_alloc(unit);
+ if(!r)
+ {
+ printf("wds%d: no request slot available!\n", unit);
+ return -1;
+ }
+
+ r->done = 0;
+ r->sxp = NULL;
+
+ scsi_uto3b(KVTOPHYS(&r->cmd), wds[unit].ombs[r->ombn].addr);
+
+ bzero(&r->cmd, sizeof r->cmd);
+ r->cmd.cmd = WDSX_GETFIRMREV;
+
+ outb(base+WDS_HCR, WDSH_DRQEN);
+ r->polled = 1;
+
+ c = WDSC_MSTART(r->ombn);
+ if(wds_cmd(base, (u_char *)&c, sizeof c))
+ {
+ printf("wds%d: version request failed\n", unit);
+ r->busy = 0;
+ wds[unit].ombs[r->ombn].stat = 0;
+ return -1;
+ }
+
+ while(1)
+ {
+ i = 0;
+ while( (inb(base+WDS_STAT) & WDS_IRQ) == 0)
+ {
+ DELAY(9000);
+ if(++i == 20)
+ return -1;
+ }
+ wdsintr(unit);
+ if(r->done)
+ {
+ printf("wds%d: firmware version %d.%02d\n", unit,
+ r->cmd.targ, r->cmd.scb[0]);
+ r->busy = 0;
+ return 0;
+ }
+ }
+}
+
+int
+wdsattach(struct isa_device *dev)
+{
+ int masunit;
+ static u_long versprobe=0; /* max 32 controllers */
+ int unit = dev->id_unit;
+ struct scsibus_data *scbus;
+
+ masunit = dev->id_unit;
+
+ if( !(versprobe & (1<<masunit)))
+ {
+ versprobe |= (1<<masunit);
+ if(wds_getvers(masunit)==-1)
+ printf("wds%d: getvers failed\n", masunit);
+ }
+
+ printf("wds%d: using %d bytes for dma buffer\n",unit,BUFSIZ);
+
+ wds[unit].sc_link.adapter_unit = unit;
+ wds[unit].sc_link.adapter_targ = 7;
+ wds[unit].sc_link.adapter = &wds_switch;
+ wds[unit].sc_link.device = &wds_dev;
+ wds[unit].sc_link.flags = SDEV_BOUNCE;
+
+ /*
+ * Prepare the scsibus_data area for the upperlevel
+ * scsi code.
+ */
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ return 0;
+ scbus->adapter_link = &wds[unit].sc_link;
+
+ scsi_attachdevs(scbus);
+
+ return 1;
+}
+
+int
+wds_init(struct isa_device *dev)
+{
+ struct wds_setup init;
+ int base;
+ int unit, i;
+ struct wds_cmd wc;
+
+ unit = dev->id_unit;
+ base = wds[unit].addr;
+
+ /*
+ * Sending a command causes the CMDRDY bit to clear.
+ */
+
+ outb(base+WDS_CMD, WDSC_NOOP);
+ if( inb(base+WDS_STAT) & WDS_RDY)
+ return 1;
+
+ /*
+ * the controller exists. reset and init.
+ */
+ outb(base+WDS_HCR, WDSH_ASCRESET|WDSH_SCSIRESET);
+ DELAY(30);
+ outb(base+WDS_HCR, 0);
+
+ outb(base+WDS_HCR, WDSH_DRQEN);
+
+ isa_dmacascade(dev->id_drq);
+
+ if( (inb(base+WDS_STAT) & (WDS_RDY)) != WDS_RDY)
+ {
+ for(i=0; i<10; i++)
+ {
+ if( (inb(base+WDS_STAT) & (WDS_RDY)) == WDS_RDY)
+ break;
+ DELAY(40000);
+ }
+ if( (inb(base+WDS_STAT) & (WDS_RDY)) != WDS_RDY) /* probe timeout */
+ return 1;
+ }
+
+ bzero(&init, sizeof init);
+ init.cmd = WDSC_INIT;
+ init.scsi_id = 7;
+ init.buson_t = 24;
+ init.busoff_t = 48;
+ scsi_uto3b(KVTOPHYS(wds[unit].ombs), init.mbaddr);
+ init.xx = 0;
+ init.nomb = WDS_NOMB;
+ init.nimb = WDS_NIMB;
+
+ wds_wait(base+WDS_STAT, WDS_RDY, WDS_RDY);
+ if( wds_cmd(base, (u_char *)&init, sizeof init) != 0)
+ {
+ printf("wds%d: wds_cmd failed\n", unit);
+ return 1;
+ }
+
+ wds_wait(base+WDS_STAT, WDS_INIT, WDS_INIT);
+
+ wds_wait(base+WDS_STAT, WDS_RDY, WDS_RDY);
+
+ bzero(&wc,sizeof wc);
+ wc.cmd = WDSC_DISUNSOL;
+ if( wds_cmd(base, (char *)&wc, sizeof wc) != 0)
+ {
+ printf("wds%d: wds_cmd failed\n", unit);
+ return 1;
+ }
+
+ return 0;
+}
+
+int
+wds_cmd(int base, u_char *p, int l)
+{
+ int s=splbio();
+
+ while(l--)
+ {
+ do
+ {
+ outb(base+WDS_CMD,*p);
+ wds_wait(base+WDS_STAT,WDS_RDY,WDS_RDY);
+ } while (inb(base+WDS_STAT) & WDS_REJ);
+ p++;
+ }
+
+ wds_wait(base+WDS_STAT,WDS_RDY,WDS_RDY);
+
+ splx(s);
+
+ return 0;
+}
+
+void
+wds_wait(int reg, int mask, int val)
+{
+ while((inb(reg) & mask) != val);
+}
+
+#endif
diff --git a/sys/i386/isa/wdreg.h b/sys/i386/isa/wdreg.h
index 88a0fecb2b278..f8520bf566162 100644
--- a/sys/i386/isa/wdreg.h
+++ b/sys/i386/isa/wdreg.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wdreg.h 7.1 (Berkeley) 5/9/91
- * $Id: wdreg.h,v 1.24 1999/01/12 01:04:38 eivind Exp $
+ * $Id: wdreg.h,v 1.21 1998/01/14 08:08:42 kato Exp $
*/
/*
@@ -262,7 +262,7 @@ int wdformat(struct buf *bp);
*/
struct wddma {
void *(*wdd_candma) /* returns a cookie if PCI */
- __P((int iobase_wd, int ctlr, int unit));
+ __P((int ctlr, int drive));
int (*wdd_dmaverify) /* verify that request is DMA-able */
__P((void *cookie, char *vaddr, u_long len, int direction));
int (*wdd_dmaprep) /* prepare DMA hardware */
@@ -312,6 +312,4 @@ struct wddma {
extern struct wddma wddma[];
-void wdintr __P((void *unit));
-
#endif /* KERNEL */
diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c
index 60ceb0b81a13d..67d570a37e5d4 100644
--- a/sys/i386/isa/wfd.c
+++ b/sys/i386/isa/wfd.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: wfd.c,v 1.16 1998/09/15 08:15:30 gibbs Exp $
+ * $Id: wfd.c,v 1.15 1998/08/23 20:16:34 phk Exp $
*/
/*
@@ -661,6 +661,9 @@ int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
struct wfd *t = wfdtab[lun];
int error = 0;
+ struct disklabel *dl;
+ char buffer[DEV_BSIZE];
+
error = dsioctl("wfd", dev, cmd, addr, flag, &t->dk_slices,
wfdstrategy1, (ds_setgeom_t *)NULL);
if (error != -1)
diff --git a/sys/i386/isa/wst.c b/sys/i386/isa/wst.c
index 3d2f4e8e59149..ff5f5435f31ec 100644
--- a/sys/i386/isa/wst.c
+++ b/sys/i386/isa/wst.c
@@ -25,13 +25,12 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: wst.c,v 1.14 1999/01/12 00:36:36 eivind Exp $
+ * $Id$
*/
#include "wdc.h"
#include "wst.h"
#include "opt_atapi.h"
-#include "opt_ddb.h"
#include "opt_devfs.h"
#if NWST > 0 && NWDC > 0 && defined(ATAPI)
@@ -200,6 +199,7 @@ static
int wstattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug);
static int wst_sense(struct wst *t);
static void wst_describe(struct wst *t);
+static int wst_open(dev_t dev, int chardev);
static void wst_poll_dsc(struct wst *t);
static void wst_start(struct wst *t);
static void wst_done(struct wst *t, struct buf *bp, int resid, struct atapires result);
@@ -212,10 +212,7 @@ static int wst_load_unload(struct wst *t, u_char finction);
static int wst_rewind(struct wst *t);
static void wst_reset(struct wst *t);
-#ifdef DDB
-void wst_dump(int lun, char *label, void *data, int len);
-
-void
+static void
wst_dump(int lun, char *label, void *data, int len)
{
u_char *p = data;
@@ -225,7 +222,6 @@ wst_dump(int lun, char *label, void *data, int len)
printf("-%x", *p++);
printf("\n");
}
-#endif
#ifndef ATAPI_STATIC
static
@@ -234,7 +230,9 @@ int
wstattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug)
{
struct wst *t;
- int lun;
+ struct atapires result;
+ int lun, i;
+ char buffer[255];
if (wstnlun >= NUNIT) {
printf("wst: too many units\n");
@@ -350,7 +348,9 @@ int
wstopen(dev_t dev, int flags, int fmt, struct proc *p)
{
int lun = UNIT(dev);
+ char buffer[255];
struct wst *t;
+ struct atapires result;
/* Check that the device number and that the ATAPI driver is loaded. */
if (lun >= wstnlun || !atapi_request_immediate) {
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index c8712ca4603d7..481397e39abb9 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -20,7 +20,7 @@
* the original CMU copyright notice.
*
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
- * $Id: wt.c,v 1.46 1998/10/22 05:58:41 bde Exp $
+ * $Id: wt.c,v 1.44 1998/06/07 17:11:07 dfr Exp $
*
*/
@@ -178,7 +178,6 @@ static void wtclock (wtinfo_t *t);
static int wtreset (wtinfo_t *t);
static int wtsense (wtinfo_t *t, int verb, int ignor);
static int wtstatus (wtinfo_t *t);
-static ointhand2_t wtintr;
static void wtrewind (wtinfo_t *t);
static int wtreadfm (wtinfo_t *t);
static int wtwritefm (wtinfo_t *t);
@@ -189,6 +188,8 @@ static d_read_t wtread;
static d_write_t wtwrite;
static d_close_t wtclose;
static d_ioctl_t wtioctl;
+static d_dump_t wtdump;
+static d_psize_t wtsize;
static d_strategy_t wtstrategy;
#define CDEV_MAJOR 10
@@ -255,7 +256,6 @@ wtattach (struct isa_device *id)
{
wtinfo_t *t = wttab + id->id_unit;
- id->id_ointr = wtintr;
if (t->type == ARCHIVE) {
printf ("wt%d: type <Archive>\n", t->unit);
outb (t->RDMAPORT, 0); /* reset dma */
@@ -275,10 +275,24 @@ wtattach (struct isa_device *id)
struct isa_driver wtdriver = { wtprobe, wtattach, "wt", };
+int
+wtdump (dev_t dev)
+{
+ /* Not implemented */
+ return (EINVAL);
+}
+
+int
+wtsize (dev_t dev)
+{
+ /* Not implemented */
+ return (-1);
+}
+
/*
* Open routine, called on every device open.
*/
-static int
+int
wtopen (dev_t dev, int flag, int fmt, struct proc *p)
{
int u = minor (dev) & T_UNIT;
@@ -359,7 +373,7 @@ wtopen (dev_t dev, int flag, int fmt, struct proc *p)
/*
* Close routine, called on last device close.
*/
-static int
+int
wtclose (dev_t dev, int flags, int fmt, struct proc *p)
{
int u = minor (dev) & T_UNIT;
@@ -408,7 +422,7 @@ done:
* ioctl (int fd, MTIOCGET, struct mtget *buf) -- get status
* ioctl (int fd, MTIOCTOP, struct mtop *buf) -- do BSD-like op
*/
-static int
+int
wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p)
{
int u = minor (dev) & T_UNIT;
@@ -511,7 +525,7 @@ wtwrite(dev_t dev, struct uio *uio, int ioflag)
/*
* Strategy routine.
*/
-static void
+void
wtstrategy (struct buf *bp)
{
int u = minor (bp->b_dev) & T_UNIT;
@@ -589,7 +603,7 @@ xit: biodone (bp);
/*
* Interrupt routine.
*/
-static void
+void
wtintr (int u)
{
wtinfo_t *t = wttab + u;
diff --git a/sys/i386/linux/imgact_linux.c b/sys/i386/linux/imgact_linux.c
index 59ee24737b737..72f846cb447c3 100644
--- a/sys/i386/linux/imgact_linux.c
+++ b/sys/i386/linux/imgact_linux.c
@@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_linux.c,v 1.30 1998/10/16 03:55:00 peter Exp $
+ * $Id: imgact_linux.c,v 1.29 1998/08/16 01:21:50 bde Exp $
*/
#include <sys/param.h>
@@ -234,8 +234,8 @@ exec_linux_imgact(imgp)
/*
* Tell kern_execve.c about it, with a little help from the linker.
* Since `const' objects end up in the text segment, TEXT_SET is the
- * correct directive to use.
+ * correct directive to use. Do not staticize; used by Linux LKM.
*/
-static const struct execsw linux_execsw = { exec_linux_imgact, "linux a.out" };
+const struct execsw linux_execsw = { exec_linux_imgact, "linux a.out" };
EXEC_SET(linuxaout, linux_execsw);
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index eaffa614c6b8c..db96f2e025d59 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux.h,v 1.25 1998/12/19 02:55:32 julian Exp $
+ * $Id: linux.h,v 1.22 1998/09/30 01:42:53 jfieber Exp $
*/
#ifndef _I386_LINUX_LINUX_H_
@@ -418,7 +418,6 @@ struct trapframe;
#define LINUX_MAP_PRIVATE 0x0002
#define LINUX_MAP_FIXED 0x0010
#define LINUX_MAP_ANON 0x0020
-#define LINUX_MAP_GROWSDOWN 0x0100
/* SystemV ipc defines */
#define LINUX_SEMOP 1
@@ -472,8 +471,6 @@ struct trapframe;
#define LINUX_SHUTDOWN 13
#define LINUX_SETSOCKOPT 14
#define LINUX_GETSOCKOPT 15
-#define LINUX_SENDMSG 16
-#define LINUX_RECVMSG 17
#define LINUX_AF_UNSPEC 0
#define LINUX_AF_UNIX 1
@@ -515,21 +512,6 @@ struct trapframe;
#define LINUX_IP_DROP_MEMBERSHIP 36
/* Sound system defines */
-#define LINUX_SNDCTL_SEQ_RESET 0x5100
-#define LINUX_SNDCTL_SEQ_SYNC 0x5101
-#define LINUX_SNDCTL_SYNTH_INFO 0x5102
-#define LINUX_SNDCTL_SEQ_CTRLRATE 0x5103
-#define LINUX_SNDCTL_SEQ_GETOUTCOUNT 0x5104
-#define LINUX_SNDCTL_SEQ_GETINCOUNT 0x5105
-#define LINUX_SNDCTL_SEQ_PERCMODE 0x5106
-#define LINUX_SNDCTL_FM_LOAD_INSTR 0x5107
-#define LINUX_SNDCTL_SEQ_TESTMIDI 0x5108
-#define LINUX_SNDCTL_SEQ_RESETSAMPLES 0x5109
-#define LINUX_SNDCTL_SEQ_NRSYNTHS 0x510A
-#define LINUX_SNDCTL_SEQ_NRMIDIS 0x510B
-#define LINUX_SNDCTL_MIDI_INFO 0x510C
-#define LINUX_SNDCTL_SEQ_TRESHOLD 0x510D
-#define LINUX_SNDCTL_SYNTH_MEMAVL 0x510E
#define LINUX_SNDCTL_DSP_RESET 0x5000
#define LINUX_SNDCTL_DSP_SYNC 0x5001
#define LINUX_SNDCTL_DSP_SPEED 0x5002
diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c
index 6a7ce1e828023..30a0dba494493 100644
--- a/sys/i386/linux/linux_dummy.c
+++ b/sys/i386/linux/linux_dummy.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_dummy.c,v 1.8 1997/11/06 19:28:52 phk Exp $
+ * $Id: linux_dummy.c,v 1.7 1997/10/29 08:17:09 kato Exp $
*/
#include <sys/param.h>
@@ -212,6 +212,13 @@ linux_sysinfo(struct proc *p, struct linux_sysinfo_args *args)
}
int
+linux_clone(struct proc *p, struct linux_clone_args *args)
+{
+ printf("Linux-emul(%d): clone() not supported\n", p->p_pid);
+ return ENOSYS;
+}
+
+int
linux_uname(struct proc *p, struct linux_uname_args *args)
{
printf("Linux-emul(%d): uname() not supported\n", p->p_pid);
diff --git a/sys/i386/linux/linux_file.c b/sys/i386/linux/linux_file.c
index 16f12ed4d7bea..6a80d4c5ec665 100644
--- a/sys/i386/linux/linux_file.c
+++ b/sys/i386/linux/linux_file.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_file.c,v 1.22 1998/10/05 16:37:36 jfieber Exp $
+ * $Id: linux_file.c,v 1.21 1998/07/29 16:43:00 bde Exp $
*/
#include "opt_compat.h"
@@ -812,7 +812,7 @@ linux_readlink(struct proc *p, struct linux_readlink_args *args)
int
linux_truncate(struct proc *p, struct linux_truncate_args *args)
{
- struct truncate_args bsd;
+ struct otruncate_args bsd;
caddr_t sg;
sg = stackgap_init();
@@ -825,6 +825,6 @@ linux_truncate(struct proc *p, struct linux_truncate_args *args)
bsd.path = args->path;
bsd.length = args->length;
- return truncate(p, &bsd);
+ return otruncate(p, &bsd);
}
diff --git a/sys/i386/linux/linux_ioctl.c b/sys/i386/linux/linux_ioctl.c
index 3010f74116bdf..26bb5ab710fc8 100644
--- a/sys/i386/linux/linux_ioctl.c
+++ b/sys/i386/linux/linux_ioctl.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_ioctl.c,v 1.29 1998/09/30 01:42:53 jfieber Exp $
+ * $Id: linux_ioctl.c,v 1.28 1998/08/31 10:53:33 jkh Exp $
*/
#include <sys/param.h>
@@ -683,66 +683,6 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args)
return copyout(&linux_line, (caddr_t)args->arg,
sizeof(int));
- case LINUX_SNDCTL_SEQ_RESET:
- args->cmd = SNDCTL_SEQ_RESET;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_SYNC:
- args->cmd = SNDCTL_SEQ_SYNC;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SYNTH_INFO:
- args->cmd = SNDCTL_SYNTH_INFO;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_CTRLRATE:
- args->cmd = SNDCTL_SEQ_CTRLRATE;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_GETOUTCOUNT:
- args->cmd = SNDCTL_SEQ_GETOUTCOUNT;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_GETINCOUNT:
- args->cmd = SNDCTL_SEQ_GETINCOUNT;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_PERCMODE:
- args->cmd = SNDCTL_SEQ_PERCMODE;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_FM_LOAD_INSTR:
- args->cmd = SNDCTL_FM_LOAD_INSTR;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_TESTMIDI:
- args->cmd = SNDCTL_SEQ_TESTMIDI;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_RESETSAMPLES:
- args->cmd = SNDCTL_SEQ_RESETSAMPLES;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_NRSYNTHS:
- args->cmd = SNDCTL_SEQ_NRSYNTHS;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_NRMIDIS:
- args->cmd = SNDCTL_SEQ_NRMIDIS;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_MIDI_INFO:
- args->cmd = SNDCTL_MIDI_INFO;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SEQ_TRESHOLD:
- args->cmd = SNDCTL_SEQ_TRESHOLD;
- return ioctl(p, (struct ioctl_args *)args);
-
- case LINUX_SNDCTL_SYNTH_MEMAVL:
- args->cmd = SNDCTL_SYNTH_MEMAVL;
- return ioctl(p, (struct ioctl_args *)args);
-
case LINUX_SNDCTL_DSP_GETOPTR :
args->cmd = SNDCTL_DSP_GETOPTR;
return ioctl(p, (struct ioctl_args *)args);
diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c
index 02f9785fa8a36..9fdd923276749 100644
--- a/sys/i386/linux/linux_misc.c
+++ b/sys/i386/linux/linux_misc.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_misc.c,v 1.50 1998/12/30 21:01:33 sos Exp $
+ * $Id: linux_misc.c,v 1.44 1998/09/24 13:25:43 jkh Exp $
*/
#include <sys/param.h>
@@ -41,9 +41,6 @@
#include <sys/resourcevar.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <sys/unistd.h>
-#endif /* COMPAT_LINUX_THREADS */
#include <sys/vnode.h>
#include <sys/wait.h>
#include <sys/time.h>
@@ -563,79 +560,6 @@ linux_fork(struct proc *p, struct linux_fork_args *args)
return 0;
}
-#ifndef COMPAT_LINUX_THREADS
-int
-linux_clone(struct proc *p, struct linux_clone_args *args)
-{
- printf("linux_clone(%d): Not enabled\n", p->p_pid);
- return (EOPNOTSUPP);
-}
-
-#else
-#define CLONE_VM 0x100
-#define CLONE_FS 0x200
-#define CLONE_FILES 0x400
-#define CLONE_SIGHAND 0x800
-#define CLONE_PID 0x1000
-
-int
-linux_clone(struct proc *p, struct linux_clone_args *args)
-{
- int error, ff = RFPROC;
- struct proc *p2;
- int exit_signal;
- vm_offset_t start;
- struct rfork_args rf_args;
-
-#ifdef SMP
- printf("linux_clone(%d): does not work with SMP yet\n", p->p_pid);
- return (EOPNOTSUPP);
-#endif
-#ifdef DEBUG
- if (args->flags & CLONE_PID)
- printf("linux_clone(%d): CLONE_PID not yet supported\n", p->p_pid);
- printf ("linux_clone(%d): invoked with flags %x and stack %x\n", p->p_pid,
- (unsigned int)args->flags, (unsigned int)args->stack);
-#endif
-
- if (!args->stack)
- return (EINVAL);
- exit_signal = args->flags & 0x000000ff;
- if (exit_signal >= LINUX_NSIG)
- return EINVAL;
- exit_signal = linux_to_bsd_signal[exit_signal];
-
- /* RFTHREAD probably not necessary here, but it shouldn't hurt either */
- ff |= RFTHREAD;
-
- if (args->flags & CLONE_VM)
- ff |= RFMEM;
- if (args->flags & CLONE_SIGHAND)
- ff |= RFSIGSHARE;
- if (!(args->flags & CLONE_FILES))
- ff |= RFFDG;
-
- error = 0;
- start = 0;
-
- rf_args.flags = ff;
- if (error = rfork(p, &rf_args))
- return error;
-
- p2 = pfind(p->p_retval[0]);
- if (p2 == 0)
- return ESRCH;
-
- p2->p_sigparent = exit_signal;
- p2->p_md.md_regs->tf_esp = (unsigned int)args->stack;
-
-#ifdef DEBUG
- printf ("linux_clone(%d): successful rfork to %d\n", p->p_pid, p2->p_pid);
-#endif
- return 0;
-}
-
-#endif /* COMPAT_LINUX_THREADS */
/* XXX move */
struct linux_mmap_argv {
linux_caddr_t addr;
@@ -646,11 +570,6 @@ struct linux_mmap_argv {
int pos;
};
-#ifdef COMPAT_LINUX_THREADS
-#define STACK_SIZE (2 * 1024 * 1024)
-#define GUARD_SIZE (4 * PAGE_SIZE)
-
-#endif /* COMPAT_LINUX_THREADS */
int
linux_mmap(struct proc *p, struct linux_mmap_args *args)
{
@@ -683,69 +602,8 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args)
bsd_args.flags |= MAP_FIXED;
if (linux_args.flags & LINUX_MAP_ANON)
bsd_args.flags |= MAP_ANON;
-#ifndef COMPAT_LINUX_THREADS
bsd_args.addr = linux_args.addr;
bsd_args.len = linux_args.len;
-#else
-
-#ifndef VM_STACK
- /* Linux Threads will map into the proc stack space, unless
- * we prevent it. This causes problems if we're not using
- * our VM_STACK options.
- */
- if ((unsigned int)linux_args.addr + linux_args.len > (USRSTACK - MAXSSIZ))
- return (EINVAL);
-#endif
-
- if (linux_args.flags & LINUX_MAP_GROWSDOWN) {
-
-#ifdef VM_STACK
- bsd_args.flags |= MAP_STACK;
-#endif
-
- /* The linux MAP_GROWSDOWN option does not limit auto
- * growth of the region. Linux mmap with this option
- * takes as addr the inital BOS, and as len, the initial
- * region size. It can then grow down from addr without
- * limit. However, linux threads has an implicit internal
- * limit to stack size of STACK_SIZE. Its just not
- * enforced explicitly in linux. But, here we impose
- * a limit of (STACK_SIZE - GUARD_SIZE) on the stack
- * region, since we can do this with our mmap.
- *
- * Our mmap with MAP_STACK takes addr as the maximum
- * downsize limit on BOS, and as len the max size of
- * the region. It them maps the top SGROWSIZ bytes,
- * and autgrows the region down, up to the limit
- * in addr.
- *
- * If we don't use the MAP_STACK option, the effect
- * of this code is to allocate a stack region of a
- * fixed size of (STACK_SIZE - GUARD_SIZE).
- */
-
- /* This gives us TOS */
- bsd_args.addr = linux_args.addr + linux_args.len;
-
- /* This gives us our maximum stack size */
- if (linux_args.len > STACK_SIZE - GUARD_SIZE)
- bsd_args.len = linux_args.len;
- else
- bsd_args.len = STACK_SIZE - GUARD_SIZE;
-
- /* This gives us a new BOS. If we're using VM_STACK, then
- * mmap will just map the top SGROWSIZ bytes, and let
- * the stack grow down to the limit at BOS. If we're
- * not using VM_STACK we map the full stack, since we
- * don't have a way to autogrow it.
- */
- bsd_args.addr -= bsd_args.len;
-
- } else {
- bsd_args.addr = linux_args.addr;
- bsd_args.len = linux_args.len;
- }
-#endif /* COMPAT_LINUX_THREADS */
bsd_args.prot = linux_args.prot | PROT_READ; /* always required */
bsd_args.fd = linux_args.fd;
bsd_args.pos = linux_args.pos;
@@ -801,23 +659,14 @@ int
linux_pipe(struct proc *p, struct linux_pipe_args *args)
{
int error;
- int reg_edx;
#ifdef DEBUG
printf("Linux-emul(%d): pipe(*)\n", p->p_pid);
#endif
- reg_edx = p->p_retval[1];
- if (error = pipe(p, 0)) {
- p->p_retval[1] = reg_edx;
+ if (error = pipe(p, 0))
return error;
- }
-
- if (error = copyout(p->p_retval, args->pipefds, 2*sizeof(int))) {
- p->p_retval[1] = reg_edx;
+ if (error = copyout(p->p_retval, args->pipefds, 2*sizeof(int)))
return error;
- }
-
- p->p_retval[1] = reg_edx;
p->p_retval[0] = 0;
return 0;
}
@@ -897,18 +746,12 @@ linux_newuname(struct proc *p, struct linux_newuname_args *args)
printf("Linux-emul(%d): newuname(*)\n", p->p_pid);
#endif
bzero(&linux_newuname, sizeof(struct linux_newuname_t));
- strncpy(linux_newuname.sysname, ostype,
- sizeof(linux_newuname.sysname) - 1);
- strncpy(linux_newuname.nodename, hostname,
- sizeof(linux_newuname.nodename) - 1);
- strncpy(linux_newuname.release, osrelease,
- sizeof(linux_newuname.release) - 1);
- strncpy(linux_newuname.version, version,
- sizeof(linux_newuname.version) - 1);
- strncpy(linux_newuname.machine, machine,
- sizeof(linux_newuname.machine) - 1);
- strncpy(linux_newuname.domainname, domainname,
- sizeof(linux_newuname.domainname) - 1);
+ strncpy(linux_newuname.sysname, ostype, 64);
+ strncpy(linux_newuname.nodename, hostname, 64);
+ strncpy(linux_newuname.release, osrelease, 64);
+ strncpy(linux_newuname.version, version, 64);
+ strncpy(linux_newuname.machine, machine, 64);
+ strncpy(linux_newuname.domainname, domainname, 64);
return (copyout((caddr_t)&linux_newuname, (caddr_t)args->buf,
sizeof(struct linux_newuname_t)));
}
@@ -972,25 +815,11 @@ linux_waitpid(struct proc *p, struct linux_waitpid_args *args)
#endif
tmp.pid = args->pid;
tmp.status = args->status;
-#ifndef COMPAT_LINUX_THREADS
tmp.options = args->options;
-#else
- /* This filters out the linux option _WCLONE. I don't
- * think we need it, but I could be wrong. If we need
- * it, we need to fix wait4, since it will give us an
- * error return of EINVAL if we pass in _WCLONE, and
- * of course, it won't do anything with it.
- */
- tmp.options = (args->options & (WNOHANG | WUNTRACED));
-#endif /* COMPAT_LINUX_THREADS */
tmp.rusage = NULL;
if (error = wait4(p, &tmp))
-#ifndef COMPAT_LINUX_THREADS
- return error;
-#else
return error;
-#endif /* COMPAT_LINUX_THREADS */
if (args->status) {
if (error = copyin(args->status, &tmpstat, sizeof(int)))
return error;
@@ -1023,17 +852,7 @@ linux_wait4(struct proc *p, struct linux_wait4_args *args)
#endif
tmp.pid = args->pid;
tmp.status = args->status;
-#ifndef COMPAT_LINUX_THREADS
tmp.options = args->options;
-#else
- /* This filters out the linux option _WCLONE. I don't
- * think we need it, but I could be wrong. If we need
- * it, we need to fix wait4, since it will give us an
- * error return of EINVAL if we pass in _WCLONE, and
- * of course, it won't do anything with it.
- */
- tmp.options = (args->options & (WNOHANG | WUNTRACED));
-#endif /* COMPAT_LINUX_THREADS */
tmp.rusage = args->rusage;
if (error = wait4(p, &tmp))
@@ -1170,75 +989,3 @@ linux_nice(struct proc *p, struct linux_nice_args *args)
return setpriority(p, &bsd_args);
}
-int
-linux_setgroups(p, uap)
- struct proc *p;
- struct linux_setgroups_args *uap;
-{
- struct pcred *pc = p->p_cred;
- linux_gid_t linux_gidset[NGROUPS];
- gid_t *bsd_gidset;
- int ngrp, error;
-
- if ((error = suser(pc->pc_ucred, &p->p_acflag)))
- return error;
-
- if (uap->gidsetsize > NGROUPS)
- return EINVAL;
-
- ngrp = uap->gidsetsize;
- pc->pc_ucred = crcopy(pc->pc_ucred);
- if (ngrp >= 1) {
- if ((error = copyin((caddr_t)uap->gidset,
- (caddr_t)linux_gidset,
- ngrp * sizeof(linux_gid_t))))
- return error;
-
- pc->pc_ucred->cr_ngroups = ngrp;
-
- bsd_gidset = pc->pc_ucred->cr_groups;
- ngrp--;
- while (ngrp >= 0) {
- bsd_gidset[ngrp] = linux_gidset[ngrp];
- ngrp--;
- }
- }
- else
- pc->pc_ucred->cr_ngroups = 1;
-
- setsugid(p);
- return 0;
-}
-
-int
-linux_getgroups(p, uap)
- struct proc *p;
- struct linux_getgroups_args *uap;
-{
- struct pcred *pc = p->p_cred;
- linux_gid_t linux_gidset[NGROUPS];
- gid_t *bsd_gidset;
- int ngrp, error;
-
- if ((ngrp = uap->gidsetsize) == 0) {
- p->p_retval[0] = pc->pc_ucred->cr_ngroups;
- return 0;
- }
-
- if (ngrp < pc->pc_ucred->cr_ngroups)
- return EINVAL;
-
- ngrp = 0;
- bsd_gidset = pc->pc_ucred->cr_groups;
- while (ngrp < pc->pc_ucred->cr_ngroups) {
- linux_gidset[ngrp] = bsd_gidset[ngrp];
- ngrp++;
- }
-
- if ((error = copyout((caddr_t)linux_gidset, (caddr_t)uap->gidset,
- ngrp * sizeof(linux_gid_t))))
- return error;
-
- p->p_retval[0] = ngrp;
- return (0);
-}
diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h
index cda56c279d8b4..eedb56606a4c3 100644
--- a/sys/i386/linux/linux_proto.h
+++ b/sys/i386/linux/linux_proto.h
@@ -2,7 +2,7 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.16 1998/12/30 20:58:28 sos Exp
+ * created from Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp
*/
#ifndef _LINUX_SYSPROTO_H_
@@ -195,14 +195,6 @@ struct linux_sigsuspend_args {
struct linux_sigpending_args {
linux_sigset_t * mask; char mask_[PAD_(linux_sigset_t *)];
};
-struct linux_getgroups_args {
- u_int gidsetsize; char gidsetsize_[PAD_(u_int)];
- linux_gid_t * gidset; char gidset_[PAD_(linux_gid_t *)];
-};
-struct linux_setgroups_args {
- u_int gidsetsize; char gidsetsize_[PAD_(u_int)];
- linux_gid_t * gidset; char gidset_[PAD_(linux_gid_t *)];
-};
struct linux_select_args {
struct linux_select_argv * ptr; char ptr_[PAD_(struct linux_select_argv *)];
};
@@ -309,8 +301,7 @@ struct linux_sigreturn_args {
struct linux_sigcontext * scp; char scp_[PAD_(struct linux_sigcontext *)];
};
struct linux_clone_args {
- int flags; char flags_[PAD_(int)];
- void * stack; char stack_[PAD_(void *)];
+ register_t dummy;
};
struct linux_newuname_args {
struct linux_newuname_t * buf; char buf_[PAD_(struct linux_newuname_t *)];
@@ -437,8 +428,6 @@ int linux_siggetmask __P((struct proc *, struct linux_siggetmask_args *));
int linux_sigsetmask __P((struct proc *, struct linux_sigsetmask_args *));
int linux_sigsuspend __P((struct proc *, struct linux_sigsuspend_args *));
int linux_sigpending __P((struct proc *, struct linux_sigpending_args *));
-int linux_getgroups __P((struct proc *, struct linux_getgroups_args *));
-int linux_setgroups __P((struct proc *, struct linux_setgroups_args *));
int linux_select __P((struct proc *, struct linux_select_args *));
int linux_symlink __P((struct proc *, struct linux_symlink_args *));
int linux_readlink __P((struct proc *, struct linux_readlink_args *));
diff --git a/sys/i386/linux/linux_signal.c b/sys/i386/linux/linux_signal.c
index 1f71bf53df09b..481ed7f177536 100644
--- a/sys/i386/linux/linux_signal.c
+++ b/sys/i386/linux/linux_signal.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_signal.c,v 1.13 1998/10/11 04:54:16 jdp Exp $
+ * $Id: linux_signal.c,v 1.12 1998/08/15 22:29:43 bde Exp $
*/
#include <sys/param.h>
@@ -310,7 +310,7 @@ linux_kill(struct proc *p, struct linux_kill_args *args)
printf("Linux-emul(%d): kill(%d, %d)\n",
p->p_pid, args->pid, args->signum);
#endif
- if (args->signum < 0 || args->signum >= LINUX_NSIG)
+ if (args->signum <= 0 || args->signum >= LINUX_NSIG)
return EINVAL;
tmp.pid = args->pid;
tmp.signum = linux_to_bsd_signal[args->signum];
diff --git a/sys/i386/linux/linux_socket.c b/sys/i386/linux/linux_socket.c
index e757fc13c7f81..b50cf5860e319 100644
--- a/sys/i386/linux/linux_socket.c
+++ b/sys/i386/linux/linux_socket.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_socket.c,v 1.14 1998/12/30 21:20:00 sos Exp $
+ * $Id: linux_socket.c,v 1.12 1998/02/07 02:13:27 msmith Exp $
*/
/* XXX we use functions that might not exist. */
@@ -810,44 +810,6 @@ linux_socketcall(struct proc *p, struct linux_socketcall_args *args)
return linux_setsockopt(p, args->args);
case LINUX_GETSOCKOPT:
return linux_getsockopt(p, args->args);
- case LINUX_SENDMSG:
- do {
- int error;
- int level;
- caddr_t control;
- struct {
- int s;
- const struct msghdr *msg;
- int flags;
- } *uap = args->args;
-
- error = copyin(&uap->msg->msg_control,
- &control, sizeof(caddr_t));
- if (error)
- return error;
- if (control == NULL)
- goto done;
- error = copyin(&((struct cmsghdr *)control)->cmsg_level,
- &level, sizeof(int));
- if (error)
- return error;
- if (level == 1) {
- /*
- * Linux thinks that SOL_SOCKET is 1; we know that it's really
- * 0xffff, of course.
- */
- level = SOL_SOCKET;
- error = copyout(&level, &((struct cmsghdr *)control)->
- cmsg_level, sizeof(int));
- if (error)
- return error;
- }
- done:
- return sendmsg(p, args->args);
- } while (0);
- case LINUX_RECVMSG:
- return recvmsg(p, args->args);
-
default:
uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what);
return ENOSYS;
diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h
index e30d836f2406e..c0b7147531562 100644
--- a/sys/i386/linux/linux_syscall.h
+++ b/sys/i386/linux/linux_syscall.h
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.16 1998/12/30 20:58:28 sos Exp
+ * created from Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp
*/
#define LINUX_SYS_linux_setup 0
@@ -85,8 +85,8 @@
#define LINUX_SYS_getrusage 77
#define LINUX_SYS_gettimeofday 78
#define LINUX_SYS_settimeofday 79
-#define LINUX_SYS_linux_getgroups 80
-#define LINUX_SYS_linux_setgroups 81
+#define LINUX_SYS_getgroups 80
+#define LINUX_SYS_setgroups 81
#define LINUX_SYS_linux_select 82
#define LINUX_SYS_linux_symlink 83
#define LINUX_SYS_ostat 84
@@ -162,6 +162,5 @@
#define LINUX_SYS_sched_rr_get_interval 161
#define LINUX_SYS_nanosleep 162
#define LINUX_SYS_linux_mremap 163
-#define LINUX_SYS_poll 168
#define LINUX_SYS_linux_chown 182
#define LINUX_SYS_MAXSYSCALL 183
diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c
index a5e8bdbf7bc72..da9ac246a517b 100644
--- a/sys/i386/linux/linux_sysent.c
+++ b/sys/i386/linux/linux_sysent.c
@@ -2,7 +2,7 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.16 1998/12/30 20:58:28 sos Exp
+ * created from Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp
*/
#include "opt_compat.h"
@@ -94,8 +94,8 @@ struct sysent linux_sysent[] = {
{ 2, (sy_call_t *)getrusage }, /* 77 = getrusage */
{ 2, (sy_call_t *)gettimeofday }, /* 78 = gettimeofday */
{ 2, (sy_call_t *)settimeofday }, /* 79 = settimeofday */
- { 2, (sy_call_t *)linux_getgroups }, /* 80 = linux_getgroups */
- { 2, (sy_call_t *)linux_setgroups }, /* 81 = linux_setgroups */
+ { 2, (sy_call_t *)getgroups }, /* 80 = getgroups */
+ { 2, (sy_call_t *)setgroups }, /* 81 = setgroups */
{ 1, (sy_call_t *)linux_select }, /* 82 = linux_select */
{ 2, (sy_call_t *)linux_symlink }, /* 83 = linux_symlink */
{ 2, (sy_call_t *)ostat }, /* 84 = ostat */
@@ -134,7 +134,7 @@ struct sysent linux_sysent[] = {
{ 5, (sy_call_t *)linux_ipc }, /* 117 = linux_ipc */
{ 1, (sy_call_t *)fsync }, /* 118 = fsync */
{ 1, (sy_call_t *)linux_sigreturn }, /* 119 = linux_sigreturn */
- { 2, (sy_call_t *)linux_clone }, /* 120 = linux_clone */
+ { 0, (sy_call_t *)linux_clone }, /* 120 = linux_clone */
{ 2, (sy_call_t *)setdomainname }, /* 121 = setdomainname */
{ 1, (sy_call_t *)linux_newuname }, /* 122 = linux_newuname */
{ 3, (sy_call_t *)linux_modify_ldt }, /* 123 = linux_modify_ldt */
@@ -182,7 +182,7 @@ struct sysent linux_sysent[] = {
{ 0, (sy_call_t *)nosys }, /* 165 = getresuid */
{ 0, (sy_call_t *)nosys }, /* 166 = new_vm86 */
{ 0, (sy_call_t *)nosys }, /* 167 = query_module */
- { 3, (sy_call_t *)poll }, /* 168 = poll */
+ { 0, (sy_call_t *)nosys }, /* 168 = poll */
{ 0, (sy_call_t *)nosys }, /* 169 = nfsservctl */
{ 0, (sy_call_t *)nosys }, /* 170 = setresgid */
{ 0, (sy_call_t *)nosys }, /* 171 = getresgid */
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index fd80f1d438e86..cf8c021c53fe8 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_sysvec.c,v 1.43 1999/01/06 23:05:38 julian Exp $
+ * $Id: linux_sysvec.c,v 1.36 1998/10/11 21:08:02 alex Exp $
*/
/* XXX we use functions that might not exist. */
@@ -70,7 +70,7 @@ static void linux_sendsig __P((sig_t catcher, int sig, int mask,
/*
* Linux syscalls return negative errno's, we do positive and map them
*/
-static int bsd_to_linux_errno[ELAST + 1] = {
+static int bsd_to_linux_errno[ELAST] = {
-0, -1, -2, -3, -4, -5, -6, -7, -8, -9,
-10, -35, -12, -13, -14, -15, -16, -17, -18, -19,
-20, -21, -22, -23, -24, -25, -26, -27, -28, -29,
@@ -79,7 +79,7 @@ static int bsd_to_linux_errno[ELAST + 1] = {
-100,-101,-102,-103,-104,-105,-106,-107,-108,-109,
-110,-111, -40, -36,-112,-113, -39, -11, -87,-122,
-116, -66, -6, -6, -6, -6, -6, -37, -38, -9,
- -6, -6, -43, -42, -75, -6, -84
+ -6, -43, -42
};
int bsd_to_linux_signal[NSIG] = {
@@ -217,11 +217,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
* and the stack can not be grown. useracc will return FALSE
* if access is denied.
*/
-#ifdef VM_STACK
- if ((grow_stack (p, (int)fp) == FALSE) ||
-#else
if ((grow(p, (int)fp) == FALSE) ||
-#endif
(useracc((caddr_t)fp, sizeof (struct linux_sigframe), B_WRITE) == FALSE)) {
/*
* Process has trashed its stack; give it an illegal
@@ -285,7 +281,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
* Build context to run handler in.
*/
regs->tf_esp = (int)fp;
- regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
regs->tf_eflags &= ~PSL_VM;
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
@@ -399,7 +395,7 @@ struct sysentvec linux_sysvec = {
0xff,
NSIG,
bsd_to_linux_signal,
- ELAST + 1,
+ ELAST,
bsd_to_linux_errno,
translate_traps,
linux_fixup,
@@ -417,7 +413,7 @@ struct sysentvec elf_linux_sysvec = {
0xff,
NSIG,
bsd_to_linux_signal,
- ELAST + 1,
+ ELAST,
bsd_to_linux_errno,
translate_traps,
elf_linux_fixup,
@@ -429,6 +425,9 @@ struct sysentvec elf_linux_sysvec = {
elf_coredump
};
+/*
+ * Installed either via SYSINIT() or via LKM stubs.
+ */
static Elf32_Brandinfo linux_brand = {
"Linux",
"/compat/linux",
@@ -449,8 +448,14 @@ Elf32_Brandinfo *linux_brandlist[] = {
NULL
};
+/*
+ * XXX: this is WRONG, it needs to be SI_SUB_EXEC, but this is just at the
+ * "proof of concept" stage and will be fixed shortly
+ */
+static int linux_elf_modevent __P((module_t mod, modeventtype_t type, void *data));
+
static int
-linux_elf_modevent(module_t mod, int type, void *data)
+linux_elf_modevent(module_t mod, modeventtype_t type, void *data)
{
Elf32_Brandinfo **brandinfo;
int error;
diff --git a/sys/i386/linux/linux_util.h b/sys/i386/linux/linux_util.h
index 07a2d3ce686e8..58a477d67e9b9 100644
--- a/sys/i386/linux/linux_util.h
+++ b/sys/i386/linux/linux_util.h
@@ -28,7 +28,7 @@
*
* from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp
* from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp
- * $Id: linux_util.h,v 1.6 1998/06/30 08:40:33 jmg Exp $
+ * $Id: linux_util.h,v 1.5 1997/02/22 09:38:30 peter Exp $
*/
/*
@@ -60,7 +60,7 @@ static __inline caddr_t
stackgap_init()
{
#define szsigcode (*(curproc->p_sysent->sv_szsigcode))
- return (caddr_t)(PS_STRINGS - szsigcode - SPARE_USRSPACE);
+ return (caddr_t)(((caddr_t)PS_STRINGS) - szsigcode - SPARE_USRSPACE);
}
diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master
index c4cc425be69a0..912cb3244597e 100644
--- a/sys/i386/linux/syscalls.master
+++ b/sys/i386/linux/syscalls.master
@@ -1,4 +1,4 @@
- $Id: syscalls.master,v 1.15 1998/12/22 08:59:19 sos Exp $
+ $Id: syscalls.master,v 1.11 1998/06/09 03:28:14 bde Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
; System call name/number master file (or rather, slave, from LINUX).
@@ -119,10 +119,8 @@
struct timezone *tzp); }
79 NOPROTO LINUX { int settimeofday(struct timeval *tp, \
struct timezone *tzp); }
-80 STD LINUX { int linux_getgroups(u_int gidsetsize, \
- linux_gid_t *gidset); }
-81 STD LINUX { int linux_setgroups(u_int gidsetsize, \
- linux_gid_t *gidset); }
+80 NOPROTO LINUX { int getgroups(u_int gidsetsize, gid_t *gidset); }
+81 NOPROTO LINUX { int setgroups(u_int gidsetsize, gid_t *gidset); }
82 STD LINUX { int linux_select(struct linux_select_argv *ptr); }
83 STD LINUX { int linux_symlink(char *path, char *to); }
84 NOPROTO LINUX { int ostat(char *path, struct ostat *up); }
@@ -173,7 +171,7 @@
caddr_t ptr); }
118 NOPROTO LINUX { int fsync(int fd); }
119 STD LINUX { int linux_sigreturn(struct linux_sigcontext *scp); }
-120 STD LINUX { int linux_clone(int flags, void *stack); }
+120 STD LINUX { int linux_clone(void); }
121 NOPROTO LINUX { int setdomainname(char *name, \
int len); }
122 STD LINUX { int linux_newuname(struct linux_newuname_t *buf); }
@@ -241,8 +239,7 @@
165 UNIMPL LINUX getresuid
166 UNIMPL LINUX new_vm86
167 UNIMPL LINUX query_module
-168 NOPROTO LINUX { int poll(struct pollfd*, unsigned int nfds, \
- long timeout); }
+168 UNIMPL LINUX poll
169 UNIMPL LINUX nfsservctl
170 UNIMPL LINUX setresgid
171 UNIMPL LINUX getresgid
diff --git a/sys/i4b/driver/i4b_ctl.c b/sys/i4b/driver/i4b_ctl.c
deleted file mode 100644
index 04c63c1f6e6a6..0000000000000
--- a/sys/i4b/driver/i4b_ctl.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ctl.c - i4b system control port driver
- * ------------------------------------------
- *
- * $Id: i4b_ctl.c,v 1.1 1998/12/27 21:46:42 phk Exp $
- *
- * last edit-date: [Sat Dec 5 17:59:15 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4bctl.h"
-
-#if NI4BCTL > 1
-#error "only 1 (one) i4bctl device allowed!"
-#endif
-
-#if NI4BCTL > 0
-
-#include <sys/param.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/layer1/i4b_l1.h>
-
-static int openflag = 0;
-
-#if BSD > 199306 && defined(__FreeBSD__)
-static d_open_t i4bctlopen;
-static d_close_t i4bctlclose;
-static d_ioctl_t i4bctlioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-static d_poll_t i4bctlpoll;
-#endif
-
-#define CDEV_MAJOR 55
-static struct cdevsw i4bctl_cdevsw =
- { i4bctlopen, i4bctlclose, noread, nowrite,
- i4bctlioctl, nostop, nullreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4bctlpoll, nommap, NULL, "i4bctl", NULL, -1 };
-#else
- noselect, nommap, NULL, "i4bctl", NULL, -1 };
-#endif
-
-static void i4bctlattach(void *);
-PSEUDO_SET(i4bctlattach, i4b_i4bctldrv);
-
-#define PDEVSTATIC static
-#endif /* __FreeBSD__ */
-
-#ifdef DEVFS
-static void *devfs_token;
-#endif
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* */
-void i4bctlattach __P((void));
-int i4bctlopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4bctlclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4bctlioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-#endif /* !FreeBSD */
-
-#if BSD > 199306 && defined(__FreeBSD__)
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-i4bctlinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4bctl_cdevsw, NULL);
-}
-
-SYSINIT(i4bctldev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &i4bctlinit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4bctlattach(void *dummy)
-#else
-i4bctlattach()
-#endif
-{
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4bctl: ISDN system control port attached\n");
-#endif
-#ifdef DEVFS
- devfs_token = devfs_add_devswf(&i4bctl_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4bctl");
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlopen - device driver open routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bctlopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- if(minor(dev))
- return (ENXIO);
-
- if(openflag)
- return (EBUSY);
-
- openflag = 1;
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlclose - device driver close routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bctlclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- openflag = 0;
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
-i4bctlioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4bctlioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- ctl_debug_t *cdbg;
- int error = 0;
-
-#ifndef DO_I4B_DEBUG
- return(ENODEV);
-#else
- if(minor(dev))
- return(ENODEV);
-
- switch(cmd)
- {
- case I4B_CTL_GET_DEBUG:
- cdbg = (ctl_debug_t *)data;
- cdbg->l1 = i4b_l1_debug;
- cdbg->l2 = i4b_l2_debug;
- cdbg->l3 = i4b_l3_debug;
- cdbg->l4 = i4b_l4_debug;
- break;
-
- case I4B_CTL_SET_DEBUG:
- cdbg = (ctl_debug_t *)data;
- i4b_l1_debug = cdbg->l1;
- i4b_l2_debug = cdbg->l2;
- i4b_l3_debug = cdbg->l3;
- i4b_l4_debug = cdbg->l4;
- break;
-
- case I4B_CTL_GET_HSCXSTAT:
- {
- hscxstat_t *hst;
- struct isic_softc *sc;
- hst = (hscxstat_t *)data;
-
- if( hst->unit < 0 ||
- hst->unit > ISIC_MAXUNIT ||
- hst->chan < 0 ||
- hst->chan > 1 )
- {
- error = EINVAL;
- break;
- }
-
-#ifndef __FreeBSD__
- sc = isic_find_sc(hst->unit);
-#else
- sc = &isic_sc[hst->unit];
-#endif
- hst->vfr = sc->sc_chan[hst->chan].stat_VFR;
- hst->rdo = sc->sc_chan[hst->chan].stat_RDO;
- hst->crc = sc->sc_chan[hst->chan].stat_CRC;
- hst->rab = sc->sc_chan[hst->chan].stat_RAB;
- hst->xdu = sc->sc_chan[hst->chan].stat_XDU;
- hst->rfo = sc->sc_chan[hst->chan].stat_RFO;
- break;
- }
-
- case I4B_CTL_CLR_HSCXSTAT:
- {
- hscxstat_t *hst;
- struct isic_softc *sc;
- hst = (hscxstat_t *)data;
-
- if( hst->unit < 0 ||
- hst->unit > ISIC_MAXUNIT ||
- hst->chan < 0 ||
- hst->chan > 1 )
- {
- error = EINVAL;
- break;
- }
-
-#ifndef __FreeBSD__
- sc = isic_find_sc(hst->unit);
-#else
- sc = &isic_sc[hst->unit];
-#endif
-
- sc->sc_chan[hst->chan].stat_VFR = 0;
- sc->sc_chan[hst->chan].stat_RDO = 0;
- sc->sc_chan[hst->chan].stat_CRC = 0;
- sc->sc_chan[hst->chan].stat_RAB = 0;
- sc->sc_chan[hst->chan].stat_XDU = 0;
- sc->sc_chan[hst->chan].stat_RFO = 0;
-
- break;
- }
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-#endif DO_I4B_DEBUG
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlpoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-static int
-i4bctlpoll (dev_t dev, int events, struct proc *p)
-{
- return (ENODEV);
-}
-#endif
-
-#endif /* NI4BCTL > 0 */
diff --git a/sys/i4b/driver/i4b_ipr.c b/sys/i4b/driver/i4b_ipr.c
deleted file mode 100644
index df3977cb72af3..0000000000000
--- a/sys/i4b/driver/i4b_ipr.c
+++ /dev/null
@@ -1,1115 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ipr.c - isdn4bsd IP over raw HDLC ISDN network driver
- * ---------------------------------------------------------
- *
- * $Id: i4b_ipr.c,v 1.42 1998/12/18 14:20:44 hm Exp $
- *
- * last edit-date: [Fri Dec 18 11:50:47 1998]
- *
- *---------------------------------------------------------------------------*
- *
- * statistics counter usage (interface lifetime):
- * ----------------------------------------------
- * sc->sc_if.if_ipackets # of received packets
- * sc->sc_if.if_ierrors # of error packets not going to upper layers
- * sc->sc_if.if_opackets # of transmitted packets
- * sc->sc_if.if_oerrors # of error packets not being transmitted
- * sc->sc_if.if_collisions # of invalid ip packets after VJ decompression
- * sc->sc_if.if_ibytes # of bytes coming in from the line (before VJ)
- * sc->sc_if.if_obytes # of bytes going out to the line (after VJ)
- * sc->sc_if.if_imcasts (currently unused)
- * sc->sc_if.if_omcasts # of frames sent out of the fastqueue
- * sc->sc_if.if_iqdrops # of frames dropped on input because queue full
- * sc->sc_if.if_noproto # of frames dropped on output because !AF_INET
- *
- * statistics counter usage (connection lifetime):
- * -----------------------------------------------
- * sc->sc_iinb # of ISDN incoming bytes from HSCX
- * sc->sc_ioutb # of ISDN outgoing bytes from HSCX
- * sc->sc_inb # of incoming bytes after decompression
- * sc->sc_outb # of outgoing bytes before compression
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4bipr.h"
-
-#if NI4BIPR > 0
-
-#ifdef __FreeBSD__
-#include "opt_i4b.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#include <sys/sockio.h>
-#ifdef IPR_VJ
-#include <sys/malloc.h>
-#endif
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-
-#ifdef IPR_VJ
-#include <net/slcompress.h>
-#define IPR_COMPRESS IFF_LINK0 /* compress TCP traffic */
-#define IPR_AUTOCOMP IFF_LINK1 /* auto-enable TCP compression */
-
-/*---------------------------------------------------------------------------
- * NOTICE: using NO separate buffer relies on the assumption, that the HSCX
- * IRQ handler _always_ allocates a single, continuous mbuf cluster large
- * enough to hold the maximum MTU size if the ipr interface !
- *
- * CAUTION: i have re-defined IPR_VJ_USEBUFFER because it makes problems
- * with 2 i4b's back to back running cvs over ssh, cvs simply
- * aborts because it gets bad data. Everything else (telnet/ftp?etc)
- * functions fine.
- *---------------------------------------------------------------------------*/
-#define IPR_VJ_USEBUFFER /* define to use an allocated separate buffer*/
- /* undef to uncompress in the mbuf itself */
-#endif /* IPR_VJ */
-
-#include "bpfilter.h"
-#if NBPFILTER > 0
-#include <sys/time.h>
-#include <net/bpf.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_debug.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#ifndef __FreeBSD__
-#include <machine/cpu.h> /* For softnet */
-#endif
-
-#ifdef __FreeBSD__
-#define IPR_FMT "ipr%d: "
-#define IPR_ARG(sc) ((sc)->sc_if.if_unit)
-#define PDEVSTATIC static
-#else
-#define IPR_FMT "%s: "
-#define IPR_ARG(sc) ((sc)->sc_if.if_xname)
-#define PDEVSTATIC /* not static */
-#endif
-
-#define I4BIPRMTU 1500 /* regular MTU */
-#define I4BIPRMAXMTU 2000 /* max MTU */
-#define I4BIPRMINMTU 500 /* min MTU */
-
-#define I4BIPRMAXQLEN 50 /* max queue length */
-
-#define I4BIPRACCT 1 /* enable accounting messages */
-#define I4BIPRACCTINTVL 2 /* accounting msg interval in secs */
-#define I4BIPRADJFRXP 1 /* adjust 1st rxd packet */
-
-/* initialized by L4 */
-
-static drvr_link_t ipr_drvr_linktab[NI4BIPR];
-static isdn_link_t *isdn_linktab[NI4BIPR];
-
-struct ipr_softc {
- struct ifnet sc_if; /* network-visible interface */
- int sc_state; /* state of the interface */
-
-#ifndef __FreeBSD__
- int sc_unit; /* unit number for Net/OpenBSD */
-#endif
-
- call_desc_t *sc_cdp; /* ptr to call descriptor */
- int sc_updown; /* soft state of interface */
- struct ifqueue sc_fastq; /* interactive traffic */
- int sc_dialresp; /* dialresponse */
- int sc_lastdialresp;/* last dialresponse */
-
-#if I4BIPRACCT
- int sc_iinb; /* isdn driver # of inbytes */
- int sc_ioutb; /* isdn driver # of outbytes */
- int sc_inb; /* # of bytes rx'd */
- int sc_outb; /* # of bytes tx'd */
- int sc_linb; /* last # of bytes rx'd */
- int sc_loutb; /* last # of bytes tx'd */
- int sc_fn; /* flag, first null acct */
-#endif
-
-#ifdef I4BIPRADJFRXP
- int sc_first_pkt; /* flag, first rxd packet */
-#endif
-
-#ifdef IPR_VJ
- struct slcompress sc_compr; /* tcp compression data */
-#ifdef IPR_VJ_USEBUFFER
- u_char *sc_cbuf; /* tcp decompression buffer */
-#endif
-#endif
-
-} ipr_softc[NI4BIPR];
-
-enum ipr_states {
- ST_IDLE, /* initialized, ready, idle */
- ST_DIALING, /* dialling out to remote */
- ST_CONNECTED_W, /* connected to remote */
- ST_CONNECTED_A, /* connected to remote */
-};
-
-#ifdef __FreeBSD__
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-# define IOCTL_CMD_T u_long
-#else
-# define IOCTL_CMD_T int
-#endif
-PDEVSTATIC void i4biprattach(void *);
-PSEUDO_SET(i4biprattach, i4b_ipr);
-static int i4biprioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data);
-#else
-PDEVSTATIC void i4biprattach __P((void));
-static int i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
-#endif
-
-static void iprwatchdog(struct ifnet *ifp);
-static void ipr_init_linktab(int unit);
-static void ipr_tx_queue_empty(int unit);
-static int i4biproutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rtp);
-static void iprclearqueues(struct ipr_softc *sc);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * interface attach routine at kernel boot time
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4biprattach(void *dummy)
-#else
-i4biprattach()
-#endif
-{
- struct ipr_softc *sc = ipr_softc;
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
-#ifdef IPR_VJ
- printf("i4bipr: %d IP over raw HDLC ISDN device(s) attached (VJ header compression)\n", NI4BIPR);
-#else
- printf("i4bipr: %d IP over raw HDLC ISDN device(s) attached\n", NI4BIPR);
-#endif
-#endif
-
- for(i=0; i < NI4BIPR; sc++, i++)
- {
- ipr_init_linktab(i);
-
- DBGL4(L4_DIALST, "i4biprattach", ("setting dial state to ST_IDLE\n"));
-
- sc->sc_state = ST_IDLE;
-
-#ifdef __FreeBSD__
- sc->sc_if.if_name = "ipr";
-#if __FreeBSD__ < 3
- sc->sc_if.if_next = NULL;
-#endif
- sc->sc_if.if_unit = i;
-#else
- sprintf(sc->sc_if.if_xname, "ipr%d", i);
- sc->sc_if.if_softc = sc;
- sc->sc_unit = i;
-#endif
-
-#ifdef IPR_VJ
- sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_SIMPLEX | IPR_AUTOCOMP;
-#else
- sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_SIMPLEX;
-#endif
-
- sc->sc_if.if_mtu = I4BIPRMTU;
- sc->sc_if.if_type = IFT_ISDNBASIC;
- sc->sc_if.if_ioctl = i4biprioctl;
- sc->sc_if.if_output = i4biproutput;
-
- sc->sc_if.if_snd.ifq_maxlen = I4BIPRMAXQLEN;
- sc->sc_fastq.ifq_maxlen = I4BIPRMAXQLEN;
-
- sc->sc_if.if_ipackets = 0;
- sc->sc_if.if_ierrors = 0;
- sc->sc_if.if_opackets = 0;
- sc->sc_if.if_oerrors = 0;
- sc->sc_if.if_collisions = 0;
- sc->sc_if.if_ibytes = 0;
- sc->sc_if.if_obytes = 0;
- sc->sc_if.if_imcasts = 0;
- sc->sc_if.if_omcasts = 0;
- sc->sc_if.if_iqdrops = 0;
- sc->sc_if.if_noproto = 0;
-
-#if I4BIPRACCT
- sc->sc_if.if_timer = 0;
- sc->sc_if.if_watchdog = iprwatchdog;
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_fn = 1;
-#endif
-
-#ifdef IPR_VJ
-#ifdef __FreeBSD__
- sl_compress_init(&sc->sc_compr, -1);
-#else
- sl_compress_init(&sc->sc_compr);
-#endif
-
-#ifdef IPR_VJ_USEBUFFER
- if(!((sc->sc_cbuf =
- (u_char *)malloc(I4BIPRMAXMTU+128, M_DEVBUF, M_WAITOK))))
- {
- panic("if_ipr.c, ipr_attach: VJ malloc failed");
- }
-#endif
-#endif
-
- sc->sc_updown = SOFT_ENA; /* soft enabled */
-
- sc->sc_dialresp = DSTAT_NONE; /* no response */
- sc->sc_lastdialresp = DSTAT_NONE;
-
- if_attach(&sc->sc_if);
-
-#if NBPFILTER > 0
-#ifdef __FreeBSD__
- bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int));
-#else
- bpfattach(&sc->sc_if.if_bpf, &sc->sc_if, DLT_NULL, sizeof(u_int));
-#endif
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * output a packet to the ISDN B-channel
- *---------------------------------------------------------------------------*/
-static int
-i4biproutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
- struct rtentry *rtp)
-{
- struct ipr_softc *sc;
- int unit;
- int s;
- struct ifqueue *ifq;
- struct ip *ip;
-
- s = SPLI4B();
-
-#ifdef __FreeBSD__
- unit = ifp->if_unit;
- sc = &ipr_softc[unit];
-#else
- sc = ifp->if_softc;
- unit = sc->sc_unit;
-#endif
-
- /* check for IP */
-
- if(dst->sa_family != AF_INET)
- {
- printf(IPR_FMT "af%d not supported\n", IPR_ARG(sc), dst->sa_family);
- m_freem(m);
- splx(s);
- sc->sc_if.if_noproto++;
- sc->sc_if.if_oerrors++;
- return(EAFNOSUPPORT);
- }
-
- /* check interface state = UP */
-
- if(!(ifp->if_flags & IFF_UP))
- {
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: interface is DOWN!\n", unit));
- m_freem(m);
- splx(s);
- sc->sc_if.if_oerrors++;
- return(ENETDOWN);
- }
-
- /* dial if necessary */
-
- if(sc->sc_state == ST_IDLE || sc->sc_state == ST_DIALING)
- {
-
-#ifdef NOTDEF
- switch(sc->sc_dialresp)
- {
- case DSTAT_TFAIL: /* transient failure */
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: transient dial failure!\n", unit));
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_if.if_oerrors++;
- return(ENETUNREACH);
- break;
-
- case DSTAT_PFAIL: /* permanent failure */
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: permanent dial failure!\n", unit));
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_if.if_oerrors++;
- return(EHOSTUNREACH);
- break;
-
- case DSTAT_INONLY: /* no dialout allowed*/
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: dialout not allowed failure!\n", unit));
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_if.if_oerrors++;
- return(EHOSTUNREACH);
- break;
- }
-#endif
-
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: send dial request message!\n", unit));
- DBGL4(L4_DIALST, "i4biproutput", ("ipr%d: setting dial state to ST_DIALING\n", unit));
- i4b_l4_dialout(BDRV_IPR, unit);
- sc->sc_state = ST_DIALING;
- }
-
- /* update access time */
-
- microtime(&sc->sc_if.if_lastchange);
-
- /*
- * check, if type of service indicates interactive, i.e. telnet,
- * traffic. in case it is interactive, put it into the fast queue,
- * else (i.e. ftp traffic) put it into the "normal" queue
- */
-
- ip = mtod(m, struct ip *); /* get ptr to ip header */
-
- if(ip->ip_tos & IPTOS_LOWDELAY)
- ifq = &sc->sc_fastq;
- else
- ifq = &sc->sc_if.if_snd;
-
- /* check for space in choosen send queue */
-
- if(IF_QFULL(ifq))
- {
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: send queue full!\n", unit));
- IF_DROP(ifq);
- m_freem(m);
- splx(s);
- sc->sc_if.if_oerrors++;
- return(ENOBUFS);
- }
-
- DBGL4(L4_IPRDBG, "i4biproutput", ("ipr%d: add packet to send queue!\n", unit));
-
- IF_ENQUEUE(ifq, m);
-
- ipr_tx_queue_empty(unit);
-
- splx(s);
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * process ioctl
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static int
-i4biprioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data)
-#else
-static int
-i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
-#endif
-{
-#ifdef __FreeBSD__
- struct ipr_softc *sc = &ipr_softc[ifp->if_unit];
-#else
- struct ipr_softc *sc = ifp->if_softc;
-#endif
-
- struct ifreq *ifr = (struct ifreq *)data;
- struct ifaddr *ifa = (struct ifaddr *)data;
- int s;
- int error = 0;
-
- s = SPLI4B();
-
- switch (cmd)
- {
- case SIOCAIFADDR: /* add interface address */
- case SIOCSIFADDR: /* set interface address */
- case SIOCSIFDSTADDR: /* set interface destination address */
- if(ifa->ifa_addr->sa_family != AF_INET)
- error = EAFNOSUPPORT;
- else
- sc->sc_if.if_flags |= IFF_UP;
- microtime(&sc->sc_if.if_lastchange);
- break;
-
- case SIOCSIFFLAGS: /* set interface flags */
- if(!(ifr->ifr_flags & IFF_UP))
- {
- if(sc->sc_if.if_flags & IFF_RUNNING)
- {
- /* disconnect ISDN line */
-#ifdef __FreeBSD__
- i4b_l4_drvrdisc(BDRV_IPR, ifp->if_unit);
-#else
- i4b_l4_drvrdisc(BDRV_IPR, sc->sc_unit);
-#endif
- sc->sc_if.if_flags &= ~IFF_RUNNING;
- }
-
- sc->sc_state = ST_IDLE;
-
- /* empty queues */
-
- iprclearqueues(sc);
- }
-
- if(ifr->ifr_flags & IFF_DEBUG)
- {
- /* enable debug messages */
- }
-
- microtime(&sc->sc_if.if_lastchange);
- break;
-
-#if !defined(__OpenBSD__)
- case SIOCSIFMTU: /* set interface MTU */
- if(ifr->ifr_mtu > I4BIPRMAXMTU)
- error = EINVAL;
- else if(ifr->ifr_mtu < I4BIPRMINMTU)
- error = EINVAL;
- else
- {
- ifp->if_mtu = ifr->ifr_mtu;
- microtime(&sc->sc_if.if_lastchange);
- }
- break;
-#endif /* __OPENBSD__ */
-
-#if 0
- /* not needed for FreeBSD, done in sl_compress_init() (-hm) */
-
- /* need to add an ioctl: set VJ max slot ID
- * #define IPRIOCSMAXCID _IOW('I', XXX, int)
- */
-#ifdef IPR_VJ
- case IPRIOCSMAXCID:
- {
- struct proc *p = curproc; /* XXX */
- if((error = suser(p->p_ucred, &p->p_acflag)) != 0)
- return (error);
- sl_compress_setup(sc->sc_compr, *(int *)data);
- }
- break;
-#endif
-#endif
- default:
- error = EINVAL;
- break;
- }
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * clear the interface's send queues
- *---------------------------------------------------------------------------*/
-static void
-iprclearqueues(struct ipr_softc *sc)
-{
- int x;
- struct mbuf *m;
-
- for(;;)
- {
- x = splimp();
- IF_DEQUEUE(&sc->sc_fastq, m);
- splx(x);
-
- if(m)
- m_freem(m);
- else
- break;
- }
-
- for(;;)
- {
- x = splimp();
- IF_DEQUEUE(&sc->sc_if.if_snd, m);
- splx(x);
-
- if(m)
- m_freem(m);
- else
- break;
- }
-}
-
-#if I4BIPRACCT
-/*---------------------------------------------------------------------------*
- * watchdog routine
- *---------------------------------------------------------------------------*/
-static void
-iprwatchdog(struct ifnet *ifp)
-{
-#ifdef __FreeBSD__
- int unit = ifp->if_unit;
- struct ipr_softc *sc = &ipr_softc[unit];
-#else
- struct ipr_softc *sc = ifp->if_softc;
- int unit = sc->sc_unit;
-#endif
- bchan_statistics_t bs;
-
- /* get # of bytes in and out from the HSCX driver */
-
- (*isdn_linktab[unit]->bch_stat)
- (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
-
- sc->sc_ioutb += bs.outbytes;
- sc->sc_iinb += bs.inbytes;
-
- if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
- {
- int ri = (sc->sc_iinb - sc->sc_linb)/I4BIPRACCTINTVL;
- int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BIPRACCTINTVL;
-
- if((sc->sc_iinb == sc->sc_linb) && (sc->sc_ioutb == sc->sc_loutb))
- sc->sc_fn = 0;
- else
- sc->sc_fn = 1;
-
- sc->sc_linb = sc->sc_iinb;
- sc->sc_loutb = sc->sc_ioutb;
-
- i4b_l4_accounting(BDRV_IPR, unit, ACCT_DURING,
- sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_outb, sc->sc_inb);
- }
- sc->sc_if.if_timer = I4BIPRACCTINTVL;
-}
-#endif /* I4BIPRACCT */
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * start transmitting after connect
- *---------------------------------------------------------------------------*/
-static void
-i4bipr_connect_startio(int unit)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- int s = SPLI4B();
-
- if(sc->sc_state == ST_CONNECTED_W)
- {
- sc->sc_state = ST_CONNECTED_A;
- ipr_tx_queue_empty(unit);
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-ipr_connect(int unit, void *cdp)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- int s;
-
- sc->sc_cdp = (call_desc_t *)cdp;
-
- s = SPLI4B();
-
- DBGL4(L4_DIALST, "ipr_connect", ("ipr%d: setting dial state to ST_CONNECTED\n", unit));
-
- sc->sc_if.if_flags |= IFF_RUNNING;
- sc->sc_state = ST_CONNECTED_W;
-
- sc->sc_dialresp = DSTAT_NONE;
- sc->sc_lastdialresp = DSTAT_NONE;
-
-#if I4BIPRACCT
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_if.if_timer = I4BIPRACCTINTVL;
-#endif
-
-#ifdef I4BIPRADJFRXP
- sc->sc_first_pkt = 1;
-#endif
-
- /*
- * Sometimes ISDN B-channels are switched thru asymmetic. This
- * means that under such circumstances B-channel data (the first
- * three packets of a TCP connection in my case) may get lost,
- * causing a large delay until the connection is started.
- * When the sending of the very first packet of a TCP connection
- * is delayed for a to be empirically determined delay (close
- * to a second in my case) those packets go thru and the TCP
- * connection comes up "almost" immediately (-hm).
- */
-
- if(sc->sc_cdp->isdntxdelay > 0)
- {
- timeout((TIMEOUT_FUNC_T)i4bipr_connect_startio, (void *)unit, sc->sc_cdp->isdntxdelay /* hz*1 */);
- }
- else
- {
- sc->sc_state = ST_CONNECTED_A;
- ipr_tx_queue_empty(unit);
- }
-
- splx(s);
-
- /* we don't need any negotiation - pass event back right now */
- i4b_l4_negcomplete(sc->sc_cdp);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-ipr_disconnect(int unit, void *cdp)
-{
- call_desc_t *cd = (call_desc_t *)cdp;
- struct ipr_softc *sc = &ipr_softc[unit];
-
- /* new stuff to check that the active channel is being closed */
-
- if (cd != sc->sc_cdp)
- {
- DBGL4(L4_IPRDBG, "ipr_disconnect", ("ipr%d: channel %d not active\n",
- cd->driver_unit, cd->channelid));
- return;
- }
-
-#if I4BIPRACCT
- sc->sc_if.if_timer = 0;
-#endif
-
- i4b_l4_accounting(BDRV_IPR, cd->driver_unit, ACCT_FINAL,
- sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
-
- sc->sc_cdp = (call_desc_t *)0;
-
- DBGL4(L4_DIALST, "ipr_disconnect", ("setting dial state to ST_IDLE\n"));
-
- sc->sc_dialresp = DSTAT_NONE;
- sc->sc_lastdialresp = DSTAT_NONE;
-
- sc->sc_if.if_flags &= ~IFF_RUNNING;
- sc->sc_state = ST_IDLE;
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is used to give a feedback from userland daemon
- * in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-ipr_dialresponse(int unit, int status)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- sc->sc_dialresp = status;
-
- DBGL4(L4_IPRDBG, "ipr_dialresponse", ("ipr%d: last=%d, this=%d\n",
- unit, sc->sc_lastdialresp, sc->sc_dialresp));
-}
-
-/*---------------------------------------------------------------------------*
- * interface soft up/down
- *---------------------------------------------------------------------------*/
-static void
-ipr_updown(int unit, int updown)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- sc->sc_updown = updown;
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and was put on
- * the rx queue. It is assumed that this routines runs at
- * pri level splimp() ! Keep it short !
- *---------------------------------------------------------------------------*/
-static void
-ipr_rx_data_rdy(int unit)
-{
- register struct ipr_softc *sc = &ipr_softc[unit];
- register struct mbuf *m;
-#ifdef IPR_VJ
-#ifdef IPR_VJ_USEBUFFER
- u_char *cp = sc->sc_cbuf;
-#endif
- int len, c;
-#endif
-
- if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
- return;
-
- m->m_pkthdr.rcvif = &sc->sc_if;
-
- m->m_pkthdr.len = m->m_len;
-
- microtime(&sc->sc_if.if_lastchange);
-
-#ifdef I4BIPRADJFRXP
-
- /*
- * The very first packet after the B channel is switched thru
- * has very often several bytes of random data prepended. This
- * routine looks where the IP header starts and removes the
- * the bad data.
- */
-
- if(sc->sc_first_pkt)
- {
- unsigned char *mp = m->m_data;
- int i;
-
- sc->sc_first_pkt = 0;
-
- for(i = 0; i < m->m_len; i++, mp++)
- {
- if( ((*mp & 0xf0) == 0x40) &&
- ((*mp & 0x0f) >= 0x05) )
- {
- m->m_data = mp;
- m->m_pkthdr.len -= i;
- break;
- }
- }
- }
-#endif
-
- sc->sc_if.if_ipackets++;
- sc->sc_if.if_ibytes += m->m_pkthdr.len;
-
-#ifdef IPR_VJ
- if((c = (*(mtod(m, u_char *)) & 0xf0)) != (IPVERSION << 4))
- {
- /* copy data to buffer */
-
- len = m->m_len;
-
-#ifdef IPR_VJ_USEBUFFER
-/* XXX */ m_copydata(m, 0, len, cp);
-#endif
-
- if(c & 0x80)
- {
- c = TYPE_COMPRESSED_TCP;
- }
- else if(c == TYPE_UNCOMPRESSED_TCP)
- {
-#ifdef IPR_VJ_USEBUFFER
- *cp &= 0x4f; /* XXX */
-#else
- *(mtod(m, u_char *)) &= 0x4f;
-#endif
- }
-
- /*
- * We've got something that's not an IP packet.
- * If compression is enabled, try to decompress it.
- * Otherwise, if `auto-enable' compression is on and
- * it's a reasonable packet, decompress it and then
- * enable compression. Otherwise, drop it.
- */
- if(sc->sc_if.if_flags & IPR_COMPRESS)
- {
-#ifdef IPR_VJ_USEBUFFER
- len = sl_uncompress_tcp(&cp,len,(u_int)c,&sc->sc_compr);
-#else
- len = sl_uncompress_tcp((u_char **)&m->m_data, len,
- (u_int)c, &sc->sc_compr);
-#endif
-
- if(len <= 0)
- {
-#ifdef DEBUG_IPR_VJ
- printf("i4b_ipr, ipr_rx_data_rdy: len <= 0 IPR_COMPRESS!\n");
-#endif
- goto error;
- }
- }
- else if((sc->sc_if.if_flags & IPR_AUTOCOMP) &&
- (c == TYPE_UNCOMPRESSED_TCP) && (len >= 40))
- {
-#ifdef IPR_VJ_USEBUFFER
- len = sl_uncompress_tcp(&cp,len,(u_int)c,&sc->sc_compr);
-#else
- len = sl_uncompress_tcp((u_char **)&m->m_data, len,
- (u_int)c, &sc->sc_compr);
-#endif
-
- if(len <= 0)
- {
-#ifdef DEBUG_IPR_VJ
- printf("i4b_ipr, ipr_rx_data_rdy: len <= 0 IPR_AUTOCOMP!\n");
-#endif
- goto error;
- }
-
- sc->sc_if.if_flags |= IPR_COMPRESS;
- }
- else
- {
-#ifdef DEBUG_IPR_VJ
- printf("i4b_ipr, ipr_input: invalid ip packet!\n");
-#endif
-
-error:
- sc->sc_if.if_ierrors++;
- sc->sc_if.if_collisions++;
- m_freem(m);
- return;
- }
-#ifdef IPR_VJ_USEBUFFER
-/* XXX */ m_copyback(m, 0, len, cp);
-#else
- m->m_len = m->m_pkthdr.len = len;
-#endif
- }
-#endif
-
-#if I4BIPRACCT
- /* NB. do the accounting after decompression! */
- sc->sc_inb += m->m_pkthdr.len;
-#endif
-
-#if NBPFILTER > 0
- if(sc->sc_if.if_bpf)
- {
- /* prepend the address family as a four byte field */
- struct mbuf mm;
- u_int af = AF_INET;
- mm.m_next = m;
- mm.m_len = 4;
- mm.m_data = (char *)&af;
-
-#ifdef __FreeBSD__
- bpf_mtap(&sc->sc_if, &mm);
-#else
- bpf_mtap(sc->sc_if.if_bpf, &mm);
-#endif
- }
-#endif /* NBPFILTER > 0 */
-
- if(IF_QFULL(&ipintrq))
- {
- DBGL4(L4_IPRDBG, "ipr_rx_data_rdy", ("ipr%d: ipintrq full!\n", unit));
-
- IF_DROP(&ipintrq);
- sc->sc_if.if_ierrors++;
- sc->sc_if.if_iqdrops++;
- m_freem(m);
- }
- else
- {
- IF_ENQUEUE(&ipintrq, m);
- schednetisr(NETISR_IP);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-ipr_tx_queue_empty(int unit)
-{
- register struct ipr_softc *sc = &ipr_softc[unit];
- register struct mbuf *m;
-#ifdef IPR_VJ
- struct ip *ip;
-#endif
- int x = 0;
-
- if(sc->sc_state != ST_CONNECTED_A)
- return;
-
- for(;;)
- {
- IF_DEQUEUE(&sc->sc_fastq, m);
- if(m)
- {
- sc->sc_if.if_omcasts++;
- }
- else
- {
- IF_DEQUEUE(&sc->sc_if.if_snd, m);
- if(m == NULL)
- break;
- }
-
- microtime(&sc->sc_if.if_lastchange);
-
-#if NBPFILTER > 0
- if(sc->sc_if.if_bpf)
- {
- /* prepend the address family as a four byte field */
-
- struct mbuf mm;
- u_int af = AF_INET;
- mm.m_next = m;
- mm.m_len = 4;
- mm.m_data = (char *)&af;
-
-#ifdef __FreeBSD__
- bpf_mtap(&sc->sc_if, &mm);
-#else
- bpf_mtap(sc->sc_if.if_bpf, &mm);
-#endif
- }
-#endif /* NBPFILTER */
-
-#if I4BIPRACCT
- sc->sc_outb += m->m_pkthdr.len; /* size before compression */
-#endif
-
-#ifdef IPR_VJ
- if((ip = mtod(m, struct ip *))->ip_p == IPPROTO_TCP)
- {
- if(sc->sc_if.if_flags & IPR_COMPRESS)
- {
- *mtod(m, u_char *) |= sl_compress_tcp(m, ip,
- &sc->sc_compr, 1);
- }
- }
-#endif
- x = 1;
-
- IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
-
- sc->sc_if.if_obytes += m->m_pkthdr.len;
-
- sc->sc_if.if_opackets++;
- }
-
- if(x)
- (*isdn_linktab[unit]->bch_tx_start)(isdn_linktab[unit]->unit, isdn_linktab[unit]->channel);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted. It should
- * be used to implement an activity timeout mechanism.
- *---------------------------------------------------------------------------*/
-static void
-ipr_activity(int unit, int rxtx)
-{
- ipr_softc[unit].sc_cdp->last_active_time = SECOND;
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-ipr_ret_linktab(int unit)
-{
- return(&ipr_drvr_linktab[unit]);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-ipr_set_linktab(int unit, isdn_link_t *ilt)
-{
- isdn_linktab[unit] = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-ipr_init_linktab(int unit)
-{
- ipr_drvr_linktab[unit].unit = unit;
- ipr_drvr_linktab[unit].bch_rx_data_ready = ipr_rx_data_rdy;
- ipr_drvr_linktab[unit].bch_tx_queue_empty = ipr_tx_queue_empty;
- ipr_drvr_linktab[unit].bch_activity = ipr_activity;
- ipr_drvr_linktab[unit].line_connected = ipr_connect;
- ipr_drvr_linktab[unit].line_disconnected = ipr_disconnect;
- ipr_drvr_linktab[unit].dial_response = ipr_dialresponse;
- ipr_drvr_linktab[unit].updown_ind = ipr_updown;
-}
-
-/*===========================================================================*/
-
-#endif /* NI4BIPR > 0 */
diff --git a/sys/i4b/driver/i4b_isppp.c b/sys/i4b/driver/i4b_isppp.c
deleted file mode 100644
index b1cb2cf9df5b9..0000000000000
--- a/sys/i4b/driver/i4b_isppp.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isppp.c - isdn4bsd kernel SyncPPP driver
- * --------------------------------------------
- *
- * Uses Serge Vakulenko's sppp backend (originally contributed with
- * the "cx" driver for Cronyx's HDLC-in-hardware device). This driver
- * is only the glue between sppp and i4b.
- *
- * $Id: i4b_isppp.c,v 1.20 1998/12/18 14:20:44 hm Exp $
- *
- * last edit-date: [Fri Dec 18 11:47:58 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4bisppp.h"
-#ifdef __FreeBSD__
-#include "sppp.h"
-#endif
-
-#if NI4BISPPP == 0
-# error "You need to define `pseudo-device sppp <N>' with options ISPPP"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/ioccom.h>
-#include <sys/sockio.h>
-#include <sys/kernel.h>
-#include <sys/protosw.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/route.h>
-#ifdef __FreeBSD__
-#include <net/if_sppp.h>
-#else
-#include <i4b/sppp/if_sppp.h>
-#endif
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-
-#include "bpfilter.h"
-#if NBPFILTER > 0
-#include <sys/time.h>
-#include <net/bpf.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#ifdef __FreeBSD__
-#define ISPPP_FMT "isp%d: "
-#define ISPPP_ARG(sc) ((sc)->sc_if.if_unit)
-#define PDEVSTATIC static
-#define IFP2UNIT(ifp) (ifp)->if_unit
-
-# if __FreeBSD_version >= 300001
-# define CALLOUT_INIT(chan) callout_handle_init(chan)
-# define TIMEOUT(fun, arg, chan, tick) chan = timeout(fun, arg, tick)
-# define UNTIMEOUT(fun, arg, chan) untimeout(fun, arg, chan)
-# define IOCTL_CMD_T u_long
-# else
-# define CALLOUT_INIT(chan) do {} while(0)
-# define TIMEOUT(fun, arg, chan, tick) timeout(fun, arg, tick)
-# define UNTIMEOUT(fun, arg, chan) untimeout(fun, arg)
-# define IOCTL_CMD_T int
-# endif
-
-#elif defined __NetBSD__ || defined __OpenBSD__
-#define ISPPP_FMT "%s: "
-#define ISPPP_ARG(sc) ((sc)->sc_if.if_xname)
-#define PDEVSTATIC /* not static */
-#define IOCTL_CMD_T u_long
-#define IFP2UNIT(ifp) ((struct i4bisppp_softc *)ifp->if_softc)->sc_unit
-#else
-# error "What system are you using?"
-#endif
-
-#ifdef __FreeBSD__
-PDEVSTATIC void i4bispppattach(void *);
-PSEUDO_SET(i4bispppattach, i4b_isppp);
-#else
-PDEVSTATIC void i4bispppattach __P((void));
-#endif
-
-#define I4BISPPPACCT 1 /* enable accounting messages */
-#define I4BISPPPACCTINTVL 2 /* accounting msg interval in secs */
-#define I4BISPPPDISCDEBUG 1
-
-#define PPP_HDRLEN 4 /* 4 octetts PPP header length */
-
-struct i4bisppp_softc {
- /*
- * struct sppp starts with a struct ifnet, but we gotta allocate
- * more space for it. NB: do not relocate this union, it must
- * be first in isppp_softc. The tls and tlf hooks below want to
- * convert a ``struct sppp *'' into a ``struct isppp_softc *''.
- */
- union {
- struct ifnet scu_if;
- struct sppp scu_sp;
- } sc_if_un;
-#define sc_if sc_if_un.scu_if
-
- int sc_state; /* state of the interface */
-
-#ifndef __FreeBSD__
- int sc_unit; /* unit number for Net/OpenBSD */
-#endif
-
- call_desc_t *sc_cdp; /* ptr to call descriptor */
-
-#ifdef I4BISPPPACCT
- int sc_iinb; /* isdn driver # of inbytes */
- int sc_ioutb; /* isdn driver # of outbytes */
- int sc_inb; /* # of bytes rx'd */
- int sc_outb; /* # of bytes tx'd */
- int sc_linb; /* last # of bytes rx'd */
- int sc_loutb; /* last # of bytes tx'd */
- int sc_fn; /* flag, first null acct */
-#endif
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- struct callout_handle sc_ch;
-#endif
-
-} i4bisppp_softc[NI4BISPPP];
-
-static void i4bisppp_init_linktab(int unit);
-static int i4bisppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data);
-
-#if 0
-static void i4bisppp_send(struct ifnet *ifp);
-#endif
-
-static void i4bisppp_start(struct ifnet *ifp);
-
-#if 0 /* never used ??? */
-static void i4bisppp_timeout(void *cookie);
-#endif
-
-static void i4bisppp_tls(struct sppp *sp);
-static void i4bisppp_tlf(struct sppp *sp);
-static void i4bisppp_state_changed(struct sppp *sp, int new_state);
-static void i4bisppp_negotiation_complete(struct sppp *sp);
-static void i4bisppp_watchdog(struct ifnet *ifp);
-
-/* initialized by L4 */
-
-static drvr_link_t i4bisppp_drvr_linktab[NI4BISPPP];
-static isdn_link_t *isdn_linktab[NI4BISPPP];
-
-enum i4bisppp_states {
- ST_IDLE, /* initialized, ready, idle */
- ST_DIALING, /* dialling out to remote */
- ST_CONNECTED, /* connected to remote */
-};
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * interface attach routine at kernel boot time
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4bispppattach(void *dummy)
-#else
-i4bispppattach(void)
-#endif
-{
- struct i4bisppp_softc *sc = i4bisppp_softc;
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4bisppp: %d ISDN SyncPPP device(s) attached\n",
- NI4BISPPP);
-#endif
-
- for(i = 0; i < NI4BISPPP; sc++, i++) {
- i4bisppp_init_linktab(i);
-
- sc->sc_if.if_softc = sc;
-
-#ifdef __FreeBSD__
- sc->sc_if.if_name = "isp";
-#if defined(__FreeBSD_version) && __FreeBSD_version < 300001
- sc->sc_if.if_next = NULL;
-#endif
- sc->sc_if.if_unit = i;
-#else
- sprintf(sc->sc_if.if_xname, "isp%d", i);
- sc->sc_unit = i;
-#endif
-
- sc->sc_if.if_mtu = PP_MTU;
- sc->sc_if.if_flags = IFF_SIMPLEX | IFF_POINTOPOINT;
- sc->sc_if.if_type = IFT_ISDNBASIC;
- sc->sc_state = ST_IDLE;
-
- sc->sc_if.if_ioctl = i4bisppp_ioctl;
-
- /* actually initialized by sppp_attach() */
- /* sc->sc_if.if_output = sppp_output; */
-
- sc->sc_if.if_start = i4bisppp_start;
-
- sc->sc_if.if_hdrlen = 0;
- sc->sc_if.if_addrlen = 0;
- sc->sc_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
-
- sc->sc_if.if_ipackets = 0;
- sc->sc_if.if_ierrors = 0;
- sc->sc_if.if_opackets = 0;
- sc->sc_if.if_oerrors = 0;
- sc->sc_if.if_collisions = 0;
- sc->sc_if.if_ibytes = 0;
- sc->sc_if.if_obytes = 0;
- sc->sc_if.if_imcasts = 0;
- sc->sc_if.if_omcasts = 0;
- sc->sc_if.if_iqdrops = 0;
- sc->sc_if.if_noproto = 0;
-
-#if I4BISPPPACCT
- sc->sc_if.if_timer = 0;
- sc->sc_if.if_watchdog = i4bisppp_watchdog;
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_fn = 1;
-#endif
-
- sc->sc_if_un.scu_sp.pp_tls = i4bisppp_tls;
- sc->sc_if_un.scu_sp.pp_tlf = i4bisppp_tlf;
- sc->sc_if_un.scu_sp.pp_con = i4bisppp_negotiation_complete;
- sc->sc_if_un.scu_sp.pp_chg = i4bisppp_state_changed;
-
- sppp_attach(&sc->sc_if);
- if_attach(&sc->sc_if);
-
-#if NBPFILTER > 0
-#ifdef __FreeBSD__
- bpfattach(&sc->sc_if, DLT_PPP, PPP_HDRLEN);
- CALLOUT_INIT(&sc->sc_ch);
-#endif /* __FreeBSD__ */
-#ifdef __NetBSD__
- bpfattach(&sc->sc_if.if_bpf, &sc->sc_if, DLT_PPP, sizeof(u_int));
-#endif
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * process ioctl
- *---------------------------------------------------------------------------*/
-static int
-i4bisppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, caddr_t data)
-{
- struct i4bisppp_softc *sc = ifp->if_softc;
-#if 0
- struct sppp *sp = (struct sppp *)sc;
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct ifreq *ifr = (struct ifreq *) data;
-#endif
-
- int error;
-
- error = sppp_ioctl(&sc->sc_if, cmd, data);
- if (error)
- return error;
-
- switch(cmd) {
- case SIOCSIFFLAGS:
-#if 0 /* never used ??? */
- x = splimp();
- if ((ifp->if_flags & IFF_UP) == 0)
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
- splx(x);
-#endif
- break;
- }
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------*
- * start output to ISDN B-channel
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_start(struct ifnet *ifp)
-{
- struct i4bisppp_softc *sc = ifp->if_softc;
- struct mbuf *m;
- int s;
- int unit = IFP2UNIT(ifp);
-
- if (sppp_isempty(ifp))
- return;
-
- if(sc->sc_state != ST_CONNECTED)
- return;
-
- s = splimp();
- /*ifp->if_flags |= IFF_OACTIVE; - need to clear this somewhere */
- splx(s);
-
- while ((m = sppp_dequeue(&sc->sc_if)) != NULL)
- {
-
-#if NBPFILTER > 0
-#ifdef __FreeBSD__
- if (ifp->if_bpf)
- bpf_mtap(ifp, m);
-#endif /* __FreeBSD__ */
-
-#ifdef __NetBSD__
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m);
-#endif
-#endif /* NBPFILTER > 0 */
-
- microtime(&ifp->if_lastchange);
-
- IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
-
- sc->sc_if.if_obytes += m->m_pkthdr.len;
- sc->sc_outb += m->m_pkthdr.len;
- sc->sc_if.if_opackets++;
- }
- isdn_linktab[unit]->bch_tx_start(isdn_linktab[unit]->unit,
- isdn_linktab[unit]->channel);
-}
-
-#ifdef I4BISPPPACCT
-/*---------------------------------------------------------------------------*
- * watchdog routine
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_watchdog(struct ifnet *ifp)
-{
- struct i4bisppp_softc *sc = ifp->if_softc;
- int unit = IFP2UNIT(ifp);
- bchan_statistics_t bs;
-
- (*isdn_linktab[unit]->bch_stat)
- (isdn_linktab[unit]->unit, isdn_linktab[unit]->channel, &bs);
-
- sc->sc_ioutb += bs.outbytes;
- sc->sc_iinb += bs.inbytes;
-
- if((sc->sc_iinb != sc->sc_linb) || (sc->sc_ioutb != sc->sc_loutb) || sc->sc_fn)
- {
- int ri = (sc->sc_iinb - sc->sc_linb)/I4BISPPPACCTINTVL;
- int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BISPPPACCTINTVL;
-
- if((sc->sc_iinb == sc->sc_linb) && (sc->sc_ioutb == sc->sc_loutb))
- sc->sc_fn = 0;
- else
- sc->sc_fn = 1;
-
- sc->sc_linb = sc->sc_iinb;
- sc->sc_loutb = sc->sc_ioutb;
-
- i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_DURING,
- sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_outb, sc->sc_inb);
- }
- sc->sc_if.if_timer = I4BISPPPACCTINTVL;
-
-#if 0 /* old stuff, keep it around */
- printf(ISPPP_FMT "transmit timeout\n", ISPPP_ARG(sc));
- i4bisppp_start(ifp);
-#endif
-}
-#endif /* I4BISPPPACCT */
-
-/*
- *===========================================================================*
- * SyncPPP layer interface routines
- *===========================================================================*
- */
-
-#if 0 /* never used ??? */
-/*---------------------------------------------------------------------------*
- * just an alias for i4bisppp_tls, but of type timeout_t
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_timeout(void *cookie)
-{
- i4bisppp_tls((struct sppp *)cookie);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * PPP this-layer-started action
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_tls(struct sppp *sp)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
- struct ifnet *ifp = (struct ifnet *)sp;
-
- if(sc->sc_state == ST_CONNECTED)
- return;
-
- i4b_l4_dialout(BDRV_ISPPP, IFP2UNIT(ifp));
-}
-
-/*---------------------------------------------------------------------------*
- * PPP this-layer-finished action
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_tlf(struct sppp *sp)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-/* call_desc_t *cd = sc->sc_cdp; */
- struct ifnet *ifp = (struct ifnet *)sp;
-
- if(sc->sc_state != ST_CONNECTED)
- return;
-
-#if 0 /* never used ??? */
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
-#endif
-
- i4b_l4_drvrdisc(BDRV_ISPPP, IFP2UNIT(ifp));
-}
-/*---------------------------------------------------------------------------*
- * PPP interface phase change
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_state_changed(struct sppp *sp, int new_state)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-
- i4b_l4_ifstate_changed(sc->sc_cdp, new_state);
-}
-
-/*---------------------------------------------------------------------------*
- * PPP control protocol negotiation complete (run ip-up script now)
- *---------------------------------------------------------------------------*
- */
-static void
-i4bisppp_negotiation_complete(struct sppp *sp)
-{
- struct i4bisppp_softc *sc = (struct i4bisppp_softc *)sp;
-
- i4b_l4_negcomplete(sc->sc_cdp);
-}
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_connect(int unit, void *cdp)
-{
- struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
- struct sppp *sp = &sc->sc_if_un.scu_sp;
- int s = splimp();
-
- sc->sc_cdp = (call_desc_t *)cdp;
- sc->sc_state = ST_CONNECTED;
-
-#if I4BISPPPACCT
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_inb = 0;
- sc->sc_outb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
- sc->sc_if.if_timer = I4BISPPPACCTINTVL;
-#endif
-
-#if 0 /* never used ??? */
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
-#endif
-
- sp->pp_up(sp); /* tell PPP we are ready */
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_disconnect(int unit, void *cdp)
-{
- call_desc_t *cd = (call_desc_t *)cdp;
- struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
- struct sppp *sp = &sc->sc_if_un.scu_sp;
-
- int s = splimp();
-
- /* new stuff to check that the active channel is being closed */
- if (cd != sc->sc_cdp)
- {
-#ifdef I4BISPPPDISCDEBUG
- printf("i4bisppp_disconnect: isppp%d channel%d not active\n",
- cd->driver_unit, cd->channelid);
-#endif
- splx(s);
- return;
- }
-
-#if I4BISPPPACCT
- sc->sc_if.if_timer = 0;
-#endif
-
- i4b_l4_accounting(BDRV_ISPPP, unit, ACCT_FINAL,
- sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_outb, sc->sc_inb);
-
- if (sc->sc_state == ST_CONNECTED)
- {
-#if 0 /* never used ??? */
- UNTIMEOUT(i4bisppp_timeout, (void *)sp, sc->sc_ch);
-#endif
- sc->sc_cdp = (call_desc_t *)0;
- /* do thhis here because pp_down calls i4bisppp_tlf */
- sc->sc_state = ST_IDLE;
- sp->pp_down(sp); /* tell PPP we have hung up */
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is used to give a feedback from userland demon
- * in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_dialresponse(int unit, int status)
-{
-/* struct i4bisppp_softc *sc = &i4bisppp_softc[unit]; */
-}
-
-/*---------------------------------------------------------------------------*
- * interface up/down
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_updown(int unit, int updown)
-{
- /* could probably do something useful here */
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and was put on
- * the rx queue.
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_rx_data_rdy(int unit)
-{
- struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
- struct mbuf *m;
- int s;
-
- if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
- return;
-
- m->m_pkthdr.rcvif = &sc->sc_if;
- m->m_pkthdr.len = m->m_len;
-
- microtime(&sc->sc_if.if_lastchange);
-
- sc->sc_if.if_ipackets++;
- sc->sc_if.if_ibytes += m->m_pkthdr.len;
-
-#if I4BISPPPACCT
- sc->sc_inb += m->m_pkthdr.len;
-#endif
-
-#ifdef I4BISPPPDEBUG
- printf("i4bisppp_rx_data_ready: received packet!\n");
-#endif
-
-#if NBPFILTER > 0
-
-#ifdef __FreeBSD__
- if(sc->sc_if.if_bpf)
- bpf_mtap(&sc->sc_if, m);
-#endif /* __FreeBSD__ */
-
-#ifdef __NetBSD__
- if(sc->sc_if.if_bpf)
- bpf_mtap(sc->sc_if.if_bpf, m);
-#endif
-
-#endif /* NBPFILTER > 0 */
-
- s = splimp();
-
- sppp_input(&sc->sc_if, m);
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_tx_queue_empty(int unit)
-{
- i4bisppp_start(&i4bisppp_softc[unit].sc_if);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted. It should
- * be used to implement an activity timeout mechanism.
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_activity(int unit, int rxtx)
-{
- i4bisppp_softc[unit].sc_cdp->last_active_time = SECOND;
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-i4bisppp_ret_linktab(int unit)
-{
- return(&i4bisppp_drvr_linktab[unit]);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-i4bisppp_set_linktab(int unit, isdn_link_t *ilt)
-{
- isdn_linktab[unit] = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-i4bisppp_init_linktab(int unit)
-{
- i4bisppp_drvr_linktab[unit].unit = unit;
- i4bisppp_drvr_linktab[unit].bch_rx_data_ready = i4bisppp_rx_data_rdy;
- i4bisppp_drvr_linktab[unit].bch_tx_queue_empty = i4bisppp_tx_queue_empty;
- i4bisppp_drvr_linktab[unit].bch_activity = i4bisppp_activity;
- i4bisppp_drvr_linktab[unit].line_connected = i4bisppp_connect;
- i4bisppp_drvr_linktab[unit].line_disconnected = i4bisppp_disconnect;
- i4bisppp_drvr_linktab[unit].dial_response = i4bisppp_dialresponse;
- i4bisppp_drvr_linktab[unit].updown_ind = i4bisppp_updown;
-}
-
-/*===========================================================================*/
diff --git a/sys/i4b/driver/i4b_rbch.c b/sys/i4b/driver/i4b_rbch.c
deleted file mode 100644
index 9cf432c98f296..0000000000000
--- a/sys/i4b/driver/i4b_rbch.c
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_rbch.c - device driver for raw B channel data
- * ---------------------------------------------------
- *
- * $Id: i4b_rbch.c,v 1.23 1998/12/14 09:39:10 hm Exp $
- *
- * last edit-date: [Sun Dec 13 10:19:08 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4brbch.h"
-
-#if NI4BRBCH > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || !defined(__FreeBSD__)
-#include <sys/ioccom.h>
-#include <sys/poll.h>
-#else
-#include <sys/fcntl.h>
-#include <sys/ioctl.h>
-#endif
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001)
-#include <sys/filio.h>
-#endif
-
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-
-#ifdef __NetBSD__
-extern cc_t ttydefchars;
-#define termioschars(t) memcpy((t)->c_cc, &ttydefchars, sizeof((t)->c_cc))
-#endif
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __NetBSD__
-#include <sys/filio.h>
-#define bootverbose 0
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_debug.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_debug.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-/* initialized by L4 */
-
-static drvr_link_t rbch_drvr_linktab[NI4BRBCH];
-static isdn_link_t *isdn_linktab[NI4BRBCH];
-
-static struct rbch_softc {
- int sc_devstate; /* state of driver */
-#define ST_IDLE 0x00
-#define ST_CONNECTED 0x01
-#define ST_ISOPEN 0x02
-#define ST_RDWAITDATA 0x04
-#define ST_WRWAITEMPTY 0x08
-#define ST_NOBLOCK 0x10
-
- int sc_bprot; /* B-ch protocol used */
-
- call_desc_t *cd; /* Call Descriptor */
- struct termios it_in;
-
- struct ifqueue sc_hdlcq; /* hdlc read queue */
-#define I4BRBCHMAXQLEN 10
-
- struct selinfo selp; /* select / poll */
-
-#ifdef DEVFS
- void *devfs_token; /* device filesystem */
-#endif
-} rbch_softc[NI4BRBCH];
-
-static void rbch_rx_data_rdy(int unit);
-static void rbch_tx_queue_empty(int unit);
-static void rbch_connect(int unit, void *cdp);
-static void rbch_disconnect(int unit, void *cdp);
-static void rbch_init_linktab(int unit);
-static void rbch_clrq(int unit);
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-#define IOCTL_CMD_T u_long
-void i4brbchattach __P((void));
-int i4brbchopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4brbchclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4brbchread __P((dev_t dev, struct uio *uio, int ioflag));
-int i4brbchwrite __P((dev_t dev, struct uio *uio, int ioflag));
-int i4brbchioctl __P((dev_t dev, IOCTL_CMD_T cmd, caddr_t arg, int flag, struct proc* pr));
-int i4brbchpoll __P((dev_t dev, int events, struct proc *p));
-#endif
-
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-#if !defined(__FreeBSD_version) || __FreeBSD_version < 300003
-#define IOCTL_CMD_T int
-#else
-#define IOCTL_CMD_T u_long
-#endif
-
-PDEVSTATIC d_open_t i4brbchopen;
-PDEVSTATIC d_close_t i4brbchclose;
-PDEVSTATIC d_read_t i4brbchread;
-PDEVSTATIC d_read_t i4brbchwrite;
-PDEVSTATIC d_ioctl_t i4brbchioctl;
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || !defined(__FreeBSD__)
-PDEVSTATIC d_poll_t i4brbchpoll;
-#else
-PDEVSTATIC d_select_t i4brbchselect;
-#endif
-
-#define CDEV_MAJOR 57
-static struct cdevsw i4brbch_cdevsw = {
- i4brbchopen, i4brbchclose, i4brbchread, i4brbchwrite,
- i4brbchioctl, nostop, noreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4brbchpoll, nommap, NULL, "i4brbch", NULL, -1
-#else
- i4brbchselect, nommap, NULL, "i4brbch", NULL, -1
-#endif
-};
-
-static void i4brbchattach(void *);
-PSEUDO_SET(i4brbchattach, i4b_rbch);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-i4brbchinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4brbch_cdevsw, NULL);
-}
-
-SYSINIT(i4brbchdev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4brbchinit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4brbchattach(void *dummy)
-#else
-i4brbchattach()
-#endif
-{
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4brbch: %d raw B channel access device(s) attached\n", NI4BRBCH);
-#endif
-
- for(i=0; i < NI4BRBCH; i++)
- {
-#ifdef DEVFS
- rbch_softc[i].devfs_token =
- devfs_add_devswf(&i4brbch_cdevsw, i, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4brbch%d", i);
-#endif
- rbch_softc[i].sc_devstate = ST_IDLE;
- rbch_softc[i].sc_hdlcq.ifq_maxlen = I4BRBCHMAXQLEN;
- rbch_softc[i].it_in.c_ispeed = rbch_softc[i].it_in.c_ospeed = 64000;
- termioschars(&rbch_softc[i].it_in);
- rbch_init_linktab(i);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * open rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
-
- if(unit > NI4BRBCH)
- return(ENXIO);
-
- if(rbch_softc[unit].sc_devstate & ST_ISOPEN)
- return(EBUSY);
-
- rbch_clrq(unit);
-
- rbch_softc[unit].sc_devstate |= ST_ISOPEN;
-
- DBGL4(L4_RBCHDBG, "i4brbchopen", ("unit %d, open\n", unit));
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
-
- if (rbch_softc[unit].cd) {
- i4b_l4_disconnect_ind(rbch_softc[unit].cd);
- rbch_softc[unit].cd = NULL;
- }
- rbch_softc[unit].sc_devstate &= ~ST_ISOPEN;
-
- rbch_clrq(unit);
-
- DBGL4(L4_RBCHDBG, "i4brbclose", ("unit %d, close\n", unit));
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * read from rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- int unit = minor(dev);
- struct ifqueue *iqp;
-
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, enter read\n", unit));
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, read while not open\n", unit));
- return(EIO);
- }
-
- if((rbch_softc[unit].sc_devstate & ST_NOBLOCK)) {
- if(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- return(EWOULDBLOCK);
-
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(IF_QEMPTY(iqp) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- return(EWOULDBLOCK);
- } else {
- while(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, wait read init\n", unit));
-
- if((error = tsleep((caddr_t) &rbch_softc[unit],
- TTIPRI | PCATCH,
- "rrrbch", 0 )) != 0)
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, error %d tsleep\n", unit, error));
- return(error);
- }
- }
-
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- while(IF_QEMPTY(iqp) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- s = splimp();
- rbch_softc[unit].sc_devstate |= ST_RDWAITDATA;
- splx(s);
-
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, wait read data\n", unit));
-
- if((error = tsleep((caddr_t) &isdn_linktab[unit]->rx_queue,
- TTIPRI | PCATCH,
- "rrbch", 0 )) != 0)
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, error %d tsleep read\n", unit, error));
- rbch_softc[unit].sc_devstate &= ~ST_RDWAITDATA;
- return(error);
- }
- }
- }
-
- s = splimp();
-
- IF_DEQUEUE(iqp, m);
-
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, read %d bytes\n", unit, m->m_len));
-
- if(m && m->m_len)
- {
- error = uiomove(m->m_data, m->m_len, uio);
- }
- else
- {
- DBGL4(L4_RBCHDBG, "i4brbchread", ("unit %d, error %d uiomove\n", unit, error));
- error = EIO;
- }
-
- if(m)
- i4b_Bfreembuf(m);
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * write to rbch device
- *---------------------------------------------------------------------------*/
-int
-i4brbchwrite(dev_t dev, struct uio * uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- int unit = minor(dev);
-
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write\n", unit));
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write while not open\n", unit));
- return(EIO);
- }
-
- if((rbch_softc[unit].sc_devstate & ST_NOBLOCK)) {
- if(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- return(EWOULDBLOCK);
- if(IF_QFULL(isdn_linktab[unit]->tx_queue) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- return(EWOULDBLOCK);
- } else {
- while(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write wait init\n", unit));
-
- error = tsleep((caddr_t) &rbch_softc[unit],
- TTIPRI | PCATCH,
- "wrrbch", 0 );
- if(error == ERESTART)
- return (ERESTART);
- else if(error == EINTR) {
- printf("\n ========= i4brbchwrite, EINTR during wait init ======== \n");
- return(EINTR);
- } else if(error) {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, error %d tsleep init\n", unit, error));
- return(error);
- }
-/*XXX*/ tsleep((caddr_t) &rbch_softc[unit], TTIPRI | PCATCH, "xrbch", (hz*1));
- }
-
- while(IF_QFULL(isdn_linktab[unit]->tx_queue) && (rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- s = splimp();
- rbch_softc[unit].sc_devstate |= ST_WRWAITEMPTY;
- splx(s);
-
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write queue full\n", unit));
-
- if ((error = tsleep((caddr_t) &isdn_linktab[unit]->tx_queue,
- TTIPRI | PCATCH,
- "wrbch", 0)) != 0) {
- rbch_softc[unit].sc_devstate &= ~ST_WRWAITEMPTY;
- if(error == ERESTART) {
- return(ERESTART);
- } else if(error == EINTR) {
- printf("\n ========= i4brbchwrite, EINTR during wait write ======== \n");
- return(error);
- } else if(error) {
- DBGL4(L4_RBCHDBG, "i4brbchwrite",
- ("unit %d, error %d tsleep write\n", unit, error));
- return(error);
- }
- }
- }
- }
-
- s = splimp();
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, not open anymore\n", unit));
- splx(s);
- return(EIO);
- }
-
- if((m = i4b_Bgetmbuf(BCH_MAX_DATALEN)) != NULL)
- {
- m->m_len = min(BCH_MAX_DATALEN, uio->uio_resid);
-
- DBGL4(L4_RBCHDBG, "i4brbchwrite", ("unit %d, write %d bytes\n", unit, m->m_len));
-
- error = uiomove(m->m_data, m->m_len, uio);
-
- IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
-
- (*isdn_linktab[unit]->bch_tx_start)(isdn_linktab[unit]->unit, isdn_linktab[unit]->channel);
- }
-
- splx(s);
-
- return(error);
-}
-
-PDEVSTATIC int
-i4brbchioctl(dev_t dev, IOCTL_CMD_T cmd, caddr_t data, int flag, struct proc* p) {
- int error = 0;
- int unit = minor(dev);
-
- switch(cmd)
- {
-#if 0
- case I4B_RBCH_DIALOUT:
-if(bootverbose)printf("EE-rbch%d: attempting dialout (ioctl)\n", unit);
- i4b_l4_dialout(BDRV_RBCH, unit);
- break;
-#endif
-
- case FIOASYNC: /* Set async mode */
- if (*(int *)data) {
-if(bootverbose)printf("EE-rbch%d: setting async mode\n", unit);
- } else {
-if(bootverbose)printf("EE-rbch%d: clearing async mode\n", unit);
- }
- break;
- case FIONBIO:
- if (*(int *)data) {
-if(bootverbose)printf("EE-rbch%d: setting non-blocking mode\n", unit);
- rbch_softc[unit].sc_devstate |= ST_NOBLOCK;
- } else {
-if(bootverbose)printf("EE-rbch%d: clearing non-blocking mode\n", unit);
- rbch_softc[unit].sc_devstate &= ~ST_NOBLOCK;
- }
- break;
- case TIOCCDTR: /* Clear DTR */
- if(rbch_softc[unit].sc_devstate & ST_CONNECTED) {
-if(bootverbose)printf("EE-rbch%d: disconnecting for DTR down\n", unit);
- i4b_l4_disconnect_ind(rbch_softc[unit].cd);
- }
- break;
- case TIOCSDTR: /* Set DTR */
-if(bootverbose)printf("EE-rbch%d: attempting dialout (DTR)\n", unit);
- i4b_l4_dialout(BDRV_RBCH, unit);
- break;
- case TIOCSETA: /* Set termios struct */
- break;
- case TIOCGETA: /* Get termios struct */
- *(struct termios *)data = rbch_softc[unit].it_in;
- break;
- case TIOCMGET:
- *(int *)data = TIOCM_LE|TIOCM_DTR|TIOCM_RTS|TIOCM_CTS|TIOCM_DSR;
- if (rbch_softc[unit].sc_devstate & ST_CONNECTED)
- *(int *)data |= TIOCM_CD;
- break;
- default: /* Unknown stuff */
- printf("\n ========= i4brbch%d - ioctl, unknown cmd %lx ==================== \n",
- unit,
- (u_long)cmd);
- error = EINVAL;
- break;
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * device driver poll
- *---------------------------------------------------------------------------*/
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || !defined(__FreeBSD__)
-
-PDEVSTATIC int
-i4brbchpoll(dev_t dev, int events, struct proc *p)
-{
- int revents = 0; /* Events we found */
- int s;
- int unit = minor(dev);
-
- /* We can't check for anything but IN or OUT */
-
- if((events & (POLLIN|POLLOUT)) == 0)
- return(POLLNVAL);
-
- s = splhigh();
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- splx(s);
- return(POLLNVAL);
- }
-
- /*
- * Writes are OK if we are connected and the
- * transmit queue can take them
- */
-
- if((events & POLLOUT) &&
- (rbch_softc[unit].sc_devstate & ST_CONNECTED) &&
- !IF_QFULL(isdn_linktab[unit]->tx_queue))
- {
- revents |= POLLOUT;
- }
-
- /* ... while reads are OK if we have any data */
-
- if((events & POLLIN) &&
- (rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- struct ifqueue *iqp;
-
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(!IF_QEMPTY(iqp))
- revents |= POLLIN;
- }
-
- if(revents == 0)
- selrecord(p, &rbch_softc[unit].selp);
-
- splx(s);
- return(revents);
-}
-
-#else
-
-/*---------------------------------------------------------------------------*
- * device driver select
- *---------------------------------------------------------------------------*/
-static int
-i4brbchselect(dev_t dev, int rw, struct proc *p)
-{
- int unit = minor(dev);
- int s;
-
- s = splhigh();
-
- if(!(rbch_softc[unit].sc_devstate & ST_ISOPEN))
- {
- splx(s);
- DBGL4(L4_RBCHDBG, "i4brbchselect", ("unit %d, not open anymore\n", unit));
- return(1);
- }
-
- if(rbch_softc[unit].sc_devstate & ST_CONNECTED)
- {
- struct ifqueue *iqp;
-
- switch(rw)
- {
- case FREAD:
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- iqp = &rbch_softc[unit].sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(!IF_QEMPTY(iqp))
- return(1);
- break;
-
- case FWRITE:
- if(!IF_QFULL(isdn_linktab[unit]->rx_queue))
- return(1);
- break;
-
- default:
- return 0;
- }
- }
- selrecord(p, &rbch_softc[unit].selp);
- return(0);
-}
-
-#endif /* defined(__FreeBSD_version) && __FreeBSD_version >= 300001 */
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-rbch_connect(int unit, void *cdp)
-{
- call_desc_t *cd = (call_desc_t *)cdp;
-
- rbch_softc[unit].sc_bprot = cd->bprot;
-
- if(!(rbch_softc[unit].sc_devstate & ST_CONNECTED))
- {
- DBGL4(L4_RBCHDBG, "rbch_connect", ("unit %d, wakeup\n", unit));
- rbch_softc[unit].sc_devstate |= ST_CONNECTED;
- rbch_softc[unit].cd = cdp;
- wakeup((caddr_t) &rbch_softc[unit]);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-rbch_disconnect(int unit, void *cdp)
-{
- /* call_desc_t *cd = (call_desc_t *)cdp; */
-
- DBGL4(L4_RBCHDBG, "rbch_disconnect", ("unit %d, deinit\n", unit));
- rbch_softc[unit].sc_devstate &= ~ST_CONNECTED;
- rbch_softc[unit].cd = NULL;
-}
-
-/*---------------------------------------------------------------------------*
- * feedback from daemon in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-rbch_dialresponse(int unit, int status)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * interface up/down
- *---------------------------------------------------------------------------*/
-static void
-rbch_updown(int unit, int updown)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and is to be put on
- * the rx queue.
- *---------------------------------------------------------------------------*/
-static void
-rbch_rx_data_rdy(int unit)
-{
- if(rbch_softc[unit].sc_bprot == BPROT_RHDLC)
- {
- register struct mbuf *m;
-
- if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
- return;
-
- m->m_pkthdr.len = m->m_len;
-
- if(IF_QFULL(&(rbch_softc[unit].sc_hdlcq)))
- {
- DBGL4(L4_RBCHDBG, "rbch_rx_data_rdy", ("unit %d: hdlc rx queue full!\n", unit));
- m_freem(m);
- }
- else
- {
- IF_ENQUEUE(&(rbch_softc[unit].sc_hdlcq), m);
- }
- }
-
- if(rbch_softc[unit].sc_devstate & ST_RDWAITDATA)
- {
- DBGL4(L4_RBCHDBG, "rbch_rx_data_rdy", ("unit %d, wakeup\n", unit));
- rbch_softc[unit].sc_devstate &= ~ST_RDWAITDATA;
- wakeup((caddr_t) &isdn_linktab[unit]->rx_queue);
- }
- else
- {
- DBGL4(L4_RBCHDBG, "rbch_rx_data_rdy", ("unit %d, NO wakeup\n", unit));
- }
- selwakeup(&rbch_softc[unit].selp);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-rbch_tx_queue_empty(int unit)
-{
- if(rbch_softc[unit].sc_devstate & ST_WRWAITEMPTY)
- {
- DBGL4(L4_RBCHDBG, "rbch_tx_queue_empty", ("unit %d, wakeup\n", unit));
- rbch_softc[unit].sc_devstate &= ~ST_WRWAITEMPTY;
- wakeup((caddr_t) &isdn_linktab[unit]->tx_queue);
- }
- else
- {
- DBGL4(L4_RBCHDBG, "rbch_tx_queue_empty", ("unit %d, NO wakeup\n", unit));
- }
- selwakeup(&rbch_softc[unit].selp);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted
- *---------------------------------------------------------------------------*/
-static void
-rbch_activity(int unit, int rxtx)
-{
- if (rbch_softc[unit].cd)
- rbch_softc[unit].cd->last_active_time = SECOND;
- selwakeup(&rbch_softc[unit].selp);
-}
-
-/*---------------------------------------------------------------------------*
- * clear an hdlc rx queue for a rbch unit
- *---------------------------------------------------------------------------*/
-static void
-rbch_clrq(int unit)
-{
- int x;
- struct mbuf *m;
-
- for(;;)
- {
- x = splimp();
- IF_DEQUEUE(&rbch_softc[unit].sc_hdlcq, m);
- splx(x);
- if(m)
- m_freem(m);
- else
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-rbch_ret_linktab(int unit)
-{
- rbch_init_linktab(unit);
- return(&rbch_drvr_linktab[unit]);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-rbch_set_linktab(int unit, isdn_link_t *ilt)
-{
- isdn_linktab[unit] = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-rbch_init_linktab(int unit)
-{
- rbch_drvr_linktab[unit].unit = unit;
- rbch_drvr_linktab[unit].bch_rx_data_ready = rbch_rx_data_rdy;
- rbch_drvr_linktab[unit].bch_tx_queue_empty = rbch_tx_queue_empty;
- rbch_drvr_linktab[unit].bch_activity = rbch_activity;
- rbch_drvr_linktab[unit].line_connected = rbch_connect;
- rbch_drvr_linktab[unit].line_disconnected = rbch_disconnect;
- rbch_drvr_linktab[unit].dial_response = rbch_dialresponse;
- rbch_drvr_linktab[unit].updown_ind = rbch_updown;
-}
-
-/*===========================================================================*/
-
-#endif /* NI4BRBCH > 0 */
diff --git a/sys/i4b/driver/i4b_tel.c b/sys/i4b/driver/i4b_tel.c
deleted file mode 100644
index 81b38a614b061..0000000000000
--- a/sys/i4b/driver/i4b_tel.c
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tel.c - device driver for ISDN telephony
- * --------------------------------------------
- *
- * $Id: i4b_tel.c,v 1.18 1998/12/14 10:31:53 hm Exp $
- *
- * last edit-date: [Mon Dec 14 11:32:06 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4btel.h"
-
-#if NI4BTEL > 0
-
-#undef I4BTELDEBUG
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_tel_ioctl.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_tel_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-typedef struct {
- drvr_link_t drvr_linktab; /* driver linktab */
- isdn_link_t *isdn_linktab; /* isdn linktab */
- int devstate; /* state of this unit */
-#define ST_IDLE 0x00 /* idle */
-#define ST_CONNECTED 0x01 /* isdn connected state */
-#define ST_ISOPEN 0x02 /* userland opened */
-#define ST_RDWAITDATA 0x04 /* userland read waiting */
-#define ST_WRWAITEMPTY 0x08 /* userland write waiting */
- int audiofmt; /* audio format conversion */
- call_desc_t *cdp; /* call descriptor pointer */
-#ifdef DEVFS
- void *devfs_token; /* token for DEVFS */
-#endif
-} tel_sc_t;
-
-static tel_sc_t tel_sc[NI4BTEL];
-
-/* forward decl */
-
-static void tel_rx_data_rdy(int unit);
-static void tel_tx_queue_empty(int unit);
-static void tel_init_linktab(int unit);
-static void tel_connect(int unit, void *cdp);
-static void tel_disconnect(int unit, void *cdp);
-
-static unsigned char alaw_ulaw[];
-static unsigned char ulaw_alaw[];
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-PDEVSTATIC void i4btelattach __P((void));
-PDEVSTATIC int i4btelioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-int i4btelopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btelclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btelread __P((dev_t dev, struct uio *uio, int ioflag));
-int i4btelwrite __P((dev_t dev, struct uio * uio, int ioflag));
-#endif
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-PDEVSTATIC d_open_t i4btelopen;
-PDEVSTATIC d_close_t i4btelclose;
-PDEVSTATIC d_read_t i4btelread;
-PDEVSTATIC d_read_t i4btelwrite;
-PDEVSTATIC d_ioctl_t i4btelioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC d_poll_t i4btelpoll;
-#endif
-
-#define CDEV_MAJOR 56
-static struct cdevsw i4btel_cdevsw = {
- i4btelopen, i4btelclose, i4btelread, i4btelwrite,
- i4btelioctl, nostop, noreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4btelpoll, nommap, NULL, "i4btel", NULL, -1
-#else
- noselect, nommap, NULL, "i4btel", NULL, -1
-#endif
-};
-
-PDEVSTATIC void i4btelinit(void *unused);
-
-PDEVSTATIC void i4btelattach(void *);
-PSEUDO_SET(i4btelattach, i4b_tel);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-i4btelinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4btel_cdevsw, NULL);
-}
-
-SYSINIT(i4bteldev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4btelinit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4btelattach(void *dummy)
-#else
-i4btelattach()
-#endif
-{
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4btel: %d ISDN telephony interface device(s) attached\n", NI4BTEL);
-#endif
-
- for(i=0; i < NI4BTEL; i++)
- {
- tel_sc[i].devstate = ST_IDLE;
- tel_sc[i].audiofmt = CVT_NONE;
- tel_init_linktab(i);
-#ifdef DEVFS
- tel_sc[i].devfs_token
- = devfs_add_devswf(&i4btel_cdevsw, i, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4btel%d", i);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * open tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
- tel_sc_t *sc;
-
- if(unit > NI4BTEL)
- return(ENXIO);
-
- sc = &tel_sc[unit];
-
- if(!(sc->devstate & ST_CONNECTED))
- return(EIO);
-
- if(sc->devstate & ST_ISOPEN)
- return(EBUSY);
-
- sc->devstate |= ST_ISOPEN;
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
- tel_sc_t *sc;
- int error = 0;
-
- if(unit > NI4BTEL)
- return(ENXIO);
-
- sc = &tel_sc[unit];
-
- if(sc->isdn_linktab != NULL && sc->isdn_linktab->tx_queue != NULL)
- {
- while(!(IF_QEMPTY(sc->isdn_linktab->tx_queue)))
- {
- sc->devstate |= ST_WRWAITEMPTY;
-
- if((error = tsleep((caddr_t) &sc->isdn_linktab->tx_queue,
- TTIPRI | PCATCH, "wtcl", 0)) != 0)
- {
- break;
- }
- }
- sc->devstate &= ~ST_WRWAITEMPTY;
- }
- sc->devstate &= ~ST_ISOPEN;
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * i4btelioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300003
-i4btelioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4btelioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- int error = 0;
- struct mbuf *m;
- int s;
- tel_sc_t *sc = &tel_sc[minor(dev)];
-
- switch(cmd)
- {
- case I4B_TEL_GETAUDIOFMT:
- *(int *)data = sc->audiofmt;
- break;
-
- case I4B_TEL_SETAUDIOFMT:
- sc->audiofmt = *(int *)data;
- break;
-
- case I4B_TEL_EMPTYINPUTQUEUE:
- s = splimp();
- while((sc->devstate & ST_CONNECTED) &&
- (sc->devstate & ST_ISOPEN) &&
- !IF_QEMPTY(sc->isdn_linktab->rx_queue))
- {
- IF_DEQUEUE(sc->isdn_linktab->rx_queue, m);
- if(m)
- i4b_Bfreembuf(m);
- }
- splx(s);
- break;
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * read from tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- tel_sc_t *sc = &tel_sc[minor(dev)];
-
- if(!(sc->devstate & ST_CONNECTED))
- return(EIO);
-
- if(!(sc->devstate & ST_ISOPEN))
- return(EIO);
-
-#ifdef NOTDEF
- while(!(sc->devstate & ST_CONNECTED))
- {
- if((error = tsleep((caddr_t) &sc->devstate,
- TTIPRI | PCATCH,
- "rrtel", 0 )) != 0)
- {
- return(error);
- }
- }
-#endif
-
- while(IF_QEMPTY(sc->isdn_linktab->rx_queue) &&
- (sc->devstate & ST_ISOPEN) &&
- (sc->devstate & ST_CONNECTED))
- {
- sc->devstate |= ST_RDWAITDATA;
-
- if((error = tsleep((caddr_t) &sc->isdn_linktab->rx_queue,
- TTIPRI | PCATCH,
- "rtel", 0 )) != 0)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- return(error);
- }
- }
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- return(EIO);
- }
-
- if(!(sc->devstate & ST_CONNECTED))
- {
- return(EIO);
- }
-
- s = splimp();
-
- IF_DEQUEUE(sc->isdn_linktab->rx_queue, m);
-
- if(m && m->m_len)
- {
- if(sc->audiofmt == CVT_ALAW2ULAW)
- {
- int i;
- for(i = 0; i < m->m_len; i++)
- m->m_data[i] = alaw_ulaw[(int)m->m_data[i]];
- }
- error = uiomove(m->m_data, m->m_len, uio);
- }
- else
- {
- error = EIO;
- }
-
- if(m)
- i4b_Bfreembuf(m);
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * write to tel device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btelwrite(dev_t dev, struct uio * uio, int ioflag)
-{
- struct mbuf *m;
- int s;
- int error = 0;
- tel_sc_t *sc = &tel_sc[minor(dev)];
-
- if(!(sc->devstate & ST_CONNECTED))
- return(EIO);
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- return(EIO);
- }
-
-#ifdef NOTDEF
- while(!(sc->devstate & ST_CONNECTED))
- {
- if((error = tsleep((caddr_t) &sc->devstate,
- TTIPRI | PCATCH,
- "wrtel", 0 )) != 0)
- {
- return(error);
- }
-
- /*
- * XXX the originations B channel gets much earlier
- * switched thru than the destinations B channel, so
- * if the origination starts to send at once, some
- * 200 bytes (at my site) or so get lost, so i delay
- * a bit before sending. (-hm)
- */
-
- tsleep((caddr_t) &sc->devstate, TTIPRI | PCATCH, "xtel", (hz*1));
- }
-#endif
-
- while((IF_QFULL(sc->isdn_linktab->tx_queue)) &&
- (sc->devstate & ST_ISOPEN))
- {
- sc->devstate |= ST_WRWAITEMPTY;
-
- if((error = tsleep((caddr_t) &sc->isdn_linktab->tx_queue,
- TTIPRI | PCATCH, "wtel", 0)) != 0)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- return(error);
- }
- }
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- return(EIO);
- }
-
- if(!(sc->devstate & ST_CONNECTED))
- {
- return(EIO);
- }
-
- s = splimp();
-
- if((m = i4b_Bgetmbuf(BCH_MAX_DATALEN)) != NULL)
- {
- m->m_len = min(BCH_MAX_DATALEN, uio->uio_resid);
-
- error = uiomove(m->m_data, m->m_len, uio);
-
- if(sc->audiofmt == CVT_ALAW2ULAW)
- {
- int i;
- for(i = 0; i < m->m_len; i++)
- m->m_data[i] = ulaw_alaw[(int)m->m_data[i]];
- }
-
- IF_ENQUEUE(sc->isdn_linktab->tx_queue, m);
-
- (*sc->isdn_linktab->bch_tx_start)(sc->isdn_linktab->unit, sc->isdn_linktab->channel);
- }
-
- splx(s);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * poll
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC int
-i4btelpoll (dev_t dev, int events, struct proc *p)
-{
- return (ENODEV);
-}
-#endif
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
-* this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-tel_connect(int unit, void *cdp)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- sc->cdp = (call_desc_t *)cdp;
-
-#ifdef NOTDEF
- if(!(sc->devstate & ST_CONNECTED))
- {
- sc->devstate |= ST_CONNECTED;
- wakeup((caddr_t) &sc->devstate);
- }
-#else
- sc->devstate |= ST_CONNECTED;
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-tel_disconnect(int unit, void *cdp)
-{
-/* call_desc_t *cd = (call_desc_t *)cdp; */
-
- tel_sc_t *sc = &tel_sc[unit];
-
- sc->devstate &= ~ST_CONNECTED;
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup((caddr_t) &sc->isdn_linktab->rx_queue);
- }
-
- if(sc->devstate & ST_WRWAITEMPTY)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- wakeup((caddr_t) &sc->isdn_linktab->tx_queue);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * feedback from daemon in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-tel_dialresponse(int unit, int status)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * interface up/down
- *---------------------------------------------------------------------------*/
-static void
-tel_updown(int unit, int updown)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when a new frame (mbuf) has been received and was put on
- * the rx queue.
- *---------------------------------------------------------------------------*/
-static void
-tel_rx_data_rdy(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup((caddr_t) &sc->isdn_linktab->rx_queue);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * when the last frame has been sent out and there is no
- * further frame (mbuf) in the tx queue.
- *---------------------------------------------------------------------------*/
-static void
-tel_tx_queue_empty(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- if(sc->devstate & ST_WRWAITEMPTY)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- wakeup((caddr_t) &sc->isdn_linktab->tx_queue);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from the HSCX interrupt handler
- * each time a packet is received or transmitted.
- *---------------------------------------------------------------------------*/
-static void
-tel_activity(int unit, int rxtx)
-{
- tel_sc[unit].cdp->last_active_time = SECOND;
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-tel_ret_linktab(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- tel_init_linktab(unit);
- return(&sc->drvr_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-tel_set_linktab(int unit, isdn_link_t *ilt)
-{
- tel_sc_t *sc = &tel_sc[unit];
- sc->isdn_linktab = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-tel_init_linktab(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit];
-
- sc->drvr_linktab.unit = unit;
- sc->drvr_linktab.bch_rx_data_ready = tel_rx_data_rdy;
- sc->drvr_linktab.bch_tx_queue_empty = tel_tx_queue_empty;
- sc->drvr_linktab.bch_activity = tel_activity;
- sc->drvr_linktab.line_connected = tel_connect;
- sc->drvr_linktab.line_disconnected = tel_disconnect;
- sc->drvr_linktab.dial_response = tel_dialresponse;
- sc->drvr_linktab.updown_ind = tel_updown;
-}
-
-/*===========================================================================*
- * AUDIO FORMAT CONVERSION
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * A-law to mu-law conversion
- *---------------------------------------------------------------------------*/
-static unsigned char alaw_ulaw[] = {
- 0x002a, 0x00a9, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0048, 0x00c8,
- 0x0039, 0x00b9, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0055, 0x00d7,
- 0x0022, 0x00a1, 0x005b, 0x00dd, 0x001f, 0x009f, 0x0040, 0x00c0,
- 0x0031, 0x00b1, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004e, 0x00cf,
- 0x002e, 0x00ad, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004c, 0x00cc,
- 0x003d, 0x00bd, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0059, 0x00db,
- 0x0026, 0x00a5, 0x005d, 0x00df, 0x001f, 0x009f, 0x0044, 0x00c4,
- 0x0035, 0x00b5, 0x006b, 0x00ef, 0x001f, 0x009f, 0x0051, 0x00d3,
- 0x0028, 0x00a7, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0046, 0x00c6,
- 0x0037, 0x00b7, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0053, 0x00d5,
- 0x0020, 0x009f, 0x005b, 0x00dd, 0x001f, 0x009f, 0x003f, 0x00bf,
- 0x002f, 0x00af, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004d, 0x00ce,
- 0x002c, 0x00ab, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004a, 0x00ca,
- 0x003b, 0x00bb, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0057, 0x00d9,
- 0x0024, 0x00a3, 0x005d, 0x00df, 0x001f, 0x009f, 0x0042, 0x00c2,
- 0x0033, 0x00b3, 0x006b, 0x00ef, 0x001f, 0x009f, 0x004f, 0x00d1,
- 0x002b, 0x00aa, 0x0063, 0x00e3, 0x001f, 0x009f, 0x0049, 0x00c9,
- 0x003a, 0x00ba, 0x0077, 0x00f7, 0x001f, 0x009f, 0x0057, 0x00d7,
- 0x0023, 0x00a2, 0x005d, 0x00dd, 0x001f, 0x009f, 0x0041, 0x00c1,
- 0x0032, 0x00b2, 0x006b, 0x00eb, 0x001f, 0x009f, 0x004f, 0x00cf,
- 0x002f, 0x00ae, 0x0067, 0x00e7, 0x001f, 0x009f, 0x004d, 0x00cd,
- 0x003e, 0x00be, 0x00ff, 0x00ff, 0x001f, 0x009f, 0x005b, 0x00db,
- 0x0027, 0x00a6, 0x005f, 0x00df, 0x001f, 0x009f, 0x0045, 0x00c5,
- 0x0036, 0x00b6, 0x006f, 0x00ef, 0x001f, 0x009f, 0x0053, 0x00d3,
- 0x0029, 0x00a8, 0x005f, 0x00e3, 0x001f, 0x009f, 0x0047, 0x00c7,
- 0x0038, 0x00b8, 0x006f, 0x00f7, 0x001f, 0x009f, 0x0055, 0x00d5,
- 0x0021, 0x00a0, 0x005b, 0x00dd, 0x001f, 0x009f, 0x003f, 0x00bf,
- 0x0030, 0x00b0, 0x0067, 0x00eb, 0x001f, 0x009f, 0x004e, 0x00ce,
- 0x002d, 0x00ac, 0x0063, 0x00e7, 0x001f, 0x009f, 0x004b, 0x00cb,
- 0x003c, 0x00bc, 0x0077, 0x00ff, 0x001f, 0x009f, 0x0059, 0x00d9,
- 0x0025, 0x00a4, 0x005d, 0x00df, 0x001f, 0x009f, 0x0043, 0x00c3,
- 0x0034, 0x00b4, 0x006b, 0x00ef, 0x001f, 0x009f, 0x0051, 0x00d1
-};
-
-/*---------------------------------------------------------------------------*
- * mu-law to A-law conversion
- *---------------------------------------------------------------------------*/
-static unsigned char ulaw_alaw[] = {
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00ac,
- 0x0050, 0x00d0, 0x0010, 0x0090, 0x0070, 0x00f0, 0x0030, 0x00b0,
- 0x0040, 0x00c0, 0x0000, 0x0080, 0x0060, 0x00e0, 0x0020, 0x00a0,
- 0x00d8, 0x0018, 0x0098, 0x0078, 0x00f8, 0x0038, 0x00b8, 0x0048,
- 0x00c8, 0x0008, 0x0088, 0x0068, 0x00e8, 0x0028, 0x00a8, 0x00d6,
- 0x0096, 0x0076, 0x00f6, 0x0036, 0x00b6, 0x0046, 0x00c6, 0x0006,
- 0x0086, 0x0066, 0x00e6, 0x0026, 0x00a6, 0x00de, 0x009e, 0x00fe,
- 0x00fe, 0x00be, 0x00be, 0x00ce, 0x00ce, 0x008e, 0x008e, 0x00ee,
- 0x00ee, 0x00d2, 0x00d2, 0x00f2, 0x00f2, 0x00c2, 0x00c2, 0x00e2,
- 0x00e2, 0x00e2, 0x00da, 0x00da, 0x00da, 0x00da, 0x00fa, 0x00fa,
- 0x00fa, 0x00fa, 0x00ca, 0x00ca, 0x00ca, 0x00ca, 0x00ea, 0x00ea,
- 0x00ea, 0x00ea, 0x00ea, 0x00ea, 0x00eb, 0x00eb, 0x00eb, 0x00eb,
- 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb, 0x00eb,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd, 0x00fd,
- 0x00d1, 0x0011, 0x0091, 0x0071, 0x00f1, 0x0031, 0x00b1, 0x0041,
- 0x00c1, 0x0001, 0x0081, 0x0061, 0x00e1, 0x0021, 0x00a1, 0x0059,
- 0x00d9, 0x0019, 0x0099, 0x0079, 0x00f9, 0x0039, 0x00b9, 0x0049,
- 0x00c9, 0x0009, 0x0089, 0x0069, 0x00e9, 0x0029, 0x00a9, 0x0057,
- 0x0017, 0x0097, 0x0077, 0x00f7, 0x0037, 0x00b7, 0x0047, 0x00c7,
- 0x0007, 0x0087, 0x0067, 0x00e7, 0x0027, 0x00a7, 0x00df, 0x009f,
- 0x009f, 0x00ff, 0x00ff, 0x00bf, 0x00bf, 0x00cf, 0x00cf, 0x008f,
- 0x008f, 0x00ef, 0x00ef, 0x00af, 0x00af, 0x00d3, 0x00d3, 0x00f3,
- 0x00f3, 0x00f3, 0x00c3, 0x00c3, 0x00c3, 0x00c3, 0x00e3, 0x00e3,
- 0x00e3, 0x00e3, 0x00db, 0x00db, 0x00db, 0x00db, 0x00fb, 0x00fb,
- 0x00fb, 0x00fb, 0x00fb, 0x00fb, 0x00cb, 0x00cb, 0x00cb, 0x00cb,
- 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x00eb, 0x00eb, 0x00eb, 0x00eb
-};
-
-/*===========================================================================*/
-
-#endif /* NI4BTEL > 0 */
diff --git a/sys/i4b/driver/i4b_trace.c b/sys/i4b/driver/i4b_trace.c
deleted file mode 100644
index f64e35d622fdb..0000000000000
--- a/sys/i4b/driver/i4b_trace.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4btrc - device driver for trace data read device
- * ---------------------------------------------------
- *
- * $Id: i4b_trace.c,v 1.14 1998/12/05 18:02:51 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:01:53 1998]
- *
- * NOTE: the code assumes that SPLI4B >= splimp !
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4btrc.h"
-
-#if NI4BTRC > 0
-
-#ifdef __FreeBSD__
-#include "isic.h" /* 'isic' is no pseudo-device on non FreeBSD -
- * so we just can't count it at compile time,
- * we're doing an attach-time check instead. */
-
-#if NI4BTRC < NISIC
-#error "number of trace devices != number of passive ISDN controllers !"
-#error "change number of i4btrc to be equal to number of isic devices !"
-#endif
-#endif /* __FreeBSD__ */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_trace.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_trace.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#ifndef __FreeBSD__
-#define memcpy(d,s,l) bcopy(s,d,l)
-#endif
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-static struct ifqueue trace_queue[NI4BTRC];
-static int device_state[NI4BTRC];
-#define ST_IDLE 0x00
-#define ST_ISOPEN 0x01
-#define ST_WAITDATA 0x02
-#ifdef DEVFS
-static void *devfs_token[NI4BTRC];
-#endif
-
-static int analyzemode = 0;
-static int rxunit = -1;
-static int txunit = -1;
-static int outunit = -1;
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-void i4btrcattach __P((void));
-int i4btrcopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btrcclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-int i4btrcread __P((dev_t dev, struct uio * uio, int ioflag));
-int i4btrcioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-#endif
-
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-static d_open_t i4btrcopen;
-static d_close_t i4btrcclose;
-static d_read_t i4btrcread;
-static d_ioctl_t i4btrcioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-static d_poll_t i4btrcpoll;
-#endif
-
-#define CDEV_MAJOR 59
-static struct cdevsw i4btrc_cdevsw = {
- i4btrcopen, i4btrcclose, i4btrcread, nowrite,
- i4btrcioctl, nostop, noreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4btrcpoll, nommap, NULL, "i4btrc", NULL, -1
-#else
- noselect, nommap, NULL, "i4btrc", NULL, -1
-#endif
-};
-
-/*---------------------------------------------------------------------------*
- * interface init routine
- *---------------------------------------------------------------------------*/
-static
-void i4btrcinit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4btrc_cdevsw, NULL);
-}
-
-SYSINIT(i4btrcdev, SI_SUB_DRIVERS,
- SI_ORDER_MIDDLE+CDEV_MAJOR, &i4btrcinit, NULL);
-
-static void i4btrcattach(void *);
-PSEUDO_SET(i4btrcattach, i4b_trace);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-int get_trace_data_from_l1(i4b_trace_hdr_t *hdr, int len, char *buf);
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4btrcattach(void *dummy)
-#else
-i4btrcattach()
-#endif
-{
- int i;
-
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4btrc: %d ISDN trace device(s) attached\n", NI4BTRC);
-#endif
-
- for(i=0; i < NI4BTRC; i++)
- {
-#ifdef DEVFS
- devfs_token[i]
- = devfs_add_devswf(&i4btrc_cdevsw, i, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4btrc%d", i);
-#endif
- trace_queue[i].ifq_maxlen = IFQ_MAXLEN;
- device_state[i] = ST_IDLE;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * get_trace_data_from_l1()
- * ------------------------
- * is called from layer 1, adds timestamp to trace data and puts
- * it into a queue, from which it can be read from the i4btrc
- * device. The unit number in the trace header selects the minor
- * device's queue the data is put into.
- *---------------------------------------------------------------------------*/
-int
-get_trace_data_from_l1(i4b_trace_hdr_t *hdr, int len, char *buf)
-{
- struct mbuf *m;
- int x;
- int unit;
- int trunc = 0;
- int totlen = len + sizeof(i4b_trace_hdr_t);
-
- /*
- * for telephony (or better non-HDLC HSCX mode) we get
- * (MCLBYTE + sizeof(i4b_trace_hdr_t)) length packets
- * to put into the queue to userland. because of this
- * we detect this situation, strip the length to MCLBYTES
- * max size, and infor the userland program of this fact
- * by putting the no of truncated bytes into hdr->trunc.
- */
-
- if(totlen > MCLBYTES)
- {
- trunc = 1;
- hdr->trunc = totlen - MCLBYTES;
- totlen = MCLBYTES;
- }
- else
- {
- hdr->trunc = 0;
- }
-
- /* set length of trace record */
-
- hdr->length = totlen;
-
- /* check valid unit no */
-
- if((unit = hdr->unit) > NI4BTRC)
- {
- printf("i4b_trace: get_trace_data_from_l1 - unit > NI4BTRC!\n");
- return(0);
- }
-
- /* get mbuf */
-
- if(!(m = i4b_Bgetmbuf(totlen)))
- {
- printf("i4b_trace: get_trace_data_from_l1 - i4b_getmbuf() failed!\n");
- return(0);
- }
-
- /* check if we are in analyzemode */
-
- if(analyzemode && (unit == rxunit || unit == txunit))
- {
- if(unit == rxunit)
- hdr->dir = FROM_NT;
- else
- hdr->dir = FROM_TE;
- unit = outunit;
- }
-
- if(IF_QFULL(&trace_queue[unit]))
- {
- struct mbuf *m1;
-
- x = SPLI4B();
- IF_DEQUEUE(&trace_queue[unit], m1);
- splx(x);
-
- i4b_Bfreembuf(m1);
- }
-
- /* copy trace header */
- memcpy(m->m_data, hdr, sizeof(i4b_trace_hdr_t));
-
- /* copy trace data */
- if(trunc)
- memcpy(&m->m_data[sizeof(i4b_trace_hdr_t)], buf, totlen-sizeof(i4b_trace_hdr_t));
- else
- memcpy(&m->m_data[sizeof(i4b_trace_hdr_t)], buf, len);
-
- x = SPLI4B();
-
- IF_ENQUEUE(&trace_queue[unit], m);
-
- if(device_state[unit] & ST_WAITDATA)
- {
- device_state[unit] &= ~ST_WAITDATA;
- wakeup((caddr_t) &trace_queue[unit]);
- }
-
- splx(x);
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- * open trace device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btrcopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int x;
- int unit = minor(dev);
-
- if(unit > NI4BTRC)
- return(ENXIO);
-
- if(device_state[unit] & ST_ISOPEN)
- return(EBUSY);
-
- if(analyzemode && (unit == outunit || unit == rxunit || unit == txunit))
- return(EBUSY);
-
- x = SPLI4B();
-
- device_state[unit] = ST_ISOPEN;
-
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close trace device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btrcclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = minor(dev);
- int i, x, cno = -1;
-
- for(i = 0; i < nctrl; i++)
- {
- if(ctrl_desc[i].N_SET_TRACE)
- {
- cno = i;
- break;
- }
- }
-
- if(analyzemode && (unit == outunit))
- {
- analyzemode = 0;
- outunit = -1;
-
- if(cno >= 0)
- {
- ctrl_desc[cno].N_SET_TRACE(rxunit, TRACE_OFF);
- ctrl_desc[cno].N_SET_TRACE(txunit, TRACE_OFF);
- }
- rxunit = -1;
- txunit = -1;
- }
-
- if(cno >= 0)
- {
- ctrl_desc[cno].N_SET_TRACE(unit, TRACE_OFF);
- }
-
- x = SPLI4B();
- device_state[unit] = ST_IDLE;
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * read from trace device
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4btrcread(dev_t dev, struct uio * uio, int ioflag)
-{
- struct mbuf *m;
- int x;
- int error = 0;
- int unit = minor(dev);
-
- if(!(device_state[unit] & ST_ISOPEN))
- return(EIO);
-
- x = SPLI4B();
-
- while(IF_QEMPTY(&trace_queue[unit]) && (device_state[unit] & ST_ISOPEN))
- {
- device_state[unit] |= ST_WAITDATA;
-
- if((error = tsleep((caddr_t) &trace_queue[unit],
- TTIPRI | PCATCH,
- "bitrc", 0 )) != 0)
- {
- device_state[unit] &= ~ST_WAITDATA;
- splx(x);
- return(error);
- }
- }
-
- IF_DEQUEUE(&trace_queue[unit], m);
-
- if(m && m->m_len)
- error = uiomove(m->m_data, m->m_len, uio);
- else
- error = EIO;
-
- if(m)
- i4b_Bfreembuf(m);
-
- splx(x);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * poll device
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC int
-i4btrcpoll(dev_t dev, int events, struct proc *p)
-{
- return(ENODEV);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
-i4btrcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4btrcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- int error = 0;
- int unit = minor(dev);
- i4b_trace_setupa_t *tsa;
- int i, cno = -1;
-
- /* find the first passive controller to get at the set/get function
- pointers. Would be better if we had the controller class virtual
- function table separate from the port registry... */
-
- for(i=0; i < nctrl; i++)
- {
- if(ctrl_desc[i].N_SET_TRACE)
- {
- cno = i; /* one suitable controller, might not */
- break; /* be related to the trace unit at all, but */
- } /* has the right function pointers */
- }
-
- switch(cmd)
- {
- case I4B_TRC_GET:
- if(cno < 0)
- return ENOTTY;
- *(int *)data = ctrl_desc[cno].N_GET_TRACE(unit);
- break;
-
- case I4B_TRC_SET:
- if(cno < 0)
- return ENOTTY;
- ctrl_desc[cno].N_SET_TRACE(unit, *(int *)data);
- break;
-
- case I4B_TRC_SETA:
- tsa = (i4b_trace_setupa_t *)data;
-
- if(tsa->rxunit >= 0 && tsa->rxunit < NI4BTRC)
- rxunit = tsa->rxunit;
- else
- error = EINVAL;
-
- if(tsa->txunit >= 0 && tsa->txunit < NI4BTRC)
- txunit = tsa->txunit;
- else
- error = EINVAL;
-
- if(error)
- {
- outunit = -1;
- rxunit = -1;
- txunit = -1;
- }
- else
- {
- if(cno < 0)
- return ENOTTY;
-
- outunit = unit;
- analyzemode = 1;
- ctrl_desc[cno].N_SET_TRACE(rxunit, tsa->rxflags & (TRACE_I | TRACE_D_RX | TRACE_B_RX));
- ctrl_desc[cno].N_SET_TRACE(txunit, tsa->txflags & (TRACE_I | TRACE_D_RX | TRACE_B_RX));
- }
- break;
-
- case I4B_TRC_RESETA:
- analyzemode = 0;
- outunit = -1;
- rxunit = -1;
- txunit = -1;
- break;
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-}
-
-#endif /* NI4BTRC > 0 */
diff --git a/sys/i4b/include/i4b_global.h b/sys/i4b/include/i4b_global.h
deleted file mode 100644
index 739d78d6b3ed9..0000000000000
--- a/sys/i4b/include/i4b_global.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_global.h - i4b global include file
- * --------------------------------------
- *
- * $Id: i4b_global.h,v 1.17 1998/12/05 18:02:53 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:03:41 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_GLOBAL_H_
-#define _I4B_GLOBAL_H_
-
-#define SPLI4B() splimp() /* spl for i4b */
-
-#define TIMER_IDLE 1 /* a timer is running */
-#define TIMER_ACTIVE 2 /* a timer is idle */
-
-#ifdef __FreeBSD__
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-
-#define TIMEOUT_FUNC_T timeout_t *
-#define SECOND time_second
-#define MICROTIME(x) getmicrotime(&(x))
-
-#else /* FreeBSD < 3 */
-
-#define TIMEOUT_FUNC_T timeout_func_t
-#define SECOND time.tv_sec
-#define MICROTIME(x) microtime(&(x))
-
-#endif /* >= 3 */
-#endif /* __FreeBSD__ */
-
-#if defined(__NetBSD__) || defined (__OpenBSD__)
-
-#define TIMEOUT_FUNC_T void *
-#define SECOND time.tv_sec
-#define MICROTIME(x) (x) = time
-
-#endif /* __NetBSD__ */
-
-/* definitions for the STATUS indications L1 -> L2 -> L3 */
-
-#define STI_ATTACH 0 /* attach at boot time */
-#define STI_L1STAT 1 /* layer 1 status */
-#define STI_L2STAT 2 /* layer 2 status */
-#define STI_TEIASG 3 /* TEI assignments */
-#define STI_PDEACT 4 /* Layer 1 T4 expired = persistent deactivation */
-#define STI_NOL1ACC 5 /* no outgoing L1 access possible */
-
-/* definitions for the COMMAND requests L3 -> L2 -> L1 */
-
-#define CMR_DOPEN 0 /* daemon opened /dev/i4b */
-#define CMR_DCLOSE 1 /* daemon closed /dev/i4b */
-
-/*---------------------------------------------------------------------------
- *
- * Number of max supported passive card units
- *
- * Teles/Creatix/Neuhaus cards have a hardware limitation
- * as one is able to set 3 (sometimes 4) different configurations by
- * jumpers so a maximum of 3 (4) cards per ISA bus is possible.
- * (Note: there are multiple ISA buses on some architectures)
- *
- *---------------------------------------------------------------------------*/
-#define ISIC_MAXUNIT 3 /* max no of supported units 0..3 */
-
-#endif /* _I4B_GLOBAL_H_ */
diff --git a/sys/i4b/include/i4b_isdnq931.h b/sys/i4b/include/i4b_isdnq931.h
deleted file mode 100644
index bdc77f08c660f..0000000000000
--- a/sys/i4b/include/i4b_isdnq931.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isdnq931.h - DSS1 layer 3 message types
- * -------------------------------------------
- *
- * $Id: i4b_isdnq931.h,v 1.4 1998/12/05 18:02:54 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:01 1998]
- *
- *---------------------------------------------------------------------------*/
-
-/* protocol discriminators */
-
-#define PD_Q931 0x08 /* Q.931/I.451 */
-
-/* Q.931 single octett information element identifiers */
-
-#define IEI_SENDCOMPL 0xa1 /* sending complete */
-
-/* Q.931 variable length information element identifiers */
-
-#define IEI_SEGMMSG 0x00 /* segmented message */
-#define IEI_BEARERCAP 0x04 /* bearer capabilities */
-#define IEI_CAUSE 0x08 /* cause */
-#define IEI_CALLID 0x10 /* call identity */
-#define IEI_CALLSTATE 0x14 /* call state */
-#define IEI_CHANNELID 0x18 /* channel identification */
-#define IEI_PROGRESSI 0x1e /* progress indicator */
-#define IEI_NETSPCFAC 0x20 /* network specific facilities */
-#define IEI_NOTIFIND 0x27 /* notification indicator */
-#define IEI_DISPLAY 0x28 /* display */
-#define IEI_DATETIME 0x29 /* date/time */
-#define IEI_KEYPAD 0x2c /* keypad facility */
-#define IEI_SIGNAL 0x34 /* signal */
-#define IEI_INFRATE 0x40 /* information rate */
-#define IEI_ETETDEL 0x42 /* end to end transit delay */
-#define IEI_TDELSELIND 0x43 /* transit delay selection and indication */
-#define IEI_PLBPARMS 0x44 /* packet layer binary parameters */
-#define IEI_PLWSIZE 0x45 /* packet layer window size */
-#define IEI_PSIZE 0x46 /* packet size */
-#define IEI_CUG 0x47 /* closed user group */
-#define IEI_REVCHRGI 0x4a /* reverse charge indication */
-#define IEI_CALLINGPN 0x6c /* calling party number */
-#define IEI_CALLINGPS 0x6d /* calling party subaddress */
-#define IEI_CALLEDPN 0x70 /* called party number */
-#define IEI_CALLEDPS 0x71 /* called party subaddress */
-#define IEI_REDIRNO 0x74 /* redirecting number */
-#define IEI_TRNSEL 0x78 /* transit network selection */
-#define IEI_RESTARTI 0x79 /* restart indicator */
-#define IEI_LLCOMPAT 0x7c /* low layer compatibility */
-#define IEI_HLCOMPAT 0x7d /* high layer compatibility */
-#define IEI_USERUSER 0x7e /* user-user */
-#define IEI_ESACPE 0x7f /* escape for extension */
-
-/* Q.932 variable length information element identifiers */
-
-#define IEI_EXTFAC 0x0d /* extended facility */
-#define IEI_FACILITY 0x1c /* facility */
-#define IEI_INFOREQ 0x32 /* information request */
-#define IEI_FEATACT 0x38 /* feature activation */
-#define IEI_FEATIND 0x39 /* feature indication */
-#define IEI_SERVPID 0x3a /* service profile identification */
-#define IEI_ENDPTID 0x3b /* endpoint identifier */
-
-/* Q.933 variable length information element identifiers */
-
-#define IEI_DATALCID 0x19 /* data link connection identifier */
-#define IEI_LLCOREP 0x48 /* link layer core parameters */
-#define IEI_LLPROTP 0x49 /* link layer protocol parameters */
-#define IEI_X213PRI 0x50 /* X.213 priority */
-#define IEI_REPORTT 0x51 /* report type */
-#define IEI_LNKITYVERF 0x53 /* link integrity verification */
-#define IEI_PVCSTAT 0x57 /* PVC status */
-
-/* Q.95x variable length information element identifiers */
-
-#define IEI_PRECLEV 0x41 /* precedence level */
-#define IEI_CONCTDNO 0x4c /* connected number */
-#define IEI_CONCTDSA 0x4d /* connected subaddress */
-#define IEI_REDICNNO 0x76 /* redirection number */
-
-/* single octett information elements */
-
-#define SOIE_SHIFT 0x90 /* shift codeset */
-#define SHIFT_LOCK 0x08 /* shift codeset, locking shift bit */
-#define SOIE_MDSC 0xa0 /* more data AND/OR sending complete */
-#define SOIE_SENDC 0xa1 /* sending complete */
-#define SOIE_CONGL 0xb0 /* congestion level */
-#define SOIE_REPTI 0xd0 /* repeat indicator */
-
-/* codesets */
-
-#define CODESET_0 0 /* codeset 0, normal DSS1 codeset */
-
-/* Q.931/Q.932 message types (see Q.931 03/93 p10 and p311) */
-
-/* call establishment messages */
-
-#define ALERT 0x01
-#define CALL_PROCEEDING 0x02
-#define PROGRESS 0x03
-#define SETUP 0x05
-#define CONNECT 0x07
-#define SETUP_ACKNOWLEDGE 0x0d
-#define CONNECT_ACKNOWLEDGE 0x0f
-
-/* call information phase messages */
-
-#define USER_INFORMATION 0x20
-#define SUSPEND_REJECT 0x21
-#define RESUME_REJECT 0x22
-#define HOLD 0x24
-#define SUSPEND 0x25
-#define RESUME 0x26
-#define HOLD_ACKNOWLEDGE 0x28
-#define SUSPEND_ACKNOWLEDGE 0x2d
-#define RESUME_ACKNOWLEDGE 0x2e
-#define HOLD_REJECT 0x30
-#define RETRIEVE 0x31
-#define RETRIEVE_ACKNOWLEDGE 0x32
-#define RETRIEVE_REJECT 0x37
-
-/* call clearing */
-
-#define DISCONNECT 0x45
-#define RESTART 0x46
-#define RELEASE 0x4d
-#define RESTART_ACKNOWLEDGE 0x4e
-#define RELEASE_COMPLETE 0x5a
-
-/* misc messages */
-
-#define SEGMENT 0x60
-#define FACILITY 0x62
-#define REGISTER 0x64
-#define NOTIFY 0x6e
-#define STATUS_ENQUIRY 0x75
-#define CONGESTION_CONTROL 0x79
-#define INFORMATION 0x7b
-#define STATUS 0x7d
-
-/* EOF */
diff --git a/sys/i4b/include/i4b_l1l2.h b/sys/i4b/include/i4b_l1l2.h
deleted file mode 100644
index 782ca68a97a39..0000000000000
--- a/sys/i4b/include/i4b_l1l2.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l1l2.h - i4b layer 1 / layer 2 interactions
- * ---------------------------------------------------
- *
- * $Id: i4b_l1l2.h,v 1.7 1998/12/05 18:02:56 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:25 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L1L2_H_
-#define _I4B_L1L2_H_
-
-#ifdef __FreeBSD__
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_trace.h>
-#endif
-
-extern struct i4b_l1l2_func i4b_l1l2_func;
-
-struct i4b_l1l2_func
-{
- /* Layer 1 --> Layer 2 */
- /* =================== */
-
- int (*PH_DATA_IND) (int, struct mbuf *);
- int (*PH_ACTIVATE_IND) (int);
- int (*PH_DEACTIVATE_IND) (int);
-
-#define PH_Data_Ind(unit, data) \
- ((*i4b_l1l2_func.PH_DATA_IND)(unit, data))
-#define PH_Act_Ind(unit) \
- ((*i4b_l1l2_func.PH_ACTIVATE_IND)(unit))
-#define PH_Deact_Ind(unit) \
- ((*i4b_l1l2_func.PH_DEACTIVATE_IND)(unit))
-
-
- /* Layer 2 --> Layer 1 */
- /* =================== */
-
- int (*PH_DATA_REQ) (int, struct mbuf *, int);
-
- /* 3rd ph_data_req parameter */
-#define MBUF_DONTFREE 0
-#define MBUF_FREE 1
-
- int (*PH_ACTIVATE_REQ) (int);
-
-#define PH_Data_Req(unit, data, freeflag) \
- ((*i4b_l1l2_func.PH_DATA_REQ)(unit, data, freeflag))
-#define PH_Act_Req(unit) \
- ((*i4b_l1l2_func.PH_ACTIVATE_REQ)(unit))
-
- /* Layer 1 --> upstream, ISDN trace data */
- /* ===================================== */
- int (*MPH_TRACE_IND) (i4b_trace_hdr_t *, int, unsigned char *);
-
-#define MPH_Trace_Ind(header, length, pointer) \
- ((*i4b_l1l2_func.MPH_TRACE_IND)(header, length, pointer))
-
- /* L1/L2 management command and status information */
- /* =============================================== */
- int (*MPH_STATUS_IND) (int, int, int);
- int (*MPH_COMMAND_REQ) (int, int, int);
-
-#define MPH_Status_Ind(unit, status, parm) \
- ((*i4b_l1l2_func.MPH_STATUS_IND)(unit, status, parm))
-#define MPH_Command_Req(unit, command, parm) \
- ((*i4b_l1l2_func.MPH_COMMAND_REQ)(unit, command, parm))
-};
-
-#endif /* _I4B_L1L2_H_ */
-
diff --git a/sys/i4b/include/i4b_l2l3.h b/sys/i4b/include/i4b_l2l3.h
deleted file mode 100644
index 81ab1829ebc92..0000000000000
--- a/sys/i4b/include/i4b_l2l3.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2l3.h - i4b layer 2 / layer 3 interactions
- * -----------------------------------------------
- *
- * $Id: i4b_l2l3.h,v 1.5 1998/12/05 18:02:57 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:44 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L2L3_H_
-#define _I4B_L2L3_H_
-
-extern struct i4b_l2l3_func i4b_l2l3_func;
-
-struct i4b_l2l3_func
-{
- /* Layer 2 --> Layer 3 */
- /* =================== */
-
- int (*DL_ESTABLISH_IND) (int);
- int (*DL_ESTABLISH_CNF) (int);
-
- int (*DL_RELEASE_IND) (int);
- int (*DL_RELEASE_CNF) (int);
-
- int (*DL_DATA_IND) (int, struct mbuf *);
-
- int (*DL_UNIT_DATA_IND) (int, struct mbuf *);
-
-#define DL_Est_Ind(unit) \
- ((*i4b_l2l3_func.DL_ESTABLISH_IND)(unit))
-#define DL_Est_Cnf(unit) \
- ((*i4b_l2l3_func.DL_ESTABLISH_CNF)(unit))
-#define DL_Rel_Ind(unit) \
- ((*i4b_l2l3_func.DL_RELEASE_IND)(unit))
-#define DL_Rel_Cnf(unit) \
- ((*i4b_l2l3_func.DL_RELEASE_CNF)(unit))
-#define DL_Data_Ind(unit, data) \
- ((*i4b_l2l3_func.DL_DATA_IND)(unit, data))
-#define DL_Unit_Data_Ind(unit, data) \
- ((*i4b_l2l3_func.DL_UNIT_DATA_IND)(unit, data))
-
-#define DL_Est_Ind_A \
- (i4b_l2l3_func.DL_ESTABLISH_IND)
-#define DL_Est_Cnf_A \
- (i4b_l2l3_func.DL_ESTABLISH_CNF)
-#define DL_Rel_Ind_A \
- (i4b_l2l3_func.DL_RELEASE_IND)
-#define DL_Rel_Cnf_A \
- (i4b_l2l3_func.DL_RELEASE_CNF)
-
- /* Layer 3 --> Layer 2 */
- /* =================== */
-
- int (*DL_ESTABLISH_REQ) (int);
-
- int (*DL_RELEASE_REQ) (int);
-
- int (*DL_DATA_REQ) (int, struct mbuf *);
-
- int (*DL_UNIT_DATA_REQ) (int, struct mbuf *);
-
-#define DL_Est_Req(unit) \
- ((*i4b_l2l3_func.DL_ESTABLISH_REQ)(unit))
-#define DL_Rel_Req(unit) \
- ((*i4b_l2l3_func.DL_RELEASE_REQ)(unit))
-#define DL_Data_Req(unit, data) \
- ((*i4b_l2l3_func.DL_DATA_REQ)(unit, data))
-#define DL_Unit_Data_Req(unit, data) \
- ((*i4b_l2l3_func.DL_UNIT_DATA_REQ)(unit, data))
-
- /* Layer 2 --> Layer 3 management */
- /* ============================== */
-
- int (*MDL_STATUS_IND) (int, int, int); /* L2 --> L3 status */
-
-#define MDL_Status_Ind(unit, status, parm) \
- ((*i4b_l2l3_func.MDL_STATUS_IND)(unit, status, parm))
-
- /* Layer 3 --> Layer 2 management */
- /* ============================== */
-
- int (*MDL_COMMAND_REQ) (int, int, int); /* L3 --> L2 command */
-
-#define MDL_Command_Req(unit, command, parm) \
- ((*i4b_l2l3_func.MDL_COMMAND_REQ)(unit, command, parm))
-};
-
-#endif /* _I4B_L2L3_H_ */
-
diff --git a/sys/i4b/include/i4b_l3l4.h b/sys/i4b/include/i4b_l3l4.h
deleted file mode 100644
index 642777c04d67b..0000000000000
--- a/sys/i4b/include/i4b_l3l4.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3l4.h - layer 3 / layer 4 interface
- * ------------------------------------------
- *
- * $Id: i4b_l3l4.h,v 1.21 1998/12/05 18:02:59 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:04:58 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L3L4_H_
-#define _I4B_L3L4_H_
-
-#define T303VAL (hz*4) /* 4 seconds timeout */
-#define T305VAL (hz*30) /* 30 seconds timeout */
-#define T308VAL (hz*4) /* 4 seconds timeout */
-#define T309VAL (hz*90) /* 90 seconds timeout */
-#define T310VAL (hz*60) /* 30-120 seconds timeout */
-#define T313VAL (hz*4) /* 4 seconds timeout */
-#define T400DEF (hz*10) /* 10 seconds timeout */
-
-#define N_CALL_DESC (MAX_CONTROLLERS*2) /* no of call descriptors */
-
-extern int nctrl; /* number of controllers detected in system */
-
-typedef struct bchan_statistics {
- int outbytes;
- int inbytes;
-} bchan_statistics_t;
-
-/*---------------------------------------------------------------------------*
- * table of things the driver needs to know about the b channel
- * it is connected to for data transfer
- *---------------------------------------------------------------------------*/
-typedef struct i4l_isdn_bchan_linktab {
- int unit;
- int channel;
- void (*bch_config)(int unit, int channel, int bprot, int updown);
- void (*bch_tx_start)(int unit, int channel);
- void (*bch_stat)(int unit, int channel, bchan_statistics_t *bsp);
- struct ifqueue *tx_queue;
- struct ifqueue *rx_queue; /* data xfer for NON-HDLC traffic */
- struct mbuf **rx_mbuf; /* data xfer for HDLC based traffic */
-} isdn_link_t;
-
-/*---------------------------------------------------------------------------*
- * table of things the b channel handler needs to know about
- * the driver it is connected to for data transfer
- *---------------------------------------------------------------------------*/
-typedef struct i4l_driver_bchan_linktab {
- int unit;
- void (*bch_rx_data_ready)(int unit);
- void (*bch_tx_queue_empty)(int unit);
- void (*bch_activity)(int unit, int rxtx);
-#define ACT_RX 0
-#define ACT_TX 1
- void (*line_connected)(int unit, void *cde);
- void (*line_disconnected)(int unit, void *cde);
- void (*dial_response)(int unit, int stat);
- void (*updown_ind)(int unit, int updown);
-} drvr_link_t;
-
-/* global linktab functions for controller types (aka hardware drivers) */
-struct ctrl_type_desc {
- isdn_link_t* (*get_linktab)(int unit, int channel);
- void (*set_linktab)(int unit, int channel, drvr_link_t *dlt);
-};
-extern struct ctrl_type_desc ctrl_types[];
-
-/* global linktab functions for RBCH userland driver */
-
-drvr_link_t *rbch_ret_linktab(int unit);
-void rbch_set_linktab(int unit, isdn_link_t *ilt);
-
-/* global linktab functions for IPR network driver */
-
-drvr_link_t *ipr_ret_linktab(int unit);
-void ipr_set_linktab(int unit, isdn_link_t *ilt);
-
-/* global linktab functions for TEL userland driver */
-
-drvr_link_t *tel_ret_linktab(int unit);
-void tel_set_linktab(int unit, isdn_link_t *ilt);
-
-/* global linktab functions for ISPPP userland driver */
-
-drvr_link_t *i4bisppp_ret_linktab(int unit);
-void i4bisppp_set_linktab(int unit, isdn_link_t *ilt);
-
-/*---------------------------------------------------------------------------*
- * this structure describes one call/connection on one B-channel
- * and all its parameters
- *---------------------------------------------------------------------------*/
-typedef struct
-{
- u_int cdid; /* call descriptor id */
- int controller; /* isdn controller number */
- int cr; /* call reference value */
-
- int crflag; /* call reference flag */
-#define CRF_ORIG 0 /* originating side */
-#define CRF_DEST 1 /* destinating side */
-
- int channelid; /* channel id value */
- int channelexcl; /* channel exclusive */
-
- int bprot; /* B channel protocol BPROT_XXX */
-
- int driver; /* driver to use for B channel */
- int driver_unit; /* unit for above driver number */
-
- cause_t cause_in; /* cause value from NT */
- cause_t cause_out; /* cause value to NT */
-
- int call_state; /* from incoming SETUP */
-
- u_char dst_telno[TELNO_MAX]; /* destination number */
- u_char src_telno[TELNO_MAX]; /* source number */
- int scr_ind; /* screening ind for incoming call */
-
- int Q931state; /* Q.931 state for call */
- int event; /* event to be processed */
-
- int response; /* setup response type */
-
- int T303; /* SETUP sent response timeout */
- int T303_first_to; /* first timeout flag */
-
- int T305; /* DISC without PROG IND */
-
- int T308; /* RELEASE sent response timeout*/
- int T308_first_to; /* first timeout flag */
-
- int T309; /* data link disconnect timeout */
-
- int T310; /* CALL PROC received */
-
- int T313; /* CONNECT sent timeout */
-
- int T400; /* L4 timeout */
-
- isdn_link_t *ilt; /* isdn B channel linktab */
- drvr_link_t *dlt; /* driver linktab */
-
- int dir; /* outgoing or incoming call */
-#define DIR_OUTGOING 0
-#define DIR_INCOMING 1
-
- int timeout_active; /* idle timeout() active flag */
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || \
- (!defined(__FreeBSD_version) && defined(__FreeBSD__) && __FreeBSD__ >= 3)
- struct callout_handle idle_timeout_handle;
- struct callout_handle T303_callout;
- struct callout_handle T305_callout;
- struct callout_handle T308_callout;
- struct callout_handle T309_callout;
- struct callout_handle T310_callout;
- struct callout_handle T313_callout;
- struct callout_handle T400_callout;
- int callouts_inited; /* must init before use */
-#endif
-
- int idletime_state; /* wait for idle_time begin */
-#define IST_IDLE 0 /* shorthold mode disabled */
-#define IST_NONCHK 1 /* in non-checked window */
-#define IST_CHECK 2 /* in idle check window */
-#define IST_SAFE 3 /* in safety zone */
-
- time_t idletimechk_start; /* check idletime window start */
- time_t connect_time; /* time connect was made */
- time_t last_active_time; /* last time with activity */
-
- /* for incoming connections: */
- time_t max_idle_time; /* max time without activity */
-
- /* for outgoing connections: */
- time_t unitlen_time; /* length of a charging unit */
- time_t idle_time; /* idle time before end of unit */
- time_t earlyhup_time; /* safety time zone at end of unit */
-
- int aocd_flag; /* AOCD used for unitlength calc*/
- time_t last_aocd_time; /* last time AOCD received */
- int units; /* number of AOCD charging units*/
- int units_type; /* units type: AOCD, AOCE */
- int cunits; /* calculated units */
-
- int isdntxdelay; /* isdn tx delay after connect */
-
- u_char display[DISPLAY_MAX]; /* display information element */
- char datetime[DATETIME_MAX]; /* date/time information element*/
-} call_desc_t;
-
-extern call_desc_t call_desc[N_CALL_DESC];
-
-/* forward decl. */
-struct isdn_diagnostic_request;
-struct isdn_dr_prot;
-
-/*---------------------------------------------------------------------------*
- * this structure "describes" one controller
- *---------------------------------------------------------------------------*/
-typedef struct
-{
- int unit; /* unit number of this contr. */
- int ctrl_type; /* controller type (CTRL_XXX) */
- int card_type; /* card manufacturer (CARD_XXX) */
-
- int dl_est; /* layer 2 established */
-#define DL_DOWN 0
-#define DL_UP 1
-
- int bch_state[2]; /* states of the b channels */
-#define BCH_ST_FREE 0 /* free to be used, idle */
-#define BCH_ST_RSVD 1 /* reserved, may become free or used */
-#define BCH_ST_USED 2 /* in use for data transfer */
-
- int tei; /* current tei or -1 if invalid */
-
- /* pointers to functions to be called from L4 */
-
- void (*N_CONNECT_REQUEST) (unsigned int);
- void (*N_CONNECT_RESPONSE) (unsigned int, int, int);
- void (*N_DISCONNECT_REQUEST) (unsigned int, int);
- void (*N_ALERT_REQUEST) (unsigned int);
- void (*N_SET_TRACE) (int unit, int val);
- int (*N_GET_TRACE) (int unit);
- int (*N_DOWNLOAD) (int unit, int numprotos, struct isdn_dr_prot *protocols);
- int (*N_DIAGNOSTICS) (int unit, struct isdn_diagnostic_request*);
- void (*N_MGMT_COMMAND) (int unit, int cmd, int parm);
-} ctrl_desc_t;
-
-extern ctrl_desc_t ctrl_desc[MAX_CONTROLLERS];
-
-#endif /* _I4B_Q931_H_ */
diff --git a/sys/i4b/layer1/i4b_avm_a1.c b/sys/i4b/layer1/i4b_avm_a1.c
deleted file mode 100644
index bb55979e3638b..0000000000000
--- a/sys/i4b/layer1/i4b_avm_a1.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (c) 1996 Andrew Gordon. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_avm_a1.c - AVM A1/Fritz passive card driver for isdn4bsd
- * ------------------------------------------------------------
- *
- * $Id: i4b_avm_a1.c,v 1.20 1998/12/16 13:57:21 hm Exp $
- *
- * last edit-date: [Wed Dec 16 14:59:59 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(AVM_A1)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#ifndef __FreeBSD__
-static u_int8_t avma1_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void avma1_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void avma1_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void avma1_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM A1 and AVM Fritz! Card special registers
- *---------------------------------------------------------------------------*/
-
-#define AVM_CONF_REG 0x1800 /* base offset for config register */
-#define AVM_CONF_IRQ 0x1801 /* base offset for IRQ register */
- /* config register write */
-#define AVM_CONF_WR_RESET 0x01 /* 1 = RESET ISAC and HSCX */
-#define AVM_CONF_WR_CCL 0x02 /* 1 = clear counter low nibble */
-#define AVM_CONF_WR_CCH 0x04 /* 1 = clear counter high nibble */
-#define AVM_CONF_WR_IRQEN 0x08 /* 1 = enable IRQ */
-#define AVM_CONF_WR_TEST 0x10 /* test bit */
- /* config register read */
-#define AVM_CONF_RD_IIRQ 0x01 /* 0 = ISAC IRQ active */
-#define AVM_CONF_RD_HIRQ 0x02 /* 0 = HSCX IRQ active */
-#define AVM_CONF_RD_CIRQ 0x04 /* 0 = counter IRQ active */
-#define AVM_CONF_RD_ZER1 0x08 /* unused, always read 0 */
-#define AVM_CONF_RD_TEST 0x10 /* test bit read back */
-#define AVM_CONF_RD_ZER2 0x20 /* unused, always read 0 */
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base - 0x3e0, (u_char *)buf, (u_int)len);
-}
-#else
-static void
-avma1_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+4].t;
- bus_space_handle_t h = sc->sc_maps[what+4].h;
- bus_space_read_multi_1(t, h, 0, buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base - 0x3e0, (u_char *)buf, (u_int)len);
-}
-#else
-static void
-avma1_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+4].t;
- bus_space_handle_t h = sc->sc_maps[what+4].h;
- bus_space_write_multi_1(t, h, 0, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-#else
-static void
-avma1_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_space_write_1(t, h, offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-avma1_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-#else
-static u_int8_t
-avma1_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- return bus_space_read_1(t, h, offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_avma1 - probe for AVM A1 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_avma1(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char savebyte;
- u_char byte;
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for AVM A1/Fritz!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq)-1)
- {
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for AVM A1/Fritz!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for AVM A1/Fritz!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
-
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x200:
- case 0x240:
- case 0x300:
- case 0x340:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for AVM A1/Fritz!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- sc->clearirq = NULL;
- sc->readreg = avma1_read_reg;
- sc->writereg = avma1_write_reg;
-
- sc->readfifo = avma1_read_fifo;
- sc->writefifo = avma1_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_AVMA1;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t)dev->id_iobase + 0x1400 - 0x20;
-
- HSCX_A_BASE = (caddr_t)dev->id_iobase + 0x400 - 0x20;
- HSCX_B_BASE = (caddr_t)dev->id_iobase + 0xc00 - 0x20;
-
- /*
- * Read HSCX A/B VSTR.
- * Expected value for AVM A1 is 0x04 or 0x05 and for the
- * AVM Fritz!Card is 0x05 in the least significant bits.
- */
-
- if( (((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(0, H_VSTR) & 0xf) != 0x4)) ||
- (((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x4)) )
- {
- printf("isic%d: HSCX VSTR test failed for AVM A1/Fritz\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- /* AVM A1 or Fritz! control register bits: */
- /* read write */
- /* 0x01 hscx irq* RESET */
- /* 0x02 isac irq* clear counter1 */
- /* 0x04 counter irq* clear counter2 */
- /* 0x08 always 0 irq enable */
- /* 0x10 read test bit set test bit */
- /* 0x20 always 0 unused */
-
- /*
- * XXX the following test may be destructive, to prevent the
- * worst case, we save the byte first, and in case the test
- * fails, we write back the saved byte .....
- */
-
- savebyte = inb(dev->id_iobase + AVM_CONF_REG);
-
- /* write low to test bit */
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x00);
-
- /* test bit and next higher and lower bit must be 0 */
-
- if((byte = inb(dev->id_iobase + AVM_CONF_REG) & 0x38) != 0x00)
- {
- printf("isic%d: Error, probe-1 failed, 0x%02x should be 0x00 for AVM A1/Fritz!\n",
- dev->id_unit, byte);
- outb(dev->id_iobase + AVM_CONF_REG, savebyte);
- return (0);
- }
-
- /* write high to test bit */
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x10);
-
- /* test bit must be high, next higher and lower bit must be 0 */
-
- if((byte = inb(dev->id_iobase + AVM_CONF_REG) & 0x38) != 0x10)
- {
- printf("isic%d: Error, probe-2 failed, 0x%02x should be 0x10 for AVM A1/Fritz!\n",
- dev->id_unit, byte);
- outb(dev->id_iobase + AVM_CONF_REG, savebyte);
- return (0);
- }
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_avma1(struct isic_attach_args *ia)
-{
- u_int8_t savebyte, v1, v2;
-
- /*
- * Read HSCX A/B VSTR.
- * Expected value for AVM A1 is 0x04 or 0x05 and for the
- * AVM Fritz!Card is 0x05 in the least significant bits.
- */
-
- v1 = bus_space_read_1(ia->ia_maps[ISIC_WHAT_HSCXA+1].t, ia->ia_maps[ISIC_WHAT_HSCXA+1].h, H_VSTR) & 0x0f;
- v2 = bus_space_read_1(ia->ia_maps[ISIC_WHAT_HSCXB+1].t, ia->ia_maps[ISIC_WHAT_HSCXB+1].h, H_VSTR) & 0x0f;
- if (v1 != v2 || (v1 != 0x05 && v1 != 0x04))
- return 0;
-
- /* AVM A1 or Fritz! control register bits: */
- /* read write */
- /* 0x01 hscx irq* RESET */
- /* 0x02 isac irq* clear counter1 */
- /* 0x04 counter irq* clear counter2 */
- /* 0x08 always 0 irq enable */
- /* 0x10 read test bit set test bit */
- /* 0x20 always 0 unused */
-
- /*
- * XXX the following test may be destructive, to prevent the
- * worst case, we save the byte first, and in case the test
- * fails, we write back the saved byte .....
- */
-
- savebyte = bus_space_read_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0);
-
- /* write low to test bit */
-
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, 0);
-
- /* test bit and next higher and lower bit must be 0 */
-
- if((bus_space_read_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0) & 0x38) != 0x00)
- {
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, savebyte);
- return 0;
- }
-
- /* write high to test bit */
-
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, 0x10);
-
- /* test bit must be high, next higher and lower bit must be 0 */
-
- if((bus_space_read_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0) & 0x38) != 0x10)
- {
- bus_space_write_1(ia->ia_maps[0].t, ia->ia_maps[0].h, 0, savebyte);
- return 0;
- }
-
- return (1);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_avma1 - attach AVM A1 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_avma1(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* reset the HSCX and ISAC chips */
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x00);
- DELAY(SEC_DELAY / 10);
-
- outb(dev->id_iobase + AVM_CONF_REG, AVM_CONF_WR_RESET);
- DELAY(SEC_DELAY / 10);
-
- outb(dev->id_iobase + AVM_CONF_REG, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- outb(dev->id_iobase + AVM_CONF_IRQ, (ffs(sc->sc_irq)) - 1);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- outb(dev->id_iobase + AVM_CONF_REG, AVM_CONF_WR_IRQEN |
- AVM_CONF_WR_CCH | AVM_CONF_WR_CCL);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-
-#else
-
-int
-isic_attach_avma1(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = avma1_read_reg;
- sc->writereg = avma1_write_reg;
-
- sc->readfifo = avma1_read_fifo;
- sc->writefifo = avma1_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_AVMA1;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* reset the HSCX and ISAC chips */
-
- bus_space_write_1(t, h, 0, 0x00);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0, AVM_CONF_WR_RESET);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- bus_space_write_1(t, h, 1, sc->sc_irq);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- bus_space_write_1(t, h, 0, AVM_CONF_WR_IRQEN |
- AVM_CONF_WR_CCH | AVM_CONF_WR_CCL);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-#endif
-
-#endif /* ISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_avm_fritz_pcmcia.c b/sys/i4b/layer1/i4b_avm_fritz_pcmcia.c
deleted file mode 100644
index 483eb660a8286..0000000000000
--- a/sys/i4b/layer1/i4b_avm_fritz_pcmcia.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Copyright (c) 1998 Matthias Apitz. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * Fritz!Card pcmcia specific routines for isic driver
- * ---------------------------------------------------
- *
- * $Id: i4b_avm_fritz_pcmcia.c,v 1.7 1998/12/01 21:25:53 hm Exp $
- *
- * last edit-date: [Tue Dec 1 22:03:51 1998]
- *
- * -ap added support for AVM PCMCIA Fritz!Card
- * -mh split into separate file
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0 && defined(AVM_PCMCIA)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-#ifndef __FreeBSD__
-/* PCMCIA support routines */
-static u_int8_t avma1_pcmcia_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void avma1_pcmcia_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void avma1_pcmcia_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void avma1_pcmcia_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM PCMCIA Fritz!Card special registers
- *---------------------------------------------------------------------------*/
-
-/*
- * register offsets from i/o base 0x140 or 0x300
- */
-#define ADDR_REG_OFFSET 0x02
-#define DATA_REG_OFFSET 0x03
-#define STAT0_OFFSET 0x04
-#define STAT1_OFFSET 0x05
-#define MODREG_OFFSET 0x06
-#define VERREG_OFFSET 0x07
-/*
- * AVM PCMCIA Status Latch 0 read only bits
- */
-#define ASL_IRQ_TIMER 0x10 /* Timer interrupt, active low */
-#define ASL_IRQ_ISAC 0x20 /* ISAC interrupt, active low */
-#define ASL_IRQ_HSCX 0x40 /* HSX interrupt, active low */
-#define ASL_IRQ_BCHAN ASL_IRQ_HSCX
-#define ASL_IRQ_Pending (ASL_IRQ_ISAC | ASL_IRQ_HSCX | ASL_IRQ_TIMER)
-/*
- * AVM Status Latch 0 write only bits
- */
-#define ASL_RESET_ALL 0x01 /* reset siemens IC's, active 1 */
-#define ASL_TIMERDISABLE 0x02 /* active high */
-#define ASL_TIMERRESET 0x04 /* active high */
-#define ASL_ENABLE_INT 0x08 /* active high */
-/*
- * AVM Status Latch 1 write only bits
- */
-#define ASL1_LED0 0x10 /* active high */
-#define ASL1_LED1 0x20 /* active high */
-
-#define ASL1_ENABLE_S0 0xc0 /* enable active S0 I/F */
-
-/*----- EEpromless controller -----*/
-/*
- * AVM Status Latch read/write bit
- */
-
-#define ASL_TESTBIT 0x80
-
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static int PCMCIA_IO_BASE = 0; /* ap: XXX hack */
-static void
-avma1_pcmcia_read_fifo(void *buf, const void *base, size_t len)
-{
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base - 0x20);
- insb(PCMCIA_IO_BASE + DATA_REG_OFFSET, (u_char *)buf, (u_int)len);
-}
-#else
-/* offsets of the different 'what' arguments */
-static u_int8_t what_map[] = {
- 0x20-0x20, /* ISIC_WHAT_ISAC */
- 0xA0-0x20, /* ISIC_WHAT_HSCXA */
- 0xE0-0x20 /* ISIC_WHAT_HSCXB */
-};
-static void
-avma1_pcmcia_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]);
- bus_space_read_multi_1(t, h, DATA_REG_OFFSET, buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_pcmcia_write_fifo(void *base, const void *buf, size_t len)
-{
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base - 0x20);
- outsb(PCMCIA_IO_BASE + DATA_REG_OFFSET, (u_char *)buf, (u_int)len);
-}
-#else
-static void
-avma1_pcmcia_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]);
- bus_space_write_multi_1(t, h, DATA_REG_OFFSET, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-avma1_pcmcia_write_reg(u_char *base, u_int offset, u_int v)
-{
- /* offset includes 0x20 FIFO ! */
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base+offset-0x20);
- outb(PCMCIA_IO_BASE + DATA_REG_OFFSET, (u_char)v);
-}
-#else
-static void
-avma1_pcmcia_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]+offs);
- bus_space_write_1(t, h, DATA_REG_OFFSET, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * AVM read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-avma1_pcmcia_read_reg(u_char *base, u_int offset)
-{
- /* offset includes 0x20 FIFO ! */
- outb(PCMCIA_IO_BASE + ADDR_REG_OFFSET, (int)base+offset-0x20);
- return (inb(PCMCIA_IO_BASE + DATA_REG_OFFSET));
-}
-#else
-static u_int8_t
-avma1_pcmcia_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ADDR_REG_OFFSET, what_map[what]+offs);
- return bus_space_read_1(t, h, DATA_REG_OFFSET);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_avma1_pcmcia - probe for AVM PCMCIA Fritz!Card
- * This is in the bus attachemnt part on NetBSD (pcmcia_isic.c), no
- * card specicfic probe is needed on direct config buses like pcmcia.
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_avma1_pcmcia(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char byte;
- int i;
- u_int cardinfo;
-
- /* check max unit range */
-
- if(dev->id_unit > 1)
- {
- printf("isic%d: Error, unit %d > MAXUNIT for AVM PCMCIA Fritz!Card\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /*
- * we trust the IRQ we got from PCCARD service
- */
- sc->sc_irq = dev->id_irq;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x140:
- case 0x300:
- break;
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for AVM PCMCIA Fritz!Card.\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* ResetController */
-
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 20);
- outb(dev->id_iobase + STAT0_OFFSET, 0x01);
- DELAY(SEC_DELAY / 20);
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
-
- /*
- * CheckController
- * The logic to check for the PCMCIA was adapted as
- * described by AVM.
- */
-
- outb(dev->id_iobase + ADDR_REG_OFFSET, 0x21); /* ISAC STAR */
- if ( (byte=inb(dev->id_iobase + DATA_REG_OFFSET) & 0xfd) != 0x48 )
- {
- printf("isic%d: Error, ISAC STAR for AVM PCMCIA is 0x%0x (should be 0x48)\n",
- dev->id_unit, byte);
- return(0);
- }
-
- outb(dev->id_iobase + ADDR_REG_OFFSET, 0xa1); /* HSCX STAR */
- if ( (byte=inb(dev->id_iobase + DATA_REG_OFFSET) & 0xfd) != 0x48 )
- {
- printf("isic%d: Error, HSCX STAR for AVM PCMCIA is 0x%0x (should be 0x48)\n",
- dev->id_unit, byte);
- return(0);
- }
-
- byte = ASL_TESTBIT;
- for (i=0; i<256; i++) {
- byte = byte ? 0 : ASL_TESTBIT;
- outb(dev->id_iobase + STAT0_OFFSET, byte);
- if ((inb(dev->id_iobase+STAT0_OFFSET)&ASL_TESTBIT)!=byte) {
- printf("isic%d: Error during toggle of AVM PCMCIA Status Latch0\n",
- dev->id_unit);
- return(0);
- }
- }
-
- sc->clearirq = NULL;
- sc->readreg = avma1_pcmcia_read_reg;
- sc->writereg = avma1_pcmcia_write_reg;
-
- sc->readfifo = avma1_pcmcia_read_fifo;
- sc->writefifo = avma1_pcmcia_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_PCFRITZ;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2; /* ap: XXX ??? */
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
- /*
- * NOTE: for PCMCIA these are no real addrs; they are
- * offsets to be written into the base+ADDR_REG_OFFSET register
- * to pick up the values of the bytes fro base+DATA_REG_OFFSET
- *
- * see also the logic in the avma1_pcmcia_* routines;
- * therefore we also must have the base addr in some static
- * space or struct; XXX better solution?
- */
-
- PCMCIA_IO_BASE = dev->id_iobase;
- ISAC_BASE = (caddr_t)0x20;
-
- HSCX_A_BASE = (caddr_t)0xA0;
- HSCX_B_BASE = (caddr_t)0xE0;
-
- /*
- * Read HSCX A/B VSTR.
- * Expected value for AVM A1 is 0x04 or 0x05 and for the
- * AVM Fritz!Card is 0x05 in the least significant bits.
- */
-
- if( (((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(0, H_VSTR) & 0xf) != 0x4)) ||
- (((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x4)) )
- {
- printf("isic%d: HSCX VSTR test failed for AVM PCMCIA Fritz!Card\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: 0x%0x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: 0x%0x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- /*
- * seems we really have an AVM PCMCIA Fritz!Card controller
- */
- cardinfo = inb(dev->id_iobase + VERREG_OFFSET)<<8 | inb(dev->id_iobase + MODREG_OFFSET);
- printf("isic%d: successfully detect AVM PCMCIA cardinfo = 0x%0x\n",
- dev->id_unit, cardinfo);
- dev->id_flags = FLAG_AVM_A1_PCMCIA;
- return (1);
-}
-#endif /* __FreeBSD__ */
-
-
-
-/*---------------------------------------------------------------------------*
- * isic_attach_fritzpcmcia - attach Fritz!Card
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_fritzpcmica(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* ResetController again just to make sure... */
-
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + STAT0_OFFSET, 0x01);
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- outb(dev->id_iobase + STAT0_OFFSET, ASL_TIMERDISABLE |
- ASL_TIMERRESET | ASL_ENABLE_INT);
- /* DELAY(SEC_DELAY / 10); */
-
- return(1);
-}
-
-#else
-
-/*
- * XXX - one time only! Some of this has to go into an enable
- * function, with apropriate counterpart in disable, so a card
- * could be removed an inserted again. But never mind for now,
- * this won't work anyway for several reasons (both in NetBSD
- * and in I4B).
- */
-int
-isic_attach_fritzpcmcia(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
-{
- struct isic_softc *sc = &psc->sc_isic;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- /* Validate config info */
- if (cfe->num_memspace != 0)
- printf(": unexpected number of memory spaces %d should be 0\n",
- cfe->num_memspace);
- if (cfe->num_iospace != 1)
- printf(": unexpected number of memory spaces %d should be 1\n",
- cfe->num_iospace);
-
- /* Allocate pcmcia space - exactly as dictated by the card */
- if (pcmcia_io_alloc(pa->pf, cfe->iospace[0].start, cfe->iospace[0].length,
- 0, &psc->sc_pcioh))
- printf(": can't allocate i/o space\n");
-
- /* map them */
- if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
- PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
- cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
- printf(": can't map i/o space\n");
- return 0;
- }
-
- /* Setup bus space maps */
- sc->sc_num_mappings = 1;
- sc->sc_cardtyp = CARD_TYPEP_PCFRITZ;
- MALLOC_MAPS(sc);
-
- /* Copy our handles/tags to the MI maps */
- sc->sc_maps[0].t = psc->sc_pcioh.iot;
- sc->sc_maps[0].h = psc->sc_pcioh.ioh;
- sc->sc_maps[0].offset = 0;
- sc->sc_maps[0].size = 0; /* not our mapping */
-
- t = sc->sc_maps[0].t;
- h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = avma1_pcmcia_read_reg;
- sc->writereg = avma1_pcmcia_write_reg;
-
- sc->readfifo = avma1_pcmcia_read_fifo;
- sc->writefifo = avma1_pcmcia_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_PCFRITZ;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* Reset controller again just to make sure... */
-
- bus_space_write_1(t, h, STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, STAT0_OFFSET, 0x01);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, STAT0_OFFSET, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* enable IRQ, disable counter IRQ */
-
- bus_space_write_1(t, h, STAT0_OFFSET, ASL_TIMERDISABLE |
- ASL_TIMERRESET | ASL_ENABLE_INT);
-
- return 1;
-}
-#endif
-
-#endif /* NISIC > 0 && defined(AVM_PCMCIA) */
diff --git a/sys/i4b/layer1/i4b_bchan.c b/sys/i4b/layer1/i4b_bchan.c
deleted file mode 100644
index 17ee273647777..0000000000000
--- a/sys/i4b/layer1/i4b_bchan.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_bchan.c - B channel handling L1 procedures
- * ----------------------------------------------
- *
- * $Id: i4b_bchan.c,v 1.28 1998/12/05 18:04:28 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:21:57 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#ifdef __FreeBSD__
-static void isic_bchannel_start(int unit, int h_chan);
-static void isic_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp);
-#else
-static void isic_bchannel_start __P((int unit, int h_chan));
-static void isic_bchannel_stat __P((int unit, int h_chan, bchan_statistics_t *bsp));
-#endif
-
-static void isic_set_linktab(int unit, int channel, drvr_link_t *dlt);
-static isdn_link_t *isic_ret_linktab(int unit, int channel);
-
-/*---------------------------------------------------------------------------*
- * initialize one B channels rx/tx data structures and init/deinit HSCX
- *---------------------------------------------------------------------------*/
-void
-isic_bchannel_setup(int unit, int h_chan, int bprot, int activate)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[h_chan];
-
- int s = SPLI4B();
-
- if(activate == 0)
- {
- /* deactivation */
- isic_hscx_init(sc, h_chan, activate);
- }
-
- DBGL1(L1_BCHAN, "isic_bchannel_setup", ("unit=%d, channel=%d, %s\n",
- sc->sc_unit, h_chan, activate ? "activate" : "deactivate"));
-
- /* general part */
-
- chan->unit = sc->sc_unit; /* unit number */
- chan->channel = h_chan; /* B channel */
- chan->bprot = bprot; /* B channel protocol */
- chan->state = HSCX_IDLE; /* B channel state */
-
- /* receiver part */
-
- i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
-
- chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- chan->rxcount = 0; /* reset rx counter */
-
- i4b_Bfreembuf(chan->in_mbuf); /* clean rx mbuf */
-
- chan->in_mbuf = NULL; /* reset mbuf ptr */
- chan->in_cbptr = NULL; /* reset mbuf curr ptr */
- chan->in_len = 0; /* reset mbuf data len */
-
- /* transmitter part */
-
- i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
-
- chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- chan->txcount = 0; /* reset tx counter */
-
- i4b_Bfreembuf(chan->out_mbuf_head); /* clean tx mbuf */
-
- chan->out_mbuf_head = NULL; /* reset head mbuf ptr */
- chan->out_mbuf_cur = NULL; /* reset current mbuf ptr */
- chan->out_mbuf_cur_ptr = NULL; /* reset current mbuf data ptr */
- chan->out_mbuf_cur_len = 0; /* reset current mbuf data cnt */
-
- if(activate != 0)
- {
- /* activation */
- isic_hscx_init(sc, h_chan, activate);
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * start transmission on a b channel
- *---------------------------------------------------------------------------*/
-static void
-isic_bchannel_start(int unit, int h_chan)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
- register isic_Bchan_t *chan = &sc->sc_chan[h_chan];
- register int next_len;
- register int len;
-
- int s;
- int activity = -1;
- int cmd = 0;
-
- s = SPLI4B(); /* enter critical section */
- if(chan->state & HSCX_TX_ACTIVE) /* already running ? */
- {
- splx(s);
- return; /* yes, leave */
- }
-
- /* get next mbuf from queue */
-
- IF_DEQUEUE(&chan->tx_queue, chan->out_mbuf_head);
-
- if(chan->out_mbuf_head == NULL) /* queue empty ? */
- {
- splx(s); /* leave critical section */
- return; /* yes, exit */
- }
-
- /* init current mbuf values */
-
- chan->out_mbuf_cur = chan->out_mbuf_head;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
-
- /* activity indicator for timeout handling */
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(isic_hscx_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
-
- chan->state |= HSCX_TX_ACTIVE; /* we start transmitting */
-
- if(sc->sc_trace & TRACE_B_TX) /* if trace, send mbuf to trace dev */
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- len = 0; /* # of chars put into HSCX tx fifo this time */
-
- /*
- * fill the HSCX tx fifo with data from the current mbuf. if
- * current mbuf holds less data than HSCX fifo length, try to
- * get the next mbuf from (a possible) mbuf chain. if there is
- * not enough data in a single mbuf or in a chain, then this
- * is the last mbuf and we tell the HSCX that it has to send
- * CRC and closing flag
- */
-
- while((len < sc->sc_bfifolen) && chan->out_mbuf_cur)
- {
- /*
- * put as much data into the HSCX fifo as is
- * available from the current mbuf
- */
-
- if((len + chan->out_mbuf_cur_len) >= sc->sc_bfifolen)
- next_len = sc->sc_bfifolen - len;
- else
- next_len = chan->out_mbuf_cur_len;
-
-#ifdef NOTDEF
- printf("b:mh=%x, mc=%x, mcp=%x, mcl=%d l=%d nl=%d # ",
- chan->out_mbuf_head,
- chan->out_mbuf_cur,
- chan->out_mbuf_cur_ptr,
- chan->out_mbuf_cur_len,
- len,
- next_len);
-#endif
-
- /* wait for tx fifo write enabled */
-
- isic_hscx_waitxfw(sc, h_chan);
-
- /* write what we have from current mbuf to HSCX fifo */
-
- HSCX_WRFIFO(h_chan, chan->out_mbuf_cur_ptr, next_len);
-
- len += next_len; /* update # of bytes written */
- chan->txcount += next_len; /* statistics */
- chan->out_mbuf_cur_ptr += next_len; /* data ptr */
- chan->out_mbuf_cur_len -= next_len; /* data len */
-
- /*
- * in case the current mbuf (of a possible chain) data
- * has been put into the fifo, check if there is a next
- * mbuf in the chain. If there is one, get ptr to it
- * and update the data ptr and the length
- */
-
- if((chan->out_mbuf_cur_len <= 0) &&
- ((chan->out_mbuf_cur = chan->out_mbuf_cur->m_next) != NULL))
- {
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
-
- if(sc->sc_trace & TRACE_B_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
- }
- }
-
- /*
- * if there is either still data in the current mbuf and/or
- * there is a successor on the chain available issue just
- * a XTF (transmit) command to HSCX. if ther is no more
- * data available from the current mbuf (-chain), issue
- * an XTF and an XME (message end) command which will then
- * send the CRC and the closing HDLC flag sequence
- */
-
- if(chan->out_mbuf_cur && (chan->out_mbuf_cur_len > 0))
- {
- /*
- * more data available, send current fifo out.
- * next xfer to HSCX tx fifo is done in the
- * HSCX interrupt routine.
- */
-
- cmd |= HSCX_CMDR_XTF;
- }
- else
- {
- /* end of mbuf chain */
-
- if(chan->bprot == BPROT_NONE)
- cmd |= HSCX_CMDR_XTF;
- else
- cmd |= HSCX_CMDR_XTF | HSCX_CMDR_XME;
-
- i4b_Bfreembuf(chan->out_mbuf_head); /* free mbuf chain */
-
- chan->out_mbuf_head = NULL;
- chan->out_mbuf_cur = NULL;
- chan->out_mbuf_cur_ptr = NULL;
- chan->out_mbuf_cur_len = 0;
- }
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->drvr_linktab->bch_activity)(chan->drvr_linktab->unit, activity);
-
- if(cmd)
- isic_hscx_cmd(sc, h_chan, cmd);
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * fill statistics struct
- *---------------------------------------------------------------------------*/
-static void
-isic_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[h_chan];
- int s;
-
- s = SPLI4B();
-
- bsp->outbytes = chan->txcount;
- bsp->inbytes = chan->rxcount;
-
- chan->txcount = 0;
- chan->rxcount = 0;
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * return the address of isic drivers linktab
- *---------------------------------------------------------------------------*/
-static isdn_link_t *
-isic_ret_linktab(int unit, int channel)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[channel];
-
- return(&chan->isdn_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * set the driver linktab in the b channel softc
- *---------------------------------------------------------------------------*/
-static void
-isic_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- isic_Bchan_t *chan = &sc->sc_chan[channel];
-
- chan->drvr_linktab = dlt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize our local linktab
- *---------------------------------------------------------------------------*/
-void
-isic_init_linktab(struct isic_softc *sc)
-{
- isic_Bchan_t *chan = &sc->sc_chan[HSCX_CH_A];
- isdn_link_t *lt = &chan->isdn_linktab;
-
- /* make sure the hardware driver is known to layer 4 */
- ctrl_types[CTRL_PASSIVE].set_linktab = isic_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = isic_ret_linktab;
-
- /* local setup */
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_A;
- lt->bch_config = isic_bchannel_setup;
- lt->bch_tx_start = isic_bchannel_start;
- lt->bch_stat = isic_bchannel_stat;
- lt->tx_queue = &chan->tx_queue;
-
- /* used by non-HDLC data transfers, i.e. telephony drivers */
- lt->rx_queue = &chan->rx_queue;
-
- /* used by HDLC data transfers, i.e. ipr and isp drivers */
- lt->rx_mbuf = &chan->in_mbuf;
-
- chan = &sc->sc_chan[HSCX_CH_B];
- lt = &chan->isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_B;
- lt->bch_config = isic_bchannel_setup;
- lt->bch_tx_start = isic_bchannel_start;
- lt->bch_stat = isic_bchannel_stat;
- lt->tx_queue = &chan->tx_queue;
-
- /* used by non-HDLC data transfers, i.e. telephony drivers */
- lt->rx_queue = &chan->rx_queue;
-
- /* used by HDLC data transfers, i.e. ipr and isp drivers */
- lt->rx_mbuf = &chan->in_mbuf;
-}
-
-/*---------------------------------------------------------------------------*
- * telephony silence detection
- *---------------------------------------------------------------------------*/
-
-#define TEL_IDLE_MIN (BCH_MAX_DATALEN/2)
-
-int
-isic_hscx_silence(unsigned char *data, int len)
-{
- register int i = 0;
- register int j = 0;
-
- /* count idle bytes */
-
- for(;i < len; i++)
- {
- if((*data >= 0xaa) && (*data <= 0xac))
- j++;
- data++;
- }
-
-#ifdef NOTDEF
- printf("isic_hscx_silence: got %d silence bytes in frame\n", j);
-#endif
-
- if(j < (TEL_IDLE_MIN))
- return(0);
- else
- return(1);
-
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_ctx_s0P.c b/sys/i4b/layer1/i4b_ctx_s0P.c
deleted file mode 100644
index f9e6b7f03eed6..0000000000000
--- a/sys/i4b/layer1/i4b_ctx_s0P.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Creatix PnP cards
- * ============================================================
- *
- * $Id: i4b_ctx_s0P.c,v 1.17 1998/12/16 09:32:50 hm Exp $
- *
- * last edit-date: [Mon Dec 14 17:26:30 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(CRTX_S0_P)
-
-#include <sys/param.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t ctxs0P_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void ctxs0P_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void ctxs0P_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void ctxs0P_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_Cs0P(struct isic_softc *sc);
-#endif
-
-#ifdef __FreeBSD__
-#include <i386/isa/pnp.h>
-extern void isicintr ( int unit );
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-ctxs0P_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-ctxs0P_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_read_multi_1(t, h, o + 0x3e, buf, size);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-ctxs0P_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-ctxs0P_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_multi_1(t, h, o + 0x3e, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-ctxs0P_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-
-#else
-
-static void
-ctxs0P_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_1(t, h, o + offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Creatix ISDN-S0 P&P ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-ctxs0P_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-
-#else
-
-static u_int8_t
-ctxs0P_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- return bus_space_read_1(t, h, o + offs);
-}
-
-#endif
-
-#ifdef __FreeBSD__
-
-/*---------------------------------------------------------------------------*
- * isic_probe_Cs0P - probe for Creatix ISDN-S0 P&P and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_probe_Cs0P(struct isa_device *dev, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 5:
- case 7:
- case 10:
- case 11:
- case 12:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- if(iobase2 == 0)
- {
- printf("isic%d: Error, iobase2 is 0 for Creatix ISDN-S0 P&P!\n",
- dev->id_unit);
- return(0);
- }
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x120:
- case 0x180:
-/*XXX*/ break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Creatix ISDN-S0 P&P!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = ctxs0P_read_reg;
- sc->writereg = ctxs0P_write_reg;
-
- sc->readfifo = ctxs0P_read_fifo;
- sc->writefifo = ctxs0P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_CS0P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t) dev->id_iobase - 0x20;
- HSCX_A_BASE = (caddr_t) iobase2 - 0x20;
- HSCX_B_BASE = (caddr_t) iobase2;
-
- /*
- * Read HSCX A/B VSTR. Expected value for the Creatix PnP card is
- * 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Creatix PnP\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163P - attach Creatix ISDN-S0 P&P
- *---------------------------------------------------------------------------*/
-int
-isic_attach_Cs0P(struct isa_device *dev, unsigned int iobase2)
-{
- outb((dev->id_iobase) + 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase) + 0x1c, 1);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else /* !__FreeBSD__ */
-
-void
-isic_attach_Cs0P(struct isic_softc *sc)
-{
- /* init card */
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 0x1c, 1);
- DELAY(SEC_DELAY / 10);
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = ctxs0P_read_reg;
- sc->writereg = ctxs0P_write_reg;
-
- sc->readfifo = ctxs0P_read_fifo;
- sc->writefifo = ctxs0P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_CS0P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(CRTX_S0_P) */
-
diff --git a/sys/i4b/layer1/i4b_drn_ngo.c b/sys/i4b/layer1/i4b_drn_ngo.c
deleted file mode 100644
index a5f3d69419238..0000000000000
--- a/sys/i4b/layer1/i4b_drn_ngo.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_drn_ngo.c - Dr. Neuhaus Niccy GO@ and SAGEM Cybermod
- * --------------------------------------------------------
- *
- * $Id: i4b_drn_ngo.c,v 1.19 1998/12/16 09:32:50 hm Exp $
- *
- * last edit-date: [Mon Dec 14 17:26:03 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(DRN_NGO)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-/*---------------------------------------------------------------------------*
- * Niccy GO@ definitions
- *
- * the card uses 2 i/o addressranges each using 2 bytes
- *
- * addressrange 0:
- * offset 0 - ISAC dataregister
- * offset 1 - HSCX dataregister
- * addressrange 1:
- * offset 0 - ISAC addressregister
- * offset 1 - HSCX addressregister
- *
- * to access an ISAC/HSCX register, you have to write the register
- * number into the ISAC or HSCX addressregister and then read/write
- * data for the ISAC/HSCX register into/from the corresponding
- * dataregister.
- *
- * Thanks to Klaus Muehle of Dr. Neuhaus Telekommunikation for giving
- * out this information!
- *
- *---------------------------------------------------------------------------*/
-#define NICCY_PORT_MIN 0x200
-#define NICCY_PORT_MAX 0x3e0
-
-#define HSCX_ABIT 0x1000 /* flag, HSCX A is meant */
-#define HSCX_BBIT 0x2000 /* flag, HSCX B is meant */
-
-#define HSCX_BOFF 0x40
-
-#define ADDR_OFF 2 /* address register range offset XXX */
-
-#define ISAC_DATA 0
-#define HSCX_DATA 1
-
-#define ISAC_ADDR 0
-#define HSCX_ADDR 1
-
-#ifdef __FreeBSD__
-
-#if 0
-#define HSCXADEBUG
-#define HSCXBDEBUG
-#define ISACDEBUG
-#else
-#undef HSCXADEBUG
-#undef HSCXBDEBUG
-#undef ISACDEBUG
-#endif
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_read_fifo(void *buf, const void *base, size_t len)
-{
- register int offset;
- register u_int data;
-
- int x = SPLI4B();
-
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = 0;
-#ifdef HSCXADEBUG
-printf("GO/A/frd: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = HSCX_BOFF;
-#ifdef HSCXBDEBUG
-printf("GO/B/frd: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else
- {
- (u_int)data = ((u_int)base + ISAC_DATA);
- (u_int)base += (ADDR_OFF + ISAC_ADDR);
- offset = 0;
-#ifdef ISACDEBUG
-printf("GO/I/frd: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
-
- for(;len > 0; len--, offset++)
- {
- outb((int)base, (u_char)offset);
- *((u_char *)buf + offset) = inb((int)data);
- }
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_write_fifo(void *base, const void *buf, size_t len)
-{
- register int offset;
- register u_int data;
-
- int x = SPLI4B();
-
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = 0;
-#ifdef HSCXADEBUG
-printf("GO/A/fwr: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- (u_int)data = ((u_int)base + HSCX_DATA);
- (u_int)base += (ADDR_OFF + HSCX_ADDR);
- offset = HSCX_BOFF;
-#ifdef HSCXBDEBUG
-printf("GO/B/fwr: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
- else
- {
- (u_int)data = ((u_int)base + ISAC_DATA);
- (u_int)base += (ADDR_OFF + ISAC_ADDR);
- offset = 0;
-#ifdef ISACDEBUG
-printf("GO/I/fwr: base=0x%x, data=0x%x, len=%d\n", base, data, len);
-#endif
- }
-
- for(;len > 0; len--, offset++)
- {
- outb((int)base, (u_char)offset);
- outb((int)data, *((u_char *)buf + offset));
- }
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ write register routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_write_reg(u_char *base, u_int offset, u_int v)
-{
- int x = SPLI4B();
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)offset);
- outb((int)base + HSCX_DATA, (u_char)v);
-#ifdef HSCXADEBUG
-printf("GO/A/rwr: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)offset, (u_char)v);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)(offset + HSCX_BOFF));
- outb((int)base + HSCX_DATA, (u_char)v);
-#ifdef HSCXBDEBUG
-printf("GO/B/rwr: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)(offset + HSCX_BOFF), (u_char)v);
-#endif
- }
- else
- {
- outb((int)base + ADDR_OFF + ISAC_ADDR, (u_char)offset);
- outb((int)base + ISAC_DATA, (u_char)v);
-#ifdef ISACDEBUG
-printf("GO/I/rwr: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + ISAC_ADDR, (int)base + ISAC_DATA,
- (u_char)offset, (u_char)v);
-#endif
- }
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ read register routine
- *---------------------------------------------------------------------------*/
-static u_char
-drnngo_read_reg(u_char *base, u_int offset)
-{
- u_char val;
- int x = SPLI4B();
-
- if((u_int)base & HSCX_ABIT)
- {
- (u_int)base &= ~HSCX_ABIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)offset);
- val = inb((int)base + HSCX_DATA);
-#ifdef HSCXADEBUG
-printf("GO/A/rrd: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)offset, (u_char)val);
-#endif
- }
- else if((u_int)base & HSCX_BBIT)
- {
- (u_int)base &= ~HSCX_BBIT;
- outb((int)base + ADDR_OFF + HSCX_ADDR, (u_char)(offset + HSCX_BOFF));
- val = inb((int)base + HSCX_DATA);
-#ifdef HSCXBDEBUG
-printf("GO/B/rrd: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + HSCX_ADDR, (int)base + HSCX_DATA,
- (u_char)(offset + HSCX_BOFF), (u_char)val);
-#endif
- }
- else
- {
- outb((int)base + ADDR_OFF + ISAC_ADDR, (u_char)offset);
- val = inb((int)base + ISAC_DATA);
-#ifdef ISACDEBUG
-printf("GO/I/rrd: base=0x%x, addr=0x%x, offset=0x%x, val=0x%x\n",
- (int)base + ADDR_OFF + ISAC_ADDR, (int)base + ISAC_DATA,
- (u_char)offset, (u_char)val);
-#endif
- }
- splx(x);
- return(val);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_drnngo - probe for Dr. Neuhaus Niccy GO@
- *---------------------------------------------------------------------------*/
-int
-isic_probe_drnngo(struct isa_device *dev, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq)-1)
- {
- case 3:
- case 4:
- case 5:
- case 9:
- case 10:
- case 11:
- case 12:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- if(dev->id_iobase < NICCY_PORT_MIN || dev->id_iobase > NICCY_PORT_MAX)
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- }
- sc->sc_port = dev->id_iobase;
-
- if(iobase2 == 0)
- {
- printf("isic%d: Error, iobase2 is 0 for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit);
- return(0);
- }
-
- if(iobase2 < NICCY_PORT_MIN || iobase2 > NICCY_PORT_MAX)
- {
- printf("isic%d: Error, invalid port1 0x%x specified for Dr. Neuhaus Niccy GO@!\n",
- dev->id_unit, iobase2);
- return(0);
- }
-
-/*XXX*/ if((dev->id_iobase + 2) != iobase2)
- {
- printf("isic%d: Error, port1 must be (port0+2) for Dr.Neuhaus Niccy GO@!\n",
- dev->id_unit);
- return(0);
- }
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = drnngo_read_reg;
- sc->writereg = drnngo_write_reg;
-
- sc->readfifo = drnngo_read_fifo;
- sc->writefifo = drnngo_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_DRNNGO;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t)dev->id_iobase;
- HSCX_A_BASE = (caddr_t)(((u_int)dev->id_iobase) | HSCX_ABIT);
- HSCX_B_BASE = (caddr_t)(((u_int)dev->id_iobase) | HSCX_BBIT);
-
- /*
- * Read HSCX A/B VSTR. Expected value for Dr. Neuhaus Niccy GO@ based
- * boards is 0x05 in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Dr. Neuhaus Niccy GO@\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_drnngo - attach Dr. Neuhaus Niccy GO@
- *---------------------------------------------------------------------------*/
-int
-isic_attach_drnngo(struct isa_device *dev, unsigned int iobase2)
-{
- return (1);
-}
-
-#else
-
-static u_int8_t drnngo_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void drnngo_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void drnngo_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void drnngo_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_drnngo __P((struct isic_softc *sc));
-
-/*
- * Mapping from "what" parameter to offsets into the io map
- */
-static struct {
- bus_size_t oa, /* address register offset */
- od, /* data register offset */
- or; /* additional chip register offset */
-} offset[] =
-{
- { ISAC_ADDR, ISAC_DATA, 0 }, /* ISAC access */
- { HSCX_ADDR, HSCX_DATA, 0 }, /* HSCX A access */
- { HSCX_ADDR, HSCX_DATA, HSCX_BOFF } /* HSCX B access */
-};
-
-static void
-drnngo_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offset[what].or);
- bus_space_read_multi_1(t, hd, offset[what].od, buf, size);
-}
-
-static void
-drnngo_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offset[what].or);
- bus_space_write_multi_1(t, hd, offset[what].od, (u_int8_t*)buf, size);
-}
-
-static void
-drnngo_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offs+offset[what].or);
- bus_space_write_1(t, hd, offset[what].od, data);
-}
-
-static u_int8_t
-drnngo_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t hd = sc->sc_maps[0].h, ha = sc->sc_maps[1].h;
- bus_space_write_1(t, ha, offset[what].oa, offs+offset[what].or);
- return bus_space_read_1(t, hd, offset[what].od);
-}
-
-void
-isic_attach_drnngo(struct isic_softc *sc)
-{
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = drnngo_read_reg;
- sc->writereg = drnngo_write_reg;
-
- sc->readfifo = drnngo_read_fifo;
- sc->writefifo = drnngo_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_DRNNGO;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(DRN_NGO) */
diff --git a/sys/i4b/layer1/i4b_dynalink.c b/sys/i4b/layer1/i4b_dynalink.c
deleted file mode 100644
index 846e79ae6da15..0000000000000
--- a/sys/i4b/layer1/i4b_dynalink.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Copyright (c) 1998 Martijn Plak. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isdn4bsd layer1 driver for Dynalink IS64PH isdn TA
- * ==================================================
- *
- * $Id: i4b_dynalink.c,v 1.8 1998/12/17 04:55:38 hm Exp $
- *
- * last edit-date: [Thu Dec 17 05:50:39 1998]
- *
- * written by Martijn Plak <tigrfhur@xs4all.nl>
- *
- * -mp 11 jun 1998 first try, code borrowed from Creatix driver
- * -mp 18 jun 1998 cleaned up code
- * -hm FreeBSD PnP
- * -mp 17 dec 1998 made it compile again
- *
- *---------------------------------------------------------------------------*/
-
-/* NOTES:
-
- This driver was written for the Dynalink IS64PH ISDN TA, based on two
- Siemens chips (HSCX 21525 and ISAC 2186). It is sold in the Netherlands.
-
- model numbers found on (my) card:
- IS64PH, TAS100H-N, P/N:89590555, TA200S100045521
-
- chips:
- Siemens PSB 21525N, HSCX TE V2.1
- Siemens PSB 2186N, ISAC-S TE V1.1
- 95MS14, PNP
-
- plug-and-play info:
- device id "ASU1688"
- vendor id 0x88167506
- serial 0x00000044
- i/o port 4 byte alignment, 4 bytes requested,
- 10 bit i/o decoding, 0x100-0x3f8 (?)
- irq 3,4,5,9,10,11,12,15, high true, edge sensitive
-
- At the moment I'm writing this Dynalink is replacing this card with
- one based on a single Siemens chip (IPAC). It will apparently be sold
- under the same model name.
-
- This driver might also work for Asuscom cards.
-*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(DYNALINK)
-
-/* HEADERS
-*/
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#ifdef __FreeBSD__
-static void dynalink_read_fifo(void *buf, const void *base, size_t len);
-static void dynalink_write_fifo(void *base, const void *buf, size_t len);
-static void dynalink_write_reg(u_char *base, u_int offset, u_int v);
-static u_char dynalink_read_reg(u_char *base, u_int offset);
-
-extern struct isa_driver isicdriver;
-
-#else
-static void dynalink_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size);
-static void dynalink_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size);
-static void dynalink_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data);
-static u_int8_t dynalink_read_reg(struct isic_softc *sc, int what, bus_size_t offs);
-void isic_attach_Dyn(struct isic_softc *sc);
-#endif
-
-/* io address mapping */
-#define ISAC 0
-#define HSCX 1
-#define ADDR 2
-
-/* ADDR bits */
-#define ADDRMASK 0x7F
-#define RESET 0x80
-
-/* HSCX register offsets */
-#define HSCXA 0x00
-#define HSCXB 0x40
-
-#ifdef __FreeBSD__
-/* base address juggling */
-#define HSCXB_HACK 0x400
-#define IOBASE(addr) (((int)addr)&0x3FC)
-#define IOADDR(addr) (((int)addr)&0x3FF)
-#define IS_HSCXB_HACK(addr) ((((int)addr)&HSCXB_HACK)?HSCXB:HSCXA)
-
-/* ISIC probe and attach
-*/
-
-int
-isic_probe_Dyn(struct isa_device *dev, unsigned int iobase2)
-{
-
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Dynalink IS64PH.\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 4:
- case 5:
- case 9:
- case 10:
- case 11:
- case 12:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Dynalink IS64PH.\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Dynalink IS64PH.\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return (0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
- if ( (dev->id_iobase < 0x100) ||
- (dev->id_iobase > 0x3f8) ||
- (dev->id_iobase & 3) )
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for Dynalink!\n", dev->id_unit, dev->id_iobase);
- return(0);
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = dynalink_read_reg;
- sc->writereg = dynalink_write_reg;
- sc->readfifo = dynalink_read_fifo;
- sc->writefifo = dynalink_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_DYNALINK;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
- ISAC_BASE = (caddr_t) sc->sc_port;
- HSCX_A_BASE = (caddr_t) sc->sc_port + 1;
- HSCX_B_BASE = (caddr_t) sc->sc_port + 1 + HSCXB_HACK;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Dynalink\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-int
-isic_attach_Dyn(struct isa_device *dev, unsigned int iobase2)
-{
- outb((dev->id_iobase)+ADDR, RESET);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase)+ADDR, 0);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else
-
-void isic_attach_Dyn(struct isic_softc *sc)
-{
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = dynalink_read_reg;
- sc->writereg = dynalink_write_reg;
- sc->readfifo = dynalink_read_fifo;
- sc->writefifo = dynalink_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_DYNALINK;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) || ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("%s: HSCX VSTR test failed for Dynalink PnP\n",
- sc->sc_dev.dv_xname);
- printf("%s: HSC0: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR));
- printf("%s: HSC1: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR));
- return;
- }
-
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ADDR, RESET);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ADDR, 0);
- DELAY(SEC_DELAY / 10);
-}
-
-#endif /* ISIC>0 && NPNP>0 && defined(DYNALINK) */
-
-/* LOW-LEVEL DEVICE ACCESS
-
- NOTE: The isdn4bsd code expects the two HSCX channels at different
- base addresses. I'm faking this, and remap them to the same address
- in the low-level routines. Search for HSCXB_HACK and IS_HSCXB_HACK.
-
- REM: this is only true for the FreeBSD version of I4B!
-*/
-
-#ifdef __FreeBSD__
-static void
-dynalink_read_fifo(void *buf, const void *base, size_t len)
-{
- outb(IOBASE(base)+ADDR, 0+IS_HSCXB_HACK(base));
- insb(IOADDR(base), (u_char *)buf, (u_int)len);
-}
-#else
-static void
-dynalink_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, 0);
- bus_space_read_multi_1(t, h, ISAC, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA);
- bus_space_read_multi_1(t, h, HSCX, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB);
- bus_space_read_multi_1(t, h, HSCX, buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-dynalink_write_fifo(void *base, const void *buf, size_t len)
-{
- outb(IOBASE(base)+ADDR, 0+IS_HSCXB_HACK(base));
- outsb(IOADDR(base), (u_char *)buf, (u_int)len);
-}
-#else
-static void dynalink_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, 0);
- bus_space_write_multi_1(t, h, ISAC, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA);
- bus_space_write_multi_1(t, h, HSCX, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB);
- bus_space_write_multi_1(t, h, HSCX, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-dynalink_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb(IOBASE(base)+ADDR, (offset+IS_HSCXB_HACK(base))&ADDRMASK);
- outb(IOADDR(base), (u_char)v);
-}
-#else
-static void dynalink_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, offs);
- bus_space_write_1(t, h, ISAC, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA+offs);
- bus_space_write_1(t, h, HSCX, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB+offs);
- bus_space_write_1(t, h, HSCX, data);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static u_char
-dynalink_read_reg(u_char *base, u_int offset)
-{
- outb(IOBASE(base)+ADDR, (offset+IS_HSCXB_HACK(base))&ADDRMASK);
- return (inb(IOADDR(base)));
-}
-#else
-static u_int8_t dynalink_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, offs);
- return bus_space_read_1(t, h, ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA+offs);
- return bus_space_read_1(t, h, HSCX);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB+offs);
- return bus_space_read_1(t, h, HSCX);
- }
- return 0;
-}
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(DYNALINK) */
diff --git a/sys/i4b/layer1/i4b_elsa_isdnmc.c b/sys/i4b/layer1/i4b_elsa_isdnmc.c
deleted file mode 100644
index c6987f55adb26..0000000000000
--- a/sys/i4b/layer1/i4b_elsa_isdnmc.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * ELSA MicroLink ISDN/MC card specific routines
- * ---------------------------------------------
- *
- * $Id: i4b_elsa_isdnmc.c,v 1.2 1998/12/05 18:04:33 hm Exp $
- *
- * last edit-date: [Tue Dec 1 07:45:53 1998]
- *
- * -mh added support for elsa ISDN/mc
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0 && defined(ELSA_ISDNMC)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-#ifndef __FreeBSD__
-/* PCMCIA support routines */
-static u_int8_t elsa_isdnmc_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void elsa_isdnmc_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void elsa_isdnmc_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void elsa_isdnmc_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*
- * The ELSA MicroLink ISDN/MC uses one contigous IO region,
- * mapped by the pcmcia code.
- * The chip access is via three ports:
- */
-#define ISAC_DATA 1 /* ISAC dataport at offset 1 */
-#define HSCX_DATA 2 /* HSCX dataport at offset 2 */
-#define ADDR_LATCH 4 /* address latch at offset 4 */
-
-/* This is very similar to the ELSA QuickStep 1000 (ISA) card */
-
-/*---------------------------------------------------------------------------*
- * read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_isdnmc_read_fifo(void *buf, const void *base, size_t len)
-{
-}
-#else
-static void
-elsa_isdnmc_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_read_multi_1(t, h, ISAC_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_read_multi_1(t, h, HSCX_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40);
- bus_space_read_multi_1(t, h, HSCX_DATA, buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_isdnmc_write_fifo(void *base, const void *buf, size_t len)
-{
-}
-#else
-static void
-elsa_isdnmc_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_write_multi_1(t, h, ISAC_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, 0);
- bus_space_write_multi_1(t, h, HSCX_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40);
- bus_space_write_multi_1(t, h, HSCX_DATA, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_isdnmc_write_reg(u_char *base, u_int offset, u_int v)
-{
-}
-#else
-static void
-elsa_isdnmc_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- bus_space_write_1(t, h, ISAC_DATA, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- bus_space_write_1(t, h, HSCX_DATA, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40+offs);
- bus_space_write_1(t, h, HSCX_DATA, data);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-elsa_isdnmc_read_reg(u_char *base, u_int offset)
-{
- return 0;
-}
-#else
-static u_int8_t
-elsa_isdnmc_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- return bus_space_read_1(t, h, ISAC_DATA);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR_LATCH, offs);
- return bus_space_read_1(t, h, HSCX_DATA);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR_LATCH, 0x40+offs);
- return bus_space_read_1(t, h, HSCX_DATA);
- }
- return 0;
-}
-#endif
-
-#ifdef __FreeBSD__
-#else
-
-/*
- * XXX - one time only! Some of this has to go into an enable
- * function, with apropriate counterpart in disable, so a card
- * could be removed an inserted again. But never mind for now,
- * this won't work anyway for several reasons (both in NetBSD
- * and in I4B).
- */
-int
-isic_attach_elsaisdnmc(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
-{
- struct isic_softc *sc = &psc->sc_isic;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- /* Validate config info */
- if (cfe->num_memspace != 0)
- printf(": unexpected number of memory spaces %d should be 0\n",
- cfe->num_memspace);
- if (cfe->num_iospace != 1)
- printf(": unexpected number of memory spaces %d should be 1\n",
- cfe->num_iospace);
-
- /* Allocate pcmcia space */
- if (pcmcia_io_alloc(pa->pf, 0, cfe->iospace[0].length,
- cfe->iospace[0].length, &psc->sc_pcioh))
- printf(": can't allocate i/o space\n");
-
- /* map them */
- if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
- PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
- cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
- printf(": can't map i/o space\n");
- return 0;
- }
-
- /* OK, this will work! */
- sc->sc_cardtyp = CARD_TYPEP_ELSAMLIMC;
-
- /* Setup bus space maps */
- sc->sc_num_mappings = 1;
- MALLOC_MAPS(sc);
-
- /* Copy our handles/tags to the MI maps */
- sc->sc_maps[0].t = psc->sc_pcioh.iot;
- sc->sc_maps[0].h = psc->sc_pcioh.ioh;
- sc->sc_maps[0].offset = 0;
- sc->sc_maps[0].size = 0; /* not our mapping */
-
- t = sc->sc_maps[0].t;
- h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = elsa_isdnmc_read_reg;
- sc->writereg = elsa_isdnmc_write_reg;
-
- sc->readfifo = elsa_isdnmc_read_fifo;
- sc->writefifo = elsa_isdnmc_write_fifo;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- return 1;
-}
-#endif
-
-#endif /* ISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_elsa_mcall.c b/sys/i4b/layer1/i4b_elsa_mcall.c
deleted file mode 100644
index 36882e912809e..0000000000000
--- a/sys/i4b/layer1/i4b_elsa_mcall.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * ELSA MicroLink MC/all card specific routines
- * --------------------------------------------
- *
- * $Id: i4b_elsa_mcall.c,v 1.1 1998/12/02 06:44:27 hm Exp $
- *
- * last edit-date: [Tue Dec 1 07:45:53 1998]
- *
- * -mh started support for ELSA MC/all
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0 && defined(ELSA_MCALL)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/layer1/i4b_ipac.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-#ifndef __FreeBSD__
-/* PCMCIA support routines */
-static u_int8_t elsa_mcall_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void elsa_mcall_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void elsa_mcall_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void elsa_mcall_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * read fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static int PCMCIA_IO_BASE = 0; /* ap: XXX hack */
-static void
-elsa_mcall_read_fifo(void *buf, const void *base, size_t len)
-{
-}
-#else
-static void
-elsa_mcall_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write fifo routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_mcall_write_fifo(void *base, const void *buf, size_t len)
-{
-}
-#else
-static void
-elsa_mcall_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * write register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static void
-elsa_mcall_write_reg(u_char *base, u_int offset, u_int v)
-{
-}
-#else
-static void
-elsa_mcall_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * read register routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-static u_char
-elsa_mcall_read_reg(u_char *base, u_int offset)
-{
- return 0;
-}
-#else
-static u_int8_t
-elsa_mcall_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- /*
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- */
- return 0;
-}
-#endif
-
-#ifdef __FreeBSD__
-#else
-
-/*
- * XXX - one time only! Some of this has to go into an enable
- * function, with apropriate counterpart in disable, so a card
- * could be removed an inserted again. But never mind for now,
- * this won't work anyway for several reasons (both in NetBSD
- * and in I4B).
- */
-int
-isic_attach_elsamcall(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
-{
- struct isic_softc *sc = &psc->sc_isic;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- /* Validate config info */
- if (cfe->num_memspace != 0)
- printf(": unexpected number of memory spaces %d should be 0\n",
- cfe->num_memspace);
- if (cfe->num_iospace != 1)
- printf(": unexpected number of memory spaces %d should be 1\n",
- cfe->num_iospace);
-
- /* Allocate pcmcia space */
- if (pcmcia_io_alloc(pa->pf, 0, cfe->iospace[0].length,
- cfe->iospace[0].length, &psc->sc_pcioh))
- printf(": can't allocate i/o space\n");
-
- /* map them */
- if (pcmcia_io_map(pa->pf, ((cfe->flags & PCMCIA_CFE_IO16) ?
- PCMCIA_WIDTH_IO16 : PCMCIA_WIDTH_IO8), 0,
- cfe->iospace[0].length, &psc->sc_pcioh, &psc->sc_io_window)) {
- printf(": can't map i/o space\n");
- return 0;
- }
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_ELSAMLMCALL;
-
- /* Setup bus space maps */
- sc->sc_num_mappings = 1;
- MALLOC_MAPS(sc);
-
- /* Copy our handles/tags to the MI maps */
- sc->sc_maps[0].t = psc->sc_pcioh.iot;
- sc->sc_maps[0].h = psc->sc_pcioh.ioh;
- sc->sc_maps[0].offset = 0;
- sc->sc_maps[0].size = 0; /* not our mapping */
-
- t = sc->sc_maps[0].t;
- h = sc->sc_maps[0].h;
-
- sc->clearirq = NULL;
- sc->readreg = elsa_mcall_read_reg;
- sc->writereg = elsa_mcall_write_reg;
-
- sc->readfifo = elsa_mcall_read_fifo;
- sc->writefifo = elsa_mcall_write_fifo;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 1;
- sc->sc_bfifolen = IPAC_BFIFO_LEN;
-
- return 1;
-}
-#endif
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_elsa_qs1i.c b/sys/i4b/layer1/i4b_elsa_qs1i.c
deleted file mode 100644
index a6b5181c65d08..0000000000000
--- a/sys/i4b/layer1/i4b_elsa_qs1i.c
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for ELSA Quickstep 1000pro ISA
- * =====================================================================
- *
- * $Id: i4b_elsa_qs1i.c,v 1.1 1998/12/27 21:46:45 phk Exp $
- *
- * last edit-date: [Mon Dec 14 17:27:08 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pnp.h"
-
-#else
-
-#define NISIC 1
-#define NPNP 1
-
-#endif
-
-#if (NISIC > 0) && (NPNP > 0) && defined(ELSA_QS1ISA)
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#ifdef __FreeBSD__
-/* static void i4b_eq1i_clrirq(void* base); */
-#else
-static void i4b_eq1i_clrirq(struct isic_softc *sc);
-void isic_attach_Eqs1pi __P((struct isic_softc *sc));
-#endif
-
-/* masks for register encoded in base addr */
-
-#define ELSA_BASE_MASK 0x0ffff
-#define ELSA_OFF_MASK 0xf0000
-
-/* register id's to be encoded in base addr */
-
-#define ELSA_IDISAC 0x00000
-#define ELSA_IDHSCXA 0x10000
-#define ELSA_IDHSCXB 0x20000
-
-/* offsets from base address */
-
-#define ELSA_OFF_ISAC 0x00
-#define ELSA_OFF_HSCX 0x02
-#define ELSA_OFF_OFF 0x03
-#define ELSA_OFF_CTRL 0x04
-#define ELSA_OFF_CFG 0x05
-#define ELSA_OFF_TIMR 0x06
-#define ELSA_OFF_IRQ 0x07
-
-/* control register (write access) */
-
-#define ELSA_CTRL_LED_YELLOW 0x02
-#define ELSA_CTRL_LED_GREEN 0x08
-#define ELSA_CTRL_RESET 0x20
-#define ELSA_CTRL_TIMEREN 0x80
-#define ELSA_CTRL_SECRET 0x50
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA clear IRQ routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-#ifdef notdef
-static void
-i4b_eq1i_clrirq(void* base)
-{
- outb((u_int)base + ELSA_OFF_IRQ, 0);
-}
-#endif
-#else
-static void
-i4b_eq1i_clrirq(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, ELSA_OFF_IRQ, 0);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pi_read_fifo(void *buf, const void *base, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0x40);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pi_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_read_multi_1(t, h, ELSA_OFF_ISAC, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_read_multi_1(t, h, ELSA_OFF_HSCX, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40);
- bus_space_read_multi_1(t, h, ELSA_OFF_HSCX, buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pi_write_fifo(void *base, const void *buf, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0x40);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, 0);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pi_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_write_multi_1(t, h, ELSA_OFF_ISAC, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0);
- bus_space_write_multi_1(t, h, ELSA_OFF_HSCX, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40);
- bus_space_write_multi_1(t, h, ELSA_OFF_HSCX, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pi_write_reg(u_char *base, u_int offset, u_int v)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)(offset+0x40));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX, (u_char)v);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC, (u_char)v);
- }
-}
-
-#else
-
-static void
-eqs1pi_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- bus_space_write_1(t, h, ELSA_OFF_ISAC, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- bus_space_write_1(t, h, ELSA_OFF_HSCX, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40+offs);
- bus_space_write_1(t, h, ELSA_OFF_HSCX, data);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-eqs1pi_read_reg(u_char *base, u_int offset)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)(offset+0x40));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX));
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_HSCX));
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_OFF, (u_char)offset);
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ISAC));
- }
-}
-
-#else
-
-static u_int8_t
-eqs1pi_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- return bus_space_read_1(t, h, ELSA_OFF_ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_OFF, offs);
- return bus_space_read_1(t, h, ELSA_OFF_HSCX);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_OFF, 0x40+offs);
- return bus_space_read_1(t, h, ELSA_OFF_HSCX);
- }
- return 0;
-}
-
-#endif
-
-#ifdef __FreeBSD__
-
-/*---------------------------------------------------------------------------*
- * isic_probe_Eqs1pi - probe for ELSA QuickStep 1000pro/ISA and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_probe_Eqs1pi(struct isa_device *dev, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 4:
- case 5:
- case 7:
- case 10:
- case 11:
- case 12:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- if(!((dev->id_iobase >= 0x160) && (dev->id_iobase <= 0x360)))
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for ELSA QuickStep 1000pro/ISA!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
-
-/* XXX no "sc_clearirq" in sight... /phk
- sc->sc_clearirq = i4b_eq1i_clrirq;
-*/
- sc->readreg = eqs1pi_read_reg;
- sc->writereg = eqs1pi_write_reg;
-
- sc->readfifo = eqs1pi_read_fifo;
- sc->writefifo = eqs1pi_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1ISA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t) ((u_int)dev->id_iobase | ELSA_IDISAC);
- HSCX_A_BASE = (caddr_t) ((u_int)dev->id_iobase | ELSA_IDHSCXA);
- HSCX_B_BASE = (caddr_t) ((u_int)dev->id_iobase | ELSA_IDHSCXB);
-
- /*
- * Read HSCX A/B VSTR. Expected value for the ELSA QuickStep 1000pro
- * ISA card is 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for ELSA QuickStep 1000pro/ISA\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163P - attach ELSA QuickStep 1000pro/ISA
- *---------------------------------------------------------------------------*/
-int
-isic_attach_Eqs1pi(struct isa_device *dev, unsigned int iobase2)
-{
- u_char byte = ELSA_CTRL_SECRET;
-
- byte &= ~ELSA_CTRL_RESET;
- outb(dev->id_iobase + ELSA_OFF_CTRL, byte);
- DELAY(20);
- byte |= ELSA_CTRL_RESET;
- outb(dev->id_iobase + ELSA_OFF_CTRL, byte);
-
- DELAY(20);
- outb(dev->id_iobase + ELSA_OFF_IRQ, 0xff);
-
- return(1);
-}
-
-#else /* !__FreeBSD__ */
-
-void
-isic_attach_Eqs1pi(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- u_char byte = ELSA_CTRL_SECRET;
-
- byte &= ~ELSA_CTRL_RESET;
- bus_space_write_1(t, h, ELSA_OFF_CTRL, byte);
- DELAY(20);
- byte |= ELSA_CTRL_RESET;
- bus_space_write_1(t, h, ELSA_OFF_CTRL, byte);
-
- DELAY(20);
- bus_space_write_1(t, h, ELSA_OFF_IRQ, 0xff);
-
- /* setup access routines */
-
- sc->clearirq = i4b_eq1i_clrirq;
- sc->readreg = eqs1pi_read_reg;
- sc->writereg = eqs1pi_write_reg;
-
- sc->readfifo = eqs1pi_read_fifo;
- sc->writefifo = eqs1pi_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1ISA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-
-#endif
-
-#endif /* (NISIC > 0) && (NPNP > 0) && defined(ELSA_QS1ISA) */
diff --git a/sys/i4b/layer1/i4b_elsa_qs1p.c b/sys/i4b/layer1/i4b_elsa_qs1p.c
deleted file mode 100644
index b2b35d03fc342..0000000000000
--- a/sys/i4b/layer1/i4b_elsa_qs1p.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for ELSA Quickstep 1000pro PCI
- * =====================================================================
- *
- * $Id: i4b_elsa_qs1p.c,v 1.4 1998/12/05 18:04:36 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:22:41 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#include "pci.h"
-#else
-#define NISIC 1
-#endif
-
-#if (NISIC > 0) && /* (NPCI > 0) && */ defined(ELSA_QS1PCI)
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcidevs.h>
-
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/layer1/i4b_ipac.h>
-
-#ifndef __FreeBSD__
-/* we don't have the function prototypes in the global i4b_l1.h any more */
-void isic_attach_Eqs1pp __P((struct isic_softc *sc, struct pci_attach_args *pa));
-#endif
-
-/* masks for register encoded in base addr */
-
-#define ELSA_BASE_MASK 0x0ffff
-#define ELSA_OFF_MASK 0xf0000
-
-/* register id's to be encoded in base addr */
-
-#define ELSA_IDISAC 0x00000
-#define ELSA_IDHSCXA 0x10000
-#define ELSA_IDHSCXB 0x20000
-#define ELSA_IDIPAC 0x40000
-
-/* offsets from base address */
-
-#define ELSA_OFF_ALE 0x00
-#define ELSA_OFF_RW 0x01
-
-#define ELSA_PORT0_MAPOFF PCI_MAPREG_START+4
-#define ELSA_PORT1_MAPOFF PCI_MAPREG_START+12
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_read_fifo(void *buf, const void *base, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_ISAC_OFF);
- insb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pp_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF);
- bus_space_read_multi_1(t, h, ELSA_OFF_RW, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- bus_space_read_multi_1(t, h, ELSA_OFF_RW, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- bus_space_read_multi_1(t, h, ELSA_OFF_RW, buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_write_fifo(void *base, const void *buf, size_t len)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
- else /* if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC) */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, IPAC_ISAC_OFF);
- outsb((((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW), (u_char *)buf, (u_int)len);
- }
-}
-
-#else
-
-static void
-eqs1pp_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF);
- bus_space_write_multi_1(t, h, ELSA_OFF_RW, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF);
- bus_space_write_multi_1(t, h, ELSA_OFF_RW, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF);
- bus_space_write_multi_1(t, h, ELSA_OFF_RW, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-eqs1pp_write_reg(u_char *base, u_int offset, u_int v)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXB_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXA_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC)
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_ISAC_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
- else /* IPAC */
- {
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_IPAC_OFF));
- outb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW, (u_char)v);
- }
-}
-
-#else
-
-static void
-eqs1pp_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_IPAC_OFF+offs);
- bus_space_write_1(t, h, ELSA_OFF_RW, data);
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/PCI ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-eqs1pp_read_reg(u_char *base, u_int offset)
-{
- if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXB)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXB_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDHSCXA)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_HSCXA_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
- else if(((u_int)base & ELSA_OFF_MASK) == ELSA_IDISAC)
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_ISAC_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
- else /* IPAC */
- {
- outb((u_int)((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_ALE, (u_char)(offset+IPAC_IPAC_OFF));
- return(inb(((u_int)base & ELSA_BASE_MASK) + ELSA_OFF_RW));
- }
-}
-
-#else
-
-static u_int8_t
-eqs1pp_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_ISAC_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXA_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_HSCXB_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- case ISIC_WHAT_IPAC:
- {
- bus_space_write_1(t, h, ELSA_OFF_ALE, IPAC_IPAC_OFF+offs);
- return bus_space_read_1(t, h, ELSA_OFF_RW);
- }
- }
-
- return 0;
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_Eqs1pp - attach for ELSA QuickStep 1000pro/PCI
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_Eqs1pp(int unit, unsigned int iobase1, unsigned int iobase2)
-{
- struct isic_softc *sc = &isic_sc[unit];
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for ELSA QuickStep 1000pro/PCI!\n",
- unit, unit);
- return(0);
- }
- sc->sc_unit = unit;
-
- /* setup iobase */
-
- if((iobase2 <= 0) || (iobase2 > 0xffff))
- {
- printf("isic%d: Error, invalid iobase 0x%x specified for ELSA QuickStep 1000pro/PCI!\n",
- unit, iobase2);
- return(0);
- }
- sc->sc_port = iobase2;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = eqs1pp_read_reg;
- sc->writereg = eqs1pp_write_reg;
-
- sc->readfifo = eqs1pp_read_fifo;
- sc->writefifo = eqs1pp_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1PCI;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* setup chip type = IPAC ! */
-
- sc->sc_ipac = 1;
- sc->sc_bfifolen = IPAC_BFIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDISAC);
- HSCX_A_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDHSCXA);
- HSCX_B_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDHSCXB);
- IPAC_BASE = (caddr_t) ((u_int)iobase2 | ELSA_IDIPAC);
-
- /* enable hscx/isac irq's */
- IPAC_WRITE(IPAC_MASK, (IPAC_MASK_INT1 | IPAC_MASK_INT0));
-
- IPAC_WRITE(IPAC_ACFG, 0); /* outputs are open drain */
- IPAC_WRITE(IPAC_AOE, /* aux 5..2 are inputs, 7, 6 outputs */
- (IPAC_AOE_OE5 | IPAC_AOE_OE4 | IPAC_AOE_OE3 | IPAC_AOE_OE2));
- IPAC_WRITE(IPAC_ATX, 0xff); /* set all output lines high */
-
- outb(iobase1 + 0x4c, 0x41); /* enable card interrupt */
-
- return (1);
-}
-
-#else /* !FreeBSD */
-
-void
-isic_attach_Eqs1pp(sc, pa)
- struct isic_softc *sc;
- struct pci_attach_args *pa;
-{
- /* setup io mappings */
- sc->sc_num_mappings = 2;
- MALLOC_MAPS(sc);
- sc->sc_maps[0].size = 0;
- if (pci_mapreg_map(pa, ELSA_PORT0_MAPOFF, PCI_MAPREG_TYPE_IO, 0,
- &sc->sc_maps[0].t, &sc->sc_maps[0].h, NULL, NULL)) {
- printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
- return;
- }
- sc->sc_maps[1].size = 0;
- if (pci_mapreg_map(pa, ELSA_PORT1_MAPOFF, PCI_MAPREG_TYPE_IO, 0,
- &sc->sc_maps[1].t, &sc->sc_maps[1].h, NULL, NULL)) {
- printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
- return;
- }
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = eqs1pp_read_reg;
- sc->writereg = eqs1pp_write_reg;
-
- sc->readfifo = eqs1pp_read_fifo;
- sc->writefifo = eqs1pp_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1PCI;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* setup chip type = IPAC ! */
-
- sc->sc_ipac = 1;
- sc->sc_bfifolen = IPAC_BFIFO_LEN;
-
- /* enable hscx/isac irq's */
- IPAC_WRITE(IPAC_MASK, (IPAC_MASK_INT1 | IPAC_MASK_INT0));
-
- IPAC_WRITE(IPAC_ACFG, 0); /* outputs are open drain */
- IPAC_WRITE(IPAC_AOE, /* aux 5..2 are inputs, 7, 6 outputs */
- (IPAC_AOE_OE5 | IPAC_AOE_OE4 | IPAC_AOE_OE3 | IPAC_AOE_OE2));
- IPAC_WRITE(IPAC_ATX, 0xff); /* set all output lines high */
-
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, 0x4c, 0x41); /* enable card interrupt */
-}
-
-#endif
-
-#endif /* (NISIC > 0) && defined(ELSA_QS1PCI) */
diff --git a/sys/i4b/layer1/i4b_hscx.c b/sys/i4b/layer1/i4b_hscx.c
deleted file mode 100644
index ed80a51c57317..0000000000000
--- a/sys/i4b/layer1/i4b_hscx.c
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b - Siemens HSCX chip (B-channel) handling
- * --------------------------------------------
- *
- * $Id: i4b_hscx.c,v 1.37 1998/12/05 18:04:38 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:23:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#else
-#define NISIC 1 /* doesn't matter in non-FreeBSD, config(8) d.t.r.t. */
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-/*---------------------------------------------------------------------------*
- * HSCX IRQ Handler
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_irq(register struct isic_softc *sc, u_char ista, int h_chan, u_char ex_irq)
-{
- register isic_Bchan_t *chan = &sc->sc_chan[h_chan];
- u_char exir = 0;
- int activity = -1;
- u_char cmd = 0;
-
- DBGL1(L1_H_IRQ, "isic_hscx_irq", ("%#x\n", ista));
-
- if(ex_irq)
- {
- /* get channel extended irq reg */
-
- exir = HSCX_READ(h_chan, H_EXIR);
-
- if(exir & HSCX_EXIR_RFO)
- {
- chan->stat_RFO++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("ex_irq: receive data overflow\n"));
- }
-
- if((exir & HSCX_EXIR_XDU) && (chan->bprot != BPROT_NONE))/* xmit data underrun */
- {
- chan->stat_XDU++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("ex_irq: xmit data underrun\n"));
- isic_hscx_cmd(sc, h_chan, HSCX_CMDR_XRES);
-
- if (chan->out_mbuf_head != NULL) /* don't continue to transmit this buffer */
- {
- i4b_Bfreembuf(chan->out_mbuf_head);
- chan->out_mbuf_cur = chan->out_mbuf_head = NULL;
- }
- }
-
- }
-
- /* rx message end, end of frame */
-
- if(ista & HSCX_ISTA_RME)
- {
- register int fifo_data_len;
- u_char rsta;
- int error = 0;
-
- rsta = HSCX_READ(h_chan, H_RSTA);
-
- if((rsta & 0xf0) != 0xa0)
- {
- if((rsta & HSCX_RSTA_VFR) == 0)
- {
- chan->stat_VFR++;
- cmd |= (HSCX_CMDR_RHR);
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("received invalid Frame\n"));
- error++;
- }
-
- if(rsta & HSCX_RSTA_RDO)
- {
- chan->stat_RDO++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("receive data overflow\n"));
- error++;
- }
-
- if((rsta & HSCX_RSTA_CRC) == 0)
- {
- chan->stat_CRC++;
- cmd |= (HSCX_CMDR_RHR);
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("CRC check failed\n"));
- error++;
- }
-
- if(rsta & HSCX_RSTA_RAB)
- {
- chan->stat_RAB++;
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("Receive message aborted\n"));
- error++;
- }
- }
-
- fifo_data_len = ((HSCX_READ(h_chan, H_RBCL)) &
- ((sc->sc_bfifolen)-1));
-
- if(fifo_data_len == 0)
- fifo_data_len = sc->sc_bfifolen;
-
- /* all error conditions checked, now decide and take action */
-
- if(error == 0)
- {
- if(chan->in_mbuf == NULL)
- {
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 isic_hscx_irq: RME, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- fifo_data_len -= 1; /* last byte in fifo is RSTA ! */
-
- if((chan->in_len + fifo_data_len) <= BCH_MAX_DATALEN)
- {
- /* read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, chan->in_cbptr, fifo_data_len);
-
- cmd |= (HSCX_CMDR_RMC);
- isic_hscx_cmd(sc, h_chan, cmd);
- cmd = 0;
-
- chan->in_len += fifo_data_len;
- chan->rxcount += fifo_data_len;
-
- /* setup mbuf data length */
-
- chan->in_mbuf->m_len = chan->in_len;
- chan->in_mbuf->m_pkthdr.len = chan->in_len;
-
- if(sc->sc_trace & TRACE_B_RX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- (*chan->drvr_linktab->bch_rx_data_ready)(chan->drvr_linktab->unit);
-
- activity = ACT_RX;
-
- /* mark buffer ptr as unused */
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- {
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("RAWHDLC rx buffer overflow in RME, in_len=%d, fifolen=%d\n", chan->in_len, fifo_data_len));
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- cmd |= (HSCX_CMDR_RHR | HSCX_CMDR_RMC);
- }
- }
- else
- {
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- cmd |= (HSCX_CMDR_RMC);
- }
- }
-
- /* rx fifo full */
-
- if(ista & HSCX_ISTA_RPF)
- {
- if(chan->in_mbuf == NULL)
- {
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 isic_hscx_irq: RPF, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- chan->rxcount += sc->sc_bfifolen;
-
- if((chan->in_len + sc->sc_bfifolen) <= BCH_MAX_DATALEN)
- {
- /* read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, chan->in_cbptr, sc->sc_bfifolen);
-
- chan->in_cbptr += sc->sc_bfifolen;
- chan->in_len += sc->sc_bfifolen;
- }
- else
- {
- if(chan->bprot == BPROT_NONE)
- {
- /* setup mbuf data length */
-
- chan->in_mbuf->m_len = chan->in_len;
- chan->in_mbuf->m_pkthdr.len = chan->in_len;
-
- if(sc->sc_trace & TRACE_B_RX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- /* move rx'd data to rx queue */
-
- IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
-
- (*chan->drvr_linktab->bch_rx_data_ready)(chan->drvr_linktab->unit);
-
- if(!(isic_hscx_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- activity = ACT_RX;
-
- /* alloc new buffer */
-
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 isic_hscx_irq: RPF, cannot allocate new mbuf!\n");
-
- /* setup new data ptr */
-
- chan->in_cbptr = chan->in_mbuf->m_data;
-
- /* read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, chan->in_cbptr, sc->sc_bfifolen);
-
- chan->in_cbptr += sc->sc_bfifolen;
- chan->in_len = sc->sc_bfifolen;
-
- chan->rxcount += sc->sc_bfifolen;
- }
- else
- {
- DBGL1(L1_H_XFRERR, "isic_hscx_irq", ("RAWHDLC rx buffer overflow in RPF, in_len=%d\n", chan->in_len));
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- cmd |= (HSCX_CMDR_RHR);
- }
- }
-
- /* command to release fifo space */
-
- cmd |= HSCX_CMDR_RMC;
- }
-
- /* transmit fifo empty, new data can be written to fifo */
-
- if(ista & HSCX_ISTA_XPR)
- {
- /*
- * for a description what is going on here, please have
- * a look at isic_bchannel_start() in i4b_bchan.c !
- */
-
- int activity = -1;
- int len;
- int nextlen;
-
- DBGL1(L1_H_IRQ, "isic_hscx_irq", ("unit %d, chan %d - XPR, Tx Fifo Empty!\n", sc->sc_unit, h_chan));
-
- if(chan->out_mbuf_cur == NULL) /* last frame is transmitted */
- {
- IF_DEQUEUE(&chan->tx_queue, chan->out_mbuf_head);
-
- if(chan->out_mbuf_head == NULL)
- {
- chan->state &= ~HSCX_TX_ACTIVE;
- (*chan->drvr_linktab->bch_tx_queue_empty)(chan->drvr_linktab->unit);
- }
- else
- {
- chan->state |= HSCX_TX_ACTIVE;
- chan->out_mbuf_cur = chan->out_mbuf_head;
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
-
- if(sc->sc_trace & TRACE_B_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(isic_hscx_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
- }
- }
-
- len = 0;
-
- while(chan->out_mbuf_cur && len != sc->sc_bfifolen)
- {
- nextlen = min(chan->out_mbuf_cur_len, sc->sc_bfifolen - len);
-
-#ifdef NOTDEF
- printf("i:mh=%x, mc=%x, mcp=%x, mcl=%d l=%d nl=%d # ",
- chan->out_mbuf_head,
- chan->out_mbuf_cur,
- chan->out_mbuf_cur_ptr,
- chan->out_mbuf_cur_len,
- len,
- next_len);
-#endif
-
- isic_hscx_waitxfw(sc, h_chan); /* necessary !!! */
-
- HSCX_WRFIFO(h_chan, chan->out_mbuf_cur_ptr, nextlen);
- cmd |= HSCX_CMDR_XTF;
-
- len += nextlen;
- chan->txcount += nextlen;
-
- chan->out_mbuf_cur_ptr += nextlen;
- chan->out_mbuf_cur_len -= nextlen;
-
- if(chan->out_mbuf_cur_len == 0)
- {
- if((chan->out_mbuf_cur = chan->out_mbuf_cur->m_next) != NULL)
- {
- chan->out_mbuf_cur_ptr = chan->out_mbuf_cur->m_data;
- chan->out_mbuf_cur_len = chan->out_mbuf_cur->m_len;
-
- if(sc->sc_trace & TRACE_B_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = (h_chan == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
- }
- else
- {
- if (chan->bprot != BPROT_NONE)
- cmd |= HSCX_CMDR_XME;
- i4b_Bfreembuf(chan->out_mbuf_head);
- chan->out_mbuf_head = NULL;
- }
-
- }
- }
- }
-
- if(cmd) /* is there a command for the HSCX ? */
- {
- isic_hscx_cmd(sc, h_chan, cmd); /* yes, to HSCX */
- }
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->drvr_linktab->bch_activity)(chan->drvr_linktab->unit, activity);
-}
-
-/*---------------------------------------------------------------------------*
- * HSCX initialization
- *
- * for telephony: extended transparent mode 1
- * for raw hdlc: transparent mode 0
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_init(struct isic_softc *sc, int h_chan, int activate)
-{
- isic_Bchan_t *chan = &sc->sc_chan[h_chan];
-
- HSCX_WRITE(h_chan, H_MASK, 0xff); /* mask irq's */
-
- if(sc->sc_ipac)
- {
- /* CCR1: Power Up, Clock Mode 5 */
- HSCX_WRITE(h_chan, H_CCR1, HSCX_CCR1_PU | /* power up */
- HSCX_CCR1_CM1); /* IPAC clock mode 5 */
- }
- else
- {
- /* CCR1: Power Up, Clock Mode 5 */
- HSCX_WRITE(h_chan, H_CCR1, HSCX_CCR1_PU | /* power up */
- HSCX_CCR1_CM2 | /* HSCX clock mode 5 */
- HSCX_CCR1_CM0);
- }
-
- /* XAD1: Transmit Address Byte 1 */
- HSCX_WRITE(h_chan, H_XAD1, 0xff);
-
- /* XAD2: Transmit Address Byte 2 */
- HSCX_WRITE(h_chan, H_XAD2, 0xff);
-
- /* RAH2: Receive Address Byte High Reg. 2 */
- HSCX_WRITE(h_chan, H_RAH2, 0xff);
-
- /* XBCH: reset Transmit Byte Count High */
- HSCX_WRITE(h_chan, H_XBCH, 0x00);
-
- /* RLCR: reset Receive Length Check Register */
- HSCX_WRITE(h_chan, H_RLCR, 0x00);
-
- /* CCR2: set tx/rx clock shift bit 0 */
- /* disable CTS irq, disable RIE irq*/
- HSCX_WRITE(h_chan, H_CCR2, HSCX_CCR2_XCS0|HSCX_CCR2_RCS0);
-
- /* XCCR: tx bit count per time slot */
- HSCX_WRITE(h_chan, H_XCCR, 0x07);
-
- /* RCCR: rx bit count per time slot */
- HSCX_WRITE(h_chan, H_RCCR, 0x07);
-
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- {
- switch(h_chan)
- {
- case HSCX_CH_A: /* Prepare HSCX channel A */
- /* TSAX: tx clock shift bits 1 & 2 */
- /* tx time slot number */
- HSCX_WRITE(h_chan, H_TSAX, 0x2f);
-
- /* TSAR: rx clock shift bits 1 & 2 */
- /* rx time slot number */
- HSCX_WRITE(h_chan, H_TSAR, 0x2f);
- break;
-
- case HSCX_CH_B: /* Prepare HSCX channel B */
- /* TSAX: tx clock shift bits 1 & 2 */
- /* tx time slot number */
- HSCX_WRITE(h_chan, H_TSAX, 0x03);
-
- /* TSAR: rx clock shift bits 1 & 2 */
- /* rx time slot number */
- HSCX_WRITE(h_chan, H_TSAR, 0x03);
- break;
- }
- }
- else /* IOM 1 setup */
- {
- /* TSAX: tx clock shift bits 1 & 2 */
- /* tx time slot number */
- HSCX_WRITE(h_chan, H_TSAX, 0x07);
-
- /* TSAR: rx clock shift bits 1 & 2 */
- /* rx time slot number */
- HSCX_WRITE(h_chan, H_TSAR, 0x07);
- }
-
- if(activate)
- {
- if(chan->bprot == BPROT_RHDLC)
- {
- /* HDLC Frames, transparent mode 0 */
- HSCX_WRITE(h_chan, H_MODE,
- HSCX_MODE_MDS1|HSCX_MODE_RAC|HSCX_MODE_RTS);
- }
- else
- {
- /* Raw Telephony, extended transparent mode 1 */
- HSCX_WRITE(h_chan, H_MODE,
- HSCX_MODE_MDS1|HSCX_MODE_MDS0|HSCX_MODE_ADM|HSCX_MODE_RTS);
- }
-
- isic_hscx_cmd(sc, h_chan, HSCX_CMDR_RHR|HSCX_CMDR_XRES);
- }
- else
- {
- /* TSAX: tx time slot */
- HSCX_WRITE(h_chan, H_TSAX, 0xff);
-
- /* TSAR: rx time slot */
- HSCX_WRITE(h_chan, H_TSAR, 0xff);
-
- /* Raw Telephony, extended transparent mode 1 */
- HSCX_WRITE(h_chan, H_MODE,
- HSCX_MODE_MDS1|HSCX_MODE_MDS0|HSCX_MODE_ADM|HSCX_MODE_RTS);
- }
-
- /* don't touch ICA, EXA and EXB bits, this could be HSCX_CH_B */
- /* always disable RSC and TIN */
-
- chan->hscx_mask |= HSCX_MASK_RSC | HSCX_MASK_TIN;
-
- if(activate)
- {
- /* enable */
- chan->hscx_mask &= ~(HSCX_MASK_RME | HSCX_MASK_RPF | HSCX_MASK_XPR);
- }
- else
- {
- /* disable */
- chan->hscx_mask |= HSCX_MASK_RME | HSCX_MASK_RPF | HSCX_MASK_XPR;
- }
-
- /* handle ICA, EXA, and EXB via interrupt mask of channel b */
-
- if (h_chan == HSCX_CH_A)
- {
- if (activate)
- HSCX_B_IMASK &= ~(HSCX_MASK_EXA | HSCX_MASK_ICA);
- else
- HSCX_B_IMASK |= HSCX_MASK_EXA | HSCX_MASK_ICA;
- HSCX_WRITE(HSCX_CH_A, H_MASK, HSCX_A_IMASK);
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK);
- }
- else
- {
- if (activate)
- HSCX_B_IMASK &= ~HSCX_MASK_EXB;
- else
- HSCX_B_IMASK |= HSCX_MASK_EXB;
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK);
- }
-
- /* clear spurious interrupts left over */
-
- if(h_chan == HSCX_CH_A)
- {
- HSCX_READ(h_chan, H_EXIR);
- HSCX_READ(h_chan, H_ISTA);
- }
- else /* mask ICA, because it must not be cleared by reading ISTA */
- {
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK | HSCX_MASK_ICA);
- HSCX_READ(h_chan, H_EXIR);
- HSCX_READ(h_chan, H_ISTA);
- HSCX_WRITE(HSCX_CH_B, H_MASK, HSCX_B_IMASK);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * write command to HSCX command register
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_cmd(struct isic_softc *sc, int h_chan, unsigned char cmd)
-{
- int timeout = 20;
-
- while(((HSCX_READ(h_chan, H_STAR)) & HSCX_STAR_CEC) && timeout)
- {
- DELAY(10);
- timeout--;
- }
-
- if(timeout == 0)
- {
- DBGL1(L1_H_ERR, "isic_hscx_cmd", ("HSCX wait for CEC timeout!\n"));
- }
-
- HSCX_WRITE(h_chan, H_CMDR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * wait for HSCX transmit FIFO write enable
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_waitxfw(struct isic_softc *sc, int h_chan)
-{
-#define WAITVAL 50
-#define WAITTO 200
-
- int timeout = WAITTO;
-
- while((!(((HSCX_READ(h_chan, H_STAR)) &
- (HSCX_STAR_CEC | HSCX_STAR_XFW)) == HSCX_STAR_XFW)) && timeout)
- {
- DELAY(WAITVAL);
- timeout--;
- }
-
- if(timeout == 0)
- {
- DBGL1(L1_H_ERR, "isic_hscx_waitxfw", ("HSCX wait for XFW timeout!\n"));
- }
- else if (timeout != WAITTO)
- {
- DBGL1(L1_H_XFRERR, "isic_hscx_waitxfw", ("HSCX wait for XFW time: %d uS\n", (WAITTO-timeout)*50));
- }
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_hscx.h b/sys/i4b/layer1/i4b_hscx.h
deleted file mode 100644
index 1b1640de22823..0000000000000
--- a/sys/i4b/layer1/i4b_hscx.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 Gary Jennejohn. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * $Id: i4b_hscx.h,v 1.3 1998/02/13 17:00:31 hm Exp $
- *
- * last edit-date: [Thu Feb 5 13:38:50 1998]
- *
- * -hm added AVM config register defs
- * -hm split up for rewrite of Siemens chipset driver
- *
- *---------------------------------------------------------------------------
- */
-
-#ifndef I4B_HSCX_H_
-#define I4B_HSCX_H_
-
-enum HSCX_VERSIONS {
- HSCX_VA1, /* 82525 A1 */
- HSCX_UNKN1, /* unknown 1 */
- HSCX_VA2, /* 82525 A2 */
- HSCX_UNKN3, /* unknown 3 */
- HSCX_VA3, /* 82525 A3 */
- HSCX_V21, /* 82525 2.1 */
- HSCX_UNKN /* unknown version */
-};
-
-#define HSCX_CH_A 0 /* channel A */
-#define HSCX_CH_B 1 /* channel B */
-
-#define HSCX_FIFO_LEN 32 /* 32 bytes FIFO on chip */
-
-/*
- * definitions of registers and bits for the HSCX ISDN chip.
- */
-
-typedef struct hscx_reg {
-
- /* 32 byte deep FIFO always first */
-
- unsigned char hscx_fifo [HSCX_FIFO_LEN];
-
- /* most registers can be read/written, but have different names */
- /* so define a union with read/write names to make that clear */
-
- union {
- struct {
- unsigned char hscx_ista;
- unsigned char hscx_star;
- unsigned char hscx_mode;
- unsigned char hscx_timr;
- unsigned char hscx_exir;
- unsigned char hscx_rbcl;
- unsigned char dummy_26;
- unsigned char hscx_rsta;
- unsigned char hscx_ral1;
- unsigned char hscx_rhcr;
- unsigned char dummy_2a;
- unsigned char dummy_2b;
- unsigned char hscx_ccr2;
- unsigned char hscx_rbch;
- unsigned char hscx_vstr;
- unsigned char hscx_ccr;
- unsigned char dummy_30;
- unsigned char dummy_31;
- unsigned char dummy_32;
- unsigned char dummy_33;
- } hscx_r;
- struct {
- unsigned char hscx_mask;
- unsigned char hscx_cmdr;
- unsigned char hscx_mode;
- unsigned char hscx_timr;
- unsigned char hscx_xad1;
- unsigned char hscx_xad2;
- unsigned char hscx_rah1;
- unsigned char hscx_rah2;
- unsigned char hscx_ral1;
- unsigned char hscx_ral2;
- unsigned char hscx_xbcl;
- unsigned char hscx_bgr;
- unsigned char hscx_ccr2;
- unsigned char hscx_xbch;
- unsigned char hscx_rlcr;
- unsigned char hscx_ccr1;
- unsigned char hscx_tsax;
- unsigned char hscx_tsar;
- unsigned char hscx_xccr;
- unsigned char hscx_rccr;
- } hscx_w;
- } hscx_rw;
-} hscx_reg_t;
-
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
-
-/* HSCX read registers */
-
-#define h_ista hscx_rw.hscx_r.hscx_ista
-#define H_ISTA REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ista)
-#define h_star hscx_rw.hscx_r.hscx_star
-#define H_STAR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_star)
-#define h_mode hscx_rw.hscx_r.hscx_mode
-#define H_MODE REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_mode)
-#define h_timr hscx_rw.hscx_r.hscx_timr
-#define H_TIMR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_timr)
-#define h_exir hscx_rw.hscx_r.hscx_exir
-#define H_EXIR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_exir)
-#define h_rbcl hscx_rw.hscx_r.hscx_rbcl
-#define H_RBCL REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rbcl)
-#define h_rsta hscx_rw.hscx_r.hscx_rsta
-#define H_RSTA REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rsta)
-#define h_ral1 hscx_rw.hscx_r.hscx_ral1
-#define H_RAL1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ral1)
-#define h_rhcr hscx_rw.hscx_r.hscx_rhcr
-#define H_RHCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rhcr)
-#define h_ccr2 hscx_rw.hscx_r.hscx_ccr2
-#define H_CCR2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ccr2)
-#define h_rbch hscx_rw.hscx_r.hscx_rbch
-#define H_RBCH REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_rbch)
-#define h_vstr hscx_rw.hscx_r.hscx_vstr
-#define H_VSTR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_vstr)
-#define h_ccr hscx_rw.hscx_r.hscx_ccr
-#define H_CCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_r.hscx_ccr)
-
-/* HSCX write registers - for hscx_mode, hscx_timr, hscx_ral1, hscx_ccr2 */
-/* see read registers */
-
-#define h_mask hscx_rw.hscx_w.hscx_mask
-#define H_MASK REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_mask)
-#define h_cmdr hscx_rw.hscx_w.hscx_cmdr
-#define H_CMDR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_cmdr)
-#define h_xad1 hscx_rw.hscx_w.hscx_xad1
-#define H_XAD1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xad1)
-#define h_xad2 hscx_rw.hscx_w.hscx_xad2
-#define H_XAD2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xad2)
-#define h_rah1 hscx_rw.hscx_w.hscx_rah1
-#define H_RAH1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rah1)
-#define h_rah2 hscx_rw.hscx_w.hscx_rah2
-#define H_RAH2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rah2)
-#define h_ral2 hscx_rw.hscx_w.hscx_ral2
-#define H_RAL2 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_ral2)
-#define h_xbcl hscx_rw.hscx_w.hscx_xbcl
-#define H_XBCL REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xbcl)
-#define h_bgr hscx_rw.hscx_w.hscx_bgr
-#define H_BGR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_bgr)
-#define h_xbch hscx_rw.hscx_w.hscx_xbch
-#define H_XBCH REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xbch)
-#define h_rlcr hscx_rw.hscx_w.hscx_rlcr
-#define H_RLCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rlcr)
-#define h_ccr1 hscx_rw.hscx_w.hscx_ccr1
-#define H_CCR1 REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_ccr1)
-#define h_tsax hscx_rw.hscx_w.hscx_tsax
-#define H_TSAX REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_tsax)
-#define h_tsar hscx_rw.hscx_w.hscx_tsar
-#define H_TSAR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_tsar)
-#define h_xccr hscx_rw.hscx_w.hscx_xccr
-#define H_XCCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_xccr)
-#define h_rccr hscx_rw.hscx_w.hscx_rccr
-#define H_RCCR REG_OFFSET(hscx_reg_t, hscx_rw.hscx_w.hscx_rccr)
-
-#define HSCX_ISTA_RME 0x80
-#define HSCX_ISTA_RPF 0x40
-#define HSCX_ISTA_RSC 0x20
-#define HSCX_ISTA_XPR 0x10
-#define HSCX_ISTA_TIN 0x08
-#define HSCX_ISTA_ICA 0x04
-#define HSCX_ISTA_EXA 0x02
-#define HSCX_ISTA_EXB 0x01
-
-#define HSCX_MASK_RME 0x80
-#define HSCX_MASK_RPF 0x40
-#define HSCX_MASK_RSC 0x20
-#define HSCX_MASK_XPR 0x10
-#define HSCX_MASK_TIN 0x08
-#define HSCX_MASK_ICA 0x04
-#define HSCX_MASK_EXA 0x02
-#define HSCX_MASK_EXB 0x01
-
-#define HSCX_EXIR_XMR 0x80
-#define HSCX_EXIR_XDU 0x40
-#define HSCX_EXIR_PCE 0x20
-#define HSCX_EXIR_RFO 0x10
-#define HSCX_EXIR_CSC 0x08
-#define HSCX_EXIR_RFS 0x04
-
-/* the other bits are always 0 */
-
-#define HSCX_STAR_XDOV 0x80
-#define HSCX_STAR_XFW 0x40
-#define HSCX_STAR_XRNR 0x20
-#define HSCX_STAR_RRNR 0x10
-#define HSCX_STAR_RLI 0x08
-#define HSCX_STAR_CEC 0x04
-#define HSCX_STAR_CTS 0x02
-#define HSCX_STAR_WFA 0x01
-
-#define HSCX_CMDR_RMC 0x80
-#define HSCX_CMDR_RHR 0x40
-/* also known as XREP in transparent mode */
-#define HSCX_CMDR_RNR 0x20
-#define HSCX_CMDR_STI 0x10
-#define HSCX_CMDR_XTF 0x08
-#define HSCX_CMDR_XIF 0x04
-#define HSCX_CMDR_XME 0x02
-#define HSCX_CMDR_XRES 0x01
-
-#define HSCX_MODE_MDS1 0x80
-#define HSCX_MODE_MDS0 0x40
-#define HSCX_MODE_ADM 0x20
-#define HSCX_MODE_TMD 0x10
-#define HSCX_MODE_RAC 0x08
-#define HSCX_MODE_RTS 0x04
-#define HSCX_MODE_TRS 0x02
-#define HSCX_MODE_TLP 0x01
-
-#define HSCX_RSTA_VFR 0x80
-#define HSCX_RSTA_RDO 0x40
-#define HSCX_RSTA_CRC 0x20
-#define HSCX_RSTA_RAB 0x10
-#define HSCX_RSTA_HA1 0x08
-#define HSCX_RSTA_HA0 0x04
-#define HSCX_RSTA_CR 0x02
-#define HSCX_RSTA_LA 0x01
-
-#define HSCX_RSTA_MASK 0xf0 /* the interesting ones */
-
-/* only used in DMA mode */
-#define HSCX_XBCH_DMA 0x80
-#define HSCX_XBCH_NRM 0x40
-#define HSCX_XBCH_CAS 0x20
-#define HSCX_XBCH_XC 0x10
-/* the rest are bits 11 thru 8 of the byte count */
-
-#define HSCX_RBCH_DMA 0x80
-#define HSCX_RBCH_NRM 0x40
-#define HSCX_RBCH_CAS 0x20
-#define HSCX_RBCH_OV 0x10
-/* the rest are bits 11 thru 8 of the byte count */
-
-#define HSCX_VSTR_CD 0x80
-/* bits 6 thru 4 are 0 */
-/* bits 3 thru 0 are the version number */
-
-#define HSCX_RLCR_RC 0x80
-/* the rest of the bits are used to set the received length */
-
-#define HSCX_CCR1_PU 0x80
-/* bits 6 and 5 are SC1 SC0 */
-#define HSCX_CCR1_ODS 0x10
-#define HSCX_CCR1_ITF 0x08
-#define HSCX_CCR1_CM2 0x04
-#define HSCX_CCR1_CM1 0x02
-#define HSCX_CCR1_CM0 0x01
-
-/* for clock mode 5 */
-#define HSCX_CCR2_SOC2 0x80
-#define HSCX_CCR2_SOC1 0x40
-#define HSCX_CCR2_XCS0 0x20
-#define HSCX_CCR2_RCS0 0x10
-#define HSCX_CCR2_TIO 0x08
-#define HSCX_CCR2_CIE 0x04
-#define HSCX_CCR2_RIE 0x02
-#define HSCX_CCR2_DIV 0x01
-
-/* bits 7 thru 2 are TSNX */
-#define HSCX_TSAX_XCS2 0x02
-#define HSCX_TSAX_XCS1 0x01
-
-/* bits 7 thru 2 are TSNR */
-#define HSCX_TSAR_RCS2 0x02
-#define HSCX_TSAR_RCS1 0x01
-
-#endif /* I4B_HSCX_H_ */
diff --git a/sys/i4b/layer1/i4b_ipac.h b/sys/i4b/layer1/i4b_ipac.h
deleted file mode 100644
index 79d8bc9656bd3..0000000000000
--- a/sys/i4b/layer1/i4b_ipac.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_ipac.h - definitions for the Siemens IPAC PSB2115 chip
- * ==========================================================
- *
- * $Id: i4b_ipac.h,v 1.4 1998/12/05 18:04:39 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:23:50 1998]
- *
- *---------------------------------------------------------------------------
- */
-
-#ifndef _I4B_IPAC_H_
-#define _I4B_IPAC_H_
-
-#define IPAC_BFIFO_LEN 64 /* 64 bytes B-channel FIFO on chip */
-
-#define IPAC_HSCXA_OFF 0x00
-#define IPAC_HSCXB_OFF 0x40
-#define IPAC_ISAC_OFF 0x80
-#define IPAC_IPAC_OFF 0xc0
-
-/*
- * definitions of registers and bits for the IPAC ISDN chip.
- */
-
-typedef struct ipac_reg {
-
- /* most registers can be read/written, but have different names */
- /* so define a union with read/write names to make that clear */
-
- union {
- struct {
- unsigned char ipac_conf;
- unsigned char ipac_ista;
- unsigned char ipac_id;
- unsigned char ipac_acfg;
- unsigned char ipac_aoe;
- unsigned char ipac_arx;
- unsigned char ipac_pita1;
- unsigned char ipac_pita2;
- unsigned char ipac_pota1;
- unsigned char ipac_pota2;
- unsigned char ipac_pcfg;
- unsigned char ipac_scfg;
- unsigned char ipac_timr2;
- } ipac_r;
- struct {
- unsigned char ipac_conf;
- unsigned char ipac_mask;
- unsigned char ipac_dummy;
- unsigned char ipac_acfg;
- unsigned char ipac_aoe;
- unsigned char ipac_atx;
- unsigned char ipac_pita1;
- unsigned char ipac_pita2;
- unsigned char ipac_pota1;
- unsigned char ipac_pota2;
- unsigned char ipac_pcfg;
- unsigned char ipac_scfg;
- unsigned char ipac_timr2;
- } ipac_w;
- } ipac_rw;
-} ipac_reg_t;
-
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
-
-/* IPAC read registers */
-
-#define IPAC_CONF REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_conf)
-#define IPAC_ISTA REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_ista)
-#define IPAC_ID REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_id)
-#define IPAC_ACFG REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_acfg)
-#define IPAC_AOE REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_aoe)
-#define IPAC_ARX REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_arx)
-#define IPAC_PITA1 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pita1)
-#define IPAC_PITA2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pita2)
-#define IPAC_POTA1 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pota1)
-#define IPAC_POTA2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pota2)
-#define IPAC_PCFG REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pcfg)
-#define IPAC_SCFG REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_scfg)
-#define IPAC_TIMR2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_timr2)
-
-/* IPAC write registers */
-
-#define IPAC_MASK REG_OFFSET(ipac_reg_t, ipac_rw.ipac_w.ipac_mask)
-#define IPAC_ATX REG_OFFSET(ipac_reg_t, ipac_rw.ipac_w.ipac_atx)
-
-/* register bits */
-
-#define IPAC_CONF_AMP 0x80
-#define IPAC_CONF_CFS 0x40
-#define IPAC_CONF_TEM 0x20
-#define IPAC_CONF_PDS 0x10
-#define IPAC_CONF_IDH 0x08
-#define IPAC_CONF_SGO 0x04
-#define IPAC_CONF_ODS 0x02
-#define IPAC_CONF_IOF 0x01
-
-#define IPAC_ISTA_INT1 0x80
-#define IPAC_ISTA_INT0 0x40
-#define IPAC_ISTA_ICD 0x20
-#define IPAC_ISTA_EXD 0x10
-#define IPAC_ISTA_ICA 0x08
-#define IPAC_ISTA_EXA 0x04
-#define IPAC_ISTA_ICB 0x02
-#define IPAC_ISTA_EXB 0x01
-
-#define IPAC_MASK_INT1 0x80
-#define IPAC_MASK_INT0 0x40
-#define IPAC_MASK_ICD 0x20
-#define IPAC_MASK_EXD 0x10
-#define IPAC_MASK_ICA 0x08
-#define IPAC_MASK_EXA 0x04
-#define IPAC_MASK_ICB 0x02
-#define IPAC_MASK_EXB 0x01
-
-#define IPAC_ACFG_OD7 0x80
-#define IPAC_ACFG_OD6 0x40
-#define IPAC_ACFG_OD5 0x20
-#define IPAC_ACFG_OD4 0x10
-#define IPAC_ACFG_OD3 0x08
-#define IPAC_ACFG_OD2 0x04
-#define IPAC_ACFG_EL1 0x02
-#define IPAC_ACFG_EL2 0x01
-
-#define IPAC_AOE_OE7 0x80
-#define IPAC_AOE_OE6 0x40
-#define IPAC_AOE_OE5 0x20
-#define IPAC_AOE_OE4 0x10
-#define IPAC_AOE_OE3 0x08
-#define IPAC_AOE_OE2 0x04
-
-#define IPAC_ARX_AR7 0x80
-#define IPAC_ARX_AR6 0x40
-#define IPAC_ARX_AR5 0x20
-#define IPAC_ARX_AR4 0x10
-#define IPAC_ARX_AR3 0x08
-#define IPAC_ARX_AR2 0x04
-
-#define IPAC_ATX_AT7 0x80
-#define IPAC_ATX_AT6 0x40
-#define IPAC_ATX_AT5 0x20
-#define IPAC_ATX_AT4 0x10
-#define IPAC_ATX_AT3 0x08
-#define IPAC_ATX_AT2 0x04
-
-#define IPAC_PITA1_ENA 0x80
-#define IPAC_PITA1_DUDD 0x40
-
-#define IPAC_PITA2_ENA 0x80
-#define IPAC_PITA2_DUDD 0x40
-
-#define IPAC_POTA1_ENA 0x80
-#define IPAC_POTA1_DUDD 0x40
-
-#define IPAC_POTA2_ENA 0x80
-#define IPAC_POTA2_DUDD 0x40
-
-#define IPAC_PCFG_DPS 0x80
-#define IPAC_PCFG_ACL 0x40
-#define IPAC_PCFG_LED 0x20
-#define IPAC_PCFG_PLD 0x10
-#define IPAC_PCFG_FBS 0x08
-#define IPAC_PCFG_CSL2 0x04
-#define IPAC_PCFG_CSL1 0x02
-#define IPAC_PCFG_CSL0 0x01
-
-#define IPAC_SCFG_PRI 0x80
-#define IPAC_SCFG_TXD 0x40
-#define IPAC_SCFG_TLEN 0x20
-
-#define IPAC_TIMR2_TMD 0x80
-
-#endif /* _I4B_IPAC_H_ */
diff --git a/sys/i4b/layer1/i4b_isac.c b/sys/i4b/layer1/i4b_isac.c
deleted file mode 100644
index 4065c9a575b9a..0000000000000
--- a/sys/i4b/layer1/i4b_isac.c
+++ /dev/null
@@ -1,679 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isac.c - i4b siemens isdn chipset driver ISAC handler
- * ---------------------------------------------------------
- *
- * $Id: i4b_isac.c,v 1.28 1998/12/05 18:04:41 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:23:59 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#else
-#define NISIC 1 /* non-FreeBSD handles this via config(8) */
-#endif
-#if NISIC > 0
-
-#ifdef __FreeBSD__
-#include "opt_i4b.h"
-#endif
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char isic_isac_exir_hdlr(register struct isic_softc *sc, u_char exir);
-static void isic_isac_ind_hdlr(register struct isic_softc *sc, int ind);
-
-/*---------------------------------------------------------------------------*
- * ISAC interrupt service routine
- *---------------------------------------------------------------------------*/
-void
-isic_isac_irq(struct isic_softc *sc, int ista)
-{
- register u_char c = 0;
- DBGL1(L1_F_MSG, "isic_isac_irq", ("unit %d: ista = 0x%02x\n", sc->sc_unit, ista));
-
- if(ista & ISAC_ISTA_EXI) /* extended interrupt */
- {
- c |= isic_isac_exir_hdlr(sc, ISAC_READ(I_EXIR));
- }
-
- if(ista & ISAC_ISTA_RME) /* receive message end */
- {
- register int rest;
- u_char rsta;
-
- /* get rx status register */
-
- rsta = ISAC_READ(I_RSTA);
-
- if((rsta & ISAC_RSTA_MASK) != 0x20)
- {
- int error = 0;
-
- if(!(rsta & ISAC_RSTA_CRC)) /* CRC error */
- {
- error++;
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: CRC error\n", sc->sc_unit));
- }
-
- if(rsta & ISAC_RSTA_RDO) /* ReceiveDataOverflow */
- {
- error++;
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: Data Overrun error\n", sc->sc_unit));
- }
-
- if(rsta & ISAC_RSTA_RAB) /* ReceiveABorted */
- {
- error++;
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: Receive Aborted error\n", sc->sc_unit));
- }
-
- if(error == 0)
- DBGL1(L1_I_ERR, "isic_isac_irq", ("unit %d: RME unknown error, RSTA = 0x%02x!\n", sc->sc_unit, rsta));
-
- i4b_Dfreembuf(sc->sc_ibuf);
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- ISAC_WRITE(I_CMDR, ISAC_CMDR_RMC|ISAC_CMDR_RRES);
- ISACCMDRWRDELAY();
-
- return;
- }
-
- rest = (ISAC_READ(I_RBCL) & (ISAC_FIFO_LEN-1));
-
- if(rest == 0)
- rest = ISAC_FIFO_LEN;
-
- if(sc->sc_ibuf == NULL)
- {
- if((sc->sc_ibuf = i4b_Dgetmbuf(rest)) != NULL)
- sc->sc_ib = sc->sc_ibuf->m_data;
- else
- panic("isic_isac_irq: RME, i4b_Dgetmbuf returns NULL!\n");
- sc->sc_ilen = 0;
- }
-
- if(sc->sc_ilen <= (MAX_DFRAME_LEN - rest))
- {
- ISAC_RDFIFO(sc->sc_ib, rest);
- sc->sc_ilen += rest;
-
- sc->sc_ibuf->m_pkthdr.len =
- sc->sc_ibuf->m_len = sc->sc_ilen;
-
- if(sc->sc_trace & TRACE_D_RX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, sc->sc_ibuf->m_len, sc->sc_ibuf->m_data);
- }
-
- c |= ISAC_CMDR_RMC;
-
- if(sc->sc_enabled)
- PH_Data_Ind(sc->sc_unit, sc->sc_ibuf);
- else
- i4b_Dfreembuf(sc->sc_ibuf);
- }
- else
- {
- DBGL1(L1_I_ERR, "isic_isac_irq", ("RME, input buffer overflow!\n"));
- i4b_Dfreembuf(sc->sc_ibuf);
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
- }
-
- if(ista & ISAC_ISTA_RPF) /* receive fifo full */
- {
- if(sc->sc_ibuf == NULL)
- {
- if((sc->sc_ibuf = i4b_Dgetmbuf(MAX_DFRAME_LEN)) != NULL)
- sc->sc_ib= sc->sc_ibuf->m_data;
- else
- panic("isic_isac_irq: RPF, i4b_Dgetmbuf returns NULL!\n");
- sc->sc_ilen = 0;
- }
-
- if(sc->sc_ilen <= (MAX_DFRAME_LEN - ISAC_FIFO_LEN))
- {
- ISAC_RDFIFO(sc->sc_ib, ISAC_FIFO_LEN);
- sc->sc_ilen += ISAC_FIFO_LEN;
- sc->sc_ib += ISAC_FIFO_LEN;
- c |= ISAC_CMDR_RMC;
- }
- else
- {
- DBGL1(L1_I_ERR, "isic_isac_irq", ("RPF, input buffer overflow!\n"));
- i4b_Dfreembuf(sc->sc_ibuf);
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
- }
-
- if(ista & ISAC_ISTA_XPR) /* transmit fifo empty (XPR bit set) */
- {
- if((sc->sc_obuf2 != NULL) && (sc->sc_obuf == NULL))
- {
- sc->sc_freeflag = sc->sc_freeflag2;
- sc->sc_obuf = sc->sc_obuf2;
- sc->sc_op = sc->sc_obuf->m_data;
- sc->sc_ol = sc->sc_obuf->m_len;
- sc->sc_obuf2 = NULL;
-#ifdef NOTDEF
- printf("ob2=%x, op=%x, ol=%d, f=%d #",
- sc->sc_obuf,
- sc->sc_op,
- sc->sc_ol,
- sc->sc_state);
-#endif
- }
- else
- {
-#ifdef NOTDEF
- printf("ob=%x, op=%x, ol=%d, f=%d #",
- sc->sc_obuf,
- sc->sc_op,
- sc->sc_ol,
- sc->sc_state);
-#endif
- }
-
- if(sc->sc_obuf)
- {
- ISAC_WRFIFO(sc->sc_op, min(sc->sc_ol, ISAC_FIFO_LEN));
-
- if(sc->sc_ol > ISAC_FIFO_LEN) /* length > 32 ? */
- {
- sc->sc_op += ISAC_FIFO_LEN; /* bufferptr+32 */
- sc->sc_ol -= ISAC_FIFO_LEN; /* length - 32 */
- c |= ISAC_CMDR_XTF; /* set XTF bit */
- }
- else
- {
- if(sc->sc_freeflag)
- {
- i4b_Dfreembuf(sc->sc_obuf);
- sc->sc_freeflag = 0;
- }
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
-
- c |= ISAC_CMDR_XTF | ISAC_CMDR_XME;
- }
- }
- else
- {
- sc->sc_state &= ~ISAC_TX_ACTIVE;
- }
- }
-
- if(ista & ISAC_ISTA_CISQ) /* channel status change CISQ */
- {
- register u_char ci;
-
- /* get command/indication rx register*/
-
- ci = ISAC_READ(I_CIRR);
-
- /* if S/Q IRQ, read SQC reg to clr SQC IRQ */
-
- if(ci & ISAC_CIRR_SQC)
- (void) ISAC_READ(I_SQRR);
-
- /* C/I code change IRQ (flag already cleared by CIRR read) */
-
- if(ci & ISAC_CIRR_CIC0)
- isic_isac_ind_hdlr(sc, (ci >> 2) & 0xf);
- }
-
- if(c)
- {
- ISAC_WRITE(I_CMDR, c);
- ISACCMDRWRDELAY();
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Extended IRQ handler
- *---------------------------------------------------------------------------*/
-static u_char
-isic_isac_exir_hdlr(register struct isic_softc *sc, u_char exir)
-{
- u_char c = 0;
-
- if(exir & ISAC_EXIR_XMR)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Tx Message Repeat\n"));
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_XDU)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Tx Data Underrun\n"));
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_PCE)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Protocol Error\n"));
- }
-
- if(exir & ISAC_EXIR_RFO)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Rx Frame Overflow\n"));
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- if(exir & ISAC_EXIR_SOV)
- {
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Sync Xfer Overflow\n"));
- }
-
- if(exir & ISAC_EXIR_MOS)
- {
- DBGL1(L1_I_ERR, "L1 isic_isac_exir_hdlr", ("EXIRQ Monitor Status\n"));
- }
-
- if(exir & ISAC_EXIR_SAW)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Subscriber Awake\n"));
- }
-
- if(exir & ISAC_EXIR_WOV)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- DBGL1(L1_I_ERR, "isic_isac_exir_hdlr", ("EXIRQ Watchdog Timer Overflow\n"));
- }
-
- return(c);
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Indication handler
- *---------------------------------------------------------------------------*/
-static void
-isic_isac_ind_hdlr(register struct isic_softc *sc, int ind)
-{
- register int event;
-
- switch(ind)
- {
- case ISAC_CIRR_IAI8:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx AI8 in state %s\n", isic_printstate(sc)));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- isic_isac_l1_cmd(sc, CMD_AR8);
- event = EV_INFO48;
- MPH_Status_Ind(sc->sc_unit, STI_L1STAT, LAYER_ACTIVE);
- break;
-
- case ISAC_CIRR_IAI10:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx AI10 in state %s\n", isic_printstate(sc)));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- isic_isac_l1_cmd(sc, CMD_AR10);
- event = EV_INFO410;
- MPH_Status_Ind(sc->sc_unit, STI_L1STAT, LAYER_ACTIVE);
- break;
-
- case ISAC_CIRR_IRSY:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx RSY in state %s\n", isic_printstate(sc)));
- event = EV_RSY;
- break;
-
- case ISAC_CIRR_IPU:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx PU in state %s\n", isic_printstate(sc)));
- event = EV_PU;
- break;
-
- case ISAC_CIRR_IDR:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx DR in state %s\n", isic_printstate(sc)));
- isic_isac_l1_cmd(sc, CMD_DIU);
- event = EV_DR;
- break;
-
- case ISAC_CIRR_IDID:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx DID in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- MPH_Status_Ind(sc->sc_unit, STI_L1STAT, LAYER_IDLE);
- break;
-
- case ISAC_CIRR_IDIS:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx DIS in state %s\n", isic_printstate(sc)));
- event = EV_DIS;
- break;
-
- case ISAC_CIRR_IEI:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx EI in state %s\n", isic_printstate(sc)));
- isic_isac_l1_cmd(sc, CMD_DIU);
- event = EV_EI;
- break;
-
- case ISAC_CIRR_IARD:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx ARD in state %s\n", isic_printstate(sc)));
- event = EV_INFO2;
- break;
-
- case ISAC_CIRR_ITI:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx TI in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_IATI:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx ATI in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_ISD:
- DBGL1(L1_I_CICO, "isic_isac_ind_hdlr", ("rx SD in state %s\n", isic_printstate(sc)));
- event = EV_INFO0;
- break;
-
- default:
- DBGL1(L1_I_ERR, "isic_isac_ind_hdlr", ("UNKNOWN Indication 0x%x in state %s\n", ind, isic_printstate(sc)));
- event = EV_INFO0;
- break;
- }
- isic_next_state(sc, event);
-}
-
-/*---------------------------------------------------------------------------*
- * execute a layer 1 command
- *---------------------------------------------------------------------------*/
-void
-isic_isac_l1_cmd(struct isic_softc *sc, int command)
-{
- u_char cmd;
-
-#ifdef I4B_SMP_WORKAROUND
-
- /* XXXXXXXXXXXXXXXXXXX */
-
- /*
- * patch from Wolfgang Helbig:
- *
- * Here is a patch that makes i4b work on an SMP:
- * The card (TELES 16.3) didn't interrupt on an SMP machine.
- * This is a gross workaround, but anyway it works *and* provides
- * some information as how to finally fix this problem.
- */
-
- HSCX_WRITE(0, H_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- /* XXXXXXXXXXXXXXXXXXX */
-
-#endif /* I4B_SMP_WORKAROUND */
-
- if(command < 0 || command > CMD_ILL)
- {
- DBGL1(L1_I_ERR, "isic_isac_l1_cmd", ("illegal cmd 0x%x in state %s\n", command, isic_printstate(sc)));
- return;
- }
-
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- cmd = ISAC_CIX0_LOW;
- else
- cmd = 0;
-
- switch(command)
- {
- case CMD_TIM:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx TIM in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CTIM << 2);
- break;
-
- case CMD_RS:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx RS in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CRS << 2);
- break;
-
- case CMD_AR8:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx AR8 in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CAR8 << 2);
- break;
-
- case CMD_AR10:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx AR10 in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CAR10 << 2);
- break;
-
- case CMD_DIU:
- DBGL1(L1_I_CICO, "isic_isac_l1_cmd", ("tx DIU in state %s\n", isic_printstate(sc)));
- cmd |= (ISAC_CIXR_CDIU << 2);
- break;
- }
- ISAC_WRITE(I_CIXR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * L1 ISAC initialization
- *---------------------------------------------------------------------------*/
-int
-isic_isac_init(struct isic_softc *sc)
-{
- ISAC_IMASK = 0xff; /* disable all irqs */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- if(sc->sc_bustyp != BUS_TYPE_IOM2)
- {
- DBGL1(L1_I_SETUP, "isic_isac_setup", ("configuring for IOM-1 mode\n"));
-
- /* ADF2: Select mode IOM-1 */
- ISAC_WRITE(I_ADF2, 0x00);
-
- /* SPCR: serial port control register:
- * SPU - software power up = 0
- * SAC - SIP port high Z
- * SPM - timing mode 0
- * TLP - test loop = 0
- * C1C, C2C - B1 and B2 switched to/from SPa
- */
- ISAC_WRITE(I_SPCR, ISAC_SPCR_C1C1|ISAC_SPCR_C2C1);
-
- /* SQXR: S/Q channel xmit register:
- * SQIE - S/Q IRQ enable = 0
- * SQX1-4 - Fa bits = 1
- */
- ISAC_WRITE(I_SQXR, ISAC_SQXR_SQX1|ISAC_SQXR_SQX2|ISAC_SQXR_SQX3|ISAC_SQXR_SQX4);
-
- /* ADF1: additional feature reg 1:
- * WTC - watchdog = 0
- * TEM - test mode = 0
- * PFS - pre-filter = 0
- * CFS - IOM clock/frame always active
- * FSC1/2 - polarity of 8kHz strobe
- * ITF - interframe fill = idle
- */
- ISAC_WRITE(I_ADF1, ISAC_ADF1_FC2); /* ADF1 */
-
- /* STCR: sync transfer control reg:
- * TSF - terminal secific functions = 0
- * TBA - TIC bus address = 7
- * STx/SCx = 0
- */
- ISAC_WRITE(I_STCR, ISAC_STCR_TBA2|ISAC_STCR_TBA1|ISAC_STCR_TBA0);
-
- /* MODE: Mode Register:
- * MDSx - transparent mode 2
- * TMD - timer mode = external
- * RAC - Receiver enabled
- * DIMx - digital i/f mode
- */
- ISAC_WRITE(I_MODE, ISAC_MODE_MDS2|ISAC_MODE_MDS1|ISAC_MODE_RAC|ISAC_MODE_DIM0);
- }
- else
- {
- DBGL1(L1_I_SETUP, "isic_isac_setup", ("configuring for IOM-2 mode\n"));
-
- /* ADF2: Select mode IOM-2 */
- ISAC_WRITE(I_ADF2, ISAC_ADF2_IMS);
-
- /* SPCR: serial port control register:
- * SPU - software power up = 0
- * SPM - timing mode 0
- * TLP - test loop = 0
- * C1C, C2C - B1 + C1 and B2 + IC2 monitoring
- */
- ISAC_WRITE(I_SPCR, 0x00);
-
- /* SQXR: S/Q channel xmit register:
- * IDC - IOM direction = 0 (master)
- * CFS - Config Select = 0 (clock always active)
- * CI1E - C/I channel 1 IRQ enable = 0
- * SQIE - S/Q IRQ enable = 0
- * SQX1-4 - Fa bits = 1
- */
- ISAC_WRITE(I_SQXR, ISAC_SQXR_SQX1|ISAC_SQXR_SQX2|ISAC_SQXR_SQX3|ISAC_SQXR_SQX4);
-
- /* ADF1: additional feature reg 1:
- * WTC - watchdog = 0
- * TEM - test mode = 0
- * PFS - pre-filter = 0
- * IOF - IOM i/f off = 0
- * ITF - interframe fill = idle
- */
- ISAC_WRITE(I_ADF1, 0x00);
-
- /* STCR: sync transfer control reg:
- * TSF - terminal secific functions = 0
- * TBA - TIC bus address = 7
- * STx/SCx = 0
- */
- ISAC_WRITE(I_STCR, ISAC_STCR_TBA2|ISAC_STCR_TBA1|ISAC_STCR_TBA0);
-
- /* MODE: Mode Register:
- * MDSx - transparent mode 2
- * TMD - timer mode = external
- * RAC - Receiver enabled
- * DIMx - digital i/f mode
- */
- ISAC_WRITE(I_MODE, ISAC_MODE_MDS2|ISAC_MODE_MDS1|ISAC_MODE_RAC|ISAC_MODE_DIM0);
- }
-
-#ifdef NOTDEF
- /*
- * XXX a transmitter reset causes an ISAC tx IRQ which will not
- * be serviced at attach time under some circumstances leaving
- * the associated IRQ line on the ISA bus active. This prevents
- * any further interrupts to be serviced because no low -> high
- * transition can take place anymore. (-hm)
- */
-
- /* command register:
- * RRES - HDLC receiver reset
- * XRES - transmitter reset
- */
- ISAC_WRITE(I_CMDR, ISAC_CMDR_RRES|ISAC_CMDR_XRES);
- ISACCMDRWRDELAY();
-#endif
-
- /* enabled interrupts:
- * ===================
- * RME - receive message end
- * RPF - receive pool full
- * XPR - transmit pool ready
- * CISQ - CI or S/Q channel change
- * EXI - extended interrupt
- */
-
- ISAC_IMASK = ISAC_MASK_RSC | /* auto mode only */
- ISAC_MASK_TIN | /* timer irq */
- ISAC_MASK_SIN; /* sync xfer irq */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- return(0);
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_isac.h b/sys/i4b/layer1/i4b_isac.h
deleted file mode 100644
index 56a4241564fec..0000000000000
--- a/sys/i4b/layer1/i4b_isac.h
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 Gary Jennejohn. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * $Id: i4b_isac.h,v 1.5 1998/03/28 15:11:03 hm Exp $
- *
- * last edit-date: [Fri Mar 27 15:52:40 1998]
- *
- * -hm split up for rewrite of Siemens chipset driver
- *
- *---------------------------------------------------------------------------
- */
-
-#ifndef I4B_ISAC_H_
-#define I4B_ISAC_H_
-
-/*
- * The ISAC databook specifies a delay of 2.5 DCL clock cycles between
- * writes to the ISAC command register CMDR. This is the delay used to
- * satisfy this requirement.
- */
-
-#define I4B_ISAC_CMDRWRDELAY 30
-
-#if (I4B_ISAC_CMDRWRDELAY > 0)
-#define ISACCMDRWRDELAY() DELAY(I4B_ISAC_CMDRWRDELAY)
-#else
-#warning "I4B_ISAC_CMDRWRDELAY set to 0!"
-#define ISACCMDRWRDELAY()
-#endif
-
-enum ISAC_VERSIONS {
- ISAC_VA, /* 2085 A1 or A2, 2086/2186 V1.1 */
- ISAC_VB1, /* 2085 B1 */
- ISAC_VB2, /* 2085 B2 */
- ISAC_VB3, /* 2085 B3/V2.3 */
- ISAC_UNKN /* unknown version */
-};
-
-#define ISAC_FIFO_LEN 32 /* 32 bytes FIFO on chip */
-
-/*
- * definitions of registers and bits for the ISAC ISDN chip.
- */
-
-typedef struct isac_reg {
-
- /* 32 byte deep FIFO always first */
-
- unsigned char isac_fifo [ISAC_FIFO_LEN];
-
- /* most registers can be read/written, but have different names */
- /* so define a union with read/write names to make that clear */
-
- union {
- struct {
- unsigned char isac_ista;
- unsigned char isac_star;
- unsigned char isac_mode;
- unsigned char isac_timr;
- unsigned char isac_exir;
- unsigned char isac_rbcl;
- unsigned char isac_sapr;
- unsigned char isac_rsta;
- unsigned char dummy_28;
- unsigned char isac_rhcr;
- unsigned char isac_rbch;
- unsigned char isac_star2;
- unsigned char dummy_2c;
- unsigned char dummy_2d;
- unsigned char dummy_2e;
- unsigned char dummt_2f;
- unsigned char isac_spcr;
- unsigned char isac_cirr;
- unsigned char isac_mor;
- unsigned char isac_sscr;
- unsigned char isac_sfcr;
- unsigned char isac_c1r;
- unsigned char isac_c2r;
- unsigned char isac_b1cr;
- unsigned char isac_b2cr;
- unsigned char isac_adf2;
- unsigned char isac_mosr;
- unsigned char isac_sqrr;
- } isac_r;
- struct {
- unsigned char isac_mask;
- unsigned char isac_cmdr;
- unsigned char isac_mode;
- unsigned char isac_timr;
- unsigned char isac_xad1;
- unsigned char isac_xad2;
- unsigned char isac_sap1;
- unsigned char isac_sap2;
- unsigned char isac_tei1;
- unsigned char isac_tei2;
- unsigned char dummy_2a;
- unsigned char isac_star2;
- unsigned char dummy_2c;
- unsigned char dummy_2d;
- unsigned char dummy_2e;
- unsigned char dummt_2f;
- unsigned char isac_spcr;
- unsigned char isac_cixr;
- unsigned char isac_mox;
- unsigned char isac_sscx;
- unsigned char isac_sfcw;
- unsigned char isac_c1r;
- unsigned char isac_c2r;
- unsigned char isac_stcr;
- unsigned char isac_adf1;
- unsigned char isac_adf2;
- unsigned char isac_mocr;
- unsigned char isac_sqxr;
- } isac_w;
- } isac_rw;
-} isac_reg_t;
-
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
-
-/* ISAC read registers */
-
-#define i_ista isac_rw.isac_r.isac_ista
-#define I_ISTA REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_ista)
-#define i_star isac_rw.isac_r.isac_star
-#define I_STAR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_star)
-#define i_mode isac_rw.isac_r.isac_mode
-#define I_MODE REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_mode)
-#define i_timr isac_rw.isac_r.isac_timr
-#define I_TIMR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_timr)
-#define i_exir isac_rw.isac_r.isac_exir
-#define I_EXIR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_exir)
-#define i_rbcl isac_rw.isac_r.isac_rbcl
-#define I_RBCL REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rbcl)
-#define i_sapr isac_rw.isac_r.isac_sapr
-#define I_SAPR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sapr)
-#define i_rsta isac_rw.isac_r.isac_rsta
-#define I_RSTA REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rsta)
-#define i_rhcr isac_rw.isac_r.isac_rhcr
-#define I_RHCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rhcr)
-#define i_rbch isac_rw.isac_r.isac_rbch
-#define I_RBCH REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_rbch)
-#define i_star2 isac_rw.isac_r.isac_star2
-#define I_STAR2 REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_star2)
-#define i_spcr isac_rw.isac_r.isac_spcr
-#define I_SPCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_spcr)
-#define i_cirr isac_rw.isac_r.isac_cirr
-#define I_CIRR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_cirr)
-#define i_mor isac_rw.isac_r.isac_mor
-#define I_MOR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_mor)
-#define i_sscr isac_rw.isac_r.isac_sscr
-#define I_SSCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sscr)
-#define i_sfcr isac_rw.isac_r.isac_sfcr
-#define I_SFCR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sfcr)
-#define i_c1r isac_rw.isac_r.isac_c1r
-#define I_C1R REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_c1r)
-#define i_c2r isac_rw.isac_r.isac_c2r
-#define I_C2R REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_c2r)
-#define i_b1cr isac_rw.isac_r.isac_b1cr
-#define I_B1CR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_b1cr)
-#define i_b2cr isac_rw.isac_r.isac_b2cr
-#define I_B2CR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_b2cr)
-#define i_adf2 isac_rw.isac_r.isac_adf2
-#define I_ADF2 REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_adf2)
-#define i_mosr isac_rw.isac_r.isac_mosr
-#define I_MOSR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_mosr)
-#define i_sqrr isac_rw.isac_r.isac_sqrr
-#define I_SQRR REG_OFFSET(isac_reg_t, isac_rw.isac_r.isac_sqrr)
-
-/* ISAC write registers - isac_mode, isac_timr, isac_star2, isac_spcr, */
-/* isac_c1r, isac_c2r, isac_adf2 see read registers */
-
-#define i_mask isac_rw.isac_w.isac_mask
-#define I_MASK REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_mask)
-#define i_cmdr isac_rw.isac_w.isac_cmdr
-#define I_CMDR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_cmdr)
-#define i_xad1 isac_rw.isac_w.isac_xad1
-#define I_XAD1 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_xad1)
-#define i_xad2 isac_rw.isac_w.isac_xad2
-#define I_XAD2 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_xad2)
-#define i_sap1 isac_rw.isac_w.isac_sap1
-#define I_SAP1 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sap1)
-#define i_sap2 isac_rw.isac_w.isac_sap2
-#define I_SAP2 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sap2)
-#define i_tei1 isac_rw.isac_w.isac_tei1
-#define i_tei2 isac_rw.isac_w.isac_tei2
-#define i_cixr isac_rw.isac_w.isac_cixr
-#define I_CIXR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_cixr)
-#define I_CIX0 I_CIXR
-#define i_mox isac_rw.isac_w.isac_mox
-#define I_MOX REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_mox)
-#define i_sscx isac_rw.isac_w.isac_sscx
-#define I_SSCX REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sscx)
-#define i_sfcw isac_rw.isac_w.isac_sfcw
-#define I_SFCW REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sfcw)
-#define i_stcr isac_rw.isac_w.isac_stcr
-#define I_STCR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_stcr)
-#define i_adf1 isac_rw.isac_w.isac_adf1
-#define I_ADF1 REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_adf1)
-#define i_mocr isac_rw.isac_w.isac_mocr
-#define I_MOCR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_mocr)
-#define i_sqxr isac_rw.isac_w.isac_sqxr
-#define I_SQXR REG_OFFSET(isac_reg_t, isac_rw.isac_w.isac_sqxr)
-
-#define ISAC_ISTA_RME 0x80
-#define ISAC_ISTA_RPF 0x40
-#define ISAC_ISTA_RSC 0x20
-#define ISAC_ISTA_XPR 0x10
-#define ISAC_ISTA_TIN 0x08
-#define ISAC_ISTA_CISQ 0x04
-#define ISAC_ISTA_SIN 0x02
-#define ISAC_ISTA_EXI 0x01
-
-#define ISAC_MASK_RME 0x80
-#define ISAC_MASL_RPF 0x40
-#define ISAC_MASK_RSC 0x20
-#define ISAC_MASK_XPR 0x10
-#define ISAC_MASK_TIN 0x08
-#define ISAC_MASK_CISQ 0x04
-#define ISAC_MASK_SIN 0x02
-#define ISAC_MASK_EXI 0x01
-#define ISAC_MASK_ALL 0xff
-
-#define ISAC_STAR_XDOV 0x80
-#define ISAC_STAR_XFW 0x40
-#define ISAC_STAR_XRNR 0x20
-#define ISAC_STAR_RRNR 0x10
-#define ISAC_STAR_MBR 0x08
-#define ISAC_STAR_MAC1 0x04
-#define ISAC_STAR_BVS 0x02
-#define ISAC_STAR_MAC0 0x01
-
-#define ISAC_CMDR_RMC 0x80
-#define ISAC_CMDR_RRES 0x40
-#define ISAC_CMDR_RNR 0x20
-#define ISAC_CMDR_STI 0x10
-#define ISAC_CMDR_XTF 0x08
-#define ISAC_CMDR_XIF 0x04
-#define ISAC_CMDR_XME 0x02
-#define ISAC_CMDR_XRES 0x01
-
-#define ISAC_MODE_MDS2 0x80
-#define ISAC_MODE_MDS1 0x40
-#define ISAC_MODE_MDS0 0x20
-#define ISAC_MODE_TMD 0x10
-#define ISAC_MODE_RAC 0x08
-#define ISAC_MODE_DIM2 0x04
-#define ISAC_MODE_DIM1 0x02
-#define ISAC_MODE_DIM0 0x01
-
-#define ISAC_EXIR_XMR 0x80
-#define ISAC_EXIR_XDU 0x40
-#define ISAC_EXIR_PCE 0x20
-#define ISAC_EXIR_RFO 0x10
-#define ISAC_EXIR_SOV 0x08
-#define ISAC_EXIR_MOS 0x04
-#define ISAC_EXIR_SAW 0x02
-#define ISAC_EXIR_WOV 0x01
-
-#define ISAC_RSTA_RDA 0x80
-#define ISAC_RSTA_RDO 0x40
-#define ISAC_RSTA_CRC 0x20
-#define ISAC_RSTA_RAB 0x10
-#define ISAC_RSTA_SA1 0x08
-#define ISAC_RSTA_SA0 0x04
-#define ISAC_RSTA_CR 0x02
-#define ISAC_RSTA_TA 0x01
-
-#define ISAC_RSTA_MASK 0x70 /* the interesting bits */
-
-#define ISAC_RBCH_XAC 0x80
-#define ISAC_RBCH_VN1 0x40
-#define ISAC_RBCH_VN0 0x20
-#define ISAC_RBCH_OV 0x10
-/* the other 4 bits are the high bits of the receive byte count */
-
-#define ISAC_SPCR_SPU 0x80
-#define ISAC_SPCR_SAC 0x40
-#define ISAC_SPCR_SPM 0x20
-#define ISAC_SPCR_TLP 0x10
-#define ISAC_SPCR_C1C1 0x08
-#define ISAC_SPCR_C1C0 0x04
-#define ISAC_SPCR_C2C1 0x02
-#define ISAC_SPCR_C2C0 0x01
-
-#define ISAC_CIRR_SQC 0x80
-#define ISAC_CIRR_BAS 0x40
-/* bits 5-2 CODR */
-#define ISAC_CIRR_CIC0 0x02
-/* bit 0 is always 0 */
-/* C/I codes from bits 5-2 (>> 2 & 0xf) */
-/* the indications */
-#define ISAC_CIRR_IPU 0x07
-#define ISAC_CIRR_IDR 0x00
-#define ISAC_CIRR_ISD 0x02
-#define ISAC_CIRR_IDIS 0x03
-#define ISAC_CIRR_IEI 0x06
-#define ISAC_CIRR_IRSY 0x04
-#define ISAC_CIRR_IARD 0x08
-#define ISAC_CIRR_ITI 0x0a
-#define ISAC_CIRR_IATI 0x0b
-#define ISAC_CIRR_IAI8 0x0c
-#define ISAC_CIRR_IAI10 0x0d
-#define ISAC_CIRR_IDID 0x0f
-
-#define ISAC_CI_MASK 0x0f
-
-#define ISAC_CIXR_RSS 0x80
-#define ISAC_CIXR_BAC 0x40
-/* bits 5-2 CODX */
-#define ISAC_CIXR_TCX 0x02
-#define ISAC_CIXR_ECX 0x01
-/* in IOM-2 mode the low bits are always 1 */
-#define ISAC_CIX0_LOW 0x03
-/* C/I codes from bits 5-2 (>> 2 & 0xf) */
-/* the commands */
-#define ISAC_CIXR_CTIM 0
-#define ISAC_CIXR_CRS 0x01
-#define ISAC_CIXR_CSCZ 0x04
-#define ISAC_CIXR_CSSZ 0x02
-#define ISAC_CIXR_CAR8 0x08
-#define ISAC_CIXR_CAR10 0x09
-#define ISAC_CIXR_CARL 0x0a
-#define ISAC_CIXR_CDIU 0x0f
-
-#define ISAC_STCR_TSF 0x80
-#define ISAC_STCR_TBA2 0x40
-#define ISAC_STCR_TBA1 0x20
-#define ISAC_STCR_TBA0 0x10
-#define ISAC_STCR_ST1 0x08
-#define ISAC_STCR_ST0 0x04
-#define ISAC_STCR_SC1 0x02
-#define ISAC_STCR_SC0 0x01
-
-#define ISAC_ADF1_WTC1 0x80
-#define ISAC_ADF1_WTC2 0x40
-#define ISAC_ADF1_TEM 0x20
-#define ISAC_ADF1_PFS 0x10
-#define ISAC_ADF1_CFS 0x08
-#define ISAC_ADF1_FC2 0x04
-#define ISAC_ADF1_FC1 0x02
-#define ISAC_ADF1_ITF 0x01
-
-#define ISAC_ADF2_IMS 0x80
-/* all other bits are 0 */
-
-/* bits 7-5 are always 0 */
-#define ISAC_SQRR_SYN 0x10
-#define ISAC_SQRR_SQR1 0x08
-#define ISAC_SQRR_SQR2 0x04
-#define ISAC_SQRR_SQR3 0x02
-#define ISAC_SQRR_SQR4 0x01
-
-#define ISAC_SQXR_IDC 0x80
-#define ISAC_SQXR_CFS 0x40
-#define ISAC_SQXR_CI1E 0x20
-#define ISAC_SQXR_SQIE 0x10
-#define ISAC_SQXR_SQX1 0x08
-#define ISAC_SQXR_SQX2 0x04
-#define ISAC_SQXR_SQX3 0x02
-#define ISAC_SQXR_SQX4 0x01
-
-#endif /* I4B_ISAC_H_ */
diff --git a/sys/i4b/layer1/i4b_isic.c b/sys/i4b/layer1/i4b_isic.c
deleted file mode 100644
index 922df793c07a7..0000000000000
--- a/sys/i4b/layer1/i4b_isic.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic.c - global isic stuff
- * ==============================
- *
- * $Id: i4b_isic.c,v 1.44 1998/12/20 11:07:59 hm Exp $
- *
- * last edit-date: [Fri Dec 18 12:14:07 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <sys/device.h>
-#if defined(__NetBSD__) && defined(amiga)
-#include <machine/bus.h>
-#else
-#include <dev/isa/isavar.h>
-#endif
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-void isic_settrace(int unit, int val);
-int isic_gettrace(int unit);
-
-#ifdef __FreeBSD__
-void isicintr_sc(struct isic_softc *sc);
-#if !(defined(__FreeBSD_version)) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300006)
-void isicintr(int unit);
-#endif
-#else
-/* XXX - hack, going away soon! */
-struct isic_softc *isic_sc[ISIC_MAXUNIT];
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic - device driver interrupt routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-void
-isicintr_sc(struct isic_softc *sc)
-{
- isicintr(sc->sc_unit);
-}
-
-void
-isicintr(int unit)
-{
- register struct isic_softc *sc = &isic_sc[unit];
-#else
-int
-isicintr(void *arg)
-{
- struct isic_softc *sc = arg;
-#endif
-
- if(sc->sc_ipac == 0) /* HSCX/ISAC interupt routine */
- {
- u_char was_hscx_irq = 0;
- u_char was_isac_irq = 0;
-
- register u_char hscx_irq_stat;
- register u_char isac_irq_stat;
-
- for(;;)
- {
- /* get hscx irq status from hscx b ista */
- hscx_irq_stat =
- HSCX_READ(HSCX_CH_B, H_ISTA) & ~HSCX_B_IMASK;
-
- /* get isac irq status */
- isac_irq_stat = ISAC_READ(I_ISTA);
-
- /* do as long as there are pending irqs in the chips */
- if(!hscx_irq_stat && !isac_irq_stat)
- break;
-
- if(hscx_irq_stat & (HSCX_ISTA_RME | HSCX_ISTA_RPF |
- HSCX_ISTA_RSC | HSCX_ISTA_XPR |
- HSCX_ISTA_TIN | HSCX_ISTA_EXB))
- {
- isic_hscx_irq(sc, hscx_irq_stat,
- HSCX_CH_B,
- hscx_irq_stat & HSCX_ISTA_EXB);
- was_hscx_irq = 1;
- }
-
- if(hscx_irq_stat & (HSCX_ISTA_ICA | HSCX_ISTA_EXA))
- {
- isic_hscx_irq(sc,
- HSCX_READ(HSCX_CH_A, H_ISTA) & ~HSCX_A_IMASK,
- HSCX_CH_A,
- hscx_irq_stat & HSCX_ISTA_EXA);
- was_hscx_irq = 1;
- }
-
- if(isac_irq_stat)
- {
- isic_isac_irq(sc, isac_irq_stat); /* isac handler */
- was_isac_irq = 1;
- }
- }
-#ifndef amiga /* XXX should be: #if INTERUPTS_ARE_SHARED */
-#ifdef ELSA_QS1ISA
- if(sc->sc_cardtyp != CARD_TYPEP_ELSAQS1ISA)
- {
-#endif
- if((was_hscx_irq == 0) && (was_isac_irq == 0))
- DBGL1(L1_ERROR, "isicintr", ("WARNING: unit %d, No IRQ from HSCX/ISAC!\n", sc->sc_unit));
-#ifdef ELSA_QS1ISA
- }
-#endif
-#endif /* AMIGA */
-
- HSCX_WRITE(0, H_MASK, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
-
-#ifdef ELSA_QS1ISA
- DELAY(80);
-
- if(sc->sc_cardtyp == CARD_TYPEP_ELSAQS1ISA)
- if (sc->clearirq)
- {
- sc->clearirq(sc);
- }
-#else
- DELAY(100);
-#endif
-
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
-#ifndef __FreeBSD__
- return(was_hscx_irq || was_isac_irq);
-#endif
- }
- else /* IPAC interrupt routine */
- {
- register u_char ipac_irq_stat;
- register u_char was_ipac_irq = 0;
-
- for(;;)
- {
- /* get global irq status */
-
- ipac_irq_stat = (IPAC_READ(IPAC_ISTA)) & 0x3f;
-
- /* check hscx a */
-
- if(ipac_irq_stat & (IPAC_ISTA_ICA | IPAC_ISTA_EXA))
- {
- /* HSCX A interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_A, H_ISTA),
- HSCX_CH_A,
- ipac_irq_stat & IPAC_ISTA_EXA);
- was_ipac_irq = 1;
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICB | IPAC_ISTA_EXB))
- {
- /* HSCX B interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_B, H_ISTA),
- HSCX_CH_B,
- ipac_irq_stat & IPAC_ISTA_EXB);
- was_ipac_irq = 1;
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICD | IPAC_ISTA_EXD))
- {
- /* ISAC interrupt */
- isic_isac_irq(sc, ISAC_READ(I_ISTA));
- was_ipac_irq = 1;
- }
-
- /* do as long as there are pending irqs in the chip */
- if(!ipac_irq_stat)
- break;
- }
-
- if(was_ipac_irq == 0)
- DBGL1(L1_ERROR, "isicintr", ("WARNING: unit %d, No IRQ from IPAC!\n", sc->sc_unit));
-
- IPAC_WRITE(IPAC_MASK, 0xff);
- DELAY(50);
- IPAC_WRITE(IPAC_MASK, 0xc0);
-
-#ifndef __FreeBSD__
- return(was_ipac_irq);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic_settrace
- *---------------------------------------------------------------------------*/
-void
-isic_settrace(int unit, int val)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- sc->sc_trace = val;
-}
-
-/*---------------------------------------------------------------------------*
- * isic_gettrace
- *---------------------------------------------------------------------------*/
-int
-isic_gettrace(int unit)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
- return(sc->sc_trace);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_recovery - try to recover from irq lockup
- *---------------------------------------------------------------------------*/
-void
-isic_recover(struct isic_softc *sc)
-{
- u_char byte;
-
- /* get hscx irq status from hscx b ista */
-
- byte = HSCX_READ(HSCX_CH_B, H_ISTA);
-
- DBGL1(L1_ERROR, "isic_recover", ("HSCX B: ISTA = 0x%x\n", byte));
-
- if(byte & HSCX_ISTA_ICA)
- DBGL1(L1_ERROR, "isic_recover", ("HSCX A: ISTA = 0x%x\n", (u_char)HSCX_READ(HSCX_CH_A, H_ISTA)));
-
- if(byte & HSCX_ISTA_EXB)
- DBGL1(L1_ERROR, "isic_recover", ("HSCX B: EXIR = 0x%x\n", (u_char)HSCX_READ(HSCX_CH_B, H_EXIR)));
-
- if(byte & HSCX_ISTA_EXA)
- DBGL1(L1_ERROR, "isic_recover", ("HSCX A: EXIR = 0x%x\n", (u_char)HSCX_READ(HSCX_CH_A, H_EXIR)));
-
- /* get isac irq status */
-
- byte = ISAC_READ(I_ISTA);
-
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: ISTA = 0x%x\n", byte));
-
- if(byte & ISAC_ISTA_EXI)
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: EXIR = 0x%x\n", (u_char)ISAC_READ(I_EXIR)));
-
- if(byte & ISAC_ISTA_CISQ)
- {
- byte = ISAC_READ(I_CIRR);
-
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: CISQ = 0x%x\n", byte));
-
- if(byte & ISAC_CIRR_SQC)
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: SQRR = 0x%x\n", (u_char)ISAC_READ(I_SQRR)));
- }
-
- DBGL1(L1_ERROR, "isic_recover", ("HSCX B: IMASK = 0x%x\n", HSCX_B_IMASK));
- DBGL1(L1_ERROR, "isic_recover", ("HSCX A: IMASK = 0x%x\n", HSCX_A_IMASK));
-
- HSCX_WRITE(0, H_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
- DELAY(100);
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
- DELAY(100);
-
- DBGL1(L1_ERROR, "isic_recover", (" ISAC: IMASK = 0x%x\n", ISAC_IMASK));
-
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
-
-#endif /* NISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_isic_isa.c b/sys/i4b/layer1/i4b_isic_isa.c
deleted file mode 100644
index c0e11b9a044f0..0000000000000
--- a/sys/i4b/layer1/i4b_isic_isa.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_isa.c - ISA bus interface
- * ==================================
- *
- * $Id: i4b_isic_isa.c,v 1.14 1998/12/20 11:07:59 hm Exp $
- *
- * last edit-date: [Fri Dec 18 12:00:26 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <sys/device.h>
-#if defined(__NetBSD__) && defined(amiga)
-#include <machine/bus.h>
-#else
-#include <dev/isa/isavar.h>
-#endif
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#ifdef __FreeBSD__
-
-#if !(defined(__FreeBSD_version)) || (defined(__FreeBSD_version) && __FreeBSD_version >= 300006)
-void isicintr ( int unit );
-#endif
-
-void isicintr_sc(struct isic_softc *sc);
-
-static int isicprobe(struct isa_device *dev);
-int isicattach(struct isa_device *dev);
-
-struct isa_driver isicdriver = {
- isicprobe,
- isicattach,
- "isic",
- 0
-};
-
-int next_isic_unit = 0;
-struct isic_softc isic_sc[ISIC_MAXUNIT];
-
-#else
-
-#ifdef NetBSD1_3
-#if NetBSD1_3 < 2
-struct cfdriver isic_cd = {
- NULL, "isic", DV_DULL
-};
-#endif
-#endif
-
-#if defined (__OpenBSD__)
-struct cfdriver isic_cd = {
- NULL, "isic", DV_DULL
-};
-#endif
-
-#endif
-
-/* parameter and format for message producing e.g. "isic0: " */
-
-#ifdef __FreeBSD__
-#define ISIC_FMT "isic%d: "
-#define ISIC_PARM dev->id_unit
-#define TERMFMT " "
-#else
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-#endif
-
-extern void isic_settrace(int unit, int val); /*XXX*/
-extern int isic_gettrace(int unit); /*XXX*/
-
-#ifdef __FreeBSD__
-/*---------------------------------------------------------------------------*
- * isic - non-pnp device driver probe routine
- *---------------------------------------------------------------------------*/
-static int
-isicprobe(struct isa_device *dev)
-{
- int ret = 0;
-
- if(dev->id_unit != next_isic_unit)
- {
- printf("isicprobe: Error: new unit (%d) != next_isic_unit (%d)!\n", dev->id_unit, next_isic_unit);
- return(0);
- }
-
- switch(dev->id_flags)
- {
-#ifdef TEL_S0_8
- case FLAG_TELES_S0_8:
- ret = isic_probe_s08(dev);
- break;
-#endif
-
-#ifdef TEL_S0_16
- case FLAG_TELES_S0_16:
- ret = isic_probe_s016(dev);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case FLAG_TELES_S0_163:
- ret = isic_probe_s0163(dev);
- break;
-#endif
-
-#ifdef AVM_A1
- case FLAG_AVM_A1:
- ret = isic_probe_avma1(dev);
- break;
-#endif
-
-#ifdef USR_STI
- case FLAG_USR_ISDN_TA_INT:
- ret = isic_probe_usrtai(dev);
- break;
-#endif
-
-#ifdef ITKIX1
- case FLAG_ITK_IX1:
- ret = isic_probe_itkix1(dev);
- break;
-#endif
-
- default:
- break;
- }
- return(ret);
-}
-
-#else
-
-/*---------------------------------------------------------------------------*
- * isic - device driver probe routine, dummy for NetBSD/OpenBSD
- *---------------------------------------------------------------------------*/
-int
-isicprobe(struct isic_attach_args *args)
-{
- return 1;
-}
-
-#endif /* __FreeBSD__ */
-
-#ifdef __FreeBSD__
-
-/*---------------------------------------------------------------------------*
- * isic - non-pnp device driver attach routine
- *---------------------------------------------------------------------------*/
-int
-isicattach(struct isa_device *dev)
-{
- return(isic_realattach(dev, 0));
-}
-
-/*---------------------------------------------------------------------------*
- * isic - non-pnp and pnp device driver attach routine
- *---------------------------------------------------------------------------*/
-int
-isic_realattach(struct isa_device *dev, unsigned int iobase2)
-
-#else /* ! __FreeBSD__ */
-
-int
-isicattach(int flags, struct isic_softc *sc)
-
-#endif /* __FreeBSD__ */
-{
- int ret = 0;
- char *drvid;
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-#define PARM dev
-#define PARM2 dev, iobase2
-#define FLAGS dev->id_flags
-#else
-#define PARM sc
-#define PARM2 sc
-#define FLAGS flags
-#endif
-
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- /* done in bus specific attach code for other OS */
-
-#ifdef __FreeBSD__
- if(dev->id_unit != next_isic_unit)
- {
- printf("isicattach: Error: new unit (%d) != next_isic_unit (%d)!\n", dev->id_unit, next_isic_unit);
- return(0);
- }
-
- sc->sc_unit = dev->id_unit;
-#else
- isic_sc[sc->sc_unit] = sc;
-#endif
-
- /* card dependent setup */
- switch(FLAGS)
- {
-#ifdef DYNALINK
- case FLAG_DYNALINK:
- ret = isic_attach_Dyn(PARM2);
- break;
-#endif
-
-#ifdef TEL_S0_8
- case FLAG_TELES_S0_8:
- ret = isic_attach_s08(PARM);
- break;
-#endif
-
-#ifdef TEL_S0_16
- case FLAG_TELES_S0_16:
- ret = isic_attach_s016(PARM);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case FLAG_TELES_S0_163:
- ret = isic_attach_s0163(PARM);
- break;
-#endif
-
-#ifdef AVM_A1
- case FLAG_AVM_A1:
- ret = isic_attach_avma1(PARM);
- break;
-#endif
-
-#ifdef USR_STI
- case FLAG_USR_ISDN_TA_INT:
- ret = isic_attach_usrtai(PARM);
- break;
-#endif
-
-#ifdef ITKIX1
- case FLAG_ITK_IX1:
- ret = isic_attach_itkix1(PARM);
- break;
-#endif
-
-/* ======================================================================
- * Only P&P cards follow below!!!
- */
-#ifdef __FreeBSD__ /* we've already splitted all non-ISA stuff
- out of this ISA specific part for the other
- OS */
-
-#ifdef AVM_PCMCIA
- case FLAG_AVM_A1_PCMCIA:
- ret = isic_attach_fritzpcmcia(PARM);
- break;
-#endif
-
-#ifndef __FreeBSD__
-#ifdef TEL_S0_16_3_P
- case FLAG_TELES_S0_163_PnP:
- ret = isic_attach_s0163P(PARM2);
- break;
-#endif
-#endif
-
-#ifdef CRTX_S0_P
- case FLAG_CREATIX_S0_PnP:
- ret = isic_attach_Cs0P(PARM2);
- break;
-#endif
-
-#ifdef DRN_NGO
- case FLAG_DRN_NGO:
- ret = isic_attach_drnngo(PARM2);
- break;
-#endif
-
-#ifdef SEDLBAUER
- case FLAG_SWS:
- ret = isic_attach_sws(PARM);
- break;
-#endif
-
-#ifdef ELSA_QS1ISA
- case FLAG_ELSA_QS1P_ISA:
- ret = isic_attach_Eqs1pi(PARM2);
- break;
-#endif
-
-#endif /* __FreeBSD__ / P&P specific part */
-
-/* --- XXX - don't know how to handle this - should be removed!!!! ---- */
-#ifdef amiga
- case FLAG_BLMASTER:
- ret = 1; /* full detection was done in caller */
- break;
-#endif
-/* ------------------------------------------------------------------- */
-
- default:
- break;
- }
-
- if(ret == 0)
- return(0);
-
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return(0);
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-#endif
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce manufacturer and card type */
-
- switch(FLAGS)
- {
- case FLAG_TELES_S0_8:
- drvid = "Teles S0/8 or Niccy 1008";
- break;
-
- case FLAG_TELES_S0_16:
- drvid = "Teles S0/16, Creatix ISDN S0-16 or Niccy 1016";
- break;
-
- case FLAG_TELES_S0_163:
- drvid = "Teles S0/16.3";
- break;
-
- case FLAG_AVM_A1:
- drvid = "AVM A1 or AVM Fritz!Card";
- break;
-
- case FLAG_AVM_A1_PCMCIA:
- drvid = "AVM PCMCIA Fritz!Card";
- break;
-
- case FLAG_TELES_S0_163_PnP:
- drvid = "Teles S0/PnP";
- break;
-
- case FLAG_CREATIX_S0_PnP:
- drvid = "Creatix ISDN S0-16 P&P";
- break;
-
- case FLAG_USR_ISDN_TA_INT:
- drvid = "USRobotics Sportster ISDN TA intern";
- break;
-
- case FLAG_DRN_NGO:
- drvid = "Dr. Neuhaus NICCY Go@";
- break;
-
- case FLAG_DYNALINK:
- drvid = "Dynalink IS64PH";
- break;
-
- case FLAG_SWS:
- drvid = "Sedlbauer WinSpeed";
- break;
-
- case FLAG_BLMASTER:
- /* board announcement was done by caller */
- drvid = (char *)0;
- break;
-
- case FLAG_ELSA_QS1P_ISA:
- drvid = "ELSA QuickStep 1000pro (ISA)";
- break;
-
- case FLAG_ITK_IX1:
- drvid = "ITK ix1 micro";
- break;
-
- default:
- drvid = "ERROR, unknown flag used";
- break;
- }
-#ifndef __FreeBSD__
- printf("\n");
-#endif
- if (drvid)
- printf(ISIC_FMT "%s\n", ISIC_PARM, drvid);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
-#ifdef __FreeBSD__
- printf("(Addr=0x%lx)\n", (u_long)ISAC_BASE);
-#endif
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-
-#ifdef __FreeBSD__
- printf("(AddrA=0x%lx, AddrB=0x%lx)\n", (u_long)HSCX_A_BASE, (u_long)HSCX_B_BASE);
-
- next_isic_unit++;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300003
-
- /* set the interrupt handler - no need to change isa_device.h */
- dev->id_intr = (inthand2_t *)isicintr;
-
-#endif
-
-#endif /* __FreeBSD__ */
-
- return(1);
-#undef PARM
-#undef FLAGS
-}
-
-#endif /* NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_isic_pci.c b/sys/i4b/layer1/i4b_isic_pci.c
deleted file mode 100644
index bd6d4fd923718..0000000000000
--- a/sys/i4b/layer1/i4b_isic_pci.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_pci.c - PCI bus interface
- * ==================================
- *
- * $Id: i4b_isic_pci.c,v 1.1 1998/12/27 21:46:46 phk Exp $
- *
- * last edit-date: [Sat Dec 5 18:24:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isic.h"
-
-#if defined(__FreeBSD__)
-#include "opt_i4b.h"
-#include "pci.h"
-#endif
-
-#if (NISIC > 0) && (NPCI > 0)
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#if __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#define PCI_QS1000_ID 0x10001048
-
-#define MEM0_MAPOFF 0
-#define PORT0_MAPOFF 4
-#define PORT1_MAPOFF 12
-
-static const char* i4b_pci_probe(pcici_t tag, pcidi_t type);
-static void i4b_pci_attach(pcici_t config_id, int unit);
-static int isic_pciattach(int unit, u_long type, u_int iobase1, u_int iobase2);
-
-static u_long i4b_pci_count = 0;
-
-static struct pci_device i4b_pci_driver = {
- "isic",
- i4b_pci_probe,
- i4b_pci_attach,
- &i4b_pci_count,
- NULL
-};
-
-DATA_SET (pcidevice_set, i4b_pci_driver);
-
-static void isic_pci_intr_sc(struct isic_softc *sc);
-
-
-/*---------------------------------------------------------------------------*
- * PCI probe routine
- *---------------------------------------------------------------------------*/
-static const char *
-i4b_pci_probe(pcici_t tag, pcidi_t type)
-{
- switch(type)
- {
- case PCI_QS1000_ID:
- return("ELSA QuickStep 1000pro PCI ISDN adaptor");
- break;
-
- default:
- if(bootverbose)
- printf("i4b_pci_probe: unknown PCI type %ul!\n", (u_int)type);
- return(NULL);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * PCI attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4b_pci_attach(pcici_t config_id, int unit)
-{
- unsigned short iobase1;
- unsigned short iobase2;
- unsigned long type;
- struct isic_softc *sc = &isic_sc[unit];
-
- if(unit != next_isic_unit)
- {
- printf("i4b_pci_attach: Error: new unit (%d) != next_isic_unit (%d)!\n", unit, next_isic_unit);
- return;
- }
-
- if(!(pci_map_port(config_id, PCI_MAP_REG_START+PORT0_MAPOFF, &iobase1)))
- {
- printf("i4b_pci_attach: pci_map_port 1 failed!\n");
- return;
- }
-
- if(!(pci_map_port(config_id, PCI_MAP_REG_START+PORT1_MAPOFF, &iobase2)))
- {
- printf("i4b_pci_attach: pci_map_port 2 failed!\n");
- return;
- }
-
- if(bootverbose)
- printf("i4b_pci_attach: unit %d, port0 0x%x, port1 0x%x\n", unit, iobase1, iobase2);
-
- type = pci_conf_read(config_id, PCI_ID_REG);
-
- if((isic_pciattach(unit, type, iobase1, iobase2)) == 0)
- return;
-
- if(!(pci_map_int(config_id, (void *)isic_pci_intr_sc, (void *)sc, &net_imask)))
- return;
-}
-
-/*---------------------------------------------------------------------------*
- * isic - pci device driver attach routine
- *---------------------------------------------------------------------------*/
-static int
-isic_pciattach(int unit, u_long type, u_int iobase1, u_int iobase2)
-{
- int ret = 0;
- struct isic_softc *sc = &isic_sc[unit];
-
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- switch(type)
- {
-#ifdef ELSA_QS1PCI
- case PCI_QS1000_ID:
- ret = isic_attach_Eqs1pp(unit, iobase1, iobase2);
- break;
-#endif
- default:
- break;
- }
-
- if(ret == 0)
- return(ret);
-
- sc->sc_isac_version = 0;
- sc->sc_hscx_version = 0;
-
- sc->sc_unit = unit;
-
- if(sc->sc_ipac)
- {
- ret = IPAC_READ(IPAC_ID);
-
- switch(ret)
- {
- case 0x01:
- printf("isic%d: IPAC PSB2115 Version 1.1\n", unit);
- break;
-
- default:
- printf("isic%d: Error, IPAC version %d unknown!\n",
- unit, ret);
- return(0);
- break;
- }
- }
- else
- {
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- printf("isic%d: ISAC %s (IOM-%c)\n",
- unit,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- break;
-
- default:
- printf("isic%d: Error, ISAC version %d unknown!\n",
- unit, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- printf("isic%d: HSCX %s\n",
- unit,
- HSCXversion[sc->sc_hscx_version]);
- break;
-
- default:
- printf("isic%d: Error, HSCX version %d unknown!\n",
- unit, sc->sc_hscx_version);
- return(0);
- break;
- }
- }
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-#endif
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- next_isic_unit++;
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic - PCI device driver interrupt routine
- *---------------------------------------------------------------------------*/
-static void
-isic_pci_intr_sc(struct isic_softc *sc)
-{
- if(sc->sc_ipac == 0) /* HSCX/ISAC interupt routine */
- {
- register u_char hscx_irq_stat;
- register u_char isac_irq_stat;
-
- for(;;)
- {
- /* get hscx irq status from hscx b ista */
- hscx_irq_stat =
- HSCX_READ(HSCX_CH_B, H_ISTA) & ~HSCX_B_IMASK;
-
- /* get isac irq status */
- isac_irq_stat = ISAC_READ(I_ISTA);
-
- /* do as long as there are pending irqs in the chips */
- if(!hscx_irq_stat && !isac_irq_stat)
- break;
-
- if(hscx_irq_stat & (HSCX_ISTA_RME | HSCX_ISTA_RPF |
- HSCX_ISTA_RSC | HSCX_ISTA_XPR |
- HSCX_ISTA_TIN | HSCX_ISTA_EXB))
- {
- isic_hscx_irq(sc, hscx_irq_stat,
- HSCX_CH_B,
- hscx_irq_stat & HSCX_ISTA_EXB);
- }
-
- if(hscx_irq_stat & (HSCX_ISTA_ICA | HSCX_ISTA_EXA))
- {
- isic_hscx_irq(sc,
- HSCX_READ(HSCX_CH_A, H_ISTA) & ~HSCX_A_IMASK,
- HSCX_CH_A,
- hscx_irq_stat & HSCX_ISTA_EXA);
- }
-
- if(isac_irq_stat)
- { /* isac handler */
- isic_isac_irq(sc, isac_irq_stat);
- }
- }
-
- HSCX_WRITE(0, H_MASK, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- HSCX_WRITE(1, H_MASK, 0xff);
-
- DELAY(100);
-
- HSCX_WRITE(0, H_MASK, HSCX_A_IMASK);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
- HSCX_WRITE(1, H_MASK, HSCX_B_IMASK);
- }
- else /* IPAC interrupt routine */
- {
- register u_char ipac_irq_stat;
-
- for(;;)
- {
- /* get global irq status */
-
- ipac_irq_stat = (IPAC_READ(IPAC_ISTA)) & 0x3f;
-
- /* do as long as there are pending irqs in the chip */
- if(!ipac_irq_stat)
- break;
-
- /* check hscx a */
-
- if(ipac_irq_stat & (IPAC_ISTA_ICA | IPAC_ISTA_EXA))
- {
- /* HSCX A interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_A, H_ISTA),
- HSCX_CH_A,
- ipac_irq_stat & IPAC_ISTA_EXA);
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICB | IPAC_ISTA_EXB))
- {
- /* HSCX B interrupt */
- isic_hscx_irq(sc, HSCX_READ(HSCX_CH_B, H_ISTA),
- HSCX_CH_B,
- ipac_irq_stat & IPAC_ISTA_EXB);
- }
- if(ipac_irq_stat & (IPAC_ISTA_ICD | IPAC_ISTA_EXD))
- {
- /* ISAC interrupt */
- isic_isac_irq(sc, ISAC_READ(I_ISTA));
- }
- }
-
- IPAC_WRITE(IPAC_MASK, 0xff);
- DELAY(50);
- IPAC_WRITE(IPAC_MASK, 0xc0);
- }
-}
-
-#endif /* (NISIC > 0) && (NPCI > 0) */
-
diff --git a/sys/i4b/layer1/i4b_isic_pcmcia.c b/sys/i4b/layer1/i4b_isic_pcmcia.c
deleted file mode 100644
index e20964cc92fc4..0000000000000
--- a/sys/i4b/layer1/i4b_isic_pcmcia.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1998 Matthias Apitz. All rights reserved.
- *
- * Copyright (c) 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_pcmcia.c - i4b FreeBSD PCMCIA support
- * ----------------------------------------------
- *
- * $Id: i4b_isic_pcmcia.c,v 1.2 1999/01/12 11:04:59 eivind Exp $
- *
- * last edit-date: [Mon Dec 14 17:30:09 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "isic.h"
-#include "opt_i4b.h"
-#include "card.h"
-
-#if (NISIC > 0) && (NCARD > 0)
-
-#include "apm.h"
-#include <sys/param.h>
-#include <sys/select.h>
-#include <i386/isa/isa_device.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/module.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-
-#include <pccard/cardinfo.h>
-#include <pccard/slot.h>
-#include <pccard/driver.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-extern int isicattach(struct isa_device *dev);
-extern void isicintr(int unit);
-
-/*
- * PC-Card (PCMCIA) specific code.
- */
-static int isic_pccard_init __P((struct pccard_devinfo *));
-static void isic_unload __P((struct pccard_devinfo *));
-static int isic_card_intr __P((struct pccard_devinfo *));
-
-PCCARD_MODULE(isic, isic_pccard_init, isic_unload, isic_card_intr, 0,net_imask);
-
-/*
- * Initialize the device - called from Slot manager.
- */
-
-static int opened = 0; /* our cards status */
-
-static int isic_pccard_init(devi)
-struct pccard_devinfo *devi;
-{
- struct isa_device *is = &devi->isahd;
-
- if ((1 << is->id_unit) & opened)
- return(EBUSY);
-
- opened |= 1 << is->id_unit;
- printf("isic%d: PCMCIA init, irqmask = 0x%x (%d), iobase = 0x%x\n",
- is->id_unit, is->id_irq, devi->slt->irq, is->id_iobase);
-
-#if 0
- /* XXX: problems resolving isic_probe_avma1_pcmcia() /phk */
- /*
- * look if there is really an AVM PCMCIA Fritz!Card and
- * setup the card specific stuff
- */
- isic_probe_avma1_pcmcia(is);
-#endif
-
- /* ap:
- * XXX what's to do with the return value?
- */
-
- /*
- * try to attach the PCMCIA card as a normal A1 card
- */
- isicattach(is);
- return(0);
-}
-
-static void isic_unload(devi)
-struct pccard_devinfo *devi;
-{
- struct isa_device *is = &devi->isahd;
- printf("isic%d: unloaded\n", is->id_unit);
- opened &= ~(1 << is->id_unit);
-}
-
-/*
- * card_intr - Shared interrupt called from
- * front end of PC-Card handler.
- */
-static int isic_card_intr(devi)
-struct pccard_devinfo *devi;
-{
- isicintr(devi->isahd.id_unit);
- return(1);
-}
-
-#endif /* (NISIC > 0) && (NCARD > 0) */
-#endif /* __FreeBSD__ */
diff --git a/sys/i4b/layer1/i4b_isic_pnp.c b/sys/i4b/layer1/i4b_isic_pnp.c
deleted file mode 100644
index ed1892d9088f3..0000000000000
--- a/sys/i4b/layer1/i4b_isic_pnp.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (c) 1998 Eivind Eklund. All rights reserved.
- *
- * Copyright (c) 1998 German Tischler. All rights reserved.
- *
- * Copyright (c) 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_isic_pnp.c - i4b pnp support
- * --------------------------------
- *
- * $Id: i4b_isic_pnp.c,v 1.15 1998/12/20 11:07:59 hm Exp $
- *
- * last edit-date: [Fri Dec 18 20:54:56 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-#include "pnp.h"
-#include "isic.h"
-#include "opt_i4b.h"
-
-#if (NISIC > 0) && (NPNP > 0)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#if defined(__FreeBSD__) && __FreeBSD__ < 3
-#include "ioconf.h"
-extern void isicintr(int unit); /* XXX this gives a compiler warning */
- /* on one 2.2.7 machine but no */
- /* warning on another one !? (-hm) */
-#endif
-
-#if (defined(__FreeBSD_version) && __FreeBSD_version >= 300006)
-extern void isicintr(int unit);
-#endif
-
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#include <i386/isa/pnp.h>
-
-#include <i4b/include/i4b_global.h>
-#include <machine/i4b_ioctl.h>
-#include <i4b/layer1/i4b_l1.h>
-
-#define VID_TEL163PNP 0x10212750 /* Teles 16.3 PnP */
-#define VID_CREATIXPP 0x0000980e /* Creatix S0/16 P+P */
-#define VID_DYNALINK 0x88167506 /* Dynalink */
-#define VID_SEDLBAUER 0x0100274c /* Sedlbauer WinSpeed */
-#define VID_NICCYGO 0x5001814c /* Neuhaus Niccy GO@ */
-#define VID_ELSAQS1P 0x33019315 /* ELSA Quickstep1000pro*/
-
-static struct i4b_pnp_ids {
- u_long vend_id;
- char *id_str;
-} i4b_pnp_ids[] = {
- { VID_TEL163PNP, "Teles 16.3 PnP" },
- { VID_CREATIXPP, "Creatix S0/16 P+P" },
- { VID_DYNALINK, "Dynalink IS64PH" },
- { VID_SEDLBAUER, "Sedlbauer WinSpeed" },
- { VID_NICCYGO, "Dr.Neuhaus Niccy Go@" },
- { VID_ELSAQS1P, "ELSA QuickStep 1000pro"},
- { 0 }
-};
-
-extern struct isa_driver isicdriver;
-
-static int isic_pnpprobe(struct isa_device *dev, unsigned int iobase2);
-static char *i4b_pnp_probe(u_long csn, u_long vend_id);
-static void i4b_pnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev);
-
-static u_long ni4b_pnp = 0;
-
-static struct pnp_device i4b_pnp = {
- "i4b_pnp",
- i4b_pnp_probe,
- i4b_pnp_attach,
- &ni4b_pnp,
- &net_imask
-};
-
-DATA_SET(pnpdevice_set, i4b_pnp);
-
-/*---------------------------------------------------------------------------*
- * PnP probe routine
- *---------------------------------------------------------------------------*/
-static char *
-i4b_pnp_probe(u_long csn, u_long vend_id)
-{
- struct i4b_pnp_ids *ids;
- char *string = NULL;
-
- /* search table of knowd id's */
-
- for(ids = i4b_pnp_ids; ids->vend_id != 0; ids++)
- {
- if(vend_id == ids->vend_id)
- {
- string = ids->id_str;
- break;
- }
- }
-
- if(string)
- {
- struct pnp_cinfo spci;
-
- read_pnp_parms(&spci, 0);
-
- if((spci.enable == 0) || (spci.flags & 0x01))
- {
- printf("CSN %d (%s) is disabled.\n", (int)csn, string);
- return (NULL);
- }
- }
- return(string);
-}
-
-/*---------------------------------------------------------------------------*
- * PnP attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4b_pnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
-{
- struct pnp_cinfo spci;
- struct isa_device *isa_devp;
-
- if(dev->id_unit != next_isic_unit)
- {
- printf("i4b_pnp_attach: Error: new unit (%d) != next_isic_unit (%d)!\n", dev->id_unit, next_isic_unit);
- return;
- }
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for %s\n",
- dev->id_unit, dev->id_unit, name);
- return;
- }
-
- if(read_pnp_parms(&spci, 0) == 0)
- {
- printf("isic%d: read_pnp_parms error for %s\n",
- dev->id_unit, name);
- return;
- }
-
- if(bootverbose)
- {
- printf("isic%d: vendorid = 0x%08x port0 = 0x%04x, port1 = 0x%04x, irq = %d\n",
- dev->id_unit, spci.vendor_id, spci.port[0], spci.port[1], spci.irq[0]);
- }
-
- dev->id_iobase = spci.port[0];
- dev->id_irq = (1 << spci.irq[0]);
- dev->id_intr = (inthand2_t *) isicintr;
- dev->id_drq = -1;
-
-/* XXX add dev->id_alive init here ! ?? */
-
- switch(spci.vendor_id)
- {
- case VID_TEL163PNP:
- dev->id_flags = FLAG_TELES_S0_163_PnP;
- break;
- case VID_CREATIXPP:
- dev->id_flags = FLAG_CREATIX_S0_PnP;
- break;
- case VID_DYNALINK:
- dev->id_flags = FLAG_DYNALINK;
- break;
- case VID_SEDLBAUER:
- dev->id_flags = FLAG_SWS;
- break;
- case VID_NICCYGO:
- dev->id_flags = FLAG_DRN_NGO;
- break;
- case VID_ELSAQS1P:
- dev->id_flags = FLAG_ELSA_QS1P_ISA;
- break;
- }
-
- write_pnp_parms(&spci, 0);
- enable_pnp_card();
-
- if(dev->id_driver == NULL)
- {
- dev->id_driver = &isicdriver;
-
- isa_devp = find_isadev(isa_devtab_net, &isicdriver, 0);
-
- if(isa_devp != NULL)
- {
- dev->id_id = isa_devp->id_id;
- }
- }
-
- if((dev->id_alive = isic_pnpprobe(dev, spci.port[1])) != 0)
- {
-/* XXX dev->id_alive is the size of the port area used ! */
- isic_realattach(dev, spci.port[1]);
- }
- else
- {
- printf("isic%d: probe failed!\n", dev->id_unit);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic - pnp device driver probe routine
- *---------------------------------------------------------------------------*/
-static int
-isic_pnpprobe(struct isa_device *dev, unsigned int iobase2)
-{
- int ret = 0;
-
- switch(dev->id_flags)
- {
-#ifndef __FreeBSD__
-#ifdef TEL_S0_16_3_P
- case FLAG_TELES_S0_163_PnP:
- ret = isic_probe_s0163P(dev, iobase2);
- break;
-#endif
-#endif
-
-#ifdef CRTX_S0_P
- case FLAG_CREATIX_S0_PnP:
- ret = isic_probe_Cs0P(dev, iobase2);
- break;
-#endif
-
-#ifdef DRN_NGO
- case FLAG_DRN_NGO:
- ret = isic_probe_drnngo(dev, iobase2);
- break;
-#endif
-
-#ifdef SEDLBAUER
- case FLAG_SWS:
- ret = 8; /* pnp only, nothing to probe */
- break;
-#endif
-
-#ifdef DYNALINK
- case FLAG_DYNALINK:
- ret = isic_probe_Dyn(dev, iobase2);
- break;
-#endif
-
-#ifdef ELSA_QS1ISA
- case FLAG_ELSA_QS1P_ISA:
- ret = isic_probe_Eqs1pi(dev, iobase2);
- break;
-#endif
- default:
- break;
- }
- return(ret);
-}
-
-#endif /* (NISIC > 0) && (NPNP > 0) */
-#endif /* __FreeBSD__ */
diff --git a/sys/i4b/layer1/i4b_itk_ix1.c b/sys/i4b/layer1/i4b_itk_ix1.c
deleted file mode 100644
index cd70dbf9ee074..0000000000000
--- a/sys/i4b/layer1/i4b_itk_ix1.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann <martin@rumolt.teuto.de>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- * derived from this software withough specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_itk_ix1.c - ITK ix1 micro passive card driver for isdn4bsd
- * --------------------------------------------------------------
- *
- * $Id: i4b_itk_ix1.c,v 1.1 1998/12/27 21:46:46 phk Exp $
- *
- * last edit-date: [Wed Dec 16 14:46:36 1998]
- *
- *---------------------------------------------------------------------------
- *
- * The ITK ix1 micro ISDN card is an ISA card with one region
- * of four io ports mapped and a fixed irq all jumpered on the card.
- * Access to the board is straight forward and simmilar to
- * the ELSA and DYNALINK cards. If a PCI version of this card
- * exists all we need is probably a pci-bus attachment, all
- * this low level routines should work imediately.
- *
- * To reset the card:
- * - write 0x01 to ITK_CONFIG
- * - wait >= 10 ms
- * - write 0x00 to ITK_CONFIG
- *
- * To read or write data:
- * - write address to ITK_ALE port
- * - read data from or write data to ITK_ISAC_DATA port or ITK_HSCX_DATA port
- * The two HSCX channel registers are offset by HSCXA (0x00) and HSCXB (0x40).
- *
- * XXX - A reasonable probe routine has to be written.
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(ITKIX1)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-
-#define ITK_ISAC_DATA 0
-#define ITK_HSCX_DATA 1
-#define ITK_ALE 2
-#define ITK_CONFIG 3
-#define ITK_IO_SIZE 4
-
-#define HSCXA 0
-#define HSCXB 0x40
-
-#ifndef __FreeBSD__
-static void itkix1_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size);
-static void itkix1_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size);
-static void itkix1_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data);
-static u_int8_t itkix1_read_reg(struct isic_softc *sc, int what, bus_size_t offs);
-#else
-static u_char itkix1_read_reg(u_char *base, u_int offset);
-static void itkix1_write_reg(u_char *base, u_int offset, u_int v);
-static void itkix1_read_fifo(void *base, const void *buf, size_t len);
-static void itkix1_write_fifo(void *base, const void *buf, size_t len);
-#endif
-
-/*
- * Probe for card
- */
-#ifdef __FreeBSD__
-int
-isic_probe_itkix1(struct isa_device *dev)
-{
- u_int8_t hd, cd;
- int ret;
-
- hd = inb(dev->id_iobase + ITK_HSCX_DATA);
- cd = inb(dev->id_iobase + ITK_CONFIG);
-
- ret = (hd == 0 && cd == 0xfc);
-
-#define ITK_PROBE_DEBUG
-#ifdef ITK_PROBE_DEBUG
- printf("\nITK ix1 micro probe: hscx = 0x%02x, config = 0x%02x, would have %s\n",
- hd, cd, ret ? "succeeded" : "failed");
- return 1;
-#else
- return ret;
-#endif
-}
-#else
-int
-isic_probe_itkix1(struct isic_attach_args *ia)
-{
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t hd, cd;
- int ret;
-
- hd = bus_space_read_1(t, h, ITK_HSCX_DATA);
- cd = bus_space_read_1(t, h, ITK_CONFIG);
-
- ret = (hd == 0 && cd == 0xfc);
-
-#define ITK_PROBE_DEBUG
-#ifdef ITK_PROBE_DEBUG
- printf("\nITK ix1 micro probe: hscx = 0x%02x, config = 0x%02x, would have %s\n",
- hd, cd, ret ? "succeeded" : "failed");
- return 1;
-#else
- return ret;
-#endif
-}
-#endif
-
-/*
- * Attach card
- */
-#ifdef __FreeBSD__
-int
-isic_attach_itkix1(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- sc->sc_irq = dev->id_irq;
-
- dev->id_msize = 0;
-
- /* check if we got an iobase */
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = itkix1_read_reg;
- sc->writereg = itkix1_write_reg;
- sc->readfifo = itkix1_read_fifo;
- sc->writefifo = itkix1_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_ITKIX1;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
- ISAC_BASE = (caddr_t) sc->sc_port;
- HSCX_A_BASE = (caddr_t) sc->sc_port + 1;
- HSCX_B_BASE = (caddr_t) sc->sc_port + 2;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) || ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for ITK ix1 micro\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- outb((dev->id_iobase)+ITK_CONFIG, 1);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase)+ITK_CONFIG, 0);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else
-
-int isic_attach_itkix1(struct isic_softc *sc)
-{
- /* setup access routines */
- sc->clearirq = NULL;
- sc->readreg = itkix1_read_reg;
- sc->writereg = itkix1_write_reg;
- sc->readfifo = itkix1_read_fifo;
- sc->writefifo = itkix1_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_ITKIX1;
-
- /* setup IOM bus type */
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1). */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) || ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("%s: HSCX VSTR test failed for ITK ix1 micro\n",
- sc->sc_dev.dv_xname);
- printf("%s: HSC0: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR));
- printf("%s: HSC1: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR));
- return 0;
- }
-
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ITK_CONFIG, 1);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, ITK_CONFIG, 0);
- DELAY(SEC_DELAY / 10);
- return 1;
-}
-
-#endif
-
-#ifdef __FreeBSD__
-static void
-itkix1_read_fifo(void *buf, const void *base, size_t len)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, 0);
- insb(port+ITK_ISAC_DATA, (u_char *)buf, (u_int)len);
- break;
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA);
- insb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB);
- insb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- }
-}
-#else
-static void
-itkix1_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, 0);
- bus_space_read_multi_1(t, h, ITK_ISAC_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA);
- bus_space_read_multi_1(t, h, ITK_HSCX_DATA, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB);
- bus_space_read_multi_1(t, h, ITK_HSCX_DATA, buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-itkix1_write_fifo(void *base, const void *buf, size_t len)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, 0);
- outsb(port+ITK_ISAC_DATA, (u_char *)buf, (u_int)len);
- break;
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA);
- outsb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB);
- outsb(port+ITK_HSCX_DATA, (u_char *)buf, (u_int)len);
- break;
- }
-}
-#else
-static void itkix1_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, 0);
- bus_space_write_multi_1(t, h, ITK_ISAC_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA);
- bus_space_write_multi_1(t, h, ITK_HSCX_DATA, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB);
- bus_space_write_multi_1(t, h, ITK_HSCX_DATA, (u_int8_t*)buf, size);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static void
-itkix1_write_reg(u_char *base, u_int offset, u_int v)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, offset);
- outb(port+ITK_ISAC_DATA, (u_char)v);
- break;
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA+offset);
- outb(port+ITK_HSCX_DATA, (u_char)v);
- break;
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB+offset);
- outb(port+ITK_HSCX_DATA, (u_char)v);
- break;
- }
-}
-#else
-static void itkix1_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, offs);
- bus_space_write_1(t, h, ITK_ISAC_DATA, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA+offs);
- bus_space_write_1(t, h, ITK_HSCX_DATA, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB+offs);
- bus_space_write_1(t, h, ITK_HSCX_DATA, data);
- break;
- }
-}
-#endif
-
-#ifdef __FreeBSD__
-static u_char
-itkix1_read_reg(u_char *base, u_int offset)
-{
- int port = (u_long)base & ~0x0003;
- switch ((u_long)base & 3) {
- case 0: /* ISAC */
- outb(port+ITK_ALE, offset);
- return (inb(port+ITK_ISAC_DATA));
- case 1: /* HSCXA */
- outb(port+ITK_ALE, HSCXA+offset);
- return (inb(port+ITK_HSCX_DATA));
- case 2: /* HSCXB */
- outb(port+ITK_ALE, HSCXB+offset);
- return (inb(port+ITK_HSCX_DATA));
- }
- panic("itkix1_read_reg: Fallthrough\n");
-}
-#else
-static u_int8_t itkix1_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ITK_ALE, offs);
- return bus_space_read_1(t, h, ITK_ISAC_DATA);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ITK_ALE, HSCXA+offs);
- return bus_space_read_1(t, h, ITK_HSCX_DATA);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ITK_ALE, HSCXB+offs);
- return bus_space_read_1(t, h, ITK_HSCX_DATA);
- }
- return 0;
-}
-#endif
-
-#endif /* ITKIX1 */
diff --git a/sys/i4b/layer1/i4b_l1.c b/sys/i4b/layer1/i4b_l1.c
deleted file mode 100644
index 96497c5df6a4b..0000000000000
--- a/sys/i4b/layer1/i4b_l1.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l1.c - isdn4bsd layer 1 handler
- * -----------------------------------
- *
- * $Id: i4b_l1.c,v 1.27 1998/12/05 18:04:51 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:24:52 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "isic.h"
-#else
-#define NISIC 1 /* don't bother */
-#endif
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-unsigned int i4b_l1_debug = L1_DEBUG_DEFAULT;
-
-static int ph_data_req(int, struct mbuf *, int);
-static int ph_activate_req(int);
-
-/* from i4btrc driver i4b_trace.c */
-extern int get_trace_data_from_l1(int unit, int what, int len, char *buf);
-
-/* from layer 2 */
-extern int i4b_ph_data_ind(int unit, struct mbuf *m);
-extern int i4b_ph_activate_ind(int unit);
-extern int i4b_ph_deactivate_ind(int unit);
-extern int i4b_mph_attach_ind(int unit);
-extern int i4b_mph_status_ind(int, int, int);
-
-/* layer 1 lme */
-static int i4b_mph_command_req(int, int, int);
-
-/* jump table */
-struct i4b_l1l2_func i4b_l1l2_func = {
-
- /* Layer 1 --> Layer 2 */
-
- (int (*)(int, struct mbuf *)) i4b_ph_data_ind,
- (int (*)(int)) i4b_ph_activate_ind,
- (int (*)(int)) i4b_ph_deactivate_ind,
-
- /* Layer 2 --> Layer 1 */
-
- (int (*)(int, struct mbuf *, int)) ph_data_req,
- (int (*)(int)) ph_activate_req,
-
- /* Layer 1 --> upstream, ISDN trace data */
-
- (int (*)(i4b_trace_hdr_t *, int, u_char *)) get_trace_data_from_l1,
-
- /* Driver control and status information */
-
- (int (*)(int, int, int)) i4b_mph_status_ind,
- (int (*)(int, int, int)) i4b_mph_command_req,
-};
-
-/*---------------------------------------------------------------------------*
- *
- * L2 -> L1: PH-DATA-REQUEST
- * =========================
- *
- * parms:
- * unit physical interface unit number
- * m mbuf containing L2 frame to be sent out
- * freeflag MBUF_FREE: free mbuf here after having sent
- * it out
- * MBUF_DONTFREE: mbuf is freed by Layer 2
- * returns:
- * ==0 fail, nothing sent out
- * !=0 ok, frame sent out
- *
- *---------------------------------------------------------------------------*/
-static int
-ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- u_char cmd;
- int s;
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
-#ifdef NOTDEF
- DBGL1(L1_PRIM, "PH-DATA-REQ", ("unit %d, freeflag=%d\n", unit, freeflag));
-#endif
-
- if(m == NULL) /* failsafe */
- return (0);
-
- s = SPLI4B();
-
- if(sc->sc_I430state == ST_F3) /* layer 1 not running ? */
- {
- DBGL1(L1_I_ERR, "ph_data_req", ("still in state F3!\n"));
- ph_activate_req(unit);
- }
-
- if(sc->sc_state & ISAC_TX_ACTIVE)
- {
- if(sc->sc_obuf2 == NULL)
- {
- sc->sc_obuf2 = m; /* save mbuf ptr */
-
- if(freeflag)
- sc->sc_freeflag2 = 1; /* IRQ must mfree */
- else
- sc->sc_freeflag2 = 0; /* IRQ must not mfree */
-
- DBGL1(L1_I_MSG, "ph_data_req", ("using 2nd ISAC TX buffer, state = %s\n", isic_printstate(sc)));
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, m->m_len, m->m_data);
- }
- splx(s);
- return(1);
- }
-
- DBGL1(L1_I_ERR, "ph_data_req", ("No Space in TX FIFO, state = %s\n", isic_printstate(sc)));
-
- if(freeflag == MBUF_FREE)
- i4b_Dfreembuf(m);
-
- splx(s);
- return (0);
- }
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = unit;
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, m->m_len, m->m_data);
- }
-
- sc->sc_state |= ISAC_TX_ACTIVE; /* set transmitter busy flag */
-
- DBGL1(L1_I_MSG, "ph_data_req", ("ISAC_TX_ACTIVE set\n"));
-
- sc->sc_freeflag = 0; /* IRQ must NOT mfree */
-
- ISAC_WRFIFO(m->m_data, min(m->m_len, ISAC_FIFO_LEN)); /* output to TX fifo */
-
- if(m->m_len > ISAC_FIFO_LEN) /* message > 32 bytes ? */
- {
- sc->sc_obuf = m; /* save mbuf ptr */
- sc->sc_op = m->m_data + ISAC_FIFO_LEN; /* ptr for irq hdl */
- sc->sc_ol = m->m_len - ISAC_FIFO_LEN; /* length for irq hdl */
-
- if(freeflag)
- sc->sc_freeflag = 1; /* IRQ must mfree */
-
- cmd = ISAC_CMDR_XTF;
- }
- else
- {
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
-
- if(freeflag)
- i4b_Dfreembuf(m);
-
- cmd = ISAC_CMDR_XTF | ISAC_CMDR_XME;
- }
-
- ISAC_WRITE(I_CMDR, cmd);
- ISACCMDRWRDELAY();
-
- splx(s);
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- *
- * L2 -> L1: PH-ACTIVATE-REQUEST
- * =============================
- *
- * parms:
- * unit physical interface unit number
- *
- * returns:
- * ==0
- * !=0
- *
- *---------------------------------------------------------------------------*/
-static int
-ph_activate_req(int unit)
-{
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
- DBGL1(L1_PRIM, "PH-ACTIVATE-REQ", ("unit %d\n", unit));
- isic_next_state(sc, EV_PHAR);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * command from the upper layers
- *---------------------------------------------------------------------------*/
-static int
-i4b_mph_command_req(int unit, int command, int parm)
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[unit];
-#else
- struct isic_softc *sc = isic_find_sc(unit);
-#endif
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- DBGL1(L1_PRIM, "MPH-COMMAND-REQ", ("unit %d, command = CMR_DOPEN\n", unit));
- sc->sc_enabled = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- DBGL1(L1_PRIM, "MPH-COMMAND-REQ", ("unit %d, command = CMR_DCLOSE\n", unit));
- sc->sc_enabled = 0;
- break;
-
- default:
- DBGL1(L1_ERROR, "i4b_mph_command_req", ("ERROR, unknown command = %d, unit = %d, parm = %d\n", command, unit, parm));
- break;
- }
-
- return(0);
-}
-
-#endif /* NISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_l1.h b/sys/i4b/layer1/i4b_l1.h
deleted file mode 100644
index 2b15ccc92983e..0000000000000
--- a/sys/i4b/layer1/i4b_l1.h
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------*
- *
- * i4b_l1.h - isdn4bsd layer 1 header file
- * ---------------------------------------
- *
- * $Id: i4b_l1.h,v 1.54 1998/12/17 04:55:39 hm Exp $
- *
- * last edit-date: [Mon Dec 14 10:41:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef I4B_L1_H_
-#define I4B_L1_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-/*---------------------------------------------------------------------------
- * kernel config file flags definition
- *---------------------------------------------------------------------------*/
- /* XXX: we do need these only for real ISA (not even ISAPNP cards), and only
- * because we are not confident enough in the general ISA probe routine (as
- * practiced by the NetBSD variant). *And* it is completely redundant to the
- * various options enabling only a few card's support routines to be compiled
- * in. Probably the current truth is: this is usefull for anybody with more
- * than one supported real ISA card. It is not usefull in generic configs,
- * nor in typical one-controller-only configurations.
- * Further - it is identical to the CARD_TYPEP_xxx definitions in
- * ../machine/i4b_ioctl.h.
- */
-#define FLAG_TELES_S0_8 1
-#define FLAG_TELES_S0_16 2
-#define FLAG_TELES_S0_163 3
-#define FLAG_AVM_A1 4
-#define FLAG_TELES_S0_163_PnP 5 /* XXX - not needed, remove! */
-#define FLAG_CREATIX_S0_PnP 6 /* XXX - not needed, remove! */
-#define FLAG_USR_ISDN_TA_INT 7
-#define FLAG_DRN_NGO 8 /* XXX - not needed, remove! */
-#define FLAG_SWS 9 /* XXX - not needed, remove! */
-#define FLAG_AVM_A1_PCMCIA 10 /* XXX - not needed, remove! */
-#define FLAG_DYNALINK 11 /* XXX - not needed, remove! */
-#define FLAG_BLMASTER 12
-#define FLAG_ELSA_QS1P_ISA 13 /* XXX - not needed, remove! */
-#define FLAG_ELSA_QS1P_PCI 14 /* XXX - not needed, remove! */
-#define FLAG_SIEMENS_ITALK 15
-#define FLAG_ELSA_MLIMC 16 /* XXX - not needed, remove! */
-#define FLAG_ELSA_MLMCALL 17 /* XXX - not needed, remove! */
-#define FLAG_ITK_IX1 18
-
-#define SEC_DELAY 1000000 /* one second DELAY for DELAY*/
-
-#define MAX_DFRAME_LEN 264 /* max length of a D frame */
-
-#define min(a,b) ((a)<(b)?(a):(b))
-
-#ifndef __FreeBSD__
-/* We try to map as few as possible as small as possible io and/or
- memory regions. Each card defines its own interpretation of this
- mapping array. At probe time we have a fixed size array, later
- (when the card type is known) we allocate a minimal array
- dynamically. */
-
-#define ISIC_MAX_IO_MAPS 49 /* no cardtype needs more yet */
-
-/* one entry in mapping array */
-struct isic_io_map {
- bus_space_tag_t t; /* which bus-space is this? */
- bus_space_handle_t h; /* handle of mapped bus space region */
- bus_size_t offset; /* offset into region */
- bus_size_t size; /* size of region, zero if not ours
- (i.e.: don't ever unmap it!) */
-};
-
-/* this is passed around at probe time (no struct isic_softc yet) */
-struct isic_attach_args {
- int ia_flags; /* flags from config file */
- int ia_num_mappings; /* number of io mappings provided */
- struct isic_io_map ia_maps[ISIC_MAX_IO_MAPS];
-};
-#endif
-
-#ifdef __FreeBSD__
-extern int next_isic_unit;
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_Bchan: the state of one B channel
- *---------------------------------------------------------------------------*/
-typedef struct
-{
- int unit; /* cards unit number */
- int channel; /* which channel is this*/
-
-#ifdef __FreeBSD__
- caddr_t hscx; /* HSCX address */
-#endif
-
- u_char hscx_mask; /* HSCX interrupt mask */
-
- int bprot; /* B channel protocol */
-
- int state; /* this channels state */
-#define HSCX_IDLE 0x00 /* channel idle */
-#define HSCX_TX_ACTIVE 0x01 /* tx running */
-
- /* receive data from ISDN */
-
- struct ifqueue rx_queue; /* receiver queue */
-
- int rxcount; /* rx statistics counter*/
-
- struct mbuf *in_mbuf; /* rx input buffer */
- u_char *in_cbptr; /* curr buffer pointer */
- int in_len; /* rx input buffer len */
-
- /* transmit data to ISDN */
-
- struct ifqueue tx_queue; /* transmitter queue */
-
- int txcount; /* tx statistics counter*/
-
- struct mbuf *out_mbuf_head; /* first mbuf in possible chain */
- struct mbuf *out_mbuf_cur; /* current mbuf in possbl chain */
- unsigned char *out_mbuf_cur_ptr; /* data pointer into mbuf */
- int out_mbuf_cur_len; /* remaining bytes in mbuf */
-
- /* link between b channel and driver */
-
- isdn_link_t isdn_linktab; /* b channel addresses */
- drvr_link_t *drvr_linktab; /* ptr to driver linktab*/
-
- /* statistics */
-
- /* RSTA */
-
- int stat_VFR; /* HSCX RSTA Valid FRame */
- int stat_RDO; /* HSCX RSTA Rx Data Overflow */
- int stat_CRC; /* HSCX RSTA CRC */
- int stat_RAB; /* HSCX RSTA Rx message ABorted */
-
- /* EXIR */
-
- int stat_XDU; /* HSCX EXIR tx data underrun */
- int stat_RFO; /* HSCX EXIR rx frame overflow */
-
-} isic_Bchan_t;
-
-/*---------------------------------------------------------------------------*
- * isic_softc: the state of the layer 1 of the D channel
- *---------------------------------------------------------------------------*/
-struct isic_softc
-{
-#ifndef __FreeBSD__
- /* We are inherited from this class. All drivers must have this
- as their first entry in struct softc. */
- struct device sc_dev;
-#endif
-
- int sc_unit; /* unit number */
- int sc_irq; /* interrupt vector */
-
-#ifdef __FreeBSD__
- int sc_port; /* port base address */
-#else
- u_int sc_maddr; /* "memory address" for card config register */
- int sc_num_mappings; /* number of io mappings provided */
- struct isic_io_map *sc_maps;
-#define MALLOC_MAPS(sc) \
- (sc)->sc_maps = (struct isic_io_map*)malloc(sizeof((sc)->sc_maps[0])*(sc)->sc_num_mappings, M_DEVBUF, 0)
-#endif
-
- int sc_cardtyp; /* CARD_TYPEP_xxxx */
-
- int sc_bustyp; /* IOM1 or IOM2 */
-#define BUS_TYPE_IOM1 0x01
-#define BUS_TYPE_IOM2 0x02
-
- int sc_trace; /* output protocol data for tracing */
- unsigned int sc_trace_dcount;/* d channel trace frame counter */
- unsigned int sc_trace_bcount;/* b channel trace frame counter */
-
- int sc_state; /* ISAC state flag */
-#define ISAC_IDLE 0x00 /* state = idle */
-#define ISAC_TX_ACTIVE 0x01 /* state = transmitter active */
-
- int sc_init_tries; /* no of out tries to access S0 */
-
-#ifdef __FreeBSD__
- caddr_t sc_vmem_addr; /* card RAM virtual memory base */
- caddr_t sc_isac; /* ISAC port base addr */
-#define ISAC_BASE (sc->sc_isac)
-
- caddr_t sc_ipacbase; /* IPAC port base addr */
-#define IPAC_BASE (sc->sc_ipacbase)
-#endif
-
- u_char sc_isac_mask; /* ISAC IRQ mask */
-#define ISAC_IMASK (sc->sc_isac_mask)
-
- isic_Bchan_t sc_chan[2]; /* B-channel state */
-#define HSCX_A_BASE (sc->sc_chan[0].hscx)
-#define HSCX_A_IMASK (sc->sc_chan[0].hscx_mask)
-#define HSCX_B_BASE (sc->sc_chan[1].hscx)
-#define HSCX_B_IMASK (sc->sc_chan[1].hscx_mask)
-
- struct mbuf *sc_ibuf; /* input buffer mgmt */
- u_short sc_ilen;
- u_char *sc_ib;
- /* this is for the irq TX routine */
- struct mbuf *sc_obuf; /* pointer to an mbuf with TX frame */
- u_char *sc_op; /* ptr to next chunk of frame to tx */
- int sc_ol; /* length of remaining frame to tx */
- int sc_freeflag; /* m_freem mbuf if set */
-
- struct mbuf *sc_obuf2; /* pointer to an mbuf with TX frame */
- int sc_freeflag2; /* m_freem mbuf if set */
-
- int sc_isac_version; /* version number of ISAC */
- int sc_hscx_version; /* version number of HSCX */
-
- int sc_I430state; /* I.430 state F3 .... F8 */
-
- int sc_I430T3; /* I.430 Timer T3 running */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- struct callout_handle sc_T3_callout;
-#endif
-
- int sc_I430T4; /* Timer T4 running */
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- struct callout_handle sc_T4_callout;
-#endif
-
- int sc_enabled; /* daemon is running */
-
- int sc_ipac; /* flag, running on ipac */
- int sc_bfifolen; /* length of b channel fifos */
-
-#ifdef __FreeBSD__
-
- u_char (*readreg)(u_char *, u_int);
- void (*writereg)(u_char *, u_int, u_int);
- void (*readfifo)(void *, const void *, size_t);
- void (*writefifo)(void *, const void *, size_t);
- void (*clearirq)(void *);
-
-#define ISAC_READ(r) (*sc->readreg)(ISAC_BASE, (r))
-#define ISAC_WRITE(r,v) (*sc->writereg)(ISAC_BASE, (r), (v));
-#define ISAC_RDFIFO(b,s) (*sc->readfifo)((b), ISAC_BASE, (s))
-#define ISAC_WRFIFO(b,s) (*sc->writefifo)(ISAC_BASE, (b), (s))
-
-#define HSCX_READ(n,r) (*sc->readreg)(sc->sc_chan[(n)].hscx, (r))
-#define HSCX_WRITE(n,r,v) (*sc->writereg)(sc->sc_chan[(n)].hscx, (r), (v))
-#define HSCX_RDFIFO(n,b,s) (*sc->readfifo)((b), sc->sc_chan[(n)].hscx, (s))
-#define HSCX_WRFIFO(n,b,s) (*sc->writefifo)(sc->sc_chan[(n)].hscx, (b), (s))
-
-#define IPAC_READ(r) (*sc->readreg)(IPAC_BASE, (r))
-#define IPAC_WRITE(r,v) (*sc->writereg)(IPAC_BASE, (r), (v));
-
-#else /* ! __FreeBSD__ */
-
-#define ISIC_WHAT_ISAC 0
-#define ISIC_WHAT_HSCXA 1
-#define ISIC_WHAT_HSCXB 2
-#define ISIC_WHAT_IPAC 3
-
- u_int8_t (*readreg) __P((struct isic_softc *sc, int what, bus_size_t offs));
- void (*writereg) __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
- void (*readfifo) __P((struct isic_softc *sc, int what, void *buf, size_t size));
- void (*writefifo) __P((struct isic_softc *sc, int what, const void *data, size_t size));
- void (*clearirq) __P((struct isic_softc *sc));
-
-#define ISAC_READ(r) (*sc->readreg)(sc, ISIC_WHAT_ISAC, (r))
-#define ISAC_WRITE(r,v) (*sc->writereg)(sc, ISIC_WHAT_ISAC, (r), (v))
-#define ISAC_RDFIFO(b,s) (*sc->readfifo)(sc, ISIC_WHAT_ISAC, (b), (s))
-#define ISAC_WRFIFO(b,s) (*sc->writefifo)(sc, ISIC_WHAT_ISAC, (b), (s))
-
-#define HSCX_READ(n,r) (*sc->readreg)(sc, ISIC_WHAT_HSCXA+(n), (r))
-#define HSCX_WRITE(n,r,v) (*sc->writereg)(sc, ISIC_WHAT_HSCXA+(n), (r), (v))
-#define HSCX_RDFIFO(n,b,s) (*sc->readfifo)(sc, ISIC_WHAT_HSCXA+(n), (b), (s))
-#define HSCX_WRFIFO(n,b,s) (*sc->writefifo)(sc, ISIC_WHAT_HSCXA+(n), (b), (s))
-
-#define IPAC_READ(r) (*sc->readreg)(sc, ISIC_WHAT_IPAC, (r))
-#define IPAC_WRITE(r, v) (*sc->writereg)(sc, ISIC_WHAT_IPAC, (r), (v))
-
-#endif /* __FreeBSD__ */
-};
-
-/*---------------------------------------------------------------------------*
- * possible I.430/ISAC states
- *---------------------------------------------------------------------------*/
-enum I430states {
- ST_F3, /* F3 Deactivated */
- ST_F4, /* F4 Awaiting Signal */
- ST_F5, /* F5 Identifying Input */
- ST_F6, /* F6 Synchronized */
- ST_F7, /* F7 Activated */
- ST_F8, /* F8 Lost Framing */
- ST_ILL, /* Illegal State */
- N_STATES
-};
-
-/*---------------------------------------------------------------------------*
- * possible I.430/ISAC events
- *---------------------------------------------------------------------------*/
-enum I430events {
- EV_PHAR, /* PH ACTIVATE REQUEST */
- EV_T3, /* Timer 3 expired */
- EV_INFO0, /* receiving INFO0 */
- EV_RSY, /* receiving any signal */
- EV_INFO2, /* receiving INFO2 */
- EV_INFO48, /* receiving INFO4 pri 8/9 */
- EV_INFO410, /* receiving INFO4 pri 10/11 */
- EV_DR, /* Deactivate Request */
- EV_PU, /* Power UP */
- EV_DIS, /* Disconnected (only 2085) */
- EV_EI, /* Error Indication */
- EV_ILL, /* Illegal Event */
- N_EVENTS
-};
-
-enum I430commands {
- CMD_TIM, /* Timing */
- CMD_RS, /* Reset */
- CMD_AR8, /* Activation request pri 8 */
- CMD_AR10, /* Activation request pri 10 */
- CMD_DIU, /* Deactivate Indication Upstream */
- CMD_ILL /* Illegal command */
-};
-
-#define N_COMMANDS CMD_ILL
-
-#ifdef __FreeBSD__
-
-extern struct isic_softc isic_sc[];
-
-extern void isic_recover(struct isic_softc *sc);
-extern int isic_realattach(struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_avma1 ( struct isa_device *dev );
-extern int isic_attach_fritzpcmcia ( struct isa_device *dev );
-extern int isic_attach_Cs0P ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_Dyn ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_s016 ( struct isa_device *dev );
-extern int isic_attach_s0163 ( struct isa_device *dev );
-extern int isic_attach_s0163P ( struct isa_device *dev );
-extern int isic_attach_s08 ( struct isa_device *dev );
-extern int isic_attach_usrtai ( struct isa_device *dev );
-extern int isic_attach_itkix1 ( struct isa_device *dev );
-extern int isic_attach_drnngo ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_sws ( struct isa_device *dev );
-extern int isic_attach_Eqs1pi(struct isa_device *dev, unsigned int iobase2);
-extern int isic_attach_Eqs1pp(int unit, unsigned int iobase1, unsigned int iobase2);
-extern void isic_bchannel_setup (int unit, int hscx_channel, int bprot, int activate );
-extern void isic_hscx_init ( struct isic_softc *sc, int hscx_channel, int activate );
-extern void isic_hscx_irq ( struct isic_softc *sc, u_char ista, int hscx_channel, u_char ex_irq );
-extern int isic_hscx_silence ( unsigned char *data, int len );
-extern void isic_hscx_cmd( struct isic_softc *sc, int h_chan, unsigned char cmd );
-extern void isic_hscx_waitxfw( struct isic_softc *sc, int h_chan );
-extern void isic_init_linktab ( struct isic_softc *sc );
-extern int isic_isac_init ( struct isic_softc *sc );
-extern void isic_isac_irq ( struct isic_softc *sc, int r );
-extern void isic_isac_l1_cmd ( struct isic_softc *sc, int command );
-extern void isic_next_state ( struct isic_softc *sc, int event );
-extern char *isic_printstate ( struct isic_softc *sc );
-extern int isic_probe_avma1 ( struct isa_device *dev );
-extern int isic_probe_avma1_pcmcia ( struct isa_device *dev );
-extern int isic_probe_Cs0P ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_probe_Dyn ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_probe_s016 ( struct isa_device *dev );
-extern int isic_probe_s0163 ( struct isa_device *dev );
-extern int isic_probe_s0163P ( struct isa_device *dev );
-extern int isic_probe_s08 ( struct isa_device *dev );
-extern int isic_probe_usrtai ( struct isa_device *dev );
-extern int isic_probe_itkix1 ( struct isa_device *dev );
-extern int isic_probe_drnngo ( struct isa_device *dev, unsigned int iobase2);
-extern int isic_probe_sws ( struct isa_device *dev );
-extern int isic_probe_Eqs1pi(struct isa_device *dev, unsigned int iobase2);
-
-#else /* not FreeBSD */
-
-extern void isic_recover __P((struct isic_softc *sc));
-extern int isicattach __P((int flags, struct isic_softc *sc));
-extern int isicintr __P((void *));
-extern int isicprobe __P((struct isic_attach_args *ia));
-extern int isic_attach_avma1 __P((struct isic_softc *sc));
-extern int isic_attach_s016 __P((struct isic_softc *sc));
-extern int isic_attach_s0163 __P((struct isic_softc *sc));
-extern int isic_attach_s08 __P((struct isic_softc *sc));
-extern int isic_attach_usrtai __P((struct isic_softc *sc));
-extern int isic_attach_itkix1 __P((struct isic_softc *sc));
-extern void isic_bchannel_setup __P((int unit, int hscx_channel, int bprot, int activate));
-extern void isic_hscx_init __P((struct isic_softc *sc, int hscx_channel, int activate));
-extern void isic_hscx_irq __P((struct isic_softc *sc, u_char ista, int hscx_channel, u_char ex_irq));
-extern int isic_hscx_silence __P(( unsigned char *data, int len ));
-extern void isic_hscx_cmd __P(( struct isic_softc *sc, int h_chan, unsigned char cmd ));
-extern void isic_hscx_waitxfw __P(( struct isic_softc *sc, int h_chan ));
-extern void isic_init_linktab __P((struct isic_softc *sc));
-extern int isic_isac_init __P((struct isic_softc *sc));
-extern void isic_isac_irq __P((struct isic_softc *sc, int r));
-extern void isic_isac_l1_cmd __P((struct isic_softc *sc, int command));
-extern void isic_next_state __P((struct isic_softc *sc, int event));
-extern char * isic_printstate __P((struct isic_softc *sc));
-extern int isic_probe_avma1 __P((struct isic_attach_args *ia));
-extern int isic_probe_s016 __P((struct isic_attach_args *ia));
-extern int isic_probe_s0163 __P((struct isic_attach_args *ia));
-extern int isic_probe_s08 __P((struct isic_attach_args *ia));
-extern int isic_probe_usrtai __P((struct isic_attach_args *ia));
-extern int isic_probe_itkix1 __P((struct isic_attach_args *ia));
-
-extern struct isic_softc *isic_sc[];
-
-#define isic_find_sc(unit) (isic_sc[(unit)])
-
-#endif /* __FreeBSD__ */
-
-#endif /* I4B_L1_H_ */
diff --git a/sys/i4b/layer1/i4b_l1fsm.c b/sys/i4b/layer1/i4b_l1fsm.c
deleted file mode 100644
index 397ce11f711cc..0000000000000
--- a/sys/i4b/layer1/i4b_l1fsm.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l1fsm.c - isdn4bsd layer 1 I.430 state machine
- * --------------------------------------------------
- *
- * $Id: i4b_l1fsm.c,v 1.26 1998/12/05 18:04:55 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:25:12 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#else
-#define NISIC 1
-#endif
-
-#if NISIC > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <machine/stdarg.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-
-static char *state_text[N_STATES] = {
- "F3 Deactivated",
- "F4 Awaiting Signal",
- "F5 Identifying Input",
- "F6 Synchronized",
- "F7 Activated",
- "F8 Lost Framing",
- "Illegal State"
-};
-
-static char *event_text[N_EVENTS] = {
- "EV_PHAR PH_ACT_REQ",
- "EV_T3 Timer 3 expired",
- "EV_INFO0 INFO0 received",
- "EV_RSY Level Detected",
- "EV_INFO2 INFO2 received",
- "EV_INFO48 INFO4 received",
- "EV_INFO410 INFO4 received",
- "EV_DR Deactivate Req",
- "EV_PU Power UP",
- "EV_DIS Disconnected",
- "EV_EI Error Ind",
- "Illegal Event"
-};
-
-/* Function prototypes */
-
-static void timer3_expired (struct isic_softc *sc);
-static void T3_start (struct isic_softc *sc);
-static void T3_stop (struct isic_softc *sc);
-static void F_T3ex (struct isic_softc *sc);
-static void timer4_expired (struct isic_softc *sc);
-static void T4_start (struct isic_softc *sc);
-static void T4_stop (struct isic_softc *sc);
-static void F_AI8 (struct isic_softc *sc);
-static void F_AI10 (struct isic_softc *sc);
-static void F_I01 (struct isic_softc *sc);
-static void F_I02 (struct isic_softc *sc);
-static void F_I03 (struct isic_softc *sc);
-static void F_I2 (struct isic_softc *sc);
-static void F_ill (struct isic_softc *sc);
-static void F_NULL (struct isic_softc *sc);
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer3_expired(struct isic_softc *sc)
-{
- if(sc->sc_I430T3)
- {
- DBGL1(L1_T_ERR, "timer3_expired", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T3 = 0;
-
- /* XXX try some recovery here XXX */
-
- isic_recover(sc);
-
- sc->sc_init_tries++; /* increment retry count */
-
-/*XXX*/ if(sc->sc_init_tries > 4)
- {
- int s = SPLI4B();
-
- sc->sc_init_tries = 0;
-
- if(sc->sc_obuf2 != NULL)
- {
- i4b_Dfreembuf(sc->sc_obuf2);
- sc->sc_obuf2 = NULL;
- }
- if(sc->sc_obuf != NULL)
- {
- i4b_Dfreembuf(sc->sc_obuf);
- sc->sc_obuf = NULL;
- sc->sc_freeflag = 0;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- }
-
- splx(s);
-
- MPH_Status_Ind(sc->sc_unit, STI_NOL1ACC, 0);
- }
-
- isic_next_state(sc, EV_T3);
- }
- else
- {
- DBGL1(L1_T_ERR, "timer3_expired", ("expired without starting it ....\n"));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 start
- *---------------------------------------------------------------------------*/
-static void
-T3_start(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T3_start", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T3 = 1;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc, 2*hz);
-#else
- timeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc, 2*hz);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 stop
- *---------------------------------------------------------------------------*/
-static void
-T3_stop(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T3_stop", ("state = %s\n", isic_printstate(sc)));
-
- sc->sc_init_tries = 0; /* init connect retry count */
-
- if(sc->sc_I430T3)
- {
- sc->sc_I430T3 = 0;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc, sc->sc_T3_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct isic_softc *)sc);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_T3ex(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_T3ex", ("FSM function F_T3ex executing\n"));
- PH_Deact_Ind(sc->sc_unit);
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer4_expired(struct isic_softc *sc)
-{
- if(sc->sc_I430T4)
- {
- DBGL1(L1_T_ERR, "timer4_expired", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T4 = 0;
- MPH_Status_Ind(sc->sc_unit, STI_PDEACT, 0);
- }
- else
- {
- DBGL1(L1_T_ERR, "timer4_expired", ("expired without starting it ....\n"));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 start
- *---------------------------------------------------------------------------*/
-static void
-T4_start(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T4_start", ("state = %s\n", isic_printstate(sc)));
- sc->sc_I430T4 = 1;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc, hz);
-#else
- timeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc, hz);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 stop
- *---------------------------------------------------------------------------*/
-static void
-T4_stop(struct isic_softc *sc)
-{
- DBGL1(L1_T_MSG, "T4_stop", ("state = %s\n", isic_printstate(sc)));
-
- if(sc->sc_I430T4)
- {
- sc->sc_I430T4 = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc, sc->sc_T4_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct isic_softc *)sc);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI8
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct isic_softc *sc)
-{
- T4_stop(sc);
-
- DBGL1(L1_F_MSG, "F_AI8", ("FSM function F_AI8 executing\n"));
-
- PH_Act_Ind(sc->sc_unit);
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_8;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI10
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct isic_softc *sc)
-{
- T4_stop(sc);
-
- DBGL1(L1_F_MSG, "F_AI10", ("FSM function F_AI10 executing\n"));
-
- PH_Act_Ind(sc->sc_unit);
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_10;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in states F3 .. F5
- *---------------------------------------------------------------------------*/
-static void
-F_I01(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I01", ("FSM function F_I01 executing\n"));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F6
- *---------------------------------------------------------------------------*/
-static void
-F_I02(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I02", ("FSM function F_I02 executing\n"));
-
- PH_Deact_Ind(sc->sc_unit);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F7 or F8
- *---------------------------------------------------------------------------*/
-static void
-F_I03(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I03", ("FSM function F_I03 executing\n"));
-
- PH_Deact_Ind(sc->sc_unit);
-
- T4_start(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: activate request
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_AR", ("FSM function F_AR executing\n"));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO1_8;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_TE;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-
- isic_isac_l1_cmd(sc, CMD_AR8);
-
- T3_start(sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO2
- *---------------------------------------------------------------------------*/
-static void
-F_I2(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_I2", ("FSM function F_I2 executing\n"));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO2;
-
- hdr.unit = sc->sc_unit;
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- MPH_Trace_Ind(&hdr, 1, &info);
- }
-
-}
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(struct isic_softc *sc)
-{
- DBGL1(L1_F_ERR, "F_ill", ("FSM function F_ill executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * No action
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct isic_softc *sc)
-{
- DBGL1(L1_F_MSG, "F_NULL", ("FSM function F_NULL executing\n"));
-}
-
-
-/*---------------------------------------------------------------------------*
- * layer 1 state transition table
- *---------------------------------------------------------------------------*/
-struct isic_state_tab {
- void (*func) (struct isic_softc *sc); /* function to execute */
- int newstate; /* next state */
-} isic_state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: F3 F4 F5 F6 F7 F8 ILLEGAL STATE */
-/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/* EV_PHAR x*/ {{F_AR, ST_F4}, {F_NULL, ST_F4}, {F_NULL, ST_F5}, {F_NULL, ST_F6}, {F_ill, ST_ILL}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_T3 x*/ {{F_NULL, ST_F3}, {F_T3ex, ST_F3}, {F_T3ex, ST_F3}, {F_T3ex, ST_F3}, {F_NULL, ST_F7}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_INFO0 */ {{F_I01, ST_F3}, {F_I01, ST_F4}, {F_I01, ST_F5}, {F_I02, ST_F3}, {F_I03, ST_F3}, {F_I03, ST_F3}, {F_ill, ST_ILL}},
-/* EV_RSY x*/ {{F_NULL, ST_F3}, {F_NULL, ST_F5}, {F_NULL, ST_F5}, {F_NULL, ST_F8}, {F_NULL, ST_F8}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_INFO2 */ {{F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_I2, ST_F6}, {F_ill, ST_ILL}},
-/* EV_INFO48*/ {{F_AI8, ST_F7}, {F_AI8, ST_F7}, {F_AI8, ST_F7}, {F_AI8, ST_F7}, {F_NULL, ST_F7}, {F_AI8, ST_F7}, {F_ill, ST_ILL}},
-/* EV_INFO41*/ {{F_AI10, ST_F7}, {F_AI10, ST_F7}, {F_AI10, ST_F7}, {F_AI10, ST_F7}, {F_NULL, ST_F7}, {F_AI10, ST_F7}, {F_ill, ST_ILL}},
-/* EV_DR */ {{F_NULL, ST_F3}, {F_NULL, ST_F4}, {F_NULL, ST_F5}, {F_NULL, ST_F6}, {F_NULL, ST_F7}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_PU */ {{F_NULL, ST_F3}, {F_NULL, ST_F4}, {F_NULL, ST_F5}, {F_NULL, ST_F6}, {F_NULL, ST_F7}, {F_NULL, ST_F8}, {F_ill, ST_ILL}},
-/* EV_DIS */ {{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_EI */ {{F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_NULL, ST_F3}, {F_ill, ST_ILL}},
-/* EV_ILL */ {{F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}}
-};
-
-/*---------------------------------------------------------------------------*
- * event handler
- *---------------------------------------------------------------------------*/
-void
-isic_next_state(struct isic_softc *sc, int event)
-{
- int currstate, newstate;
-
- if(event >= N_EVENTS)
- panic("i4b_l1fsm.c: event >= N_EVENTS\n");
-
- currstate = sc->sc_I430state;
-
- if(currstate >= N_STATES)
- panic("i4b_l1fsm.c: currstate >= N_STATES\n");
-
- newstate = isic_state_tab[event][currstate].newstate;
-
- if(newstate >= N_STATES)
- panic("i4b_l1fsm.c: newstate >= N_STATES\n");
-
- DBGL1(L1_F_MSG, "isic_next_state", ("FSM event [%s]: [%s => %s]\n", event_text[event],
- state_text[currstate],
- state_text[newstate]));
-
- (*isic_state_tab[event][currstate].func)(sc);
-
- if(newstate == ST_ILL)
- {
- newstate = ST_F3;
- DBGL1(L1_F_ERR, "isic_next_state", ("FSM Illegal State ERROR, oldstate = %s, newstate = %s, event = %s!\n",
- state_text[currstate],
- state_text[newstate],
- event_text[event]));
- }
-
- sc->sc_I430state = newstate;
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-isic_printstate(struct isic_softc *sc)
-{
- return((char *) state_text[sc->sc_I430state]);
-}
-
-#endif /* NISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_sws.c b/sys/i4b/layer1/i4b_sws.c
deleted file mode 100644
index c5182b49e3d79..0000000000000
--- a/sys/i4b/layer1/i4b_sws.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright (c) 1998 German Tischler. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * Card format:
- *
- * iobase + 0 : reset on (0x03)
- * iobase + 1 : reset off (0x0)
- * iobase + 2 : isac read/write
- * iobase + 3 : hscx read/write ( offset 0-0x3f hscx0 ,
- * offset 0x40-0x7f hscx1 )
- * iobase + 4 : offset for indirect adressing
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for SWS cards
- * ====================================================
- *
- * EXPERIMENTAL !!!!
- * =================
- *
- * $Id: i4b_sws.c,v 1.12 1998/12/18 09:32:45 hm Exp $
- *
- * last edit-date: [Sun Dec 13 10:49:25 1998]
- *
- * -hm adding driver to i4b
- * -hm adjustments for FreeBSD < 2.2.6, no PnP support yet
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-
-#include "isic.h"
-#include "opt_i4b.h"
-
-#else
-
-#define NISIC 1
-
-#endif
-
-#if defined (SEDLBAUER) && NISIC > 0
-
-#define SWS_RESON 0 /* reset on */
-#define SWS_RESOFF 1 /* reset off */
-#define SWS_ISAC 2 /* ISAC */
-#define SWS_HSCX0 3 /* HSCX0 */
-#define SWS_RW 4 /* indirect access register */
-#define SWS_HSCX1 5 /* this is for fakeing that we mean hscx1, though */
- /* access is done through hscx0 */
-
-#define SWS_REGS 8 /* we use an area of 8 bytes for io */
-
-#define SWS_BASE(X) ((unsigned int)X&~(SWS_REGS-1))
-#define SWS_PART(X) ((unsigned int)X& (SWS_REGS-1))
-#define SWS_ADDR(X) ((SWS_PART(X) == SWS_ISAC) ? (SWS_BASE(X)+SWS_ISAC) : (SWS_BASE(X)+SWS_HSCX0) )
-#define SWS_REG(X,Y) ((SWS_PART(X) != SWS_HSCX1) ? Y : (Y+0x40) )
-#define SWS_IDO(X) (SWS_BASE(X)+SWS_RW)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t sws_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void sws_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void sws_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void sws_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_sws __P((struct isic_softc *sc));
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-static void
-sws_read_fifo(void *buf, const void *base, size_t len)
-{
- outb(SWS_IDO(base),SWS_REG(base,0));
- insb(SWS_ADDR(base),buf,len);
-}
-
-#else
-
-static void
-sws_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_read_multi_1(t, h, SWS_ISAC, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_read_multi_1(t, h, SWS_HSCX0, buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40);
- bus_space_read_multi_1(t, h, SWS_HSCX0, buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-static void
-sws_write_fifo(void *base, const void *buf, size_t len)
-{
- outb (SWS_IDO(base),SWS_REG(base,0));
- outsb(SWS_ADDR(base),buf,len);
-}
-
-#else
-
-static void
-sws_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_write_multi_1(t, h, SWS_ISAC, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, 0);
- bus_space_write_multi_1(t, h, SWS_HSCX0, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40);
- bus_space_write_multi_1(t, h, SWS_HSCX0, (u_int8_t*)buf, size);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC put register routine
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-
-static void
-sws_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb(SWS_IDO(base),SWS_REG(base,offset));
- outb(SWS_ADDR(base),v);
-}
-
-#else
-
-static void
-sws_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, offs);
- bus_space_write_1(t, h, SWS_ISAC, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, offs);
- bus_space_write_1(t, h, SWS_HSCX0, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40+offs);
- bus_space_write_1(t, h, SWS_HSCX0, data);
- break;
- }
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-sws_read_reg(u_char *base, u_int offset)
-{
- outb(SWS_IDO(base),SWS_REG(base,offset));
- return inb(SWS_ADDR(base));
-}
-
-#else
-
-static u_int8_t
-sws_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, SWS_RW, offs);
- return bus_space_read_1(t, h, SWS_ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, SWS_RW, offs);
- return bus_space_read_1(t, h, SWS_HSCX0);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, SWS_RW, 0x40+offs);
- return bus_space_read_1(t, h, SWS_HSCX0);
- }
- return 0;
-}
-
-#endif
-
-#ifdef __FreeBSD__
-
-/* attach callback routine */
-
-int
-isic_attach_sws(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* fill in isic_softc structure */
-
- sc->readreg = sws_read_reg;
- sc->writereg = sws_write_reg;
- sc->readfifo = sws_read_fifo;
- sc->writefifo = sws_write_fifo;
- sc->clearirq = NULL;
- sc->sc_unit = dev->id_unit;
- sc->sc_irq = dev->id_irq;
- sc->sc_port = dev->id_iobase;
- sc->sc_cardtyp = CARD_TYPEP_SWS;
- sc->sc_bustyp = BUS_TYPE_IOM2;
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
- dev->id_msize = 0;
-
- ISAC_BASE = (caddr_t) (((u_int) sc->sc_port) + SWS_ISAC);
- HSCX_A_BASE = (caddr_t) (((u_int) sc->sc_port) + SWS_HSCX0);
- HSCX_B_BASE = (caddr_t) (((u_int) sc->sc_port) + SWS_HSCX1);
-
- /*
- * Read HSCX A/B VSTR. Expected value for the SWS PnP card is
- * 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for SWS PnP\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- /* reset card */
-
- outb( ((u_int) sc->sc_port) + SWS_RESON , 0x3);
- DELAY(SEC_DELAY / 5);
- outb( ((u_int) sc->sc_port) + SWS_RESOFF, 0);
- DELAY(SEC_DELAY / 5);
-
- return(1);
-}
-
-#else /* !__FreeBSD__ */
-
-void
-isic_attach_sws(struct isic_softc *sc)
-{
- /* setup access routines */
-
- sc->readreg = sws_read_reg;
- sc->writereg = sws_write_reg;
-
- sc->readfifo = sws_read_fifo;
- sc->writefifo = sws_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_SWS;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /*
- * Read HSCX A/B VSTR. Expected value for the SWS PnP card is
- * 0x05 ( = version 2.1 ) in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("%s: HSCX VSTR test failed for SWS PnP\n",
- sc->sc_dev.dv_xname);
- printf("%s: HSC0: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR));
- printf("%s: HSC1: VSTR: %#x\n",
- sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR));
- return;
- }
-
- /* reset card */
- {
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, SWS_RESON, 0x3);
- DELAY(SEC_DELAY / 5);
- bus_space_write_1(t, h, SWS_RESOFF, 0);
- DELAY(SEC_DELAY / 5);
- }
-}
-
-#endif /* !__FreeBSD__ */
-
-#endif /* defined(SEDLBAUER) && NISIC > 0 */
diff --git a/sys/i4b/layer1/i4b_tel_s016.c b/sys/i4b/layer1/i4b_tel_s016.c
deleted file mode 100644
index f77a3c184241d..0000000000000
--- a/sys/i4b/layer1/i4b_tel_s016.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0/16 and clones
- * =================================================================
- *
- * $Id: i4b_tel_s016.c,v 1.12 1998/12/05 18:04:56 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:40:17 1998]
- *
- * -hm clean up
- * -hm checked with a Creatix ISDN-S0 (PCB version: mp 130.1)
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- * -hm converting asm -> C
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_16)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <machine/md_var.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char intr_no[] = { 1, 1, 0, 2, 4, 6, 1, 1, 1, 0, 8, 10, 12, 1, 1, 14 };
-
-#ifndef __FreeBSD__
-static u_int8_t tels016_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels016_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels016_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void tels016_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 write register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels016_write_reg(u_char *base, u_int i, u_int v)
-{
- if(i & 0x01)
- i |= 0x200;
- base[i] = v;
-}
-
-#else
-
-static const bus_size_t offset[] = { 0x100, 0x180, 0x1c0 };
-
-static void
-tels016_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
-
- offs += offset[what];
- if (offs & 0x01)
- offs |= 0x200;
-
- bus_space_write_1(t, h, offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 read register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels016_read_reg(u_char *base, u_int i)
-{
- if(i & 0x1)
- i |= 0x200;
- return(base[i]);
-}
-
-#else
-
-static u_int8_t
-tels016_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
-
- offs += offset[what];
-
- if(offs & 0x01)
- offs |= 0x200;
-
- return bus_space_read_1(t, h, offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 fifo read/write routines
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels016_memcpyb(void *to, const void *from, size_t len)
-{
- for(;len > 0; len--)
- *((unsigned char *)to)++ = *((unsigned char *)from)++;
-}
-
-#else
-
-static void
-tels016_write_fifo(struct isic_softc *sc, int what, const void *data, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- bus_space_write_region_1(t, h, offset[what], data, size);
-}
-
-static void
-tels016_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[1].t;
- bus_space_handle_t h = sc->sc_maps[1].h;
- bus_space_read_region_1(t, h, offset[what], buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s016 - probe for Teles S0/16 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_s016(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char byte;
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/16!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- if((intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0xd80:
- case 0xe80:
- case 0xf80:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* check if valid memory addr */
-
- switch((unsigned int)kvtop(dev->id_maddr))
- {
- case 0xc0000:
- case 0xc2000:
- case 0xc4000:
- case 0xc6000:
- case 0xc8000:
- case 0xca000:
- case 0xcc000:
- case 0xce000:
- case 0xd0000:
- case 0xd2000:
- case 0xd4000:
- case 0xd6000:
- case 0xd8000:
- case 0xda000:
- case 0xdc000:
- case 0xde000:
- break;
-
- default:
- printf("isic%d: Error, invalid mem addr 0x%lx for Teles S0/16!\n",
- dev->id_unit, kvtop(dev->id_maddr));
- return(0);
- break;
- }
- sc->sc_vmem_addr = (caddr_t) dev->id_maddr;
- dev->id_msize = 0x1000;
-
- /* check card signature */
-
- if((byte = inb(sc->sc_port)) != 0x51)
- {
- printf("isic%d: Error, signature 1 0x%x != 0x51 for Teles S0/16!\n",
- dev->id_unit, byte);
- return(0);
- }
-
- if((byte = inb(sc->sc_port + 1)) != 0x93)
- {
- printf("isic%d: Error, signature 2 0x%x != 0x93 for Teles S0/16!\n",
- dev->id_unit, byte);
- return(0);
- }
-
- byte = inb(sc->sc_port + 2);
-
- if((byte != 0x1e) && (byte != 0x1f))
- {
- printf("isic%d: Error, signature 3 0x%x != 0x1e or 0x1f for Teles S0/16!\n",
- dev->id_unit, byte);
- return(0);
- }
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels016_read_reg;
- sc->writereg = tels016_write_reg;
-
- sc->readfifo = tels016_memcpyb;
- sc->writefifo = tels016_memcpyb;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC base addr */
-
- ISAC_BASE = (caddr_t) ((dev->id_maddr) + 0x100);
-
- /* setup HSCX base addr */
-
- HSCX_A_BASE = (caddr_t) ((dev->id_maddr) + 0x180);
- HSCX_B_BASE = (caddr_t) ((dev->id_maddr) + 0x1c0);
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_s016(struct isic_attach_args *ia)
-{
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t b0, b1, b2;
-
- b0 = bus_space_read_1(t, h, 0);
- b1 = bus_space_read_1(t, h, 1);
- b2 = bus_space_read_1(t, h, 2);
-
- if (b0 == 0x51 && b1 == 0x93 && (b2 == 0x1e || b2 == 0x1f))
- return 1;
-
- return 0;
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s016 - attach Teles S0/16 and compatibles
- *---------------------------------------------------------------------------*/
-int
-#ifdef __FreeBSD__
-isic_attach_s016(struct isa_device *dev)
-#else
-isic_attach_s016(struct isic_softc *sc)
-#endif
-{
-
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-#endif
-
- u_long irq;
-
-#ifndef __FreeBSD__
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels016_read_reg;
- sc->writereg = tels016_write_reg;
-
- sc->readfifo = tels016_read_fifo;
- sc->writefifo = tels016_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
-#endif
-
-#ifdef __FreeBSD__
- if((irq = intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Attach error, invalid IRQ [%d] specified for Teles S0/16!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
-#else
- irq = intr_no[sc->sc_irq];
-#endif
-
- /* configure IRQ */
-
-#ifdef __FreeBSD__
- irq |= ((u_long) sc->sc_vmem_addr) >> 9;
-
- DELAY(SEC_DELAY / 10);
- outb(sc->sc_port + 4, irq);
-
- DELAY(SEC_DELAY / 10);
- outb(sc->sc_port + 4, irq | 0x01);
-
- DELAY(SEC_DELAY / 5);
-
- /* set card bit off */
-
- sc->sc_vmem_addr[0x80] = 0;
- DELAY(SEC_DELAY / 5);
-
- /* set card bit on */
-
- sc->sc_vmem_addr[0x80] = 1;
- DELAY(SEC_DELAY / 5);
-
-#else
-
- irq |= ((sc->sc_maddr >> 9) & 0x000000f0);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, 4, irq);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, 4, irq | 0x01);
-
- DELAY(SEC_DELAY / 5);
-
- /* set card bit off */
-
- bus_space_write_1(sc->sc_maps[1].t, sc->sc_maps[1].h, 0x80, 0);
- DELAY(SEC_DELAY / 5);
-
- /* set card bit on */
-
- bus_space_write_1(sc->sc_maps[1].t, sc->sc_maps[1].h, 0x80, 1);
- DELAY(SEC_DELAY / 5);
-#endif
-
- return (1);
-}
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_tel_s0163.c b/sys/i4b/layer1/i4b_tel_s0163.c
deleted file mode 100644
index 5fdd32961b735..0000000000000
--- a/sys/i4b/layer1/i4b_tel_s0163.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0/16.3
- * ========================================================
- *
- * $Id: i4b_tel_s0163.c,v 1.15 1998/12/05 18:04:58 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:40:58 1998]
- *
- * -hm clean up
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- * -hm VSTR detection for older 16.3 cards
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_16_3)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char intr_no[] = { 1, 1, 0, 2, 4, 6, 1, 1, 1, 0, 8, 10, 12, 1, 1, 14 };
-
-#ifndef __FreeBSD__
-static u_int8_t tels0163_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels0163_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels0163_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void tels0163_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 read fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_read_multi_1(t, h, o + 0x1e, buf, size);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 write fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_multi_1(t, h, o + 0x1e, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 ISAC put register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-
-#else
-
-static void
-tels0163_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_1(t, h, o + offs - 0x20, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 ISAC get register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels0163_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-
-#else
-
-static u_int8_t
-tels0163_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- return bus_space_read_1(t, h, o + offs - 0x20);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s0163 - probe for Teles S0/16.3 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_s0163(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
- u_char byte;
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/16.3!",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- if((intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16.3!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Teles S0/16.3!",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
-
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0xd80:
- case 0xe80:
- case 0xf80:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16.3!",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- if((byte = inb(sc->sc_port)) != 0x51)
- {
- printf("isic%d: Error, signature 1 0x%x != 0x51 for Teles S0/16.3!",
- dev->id_unit, byte);
- return(0);
- }
-
- if((byte = inb(sc->sc_port + 1)) != 0x93)
- {
- printf("isic%d: Error, signature 2 0x%x != 0x93 for Teles S0/16.3!",
- dev->id_unit, byte);
- return(0);
- }
-
- if((byte = inb(sc->sc_port + 2)) != 0x1c)
- {
- printf("isic%d: Error, signature 3 0x%x != 0x1c for Teles S0/16.3!",
- dev->id_unit, byte);
- return(0);
- }
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163_read_reg;
- sc->writereg = tels0163_write_reg;
-
- sc->readfifo = tels0163_read_fifo;
- sc->writefifo = tels0163_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16_3;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- switch(dev->id_iobase)
- {
- case 0xd80:
- ISAC_BASE = (caddr_t) 0x960;
- HSCX_A_BASE = (caddr_t) 0x160;
- HSCX_B_BASE = (caddr_t) 0x560;
- break;
-
- case 0xe80:
- ISAC_BASE = (caddr_t) 0xa60;
- HSCX_A_BASE = (caddr_t) 0x260;
- HSCX_B_BASE = (caddr_t) 0x660;
- break;
-
- case 0xf80:
- ISAC_BASE = (caddr_t) 0xb60;
- HSCX_A_BASE = (caddr_t) 0x360;
- HSCX_B_BASE = (caddr_t) 0x760;
- break;
- }
-
- /*
- * Read HSCX A/B VSTR. Expected value for the S0/16.3 card is
- * 0x05 or 0x04 (for older 16.3's) in the least significant bits.
- */
-
- if( (((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(0, H_VSTR) & 0xf) != 0x4)) ||
- (((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) &&
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x4)) )
- {
- printf("isic%d: HSCX VSTR test failed for Teles S0/16.3\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_s0163(struct isic_attach_args *ia)
-{
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t b0, b1, b2;
-
- b0 = bus_space_read_1(t, h, 0);
- b1 = bus_space_read_1(t, h, 1);
- b2 = bus_space_read_1(t, h, 2);
-
- if (b0 == 0x51 && b1 == 0x93 && b2 == 0x1c)
- return 1;
-
- return 0;
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163 - attach Teles S0/16.3 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_s0163(struct isa_device *dev)
-{
- u_char irq;
-
- if((irq = intr_no[ffs(dev->id_irq) - 1]) == 1)
- {
- printf("isic%d: Attach error, invalid IRQ [%d] specified for Teles S0/16.3!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
-
- /* configure IRQ */
-
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + 4, irq);
-
- DELAY(SEC_DELAY / 10);
- outb(dev->id_iobase + 4, irq | 0x01);
-
- return (1);
-}
-
-#else
-
-int
-isic_attach_s0163(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- u_int8_t irq = intr_no[sc->sc_irq];
-
- /* configure IRQ */
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 4, irq);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 4, irq | 0x01);
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163_read_reg;
- sc->writereg = tels0163_write_reg;
-
- sc->readfifo = tels0163_read_fifo;
- sc->writefifo = tels0163_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp= CARD_TYPEP_16_3;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- return (1);
-}
-#endif
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_tel_s08.c b/sys/i4b/layer1/i4b_tel_s08.c
deleted file mode 100644
index 6115e12ab6245..0000000000000
--- a/sys/i4b/layer1/i4b_tel_s08.c
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- *
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0/8 and clones
- * ================================================================
- *
- * $Id: i4b_tel_s08.c,v 1.13 1998/12/05 18:04:59 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:39:12 1998]
- *
- * -hm clean up
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- * -hm making it finally work (checked with board revision 1.2)
- * -hm converting asm -> C
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_8)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <machine/md_var.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t tels08_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels08_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels08_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-static void tels08_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 write register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels08_write_reg(u_char *base, u_int i, u_int v)
-{
- if(i & 0x01)
- i |= 0x200;
- base[i] = v;
-}
-
-#else
-
-static const bus_size_t offset[] = { 0x100, 0x180, 0x1c0 };
-
-static void
-tels08_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-
- offs += offset[what];
-
- if (offs & 0x01)
- offs |= 0x200;
-
- bus_space_write_1(t, h, offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 read register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels08_read_reg(u_char *base, u_int i)
-{
- if(i & 0x1)
- i |= 0x200;
- return(base[i]);
-}
-
-#else
-
-static u_int8_t
-tels08_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-
- offs += offset[what];
-
- if (offs & 0x01)
- offs |= 0x200;
-
- return bus_space_read_1(t, h, offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 fifo read/write access
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels08_memcpyb(void *to, const void *from, size_t len)
-{
- for(;len > 0; len--)
- *((unsigned char *)to)++ = *((unsigned char *)from)++;
-}
-
-#else
-
-static void
-tels08_write_fifo(struct isic_softc *sc, int what, const void *data, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_region_1(t, h, offset[what], data, size);
-}
-
-static void
-tels08_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_read_region_1(t, h, offset[what], buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s08 - probe for Teles S0/8 and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-int
-isic_probe_s08(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/8!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq)-1)
- {
- case 2:
- case 9: /* XXX */
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/8!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if we got an iobase */
-
- if(dev->id_iobase > 0)
- {
- printf("isic%d: Error, iobase specified for Teles S0/8!\n",
- dev->id_unit);
- return(0);
- }
-
- /* check if inside memory range of 0xA0000 .. 0xDF000 */
-
- if( (kvtop(dev->id_maddr) < 0xa0000) ||
- (kvtop(dev->id_maddr) > 0xdf000) )
- {
- printf("isic%d: Error, mem addr 0x%lx outside 0xA0000-0xDF000 for Teles S0/8!\n",
- dev->id_unit, kvtop(dev->id_maddr));
- return(0);
- }
-
- sc->sc_vmem_addr = (caddr_t) dev->id_maddr;
- dev->id_msize = 0x1000;
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels08_read_reg;
- sc->writereg = tels08_write_reg;
-
- sc->readfifo = tels08_memcpyb;
- sc->writefifo = tels08_memcpyb;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_8;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC base addr */
-
- ISAC_BASE = (caddr_t)((dev->id_maddr) + 0x100);
-
- /* setup HSCX base addr */
-
- HSCX_A_BASE = (caddr_t)((dev->id_maddr) + 0x180);
- HSCX_B_BASE = (caddr_t)((dev->id_maddr) + 0x1c0);
-
- return (1);
-}
-
-#else
-
-int
-isic_probe_s08(struct isic_attach_args *ia)
-{
- /* no real sensible probe is easy - write to fifo memory
- and read back to verify there is memory doesn't work,
- because you talk to tx fifo and rcv fifo. So, just check
- HSCX version, which at least fails if no card present
- at the given location. */
- bus_space_tag_t t = ia->ia_maps[0].t;
- bus_space_handle_t h = ia->ia_maps[0].h;
- u_int8_t v1, v2;
-
- /* HSCX A VSTR */
- v1 = bus_space_read_1(t, h, offset[1] + H_VSTR) & 0x0f;
- if (v1 != HSCX_VA1 && v1 != HSCX_VA2 && v1 != HSCX_VA3 && v1 != HSCX_V21)
- return 0;
-
- /* HSCX B VSTR */
- v2 = bus_space_read_1(t, h, offset[2] + H_VSTR) & 0x0f;
- if (v2 != HSCX_VA1 && v2 != HSCX_VA2 && v2 != HSCX_VA3 && v2 != HSCX_V21)
- return 0;
-
- /* both HSCX channels should have the same version... */
- if (v1 != v2)
- return 0;
-
- return 1;
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s08 - attach Teles S0/8 and compatibles
- *---------------------------------------------------------------------------*/
-int
-#ifdef __FreeBSD__
-isic_attach_s08(struct isa_device *dev)
-#else
-isic_attach_s08(struct isic_softc *sc)
-#endif
-{
-#ifdef __FreeBSD__
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-#else
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
-#endif
-
- /* set card off */
-
-#ifdef __FreeBSD__
- sc->sc_vmem_addr[0x80] = 0;
-#else
- bus_space_write_1(t, h, 0x80, 0);
-#endif
-
- DELAY(SEC_DELAY / 5);
-
- /* set card on */
-
-#ifdef __FreeBSD__
- sc->sc_vmem_addr[0x80] = 1;
-#else
- bus_space_write_1(t, h, 0x80, 1);
-#endif
-
- DELAY(SEC_DELAY / 5);
-
-#ifndef __FreeBSD__
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels08_read_reg;
- sc->writereg = tels08_write_reg;
- sc->readfifo = tels08_read_fifo;
- sc->writefifo = tels08_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_8;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
-#endif
-
- return (1);
-}
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_tel_s0P.c b/sys/i4b/layer1/i4b_tel_s0P.c
deleted file mode 100644
index 9bccd77b6fc92..0000000000000
--- a/sys/i4b/layer1/i4b_tel_s0P.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Copyright (c) 1997 Andrew Gordon. All rights reserved.
- *
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic - I4B Siemens ISDN Chipset Driver for Teles S0 PnP
- * =======================================================
- *
- * EXPERIMENTAL !!!
- * ================
- *
- * $Id: i4b_tel_s0P.c,v 1.12 1998/12/13 09:52:34 hm Exp $
- *
- * last edit-date: [Thu Dec 10 07:11:15 1998]
- *
- * -hm rudimentary PnP support, hint from Andrew Gordon
- * -hm more cleanup
- * -hm NetBSD patches from Martin
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(TEL_S0_16_3_P)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#ifndef __FreeBSD__
-static u_int8_t tels0163P_read_reg __P((struct isic_softc *sc, int what, bus_size_t offs));
-static void tels0163P_write_reg __P((struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data));
-static void tels0163P_read_fifo __P((struct isic_softc *sc, int what, void *buf, size_t size));
-static void tels0163P_write_fifo __P((struct isic_softc *sc, int what, const void *data, size_t size));
-void isic_attach_s0163P __P((struct isic_softc *sc));
-#endif
-
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP read fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163P_read_fifo(void *buf, const void *base, size_t len)
-{
- insb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163P_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_read_multi_1(t, h, o + 0x3e, buf, size);
-}
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP write fifo routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163P_write_fifo(void *base, const void *buf, size_t len)
-{
- outsb((int)base + 0x3e, (u_char *)buf, (u_int)len);
-}
-
-#else
-
-static void
-tels0163P_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_multi_1(t, h, o + 0x3e, (u_int8_t*)buf, size);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP write register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static void
-tels0163P_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + offset, (u_char)v);
-}
-
-#else
-
-static void
-tels0163P_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- bus_space_write_1(t, h, o + offs, data);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 PnP read register routine
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-
-static u_char
-tels0163P_read_reg(u_char *base, u_int offset)
-{
- return (inb((int)base + offset));
-}
-
-#else
-
-static u_int8_t
-tels0163P_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what+1].t;
- bus_space_handle_t h = sc->sc_maps[what+1].h;
- bus_size_t o = sc->sc_maps[what+1].offset;
- return bus_space_read_1(t, h, o + offs);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s0163P - probe for Teles S0/16.3 PnP and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_probe_s0163P(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/16.3 PnP!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- switch(ffs(dev->id_irq) - 1)
- {
- case 3:
- case 5:
- case 7:
- case 10:
- case 11:
- case 12:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16.3 PnP!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- break;
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for Teles S0/16.3 PnP!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x580:
- case 0x500:
- case 0x680:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16.3 PnP!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163P_read_reg;
- sc->writereg = tels0163P_write_reg;
-
- sc->readfifo = tels0163P_read_fifo;
- sc->writefifo = tels0163P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_163P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- switch(dev->id_iobase)
- {
- case 0x580:
- ISAC_BASE = (caddr_t) 0x580 - 0x20;
- HSCX_A_BASE = (caddr_t) 0x180 - 0x20;
- HSCX_B_BASE = (caddr_t) 0x180;
- break;
-
- case 0x500:
- ISAC_BASE = (caddr_t) 0x500 - 0x20;
- HSCX_A_BASE = (caddr_t) 0x100 - 0x20;
- HSCX_B_BASE = (caddr_t) 0x100;
- break;
-
- case 0x680:
- ISAC_BASE = (caddr_t) 0x680 - 0x20;
- HSCX_A_BASE = (caddr_t) 0x280 - 0x20;
- HSCX_B_BASE = (caddr_t) 0x280;
- break;
- }
-
- /*
- * Read HSCX A/B VSTR. Expected value for the S0/16.3 PnP card is
- * 0x05 in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for Teles S0/16.3 PnP\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163P - attach Teles S0/16.3 PnP and compatibles
- *---------------------------------------------------------------------------*/
-#ifdef __FreeBSD__
-int
-isic_attach_s0163P(struct isa_device *dev)
-{
- outb((dev->id_iobase) + 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- outb((dev->id_iobase) + 0x1c, 1);
- DELAY(SEC_DELAY / 10);
- return(1);
-}
-
-#else
-
-void
-isic_attach_s0163P(struct isic_softc *sc)
-{
- /* init card */
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- bus_space_write_1(t, h, 0x1c, 0);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 0x1c, 1);
- DELAY(SEC_DELAY / 10);
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = tels0163P_read_reg;
- sc->writereg = tels0163P_write_reg;
-
- sc->readfifo = tels0163P_read_fifo;
- sc->writefifo = tels0163P_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_163P;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-}
-#endif
-
-#endif /* ISIC > 0 */
-
diff --git a/sys/i4b/layer1/i4b_usr_sti.c b/sys/i4b/layer1/i4b_usr_sti.c
deleted file mode 100644
index db89296160faf..0000000000000
--- a/sys/i4b/layer1/i4b_usr_sti.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_usr_sti.c - USRobotics Sportster ISDN TA intern (Tina-pp)
- * -------------------------------------------------------------
- *
- * $Id: i4b_usr_sti.c,v 1.16 1998/12/05 18:05:02 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:25:34 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__)
-#include "isic.h"
-#include "opt_i4b.h"
-#else
-#define NISIC 1
-#endif
-#if NISIC > 0 && defined(USR_STI)
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#ifdef __FreeBSD__
-#include <machine/clock.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#endif
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-
-/*---------------------------------------------------------------------------*
- * USR Sportster TA intern special registers
- *---------------------------------------------------------------------------*/
-#define USR_HSCXA_OFF 0x0000
-#define USR_HSCXB_OFF 0x4000
-#define USR_INTL_OFF 0x8000
-#define USR_ISAC_OFF 0xc000
-
-#define USR_RES_BIT 0x80 /* 0 = normal, 1 = reset ISAC/HSCX */
-#define USR_INTE_BIT 0x40 /* 0 = IRQ disabled, 1 = IRQ's enabled */
-#define USR_IL_MASK 0x07 /* IRQ level config */
-
-static u_char intr_no[] = { 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 3, 4, 5, 0, 6, 7 };
-
-#ifdef __FreeBSD__
-
-#define ADDR(reg) \
- (((reg/4) * 1024) + ((reg%4) * 2))
-
-/*---------------------------------------------------------------------------*
- * USRobotics read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_read_fifo(void *buf, const void *base, size_t len)
-{
- register int offset = 0;
-
- for(;len > 0; len--, offset++)
- *((u_char *)buf + offset) = inb((int)base + ADDR(offset));
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_fifo(void *base, const void *buf, size_t len)
-{
- register int offset = 0;
-
- for(;len > 0; len--, offset++)
- outb((int)base + ADDR(offset), *((u_char *)buf + offset));
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write register routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_reg(u_char *base, u_int offset, u_int v)
-{
- outb((int)base + ADDR(offset), (u_char)v);
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics read register routine
- *---------------------------------------------------------------------------*/
-static u_char
-usrtai_read_reg(u_char *base, u_int offset)
-{
- return(inb((int)base + ADDR(offset)));
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_usrtai - probe for USR
- *---------------------------------------------------------------------------*/
-int
-isic_probe_usrtai(struct isa_device *dev)
-{
- struct isic_softc *sc = &isic_sc[dev->id_unit];
-
- /* check max unit range */
-
- if(dev->id_unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= MAXUNIT for USR Sportster TA!\n",
- dev->id_unit, dev->id_unit);
- return(0);
- }
- sc->sc_unit = dev->id_unit;
-
- /* check IRQ validity */
-
- if((intr_no[ffs(dev->id_irq) - 1]) == 0)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for USR Sportster TA!\n",
- dev->id_unit, (ffs(dev->id_irq))-1);
- return(0);
- }
- sc->sc_irq = dev->id_irq;
-
- /* check if memory addr specified */
-
- if(dev->id_maddr)
- {
- printf("isic%d: Error, mem addr 0x%lx specified for USR Sportster TA!\n",
- dev->id_unit, (u_long)dev->id_maddr);
- return(0);
- }
- dev->id_msize = 0;
-
- /* check if we got an iobase */
-
- switch(dev->id_iobase)
- {
- case 0x200:
- case 0x208:
- case 0x210:
- case 0x218:
- case 0x220:
- case 0x228:
- case 0x230:
- case 0x238:
- case 0x240:
- case 0x248:
- case 0x250:
- case 0x258:
- case 0x260:
- case 0x268:
- case 0x270:
- case 0x278:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for USR Sportster TA!\n",
- dev->id_unit, dev->id_iobase);
- return(0);
- break;
- }
- sc->sc_port = dev->id_iobase;
-
- /* setup ISAC access routines */
-
- sc->clearirq = NULL;
- sc->readreg = usrtai_read_reg;
- sc->writereg = usrtai_write_reg;
-
- sc->readfifo = usrtai_read_fifo;
- sc->writefifo = usrtai_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_USRTA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC and HSCX base addr */
-
- ISAC_BASE = (caddr_t)dev->id_iobase + USR_ISAC_OFF;
- HSCX_A_BASE = (caddr_t)dev->id_iobase + USR_HSCXA_OFF;
- HSCX_B_BASE = (caddr_t)dev->id_iobase + USR_HSCXB_OFF;
-
- /*
- * Read HSCX A/B VSTR. Expected value for USR Sportster TA based
- * boards is 0x05 in the least significant bits.
- */
-
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
- {
- printf("isic%d: HSCX VSTR test failed for USR Sportster TA\n",
- dev->id_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- dev->id_unit, HSCX_READ(1, H_VSTR));
- return (0);
- }
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_usrtai - attach USR
- *---------------------------------------------------------------------------*/
-int
-isic_attach_usrtai(struct isa_device *dev)
-{
- u_char irq = 0;
-
- /* reset the HSCX and ISAC chips */
-
- outb(dev->id_iobase + USR_INTL_OFF, USR_RES_BIT);
- DELAY(SEC_DELAY / 10);
-
- outb(dev->id_iobase + USR_INTL_OFF, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- if((irq = intr_no[ffs(dev->id_irq) - 1]) == 0)
- {
- printf("isic%d: Attach error, invalid IRQ [%d] specified for USR Sportster TA!\n",
- dev->id_unit, ffs(dev->id_irq)-1);
- return(0);
- }
-
- /* configure and enable irq */
-
- outb(dev->id_iobase + USR_INTL_OFF, irq | USR_INTE_BIT);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-
-#else /* end of FreeBSD, start NetBSD */
-
-/*
- * Use of sc->sc_maps:
- * 0 : config register
- * 1 - 16 : HSCX A registers
- * 17 - 32 : HSCX B registers
- * 33 - 48 : ISAC registers
- */
-
-#define USR_REG_OFFS(reg) ((reg % 4) * 2)
-#define USR_HSCXA_MAP(reg) ((reg / 4) + 1)
-#define USR_HSCXB_MAP(reg) ((reg / 4) + 17)
-#define USR_ISAC_MAP(reg) ((reg / 4) + 33)
-
-static int map_base[] = { 33, 1, 17, 0 }; /* ISAC, HSCX A, HSCX B */
-
-/*---------------------------------------------------------------------------*
- * USRobotics read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- int map, off, offset;
- u_char * p = buf;
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- for (offset = 0; size > 0; size--, offset++) {
- map = map_base[what] + (offset / 4);
- t = sc->sc_maps[map].t;
- h = sc->sc_maps[map].h;
- off = USR_REG_OFFS(offset);
-
- *p++ = bus_space_read_1(t, h, off);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- int map, off, offset;
- const u_char * p = buf;
- bus_space_tag_t t;
- bus_space_handle_t h;
- u_char v;
-
- for (offset = 0; size > 0; size--, offset++) {
- map = map_base[what] + (offset / 4);
- t = sc->sc_maps[map].t;
- h = sc->sc_maps[map].h;
- off = USR_REG_OFFS(offset);
-
- v = *p++;
- bus_space_write_1(t, h, off, v);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write register routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- int map = map_base[what] + (offs / 4),
- off = USR_REG_OFFS(offs);
- bus_space_tag_t t = sc->sc_maps[map].t;
- bus_space_handle_t h = sc->sc_maps[map].h;
-
- bus_space_write_1(t, h, off, data);
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics read register routine
- *---------------------------------------------------------------------------*/
-static u_char
-usrtai_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- int map = map_base[what] + (offs / 4),
- off = USR_REG_OFFS(offs);
- bus_space_tag_t t = sc->sc_maps[map].t;
- bus_space_handle_t h = sc->sc_maps[map].h;
-
- return bus_space_read_1(t, h, off);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_usrtai - probe for USR
- *---------------------------------------------------------------------------*/
-int
-isic_probe_usrtai(struct isic_attach_args *ia)
-{
- /*
- * Read HSCX A/B VSTR. Expected value for IOM2 based
- * boards is 0x05 in the least significant bits.
- */
-
- if(((bus_space_read_1(ia->ia_maps[USR_HSCXA_MAP(H_VSTR)].t, ia->ia_maps[USR_HSCXA_MAP(H_VSTR)].h, USR_REG_OFFS(H_VSTR)) & 0x0f) != 0x05) ||
- ((bus_space_read_1(ia->ia_maps[USR_HSCXB_MAP(H_VSTR)].t, ia->ia_maps[USR_HSCXB_MAP(H_VSTR)].h, USR_REG_OFFS(H_VSTR)) & 0x0f) != 0x05))
- return 0;
-
- return (1);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_usrtai - attach USR
- *---------------------------------------------------------------------------*/
-int
-isic_attach_usrtai(struct isic_softc *sc)
-{
- bus_space_tag_t t = sc->sc_maps[0].t;
- bus_space_handle_t h = sc->sc_maps[0].h;
- u_char irq = intr_no[sc->sc_irq];
-
- sc->clearirq = NULL;
- sc->readreg = usrtai_read_reg;
- sc->writereg = usrtai_write_reg;
-
- sc->readfifo = usrtai_read_fifo;
- sc->writefifo = usrtai_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_USRTA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* reset the HSCX and ISAC chips */
-
- bus_space_write_1(t, h, 0, USR_RES_BIT);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- bus_space_write_1(t, h, 0, irq | USR_INTE_BIT);
- DELAY(SEC_DELAY / 10);
-
- return (1);
-}
-
-#endif /* __FreeBSD__ */
-
-#endif /* ISIC > 0 */
diff --git a/sys/i4b/layer1/isa_isic.c b/sys/i4b/layer1/isa_isic.c
deleted file mode 100644
index 94e4bf7e4151f..0000000000000
--- a/sys/i4b/layer1/isa_isic.c
+++ /dev/null
@@ -1,828 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Martin Husemann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isa_isic.c - ISA bus frontend for i4b_isic driver
- * --------------------------------------------------
- *
- * $Id: isa_isic.c,v 1.18 1998/12/16 13:39:47 hm Exp $
- *
- * last edit-date: [Mon Dec 14 10:53:16 1998]
- *
- * -mh original implementation
- * -hm NetBSD patches from Martin
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <dev/isa/isavar.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-
-#if defined(__OpenBSD__)
-#define __BROKEN_INDIRECT_CONFIG
-#endif
-
-/* local functions */
-#ifdef __BROKEN_INDIRECT_CONFIG
-static int isa_isic_probe __P((struct device *, void *, void *));
-#else
-static int isa_isic_probe __P((struct device *, struct cfdata *, void *));
-#endif
-
-static void isa_isic_attach __P((struct device *, struct device *, void *));
-static int setup_io_map __P((int flags, bus_space_tag_t iot,
- bus_space_tag_t memt, bus_size_t iobase, bus_size_t maddr,
- int *num_mappings, struct isic_io_map *maps, int *iosize,
- int *msize));
-static void args_unmap __P((int *num_mappings, struct isic_io_map *maps));
-
-struct cfattach isa_isic_ca = {
- sizeof(struct isic_softc), isa_isic_probe, isa_isic_attach
-};
-
-
-/*
- * Probe card
- */
-static int
-#ifdef __BROKEN_INDIRECT_CONFIG
-isa_isic_probe(parent, match, aux)
-#else
-isa_isic_probe(parent, cf, aux)
-#endif
- struct device *parent;
-#ifdef __BROKEN_INDIRECT_CONFIG
- void *match;
-#else
- struct cfdata *cf;
-#endif
- void *aux;
-{
-#ifdef __BROKEN_INDIRECT_CONFIG
- struct cfdata *cf = ((struct device*)match)->dv_cfdata;
-#endif
- struct isa_attach_args *ia = aux;
- bus_space_tag_t memt = ia->ia_memt, iot = ia->ia_iot;
- int flags = cf->cf_flags;
- struct isic_attach_args args;
- int ret = 0;
-
- /* check irq */
- if (ia->ia_irq == IRQUNK) {
- printf("isic%d: config error: no IRQ specified\n", cf->cf_unit);
- return 0;
- }
-
- /* setup MI attach args */
- bzero(&args, sizeof(args));
- args.ia_flags = flags;
-
- /* if card type specified setup io map for that card */
- switch(flags)
- {
- case FLAG_TELES_S0_8:
- case FLAG_TELES_S0_16:
- case FLAG_TELES_S0_163:
- case FLAG_AVM_A1:
- case FLAG_USR_ISDN_TA_INT:
- case FLAG_ITK_IX1:
- if (setup_io_map(flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &ia->ia_msize)) {
- ret = 0;
- goto done;
- }
- break;
-
- default:
- /* no io map now, will figure card type later */
- break;
- }
-
- /* probe card */
- switch(flags)
- {
-#ifdef DYNALINK
- case FLAG_DYNALINK:
- ret = isic_probe_Dyn(&args);
- break;
-#endif
-
-#ifdef TEL_S0_8
- case FLAG_TELES_S0_8:
- ret = isic_probe_s08(&args);
- break;
-#endif
-
-#ifdef TEL_S0_16
- case FLAG_TELES_S0_16:
- ret = isic_probe_s016(&args);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case FLAG_TELES_S0_163:
- ret = isic_probe_s0163(&args);
- break;
-#endif
-
-#ifdef AVM_A1
- case FLAG_AVM_A1:
- ret = isic_probe_avma1(&args);
- break;
-#endif
-
-#ifdef USR_STI
- case FLAG_USR_ISDN_TA_INT:
- ret = isic_probe_usrtai(&args);
- break;
-#endif
-
-#ifdef ITKIX1
- case FLAG_ITK_IX1:
- ret = isic_probe_itkix1(&args);
- break;
-#endif
-
- default:
- /* No card type given, try to figure ... */
- if (ia->ia_iobase == IOBASEUNK) {
- ret = 0;
-#ifdef TEL_S0_8
- /* only Teles S0/8 will work without IO */
- args.ia_flags = FLAG_TELES_S0_8;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s08(&args);
- }
-#endif /* TEL_S0_8 */
- } else if (ia->ia_maddr == MADDRUNK) {
- ret = 0;
-#ifdef TEL_S0_16_3
- /* no shared memory, only a 16.3 based card,
- AVM A1, the usr sportster or an ITK would work */
- args.ia_flags = FLAG_TELES_S0_163;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s0163(&args);
- if (ret)
- break;
- }
-#endif /* TEL_S0_16_3 */
-#ifdef AVM_A1
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_AVM_A1;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_avma1(&args);
- if (ret)
- break;
- }
-#endif /* AVM_A1 */
-#ifdef USR_STI
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_USR_ISDN_TA_INT;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_usrtai(&args);
- if (ret)
- break;
- }
-#endif /* USR_STI */
-
-#ifdef ITKIX1
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_ITK_IX1;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_itkix1(&args);
- if (ret)
- break;
- }
-#endif /* ITKIX1 */
-
- } else {
-#ifdef TEL_S0_16_3
- /* could be anything */
- args.ia_flags = FLAG_TELES_S0_163;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s0163(&args);
- if (ret)
- break;
- }
-#endif /* TEL_S0_16_3 */
-#ifdef TEL_S0_16
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_TELES_S0_16;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s016(&args);
- if (ret)
- break;
- }
-#endif /* TEL_S0_16 */
-#ifdef AVM_A1
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_AVM_A1;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_avma1(&args);
- if (ret)
- break;
- }
-#endif /* AVM_A1 */
-#ifdef TEL_S0_8
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- args.ia_flags = FLAG_TELES_S0_8;
- if (setup_io_map(args.ia_flags, iot, memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0],
- &(ia->ia_iosize), &(ia->ia_msize)) == 0)
- {
- ret = isic_probe_s08(&args);
- }
-#endif /* TEL_S0_8 */
- }
- break;
- }
-
-done:
- /* unmap resources */
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-
- return ret;
-}
-
-/*
- * Attach the card
- */
-static void
-isa_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct isic_softc *sc = (void *)self;
- struct isa_attach_args *ia = aux;
- int flags = sc->sc_dev.dv_cfdata->cf_flags;
- int ret = 0;
- struct isic_attach_args args;
-
- /* Setup parameters */
- sc->sc_unit = sc->sc_dev.dv_unit;
- sc->sc_irq = ia->ia_irq;
- sc->sc_maddr = ia->ia_maddr;
- sc->sc_num_mappings = 0;
- sc->sc_maps = NULL;
- switch(flags)
- {
- case FLAG_TELES_S0_8:
- case FLAG_TELES_S0_16:
- case FLAG_TELES_S0_163:
- case FLAG_AVM_A1:
- case FLAG_USR_ISDN_TA_INT:
- setup_io_map(flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &(sc->sc_num_mappings), NULL, NULL, NULL);
- MALLOC_MAPS(sc);
- setup_io_map(flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &(sc->sc_num_mappings), &(sc->sc_maps[0]), NULL, NULL);
- break;
-
- default:
- /* No card type given, try to figure ... */
-
- /* setup MI attach args */
- bzero(&args, sizeof(args));
- args.ia_flags = flags;
-
- /* Probe cards */
- if (ia->ia_iobase == IOBASEUNK) {
- ret = 0;
-#ifdef TEL_S0_8
- /* only Teles S0/8 will work without IO */
- args.ia_flags = FLAG_TELES_S0_8;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s08(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_8 */
- } else if (ia->ia_maddr == MADDRUNK) {
- /* no shared memory, only a 16.3 based card,
- AVM A1, the usr sportster or an ITK would work */
- ret = 0;
-#ifdef TEL_S0_16_3
- args.ia_flags = FLAG_TELES_S0_163;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s0163(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_16_3 */
-#ifdef AVM_A1
- args.ia_flags = FLAG_AVM_A1;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_avma1(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* AVM_A1 */
-#ifdef USR_STI
- args.ia_flags = FLAG_USR_ISDN_TA_INT;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_usrtai(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* USR_STI */
-#ifdef ITKIX1
- args.ia_flags = FLAG_ITK_IX1;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_itkix1(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* ITKIX1 */
- } else {
- /* could be anything */
- ret = 0;
-#ifdef TEL_S0_16_3
- args.ia_flags = FLAG_TELES_S0_163;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s0163(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_16_3 */
-#ifdef TEL_S0_16
- args.ia_flags = FLAG_TELES_S0_16;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s016(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_16 */
-#ifdef AVM_A1
- args.ia_flags = FLAG_AVM_A1;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_avma1(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* AVM_A1 */
-#ifdef TEL_S0_8
- args.ia_flags = FLAG_TELES_S0_8;
- setup_io_map(args.ia_flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &args.ia_num_mappings, &args.ia_maps[0], NULL, NULL);
- ret = isic_probe_s08(&args);
- if (ret)
- goto found;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
-#endif /* TEL_S0_8 */
- }
- break;
-
- found:
- flags = args.ia_flags;
- sc->sc_num_mappings = args.ia_num_mappings;
- args_unmap(&args.ia_num_mappings, &args.ia_maps[0]);
- if (ret) {
- MALLOC_MAPS(sc);
- setup_io_map(flags, ia->ia_iot, ia->ia_memt, ia->ia_iobase, ia->ia_maddr,
- &(sc->sc_num_mappings), &(sc->sc_maps[0]), NULL, NULL);
- } else {
- printf(": could not determine card type - not configured!\n");
- return;
- }
- break;
- }
-
-#if defined(__OpenBSD__)
- isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
- IPL_NET, isicintr, sc, sc->sc_dev.dv_xname);
-
- /* MI initialization of card */
- isicattach(flags, sc);
-
-#else
-
- /* MI initialization of card */
- isicattach(flags, sc);
-
- /*
- * Try to get a level-triggered interrupt first. If that doesn't
- * work (like on NetBSD/Atari, try to establish an edge triggered
- * interrupt.
- */
- if (isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_LEVEL,
- IPL_NET, isicintr, sc) == NULL) {
- if(isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
- IPL_NET, isicintr, sc) == NULL) {
- args_unmap(&(sc->sc_num_mappings), &(sc->sc_maps[0]));
- free((sc)->sc_maps, M_DEVBUF);
- }
- else {
- /*
- * XXX: This is a hack that probably needs to be
- * solved by setting an interrupt type in the sc
- * structure. I don't feel familiar enough with the
- * code to do this currently. Feel free to contact
- * me about it (leo@netbsd.org).
- */
- isicintr(sc);
- }
- }
-#endif
-}
-
-/*
- * Setup card specific io mapping. Return 0 on success,
- * any other value on config error.
- * Be prepared to get NULL as maps array.
- * Make sure to keep *num_mappings in sync with the real
- * mappings already setup when returning!
- */
-static int
-setup_io_map(flags, iot, memt, iobase, maddr, num_mappings, maps, iosize, msize)
- int flags, *num_mappings, *iosize, *msize;
- bus_size_t iobase, maddr;
- bus_space_tag_t iot, memt;
- struct isic_io_map *maps;
-{
- /* nothing mapped yet */
- *num_mappings = 0;
-
- /* which resources do we need? */
- switch(flags)
- {
- case FLAG_TELES_S0_8:
- if (maddr == MADDRUNK) {
- printf("isic: config error: no shared memory specified for Teles S0/8!\n");
- return 1;
- }
- if (iosize) *iosize = 0; /* no i/o ports */
- if (msize) *msize = 0x1000; /* shared memory size */
-
- /* this card uses a single memory mapping */
- if (maps == NULL) {
- *num_mappings = 1;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = memt;
- maps[0].offset = 0;
- maps[0].size = 0x1000;
- if (bus_space_map(maps[0].t, maddr,
- maps[0].size, 0, &maps[0].h)) {
- return 1;
- }
- (*num_mappings)++;
- break;
-
- case FLAG_TELES_S0_16:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no i/o address specified for Teles S0/16!\n");
- return 1;
- }
- if (maddr == MADDRUNK) {
- printf("isic: config error: no shared memory specified for Teles S0/16!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* i/o ports */
- if (msize) *msize = 0x1000; /* shared memory size */
-
- /* one io and one memory mapping */
- if (maps == NULL) {
- *num_mappings = 2;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = iot;
- maps[0].offset = 0;
- maps[0].size = 8;
- if (bus_space_map(maps[0].t, iobase,
- maps[0].size, 0, &maps[0].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[1].t = memt;
- maps[1].offset = 0;
- maps[1].size = 0x1000;
- if (bus_space_map(maps[1].t, maddr,
- maps[1].size, 0, &maps[1].h)) {
- return 1;
- }
- (*num_mappings)++;
- break;
-
- case FLAG_TELES_S0_163:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no i/o address specified for Teles S0/16!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* only some i/o ports shown */
- if (msize) *msize = 0; /* no shared memory */
-
- /* Four io mappings: config, isac, 2 * hscx */
- if (maps == NULL) {
- *num_mappings = 4;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = iot;
- maps[0].offset = 0;
- maps[0].size = 8;
- if (bus_space_map(maps[0].t, iobase,
- maps[0].size, 0, &maps[0].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[1].t = iot;
- maps[1].offset = 0;
- maps[1].size = 0x40; /* XXX - ??? */
- if ((iobase - 0xd80 + 0x980) < 0 || (iobase - 0xd80 + 0x980) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[1].t, iobase - 0xd80 + 0x980,
- maps[1].size, 0, &maps[1].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[2].t = iot;
- maps[2].offset = 0;
- maps[2].size = 0x40; /* XXX - ??? */
- if ((iobase - 0xd80 + 0x180) < 0 || (iobase - 0xd80 + 0x180) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[2].t, iobase - 0xd80 + 0x180,
- maps[2].size, 0, &maps[2].h)) {
- return 1;
- }
- (*num_mappings)++;
- maps[3].t = iot;
- maps[3].offset = 0;
- maps[3].size = 0x40; /* XXX - ??? */
- if ((iobase - 0xd80 + 0x580) < 0 || (iobase - 0xd80 + 0x580) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[3].t, iobase - 0xd80 + 0x580,
- maps[3].size, 0, &maps[3].h)) {
- return 1;
- }
- (*num_mappings)++;
- break;
-
- case FLAG_AVM_A1:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no i/o address specified for AVM A1/Fritz! card!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* only some i/o ports shown */
- if (msize) *msize = 0; /* no shared memory */
-
- /* Seven io mappings: config, isac, 2 * hscx,
- isac-fifo, 2 * hscx-fifo */
- if (maps == NULL) {
- *num_mappings = 7;
- return 0;
- }
- *num_mappings = 0;
- maps[0].t = iot; /* config */
- maps[0].offset = 0;
- maps[0].size = 8;
- if ((iobase + 0x1800) < 0 || (iobase + 0x1800) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[0].t, iobase + 0x1800, maps[0].size, 0, &maps[0].h))
- return 1;
- (*num_mappings)++;
- maps[1].t = iot; /* isac */
- maps[1].offset = 0;
- maps[1].size = 0x80; /* XXX - ??? */
- if ((iobase + 0x1400 - 0x20) < 0 || (iobase + 0x1400 - 0x20) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[1].t, iobase + 0x1400 - 0x20, maps[1].size, 0, &maps[1].h))
- return 1;
- (*num_mappings)++;
- maps[2].t = iot; /* hscx 0 */
- maps[2].offset = 0;
- maps[2].size = 0x40; /* XXX - ??? */
- if ((iobase + 0x400 - 0x20) < 0 || (iobase + 0x400 - 0x20) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[2].t, iobase + 0x400 - 0x20, maps[2].size, 0, &maps[2].h))
- return 1;
- (*num_mappings)++;
- maps[3].t = iot; /* hscx 1 */
- maps[3].offset = 0;
- maps[3].size = 0x40; /* XXX - ??? */
- if ((iobase + 0xc00 - 0x20) < 0 || (iobase + 0xc00 - 0x20) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[3].t, iobase + 0xc00 - 0x20, maps[3].size, 0, &maps[3].h))
- return 1;
- (*num_mappings)++;
- maps[4].t = iot; /* isac-fifo */
- maps[4].offset = 0;
- maps[4].size = 1;
- if ((iobase + 0x1400 - 0x20 -0x3e0) < 0 || (iobase + 0x1400 - 0x20 -0x3e0) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[4].t, iobase + 0x1400 - 0x20 -0x3e0, maps[4].size, 0, &maps[4].h))
- return 1;
- (*num_mappings)++;
- maps[5].t = iot; /* hscx 0 fifo */
- maps[5].offset = 0;
- maps[5].size = 1;
- if ((iobase + 0x400 - 0x20 -0x3e0) < 0 || (iobase + 0x400 - 0x20 -0x3e0) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[5].t, iobase + 0x400 - 0x20 -0x3e0, maps[5].size, 0, &maps[5].h))
- return 1;
- (*num_mappings)++;
- maps[6].t = iot; /* hscx 1 fifo */
- maps[6].offset = 0;
- maps[6].size = 1;
- if ((iobase + 0xc00 - 0x20 -0x3e0) < 0 || (iobase + 0xc00 - 0x20 -0x3e0) > 0x0ffff)
- return 1;
- if (bus_space_map(maps[6].t, iobase + 0xc00 - 0x20 -0x3e0, maps[6].size, 0, &maps[6].h))
- return 1;
- (*num_mappings)++;
- break;
-
- case FLAG_USR_ISDN_TA_INT:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no I/O base specified for USR Sportster TA intern!\n");
- return 1;
- }
- if (iosize) *iosize = 8; /* scattered ports, only some shown */
- if (msize) *msize = 0; /* no shared memory */
-
- /* 49 io mappings: 1 config and 48x8 registers */
- if (maps == NULL) {
- *num_mappings = 49;
- return 0;
- }
- *num_mappings = 0;
- {
- int i, num;
- bus_size_t base;
-
- /* config at offset 0x8000 */
- base = iobase + 0x8000;
- maps[0].size = 1;
- maps[0].t = iot;
- maps[0].offset = 0;
- if (base < 0 || base > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base, 1, 0, &maps[0].h)) {
- return 1;
- }
- *num_mappings = num = 1;
-
- /* HSCX A at offset 0 */
- base = iobase;
- for (i = 0; i < 16; i++) {
- maps[num].size = 8;
- maps[num].offset = 0;
- maps[num].t = iot;
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base+i*1024, 8, 0, &maps[num].h)) {
- return 1;
- }
- *num_mappings = ++num;
- }
- /* HSCX B at offset 0x4000 */
- base = iobase + 0x4000;
- for (i = 0; i < 16; i++) {
- maps[num].size = 8;
- maps[num].offset = 0;
- maps[num].t = iot;
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base+i*1024, 8, 0, &maps[num].h)) {
- return 1;
- }
- *num_mappings = ++num;
- }
- /* ISAC at offset 0xc000 */
- base = iobase + 0xc000;
- for (i = 0; i < 16; i++) {
- maps[num].size = 8;
- maps[num].offset = 0;
- maps[num].t = iot;
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- if (bus_space_map(iot, base+i*1024, 8, 0, &maps[num].h)) {
- return 1;
- }
- *num_mappings = ++num;
- }
- }
- break;
-
- case FLAG_ITK_IX1:
- if (iobase == IOBASEUNK) {
- printf("isic: config error: no I/O base specified for ITK ix1 micro!\n");
- return 1;
- }
- if (iosize) *iosize = 4;
- if (msize) *msize = 0;
- if (maps == NULL) {
- *num_mappings = 1;
- return 0;
- }
- *num_mappings = 0;
- maps[0].size = 4;
- maps[0].t = iot;
- maps[0].offset = 0;
- if (bus_space_map(iot, iobase, 4, 0, &maps[0].h)) {
- return 1;
- }
- *num_mappings = 1;
- break;
-
- default:
- printf("isic: config error: flags do not specify any known card!\n");
- return 1;
- break;
- }
-
- return 0;
-}
-
-static void
-args_unmap(num_mappings, maps)
- int *num_mappings;
- struct isic_io_map *maps;
-{
- int i, n;
- for (i = 0, n = *num_mappings; i < n; i++)
- if (maps[i].size)
- bus_space_unmap(maps[i].t, maps[i].h, maps[i].size);
- *num_mappings = 0;
-}
diff --git a/sys/i4b/layer1/isapnp_isic.c b/sys/i4b/layer1/isapnp_isic.c
deleted file mode 100644
index 9dfdf68c62b38..0000000000000
--- a/sys/i4b/layer1/isapnp_isic.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Martin Husemann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isapnp_isic.c - ISA-P&P bus frontend for i4b_isic driver
- * --------------------------------------------------------
- *
- * $Id: isapnp_isic.c,v 1.9 1998/12/16 13:39:47 hm Exp $
- *
- * last edit-date: [Mon Dec 14 10:54:23 1998]
- *
- * -mh original implementation
- * -hm NetBSD patches from Martin
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <dev/isa/isavar.h>
-#include <dev/isapnp/isapnpreg.h>
-#include <dev/isapnp/isapnpvar.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_global.h>
-
-#ifdef __BROKEN_INDIRECT_CONFIG
-static int isapnp_isic_probe __P((struct device *, void *, void *));
-#else
-static int isapnp_isic_probe __P((struct device *, struct cfdata *, void *));
-#endif
-static void isapnp_isic_attach __P((struct device *, struct device *, void *));
-
-struct cfattach isapnp_isic_ca = {
- sizeof(struct isic_softc), isapnp_isic_probe, isapnp_isic_attach
-};
-
-typedef void (*allocmaps_func)(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-typedef void (*attach_func)(struct isic_softc *sc);
-
-/* map allocators */
-static void generic_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-static void ngo_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-static void tls_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc);
-
-/* card attach functions */
-extern void isic_attach_Cs0P __P((struct isic_softc *sc));
-extern void isic_attach_Dyn __P((struct isic_softc *sc));
-extern void isic_attach_s0163P __P((struct isic_softc *sc));
-extern void isic_attach_drnngo __P((struct isic_softc *sc));
-extern void isic_attach_sws __P((struct isic_softc *sc));
-extern void isic_attach_Eqs1pi __P((struct isic_softc *sc));
-
-struct isapnp_isic_card_desc {
- char *devlogic; /* ISAPNP logical device ID */
- char *name; /* Name of the card */
- int card_type; /* isic card type identifier */
- allocmaps_func allocmaps; /* map allocator function */
- attach_func attach; /* card attach and init function */
-};
-static const struct isapnp_isic_card_desc
-isapnp_isic_descriptions[] =
-{
-#ifdef CRTX_S0_P
- { "CTX0000", "Creatix ISDN S0-16 P&P", CARD_TYPEP_CS0P,
- tls_pnp_mapalloc, isic_attach_Cs0P },
-#endif
-#ifdef TEL_S0_16_3_P
- { "TAG2110", "Teles S0/PnP", CARD_TYPEP_163P,
- tls_pnp_mapalloc, isic_attach_s0163P },
-#endif
-#ifdef DRN_NGO
- { "SDA0150", "Dr. Neuhaus NICCY GO@", CARD_TYPEP_DRNNGO,
- ngo_pnp_mapalloc, isic_attach_drnngo },
-#endif
-#ifdef ELSA_QS1ISA
- { "ELS0133", "Elsa QuickStep 1000 (ISA)", CARD_TYPEP_ELSAQS1ISA,
- generic_pnp_mapalloc, isic_attach_Eqs1pi },
-#endif
-#ifdef SEDLBAUER
- { "SAG0001", "Sedlbauer WinSpeed", CARD_TYPEP_SWS,
- generic_pnp_mapalloc, isic_attach_sws },
-#endif
-#ifdef DYNALINK
- { "ASU1688", "Dynalink IS64PH", CARD_TYPEP_DYNALINK,
- generic_pnp_mapalloc, isic_attach_Dyn },
-#endif
-};
-#define NUM_DESCRIPTIONS (sizeof(isapnp_isic_descriptions)/sizeof(isapnp_isic_descriptions[0]))
-
-/*
- * Probe card
- */
-static int
-#ifdef __BROKEN_INDIRECT_CONFIG
-isapnp_isic_probe(parent, match, aux)
-#else
-isapnp_isic_probe(parent, cf, aux)
-#endif
- struct device *parent;
-#ifdef __BROKEN_INDIRECT_CONFIG
- void *match;
-#else
- struct cfdata *cf;
-#endif
- void *aux;
-{
- struct isapnp_attach_args *ipa = aux;
- const struct isapnp_isic_card_desc *desc = isapnp_isic_descriptions;
- int i;
-
- for (i = 0; i < NUM_DESCRIPTIONS; i++, desc++)
- if (strcmp(ipa->ipa_devlogic, desc->devlogic) == 0)
- return 1;
-
- return 0;
-}
-
-
-/*---------------------------------------------------------------------------*
- * card independend attach for ISA P&P cards
- *---------------------------------------------------------------------------*/
-
-/* parameter and format for message producing e.g. "isic0: " */
-
-#ifdef __FreeBSD__
-#define ISIC_FMT "isic%d: "
-#define ISIC_PARM dev->id_unit
-#define TERMFMT " "
-#else
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-#endif
-
-static void
-isapnp_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- struct isic_softc *sc = (void *)self;
- struct isapnp_attach_args *ipa = aux;
- const struct isapnp_isic_card_desc *desc = isapnp_isic_descriptions;
- int i;
-
- for (i = 0; i < NUM_DESCRIPTIONS; i++, desc++)
- if (strcmp(ipa->ipa_devlogic, desc->devlogic) == 0)
- break;
- if (i >= NUM_DESCRIPTIONS)
- panic("could not identify isic PnP device");
-
- /* setup parameters */
- sc->sc_cardtyp = desc->card_type;
- sc->sc_unit = sc->sc_dev.dv_unit;
- sc->sc_irq = ipa->ipa_irq[0].num;
- desc->allocmaps(ipa, sc);
-
- /* announce card name */
- printf(": %s\n", desc->name);
-
- /* establish interrupt handler */
- isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num, IST_EDGE,
- IPL_NET, isicintr, sc);
-
- /* init card */
- isic_sc[sc->sc_unit] = sc;
- desc->attach(sc);
-
- /* announce chip versions */
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return;
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return;
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-}
-
-static void
-generic_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc)
-{
- sc->sc_num_mappings = 1; /* most cards have just one mapping */
- MALLOC_MAPS(sc); /* malloc the maps */
- sc->sc_maps[0].t = ipa->ipa_iot; /* copy the access handles */
- sc->sc_maps[0].h = ipa->ipa_io[0].h;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
-}
-
-static void
-ngo_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc)
-{
- sc->sc_num_mappings = 2; /* one data, one address mapping */
- MALLOC_MAPS(sc); /* malloc the maps */
- sc->sc_maps[0].t = ipa->ipa_iot; /* copy the access handles */
- sc->sc_maps[0].h = ipa->ipa_io[0].h;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
- sc->sc_maps[1].t = ipa->ipa_iot;
- sc->sc_maps[1].h = ipa->ipa_io[1].h;
- sc->sc_maps[1].size = 0;
-}
-
-static void
-tls_pnp_mapalloc(struct isapnp_attach_args *ipa, struct isic_softc *sc)
-{
- sc->sc_num_mappings = 4; /* config, isac, 2 * hscx */
- MALLOC_MAPS(sc); /* malloc the maps */
- sc->sc_maps[0].t = ipa->ipa_iot; /* copy the access handles */
- sc->sc_maps[0].h = ipa->ipa_io[0].h;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
- sc->sc_maps[1].t = ipa->ipa_iot;
- sc->sc_maps[1].h = ipa->ipa_io[0].h;
- sc->sc_maps[1].size = 0;
- sc->sc_maps[1].offset = - 0x20;
- sc->sc_maps[2].t = ipa->ipa_iot;
- sc->sc_maps[2].offset = - 0x20;
- sc->sc_maps[2].h = ipa->ipa_io[1].h;
- sc->sc_maps[2].size = 0;
- sc->sc_maps[3].t = ipa->ipa_iot;
- sc->sc_maps[3].offset = 0;
- sc->sc_maps[3].h = ipa->ipa_io[1].h;
- sc->sc_maps[3].size = 0;
-}
diff --git a/sys/i4b/layer1/isic_supio.c b/sys/i4b/layer1/isic_supio.c
deleted file mode 100644
index 6c58ad218425f..0000000000000
--- a/sys/i4b/layer1/isic_supio.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 1998 Ignatios Souvatzis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * isic_supio.c - Amiga supio pseudo bus frontend for i4b_isic driver
- * supports:
- * - ISDN Blaster 5001/1
- * - ISDN Master 2092/64
- * But we attach to the supio, so just see "isic".
- * -----------------------------------------------
- *
- * $Id: isic_supio.c,v 1.5 1998/12/19 12:07:55 hm Exp $
- *
- * last edit-date: [Mon Nov 16 12:29:19 1998]
- *
- * -is original implementation
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <amiga/dev/supio.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/layer1/i4b_isac.h>
-
-/*static*/ int isic_supio_match __P((struct device *, struct cfdata *, void *));
-/*static*/ void isic_supio_attach __P((struct device *, struct device *, void *));
-
-/*static*/ u_int8_t aster_read_reg __P((struct isic_softc *sc, int what,
- bus_size_t offs));
-/*static*/ void aster_write_reg __P((struct isic_softc *sc, int what,
- bus_size_t offs, u_int8_t data));
-/*static*/ void aster_read_fifo __P((struct isic_softc *sc, int what,
- void *buf, size_t size));
-/*static*/ void aster_write_fifo __P((struct isic_softc *sc, int what,
- const void *data, size_t size));
-
-static int supio_isicattach __P((struct isic_softc *sc));
-
-struct isic_supio_softc {
- struct isic_softc sc_isic;
- struct isr sc_isr;
- struct bus_space_tag sc_bst;
-};
-
-struct cfattach isic_supio_ca = {
- sizeof(struct isic_supio_softc), isic_supio_match, isic_supio_attach
-};
-
-/*
- * Probe card
- */
-/*static*/ int
-isic_supio_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
-{
- struct supio_attach_args *sap = aux;
-
- /* ARGSUSED */
- return (!strcmp("isic", sap->supio_name));
-}
-
-int isic_supio_ipl = 2;
-/*
- * Attach the card
- */
-/*static*/ void
-isic_supio_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct isic_supio_softc *ssc = (void *)self;
- struct isic_softc *sc = &ssc->sc_isic;
- struct supio_attach_args *sap = aux;
-
- bus_space_tag_t bst;
- bus_space_handle_t h;
-
- /* setup parameters */
- sc->sc_cardtyp = CARD_TYPEP_BLMASTER;
- sc->sc_num_mappings = 3;
- sc->sc_unit = sc->sc_dev.dv_unit; /* XXX ??? */
-
- /* create io mappings */
- MALLOC_MAPS(sc);
-
- bst = sap->supio_iot;
- bus_space_map(bst, sap->supio_iobase, 0x400, 0, &h);
-
- /* ISAC */
- sc->sc_maps[0].t = bst;
- sc->sc_maps[0].h = h;
- sc->sc_maps[0].offset = 0x300/2;
- sc->sc_maps[0].size = 0; /* foreign mapping, leave it alone */
-
- /* HSCX A */
- sc->sc_maps[1].t = bst;
- sc->sc_maps[1].h = h;
- sc->sc_maps[1].offset = 0x100/2;
- sc->sc_maps[1].size = 0; /* foreign mapping, leave it alone */
-
- /* HSCX B */
- sc->sc_maps[2].t = bst;
- sc->sc_maps[2].h = h;
- sc->sc_maps[2].offset = 0x180/2;
- sc->sc_maps[2].size = 0; /* foreign mapping, leave it alone */
-
- sc->clearirq = NULL;
- sc->readreg = aster_read_reg;
- sc->writereg = aster_write_reg;
- sc->readfifo = aster_read_fifo;
- sc->writefifo = aster_write_fifo;
-
- /* setup card type */
- sc->sc_cardtyp = CARD_TYPEP_BLMASTER;
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* enable RTS on HSCX A */
- aster_write_reg(sc, ISIC_WHAT_HSCXA, H_MODE, HSCX_MODE_RTS);
-
- /* MI initialization of card */
-
- printf("\n");
- supio_isicattach(sc);
-
- ssc->sc_isr.isr_intr = isicintr;
- ssc->sc_isr.isr_arg = sc;
- ssc->sc_isr.isr_ipl = isic_supio_ipl; /* XXX */
- add_isr(&ssc->sc_isr);
-}
-
-#if 0
-int
-isic_supiointr(p)
- void *p;
-{
- /* XXX should test whether it is our interupt at all */
- add_sicallback((sifunc_t)isicintr, p, NULL);
- return 1;
-}
-#endif
-
-/*static*/ void
-aster_read_fifo(struct isic_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- bus_space_read_multi_1(t, h, o, buf, size);
-}
-
-/*static*/ void
-aster_write_fifo(struct isic_softc *sc, int what, const void *buf, size_t size)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- bus_space_write_multi_1(t, h, o, (u_int8_t*)buf, size);
-}
-
-/*static*/ u_int8_t
-aster_read_reg(struct isic_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- return bus_space_read_1(t, h, o + offs);
-}
-
-/*static*/ void
-aster_write_reg(struct isic_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = sc->sc_maps[what].t;
- bus_space_handle_t h = sc->sc_maps[what].h;
- bus_size_t o = sc->sc_maps[what].offset;
-
- bus_space_write_1(t, h, o + offs, data);
-}
-
-/*---------------------------------------------------------------------------*
- * card independend attach for pcmcia^Wsupio cards
- * XXX this should be centralized!
- *---------------------------------------------------------------------------*/
-
-/*
- * parameter and format for message producing e.g. "isic0: "
- * there is no FreeBSD/Amiga, so just:
- */
-
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-
-int
-supio_isicattach(struct isic_softc *sc)
-{
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- isic_sc[sc->sc_unit] = sc;
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return(0);
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-
- return(1);
-}
-
diff --git a/sys/i4b/layer1/pci_isic.c b/sys/i4b/layer1/pci_isic.c
deleted file mode 100644
index 6f929e52cca69..0000000000000
--- a/sys/i4b/layer1/pci_isic.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * pci_isic.c - pcmcia bus frontend for i4b_isic driver
- * -------------------------------------------------------
- *
- * $Id: pci_isic.c,v 1.1 1998/12/16 13:39:47 hm Exp $
- *
- * last edit-date: [Mon Nov 16 20:37:32 1998]
- *
- * -mh original implementation
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcidevs.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-
-static int pci_isic_match __P((struct device *, struct cfdata *, void *));
-static void pci_isic_attach __P((struct device *, struct device *, void *));
-static const struct isic_pci_product * find_matching_card __P((struct pci_attach_args *pa));
-
-extern void isic_attach_Eqs1pp __P((struct isic_softc *sc, struct pci_attach_args *pa));
-static int isic_pciattach __P((struct isic_softc *sc));
-
-struct pci_isic_softc {
- struct isic_softc sc_isic; /* parent class */
-
- /* PCI-specific goo */
- void *sc_ih; /* interrupt handler */
-};
-
-struct cfattach pci_isic_ca = {
- sizeof(struct pci_isic_softc), pci_isic_match, pci_isic_attach
-};
-
-
-static const struct isic_pci_product {
- pci_vendor_id_t npp_vendor;
- pci_product_id_t npp_product;
- int cardtype;
- int flag;
- const char * name;
- void (*attach)(struct isic_softc *sc, struct pci_attach_args *pa);
-} isic_pci_products[] = {
- { PCI_VENDOR_ELSA, 0x1000,
- CARD_TYPEP_ELSAQS1PCI, FLAG_ELSA_QS1P_PCI,
- "ELSA QuickStep 1000pro/PCI",
- isic_attach_Eqs1pp },
-
- { 0, 0, 0, 0, NULL, NULL },
-};
-
-static const struct isic_pci_product * find_matching_card(pa)
- struct pci_attach_args *pa;
-{
- const struct isic_pci_product * pp = NULL;
-
- for (pp = isic_pci_products; pp->npp_vendor; pp++)
- if (PCI_VENDOR(pa->pa_id) == pp->npp_vendor &&
- PCI_PRODUCT(pa->pa_id) == pp->npp_product)
- return pp;
-
- return NULL;
-}
-
-/*
- * Match card
- */
-static int
-pci_isic_match(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
-{
- struct pci_attach_args *pa = aux;
-
- if (!find_matching_card(pa))
- return 0;
-
- return 1;
-}
-
-/*
- * Attach the card
- */
-static void
-pci_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct pci_isic_softc *psc = (void*) self;
- struct isic_softc *sc = &psc->sc_isic;
- struct pci_attach_args *pa = aux;
- pci_chipset_tag_t pc = pa->pa_pc;
- pci_intr_handle_t ih;
- const struct isic_pci_product * prod;
- const char *intrstr;
-
- /* Redo probe */
- prod = find_matching_card(pa);
- if (prod == NULL) return; /* oops - not found?!? */
-
- sc->sc_unit = sc->sc_dev.dv_unit;
- printf(": %s\n", prod->name);
-
- /* card initilization and sc setup */
- prod->attach(sc, pa);
-
- /* generic setup */
- isic_pciattach(sc);
-
- /* Map and establish the interrupt. */
- if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,
- pa->pa_intrline, &ih)) {
- printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname);
- return;
- }
- intrstr = pci_intr_string(pc, ih);
- psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, isicintr, sc);
- if (psc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt",
- sc->sc_dev.dv_xname);
- if (intrstr != NULL)
- printf(" at %s", intrstr);
- printf("\n");
- return;
- }
- printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);
-}
-
-/*---------------------------------------------------------------------------*
- * isic - pci device driver attach routine
- *---------------------------------------------------------------------------*/
-static int
-isic_pciattach(sc)
- struct isic_softc *sc;
-{
- int ret = 0;
-
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- isic_sc[sc->sc_unit] = sc; /* XXX - hack! */
-
- sc->sc_isac_version = 0;
- sc->sc_hscx_version = 0;
-
- if(sc->sc_ipac)
- {
- ret = IPAC_READ(IPAC_ID);
-
- switch(ret)
- {
- case 0x01:
- printf("%s: IPAC PSB2115 Version 1.1\n", sc->sc_dev.dv_xname);
- break;
-
- default:
- printf("%s: Error, IPAC version %d unknown!\n",
- sc->sc_dev.dv_xname, ret);
- return(0);
- break;
- }
- }
- else
- {
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- printf("%s: ISAC %s (IOM-%c)\n",
- sc->sc_dev.dv_xname,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- break;
-
- default:
- printf("%s: Error, ISAC version %d unknown!\n",
- sc->sc_dev.dv_xname, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- printf("%s: HSCX %s\n",
- sc->sc_dev.dv_xname,
- HSCXversion[sc->sc_hscx_version]);
- break;
-
- default:
- printf("%s: Error, HSCX version %d unknown!\n",
- sc->sc_dev.dv_xname, sc->sc_hscx_version);
- return(0);
- break;
- }
- }
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
-#if defined(__FreeBSD__) && __FreeBSD__ >=3
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-#endif
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- return(1);
-}
-
diff --git a/sys/i4b/layer1/pcmcia_isic.c b/sys/i4b/layer1/pcmcia_isic.c
deleted file mode 100644
index 9d428a1b3cefe..0000000000000
--- a/sys/i4b/layer1/pcmcia_isic.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * pcmcia_isic.c - pcmcia bus frontend for i4b_isic driver
- * -------------------------------------------------------
- *
- * $Id: pcmcia_isic.c,v 1.3 1998/12/05 18:05:04 hm Exp $
- *
- * last edit-date: [Fri Dec 4 10:38:43 1998]
- *
- * -mh original implementation
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <machine/cpu.h>
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <dev/pcmcia/pcmciareg.h>
-#include <dev/pcmcia/pcmciavar.h>
-#include <dev/pcmcia/pcmciadevs.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_ipac.h>
-#include <i4b/layer1/i4b_isac.h>
-#include <i4b/layer1/i4b_hscx.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/pcmcia_isic.h>
-
-static int pcmcia_isic_match __P((struct device *, struct cfdata *, void *));
-static void pcmcia_isic_attach __P((struct device *, struct device *, void *));
-static const struct isic_pcmcia_card_entry * find_matching_card __P((struct pcmcia_attach_args *pa));
-static int pcmcia_isicattach __P((struct isic_softc *sc));
-
-struct cfattach pcmcia_isic_ca = {
- sizeof(struct pcmcia_isic_softc), pcmcia_isic_match, pcmcia_isic_attach
-};
-
-struct isic_pcmcia_card_entry {
- int32_t vendor; /* vendor ID */
- int32_t product; /* product ID */
- char *cis1_info[4]; /* CIS info to match */
- char *name; /* name of controller */
- int function; /* expected PCMCIA function type */
- int card_type; /* card type found */
- isic_pcmcia_attach_func attach; /* card initialization */
-};
-
-static const struct isic_pcmcia_card_entry card_list[] = {
-
-#ifdef AVM_PCMCIA
- { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
- { "AVM", "ISDN A", NULL, NULL },
- "AVM Fritz!Card", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_PCFRITZ, isic_attach_fritzpcmcia },
-#endif
-
-#ifdef ELSA_ISDNMC
- { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
- { "ELSA GmbH, Aachen", "MicroLink ISDN/MC ", NULL, NULL },
- "ELSA MicroLink ISDN/MC", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_ELSAMLIMC, isic_attach_elsaisdnmc },
- { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID,
- { "ELSA AG, Aachen", "MicroLink ISDN/MC ", NULL, NULL },
- "ELSA MicroLink ISDN/MC", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_ELSAMLIMC, isic_attach_elsaisdnmc },
-#endif
-
-#ifdef ELSA_MCALL
- { 0x105, 0x410a,
- { "ELSA", "MicroLink MC all", NULL, NULL },
- "ELSA MicroLink MCall", PCMCIA_FUNCTION_NETWORK,
- CARD_TYPEP_ELSAMLMCALL, isic_attach_elsamcall },
-#endif
-
-};
-#define NUM_MATCH_ENTRIES (sizeof(card_list)/sizeof(card_list[0]))
-
-static const struct isic_pcmcia_card_entry *
-find_matching_card(pa)
- struct pcmcia_attach_args *pa;
-{
- int i, j;
-
- for (i = 0; i < NUM_MATCH_ENTRIES; i++) {
- if (card_list[i].vendor != PCMCIA_VENDOR_INVALID && pa->card->manufacturer != card_list[i].vendor)
- continue;
- if (card_list[i].product != PCMCIA_PRODUCT_INVALID && pa->card->product != card_list[i].product)
- continue;
- if (pa->pf->function != card_list[i].function)
- continue;
- for (j = 0; j < 4; j++) {
- if (card_list[i].cis1_info[j] == NULL)
- continue; /* wildcard */
- if (pa->card->cis1_info[j] == NULL)
- break; /* not available */
- if (strcmp(pa->card->cis1_info[j], card_list[i].cis1_info[j]) != 0)
- break; /* mismatch */
- }
- if (j >= 4)
- break;
- }
- if (i >= NUM_MATCH_ENTRIES)
- return NULL;
-
- return &card_list[i];
-}
-
-/*
- * Match card
- */
-static int
-pcmcia_isic_match(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
-{
- struct pcmcia_attach_args *pa = aux;
-
- if (!find_matching_card(pa))
- return 0;
-
- return 1;
-}
-
-/*
- * Attach the card
- */
-static void
-pcmcia_isic_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct pcmcia_isic_softc *psc = (void*) self;
- struct isic_softc *sc = &psc->sc_isic;
- struct pcmcia_attach_args *pa = aux;
- struct pcmcia_config_entry *cfe;
- const struct isic_pcmcia_card_entry * cde;
-
- /* Which card is it? */
- cde = find_matching_card(pa);
- if (cde == NULL) return; /* oops - not found?!? */
-
- psc->sc_pf = pa->pf;
- cfe = pa->pf->cfe_head.sqh_first;
-
- /* Enable the card */
- pcmcia_function_init(pa->pf, cfe);
- pcmcia_function_enable(pa->pf);
-
- if (!cde->attach(psc, cfe, pa))
- return; /* Ooops ? */
-
- sc->sc_unit = sc->sc_dev.dv_unit;
-
- /* Announce card name */
- printf(": %s\n", cde->name);
-
- /* MI initilization */
- pcmcia_isicattach(sc);
-
- /* setup interrupt */
- psc->sc_ih = pcmcia_intr_establish(pa->pf, IPL_NET, isicintr, sc);
-}
-
-/*---------------------------------------------------------------------------*
- * card independend attach for pcmicia cards
- *---------------------------------------------------------------------------*/
-
-/* parameter and format for message producing e.g. "isic0: " */
-
-#ifdef __FreeBSD__
-#define ISIC_FMT "isic%d: "
-#define ISIC_PARM dev->id_unit
-#define TERMFMT " "
-#else
-#define ISIC_FMT "%s: "
-#define ISIC_PARM sc->sc_dev.dv_xname
-#define TERMFMT "\n"
-#endif
-
-int
-pcmcia_isicattach(struct isic_softc *sc)
-{
- static char *ISACversion[] = {
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- "2085 Version B1",
- "2085 Version B2",
- "2085 Version V2.3 (B3)",
- "Unknown Version"
- };
-
- static char *HSCXversion[] = {
- "82525 Version A1",
- "Unknown (0x01)",
- "82525 Version A2",
- "Unknown (0x03)",
- "82525 Version A3",
- "82525 or 21525 Version 2.1",
- "Unknown Version"
- };
-
- isic_sc[sc->sc_unit] = sc;
- sc->sc_isac_version = 0;
- sc->sc_isac_version = ((ISAC_READ(I_RBCH)) >> 5) & 0x03;
-
- switch(sc->sc_isac_version)
- {
- case ISAC_VA:
- case ISAC_VB1:
- case ISAC_VB2:
- case ISAC_VB3:
- break;
-
- default:
- printf(ISIC_FMT "Error, ISAC version %d unknown!\n",
- ISIC_PARM, sc->sc_isac_version);
- return(0);
- break;
- }
-
- sc->sc_hscx_version = HSCX_READ(0, H_VSTR) & 0xf;
-
- switch(sc->sc_hscx_version)
- {
- case HSCX_VA1:
- case HSCX_VA2:
- case HSCX_VA3:
- case HSCX_V21:
- break;
-
- default:
- printf(ISIC_FMT "Error, HSCX version %d unknown!\n",
- ISIC_PARM, sc->sc_hscx_version);
- return(0);
- break;
- };
-
- /* ISAC setup */
-
- isic_isac_init(sc);
-
- /* HSCX setup */
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- isic_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* setup linktab */
-
- isic_init_linktab(sc);
-
- /* set trace level */
-
- sc->sc_trace = TRACE_OFF;
-
- sc->sc_state = ISAC_IDLE;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL;
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL;
- sc->sc_freeflag2 = 0;
-
- /* init higher protocol layers */
-
- MPH_Status_Ind(sc->sc_unit, STI_ATTACH, sc->sc_cardtyp);
-
- /* announce chip versions */
-
- if(sc->sc_isac_version >= ISAC_UNKN)
- {
- printf(ISIC_FMT "ISAC Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_isac_version);
- sc->sc_isac_version = ISAC_UNKN;
- }
- else
- {
- printf(ISIC_FMT "ISAC %s (IOM-%c)" TERMFMT,
- ISIC_PARM,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
- }
-
- if(sc->sc_hscx_version >= HSCX_UNKN)
- {
- printf(ISIC_FMT "HSCX Version UNKNOWN (VN=0x%x)" TERMFMT,
- ISIC_PARM,
- sc->sc_hscx_version);
- sc->sc_hscx_version = HSCX_UNKN;
- }
- else
- {
- printf(ISIC_FMT "HSCX %s" TERMFMT,
- ISIC_PARM,
- HSCXversion[sc->sc_hscx_version]);
- }
-
- return(1);
-}
-
diff --git a/sys/i4b/layer1/pcmcia_isic.h b/sys/i4b/layer1/pcmcia_isic.h
deleted file mode 100644
index 73f52d6930203..0000000000000
--- a/sys/i4b/layer1/pcmcia_isic.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1998 Martin Husemann. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- * 4. Altered versions must be plainly marked as such, and must not be
- * misrepresented as being the original software and/or documentation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * pcmcia_isic.h - common definitions for pcmcia isic cards
- * --------------------------------------------------------
- *
- * $Id: pcmcia_isic.h,v 1.1 1998/12/02 06:44:30 hm Exp $
- *
- * last edit-date: [Mon Nov 30 21:19:14 1998]
- *
- * -mh original implementation
- *
- *---------------------------------------------------------------------------*/
-
-struct pcmcia_isic_softc {
- struct isic_softc sc_isic; /* parent class */
-
- /* PCMCIA-specific goo */
- struct pcmcia_io_handle sc_pcioh; /* PCMCIA i/o space info */
- int sc_io_window; /* our i/o window */
- struct pcmcia_function *sc_pf; /* our PCMCIA function */
- void *sc_ih; /* interrupt handler */
-};
-
-typedef int (*isic_pcmcia_attach_func)(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-
-extern int isic_attach_fritzpcmcia(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-extern int isic_attach_elsaisdnmc(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-extern int isic_attach_elsamcall(struct pcmcia_isic_softc *sc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa);
-
-
diff --git a/sys/i4b/layer2/i4b_iframe.c b/sys/i4b/layer2/i4b_iframe.c
deleted file mode 100644
index c5e38d80f8ece..0000000000000
--- a/sys/i4b/layer2/i4b_iframe.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_iframe.c - i frame handling routines
- * ------------------------------------------
- *
- * $Id: i4b_iframe.c,v 1.15 1998/12/05 18:05:06 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:26:16 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_trace.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * process i frame
- * implements the routine "I COMMAND" Q.921 03/93 pp 77
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_i_frame(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
- int nr;
- int ns;
- int p;
- int x;
-
- if(!((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI)))))
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- if((l2sc->Q921_state != ST_MULTIFR) && (l2sc->Q921_state != ST_TIMREC))
- {
- i4b_Dfreembuf(m);
- DBGL2(L2_I_ERR, "i4b_rxd_i_frame", ("ERROR, state != (MF || TR)!\n"));
- return;
- }
-
- x = SPLI4B();
-
- nr = GETINR(*(ptr + OFF_INR));
- ns = GETINS(*(ptr + OFF_INS));
- p = GETIP(*(ptr + OFF_INR));
-
- i4b_rxd_ack(l2sc, nr); /* last packet ack */
-
- if(l2sc->own_busy) /* own receiver busy ? */
- {
- i4b_Dfreembuf(m); /* yes, discard information */
-
- if(p == 1) /* P bit == 1 ? */
- {
- i4b_tx_rnr_response(l2sc, p); /* yes, tx RNR */
- l2sc->ack_pend = 0; /* clear ACK pending */
- }
- }
- else /* own receiver ready */
- {
- if(ns == l2sc->vr) /* expected sequence number ? */
- {
- M128INC(l2sc->vr); /* yes, update */
-
- l2sc->rej_excpt = 0; /* clr reject exception */
-
- m_adj(m, I_HDR_LEN); /* strip i frame header */
-
- l2sc->iframe_sent = 0; /* reset i acked already */
-
- DL_Data_Ind(l2sc->unit, m); /* pass data up */
-
- if(!l2sc->iframe_sent)
- {
- i4b_tx_rr_response(l2sc, p); /* yes, tx RR */
- l2sc->ack_pend = 0; /* clr ACK pending */
- }
- }
- else /* ERROR, sequence number NOT expected */
- {
- i4b_Dfreembuf(m); /* discard information */
-
- if(l2sc->rej_excpt == 1) /* already exception ? */
- {
- if(p == 1) /* immediate response ? */
- {
- i4b_tx_rr_response(l2sc, p); /* yes, tx RR */
- l2sc->ack_pend = 0; /* clr ack pend */
- }
- }
- else /* not in exception cond */
- {
- l2sc->rej_excpt = 1; /* set exception */
- i4b_tx_rej_response(l2sc, p); /* tx REJ */
- l2sc->ack_pend = 0; /* clr ack pending */
- }
- }
- }
-
- /* sequence number ranges as expected ? */
-
- if(i4b_l2_nr_ok(nr, l2sc->va, l2sc->vs))
- {
- if(l2sc->Q921_state == ST_TIMREC)
- {
- l2sc->va = nr;
- splx(x);
- return;
- }
-
- if(l2sc->peer_busy) /* yes, other side busy ? */
- {
- l2sc->va = nr; /* yes, update ack count */
- }
- else /* other side ready */
- {
- if(nr == l2sc->vs) /* count expected ? */
- {
- l2sc->va = nr; /* update ack */
- i4b_T200_stop(l2sc);
- i4b_T203_restart(l2sc);
- }
- else
- {
- if(nr != l2sc->va)
- {
- l2sc->va = nr;
- i4b_T200_restart(l2sc);
- }
- }
- }
- }
- else
- {
- i4b_nr_error_recovery(l2sc); /* sequence error */
- l2sc->Q921_state = ST_AW_EST;
- }
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * internal I FRAME QUEUED UP routine (Q.921 03/93 p 61)
- *---------------------------------------------------------------------------*/
-void
-i4b_i_frame_queued_up(l2_softc_t *l2sc)
-{
- int x;
- struct mbuf *m;
- u_char *ptr;
-
- x = SPLI4B();
-
- if(l2sc->peer_busy)
- {
- DBGL2(L2_I_MSG, "i4b_i_frame_queued_up", ("peer busy!\n"));
- i4b_print_l2var(l2sc);
- splx(x);
- return;
- }
-
- if(l2sc->vs == ((l2sc->va + MAX_K_VALUE) & 127))
- {
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("V(S) == ((V(A) + k) & 127)!\n"));
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("state = %s\n", i4b_print_l2state(l2sc)));
- i4b_print_l2var(l2sc);
- splx(x);
- return;
- }
-
- IF_DEQUEUE(&l2sc->i_queue, m); /* fetch next frame to tx */
-
- if(!m)
- {
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("ERROR, mbuf NULL after IF_DEQUEUE\n"));
- splx(x);
- return;
- }
-
- ptr = m->m_data;
-
- PUTSAPI(SAPI_CCP, CR_CMD_TO_NT, *(ptr + OFF_SAPI));
- PUTTEI(l2sc->tei, *(ptr + OFF_TEI));
-
- *(ptr + OFF_INS) = (l2sc->vs << 1) & 0xfe; /* bit 0 = 0 */
- *(ptr + OFF_INR) = (l2sc->vr << 1) & 0xfe; /* P bit = 0 */
-
- PH_Data_Req(l2sc->unit, m, MBUF_DONTFREE); /* free'd when ack'd ! */
-
- l2sc->iframe_sent = 1; /* in case we ack an I frame with another I frame */
-
- if(l2sc->ua_num != UA_EMPTY) /* failsafe */
- {
- DBGL2(L2_I_ERR, "i4b_i_frame_queued_up", ("ERROR, l2sc->ua_num: %d != UA_EMPTY\n", l2sc->ua_num));
- i4b_print_l2var(l2sc);
- i4b_Dfreembuf(l2sc->ua_frame);
- }
-
- l2sc->ua_frame = m; /* save unacked frame */
- l2sc->ua_num = l2sc->vs; /* save frame number */
-
- M128INC(l2sc->vs);
-
- l2sc->ack_pend = 0;
-
- splx(x);
-
- if(l2sc->T200 == TIMER_IDLE)
- {
- i4b_T203_stop(l2sc);
- i4b_T200_start(l2sc);
- }
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_l2.c b/sys/i4b/layer2/i4b_l2.c
deleted file mode 100644
index 5cdc1c7cc582a..0000000000000
--- a/sys/i4b/layer2/i4b_l2.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2.c - ISDN layer 2 (Q.921)
- * -------------------------------
- *
- * $Id: i4b_l2.c,v 1.23 1998/12/05 18:05:08 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:27:00 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-int i4b_dl_establish_ind(int);
-int i4b_dl_establish_cnf(int);
-int i4b_dl_release_ind(int);
-int i4b_dl_release_cnf(int);
-int i4b_dl_data_ind(int, struct mbuf *);
-int i4b_dl_unit_data_ind(int, struct mbuf *);
-
-static int i4b_mdl_command_req(int, int, int);
-
-/* from layer 2 */
-
-extern int i4b_mdl_attach_ind(int, int);
-extern int i4b_mdl_status_ind(int, int, int);
-
-/* this layers debug level */
-
-unsigned int i4b_l2_debug = L2_DEBUG_DEFAULT;
-
-struct i4b_l2l3_func i4b_l2l3_func = {
-
- /* Layer 2 --> Layer 3 */
-
- (int (*)(int)) i4b_dl_establish_ind,
- (int (*)(int)) i4b_dl_establish_cnf,
- (int (*)(int)) i4b_dl_release_ind,
- (int (*)(int)) i4b_dl_release_cnf,
- (int (*)(int, struct mbuf *)) i4b_dl_data_ind,
- (int (*)(int, struct mbuf *)) i4b_dl_unit_data_ind,
-
- /* Layer 3 --> Layer 2 */
-
- (int (*)(int)) i4b_dl_establish_req,
- (int (*)(int)) i4b_dl_release_req,
- (int (*)(int, struct mbuf *)) i4b_dl_data_req,
- (int (*)(int, struct mbuf *)) i4b_dl_unit_data_req,
-
- /* Layer 2 --> Layer 3 management */
-
- (int (*)(int, int, int)) i4b_mdl_status_ind,
-
- /* Layer 3 --> Layer 2 management */
-
- (int (*)(int, int, int)) i4b_mdl_command_req
-};
-
-/*---------------------------------------------------------------------------*
- * DL_ESTABLISH_REQ from layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_establish_req(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL2(L2_PRIM, "DL-ESTABLISH-REQ", ("unit %d\n",unit));
- i4b_l1_activate(l2sc);
- i4b_next_l2state(l2sc, EV_DLESTRQ);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL_RELEASE_REQ from layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_release_req(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL2(L2_PRIM, "DL-RELEASE-REQ", ("unit %d\n",unit));
- i4b_next_l2state(l2sc, EV_DLRELRQ);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL UNIT DATA REQUEST from Layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_unit_data_req(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-UNIT-DATA-REQ", ("unit %d\n",unit));
-#endif
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL DATA REQUEST from Layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_data_req(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- int x;
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-DATA-REQ", ("unit %d\n",unit));
-#endif
- switch(l2sc->Q921_state)
- {
- case ST_AW_EST:
- case ST_MULTIFR:
- case ST_TIMREC:
-
- if(IF_QFULL(&l2sc->i_queue))
- {
- DBGL2(L2_ERROR, "i4b_dl_data_req", ("i_queue full!!\n"));
- i4b_Dfreembuf(m);
- }
- else
- {
- x = splimp();
- IF_ENQUEUE(&l2sc->i_queue, m);
- splx(x);
- i4b_i_frame_queued_up(l2sc);
- }
- break;
-
- default:
- DBGL2(L2_ERROR, "i4b_dl_data_req", ("unit %d ERROR in state [%s], freeing mbuf\n", unit, i4b_print_l2state(l2sc)));
- i4b_Dfreembuf(m);
- break;
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_ph_activate_ind - link activation indication from layer 1
- *---------------------------------------------------------------------------*/
-int
-i4b_ph_activate_ind(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL1(L1_PRIM, "PH-ACTIVATE-IND", ("unit %d\n",unit));
- l2sc->ph_active = PH_ACTIVE;
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_ph_deactivate_ind - link deactivation indication from layer 1
- *---------------------------------------------------------------------------*/
-int
-i4b_ph_deactivate_ind(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- DBGL1(L1_PRIM, "PH-DEACTIVATE-IND", ("unit %d\n",unit));
- l2sc->ph_active = PH_INACTIVE;
- return(0);
-}
-
-
-/*---------------------------------------------------------------------------*
- * i4b_l2_unit_init - place layer 2 unit into known state
- *---------------------------------------------------------------------------*/
-static void
-i4b_l2_unit_init(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- l2sc->Q921_state = ST_TEI_UNAS;
- l2sc->tei_valid = TEI_INVALID;
- l2sc->vr = 0;
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->ack_pend = 0;
- l2sc->rej_excpt = 0;
- l2sc->peer_busy = 0;
- l2sc->own_busy = 0;
- l2sc->l3initiated = 0;
-
- l2sc->rxd_CR = 0;
- l2sc->rxd_PF = 0;
- l2sc->rxd_NR = 0;
- l2sc->RC = 0;
- l2sc->iframe_sent = 0;
-
- l2sc->postfsmfunc = NULL;
-
- if(l2sc->ua_num != UA_EMPTY)
- {
- i4b_Dfreembuf(l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
- l2sc->ua_frame = NULL;
- }
-
- i4b_T200_stop(l2sc);
- i4b_T202_stop(l2sc);
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_mph_status_ind - status indication upward
- *---------------------------------------------------------------------------*/
-int
-i4b_mph_status_ind(int unit, int status, int parm)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- int sendup = 1;
-
- int x = SPLI4B();
-
- DBGL1(L1_PRIM, "MPH-STATUS-IND", ("unit %d, status=%d, parm=%d\n", unit, status, parm));
-
- switch(status)
- {
- case STI_ATTACH:
- l2sc->unit = unit;
- l2sc->i_queue.ifq_maxlen = IQUEUE_MAXLEN;
- l2sc->ua_frame = NULL;
- i4b_l2_unit_init(unit);
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- /* initialize the callout handles for timeout routines */
- callout_handle_init(&l2sc->T200_callout);
- callout_handle_init(&l2sc->T202_callout);
- callout_handle_init(&l2sc->T203_callout);
-#endif
- break;
-
- case STI_L1STAT: /* state of layer 1 */
- break;
-
- case STI_PDEACT: /* Timer 4 expired */
- if((l2sc->Q921_state >= ST_AW_EST) &&
- (l2sc->Q921_state <= ST_TIMREC))
- {
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("unit %d, persistent deactivation!\n", unit));
- i4b_l2_unit_init(unit);
- }
- else
- {
- sendup = 0;
- }
- break;
-
- case STI_NOL1ACC:
- i4b_l2_unit_init(unit);
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("unit %d, cannot access S0 bus!\n", unit));
- break;
-
- default:
- DBGL2(L2_ERROR, "i4b_mph_status_ind", ("ERROR, unit %d, unknown status message!\n", unit));
- break;
- }
-
- if(sendup)
- MDL_Status_Ind(unit, status, parm); /* send up to layer 3 */
-
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * MDL_COMMAND_REQ from layer 3
- *---------------------------------------------------------------------------*/
-int i4b_mdl_command_req(int unit, int command, int parm)
-{
- DBGL2(L2_PRIM, "MDL-COMMAND-REQ", ("unit %d, command=%d, parm=%d\n", unit, command, parm));
-
- switch(command)
- {
- case CMR_DOPEN:
- i4b_l2_unit_init(unit);
- break;
- }
-
- MPH_Command_Req(unit, command, parm);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_ph_data_ind - process a rx'd frame got from layer 1
- *---------------------------------------------------------------------------*/
-int
-i4b_ph_data_ind(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL1(L1_PRIM, "PH-DATA-IND", ("unit %d\n", unit));
-#endif
- u_char *ptr = m->m_data;
-
- if ( (*(ptr + OFF_CNTL) & 0x01) == 0 )
- {
- if(m->m_len < 4) /* 6 oct - 2 chksum oct */
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, I-frame < 6 octetts!\n"));
- i4b_Dfreembuf(m);
- return(0);
- }
- i4b_rxd_i_frame(unit, m);
- }
- else if ( (*(ptr + OFF_CNTL) & 0x03) == 0x01 )
- {
- if(m->m_len < 4) /* 6 oct - 2 chksum oct */
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, S-frame < 6 octetts!\n"));
- i4b_Dfreembuf(m);
- return(0);
- }
- i4b_rxd_s_frame(unit, m);
- }
- else if ( (*(ptr + OFF_CNTL) & 0x03) == 0x03 )
- {
- if(m->m_len < 3) /* 5 oct - 2 chksum oct */
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, U-frame < 5 octetts!\n"));
- i4b_Dfreembuf(m);
- return(0);
- }
- i4b_rxd_u_frame(unit, m);
- }
- else
- {
- DBGL2(L2_ERROR, "i4b_ph_data_ind", ("ERROR, bad frame rx'd - "));
- i4b_print_frame(m->m_len, m->m_data);
- i4b_Dfreembuf(m);
- }
- return(0);
-}
-
-#endif /* NI4BQ921 > 0 */
-
diff --git a/sys/i4b/layer2/i4b_l2.h b/sys/i4b/layer2/i4b_l2.h
deleted file mode 100644
index ab1dfd7cd549d..0000000000000
--- a/sys/i4b/layer2/i4b_l2.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2.h - ISDN layer 2 (Q.921) definitions
- * ---------------------------------------------
- *
- * $Id: i4b_l2.h,v 1.14 1998/12/05 18:05:09 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:27:13 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L2_H_
-#define _I4B_L2_H_
-
-typedef struct {
- int unit; /* unit number this entry is for */
-
- int Q921_state; /* state according to Q.921 */
-
- u_char last_ril; /* last reference number from TEI management */
- u_char last_rih;
-
- int tei_valid; /* tei is valid flag */
-#define TEI_INVALID 0
-#define TEI_VALID 1
- int tei; /* tei, if tei flag valid */
-
- int ph_active; /* Layer 1 active flag */
-#define PH_INACTIVE 0 /* layer 1 inactive */
-#define PH_ACTIVEPEND 1 /* already tried to activate */
-#define PH_ACTIVE 2 /* layer 1 active */
-
- int T200; /* Multiframe timeout timer */
- int T201; /* min time between TEI ID check */
- int T202; /* min time between TEI ID Req messages */
- int N202; /* TEI ID Req tx counter */
- void(*T202func)(void *);/* function to be called when T202 expires */
- int T203; /* max line idle time */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- struct callout_handle T200_callout;
- struct callout_handle T202_callout;
- struct callout_handle T203_callout;
-#endif
-
- int vr; /* receive sequence frame counter */
- int vs; /* transmit sequence frame counter */
- int va; /* acknowledge sequence frame counter */
-
- int ack_pend; /* acknowledge pending */
- int rej_excpt; /* reject exception */
- int peer_busy; /* peer receiver busy */
- int own_busy; /* own receiver busy */
- int l3initiated; /* layer 3 initiated */
-
- struct ifqueue i_queue; /* queue of outgoing i frames */
-#define IQUEUE_MAXLEN 20
-
- /* this implementation only supports a k-value of 1 !!! */
- struct mbuf *ua_frame; /* last unacked frame */
- int ua_num; /* last unacked frame number */
-#define UA_EMPTY (-1) /* ua_frame is unused */
-
- int rxd_CR; /* received Command Response bit */
- int rxd_PF; /* received Poll/Final bit */
- int rxd_NR; /* received N(R) field */
- int RC; /* Retry Counter */
-
- int iframe_sent; /* check if i frame acked by another i frame */
-
- int (*postfsmfunc)(int);/* function to be called at fsm exit */
- int postfsmarg; /* argument for above function */
-} l2_softc_t;
-
-extern l2_softc_t l2_softc[];
-
-/* Q.912 system parameters (Q.921 03/93 pp 43) */
-
-#define MAX_K_VALUE 1 /* BRI - # of outstanding frames */
-
-#define N200 3 /* max no of retransmissions */
-#define N201DEF 260 /* max no of octetts in information field */
-#define N202DEF 3 /* max no of TEI ID Request message transmissions */
-
-#define T200DEF (hz*1) /* default T200 timer value = 1 second */
-#define T201DEF T200DEF /* default T201 timer value = T200DEF */
-#define T202DEF (hz*2) /* default T202 timer value = 2 seconds */
-#define T203DEF (hz*10) /* default T203 timer value = 10 seconds*/
-
-/* modulo 128 operations */
-
-#define M128INC(v) (v)++; \
- if((v)>127) \
- { \
- v = 0; \
- }
-
-#define M128DEC(v) (v)--; \
- if((v)<0) \
- { \
- v = 127;\
- }
-
-/* P-bit values */
-
-typedef enum {
- P0,
- P1
-} pbit_t;
-
-/* F-bit values */
-
-typedef enum {
- F0,
- F1
-} fbit_t;
-
-/* CR-bit values to NT */
-
-typedef enum {
- CR_CMD_TO_NT,
- CR_RSP_TO_NT
-} crbit_to_nt_t;
-
-/* CR-bit values from NT */
-
-typedef enum {
- CR_RSP_FROM_NT,
- CR_CMD_FROM_NT
-} crbit_from_nt_t;
-
-/* address field - octett 2 */
-
-#define OFF_SAPI 0 /* SAPI offset, HDLC flag is eaten by L1 */
-#define SAPI_CCP 0 /* SAPI = 0 - call control procedures */
-#define SAPI_X25 16 /* SAPI = 16 - X.25 packet procedures */
-#define SAPI_L2M 63 /* SAPI = 63 - Layer 2 management procedures */
-
-/* extract and insert macros for SAPI octett */
-
-#define GETSAPI(octett) (((octett) >> 2) & 0x3f)
-#define PUTSAPI(sapi,cr,octett) ((octett) = (((sapi << 2) & 0xfc) | ((cr & 0x01) << 1)))
-#define GETCR(octett) (((octett) >> 1) & 0x01)
-#define GETEA(octett) ((octett) & 0x01)
-
-/* address field - octett 3 */
-
-#define OFF_TEI 1 /* TEI offset */
-#define GETTEI(octett) (((octett) >> 1) & 0x7f)
-#define PUTTEI(tei, octett) ((octett) = ((((tei) << 1) & 0xfe)) | 0x01)
-#define GROUP_TEI 127 /* broadcast TEI for LME */
-
-/* control field - octett 4 */
-
-#define OFF_CNTL 2 /* 1st byte of control field */
-
-/* S frames */
-
-#define S_FRAME_LEN 4 /* lenght of a U-frame */
-#define OFF_SRCR 2 /* 1st byte of control field, */
- /* R-commands and R-responses */
-#define OFF_SNR 3 /* 2nd byte of control field, N(R) and PF */
-#define SPFBIT 0x01 /* poll/final bit mask */
-#define SPBITSET SPFBIT
-#define SFBITSET SPFBIT
-#define GETSNR(octett) (((octett) >> 1) & 0x7f)
-#define GETSPF(octett) ((octett) & SPFBIT)
-#define RR 0x01 /* RR and bit 0 set */
-#define RNR 0x05 /* RNR and bit 0 set */
-#define REJ 0x09 /* REJ and bit 0 set */
-
-/* U frames */
-
-#define UI_HDR_LEN 3 /* length of UI header in front of L3 frame */
-#define U_FRAME_LEN 3 /* lenght of a U-frame */
-#define UPFBIT 0x10 /* poll/final bit mask */
-#define UPBITSET UPFBIT
-#define UFBITSET UPFBIT
-#define GETUPF(octett) (((octett) >> 4) & 0x01)
-
-/* commands/responses with pf bit set to 0 */
-
-#define SABME 0x6f
-#define DM 0x0f
-#define UI 0x03
-#define DISC 0x43
-#define UA 0x63
-#define FRMR 0x87
-#define XID 0xaf
-
-/* control field - octett 3 */
-
-#define OFF_MEI 3 /* 2nd byte of control field */
-
-/* control field - octett 4,5 */
-
-#define OFF_RIL 4 /* Ri low byte */
-#define OFF_RIH 5 /* Ri high byte */
-
-/* control field - octett 6 */
-
-#define OFF_MT 6 /* Message Type */
-#define OFF_AI 7 /* Action Indicator */
-#define GET_TEIFROMAI(octett) (((octett) >> 1) & 0x7f)
-
-/* I frame */
-
-#define I_HDR_LEN 4 /* length of I header in front of L3 frame */
-#define OFF_INS 2 /* transmit sequence number */
-#define OFF_INR 3 /* receive sequence number */
-#define IPFBIT 0x01 /* poll/final bit mask */
-#define IPBITSET 0x01
-#define GETINR(octett) (((octett) >> 1) & 0x7f)
-#define GETINS(octett) (((octett) >> 1) & 0x7f)
-#define GETIP(octett) ((octett) & IPFBIT)
-
-/* structure of a TEI management frame */
-
-#define TEI_MGMT_FRM_LEN 8 /* frame length */
-#define TEIM_SAPIO 0x00 /* SAPI, CR, EA */
-#define TEIM_TEIO 0x01 /* TEI, EA */
-#define TEIM_UIO 0x02 /* frame type = UI = 0x03 */
-#define TEIM_MEIO 0x03 /* management entity id = 0x0f */
-#define MEI 0x0f
-#define TEIM_RILO 0x04 /* reference number, low */
-#define TEIM_RIHO 0x05 /* reference number, high */
-#define TEIM_MTO 0x06 /* message type */
-#define MT_ID_REQEST 0x01
-#define MT_ID_ASSIGN 0x02
-#define MT_ID_DENY 0x03
-#define MT_ID_CHK_REQ 0x04
-#define MT_ID_CHK_RSP 0x05
-#define MT_ID_REMOVE 0x06
-#define MT_ID_VERIFY 0x07
-#define TEIM_AIO 0x07 /* action indicator */
-
-/* i4b_mdl_error_ind codes */
-
-enum MDL_ERROR_CODES {
- MDL_ERR_A,
- MDL_ERR_B,
- MDL_ERR_C,
- MDL_ERR_D,
- MDL_ERR_E,
- MDL_ERR_F,
- MDL_ERR_G,
- MDL_ERR_H,
- MDL_ERR_I,
- MDL_ERR_J,
- MDL_ERR_K,
- MDL_ERR_L,
- MDL_ERR_M,
- MDL_ERR_N,
- MDL_ERR_O,
- MDL_ERR_MAX
-};
-
-/* forward decl */
-
-extern void i4b_acknowledge_pending ( l2_softc_t *l2sc );
-extern struct mbuf * i4b_build_s_frame ( l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type );
-extern struct mbuf * i4b_build_u_frame ( l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type );
-extern void i4b_clear_exception_conditions ( l2_softc_t *l2sc );
-extern int i4b_dl_data_req ( int unit, struct mbuf *m );
-extern int i4b_dl_establish_req ( int unit );
-extern int i4b_dl_release_req ( int unit );
-extern int i4b_dl_unit_data_req ( int unit, struct mbuf *m );
-extern void i4b_enquiry_response ( l2_softc_t *l2sc );
-extern void i4b_establish_data_link ( l2_softc_t *l2sc );
-extern void i4b_invoke_retransmission ( l2_softc_t *l2sc, int nr );
-extern void i4b_i_frame_queued_up ( l2_softc_t *l2sc );
-extern void i4b_l1_activate ( l2_softc_t *l2sc );
-extern int i4b_l2_nr_ok ( int nr, int va, int vs );
-extern void i4b_make_rand_ri ( l2_softc_t *l2sc );
-extern void i4b_mdl_assign_ind ( l2_softc_t *l2sc );
-extern void i4b_mdl_error_ind ( l2_softc_t *l2sc, char *where, int errorcode );
-extern int i4b_mph_attach_ind ( int unit, int type );
-extern int i4b_mph_status_ind ( int unit, int status, int parm );
-extern void i4b_next_l2state ( l2_softc_t *l2sc, int event );
-extern void i4b_nr_error_recovery ( l2_softc_t *l2sc );
-extern int i4b_ph_activate_ind ( int unit );
-extern int i4b_ph_deactivate_ind ( int unit );
-extern int i4b_ph_data_ind ( int unit, struct mbuf *m );
-extern void i4b_print_frame ( int len, u_char *buf );
-extern char *i4b_print_l2state ( l2_softc_t *l2sc );
-extern void i4b_print_l2var ( l2_softc_t *l2sc );
-extern void i4b_rxd_ack(l2_softc_t *l2sc, int nr);
-extern void i4b_rxd_i_frame ( int unit, struct mbuf *m );
-extern void i4b_rxd_s_frame ( int unit, struct mbuf *m );
-extern void i4b_rxd_u_frame ( int unit, struct mbuf *m );
-extern void i4b_T200_restart ( l2_softc_t *l2sc );
-extern void i4b_T200_start ( l2_softc_t *l2sc );
-extern void i4b_T200_stop ( l2_softc_t *l2sc );
-extern void i4b_T202_start ( l2_softc_t *l2sc );
-extern void i4b_T202_stop ( l2_softc_t *l2sc );
-extern void i4b_T203_restart ( l2_softc_t *l2sc );
-extern void i4b_T203_start ( l2_softc_t *l2sc );
-extern void i4b_T203_stop ( l2_softc_t *l2sc );
-extern void i4b_tei_assign ( l2_softc_t *l2sc );
-extern void i4b_tei_chkresp ( l2_softc_t *l2sc );
-extern void i4b_tei_rxframe ( int unit, struct mbuf *m );
-extern void i4b_tei_verify ( l2_softc_t *l2sc );
-extern void i4b_transmit_enquire ( l2_softc_t *l2sc );
-extern void i4b_tx_disc ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_dm ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_frmr ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_rej_response ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_rnr_command ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_rnr_response ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_rr_command ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_rr_response ( l2_softc_t *l2sc, fbit_t fbit );
-extern void i4b_tx_sabme ( l2_softc_t *l2sc, pbit_t pbit );
-extern void i4b_tx_ua ( l2_softc_t *l2sc, fbit_t fbit );
-
-#endif /* _I4B_L2_H_ */
diff --git a/sys/i4b/layer2/i4b_l2fsm.c b/sys/i4b/layer2/i4b_l2fsm.c
deleted file mode 100644
index 113167c114295..0000000000000
--- a/sys/i4b/layer2/i4b_l2fsm.c
+++ /dev/null
@@ -1,1593 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2fsm.c - layer 2 FSM
- * -------------------------
- *
- * $Id: i4b_l2fsm.c,v 1.13 1998/12/05 18:05:11 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:28:15 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-l2_softc_t l2_softc[ISIC_MAXUNIT];
-
-static char *l2state_text[N_STATES] = {
- "ST_TEI_UNAS",
- "ST_ASG_AW_TEI",
- "ST_EST_AW_TEI",
- "ST_TEI_ASGD",
-
- "ST_AW_EST",
- "ST_AW_REL",
- "ST_MULTIFR",
- "ST_TIMREC",
-
- "ST_SUBSET",
- "Illegal State"
-};
-
-static char *l2event_text[N_EVENTS] = {
- "EV_DLESTRQ",
- "EV_DLUDTRQ",
- "EV_MDASGRQ",
- "EV_MDERRRS",
- "EV_PSDEACT",
- "EV_MDREMRQ",
- "EV_RXSABME",
- "EV_RXDISC",
- "EV_RXUA",
- "EV_RXDM",
- "EV_T200EXP",
- "EV_DLDATRQ",
- "EV_DLRELRQ",
- "EV_T203EXP",
- "EV_OWNBUSY",
- "EV_OWNRDY",
- "EV_RXRR",
- "EV_RXREJ",
- "EV_RXRNR",
- "EV_RXFRMR",
- "Illegal Event"
-};
-
-static void F_TU01 __P((l2_softc_t *));
-static void F_TU03 __P((l2_softc_t *));
-
-static void F_TA03 __P((l2_softc_t *));
-static void F_TA04 __P((l2_softc_t *));
-static void F_TA05 __P((l2_softc_t *));
-
-static void F_TE03 __P((l2_softc_t *));
-static void F_TE04 __P((l2_softc_t *));
-static void F_TE05 __P((l2_softc_t *));
-
-static void F_T01 __P((l2_softc_t *));
-static void F_T05 __P((l2_softc_t *));
-static void F_T06 __P((l2_softc_t *));
-static void F_T07 __P((l2_softc_t *));
-static void F_T08 __P((l2_softc_t *));
-static void F_T09 __P((l2_softc_t *));
-static void F_T10 __P((l2_softc_t *));
-static void F_T13 __P((l2_softc_t *));
-
-static void F_AE01 __P((l2_softc_t *));
-static void F_AE05 __P((l2_softc_t *));
-static void F_AE06 __P((l2_softc_t *));
-static void F_AE07 __P((l2_softc_t *));
-static void F_AE08 __P((l2_softc_t *));
-static void F_AE09 __P((l2_softc_t *));
-static void F_AE10 __P((l2_softc_t *));
-static void F_AE11 __P((l2_softc_t *));
-static void F_AE12 __P((l2_softc_t *));
-
-static void F_AR05 __P((l2_softc_t *));
-static void F_AR06 __P((l2_softc_t *));
-static void F_AR07 __P((l2_softc_t *));
-static void F_AR08 __P((l2_softc_t *));
-static void F_AR09 __P((l2_softc_t *));
-static void F_AR10 __P((l2_softc_t *));
-static void F_AR11 __P((l2_softc_t *));
-
-static void F_MF01 __P((l2_softc_t *));
-static void F_MF05 __P((l2_softc_t *));
-static void F_MF06 __P((l2_softc_t *));
-static void F_MF07 __P((l2_softc_t *));
-static void F_MF08 __P((l2_softc_t *));
-static void F_MF09 __P((l2_softc_t *));
-static void F_MF10 __P((l2_softc_t *));
-static void F_MF11 __P((l2_softc_t *));
-static void F_MF12 __P((l2_softc_t *));
-static void F_MF13 __P((l2_softc_t *));
-static void F_MF14 __P((l2_softc_t *));
-static void F_MF15 __P((l2_softc_t *));
-static void F_MF16 __P((l2_softc_t *));
-static void F_MF17 __P((l2_softc_t *));
-static void F_MF18 __P((l2_softc_t *));
-static void F_MF19 __P((l2_softc_t *));
-static void F_MF20 __P((l2_softc_t *));
-
-static void F_TR01 __P((l2_softc_t *));
-static void F_TR05 __P((l2_softc_t *));
-static void F_TR06 __P((l2_softc_t *));
-static void F_TR07 __P((l2_softc_t *));
-static void F_TR08 __P((l2_softc_t *));
-static void F_TR09 __P((l2_softc_t *));
-static void F_TR10 __P((l2_softc_t *));
-static void F_TR11 __P((l2_softc_t *));
-static void F_TR12 __P((l2_softc_t *));
-static void F_TR13 __P((l2_softc_t *));
-static void F_TR15 __P((l2_softc_t *));
-static void F_TR16 __P((l2_softc_t *));
-static void F_TR17 __P((l2_softc_t *));
-static void F_TR18 __P((l2_softc_t *));
-static void F_TR19 __P((l2_softc_t *));
-static void F_TR20 __P((l2_softc_t *));
-static void F_ILL __P((l2_softc_t *));
-static void F_NCNA __P((l2_softc_t *));
-
-/*---------------------------------------------------------------------------*
- * FSM illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ILL(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_ERR, "F_ILL", ("FSM function F_ILL executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM No change, No action
- *---------------------------------------------------------------------------*/
-static void
-F_NCNA(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_NCNA", ("FSM function F_NCNA executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * layer 2 state transition table
- *---------------------------------------------------------------------------*/
-struct l2state_tab {
- void (*func) __P((l2_softc_t *)); /* function to execute */
- int newstate; /* next state */
-} l2state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: ST_TEI_UNAS, ST_ASG_AW_TEI, ST_EST_AW_TEI, ST_TEI_ASGD, ST_AW_EST, ST_AW_REL, ST_MULTIFR, ST_TIMREC, ST_SUBSET, ILLEGAL STATE */
-/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_DLESTRQ*/{ {F_TU01, ST_EST_AW_TEI}, {F_NCNA, ST_EST_AW_TEI}, {F_ILL, ST_ILL}, {F_T01, ST_AW_EST}, {F_AE01, ST_AW_EST}, {F_ILL, ST_ILL}, {F_MF01, ST_AW_EST}, {F_TR01, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_DLUDTRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_MDASGRQ*/{ {F_TU03, ST_TEI_ASGD}, {F_TA03, ST_TEI_ASGD}, {F_TE03, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_MDERRRS*/{ {F_ILL, ST_ILL}, {F_TA04, ST_TEI_UNAS}, {F_TE04, ST_TEI_UNAS}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_PSDEACT*/{ {F_ILL, ST_ILL}, {F_TA05, ST_TEI_UNAS}, {F_TE05, ST_TEI_UNAS}, {F_T05, ST_TEI_ASGD}, {F_AE05, ST_TEI_ASGD}, {F_AR05, ST_TEI_ASGD}, {F_MF05, ST_TEI_ASGD}, {F_TR05, ST_TEI_ASGD}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_MDREMRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T06, ST_TEI_UNAS}, {F_AE06, ST_TEI_UNAS}, {F_AR06, ST_TEI_UNAS}, {F_MF06, ST_TEI_UNAS}, {F_TR06, ST_TEI_UNAS}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXSABME*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T07, ST_SUBSET}, {F_AE07, ST_AW_EST}, {F_AR07, ST_AW_REL}, {F_MF07, ST_MULTIFR}, {F_TR07, ST_MULTIFR}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXDISC */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T08, ST_TEI_ASGD}, {F_AE08, ST_AW_EST}, {F_AR08, ST_AW_REL}, {F_MF08, ST_TEI_ASGD}, {F_TR08, ST_TEI_ASGD}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXUA */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T09, ST_TEI_ASGD}, {F_AE09, ST_SUBSET}, {F_AR09, ST_SUBSET}, {F_MF09, ST_MULTIFR}, {F_TR09, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXDM */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T10, ST_SUBSET}, {F_AE10, ST_SUBSET}, {F_AR10, ST_SUBSET}, {F_MF10, ST_SUBSET}, {F_TR10, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_T200EXP*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_AE11, ST_SUBSET}, {F_AR11, ST_SUBSET}, {F_MF11, ST_TIMREC}, {F_TR11, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_DLDATRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_AE12, ST_AW_EST}, {F_ILL, ST_ILL}, {F_MF12, ST_MULTIFR}, {F_TR12, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_DLRELRQ*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_T13, ST_TEI_ASGD}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF13, ST_AW_REL}, {F_TR13, ST_AW_REL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_T203EXP*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF14, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_OWNBUSY*/{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF15, ST_MULTIFR}, {F_TR15, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_OWNRDY */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF16, ST_MULTIFR}, {F_TR16, ST_TIMREC}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXRR */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF17, ST_SUBSET}, {F_TR17, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXREJ */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF18, ST_SUBSET}, {F_TR18, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXRNR */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF19, ST_SUBSET}, {F_TR19, ST_SUBSET}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_RXFRMR */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_MF20, ST_AW_EST}, {F_TR20, ST_AW_EST}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} },
-/*EV_ILL */{ {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL} }
-};
-
-/*---------------------------------------------------------------------------*
- * event handler, executes function and sets new state
- *---------------------------------------------------------------------------*/
-void i4b_next_l2state(l2_softc_t *l2sc, int event)
-{
- int currstate, newstate;
-
- /* check event number */
- if(event > N_EVENTS)
- panic("i4b_l2fsm.c: event > N_EVENTS\n");
-
- /* get current state and check it */
- if((currstate = l2sc->Q921_state) > N_STATES) /* failsafe */
- panic("i4b_l2fsm.c: currstate > N_STATES\n");
-
- /* get new state and check it */
- if((newstate = l2state_tab[event][currstate].newstate) > N_STATES)
- panic("i4b_l2fsm.c: newstate > N_STATES\n");
-
-
- if(newstate != ST_SUBSET)
- { /* state function does NOT set new state */
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM event [%s]: [%s/%d => %s/%d]\n",
- l2event_text[event],
- l2state_text[currstate], currstate,
- l2state_text[newstate], newstate));
- }
-
- /* execute state transition function */
- (*l2state_tab[event][currstate].func)(l2sc);
-
- if(newstate == ST_SUBSET)
- { /* state function DOES set new state */
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM S-event [%s]: [%s => %s]\n", l2event_text[event],
- l2state_text[currstate],
- l2state_text[l2sc->Q921_state]));
- }
-
- /* check for illegal new state */
-
- if(newstate == ST_ILL)
- {
- newstate = currstate;
- DBGL2(L2_F_ERR, "i4b_next_l2state", ("FSM illegal state, state = %s, event = %s!\n",
- l2state_text[currstate],
- l2event_text[event]));
- }
-
- /* check if state machine function has to set new state */
-
- if(newstate != ST_SUBSET)
- l2sc->Q921_state = newstate; /* no, we set new state */
-
- if(l2sc->postfsmfunc != NULL)
- {
- DBGL2(L2_F_MSG, "i4b_next_l2state", ("FSM executing postfsmfunc!\n"));
- (*l2sc->postfsmfunc)(l2sc->postfsmarg);
- l2sc->postfsmfunc = NULL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *i4b_print_l2state(l2_softc_t *l2sc)
-{
- return((char *) l2state_text[l2sc->Q921_state]);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_UNAS event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_TU01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TU01", ("FSM function F_TU01 executing\n"));
- i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_UNAS event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TU03(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TU03", ("FSM function F_TU03 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TA03(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TA03", ("FSM function F_TA03 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event mdl error response
- *---------------------------------------------------------------------------*/
-static void
-F_TA04(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TA04", ("FSM function F_TA04 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_TA05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TA05", ("FSM function F_TA05 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_EST_AW_TEI event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TE03(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TE03", ("FSM function F_TE03 executing\n"));
- i4b_establish_data_link(l2sc);
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_EST_AW_TEI event mdl error response
- *---------------------------------------------------------------------------*/
-static void
-F_TE04(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TE04", ("FSM function F_TE04 executing\n"));
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_EST_AW_TEI event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_TE05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TE05", ("FSM function F_TE05 executing\n"));
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_T01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T01", ("FSM function F_T01 executing\n"));
- i4b_establish_data_link(l2sc);
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_T05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T05", ("FSM function F_T05 executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_T06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T06", ("FSM function F_T06 executing\n"));
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_T07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T07", ("FSM function F_T07 executing\n"));
-
-/* XXX */
-#ifdef NOTDEF
- if(NOT able to establish)
- {
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
- l2sc->Q921_state = ST_TEI_ASGD;
- return;
- }
-#endif
-
- i4b_clear_exception_conditions(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->vr = 0;
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
-
- i4b_T203_start(l2sc);
-
- l2sc->Q921_state = ST_MULTIFR;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_T08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T08", ("FSM function F_T08 executing\n"));
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_T09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T09", ("FSM function F_T09 executing\n"));
- i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_C);
- i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_D);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_T10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T10", ("FSM function F_T10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
-#ifdef NOTDEF
- if(NOT able_to_etablish)
- {
- l2sc->Q921_state = ST_TEI_ASGD;
- return;
- }
-#endif
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 1;
-
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_T13(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_T13", ("FSM function F_T13 executing\n"));
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_AE01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE01", ("FSM function F_AE01 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_AE05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE05", ("FSM function F_AE05 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_AE06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE06", ("FSM function F_AE06 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_AE07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE07", ("FSM function F_AE07 executing\n"));
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_AE08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE08", ("FSM function F_AE08 executing\n"));
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_AE09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE09", ("FSM function F_AE09 executing\n"));
-
- if(l2sc->rxd_PF == 0)
- {
- i4b_mdl_error_ind(l2sc, "F_AE09", MDL_ERR_D);
- l2sc->Q921_state = ST_AW_EST;
- }
- else
- {
- if(l2sc->l3initiated)
- {
- l2sc->l3initiated = 0;
- l2sc->vr = 0;
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Cnf_A;
- }
- else
- {
- if(l2sc->vs != l2sc->va)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
- }
- }
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
-
- l2sc->vs = 0;
- l2sc->va = 0;
-
- l2sc->Q921_state = ST_MULTIFR;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_AE10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE10", ("FSM function F_AE10 executing\n"));
-
- if(l2sc->rxd_PF == 0)
- {
- l2sc->Q921_state = ST_AW_EST;
- }
- else
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_AE11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE11", ("FSM function F_AE11 executing\n"));
-
- if(l2sc->RC >= N200)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- i4b_mdl_error_ind(l2sc, "F_AE11", MDL_ERR_G);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- l2sc->RC++;
-
- i4b_tx_sabme(l2sc, P1);
-
- i4b_T200_start(l2sc);
-
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event dl data request
- *---------------------------------------------------------------------------*/
-static void
-F_AE12(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AE12", ("FSM function F_AE12 executing\n"));
-
- if(l2sc->l3initiated == 0)
- {
- i4b_i_frame_queued_up(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_AR05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR05", ("FSM function F_AR05 executing\n"));
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_AR06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR06", ("FSM function F_AR06 executing\n"));
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_AR07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR07", ("FSM function F_AR07 executing\n"));
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_AR08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR08", ("FSM function F_AR08 executing\n"));
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_AR09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR09", ("FSM function F_AR09 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- i4b_mdl_error_ind(l2sc, "F_AR09", MDL_ERR_D);
-
- l2sc->Q921_state = ST_AW_REL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_AR10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR10", ("FSM function F_AR10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- i4b_T200_stop(l2sc);
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- l2sc->Q921_state = ST_AW_REL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_AR11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_AR11", ("FSM function F_AR11 executing\n"));
-
- if(l2sc->RC >= N200)
- {
- i4b_mdl_error_ind(l2sc, "F_AR11", MDL_ERR_H);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Cnf_A;
-
- l2sc->Q921_state = ST_TEI_ASGD;
- }
- else
- {
- l2sc->RC++;
-
- i4b_tx_disc(l2sc, P1);
-
- i4b_T200_start(l2sc);
-
- l2sc->Q921_state = ST_AW_REL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_MF01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF01", ("FSM function F_MF01 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_MF05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF05", ("FSM function F_MF05 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_MF06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF06", ("FSM function F_MF06 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
- i4b_T203_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_MF07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF07", ("FSM function F_MF07 executing\n"));
-
- i4b_clear_exception_conditions(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- i4b_mdl_error_ind(l2sc, "F_MF07", MDL_ERR_F);
-
- if(l2sc->vs != l2sc->va)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
- }
-
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
-
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->vr = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_MF08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF08", ("FSM function F_MF08 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_MF09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF09", ("FSM function F_MF09 executing\n"));
- if(l2sc->rxd_PF)
- i4b_mdl_error_ind(l2sc, "F_MF09", MDL_ERR_C);
- else
- i4b_mdl_error_ind(l2sc, "F_MF09", MDL_ERR_D);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_MF10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF10", ("FSM function F_MF10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- i4b_mdl_error_ind(l2sc, "F_MF10", MDL_ERR_B);
-
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_mdl_error_ind(l2sc, "F_MF10", MDL_ERR_E);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_MF11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF11", ("FSM function F_MF11 executing\n"));
-
- l2sc->RC = 0;
-
- i4b_transmit_enquire(l2sc);
-
- l2sc->RC++;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event dl data request
- *---------------------------------------------------------------------------*/
-static void
-F_MF12(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF12", ("FSM function F_MF12 executing\n"));
-
- i4b_i_frame_queued_up(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_MF13(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF13", ("FSM function F_MF13 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->RC = 0;
-
- i4b_tx_disc(l2sc, P1);
-
- i4b_T203_stop(l2sc);
- i4b_T200_restart(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event T203 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_MF14(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF14", ("FSM function F_MF14 executing\n"));
-
- i4b_transmit_enquire(l2sc);
-
- l2sc->RC = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event set own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_MF15(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF15", ("FSM function F_MF15 executing\n"));
-
- if(l2sc->own_busy == 0)
- {
- l2sc->own_busy = 1;
-
- i4b_tx_rnr_response(l2sc, F0); /* wrong in Q.921 03/93 p 64 */
-
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event clear own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_MF16(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF16", ("FSM function F_MF16 executing\n"));
-
- if(l2sc->own_busy != 0)
- {
- l2sc->own_busy = 0;
-
- i4b_tx_rr_response(l2sc, F0); /* wrong in Q.921 03/93 p 64 */
-
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd RR
- *---------------------------------------------------------------------------*/
-static void
-F_MF17(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF17", ("FSM function F_MF17 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_mdl_error_ind(l2sc, "F_MF17", MDL_ERR_A);
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- if(l2sc->rxd_NR == l2sc->vs)
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_restart(l2sc);
- }
- else if(l2sc->rxd_NR != l2sc->va)
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_restart(l2sc);
- }
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd REJ
- *---------------------------------------------------------------------------*/
-static void
-F_MF18(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF18", ("FSM function F_MF18 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_mdl_error_ind(l2sc, "F_MF18", MDL_ERR_A);
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd RNR
- *---------------------------------------------------------------------------*/
-static void
-F_MF19(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF19", ("FSM function F_MF19 executing\n"));
-
- l2sc->peer_busy = 1;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_mdl_error_ind(l2sc, "F_MF19", MDL_ERR_A);
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T203_stop(l2sc);
- i4b_T200_restart(l2sc);
- l2sc->Q921_state = ST_MULTIFR;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event rx'd FRMR
- *---------------------------------------------------------------------------*/
-static void
-F_MF20(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_MF20", ("FSM function F_MF20 executing\n"));
-
- i4b_mdl_error_ind(l2sc, "F_MF20", MDL_ERR_K);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_TR01(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR01", ("FSM function F_TR01 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_TR05(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR05", ("FSM function F_TR05 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_TR06(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR06", ("FSM function F_TR06 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_TR07(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR07", ("FSM function F_TR07 executing\n"));
-
- i4b_clear_exception_conditions(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
-
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- i4b_mdl_error_ind(l2sc, "F_TR07", MDL_ERR_F);
-
- if(l2sc->vs != l2sc->va)
- {
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Est_Ind_A;
- }
-
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
-
- l2sc->vs = 0;
- l2sc->va = 0;
- l2sc->vr = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_TR08(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR08", ("FSM function F_TR08 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
- MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
- i4b_tx_ua(l2sc, l2sc->rxd_PF);
-
- l2sc->postfsmarg = l2sc->unit;
- l2sc->postfsmfunc = DL_Rel_Ind_A;
-
- i4b_T200_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_TR09(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR09", ("FSM function F_TR09 executing\n"));
- if(l2sc->rxd_PF)
- i4b_mdl_error_ind(l2sc, "F_TR09", MDL_ERR_C);
- else
- i4b_mdl_error_ind(l2sc, "F_TR09", MDL_ERR_D);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd DM
- *---------------------------------------------------------------------------*/
-static void
-F_TR10(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR10", ("FSM function F_TR10 executing\n"));
-
- if(l2sc->rxd_PF)
- {
- i4b_mdl_error_ind(l2sc, "F_TR10", MDL_ERR_B);
- }
- else
- {
- i4b_mdl_error_ind(l2sc, "F_TR10", MDL_ERR_E);
- }
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event T200 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_TR11(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR11", ("FSM function F_TR11 executing\n"));
-
- if(l2sc->RC >= N200)
- {
- i4b_mdl_error_ind(l2sc, "F_TR11", MDL_ERR_I);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-
- l2sc->Q921_state = ST_AW_EST;
- }
- else
- {
- i4b_transmit_enquire(l2sc);
-
- l2sc->RC++;
-
- l2sc->Q921_state = ST_TIMREC;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event dl data request
- *---------------------------------------------------------------------------*/
-static void
-F_TR12(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR12", ("FSM function F_TR12 executing\n"));
-
- i4b_i_frame_queued_up(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_TR13(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR13", ("FSM function F_TR13 executing\n"));
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->RC = 0;
-
- i4b_tx_disc(l2sc, P1);
-
- i4b_T200_restart(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event set own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_TR15(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR15", ("FSM function F_TR15 executing\n"));
-
- if(l2sc->own_busy == 0)
- {
- l2sc->own_busy = 1;
-
- i4b_tx_rnr_response(l2sc, F0);
-
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event clear own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_TR16(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR16", ("FSM function F_TR16 executing\n"));
-
- if(l2sc->own_busy != 0)
- {
- l2sc->own_busy = 0;
-
- i4b_tx_rr_response(l2sc, F0); /* this is wrong */
- /* in Q.921 03/93 p 74 ! */
- l2sc->ack_pend = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd RR
- *---------------------------------------------------------------------------*/
-static void
-F_TR17(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR17", ("FSM function F_TR17 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- return;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- return;
- }
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- l2sc->Q921_state = ST_TIMREC;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event
- *---------------------------------------------------------------------------*/
-static void
-F_TR18(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR18", ("FSM function F_TR18 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_stop(l2sc);
- i4b_T203_start(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- return;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- return;
- }
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- l2sc->Q921_state = ST_TIMREC;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd RNR
- *---------------------------------------------------------------------------*/
-static void
-F_TR19(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR19", ("FSM function F_TR19 executing\n"));
-
- l2sc->peer_busy = 0;
-
- if(l2sc->rxd_CR == CR_CMD_FROM_NT)
- {
- if(l2sc->rxd_PF == 1)
- {
- i4b_enquiry_response(l2sc);
- }
- }
- else
- {
- if(l2sc->rxd_PF == 1)
- {
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- i4b_T200_restart(l2sc);
- i4b_invoke_retransmission(l2sc, l2sc->rxd_NR);
- l2sc->Q921_state = ST_MULTIFR;
- return;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- return;
- }
- }
- }
-
- if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
- {
- l2sc->va = l2sc->rxd_NR;
- l2sc->Q921_state = ST_TIMREC;
- }
- else
- {
- i4b_nr_error_recovery(l2sc);
- l2sc->Q921_state = ST_AW_EST;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event rx'd FRMR
- *---------------------------------------------------------------------------*/
-static void
-F_TR20(l2_softc_t *l2sc)
-{
- DBGL2(L2_F_MSG, "F_TR20", ("FSM function F_TR20 executing\n"));
-
- i4b_mdl_error_ind(l2sc, "F_TR20", MDL_ERR_K);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_l2fsm.h b/sys/i4b/layer2/i4b_l2fsm.h
deleted file mode 100644
index 8f510682bebfc..0000000000000
--- a/sys/i4b/layer2/i4b_l2fsm.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2fsm.h - layer 2 FSM
- * -------------------------
- *
- * $Id: i4b_l2fsm.h,v 1.3 1998/12/05 18:05:13 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:28:39 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L2FSM_H_
-#define _I4B_L2FSM_H_
-
-enum Q921_states {
- ST_TEI_UNAS, /* TEI unassigned */
- ST_ASG_AW_TEI, /* assign awaiting TEI */
- ST_EST_AW_TEI, /* establish awaiting TEI */
- ST_TEI_ASGD, /* TEI assigned */
-
- ST_AW_EST, /* awaiting establishment */
- ST_AW_REL, /* awaiting release */
- ST_MULTIFR, /* multiple frame established */
- ST_TIMREC, /* timer recovery */
-
- ST_SUBSET, /* SUBroutine SETs new state */
- ST_ILL, /* illegal state */
- N_STATES /* number of states */
-};
-
-enum Q921_events {
- EV_DLESTRQ, /* dl establish req */
- EV_DLUDTRQ, /* dl unit data req */
- EV_MDASGRQ, /* mdl assign req */
- EV_MDERRRS, /* mdl error response */
- EV_PSDEACT, /* persistent deactivation */
- EV_MDREMRQ, /* mdl remove req */
- EV_RXSABME, /* rx'd SABME */
- EV_RXDISC, /* rx'd DISC */
- EV_RXUA, /* rx'd UA */
- EV_RXDM, /* rx'd DM */
- EV_T200EXP, /* T200 expired */
- EV_DLDATRQ, /* dl data req */
- EV_DLRELRQ, /* dl release req */
- EV_T203EXP, /* T203 expired */
- EV_OWNBUSY, /* set own rx busy */
- EV_OWNRDY, /* clear own rx busy */
- EV_RXRR, /* rx'd RR */
- EV_RXREJ, /* rx'd REJ */
- EV_RXRNR, /* rx'd RNR */
- EV_RXFRMR, /* rx'd FRMR */
-
- EV_ILL, /* Illegal */
- N_EVENTS
-};
-
-#endif /* _I4B_L2FSM_H_ */
-
diff --git a/sys/i4b/layer2/i4b_l2timer.c b/sys/i4b/layer2/i4b_l2timer.c
deleted file mode 100644
index 3b45e807dcdbf..0000000000000
--- a/sys/i4b/layer2/i4b_l2timer.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2timer.c - layer 2 timer handling
- * --------------------------------------
- *
- * $Id: i4b_l2timer.c,v 1.12 1998/12/05 18:05:15 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:29:13 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 timeout function
- *---------------------------------------------------------------------------*/
-static void
-i4b_T200_timeout(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_ERR, "i4b_T200_timeout", ("unit %d, RC = %d\n", l2sc->unit, l2sc->RC));
- i4b_next_l2state(l2sc, EV_T200EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_start(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_MSG, "i4b_T200_start", ("unit %d\n", l2sc->unit));
- l2sc->T200 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T200_callout = timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_stop(l2_softc_t *l2sc)
-{
- if(l2sc->T200 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, l2sc->T200_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc);
-#endif
- l2sc->T200 = TIMER_IDLE;
- }
- DBGL2(L2_T_MSG, "i4b_T200_stop", ("unit %d\n", l2sc->unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 restart
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_restart(l2_softc_t *l2sc)
-{
- if(l2sc->T200 != TIMER_IDLE)
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, l2sc->T200_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc);
-#endif
- else
- l2sc->T200 = TIMER_ACTIVE;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T200_callout = timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T200_timeout, (void *)l2sc, T200DEF);
-#endif
-
- DBGL2(L2_T_MSG, "i4b_T200_restart", ("unit %d\n", l2sc->unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 timeout function
- *---------------------------------------------------------------------------*/
-static void
-i4b_T202_timeout(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_ERR, "i4b_T202_timeout", ("unit %d, N202 = %d\n", l2sc->unit, l2sc->N202));
-
- if(--(l2sc->N202))
- {
- (*l2sc->T202func)(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T202_start(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_MSG, "i4b_T202_start", ("unit %d\n", l2sc->unit));
- l2sc->N202 = N202DEF;
- l2sc->T202 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T202_callout = timeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, T202DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, T202DEF);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T202_stop(l2_softc_t *l2sc)
-{
- if(l2sc->T202 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc, l2sc->T202_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T202_timeout, (void *)l2sc);
-#endif
- l2sc->T202 = TIMER_IDLE;
- }
- DBGL2(L2_T_MSG, "i4b_T202_stop", ("unit %d\n", l2sc->unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 timeout function
- *---------------------------------------------------------------------------*/
-#if I4B_T203_ACTIVE
-static void
-i4b_T203_timeout(l2_softc_t *l2sc)
-{
- DBGL2(L2_T_ERR, "i4b_T203_timeout", ("unit %d\n", l2sc->unit));
- i4b_next_l2state(l2sc, EV_T203EXP);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_start(l2_softc_t *l2sc)
-{
-#if I4B_T203_ACTIVE
- DBGL2(L2_T_MSG, "i4b_T203_start", ("unit %d\n", l2sc->unit));
- l2sc->T203 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T203_callout = timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#endif
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_stop(l2_softc_t *l2sc)
-{
-#if I4B_T203_ACTIVE
- if(l2sc->T203 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, l2sc->T203_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc);
-#endif
- l2sc->T203 = TIMER_IDLE;
- }
- DBGL2(L2_T_MSG, "i4b_T203_stop", ("unit %d\n", l2sc->unit));
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 restart
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_restart(l2_softc_t *l2sc)
-{
-#if I4B_T203_ACTIVE
- if(l2sc->T203 != TIMER_IDLE)
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, l2sc->T203_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc);
-#endif
- else
- l2sc->T203 = TIMER_ACTIVE;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- l2sc->T203_callout = timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#else
- timeout((TIMEOUT_FUNC_T)i4b_T203_timeout, (void *)l2sc, T203DEF);
-#endif
-
- DBGL2(L2_T_MSG, "i4b_T203_restart", ("unit %d\n", l2sc->unit));
-#endif
-}
-
-#endif /* NI4BQ921 > 0 */
-
diff --git a/sys/i4b/layer2/i4b_lme.c b/sys/i4b/layer2/i4b_lme.c
deleted file mode 100644
index b179e94bfe43c..0000000000000
--- a/sys/i4b/layer2/i4b_lme.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_lme.c - layer management entity
- * -------------------------------------
- *
- * $Id: i4b_lme.c,v 1.8 1998/12/05 18:05:19 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:29:25 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * mdl assign indication handler
- *---------------------------------------------------------------------------*/
-void
-i4b_mdl_assign_ind(l2_softc_t *l2sc)
-{
- DBGL2(L2_PRIM, "MDL-ASSIGN-IND", ("unit %d\n", l2sc->unit));
-
- i4b_l1_activate(l2sc);
-
- if(l2sc->tei_valid == TEI_VALID)
- {
- l2sc->T202func = (void(*)(void*))i4b_tei_verify;
- l2sc->N202 = N202DEF;
- i4b_tei_verify(l2sc);
- }
- else
- {
- l2sc->T202func = (void(*)(void*))i4b_tei_assign;
- l2sc->N202 = N202DEF;
- i4b_tei_assign(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_mdl_error_ind handler (Q.921 01/94 pp 156)
- *---------------------------------------------------------------------------*/
-void
-i4b_mdl_error_ind(l2_softc_t *l2sc, char *where, int errorcode)
-{
- static char *error_text[] = {
- "MDL_ERR_A: rx'd unsolicited response - supervisory (F=1)",
- "MDL_ERR_B: rx'd unsolicited response - DM (F=1)",
- "MDL_ERR_C: rx'd unsolicited response - UA (F=1)",
- "MDL_ERR_D: rx'd unsolicited response - UA (F=0)",
- "MDL_ERR_E: rx'd unsolicited response - DM (F=0)",
- "MDL_ERR_F: peer initiated re-establishment - SABME",
- "MDL_ERR_G: unsuccessful transmission N200times - SABME",
- "MDL_ERR_H: unsuccessful transmission N200times - DIS",
- "MDL_ERR_I: unsuccessful transmission N200times - Status ENQ",
- "MDL_ERR_J: other error - N(R) error",
- "MDL_ERR_K: other error - rx'd FRMR response",
- "MDL_ERR_L: other error - rx'd undefined frame",
- "MDL_ERR_M: other error - receipt of I field not permitted",
- "MDL_ERR_N: other error - rx'd frame with wrong size",
- "MDL_ERR_O: other error - N201 error",
- "MDL_ERR_MAX: i4b_mdl_error_ind called with wrong parameter!!!"
- };
-
- if(errorcode > MDL_ERR_MAX)
- errorcode = MDL_ERR_MAX;
-
- DBGL2(L2_ERROR, "i4b_mdl_error_ind", ("unit = %d, location = %s\n", l2sc->unit, where));
- DBGL2(L2_ERROR, "i4b_mdl_error_ind", ("error = %s\n", error_text[errorcode]));
-
- switch(errorcode)
- {
- case MDL_ERR_A:
- case MDL_ERR_B:
- break;
-
- case MDL_ERR_C:
- case MDL_ERR_D:
- i4b_tei_verify(l2sc);
- break;
-
- case MDL_ERR_E:
- case MDL_ERR_F:
- break;
-
- case MDL_ERR_G:
- case MDL_ERR_H:
- i4b_tei_verify(l2sc);
- break;
-
- case MDL_ERR_I:
- case MDL_ERR_J:
- case MDL_ERR_K:
- case MDL_ERR_L:
- case MDL_ERR_M:
- case MDL_ERR_N:
- case MDL_ERR_O:
- break;
-
- default:
- break;
- }
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_mbuf.c b/sys/i4b/layer2/i4b_mbuf.c
deleted file mode 100644
index 6d085c3e08c08..0000000000000
--- a/sys/i4b/layer2/i4b_mbuf.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b - mbuf handling support routines
- * ------------------------------------
- *
- * $Id: i4b_mbuf.c,v 1.10 1998/12/05 18:05:20 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:29:44 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/tty.h>
-#include <sys/proc.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#define I4B_MBUF_DEBUG
-#undef I4B_MBUF_TYPE_DEBUG
-
-#ifdef I4B_MBUF_TYPE_DEBUG
-
-#ifdef __FreeBSD__
-
-#define MT_DCHAN 42
-#define MT_BCHAN 43
-
-#else /* NetBSD */
-
-#define MT_DCHAN MT_DATA
-#define MT_BCHAN MT_DATA
-
-#endif
-
-#define MT_I4B_D MT_DCHAN
-#define MT_I4B_B MT_BCHAN
-
-#else /* ! I4B_MBUF_TYPE_DEBUG */
-
-#define MT_I4B_D MT_DATA
-#define MT_I4B_B MT_DATA
-
-#endif /* I4B_MBUF_TYPE_DEBUG */
-
-/*---------------------------------------------------------------------------*
- * allocate D-channel mbuf space
- *---------------------------------------------------------------------------*/
-struct mbuf*
-i4b_Dgetmbuf(int len)
-{
- struct mbuf *m;
-
- if(len > MCLBYTES) /* if length > max extension size */
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getmbuf: error - len(%d) > MCLBYTES(%d)\n",
- len, MCLBYTES);
-#endif
-
- return(NULL);
- }
-
- MGETHDR(m, M_DONTWAIT, MT_I4B_D); /* get mbuf with pkthdr */
-
- /* did we actually get the mbuf ? */
-
- if(!m)
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MGETHDR failed!\n");
-#endif
-
- return(NULL);
- }
-
- if(len >= MHLEN)
- {
- MCLGET(m, M_DONTWAIT);
-
- if(!(m->m_flags & M_EXT))
- {
- m_freem(m);
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MCLGET failed, len(%d)\n", len);
-#endif
-
- return (NULL);
- }
- }
-
- m->m_len = len;
-
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * free a D-channel mbuf
- *---------------------------------------------------------------------------*/
-void
-i4b_Dfreembuf(struct mbuf *m)
-{
- if(m)
- m_freem(m);
-}
-
-/*---------------------------------------------------------------------------*
- * clear a D-channel ifqueue from data
- *---------------------------------------------------------------------------*/
-void
-i4b_Dcleanifq(struct ifqueue *ifq)
-{
- struct mbuf *m;
- int x = splimp();
-
- while(!IF_QEMPTY(ifq))
- {
- IF_DEQUEUE(ifq, m);
- i4b_Dfreembuf(m);
- }
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * allocate B-channel mbuf space
- *---------------------------------------------------------------------------*/
-struct mbuf*
-i4b_Bgetmbuf(int len)
-{
- struct mbuf *m;
-
- if(len > MCLBYTES) /* if length > max extension size */
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getmbuf: error - len(%d) > MCLBYTES(%d)\n",
- len, MCLBYTES);
-#endif
-
- return(NULL);
- }
-
- MGETHDR(m, M_DONTWAIT, MT_I4B_B); /* get mbuf with pkthdr */
-
- /* did we actually get the mbuf ? */
-
- if(!m)
- {
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MGETHDR failed!\n");
-#endif
-
- return(NULL);
- }
-
- if(len >= MHLEN)
- {
- MCLGET(m, M_DONTWAIT);
-
- if(!(m->m_flags & M_EXT))
- {
- m_freem(m);
-
-#ifdef I4B_MBUF_DEBUG
- printf("i4b_getbuf: error - MCLGET failed, len(%d)\n", len);
-#endif
-
- return (NULL);
- }
- }
-
- m->m_len = len;
-
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * free a B-channel mbuf
- *---------------------------------------------------------------------------*/
-void
-i4b_Bfreembuf(struct mbuf *m)
-{
- if(m)
- m_freem(m);
-}
-
-/*---------------------------------------------------------------------------*
- * clear a B-channel ifqueue from data
- *---------------------------------------------------------------------------*/
-void
-i4b_Bcleanifq(struct ifqueue *ifq)
-{
- struct mbuf *m;
- int x = splimp();
-
- while(!IF_QEMPTY(ifq))
- {
- IF_DEQUEUE(ifq, m);
- i4b_Bfreembuf(m);
- }
-
- splx(x);
-}
-
-/* EOF */
diff --git a/sys/i4b/layer2/i4b_sframe.c b/sys/i4b/layer2/i4b_sframe.c
deleted file mode 100644
index f8d14ba1a2465..0000000000000
--- a/sys/i4b/layer2/i4b_sframe.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_sframe.c - s frame handling routines
- * ----------------------------------------
- *
- * $Id: i4b_sframe.c,v 1.8 1998/12/05 18:05:21 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:30:02 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * process s frame
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_s_frame(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
-
- if(!((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI)))))
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- l2sc->rxd_CR = GETCR(*(ptr + OFF_SAPI));
- l2sc->rxd_PF = GETSPF(*(ptr + OFF_SNR));
- l2sc->rxd_NR = GETSNR(*(ptr + OFF_SNR));
-
- i4b_rxd_ack(l2sc, l2sc->rxd_NR);
-
- switch(*(ptr + OFF_SRCR))
- {
- case RR:
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd RR, N(R) = %d\n", l2sc->rxd_NR));
- i4b_next_l2state(l2sc, EV_RXRR);
- break;
-
- case RNR:
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd RNR, N(R) = %d\n", l2sc->rxd_NR));
- i4b_next_l2state(l2sc, EV_RXRNR);
- break;
-
- case REJ:
- DBGL2(L2_S_MSG, "i4b_rxd_s_frame", ("rx'd REJ, N(R) = %d\n", l2sc->rxd_NR));
- i4b_next_l2state(l2sc, EV_RXREJ);
- break;
-
- default:
- DBGL2(L2_S_ERR, "i4b_rxd_s_frame", ("ERROR, unknown code, frame = \n"));
- i4b_print_frame(m->m_len, m->m_data);
- break;
- }
- i4b_Dfreembuf(m);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RR command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rr_command(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rr_command", ("tx RR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rr_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rr_response", ("tx RR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RNR command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rnr_command(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rnr_command", ("tx RNR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RNR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RNR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rnr_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rnr_response", ("tx RNR, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RNR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit REJ response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rej_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_S_MSG, "i4b_tx_rej_response", ("tx REJ, unit = %d\n", l2sc->unit));
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, REJ);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * build S-frame for sending
- *---------------------------------------------------------------------------*/
-struct mbuf *
-i4b_build_s_frame(l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(S_FRAME_LEN)) == NULL)
- return(NULL);
-
- PUTSAPI(SAPI_CCP, crbit, m->m_data[OFF_SAPI]);
-
- PUTTEI(l2sc->tei, m->m_data[OFF_TEI]);
-
- m->m_data[OFF_SRCR] = type;
-
- m->m_data[OFF_SNR] = (l2sc->vr << 1) | (pbit & 0x01);
-
- return(m);
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_tei.c b/sys/i4b/layer2/i4b_tei.c
deleted file mode 100644
index 5c5b7b83fd873..0000000000000
--- a/sys/i4b/layer2/i4b_tei.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tei.c - tei handling procedures
- * -----------------------------------
- *
- * $Id: i4b_tei.c,v 1.13 1998/12/05 18:05:23 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:30:20 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/syslog.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <machine/random.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * handle a received TEI management frame
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_rxframe(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
-
- switch(*(ptr + OFF_MT))
- {
- case MT_ID_ASSIGN:
- if( (*(ptr + OFF_RIL) == l2sc->last_ril) &&
- (*(ptr + OFF_RIH) == l2sc->last_rih))
- {
- l2sc->tei = GET_TEIFROMAI(*(ptr+OFF_AI));
- l2sc->tei_valid = TEI_VALID;
-
- if(l2sc->T202 == TIMER_ACTIVE)
- i4b_T202_stop(l2sc);
-
- MDL_Status_Ind(l2sc->unit, STI_TEIASG, l2sc->tei);
-
- log(LOG_INFO, "i4b: unit %d, assigned TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
-
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Assign - TEI = %d\n", l2sc->tei));
-
- i4b_next_l2state(l2sc, EV_MDASGRQ);
- }
- break;
-
- case MT_ID_DENY:
- if( (*(ptr + OFF_RIL) == l2sc->last_ril) &&
- (*(ptr + OFF_RIH) == l2sc->last_rih))
- {
- l2sc->tei_valid = TEI_INVALID;
- l2sc->tei = GET_TEIFROMAI(*(ptr+OFF_AI));
-
- if(l2sc->tei == GROUP_TEI)
- {
- log(LOG_WARNING, "i4b: unit %d, denied TEI, no TEI values available from exchange!\n", l2sc->unit);
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("TEI ID Denied, No TEI values available from exchange!\n"));
- }
- else
- {
- log(LOG_WARNING, "i4b: unit %d, denied TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("TEI ID Denied - TEI = %d\n", l2sc->tei));
- }
- MDL_Status_Ind(l2sc->unit, STI_TEIASG, -1);
- i4b_next_l2state(l2sc, EV_MDERRRS);
- }
- break;
-
- case MT_ID_CHK_REQ:
- if( (l2sc->tei_valid == TEI_VALID) &&
- ( (l2sc->tei == GET_TEIFROMAI(*(ptr+OFF_AI))) ||
- (GROUP_TEI == GET_TEIFROMAI(*(ptr+OFF_AI))) ))
- {
- static int lasttei = -1;
-
- if(l2sc->tei != lasttei)
- {
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Check Req - TEI = %d\n", l2sc->tei));
- lasttei = l2sc->tei;
- }
-
- if(l2sc->T202 == TIMER_ACTIVE)
- i4b_T202_stop(l2sc);
- i4b_tei_chkresp(l2sc);
- }
- break;
-
- case MT_ID_REMOVE:
- if( (l2sc->tei_valid == TEI_VALID) &&
- ( (l2sc->tei == GET_TEIFROMAI(*(ptr+OFF_AI))) ||
- (l2sc->tei == GET_TEIFROMAI(*(ptr+OFF_AI)))))
- {
- l2sc->tei_valid = TEI_INVALID;
- l2sc->tei = GET_TEIFROMAI(*(ptr+OFF_AI));
-
- log(LOG_INFO, "i4b: unit %d, removed TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- DBGL2(L2_TEI_MSG, "i4b_tei_rx_frame", ("TEI ID Remove - TEI = %d\n", l2sc->tei));
- MDL_Status_Ind(l2sc->unit, STI_TEIASG, -1);
- i4b_next_l2state(l2sc, EV_MDREMRQ);
- }
- break;
-
- default:
- DBGL2(L2_TEI_ERR, "i4b_tei_rx_frame", ("UNKNOWN TEI MGMT Frame, type = 0x%x\n", *(ptr + OFF_MT)));
- i4b_print_frame(m->m_len, m->m_data);
- break;
- }
- i4b_Dfreembuf(m);
-}
-
-/*---------------------------------------------------------------------------*
- * allocate and fill up a TEI management frame for sending
- *---------------------------------------------------------------------------*/
-static struct mbuf *
-build_tei_mgmt_frame(l2_softc_t *l2sc, unsigned char type)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(TEI_MGMT_FRM_LEN)) == NULL)
- return(NULL);
-
- m->m_data[TEIM_SAPIO] = 0xfc; /* SAPI = 63, CR = 0, EA = 0 */
- m->m_data[TEIM_TEIO] = 0xff; /* TEI = 127, EA = 1 */
- m->m_data[TEIM_UIO] = UI; /* UI */
- m->m_data[TEIM_MEIO] = MEI; /* MEI */
- m->m_data[TEIM_MTO] = type; /* message type */
-
- switch(type)
- {
- case MT_ID_REQEST:
- i4b_make_rand_ri(l2sc);
- m->m_data[TEIM_RILO] = l2sc->last_ril;
- m->m_data[TEIM_RIHO] = l2sc->last_rih;
- m->m_data[TEIM_AIO] = (GROUP_TEI << 1) | 0x01;
- break;
-
- case MT_ID_CHK_RSP:
- i4b_make_rand_ri(l2sc);
- m->m_data[TEIM_RILO] = l2sc->last_ril;
- m->m_data[TEIM_RIHO] = l2sc->last_rih;
- m->m_data[TEIM_AIO] = (l2sc->tei << 1) | 0x01;
- break;
-
- case MT_ID_VERIFY:
- m->m_data[TEIM_RILO] = 0;
- m->m_data[TEIM_RIHO] = 0;
- m->m_data[TEIM_AIO] = (l2sc->tei << 1) | 0x01;
- break;
-
- default:
- i4b_Dfreembuf(m);
- panic("build_tei_mgmt_frame: invalid type");
- break;
- }
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_tei_assign - TEI assignment procedure (Q.921, 5.3.2, pp 24)
- * T202func and N202 _MUST_ be set prior to calling this function !
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_assign(l2_softc_t *l2sc)
-{
- struct mbuf *m;
-
- DBGL2(L2_TEI_MSG, "i4b_tei_assign", ("tx TEI ID_Request\n"));
-
- m = build_tei_mgmt_frame(l2sc, MT_ID_REQEST);
-
- if(m == NULL)
- panic("i4b_tei_assign: no mbuf");
-
- i4b_T202_start(l2sc);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_tei_assign - TEI verify procedure (Q.921, 5.3.5, pp 29)
- * T202func and N202 _MUST_ be set prior to calling this function !
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_verify(l2_softc_t *l2sc)
-{
- struct mbuf *m;
-
- DBGL2(L2_TEI_MSG, "i4b_tei_verify", ("tx TEI ID_Verify\n"));
-
- m = build_tei_mgmt_frame(l2sc, MT_ID_VERIFY);
-
- if(m == NULL)
- panic("i4b_tei_verify: no mbuf");
-
- i4b_T202_start(l2sc);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_tei_chkresp - TEI check response procedure (Q.921, 5.3.5, pp 29)
- *---------------------------------------------------------------------------*/
-void
-i4b_tei_chkresp(l2_softc_t *l2sc)
-{
- struct mbuf *m;
- static int lasttei = 0;
-
- if(l2sc->tei != lasttei)
- {
- lasttei = l2sc->tei;
- DBGL2(L2_TEI_MSG, "i4b_tei_chkresp", ("tx TEI ID_Check_Response\n"));
- }
-
- m = build_tei_mgmt_frame(l2sc, MT_ID_CHK_RSP);
-
- if(m == NULL)
- panic("i4b_tei_chkresp: no mbuf");
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * generate some 16 bit "random" number used for TEI mgmt Ri field
- *---------------------------------------------------------------------------*/
-void
-i4b_make_rand_ri(l2_softc_t *l2sc)
-{
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-
- u_short val;
- read_random((char *)&val, sizeof(val));
-
-#else
-
- register u_short val;
- register int i;
- static int called = 42;
-
- val = (l2sc->last_rih << 8) | l2sc->last_ril;
-
- val += ++called;
-
- for(i=0; i < 50 ; i++, val++)
- {
- val |= l2sc->unit+i;
- val <<= i;
- val ^= (time.tv_sec >> 16) ^ time.tv_usec;
- val <<= i;
- val ^= time.tv_sec ^ (time.tv_usec >> 16);
-
- if(val != 0 && val != 0xffff)
- break;
- }
-#endif
- l2sc->last_rih = (val >> 8) & 0x00ff;
- l2sc->last_ril = val & 0x00ff;
-}
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_uframe.c b/sys/i4b/layer2/i4b_uframe.c
deleted file mode 100644
index 90e79124d29c8..0000000000000
--- a/sys/i4b/layer2/i4b_uframe.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_uframe.c - routines for handling U-frames
- * -----------------------------------------------
- *
- * $Id: i4b_uframe.c,v 1.6 1998/12/05 18:05:24 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:30:33 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * process a received U-frame
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_u_frame(int unit, struct mbuf *m)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
- u_char *ptr = m->m_data;
-
- int sapi = GETSAPI(*(ptr + OFF_SAPI));
- int tei = GETTEI(*(ptr + OFF_TEI));
- int pfbit = GETUPF(*(ptr + OFF_CNTL));
-
- switch(*(ptr + OFF_CNTL) & ~UPFBIT)
- {
- /* commands */
-
- case SABME:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("SABME, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXSABME);
- }
- i4b_Dfreembuf(m);
- break;
-
- case UI:
- if(sapi == SAPI_L2M &&
- tei == GROUP_TEI &&
- *(ptr + OFF_MEI) == MEI)
- {
- /* layer 2 management (SAPI = 63) */
-
- i4b_tei_rxframe(unit, m);
- }
- else if(sapi == SAPI_CCP && tei == GROUP_TEI)
- {
- /* call control (SAPI = 0) */
-
- /* strip ui header */
- m_adj(m, UI_HDR_LEN);
- /* to upper layer */
- DL_Unit_Data_Ind(unit, m);
- }
- else
- {
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("unknown UI frame!\n"));
-
- i4b_Dfreembuf(m);
- }
- break;
-
- case DISC:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("DISC, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXDISC);
- }
- i4b_Dfreembuf(m);
- break;
-
- case XID:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("XID, sapi = %d, tei = %d\n", sapi, tei));
- }
- i4b_Dfreembuf(m);
- break;
-
- /* responses */
-
- case DM:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("DM, sapi = %d, tei = %d\n", sapi, tei));
-
- i4b_print_frame(m->m_len, m->m_data);
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXDM);
- }
- i4b_Dfreembuf(m);
- break;
-
- case UA:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("UA, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXUA);
- }
- i4b_Dfreembuf(m);
- break;
-
- case FRMR:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_MSG, "i4b_rxd_u_frame", ("FRMR, sapi = %d, tei = %d\n", sapi, tei));
-
- l2sc->rxd_PF = pfbit;
-
- i4b_next_l2state(l2sc, EV_RXFRMR);
- }
- i4b_Dfreembuf(m);
- break;
-
- default:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei));
- i4b_print_frame(m->m_len, m->m_data);
- }
- else
- {
- DBGL2(L2_U_ERR, "i4b_rxd_u_frame", ("not mine - UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei));
- i4b_print_frame(m->m_len, m->m_data);
- }
- i4b_Dfreembuf(m);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * build U-frame for sending
- *---------------------------------------------------------------------------*/
-struct mbuf *
-i4b_build_u_frame(l2_softc_t *l2sc, crbit_to_nt_t crbit, pbit_t pbit, u_char type)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(U_FRAME_LEN)) == NULL)
- return(NULL);
-
- PUTSAPI(SAPI_CCP, crbit, m->m_data[OFF_SAPI]);
-
- PUTTEI(l2sc->tei, m->m_data[OFF_TEI]);
-
- if(pbit)
- m->m_data[OFF_CNTL] = type | UPBITSET;
- else
- m->m_data[OFF_CNTL] = type & ~UPBITSET;
-
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit SABME command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_sabme(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_sabme", ("tx SABME, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_CMD_TO_NT, pbit, SABME);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit DM response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_dm(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_dm", ("tx DM, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, DM);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit DISC command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_disc(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_disc", ("tx DISC, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_CMD_TO_NT, pbit, DISC);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit UA response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_ua(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_ua", ("tx UA, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, UA);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit FRMR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_frmr(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- DBGL2(L2_U_MSG, "i4b_tx_frmr", ("tx FRMR, tei = %d\n", l2sc->tei));
-
- m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, FRMR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
-
-
-#endif /* NI4BQ921 > 0 */
diff --git a/sys/i4b/layer2/i4b_util.c b/sys/i4b/layer2/i4b_util.c
deleted file mode 100644
index 9f8fe196c56cc..0000000000000
--- a/sys/i4b/layer2/i4b_util.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_util.c - layer 2 utility routines
- * -------------------------------------
- *
- * $Id: i4b_util.c,v 1.15 1998/12/05 18:05:26 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:31:10 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq921.h"
-#else
-#define NI4BQ921 1
-#endif
-#if NI4BQ921 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-/*---------------------------------------------------------------------------*
- * routine ESTABLISH DATA LINK (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_establish_data_link(l2_softc_t *l2sc)
-{
- i4b_l1_activate(l2sc);
-
- i4b_clear_exception_conditions(l2sc);
-
- l2sc->RC = 0;
-
- i4b_tx_sabme(l2sc, P1);
-
- i4b_T200_restart(l2sc);
-
- i4b_T203_stop(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * routine CLEAR EXCEPTION CONDITIONS (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_clear_exception_conditions(l2_softc_t *l2sc)
-{
-
-/*XXX -------------------------------------------------------------- */
-/*XXX is this really appropriate here or should it moved elsewhere ? */
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- if(l2sc->ua_num != UA_EMPTY)
- {
- i4b_Dfreembuf(l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
- }
-/*XXX -------------------------------------------------------------- */
-
- l2sc->peer_busy = 0;
-
- l2sc->rej_excpt = 0;
-
- l2sc->own_busy = 0;
-
- l2sc->ack_pend = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * routine TRANSMIT ENQUIRE (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_transmit_enquire(l2_softc_t *l2sc)
-{
- if(l2sc->own_busy)
- i4b_tx_rnr_command(l2sc, P1);
- else
- i4b_tx_rr_command(l2sc, P1);
-
- l2sc->ack_pend = 0;
-
- i4b_T200_start(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * routine NR ERROR RECOVERY (Q.921 03/93 page 83)
- *---------------------------------------------------------------------------*/
-void
-i4b_nr_error_recovery(l2_softc_t *l2sc)
-{
- i4b_mdl_error_ind(l2sc, "i4b_nr_error_recovery", MDL_ERR_J);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * routine ENQUIRY RESPONSE (Q.921 03/93 page 84)
- *---------------------------------------------------------------------------*/
-void
-i4b_enquiry_response(l2_softc_t *l2sc)
-{
- if(l2sc->own_busy)
- i4b_tx_rnr_response(l2sc, F1);
- else
- i4b_tx_rr_response(l2sc, F1);
-
- l2sc->ack_pend = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * routine INVOKE RETRANSMISSION (Q.921 03/93 page 84)
- *---------------------------------------------------------------------------*/
-void
-i4b_invoke_retransmission(l2_softc_t *l2sc, int nr)
-{
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("nr = %d\n", nr ));
-
- while(l2sc->vs != nr)
- {
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("nr != vs, nr = %d, vs = %d\n", nr, l2sc->vs));
-
- M128DEC(l2sc->vs);
-
-/* XXXXXXXXXXXXXXXXX */
-
- if((l2sc->ua_num != UA_EMPTY) && (l2sc->vs == l2sc->ua_num))
- {
- IF_ENQUEUE(&l2sc->i_queue, l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
- }
- else
- {
- DBGL2(L2_ERROR, "i4b_invoke_retransmission", ("ERROR, l2sc->vs = %d, l2sc->ua_num = %d \n",l2sc->vs, l2sc->ua_num));
- }
-
-/* XXXXXXXXXXXXXXXXX */
-
- i4b_i_frame_queued_up(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * routine ACKNOWLEDGE PENDING (Q.921 03/93 p 70)
- *---------------------------------------------------------------------------*/
-void
-i4b_acknowledge_pending(l2_softc_t *l2sc)
-{
- if(l2sc->ack_pend)
- {
- l2sc->ack_pend = 0;
- i4b_tx_rr_response(l2sc, F0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_print_frame - just print the hex contents of a frame
- *---------------------------------------------------------------------------*/
-void
-i4b_print_frame(int len, u_char *buf)
-{
-#ifdef DO_I4B_DEBUG
- int i;
-
- if (!(i4b_l2_debug & L2_ERROR)) /* XXXXXXXXXXXXXXXXXXXXX */
- return;
-
- for(i = 0; i < len; i++)
- printf(" 0x%x", buf[i]);
- printf("\n");
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_print_l2var - print some l2softc vars
- *---------------------------------------------------------------------------*/
-void
-i4b_print_l2var(l2_softc_t *l2sc)
-{
- DBGL2(L2_ERROR, "i4b_print_l2var", ("unit%d V(R)=%d, V(S)=%d, V(A)=%d,ACKP=%d,PBSY=%d,OBSY=%d\n",
- l2sc->unit,
- l2sc->vr,
- l2sc->vs,
- l2sc->va,
- l2sc->ack_pend,
- l2sc->peer_busy,
- l2sc->own_busy));
-}
-
-/*---------------------------------------------------------------------------*
- * got s or i frame, check if valid ack for last sent frame
- *---------------------------------------------------------------------------*/
-void
-i4b_rxd_ack(l2_softc_t *l2sc, int nr)
-{
-
-#ifdef NOTDEF
- DBGL2(L2_ERROR, "i4b_rxd_ack", ("N(R)=%d, UA=%d, V(R)=%d, V(S)=%d, V(A)=%d\n",
- nr,
- l2sc->ua_num,
- l2sc->vr,
- l2sc->vs,
- l2sc->va));
-#endif
-
- if(l2sc->ua_num != UA_EMPTY)
- {
- int s;
-
- M128DEC(nr);
-
- if(l2sc->ua_num != nr)
- DBGL2(L2_ERROR, "i4b_rxd_ack", ("((N(R)-1)=%d) != (UA=%d) !!!\n", nr, l2sc->ua_num));
-
- s = SPLI4B();
-
- i4b_Dfreembuf(l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
-
- splx(s);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * if not already active, activate layer 1
- *---------------------------------------------------------------------------*/
-void
-i4b_l1_activate(l2_softc_t *l2sc)
-{
- if(l2sc->ph_active == PH_INACTIVE)
- {
- l2sc->ph_active = PH_ACTIVEPEND;
- PH_Act_Req(l2sc->unit);
- }
-};
-
-/*---------------------------------------------------------------------------*
- * check for v(a) <= n(r) <= v(s)
- * nr = receive sequence frame counter, va = acknowledge sequence frame
- * counter and vs = transmit sequence frame counter
- *---------------------------------------------------------------------------*/
-int
-i4b_l2_nr_ok(int nr, int va, int vs)
-{
- if((va > nr) && ((nr != 0) || (va != 127)))
- {
- DBGL2(L2_ERROR, "i4b_l2_nr_ok", ("ERROR, va = %d, nr = %d, vs = %d [1]\n", va, nr, vs));
- return 0; /* fail */
- }
-
- if((nr > vs) && ((vs != 0) || (nr != 127)))
- {
- DBGL2(L2_ERROR, "i4b_l2_nr_ok", ("ERROR, va = %d, nr = %d, vs = %d [2]\n", va, nr, vs));
- return 0; /* fail */
- }
-
- return 1; /* good */
-}
-
-#endif /* NI4BQ921 > 0 */
-
diff --git a/sys/i4b/layer3/i4b_l2if.c b/sys/i4b/layer3/i4b_l2if.c
deleted file mode 100644
index 33b1340738ec2..0000000000000
--- a/sys/i4b/layer3/i4b_l2if.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l2if.c - Layer 3 interface to Layer 2
- * -------------------------------------------
- *
- * $Id: i4b_l2if.c,v 1.14 1998/12/05 18:05:28 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:31:26 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-static unsigned char make_q931_cause(cause_t cause);
-
-/*---------------------------------------------------------------------------*
- * this converts our internal state (number) to the number specified
- * in Q.931 and is used for reporting our state in STATUS messages.
- *---------------------------------------------------------------------------*/
-int i4b_status_tab[] = {
- 0, /* ST_U0, */
- 1, /* ST_U1, */
- 3, /* ST_U3, */
- 4, /* ST_U4, */
- 6, /* ST_U6, */
- 7, /* ST_U7, */
- 8, /* ST_U8, */
- 9, /* ST_U9, */
- 10, /* ST_U10, */
- 11, /* ST_U11, */
- 12, /* ST_U12, */
- 19, /* ST_U19, */
- 6, /* ST_IWA, */
- 6, /* ST_IWR, */
- 1, /* ST_OW, */
- 6, /* ST_IWL, */
-};
-
-/*---------------------------------------------------------------------------*
- * return a valid q.931/q.850 cause from any of the internal causes
- *---------------------------------------------------------------------------*/
-static unsigned char
-make_q931_cause(cause_t cause)
-{
- register unsigned char ret;
-
- switch(GET_CAUSE_TYPE(cause))
- {
- case CAUSET_Q850:
- ret = GET_CAUSE_VAL(cause);
- break;
- case CAUSET_I4B:
- ret = cause_tab_q931[GET_CAUSE_VAL(cause)];
- break;
- default:
- panic("make_q931_cause: unknown cause type!");
- break;
- }
- ret |= EXT_LAST;
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * return status of data link
- *---------------------------------------------------------------------------*/
-int
-i4b_get_dl_stat(call_desc_t *cd)
-{
- return(ctrl_desc[cd->controller].dl_est);
-}
-
-/*---------------------------------------------------------------------------*
- * DL ESTABLISH INDICATION from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_establish_ind(int unit)
-{
- int i;
- int found = 0;
-
- DBGL2(L2_PRIM, "DL-ESTABLISH-IND", ("unit %d\n",unit));
-
- /* first set DL up in controller descriptor */
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_establish_ind", ("unit=%d DL established!\n",unit));
- ctrl_desc[i].dl_est = DL_UP;
- found = 1;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_establish_ind", ("ERROR, controller not found for unit=%d!\n",unit));
- return(-1);
- }
-
- found = 0;
-
- /* second, inform all (!) active call of the event */
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != 0) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_establish_ind", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
- next_l3state(&call_desc[i], EV_DLESTIN);
- found++;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_establish_ind", ("ERROR, no cdid for unit %d found!\n", unit));
- return(-1);
- }
- else
- {
- return(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * DL ESTABLISH CONFIRM from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_establish_cnf(int unit)
-{
- int i;
- int found = 0;
-
- DBGL2(L2_PRIM, "DL-ESTABLISH-CONF", ("unit %d\n",unit));
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != 0) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- ctrl_desc[call_desc[i].controller].dl_est = DL_UP;
-
- DBGL3(L3_MSG, "i4b_dl_establish_cnf", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
-
- next_l3state(&call_desc[i], EV_DLESTCF);
- found++;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_establish_cnf", ("ERROR, no cdid for unit %d found!\n", unit));
- return(-1);
- }
- else
- {
- return(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * DL RELEASE INDICATION from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_release_ind(int unit)
-{
- int i;
- int found = 0;
-
- DBGL2(L2_PRIM, "DL-RELEASE-IND", ("unit %d\n",unit));
-
- /* first set controller to down */
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("unit=%d DL released!\n",unit));
- ctrl_desc[i].dl_est = DL_DOWN;
- found = 1;
- }
- }
-
- if(found == 0)
- {
- DBGL3(L3_ERR, "i4b_dl_release_ind", ("ERROR, controller not found for unit=%d!\n",unit));
- return(-1);
- }
-
- found = 0;
-
- /* second, inform all (!) active calls of the event */
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != 0) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("unit=%d, index=%d cdid=%u cr=%d\n",
- unit, i, call_desc[i].cdid, call_desc[i].cr));
- next_l3state(&call_desc[i], EV_DLRELIN);
- found++;
- }
- }
-
- if(found == 0)
- {
- /* this is not an error since it might be a normal call end */
- DBGL3(L3_MSG, "i4b_dl_release_ind", ("no cdid for unit %d found\n", unit));
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL RELEASE CONFIRM from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_release_cnf(int unit)
-{
- int i;
-
- DBGL2(L2_PRIM, "DL-RELEASE-CONF", ("unit %d\n",unit));
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- DBGL3(L3_MSG, "i4b_dl_release_cnf", ("unit=%d DL released!\n",unit));
- ctrl_desc[i].dl_est = DL_DOWN;
- return(0);
- }
- }
- DBGL3(L3_ERR, "i4b_dl_release_cnf", ("ERROR, controller not found for unit=%d!\n",unit));
- return(-1);
-}
-
-/*---------------------------------------------------------------------------*
- * i4b_dl_data_ind - process a rx'd I-frame got from layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_data_ind(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-DATA-IND", ("unit %d\n",unit));
-#endif
- i4b_decode_q931(unit, m->m_len, m->m_data);
- i4b_Dfreembuf(m);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * dl_unit_data_ind - process a rx'd U-frame got from layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_unit_data_ind(int unit, struct mbuf *m)
-{
-#ifdef NOTDEF
- DBGL2(L2_PRIM, "DL-UNIT-DATA-IND", ("unit %d\n",unit));
-#endif
- i4b_decode_q931(unit, m->m_len, m->m_data);
- i4b_Dfreembuf(m);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * send CONNECT message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_connect(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx CONNECT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_CONNECT_LEN)) == NULL)
- panic("i4b_l3_tx_connect: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = CONNECT; /* message type = connect */
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send RELEASE COMPLETE message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_release_complete(call_desc_t *cd, int send_cause_flag)
-{
- struct mbuf *m;
- u_char *ptr;
- int len = I_FRAME_HDRLEN + MSG_RELEASE_COMPLETE_LEN;
-
- DBGL3(L3_PRIM, "tx RELEASE-COMPLETE", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if(send_cause_flag == 0)
- len -= 4;
-
- if((m = i4b_Dgetmbuf(len)) == NULL)
- panic("i4b_l3_tx_release_complete: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = RELEASE_COMPLETE; /* message type = release complete */
-
- if(send_cause_flag)
- {
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = make_q931_cause(cd->cause_out);
- }
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send DISCONNECT message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_disconnect(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx DISCONNECT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_DISCONNECT_LEN)) == NULL)
- panic("i4b_l3_tx_disconnect: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call ref length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = DISCONNECT; /* message type = disconnect */
-
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = make_q931_cause(cd->cause_out);
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send SETUP message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_setup(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
- int slen = strlen(cd->src_telno);
- int dlen = strlen(cd->dst_telno);
-
- /*
- * there is one additional octet if cd->bprot == BPROT_NONE
- * NOTE: the selection of a bearer capability by a B L1
- * protocol is highly questionable and a better
- * mechanism should be used in future. (-hm)
- */
-
- DBGL3(L3_PRIM, "tx SETUP", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_SETUP_LEN + slen + dlen +
- (cd->bprot == BPROT_NONE ? 1 : 0))) == NULL)
- {
- panic("i4b_l3_tx_setup: can't allocate mbuf\n");
- }
-
- cd->crflag = CRF_ORIG; /* we are the originating side */
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call ref length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = SETUP; /* message type = setup */
-
- *ptr++ = IEI_SENDCOMPL; /* sending complete */
-
- *ptr++ = IEI_BEARERCAP; /* bearer capability */
-
- /* XXX
- * currently i have no idea if this should be switched by
- * the choosen B channel protocol or if there should be a
- * separate configuration item for the bearer capability.
- * For now, it is switched by the choosen b protocol (-hm)
- */
-
- switch(cd->bprot)
- {
- case BPROT_NONE: /* telephony */
- *ptr++ = IEI_BEARERCAP_LEN+1;
- *ptr++ = IT_CAP_SPEECH;
- *ptr++ = IT_RATE_64K;
- *ptr++ = IT_UL1_G711A;
- break;
-
- case BPROT_RHDLC: /* raw HDLC */
- *ptr++ = IEI_BEARERCAP_LEN;
- *ptr++ = IT_CAP_UNR_DIG_INFO;
- *ptr++ = IT_RATE_64K;
- break;
-
- default:
- *ptr++ = IEI_BEARERCAP_LEN;
- *ptr++ = IT_CAP_UNR_DIG_INFO;
- *ptr++ = IT_RATE_64K;
- break;
- }
-
- *ptr++ = IEI_CHANNELID; /* channel id */
- *ptr++ = IEI_CHANNELID_LEN; /* channel id length */
-
- switch(cd->channelid)
- {
- case CHAN_B1:
- *ptr++ = CHANNELID_B1;
- break;
- case CHAN_B2:
- *ptr++ = CHANNELID_B2;
- break;
- default:
- *ptr++ = CHANNELID_ANY;
- break;
- }
-
- *ptr++ = IEI_CALLINGPN; /* calling party no */
- *ptr++ = IEI_CALLINGPN_LEN+slen;/* calling party no length */
- *ptr++ = NUMBER_TYPEPLAN; /* type of number, number plan id */
- strncpy(ptr, cd->src_telno, slen);
- ptr += slen;
-
- *ptr++ = IEI_CALLEDPN; /* called party no */
- *ptr++ = IEI_CALLEDPN_LEN+dlen; /* called party no length */
- *ptr++ = NUMBER_TYPEPLAN; /* type of number, number plan id */
- strncpy(ptr, cd->dst_telno, dlen);
- ptr += dlen;
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send CONNECT ACKNOWLEDGE message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_connect_ack(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx CONNECT-ACK", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_CONNECT_ACK_LEN)) == NULL)
- panic("i4b_l3_tx_connect_ack: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = CONNECT_ACKNOWLEDGE; /* message type = connect ack */
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send STATUS message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_status(call_desc_t *cd, u_char q850cause)
-{
- struct mbuf *m;
- u_char *ptr;
-
- DBGL3(L3_PRIM, "tx STATUS", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_STATUS_LEN)) == NULL)
- panic("i4b_l3_tx_status: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = STATUS; /* message type = connect ack */
-
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = q850cause;
-
- *ptr++ = IEI_CALLSTATE; /* call state ie */
- *ptr++ = CALLSTATE_LEN;
- *ptr++ = i4b_status_tab[cd->Q931state];
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send RELEASE message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_release(call_desc_t *cd, int send_cause_flag)
-{
- struct mbuf *m;
- u_char *ptr;
- int len = I_FRAME_HDRLEN + MSG_RELEASE_LEN;
-
- DBGL3(L3_PRIM, "tx RELEASE", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- if(send_cause_flag == 0)
- len -= 4;
-
- if((m = i4b_Dgetmbuf(len)) == NULL)
- panic("i4b_l3_tx_release: can't allocate mbuf\n");
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = RELEASE; /* message type = release complete */
-
- if(send_cause_flag)
- {
- *ptr++ = IEI_CAUSE; /* cause ie */
- *ptr++ = CAUSE_LEN;
- *ptr++ = CAUSE_STD_LOC_OUT;
- *ptr++ = make_q931_cause(cd->cause_out);
- }
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-/*---------------------------------------------------------------------------*
- * send ALERTING message
- *---------------------------------------------------------------------------*/
-void
-i4b_l3_tx_alert(call_desc_t *cd)
-{
- struct mbuf *m;
- u_char *ptr;
-
- if((m = i4b_Dgetmbuf(I_FRAME_HDRLEN + MSG_ALERT_LEN)) == NULL)
- panic("i4b_l3_tx_alert: can't allocate mbuf\n");
-
- DBGL3(L3_PRIM, "tx ALERT", ("unit %d, cr = 0x%02x\n", ctrl_desc[cd->controller].unit, cd->cr));
-
- ptr = m->m_data + I_FRAME_HDRLEN;
-
- *ptr++ = PD_Q931; /* protocol discriminator */
- *ptr++ = 0x01; /* call reference length */
- *ptr++ = setup_cr(cd, cd->cr); /* call reference value */
- *ptr++ = ALERT; /* message type = alert */
-
- DL_Data_Req(ctrl_desc[cd->controller].unit, m);
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_l3.h b/sys/i4b/layer3/i4b_l3.h
deleted file mode 100644
index 9d05055fc5373..0000000000000
--- a/sys/i4b/layer3/i4b_l3.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3.h - layer 3 header file
- * ------------------------------
- *
- * $Id: i4b_l3.h,v 1.8 1998/12/05 18:05:30 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:31:41 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L3_H_
-#define _I4B_L3_H_
-
-extern int utoc_tab[];
-extern unsigned char cause_tab_q931[];
-
-extern int i4b_aoc ( unsigned char *, call_desc_t *cd );
-extern void i4b_decode_q931 ( int unit, int msg_len, u_char *msg_ptr );
-extern int i4b_decode_q931_cs0_ie ( int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr );
-extern void i4b_decode_q931_message ( int unit, call_desc_t *cd, u_char message_type );
-extern void i4b_l3_stop_all_timers ( call_desc_t *cd );
-extern void i4b_l3_tx_alert ( call_desc_t *cd );
-extern void i4b_l3_tx_connect ( call_desc_t *cd );
-extern void i4b_l3_tx_connect_ack ( call_desc_t *cd );
-extern void i4b_l3_tx_disconnect ( call_desc_t *cd );
-extern void i4b_l3_tx_release ( call_desc_t *cd, int send_cause_flag );
-extern void i4b_l3_tx_release_complete ( call_desc_t *cd, int send_cause_flag );
-extern void i4b_l3_tx_setup ( call_desc_t *cd );
-extern void i4b_l3_tx_status ( call_desc_t *cd, u_char q850cause );
-extern int i4b_dl_data_ind ( int unit, struct mbuf *m );
-extern int i4b_dl_establish_cnf ( int unit );
-extern int i4b_dl_establish_ind ( int unit );
-extern int i4b_dl_release_cnf ( int unit );
-extern int i4b_dl_release_ind ( int unit );
-extern int i4b_dl_unit_data_ind ( int unit, struct mbuf *m );
-extern int i4b_get_dl_stat( call_desc_t *cd );
-extern int i4b_mdl_status_ind ( int unit, int status, int parm);
-extern void i4b_print_frame ( int len, u_char *buf );
-extern void next_l3state ( call_desc_t *cd, int event );
-extern char *print_l3state ( call_desc_t *cd );
-extern unsigned char setup_cr ( call_desc_t *cd, unsigned char cr );
-extern void T303_start ( call_desc_t *cd );
-extern void T303_stop ( call_desc_t *cd );
-extern void T305_start ( call_desc_t *cd );
-extern void T305_stop ( call_desc_t *cd );
-extern void T308_start ( call_desc_t *cd );
-extern void T308_stop ( call_desc_t *cd );
-extern void T309_start ( call_desc_t *cd );
-extern void T309_stop ( call_desc_t *cd );
-extern void T310_start ( call_desc_t *cd );
-extern void T310_stop ( call_desc_t *cd );
-extern void T313_start ( call_desc_t *cd );
-extern void T313_stop ( call_desc_t *cd );
-
-#endif /* _I4B_L3_H_ */
diff --git a/sys/i4b/layer3/i4b_l3fsm.c b/sys/i4b/layer3/i4b_l3fsm.c
deleted file mode 100644
index e45e1195e399d..0000000000000
--- a/sys/i4b/layer3/i4b_l3fsm.c
+++ /dev/null
@@ -1,1034 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3fsm.c - layer 3 FSM
- * -------------------------
- *
- * $Id: i4b_l3fsm.c,v 1.13 1998/12/05 18:05:31 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:32:17 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-
-static void F_00A(call_desc_t *cd), F_00H(call_desc_t *cd), F_00I(call_desc_t *cd);
-static void F_00J(call_desc_t *cd);
-
-static void F_01B(call_desc_t *cd), F_01K(call_desc_t *cd), F_01L(call_desc_t *cd);
-static void F_01M(call_desc_t *cd), F_01N(call_desc_t *cd), F_01U(call_desc_t *cd);
-static void F_01O(call_desc_t *cd);
-
-static void F_03C(call_desc_t *cd), F_03N(call_desc_t *cd), F_03O(call_desc_t *cd);
-static void F_03P(call_desc_t *cd), F_03Y(call_desc_t *cd);
-
-static void F_04O(call_desc_t *cd);
-
-static void F_06D(call_desc_t *cd), F_06E(call_desc_t *cd), F_06F(call_desc_t *cd);
-static void F_06G(call_desc_t *cd), F_06J(call_desc_t *cd), F_06Q(call_desc_t *cd);
-
-static void F_07E(call_desc_t *cd), F_07F(call_desc_t *cd), F_07G(call_desc_t *cd);
-
-static void F_08R(call_desc_t *cd), F_08Z(call_desc_t *cd);
-
-static void F_09D(call_desc_t *cd), F_09E(call_desc_t *cd), F_09F(call_desc_t *cd);
-static void F_09G(call_desc_t *cd);
-
-static void F_11J(call_desc_t *cd), F_11Q(call_desc_t *cd), F_11V(call_desc_t *cd);
-
-static void F_12C(call_desc_t *cd), F_12J(call_desc_t *cd);
-
-static void F_19I(call_desc_t *cd), F_19J(call_desc_t *cd), F_19K(call_desc_t *cd);
-static void F_19W(call_desc_t *cd);
-
-static void F_NCNA(call_desc_t *cd), F_STENQ(call_desc_t *cd), F_STAT(call_desc_t *cd);
-static void F_INFO(call_desc_t *cd), F_RELCP(call_desc_t *cd), F_REL(call_desc_t *cd);
-static void F_DISC(call_desc_t *cd), F_DCRQ(call_desc_t *cd), F_UEM(call_desc_t *cd);
-static void F_SIGN(call_desc_t *cd), F_DLEI(call_desc_t *cd), F_ILL(call_desc_t *cd);
-static void F_309TO(call_desc_t *cd), F_DECF(call_desc_t *cd), F_FCTY(call_desc_t *cd);
-static void F_DECF1(call_desc_t *cd), F_DECF2(call_desc_t *cd), F_DECF3(call_desc_t *cd);
-static void F_DLRI(call_desc_t *cd), F_DLRIA(call_desc_t *cd), F_DECF4(call_desc_t *cd);
-
-static char *l3state_text[N_STATES] = {
- "ST_U0 - Null",
- "ST_U1 - Out Init",
- "ST_U3 - Out Proc",
- "ST_U4 - Out Delv",
- "ST_U6 - In Pres",
- "ST_U7 - In Rxd",
- "ST_U8 - In ConReq",
- "ST_U9 - In Proc",
- "ST_U10 - Active",
- "ST_U11 - Disc Req",
- "ST_U12 - Disc Ind",
- "ST_U19 - Rel Req",
-
- "ST_IWA - In Wait EST-Accept",
- "ST_IWR - In Wait EST-Reject",
- "ST_OW - Out Wait EST",
- "ST_IWL - In Wait EST-Alert",
-
- "ST_SUSE - Subroutine sets state",
-
- "Illegal State"
-};
-
-static char *l3event_text[N_EVENTS] = {
- "EV_SETUPRQ - L4 SETUP REQ", /* setup request from L4 */
- "EV_DISCRQ - L4 DISC REQ", /* disconnect request from L4 */
- "EV_RELRQ - L4 REL REQ", /* release request from L4 */
- "EV_ALERTRQ - L4 ALERT REQ", /* alerting request from L4 */
- "EV_SETACRS - L4 accept RSP", /* setup response accept from l4 */
- "EV_SETRJRS - L4 reject RSP", /* setup response reject from l4 */
- "EV_SETDCRS - L4 ignore RSP", /* setup response dontcare from l4 */
-
- "EV_SETUP - rxd SETUP", /* incoming SETUP message from L2 */
- "EV_STATUS - rxd STATUS", /* incoming STATUS message from L2 */
- "EV_RELEASE - rxd REL", /* incoming RELEASE message from L2 */
- "EV_RELCOMP - rxd REL COMPL", /* incoming RELEASE COMPLETE from L2 */
- "EV_SETUPAK - rxd SETUP ACK", /* incoming SETUP ACK message from L2 */
- "EV_CALLPRC - rxd CALL PROC", /* incoming CALL PROCEEDING from L2 */
- "EV_ALERT - rxd ALERT", /* incoming ALERT message from L2 */
- "EV_CONNECT - rxd CONNECT", /* incoming CONNECT message from L2 */
- "EV_PROGIND - rxd PROG IND", /* incoming Progress IND from L2 */
- "EV_DISCONN - rxd DISC", /* incoming DISCONNECT message from L2 */
- "EV_CONACK - rxd CONN ACK", /* incoming CONNECT ACK message from L2 */
- "EV_STATENQ - rxd STAT ENQ", /* incoming STATUS ENQ message from L2 */
- "EV_INFO - rxd INFO", /* incoming INFO message from L2 */
- "EV_FACILITY - rxd FACILITY", /* incoming FACILITY message */
-
- "EV_T303EXP - T303 timeout", /* Timer T303 expired */
- "EV_T305EXP - T305 timeout", /* Timer T305 expired */
- "EV_T308EXP - T308 timeout", /* Timer T308 expired */
- "EV_T309EXP - T309 timeout", /* Timer T309 expired */
- "EV_T310EXP - T310 timeout", /* Timer T310 expired */
- "EV_T313EXP - T313 timeout", /* Timer T313 expired */
-
- "EV_DLESTIN - L2 DL_Est_Ind", /* dl establish indication from l2 */
- "EV_DLRELIN - L2 DL_Rel_Ind", /* dl release indication from l2 */
- "EV_DLESTCF - L2 DL_Est_Cnf", /* dl establish confirm from l2 */
- "EV_DLRELCF - L2 DL_Rel_Cnf", /* dl release confirm from l2 */
-
- "EV_ILL - Illegal event!!" /* Illegal */
-};
-
-/*---------------------------------------------------------------------------*
- * layer 3 state transition table
- *---------------------------------------------------------------------------*/
-struct l3state_tab {
- void (*func) (call_desc_t *); /* function to execute */
- int newstate; /* next state */
-} l3state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_SETUPRQ*/ {{F_00A, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DISCRQ */ {{F_ILL, ST_ILL}, {F_01B, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_ILL, ST_ILL}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_ILL, ST_ILL}, {F_NCNA, ST_U12}, {F_ILL, ST_ILL}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_DCRQ, ST_U11}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_RELRQ */ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_03C, ST_U19}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_12C, ST_U19}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_ALERTRQ*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06D, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_09D, ST_U7}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETACRS*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06E, ST_SUSE}, {F_07E, ST_U8}, {F_ILL, ST_ILL}, {F_09E, ST_U8}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETRJRS*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06F, ST_SUSE}, {F_07F, ST_U0}, {F_ILL, ST_ILL}, {F_09F, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETDCRS*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_06G, ST_U0}, {F_07G, ST_U0}, {F_ILL, ST_ILL}, {F_09G, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_SETUP */ {{F_00H, ST_U6}, {F_SIGN, ST_U1}, {F_SIGN, ST_U3}, {F_SIGN, ST_U4}, {F_SIGN, ST_U6}, {F_SIGN, ST_U7}, {F_SIGN, ST_U8}, {F_SIGN, ST_U9}, {F_SIGN, ST_U10}, {F_SIGN, ST_U11}, {F_SIGN, ST_U12}, {F_SIGN, ST_U19}, {F_SIGN, ST_IWA}, {F_SIGN, ST_IWR}, {F_SIGN, ST_OW}, {F_SIGN, ST_IWL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_STATUS */ {{F_00I, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_19I, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_STAT, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_RELEASE*/ {{F_00J, ST_U0}, {F_UEM, ST_SUSE}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_06J, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_11J, ST_U0}, {F_12J, ST_U0}, {F_19J, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_REL, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_RELCOMP*/ {{F_NCNA, ST_U0}, {F_01K, ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_19K, ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_RELCP,ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_SETUPAK*/ {{F_UEM, ST_SUSE}, {F_01L, ST_U3}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_CALLPRC*/ {{F_UEM, ST_SUSE}, {F_01M, ST_U3}, {F_NCNA, ST_U3}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_ALERT */ {{F_UEM, ST_SUSE}, {F_01N, ST_U4}, {F_03N, ST_U4}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_CONNECT*/ {{F_UEM, ST_SUSE}, {F_01O, ST_U10}, {F_03O, ST_U10}, {F_04O, ST_U10}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_PROGIND*/ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_03P, ST_U3}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DISCONN*/ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_06Q, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_11Q, ST_U19}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_DISC, ST_U12}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_CONACK */ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_08R, ST_U10}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_STATENQ*/ {{F_STENQ,ST_U0}, {F_STENQ,ST_U1}, {F_STENQ,ST_U3}, {F_STENQ,ST_U4}, {F_STENQ,ST_U6}, {F_STENQ,ST_U7}, {F_STENQ,ST_U8}, {F_STENQ,ST_U9}, {F_STENQ,ST_U10}, {F_STENQ,ST_U11}, {F_STENQ,ST_U12}, {F_STENQ,ST_U19}, {F_STENQ,ST_IWA}, {F_STENQ,ST_IWR}, {F_STENQ,ST_OW}, {F_STENQ,ST_OW}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_INFO */ {{F_UEM, ST_SUSE}, {F_UEM, ST_SUSE}, {F_INFO, ST_U3}, {F_INFO, ST_U4}, {F_UEM, ST_SUSE}, {F_INFO, ST_U7}, {F_INFO, ST_U8}, {F_INFO, ST_U9}, {F_INFO, ST_U10}, {F_INFO, ST_U11}, {F_INFO, ST_U12}, {F_UEM, ST_SUSE}, {F_INFO, ST_IWA}, {F_INFO, ST_IWR}, {F_INFO, ST_OW}, {F_INFO, ST_OW}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_FACILITY*/ {{F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_FCTY, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_T303EXP*/ {{F_ILL, ST_ILL}, {F_01U, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T305EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_11V, ST_U19}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T308EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_19W, ST_SUSE}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T309EXP*/ {{F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_309TO,ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T310EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_03Y, ST_U11}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_T313EXP*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_08Z, ST_U11}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/* STATE: ST_U0 ST_U1 ST_U3 ST_U4 ST_U6 ST_U7 ST_U8 ST_U9 ST_U10 ST_U11 ST_U12 ST_U19 ST_IWA ST_IWR ST_OW ST_IWL ST_SUBSET ST_ILL */
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/*EV_DLESTIN*/ {{F_ILL, ST_ILL}, {F_DLEI, ST_U1}, {F_DLEI, ST_U3}, {F_DLEI, ST_U4}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_DLEI, ST_U1}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DLRELIN*/ {{F_NCNA, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRIA,ST_U10}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_DLRI, ST_U0}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DLESTCF*/ {{F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF, ST_SUSE}, {F_DECF2,ST_U8}, {F_DECF3,ST_U0}, {F_DECF1,ST_U1}, {F_DECF4,ST_U7}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_DLRELCF*/ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}},
-/*EV_ILL */ {{F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}, {F_ILL, ST_ILL}}
-};
-
-/*---------------------------------------------------------------------------*
- * event handler
- *---------------------------------------------------------------------------*/
-void next_l3state(call_desc_t *cd, int event)
-{
- int currstate, newstate;
-
- if(event > N_EVENTS)
- panic("i4b_l3fsm.c: event > N_EVENTS\n");
-
- currstate = cd->Q931state;
-
- if(currstate > N_STATES)
- panic("i4b_l3fsm.c: currstate > N_STATES\n");
-
- newstate = l3state_tab[event][currstate].newstate;
-
- if(newstate > N_STATES)
- panic("i4b_l3fsm.c: newstate > N_STATES\n");
-
- DBGL3(L3_F_MSG, "next_l3state", ("L3 FSM event [%s]: [%s => %s]\n",
- l3event_text[event],
- l3state_text[currstate],
- l3state_text[newstate]));
-
- /* execute function */
-
- (*l3state_tab[event][currstate].func)(cd);
-
- if(newstate == ST_ILL)
- {
- newstate = currstate;
- DBGL3(L3_F_ERR, "next_l3state", ("FSM illegal state, state = %s, event = %s!\n",
- l3state_text[newstate],
- l3event_text[event]));
- }
-
- if(newstate != ST_SUSE)
- cd->Q931state = newstate;
-}
-
-/*---------------------------------------------------------------------------*
- * resturn pointer to current state description
- *---------------------------------------------------------------------------*/
-char *print_l3state(call_desc_t *cd)
-{
- return((char *) l3state_text[cd->Q931state]);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event L4 setup req
- *---------------------------------------------------------------------------*/
-static void F_00A(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00A", ("FSM function F_00A executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_OW;
- }
- else
- {
- i4b_l3_tx_setup(cd);
- cd->Q931state = ST_U1;
- }
-
- cd->T303_first_to = 1;
- T303_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event SETUP from L2
- *---------------------------------------------------------------------------*/
-static void F_00H(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00H", ("FSM function F_00H executing\n"));
- i4b_l4_connect_ind(cd); /* tell l4 we have an incoming setup */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event STATUS from L2
- *---------------------------------------------------------------------------*/
-static void F_00I(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00I", ("FSM function F_00I executing\n"));
-
- if(cd->call_state != 0)
- {
- cd->cause_out = 101;
- i4b_l3_tx_release_complete(cd, 1); /* 1 = send cause */
- }
- cd->Q931state = ST_U0;
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_00J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_00J", ("FSM function F_00J executing\n"));
- i4b_l3_tx_release_complete(cd, 0); /* 0 = don't send cause */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event disconnect req from L4
- *---------------------------------------------------------------------------*/
-static void F_01B(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01B", ("FSM function F_01B executing\n"));
- /* cause from L4 */
- i4b_l3_tx_disconnect(cd);
- T303_stop(cd);
- T305_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event RELEASE COMPLETE from L2
- *---------------------------------------------------------------------------*/
-static void F_01K(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01K", ("FSM function F_01K executing\n"));
- T303_stop(cd);
- i4b_l4_disconnect_ind(cd); /* tell l4 we were rejected */
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event SETUP ACK from L2
- *---------------------------------------------------------------------------*/
-static void F_01L(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01L", ("FSM function F_01L executing\n"));
- T303_stop(cd);
-
- /*
- * since this implementation does NOT support overlap sending,
- * we react here as if we received a CALL PROCEEDING because
- * several PBX's react with a SETUP ACK even if the called
- * number is complete AND we sent a SENDING COMPLETE in the
- * preceeding SETUP message. (-hm)
- */
-
- T310_start(cd);
- i4b_l4_proceeding_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event CALL PROCEEDING from L2
- *---------------------------------------------------------------------------*/
-static void F_01M(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01M", ("FSM function F_01M executing\n"));
- T303_stop(cd);
- T310_start(cd);
- i4b_l4_proceeding_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event ALERT from L2 (XXX !)
- *---------------------------------------------------------------------------*/
-static void F_01N(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01N", ("FSM function F_01N executing\n"));
- T303_stop(cd);
- i4b_l4_alert_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event CONNECT from L2 (XXX !)
- *---------------------------------------------------------------------------*/
-static void F_01O(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01O", ("FSM function F_01O executing\n"));
- T303_stop(cd);
- i4b_l3_tx_connect_ack(cd);
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U1 event T303 timeout
- *---------------------------------------------------------------------------*/
-static void F_01U(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_01U", ("FSM function F_01U executing\n"));
- if(cd->T303_first_to == 1)
- {
- cd->T303_first_to = 0;
- i4b_l3_tx_setup(cd);
- T303_start(cd);
- cd->Q931state = ST_U1;
- }
- else
- {
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- cd->Q931state = ST_U0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event release req from L4
- *---------------------------------------------------------------------------*/
-static void F_03C(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03C", ("FSM function F_03C executing\n"));
- T310_stop(cd);
- cd->cause_out = 6;
- i4b_l3_tx_release(cd, 1); /* 0 = don't send cause */
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event ALERT from L2
- *---------------------------------------------------------------------------*/
-static void F_03N(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03N", ("FSM function F_03N executing\n"));
- T310_stop(cd);
- i4b_l4_alert_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event CONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_03O(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03O", ("FSM function F_03O executing\n"));
- T310_stop(cd);
- i4b_l3_tx_connect_ack(cd); /* CONNECT ACK to network */
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event PROGESS IND from L2
- *---------------------------------------------------------------------------*/
-static void F_03P(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03P", ("FSM function F_03P executing\n"));
- T310_stop(cd);
-#ifdef NOTDEF
- i4b_l4_progress_ind(cd);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event T310 timeout
- *---------------------------------------------------------------------------*/
-static void F_03Y(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_03Y", ("FSM function F_03Y executing\n"));
- cd->cause_out = 102; /* recovery on timer expiry */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- i4b_l4_disconnect_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U4 event CONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_04O(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_04O", ("FSM function F_04O executing\n"));
- i4b_l3_tx_connect_ack(cd); /* CONNECT ACK to network */
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event alert req from L4
- *---------------------------------------------------------------------------*/
-static void F_06D(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06D", ("FSM function F_06D executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_IWL;
- }
- else
- {
- i4b_l3_tx_alert(cd);
- cd->Q931state = ST_U7;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event incoming setup accept from L4
- *---------------------------------------------------------------------------*/
-static void F_06E(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06E", ("FSM function F_06E executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_IWA;
- }
- else
- {
- i4b_l3_tx_connect(cd);
- cd->Q931state = ST_U8;
- }
- T313_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event incoming setup reject from L4
- *---------------------------------------------------------------------------*/
-static void F_06F(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06F", ("FSM function F_06F executing\n"));
-
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_IWR;
- }
- else
- {
- int s = SPLI4B();
- i4b_l3_tx_release_complete(cd, 1);
- cd->Q931state = ST_U0;
- freecd_by_cd(cd);
- splx(s);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event incoming setup ignore from L4
- *---------------------------------------------------------------------------*/
-static void F_06G(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06G", ("FSM function F_06G executing\n"));
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_06J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06J", ("FSM function F_06J executing\n"));
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event DISCONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_06Q(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_06Q", ("FSM function F_06Q executing\n"));
- i4b_l4_disconnect_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U7 event setup response accept from L4
- *---------------------------------------------------------------------------*/
-static void F_07E(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_07E", ("FSM function F_07E executing\n"));
- i4b_l3_tx_connect(cd);
- T313_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U7 event setup response reject from L4
- *---------------------------------------------------------------------------*/
-static void F_07F(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_07F", ("FSM function F_07F executing\n"));
- i4b_l3_tx_release_complete(cd, 1);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U7 event setup response ignore from L4
- *---------------------------------------------------------------------------*/
-static void F_07G(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_07G", ("FSM function F_07G executing\n"));
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U8 event CONNECT ACK from L2
- *---------------------------------------------------------------------------*/
-static void F_08R(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_08R", ("FSM function F_08R executing\n"));
- T313_stop(cd);
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U8 event T313 timeout
- *---------------------------------------------------------------------------*/
-static void F_08Z(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_08Z", ("FSM function F_08Z executing\n"));
- cd->cause_out = 102; /* recovery on timer expiry */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- i4b_l4_disconnect_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event alert req from L4
- *---------------------------------------------------------------------------*/
-static void F_09D(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09D", ("FSM function F_09D executing\n"));
- i4b_l3_tx_alert(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event setup response accept from L4
- *---------------------------------------------------------------------------*/
-static void F_09E(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09E", ("FSM function F_09E executing\n"));
- i4b_l3_tx_connect(cd);
- T313_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event setup response reject from L4
- *---------------------------------------------------------------------------*/
-static void F_09F(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09F", ("FSM function F_09F executing\n"));
- i4b_l3_tx_release_complete(cd, 1);
- freecd_by_cd(cd);
-}
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event setup response ignore from L4
- *---------------------------------------------------------------------------*/
-static void F_09G(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_09G", ("FSM function F_09G executing\n"));
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U11 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_11J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_11J", ("FSM function F_11J executing\n"));
- T305_stop(cd);
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U11 event DISCONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_11Q(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_11Q", ("FSM function F_11Q executing\n"));
- T305_stop(cd);
- i4b_l3_tx_release(cd, 0);
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U11 event T305 timeout
- *---------------------------------------------------------------------------*/
-static void F_11V(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_11V", ("FSM function F_11V executing\n"));
- cd->cause_out = 102;
- i4b_l3_tx_release(cd, 1);
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U12 event release req from L4
- *---------------------------------------------------------------------------*/
-static void F_12C(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_12C", ("FSM function F_12C executing\n"));
- i4b_l3_tx_release(cd, 1);
- cd->T308_first_to = 1;
- T308_start(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U12 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_12J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_12J", ("FSM function F_12J executing\n"));
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event STATUS from L2
- *---------------------------------------------------------------------------*/
-static void F_19I(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19I", ("FSM function F_19I executing\n"));
-
- if(cd->call_state == 0)
- {
- i4b_l4_status_ind(cd);
- freecd_by_cd(cd);
- cd->Q931state = ST_U0;
- }
- else
- {
- cd->Q931state = ST_U19;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_19J(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19J", ("FSM function F_19J executing\n"));
- T308_stop(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event RELEASE COMPLETE from L2
- *---------------------------------------------------------------------------*/
-static void F_19K(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19K", ("FSM function F_19K executing\n"));
- T308_stop(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U19 event T308 timeout
- *---------------------------------------------------------------------------*/
-static void F_19W(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_19W", ("FSM function F_19W executing\n"));
- if(cd->T308_first_to == 0)
- {
- cd->T308_first_to = 1;
- i4b_l3_tx_release(cd, 0);
- T308_start(cd);
- cd->Q931state = ST_U19;
- }
- else
- {
- cd->T308_first_to = 0;
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- cd->Q931state = ST_U0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM routine no change no action
- *---------------------------------------------------------------------------*/
-static void F_NCNA(call_desc_t *cd)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event STATUS ENQ from L2
- *---------------------------------------------------------------------------*/
-static void F_STENQ(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_STENQ", ("FSM function F_STENQ executing\n"));
- i4b_l3_tx_status(cd, CAUSE_Q850_STENQRSP); /* 30, resonse to stat enq */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except 0 & 19 event STATUS from L2
- *---------------------------------------------------------------------------*/
-static void F_STAT(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_STAT", ("FSM function F_STAT executing\n"));
- if(cd->call_state == 0)
- {
- i4b_l4_status_ind(cd);
- cd->Q931state = ST_U0;
- freecd_by_cd(cd);
- }
- else
- {
- /* XXX !!!!!!!!!!!!!!!!!! */
-
- i4b_l4_status_ind(cd);
- cd->cause_out = 101; /* message not compatible with call state */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- cd->Q931state = ST_U11;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event INFORMATION from L2
- *---------------------------------------------------------------------------*/
-static void F_INFO(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_INFO", ("FSM function F_INFO executing\n"));
- i4b_l4_info_ind(cd);
- /* remain in current state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event RELEASE COMPLETE from L2
- *---------------------------------------------------------------------------*/
-static void F_RELCP(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_RELCP", ("FSM function F_RELCP executing\n"));
- i4b_l3_stop_all_timers(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_REL(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_REL", ("FSM function F_REL executing\n"));
- i4b_l3_stop_all_timers(cd);
- i4b_l3_tx_release_complete(cd, 0);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event DISCONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_DISC(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DISC", ("FSM function F_DISC executing\n"));
- i4b_l3_stop_all_timers(cd);
-
- /*
- * no disconnect ind to L4, no jump to state U12
- * instead we issue a RELEASE and jump to U19
- */
-
- i4b_l3_tx_release(cd, 0);
- cd->T308_first_to = 1;
- T308_start(cd);
- cd->Q931state = ST_U19;
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event disconnect request from L4
- *---------------------------------------------------------------------------*/
-static void F_DCRQ(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DCRQ", ("FSM function F_DCRQ executing\n"));
- /* cause from L4 */
- i4b_l3_tx_disconnect(cd);
- T305_start(cd);
- cd->Q931state = ST_U11;
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except 0 event unexpected message from L2
- *---------------------------------------------------------------------------*/
-static void F_UEM(call_desc_t *cd)
-{
- DBGL3(L3_F_ERR, "F_UEM", ("FSM function F_UEM executing, state = %s\n", print_l3state(cd)));
- i4b_l3_tx_status(cd, CAUSE_Q850_MSGNCWCS); /* 101, message not compatible with call state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except 0 event SETUP from L2
- *---------------------------------------------------------------------------*/
-static void F_SIGN(call_desc_t *cd)
-{
- DBGL3(L3_F_ERR, "F_SIGN", ("FSM function F_SIGN executing\n"));
-
-/* XXX */ /* freecd_by_cd(cd); ?????????? XXX */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM relevant states event DL ESTABLISH IND from L2
- *---------------------------------------------------------------------------*/
-static void F_DLEI(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DLEI", ("FSM function F_DLEI executing\n"));
-
-/* XXX */
-
- /* remain in current state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event illegal event occured
- *---------------------------------------------------------------------------*/
-static void F_ILL(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_ILL", ("FSM function F_ILL executing\n"));
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event T309 timeout
- *---------------------------------------------------------------------------*/
-static void F_309TO(call_desc_t *cd)
-{
- DBGL3(L3_F_ERR, "F_309TO", ("FSM function F_309TO executing\n"));
-
-/* XXX */
-
-#ifdef NOTDEF
- i4b_l4_dl_fail_ind(cd);
-#endif
-
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event FACILITY message received
- *---------------------------------------------------------------------------*/
-static void F_FCTY(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_FCTY", ("FSM function F_FCTY executing\n"));
- /* ST_SUSE, no change in state ! */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_OW event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF1(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF1", ("FSM function F_DECF1 executing\n"));
- i4b_l3_tx_setup(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWA event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF2(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF2", ("FSM function F_DECF2 executing\n"));
- i4b_l3_tx_connect(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWR event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF3(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF3", ("FSM function F_DECF3 executing\n"));
- i4b_l3_tx_release_complete(cd, 1);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWL event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF4(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF4", ("FSM function F_DECF4 executing\n"));
- i4b_l3_tx_alert(cd);
-}
-
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DECF", ("FSM function F_DECF executing\n"));
- T309_stop(cd);
- i4b_l3_tx_status(cd, CAUSE_Q850_NORMUNSP); /* 31, normal unspecified */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state except U10 event DL RELEASE IND from L2
- *---------------------------------------------------------------------------*/
-static void F_DLRI(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DLRI", ("FSM function F_DLRI executing\n"));
- i4b_l3_stop_all_timers(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U10 event DL RELEASE IND from L2
- *---------------------------------------------------------------------------*/
-static void F_DLRIA(call_desc_t *cd)
-{
- DBGL3(L3_F_MSG, "F_DLRIA", ("FSM function F_DLRIA executing\n"));
-
- if(cd->T309 == TIMER_IDLE)
- T309_start(cd);
-
- DL_Est_Req(ctrl_desc[cd->controller].unit);
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_l3fsm.h b/sys/i4b/layer3/i4b_l3fsm.h
deleted file mode 100644
index d69b810b45ad1..0000000000000
--- a/sys/i4b/layer3/i4b_l3fsm.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3fsm.c - layer 3 FSM
- * -------------------------
- *
- * $Id: i4b_l3fsm.h,v 1.5 1998/12/05 18:05:33 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:32:45 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L3FSM_H_
-#define _I4B_L3FSM_H_
-
-enum Q931_states {
- ST_U0,
- ST_U1,
- ST_U3,
- ST_U4,
- ST_U6,
- ST_U7,
- ST_U8,
- ST_U9,
- ST_U10,
- ST_U11,
- ST_U12,
- ST_U19,
-
- ST_IWA, /* incoming call, wait establish, then accept */
- ST_IWR, /* incoming call, wait establish, then reject */
- ST_OW, /* outgoing call, wait establish */
- ST_IWL, /* incoming call, wait establish, then alert */
-
- ST_SUSE, /* SUBroutine SETs new state on exit */
- ST_ILL, /* Illegal */
-
- N_STATES /* number of states */
-};
-
-enum Q931_events {
-
- EV_SETUPRQ, /* setup request from L4 */
- EV_DISCRQ, /* disconnect request from L4 */
- EV_RELRQ, /* release request from L4 */
- EV_ALERTRQ, /* alerting request from L4 */
- EV_SETACRS, /* setup response accept from l4 */
- EV_SETRJRS, /* setup response reject from l4 */
- EV_SETDCRS, /* setup response dontcare from l4 */
-
- EV_SETUP, /* incoming SETUP message from L2 */
- EV_STATUS, /* incoming STATUS message from L2 */
- EV_RELEASE, /* incoming RELEASE message from L2 */
- EV_RELCOMP, /* incoming RELEASE COMPLETE from L2 */
- EV_SETUPAK, /* incoming SETUP ACK message from L2 */
- EV_CALLPRC, /* incoming CALL PROCEEDING from L2 */
- EV_ALERT, /* incoming ALERT message from L2 */
- EV_CONNECT, /* incoming CONNECT message from L2 */
- EV_PROGIND, /* incoming Progress IND from L2 */
- EV_DISCONN, /* incoming DISCONNECT message from L2 */
- EV_CONACK, /* incoming CONNECT ACK message from L2 */
- EV_STATENQ, /* incoming STATUS ENQ message from L2 */
- EV_INFO, /* incoming INFO message from L2 */
- EV_FACILITY, /* FACILITY message */
-
- EV_T303EXP, /* Timer T303 expired */
- EV_T305EXP, /* Timer T305 expired */
- EV_T308EXP, /* Timer T308 expired */
- EV_T309EXP, /* Timer T309 expired */
- EV_T310EXP, /* Timer T310 expired */
- EV_T313EXP, /* Timer T313 expired */
-
- EV_DLESTIN, /* dl establish indication from l2 */
- EV_DLRELIN, /* dl release indication from l2 */
- EV_DLESTCF, /* dl establish confirm from l2 */
- EV_DLRELCF, /* dl release indication from l2 */
-
- EV_ILL, /* Illegal */
- N_EVENTS
-};
-
-#endif /* _I4B_L3FSM_H_ */
diff --git a/sys/i4b/layer3/i4b_l3timer.c b/sys/i4b/layer3/i4b_l3timer.c
deleted file mode 100644
index 6c1a2d30122b3..0000000000000
--- a/sys/i4b/layer3/i4b_l3timer.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l3timer.c - timer and timeout handling for layer 3
- * ------------------------------------------------------
- *
- * $Id: i4b_l3timer.c,v 1.9 1998/12/05 18:05:35 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:00 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-/*---------------------------------------------------------------------------*
- * stop all layer 3 timers
- *---------------------------------------------------------------------------*/
-void i4b_l3_stop_all_timers(call_desc_t *cd)
-{
- T303_stop(cd);
- T305_stop(cd);
- T308_stop(cd);
- T309_stop(cd);
- T310_stop(cd);
- T313_stop(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T303_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T303_timeout", ("SETUP not answered, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T303EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 start
- *---------------------------------------------------------------------------*/
-void
-T303_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T303_start", ("cr = %d\n", cd->cr));
- cd->T303 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T303_callout = timeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, T303VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, T303VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 stop
- *---------------------------------------------------------------------------*/
-void
-T303_stop(call_desc_t *cd)
-{
- if(cd->T303 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd, cd->T303_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T303_timeout, (void *)cd);
-#endif
- cd->T303 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T303_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T305_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T305_timeout", ("DISC not answered, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T305EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 start
- *---------------------------------------------------------------------------*/
-void
-T305_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T305_start", ("cr = %d\n", cd->cr));
- cd->T305 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T305_callout = timeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, T305VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, T305VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 stop
- *---------------------------------------------------------------------------*/
-void
-T305_stop(call_desc_t *cd)
-{
- if(cd->T305 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd, cd->T305_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T305_timeout, (void *)cd);
-#endif
- cd->T305 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T305_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T308_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T308_timeout", ("REL not answered, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T308EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 start
- *---------------------------------------------------------------------------*/
-void
-T308_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T308_start", ("cr = %d\n", cd->cr));
- cd->T308 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T308_callout = timeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, T308VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, T308VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 stop
- *---------------------------------------------------------------------------*/
-void
-T308_stop(call_desc_t *cd)
-{
- if(cd->T308 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd, cd->T308_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T308_timeout, (void *)cd);
-#endif
- cd->T308 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T308_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T309_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T309_timeout", ("datalink not reconnected, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T309EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 start
- *---------------------------------------------------------------------------*/
-void
-T309_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T309_start", ("cr = %d\n", cd->cr));
- cd->T309 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T309_callout = timeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, T309VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, T309VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 stop
- *---------------------------------------------------------------------------*/
-void
-T309_stop(call_desc_t *cd)
-{
- if(cd->T309 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd, cd->T309_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T309_timeout, (void *)cd);
-#endif
- cd->T309 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T309_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T310_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T310_timeout", ("CALL PROC timeout, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T310EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 start
- *---------------------------------------------------------------------------*/
-void
-T310_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T310_start", ("cr = %d\n", cd->cr));
- cd->T310 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T310_callout = timeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, T310VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, T310VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 stop
- *---------------------------------------------------------------------------*/
-void
-T310_stop(call_desc_t *cd)
-{
- if(cd->T310 != TIMER_IDLE)
- {
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd, cd->T310_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T310_timeout, (void *)cd);
-#endif
- cd->T310 = TIMER_IDLE;
- }
- DBGL3(L3_T_MSG, "T310_stop", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T313_timeout(call_desc_t *cd)
-{
- DBGL3(L3_T_ERR, "T313_timeout", ("CONN ACK not received, cr = %d\n", cd->cr));
- next_l3state(cd, EV_T313EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 start
- *---------------------------------------------------------------------------*/
-void
-T313_start(call_desc_t *cd)
-{
- DBGL3(L3_T_MSG, "T313_start", ("cr = %d\n", cd->cr));
- cd->T313 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T313_callout = timeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, T313VAL);
-#else
- timeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, T313VAL);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 stop
- *---------------------------------------------------------------------------*/
-void
-T313_stop(call_desc_t *cd)
-{
- if(cd->T313 != TIMER_IDLE)
- {
- cd->T313 = TIMER_IDLE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd, cd->T313_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T313_timeout, (void *)cd);
-#endif
- }
- DBGL3(L3_T_MSG, "T313_stop", ("cr = %d\n", cd->cr));
-}
-
-#endif /* NI4BQ931 > 0 */
-
diff --git a/sys/i4b/layer3/i4b_l4if.c b/sys/i4b/layer3/i4b_l4if.c
deleted file mode 100644
index 55d9bb9da4455..0000000000000
--- a/sys/i4b/layer3/i4b_l4if.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4if.c - Layer 3 interface to Layer 4
- * -------------------------------------------
- *
- * $Id: i4b_l4if.c,v 1.17 1998/12/05 18:05:36 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:16 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-extern void isic_settrace(int unit, int val); /*XXX*/
-extern int isic_gettrace(int unit); /*XXX*/
-
-static void n_connect_request(u_int cdid);
-static void n_connect_response(u_int cdid, int response, int cause);
-static void n_disconnect_request(u_int cdid, int cause);
-static void n_alert_request(u_int cdid);
-static void n_mgmt_command(int unit, int cmd, int parm);
-
-/*---------------------------------------------------------------------------*
- * i4b_mdl_status_ind - status indication from lower layers
- *---------------------------------------------------------------------------*/
-int
-i4b_mdl_status_ind(int unit, int status, int parm)
-{
- int sendup;
- int i;
-
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("unit = %d, status = %d, parm = %d\n", unit, status, parm));
-
- switch(status)
- {
- case STI_ATTACH:
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_ATTACH: attaching unit %d to controller %d\n", unit, nctrl));
-
- /* init function pointers */
-
- ctrl_desc[nctrl].N_CONNECT_REQUEST = n_connect_request;
- ctrl_desc[nctrl].N_CONNECT_RESPONSE = n_connect_response;
- ctrl_desc[nctrl].N_DISCONNECT_REQUEST = n_disconnect_request;
- ctrl_desc[nctrl].N_ALERT_REQUEST = n_alert_request;
- ctrl_desc[nctrl].N_SET_TRACE = isic_settrace;
- ctrl_desc[nctrl].N_GET_TRACE = isic_gettrace;
- ctrl_desc[nctrl].N_DOWNLOAD = NULL; /* only used by active cards */
- ctrl_desc[nctrl].N_DIAGNOSTICS = NULL; /* only used by active cards */
- ctrl_desc[nctrl].N_MGMT_COMMAND = n_mgmt_command;
-
- /* init type and unit */
-
- ctrl_desc[nctrl].unit = unit;
- ctrl_desc[nctrl].ctrl_type = CTRL_PASSIVE;
- ctrl_desc[nctrl].card_type = parm;
-
- /* state fields */
-
- ctrl_desc[nctrl].dl_est = DL_DOWN;
- ctrl_desc[nctrl].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[nctrl].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[nctrl].tei = -1;
-
- /* init unit to controller table */
-
- utoc_tab[unit] = nctrl;
-
- /* increment no. of controllers */
-
- nctrl++;
-
- break;
-
- case STI_L1STAT:
- i4b_l4_l12stat(unit, 1, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_L1STAT: unit %d layer 1 = %s\n", unit, status ? "up" : "down"));
- break;
-
- case STI_L2STAT:
- i4b_l4_l12stat(unit, 2, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_L2STAT: unit %d layer 2 = %s\n", unit, status ? "up" : "down"));
- break;
-
- case STI_TEIASG:
- ctrl_desc[unit].tei = parm;
- i4b_l4_teiasg(unit, parm);
- DBGL3(L3_MSG, "i4b_mdl_status_ind", ("STI_TEIASG: unit %d TEI = %d = 0x%02x\n", unit, parm, parm));
- break;
-
- case STI_PDEACT: /* L1 T4 timeout */
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("STI_PDEACT: unit %d TEI = %d = 0x%02x\n", unit, parm, parm));
-
- sendup = 0;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- if(call_desc[i].cdid != CDID_UNUSED)
- sendup++;
- }
- }
-
- ctrl_desc[utoc_tab[unit]].dl_est = DL_DOWN;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
-
- if(sendup)
- i4b_l4_pdeact(unit, sendup);
- break;
-
- case STI_NOL1ACC: /* no outgoing access to S0 */
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("STI_NOL1ACC: unit %d no outgoing access to S0\n", unit));
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- if(call_desc[i].cdid != CDID_UNUSED)
- {
- SET_CAUSE_TYPE(call_desc[i].cause_in, CAUSET_I4B);
- SET_CAUSE_VAL(call_desc[i].cause_in, CAUSE_I4B_L1ERROR);
- i4b_l4_disconnect_ind(&(call_desc[i]));
- }
- }
- }
-
- ctrl_desc[utoc_tab[unit]].dl_est = DL_DOWN;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
- break;
-
- default:
- DBGL3(L3_ERR, "i4b_mdl_status_ind", ("ERROR, unit %d, unknown status value %d!\n", unit, status));
- break;
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * send command to the lower layers
- *---------------------------------------------------------------------------*/
-static void
-n_mgmt_command(int unit, int cmd, int parm)
-{
- int i;
-
- switch(cmd)
- {
- case CMR_DOPEN:
- DBGL3(L3_MSG, "n_mgmt_command", ("CMR_DOPEN for unit %d\n", unit));
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit))
- {
- call_desc[i].cdid = CDID_UNUSED;
- }
- }
-
- ctrl_desc[utoc_tab[unit]].dl_est = DL_DOWN;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B1] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].bch_state[CHAN_B2] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
- break;
-
- case CMR_DCLOSE:
- DBGL3(L3_MSG, "n_mgmt_command", ("CMR_DCLOSE for unit %d\n", unit));
- break;
-
- default:
- break;
-
- }
-
- MDL_Command_Req(unit, cmd, parm);
-
-}
-
-/*---------------------------------------------------------------------------*
- * handle connect request message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_connect_request(u_int cdid)
-{
- call_desc_t *cd;
-
- cd = cd_by_cdid(cdid);
-
- next_l3state(cd, EV_SETUPRQ);
-}
-
-/*---------------------------------------------------------------------------*
- * handle setup response message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_connect_response(u_int cdid, int response, int cause)
-{
- call_desc_t *cd;
- int chstate;
-
- cd = cd_by_cdid(cdid);
-
- T400_stop(cd);
-
- cd->response = response;
- cd->cause_out = cause;
-
- switch(response)
- {
- case SETUP_RESP_ACCEPT:
- next_l3state(cd, EV_SETACRS);
- chstate = BCH_ST_USED;
- break;
-
- case SETUP_RESP_REJECT:
- next_l3state(cd, EV_SETRJRS);
- chstate = BCH_ST_FREE;
- break;
-
- case SETUP_RESP_DNTCRE:
- next_l3state(cd, EV_SETDCRS);
- chstate = BCH_ST_FREE;
- break;
-
- default: /* failsafe */
- next_l3state(cd, EV_SETDCRS);
- chstate = BCH_ST_FREE;
- DBGL3(L3_ERR, "n_connect_response", ("unknown response, doing SETUP_RESP_DNTCRE"));
- break;
- }
-
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = chstate;
- }
- else
- {
- DBGL3(L3_ERR, "n_connect_response", ("ERROR, invalid channel %d\n", cd->channelid));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle disconnect request message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_disconnect_request(u_int cdid, int cause)
-{
- call_desc_t *cd;
-
- cd = cd_by_cdid(cdid);
-
- cd->cause_out = cause;
-
- next_l3state(cd, EV_DISCRQ);
-}
-
-/*---------------------------------------------------------------------------*
- * handle alert request message from userland
- *---------------------------------------------------------------------------*/
-static void
-n_alert_request(u_int cdid)
-{
- call_desc_t *cd;
-
- cd = cd_by_cdid(cdid);
-
- next_l3state(cd, EV_ALERTRQ);
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_q931.c b/sys/i4b/layer3/i4b_q931.c
deleted file mode 100644
index 6c111d1012284..0000000000000
--- a/sys/i4b/layer3/i4b_q931.c
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q931.c - Q931 received messages handling
- * --------------------------------------------
- *
- * $Id: i4b_q931.c,v 1.18 1998/12/05 18:05:38 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:36 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#ifndef __FreeBSD__
-#define memcpy(d,s,l) bcopy(s,d,l)
-#endif
-
-unsigned int i4b_l3_debug = L3_DEBUG_DEFAULT;
-
-call_desc_t call_desc[N_CALL_DESC]; /* call descriptor array */
-ctrl_desc_t ctrl_desc[MAX_CONTROLLERS]; /* controller description array */
-int utoc_tab[MAX_CONTROLLERS]; /* unit to controller conversion */
-
-/* protocol independent causes -> Q.931 causes */
-
-unsigned char cause_tab_q931[CAUSE_I4B_MAX] = {
- CAUSE_Q850_NCCLR, /* CAUSE_I4B_NORMAL -> normal call clearing */
- CAUSE_Q850_USRBSY, /* CAUSE_I4B_BUSY -> user busy */
- CAUSE_Q850_NOCAVAIL, /* CAUSE_I4B_NOCHAN -> no circuit/channel available*/
- CAUSE_Q850_INCDEST, /* CAUSE_I4B_INCOMP -> incompatible destination */
- CAUSE_Q850_CALLREJ, /* CAUSE_I4B_REJECT -> call rejected */
- CAUSE_Q850_DSTOOORDR, /* CAUSE_I4B_OOO -> destination out of order */
- CAUSE_Q850_TMPFAIL, /* CAUSE_I4B_TMPFAIL -> temporary failure */
-};
-
-/*---------------------------------------------------------------------------*
- * setup cr ref flag according to direction
- *---------------------------------------------------------------------------*/
-unsigned char
-setup_cr(call_desc_t *cd, unsigned char cr)
-{
- if(cd->crflag == CRF_ORIG)
- return(cr & 0x7f); /* clear cr ref flag */
- else if(cd->crflag == CRF_DEST)
- return(cr | 0x80); /* set cr ref flag */
- else
- panic("setup_cr: invalid crflag!\n");
-}
-
-/*---------------------------------------------------------------------------*
- * decode and process a Q.931 message
- *---------------------------------------------------------------------------*/
-void
-i4b_decode_q931(int unit, int msg_len, u_char *msg_ptr)
-{
- call_desc_t *cd;
- int codeset = CODESET_0;
- int old_codeset = CODESET_0;
- int shift_flag = UNSHIFTED;
- int crlen = 0;
- int crval = 0;
- int crflag = 0;
- int i;
- int offset;
- int s;
-
- /* check protocol discriminator */
-
- if(*msg_ptr != PD_Q931)
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("protocol discriminator 0x%x != Q.931\n", *msg_ptr));
- return;
- }
- msg_ptr++;
- msg_len--;
-
- s = SPLI4B(); /* this has to be protected ! */
-
- /* extract call reference */
-
- crlen = *msg_ptr & CRLENGTH_MASK;
- msg_ptr++;
- msg_len--;
-
- if(crlen != 0)
- {
- crval += *msg_ptr & 0x7f;
- crflag = (*msg_ptr >> 7) & 0x01;
- msg_ptr++;
- msg_len--;
-
- for(i=1; i < crlen; i++)
- {
- crval += *msg_ptr;
- msg_ptr++;
- msg_len--;
- }
- }
- else
- {
- crval = 0;
- crflag = 0;
- }
-
- DBGL3(L3_P_MSG, "i4b_decode_q931", ("Call Ref, len %d, val %d, flag %d\n", crlen, crval, crflag));
-
- /* find or allocate calldescriptor */
-
- if((cd = cd_by_unitcr(unit, crval,
- crflag == CRF_DEST ? CRF_ORIG : CRF_DEST)) == NULL)
- {
- if(*msg_ptr == SETUP)
- {
- /* get and init new calldescriptor */
-
- cd = reserve_cd(); /* cdid filled in */
- cd->controller = utoc_tab[unit];
- cd->cr = crval;
- cd->crflag = CRF_DEST; /* we are the dest side */
- cd->ilt = NULL; /* reset link tab ptrs */
- cd->dlt = NULL;
- }
- else
- {
-/*XXX*/ if(crval != 0) /* ignore global call references */
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("cannot find calldescriptor for cr = 0x%x, crflag = 0x%x, msg = 0x%x, frame = ", crval, crflag, *msg_ptr));
- i4b_print_frame(msg_len, msg_ptr);
- }
- splx(s);
- return;
- }
- }
-
- splx(s);
-
- /* decode and handle message type */
-
- i4b_decode_q931_message(unit, cd, *msg_ptr);
- msg_ptr++;
- msg_len--;
-
- /* process information elements */
-
- while(msg_len > 0)
- {
- /* check for shift codeset IE */
-
- if((*msg_ptr & 0x80) && ((*msg_ptr & 0xf0) == SOIE_SHIFT))
- {
- if(!(*msg_ptr & SHIFT_LOCK))
- shift_flag = SHIFTED;
-
- old_codeset = codeset;
- codeset = *msg_ptr & CODESET_MASK;
-
- if((shift_flag != SHIFTED) &&
- (codeset <= old_codeset))
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("Q.931 lockingshift proc violation, shift %d -> %d\n", old_codeset, codeset));
- codeset = old_codeset;
- }
- msg_len--;
- msg_ptr++;
- }
-
- /* process one IE for selected codeset */
-
- switch(codeset)
- {
- case CODESET_0:
- offset = i4b_decode_q931_cs0_ie(unit, cd, msg_len, msg_ptr);
- msg_len -= offset;
- msg_ptr += offset;
- break;
-
- default:
- DBGL3(L3_P_ERR, "i4b_decode_q931", ("unknown codeset %d, ", codeset));
- i4b_print_frame(msg_len, msg_ptr);
- msg_len = 0;
- break;
- }
-
- /* check for non-locking shifts */
-
- if(shift_flag == SHIFTED)
- {
- shift_flag = UNSHIFTED;
- codeset = old_codeset;
- }
- }
- next_l3state(cd, cd->event);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and process one Q.931 codeset 0 information element
- *---------------------------------------------------------------------------*/
-int
-i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
-{
- int i, j;
- char *p;
-
- switch(*msg_ptr)
- {
- /* single byte IE's */
-
- case IEI_SENDCOMPL:
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_SENDCOMPL\n"));
- return(1);
- break;
-
- /* multi byte IE's */
-
- case IEI_BEARERCAP: /* bearer capability */
- switch(msg_ptr[2])
- {
- case 0x80: /* speech */
- case 0x89: /* restricted digital info */
- case 0x90: /* 3.1KHz audio */
-/* XXX */ cd->bprot = BPROT_NONE;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - Telephony\n"));
- break;
-
- case 0x88: /* unrestricted digital info */
-/* XXX */ cd->bprot = BPROT_RHDLC;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - Raw HDLC\n"));
- break;
-
- default:
-/* XXX */ cd->bprot = BPROT_NONE;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_BEARERCAP - No Protocol\n"));
- break;
- }
- break;
-
- case IEI_CAUSE: /* cause */
- if(msg_ptr[2] & 0x80)
- {
- cd->cause_in = msg_ptr[3] & 0x7f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CAUSE = %d\n", msg_ptr[3] & 0x7f));
- }
- else
- {
- cd->cause_in = msg_ptr[4] & 0x7f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CAUSE = %d\n", msg_ptr[4] & 0x7f));
- }
- break;
-
- case IEI_CHANNELID: /* channel id */
- if((msg_ptr[2] & 0xf4) != 0x80)
- {
- cd->channelid = CHAN_NO;
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("IEI_CHANNELID, unsupported value 0x%x\n", msg_ptr[2]));
- }
- else
- {
- switch(msg_ptr[2] & 0x03)
- {
- case IE_CHAN_ID_NO:
- cd->channelid = CHAN_NO;
- break;
- case IE_CHAN_ID_B1:
- cd->channelid = CHAN_B1;
- break;
- case IE_CHAN_ID_B2:
- cd->channelid = CHAN_B2;
- break;
- case IE_CHAN_ID_ANY:
- cd->channelid = CHAN_ANY;
- break;
- }
- cd->channelexcl = (msg_ptr[2] & 0x08) >> 3;
-
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CHANNELID - channel %d, exclusive = %d\n", cd->channelid, cd->channelexcl));
-
- /* if this is a setup message, reserve channel */
-
- if(cd->event == EV_SETUP)
- {
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- if(ctrl_desc[cd->controller].bch_state[cd->channelid] == BCH_ST_FREE)
- ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_RSVD;
- else
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("IE ChannelID, Channel NOT free!!\n"));
- }
- else if(cd->channelid == CHAN_NO)
- {
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IE ChannelID, SETUP with channel = No channel (CW)\n"));
- }
- else /* cd->channelid == CHAN_ANY */
- {
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("ERROR: IE ChannelID, SETUP with channel = Any channel!\n"));
- }
- }
- }
- break;
-
- case IEI_CALLINGPN: /* calling party no */
- if(msg_ptr[2] & 0x80) /* no presentation/screening indicator ? */
- {
- memcpy(cd->src_telno, &msg_ptr[3], min(TELNO_MAX, msg_ptr[1]-1));
- cd->src_telno[min(TELNO_MAX, msg_ptr[1] - 1)] = '\0';
- cd->scr_ind = SCR_NONE;
- }
- else
- {
- memcpy(cd->src_telno, &msg_ptr[4], min(TELNO_MAX, msg_ptr[1]-2));
- cd->src_telno[min(TELNO_MAX, msg_ptr[1] - 2)] = '\0';
- cd->scr_ind = (msg_ptr[3] & 0x03) + SCR_USR_NOSC;
- }
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLINGPN = %s\n", cd->src_telno));
- break;
-
- case IEI_CALLEDPN: /* called party number */
- memcpy(cd->dst_telno, &msg_ptr[3], min(TELNO_MAX, msg_ptr[1]-1));
- cd->dst_telno[min(TELNO_MAX, msg_ptr [1] - 1)] = '\0';
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLED = %s\n", cd->dst_telno));
- break;
-
- case IEI_CALLSTATE: /* call state */
- cd->call_state = msg_ptr[2] & 0x3f;
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CALLSTATE = %d\n", cd->call_state));
- break;
-
- case IEI_PROGRESSI: /* progress indicator */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_PROGRESSINDICATOR\n"));
- break;
-
- case IEI_DISPLAY: /* display */
- /* CHANGED BY <chris@medis.de> */
- memcpy(cd->display, &msg_ptr[2], min(DISPLAY_MAX, msg_ptr[1]));
- cd->display[min(DISPLAY_MAX, msg_ptr[1])] = '\0';
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_DISPLAY = %s\n", cd->display));
- break;
-
- case IEI_DATETIME: /* date/time */
- i = 2;
- j = msg_ptr[1];
- p = &(cd->datetime[0]);
- *p = '\0';
-
- for(j = msg_ptr[1]; j > 0; j--, i++)
- sprintf(p+strlen(p), "%02d", msg_ptr[i]);
-
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_DATETIME = %s\n", cd->datetime));
- break;
-
- case IEI_FACILITY: /* facility */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_FACILITY\n"));
- if(i4b_aoc(msg_ptr, cd) > -1)
- i4b_l4_charging_ind(cd);
- break;
-
- case IEI_CONCTDNO: /* connected number */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_CONCTDNO\n"));
- break;
-
- case IEI_NETSPCFAC: /* network specific fac */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_NETSPCFAC\n"));
- break;
-
- case IEI_LLCOMPAT: /* low layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_LLCOMPAT\n"));
- break;
-
- case IEI_HLCOMPAT: /* high layer compat */
- DBGL3(L3_P_MSG, "i4b_decode_q931_codeset0", ("IEI_HLCOMPAT\n"));
- break;
-
- default:
- DBGL3(L3_P_ERR, "i4b_decode_q931_codeset0", ("Unknown IE %d - ", *msg_ptr));
- i4b_print_frame(msg_ptr[1]+2, msg_ptr);
- break;
- }
- return(msg_ptr[1] + 2);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and process one Q.931 codeset 0 information element
- *---------------------------------------------------------------------------*/
-void
-i4b_decode_q931_message(int unit, call_desc_t *cd, u_char message_type)
-{
- cd->event = EV_ILL;
-
- switch(message_type)
- {
- /* call establishment */
-
- case ALERT:
- cd->event = EV_ALERT;
- DBGL3(L3_PRIM, "rx ALERT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case CALL_PROCEEDING:
- cd->event = EV_CALLPRC;
- DBGL3(L3_PRIM, "rx CALL-PROC", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case PROGRESS:
- cd->event = EV_PROGIND;
- DBGL3(L3_PRIM, "rx PROGRESS", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SETUP:
- DBGL3(L3_PRIM, "rx SETUP", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->bprot = BPROT_NONE;
- cd->cause_in = 0;
- cd->cause_out = 0;
- cd->dst_telno[0] = '\0';
- cd->src_telno[0] = '\0';
- cd->channelid = CHAN_NO;
- cd->channelexcl = 0;
- cd->display[0] = '\0';
- cd->datetime[0] = '\0';
- cd->event = EV_SETUP;
- break;
-
- case CONNECT:
- DBGL3(L3_PRIM, "rx CONNECT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->datetime[0] = '\0';
- cd->event = EV_CONNECT;
- break;
-
- case SETUP_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx SETUP-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_SETUPAK;
- break;
-
- case CONNECT_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx CONNECT-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_CONACK;
- break;
-
- /* call information */
-
- case USER_INFORMATION:
- DBGL3(L3_PRIM, "rx USER-INFO", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SUSPEND_REJECT:
- DBGL3(L3_PRIM, "rx SUSPEND-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RESUME_REJECT:
- DBGL3(L3_PRIM, "rx RESUME-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case HOLD:
- DBGL3(L3_PRIM, "rx HOLD", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SUSPEND:
- DBGL3(L3_PRIM, "rx SUSPEND", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RESUME:
- DBGL3(L3_PRIM, "rx RESUME", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case HOLD_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx HOLD-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case SUSPEND_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx SUSPEND-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RESUME_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RESUME-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case HOLD_REJECT:
- DBGL3(L3_PRIM, "rx HOLD-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RETRIEVE:
- DBGL3(L3_PRIM, "rx RETRIEVE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RETRIEVE_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RETRIEVE-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RETRIEVE_REJECT:
- DBGL3(L3_PRIM, "rx RETRIEVE-REJ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- /* call clearing */
-
- case DISCONNECT:
- DBGL3(L3_PRIM, "rx DISCONNECT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_DISCONN;
- break;
-
- case RESTART:
- DBGL3(L3_PRIM, "rx RESTART", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RELEASE:
- DBGL3(L3_PRIM, "rx RELEASE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_RELEASE;
- break;
-
- case RESTART_ACKNOWLEDGE:
- DBGL3(L3_PRIM, "rx RESTART-ACK", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case RELEASE_COMPLETE:
- DBGL3(L3_PRIM, "rx RELEASE-COMPLETE", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_RELCOMP;
- break;
-
- /* misc messages */
-
- case SEGMENT:
- DBGL3(L3_PRIM, "rx SEGMENT", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case FACILITY:
- DBGL3(L3_PRIM, "rx FACILITY", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_FACILITY;
- break;
-
- case REGISTER:
- DBGL3(L3_PRIM, "rx REGISTER", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case NOTIFY:
- DBGL3(L3_PRIM, "rx NOTIFY", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case STATUS_ENQUIRY:
- DBGL3(L3_PRIM, "rx STATUS-ENQ", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_STATENQ;
- break;
-
- case CONGESTION_CONTROL:
- DBGL3(L3_PRIM, "rx CONGESTION-CONTROL", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- break;
-
- case INFORMATION:
- DBGL3(L3_PRIM, "rx INFORMATION", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_INFO;
- break;
-
- case STATUS:
- DBGL3(L3_PRIM, "rx STATUS", ("unit %d, cr = 0x%02x\n", unit, cd->cr));
- cd->event = EV_STATUS;
- break;
-
- default:
- DBGL3(L3_P_ERR, "rx UNKNOWN msg", ("unit %d, cr = 0x%02x, msg = 0x%02x\n", unit, cd->cr, message_type));
- break;
- }
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_q931.h b/sys/i4b/layer3/i4b_q931.h
deleted file mode 100644
index cb916b045fd0a..0000000000000
--- a/sys/i4b/layer3/i4b_q931.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q931.h - Q931 handling header file
- * --------------------------------------
- *
- * $Id: i4b_q931.h,v 1.5 1998/12/05 18:05:39 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:33:53 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_Q931_H_
-#define _I4B_Q931_H_
-
-/* extension bit */
-
-#define EXT_LAST 0x80 /* last octett */
-
-/* reserve space in mbuf */
-
-#define I_FRAME_HDRLEN 4 /* to be added by layer 2 */
-
-/* SHIFT */
-
-#define CODESET_MASK 0x07
-#define UNSHIFTED 0
-#define SHIFTED 1
-#define CRLENGTH_MASK 0x0f
-
-/* CONNECT */
-
-#define MSG_CONNECT_LEN 4 /* length of a connect message */
-
-/* DISCONNECT */
-
-#define MSG_DISCONNECT_LEN 8 /* length of a disconnect message */
-
-/* RELEASE COMPLETE */
-
-#define MSG_RELEASE_COMPLETE_LEN 8 /* length of release complete msg */
-
-/* for outgoing causes */
-
-#define CAUSE_LEN 2
-#define CAUSE_STD_LOC_OUT 0x80 /* std = CCITT, loc = user */
-
-/* SETUP */
-
-#define MSG_SETUP_LEN 18 /* without number strings ! */
-
-#define IEI_BEARERCAP_LEN 2 /* 2 octetts lenght */
-
-#define IT_CAP_SPEECH 0x80 /* BC: information xfer capability */
-#define IT_CAP_UNR_DIG_INFO 0x88 /* BC: information xfer capability */
-
-#define IT_RATE_64K 0x90 /* BC: information xfer rate */
-#define IT_UL1_G711A 0xa3 /* layer1 proto G.711 A-law */
-
-#define IEI_CHANNELID_LEN 0x01 /* length of channel id */
-#define CHANNELID_B1 0x81 /* channel = B1 (outgoing) */
-#define CHANNELID_B2 0x82 /* channel = B2 (outgoing) */
-#define CHANNELID_ANY 0x83 /* channel = any channel (outgoing) */
-
-#define IE_CHAN_ID_NO 0x00 /* no channel (incoming) */
-#define IE_CHAN_ID_B1 0x01 /* B1 channel (incoming) */
-#define IE_CHAN_ID_B2 0x02 /* B2 channel (incoming) */
-#define IE_CHAN_ID_ANY 0x03 /* ANY channel (incoming) */
-
-#define NUMBER_TYPEPLAN 0x81 /* type of number/numbering plan */
-
-#define IEI_CALLINGPN_LEN 1 /* without number string ! */
-
-#define IEI_CALLEDPN_LEN 1 /* without number string ! */
-
-/* CONNECT_ACK */
-
-#define MSG_CONNECT_ACK_LEN 4 /* length of a connect ack message */
-
-/* STATUS */
-
-#define MSG_STATUS_LEN 11
-#define CALLSTATE_LEN 1
-
-/* RELEASE */
-
-#define MSG_RELEASE_LEN 8 /* length of release msg */
-
-/* ALERT */
-
-#define MSG_ALERT_LEN 4 /* length of a alert message */
-
-#endif /* _I4B_Q931_H_ */
diff --git a/sys/i4b/layer3/i4b_q932fac.c b/sys/i4b/layer3/i4b_q932fac.c
deleted file mode 100644
index 487ce004c144c..0000000000000
--- a/sys/i4b/layer3/i4b_q932fac.c
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q932fac.c - Q932 facility handling
- * --------------------------------------
- *
- * $Id: i4b_q932fac.c,v 1.5 1998/12/05 18:05:41 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:34:11 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include "i4bq931.h"
-#else
-#define NI4BQ931 1
-#endif
-#if NI4BQ931 > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.h>
-#include <i4b/layer3/i4b_q931.h>
-#include <i4b/layer3/i4b_q932fac.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-static int do_component(int length);
-static void next_state(int class, int form, int code, int val);
-
-static int byte_len;
-static unsigned char *byte_buf;
-static int state;
-
-static int units;
-static int operation_value;
-
-/*---------------------------------------------------------------------------*
- * decode Q.931/Q.932 facility info element
- *---------------------------------------------------------------------------*/
-int
-i4b_aoc(unsigned char *buf, call_desc_t *cd)
-{
- int len;
-
- cd->units_type = CHARGE_INVALID;
- cd->units = -1;
-
- buf++; /* length */
-
- len = *buf;
-
- buf++; /* protocol profile */
-
- switch(*buf & 0x1f)
- {
- case FAC_PROTO_ROP:
- break;
-
- case FAC_PROTO_CMIP:
- DBGL3(L3_A_MSG, "i4b_facility", ("CMIP Protocol (Q.941), UNSUPPORTED\n"));
- return(-1);
- break;
-
- case FAC_PROTO_ACSE:
- DBGL3(L3_A_MSG, "i4b_facility", ("ACSE Protocol (X.217/X.227), UNSUPPORTED!\n"));
- return(-1);
- break;
-
- default:
- DBGL3(L3_A_ERR, "i4b_facility", ("Unknown Protocol, UNSUPPORTED!\n"));
- return(-1);
- break;
- }
-
- DBGL3(L3_A_MSG, "i4b_facility", ("Remote Operations Protocol\n"));
-
- /* next byte */
-
- buf++;
- len--;
-
- /* initialize variables for do_component */
-
- byte_len = 0;
- byte_buf = buf;
- state = ST_EXP_COMP_TYP;
-
- /* decode facility */
-
- do_component(len);
-
- switch(operation_value)
- {
- case FAC_OPVAL_AOC_D_CUR:
- cd->units_type = CHARGE_AOCD;
- cd->units = 0;
- return(0);
- break;
-
- case FAC_OPVAL_AOC_D_UNIT:
- cd->units_type = CHARGE_AOCD;
- cd->units = units;
- return(0);
- break;
-
- case FAC_OPVAL_AOC_E_CUR:
- cd->units_type = CHARGE_AOCE;
- cd->units = 0;
- return(0);
- break;
-
- case FAC_OPVAL_AOC_E_UNIT:
- cd->units_type = CHARGE_AOCE;
- cd->units = units;
- return(0);
- break;
-
- default:
- cd->units_type = CHARGE_INVALID;
- cd->units = -1;
- return(-1);
- break;
- }
- return(-1);
-}
-
-/*---------------------------------------------------------------------------*
- * handle a component recursively
- *---------------------------------------------------------------------------*/
-static int
-do_component(int length)
-{
- int comp_tag_class; /* component tag class */
- int comp_tag_form; /* component form: constructor or primitive */
- int comp_tag_code; /* component code depending on class */
- int comp_length = 0; /* component length */
-
-again:
-
- /*----------------------------------------*/
- /* first component element: component tag */
- /*----------------------------------------*/
-
- /* tag class bits */
-
- comp_tag_class = (*byte_buf & 0xc0) >> 6;
-
- switch(comp_tag_class)
- {
- case FAC_TAGCLASS_UNI:
- break;
- case FAC_TAGCLASS_APW:
- break;
- case FAC_TAGCLASS_COS:
- break;
- case FAC_TAGCLASS_PRU:
- break;
- }
-
- /* tag form bit */
-
- comp_tag_form = (*byte_buf & 0x20) > 5;
-
- /* tag code bits */
-
- comp_tag_code = *byte_buf & 0x1f;
-
- if(comp_tag_code == 0x1f)
- {
- comp_tag_code = 0;
-
- byte_buf++;
- byte_len++;
-
- while(*byte_buf & 0x80)
- {
- comp_tag_code += (*byte_buf & 0x7f);
- byte_buf++;
- byte_len++;
- }
- comp_tag_code += (*byte_buf & 0x7f);
- }
- else
- {
- comp_tag_code = (*byte_buf & 0x1f);
- }
-
- byte_buf++;
- byte_len++;
-
- /*--------------------------------------------*/
- /* second component element: component length */
- /*--------------------------------------------*/
-
- comp_length = 0;
-
- if(*byte_buf & 0x80)
- {
- int i = *byte_buf & 0x7f;
-
- byte_len += i;
-
- for(;i > 0;i++)
- {
- byte_buf++;
- comp_length += (*byte_buf * (i*256));
- }
- }
- else
- {
- comp_length = *byte_buf & 0x7f;
- }
-
- next_state(comp_tag_class, comp_tag_form, comp_tag_code, -1);
-
- byte_len++;
- byte_buf++;
-
- /*---------------------------------------------*/
- /* third component element: component contents */
- /*---------------------------------------------*/
-
- if(comp_tag_form) /* == constructor */
- {
- do_component(comp_length);
- }
- else
- {
- int val = 0;
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- switch(comp_tag_code)
- {
- case FAC_CODEUNI_INT:
- case FAC_CODEUNI_ENUM:
- case FAC_CODEUNI_BOOL:
- if(comp_length)
- {
- int i;
-
- for(i = comp_length-1; i >= 0; i--)
- {
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- }
- }
- break;
- default:
- if(comp_length)
- {
- int i;
-
- for(i = comp_length-1; i >= 0; i--)
- {
- byte_buf++;
- byte_len++;
- }
- }
- break;
- }
- }
-
- else /* comp_tag_class != FAC_TAGCLASS_UNI */
- {
- if(comp_length)
- {
- int i;
-
- for(i = comp_length-1; i >= 0; i--)
- {
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- }
- }
- }
- next_state(comp_tag_class, comp_tag_form, comp_tag_code, val);
- }
-
- if(byte_len < length)
- goto again;
-
- return(byte_len);
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component
- *---------------------------------------------------------------------------*/
-static void
-F_1_1(int val)
-{
- if(val == -1)
- {
- state = ST_EXP_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result
- *---------------------------------------------------------------------------*/
-static void
-F_1_2(int val)
-{
- if(val == -1)
- state = ST_EXP_NIX;
-}
-/*---------------------------------------------------------------------------*
- * return error
- *---------------------------------------------------------------------------*/
-static void
-F_1_3(int val)
-{
- if(val == -1)
- state = ST_EXP_NIX;
-}
-/*---------------------------------------------------------------------------*
- * reject
- *---------------------------------------------------------------------------*/
-static void
-F_1_4(int val)
-{
- if(val == -1)
- state = ST_EXP_NIX;
-}
-
-/*---------------------------------------------------------------------------*
- * invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_2(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Invoke ID = %d\n", val));
- state = ST_EXP_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * operation value
- *---------------------------------------------------------------------------*/
-static void
-F_3(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Operation Value = %d\n", val));
-
- operation_value = val;
-
- if((val == FAC_OPVAL_AOC_D_UNIT) || (val == FAC_OPVAL_AOC_E_UNIT))
- {
- units = 0;
- state = ST_EXP_INFO;
- }
- else
- {
- state = ST_EXP_NIX;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * specific charging units
- *---------------------------------------------------------------------------*/
-static void
-F_4(int val)
-{
- if(val == -1)
- state = ST_EXP_RUL;
-}
-
-/*---------------------------------------------------------------------------*
- * free of charge
- *---------------------------------------------------------------------------*/
-static void
-F_4_1(int val)
-{
- if(val == -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Free of Charge\n"));
- /* units = 0; XXXX */
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * charge not available
- *---------------------------------------------------------------------------*/
-static void
-F_4_2(int val)
-{
- if(val == -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Charge not available\n"));
- /* units = -1; XXXXXX ??? */
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * recorded units list
- *---------------------------------------------------------------------------*/
-static void
-F_5(int val)
-{
- if(val == -1)
- state = ST_EXP_RU;
-}
-
-/*---------------------------------------------------------------------------*
- * recorded units
- *---------------------------------------------------------------------------*/
-static void
-F_6(int val)
-{
- if(val == -1)
- state = ST_EXP_RNOU;
-}
-
-/*---------------------------------------------------------------------------*
- * number of units
- *---------------------------------------------------------------------------*/
-static void
-F_7(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Number of Units = %d\n", val));
- units = val;
- state = ST_EXP_TOCI;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * subtotal/total
- *---------------------------------------------------------------------------*/
-static void
-F_8(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Subtotal/Total = %d\n", val));
- /* type_of_charge = val; */
- state = ST_EXP_DBID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * billing_id
- *---------------------------------------------------------------------------*/
-static void
-F_9(int val)
-{
- if(val != -1)
- {
- DBGL3(L3_A_MSG, "i4b_facility", ("Billing ID = %d\n", val));
- /* billing_id = val; */
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static struct statetab {
- int currstate; /* input: current state we are in */
- int form; /* input: current tag form */
- int class; /* input: current tag class */
- int code; /* input: current tag code */
- void (*func)(int); /* output: func to exec */
-} statetab[] = {
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_1_1 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 2, F_1_2 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 3, F_1_3 },
- {ST_EXP_COMP_TYP, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 4, F_1_4 },
- {ST_EXP_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_2 },
- {ST_EXP_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_3 },
- {ST_EXP_INFO, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_4 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_NULL, F_4_1 },
- {ST_EXP_INFO, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 1, F_4_2 },
- {ST_EXP_RUL, FAC_TAGFORM_CON, FAC_TAGCLASS_COS, 1, F_5 },
- {ST_EXP_RU, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SEQ, F_6 },
- {ST_EXP_RNOU, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_7 },
- {ST_EXP_TOCI, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 2, F_8 },
- {ST_EXP_DBID, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 3, F_9 },
- {-1, -1, -1, -1, NULL }
-};
-
-/*---------------------------------------------------------------------------*
- * state decode for do_component
- *---------------------------------------------------------------------------*/
-static void
-next_state(int class, int form, int code, int val)
-{
- int i;
-
- for(i=0; ; i++)
- {
- if((statetab[i].currstate > state) ||
- (statetab[i].currstate == -1))
- {
- break;
- }
-
- if((statetab[i].currstate == state) &&
- (statetab[i].form == form) &&
- (statetab[i].class == class) &&
- (statetab[i].code == code))
- {
- (*statetab[i].func)(val);
- break;
- }
- }
-}
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer3/i4b_q932fac.h b/sys/i4b/layer3/i4b_q932fac.h
deleted file mode 100644
index d7544a86e0202..0000000000000
--- a/sys/i4b/layer3/i4b_q932fac.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_q932fac.h - Q932 facility handling header file
- * --------------------------------------------------
- *
- * $Id: i4b_q932fac.h,v 1.5 1998/12/18 17:17:57 hm Exp $
- *
- * last edit-date: [Fri Dec 18 18:17:23 1998]
- *
- *---------------------------------------------------------------------------
- *
- * - Q.932 (03/93) Generic Procedures for the Control of
- * ISDN Supplementaty Services
- * - Q.950 (03/93) Supplementary Services Protocols, Structure and
- * General Principles
- * - ETS 300 179 (10/92) Advice Of Charge: charging information during
- * the call (AOC-D) supplementary service Service description
- * - ETS 300 180 (10/92) Advice Of Charge: charging information at the
- * end of call (AOC-E) supplementary service Service description
- * - ETS 300 181 (04/93) Advice Of Charge (AOC) supplementary service
- * Functional capabilities and information flows
- * - ETS 300 182 (04/93) Advice Of Charge (AOC) supplementary service
- * Digital Subscriber Signalling System No. one (DSS1) protocol
- * - X.208 Specification of Abstract Syntax Notation One (ASN.1)
- * - X.209 Specification of Basic Encoding Rules for
- * Abstract Syntax Notation One (ASN.1)
- * - "ASN.1 Abstract Syntax Notation One", Walter Gora, DATACOM-Verlag
- * 1992, 3rd Edition (ISBN 3-89238-062-7) (german !)
- *
- *---------------------------------------------------------------------------*/
-
-/* protocols */
-#define FAC_PROTO_ROP 0x11
-#define FAC_PROTO_CMIP 0x12
-#define FAC_PROTO_ACSE 0x13
-
-/* tag classes */
-#define FAC_TAGCLASS_UNI 0x00
-#define FAC_TAGCLASS_APW 0x01
-#define FAC_TAGCLASS_COS 0x02
-#define FAC_TAGCLASS_PRU 0x03
-
-/* tag forms */
-#define FAC_TAGFORM_PRI 0x00
-#define FAC_TAGFORM_CON 0x01
-
-/* class UNIVERSAL values */
-#define FAC_CODEUNI_BOOL 1
-#define FAC_CODEUNI_INT 2
-#define FAC_CODEUNI_BITS 3
-#define FAC_CODEUNI_OCTS 4
-#define FAC_CODEUNI_NULL 5
-#define FAC_CODEUNI_OBJI 6
-#define FAC_CODEUNI_OBJD 7
-#define FAC_CODEUNI_EXT 8
-#define FAC_CODEUNI_REAL 9
-#define FAC_CODEUNI_ENUM 10
-#define FAC_CODEUNI_R11 11
-#define FAC_CODEUNI_R12 12
-#define FAC_CODEUNI_R13 13
-#define FAC_CODEUNI_R14 14
-#define FAC_CODEUNI_R15 15
-#define FAC_CODEUNI_SEQ 16
-#define FAC_CODEUNI_SET 17
-#define FAC_CODEUNI_NSTR 18
-#define FAC_CODEUNI_PSTR 19
-#define FAC_CODEUNI_TSTR 20
-#define FAC_CODEUNI_VSTR 21
-#define FAC_CODEUNI_ISTR 22
-#define FAC_CODEUNI_UTIME 23
-#define FAC_CODEUNI_GTIME 24
-#define FAC_CODEUNI_GSTR 25
-#define FAC_CODEUNI_VISTR 26
-#define FAC_CODEUNI_GNSTR 27
-
-/* operation values */
-#define FAC_OPVAL_UUS 1
-#define FAC_OPVAL_CUG 2
-#define FAC_OPVAL_MCID 3
-#define FAC_OPVAL_BTPY 4
-#define FAC_OPVAL_ETPY 5
-#define FAC_OPVAL_ECT 6
-
-#define FAC_OPVAL_DIV_ACT 7
-#define FAC_OPVAL_DIV_DEACT 8
-#define FAC_OPVAL_DIV_ACTSN 9
-#define FAC_OPVAL_DIV_DEACTSN 10
-#define FAC_OPVAL_DIV_INTER 11
-#define FAC_OPVAL_DIV_INFO 12
-#define FAC_OPVAL_DIV_CALLDEF 13
-#define FAC_OPVAL_DIV_CALLRER 14
-#define FAC_OPVAL_DIV_LINF2 15
-#define FAC_OPVAL_DIV_INVS 16
-#define FAC_OPVAL_DIV_INTER1 17
-#define FAC_OPVAL_DIV_LINF1 18
-#define FAC_OPVAL_DIV_LINF3 19
-
-#define FAC_OPVAL_ER_CRCO 20
-#define FAC_OPVAL_ER_MGMT 21
-#define FAC_OPVAL_ER_CANC 22
-
-#define FAC_OPVAL_MLPP_QUERY 24
-#define FAC_OPVAL_MLPP_CALLR 25
-#define FAC_OPVAL_MLPP_CALLP 26
-
-#define FAC_OPVAL_AOC_REQ 30
-#define FAC_OPVAL_AOC_S_CUR 31
-#define FAC_OPVAL_AOC_S_SPC 32
-#define FAC_OPVAL_AOC_D_CUR 33
-#define FAC_OPVAL_AOC_D_UNIT 34
-#define FAC_OPVAL_AOC_E_CUR 35
-#define FAC_OPVAL_AOC_E_UNIT 36
-#define FAC_OPVAL_AOC_IDOFCRG 37
-
-#define FAC_OPVAL_CONF_BEG 40
-#define FAC_OPVAL_CONF_ADD 41
-#define FAC_OPVAL_CONF_SPLIT 42
-#define FAC_OPVAL_CONF_DROP 43
-#define FAC_OPVAL_CONF_ISOLATE 44
-#define FAC_OPVAL_CONF_REATT 45
-#define FAC_OPVAL_CONF_PDISC 46
-#define FAC_OPVAL_CONF_FCONF 47
-#define FAC_OPVAL_CONF_END 48
-#define FAC_OPVAL_CONF_IDCFE 49
-
-#define FAC_OPVAL_REVC_REQ 60
-
-enum states {
- ST_EXP_COMP_TYP,
- ST_EXP_INV_ID,
- ST_EXP_OP_VAL,
- ST_EXP_INFO,
- ST_EXP_RUL,
- ST_EXP_RU,
- ST_EXP_RNOU,
- ST_EXP_TOCI,
- ST_EXP_DBID,
-
- ST_EXP_NIX
-};
-
-/* EOF */
-
diff --git a/sys/i4b/layer4/i4b_i4bdrv.c b/sys/i4b/layer4/i4b_i4bdrv.c
deleted file mode 100644
index e48d993496a0b..0000000000000
--- a/sys/i4b/layer4/i4b_i4bdrv.c
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_i4bdrv.c - i4b userland interface driver
- * --------------------------------------------
- *
- * $Id: i4b_i4bdrv.c,v 1.1 1998/12/27 21:46:52 phk Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:02 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-#include "i4bipr.h"
-
-#if NI4B > 1
-#error "only 1 (one) i4b device possible!"
-#endif
-
-#if NI4B > 0
-
-#include <sys/param.h>
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#include <sys/malloc.h>
-#include <sys/uio.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include "opt_devfs.h"
-#endif
-
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#if defined(__FreeBSD__) && (!defined(__FreeBSD_version) || __FreeBSD_version < 300001)
-/* do nothing */
-#else
-#include <sys/poll.h>
-#endif
-
-struct selinfo select_rd_info;
-
-static struct ifqueue i4b_rdqueue;
-static int openflag = 0;
-static int selflag = 0;
-static int readflag = 0;
-#ifdef DEVFS
-static void *devfs_token;
-#endif
-
-#ifndef __FreeBSD__
-#define PDEVSTATIC /* - not static - */
-PDEVSTATIC void i4battach __P((void));
-PDEVSTATIC int i4bopen __P((dev_t dev, int flag, int fmt, struct proc *p));
-PDEVSTATIC int i4bclose __P((dev_t dev, int flag, int fmt, struct proc *p));
-PDEVSTATIC int i4bread __P((dev_t dev, struct uio *uio, int ioflag));
-PDEVSTATIC int i4bioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p));
-PDEVSTATIC int i4bpoll __P((dev_t dev, int events, struct proc *p));
-
-#if defined (__OpenBSD__)
-PDEVSTATIC int i4bselect(dev_t dev, int rw, struct proc *p);
-#endif
-
-#endif
-
-#if BSD > 199306 && defined(__FreeBSD__)
-#define PDEVSTATIC static
-
-PDEVSTATIC d_open_t i4bopen;
-PDEVSTATIC d_close_t i4bclose;
-PDEVSTATIC d_read_t i4bread;
-PDEVSTATIC d_ioctl_t i4bioctl;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-PDEVSTATIC d_poll_t i4bpoll;
-#else
-PDEVSTATIC d_select_t i4bselect;
-#endif
-
-#define CDEV_MAJOR 60
-static struct cdevsw i4b_cdevsw =
- { i4bopen, i4bclose, i4bread, nowrite,
- i4bioctl, nostop, nullreset, nodevtotty,
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- i4bpoll, nommap, NULL, "i4b", NULL, -1 };
-#else
- i4bselect, nommap, NULL, "i4b", NULL, -1 };
-#endif
-
-PDEVSTATIC void i4battach(void *);
-PSEUDO_SET(i4battach, i4b_i4bdrv);
-
-#endif /* __FreeBSD__ */
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC void
-#ifdef __FreeBSD__
-i4battach(void *dummy)
-#else
-i4battach()
-#endif
-{
-#ifndef HACK_NO_PSEUDO_ATTACH_MSG
- printf("i4b: ISDN call control device attached\n");
-#endif
- i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN;
-#ifdef DEVFS
- devfs_token = devfs_add_devswf(&i4b_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "i4b");
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * i4bopen - device driver open routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int x;
-
- if(minor(dev))
- return(ENXIO);
-
- if(openflag)
- return(EBUSY);
-
- x = splimp();
- openflag = 1;
- i4b_l4_daemon_attached();
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bclose - device driver close routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int x = splimp();
- openflag = 0;
- i4b_l4_daemon_detached();
- i4b_Dcleanifq(&i4b_rdqueue);
- splx(x);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bread - device driver read routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bread(dev_t dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int x;
- int error = 0;
-
- if(minor(dev))
- return(ENODEV);
-
- while(IF_QEMPTY(&i4b_rdqueue))
- {
- x = splimp();
- readflag = 1;
- splx(x);
- tsleep((caddr_t) &i4b_rdqueue, (PZERO + 1) | PCATCH, "bird", 0);
- }
-
- x = splimp();
-
- IF_DEQUEUE(&i4b_rdqueue, m);
-
- splx(x);
-
- if(m && m->m_len)
- error = uiomove(m->m_data, m->m_len, uio);
- else
- error = EIO;
-
- if(m)
- i4b_Dfreembuf(m);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-#if defined (__FreeBSD_version) && __FreeBSD_version >= 300003
-i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-#else
-i4bioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
-#endif
-{
- call_desc_t *cd;
- int error = 0;
-
- if(minor(dev))
- return(ENODEV);
-
- switch(cmd)
- {
- /* cdid request, reserve cd and return cdid */
-
- case I4B_CDID_REQ:
- {
- msg_cdid_req_t *mir;
- mir = (msg_cdid_req_t *)data;
- cd = reserve_cd();
- mir->cdid = cd->cdid;
- break;
- }
-
- /* connect request, dial out to remote */
-
- case I4B_CONNECT_REQ:
- {
- msg_connect_req_t *mcr;
- mcr = (msg_connect_req_t *)data; /* setup ptr */
-
- if((cd = cd_by_cdid(mcr->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_CONNECT_REQ ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- cd->controller = mcr->controller; /* fill cd */
- cd->bprot = mcr->bprot;
- cd->driver = mcr->driver;
- cd->driver_unit = mcr->driver_unit;
- cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit);
-
- cd->unitlen_time = mcr->unitlen_time;
- cd->idle_time = mcr->idle_time;
- cd->earlyhup_time = mcr->earlyhup_time;
-
- cd->last_aocd_time = 0;
- if(mcr->unitlen_method == ULEN_METHOD_DYNAMIC)
- cd->aocd_flag = 1;
- else
- cd->aocd_flag = 0;
-
- cd->cunits = 0;
-
- cd->max_idle_time = 0; /* this is outgoing */
-
- cd->dir = DIR_OUTGOING;
-
- DBGL4(L4_TIMO, "i4bioctl", ("I4B_CONNECT_REQ times, unitlen=%ld idle=%ld earlyhup=%ld\n",
- (long)cd->unitlen_time, (long)cd->idle_time, (long)cd->earlyhup_time));
-
- strcpy(cd->dst_telno, mcr->dst_telno);
- strcpy(cd->src_telno, mcr->src_telno);
- cd->display[0] = '\0';
-
- SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NORMAL);
-
- switch(mcr->channel)
- {
- case CHAN_B1:
- case CHAN_B2:
- if(ctrl_desc[mcr->controller].bch_state[mcr->channel] != BCH_ST_FREE)
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
- break;
-
- case CHAN_ANY:
- if((ctrl_desc[mcr->controller].bch_state[CHAN_B1] != BCH_ST_FREE) &&
- (ctrl_desc[mcr->controller].bch_state[CHAN_B2] != BCH_ST_FREE))
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
- break;
-
- default:
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
- break;
- }
-
- cd->channelid = mcr->channel;
-
- cd->isdntxdelay = mcr->txdelay;
-
- /* check whether we have a pointer. Seems like */
- /* this should be adequate. GJ 19.09.97 */
- if(ctrl_desc[cd->controller].N_CONNECT_REQUEST == NULL)
-/*XXX*/ SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
-
- if((GET_CAUSE_VAL(cd->cause_in)) != CAUSE_I4B_NORMAL)
- {
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- }
- else
- {
- (*ctrl_desc[cd->controller].N_CONNECT_REQUEST)(mcr->cdid);
- }
- break;
- }
-
- /* connect response, accept/reject/ignore incoming call */
-
- case I4B_CONNECT_RESP:
- {
- msg_connect_resp_t *mcrsp;
-
- mcrsp = (msg_connect_resp_t *)data;
-
- if((cd = cd_by_cdid(mcrsp->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_CONNECT_RESP ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- T400_stop(cd);
-
- cd->driver = mcrsp->driver;
- cd->driver_unit = mcrsp->driver_unit;
- cd->max_idle_time = mcrsp->max_idle_time;
-
- cd->unitlen_time = 0; /* this is incoming */
- cd->idle_time = 0;
- cd->earlyhup_time = 0;
-
- cd->isdntxdelay = mcrsp->txdelay;
-
- DBGL4(L4_TIMO, "i4bioctl", ("I4B_CONNECT_RESP max_idle_time set to %ld seconds\n", (long)cd->max_idle_time));
-
- (*ctrl_desc[cd->controller].N_CONNECT_RESPONSE)(mcrsp->cdid, mcrsp->response, mcrsp->cause);
- break;
- }
-
- /* disconnect request, actively terminate connection */
-
- case I4B_DISCONNECT_REQ:
- {
- msg_discon_req_t *mdr;
-
- mdr = (msg_discon_req_t *)data;
-
- if((cd = cd_by_cdid(mdr->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_DISCONNECT_REQ ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- /* preset causes with our cause */
- cd->cause_in = cd->cause_out = mdr->cause;
-
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(mdr->cdid, mdr->cause);
- break;
- }
-
- /* controller info request */
-
- case I4B_CTRL_INFO_REQ:
- {
- msg_ctrl_info_req_t *mcir;
-
- mcir = (msg_ctrl_info_req_t *)data;
- mcir->ncontroller = nctrl;
-
- if(mcir->controller > nctrl)
- {
- mcir->ctrl_type = -1;
- mcir->card_type = -1;
- }
- else
- {
- mcir->ctrl_type =
- ctrl_desc[mcir->controller].ctrl_type;
- mcir->card_type =
- ctrl_desc[mcir->controller].card_type;
-
- if(ctrl_desc[mcir->controller].ctrl_type == CTRL_PASSIVE)
- mcir->tei = ctrl_desc[mcir->controller].tei;
- else
- mcir->tei = -1;
- }
- break;
- }
-
- /* dial response */
-
- case I4B_DIALOUT_RESP:
- {
- msg_dialout_resp_t *mdrsp;
-
- mdrsp = (msg_dialout_resp_t *)data;
-
-#if NI4BIPR > 0
- if(mdrsp->driver == BDRV_IPR)
- {
- drvr_link_t *dlt;
- dlt = ipr_ret_linktab(mdrsp->driver_unit);
- (*dlt->dial_response)(mdrsp->driver_unit, mdrsp->stat);
- }
-#endif
- break;
- }
-
- /* update timeout value */
-
- case I4B_TIMEOUT_UPD:
- {
- msg_timeout_upd_t *mtu;
- int x;
-
- mtu = (msg_timeout_upd_t *)data;
-
- if((cd = cd_by_cdid(mtu->cdid)) == NULL)/* get cd */
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_TIMEOUT_UPD ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- x = SPLI4B();
- cd->unitlen_time = mtu->unitlen_time;
- cd->idle_time = mtu->idle_time;
- cd->earlyhup_time = mtu->earlyhup_time;
- splx(x);
- break;
- }
-
- /* soft enable/disable interface */
-
- case I4B_UPDOWN_IND:
- {
- msg_updown_ind_t *mui;
-
- mui = (msg_updown_ind_t *)data;
-
-#if NI4BIPR > 0
- if(mui->driver == BDRV_IPR)
- {
- drvr_link_t *dlt;
- dlt = ipr_ret_linktab(mui->driver_unit);
- (*dlt->updown_ind)(mui->driver_unit, mui->updown);
- }
-#endif
- break;
- }
-
- /* send ALERT request */
-
- case I4B_ALERT_REQ:
- {
- msg_alert_req_t *mar;
-
- mar = (msg_alert_req_t *)data;
-
- if((cd = cd_by_cdid(mar->cdid)) == NULL)
- {
- DBGL4(L4_ERR, "i4bioctl", ("I4B_ALERT_REQ ioctl, cdid not found!\n"));
- error = EINVAL;
- break;
- }
-
- T400_stop(cd);
-
- (*ctrl_desc[cd->controller].N_ALERT_REQUEST)(mar->cdid);
-
- break;
- }
-
- /* version/release number request */
-
- case I4B_VR_REQ:
- {
- msg_vr_req_t *mvr;
-
- mvr = (msg_vr_req_t *)data;
-
- mvr->version = VERSION;
- mvr->release = REL;
- mvr->step = STEP;
- break;
- }
-
- /* Download request */
-
- case I4B_CTRL_DOWNLOAD:
- {
- struct isdn_dr_prot *prots = NULL, *prots2 = NULL;
- struct isdn_download_request *r =
- (struct isdn_download_request*)data;
- int i;
-
- if(!ctrl_desc[r->controller].N_DOWNLOAD)
- {
- error = ENODEV;
- goto download_done;
- }
-
- prots = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
- M_DEVBUF, M_WAITOK);
-
- prots2 = malloc(r->numprotos * sizeof(struct isdn_dr_prot),
- M_DEVBUF, M_WAITOK);
-
- if(!prots || !prots2)
- {
- error = ENOMEM;
- goto download_done;
- }
-
- copyin(r->protocols, prots, r->numprotos * sizeof(struct isdn_dr_prot));
-
- for(i = 0; i < r->numprotos; i++)
- {
- prots2[i].microcode = malloc(prots[i].bytecount, M_DEVBUF, M_WAITOK);
- copyin(prots[i].microcode, prots2[i].microcode, prots[i].bytecount);
- prots2[i].bytecount = prots[i].bytecount;
- }
-
- error = ctrl_desc[r->controller].N_DOWNLOAD(
- ctrl_desc[r->controller].unit,
- r->numprotos, prots2);
-
-download_done:
- if(prots2)
- {
- for(i = 0; i < r->numprotos; i++)
- {
- if(prots2[i].microcode)
- {
- free(prots2[i].microcode, M_DEVBUF);
- }
- }
- free(prots2, M_DEVBUF);
- }
-
- if(prots)
- {
- free(prots, M_DEVBUF);
- }
- break;
- }
-
- /* Diagnostic request */
-
- case I4B_ACTIVE_DIAGNOSTIC:
- {
- struct isdn_diagnostic_request req, *r =
- (struct isdn_diagnostic_request*)data;
-
- req.in_param = req.out_param = NULL;
-
- if(!ctrl_desc[r->controller].N_DIAGNOSTICS)
- {
- error = ENODEV;
- goto diag_done;
- }
-
- memcpy(&req, r, sizeof(req));
-
- if(req.in_param_len)
- {
- req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
-
- if(!req.in_param)
- {
- error = ENOMEM;
- goto diag_done;
- }
- copyin(r->in_param, req.in_param, req.in_param_len);
- }
-
- if(req.out_param_len)
- {
- req.out_param = malloc(r->out_param_len, M_DEVBUF, M_WAITOK);
-
- if(!req.out_param)
- {
- error = ENOMEM;
- goto diag_done;
- }
- }
-
- error = ctrl_desc[r->controller].N_DIAGNOSTICS(r->controller, &req);
-
- if(!error && req.out_param_len)
- copyout(req.out_param, r->out_param, req.out_param_len);
-
-diag_done:
- if(req.in_param)
- free(req.in_param, M_DEVBUF);
-
- if(req.out_param)
- free(req.out_param, M_DEVBUF);
-
- break;
- }
-
- /* default */
-
- default:
- error = ENOTTY;
- break;
- }
-
- return(error);
-}
-
-#if (defined(__FreeBSD__) && \
- (!defined(__FreeBSD_version) || (__FreeBSD_version < 300001))) \
- || defined (__OpenBSD__)
-
-/*---------------------------------------------------------------------------*
- * i4bselect - device driver select routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bselect(dev_t dev, int rw, struct proc *p)
-{
- int x;
-
- if(minor(dev))
- return(ENODEV);
-
- switch(rw)
- {
- case FREAD:
- if(!IF_QEMPTY(&i4b_rdqueue))
- return(1);
- x = splimp();
- selrecord(p, &select_rd_info);
- selflag = 1;
- splx(x);
- return(0);
- break;
-
- case FWRITE:
- return(1);
- break;
- }
- return(0);
-}
-
-#else /* NetBSD and FreeBSD -current */
-
-/*---------------------------------------------------------------------------*
- * i4bpoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-PDEVSTATIC int
-i4bpoll(dev_t dev, int events, struct proc *p)
-{
- int x;
-
- if(minor(dev))
- return(ENODEV);
-
- if((events & POLLIN) || (events & POLLRDNORM))
- {
- if(!IF_QEMPTY(&i4b_rdqueue))
- return(1);
-
- x = splimp();
- selrecord(p, &select_rd_info);
- selflag = 1;
- splx(x);
- return(0);
- }
- else if((events & POLLOUT) || (events & POLLWRNORM))
- {
- return(1);
- }
-
- return(0);
-}
-
-#endif /* defined(__FreeBSD__) && __FreeBSD__ < 3 */
-
-/*---------------------------------------------------------------------------*
- * i4bputqueue - put message into queue to userland
- *---------------------------------------------------------------------------*/
-void
-i4bputqueue(struct mbuf *m)
-{
- int x;
-
- if(!openflag)
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- x = splimp();
-
- if(IF_QFULL(&i4b_rdqueue))
- {
- struct mbuf *m1;
- IF_DEQUEUE(&i4b_rdqueue, m1);
- i4b_Dfreembuf(m1);
- DBGL4(L4_ERR, "i4bputqueue", ("ERROR, queue full, removing entry!\n"));
- }
-
- IF_ENQUEUE(&i4b_rdqueue, m);
-
- splx(x);
-
- if(readflag)
- {
- readflag = 0;
- wakeup((caddr_t) &i4b_rdqueue);
- }
-
- if(selflag)
- {
- selflag = 0;
- selwakeup(&select_rd_info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * i4bputqueue_hipri - put message into front of queue to userland
- *---------------------------------------------------------------------------*/
-void
-i4bputqueue_hipri(struct mbuf *m)
-{
- int x;
-
- if(!openflag)
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- x = splimp();
-
- if(IF_QFULL(&i4b_rdqueue))
- {
- struct mbuf *m1;
- IF_DEQUEUE(&i4b_rdqueue, m1);
- i4b_Dfreembuf(m1);
- DBGL4(L4_ERR, "i4bputqueue", ("ERROR, queue full, removing entry!\n"));
- }
-
- IF_PREPEND(&i4b_rdqueue, m);
-
- splx(x);
-
- if(readflag)
- {
- readflag = 0;
- wakeup((caddr_t) &i4b_rdqueue);
- }
-
- if(selflag)
- {
- selflag = 0;
- selwakeup(&select_rd_info);
- }
-}
-
-#if BSD > 199306 && defined(__FreeBSD__)
-static i4b_devsw_installed = 0;
-
-static void
-i4b_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! i4b_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&i4b_cdevsw,NULL);
- i4b_devsw_installed = 1;
- }
-}
-
-SYSINIT(i4bdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,i4b_drvinit,NULL)
-#endif /* __FreeBSD__ */
-#endif /* NI4B > 0 */
diff --git a/sys/i4b/layer4/i4b_l4.c b/sys/i4b/layer4/i4b_l4.c
deleted file mode 100644
index cecd5f4e2d665..0000000000000
--- a/sys/i4b/layer4/i4b_l4.c
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4.c - kernel interface to userland
- * -----------------------------------------
- *
- * $Id: i4b_l4.c,v 1.33 1998/12/05 18:05:49 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:16 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-#include "i4bipr.h"
-#include "i4bisppp.h"
-#include "i4brbch.h"
-#include "i4btel.h"
-
-#if NI4B > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <machine/i4b_cause.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer4/i4b_l4.h>
-
-unsigned int i4b_l4_debug = L4_DEBUG_DEFAULT;
-
-struct ctrl_type_desc ctrl_types[CTRL_NUMTYPES] = { { NULL, NULL} };
-
-static int i4b_link_bchandrvr(call_desc_t *cd);
-static void i4b_unlink_bchandrvr(call_desc_t *cd);
-static void i4b_l4_setup_timeout(call_desc_t *cd);
-
-/*---------------------------------------------------------------------------*
- * send MSG_PDEACT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_pdeact(int controller, int numactive)
-{
- struct mbuf *m;
- int i;
- call_desc_t *cd;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if((call_desc[i].cdid != CDID_UNUSED) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == controller))
- {
- cd = &call_desc[i];
-
- if(cd->timeout_active)
- {
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, cd->idle_timeout_handle);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd);
-#endif
- }
-
- if(cd->dlt != NULL)
- {
- (*cd->dlt->line_disconnected)(cd->driver_unit, (void *)cd);
- i4b_unlink_bchandrvr(cd);
- }
-
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_FREE;
- }
-
- cd->cdid = CDID_UNUSED;
- }
- }
-
- if((m = i4b_Dgetmbuf(sizeof(msg_pdeact_ind_t))) != NULL)
- {
- msg_pdeact_ind_t *md = (msg_pdeact_ind_t *)m->m_data;
-
- md->header.type = MSG_PDEACT_IND;
- md->header.cdid = -1;
-
- md->controller = controller;
- md->numactive = numactive;
-
- i4bputqueue_hipri(m); /* URGENT !!! */
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_L12STAT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_l12stat(int controller, int layer, int state)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_l12stat_ind_t))) != NULL)
- {
- msg_l12stat_ind_t *md = (msg_l12stat_ind_t *)m->m_data;
-
- md->header.type = MSG_L12STAT_IND;
- md->header.cdid = -1;
-
- md->controller = controller;
- md->layer = layer;
- md->state = state;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_TEIASG_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_teiasg(int controller, int tei)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_teiasg_ind_t))) != NULL)
- {
- msg_teiasg_ind_t *md = (msg_teiasg_ind_t *)m->m_data;
-
- md->header.type = MSG_TEIASG_IND;
- md->header.cdid = -1;
-
- md->controller = controller;
- md->tei = ctrl_desc[controller].tei;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_DIALOUT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_dialout(int driver, int driver_unit)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_dialout_ind_t))) != NULL)
- {
- msg_dialout_ind_t *md = (msg_dialout_ind_t *)m->m_data;
-
- md->header.type = MSG_DIALOUT_IND;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_NEGOTIATION_COMPL message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_negcomplete(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_negcomplete_ind_t))) != NULL)
- {
- msg_negcomplete_ind_t *md = (msg_negcomplete_ind_t *)m->m_data;
-
- md->header.type = MSG_NEGCOMP_IND;
- md->header.cdid = cd->cdid;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_IFSTATE_CHANGED_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_ifstate_changed(call_desc_t *cd, int new_state)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_ifstatechg_ind_t))) != NULL)
- {
- msg_ifstatechg_ind_t *md = (msg_ifstatechg_ind_t *)m->m_data;
-
- md->header.type = MSG_IFSTATE_CHANGED_IND;
- md->header.cdid = cd->cdid;
- md->state = new_state;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_DRVRDISC_REQ message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_drvrdisc(int driver, int driver_unit)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_drvrdisc_req_t))) != NULL)
- {
- msg_drvrdisc_req_t *md = (msg_drvrdisc_req_t *)m->m_data;
-
- md->header.type = MSG_DRVRDISC_REQ;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_ACCT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_accounting(int driver, int driver_unit, int accttype, int ioutbytes,
- int iinbytes, int ro, int ri, int outbytes, int inbytes)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_accounting_ind_t))) != NULL)
- {
- msg_accounting_ind_t *md = (msg_accounting_ind_t *)m->m_data;
-
- md->header.type = MSG_ACCT_IND;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- md->accttype = accttype;
- md->ioutbytes = ioutbytes;
- md->iinbytes = iinbytes;
- md->outbps = ro;
- md->inbps = ri;
- md->outbytes = outbytes;
- md->inbytes = inbytes;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_CONNECT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_connect_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_connect_ind_t))) != NULL)
- {
- msg_connect_ind_t *mp = (msg_connect_ind_t *)m->m_data;
-
- mp->header.type = MSG_CONNECT_IND;
- mp->header.cdid = cd->cdid;
-
- mp->controller = cd->controller;
- mp->channel = cd->channelid;
- mp->bprot = cd->bprot;
-
- cd->dir = DIR_INCOMING;
-
- if(strlen(cd->dst_telno) > 0)
- strcpy(mp->dst_telno, cd->dst_telno);
- else
- strcpy(mp->dst_telno, TELNO_EMPTY);
-
- if(strlen(cd->src_telno) > 0)
- strcpy(mp->src_telno, cd->src_telno);
- else
- strcpy(mp->src_telno, TELNO_EMPTY);
-
- strcpy(mp->display, cd->display);
-
- mp->scr_ind = cd->scr_ind;
-
- T400_start(cd);
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_CONNECT_ACTIVE_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_connect_active_ind(call_desc_t *cd)
-{
- int s;
- struct mbuf *m;
-
- s = SPLI4B();
-
- cd->last_active_time = cd->connect_time = SECOND;
-
- DBGL4(L4_TIMO, "i4b_l4_connect_active_ind", ("last_active/connect_time=%ld\n", (long)cd->connect_time));
-
- i4b_link_bchandrvr(cd);
-
- (*cd->dlt->line_connected)(cd->driver_unit, (void *)cd);
-
- i4b_l4_setup_timeout(cd);
-
- splx(s);
-
- if((m = i4b_Dgetmbuf(sizeof(msg_connect_active_ind_t))) != NULL)
- {
- msg_connect_active_ind_t *mp = (msg_connect_active_ind_t *)m->m_data;
-
- mp->header.type = MSG_CONNECT_ACTIVE_IND;
- mp->header.cdid = cd->cdid;
- mp->controller = cd->controller;
- mp->channel = cd->channelid;
- if(cd->datetime[0] != '\0')
- strcpy(mp->datetime, cd->datetime);
- else
- mp->datetime[0] = '\0';
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_DISCONNECT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_disconnect_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if(cd->timeout_active)
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, cd->idle_timeout_handle);
-#else
- untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd);
-#endif
-
- if(cd->dlt != NULL)
- {
- (*cd->dlt->line_disconnected)(cd->driver_unit, (void *)cd);
- i4b_unlink_bchandrvr(cd);
- }
-
- if((cd->channelid == CHAN_B1) || (cd->channelid == CHAN_B2))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_FREE;
- }
- else
- {
- /* no error, might be hunting call for callback */
- DBGL4(L4_MSG, "i4b_l4_disconnect_ind", ("channel free not B1/B2 but %d!\n", cd->channelid));
- }
-
- if((m = i4b_Dgetmbuf(sizeof(msg_disconnect_ind_t))) != NULL)
- {
- msg_disconnect_ind_t *mp = (msg_disconnect_ind_t *)m->m_data;
-
- mp->header.type = MSG_DISCONNECT_IND;
- mp->header.cdid = cd->cdid;
- mp->cause = cd->cause_in;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_IDLE_TIMEOUT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_idle_timeout_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_idle_timeout_ind_t))) != NULL)
- {
- msg_idle_timeout_ind_t *mp = (msg_idle_timeout_ind_t *)m->m_data;
-
- mp->header.type = MSG_IDLE_TIMEOUT_IND;
- mp->header.cdid = cd->cdid;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_CHARGING_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_charging_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_charging_ind_t))) != NULL)
- {
- msg_charging_ind_t *mp = (msg_charging_ind_t *)m->m_data;
-
- mp->header.type = MSG_CHARGING_IND;
- mp->header.cdid = cd->cdid;
- mp->units_type = cd->units_type;
-
-/*XXX*/ if(mp->units_type == CHARGE_CALC)
- mp->units = cd->cunits;
- else
- mp->units = cd->units;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_STATUS_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_status_ind(call_desc_t *cd)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_ALERT_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_alert_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_alert_ind_t))) != NULL)
- {
- msg_alert_ind_t *mp = (msg_alert_ind_t *)m->m_data;
-
- mp->header.type = MSG_ALERT_IND;
- mp->header.cdid = cd->cdid;
-
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_INFO_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_info_ind(call_desc_t *cd)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_INFO_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_proceeding_ind(call_desc_t *cd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_proceeding_ind_t))) != NULL)
- {
- msg_proceeding_ind_t *mp = (msg_proceeding_ind_t *)m->m_data;
-
- mp->header.type = MSG_PROCEEDING_IND;
- mp->header.cdid = cd->cdid;
- mp->controller = cd->controller;
- mp->channel = cd->channelid;
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * link a driver(unit) to a B-channel(controller,unit,channel)
- *---------------------------------------------------------------------------*/
-static int
-i4b_link_bchandrvr(call_desc_t *cd)
-{
- int t = ctrl_desc[cd->controller].ctrl_type;
-
- if(t < 0 || t >= CTRL_NUMTYPES || ctrl_types[t].get_linktab == NULL)
- {
- cd->ilt = NULL;
- }
- else
- {
- cd->ilt = ctrl_types[t].get_linktab(
- ctrl_desc[cd->controller].unit,
- cd->channelid);
- }
-
- switch(cd->driver)
- {
-#if NI4BRBCH > 0
- case BDRV_RBCH:
- cd->dlt = rbch_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if NI4BTEL > 0
- case BDRV_TEL:
- cd->dlt = tel_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if NI4BIPR > 0
- case BDRV_IPR:
- cd->dlt = ipr_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if NI4BISPPP > 0
- case BDRV_ISPPP:
- cd->dlt = i4bisppp_ret_linktab(cd->driver_unit);
- break;
-#endif
-
- default:
- cd->dlt = NULL;
- break;
- }
-
- if(cd->dlt == NULL || cd->ilt == NULL)
- return(-1);
-
- if(t >= 0 && t < CTRL_NUMTYPES && ctrl_types[t].set_linktab != NULL)
- {
- ctrl_types[t].set_linktab(
- ctrl_desc[cd->controller].unit,
- cd->channelid,
- cd->dlt);
- }
-
- switch(cd->driver)
- {
-#if NI4BRBCH > 0
- case BDRV_RBCH:
- rbch_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if NI4BTEL > 0
- case BDRV_TEL:
- tel_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if NI4BIPR > 0
- case BDRV_IPR:
- ipr_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if NI4BISPPP > 0
- case BDRV_ISPPP:
- i4bisppp_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
- default:
- return(0);
- break;
- }
-
- /* activate B channel */
-
- (*cd->ilt->bch_config)(ctrl_desc[cd->controller].unit,
- cd->channelid, cd->bprot, 1);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * unlink a driver(unit) from a B-channel(controller,unit,channel)
- *---------------------------------------------------------------------------*/
-static void
-i4b_unlink_bchandrvr(call_desc_t *cd)
-{
- int t = ctrl_desc[cd->controller].ctrl_type;
-
- if(t < 0 || t >= CTRL_NUMTYPES || ctrl_types[t].get_linktab == NULL)
- {
- cd->ilt = NULL;
- return;
- }
- else
- {
- cd->ilt = ctrl_types[t].get_linktab(
- ctrl_desc[cd->controller].unit,
- cd->channelid);
- }
-
- /* deactivate B channel */
-
- (*cd->ilt->bch_config)(ctrl_desc[cd->controller].unit,
- cd->channelid, cd->bprot, 0);
-}
-
-/*---------------------------------------------------------------------------
-
- How shorthold mode works for OUTGOING connections
- =================================================
-
- |<---- unchecked-window ------->|<-checkwindow->|<-safetywindow>|
-
-idletime_state: IST_NONCHK IST_CHECK IST_SAFE
-
- | | | |
- time>>+-------------------------------+---------------+---------------+-...
- | | | |
- | |<--idle_time-->|<--earlyhup--->|
- |<-----------------------unitlen------------------------------->|
-
-
- unitlen - specifies the time a charging unit lasts
- idle_time - specifies the thime the line must be idle at the
- end of the unit to be elected for hangup
- earlyhup - is the beginning of a timing safety zone before the
- next charging unit starts
-
- The algorithm works as follows: lets assume the unitlen is 100
- secons, idle_time is 40 seconds and earlyhup is 10 seconds.
- The line then must be idle 50 seconds after the begin of the
- current unit and it must then be quiet for 40 seconds. if it
- has been quiet for this 40 seconds, the line is closed 10
- seconds before the next charging unit starts. In case there was
- any traffic within the idle_time, the line is not closed.
- It does not matter whether there was any traffic between second
- 0 and second 50 or not.
-
-
- How shorthold mode works for INCOMING connections
- =================================================
-
- it is just possible to specify a maximum idle time for incoming
- connections, after this time of no activity on the line the line
- is closed.
-
----------------------------------------------------------------------------*/
-
-/*---------------------------------------------------------------------------*
- * B channel idle check timeout setup
- *---------------------------------------------------------------------------*/
-static void
-i4b_l4_setup_timeout(call_desc_t *cd)
-{
- cd->timeout_active = 0;
- cd->idletime_state = IST_IDLE;
-
- if((cd->dir == DIR_INCOMING) && (cd->max_idle_time > 0))
- {
- /* incoming call: simple max idletime check */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("%ld: incoming-call, setup max_idle_time to %ld\n", (long)SECOND, (long)cd->max_idle_time));
- }
- else if((cd->dir == DIR_OUTGOING) && (cd->idle_time > 0))
- {
- /* outgoing call */
-
- if((cd->idle_time > 0) && (cd->unitlen_time == 0))
- {
- /* outgoing call: simple max idletime check */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("%ld: outgoing-call, setup idle_time to %ld\n", (long)SECOND, (long)cd->idle_time));
- }
- else if((cd->unitlen_time > 0) && (cd->unitlen_time > (cd->idle_time + cd->earlyhup_time)))
- {
- /* outgoing call: full shorthold mode check */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->unitlen_time - (cd->idle_time + cd->earlyhup_time)));
- cd->timeout_active = 1;
- cd->idletime_state = IST_NONCHK;
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("%ld: outgoing-call, start %ld sec nocheck window\n",
- (long)SECOND, (long)(cd->unitlen_time - (cd->idle_time + cd->earlyhup_time))));
-
- if(cd->aocd_flag == 0)
- {
- cd->units_type = CHARGE_CALC;
- cd->cunits++;
- i4b_l4_charging_ind(cd);
- }
- }
- else
- {
- /* parms somehow got wrong .. */
-
- DBGL4(L4_ERR, "i4b_l4_setup_timeout", ("%ld: ERROR: idletime[%ld]+earlyhup[%ld] > unitlength[%ld]!\n",
- (long)SECOND, (long)cd->idle_time, (long)cd->earlyhup_time, (long)cd->unitlen_time));
- }
- }
- else
- {
- DBGL4(L4_TIMO, "i4b_l4_setup_timeout", ("no idle_timeout configured\n"));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * B channel idle check timeout function
- *---------------------------------------------------------------------------*/
-void
-i4b_idle_check(call_desc_t *cd)
-{
- int s;
-
- if(cd->cdid == CDID_UNUSED)
- return;
-
- s = SPLI4B();
-
- /* failsafe */
-
- if(cd->timeout_active == 0)
- {
- DBGL4(L4_ERR, "i4b_idle_check", ("ERROR: timeout_active == 0 !!!\n"));
- }
- else
- {
- cd->timeout_active = 0;
- }
-
- /* incoming connections, simple idletime check */
-
- if(cd->dir == DIR_INCOMING)
- {
- if((cd->last_active_time + cd->max_idle_time) <= SECOND)
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: incoming-call, line idle timeout, disconnecting!\n", (long)SECOND));
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- }
- else
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: incoming-call, activity, last_active=%ld, max_idle=%ld\n", (long)SECOND, (long)cd->last_active_time, (long)cd->max_idle_time));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- }
- }
-
- /* outgoing connections */
-
- else if(cd->dir == DIR_OUTGOING)
- {
-
- /* simple idletime calculation */
-
- if((cd->idle_time > 0) && (cd->unitlen_time == 0))
- {
- if((cd->last_active_time + cd->idle_time) <= SECOND)
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call-st, idle timeout, disconnecting!\n", (long)SECOND));
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- }
- else
- {
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call-st, activity, last_active=%ld, max_idle=%ld\n",
- (long)SECOND, (long)cd->last_active_time, (long)cd->idle_time));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz/2);
- cd->timeout_active = 1;
- }
- }
-
- /* full shorthold mode calculation */
-
- else if((cd->unitlen_time > 0) && (cd->unitlen_time > (cd->idle_time + cd->earlyhup_time)))
- {
- switch(cd->idletime_state)
- {
- case IST_NONCHK: /* end of non-check time */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->idle_time));
- cd->idletimechk_start = SECOND;
- cd->idletime_state = IST_CHECK;
- cd->timeout_active = 1;
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, idletime check window reached!\n", (long)SECOND));
- break;
-
- case IST_CHECK: /* end of idletime chk */
- if((cd->last_active_time > cd->idletimechk_start) &&
- (cd->last_active_time <= SECOND))
- { /* activity detected */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->earlyhup_time));
- cd->timeout_active = 1;
- cd->idletime_state = IST_SAFE;
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, activity at %ld, wait earlyhup-end\n", (long)SECOND, (long)cd->last_active_time));
- }
- else
- { /* no activity, hangup */
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, idle timeout, last activity at %ld\n", (long)SECOND, (long)cd->last_active_time));
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- cd->idletime_state = IST_IDLE;
- }
- break;
-
- case IST_SAFE: /* end of earlyhup time */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->idle_timeout_handle =
-#endif
- timeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, hz*(cd->unitlen_time - (cd->idle_time+cd->earlyhup_time)));
- cd->timeout_active = 1;
- cd->idletime_state = IST_NONCHK;
-
- if(cd->aocd_flag == 0)
- {
- cd->units_type = CHARGE_CALC;
- cd->cunits++;
- i4b_l4_charging_ind(cd);
- }
-
- DBGL4(L4_TIMO, "i4b_idle_check", ("%ld: outgoing-call, earlyhup end, wait for idletime start\n", (long)SECOND));
- break;
-
- default:
- DBGL4(L4_ERR, "i4b_idle_check", ("outgoing-call: invalid idletime_state value!\n"));
- cd->idletime_state = IST_IDLE;
- break;
- }
- }
- }
- splx(s);
-}
-
-#endif /* NI4B > 0 */
diff --git a/sys/i4b/layer4/i4b_l4.h b/sys/i4b/layer4/i4b_l4.h
deleted file mode 100644
index e4ed863f383ab..0000000000000
--- a/sys/i4b/layer4/i4b_l4.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4.h - kernel interface to userland header file
- * ---------------------------------------------------
- *
- * $Id: i4b_l4.h,v 1.13 1998/12/05 18:05:50 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:34 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L4_H_
-#define _I4B_L4_H_
-
-extern void i4bputqueue ( struct mbuf *m );
-extern void i4bputqueue_hipri(struct mbuf *m);
-extern void i4b_l4_accounting(int, int, int, int, int, int, int, int, int);
-extern void i4b_l4_alert_ind ( call_desc_t *cd );
-extern void i4b_l4_charging_ind( call_desc_t *cd );
-extern void i4b_l4_connect_active_ind ( call_desc_t *cd );
-extern void i4b_l4_connect_ind ( call_desc_t *cd );
-extern void i4b_l4_daemon_attached(void);
-extern void i4b_l4_daemon_detached(void);
-extern void i4b_l4_dialout( int driver, int driver_unit );
-extern void i4b_l4_disconnect_ind ( call_desc_t *cd );
-extern void i4b_l4_drvrdisc (int driver, int driver_unit );
-extern void i4b_l4_negcomplete( call_desc_t *cd );
-extern void i4b_l4_ifstate_changed( call_desc_t *cd, int new_state );
-extern void i4b_l4_idle_timeout_ind( call_desc_t *cd );
-extern void i4b_l4_info_ind ( call_desc_t *cd );
-extern void i4b_l4_l12stat(int controller, int layer, int state);
-extern void i4b_l4_pdeact(int controller, int numactive);
-extern void i4b_l4_teiasg(int controller, int tei);
-extern void i4b_l4_status_ind ( call_desc_t *cd );
-extern void i4b_l4_proceeding_ind ( call_desc_t *cd );
-extern void i4b_idle_check(call_desc_t *cdp);
-extern call_desc_t * cd_by_cdid ( unsigned int cdid );
-extern call_desc_t * cd_by_unitcr ( int unit, int cr, int crf );
-extern void freecd_by_cd ( call_desc_t *cd );
-extern unsigned char get_rand_cr ( int unit );
-extern call_desc_t * reserve_cd ( void );
-extern void T400_start ( call_desc_t *cd );
-extern void T400_stop ( call_desc_t *cd );
-
-#endif /* _I4B_L4_H_ */
diff --git a/sys/i4b/layer4/i4b_l4mgmt.c b/sys/i4b/layer4/i4b_l4mgmt.c
deleted file mode 100644
index e8e1a967a6960..0000000000000
--- a/sys/i4b/layer4/i4b_l4mgmt.c
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4mgmt.c - layer 4 calldescriptor management utilites
- * -----------------------------------------------------------
- *
- * $Id: i4b_l4mgmt.c,v 1.23 1998/12/05 18:05:52 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:35:50 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-
-#if NI4B > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <machine/random.h>
-#endif
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-call_desc_t call_desc[N_CALL_DESC]; /* call descriptor array */
-
-static unsigned int get_cdid(void);
-
-int nctrl; /* number of attached controllers */
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-void init_callout(call_desc_t *);
-#endif
-
-/*---------------------------------------------------------------------------*
- * return a new unique call descriptor id
- * --------------------------------------
- * returns a new calldescriptor id which is used to uniquely identyfy
- * a single call in the communication between kernel and userland.
- * this cdid is then used to associate a calldescriptor with an id.
- *---------------------------------------------------------------------------*/
-static unsigned int
-get_cdid(void)
-{
- static unsigned int cdid_count = 0;
- int i;
- int x;
-
- x = SPLI4B();
-
- /* get next id */
-
- cdid_count++;
-
-again:
- if(cdid_count == CDID_UNUSED) /* zero is invalid */
- cdid_count++;
- else if(cdid_count > CDID_MAX) /* wraparound ? */
- cdid_count = 1;
-
- /* check if id already in use */
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid == cdid_count)
- {
- cdid_count++;
- goto again;
- }
- }
-
- splx(x);
-
- return(cdid_count);
-}
-
-/*---------------------------------------------------------------------------*
- * reserve a calldescriptor for later usage
- * ----------------------------------------
- * searches the calldescriptor array until an unused
- * descriptor is found, gets a new calldescriptor id
- * and reserves it by putting the id into the cdid field.
- * returns pointer to the calldescriptor.
- *---------------------------------------------------------------------------*/
-call_desc_t *
-reserve_cd(void)
-{
- call_desc_t *cd;
- int x;
- int i;
-
- x = SPLI4B();
-
- cd = NULL;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid == CDID_UNUSED)
- {
- bzero(&call_desc[i], sizeof(call_desc_t)); /* clear it */
- call_desc[i].cdid = get_cdid(); /* fill in new cdid */
- cd = &(call_desc[i]); /* get pointer to descriptor */
- DBGL4(L4_MSG, "reserve_cd", ("found free cd - index=%d cdid=%u\n",
- i, call_desc[i].cdid));
- break;
- }
- }
-
- splx(x);
-
- if(cd == NULL)
- panic("reserve_cd: no free call descriptor available!");
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- init_callout(cd);
-#endif
-
- return(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * free a calldescriptor
- * ---------------------
- * free a unused calldescriptor by giving address of calldescriptor
- * and writing a 0 into the cdid field marking it as unused.
- *---------------------------------------------------------------------------*/
-void
-freecd_by_cd(call_desc_t *cd)
-{
- int i;
- int x = SPLI4B();
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if( (call_desc[i].cdid != CDID_UNUSED) &&
- (&(call_desc[i]) == cd) )
- {
- DBGL4(L4_MSG, "freecd_by_cd", ("releasing cd - index=%d cdid=%u cr=%d\n",
- i, call_desc[i].cdid, cd->cr));
- call_desc[i].cdid = CDID_UNUSED;
- break;
- }
- }
-
- if(i == N_CALL_DESC)
- panic("freecd_by_cd: ERROR, cd not found, cr = %d\n", cd->cr);
-
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to calldescriptor by giving the calldescriptor id
- * ----------------------------------------------------------------
- * lookup a calldescriptor in the calldescriptor array by looking
- * at the cdid field. return pointer to calldescriptor if found,
- * else return NULL if not found.
- *---------------------------------------------------------------------------*/
-call_desc_t *
-cd_by_cdid(unsigned int cdid)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid == cdid)
- {
- DBGL4(L4_MSG, "cd_by_cdid", ("found cdid - index=%d cdid=%u cr=%d\n",
- i, call_desc[i].cdid, call_desc[i].cr));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- init_callout(&call_desc[i]);
-#endif
- return(&(call_desc[i]));
- }
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * search calldescriptor
- * ---------------------
- * This routine searches for the calldescriptor for a passive controller
- * given by unit number, callreference and callreference flag.
- * It returns a pointer to the calldescriptor if found, else a NULL.
- *---------------------------------------------------------------------------*/
-call_desc_t *
-cd_by_unitcr(int unit, int cr, int crf)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if((call_desc[i].cdid != CDID_UNUSED) &&
- (ctrl_desc[call_desc[i].controller].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[call_desc[i].controller].unit == unit) &&
- (call_desc[i].cr == cr) &&
- (call_desc[i].crflag == crf) )
- {
- DBGL4(L4_MSG, "cd_by_unitcr", ("found cd, index=%d cdid=%u cr=%d\n",
- i, call_desc[i].cdid, call_desc[i].cr));
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- init_callout(&call_desc[i]);
-#endif
- return(&(call_desc[i]));
- }
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * generate 7 bit "random" number used for outgoing Call Reference
- *---------------------------------------------------------------------------*/
-unsigned char
-get_rand_cr(int unit)
-{
- register int i, j;
- static u_char val, retval;
- static int called = 42;
-
- val += ++called;
-
- for(i=0; i < 50 ; i++, val++)
- {
- int found = 1;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- read_random((char *)&val, sizeof(val));
-#else
- val |= unit+i;
- val <<= i;
- val ^= (time.tv_sec >> 8) ^ time.tv_usec;
- val <<= i;
- val ^= time.tv_sec ^ (time.tv_usec >> 8);
-#endif
-
- retval = val & 0x7f;
-
- if(retval == 0 || retval == 0x7f)
- continue;
-
- for(j=0; j < N_CALL_DESC; j++)
- {
- if( (call_desc[j].cdid != CDID_UNUSED) &&
- (call_desc[j].cr == retval) )
- {
- found = 0;
- break;
- }
- }
-
- if(found)
- return(retval);
- }
- return(0); /* XXX */
-}
-
-/*---------------------------------------------------------------------------*
- * initialize the callout handles for FreeBSD-current 3.0
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-void
-init_callout(call_desc_t *cd)
-{
- if(cd->callouts_inited == 0)
- {
- callout_handle_init(&cd->idle_timeout_handle);
- callout_handle_init(&cd->T303_callout);
- callout_handle_init(&cd->T305_callout);
- callout_handle_init(&cd->T308_callout);
- callout_handle_init(&cd->T309_callout);
- callout_handle_init(&cd->T310_callout);
- callout_handle_init(&cd->T313_callout);
- callout_handle_init(&cd->T400_callout);
- cd->callouts_inited = 1;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * daemon is attached
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_daemon_attached(void)
-{
- int i;
-
- int x = SPLI4B();
-
- for(i=0; i < nctrl; i++)
- {
-/*XXX*/ if(ctrl_desc[i].ctrl_type == CTRL_PASSIVE)
- {
- DBGL4(L4_MSG, "i4b_l4_daemon_attached", ("CMR_DOPEN sent to unit %d\n", ctrl_desc[i].unit));
-
- (*ctrl_desc[i].N_MGMT_COMMAND)(ctrl_desc[i].unit, CMR_DOPEN, 0);
- }
- }
- splx(x);
-}
-
-/*---------------------------------------------------------------------------*
- * daemon is detached
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_daemon_detached(void)
-{
- int i;
-
- int x = SPLI4B();
-
- for(i=0; i < nctrl; i++)
- {
-/*XXX*/ if(ctrl_desc[i].ctrl_type == CTRL_PASSIVE)
- {
- DBGL4(L4_MSG, "i4b_l4_daemon_detached", ("CMR_DCLOSE sent to unit %d\n", ctrl_desc[i].unit));
-
- (*ctrl_desc[i].N_MGMT_COMMAND)(ctrl_desc[i].unit, CMR_DCLOSE, 0);
- }
- }
- splx(x);
-}
-
-#ifdef I4B_CD_DEBUG_PRINT
-
-extern char *print_l3state(call_desc_t *cd);
-
-void i4b_print_cdp(call_desc_t *cdp);
-void i4b_print_cdx(int index);
-void i4b_print_cda(void);
-void i4b_print_cdaa(void);
-
-/*---------------------------------------------------------------------------*
- * print a call descriptor by cd-pointer
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cdp(call_desc_t *cdp)
-{
- if((cdp > &(call_desc[N_CALL_DESC])) || (cdp < &(call_desc[0])))
- {
- printf("i4b_print_cd: cdp out of range!\n");
- return;
- }
-
- printf("i4b_print_cd: printing call descriptor %d at 0x%lx:\n", cdp - (&(call_desc[0])), (unsigned long)cdp);
-
- printf(" cdid = %d\n", cdp->cdid);
- printf(" controller = %d (u=%d, dl=%d, b1=%d, b2=%d)\n",
- cdp->controller,
- ctrl_desc[cdp->controller].unit,
- ctrl_desc[cdp->controller].dl_est,
- ctrl_desc[cdp->controller].bch_state[CHAN_B1],
- ctrl_desc[cdp->controller].bch_state[CHAN_B2]);
- printf(" cr = 0x%02x\n", cdp->cr);
- printf(" crflag = %d\n", cdp->crflag);
- printf(" channelid = %d\n", cdp->channelid);
- printf(" bprot = %d\n", cdp->bprot);
- printf(" driver = %d\n", cdp->driver);
- printf(" driver_unit = %d\n", cdp->driver_unit);
- printf(" call_state = %d\n", cdp->call_state);
- printf(" Q931state = %s\n", print_l3state(cdp));
- printf(" event = %d\n", cdp->event);
- printf(" response = %d\n", cdp->response);
- printf(" T303 = %d\n", cdp->T303);
- printf("T303_first_to = %d\n", cdp->T303_first_to);
- printf(" T305 = %d\n", cdp->T305);
- printf(" T308 = %d\n", cdp->T308);
- printf("T308_first_to = %d\n", cdp->T308_first_to);
- printf(" T309 = %d\n", cdp->T309);
- printf(" T310 = %d\n", cdp->T310);
- printf(" T313 = %d\n", cdp->T313);
- printf(" T400 = %d\n", cdp->T400);
- printf(" dir = %s\n", cdp->dir == DIR_OUTGOING ? "out" : "in");
-}
-
-/*---------------------------------------------------------------------------*
- * print a call descriptor by index
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cdx(int index)
-{
- if(index >= N_CALL_DESC)
- {
- printf("i4b_print_cdx: index %d >= N_CALL_DESC %d\n", index, N_CALL_DESC);
- return;
- }
- i4b_print_cdp(&(call_desc[index]));
-}
-
-/*---------------------------------------------------------------------------*
- * print all call descriptors
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cda(void)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- i4b_print_cdp(&(call_desc[i]));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * print all active call descriptors
- *---------------------------------------------------------------------------*/
-void
-i4b_print_cdaa(void)
-{
- int i;
-
- for(i=0; i < N_CALL_DESC; i++)
- {
- if(call_desc[i].cdid != CDID_UNUSED)
- {
- i4b_print_cdp(&(call_desc[i]));
- }
- }
-}
-
-#endif /* I4B_CD_DEBUG_PRINT */
-
-#endif /* NI4BQ931 > 0 */
diff --git a/sys/i4b/layer4/i4b_l4timer.c b/sys/i4b/layer4/i4b_l4timer.c
deleted file mode 100644
index 7a38e13904dd0..0000000000000
--- a/sys/i4b/layer4/i4b_l4timer.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_l4timer.c - timer and timeout handling for layer 4
- * --------------------------------------------------------
- *
- * $Id: i4b_l4timer.c,v 1.10 1998/12/05 18:05:53 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:36:07 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "i4b.h"
-
-#if NI4B > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#else
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-/*---------------------------------------------------------------------------*
- * timer T400 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T400_timeout(call_desc_t *cd)
-{
- DBGL4(L4_ERR, "T400_timeout", ("cr = %d\n", cd->cr));
-}
-
-/*---------------------------------------------------------------------------*
- * timer T400 start
- *---------------------------------------------------------------------------*/
-void
-T400_start(call_desc_t *cd)
-{
- DBGL4(L4_MSG, "T400_start", ("cr = %d\n", cd->cr));
-
- cd->T400 = TIMER_ACTIVE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- cd->T400_callout = timeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd, T400DEF);
-#else
- timeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd, T400DEF);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * timer T400 stop
- *---------------------------------------------------------------------------*/
-void
-T400_stop(call_desc_t *cd)
-{
- DBGL4(L4_MSG, "T400_stop", ("cr = %d\n", cd->cr));
-
- if(cd->T400 == TIMER_ACTIVE)
- {
- cd->T400 = TIMER_IDLE;
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
- untimeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd, cd->T400_callout);
-#else
- untimeout((TIMEOUT_FUNC_T)T400_timeout, (void *)cd);
-#endif
- }
-}
-
-#endif /* NI4B > 0 */
diff --git a/sys/i4b/tina-dd/README b/sys/i4b/tina-dd/README
deleted file mode 100644
index 6a2386f90bf41..0000000000000
--- a/sys/i4b/tina-dd/README
+++ /dev/null
@@ -1,20 +0,0 @@
-
-THIS DRIVER IS NOT YET WORKING !
-================================
-
-This adds support for the active ISDN card tina-dd manufactured by
-Stollmann E+V GmbH in Hamburg, Germany. This card was also sold by
-MIRO as the Miro P1.
-
-Christian Luehrs and Manfred Jung of Stollmann were very helpful
-giving out docs and sources to support the development of a driver
-for this card.
-
-The card supports many protocols. In order to make the card operable
-you'll need the downloadable firmware which also can be found on the
-www/ftp server, www.stollmann.de / ftp.stollmann.de.
-
-While developing this driver, i used fcdddss1.loc as of April 1994.
-
-The code is based in part on sources and header files written by
-Stollmann for their driver development kit for the tina-dd.
diff --git a/sys/i4b/tina-dd/i4b_tina_dd.c b/sys/i4b/tina-dd/i4b_tina_dd.c
deleted file mode 100644
index e210d001888f5..0000000000000
--- a/sys/i4b/tina-dd/i4b_tina_dd.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (c) 1994, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tina_dd.c - i4b Stollman Tina-dd control device driver
- * ----------------------------------------------------------
- *
- * $Id: i4b_tina_dd.c,v 1.1 1998/12/27 21:46:53 phk Exp $
- *
- * last edit-date: [Sat Dec 5 18:41:38 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#include "tina.h"
-
-#if NTINA > 0
-
-#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/ioccom.h>
-#else
-#include <sys/ioctl.h>
-#endif
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/proc.h>
-#include <sys/fcntl.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#ifdef __FreeBSD__
-#include <machine/i4b_debug.h>
-#include <machine/i4b_ioctl.h>
-#include <i386/isa/isa_device.h>
-#else
-#include <machine/bus.h>
-#include <sys/device.h>
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-#endif
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/tina-dd/i4b_tina_ioctl.h>
-
-static int openflag = 0;
-
-int tinaprobe(struct isa_device *dev);
-int tinaattach(struct isa_device *dev);
-void tinaintr(int unit);
-
-struct isa_driver tinadriver = {
- tinaprobe,
- tinaattach,
- "tina",
- 0
-};
-
-static struct tina_softc {
- int sc_unit;
- int sc_iobase;
-} tina_sc[NTINA];
-
-static d_open_t tinaopen;
-static d_close_t tinaclose;
-static d_ioctl_t tinaioctl;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-static d_poll_t tinapoll;
-#endif
-
-#define CDEV_MAJOR 54
-static struct cdevsw tina_cdevsw =
- { tinaopen, tinaclose, noread, nowrite,
- tinaioctl, nostop, nullreset, nodevtotty,
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- tinapoll, nommap, NULL, "tina", NULL, -1 };
-#else
- noselect, nommap, NULL, "tina", NULL, -1 };
-#endif
-
-static void setupaddr(unsigned short iobase, unsigned int addr);
-static void readblock(unsigned short iobase, unsigned int addr,
- unsigned char *dst, unsigned int len);
-static void writeblock(unsigned short iobase, unsigned char *src,
- unsigned long addr, int len);
-
-/*---------------------------------------------------------------------------*
- * tina - device driver probe routine
- *---------------------------------------------------------------------------*/
-int
-tinaprobe(struct isa_device *dev)
-{
- u_char byte;
-
-#define SETLOW 0x55
-#define SETMID 0xaa
-#define SETHIGH 0x06
-
- outb((dev->id_iobase + ADDR_CNTL), SETLOW);
-
- if((byte = inb(dev->id_iobase + ADDR_CNTL)) != SETLOW)
- {
- printf("tina%d: probe low failed, 0x%x != 0x%x\n",
- dev->id_unit, byte, SETLOW);
- return(0);
- }
-
- outb((dev->id_iobase + ADDR_CNTM), SETMID);
- if((byte = inb(dev->id_iobase + ADDR_CNTM)) != SETMID)
- {
- printf("tina%d: probe mid failed, 0x%x != 0x%x\n",
- dev->id_unit, byte, SETMID);
- return(0);
- }
-
- outb((dev->id_iobase + ADDR_CNTH), SETHIGH);
- if(((byte = inb(dev->id_iobase + ADDR_CNTH)) & 0x0f) != SETHIGH)
- {
- printf("tina%d: probe high failed, 0x%x != 0x%x\n",
- dev->id_unit, byte, SETHIGH);
- return(0);
- }
-
- printf("tina%d: status register = 0x%x\n",
- dev->id_unit, inb(dev->id_iobase + CTRL_STAT));
-
- return(1); /* board found */
-}
-#undef SETLOW
-#undef SETMID
-#undef SETHIGH
-
-/*---------------------------------------------------------------------------*
- * tina - device driver attach routine
- *---------------------------------------------------------------------------*/
-int
-tinaattach(struct isa_device *dev)
-{
- struct tina_softc *sc = &tina_sc[dev->id_unit];
-
- sc->sc_unit = dev->id_unit;
- sc->sc_iobase = dev->id_iobase;
-
- printf("tina%d: attaching Tina-dd\n", dev->id_unit);
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- * tina - device driver interrupt routine
- *---------------------------------------------------------------------------*/
-void
-tinaintr(int unit)
-{
-}
-
-#if BSD > 199306 && defined(__FreeBSD__)
-/*---------------------------------------------------------------------------*
- * initialization at kernel load time
- *---------------------------------------------------------------------------*/
-static void
-tinainit(void *unused)
-{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &tina_cdevsw, NULL);
-}
-
-SYSINIT(tinadev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &tinainit, NULL);
-
-#endif /* BSD > 199306 && defined(__FreeBSD__) */
-
-/*---------------------------------------------------------------------------*
- * tinaopen - device driver open routine
- *---------------------------------------------------------------------------*/
-static int
-tinaopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- if(minor(dev))
- return (ENXIO);
-
- if(openflag)
- return (EBUSY);
-
- openflag = 1;
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * tinaclose - device driver close routine
- *---------------------------------------------------------------------------*/
-static int
-tinaclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- openflag = 0;
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * tinaioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-static int
-tinaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
-{
- struct tina_softc *sc = &tina_sc[minor(dev)];
- u_short iobase = sc->sc_iobase;
- int error = 0;
- int s;
-
- if(minor(dev))
- return(ENODEV);
-
- s = splimp();
-
- switch(cmd)
- {
- /* hardware layer - control & status register */
-
- case ISDN_GETCSR: /* return control register */
- *(unsigned char *)data = inb(iobase + CTRL_STAT);
- break;
-
- case ISDN_SETCSR: /* set status register */
- outb((iobase + CTRL_STAT), *(unsigned char *)data);
- break;
-
- /* hardware layer - dual ported memory */
-
- case ISDN_GETBLK: /* get block from dual port mem */
- readblock(iobase, (*(struct record *)data).addr,
- (*(struct record *)data).data,
- (*(struct record *)data).length);
- break;
-
- case ISDN_SETBLK: /* write block to dual port mem */
- writeblock(iobase, (*(struct record *)data).data,
- (*(struct record *)data).addr,
- (*(struct record *)data).length);
- break;
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * tinapoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-static int
-tinapoll (dev_t dev, int events, struct proc *p)
-{
- return (ENODEV);
-}
-#endif
-
-/*===========================================================================*
- * tina dual ported memory access
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * setup address for accessing tina-dd ram
- *---------------------------------------------------------------------------*/
-static void
-setupaddr(unsigned short iobase, unsigned int addr)
-{
- outb((iobase + ADDR_CNTL), (unsigned char) addr & 0xff);
- outb((iobase + ADDR_CNTM), (unsigned char) ((addr >> 8) & 0xff));
- outb((iobase + ADDR_CNTH), (unsigned char) ((addr >> 16) & 0xff));
-}
-
-
-/*---------------------------------------------------------------------------*
- * read block from tina-dd dual ported ram
- *---------------------------------------------------------------------------*/
-static void
-readblock(unsigned short iobase, unsigned int addr,
- unsigned char *dst, unsigned int len)
-{
- setupaddr(iobase, addr); /* setup start address */
-
- while(len--) /* tina-dd mem -> pc mem */
- *dst++ = inb(iobase + DATA_LOW_INC);
-}
-
-/*---------------------------------------------------------------------------*
- * write block to tina-dd dual ported ram
- *---------------------------------------------------------------------------*/
-static void
-writeblock(unsigned short iobase, unsigned char *src,
- unsigned long addr, int len)
-{
- setupaddr(iobase, addr); /* setup start address */
-
- while(len--) /* pc mem -> tina-dd mem */
- outb((iobase + DATA_LOW_INC), *src++);
-}
-
-#endif /* NTINA > 0 */
diff --git a/sys/i4b/tina-dd/i4b_tina_ioctl.h b/sys/i4b/tina-dd/i4b_tina_ioctl.h
deleted file mode 100644
index d51f16d731a4a..0000000000000
--- a/sys/i4b/tina-dd/i4b_tina_ioctl.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1994, 1998 Hellmuth Michaelis. All rights reserved.
- *
- * Based on code written by Stollmann GmbH, Hamburg. Many thanks to
- * Christian Luehrs and Manfred Jung for docs, sources and answers!
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *---------------------------------------------------------------------------
- *
- * i4b_tina_ioctl.h - i4b Stollman Tina-dd ioctl header file
- * ---------------------------------------------------------
- *
- * $Id: i4b_tina_ioctl.h,v 1.2 1998/12/05 18:06:20 hm Exp $
- *
- * last edit-date: [Sat Dec 5 18:41:51 1998]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_TINA_IOCTL_H_
-#define _I4B_TINA_IOCTL_H_
-
-#define TINA_IOSIZE 8 /* 8 byte wide iospace occupied */
-
-/*---------------------------------------------------------------------------*
- * register offsets in i/o address space
- *---------------------------------------------------------------------------*/
-
-#define CTRL_STAT 0 /* control & status */
-
-#define ADDR_CNTL 1 /* address pointer low */
-#define ADDR_CNTM 2 /* address pointer mid */
-#define ADDR_CNTH 3 /* address pointer high */
-
-#define DATA_LOW 4 /* data register low */
-#define DATA_HIGH 5 /* data register high */
-
-#define DATA_LOW_INC 6 /* data register low, post inc */
-#define DATA_HIGH_INC 7 /* data register high, post inc */
-
-/*---------------------------------------------------------------------------*
- * status register (CTRL_STAT read access)
- *---------------------------------------------------------------------------*/
-
-#define CR_INTC 0x80 /* irq FROM tina-dd TO pc active */
-#define CR_INTP 0x40 /* irq FROM pc TO tina-dd active */
-#define CR_INTPA 0x20 /* irq FROM pc TO tina-dd active */
-#define CR_NMI 0x10 /* nmi FROM PC TO tina-dd active */
-#define CR_FLASHLD 0x08 /* read of the FLASHLD-bit (n/c) */
-#define CR_S2C 0x04 /* info bit */
-#define CR_S1C 0x02 /* info bit */
-#define CR_S0C 0x01 /* info bit */
-
-/*---------------------------------------------------------------------------*
- * control register (CTRL_STAT write access)
- *---------------------------------------------------------------------------*/
-
-#define CR_CLR_INTC 0x80 /* clear irq on tina-dd */
-#define CR_SET_INTP 0x40 /* trigger irq on tina-dd */
-#define CR_RESET 0x20 /* reset tina-dd */
-#define CR_SET_NMI 0x10 /* trigger nmi on tina-dd */
-#define CR_SET_FLASHLD 0x08 /* activates pin FLASHLD (n/c) */
-#define CR_S2P 0x04 /* info bit (not readable !) */
-#define CR_S1P 0x02 /* info bit (not readable !) */
-#define CR_S0P 0x01 /* info bit (not readable !) */
-
-/*---------------------------------------------------------------------------*
- * misc definitions in dual-ported mem on board of tina-dd
- *---------------------------------------------------------------------------*/
-
-#define FW_SYSCB 0x200 /* address of FW SYSCB / MJ 300392 */
-#define FW_SINFO_NAME 0x220 /* address of general info label */
-
-#define FW_HW_TYPE 0x224 /* address of hardware type byte: */
-#define FW_HW_UNDEF 0x00 /* undefined .. */
-#define FW_HW_TINA_DD 0x10 /* TINA-dd */
-#define FW_HW_TINA_DS 0x20 /* TINA-ds (B channel/ser ?) */
-#define FW_HW_TINA_D 0x30 /* TINA-d (one B channel ?) */
-#define FW_HW_TINA_DDM 0x40 /* TINA-dd with fax module */
-#define FW_HW_TINA_DDS 0x50 /* TINA-dd with fax/voice module */
-#define FW_HW_SICCE 0x80 /* X.25 board */
-#define FW_HW_ASIC 0x01 /* ASIC version bit */
-
-#define FW_STAT 0x228 /* address of firmware status byte */
-#define FW_READY 0x20 /* firmware ready bit */
-#define FW_BOOTPRM_RDY 0x02 /* boot PROM ready */
-#define FW_UNDEF_0 0x00 /* undefined */
-#define FW_UNDEF_1 0xFF /* undefined */
-
-#define FW_SINFO_ID "SYSI" /* general info label for FW > 2.13*/
-#define FW_SINFO_ID_LEN 4
-
-#define FW_ADDR_PROFPTR 0x260 /* addr of ptr to board profile */
-
-/*===========================================================================*
- * Layer 0 - Hardware layer
- *===========================================================================*/
-
-/* control and status register access */
-
-#define ISDN_GETCSR _IOR('I', 1, unsigned char) /* get csr */
-#define ISDN_SETCSR _IOW('I', 2, unsigned char) /* set csr */
-
-/* dual ported ram access */
-
-#define ISDN_GETBLK _IOWR('I', 3, struct record) /* get dpr record */
-#define ISDN_SETBLK _IOW('I', 4, struct record) /* set dpr record */
-
-/*---------------------------------------------------------------------------*
- * record structure for dual ported ram block rd/wr
- *---------------------------------------------------------------------------*/
-struct record {
- unsigned int length; /* length of data block */
- unsigned int addr; /* address of mem on tina-dd board */
- unsigned char *data; /* pointer to the datablock itself */
-};
-
-#endif /* _I4B_TINA_IOCTL_H_ */
diff --git a/sys/isa/isareg.h b/sys/isa/isareg.h
index 644755a6e6ea2..8739e3cd191e1 100644
--- a/sys/isa/isareg.h
+++ b/sys/isa/isareg.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
- * $Id: isareg.h,v 1.1 1998/08/06 08:49:09 dfr Exp $
+ * $Id: isa.h,v 1.21 1997/02/22 09:36:41 peter Exp $
*/
#ifdef PC98
@@ -147,7 +147,7 @@
#define IO_ISASIZES
#define IO_ASCSIZE 5 /* AmiScan GI1904-based hand scanner */
-#define IO_CGASIZE 12 /* CGA controllers */
+#define IO_CGASIZE 16 /* CGA controllers */
#define IO_COMSIZE 8 /* 8250, 16x50 com controllers */
#define IO_DMASIZE 16 /* 8237 DMA controllers */
#define IO_DPGSIZE 32 /* 74LS612 DMA page registers */
@@ -158,10 +158,9 @@
#define IO_ICUSIZE 16 /* 8259A interrupt controllers */
#define IO_KBDSIZE 16 /* 8042 Keyboard controllers */
#define IO_LPTSIZE 8 /* LPT controllers, some use only 4 */
-#define IO_MDASIZE 12 /* Monochrome display controllers */
+#define IO_MDASIZE 16 /* Monochrome display controllers */
#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
#define IO_PMPSIZE 2 /* 82347 power management peripheral */
-#define IO_PSMSIZE 5 /* 8042 Keyboard controllers */
#define IO_RTCSIZE 16 /* CMOS real time clock, NMI control */
#define IO_TMRSIZE 16 /* 8253 programmable timers */
#define IO_VGASIZE 16 /* VGA controllers */
diff --git a/sys/isa/isavar.h b/sys/isa/isavar.h
index bb8ee55c780f6..756333a583780 100644
--- a/sys/isa/isavar.h
+++ b/sys/isa/isavar.h
@@ -23,34 +23,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isavar.h,v 1.1 1998/08/06 08:49:09 dfr Exp $
+ * $Id$
*/
-#define ISA_NPORT_IVARS 2
-#define ISA_NMEM_IVARS 2
-#define ISA_NIRQ_IVARS 2
-#define ISA_NDRQ_IVARS 2
-
enum isa_device_ivars {
- ISA_IVAR_PORT,
- ISA_IVAR_PORT_0 = ISA_IVAR_PORT,
- ISA_IVAR_PORT_1,
- ISA_IVAR_PORTSIZE,
- ISA_IVAR_PORTSIZE_0 = ISA_IVAR_PORTSIZE,
- ISA_IVAR_PORTSIZE_1,
- ISA_IVAR_MADDR,
- ISA_IVAR_MADDR_0 = ISA_IVAR_MADDR,
- ISA_IVAR_MADDR_1,
- ISA_IVAR_MSIZE,
- ISA_IVAR_MSIZE_0 = ISA_IVAR_MSIZE,
- ISA_IVAR_MSIZE_1,
- ISA_IVAR_FLAGS,
- ISA_IVAR_IRQ,
- ISA_IVAR_IRQ_0 = ISA_IVAR_IRQ,
- ISA_IVAR_IRQ_1,
- ISA_IVAR_DRQ,
- ISA_IVAR_DRQ_0 = ISA_IVAR_DRQ,
- ISA_IVAR_DRQ_1
+ ISA_IVAR_PORT,
+ ISA_IVAR_PORTSIZE,
+ ISA_IVAR_FLAGS,
+ ISA_IVAR_IRQ
};
extern int isa_irq_pending(void);
diff --git a/sys/isa/kbdio.c b/sys/isa/kbdio.c
index 5243d42a06d59..ca1565d5bd749 100644
--- a/sys/isa/kbdio.c
+++ b/sys/isa/kbdio.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kbdio.c,v 1.13 1998/08/06 09:15:53 dfr Exp $
+ * $Id$
* from: i386/isa kbdio.c,v 1.12
*/
@@ -40,7 +40,7 @@
#include <sys/systm.h>
#include <sys/syslog.h>
#include <machine/clock.h>
-#include <isa/kbdio.h>
+#include <i386/isa/kbdio.h>
/*
* driver specific options: the following options may be set by
diff --git a/sys/isa/kbdio.h b/sys/isa/kbdio.h
index 3aa0a0346e8ef..5bdb5be7aee9a 100644
--- a/sys/isa/kbdio.h
+++ b/sys/isa/kbdio.h
@@ -26,12 +26,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kbdio.h,v 1.9 1999/01/06 05:49:30 yokota Exp $
+ * $Id$
* from: i386/isa kbdio.h,v 1.7
*/
-#ifndef _ISA_KBDIO_H_
-#define _ISA_KBDIO_H_
+#ifndef _I386_ISA_KBDIO_H_
+#define _I386_ISA_KBDIO_H_
/* constants */
@@ -52,6 +52,9 @@
*/
#endif /* PC98 */
+/* FIXME: `IO_PSMSIZE' should really be in `isa.h'. */
+#define IO_PSMSIZE (KBD_COMMAND_PORT - KBD_DATA_PORT + 1) /* 5 */
+
/* controller commands (sent to KBD_COMMAND_PORT) */
#define KBDC_SET_COMMAND_BYTE 0x0060
#define KBDC_GET_COMMAND_BYTE 0x0020
@@ -204,4 +207,4 @@ int set_controller_command_byte __P((KBDC kbdc, int command, int flag));
#endif /* KERNEL */
-#endif /* !_ISA_KBDIO_H_ */
+#endif /* !_I386_ISA_KBDIO_H_ */
diff --git a/sys/isa/psm.c b/sys/isa/psm.c
deleted file mode 100644
index 5b999e1b36af2..0000000000000
--- a/sys/isa/psm.c
+++ /dev/null
@@ -1,2222 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993 Erik Forsberg.
- * Copyright (c) 1996, 1997 Kazutaka YOKOTA.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
- * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: psm.c,v 1.1 1998/11/08 18:43:03 dfr Exp $
- */
-
-/*
- * Ported to 386bsd Oct 17, 1992
- * Sandi Donno, Computer Science, University of Cape Town, South Africa
- * Please send bug reports to sandi@cs.uct.ac.za
- *
- * Thanks are also due to Rick Macklem, rick@snowhite.cis.uoguelph.ca -
- * although I was only partially successful in getting the alpha release
- * of his "driver for the Logitech and ATI Inport Bus mice for use with
- * 386bsd and the X386 port" to work with my Microsoft mouse, I nevertheless
- * found his code to be an invaluable reference when porting this driver
- * to 386bsd.
- *
- * Further modifications for latest 386BSD+patchkit and port to NetBSD,
- * Andrew Herbert <andrew@werple.apana.org.au> - 8 June 1993
- *
- * Cloned from the Microsoft Bus Mouse driver, also by Erik Forsberg, by
- * Andrew Herbert - 12 June 1993
- *
- * Modified for PS/2 mouse by Charles Hannum <mycroft@ai.mit.edu>
- * - 13 June 1993
- *
- * Modified for PS/2 AUX mouse by Shoji Yuen <yuen@nuie.nagoya-u.ac.jp>
- * - 24 October 1993
- *
- * Hardware access routines and probe logic rewritten by
- * Kazutaka Yokota <yokota@zodiac.mech.utsunomiya-u.ac.jp>
- * - 3, 14, 22 October 1996.
- * - 12 November 1996. IOCTLs and rearranging `psmread', `psmioctl'...
- * - 14, 30 November 1996. Uses `kbdio.c'.
- * - 13 December 1996. Uses queuing version of `kbdio.c'.
- * - January/February 1997. Tweaked probe logic for
- * HiNote UltraII/Latitude/Armada laptops.
- * - 30 July 1997. Added APM support.
- * - 5 March 1997. Defined driver configuration flags (PSM_CONFIG_XXX).
- * Improved sync check logic.
- * Vendor specific support routines.
- */
-
-#include "psm.h"
-#include "opt_devfs.h"
-#include "opt_psm.h"
-
-#if NPSM > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/poll.h>
-#include <sys/syslog.h>
-#include <sys/malloc.h>
-#include <sys/rman.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
-#include <sys/select.h>
-#include <sys/uio.h>
-
-#include <machine/clock.h>
-#include <machine/limits.h>
-#include <machine/mouse.h>
-#include <machine/resource.h>
-
-#include <isa/isareg.h>
-#include <isa/isavar.h>
-#include <isa/kbdio.h>
-
-/*
- * Driver specific options: the following options may be set by
- * `options' statements in the kernel configuration file.
- */
-
-/* debugging */
-#ifndef PSM_DEBUG
-#define PSM_DEBUG 0 /* logging: 0: none, 1: brief, 2: verbose */
-#endif
-
-/* features */
-
-/* #define PSM_HOOKAPM hook the APM resume event */
-/* #define PSM_RESETAFTERSUSPEND reset the device at the resume event */
-
-#if NAPM <= 0
-#undef PSM_HOOKAPM
-#endif /* NAPM */
-
-#ifndef PSM_HOOKAPM
-#undef PSM_RESETAFTERSUSPEND
-#endif /* PSM_HOOKAPM */
-
-/* end of driver specific options */
-
-/* input queue */
-#define PSM_BUFSIZE 960
-#define PSM_SMALLBUFSIZE 240
-
-/* operation levels */
-#define PSM_LEVEL_BASE 0
-#define PSM_LEVEL_STANDARD 1
-#define PSM_LEVEL_NATIVE 2
-#define PSM_LEVEL_MIN PSM_LEVEL_BASE
-#define PSM_LEVEL_MAX PSM_LEVEL_NATIVE
-
-/* some macros */
-#define PSM_UNIT(dev) (minor(dev) >> 1)
-#define PSM_NBLOCKIO(dev) (minor(dev) & 1)
-#define PSM_MKMINOR(unit,block) (((unit) << 1) | ((block) ? 0:1))
-
-#ifndef max
-#define max(x,y) ((x) > (y) ? (x) : (y))
-#endif
-#ifndef min
-#define min(x,y) ((x) < (y) ? (x) : (y))
-#endif
-
-/* ring buffer */
-typedef struct ringbuf {
- int count; /* # of valid elements in the buffer */
- int head; /* head pointer */
- int tail; /* tail poiner */
- unsigned char buf[PSM_BUFSIZE];
-} ringbuf_t;
-
-/* driver control block */
-struct psm_softc { /* Driver status information */
- struct selinfo rsel; /* Process selecting for Input */
- unsigned char state; /* Mouse driver state */
- int config; /* driver configuration flags */
- int flags; /* other flags */
- KBDC kbdc; /* handle to access the keyboard controller */
- int addr; /* I/O port address */
- mousehw_t hw; /* hardware information */
- mousemode_t mode; /* operation mode */
- mousemode_t dflt_mode; /* default operation mode */
- mousestatus_t status; /* accumulated mouse movement */
- ringbuf_t queue; /* mouse status queue */
- unsigned char ipacket[16]; /* interim input buffer */
- int inputbytes; /* # of bytes in the input buffer */
- int button; /* the latest button state */
-#ifdef DEVFS
- void *devfs_token;
- void *b_devfs_token;
-#endif
-#ifdef PSM_HOOKAPM
- struct apmhook resumehook;
-#endif
-};
-devclass_t psm_devclass;
-#define PSM_SOFTC(unit) ((struct psm_softc*)devclass_get_softc(psm_devclass, unit))
-
-/* driver state flags (state) */
-#define PSM_VALID 0x80
-#define PSM_OPEN 1 /* Device is open */
-#define PSM_ASLP 2 /* Waiting for mouse data */
-
-/* driver configuration flags (config) */
-#define PSM_CONFIG_RESOLUTION 0x000f /* resolution */
-#define PSM_CONFIG_ACCEL 0x00f0 /* acceleration factor */
-#define PSM_CONFIG_NOCHECKSYNC 0x0100 /* disable sync. test */
-
-#define PSM_CONFIG_FLAGS (PSM_CONFIG_RESOLUTION \
- | PSM_CONFIG_ACCEL \
- | PSM_CONFIG_NOCHECKSYNC)
-
-/* other flags (flags) */
-/*
- * Pass mouse data packet to the user land program `as is', even if
- * the mouse has vendor-specific enhanced features and uses non-standard
- * packet format. Otherwise manipulate the mouse data packet so that
- * it can be recognized by the programs which can only understand
- * the standard packet format.
-*/
-#define PSM_FLAGS_NATIVEMODE 0x0200
-
-/* for backward compatibility */
-#define OLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t)
-#define OLD_MOUSE_GETMODE _IOR('M', 2, old_mousemode_t)
-#define OLD_MOUSE_SETMODE _IOW('M', 3, old_mousemode_t)
-
-typedef struct old_mousehw {
- int buttons;
- int iftype;
- int type;
- int hwid;
-} old_mousehw_t;
-
-typedef struct old_mousemode {
- int protocol;
- int rate;
- int resolution;
- int accelfactor;
-} old_mousemode_t;
-
-/* packet formatting function */
-typedef int packetfunc_t __P((struct psm_softc *, unsigned char *,
- int *, int, mousestatus_t *));
-
-/* function prototypes */
-static int psmprobe __P((device_t));
-static int psmattach __P((device_t));
-#ifdef PSM_HOOKAPM
-static int psmresume __P((void *));
-#endif
-
-static d_open_t psmopen;
-static d_close_t psmclose;
-static d_read_t psmread;
-static d_ioctl_t psmioctl;
-static d_poll_t psmpoll;
-
-static int enable_aux_dev __P((KBDC));
-static int disable_aux_dev __P((KBDC));
-static int get_mouse_status __P((KBDC, int *, int, int));
-static int get_aux_id __P((KBDC));
-static int set_mouse_sampling_rate __P((KBDC, int));
-static int set_mouse_scaling __P((KBDC, int));
-static int set_mouse_resolution __P((KBDC, int));
-static int set_mouse_mode __P((KBDC));
-static int get_mouse_buttons __P((KBDC));
-static int is_a_mouse __P((int));
-static void recover_from_error __P((KBDC));
-static int restore_controller __P((KBDC, int));
-static int reinitialize __P((int, mousemode_t *));
-static int doopen __P((int, int));
-static char *model_name(int);
-static void psmintr(void*);
-
-/* vendor specific features */
-typedef int probefunc_t __P((struct psm_softc *));
-
-static int mouse_id_proc1 __P((KBDC, int, int, int *));
-static probefunc_t enable_groller;
-static probefunc_t enable_gmouse;
-static probefunc_t enable_aglide;
-static probefunc_t enable_kmouse;
-static probefunc_t enable_msintelli;
-static probefunc_t enable_mmanplus;
-static int tame_mouse __P((struct psm_softc *, mousestatus_t *, unsigned char *));
-
-static struct {
- int model;
- unsigned char syncmask;
- int packetsize;
- probefunc_t *probefunc;
-} vendortype[] = {
- { MOUSE_MODEL_NET, /* Genius NetMouse */
- 0xc8, MOUSE_INTELLI_PACKETSIZE, enable_gmouse, },
- { MOUSE_MODEL_NETSCROLL, /* Genius NetScroll */
- 0xc8, 6, enable_groller, },
- { MOUSE_MODEL_GLIDEPOINT, /* ALPS GlidePoint */
- 0xc0, MOUSE_PS2_PACKETSIZE, enable_aglide, },
- { MOUSE_MODEL_MOUSEMANPLUS, /* Logitech MouseMan+ */
- 0x08, MOUSE_PS2_PACKETSIZE, enable_mmanplus, },
- { MOUSE_MODEL_THINK, /* Kensignton ThinkingMouse */
- 0x80, MOUSE_PS2_PACKETSIZE, enable_kmouse, },
- { MOUSE_MODEL_INTELLI, /* Microsoft IntelliMouse */
- 0xc8, MOUSE_INTELLI_PACKETSIZE, enable_msintelli, },
- { MOUSE_MODEL_GENERIC,
- 0xc0, MOUSE_PS2_PACKETSIZE, NULL, },
-};
-
-/* device driver declarateion */
-static device_method_t psm_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, psmprobe),
- DEVMETHOD(device_attach, psmattach),
-
- { 0, 0 }
-};
-
-static driver_t psm_driver = {
- "psm",
- psm_methods,
- DRIVER_TYPE_TTY,
- sizeof(struct psm_softc),
-};
-
-#define CDEV_MAJOR 21
-
-static struct cdevsw psm_cdevsw = {
- psmopen, psmclose, psmread, nowrite, /* 21 */
- psmioctl, nostop, nullreset, nodevtotty,
- psmpoll, nommap, NULL, "psm", NULL, -1
-};
-
-/* debug message level */
-static int verbose = PSM_DEBUG;
-
-/* device I/O routines */
-static int
-enable_aux_dev(KBDC kbdc)
-{
- int res;
-
- res = send_aux_command(kbdc, PSMC_ENABLE_DEV);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: ENABLE_DEV return code:%04x\n", res);
-
- return (res == PSM_ACK);
-}
-
-static int
-disable_aux_dev(KBDC kbdc)
-{
- int res;
-
- res = send_aux_command(kbdc, PSMC_DISABLE_DEV);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: DISABLE_DEV return code:%04x\n", res);
-
- return (res == PSM_ACK);
-}
-
-static int
-get_mouse_status(KBDC kbdc, int *status, int flag, int len)
-{
- int cmd;
- int res;
- int i;
-
- switch (flag) {
- case 0:
- default:
- cmd = PSMC_SEND_DEV_STATUS;
- break;
- case 1:
- cmd = PSMC_SEND_DEV_DATA;
- break;
- }
- empty_aux_buffer(kbdc, 5);
- res = send_aux_command(kbdc, cmd);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SEND_AUX_DEV_%s return code:%04x\n",
- (flag == 1) ? "DATA" : "STATUS", res);
- if (res != PSM_ACK)
- return 0;
-
- for (i = 0; i < len; ++i) {
- status[i] = read_aux_data(kbdc);
- if (status[i] < 0)
- break;
- }
-
- if (verbose) {
- log(LOG_DEBUG, "psm: %s %02x %02x %02x\n",
- (flag == 1) ? "data" : "status", status[0], status[1], status[2]);
- }
-
- return i;
-}
-
-static int
-get_aux_id(KBDC kbdc)
-{
- int res;
- int id;
-
- empty_aux_buffer(kbdc, 5);
- res = send_aux_command(kbdc, PSMC_SEND_DEV_ID);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SEND_DEV_ID return code:%04x\n", res);
- if (res != PSM_ACK)
- return (-1);
-
- /* 10ms delay */
- DELAY(10000);
-
- id = read_aux_data(kbdc);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: device ID: %04x\n", id);
-
- return id;
-}
-
-static int
-set_mouse_sampling_rate(KBDC kbdc, int rate)
-{
- int res;
-
- res = send_aux_command_and_data(kbdc, PSMC_SET_SAMPLING_RATE, rate);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_SAMPLING_RATE (%d) %04x\n", rate, res);
-
- return ((res == PSM_ACK) ? rate : -1);
-}
-
-static int
-set_mouse_scaling(KBDC kbdc, int scale)
-{
- int res;
-
- switch (scale) {
- case 1:
- default:
- scale = PSMC_SET_SCALING11;
- break;
- case 2:
- scale = PSMC_SET_SCALING21;
- break;
- }
- res = send_aux_command(kbdc, scale);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_SCALING%s return code:%04x\n",
- (scale == PSMC_SET_SCALING21) ? "21" : "11", res);
-
- return (res == PSM_ACK);
-}
-
-/* `val' must be 0 through PSMD_MAX_RESOLUTION */
-static int
-set_mouse_resolution(KBDC kbdc, int val)
-{
- int res;
-
- res = send_aux_command_and_data(kbdc, PSMC_SET_RESOLUTION, val);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_RESOLUTION (%d) %04x\n", val, res);
-
- return ((res == PSM_ACK) ? val : -1);
-}
-
-/*
- * NOTE: once `set_mouse_mode()' is called, the mouse device must be
- * re-enabled by calling `enable_aux_dev()'
- */
-static int
-set_mouse_mode(KBDC kbdc)
-{
- int res;
-
- res = send_aux_command(kbdc, PSMC_SET_STREAM_MODE);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm: SET_STREAM_MODE return code:%04x\n", res);
-
- return (res == PSM_ACK);
-}
-
-static int
-get_mouse_buttons(KBDC kbdc)
-{
- int c = 2; /* assume two buttons by default */
- int status[3];
-
- /*
- * NOTE: a special sequence to obtain Logitech Mouse specific
- * information: set resolution to 25 ppi, set scaling to 1:1, set
- * scaling to 1:1, set scaling to 1:1. Then the second byte of the
- * mouse status bytes is the number of available buttons.
- * Some manufactures also support this sequence.
- */
- if (set_mouse_resolution(kbdc, PSMD_RES_LOW) != PSMD_RES_LOW)
- return c;
- if (set_mouse_scaling(kbdc, 1) && set_mouse_scaling(kbdc, 1)
- && set_mouse_scaling(kbdc, 1)
- && (get_mouse_status(kbdc, status, 0, 3) >= 3)) {
- if (status[1] != 0)
- return status[1];
- }
- return c;
-}
-
-/* misc subroutines */
-/*
- * Someday, I will get the complete list of valid pointing devices and
- * their IDs... XXX
- */
-static int
-is_a_mouse(int id)
-{
-#if 0
- static int valid_ids[] = {
- PSM_MOUSE_ID, /* mouse */
- PSM_BALLPOINT_ID, /* ballpoint device */
- PSM_INTELLI_ID, /* Intellimouse */
- -1 /* end of table */
- };
- int i;
-
- for (i = 0; valid_ids[i] >= 0; ++i)
- if (valid_ids[i] == id)
- return TRUE;
- return FALSE;
-#else
- return TRUE;
-#endif
-}
-
-static char *
-model_name(int model)
-{
- static struct {
- int model_code;
- char *model_name;
- } models[] = {
- { MOUSE_MODEL_NETSCROLL, "NetScroll Mouse" },
- { MOUSE_MODEL_NET, "NetMouse" },
- { MOUSE_MODEL_GLIDEPOINT, "GlidePoint" },
- { MOUSE_MODEL_THINK, "ThinkingMouse" },
- { MOUSE_MODEL_INTELLI, "IntelliMouse" },
- { MOUSE_MODEL_MOUSEMANPLUS, "MouseMan+" },
- { MOUSE_MODEL_GENERIC, "Generic PS/2 mouse" },
- { MOUSE_MODEL_UNKNOWN, NULL },
- };
- int i;
-
- for (i = 0; models[i].model_code != MOUSE_MODEL_UNKNOWN; ++i) {
- if (models[i].model_code == model)
- return models[i].model_name;
- }
- return "Unknown";
-}
-
-static void
-recover_from_error(KBDC kbdc)
-{
- /* discard anything left in the output buffer */
- empty_both_buffers(kbdc, 10);
-
-#if 0
- /*
- * NOTE: KBDC_RESET_KBD may not restore the communication between the
- * keyboard and the controller.
- */
- reset_kbd(kbdc);
-#else
- /*
- * NOTE: somehow diagnostic and keyboard port test commands bring the
- * keyboard back.
- */
- if (!test_controller(kbdc))
- log(LOG_ERR, "psm: keyboard controller failed.\n");
- /* if there isn't a keyboard in the system, the following error is OK */
- if (test_kbd_port(kbdc) != 0) {
- if (verbose)
- log(LOG_ERR, "psm: keyboard port failed.\n");
- }
-#endif
-}
-
-static int
-restore_controller(KBDC kbdc, int command_byte)
-{
- empty_both_buffers(kbdc, 10);
-
- if (!set_controller_command_byte(kbdc, 0xff, command_byte)) {
- log(LOG_ERR, "psm: failed to restore the keyboard controller "
- "command byte.\n");
- return FALSE;
- } else {
- return TRUE;
- }
-}
-
-/*
- * Re-initialize the aux port and device. The aux port must be enabled
- * and its interrupt must be disabled before calling this routine.
- * The aux device will be disabled before returning.
- * The keyboard controller must be locked via `kbdc_lock()' before
- * calling this routine.
- */
-static int
-reinitialize(int unit, mousemode_t *mode)
-{
- struct psm_softc *sc = PSM_SOFTC(unit);
- KBDC kbdc = sc->kbdc;
- int stat[3];
- int i;
-
- switch((i = test_aux_port(kbdc))) {
- case 1: /* ignore this error */
- case PSM_ACK:
- if (verbose)
- log(LOG_DEBUG, "psm%d: strange result for test aux port (%d).\n",
- unit, i);
- /* fall though */
- case 0: /* no error */
- break;
- case -1: /* time out */
- default: /* error */
- recover_from_error(kbdc);
- log(LOG_ERR, "psm%d: the aux port is not functioning (%d).\n",
- unit, i);
- return FALSE;
- }
-
- /*
- * NOTE: some controllers appears to hang the `keyboard' when
- * the aux port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(kbdc)) {
- recover_from_error(kbdc);
- log(LOG_ERR, "psm%d: failed to reset the aux device.\n", unit);
- return FALSE;
- }
-
- /*
- * both the aux port and the aux device is functioning, see
- * if the device can be enabled.
- */
- if (!enable_aux_dev(kbdc) || !disable_aux_dev(kbdc)) {
- log(LOG_ERR, "psm%d: failed to enable the aux device.\n", unit);
- return FALSE;
- }
- empty_both_buffers(kbdc, 10); /* remove stray data if any */
-
- /* FIXME: hardware ID, mouse buttons? */
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- log(LOG_ERR, "psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
- }
-
- sc->hw.model = vendortype[i].model;
- sc->mode.packetsize = vendortype[i].packetsize;
-
- /* set mouse parameters */
- if (mode != (mousemode_t *)NULL) {
- if (mode->rate > 0)
- mode->rate = set_mouse_sampling_rate(kbdc, mode->rate);
- if (mode->resolution >= 0)
- mode->resolution = set_mouse_resolution(kbdc, mode->resolution);
- set_mouse_scaling(kbdc, 1);
- set_mouse_mode(kbdc);
- }
-
- /* request a data packet and extract sync. bits */
- if (get_mouse_status(kbdc, stat, 1, 3) < 3) {
- log(LOG_DEBUG, "psm%d: failed to get data (reinitialize).\n", unit);
- sc->mode.syncmask[0] = 0;
- } else {
- sc->mode.syncmask[1] = stat[0] & sc->mode.syncmask[0]; /* syncbits */
- /* the NetScroll Mouse will send three more bytes... Ignore them */
- empty_aux_buffer(kbdc, 5);
- }
-
- /* just check the status of the mouse */
- if (get_mouse_status(kbdc, stat, 0, 3) < 3)
- log(LOG_DEBUG, "psm%d: failed to get status (reinitialize).\n", unit);
-
- return TRUE;
-}
-
-static int
-doopen(int unit, int command_byte)
-{
- struct psm_softc *sc = PSM_SOFTC(unit);
- int stat[3];
-
- /* enable the mouse device */
- if (!enable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR: failed to enable the mouse because:
- * 1) the mouse is faulty,
- * 2) the mouse has been removed(!?)
- * In the latter case, the keyboard may have hung, and need
- * recovery procedure...
- */
- recover_from_error(sc->kbdc);
-#if 0
- /* FIXME: we could reset the mouse here and try to enable
- * it again. But it will take long time and it's not a good
- * idea to disable the keyboard that long...
- */
- if (!reinitialize(unit, &sc->mode) || !enable_aux_dev(sc->kbdc)) {
- recover_from_error(sc->kbdc);
-#else
- {
-#endif
- restore_controller(sc->kbdc, command_byte);
- /* mark this device is no longer available */
- sc->state &= ~PSM_VALID;
- log(LOG_ERR, "psm%d: failed to enable the device (doopen).\n",
- unit);
- return (EIO);
- }
- }
-
- if (get_mouse_status(sc->kbdc, stat, 0, 3) < 3)
- log(LOG_DEBUG, "psm%d: failed to get status (doopen).\n", unit);
-
- /* enable the aux port and interrupt */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- (command_byte & KBD_KBD_CONTROL_BITS)
- | KBD_ENABLE_AUX_PORT | KBD_ENABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- disable_aux_dev(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- log(LOG_ERR, "psm%d: failed to enable the aux interrupt (doopen).\n",
- unit);
- return (EIO);
- }
-
- return (0);
-}
-
-/* psm driver entry points */
-
-#define endprobe(v) { if (bootverbose) \
- --verbose; \
- kbdc_set_device_mask(sc->kbdc, mask); \
- kbdc_lock(sc->kbdc, FALSE); \
- free(sc, M_DEVBUF); \
- return (v); \
- }
-
-static int
-psmprobe(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct psm_softc *sc = device_get_softc(dev);
- int stat[3];
- int command_byte;
- int mask;
- int i;
-
-#if 0
- kbdc_debug(TRUE);
-#endif
- sc->addr = isa_get_port(dev);
- sc->kbdc = kbdc_open(sc->addr);
- sc->config = isa_get_flags(dev) & PSM_CONFIG_FLAGS;
- sc->flags = 0;
- if (bootverbose)
- ++verbose;
-
- if (!kbdc_lock(sc->kbdc, TRUE)) {
- printf("psm%d: unable to lock the controller.\n", unit);
- if (bootverbose)
- --verbose;
- return (ENXIO);
- }
-
- /*
- * NOTE: two bits in the command byte controls the operation of the
- * aux port (mouse port): the aux port disable bit (bit 5) and the aux
- * port interrupt (IRQ 12) enable bit (bit 2).
- */
-
- /* discard anything left after the keyboard initialization */
- empty_both_buffers(sc->kbdc, 10);
-
- /* save the current command byte; it will be used later */
- mask = kbdc_get_device_mask(sc->kbdc) & ~KBD_AUX_CONTROL_BITS;
- command_byte = get_controller_command_byte(sc->kbdc);
- if (verbose)
- printf("psm%d: current command byte:%04x\n", unit, command_byte);
- if (command_byte == -1) {
- /* CONTROLLER ERROR */
- printf("psm%d: unable to get the current command byte value.\n",
- unit);
- endprobe(ENXIO);
- }
-
- /*
- * disable the keyboard port while probing the aux port, which must be
- * enabled during this routine
- */
- if (!set_controller_command_byte(sc->kbdc,
- KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS,
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /*
- * this is CONTROLLER ERROR; I don't know how to recover
- * from this error...
- */
- restore_controller(sc->kbdc, command_byte);
- printf("psm%d: unable to set the command byte.\n", unit);
- endprobe(ENXIO);
- }
-
- /*
- * NOTE: `test_aux_port()' is designed to return with zero if the aux
- * port exists and is functioning. However, some controllers appears
- * to respond with zero even when the aux port doesn't exist. (It may
- * be that this is only the case when the controller DOES have the aux
- * port but the port is not wired on the motherboard.) The keyboard
- * controllers without the port, such as the original AT, are
- * supporsed to return with an error code or simply time out. In any
- * case, we have to continue probing the port even when the controller
- * passes this test.
- *
- * XXX: some controllers erroneously return the error code 1 when
- * it has the perfectly functional aux port. We have to ignore this
- * error code. Even if the controller HAS error with the aux port,
- * it will be detected later...
- * XXX: another incompatible controller returns PSM_ACK (0xfa)...
- */
- switch ((i = test_aux_port(sc->kbdc))) {
- case 1: /* ignore this error */
- case PSM_ACK:
- if (verbose)
- printf("psm%d: strange result for test aux port (%d).\n",
- unit, i);
- /* fall though */
- case 0: /* no error */
- break;
- case -1: /* time out */
- default: /* error */
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: the aux port is not functioning (%d).\n",
- unit, i);
- endprobe(ENXIO);
- }
-
- /*
- * NOTE: some controllers appears to hang the `keyboard' when the aux
- * port doesn't exist and `PSMC_RESET_DEV' is issued.
- */
- if (!reset_aux_dev(sc->kbdc)) {
- recover_from_error(sc->kbdc);
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to reset the aux device.\n", unit);
- endprobe(ENXIO);
- }
- /*
- * both the aux port and the aux device is functioning, see if the
- * device can be enabled. NOTE: when enabled, the device will start
- * sending data; we shall immediately disable the device once we know
- * the device can be enabled.
- */
- if (!enable_aux_dev(sc->kbdc) || !disable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR */
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: failed to enable the aux device.\n", unit);
- endprobe(ENXIO);
- }
-
- /* save the default values after reset */
- if (get_mouse_status(sc->kbdc, stat, 0, 3) >= 3) {
- sc->dflt_mode.rate = sc->mode.rate = stat[2];
- sc->dflt_mode.resolution = sc->mode.resolution = stat[1];
- } else {
- sc->dflt_mode.rate = sc->mode.rate = -1;
- sc->dflt_mode.resolution = sc->mode.resolution = -1;
- }
-
- /* hardware information */
- sc->hw.iftype = MOUSE_IF_PS2;
-
- /* verify the device is a mouse */
- sc->hw.hwid = get_aux_id(sc->kbdc);
- if (!is_a_mouse(sc->hw.hwid)) {
- restore_controller(sc->kbdc, command_byte);
- if (verbose)
- printf("psm%d: unknown device type (%d).\n", unit, sc->hw.hwid);
- endprobe(ENXIO);
- }
- switch (sc->hw.hwid) {
- case PSM_BALLPOINT_ID:
- sc->hw.type = MOUSE_TRACKBALL;
- break;
- case PSM_MOUSE_ID:
- case PSM_INTELLI_ID:
- sc->hw.type = MOUSE_MOUSE;
- break;
- default:
- sc->hw.type = MOUSE_UNKNOWN;
- break;
- }
-
- /* # of buttons */
- sc->hw.buttons = get_mouse_buttons(sc->kbdc);
-
- /* other parameters */
- for (i = 0; vendortype[i].probefunc != NULL; ++i) {
- if ((*vendortype[i].probefunc)(sc)) {
- if (verbose >= 2)
- printf("psm%d: found %s\n",
- unit, model_name(vendortype[i].model));
- break;
- }
- }
-
- sc->hw.model = vendortype[i].model;
-
- sc->dflt_mode.level = PSM_LEVEL_BASE;
- sc->dflt_mode.packetsize = MOUSE_PS2_PACKETSIZE;
- sc->dflt_mode.accelfactor = (sc->config & PSM_CONFIG_ACCEL) >> 4;
- if (sc->config & PSM_CONFIG_NOCHECKSYNC)
- sc->dflt_mode.syncmask[0] = 0;
- else
- sc->dflt_mode.syncmask[0] = vendortype[i].syncmask;
- sc->dflt_mode.syncmask[1] = 0; /* syncbits */
- sc->mode = sc->dflt_mode;
- sc->mode.packetsize = vendortype[i].packetsize;
-
- /* set mouse parameters */
- i = send_aux_command(sc->kbdc, PSMC_SET_DEFAULTS);
- if (verbose >= 2)
- printf("psm%d: SET_DEFAULTS return code:%04x\n", unit, i);
- if (sc->config & PSM_CONFIG_RESOLUTION) {
- sc->mode.resolution
- = set_mouse_resolution(sc->kbdc,
- (sc->config & PSM_CONFIG_RESOLUTION) - 1);
- }
-
- /* request a data packet and extract sync. bits */
- if (get_mouse_status(sc->kbdc, stat, 1, 3) < 3) {
- printf("psm%d: failed to get data.\n", unit);
- sc->mode.syncmask[0] = 0;
- } else {
- sc->mode.syncmask[1] = stat[0] & sc->mode.syncmask[0]; /* syncbits */
- /* the NetScroll Mouse will send three more bytes... Ignore them */
- empty_aux_buffer(sc->kbdc, 5);
- }
-
- /* just check the status of the mouse */
- /*
- * NOTE: XXX there are some arcane controller/mouse combinations out
- * there, which hung the controller unless there is data transmission
- * after ACK from the mouse.
- */
- if (get_mouse_status(sc->kbdc, stat, 0, 3) < 3) {
- printf("psm%d: failed to get status.\n", unit);
- } else {
- /*
- * When in its native mode, some mice operate with different
- * default parameters than in the PS/2 compatible mode.
- */
- sc->dflt_mode.rate = sc->mode.rate = stat[2];
- sc->dflt_mode.resolution = sc->mode.resolution = stat[1];
- }
-
- /* disable the aux port for now... */
- if (!set_controller_command_byte(sc->kbdc,
- KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS,
- (command_byte & KBD_KBD_CONTROL_BITS)
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /*
- * this is CONTROLLER ERROR; I don't know the proper way to
- * recover from this error...
- */
- restore_controller(sc->kbdc, command_byte);
- printf("psm%d: unable to set the command byte.\n", unit);
- endprobe(ENXIO);
- }
-
- /* done */
- kbdc_set_device_mask(sc->kbdc, mask | KBD_AUX_CONTROL_BITS);
- kbdc_lock(sc->kbdc, FALSE);
- return (0);
-}
-
-static int
-psmattach(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct psm_softc *sc = device_get_softc(dev);
- void *ih;
- struct resource *res;
- int zero = 0;
-
- if (sc == NULL) /* shouldn't happen */
- return (ENXIO);
-
- /* Setup initial state */
- sc->state = PSM_VALID;
-
- /* Done */
-#ifdef DEVFS
- sc->devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, FALSE),
- DV_CHR, 0, 0, 0666, "psm%d", unit);
- sc->b_devfs_token =
- devfs_add_devswf(&psm_cdevsw, PSM_MKMINOR(unit, TRUE),
- DV_CHR, 0, 0, 0666, "bpsm%d", unit);
-#endif /* DEVFS */
-
-#ifdef PSM_HOOKAPM
- sc->resumehook.ah_name = "PS/2 mouse";
- sc->resumehook.ah_fun = psmresume;
- sc->resumehook.ah_arg = (void *)unit;
- sc->resumehook.ah_order = APM_MID_ORDER;
- apm_hook_establish(APM_HOOK_RESUME , &sc->resumehook);
- if (verbose)
- printf("psm%d: APM hooks installed.\n", unit);
-#endif /* PSM_HOOKAPM */
-
- if (!verbose) {
- printf("psm%d: model %s, device ID %d\n",
- unit, model_name(sc->hw.model), sc->hw.hwid);
- } else {
- printf("psm%d: model %s, device ID %d, %d buttons\n",
- unit, model_name(sc->hw.model), sc->hw.hwid, sc->hw.buttons);
- printf("psm%d: config:%08x, flags:%08x, packet size:%d\n",
- unit, sc->config, sc->flags, sc->mode.packetsize);
- printf("psm%d: syncmask:%02x, syncbits:%02x\n",
- unit, sc->mode.syncmask[0], sc->mode.syncmask[1]);
- }
-
- if (bootverbose)
- --verbose;
-
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, 0ul, ~0ul, 1,
- RF_SHAREABLE | RF_ACTIVE);
- BUS_SETUP_INTR(device_get_parent(dev), dev, res, psmintr, sc,
- &ih);
-
- return (0);
-}
-
-static int
-psmopen(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = PSM_UNIT(dev);
- struct psm_softc *sc;
- int command_byte;
- int err;
- int s;
-
- /* Validate unit number */
- if (unit >= NPSM)
- return (ENXIO);
-
- /* Get device data */
- sc = PSM_SOFTC(unit);
- if ((sc == NULL) || (sc->state & PSM_VALID) == 0)
- /* the device is no longer valid/functioning */
- return (ENXIO);
-
- /* Disallow multiple opens */
- if (sc->state & PSM_OPEN)
- return (EBUSY);
-
- device_busy(devclass_get_device(psm_devclass, unit));
-
- /* Initialize state */
- sc->rsel.si_flags = 0;
- sc->rsel.si_pid = 0;
- sc->mode.level = sc->dflt_mode.level;
- sc->mode.protocol = sc->dflt_mode.protocol;
-
- /* flush the event queue */
- sc->queue.count = 0;
- sc->queue.head = 0;
- sc->queue.tail = 0;
- sc->status.flags = 0;
- sc->status.button = 0;
- sc->status.obutton = 0;
- sc->status.dx = 0;
- sc->status.dy = 0;
- sc->status.dz = 0;
- sc->button = 0;
-
- /* empty input buffer */
- bzero(sc->ipacket, sizeof(sc->ipacket));
- sc->inputbytes = 0;
-
- /* don't let timeout routines in the keyboard driver to poll the kbdc */
- if (!kbdc_lock(sc->kbdc, TRUE))
- return (EIO);
-
- /* save the current controller command byte */
- s = spltty();
- command_byte = get_controller_command_byte(sc->kbdc);
-
- /* enable the aux port and temporalily disable the keyboard */
- if ((command_byte == -1)
- || !set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR; do you know how to get out of this? */
- kbdc_lock(sc->kbdc, FALSE);
- splx(s);
- log(LOG_ERR, "psm%d: unable to set the command byte (psmopen).\n",
- unit);
- return (EIO);
- }
- /*
- * Now that the keyboard controller is told not to generate
- * the keyboard and mouse interrupts, call `splx()' to allow
- * the other tty interrupts. The clock interrupt may also occur,
- * but timeout routines will be blocked by the poll flag set
- * via `kbdc_lock()'
- */
- splx(s);
-
- /* enable the mouse device */
- err = doopen(unit, command_byte);
-
- /* done */
- if (err == 0)
- sc->state |= PSM_OPEN;
- kbdc_lock(sc->kbdc, FALSE);
- return (err);
-}
-
-static int
-psmclose(dev_t dev, int flag, int fmt, struct proc *p)
-{
- int unit = PSM_UNIT(dev);
- struct psm_softc *sc = PSM_SOFTC(unit);
- int stat[3];
- int command_byte;
- int s;
-
- /* don't let timeout routines in the keyboard driver to poll the kbdc */
- if (!kbdc_lock(sc->kbdc, TRUE))
- return (EIO);
-
- /* save the current controller command byte */
- s = spltty();
- command_byte = get_controller_command_byte(sc->kbdc);
- if (command_byte == -1) {
- kbdc_lock(sc->kbdc, FALSE);
- splx(s);
- return (EIO);
- }
-
- /* disable the aux interrupt and temporalily disable the keyboard */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- log(LOG_ERR, "psm%d: failed to disable the aux int (psmclose).\n",
- PSM_UNIT(dev));
- /* CONTROLLER ERROR;
- * NOTE: we shall force our way through. Because the only
- * ill effect we shall see is that we may not be able
- * to read ACK from the mouse, and it doesn't matter much
- * so long as the mouse will accept the DISABLE command.
- */
- }
- splx(s);
-
- /* remove anything left in the output buffer */
- empty_aux_buffer(sc->kbdc, 10);
-
- /* disable the aux device, port and interrupt */
- if (sc->state & PSM_VALID) {
- if (!disable_aux_dev(sc->kbdc)) {
- /* MOUSE ERROR;
- * NOTE: we don't return error and continue, pretending
- * we have successfully disabled the device. It's OK because
- * the interrupt routine will discard any data from the mouse
- * hereafter.
- */
- log(LOG_ERR, "psm%d: failed to disable the device (psmclose).\n",
- PSM_UNIT(dev));
- }
-
- if (get_mouse_status(sc->kbdc, stat, 0, 3) < 3)
- log(LOG_DEBUG, "psm%d: failed to get status (psmclose).\n",
- PSM_UNIT(dev));
- }
-
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- (command_byte & KBD_KBD_CONTROL_BITS)
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR;
- * we shall ignore this error; see the above comment.
- */
- log(LOG_ERR, "psm%d: failed to disable the aux port (psmclose).\n",
- PSM_UNIT(dev));
- }
-
- /* remove anything left in the output buffer */
- empty_aux_buffer(sc->kbdc, 10);
-
- /* close is almost always successful */
- sc->state &= ~PSM_OPEN;
- kbdc_lock(sc->kbdc, FALSE);
- device_unbusy(devclass_get_device(psm_devclass, unit));
- return (0);
-}
-
-static int
-tame_mouse(struct psm_softc *sc, mousestatus_t *status, unsigned char *buf)
-{
- static unsigned char butmapps2[8] = {
- 0,
- MOUSE_PS2_BUTTON1DOWN,
- MOUSE_PS2_BUTTON2DOWN,
- MOUSE_PS2_BUTTON1DOWN | MOUSE_PS2_BUTTON2DOWN,
- MOUSE_PS2_BUTTON3DOWN,
- MOUSE_PS2_BUTTON1DOWN | MOUSE_PS2_BUTTON3DOWN,
- MOUSE_PS2_BUTTON2DOWN | MOUSE_PS2_BUTTON3DOWN,
- MOUSE_PS2_BUTTON1DOWN | MOUSE_PS2_BUTTON2DOWN | MOUSE_PS2_BUTTON3DOWN,
- };
- static unsigned char butmapmsc[8] = {
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON3UP,
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP,
- MOUSE_MSC_BUTTON2UP,
- MOUSE_MSC_BUTTON1UP,
- 0,
- };
- int mapped;
- int i;
-
- if (sc->mode.level == PSM_LEVEL_BASE) {
- mapped = status->button & ~MOUSE_BUTTON4DOWN;
- if (status->button & MOUSE_BUTTON4DOWN)
- mapped |= MOUSE_BUTTON1DOWN;
- status->button = mapped;
- buf[0] = MOUSE_PS2_SYNC | butmapps2[mapped & MOUSE_STDBUTTONS];
- i = max(min(status->dx, 255), -256);
- if (i < 0)
- buf[0] |= MOUSE_PS2_XNEG;
- buf[1] = i;
- i = max(min(status->dy, 255), -256);
- if (i < 0)
- buf[0] |= MOUSE_PS2_YNEG;
- buf[2] = i;
- return MOUSE_PS2_PACKETSIZE;
- } else if (sc->mode.level == PSM_LEVEL_STANDARD) {
- buf[0] = MOUSE_MSC_SYNC | butmapmsc[status->button & MOUSE_STDBUTTONS];
- i = max(min(status->dx, 255), -256);
- buf[1] = i >> 1;
- buf[3] = i - buf[1];
- i = max(min(status->dy, 255), -256);
- buf[2] = i >> 1;
- buf[4] = i - buf[2];
- i = max(min(status->dz, 127), -128);
- buf[5] = (i >> 1) & 0x7f;
- buf[6] = (i - (i >> 1)) & 0x7f;
- buf[7] = (~status->button >> 3) & 0x7f;
- return MOUSE_SYS_PACKETSIZE;
- }
- return sc->inputbytes;;
-}
-
-static int
-psmread(dev_t dev, struct uio *uio, int flag)
-{
- register struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
- unsigned char buf[PSM_SMALLBUFSIZE];
- int error = 0;
- int s;
- int l;
-
- if ((sc->state & PSM_VALID) == 0)
- return EIO;
-
- /* block until mouse activity occured */
- s = spltty();
- while (sc->queue.count <= 0) {
- if (PSM_NBLOCKIO(dev)) {
- splx(s);
- return EWOULDBLOCK;
- }
- sc->state |= PSM_ASLP;
- error = tsleep((caddr_t) sc, PZERO | PCATCH, "psmrea", 0);
- sc->state &= ~PSM_ASLP;
- if (error) {
- splx(s);
- return error;
- } else if ((sc->state & PSM_VALID) == 0) {
- /* the device disappeared! */
- splx(s);
- return EIO;
- }
- }
- splx(s);
-
- /* copy data to the user land */
- while ((sc->queue.count > 0) && (uio->uio_resid > 0)) {
- s = spltty();
- l = min(sc->queue.count, uio->uio_resid);
- if (l > sizeof(buf))
- l = sizeof(buf);
- if (l > sizeof(sc->queue.buf) - sc->queue.head) {
- bcopy(&sc->queue.buf[sc->queue.head], &buf[0],
- sizeof(sc->queue.buf) - sc->queue.head);
- bcopy(&sc->queue.buf[0],
- &buf[sizeof(sc->queue.buf) - sc->queue.head],
- l - (sizeof(sc->queue.buf) - sc->queue.head));
- } else {
- bcopy(&sc->queue.buf[sc->queue.head], &buf[0], l);
- }
- sc->queue.count -= l;
- sc->queue.head = (sc->queue.head + l) % sizeof(sc->queue.buf);
- splx(s);
- error = uiomove(buf, l, uio);
- if (error)
- break;
- }
-
- return error;
-}
-
-static int
-block_mouse_data(struct psm_softc *sc, int *c)
-{
- int s;
-
- if (!kbdc_lock(sc->kbdc, TRUE))
- return EIO;
-
- s = spltty();
- *c = get_controller_command_byte(sc->kbdc);
- if ((*c == -1)
- || !set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* this is CONTROLLER ERROR */
- splx(s);
- kbdc_lock(sc->kbdc, FALSE);
- return EIO;
- }
-
- /*
- * The device may be in the middle of status data transmission.
- * The transmission will be interrupted, thus, incomplete status
- * data must be discarded. Although the aux interrupt is disabled
- * at the keyboard controller level, at most one aux interrupt
- * may have already been pending and a data byte is in the
- * output buffer; throw it away. Note that the second argument
- * to `empty_aux_buffer()' is zero, so that the call will just
- * flush the internal queue.
- * `psmintr()' will be invoked after `splx()' if an interrupt is
- * pending; it will see no data and returns immediately.
- */
- empty_aux_buffer(sc->kbdc, 0); /* flush the queue */
- read_aux_data_no_wait(sc->kbdc); /* throw away data if any */
- sc->inputbytes = 0;
- splx(s);
-
- return 0;
-}
-
-static int
-unblock_mouse_data(struct psm_softc *sc, int c)
-{
- int error = 0;
-
- /*
- * We may have seen a part of status data during `set_mouse_XXX()'.
- * they have been queued; flush it.
- */
- empty_aux_buffer(sc->kbdc, 0);
-
- /* restore ports and interrupt */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
- /* CONTROLLER ERROR; this is serious, we may have
- * been left with the inaccessible keyboard and
- * the disabled mouse interrupt.
- */
- error = EIO;
- }
-
- kbdc_lock(sc->kbdc, FALSE);
- return error;
-}
-
-static int
-psmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
-{
- struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
- mousemode_t mode;
- mousestatus_t status;
-#if (defined(MOUSE_GETVARS))
- mousevar_t *var;
-#endif
- mousedata_t *data;
- int stat[3];
- int command_byte;
- int error = 0;
- int s;
-
- /* Perform IOCTL command */
- switch (cmd) {
-
- case OLD_MOUSE_GETHWINFO:
- s = spltty();
- ((old_mousehw_t *)addr)->buttons = sc->hw.buttons;
- ((old_mousehw_t *)addr)->iftype = sc->hw.iftype;
- ((old_mousehw_t *)addr)->type = sc->hw.type;
- ((old_mousehw_t *)addr)->hwid = sc->hw.hwid;
- splx(s);
- break;
-
- case MOUSE_GETHWINFO:
- s = spltty();
- *(mousehw_t *)addr = sc->hw;
- if (sc->mode.level == PSM_LEVEL_BASE)
- ((mousehw_t *)addr)->model = MOUSE_MODEL_GENERIC;
- splx(s);
- break;
-
- case OLD_MOUSE_GETMODE:
- s = spltty();
- switch (sc->mode.level) {
- case PSM_LEVEL_BASE:
- ((old_mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- break;
- case PSM_LEVEL_STANDARD:
- ((old_mousemode_t *)addr)->protocol = MOUSE_PROTO_SYSMOUSE;
- break;
- case PSM_LEVEL_NATIVE:
- ((old_mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- break;
- }
- ((old_mousemode_t *)addr)->rate = sc->mode.rate;
- ((old_mousemode_t *)addr)->resolution = sc->mode.resolution;
- ((old_mousemode_t *)addr)->accelfactor = sc->mode.accelfactor;
- splx(s);
- break;
-
- case MOUSE_GETMODE:
- s = spltty();
- *(mousemode_t *)addr = sc->mode;
- ((mousemode_t *)addr)->resolution =
- MOUSE_RES_LOW - sc->mode.resolution;
- switch (sc->mode.level) {
- case PSM_LEVEL_BASE:
- ((mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- ((mousemode_t *)addr)->packetsize = MOUSE_PS2_PACKETSIZE;
- break;
- case PSM_LEVEL_STANDARD:
- ((mousemode_t *)addr)->protocol = MOUSE_PROTO_SYSMOUSE;
- ((mousemode_t *)addr)->packetsize = MOUSE_SYS_PACKETSIZE;
- ((mousemode_t *)addr)->syncmask[0] = MOUSE_SYS_SYNCMASK;
- ((mousemode_t *)addr)->syncmask[1] = MOUSE_SYS_SYNC;
- break;
- case PSM_LEVEL_NATIVE:
- /* FIXME: this isn't quite correct... XXX */
- ((mousemode_t *)addr)->protocol = MOUSE_PROTO_PS2;
- break;
- }
- splx(s);
- break;
-
- case OLD_MOUSE_SETMODE:
- case MOUSE_SETMODE:
- if (cmd == OLD_MOUSE_SETMODE) {
- mode.rate = ((old_mousemode_t *)addr)->rate;
- /*
- * resolution old I/F new I/F
- * default 0 0
- * low 1 -2
- * medium low 2 -3
- * medium high 3 -4
- * high 4 -5
- */
- if (((old_mousemode_t *)addr)->resolution > 0)
- mode.resolution = -((old_mousemode_t *)addr)->resolution - 1;
- mode.accelfactor = ((old_mousemode_t *)addr)->accelfactor;
- mode.level = -1;
- } else {
- mode = *(mousemode_t *)addr;
- }
-
- /* adjust and validate parameters. */
- if (mode.rate > UCHAR_MAX)
- return EINVAL;
- if (mode.rate == 0)
- mode.rate = sc->dflt_mode.rate;
- else if (mode.rate == -1)
- /* don't change the current setting */
- ;
- else if (mode.rate < 0)
- return EINVAL;
- if (mode.resolution >= UCHAR_MAX)
- return EINVAL;
- if (mode.resolution >= 200)
- mode.resolution = MOUSE_RES_HIGH;
- else if (mode.resolution >= 100)
- mode.resolution = MOUSE_RES_MEDIUMHIGH;
- else if (mode.resolution >= 50)
- mode.resolution = MOUSE_RES_MEDIUMLOW;
- else if (mode.resolution > 0)
- mode.resolution = MOUSE_RES_LOW;
- if (mode.resolution == MOUSE_RES_DEFAULT)
- mode.resolution = sc->dflt_mode.resolution;
- else if (mode.resolution == -1)
- /* don't change the current setting */
- ;
- else if (mode.resolution < 0) /* MOUSE_RES_LOW/MEDIUM/HIGH */
- mode.resolution = MOUSE_RES_LOW - mode.resolution;
- if (mode.level == -1)
- /* don't change the current setting */
- mode.level = sc->mode.level;
- else if ((mode.level < PSM_LEVEL_MIN) || (mode.level > PSM_LEVEL_MAX))
- return EINVAL;
- if (mode.accelfactor == -1)
- /* don't change the current setting */
- mode.accelfactor = sc->mode.accelfactor;
- else if (mode.accelfactor < 0)
- return EINVAL;
-
- /* don't allow anybody to poll the keyboard controller */
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
-
- /* set mouse parameters */
- if (mode.rate > 0)
- mode.rate = set_mouse_sampling_rate(sc->kbdc, mode.rate);
- if (mode.resolution >= 0)
- mode.resolution = set_mouse_resolution(sc->kbdc, mode.resolution);
- set_mouse_scaling(sc->kbdc, 1);
- get_mouse_status(sc->kbdc, stat, 0, 3);
-
- s = spltty();
- sc->mode.rate = mode.rate;
- sc->mode.resolution = mode.resolution;
- sc->mode.accelfactor = mode.accelfactor;
- sc->mode.level = mode.level;
- splx(s);
-
- unblock_mouse_data(sc, command_byte);
- break;
-
- case MOUSE_GETLEVEL:
- *(int *)addr = sc->mode.level;
- break;
-
- case MOUSE_SETLEVEL:
- if ((*(int *)addr < PSM_LEVEL_MIN) || (*(int *)addr > PSM_LEVEL_MAX))
- return EINVAL;
- sc->mode.level = *(int *)addr;
- break;
-
- case MOUSE_GETSTATUS:
- s = spltty();
- status = sc->status;
- sc->status.flags = 0;
- sc->status.obutton = sc->status.button;
- sc->status.button = 0;
- sc->status.dx = 0;
- sc->status.dy = 0;
- sc->status.dz = 0;
- splx(s);
- *(mousestatus_t *)addr = status;
- break;
-
-#if (defined(MOUSE_GETVARS))
- case MOUSE_GETVARS:
- var = (mousevar_t *)addr;
- bzero(var, sizeof(*var));
- s = spltty();
- var->var[0] = MOUSE_VARS_PS2_SIG;
- var->var[1] = sc->config;
- var->var[2] = sc->flags;
- splx(s);
- break;
-
- case MOUSE_SETVARS:
- return ENODEV;
-#endif /* MOUSE_GETVARS */
-
- case MOUSE_READSTATE:
- case MOUSE_READDATA:
- data = (mousedata_t *)addr;
- if (data->len > sizeof(data->buf)/sizeof(data->buf[0]))
- return EINVAL;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- if ((data->len = get_mouse_status(sc->kbdc, data->buf,
- (cmd == MOUSE_READDATA) ? 1 : 0, data->len)) <= 0)
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-
-#if (defined(MOUSE_SETRESOLUTION))
- case MOUSE_SETRESOLUTION:
- mode.resolution = *(int *)addr;
- if (mode.resolution >= UCHAR_MAX)
- return EINVAL;
- else if (mode.resolution >= 200)
- mode.resolution = MOUSE_RES_HIGH;
- else if (mode.resolution >= 100)
- mode.resolution = MOUSE_RES_MEDIUMHIGH;
- else if (mode.resolution >= 50)
- mode.resolution = MOUSE_RES_MEDIUMLOW;
- else if (mode.resolution > 0)
- mode.resolution = MOUSE_RES_LOW;
- if (mode.resolution == MOUSE_RES_DEFAULT)
- mode.resolution = sc->dflt_mode.resolution;
- else if (mode.resolution == -1)
- mode.resolution = sc->mode.resolution;
- else if (mode.resolution < 0) /* MOUSE_RES_LOW/MEDIUM/HIGH */
- mode.resolution = MOUSE_RES_LOW - mode.resolution;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- sc->mode.resolution = set_mouse_resolution(sc->kbdc, mode.resolution);
- if (sc->mode.resolution != mode.resolution)
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_SETRESOLUTION */
-
-#if (defined(MOUSE_SETRATE))
- case MOUSE_SETRATE:
- mode.rate = *(int *)addr;
- if (mode.rate > UCHAR_MAX)
- return EINVAL;
- if (mode.rate == 0)
- mode.rate = sc->dflt_mode.rate;
- else if (mode.rate < 0)
- mode.rate = sc->mode.rate;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- sc->mode.rate = set_mouse_sampling_rate(sc->kbdc, mode.rate);
- if (sc->mode.rate != mode.rate)
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_SETRATE */
-
-#if (defined(MOUSE_SETSCALING))
- case MOUSE_SETSCALING:
- if ((*(int *)addr <= 0) || (*(int *)addr > 2))
- return EINVAL;
-
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- if (!set_mouse_scaling(sc->kbdc, *(int *)addr))
- error = EIO;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_SETSCALING */
-
-#if (defined(MOUSE_GETHWID))
- case MOUSE_GETHWID:
- error = block_mouse_data(sc, &command_byte);
- if (error)
- return error;
- sc->hw.hwid = get_aux_id(sc->kbdc);
- *(int *)addr = sc->hw.hwid;
- unblock_mouse_data(sc, command_byte);
- break;
-#endif /* MOUSE_GETHWID */
-
- default:
- return ENOTTY;
- }
-
- return error;
-}
-
-static void
-psmintr(void *arg)
-{
- /*
- * the table to turn PS/2 mouse button bits (MOUSE_PS2_BUTTON?DOWN)
- * into `mousestatus' button bits (MOUSE_BUTTON?DOWN).
- */
- static int butmap[8] = {
- 0,
- MOUSE_BUTTON1DOWN,
- MOUSE_BUTTON3DOWN,
- MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN,
- MOUSE_BUTTON2DOWN,
- MOUSE_BUTTON1DOWN | MOUSE_BUTTON2DOWN,
- MOUSE_BUTTON2DOWN | MOUSE_BUTTON3DOWN,
- MOUSE_BUTTON1DOWN | MOUSE_BUTTON2DOWN | MOUSE_BUTTON3DOWN
- };
- register struct psm_softc *sc = arg;
- mousestatus_t ms;
- int x, y, z;
- int c;
- int l;
-
- /* read until there is nothing to read */
- while((c = read_aux_data_no_wait(sc->kbdc)) != -1) {
-
- /* discard the byte if the device is not open */
- if ((sc->state & PSM_OPEN) == 0)
- continue;
-
- /*
- * Check sync bits. We check for overflow bits and the bit 3
- * for most mice. True, the code doesn't work if overflow
- * condition occurs. But we expect it rarely happens...
- */
- if ((sc->inputbytes == 0)
- && ((c & sc->mode.syncmask[0]) != sc->mode.syncmask[1])) {
- log(LOG_DEBUG, "psmintr: out of sync (%04x != %04x).\n",
- c & sc->mode.syncmask[0], sc->mode.syncmask[1]);
- continue;
- }
-
- sc->ipacket[sc->inputbytes++] = c;
- if (sc->inputbytes < sc->mode.packetsize)
- continue;
-
-#if 0
- log(LOG_DEBUG, "psmintr: %02x %02x %02x %02x %02x %02x\n",
- sc->ipacket[0], sc->ipacket[1], sc->ipacket[2],
- sc->ipacket[3], sc->ipacket[4], sc->ipacket[5]);
-#endif
-
- c = sc->ipacket[0];
-
- /*
- * A kludge for Kensington device!
- * The MSB of the horizontal count appears to be stored in
- * a strange place. This kludge doesn't affect other mice
- * because the bit is the overflow bit which is, in most cases,
- * expected to be zero when we reach here. XXX
- */
- sc->ipacket[1] |= (c & MOUSE_PS2_XOVERFLOW) ? 0x80 : 0;
-
- /* ignore the overflow bits... */
- x = (c & MOUSE_PS2_XNEG) ? sc->ipacket[1] - 256 : sc->ipacket[1];
- y = (c & MOUSE_PS2_YNEG) ? sc->ipacket[2] - 256 : sc->ipacket[2];
- z = 0;
- ms.obutton = sc->button; /* previous button state */
- ms.button = butmap[c & MOUSE_PS2_BUTTONS];
-
- switch (sc->hw.model) {
-
- case MOUSE_MODEL_INTELLI:
- case MOUSE_MODEL_NET:
- /* wheel data is in the fourth byte */
- z = (char)sc->ipacket[3];
- break;
-
- case MOUSE_MODEL_MOUSEMANPLUS:
- if ((c & ~MOUSE_PS2_BUTTONS) == 0xc8) {
- /* the extended data packet encodes button and wheel events */
- x = y = 0;
- z = (sc->ipacket[1] & MOUSE_PS2PLUS_ZNEG)
- ? (sc->ipacket[2] & 0x0f) - 16 : (sc->ipacket[2] & 0x0f);
- ms.button |= (sc->ipacket[2] & MOUSE_PS2PLUS_BUTTON4DOWN)
- ? MOUSE_BUTTON4DOWN : 0;
- } else {
- /* preserve button states */
- ms.button |= ms.obutton & MOUSE_EXTBUTTONS;
- }
- break;
-
- case MOUSE_MODEL_GLIDEPOINT:
- /* `tapping' action */
- ms.button |= ((c & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN;
- break;
-
- case MOUSE_MODEL_NETSCROLL:
- /* three addtional bytes encode button and wheel events */
- ms.button |= (sc->ipacket[3] & MOUSE_PS2_BUTTON3DOWN)
- ? MOUSE_BUTTON4DOWN : 0;
- z = (sc->ipacket[3] & MOUSE_PS2_XNEG)
- ? sc->ipacket[4] - 256 : sc->ipacket[4];
- break;
-
- case MOUSE_MODEL_THINK:
- /* the fourth button state in the first byte */
- ms.button |= (c & MOUSE_PS2_TAP) ? MOUSE_BUTTON4DOWN : 0;
- break;
-
- case MOUSE_MODEL_GENERIC:
- default:
- break;
- }
-
- /* scale values */
- if (sc->mode.accelfactor >= 1) {
- if (x != 0) {
- x = x * x / sc->mode.accelfactor;
- if (x == 0)
- x = 1;
- if (c & MOUSE_PS2_XNEG)
- x = -x;
- }
- if (y != 0) {
- y = y * y / sc->mode.accelfactor;
- if (y == 0)
- y = 1;
- if (c & MOUSE_PS2_YNEG)
- y = -y;
- }
- }
-
- ms.dx = x;
- ms.dy = y;
- ms.dz = z;
- ms.flags = ((x || y || z) ? MOUSE_POSCHANGED : 0)
- | (ms.obutton ^ ms.button);
-
- if (sc->mode.level < PSM_LEVEL_NATIVE)
- sc->inputbytes = tame_mouse(sc, &ms, sc->ipacket);
-
- sc->status.flags |= ms.flags;
- sc->status.dx += ms.dx;
- sc->status.dy += ms.dy;
- sc->status.dz += ms.dz;
- sc->status.button = ms.button;
- sc->button = ms.button;
-
- /* queue data */
- if (sc->queue.count + sc->inputbytes < sizeof(sc->queue.buf)) {
- l = min(sc->inputbytes, sizeof(sc->queue.buf) - sc->queue.tail);
- bcopy(&sc->ipacket[0], &sc->queue.buf[sc->queue.tail], l);
- if (sc->inputbytes > l)
- bcopy(&sc->ipacket[l], &sc->queue.buf[0], sc->inputbytes - l);
- sc->queue.tail =
- (sc->queue.tail + sc->inputbytes) % sizeof(sc->queue.buf);
- sc->queue.count += sc->inputbytes;
- }
- sc->inputbytes = 0;
-
- if (sc->state & PSM_ASLP) {
- sc->state &= ~PSM_ASLP;
- wakeup((caddr_t) sc);
- }
- selwakeup(&sc->rsel);
- }
-}
-
-static int
-psmpoll(dev_t dev, int events, struct proc *p)
-{
- struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
- int s;
- int revents = 0;
-
- /* Return true if a mouse event available */
- s = spltty();
- if (events & (POLLIN | POLLRDNORM))
- if (sc->queue.count > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->rsel);
-
- splx(s);
-
- return (revents);
-}
-
-/* vendor/model specific routines */
-
-static int mouse_id_proc1(KBDC kbdc, int res, int scale, int *status)
-{
- if (set_mouse_resolution(kbdc, res) != res)
- return FALSE;
- if (set_mouse_scaling(kbdc, scale)
- && set_mouse_scaling(kbdc, scale)
- && set_mouse_scaling(kbdc, scale)
- && (get_mouse_status(kbdc, status, 0, 3) >= 3))
- return TRUE;
- return FALSE;
-}
-
-#if notyet
-/* Logitech MouseMan Cordless II */
-static int
-enable_lcordless(struct psm_softc *sc)
-{
- int status[3];
- int ch;
-
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_HIGH, 2, status))
- return FALSE;
- if (status[1] == PSMD_RES_HIGH)
- return FALSE;
- ch = (status[0] & 0x07) - 1; /* channel # */
- if ((ch <= 0) || (ch > 4))
- return FALSE;
- /*
- * status[1]: always one?
- * status[2]: battery status? (0-100)
- */
- return TRUE;
-}
-#endif /* notyet */
-
-/* Genius NetScroll Mouse */
-static int
-enable_groller(struct psm_softc *sc)
-{
- int status[3];
-
- /*
- * The special sequence to enable the fourth button and the
- * roller. Immediately after this sequence check status bytes.
- * if the mouse is NetScroll, the second and the third bytes are
- * '3' and 'D'.
- */
-
- /*
- * If the mouse is an ordinary PS/2 mouse, the status bytes should
- * look like the following.
- *
- * byte 1 bit 7 always 0
- * bit 6 stream mode (0)
- * bit 5 disabled (0)
- * bit 4 1:1 scaling (0)
- * bit 3 always 0
- * bit 0-2 button status
- * byte 2 resolution (PSMD_RES_HIGH)
- * byte 3 report rate (?)
- */
-
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_HIGH, 1, status))
- return FALSE;
- if ((status[1] != '3') || (status[2] != 'D'))
- return FALSE;
- /* FIXME!! */
- sc->hw.buttons = get_mouse_buttons(sc->kbdc);
- sc->hw.buttons = 4;
- return TRUE;
-}
-
-/* Genius NetMouse/NetMouse Pro */
-static int
-enable_gmouse(struct psm_softc *sc)
-{
- int status[3];
-
- /*
- * The special sequence to enable the middle, "rubber" button.
- * Immediately after this sequence check status bytes.
- * if the mouse is NetMouse, NetMouse Pro, or ASCII MIE Mouse,
- * the second and the third bytes are '3' and 'U'.
- * NOTE: NetMouse reports that it has three buttons although it has
- * two buttons and a rubber button. NetMouse Pro and MIE Mouse
- * say they have three buttons too and they do have a button on the
- * side...
- */
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_HIGH, 1, status))
- return FALSE;
- if ((status[1] != '3') || (status[2] != 'U'))
- return FALSE;
- return TRUE;
-}
-
-/* ALPS GlidePoint */
-static int
-enable_aglide(struct psm_softc *sc)
-{
- int status[3];
-
- /*
- * The special sequence to obtain ALPS GlidePoint specific
- * information. Immediately after this sequence, status bytes will
- * contain something interesting.
- * NOTE: ALPS produces several models of GlidePoint. Some of those
- * do not respond to this sequence, thus, cannot be detected this way.
- */
- if (!mouse_id_proc1(sc->kbdc, PSMD_RES_LOW, 2, status))
- return FALSE;
- if ((status[0] & 0x10) || (status[1] == PSMD_RES_LOW))
- return FALSE;
- return TRUE;
-}
-
-/* Kensington ThinkingMouse/Trackball */
-static int
-enable_kmouse(struct psm_softc *sc)
-{
- static unsigned char rate[] = { 20, 60, 40, 20, 20, 60, 40, 20, 20 };
- KBDC kbdc = sc->kbdc;
- int status[3];
- int id1;
- int id2;
- int i;
-
- id1 = get_aux_id(kbdc);
- if (set_mouse_sampling_rate(kbdc, 10) != 10)
- return FALSE;
- /*
- * The device is now in the native mode? It returns a different
- * ID value...
- */
- id2 = get_aux_id(kbdc);
- if ((id1 == id2) || (id2 != 2))
- return FALSE;
-
- if (set_mouse_resolution(kbdc, PSMD_RES_LOW) != PSMD_RES_LOW)
- return FALSE;
-#if PSM_DEBUG >= 2
- /* at this point, resolution is LOW, sampling rate is 10/sec */
- if (get_mouse_status(kbdc, status, 0, 3) < 3)
- return FALSE;
-#endif
-
- /*
- * The special sequence to enable the third and fourth buttons.
- * Otherwise they behave like the first and second buttons.
- */
- for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) {
- if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i])
- return FALSE;
- }
-
- /*
- * At this point, the device is using default resolution and
- * sampling rate for the native mode.
- */
- if (get_mouse_status(kbdc, status, 0, 3) < 3)
- return FALSE;
- if ((status[1] == PSMD_RES_LOW) || (status[2] == rate[i - 1]))
- return FALSE;
-
- /* the device appears be enabled by this sequence, diable it for now */
- disable_aux_dev(kbdc);
- empty_aux_buffer(kbdc, 5);
-
- return TRUE;
-}
-
-/* Logitech MouseMan+/FirstMouse+ */
-static int
-enable_mmanplus(struct psm_softc *sc)
-{
- static char res[] = {
- -1, PSMD_RES_LOW, PSMD_RES_HIGH, PSMD_RES_MEDIUM_HIGH,
- PSMD_RES_MEDIUM_LOW, -1, PSMD_RES_HIGH, PSMD_RES_MEDIUM_LOW,
- PSMD_RES_MEDIUM_HIGH, PSMD_RES_HIGH,
- };
- KBDC kbdc = sc->kbdc;
- int data[3];
- int i;
-
- /* the special sequence to enable the fourth button and the roller. */
- for (i = 0; i < sizeof(res)/sizeof(res[0]); ++i) {
- if (res[i] < 0) {
- if (!set_mouse_scaling(kbdc, 1))
- return FALSE;
- } else {
- if (set_mouse_resolution(kbdc, res[i]) != res[i])
- return FALSE;
- }
- }
-
- if (get_mouse_status(kbdc, data, 1, 3) < 3)
- return FALSE;
-
- /*
- * MouseMan+ and FirstMouse+ return following data.
- *
- * byte 1 0xc8
- * byte 2 ?? (MouseMan+:0xc2, FirstMouse+:0xc6)
- * byte 3 model ID? MouseMan+:0x50, FirstMouse+:0x51
- */
- if ((data[0] & ~MOUSE_PS2_BUTTONS) != 0xc8)
- return FALSE;
-
- /*
- * MouseMan+ (or FirstMouse+) is now in its native mode, in which
- * the wheel and the fourth button events are encoded in the
- * special data packet. The mouse may be put in the IntelliMouse mode
- * if it is initialized by the IntelliMouse's method.
- */
- return TRUE;
-}
-
-/* MS IntelliMouse */
-static int
-enable_msintelli(struct psm_softc *sc)
-{
- /*
- * Logitech MouseMan+ and FirstMouse+ will also respond to this
- * probe routine and act like IntelliMouse.
- */
-
- static unsigned char rate[] = { 200, 100, 80, };
- KBDC kbdc = sc->kbdc;
- int id;
- int i;
-
- /* the special sequence to enable the third button and the roller. */
- for (i = 0; i < sizeof(rate)/sizeof(rate[0]); ++i) {
- if (set_mouse_sampling_rate(kbdc, rate[i]) != rate[i])
- return FALSE;
- }
- /* the device will give the genuine ID only after the above sequence */
- id = get_aux_id(kbdc);
- if (id != PSM_INTELLI_ID)
- return FALSE;
-
- sc->hw.hwid = id;
- sc->hw.buttons = 3;
-
- return TRUE;
-}
-
-#ifdef PSM_HOOKAPM
-static int
-psmresume(void *dummy)
-{
- struct psm_softc *sc = psm_softc[(int)dummy];
- int unit = (int)dummy;
- int err = 0;
- int s;
- int c;
-
- if (verbose >= 2)
- log(LOG_NOTICE, "psm%d: APM resume hook called.\n", unit);
-
- /* don't let anybody mess with the aux device */
- if (!kbdc_lock(sc->kbdc, TRUE))
- return (EIO);
- s = spltty();
-
- /* save the current controller command byte */
- empty_both_buffers(sc->kbdc, 10);
- c = get_controller_command_byte(sc->kbdc);
- if (verbose >= 2)
- log(LOG_DEBUG, "psm%d: current command byte: %04x (psmresume).\n",
- unit, c);
-
- /* enable the aux port but disable the aux interrupt and the keyboard */
- if ((c == -1) || !set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
- | KBD_ENABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- splx(s);
- kbdc_lock(sc->kbdc, FALSE);
- log(LOG_ERR, "psm%d: unable to set the command byte (psmresume).\n",
- unit);
- return (EIO);
- }
-
- /* flush any data */
- if (sc->state & PSM_VALID) {
- disable_aux_dev(sc->kbdc); /* this may fail; but never mind... */
- empty_aux_buffer(sc->kbdc, 10);
- }
- sc->inputbytes = 0;
-
-#ifdef PSM_RESETAFTERSUSPEND
- /* try to detect the aux device; are you still there? */
- if (reinitialize(unit, &sc->mode)) {
- /* yes */
- sc->state |= PSM_VALID;
- } else {
- /* the device has gone! */
- restore_controller(sc->kbdc, c);
- sc->state &= ~PSM_VALID;
- log(LOG_ERR, "psm%d: the aux device has gone! (psmresume).\n",
- unit);
- err = ENXIO;
- }
-#endif /* PSM_RESETAFTERSUSPEND */
- splx(s);
-
- /* restore the driver state */
- if ((sc->state & PSM_OPEN) && (err == 0)) {
- /* enable the aux device and the port again */
- err = doopen(unit, c);
- if (err != 0)
- log(LOG_ERR, "psm%d: failed to enable the device (psmresume).\n",
- unit);
- } else {
- /* restore the keyboard port and disable the aux port */
- if (!set_controller_command_byte(sc->kbdc,
- kbdc_get_device_mask(sc->kbdc),
- (c & KBD_KBD_CONTROL_BITS)
- | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
- /* CONTROLLER ERROR */
- log(LOG_ERR, "psm%d: failed to disable the aux port (psmresume).\n",
- unit);
- err = EIO;
- }
- }
-
- /* done */
- kbdc_lock(sc->kbdc, FALSE);
- if ((sc->state & PSM_ASLP) && !(sc->state & PSM_VALID)) {
- /*
- * Release the blocked process; it must be notified that the device
- * cannot be accessed anymore.
- */
- sc->state &= ~PSM_ASLP;
- wakeup((caddr_t)sc);
- }
-
- if (verbose >= 2)
- log(LOG_DEBUG, "psm%d: APM resume hook exiting.\n", unit);
-
- return (err);
-}
-#endif /* PSM_HOOKAPM */
-
-CDEV_DRIVER_MODULE(psm, isa, psm_driver, psm_devclass,
- CDEV_MAJOR, psm_cdevsw, 0, 0);
-
-#endif /* NPSM > 0 */
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index 6a2084e6dc81f..d5b48cee1ecba 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sio.c,v 1.219 1998/12/13 23:12:54 steve Exp $
+ * $Id: sio.c,v 1.216 1998/09/26 13:59:26 peter Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.215
*/
@@ -68,7 +68,6 @@
#include <sys/syslog.h>
#include <sys/sysctl.h>
#include <sys/bus.h>
-#include <sys/rman.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif
@@ -79,7 +78,6 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#include <machine/resource.h>
#include <isa/sioreg.h>
@@ -92,7 +90,6 @@
#include "card.h"
#if NCARD > 0
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -495,7 +492,17 @@ static int sioinit __P((struct pccard_devinfo *));
static void siounload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(sio, sioinit, siounload, card_intr, 0, tty_imask);
+static struct pccard_device sio_info = {
+ driver_name,
+ sioinit,
+ siounload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &tty_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, sio_info);
/*
* Initialize the device - called from Slot manager.
@@ -914,8 +921,6 @@ sioattach(dev)
int s;
int unit;
void *ih;
- struct resource *res;
- int zero = 0;
u_int flags = isa_get_flags(dev);
#if 0
@@ -1131,10 +1136,13 @@ determined_type: ;
#endif
com->flags = isa_get_flags(dev); /* Heritate id_flags for later */
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, 0ul, ~0ul, 1,
- RF_SHAREABLE | RF_ACTIVE);
- BUS_SETUP_INTR(device_get_parent(dev), dev, res, siointr, com,
- &ih);
+ ih = BUS_CREATE_INTR(device_get_parent(dev), dev,
+ isa_get_irq(dev),
+ siointr, com);
+ if (!ih)
+ return ENXIO;
+
+ BUS_CONNECT_INTR(device_get_parent(dev), ih);
return (0);
}
@@ -3109,7 +3117,6 @@ static pnpid_t siopnp_ids[] = {
{ 0x7121b04e, "SupraExpress 56i Sp"},
{ 0x11007256, "USR0011"},
{ 0x30207256, "USR2030"},
- { 0x31307256, "USR3031"},
{ 0 }
};
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c
index e44fe37ee3085..6d9f7c9c1b816 100644
--- a/sys/isa/syscons.c
+++ b/sys/isa/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.276 1998/11/08 12:39:04 dfr Exp $
+ * $Id: syscons.c,v 1.273 1998/08/06 09:15:53 dfr Exp $
* from: i386/isa syscons.c,v 1.278
*/
@@ -54,12 +54,10 @@
#include <sys/tty.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-#include <sys/rman.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif
-#include <machine/resource.h>
#include <machine/clock.h>
#include <machine/cons.h>
#include <machine/console.h>
@@ -454,12 +452,12 @@ scprobe(device_t dev)
if (!scvidprobe(device_get_unit(dev), isa_get_flags(dev))) {
if (bootverbose)
printf("sc%d: no video adapter is found.\n", device_get_unit(dev));
- return (ENXIO);
+ return (0);
}
(*biosvidsw.diag)(bootverbose);
#if defined(VESA) && defined(VM86)
if (vesa_load())
- return ENXIO;
+ return FALSE;
(*biosvidsw.diag)(bootverbose);
#endif
@@ -696,8 +694,6 @@ scattach(device_t dev)
int vc;
#endif
void *ih;
- struct resource *res;
- int zero = 0;
scinit();
flags = isa_get_flags(dev);
@@ -775,10 +771,13 @@ scattach(device_t dev)
UID_ROOT, GID_WHEEL, 0600, "consolectl");
#endif
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, 0ul, ~0ul, 1,
- RF_SHAREABLE | RF_ACTIVE);
- BUS_SETUP_INTR(device_get_parent(dev), dev, res, scintr, 0,
- &ih);
+ ih = BUS_CREATE_INTR(device_get_parent(dev), dev,
+ isa_get_irq(dev),
+ scintr, 0);
+ if (!ih)
+ return ENXIO;
+
+ BUS_CONNECT_INTR(device_get_parent(dev), ih);
return 0;
}
@@ -3937,7 +3936,7 @@ next_code:
}
int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
+scmmap(dev_t dev, int offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;
diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c
index edfd66cb61dea..a7a971bffd1f2 100644
--- a/sys/isofs/cd9660/cd9660_node.c
+++ b/sys/isofs/cd9660/cd9660_node.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94
- * $Id: cd9660_node.c,v 1.25 1998/02/09 06:09:18 eivind Exp $
+ * $Id: cd9660_node.c,v 1.24 1998/02/06 12:13:20 eivind Exp $
*/
#include <sys/param.h>
@@ -58,9 +58,7 @@
static struct iso_node **isohashtbl;
static u_long isohash;
#define INOHASH(device, inum) (((device) + ((inum)>>12)) & isohash)
-#ifndef NULL_SIMPLELOCKS
static struct simplelock cd9660_ihash_slock;
-#endif
static void cd9660_ihashrem __P((struct iso_node *));
static unsigned cd9660_chars2ui __P((unsigned char *begin, int len));
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 9e661a6cdf836..fb877ca1a412a 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95
- * $Id: cd9660_vfsops.c,v 1.46 1998/12/06 11:36:24 jkh Exp $
+ * $Id: cd9660_vfsops.c,v 1.43 1998/09/07 13:17:00 bde Exp $
*/
#include <sys/param.h>
@@ -122,13 +122,13 @@ iso_get_ssector(dev, p)
if (ioctlp == NULL)
return 0;
- if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, p) != 0)
+ if (ioctlp(dev, CDIOREADTOCHEADER, (caddr_t)&h, FREAD, p) == -1)
return 0;
for (i = h.ending_track; i >= 0; i--) {
t.address_format = CD_LBA_FORMAT;
t.track = i;
- if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, p) != 0)
+ if (ioctlp(dev, CDIOREADTOCENTRY, (caddr_t)&t, FREAD, p) == -1)
return 0;
if ((t.entry.control & 4) != 0)
/* found a data track */
@@ -141,6 +141,8 @@ iso_get_ssector(dev, p)
return ntohl(t.entry.addr.lba);
}
+#ifndef VFS_LKM /* mount root makes no sense to an LKM */
+
static int iso_mountroot __P((struct mount *mp, struct proc *p));
static int
@@ -166,6 +168,7 @@ iso_mountroot(mp, p)
(void)cd9660_statfs(mp, &mp->mnt_stat, p);
return (0);
}
+#endif /* ! VFS_LKM */
/*
* VFS Operations.
@@ -187,11 +190,13 @@ cd9660_mount(mp, path, data, ndp, p)
mode_t accessmode;
struct iso_mnt *imp = 0;
+#ifndef VFS_LKM /* mount root makes no sense to an LKM */
if ((mp->mnt_flag & MNT_ROOTFS) != 0) {
if (bdevsw[major(rootdev)]->d_flags & D_NOCLUSTERR)
mp->mnt_flag |= MNT_NOCLUSTERR;
return (iso_mountroot(mp, p));
}
+#endif /* ! VFS_LKM */
if ((error = copyin(data, (caddr_t)&args, sizeof (struct iso_args))))
return (error);
@@ -224,8 +229,7 @@ cd9660_mount(mp, path, data, ndp, p)
vrele(devvp);
return ENOTBLK;
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
vrele(devvp);
return ENXIO;
}
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
index fd4f648e002cf..0c75b74b8509f 100644
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -23,10 +23,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: bus_if.m,v 1.4 1998/11/08 18:51:38 nsouch Exp $
+# $Id: bus_if.m,v 1.2 1998/07/12 16:20:51 dfr Exp $
#
-INTERFACE bus;
+INTERFACE bus
#
# This is called from system code which prints out a description of a
@@ -57,7 +57,7 @@ METHOD int read_ivar {
device_t dev;
device_t child;
int index;
- uintptr_t *result;
+ u_long *result;
};
#
@@ -67,75 +67,27 @@ METHOD int write_ivar {
device_t dev;
device_t child;
int index;
- uintptr_t value;
+ u_long value;
};
#
-# Allocate a system resource attached to `dev' on behalf of `child'.
-# The types are defined in <machine/resource.h>; the meaning of the
-# resource-ID field varies from bus to bus (but *rid == 0 is always
-# valid if the resource type is). start and end reflect the allowable
-# range, and should be passed as `0UL' and `~0UL', respectively, if
-# the client has no range restriction. count is the number of consecutive
-# indices in the resource required. flags is a set of sharing flags
-# as defined in <sys/rman.h>.
-#
-# Returns a resource or a null pointer on failure. The caller is
-# responsible for calling rman_activate_resource() when it actually
-# uses the resource.
-#
-METHOD struct resource * alloc_resource {
- device_t dev;
- device_t child;
- int type;
- int *rid;
- u_long start;
- u_long end;
- u_long count;
- u_int flags;
-};
-
-METHOD int activate_resource {
- device_t dev;
- device_t child;
- int type;
- int rid;
- struct resource *r;
-};
-
-METHOD int deactivate_resource {
- device_t dev;
- device_t child;
- int type;
- int rid;
- struct resource *r;
+# Create an interrupt handler for the child device. The handler will
+# be called with the value 'arg' as its only argument. This method
+# does not activate the handler.
+#
+METHOD void* create_intr {
+ device_t dev;
+ device_t child;
+ int irq;
+ driver_intr_t *intr;
+ void *arg;
};
#
-# Free a resource allocated by the preceding method. The `rid' value
-# must be the same as the one returned by BUS_ALLOC_RESOURCE (which
-# is not necessarily the same as the one the client passed).
+# Activate an interrupt handler previously created with
+# BUS_CREATE_INTR.
#
-METHOD int release_resource {
- device_t dev;
- device_t child;
- int type;
- int rid;
- struct resource *res;
-};
-
-METHOD int setup_intr {
- device_t dev;
- device_t child;
- struct resource *irq;
- driver_intr_t *intr;
- void *arg;
- void **cookiep;
-};
-
-METHOD int teardown_intr {
- device_t dev;
- device_t child;
- struct resource *irq;
- void *cookie;
+METHOD int connect_intr {
+ device_t dev;
+ void *ih;
};
diff --git a/sys/kern/device_if.m b/sys/kern/device_if.m
index f429e67759a02..4ae1df86a0db5 100644
--- a/sys/kern/device_if.m
+++ b/sys/kern/device_if.m
@@ -23,10 +23,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: device_if.m,v 1.2 1998/11/08 18:35:53 nsouch Exp $
+# $Id$
#
-INTERFACE device;
+INTERFACE device
#
# Probe to see if the device is present. Return 0 if the device exists,
@@ -67,17 +67,3 @@ METHOD int detach {
METHOD int shutdown {
device_t dev;
};
-
-#
-# This is called by the power-management subsystem when a suspend has been
-# requested by the user or by some automatic mechanism. This gives
-# drivers a chance to veto the suspend or save their configuration before
-# power is removed.
-#
-METHOD int suspend {
- device_t dev;
-};
-
-METHOD int resume {
- device_t dev;
-};
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 9fbd203177dd8..446946e8c58f5 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_aout.c,v 1.43 1998/10/16 03:55:00 peter Exp $
+ * $Id: imgact_aout.c,v 1.42 1998/09/14 05:36:49 jdp Exp $
*/
#include <sys/param.h>
@@ -232,8 +232,8 @@ exec_aout_imgact(imgp)
}
/*
- * Dump core, into a file named as described in the comments for
- * expand_name(), unless the process was setuid/setgid.
+ * Dump core, into a file named "progname.core", unless the process was
+ * setuid/setgid.
*/
int
aout_coredump(p)
@@ -248,6 +248,7 @@ aout_coredump(p)
char *name; /* name of corefile */
STOPEVENT(p, S_CORE, 0);
+
if (sugid_coredump == 0 && p->p_flag & P_SUGID)
return (EFAULT);
if (ctob(UPAGES + vm->vm_dsize + vm->vm_ssize) >=
@@ -256,6 +257,7 @@ aout_coredump(p)
name = expand_name(p->p_comm, p->p_ucred->cr_uid, p->p_pid);
if (name == NULL)
return (EFAULT); /* XXX -- not the best error */
+
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, name, p);
error = vn_open(&nd, O_CREAT | FWRITE, S_IRUSR | S_IWUSR);
free(name, M_TEMP);
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index a0a228466784b..c33c6bea43cb5 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.c,v 1.43 1998/12/04 22:54:51 archie Exp $
+ * $Id: imgact_elf.c,v 1.39 1998/10/15 09:52:19 dfr Exp $
*/
#include "opt_rlimit.h"
@@ -63,25 +63,40 @@
#include <vm/vm_prot.h>
#include <vm/vm_extern.h>
-#include <machine/elf.h>
#include <machine/md_var.h>
-__ElfType(Brandinfo);
-__ElfType(Auxargs);
+#define MAX_PHDR 32 /* XXX enough ? */
+
+#if ELF_TARG_CLASS == ELFCLASS32
+
+#define Elf_Ehdr Elf32_Ehdr
+#define Elf_Phdr Elf32_Phdr
+#define Elf_Auxargs Elf32_Auxargs
+#define Elf_Brandinfo Elf32_Brandinfo
+
+#else
+
+#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Phdr Elf64_Phdr
+#define Elf_Auxargs Elf64_Auxargs
+#define Elf_Brandinfo Elf64_Brandinfo
+
+#endif
+
static int elf_check_header __P((const Elf_Ehdr *hdr, int type));
static int elf_freebsd_fixup __P((long **stack_base,
struct image_params *imgp));
static int elf_load_file __P((struct proc *p, char *file, u_long *addr,
u_long *entry));
-static int elf_load_section __P((struct proc *p,
- struct vmspace *vmspace, struct vnode *vp,
+static int elf_load_section __P((struct vmspace *vmspace, struct vnode *vp,
vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz,
vm_prot_t prot));
static int exec_elf_imgact __P((struct image_params *imgp));
static int elf_trace = 0;
SYSCTL_INT(_debug, OID_AUTO, elf_trace, CTLFLAG_RW, &elf_trace, 0, "");
+#define UPRINTF if (elf_trace) uprintf
static struct sysentvec elf_freebsd_sysvec = {
SYS_MAXSYSCALL,
@@ -148,124 +163,86 @@ elf_remove_brand_entry(Elf_Brandinfo *entry)
static int
elf_check_header(const Elf_Ehdr *hdr, int type)
{
- if (!IS_ELF(*hdr) ||
- hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS ||
- hdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
- hdr->e_ident[EI_VERSION] != EV_CURRENT)
+ if (!(hdr->e_ident[EI_MAG0] == ELFMAG0 &&
+ hdr->e_ident[EI_MAG1] == ELFMAG1 &&
+ hdr->e_ident[EI_MAG2] == ELFMAG2 &&
+ hdr->e_ident[EI_MAG3] == ELFMAG3))
return ENOEXEC;
- if (!ELF_MACHINE_OK(hdr->e_machine))
+#ifdef __i386__
+ if (hdr->e_machine != EM_386 && hdr->e_machine != EM_486)
+#endif
+#ifdef __alpha__
+ if (hdr->e_machine != EM_ALPHA)
+#endif
return ENOEXEC;
- if (hdr->e_type != type || hdr->e_version != ELF_TARG_VER)
+
+ if (hdr->e_type != type)
return ENOEXEC;
return 0;
}
static int
-elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot)
+elf_load_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot)
{
size_t map_len;
vm_offset_t map_addr;
- int error, rv;
+ int error;
+ unsigned char *data_buf = 0;
size_t copy_len;
- vm_object_t object;
- vm_offset_t file_addr;
- vm_offset_t data_buf = 0;
-
- object = vp->v_object;
- error = 0;
map_addr = trunc_page((vm_offset_t)vmaddr);
- file_addr = trunc_page(offset);
- /*
- * We have two choices. We can either clear the data in the last page
- * of an oversized mapping, or we can start the anon mapping a page
- * early and copy the initialized data into that first page. We
- * choose the second..
- */
if (memsz > filsz)
- map_len = trunc_page(offset+filsz) - file_addr;
+ map_len = trunc_page(offset+filsz) - trunc_page(offset);
else
- map_len = round_page(offset+filsz) - file_addr;
-
- if (map_len != 0) {
- vm_object_reference(object);
- vm_map_lock(&vmspace->vm_map);
- rv = vm_map_insert(&vmspace->vm_map,
- object,
- file_addr, /* file offset */
- map_addr, /* virtual start */
- map_addr + map_len,/* virtual end */
- prot,
- VM_PROT_ALL,
- MAP_COPY_NEEDED | MAP_COPY_ON_WRITE);
- vm_map_unlock(&vmspace->vm_map);
- if (rv != KERN_SUCCESS)
- return EINVAL;
-
- /* prefault the page tables */
- pmap_object_init_pt(&vmspace->vm_pmap,
- map_addr,
- object,
- (vm_pindex_t) OFF_TO_IDX(file_addr),
- map_len,
- 0);
-
- /* we can stop now if we've covered it all */
- if (memsz == filsz)
- return 0;
- }
+ map_len = round_page(offset+filsz) - trunc_page(offset);
+
+ if (error = vm_mmap (&vmspace->vm_map,
+ &map_addr,
+ map_len,
+ prot,
+ VM_PROT_ALL,
+ MAP_PRIVATE | MAP_FIXED,
+ (caddr_t)vp,
+ trunc_page(offset)))
+ return error;
+ if (memsz == filsz)
+ return 0;
/*
- * We have to get the remaining bit of the file into the first part
- * of the oversized map segment. This is normally because the .data
- * segment in the file is extended to provide bss. It's a neat idea
- * to try and save a page, but it's a pain in the behind to implement.
+ * We have to map the remaining bit of the file into the kernel's
+ * memory map, allocate some anonymous memory, and copy that last
+ * bit into it. The remaining space should be .bss...
*/
copy_len = (offset + filsz) - trunc_page(offset + filsz);
map_addr = trunc_page((vm_offset_t)vmaddr + filsz);
map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr;
- /* This had damn well better be true! */
if (map_len != 0) {
- vm_map_lock(&vmspace->vm_map);
- rv = vm_map_insert(&vmspace->vm_map, NULL, 0,
- map_addr, map_addr + map_len,
- VM_PROT_ALL, VM_PROT_ALL, 0);
- vm_map_unlock(&vmspace->vm_map);
- if (rv != KERN_SUCCESS)
- return EINVAL;
+ if (error = vm_map_find(&vmspace->vm_map, NULL, 0,
+ &map_addr, map_len, FALSE,
+ VM_PROT_ALL, VM_PROT_ALL,0))
+ return error;
}
- if (copy_len != 0) {
- vm_object_reference(object);
- rv = vm_map_find(exec_map,
- object,
- trunc_page(offset + filsz),
- &data_buf,
- PAGE_SIZE,
- TRUE,
- VM_PROT_READ,
- VM_PROT_ALL,
- MAP_COPY_ON_WRITE | MAP_COPY_NEEDED);
- if (rv != KERN_SUCCESS) {
- vm_object_deallocate(object);
- return EINVAL;
- }
- pmap_object_init_pt(exec_map->pmap, data_buf, object,
- (vm_pindex_t) OFF_TO_IDX(trunc_page(offset + filsz)),
- PAGE_SIZE, 1);
-
- /* send the page fragment to user space */
- error = copyout((caddr_t)data_buf, (caddr_t)map_addr, copy_len);
- vm_map_remove(exec_map, data_buf, data_buf + PAGE_SIZE);
- if (error)
- return (error);
- }
+ if (error = vm_mmap(exec_map,
+ (vm_offset_t *)&data_buf,
+ PAGE_SIZE,
+ VM_PROT_READ,
+ VM_PROT_READ,
+ 0,
+ (caddr_t)vp,
+ trunc_page(offset + filsz)))
+ return error;
+
+ error = copyout(data_buf, (caddr_t)map_addr, copy_len);
+
+ vm_map_remove(exec_map, (vm_offset_t)data_buf,
+ (vm_offset_t)data_buf + PAGE_SIZE);
/*
* set it to the specified protection
@@ -273,6 +250,7 @@ elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_o
vm_map_protect(&vmspace->vm_map, map_addr, map_addr + map_len, prot,
FALSE);
+ UPRINTF("bss size %d (%x)\n", map_len-copy_len, map_len-copy_len);
return error;
}
@@ -285,9 +263,10 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
struct vmspace *vmspace = p->p_vmspace;
struct vattr attr;
struct image_params image_params, *imgp;
- vm_prot_t prot;
+ vm_prot_t prot = 0;
unsigned long text_size = 0, data_size = 0;
unsigned long text_addr = 0, data_addr = 0;
+ int header_size = 0;
int error, i;
imgp = &image_params;
@@ -333,9 +312,19 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
if (error = elf_check_header(hdr, ET_DYN))
goto fail;
+ /*
+ * ouch, need to bounds check in case user gives us a corrupted
+ * file with an insane header size
+ */
+ if (hdr->e_phnum > MAX_PHDR) { /* XXX: ever more than this? */
+ error = ENOEXEC;
+ goto fail;
+ }
+
+ header_size = hdr->e_phentsize * hdr->e_phnum;
+
/* Only support headers that fit within first page for now */
- if ((hdr->e_phoff > PAGE_SIZE) ||
- (hdr->e_phoff + hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE) {
+ if (header_size + hdr->e_phoff > PAGE_SIZE) {
error = ENOEXEC;
goto fail;
}
@@ -343,8 +332,14 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
phdr = (Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
for (i = 0; i < hdr->e_phnum; i++) {
- if (phdr[i].p_type == PT_LOAD) { /* Loadable segment */
- prot = 0;
+ switch(phdr[i].p_type) {
+
+ case PT_NULL: /* NULL section */
+ UPRINTF ("ELF(file) PT_NULL section\n");
+ break;
+ case PT_LOAD: /* Loadable segment */
+ {
+ UPRINTF ("ELF(file) PT_LOAD section ");
if (phdr[i].p_flags & PF_X)
prot |= VM_PROT_EXECUTE;
if (phdr[i].p_flags & PF_W)
@@ -352,7 +347,7 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
if (phdr[i].p_flags & PF_R)
prot |= VM_PROT_READ;
- if (error = elf_load_section(p, vmspace, nd.ni_vp,
+ if (error = elf_load_section(vmspace, nd.ni_vp,
phdr[i].p_offset,
(caddr_t)phdr[i].p_vaddr +
(*addr),
@@ -372,13 +367,37 @@ elf_load_file(struct proc *p, char *file, u_long *addr, u_long *entry)
phdr[i].p_vaddr -
trunc_page(phdr[i].p_vaddr));
*entry=(unsigned long)hdr->e_entry+(*addr);
+ UPRINTF(".text <%08lx,%08lx> entry=%08lx\n",
+ text_addr, text_size, *entry);
} else {
data_addr = trunc_page(phdr[i].p_vaddr+(*addr));
data_size = round_page(phdr[i].p_memsz +
phdr[i].p_vaddr -
trunc_page(phdr[i].p_vaddr));
+ UPRINTF(".data <%08lx,%08lx>\n",
+ data_addr, data_size);
}
}
+ break;
+
+ case PT_DYNAMIC:/* Dynamic link information */
+ UPRINTF ("ELF(file) PT_DYNAMIC section\n");
+ break;
+ case PT_INTERP: /* Path to interpreter */
+ UPRINTF ("ELF(file) PT_INTERP section\n");
+ break;
+ case PT_NOTE: /* Note section */
+ UPRINTF ("ELF(file) PT_NOTE section\n");
+ break;
+ case PT_SHLIB: /* Shared lib section */
+ UPRINTF ("ELF(file) PT_SHLIB section\n");
+ break;
+ case PT_PHDR: /* Program header table info */
+ UPRINTF ("ELF(file) PT_PHDR section\n");
+ break;
+ default:
+ UPRINTF ("ELF(file) %d section ??\n", phdr[i].p_type );
+ }
}
fail:
@@ -397,14 +416,14 @@ static int
exec_elf_imgact(struct image_params *imgp)
{
const Elf_Ehdr *hdr = (const Elf_Ehdr *) imgp->image_header;
- const Elf_Phdr *phdr;
+ const Elf_Phdr *phdr, *mapped_phdr = NULL;
Elf_Auxargs *elf_auxargs = NULL;
struct vmspace *vmspace;
- vm_prot_t prot;
+ vm_prot_t prot = 0;
u_long text_size = 0, data_size = 0;
u_long text_addr = 0, data_addr = 0;
u_long addr, entry = 0, proghdr = 0;
- int error, i;
+ int error, i, header_size = 0;
const char *interp = NULL;
Elf_Brandinfo *brand_info;
char *brand;
@@ -421,12 +440,24 @@ exec_elf_imgact(struct image_params *imgp)
* detected an ELF file.
*/
+ /*
+ * ouch, need to bounds check in case user gives us a corrupted
+ * file with an insane header size
+ */
+ if (hdr->e_phnum > MAX_PHDR) { /* XXX: ever more than this? */
+ return ENOEXEC;
+ }
+
+ header_size = hdr->e_phentsize * hdr->e_phnum;
+
if ((hdr->e_phoff > PAGE_SIZE) ||
- (hdr->e_phoff + hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE) {
+ (hdr->e_phoff + header_size) > PAGE_SIZE) {
/* Only support headers in first page for now */
return ENOEXEC;
+ } else {
+ phdr = (const Elf_Phdr*)
+ ((const char *)imgp->image_header + hdr->e_phoff);
}
- phdr = (const Elf_Phdr*)(imgp->image_header + hdr->e_phoff);
/*
* From this point on, we may have resources that need to be freed.
@@ -441,8 +472,12 @@ exec_elf_imgact(struct image_params *imgp)
for (i = 0; i < hdr->e_phnum; i++) {
switch(phdr[i].p_type) {
+ case PT_NULL: /* NULL section */
+ UPRINTF ("ELF PT_NULL section\n");
+ break;
case PT_LOAD: /* Loadable segment */
- prot = 0;
+ {
+ UPRINTF ("ELF PT_LOAD section ");
if (phdr[i].p_flags & PF_X)
prot |= VM_PROT_EXECUTE;
if (phdr[i].p_flags & PF_W)
@@ -450,8 +485,7 @@ exec_elf_imgact(struct image_params *imgp)
if (phdr[i].p_flags & PF_R)
prot |= VM_PROT_READ;
- if (error = elf_load_section(imgp->proc,
- vmspace, imgp->vp,
+ if (error = elf_load_section(vmspace, imgp->vp,
phdr[i].p_offset,
(caddr_t)phdr[i].p_vaddr,
phdr[i].p_memsz,
@@ -470,26 +504,44 @@ exec_elf_imgact(struct image_params *imgp)
phdr[i].p_vaddr -
text_addr);
entry = (u_long)hdr->e_entry;
+ UPRINTF(".text <%08lx,%08lx> entry=%08lx\n",
+ text_addr, text_size, entry);
} else {
data_addr = trunc_page(phdr[i].p_vaddr);
data_size = round_page(phdr[i].p_memsz +
phdr[i].p_vaddr -
data_addr);
+ UPRINTF(".data <%08lx,%08lx>\n",
+ data_addr, data_size);
}
+ }
+ break;
+
+ case PT_DYNAMIC:/* Dynamic link information */
+ UPRINTF ("ELF PT_DYNAMIC section ??\n");
break;
case PT_INTERP: /* Path to interpreter */
+ UPRINTF ("ELF PT_INTERP section ");
if (phdr[i].p_filesz > MAXPATHLEN ||
phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) {
error = ENOEXEC;
goto fail;
}
interp = imgp->image_header + phdr[i].p_offset;
+ UPRINTF("<%s>\n", interp);
+ break;
+ case PT_NOTE: /* Note section */
+ UPRINTF ("ELF PT_NOTE section\n");
+ break;
+ case PT_SHLIB: /* Shared lib section */
+ UPRINTF ("ELF PT_SHLIB section\n");
break;
case PT_PHDR: /* Program header table info */
+ UPRINTF ("ELF PT_PHDR section <%x>\n", phdr[i].p_vaddr);
proghdr = phdr[i].p_vaddr;
break;
default:
- break;
+ UPRINTF ("ELF %d section ??\n", phdr[i].p_type);
}
}
@@ -548,8 +600,9 @@ exec_elf_imgact(struct image_params *imgp)
imgp->proc->p_sysent = brand_info->sysvec;
if (interp != NULL) {
- snprintf(path, sizeof(path), "%s%s",
- brand_info->emul_path, interp);
+ strcpy(path, brand_info->emul_path);
+ strcat(path, interp);
+ UPRINTF("interpreter=<%s> %s\n", interp, brand_info->emul_path);
if ((error = elf_load_file(imgp->proc, path, &addr,
&imgp->entry_addr)) != 0) {
uprintf("ELF interpreter %s not found\n", path);
@@ -557,6 +610,8 @@ exec_elf_imgact(struct image_params *imgp)
}
}
+ UPRINTF("Executing %s binary\n", brand_info->brand);
+
/*
* Construct auxargs table (used by the fixup routine)
*/
@@ -649,6 +704,7 @@ elf_coredump(p)
{
register struct vnode *vp;
register struct ucred *cred = p->p_cred->pc_ucred;
+ register struct vmspace *vm = p->p_vmspace;
struct nameidata nd;
struct vattr vattr;
int error, error1;
@@ -842,6 +898,7 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize)
size_t hdrsize;
void *hdr;
{
+ struct vmspace *vm = p->p_vmspace;
size_t off;
prstatus_t status;
prfpregset_t fpregset;
@@ -854,11 +911,7 @@ elf_corehdr(p, vp, cred, numsegs, hdr, hdrsize)
status.pr_gregsetsz = sizeof(gregset_t);
status.pr_fpregsetsz = sizeof(fpregset_t);
status.pr_osreldate = osreldate;
-#ifndef COMPAT_LINUX_THREADS
status.pr_cursig = p->p_sigacts->ps_sig;
-#else
- status.pr_cursig = p->p_sig;
-#endif /* COMPAT_LINUX_THREADS */
status.pr_pid = p->p_pid;
fill_regs(p, &status.pr_reg);
diff --git a/sys/kern/inflate.c b/sys/kern/inflate.c
index 1db9b2c99642a..4558eb3519bdc 100644
--- a/sys/kern/inflate.c
+++ b/sys/kern/inflate.c
@@ -7,7 +7,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: inflate.c,v 1.11 1997/10/12 20:23:40 phk Exp $
+ * $Id: inflate.c,v 1.10 1997/10/11 18:31:20 phk Exp $
*
*
*/
@@ -16,13 +16,10 @@
#include <sys/inflate.h>
#ifdef KERNEL
#include <sys/systm.h>
-#include <sys/kernel.h>
#endif
#include <sys/malloc.h>
-#ifdef KERNEL
static MALLOC_DEFINE(M_GZIP, "Gzip trees", "Gzip trees");
-#endif
/* needed to make inflate() work */
#define uch u_char
@@ -50,10 +47,8 @@ extern void putstr (char *);
static const int qflag = 0;
#ifndef KERNEL /* want to use this file in kzip also */
-extern unsigned char *kzipmalloc (int);
-extern void kzipfree (void*);
-#define malloc(x, y, z) kzipmalloc((x))
-#define free(x, y) kzipfree((x))
+extern unsigned char *malloc (int, int, int);
+extern void free (void*, int);
#endif
/*
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 246684f883624..fffe109924d8e 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id: init_main.c,v 1.102 1998/12/30 10:38:58 dfr Exp $
+ * $Id: init_main.c,v 1.98 1998/10/09 23:42:47 peter Exp $
*/
#include "opt_devfs.h"
@@ -83,9 +83,6 @@ static struct session session0;
static struct pgrp pgrp0;
struct proc proc0;
static struct pcred cred0;
-#ifdef COMPAT_LINUX_THREADS
-static struct procsig procsig0;
-#endif /* COMPAT_LINUX_THREADS */
static struct filedesc0 filedesc0;
static struct plimit limit0;
static struct vmspace vmspace0;
@@ -418,12 +415,6 @@ proc0_init(dummy)
p->p_ucred = crget();
p->p_ucred->cr_ngroups = 1; /* group 0 */
-#ifdef COMPAT_LINUX_THREADS
- /* Create procsig. */
- p->p_procsig = &procsig0;
- p->p_procsig->ps_refcnt = 2;
-
-#endif /* COMPAT_LINUX_THREADS */
/* Create the file descriptor table. */
fdp = &filedesc0;
p->p_fd = &fdp->fd_fd;
@@ -626,7 +617,7 @@ start_init(p)
/*
* Need just enough stack to hold the faked-up "execve()" arguments.
*/
- addr = trunc_page(USRSTACK - PAGE_SIZE);
+ addr = trunc_page(VM_MAXUSER_ADDRESS - PAGE_SIZE);
if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
panic("init: couldn't allocate argument space");
p->p_vmspace->vm_maxsaddr = (caddr_t)addr;
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index c31ed46bc01f0..d806c5ba886f3 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -2,7 +2,7 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
#include "opt_compat.h"
@@ -355,6 +355,4 @@ struct sysent sysent[] = {
{ 1, (sy_call_t *)sched_get_priority_min }, /* 333 = sched_get_priority_min */
{ 2, (sy_call_t *)sched_rr_get_interval }, /* 334 = sched_rr_get_interval */
{ 2, (sy_call_t *)utrace }, /* 335 = utrace */
- { 8, (sy_call_t *)sendfile }, /* 336 = sendfile */
- { 3, (sy_call_t *)kldsym }, /* 337 = kldsym */
};
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 2ea378fb95447..283e0c61f801d 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,3 +1,5 @@
+static volatile int print_tci = 1;
+
/*-
* Copyright (c) 1997, 1998 Poul-Henning Kamp <phk@FreeBSD.org>
* Copyright (c) 1982, 1986, 1991, 1993
@@ -37,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_clock.c,v 1.85 1998/11/23 09:58:53 phk Exp $
+ * $Id: kern_clock.c,v 1.79 1998/09/15 10:05:18 gibbs Exp $
*/
#include <sys/param.h>
@@ -46,7 +48,6 @@
#include <sys/callout.h>
#include <sys/kernel.h>
#include <sys/proc.h>
-#include <sys/malloc.h>
#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#include <sys/timex.h>
@@ -67,23 +68,10 @@
#include <machine/smp.h>
#endif
-/* This is where the NTIMECOUNTER option hangs out */
-#include "opt_ntp.h"
-
-/*
- * Number of timecounters used to implement stable storage
- */
-#ifndef NTIMECOUNTER
-#define NTIMECOUNTER 5
-#endif
-
-static MALLOC_DEFINE(M_TIMECOUNTER, "timecounter",
- "Timecounter stable storage");
-
static void initclocks __P((void *dummy));
SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL)
-static void tco_forward __P((int force));
+static void tco_forward __P((void));
static void tco_setscales __P((struct timecounter *tc));
static __inline unsigned tco_delta __P((struct timecounter *tc));
@@ -99,37 +87,9 @@ long tk_nin;
long tk_nout;
long tk_rawcc;
-time_t time_second;
+struct timecounter *timecounter;
-/*
- * Which update policy to use.
- * 0 - every tick, bad hardware may fail with "calcru negative..."
- * 1 - more resistent to the above hardware, but less efficient.
- */
-static int tco_method;
-
-/*
- * Implement a dummy timecounter which we can use until we get a real one
- * in the air. This allows the console and other early stuff to use
- * timeservices.
- */
-
-static unsigned
-dummy_get_timecount(struct timecounter *tc)
-{
- static unsigned now;
- return (++now);
-}
-
-static struct timecounter dummy_timecounter = {
- dummy_get_timecount,
- 0,
- ~0u,
- 1000000,
- "dummy"
-};
-
-struct timecounter *timecounter = &dummy_timecounter;
+time_t time_second;
/*
* Clock handling routines.
@@ -232,7 +192,7 @@ hardclock(frame)
if (stathz == 0)
statclock(frame);
- tco_forward(0);
+ tco_forward();
ticks++;
/*
@@ -365,15 +325,15 @@ statclock(frame)
{
#ifdef GPROF
register struct gmonparam *g;
- int i;
#endif
register struct proc *p;
+ register int i;
struct pstats *pstats;
long rss;
struct rusage *ru;
struct vmspace *vm;
- if (curproc != NULL && CLKF_USERMODE(frame)) {
+ if (CLKF_USERMODE(frame)) {
p = curproc;
if (p->p_flag & P_PROFIL)
addupc_intr(p, CLKF_PC(frame), 1);
@@ -522,12 +482,8 @@ getmicrotime(struct timeval *tvp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- *tvp = tc->tc_microtime;
- } else {
- microtime(tvp);
- }
+ tc = timecounter;
+ *tvp = tc->tc_microtime;
}
void
@@ -535,12 +491,8 @@ getnanotime(struct timespec *tsp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- *tsp = tc->tc_nanotime;
- } else {
- nanotime(tsp);
- }
+ tc = timecounter;
+ *tsp = tc->tc_nanotime;
}
void
@@ -611,13 +563,9 @@ getmicrouptime(struct timeval *tvp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- tvp->tv_sec = tc->tc_offset_sec;
- tvp->tv_usec = tc->tc_offset_micro;
- } else {
- microuptime(tvp);
- }
+ tc = timecounter;
+ tvp->tv_sec = tc->tc_offset_sec;
+ tvp->tv_usec = tc->tc_offset_micro;
}
void
@@ -625,13 +573,9 @@ getnanouptime(struct timespec *tsp)
{
struct timecounter *tc;
- if (!tco_method) {
- tc = timecounter;
- tsp->tv_sec = tc->tc_offset_sec;
- tsp->tv_nsec = tc->tc_offset_nano >> 32;
- } else {
- nanouptime(tsp);
- }
+ tc = timecounter;
+ tsp->tv_sec = tc->tc_offset_sec;
+ tsp->tv_nsec = tc->tc_offset_nano >> 32;
}
void
@@ -650,14 +594,14 @@ microuptime(struct timeval *tv)
}
void
-nanouptime(struct timespec *ts)
+nanouptime(struct timespec *tv)
{
unsigned count;
u_int64_t delta;
struct timecounter *tc;
tc = (struct timecounter *)timecounter;
- ts->tv_sec = tc->tc_offset_sec;
+ tv->tv_sec = tc->tc_offset_sec;
count = tco_delta(tc);
delta = tc->tc_offset_nano;
delta += ((u_int64_t)count * tc->tc_scale_nano_f);
@@ -665,9 +609,9 @@ nanouptime(struct timespec *ts)
delta += ((u_int64_t)count * tc->tc_scale_nano_i);
if (delta >= 1000000000) {
delta -= 1000000000;
- ts->tv_sec++;
+ tv->tv_sec++;
}
- ts->tv_nsec = delta;
+ tv->tv_nsec = delta;
}
static void
@@ -689,29 +633,33 @@ tco_setscales(struct timecounter *tc)
void
init_timecounter(struct timecounter *tc)
{
- struct timespec ts1;
- struct timecounter *t1, *t2, *t3;
+ struct timespec ts0, ts1;
int i;
tc->tc_adjustment = 0;
tco_setscales(tc);
tc->tc_offset_count = tc->tc_get_timecount(tc);
- tc->tc_tweak = tc;
- MALLOC(t1, struct timecounter *, sizeof *t1, M_TIMECOUNTER, M_WAITOK);
- *t1 = *tc;
- t2 = t1;
- for (i = 1; i < NTIMECOUNTER; i++) {
- MALLOC(t3, struct timecounter *, sizeof *t3,
- M_TIMECOUNTER, M_WAITOK);
- *t3 = *tc;
- t3->tc_other = t2;
- t2 = t3;
- }
- t1->tc_other = t3;
- tc = t1;
-
- printf("Timecounter \"%s\" frequency %lu Hz\n",
- tc->tc_name, (u_long)tc->tc_frequency);
+ tc[0].tc_tweak = &tc[0];
+ tc[2] = tc[1] = tc[0];
+ tc[1].tc_other = &tc[2];
+ tc[2].tc_other = &tc[1];
+ if (!timecounter || !strcmp(timecounter->tc_name, "dummy"))
+ timecounter = &tc[2];
+ tc = &tc[1];
+
+ /*
+ * Figure out the cost of calling this timecounter.
+ */
+ nanotime(&ts0);
+ for (i = 0; i < 256; i ++)
+ tc->tc_get_timecount(tc);
+ nanotime(&ts1);
+ ts1.tv_sec -= ts0.tv_sec;
+ tc->tc_cost = ts1.tv_sec * 1000000000 + ts1.tv_nsec - ts0.tv_nsec;
+ tc->tc_cost >>= 8;
+ if (print_tci && strcmp(tc->tc_name, "dummy"))
+ printf("Timecounter \"%s\" frequency %lu Hz cost %u ns\n",
+ tc->tc_name, (u_long)tc->tc_frequency, tc->tc_cost);
/* XXX: For now always start using the counter. */
tc->tc_offset_count = tc->tc_get_timecount(tc);
@@ -735,7 +683,7 @@ set_timecounter(struct timespec *ts)
boottime.tv_sec--;
}
/* fiddle all the little crinkly bits around the fiords... */
- tco_forward(1);
+ tco_forward();
}
@@ -783,7 +731,7 @@ sync_other_counter(void)
}
static void
-tco_forward(int force)
+tco_forward(void)
{
struct timecounter *tc, *tco;
@@ -803,7 +751,6 @@ tco_forward(int force)
if (timedelta != 0) {
tc->tc_offset_nano += (u_int64_t)(tickdelta * 1000) << 32;
timedelta -= tickdelta;
- force++;
}
while (tc->tc_offset_nano >= 1000000000ULL << 32) {
@@ -813,12 +760,8 @@ tco_forward(int force)
tc->tc_adjustment = tc->tc_tweak->tc_adjustment;
ntp_update_second(tc); /* XXX only needed if xntpd runs */
tco_setscales(tc);
- force++;
}
- if (tco_method && !force)
- return;
-
tc->tc_offset_micro = (tc->tc_offset_nano / 1000) >> 32;
/* Figure out the wall-clock time */
@@ -856,15 +799,39 @@ sysctl_kern_timecounter_adjustment SYSCTL_HANDLER_ARGS
SYSCTL_NODE(_kern, OID_AUTO, timecounter, CTLFLAG_RW, 0, "");
-SYSCTL_INT(_kern_timecounter, KERN_ARGMAX, method, CTLFLAG_RW, &tco_method, 0,
- "This variable determines the method used for updating timecounters. "
- "If the default algorithm (0) fails with \"calcru negative...\" messages "
- "try the alternate algorithm (1) which handles bad hardware better."
-
-);
-
SYSCTL_PROC(_kern_timecounter, OID_AUTO, frequency, CTLTYPE_INT | CTLFLAG_RW,
0, sizeof(u_int), sysctl_kern_timecounter_frequency, "I", "");
SYSCTL_PROC(_kern_timecounter, OID_AUTO, adjustment, CTLTYPE_INT | CTLFLAG_RW,
0, sizeof(int), sysctl_kern_timecounter_adjustment, "I", "");
+
+/*
+ * Implement a dummy timecounter which we can use until we get a real one
+ * in the air. This allows the console and other early stuff to use
+ * timeservices.
+ */
+
+static unsigned
+dummy_get_timecount(struct timecounter *tc)
+{
+ static unsigned now;
+ return (++now);
+}
+
+static struct timecounter dummy_timecounter[3] = {
+ {
+ dummy_get_timecount,
+ 0,
+ ~0u,
+ 1000000,
+ "dummy"
+ }
+};
+
+static void
+initdummytimecounter(void *dummy)
+{
+ init_timecounter(dummy_timecounter);
+}
+
+SYSINIT(dummytc, SI_SUB_CONSOLE, SI_ORDER_FIRST, initdummytimecounter, NULL)
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index df832f63fb7fc..684b36514f8a1 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_conf.c,v 1.28 1998/10/25 17:44:50 phk Exp $
+ * $Id: kern_conf.c,v 1.26 1998/06/26 18:14:25 phk Exp $
*/
#include <sys/param.h>
@@ -57,6 +57,7 @@ int nchrdev = NUMCDEV;
dev_t
chrtoblk(dev_t dev)
{
+ struct bdevsw *bd;
struct cdevsw *cd;
if(cd = cdevsw[major(dev)]) {
@@ -166,7 +167,7 @@ cdevsw_add_generic(int bdev, int cdev, struct cdevsw *cdevsw)
}
int
-cdevsw_module_handler(module_t mod, int what, void *arg)
+cdevsw_module_handler(module_t mod, modeventtype_t what, void* arg)
{
struct cdevsw_module_data* data = (struct cdevsw_module_data*) arg;
int error;
@@ -190,7 +191,7 @@ cdevsw_module_handler(module_t mod, int what, void *arg)
}
int
-bdevsw_module_handler(module_t mod, int what, void* arg)
+bdevsw_module_handler(module_t mod, modeventtype_t what, void* arg)
{
struct bdevsw_module_data* data = (struct bdevsw_module_data*) arg;
int error;
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 1d18a86d98a25..e3d736b417b48 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
- * $Id: kern_descrip.c,v 1.57 1998/11/11 10:55:56 truckman Exp $
+ * $Id: kern_descrip.c,v 1.54 1998/07/15 06:10:16 bde Exp $
*/
#include "opt_compat.h"
@@ -71,7 +71,6 @@
static MALLOC_DEFINE(M_FILEDESC, "file desc", "Open file descriptor table");
MALLOC_DEFINE(M_FILE, "file", "Open file structure");
-static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures");
static d_open_t fdopen;
@@ -258,13 +257,30 @@ fcntl(p, uap)
return (error);
case F_GETOWN:
+ if (fp->f_type == DTYPE_SOCKET) {
+ p->p_retval[0] = ((struct socket *)fp->f_data)->so_pgid;
+ return (0);
+ }
error = (*fp->f_ops->fo_ioctl)
- (fp, FIOGETOWN, (caddr_t)p->p_retval, p);
+ (fp, TIOCGPGRP, (caddr_t)p->p_retval, p);
+ p->p_retval[0] = - p->p_retval[0];
return (error);
case F_SETOWN:
+ if (fp->f_type == DTYPE_SOCKET) {
+ ((struct socket *)fp->f_data)->so_pgid = uap->arg;
+ return (0);
+ }
+ if (uap->arg <= 0) {
+ uap->arg = -uap->arg;
+ } else {
+ struct proc *p1 = pfind(uap->arg);
+ if (p1 == 0)
+ return (ESRCH);
+ uap->arg = p1->p_pgrp->pg_id;
+ }
return ((*fp->f_ops->fo_ioctl)
- (fp, FIOSETOWN, (caddr_t)&uap->arg, p));
+ (fp, TIOCSPGRP, (caddr_t)&uap->arg, p));
case F_SETLKW:
flg |= F_WAIT;
@@ -350,127 +366,6 @@ finishdup(fdp, old, new, retval)
}
/*
- * If sigio is on the list associated with a process or process group,
- * disable signalling from the device, remove sigio from the list and
- * free sigio.
- */
-void
-funsetown(sigio)
- struct sigio *sigio;
-{
- int s;
-
- if (sigio == NULL)
- return;
- s = splhigh();
- *(sigio->sio_myref) = NULL;
- splx(s);
- if (sigio->sio_pgid < 0) {
- SLIST_REMOVE(&sigio->sio_pgrp->pg_sigiolst, sigio,
- sigio, sio_pgsigio);
- } else /* if ((*sigiop)->sio_pgid > 0) */ {
- SLIST_REMOVE(&sigio->sio_proc->p_sigiolst, sigio,
- sigio, sio_pgsigio);
- }
- crfree(sigio->sio_ucred);
- FREE(sigio, M_SIGIO);
-}
-
-/* Free a list of sigio structures. */
-void
-funsetownlst(sigiolst)
- struct sigiolst *sigiolst;
-{
- struct sigio *sigio;
-
- while ((sigio = sigiolst->slh_first) != NULL)
- funsetown(sigio);
-}
-
-/*
- * This is common code for FIOSETOWN ioctl called by fcntl(fd, F_SETOWN, arg).
- *
- * After permission checking, add a sigio structure to the sigio list for
- * the process or process group.
- */
-int
-fsetown(pgid, sigiop)
- pid_t pgid;
- struct sigio **sigiop;
-{
- struct proc *proc;
- struct pgrp *pgrp;
- struct sigio *sigio;
- int s;
-
- if (pgid == 0) {
- funsetown(*sigiop);
- return (0);
- }
- if (pgid > 0) {
- proc = pfind(pgid);
- if (proc == NULL)
- return (ESRCH);
- /*
- * Policy - Don't allow a process to FSETOWN a process
- * in another session.
- *
- * Remove this test to allow maximum flexibility or
- * restrict FSETOWN to the current process or process
- * group for maximum safety.
- */
- else if (proc->p_session != curproc->p_session)
- return (EPERM);
- pgrp = NULL;
- } else /* if (pgid < 0) */ {
- pgrp = pgfind(-pgid);
- if (pgrp == NULL)
- return (ESRCH);
- /*
- * Policy - Don't allow a process to FSETOWN a process
- * in another session.
- *
- * Remove this test to allow maximum flexibility or
- * restrict FSETOWN to the current process or process
- * group for maximum safety.
- */
- else if (pgrp->pg_session != curproc->p_session)
- return (EPERM);
- proc = NULL;
- }
- funsetown(*sigiop);
- MALLOC(sigio, struct sigio *, sizeof(struct sigio), M_SIGIO,
- M_WAITOK);
- if (pgid > 0) {
- SLIST_INSERT_HEAD(&proc->p_sigiolst, sigio, sio_pgsigio);
- sigio->sio_proc = proc;
- } else {
- SLIST_INSERT_HEAD(&pgrp->pg_sigiolst, sigio, sio_pgsigio);
- sigio->sio_pgrp = pgrp;
- }
- sigio->sio_pgid = pgid;
- crhold(curproc->p_ucred);
- sigio->sio_ucred = curproc->p_ucred;
- /* It would be convenient if p_ruid was in ucred. */
- sigio->sio_ruid = curproc->p_cred->p_ruid;
- sigio->sio_myref = sigiop;
- s = splhigh();
- *sigiop = sigio;
- splx(s);
- return (0);
-}
-
-/*
- * This is common code for FIOGETOWN ioctl called by fcntl(fd, F_GETOWN, arg).
- */
-pid_t
-fgetown(sigio)
- struct sigio *sigio;
-{
- return (sigio != NULL ? sigio->sio_pgid : 0);
-}
-
-/*
* Close a file descriptor.
*/
#ifndef _SYS_SYSPROTO_H_
@@ -845,7 +740,7 @@ ffree(fp)
{
LIST_REMOVE(fp, f_list);
crfree(fp->f_cred);
-#if defined(DIAGNOSTIC) || defined(INVARIANTS)
+#ifdef DIAGNOSTIC
fp->f_count = 0;
#endif
nfiles--;
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c
index 2243e2749fb6d..790fbf4f9d65e 100644
--- a/sys/kern/kern_environment.c
+++ b/sys/kern/kern_environment.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_environment.c,v 1.3 1998/10/09 21:21:34 msmith Exp $
+ * $Id: kern_environment.c,v 1.2 1998/10/09 11:03:46 jkh Exp $
*/
/*
@@ -65,25 +65,6 @@ getenv(char *name)
return(NULL);
}
-/*
- * Return an integer value from an environment variable.
- */
-int
-getenv_int(char *name, int *data)
-{
- char *value, *vtp;
- quad_t iv;
-
- if ((value = getenv(name)) == NULL)
- return(0);
-
- iv = strtoq(value, &vtp, 0);
- if ((vtp == value) || (*vtp != 0))
- return(0);
-
- *data = (int)iv;
- return(1);
-}
static int
sysctl_kernenv SYSCTL_HANDLER_ARGS
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index dd63672035794..d30d9c29fc9b0 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_exec.c,v 1.92 1998/12/30 10:38:59 dfr Exp $
+ * $Id: kern_exec.c,v 1.86 1998/09/04 08:06:55 dfr Exp $
*/
#include <sys/param.h>
@@ -66,12 +66,11 @@
static long *exec_copyout_strings __P((struct image_params *));
-static long ps_strings = PS_STRINGS;
-SYSCTL_LONG(_kern, KERN_PS_STRINGS, ps_strings, CTLFLAG_RD, &ps_strings, "");
-
-static long usrstack = USRSTACK;
-SYSCTL_LONG(_kern, KERN_USRSTACK, usrstack, CTLFLAG_RD, &usrstack, "");
+static struct ps_strings *ps_strings = PS_STRINGS;
+SYSCTL_INTPTR(_kern, KERN_PS_STRINGS, ps_strings, 0, &ps_strings, 0, "");
+static caddr_t usrstack = (caddr_t)USRSTACK;
+SYSCTL_INTPTR(_kern, KERN_USRSTACK, usrstack, 0, &usrstack, 0, "");
/*
* Each of the items is a pointer to a `const struct execsw', hence the
* double pointer here.
@@ -149,7 +148,6 @@ interpret:
}
imgp->vp = ndp->ni_vp;
- imgp->fname = uap->fname;
/*
* Check file permissions (also 'opens' file)
@@ -324,8 +322,8 @@ exec_fail_dealloc:
kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase,
ARG_MAX + PAGE_SIZE);
- if (imgp->vp) {
- vrele(imgp->vp);
+ if (ndp->ni_vp) {
+ vrele(ndp->ni_vp);
zfree(namei_zone, ndp->ni_cnd.cn_pnbuf);
}
@@ -410,7 +408,7 @@ exec_unmap_first_page(imgp)
{
if (imgp->firstpage) {
pmap_kremove((vm_offset_t) imgp->image_header);
- vm_page_unwire(imgp->firstpage, 1);
+ vm_page_unwire(imgp->firstpage);
imgp->firstpage = NULL;
}
}
@@ -426,11 +424,7 @@ exec_new_vmspace(imgp)
{
int error;
struct vmspace *vmspace = imgp->proc->p_vmspace;
-#ifdef VM_STACK
- caddr_t stack_addr = (caddr_t) (USRSTACK - MAXSSIZ);
-#else
caddr_t stack_addr = (caddr_t) (USRSTACK - SGROWSIZ);
-#endif
vm_map_t map = &vmspace->vm_map;
imgp->vmspace_destroyed = 1;
@@ -443,8 +437,8 @@ exec_new_vmspace(imgp)
if (vmspace->vm_refcnt == 1) {
if (vmspace->vm_shm)
shmexit(imgp->proc);
- pmap_remove_pages(&vmspace->vm_pmap, 0, VM_MAXUSER_ADDRESS);
- vm_map_remove(map, 0, VM_MAXUSER_ADDRESS);
+ pmap_remove_pages(&vmspace->vm_pmap, 0, USRSTACK);
+ vm_map_remove(map, 0, USRSTACK);
} else {
vmspace_exec(imgp->proc);
vmspace = imgp->proc->p_vmspace;
@@ -452,19 +446,6 @@ exec_new_vmspace(imgp)
}
/* Allocate a new stack */
-#ifdef VM_STACK
- error = vm_map_stack (&vmspace->vm_map, (vm_offset_t)stack_addr,
- (vm_size_t)MAXSSIZ, VM_PROT_ALL, VM_PROT_ALL, 0);
- if (error)
- return (error);
-
- /* vm_ssize and vm_maxsaddr are somewhat antiquated concepts in the
- * VM_STACK case, but they are still used to monitor the size of the
- * process stack so we can check the stack rlimit.
- */
- vmspace->vm_ssize = SGROWSIZ >> PAGE_SHIFT;
- vmspace->vm_maxsaddr = (char *)USRSTACK - MAXSSIZ;
-#else
error = vm_map_insert(&vmspace->vm_map, NULL, 0,
(vm_offset_t) stack_addr, (vm_offset_t) USRSTACK,
VM_PROT_ALL, VM_PROT_ALL, 0);
@@ -475,7 +456,6 @@ exec_new_vmspace(imgp)
/* Initialize maximum stack address */
vmspace->vm_maxsaddr = (char *)USRSTACK - MAXSSIZ;
-#endif
return(0);
}
@@ -569,7 +549,7 @@ exec_copyout_strings(imgp)
* Calculate string base and vector table pointers.
* Also deal with signal trampoline code for this exec type.
*/
- arginfo = (struct ps_strings *)PS_STRINGS;
+ arginfo = PS_STRINGS;
szsigcode = *(imgp->proc->p_sysent->sv_szsigcode);
destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
roundup((ARG_MAX - imgp->stringspace), sizeof(char *));
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 7be01af67fac0..31c31bbd89266 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
- * $Id: kern_exit.c,v 1.70 1998/12/19 02:55:33 julian Exp $
+ * $Id: kern_exit.c,v 1.66 1998/04/06 08:26:03 phk Exp $
*/
#include "opt_compat.h"
@@ -45,7 +45,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
-#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/pioctl.h>
@@ -73,9 +72,6 @@
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_zone.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <sys/user.h>
-#endif
static MALLOC_DEFINE(M_ZOMBIE, "zombie", "zombie proc status");
@@ -184,20 +180,12 @@ exit1(p, rv)
*/
p->p_flag &= ~(P_TRACED | P_PPWAIT);
p->p_flag |= P_WEXIT;
-#ifndef COMPAT_LINUX_THREADS
p->p_sigignore = ~0;
-#endif /* COMPAT_LINUX_THREADS */
p->p_siglist = 0;
if (timevalisset(&p->p_realtimer.it_value))
untimeout(realitexpire, (caddr_t)p, p->p_ithandle);
/*
- * Reset any sigio structures pointing to us as a result of
- * F_SETOWN with our pid.
- */
- funsetownlst(&p->p_sigiolst);
-
- /*
* Close open files and release open-file table.
* This may block!
*/
@@ -287,9 +275,6 @@ exit1(p, rv)
LIST_REMOVE(q, p_sibling);
LIST_INSERT_HEAD(&initproc->p_children, q, p_sibling);
q->p_pptr = initproc;
-#ifdef COMPAT_LINUX_THREADS
- q->p_sigparent = 0;
-#endif /* COMPAT_LINUX_THREADS */
/*
* Traced processes are killed
* since their existence means someone is screwing up.
@@ -314,11 +299,7 @@ exit1(p, rv)
* flag set, notify process 1 instead (and hope it will handle
* this situation).
*/
-#ifndef COMPAT_LINUX_THREADS
if (p->p_pptr->p_flag & P_NOCLDWAIT) {
-#else
- if (p->p_pptr->p_procsig->ps_flag & P_NOCLDWAIT) {
-#endif /* COMPAT_LINUX_THREADS */
struct proc *pp = p->p_pptr;
proc_reparent(p, initproc);
/*
@@ -330,15 +311,7 @@ exit1(p, rv)
wakeup((caddr_t)pp);
}
-#ifndef COMPAT_LINUX_THREADS
psignal(p->p_pptr, SIGCHLD);
-#else
- if (p->p_sigparent && p->p_pptr != initproc) {
- psignal(p->p_pptr, p->p_sigparent);
- } else {
- psignal(p->p_pptr, SIGCHLD);
- }
-#endif /* COMPAT_LINUX_THREADS */
wakeup((caddr_t)p->p_pptr);
#if defined(tahoe)
/* move this to cpu_exit */
@@ -508,14 +481,6 @@ loop:
LIST_REMOVE(p, p_list); /* off zombproc */
LIST_REMOVE(p, p_sibling);
-#ifdef COMPAT_LINUX_THREADS
- if (--p->p_procsig->ps_refcnt == 0) {
- if (p->p_sigacts != &p->p_addr->u_sigacts)
- FREE(p->p_sigacts, M_SUBPROC);
- FREE(p->p_procsig, M_SUBPROC);
- p->p_procsig = NULL;
- }
-#endif /* COMPAT_LINUX_THREADS */
/*
* Give machine-dependent layer a chance
* to free anything that cpu_exit couldn't
@@ -626,22 +591,3 @@ rm_at_exit(function)
}
return (count);
}
-
-#ifdef COMPAT_LINUX_THREADS
-void check_sigacts (void)
-{
- struct proc *p = curproc;
- struct sigacts *pss;
- int s;
-
- if (p->p_procsig->ps_refcnt == 1 &&
- p->p_sigacts != &p->p_addr->u_sigacts) {
- pss = p->p_sigacts;
- s = splhigh();
- p->p_addr->u_sigacts = *pss;
- p->p_sigacts = &p->p_addr->u_sigacts;
- splx(s);
- FREE(pss, M_SUBPROC);
- }
-}
-#endif
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 732712b32fd8d..26cbe47576d6e 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
- * $Id: kern_fork.c,v 1.53 1998/12/19 02:55:33 julian Exp $
+ * $Id: kern_fork.c,v 1.50 1997/12/12 04:00:58 dyson Exp $
*/
#include "opt_ktrace.h"
@@ -62,10 +62,6 @@
#include <vm/vm_extern.h>
#include <vm/vm_zone.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <machine/frame.h>
-#include <sys/user.h>
-#endif /* COMPAT_LINUX_THREADS */
#ifdef SMP
static int fast_vfork = 0; /* Doesn't work on SMP yet. */
#else
@@ -275,8 +271,7 @@ retry:
again:
for (; p2 != 0; p2 = p2->p_list.le_next) {
while (p2->p_pid == nextpid ||
- p2->p_pgrp->pg_id == nextpid ||
- p2->p_session->s_sid == nextpid) {
+ p2->p_pgrp->pg_id == nextpid) {
nextpid++;
if (nextpid >= pidchecked)
goto retry;
@@ -286,9 +281,6 @@ again:
if (p2->p_pgrp->pg_id > nextpid &&
pidchecked > p2->p_pgrp->pg_id)
pidchecked = p2->p_pgrp->pg_id;
- if (p2->p_session->s_sid > nextpid &&
- pidchecked > p2->p_session->s_sid)
- pidchecked = p2->p_session->s_sid;
}
if (!doingzomb) {
doingzomb = 1;
@@ -329,44 +321,6 @@ again:
p2->p_cred->p_refcnt = 1;
crhold(p1->p_ucred);
-#ifdef COMPAT_LINUX_THREADS
- if (flags & RFSIGSHARE) {
- p2->p_procsig = p1->p_procsig;
- p2->p_procsig->ps_refcnt++;
- if (p1->p_sigacts == &p1->p_addr->u_sigacts) {
- struct sigacts *newsigacts;
- int s;
-
- if (p2->p_procsig->ps_refcnt != 2)
- printf ("PID:%d Creating shared sigacts with procsig->ps_refcnt %d\n",
- p2->p_pid, p2->p_procsig->ps_refcnt);
- /* Create the shared sigacts structure */
- MALLOC (newsigacts, struct sigacts *, sizeof (struct sigacts),
- M_SUBPROC, M_WAITOK);
- s = splhigh();
- /* Set p_sigacts to the new shared structure. Note that this
- * is updating p1->p_sigacts at the same time, since p_sigacts
- * is just a pointer to the shared p_procsig->ps_sigacts.
- */
- p2->p_sigacts = newsigacts;
- /* Copy in the values from the u area */
- *p2->p_sigacts = p1->p_addr->u_sigacts;
- splx (s);
- }
- } else {
- MALLOC (p2->p_procsig, struct procsig *, sizeof(struct procsig),
- M_SUBPROC, M_WAITOK);
- bcopy(&p1->p_procsig->ps_begincopy, &p2->p_procsig->ps_begincopy,
- (unsigned)&p1->p_procsig->ps_endcopy -
- (unsigned)&p1->p_procsig->ps_begincopy);
- p2->p_procsig->ps_refcnt = 1;
- /* Note that we fill in the values of sigacts in vm_fork */
- p2->p_sigacts = NULL;
- }
- if (flags & RFLINUXTHPN) {
- p2->p_sigparent = SIGUSR1;
- }
-#endif /* COMPAT_LINUX_THREADS */
/* bump references to the text vnode (for procfs) */
p2->p_textvp = p1->p_textvp;
if (p2->p_textvp)
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 1d6756c0065c0..207263736e86f 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -23,14 +23,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: kern_intr.c,v 1.20 1998/09/26 14:25:31 dfr Exp $
+ * $Id: kern_intr.c,v 1.19 1998/08/11 15:08:13 bde Exp $
*
*/
-#include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/types.h>
#include <sys/malloc.h>
+#include <sys/systm.h>
#include <sys/errno.h>
#ifdef RESOURCE_CHECK
#include <sys/drvresource.h>
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 7a6d237a8f480..57f470a6656f8 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93
- * $Id: kern_ktrace.c,v 1.24 1998/11/10 09:16:29 peter Exp $
+ * $Id: kern_ktrace.c,v 1.22 1997/12/05 19:55:38 bde Exp $
*/
#include "opt_ktrace.h"
@@ -39,7 +39,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/fcntl.h>
#include <sys/lock.h>
@@ -473,7 +472,7 @@ ktrwrite(vp, kth)
aiov[0].iov_len = sizeof(struct ktr_header);
auio.uio_resid = sizeof(struct ktr_header);
auio.uio_iovcnt = 1;
- auio.uio_procp = curproc;
+ auio.uio_procp = (struct proc *)0;
if (kth->ktr_len > 0) {
auio.uio_iovcnt++;
aiov[1].iov_base = kth->ktr_buf;
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 97def9fe83507..b43953b5936bc 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_linker.c,v 1.20 1999/01/19 16:26:32 peter Exp $
+ * $Id: kern_linker.c,v 1.9 1998/10/10 02:29:07 peter Exp $
*/
#include "opt_ddb.h"
@@ -47,13 +47,8 @@
#include <sys/vnode.h>
#include <sys/sysctl.h>
-#ifdef KLD_DEBUG
-int kld_debug = 0;
-#endif
-
MALLOC_DEFINE(M_LINKER, "kld", "kernel linker");
linker_file_t linker_current_file;
-linker_file_t linker_kernel_file;
static struct lock lock; /* lock for the file list */
static linker_class_list_t classes;
@@ -123,11 +118,11 @@ linker_file_sysinit(linker_file_t lf)
* Since some things care about execution order, this is the
* operation which ensures continued function.
*/
- for (sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
- for (xipp = sipp + 1; *xipp; xipp++) {
- if ((*sipp)->subsystem <= (*xipp)->subsystem ||
- ((*sipp)->subsystem == (*xipp)->subsystem &&
- (*sipp)->order <= (*xipp)->order))
+ for( sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
+ for( xipp = sipp + 1; *xipp; xipp++) {
+ if( (*sipp)->subsystem < (*xipp)->subsystem ||
+ ( (*sipp)->subsystem == (*xipp)->subsystem &&
+ (*sipp)->order < (*xipp)->order))
continue; /* skip*/
save = *sipp;
*sipp = *xipp;
@@ -139,15 +134,18 @@ linker_file_sysinit(linker_file_t lf)
/*
* Traverse the (now) ordered list of system initialization tasks.
* Perform each task, and continue on to the next task.
+ *
+ * The last item on the list is expected to be the scheduler,
+ * which will not return.
*/
- for (sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
- if ((*sipp)->subsystem == SI_SUB_DUMMY)
+ for( sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
+ if( (*sipp)->subsystem == SI_SUB_DUMMY)
continue; /* skip dummy task(s)*/
- switch ((*sipp)->type) {
+ switch( (*sipp)->type) {
case SI_TYPE_DEFAULT:
/* no special processing*/
- (*((*sipp)->func))((*sipp)->udata);
+ (*((*sipp)->func))( (*sipp)->udata);
break;
case SI_TYPE_KTHREAD:
@@ -169,65 +167,7 @@ linker_file_sysinit(linker_file_t lf)
break;
default:
- panic ("linker_file_sysinit: unrecognized init type");
- }
- }
-}
-
-static void
-linker_file_sysuninit(linker_file_t lf)
-{
- struct linker_set* sysuninits;
- struct sysinit** sipp;
- struct sysinit** xipp;
- struct sysinit* save;
-
- KLD_DPF(FILE, ("linker_file_sysuninit: calling SYSUNINITs for %s\n",
- lf->filename));
-
- sysuninits = (struct linker_set*)
- linker_file_lookup_symbol(lf, "sysuninit_set", 0);
-
- KLD_DPF(FILE, ("linker_file_sysuninit: SYSUNINITs %p\n", sysuninits));
- if (!sysuninits)
- return;
-
- /*
- * Perform a reverse bubble sort of the system initialization objects
- * by their subsystem (primary key) and order (secondary key).
- *
- * Since some things care about execution order, this is the
- * operation which ensures continued function.
- */
- for (sipp = (struct sysinit **)sysuninits->ls_items; *sipp; sipp++) {
- for (xipp = sipp + 1; *xipp; xipp++) {
- if ((*sipp)->subsystem >= (*xipp)->subsystem ||
- ((*sipp)->subsystem == (*xipp)->subsystem &&
- (*sipp)->order >= (*xipp)->order))
- continue; /* skip*/
- save = *sipp;
- *sipp = *xipp;
- *xipp = save;
- }
- }
-
-
- /*
- * Traverse the (now) ordered list of system initialization tasks.
- * Perform each task, and continue on to the next task.
- */
- for (sipp = (struct sysinit **)sysuninits->ls_items; *sipp; sipp++) {
- if ((*sipp)->subsystem == SI_SUB_DUMMY)
- continue; /* skip dummy task(s)*/
-
- switch ((*sipp)->type) {
- case SI_TYPE_DEFAULT:
- /* no special processing*/
- (*((*sipp)->func))((*sipp)->udata);
- break;
-
- default:
- panic("linker_file_sysuninit: unrecognized uninit type");
+ panic( "linker_file_sysinit: unrecognized init type");
}
}
}
@@ -237,8 +177,7 @@ linker_load_file(const char* filename, linker_file_t* result)
{
linker_class_t lc;
linker_file_t lf;
- int foundfile, error = 0;
- char *koname = NULL;
+ int error = 0;
lf = linker_find_file_by_name(filename);
if (lf) {
@@ -248,47 +187,22 @@ linker_load_file(const char* filename, linker_file_t* result)
goto out;
}
- koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK);
- if (koname == NULL) {
- error = ENOMEM;
- goto out;
- }
- sprintf(koname, "%s.ko", filename);
lf = NULL;
- foundfile = 0;
for (lc = TAILQ_FIRST(&classes); lc; lc = TAILQ_NEXT(lc, link)) {
KLD_DPF(FILE, ("linker_load_file: trying to load %s as %s\n",
filename, lc->desc));
-
- error = lc->ops->load_file(koname, &lf); /* First with .ko */
- if (lf == NULL && error == ENOENT)
- error = lc->ops->load_file(filename, &lf); /* Then try without */
- /*
- * If we got something other than ENOENT, then it exists but we cannot
- * load it for some other reason.
- */
- if (error != ENOENT)
- foundfile = 1;
+ if (error = lc->ops->load_file(filename, &lf))
+ goto out;
if (lf) {
linker_file_sysinit(lf);
*result = lf;
- error = 0;
goto out;
}
}
- /*
- * Less than ideal, but tells the user whether it failed to load or
- * the module was not found.
- */
- if (foundfile)
- error = ENOEXEC; /* Format not recognised (or unloadable) */
- else
- error = ENOENT; /* Nothing found */
+ error = ENOEXEC; /* format not recognised */
out:
- if (koname)
- free(koname, M_LINKER);
return error;
}
@@ -296,25 +210,13 @@ linker_file_t
linker_find_file_by_name(const char* filename)
{
linker_file_t lf = 0;
- char *koname;
-
- koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK);
- if (koname == NULL)
- goto out;
- sprintf(koname, "%s.ko", filename);
lockmgr(&lock, LK_SHARED, 0, curproc);
- for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link)) {
- if (!strcmp(lf->filename, koname))
- break;
+ for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link))
if (!strcmp(lf->filename, filename))
break;
- }
lockmgr(&lock, LK_RELEASE, 0, curproc);
-out:
- if (koname)
- free(koname, M_LINKER);
return lf;
}
@@ -410,8 +312,6 @@ linker_file_unload(linker_file_t file)
goto out;
}
- linker_file_sysuninit(file);
-
TAILQ_REMOVE(&files, file, link);
lockmgr(&lock, LK_RELEASE, 0, curproc);
@@ -459,7 +359,6 @@ linker_file_lookup_symbol(linker_file_t file, const char* name, int deps)
{
linker_sym_t sym;
linker_symval_t symval;
- linker_file_t lf;
caddr_t address;
size_t common_size = 0;
int i;
@@ -481,7 +380,7 @@ linker_file_lookup_symbol(linker_file_t file, const char* name, int deps)
}
}
- if (deps) {
+ if (deps)
for (i = 0; i < file->ndeps; i++) {
address = linker_file_lookup_symbol(file->deps[i], name, 0);
if (address) {
@@ -490,25 +389,6 @@ linker_file_lookup_symbol(linker_file_t file, const char* name, int deps)
}
}
- /* If we have not found it in the dependencies, search globally */
- for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link)) {
- /* But skip the current file if it's on the list */
- if (lf == file)
- continue;
- /* And skip the files we searched above */
- for (i = 0; i < file->ndeps; i++)
- if (lf == file->deps[i])
- break;
- if (i < file->ndeps)
- continue;
- address = linker_file_lookup_symbol(lf, name, 0);
- if (address) {
- KLD_DPF(SYM, ("linker_file_lookup_symbol: global value=%x\n", address));
- return address;
- }
- }
- }
-
if (common_size > 0) {
/*
* This is a common symbol which was not found in the
@@ -627,7 +507,7 @@ linker_ddb_symbol_values(linker_sym_t sym, linker_symval_t *symval)
int
kldload(struct proc* p, struct kldload_args* uap)
{
- char* filename = NULL, *modulename;
+ char* filename = NULL;
linker_file_t lf;
int error = 0;
@@ -643,16 +523,7 @@ kldload(struct proc* p, struct kldload_args* uap)
if (error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL))
goto out;
- /* Can't load more than one module with the same name */
- modulename = rindex(filename, '/');
- if (modulename == NULL)
- modulename = filename;
- if (linker_find_file_by_name(modulename)) {
- error = EEXIST;
- goto out;
- }
-
- if (error = linker_load_file(filename, &lf))
+ if (error = linker_load_file(uap->file, &lf))
goto out;
lf->userrefs++;
@@ -684,10 +555,8 @@ kldunload(struct proc* p, struct kldunload_args* uap)
error = EBUSY;
goto out;
}
- error = linker_file_unload(lf);
- if (error)
- goto out;
lf->userrefs--;
+ error = linker_file_unload(lf);
} else
error = ENOENT;
@@ -698,7 +567,7 @@ out:
int
kldfind(struct proc* p, struct kldfind_args* uap)
{
- char* filename = NULL, *modulename;
+ char* filename = NULL;
linker_file_t lf;
int error = 0;
@@ -708,11 +577,7 @@ kldfind(struct proc* p, struct kldfind_args* uap)
if (error = copyinstr(SCARG(uap, file), filename, MAXPATHLEN, NULL))
goto out;
- modulename = rindex(filename, '/');
- if (modulename == NULL)
- modulename = filename;
-
- lf = linker_find_file_by_name(modulename);
+ lf = linker_find_file_by_name(filename);
if (lf)
p->p_retval[0] = lf->id;
else
@@ -815,59 +680,6 @@ kldfirstmod(struct proc* p, struct kldfirstmod_args* uap)
return error;
}
-int
-kldsym(struct proc *p, struct kldsym_args *uap)
-{
- char *symstr = NULL;
- linker_sym_t sym;
- linker_symval_t symval;
- linker_file_t lf;
- struct kld_sym_lookup lookup;
- int error = 0;
-
- if (error = copyin(SCARG(uap, data), &lookup, sizeof(lookup)))
- goto out;
- if (lookup.version != sizeof(lookup) || SCARG(uap, cmd) != KLDSYM_LOOKUP) {
- error = EINVAL;
- goto out;
- }
-
- symstr = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
- if (error = copyinstr(lookup.symname, symstr, MAXPATHLEN, NULL))
- goto out;
-
- if (SCARG(uap, fileid) != 0) {
- lf = linker_find_file_by_id(SCARG(uap, fileid));
- if (lf == NULL) {
- error = ENOENT;
- goto out;
- }
- if (lf->ops->lookup_symbol(lf, symstr, &sym) == 0 &&
- lf->ops->symbol_values(lf, sym, &symval) == 0) {
- lookup.symvalue = (u_long)symval.value;
- lookup.symsize = symval.size;
- error = copyout(&lookup, SCARG(uap, data), sizeof(lookup));
- } else
- error = ENOENT;
- } else {
- for (lf = TAILQ_FIRST(&files); lf; lf = TAILQ_NEXT(lf, link)) {
- if (lf->ops->lookup_symbol(lf, symstr, &sym) == 0 &&
- lf->ops->symbol_values(lf, sym, &symval) == 0) {
- lookup.symvalue = (u_long)symval.value;
- lookup.symsize = symval.size;
- error = copyout(&lookup, SCARG(uap, data), sizeof(lookup));
- break;
- }
- }
- if (!lf)
- error = ENOENT;
- }
-out:
- if (symstr)
- free(symstr, M_TEMP);
- return error;
-}
-
/*
* Preloaded module support
*/
@@ -890,14 +702,14 @@ linker_preload(void* arg)
modname = (char *)preload_search_info(modptr, MODINFO_NAME);
modtype = (char *)preload_search_info(modptr, MODINFO_TYPE);
if (modname == NULL) {
- printf("Preloaded module at %p does not have a name!\n", modptr);
+ printf("Preloaded module at 0x%p does not have a name!\n", modptr);
continue;
}
if (modtype == NULL) {
- printf("Preloaded module at %p does not have a type!\n", modptr);
+ printf("Preloaded module at 0x%p does not have a type!\n", modptr);
continue;
}
- printf("Preloaded %s \"%s\" at %p.\n", modtype, modname, modptr);
+ printf("Preloaded %s \"%s\" at 0x%p.\n", modtype, modname, modptr);
lf = linker_find_file_by_name(modname);
if (lf) {
lf->userrefs++;
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c
index e5ea6297398d2..f7ca01d4b4a28 100644
--- a/sys/kern/kern_lkm.c
+++ b/sys/kern/kern_lkm.c
@@ -30,10 +30,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_lkm.c,v 1.59 1998/11/10 09:12:40 peter Exp $
+ * $Id: kern_lkm.c,v 1.56 1998/09/07 05:42:15 bde Exp $
*/
#include "opt_devfs.h"
+#include "opt_no_lkm.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -78,6 +79,16 @@ static int lkm_state = LKMS_IDLE;
static struct lkm_table lkmods[MAXLKMS]; /* table of loaded modules */
static struct lkm_table *curp; /* global for in-progress ops */
+/*
+ * XXX this bloat just exands the sysctl__vfs linker set a little so that
+ * we can attach sysctls for VFS LKMs without expanding the linker set.
+ * Currently (1998/09/06), only one VFS uses sysctls, so 2 extra linker
+ * set slots are more than sufficient.
+ */
+extern struct linker_set sysctl__vfs;
+SYSCTL_INT(_vfs, OID_AUTO, lkm0, CTLFLAG_RD, &lkm_v, 0, "");
+SYSCTL_INT(_vfs, OID_AUTO, lkm1, CTLFLAG_RD, &lkm_v, 0, "");
+
static int _lkm_dev __P((struct lkm_table *lkmtp, int cmd));
static int _lkm_exec __P((struct lkm_table *lkmtp, int cmd));
static int _lkm_vfs __P((struct lkm_table *lkmtp, int cmd));
@@ -239,7 +250,7 @@ lkmcioctl(dev, cmd, data, flag, p)
#ifdef DEBUG
printf("LKM: LMRESERV (actual = 0x%08lx)\n", curp->area);
- printf("LKM: LMRESERV (adjusted = 0x%08lx)\n",
+ printf("LKM: LMRESERV (adjusted = 0x%08x)\n",
trunc_page(curp->area));
#endif /* DEBUG */
lkm_state = LKMS_RESERVED;
@@ -480,6 +491,21 @@ lkmcioctl(dev, cmd, data, flag, p)
return (err);
}
+/*
+ * Acts like "nosys" but can be identified in sysent for dynamic call
+ * number assignment for a limited number of calls.
+ *
+ * Place holder for system call slots reserved for loadable modules.
+ */
+int
+lkmnosys(p, args)
+ struct proc *p;
+ struct nosys_args *args;
+{
+
+ return(nosys(p, args));
+}
+
int
lkmexists(lkmtp)
struct lkm_table *lkmtp;
@@ -522,16 +548,35 @@ _lkm_syscall(lkmtp, cmd)
/* don't load twice! */
if (lkmexists(lkmtp))
return(EEXIST);
+ if ((i = args->lkm_offset) == LKM_ANON) { /* auto */
+ /*
+ * Search the table looking for a slot...
+ */
+ for (i = 0; i < aout_sysvec.sv_size; i++)
+ if (aout_sysvec.sv_table[i].sy_call ==
+ (sy_call_t *)lkmnosys)
+ break; /* found it! */
+ /* out of allocable slots? */
+ if (i == aout_sysvec.sv_size) {
+ err = ENFILE;
+ break;
+ }
+ } else { /* assign */
+ if (i < 0 || i >= aout_sysvec.sv_size) {
+ err = EINVAL;
+ break;
+ }
+ }
- if (args->lkm_offset == LKM_ANON)
- i = NO_SYSCALL;
- else
- i = args->lkm_offset;
+ /* save old */
+ bcopy(&aout_sysvec.sv_table[i],
+ &(args->lkm_oldent),
+ sizeof(struct sysent));
- err = syscall_register(&i, args->lkm_sysent,
- &(args->lkm_oldent));
- if (err)
- return(err);
+ /* replace with new */
+ bcopy(args->lkm_sysent,
+ &aout_sysvec.sv_table[i],
+ sizeof(struct sysent));
/* done! */
args->lkm_offset = i; /* slot in sysent[] */
@@ -542,9 +587,11 @@ _lkm_syscall(lkmtp, cmd)
/* current slot... */
i = args->lkm_offset;
- err = syscall_deregister(&i, &(args->lkm_oldent));
- if (err)
- return(err);
+ /* replace current slot contents with old contents */
+ bcopy(&(args->lkm_oldent),
+ &aout_sysvec.sv_table[i],
+ sizeof(struct sysent));
+
break;
case LKM_E_STAT: /* no special handling... */
@@ -564,8 +611,11 @@ _lkm_vfs(lkmtp, cmd)
int cmd;
{
struct lkm_vfs *args = lkmtp->private.lkm_vfs;
+ struct linker_set *l;
+ struct sysctl_oid **oidpp;
struct vfsconf *vfc = args->lkm_vfsconf;
- int error, i;
+ struct vfsconf *vfsp, *prev_vfsp;
+ int error, i, maxtypenum;
switch(cmd) {
case LKM_E_LOAD:
@@ -573,13 +623,47 @@ _lkm_vfs(lkmtp, cmd)
if (lkmexists(lkmtp))
return(EEXIST);
- for(i = 0; args->lkm_vnodeops->ls_items[i]; i++)
- vfs_add_vnodeops((void*)args->lkm_vnodeops->ls_items[i]);
- error = vfs_register(vfc);
- if (error)
- return(error);
+ for (vfsp = vfsconf; vfsp->vfc_next; vfsp = vfsp->vfc_next) {
+ if (!strcmp(vfc->vfc_name, vfsp->vfc_name)) {
+ return EEXIST;
+ }
+ }
- args->lkm_offset = vfc->vfc_typenum;
+ args->lkm_offset = vfc->vfc_typenum = maxvfsconf++;
+ if (vfc->vfc_vfsops->vfs_oid != NULL) {
+ l = &sysctl__vfs;
+ for (i = l->ls_length,
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ i--; oidpp++) {
+ if (!*oidpp || *oidpp == &sysctl___vfs_lkm0 ||
+ *oidpp == &sysctl___vfs_lkm1) {
+ *oidpp = vfc->vfc_vfsops->vfs_oid;
+ (*oidpp)->oid_number = vfc->vfc_typenum;
+ sysctl_order_all();
+ break;
+ }
+ }
+ }
+
+ vfsp->vfc_next = vfc;
+ vfc->vfc_next = NULL;
+
+ /* like in vfs_op_init */
+ for(i = 0; args->lkm_vnodeops->ls_items[i]; i++) {
+ struct vnodeopv_desc *opv = (struct vnodeopv_desc *)
+ args->lkm_vnodeops->ls_items[i];
+ *(opv->opv_desc_vector_p) = NULL;
+ }
+ for(i = 0; args->lkm_vnodeops->ls_items[i]; i++) {
+ struct vnodeopv_desc *opv = (struct vnodeopv_desc *)
+ args->lkm_vnodeops->ls_items[i];
+ vfs_opv_init(opv);
+ }
+
+ /*
+ * Call init function for this VFS...
+ */
+ (*(vfc->vfc_vfsops->vfs_init))(vfc);
/* done! */
break;
@@ -588,12 +672,49 @@ _lkm_vfs(lkmtp, cmd)
/* current slot... */
i = args->lkm_offset;
- error = vfs_unregister(vfc);
- if (error)
- return(error);
+ prev_vfsp = NULL;
+ for (vfsp = vfsconf; vfsp;
+ prev_vfsp = vfsp, vfsp = vfsp->vfc_next) {
+ if (!strcmp(vfc->vfc_name, vfsp->vfc_name))
+ break;
+ }
+ if (vfsp == NULL) {
+ return EINVAL;
+ }
+
+ if (vfsp->vfc_refcount) {
+ return EBUSY;
+ }
+
+ if (vfc->vfc_vfsops->vfs_uninit != NULL) {
+ error = (*vfc->vfc_vfsops->vfs_uninit)(vfsp);
+ if (error)
+ return (error);
+ }
+
+ prev_vfsp->vfc_next = vfsp->vfc_next;
+
+ if (vfsp->vfc_vfsops->vfs_oid != NULL) {
+ l = &sysctl__vfs;
+ for (i = l->ls_length,
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ i--; oidpp++) {
+ if (*oidpp == vfsp->vfc_vfsops->vfs_oid) {
+ *oidpp = NULL;
+ sysctl_order_all();
+ break;
+ }
+ }
+ }
- for(i = 0; args->lkm_vnodeops->ls_items[i]; i++)
- vfs_rm_vnodeops((void*)args->lkm_vnodeops->ls_items[i]);
+ /*
+ * Maintain maxvfsconf.
+ */
+ maxtypenum = 0;
+ for (vfsp = vfsconf; vfsp != NULL; vfsp = vfsp->vfc_next)
+ if (maxtypenum < vfsp->vfc_typenum)
+ maxtypenum = vfsp->vfc_typenum;
+ maxvfsconf = maxtypenum + 1;
break;
@@ -707,7 +828,10 @@ _lkm_exec(lkmtp, cmd)
int cmd;
{
struct lkm_exec *args = lkmtp->private.lkm_exec;
+ int i;
int err = 0;
+ const struct execsw **execsw =
+ (const struct execsw **)&execsw_set.ls_items[0];
switch(cmd) {
case LKM_E_LOAD:
@@ -722,7 +846,7 @@ _lkm_exec(lkmtp, cmd)
err = exec_register(args->lkm_exec);
/* done! */
- args->lkm_offset = 0;
+ args->lkm_offset = 0; /* slot in execsw[] */
break;
@@ -799,40 +923,27 @@ lkm_nullcmd(lkmtp, cmd)
return (0);
}
+static lkm_devsw_installed = 0;
#ifdef DEVFS
static void *lkmc_devfs_token;
#endif
-static int
-lkm_modevent(module_t mod, int type, void *data)
+static void lkm_drvinit(void *unused)
{
dev_t dev;
- static struct cdevsw *oldcdevsw;
- switch (type) {
- case MOD_LOAD:
+ if( ! lkm_devsw_installed ) {
dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &lkmc_cdevsw, &oldcdevsw);
+ cdevsw_add(&dev,&lkmc_cdevsw, NULL);
+ lkm_devsw_installed = 1;
#ifdef DEVFS
lkmc_devfs_token = devfs_add_devswf(&lkmc_cdevsw, 0, DV_CHR,
UID_ROOT, GID_WHEEL, 0644,
"lkm");
#endif
- break;
- case MOD_UNLOAD:
-#ifdef DEVFS
- devfs_remove_dev(lkmc_devfs_token);
-#endif
- cdevsw_add(&dev, oldcdevsw, NULL);
- break;
- default:
- break;
- }
- return 0;
+ }
}
-static moduledata_t lkm_mod = {
- "lkm",
- lkm_modevent,
- NULL
-};
-DECLARE_MODULE(lkm, lkm_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR);
+
+#ifndef NO_LKM
+SYSINIT(lkmdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,lkm_drvinit,NULL)
+#endif
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index e832acff84a25..65a84ea9737f3 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* @(#)kern_lock.c 8.18 (Berkeley) 5/21/95
- * $Id: kern_lock.c,v 1.22 1999/01/10 01:58:24 eivind Exp $
+ * $Id: kern_lock.c,v 1.18 1998/03/07 19:25:34 dyson Exp $
*/
#include "opt_lint.h"
@@ -83,8 +83,14 @@ sharelock(struct lock *lkp, int incr) {
static LOCK_INLINE void
shareunlock(struct lock *lkp, int decr) {
-
- KASSERT(lkp->lk_sharecount >= decr, ("shareunlock: count < decr"));
+#if defined(DIAGNOSTIC)
+ if (lkp->lk_sharecount < decr)
+#if defined(DDB)
+ Debugger("shareunlock: count < decr");
+#else
+ panic("shareunlock: count < decr");
+#endif
+#endif
if (lkp->lk_sharecount == decr) {
lkp->lk_flags &= ~LK_SHARE_NONZERO;
@@ -171,20 +177,11 @@ acquire(struct lock *lkp, int extflags, int wanted) {
* accepted shared locks and shared-to-exclusive upgrades to go away.
*/
int
-#ifndef DEBUG_LOCKS
lockmgr(lkp, flags, interlkp, p)
-#else
-debuglockmgr(lkp, flags, interlkp, p, name, file, line)
-#endif
struct lock *lkp;
u_int flags;
struct simplelock *interlkp;
struct proc *p;
-#ifdef DEBUG_LOCKS
- const char *name; /* Name of lock function */
- const char *file; /* Name of file call is from */
- int line; /* Line number in file */
-#endif
{
int error;
pid_t pid;
@@ -292,11 +289,6 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
panic("lockmgr: non-zero exclusive count");
#endif
lkp->lk_exclusivecount = 1;
-#if defined(DEBUG_LOCKS)
- lkp->lk_filename = file;
- lkp->lk_lineno = line;
- lkp->lk_lockername = name;
-#endif
COUNT(p, 1);
break;
}
@@ -352,11 +344,6 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
panic("lockmgr: non-zero exclusive count");
#endif
lkp->lk_exclusivecount = 1;
-#if defined(DEBUG_LOCKS)
- lkp->lk_filename = file;
- lkp->lk_lineno = line;
- lkp->lk_lockername = name;
-#endif
COUNT(p, 1);
break;
@@ -402,11 +389,6 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
lkp->lk_flags |= LK_DRAINING | LK_HAVE_EXCL;
lkp->lk_lockholder = pid;
lkp->lk_exclusivecount = 1;
-#if defined(DEBUG_LOCKS)
- lkp->lk_filename = file;
- lkp->lk_lineno = line;
- lkp->lk_lockername = name;
-#endif
COUNT(p, 1);
break;
@@ -522,7 +504,7 @@ lockmgr_printinfo(lkp)
static int lockpausetime = 0;
SYSCTL_INT(_debug, OID_AUTO, lockpausetime, CTLFLAG_RW, &lockpausetime, 0, "");
-static int simplelockrecurse;
+int simplelockrecurse;
/*
* Simple lock functions so that the debugger can see from whence
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index cc1b8a562f209..bc73d382339b8 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -34,14 +34,13 @@
* SUCH DAMAGE.
*
* @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94
- * $Id: kern_lockf.c,v 1.19 1998/07/29 17:38:14 bde Exp $
+ * $Id: kern_lockf.c,v 1.18 1998/01/31 07:23:11 eivind Exp $
*/
#include "opt_debug_lockf.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/proc.h>
#include <sys/unistd.h>
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index a9776a5f9a8c5..618b726361c03 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94
- * $Id: kern_malloc.c,v 1.50 1999/01/08 17:31:09 eivind Exp $
+ * $Id: kern_malloc.c,v 1.46 1998/07/29 17:38:14 bde Exp $
*/
#include "opt_vm.h"
@@ -53,18 +53,19 @@
#include <vm/vm_map.h>
static void kmeminit __P((void *));
+static void malloc_init __P((struct malloc_type *));
SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
static MALLOC_DEFINE(M_FREE, "free", "should be on free list");
-static struct malloc_type *kmemstatistics;
+static struct malloc_type *kmemstatistics = M_FREE;
static struct kmembuckets bucket[MINBUCKET + 16];
static struct kmemusage *kmemusage;
static char *kmembase;
static char *kmemlimit;
static int vm_kmem_size;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* This structure provides a set of masks to catch unaligned frees.
*/
@@ -94,11 +95,11 @@ struct freelist {
long spare1;
caddr_t next;
};
-#else /* !INVARIANTS */
+#else /* !DIAGNOSTIC */
struct freelist {
caddr_t next;
};
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
/*
* Allocate a block of memory
@@ -115,7 +116,7 @@ malloc(size, type, flags)
long indx, npg, allocsize;
int s;
caddr_t va, cp, savedlist;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
long *end, *lp;
int copysize;
char *savedtype;
@@ -138,7 +139,7 @@ malloc(size, type, flags)
tsleep((caddr_t)ksp, PSWP+2, type->ks_shortdesc, 0);
}
ksp->ks_size |= 1 << indx;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
copysize = 1 << indx < MAX_COPY ? 1 << indx : MAX_COPY;
#endif
if (kbp->kb_next == NULL) {
@@ -174,7 +175,7 @@ malloc(size, type, flags)
kbp->kb_next = cp = va + (npg * PAGE_SIZE) - allocsize;
for (;;) {
freep = (struct freelist *)cp;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* Copy in known text to detect modification
* after freeing.
@@ -183,7 +184,7 @@ malloc(size, type, flags)
for (lp = (long *)cp; lp < end; lp++)
*lp = WEIRD_ADDR;
freep->type = M_FREE;
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
if (cp <= va)
break;
cp -= allocsize;
@@ -195,7 +196,7 @@ malloc(size, type, flags)
}
va = kbp->kb_next;
kbp->kb_next = ((struct freelist *)va)->next;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
freep = (struct freelist *)va;
savedtype = (char *) type->ks_shortdesc;
#if BYTE_ORDER == BIG_ENDIAN
@@ -219,7 +220,7 @@ malloc(size, type, flags)
break;
}
freep->spare0 = 0;
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
kup = btokup(va);
if (kup->ku_indx != indx)
panic("malloc: wrong bucket");
@@ -251,7 +252,7 @@ free(addr, type)
register struct freelist *freep;
long size;
int s;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
struct freelist *fp;
long *end, *lp, alloc, copysize;
#endif
@@ -260,13 +261,16 @@ free(addr, type)
if (!type->ks_next)
panic("freeing with unknown type (%s)", type->ks_shortdesc);
- KASSERT(kmembase <= (char *)addr && (char *)addr < kmemlimit,
- ("free: address %p out of range", (void *)addr));
+#ifdef DIAGNOSTIC
+ if ((char *)addr < kmembase || (char *)addr >= kmemlimit) {
+ panic("free: address %p out of range", (void *)addr);
+ }
+#endif
kup = btokup(addr);
size = 1 << kup->ku_indx;
kbp = &bucket[kup->ku_indx];
s = splmem();
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* Check for returns of data that do not point to the
* beginning of the allocation.
@@ -278,7 +282,7 @@ free(addr, type)
if (((uintptr_t)(void *)addr & alloc) != 0)
panic("free: unaligned addr %p, size %ld, type %s, mask %ld",
(void *)addr, size, type->ks_shortdesc, alloc);
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
if (size > MAXALLOCSAVE) {
kmem_free(kmem_map, (vm_offset_t)addr, ctob(kup->ku_pagecnt));
size = kup->ku_pagecnt << PAGE_SHIFT;
@@ -294,7 +298,7 @@ free(addr, type)
return;
}
freep = (struct freelist *)addr;
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
/*
* Check for multiple frees. Use a quick check to see if
* it looks free before laboriously searching the freelist.
@@ -302,10 +306,13 @@ free(addr, type)
if (freep->spare0 == WEIRD_ADDR) {
fp = (struct freelist *)kbp->kb_next;
while (fp) {
- if (fp->spare0 != WEIRD_ADDR)
- panic("free: free item %p modified", fp);
- else if (addr == (caddr_t)fp)
- panic("free: multiple freed item %p", addr);
+ if (fp->spare0 != WEIRD_ADDR) {
+ printf("trashed free item %p\n", fp);
+ panic("free: free item modified");
+ } else if (addr == (caddr_t)fp) {
+ printf("multiple freed item %p\n", addr);
+ panic("free: multiple free");
+ }
fp = (struct freelist *)fp->next;
}
}
@@ -320,7 +327,7 @@ free(addr, type)
for (lp = (long *)addr; lp < end; lp++)
*lp = WEIRD_ADDR;
freep->type = type;
-#endif /* INVARIANTS */
+#endif /* DIAGNOSTIC */
kup->ku_freecnt++;
if (kup->ku_freecnt >= kbp->kb_elmpercl)
if (kup->ku_freecnt > kbp->kb_elmpercl)
@@ -425,18 +432,16 @@ kmeminit(dummy)
}
}
-void
-malloc_init(data)
- void *data;
+static void
+malloc_init(type)
+ struct malloc_type *type;
{
- struct malloc_type *type = (struct malloc_type *)data;
+ int npg;
+ int mem_size;
if (type->ks_magic != M_MAGIC)
panic("malloc type lacks magic");
- if (type->ks_next)
- return;
-
if (cnt.v_page_count == 0)
panic("malloc_init not allowed before vm init");
@@ -448,28 +453,3 @@ malloc_init(data)
type->ks_next = kmemstatistics;
kmemstatistics = type;
}
-
-void
-malloc_uninit(data)
- void *data;
-{
- struct malloc_type *type = (struct malloc_type *)data;
- struct malloc_type *t;
-
- if (type->ks_magic != M_MAGIC)
- panic("malloc type lacks magic");
-
- if (cnt.v_page_count == 0)
- panic("malloc_uninit not allowed before vm init");
-
- if (type == kmemstatistics)
- kmemstatistics = type->ks_next;
- else {
- for (t = kmemstatistics; t->ks_next != NULL; t = t->ks_next) {
- if (t->ks_next == type) {
- t->ks_next = type->ks_next;
- break;
- }
- }
- }
-}
diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c
index afe9f2e2de78e..5555df3c663c4 100644
--- a/sys/kern/kern_module.c
+++ b/sys/kern/kern_module.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_module.c,v 1.13 1999/01/09 14:59:50 dfr Exp $
+ * $Id: kern_module.c,v 1.10 1998/10/10 00:03:07 peter Exp $
*/
#include <sys/param.h>
@@ -48,7 +48,6 @@ struct module {
char *name; /* module name */
modeventhand_t handler; /* event handler */
void *arg; /* argument for handler */
- modspecific_t data; /* module specific data */
};
#define MOD_EVENT(mod, type) (mod)->handler((mod), (type), (mod)->arg)
@@ -84,7 +83,7 @@ module_register_init(void *arg)
error = module_register(data->name, data->evhand, data->priv, data->_file);
if (error)
- printf("module_register_init: module_register(%s, %lx, %p) error %d\n",
+ printf("module_register_init: module_register(%s, %lx, %p) returned %d",
data->name, (u_long)(uintfptr_t)data->evhand, data->priv, error);
}
@@ -108,7 +107,6 @@ module_register(const char* name, modeventhand_t handler, void* arg, void *file)
strcpy(newmod->name, name);
newmod->handler = handler;
newmod->arg = arg;
- bzero(&newmod->data, sizeof(newmod->data));
TAILQ_INSERT_TAIL(&modules, newmod, link);
if (container == NULL)
@@ -198,12 +196,6 @@ module_getfnext(module_t mod)
return TAILQ_NEXT(mod, flink);
}
-void
-module_setspecific(module_t mod, modspecific_t *datap)
-{
- mod->data = *datap;
-}
-
/*
* Syscalls.
*/
@@ -251,13 +243,6 @@ modfnext(struct proc* p, struct modfnext_args* uap)
return 0;
}
-struct module_stat_v1 {
- int version; /* set to sizeof(struct module_stat) */
- char name[MAXMODNAME];
- int refs;
- int id;
-};
-
int
modstat(struct proc* p, struct modstat_args* uap)
{
@@ -278,8 +263,7 @@ modstat(struct proc* p, struct modstat_args* uap)
*/
if (error = copyin(&stat->version, &version, sizeof(version)))
goto out;
- if (version != sizeof(struct module_stat_v1)
- && version != sizeof(struct module_stat)) {
+ if (version != sizeof(struct module_stat)) {
error = EINVAL;
goto out;
}
@@ -295,14 +279,6 @@ modstat(struct proc* p, struct modstat_args* uap)
if (error = copyout(&mod->id, &stat->id, sizeof(int)))
goto out;
- /*
- * >v1 stat includes module data.
- */
- if (version == sizeof(struct module_stat)) {
- if (error = copyout(&mod->data, &stat->data, sizeof(mod->data)))
- goto out;
- }
-
p->p_retval[0] = 0;
out:
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 441d95fc5086d..17bd5b2c4fa64 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: kern_physio.c,v 1.28 1998/08/19 10:50:32 sos Exp $
+ * $Id: kern_physio.c,v 1.27 1998/07/04 22:30:21 julian Exp $
*/
#include <sys/param.h>
@@ -169,6 +169,7 @@ minphys(bp)
{
u_int maxphys = DFLTPHYS;
struct cdevsw *bdsw;
+ int offset;
bdsw = cdevsw[major(bp->b_dev)];
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 0c6feac328a0f..e229a5d4cd4e1 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_proc.c 8.7 (Berkeley) 2/14/95
- * $Id: kern_proc.c,v 1.42 1999/01/10 01:58:24 eivind Exp $
+ * $Id: kern_proc.c,v 1.36 1998/02/20 13:52:14 bde Exp $
*/
#include <sys/param.h>
@@ -40,7 +40,6 @@
#include <sys/sysctl.h>
#include <sys/proc.h>
#include <sys/malloc.h>
-#include <sys/filedesc.h>
#include <sys/tty.h>
#include <sys/signalvar.h>
#include <vm/vm.h>
@@ -195,19 +194,22 @@ enterpgrp(p, pgid, mksess)
{
register struct pgrp *pgrp = pgfind(pgid);
- KASSERT(pgrp == NULL || !mksess,
- ("enterpgrp: setsid into non-empty pgrp"));
- KASSERT(!SESS_LEADER(p),
- ("enterpgrp: session leader attempted setpgrp"));
-
+#ifdef DIAGNOSTIC
+ if (pgrp != NULL && mksess) /* firewalls */
+ panic("enterpgrp: setsid into non-empty pgrp");
+ if (SESS_LEADER(p))
+ panic("enterpgrp: session leader attempted setpgrp");
+#endif
if (pgrp == NULL) {
pid_t savepid = p->p_pid;
struct proc *np;
/*
* new process group
*/
- KASSERT(p->p_pid == pgid,
- ("enterpgrp: new pgrp and pid != pgid"));
+#ifdef DIAGNOSTIC
+ if (p->p_pid != pgid)
+ panic("enterpgrp: new pgrp and pid != pgid");
+#endif
MALLOC(pgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP,
M_WAITOK);
if ((np = pfind(savepid)) == NULL || np != p)
@@ -221,7 +223,6 @@ enterpgrp(p, pgid, mksess)
MALLOC(sess, struct session *, sizeof(struct session),
M_SESSION, M_WAITOK);
sess->s_leader = p;
- sess->s_sid = p->p_pid;
sess->s_count = 1;
sess->s_ttyvp = NULL;
sess->s_ttyp = NULL;
@@ -229,8 +230,10 @@ enterpgrp(p, pgid, mksess)
sizeof(sess->s_login));
p->p_flag &= ~P_CONTROLT;
pgrp->pg_session = sess;
- KASSERT(p == curproc,
- ("enterpgrp: mksession and p != curproc"));
+#ifdef DIAGNOSTIC
+ if (p != curproc)
+ panic("enterpgrp: mksession and p != curproc");
+#endif
} else {
pgrp->pg_session = p->p_session;
pgrp->pg_session->s_count++;
@@ -239,7 +242,6 @@ enterpgrp(p, pgid, mksess)
LIST_INIT(&pgrp->pg_members);
LIST_INSERT_HEAD(PGRPHASH(pgid), pgrp, pg_hash);
pgrp->pg_jobc = 0;
- SLIST_INIT(&pgrp->pg_sigiolst);
} else if (pgrp == p->p_pgrp)
return (0);
@@ -282,12 +284,6 @@ pgdelete(pgrp)
register struct pgrp *pgrp;
{
- /*
- * Reset any sigio structures pointing to us as a result of
- * F_SETOWN with our pgid.
- */
- funsetownlst(&pgrp->pg_sigiolst);
-
if (pgrp->pg_session->s_ttyp != NULL &&
pgrp->pg_session->s_ttyp->t_pgrp == pgrp)
pgrp->pg_session->s_ttyp->t_pgrp = NULL;
@@ -415,11 +411,6 @@ fill_eproc(p, ep)
if (p->p_ucred)
ep->e_ucred = *p->p_ucred;
}
-#ifdef COMPAT_LINUX_THREADS
- if (p->p_procsig){
- ep->e_procsig = *p->p_procsig;
- }
-#endif
if (p->p_stat != SIDL && p->p_stat != SZOMB && p->p_vmspace != NULL) {
register struct vmspace *vm = p->p_vmspace;
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index e5e1a3eacb073..24abb73f0ba6d 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_prot.c 8.6 (Berkeley) 1/21/94
- * $Id: kern_prot.c,v 1.42 1998/11/10 09:16:29 peter Exp $
+ * $Id: kern_prot.c,v 1.39 1997/12/20 03:05:46 sef Exp $
*/
/*
@@ -49,7 +49,6 @@
#include <sys/acct.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/unistd.h>
@@ -122,16 +121,13 @@ getpgid(p, uap)
struct proc *p;
struct getpgid_args *uap;
{
- struct proc *pt;
-
- pt = p;
if (uap->pid == 0)
goto found;
- if ((pt = pfind(uap->pid)) == 0)
+ if ((p == pfind(uap->pid)) == 0)
return ESRCH;
found:
- p->p_retval[0] = pt->p_pgrp->pg_id;
+ p->p_retval[0] = p->p_pgrp->pg_id;
return 0;
}
@@ -149,16 +145,13 @@ getsid(p, uap)
struct proc *p;
struct getsid_args *uap;
{
- struct proc *pt;
-
- pt = p;
if (uap->pid == 0)
goto found;
- if ((pt == pfind(uap->pid)) == 0)
+ if ((p == pfind(uap->pid)) == 0)
return ESRCH;
found:
- p->p_retval[0] = pt->p_session->s_sid;
+ p->p_retval[0] = p->p_pgrp->pg_session->s_leader->p_pid;
return 0;
}
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 4d6db416a02de..ff6997ce43d28 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_shutdown.c,v 1.43 1998/12/04 22:54:51 archie Exp $
+ * $Id: kern_shutdown.c,v 1.39 1998/09/15 08:49:52 gibbs Exp $
*/
#include "opt_ddb.h"
@@ -49,7 +49,6 @@
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/proc.h>
-#include <sys/vnode.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/mount.h>
@@ -80,9 +79,9 @@
#ifdef DDB
#ifdef DDB_UNATTENDED
-int debugger_on_panic = 0;
+static int debugger_on_panic = 0;
#else
-int debugger_on_panic = 1;
+static int debugger_on_panic = 1;
#endif
SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW,
&debugger_on_panic, 0, "");
@@ -112,7 +111,6 @@ typedef struct shutdown_list_element {
LIST_ENTRY(shutdown_list_element) links;
bootlist_fn function;
void *arg;
- int priority;
} *sle_p;
/*
@@ -225,21 +223,6 @@ boot(howto)
sync(&proc0, NULL);
DELAY(50000 * iter);
}
- /*
- * Count only busy local buffers to prevent forcing
- * a fsck if we're just a client of a wedged NFS server
- */
- nbusy = 0;
- for (bp = &buf[nbuf]; --bp >= buf; ) {
- if (((bp->b_flags & (B_BUSY | B_INVAL)) == B_BUSY)
- ||((bp->b_flags & (B_DELWRI | B_INVAL))== B_DELWRI))
- if(bp->b_dev == NODEV)
- CIRCLEQ_REMOVE(&mountlist, bp->b_vp->v_mount, mnt_list);
- else
- nbusy++;
-
-
- }
if (nbusy) {
/*
* Failed to sync all blocks. Indicate this and don't
@@ -292,6 +275,7 @@ boot(howto)
(*ep->function)(howto, ep->arg);
if (howto & RB_HALT) {
+ cpu_power_down();
printf("\n");
printf("The operating system has halted.\n");
printf("Please press any key to reboot.\n\n");
@@ -427,7 +411,7 @@ panic(const char *fmt, ...)
panicstr = fmt;
va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf), fmt, ap);
+ (void)vsprintf(buf, fmt, ap);
if (panicstr == fmt)
panicstr = buf;
va_end(ap);
@@ -447,7 +431,7 @@ panic(const char *fmt, ...)
}
/*
- * Three routines to handle adding/deleting items on the
+ * Two routines to handle adding/deleting items on the
* shutdown callout lists
*
* at_shutdown():
@@ -458,19 +442,7 @@ panic(const char *fmt, ...)
int
at_shutdown(bootlist_fn function, void *arg, int queue)
{
- return(at_shutdown_pri(function, arg, queue, SHUTDOWN_PRI_DEFAULT));
-}
-
-/*
- * at_shutdown_pri():
- * Take the arguments given and put them onto the shutdown callout list
- * with the given execution priority.
- * returns 0 on success.
- */
-int
-at_shutdown_pri(bootlist_fn function, void *arg, int queue, int pri)
-{
- sle_p ep, ip;
+ sle_p ep;
if (queue < SHUTDOWN_PRE_SYNC
|| queue > SHUTDOWN_FINAL) {
@@ -485,23 +457,7 @@ at_shutdown_pri(bootlist_fn function, void *arg, int queue, int pri)
return (ENOMEM);
ep->function = function;
ep->arg = arg;
- ep->priority = pri;
-
- /* Sort into list of items on this queue */
- ip = LIST_FIRST(&shutdown_lists[queue]);
- if (ip == NULL) {
- LIST_INSERT_HEAD(&shutdown_lists[queue], ep, links);
- } else {
- for (; LIST_NEXT(ip, links) != NULL; ip = LIST_NEXT(ip, links)) {
- if (ep->priority < ip->priority) {
- LIST_INSERT_BEFORE(ip, ep, links);
- ep = NULL;
- break;
- }
- }
- if (ep != NULL)
- LIST_INSERT_AFTER(ip, ep, links);
- }
+ LIST_INSERT_HEAD(&shutdown_lists[queue], ep, links);
return (0);
}
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index bf89d8a745de0..f164ed6cf14ed 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sig.c 8.7 (Berkeley) 4/18/94
- * $Id: kern_sig.c,v 1.52 1999/01/08 17:31:10 eivind Exp $
+ * $Id: kern_sig.c,v 1.46 1998/09/14 05:36:49 jdp Exp $
*/
#include "opt_compat.h"
@@ -86,16 +86,6 @@ SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, &kern_logsigexit, 0,
(pc)->pc_ucred->cr_uid == (q)->p_ucred->cr_uid || \
((signum) == SIGCONT && (q)->p_session == (p)->p_session))
-/*
- * Policy -- Can real uid ruid with ucred uc send a signal to process q?
- */
-#define CANSIGIO(ruid, uc, q) \
- ((uc)->cr_uid == 0 || \
- (ruid) == (q)->p_cred->p_ruid || \
- (uc)->cr_uid == (q)->p_cred->p_ruid || \
- (ruid) == (q)->p_ucred->cr_uid || \
- (uc)->cr_uid == (q)->p_ucred->cr_uid)
-
int sugid_coredump;
SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "");
@@ -135,17 +125,9 @@ sigaction(p, uap)
sa->sa_flags |= SA_RESETHAND;
if ((ps->ps_signodefer & bit) != 0)
sa->sa_flags |= SA_NODEFER;
-#ifndef COMPAT_LINUX_THREADS
if (signum == SIGCHLD && p->p_flag & P_NOCLDSTOP)
-#else
- if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDSTOP)
-#endif /* COMPAT_LINUX_THREADS */
sa->sa_flags |= SA_NOCLDSTOP;
-#ifndef COMPAT_LINUX_THREADS
if (signum == SIGCHLD && p->p_flag & P_NOCLDWAIT)
-#else
- if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDWAIT)
-#endif /* COMPAT_LINUX_THREADS */
sa->sa_flags |= SA_NOCLDWAIT;
if ((error = copyout((caddr_t)sa, (caddr_t)uap->osa,
sizeof (vec))))
@@ -203,15 +185,9 @@ setsigvec(p, signum, sa)
#endif
if (signum == SIGCHLD) {
if (sa->sa_flags & SA_NOCLDSTOP)
-#ifndef COMPAT_LINUX_THREADS
p->p_flag |= P_NOCLDSTOP;
else
p->p_flag &= ~P_NOCLDSTOP;
-#else
- p->p_procsig->ps_flag |= P_NOCLDSTOP;
- else
- p->p_procsig->ps_flag &= ~P_NOCLDSTOP;
-#endif /* COMPAT_LINUX_THREADS */
if (sa->sa_flags & SA_NOCLDWAIT) {
/*
* Paranoia: since SA_NOCLDWAIT is implemented by
@@ -220,21 +196,11 @@ setsigvec(p, signum, sa)
* forbidden to set SA_NOCLDWAIT.
*/
if (p->p_pid == 1)
-#ifndef COMPAT_LINUX_THREADS
p->p_flag &= ~P_NOCLDWAIT;
else
p->p_flag |= P_NOCLDWAIT;
-#else
- p->p_procsig->ps_flag &= ~P_NOCLDWAIT;
- else
- p->p_procsig->ps_flag |= P_NOCLDWAIT;
-#endif /* COMPAT_LINUX_THREADS */
} else
-#ifndef COMPAT_LINUX_THREADS
p->p_flag &= ~P_NOCLDWAIT;
-#else
- p->p_procsig->ps_flag &= ~P_NOCLDWAIT;
-#endif /* COMPAT_LINUX_THREADS */
}
/*
* Set bit in p_sigignore for signals that are set to SIG_IGN,
@@ -409,11 +375,7 @@ osigvec(p, uap)
if ((ps->ps_signodefer & bit) != 0)
sv->sv_flags |= SV_NODEFER;
#ifndef COMPAT_SUNOS
-#ifndef COMPAT_LINUX_THREADS
if (signum == SIGCHLD && p->p_flag & P_NOCLDSTOP)
-#else
- if (signum == SIGCHLD && p->p_procsig->ps_flag & P_NOCLDSTOP)
-#endif /* COMPAT_LINUX_THREADS */
sv->sv_flags |= SV_NOCLDSTOP;
#endif
if ((error = copyout((caddr_t)sv, (caddr_t)uap->osv,
@@ -498,12 +460,8 @@ sigsuspend(p, uap)
* save it here and mark the sigacts structure
* to indicate this.
*/
-#ifndef COMPAT_LINUX_THREADS
ps->ps_oldmask = p->p_sigmask;
ps->ps_flags |= SAS_OLDMASK;
-#else
- p->p_oldsigmask = p->p_sigmask;
-#endif /* COMPAT_LINUX_THREADS */
p->p_sigmask = uap->mask &~ sigcantmask;
while (tsleep((caddr_t) ps, PPAUSE|PCATCH, "pause", 0) == 0)
/* void */;
@@ -762,13 +720,8 @@ trapsignal(p, signum, code)
ps->ps_sigact[signum] = SIG_DFL;
}
} else {
-#ifndef COMPAT_LINUX_THREADS
ps->ps_code = code; /* XXX for core dump/debugger */
ps->ps_sig = signum; /* XXX to verify code */
-#else
- p->p_code = code; /* XXX for core dump/debugger */
- p->p_sig = signum; /* XXX to verify code */
-#endif /* COMPAT_LINUX_THREADS */
psignal(p, signum);
}
}
@@ -817,11 +770,7 @@ psignal(p, signum)
* and if it is set to SIG_IGN,
* action will be SIG_DFL here.)
*/
-#ifndef COMPAT_LINUX_THREADS
if (p->p_sigignore & mask)
-#else
- if ((p->p_sigignore & mask) || (p->p_flag & P_WEXIT))
-#endif /* COMPAT_LINUX_THREADS */
return;
if (p->p_sigmask & mask)
action = SIG_HOLD;
@@ -903,11 +852,7 @@ psignal(p, signum)
goto out;
p->p_siglist &= ~mask;
p->p_xstat = signum;
-#ifndef COMPAT_LINUX_THREADS
if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0)
-#else
- if ((p->p_pptr->p_procsig->ps_flag & P_NOCLDSTOP) == 0)
-#endif /* COMPAT_LINUX_THREADS */
psignal(p->p_pptr, SIGCHLD);
stop(p);
goto out;
@@ -1114,11 +1059,7 @@ issignal(p)
break; /* == ignore */
p->p_xstat = signum;
stop(p);
-#ifndef COMPAT_LINUX_THREADS
if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0)
-#else
- if ((p->p_pptr->p_procsig->ps_flag & P_NOCLDSTOP) == 0)
-#endif /* COMPAT_LINUX_THREADS */
psignal(p->p_pptr, SIGCHLD);
mi_switch();
break;
@@ -1183,21 +1124,18 @@ postsig(signum)
register sig_t action;
int code, mask, returnmask;
- KASSERT(signum != 0, ("postsig"));
-
+#ifdef DIAGNOSTIC
+ if (signum == 0)
+ panic("postsig");
+#endif
mask = sigmask(signum);
p->p_siglist &= ~mask;
action = ps->ps_sigact[signum];
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG))
ktrpsig(p->p_tracep,
-#ifndef COMPAT_LINUX_THREADS
signum, action, ps->ps_flags & SAS_OLDMASK ?
ps->ps_oldmask : p->p_sigmask, 0);
-#else
- signum, action, p->p_oldsigmask ?
- p->p_oldsigmask : p->p_sigmask, 0);
-#endif /* COMPAT_LINUX_THREADS */
#endif
STOPEVENT(p, S_SIG, signum);
@@ -1212,8 +1150,10 @@ postsig(signum)
/*
* If we get here, the signal must be caught.
*/
- KASSERT(action != SIG_IGN && (p->p_sigmask & mask) == 0,
- ("postsig action"));
+#ifdef DIAGNOSTIC
+ if (action == SIG_IGN || (p->p_sigmask & mask))
+ panic("postsig action");
+#endif
/*
* Set the new mask value and also defer further
* occurences of this signal.
@@ -1224,15 +1164,9 @@ postsig(signum)
* restored after the signal processing is completed.
*/
(void) splhigh();
-#ifndef COMPAT_LINUX_THREADS
if (ps->ps_flags & SAS_OLDMASK) {
returnmask = ps->ps_oldmask;
ps->ps_flags &= ~SAS_OLDMASK;
-#else
- if (p->p_oldsigmask) {
- returnmask = p->p_oldsigmask;
- p->p_oldsigmask = 0;
-#endif /* COMPAT_LINUX_THREADS */
} else
returnmask = p->p_sigmask;
p->p_sigmask |= ps->ps_catchmask[signum] |
@@ -1248,22 +1182,12 @@ postsig(signum)
}
(void) spl0();
p->p_stats->p_ru.ru_nsignals++;
-#ifndef COMPAT_LINUX_THREADS
if (ps->ps_sig != signum) {
-#else
- if (p->p_sig != signum) {
-#endif /* COMPAT_LINUX_THREADS */
code = 0;
} else {
-#ifndef COMPAT_LINUX_THREADS
code = ps->ps_code;
ps->ps_code = 0;
ps->ps_sig = 0;
-#else
- code = p->p_code;
- p->p_code = 0;
- p->p_sig = 0;
-#endif /* COMPAT_LINUX_THREADS */
}
(*p->p_sysent->sv_sendsig)(action, signum, returnmask, code);
}
@@ -1298,17 +1222,17 @@ sigexit(p, signum)
p->p_acflag |= AXSIG;
if (sigprop[signum] & SA_CORE) {
-#ifndef COMPAT_LINUX_THREADS
p->p_sigacts->ps_sig = signum;
-#else
- p->p_sig = signum;
-#endif /* COMPAT_LINUX_THREADS */
/*
* Log signals which would cause core dumps
* (Log as LOG_INFO to appease those who don't want
* these messages.)
* XXX : Todo, as well as euid, write out ruid too
*/
+
+ /* Use the correct function to dump core, as stored in
+ the sysentvec struct. This way we can do ELF and a.out
+ dumps without breaking a sweat. */
if (p->p_sysent->sv_coredump != NULL &&
(*p->p_sysent->sv_coredump)(p) == 0)
signum |= WCOREFLAG;
@@ -1349,8 +1273,6 @@ const char *name; int uid; int pid; {
char *format = corefilename;
temp = malloc(MAXPATHLEN + 3, M_TEMP, M_NOWAIT);
- if (temp == NULL)
- return NULL;
bzero(temp, MAXPATHLEN+3);
for (i = 0, n = 0; i < MAXPATHLEN && format[i]; i++) {
int l;
@@ -1426,30 +1348,3 @@ nosys(p, args)
psignal(p, SIGSYS);
return (EINVAL);
}
-
-/*
- * Send a signal to a SIGIO or SIGURG to a process or process group using
- * stored credentials rather than those of the current process.
- */
-void
-pgsigio(sigio, signum, checkctty)
- struct sigio *sigio;
- int signum, checkctty;
-{
- if (sigio == NULL)
- return;
-
- if (sigio->sio_pgid > 0) {
- if (CANSIGIO(sigio->sio_ruid, sigio->sio_ucred,
- sigio->sio_proc))
- psignal(sigio->sio_proc, signum);
- } else if (sigio->sio_pgid < 0) {
- struct proc *p;
-
- for (p = sigio->sio_pgrp->pg_members.lh_first; p != NULL;
- p = p->p_pglist.le_next)
- if (CANSIGIO(sigio->sio_ruid, sigio->sio_ucred, p) &&
- (checkctty == 0 || (p->p_flag & P_CONTROLT)))
- psignal(p, signum);
- }
-}
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index a96d554b6517c..548cd20e1c8b3 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_subr.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_subr.c,v 1.23 1999/01/08 17:31:10 eivind Exp $
+ * $Id: kern_subr.c,v 1.21 1998/07/15 02:32:10 bde Exp $
*/
#include <sys/param.h>
@@ -61,11 +61,12 @@ uiomove(cp, n, uio)
u_int cnt;
int error;
- KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE,
- ("uiomove: mode"));
- KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_procp == curproc,
- ("uiomove proc"));
-
+#ifdef DIAGNOSTIC
+ if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
+ panic("uiomove: mode");
+ if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
+ panic("uiomove proc");
+#endif
while (n > 0 && uio->uio_resid) {
iov = uio->uio_iov;
cnt = iov->iov_len;
@@ -119,11 +120,12 @@ uiomoveco(cp, n, uio, obj)
u_int cnt;
int error;
- KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE,
- ("uiomoveco: mode"));
- KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_procp == curproc,
- ("uiomoveco proc"));
-
+#ifdef DIAGNOSTIC
+ if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
+ panic("uiomove: mode");
+ if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
+ panic("uiomove proc");
+#endif
while (n > 0 && uio->uio_resid) {
iov = uio->uio_iov;
cnt = iov->iov_len;
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index f8baf85461cae..2d5105514a20f 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
- * $Id: kern_synch.c,v 1.71 1999/01/08 17:31:10 eivind Exp $
+ * $Id: kern_synch.c,v 1.61 1998/07/15 02:32:10 bde Exp $
*/
#include "opt_ktrace.h"
@@ -138,9 +138,7 @@ static void
roundrobin(arg)
void *arg;
{
-#ifndef SMP
struct proc *p = curproc; /* XXX */
-#endif
#ifdef SMP
need_resched();
@@ -225,8 +223,8 @@ roundrobin(arg)
static fixpt_t ccpu = 0.95122942450071400909 * FSCALE; /* exp(-1/20) */
SYSCTL_INT(_kern, OID_AUTO, ccpu, CTLFLAG_RD, &ccpu, 0, "");
-/* kernel uses `FSCALE', userland (SHOULD) use kern.fscale */
-static int fscale __unused = FSCALE;
+/* kernel uses `FSCALE', user uses `fscale' */
+static int fscale = FSCALE;
SYSCTL_INT(_kern, OID_AUTO, fscale, CTLFLAG_RD, 0, FSCALE, "");
/*
@@ -253,10 +251,9 @@ schedcpu(arg)
{
register fixpt_t loadfac = loadfactor(averunnable.ldavg[0]);
register struct proc *p;
- register int realstathz, s;
+ register int s;
register unsigned int newcpu;
- realstathz = stathz ? stathz : hz;
for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
/*
* Increment time in/out of memory and sleep time
@@ -278,13 +275,13 @@ schedcpu(arg)
* p_pctcpu is only for ps.
*/
#if (FSHIFT >= CCPU_SHIFT)
- p->p_pctcpu += (realstathz == 100)?
+ p->p_pctcpu += (hz == 100)?
((fixpt_t) p->p_cpticks) << (FSHIFT - CCPU_SHIFT):
100 * (((fixpt_t) p->p_cpticks)
- << (FSHIFT - CCPU_SHIFT)) / realstathz;
+ << (FSHIFT - CCPU_SHIFT)) / hz;
#else
p->p_pctcpu += ((FSCALE - ccpu) *
- (p->p_cpticks * FSCALE / realstathz)) >> FSHIFT;
+ (p->p_cpticks * FSCALE / hz)) >> FSHIFT;
#endif
p->p_cpticks = 0;
newcpu = (u_int) decay_cpu(loadfac, p->p_estcpu) + p->p_nice;
@@ -401,15 +398,15 @@ tsleep(ident, priority, wmesg, timo)
splx(s);
return (0);
}
- KASSERT(p != NULL, ("tsleep1"));
- KASSERT(ident != NULL && p->p_stat == SRUN, ("tsleep"));
- /*
- * Process may be sitting on a slpque if asleep() was called, remove
- * it before re-adding.
- */
- if (p->p_wchan != NULL)
- unsleep(p);
-
+#ifdef DIAGNOSTIC
+ if(p == NULL)
+ panic("tsleep1");
+ if (ident == NULL || p->p_stat != SRUN)
+ panic("tsleep");
+ /* XXX This is not exhaustive, just the most common case */
+ if ((p->p_procq.tqe_prev != NULL) && (*p->p_procq.tqe_prev == p))
+ panic("sleeping process already on another queue");
+#endif
p->p_wchan = ident;
p->p_wmesg = wmesg;
p->p_slptime = 0;
@@ -475,170 +472,7 @@ resume:
}
/*
- * asleep() - async sleep call. Place process on wait queue and return
- * immediately without blocking. The process stays runnable until await()
- * is called. If ident is NULL, remove process from wait queue if it is still
- * on one.
- *
- * Only the most recent sleep condition is effective when making successive
- * calls to asleep() or when calling tsleep().
- *
- * The timeout, if any, is not initiated until await() is called. The sleep
- * priority, signal, and timeout is specified in the asleep() call but may be
- * overriden in the await() call.
- *
- * <<<<<<<< EXPERIMENTAL, UNTESTED >>>>>>>>>>
- */
-
-int
-asleep(void *ident, int priority, const char *wmesg, int timo)
-{
- struct proc *p = curproc;
- int s;
-
- /*
- * splhigh() while manipulating sleep structures and slpque.
- *
- * Remove preexisting wait condition (if any) and place process
- * on appropriate slpque, but do not put process to sleep.
- */
-
- s = splhigh();
-
- if (p->p_wchan != NULL)
- unsleep(p);
-
- if (ident) {
- p->p_wchan = ident;
- p->p_wmesg = wmesg;
- p->p_slptime = 0;
- p->p_asleep.as_priority = priority;
- p->p_asleep.as_timo = timo;
- TAILQ_INSERT_TAIL(&slpque[LOOKUP(ident)], p, p_procq);
- }
-
- splx(s);
-
- return(0);
-}
-
-/*
- * await() - wait for async condition to occur. The process blocks until
- * wakeup() is called on the most recent asleep() address. If wakeup is called
- * priority to await(), await() winds up being a NOP.
- *
- * If await() is called more then once (without an intervening asleep() call),
- * await() is still effectively a NOP but it calls mi_switch() to give other
- * processes some cpu before returning. The process is left runnable.
- *
- * <<<<<<<< EXPERIMENTAL, UNTESTED >>>>>>>>>>
- */
-
-int
-await(int priority, int timo)
-{
- struct proc *p = curproc;
- int s;
-
- s = splhigh();
-
- if (p->p_wchan != NULL) {
- struct callout_handle thandle;
- int sig;
- int catch;
-
- /*
- * The call to await() can override defaults specified in
- * the original asleep().
- */
- if (priority < 0)
- priority = p->p_asleep.as_priority;
- if (timo < 0)
- timo = p->p_asleep.as_timo;
-
- /*
- * Install timeout
- */
-
- if (timo)
- thandle = timeout(endtsleep, (void *)p, timo);
-
- sig = 0;
- catch = priority & PCATCH;
-
- if (catch) {
- p->p_flag |= P_SINTR;
- if ((sig = CURSIG(p))) {
- if (p->p_wchan)
- unsleep(p);
- p->p_stat = SRUN;
- goto resume;
- }
- if (p->p_wchan == NULL) {
- catch = 0;
- goto resume;
- }
- }
- p->p_stat = SSLEEP;
- p->p_stats->p_ru.ru_nvcsw++;
- mi_switch();
-resume:
- curpriority = p->p_usrpri;
-
- splx(s);
- p->p_flag &= ~P_SINTR;
- if (p->p_flag & P_TIMEOUT) {
- p->p_flag &= ~P_TIMEOUT;
- if (sig == 0) {
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_CSW))
- ktrcsw(p->p_tracep, 0, 0);
-#endif
- return (EWOULDBLOCK);
- }
- } else if (timo)
- untimeout(endtsleep, (void *)p, thandle);
- if (catch && (sig != 0 || (sig = CURSIG(p)))) {
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_CSW))
- ktrcsw(p->p_tracep, 0, 0);
-#endif
- if (p->p_sigacts->ps_sigintr & sigmask(sig))
- return (EINTR);
- return (ERESTART);
- }
-#ifdef KTRACE
- if (KTRPOINT(p, KTR_CSW))
- ktrcsw(p->p_tracep, 0, 0);
-#endif
- } else {
- /*
- * If as_priority is 0, await() has been called without an
- * intervening asleep(). We are still effectively a NOP,
- * but we call mi_switch() for safety.
- */
-
- if (p->p_asleep.as_priority == 0) {
- p->p_stats->p_ru.ru_nvcsw++;
- mi_switch();
- }
- splx(s);
- }
-
- /*
- * clear p_asleep.as_priority as an indication that await() has been
- * called. If await() is called again without an intervening asleep(),
- * await() is still effectively a NOP but the above mi_switch() code
- * is triggered as a safety.
- */
- p->p_asleep.as_priority = 0;
-
- return (0);
-}
-
-/*
- * Implement timeout for tsleep or asleep()/await()
- *
+ * Implement timeout for tsleep.
* If process hasn't been awakened (wchan non-zero),
* set timeout flag and undo the sleep. If proc
* is stopped, just unsleep so it will remain stopped.
@@ -694,6 +528,10 @@ wakeup(ident)
qp = &slpque[LOOKUP(ident)];
restart:
for (p = qp->tqh_first; p != NULL; p = p->p_procq.tqe_next) {
+#ifdef DIAGNOSTIC
+ if (p->p_stat != SSLEEP && p->p_stat != SSTOP)
+ panic("wakeup");
+#endif
if (p->p_wchan == ident) {
TAILQ_REMOVE(qp, p, p_procq);
p->p_wchan = 0;
@@ -735,6 +573,10 @@ wakeup_one(ident)
qp = &slpque[LOOKUP(ident)];
for (p = qp->tqh_first; p != NULL; p = p->p_procq.tqe_next) {
+#ifdef DIAGNOSTIC
+ if (p->p_stat != SSLEEP && p->p_stat != SSTOP)
+ panic("wakeup_one");
+#endif
if (p->p_wchan == ident) {
TAILQ_REMOVE(qp, p, p_procq);
p->p_wchan = 0;
@@ -805,8 +647,7 @@ mi_switch()
* Check if the process exceeds its cpu resource allocation.
* If over max, kill it.
*/
- if (p->p_stat != SZOMB && p->p_limit->p_cpulimit != RLIM_INFINITY &&
- p->p_runtime > p->p_limit->p_cpulimit) {
+ if (p->p_stat != SZOMB && p->p_runtime > p->p_limit->p_cpulimit) {
rlim = &p->p_rlimit[RLIMIT_CPU];
if (p->p_runtime / (rlim_t)1000000 >= rlim->rlim_max) {
killproc(p, "exceeded maximum CPU limit");
diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c
deleted file mode 100644
index e1192a918c5bb..0000000000000
--- a/sys/kern/kern_syscalls.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * Copyright (c) 1999 Assar Westerlund
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: kern_syscalls.c,v 1.2 1999/01/09 14:59:50 dfr Exp $
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/sysproto.h>
-#include <sys/sysent.h>
-#include <sys/syscall.h>
-#include <sys/module.h>
-#include <sys/linker.h>
-#include <sys/proc.h>
-
-/*
- * Acts like "nosys" but can be identified in sysent for dynamic call
- * number assignment for a limited number of calls.
- *
- * Place holder for system call slots reserved for loadable modules.
- */
-int
-lkmnosys(struct proc *p, struct nosys_args *args)
-{
- return(nosys(p, args));
-}
-
-int
-syscall_register(int *offset, struct sysent *new_sysent,
- struct sysent *old_sysent)
-{
- if (*offset == NO_SYSCALL) {
- int i;
-
- for (i = 1; i < SYS_MAXSYSCALL; ++i)
- if (sysent[i].sy_call == (sy_call_t *)lkmnosys)
- break;
- if (i == SYS_MAXSYSCALL)
- return ENFILE;
- *offset = i;
- } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL)
- return EINVAL;
- else if (sysent[*offset].sy_call != (sy_call_t *)lkmnosys)
- return EEXIST;
-
- *old_sysent = sysent[*offset];
- sysent[*offset] = *new_sysent;
- return 0;
-}
-
-int
-syscall_deregister(int *offset, struct sysent *old_sysent)
-{
- if (*offset)
- sysent[*offset] = *old_sysent;
- return 0;
-}
-
-int
-syscall_module_handler(struct module *mod, int what, void *arg)
-{
- struct syscall_module_data *data = (struct syscall_module_data*)arg;
- modspecific_t ms;
- int error;
-
- switch (what) {
- case MOD_LOAD :
- error = syscall_register(data->offset, data->new_sysent,
- &data->old_sysent);
- if (error)
- return error;
- ms.intval = *data->offset;
- module_setspecific(mod, &ms);
- break;
- case MOD_UNLOAD :
- error = syscall_deregister(data->offset, &data->old_sysent);
- if (error)
- return error;
- break;
- }
- if (data->chainevh)
- return data->chainevh(mod, what, data->chainarg);
- else
- return 0;
-}
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index fbf2f6a99389d..c3e221fc0fd9d 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
- * $Id: kern_sysctl.c,v 1.81 1998/12/27 18:03:29 dfr Exp $
+ * $Id: kern_sysctl.c,v 1.77 1998/09/05 17:13:27 bde Exp $
*/
#include "opt_compat.h"
@@ -225,7 +225,7 @@ sysctl_sysctl_name SYSCTL_HANDLER_ARGS
while (namelen) {
if (!lsp) {
- snprintf(buf,sizeof(buf),"%d",*name);
+ sprintf(buf,"%d",*name);
if (req->oldidx)
error = SYSCTL_OUT(req, ".", 1);
if (!error)
@@ -497,7 +497,7 @@ SYSCTL_NODE(_sysctl, 4, oidfmt, CTLFLAG_RD, sysctl_sysctl_oidfmt, "");
*/
/*
- * Handle an int, signed or unsigned.
+ * Handle an integer, signed or unsigned.
* Two cases:
* a variable: point arg1 at it.
* a constant: pass it in arg2.
@@ -524,7 +524,7 @@ sysctl_handle_int SYSCTL_HANDLER_ARGS
}
/*
- * Handle a long, signed or unsigned.
+ * Handle an integer, signed or unsigned.
* Two cases:
* a variable: point arg1 at it.
* a constant: pass it in arg2.
@@ -535,7 +535,10 @@ sysctl_handle_long SYSCTL_HANDLER_ARGS
{
int error = 0;
- error = SYSCTL_OUT(req, arg1, sizeof(long));
+ if (arg1)
+ error = SYSCTL_OUT(req, arg1, sizeof(long));
+ else
+ error = SYSCTL_OUT(req, &arg2, sizeof(long));
if (error || !req->newptr)
return (error);
@@ -548,6 +551,33 @@ sysctl_handle_long SYSCTL_HANDLER_ARGS
}
/*
+ * Handle an integer, signed or unsigned.
+ * Two cases:
+ * a variable: point arg1 at it.
+ * a constant: pass it in arg2.
+ */
+
+int
+sysctl_handle_intptr SYSCTL_HANDLER_ARGS
+{
+ int error = 0;
+
+ if (arg1)
+ error = SYSCTL_OUT(req, arg1, sizeof(intptr_t));
+ else
+ error = SYSCTL_OUT(req, &arg2, sizeof(intptr_t));
+
+ if (error || !req->newptr)
+ return (error);
+
+ if (!arg1)
+ error = EPERM;
+ else
+ error = SYSCTL_IN(req, arg1, sizeof(intptr_t));
+ return (error);
+}
+
+/*
* Handle our generic '\0' terminated 'C' string.
* Two cases:
* a variable string: point arg1 at it, arg2 is max length.
@@ -774,8 +804,7 @@ sysctl_root SYSCTL_HANDLER_ARGS
return ENOENT;
found:
/* If writing isn't allowed */
- if (req->newptr && (!((*oidpp)->oid_kind & CTLFLAG_WR) ||
- (((*oidpp)->oid_kind & CTLFLAG_SECURE) && securelevel > 0)))
+ if (req->newptr && !((*oidpp)->oid_kind & CTLFLAG_WR))
return (EPERM);
/* Most likely only root can write */
diff --git a/sys/kern/kern_threads.c b/sys/kern/kern_threads.c
index 57e8d96eb4f8f..1121f09837d18 100644
--- a/sys/kern/kern_threads.c
+++ b/sys/kern/kern_threads.c
@@ -46,7 +46,7 @@
* in Germany will I accept domestic beer. This code may or may not work
* and I certainly make no claims as to its fitness for *any* purpose.
*
- * $Id: kern_threads.c,v 1.9 1998/10/25 17:44:51 phk Exp $
+ * $Id: kern_threads.c,v 1.7 1998/03/30 09:50:18 phk Exp $
*/
#include <sys/param.h>
@@ -71,7 +71,7 @@ thr_sleep(struct proc *p, struct thr_sleep_args *uap) {
int sleepstart;
struct timespec ts;
struct timeval atv;
- int error, timo;
+ int error, s, timo;
timo = 0;
if (uap->timeout != 0) {
@@ -86,7 +86,7 @@ thr_sleep(struct proc *p, struct thr_sleep_args *uap) {
p->p_wakeup = 0;
return (EINVAL);
}
- TIMESPEC_TO_TIMEVAL(&atv, &ts);
+ TIMESPEC_TO_TIMEVAL(&atv, &ts)
if (itimerfix(&atv)) {
p->p_wakeup = 0;
return (EINVAL);
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 2bd17bb6bdcb7..c269355a8a62d 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_time.c 8.1 (Berkeley) 6/10/93
- * $Id: kern_time.c,v 1.58 1998/06/09 13:10:53 phk Exp $
+ * $Id: kern_time.c,v 1.57 1998/05/17 20:13:01 bde Exp $
*/
#include <sys/param.h>
@@ -79,6 +79,7 @@ settime(tv)
{
struct timeval delta, tv1;
struct timespec ts;
+ struct proc *p;
int s;
s = splclock();
diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c
index 29b588489b681..80e9e1f5ffd0c 100644
--- a/sys/kern/link_aout.c
+++ b/sys/kern/link_aout.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: link_aout.c,v 1.16 1998/11/03 14:25:21 peter Exp $
+ * $Id: link_aout.c,v 1.13 1998/10/09 23:49:28 peter Exp $
*/
#ifndef __alpha__
@@ -55,6 +55,13 @@ static int link_aout_search_symbol(linker_file_t lf, caddr_t value,
static void link_aout_unload_file(linker_file_t);
static void link_aout_unload_module(linker_file_t);
+/*
+ * The file representing the currently running kernel. This contains
+ * the global symbol table.
+ */
+
+static linker_file_t linker_kernel_file;
+
static struct linker_class_ops link_aout_class_ops = {
link_aout_load_module,
};
@@ -119,7 +126,7 @@ link_aout_init(void* arg)
#endif
}
-SYSINIT(link_aout, SI_SUB_KLD, SI_ORDER_THIRD, link_aout_init, 0);
+SYSINIT(link_aout, SI_SUB_KLD, SI_ORDER_SECOND, link_aout_init, 0);
static int
link_aout_load_module(const char* filename, linker_file_t* result)
@@ -301,10 +308,8 @@ load_dependancies(linker_file_t lf)
/*
* All files are dependant on /kernel.
*/
- if (linker_kernel_file) {
- linker_kernel_file->refs++;
- linker_file_add_dependancy(lf, linker_kernel_file);
- }
+ linker_kernel_file->refs++;
+ linker_file_add_dependancy(lf, linker_kernel_file);
off = LD_NEED(af->dynamic);
@@ -556,6 +561,7 @@ link_aout_search_symbol(linker_file_t lf, caddr_t value,
struct nzlist* sp;
struct nzlist* ep;
struct nzlist* best = 0;
+ int i;
for (sp = AOUT_RELOC(af, struct nzlist, LD_SYMBOL(af->dynamic)),
ep = (struct nzlist *) ((caddr_t) sp + LD_STABSZ(af->dynamic));
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index c5e84daf0a3e2..26b6213745d98 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: link_elf.c,v 1.10 1998/11/06 15:16:07 peter Exp $
+ * $Id: link_elf.c,v 1.6 1998/10/15 17:16:24 peter Exp $
*/
#include <sys/param.h>
@@ -58,6 +58,13 @@ static int link_elf_search_symbol(linker_file_t, caddr_t value,
static void link_elf_unload_file(linker_file_t);
static void link_elf_unload_module(linker_file_t);
+/*
+ * The file representing the currently running kernel. This contains
+ * the global symbol table.
+ */
+
+linker_file_t linker_kernel_file;
+
static struct linker_class_ops link_elf_class_ops = {
link_elf_load_module,
};
@@ -393,8 +400,10 @@ link_elf_load_file(const char* filename, linker_file_t* result)
{
struct nameidata nd;
struct proc* p = curproc; /* XXX */
- Elf_Ehdr *hdr;
- caddr_t firstpage;
+ union {
+ Elf_Ehdr hdr;
+ char buf[PAGE_SIZE];
+ } u;
int nbytes, i;
Elf_Phdr *phdr;
Elf_Phdr *phlimit;
@@ -407,6 +416,17 @@ link_elf_load_file(const char* filename, linker_file_t* result)
Elf_Off base_offset;
Elf_Addr base_vaddr;
Elf_Addr base_vlimit;
+ caddr_t base_addr;
+ Elf_Off data_offset;
+ Elf_Addr data_vaddr;
+ Elf_Addr data_vlimit;
+ caddr_t data_addr;
+ Elf_Addr clear_vaddr;
+ caddr_t clear_addr;
+ size_t nclear;
+ Elf_Addr bss_vaddr;
+ Elf_Addr bss_vlimit;
+ caddr_t bss_addr;
int error = 0;
int resid;
elf_file_t ef;
@@ -424,7 +444,6 @@ link_elf_load_file(const char* filename, linker_file_t* result)
pathname = linker_search_path(filename);
if (pathname == NULL)
return ENOENT;
-
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, pathname, p);
error = vn_open(&nd, FREAD, 0);
free(pathname, M_LINKER);
@@ -434,41 +453,35 @@ link_elf_load_file(const char* filename, linker_file_t* result)
/*
* Read the elf header from the file.
*/
- firstpage = malloc(PAGE_SIZE, M_LINKER, M_WAITOK);
- if (firstpage == NULL) {
- error = ENOMEM;
- goto out;
- }
- hdr = (Elf_Ehdr *)firstpage;
- error = vn_rdwr(UIO_READ, nd.ni_vp, firstpage, PAGE_SIZE, 0,
+ error = vn_rdwr(UIO_READ, nd.ni_vp, (void*) &u, sizeof u, 0,
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
- nbytes = PAGE_SIZE - resid;
+ nbytes = sizeof u - resid;
if (error)
goto out;
- if (!IS_ELF(*hdr)) {
+ if (!IS_ELF(u.hdr)) {
error = ENOEXEC;
goto out;
}
- if (hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS
- || hdr->e_ident[EI_DATA] != ELF_TARG_DATA) {
+ if (u.hdr.e_ident[EI_CLASS] != ELF_TARG_CLASS
+ || u.hdr.e_ident[EI_DATA] != ELF_TARG_DATA) {
link_elf_error("Unsupported file layout");
error = ENOEXEC;
goto out;
}
- if (hdr->e_ident[EI_VERSION] != EV_CURRENT
- || hdr->e_version != EV_CURRENT) {
+ if (u.hdr.e_ident[EI_VERSION] != EV_CURRENT
+ || u.hdr.e_version != EV_CURRENT) {
link_elf_error("Unsupported file version");
error = ENOEXEC;
goto out;
}
- if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN) {
+ if (u.hdr.e_type != ET_EXEC && u.hdr.e_type != ET_DYN) {
link_elf_error("Unsupported file type");
error = ENOEXEC;
goto out;
}
- if (hdr->e_machine != ELF_TARG_MACH) {
+ if (u.hdr.e_machine != ELF_TARG_MACH) {
link_elf_error("Unsupported machine");
error = ENOEXEC;
goto out;
@@ -479,9 +492,9 @@ link_elf_load_file(const char* filename, linker_file_t* result)
* not strictly required by the ABI specification, but it seems to
* always true in practice. And, it simplifies things considerably.
*/
- if (!((hdr->e_phentsize == sizeof(Elf_Phdr)) &&
- (hdr->e_phoff + hdr->e_phnum*sizeof(Elf_Phdr) <= PAGE_SIZE) &&
- (hdr->e_phoff + hdr->e_phnum*sizeof(Elf_Phdr) <= nbytes)))
+ if (!((u.hdr.e_phentsize == sizeof(Elf_Phdr))
+ || (u.hdr.e_phoff + u.hdr.e_phnum*sizeof(Elf_Phdr) <= PAGE_SIZE)
+ || (u.hdr.e_phoff + u.hdr.e_phnum*sizeof(Elf_Phdr) <= nbytes)))
link_elf_error("Unreadable program headers");
/*
@@ -490,8 +503,8 @@ link_elf_load_file(const char* filename, linker_file_t* result)
* We rely on there being exactly two load segments, text and data,
* in that order.
*/
- phdr = (Elf_Phdr *) (firstpage + hdr->e_phoff);
- phlimit = phdr + hdr->e_phnum;
+ phdr = (Elf_Phdr *) (u.buf + u.hdr.e_phoff);
+ phlimit = phdr + u.hdr.e_phnum;
nsegs = 0;
phdyn = NULL;
phphdr = NULL;
@@ -623,8 +636,8 @@ link_elf_load_file(const char* filename, linker_file_t* result)
goto out;
/* Try and load the symbol table if it's present. (you can strip it!) */
- nbytes = hdr->e_shnum * hdr->e_shentsize;
- if (nbytes == 0 || hdr->e_shoff == 0)
+ nbytes = u.hdr.e_shnum * u.hdr.e_shentsize;
+ if (nbytes == 0 || u.hdr.e_shoff == 0)
goto nosyms;
shdr = malloc(nbytes, M_LINKER, M_WAITOK);
if (shdr == NULL) {
@@ -633,13 +646,13 @@ link_elf_load_file(const char* filename, linker_file_t* result)
}
bzero(shdr, nbytes);
error = vn_rdwr(UIO_READ, nd.ni_vp,
- (caddr_t)shdr, nbytes, hdr->e_shoff,
+ (caddr_t)shdr, nbytes, u.hdr.e_shoff,
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
if (error)
goto out;
symtabindex = -1;
symstrindex = -1;
- for (i = 0; i < hdr->e_shnum; i++) {
+ for (i = 0; i < u.hdr.e_shnum; i++) {
if (shdr[i].sh_type == SHT_SYMTAB) {
symtabindex = i;
symstrindex = shdr[i].sh_link;
@@ -682,8 +695,6 @@ out:
linker_file_unload(lf);
if (shdr)
free(shdr, M_LINKER);
- if (firstpage)
- free(firstpage, M_LINKER);
VOP_UNLOCK(nd.ni_vp, 0, p);
vn_close(nd.ni_vp, FREAD, p->p_ucred, p);
@@ -738,11 +749,10 @@ load_dependancies(linker_file_t lf)
/*
* All files are dependant on /kernel.
*/
- if (linker_kernel_file) {
- linker_kernel_file->refs++;
- linker_file_add_dependancy(lf, linker_kernel_file);
- }
+ linker_kernel_file->refs++;
+ linker_file_add_dependancy(lf, linker_kernel_file);
+
for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) {
if (dp->d_tag == DT_NEEDED) {
name = ef->strtab + dp->d_un.d_val;
@@ -788,10 +798,8 @@ relocate_file(linker_file_t lf)
rellim = (const Elf_Rel *) ((caddr_t) ef->rel + ef->relsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
- if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rel, ELF_RELOC_REL, symname))
return ENOENT;
- }
rel++;
}
}
@@ -802,10 +810,8 @@ relocate_file(linker_file_t lf)
relalim = (const Elf_Rela *) ((caddr_t) ef->rela + ef->relasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
- if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname))
return ENOENT;
- }
rela++;
}
}
@@ -816,10 +822,8 @@ relocate_file(linker_file_t lf)
rellim = (const Elf_Rel *) ((caddr_t) ef->pltrel + ef->pltrelsize);
while (rel < rellim) {
symname = symbol_name(ef, rel->r_info);
- if (elf_reloc(lf, rel, ELF_RELOC_REL, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rel, ELF_RELOC_REL, symname))
return ENOENT;
- }
rel++;
}
}
@@ -830,10 +834,8 @@ relocate_file(linker_file_t lf)
relalim = (const Elf_Rela *) ((caddr_t) ef->pltrela + ef->pltrelasize);
while (rela < relalim) {
symname = symbol_name(ef, rela->r_info);
- if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname)) {
- printf("link_elf: symbol %s undefined\n", symname);
+ if (elf_reloc(lf, rela, ELF_RELOC_RELA, symname))
return ENOENT;
- }
rela++;
}
}
diff --git a/sys/kern/makedevops.pl b/sys/kern/makedevops.pl
deleted file mode 100644
index 24e0b146a3f4b..0000000000000
--- a/sys/kern/makedevops.pl
+++ /dev/null
@@ -1,394 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (c) 1992, 1993
-# The Regents of the University of California. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# From @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93
-# From @(#)makedevops.sh 1.1 1998/06/14 13:53:12 dfr Exp $
-# From @(#)makedevops.sh ?.? 1998/10/05
-
-#
-# Script to produce device front-end sugar.
-#
-
-$debug = 0;
-$cfile = 0; # by default do not produce any file type
-$hfile = 0;
-
-$keepcurrentdir = 1;
-
-$line_width = 80;
-
-use File::Basename;
-
-# Process the command line
-#
-while ( $arg = shift @ARGV ) {
- if ( $arg eq '-c' ) {
- warn "Producing .c output files"
- if $debug;
- $cfile = 1;
- } elsif ( $arg eq '-h' ) {
- warn "Producing .h output files"
- if $debug;
- $hfile = 1;
- } elsif ( $arg eq '-ch' || $arg eq '-hc' ) {
- warn "Producing .c and .h output files"
- if $debug;
- $cfile = 1;
- $hfile = 1;
- } elsif ( $arg eq '-d' ) {
- $debug = 1;
- } elsif ( $arg eq '-p' ) {
- warn "Will produce files in original not in current directory"
- if $debug;
- $keepcurrentdir = 0;
- } elsif ( $arg eq '-l' ) {
- if ( $line_width = shift @ARGV and $line_width > 0 ) {
- warn "Line width set to $line_width"
- if $debug;
- } else {
- die "Please specify a valid line width after -l";
- }
- } elsif ( $arg =~ m/\.m$/ ) {
- warn "Filename: $arg"
- if $debug;
- push @filenames, $arg;
- } else {
- warn "$arg ignored"
- if $debug;
- }
-}
-
-
-# Validate the command line parameters
-#
-die "usage: $0 [-d] [-p] [-c|-h] srcfile
-where -c produce only .c files
- -h produce only .h files
- -p use the path component in the source file for destination dir
- -l set line width for output files [80]
- -d switch on debugging
-"
- unless ($cfile or $hfile)
- and $#filenames != -1;
-
-# FIXME should be able to do this more easily
-#
-$tmpdir = $ENV{'TMPDIR'}; # environment variables
-$tmpdir = $ENV{'TMP'}
- if !$tmpdir;
-$tmpdir = $ENV{'TEMP'}
- if !$tmpdir;
-$tmpdir = '/tmp' # look for a physical directory
- if !$tmpdir and -d '/tmp';
-$tmpdir = '/usr/tmp'
- if !$tmpdir and -d '/usr/tmp';
-$tmpdir = '/var/tmp'
- if !$tmpdir and -d '/var/tmp';
-$tmpdir = '.' # give up and use current dir
- if !$tmpdir;
-
-foreach $src ( @filenames ) {
- # Names of the created files
- $ctmpname = "$tmpdir/ctmp.$$";
- $htmpname = "$tmpdir/htmp.$$";
-
- ($name, $path, $suffix) = &fileparse($src, '.m');
- $path = '.'
- if $keepcurrentdir;
- $cfilename="$path/$name.c";
- $hfilename="$path/$name.h";
-
- warn "Processing from $src to $cfile / $hfile via $ctmp / $htmp"
- if $debug;
-
- die "Could not open $src, $!"
- if !open SRC, "$src";
- die "Could not open $ctmpname, $!"
- if $cfile and !open CFILE, ">$ctmpname";
- die "Could not open $htmpname, $!"
- if $hfile and !open HFILE, ">$htmpname";
-
- if ( $cfile ) {
- # Produce the header of the C file
- #
- print CFILE "/*\n";
- print CFILE " * This file is produced automatically.\n";
- print CFILE " * Do not modify anything in here by hand.\n";
- print CFILE " *\n";
- print CFILE " * Created from\n";
- print CFILE " * $src\n";
- print CFILE " * with\n";
- print CFILE " * $0\n";
- print CFILE " */\n";
- print CFILE "\n";
- print CFILE "#include <sys/param.h>\n";
- print CFILE "#include <sys/queue.h>\n";
- print CFILE "#include <sys/bus_private.h>\n";
- }
-
- if ( $hfile ) {
- # Produce the header of the H file
- #
- print HFILE "/*\n";
- print HFILE " * This file is produced automatically.\n";
- print HFILE " * Do not modify anything in here by hand.\n";
- print HFILE " *\n";
- print HFILE " * Created from\n";
- print HFILE " * $src\n";
- print HFILE " * with\n";
- print HFILE " * $0\n";
- print HFILE " */\n";
- print HFILE "\n";
- }
-
- %methods = (); # clear list of methods
- $lineno = 0;
- $error = 0; # to signal clean up and gerror setting
-
- LINE: while ( $line = <SRC> ) {
- $lineno++;
-
- # take special notice of include directives.
- #
- if ( $line =~ m/^#\s*include\s+(["<])([^">]+)([">]).*/i ) {
- warn "Included file: $1$2" . ($1 eq '<'? '>':'"')
- if $debug;
- print CFILE "#include $1$2" . ($1 eq '<'? '>':'"') . "\n"
- if $cfile;
- }
-
- $line =~ s/#.*//; # remove comments
- $line =~ s/^\s+//; # remove leading ...
- $line =~ s/\s+$//; # remove trailing whitespace
-
- if ( $line =~ m/^$/ ) { # skip empty lines
- # nop
-
- } elsif ( $line =~ m/^INTERFACE\s*([^\s;]*)(\s*;?)/i ) {
- $intname = $1;
- $semicolon = $2;
- unless ( $intname =~ m/^[a-z_][a-z0-9_]*$/ ) {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid interface name '$intname', use [a-z_][a-z0-9_]*";
- $error = 1;
- last LINE;
- }
-
- warn "$src:$lineno: semicolon missing at end of line, no problem"
- if $semicolon !~ s/;$//;
-
- warn "Interface $intname"
- if $debug;
-
- print HFILE '#ifndef _'.$intname."_if_h_\n"
- if $hfile;
- print HFILE '#define _'.$intname."_if_h_\n\n"
- if $hfile;
- print CFILE '#include "'.$intname.'_if.h"'."\n\n"
- if $cfile;
-
- } elsif ( $line =~ m/^METHOD/i ) {
- # Get the return type function name and delete that from
- # the line. What is left is the possibly first function argument
- # if it is on the same line.
- #
- # FIXME For compatibilities sake METHOD and METHODE is accepted.
- #
- if ( !$intname ) {
- warn "$src:$lineno: No interface name defined";
- $error = 1;
- last LINE;
- }
- $line =~ s/^METHODE?\s+([^{]+?)\s*{\s*//i;
- @ret = split m/\s+/, $1;
- $name = pop @ret; # last element is name of method
- $ret = join(" ", @ret); # return type
-
- warn "Method: name=$name return type=$ret"
- if $debug;
-
- if ( !$name or !$ret ) {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid method specification";
- $error = 1;
- last LINE;
- }
-
- unless ( $name =~ m/^[a-z_][a-z_0-9]*$/ ) {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid method name '$name', use [a-z_][a-z0-9_]*";
- $error = 1;
- last LINE;
- }
-
- if ( defined($methods{$name}) ) {
- warn "$src:$lineno: Duplicate method name";
- $error = 1;
- last LINE;
- }
-
- $methods{$name} = 'VIS';
-
- while ( $line !~ m/}/ and $line .= <SRC> ) { }
-
- if ( $line !~ s/};?(.*)// ) { # remove first '}' and trailing garbage
- # The '}' was not there (the rest is optional), so complain
- warn "$src:$lineno: Premature end of file";
- $error = 1;
- last LINE;
- }
- warn "$src:$lineno: Ignored '$1'" # warn about garbage at end of line
- if $debug and $1;
-
- # Create a list of variables without the types prepended
- #
- $line =~ s/^\s+//; # remove leading ...
- $line =~ s/\s+$//; # ... and trailing whitespace
- $line =~ s/\s+/ /; # remove double spaces
-
- @arguments = split m/\s*;\s*/, $line;
- @varnames = (); # list of varnames
- foreach $argument (@arguments) {
- next # skip argument if argument is empty
- if !$argument;
-
- @ar = split m/[*\s]+/, $argument;
- if ( $#ar == 0 ) { # only 1 word in argument?
- warn "$src:$lineno: no type for '$argument'";
- $error = 1;
- last LINE;
- }
-
- push @varnames, $ar[-1]; # last element is name of variable
- };
-
- warn 'Arguments: ' . join(', ', @arguments) . "\n"
- . 'Varnames: ' . join(', ', @varnames)
- if $debug;
-
- $mname = $intname.'_'.$name; # method name
- $umname = uc($mname); # uppercase method name
-
- $arguments = join(", ", @arguments);
- $varnames = join(", ", @varnames);
-
- if ( $hfile ) {
- # the method description
- print HFILE "extern struct device_op_desc $mname\_desc;\n";
- # the method typedef
- print HFILE &format_line("typedef $ret $mname\_t($arguments);",
- $line_width, ', ',
- ',',' ' x length("typedef $ret $mname\_t("))
- . "\n";
- # the method declaration
- print HFILE "$mname\_t $umname;\n\n";
- }
-
- if ( $cfile ) {
- # Print out the method desc
- print CFILE "struct device_op_desc $mname\_desc = {\n";
- print CFILE "\t0, \"$mname\"\n";
- print CFILE "};\n\n";
-
- # Print out the method itself
- if ( 0 ) { # haven't chosen the format yet
- print CFILE "$ret $umname($varnames)\n";
- print CFILE "\t".join(";\n\t", @arguments).";\n";
- } else {
- print CFILE &format_line("$ret $umname($arguments)",
- $line_width, ', ',
- ',', ' ' x length("$ret $umname(")) . "\n";
- }
- print CFILE "{\n";
- print CFILE &format_line("\t$mname\_t *m = ($mname\_t *) DEVOPMETH(dev, $mname);",
- $line_width-8, ' = ', ' =', "\t\t")
- . "\n";
- print CFILE "\t".($ret eq 'void'? '':'return ') . "m($varnames);\n";
- print CFILE "}\n\n";
- }
- } else {
- warn $line
- if $debug;
- warn "$src:$lineno: Invalid line encountered";
- $error = 1;
- last LINE;
- }
- } # end LINE
-
- # print the final '#endif' in the header file
- #
- print HFILE "#endif /* _".$intname."_if_h_ */\n"
- if $hfile;
-
- close SRC;
- close CFILE
- if $cfile;
- close HFILE
- if $hfile;
-
- if ( !$error ) {
- if ( $cfile ) {
- ($rc = system("mv $ctmpname $cfilename"))
- and warn "mv $ctmpname $cfilename failed, $rc";
- }
-
- if ( $hfile ) {
- ($rc = system("mv $htmpname $hfilename"))
- and warn "mv $htmpname $hfilename failed, $rc";
- }
- } else {
- warn 'File' . ($hfile and $cfile? 's':'') . ' skipped';
- ($rc = system("rm -f $htmpname $ctmpname"))
- and warn "rm -f $htmpname $ctmpname failed, $rc";
- $gerror = 1;
- }
-}
-
-exit $gerror;
-
-
-sub format_line {
- my ($line, $maxlength, $break, $new_end, $new_start) = @_;
- my $rline = "";
-
- while ( length($line) > $maxlength
- and ($i = rindex $line, $break, $maxlength-length($new_end)) != -1 ) {
- $rline .= substr($line, 0, $i) . $new_end . "\n";
- $line = $new_start . substr($line, $i+length($break));
- }
-
- return $rline . $line;
-}
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index 92347324ec60f..2ab21f521d1b3 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -41,7 +41,7 @@
*
* @(#)subr_autoconf.c 8.1 (Berkeley) 6/10/93
*
- * $Id: subr_autoconf.c,v 1.7 1998/12/04 22:54:51 archie Exp $
+ * $Id: subr_autoconf.c,v 1.5 1997/09/21 22:00:18 gibbs Exp $
*/
#include <sys/param.h>
@@ -334,12 +334,14 @@ evcnt_attach(dev, name, ev)
{
static struct evcnt **nextp = &allevents;
- KASSERT(strlen(name) < sizeof(ev->ev_name), ("evcnt_attach"));
-
+#ifdef DIAGNOSTIC
+ if (strlen(name) >= sizeof(ev->ev_name))
+ panic("evcnt_attach");
+#endif
/* ev->ev_next = NULL; */
ev->ev_dev = dev;
/* ev->ev_count = 0; */
- snprintf(ev->ev_name, sizeof(ev->ev_name), "%s", name);
+ strcpy(ev->ev_name, name);
*nextp = ev;
nextp = &ev->ev_next;
}
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index dc4c88a22912e..f38f0f885063c 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: subr_bus.c,v 1.13 1999/01/10 22:04:05 n_hibma Exp $
+ * $Id: subr_bus.c,v 1.5 1998/09/05 13:24:39 bde Exp $
*/
#include <sys/param.h>
@@ -33,61 +33,11 @@
#include <sys/module.h>
#include <sys/bus_private.h>
#include <sys/systm.h>
-#include <machine/stdarg.h> /* for device_printf() */
-
-#include "opt_bus.h"
-
-#ifdef BUS_DEBUG
-#define PDEBUG(a) (printf(__FUNCTION__ ":%d: ", __LINE__), printf a, printf("\n"))
-#define DEVICENAME(d) ((d)? device_get_name(d): "no device")
-#define DRIVERNAME(d) ((d)? d->name : "no driver")
-#define DEVCLANAME(d) ((d)? d->name : "no devclass")
-
-/* Produce the indenting, indent*2 spaces plus a '.' ahead of that to
- * prevent syslog from deleting initial spaces
- */
-#define indentprintf(p) do { int iJ; printf("."); for (iJ=0; iJ<indent; iJ++) printf(" "); printf p ; } while(0)
-
-static void print_method_list(device_method_t *m, int indent);
-static void print_device_ops(device_ops_t ops, int indent);
-static void print_device_short(device_t dev, int indent);
-static void print_device(device_t dev, int indent);
-void print_device_tree_short(device_t dev, int indent);
-void print_device_tree(device_t dev, int indent);
-static void print_driver_short(driver_t *driver, int indent);
-static void print_driver(driver_t *driver, int indent);
-static void print_driver_list(driver_list_t drivers, int indent);
-static void print_devclass_short(devclass_t dc, int indent);
-static void print_devclass(devclass_t dc, int indent);
-void print_devclass_list_short(void);
-void print_devclass_list(void);
-
-#else
-/* Make the compiler ignore the function calls */
-#define PDEBUG(a) /* nop */
-#define DEVICENAME(d) /* nop */
-#define DRIVERNAME(d) /* nop */
-#define DEVCLANAME(d) /* nop */
-
-#define print_method_list(m,i) /* nop */
-#define print_device_ops(o,i) /* nop */
-#define print_device_short(d,i) /* nop */
-#define print_device(d,i) /* nop */
-#define print_device_tree_short(d,i) /* nop */
-#define print_device_tree(d,i) /* nop */
-#define print_driver_short(d,i) /* nop */
-#define print_driver(d,i) /* nop */
-#define print_driver_list(d,i) /* nop */
-#define print_devclass_short(d,i) /* nop */
-#define print_devclass(d,i) /* nop */
-#define print_devclass_list_short() /* nop */
-#define print_devclass_list() /* nop */
-#endif
-
/*
* Method table handling
*/
+
static int next_method_offset = 1;
static int methods_count = 0;
static int methods_size = 0;
@@ -108,8 +58,6 @@ register_method(struct device_op_desc *desc)
for (i = 0; i < methods_count; i++)
if (!strcmp(methods[i].name, desc->name)) {
desc->offset = methods[i].offset;
- PDEBUG(("methods[%d] has the same name, %s, with offset %d",
- i, desc->name, desc->offset));
return;
}
@@ -158,8 +106,6 @@ compile_methods(driver_t *driver)
for (i = 0, m = driver->methods; m->desc; i++, m++)
if (!m->desc->offset)
register_method(m->desc);
- else
- PDEBUG(("offset not equal to zero, method desc %d left as is", i));
/*
* Then allocate the compiled op table.
@@ -168,16 +114,11 @@ compile_methods(driver_t *driver)
M_DEVBUF, M_NOWAIT);
if (!ops)
panic("compile_methods: out of memory");
-
ops->maxoffset = next_method_offset;
for (i = 0; i < next_method_offset; i++)
ops->methods[i] = error_method;
for (i = 0, m = driver->methods; m->desc; i++, m++)
ops->methods[m->desc->offset] = m->func;
- PDEBUG(("%s has %d method%s, wasting %d bytes",
- DRIVERNAME(driver), i, (i==1?"":"s"),
- (next_method_offset-i)*sizeof(devop_t)));
-
driver->ops = ops;
}
@@ -185,22 +126,23 @@ compile_methods(driver_t *driver)
* Devclass implementation
*/
-static devclass_list_t devclasses = TAILQ_HEAD_INITIALIZER(devclasses);
+static devclass_list_t devclasses;
+
+static void
+devclass_init(void)
+{
+ TAILQ_INIT(&devclasses);
+}
static devclass_t
devclass_find_internal(const char *classname, int create)
{
devclass_t dc;
- PDEBUG(("looking for %s", classname));
- if (!classname)
- return NULL;
-
for (dc = TAILQ_FIRST(&devclasses); dc; dc = TAILQ_NEXT(dc, link))
if (!strcmp(dc->name, classname))
return dc;
- PDEBUG(("%s not found%s", classname, (create? ", creating": "")));
if (create) {
dc = malloc(sizeof(struct devclass) + strlen(classname) + 1,
M_DEVBUF, M_NOWAIT);
@@ -227,7 +169,6 @@ devclass_find(const char *classname)
int
devclass_add_driver(devclass_t dc, driver_t *driver)
{
- PDEBUG(("%s", DRIVERNAME(driver)));
/*
* Compile the drivers methods.
*/
@@ -244,35 +185,31 @@ devclass_add_driver(devclass_t dc, driver_t *driver)
}
int
-devclass_delete_driver(devclass_t busclass, driver_t *driver)
+devclass_delete_driver(devclass_t dc, driver_t *driver)
{
- devclass_t dc = devclass_find(driver->name);
+ device_t bus;
device_t dev;
int i;
int error;
- PDEBUG(("%s from devclass %s", driver->name, DEVCLANAME(busclass)));
-
- if (!dc)
- return 0;
-
/*
* Disassociate from any devices. We iterate through all the
- * devices in the devclass of the driver and detach any which are
- * using the driver.
+ * devices attached to any bus in this class.
*/
for (i = 0; i < dc->maxunit; i++) {
if (dc->devices[i]) {
- dev = dc->devices[i];
- if (dev->driver == driver) {
- if (error = device_detach(dev))
- return error;
- device_set_driver(dev, NULL);
- }
+ bus = dc->devices[i]->parent;
+ for (dev = TAILQ_FIRST(&bus->children); dev;
+ dev = TAILQ_NEXT(dev, link))
+ if (dev->driver == driver) {
+ if (error = device_detach(dev))
+ return error;
+ device_set_driver(dev, NULL);
+ }
}
}
- TAILQ_REMOVE(&busclass->drivers, driver, link);
+ TAILQ_REMOVE(&dc->drivers, driver, link);
return 0;
}
@@ -281,15 +218,11 @@ devclass_find_driver(devclass_t dc, const char *classname)
{
driver_t *driver;
- PDEBUG(("%s in devclass %s", classname, DEVCLANAME(dc)));
-
for (driver = TAILQ_FIRST(&dc->drivers); driver;
- driver = TAILQ_NEXT(driver, link)) {
+ driver = TAILQ_NEXT(driver, link))
if (!strcmp(driver->name, classname))
return driver;
- }
- PDEBUG(("not found"));
return NULL;
}
@@ -325,6 +258,7 @@ devclass_get_devices(devclass_t dc, device_t **devlistp, int *devcountp)
{
int i;
int count;
+ device_t dev;
device_t *list;
count = 0;
@@ -360,8 +294,6 @@ devclass_alloc_unit(devclass_t dc, int *unitp)
{
int unit = *unitp;
- PDEBUG(("unit %d in devclass %s", unit, DEVCLANAME(dc)));
-
/*
* If we have been given a wired unit number, check for existing
* device.
@@ -398,7 +330,6 @@ devclass_alloc_unit(devclass_t dc, int *unitp)
dc->devices = newlist;
dc->maxunit = newsize;
}
- PDEBUG(("now: unit %d in devclass %s", unit, DEVCLANAME(dc)));
*unitp = unit;
return 0;
@@ -409,8 +340,6 @@ devclass_add_device(devclass_t dc, device_t dev)
{
int error;
- PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc)));
-
if (error = devclass_alloc_unit(dc, &dev->unit))
return error;
dc->devices[dev->unit] = dev;
@@ -421,11 +350,6 @@ devclass_add_device(devclass_t dc, device_t dev)
static int
devclass_delete_device(devclass_t dc, device_t dev)
{
- if (!dc || !dev)
- return 0;
-
- PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc)));
-
if (dev->devclass != dc
|| dc->devices[dev->unit] != dev)
panic("devclass_delete_device: inconsistent device class");
@@ -442,13 +366,11 @@ static device_t
make_device(device_t parent, const char *name,
int unit, void *ivars)
{
+ driver_t *driver;
device_t dev;
devclass_t dc;
int error;
- PDEBUG(("%s at %s as unit %d with%s ivars",
- name, DEVICENAME(parent), unit, (ivars? "":"out")));
-
if (name) {
dc = devclass_find_internal(name, TRUE);
if (!dc) {
@@ -507,15 +429,9 @@ device_add_child(device_t dev, const char *name, int unit, void *ivars)
{
device_t child;
- PDEBUG(("%s at %s as unit %d with%s ivars",
- name, DEVICENAME(dev), unit, (ivars? "":"out")));
-
child = make_device(dev, name, unit, ivars);
- if (child)
- TAILQ_INSERT_TAIL(&dev->children, child, link);
- else
- PDEBUG(("%s failed", name));
+ TAILQ_INSERT_TAIL(&dev->children, child, link);
return child;
}
@@ -526,9 +442,6 @@ device_add_child_after(device_t dev, device_t place, const char *name,
{
device_t child;
- PDEBUG(("%s at %s after %s as unit %d with%s ivars",
- name, DEVICENAME(dev), DEVICENAME(place), unit, (ivars? "":"out")));
-
child = make_device(dev, name, unit, ivars);
if (place) {
@@ -544,23 +457,13 @@ int
device_delete_child(device_t dev, device_t child)
{
int error;
- device_t grandchild;
-
- PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev)));
-
- /* remove children first */
- while ( (grandchild = TAILQ_FIRST(&child->children)) ) {
- error = device_delete_child(child, grandchild);
- if (error)
- return error;
- }
if (error = device_detach(child))
return error;
if (child->devclass)
devclass_delete_device(child->devclass, child);
TAILQ_REMOVE(&dev->children, child, link);
- free(child, M_DEVBUF);
+ free(dev, M_DEVBUF);
return 0;
}
@@ -612,6 +515,7 @@ device_probe_child(device_t dev, device_t child)
{
devclass_t dc;
driver_t *driver;
+ void *softc;
dc = dev->devclass;
if (dc == NULL)
@@ -623,7 +527,6 @@ device_probe_child(device_t dev, device_t child)
for (driver = first_matching_driver(dc, child);
driver;
driver = next_matching_driver(dc, child, driver)) {
- PDEBUG(("Trying %s", DRIVERNAME(driver)));
device_set_driver(child, driver);
if (DEVICE_PROBE(child) == 0) {
if (!child->devclass)
@@ -642,35 +545,6 @@ device_get_parent(device_t dev)
return dev->parent;
}
-int
-device_get_children(device_t dev, device_t **devlistp, int *devcountp)
-{
- int count;
- device_t child;
- device_t *list;
-
- count = 0;
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link))
- count++;
-
- list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT);
- if (!list)
- return ENOMEM;
-
- count = 0;
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link)) {
- list[count] = child;
- count++;
- }
-
- *devlistp = list;
- *devcountp = count;
-
- return 0;
-}
-
driver_t *
device_get_driver(device_t dev)
{
@@ -704,27 +578,6 @@ device_get_desc(device_t dev)
}
void
-device_print_prettyname(device_t dev)
-{
- const char *name = device_get_name(dev);
-
- if (name == 0)
- name = "(no driver assigned)";
- printf("%s%d: ", name, device_get_unit(dev));
-}
-
-void
-device_printf(device_t dev, const char * fmt, ...)
-{
- va_list ap;
-
- device_print_prettyname(dev);
- va_start(ap, fmt);
- vprintf(fmt, ap);
- va_end(ap);
-}
-
-void
device_set_desc(device_t dev, const char* desc)
{
dev->desc = desc;
@@ -831,11 +684,6 @@ device_set_driver(device_t dev, driver_t *driver)
if (driver) {
dev->ops = driver->ops;
dev->softc = malloc(driver->softc, M_DEVBUF, M_NOWAIT);
- if (!dev->softc) {
- dev->ops = &null_ops;
- dev->driver = NULL;
- return ENOMEM;
- }
bzero(dev->softc, driver->softc);
}
return 0;
@@ -845,15 +693,15 @@ int
device_probe_and_attach(device_t dev)
{
device_t bus = dev->parent;
- int error = 0;
+ int error;
if (dev->state >= DS_ALIVE)
return 0;
if (dev->flags & DF_ENABLED) {
- error = device_probe_child(bus, dev);
- if (!error) {
- device_print_child(bus, dev);
+ device_probe_child(bus, dev);
+ device_print_child(bus, dev);
+ if (dev->state == DS_ALIVE) {
error = DEVICE_ATTACH(dev);
if (!error)
dev->state = DS_ATTACHED;
@@ -864,12 +712,11 @@ device_probe_and_attach(device_t dev)
dev->state = DS_NOTPRESENT;
}
}
- } else {
- device_print_prettyname(dev);
- printf("not probed (disabled)\n");
- }
+ } else
+ printf("%s%d: disabled, not probed.\n",
+ dev->devclass->name, dev->unit);
- return error;
+ return 0;
}
int
@@ -877,7 +724,6 @@ device_detach(device_t dev)
{
int error;
- PDEBUG(("%s", DEVICENAME(dev)));
if (dev->state == DS_BUSY)
return EBUSY;
if (dev->state != DS_ATTACHED)
@@ -913,7 +759,7 @@ static int
resource_match_string(int i, char *resname, char *value)
{
int j;
- struct config_resource *res;
+ struct resource *res;
for (j = 0, res = devtab[i].resources;
j < devtab[i].resource_count; j++, res++)
@@ -925,11 +771,10 @@ resource_match_string(int i, char *resname, char *value)
}
static int
-resource_find(const char *name, int unit, char *resname,
- struct config_resource **result)
+resource_find(const char *name, int unit, char *resname, struct resource **result)
{
int i, j;
- struct config_resource *res;
+ struct resource *res;
/*
* First check specific instances, then generic.
@@ -965,7 +810,7 @@ int
resource_int_value(const char *name, int unit, char *resname, int *result)
{
int error;
- struct config_resource *res;
+ struct resource *res;
if ((error = resource_find(name, unit, resname, &res)) != 0)
return error;
if (res->type != RES_INT)
@@ -978,7 +823,7 @@ int
resource_long_value(const char *name, int unit, char *resname, long *result)
{
int error;
- struct config_resource *res;
+ struct resource *res;
if ((error = resource_find(name, unit, resname, &res)) != 0)
return error;
if (res->type != RES_LONG)
@@ -991,7 +836,7 @@ int
resource_string_value(const char *name, int unit, char *resname, char **result)
{
int error;
- struct config_resource *res;
+ struct resource *res;
if ((error = resource_find(name, unit, resname, &res)) != 0)
return error;
if (res->type != RES_STRING)
@@ -1033,6 +878,7 @@ int
bus_generic_attach(device_t dev)
{
device_t child;
+ int error;
for (child = TAILQ_FIRST(&dev->children);
child; child = TAILQ_NEXT(child, link))
@@ -1052,8 +898,7 @@ bus_generic_detach(device_t dev)
for (child = TAILQ_FIRST(&dev->children);
child; child = TAILQ_NEXT(child, link))
- if (error = device_detach(child))
- return error;
+ device_detach(child);
return 0;
}
@@ -1070,197 +915,59 @@ bus_generic_shutdown(device_t dev)
return 0;
}
-int
-bus_generic_suspend(device_t dev)
-{
- int error;
- device_t child, child2;
-
- for (child = TAILQ_FIRST(&dev->children);
- child; child = TAILQ_NEXT(child, link)) {
- error = DEVICE_SUSPEND(child);
- if (error) {
- for (child2 = TAILQ_FIRST(&dev->children);
- child2 && child2 != child;
- child2 = TAILQ_NEXT(child2, link))
- DEVICE_RESUME(child2);
- return (error);
- }
- }
- return 0;
-}
-
-int
-bus_generic_resume(device_t dev)
-{
- device_t child;
-
- for (child = TAILQ_FIRST(&dev->children);
- child; child = TAILQ_NEXT(child, link)) {
- DEVICE_RESUME(child);
- /* if resume fails, there's nothing we can usefully do... */
- }
- return 0;
-}
-
void
bus_generic_print_child(device_t dev, device_t child)
{
- printf(" on %s%d", device_get_name(dev), device_get_unit(dev));
}
int
-bus_generic_read_ivar(device_t dev, device_t child, int index,
- uintptr_t * result)
+bus_generic_read_ivar(device_t dev, device_t child, int index, u_long* result)
{
return ENOENT;
}
int
-bus_generic_write_ivar(device_t dev, device_t child, int index,
- uintptr_t value)
+bus_generic_write_ivar(device_t dev, device_t child, int index, u_long value)
{
return ENOENT;
}
-int
-bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_SETUP_INTR(dev->parent, child, irq, intr, arg,
- cookiep));
- else
- return (EINVAL);
-}
-
-int
-bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq,
- void *cookie)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie));
- else
- return (EINVAL);
-}
-
-struct resource *
-bus_generic_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_ALLOC_RESOURCE(dev->parent, child, type, rid,
- start, end, count, flags));
- else
- return (NULL);
-}
-
-int
-bus_generic_release_resource(device_t dev, device_t child, int type, int rid,
- struct resource *r)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_RELEASE_RESOURCE(dev->parent, child, type, rid,
- r));
- else
- return (EINVAL);
-}
-
-int
-bus_generic_activate_resource(device_t dev, device_t child, int type, int rid,
- struct resource *r)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_ACTIVATE_RESOURCE(dev->parent, child, type, rid,
- r));
- else
- return (EINVAL);
-}
-
-int
-bus_generic_deactivate_resource(device_t dev, device_t child, int type,
- int rid, struct resource *r)
-{
- /* Propagate up the bus hierarchy until someone handles it. */
- if (dev->parent)
- return (BUS_DEACTIVATE_RESOURCE(dev->parent, child, type, rid,
- r));
- else
- return (EINVAL);
-}
-
-/*
- * Some convenience functions to make it easier for drivers to use the
- * resource-management functions. All these really do is hide the
- * indirection through the parent's method table, making for slightly
- * less-wordy code. In the future, it might make sense for this code
- * to maintain some sort of a list of resources allocated by each device.
- */
-struct resource *
-bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end,
- u_long count, u_int flags)
-{
- if (dev->parent == 0)
- return (0);
- return (BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end,
- count, flags));
-}
-
-int
-bus_activate_resource(device_t dev, int type, int rid, struct resource *r)
-{
- if (dev->parent == 0)
- return (EINVAL);
- return (BUS_ACTIVATE_RESOURCE(dev->parent, dev, type, rid, r));
-}
-
-int
-bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r)
+void *
+bus_generic_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg)
{
- if (dev->parent == 0)
- return (EINVAL);
- return (BUS_DEACTIVATE_RESOURCE(dev->parent, dev, type, rid, r));
+ /* Propagate up the bus hierarchy until someone handles it. */
+ if (dev->parent)
+ return BUS_CREATE_INTR(dev->parent, dev, irq, intr, arg);
+ else
+ return NULL;
}
int
-bus_release_resource(device_t dev, int type, int rid, struct resource *r)
-{
- if (dev->parent == 0)
- return (EINVAL);
- return (BUS_RELEASE_RESOURCE(dev->parent, dev,
- type, rid, r));
-}
-
-static void
-root_print_child(device_t dev, device_t child)
+bus_generic_connect_intr(device_t dev, void *ih)
{
+ /* Propagate up the bus hierarchy until someone handles it. */
+ if (dev->parent)
+ return BUS_CONNECT_INTR(dev->parent, ih);
+ else
+ return EINVAL;
}
-static int
-root_setup_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg,
- void **cookiep)
+static int root_create_intr(device_t dev, device_t child,
+ driver_intr_t *intr, void *arg)
{
- /*
- * If an interrupt mapping gets to here something bad has happened.
- */
- panic("root_setup_intr");
+ /*
+ * If an interrupt mapping gets to here something bad has happened.
+ * Should probably panic.
+ */
+ return EINVAL;
}
static device_method_t root_methods[] = {
- /* Device interface */
- DEVMETHOD(device_suspend, bus_generic_suspend),
- DEVMETHOD(device_resume, bus_generic_resume),
-
/* Bus interface */
- DEVMETHOD(bus_print_child, root_print_child),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
- DEVMETHOD(bus_setup_intr, root_setup_intr),
+ DEVMETHOD(bus_create_intr, root_create_intr),
{ 0, 0 }
};
@@ -1272,21 +979,21 @@ static driver_t root_driver = {
1, /* no softc */
};
-device_t root_bus;
-devclass_t root_devclass;
+device_t root_bus;
+devclass_t root_devclass;
static int
-root_bus_module_handler(module_t mod, int what, void* arg)
+root_bus_module_handler(module_t mod, modeventtype_t what, void* arg)
{
switch (what) {
case MOD_LOAD:
+ devclass_init();
compile_methods(&root_driver);
root_bus = make_device(NULL, "root", 0, NULL);
- root_bus->desc = "System root bus";
root_bus->ops = root_driver.ops;
root_bus->driver = &root_driver;
root_bus->state = DS_ATTACHED;
- root_devclass = devclass_find_internal("root", FALSE);
+ root_devclass = devclass_find("root");
return 0;
}
@@ -1301,11 +1008,10 @@ static moduledata_t root_bus_mod = {
DECLARE_MODULE(rootbus, root_bus_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
void
-root_bus_configure(void)
+root_bus_configure()
{
device_t dev;
-
- PDEBUG(("."));
+ int error;
for (dev = TAILQ_FIRST(&root_bus->children); dev;
dev = TAILQ_NEXT(dev, link)) {
@@ -1314,259 +1020,30 @@ root_bus_configure(void)
}
int
-driver_module_handler(module_t mod, int what, void *arg)
-{
- int error, i;
- struct driver_module_data *dmd;
- devclass_t bus_devclass;
-
- dmd = (struct driver_module_data *)arg;
- bus_devclass = devclass_find_internal(dmd->dmd_busname, TRUE);
- error = 0;
-
- switch (what) {
- case MOD_LOAD:
- for (i = 0; !error && i < dmd->dmd_ndrivers; i++) {
- PDEBUG(("Loading module: driver %s on bus %s",
- DRIVERNAME(dmd->dmd_drivers[i]),
- dmd->dmd_busname));
- error = devclass_add_driver(bus_devclass,
- dmd->dmd_drivers[i]);
- }
- if (error)
- break;
-
- /*
- * The drivers loaded in this way are assumed to all
- * implement the same devclass.
- */
- *dmd->dmd_devclass =
- devclass_find_internal(dmd->dmd_drivers[0]->name,
- TRUE);
- break;
-
- case MOD_UNLOAD:
- for (i = 0; !error && i < dmd->dmd_ndrivers; i++) {
- PDEBUG(("Unloading module: driver %s from bus %s",
- DRIVERNAME(dmd->dmd_drivers[i]),
- dmd->dmd_busname));
- error = devclass_delete_driver(bus_devclass,
- dmd->dmd_drivers[i]);
- }
- break;
- }
-
- if (!error && dmd->dmd_chainevh)
- error = dmd->dmd_chainevh(mod, what, dmd->dmd_chainarg);
- return (error);
-}
-
-#ifdef BUS_DEBUG
-
-/* the _short versions avoid iteration by not calling anything that prints
- * more than oneliners. I love oneliners.
- */
-
-static void
-print_method_list(device_method_t *m, int indent)
-{
- int i;
-
- if (!m)
- return;
-
- for (i = 0; m->desc; i++, m++)
- indentprintf(("method %d: %s, offset=%d\n",
- i, m->desc->name, m->desc->offset));
-}
-
-static void
-print_device_ops(device_ops_t ops, int indent)
+driver_module_handler(module_t mod, modeventtype_t what, void* arg)
{
- int i;
- int count = 0;
-
- if (!ops)
- return;
-
- /* we present a list of the methods that are pointing to the
- * error_method, but ignore the 0'th elements; it is always
- * error_method.
- */
- for (i = 1; i < ops->maxoffset; i++) {
- if (ops->methods[i] == error_method) {
- if (count == 0)
- indentprintf(("error_method:"));
- printf(" %d", i);
- count++;
- }
- }
- if (count)
- printf("\n");
-
- indentprintf(("(%d method%s, %d valid, %d error_method%s)\n",
- ops->maxoffset-1, (ops->maxoffset-1 == 1? "":"s"),
- ops->maxoffset-1-count,
- count, (count == 1? "":"'s")));
-}
-
-static void
-print_device_short(device_t dev, int indent)
-{
- if (!dev)
- return;
-
- indentprintf(("device %d: <%s> %sparent,%schildren,%s%s%s%sivars,%ssoftc,busy=%d\n",
- dev->unit, dev->desc,
- (dev->parent? "":"no "),
- (TAILQ_EMPTY(&dev->children)? "no ":""),
- (dev->flags&DF_ENABLED? "enabled,":"disabled,"),
- (dev->flags&DF_FIXEDCLASS? "fixed,":""),
- (dev->flags&DF_WILDCARD? "wildcard,":""),
- (dev->ivars? "":"no "),
- (dev->softc? "":"no "),
- dev->busy));
-}
-
-static void
-print_device(device_t dev, int indent)
-{
- if (!dev)
- return;
-
- print_device_short(dev, indent);
-
- indentprintf(("Parent:\n"));
- print_device_short(dev->parent, indent+1);
- indentprintf(("Methods:\n"));
- print_device_ops(dev->ops, indent+1);
- indentprintf(("Driver:\n"));
- print_driver_short(dev->driver, indent+1);
- indentprintf(("Devclass:\n"));
- print_devclass_short(dev->devclass, indent+1);
-}
-
-void
-print_device_tree_short(device_t dev, int indent)
-/* print the device and all its children (indented) */
-{
- device_t child;
-
- if (!dev)
- return;
-
- print_device_short(dev, indent);
-
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link))
- print_device_tree_short(child, indent+1);
-}
-
-void
-print_device_tree(device_t dev, int indent)
-/* print the device and all its children (indented) */
-{
- device_t child;
-
- if (!dev)
- return;
-
- print_device(dev, indent);
-
- for (child = TAILQ_FIRST(&dev->children); child;
- child = TAILQ_NEXT(child, link))
- print_device_tree(child, indent+1);
-}
-
-static void
-print_driver_short(driver_t *driver, int indent)
-{
- if (!driver)
- return;
-
- indentprintf(("driver %s: type = %s%s%s%s, softc size = %d\n",
- driver->name,
- /* yes, I know this looks silly, but going to bed at
- * two o'clock and having to get up at 7:30 again is silly
- * as well. As is sticking your head in a bucket of water.
- */
- (driver->type == DRIVER_TYPE_TTY? "tty":""),
- (driver->type == DRIVER_TYPE_BIO? "bio":""),
- (driver->type == DRIVER_TYPE_NET? "net":""),
- (driver->type == DRIVER_TYPE_MISC? "misc":""),
- driver->softc));
-}
-
-static void
-print_driver(driver_t *driver, int indent)
-{
- if (!driver)
- return;
-
- print_driver_short(driver, indent);
- indentprintf(("Methods:\n"));
- print_method_list(driver->methods, indent+1);
- indentprintf(("Operations:\n"));
- print_device_ops(driver->ops, indent+1);
-}
-
-
-static void
-print_driver_list(driver_list_t drivers, int indent)
-{
- driver_t *driver;
-
- for (driver = TAILQ_FIRST(&drivers); driver;
- driver = TAILQ_NEXT(driver, link))
- print_driver(driver, indent);
-}
-
-static void
-print_devclass_short(devclass_t dc, int indent)
-{
- if ( !dc )
- return;
-
- indentprintf(("devclass %s: max units = %d, next unit = %d\n",
- dc->name, dc->maxunit, dc->nextunit));
-}
-
-static void
-print_devclass(devclass_t dc, int indent)
-{
- int i;
-
- if ( !dc )
- return;
-
- print_devclass_short(dc, indent);
- indentprintf(("Drivers:\n"));
- print_driver_list(dc->drivers, indent+1);
-
- indentprintf(("Devices:\n"));
- for (i = 0; i < dc->maxunit; i++)
- if (dc->devices[i])
- print_device(dc->devices[i], indent+1);
-}
-
-void
-print_devclass_list_short(void)
-{
- devclass_t dc;
+ struct driver_module_data* data = (struct driver_module_data*) arg;
+ devclass_t bus_devclass = devclass_find_internal(data->busname, TRUE);
+ int error;
- printf("Short listing of devclasses, drivers & devices:\n");
- for (dc = TAILQ_FIRST(&devclasses); dc; dc = TAILQ_NEXT(dc, link))
- print_devclass_short(dc, 0);
-}
+ switch (what) {
+ case MOD_LOAD:
+ if (error = devclass_add_driver(bus_devclass,
+ data->driver))
+ return error;
+ *data->devclass =
+ devclass_find_internal(data->driver->name, TRUE);
+ break;
-void
-print_devclass_list(void)
-{
- devclass_t dc;
+ case MOD_UNLOAD:
+ if (error = devclass_delete_driver(bus_devclass,
+ data->driver))
+ return error;
+ break;
+ }
- printf("Full listing of devclasses, drivers & devices:\n");
- for (dc = TAILQ_FIRST(&devclasses); dc; dc = TAILQ_NEXT(dc, link))
- print_devclass(dc, 0);
+ if (data->chainevh)
+ return data->chainevh(mod, what, data->chainarg);
+ else
+ return 0;
}
-
-#endif
diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c
index 5fcf88efdca7a..51c73df1da2ff 100644
--- a/sys/kern/subr_devstat.c
+++ b/sys/kern/subr_devstat.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: subr_devstat.c,v 1.7 1998/12/04 22:54:51 archie Exp $
+ * $Id: subr_devstat.c,v 1.3 1998/10/06 04:16:07 ken Exp $
*/
#include <sys/param.h>
@@ -49,7 +49,7 @@ STAILQ_HEAD(devstatlist, devstat) device_statq;
* and add it to the queue of devices.
*/
void
-devstat_add_entry(struct devstat *ds, const char *dev_name,
+devstat_add_entry(struct devstat *ds, char *dev_name,
int unit_number, u_int32_t block_size,
devstat_support_flags flags,
devstat_type_flags device_type)
@@ -73,7 +73,6 @@ devstat_add_entry(struct devstat *ds, const char *dev_name,
ds->device_number = devstat_current_devnumber++;
ds->unit_number = unit_number;
strncpy(ds->device_name, dev_name, DEVSTAT_NAME_LEN);
- ds->device_name[DEVSTAT_NAME_LEN - 1] = 0;
ds->block_size = block_size;
ds->flags = flags;
ds->device_type = device_type;
@@ -178,10 +177,18 @@ devstat_end_transaction(struct devstat *ds, u_int32_t bytes,
/* Add our busy time to the total busy time. */
timevaladd(&ds->busy_time, &busy_time);
- } else if (ds->busy_count < 0)
+ }
+ /*
+ * XXX KDM this is temporarily disabled to avoid causing
+ * unsophisticated users to panic. There are unfixed bugs in the
+ * wd driver that will set off this error message.
+ */
+#if 0
+ else if (ds->busy_count < 0)
printf("devstat_end_transaction: HELP!! busy_count "
"for %s%d is < 0 (%d)!\n", ds->device_name,
ds->unit_number, ds->busy_count);
+#endif
}
/*
@@ -243,6 +250,6 @@ SYSCTL_PROC(_kern_devstat, OID_AUTO, all, CTLFLAG_RD|CTLTYPE_OPAQUE,
SYSCTL_INT(_kern_devstat, OID_AUTO, numdevs, CTLFLAG_RD, &devstat_num_devs,
0, "Number of devices in the devstat list");
SYSCTL_LONG(_kern_devstat, OID_AUTO, generation, CTLFLAG_RD,
- &devstat_generation, "Devstat list generation");
+ &devstat_generation, 0, "Devstat list generation");
SYSCTL_INT(_kern_devstat, OID_AUTO, version, CTLFLAG_RD, &devstat_version,
0, "Devstat list version number");
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index fa0e4a4126acc..d02b6b29cfbe1 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -43,7 +43,7 @@
* from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: subr_diskslice.c,v 1.60 1998/12/04 22:54:51 archie Exp $
+ * $Id: subr_diskslice.c,v 1.57 1998/08/13 08:09:07 dfr Exp $
*/
#include "opt_devfs.h"
@@ -464,7 +464,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp, strat, setgeom)
(u_long)openmask);
/* XXX why doesn't setdisklabel() check this? */
if (error == 0 && lp->d_partitions[RAW_PART].p_offset != 0)
- error = EXDEV;
+ error = EINVAL;
if (error == 0) {
if (lp->d_secperunit > sp->ds_size)
error = ENOSPC;
@@ -680,14 +680,13 @@ dsname(dname, unit, slice, part, partname)
if (strlen(dname) > 16)
dname = "nametoolong";
- snprintf(name, sizeof(name), "%s%d", dname, unit);
+ sprintf(name, "%s%d", dname, unit);
partname[0] = '\0';
if (slice != WHOLE_DISK_SLICE || part != RAW_PART) {
partname[0] = 'a' + part;
partname[1] = '\0';
if (slice != COMPATIBILITY_SLICE)
- snprintf(name + strlen(name),
- sizeof(name) - strlen(name), "s%d", slice - 1);
+ sprintf(name + strlen(name), "s%d", slice - 1);
}
return (name);
}
@@ -1158,10 +1157,10 @@ set_ds_labeldevs_unaliased(dname, dev, ssp)
sname = dsname(dname, dkunit(dev), slice, part, partname);
if (part == RAW_PART && sp->ds_bdev != NULL) {
sp->ds_bdevs[part] =
- devfs_makelink(sp->ds_bdev,
+ devfs_link(sp->ds_bdev,
"%s%s", sname, partname);
sp->ds_cdevs[part] =
- devfs_makelink(sp->ds_cdev,
+ devfs_link(sp->ds_cdev,
"r%s%s", sname, partname);
} else {
mynor = minor(dkmodpart(dev, part));
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 1204376244c2e..80193d4007433 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)subr_log.c 8.1 (Berkeley) 6/10/93
- * $Id: subr_log.c,v 1.32 1998/11/11 10:55:56 truckman Exp $
+ * $Id: subr_log.c,v 1.29 1998/05/28 09:30:20 phk Exp $
*/
/*
@@ -51,7 +51,6 @@
#include <sys/signalvar.h>
#include <sys/kernel.h>
#include <sys/poll.h>
-#include <sys/filedesc.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /*DEVFS*/
@@ -76,7 +75,7 @@ static struct cdevsw log_cdevsw =
static struct logsoftc {
int sc_state; /* see above for possibilities */
struct selinfo sc_selp; /* process waiting on select call */
- struct sigio *sc_sigio; /* information for async I/O */
+ int sc_pgid; /* process/group for async I/O */
} logsoftc;
int log_open; /* also used in log() */
@@ -91,7 +90,7 @@ logopen(dev, flags, mode, p)
if (log_open)
return (EBUSY);
log_open = 1;
- fsetown(p->p_pid, &logsoftc.sc_sigio); /* signal process only */
+ logsoftc.sc_pgid = p->p_pid; /* signal process only */
return (0);
}
@@ -105,7 +104,6 @@ logclose(dev, flag, mode, p)
log_open = 0;
logsoftc.sc_state = 0;
- funsetown(logsoftc.sc_sigio);
return (0);
}
@@ -180,11 +178,17 @@ logpoll(dev, events, p)
void
logwakeup()
{
+ struct proc *p;
+
if (!log_open)
return;
selwakeup(&logsoftc.sc_selp);
- if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL)
- pgsigio(logsoftc.sc_sigio, SIGIO, 0);
+ if (logsoftc.sc_state & LOG_ASYNC) {
+ if (logsoftc.sc_pgid < 0)
+ gsignal(-logsoftc.sc_pgid, SIGIO);
+ else if ((p = pfind(logsoftc.sc_pgid)))
+ psignal(p, SIGIO);
+ }
if (logsoftc.sc_state & LOG_RDWAIT) {
wakeup((caddr_t)msgbufp);
logsoftc.sc_state &= ~LOG_RDWAIT;
@@ -225,20 +229,12 @@ logioctl(dev, com, data, flag, p)
logsoftc.sc_state &= ~LOG_ASYNC;
break;
- case FIOSETOWN:
- return (fsetown(*(int *)data, &logsoftc.sc_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(logsoftc.sc_sigio);
- break;
-
- /* This is deprecated, FIOSETOWN should be used instead. */
case TIOCSPGRP:
- return (fsetown(-(*(int *)data), &logsoftc.sc_sigio));
+ logsoftc.sc_pgid = *(int *)data;
+ break;
- /* This is deprecated, FIOGETOWN should be used instead */
case TIOCGPGRP:
- *(int *)data = -fgetown(logsoftc.sc_sigio);
+ *(int *)data = logsoftc.sc_pgid;
break;
default:
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 424ac9faf084d..f18a71ab070b4 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
- * $Id: subr_prf.c,v 1.50 1998/09/06 06:25:04 ache Exp $
+ * $Id: subr_prf.c,v 1.49 1998/08/10 14:27:34 bde Exp $
*/
#include <sys/param.h>
@@ -62,22 +62,12 @@
struct tty *constty; /* pointer to console "window" tty */
-struct putchar_arg {
- int flags;
- struct tty *tty;
-};
-
-struct snprintf_arg {
- char *str;
- size_t remain;
-};
-
static void (*v_putc)(int) = cnputc; /* routine to putc on virtual console */
static void logpri __P((int level));
static void msglogchar(int c, void *dummyarg);
+struct putchar_arg {int flags; struct tty *tty; };
static void putchar __P((int ch, void *arg));
static char *ksprintn __P((u_long num, int base, int *len));
-static void snprintf_func __P((int ch, void *arg));
static int consintr = 1; /* Ok to handle console interrupts? */
static int msgbufmapped; /* Set when safe to use msgbuf */
@@ -339,49 +329,6 @@ vsprintf(char *buf, const char *cfmt, va_list ap)
}
/*
- * Scaled down version of snprintf(3).
- */
-int
-snprintf(char *str, size_t size, const char *format, ...)
-{
- int retval;
- va_list ap;
-
- va_start(ap, format);
- retval = vsnprintf(str, size, format, ap);
- va_end(ap);
- return(retval);
-}
-
-/*
- * Scaled down version of vsnprintf(3).
- */
-int
-vsnprintf(char *str, size_t size, const char *format, va_list ap)
-{
- struct snprintf_arg info;
- int retval;
-
- info.str = str;
- info.remain = size;
- retval = kvprintf(format, snprintf_func, &info, 10, ap);
- if (info.remain >= 1)
- *info.str++ = '\0';
- return retval;
-}
-
-static void
-snprintf_func(int ch, void *arg)
-{
- struct snprintf_arg *const info = arg;
-
- if (info->remain >= 2) {
- *info->str++ = ch;
- info->remain--;
- }
-}
-
-/*
* Put a number (base <= 16) in a buffer in reverse order; return an
* optional length and a pointer to the NULL terminated (preceded?)
* buffer.
diff --git a/sys/kern/subr_rlist.c b/sys/kern/subr_rlist.c
index d637ab428f770..33ac632890463 100644
--- a/sys/kern/subr_rlist.c
+++ b/sys/kern/subr_rlist.c
@@ -54,7 +54,7 @@
* functioning of this software, nor does the author assume any responsibility
* for damages incurred with its use.
*
- * $Id: subr_rlist.c,v 1.28 1999/01/08 17:31:12 eivind Exp $
+ * $Id: subr_rlist.c,v 1.26 1998/04/15 17:46:25 bde Exp $
*/
#include <sys/param.h>
@@ -137,14 +137,16 @@ rlist_free(rlh, start, end)
while (cur_rlp != NULL) {
if (start < cur_rlp->rl_start)
break;
+#ifdef DIAGNOSTIC
if (prev_rlp) {
- KASSERT(prev_rlp->rl_end + 1 != cur_rlp->rl_start,
- ("rlist_free: missed coalesce opportunity"));
- KASSERT(prev_rlp->rl_end != cur_rlp->rl_start,
- ("rlist_free: entries overlap"));
- KASSERT(prev_rlp->rl_end <= cur_rlp->rl_start,
- ("entries out of order"));
+ if (prev_rlp->rl_end + 1 == cur_rlp->rl_start)
+ panic("rlist_free: missed coalesce opportunity");
+ if (prev_rlp->rl_end == cur_rlp->rl_start)
+ panic("rlist_free: entries overlap");
+ if (prev_rlp->rl_end > cur_rlp->rl_start)
+ panic("entries out of order");
}
+#endif
prev_rlp = cur_rlp;
cur_rlp = cur_rlp->rl_next;
}
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
deleted file mode 100644
index e0526bb5badc3..0000000000000
--- a/sys/kern/subr_rman.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: subr_rman.c,v 1.3 1998/12/07 21:58:29 archie Exp $
- */
-
-/*
- * The kernel resource manager. This code is responsible for keeping track
- * of hardware resources which are apportioned out to various drivers.
- * It does not actually assign those resources, and it is not expected
- * that end-device drivers will call into this code directly. Rather,
- * the code which implements the buses that those devices are attached to,
- * and the code which manages CPU resources, will call this code, and the
- * end-device drivers will make upcalls to that code to actually perform
- * the allocation.
- *
- * There are two sorts of resources managed by this code. The first is
- * the more familiar array (RMAN_ARRAY) type; resources in this class
- * consist of a sequence of individually-allocatable objects which have
- * been numbered in some well-defined order. Most of the resources
- * are of this type, as it is the most familiar. The second type is
- * called a gauge (RMAN_GAUGE), and models fungible resources (i.e.,
- * resources in which each instance is indistinguishable from every
- * other instance). The principal anticipated application of gauges
- * is in the context of power consumption, where a bus may have a specific
- * power budget which all attached devices share. RMAN_GAUGE is not
- * implemented yet.
- *
- * For array resources, we make one simplifying assumption: two clients
- * sharing the same resource must use the same range of indices. That
- * is to say, sharing of overlapping-but-not-identical regions is not
- * permitted.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/lock.h>
-#include <sys/malloc.h>
-#include <sys/rman.h>
-#include <sys/bus.h> /* XXX debugging */
-
-MALLOC_DEFINE(M_RMAN, "rman", "Resource manager");
-
-struct rman_head rman_head;
-#ifndef NULL_SIMPLELOCKS
-static struct simplelock rman_lock; /* mutex to protect rman_head */
-#endif
-static int int_rman_activate_resource(struct rman *rm, struct resource *r,
- struct resource **whohas);
-static int int_rman_release_resource(struct rman *rm, struct resource *r);
-
-#define CIRCLEQ_TERMCOND(var, head) (var == (void *)&(head))
-
-int
-rman_init(struct rman *rm)
-{
- static int once;
-
- if (once == 0) {
- once = 1;
- TAILQ_INIT(&rman_head);
- simple_lock_init(&rman_lock);
- }
-
- if (rm->rm_type == RMAN_UNINIT)
- panic("rman_init");
- if (rm->rm_type == RMAN_GAUGE)
- panic("implement RMAN_GAUGE");
-
- CIRCLEQ_INIT(&rm->rm_list);
- rm->rm_slock = malloc(sizeof *rm->rm_slock, M_RMAN, M_NOWAIT);
- if (rm->rm_slock == 0)
- return ENOMEM;
- simple_lock_init(rm->rm_slock);
-
- simple_lock(&rman_lock);
- TAILQ_INSERT_TAIL(&rman_head, rm, rm_link);
- simple_unlock(&rman_lock);
- return 0;
-}
-
-/*
- * NB: this interface is not robust against programming errors which
- * add multiple copies of the same region.
- */
-int
-rman_manage_region(struct rman *rm, u_long start, u_long end)
-{
- struct resource *r, *s;
-
- r = malloc(sizeof *r, M_RMAN, M_NOWAIT);
- if (r == 0)
- return ENOMEM;
- r->r_sharehead = 0;
- r->r_start = start;
- r->r_end = end;
- r->r_flags = 0;
- r->r_dev = 0;
- r->r_rm = rm;
-
- simple_lock(rm->rm_slock);
- for (s = rm->rm_list.cqh_first;
- !CIRCLEQ_TERMCOND(s, rm->rm_list) && s->r_end < r->r_start;
- s = s->r_link.cqe_next)
- ;
-
- if (CIRCLEQ_TERMCOND(s, rm->rm_list)) {
- CIRCLEQ_INSERT_TAIL(&rm->rm_list, r, r_link);
- } else {
- CIRCLEQ_INSERT_BEFORE(&rm->rm_list, s, r, r_link);
- }
-
- simple_unlock(rm->rm_slock);
- return 0;
-}
-
-int
-rman_fini(struct rman *rm)
-{
- struct resource *r;
-
- simple_lock(rm->rm_slock);
- for (r = rm->rm_list.cqh_first; !CIRCLEQ_TERMCOND(r, rm->rm_list);
- r = r->r_link.cqe_next) {
- if (r->r_flags & RF_ALLOCATED)
- return EBUSY;
- }
-
- /*
- * There really should only be one of these if we are in this
- * state and the code is working properly, but it can't hurt.
- */
- for (r = rm->rm_list.cqh_first; !CIRCLEQ_TERMCOND(r, rm->rm_list);
- r = rm->rm_list.cqh_first) {
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- free(r, M_RMAN);
- }
- simple_unlock(rm->rm_slock);
- simple_lock(&rman_lock);
- TAILQ_REMOVE(&rman_head, rm, rm_link);
- simple_unlock(&rman_lock);
- free(rm->rm_slock, M_RMAN);
-
- return 0;
-}
-
-struct resource *
-rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count,
- u_int flags, struct device *dev)
-{
- u_int want_activate;
- struct resource *r, *s, *rv;
- u_long rstart, rend;
-
- rv = 0;
-
-#ifdef RMAN_DEBUG
- printf("rman_reserve_resource: <%s> request: [%#lx, %#lx], length "
- "%#lx, flags %u, device %s%d\n", rm->rm_descr, start, end,
- count, flags, device_get_name(dev), device_get_unit(dev));
-#endif /* RMAN_DEBUG */
- want_activate = (flags & RF_ACTIVE);
- flags &= ~RF_ACTIVE;
-
- simple_lock(rm->rm_slock);
-
- for (r = rm->rm_list.cqh_first;
- !CIRCLEQ_TERMCOND(r, rm->rm_list) && r->r_end < start;
- r = r->r_link.cqe_next)
- ;
-
- if (CIRCLEQ_TERMCOND(r, rm->rm_list)) {
-#ifdef RMAN_DEBUG
- printf("could not find a region\n");
-#endif RMAN_DEBUG
- goto out;
- }
-
- /*
- * First try to find an acceptable totally-unshared region.
- */
- for (s = r; !CIRCLEQ_TERMCOND(s, rm->rm_list);
- s = s->r_link.cqe_next) {
-#ifdef RMAN_DEBUG
- printf("considering [%#lx, %#lx]\n", s->r_start, s->r_end);
-#endif /* RMAN_DEBUG */
- if (s->r_start > end) {
-#ifdef RMAN_DEBUG
- printf("s->r_start (%#lx) > end (%#lx)\n", s->r_start, end);
-#endif /* RMAN_DEBUG */
- break;
- }
- if (s->r_flags & RF_ALLOCATED) {
-#ifdef RMAN_DEBUG
- printf("region is allocated\n");
-#endif /* RMAN_DEBUG */
- continue;
- }
- rstart = max(s->r_start, start);
- rend = min(s->r_end, max(start + count, end));
-#ifdef RMAN_DEBUG
- printf("truncated region: [%#lx, %#lx]; size %#lx (requested %#lx)\n",
- rstart, rend, (rend - rstart + 1), count);
-#endif /* RMAN_DEBUG */
-
- if ((rend - rstart + 1) >= count) {
-#ifdef RMAN_DEBUG
- printf("candidate region: [%#lx, %#lx], size %#lx\n",
- rend, rstart, (rend - rstart + 1));
-#endif /* RMAN_DEBUG */
- if ((s->r_end - s->r_start + 1) == count) {
-#ifdef RMAN_DEBUG
- printf("candidate region is entire chunk\n");
-#endif /* RMAN_DEBUG */
- rv = s;
- rv->r_flags |= RF_ALLOCATED;
- rv->r_dev = dev;
- goto out;
- }
-
- /*
- * If s->r_start < rstart and
- * s->r_end > rstart + count - 1, then
- * we need to split the region into three pieces
- * (the middle one will get returned to the user).
- * Otherwise, we are allocating at either the
- * beginning or the end of s, so we only need to
- * split it in two. The first case requires
- * two new allocations; the second requires but one.
- */
- rv = malloc(sizeof *r, M_RMAN, M_NOWAIT);
- if (rv == 0)
- goto out;
- rv->r_start = rstart;
- rv->r_end = rstart + count - 1;
- rv->r_flags = flags | RF_ALLOCATED;
- rv->r_dev = dev;
- rv->r_sharehead = 0;
-
- if (s->r_start < rv->r_start && s->r_end > rv->r_end) {
-#ifdef RMAN_DEBUG
- printf("splitting region in three parts: "
- "[%#lx, %#lx]; [%#lx, %#lx]; [%#lx, %#lx]\n",
- s->r_start, rv->r_start - 1,
- rv->r_start, rv->r_end,
- rv->r_end + 1, s->r_end);
-#endif /* RMAN_DEBUG */
- /*
- * We are allocating in the middle.
- */
- r = malloc(sizeof *r, M_RMAN, M_NOWAIT);
- if (r == 0) {
- free(rv, M_RMAN);
- rv = 0;
- goto out;
- }
- r->r_start = rv->r_end + 1;
- r->r_end = s->r_end;
- r->r_flags = s->r_flags;
- r->r_dev = 0;
- r->r_sharehead = 0;
- s->r_end = rv->r_start - 1;
- CIRCLEQ_INSERT_AFTER(&rm->rm_list, s, rv,
- r_link);
- CIRCLEQ_INSERT_AFTER(&rm->rm_list, rv, r,
- r_link);
- } else if (s->r_start == rv->r_start) {
-#ifdef RMAN_DEBUG
- printf("allocating from the beginning\n");
-#endif /* RMAN_DEBUG */
- /*
- * We are allocating at the beginning.
- */
- s->r_start = rv->r_end + 1;
- CIRCLEQ_INSERT_BEFORE(&rm->rm_list, s, rv,
- r_link);
- } else {
-#ifdef RMAN_DEBUG
- printf("allocating at the end\n");
-#endif /* RMAN_DEBUG */
- /*
- * We are allocating at the end.
- */
- s->r_end = rv->r_start - 1;
- CIRCLEQ_INSERT_AFTER(&rm->rm_list, s, rv,
- r_link);
- }
- goto out;
- }
- }
-
- /*
- * Now find an acceptable shared region, if the client's requirements
- * allow sharing. By our implementation restriction, a candidate
- * region must match exactly by both size and sharing type in order
- * to be considered compatible with the client's request. (The
- * former restriction could probably be lifted without too much
- * additional work, but this does not seem warranted.)
- */
-#ifdef RMAN_DEBUG
- printf("no unshared regions found\n");
-#endif /* RMAN_DEBUG */
- if ((flags & (RF_SHAREABLE | RF_TIMESHARE)) == 0)
- goto out;
-
- for (s = r; !CIRCLEQ_TERMCOND(s, rm->rm_list);
- s = s->r_link.cqe_next) {
- if (s->r_start > end)
- break;
- if ((s->r_flags & flags) != flags)
- continue;
- rstart = max(s->r_start, start);
- rend = min(s->r_end, max(start + count, end));
- if (s->r_start >= start && s->r_end <= end
- && (s->r_end - s->r_start + 1) == count) {
- rv = malloc(sizeof *rv, M_RMAN, M_NOWAIT);
- if (rv == 0)
- goto out;
- rv->r_start = s->r_start;
- rv->r_end = s->r_end;
- rv->r_flags = s->r_flags &
- (RF_ALLOCATED | RF_SHAREABLE | RF_TIMESHARE);
- rv->r_dev = dev;
- rv->r_rm = rm;
- if (s->r_sharehead == 0) {
- s->r_sharehead = malloc(sizeof *s->r_sharehead,
- M_RMAN, M_NOWAIT);
- if (s->r_sharehead == 0) {
- free(rv, M_RMAN);
- rv = 0;
- goto out;
- }
- LIST_INIT(s->r_sharehead);
- LIST_INSERT_HEAD(s->r_sharehead, s,
- r_sharelink);
- s->r_flags = RF_FIRSTSHARE;
- }
- rv->r_sharehead = s->r_sharehead;
- LIST_INSERT_HEAD(s->r_sharehead, rv, r_sharelink);
- goto out;
- }
- }
-
- /*
- * We couldn't find anything.
- */
-out:
- /*
- * If the user specified RF_ACTIVE in the initial flags,
- * which is reflected in `want_activate', we attempt to atomically
- * activate the resource. If this fails, we release the resource
- * and indicate overall failure. (This behavior probably doesn't
- * make sense for RF_TIMESHARE-type resources.)
- */
- if (rv && want_activate) {
- struct resource *whohas;
- if (int_rman_activate_resource(rm, rv, &whohas)) {
- int_rman_release_resource(rm, rv);
- rv = 0;
- }
- }
-
- simple_unlock(rm->rm_slock);
- return (rv);
-}
-
-static int
-int_rman_activate_resource(struct rman *rm, struct resource *r,
- struct resource **whohas)
-{
- struct resource *s;
- int ok;
-
- /*
- * If we are not timesharing, then there is nothing much to do.
- * If we already have the resource, then there is nothing at all to do.
- * If we are not on a sharing list with anybody else, then there is
- * little to do.
- */
- if ((r->r_flags & RF_TIMESHARE) == 0
- || (r->r_flags & RF_ACTIVE) != 0
- || r->r_sharehead == 0) {
- r->r_flags |= RF_ACTIVE;
- return 0;
- }
-
- ok = 1;
- for (s = r->r_sharehead->lh_first; s && ok;
- s = s->r_sharelink.le_next) {
- if ((s->r_flags & RF_ACTIVE) != 0) {
- ok = 0;
- *whohas = s;
- }
- }
- if (ok) {
- r->r_flags |= RF_ACTIVE;
- return 0;
- }
- return EBUSY;
-}
-
-int
-rman_activate_resource(struct resource *r)
-{
- int rv;
- struct resource *whohas;
- struct rman *rm;
-
- rm = r->r_rm;
- simple_lock(rm->rm_slock);
- rv = int_rman_activate_resource(rm, r, &whohas);
- simple_unlock(rm->rm_slock);
- return rv;
-}
-
-int
-rman_await_resource(struct resource *r, int pri, int timo)
-{
- int rv, s;
- struct resource *whohas;
- struct rman *rm;
-
- rm = r->r_rm;
- for (;;) {
- simple_lock(rm->rm_slock);
- rv = int_rman_activate_resource(rm, r, &whohas);
- if (rv != EBUSY)
- return (rv);
-
- if (r->r_sharehead == 0)
- panic("rman_await_resource");
- /*
- * splhigh hopefully will prevent a race between
- * simple_unlock and tsleep where a process
- * could conceivably get in and release the resource
- * before we have a chance to sleep on it.
- */
- s = splhigh();
- whohas->r_flags |= RF_WANTED;
- simple_unlock(rm->rm_slock);
- rv = tsleep(r->r_sharehead, pri, "rmwait", timo);
- if (rv) {
- splx(s);
- return rv;
- }
- simple_lock(rm->rm_slock);
- splx(s);
- }
-}
-
-int
-rman_deactivate_resource(struct resource *r)
-{
- struct rman *rm;
-
- rm = r->r_rm;
- simple_lock(rm->rm_slock);
- r->r_flags &= ~RF_ACTIVE;
- if (r->r_flags & RF_WANTED) {
- r->r_flags &= ~RF_WANTED;
- wakeup(r->r_sharehead);
- }
- simple_unlock(rm->rm_slock);
- return 0;
-}
-
-static int
-int_rman_release_resource(struct rman *rm, struct resource *r)
-{
- struct resource *s, *t;
-
- if (r->r_flags & RF_ACTIVE)
- return EBUSY;
-
- /*
- * Check for a sharing list first. If there is one, then we don't
- * have to think as hard.
- */
- if (r->r_sharehead) {
- /*
- * If a sharing list exists, then we know there are at
- * least two sharers.
- *
- * If we are in the main circleq, appoint someone else.
- */
- LIST_REMOVE(r, r_sharelink);
- s = r->r_sharehead->lh_first;
- if (r->r_flags & RF_FIRSTSHARE) {
- s->r_flags |= RF_FIRSTSHARE;
- CIRCLEQ_INSERT_BEFORE(&rm->rm_list, r, s, r_link);
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- }
-
- /*
- * Make sure that the sharing list goes away completely
- * if the resource is no longer being shared at all.
- */
- if (s->r_sharelink.le_next == 0) {
- free(s->r_sharehead, M_RMAN);
- s->r_sharehead = 0;
- s->r_flags &= ~RF_FIRSTSHARE;
- }
- goto out;
- }
-
- /*
- * Look at the adjacent resources in the list and see if our
- * segment can be merged with any of them.
- */
- s = r->r_link.cqe_prev;
- t = r->r_link.cqe_next;
-
- if (s != (void *)&rm->rm_list && (s->r_flags & RF_ALLOCATED) == 0
- && t != (void *)&rm->rm_list && (t->r_flags & RF_ALLOCATED) == 0) {
- /*
- * Merge all three segments.
- */
- s->r_end = t->r_end;
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- CIRCLEQ_REMOVE(&rm->rm_list, t, r_link);
- free(t, M_RMAN);
- } else if (s != (void *)&rm->rm_list
- && (s->r_flags & RF_ALLOCATED) == 0) {
- /*
- * Merge previous segment with ours.
- */
- s->r_end = r->r_end;
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- } else if (t != (void *)&rm->rm_list
- && (t->r_flags & RF_ALLOCATED) == 0) {
- /*
- * Merge next segment with ours.
- */
- t->r_start = r->r_start;
- CIRCLEQ_REMOVE(&rm->rm_list, r, r_link);
- } else {
- /*
- * At this point, we know there is nothing we
- * can potentially merge with, because on each
- * side, there is either nothing there or what is
- * there is still allocated. In that case, we don't
- * want to remove r from the list; we simply want to
- * change it to an unallocated region and return
- * without freeing anything.
- */
- r->r_flags &= ~RF_ALLOCATED;
- return 0;
- }
-
-out:
- free(r, M_RMAN);
- return 0;
-}
-
-int
-rman_release_resource(struct resource *r)
-{
- int rv;
- struct rman *rm = r->r_rm;
-
- simple_lock(rm->rm_slock);
- rv = int_rman_release_resource(rm, r);
- simple_unlock(rm->rm_slock);
- return (rv);
-}
diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c
deleted file mode 100644
index 24f8846d5b999..0000000000000
--- a/sys/kern/subr_scanf.c
+++ /dev/null
@@ -1,793 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- * From: Id: vfscanf.c,v 1.13 1998/09/25 12:20:27 obrien Exp
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <machine/limits.h>
-
-/*
- * Note that stdarg.h and the ANSI style va_start macro is used for both
- * ANSI and traditional C compilers.
- */
-#include <machine/stdarg.h>
-
-#define BUF 32 /* Maximum length of numeric string. */
-
-/*
- * Flags used during conversion.
- */
-#define LONG 0x01 /* l: long or double */
-#define SHORT 0x04 /* h: short */
-#define SUPPRESS 0x08 /* suppress assignment */
-#define POINTER 0x10 /* weird %p pointer (`fake hex') */
-#define NOSKIP 0x20 /* do not skip blanks */
-#define QUAD 0x400
-
-/*
- * The following are used in numeric conversions only:
- * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point;
- * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral.
- */
-#define SIGNOK 0x40 /* +/- is (still) legal */
-#define NDIGITS 0x80 /* no digits detected */
-
-#define DPTOK 0x100 /* (float) decimal point is still legal */
-#define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */
-
-#define PFXOK 0x100 /* 0x prefix is (still) legal */
-#define NZDIGITS 0x200 /* no zero digits detected */
-
-/*
- * Conversion types.
- */
-#define CT_CHAR 0 /* %c conversion */
-#define CT_CCL 1 /* %[...] conversion */
-#define CT_STRING 2 /* %s conversion */
-#define CT_INT 3 /* integer, i.e., strtoq or strtouq */
-typedef u_quad_t (*ccfntype)(const char *, char **, int);
-
-#define isspace(c) ((c) == ' ' || (c) == '\t' || \
- (c) == '\r' || (c) == '\n')
-#define isascii(c) (((c) & ~0x7f) == 0)
-#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
-#define islower(c) ((c) >= 'a' && (c) <= 'z')
-#define isalpha(c) (isupper(c) || (islower(c)))
-#define isdigit(c) ((c) >= '0' && (c) <= '9')
-
-static u_char *__sccl(char *, u_char *);
-
-int
-sscanf(const char *ibuf, const char *fmt, ...)
-{
- va_list ap;
- int ret;
-
- va_start(ap, fmt);
- ret = vsscanf(ibuf, fmt, ap);
- va_end(ap);
- return(ret);
-}
-
-int
-vsscanf(const char *inp, char const *fmt0, va_list ap)
-{
- int inr;
- u_char *fmt = (u_char *)fmt0;
- int c; /* character from format, or conversion */
- size_t width; /* field width, or 0 */
- char *p; /* points into all kinds of strings */
- int n; /* handy integer */
- int flags; /* flags as defined above */
- char *p0; /* saves original value of p when necessary */
- int nassigned; /* number of fields assigned */
- int nconversions; /* number of conversions */
- int nread; /* number of characters consumed from fp */
- int base; /* base argument to strtoq/strtouq */
- ccfntype ccfn; /* conversion function (strtoq/strtouq) */
- char ccltab[256]; /* character class table for %[...] */
- char buf[BUF]; /* buffer for numeric conversions */
-
- /* `basefix' is used to avoid `if' tests in the integer scanner */
- static short basefix[17] =
- { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
-
- inr = strlen(inp);
-
- nassigned = 0;
- nconversions = 0;
- nread = 0;
- base = 0; /* XXX just to keep gcc happy */
- ccfn = NULL; /* XXX just to keep gcc happy */
- for (;;) {
- c = *fmt++;
- if (c == 0)
- return (nassigned);
- if (isspace(c)) {
- while (inr > 0 && isspace(*inp))
- nread++, inr--, inp++;
- continue;
- }
- if (c != '%')
- goto literal;
- width = 0;
- flags = 0;
- /*
- * switch on the format. continue if done;
- * break once format type is derived.
- */
-again: c = *fmt++;
- switch (c) {
- case '%':
-literal:
- if (inr <= 0)
- goto input_failure;
- if (*inp != c)
- goto match_failure;
- inr--, inp++;
- nread++;
- continue;
-
- case '*':
- flags |= SUPPRESS;
- goto again;
- case 'l':
- flags |= LONG;
- goto again;
- case 'q':
- flags |= QUAD;
- goto again;
- case 'h':
- flags |= SHORT;
- goto again;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- width = width * 10 + c - '0';
- goto again;
-
- /*
- * Conversions.
- *
- */
- case 'd':
- c = CT_INT;
- ccfn = (ccfntype)strtoq;
- base = 10;
- break;
-
- case 'i':
- c = CT_INT;
- ccfn = (ccfntype)strtoq;
- base = 0;
- break;
-
- case 'o':
- c = CT_INT;
- ccfn = strtouq;
- base = 8;
- break;
-
- case 'u':
- c = CT_INT;
- ccfn = strtouq;
- base = 10;
- break;
-
- case 'x':
- flags |= PFXOK; /* enable 0x prefixing */
- c = CT_INT;
- ccfn = strtouq;
- base = 16;
- break;
-
- case 's':
- c = CT_STRING;
- break;
-
- case '[':
- fmt = __sccl(ccltab, fmt);
- flags |= NOSKIP;
- c = CT_CCL;
- break;
-
- case 'c':
- flags |= NOSKIP;
- c = CT_CHAR;
- break;
-
- case 'p': /* pointer format is like hex */
- flags |= POINTER | PFXOK;
- c = CT_INT;
- ccfn = strtouq;
- base = 16;
- break;
-
- case 'n':
- nconversions++;
- if (flags & SUPPRESS) /* ??? */
- continue;
- if (flags & SHORT)
- *va_arg(ap, short *) = nread;
- else if (flags & LONG)
- *va_arg(ap, long *) = nread;
- else if (flags & QUAD)
- *va_arg(ap, quad_t *) = nread;
- else
- *va_arg(ap, int *) = nread;
- continue;
- }
-
- /*
- * We have a conversion that requires input.
- */
- if (inr <= 0)
- goto input_failure;
-
- /*
- * Consume leading white space, except for formats
- * that suppress this.
- */
- if ((flags & NOSKIP) == 0) {
- while (isspace(*inp)) {
- nread++;
- if (--inr > 0)
- inp++;
- else
- goto input_failure;
- }
- /*
- * Note that there is at least one character in
- * the buffer, so conversions that do not set NOSKIP
- * can no longer result in an input failure.
- */
- }
-
- /*
- * Do the conversion.
- */
- switch (c) {
-
- case CT_CHAR:
- /* scan arbitrary characters (sets NOSKIP) */
- if (width == 0)
- width = 1;
- if (flags & SUPPRESS) {
- size_t sum = 0;
- for (;;) {
- if ((n = inr) < width) {
- sum += n;
- width -= n;
- inp += n;
- if (sum == 0)
- goto input_failure;
- break;
- } else {
- sum += width;
- inr -= width;
- inp += width;
- break;
- }
- }
- nread += sum;
- } else {
- bcopy(inp, va_arg(ap, char *), width);
- inr -= width;
- inp += width;
- nread += width;
- nassigned++;
- }
- nconversions++;
- break;
-
- case CT_CCL:
- /* scan a (nonempty) character class (sets NOSKIP) */
- if (width == 0)
- width = (size_t)~0; /* `infinity' */
- /* take only those things in the class */
- if (flags & SUPPRESS) {
- n = 0;
- while (ccltab[*inp]) {
- n++, inr--, inp++;
- if (--width == 0)
- break;
- if (inr <= 0) {
- if (n == 0)
- goto input_failure;
- break;
- }
- }
- if (n == 0)
- goto match_failure;
- } else {
- p0 = p = va_arg(ap, char *);
- while (ccltab[*inp]) {
- inr--;
- *p++ = *inp++;
- if (--width == 0)
- break;
- if (inr <= 0) {
- if (p == p0)
- goto input_failure;
- break;
- }
- }
- n = p - p0;
- if (n == 0)
- goto match_failure;
- *p = 0;
- nassigned++;
- }
- nread += n;
- nconversions++;
- break;
-
- case CT_STRING:
- /* like CCL, but zero-length string OK, & no NOSKIP */
- if (width == 0)
- width = (size_t)~0;
- if (flags & SUPPRESS) {
- n = 0;
- while (!isspace(*inp)) {
- n++, inr--, inp++;
- if (--width == 0)
- break;
- if (inr <= 0)
- break;
- }
- nread += n;
- } else {
- p0 = p = va_arg(ap, char *);
- while (!isspace(*inp)) {
- inr--;
- *p++ = *inp++;
- if (--width == 0)
- break;
- if (inr <= 0)
- break;
- }
- *p = 0;
- nread += p - p0;
- nassigned++;
- }
- nconversions++;
- continue;
-
- case CT_INT:
- /* scan an integer as if by strtoq/strtouq */
-#ifdef hardway
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
-#else
- /* size_t is unsigned, hence this optimisation */
- if (--width > sizeof(buf) - 2)
- width = sizeof(buf) - 2;
- width++;
-#endif
- flags |= SIGNOK | NDIGITS | NZDIGITS;
- for (p = buf; width; width--) {
- c = *inp;
- /*
- * Switch on the character; `goto ok'
- * if we accept it as a part of number.
- */
- switch (c) {
-
- /*
- * The digit 0 is always legal, but is
- * special. For %i conversions, if no
- * digits (zero or nonzero) have been
- * scanned (only signs), we will have
- * base==0. In that case, we should set
- * it to 8 and enable 0x prefixing.
- * Also, if we have not scanned zero digits
- * before this, do not turn off prefixing
- * (someone else will turn it off if we
- * have scanned any nonzero digits).
- */
- case '0':
- if (base == 0) {
- base = 8;
- flags |= PFXOK;
- }
- if (flags & NZDIGITS)
- flags &= ~(SIGNOK|NZDIGITS|NDIGITS);
- else
- flags &= ~(SIGNOK|PFXOK|NDIGITS);
- goto ok;
-
- /* 1 through 7 always legal */
- case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- base = basefix[base];
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* digits 8 and 9 ok iff decimal or hex */
- case '8': case '9':
- base = basefix[base];
- if (base <= 8)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* letters ok iff hex */
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
- /* no need to fix base here */
- if (base <= 10)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* sign ok only as first character */
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto ok;
- }
- break;
-
- /* x ok iff flag still set & 2nd char */
- case 'x': case 'X':
- if (flags & PFXOK && p == buf + 1) {
- base = 16; /* if %i */
- flags &= ~PFXOK;
- goto ok;
- }
- break;
- }
-
- /*
- * If we got here, c is not a legal character
- * for a number. Stop accumulating digits.
- */
- break;
- ok:
- /*
- * c is legal: store it and look at the next.
- */
- *p++ = c;
- if (--inr > 0)
- inp++;
- else
- break; /* end of input */
- }
- /*
- * If we had only a sign, it is no good; push
- * back the sign. If the number ends in `x',
- * it was [sign] '0' 'x', so push back the x
- * and treat it as [sign] '0'.
- */
- if (flags & NDIGITS) {
- if (p > buf) {
- inp--;
- inr++;
- }
- goto match_failure;
- }
- c = ((u_char *)p)[-1];
- if (c == 'x' || c == 'X') {
- --p;
- inp--;
- inr++;
- }
- if ((flags & SUPPRESS) == 0) {
- u_quad_t res;
-
- *p = 0;
- res = (*ccfn)(buf, (char **)NULL, base);
- if (flags & POINTER)
- *va_arg(ap, void **) =
- (void *)(u_long)res;
- else if (flags & SHORT)
- *va_arg(ap, short *) = res;
- else if (flags & LONG)
- *va_arg(ap, long *) = res;
- else if (flags & QUAD)
- *va_arg(ap, quad_t *) = res;
- else
- *va_arg(ap, int *) = res;
- nassigned++;
- }
- nread += p - buf;
- nconversions++;
- break;
-
- }
- }
-input_failure:
- return (nconversions != 0 ? nassigned : -1);
-match_failure:
- return (nassigned);
-}
-
-/*
- * Fill in the given table from the scanset at the given format
- * (just after `['). Return a pointer to the character past the
- * closing `]'. The table has a 1 wherever characters should be
- * considered part of the scanset.
- */
-static u_char *
-__sccl(char *tab, u_char *fmt)
-{
- int c, n, v;
-
- /* first `clear' the whole table */
- c = *fmt++; /* first char hat => negated scanset */
- if (c == '^') {
- v = 1; /* default => accept */
- c = *fmt++; /* get new first char */
- } else
- v = 0; /* default => reject */
-
- /* XXX: Will not work if sizeof(tab*) > sizeof(char) */
- for (n = 0; n < 256; n++)
- tab[n] = v; /* memset(tab, v, 256) */
-
- if (c == 0)
- return (fmt - 1);/* format ended before closing ] */
-
- /*
- * Now set the entries corresponding to the actual scanset
- * to the opposite of the above.
- *
- * The first character may be ']' (or '-') without being special;
- * the last character may be '-'.
- */
- v = 1 - v;
- for (;;) {
- tab[c] = v; /* take character c */
-doswitch:
- n = *fmt++; /* and examine the next */
- switch (n) {
-
- case 0: /* format ended too soon */
- return (fmt - 1);
-
- case '-':
- /*
- * A scanset of the form
- * [01+-]
- * is defined as `the digit 0, the digit 1,
- * the character +, the character -', but
- * the effect of a scanset such as
- * [a-zA-Z0-9]
- * is implementation defined. The V7 Unix
- * scanf treats `a-z' as `the letters a through
- * z', but treats `a-a' as `the letter a, the
- * character -, and the letter a'.
- *
- * For compatibility, the `-' is not considerd
- * to define a range if the character following
- * it is either a close bracket (required by ANSI)
- * or is not numerically greater than the character
- * we just stored in the table (c).
- */
- n = *fmt;
- if (n == ']' || n < c) {
- c = '-';
- break; /* resume the for(;;) */
- }
- fmt++;
- /* fill in the range */
- do {
- tab[++c] = v;
- } while (c < n);
- c = n;
- /*
- * Alas, the V7 Unix scanf also treats formats
- * such as [a-c-e] as `the letters a through e'.
- * This too is permitted by the standard....
- */
- goto doswitch;
- break;
-
- case ']': /* end of scanset */
- return (fmt);
-
- default: /* just another character */
- c = n;
- break;
- }
- }
- /* NOTREACHED */
-}
-
-/*
- * Convert a string to an unsigned quad integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-u_quad_t
-strtouq(const char *nptr, char **endptr, int base)
-{
- const char *s = nptr;
- u_quad_t acc;
- unsigned char c;
- u_quad_t qbase, cutoff;
- int neg, any, cutlim;
-
- /*
- * See strtoq for comments as to the logic used.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- qbase = (unsigned)base;
- cutoff = (u_quad_t)UQUAD_MAX / qbase;
- cutlim = (u_quad_t)UQUAD_MAX % qbase;
- for (acc = 0, any = 0;; c = *s++) {
- if (!isascii(c))
- break;
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= qbase;
- acc += c;
- }
- }
- if (any < 0) {
- acc = UQUAD_MAX;
- } else if (neg)
- acc = -acc;
- if (endptr != 0)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
-
-/*
- * Convert a string to a quad integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-quad_t
-strtoq(const char *nptr, char **endptr, int base)
-{
- const char *s;
- u_quad_t acc;
- unsigned char c;
- u_quad_t qbase, cutoff;
- int neg, any, cutlim;
-
- /*
- * Skip white space and pick up leading +/- sign if any.
- * If base is 0, allow 0x for hex and 0 for octal, else
- * assume decimal; if base is already 16, allow 0x.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
-
- /*
- * Compute the cutoff value between legal numbers and illegal
- * numbers. That is the largest legal value, divided by the
- * base. An input number that is greater than this value, if
- * followed by a legal input character, is too big. One that
- * is equal to this value may be valid or not; the limit
- * between valid and invalid numbers is then based on the last
- * digit. For instance, if the range for quads is
- * [-9223372036854775808..9223372036854775807] and the input base
- * is 10, cutoff will be set to 922337203685477580 and cutlim to
- * either 7 (neg==0) or 8 (neg==1), meaning that if we have
- * accumulated a value > 922337203685477580, or equal but the
- * next digit is > 7 (or 8), the number is too big, and we will
- * return a range error.
- *
- * Set any if any `digits' consumed; make it negative to indicate
- * overflow.
- */
- qbase = (unsigned)base;
- cutoff = neg ? (u_quad_t)-(QUAD_MIN + QUAD_MAX) + QUAD_MAX : QUAD_MAX;
- cutlim = cutoff % qbase;
- cutoff /= qbase;
- for (acc = 0, any = 0;; c = *s++) {
- if (!isascii(c))
- break;
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= qbase;
- acc += c;
- }
- }
- if (any < 0) {
- acc = neg ? QUAD_MIN : QUAD_MAX;
- } else if (neg)
- acc = -acc;
- if (endptr != 0)
- *endptr = (char *)(any ? s - 1 : nptr);
- return (acc);
-}
diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c
index 7ff33668c2a94..e803032bdae7c 100644
--- a/sys/kern/subr_xxx.c
+++ b/sys/kern/subr_xxx.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)subr_xxx.c 8.1 (Berkeley) 6/10/93
- * $Id: subr_xxx.c,v 1.11 1998/08/20 06:10:40 bde Exp $
+ * $Id: subr_xxx.c,v 1.10 1998/06/07 17:11:38 dfr Exp $
*/
/*
@@ -161,7 +161,7 @@ nodevtotty(dev)
int
nommap(dev, offset, nprot)
dev_t dev;
- vm_offset_t offset;
+ int offset;
int nprot;
{
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 8d90ee9bdc2e2..bb8f7a3a70b0d 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
- * $Id: sys_generic.c,v 1.42 1998/11/11 10:03:55 truckman Exp $
+ * $Id: sys_generic.c,v 1.40 1998/08/24 08:39:38 dfr Exp $
*/
#include "opt_ktrace.h"
@@ -469,6 +469,37 @@ ioctl(p, uap)
error = (*fp->f_ops->fo_ioctl)(fp, FIOASYNC, (caddr_t)&tmp, p);
break;
+ case FIOSETOWN:
+ tmp = *(int *)data;
+ if (fp->f_type == DTYPE_SOCKET) {
+ ((struct socket *)fp->f_data)->so_pgid = tmp;
+ error = 0;
+ break;
+ }
+ if (tmp <= 0) {
+ tmp = -tmp;
+ } else {
+ struct proc *p1 = pfind(tmp);
+ if (p1 == 0) {
+ error = ESRCH;
+ break;
+ }
+ tmp = p1->p_pgrp->pg_id;
+ }
+ error = (*fp->f_ops->fo_ioctl)
+ (fp, (int)TIOCSPGRP, (caddr_t)&tmp, p);
+ break;
+
+ case FIOGETOWN:
+ if (fp->f_type == DTYPE_SOCKET) {
+ error = 0;
+ *(int *)data = ((struct socket *)fp->f_data)->so_pgid;
+ break;
+ }
+ error = (*fp->f_ops->fo_ioctl)(fp, (int)TIOCGPGRP, data, p);
+ *(int *)data = -*(int *)data;
+ break;
+
default:
error = (*fp->f_ops->fo_ioctl)(fp, com, data, p);
/*
@@ -762,11 +793,9 @@ pollscan(p, fds, nfd)
int n = 0;
for (i = 0; i < nfd; i++, fds++) {
- if (fds->fd >= fdp->fd_nfiles) {
+ if ((u_int)fds->fd >= fdp->fd_nfiles) {
fds->revents = POLLNVAL;
n++;
- } else if (fds->fd < 0) {
- fds->revents = 0;
} else {
fp = fdp->fd_ofiles[fds->fd];
if (fp == 0) {
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 29e1e97a7aad7..9b60e26c2543d 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: sys_pipe.c,v 1.45 1998/11/11 10:03:55 truckman Exp $
+ * $Id: sys_pipe.c,v 1.42 1998/06/07 17:11:39 dfr Exp $
*/
/*
@@ -256,6 +256,7 @@ pipeinit(cpipe)
cpipe->pipe_atime = cpipe->pipe_ctime;
cpipe->pipe_mtime = cpipe->pipe_ctime;
bzero(&cpipe->pipe_sel, sizeof cpipe->pipe_sel);
+ cpipe->pipe_pgid = NO_PID;
#ifndef PIPE_NODIRECT
/*
@@ -308,12 +309,18 @@ static __inline void
pipeselwakeup(cpipe)
struct pipe *cpipe;
{
+ struct proc *p;
+
if (cpipe->pipe_state & PIPE_SEL) {
cpipe->pipe_state &= ~PIPE_SEL;
selwakeup(&cpipe->pipe_sel);
}
- if ((cpipe->pipe_state & PIPE_ASYNC) && cpipe->pipe_sigio)
- pgsigio(cpipe->pipe_sigio, SIGIO, 0);
+ if (cpipe->pipe_state & PIPE_ASYNC) {
+ if (cpipe->pipe_pgid < 0)
+ gsignal(-cpipe->pipe_pgid, SIGIO);
+ else if ((p = pfind(cpipe->pipe_pgid)) != NULL)
+ psignal(p, SIGIO);
+ }
}
/* ARGSUSED */
@@ -495,7 +502,7 @@ pipe_build_write_buffer(wpipe, uio)
if (!paddr) {
int j;
for(j=0;j<i;j++)
- vm_page_unwire(wpipe->pipe_map.ms[j], 1);
+ vm_page_unwire(wpipe->pipe_map.ms[j]);
return EFAULT;
}
@@ -559,7 +566,7 @@ struct pipe *wpipe;
}
}
for (i=0;i<wpipe->pipe_map.npages;i++)
- vm_page_unwire(wpipe->pipe_map.ms[i], 1);
+ vm_page_unwire(wpipe->pipe_map.ms[i]);
}
/*
@@ -946,20 +953,12 @@ pipe_ioctl(fp, cmd, data, p)
*(int *)data = mpipe->pipe_buffer.cnt;
return (0);
- case FIOSETOWN:
- return (fsetown(*(int *)data, &mpipe->pipe_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(mpipe->pipe_sigio);
- return (0);
-
- /* This is deprecated, FIOSETOWN should be used instead. */
case TIOCSPGRP:
- return (fsetown(-(*(int *)data), &mpipe->pipe_sigio));
+ mpipe->pipe_pgid = *(int *)data;
+ return (0);
- /* This is deprecated, FIOGETOWN should be used instead. */
case TIOCGPGRP:
- *(int *)data = -fgetown(mpipe->pipe_sigio);
+ *(int *)data = mpipe->pipe_pgid;
return (0);
}
@@ -1039,7 +1038,6 @@ pipe_close(fp, p)
{
struct pipe *cpipe = (struct pipe *)fp->f_data;
- funsetown(cpipe->pipe_sigio);
pipeclose(cpipe);
fp->f_data = NULL;
return 0;
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 475612703965b..330a2d68c9ee7 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sys_process.c,v 1.40 1998/07/29 18:41:30 dfr Exp $
+ * $Id: sys_process.c,v 1.39 1998/07/15 04:43:49 bde Exp $
*/
#include <sys/param.h>
@@ -407,10 +407,7 @@ ptrace(curp, uap)
return (error);
case PT_READ_U:
- if ((uintptr_t)uap->addr > UPAGES * PAGE_SIZE - sizeof(int)) {
- return EFAULT;
- }
- if ((uintptr_t)uap->addr & (sizeof(int) - 1)) {
+ if ((uintptr_t)uap->addr > UPAGES * PAGE_SIZE - sizeof(long)) {
return EFAULT;
}
if (ptrace_read_u_check(p,(vm_offset_t) uap->addr,
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index 8cf30cdcaf559..5b65bea89362a 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)sys_socket.c 8.1 (Berkeley) 6/10/93
- * $Id: sys_socket.c,v 1.18 1998/06/07 17:11:40 dfr Exp $
+ * $Id: sys_socket.c,v 1.17 1998/03/28 10:33:07 bde Exp $
*/
#include <sys/param.h>
@@ -44,7 +44,6 @@
#include <sys/sockio.h>
#include <sys/stat.h>
#include <sys/uio.h>
-#include <sys/filedesc.h>
#include <net/if.h>
#include <net/route.h>
@@ -115,18 +114,12 @@ soo_ioctl(fp, cmd, data, p)
*(int *)data = so->so_rcv.sb_cc;
return (0);
- case FIOSETOWN:
- return (fsetown(*(int *)data, &so->so_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(so->so_sigio);
- return (0);
-
case SIOCSPGRP:
- return (fsetown(-(*(int *)data), &so->so_sigio));
+ so->so_pgid = *(int *)data;
+ return (0);
case SIOCGPGRP:
- *(int *)data = -fgetown(so->so_sigio);
+ *(int *)data = so->so_pgid;
return (0);
case SIOCATMARK:
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index 22e9e8ecf8540..781cf4c6c7399 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -2,7 +2,7 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
char *syscallnames[] = {
@@ -342,6 +342,4 @@ char *syscallnames[] = {
"sched_get_priority_min", /* 333 = sched_get_priority_min */
"sched_rr_get_interval", /* 334 = sched_rr_get_interval */
"utrace", /* 335 = utrace */
- "sendfile", /* 336 = sendfile */
- "kldsym", /* 337 = kldsym */
};
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 677236325090a..769988b97826d 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
- $Id: syscalls.master,v 1.54 1998/11/05 14:28:24 dg Exp $
+ $Id: syscalls.master,v 1.52 1998/06/07 17:11:40 dfr Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
;
; System call name/number master file.
@@ -468,6 +468,3 @@
333 STD POSIX { int sched_get_priority_min (int policy); }
334 STD POSIX { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
335 STD BSD { int utrace(caddr_t addr, size_t len); }
-336 STD BSD { int sendfile(int fd, int s, off_t offset, size_t nbytes, \
- struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
-337 STD BSD { int kldsym(int fileid, int cmd, void *data); }
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index fb04c42b029ac..d35bbca0b8188 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $Id: sysv_sem.c,v 1.21 1998/03/30 09:50:41 phk Exp $ */
+/* $Id: sysv_sem.c,v 1.20 1997/11/06 19:29:24 phk Exp $ */
/*
* Implementation of SVID semaphores
@@ -276,7 +276,7 @@ semundo_adjust(p, supptr, semid, semnum, adjval)
/* Didn't find the right entry - create it */
if (adjval == 0)
return(0);
- if (suptr->un_cnt != seminfo.semume) {
+ if (suptr->un_cnt != SEMUME) {
sunptr = &suptr->un_ent[suptr->un_cnt];
suptr->un_cnt++;
sunptr->un_adjval = adjval;
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 1adf784ddfe13..7d34873e2e4dd 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
- * $Id: tty.c,v 1.110 1998/12/08 10:22:07 bde Exp $
+ * $Id: tty.c,v 1.105 1998/07/11 10:41:15 bde Exp $
*/
/*-
@@ -58,8 +58,8 @@
* than TTYDISC. Cancel their effects before switch disciplines
* and ignore them if they are set while we are in another
* discipline.
- * o Now that historical speed conversions are handled here, don't
- * do them in drivers.
+ * o Handle c_ispeed = 0 to c_ispeed = c_ospeed conversion here instead
+ * of in drivers and fix drivers that write to tp->t_termios.
* o Check for TS_CARR_ON being set while everything is closed and not
* waiting for carrier. TS_CARR_ON isn't cleared if nothing is open,
* so it would live until the next open even if carrier drops.
@@ -90,7 +90,6 @@
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/malloc.h>
-#include <sys/filedesc.h>
#if NSNP > 0
#include <sys/snoop.h>
#endif
@@ -231,7 +230,6 @@ ttyclose(tp)
{
int s;
- funsetown(tp->t_sigio);
s = spltty();
if (constty == tp)
constty = NULL;
@@ -706,27 +704,16 @@ ttioctl(tp, cmd, data, flag)
/* If the ioctl involves modification, hang if in the background. */
switch (cmd) {
- case TIOCCBRK:
- case TIOCCONS:
- case TIOCDRAIN:
- case TIOCEXCL:
case TIOCFLUSH:
-#ifdef TIOCHPCL
- case TIOCHPCL:
-#endif
- case TIOCNXCL:
- case TIOCSBRK:
- case TIOCSCTTY:
- case TIOCSDRAINWAIT:
case TIOCSETA:
+ case TIOCSETD:
case TIOCSETAF:
case TIOCSETAW:
- case TIOCSETD:
+#ifdef notdef
case TIOCSPGRP:
- case TIOCSTART:
+#endif
case TIOCSTAT:
case TIOCSTI:
- case TIOCSTOP:
case TIOCSWINSZ:
#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
case TIOCLBIC:
@@ -769,25 +756,6 @@ ttioctl(tp, cmd, data, flag)
*(int *)data = ttnread(tp);
splx(s);
break;
-
- case FIOSETOWN:
- /*
- * Policy -- Don't allow FIOSETOWN on someone else's
- * controlling tty
- */
- if (tp->t_session != NULL && !isctty(p, tp))
- return (ENOTTY);
-
- error = fsetown(*(int *)data, &tp->t_sigio);
- if (error)
- return (error);
- break;
- case FIOGETOWN:
- if (tp->t_session != NULL && !isctty(p, tp))
- return (ENOTTY);
- *(int *)data = fgetown(tp->t_sigio);
- break;
-
case TIOCEXCL: /* set exclusive use of tty */
s = spltty();
SET(tp->t_state, TS_XCLUDE);
@@ -858,11 +826,7 @@ ttioctl(tp, cmd, data, flag)
case TIOCSETAF: { /* drn out, fls in, set */
register struct termios *t = (struct termios *)data;
- if (t->c_ispeed == 0)
- t->c_ispeed = t->c_ospeed;
- if (t->c_ispeed == 0)
- t->c_ispeed = tp->t_ospeed;
- if (t->c_ispeed == 0)
+ if (t->c_ispeed < 0 || t->c_ospeed < 0)
return (EINVAL);
s = spltty();
if (cmd == TIOCSETAW || cmd == TIOCSETAF) {
@@ -904,8 +868,7 @@ ttioctl(tp, cmd, data, flag)
CLR(tp->t_state, TS_CONNECTED);
tp->t_cflag = t->c_cflag;
tp->t_ispeed = t->c_ispeed;
- if (t->c_ospeed != 0)
- tp->t_ospeed = t->c_ospeed;
+ tp->t_ospeed = t->c_ospeed;
ttsetwater(tp);
}
if (ISSET(t->c_lflag, ICANON) != ISSET(tp->t_lflag, ICANON) &&
@@ -1310,8 +1273,10 @@ ttrstrt(tp_arg)
struct tty *tp;
int s;
- KASSERT(tp_arg != NULL, ("ttrstrt"));
-
+#ifdef DIAGNOSTIC
+ if (tp_arg == NULL)
+ panic("ttrstrt");
+#endif
tp = tp_arg;
s = spltty();
@@ -1449,7 +1414,6 @@ ttread(tp, uio, flag)
int s, first, error = 0;
int has_stime = 0, last_cc = 0;
long slp = 0; /* XXX this should be renamed `timo'. */
- struct timeval stime;
loop:
s = spltty();
@@ -1506,7 +1470,7 @@ loop:
if (!ISSET(lflag, ICANON)) {
int m = cc[VMIN];
long t = cc[VTIME];
- struct timeval timecopy;
+ struct timeval stime, timecopy;
/*
* Check each of the four combinations.
@@ -2118,8 +2082,8 @@ ttwakeup(tp)
if (tp->t_rsel.si_pid != 0)
selwakeup(&tp->t_rsel);
- if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
- pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
+ if (ISSET(tp->t_state, TS_ASYNC))
+ pgsignal(tp->t_pgrp, SIGIO, 1);
wakeup(TSA_HUP_OR_INPUT(tp));
}
diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c
index ba71a949fb3b8..c4b13e575e252 100644
--- a/sys/kern/tty_snoop.c
+++ b/sys/kern/tty_snoop.c
@@ -135,8 +135,10 @@ snpread(dev, uio, flag)
caddr_t from;
char *nbuf;
- KASSERT(snp->snp_len + snp->snp_base <= snp->snp_blen,
- ("snoop buffer error"));
+#ifdef DIAGNOSTIC
+ if ((snp->snp_len + snp->snp_base) > snp->snp_blen)
+ panic("snoop buffer error");
+#endif
if (snp->snp_tty == NULL)
return (EIO);
@@ -206,12 +208,14 @@ snpin(snp, buf, n)
caddr_t from, to;
char *nbuf;
- KASSERT(n >= 0, ("negative snoop char count"));
if (n == 0)
return 0;
#ifdef DIAGNOSTIC
+ if (n < 0)
+ panic("bad snoop char count");
+
if (!(snp->snp_flags & SNOOP_OPEN)) {
printf("Snoop: data coming to closed device.\n");
return 0;
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
index 929da87ba79df..22078b1c3f3d8 100644
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
- * $Id: uipc_domain.c,v 1.19 1998/05/15 20:11:29 wollman Exp $
+ * $Id: uipc_domain.c,v 1.18 1997/09/16 11:43:36 bde Exp $
*/
#include <sys/param.h>
@@ -52,7 +52,7 @@
* want to call a registration function rather than being handled here
* in domaininit(). Probably this will look like:
*
- * SYSINIT(unique, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, domain_add, xxx)
+ * SYSINIT(unique, SI_SUB_PROTO_DOMAI, SI_ORDER_ANY, domain_add, xxx)
*
* Where 'xxx' is replaced by the address of a parameter struct to be
* passed to the doamin_add() function.
@@ -71,64 +71,21 @@ static void pfslowtimo __P((void *));
struct domain *domains;
-/*
- * Add a new protocol domain to the list of supported domains
- * Note: you cant unload it again because a socket may be using it.
- * XXX can't fail at this time.
- */
-static int
-net_init_domain(struct domain *dp)
-{
- register struct protosw *pr;
- int s;
-
- s = splnet();
- if (dp->dom_init)
- (*dp->dom_init)();
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
- if (pr->pr_usrreqs == 0)
- panic("domaininit: %ssw[%d] has no usrreqs!",
- dp->dom_name,
- (int)(pr - dp->dom_protosw));
- if (pr->pr_init)
- (*pr->pr_init)();
- }
- /*
- * update global informatio about maximums
- */
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- splx(s);
- return (0);
-}
-
-/*
- * Add a new protocol domain to the list of supported domains
- * Note: you cant unload it again because a socket may be using it.
- * XXX can't fail at this time.
- */
-int
-net_add_domain(struct domain *dp)
-{
- int s, error;
-
- s = splnet();
- dp->dom_next = domains;
- domains = dp;
- splx(s);
- error = net_init_domain(dp);
- max_hdr = max_linkhdr + max_protohdr;
- max_datalen = MHLEN - max_hdr;
- return (error);
+#define ADDDOMAIN(x) { \
+ __CONCAT(x,domain.dom_next) = domains; \
+ domains = &__CONCAT(x,domain); \
}
extern struct linker_set domain_set;
/* ARGSUSED*/
static void
-domaininit(void *dummy)
+domaininit(dummy)
+ void *dummy;
{
register struct domain *dp, **dpp;
+ register struct protosw *pr;
+
/*
* Before we do any setup, make sure to initialize the
* zone allocator we get struct sockets from. The obvious
@@ -144,33 +101,33 @@ domaininit(void *dummy)
socket_zone = zinit("socket", sizeof(struct socket), maxsockets,
ZONE_INTERRUPT, 0);
- if (max_linkhdr < 16) /* XXX */
- max_linkhdr = 16;
-
/*
* NB - local domain is always present.
*/
- net_add_domain(&localdomain);
+ ADDDOMAIN(local);
- /*
- * gather up as many protocols as we have statically linked.
- * XXX we need to do this because when we ask the routing
- * protocol to initialise it will want to examine all
- * installed protocols. This needs fixing before protocols
- * that use the standard routing can become modules.
- */
for (dpp = (struct domain **)domain_set.ls_items; *dpp; dpp++) {
(**dpp).dom_next = domains;
domains = *dpp;
}
- /*
- * Now ask them all to init (XXX including the routing domain,
- * see above)
- */
- for (dp = domains; dp; dp = dp->dom_next)
- net_init_domain(dp);
+ for (dp = domains; dp; dp = dp->dom_next) {
+ if (dp->dom_init)
+ (*dp->dom_init)();
+ for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
+ if (pr->pr_usrreqs == 0)
+ panic("domaininit: %ssw[%d] has no usrreqs!",
+ dp->dom_name,
+ (int)(pr - dp->dom_protosw));
+ if (pr->pr_init)
+ (*pr->pr_init)();
+ }
+ }
+ if (max_linkhdr < 16) /* XXX */
+ max_linkhdr = 16;
+ max_hdr = max_linkhdr + max_protohdr;
+ max_datalen = MHLEN - max_hdr;
timeout(pffasttimo, (void *)0, 1);
timeout(pfslowtimo, (void *)0, 1);
}
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 1efa8c531b3c8..05d312f65302b 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
- * $Id: uipc_socket.c,v 1.50 1999/01/20 17:31:54 fenner Exp $
+ * $Id: uipc_socket.c,v 1.44 1998/08/31 15:34:55 wollman Exp $
*/
#include <sys/param.h>
@@ -218,7 +218,6 @@ soclose(so)
int s = splnet(); /* conservative */
int error = 0;
- funsetown(so->so_sigio);
if (so->so_options & SO_ACCEPTCONN) {
struct socket *sp, *sonext;
@@ -529,9 +528,7 @@ nopages:
((flags & MSG_EOF) &&
(so->so_proto->pr_flags & PR_IMPLOPCL) &&
(resid <= 0)) ?
- PRUS_EOF :
- /* If there is more to send set PRUS_MORETOCOME */
- (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0,
+ PRUS_EOF : 0,
top, addr, control, p);
splx(s);
if (dontroute)
@@ -639,7 +636,10 @@ restart:
(so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0)) {
- KASSERT(m != 0 || !so->so_rcv.sb_cc, ("receive 1"));
+#ifdef DIAGNOSTIC
+ if (m == 0 && so->so_rcv.sb_cc)
+ panic("receive 1");
+#endif
if (so->so_error) {
if (m)
goto dontblock;
@@ -682,7 +682,10 @@ dontblock:
uio->uio_procp->p_stats->p_ru.ru_msgrcv++;
nextrecord = m->m_nextpkt;
if (pr->pr_flags & PR_ADDR) {
- KASSERT(m->m_type == MT_SONAME, ("receive 1a"));
+#ifdef DIAGNOSTIC
+ if (m->m_type != MT_SONAME)
+ panic("receive 1a");
+#endif
orig_resid = 0;
if (psa)
*psa = dup_sockaddr(mtod(m, struct sockaddr *),
@@ -736,9 +739,10 @@ dontblock:
break;
} else if (type == MT_OOBDATA)
break;
- else
- KASSERT(m->m_type == MT_DATA || m->m_type == MT_HEADER,
- ("receive 3"));
+#ifdef DIAGNOSTIC
+ else if (m->m_type != MT_DATA && m->m_type != MT_HEADER)
+ panic("receive 3");
+#endif
so->so_state &= ~SS_RCVATMARK;
len = uio->uio_resid;
if (so->so_oobmark && len > so->so_oobmark - offset)
@@ -1176,8 +1180,12 @@ void
sohasoutofband(so)
register struct socket *so;
{
- if (so->so_sigio != NULL)
- pgsigio(so->so_sigio, SIGURG, 0);
+ struct proc *p;
+
+ if (so->so_pgid < 0)
+ gsignal(-so->so_pgid, SIGURG);
+ else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
+ psignal(p, SIGURG);
selwakeup(&so->so_rcv.sb_sel);
}
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index e718c62bd5cb8..a7405d97a191b 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id: uipc_socket2.c,v 1.42 1998/11/23 00:45:38 truckman Exp $
+ * $Id: uipc_socket2.c,v 1.38 1998/09/04 13:13:18 ache Exp $
*/
#include <sys/param.h>
@@ -213,6 +213,7 @@ sonewconn(head, connstatus)
so->so_state = head->so_state | SS_NOFDREF;
so->so_proto = head->so_proto;
so->so_timeo = head->so_timeo;
+ so->so_pgid = head->so_pgid;
so->so_uid = head->so_uid;
(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
@@ -312,14 +313,20 @@ sowakeup(so, sb)
register struct socket *so;
register struct sockbuf *sb;
{
+ struct proc *p;
+
selwakeup(&sb->sb_sel);
sb->sb_flags &= ~SB_SEL;
if (sb->sb_flags & SB_WAIT) {
sb->sb_flags &= ~SB_WAIT;
wakeup((caddr_t)&sb->sb_cc);
}
- if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL)
- pgsigio(so->so_sigio, SIGIO, 0);
+ if (so->so_state & SS_ASYNC) {
+ if (so->so_pgid < 0)
+ gsignal(-so->so_pgid, SIGIO);
+ else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
+ psignal(p, SIGIO);
+ }
if (sb->sb_flags & SB_UPCALL)
(*so->so_upcall)(so, so->so_upcallarg, M_DONTWAIT);
}
@@ -470,20 +477,18 @@ sbcheck(sb)
register struct sockbuf *sb;
{
register struct mbuf *m;
- register struct mbuf *n = 0;
- register u_long len = 0, mbcnt = 0;
+ register int len = 0, mbcnt = 0;
- for (m = sb->sb_mb; m; m = n) {
- n = m->m_nextpkt;
- for (; m; m = m->m_next) {
+ for (m = sb->sb_mb; m; m = m->m_next) {
len += m->m_len;
mbcnt += MSIZE;
if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */
mbcnt += m->m_ext.ext_size;
- }
+ if (m->m_nextpkt)
+ panic("sbcheck nextpkt");
}
if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) {
- printf("cc %ld != %ld || mbcnt %ld != %ld\n", len, sb->sb_cc,
+ printf("cc %d != %d || mbcnt %d != %d\n", len, sb->sb_cc,
mbcnt, sb->sb_mbcnt);
panic("sbcheck");
}
@@ -715,10 +720,10 @@ sbflush(sb)
if (sb->sb_flags & SB_LOCK)
panic("sbflush: locked");
- while (sb->sb_mbcnt && sb->sb_cc)
+ while (sb->sb_mbcnt)
sbdrop(sb, (int)sb->sb_cc);
- if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt)
- panic("sbflush: cc %ld || mb %p || mbcnt %ld", sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt);
+ if (sb->sb_cc || sb->sb_mb)
+ panic("sbflush: cc %ld || mb %p", sb->sb_cc, (void *)sb->sb_mb);
}
/*
@@ -911,7 +916,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
xso->so_qlimit = so->so_qlimit;
xso->so_timeo = so->so_timeo;
xso->so_error = so->so_error;
- xso->so_pgid = so->so_sigio ? so->so_sigio->sio_pgid : 0;
+ xso->so_pgid = so->so_pgid;
xso->so_oobmark = so->so_oobmark;
sbtoxsockbuf(&so->so_snd, &xso->so_snd);
sbtoxsockbuf(&so->so_rcv, &xso->so_rcv);
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 6cc487ad8cdf1..a841bfad18c79 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -2,9 +2,6 @@
* Copyright (c) 1982, 1986, 1989, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
- * sendfile(2) and related extensions:
- * Copyright (c) 1998, David Greenman. All rights reserved.
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94
- * $Id: uipc_syscalls.c,v 1.48 1998/12/03 12:35:47 dg Exp $
+ * $Id: uipc_syscalls.c,v 1.40 1998/06/10 10:30:23 dfr Exp $
*/
#include "opt_compat.h"
@@ -42,7 +39,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/sysproto.h>
#include <sys/malloc.h>
#include <sys/filedesc.h>
@@ -55,27 +51,9 @@
#include <sys/socketvar.h>
#include <sys/signalvar.h>
#include <sys/uio.h>
-#include <sys/vnode.h>
-#include <sys/lock.h>
-#include <sys/mount.h>
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
-#include <vm/vm.h>
-#include <vm/vm_prot.h>
-#include <vm/vm_object.h>
-#include <vm/vm_page.h>
-#include <vm/vm_pager.h>
-#include <vm/vm_pageout.h>
-#include <vm/vm_kern.h>
-#include <vm/vm_extern.h>
-#include <machine/limits.h>
-
-static void sf_buf_init(void *arg);
-SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL)
-static struct sf_buf *sf_buf_alloc(void);
-static void sf_buf_ref(caddr_t addr, u_int size);
-static void sf_buf_free(caddr_t addr, u_int size);
static int sendit __P((struct proc *p, int s, struct msghdr *mp, int flags));
static int recvit __P((struct proc *p, int s, struct msghdr *mp,
@@ -87,11 +65,6 @@ static int getsockname1 __P((struct proc *p, struct getsockname_args *uap,
static int getpeername1 __P((struct proc *p, struct getpeername_args *uap,
int compat));
-static SLIST_HEAD(, sf_buf) sf_freelist;
-static vm_offset_t sf_base;
-static struct sf_buf *sf_bufs;
-static int sf_buf_alloc_want;
-
/*
* System call interface to the socket abstraction.
*/
@@ -260,8 +233,6 @@ accept1(p, uap, compat)
so->so_state &= ~SS_COMP;
so->so_head = NULL;
- if (head->so_sigio != NULL)
- fsetown(fgetown(head->so_sigio), &so->so_sigio);
fp->f_type = DTYPE_SOCKET;
fp->f_flag = fflag;
@@ -1303,402 +1274,3 @@ getsock(fdp, fdes, fpp)
*fpp = fp;
return (0);
}
-
-/*
- * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-))
- * XXX - The sf_buf functions are currently private to sendfile(2), so have
- * been made static, but may be useful in the future for doing zero-copy in
- * other parts of the networking code.
- */
-static void
-sf_buf_init(void *arg)
-{
- int i;
-
- SLIST_INIT(&sf_freelist);
- sf_base = kmem_alloc_pageable(kernel_map, nsfbufs * PAGE_SIZE);
- sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, M_NOWAIT);
- bzero(sf_bufs, nsfbufs * sizeof(struct sf_buf));
- for (i = 0; i < nsfbufs; i++) {
- sf_bufs[i].kva = sf_base + i * PAGE_SIZE;
- SLIST_INSERT_HEAD(&sf_freelist, &sf_bufs[i], free_list);
- }
-}
-
-/*
- * Get an sf_buf from the freelist. Will block if none are available.
- */
-static struct sf_buf *
-sf_buf_alloc()
-{
- struct sf_buf *sf;
- int s;
-
- s = splimp();
- while ((sf = SLIST_FIRST(&sf_freelist)) == NULL) {
- sf_buf_alloc_want = 1;
- tsleep(&sf_freelist, PVM, "sfbufa", 0);
- }
- SLIST_REMOVE_HEAD(&sf_freelist, free_list);
- splx(s);
- sf->refcnt = 1;
- return (sf);
-}
-
-#define dtosf(x) (&sf_bufs[((uintptr_t)(x) - (uintptr_t)sf_base) >> PAGE_SHIFT])
-static void
-sf_buf_ref(caddr_t addr, u_int size)
-{
- struct sf_buf *sf;
-
- sf = dtosf(addr);
- if (sf->refcnt == 0)
- panic("sf_buf_ref: referencing a free sf_buf");
- sf->refcnt++;
-}
-
-/*
- * Lose a reference to an sf_buf. When none left, detach mapped page
- * and release resources back to the system.
- *
- * Must be called at splimp.
- */
-static void
-sf_buf_free(caddr_t addr, u_int size)
-{
- struct sf_buf *sf;
- struct vm_page *m;
- int s;
-
- sf = dtosf(addr);
- if (sf->refcnt == 0)
- panic("sf_buf_free: freeing free sf_buf");
- sf->refcnt--;
- if (sf->refcnt == 0) {
- pmap_qremove((vm_offset_t)addr, 1);
- m = sf->m;
- s = splvm();
- vm_page_unwire(m, 0);
- /*
- * Check for the object going away on us. This can
- * happen since we don't hold a reference to it.
- * If so, we're responsible for freeing the page.
- */
- if (m->wire_count == 0 && m->object == NULL)
- vm_page_free(m);
- splx(s);
- sf->m = NULL;
- SLIST_INSERT_HEAD(&sf_freelist, sf, free_list);
- if (sf_buf_alloc_want) {
- sf_buf_alloc_want = 0;
- wakeup(&sf_freelist);
- }
- }
-}
-
-/*
- * sendfile(2).
- * int sendfile(int fd, int s, off_t offset, size_t nbytes,
- * struct sf_hdtr *hdtr, off_t *sbytes, int flags)
- *
- * Send a file specified by 'fd' and starting at 'offset' to a socket
- * specified by 's'. Send only 'nbytes' of the file or until EOF if
- * nbytes == 0. Optionally add a header and/or trailer to the socket
- * output. If specified, write the total number of bytes sent into *sbytes.
- */
-int
-sendfile(struct proc *p, struct sendfile_args *uap)
-{
- struct file *fp;
- struct filedesc *fdp = p->p_fd;
- struct vnode *vp;
- struct vm_object *obj;
- struct socket *so;
- struct mbuf *m;
- struct sf_buf *sf;
- struct vm_page *pg;
- struct writev_args nuap;
- struct sf_hdtr hdtr;
- off_t off, xfsize, sbytes = 0;
- int error = 0, s;
-
- /*
- * Do argument checking. Must be a regular file in, stream
- * type and connected socket out, positive offset.
- */
- if (((u_int)uap->fd) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[uap->fd]) == NULL ||
- (fp->f_flag & FREAD) == 0) {
- error = EBADF;
- goto done;
- }
- if (fp->f_type != DTYPE_VNODE) {
- error = EINVAL;
- goto done;
- }
- vp = (struct vnode *)fp->f_data;
- obj = vp->v_object;
- if (vp->v_type != VREG || obj == NULL) {
- error = EINVAL;
- goto done;
- }
- error = getsock(p->p_fd, uap->s, &fp);
- if (error)
- goto done;
- so = (struct socket *)fp->f_data;
- if (so->so_type != SOCK_STREAM) {
- error = EINVAL;
- goto done;
- }
- if ((so->so_state & SS_ISCONNECTED) == 0) {
- error = ENOTCONN;
- goto done;
- }
- if (uap->offset < 0) {
- error = EINVAL;
- goto done;
- }
-
- /*
- * If specified, get the pointer to the sf_hdtr struct for
- * any headers/trailers.
- */
- if (uap->hdtr != NULL) {
- error = copyin(uap->hdtr, &hdtr, sizeof(hdtr));
- if (error)
- goto done;
- /*
- * Send any headers. Wimp out and use writev(2).
- */
- if (hdtr.headers != NULL) {
- nuap.fd = uap->s;
- nuap.iovp = hdtr.headers;
- nuap.iovcnt = hdtr.hdr_cnt;
- error = writev(p, &nuap);
- if (error)
- goto done;
- sbytes += p->p_retval[0];
- }
- }
-
- /*
- * Protect against multiple writers to the socket.
- */
- (void) sblock(&so->so_snd, M_WAITOK);
-
- /*
- * Loop through the pages in the file, starting with the requested
- * offset. Get a file page (do I/O if necessary), map the file page
- * into an sf_buf, attach an mbuf header to the sf_buf, and queue
- * it on the socket.
- */
- for (off = uap->offset; ; off += xfsize, sbytes += xfsize) {
- vm_pindex_t pindex;
- vm_offset_t pgoff;
-
- pindex = OFF_TO_IDX(off);
-retry_lookup:
- /*
- * Calculate the amount to transfer. Not to exceed a page,
- * the EOF, or the passed in nbytes.
- */
- xfsize = obj->un_pager.vnp.vnp_size - off;
- if (xfsize > PAGE_SIZE)
- xfsize = PAGE_SIZE;
- pgoff = (vm_offset_t)(off & PAGE_MASK);
- if (PAGE_SIZE - pgoff < xfsize)
- xfsize = PAGE_SIZE - pgoff;
- if (uap->nbytes && xfsize > (uap->nbytes - sbytes))
- xfsize = uap->nbytes - sbytes;
- if (xfsize <= 0)
- break;
- /*
- * Optimize the non-blocking case by looking at the socket space
- * before going to the extra work of constituting the sf_buf.
- */
- if ((so->so_state & SS_NBIO) && sbspace(&so->so_snd) <= 0) {
- if (so->so_state & SS_CANTSENDMORE)
- error = EPIPE;
- else
- error = EAGAIN;
- sbunlock(&so->so_snd);
- goto done;
- }
- /*
- * Attempt to look up the page. If the page doesn't exist or the
- * part we're interested in isn't valid, then read it from disk.
- * If some other part of the kernel has this page (i.e. it's busy),
- * then disk I/O may be occuring on it, so wait and retry.
- */
- pg = vm_page_lookup(obj, pindex);
- if (pg == NULL || (!(pg->flags & PG_BUSY) && !pg->busy &&
- !vm_page_is_valid(pg, pgoff, xfsize))) {
- struct uio auio;
- struct iovec aiov;
- int bsize;
-
- if (pg == NULL) {
- pg = vm_page_alloc(obj, pindex, VM_ALLOC_NORMAL);
- if (pg == NULL) {
- VM_WAIT;
- goto retry_lookup;
- }
- vm_page_flag_clear(pg, PG_BUSY);
- }
- /*
- * Ensure that our page is still around when the I/O completes.
- */
- vm_page_io_start(pg);
- vm_page_wire(pg);
- /*
- * Get the page from backing store.
- */
- bsize = vp->v_mount->mnt_stat.f_iosize;
- auio.uio_iov = &aiov;
- auio.uio_iovcnt = 1;
- aiov.iov_base = 0;
- aiov.iov_len = MAXBSIZE;
- auio.uio_resid = MAXBSIZE;
- auio.uio_offset = trunc_page(off);
- auio.uio_segflg = UIO_NOCOPY;
- auio.uio_rw = UIO_READ;
- auio.uio_procp = p;
- vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY, p);
- error = VOP_READ(vp, &auio, IO_VMIO | ((MAXBSIZE / bsize) << 16),
- p->p_ucred);
- VOP_UNLOCK(vp, 0, p);
- vm_page_flag_clear(pg, PG_ZERO);
- vm_page_io_finish(pg);
- if (error) {
- vm_page_unwire(pg, 0);
- /*
- * See if anyone else might know about this page.
- * If not and it is not valid, then free it.
- */
- if (pg->wire_count == 0 && pg->valid == 0 &&
- pg->busy == 0 && !(pg->flags & PG_BUSY) &&
- pg->hold_count == 0)
- vm_page_free(pg);
- sbunlock(&so->so_snd);
- goto done;
- }
- } else {
- if ((pg->flags & PG_BUSY) || pg->busy) {
- s = splvm();
- if ((pg->flags & PG_BUSY) || pg->busy) {
- /*
- * Page is busy. Wait and retry.
- */
- vm_page_flag_set(pg, PG_WANTED);
- tsleep(pg, PVM, "sfpbsy", 0);
- splx(s);
- goto retry_lookup;
- }
- splx(s);
- }
- /*
- * Protect from having the page ripped out from beneath us.
- */
- vm_page_wire(pg);
- }
- /*
- * Allocate a kernel virtual page and insert the physical page
- * into it.
- */
- sf = sf_buf_alloc();
- sf->m = pg;
- pmap_qenter(sf->kva, &pg, 1);
- /*
- * Get an mbuf header and set it up as having external storage.
- */
- MGETHDR(m, M_WAIT, MT_DATA);
- m->m_ext.ext_free = sf_buf_free;
- m->m_ext.ext_ref = sf_buf_ref;
- m->m_ext.ext_buf = (void *)sf->kva;
- m->m_ext.ext_size = PAGE_SIZE;
- m->m_data = (char *) sf->kva + pgoff;
- m->m_flags |= M_EXT;
- m->m_pkthdr.len = m->m_len = xfsize;
- /*
- * Add the buffer to the socket buffer chain.
- */
- s = splnet();
-retry_space:
- /*
- * Make sure that the socket is still able to take more data.
- * CANTSENDMORE being true usually means that the connection
- * was closed. so_error is true when an error was sensed after
- * a previous send.
- * The state is checked after the page mapping and buffer
- * allocation above since those operations may block and make
- * any socket checks stale. From this point forward, nothing
- * blocks before the pru_send (or more accurately, any blocking
- * results in a loop back to here to re-check).
- */
- if ((so->so_state & SS_CANTSENDMORE) || so->so_error) {
- if (so->so_state & SS_CANTSENDMORE) {
- error = EPIPE;
- } else {
- error = so->so_error;
- so->so_error = 0;
- }
- m_freem(m);
- sbunlock(&so->so_snd);
- splx(s);
- goto done;
- }
- /*
- * Wait for socket space to become available. We do this just
- * after checking the connection state above in order to avoid
- * a race condition with sbwait().
- */
- if (sbspace(&so->so_snd) < so->so_snd.sb_lowat) {
- if (so->so_state & SS_NBIO) {
- m_freem(m);
- sbunlock(&so->so_snd);
- splx(s);
- error = EAGAIN;
- goto done;
- }
- error = sbwait(&so->so_snd);
- /*
- * An error from sbwait usually indicates that we've
- * been interrupted by a signal. If we've sent anything
- * then return bytes sent, otherwise return the error.
- */
- if (error) {
- m_freem(m);
- sbunlock(&so->so_snd);
- splx(s);
- goto done;
- }
- goto retry_space;
- }
- error = (*so->so_proto->pr_usrreqs->pru_send)(so, 0, m, 0, 0, p);
- splx(s);
- if (error) {
- sbunlock(&so->so_snd);
- goto done;
- }
- }
- sbunlock(&so->so_snd);
-
- /*
- * Send trailers. Wimp out and use writev(2).
- */
- if (uap->hdtr != NULL && hdtr.trailers != NULL) {
- nuap.fd = uap->s;
- nuap.iovp = hdtr.trailers;
- nuap.iovcnt = hdtr.trl_cnt;
- error = writev(p, &nuap);
- if (error)
- goto done;
- sbytes += p->p_retval[0];
- }
-
-done:
- if (uap->sbytes != NULL) {
- copyout(&sbytes, uap->sbytes, sizeof(off_t));
- }
- return (error);
-}
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 93f61649641e1..0799791d33dfd 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94
- * $Id: uipc_usrreq.c,v 1.36 1998/07/15 02:32:12 bde Exp $
+ * $Id: uipc_usrreq.c,v 1.35 1998/05/15 20:11:31 wollman Exp $
*/
#include <sys/param.h>
@@ -709,7 +709,7 @@ unp_abort(unp)
static int
unp_pcblist SYSCTL_HANDLER_ARGS
{
- int error, i, n;
+ int error, i, n, s;
struct unpcb *unp, **unp_list;
unp_gen_t gencnt;
struct xunpgen xug;
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index c7c8aa9a5af05..89e5a580d2615 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -13,7 +13,7 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
- * $Id: vfs_aio.c,v 1.35 1998/11/27 01:14:21 tegge Exp $
+ * $Id: vfs_aio.c,v 1.32 1998/07/15 06:51:14 bde Exp $
*/
/*
@@ -245,7 +245,7 @@ static vm_zone_t kaio_zone=0, aiop_zone=0,
/*
* Single AIOD vmspace shared amongst all of them
*/
-struct vmspace *aiovmspace = NULL;
+static struct vmspace *aiovmspace = NULL;
/*
* Startup initialization
@@ -953,6 +953,7 @@ aio_qphysio(p, aiocbe)
struct aiocblist *aiocbe;
{
int error;
+ caddr_t sa;
struct aiocb *cb;
struct file *fp;
struct buf *bp;
@@ -1387,10 +1388,11 @@ int
aio_return(struct proc *p, struct aio_return_args *uap)
{
int s;
- int jobref;
+ int jobref, status;
struct aiocblist *cb, *ncb;
struct aiocb *ujob;
struct kaioinfo *ki;
+ struct proc *userp;
ki = p->p_aioinfo;
if (ki == NULL) {
@@ -1478,7 +1480,7 @@ aio_suspend(struct proc *p, struct aio_suspend_args *uap)
if (ts.tv_nsec < 0 || ts.tv_nsec >= 1000000000)
return (EINVAL);
- TIMESPEC_TO_TIMEVAL(&atv, &ts);
+ TIMESPEC_TO_TIMEVAL(&atv, &ts)
if (itimerfix(&atv))
return (EINVAL);
timo = tvtohz(&atv);
@@ -1581,6 +1583,7 @@ aio_error(struct proc *p, struct aio_error_args *uap)
struct aiocblist *cb;
struct kaioinfo *ki;
int jobref;
+ int error, status;
ki = p->p_aioinfo;
if (ki == NULL)
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 30018b544f533..0fc7770e03cac 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -11,7 +11,7 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
- * $Id: vfs_bio.c,v 1.192 1999/01/12 11:59:34 eivind Exp $
+ * $Id: vfs_bio.c,v 1.178 1998/09/26 00:12:35 dillon Exp $
*/
/*
@@ -23,8 +23,6 @@
* Author: John S. Dyson
* Significant help during the development and debugging phases
* had been provided by David Greenman, also of the FreeBSD core team.
- *
- * see man buf(9) for more info.
*/
#define VMIO
@@ -70,6 +68,7 @@ SYSINIT_KT(update, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &up_kp)
struct buf *buf; /* buffer header pool */
struct swqueue bswlist;
+static int count_lock_queue __P((void));
static void vm_hold_free_pages(struct buf * bp, vm_offset_t from,
vm_offset_t to);
static void vm_hold_load_pages(struct buf * bp, vm_offset_t from,
@@ -181,7 +180,7 @@ bufinit()
bp->b_rcred = NOCRED;
bp->b_wcred = NOCRED;
bp->b_qindex = QUEUE_EMPTY;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
LIST_INIT(&bp->b_dep);
TAILQ_INSERT_TAIL(&bufqueues[QUEUE_EMPTY], bp, b_freelist);
LIST_INSERT_HEAD(&invalhash, bp, b_hash);
@@ -423,7 +422,7 @@ bwrite(struct buf * bp)
return (0);
}
-void
+__inline void
vfs_bio_need_satisfy(void) {
++numfreebuffers;
if (!needsbuffer)
@@ -445,6 +444,7 @@ vfs_bio_need_satisfy(void) {
void
bdwrite(struct buf * bp)
{
+ int s;
struct vnode *vp;
#if !defined(MAX_PERF)
@@ -499,9 +499,9 @@ bdwrite(struct buf * bp)
* requested by the soft dependency code.
*/
if ((vp = bp->b_vp) &&
- ((vp->v_type == VBLK && vp->v_specmountpoint &&
- (vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP)) ||
- (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP))))
+ (vp->v_type == VBLK && vp->v_specmountpoint &&
+ (vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP)) ||
+ (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP)))
return;
if (numdirtybuffers >= hidirtybuffers)
@@ -519,6 +519,7 @@ void
bdirty(bp)
struct buf *bp;
{
+ int s;
bp->b_flags &= ~(B_READ|B_RELBUF); /* XXX ??? check this */
if ((bp->b_flags & B_DELWRI) == 0) {
@@ -612,13 +613,11 @@ brelse(struct buf * bp)
* but the VM object is kept around. The B_NOCACHE flag is used to
* invalidate the pages in the VM object.
*
- * The b_{validoff,validend,dirtyoff,dirtyend} values are relative
- * to b_offset and currently have byte granularity, whereas the
- * valid flags in the vm_pages have only DEV_BSIZE resolution.
- * The byte resolution fields are used to avoid unnecessary re-reads
- * of the buffer but the code really needs to be genericized so
- * other filesystem modules can take advantage of these fields.
- *
+ * If the buffer is a partially filled NFS buffer, keep it
+ * since invalidating it now will lose informatio. The valid
+ * flags in the vm_pages have only DEV_BSIZE resolution but
+ * the b_validoff, b_validend fields have byte resolution.
+ * This can avoid unnecessary re-reads of the buffer.
* XXX this seems to cause performance problems.
*/
if ((bp->b_flags & B_VMIO)
@@ -644,22 +643,6 @@ brelse(struct buf * bp)
vp = bp->b_vp;
- /*
- * Get the base offset and length of the buffer. Note that
- * for block sizes that are less then PAGE_SIZE, the b_data
- * base of the buffer does not represent exactly b_offset and
- * neither b_offset nor b_size are necessarily page aligned.
- * Instead, the starting position of b_offset is:
- *
- * b_data + (b_offset & PAGE_MASK)
- *
- * block sizes less then DEV_BSIZE (usually 512) are not
- * supported due to the page granularity bits (m->valid,
- * m->dirty, etc...).
- *
- * See man buf(9) for more information
- */
-
resid = bp->b_bufsize;
foff = bp->b_offset;
@@ -692,12 +675,9 @@ brelse(struct buf * bp)
int poffset = foff & PAGE_MASK;
int presid = resid > (PAGE_SIZE - poffset) ?
(PAGE_SIZE - poffset) : resid;
-
- KASSERT(presid >= 0, ("brelse: extra page"));
vm_page_set_invalid(m, poffset, presid);
}
- resid -= PAGE_SIZE - (foff & PAGE_MASK);
- foff = (foff + PAGE_SIZE) & ~PAGE_MASK;
+ resid -= PAGE_SIZE;
}
if (bp->b_flags & (B_INVAL | B_RELBUF))
@@ -811,18 +791,14 @@ static void
vfs_vmio_release(bp)
struct buf *bp;
{
- int i, s;
+ int i;
vm_page_t m;
- s = splvm();
for (i = 0; i < bp->b_npages; i++) {
m = bp->b_pages[i];
bp->b_pages[i] = NULL;
- /*
- * In order to keep page LRU ordering consistent, put
- * everything on the inactive queue.
- */
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
+
/*
* We don't mess with busy pages, it is
* the responsibility of the process that
@@ -832,19 +808,49 @@ vfs_vmio_release(bp)
continue;
if (m->wire_count == 0) {
- vm_page_flag_clear(m, PG_ZERO);
+
+ /*
+ * If this is an async free -- we cannot place
+ * pages onto the cache queue. If it is an
+ * async free, then we don't modify any queues.
+ * This is probably in error (for perf reasons),
+ * and we will eventually need to build
+ * a more complete infrastructure to support I/O
+ * rundown.
+ */
+ if ((bp->b_flags & B_ASYNC) == 0) {
+
/*
- * Might as well free the page if we can and it has
- * no valid data.
+ * In the case of sync buffer frees, we can do pretty much
+ * anything to any of the memory queues. Specifically,
+ * the cache queue is okay to be modified.
*/
- if ((bp->b_flags & B_ASYNC) == 0 && !m->valid && m->hold_count == 0) {
- vm_page_busy(m);
- vm_page_protect(m, VM_PROT_NONE);
- vm_page_free(m);
+ if (m->valid) {
+ if(m->dirty == 0)
+ vm_page_test_dirty(m);
+ /*
+ * this keeps pressure off of the process memory
+ */
+ if (m->dirty == 0 && m->hold_count == 0)
+ vm_page_cache(m);
+ else
+ vm_page_deactivate(m);
+ vm_page_flag_clear(m, PG_ZERO);
+ } else if (m->hold_count == 0) {
+ vm_page_busy(m);
+ vm_page_protect(m, VM_PROT_NONE);
+ vm_page_free(m);
+ }
+ } else {
+ /*
+ * If async, then at least we clear the
+ * act_count.
+ */
+ m->act_count = 0;
+ vm_page_flag_clear(m, PG_ZERO);
}
}
}
- splx(s);
bufspace -= bp->b_bufsize;
vmiospace -= bp->b_bufsize;
pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages);
@@ -999,8 +1005,13 @@ trytofreespace:
while (needsbuffer & VFS_BIO_NEED_ANY);
return (0);
}
- KASSERT(!(bp->b_flags & B_BUSY),
- ("getnewbuf: busy buffer on free list\n"));
+
+#if defined(DIAGNOSTIC)
+ if (bp->b_flags & B_BUSY) {
+ panic("getnewbuf: busy buffer on free list\n");
+ }
+#endif
+
/*
* We are fairly aggressive about freeing VMIO buffers, but since
* the buffering is intact without buffer headers, there is not
@@ -1291,7 +1302,7 @@ int
inmem(struct vnode * vp, daddr_t blkno)
{
vm_object_t obj;
- vm_offset_t toff, tinc, size;
+ vm_offset_t toff, tinc;
vm_page_t m;
vm_ooffset_t off;
@@ -1303,18 +1314,16 @@ inmem(struct vnode * vp, daddr_t blkno)
return 0;
obj = vp->v_object;
- size = PAGE_SIZE;
- if (size > vp->v_mount->mnt_stat.f_iosize)
- size = vp->v_mount->mnt_stat.f_iosize;
- off = (vm_ooffset_t)blkno * (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize;
+ tinc = PAGE_SIZE;
+ if (tinc > vp->v_mount->mnt_stat.f_iosize)
+ tinc = vp->v_mount->mnt_stat.f_iosize;
+ off = blkno * vp->v_mount->mnt_stat.f_iosize;
for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) {
+
m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
if (!m)
return 0;
- tinc = size;
- if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK))
- tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK);
if (vm_page_is_valid(m,
(vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
return 0;
@@ -1335,11 +1344,7 @@ static void
vfs_setdirty(struct buf *bp) {
int i;
vm_object_t object;
- vm_offset_t boffset;
-#if 0
- vm_offset_t offset;
-#endif
-
+ vm_offset_t boffset, offset;
/*
* We qualify the scan for modified pages on whether the
* object has been flushed yet. The OBJ_WRITEABLE flag
@@ -1364,9 +1369,9 @@ vfs_setdirty(struct buf *bp) {
break;
}
}
- boffset = (i << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK);
+ boffset = (i << PAGE_SHIFT);
if (boffset < bp->b_dirtyoff) {
- bp->b_dirtyoff = max(boffset, 0);
+ bp->b_dirtyoff = boffset;
}
/*
@@ -1378,14 +1383,11 @@ vfs_setdirty(struct buf *bp) {
}
}
boffset = (i + 1);
-#if 0
offset = boffset + bp->b_pages[0]->pindex;
if (offset >= object->size)
boffset = object->size - bp->b_pages[0]->pindex;
-#endif
- boffset = (boffset << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK);
- if (bp->b_dirtyend < boffset)
- bp->b_dirtyend = min(boffset, bp->b_bufsize);
+ if (bp->b_dirtyend < (boffset << PAGE_SHIFT))
+ bp->b_dirtyend = (boffset << PAGE_SHIFT);
}
}
@@ -1398,6 +1400,20 @@ getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo)
struct buf *bp;
int i, s;
struct bufhashhdr *bh;
+ int maxsize;
+ int generation;
+ int checksize;
+
+ if (vp->v_mount) {
+ maxsize = vp->v_mount->mnt_stat.f_iosize;
+ /*
+ * This happens on mount points.
+ */
+ if (maxsize < size)
+ maxsize = size;
+ } else {
+ maxsize = size;
+ }
#if !defined(MAX_PERF)
if (size > MAXBSIZE)
@@ -1411,6 +1427,7 @@ loop:
}
if ((bp = gbincore(vp, blkno))) {
+loop1:
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -1455,8 +1472,12 @@ loop:
goto loop;
}
}
- KASSERT(bp->b_offset != NOOFFSET,
- ("getblk: no buffer offset"));
+
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("getblk: no buffer offset");
+#endif
+
/*
* Check that the constituted buffer really deserves for the
* B_CACHE bit to be set. B_VMIO type buffers might not
@@ -1464,10 +1485,11 @@ loop:
* should be fully valid.
*/
if (bp->b_flags & B_VMIO) {
- int checksize = bp->b_bufsize;
- int poffset = bp->b_offset & PAGE_MASK;
- int resid;
+ checksize = bp->b_bufsize;
for (i = 0; i < bp->b_npages; i++) {
+ int resid;
+ int poffset;
+ poffset = bp->b_offset & PAGE_MASK;
resid = (checksize > (PAGE_SIZE - poffset)) ?
(PAGE_SIZE - poffset) : checksize;
if (!vm_page_is_valid(bp->b_pages[i], poffset, resid)) {
@@ -1475,7 +1497,6 @@ loop:
break;
}
checksize -= resid;
- poffset = 0;
}
}
@@ -1484,22 +1505,7 @@ loop:
splx(s);
return (bp);
} else {
- int bsize, maxsize, vmio;
- off_t offset;
-
- if (vp->v_type == VBLK)
- bsize = DEV_BSIZE;
- else if (vp->v_mountedhere)
- bsize = vp->v_mountedhere->mnt_stat.f_iosize;
- else if (vp->v_mount)
- bsize = vp->v_mount->mnt_stat.f_iosize;
- else
- bsize = size;
-
- offset = (off_t)blkno * bsize;
- vmio = (vp->v_object != 0) && (vp->v_flag & VOBJBUF);
- maxsize = vmio ? size + (offset & PAGE_MASK) : size;
- maxsize = imax(maxsize, bsize);
+ vm_object_t obj;
if ((bp = getnewbuf(vp, blkno,
slpflag, slptimeo, size, maxsize)) == 0) {
@@ -1527,14 +1533,18 @@ loop:
* be found by incore.
*/
bp->b_blkno = bp->b_lblkno = blkno;
- bp->b_offset = offset;
+
+ if (vp->v_type != VBLK)
+ bp->b_offset = (off_t) blkno * maxsize;
+ else
+ bp->b_offset = (off_t) blkno * DEV_BSIZE;
bgetvp(vp, bp);
LIST_REMOVE(bp, b_hash);
bh = BUFHASH(vp, blkno);
LIST_INSERT_HEAD(bh, bp, b_hash);
- if (vmio) {
+ if ((obj = vp->v_object) && (vp->v_flag & VOBJBUF)) {
bp->b_flags |= (B_VMIO | B_CACHE);
#if defined(VFS_BIO_DEBUG)
if (vp->v_type != VREG && vp->v_type != VBLK)
@@ -1687,8 +1697,7 @@ allocbuf(struct buf * bp, int size)
int desiredpages;
newbsize = (size + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
- desiredpages = (size == 0) ? 0 :
- num_pages((bp->b_offset & PAGE_MASK) + newbsize);
+ desiredpages = (round_page(newbsize) >> PAGE_SHIFT);
#if !defined(NO_B_MALLOC)
if (bp->b_flags & B_MALLOC)
@@ -1703,12 +1712,14 @@ allocbuf(struct buf * bp, int size)
* is the responsibility of vnode_pager_setsize
*/
m = bp->b_pages[i];
- KASSERT(m != bogus_page,
- ("allocbuf: bogus page found"));
+#if defined(DIAGNOSTIC)
+ if (m == bogus_page)
+ panic("allocbuf: bogus page found");
+#endif
vm_page_sleep(m, "biodep", &m->busy);
bp->b_pages[i] = NULL;
- vm_page_unwire(m, 0);
+ vm_page_unwire(m);
}
pmap_qremove((vm_offset_t) trunc_page((vm_offset_t)bp->b_data) +
(desiredpages << PAGE_SHIFT), (bp->b_npages - desiredpages));
@@ -1735,30 +1746,37 @@ allocbuf(struct buf * bp, int size)
if (bp->b_npages < desiredpages) {
obj = vp->v_object;
tinc = PAGE_SIZE;
+ if (tinc > bsize)
+ tinc = bsize;
off = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("allocbuf: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("allocbuf: no buffer offset");
+#endif
+
curbpnpages = bp->b_npages;
doretry:
bp->b_validoff = orig_validoff;
bp->b_validend = orig_validend;
bp->b_flags |= B_CACHE;
for (toff = 0; toff < newbsize; toff += tinc) {
+ int bytesinpage;
+
+ pageindex = toff >> PAGE_SHIFT;
objoff = OFF_TO_IDX(off + toff);
- pageindex = objoff - OFF_TO_IDX(off);
- tinc = PAGE_SIZE - ((off + toff) & PAGE_MASK);
if (pageindex < curbpnpages) {
m = bp->b_pages[pageindex];
#ifdef VFS_BIO_DIAG
if (m->pindex != objoff)
- panic("allocbuf: page changed offset?!!!?");
+ panic("allocbuf: page changed offset??!!!?");
#endif
+ bytesinpage = tinc;
if (tinc > (newbsize - toff))
- tinc = newbsize - toff;
+ bytesinpage = newbsize - toff;
if (bp->b_flags & B_CACHE)
- vfs_buf_set_valid(bp, off, toff, tinc, m);
+ vfs_buf_set_valid(bp, off, toff, bytesinpage, m);
continue;
}
m = vm_page_lookup(obj, objoff);
@@ -1766,7 +1784,7 @@ allocbuf(struct buf * bp, int size)
m = vm_page_alloc(obj, objoff, VM_ALLOC_NORMAL);
if (!m) {
VM_WAIT;
- vm_pageout_deficit += (desiredpages - curbpnpages);
+ vm_pageout_deficit += (desiredpages - bp->b_npages);
goto doretry;
}
@@ -1789,10 +1807,11 @@ allocbuf(struct buf * bp, int size)
(cnt.v_free_min + cnt.v_cache_min))) {
pagedaemon_wakeup();
}
+ bytesinpage = tinc;
if (tinc > (newbsize - toff))
- tinc = newbsize - toff;
+ bytesinpage = newbsize - toff;
if (bp->b_flags & B_CACHE)
- vfs_buf_set_valid(bp, off, toff, tinc, m);
+ vfs_buf_set_valid(bp, off, toff, bytesinpage, m);
vm_page_flag_clear(m, PG_ZERO);
vm_page_wire(m);
}
@@ -1925,8 +1944,10 @@ biodone(register struct buf * bp)
#endif
foff = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("biodone: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("biodone: no buffer offset");
+#endif
#if !defined(MAX_PERF)
if (!obj) {
@@ -1958,9 +1979,7 @@ biodone(register struct buf * bp)
}
#if defined(VFS_BIO_DEBUG)
if (OFF_TO_IDX(foff) != m->pindex) {
- printf(
-"biodone: foff(%lu)/m->pindex(%d) mismatch\n",
- (unsigned long)foff, m->pindex);
+ printf("biodone: foff(%d)/m->pindex(%d) mismatch\n", foff, m->pindex);
}
#endif
resid = IDX_TO_OFF(m->pindex + 1) - foff;
@@ -2035,6 +2054,20 @@ biodone(register struct buf * bp)
splx(s);
}
+static int
+count_lock_queue()
+{
+ int count;
+ struct buf *bp;
+
+ count = 0;
+ for (bp = TAILQ_FIRST(&bufqueues[QUEUE_LOCKED]);
+ bp != NULL;
+ bp = TAILQ_NEXT(bp, b_freelist))
+ count++;
+ return (count);
+}
+
#if 0 /* not with kirks code */
static int vfs_update_interval = 30;
@@ -2073,7 +2106,7 @@ SYSCTL_PROC(_kern, KERN_UPDATEINTERVAL, update, CTLTYPE_INT|CTLFLAG_RW,
void
vfs_unbusy_pages(struct buf * bp)
{
- int i;
+ int i, s;
if (bp->b_flags & B_VMIO) {
struct vnode *vp = bp->b_vp;
@@ -2117,7 +2150,7 @@ vfs_buf_set_valid(struct buf *bp,
{
if (bp->b_vp->v_tag == VT_NFS && bp->b_vp->v_type != VBLK) {
vm_offset_t svalid, evalid;
- int validbits = m->valid >> (((foff+off)&PAGE_MASK)/DEV_BSIZE);
+ int validbits = m->valid;
/*
* This only bothers with the first valid range in the
@@ -2133,7 +2166,6 @@ vfs_buf_set_valid(struct buf *bp,
evalid += DEV_BSIZE;
validbits >>= 1;
}
- evalid = min(evalid, off + size);
/*
* Make sure this range is contiguous with the range
* built up from previous pages. If not, then we will
@@ -2162,17 +2194,15 @@ vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, int pageno, vm_page_t m)
vm_ooffset_t soff, eoff;
soff = off;
- eoff = (off + PAGE_SIZE) & ~PAGE_MASK;
- if (eoff > bp->b_offset + bp->b_bufsize)
- eoff = bp->b_offset + bp->b_bufsize;
+ eoff = off + min(PAGE_SIZE, bp->b_bufsize);
if (vp->v_tag == VT_NFS && vp->v_type != VBLK) {
vm_ooffset_t sv, ev;
vm_page_set_invalid(m,
(vm_offset_t) (soff & PAGE_MASK),
(vm_offset_t) (eoff - soff));
- sv = (bp->b_offset + bp->b_validoff + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
- ev = (bp->b_offset + bp->b_validend + (DEV_BSIZE - 1)) &
- ~(DEV_BSIZE - 1);
+ off = off - pageno * PAGE_SIZE;
+ sv = off + ((bp->b_validoff + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1));
+ ev = off + ((bp->b_validend + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1));
soff = qmax(sv, soff);
eoff = qmin(ev, eoff);
}
@@ -2193,7 +2223,7 @@ vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, int pageno, vm_page_t m)
void
vfs_busy_pages(struct buf * bp, int clear_modify)
{
- int i, bogus;
+ int i, s;
if (bp->b_flags & B_VMIO) {
struct vnode *vp = bp->b_vp;
@@ -2201,8 +2231,11 @@ vfs_busy_pages(struct buf * bp, int clear_modify)
vm_ooffset_t foff;
foff = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("vfs_busy_pages: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("vfs_busy_pages: no buffer offset");
+#endif
+
vfs_setdirty(bp);
retry:
@@ -2212,8 +2245,7 @@ retry:
goto retry;
}
- bogus = 0;
- for (i = 0; i < bp->b_npages; i++) {
+ for (i = 0; i < bp->b_npages; i++, foff += PAGE_SIZE) {
vm_page_t m = bp->b_pages[i];
vm_page_flag_clear(m, PG_ZERO);
@@ -2225,15 +2257,13 @@ retry:
vm_page_protect(m, VM_PROT_NONE);
if (clear_modify)
vfs_page_set_valid(bp, foff, i, m);
- else if (m->valid == VM_PAGE_BITS_ALL &&
- (bp->b_flags & B_CACHE) == 0) {
- bp->b_pages[i] = bogus_page;
- bogus++;
+ else if (bp->b_bcount >= PAGE_SIZE) {
+ if (m->valid && (bp->b_flags & B_CACHE) == 0) {
+ bp->b_pages[i] = bogus_page;
+ pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages);
+ }
}
- foff = (foff + PAGE_SIZE) & ~PAGE_MASK;
}
- if (bogus)
- pmap_qenter(trunc_page((vm_offset_t)bp->b_data), bp->b_pages, bp->b_npages);
}
}
@@ -2248,55 +2278,55 @@ vfs_clean_pages(struct buf * bp)
int i;
if (bp->b_flags & B_VMIO) {
+ struct vnode *vp = bp->b_vp;
vm_ooffset_t foff;
foff = bp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET,
- ("vfs_clean_pages: no buffer offset"));
- for (i = 0; i < bp->b_npages; i++) {
+
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("vfs_clean_pages: no buffer offset");
+#endif
+
+ for (i = 0; i < bp->b_npages; i++, foff += PAGE_SIZE) {
vm_page_t m = bp->b_pages[i];
vfs_page_set_valid(bp, foff, i, m);
- foff = (foff + PAGE_SIZE) & ~PAGE_MASK;
}
}
}
void
vfs_bio_clrbuf(struct buf *bp) {
- int i, mask = 0;
- caddr_t sa, ea;
+ int i;
if ((bp->b_flags & (B_VMIO | B_MALLOC)) == B_VMIO) {
- if( (bp->b_npages == 1) && (bp->b_bufsize < PAGE_SIZE) &&
- (bp->b_offset & PAGE_MASK) == 0) {
- mask = (1 << (bp->b_bufsize / DEV_BSIZE)) - 1;
- if (((bp->b_pages[0]->flags & PG_ZERO) == 0) &&
- ((bp->b_pages[0]->valid & mask) != mask)) {
+ if( (bp->b_npages == 1) && (bp->b_bufsize < PAGE_SIZE)) {
+ int mask;
+ mask = 0;
+ for(i=0;i<bp->b_bufsize;i+=DEV_BSIZE)
+ mask |= (1 << (i/DEV_BSIZE));
+ if(((bp->b_pages[0]->flags & PG_ZERO) == 0) &&
+ (bp->b_pages[0]->valid != mask)) {
bzero(bp->b_data, bp->b_bufsize);
}
- bp->b_pages[0]->valid |= mask;
+ bp->b_pages[0]->valid = mask;
bp->b_resid = 0;
return;
}
- ea = sa = bp->b_data;
- for(i=0;i<bp->b_npages;i++,sa=ea) {
- int j = ((u_long)sa & PAGE_MASK) / DEV_BSIZE;
- ea = (caddr_t)trunc_page((vm_offset_t)sa + PAGE_SIZE);
- ea = (caddr_t)ulmin((u_long)ea,
- (u_long)bp->b_data + bp->b_bufsize);
- mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j;
- if ((bp->b_pages[i]->valid & mask) == mask)
+ for(i=0;i<bp->b_npages;i++) {
+ if( bp->b_pages[i]->valid == VM_PAGE_BITS_ALL)
continue;
- if ((bp->b_pages[i]->valid & mask) == 0) {
+ if( bp->b_pages[i]->valid == 0) {
if ((bp->b_pages[i]->flags & PG_ZERO) == 0) {
- bzero(sa, ea - sa);
+ bzero(bp->b_data + (i << PAGE_SHIFT), PAGE_SIZE);
}
} else {
- for (; sa < ea; sa += DEV_BSIZE, j++) {
+ int j;
+ for(j=0;j<PAGE_SIZE/DEV_BSIZE;j++) {
if (((bp->b_pages[i]->flags & PG_ZERO) == 0) &&
(bp->b_pages[i]->valid & (1<<j)) == 0)
- bzero(sa, DEV_BSIZE);
+ bzero(bp->b_data + (i << PAGE_SHIFT) + j * DEV_BSIZE, DEV_BSIZE);
}
}
- bp->b_pages[i]->valid |= mask;
+ bp->b_pages[i]->valid = VM_PAGE_BITS_ALL;
vm_page_flag_clear(bp->b_pages[i], PG_ZERO);
}
bp->b_resid = 0;
@@ -2366,7 +2396,7 @@ vm_hold_free_pages(struct buf * bp, vm_offset_t from, vm_offset_t to)
bp->b_pages[index] = NULL;
pmap_kremove(pg);
vm_page_busy(p);
- vm_page_unwire(p, 0);
+ vm_page_unwire(p);
vm_page_free(p);
}
}
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index ce842ad204cf0..fb88938bbd63f 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -33,18 +33,16 @@
* SUCH DAMAGE.
*
* @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
- * $Id: vfs_cluster.c,v 1.76 1999/01/08 17:31:15 eivind Exp $
+ * $Id: vfs_cluster.c,v 1.69 1998/08/24 08:39:39 dfr Exp $
*/
#include "opt_debug_cluster.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/buf.h>
#include <sys/vnode.h>
-#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/resourcevar.h>
#include <vm/vm.h>
@@ -54,14 +52,15 @@
#if defined(CLUSTERDEBUG)
#include <sys/sysctl.h>
+#include <sys/kernel.h>
static int rcluster= 0;
SYSCTL_INT(_debug, OID_AUTO, rcluster, CTLFLAG_RW, &rcluster, 0, "");
#endif
-static MALLOC_DEFINE(M_SEGMENT, "cluster_save buffer", "cluster_save buffer");
-
+#ifdef notyet_block_reallocation_enabled
static struct cluster_save *
cluster_collectbufs __P((struct vnode *vp, struct buf *last_bp));
+#endif
static struct buf *
cluster_rbuild __P((struct vnode *vp, u_quad_t filesize, daddr_t lbn,
daddr_t blkno, long size, int run, struct buf *fbp));
@@ -166,10 +165,12 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
}
reqbp = bp = NULL;
} else {
- off_t firstread = bp->b_offset;
-
- KASSERT(bp->b_offset != NOOFFSET,
- ("cluster_read: no buffer offset"));
+ off_t firstread;
+ firstread = bp->b_offset;
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("cluster_read: no buffer offset");
+#endif
if (firstread + totread > filesize)
totread = filesize - firstread;
if (totread > size) {
@@ -308,12 +309,13 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
{
struct buf *bp, *tbp;
daddr_t bn;
- int i, inc, j;
-
- KASSERT(size == vp->v_mount->mnt_stat.f_iosize,
- ("cluster_rbuild: size %ld != filesize %ld\n",
- size, vp->v_mount->mnt_stat.f_iosize));
+ int i, inc, j, s;
+#ifdef DIAGNOSTIC
+ if (size != vp->v_mount->mnt_stat.f_iosize)
+ panic("cluster_rbuild: size %ld != filesize %ld\n",
+ size, vp->v_mount->mnt_stat.f_iosize);
+#endif
/*
* avoid a division
*/
@@ -347,7 +349,10 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
bp->b_blkno = blkno;
bp->b_lblkno = lbn;
bp->b_offset = tbp->b_offset;
- KASSERT(bp->b_offset != NOOFFSET, ("cluster_rbuild: no buffer offset"));
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("cluster_rbuild: no buffer offset");
+#endif
pbgetvp(vp, bp);
TAILQ_INIT(&bp->b_cluster.cluster_head);
@@ -510,7 +515,11 @@ cluster_write(bp, filesize)
lblocksize = bp->b_bufsize;
}
lbn = bp->b_lblkno;
- KASSERT(bp->b_offset != NOOFFSET, ("cluster_write: no buffer offset"));
+
+#ifdef DIAGNOSTIC
+ if (bp->b_offset == NOOFFSET)
+ panic("cluster_write: no buffer offset");
+#endif
/* Initialize vnode to beginning of file. */
if (lbn == 0)
@@ -530,7 +539,16 @@ cluster_write(bp, filesize)
* reallocating to make it sequential.
*/
cursize = vp->v_lastw - vp->v_cstart + 1;
+#ifndef notyet_block_reallocation_enabled
if (((u_quad_t) bp->b_offset + lblocksize) != filesize ||
+ lbn != vp->v_lastw + 1 ||
+ vp->v_clen <= cursize) {
+ if (!async)
+ cluster_wbuild(vp, lblocksize,
+ vp->v_cstart, cursize);
+ }
+#else
+ if ((lbn + 1) * lblocksize != filesize ||
lbn != vp->v_lastw + 1 || vp->v_clen <= cursize) {
if (!async)
cluster_wbuild(vp, lblocksize,
@@ -565,6 +583,7 @@ cluster_write(bp, filesize)
return;
}
}
+#endif /* notyet_block_reallocation_enabled */
}
/*
* Consider beginning a cluster. If at end of file, make
@@ -803,6 +822,7 @@ cluster_wbuild(vp, size, start_lbn, len)
return totalwritten;
}
+#ifdef notyet_block_reallocation_enabled
/*
* Collect together all the buffers in a cluster.
* Plus add one additional buffer.
@@ -813,7 +833,6 @@ cluster_collectbufs(vp, last_bp)
struct buf *last_bp;
{
struct cluster_save *buflist;
- struct buf *bp;
daddr_t lbn;
int i, len;
@@ -822,17 +841,11 @@ cluster_collectbufs(vp, last_bp)
M_SEGMENT, M_WAITOK);
buflist->bs_nchildren = 0;
buflist->bs_children = (struct buf **) (buflist + 1);
- for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) {
- (void) bread(vp, lbn, last_bp->b_bcount, NOCRED, &bp);
- buflist->bs_children[i] = bp;
- if (bp->b_blkno == bp->b_lblkno)
- VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
- NULL, NULL);
- }
- buflist->bs_children[i] = bp = last_bp;
- if (bp->b_blkno == bp->b_lblkno)
- VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
- NULL, NULL);
+ for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++)
+ (void) bread(vp, lbn, last_bp->b_bcount, NOCRED,
+ &buflist->bs_children[i]);
+ buflist->bs_children[i] = last_bp;
buflist->bs_nchildren = i + 1;
return (buflist);
}
+#endif /* notyet_block_reallocation_enabled */
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index b73b126a82ccf..538cbc06d5572 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -130,13 +130,6 @@ vop_defaultop(struct vop_generic_args *ap)
return (VOCALL(default_vnodeop_p, ap->a_desc->vdesc_offset, ap));
}
-int
-vop_panic(struct vop_generic_args *ap)
-{
-
- panic("illegal vnode op called");
-}
-
static int
vop_nostrategy (struct vop_strategy_args *ap)
{
@@ -205,12 +198,7 @@ vop_stdlock(ap)
return 0;
}
-#ifndef DEBUG_LOCKS
return (lockmgr(l, ap->a_flags, &ap->a_vp->v_interlock, ap->a_p));
-#else
- return (debuglockmgr(l, ap->a_flags, &ap->a_vp->v_interlock, ap->a_p,
- "vop_stdlock", ap->a_vp->filename, ap->a_vp->line));
-#endif
}
int
@@ -360,12 +348,7 @@ vop_sharedlock(ap)
}
if (flags & LK_INTERLOCK)
vnflags |= LK_INTERLOCK;
-#ifndef DEBUG_LOCKS
- return (lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p));
-#else
- return (debuglockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p,
- "vop_sharedlock", vp->filename, vp->line));
-#endif
+ return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p));
}
/*
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c
index 43589c740a7e8..39900c612c64d 100644
--- a/sys/kern/vfs_init.c
+++ b/sys/kern/vfs_init.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_init.c 8.3 (Berkeley) 1/4/94
- * $Id: vfs_init.c,v 1.40 1998/11/15 15:18:30 bde Exp $
+ * $Id: vfs_init.c,v 1.34 1998/10/05 11:10:55 obrien Exp $
*/
@@ -49,10 +49,33 @@
#include <sys/malloc.h>
#include <vm/vm_zone.h>
+static void vfs_op_init __P((void));
+
+static void vfsinit __P((void *));
+SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vfsinit, NULL)
MALLOC_DEFINE(M_VNODE, "vnodes", "Dynamically allocated vnodes");
/*
+ * Sigh, such primitive tools are these...
+ */
+#if 0
+#define DODEBUG(A) A
+#else
+#define DODEBUG(A)
+#endif
+
+static struct vfsconf void_vfsconf;
+
+#ifdef unused
+extern struct linker_set vfs_opv_descs_;
+#define vfs_opv_descs ((struct vnodeopv_desc **)vfs_opv_descs_.ls_items)
+#endif
+
+extern struct vnodeop_desc *vfs_op_descs[];
+ /* and the operations they perform */
+
+/*
* XXX this bloat just exands the sysctl__vfs linker set a little so that
* we can attach sysctls for VFS modules without expanding the linker set.
* Currently (1998/09/06), only one VFS uses sysctls, so 2 extra linker
@@ -83,221 +106,133 @@ struct vm_zone *namei_zone;
* listing those new operations Ficus adds to NFS, all without modifying the
* NFS code. (Of couse, the OTW NFS protocol still needs to be munged, but
* that is a(whole)nother story.) This is a feature.
+ *
+ * Without an explicit reserve area, however, you must replace vnode_if.c
+ * and vnode_if.h when you do this, or you will be derefrencing of the
+ * end of vfs_op_descs[]. This is a flaw in the use of a structure
+ * pointer array rather than an agregate to define vfs_op_descs. So
+ * it's not a very dynamic "feature".
*/
-
-/* Table of known vnodeop vectors (list of VFS vnode vectors) */
-static struct vnodeopv_desc **vnodeopv_descs;
-static int vnodeopv_num;
-
-/* Table of known descs (list of vnode op handlers "vop_access_desc") */
-static struct vnodeop_desc **vfs_op_descs;
-static int *vfs_op_desc_refs; /* reference counts */
-static int num_op_descs;
-static int vfs_opv_numops;
-
-static void
-vfs_opv_recalc(void)
+void
+vfs_opv_init(struct vnodeopv_desc *opv)
{
- int i, j;
+ int j, k;
vop_t ***opv_desc_vector_p;
vop_t **opv_desc_vector;
struct vnodeopv_entry_desc *opve_descp;
- struct vnodeopv_desc *opv;
-
- if (vfs_op_descs == NULL)
- panic("vfs_opv_recalc called with null vfs_op_descs");
/*
- * Run through and make sure all known descs have an offset
- *
- * vop_default_desc is hardwired at offset 1, and offset 0
- * is a panic sanity check.
+ * Allocate the dynamic vectors and fill them in.
*/
- vfs_opv_numops = 0;
- for (i = 0; i < num_op_descs; i++)
- if (vfs_opv_numops < (vfs_op_descs[i]->vdesc_offset + 1))
- vfs_opv_numops = vfs_op_descs[i]->vdesc_offset + 1;
- for (i = 0; i < num_op_descs; i++)
- if (vfs_op_descs[i]->vdesc_offset == 0)
- vfs_op_descs[i]->vdesc_offset = vfs_opv_numops++;
+ opv_desc_vector_p = opv->opv_desc_vector_p;
/*
- * Allocate and fill in the vectors
+ * Allocate and init the vector, if it needs it.
+ * Also handle backwards compatibility.
*/
- for (i = 0; i < vnodeopv_num; i++) {
- opv = vnodeopv_descs[i];
- opv_desc_vector_p = opv->opv_desc_vector_p;
- if (*opv_desc_vector_p)
- FREE(*opv_desc_vector_p, M_VNODE);
+ if (*opv_desc_vector_p == NULL) {
+ /* XXX - shouldn't be M_VNODE */
MALLOC(*opv_desc_vector_p, vop_t **,
- vfs_opv_numops * sizeof(vop_t *), M_VNODE, M_WAITOK);
- if (*opv_desc_vector_p == NULL)
- panic("no memory for vop_t ** vector");
- bzero(*opv_desc_vector_p, vfs_opv_numops * sizeof(vop_t *));
-
- /* Fill in, with slot 0 being panic */
- opv_desc_vector = *opv_desc_vector_p;
- opv_desc_vector[0] = (vop_t *)vop_panic;
- for (j = 0; opv->opv_desc_ops[j].opve_op; j++) {
- opve_descp = &(opv->opv_desc_ops[j]);
- opv_desc_vector[opve_descp->opve_op->vdesc_offset] =
- opve_descp->opve_impl;
- }
-
- /* Replace unfilled routines with their default (slot 1). */
- opv_desc_vector = *(opv->opv_desc_vector_p);
- if (opv_desc_vector[1] == NULL)
- panic("vfs_opv_recalc: vector without a default.");
- for (j = 0; j < vfs_opv_numops; j++)
- if (opv_desc_vector[j] == NULL)
- opv_desc_vector[j] = opv_desc_vector[1];
+ vfs_opv_numops * sizeof(vop_t *), M_VNODE,
+ M_WAITOK);
+ bzero(*opv_desc_vector_p,
+ vfs_opv_numops * sizeof(vop_t *));
+ DODEBUG(printf("vector at %x allocated\n",
+ opv_desc_vector_p));
}
-}
+ opv_desc_vector = *opv_desc_vector_p;
+ for (j = 0; opv->opv_desc_ops[j].opve_op; j++) {
+ opve_descp = &(opv->opv_desc_ops[j]);
-void
-vfs_add_vnodeops(void *data)
-{
- struct vnodeopv_desc *opv;
- struct vnodeopv_desc **newopv;
- struct vnodeop_desc **newop;
- int *newref;
- vop_t **opv_desc_vector;
- struct vnodeop_desc *desc;
- int i, j;
-
- opv = (struct vnodeopv_desc *)data;
- MALLOC(newopv, struct vnodeopv_desc **,
- (vnodeopv_num + 1) * sizeof(*newopv), M_VNODE, M_WAITOK);
- if (newopv == NULL)
- panic("vfs_add_vnodeops: no memory");
- if (vnodeopv_descs) {
- bcopy(vnodeopv_descs, newopv, vnodeopv_num * sizeof(*newopv));
- FREE(vnodeopv_descs, M_VNODE);
+ /*
+ * Sanity check: is this operation listed
+ * in the list of operations? We check this
+ * by seeing if its offest is zero. Since
+ * the default routine should always be listed
+ * first, it should be the only one with a zero
+ * offset. Any other operation with a zero
+ * offset is probably not listed in
+ * vfs_op_descs, and so is probably an error.
+ *
+ * A panic here means the layer programmer
+ * has committed the all-too common bug
+ * of adding a new operation to the layer's
+ * list of vnode operations but
+ * not adding the operation to the system-wide
+ * list of supported operations.
+ */
+ if (opve_descp->opve_op->vdesc_offset == 0 &&
+ opve_descp->opve_op->vdesc_offset !=
+ VOFFSET(vop_default)) {
+ printf("operation %s not listed in %s.\n",
+ opve_descp->opve_op->vdesc_name,
+ "vfs_op_descs");
+ panic ("vfs_opv_init: bad operation");
+ }
+ /*
+ * Fill in this entry.
+ */
+ opv_desc_vector[opve_descp->opve_op->vdesc_offset] =
+ opve_descp->opve_impl;
}
- newopv[vnodeopv_num] = opv;
- vnodeopv_descs = newopv;
- vnodeopv_num++;
-
- /* See if we have turned up a new vnode op desc */
+ /*
+ * Finally, go back and replace unfilled routines
+ * with their default. (Sigh, an O(n^3) algorithm. I
+ * could make it better, but that'd be work, and n is small.)
+ */
opv_desc_vector = *(opv->opv_desc_vector_p);
- for (i = 0; (desc = opv->opv_desc_ops[i].opve_op); i++) {
- for (j = 0; j < num_op_descs; j++) {
- if (desc == vfs_op_descs[j]) {
- /* found it, increase reference count */
- vfs_op_desc_refs[j]++;
- break;
- }
- }
- if (j == num_op_descs) {
- /* not found, new entry */
- MALLOC(newop, struct vnodeop_desc **,
- (num_op_descs + 1) * sizeof(*newop),
- M_VNODE, M_WAITOK);
- if (newop == NULL)
- panic("vfs_add_vnodeops: no memory for desc");
- /* new reference count (for unload) */
- MALLOC(newref, int *,
- (num_op_descs + 1) * sizeof(*newref),
- M_VNODE, M_WAITOK);
- if (newref == NULL)
- panic("vfs_add_vnodeops: no memory for refs");
- if (vfs_op_descs) {
- bcopy(vfs_op_descs, newop,
- num_op_descs * sizeof(*newop));
- FREE(vfs_op_descs, M_VNODE);
- }
- if (vfs_op_desc_refs) {
- bcopy(vfs_op_desc_refs, newref,
- num_op_descs * sizeof(*newref));
- FREE(vfs_op_desc_refs, M_VNODE);
- }
- newop[num_op_descs] = desc;
- newref[num_op_descs] = 1;
- vfs_op_descs = newop;
- vfs_op_desc_refs = newref;
- num_op_descs++;
- }
+ /*
+ * Force every operations vector to have a default routine.
+ */
+ if (opv_desc_vector[VOFFSET(vop_default)]==NULL) {
+ panic("vfs_opv_init: operation vector without default routine.");
}
- vfs_opv_recalc();
+ for (k = 0; k<vfs_opv_numops; k++)
+ if (opv_desc_vector[k] == NULL)
+ opv_desc_vector[k] =
+ opv_desc_vector[VOFFSET(vop_default)];
}
-void
-vfs_rm_vnodeops(void *data)
+/*
+ * Initialize known vnode operations vectors.
+ */
+static void
+vfs_op_init()
{
- struct vnodeopv_desc *opv;
- struct vnodeopv_desc **newopv;
- struct vnodeop_desc **newop;
- int *newref;
- vop_t **opv_desc_vector;
- struct vnodeop_desc *desc;
- int i, j, k;
-
- opv = (struct vnodeopv_desc *)data;
- /* Lower ref counts on descs in the table and release if zero */
- opv_desc_vector = *(opv->opv_desc_vector_p);
- for (i = 0; (desc = opv->opv_desc_ops[i].opve_op); i++) {
- for (j = 0; j < num_op_descs; j++) {
- if (desc == vfs_op_descs[j]) {
- /* found it, decrease reference count */
- vfs_op_desc_refs[j]--;
- break;
- }
- }
- for (j = 0; j < num_op_descs; j++) {
- if (vfs_op_desc_refs[j] > 0)
- continue;
- if (vfs_op_desc_refs[j] < 0)
- panic("vfs_remove_vnodeops: negative refcnt");
- MALLOC(newop, struct vnodeop_desc **,
- (num_op_descs - 1) * sizeof(*newop),
- M_VNODE, M_WAITOK);
- if (newop == NULL)
- panic("vfs_remove_vnodeops: no memory for desc");
- /* new reference count (for unload) */
- MALLOC(newref, int *,
- (num_op_descs - 1) * sizeof(*newref),
- M_VNODE, M_WAITOK);
- if (newref == NULL)
- panic("vfs_remove_vnodeops: no memory for refs");
- for (k = j; k < (num_op_descs - 1); k++) {
- vfs_op_descs[k] = vfs_op_descs[k + 1];
- vfs_op_desc_refs[k] = vfs_op_desc_refs[k + 1];
- }
- bcopy(vfs_op_descs, newop,
- (num_op_descs - 1) * sizeof(*newop));
- bcopy(vfs_op_desc_refs, newref,
- (num_op_descs - 1) * sizeof(*newref));
- FREE(vfs_op_descs, M_VNODE);
- FREE(vfs_op_desc_refs, M_VNODE);
- vfs_op_descs = newop;
- vfs_op_desc_refs = newref;
- num_op_descs--;
- }
- }
-
- for (i = 0; i < vnodeopv_num; i++) {
- if (vnodeopv_descs[i] == opv) {
- for (j = i; j < (vnodeopv_num - 1); j++)
- vnodeopv_descs[j] = vnodeopv_descs[j + 1];
- break;
- }
- }
- if (i == vnodeopv_num)
- panic("vfs_remove_vnodeops: opv not found");
- MALLOC(newopv, struct vnodeopv_desc **,
- (vnodeopv_num - 1) * sizeof(*newopv), M_VNODE, M_WAITOK);
- if (newopv == NULL)
- panic("vfs_remove_vnodeops: no memory");
- bcopy(vnodeopv_descs, newopv, (vnodeopv_num - 1) * sizeof(*newopv));
- FREE(vnodeopv_descs, M_VNODE);
- vnodeopv_descs = newopv;
- vnodeopv_num--;
+ int i;
- vfs_opv_recalc();
+ DODEBUG(printf("Vnode_interface_init.\n"));
+ DODEBUG(printf ("vfs_opv_numops=%d\n", vfs_opv_numops));
+#ifdef unused
+ /*
+ * Set all vnode vectors to a well known value.
+ */
+ for (i = 0; vfs_opv_descs[i]; i++)
+ *(vfs_opv_descs[i]->opv_desc_vector_p) = NULL;
+#endif
+ /*
+ * assign each op to its offset
+ *
+ * XXX This should not be needed, but is because the per
+ * XXX FS ops tables are not sorted according to the
+ * XXX vnodeop_desc's offset in vfs_op_descs. This
+ * XXX is the same reason we have to take the hit for
+ * XXX the static inline function calls instead of using
+ * XXX simple macro references.
+ */
+ for (i = 0; i < vfs_opv_numops; i++)
+ vfs_op_descs[i]->vdesc_offset = i;
+#ifdef unused
+ /* Finish the job */
+ for (i = 0; vfs_opv_descs[i]; i++)
+ vfs_opv_init(vfs_opv_descs[i]);
+#endif
}
/*
* Routines having to do with the management of the vnode table.
*/
+extern struct vnodeops dead_vnodeops;
+extern struct vnodeops spec_vnodeops;
struct vattr va_null;
/*
@@ -305,8 +240,11 @@ struct vattr va_null;
*/
/* ARGSUSED*/
static void
-vfsinit(void *dummy)
+vfsinit(dummy)
+ void *dummy;
{
+ struct vfsconf **vfc, *vfsp;
+ int maxtypenum;
namei_zone = zinit("NAMEI", MAXPATHLEN, 0, 0, 2);
@@ -319,23 +257,28 @@ vfsinit(void *dummy)
*/
nchinit();
/*
+ * Build vnode operation vectors.
+ */
+ vfs_op_init();
+ /*
* Initialize each file system type.
* Vfs type numbers must be distinct from VFS_GENERIC (and VFS_VFSCONF).
*/
vattr_null(&va_null);
maxvfsconf = VFS_GENERIC + 1;
}
-SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vfsinit, NULL)
int
-vfs_register(struct vfsconf *vfc)
+vfs_register(vfc)
+ struct vfsconf *vfc;
{
struct linker_set *l;
struct sysctl_oid **oidpp;
struct vfsconf *vfsp;
- int i, exists;
+ int error, i, maxtypenum, exists;
vfsp = NULL;
+ exists = 0;
l = &sysctl__vfs;
if (vfsconf)
for (vfsp = vfsconf; vfsp->vfc_next; vfsp = vfsp->vfc_next)
@@ -344,33 +287,23 @@ vfs_register(struct vfsconf *vfc)
vfc->vfc_typenum = maxvfsconf++;
if (vfc->vfc_vfsops->vfs_oid != NULL) {
- /*
- * Attach the oid to the "vfs" node of the sysctl tree if
- * it isn't already there (it will be there for statically
- * configured vfs's).
- */
- exists = 0;
- for (i = l->ls_length,
- oidpp = (struct sysctl_oid **)l->ls_items;
- i-- != 0; oidpp++)
- if (*oidpp == vfc->vfc_vfsops->vfs_oid) {
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ for (i = l->ls_length; i-- && !exists; oidpp++)
+ if (*oidpp == vfc->vfc_vfsops->vfs_oid)
exists = 1;
+ }
+ if (exists == 0 && vfc->vfc_vfsops->vfs_oid != NULL) {
+ oidpp = (struct sysctl_oid **)l->ls_items;
+ for (i = l->ls_length; i--; oidpp++) {
+ if (*oidpp == NULL ||
+ *oidpp == &sysctl___vfs_mod0 ||
+ *oidpp == &sysctl___vfs_mod1) {
+ *oidpp = vfc->vfc_vfsops->vfs_oid;
+ (*oidpp)->oid_number = vfc->vfc_typenum;
+ sysctl_order_all();
break;
}
- if (exists == 0)
- for (i = l->ls_length,
- oidpp = (struct sysctl_oid **)l->ls_items;
- i-- != 0; oidpp++) {
- if (*oidpp == NULL ||
- *oidpp == &sysctl___vfs_mod0 ||
- *oidpp == &sysctl___vfs_mod1) {
- *oidpp = vfc->vfc_vfsops->vfs_oid;
- break;
- }
- }
-
- vfc->vfc_vfsops->vfs_oid->oid_number = vfc->vfc_typenum;
- sysctl_order_all();
+ }
}
if (vfsp)
vfsp->vfc_next = vfc;
@@ -387,8 +320,24 @@ vfs_register(struct vfsconf *vfc)
}
+/*
+ * To be called at SI_SUB_VFS, SECOND, for each VFS before any are registered.
+ */
+void
+vfs_mod_opv_init(handle)
+ void *handle;
+{
+ int i;
+ struct vnodeopv_desc *opv;
+
+ opv = (struct vnodeopv_desc *)handle;
+ *(opv->opv_desc_vector_p) = NULL;
+ vfs_opv_init(opv);
+}
+
int
-vfs_unregister(struct vfsconf *vfc)
+vfs_unregister(vfc)
+ struct vfsconf *vfc;
{
struct linker_set *l;
struct sysctl_oid **oidpp;
@@ -435,27 +384,3 @@ vfs_unregister(struct vfsconf *vfc)
maxvfsconf = maxtypenum + 1;
return 0;
}
-
-int
-vfs_modevent(module_t mod, int type, void *data)
-{
- struct vfsconf *vfc;
- int error = 0;
-
- vfc = (struct vfsconf *)data;
-
- switch (type) {
- case MOD_LOAD:
- if (vfc)
- error = vfs_register(vfc);
- break;
-
- case MOD_UNLOAD:
- if (vfc)
- error = vfs_unregister(vfc);
- break;
- default: /* including MOD_SHUTDOWN */
- break;
- }
- return (error);
-}
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 67efd523706d9..b2d09547b9361 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
- * $Id: vfs_lookup.c,v 1.30 1999/01/08 17:31:16 eivind Exp $
+ * $Id: vfs_lookup.c,v 1.27 1998/04/08 18:31:57 wosch Exp $
*/
#include "opt_ktrace.h"
@@ -89,11 +89,14 @@ namei(ndp)
struct proc *p = cnp->cn_proc;
ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_proc->p_ucred;
- KASSERT(cnp->cn_cred && cnp->cn_proc, ("namei: bad cred/proc"));
- KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0,
- ("namei: nameiop contaminated with flags"));
- KASSERT((cnp->cn_flags & OPMASK) == 0,
- ("namei: flags contaminated with nameiops"));
+#ifdef DIAGNOSTIC
+ if (!cnp->cn_cred || !cnp->cn_proc)
+ panic ("namei: bad cred/proc");
+ if (cnp->cn_nameiop & (~OPMASK))
+ panic ("namei: nameiop contaminated with flags");
+ if (cnp->cn_flags & OPMASK)
+ panic ("namei: flags contaminated with nameiops");
+#endif
fdp = cnp->cn_proc->p_fd;
/*
@@ -165,11 +168,9 @@ namei(ndp)
if (ndp->ni_vp && ndp->ni_vp->v_type == VREG &&
(cnp->cn_nameiop != DELETE) &&
- ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) ==
- LOCKLEAF))
+ ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF))
vfs_object_create(ndp->ni_vp,
- ndp->ni_cnd.cn_proc,
- ndp->ni_cnd.cn_cred);
+ ndp->ni_cnd.cn_proc, ndp->ni_cnd.cn_cred, 1);
return (0);
}
@@ -415,7 +416,10 @@ unionlookup:
ndp->ni_vp = NULL;
ASSERT_VOP_LOCKED(dp, "lookup");
if (error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp)) {
- KASSERT(ndp->ni_vp == NULL, ("leaf should be empty"));
+#ifdef DIAGNOSTIC
+ if (ndp->ni_vp != NULL)
+ panic("leaf should be empty");
+#endif
#ifdef NAMEI_DIAGNOSTIC
printf("not found\n");
#endif
@@ -643,7 +647,10 @@ relookup(dvp, vpp, cnp)
* We now have a segment name to search for, and a directory to search.
*/
if (error = VOP_LOOKUP(dp, vpp, cnp)) {
- KASSERT(*vpp == NULL, ("leaf should be empty"));
+#ifdef DIAGNOSTIC
+ if (*vpp != NULL)
+ panic("leaf should be empty");
+#endif
if (error != EJUSTRETURN)
goto bad;
/*
@@ -666,11 +673,13 @@ relookup(dvp, vpp, cnp)
}
dp = *vpp;
+#ifdef DIAGNOSTIC
/*
* Check for symbolic link
*/
- KASSERT(dp->v_type != VLNK || !(cnp->cn_flags & FOLLOW),
- ("relookup: symlink found.\n"));
+ if (dp->v_type == VLNK && (cnp->cn_flags & FOLLOW))
+ panic ("relookup: symlink found.\n");
+#endif
/*
* Disallow directory write attempts on read-only file systems.
@@ -689,7 +698,7 @@ relookup(dvp, vpp, cnp)
if (dp->v_type == VREG &&
((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF))
- vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred);
+ vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred, 1);
if ((cnp->cn_flags & LOCKLEAF) == 0)
VOP_UNLOCK(dp, 0, p);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 179ef78994632..867cf8866f372 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
- * $Id: vfs_subr.c,v 1.181 1999/01/08 17:31:17 eivind Exp $
+ * $Id: vfs_subr.c,v 1.165 1998/10/13 08:24:41 dg Exp $
*/
/*
@@ -46,8 +46,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/malloc.h>
@@ -77,6 +75,9 @@
static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure");
static void insmntque __P((struct vnode *vp, struct mount *mp));
+#ifdef DDB
+static void printlockedvnodes __P((void));
+#endif
static void vclean __P((struct vnode *vp, int flags, struct proc *p));
static void vfree __P((struct vnode *));
static void vgonel __P((struct vnode *vp, struct proc *p));
@@ -92,6 +93,15 @@ int vttoif_tab[9] = {
S_IFSOCK, S_IFIFO, S_IFMT,
};
+/*
+ * Insq/Remq for the vnode usage lists.
+ */
+#define bufinsvn(bp, dp) LIST_INSERT_HEAD(dp, bp, b_vnbufs)
+#define bufremvn(bp) { \
+ LIST_REMOVE(bp, b_vnbufs); \
+ (bp)->b_vnbufs.le_next = NOLIST; \
+}
+
static TAILQ_HEAD(freelst, vnode) vnode_free_list; /* vnode free list */
struct tobefreelist vnode_tobefree_list; /* vnode free list */
@@ -107,13 +117,11 @@ SYSCTL_INT(_vfs, OID_AUTO, ioopt, CTLFLAG_RW, &vfs_ioopt, 0, "");
struct mntlist mountlist; /* mounted filesystem list */
struct simplelock mountlist_slock;
+static struct simplelock mntid_slock;
struct simplelock mntvnode_slock;
int nfs_mount_type = -1;
-#ifndef NULL_SIMPLELOCKS
-static struct simplelock mntid_slock;
static struct simplelock vnode_free_list_slock;
static struct simplelock spechash_slock;
-#endif
struct nfs_public nfs_pub; /* publicly exported FS */
static vm_zone_t vnode_zone;
@@ -121,7 +129,7 @@ static vm_zone_t vnode_zone;
* The workitem queue.
*/
#define SYNCER_MAXDELAY 32
-static int syncer_maxdelay = SYNCER_MAXDELAY; /* maximum delay time */
+int syncer_maxdelay = SYNCER_MAXDELAY; /* maximum delay time */
time_t syncdelay = 30;
int rushjob; /* number of slots to run ASAP */
@@ -422,7 +430,9 @@ getnewvnode(tag, mp, vops, vpp)
vp = NULL;
} else {
for (vp = TAILQ_FIRST(&vnode_free_list); vp; vp = nvp) {
+
nvp = TAILQ_NEXT(vp, v_freelist);
+
if (!simple_lock_try(&vp->v_interlock))
continue;
if (vp->v_usecount)
@@ -466,7 +476,7 @@ getnewvnode(tag, mp, vops, vpp)
simple_unlock(&vp->v_interlock);
}
-#ifdef INVARIANTS
+#ifdef DIAGNOSTIC
{
int s;
@@ -499,8 +509,6 @@ getnewvnode(tag, mp, vops, vpp)
numvnodes++;
}
- TAILQ_INIT(&vp->v_cleanblkhd);
- TAILQ_INIT(&vp->v_dirtyblkhd);
vp->v_type = VNON;
vp->v_tag = tag;
vp->v_op = vops;
@@ -510,7 +518,7 @@ getnewvnode(tag, mp, vops, vpp)
vp->v_data = 0;
splx(s);
- vfs_object_create(vp, p, p->p_ucred);
+ vfs_object_create(vp, p, p->p_ucred, TRUE);
return (0);
}
@@ -582,34 +590,37 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo)
s = splbio();
while (vp->v_numoutput) {
vp->v_flag |= VBWAIT;
- error = tsleep((caddr_t)&vp->v_numoutput,
- slpflag | (PRIBIO + 1), "vinvlbuf", slptimeo);
- if (error) {
- splx(s);
- return (error);
- }
+ tsleep((caddr_t)&vp->v_numoutput,
+ slpflag | (PRIBIO + 1),
+ "vinvlbuf", slptimeo);
}
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first != NULL) {
splx(s);
if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, p)) != 0)
return (error);
s = splbio();
if (vp->v_numoutput > 0 ||
- !TAILQ_EMPTY(&vp->v_dirtyblkhd))
+ vp->v_dirtyblkhd.lh_first != NULL)
panic("vinvalbuf: dirty bufs");
}
splx(s);
}
s = splbio();
for (;;) {
- blist = TAILQ_FIRST(&vp->v_cleanblkhd);
- if (!blist)
- blist = TAILQ_FIRST(&vp->v_dirtyblkhd);
+ if ((blist = vp->v_cleanblkhd.lh_first) && (flags & V_SAVEMETA))
+ while (blist && blist->b_lblkno < 0)
+ blist = blist->b_vnbufs.le_next;
+ if (!blist && (blist = vp->v_dirtyblkhd.lh_first) &&
+ (flags & V_SAVEMETA))
+ while (blist && blist->b_lblkno < 0)
+ blist = blist->b_vnbufs.le_next;
if (!blist)
break;
for (bp = blist; bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ nbp = bp->b_vnbufs.le_next;
+ if ((flags & V_SAVEMETA) && bp->b_lblkno < 0)
+ continue;
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
error = tsleep((caddr_t) bp,
@@ -667,12 +678,17 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo)
simple_lock(&vp->v_interlock);
object = vp->v_object;
if (object != NULL) {
- vm_object_page_remove(object, 0, 0,
- (flags & V_SAVE) ? TRUE : FALSE);
+ if (flags & V_SAVEMETA)
+ vm_object_page_remove(object, 0, object->size,
+ (flags & V_SAVE) ? TRUE : FALSE);
+ else
+ vm_object_page_remove(object, 0, 0,
+ (flags & V_SAVE) ? TRUE : FALSE);
}
simple_unlock(&vp->v_interlock);
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd) || !TAILQ_EMPTY(&vp->v_cleanblkhd))
+ if (!(flags & V_SAVEMETA) &&
+ (vp->v_dirtyblkhd.lh_first || vp->v_cleanblkhd.lh_first))
panic("vinvalbuf: flush failed");
return (0);
}
@@ -691,8 +707,9 @@ vtruncbuf(vp, cred, p, length, blksize)
int blksize;
{
register struct buf *bp;
- struct buf *nbp;
- int s, anyfreed;
+ struct buf *nbp, *blist;
+ int s, error, anyfreed;
+ vm_object_t object;
int trunclbn;
/*
@@ -705,8 +722,10 @@ restart:
anyfreed = 1;
for (;anyfreed;) {
anyfreed = 0;
- for (bp = TAILQ_FIRST(&vp->v_cleanblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for ( bp = LIST_FIRST(&vp->v_cleanblkhd); bp; bp = nbp) {
+
+ nbp = LIST_NEXT(bp, b_vnbufs);
+
if (bp->b_lblkno >= trunclbn) {
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -719,7 +738,8 @@ restart:
brelse(bp);
anyfreed = 1;
}
- if (nbp && (((nbp->b_xflags & B_VNCLEAN) == 0)||
+ if (nbp &&
+ ((LIST_NEXT(nbp, b_vnbufs) == NOLIST) ||
(nbp->b_vp != vp) ||
(nbp->b_flags & B_DELWRI))) {
goto restart;
@@ -727,8 +747,10 @@ restart:
}
}
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
+
+ nbp = LIST_NEXT(bp, b_vnbufs);
+
if (bp->b_lblkno >= trunclbn) {
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -741,7 +763,8 @@ restart:
brelse(bp);
anyfreed = 1;
}
- if (nbp && (((nbp->b_xflags & B_VNDIRTY) == 0)||
+ if (nbp &&
+ ((LIST_NEXT(nbp, b_vnbufs) == NOLIST) ||
(nbp->b_vp != vp) ||
(nbp->b_flags & B_DELWRI) == 0)) {
goto restart;
@@ -752,8 +775,10 @@ restart:
if (length > 0) {
restartsync:
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
+
+ nbp = LIST_NEXT(bp, b_vnbufs);
+
if ((bp->b_flags & B_DELWRI) && (bp->b_lblkno < 0)) {
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
@@ -796,8 +821,10 @@ bgetvp(vp, bp)
{
int s;
- KASSERT(bp->b_vp == NULL, ("bgetvp: not free"));
-
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp)
+ panic("bgetvp: not free");
+#endif
vhold(vp);
bp->b_vp = vp;
if (vp->v_type == VBLK || vp->v_type == VCHR)
@@ -808,9 +835,7 @@ bgetvp(vp, bp)
* Insert onto list for new vnode.
*/
s = splbio();
- bp->b_xflags |= B_VNCLEAN;
- bp->b_xflags &= ~B_VNDIRTY;
- TAILQ_INSERT_TAIL(&vp->v_cleanblkhd, bp, b_vnbufs);
+ bufinsvn(bp, &vp->v_cleanblkhd);
splx(s);
}
@@ -822,25 +847,21 @@ brelvp(bp)
register struct buf *bp;
{
struct vnode *vp;
- struct buflists *listheadp;
int s;
- KASSERT(bp->b_vp != NULL, ("brelvp: NULL"));
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp == (struct vnode *) 0)
+ panic("brelvp: NULL");
+#endif
/*
* Delete from old vnode list, if on one.
*/
vp = bp->b_vp;
s = splbio();
- if (bp->b_xflags & (B_VNDIRTY|B_VNCLEAN)) {
- if (bp->b_xflags & B_VNDIRTY)
- listheadp = &vp->v_dirtyblkhd;
- else
- listheadp = &vp->v_cleanblkhd;
- TAILQ_REMOVE(listheadp, bp, b_vnbufs);
- bp->b_xflags &= ~(B_VNDIRTY|B_VNCLEAN);
- }
- if ((vp->v_flag & VONWORKLST) && TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (bp->b_vnbufs.le_next != NOLIST)
+ bufremvn(bp);
+ if ((vp->v_flag & VONWORKLST) && (LIST_FIRST(&vp->v_dirtyblkhd) == NULL)) {
vp->v_flag &= ~VONWORKLST;
LIST_REMOVE(vp, v_synclist);
}
@@ -939,7 +960,7 @@ sched_sync(void)
(void) VOP_FSYNC(vp, p->p_ucred, MNT_LAZY, p);
VOP_UNLOCK(vp, 0, p);
if (LIST_FIRST(slp) == vp) {
- if (TAILQ_EMPTY(&vp->v_dirtyblkhd) &&
+ if (LIST_FIRST(&vp->v_dirtyblkhd) == NULL &&
vp->v_type != VBLK)
panic("sched_sync: fsync failed");
/*
@@ -991,9 +1012,10 @@ pbgetvp(vp, bp)
register struct vnode *vp;
register struct buf *bp;
{
-
- KASSERT(bp->b_vp == NULL, ("pbgetvp: not free"));
-
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp)
+ panic("pbgetvp: not free");
+#endif
bp->b_vp = vp;
if (vp->v_type == VBLK || vp->v_type == VCHR)
bp->b_dev = vp->v_rdev;
@@ -1009,7 +1031,10 @@ pbrelvp(bp)
register struct buf *bp;
{
- KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL"));
+#if defined(DIAGNOSTIC)
+ if (bp->b_vp == (struct vnode *) 0)
+ panic("pbrelvp: NULL");
+#endif
bp->b_vp = (struct vnode *) 0;
}
@@ -1025,7 +1050,6 @@ reassignbuf(bp, newvp)
register struct vnode *newvp;
{
struct buflists *listheadp;
- struct vnode *oldvp;
int delay;
int s;
@@ -1038,15 +1062,9 @@ reassignbuf(bp, newvp)
/*
* Delete from old vnode list, if on one.
*/
- if (bp->b_xflags & (B_VNDIRTY|B_VNCLEAN)) {
- oldvp = bp->b_vp;
- if (bp->b_xflags & B_VNDIRTY)
- listheadp = &oldvp->v_dirtyblkhd;
- else
- listheadp = &oldvp->v_cleanblkhd;
- TAILQ_REMOVE(listheadp, bp, b_vnbufs);
- bp->b_xflags &= ~(B_VNDIRTY|B_VNCLEAN);
- vdrop(oldvp);
+ if (bp->b_vnbufs.le_next != NOLIST) {
+ bufremvn(bp);
+ vdrop(bp->b_vp);
}
/*
* If dirty, put on list of dirty buffers; otherwise insert onto list
@@ -1072,28 +1090,20 @@ reassignbuf(bp, newvp)
}
vn_syncer_add_to_worklist(newvp, delay);
}
- bp->b_xflags |= B_VNDIRTY;
- tbp = TAILQ_FIRST(listheadp);
- if (tbp == NULL ||
- (bp->b_lblkno >= 0 && tbp->b_lblkno > bp->b_lblkno)) {
- TAILQ_INSERT_HEAD(listheadp, bp, b_vnbufs);
+ tbp = listheadp->lh_first;
+ if (!tbp || (tbp->b_lblkno > bp->b_lblkno)) {
+ bufinsvn(bp, listheadp);
} else {
- if (bp->b_lblkno >= 0) {
- struct buf *ttbp;
- while ((ttbp = TAILQ_NEXT(tbp, b_vnbufs)) &&
- (ttbp->b_lblkno < bp->b_lblkno)) {
- tbp = ttbp;
- }
- TAILQ_INSERT_AFTER(listheadp, tbp, bp, b_vnbufs);
- } else {
- TAILQ_INSERT_TAIL(listheadp, bp, b_vnbufs);
+ while (tbp->b_vnbufs.le_next &&
+ (tbp->b_vnbufs.le_next->b_lblkno < bp->b_lblkno)) {
+ tbp = tbp->b_vnbufs.le_next;
}
+ LIST_INSERT_AFTER(tbp, bp, b_vnbufs);
}
} else {
- bp->b_xflags |= B_VNCLEAN;
- TAILQ_INSERT_TAIL(&newvp->v_cleanblkhd, bp, b_vnbufs);
+ bufinsvn(bp, &newvp->v_cleanblkhd);
if ((newvp->v_flag & VONWORKLST) &&
- TAILQ_EMPTY(&newvp->v_dirtyblkhd)) {
+ LIST_FIRST(&newvp->v_dirtyblkhd) == NULL) {
newvp->v_flag &= ~VONWORKLST;
LIST_REMOVE(newvp, v_synclist);
}
@@ -1116,20 +1126,16 @@ bdevvp(dev, vpp)
struct vnode *nvp;
int error;
- /* XXX 255 is for mfs. */
- if (dev == NODEV || (major(dev) != 255 && (major(dev) >= nblkdev ||
- bdevsw[major(dev)] == NULL))) {
- *vpp = NULLVP;
- return (ENXIO);
- }
- error = getnewvnode(VT_NON, (struct mount *)0, spec_vnodeop_p, &nvp);
+ if (dev == NODEV)
+ return (0);
+ error = getnewvnode(VT_NON, (struct mount *) 0, spec_vnodeop_p, &nvp);
if (error) {
- *vpp = NULLVP;
+ *vpp = 0;
return (error);
}
vp = nvp;
vp->v_type = VBLK;
- if ((nvp = checkalias(vp, dev, (struct mount *)0)) != NULL) {
+ if ((nvp = checkalias(vp, dev, (struct mount *) 0))) {
vput(vp);
vp = nvp;
}
@@ -1304,8 +1310,10 @@ vrele(vp)
{
struct proc *p = curproc; /* XXX */
- KASSERT(vp != NULL, ("vrele: null vp"));
-
+#ifdef DIAGNOSTIC
+ if (vp == NULL)
+ panic("vrele: null vp");
+#endif
simple_lock(&vp->v_interlock);
if (vp->v_usecount > 1) {
@@ -1345,7 +1353,10 @@ vput(vp)
{
struct proc *p = curproc; /* XXX */
- KASSERT(vp != NULL, ("vput: null vp"));
+#ifdef DIAGNOSTIC
+ if (vp == NULL)
+ panic("vput: null vp");
+#endif
simple_lock(&vp->v_interlock);
@@ -1572,7 +1583,7 @@ vclean(vp, flags, p)
*/
if (active) {
if (flags & DOCLOSE)
- VOP_CLOSE(vp, FNONBLOCK, NOCRED, p);
+ VOP_CLOSE(vp, IO_NDELAY, NOCRED, p);
VOP_INACTIVE(vp, p);
} else {
/*
@@ -1632,7 +1643,10 @@ vop_revoke(ap)
struct vnode *vp, *vq;
struct proc *p = curproc; /* XXX */
- KASSERT((ap->a_flags & REVOKEALL) != 0, ("vop_revoke"));
+#ifdef DIAGNOSTIC
+ if ((ap->a_flags & REVOKEALL) == 0)
+ panic("vop_revoke");
+#endif
vp = ap->a_vp;
simple_lock(&vp->v_interlock);
@@ -1891,7 +1905,7 @@ vprint(label, vp)
char *label;
register struct vnode *vp;
{
- char buf[96];
+ char buf[64];
if (label != NULL)
printf("%s: %p: ", label, (void *)vp);
@@ -1932,12 +1946,12 @@ vprint(label, vp)
}
#ifdef DDB
-#include <ddb/ddb.h>
/*
* List all of the locked vnodes in the system.
* Called when debugging the kernel.
*/
-DB_SHOW_COMMAND(lockedvnodes, lockedvnodes)
+static void
+printlockedvnodes()
{
struct proc *p = curproc; /* XXX */
struct mount *mp, *nmp;
@@ -2041,6 +2055,8 @@ sysctl_ovfs_conf SYSCTL_HANDLER_ARGS
#endif /* 1 || COMPAT_PRELITE2 */
+static volatile int kinfo_vdebug = 1;
+
#if 0
#define KINFO_VNODESLOP 10
/*
@@ -2082,6 +2098,8 @@ again:
*/
if (vp->v_mount != mp) {
simple_unlock(&mntvnode_slock);
+ if (kinfo_vdebug)
+ printf("kinfo: vp changed\n");
goto again;
}
nvp = vp->v_mntvnodes.le_next;
@@ -2463,7 +2481,7 @@ loop:
if (!vget(vp,
LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) {
if (vp->v_object) {
- vm_object_page_clean(vp->v_object, 0, 0, flags == MNT_WAIT ? OBJPC_SYNC : 0);
+ vm_object_page_clean(vp->v_object, 0, 0, TRUE);
anyio = 1;
}
vput(vp);
@@ -2482,20 +2500,27 @@ loop:
* afford the additional metadata buffering capability of the
* VMIO code by making the device node be VMIO mode also.
*
- * vp must be locked when vfs_object_create is called.
+ * If !waslocked, must be called with interlock.
*/
int
-vfs_object_create(vp, p, cred)
+vfs_object_create(vp, p, cred, waslocked)
struct vnode *vp;
struct proc *p;
struct ucred *cred;
+ int waslocked;
{
struct vattr vat;
vm_object_t object;
int error = 0;
- if ((vp->v_type != VREG) && (vp->v_type != VBLK))
+ if ((vp->v_type != VREG) && (vp->v_type != VBLK)) {
+ if (!waslocked)
+ simple_unlock(&vp->v_interlock);
return 0;
+ }
+
+ if (!waslocked)
+ vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY, p);
retry:
if ((object = vp->v_object) == NULL) {
@@ -2503,8 +2528,7 @@ retry:
if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
goto retn;
object = vnode_pager_alloc(vp, vat.va_size, 0, 0);
- } else if (major(vp->v_rdev) < nblkdev &&
- bdevsw[major(vp->v_rdev)] != NULL) {
+ } else if (major(vp->v_rdev) < nblkdev) {
/*
* This simply allocates the biggest object possible
* for a VBLK vnode. This should be fixed, but doesn't
@@ -2523,10 +2547,16 @@ retry:
}
}
- if (vp->v_object)
+ if (vp->v_object) {
vp->v_flag |= VOBJBUF;
+ }
retn:
+ if (!waslocked) {
+ simple_lock(&vp->v_interlock);
+ VOP_UNLOCK(vp, LK_INTERLOCK, p);
+ }
+
return error;
}
@@ -2663,16 +2693,16 @@ vn_pollgone(vp)
* Routine to create and manage a filesystem syncer vnode.
*/
#define sync_close ((int (*) __P((struct vop_close_args *)))nullop)
-static int sync_fsync __P((struct vop_fsync_args *));
-static int sync_inactive __P((struct vop_inactive_args *));
-static int sync_reclaim __P((struct vop_reclaim_args *));
+int sync_fsync __P((struct vop_fsync_args *));
+int sync_inactive __P((struct vop_inactive_args *));
+int sync_reclaim __P((struct vop_reclaim_args *));
#define sync_lock ((int (*) __P((struct vop_lock_args *)))vop_nolock)
#define sync_unlock ((int (*) __P((struct vop_unlock_args *)))vop_nounlock)
-static int sync_print __P((struct vop_print_args *));
+int sync_print __P((struct vop_print_args *));
#define sync_islocked ((int(*) __P((struct vop_islocked_args *)))vop_noislocked)
-static vop_t **sync_vnodeop_p;
-static struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
+vop_t **sync_vnodeop_p;
+struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
{ &vop_default_desc, (vop_t *) vop_eopnotsupp },
{ &vop_close_desc, (vop_t *) sync_close }, /* close */
{ &vop_fsync_desc, (vop_t *) sync_fsync }, /* fsync */
@@ -2684,7 +2714,7 @@ static struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
{ &vop_islocked_desc, (vop_t *) sync_islocked }, /* islocked */
{ NULL, NULL }
};
-static struct vnodeopv_desc sync_vnodeop_opv_desc =
+struct vnodeopv_desc sync_vnodeop_opv_desc =
{ &sync_vnodeop_p, sync_vnodeop_entries };
VNODEOP_SET(sync_vnodeop_opv_desc);
@@ -2730,7 +2760,7 @@ vfs_allocate_syncvnode(mp)
/*
* Do a lazy sync of the filesystem.
*/
-static int
+int
sync_fsync(ap)
struct vop_fsync_args /* {
struct vnode *a_vp;
@@ -2777,7 +2807,7 @@ sync_fsync(ap)
/*
* The syncer vnode is no referenced.
*/
-static int
+int
sync_inactive(ap)
struct vop_inactive_args /* {
struct vnode *a_vp;
@@ -2792,7 +2822,7 @@ sync_inactive(ap)
/*
* The syncer vnode is no longer needed and is being decommissioned.
*/
-static int
+int
sync_reclaim(ap)
struct vop_reclaim_args /* {
struct vnode *a_vp;
@@ -2812,7 +2842,7 @@ sync_reclaim(ap)
/*
* Print out a syncer vnode.
*/
-static int
+int
sync_print(ap)
struct vop_print_args /* {
struct vnode *a_vp;
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 18e39d63abd5e..ec543ab35700b 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,12 +36,21 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.111 1998/12/12 21:07:09 dillon Exp $
+ * $Id: vfs_syscalls.c,v 1.106 1998/09/10 02:27:52 tegge Exp $
*/
/* For 4.3 integer FS ID compatibility */
#include "opt_compat.h"
+/*
+ * XXX - The following is required because of some magic done
+ * in getdirentries() below which is only done if the translucent
+ * filesystem `UNION' is compiled into the kernel. This is broken,
+ * but I don't have time to study the code deeply enough to understand
+ * what's going on and determine an appropriate fix. -GAW
+ */
+#include "opt_union.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysent.h>
@@ -51,7 +60,6 @@
#include <sys/kernel.h>
#include <sys/fcntl.h>
#include <sys/file.h>
-#include <sys/linker.h>
#include <sys/stat.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
@@ -60,7 +68,9 @@
#include <sys/proc.h>
#include <sys/dirent.h>
+#ifdef UNION
#include <miscfs/union/union.h>
+#endif
#include <vm/vm.h>
#include <vm/vm_object.h>
@@ -76,8 +86,6 @@ static int setfflags __P((struct proc *, struct vnode *, int));
static int setutimes __P((struct proc *, struct vnode *, struct timeval *, int));
static int usermount = 0; /* if 1, non-root can mount fs. */
-int (*union_dircheckp) __P((struct proc *, struct vnode **, struct file *));
-
SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");
/*
@@ -225,36 +233,8 @@ mount(p, uap)
if (!strcmp(vfsp->vfc_name, fstypename))
break;
if (vfsp == NULL) {
- linker_file_t lf;
-
- /* Refuse to load modules if securelevel raised */
- if (securelevel > 0) {
- vput(vp);
- return EPERM;
- }
- /* Only load modules for root (very important!) */
- if (error = suser(p->p_ucred, &p->p_acflag)) {
- vput(vp);
- return error;
- }
- error = linker_load_file(fstypename, &lf);
- if (error || lf == NULL) {
- vput(vp);
- if (lf == NULL)
- error = ENODEV;
- return error;
- }
- lf->userrefs++;
- /* lookup again, see if the VFS was loaded */
- for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
- if (!strcmp(vfsp->vfc_name, fstypename))
- break;
- if (vfsp == NULL) {
- lf->userrefs--;
- linker_file_unload(lf);
- vput(vp);
- return (ENODEV);
- }
+ vput(vp);
+ return (ENODEV);
}
simple_lock(&vp->v_interlock);
if ((vp->v_flag & VMOUNT) != 0 ||
@@ -494,8 +474,6 @@ dounmount(mp, flags, p)
mp->mnt_flag |= async_flag;
lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK | LK_REENABLE,
&mountlist_slock, p);
- if (mp->mnt_kern_flag & MNTK_MWAIT)
- wakeup((caddr_t)mp);
return (error);
}
CIRCLEQ_REMOVE(&mountlist, mp, mnt_list);
@@ -976,7 +954,7 @@ open(p, uap)
fp->f_flag |= FHASLOCK;
}
if ((vp->v_type == VREG) && (vp->v_object == NULL))
- vfs_object_create(vp, p, p->p_ucred);
+ vfs_object_create(vp, p, p->p_ucred, TRUE);
VOP_UNLOCK(vp, 0, p);
p->p_retval[0] = indx;
return (0);
@@ -2432,7 +2410,7 @@ fsync(p, uap)
vp = (struct vnode *)fp->f_data;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
if (vp->v_object)
- vm_object_page_clean(vp->v_object, 0, 0, 0);
+ vm_object_page_clean(vp->v_object, 0, 0, FALSE);
if ((error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, p)) == 0 &&
vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP) &&
bioops.io_fsync)
@@ -2675,7 +2653,7 @@ ogetdirentries(p, uap)
syscallarg(long *) basep;
} */ *uap;
{
- struct vnode *vp;
+ register struct vnode *vp;
struct file *fp;
struct uio auio, kuio;
struct iovec aiov, kiov;
@@ -2756,12 +2734,57 @@ unionread:
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
- if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
- error = union_dircheckp(p, &vp, fp);
- if (error == -1)
+
+#ifdef UNION
+{
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_op == union_vnodeop_p)) {
+ struct vnode *lvp;
+
+ lvp = union_dircache(vp, p);
+ if (lvp != NULLVP) {
+ struct vattr va;
+
+ /*
+ * If the directory is opaque,
+ * then don't show lower entries
+ */
+ error = VOP_GETATTR(vp, &va, fp->f_cred, p);
+ if (va.va_flags & OPAQUE) {
+ vput(lvp);
+ lvp = NULL;
+ }
+ }
+
+ if (lvp != NULLVP) {
+ error = VOP_OPEN(lvp, FREAD, fp->f_cred, p);
+ if (error) {
+ vput(lvp);
+ return (error);
+ }
+ VOP_UNLOCK(lvp, 0, p);
+ fp->f_data = (caddr_t) lvp;
+ fp->f_offset = 0;
+ error = vn_close(vp, FREAD, fp->f_cred, p);
+ if (error)
+ return (error);
+ vp = lvp;
goto unionread;
- if (error)
- return (error);
+ }
+ }
+}
+#endif /* UNION */
+
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_flag & VROOT) &&
+ (vp->v_mount->mnt_flag & MNT_UNION)) {
+ struct vnode *tvp = vp;
+ vp = vp->v_mount->mnt_vnodecovered;
+ VREF(vp);
+ fp->f_data = (caddr_t) vp;
+ fp->f_offset = 0;
+ vrele(tvp);
+ goto unionread;
}
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long));
@@ -2791,7 +2814,7 @@ getdirentries(p, uap)
syscallarg(long *) basep;
} */ *uap;
{
- struct vnode *vp;
+ register struct vnode *vp;
struct file *fp;
struct uio auio;
struct iovec aiov;
@@ -2822,12 +2845,57 @@ unionread:
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
- if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
- error = union_dircheckp(p, &vp, fp);
- if (error == -1)
+
+#ifdef UNION
+{
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_op == union_vnodeop_p)) {
+ struct vnode *lvp;
+
+ lvp = union_dircache(vp, p);
+ if (lvp != NULLVP) {
+ struct vattr va;
+
+ /*
+ * If the directory is opaque,
+ * then don't show lower entries
+ */
+ error = VOP_GETATTR(vp, &va, fp->f_cred, p);
+ if (va.va_flags & OPAQUE) {
+ vput(lvp);
+ lvp = NULL;
+ }
+ }
+
+ if (lvp != NULLVP) {
+ error = VOP_OPEN(lvp, FREAD, fp->f_cred, p);
+ if (error) {
+ vput(lvp);
+ return (error);
+ }
+ VOP_UNLOCK(lvp, 0, p);
+ fp->f_data = (caddr_t) lvp;
+ fp->f_offset = 0;
+ error = vn_close(vp, FREAD, fp->f_cred, p);
+ if (error)
+ return (error);
+ vp = lvp;
goto unionread;
- if (error)
- return (error);
+ }
+ }
+}
+#endif /* UNION */
+
+ if ((SCARG(uap, count) == auio.uio_resid) &&
+ (vp->v_flag & VROOT) &&
+ (vp->v_mount->mnt_flag & MNT_UNION)) {
+ struct vnode *tvp = vp;
+ vp = vp->v_mount->mnt_vnodecovered;
+ VREF(vp);
+ fp->f_data = (caddr_t) vp;
+ fp->f_offset = 0;
+ vrele(tvp);
+ goto unionread;
}
if (SCARG(uap, basep) != NULL) {
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 0b32a7d1950cb..41e8cbb15dde3 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
- * $Id: vfs_vnops.c,v 1.61 1999/01/05 18:49:56 eivind Exp $
+ * $Id: vfs_vnops.c,v 1.58 1998/06/07 17:11:48 dfr Exp $
*/
#include <sys/param.h>
@@ -78,7 +78,7 @@ vn_open(ndp, fmode, cmode)
register struct ucred *cred = p->p_ucred;
struct vattr vat;
struct vattr *vap = &vat;
- int mode, error;
+ int error;
if (fmode & O_CREAT) {
ndp->ni_cnd.cn_nameiop = CREATE;
@@ -136,7 +136,11 @@ vn_open(ndp, fmode, cmode)
goto bad;
}
if ((fmode & O_CREAT) == 0) {
- mode = 0;
+ if (fmode & FREAD) {
+ error = VOP_ACCESS(vp, VREAD, cred, p);
+ if (error)
+ goto bad;
+ }
if (fmode & (FWRITE | O_TRUNC)) {
if (vp->v_type == VDIR) {
error = EISDIR;
@@ -145,12 +149,7 @@ vn_open(ndp, fmode, cmode)
error = vn_writechk(vp);
if (error)
goto bad;
- mode |= VWRITE;
- }
- if (fmode & FREAD)
- mode |= VREAD;
- if (mode) {
- error = VOP_ACCESS(vp, mode, cred, p);
+ error = VOP_ACCESS(vp, VWRITE, cred, p);
if (error)
goto bad;
}
@@ -172,7 +171,7 @@ vn_open(ndp, fmode, cmode)
* Make sure that a VM object is created for VMIO support.
*/
if (vp->v_type == VREG) {
- if ((error = vfs_object_create(vp, p, cred)) != 0)
+ if ((error = vfs_object_create(vp, p, cred, 1)) != 0)
goto bad;
}
@@ -510,18 +509,10 @@ vn_poll(fp, events, cred, p)
* acquire requested lock.
*/
int
-#ifndef DEBUG_LOCKS
vn_lock(vp, flags, p)
-#else
-debug_vn_lock(vp, flags, p, filename, line)
-#endif
struct vnode *vp;
int flags;
struct proc *p;
-#ifdef DEBUG_LOCKS
- const char *filename;
- int line;
-#endif
{
int error;
@@ -534,12 +525,7 @@ debug_vn_lock(vp, flags, p, filename, line)
tsleep((caddr_t)vp, PINOD, "vn_lock", 0);
error = ENOENT;
} else {
-#ifdef DEBUG_LOCKS
- vp->filename = filename;
- vp->line = line;
-#endif
- error = VOP_LOCK(vp,
- flags | LK_NOPAUSE | LK_INTERLOCK, p);
+ error = VOP_LOCK(vp, flags | LK_NOPAUSE | LK_INTERLOCK, p);
if (error == 0)
return (error);
}
diff --git a/sys/kern/vnode_if.sh b/sys/kern/vnode_if.sh
index 8193edb0c53c7..d289c35da7686 100644
--- a/sys/kern/vnode_if.sh
+++ b/sys/kern/vnode_if.sh
@@ -32,7 +32,7 @@
# SUCH DAMAGE.
#
# @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93
-# $Id: vnode_if.sh,v 1.15 1998/07/04 20:45:32 julian Exp $
+# $Id: vnode_if.sh,v 1.14 1997/12/19 23:25:16 bde Exp $
#
# Script to produce VFS front-end sugar.
@@ -188,7 +188,7 @@ cat << END_OF_LEADING_COMMENT > $CFILE
#include <sys/vnode.h>
struct vnodeop_desc vop_default_desc = {
- 1, /* special case, vop_default => 1 */
+ 0,
"default",
0,
NULL,
@@ -400,3 +400,39 @@ struct vnodeop_desc vop_bwrite_desc = {
NULL,
};
END_OF_SPECIAL_CASES
+
+# Add the vfs_op_descs array to the C file.
+$AWK '
+ BEGIN {
+ printf("\nstruct vnodeop_desc *vfs_op_descs[] = {\n");
+ printf("\t&vop_default_desc, /* MUST BE FIRST */\n");
+ printf("\t&vop_strategy_desc, /* XXX: SPECIAL CASE */\n");
+ printf("\t&vop_bwrite_desc, /* XXX: SPECIAL CASE */\n");
+ }
+ END {
+ printf("\tNULL\n};\n");
+ }
+ NF == 0 || $0 ~ "^#" {
+ next;
+ }
+ {
+ # Get the function name.
+ printf("\t&%s_desc,\n", $1);
+
+ # Skip the function arguments.
+ for (;;) {
+ if (getline <= 0)
+ exit
+ if ($0 ~ "^};")
+ break;
+ }
+ }' < $SRC >> $CFILE
+
+cat << END_OF_NUMOPS_CODE >> $CFILE
+
+/*
+ * the -1 is to account for the NULL
+ * XXX is the NULL still necessary? I don't think so...
+ */
+int vfs_opv_numops = (sizeof(vfs_op_descs)/sizeof(struct vnodeop_desc *)) - 1;
+END_OF_NUMOPS_CODE
diff --git a/sys/libkern/moddi3.c b/sys/libkern/moddi3.c
index d914dc17be64a..0e87656a7678d 100644
--- a/sys/libkern/moddi3.c
+++ b/sys/libkern/moddi3.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: moddi3.c,v 1.5 1997/02/22 09:39:56 peter Exp $
+ * $Id$
*/
#include <libkern/quad.h>
@@ -57,7 +57,7 @@ __moddi3(a, b)
else
ua = a, neg = 0;
if (b < 0)
- ub = -(u_quad_t)b;
+ ub = -(u_quad_t)b, neg ^= 1;
else
ub = b;
(void)__qdivrem(ua, ub, &ur);
diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c
index 4e3853ce54c50..6e810f8071a6e 100644
--- a/sys/miscfs/deadfs/dead_vnops.c
+++ b/sys/miscfs/deadfs/dead_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93
- * $Id: dead_vnops.c,v 1.24 1998/08/23 11:43:29 bde Exp $
+ * $Id: dead_vnops.c,v 1.23 1997/12/15 03:09:44 wollman Exp $
*/
#include <sys/param.h>
@@ -188,7 +188,7 @@ dead_ioctl(ap)
{
if (!chkvnlock(ap->a_vp))
- return (ENOTTY);
+ return (EBADF);
return (VCALL(ap->a_vp, VOFFSET(vop_ioctl), ap));
}
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c
index 7839645da0ac4..c43a01109d299 100644
--- a/sys/miscfs/devfs/devfs_tree.c
+++ b/sys/miscfs/devfs/devfs_tree.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfs_tree.c,v 1.57 1998/11/26 18:50:23 eivind Exp $
+ * $Id: devfs_tree.c,v 1.55 1998/07/04 22:30:22 julian Exp $
*/
@@ -56,7 +56,7 @@ static MALLOC_DEFINE(M_DEVFSNODE, "DEVFS node", "DEVFS node");
static MALLOC_DEFINE(M_DEVFSNAME, "DEVFS name", "DEVFS name");
devnm_p dev_root; /* root of the backing tree */
-static struct mount *devfs_hidden_mount;
+struct mount *devfs_hidden_mount;
int devfs_up_and_going;
/*
@@ -1129,7 +1129,7 @@ devfs_add_devswf(void *devsw, int minor, int chrblk, uid_t uid,
* this function is exported.. see sys/devfsext.h *
\***********************************************************************/
void *
-devfs_makelink(void *original, char *fmt, ...)
+devfs_link(void *original, char *fmt, ...)
{
devnm_p new_dev;
devnm_p orig = (devnm_p) original;
diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c
index 95ae9579719bf..f2751708b8a5f 100644
--- a/sys/miscfs/devfs/devfs_vfsops.c
+++ b/sys/miscfs/devfs/devfs_vfsops.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfs_vfsops.c,v 1.34 1998/10/31 15:31:23 peter Exp $
+ * $Id: devfs_vfsops.c,v 1.32 1998/09/07 13:17:00 bde Exp $
*
*/
@@ -258,6 +258,7 @@ static int
devfs_sync(struct mount *mp, int waitfor,struct ucred *cred,struct proc *p)
{
register struct vnode *vp, *nvp;
+ struct timeval tv;
int error, allerror = 0;
DBPRINT(("sync "));
@@ -281,7 +282,7 @@ loop:
nvp = vp->v_mntvnodes.le_next;
if (VOP_ISLOCKED(vp))
continue;
- if (TAILQ_EMPTY(&vp->v_dirtyblkhd))
+ if ( vp->v_dirtyblkhd.lh_first == NULL)
continue;
if (vp->v_type == VBLK) {
if (vget(vp, LK_EXCLUSIVE, p))
@@ -293,8 +294,6 @@ loop:
}
#ifdef NOTYET
else {
- struct timeval tv;
-
tv = time;
/* VOP_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */
VOP_UPDATE(vp, &tv, &tv, 0);
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c
index e9bdc2a36c72c..213a8677c4de2 100644
--- a/sys/miscfs/devfs/devfs_vnops.c
+++ b/sys/miscfs/devfs/devfs_vnops.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfs_vnops.c,v 1.64 1998/12/15 23:46:59 eivind Exp $
+ * $Id: devfs_vnops.c,v 1.60 1998/09/04 08:06:56 dfr Exp $
*/
@@ -639,6 +639,9 @@ devfs_xwrite(struct vop_write_args *ap)
struct ucred *a_cred;
} */
{
+ dn_p file_node;
+ int error;
+
switch (ap->a_vp->v_type) {
case VREG:
return(EINVAL);
@@ -1285,6 +1288,16 @@ devfs_print(struct vop_print_args *ap)
* pseudo ops *
\**************************************************************************/
+/*
+ * /devfs vnode unsupported operation
+ */
+static int
+devfs_enotsupp(void *junk)
+{
+
+ return (EOPNOTSUPP);
+}
+
/*proto*/
void
devfs_dropvnode(dn_p dnp)
@@ -1324,7 +1337,8 @@ static int
devfs_open( struct vop_open_args *ap)
{
struct proc *p = ap->a_p;
- struct vnode *vp = ap->a_vp;
+ struct vnode *bvp, *vp = ap->a_vp;
+ dev_t bdev, dev = (dev_t)vp->v_rdev;
int error;
dn_p dnp;
@@ -1373,7 +1387,7 @@ devfs_read( struct vop_read_args *ap)
daddr_t bn, nextbn;
long bsize, bscale;
struct partinfo dpart;
- int n, on;
+ int n, on, majordev;
d_ioctl_t *ioctl;
int error = 0;
dev_t dev;
@@ -1519,11 +1533,11 @@ devfs_write( struct vop_write_args *ap)
bp = getblk(vp, bn, bsize, 0, 0);
else
error = bread(vp, bn, bsize, NOCRED, &bp);
+ n = min(n, bsize - bp->b_resid);
if (error) {
brelse(bp);
return (error);
}
- n = min(n, bsize - bp->b_resid);
error = uiomove((char *)bp->b_data + on, n, uio);
if (n + on == bsize)
bawrite(bp);
@@ -1641,8 +1655,8 @@ devfs_fsync(struct vop_fsync_args *ap)
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -1664,7 +1678,7 @@ loop:
(void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0);
}
#ifdef DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("devfs_fsync: dirty", vp);
splx(s);
goto loop;
@@ -1763,8 +1777,11 @@ static int
devfs_close(struct vop_close_args *ap)
{
register struct vnode *vp = ap->a_vp;
- int error;
- dn_p dnp;
+ struct proc *p = ap->a_p;
+ dev_t dev = vp->v_rdev;
+ d_close_t *devclose;
+ int mode, error;
+ dn_p dnp;
if (error = devfs_vntodn(vp,&dnp))
return error;
diff --git a/sys/miscfs/devfs/devfsdefs.h b/sys/miscfs/devfs/devfsdefs.h
index 43ae38b5d5579..9144c3dd925e3 100644
--- a/sys/miscfs/devfs/devfsdefs.h
+++ b/sys/miscfs/devfs/devfsdefs.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfsdefs.h,v 1.17 1998/09/30 20:33:46 sos Exp $
+ * $Id: devfsdefs.h,v 1.16 1998/07/05 23:10:22 julian Exp $
*/
#ifdef DEVFS_DEBUG
#define DBPRINT(A) printf(A)
@@ -202,6 +202,7 @@ struct dev_vn_data
devnm_p back;
};
+extern struct vnodeops spec_vnodeops,devfs_vnodeops;
/*
* Prototypes for DEVFS virtual filesystem operations
*/
diff --git a/sys/miscfs/fdesc/fdesc_vfsops.c b/sys/miscfs/fdesc/fdesc_vfsops.c
index 881be49c8168d..de6f03d062e47 100644
--- a/sys/miscfs/fdesc/fdesc_vfsops.c
+++ b/sys/miscfs/fdesc/fdesc_vfsops.c
@@ -35,7 +35,7 @@
*
* @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94
*
- * $Id: fdesc_vfsops.c,v 1.16 1998/09/07 13:17:00 bde Exp $
+ * $Id: fdesc_vfsops.c,v 1.15 1998/05/06 05:29:33 msmith Exp $
*/
/*
@@ -55,8 +55,13 @@
static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure");
+static int fdesc_fhtovp __P((struct mount *mp, struct fid *fhp,
+ struct mbuf *nam, struct vnode **vpp,
+ int *exflagsp, struct ucred **credanonp));
static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
+static int fdesc_quotactl __P((struct mount *mp, int cmd, uid_t uid,
+ caddr_t arg, struct proc *p));
static int fdesc_start __P((struct mount *mp, int flags, struct proc *p));
static int fdesc_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
@@ -64,6 +69,9 @@ static int fdesc_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int fdesc_sync __P((struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
+static int fdesc_vget __P((struct mount *mp, ino_t ino,
+ struct vnode **vpp));
+static int fdesc_vptofh __P((struct vnode *vp, struct fid *fhp));
/*
* Mount the per-process file descriptors (/dev/fd)
diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c
index fb8f4a169f25f..a8ec1765814c3 100644
--- a/sys/miscfs/fdesc/fdesc_vnops.c
+++ b/sys/miscfs/fdesc/fdesc_vnops.c
@@ -35,7 +35,7 @@
*
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
*
- * $Id: fdesc_vnops.c,v 1.39 1998/12/07 21:58:31 archie Exp $
+ * $Id: fdesc_vnops.c,v 1.37 1998/06/10 21:21:28 dfr Exp $
*/
/*
@@ -84,6 +84,8 @@ static int fdesc_attr __P((int fd, struct vattr *vap, struct ucred *cred,
struct proc *p));
static int fdesc_badop __P((void));
static int fdesc_getattr __P((struct vop_getattr_args *ap));
+static struct fdcache *
+ fdesc_hash __P((int ix));
static int fdesc_inactive __P((struct vop_inactive_args *ap));
static int fdesc_ioctl __P((struct vop_ioctl_args *ap));
static int fdesc_lookup __P((struct vop_lookup_args *ap));
@@ -193,7 +195,7 @@ fdesc_lookup(ap)
char *pname = cnp->cn_nameptr;
struct proc *p = cnp->cn_proc;
int nfiles = p->p_fd->fd_nfiles;
- unsigned fd = -1;
+ unsigned fd;
int error;
struct vnode *fvp;
char *ln;
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c
index 49f7288f69094..c30ed0147f92a 100644
--- a/sys/miscfs/kernfs/kernfs_vfsops.c
+++ b/sys/miscfs/kernfs/kernfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95
- * $Id: kernfs_vfsops.c,v 1.23 1998/09/07 13:17:01 bde Exp $
+ * $Id: kernfs_vfsops.c,v 1.22 1998/05/06 05:29:33 msmith Exp $
*/
/*
@@ -56,6 +56,7 @@ static MALLOC_DEFINE(M_KERNFSMNT, "KERNFS mount", "KERNFS mount structure");
dev_t rrootdev = NODEV;
+static int cdevvp __P((dev_t dev, struct vnode **vpp));
static void kernfs_get_rrootdev __P((void));
static int kernfs_init __P((struct vfsconf *vfsp));
static int kernfs_mount __P((struct mount *mp, char *path, caddr_t data,
diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c
index 81261a9009208..4280ef1db733b 100644
--- a/sys/miscfs/kernfs/kernfs_vnops.c
+++ b/sys/miscfs/kernfs/kernfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95
- * $Id: kernfs_vnops.c,v 1.36 1998/12/04 22:54:51 archie Exp $
+ * $Id: kernfs_vnops.c,v 1.34 1998/06/25 16:54:18 dt Exp $
*/
/*
@@ -106,9 +106,11 @@ static int nkern_targets = sizeof(kern_targets) / sizeof(kern_targets[0]);
static int kernfs_access __P((struct vop_access_args *ap));
static int kernfs_badop __P((void));
+static int kernfs_enotsupp __P((void));
static int kernfs_getattr __P((struct vop_getattr_args *ap));
static int kernfs_inactive __P((struct vop_inactive_args *ap));
static int kernfs_lookup __P((struct vop_lookup_args *ap));
+static int kernfs_pathconf __P((struct vop_pathconf_args *ap));
static int kernfs_print __P((struct vop_print_args *ap));
static int kernfs_read __P((struct vop_read_args *ap));
static int kernfs_readdir __P((struct vop_readdir_args *ap));
@@ -131,13 +133,13 @@ kernfs_xread(kt, buf, len, lenp)
case KTT_TIME: {
struct timeval tv;
microtime(&tv);
- snprintf(buf, len, "%ld %ld\n", tv.tv_sec, tv.tv_usec);
+ sprintf(buf, "%ld %ld\n", tv.tv_sec, tv.tv_usec);
break;
}
case KTT_INT: {
int *ip = kt->kt_data;
- snprintf(buf, len, "%d\n", *ip);
+ sprintf(buf, "%d\n", *ip);
break;
}
@@ -179,7 +181,7 @@ kernfs_xread(kt, buf, len, lenp)
}
case KTT_AVENRUN:
- snprintf(buf, len, "%lu %lu %lu %ld\n",
+ sprintf(buf, "%lu %lu %lu %ld\n",
(u_long)averunnable.ldavg[0], (u_long)averunnable.ldavg[1],
(u_long)averunnable.ldavg[2], averunnable.fscale);
break;
@@ -233,6 +235,7 @@ kernfs_lookup(ap)
struct proc *p = cnp->cn_proc;
struct kern_target *kt;
struct vnode *fvp;
+ int nameiop = cnp->cn_nameiop;
int error, i;
#ifdef KERNFS_DIAGNOSTIC
@@ -371,6 +374,7 @@ kernfs_getattr(ap)
{
struct vnode *vp = ap->a_vp;
struct vattr *vap = ap->a_vap;
+ struct timeval tv;
int error = 0;
char strbuf[KSTRING];
@@ -455,6 +459,7 @@ kernfs_read(ap)
char strbuf[KSTRING];
int off = uio->uio_offset;
int error, len;
+ char *cp;
if (vp->v_type == VDIR)
return (EOPNOTSUPP);
diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c
index b2e1b63af9553..1398e34325394 100644
--- a/sys/miscfs/nullfs/null_vnops.c
+++ b/sys/miscfs/nullfs/null_vnops.c
@@ -37,11 +37,11 @@
*
* Ancestors:
* @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
- * $Id: null_vnops.c,v 1.29 1998/07/04 20:45:33 julian Exp $
+ * $Id: null_vnops.c,v 1.28 1998/06/10 06:34:56 peter Exp $
* ...and...
* @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
*
- * $Id: null_vnops.c,v 1.29 1998/07/04 20:45:33 julian Exp $
+ * $Id: null_vnops.c,v 1.28 1998/06/10 06:34:56 peter Exp $
*/
/*
@@ -523,6 +523,8 @@ null_unlock(ap)
struct proc *a_p;
} */ *ap;
{
+ struct vnode *vp = ap->a_vp;
+
vop_nounlock(ap);
ap->a_flags &= ~LK_INTERLOCK;
return (null_bypass((struct vop_generic_args *)ap));
diff --git a/sys/miscfs/portal/portal_vnops.c b/sys/miscfs/portal/portal_vnops.c
index 819d636a20c23..11a1e84a1a487 100644
--- a/sys/miscfs/portal/portal_vnops.c
+++ b/sys/miscfs/portal/portal_vnops.c
@@ -35,7 +35,7 @@
*
* @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95
*
- * $Id: portal_vnops.c,v 1.34 1998/12/07 21:58:32 archie Exp $
+ * $Id: portal_vnops.c,v 1.32 1998/06/10 06:34:57 peter Exp $
*/
/*
@@ -68,6 +68,7 @@ static int portal_fileid = PORTAL_ROOTFILEID+1;
static int portal_badop __P((void));
static void portal_closefd __P((struct proc *p, int fd));
static int portal_connect __P((struct socket *so, struct socket *so2));
+static int portal_enotsupp __P((void));
static int portal_getattr __P((struct vop_getattr_args *ap));
static int portal_inactive __P((struct vop_inactive_args *ap));
static int portal_lookup __P((struct vop_lookup_args *ap));
@@ -444,6 +445,7 @@ portal_getattr(ap)
{
struct vnode *vp = ap->a_vp;
struct vattr *vap = ap->a_vap;
+ struct timeval tv;
bzero(vap, sizeof(*vap));
vattr_null(vap);
@@ -575,6 +577,16 @@ portal_print(ap)
/*
+ * Portal vnode unsupported operation
+ */
+static int
+portal_enotsupp()
+{
+
+ return (EOPNOTSUPP);
+}
+
+/*
* Portal "should never get here" operation
*/
static int
diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h
index 619e1b23ed8b4..b727e16543aa0 100644
--- a/sys/miscfs/procfs/procfs.h
+++ b/sys/miscfs/procfs/procfs.h
@@ -37,7 +37,7 @@
* @(#)procfs.h 8.9 (Berkeley) 5/14/95
*
* From:
- * $Id: procfs.h,v 1.20 1998/07/07 04:08:44 bde Exp $
+ * $Id: procfs.h,v 1.19 1998/05/19 00:00:13 tegge Exp $
*/
/*
@@ -56,8 +56,7 @@ typedef enum {
Pnote, /* process notifier */
Pnotepg, /* process group notifier */
Pmap, /* memory map */
- Ptype, /* executable type */
- Pcmdline /* command line */
+ Ptype /* executable type */
} pfstype;
/*
@@ -155,7 +154,6 @@ int procfs_doctl __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct
int procfs_dostatus __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
int procfs_domap __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
int procfs_dotype __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
-int procfs_docmdline __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio));
/* Return 1 if process has special kernel digging privileges */
int procfs_kmemaccess __P((struct proc *));
diff --git a/sys/miscfs/procfs/procfs_map.c b/sys/miscfs/procfs/procfs_map.c
index 4dae10a6fdc0e..1a865e6690427 100644
--- a/sys/miscfs/procfs/procfs_map.c
+++ b/sys/miscfs/procfs/procfs_map.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
- * $Id: procfs_map.c,v 1.17 1998/04/29 04:28:22 dyson Exp $
+ * $Id: procfs_map.c,v 1.16 1998/02/06 12:13:41 eivind Exp $
*/
#include <sys/param.h>
@@ -153,8 +153,7 @@ case OBJT_DEVICE:
* format:
* start, end, resident, private resident, cow, access, type.
*/
- snprintf(mebuffer, sizeof(mebuffer),
- "0x%x 0x%x %d %d %d %s%s%s %d %d 0x%x %s %s %s\n",
+ sprintf(mebuffer, "0x%x 0x%x %d %d %d %s%s%s %d %d 0x%x %s %s %s\n",
entry->start, entry->end,
resident, privateresident, id,
(entry->protection & VM_PROT_READ)?"r":"-",
diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c
index 22d8f74228764..c1012f1cb2535 100644
--- a/sys/miscfs/procfs/procfs_mem.c
+++ b/sys/miscfs/procfs/procfs_mem.c
@@ -37,7 +37,7 @@
*
* @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94
*
- * $Id: procfs_mem.c,v 1.34 1998/07/15 02:32:19 bde Exp $
+ * $Id: procfs_mem.c,v 1.33 1998/06/07 17:11:57 dfr Exp $
*/
/*
@@ -253,7 +253,7 @@ procfs_rwmem(curp, p, uio)
/*
* release the page and the object
*/
- vm_page_unwire(m, 1);
+ vm_page_unwire(m);
vm_object_deallocate(object);
object = NULL;
diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c
index 3176a64400644..3f1cccf39f3ec 100644
--- a/sys/miscfs/procfs/procfs_status.c
+++ b/sys/miscfs/procfs/procfs_status.c
@@ -37,7 +37,7 @@
* @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
*
* From:
- * $Id: procfs_status.c,v 1.11 1998/07/11 07:45:45 bde Exp $
+ * $Id: procfs_status.c,v 1.10 1997/08/02 14:32:17 bde Exp $
*/
#include <sys/param.h>
@@ -147,40 +147,3 @@ procfs_dostatus(curp, p, pfs, uio)
return (error);
}
-
-int
-procfs_docmdline(curp, p, pfs, uio)
- struct proc *curp;
- struct proc *p;
- struct pfsnode *pfs;
- struct uio *uio;
-{
- char *ps;
- int xlen;
- int error;
- char psbuf[256];
-
- if (uio->uio_rw != UIO_READ)
- return (EOPNOTSUPP);
-
- /*
- * For now, this is a hack. To implement this fully would require
- * groping around in the process address space to follow argv etc.
- */
- ps = psbuf;
- bcopy(p->p_comm, ps, MAXCOMLEN);
- ps[MAXCOMLEN] = '\0';
- ps += strlen(ps);
-
- ps += sprintf(ps, "\n");
-
- xlen = ps - psbuf;
- xlen -= uio->uio_offset;
- ps = psbuf + uio->uio_offset;
- xlen = min(xlen, uio->uio_resid);
- if (xlen <= 0)
- error = 0;
- else
- error = uiomove(ps, xlen, uio);
- return (error);
-}
diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c
index 813232cb5fb32..2156b12b04533 100644
--- a/sys/miscfs/procfs/procfs_subr.c
+++ b/sys/miscfs/procfs/procfs_subr.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95
*
- * $Id: procfs_subr.c,v 1.21 1997/12/12 03:33:43 sef Exp $
+ * $Id: procfs_subr.c,v 1.20 1997/12/09 05:03:41 sef Exp $
*/
#include <sys/param.h>
@@ -181,7 +181,6 @@ loop:
case Ptype:
case Pmap:
case Pstatus:
- case Pcmdline:
pfs->pfs_mode = (VREAD) |
(VREAD >> 3) |
(VREAD >> 6);
@@ -283,10 +282,6 @@ procfs_rw(ap)
rtval = procfs_dotype(curp, p, pfs, uio);
break;
- case Pcmdline:
- rtval = procfs_docmdline(curp, p, pfs, uio);
- break;
-
default:
rtval = EOPNOTSUPP;
break;
diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c
index daab08f2c2408..8a6230eabf015 100644
--- a/sys/miscfs/procfs/procfs_vnops.c
+++ b/sys/miscfs/procfs/procfs_vnops.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95
*
- * $Id: procfs_vnops.c,v 1.62 1998/12/04 22:54:51 archie Exp $
+ * $Id: procfs_vnops.c,v 1.60 1998/06/25 16:54:41 dt Exp $
*/
/*
@@ -101,7 +101,6 @@ static struct proc_target {
{ DT_REG, N("notepg"), Pnotepg, NULL },
{ DT_REG, N("map"), Pmap, procfs_validmap },
{ DT_REG, N("etype"), Ptype, procfs_validtype },
- { DT_REG, N("cmdline"), Pcmdline, NULL },
#undef N
};
static const int nproc_targets = sizeof(proc_targets) / sizeof(proc_targets[0]);
@@ -529,7 +528,7 @@ procfs_getattr(ap)
vap->va_uid = 0;
vap->va_gid = 0;
vap->va_size = vap->va_bytes =
- snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid);
+ sprintf(buf, "%ld", (long)curproc->p_pid);
break;
}
@@ -574,7 +573,6 @@ procfs_getattr(ap)
case Pstatus:
case Pnote:
case Pnotepg:
- case Pcmdline:
vap->va_nlink = 1;
vap->va_uid = procp->p_ucred->cr_uid;
vap->va_gid = procp->p_ucred->cr_gid;
@@ -946,7 +944,7 @@ procfs_readlink(ap)
if (VTOPFS(ap->a_vp)->pfs_fileno != PROCFS_FILENO(0, Pcurproc))
return (EINVAL);
- len = snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid);
+ len = sprintf(buf, "%ld", (long)curproc->p_pid);
return (uiomove((caddr_t)buf, len, ap->a_uio));
}
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index ff0f347546b7a..f32a9f15033ee 100644
--- a/sys/miscfs/specfs/spec_vnops.c
+++ b/sys/miscfs/specfs/spec_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95
- * $Id: spec_vnops.c,v 1.77 1998/12/07 21:58:33 archie Exp $
+ * $Id: spec_vnops.c,v 1.73 1998/09/05 14:13:12 phk Exp $
*/
#include <sys/param.h>
@@ -257,7 +257,7 @@ spec_read(ap)
daddr_t bn, nextbn;
long bsize, bscale;
struct partinfo dpart;
- int n, on;
+ int n, on, majordev;
d_ioctl_t *ioctl;
int error = 0;
dev_t dev;
@@ -285,7 +285,8 @@ spec_read(ap)
return (EINVAL);
bsize = BLKDEV_IOSIZE;
dev = vp->v_rdev;
- if ((ioctl = bdevsw[major(dev)]->d_ioctl) != NULL &&
+ if ((majordev = major(dev)) < nblkdev &&
+ (ioctl = bdevsw[majordev]->d_ioctl) != NULL &&
(*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 &&
dpart.part->p_fstype == FS_BSDFFS &&
dpart.part->p_frag != 0 && dpart.part->p_fsize != 0)
@@ -379,11 +380,11 @@ spec_write(ap)
bp = getblk(vp, bn, bsize, 0, 0);
else
error = bread(vp, bn, bsize, NOCRED, &bp);
+ n = min(n, bsize - bp->b_resid);
if (error) {
brelse(bp);
return (error);
}
- n = min(n, bsize - bp->b_resid);
error = uiomove((char *)bp->b_data + on, n, uio);
if (n + on == bsize)
bawrite(bp);
@@ -476,8 +477,8 @@ spec_fsync(ap)
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -499,7 +500,7 @@ loop:
(void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0);
}
#ifdef DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("spec_fsync: dirty", vp);
splx(s);
goto loop;
@@ -605,6 +606,7 @@ spec_close(ap)
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
+ struct proc *p = ap->a_p;
dev_t dev = vp->v_rdev;
d_close_t *devclose;
int mode, error;
diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c
index 4974f03c110c6..fc4d5eb4575ad 100644
--- a/sys/miscfs/umapfs/umap_subr.c
+++ b/sys/miscfs/umapfs/umap_subr.c
@@ -35,7 +35,7 @@
*
* @(#)umap_subr.c 8.9 (Berkeley) 5/14/95
*
- * $Id: umap_subr.c,v 1.15 1998/11/09 09:21:25 peter Exp $
+ * $Id: umap_subr.c,v 1.13 1998/02/09 06:09:48 eivind Exp $
*/
#include <sys/param.h>
@@ -259,7 +259,7 @@ umap_node_create(mp, targetvp, newvpp)
* Take another reference to the alias vnode
*/
#ifdef UMAPFS_DIAGNOSTIC
- vprint("umap_node_create: exists", aliasvp);
+ vprint("umap_node_create: exists", ap->umap_vnode);
#endif
/* VREF(aliasvp); */
} else {
@@ -352,18 +352,22 @@ umap_mapids(v_mount, credp)
struct mount *v_mount;
struct ucred *credp;
{
- int i;
+ int i, unentries, gnentries;
+ u_long *groupmap, *usermap;
uid_t uid;
gid_t gid;
if (credp == NOCRED)
return;
+ unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries;
+ usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]);
+ gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries;
+ groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]);
+
/* Find uid entry in map */
- uid = (uid_t) umap_findid(credp->cr_uid,
- MOUNTTOUMAPMOUNT(v_mount)->info_mapdata,
- MOUNTTOUMAPMOUNT(v_mount)->info_nentries);
+ uid = (uid_t) umap_findid(credp->cr_uid, usermap, unentries);
if (uid != -1)
credp->cr_uid = uid;
@@ -375,9 +379,7 @@ umap_mapids(v_mount, credp)
/* Find gid entry in map */
- gid = (gid_t) umap_findid(credp->cr_gid,
- MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata,
- MOUNTTOUMAPMOUNT(v_mount)->info_gnentries);
+ gid = (gid_t) umap_findid(credp->cr_gid, groupmap, gnentries);
if (gid != -1)
credp->cr_gid = gid;
@@ -391,8 +393,7 @@ umap_mapids(v_mount, credp)
i = 0;
while (credp->cr_groups[i] != 0) {
gid = (gid_t) umap_findid(credp->cr_groups[i],
- MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata,
- MOUNTTOUMAPMOUNT(v_mount)->info_gnentries);
+ groupmap, gnentries);
if (gid != -1)
credp->cr_groups[i++] = gid;
diff --git a/sys/miscfs/umapfs/umap_vnops.c b/sys/miscfs/umapfs/umap_vnops.c
index 893e1e54ad90d..a41a575bf4108 100644
--- a/sys/miscfs/umapfs/umap_vnops.c
+++ b/sys/miscfs/umapfs/umap_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)umap_vnops.c 8.6 (Berkeley) 5/22/95
- * $Id: umap_vnops.c,v 1.25 1998/07/30 17:40:45 bde Exp $
+ * $Id: umap_vnops.c,v 1.24 1998/07/04 20:45:34 julian Exp $
*/
/*
@@ -386,6 +386,8 @@ umap_unlock(ap)
struct proc *a_p;
} */ *ap;
{
+ struct vnode *vp = ap->a_vp;
+
vop_nounlock(ap);
ap->a_flags &= ~LK_INTERLOCK;
return (null_bypass((struct vop_generic_args *)ap));
diff --git a/sys/miscfs/union/union.h b/sys/miscfs/union/union.h
index 6a4aa226203e2..4deb6d42fa2cf 100644
--- a/sys/miscfs/union/union.h
+++ b/sys/miscfs/union/union.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union.h 8.9 (Berkeley) 12/10/94
- * $Id: union.h,v 1.12 1998/02/26 03:23:51 kato Exp $
+ * $Id: union.h,v 1.11 1998/02/10 03:32:03 kato Exp $
*/
struct union_args {
@@ -114,9 +114,6 @@ extern void union_removed_upper __P((struct union_node *un));
extern struct vnode *union_lowervp __P((struct vnode *));
extern void union_newsize __P((struct vnode *, off_t, off_t));
-extern int (*union_dircheckp) __P((struct proc *, struct vnode **,
- struct file *));
-
#define MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)->mnt_data))
#define VTOUNION(vp) ((struct union_node *)(vp)->v_data)
#define UNIONTOV(un) ((un)->un_vnode)
diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c
index 7559b6e205fb5..c54d86b6a4192 100644
--- a/sys/miscfs/union/union_subr.c
+++ b/sys/miscfs/union/union_subr.c
@@ -35,19 +35,16 @@
* SUCH DAMAGE.
*
* @(#)union_subr.c 8.20 (Berkeley) 5/20/95
- * $Id: union_subr.c,v 1.35 1998/12/07 21:58:34 archie Exp $
+ * $Id: union_subr.c,v 1.30 1998/05/07 04:58:36 msmith Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/vnode.h>
#include <sys/namei.h>
#include <sys/malloc.h>
#include <sys/fcntl.h>
-#include <sys/file.h>
#include <sys/filedesc.h>
-#include <sys/module.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <vm/vm.h>
@@ -307,9 +304,10 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp, docache)
struct union_node *un = 0;
struct vnode *xlowervp = NULLVP;
struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
- int hash = 0;
+ int hash;
int vflag;
int try;
+ int klocked;
if (uppervp == NULLVP && lowervp == NULLVP)
panic("union: unidentifiable allocation");
@@ -773,7 +771,7 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen)
vrele(dvp);
else {
zfree(namei_zone, cn->cn_pnbuf);
- cn->cn_pnbuf = NULL;
+ cn->cn_pnbuf = '\0';
}
return (error);
@@ -1140,79 +1138,3 @@ out:
VOP_UNLOCK(vp, 0, p);
return (nvp);
}
-
-/*
- * Module glue to remove #ifdef UNION from vfs_syscalls.c
- */
-static int
-union_dircheck(struct proc *p, struct vnode **vp, struct file *fp)
-{
- int error = 0;
-
- if ((*vp)->v_op == union_vnodeop_p) {
- struct vnode *lvp;
-
- lvp = union_dircache(*vp, p);
- if (lvp != NULLVP) {
- struct vattr va;
-
- /*
- * If the directory is opaque,
- * then don't show lower entries
- */
- error = VOP_GETATTR(*vp, &va, fp->f_cred, p);
- if (va.va_flags & OPAQUE) {
- vput(lvp);
- lvp = NULL;
- }
- }
-
- if (lvp != NULLVP) {
- error = VOP_OPEN(lvp, FREAD, fp->f_cred, p);
- if (error) {
- vput(lvp);
- return (error);
- }
- VOP_UNLOCK(lvp, 0, p);
- fp->f_data = (caddr_t) lvp;
- fp->f_offset = 0;
- error = vn_close(*vp, FREAD, fp->f_cred, p);
- if (error)
- return (error);
- *vp = lvp;
- return -1; /* goto unionread */
- }
- }
- if (((*vp)->v_flag & VROOT) && ((*vp)->v_mount->mnt_flag & MNT_UNION)) {
- struct vnode *tvp = *vp;
- *vp = (*vp)->v_mount->mnt_vnodecovered;
- VREF(*vp);
- fp->f_data = (caddr_t) *vp;
- fp->f_offset = 0;
- vrele(tvp);
- return -1; /* goto unionread */
- }
- return error;
-}
-
-static int
-union_modevent(module_t mod, int type, void *data)
-{
- switch (type) {
- case MOD_LOAD:
- union_dircheckp = union_dircheck;
- break;
- case MOD_UNLOAD:
- union_dircheckp = NULL;
- break;
- default:
- break;
- }
- return 0;
-}
-static moduledata_t union_mod = {
- "union_dircheck",
- union_modevent,
- NULL
-};
-DECLARE_MODULE(union_dircheck, union_mod, SI_SUB_VFS, SI_ORDER_ANY);
diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c
index 87fda6d6cc81e..2bcd1ee794f03 100644
--- a/sys/miscfs/union/union_vnops.c
+++ b/sys/miscfs/union/union_vnops.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
- * $Id: union_vnops.c,v 1.58 1998/07/04 20:45:35 julian Exp $
+ * $Id: union_vnops.c,v 1.57 1998/05/07 04:58:38 msmith Exp $
*/
#include <sys/param.h>
@@ -205,7 +205,7 @@ union_lookup(ap)
struct proc *p = cnp->cn_proc;
int lockparent = cnp->cn_flags & LOCKPARENT;
struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
- struct ucred *saved_cred = NULL;
+ struct ucred *saved_cred;
int iswhiteout;
struct vattr va;
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 90b5bb3cdd7ef..bc956d9b32bad 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -1,15 +1,14 @@
-# $Id: Makefile,v 1.46 1999/01/17 19:06:06 peter Exp $
+# $Id: Makefile,v 1.33 1998/09/28 05:38:22 grog Exp $
# XXX present but broken: ip_mroute_mod
-# XXX not yet completed porting: acd
-# XXX builds but not updated: atapi
-
-SUBDIR= ccd cd9660 coda fdesc if_disc if_ppp if_sl if_tun ipfw kernfs \
- mfs msdos nfs nullfs portal procfs umapfs union vinum
-
-# XXX some of these can move to the general case when de-i386'ed
-.if ${MACHINE_ARCH} == "i386"
-SUBDIR+=atapi coff fpu gnufpu ibcs2 joy linux lkm pcic splash syscons vesa
+# XXX not yet completed porting: pcic coda syscons/*
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR= atapi ccd cd9660 coff fdesc fpu gnufpu ibcs2 if_disc if_ppp if_sl \
+ if_tun ipfw joy kernfs linux mfs msdos nfs nullfs \
+ portal procfs syscons umapfs vesa vinum wcd
.endif
+# XXX builds, but not useable with present design
+#union
+
.include <bsd.subdir.mk>
diff --git a/sys/modules/coda/Makefile b/sys/modules/coda/Makefile
index f30ec7b464a24..9135235c6a472 100644
--- a/sys/modules/coda/Makefile
+++ b/sys/modules/coda/Makefile
@@ -1,18 +1,10 @@
-# $Id: Makefile,v 1.3 1998/10/16 04:30:42 peter Exp $
+# $Id: Makefile,v 1.2 1998/09/29 20:19:45 rvb Exp $
.PATH: ${.CURDIR}/../../coda
KMOD= coda
SRCS= coda_fbsd.c coda_namecache.c coda_psdev.c coda_subr.c \
- coda_venus.c coda_vfsops.c coda_vnops.c opt_devfs.h vcoda.h
+ coda_venus.c coda_vfsops.c coda_vnops.c
NOMAN=
VFS_KLD=
-CLEANFILES+= vcoda.h opt_devfs.h
-
-opt_devfs.h:
- touch opt_devfs.h
-
-vcoda.h:
- echo "#define NVCODA 4" > vcoda.h
-
.include <bsd.kmod.mk>
diff --git a/sys/modules/coff/Makefile b/sys/modules/coff/Makefile
index 759158538e9af..dbfd197030e0d 100644
--- a/sys/modules/coff/Makefile
+++ b/sys/modules/coff/Makefile
@@ -1,11 +1,11 @@
-# $Id: Makefile,v 1.7 1998/10/16 04:30:42 peter Exp $
+# $Id: Makefile,v 1.6 1998/03/12 20:04:38 eivind Exp $
.PATH: ${.CURDIR}/../../i386/ibcs2
KMOD= ibcs2_coff
SRCS= imgact_coff.c vnode_if.h
NOMAN=
-CLEANFILES+= vnode_if.h vnode_if.c
-CFLAGS+= -DCOMPAT_IBCS2
-KMODDEPS= ibcs2
+CLEANFILES+= vnode_if.h vnode_if.c
+CFLAGS+= -DCOMPAT_IBCS2
+DEPLKMS=${.OBJDIR}/../ibcs2/ibcs2_mod.o
.include <bsd.kmod.mk>
diff --git a/sys/modules/ibcs2/Makefile b/sys/modules/ibcs2/Makefile
index 9bb8a5b303bfe..3f42872ab0728 100644
--- a/sys/modules/ibcs2/Makefile
+++ b/sys/modules/ibcs2/Makefile
@@ -1,8 +1,8 @@
-# $Id: Makefile,v 1.22 1998/11/11 07:04:10 peter Exp $
+# $Id: Makefile,v 1.17 1998/02/06 23:54:20 eivind Exp $
.PATH: ${.CURDIR}/../../i386/ibcs2
KMOD= ibcs2
-SRCS= ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \
+SRCS= ibcs2.c ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \
ibcs2_fcntl.c ibcs2_signal.c ibcs2_sysent.c ibcs2_ioctl.c \
ibcs2_socksys.c ibcs2_util.c ibcs2_xenix.c ibcs2_xenix_sysent.c \
ibcs2_isc.c ibcs2_isc_sysent.c \
@@ -19,6 +19,6 @@ opt_spx_hack.h:
afterinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/ibcs2.sh ${DESTDIR}/usr/bin/ibcs2
+ ${.CURDIR}/ibcs2 ${DESTDIR}/usr/bin
.include <bsd.kmod.mk>
diff --git a/sys/modules/ibcs2/ibcs2.sh b/sys/modules/ibcs2/ibcs2
index 0fd465fa023e1..a649885512ea0 100644..100755
--- a/sys/modules/ibcs2/ibcs2.sh
+++ b/sys/modules/ibcs2/ibcs2
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: ibcs2,v 1.7 1997/02/22 12:47:59 peter Exp $
+# $Id$
PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH
@@ -35,9 +35,18 @@ fi
set -e
-kldload ibcs2
+kernelfile=`sysctl -n kern.bootfile`
+kernelfile=`basename $kernelfile`
+newkernelfile="/tmp/_${kernelfile}+ibcs2$$"
+
+trap 'rm -f $newkernelfile; exit 1' 1 2 3 13 15
+
+rm -f $newkernelfile
+modload -e ibcs2_mod -o $newkernelfile -q /lkm/ibcs2_mod.o
for loader in $LOADERS; do
- kldload ibcs2_${loader}
+ modload -e ibcs2_${loader}_mod -o/tmp/ibcs2_${loader} -q -u \
+ -A${newkernelfile} /lkm/ibcs2_${loader}_mod.o
done
+rm -f ${newkernelfile}
set +e
diff --git a/sys/i386/isa/syscons_isa.c b/sys/modules/ibcs2/ibcs2.c
index e96542fba603e..2bd5fb62ec8fc 100644
--- a/sys/i386/isa/syscons_isa.c
+++ b/sys/modules/ibcs2/ibcs2.c
@@ -1,16 +1,18 @@
/*-
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
+ * Copyright (c) 1994 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software withough specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -23,52 +25,40 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id:$
+ * $Id: ibcs2.c,v 1.11 1997/05/01 06:09:01 jkh Exp $
*/
-#include "sc.h"
-#include "opt_syscons.h"
-
-#if NSC > 0
-
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
+#include <sys/sysproto.h>
#include <sys/conf.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
-#include <machine/console.h>
-#include <machine/apm_bios.h>
-
-#include <dev/syscons/syscons.h>
-
-#include <i386/isa/isa_device.h>
-
-static int scprobe(struct isa_device *dev);
-static int scattach(struct isa_device *dev);
-
-struct isa_driver scdriver = {
- scprobe,
- scattach,
- "sc",
- 1
-};
+#include <sys/kernel.h>
+#include <sys/module.h>
static int
-scprobe(struct isa_device *dev)
+ibcs2_modevent(module_t mod, modeventtype_t type, void *unused)
{
- int error;
-
- error = sc_probe_unit(dev->id_unit, dev->id_flags);
- return ((error == 0) ? -1 : 0);
+ switch (type) {
+ case MOD_LOAD:
+ printf("ibcs2 module loaded\n");
+ break;
+ case MOD_UNLOAD:
+ printf("ibcs2 module unloaded\n");
+ break;
+ default:
+ printf("ibcs2 module unknown event: 0x%x\n", type);
+ }
+ return 0;
}
-static int
-scattach(struct isa_device *dev)
-{
- int error;
-
- error = sc_attach_unit(dev->id_unit, dev->id_flags);
- return ((error == 0) ? 0 : 1);
-}
+moduledata_t ibcs2mod = {
+ "ibcs2",
+ ibcs2_modevent,
+ 0
+};
-#endif /* NSC > 0 */
+DECLARE_MODULE(ibcs2, ibcs2mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
diff --git a/sys/modules/if_ppp/Makefile b/sys/modules/if_ppp/Makefile
index 97c3b3c2df725..34b90d8ec4eaa 100644
--- a/sys/modules/if_ppp/Makefile
+++ b/sys/modules/if_ppp/Makefile
@@ -1,11 +1,10 @@
-# $Id: Makefile,v 1.15 1998/10/16 04:30:44 peter Exp $
+# $Id: Makefile,v 1.14 1998/03/27 04:05:08 peter Exp $
.PATH: ${.CURDIR}/../../net
KMOD= if_ppp
SRCS= if_ppp.c ppp_tty.c slcompress.c \
- bpfilter.h ppp.h opt_inet.h opt_ipx.h opt_ppp.h vnode_if.h
+ bpfilter.h ppp.h opt_inet.h opt_ipx.h opt_ppp.h
NOMAN=
-CLEANFILES+= vnode_if.c vnode_if.h
NPPP?= 2
PPP_BSDCOMP?= 1 # 0/1
diff --git a/sys/modules/if_tun/Makefile b/sys/modules/if_tun/Makefile
index 7fadb7fa71266..2581e361e23d7 100644
--- a/sys/modules/if_tun/Makefile
+++ b/sys/modules/if_tun/Makefile
@@ -1,10 +1,9 @@
-# $Id: Makefile,v 1.7 1998/10/16 04:30:45 peter Exp $
+# $Id: Makefile,v 1.6 1998/02/01 18:12:14 bde Exp $
.PATH: ${.CURDIR}/../../net
KMOD= if_tun
-SRCS= if_tun.c bpfilter.h opt_devfs.h opt_inet.h tun.h vnode_if.h
+SRCS= if_tun.c bpfilter.h opt_devfs.h opt_inet.h tun.h
NOMAN=
-CLEANFILES+= vnode_if.h vnode_if.c
NBPFILTER?= 0
NTUN?= 2
diff --git a/sys/modules/joy/Makefile b/sys/modules/joy/Makefile
index 335833f31b1dd..ebbf4c9f47780 100644
--- a/sys/modules/joy/Makefile
+++ b/sys/modules/joy/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 1998/11/11 07:04:10 peter Exp $
+# $Id: Makefile,v 1.7 1998/02/01 18:12:15 bde Exp $
.PATH: ${.CURDIR}/../../i386/isa
KMOD = joy
@@ -17,6 +17,6 @@ opt_devfs.h:
afterinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/joy.sh ${DESTDIR}/usr/bin/joy
+ ${.CURDIR}/joy ${DESTDIR}/usr/bin
.include <bsd.kmod.mk>
diff --git a/sys/modules/joy/joy b/sys/modules/joy/joy
new file mode 100644
index 0000000000000..3f5bbb96ab093
--- /dev/null
+++ b/sys/modules/joy/joy
@@ -0,0 +1,4 @@
+#!/bin/sh
+# $Id$
+
+modload -q -u -A `sysctl -n kern.bootfile` /lkm/joy_mod.o
diff --git a/sys/modules/joy/joy.sh b/sys/modules/joy/joy.sh
deleted file mode 100644
index 3f165a6aa2a16..0000000000000
--- a/sys/modules/joy/joy.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $Id: joy,v 1.3 1997/02/22 12:48:17 peter Exp $
-
-kldload joy
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index ed7bed5750ccd..090f2fc7e72c0 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.23 1998/11/11 07:04:10 peter Exp $
+# $Id: Makefile,v 1.18 1998/07/07 02:04:20 bde Exp $
.PATH: ${.CURDIR}/../../i386/linux
KMOD= linux
@@ -27,7 +27,7 @@ linux_genassym.o: linux_genassym.c linux.h @ machine
${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC}
linux_genassym: linux_genassym.o
- ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
opt_compat.h:
echo "#define COMPAT_43 1" > opt_compat.h
@@ -37,6 +37,6 @@ opt_linux.h opt_vmpage.h:
afterinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/linux.sh ${DESTDIR}/usr/bin/linux
+ ${.CURDIR}/linux ${DESTDIR}/usr/bin
.include <bsd.kmod.mk>
diff --git a/sys/modules/linux/linux b/sys/modules/linux/linux
new file mode 100644
index 0000000000000..9945a9908c5c0
--- /dev/null
+++ b/sys/modules/linux/linux
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# $Id: linux,v 1.4 1997/02/22 12:48:25 peter Exp $
+
+if modstat -n linux_mod > /dev/null ; then
+ echo Linux lkm already loaded
+ exit 1
+else
+ modload -e linux_mod -u -q -o /tmp/linux_mod /lkm/linux_mod.o
+fi
diff --git a/sys/modules/linux/linux.sh b/sys/modules/linux/linux.sh
deleted file mode 100644
index 8545fbbc47bc7..0000000000000
--- a/sys/modules/linux/linux.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# $Id: linux,v 1.5 1998/09/07 16:15:59 cracauer Exp $
-
-FOUND=`kldstat -v | egrep 'linux(aout|elf)'`
-
-if [ "x$FOUND" != x ] ; then
- echo Linux driver already loaded
- exit 1
-else
- kldload linux
-fi
diff --git a/sys/modules/lkm/Makefile b/sys/modules/lkm/Makefile
deleted file mode 100644
index ecf7d27dce59d..0000000000000
--- a/sys/modules/lkm/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# $Id: Makefile,v 1.11 1998/11/12 00:37:39 jkh Exp $
-
-.PATH: ${.CURDIR}/../../kern
-KMOD = lkm
-SRCS = kern_lkm.c vnode_if.h opt_devfs.h
-
-CLEANFILES += opt_devfs.h vnode_if.c vnode_if.h
-
-opt_devfs.h:
- touch opt_devfs.h
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/mfs/Makefile b/sys/modules/mfs/Makefile
index 6fde55f65ac30..d1fb29b7a273a 100644
--- a/sys/modules/mfs/Makefile
+++ b/sys/modules/mfs/Makefile
@@ -1,13 +1,13 @@
-# $Id: Makefile,v 1.4 1998/10/16 04:30:47 peter Exp $
+# $Id: Makefile,v 1.3 1997/02/22 12:48:36 peter Exp $
.PATH: ${.CURDIR}/../../ufs/mfs
KMOD= mfs
SRCS= mfs_vfsops.c mfs_vnops.c opt_mfs.h
NOMAN=
VFS_KLD=
-CLEANFILES+= opt_mfs.h
+CFLAGS+= -DFFS -DMFS
opt_mfs.h:
- touch ${.TARGET}
+ touch opt_mfs.h
.include <bsd.kmod.mk>
diff --git a/sys/modules/pcic/Makefile b/sys/modules/pcic/Makefile
index 550d58922a49d..0c8c2047bfcdf 100644
--- a/sys/modules/pcic/Makefile
+++ b/sys/modules/pcic/Makefile
@@ -1,8 +1,9 @@
-# $Id: Makefile,v 1.7 1998/10/16 04:30:48 peter Exp $
+# $Id: Makefile,v 1.6 1997/02/22 12:48:45 peter Exp $
.PATH: ${.CURDIR}/../../pccard
KMOD= pcic
SRCS= pcic.c
NOMAN=
+CFLAGS+= -DLKM
.include <bsd.kmod.mk>
diff --git a/sys/modules/splash/Makefile b/sys/modules/splash/Makefile
deleted file mode 100644
index 39a292e7c6bf4..0000000000000
--- a/sys/modules/splash/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $Id: $
-
-SUBDIR= bmp
-
-.include <bsd.subdir.mk>
diff --git a/sys/modules/splash/Makefile.inc b/sys/modules/splash/Makefile.inc
deleted file mode 100644
index 64212f6bfa21d..0000000000000
--- a/sys/modules/splash/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id: $
-
-.include "../Makefile.inc"
diff --git a/sys/modules/splash/bmp/Makefile b/sys/modules/splash/bmp/Makefile
deleted file mode 100644
index 798e7e4283894..0000000000000
--- a/sys/modules/splash/bmp/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# $Id: $
-
-KMOD= splash_bmp
-SRCS= splash_bmp.c
-
-NOMAN=
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/splash/bmp/splash_bmp.c b/sys/modules/splash/bmp/splash_bmp.c
deleted file mode 100644
index 03192c697e391..0000000000000
--- a/sys/modules/splash/bmp/splash_bmp.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/*-
- * Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 1999 Kazutaka YOKOTA <yokota@freebsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: splash_bmp.c,v 1.2 1999/01/11 17:32:22 yokota Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/linker.h>
-
-#include <machine/console.h>
-
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
-
-#define FADE_TIMEOUT 300 /* sec */
-
-static int splash_mode = -1;
-static int splash_on = FALSE;
-
-static int bmp_start(video_adapter_t *adp);
-static int bmp_end(video_adapter_t *adp);
-static int bmp_splash(video_adapter_t *adp, int on);
-static int bmp_Init(const char *data, int swidth, int sheight, int sdepth);
-static int bmp_Draw(video_adapter_t *adp);
-
-static splash_decoder_t bmp_decoder = {
- "splash_bmp", bmp_start, bmp_end, bmp_splash, SPLASH_IMAGE,
-};
-
-SPLASH_DECODER(splash_bmp, bmp_decoder);
-
-static int
-bmp_start(video_adapter_t *adp)
-{
- static int modes[] = {
- M_VGA_CG320,
- -1,
- };
- video_info_t info;
- int i;
-
- if ((bmp_decoder.data == NULL) || (bmp_decoder.data_size <= 0))
- return ENODEV;
- for (i = 0; modes[i] >= 0; ++i) {
- if (((*vidsw[adp->va_index]->get_info)(adp, modes[i], &info) == 0)
- && (bmp_Init((u_char *)bmp_decoder.data,
- info.vi_width, info.vi_height, info.vi_depth) == 0))
- break;
- }
- splash_mode = modes[i];
- if (bootverbose)
- printf("bmp_start(): splash_mode:%d\n", splash_mode);
- return ((splash_mode < 0) ? ENODEV : 0);
-}
-
-static int
-bmp_end(video_adapter_t *adp)
-{
- /* nothing to do */
- return 0;
-}
-
-static int
-bmp_splash(video_adapter_t *adp, int on)
-{
- static u_char pal[256*3];
- static long time_stamp;
- struct timeval tv;
- int i;
-
- if (on) {
- if (!splash_on) {
- /* set up the video mode and draw something */
- if ((*vidsw[adp->va_index]->set_mode)(adp, splash_mode))
- return 1;
- if (bmp_Draw(adp))
- return 1;
- (*vidsw[adp->va_index]->save_palette)(adp, pal);
- time_stamp = 0;
- splash_on = TRUE;
- }
- /*
- * This is a kludge to fade the image away. This section of the
- * code takes effect only after the system is completely up.
- */
- if (!cold) {
- getmicrotime(&tv);
- if (time_stamp == 0)
- time_stamp = tv.tv_sec;
- if (tv.tv_sec > time_stamp + FADE_TIMEOUT) {
- for (i = 0; i < sizeof(pal); ++i) {
- if (pal[i] > 40)
- pal[i] -= 4;
- }
- (*vidsw[adp->va_index]->load_palette)(adp, pal);
- }
- }
- return 0;
- } else {
- /* the video mode will be restored by the caller */
- splash_on = FALSE;
- return 0;
- }
-}
-
-/*
-** Code to handle Microsoft DIB (".BMP") format images.
-**
-** Blame me (msmith@freebsd.org) if this is broken, not Soren.
-*/
-
-typedef struct tagBITMAPFILEHEADER { /* bmfh */
- u_short bfType __attribute__ ((packed));
- int bfSize __attribute__ ((packed));
- u_short bfReserved1 __attribute__ ((packed));
- u_short bfReserved2 __attribute__ ((packed));
- int bfOffBits __attribute__ ((packed));
-} BITMAPFILEHEADER;
-
-typedef struct tagBITMAPINFOHEADER { /* bmih */
- int biSize __attribute__ ((packed));
- int biWidth __attribute__ ((packed));
- int biHeight __attribute__ ((packed));
- short biPlanes __attribute__ ((packed));
- short biBitCount __attribute__ ((packed));
- int biCompression __attribute__ ((packed));
- int biSizeImage __attribute__ ((packed));
- int biXPelsPerMeter __attribute__ ((packed));
- int biYPelsPerMeter __attribute__ ((packed));
- int biClrUsed __attribute__ ((packed));
- int biClrImportant __attribute__ ((packed));
-} BITMAPINFOHEADER;
-
-typedef struct tagRGBQUAD { /* rgbq */
- u_char rgbBlue __attribute__ ((packed));
- u_char rgbGreen __attribute__ ((packed));
- u_char rgbRed __attribute__ ((packed));
- u_char rgbReserved __attribute__ ((packed));
-} RGBQUAD;
-
-typedef struct tagBITMAPINFO { /* bmi */
- BITMAPINFOHEADER bmiHeader __attribute__ ((packed));
- RGBQUAD bmiColors[256] __attribute__ ((packed));
-} BITMAPINFO;
-
-typedef struct tagBITMAPF
-{
- BITMAPFILEHEADER bmfh __attribute__ ((packed));
- BITMAPINFO bmfi __attribute__ ((packed));
-} BITMAPF;
-
-#define BI_RGB 0
-#define BI_RLE8 1
-#define BI_RLE4 2
-
-/*
-** all we actually care about the image
-*/
-typedef struct
-{
- int width,height; /* image dimensions */
- int swidth,sheight; /* screen dimensions for the current mode */
- u_char sdepth; /* screen depth (1, 4, 8 bpp) */
- int ncols; /* number of colours */
- u_char palette[256][3]; /* raw palette data */
- u_char format; /* one of the BI_* constants above */
- u_char *data; /* pointer to the raw data */
- u_char *index; /* running pointer to the data while drawing */
- u_char *vidmem; /* video memory allocated for drawing */
-} BMP_INFO;
-
-static BMP_INFO bmp_info;
-
-/*
-** bmp_SetPix
-**
-** Given (info), set the pixel at (x),(y) to (val)
-**
-*/
-static void
-bmp_SetPix(BMP_INFO *info, int x, int y, u_char val)
-{
- int sofs, bofs;
- u_char tpv, mask;
-
- /*
- * range check to avoid explosions
- */
- if ((x < 0) || (x >= info->swidth) || (y < 0) || (y >= info->sheight))
- return;
-
- /*
- * calculate offset into video memory;
- * because 0,0 is bottom-left for DIB, we have to convert.
- */
- sofs = ((info->height - (y+1) + (info->sheight - info->height) / 2)
- * info->swidth) + x + (info->swidth - info->width) / 2;
-
- switch(info->sdepth) {
- case 1:
- sofs = sofs >> 3; /* correct for depth */
- bofs = x & 0x7; /* offset within byte */
-
- val &= 1; /* mask pixel value */
- mask = ~(0x80 >> bofs); /* calculate bit mask */
- tpv = *(info->vidmem+sofs) & mask; /* get screen contents, excluding masked bit */
- *(info->vidmem+sofs) = tpv | (val << (8-bofs)); /* write new bit */
- break;
-
- /* XXX only correct for non-interleaved modes */
- case 4:
- sofs = sofs >> 1; /* correct for depth */
- bofs = x & 0x1; /* offset within byte */
-
- val &= 0xf; /* mask pixel value */
- mask = bofs ? 0x0f : 0xf0; /* calculate bit mask */
- tpv = *(info->vidmem+sofs) & mask; /* get screen contents, excluding masked bits */
- *(info->vidmem+sofs) = tpv | (val << (bofs ? 0 : 4)); /* write new bits */
- break;
-
- case 8:
- *(info->vidmem+sofs) = val;
- break;
- }
-}
-
-/*
-** bmp_DecodeRLE4
-**
-** Given (data) pointing to a line of RLE4-format data and (line) being the starting
-** line onscreen, decode the line.
-*/
-static void
-bmp_DecodeRLE4(BMP_INFO *info, int line)
-{
- int count; /* run count */
- u_char val;
- int x,y; /* screen position */
-
- x = 0; /* starting position */
- y = line;
-
- /* loop reading data */
- for (;;) {
- /*
- * encoded mode starts with a run length, and then a byte with
- * two colour indexes to alternate between for the run
- */
- if (*info->index) {
- for (count = 0; count < *info->index; count++, x++) {
- if (count & 1) { /* odd count, low nybble */
- bmp_SetPix(info, x, y, *(info->index+1) & 0x0f);
- } else { /* even count, high nybble */
- bmp_SetPix(info, x, y, (*(info->index+1) >>4) & 0x0f);
- }
- }
- info->index += 2;
- /*
- * A leading zero is an escape; it may signal the end of the
- * bitmap, a cursor move, or some absolute data.
- */
- } else { /* zero tag may be absolute mode or an escape */
- switch (*(info->index+1)) {
- case 0: /* end of line */
- info->index += 2;
- return;
- case 1: /* end of bitmap */
- info->index = NULL;
- return;
- case 2: /* move */
- x += *(info->index + 2); /* new coords */
- y += *(info->index + 3);
- info->index += 4;
- break;
- default: /* literal bitmap data */
- for (count = 0; count < *(info->index + 1); count++, x++) {
- val = *(info->index + 2 + (count / 2)); /* byte with nybbles */
- if (count & 1) {
- val &= 0xf; /* get low nybble */
- } else {
- val = (val >> 4); /* get high nybble */
- }
- bmp_SetPix(info, x, y, val);
- }
- /* warning, this depends on integer truncation, do not hand-optimise! */
- info->index += 2 + ((count + 3) / 4) * 2;
- break;
- }
- }
- }
-}
-
-/*
-** bmp_DecodeRLE8
-** Given (data) pointing to a line of RLE4-format data and (line) being the starting
-** line onscreen, decode the line.
-*/
-static void
-bmp_DecodeRLE8(BMP_INFO *info, int line)
-{
- int count; /* run count */
- int x,y; /* screen position */
-
- x = 0; /* starting position */
- y = line;
-
- /* loop reading data */
- for(;;) {
- /*
- * encoded mode starts with a run length, and then a byte with
- * two colour indexes to alternate between for the run
- */
- if (*info->index) {
- for (count = 0; count < *info->index; count++, x++)
- bmp_SetPix(info, x, y, *(info->index+1));
- info->index += 2;
- /*
- * A leading zero is an escape; it may signal the end of the
- * bitmap, a cursor move, or some absolute data.
- */
- } else { /* zero tag may be absolute mode or an escape */
- switch(*(info->index+1)) {
- case 0: /* end of line */
- info->index += 2;
- return;
- case 1: /* end of bitmap */
- info->index = NULL;
- return;
- case 2: /* move */
- x += *(info->index + 2); /* new coords */
- y += *(info->index + 3);
- info->index += 4;
- break;
- default: /* literal bitmap data */
- for (count = 0; count < *(info->index + 1); count++, x++)
- bmp_SetPix(info, x, y, *(info->index + 2 + count));
- /* must be an even count */
- info->index += 2 + count + (count & 1);
- break;
- }
- }
- }
-}
-
-/*
-** bmp_DecodeLine
-**
-** Given (info) pointing to an image being decoded, (line) being the line currently
-** being displayed, decode a line of data.
-*/
-static void
-bmp_DecodeLine(BMP_INFO *info, int line)
-{
- int x;
-
- switch(info->format) {
- case BI_RGB:
- for (x = 0; x < info->width; x++, info->index++)
- bmp_SetPix(info, x, line, *info->index);
- info->index += 3 - (--x % 4);
- break;
- case BI_RLE4:
- bmp_DecodeRLE4(info, line);
- break;
- case BI_RLE8:
- bmp_DecodeRLE8(info, line);
- break;
- }
-}
-
-/*
-** bmp_Init
-**
-** Given a pointer (data) to the image of a BMP file, fill in bmp_info with what
-** can be learnt from it. Return nonzero if the file isn't usable.
-**
-** Take screen dimensions (swidth), (sheight) and (sdepth) and make sure we
-** can work with these.
-*/
-static int
-bmp_Init(const char *data, int swidth, int sheight, int sdepth)
-{
- BITMAPF *bmf = (BITMAPF *)data;
- int pind;
-
- bmp_info.data = NULL; /* assume setup failed */
-#if 0
- bmp_info.vidmem = vidmem; /* remember where */
-#endif
-
- /* check file ID */
- if (bmf->bmfh.bfType != 0x4d42) {
- return(1); /* XXX check word ordering for big-endian ports? */
- }
-
- /* save what we know about the screen */
- bmp_info.swidth = swidth;
- bmp_info.sheight = sheight;
- bmp_info.sdepth = sdepth;
-
- /* where's the data? */
- bmp_info.data = (u_char *)data + bmf->bmfh.bfOffBits;
-
- /* image parameters */
- bmp_info.width = bmf->bmfi.bmiHeader.biWidth;
- bmp_info.height = bmf->bmfi.bmiHeader.biHeight;
- bmp_info.format = bmf->bmfi.bmiHeader.biCompression;
-
- switch(bmp_info.format) { /* check compression format */
- case BI_RGB:
- case BI_RLE4:
- case BI_RLE8:
- break;
- default:
- return(1); /* unsupported compression format */
- }
-
- /* palette details */
- bmp_info.ncols = (bmf->bmfi.bmiHeader.biClrUsed);
- bzero(bmp_info.palette,sizeof(bmp_info.palette));
- if (bmp_info.ncols == 0) { /* uses all of them */
- bmp_info.ncols = 1 << bmf->bmfi.bmiHeader.biBitCount;
- }
- if ((bmp_info.height > bmp_info.sheight) ||
- (bmp_info.width > bmp_info.swidth) ||
- (bmp_info.ncols > (1 << sdepth))) {
- return(1); /* beyond screen capacity */
- }
-
- /* read palette */
- for (pind = 0; pind < bmp_info.ncols; pind++) {
- bmp_info.palette[pind][0] = bmf->bmfi.bmiColors[pind].rgbRed;
- bmp_info.palette[pind][1] = bmf->bmfi.bmiColors[pind].rgbGreen;
- bmp_info.palette[pind][2] = bmf->bmfi.bmiColors[pind].rgbBlue;
- }
- return(0);
-}
-
-/*
-** bmp_Draw
-**
-** Render the image. Return nonzero if that's not possible.
-**
-*/
-static int
-bmp_Draw(video_adapter_t *adp)
-{
- int line;
-
- if (bmp_info.data == NULL) { /* init failed, do nothing */
- return(1);
- }
-
- /* clear the screen */
- bmp_info.vidmem = (u_char *)adp->va_window;
- /* XXX; the following line is correct only for 8bpp modes */
- bzero(bmp_info.vidmem, bmp_info.swidth * bmp_info.sheight);
-
- /* initialise the info structure for drawing */
- bmp_info.index = bmp_info.data;
-
- /* set the palette for our image */
- (*vidsw[adp->va_index]->load_palette)(adp, (u_char *)&bmp_info.palette);
-
- for (line = 0; (line < bmp_info.height) && bmp_info.index; line++) {
- bmp_DecodeLine(&bmp_info, line);
- }
- return(0);
-}
diff --git a/sys/modules/syscons/Makefile b/sys/modules/syscons/Makefile
index d817ca271a490..195fd0381e669 100644
--- a/sys/modules/syscons/Makefile
+++ b/sys/modules/syscons/Makefile
@@ -1,5 +1,5 @@
-# $Id: Makefile,v 1.6 1998/12/28 14:23:43 des Exp $
+# $Id: Makefile,v 1.3 1997/02/22 12:48:58 peter Exp $
-SUBDIR= blank daemon fade green logo rain snake star warp
+SUBDIR= blank daemon fade green snake star
.include <bsd.subdir.mk>
diff --git a/sys/modules/syscons/blank/blank_saver.c b/sys/modules/syscons/blank/blank_saver.c
index 89dd199815f5b..1bb73233e7906 100644
--- a/sys/modules/syscons/blank/blank_saver.c
+++ b/sys/modules/syscons/blank/blank_saver.c
@@ -25,26 +25,29 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: blank_saver.c,v 1.14 1998/11/04 03:49:38 peter Exp $
+ * $Id: blank_saver.c,v 1.12 1998/09/15 18:16:38 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-
-#include <dev/fb/vgareg.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <i386/isa/isa.h>
#include <saver.h>
-static int
-blank_saver(video_adapter_t *adp, int blank)
+MOD_MISC(blank_saver);
+
+static void
+blank_saver(int blank)
{
u_char val;
if (blank) {
- switch (adp->va_type) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
@@ -53,18 +56,18 @@ blank_saver(video_adapter_t *adp, int blank)
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x25);
+ outb(crtc_addr + 4, 0x25);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x21);
+ outb(crtc_addr + 4, 0x21);
break;
default:
break;
}
}
else {
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
@@ -73,23 +76,24 @@ blank_saver(video_adapter_t *adp, int blank)
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x2d);
+ outb(crtc_addr + 4, 0x2d);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x29);
+ outb(crtc_addr + 4, 0x29);
break;
default:
break;
}
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
}
- return 0;
}
static int
-blank_init(video_adapter_t *adp)
+blank_saver_load(struct lkm_table *lkmtp, int cmd)
{
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_MONO:
case KD_HERCULES:
case KD_CGA:
@@ -100,17 +104,18 @@ blank_init(video_adapter_t *adp)
default:
return ENODEV;
}
- return 0;
+ return add_scrn_saver(blank_saver);
}
static int
-blank_term(video_adapter_t *adp)
+blank_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(blank_saver);
}
-static scrn_saver_t blank_module = {
- "blank_saver", blank_init, blank_term, blank_saver, NULL,
-};
-
-SAVER_MODULE(blank_saver, blank_module);
+int
+blank_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(blank_saver, lkmtp, cmd, ver,
+ blank_saver_load, blank_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/daemon/daemon_saver.c b/sys/modules/syscons/daemon/daemon_saver.c
index 09f6caf361893..59e99f0fe328d 100644
--- a/sys/modules/syscons/daemon/daemon_saver.c
+++ b/sys/modules/syscons/daemon/daemon_saver.c
@@ -25,12 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: daemon_saver.c,v 1.13 1999/01/11 03:18:45 yokota Exp $
+ * $Id: daemon_saver.c,v 1.10 1998/09/15 18:16:38 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
@@ -46,10 +48,11 @@
#define DAEMON_MAX_WIDTH 32
#define DAEMON_MAX_HEIGHT 19
+MOD_MISC(daemon_saver);
+
static char *message;
static int messagelen;
static u_short *window;
-static int blanked;
/* Who is the author of this ASCII pic? */
@@ -185,8 +188,8 @@ draw_string(int xpos, int ypos, int xoff, char *s, int len)
scr_map[s[x]]|(FG_LIGHTGREEN|BG_BLACK)<<8;
}
-static int
-daemon_saver(video_adapter_t *adp, int blank)
+static void
+daemon_saver(int blank)
{
static int txpos = 10, typos = 10;
static int txdir = -1, tydir = -1;
@@ -199,19 +202,20 @@ daemon_saver(video_adapter_t *adp, int blank)
int min, max;
if (blank) {
- if (adp->va_mode_flags & V_INFO_GRAPHICS)
- return EAGAIN;
- if (blanked == 0) {
- window = (u_short *)adp->va_window;
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked == 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
/* clear the screen and set the border color */
fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
window, scp->xsize * scp->ysize);
set_border(scp, 0);
xlen = ylen = tlen = 0;
}
- if (blanked++ < 2)
- return 0;
- blanked = 1;
+ if (scrn_blanked++ < 2)
+ return;
+ scrn_blanked = 1;
clear_daemon(dxpos, dypos, dxdir, xoff, yoff, xlen, ylen);
clear_string(txpos, typos, toff, (char *)message, tlen);
@@ -322,31 +326,44 @@ daemon_saver(video_adapter_t *adp, int blank)
draw_daemon(dxpos, dypos, dxdir, xoff, yoff, xlen, ylen);
draw_string(txpos, typos, toff, (char *)message, tlen);
} else {
- blanked = 0;
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
}
- return 0;
}
static int
-daemon_init(video_adapter_t *adp)
+daemon_saver_load(struct lkm_table *lkmtp, int cmd)
{
+ int err;
+
messagelen = strlen(hostname) + 3 + strlen(ostype) + 1 +
strlen(osrelease);
message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK);
sprintf(message, "%s - %s %s", hostname, ostype, osrelease);
- blanked = 0;
- return 0;
+
+ err = add_scrn_saver(daemon_saver);
+ if (err != 0)
+ free(message, M_DEVBUF);
+ return err;
}
static int
-daemon_term(video_adapter_t *adp)
+daemon_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- free(message, M_DEVBUF);
- return 0;
-}
+ int err;
-static scrn_saver_t daemon_module = {
- "daemon_saver", daemon_init, daemon_term, daemon_saver, NULL,
-};
+ err = remove_scrn_saver(daemon_saver);
+ if (err == 0)
+ free(message, M_DEVBUF);
+ return err;
+}
-SAVER_MODULE(daemon_saver, daemon_module);
+int
+daemon_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(daemon_saver, lkmtp, cmd, ver,
+ daemon_saver_load, daemon_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/fade/fade_saver.c b/sys/modules/syscons/fade/fade_saver.c
index 70d36c9c1e0c2..0d31bd6de526e 100644
--- a/sys/modules/syscons/fade/fade_saver.c
+++ b/sys/modules/syscons/fade/fade_saver.c
@@ -25,34 +25,33 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: fade_saver.c,v 1.15 1998/11/04 03:49:38 peter Exp $
+ * $Id: fade_saver.c,v 1.13 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <i386/isa/isa.h>
#include <saver.h>
-static u_char palette[256*3];
-static int blanked;
+MOD_MISC(fade_saver);
-static int
-fade_saver(video_adapter_t *adp, int blank)
+static void
+fade_saver(int blank)
{
static int count = 0;
u_char pal[256*3];
int i;
if (blank) {
- blanked = TRUE;
- switch (adp->va_type) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
case KD_VGA:
- if (count <= 0)
- save_palette(adp, palette);
if (count < 64) {
pal[0] = pal[1] = pal[2] = 0;
for (i = 3; i < 256*3; i++) {
@@ -61,7 +60,7 @@ fade_saver(video_adapter_t *adp, int blank)
else
pal[i] = 60;
}
- load_palette(adp, pal);
+ load_palette(cur_console, pal);
count++;
}
break;
@@ -69,44 +68,44 @@ fade_saver(video_adapter_t *adp, int blank)
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x25);
+ outb(crtc_addr + 4, 0x25);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x21);
+ outb(crtc_addr + 4, 0x21);
break;
default:
break;
}
}
else {
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_VGA:
- load_palette(adp, palette);
+ load_palette(cur_console, palette);
count = 0;
break;
case KD_EGA:
/* not yet done XXX */
break;
case KD_CGA:
- outb(adp->va_crtc_addr + 4, 0x2d);
+ outb(crtc_addr + 4, 0x2d);
break;
case KD_MONO:
case KD_HERCULES:
- outb(adp->va_crtc_addr + 4, 0x29);
+ outb(crtc_addr + 4, 0x29);
break;
default:
break;
}
- blanked = FALSE;
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
}
- return 0;
}
static int
-fade_init(video_adapter_t *adp)
+fade_saver_load(struct lkm_table *lkmtp, int cmd)
{
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_MONO:
case KD_HERCULES:
case KD_CGA:
@@ -121,18 +120,18 @@ fade_init(video_adapter_t *adp)
default:
return ENODEV;
}
- blanked = FALSE;
- return 0;
+ return add_scrn_saver(fade_saver);
}
static int
-fade_term(video_adapter_t *adp)
+fade_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(fade_saver);
}
-static scrn_saver_t fade_module = {
- "fade_saver", fade_init, fade_term, fade_saver, NULL,
-};
-
-SAVER_MODULE(fade_saver, fade_module);
+int
+fade_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(fade_saver, lkmtp, cmd, ver,
+ fade_saver_load, fade_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/green/green_saver.c b/sys/modules/syscons/green/green_saver.c
index 9decd7282f9f6..0e61c2e2102ba 100644
--- a/sys/modules/syscons/green/green_saver.c
+++ b/sys/modules/syscons/green/green_saver.c
@@ -25,29 +25,29 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: green_saver.c,v 1.14 1998/11/04 03:49:38 peter Exp $
+ * $Id: green_saver.c,v 1.12 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-
-#include <dev/fb/vgareg.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <i386/isa/isa.h>
#include <saver.h>
-static int
-green_saver(video_adapter_t *adp, int blank)
+MOD_MISC(green_saver);
+
+static void
+green_saver(int blank)
{
- int crtc_addr;
u_char val;
-
- crtc_addr = adp->va_crtc_addr;
if (blank) {
- switch (adp->va_type) {
+ scrn_blanked = 1;
+ cur_console->status |= SAVER_RUNNING;
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
@@ -69,7 +69,7 @@ green_saver(video_adapter_t *adp, int blank)
}
}
else {
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_VGA:
outb(TSIDX, 0x01); val = inb(TSREG);
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
@@ -89,14 +89,15 @@ green_saver(video_adapter_t *adp, int blank)
default:
break;
}
+ cur_console->status &= ~SAVER_RUNNING;
+ scrn_blanked = 0;
}
- return 0;
}
static int
-green_init(video_adapter_t *adp)
+green_saver_load(struct lkm_table *lkmtp, int cmd)
{
- switch (adp->va_type) {
+ switch (crtc_type) {
case KD_MONO:
case KD_HERCULES:
case KD_CGA:
@@ -111,17 +112,18 @@ green_init(video_adapter_t *adp)
default:
return ENODEV;
}
- return 0;
+ return add_scrn_saver(green_saver);
}
static int
-green_term(video_adapter_t *adp)
+green_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(green_saver);
}
-static scrn_saver_t green_module = {
- "green_saver", green_init, green_term, green_saver, NULL,
-};
-
-SAVER_MODULE(green_saver, green_module);
+int
+green_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(green_saver, lkmtp, cmd, ver,
+ green_saver_load, green_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/logo/Makefile b/sys/modules/syscons/logo/Makefile
deleted file mode 100644
index 1bccccdbde1a4..0000000000000
--- a/sys/modules/syscons/logo/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id: Makefile,v 1.1 1998/12/28 14:22:57 des Exp $
-
-KMOD= logo_saver
-SRCS= logo_saver.c
-
-NOMAN=
-CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/logo/logo.c b/sys/modules/syscons/logo/logo.c
deleted file mode 100644
index be502fe502ff6..0000000000000
--- a/sys/modules/syscons/logo/logo.c
+++ /dev/null
@@ -1,352 +0,0 @@
-#define logo_w 88
-#define logo_h 88
-
-unsigned char logo_pal[768] = {
- 0x00, 0x00, 0x00,
- 0x33, 0x33, 0x33,
- 0x66, 0x66, 0x66,
- 0x99, 0x99, 0x99,
- 0xcc, 0xcc, 0xcc,
- 0xff, 0xff, 0xff,
- 0x90, 0x8f, 0x90,
- 0x56, 0x4b, 0x55,
- 0xa3, 0xa5, 0xab,
- 0xfd, 0xfd, 0xfd,
- 0x6d, 0x6e, 0x74,
- 0x41, 0x2b, 0x39,
- 0xcb, 0xc8, 0xcb,
- 0xcf, 0xbb, 0xba,
- 0x8e, 0x82, 0x87,
- 0x5c, 0x5d, 0x60,
- 0x52, 0x2a, 0x37,
- 0x7f, 0x76, 0x7d,
- 0x82, 0x82, 0x85,
- 0x7a, 0x3e, 0x45,
- 0x7f, 0x6e, 0x70,
- 0xef, 0xef, 0xed,
- 0x53, 0x41, 0x4b,
- 0x67, 0x2b, 0x35,
- 0x6a, 0x55, 0x62,
- 0xe7, 0xe2, 0xe3,
- 0x64, 0x35, 0x3f,
- 0xf7, 0xe0, 0xe7,
- 0xb1, 0xb2, 0xb2,
- 0x31, 0x2b, 0x35,
- 0x7a, 0x2d, 0x37,
- 0x69, 0x4c, 0x56,
- 0x95, 0x9d, 0xa4,
- 0x85, 0x61, 0x69,
- 0x40, 0x34, 0x41,
- 0x8f, 0x2e, 0x39,
- 0x7a, 0x50, 0x5a,
- 0xde, 0xe1, 0xe0,
- 0x32, 0x33, 0x3d,
- 0xa0, 0x9b, 0x9c,
- 0x68, 0x63, 0x67,
- 0x76, 0x60, 0x67,
- 0xba, 0xb6, 0xb8,
- 0x29, 0x24, 0x41,
- 0x38, 0x21, 0x29,
- 0x42, 0x21, 0x27,
- 0xa2, 0x2a, 0x32,
- 0x56, 0x55, 0x58,
- 0x55, 0x21, 0x2b,
- 0x7a, 0x20, 0x2a,
- 0x37, 0x16, 0x21,
- 0x4d, 0x18, 0x37,
- 0x8a, 0x3a, 0x3e,
- 0xc0, 0xc2, 0xc4,
- 0x64, 0x23, 0x2c,
- 0x37, 0x1a, 0x24,
- 0x42, 0x18, 0x20,
- 0x4c, 0x21, 0x2b,
- 0xa0, 0x23, 0x2e,
- 0x95, 0x6c, 0x76,
- 0x26, 0x16, 0x1c,
- 0xa5, 0x18, 0x23,
- 0x84, 0x20, 0x2b,
- 0x6d, 0x3f, 0x49,
- 0xae, 0xa7, 0xac,
- 0x2a, 0x1f, 0x24,
- 0x90, 0x21, 0x30,
- 0xa0, 0x39, 0x3e,
- 0x95, 0x0f, 0x1c,
- 0x84, 0x13, 0x1e,
- 0x4e, 0x17, 0x24,
- 0x8c, 0x56, 0x5f,
- 0xe0, 0xc4, 0xcb,
- 0xa5, 0x7f, 0x8e,
- 0xff, 0xff, 0xf1,
- 0x3d, 0x3d, 0x5d,
- 0x61, 0x19, 0x26,
- 0xd5, 0xd5, 0xd5,
- 0xff, 0xf1, 0xed,
- 0xb6, 0x9c, 0xa5,
- 0x87, 0x4c, 0x5a,
- 0xa0, 0x76, 0x76,
- 0xc8, 0xa0, 0xa0,
- 0xa2, 0xc1, 0xc8,
- 0x91, 0xae, 0xb6,
- 0x52, 0x8b, 0xae,
- 0xb3, 0xd2, 0xd4,
- 0x95, 0xb7, 0xc1,
- 0x54, 0x6e, 0x83,
- 0x67, 0x90, 0xa6,
- 0x44, 0x3e, 0x45,
- 0x23, 0x40, 0x6a,
- 0x41, 0x6e, 0x97,
- 0x7e, 0x8e, 0x91,
- 0x52, 0x33, 0x41,
- 0x39, 0x49, 0x68,
- 0x1d, 0x2a, 0x48,
- 0x17, 0x21, 0x45,
- 0x90, 0x17, 0x1f,
- 0x38, 0x54, 0x71,
- 0x1c, 0x33, 0x58,
- 0x1c, 0x1e, 0x23,
- 0x6c, 0x17, 0x21,
- 0xb0, 0xc5, 0xc1,
- 0x5d, 0x7f, 0x96,
- 0xe9, 0xbf, 0xc1,
- 0x96, 0x06, 0x0f,
- 0x78, 0x16, 0x1e,
- 0xab, 0x0e, 0x18,
- 0xa6, 0x06, 0x0e,
- 0x4c, 0x4c, 0x54,
- 0x61, 0x42, 0x4c,
- 0x48, 0x5f, 0x84,
- 0xa0, 0xb8, 0xbe,
- 0x5c, 0x66, 0x7f,
- 0x7b, 0x9e, 0xa9,
- 0x6f, 0x75, 0x7f,
- 0x45, 0x54, 0x74,
- 0x32, 0x3e, 0x63,
- 0xb1, 0xb4, 0xb3,
- 0x66, 0x9d, 0xb4,
- 0x7a, 0x9f, 0xbb,
- 0x82, 0xaa, 0xba,
- 0x13, 0x15, 0x17,
- 0x0b, 0x0b, 0x0a,
- 0x37, 0x66, 0x92,
- 0x4c, 0x7f, 0xa5,
- 0x24, 0x4c, 0x7b,
- 0x25, 0x5f, 0x91,
- 0x40, 0x7d, 0xa5,
- 0x1d, 0x56, 0x88,
- 0x2d, 0x6f, 0xa0,
- 0x70, 0x81, 0x8f,
- 0x58, 0x97, 0xbd,
- 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,
- 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,
- 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,
- 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,
-};
-
-unsigned char logo_img[logo_w*logo_h] = {
- 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 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, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 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, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x09, 0x0a, 0x0b, 0x07, 0x0c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0d, 0x0e, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x0f, 0x0b, 0x10, 0x11, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x12, 0x13, 0x14, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x16, 0x0b, 0x17, 0x18, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x13, 0x1a, 0x1b, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x1c, 0x1d, 0x10, 0x1e, 0x1f, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x20, 0x0b, 0x1e, 0x21, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x22, 0x0b, 0x17, 0x23, 0x24, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x26, 0x10, 0x23, 0x27, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x11, 0x28, 0x29, 0x11, 0x06, 0x0d, 0x09, 0x05, 0x2a, 0x2b, 0x2c, 0x2d, 0x1e, 0x2e, 0x21, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2f, 0x0b, 0x30, 0x31, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x06, 0x16, 0x22, 0x1d, 0x2c, 0x32, 0x33, 0x17, 0x17, 0x17, 0x22, 0x14, 0x16, 0x1d, 0x2c, 0x2d, 0x1e, 0x2e, 0x34, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x2c, 0x36, 0x36, 0x35, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x27, 0x0b, 0x2c, 0x2c, 0x37, 0x32, 0x38, 0x2c, 0x2d, 0x39, 0x36, 0x17, 0x30, 0x2c, 0x2c, 0x2d, 0x2c, 0x2c, 0x1a, 0x3a, 0x3a, 0x3b, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2d, 0x2b, 0x33, 0x31, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x09, 0x28, 0x2c, 0x37, 0x3c, 0x32, 0x38, 0x38, 0x37, 0x2c, 0x30, 0x36, 0x36, 0x17, 0x31, 0x36, 0x23, 0x23, 0x17, 0x2c, 0x17, 0x3a, 0x3d, 0x13, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x2c, 0x37, 0x33, 0x3e, 0x31, 0x3f, 0x40, 0x19, 0x05, 0x11, 0x2c, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x37, 0x41, 0x30, 0x3a, 0x3a, 0x2e, 0x42, 0x43, 0x17, 0x1a, 0x13, 0x23, 0x31, 0x1a, 0x2e, 0x3d, 0x1a, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0b, 0x37, 0x32, 0x37, 0x33, 0x44, 0x44, 0x45, 0x17, 0x1a, 0x10, 0x2d, 0x37, 0x38, 0x46, 0x33, 0x46, 0x32, 0x2c, 0x23, 0x23, 0x47, 0x21, 0x13, 0x43, 0x34, 0x48, 0x19, 0x49, 0x34, 0x17, 0x1e, 0x3a, 0x13, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4b, 0x32, 0x32, 0x32, 0x32, 0x4c, 0x45, 0x44, 0x44, 0x42, 0x36, 0x30, 0x33, 0x46, 0x38, 0x33, 0x46, 0x38, 0x31, 0x23, 0x27, 0x09, 0x4a, 0x4d, 0x47, 0x43, 0x0d, 0x4e, 0x4a, 0x4f, 0x34, 0x1a, 0x2e, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x33, 0x32, 0x32, 0x32, 0x33, 0x4c, 0x31, 0x45, 0x3e, 0x31, 0x36, 0x46, 0x46, 0x33, 0x33, 0x39, 0x30, 0x23, 0x50, 0x4a, 0x4a, 0x4a, 0x4a, 0x4d, 0x47, 0x51, 0x4e, 0x4a, 0x4a, 0x0e, 0x13, 0x1a, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x32, 0x32, 0x2b, 0x32, 0x33, 0x4c, 0x33, 0x4c, 0x4c, 0x36, 0x30, 0x30, 0x30, 0x30, 0x31, 0x23, 0x3a, 0x49, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4f, 0x50, 0x1b, 0x4e, 0x4a, 0x19, 0x50, 0x16, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x32, 0x32, 0x32, 0x32, 0x2b, 0x33, 0x33, 0x30, 0x2d, 0x39, 0x30, 0x30, 0x30, 0x4c, 0x36, 0x42, 0x3a, 0x52, 0x05, 0x4a, 0x4a, 0x4a, 0x4a, 0x09, 0x3b, 0x52, 0x4e, 0x4a, 0x4a, 0x4f, 0x1a, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x2b, 0x2b, 0x32, 0x32, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2d, 0x10, 0x30, 0x30, 0x3e, 0x23, 0x3a, 0x0d, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x40, 0x51, 0x4a, 0x4a, 0x25, 0x15, 0x1f, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x22, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x2d, 0x2c, 0x41, 0x32, 0x39, 0x46, 0x4c, 0x31, 0x2e, 0x2e, 0x0c, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x25, 0x53, 0x18, 0x4a, 0x54, 0x55, 0x56, 0x51, 0x11, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x22, 0x32, 0x32, 0x32, 0x38, 0x38, 0x32, 0x2c, 0x37, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3a, 0x2a, 0x4a, 0x4a, 0x05, 0x4a, 0x57, 0x58, 0x59, 0x5a, 0x35, 0x58, 0x5b, 0x5c, 0x5d, 0x5e, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x07, 0x37, 0x32, 0x38, 0x38, 0x32, 0x32, 0x41, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3d, 0x27, 0x05, 0x4a, 0x4a, 0x4a, 0x5c, 0x5f, 0x59, 0x1d, 0x29, 0x2f, 0x60, 0x61, 0x26, 0x0b, 0x1c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4e, 0x0a, 0x2d, 0x38, 0x38, 0x32, 0x37, 0x32, 0x2d, 0x39, 0x36, 0x31, 0x62, 0x3d, 0x0e, 0x4a, 0x4a, 0x4a, 0x09, 0x63, 0x64, 0x64, 0x61, 0x2d, 0x1d, 0x65, 0x61, 0x2b, 0x17, 0x16, 0x4a, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x2c, 0x38, 0x38, 0x37, 0x37, 0x38, 0x2d, 0x30, 0x31, 0x42, 0x3a, 0x18, 0x09, 0x05, 0x05, 0x4a, 0x63, 0x60, 0x60, 0x2b, 0x10, 0x2d, 0x41, 0x41, 0x30, 0x42, 0x3e, 0x29, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x37, 0x32, 0x38, 0x32, 0x41, 0x38, 0x38, 0x30, 0x66, 0x31, 0x3a, 0x1e, 0x67, 0x4a, 0x4a, 0x05, 0x68, 0x64, 0x61, 0x2b, 0x17, 0x36, 0x10, 0x33, 0x31, 0x42, 0x3d, 0x45, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x1c, 0x2c, 0x32, 0x32, 0x37, 0x41, 0x2c, 0x46, 0x30, 0x36, 0x36, 0x42, 0x42, 0x29, 0x1b, 0x4a, 0x4a, 0x4d, 0x26, 0x60, 0x0b, 0x17, 0x36, 0x44, 0x45, 0x66, 0x3e, 0x44, 0x44, 0x1a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x2c, 0x32, 0x32, 0x38, 0x37, 0x32, 0x37, 0x30, 0x36, 0x4c, 0x31, 0x1e, 0x10, 0x1f, 0x52, 0x69, 0x52, 0x07, 0x2c, 0x10, 0x36, 0x62, 0x6a, 0x44, 0x6b, 0x3e, 0x44, 0x6c, 0x30, 0x09, 0x05, 0x05, 0x25, 0x54, 0x19, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x2c, 0x37, 0x38, 0x37, 0x2c, 0x32, 0x32, 0x46, 0x30, 0x46, 0x4c, 0x31, 0x66, 0x4c, 0x36, 0x1a, 0x1a, 0x17, 0x37, 0x37, 0x10, 0x31, 0x62, 0x45, 0x4c, 0x3e, 0x44, 0x62, 0x30, 0x09, 0x05, 0x0a, 0x70, 0x71, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x32, 0x32, 0x38, 0x41, 0x41, 0x38, 0x2d, 0x46, 0x66, 0x44, 0x6c, 0x6c, 0x6c, 0x3d, 0x3a, 0x42, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x30, 0x36, 0x3e, 0x3e, 0x31, 0x07, 0x05, 0x12, 0x6e, 0x72, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2c, 0x38, 0x32, 0x41, 0x37, 0x2d, 0x46, 0x66, 0x6a, 0x6c, 0x6d, 0x6d, 0x6c, 0x3d, 0x3d, 0x31, 0x38, 0x38, 0x39, 0x33, 0x39, 0x36, 0x30, 0x30, 0x66, 0x30, 0x40, 0x4d, 0x5f, 0x4d, 0x4d, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x5a, 0x2d, 0x32, 0x32, 0x37, 0x37, 0x32, 0x38, 0x46, 0x46, 0x66, 0x45, 0x44, 0x62, 0x44, 0x44, 0x3e, 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, 0x37, 0x30, 0x10, 0x06, 0x05, 0x12, 0x0a, 0x05, 0x05, 0x05, 0x08, 0x68, 0x73, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x32, 0x32, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x39, 0x39, 0x39, 0x36, 0x36, 0x6b, 0x3e, 0x3e, 0x3e, 0x3e, 0x31, 0x4c, 0x39, 0x2d, 0x10, 0x16, 0x2a, 0x05, 0x05, 0x74, 0x74, 0x05, 0x05, 0x0c, 0x75, 0x5f, 0x1c, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x2c, 0x32, 0x32, 0x32, 0x41, 0x37, 0x41, 0x2c, 0x2c, 0x41, 0x2c, 0x33, 0x36, 0x31, 0x36, 0x31, 0x31, 0x17, 0x46, 0x2c, 0x16, 0x40, 0x05, 0x05, 0x05, 0x05, 0x20, 0x5f, 0x4d, 0x72, 0x76, 0x06, 0x25, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x0b, 0x2d, 0x37, 0x2d, 0x2c, 0x2c, 0x37, 0x37, 0x38, 0x2c, 0x37, 0x2c, 0x10, 0x10, 0x39, 0x30, 0x0b, 0x2c, 0x11, 0x09, 0x05, 0x09, 0x4a, 0x05, 0x05, 0x19, 0x1d, 0x26, 0x76, 0x08, 0x05, 0x05, 0x05, 0x15, 0x25, 0x4d, 0x53, 0x77, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x5a, 0x2c, 0x37, 0x2d, 0x2c, 0x37, 0x37, 0x39, 0x39, 0x33, 0x38, 0x2c, 0x2d, 0x2d, 0x2c, 0x5e, 0x2a, 0x05, 0x15, 0x3b, 0x17, 0x1f, 0x19, 0x05, 0x06, 0x26, 0x60, 0x5f, 0x0c, 0x05, 0x05, 0x05, 0x35, 0x68, 0x78, 0x56, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x37, 0x2c, 0x37, 0x32, 0x46, 0x33, 0x46, 0x39, 0x11, 0x15, 0x05, 0x05, 0x18, 0x31, 0x44, 0x6a, 0x30, 0x6e, 0x2b, 0x4b, 0x11, 0x5f, 0x63, 0x72, 0x54, 0x20, 0x74, 0x58, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2c, 0x38, 0x2d, 0x39, 0x39, 0x2d, 0x37, 0x3c, 0x32, 0x37, 0x0b, 0x18, 0x05, 0x05, 0x05, 0x4e, 0x26, 0x32, 0x45, 0x6a, 0x46, 0x2b, 0x72, 0x4e, 0x05, 0x35, 0x0a, 0x75, 0x5f, 0x70, 0x08, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x2d, 0x30, 0x6b, 0x6b, 0x66, 0x36, 0x30, 0x36, 0x4c, 0x36, 0x30, 0x18, 0x05, 0x05, 0x05, 0x09, 0x4b, 0x32, 0x46, 0x66, 0x38, 0x0b, 0x09, 0x05, 0x05, 0x05, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2c, 0x2c, 0x31, 0x62, 0x62, 0x6b, 0x31, 0x45, 0x44, 0x44, 0x45, 0x31, 0x10, 0x0c, 0x4d, 0x0c, 0x08, 0x0b, 0x3c, 0x32, 0x33, 0x66, 0x17, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x22, 0x2c, 0x2d, 0x31, 0x45, 0x6b, 0x36, 0x31, 0x6b, 0x62, 0x45, 0x6a, 0x66, 0x30, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x37, 0x46, 0x6b, 0x44, 0x62, 0x5e, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x1d, 0x2c, 0x39, 0x36, 0x4c, 0x30, 0x30, 0x30, 0x36, 0x4c, 0x66, 0x4c, 0x36, 0x30, 0x37, 0x41, 0x2c, 0x2d, 0x2c, 0x3c, 0x33, 0x6b, 0x44, 0x44, 0x39, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2d, 0x2d, 0x36, 0x39, 0x2d, 0x32, 0x38, 0x38, 0x46, 0x6a, 0x6d, 0x3d, 0x62, 0x46, 0x3c, 0x37, 0x2d, 0x32, 0x32, 0x32, 0x38, 0x4c, 0x30, 0x16, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x37, 0x38, 0x38, 0x39, 0x37, 0x2c, 0x37, 0x37, 0x30, 0x45, 0x6d, 0x6d, 0x62, 0x62, 0x38, 0x3c, 0x3c, 0x32, 0x37, 0x32, 0x32, 0x32, 0x2c, 0x14, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x6e, 0x37, 0x38, 0x38, 0x38, 0x37, 0x2c, 0x2d, 0x30, 0x31, 0x62, 0x6a, 0x6d, 0x6a, 0x6a, 0x46, 0x32, 0x32, 0x37, 0x37, 0x32, 0x30, 0x17, 0x29, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x0b, 0x38, 0x38, 0x38, 0x2c, 0x2c, 0x0b, 0x2d, 0x39, 0x4c, 0x45, 0x6a, 0x6a, 0x6a, 0x6a, 0x6a, 0x38, 0x37, 0x2c, 0x41, 0x18, 0x1c, 0x0c, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2d, 0x38, 0x38, 0x37, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x4c, 0x6b, 0x44, 0x44, 0x45, 0x6a, 0x45, 0x38, 0x37, 0x1c, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x1d, 0x38, 0x38, 0x38, 0x38, 0x2c, 0x3c, 0x37, 0x37, 0x32, 0x32, 0x46, 0x36, 0x1e, 0x6b, 0x4c, 0x46, 0x32, 0x22, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x37, 0x32, 0x37, 0x38, 0x38, 0x37, 0x32, 0x3c, 0x32, 0x32, 0x37, 0x38, 0x2d, 0x2d, 0x38, 0x2c, 0x2c, 0x4f, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x3c, 0x37, 0x41, 0x38, 0x2d, 0x37, 0x37, 0x3c, 0x32, 0x3c, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x41, 0x3c, 0x3c, 0x38, 0x32, 0x3c, 0x3c, 0x3c, 0x41, 0x32, 0x41, 0x37, 0x2c, 0x2c, 0x41, 0x38, 0x45, 0x18, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x37, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x4c, 0x45, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x2c, 0x37, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x41, 0x37, 0x37, 0x4c, 0x44, 0x6d, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x5a, 0x2c, 0x41, 0x3c, 0x3c, 0x3c, 0x32, 0x2c, 0x32, 0x2c, 0x2c, 0x38, 0x38, 0x36, 0x45, 0x62, 0x44, 0x45, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x37, 0x39, 0x4c, 0x4c, 0x45, 0x62, 0x44, 0x62, 0x30, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x5a, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x46, 0x4c, 0x6b, 0x6b, 0x45, 0x3e, 0x36, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x3c, 0x37, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x38, 0x37, 0x37, 0x37, 0x38, 0x39, 0x36, 0x4c, 0x30, 0x10, 0x16, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x25, 0x1d, 0x37, 0x37, 0x41, 0x32, 0x3c, 0x32, 0x41, 0x37, 0x32, 0x2c, 0x41, 0x37, 0x2c, 0x32, 0x37, 0x2c, 0x2c, 0x5a, 0x0c, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x05, 0x15, 0x5a, 0x37, 0x2c, 0x41, 0x2c, 0x2c, 0x41, 0x37, 0x41, 0x41, 0x3c, 0x2c, 0x41, 0x41, 0x3c, 0x37, 0x2c, 0x39, 0x0b, 0x0b, 0x25, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 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, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x2a, 0x22, 0x2d, 0x37, 0x2c, 0x3c, 0x1d, 0x2c, 0x38, 0x2c, 0x41, 0x2c, 0x2c, 0x2d, 0x39, 0x37, 0x3c, 0x37, 0x30, 0x1a, 0x5e, 0x6e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 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, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x2a, 0x6e, 0x0b, 0x2d, 0x38, 0x41, 0x41, 0x6e, 0x5a, 0x2c, 0x41, 0x32, 0x38, 0x32, 0x39, 0x3f, 0x6f, 0x16, 0x37, 0x1a, 0x1f, 0x1f, 0x16, 0x1d, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x40, 0x07, 0x2c, 0x37, 0x2c, 0x2d, 0x2c, 0x1d, 0x0e, 0x09, 0x0b, 0x4b, 0x07, 0x41, 0x38, 0x2d, 0x10, 0x2d, 0x10, 0x0b, 0x2b, 0x33, 0x3f, 0x21, 0x29, 0x07, 0x5e, 0x2f, 0x12, 0x08, 0x2a, 0x0c, 0x25, 0x09, 0x09, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 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, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x40, 0x28, 0x22, 0x2c, 0x38, 0x32, 0x32, 0x32, 0x1d, 0x0e, 0x19, 0x05, 0x35, 0x2c, 0x4b, 0x70, 0x0b, 0x32, 0x2c, 0x16, 0x16, 0x16, 0x0b, 0x22, 0x26, 0x0b, 0x10, 0x3f, 0x29, 0x1f, 0x47, 0x1f, 0x1f, 0x5e, 0x0b, 0x4b, 0x74, 0x84, 0x74, 0x84, 0x06, 0x35, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x4d, 0x27, 0x0a, 0x22, 0x1d, 0x2c, 0x2c, 0x37, 0x32, 0x41, 0x41, 0x16, 0x27, 0x15, 0x09, 0x4a, 0x09, 0x28, 0x2d, 0x0b, 0x76, 0x2c, 0x37, 0x2d, 0x37, 0x32, 0x37, 0x0b, 0x0b, 0x5e, 0x5a, 0x4b, 0x0b, 0x0b, 0x07, 0x6e, 0x16, 0x5e, 0x10, 0x76, 0x5c, 0x68, 0x79, 0x7a, 0x53, 0x71, 0x54, 0x5d, 0x08, 0x4d, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x28, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x41, 0x41, 0x41, 0x22, 0x11, 0x35, 0x4d, 0x4d, 0x35, 0x1c, 0x06, 0x0a, 0x22, 0x38, 0x38, 0x37, 0x38, 0x38, 0x38, 0x2d, 0x39, 0x39, 0x39, 0x10, 0x39, 0x10, 0x4b, 0x12, 0x08, 0x35, 0x67, 0x2a, 0x08, 0x74, 0x70, 0x81, 0x55, 0x78, 0x79, 0x57, 0x53, 0x71, 0x71, 0x73, 0x84, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x09, 0x27, 0x16, 0x0b, 0x2c, 0x2d, 0x2c, 0x41, 0x41, 0x1d, 0x22, 0x5a, 0x0f, 0x14, 0x0a, 0x28, 0x0a, 0x28, 0x28, 0x28, 0x6e, 0x5a, 0x65, 0x1d, 0x0b, 0x2d, 0x38, 0x46, 0x38, 0x38, 0x38, 0x39, 0x2d, 0x46, 0x39, 0x30, 0x39, 0x4b, 0x68, 0x79, 0x7a, 0x57, 0x67, 0x67, 0x56, 0x53, 0x71, 0x68, 0x7e, 0x85, 0x59, 0x73, 0x79, 0x54, 0x7a, 0x54, 0x06, 0x1c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x4d, 0x16, 0x0b, 0x10, 0x39, 0x2d, 0x0b, 0x28, 0x06, 0x2a, 0x25, 0x35, 0x06, 0x11, 0x0a, 0x28, 0x07, 0x5a, 0x22, 0x26, 0x5a, 0x41, 0x7b, 0x7c, 0x60, 0x76, 0x22, 0x1d, 0x32, 0x38, 0x46, 0x46, 0x46, 0x38, 0x38, 0x38, 0x38, 0x2b, 0x75, 0x7d, 0x7e, 0x55, 0x78, 0x7a, 0x57, 0x57, 0x57, 0x71, 0x20, 0x68, 0x55, 0x85, 0x7a, 0x57, 0x53, 0x71, 0x57, 0x5d, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x0c, 0x16, 0x0b, 0x30, 0x39, 0x18, 0x2a, 0x09, 0x05, 0x4e, 0x19, 0x25, 0x0c, 0x27, 0x11, 0x0a, 0x0a, 0x2f, 0x5a, 0x5a, 0x26, 0x5a, 0x7b, 0x7c, 0x7c, 0x61, 0x7f, 0x7f, 0x7f, 0x76, 0x22, 0x22, 0x0b, 0x2d, 0x0b, 0x2d, 0x2d, 0x33, 0x0b, 0x5f, 0x80, 0x7d, 0x5c, 0x81, 0x55, 0x59, 0x59, 0x73, 0x73, 0x54, 0x5c, 0x5c, 0x7e, 0x55, 0x59, 0x73, 0x7a, 0x71, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x25, 0x08, 0x07, 0x5e, 0x10, 0x22, 0x1c, 0x4a, 0x05, 0x09, 0x05, 0x15, 0x4d, 0x19, 0x19, 0x4d, 0x08, 0x12, 0x74, 0x0f, 0x6e, 0x5a, 0x26, 0x1d, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x61, 0x5b, 0x82, 0x82, 0x80, 0x80, 0x82, 0x7f, 0x7f, 0x7f, 0x7f, 0x5b, 0x7f, 0x82, 0x80, 0x7d, 0x5c, 0x7e, 0x79, 0x54, 0x54, 0x7a, 0x73, 0x0f, 0x2a, 0x25, 0x19, 0x09, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x4d, 0x2a, 0x06, 0x74, 0x28, 0x22, 0x22, 0x2d, 0x2c, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x3b, 0x07, 0x19, 0x09, 0x25, 0x0c, 0x27, 0x12, 0x0f, 0x2f, 0x26, 0x26, 0x1d, 0x65, 0x65, 0x7c, 0x7c, 0x7b, 0x7c, 0x7b, 0x7b, 0x60, 0x5b, 0x7f, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x80, 0x80, 0x83, 0x83, 0x81, 0x7e, 0x59, 0x73, 0x73, 0x84, 0x5d, 0x25, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x19, 0x08, 0x12, 0x0a, 0x0f, 0x6e, 0x5a, 0x26, 0x22, 0x2c, 0x2c, 0x0b, 0x27, 0x05, 0x05, 0x05, 0x15, 0x1e, 0x1e, 0x6f, 0x0c, 0x09, 0x15, 0x0c, 0x20, 0x12, 0x0f, 0x6e, 0x5a, 0x26, 0x26, 0x26, 0x65, 0x65, 0x65, 0x65, 0x7b, 0x7c, 0x7b, 0x65, 0x7b, 0x61, 0x61, 0x60, 0x64, 0x64, 0x64, 0x5b, 0x5b, 0x5f, 0x63, 0x70, 0x63, 0x58, 0x5d, 0x2a, 0x15, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x4a, 0x4d, 0x27, 0x11, 0x0a, 0x28, 0x6e, 0x5a, 0x26, 0x65, 0x41, 0x1d, 0x2c, 0x2c, 0x5e, 0x29, 0x0e, 0x14, 0x17, 0x31, 0x6b, 0x30, 0x14, 0x25, 0x09, 0x15, 0x4d, 0x08, 0x74, 0x0a, 0x0f, 0x2f, 0x5a, 0x26, 0x26, 0x1d, 0x1d, 0x1d, 0x2b, 0x65, 0x1d, 0x41, 0x65, 0x65, 0x7b, 0x65, 0x65, 0x1d, 0x6e, 0x74, 0x5d, 0x1c, 0x25, 0x15, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x19, 0x4d, 0x08, 0x06, 0x0a, 0x2f, 0x6e, 0x2f, 0x6e, 0x26, 0x41, 0x7b, 0x65, 0x41, 0x37, 0x33, 0x30, 0x36, 0x36, 0x4c, 0x6b, 0x66, 0x30, 0x14, 0x35, 0x4a, 0x09, 0x15, 0x15, 0x25, 0x25, 0x0c, 0x1c, 0x08, 0x06, 0x5d, 0x5d, 0x5d, 0x0e, 0x06, 0x12, 0x06, 0x08, 0x1c, 0x2a, 0x0c, 0x19, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x09, 0x19, 0x35, 0x08, 0x12, 0x28, 0x2f, 0x2f, 0x6e, 0x5a, 0x41, 0x7c, 0x3c, 0x3c, 0x2c, 0x41, 0x2d, 0x2d, 0x39, 0x30, 0x4c, 0x4c, 0x66, 0x66, 0x31, 0x24, 0x20, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x4a, 0x09, 0x4a, 0x09, 0x09, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x15, 0x0c, 0x1c, 0x12, 0x28, 0x2f, 0x5a, 0x1d, 0x7c, 0x7b, 0x41, 0x7b, 0x3c, 0x7b, 0x3c, 0x41, 0x41, 0x5a, 0x16, 0x28, 0x14, 0x14, 0x14, 0x3b, 0x12, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x4a, 0x09, 0x15, 0x1c, 0x12, 0x12, 0x0a, 0x0f, 0x2f, 0x07, 0x2f, 0x0a, 0x12, 0x27, 0x0c, 0x4d, 0x15, 0x09, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x15, 0x15, 0x15, 0x19, 0x4e, 0x4e, 0x05, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 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, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
diff --git a/sys/modules/syscons/logo/logo_saver.c b/sys/modules/syscons/logo/logo_saver.c
deleted file mode 100644
index 1db8dcc496b68..0000000000000
--- a/sys/modules/syscons/logo/logo_saver.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer
- * in this position and unchanged.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: logo_saver.c,v 1.3 1999/01/11 03:18:49 yokota Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/syslog.h>
-
-#include <saver.h>
-
-static u_char *vid;
-static int banksize, scrmode, scrw, scrh;
-static int blanked;
-
-#include "logo.c"
-
-static void
-logo_blit(video_adapter_t *adp, int x, int y)
-{
- int d, l, o, p;
-
- for (o = 0, p = y * scrw + x; p > banksize; p -= banksize)
- o += banksize;
- set_origin(adp, o);
-
- for (d = 0; d < sizeof logo_img; d += logo_w) {
- if (p + logo_w < banksize) {
- bcopy(logo_img + d, vid + p, logo_w);
- p += scrw;
- } else if (p < banksize) {
- l = banksize - p;
- bcopy(logo_img + d, vid + p, l);
- set_origin(adp, (o += banksize));
- bcopy(logo_img + d + l, vid, logo_w - l);
- p += scrw - banksize;
- } else {
- p -= banksize;
- set_origin(adp, (o += banksize));
- bcopy(logo_img + d, vid + p, logo_w);
- p += scrw;
- }
- }
-}
-
-static void
-logo_update(video_adapter_t *adp)
-{
- static int xpos = 0, ypos = 0;
- static int xinc = 1, yinc = 1;
-
- /* Turn when you hit the edge */
- if ((xpos + logo_w + xinc > scrw) || (xpos + xinc < 0))
- xinc = -xinc;
- if ((ypos + logo_h + yinc > scrh) || (ypos + yinc < 0))
- yinc = -yinc;
- xpos += xinc;
- ypos += yinc;
-
- /* XXX Relies on margin around logo to erase trail */
- logo_blit(adp, xpos, ypos);
-}
-
-static int
-logo_saver(video_adapter_t *adp, int blank)
-{
- int i, pl;
-
- if (blank) {
- /* switch to graphics mode */
- if (blanked <= 0) {
- pl = splhigh();
- set_video_mode(adp, scrmode, logo_pal, 0);
- blanked++;
- vid = (u_char *)adp->va_window;
- splx(pl);
- for (i = 0; i < scrw*scrh; i += banksize) {
- set_origin(adp, i);
- bzero(vid, banksize);
- }
- }
- logo_update(adp);
- } else {
- blanked = 0;
- }
- return 0;
-}
-
-static int
-logo_init(video_adapter_t *adp)
-{
- video_info_t info;
-
- if (!get_mode_info(adp, M_VESA_CG800x600, &info)) {
- scrmode = M_VESA_CG800x600;
- } else if (!get_mode_info(adp, M_VGA_CG320, &info)) {
- scrmode = M_VGA_CG320;
- } else {
- log(LOG_NOTICE, "logo_saver: no suitable graphics mode\n");
- return ENODEV;
- }
-
- banksize = info.vi_window_size;
- scrw = info.vi_width;
- scrh = info.vi_height;
- blanked = 0;
-
- return 0;
-}
-
-static int
-logo_term(video_adapter_t *adp)
-{
- return 0;
-}
-
-static scrn_saver_t logo_module = {
- "logo_saver", logo_init, logo_term, logo_saver, NULL,
-};
-
-SAVER_MODULE(logo_saver, logo_module);
diff --git a/sys/modules/syscons/rain/Makefile b/sys/modules/syscons/rain/Makefile
deleted file mode 100644
index 8b964f34a0fa0..0000000000000
--- a/sys/modules/syscons/rain/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $Id: Makefile,v 1.1 1998/12/27 22:03:09 des Exp $
-
-KMOD= rain_saver
-SRCS= rain_saver.c
-
-NOMAN=
-CFLAGS+= -I${.CURDIR}/..
-CWARNFLAGS= -Wall -pedantic
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/rain/rain_saver.c b/sys/modules/syscons/rain/rain_saver.c
deleted file mode 100644
index 0b4b2ee3e9e29..0000000000000
--- a/sys/modules/syscons/rain/rain_saver.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer
- * in this position and unchanged.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: rain_saver.c,v 1.1 1998/12/31 13:41:40 des Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/syslog.h>
-
-#include <machine/random.h>
-
-#include <saver.h>
-
-static u_char *vid;
-
-#define SCRW 320
-#define SCRH 200
-#define MAX 63
-
-static u_char rain_pal[768];
-static int blanked;
-
-static void
-rain_update(video_adapter_t *adp)
-{
- int i, t;
-
- t = rain_pal[(MAX*3+2)];
- for (i = (MAX*3+2); i > 5; i -= 3)
- rain_pal[i] = rain_pal[i-3];
- rain_pal[5] = t;
- load_palette(adp, rain_pal);
-}
-
-static int
-rain_saver(video_adapter_t *adp, int blank)
-{
- int i, j, k, pl;
-
- if (blank) {
- /* switch to graphics mode */
- if (blanked <= 0) {
- pl = splhigh();
- set_video_mode(adp, M_VGA_CG320, rain_pal, 0);
- blanked++;
- vid = (u_char *)adp->va_window;
- splx(pl);
- bzero(vid, SCRW*SCRH);
- for (i = 0; i < SCRW; i += 2)
- vid[i] = 1 + (random() % MAX);
- for (j = 1, k = SCRW; j < SCRH; j++)
- for (i = 0; i < SCRW; i += 2, k += 2)
- vid[k] = (vid[k-SCRW] < MAX) ? 1 + vid[k-SCRW] : 1;
- }
-
- /* update display */
- rain_update(adp);
-
- } else {
- blanked = 0;
- }
- return 0;
-}
-
-static int
-rain_init(video_adapter_t *adp)
-{
- video_info_t info;
- int i;
-
- /* check that the console is capable of running in 320x200x256 */
- if (get_mode_info(adp, M_VGA_CG320, &info)) {
- log(LOG_NOTICE, "rain_saver: the console does not support M_VGA_CG320\n");
- return ENODEV;
- }
-
- /* intialize the palette */
- for (i = 3; i < (MAX+1)*3; i += 3)
- rain_pal[i+2] = rain_pal[i-1] + 4;
-
- blanked = 0;
-
- return 0;
-}
-
-static int
-rain_term(video_adapter_t *adp)
-{
- return 0;
-}
-
-static scrn_saver_t rain_module = {
- "rain_saver", rain_init, rain_term, rain_saver, NULL,
-};
-
-SAVER_MODULE(rain_saver, rain_module);
diff --git a/sys/modules/syscons/saver.h b/sys/modules/syscons/saver.h
index 661b15acaba93..9eb19956327f2 100644
--- a/sys/modules/syscons/saver.h
+++ b/sys/modules/syscons/saver.h
@@ -25,26 +25,20 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: saver.h,v 1.15 1999/01/11 03:18:42 yokota Exp $
+ * $Id: saver.h,v 1.11 1998/09/15 18:16:38 sos Exp $
*/
#include <machine/apm_bios.h>
#include <machine/console.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
+#include <i386/isa/videoio.h>
+#include <i386/isa/syscons.h>
-#include <dev/syscons/syscons.h>
-
-#define set_video_mode(adp, mode, pal, border) \
- { \
- (*vidsw[(adp)->va_index]->set_mode)((adp), (mode)); \
- (*vidsw[(adp)->va_index]->load_palette)((adp), (pal)); \
- (*vidsw[(adp)->va_index]->set_border)((adp), (border)); \
- }
-#define get_mode_info(adp, mode, buf) \
- (*vidsw[(adp)->va_index]->get_info)((adp), (mode), (buf))
-#define set_origin(adp, o) \
- (*vidsw[(adp)->va_index]->set_win_org)(adp, o)
-
extern scr_stat *cur_console;
+extern u_short *Crtat;
+extern u_int crtc_addr;
+extern char crtc_type;
extern char scr_map[];
+extern int scrn_blanked;
+extern int fonts_loaded;
+extern char font_8[], font_14[], font_16[];
+extern char palette[];
diff --git a/sys/modules/syscons/snake/snake_saver.c b/sys/modules/syscons/snake/snake_saver.c
index 642e6b15b309e..efb76d505df73 100644
--- a/sys/modules/syscons/snake/snake_saver.c
+++ b/sys/modules/syscons/snake/snake_saver.c
@@ -25,12 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: snake_saver.c,v 1.21 1999/01/11 03:18:52 yokota Exp $
+ * $Id: snake_saver.c,v 1.18 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
@@ -40,14 +42,15 @@
#include <saver.h>
+MOD_MISC(snake_saver);
+
static char *message;
static u_char **messagep;
static int messagelen;
static u_short *window;
-static int blanked;
-static int
-snake_saver(video_adapter_t *adp, int blank)
+static void
+snake_saver(int blank)
{
static int dirx, diry;
int f;
@@ -58,11 +61,12 @@ snake_saver(video_adapter_t *adp, int blank)
#define savs messagep
if (blank) {
- if (adp->va_mode_flags & V_INFO_GRAPHICS)
- return EAGAIN;
- if (blanked <= 0) {
- window = (u_short *)adp->va_window;
- fillw(((FG_LIGHTGREY|BG_BLACK)<<8) | scr_map[0x20],
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked <= 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8 | scr_map[0x20],
window, scp->xsize * scp->ysize);
set_border(scp, 0);
dirx = (scp->xpos ? 1 : -1);
@@ -72,11 +76,16 @@ snake_saver(video_adapter_t *adp, int blank)
savs[f] = (u_char *)window + 2 *
(scp->xpos+scp->ypos*scp->xsize);
*(savs[0]) = scr_map[*save];
- blanked = 1;
+ f = scp->ysize * scp->xsize + 5;
+ outb(crtc_addr, 14);
+ outb(crtc_addr+1, f >> 8);
+ outb(crtc_addr, 15);
+ outb(crtc_addr+1, f & 0xff);
+ scrn_blanked = 1;
}
- if (blanked++ < 4)
- return 0;
- blanked = 1;
+ if (scrn_blanked++ < 4)
+ return;
+ scrn_blanked = 1;
*(savs[messagelen-1]) = scr_map[0x20];
for (f=messagelen-1; f > 0; f--)
savs[f] = savs[f-1];
@@ -94,31 +103,48 @@ snake_saver(video_adapter_t *adp, int blank)
*(savs[f]) = scr_map[save[f]];
}
else {
- blanked = 0;
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
}
- return 0;
}
static int
-snake_init(video_adapter_t *adp)
+snake_saver_load(struct lkm_table *lkmtp, int cmd)
{
+ int err;
+
messagelen = strlen(ostype) + 1 + strlen(osrelease);
message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK);
sprintf(message, "%s %s", ostype, osrelease);
messagep = malloc(messagelen * sizeof *messagep, M_DEVBUF, M_WAITOK);
- return 0;
+
+ err = add_scrn_saver(snake_saver);
+ if (err != 0) {
+ free(message, M_DEVBUF);
+ free(messagep, M_DEVBUF);
+ }
+ return err;
}
static int
-snake_term(video_adapter_t *adp)
+snake_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- free(message, M_DEVBUF);
- free(messagep, M_DEVBUF);
- return 0;
-}
+ int err;
-static scrn_saver_t snake_module = {
- "snake_saver", snake_init, snake_term, snake_saver, NULL,
-};
+ err = remove_scrn_saver(snake_saver);
+ if (err == 0) {
+ free(message, M_DEVBUF);
+ free(messagep, M_DEVBUF);
+ }
+ return err;
+}
-SAVER_MODULE(snake_saver, snake_module);
+int
+snake_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(snake_saver, lkmtp, cmd, ver,
+ snake_saver_load, snake_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/star/star_saver.c b/sys/modules/syscons/star/star_saver.c
index 463a0ae0f3f88..2e56a3c96fbd6 100644
--- a/sys/modules/syscons/star/star_saver.c
+++ b/sys/modules/syscons/star/star_saver.c
@@ -25,30 +25,32 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: star_saver.c,v 1.18 1999/01/11 03:18:53 yokota Exp $
+ * $Id: star_saver.c,v 1.15 1998/09/15 18:16:39 sos Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
#include <machine/md_var.h>
#include <machine/pc/display.h>
#include <saver.h>
+MOD_MISC(star_saver);
+
#define NUM_STARS 50
static u_short *window;
-static int blanked;
/*
* Alternate saver that got its inspiration from a well known utility
* package for an inferior^H^H^H^H^H^Hfamous OS.
*/
-static int
-star_saver(video_adapter_t *adp, int blank)
+static void
+star_saver(int blank)
{
scr_stat *scp = cur_console;
int cell, i;
@@ -58,15 +60,15 @@ star_saver(video_adapter_t *adp, int blank)
static u_short stars[NUM_STARS][2];
if (blank) {
- if (adp->va_mode_flags & V_INFO_GRAPHICS)
- return EAGAIN;
- if (!blanked) {
- window = (u_short *)adp->va_window;
- /* clear the screen and set the border color */
- fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
- window, scp->xsize * scp->ysize);
+ if (!ISTEXTSC(scp))
+ return;
+ if (scrn_blanked <= 0) {
+ scp->status |= SAVER_RUNNING;
+ window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
+ scrn_blanked = 1;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], window,
+ scp->xsize * scp->ysize);
set_border(scp, 0);
- blanked = TRUE;
for(i=0; i<NUM_STARS; i++) {
stars[i][0] =
random() % (scp->xsize*scp->ysize);
@@ -83,26 +85,29 @@ star_saver(video_adapter_t *adp, int blank)
}
}
else {
- blanked = FALSE;
+ if (scrn_blanked > 0) {
+ set_border(scp, scp->border);
+ scrn_blanked = 0;
+ scp->status &= ~SAVER_RUNNING;
+ }
}
- return 0;
}
static int
-star_init(video_adapter_t *adp)
+star_saver_load(struct lkm_table *lkmtp, int cmd)
{
- blanked = FALSE;
- return 0;
+ return add_scrn_saver(star_saver);
}
static int
-star_term(video_adapter_t *adp)
+star_saver_unload(struct lkm_table *lkmtp, int cmd)
{
- return 0;
+ return remove_scrn_saver(star_saver);
}
-static scrn_saver_t star_module = {
- "star_saver", star_init, star_term, star_saver, NULL,
-};
-
-SAVER_MODULE(star_saver, star_module);
+int
+star_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(star_saver, lkmtp, cmd, ver,
+ star_saver_load, star_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/warp/Makefile b/sys/modules/syscons/warp/Makefile
deleted file mode 100644
index 3902ca0eac538..0000000000000
--- a/sys/modules/syscons/warp/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $Id: Makefile,v 1.1 1998/12/27 22:03:09 des Exp $
-
-KMOD= warp_saver
-SRCS= warp_saver.c
-
-NOMAN=
-CFLAGS+= -I${.CURDIR}/..
-CWARNFLAGS= -Wall -pedantic
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/warp/warp_saver.c b/sys/modules/syscons/warp/warp_saver.c
deleted file mode 100644
index ef0afa2bebfa7..0000000000000
--- a/sys/modules/syscons/warp/warp_saver.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer
- * in this position and unchanged.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: warp_saver.c,v 1.3 1998/12/31 13:38:59 des Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/syslog.h>
-
-#include <machine/md_var.h>
-#include <machine/random.h>
-
-#include <saver.h>
-
-static u_char *vid;
-static int blanked;
-
-#define SCRW 320
-#define SCRH 200
-#define SPP 15
-#define STARS (SPP*(1+2+4+8))
-
-static int star[STARS];
-static u_char warp_pal[768] = {
- 0x00, 0x00, 0x00,
- 0x66, 0x66, 0x66,
- 0x99, 0x99, 0x99,
- 0xcc, 0xcc, 0xcc,
- 0xff, 0xff, 0xff
- /* the rest is zero-filled by the compiler */
-};
-
-static void
-warp_update(void)
-{
- int i, j, k, n;
-
- for (i = 1, k = 0, n = SPP*8; i < 5; i++, n /= 2)
- for (j = 0; j < n; j++, k++) {
- vid[star[k]] = 0;
- star[k] += i;
- if (star[k] > SCRW*SCRH)
- star[k] -= SCRW*SCRH;
- vid[star[k]] = i;
- }
-}
-
-static int
-warp_saver(video_adapter_t *adp, int blank)
-{
- int pl;
-
- if (blank) {
- /* switch to graphics mode */
- if (blanked <= 0) {
- pl = splhigh();
- set_video_mode(adp, M_VGA_CG320, warp_pal, 0);
- blanked++;
- vid = (u_char *)adp->va_window;
- splx(pl);
- bzero(vid, SCRW*SCRH);
- }
-
- /* update display */
- warp_update();
-
- } else {
- blanked = 0;
- }
- return 0;
-}
-
-static int
-warp_init(video_adapter_t *adp)
-{
- video_info_t info;
- int i;
-
- /* check that the console is capable of running in 320x200x256 */
- if (get_mode_info(adp, M_VGA_CG320, &info)) {
- log(LOG_NOTICE, "warp_saver: the console does not support M_VGA_CG320\n");
- return ENODEV;
- }
-
- /* randomize the star field */
- for (i = 0; i < STARS; i++) {
- star[i] = random() % (SCRW*SCRH);
- }
-
- blanked = 0;
-
- return 0;
-}
-
-static int
-warp_term(video_adapter_t *adp)
-{
- return 0;
-}
-
-static scrn_saver_t warp_module = {
- "warp_saver", warp_init, warp_term, warp_saver, NULL,
-};
-
-SAVER_MODULE(warp_saver, warp_module);
diff --git a/sys/modules/vesa/Makefile b/sys/modules/vesa/Makefile
index 6de1c879120ca..62dd4bc141e6e 100644
--- a/sys/modules/vesa/Makefile
+++ b/sys/modules/vesa/Makefile
@@ -1,32 +1,19 @@
-# $Id: Makefile,v 1.4 1998/12/30 11:21:07 yokota Exp $
+# $Id: Makefile,v 1.2 1998/09/15 20:14:11 sos Exp $
-.PATH: ${.CURDIR}/../../dev/syscons ${.CURDIR}/../../i386/isa
+.PATH: ${.CURDIR}/../../i386/isa
KMOD = vesa
-SRCS = vesa.c scvesactl.c sc.h vga.h opt_syscons.h opt_vga.h \
- opt_vesa.h opt_vm86.h opt_fb.h
+SRCS = vesa.c scvesactl.c sc.h opt_vesa.h opt_vm86.h
NOMAN =
-CLEANFILES += sc.h vga.h opt_syscons.h opt_vga.h opt_vesa.h opt_vm86.h \
- opt_fb.h
+CFLAGS += -DVESA_MODULE
+CLEANFILES += sc.h opt_vesa.h opt_vm86.h
sc.h:
echo "#define NSC 1" > sc.h
-vga.h:
- echo "#define NVGA 1" > vga.h
-
-opt_syscons.h:
- touch opt_syscons.h
-
-opt_vga.h:
- touch opt_vga.h
-
opt_vesa.h:
echo "#define VESA 1" > opt_vesa.h
opt_vm86.h:
echo "#define VM86 1" > opt_vm86.h
-opt_fb.h:
- touch opt_fb.h
-
.include <bsd.kmod.mk>
diff --git a/sys/dev/vinum/COPYRIGHT b/sys/modules/vinum/COPYRIGHT
index ed43ff1f54ebb..4ee95f20ce5ca 100644
--- a/sys/dev/vinum/COPYRIGHT
+++ b/sys/modules/vinum/COPYRIGHT
@@ -33,5 +33,5 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: COPYRIGHT,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
+ * $Id: COPYRIGHT,v 1.1 1998/03/05 06:07:05 grog Exp grog $
*/
diff --git a/sys/modules/vinum/Makefile b/sys/modules/vinum/Makefile
index 0a89def26a8e5..6489222ef0c30 100644
--- a/sys/modules/vinum/Makefile
+++ b/sys/modules/vinum/Makefile
@@ -1,23 +1,20 @@
-# $Id: Makefile.Vinum,v 1.1 1999/01/18 04:49:18 grog Exp grog $
+# $Id: Makefile,v 1.2 1998/09/28 04:21:20 grog Exp $
-SOURCE= ${.CURDIR}/../../dev/vinum
-
-.PATH: ${SOURCE}
+.PATH: ${.CURDIR}/../../dev/ccd
KMOD= vinum
-SRCS= vnode_if.h opt_vinum.h vinumstate.h vinumvar.h \
- vinumhdr.h request.h vinumext.h vinumio.h vinumkw.h \
- vinum.c vinumparser.c vinumconfig.c vinumio.c vinumutil.c \
- vinumstate.c vinummemory.c vinumrequest.c vinumlock.c \
- vinumrevive.c vinumioctl.c vinuminterrupt.c vinumdaemon.c
-
+SRCS= vinum.c vinum.h vnode_if.h parser.c config.c io.c util.c vinumhdr.h request.h \
+ state.c memory.c request.c lock.c vinumext.h vinumio.h vinumkw.h \
+ vinumstate.h vinumvar.h revive.c vinumioctl.c interrupt.c
NOMAN=
+CFLAGS = -I${.CURDIR} -O -g -I/usr/include/machine -DDEBUG -Wall -Wno-unused -Wno-parentheses
-CLEANFILES+= vnode_if.h vnode_if.c opt_vinum.h
+CLEANFILES+= vinum.h vnode_if.h vnode_if.c
all:
-opt_vinum.h:
- @touch opt_vinum.h
+# We don't need this, but the Makefile wants it
+vinum.h:
+ touch $@
state.h: maketabs vinumstate.h
./maketabs >state.h
@@ -26,5 +23,3 @@ maketabs: maketabs.c
${CC} -g -o maketabs maketabs.c
.include <bsd.kmod.mk>
-
-CFLAGS += -I${SOURCE} -g -DVINUMDEBUG -Wall -Wno-unused -Wno-parentheses
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/modules/vinum/config.c
index 32e56b9250560..fd31c5e07c46f 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/modules/vinum/config.c
@@ -44,19 +44,20 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumconfig.c,v 1.22 1998/12/30 05:07:24 grog Exp grog $
+ * $Id: config.c,v 1.17 1998/08/14 04:49:26 grog Exp grog $
*/
#define STATIC /* nothing while we're testing XXX */
#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
+#include "vinumhdr.h"
extern jmp_buf command_fail; /* return on a failed command */
+#if __FreeBSD__ >= 3
/* Why aren't these declared anywhere? XXX */
void longjmp(jmp_buf, int);
+#endif
#define MAXTOKEN 64 /* maximum number of tokens in a line */
@@ -93,6 +94,7 @@ struct putchar_arg {
void
throw_rude_remark(int error, char *msg,...)
{
+ BROKEN_GDB;
int retval;
va_list ap;
char *text;
@@ -145,6 +147,7 @@ int atoi(char *); /* no atoi in the kernel */
int
atoi(char *s)
{ /* no atoi in the kernel */
+ BROKEN_GDB;
int r = 0;
int sign = 1;
@@ -162,6 +165,7 @@ atoi(char *s)
int
volume_index(struct volume *vol)
{
+ BROKEN_GDB;
int i;
for (i = 0; i < vinum_conf.volumes_used; i++)
@@ -175,6 +179,7 @@ volume_index(struct volume *vol)
int
plex_index(struct plex *plex)
{
+ BROKEN_GDB;
int i;
for (i = 0; i < vinum_conf.plexes_used; i++)
@@ -188,6 +193,7 @@ plex_index(struct plex *plex)
int
sd_index(struct sd *sd)
{
+ BROKEN_GDB;
int i;
for (i = 0; i < vinum_conf.subdisks_used; i++)
@@ -201,6 +207,7 @@ sd_index(struct sd *sd)
int
drive_index(struct drive *drive)
{
+ BROKEN_GDB;
int i;
for (i = 0; i < vinum_conf.drives_used; i++)
@@ -214,6 +221,7 @@ drive_index(struct drive *drive)
int
my_plex(int volno, int plexno)
{
+ BROKEN_GDB;
int i;
struct volume *vol;
@@ -229,6 +237,7 @@ my_plex(int volno, int plexno)
int
my_sd(int plexno, int sdno)
{
+ BROKEN_GDB;
int i;
struct plex *plex;
@@ -244,14 +253,16 @@ my_sd(int plexno, int sdno)
void
checkkernel(char *op)
{
+ BROKEN_GDB;
if (vinum_conf.flags & VF_KERNELOP == 0)
- throw_rude_remark(EPERM, "Can't perform '%s' from user space", op);
+ throw_rude_remark(EPERM, "Can't perform '%s' from user space", op);
}
/* Add plex to the volume if possible */
int
give_plex_to_volume(int volno, int plexno)
{
+ BROKEN_GDB;
struct volume *vol;
/* XXX It's not an error for the plex to already
@@ -266,9 +277,6 @@ give_plex_to_volume(int volno, int plexno)
throw_rude_remark(ENOSPC,
"Too many plexes for volume %s",
vol->name);
- else if ((vol->plexes > 0) /* we have other plexes */
- &&(vol->flags & VF_CONFIG_SETUPSTATE == 0)) /* and we're not setting up state */
- invalidate_subdisks(&PLEX[plexno], sd_stale); /* make the subdisks invalid */
vol->plex[vol->plexes] = plexno; /* this one */
vol->plexes++; /* add another plex */
PLEX[plexno].volno = volno; /* note the number of our volume */
@@ -280,6 +288,7 @@ give_plex_to_volume(int volno, int plexno)
int
give_sd_to_plex(int plexno, int sdno)
{
+ BROKEN_GDB;
int i;
struct plex *plex;
struct sd *sd;
@@ -299,29 +308,27 @@ give_sd_to_plex(int plexno, int sdno)
if (sd->plexoffset < 0) { /* no offset specified */
if (plex->subdisks > 0) {
struct sd *lastsd = &SD[plex->sdnos[plex->subdisks - 1]]; /* last subdisk */
-
- if (plex->organization == plex_concat) /* concat, */
- sd->plexoffset = lastsd->sectors + lastsd->plexoffset; /* starts here */
- else /* striped or RAID-5, */
- sd->plexoffset = plex->stripesize * plex->subdisks; /* starts here */
+ sd->plexoffset = lastsd->sectors + lastsd->plexoffset; /* take it */
} else /* first subdisk */
sd->plexoffset = 0; /* start at the beginning */
}
- if (plex->subdisks == MAXSD) /* we already have our maximum */
- throw_rude_remark(ENOSPC, /* crap out */
- "Can't add %s to %s: plex full\n",
- sd->name,
- plex->name);
-
plex->subdisks++; /* another entry */
if (plex->subdisks >= plex->subdisks_allocated) /* need more space */
EXPAND(plex->sdnos, int, plex->subdisks_allocated, INITIAL_SUBDISKS_IN_PLEX);
- /* Adjust size of plex and volume. */
- plex->length += sd->sectors; /* plex gets this much bigger */
- if (plex->volno >= 0) /* we have a volume */
- VOL[plex->volno].size = max(VOL[plex->volno].size, plex->length); /* adjust its size */
-
+ /* XXX I'm not sure this makes any sense
+ * for anything except concatenated plexes,
+ * and it comes up with the wrong answer for
+ * RAID-5 plexes, but it's currently needed
+ * for the calculations. We'll adjust for
+ * RAID-5 in config_plex */
+ if ((sd->sectors + sd->plexoffset) > plex->length) { /* gone beyond the end of the plex */
+ plex->length = sd->sectors + sd->plexoffset; /* adjust the length */
+
+ if ((plex->volno >= 0) /* we have a volume */
+ &&(plex->length > VOL[plex->volno].size)) /* and we're now the longest plex */
+ VOL[plex->volno].size = plex->length; /* increase the size of the volume */
+ }
/* We need to check that the subdisks don't overlap,
* but we can't do that until a point where we *must*
* know the size of all the subdisks. That's not
@@ -334,7 +341,6 @@ give_sd_to_plex(int plexno, int sdno)
for (j = plex->subdisks - 1; j > i; j--) /* move up one at a time */
plex->sdnos[j] = plex->sdnos[j - 1];
plex->sdnos[i] = sdno;
- sd->plexsdno = i; /* note where we are in the subdisk */
return i;
}
}
@@ -342,7 +348,6 @@ give_sd_to_plex(int plexno, int sdno)
/* The plex doesn't have any subdisk with a larger
* offset. Insert it */
plex->sdnos[i] = sdno;
- sd->plexsdno = i; /* note where we are in the subdisk */
return i;
}
@@ -352,6 +357,7 @@ give_sd_to_plex(int plexno, int sdno)
static void
give_sd_to_drive(int sdno)
{
+ BROKEN_GDB;
struct sd *sd; /* pointer to subdisk */
struct drive *drive; /* and drive */
int fe; /* index in free list */
@@ -359,9 +365,9 @@ give_sd_to_drive(int sdno)
sd = &SD[sdno]; /* point to sd */
drive = &DRIVE[sd->driveno]; /* and drive */
- if (drive->state != drive_up)
- update_sd_state(sdno); /* that crashes the subdisk */
- if (sd->sectors > drive->sectors_available) { /* too big, */
+ if (drive->state != drive_up) /* not up */
+ throw_rude_remark(EIO, "Drive %s is not accessible", drive->label.name);
+ else if (sd->sectors > drive->sectors_available) { /* too big, */
sd->driveoffset = -1; /* don't be confusing */
throw_rude_remark(ENOSPC, "No space for %s on %s", sd->name, drive->label.name);
}
@@ -456,6 +462,7 @@ give_sd_to_drive(int sdno)
int
get_empty_drive(void)
{
+ BROKEN_GDB;
int driveno;
struct drive *drive;
@@ -481,13 +488,14 @@ get_empty_drive(void)
/* Find the named drive in vinum_conf.drive, return a pointer
* return the index in vinum_conf.drive.
- * Don't mark the drive as allocated (XXX SMP)
+ * Don't mark the drive as allocated (XXX MP)
* If create != 0, create an entry if it doesn't exist
*/
/* XXX check if we have it open from attach */
int
find_drive(const char *name, int create)
{
+ BROKEN_GDB;
int driveno;
struct drive *drive;
@@ -511,7 +519,6 @@ find_drive(const char *name, int create)
min(sizeof(drive->label.name),
strlen(name)));
drive->state = drive_uninit; /* in use, nothing worthwhile there */
- drive->flags |= VF_NEWBORN; /* newly born drive */
return driveno; /* return the index */
}
@@ -521,13 +528,14 @@ find_drive(const char *name, int create)
int
find_drive_by_dev(const char *devname, int create)
{
+ BROKEN_GDB;
int driveno;
struct drive *drive;
for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
drive = &DRIVE[driveno]; /* point to drive */
if ((drive->label.name[0] != '\0') /* it has a name */
- &&(strcmp(drive->devicename, devname) == 0)) /* and it's this one: found */
+ &&(strcmp(drive->label.name, devname) == 0)) /* and it's this one: found */
return driveno;
}
@@ -542,7 +550,6 @@ find_drive_by_dev(const char *devname, int create)
min(sizeof(drive->devicename),
strlen(devname)));
drive->state = drive_uninit; /* in use, nothing worthwhile there */
- drive->flags |= VF_NEWBORN; /* newly born drive */
return driveno; /* return the index */
}
@@ -550,6 +557,7 @@ find_drive_by_dev(const char *devname, int create)
int
get_empty_sd(void)
{
+ BROKEN_GDB;
int sdno;
struct sd *sd;
@@ -578,12 +586,10 @@ get_empty_sd(void)
void
free_drive(struct drive *drive)
{
- lockdrive(drive);
+ BROKEN_GDB;
if (drive->vp != NULL) /* device open */
vn_close(drive->vp, FREAD | FWRITE, FSCRED, drive->p);
bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */
- vinum_conf.drives_used--; /* one less drive */
- unlockdrive(drive);
}
/* Find the named subdisk in vinum_conf.sd.
@@ -595,6 +601,7 @@ free_drive(struct drive *drive)
int
find_subdisk(const char *name, int create)
{
+ BROKEN_GDB;
int sdno;
struct sd *sd;
@@ -611,7 +618,6 @@ find_subdisk(const char *name, int create)
sdno = get_empty_sd();
sd = &SD[sdno];
bcopy(name, sd->name, min(sizeof(sd->name), strlen(name))); /* put in its name */
- sd->flags |= VF_NEWBORN; /* newly born subdisk */
return sdno; /* return the pointer */
}
@@ -622,6 +628,7 @@ find_subdisk(const char *name, int create)
void
free_sd(int sdno)
{
+ BROKEN_GDB;
struct sd *sd;
struct drive *drive;
int fe; /* free list entry */
@@ -700,13 +707,13 @@ free_sd(int sdno)
}
bzero(sd, sizeof(struct sd)); /* and clear it out */
sd->state = sd_unallocated;
- vinum_conf.subdisks_used--; /* one less sd */
}
/* Find an empty plex in the plex table */
int
get_empty_plex(void)
{
+ BROKEN_GDB;
int plexno;
struct plex *plex; /* if we allocate one */
@@ -743,6 +750,7 @@ get_empty_plex(void)
int
find_plex(const char *name, int create)
{
+ BROKEN_GDB;
int plexno;
struct plex *plex;
@@ -759,7 +767,6 @@ find_plex(const char *name, int create)
plexno = get_empty_plex();
plex = &PLEX[plexno]; /* point to it */
bcopy(name, plex->name, min(sizeof(plex->name), strlen(name))); /* put in its name */
- plex->flags |= VF_NEWBORN; /* newly born plex */
return plexno; /* return the pointer */
}
@@ -768,6 +775,7 @@ find_plex(const char *name, int create)
void
free_plex(int plexno)
{
+ BROKEN_GDB;
struct plex *plex;
plex = &PLEX[plexno];
@@ -775,15 +783,19 @@ free_plex(int plexno)
Free(plex->sdnos);
if (plex->lock)
Free(plex->lock);
+ if (plex->defective_region)
+ Free(plex->defective_region);
+ if (plex->unmapped_region)
+ Free(plex->unmapped_region);
bzero(plex, sizeof(struct plex)); /* and clear it out */
plex->state = plex_unallocated;
- vinum_conf.plexes_used--; /* one less plex */
}
/* Find an empty volume in the volume table */
int
get_empty_volume(void)
{
+ BROKEN_GDB;
int volno;
struct volume *vol;
@@ -817,6 +829,7 @@ get_empty_volume(void)
int
find_volume(const char *name, int create)
{
+ BROKEN_GDB;
int volno;
struct volume *vol;
@@ -834,7 +847,6 @@ find_volume(const char *name, int create)
vol = &VOL[volno];
bcopy(name, vol->name, min(sizeof(vol->name), strlen(name))); /* put in its name */
vol->blocksize = DEV_BSIZE; /* block size of this volume */
- vol->flags |= VF_NEWBORN; /* newly born volume */
return volno; /* return the pointer */
}
@@ -843,12 +855,12 @@ find_volume(const char *name, int create)
void
free_volume(int volno)
{
+ BROKEN_GDB;
struct volume *vol;
vol = &VOL[volno];
bzero(vol, sizeof(struct volume)); /* and clear it out */
vol->state = volume_unallocated;
- vinum_conf.volumes_used--; /* one less volume */
}
/* Handle a drive definition. We store the information in the global variable
@@ -857,8 +869,9 @@ free_volume(int volno)
* If we find an error, print a message and return
*/
void
-config_drive(int update)
+config_drive(void)
{
+ BROKEN_GDB;
enum drive_label_info partition_status; /* info about the partition */
int parameter;
int driveno; /* index of drive in vinum_conf */
@@ -868,9 +881,6 @@ config_drive(int update)
throw_rude_remark(EINVAL, "Drive has no name");
driveno = find_drive(token[1], 1); /* allocate a drive to initialize */
drive = &DRIVE[driveno]; /* and get a pointer */
- if (update && ((drive->flags & VF_NEWBORN) == 0)) /* this drive exists already */
- return; /* don't do anything */
- drive->flags &= ~VF_NEWBORN; /* no longer newly born */
if (drive->state != drive_uninit) { /* we already know this drive */
/* XXX Check which definition is more up-to-date. Give
@@ -887,14 +897,13 @@ config_drive(int update)
else /* no change */
break;
}
- /* open the device and get the configuration */
bcopy(token[parameter], /* insert device information */
drive->devicename,
min(sizeof(drive->devicename),
strlen(token[parameter])));
- partition_status = read_drive_label(drive, 1);
- switch (partition_status) {
- case DL_CANT_OPEN: /* not our kind */
+ /* open the device and get the configuration */
+ partition_status = read_drive_label(drive);
+ if (partition_status == DL_CANT_OPEN) { /* not our kind */
close_drive(drive);
if (drive->lasterror == EFTYPE) /* wrong kind of partition */
throw_rude_remark(drive->lasterror,
@@ -904,30 +913,13 @@ config_drive(int update)
throw_rude_remark(drive->lasterror,
"Can't initialize drive %s",
drive->label.name);
- break;
-
- case DL_WRONG_DRIVE: /* valid drive, not the name we expected */
+ } else if (partition_status == DL_WRONG_DRIVE) { /* valid drive, not ours */
close_drive(drive);
throw_rude_remark(drive->lasterror,
"Incorrect drive name %s specified for drive %s",
token[1],
drive->label.name);
- break;
-
- case DL_DELETED_LABEL: /* it was a drive, but we deleted it */
- break;
-
- case DL_NOT_OURS: /* nothing to do with the rest */
- case DL_OURS:
- break;
}
- /* read_drive_label overwrites the device name.
- * If we get here, we can have the drive,
- * so put it back again */
- bcopy(token[parameter],
- drive->devicename,
- min(sizeof(drive->devicename),
- strlen(token[parameter])));
break;
case kw_state:
@@ -944,10 +936,9 @@ config_drive(int update)
}
}
- if (drive->devicename[0] == '\0') {
- drive->state = drive_unallocated; /* deallocate the drive */
+ if (drive->devicename[0] == '\0')
throw_rude_remark(EINVAL, "No device name for %s", drive->label.name);
- }
+
}
/* Handle a subdisk definition. We store the information in the global variable
@@ -956,20 +947,19 @@ config_drive(int update)
* If we find an error, print a message and return
*/
void
-config_subdisk(int update)
+config_subdisk(void)
{
+ BROKEN_GDB;
int parameter;
int sdno; /* index of sd in vinum_conf */
struct sd *sd; /* and pointer to it */
u_int64_t size;
+ int sectors; /* sector offset value */
int detached = 0; /* set to 1 if this is a detached subdisk */
int sdindex = -1; /* index in plexes subdisk table */
- int namedsdno;
- enum sdstate state = sd_unallocated; /* state to set, if specified */
sdno = get_empty_sd(); /* allocate an SD to initialize */
sd = &SD[sdno]; /* and get a pointer */
-
for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
switch (get_keyword(token[parameter], &keyword_set)) {
case kw_detached:
@@ -993,13 +983,7 @@ config_subdisk(int update)
break;
case kw_name:
- namedsdno = find_subdisk(token[++parameter], 0); /* find an existing sd with this name */
- if (namedsdno >= 0) { /* got one */
- if (update) /* are we updating? */
- return; /* that's OK, nothing more to do */
- else
- throw_rude_remark(EINVAL, "Duplicate subdisk %s", token[parameter]);
- }
+ ++parameter;
bcopy(token[parameter],
sd->name,
min(sizeof(sd->name), strlen(token[parameter])));
@@ -1021,11 +1005,9 @@ config_subdisk(int update)
sd->plexno = find_plex(token[++parameter], 1); /* insert plex information */
break;
- /* Set the state. We can't do this directly,
- * because give_sd_to_plex may change it */
case kw_state:
checkkernel(token[++parameter]); /* must be a kernel user */
- state = SdState(token[parameter]); /* set the state */
+ sd->state = SdState(token[parameter]); /* set the state */
break;
default:
@@ -1065,10 +1047,8 @@ config_subdisk(int update)
if (sd->sectors == 0)
throw_rude_remark(EINVAL, "sd %s has no length spec", sd->name);
- if (state != sd_unallocated) /* we had a specific state to set */
- sd->state = state; /* do it now */
- else if (sd->state == sd_unallocated) /* no, nothing set yet, */
- sd->state = sd_up; /* must be up */
+ if (sd->state == sd_unallocated) /* no state decided, */
+ sd->state = sd_init; /* at least we're in the game */
/* register the subdisk with the drive. This action
* will have the side effect of setting the offset if
@@ -1078,22 +1058,22 @@ config_subdisk(int update)
}
/* Handle a plex definition.
+ * If we find an error, print a message, deallocate the nascent plex, and return
*/
void
-config_plex(int update)
+config_plex(void)
{
+ BROKEN_GDB;
int parameter;
int plexno; /* index of plex in vinum_conf */
struct plex *plex; /* and pointer to it */
int pindex = MAXPLEX; /* index in volume's plex list */
int detached = 0; /* don't give it to a volume */
- int namedplexno;
current_plex = -1; /* forget the previous plex */
plexno = get_empty_plex(); /* allocate a plex */
plex = &PLEX[plexno]; /* and point to it */
plex->plexno = plexno; /* and back to the config */
-
for (parameter = 1; parameter < tokens; parameter++) { /* look at the other tokens */
switch (get_keyword(token[parameter], &keyword_set)) {
case kw_detached:
@@ -1101,11 +1081,11 @@ config_plex(int update)
break;
case kw_name:
- namedplexno = find_plex(token[++parameter], 0); /* find an existing plex with this name */
- if (namedplexno >= 0) { /* plex exists already, */
- if (update) /* are we updating? */
- return; /* yes: that's OK, just return */
- else
+ {
+ int namedplexno;
+
+ namedplexno = find_plex(token[++parameter], 0); /* find an existing plex with this name */
+ if (namedplexno >= 0)
throw_rude_remark(EINVAL, "Duplicate plex %s", token[parameter]);
}
bcopy(token[parameter], /* put in the name */
@@ -1198,8 +1178,9 @@ config_plex(int update)
* If we find an error, print a message, deallocate the nascent volume, and return
*/
void
-config_volume(int update)
+config_volume(void)
{
+ BROKEN_GDB;
int parameter;
int volno;
struct volume *vol; /* collect volume info here */
@@ -1210,9 +1191,6 @@ config_volume(int update)
current_volume = -1; /* forget the previous volume */
volno = find_volume(token[1], 1); /* allocate a volume to initialize */
vol = &VOL[volno]; /* and get a pointer */
- if (update && ((vol->flags & VF_NEWBORN) == 0)) /* this volume exists already */
- return; /* don't do anything */
- vol->flags &= ~VF_NEWBORN; /* no longer newly born */
for (parameter = 2; parameter < tokens; parameter++) { /* look at all tokens */
switch (get_keyword(token[parameter], &keyword_set)) {
@@ -1319,8 +1297,9 @@ config_volume(int update)
*
* Return 0 if all is well, otherwise EINVAL */
int
-parse_config(char *cptr, struct keywordset *keyset, int update)
+parse_config(char *cptr, struct keywordset *keyset)
{
+ BROKEN_GDB;
int status;
status = 0; /* until proven otherwise */
@@ -1334,23 +1313,32 @@ parse_config(char *cptr, struct keywordset *keyset, int update)
switch (get_keyword(token[0], keyset)) { /* decide what to do */
case kw_read: /* read config from a specified drive */
- vinum_scandisk(&token[1], tokens - 1); /* read the config from disk */
+ vinum_conf.flags |= VF_KERNELOP | VF_READING_CONFIG; /* kernel operation: reading config */
+ status = check_drive(token[1]); /* check the drive info */
+ vinum_conf.flags &= ~(VF_KERNELOP | VF_READING_CONFIG);
+ if (status != 0) {
+ char *msg = "Can't read configuration from %s";
+ if (status == ENODEV)
+ msg = "No vinum configuration on %s";
+ throw_rude_remark(status, msg, token[1]);
+ }
+ updateconfig(VF_KERNELOP); /* update from kernel space */
break;
case kw_drive:
- config_drive(update);
+ config_drive();
break;
case kw_subdisk:
- config_subdisk(update);
+ config_subdisk();
break;
case kw_plex:
- config_plex(update);
+ config_plex();
break;
case kw_volume:
- config_volume(update);
+ config_volume();
break;
/* Anything else is invalid in this context */
@@ -1372,10 +1360,11 @@ parse_config(char *cptr, struct keywordset *keyset, int update)
int
parse_user_config(char *cptr, struct keywordset *keyset)
{
+ BROKEN_GDB;
int status;
ioctl_reply = (struct _ioctl_reply *) cptr;
- status = parse_config(cptr, keyset, 0);
+ status = parse_config(cptr, keyset);
ioctl_reply = NULL; /* don't do this again */
return status;
}
@@ -1435,7 +1424,6 @@ remove_drive_entry(int driveno, int force, int recurse)
for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) {
if ((SD[sdno].state != sd_unallocated) /* subdisk is allocated */
&&(SD[sdno].driveno == driveno)) { /* and it belongs to this drive */
- sdmsg.index = sdno;
sdmsg.type = sd_object;
sdmsg.recurse = 1;
sdmsg.force = force;
@@ -1478,18 +1466,14 @@ remove_sd_entry(int sdno, int force, int recurse)
* RAID-5 plex really tears the hell out
* of the structure, and it needs to be
* reinitialized */
- /* XXX Think about this. Maybe we should just
- * leave a hole */
if (plex->organization != plex_concat) /* not concatenated, */
set_plex_state(plex->plexno, plex_faulty, setstate_force); /* need to reinitialize */
- printf("vinum: removing %s\n", sd->name);
+ rebuild_plex_unmappedlist(plex); /* and see what remains */
free_sd(sdno);
} else
ioctl_reply->error = EBUSY; /* can't do that */
- } else {
- printf("vinum: removing %s\n", sd->name);
+ } else
free_sd(sdno);
- }
}
/* remove a plex */
@@ -1545,7 +1529,6 @@ remove_plex_entry(int plexno, int force, int recurse)
return;
}
}
- printf("vinum: removing %s\n", plex->name);
free_plex(plexno);
}
@@ -1573,28 +1556,25 @@ remove_volume_entry(int volno, int force, int recurse)
plexmsg.index = vol->plex[plexno]; /* plex number */
remove(&plexmsg);
}
- printf("vinum: removing %s\n", vol->name);
free_volume(volno);
} else
ioctl_reply->error = EBUSY; /* can't do that */
- } else {
- printf("vinum: removing %s\n", vol->name);
+ } else
free_volume(volno);
- }
}
void
update_sd_config(int sdno, int kernelstate)
{
if (!kernelstate)
- set_sd_state(sdno, sd_up, setstate_configuring);
+ set_sd_state(sdno, sd_up, setstate_configuring | setstate_norecurse);
}
void
update_plex_config(int plexno, int kernelstate)
{
int error = 0;
- u_int64_t size;
+ int size;
int sdno;
struct plex *plex = &PLEX[plexno];
enum plexstate state = plex_up; /* state we want the plex in */
@@ -1611,7 +1591,7 @@ update_plex_config(int plexno, int kernelstate)
error = 1;
printf("vinum: plex %s does not have at least 2 subdisks\n", plex->name);
if (!kernelstate)
- set_plex_state(plexno, plex_down, setstate_force | setstate_configuring);
+ set_plex_state(plexno, plex_down, setstate_force | setstate_configuring | setstate_norecurse);
}
size = 0;
for (sdno = 0; sdno < plex->subdisks; sdno++) {
@@ -1620,24 +1600,22 @@ update_plex_config(int plexno, int kernelstate)
&& (sdno > 0)
&& (SD[plex->sdnos[sdno]].sectors != SD[plex->sdnos[sdno - 1]].sectors)) {
error = 1;
- printf("vinum: %s must have equal sized subdisks\n", plex->name);
- set_plex_state(plexno, plex_down, setstate_force | setstate_configuring);
+ printf("vinum: plex %s must have equal sized subdisks\n", plex->name);
+ set_plex_state(plexno, plex_down, setstate_force | setstate_configuring | setstate_norecurse);
}
size += SD[plex->sdnos[sdno]].sectors;
}
if (plex->subdisks) { /* plex has subdisks, calculate size */
- /* XXX We shouldn't need to calculate the size any
- * more. Check this some time */
- if (plex->length != size)
- printf("Correcting length of %s: was %qd, is %qd\n", plex->name, plex->length, size);
+ rebuild_plex_unmappedlist(plex); /* rebuild the unmapped list first */
+
plex->length = size;
} else { /* no subdisks, */
plex->length = 0; /* no size */
state = plex_down; /* take it down */
}
if (!(kernelstate || error))
- set_plex_state(plexno, state, setstate_none | setstate_configuring);
+ set_plex_state(plexno, state, setstate_none | setstate_configuring | setstate_norecurse);
}
void
@@ -1658,7 +1636,7 @@ update_volume_config(int volno, int kernelstate)
}
}
if (!kernelstate) /* try to bring it up */
- set_volume_state(volno, volume_up, setstate_configuring);
+ set_volume_state(volno, volume_up, setstate_configuring | setstate_norecurse);
}
/* Update the global configuration.
@@ -1671,17 +1649,21 @@ update_volume_config(int volno, int kernelstate)
void
updateconfig(int kernelstate)
{
+ BROKEN_GDB;
+ int sdno;
int plexno;
int volno;
+ struct volume *vol;
+ struct plex *plex;
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++)
+ update_sd_config(sdno, kernelstate);
for (plexno = 0; plexno < vinum_conf.plexes_used; plexno++)
update_plex_config(plexno, kernelstate);
- for (volno = 0; volno < vinum_conf.volumes_used; volno++) {
- VOL[volno].flags &= ~VF_CONFIG_SETUPSTATE; /* no more setupstate */
- set_volume_state(volno, volume_up, setstate_configuring);
- }
+ for (volno = 0; volno < vinum_conf.volumes_used; volno++)
+ update_volume_config(volno, kernelstate);
save_config();
}
@@ -1699,7 +1681,7 @@ start_config(void)
return error;
}
/* We need two flags here: VF_CONFIGURING
- * tells other processes to hold off (this
+ * tells other processes to hold off (this
* function), and VF_CONFIG_INCOMPLETE
* tells the state change routines not to
* propagate incrememntal state changes */
diff --git a/sys/dev/vinum/vinuminterrupt.c b/sys/modules/vinum/interrupt.c
index 073ee7635c775..e7eb034faf4b0 100644
--- a/sys/dev/vinum/vinuminterrupt.c
+++ b/sys/modules/vinum/interrupt.c
@@ -35,13 +35,12 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinuminterrupt.c,v 1.4 1999/01/12 04:30:12 grog Exp grog $
+ * $Id: interrupt.c,v 1.1 1998/08/13 06:12:27 grog Exp grog $
*/
#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
+#include "vinumhdr.h"
+#include "request.h"
#include <miscfs/specfs/specdev.h>
#include <sys/resourcevar.h>
@@ -61,6 +60,7 @@ void sdio_done(struct buf *bp);
void
complete_rqe(struct buf *bp)
{
+ BROKEN_GDB;
struct rqelement *rqe;
struct request *rq;
struct rqgroup *rqg;
@@ -69,32 +69,14 @@ complete_rqe(struct buf *bp)
rqe = (struct rqelement *) bp; /* point to the element element that completed */
rqg = rqe->rqg; /* and the request group */
rq = rqg->rq; /* and the complete request */
- ubp = rq->bp; /* user buffer */
-#ifdef VINUMDEBUG
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_iodone, rqe, ubp);
-#endif
if ((bp->b_flags & B_ERROR) != 0) { /* transfer in error */
if (bp->b_error != 0) /* did it return a number? */
rq->error = bp->b_error; /* yes, put it in. */
else if (rq->error == 0) /* no: do we have one already? */
rq->error = EIO; /* no: catchall "I/O error" */
- SD[rqe->sdno].lasterror = rq->error;
- if (bp->b_flags & B_READ) {
- printf("%s: fatal read I/O error\n", SD[rqe->sdno].name);
- set_sd_state(rqe->sdno, sd_crashed, setstate_force); /* subdisk is crashed */
- } else { /* write operation */
- printf("%s: fatal write I/O error\n", SD[rqe->sdno].name);
- set_sd_state(rqe->sdno, sd_stale, setstate_force); /* subdisk is stale */
- }
- if (rq->error == ENXIO) { /* the drive's down too */
- printf("%s: fatal drive I/O error\n", DRIVE[rqe->driveno].label.name);
- DRIVE[rqe->driveno].lasterror = rq->error;
- set_drive_state(rqe->driveno, /* take the drive down */
- drive_down,
- setstate_force);
- }
+ if (rq->error == EIO) /* I/O error, */
+ set_sd_state(rqe->sdno, sd_crashed, setstate_force); /* take the subdisk down */
}
/* Now update the statistics */
if (bp->b_flags & B_READ) { /* read operation */
@@ -112,12 +94,13 @@ complete_rqe(struct buf *bp)
PLEX[rqe->rqg->plexno].writes++;
PLEX[rqe->rqg->plexno].bytes_written += bp->b_bcount;
}
+ ubp = rq->bp; /* user buffer */
rqg->active--; /* one less request active */
if (rqg->active == 0) /* request group finished, */
rq->active--; /* one less */
if (rq->active == 0) { /* request finished, */
-#if VINUMDEBUG
- if (debug & DEBUG_RESID) {
+#if DEBUG
+ if (debug & 4) {
if (ubp->b_resid != 0) /* still something to transfer? */
Debugger("resid");
@@ -137,18 +120,14 @@ complete_rqe(struct buf *bp)
#endif
if (rq->error) { /* did we have an error? */
- if (rq->isplex) { /* plex operation, */
- ubp->b_flags |= B_ERROR; /* yes, propagate to user */
- ubp->b_error = rq->error;
- } else /* try to recover */
- queue_daemon_request(daemonrq_ioerror, rq); /* let the daemon complete */
- } else {
+ ubp->b_flags |= B_ERROR; /* yes, propagate to user */
+ ubp->b_error = rq->error;
+ } else
ubp->b_resid = 0; /* completed our transfer */
- if (rq->isplex == 0) /* volume request, */
- VOL[rq->volplex.volno].active--; /* another request finished */
- biodone(ubp); /* top level buffer completed */
- freerq(rq); /* return the request storage */
- }
+ if (rq->isplex == 0) /* volume request, */
+ VOL[rq->volplex.volno].active--; /* another request finished */
+ biodone(ubp); /* top level buffer completed */
+ freerq(rq); /* return the request storage */
}
}
@@ -157,6 +136,7 @@ complete_rqe(struct buf *bp)
void
freerq(struct request *rq)
{
+ BROKEN_GDB;
struct rqgroup *rqg;
struct rqgroup *nrqg; /* next in chain */
int rqno;
diff --git a/sys/dev/vinum/vinumio.c b/sys/modules/vinum/io.c
index 331debfa643cd..a16a33a9e8bc7 100644
--- a/sys/dev/vinum/vinumio.c
+++ b/sys/modules/vinum/io.c
@@ -33,33 +33,36 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumio.c,v 1.21 1998/12/30 06:04:31 grog Exp grog $
+ * $Id: io.c,v 1.16 1998/08/10 23:47:21 grog Exp grog $
*/
#define STATIC /* nothing while we're testing XXX */
-#include "opt_vinum.h"
+#if __FreeBSD__ < 3 /* this is in sys/disklabel.h in 3.0 and on */
+#define DTYPE_VINUM 12 /* vinum volume */
+#endif
#define REALLYKERNEL
#include "vinumhdr.h"
-#include "request.h"
#include <miscfs/specfs/specdev.h>
extern jmp_buf command_fail; /* return on a failed command */
struct _ioctl_reply *ioctl_reply; /* data pointer, for returning error messages */
+#if __FreeBSD__ >= 3
/* Why aren't these declared anywhere? XXX */
int setjmp(jmp_buf);
void longjmp(jmp_buf, int);
+#endif
-static char *sappend(char *txt, char *s);
-static int drivecmp(const void *va, const void *vb);
+/* pointer to ioctl p parameter, to save passing it around */
+extern struct proc *myproc;
-/* Open the device associated with the drive, and set drive's vp.
- * Return an error number */
+/* Open the device associated with the drive, and set drive's vp */
int
-open_drive(struct drive *drive, struct proc *p, int verbose)
+open_drive(struct drive *drive, struct proc *p)
{
+ BROKEN_GDB;
struct nameidata nd;
struct vattr va;
int error;
@@ -69,45 +72,59 @@ open_drive(struct drive *drive, struct proc *p, int verbose)
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, drive->devicename, p);
error = vn_open(&nd, FREAD | FWRITE, 0); /* open the device */
if (error != 0) { /* can't open? */
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ set_drive_state(drive->driveno, drive_down, 1);
drive->lasterror = error;
- if (verbose)
- printf("vinum open_drive %s: failed with error %d\n", drive->devicename, error); /* XXX */
+ printf("vinum open_drive %s: failed with error %d\n", drive->devicename, error); /* XXX */
return error;
}
drive->vp = nd.ni_vp;
drive->p = p;
if (drive->vp->v_usecount > 1) { /* already in use? */
- if (verbose)
- printf("open_drive %s: use count %d, ignoring\n", /* XXX where does this come from? */
- drive->devicename,
- drive->vp->v_usecount);
- drive->vp->v_usecount = 1; /* will this work? */
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
+ close_drive(drive);
+ set_drive_state(drive->driveno, drive_down, 1);
+ drive->lasterror = EBUSY;
+ printf("vinum open_drive %s: Drive in use\n", drive->devicename); /* XXX */
+ return EBUSY;
}
- error = VOP_GETATTR(drive->vp, &va, NOCRED, drive->p);
+ error = VOP_GETATTR(drive->vp, &va, NOCRED, p);
if (error) {
- VOP_UNLOCK(drive->vp, 0, drive->p);
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
close_drive(drive);
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ set_drive_state(drive->driveno, drive_down, 1);
drive->lasterror = error;
- if (verbose)
- printf("vinum open_drive %s: GETAATTR returns error %d\n", drive->devicename, error); /* XXX */
+ printf("vinum open_drive %s: GETAATTR returns error %d\n", drive->devicename, error); /* XXX */
return error;
}
drive->dev = va.va_rdev; /* device */
if (va.va_type != VBLK) { /* only consider block devices */
- VOP_UNLOCK(drive->vp, 0, drive->p);
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
close_drive(drive);
- set_drive_state(drive->driveno, drive_down, setstate_force); /* this also closes the drive */
+ set_drive_state(drive->driveno, drive_down, 1); /* this also closes the drive */
drive->lasterror = ENOTBLK;
- if (verbose)
- printf("vinum open_drive %s: Not a block device\n", drive->devicename); /* XXX */
+ printf("vinum open_drive %s: Not a block device\n", drive->devicename); /* XXX */
return ENOTBLK;
}
drive->vp->v_numoutput = 0;
- VOP_UNLOCK(drive->vp, 0, drive->p);
+#if __FreeBSD__ == 2 /* pre-4.4BSD Lite/2 parameters */
+ VOP_UNLOCK(drive->vp);
+#else
+ VOP_UNLOCK(drive->vp, 0, p);
+#endif
return 0;
}
@@ -122,7 +139,11 @@ set_drive_parms(struct drive *drive)
/* Now update the label part */
bcopy(hostname, drive->label.sysname, VINUMHOSTNAMELEN); /* put in host name */
+#if __FreeBSD__ >= 3
getmicrotime(&drive->label.date_of_birth); /* and current time */
+#else
+ drive->label.date_of_birth = time; /* and current time */
+#endif
drive->label.drive_size = ((u_int64_t) drive->partinfo.part->p_size) /* size of the drive in bytes */
*((u_int64_t) drive->partinfo.disklab->d_secsize);
@@ -132,7 +153,8 @@ set_drive_parms(struct drive *drive)
/* XXX Bug in 3.0 as of January 1998: you can open
* non-existent slices. They have a length of 0 */
if (drive->label.drive_size < MINVINUMSLICE) { /* too small to worry about */
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ set_drive_state(drive->driveno, drive_down, 1);
+ printf("vinum open_drive %s: Drive too small\n", drive->devicename); /* XXX */
drive->lasterror = ENOSPC;
return ENOSPC;
}
@@ -144,28 +166,24 @@ set_drive_parms(struct drive *drive)
drive->freelist_entries = 1; /* just (almost) the complete drive */
drive->freelist[0].offset = DATASTART; /* starts here */
drive->freelist[0].sectors = (drive->label.drive_size >> DEV_BSHIFT) - DATASTART; /* and it's this long */
- if (drive->label.name[0] != '\0') /* got a name */
- set_drive_state(drive->driveno, drive_up, setstate_force); /* our drive is accessible */
- else /* we know about it, but that's all */
- drive->state = drive_uninit;
+ set_drive_state(drive->driveno, drive_up, 1); /* our drive is accessible */
return 0;
}
/* Initialize a drive: open the device and add device
* information */
int
-init_drive(struct drive *drive, int verbose)
+init_drive(struct drive *drive)
{
+ BROKEN_GDB;
int error;
if (drive->devicename[0] == '\0') { /* no device name yet, default to drive name */
drive->lasterror = EINVAL;
- /* This is a bug if it happens internally,
- * so print a message regardless */
printf("vinum: Can't open drive without drive name\n"); /* XXX */
return EINVAL;
}
- error = open_drive(drive, curproc, verbose); /* open the drive */
+ error = open_drive(drive, myproc); /* open the drive */
if (error)
return error;
@@ -174,23 +192,21 @@ init_drive(struct drive *drive, int verbose)
(caddr_t) & drive->partinfo,
FREAD,
NOCRED,
- curproc);
+ myproc);
if (error) {
- if (verbose)
- printf("vinum open_drive %s: Can't get partition information, error %d\n",
- drive->devicename,
- error); /* XXX */
+ printf("vinum open_drive %s: Can't get partition information, error %d\n",
+ drive->devicename,
+ error); /* XXX */
close_drive(drive);
drive->lasterror = error;
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ set_drive_state(drive->driveno, drive_down, 1);
return error;
}
if (drive->partinfo.part->p_fstype != 0) { /* not plain */
drive->lasterror = EFTYPE;
- if (verbose)
- printf("vinum open_drive %s: Wrong partition type for vinum\n", drive->devicename); /* XXX */
+ printf("vinum open_drive %s: Wrong partition type for vinum\n", drive->devicename); /* XXX */
close_drive(drive);
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ set_drive_state(drive->driveno, drive_down, 1);
return EFTYPE;
}
return set_drive_parms(drive); /* set various odds and ends */
@@ -201,14 +217,8 @@ void
close_drive(struct drive *drive)
{
if (drive->vp) {
- lockdrive(drive); /* keep the daemon out */
vn_close(drive->vp, FREAD | FWRITE, NOCRED, drive->p);
- if (drive->vp->v_usecount) { /* XXX shouldn't happen */
- printf("close_drive %s: use count still %d\n", drive->devicename, drive->vp->v_usecount);
- drive->vp->v_usecount = 0; /* will this work? */
- }
drive->vp = NULL;
- unlockdrive(drive);
}
}
@@ -218,6 +228,7 @@ close_drive(struct drive *drive)
void
remove_drive(int driveno)
{
+ BROKEN_GDB;
struct drive *drive = &vinum_conf.drive[driveno];
long long int nomagic = VINUM_NOMAGIC; /* no magic number */
@@ -225,59 +236,55 @@ remove_drive(int driveno)
(char *) &nomagic,
8,
VINUM_LABEL_OFFSET);
- free_drive(drive); /* close it and free resources */
+ close_drive(drive); /* and close it */
+ drive->state = drive_unallocated; /* and forget everything we knew about it */
save_config(); /* and save the updated configuration */
}
/* Transfer drive data. Usually called from one of these defines;
+
* #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
* #define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE)
*
- * length and offset are in bytes, but must be multiples of sector
- * size. The function *does not check* for this condition, and
- * truncates ruthlessly.
* Return error number
*/
int
-driveio(struct drive *drive, char *buf, size_t length, off_t offset, int flag)
+driveio(struct drive *drive, void *buf, size_t length, off_t offset, int flag)
{
+ BROKEN_GDB;
int error;
struct buf *bp;
- char foo[40];
+ int spl;
+
+ error = 0;
- error = 0; /* to keep the compiler happy */
- while (length) { /* divide into small enough blocks */
- int len = min(length, MAXBSIZE); /* maximum block device transfer is MAXBSIZE */
+ /* Get a buffer */
+ bp = (struct buf *) Malloc(sizeof(struct buf)); /* get a buffer */
+ CHECKALLOC(bp, "Can't allocate memory");
- bp = geteblk(len); /* get a buffer header */
- bp->b_flags = B_BUSY | flag; /* get busy */
- bp->b_proc = curproc; /* process */
- bp->b_dev = drive->vp->v_un.vu_specinfo->si_rdev; /* device */
+ bzero(&buf, sizeof(buf));
+ bp->b_flags = B_BUSY | flag; /* tell us when it's done */
+ bp->b_iodone = drive_io_done; /* here */
+ bp->b_proc = myproc; /* process */
+ bp->b_dev = drive->vp->v_un.vu_specinfo->si_rdev; /* device */
+ if (offset & (drive->partinfo.disklab->d_secsize - 1)) /* not on a block boundary */
bp->b_blkno = offset / drive->partinfo.disklab->d_secsize; /* block number */
- bp->b_data = buf;
- bp->b_bcount = len;
- bp->b_bufsize = len;
-
- (*bdevsw[major(bp->b_dev)]->d_strategy) (bp); /* initiate the transfer */
-
- error = biowait(bp);
- printf("driveio: %s dev 0x%x, block 0x%x, len 0x%lx, error %d\n", /* XXX */
- flag ? "read" : "write",
- bp->b_dev,
- bp->b_blkno,
- bp->b_bcount,
- error);
- bcopy(buf, foo, 40);
- foo[39] = '\0';
- printf("---> %s\n", foo); /* XXXXXX */
- bp->b_flags |= B_INVAL | B_AGE;
- brelse(bp);
- if (error)
- break;
- length -= len; /* update pointers */
- buf += len;
- offset += len;
+ bp->b_data = buf;
+ bp->b_vp = drive->vp; /* vnode */
+ bp->b_bcount = length;
+ bp->b_bufsize = length;
+
+ (*bdevsw[major(bp->b_dev)]->d_strategy) (bp); /* initiate the transfer */
+
+ spl = splbio();
+ while ((bp->b_flags & B_DONE) == 0) {
+ bp->b_flags |= B_CALL; /* wake me again */
+ tsleep((caddr_t) bp, PRIBIO, "driveio", 0); /* and wait for it to complete */
}
+ splx(spl);
+ if (bp->b_flags & B_ERROR) /* didn't work */
+ error = bp->b_error; /* get the error return */
+ Free(bp); /* then return the buffer */
return error;
}
@@ -288,6 +295,7 @@ driveio(struct drive *drive, char *buf, size_t length, off_t offset, int flag)
int
read_drive(struct drive *drive, void *buf, size_t length, off_t offset)
{
+ BROKEN_GDB;
int error;
struct buf *bp;
daddr_t nextbn;
@@ -308,7 +316,7 @@ read_drive(struct drive *drive, void *buf, size_t length, off_t offset)
uio.uio_resid = length;
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_READ;
- uio.uio_procp = curproc;
+ uio.uio_procp = myproc;
bscale = btodb(drive->blocksize); /* mask off offset from block number */
do {
@@ -350,6 +358,7 @@ read_drive(struct drive *drive, void *buf, size_t length, off_t offset)
int
write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
{
+ BROKEN_GDB;
int error;
struct buf *bp;
struct uio uio;
@@ -374,7 +383,7 @@ write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
uio.uio_resid = length;
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_WRITE;
- uio.uio_procp = curproc;
+ uio.uio_procp = myproc;
error = 0;
blockshift = btodb(drive->blocksize) - 1; /* amount to shift block number
@@ -385,7 +394,7 @@ write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
count = min((unsigned) (drive->blocksize - blockoff), /* amount to transfer in this block */
uio.uio_resid);
if (count == drive->blocksize) /* the whole block */
- bp = getblk(drive->vp, blocknum, drive->blocksize, 0, 0); /* just transfer it */
+ bp = getblk(drive->vp, blocknum, drive->blocksize, 0, 0); /* just get it */
else /* partial block: */
error = bread(drive->vp, /* read it first */
blocknum,
@@ -402,7 +411,7 @@ write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
drive->lasterror = error;
switch (error) {
case EIO:
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ set_drive_state(drive->driveno, drive_down, 1);
break;
/* XXX Add other possibilities here */
@@ -427,6 +436,7 @@ write_drive(struct drive *drive, void *buf, size_t length, off_t offset)
void
drive_io_done(struct buf *bp)
{
+ BROKEN_GDB;
wakeup((caddr_t) bp); /* Wachet auf! */
bp->b_flags &= ~B_CALL; /* don't do this again */
}
@@ -436,23 +446,17 @@ drive_io_done(struct buf *bp)
* with a partially populated drive structure
* which includes the device name.
*
- * Return information on what we found.
- *
- * This function is called from two places: check_drive,
- * which wants to find out whether the drive is a
- * Vinum drive, and config_drive, which asserts that
- * it is a vinum drive. In the first case, we don't
- * print error messages (verbose==0), in the second
- * we do (verbose==1).
+ * Return information on what we found
*/
enum drive_label_info
-read_drive_label(struct drive *drive, int verbose)
+read_drive_label(struct drive *drive)
{
+ BROKEN_GDB;
int error;
int result; /* result of our search */
struct vinum_hdr *vhdr; /* and as header */
- error = init_drive(drive, 0); /* find the drive */
+ error = init_drive(drive); /* find the drive */
if (error) /* find the drive */
return DL_CANT_OPEN; /* not ours */
@@ -466,7 +470,7 @@ read_drive_label(struct drive *drive, int verbose)
drive->lasterror = EINVAL;
result = DL_WRONG_DRIVE; /* it's the wrong drive */
} else {
- drive->state = drive_up; /* it's OK by us */
+ set_drive_parms(drive); /* and set other parameters */
result = DL_OURS;
}
/* We copy the drive anyway so that we have
@@ -485,23 +489,100 @@ read_drive_label(struct drive *drive, int verbose)
* read configuration information from the drive and
* incorporate the data into the configuration.
*
- * Return
+ * Return error number
*/
-struct drive *
+int
check_drive(char *drivename)
{
+ BROKEN_GDB;
+ int error;
+ struct nameidata nd; /* mount point credentials */
+ char *config_text; /* read the config info from disk into here */
+ volatile char *cptr; /* pointer into config information */
+ char *eptr; /* end pointer into config information */
int driveno;
struct drive *drive;
+ char *config_line; /* copy the config line to */
- driveno = find_drive_by_dev(drivename, 1); /* entry doesn't exist, create it */
+ driveno = find_drive_by_dev(drivename, 1); /* doesn't exist, create it */
drive = &vinum_conf.drive[driveno]; /* and get a pointer */
+ strcpy(drive->devicename, drivename); /* put in device name */
- if (read_drive_label(drive, 0) != DL_OURS) { /* not ours */
- if (drive->lasterror == 0)
- drive->lasterror = ENODEV;
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ if (read_drive_label(drive) == DL_OURS) { /* ours! */
+ config_text = (char *) Malloc(MAXCONFIG * 2); /* allocate buffers */
+ CHECKALLOC(config_text, "Can't allocate memory");
+ config_line = (char *) Malloc(MAXCONFIGLINE * 2); /* allocate buffers */
+ CHECKALLOC(config_line, "Can't allocate memory");
+
+ /* Read in both copies of the configuration information */
+ error = read_drive(drive, config_text, MAXCONFIG * 2, VINUM_CONFIG_OFFSET);
+
+ if (error != 0) {
+ printf("vinum: Can't read device %s, error %d\n", drive->devicename, error);
+ Free(config_text);
+ Free(config_line);
+ free_drive(drive); /* give it back */
+ return error;
+ }
+ /* XXX At this point, check that the two copies are the same, and do something useful if not.
+ * In particular, consider which is newer, and what this means for the integrity of the
+ * data on the drive */
+
+ /* Parse the configuration, and add it to the global configuration */
+ for (cptr = config_text; *cptr != '\0';) { /* love this style(9) */
+ volatile int parse_status; /* return value from parse_config */
+
+ for (eptr = config_line; (*cptr != '\n') && (*cptr != '\0');) /* until the end of the line */
+ *eptr++ = *cptr++;
+ *eptr = '\0'; /* and delimit */
+ if (setjmp(command_fail) == 0) { /* come back here on error and continue */
+ parse_status = parse_config(config_line, &keyword_set); /* parse the config line */
+ if (parse_status < 0) { /* error in config */
+ /* This config should have been parsed in user
+ * space. If we run into problems here, something
+ * serious is afoot. Complain and let the user
+ * snarf the config to see what's wrong */
+ printf("vinum: Config error on drive %s, aborting integration\n", nd.ni_dirp);
+ Free(config_text);
+ Free(config_line);
+ free_drive(drive); /* give it back */
+ return EINVAL;
+ }
+ }
+ while (*cptr == '\n')
+ cptr++; /* skip to next line */
+ }
+ Free(config_text);
+ if ((vinum_conf.flags & VF_READING_CONFIG) == 0) /* not reading config */
+ updateconfig(0); /* update object states */
+ printf("vinum: read configuration from %s\n", drivename);
+ return 0; /* it all worked */
+ } else { /* no vinum label found */
+ if (drive->lasterror) {
+ set_drive_state(drive->driveno, drive_down, 1);
+ return drive->lasterror;
+ } else
+ return ENODEV; /* not our device */
}
- return drive;
+}
+
+/* Kludge: kernel printf doesn't handle longs correctly XXX */
+static char *lltoa(long long l, char *s);
+static char *sappend(char *txt, char *s);
+
+static char *
+lltoa(long long l, char *s)
+{
+ if (l < 0) {
+ *s++ = '-';
+ l = -l;
+ }
+ if (l > 9) {
+ s = lltoa(l / 10, s);
+ l %= 10;
+ }
+ *s++ = l + '0';
+ return s;
}
static char *
@@ -511,187 +592,132 @@ sappend(char *txt, char *s)
return s - 1;
}
-/* Kludge: kernel printf doesn't handle quads */
-static char *lltoa (long long l, char *s);
-
-static char *lltoa (long long l, char *s)
-{
- if (l < 0)
- {
- *s++ = '-';
- l = -l;
- }
- if (l > 9)
- {
- s = lltoa (l / 10, s);
- l %= 10;
- }
- *s++ = l + '0';
- return s;
- }
/* Format the configuration in text form into the buffer
* at config. Don't go beyond len bytes
* XXX this stinks. Fix soon. */
-void format_config (char *config, int len)
+void
+format_config(char *config, int len)
{
-#if __FreeBSD__ == 2
- BROKEN_GDB
-#endif
- int i;
- int j;
- char *s = config;
-
- bzero (config, len);
-
-#if 0 /* XXX die, die */
- /* First write the drive configuration */
- for (i = 0; i < vinum_conf.drives_used; i++)
- {
- struct drive *drive;
-
- drive = &vinum_conf.drive [i];
- if (drive->state != drive_unallocated)
- {
- sprintf (s,
- "drive %s state %s device %s\n",
- drive->label.name,
- drive_state (drive->state),
- drive->devicename);
- while (*s)
- s++; /* find the end */
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
+ BROKEN_GDB;
+ int i;
+ int j;
+ char *s = config;
+
+ bzero(config, len);
+
+ /* First write the drive configuration */
+ for (i = 0; i < vinum_conf.drives_used; i++) {
+ struct drive *drive;
+
+ drive = &vinum_conf.drive[i];
+ if (drive->state != drive_unallocated) {
+ sprintf(s,
+ "drive %s state %s device %s\n",
+ drive->label.name,
+ drive_state(drive->state),
+ drive->devicename);
+ while (*s)
+ s++; /* find the end */
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
}
- }
}
-#endif
-
- /* Then the volume configuration */
- for (i = 0; i < vinum_conf.volumes_used; i++)
- {
- struct volume *vol;
-
- vol = &vinum_conf.volume [i];
- if (vol->state != volume_unallocated)
- {
- if (vol->preferred_plex >= 0) /* preferences, */
- sprintf (s,
- "volume %s state %s readpol prefer %s",
- vol->name,
- volume_state (vol->state),
- vinum_conf.plex [vol->preferred_plex].name);
- else /* default round-robin */
- sprintf (s,
- "volume %s state %s",
- vol->name,
- volume_state (vol->state));
- while (*s)
- s++; /* find the end */
-#if 0
- /* Do we need to state the plexes? */
- for (j = 0; j < vol->plexes; j++)
- {
- sprintf (s, " plex %s", vinum_conf.plex [vol->plex [j]].name);
- while (*s)
- s++; /* find the end */
- }
-#endif
- s = sappend ("\n", s);
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
+
+ /* Then the volume configuration */
+ for (i = 0; i < vinum_conf.volumes_used; i++) {
+ struct volume *vol;
+
+ vol = &vinum_conf.volume[i];
+ if (vol->state != volume_unallocated) {
+ if (vol->preferred_plex >= 0) /* preferences, */
+ sprintf(s,
+ "volume %s state %s readpol prefer %s",
+ vol->name,
+ volume_state(vol->state),
+ vinum_conf.plex[vol->preferred_plex].name);
+ else /* default round-robin */
+ sprintf(s,
+ "volume %s state %s",
+ vol->name,
+ volume_state(vol->state));
+ while (*s)
+ s++; /* find the end */
+ s = sappend("\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
}
- }
}
- /* Then the plex configuration */
- for (i = 0; i < vinum_conf.plexes_used; i++)
- {
- struct plex *plex;
-
- plex = &vinum_conf.plex [i];
- if (plex->state != plex_unallocated)
- {
- sprintf (s, "plex name %s state %s org %s ",
- plex->name,
- plex_state (plex->state),
- plex_org (plex->organization) );
- while (*s)
- s++; /* find the end */
- if ((plex->organization == plex_striped)
-#ifdef RAID5
- || (plex->organization == plex_raid5)
-#endif
- )
- {
- sprintf (s, "%db ", (int) plex->stripesize);
- while (*s)
- s++; /* find the end */
- }
- if (plex->volno >= 0) /* we have a volume */
- sprintf (s, "vol %s ", vinum_conf.volume [plex->volno].name);
- while (*s)
- s++; /* find the end */
- for (j = 0; j < plex->subdisks; j++)
- {
- sprintf (s, " sd %s", vinum_conf.sd [plex->sdnos [j]].name);
- }
- s = sappend ("\n", s);
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
+ /* Then the plex configuration */
+ for (i = 0; i < vinum_conf.plexes_used; i++) {
+ struct plex *plex;
+
+ plex = &vinum_conf.plex[i];
+ if (plex->state != plex_unallocated) {
+ sprintf(s, "plex name %s state %s org %s ",
+ plex->name,
+ plex_state(plex->state),
+ plex_org(plex->organization));
+ while (*s)
+ s++; /* find the end */
+ if ((plex->organization == plex_striped)
+ ) {
+ sprintf(s, "%db ", (int) plex->stripesize);
+ while (*s)
+ s++; /* find the end */
+ }
+ if (plex->volno >= 0) /* we have a volume */
+ sprintf(s, "vol %s ", vinum_conf.volume[plex->volno].name);
+ while (*s)
+ s++; /* find the end */
+ for (j = 0; j < plex->subdisks; j++) {
+ sprintf(s, " sd %s", vinum_conf.sd[plex->sdnos[j]].name);
+ }
+ s = sappend("\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
}
- }
}
-
- /* And finally the subdisk configuration */
- for (i = 0; i < vinum_conf.subdisks_used; i++)
- {
- struct sd *sd = &vinum_conf.sd [i]; /* XXX */
- if (vinum_conf.sd [i].state != sd_unallocated)
- {
- sprintf (s,
- "sd name %s drive %s plex %s state %s len ",
- sd->name,
- vinum_conf.drive [sd->driveno].label.name,
- vinum_conf.plex [sd->plexno].name,
- sd_state (sd->state) );
- while (*s)
- s++; /* find the end */
- s = lltoa (sd->sectors, s);
- s = sappend ("b driveoffset ", s);
- s = lltoa (sd->driveoffset, s);
- s = sappend ("b plexoffset ", s);
- s = lltoa (sd->plexoffset, s);
- s = sappend ("b\n", s);
- if (s > &config [len - 80])
- {
- printf ("vinum: configuration data overflow\n");
- return;
+
+ /* And finally the subdisk configuration */
+ for (i = 0; i < vinum_conf.subdisks_used; i++) {
+ struct sd *sd = &vinum_conf.sd[i]; /* XXX */
+ if (vinum_conf.sd[i].state != sd_unallocated) {
+ sprintf(s,
+ "sd name %s drive %s plex %s state %s len ",
+ sd->name,
+ vinum_conf.drive[sd->driveno].label.name,
+ vinum_conf.plex[sd->plexno].name,
+ sd_state(sd->state));
+ while (*s)
+ s++; /* find the end */
+ s = lltoa(sd->sectors, s);
+ s = sappend("b driveoffset ", s);
+ s = lltoa(sd->driveoffset, s);
+ s = sappend("b plexoffset ", s);
+ s = lltoa(sd->plexoffset, s);
+ s = sappend("b\n", s);
+ if (s > &config[len - 80]) {
+ printf("vinum: configuration data overflow\n");
+ return;
+ }
}
- }
}
- }
-
-/* issue a save config request to the dæmon. The actual work
- * is done in process context by daemon_save_config */
-void
-save_config(void)
-{
- queue_daemon_request(daemonrq_saveconfig, NULL);
}
-/* Write the configuration to all vinum slices. This
- * is performed by the dæmon only */
-void
-daemon_save_config(void)
+/* Write the configuration to all vinum slices */
+int
+save_config(void)
{
+ BROKEN_GDB;
int error;
- int written_config; /* set when we first write the config to disk */
+ int written_config; /* set when we firstnwrite the config to disk */
int driveno;
struct drive *drive; /* point to current drive info */
struct vinum_hdr *vhdr; /* and as header */
@@ -700,7 +726,7 @@ daemon_save_config(void)
/* don't save the configuration while we're still working on it */
if (vinum_conf.flags & VF_CONFIGURING)
- return;
+ return 0;
written_config = 0; /* no config written yet */
/* Build a volume header */
vhdr = (struct vinum_hdr *) Malloc(VINUMHEADERLEN); /* get space for the config data */
@@ -715,31 +741,13 @@ daemon_save_config(void)
error = 0; /* no errors yet */
for (driveno = 0; driveno < vinum_conf.drives_used; driveno++) {
drive = &vinum_conf.drive[driveno]; /* point to drive */
- lockdrive(drive); /* don't let it change */
-
- /* First, do some drive consistency checks. Some
- * of these are kludges, others require a process
- * context and couldn't be done before */
- if ((drive->devicename[0] == '\0') /* XXX we keep getting these nameless drives */
- ||(drive->label.name[0] == '\0')) { /* XXX we keep getting these nameless drives */
- unlockdrive(drive);
- printf("Removing incomplete drive, index %d\n", driveno);
- if (drive->vp) /* how can it be open without a name? */
- close_drive(drive);
- free_drive(drive); /* get rid of it */
- break;
- }
- if ((drive->vp == NULL) /* drive not open */
- &&(drive->state > drive_down)) { /* and it thinks it's not down */
- unlockdrive(drive);
- set_drive_state(driveno, drive_down, setstate_force); /* tell it what's what */
- }
- if ((drive->state == drive_down) /* it's down */
- &&(drive->vp != NULL)) { /* but open, */
- unlockdrive(drive);
- close_drive(drive); /* close it */
- } else if (drive->state > drive_down) {
+
+ if (drive->state != drive_down) {
+#if (__FreeBSD__ >= 3)
getmicrotime(&drive->label.last_update); /* time of last update is now */
+#else
+ drive->label.last_update = time; /* time of last update is now */
+#endif
bcopy((char *) &drive->label, /* and the label info from the drive structure */
(char *) &vhdr->label,
sizeof(vhdr->label));
@@ -751,25 +759,21 @@ daemon_save_config(void)
(caddr_t) & wlabel_on,
FWRITE,
NOCRED,
- curproc);
- if (error == 0)
- error = write_drive(drive, (char *) vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
+ myproc);
if (error == 0)
- error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET); /* first config copy */
+ error = write_drive(drive, vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET);
if (error == 0)
- error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET + MAXCONFIG); /* second copy */
+ error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET);
wlabel_on = 0; /* enable writing the label */
- if (error == 0)
- VOP_IOCTL(drive->vp, /* make the label non-writeable again */
- DIOCWLABEL,
- (caddr_t) & wlabel_on,
- FWRITE,
- NOCRED,
- curproc);
- unlockdrive(drive);
+ VOP_IOCTL(drive->vp, /* make the label non-writeable again */
+ DIOCWLABEL,
+ (caddr_t) & wlabel_on,
+ FWRITE,
+ NOCRED,
+ myproc);
if (error) {
printf("vinum: Can't write config to %s, error %d\n", drive->devicename, error);
- set_drive_state(drive->driveno, drive_down, setstate_force);
+ set_drive_state(drive->driveno, drive_down, 1);
} else
written_config = 1; /* we've written it on at least one drive */
}
@@ -777,6 +781,7 @@ daemon_save_config(void)
}
Free(vhdr);
Free(config);
+ return written_config == 0; /* return 1 if we failed to write config */
}
/* Disk labels are a mess. The correct way to access them
@@ -831,7 +836,6 @@ get_volume_label(struct volume *vol, struct disklabel *lp)
lp->d_checksum = dkcksum(lp);
}
-/* Write a volume label. This implements the VINUM_LABEL ioctl. */
int
write_volume_label(int volno)
{
@@ -880,153 +884,3 @@ initsd(int sdno)
{
return 0;
}
-
-/* Look at all disks on the system for vinum slices */
-void
-vinum_scandisk(char *drivename[], int drives)
-{
- struct drive *volatile drive;
- volatile int driveno;
- int firstdrive; /* first drive in this list */
- volatile int gooddrives; /* number of usable drives found */
- int firsttime; /* set if we have never configured before */
- int error;
- struct nameidata nd; /* mount point credentials */
- char *config_text; /* read the config info from disk into here */
- char *volatile cptr; /* pointer into config information */
- char *eptr; /* end pointer into config information */
- char *config_line; /* copy the config line to */
- volatile int status;
- struct drive **volatile drivelist;
-#define DRIVENAMELEN 64
-#define DRIVEPARTS 35 /* max partitions per drive, excluding c */
- char partname[DRIVENAMELEN]; /* for creating partition names */
-
- status = 0; /* success indication */
- vinum_conf.flags |= VF_KERNELOP | VF_READING_CONFIG; /* kernel operation: reading config */
-
- gooddrives = 0; /* number of usable drives found */
- firstdrive = vinum_conf.drives_used; /* the first drive */
- firsttime = vinum_conf.drives_used == 0; /* are we a virgin? */
-
-
- /* allocate a drive pointer list */
- drivelist = (struct drive **) Malloc(drives * DRIVEPARTS * sizeof(struct drive *));
- CHECKALLOC(drivelist, "Can't allocate memory");
-
- /* Open all drives and find which was modified most recently */
- for (driveno = 0; driveno < drives; driveno++) {
- char part; /* UNIX partition */
-
- for (part = 'a'; part < 'i'; part++)
- if (part != 'c') { /* don't do the c partition */
- snprintf(partname, /* /dev/sd0a */
- DRIVENAMELEN,
- "%s%c",
- drivename[driveno],
- part);
- drive = check_drive(partname); /* try to open it */
- if (drive->lasterror != 0) /* didn't work, */
- free_drive(drive); /* get rid of it */
- else if (drive->flags & VF_CONFIGURED) /* already read this config, */
- printf("vinum: already read config from %s\n", /* say so */
- drive->label.name);
- else {
- drivelist[gooddrives] = drive; /* keep a pointer to the drive */
- drive->flags &= ~VF_NEWBORN; /* which is no longer newly born */
- gooddrives++;
- }
- }
- }
-
- if (gooddrives == 0) {
- printf("vinum: no drives found\n");
- return;
- }
- /* We now have at least one drive
- * open. Sort them in order of config time
- * and merge the config info with what we
- * have already */
- qsort(drivelist, gooddrives, sizeof(struct drive *), drivecmp);
- config_text = (char *) Malloc(MAXCONFIG * 2); /* allocate buffers */
- CHECKALLOC(config_text, "Can't allocate memory");
- config_line = (char *) Malloc(MAXCONFIGLINE * 2); /* allocate buffers */
- CHECKALLOC(config_line, "Can't allocate memory");
- for (driveno = 0; driveno < gooddrives; driveno++) { /* now include the config */
- drive = drivelist[driveno];
-
- if (firsttime && (driveno == 0)) /* we've never configured before, */
- printf("vinum: reading configuration from %s\n", drive->devicename);
- else
- printf("vinum: updating configuration from %s\n", drive->devicename);
-
- /* Read in both copies of the configuration information */
- error = read_drive(drive, config_text, MAXCONFIG * 2, VINUM_CONFIG_OFFSET);
-
- if (error != 0) {
- printf("vinum: Can't read device %s, error %d\n", drive->devicename, error);
- Free(config_text);
- Free(config_line);
- free_drive(drive); /* give it back */
- status = error;
- }
- /* XXX At this point, check that the two copies are the same, and do something useful if not.
- * In particular, consider which is newer, and what this means for the integrity of the
- * data on the drive */
-
- else {
- /* Parse the configuration, and add it to the global configuration */
- for (cptr = config_text; *cptr != '\0';) { /* love this style(9) */
- volatile int parse_status; /* return value from parse_config */
-
- for (eptr = config_line; (*cptr != '\n') && (*cptr != '\0');) /* until the end of the line */
- *eptr++ = *cptr++;
- *eptr = '\0'; /* and delimit */
- if (setjmp(command_fail) == 0) { /* come back here on error and continue */
- parse_status = parse_config(config_line, &keyword_set, 1); /* parse the config line */
- if (parse_status < 0) { /* error in config */
- /* This config should have been parsed in user
- * space. If we run into problems here, something
- * serious is afoot. Complain and let the user
- * snarf the config to see what's wrong */
- printf("vinum: Config error on drive %s, aborting integration\n", nd.ni_dirp);
- Free(config_text);
- Free(config_line);
- free_drive(drive); /* give it back */
- status = EINVAL;
- }
- }
- while (*cptr == '\n')
- cptr++; /* skip to next line */
- }
- }
- drive->flags |= VF_CONFIGURED; /* read this drive's configuration */
- }
-
- Free(config_text);
- Free(drivelist);
- vinum_conf.flags &= ~(VF_KERNELOP | VF_READING_CONFIG);
- if (status != 0)
- throw_rude_remark(status, "Couldn't read configuration");
- updateconfig(VF_KERNELOP); /* update from kernel space */
-}
-
-/* Compare the modification dates of the drives, for qsort.
- * Return 1 if a < b, 0 if a == b, 01 if a > b: in other
- * words, sort backwards */
-int
-drivecmp(const void *va, const void *vb)
-{
- struct drive *a = *(struct drive **) va;
- struct drive *b = *(struct drive **) vb;
-
- if ((a->label.last_update.tv_sec == b->label.last_update.tv_sec)
- && (a->label.last_update.tv_usec == b->label.last_update.tv_usec))
- return 0;
- else if ((a->label.last_update.tv_sec > b->label.last_update.tv_sec)
- || ((a->label.last_update.tv_sec == b->label.last_update.tv_sec)
- && (a->label.last_update.tv_usec > b->label.last_update.tv_usec)))
- return -1;
- else
- return 1;
-}
diff --git a/sys/dev/vinum/vinumlock.c b/sys/modules/vinum/lock.c
index b367dc57a50fe..ed69649fccdc0 100644
--- a/sys/dev/vinum/vinumlock.c
+++ b/sys/modules/vinum/lock.c
@@ -33,50 +33,16 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumlock.c,v 1.8 1999/01/14 02:52:13 grog Exp grog $
+ * $Id: lock.c,v 1.6 1998/07/28 06:32:57 grog Exp grog $
*/
#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
+#include "vinumhdr.h"
/* Lock routines. Currently, we lock either an individual volume
* or the global configuration. I don't think tsleep and
* wakeup are SMP safe. FIXME XXX */
-/* Lock a drive, wait if it's in use */
-int
-lockdrive(struct drive *drive)
-{
- int error;
-
- /* XXX get rid of drive->flags |= VF_LOCKING; */
- while ((drive->flags & VF_LOCKED) != 0) {
- /* There are problems sleeping on a unique identifier,
- * since the drive structure can move, and the unlock
- * function can be called after killing the drive.
- * Solve this by waiting on this function; the number
- * of conflicts is negligible */
- if ((error = tsleep(&lockdrive,
- PRIBIO | PCATCH,
- "vindrv",
- 0)) != 0)
- return error;
- }
- drive->flags |= VF_LOCKED;
- drive->pid = curproc->p_pid; /* it's a panic error if curproc is null */
- return 0;
-}
-
-/* Unlock a drive and let the next one at it */
-void
-unlockdrive(struct drive *drive)
-{
- drive->flags &= ~VF_LOCKED;
- /* we don't reset pid: it's of hysterical interest */
- wakeup(&lockdrive);
-}
-
/* Lock a volume, wait if it's in use */
int
lockvol(struct volume *vol)
@@ -119,7 +85,7 @@ lockplex(struct plex *plex)
while ((plex->flags & VF_LOCKED) != 0) {
plex->flags |= VF_LOCKING;
/* It would seem to make more sense to sleep on
- * the address 'plex'. Unfortunately we can't
+ * the address 'plex'. Unfortuntaly we can't
* guarantee that this address won't change due to
* table expansion. The address we choose won't change. */
if ((error = tsleep(&vinum_conf.plex + plex->sdnos[0],
diff --git a/sys/modules/vinum/makestatetext b/sys/modules/vinum/makestatetext
new file mode 100755
index 0000000000000..ca5eb2dc3c3de
--- /dev/null
+++ b/sys/modules/vinum/makestatetext
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Make statetexts.h from vinumstate.h
+# $Id: makestatetext,v 1.4 1998/03/13 05:36:16 grog Exp grog $
+infile=vinumstate.h
+ofile=statetexts.h
+cat <COPYRIGHT > $ofile
+
+echo >>$ofile "/* Created by $0 on" `date`. "Do not edit */"
+echo >>$ofile
+echo >>$ofile "/* Drive state texts */"
+echo >>$ofile "char *drivestatetext [] =
+ { "
+egrep -e 'drive_[A-z0-9]*,' <$infile | grep -v = | sed 's: *drive_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Subdisk state texts */
+char *sdstatetext [] =
+ {
+FOO
+egrep -e 'sd_[A-z0-9]*,' $infile | grep -v = | sed 's: *sd_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Plex state texts */
+char *plexstatetext [] =
+ {
+FOO
+egrep -e 'plex_[A-z0-9]*,' $infile | grep -v = | sed 's: *plex_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+
+/* Volume state texts */
+char *volstatetext [] =
+ {
+FOO
+egrep -e 'volume_[A-z0-9]*,' $infile | grep -v = | sed 's: *volume_\([^,]*\).*: \"\1\",:' >>$ofile
+cat <<FOO >> $ofile
+ };
+FOO
diff --git a/sys/dev/vinum/vinummemory.c b/sys/modules/vinum/memory.c
index c06bd9abd4db8..5dee671167b0e 100644
--- a/sys/dev/vinum/vinummemory.c
+++ b/sys/modules/vinum/memory.c
@@ -1,3 +1,4 @@
+
/*-
* Copyright (c) 1997, 1998
* Nan Yang Computer Services Limited. All rights reserved.
@@ -33,24 +34,20 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinummemory.c,v 1.19 1998/12/30 06:22:26 grog Exp grog $
+ * $Id: memory.c,v 1.16 1998/08/08 04:43:22 grog Exp grog $
*/
#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
+#define USES_VM
+#include "vinumhdr.h"
extern jmp_buf command_fail; /* return on a failed command */
-#ifdef VINUMDEBUG
-#include <dev/vinum/request.h>
-extern struct rqinfo rqinfo[];
-extern struct rqinfo *rqip;
-#endif
-
+#if __FreeBSD__ >= 3
/* Why aren't these declared anywhere? XXX */
int setjmp(jmp_buf);
void longjmp(jmp_buf, int);
+#endif
void freedatabuf(struct mc *me);
caddr_t allocdatabuf(struct mc *me);
@@ -71,7 +68,21 @@ expand_table(void **table, int oldsize, int newsize)
}
}
-#if VINUMDEBUG /* XXX debug */
+#ifndef DEBUG
+/* increase the size of a request block */
+void
+expandrq(struct plexrq *prq)
+{
+ expand_table((void **) &prq->rqe,
+ prq->requests * sizeof(struct rqelement),
+ (prq->requests + RQELTS) * sizeof(struct rqelement));
+ bzero(&prq->rqe[prq->requests], RQELTS * sizeof(struct rqelement)); /* clear the new part */
+ prq->rqcount += RQELTS;
+}
+
+#endif
+
+#if DEBUG /* XXX debug */
#define MALLOCENTRIES 16384
int malloccount = 0;
int highwater = 0; /* highest index ever allocated */
@@ -104,12 +115,6 @@ MMalloc(int size, char *file, int line)
Debugger("Malloc overlap");
}
if (result) {
- char *f = rindex(file, '/'); /* chop off dirname if present */
-
- if (f == NULL)
- f = file;
- else
- f++; /* skip the / */
i = malloccount++;
total_malloced += size;
malloced[i].address = result;
@@ -118,7 +123,7 @@ MMalloc(int size, char *file, int line)
malloced[i].seq = seq++;
malloced[i].flags = me.flags;
malloced[i].databuf = me.databuf; /* only used with kva alloc */
- bcopy(f, malloced[i].file, min(strlen(f) + 1, 16));
+ bcopy(file, malloced[i].file, min(strlen(file) + 1, 16));
}
if (malloccount > highwater)
highwater = malloccount;
@@ -178,21 +183,4 @@ vinum_mallocinfo(caddr_t data)
return 0;
}
-/* return the nth request trace buffer entry. This
- * is indexed back from the current entry (which
- * has index 0) */
-int
-vinum_rqinfo(caddr_t data)
-{
- struct rqinfo *rq = (struct rqinfo *) data;
- int ent = *(int *) data; /* 1st word is index */
- int lastent = rqip - rqinfo; /* entry number of current entry */
-
- if (ent >= RQINFO_SIZE) /* out of the table */
- return ENOENT;
- if ((ent = lastent - ent - 1) < 0)
- ent += RQINFO_SIZE; /* roll over backwards */
- bcopy(&rqinfo[ent], rq, sizeof(struct rqinfo));
- return 0;
-}
#endif
diff --git a/sys/dev/vinum/vinumparser.c b/sys/modules/vinum/parser.c
index 7812f64bbd8b3..9e7f791a7d142 100644
--- a/sys/dev/vinum/vinumparser.c
+++ b/sys/modules/vinum/parser.c
@@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumparser.c,v 1.14 1999/01/18 03:30:07 grog Exp grog $
+ * $Id: parser.c,v 1.11 1998/08/10 08:50:42 grog Exp grog $
*/
/* This file contains the parser for the configuration routines. It's used
@@ -52,15 +52,10 @@
* Error conditions are end of line before end of quote, or no space after
* a closing quote. In this case, tokenize() returns -1. */
-#ifdef KERNEL
-#include "opt_vinum.h"
-#endif
-
#include <sys/param.h>
#ifdef KERNEL
#undef KERNEL /* XXX */
#define REALLYKERNEL
-#include "opt_vinum.h"
#else
#include <ctype.h>
#include <errno.h>
@@ -73,12 +68,12 @@
#include <sys/mount.h>
#include <sys/device.h>
#include <sys/disk.h>
-#include <sys/buf.h>
+#include "sys/buf.h"
-#include <dev/vinum/vinumvar.h>
-#include <dev/vinum/vinumkw.h>
-#include <dev/vinum/vinumio.h>
-#include <dev/vinum/vinumext.h>
+#include <vinumvar.h>
+#include "vinumkw.h"
+#include "vinumio.h"
+#include "vinumext.h"
#ifdef REALLYKERNEL
#define isspace(c) ((c == ' ') || (c == '\t')) /* check for white space */
@@ -121,7 +116,7 @@ struct _keywords keywords[] =
keypair(rename),
keypair(detached),
#ifndef KERNEL /* for vinum(8) only */
-#ifdef VINUMDEBUG
+#ifdef DEBUG
keypair(debug),
#endif
keypair(attach),
@@ -145,11 +140,6 @@ struct _keywords keywords[] =
keypair(resetconfig),
keypair(start),
keypair(stop),
- keypair(makedev),
- keypair(help),
- keypair(quit),
- keypair(setdaemon),
- keypair(getdaemon),
keypair(resetstats)
#endif
};
diff --git a/sys/dev/vinum/vinumrequest.c b/sys/modules/vinum/request.c
index 91f6e15dd9e38..589eb3fac0ba2 100644
--- a/sys/dev/vinum/vinumrequest.c
+++ b/sys/modules/vinum/request.c
@@ -37,16 +37,18 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumrequest.c,v 1.22 1999/01/17 06:15:46 grog Exp grog $
+ * $Id: request.c,v 1.17 1998/08/13 06:04:47 grog Exp grog $
*/
#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/request.h>
+#include "vinumhdr.h"
+#include "request.h"
#include <miscfs/specfs/specdev.h>
#include <sys/resourcevar.h>
+/* pointer to ioctl p parameter, to save passing it around */
+extern struct proc *myproc;
+
enum requeststatus bre(struct request *rq,
int plexno,
daddr_t * diskstart,
@@ -65,57 +67,24 @@ int check_range_covered(struct request *);
void complete_rqe(struct buf *bp);
void complete_raid5_write(struct rqelement *);
int abortrequest(struct request *rq, int error);
+void sdio(struct buf *bp);
void sdio_done(struct buf *bp);
int vinum_bounds_check(struct buf *bp, struct volume *vol);
caddr_t allocdatabuf(struct rqelement *rqe);
void freedatabuf(struct rqelement *rqe);
-#ifdef VINUMDEBUG
-struct rqinfo rqinfo[RQINFO_SIZE];
-struct rqinfo *rqip = rqinfo;
-
-void
-logrq(enum rqinfo_type type, union rqinfou info, struct buf *ubp)
-{
- int s = splhigh();
-
- microtime(&rqip->timestamp); /* when did this happen? */
- rqip->type = type;
- rqip->bp = ubp; /* user buffer */
- switch (type) {
- case loginfo_user_bp:
- case loginfo_user_bpl:
- bcopy(info.bp, &rqip->info.b, sizeof(struct buf));
- break;
-
- case loginfo_iodone:
- case loginfo_rqe:
- case loginfo_raid5_data:
- case loginfo_raid5_parity:
- bcopy(info.rqe, &rqip->info.rqe, sizeof(struct rqelement));
- break;
-
- case loginfo_unused:
- break;
- }
- rqip++;
- if (rqip >= &rqinfo[RQINFO_SIZE]) /* wrap around */
- rqip = rqinfo;
- splx(s);
-}
-
-#endif
-
void
vinumstrategy(struct buf *bp)
{
+ BROKEN_GDB;
int volno;
struct volume *vol = NULL;
+ int s;
struct devcode *device = (struct devcode *) &bp->b_dev; /* decode device number */
+ enum requeststatus status;
switch (device->type) {
case VINUM_SD_TYPE:
- case VINUM_RAWSD_TYPE:
sdio(bp);
return;
@@ -129,7 +98,7 @@ vinumstrategy(struct buf *bp)
return;
case VINUM_VOLUME_TYPE: /* volume I/O */
- volno = Volno(bp->b_dev);
+ volno = VOLNO(bp->b_dev);
vol = &VOL[volno];
if (vol->state != volume_up) { /* can't access this volume */
bp->b_error = EIO; /* I/O error */
@@ -146,7 +115,6 @@ vinumstrategy(struct buf *bp)
* for a single plex. Indicate this by passing a NULL
* pointer (set above) for the volume */
case VINUM_PLEX_TYPE:
- case VINUM_RAWPLEX_TYPE:
bp->b_resid = bp->b_bcount; /* transfer everything */
vinumstart(bp, 0);
return;
@@ -164,17 +132,16 @@ vinumstrategy(struct buf *bp)
int
vinumstart(struct buf *bp, int reviveok)
{
+ BROKEN_GDB;
int plexno;
int maxplex; /* maximum number of plexes to handle */
struct volume *vol;
+ struct rqgroup *rqg; /* current plex's requests */
+ struct rqelement *rqe; /* individual element */
struct request *rq; /* build up our request here */
+ int rqno; /* index in request list */
enum requeststatus status;
-#if VINUMDEBUG
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_user_bp, bp, bp);
-#endif
-
/* XXX In these routines, we're assuming that
* we will always be called with bp->b_bcount
* which is a multiple of the sector size. This
@@ -203,13 +170,13 @@ vinumstart(struct buf *bp, int reviveok)
rq->bp = bp; /* and the user buffer struct */
if (DEVTYPE(bp->b_dev) == VINUM_VOLUME_TYPE) { /* it's a volume, */
- rq->volplex.volno = Volno(bp->b_dev); /* get the volume number */
+ rq->volplex.volno = VOLNO(bp->b_dev); /* get the volume number */
vol = &VOL[rq->volplex.volno]; /* and point to it */
vol->active++; /* one more active request */
maxplex = vol->plexes; /* consider all its plexes */
} else {
vol = NULL; /* no volume */
- rq->volplex.plexno = Plexno(bp->b_dev); /* point to the plex */
+ rq->volplex.plexno = PLEXNO(bp->b_dev); /* point to the plex */
rq->isplex = 1; /* note that it's a plex */
maxplex = 1; /* just the one plex */
}
@@ -251,13 +218,8 @@ vinumstart(struct buf *bp, int reviveok)
biodone(bp);
freerq(rq);
return -1;
- } { /* XXX */
- int result;
- int s = splhigh();
- result = launch_requests(rq, reviveok); /* now start the requests if we can */
- splx(s);
- return result;
}
+ return launch_requests(rq, reviveok); /* now start the requests if we can */
} else
/* This is a write operation. We write to all
* plexes. If this is a RAID 5 plex, we must also
@@ -272,7 +234,7 @@ vinumstart(struct buf *bp, int reviveok)
diskstart = bp->b_blkno; /* start offset of transfer */
status = bre(rq,
- Plexno(bp->b_dev),
+ PLEXNO(bp->b_dev),
&diskstart,
bp->b_blkno + (bp->b_bcount / DEV_BSIZE)); /* build requests for the plex */
}
@@ -287,7 +249,7 @@ vinumstart(struct buf *bp, int reviveok)
freerq(rq);
return -1;
}
- return launch_requests(rq, reviveok); /* now start the requests if we can */
+ return launch_requests(rq, reviveok); /* start the requests */
}
}
@@ -307,49 +269,40 @@ launch_requests(struct request *rq, int reviveok)
* plex we find which is reviving */
if ((rq->flags & XFR_REVIVECONFLICT) /* possible revive conflict */
&&(!reviveok)) { /* and we don't want to do it now, */
- struct sd *sd;
- struct request *waitlist; /* point to the waitlist */
+ struct volume *vol = &VOL[VOLNO(rq->bp->b_dev)];
+ struct plex *plex;
+ int plexno;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++) { /* find the reviving plex */
+ plex = &PLEX[vol->plex[plexno]];
+ if (plex->state == plex_reviving) /* found it */
+ break;
+ }
+ if (plexno < vol->plexes) { /* found it? */
+ struct request *waitlist = plex->waitlist; /* point to the waiting list */
- sd = &SD[rq->sdno];
- if (sd->waitlist != NULL) { /* something there already, */
- waitlist = sd->waitlist;
while (waitlist->next != NULL) /* find the end */
waitlist = waitlist->next;
waitlist->next = rq; /* hook our request there */
- } else
- sd->waitlist = rq; /* hook our request at the front */
-
-#if VINUMDEBUG
- if (debug & DEBUG_REVIVECONFLICT)
- printf("Revive conflict sd %d: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
- rq->sdno,
- (u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
- rq->bp->b_dev,
- rq->bp->b_blkno,
- rq->bp->b_bcount); /* XXX */
-#endif
- return 0; /* and get out of here */
+ return 0; /* and get out of here */
+ } else /* bad vinum, bad */
+ printf("vinum: can't find reviving plex for volume %s\n", vol->name);
}
rq->active = 0; /* nothing yet */
/* XXX This is probably due to a bug */
if (rq->rqg == NULL) { /* no request */
- printf("vinum: null rqg");
abortrequest(rq, EINVAL);
return -1;
}
-#if VINUMDEBUG
+#if DEBUG
if (debug & DEBUG_ADDRESSES)
- printf("Request: %x\n%s dev 0x%x, offset 0x%x, length %ld\n",
+ printf("Request: %x\nWrite dev 0x%x, offset 0x%x, length %ld\n",
(u_int) rq,
- rq->bp->b_flags & B_READ ? "Read" : "Write",
rq->bp->b_dev,
rq->bp->b_blkno,
rq->bp->b_bcount); /* XXX */
vinum_conf.lastrq = (int) rq;
vinum_conf.lastbuf = rq->bp;
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_user_bpl, rq->bp, rq->bp);
#endif
for (rqg = rq->rqg; rqg != NULL; rqg = rqg->next) { /* through the whole request chain */
rqg->active = rqg->count; /* they're all active */
@@ -359,10 +312,10 @@ launch_requests(struct request *rq, int reviveok)
if (rqe->flags & XFR_BAD_SUBDISK) /* this subdisk is bad, */
rqg->active--; /* one less active request */
else {
+ struct drive *drive = &DRIVE[rqe->driveno]; /* drive to access */
if ((rqe->b.b_flags & B_READ) == 0)
rqe->b.b_vp->v_numoutput++; /* one more output going */
- rqe->b.b_flags |= B_ORDERED; /* XXX chase SCSI driver */
-#if VINUMDEBUG
+#if DEBUG
if (debug & DEBUG_ADDRESSES)
printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
rqe->b.b_flags & B_READ ? "Read" : "Write",
@@ -375,8 +328,6 @@ launch_requests(struct request *rq, int reviveok)
printf(" vinumstart sd %d numoutput %ld\n",
rqe->sdno,
rqe->b.b_vp->v_numoutput);
- if (debug & DEBUG_LASTREQS)
- logrq(loginfo_rqe, rqe, rq->bp);
#endif
/* fire off the request */
s = splbio();
@@ -413,6 +364,7 @@ bre(struct request *rq,
daddr_t * diskaddr,
daddr_t diskend)
{
+ BROKEN_GDB;
int sdno;
struct sd *sd;
struct rqgroup *rqg;
@@ -436,12 +388,12 @@ bre(struct request *rq,
sd = &SD[plex->sdnos[sdno]];
if ((*diskaddr < (sd->plexoffset + sd->sectors)) /* The request starts before the end of this */
&&(diskend > sd->plexoffset)) { /* subdisk and ends after the start of this sd */
- if (sd->state != sd_up) {
+ if ((sd->state != sd_up) || (plex->state != plex_up)) {
enum requeststatus s;
s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
- if (s)
- return s; /* XXX get this right */
+ if (s) /* give up? */
+ return s; /* yup */
}
rqg = allocrqg(rq, 1); /* space for the request */
if (rqg == NULL) { /* malloc failed */
@@ -500,7 +452,7 @@ bre(struct request *rq,
blockoffset = stripeoffset % plex->stripesize;
sd = &SD[plex->sdnos[sdno]]; /* the subdisk in question */
- if (sd->state != sd_up) {
+ if ((sd->state != sd_up) || (plex->state != plex_up)) {
enum requeststatus s;
s = checksdstate(sd, rq, *diskaddr, diskend); /* do we need to change state? */
@@ -568,6 +520,7 @@ enum requeststatus
build_read_request(struct request *rq, /* request */
int plexindex)
{ /* index in the volume's plex table */
+ BROKEN_GDB;
struct buf *bp;
daddr_t startaddr; /* offset of previous part of transfer */
daddr_t diskaddr; /* offset of current part of transfer */
@@ -638,6 +591,7 @@ build_read_request(struct request *rq, /* request */
enum requeststatus
build_write_request(struct request *rq)
{ /* request */
+ BROKEN_GDB;
struct buf *bp;
daddr_t diskstart; /* offset of current part of transfer */
daddr_t diskend; /* and end offset of transfer */
@@ -651,7 +605,7 @@ build_write_request(struct request *rq)
status = REQUEST_OK;
for (plexno = 0; plexno < vol->plexes; plexno++) {
diskstart = bp->b_blkno; /* start offset of transfer */
- status = max(status, bre(rq, /* build requests for the plex */
+ status = min(status, bre(rq, /* build requests for the plex */
vol->plex[plexno],
&diskstart,
diskend));
@@ -663,6 +617,7 @@ build_write_request(struct request *rq)
enum requeststatus
build_rq_buffer(struct rqelement *rqe, struct plex *plex)
{
+ BROKEN_GDB;
struct sd *sd; /* point to subdisk */
struct volume *vol;
struct buf *bp;
@@ -678,8 +633,8 @@ build_rq_buffer(struct rqelement *rqe, struct plex *plex)
bp->b_proc = ubp->b_proc; /* process pointer */
bp->b_flags = ubp->b_flags & (B_NOCACHE | B_READ | B_ASYNC); /* copy these flags from user bp */
bp->b_flags |= B_CALL | B_BUSY; /* inform us when it's done */
- /* XXX Should we check for reviving plexes here, and
- * set B_ORDERED if so? */
+ if (plex->state == plex_reviving)
+ bp->b_flags |= B_ORDERED; /* keep request order if we're reviving */
bp->b_iodone = complete_rqe; /* by calling us here */
bp->b_dev = DRIVE[rqe->driveno].dev; /* drive device */
bp->b_blkno = rqe->sdoffset + sd->driveoffset; /* start address */
@@ -739,20 +694,22 @@ sdio(struct buf *bp)
daddr_t endoffset;
struct drive *drive;
- sd = &SD[Sdno(bp->b_dev)]; /* point to the subdisk */
+ sd = &SD[SDNO(bp->b_dev)]; /* point to the subdisk */
drive = &DRIVE[sd->driveno];
if (drive->state != drive_up) { /* XXX until we get the states fixed */
- if (bp->b_flags & B_WRITE) /* writing, */
- set_sd_state(Sdno(bp->b_dev), sd_stale, setstate_force);
- else
- set_sd_state(Sdno(bp->b_dev), sd_crashed, setstate_force);
+ set_sd_state(SDNO(bp->b_dev), sd_obsolete, setstate_force);
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
biodone(bp);
return;
}
- if (sd->state < sd_empty) { /* nothing to talk to, */
+ /* XXX decide which states we will really accept here. up
+ * implies it could be involved with a plex, in which
+ * case we don't want to dick with it */
+ if ((sd->state != sd_up)
+ && (sd->state != sd_initializing)
+ && (sd->state != sd_reborn)) { /* we can't access it */
bp->b_flags |= B_ERROR;
bp->b_flags = EIO;
if (bp->b_flags & B_BUSY) /* XXX why isn't this always the case? */
@@ -792,7 +749,7 @@ sdio(struct buf *bp)
}
if ((sbp->b.b_flags & B_READ) == 0) /* write */
sbp->b.b_vp->v_numoutput++; /* one more output going */
-#if VINUMDEBUG
+#if DEBUG
if (debug & DEBUG_ADDRESSES)
printf(" %s dev 0x%x, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
sbp->b.b_flags & B_READ ? "Read" : "Write",
diff --git a/sys/dev/vinum/request.h b/sys/modules/vinum/request.h
index dfeb19604ca2c..b4beccca9b42c 100644
--- a/sys/dev/vinum/request.h
+++ b/sys/modules/vinum/request.h
@@ -33,11 +33,19 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: request.h,v 1.13 1999/01/14 05:46:22 grog Exp grog $
+ * $Id: request.h,v 1.10 1998/08/03 07:15:26 grog Exp grog $
*/
/* Information needed to set up a transfer */
+/* struct buf is surprisingly big (about 300
+ * bytes), and it's part of the request, so this
+ * value is really important. Most requests
+ * don't need more than 2 subrequests per
+ * plex. The table is automatically extended if
+ * this value is too small. */
+#define RQELTS 2 /* default of 2 requests per transfer */
+
enum xferinfo {
XFR_NORMAL_READ = 1,
XFR_NORMAL_WRITE = 2, /* write request in normal mode */
@@ -49,7 +57,7 @@ enum xferinfo {
XFR_PARITY_BLOCK = 0x80, /* parity block in request */
XFR_BAD_SUBDISK = 0x100, /* this subdisk is dead */
XFR_MALLOCED = 0x200, /* this buffer is malloced */
-#if VINUMDEBUG
+#if DEBUG
XFR_PHASE2 = 0x800, /* documentation only: 2nd phase write */
#endif
XFR_REVIVECONFLICT = 0x1000, /* possible conflict with a revive operation */
@@ -116,17 +124,16 @@ struct rqgroup {
* work we have to do to satisfy it */
struct request {
struct buf *bp; /* pointer to the high-level request */
- enum xferinfo flags;
+ int flags;
union {
int volno; /* volume index */
int plexno; /* or plex index */
} volplex;
int error; /* current error indication */
- int sdno; /* reviving subdisk (XFR_REVIVECONFLICT) */
short isplex; /* set if this is a plex request */
short active; /* number of subrequests still active */
struct rqgroup *rqg; /* pointer to the first group of requests */
- struct rqgroup *lrqg; /* and to the last group of requests */
+ struct rqgroup *lrqg; /* and to the first group of requests */
struct request *next; /* link of waiting requests */
};
@@ -150,71 +157,3 @@ enum requeststatus {
REQUEST_DOWN, /* request failed: subdisk down */
REQUEST_ENOMEM /* ran out of memory */
};
-
-#ifdef VINUMDEBUG
-/* Trace entry for request info (DEBUG_LASTREQS) */
-enum rqinfo_type {
- loginfo_unused, /* never been used */
- loginfo_user_bp, /* this is the bp when strategy is called */
- loginfo_user_bpl, /* and this is the bp at launch time */
- loginfo_rqe, /* user RQE */
- loginfo_iodone, /* iodone */
- loginfo_raid5_data, /* write RAID-5 data block */
- loginfo_raid5_parity /* write RAID-5 parity block */
-};
-
-union rqinfou { /* info to pass to logrq */
- struct buf *bp;
- struct rqelement *rqe; /* address of request, for correlation */
-};
-
-struct rqinfo {
- enum rqinfo_type type; /* kind of event */
- struct timeval timestamp; /* time it happened */
- struct buf *bp; /* point to user buffer */
- union {
- struct buf b; /* yup, the *whole* buffer header */
- struct rqelement rqe; /* and the whole rqe */
- } info;
-};
-
-#define RQINFO_SIZE 128 /* number of info slots in buffer */
-
-void logrq(enum rqinfo_type type, union rqinfou info, struct buf *ubp);
-#endif
-
-/* Structures for the daemon */
-
-/* types of request to the daemon */
-enum daemonrq {
- daemonrq_none, /* dummy to catch bugs */
- daemonrq_ioerror, /* error occurred on I/O */
- daemonrq_saveconfig, /* save configuration */
- daemonrq_return, /* return to userland */
- daemonrq_ping, /* show sign of life */
- daemonrq_init, /* initialize a plex */
- daemonrq_revive, /* revive a subdisk */
-};
-
-/* info field for daemon requests */
-union daemoninfo { /* and the request information */
- struct request *rq; /* for daemonrq_ioerror */
- struct sd *sd; /* for daemonrq_revive */
- struct plex *plex; /* for daemonrq_init */
-};
-
-struct daemonq {
- struct daemonq *next; /* pointer to next element in queue */
- enum daemonrq type; /* type of request */
- union daemoninfo info; /* and the request information */
-};
-
-void queue_daemon_request(enum daemonrq type, union daemoninfo info);
-
-extern int daemon_options;
-
-enum daemon_option {
- daemon_verbose = 1, /* talk about what we're doing */
- daemon_stopped = 2,
- daemon_noupdate = 4, /* don't update the disk config, for recovery */
-};
diff --git a/sys/modules/vinum/revive.c b/sys/modules/vinum/revive.c
new file mode 100644
index 0000000000000..216dc4887d417
--- /dev/null
+++ b/sys/modules/vinum/revive.c
@@ -0,0 +1,128 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * This software is provided ``as is'', and any express or implied
+ * warranties, including, but not limited to, the implied warranties of
+ * merchantability and fitness for a particular purpose are disclaimed.
+ * In no event shall the company or contributors be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential
+ * damages (including, but not limited to, procurement of substitute
+ * goods or services; loss of use, data, or profits; or business
+ * interruption) however caused and on any theory of liability, whether
+ * in contract, strict liability, or tort (including negligence or
+ * otherwise) arising in any way out of the use of this software, even if
+ * advised of the possibility of such damage.
+ *
+ * $Id: revive.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+
+/* revive a block of a plex. Return an error
+ * indication. EAGAIN means successful copy, but
+ * that more blocks remain to be copied.
+ * XXX We should specify a block size here. At the moment,
+ * just take a default value. FIXME */
+int
+revive_block(int plexno)
+{
+ struct plex *plex = &PLEX[plexno];
+ struct buf *bp;
+ int error = EAGAIN;
+ int size;
+ int s; /* priority level */
+
+ if (plex->revive_blocksize == 0) {
+ if (plex->stripesize != 0) /* we're striped, don't revive more than */
+ plex->revive_blocksize = min(DEFAULT_REVIVE_BLOCKSIZE, plex->stripesize); /* one block at a time */
+ else
+ plex->revive_blocksize = DEFAULT_REVIVE_BLOCKSIZE;
+ }
+ size = min(plex->revive_blocksize, (plex->length - plex->revived) << DEV_BSHIFT);
+
+ s = splbio();
+ /* Get a buffer */
+ bp = geteblk(size);
+ if (bp == NULL) {
+ splx(s);
+ return ENOMEM;
+ }
+ if (bp->b_qindex != 0) /* on a queue, */
+ bremfree(bp); /* remove it */
+ splx(s);
+
+ /* Amount to transfer: block size, unless it
+ * would overlap the end */
+ bp->b_bufsize = size;
+ bp->b_bcount = bp->b_bufsize;
+ bp->b_resid = 0x0;
+ bp->b_blkno = plex->revived; /* we've got this far */
+
+ /* XXX what about reviving anonymous plexes? */
+
+ /* First, read the data from the volume. We don't
+ * care which plex, that's bre's job */
+ bp->b_dev = VINUMBDEV(plex->volno, 0, 0, VINUM_VOLUME_TYPE); /* create the device number */
+ bp->b_flags = B_BUSY | B_READ;
+ vinumstart(bp, 1);
+ biowait(bp);
+ if (bp->b_flags & B_ERROR)
+ error = bp->b_error;
+ else
+ /* Now write to the plex */
+ {
+ s = splbio();
+ if (bp->b_qindex != 0) /* on a queue, */
+ bremfree(bp); /* remove it */
+ splx(s);
+ bp->b_dev = VINUMBDEV(plex->volno, plex->volplexno, 0, VINUM_PLEX_TYPE); /* create the device number */
+
+ bp->b_flags = B_BUSY; /* make this a write */
+ bp->b_resid = 0x0;
+ vinumstart(bp, 1);
+ biowait(bp);
+ if (bp->b_flags & B_ERROR)
+ error = bp->b_error;
+ else {
+ plex->revived += bp->b_bcount >> DEV_BSHIFT; /* moved this much further down */
+ if (plex->revived >= plex->length) { /* finished */
+ plex->revived = 0;
+ plex->state = plex_up; /* do we need to do more? */
+ if (plex->volno >= 0) /* we have a volume, */
+ set_volume_state(plex->volno, volume_up, 0);
+ printf("vinum: plex %s is %s\n", plex->name, plex_state(plex->state));
+ save_config(); /* and save the updated configuration */
+ error = 0; /* we're done */
+ }
+ }
+ while (plex->waitlist) { /* we have waiting requests */
+ launch_requests(plex->waitlist, 1); /* do them now */
+ plex->waitlist = plex->waitlist->next; /* and move on to the next */
+ }
+ }
+ if (bp->b_qindex == 0) /* not on a queue, */
+ brelse(bp); /* is this kosher? */
+ return error;
+}
diff --git a/sys/modules/vinum/state.c b/sys/modules/vinum/state.c
new file mode 100644
index 0000000000000..2ce2ed0c29e55
--- /dev/null
+++ b/sys/modules/vinum/state.c
@@ -0,0 +1,755 @@
+/*-
+ * Copyright (c) 1997, 1998
+ * Nan Yang Computer Services Limited. All rights reserved.
+ *
+ * This software is distributed under the so-called ``Berkeley
+ * License'':
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Nan Yang Computer
+ * Services Limited.
+ * 4. Neither the name of the Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * This software is provided ``as is'', and any express or implied
+ * warranties, including, but not limited to, the implied warranties of
+ * merchantability and fitness for a particular purpose are disclaimed.
+ * In no event shall the company or contributors be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential
+ * damages (including, but not limited to, procurement of substitute
+ * goods or services; loss of use, data, or profits; or business
+ * interruption) however caused and on any theory of liability, whether
+ * in contract, strict liability, or tort (including negligence or
+ * otherwise) arising in any way out of the use of this software, even if
+ * advised of the possibility of such damage.
+ *
+ * $Id: state.c,v 2.6 1998/08/19 08:04:47 grog Exp grog $
+ */
+
+#define REALLYKERNEL
+#include "vinumhdr.h"
+#include "request.h"
+
+/* Update drive state */
+/* Return 1 if the state changes, otherwise 0 */
+int
+set_drive_state(int driveno, enum drivestate state, int flags)
+{
+ struct drive *drive = &DRIVE[driveno];
+ int oldstate = drive->state;
+ int sdno;
+
+ if (drive->state == drive_unallocated) /* no drive to do anything with, */
+ return 0;
+
+ if (state != oldstate) { /* don't change it if it's not different */
+ if (state == drive_down) { /* the drive's going down */
+ if (flags || (drive->opencount == 0)) { /* we can do it */
+ close_drive(drive);
+ drive->state = state;
+ printf("vinum: drive %s is %s\n", drive->label.name, drive_state(drive->state));
+ } else
+ return 0; /* don't do it */
+ }
+ drive->state = state; /* set the state */
+ if (((drive->state == drive_up)
+ || ((drive->state == drive_coming_up)))
+ && (drive->vp == NULL)) /* should be open, but we're not */
+ init_drive(drive); /* which changes the state again */
+ if ((state != oldstate) /* state has changed */
+ &&((flags & setstate_norecurse) == 0)) { /* and we want to recurse, */
+ for (sdno = 0; sdno < vinum_conf.subdisks_used; sdno++) { /* find this drive's subdisks */
+ if (SD[sdno].driveno == driveno) /* belongs to this drive */
+ set_sd_state(sdno, sd_down, setstate_force | setstate_recursing); /* take it down */
+ }
+ save_config(); /* and save the updated configuration */
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/* Try to set the subdisk state. Return 1 if state changed to
+ * what we wanted, -1 if it changed to something else, and 0
+ * if no change.
+ *
+ * This routine is called both from the user (up, down states
+ * only) and internally.
+ */
+int
+set_sd_state(int sdno, enum sdstate state, enum setstateflags flags)
+{
+ struct sd *sd = &SD[sdno];
+ int oldstate = sd->state;
+ int status = 1; /* status to return */
+
+ if (state == oldstate)
+ return 0; /* no change */
+
+ if (sd->state == sd_unallocated) /* no subdisk to do anything with, */
+ return 0;
+
+ if (sd->driveoffset < 0) { /* not allocated space */
+ sd->state = sd_down;
+ if (state != sd_down)
+ return -1;
+ } else { /* space allocated */
+ switch (state) {
+ case sd_down:
+ if ((!flags & setstate_force) /* but gently */
+ &&(sd->plexno >= 0)) /* and we're attached to a plex, */
+ return 0; /* don't do it */
+ break;
+
+ case sd_up:
+ if (DRIVE[sd->driveno].state != drive_up) /* can't bring the sd up if the drive isn't, */
+ return 0; /* not even by force */
+ switch (sd->state) {
+ case sd_obsolete:
+ case sd_down: /* been down, no data lost */
+ if ((sd->plexno) /* we're associated with a plex */
+ &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
+ ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
+ break;
+ /* XXX Get this right: make sure that other plexes in
+ * the volume cover this address space, otherwise
+ * we make this one sd_up */
+ sd->state = sd_reborn; /* here it is again */
+ printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(state));
+ status = -1;
+ break;
+
+ case sd_init: /* brand new */
+ if (flags & setstate_configuring) /* we're doing this while configuring */
+ break;
+ sd->state = sd_empty; /* nothing in it */
+ printf("vinum: subdisk %s is %s, not %s\n", sd->name, sd_state(sd->state), sd_state(state));
+ status = -1;
+ break;
+
+ case sd_initializing:
+ break; /* go on and do it */
+
+ case sd_empty:
+ if ((sd->plexno) /* we're associated with a plex */
+ &&(((PLEX[sd->plexno].state < plex_firstup) /* and it's not up */
+ ||(PLEX[sd->plexno].subdisks > 1)))) /* or it's the only one */
+ break;
+ return 0; /* can't do it */
+
+ default: /* can't do it */
+ /* There's no way to bring subdisks up directly from
+ * other states. First they need to be initialized
+ * or revived */
+ return 0;
+ }
+ break;
+
+ default: /* other ones, only internal with force */
+ if (flags & setstate_force == 0) /* no force? What's this? */
+ return 0; /* don't do it */
+ }
+ }
+ sd->state = state;
+ printf("vinum: subdisk %s is %s\n", sd->name, sd_state(sd->state));
+ if ((flags & setstate_norecurse) == 0)
+ set_plex_state(sd->plexno, plex_up, setstate_recursing); /* update plex state */
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return status;
+}
+
+/* Called from request routines when they find
+ * a subdisk which is not kosher. Decide whether
+ * it warrants changing the state. Return
+ * REQUEST_DOWN if we can't use the subdisk,
+ * REQUEST_OK if we can. */
+enum requeststatus
+checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend)
+{
+ struct plex *plex = &PLEX[sd->plexno];
+ int writeop = (rq->bp->b_flags & B_READ) == 0; /* note if we're writing */
+
+ /* first, see if the plex wants to be accessed */
+ switch (plex->state) {
+ case plex_reviving:
+ /* When writing, we'll write anything that starts
+ * up to the current revive pointer, but we'll
+ * only accept a read which finishes before the
+ * current revive pointer.
+ */
+ if ((writeop && (diskaddr > plex->revived)) /* write starts after current revive pointer */
+ ||((!writeop) && (diskend >= plex->revived))) { /* or read ends after current revive pointer */
+ if (writeop) { /* writing to a consistent down disk */
+ if (DRIVE[sd->driveno].state == drive_up)
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
+ else
+ set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
+ }
+ return REQUEST_DOWN; /* that part of the plex is still down */
+ } else if (diskend >= plex->revived) /* write finishes beyond revive pointer */
+ rq->flags |= XFR_REVIVECONFLICT; /* note a potential conflict */
+ /* FALLTHROUGH */
+
+ case plex_up:
+ case plex_degraded:
+ case plex_flaky:
+ /* We can access the plex: let's see
+ * how the subdisk feels */
+ switch (sd->state) {
+ case sd_up:
+ return REQUEST_OK;
+
+ case sd_reborn:
+ if (writeop)
+ return REQUEST_OK; /* always write to a reborn disk */
+ /* Handle the mapping. We don't want to reject
+ * a read request to a reborn subdisk if that's
+ * all we have. XXX */
+ return REQUEST_DOWN;
+
+ case sd_down:
+ case sd_crashed:
+ if (writeop) { /* writing to a consistent down disk */
+ if (DRIVE[sd->driveno].state == drive_up)
+ set_sd_state(sd->sdno, sd_stale, setstate_force); /* it's not consistent now */
+ else
+ set_sd_state(sd->sdno, sd_obsolete, setstate_force); /* it's not consistent now */
+ }
+ return REQUEST_DOWN; /* and it's down one way or another */
+
+ default:
+ return REQUEST_DOWN;
+ }
+
+ default:
+ return REQUEST_DOWN;
+ }
+}
+
+void
+add_defective_region(struct plex *plex, off_t offset, size_t length)
+{
+/* XXX get this ordered, and coalesce regions if necessary */
+ if (++plex->defective_regions > plex->defective_region_count)
+ EXPAND(plex->defective_region,
+ struct plexregion,
+ plex->defective_region_count,
+ PLEX_REGION_TABLE_SIZE);
+ plex->defective_region[plex->defective_regions - 1].offset = offset;
+ plex->defective_region[plex->defective_regions - 1].length = length;
+}
+
+void
+add_unmapped_region(struct plex *plex, off_t offset, size_t length)
+{
+ if (++plex->unmapped_regions > plex->unmapped_region_count)
+ EXPAND(plex->unmapped_region,
+ struct plexregion,
+ plex->unmapped_region_count,
+ PLEX_REGION_TABLE_SIZE);
+ plex->unmapped_region[plex->unmapped_regions - 1].offset = offset;
+ plex->unmapped_region[plex->unmapped_regions - 1].length = length;
+}
+
+/* Rebuild a plex free list and set state if
+ * we have a configuration error */
+void
+rebuild_plex_unmappedlist(struct plex *plex)
+{
+ int sdno;
+ struct sd *sd;
+ int lastsdend = 0; /* end offset of last subdisk */
+
+ if (plex->unmapped_region != NULL) { /* we're going to rebuild it */
+ Free(plex->unmapped_region);
+ plex->unmapped_region = NULL;
+ plex->unmapped_regions = 0;
+ plex->unmapped_region_count = 0;
+ }
+ if (plex->defective_region != NULL) {
+ Free(plex->defective_region);
+ plex->defective_region = NULL;
+ plex->defective_regions = 0;
+ plex->defective_region_count = 0;
+ }
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ if (sd->plexoffset < lastsdend) { /* overlap */
+ printf("vinum: Plex %s, subdisk %s overlaps previous\n", plex->name, sd->name);
+ set_plex_state(plex->plexno, plex_down, setstate_force); /* don't allow that */
+ } else if (sd->plexoffset > lastsdend) /* gap */
+ add_unmapped_region(plex, lastsdend, sd->plexoffset - lastsdend);
+ else if (sd->state < sd_reborn) /* this part defective */
+ add_defective_region(plex, sd->plexoffset, sd->sectors);
+ lastsdend = sd->plexoffset + sd->sectors;
+ }
+}
+
+/* return a state map for the subdisks of a plex */
+enum sdstates
+sdstatemap(struct plex *plex, int *sddowncount)
+{
+ int sdno;
+ enum sdstates statemap = 0; /* note the states we find */
+
+ *sddowncount = 0; /* no subdisks down yet */
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ struct sd *sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
+
+ switch (sd->state) {
+ case sd_empty:
+ statemap |= sd_emptystate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_init:
+ statemap |= sd_initstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_down:
+ statemap |= sd_downstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_crashed:
+ statemap |= sd_crashedstate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_obsolete:
+ statemap |= sd_obsolete;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_stale:
+ statemap |= sd_stalestate;
+ (*sddowncount)++; /* another unusable subdisk */
+ break;
+
+ case sd_reborn:
+ statemap |= sd_rebornstate;
+ break;
+
+ case sd_up:
+ statemap |= sd_upstate;
+ break;
+
+ default:
+ statemap |= sd_otherstate;
+ break;
+ }
+ }
+ return statemap;
+}
+
+/* determine the state of the volume relative to this plex */
+enum volplexstate
+vpstate(struct plex *plex)
+{
+ struct volume *vol;
+ enum volplexstate state = volplex_onlyusdown; /* state to return */
+ int plexno;
+
+ if (plex->volno < 0) /* not associated with a volume */
+ return volplex_onlyusdown; /* assume the worst */
+
+ vol = &VOL[plex->volno]; /* point to our volume */
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ if (&PLEX[vol->plex[plexno]] == plex) { /* us */
+ if (PLEX[vol->plex[plexno]].state == plex_up) /* are we up? */
+ state |= volplex_onlyus; /* yes */
+ } else {
+ if (PLEX[vol->plex[plexno]].state == plex_up) /* not us */
+ state |= volplex_otherup; /* and when they were up, they were up */
+ else
+ state |= volplex_alldown; /* and when they were down, they were down */
+ }
+ }
+ return state; /* and when they were only halfway up */
+} /* they were neither up nor down */
+
+/* Check if all bits b are set in a */
+int allset(int a, int b);
+
+int
+allset(int a, int b)
+{
+ return (a & b) == b;
+}
+
+/* Update the state of a plex dependent on its subdisks.
+ * Also rebuild the unmapped_region and defective_region table */
+int
+set_plex_state(int plexno, enum plexstate state, enum setstateflags flags)
+{
+ int sddowncount = 0; /* number of down subdisks */
+ struct plex *plex = &PLEX[plexno]; /* point to our plex */
+ enum plexstate oldstate = plex->state;
+ enum volplexstate vps = vpstate(plex); /* how do we compare with the other plexes? */
+ enum sdstates statemap = sdstatemap(plex, &sddowncount); /* get a map of the subdisk states */
+
+ if ((flags & setstate_force) && (oldstate == state)) /* we're there already, */
+ return 0; /* no change */
+
+ if (plex->state == plex_unallocated) /* no plex to do anything with, */
+ return 0;
+
+ switch (state) {
+ case plex_up:
+ if ((plex->state == plex_initializing) /* we're initializing */
+ &&(statemap != sd_upstate)) /* but SDs aren't up yet */
+ return 0; /* do nothing */
+
+ /* We don't really care what our state was before
+ * if we want to come up. We rely entirely on the
+ * state of our subdisks and our volume */
+ switch (vps) {
+ case volplex_onlyusdown:
+ case volplex_alldown: /* another plex is down, and so are we */
+ if (statemap == sd_upstate) { /* all subdisks ready for action */
+ if ((plex->state == plex_init) /* we're brand spanking new */
+ &&(VOL[plex->volno].flags & VF_CONFIG_SETUPSTATE)) { /* and we consider that up */
+ /* Conceptually, an empty plex does not contain valid data,
+ * but normally we'll see this state when we have just
+ * created a plex, and it's either consistent from earlier,
+ * or we don't care about the previous contents (we're going
+ * to create a file system or use it for swap).
+ *
+ * We need to do this in one swell foop: on the next call
+ * we will no longer be just empty.
+ *
+ * We'll still come back to this function for the remaining
+ * plexes in the volume. They'll be up already, so that
+ * doesn't change anything, but it's not worth the additional
+ * code to stop doing it. */
+ struct volume *vol = &VOL[plex->volno];
+ int plexno;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++)
+ PLEX[vol->plex[plexno]].state = plex_up;
+ }
+ plex->state = plex_up; /* bring up up, anyway */
+ } else
+ plex->state = plex_down;
+ break;
+
+ case volplex_onlyusup: /* only we are up: others are down */
+ case volplex_onlyus: /* we're up and alone */
+ if ((statemap == sd_upstate) /* subdisks all up */
+ ||(statemap == sd_emptystate)) /* or all empty */
+ plex->state = plex_up; /* go for it */
+ else if ((statemap & (sd_upstate | sd_reborn)) == statemap) /* all up or reborn, */
+ plex->state = plex_flaky;
+ else if (statemap & (sd_upstate | sd_reborn)) /* some up or reborn, */
+ plex->state = plex_degraded; /* so far no corruption */
+ else
+ plex->state = plex_faulty;
+ break;
+
+ case volplex_otherup: /* another plex is up */
+ case volplex_otherupdown: /* other plexes are up and down */
+ if ((statemap == sd_upstate) /* subdisks all up */
+ ||(statemap == sd_emptystate) /* or all empty */
+ ) {
+ /* Is the data in all subdisks valid? */
+ if (statemap == statemap & (sd_downstate | sd_rebornstate | sd_upstate))
+ break; /* yes, we can bring the plex up */
+ plex->state = plex_reviving; /* we need reviving */
+ return EAGAIN;
+ } else
+ plex->state = plex_faulty; /* still in error */
+ break;
+
+ case volplex_allup: /* all plexes are up */
+ case volplex_someup:
+ if ((statemap & (sd_upstate | sd_reborn)) == statemap) /* all up or reborn, */
+ break; /* no change */
+ else
+ plex->state = plex_degraded; /* we're not all there */
+ }
+
+ if (plex->state != oldstate)
+ break;
+ return 0; /* no change */
+
+ case plex_down: /* want to take it down */
+ if (((vps == volplex_onlyus) /* we're the only one up */
+ ||(vps == volplex_onlyusup)) /* we're the only one up */
+ &&(!(flags & setstate_force))) /* and we don't want to use force */
+ return 0; /* can't do it */
+ plex->state = state; /* do it */
+ break;
+
+ /* This is only requested by the driver.
+ * Trust ourselves */
+ case plex_faulty:
+ plex->state = state; /* do it */
+ break;
+
+ case plex_initializing:
+ /* XXX consider what safeguards we need here */
+ if ((flags & setstate_force) == 0)
+ return 0;
+ plex->state = state; /* do it */
+ break;
+
+ /* What's this? */
+ default:
+ return 0;
+ }
+ printf("vinum: plex %s is %s\n", plex->name, plex_state(plex->state));
+ /* Now see what we have left, and whether
+ * we're taking the volume down */
+ if (plex->volno >= 0) { /* we have a volume */
+ struct volume *vol = &VOL[plex->volno];
+
+ vps = vpstate(plex); /* get our combined state again */
+ if ((flags & setstate_norecurse) == 0) { /* we can recurse */
+ if ((vol->state == volume_up)
+ && (vps == volplex_alldown)) /* and we're all down */
+ set_volume_state(plex->volno, volume_down, setstate_recursing); /* take our volume down */
+ else if ((vol->state == volume_down)
+ && (vps & (volplex_otherup | volplex_onlyusup))) /* and at least one is up */
+ set_volume_state(plex->volno, volume_up, setstate_recursing); /* bring our volume up */
+ }
+ }
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+}
+
+/* Update the state of a plex dependent on its plexes.
+ * Also rebuild the unmapped_region and defective_region table */
+int
+set_volume_state(int volno, enum volumestate state, enum setstateflags flags)
+{
+ int plexno;
+ enum plexstates {
+ plex_downstate = 1, /* found a plex which is down */
+ plex_degradedstate = 2, /* found a plex which is halfway up */
+ plex_upstate = 4 /* found a plex which is completely up */
+ };
+
+ int plexstatemap = 0; /* note the states we find */
+ struct volume *vol = &VOL[volno]; /* point to our volume */
+
+ if (vol->state == state) /* we're there already */
+ return 0; /* no change */
+ if (vol->state == volume_unallocated) /* no volume to do anything with, */
+ return 0;
+
+ for (plexno = 0; plexno < vol->plexes; plexno++) {
+ struct plex *plex = &PLEX[vol->plex[plexno]]; /* point to the plex */
+ switch (plex->state) {
+ case plex_degraded:
+ case plex_flaky:
+ case plex_reviving:
+ plexstatemap |= plex_degradedstate;
+ break;
+
+ case plex_up:
+ plexstatemap |= plex_upstate;
+ break;
+
+ default:
+ plexstatemap |= plex_downstate;
+ break;
+ }
+ }
+
+ if (state == volume_up) { /* want to come up */
+ if (plexstatemap & plex_upstate) { /* we have a plex which is completely up */
+ vol->state = volume_up; /* did it */
+ printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+ }
+ /* Here we should check whether we have enough
+ * coverage for the complete volume. Writeme XXX */
+ } else if (state == volume_down) { /* want to go down */
+ if ((vol->opencount == 0) /* not open */
+ ||(flags & setstate_force != 0)) { /* or we're forcing */
+ vol->state = volume_down;
+ printf("vinum: volume %s is %s\n", vol->name, volume_state(vol->state));
+ if ((flags & (setstate_configuring | setstate_recursing)) == 0) /* save config now */
+ save_config();
+ return 1;
+ }
+ }
+ return 0; /* no change */
+}
+
+/* Start an object, in other words do what we can to get it up.
+ * This is called from vinumioctl (VINUMSTART).
+ * Return error indications via ioctl_reply
+ */
+void
+start_object(struct vinum_ioctl_msg *data)
+{
+ int status;
+ int realstatus; /* what we really have */
+ int objindex = data->index; /* data gets overwritten */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
+
+ switch (data->type) {
+ case drive_object:
+ status = set_drive_state(objindex, drive_up, setstate_none);
+ realstatus = DRIVE[objindex].state == drive_up; /* set status on whether we really did it */
+ break;
+
+ case sd_object:
+ status = set_sd_state(objindex, sd_up, setstate_none); /* set state */
+ realstatus = SD[objindex].state == sd_up; /* set status on whether we really did it */
+ break;
+
+ case plex_object:
+ if (PLEX[objindex].state == plex_reviving) { /* reviving, */
+ ioctl_reply->error = revive_block(objindex); /* revive another block */
+ ioctl_reply->msg[0] = '\0'; /* no comment */
+ return;
+ }
+ status = set_plex_state(objindex, plex_up, setstate_none);
+ realstatus = PLEX[objindex].state == plex_up; /* set status on whether we really did it */
+ break;
+
+ case volume_object:
+ status = set_volume_state(objindex, volume_up, setstate_none);
+ realstatus = VOL[objindex].state == volume_up; /* set status on whether we really did it */
+ break;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ return;
+ }
+ /* There's no point in saying anything here:
+ * the userland program does it better */
+ ioctl_reply->msg[0] = '\0';
+ if (realstatus == 0) /* couldn't do it */
+ ioctl_reply->error = EINVAL;
+ else
+ ioctl_reply->error = 0;
+}
+
+/* Stop an object, in other words do what we can to get it down
+ * This is called from vinumioctl (VINUMSTOP).
+ * Return error indications via ioctl_reply.
+ */
+void
+stop_object(struct vinum_ioctl_msg *data)
+{
+ int status = 1;
+ int objindex = data->index; /* save the number from change */
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) data; /* format for returning replies */
+
+ switch (data->type) {
+ case drive_object:
+ status = set_drive_state(objindex, drive_down, data->force);
+ break;
+
+ case sd_object:
+ status = set_sd_state(objindex, sd_down, data->force);
+ break;
+
+ case plex_object:
+ status = set_plex_state(objindex, plex_down, data->force);
+ break;
+
+ case volume_object:
+ status = set_volume_state(objindex, volume_down, data->force);
+ break;
+
+ default:
+ ioctl_reply->error = EINVAL;
+ strcpy(ioctl_reply->msg, "Invalid object type");
+ return;
+ }
+ ioctl_reply->msg[0] = '\0';
+ if (status == 0) /* couldn't do it */
+ ioctl_reply->error = EINVAL;
+ else
+ ioctl_reply->error = 0;
+}
+
+/* VINUM_SETSTATE ioctl: set an object state
+ * msg is the message passed by the user */
+void
+setstate(struct vinum_ioctl_msg *msg)
+{
+ int sdno;
+ struct sd *sd;
+ struct plex *plex;
+ struct _ioctl_reply *ioctl_reply = (struct _ioctl_reply *) msg; /* format for returning replies */
+
+ switch (msg->state) {
+ case object_down:
+ stop_object(msg);
+ break;
+
+ case object_initializing:
+ switch (msg->type) {
+ case sd_object:
+ sd = &SD[msg->index];
+ if ((msg->index >= vinum_conf.subdisks_used)
+ || (sd->state == sd_unallocated)) {
+ sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
+ ioctl_reply->error = EFAULT;
+ return;
+ }
+ set_sd_state(msg->index, sd_initializing, msg->force);
+ if (sd->state != sd_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ } else
+ ioctl_reply->error = 0;
+ break;
+
+ case plex_object:
+ plex = &PLEX[msg->index];
+ if ((msg->index >= vinum_conf.plexes_used)
+ || (plex->state == plex_unallocated)) {
+ sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index);
+ ioctl_reply->error = EFAULT;
+ return;
+ }
+ set_plex_state(msg->index, plex_initializing, msg->force);
+ if (plex->state != plex_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ } else {
+ ioctl_reply->error = 0;
+ for (sdno = 0; sdno < plex->subdisks; sdno++) {
+ sd = &SD[plex->sdnos[sdno]];
+ set_sd_state(plex->sdnos[sdno], sd_initializing, msg->force);
+ if (sd->state != sd_initializing) {
+ strcpy(ioctl_reply->msg, "Can't set state");
+ ioctl_reply->error = EINVAL;
+ break;
+ }
+ }
+ }
+ break;
+
+ default:
+ strcpy(ioctl_reply->msg, "Invalid object");
+ ioctl_reply->error = EINVAL;
+ }
+ break;
+
+ case object_up:
+ start_object(msg);
+ }
+}
diff --git a/sys/dev/vinum/statetexts.h b/sys/modules/vinum/statetexts.h
index 1388400b46eea..b7ce4eb54bef1 100644
--- a/sys/dev/vinum/statetexts.h
+++ b/sys/modules/vinum/statetexts.h
@@ -33,9 +33,9 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
+ * $Id: COPYRIGHT,v 1.1 1998/03/05 06:07:05 grog Exp grog $
*/
-
-/* Created by ./makestatetext on Wed Jan 20 16:30:10 CST 1999. Do not edit */
+/* Created by ./makestatetext on Tue 4 Aug 15:53:16 CST 1998. Do not edit */
/* Drive state texts */
char *drivestatetext[] =
@@ -43,6 +43,7 @@ char *drivestatetext[] =
"unallocated",
"uninit",
"down",
+ "coming_up",
"up",
};
@@ -52,13 +53,12 @@ char *sdstatetext[] =
"unallocated",
"uninit",
"init",
- "empty",
"initializing",
+ "empty",
"obsolete",
"stale",
"crashed",
"down",
- "reviving",
"reborn",
"up",
};
@@ -70,6 +70,7 @@ char *plexstatetext[] =
"init",
"faulty",
"down",
+ "reviving",
"initializing",
"corrupt",
"degraded",
diff --git a/sys/dev/vinum/vinumutil.c b/sys/modules/vinum/util.c
index 22d8be8431dd2..512140438fc95 100644
--- a/sys/dev/vinum/vinumutil.c
+++ b/sys/modules/vinum/util.c
@@ -33,16 +33,13 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumutil.c,v 1.10 1999/01/02 00:39:04 grog Exp grog $
+ * $Id: util.c,v 1.7 1998/08/07 09:23:10 grog Exp grog $
*/
/* This file contains utility routines used both in kernel and user context */
-#ifdef KERNEL
-#include "opt_vinum.h"
-#endif
-#include <dev/vinum/vinumhdr.h>
-#include <dev/vinum/statetexts.h>
+#include "vinumhdr.h"
+#include "statetexts.h"
#ifndef REALLYKERNEL
#include <stdio.h>
extern jmp_buf command_fail; /* return on a failed command */
@@ -100,9 +97,6 @@ plex_org(enum plexorg org)
return "striped";
break;
- case plex_raid5: /* RAID5 plex */
- return "raid5";
- break;
default:
sprintf(numeric_state, "Invalid org %d", (int) org);
@@ -215,66 +209,3 @@ sizespec(char *spec)
/* NOTREACHED */
return -1;
}
-
-/* Extract the volume number from a device number.
- * Perform no checking. */
-int
-Volno(dev_t dev)
-{
- int x = (int) dev;
- return (x & MASK(VINUM_VOL_WIDTH)) >> VINUM_VOL_SHIFT;
-}
-
-/* Extract a plex number from a device number.
- * Don't check the major number, but check the
- * type. Return -1 for invalid types. */
-int
-Plexno(dev_t dev)
-{
- int x = (int) dev;
-
- switch (DEVTYPE(dev)) {
- case VINUM_VOLUME_TYPE:
- case VINUM_DRIVE_TYPE:
- case VINUM_SUPERDEV_TYPE:
- case VINUM_RAWSD_TYPE:
- return -1;
-
- case VINUM_PLEX_TYPE:
- case VINUM_SD_TYPE:
- return VOL[Volno(x)].plex[(x >> VINUM_PLEX_SHIFT) & (MASK(VINUM_PLEX_WIDTH))];
-
- case VINUM_RAWPLEX_TYPE:
- return ((x & MASK(VINUM_VOL_WIDTH)) >> VINUM_VOL_SHIFT) /* low order 8 bits */
- |((x >> VINUM_RAWPLEX_SHIFT)
- & (MASK(VINUM_RAWPLEX_WIDTH)
- << (VINUM_VOL_SHIFT + VINUM_VOL_WIDTH))); /* upper 12 bits */
- }
- return 0; /* compiler paranoia */
-}
-
-/* Extract a subdisk number from a device number.
- * Don't check the major number, but check the
- * type. Return -1 for invalid types. */
-int
-Sdno(dev_t dev)
-{
- int x = (int) dev;
-
- switch (DEVTYPE(dev)) {
- case VINUM_VOLUME_TYPE:
- case VINUM_DRIVE_TYPE:
- case VINUM_SUPERDEV_TYPE:
- case VINUM_PLEX_TYPE:
- case VINUM_RAWPLEX_TYPE:
- return -1;
-
- case VINUM_SD_TYPE:
- return PLEX[Plexno(x)].sdnos[(x >> VINUM_SD_SHIFT) & (MASK(VINUM_SD_WIDTH))];
-
- case VINUM_RAWSD_TYPE:
- return ((x & MASK(VINUM_VOL_WIDTH)) >> VINUM_VOL_SHIFT) /* low order 8 bits */
- |((x >> VINUM_RAWPLEX_SHIFT) & (MASK(VINUM_RAWPLEX_WIDTH) << (VINUM_VOL_SHIFT + VINUM_VOL_WIDTH))); /* upper 12 bits */
- }
- return -1; /* compiler paranoia */
-}
diff --git a/sys/dev/vinum/vinum.c b/sys/modules/vinum/vinum.c
index 5d0dad245559d..62c6b3fa7678d 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/modules/vinum/vinum.c
@@ -33,21 +33,31 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinum.c,v 1.23 1999/01/15 05:03:15 grog Exp grog $
+ * $Id: vinum.c,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
*/
#define STATIC /* nothing while we're testing XXX */
#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <sys/sysproto.h> /* for sync(2) */
-#ifdef VINUMDEBUG
+#include "vinumhdr.h"
+#include "sys/sysproto.h" /* for sync(2) */
+#ifdef DEBUG
#include <sys/reboot.h>
int debug = 0;
#endif
-#include <dev/vinum/request.h>
+/* pointer to ioctl p parameter, to save passing it around */
+struct proc *myproc;
+
+#if __FreeBSD__ < 3
+STATIC struct cdevsw vinum_cdevsw;
+STATIC struct bdevsw vinum_bdevsw =
+{
+ vinumopen, vinumclose, vinumstrategy, vinumioctl,
+ vinumdump, vinumsize, 0,
+ "vinum", &vinum_cdevsw, -1
+};
+#else /* goodbye, bdevsw */
STATIC struct cdevsw vinum_cdevsw =
{
vinumopen, vinumclose, vinumread, vinumwrite,
@@ -56,21 +66,21 @@ STATIC struct cdevsw vinum_cdevsw =
NULL, -1, vinumdump, vinumsize,
D_DISK, 0, -1
};
+#endif
/* Called by main() during pseudo-device attachment. */
STATIC void vinumattach(void *);
STATIC void vinumgetdisklabel(dev_t);
+void vinum_scandisk(void);
int vinum_inactive(void);
void free_vinum(int);
-#ifndef ACTUALLY_LKM_NOT_KERNEL
-STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
-#endif
-
+#if __FreeBSD__ >= 3
/* Why aren't these declared anywhere? XXX */
int setjmp(jmp_buf);
void longjmp(jmp_buf, int);
+#endif
extern jmp_buf command_fail; /* return here if config fails */
@@ -86,7 +96,8 @@ STATIC int vinum_devsw_installed = 0;
void
vinumattach(void *dummy)
{
- char *buf; /* pointer to temporary buffer */
+ BROKEN_GDB;
+ char *buf; /* pointer to temporary buffer */
struct _ioctl_reply *ioctl_reply; /* struct to return */
struct uio uio;
struct iovec iovec;
@@ -98,10 +109,13 @@ vinumattach(void *dummy)
printf("vinum: loaded\n");
vinum_conf.flags |= VF_LOADED; /* we're loaded now */
- daemonq = NULL; /* initialize daemon's work queue */
- dqend = NULL;
-
+ /* We don't have a p pointer here, so take it from curproc */
+ myproc = curproc;
+#if __FreeBSD__ < 3
+ bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vinum_bdevsw);
+#else
cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vinum_cdevsw);
+#endif
#ifdef DEVFS
#error DEVFS not finished yet
#endif
@@ -146,17 +160,19 @@ vinumattach(void *dummy)
ioctl_reply = NULL; /* no reply on longjmp */
}
+
/* Check if we have anything open. If so, return 0 (not inactive),
* otherwise 1 (inactive) */
int
vinum_inactive(void)
{
+ BROKEN_GDB;
int i;
int can_do = 1; /* assume we can do it */
lock_config();
for (i = 0; i < vinum_conf.volumes_used; i++) {
- if (VOL[i].opencount != 0) { /* volume is open */
+ if (VOL[i].pid != NULL) { /* volume is open */
can_do = 0;
break;
}
@@ -174,6 +190,7 @@ vinum_inactive(void)
void
free_vinum(int cleardrive)
{
+ BROKEN_GDB;
int i;
if (cleardrive) {
@@ -187,7 +204,6 @@ free_vinum(int cleardrive)
Free(DRIVE);
}
}
- queue_daemon_request(daemonrq_return, NULL); /* tell daemon to stop */
if (SD != NULL)
Free(SD);
if (PLEX != NULL) {
@@ -197,6 +213,10 @@ free_vinum(int cleardrive)
if (plex->state != plex_unallocated) { /* we have real data there */
if (plex->sdnos)
Free(plex->sdnos);
+ if (plex->unmapped_regions)
+ Free(plex->unmapped_region);
+ if (plex->defective_regions)
+ Free(plex->defective_region);
}
}
Free(PLEX);
@@ -204,23 +224,20 @@ free_vinum(int cleardrive)
if (VOL != NULL)
Free(VOL);
bzero(&vinum_conf, sizeof(vinum_conf));
- while ((daemon_options & daemon_stopped) == 0) /* daemon hasn't stopped yet, */
- tsleep(&vinum_daemon, PRIBIO, "vdaemn", 10 * hz); /* wait for it to stop */
- tsleep(&vinum_daemon, PRIBIO, "diedie", 3 * hz); /* and wait another 3 secs XXX */
}
#ifdef ACTUALLY_LKM_NOT_KERNEL /* stuff for LKMs */
-
MOD_MISC(vinum);
/*
* Function called when loading the driver.
*/
-
STATIC int
vinum_load(struct lkm_table *lkmtp, int cmd)
{
- vinumattach(NULL);
+ BROKEN_GDB;
+/* Debugger ("vinum_load"); */
+ vinumattach(NULL);
return 0; /* OK */
}
@@ -230,13 +247,24 @@ vinum_load(struct lkm_table *lkmtp, int cmd)
STATIC int
vinum_unload(struct lkm_table *lkmtp, int cmd)
{
- if (vinum_inactive()) { /* is anything open? */
+ BROKEN_GDB;
+ if (vinum_inactive()) { /* is anything open? */
struct sync_args dummyarg =
{0};
+#if __FreeBSD__ < 3
+ int retval;
+#endif
printf("vinum: unloaded\n");
+#if __FreeBSD__ < 3
+ sync(curproc, &dummyarg, &retval); /* write out buffers */
+#else
sync(curproc, &dummyarg); /* write out buffers */
+#endif
free_vinum(0); /* no: clean up */
+#if __FreeBSD__ < 3
+ bdevsw[BDEV_MAJOR] = NULL; /* clear bdevsw */
+#endif
cdevsw[CDEV_MAJOR] = NULL; /* and cdevsw */
return 0;
} else
@@ -249,7 +277,8 @@ vinum_unload(struct lkm_table *lkmtp, int cmd)
int
vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
{
- MOD_DISPATCH(vinum, /* module name */
+ BROKEN_GDB;
+ MOD_DISPATCH(vinum, /* module name */
lkmtp, /* LKM table */
cmd, /* command */
ver,
@@ -260,14 +289,16 @@ vinum_mod(struct lkm_table *lkmtp, int cmd, int ver)
#else /* not LKM */
-STATIC int
+STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
+STATIC int
vinum_modevent(module_t mod, modeventtype_t type, void *unused)
{
- struct sync_args dummyarg =
- {0};
+ struct sync_args dummyarg = {0};
+ BROKEN_GDB;
switch (type) {
case MOD_LOAD:
+ /* Debugger ("vinum_load"); */
vinumattach(NULL);
return 0; /* OK */
case MOD_UNLOAD:
@@ -283,8 +314,7 @@ vinum_modevent(module_t mod, modeventtype_t type, void *unused)
return 0;
}
-moduledata_t vinum_mod =
-{
+moduledata_t vinum_mod = {
"vinum",
vinum_modevent,
0
@@ -305,6 +335,7 @@ vinumopen(dev_t dev,
int fmt,
struct proc *p)
{
+ BROKEN_GDB;
int s; /* spl */
int error;
unsigned int index;
@@ -319,7 +350,7 @@ vinumopen(dev_t dev,
/* First, decide what we're looking at */
switch (device->type) {
case VINUM_VOLUME_TYPE:
- index = Volno(dev);
+ index = VOLNO(dev);
if (index >= vinum_conf.volumes_used)
return ENXIO; /* no such device */
vol = &VOL[index];
@@ -330,8 +361,14 @@ vinumopen(dev_t dev,
return ENXIO;
case volume_up:
- vol->opencount = 1;
+ s = splhigh(); /* quick lock */
+ if (error)
+ return error;
+ if (vol->opencount == 0)
+ vol->openflags = flags; /* set our flags */
+ vol->opencount++;
vol->pid = p->p_pid; /* and say who we are (do we need this? XXX) */
+ splx(s);
return 0;
case volume_down:
@@ -342,9 +379,9 @@ vinumopen(dev_t dev,
}
case VINUM_PLEX_TYPE:
- if (Volno(dev) >= vinum_conf.volumes_used)
+ if (VOLNO(dev) >= vinum_conf.volumes_used)
return ENXIO;
- index = Plexno(dev); /* get plex index in vinum_conf */
+ index = PLEXNO(dev); /* get plex index in vinum_conf */
if (index >= vinum_conf.plexes_used)
return ENXIO; /* no such device */
plex = &PLEX[index];
@@ -366,10 +403,10 @@ vinumopen(dev_t dev,
}
case VINUM_SD_TYPE:
- if ((Volno(dev) >= vinum_conf.volumes_used) || /* no such volume */
- (Plexno(dev) >= vinum_conf.plexes_used)) /* or no such plex */
+ if ((VOLNO(dev) >= vinum_conf.volumes_used) || /* no such volume */
+ (PLEXNO(dev) >= vinum_conf.plexes_used)) /* or no such plex */
return ENXIO; /* no such device */
- index = Sdno(dev); /* get the subdisk number */
+ index = SDNO(dev); /* get the subdisk number */
if (index >= vinum_conf.subdisks_used)
return ENXIO; /* no such device */
sd = &SD[index];
@@ -399,7 +436,7 @@ vinumopen(dev_t dev,
case VINUM_SUPERDEV_TYPE:
if (p->p_ucred->cr_uid == 0) { /* root calling, */
- vinum_conf.opencount = 1; /* we're open */
+ vinum_conf.opencount++; /* one more opener */
return 0; /* no worries opening super dev */
} else
return EPERM; /* you can't do that! */
@@ -413,13 +450,14 @@ vinumclose(dev_t dev,
int fmt,
struct proc *p)
{
+ BROKEN_GDB;
unsigned int index;
struct volume *vol;
struct plex *plex;
struct sd *sd;
struct devcode *device = (struct devcode *) &dev;
- index = Volno(dev);
+ index = VOLNO(dev);
/* First, decide what we're looking at */
switch (device->type) {
case VINUM_VOLUME_TYPE:
@@ -445,9 +483,9 @@ vinumclose(dev_t dev,
}
case VINUM_PLEX_TYPE:
- if (Volno(dev) >= vinum_conf.volumes_used)
+ if (VOLNO(dev) >= vinum_conf.volumes_used)
return ENXIO;
- index = Plexno(dev); /* get plex index in vinum_conf */
+ index = PLEXNO(dev); /* get plex index in vinum_conf */
if (index >= vinum_conf.plexes_used)
return ENXIO; /* no such device */
plex = &PLEX[index];
@@ -455,10 +493,10 @@ vinumclose(dev_t dev,
return 0;
case VINUM_SD_TYPE:
- if ((Volno(dev) >= vinum_conf.volumes_used) || /* no such volume */
- (Plexno(dev) >= vinum_conf.plexes_used)) /* or no such plex */
+ if ((VOLNO(dev) >= vinum_conf.volumes_used) || /* no such volume */
+ (PLEXNO(dev) >= vinum_conf.plexes_used)) /* or no such plex */
return ENXIO; /* no such device */
- index = Sdno(dev); /* get the subdisk number */
+ index = SDNO(dev); /* get the subdisk number */
if (index >= vinum_conf.subdisks_used)
return ENXIO; /* no such device */
sd = &SD[index];
@@ -467,7 +505,7 @@ vinumclose(dev_t dev,
case VINUM_SUPERDEV_TYPE:
if (p->p_ucred->cr_uid == 0) /* root calling, */
- vinum_conf.opencount = 0; /* no longer open */
+ vinum_conf.opencount--; /* one less opener */
return 0; /* no worries closing super dev */
case VINUM_DRIVE_TYPE:
@@ -480,16 +518,20 @@ vinumclose(dev_t dev,
int
vinumsize(dev_t dev)
{
+ BROKEN_GDB;
struct volume *vol;
int size;
- vol = &VOL[Volno(dev)];
+/* XXX This is bogus. We don't need to open
+ * a device to find its size */
+ vol = &VOL[VOLNO(dev)];
if (vol->state == volume_up)
size = vol->size;
else
return 0; /* err on the size of conservatism */
+
return size;
}
diff --git a/sys/dev/vinum/vinumext.h b/sys/modules/vinum/vinumext.h
index 40ffbbbd3eeb8..4b7d5a01d6421 100644
--- a/sys/dev/vinum/vinumext.h
+++ b/sys/modules/vinum/vinumext.h
@@ -33,14 +33,14 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumext.h,v 1.18 1999/01/15 02:41:16 grog Exp grog $
+ * $Id: vinumext.h,v 1.14 1998/08/11 00:03:57 grog Exp grog $
*/
/* vinumext.h: external definitions */
extern struct _vinum_conf vinum_conf; /* configuration information */
-#ifdef VINUMDEBUG
+#ifdef DEBUG
extern debug; /* debug flags */
#endif
@@ -58,9 +58,9 @@ struct proc;
#ifdef KERNEL
int give_sd_to_plex(int plexno, int sdno);
int give_plex_to_volume(int volno, int plexno);
-struct drive *check_drive(char *);
-enum drive_label_info read_drive_label(struct drive *, int);
-int parse_config(char *, struct keywordset *, int);
+int check_drive(char *);
+enum drive_label_info read_drive_label(struct drive *drive);
+int parse_config(char *, struct keywordset *);
int parse_user_config(char *cptr, struct keywordset *keyset);
u_int64_t sizespec(char *spec);
int volume_index(struct volume *volume);
@@ -81,18 +81,17 @@ int find_plex(const char *name, int create);
void free_plex(int plexno);
int get_empty_volume(void);
int find_volume(const char *name, int create);
-void config_subdisk(int);
-void config_plex(int);
-void config_volume(int);
-void config_drive(int);
+void config_subdisk(void);
+void config_plex(void);
+void config_volume(void);
+void config_drive(void);
void updateconfig(int);
void update_sd_config(int sdno, int kernelstate);
void update_plex_config(int plexno, int kernelstate);
void update_volume_config(int volno, int kernelstate);
void update_config(void);
void drive_io_done(struct buf *);
-void save_config(void);
-void daemon_save_config(void);
+int save_config(void);
void write_config(char *, int);
int start_config(void);
void finish_config(int);
@@ -103,17 +102,16 @@ void remove_plex_entry(int plexno, int force, int recurse);
void remove_volume_entry(int volno, int force, int recurse);
void checkernel(char *);
-int open_drive(struct drive *, struct proc *, int);
+int open_drive(struct drive *, struct proc *);
void close_drive(struct drive *drive);
-int driveio(struct drive *, char *, size_t, off_t, int);
+int driveio(struct drive *, void *, size_t, off_t, int);
/* #define read_drive(a, b, c, d) driveio (a, b, c, d, B_READ)
#define write_drive(a, b, c, d) driveio (a, b, c, d, B_WRITE) */
int set_drive_parms(struct drive *drive);
-int init_drive(struct drive *, int);
+int init_drive(struct drive *);
/* void throw_rude_remark (int, struct _ioctl_reply *, char *, ...); XXX */
void throw_rude_remark(int, char *,...);
-/* XXX die die */
int read_drive(struct drive *drive, void *buf, size_t length, off_t offset);
int write_drive(struct drive *drive, void *buf, size_t length, off_t offset);
void format_config(char *config, int len);
@@ -122,8 +120,6 @@ void free_drive(struct drive *drive);
void down_drive(struct drive *drive);
void remove_drive(int driveno);
-void vinum_scandisk(char *drivename[], int drives);
-
/* I/O */
d_open_t vinumopen;
d_close_t vinumclose;
@@ -136,39 +132,29 @@ d_write_t vinumwrite;
int vinumstart(struct buf *bp, int reviveok);
int launch_requests(struct request *rq, int reviveok);
-void sdio(struct buf *bp);
/* XXX Do we need this? */
int vinumpart(dev_t);
-#ifdef VINUMDEBUG
-/* Memory allocation and request tracing */
+/* Memory allocation */
void vinum_meminfo(caddr_t data);
int vinum_mallocinfo(caddr_t data);
-int vinum_rqinfo(caddr_t data);
-#endif
void expand_table(void **, int, int);
+void add_defective_region(struct plex *plex, off_t offset, size_t length);
+void add_unmapped_region(struct plex *plex, off_t offset, size_t length);
+void rebuild_plex_unmappedlist(struct plex *plex);
struct request;
struct rqgroup *allocrqg(struct request *rq, int elements);
void deallocrqg(struct rqgroup *rqg);
-/* Device number decoding */
-int Volno(dev_t x);
-int Plexno(dev_t x);
-int Sdno(dev_t x);
-
/* State transitions */
-int set_drive_state(int driveno, enum drivestate state, enum setstateflags flags);
+int set_drive_state(int driveno, enum drivestate state, int force);
int set_sd_state(int sdno, enum sdstate state, enum setstateflags flags);
enum requeststatus checksdstate(struct sd *sd, struct request *rq, daddr_t diskaddr, daddr_t diskend);
int set_plex_state(int plexno, enum plexstate state, enum setstateflags flags);
int set_volume_state(int volumeno, enum volumestate state, enum setstateflags flags);
-void update_sd_state(int sdno);
-void update_plex_state(int plexno);
-void update_volume_state(int volno);
-void invalidate_subdisks(struct plex *, enum sdstate);
void get_volume_label(struct volume *vol, struct disklabel *lp);
int write_volume_label(int);
void start_object(struct vinum_ioctl_msg *);
@@ -179,11 +165,10 @@ int vinum_writedisklabel(struct volume *, struct disklabel *);
int initsd(int);
int restart_plex(int plexno);
-int revive_read(struct sd *sd);
-int revive_block(int sdno);
+int revive_block(int plexno);
/* Auxiliary functions */
-enum sdstates sdstatemap(struct plex *plex);
+enum sdstates sdstatemap(struct plex *plex, int *sddowncount);
enum volplexstate vpstate(struct plex *plex);
#endif
@@ -206,8 +191,6 @@ int tokenize(char *, char *[]);
void resetstats(struct vinum_ioctl_msg *msg);
/* Locking */
-int lockdrive(struct drive *drive);
-void unlockdrive(struct drive *drive);
int lockvol(struct volume *vol);
void unlockvol(struct volume *vol);
int lockplex(struct plex *plex);
@@ -217,10 +200,15 @@ void unlockrange(struct plex *plex, off_t first, off_t last);
int lock_config(void);
void unlock_config(void);
-/* Dæmon */
-
-void vinum_daemon(void);
-int vinum_finddaemon(void);
-int vinum_setdaemonopts(int);
-extern struct daemonq *daemonq; /* daemon's work queue */
-extern struct daemonq *dqend; /* and the end of the queue */
+#ifdef DEBUG
+#define expandrq(prq) \
+{ \
+ expand_table ((void **) &prq->rqe, \
+ prq->requests * sizeof (struct rqelement), \
+ (prq->requests + RQELTS) * sizeof (struct rqelement) ); \
+ bzero (&prq->rqe [prq->requests], RQELTS * sizeof (struct rqelement)); \
+ prq->rqcount += RQELTS; \
+ }
+#else
+void expandrq(struct plexrq *);
+#endif
diff --git a/sys/dev/vinum/vinumhdr.h b/sys/modules/vinum/vinumhdr.h
index c913665cc30ce..22a8561823965 100644
--- a/sys/dev/vinum/vinumhdr.h
+++ b/sys/modules/vinum/vinumhdr.h
@@ -36,7 +36,7 @@
*/
/* Header files used by all modules */
-/* $Id: vinumhdr.h,v 1.11 1998/12/30 05:11:15 grog Exp grog $ */
+/* $Id: vinumhdr.h,v 1.7 1998/08/07 04:41:18 grog Exp grog $ */
#ifdef KERNEL
#define REALLYKERNEL
@@ -72,32 +72,32 @@
#include <sys/fcntl.h>
#include <sys/vnode.h>
#include <sys/dkbad.h>
-#include <sys/queue.h>
-#ifdef KERNEL
-#include <machine/setjmp.h>
-#include <machine/stdarg.h>
-#else
#include <setjmp.h>
#include <stdarg.h>
-#endif
#include <vm/vm.h>
-#include <dev/vinum/vinumvar.h>
-#include <dev/vinum/vinumio.h>
-#include <dev/vinum/vinumkw.h>
-#include <dev/vinum/vinumext.h>
+#ifdef USES_VM
+/* XXX Do we need this? */
+#include <vm/vm_extern.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_object.h>
+#include <vm/vm_prot.h>
+/* #include <vm/vm_page.h> */
+#include <sys/vmmeter.h>
+/* #include <machine/pmap.h> */
+#include <machine/cputypes.h>
+#endif /* USES_VM */
+#include <vinumvar.h>
+#include <vinumio.h>
+#include "vinumkw.h"
+#include "vinumext.h"
#undef Free /* defined in some funny net stuff */
#ifdef REALLYKERNEL
-#ifdef VINUMDEBUG
#define Malloc(x) MMalloc ((x), __FILE__, __LINE__) /* show where we came from */
#define Free(x) FFree ((x), __FILE__, __LINE__) /* show where we came from */
caddr_t MMalloc (int size, char *, int);
void FFree (void *mem, char *, int);
#else
-#define Malloc(x) malloc((x), M_DEVBUF, M_WAITOK)
-#define Free(x) free((x), M_DEVBUF)
-#endif
-#else
#define Malloc(x) malloc ((x)) /* just the size */
#define Free(x) free ((x)) /* just the address */
#endif
diff --git a/sys/dev/vinum/vinumio.h b/sys/modules/vinum/vinumio.h
index fe1c09b096067..be79528a6db8b 100644
--- a/sys/dev/vinum/vinumio.h
+++ b/sys/modules/vinum/vinumio.h
@@ -33,15 +33,10 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumio.h,v 1.14 1999/01/18 05:00:30 grog Exp grog $
+ * $Id: vinumio.h,v 1.10 1998/08/10 05:46:19 grog Exp grog $
*/
-#ifdef VINUMDEBUG
-#define MAX_IOCTL_REPLY 4096
-#else
#define MAX_IOCTL_REPLY 256
-#endif
-
#define L 'F' /* ID letter of our ioctls */
/* VINUM_CREATE returns a buffer of this kind */
struct _ioctl_reply {
@@ -62,7 +57,7 @@ struct _ioctl_reply {
#define VINUM_SAVECONFIG _IOC(0, L, 72, 0) /* release locks, update, write config to disk */
#define VINUM_RESETCONFIG _IOC(0, L, 73, 0) /* trash config on disk */
#define VINUM_INIT _IOC(0, L, 74, 0) /* read config from disk */
-#ifdef VINUMDEBUG
+#ifdef DEBUG
struct debuginfo {
int changeit;
@@ -120,7 +115,8 @@ struct vinum_ioctl_msg {
#define VINUM_LABEL _IOC(IOC_IN | IOC_OUT, L, 81, MAX_IOCTL_REPLY) /* label a volume */
#define VINUM_INITSD _IOW(L, 82, int) /* initialize a subdisk */
#define VINUM_REMOVE _IOC(IOC_IN | IOC_OUT, L, 83, MAX_IOCTL_REPLY) /* remove an object */
-/* 84, 85 going begging */
+#define VINUM_GETUNMAPPED _IOWR(L, 84, struct plexregion) /* get unmapped element (plex, re) */
+#define VINUM_GETDEFECTIVE _IOWR(L, 85, struct plexregion) /* get defective element (plex, re) */
#define VINUM_RESETSTATS _IOC(IOC_IN | IOC_OUT, L, 86, MAX_IOCTL_REPLY) /* reset object stats */
#define VINUM_ATTACH _IOC(IOC_IN | IOC_OUT, L, 87, MAX_IOCTL_REPLY) /* reset object stats */
#define VINUM_DETACH _IOC(IOC_IN | IOC_OUT, L, 88, MAX_IOCTL_REPLY) /* reset object stats */
@@ -134,12 +130,3 @@ struct vinum_rename_msg {
#define VINUM_RENAME _IOC(IOC_IN | IOC_OUT, L, 89, MAX_IOCTL_REPLY) /* reset object stats */
#define VINUM_REPLACE _IOC(IOC_IN | IOC_OUT, L, 90, MAX_IOCTL_REPLY) /* reset object stats */
-
-#ifdef VINUMDEBUG
-#define VINUM_RQINFO _IOWR(L, 91, struct rqinfo) /* get request info [i] from trace buffer */
-#endif
-
-#define VINUM_DAEMON _IOC(0, L, 92, 0) /* perform the kernel part of Vinum daemon */
-#define VINUM_FINDDAEMON _IOC(0, L, 93, 0) /* check for presence of Vinum daemon */
-#define VINUM_SETDAEMON _IOW(L, 94, int) /* set daemon flags */
-#define VINUM_GETDAEMON _IOR(L, 95, int) /* get daemon flags */
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/modules/vinum/vinumioctl.c
index a2052b87c1d20..6dbe3c6bf4d61 100644
--- a/sys/dev/vinum/vinumioctl.c
+++ b/sys/modules/vinum/vinumioctl.c
@@ -35,25 +35,28 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumioctl.c,v 1.7 1999/01/18 03:36:17 grog Exp grog $
+ * $Id: vinumioctl.c,v 1.1 1998/08/14 08:46:10 grog Exp grog $
*/
#define STATIC /* nothing while we're testing XXX */
#define REALLYKERNEL
-#include "opt_vinum.h"
-#include <dev/vinum/vinumhdr.h>
-#include <sys/sysproto.h> /* for sync(2) */
-#ifdef VINUMDEBUG
+#include "vinumhdr.h"
+#include "sys/sysproto.h" /* for sync(2) */
+#ifdef DEBUG
#include <sys/reboot.h>
-#include <dev/vinum/request.h>
#endif
jmp_buf command_fail; /* return on a failed command */
+#if __FreeBSD__ >= 3
/* Why aren't these declared anywhere? XXX */
int setjmp(jmp_buf);
void longjmp(jmp_buf, int);
+#endif
+
+/* pointer to ioctl p parameter, to save passing it around */
+struct proc *myproc;
int vinum_inactive(void);
void free_vinum(int);
@@ -65,11 +68,16 @@ void replaceobject(struct vinum_ioctl_msg *);
/* ioctl routine */
int
vinumioctl(dev_t dev,
+#if __FreeBSD__ >= 3
u_long cmd,
+#else
+ int cmd,
+#endif
caddr_t data,
int flag,
struct proc *p)
{
+ BROKEN_GDB;
unsigned int objno;
int error = 0;
struct volume *vol;
@@ -83,26 +91,23 @@ vinumioctl(dev_t dev,
/* First, decide what we're looking at */
switch (device->type) {
case VINUM_SUPERDEV_TYPE:
+ myproc = p; /* save pointer to process */
ioctl_reply = (struct _ioctl_reply *) data; /* save the address to reply to */
error = setjmp(command_fail); /* come back here on error */
if (error) /* bombed out */
return 0; /* the reply will contain meaningful info */
switch (cmd) {
-#ifdef VINUMDEBUG
+ /* XXX #ifdef DEBUG */
case VINUM_DEBUG:
+ boothowto |= RB_GDB; /* serial debug line */
if (((struct debuginfo *) data)->changeit) /* change debug settings */
debug = (((struct debuginfo *) data)->param);
- else {
- if (debug & DEBUG_REMOTEGDB)
- boothowto |= RB_GDB; /* serial debug line */
- else
- boothowto &= ~RB_GDB; /* local ddb */
+ else
Debugger("vinum debug");
- }
ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
ioctl_reply->error = 0;
return 0;
-#endif
+ /* XXX #endif */
case VINUM_CREATE: /* create a vinum object */
error = lock_config(); /* get the config for us alone */
@@ -174,7 +179,7 @@ vinumioctl(dev_t dev,
case VINUM_SAVECONFIG:
if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
finish_config(1); /* finish the configuration and update it */
- save_config(); /* save configuration to disk */
+ error = save_config(); /* save configuration to disk */
} else
error = EINVAL; /* queue up for this one, please */
return error;
@@ -182,7 +187,7 @@ vinumioctl(dev_t dev,
case VINUM_RELEASECONFIG: /* release the config */
if (VFLAGS & VF_CONFIGURING) { /* must be us, the others are asleep */
finish_config(0); /* finish the configuration, don't change it */
- save_config(); /* save configuration to disk */
+ error = save_config(); /* save configuration to disk */
} else
error = EINVAL; /* release what config? */
return error;
@@ -210,7 +215,6 @@ vinumioctl(dev_t dev,
setstate((struct vinum_ioctl_msg *) data); /* set an object state */
return 0;
-#ifdef VINUMDEBUG
case VINUM_MEMINFO:
vinum_meminfo(data);
return 0;
@@ -218,10 +222,6 @@ vinumioctl(dev_t dev,
case VINUM_MALLOCINFO:
return vinum_mallocinfo(data);
- case VINUM_RQINFO:
- return vinum_rqinfo(data);
-#endif
-
case VINUM_LABEL: /* label a volume */
ioctl_reply->error = write_volume_label(*(int *) data); /* index of the volume to label */
ioctl_reply->msg[0] = '\0'; /* no message */
@@ -244,6 +244,32 @@ vinumioctl(dev_t dev,
sizeof(struct drive_freelist));
return 0;
+ case VINUM_GETDEFECTIVE: /* get a plex defective area element */
+ index = *(int *) data; /* get the plex index */
+ fe = ((int *) data)[1]; /* and the region number */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(PLEX[index].state == plex_unallocated))
+ return ENODEV;
+ if (fe >= PLEX[index].defective_regions) /* no such entry */
+ return ENOENT;
+ bcopy(&PLEX[index].defective_region[fe],
+ data,
+ sizeof(struct plexregion));
+ return 0;
+
+ case VINUM_GETUNMAPPED: /* get a plex unmapped area element */
+ index = *(int *) data; /* get the plex index */
+ fe = ((int *) data)[1]; /* and the region number */
+ if ((index >= (unsigned) vinum_conf.plexes_used) /* plex doesn't exist */
+ ||(PLEX[index].state == plex_unallocated))
+ return ENODEV;
+ if (fe >= PLEX[index].unmapped_regions) /* no such entry */
+ return ENOENT;
+ bcopy(&PLEX[index].unmapped_region[fe],
+ data,
+ sizeof(struct plexregion));
+ return 0;
+
case VINUM_RESETSTATS:
resetstats((struct vinum_ioctl_msg *) data); /* reset object stats */
return 0;
@@ -268,30 +294,30 @@ vinumioctl(dev_t dev,
replaceobject((struct vinum_ioctl_msg *) data);
return 0;
- case VINUM_DAEMON:
- vinum_daemon(); /* perform the daemon */
- return 0;
-
- case VINUM_FINDDAEMON: /* check for presence of daemon */
- return vinum_finddaemon();
- return 0;
-
- case VINUM_SETDAEMON: /* set daemon flags */
- return vinum_setdaemonopts(*(int *) data);
-
- case VINUM_GETDAEMON: /* get daemon flags */
- *(int *) data = daemon_options;
- return 0;
-
default:
/* FALLTHROUGH */
}
default:
- printf("vinumioctl: invalid ioctl from process %d (%s): %lx\n",
- curproc->p_pid,
- curproc->p_comm,
+#if __FreeBSD__>=3
+ printf("vinumioctl: type %d, sd %d, plex %d, major %x, volume %d, command %lx\n",
+ device->type,
+ device->sd,
+ device->plex,
+ device->major,
+ device->volume,
+ cmd); /* XXX */
+
+#else
+ printf("vinumioctl: type %d, sd %d, plex %d, major %x, volume %d, command %x\n",
+ device->type,
+ device->sd,
+ device->plex,
+ device->major,
+ device->volume,
cmd); /* XXX */
+
+#endif
return EINVAL;
case VINUM_DRIVE_TYPE:
@@ -299,7 +325,7 @@ vinumioctl(dev_t dev,
return EAGAIN; /* try again next week */
case VINUM_SD_TYPE:
- objno = Sdno(dev);
+ objno = SDNO(dev);
switch (cmd) {
case VINUM_INITSD: /* initialize subdisk */
@@ -311,7 +337,7 @@ vinumioctl(dev_t dev,
break;
case VINUM_VOLUME_TYPE:
- objno = Volno(dev);
+ objno = VOLNO(dev);
if ((unsigned) objno >= (unsigned) vinum_conf.volumes_used) /* not a valid volume */
return ENXIO;
@@ -486,7 +512,6 @@ void
attachobject(struct vinum_ioctl_msg *msg)
{
struct _ioctl_reply *reply = (struct _ioctl_reply *) msg;
- int sdno;
struct sd *sd;
struct plex *plex;
struct volume *vol;
@@ -517,10 +542,6 @@ attachobject(struct vinum_ioctl_msg *msg)
save_config();
reply->error = 0;
}
- if (sd->state == sd_reviving)
- reply->error = EAGAIN; /* need to revive it */
- else
- reply->error = 0;
break;
case plex_object:
@@ -540,16 +561,14 @@ attachobject(struct vinum_ioctl_msg *msg)
reply->msg[0] = '\0';
return;
}
- for (sdno = 0; sdno < plex->subdisks; sdno++) {
- sd = &SD[plex->sdnos[sdno]];
-
- if (sd->state > sd_down) /* real subdisk, vaguely accessible */
- set_sd_state(plex->sdnos[sdno], sd_stale, setstate_force); /* make it stale */
- }
- set_plex_state(plex->plexno, plex_up, setstate_none); /* update plex state */
+ set_plex_state(plex->plexno, plex_down, setstate_force); /* make sure it's down */
give_plex_to_volume(msg->otherobject, msg->index); /* and give it to the volume */
update_plex_config(plex->plexno, 0);
save_config();
+ if (plex->state == plex_reviving)
+ reply->error = EAGAIN; /* need to revive it */
+ else
+ reply->error = 0;
}
}
}
@@ -566,7 +585,7 @@ detachobject(struct vinum_ioctl_msg *msg)
int plexno;
switch (msg->type) {
- case drive_object: /* you can't detach a drive from anything */
+ case drive_object: /* you can't attach a drive to anything */
case volume_object: /* nor a volume */
case invalid_object: /* "this can't happen" */
reply->error = EINVAL;
@@ -606,6 +625,7 @@ detachobject(struct vinum_ioctl_msg *msg)
(plex->subdisks - 1 - sdno) * sizeof(int));
}
plex->subdisks--;
+ rebuild_plex_unmappedlist(plex); /* rebuild the unmapped list */
if (!bcmp(plex->name, sd->name, strlen(plex->name))) { /* this subdisk is named after the plex */
bcopy(sd->name,
&sd->name[3],
@@ -615,7 +635,7 @@ detachobject(struct vinum_ioctl_msg *msg)
}
update_plex_config(plex->plexno, 0);
if ((plex->organization == plex_striped) /* we've just mutilated our plex, */
- )
+ ||(plex->organization == plex_striped)) /* the data no longer matches */
set_plex_state(plex->plexno,
plex_down,
setstate_force | setstate_configuring);
diff --git a/sys/dev/vinum/vinumkw.h b/sys/modules/vinum/vinumkw.h
index 25dbced2fc282..1a81f37656f4a 100644
--- a/sys/dev/vinum/vinumkw.h
+++ b/sys/modules/vinum/vinumkw.h
@@ -33,13 +33,9 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumkw.h,v 1.11 1999/01/18 03:32:10 grog Exp grog $
+ * $Id: vinumkw.h,v 1.7 1998/08/07 02:35:51 grog Exp grog $
*/
-#ifdef KERNEL
-#include "opt_vinum.h"
-#endif
-
/* Command keywords that vinum knows. These include both user-level
* and kernel-level stuff */
@@ -60,10 +56,6 @@ enum keyword {
kw_rm,
kw_start,
kw_stop,
- kw_makedev, /* make /dev/vinum devices */
- kw_setdaemon, /* set daemon flags */
- kw_getdaemon, /* set daemon flags */
- kw_help,
kw_drive,
kw_sd,
kw_subdisk = kw_sd,
@@ -104,11 +96,10 @@ enum keyword {
kw_printconfig,
kw_replace,
kw_detached,
-#ifdef VINUMDEBUG
+#ifdef DEBUG
kw_debug, /* go into debugger */
-#endif
kw_info,
- kw_quit,
+#endif
kw_invalid_keyword = -1
};
diff --git a/sys/dev/vinum/vinumstate.h b/sys/modules/vinum/vinumstate.h
index 267626949069d..0b07590b2cf6e 100644
--- a/sys/dev/vinum/vinumstate.h
+++ b/sys/modules/vinum/vinumstate.h
@@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumstate.h,v 1.12 1998/12/30 01:31:52 grog Exp grog $
+ * $Id: vinumstate.h,v 1.11 1998/08/04 06:22:49 grog Exp grog $
*/
/* This file gets read by makestatetext to create text files
@@ -70,6 +70,11 @@ enum plexstate {
* administrator. */
plex_down,
+ /* A plex which is currently being brought up after
+ * being not up. This involves copying data from
+ * another plex */
+ plex_reviving,
+
/* A plex which is being initialized */
plex_initializing,
@@ -85,9 +90,12 @@ enum plexstate {
plex_firstup = plex_corrupt, /* first "up" state */
- /* A RAID-5 plex entry which is accessible, but one
- * subdisk is down, requiring recovery for many
- * I/O requests. */
+ /* A plex entry which is at least partially up. Not
+ * all subdisks are available, but so far no
+ * inconsistency has occurred (this will change with
+ * the first write to the address space occupied by
+ * a defective subdisk). A RAID 5 plex with one subdisk
+ * down will remain degraded even after a write */
plex_degraded,
/* A plex which is really up, but which has a reborn
@@ -118,39 +126,39 @@ enum sdstate {
*/
sd_init,
+ /* A subdisk entry which has been created completely and
+ * which is currently being initialized */
+ sd_initializing,
+
/* A subdisk entry which has been created completely.
* All fields are correct, and the disk has been
* updated, but there is no data on the disk.
*/
sd_empty,
- /* A subdisk entry which has been created completely and
- * which is currently being initialized */
- sd_initializing,
-
/* *** The following states represent invalid data */
/* A subdisk entry which has been created completely.
- * All fields are correct, the config on disk has been
- * updated, and the data was valid, but since then the
- * drive has been taken down, and as a result updates
- * have been missed.
+ * All fields are correct, the disk has been updated,
+ * and the data was valid, but since then the drive
+ * has gone down, and as a result updates have been
+ * missed.
*/
sd_obsolete,
/* A subdisk entry which has been created completely.
* All fields are correct, the disk has been updated,
* and the data was valid, but since then the drive
- * has been crashed and updates have been lost.
+ * has gone down, updates have been lost, and then
+ * the drive came up again.
*/
sd_stale,
/* *** The following states represent valid, inaccessible data */
-
/* A subdisk entry which has been created completely.
* All fields are correct, the disk has been updated,
* and the data was valid, but since then the drive
* has gone down. No attempt has been made to write
- * to the subdisk since the crash, so the data is valid.
+ * to the subdisk since the crash.
*/
sd_crashed,
@@ -159,11 +167,6 @@ enum sdstate {
* administrator. The data is valid. */
sd_down,
- /* *** This is invalid data (the subdisk previously had
- * a numerically lower state), but it is currently in the
- * process of being revived. We can write but not read. */
- sd_reviving,
-
/* *** The following states represent accessible subdisks
* with valid data */
@@ -177,7 +180,8 @@ enum sdstate {
* covers this address space in the plex, we set its
* state to sd_up under these circumstances, so this
* status implies that there is another subdisk to
- * fulfil the request. */
+ * fulfil the request.
+ */
sd_reborn,
/* A subdisk entry which has been created completely.
@@ -199,6 +203,9 @@ enum drivestate {
drive_down,
/* not accessible */
+ drive_coming_up,
+ /* in the process of being brought up */
+
drive_up,
/* up and running */
diff --git a/sys/dev/vinum/vinumvar.h b/sys/modules/vinum/vinumvar.h
index df579fad53662..ca54f76aad02e 100644
--- a/sys/dev/vinum/vinumvar.h
+++ b/sys/modules/vinum/vinumvar.h
@@ -33,15 +33,20 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumvar.h,v 1.18 1999/01/15 06:00:24 grog Exp grog $
+ * $Id: vinumvar.h,v 1.15 1998/08/14 06:36:41 grog Exp grog $
*/
+/* XXX gdb can't find our global pointers, so use this kludge to
+ * point to them locally. Remove after testing */
+#define BROKEN_GDB struct _vinum_conf *VC = &vinum_conf
+
#include <sys/time.h>
-#include <dev/vinum/vinumstate.h>
+#include "vinumstate.h"
/* Some configuration maxima. They're an enum because
* we can't define global constants. Sorry about that.
*
- * These aren't as bad as they look: most of them are soft limits.
+ * These aren't as bad as they look: most of them
+ * are soft limits. Only the MAXCONFIG parameter is set in stone
*/
enum constants {
@@ -61,8 +66,6 @@ enum constants {
VINUM_SD_TYPE = 2,
VINUM_DRIVE_TYPE = 3,
VINUM_SUPERDEV_TYPE = 4, /* super device. */
- VINUM_RAWPLEX_TYPE = 5, /* anonymous plex */
- VINUM_RAWSD_TYPE = 6, /* anonymous subdisk */
/* Shifts for the individual fields in the device */
VINUM_TYPE_SHIFT = 28,
@@ -72,22 +75,8 @@ enum constants {
VINUM_VOL_WIDTH = 8,
VINUM_PLEX_WIDTH = 3,
VINUM_SD_WIDTH = 8,
-
- /* Shifts for the second half of raw plex and
- * subdisk numbers */
- VINUM_RAWPLEX_SHIFT = 8, /* shift the second half this much */
- VINUM_RAWPLEX_WIDTH = 12, /* width of second half */
-
MAJORDEV_SHIFT = 8,
- MAXPLEX = 8, /* maximum number of plexes in a volume */
- MAXSD = 256, /* maximum number of subdisks in a plex */
- MAXDRIVENAME = 32, /* maximum length of a device name */
- MAXSDNAME = 64, /* maximum length of a subdisk name */
- MAXPLEXNAME = 64, /* maximum length of a plex name */
- MAXVOLNAME = 64, /* maximum length of a volume name */
- MAXNAME = 64, /* maximum length of any name */
-
/* Create a block device number */
#define VINUMBDEV(v,p,s,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
@@ -96,16 +85,6 @@ enum constants {
| (s << VINUM_SD_SHIFT) \
| (t << VINUM_TYPE_SHIFT) )
-/* Create a bit mask for x bits */
-#define MASK(x) ((1 << (x)) - 1)
-
-/* Create a raw block device number */
-#define VINUMRBDEV(d,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
- | ((d & MASK (VINUM_VOL_WIDTH)) << VINUM_VOL_SHIFT) \
- | ((d & ~MASK (VINUM_VOL_WIDTH)) \
- << (VINUM_PLEX_SHIFT + VINUM_VOL_WIDTH)) \
- | (t << VINUM_TYPE_SHIFT) )
-
/* And a character device number */
#define VINUMCDEV(v,p,s,t) ((CDEV_MAJOR << MAJORDEV_SHIFT) \
| (v << VINUM_VOL_SHIFT) \
@@ -116,6 +95,18 @@ enum constants {
/* extract device type */
#define DEVTYPE(x) ((x >> VINUM_TYPE_SHIFT) & 7)
+/* extract volume number */
+#define VOLNO(x) (x & ((1 << VINUM_VOL_WIDTH) - 1))
+
+/* extract plex number */
+#define PLEXNO(x) (VOL [VOLNO (x)].plex [(x >> VINUM_PLEX_SHIFT) & ((1 << VINUM_PLEX_WIDTH) - 1)])
+
+/* extract subdisk number */
+#define SDNO(x) (PLEX [PLEXNO (x)].sdnos [(x >> VINUM_SD_SHIFT) & ((1 << VINUM_SD_WIDTH) - 1)])
+
+/* extract drive number */
+#define DRIVENO(x) (SD [SDNO (x)].driveno)
+
VINUM_SUPERDEV = VINUMBDEV(0, 0, 0, VINUM_SUPERDEV_TYPE), /* superdevice number */
/* the number of object entries to cater for initially, and also the
@@ -134,8 +125,7 @@ enum constants {
INITIAL_DRIVE_FREELIST = 16, /* number of entries in drive freelist */
PLEX_REGION_TABLE_SIZE = 8, /* number of entries in plex region tables */
INITIAL_LOCKS = 8, /* number of locks to allocate to a volume */
- DEFAULT_REVIVE_BLOCKSIZE = 65536, /* size of block to transfer in one op */
- VINUMHOSTNAMELEN = 32, /* host name field in label */
+ DEFAULT_REVIVE_BLOCKSIZE = 32768, /* size of block to transfer in one op */
};
/* device numbers */
@@ -147,15 +137,7 @@ enum constants {
* |-----------------------------------------------------------------------------------------------|
*
* 0x2 03 1 19 06
- *
- * The fields in the minor number are interpreted as follows:
- *
- * Volume: Only type and volume number are relevant
- * Plex in volume: type, plex number in volume and volume number are relevant
- * raw plex: type, plex number is made of bits 27-16 and 7-0
- * raw subdisk: type, subdisk number is made of bits 27-16 and 7-0
*/
-
struct devcode {
/* CARE. These fields assume a big-endian word. On a
* little-endian system, they're the wrong way around */
@@ -170,15 +152,19 @@ struct devcode {
VINUM_PLEX = 1,
VINUM_SUBDISK = 2,
VINUM_DRIVE = 3,
- VINUM_SUPERDEV = 4,
- VINUM_RAWPLEX = 5,
- VINUM_RAWSD = 6 */
+ VINUM_SUPERDEV = 4, */
unsigned signbit:1; /* to make 32 bits */
};
#define VINUM_DIR "/dev/vinum"
#define VINUM_RDIR "/dev/rvinum"
#define VINUM_SUPERDEV_NAME VINUM_DIR"/control"
+#define MAXDRIVENAME 32 /* maximum length of a device name */
+#define MAXSDNAME 64 /* maximum length of a subdisk name */
+#define MAXPLEXNAME 64 /* maximum length of a plex name */
+#define MAXVOLNAME 64 /* maximum length of a volume name */
+#define MAXNAME 64 /* maximum length of any name */
+#define MAXVOLPLEX 8 /* maximum number of plexes in a volume */
/* Flags for all objects. Most of them only apply to
* specific objects, but we have space for all in any
@@ -199,8 +185,6 @@ enum objflags {
VF_CONFIG_SETUPSTATE = 0x2000, /* set a volume up if all plexes are empty */
VF_READING_CONFIG = 0x4000, /* we're reading config database from disk */
VF_KERNELOP = 0x8000, /* we're performing ops from kernel space */
- VF_NEWBORN = 0x10000, /* for objects: we've just created it */
- VF_CONFIGURED = 0x20000, /* for drives: we read the config */
};
/* Global configuration information for the vinum subsystem */
@@ -225,11 +209,9 @@ struct _vinum_conf {
int flags;
int opencount; /* number of times we've been opened */
-#if VINUMDEBUG
+#if DEBUG
int lastrq;
struct buf *lastbuf;
- struct rqinfo **rqipp;
- struct rqinfo *rqinfop;
#endif
};
@@ -244,7 +226,7 @@ struct _vinum_conf {
* Vinum drives start with this structure:
*
- *\ Sector
+ * Sector
* |--------------------------------------|
* | PDP-11 memorial boot block | 0
* |--------------------------------------|
@@ -275,6 +257,7 @@ enum {
* multiple copies in vinum. We use the host name just
* to identify this system, and 32 bytes should be ample
* for that purpose */
+#define VINUMHOSTNAMELEN 32
struct vinum_label {
char sysname[VINUMHOSTNAMELEN]; /* system name at time of creation */
@@ -313,11 +296,9 @@ enum drive_label_info {
struct drive {
enum drivestate state; /* current state */
- int flags; /* flags */
int subdisks_allocated; /* number of entries in sd */
int subdisks_used; /* and the number used */
int blocksize; /* size of fs blocks */
- int pid; /* of locker */
u_int64_t sectors_available; /* number of sectors still available */
int secsperblock;
int lasterror; /* last error on drive */
@@ -345,31 +326,18 @@ struct drive {
struct sd {
enum sdstate state; /* state */
- int flags;
- int lasterror; /* last error occurred */
/* offsets in blocks */
int64_t driveoffset; /* offset on drive */
- /* plexoffset is the offset from the beginning of the
- * plex to the very first part of the subdisk, in
- * sectors. For striped and RAID-5 plexes, only
- * the first stripe is located at this offset */
int64_t plexoffset; /* offset in plex */
u_int64_t sectors; /* and length in sectors */
int plexno; /* index of plex, if it belongs */
int driveno; /* index of the drive on which it is located */
int sdno; /* our index in vinum_conf */
- int plexsdno; /* and our number in our plex
- * (undefined if no plex) */
int pid; /* pid of process which opened us */
u_int64_t reads; /* number of reads on this subdisk */
u_int64_t writes; /* number of writes on this subdisk */
u_int64_t bytes_read; /* number of bytes read */
u_int64_t bytes_written; /* number of bytes written */
- /* revive parameters */
- u_int64_t revived; /* block number of current revive request */
- int revive_blocksize; /* revive block size (bytes) */
- int revive_interval; /* and time to wait between transfers */
- struct request *waitlist; /* list of requests waiting on revive op */
char name[MAXSDNAME]; /* name of subdisk */
};
@@ -383,10 +351,16 @@ enum plexorg {
plex_raid5 /* RAID5 plex */
};
+/* Region in plex (either defective or unmapped) */
+struct plexregion {
+ u_int64_t offset; /* start of region */
+ u_int64_t length; /* length */
+};
+
struct plex {
enum plexorg organization; /* Plex organization */
enum plexstate state; /* and current state */
- u_int64_t length; /* total length of plex (max offset, in blocks) */
+ u_int64_t length; /* total length of plex (max offset) */
int flags;
int stripesize; /* size of stripe or raid band, in sectors */
int subdisks; /* number of associated subdisks */
@@ -407,12 +381,25 @@ struct plex {
u_int64_t bytes_written; /* number of bytes written */
u_int64_t multiblock; /* requests that needed more than one block */
u_int64_t multistripe; /* requests that needed more than one stripe */
- int sddowncount; /* number of subdisks down */
+ /* revive parameters */
+ u_int64_t revived; /* block number of current revive request */
+ int revive_blocksize; /* revive block size (bytes) */
+ int revive_interval; /* and time to wait between transfers */
+ struct request *waitlist; /* list of requests waiting on revive op */
+ /* geometry control */
+ int defective_regions; /* number of regions which are defective */
+ int defective_region_count; /* number of entries in defective_region */
+ struct plexregion *defective_region; /* list of offset/length pairs: defective sds */
+ int unmapped_regions; /* number of regions which are missing */
+ int unmapped_region_count; /* number of entries in unmapped_region */
+ struct plexregion *unmapped_region; /* list of offset/length pairs: missing sds */
char name[MAXPLEXNAME]; /* name of plex */
};
/*** Volume definitions ***/
+#define MAXPLEX 8 /* maximum number of plexes */
+
struct volume {
enum volumestate state; /* current state */
@@ -512,17 +499,12 @@ enum setstateflags {
setstate_none = 0, /* no flags */
setstate_force = 1, /* force the state change */
setstate_configuring = 2, /* we're currently configuring, don't save */
+ setstate_recursing = 4, /* we're called from another setstate function */
+ setstate_norecurse = 8 /* don't call other setstate functions */
};
-#ifdef VINUMDEBUG
+#ifdef DEBUG
/* Debugging stuff */
-enum debugflags {
- DEBUG_ADDRESSES = 1, /* show buffer information during requests */
- DEBUG_NUMOUTPUT = 2, /* show the value of vp->v_numoutput */
- DEBUG_RESID = 4, /* go into debugger in complete_rqe */
- DEBUG_LASTREQS = 8, /* keep a circular buffer of last requests */
- DEBUG_REVIVECONFLICT = 16, /* print info about revive conflicts */
- DEBUG_REMOTEGDB = 256, /* go into remote gdb */
-};
-
+#define DEBUG_ADDRESSES 1
+#define DEBUG_NUMOUTPUT 2
#endif
diff --git a/sys/modules/wcd/Makefile b/sys/modules/wcd/Makefile
new file mode 100644
index 0000000000000..9f1dfb102cf7d
--- /dev/null
+++ b/sys/modules/wcd/Makefile
@@ -0,0 +1,29 @@
+# $Id: Makefile,v 1.11 1998/02/25 01:40:55 bde Exp $
+
+.PATH: ${.CURDIR}/../../i386/isa
+KMOD = wcd
+SRCS = wcd.c wdc.h wcd.h opt_atapi.h opt_devfs.h
+NOMAN =
+CFLAGS += -DWCD_MODULE
+CLEANFILES += wdc.h wcd.h opt_atapi.h opt_devfs.h
+
+load: ${PROG}
+ ${MODLOAD} -u -e wcd $(PROG)
+
+unload: ${PROG}
+ ${MODUNLOAD} -n wcd
+
+wdc.h:
+ echo "#define NWDC 2" > wdc.h
+ echo "#define NWD 4" >> wdc.h
+
+wcd.h:
+ echo "#define NWCD 1" > wcd.h
+
+opt_atapi.h:
+ echo "#define ATAPI 1"> opt_atapi.h
+
+opt_devfs.h:
+ touch opt_devfs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h
index ba2ef8c65dab1..16220e54f4ef2 100644
--- a/sys/msdosfs/denode.h
+++ b/sys/msdosfs/denode.h
@@ -1,4 +1,4 @@
-/* $Id: denode.h,v 1.17 1998/11/21 00:20:24 dt Exp $ */
+/* $Id: denode.h,v 1.15 1998/02/18 09:28:26 jkh Exp $ */
/* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */
/*-
@@ -150,7 +150,6 @@ struct denode {
struct msdosfsmount *de_pmp; /* addr of our mount struct */
u_char de_Name[12]; /* name, from DOS directory entry */
u_char de_Attributes; /* attributes, from directory entry */
- u_char de_LowerCase; /* NT VFAT lower case flags */
u_char de_CHun; /* Hundredth of second of CTime*/
u_short de_CTime; /* creation time */
u_short de_CDate; /* creation date */
@@ -183,7 +182,6 @@ struct denode {
#define DE_INTERNALIZE(dep, dp) \
(bcopy((dp)->deName, (dep)->de_Name, 11), \
(dep)->de_Attributes = (dp)->deAttributes, \
- (dep)->de_LowerCase = (dp)->deLowerCase, \
(dep)->de_CHun = (dp)->deCHundredth, \
(dep)->de_CTime = getushort((dp)->deCTime), \
(dep)->de_CDate = getushort((dp)->deCDate), \
@@ -194,10 +192,12 @@ struct denode {
(dep)->de_FileSize = getulong((dp)->deFileSize), \
(FAT32((dep)->de_pmp) ? DE_INTERNALIZE32((dep), (dp)) : 0))
+#define DE_EXTERNALIZE32(dp, dep) \
+ putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)
#define DE_EXTERNALIZE(dp, dep) \
(bcopy((dep)->de_Name, (dp)->deName, 11), \
+ bzero((dp)->deReserved, 10), \
(dp)->deAttributes = (dep)->de_Attributes, \
- (dp)->deLowerCase = (dep)->de_LowerCase, \
(dp)->deCHundredth = (dep)->de_CHun, \
putushort((dp)->deCTime, (dep)->de_CTime), \
putushort((dp)->deCDate, (dep)->de_CDate), \
@@ -207,7 +207,7 @@ struct denode {
putushort((dp)->deStartCluster, (dep)->de_StartCluster), \
putulong((dp)->deFileSize, \
((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
- putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16))
+ (FAT32((dep)->de_pmp) ? DE_EXTERNALIZE32((dp), (dep)) : 0))
#define de_forw de_chain[0]
#define de_back de_chain[1]
@@ -217,33 +217,21 @@ struct denode {
#define VTODE(vp) ((struct denode *)(vp)->v_data)
#define DETOV(de) ((de)->de_vnode)
-#define DETIMES(dep, acc, mod, cre) do { \
- if ((dep)->de_flag & DE_UPDATE) { \
- (dep)->de_flag |= DE_MODIFIED; \
- unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, \
- NULL); \
- (dep)->de_Attributes |= ATTR_ARCHIVE; \
- } \
- if ((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95) { \
- (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
- break; \
- } \
- if ((dep)->de_flag & DE_ACCESS) { \
- u_int16_t adate; \
- \
- unix2dostime((acc), &adate, NULL, NULL); \
- if (adate != (dep)->de_ADate) { \
- (dep)->de_flag |= DE_MODIFIED; \
- (dep)->de_ADate = adate; \
- } \
- } \
- if ((dep)->de_flag & DE_CREATE) { \
- unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, \
- &(dep)->de_CHun); \
- (dep)->de_flag |= DE_MODIFIED; \
- } \
- (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
-} while (0);
+#define DETIMES(dep, acc, mod, cre) \
+ if ((dep)->de_flag & (DE_UPDATE | DE_CREATE | DE_ACCESS)) { \
+ (dep)->de_flag |= DE_MODIFIED; \
+ if ((dep)->de_flag & DE_UPDATE) { \
+ unix2dostime((mod), &(dep)->de_MDate, &(dep)->de_MTime, NULL); \
+ (dep)->de_Attributes |= ATTR_ARCHIVE; \
+ } \
+ if (!((dep)->de_pmp->pm_flags & MSDOSFSMNT_NOWIN95)) { \
+ if ((dep)->de_flag & DE_ACCESS) \
+ unix2dostime((acc), &(dep)->de_ADate, NULL, NULL); \
+ if ((dep)->de_flag & DE_CREATE) \
+ unix2dostime((cre), &(dep)->de_CDate, &(dep)->de_CTime, &(dep)->de_CHun); \
+ } \
+ (dep)->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS); \
+ }
/*
* This overlays the fid structure (see mount.h)
diff --git a/sys/msdosfs/direntry.h b/sys/msdosfs/direntry.h
index 796fe78131c8e..c0db68c469333 100644
--- a/sys/msdosfs/direntry.h
+++ b/sys/msdosfs/direntry.h
@@ -1,4 +1,4 @@
-/* $Id: direntry.h,v 1.12 1998/02/26 06:45:42 msmith Exp $ */
+/* $Id: direntry.h,v 1.11 1998/02/24 14:13:08 ache Exp $ */
/* $NetBSD: direntry.h,v 1.14 1997/11/17 15:36:32 ws Exp $ */
/*-
@@ -65,9 +65,7 @@ struct direntry {
#define ATTR_VOLUME 0x08 /* entry is a volume label */
#define ATTR_DIRECTORY 0x10 /* entry is a directory name */
#define ATTR_ARCHIVE 0x20 /* file is new or modified */
- u_int8_t deLowerCase; /* NT VFAT lower case flags */
-#define LCASE_BASE 0x08 /* filename base in lower case */
-#define LCASE_EXT 0x10 /* filename extension in lower case */
+ u_int8_t deReserved[1]; /* reserved */
u_int8_t deCHundredth; /* hundredth of seconds in CTime */
u_int8_t deCTime[2]; /* create time */
u_int8_t deCDate[2]; /* create date */
diff --git a/sys/msdosfs/msdosfs_conv.c b/sys/msdosfs/msdosfs_conv.c
index 2c792ebf89bbb..6c39544cc5ae1 100644
--- a/sys/msdosfs/msdosfs_conv.c
+++ b/sys/msdosfs/msdosfs_conv.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_conv.c,v 1.27 1998/05/17 21:18:08 dt Exp $ */
+/* $Id: msdosfs_conv.c,v 1.26 1998/04/15 17:46:37 bde Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */
/*-
@@ -418,7 +418,7 @@ dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
else
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
- *un++ = (lower & LCASE_BASE) ? (ul_loaded && (c & 0x80) ?
+ *un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
dn++;
@@ -429,7 +429,7 @@ dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
- *un++ = (lower & LCASE_BASE) ? (ul_loaded && (c & 0x80) ?
+ *un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
@@ -446,7 +446,7 @@ dos2unixfn(dn, un, lower, d2u_loaded, d2u, ul_loaded, ul)
c = d2u_loaded && (*dn & 0x80) ? d2u[*dn & 0x7f] :
dos2unix[*dn];
dn++;
- *un++ = (lower & LCASE_EXT) ? (ul_loaded && (c & 0x80) ?
+ *un++ = lower ? (ul_loaded && (c & 0x80) ?
ul[c & 0x7f] : u2l[c]) : c;
thislong++;
}
diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c
index 74be5c4695a55..63b878ab5a818 100644
--- a/sys/msdosfs/msdosfs_denode.c
+++ b/sys/msdosfs/msdosfs_denode.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_denode.c,v 1.43 1998/12/07 21:58:34 archie Exp $ */
+/* $Id: msdosfs_denode.c,v 1.38 1998/05/17 18:09:28 bde Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.28 1998/02/10 14:10:00 mrg Exp $ */
/*-
@@ -50,7 +50,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/malloc.h>
#include <sys/proc.h>
@@ -72,9 +71,7 @@ static struct denode **dehashtbl;
static u_long dehash; /* size of hash table - 1 */
#define DEHASH(dev, dcl, doff) (dehashtbl[((dev) + (dcl) + (doff) / \
sizeof(struct direntry)) & dehash])
-#ifndef NULL_SIMPLELOCKS
static struct simplelock dehash_slock;
-#endif
union _qcvt {
quad_t qcvt;
@@ -293,7 +290,6 @@ deget(pmp, dirclust, diroffset, depp)
nvp->v_flag |= VROOT; /* should be further down XXX */
ldep->de_Attributes = ATTR_DIRECTORY;
- ldep->de_LowerCase = 0;
if (FAT32(pmp))
ldep->de_StartCluster = pmp->pm_rootdirblk;
/* de_FileSize will be filled in further down */
@@ -412,6 +408,7 @@ detrunc(dep, length, flags, cred, p)
{
int error;
int allerror;
+ int vflags;
u_long eofentry;
u_long chaintofree;
daddr_t bn;
@@ -419,6 +416,7 @@ detrunc(dep, length, flags, cred, p)
int isadir = dep->de_Attributes & ATTR_DIRECTORY;
struct buf *bp;
struct msdosfsmount *pmp = dep->de_pmp;
+ struct timespec ts;
#ifdef MSDOSFS_DEBUG
printf("detrunc(): file %s, length %lu, flags %x\n", dep->de_Name, length, flags);
@@ -509,14 +507,10 @@ detrunc(dep, length, flags, cred, p)
dep->de_FileSize = length;
if (!isadir)
dep->de_flag |= DE_UPDATE|DE_MODIFIED;
- allerror = vtruncbuf(DETOV(dep), cred, p, length, pmp->pm_bpcluster);
-#ifdef MSDOSFS_DEBUG
- if (allerror)
- printf("detrunc(): vtruncbuf error %d\n", allerror);
-#endif
- error = deupdat(dep, 1);
- if (error && (allerror == 0))
- allerror = error;
+ vflags = (length > 0 ? V_SAVE : 0) | V_SAVEMETA;
+ vinvalbuf(DETOV(dep), vflags, cred, p, 0, 0);
+ vnode_pager_setsize(DETOV(dep), length);
+ allerror = deupdat(dep, 1);
#ifdef MSDOSFS_DEBUG
printf("detrunc(): allerror %d, eofentry %lu\n",
allerror, eofentry);
@@ -561,6 +555,7 @@ deextend(dep, length, cred)
struct msdosfsmount *pmp = dep->de_pmp;
u_long count;
int error;
+ struct timespec ts;
/*
* The root of a DOS filesystem cannot be extended.
@@ -666,6 +661,7 @@ msdosfs_inactive(ap)
struct denode *dep = VTODE(vp);
struct proc *p = ap->a_p;
int error = 0;
+ struct timespec ts;
#ifdef MSDOSFS_DEBUG
printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]);
diff --git a/sys/msdosfs/msdosfs_lookup.c b/sys/msdosfs/msdosfs_lookup.c
index 87de1f23eba37..4827201100b72 100644
--- a/sys/msdosfs/msdosfs_lookup.c
+++ b/sys/msdosfs/msdosfs_lookup.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_lookup.c,v 1.27 1998/12/07 21:58:35 archie Exp $ */
+/* $Id: msdosfs_lookup.c,v 1.25 1998/05/18 10:24:26 dt Exp $ */
/* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */
/*-
@@ -61,6 +61,9 @@
#include <msdosfs/msdosfsmount.h>
#include <msdosfs/fat.h>
+static int markdeleted __P((struct msdosfsmount *pmp, u_long dirclust,
+ u_long diroffset));
+
/*
* When we search a directory the blocks containing directory entries are
* read and examined. The directory entries contain information that would
@@ -106,6 +109,7 @@ msdosfs_lookup(ap)
struct msdosfsmount *pmp;
struct buf *bp = 0;
struct direntry *dep = NULL;
+ struct ucred *cred = cnp->cn_cred;
u_char dosfilename[12];
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
@@ -1040,22 +1044,21 @@ findwin95(dep)
{
struct msdosfsmount *pmp = dep->de_pmp;
struct direntry *dentp;
- int blsize, win95;
+ int blsize;
u_long cn;
daddr_t bn;
struct buf *bp;
- win95 = 1;
/*
* Read through the directory looking for Win'95 entries
* Note: Error currently handled just as EOF XXX
*/
for (cn = 0;; cn++) {
if (pcbmap(dep, cn, &bn, 0, &blsize))
- return (win95);
+ return 0;
if (bread(pmp->pm_devvp, bn, blsize, NOCRED, &bp)) {
brelse(bp);
- return (win95);
+ return 0;
}
for (dentp = (struct direntry *)bp->b_data;
(char *)dentp < bp->b_data + blsize;
@@ -1065,7 +1068,7 @@ findwin95(dep)
* Last used entry and not found
*/
brelse(bp);
- return (win95);
+ return 0;
}
if (dentp->deName[0] == SLOT_DELETED) {
/*
@@ -1078,7 +1081,6 @@ findwin95(dep)
brelse(bp);
return 1;
}
- win95 = 0;
}
brelse(bp);
}
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index b3a63b55d6135..42798d765e7b2 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vfsops.c,v 1.38 1998/10/31 15:31:24 peter Exp $ */
+/* $Id: msdosfs_vfsops.c,v 1.35 1998/05/06 05:29:38 msmith Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */
/*-
@@ -50,7 +50,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/conf.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/kernel.h>
@@ -298,8 +297,7 @@ msdosfs_mount(mp, path, data, ndp, p)
vrele(devvp);
return (ENOTBLK);
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
vrele(devvp);
return (ENXIO);
}
@@ -365,7 +363,6 @@ mountmsdosfs(devvp, mp, p, argp)
dev_t dev = devvp->v_rdev;
#ifndef __FreeBSD__
struct partinfo dpart;
- int bsize = 0, dtype = 0, tmp;
#endif
union bootsector *bsp;
struct byte_bpb33 *b33;
@@ -373,6 +370,7 @@ mountmsdosfs(devvp, mp, p, argp)
struct byte_bpb710 *b710;
u_int8_t SecPerClust;
int ronly, error;
+ int bsize = 0, dtype = 0, tmp;
/*
* Disallow multiple mounts of the same device.
@@ -797,8 +795,8 @@ msdosfs_unmount(mp, mntflags, p)
vp->v_freelist.tqe_next, vp->v_freelist.tqe_prev,
vp->v_mount);
printf("cleanblkhd %p, dirtyblkhd %p, numoutput %ld, type %d\n",
- TAILQ_FIRST(&vp->v_cleanblkhd),
- TAILQ_FIRST(&vp->v_dirtyblkhd),
+ vp->v_cleanblkhd.lh_first,
+ vp->v_dirtyblkhd.lh_first,
vp->v_numoutput, vp->v_type);
printf("union %p, tag %d, data[0] %08x, data[1] %08x\n",
vp->v_socket, vp->v_tag,
@@ -913,7 +911,8 @@ loop:
if (vp->v_type == VNON ||
(dep->de_flag &
(DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 &&
- (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) {
+ (vp->v_dirtyblkhd.lh_first == NULL ||
+ waitfor == MNT_LAZY)) {
simple_unlock(&vp->v_interlock);
continue;
}
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index aad4e6ba9f1ed..c8923601b85a0 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vnops.c,v 1.79 1998/11/29 22:38:57 dt Exp $ */
+/* $Id: msdosfs_vnops.c,v 1.75 1998/07/11 07:45:50 bde Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */
/*-
@@ -174,7 +174,6 @@ msdosfs_create(ap)
ndirent.de_Attributes = (ap->a_vap->va_mode & VWRITE) ?
ATTR_ARCHIVE : ATTR_ARCHIVE | ATTR_READONLY;
- ndirent.de_LowerCase = 0;
ndirent.de_StartCluster = 0;
ndirent.de_FileSize = 0;
ndirent.de_dev = pdep->de_dev;
@@ -329,6 +328,7 @@ msdosfs_getattr(ap)
struct proc *a_p;
} */ *ap;
{
+ u_int cn;
struct denode *dep = VTODE(ap->a_vp);
struct msdosfsmount *pmp = dep->de_pmp;
struct vattr *vap = ap->a_vap;
@@ -609,10 +609,10 @@ msdosfs_read(ap)
return (error);
}
error = uiomove(bp->b_data + on, (int) n, uio);
+ if (!isadir)
+ dep->de_flag |= DE_ACCESS;
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
- if (!isadir && !(vp->v_mount->mnt_flag & MNT_NOATIME))
- dep->de_flag |= DE_ACCESS;
return (error);
}
@@ -835,8 +835,8 @@ msdosfs_fsync(ap)
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -852,7 +852,7 @@ loop:
(void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "msdosfsn", 0);
}
#ifdef DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("msdosfs_fsync: dirty", vp);
goto loop;
}
@@ -1402,7 +1402,6 @@ msdosfs_mkdir(ap)
goto bad;
ndirent.de_Attributes = ATTR_DIRECTORY;
- ndirent.de_LowerCase = 0;
ndirent.de_StartCluster = newcluster;
ndirent.de_FileSize = 0;
ndirent.de_dev = pdep->de_dev;
@@ -1715,9 +1714,7 @@ msdosfs_readdir(ap)
if (chksum != winChksum(dentp->deName))
dirbuf.d_namlen = dos2unixfn(dentp->deName,
(u_char *)dirbuf.d_name,
- dentp->deLowerCase |
- ((pmp->pm_flags & MSDOSFSMNT_SHORTNAME) ?
- (LCASE_BASE | LCASE_EXT) : 0),
+ pmp->pm_flags & MSDOSFSMNT_SHORTNAME,
pmp->pm_flags & MSDOSFSMNT_U2WTABLE,
pmp->pm_d2u,
pmp->pm_flags & MSDOSFSMNT_ULTABLE,
@@ -1797,6 +1794,7 @@ msdosfs_bmap(ap)
} */ *ap;
{
struct denode *dep = VTODE(ap->a_vp);
+ struct msdosfsmount *pmp = dep->de_pmp;
if (ap->a_vpp != NULL)
*ap->a_vpp = dep->de_devvp;
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 001d797fed4af..f9a217b5e3343 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -37,7 +37,7 @@
*
* @(#)bpf.c 8.2 (Berkeley) 3/28/94
*
- * $Id: bpf.c,v 1.45 1998/11/11 10:04:09 truckman Exp $
+ * $Id: bpf.c,v 1.43 1998/10/04 23:04:48 alex Exp $
*/
#include "bpfilter.h"
@@ -61,7 +61,6 @@
#include <sys/filio.h>
#include <sys/sockio.h>
#include <sys/ttycom.h>
-#include <sys/filedesc.h>
#if defined(sparc) && BSD < 199103
#include <sys/stream.h>
@@ -380,7 +379,6 @@ bpfclose(dev, flags, fmt, p)
register struct bpf_d *d = &bpf_dtab[minor(dev)];
register int s;
- funsetown(d->bd_sigio);
s = splimp();
if (d->bd_bif)
bpf_detachd(d);
@@ -536,9 +534,14 @@ static inline void
bpf_wakeup(d)
register struct bpf_d *d;
{
+ struct proc *p;
+
wakeup((caddr_t)d);
- if (d->bd_async && d->bd_sig && d->bd_sigio)
- pgsigio(d->bd_sigio, d->bd_sig, 0);
+ if (d->bd_async && d->bd_sig)
+ if (d->bd_pgid > 0)
+ gsignal (d->bd_pgid, d->bd_sig);
+ else if (p = pfind (-d->bd_pgid))
+ psignal (p, d->bd_sig);
#if BSD >= 199103
selwakeup(&d->bd_sel);
@@ -831,22 +834,18 @@ bpfioctl(dev, cmd, addr, flags, p)
d->bd_async = *(int *)addr;
break;
- case FIOSETOWN:
- error = fsetown(*(int *)addr, &d->bd_sigio);
- break;
-
- case FIOGETOWN:
- *(int *)addr = fgetown(d->bd_sigio);
- break;
+/* N.B. ioctl (FIOSETOWN) and fcntl (F_SETOWN) both end up doing the
+ equivalent of a TIOCSPGRP and hence end up here. *However* TIOCSPGRP's arg
+ is a process group if it's positive and a process id if it's negative. This
+ is exactly the opposite of what the other two functions want! Therefore
+ there is code in ioctl and fcntl to negate the arg before calling here. */
- /* This is deprecated, FIOSETOWN should be used instead. */
- case TIOCSPGRP:
- error = fsetown(-(*(int *)addr), &d->bd_sigio);
+ case TIOCSPGRP: /* Process or group to send signals to */
+ d->bd_pgid = *(int *)addr;
break;
- /* This is deprecated, FIOGETOWN should be used instead. */
case TIOCGPGRP:
- *(int *)addr = -fgetown(d->bd_sigio);
+ *(int *)addr = d->bd_pgid;
break;
case BIOCSRSIG: /* Set receive signal */
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c
index a452448390341..63f78f8e889d7 100644
--- a/sys/net/bpf_filter.c
+++ b/sys/net/bpf_filter.c
@@ -37,7 +37,7 @@
*
* @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93
*
- * $Id: bpf_filter.c,v 1.11 1998/12/07 03:26:34 eivind Exp $
+ * $Id: bpf_filter.c,v 1.8 1997/02/22 09:40:57 peter Exp $
*/
#include <sys/param.h>
@@ -46,30 +46,27 @@
#include <netinet/in.h>
#endif
-#if defined(sparc) || defined(mips) || defined(ibm032) || defined(__alpha__)
+#if defined(sparc) || defined(mips) || defined(ibm032)
#define BPF_ALIGN
#endif
#ifndef BPF_ALIGN
-#define EXTRACT_SHORT(p) ((u_int16_t)ntohs(*(u_int16_t *)p))
-#define EXTRACT_LONG(p) (ntohl(*(u_int32_t *)p))
+#define EXTRACT_SHORT(p) ((u_short)ntohs(*(u_short *)p))
+#define EXTRACT_LONG(p) (ntohl(*(u_long *)p))
#else
#define EXTRACT_SHORT(p)\
- ((u_int16_t)\
- ((u_int16_t)*((u_char *)p+0)<<8|\
- (u_int16_t)*((u_char *)p+1)<<0))
+ ((u_short)\
+ ((u_short)*((u_char *)p+0)<<8|\
+ (u_short)*((u_char *)p+1)<<0))
#define EXTRACT_LONG(p)\
- ((u_int32_t)*((u_char *)p+0)<<24|\
- (u_int32_t)*((u_char *)p+1)<<16|\
- (u_int32_t)*((u_char *)p+2)<<8|\
- (u_int32_t)*((u_char *)p+3)<<0)
+ ((u_long)*((u_char *)p+0)<<24|\
+ (u_long)*((u_char *)p+1)<<16|\
+ (u_long)*((u_char *)p+2)<<8|\
+ (u_long)*((u_char *)p+3)<<0)
#endif
#ifdef KERNEL
#include <sys/mbuf.h>
-#endif
-#include <net/bpf.h>
-#ifdef KERNEL
#define MINDEX(m, k) \
{ \
register int len = m->m_len; \
@@ -83,16 +80,15 @@
} \
}
-static u_int16_t m_xhalf __P((struct mbuf *m, bpf_u_int32 k, int *err));
-static u_int32_t m_xword __P((struct mbuf *m, bpf_u_int32 k, int *err));
+static int m_xhalf __P((struct mbuf *m, int k, int *err));
+static int m_xword __P((struct mbuf *m, int k, int *err));
-static u_int32_t
+static int
m_xword(m, k, err)
register struct mbuf *m;
- register bpf_u_int32 k;
- register int *err;
+ register int k, *err;
{
- register size_t len;
+ register int len;
register u_char *cp, *np;
register struct mbuf *m0;
@@ -117,38 +113,27 @@ m_xword(m, k, err)
switch (len - k) {
case 1:
- return
- ((u_int32_t)cp[0] << 24) |
- ((u_int32_t)np[0] << 16) |
- ((u_int32_t)np[1] << 8) |
- (u_int32_t)np[2];
+ return (cp[0] << 24) | (np[0] << 16) | (np[1] << 8) | np[2];
case 2:
- return
- ((u_int32_t)cp[0] << 24) |
- ((u_int32_t)cp[1] << 16) |
- ((u_int32_t)np[0] << 8) |
- (u_int32_t)np[1];
+ return (cp[0] << 24) | (cp[1] << 16) | (np[0] << 8) |
+ np[1];
default:
- return
- ((u_int32_t)cp[0] << 24) |
- ((u_int32_t)cp[1] << 16) |
- ((u_int32_t)cp[2] << 8) |
- (u_int32_t)np[0];
+ return (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) |
+ np[0];
}
bad:
*err = 1;
return 0;
}
-static u_int16_t
+static int
m_xhalf(m, k, err)
register struct mbuf *m;
- register bpf_u_int32 k;
- register int *err;
+ register int k, *err;
{
- register size_t len;
+ register int len;
register u_char *cp;
register struct mbuf *m0;
@@ -176,6 +161,7 @@ m_xhalf(m, k, err)
}
#endif
+#include <net/bpf.h>
/*
* Execute the filter program starting at pc on the packet p
* wirelen is the length of the original packet
@@ -188,9 +174,9 @@ bpf_filter(pc, p, wirelen, buflen)
u_int wirelen;
register u_int buflen;
{
- register u_int32_t A = 0, X = 0;
- register bpf_u_int32 k;
- int32_t mem[BPF_MEMWORDS];
+ register u_long A = 0, X = 0;
+ register int k;
+ long mem[BPF_MEMWORDS];
if (pc == 0)
/*
@@ -217,7 +203,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_W|BPF_ABS:
k = pc->k;
- if (k > buflen || sizeof(int32_t) > buflen - k) {
+ if (k + sizeof(long) > buflen) {
#ifdef KERNEL
int merr;
@@ -232,16 +218,16 @@ bpf_filter(pc, p, wirelen, buflen)
#endif
}
#ifdef BPF_ALIGN
- if (((intptr_t)(p + k) & 3) != 0)
+ if (((int)(p + k) & 3) != 0)
A = EXTRACT_LONG(&p[k]);
else
#endif
- A = ntohl(*(int32_t *)(p + k));
+ A = ntohl(*(long *)(p + k));
continue;
case BPF_LD|BPF_H|BPF_ABS:
k = pc->k;
- if (k > buflen || sizeof(int16_t) > buflen - k) {
+ if (k + sizeof(short) > buflen) {
#ifdef KERNEL
int merr;
@@ -285,7 +271,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_W|BPF_IND:
k = X + pc->k;
- if (pc->k > buflen || X > buflen - pc->k || sizeof(int32_t) > buflen - k) {
+ if (k + sizeof(long) > buflen) {
#ifdef KERNEL
int merr;
@@ -300,16 +286,16 @@ bpf_filter(pc, p, wirelen, buflen)
#endif
}
#ifdef BPF_ALIGN
- if (((intptr_t)(p + k) & 3) != 0)
+ if (((int)(p + k) & 3) != 0)
A = EXTRACT_LONG(&p[k]);
else
#endif
- A = ntohl(*(int32_t *)(p + k));
+ A = ntohl(*(long *)(p + k));
continue;
case BPF_LD|BPF_H|BPF_IND:
k = X + pc->k;
- if (X > buflen || pc->k > buflen - X || sizeof(int16_t) > buflen - k) {
+ if (k + sizeof(short) > buflen) {
#ifdef KERNEL
int merr;
@@ -328,7 +314,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_B|BPF_IND:
k = X + pc->k;
- if (pc->k >= buflen || X >= buflen - k) {
+ if (k >= buflen) {
#ifdef KERNEL
register struct mbuf *m;
@@ -534,10 +520,10 @@ bpf_validate(f, len)
register int from = i + 1;
if (BPF_OP(p->code) == BPF_JA) {
- if (from >= len || p->k >= len - from)
+ if (from + p->k >= len)
return 0;
}
- else if (from >= len || p->jt >= len - from || p->jf >= len - from)
+ else if (from + p->jt >= len || from + p->jf >= len)
return 0;
}
/*
@@ -546,7 +532,7 @@ bpf_validate(f, len)
if ((BPF_CLASS(p->code) == BPF_ST ||
(BPF_CLASS(p->code) == BPF_LD &&
(p->code & 0xe0) == BPF_MEM)) &&
- p->k >= BPF_MEMWORDS)
+ (p->k >= BPF_MEMWORDS || p->k < 0))
return 0;
/*
* Check for constant division by 0.
diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h
index 39ac4897915ff..aa7f4622816c4 100644
--- a/sys/net/bpfdesc.h
+++ b/sys/net/bpfdesc.h
@@ -37,7 +37,7 @@
*
* @(#)bpfdesc.h 8.1 (Berkeley) 6/10/93
*
- * $Id: bpfdesc.h,v 1.11 1998/11/11 10:04:09 truckman Exp $
+ * $Id$
*/
#ifndef _NET_BPFDESC_H_
@@ -78,7 +78,7 @@ struct bpf_d {
u_char bd_immediate; /* true to return on packet arrival */
int bd_async; /* non-zero if packet reception should generate signal */
int bd_sig; /* signal to send upon packet reception */
- struct sigio * bd_sigio; /* information for async I/O */
+ pid_t bd_pgid; /* process or group id for signal */
#if BSD < 199103
u_char bd_selcoll; /* true if selects collide */
int bd_timedout;
diff --git a/sys/net/bridge.c b/sys/net/bridge.c
index 745eaa2fca0de..7c2e0f23508f2 100644
--- a/sys/net/bridge.c
+++ b/sys/net/bridge.c
@@ -77,7 +77,6 @@
#include <sys/param.h>
#include <sys/mbuf.h>
-#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/socket.h> /* for net/if.h */
#include <sys/kernel.h>
@@ -90,11 +89,9 @@
#include <netinet/if_ether.h> /* for struct arpcom */
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#if defined(IPFIREWALL) && defined(DUMMYNET)
#include <net/route.h>
-#include <netinet/ip_fw.h>
#include <netinet/ip_dummynet.h>
#endif
@@ -239,10 +236,11 @@ bdg_timeout(void *dummy)
if (--slowtimer <= 0 ) {
slowtimer = 5 ;
- for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_link.tqe_next) {
+ for (ifp = ifnet; ifp; ifp = ifp->if_next) {
if (ifp->if_type != IFT_ETHER)
continue ;
if ( 0 == ( ifp->if_flags & IFF_UP) ) {
+ int ret ;
s = splimp();
if_up(ifp);
splx(s);
@@ -281,7 +279,7 @@ static void
bdginit(dummy)
void *dummy;
{
- int i ;
+ int s, i ;
struct ifnet *ifp;
struct arpcom *ac ;
u_char *eth_addr ;
@@ -301,9 +299,8 @@ bdginit(dummy)
bdg_ports = 0 ;
eth_addr = bdg_addresses ;
- printf("BRIDGE 981214, have %d interfaces\n", if_index);
- for (i = 0 , ifp = ifnet.tqh_first ; i < if_index ;
- i++, ifp = ifp->if_link.tqe_next)
+ printf("BRIDGE 980911, have %d interfaces\n", if_index);
+ for (i = 0 , ifp = ifnet ; i < if_index ; i++, ifp = ifp->if_next)
if (ifp->if_type == IFT_ETHER) { /* ethernet ? */
ac = (struct arpcom *)ifp;
sprintf(bdg_stats.s[ifp->if_index].name,
@@ -325,7 +322,7 @@ bdginit(dummy)
bdg_ports ++ ;
}
bdg_timeout(0);
- do_bridge=0;
+ do_bridge=1;
}
/*
@@ -467,7 +464,7 @@ bdg_forward (struct mbuf **m0, struct ifnet *dst)
return 0;
}
if (dst == BDG_BCAST || dst == BDG_MCAST || dst == BDG_UNKNOWN) {
- ifp = ifnet.tqh_first ;
+ ifp = ifnet ;
once = 0 ;
if (dst != BDG_UNKNOWN)
canfree = 0 ;
@@ -518,7 +515,7 @@ bdg_forward (struct mbuf **m0, struct ifnet *dst)
}
dummy = 0 ;
- off= (*ip_fw_chk_ptr)(NULL, 0, src, &dummy, &m, &rule, NULL /*next hop */ ) ;
+ off=(*ip_fw_chk_ptr)(NULL, 0, src, &dummy, &m, &rule) ;
if (m == NULL) { /* pkt discarded by firewall */
printf("-- bdg: firewall discarded pkt\n");
if (canfree)
@@ -559,12 +556,12 @@ forward:
else
m = NULL ;
- for ( ; ifp ; ifp = ifp->if_link.tqe_next ) {
+ for ( ; ifp ; ifp = ifp->if_next ) {
if (ifp != src && ifp->if_type == IFT_ETHER &&
(ifp->if_flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING) &&
SAMEGROUP(ifp, src) && !MUTED(ifp) ) {
if (m == NULL) { /* do i need to make a copy ? */
- if (canfree && ifp->if_link.tqe_next == NULL) /* last one! */
+ if (canfree && ifp->if_next == NULL) /* last one! */
m = *m0 ;
else /* on a P5-90, m_packetcopy takes 540 ticks */
m = m_copypacket(*m0, M_DONTWAIT);
diff --git a/sys/net/bridge.h b/sys/net/bridge.h
index e151e4e6ac7d8..8dcee07a3c51e 100644
--- a/sys/net/bridge.h
+++ b/sys/net/bridge.h
@@ -108,7 +108,7 @@ struct bdg_stats {
* BDG_DROP must be dropped
* other ifp of the dest. interface (incl.self)
*/
-static __inline
+static inline
struct ifnet *
bridge_dst_lookup(struct mbuf *m)
{
diff --git a/sys/net/if.c b/sys/net/if.c
index b0c7be766cee3..295ae4d230587 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id: if.c,v 1.63 1998/12/04 22:54:52 archie Exp $
+ * $Id: if.c,v 1.61 1998/07/20 13:21:56 dfr Exp $
*/
#include "opt_compat.h"
@@ -143,8 +143,7 @@ if_attach(ifp)
/*
* create a Link Level name for this device
*/
- namelen = snprintf(workbuf, sizeof(workbuf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ namelen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
#define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
masklen = _offsetof(struct sockaddr_dl, sdl_data[0]) + namelen;
socksize = masklen + ifp->if_addrlen;
@@ -401,17 +400,16 @@ link_rtrequest(cmd, rt, sa)
* NOTE: must be called at splnet or eqivalent.
*/
void
-if_unroute(ifp, flag, fam)
+if_down(ifp)
register struct ifnet *ifp;
- int flag, fam;
{
register struct ifaddr *ifa;
- ifp->if_flags &= ~flag;
+ ifp->if_flags &= ~IFF_UP;
getmicrotime(&ifp->if_lastchange);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
- if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
- pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
+ for (ifa = ifp->if_addrhead.tqh_first; ifa;
+ ifa = ifa->ifa_link.tqe_next)
+ pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
if_qflush(&ifp->if_snd);
rt_ifmsg(ifp);
}
@@ -422,47 +420,20 @@ if_unroute(ifp, flag, fam)
* NOTE: must be called at splnet or eqivalent.
*/
void
-if_route(ifp, flag, fam)
+if_up(ifp)
register struct ifnet *ifp;
- int flag, fam;
{
register struct ifaddr *ifa;
- ifp->if_flags |= flag;
+ ifp->if_flags |= IFF_UP;
getmicrotime(&ifp->if_lastchange);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
- if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
- pfctlinput(PRC_IFUP, ifa->ifa_addr);
+ for (ifa = ifp->if_addrhead.tqh_first; ifa;
+ ifa = ifa->ifa_link.tqe_next)
+ pfctlinput(PRC_IFUP, ifa->ifa_addr);
rt_ifmsg(ifp);
}
/*
- * Mark an interface down and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_down(ifp)
- register struct ifnet *ifp;
-{
-
- if_unroute(ifp, IFF_UP, AF_UNSPEC);
-}
-
-/*
- * Mark an interface up and notify protocols of
- * the transition.
- * NOTE: must be called at splnet or eqivalent.
- */
-void
-if_up(ifp)
- register struct ifnet *ifp;
-{
-
- if_route(ifp, IFF_UP, AF_UNSPEC);
-}
-
-/*
* Flush an interface queue.
*/
static void
@@ -821,8 +792,7 @@ ifconf(cmd, data)
char workbuf[64];
int ifnlen;
- ifnlen = snprintf(workbuf, sizeof(workbuf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
if(ifnlen + 1 > sizeof ifr.ifr_name) {
error = ENAMETOOLONG;
} else {
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index 9f56a9b610ffc..a41bfaf8548dd 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -521,16 +521,14 @@ pvc_ioctl(shadow, cmd, data)
*/
switch (cmd) {
case SIOCGPVCSIF:
- snprintf(ifr->ifr_name, sizeof(ifr->ifr_name),
- "%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(ifr->ifr_name, "%s%d", ifp->if_name, ifp->if_unit);
return (0);
case SIOCGPVCTX:
do {
struct pvctxreq *pvcreq = (struct pvctxreq *)data;
- snprintf(pvcreq->pvc_ifname,
- sizeof(pvcreq->pvc_ifname), "%s%d",
+ sprintf(pvcreq->pvc_ifname, "%s%d",
ifp->if_name, ifp->if_unit);
pvcreq->pvc_aph = pvcsif->sif_aph;
} while (0);
diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c
index 8e7b99e862a4e..796061e978a0a 100644
--- a/sys/net/if_disc.c
+++ b/sys/net/if_disc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id: if_disc.c,v 1.20 1998/06/07 17:12:03 dfr Exp $
+ * $Id: if_disc.c,v 1.19 1998/01/08 23:41:21 eivind Exp $
*/
/*
@@ -63,24 +63,24 @@
static void discattach __P((void *dummy));
PSEUDO_SET(discattach, if_disc);
-static struct ifnet discif;
-static int discoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+static struct ifnet dsif;
+static int dsoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);
-static void discrtrequest(int cmd, struct rtentry *rt, struct sockaddr *sa);
-static int discioctl(struct ifnet *, u_long, caddr_t);
+static void dsrtrequest(int cmd, struct rtentry *rt, struct sockaddr *sa);
+static int dsioctl(struct ifnet *, u_long, caddr_t);
/* ARGSUSED */
static void
discattach(dummy)
void *dummy;
{
- register struct ifnet *ifp = &discif;
+ register struct ifnet *ifp = &dsif;
ifp->if_name = "ds";
ifp->if_mtu = DSMTU;
ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
- ifp->if_ioctl = discioctl;
- ifp->if_output = discoutput;
+ ifp->if_ioctl = dsioctl;
+ ifp->if_output = dsoutput;
ifp->if_type = IFT_LOOP;
ifp->if_hdrlen = 0;
ifp->if_addrlen = 0;
@@ -91,14 +91,14 @@ discattach(dummy)
}
static int
-discoutput(ifp, m, dst, rt)
+dsoutput(ifp, m, dst, rt)
struct ifnet *ifp;
register struct mbuf *m;
struct sockaddr *dst;
register struct rtentry *rt;
{
if ((m->m_flags & M_PKTHDR) == 0)
- panic("discoutput no HDR");
+ panic("dsoutput no HDR");
#if NBPFILTER > 0
/* BPF write needs to be handled specially */
if (dst->sa_family == AF_UNSPEC) {
@@ -108,7 +108,7 @@ discoutput(ifp, m, dst, rt)
m->m_data += sizeof(int);
}
- if (discif.if_bpf) {
+ if (dsif.if_bpf) {
/*
* We need to prepend the address family as
* a four byte field. Cons up a dummy header
@@ -123,7 +123,7 @@ discoutput(ifp, m, dst, rt)
m0.m_len = 4;
m0.m_data = (char *)&af;
- bpf_mtap(&discif, &m0);
+ bpf_mtap(&dsif, &m0);
}
#endif
m->m_pkthdr.rcvif = ifp;
@@ -137,7 +137,7 @@ discoutput(ifp, m, dst, rt)
/* ARGSUSED */
static void
-discrtrequest(cmd, rt, sa)
+dsrtrequest(cmd, rt, sa)
int cmd;
struct rtentry *rt;
struct sockaddr *sa;
@@ -151,7 +151,7 @@ discrtrequest(cmd, rt, sa)
*/
/* ARGSUSED */
static int
-discioctl(ifp, cmd, data)
+dsioctl(ifp, cmd, data)
register struct ifnet *ifp;
u_long cmd;
caddr_t data;
@@ -166,7 +166,7 @@ discioctl(ifp, cmd, data)
ifp->if_flags |= IFF_UP;
ifa = (struct ifaddr *)data;
if (ifa != 0)
- ifa->ifa_rtrequest = discrtrequest;
+ ifa->ifa_rtrequest = dsrtrequest;
/*
* Everything else is done at a higher level.
*/
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 1485c27665462..ca66eb0dc9068 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -31,13 +31,12 @@
* SUCH DAMAGE.
*
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ethersubr.c,v 1.53 1998/12/14 17:58:05 luigi Exp $
+ * $Id: if_ethersubr.c,v 1.51 1998/06/14 20:58:14 julian Exp $
*/
#include "opt_atalk.h"
#include "opt_inet.h"
#include "opt_ipx.h"
-#include "opt_bdg.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -102,10 +101,6 @@ extern u_char at_org_code[3];
extern u_char aarp_org_code[3];
#endif /* NETATALK */
-#ifdef BRIDGE
-#include <net/bridge.h>
-#endif
-
#include "vlan.h"
#if NVLAN > 0
#include <net/if_vlan_var.h>
@@ -374,22 +369,10 @@ ether_output(ifp, m0, dst, rt0)
} else if (bcmp(eh->ether_dhost,
eh->ether_shost, ETHER_ADDR_LEN) == 0) {
(void) if_simloop(ifp, m, dst, hlen);
- return (0); /* XXX */
+ return(0); /* XXX */
}
}
-#ifdef BRIDGE
- if (do_bridge) {
- struct mbuf *m0 = m ;
-
- if (m->m_pkthdr.rcvif)
- m->m_pkthdr.rcvif = NULL ;
- ifp = bridge_dst_lookup(m);
- bdg_forward(&m0, ifp);
- if (m0)
- m_freem(m0);
- return (0);
- }
-#endif
+
s = splimp();
/*
* Queue message on interface, and start output if interface
diff --git a/sys/net/if_mib.c b/sys/net/if_mib.c
index 2e8f331cfdfcd..268669d36922e 100644
--- a/sys/net/if_mib.c
+++ b/sys/net/if_mib.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_mib.c,v 1.5 1997/08/02 14:32:38 bde Exp $
+ * $Id: if_mib.c,v 1.4 1997/02/22 09:41:02 peter Exp $
*/
#include <sys/param.h>
@@ -89,8 +89,7 @@ sysctl_ifdata SYSCTL_HANDLER_ARGS /* XXX bad syntax! */
return ENOENT;
case IFDATA_GENERAL:
- ifnlen = snprintf(workbuf, sizeof(workbuf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ ifnlen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit);
if(ifnlen + 1 > sizeof ifmd.ifmd_name) {
return ENAMETOOLONG;
} else {
diff --git a/sys/net/if_sppp.h b/sys/net/if_sppp.h
index 67a63ae0472ff..41e5d8e427cb1 100644
--- a/sys/net/if_sppp.h
+++ b/sys/net/if_sppp.h
@@ -16,11 +16,11 @@
*
* From: Version 2.0, Fri Oct 6 20:39:21 MSK 1995
*
- * $Id: if_sppp.h,v 1.12 1998/12/20 19:06:22 phk Exp $
+ * $Id: if_sppp.h,v 1.8 1997/10/11 11:25:20 joerg Exp $
*/
-#ifndef _NET_IF_SPPP_H_
-#define _NET_IF_SPPP_H_ 1
+#ifndef _NET_IF_HDLC_H_
+#define _NET_IF_HDLC_H_ 1
#define IDX_LCP 0 /* idx into state table */
@@ -45,7 +45,6 @@ struct sipcp {
u_int flags;
#define IPCP_HISADDR_SEEN 1 /* have seen his address already */
#define IPCP_MYADDR_DYN 2 /* my address is dynamically assigned */
-#define IPCP_MYADDR_SEEN 4 /* have seen his address already */
};
#define AUTHNAMELEN 32
@@ -117,18 +116,6 @@ struct sppp {
*/
void (*pp_tls)(struct sppp *sp);
void (*pp_tlf)(struct sppp *sp);
- /*
- * These (optional) functions may be filled by the hardware
- * driver if any notification of established connections
- * (currently: IPCP up) is desired (pp_con) or any internal
- * state change of the interface state machine should be
- * signaled for monitoring purposes (pp_chg).
- */
- void (*pp_con)(struct sppp *sp);
- void (*pp_chg)(struct sppp *sp, int new_state);
- /* These two fields are for use by the lower layer */
- void *pp_lowerp;
- int pp_loweri;
};
#define PP_KEEPALIVE 0x01 /* use keepalive protocol */
@@ -172,4 +159,4 @@ int sppp_isempty (struct ifnet *ifp);
void sppp_flush (struct ifnet *ifp);
#endif
-#endif /* _NET_IF_SPPP_H_ */
+#endif /* _NET_IF_HDLC_H_ */
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 4f3e17afdecb8..e5b040debdfa5 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -17,12 +17,12 @@
*
* From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997
*
- * $Id: if_spppsubr.c,v 1.51 1998/12/26 13:14:45 phk Exp $
+ * $Id: if_spppsubr.c,v 1.44 1998/10/06 20:47:53 joerg Exp $
*/
#include <sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
#include "opt_inet.h"
#include "opt_ipx.h"
#endif
@@ -39,9 +39,6 @@
#include <sys/sockio.h>
#include <sys/socket.h>
#include <sys/syslog.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <machine/random.h>
-#endif
#include <sys/malloc.h>
#include <sys/mbuf.h>
@@ -54,15 +51,13 @@
#include <net/if.h>
#include <net/netisr.h>
#include <net/if_types.h>
-#include <net/route.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
#include <machine/random.h>
#endif
#if defined (__NetBSD__) || defined (__OpenBSD__)
#include <machine/cpu.h> /* XXX for softnet */
#endif
-
#include <machine/stdarg.h>
#ifdef INET
@@ -99,16 +94,13 @@
#include <net/if_sppp.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-# define UNTIMEOUT(fun, arg, handle) untimeout(fun, arg, handle)
-# define TIMEOUT(fun, arg1, arg2, handle) handle = timeout(fun, arg1, arg2)
-# define IOCTL_CMD_T u_long
+#if defined (__FreeBSD__)
+# define UNTIMEOUT(fun, arg, handle) \
+ untimeout(fun, arg, handle)
#else
-# define UNTIMEOUT(fun, arg, handle) untimeout(fun, arg)
-# define TIMEOUT(fun, arg1, arg2, handle) timeout(fun, arg1, arg2)
-# define IOCTL_CMD_T int
+# define UNTIMEOUT(fun, arg, handle) \
+ untimeout(fun, arg)
#endif
-
#define MAXALIVECNT 3 /* max. alive packets */
/*
@@ -258,11 +250,11 @@ struct cp {
};
static struct sppp *spppq;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
static struct callout_handle keepalive_ch;
#endif
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
#define SPP_FMT "%s%d: "
#define SPP_ARGS(ifp) (ifp)->if_name, (ifp)->if_unit
#else
@@ -299,11 +291,13 @@ static void sppp_cp_input(const struct cp *cp, struct sppp *sp,
struct mbuf *m);
static void sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
u_char ident, u_short len, void *data);
-/* static void sppp_cp_timeout(void *arg); */
+#ifdef notyet
+static void sppp_cp_timeout(void *arg);
+#endif
static void sppp_cp_change_state(const struct cp *cp, struct sppp *sp,
int newstate);
static void sppp_auth_send(const struct cp *cp,
- struct sppp *sp, unsigned int type, unsigned int id,
+ struct sppp *sp, u_char type, u_char id,
...);
static void sppp_up_event(const struct cp *cp, struct sppp *sp);
@@ -625,7 +619,6 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
struct ppp_header *h;
struct ifqueue *ifq;
int s, rv = 0;
- int debug = ifp->if_flags & IFF_DEBUG;
s = splimp();
@@ -649,47 +642,21 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
ifq = &ifp->if_snd;
#ifdef INET
+ /*
+ * Put low delay, telnet, rlogin and ftp control packets
+ * in front of the queue.
+ */
if (dst->sa_family == AF_INET) {
/* XXX Check mbuf length here? */
struct ip *ip = mtod (m, struct ip*);
struct tcphdr *tcp = (struct tcphdr*) ((long*)ip + ip->ip_hl);
- /*
- * When using dynamic local IP address assignment by using
- * 0.0.0.0 as a local address, the first TCP session will
- * not connect because the local TCP checksum is computed
- * using 0.0.0.0 which will later become our real IP address
- * so the TCP checksum computed at the remote end will
- * become invalid. So we
- * - don't let packets with src ip addr 0 thru
- * - we flag TCP packets with src ip 0 as an error
- */
-
- if(ip->ip_src.s_addr == INADDR_ANY) /* -hm */
- {
- m_freem(m);
- splx(s);
- if(ip->ip_p == IPPROTO_TCP)
- return(EADDRNOTAVAIL);
- else
- return(0);
- }
-
- /*
- * Put low delay, telnet, rlogin and ftp control packets
- * in front of the queue.
- */
- if (IF_QFULL (&sp->pp_fastq))
- ;
- else if (ip->ip_tos & IPTOS_LOWDELAY)
- ifq = &sp->pp_fastq;
- else if (m->m_len < sizeof *ip + sizeof *tcp)
- ;
- else if (ip->ip_p != IPPROTO_TCP)
- ;
- else if (INTERACTIVE (ntohs (tcp->th_sport)))
- ifq = &sp->pp_fastq;
- else if (INTERACTIVE (ntohs (tcp->th_dport)))
+ if (! IF_QFULL (&sp->pp_fastq) &&
+ ((ip->ip_tos & IPTOS_LOWDELAY) ||
+ ((ip->ip_p == IPPROTO_TCP &&
+ m->m_len >= sizeof (struct ip) + sizeof (struct tcphdr) &&
+ (INTERACTIVE (ntohs (tcp->th_sport)))) ||
+ INTERACTIVE (ntohs (tcp->th_dport)))))
ifq = &sp->pp_fastq;
}
#endif
@@ -699,7 +666,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
*/
M_PREPEND (m, PPP_HEADER_LEN, M_DONTWAIT);
if (! m) {
- if (debug)
+ if (ifp->if_flags & IFF_DEBUG)
log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n",
SPP_ARGS(ifp));
++ifp->if_oerrors;
@@ -799,19 +766,17 @@ sppp_attach(struct ifnet *ifp)
/* Initialize keepalive handler. */
if (! spppq)
- TIMEOUT(sppp_keepalive, 0, hz * 10, keepalive_ch);
+#if defined (__FreeBSD__)
+ keepalive_ch =
+#endif
+ timeout(sppp_keepalive, 0, hz * 10);
/* Insert new entry into the keepalive list. */
sp->pp_next = spppq;
spppq = sp;
- sp->pp_if.if_mtu = PP_MTU;
- sp->pp_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
sp->pp_if.if_type = IFT_PPP;
sp->pp_if.if_output = sppp_output;
-#if 0
- sp->pp_flags = PP_KEEPALIVE;
-#endif
sp->pp_fastq.ifq_maxlen = 32;
sp->pp_cpq.ifq_maxlen = 20;
sp->pp_loopcnt = 0;
@@ -933,7 +898,7 @@ sppp_pick(struct ifnet *ifp)
* Process an ioctl request. Called on low priority level.
*/
int
-sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data)
+sppp_ioctl(struct ifnet *ifp, u_long cmd, void *data)
{
struct ifreq *ifr = (struct ifreq*) data;
struct sppp *sp = (struct sppp*) ifp;
@@ -1076,7 +1041,7 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m)
++sp->pp_loopcnt;
/* Generate new local sequence number */
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
sp->pp_seq = random();
#else
sp->pp_seq ^= time.tv_sec ^ time.tv_usec;
@@ -1108,13 +1073,13 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2)
struct ppp_header *h;
struct cisco_packet *ch;
struct mbuf *m;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
struct timeval tv;
#else
u_long t = (time.tv_sec - boottime.tv_sec) * 1000;
#endif
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
getmicrouptime(&tv);
#endif
@@ -1135,7 +1100,7 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2)
ch->par2 = htonl (par2);
ch->rel = -1;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
ch->time0 = htons ((u_short) (tv.tv_sec >> 16));
ch->time1 = htons ((u_short) tv.tv_sec);
#else
@@ -1435,12 +1400,12 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
case STATE_ACK_SENT:
break;
case STATE_CLOSING:
- sppp_cp_change_state(cp, sp, STATE_CLOSED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_CLOSED);
break;
case STATE_STOPPING:
- sppp_cp_change_state(cp, sp, STATE_STOPPED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STOPPED);
break;
case STATE_ACK_RCVD:
sppp_cp_change_state(cp, sp, STATE_REQ_SENT);
@@ -1605,9 +1570,8 @@ sppp_down_event(const struct cp *cp, struct sppp *sp)
sppp_cp_change_state(cp, sp, STATE_INITIAL);
break;
case STATE_STOPPED:
- sppp_cp_change_state(cp, sp, STATE_STARTING);
(cp->tls)(sp);
- break;
+ /* fall through */
case STATE_STOPPING:
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
@@ -1638,8 +1602,8 @@ sppp_open_event(const struct cp *cp, struct sppp *sp)
switch (sp->state[cp->protoidx]) {
case STATE_INITIAL:
- sppp_cp_change_state(cp, sp, STATE_STARTING);
(cp->tls)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STARTING);
break;
case STATE_STARTING:
break;
@@ -1678,8 +1642,8 @@ sppp_close_event(const struct cp *cp, struct sppp *sp)
case STATE_CLOSING:
break;
case STATE_STARTING:
- sppp_cp_change_state(cp, sp, STATE_INITIAL);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_INITIAL);
break;
case STATE_STOPPED:
sppp_cp_change_state(cp, sp, STATE_CLOSED);
@@ -1717,18 +1681,18 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
/* TO- event */
switch (sp->state[cp->protoidx]) {
case STATE_CLOSING:
- sppp_cp_change_state(cp, sp, STATE_CLOSED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_CLOSED);
break;
case STATE_STOPPING:
- sppp_cp_change_state(cp, sp, STATE_STOPPED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STOPPED);
break;
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
case STATE_ACK_SENT:
- sppp_cp_change_state(cp, sp, STATE_STOPPED);
(cp->tlf)(sp);
+ sppp_cp_change_state(cp, sp, STATE_STOPPED);
break;
}
else
@@ -1738,8 +1702,10 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
case STATE_STOPPING:
sppp_cp_send(sp, cp->proto, TERM_REQ, ++sp->pp_seq,
0, 0);
- TIMEOUT(cp->TO, (void *)sp, sp->lcp.timeout,
- sp->ch[cp->protoidx]);
+#if defined (__FreeBSD__)
+ sp->ch[cp->protoidx] =
+#endif
+ timeout(cp->TO, (void *)sp, sp->lcp.timeout);
break;
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
@@ -1749,8 +1715,10 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
break;
case STATE_ACK_SENT:
(cp->scr)(sp);
- TIMEOUT(cp->TO, (void *)sp, sp->lcp.timeout,
- sp->ch[cp->protoidx]);
+#if defined (__FreeBSD__)
+ sp->ch[cp->protoidx] =
+#endif
+ timeout(cp->TO, (void *)sp, sp->lcp.timeout);
break;
}
@@ -1779,8 +1747,10 @@ sppp_cp_change_state(const struct cp *cp, struct sppp *sp, int newstate)
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
case STATE_ACK_SENT:
- TIMEOUT(cp->TO, (void *)sp, sp->lcp.timeout,
- sp->ch[cp->protoidx]);
+#if defined (__FreeBSD__)
+ sp->ch[cp->protoidx] =
+#endif
+ timeout(cp->TO, (void *)sp, sp->lcp.timeout);
break;
}
}
@@ -1812,7 +1782,7 @@ sppp_lcp_init(struct sppp *sp)
sp->lcp.max_terminate = 2;
sp->lcp.max_configure = 10;
sp->lcp.max_failure = 10;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_LCP]);
#endif
}
@@ -1860,7 +1830,7 @@ sppp_lcp_down(struct sppp *sp)
*/
if ((ifp->if_flags & (IFF_AUTO | IFF_PASSIVE)) == 0) {
log(LOG_INFO,
- SPP_FMT "Down event, taking interface down.\n",
+ SPP_FMT "Down event (carrier loss), taking interface down.\n",
SPP_ARGS(ifp));
if_down(ifp);
} else {
@@ -2222,7 +2192,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
if (magic == ~sp->lcp.magic) {
if (debug)
addlog("magic glitch ");
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
sp->lcp.magic = random();
#else
sp->lcp.magic = time.tv_sec + time.tv_usec;
@@ -2270,7 +2240,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
static void
sppp_lcp_tlu(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
int i;
u_long mask;
@@ -2292,9 +2262,8 @@ sppp_lcp_tlu(struct sppp *sp)
else
sp->pp_phase = PHASE_NETWORK;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/*
* Open all authentication protocols. This is even required
@@ -2319,10 +2288,6 @@ sppp_lcp_tlu(struct sppp *sp)
if (sp->lcp.protos & mask && ((cps[i])->flags & CP_LCP) == 0)
(cps[i])->Up(sp);
- /* notify low-level driver of state change */
- if (sp->pp_chg)
- sp->pp_chg(sp, (int)sp->pp_phase);
-
if (sp->pp_phase == PHASE_NETWORK)
/* if no NCP is starting, close down */
sppp_lcp_check_and_close(sp);
@@ -2331,15 +2296,14 @@ sppp_lcp_tlu(struct sppp *sp)
static void
sppp_lcp_tld(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
int i;
u_long mask;
sp->pp_phase = PHASE_TERMINATE;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/*
* Take upper layers down. We send the Down event first and
@@ -2357,36 +2321,30 @@ sppp_lcp_tld(struct sppp *sp)
static void
sppp_lcp_tls(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
sp->pp_phase = PHASE_ESTABLISH;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/* Notify lower layer if desired. */
if (sp->pp_tls)
(sp->pp_tls)(sp);
- else
- (sp->pp_up)(sp);
}
static void
sppp_lcp_tlf(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
sp->pp_phase = PHASE_DEAD;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/* Notify lower layer if desired. */
if (sp->pp_tlf)
(sp->pp_tlf)(sp);
- else
- (sp->pp_down)(sp);
}
static void
@@ -2398,7 +2356,7 @@ sppp_lcp_scr(struct sppp *sp)
if (sp->lcp.opts & (1 << LCP_OPT_MAGIC)) {
if (! sp->lcp.magic)
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
sp->lcp.magic = random();
#else
sp->lcp.magic = time.tv_sec + time.tv_usec;
@@ -2478,7 +2436,7 @@ sppp_ipcp_init(struct sppp *sp)
sp->ipcp.flags = 0;
sp->state[IDX_IPCP] = STATE_INITIAL;
sp->fail_counter[IDX_IPCP] = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_IPCP]);
#endif
}
@@ -2501,8 +2459,6 @@ sppp_ipcp_open(struct sppp *sp)
STDDCL;
u_long myaddr, hisaddr;
- sp->ipcp.flags &= ~(IPCP_HISADDR_SEEN|IPCP_MYADDR_SEEN|IPCP_MYADDR_DYN);
-
sppp_get_ip_addrs(sp, &myaddr, &hisaddr, 0);
/*
* If we don't have his address, this probably means our
@@ -2525,8 +2481,7 @@ sppp_ipcp_open(struct sppp *sp)
*/
sp->ipcp.flags |= IPCP_MYADDR_DYN;
sp->ipcp.opts |= (1 << IPCP_OPT_ADDRESS);
- } else
- sp->ipcp.flags |= IPCP_MYADDR_SEEN;
+ }
sppp_open_event(&ipcp, sp);
}
@@ -2560,7 +2515,6 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
struct ifnet *ifp = &sp->pp_if;
int rlen, origlen, debug = ifp->if_flags & IFF_DEBUG;
u_long hisaddr, desiredaddr;
- int gotmyaddr = 0;
len -= 4;
origlen = len;
@@ -2634,11 +2588,10 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
continue;
#endif
case IPCP_OPT_ADDRESS:
- /* This is the address he wants in his end */
desiredaddr = p[2] << 24 | p[3] << 16 |
p[4] << 8 | p[5];
if (desiredaddr == hisaddr ||
- (hisaddr == 1 && desiredaddr != 0)) {
+ hisaddr == 1 && desiredaddr != 0) {
/*
* Peer's address is same as our value,
* or we have set it to 0.0.0.1 to
@@ -2648,7 +2601,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
*/
if (debug)
addlog("%s [ack] ",
- sppp_dotted_quad(hisaddr));
+ sppp_dotted_quad(desiredaddr));
/* record that we've seen it already */
sp->ipcp.flags |= IPCP_HISADDR_SEEN;
continue;
@@ -2659,14 +2612,13 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
* address, or he send us another address not
* matching our value. Either case, we gonna
* conf-nak it with our value.
- * XXX: we should "rej" if hisaddr == 0
*/
if (debug) {
if (desiredaddr == 0)
addlog("[addr requested] ");
else
addlog("%s [not agreed] ",
- sppp_dotted_quad(desiredaddr));
+ sppp_dotted_quad(desiredaddr));
p[2] = hisaddr >> 24;
p[3] = hisaddr >> 16;
@@ -2691,7 +2643,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
* doesn't want to send us his address. Q: What should we do
* about it? XXX A: implement the max-failure counter.
*/
- if (rlen == 0 && !(sp->ipcp.flags & IPCP_HISADDR_SEEN) && !gotmyaddr) {
+ if (rlen == 0 && !(sp->ipcp.flags & IPCP_HISADDR_SEEN)) {
buf[0] = IPCP_OPT_ADDRESS;
buf[1] = 6;
buf[2] = hisaddr >> 24;
@@ -2747,7 +2699,6 @@ sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
/*
* Peer doesn't grok address option. This is
* bad. XXX Should we better give up here?
- * XXX We could try old "addresses" option...
*/
sp->ipcp.opts &= ~(1 << IPCP_OPT_ADDRESS);
break;
@@ -2808,14 +2759,11 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
* we accept his offer. Otherwise, we
* ignore it and thus continue to negotiate
* our already existing value.
- * XXX: Bogus, if he said no once, he'll
- * just say no again, might as well die.
*/
if (sp->ipcp.flags & IPCP_MYADDR_DYN) {
sppp_set_ip_addr(sp, wantaddr);
if (debug)
addlog("[agree] ");
- sp->ipcp.flags |= IPCP_MYADDR_SEEN;
}
}
break;
@@ -2837,9 +2785,6 @@ sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
static void
sppp_ipcp_tlu(struct sppp *sp)
{
- /* we are up - notify isdn daemon */
- if (sp->pp_con)
- sp->pp_con(sp);
}
static void
@@ -3213,7 +3158,7 @@ sppp_chap_init(struct sppp *sp)
/* Chap doesn't have STATE_INITIAL at all. */
sp->state[IDX_CHAP] = STATE_CLOSED;
sp->fail_counter[IDX_CHAP] = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_CHAP]);
#endif
}
@@ -3298,7 +3243,11 @@ sppp_chap_tlu(struct sppp *sp)
* a number between 300 and 810 seconds.
*/
i = 300 + ((unsigned)(random() & 0xff00) >> 7);
- TIMEOUT(chap.TO, (void *)sp, i * hz, sp->ch[IDX_CHAP]);
+
+#if defined (__FreeBSD__)
+ sp->ch[IDX_CHAP] =
+#endif
+ timeout(chap.TO, (void *)sp, i * hz);
}
if (debug) {
@@ -3353,17 +3302,17 @@ sppp_chap_scr(struct sppp *sp)
{
u_long *ch, seed;
u_char clen;
+#if defined (__NetBSD__) || defined (__OpenBSD__)
+ struct timeval tv;
+#endif
/* Compute random challenge. */
ch = (u_long *)sp->myauth.challenge;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
read_random(&seed, sizeof seed);
#else
- {
- struct timeval tv;
microtime(&tv);
seed = tv.tv_sec ^ tv.tv_usec;
- }
#endif
ch[0] = seed ^ random();
ch[1] = seed ^ random();
@@ -3545,7 +3494,7 @@ sppp_pap_init(struct sppp *sp)
/* PAP doesn't have STATE_INITIAL at all. */
sp->state[IDX_PAP] = STATE_CLOSED;
sp->fail_counter[IDX_PAP] = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined (__FreeBSD__)
callout_handle_init(&sp->ch[IDX_PAP]);
callout_handle_init(&sp->pap_my_to_ch);
#endif
@@ -3563,8 +3512,10 @@ sppp_pap_open(struct sppp *sp)
if (sp->myauth.proto == PPP_PAP) {
/* we are peer, send a request, and start a timer */
pap.scr(sp);
- TIMEOUT(sppp_pap_my_TO, (void *)sp, sp->lcp.timeout,
- sp->pap_my_to_ch);
+#if defined (__FreeBSD__)
+ sp->pap_my_to_ch =
+#endif
+ timeout(sppp_pap_my_TO, (void *)sp, sp->lcp.timeout);
}
}
@@ -3700,14 +3651,10 @@ sppp_pap_scr(struct sppp *sp)
* Varadic function, each of the elements for the ellipsis is of type
* ``size_t mlen, const u_char *msg''. Processing will stop iff
* mlen == 0.
- * NOTE: never declare variadic functions with types subject to type
- * promotion (i.e. u_char). This is asking for big trouble depending
- * on the architecture you are on...
*/
static void
-sppp_auth_send(const struct cp *cp, struct sppp *sp,
- unsigned int type, unsigned int id,
+sppp_auth_send(const struct cp *cp, struct sppp *sp, u_char type, u_char id,
...)
{
STDDCL;
@@ -3716,7 +3663,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
struct mbuf *m;
u_char *p;
int len;
- unsigned int mlen;
+ size_t mlen;
const char *msg;
va_list ap;
@@ -3738,7 +3685,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
va_start(ap, id);
len = 0;
- while ((mlen = (unsigned int)va_arg(ap, size_t)) != 0) {
+ while ((mlen = va_arg(ap, size_t)) != 0) {
msg = va_arg(ap, const char *);
len += mlen;
if (len > MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN) {
@@ -3843,7 +3790,10 @@ sppp_keepalive(void *dummy)
}
}
splx(s);
- TIMEOUT(sppp_keepalive, 0, hz * 10, keepalive_ch);
+#if defined (__FreeBSD__)
+ keepalive_ch =
+#endif
+ timeout(sppp_keepalive, 0, hz * 10);
}
/*
@@ -3863,17 +3813,14 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask)
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
-#elif defined(__NetBSD__) || defined (__OpenBSD__)
- for (ifa = ifp->if_addrlist.tqh_first;
+#if defined (__FreeBSD__)
+ for (ifa = ifp->if_addrhead.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_list.tqe_next)
+ ifa = ifa->ifa_link.tqe_next)
#else
- for (ifa = ifp->if_addrlist;
+ for (ifa = ifp->if_addrlist.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_next)
+ ifa = ifa->ifa_list.tqe_next)
#endif
if (ifa->ifa_addr->sa_family == AF_INET) {
si = (struct sockaddr_in *)ifa->ifa_addr;
@@ -3903,7 +3850,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask)
static void
sppp_set_ip_addr(struct sppp *sp, u_long src)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
struct ifaddr *ifa;
struct sockaddr_in *si;
@@ -3911,17 +3858,15 @@ sppp_set_ip_addr(struct sppp *sp, u_long src)
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
-#elif defined(__NetBSD__) || defined (__OpenBSD__)
- for (ifa = ifp->if_addrlist.tqh_first;
+
+#if defined (__FreeBSD__)
+ for (ifa = ifp->if_addrhead.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_list.tqe_next)
+ ifa = ifa->ifa_link.tqe_next)
#else
- for (ifa = ifp->if_addrlist;
+ for (ifa = ifp->if_addrlist.tqh_first, si = 0;
ifa;
- ifa = ifa->ifa_next)
+ ifa = ifa->ifa_list.tqe_next)
#endif
{
if (ifa->ifa_addr->sa_family == AF_INET)
@@ -3933,40 +3878,8 @@ sppp_set_ip_addr(struct sppp *sp, u_long src)
}
if (ifa && si)
- {
- int error;
-#if __NetBSD_Version__ >= 103080000
- struct sockaddr_in new_sin = *si;
-
- new_sin.sin_addr.s_addr = htonl(src);
- error = in_ifinit(ifp, ifatoia(ifa), &new_sin, 1);
- if(debug && error)
- {
- log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: in_ifinit "
- " failed, error=%d\n", SPP_ARGS(ifp), error);
- }
-#else
- /* delete old route */
- error = rtinit(ifa, (int)RTM_DELETE, RTF_HOST);
- if(debug && error)
- {
- log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: rtinit DEL failed, error=%d\n",
- SPP_ARGS(ifp), error);
- }
-
- /* set new address */
si->sin_addr.s_addr = htonl(src);
-
- /* add new route */
- error = rtinit(ifa, (int)RTM_ADD, RTF_HOST);
- if (debug && error)
- {
- log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: rtinit ADD failed, error=%d",
- SPP_ARGS(ifp), error);
- }
-#endif
- }
-}
+}
static int
sppp_params(struct sppp *sp, u_long cmd, void *data)
@@ -4075,15 +3988,14 @@ sppp_params(struct sppp *sp, u_long cmd, void *data)
static void
sppp_phase_network(struct sppp *sp)
{
- STDDCL;
+ struct ifnet *ifp = &sp->pp_if;
int i;
u_long mask;
sp->pp_phase = PHASE_NETWORK;
- if (debug)
- log(LOG_DEBUG, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
- sppp_phase_name(sp->pp_phase));
+ log(LOG_INFO, SPP_FMT "phase %s\n", SPP_ARGS(ifp),
+ sppp_phase_name(sp->pp_phase));
/* Notify NCPs now. */
for (i = 0; i < IDX_COUNT; i++)
@@ -4117,7 +4029,7 @@ sppp_cp_type_name(u_char type)
case ECHO_REPLY: return "echo-reply";
case DISC_REQ: return "discard-req";
}
- snprintf (buf, sizeof(buf), "0x%x", type);
+ sprintf (buf, "0x%x", type);
return buf;
}
@@ -4140,7 +4052,7 @@ sppp_auth_type_name(u_short proto, u_char type)
case PAP_NAK: return "nak";
}
}
- snprintf (buf, sizeof(buf), "0x%x", type);
+ sprintf (buf, "0x%x", type);
return buf;
}
@@ -4157,7 +4069,7 @@ sppp_lcp_opt_name(u_char opt)
case LCP_OPT_PROTO_COMP: return "proto-comp";
case LCP_OPT_ADDR_COMP: return "addr-comp";
}
- snprintf (buf, sizeof(buf), "0x%x", opt);
+ sprintf (buf, "0x%x", opt);
return buf;
}
@@ -4170,7 +4082,7 @@ sppp_ipcp_opt_name(u_char opt)
case IPCP_OPT_COMPRESSION: return "compression";
case IPCP_OPT_ADDRESS: return "address";
}
- snprintf (buf, sizeof(buf), "0x%x", opt);
+ sprintf (buf, "0x%x", opt);
return buf;
}
@@ -4215,7 +4127,7 @@ sppp_proto_name(u_short proto)
case PPP_PAP: return "pap";
case PPP_CHAP: return "chap";
}
- snprintf(buf, sizeof(buf), "0x%x", (unsigned)proto);
+ sprintf(buf, "0x%x", (unsigned)proto);
return buf;
}
@@ -4272,3 +4184,10 @@ sppp_null(struct sppp *unused)
{
/* do just nothing */
}
+/*
+ * This file is large. Tell emacs to highlight it nevertheless.
+ *
+ * Local Variables:
+ * hilit-auto-highlight-maxout: 120000
+ * End:
+ */
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index ed98e6c0a539a..e00ce0c5bd3d0 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -30,7 +30,6 @@
#include <sys/ttycom.h>
#include <sys/poll.h>
#include <sys/signalvar.h>
-#include <sys/filedesc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#ifdef DEVFS
@@ -38,7 +37,13 @@
#endif /*DEVFS*/
#include <sys/conf.h>
#include <sys/uio.h>
+/*
+ * XXX stop <sys/vnode.h> from including <vnode_if.h>. <vnode_if.h> doesn't
+ * exist if we are an LKM.
+ */
+#undef KERNEL
#include <sys/vnode.h>
+#define KERNEL
#include <net/if.h>
#include <net/netisr.h>
@@ -210,7 +215,7 @@ tunclose(dev, foo, bar, p)
}
splx(s);
}
- funsetown(tp->tun_sigio);
+ tp->tun_pgrp = 0;
selwakeup(&tp->tun_rsel);
TUNDEBUG ("%s%d: closed\n", ifp->if_name, ifp->if_unit);
@@ -301,6 +306,7 @@ tunoutput(ifp, m0, dst, rt)
struct rtentry *rt;
{
struct tun_softc *tp = &tunctl[ifp->if_unit];
+ struct proc *p;
int s;
TUNDEBUG ("%s%d: tunoutput\n", ifp->if_name, ifp->if_unit);
@@ -366,8 +372,12 @@ tunoutput(ifp, m0, dst, rt)
tp->tun_flags &= ~TUN_RWAIT;
wakeup((caddr_t)tp);
}
- if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio)
- pgsigio(tp->tun_sigio, SIGIO, 0);
+ if (tp->tun_flags & TUN_ASYNC && tp->tun_pgrp) {
+ if (tp->tun_pgrp > 0)
+ gsignal(tp->tun_pgrp, SIGIO);
+ else if ((p = pfind(-tp->tun_pgrp)) != 0)
+ psignal(p, SIGIO);
+ }
selwakeup(&tp->tun_rsel);
return 0;
}
@@ -424,22 +434,12 @@ tunioctl(dev, cmd, data, flag, p)
*(int *)data = 0;
splx(s);
break;
- case FIOSETOWN:
- return (fsetown(*(int *)data, &tp->tun_sigio));
-
- case FIOGETOWN:
- *(int *)data = fgetown(tp->tun_sigio);
- return (0);
-
- /* This is deprecated, FIOSETOWN should be used instead. */
case TIOCSPGRP:
- return (fsetown(-(*(int *)data), &tp->tun_sigio));
-
- /* This is deprecated, FIOGETOWN should be used instead. */
+ tp->tun_pgrp = *(int *)data;
+ break;
case TIOCGPGRP:
- *(int *)data = -fgetown(tp->tun_sigio);
- return (0);
-
+ *(int *)data = tp->tun_pgrp;
+ break;
default:
return (ENOTTY);
}
diff --git a/sys/net/if_tunvar.h b/sys/net/if_tunvar.h
index 9e537d3abef83..c44911bcc15c2 100644
--- a/sys/net/if_tunvar.h
+++ b/sys/net/if_tunvar.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_tunvar.h,v 1.2 1998/11/11 10:04:10 truckman Exp $
+ * $Id:$
*/
#ifndef _NET_IF_TUNVAR_H_
@@ -42,7 +42,7 @@ struct tun_softc {
#define TUN_READY (TUN_OPEN | TUN_INITED)
struct ifnet tun_if; /* the interface */
- struct sigio *tun_sigio; /* information for async I/O */
+ int tun_pgrp; /* the process group - if any */
struct selinfo tun_rsel; /* read select */
struct selinfo tun_wsel; /* write select (not used) */
};
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 31ce8f63c15d7..0feaf2322d29b 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)if.h 8.1 (Berkeley) 6/10/93
- * $Id: if_var.h,v 1.9 1998/06/12 03:48:09 julian Exp $
+ * $Id: if_var.h,v 1.8 1998/06/07 17:12:06 dfr Exp $
*/
#ifndef _NET_IF_VAR_H_
@@ -300,9 +300,10 @@ int if_allmulti __P((struct ifnet *, int));
void if_attach __P((struct ifnet *));
int if_delmulti __P((struct ifnet *, struct sockaddr *));
void if_down __P((struct ifnet *));
-void if_route __P((struct ifnet *, int flag, int fam));
-void if_unroute __P((struct ifnet *, int flag, int fam));
void if_up __P((struct ifnet *));
+#ifdef vax
+void ifubareset __P((int));
+#endif
/*void ifinit __P((void));*/ /* declared in systm.h for main() */
int ifioctl __P((struct socket *, u_long, caddr_t, struct proc *));
int ifpromisc __P((struct ifnet *, int));
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 2488b31a1a363..d6149e9175e1d 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_vlan.c,v 1.3 1998/08/23 03:07:10 wollman Exp $
+ * $Id: if_vlan.c,v 1.2 1998/05/15 20:02:47 wollman Exp $
*/
/*
@@ -334,8 +334,8 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCGETVLAN:
bzero(&vlr, sizeof vlr);
if (ifv->ifv_p) {
- snprintf(vlr.vlr_parent, sizeof(vlr.vlr_parent),
- "%s%d", ifv->ifv_p->if_name, ifv->ifv_p->if_unit);
+ sprintf(vlr.vlr_parent, "%s%d", ifv->ifv_p->if_name,
+ ifv->ifv_p->if_unit);
vlr.vlr_tag = ifv->ifv_tag;
}
error = copyout(&vlr, ifr->ifr_data, sizeof vlr);
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index 74e7172f960ce..dc48c8f2b4100 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -70,7 +70,7 @@
* Paul Mackerras (paulus@cs.anu.edu.au).
*/
-/* $Id: ppp_tty.c,v 1.37 1998/06/20 16:39:35 peter Exp $ */
+/* $Id: ppp_tty.c,v 1.36 1998/06/07 17:12:07 dfr Exp $ */
#include "ppp.h"
#if NPPP > 0
@@ -89,7 +89,14 @@
#include <sys/tty.h>
#include <sys/conf.h>
#include <sys/uio.h>
-#include <sys/vnode.h>
+
+/*
+ * XXX stop <sys/vnode.h> from including <vnode_if.h>. <vnode_if.h> doesn't
+ * exist if we are an LKM.
+ */
+#undef KERNEL
+# include <sys/vnode.h>
+#define KERNEL
#ifdef __i386__
#include <i386/isa/intr_machdep.h>
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index 27295dc46781a..702f08857ab81 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -31,6 +31,7 @@ static void at_aarpinput( struct arpcom *ac, struct mbuf *m);
#define AARPTAB_NB 19
#define AARPTAB_SIZE (AARPTAB_BSIZ * AARPTAB_NB)
static struct aarptab aarptab[AARPTAB_SIZE];
+static int aarptab_size = AARPTAB_SIZE;
#define AARPTAB_HASH(a) \
((((a).s_net << 8 ) + (a).s_node ) % AARPTAB_NB )
diff --git a/sys/netatalk/at_rmx.c b/sys/netatalk/at_rmx.c
index ca8db3aff5dbf..556c1c221b269 100644
--- a/sys/netatalk/at_rmx.c
+++ b/sys/netatalk/at_rmx.c
@@ -37,11 +37,9 @@
#include <net/route.h>
-int at_inithead(void **head, int off);
-
static char hexbuf[256];
-static char *
+char *
prsockaddr(void *v)
{
char *bp = &hexbuf[0];
@@ -149,3 +147,4 @@ at_inithead(void **head, int off)
rnh->rnh_lookup = at_lookup;
return 1;
}
+
diff --git a/sys/netatalk/ddp_input.c b/sys/netatalk/ddp_input.c
index 6f7e9f3d06846..e5d37793d6155 100644
--- a/sys/netatalk/ddp_input.c
+++ b/sys/netatalk/ddp_input.c
@@ -37,6 +37,7 @@ atintr( void )
struct elaphdr *elhp, elh;
struct ifnet *ifp;
struct mbuf *m;
+ struct at_ifaddr *aa;
int s;
/*
diff --git a/sys/netatalk/ddp_usrreq.c b/sys/netatalk/ddp_usrreq.c
index ce681ffc509ae..45c9b2eb4836c 100644
--- a/sys/netatalk/ddp_usrreq.c
+++ b/sys/netatalk/ddp_usrreq.c
@@ -60,6 +60,7 @@ static int
ddp_detach(struct socket *so)
{
struct ddpcb *ddp;
+ int error = 0;
int s;
ddp = sotoddpcb( so );
@@ -118,6 +119,7 @@ ddp_disconnect(struct socket *so)
{
struct ddpcb *ddp;
+ int error = 0;
int s;
ddp = sotoddpcb( so );
@@ -140,7 +142,9 @@ static int
ddp_shutdown(struct socket *so)
{
struct ddpcb *ddp;
-
+ int error = 0;
+ int s;
+
ddp = sotoddpcb( so );
if ( ddp == NULL ) {
return( EINVAL);
@@ -532,7 +536,9 @@ static int
at_setsockaddr(struct socket *so, struct sockaddr **nam)
{
struct ddpcb *ddp;
-
+ int error = 0;
+ int s;
+
ddp = sotoddpcb( so );
if ( ddp == NULL ) {
return( EINVAL);
diff --git a/sys/netatm/atm_aal5.c b/sys/netatm/atm_aal5.c
index 7d6a22bd792bc..4d365dd63b401 100644
--- a/sys/netatm/atm_aal5.c
+++ b/sys/netatm/atm_aal5.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_aal5.c,v 1.3 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_aal5.c,v 1.1 1998/09/15 08:22:57 phk Exp $
*
*/
@@ -35,13 +35,13 @@
*
*/
-#include <netatm/kern_include.h>
-#include <sys/stat.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_aal5.c,v 1.3 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_aal5.c,v 1.1 1998/09/15 08:22:57 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+#include <sys/stat.h>
+
/*
* Global variables
@@ -193,14 +193,15 @@ static Atm_attributes atm_aal5_defattr = {
if (atm_stackq_head != NULL) \
panic("atm_aal5: stack queue not empty"); \
;
-#else /* !DIAGNOSTIC */
+#else
#define ATM_INTRO(f) \
int s, err = 0; \
s = splnet(); \
;
-#endif /* DIAGNOSTIC */
+#endif
#define ATM_OUTRO() \
+out: \
/* \
* Drain any deferred calls \
*/ \
@@ -243,7 +244,7 @@ atm_aal5_attach(so, proto, p)
*/
err = atm_sock_attach(so, atm_aal5_sendspace, atm_aal5_recvspace);
if (err)
- ATM_RETERR(err);
+ goto out;
/*
* Finish up any protocol specific stuff
@@ -257,7 +258,6 @@ atm_aal5_attach(so, proto, p)
atp->atp_attr = atm_aal5_defattr;
strncpy(atp->atp_name, "(AAL5)", T_ATM_APP_NAME_LEN);
-out:
ATM_OUTRO();
}
@@ -521,7 +521,6 @@ atm_aal5_send(so, flags, m, addr, control, p)
KB_FREEALL(m);
}
-out:
ATM_OUTRO();
}
@@ -693,7 +692,7 @@ atm_aal5_incoming(tok, cop, ap, tokp)
Atm_attributes *ap;
void **tokp;
{
- Atm_pcb *atp0 = tok, *atp;
+ Atm_pcb *atp = tok;
struct socket *so;
int err = 0;
@@ -703,11 +702,11 @@ atm_aal5_incoming(tok, cop, ap, tokp)
* Note that our attach function will be called via sonewconn
* and it will allocate and setup most of the pcb.
*/
- atm_sock_stat.as_inconn[atp0->atp_type]++;
+ atm_sock_stat.as_inconn[atp->atp_type]++;
#if (defined(BSD) && (BSD >= 199103))
- so = sonewconn(atp0->atp_socket, 0);
+ so = sonewconn(atp->atp_socket, 0);
#else
- so = sonewconn(atp0->atp_socket);
+ so = sonewconn(atp->atp_socket);
#endif
if (so) {
@@ -716,12 +715,10 @@ atm_aal5_incoming(tok, cop, ap, tokp)
*/
atp = sotoatmpcb(so);
atp->atp_conn = cop;
- atp->atp_attr = *atp0->atp_conn->co_lattr;
- strncpy(atp->atp_name, atp0->atp_name, T_ATM_APP_NAME_LEN);
*tokp = atp;
} else {
err = ECONNABORTED;
- atm_sock_stat.as_connfail[atp0->atp_type]++;
+ atm_sock_stat.as_connfail[atp->atp_type]++;
}
return (err);
@@ -826,7 +823,6 @@ atm_aal5_ctloutput(so, sopt)
break;
case T_ATM_CAUSE:
- case T_ATM_APP_NAME:
break;
default:
@@ -856,7 +852,6 @@ atm_aal5_ctloutput(so, sopt)
break;
}
-out:
ATM_OUTRO();
}
diff --git a/sys/netatm/atm_cm.c b/sys/netatm/atm_cm.c
index 6ae42e8396bdf..4304b56dc7503 100644
--- a/sys/netatm/atm_cm.c
+++ b/sys/netatm/atm_cm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_cm.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: atm_cm.c,v 1.1 1998/09/15 08:22:57 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_cm.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_cm.c,v 1.1 1998/09/15 08:22:57 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Global variables
diff --git a/sys/netatm/atm_device.c b/sys/netatm/atm_device.c
index d68134fc03fe8..3a65880e15745 100644
--- a/sys/netatm/atm_device.c
+++ b/sys/netatm/atm_device.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_device.c,v 1.3 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_device.c,v 1.1 1998/09/15 08:22:57 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_device.c,v 1.3 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_device.c,v 1.1 1998/09/15 08:22:57 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Private structures for managing allocated kernel memory resources
@@ -874,7 +874,7 @@ atm_dev_pdu_print(cup, cvp, m, msg)
{
char buf[128];
- snprintf(buf, sizeof(buf), "%s vcc=(%d,%d)", msg,
+ sprintf(buf, "%s vcc=(%d,%d)", msg,
cvp->cv_connvc->cvc_vcc->vc_vpi,
cvp->cv_connvc->cvc_vcc->vc_vci);
diff --git a/sys/netatm/atm_if.c b/sys/netatm/atm_if.c
index a3609551b484f..a07ccc2251d66 100644
--- a/sys/netatm/atm_if.c
+++ b/sys/netatm/atm_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_if.c,v 1.2 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_if.c,v 1.13 1998/07/23 21:43:55 root Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_if.c,v 1.2 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_if.c,v 1.13 1998/07/23 21:43:55 root Exp $";
#endif
+#include <netatm/kern_include.h>
+
#if (defined(BSD) && (BSD < 199506))
extern int ifqmaxlen;
@@ -326,8 +326,8 @@ atm_physif_ioctl(code, data, arg)
KM_ZERO((caddr_t)&apr, sizeof(apr));
smp = pip->pif_sigmgr;
sip = pip->pif_siginst;
- (void) snprintf(apr.anp_intf, sizeof(apr.anp_intf),
- "%s%d", pip->pif_name, pip->pif_unit );
+ (void) sprintf(apr.anp_intf, "%s%d", pip->pif_name,
+ pip->pif_unit );
if ( pip->pif_nif )
{
strcpy(apr.anp_nif_pref, pip->pif_nif->nif_if.if_name);
@@ -380,14 +380,14 @@ atm_physif_ioctl(code, data, arg)
* Fill in info to be returned
*/
KM_ZERO((caddr_t)&anr, sizeof(anr));
- (void) snprintf(anr.anp_intf, sizeof(anr.anp_intf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ (void) sprintf(anr.anp_intf, "%s%d", ifp->if_name,
+ ifp->if_unit);
IFP_TO_IA(ifp, ia);
if (ia) {
anr.anp_proto_addr = *ia->ia_ifa.ifa_addr;
}
- (void) snprintf(anr.anp_phy_intf, sizeof(anr.anp_phy_intf),
- "%s%d", pip->pif_name, pip->pif_unit);
+ (void) sprintf(anr.anp_phy_intf, "%s%d", pip->pif_name,
+ pip->pif_unit);
/*
* Copy data to user buffer
@@ -410,8 +410,7 @@ atm_physif_ioctl(code, data, arg)
pip = (struct atm_pif *)arg;
if ( pip == NULL )
return ( ENXIO );
- snprintf ( ifname, sizeof(ifname),
- "%s%d", pip->pif_name, pip->pif_unit );
+ sprintf ( ifname, "%s%d", pip->pif_name, pip->pif_unit );
/*
* Cast response into users buffer
@@ -573,8 +572,8 @@ atm_physif_ioctl(code, data, arg)
* Fill in info to be returned
*/
KM_ZERO((caddr_t)&acr, sizeof(acr));
- (void) snprintf(acr.acp_intf, sizeof(acr.acp_intf),
- "%s%d", pip->pif_name, pip->pif_unit);
+ (void) sprintf(acr.acp_intf, "%s%d", pip->pif_name,
+ pip->pif_unit);
KM_COPY((caddr_t)acp, (caddr_t)&acr.acp_cfg,
sizeof(Atm_config));
diff --git a/sys/netatm/atm_proto.c b/sys/netatm/atm_proto.c
index 5327e4ed923ac..ddd1a88bb2012 100644
--- a/sys/netatm/atm_proto.c
+++ b/sys/netatm/atm_proto.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_proto.c,v 1.1 1998/09/15 08:22:58 phk Exp $
+ * @(#) $Id: atm_proto.c,v 1.6 1998/02/19 19:52:06 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_proto.c,v 1.1 1998/09/15 08:22:58 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_proto.c,v 1.6 1998/02/19 19:52:06 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
struct protosw atmsw[] = {
{ SOCK_DGRAM, /* ioctl()-only */
diff --git a/sys/netatm/atm_signal.c b/sys/netatm/atm_signal.c
index da46c98771a56..8acbf7a117576 100644
--- a/sys/netatm/atm_signal.c
+++ b/sys/netatm/atm_signal.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_signal.c,v 1.1 1998/09/15 08:22:58 phk Exp $
+ * @(#) $Id: atm_signal.c,v 1.8 1998/03/24 20:45:37 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_signal.c,v 1.1 1998/09/15 08:22:58 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_signal.c,v 1.8 1998/03/24 20:45:37 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Local variables
diff --git a/sys/netatm/atm_socket.c b/sys/netatm/atm_socket.c
index 004fba4949d0e..2370a15fd070e 100644
--- a/sys/netatm/atm_socket.c
+++ b/sys/netatm/atm_socket.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_socket.c,v 1.2 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_socket.c,v 1.3 1998/07/30 22:30:53 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_socket.c,v 1.2 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_socket.c,v 1.3 1998/07/30 22:30:53 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Local functions
@@ -1207,8 +1207,8 @@ atm_sock_getopt(so, sopt, atp)
struct ifnet *ifp;
ifp = &ap->nif->nif_if;
- (void) snprintf(netif.net_intf, sizeof(netif.net_intf),
- "%s%d", ifp->if_name, ifp->if_unit);
+ (void) sprintf(netif.net_intf, "%s%d",
+ ifp->if_name, ifp->if_unit);
return (sooptcopyout(sopt, &netif,
sizeof netif));
} else {
diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c
index 328b6be5a57f3..3fcf36e16a799 100644
--- a/sys/netatm/atm_subr.c
+++ b/sys/netatm/atm_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_subr.c,v 1.2 1998/09/17 09:34:59 phk Exp $
+ * @(#) $Id: atm_subr.c,v 1.1 1998/09/15 08:22:59 phk Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_subr.c,v 1.2 1998/09/17 09:34:59 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_subr.c,v 1.1 1998/09/15 08:22:59 phk Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Global variables
diff --git a/sys/netatm/atm_usrreq.c b/sys/netatm/atm_usrreq.c
index 278d9f8f85747..4231d1c010d15 100644
--- a/sys/netatm/atm_usrreq.c
+++ b/sys/netatm/atm_usrreq.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: atm_usrreq.c,v 1.2 1998/10/31 20:06:54 phk Exp $
+ * @(#) $Id: atm_usrreq.c,v 1.7 1998/06/29 21:51:29 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: atm_usrreq.c,v 1.2 1998/10/31 20:06:54 phk Exp $");
+static char *RCSid = "@(#) $Id: atm_usrreq.c,v 1.7 1998/06/29 21:51:29 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* Local functions
@@ -98,6 +98,7 @@ struct pr_usrreqs atm_dgram_usrreqs = {
#endif
#define ATM_OUTRO() \
+done: \
/* \
* Drain any deferred calls \
*/ \
@@ -108,7 +109,7 @@ struct pr_usrreqs atm_dgram_usrreqs = {
#define ATM_RETERR(errno) { \
err = errno; \
- goto out; \
+ goto done; \
}
@@ -437,7 +438,6 @@ atm_dgram_control(so, cmd, data, ifp, p)
err = EOPNOTSUPP;
}
-out:
ATM_OUTRO();
}
@@ -547,17 +547,11 @@ atm_dgram_info(data)
for (pip = atm_interface_head; pip;
pip = pip->pif_next) {
if (smp = pip->pif_sigmgr) {
- for (nip = pip->pif_nif; nip;
- nip = nip->nif_pnext) {
- err = (*smp->sm_ioctl)
- (AIOCS_INF_ASV, data,
- (caddr_t)nip);
- if (err)
- break;
- }
- if (err)
- break;
+ err = (*smp->sm_ioctl)(AIOCS_INF_ASV,
+ data, NULL);
}
+ if (err)
+ break;
}
}
break;
diff --git a/sys/netatm/ipatm/ipatm_event.c b/sys/netatm/ipatm/ipatm_event.c
index 66f736e6bbd00..842ee64feaaa5 100644
--- a/sys/netatm/ipatm/ipatm_event.c
+++ b/sys/netatm/ipatm/ipatm_event.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_event.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: ipatm_event.c,v 1.1 1998/09/15 08:23:00 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_event.c,v 1.1 1998/09/15 08:23:00 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_event.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* Process an IP VCC timeout
diff --git a/sys/netatm/ipatm/ipatm_if.c b/sys/netatm/ipatm/ipatm_if.c
index 7cac3da4e319c..ede2450ff8be1 100644
--- a/sys/netatm/ipatm/ipatm_if.c
+++ b/sys/netatm/ipatm/ipatm_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_if.c,v 1.1 1998/09/15 08:23:00 phk Exp $
+ * @(#) $Id: ipatm_if.c,v 1.6 1998/03/24 20:51:47 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_if.c,v 1.6 1998/03/24 20:51:47 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_if.c,v 1.1 1998/09/15 08:23:00 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/ipatm/ipatm_input.c b/sys/netatm/ipatm/ipatm_input.c
index 5d292fe2c9061..ca3e3e75a34af 100644
--- a/sys/netatm/ipatm/ipatm_input.c
+++ b/sys/netatm/ipatm/ipatm_input.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_input.c,v 1.1 1998/09/15 08:23:00 phk Exp $
+ * @(#) $Id: ipatm_input.c,v 1.9 1998/04/07 23:03:52 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_input.c,v 1.9 1998/04/07 23:03:52 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_input.c,v 1.1 1998/09/15 08:23:00 phk Exp $");
-#endif
-
/*
* Process VCC Input Data
@@ -111,10 +111,7 @@ ipatm_ipinput(inp, m)
struct ip_nif *inp;
KBuffer *m;
{
- int s;
-#if BSD < 199103
- int space;
-#endif
+ int s, space;
#ifdef DIAGNOSTIC
if (ipatm_print) {
diff --git a/sys/netatm/ipatm/ipatm_load.c b/sys/netatm/ipatm/ipatm_load.c
index 38254150b1e28..8caa6354a4cb7 100644
--- a/sys/netatm/ipatm/ipatm_load.c
+++ b/sys/netatm/ipatm/ipatm_load.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_load.c,v 1.1 1998/09/15 08:23:00 phk Exp $
+ * @(#) $Id: ipatm_load.c,v 1.12 1998/07/30 22:23:00 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_load.c,v 1.12 1998/07/30 22:23:00 mks Exp $";
+#endif
+
#ifndef ATM_IP_MODULE
#include "opt_atm.h"
#endif
@@ -45,10 +49,6 @@
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_load.c,v 1.1 1998/09/15 08:23:00 phk Exp $");
-#endif
-
/*
* Global variables
diff --git a/sys/netatm/ipatm/ipatm_output.c b/sys/netatm/ipatm/ipatm_output.c
index 54def8a1e5062..7f02f28c85056 100644
--- a/sys/netatm/ipatm/ipatm_output.c
+++ b/sys/netatm/ipatm/ipatm_output.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_output.c,v 1.1 1998/09/15 08:23:01 phk Exp $
+ * @(#) $Id: ipatm_output.c,v 1.6 1998/02/19 20:14:17 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_output.c,v 1.6 1998/02/19 20:14:17 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_output.c,v 1.1 1998/09/15 08:23:01 phk Exp $");
-#endif
-
/*
* Output an IP Packet
diff --git a/sys/netatm/ipatm/ipatm_usrreq.c b/sys/netatm/ipatm/ipatm_usrreq.c
index 6fc94d6feb76e..1f1751c703d54 100644
--- a/sys/netatm/ipatm/ipatm_usrreq.c
+++ b/sys/netatm/ipatm/ipatm_usrreq.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_usrreq.c,v 1.2 1998/10/31 20:06:55 phk Exp $
+ * @(#) $Id: ipatm_usrreq.c,v 1.6 1998/05/18 19:14:04 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_usrreq.c,v 1.6 1998/05/18 19:14:04 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_usrreq.c,v 1.2 1998/10/31 20:06:55 phk Exp $");
-#endif
-
/*
* Process IP PF_ATM ioctls
@@ -333,8 +333,7 @@ ipatm_ioctl(code, data, arg1)
AF_INET;
SATOSIN(&aivr.aip_dst_addr)->sin_addr.s_addr =
ivp->iv_dst.s_addr;
- (void) snprintf(aivr.aip_intf,
- sizeof(aivr.aip_intf), "%s%d",
+ (void) sprintf(aivr.aip_intf, "%s%d",
inp->inf_nif->nif_if.if_name,
inp->inf_nif->nif_if.if_unit);
if ((ivp->iv_conn) &&
diff --git a/sys/netatm/ipatm/ipatm_vcm.c b/sys/netatm/ipatm/ipatm_vcm.c
index 8bfab7e5e0644..cb8f46bdb61ac 100644
--- a/sys/netatm/ipatm/ipatm_vcm.c
+++ b/sys/netatm/ipatm/ipatm_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: ipatm_vcm.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: ipatm_vcm.c,v 1.1 1998/09/15 08:23:01 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: ipatm_vcm.c,v 1.1 1998/09/15 08:23:01 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
-#ifndef lint
-__RCSID("@(#) $Id: ipatm_vcm.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
Atm_attributes ipatm_aal5llc = {
NULL, /* nif */
diff --git a/sys/netatm/sigpvc/sigpvc_if.c b/sys/netatm/sigpvc/sigpvc_if.c
index b3af607af6a14..4208f29f4cb3e 100644
--- a/sys/netatm/sigpvc/sigpvc_if.c
+++ b/sys/netatm/sigpvc/sigpvc_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sigpvc_if.c,v 1.3 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: sigpvc_if.c,v 1.13 1998/07/30 22:32:42 mks Exp $
*
*/
@@ -36,6 +36,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sigpvc_if.c,v 1.13 1998/07/30 22:32:42 mks Exp $";
+#endif
+
#ifndef ATM_SIGPVC_MODULE
#include "opt_atm.h"
#endif
@@ -45,10 +49,6 @@
#include <netatm/sigpvc/sigpvc.h>
#include <netatm/sigpvc/sigpvc_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sigpvc_if.c,v 1.3 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -604,8 +604,7 @@ sigpvc_ioctl(code, data, arg1)
/*
* Fill in info to be returned
*/
- (void) snprintf(avr.avp_intf, sizeof(avr.avp_intf),
- "%s%d",
+ (void) sprintf(avr.avp_intf, "%s%d",
pvp->pv_pif->pif_name, pvp->pv_pif->pif_unit);
avr.avp_vpi = vcp->vc_vpi;
avr.avp_vci = vcp->vc_vci;
@@ -653,9 +652,8 @@ sigpvc_ioctl(code, data, arg1)
break;
case AIOCS_INF_ARP:
- case AIOCS_INF_ASV:
/*
- * Get ARP table/server information
+ * Get ARP table information
*/
/* We don't maintain any ARP information */
break;
diff --git a/sys/netatm/sigpvc/sigpvc_subr.c b/sys/netatm/sigpvc/sigpvc_subr.c
index 63e3b64fd5777..00f92ec125e58 100644
--- a/sys/netatm/sigpvc/sigpvc_subr.c
+++ b/sys/netatm/sigpvc/sigpvc_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sigpvc_subr.c,v 1.1 1998/09/15 08:23:02 phk Exp $
+ * @(#) $Id: sigpvc_subr.c,v 1.7 1998/06/29 21:52:25 mks Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sigpvc_subr.c,v 1.7 1998/06/29 21:52:25 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/sigpvc/sigpvc.h>
#include <netatm/sigpvc/sigpvc_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sigpvc_subr.c,v 1.1 1998/09/15 08:23:02 phk Exp $");
-#endif
-
extern struct sp_info sigpvc_vcpool;
/*
diff --git a/sys/netatm/spans/spans_arp.c b/sys/netatm/spans/spans_arp.c
index d2d65e6c38794..5a2443af9de37 100644
--- a/sys/netatm/spans/spans_arp.c
+++ b/sys/netatm/spans/spans_arp.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_arp.c,v 1.3 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: spans_arp.c,v 1.9 1998/06/29 22:03:12 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_arp.c,v 1.9 1998/06/29 22:03:12 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -43,10 +47,6 @@
#include <netatm/spans/spans_var.h>
#include <netatm/spans/spans_cls.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_arp.c,v 1.3 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -1089,8 +1089,7 @@ spansarp_ioctl(code, data, arg1)
AF_INET;
SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr =
sap->sa_dstip.s_addr;
- (void) snprintf(aar.aap_intf,
- sizeof(aar.aap_intf), "%s%d",
+ (void) sprintf(aar.aap_intf, "%s%d",
clp->cls_ipnif->inf_nif->nif_if.if_name,
clp->cls_ipnif->inf_nif->nif_if.if_unit
);
@@ -1125,13 +1124,6 @@ spansarp_ioctl(code, data, arg1)
aip->air_buf_len = buf_len;
break;
- case AIOCS_INF_ASV:
- /*
- * Get ARP server information
- */
- /* SPANS doesn't have an ARP server */
- break;
-
default:
err = EOPNOTSUPP;
}
diff --git a/sys/netatm/spans/spans_cls.c b/sys/netatm/spans/spans_cls.c
index 17dc135fc5470..f496311f0d39f 100644
--- a/sys/netatm/spans/spans_cls.c
+++ b/sys/netatm/spans/spans_cls.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_cls.c,v 1.2 1998/10/31 20:06:56 phk Exp $
+ * @(#) $Id: spans_cls.c,v 1.11 1998/06/29 22:04:29 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_cls.c,v 1.11 1998/06/29 22:04:29 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -43,10 +47,6 @@
#include <netatm/spans/spans_var.h>
#include <netatm/spans/spans_cls.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_cls.c,v 1.2 1998/10/31 20:06:56 phk Exp $");
-#endif
-
/*
* Global variables
@@ -842,7 +842,7 @@ spanscls_pdu_print(clp, m, msg)
{
char buf[128];
- snprintf(buf, sizeof(buf), "spanscls %s:\n", msg);
+ sprintf(buf, "spanscls %s:\n", msg);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/spans/spans_if.c b/sys/netatm/spans/spans_if.c
index 4557f26a662da..6546ae25a6010 100644
--- a/sys/netatm/spans/spans_if.c
+++ b/sys/netatm/spans/spans_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_if.c,v 1.3 1998/10/31 20:06:56 phk Exp $
+ * @(#) $Id: spans_if.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -36,6 +36,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_if.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#ifndef ATM_SPANS_MODULE
#include "opt_atm.h"
#endif
@@ -45,10 +49,6 @@
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_if.c,v 1.3 1998/10/31 20:06:56 phk Exp $");
-#endif
-
/*
* Global variables
*/
@@ -972,8 +972,7 @@ spans_ioctl(code, data, arg1)
/*
* Fill out the response struct for the VCC
*/
- (void) snprintf(rsp.avp_intf,
- sizeof(rsp.avp_intf), "%s%d",
+ (void) sprintf(rsp.avp_intf, "%s%d",
spp->sp_pif->pif_name,
spp->sp_pif->pif_unit);
rsp.avp_vpi = svp->sv_vpi;
diff --git a/sys/netatm/spans/spans_kxdr.c b/sys/netatm/spans/spans_kxdr.c
index 3843341c22416..b6534de0e3f7b 100644
--- a/sys/netatm/spans/spans_kxdr.c
+++ b/sys/netatm/spans/spans_kxdr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_kxdr.c,v 1.1 1998/09/15 08:23:03 phk Exp $
+ * @(#) $Id: spans_kxdr.c,v 1.2 1997/05/06 22:17:00 mks Exp $
*
*/
@@ -35,12 +35,12 @@
*
*/
-#include <netatm/kern_include.h>
-
#ifndef lint
-__RCSID("@(#) $Id: spans_kxdr.c,v 1.1 1998/09/15 08:23:03 phk Exp $");
+static char *RCSid = "@(#) $Id: spans_kxdr.c,v 1.2 1997/05/06 22:17:00 mks Exp $";
#endif
+#include <netatm/kern_include.h>
+
/*
* This file contains code that has been copied and/or modified from
* the following FreeBSD files:
diff --git a/sys/netatm/spans/spans_msg.c b/sys/netatm/spans/spans_msg.c
index f04cc7fb3bed4..1ce9a50eecfd6 100644
--- a/sys/netatm/spans/spans_msg.c
+++ b/sys/netatm/spans/spans_msg.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_msg.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: spans_msg.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_msg.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <rpc/rpc.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_msg.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* External functions
*/
diff --git a/sys/netatm/spans/spans_print.c b/sys/netatm/spans/spans_print.c
index 99e8c94b18287..117324c29ef1f 100644
--- a/sys/netatm/spans/spans_print.c
+++ b/sys/netatm/spans/spans_print.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_print.c,v 1.3 1998/10/31 20:06:56 phk Exp $
+ * @(#) $Id: spans_print.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_print.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_print.c,v 1.3 1998/10/31 20:06:56 phk Exp $");
-#endif
-
/*
* If LONGPRINT is defined, every field of the SPANS message will be
* printed. If not, a shorter summary (useful for debugging without
@@ -54,17 +54,13 @@ __RCSID("@(#) $Id: spans_print.c,v 1.3 1998/10/31 20:06:56 phk Exp $");
/*
* Local functions
*/
-static void spans_msgtype_str __P((spans_msgtype *, char *, int));
-static void spans_print_msgbody __P((spans_msgbody *));
-static void spans_result_str __P((spans_result *, char *, int));
-
-#ifdef LONGPRINT
-
static void inc_indent __P((void));
static void dec_indent __P((void));
-static void spans_aal_str __P((spans_aal *, char *, int));
-static void spans_query_type_str __P((spans_query_type *, char *, int));
-static void spans_state_str __P((spans_query_type *, char *, int));
+static void spans_aal_str __P((spans_aal *, char *));
+static void spans_result_str __P((spans_result *, char *));
+static void spans_msgtype_str __P((spans_msgtype *, char *));
+static void spans_query_type_str __P((spans_query_type *, char *));
+static void spans_state_str __P((spans_query_type *, char *));
static void spans_print_version __P((spans_version *));
static void spans_print_vpvc __P((spans_vpvc *));
static void spans_print_vpvc_pref __P((spans_vpvc_pref *));
@@ -105,6 +101,7 @@ static void spans_print_parm_leave_cnf __P((spans_parm_leave_cnf *));
static void spans_print_parm_vcir_ind __P((spans_parm_vcir_ind *));
static void spans_print_parm_query_req __P((spans_parm_query_req *));
static void spans_print_parm_query_rsp __P((spans_parm_query_rsp *));
+static void spans_print_msgbody __P((spans_msgbody *));
/*
@@ -119,7 +116,7 @@ static void
inc_indent()
{
if (spans_indent != &indent_str[0]) {
- spans_indent--;
+ *spans_indent--;
}
}
@@ -127,15 +124,14 @@ static void
dec_indent()
{
if (spans_indent != INIT_INDENT) {
- spans_indent++;
+ *spans_indent++;
}
}
static void
-spans_aal_str(objp, dest, len)
+spans_aal_str(objp, dest)
spans_aal *objp;
char *dest;
- int len;
{
static char *aal_names[] = {
"SPANS_AAL0",
@@ -147,20 +143,17 @@ spans_aal_str(objp, dest, len)
};
if (*objp < SPANS_AAL0 || *objp > SPANS_AAL5) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)", aal_names[(int)*objp],
+ sprintf(dest, "%s (%d)", aal_names[(int)*objp],
(int)*objp);
}
}
-#endif
-
static void
-spans_result_str(objp, dest, len)
+spans_result_str(objp, dest)
spans_result *objp;
char *dest;
- int len;
{
static char *result_names[] = {
"SPANS_OK",
@@ -171,18 +164,17 @@ spans_result_str(objp, dest, len)
};
if (*objp < SPANS_OK || *objp > SPANS_BADDEST) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)",
+ sprintf(dest, "%s (%d)",
result_names[(int)*objp], (int)*objp);
}
}
static void
-spans_msgtype_str(objp, dest, len)
+spans_msgtype_str(objp, dest)
spans_msgtype *objp;
char *dest;
- int len;
{
int i;
@@ -228,7 +220,7 @@ spans_msgtype_str(objp, dest, len)
*/
for (i=0; msgtype_names[i].name; i++) {
if (*objp == msgtype_names[i].type) {
- snprintf(dest, len, "%s (%d)",
+ sprintf(dest, "%s (%d)",
msgtype_names[i].name,
(int)*objp);
return;
@@ -238,16 +230,13 @@ spans_msgtype_str(objp, dest, len)
/*
* Type was not found--return an error indicator
*/
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
}
-#ifdef LONGPRINT
-
static void
-spans_query_type_str(objp, dest, len)
+spans_query_type_str(objp, dest)
spans_query_type *objp;
char *dest;
- int len;
{
static char *query_names[] = {
"SPANS_QUERY_NORMAL",
@@ -257,18 +246,17 @@ spans_query_type_str(objp, dest, len)
if (*objp < SPANS_QUERY_NORMAL ||
*objp > SPANS_QUERY_END_TO_END) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)", query_names[(int)*objp],
+ sprintf(dest, "%s (%d)", query_names[(int)*objp],
(int)*objp);
}
}
static void
-spans_state_str(objp, dest, len)
+spans_state_str(objp, dest)
spans_query_type *objp;
char *dest;
- int len;
{
static char *state_names[] = {
"SPANS_CONN_OPEN",
@@ -278,13 +266,14 @@ spans_state_str(objp, dest, len)
};
if (*objp < SPANS_CONN_OPEN || *objp > SPANS_CONN_CLOSED) {
- snprintf(dest, len, "Invalid (%d)", (int)*objp);
+ sprintf(dest, "Invalid (%d)", (int)*objp);
} else {
- snprintf(dest, len, "%s (%d)", state_names[(int)*objp],
+ sprintf(dest, "%s (%d)", state_names[(int)*objp],
(int)*objp);
}
}
+#ifdef LONGPRINT
static void
spans_print_version(objp)
@@ -362,7 +351,7 @@ spans_print_aal(objp)
{
char aal_str[80];
- spans_aal_str(objp, aal_str, sizeof(aal_str));
+ spans_aal_str(objp, aal_str);
printf("%sspans_aal %s\n", spans_indent, aal_str);
}
@@ -372,7 +361,7 @@ spans_print_result(objp)
{
char result_str[80];
- spans_result_str(objp, result_str, sizeof(result_str));
+ spans_result_str(objp, result_str);
printf("%sspans_result %s\n", spans_indent, result_str);
}
@@ -382,7 +371,7 @@ spans_print_msgtype(objp)
{
char msgtype_str[80];
- spans_msgtype_str(objp, msgtype_str, sizeof(msgtype_str));
+ spans_msgtype_str(objp, msgtype_str);
printf("%sspans_msgtype %s\n", spans_indent, msgtype_str);
}
@@ -722,8 +711,7 @@ spans_print_parm_query_req(objp)
printf("%sspans_parm_query_req\n", spans_indent);
inc_indent();
spans_print_atm_conn(&objp->qyreq_conn);
- spans_query_type_str(&objp->qyreq_type,
- query_type_str, sizeof(query_type_str));
+ spans_query_type_str(&objp->qyreq_type, query_type_str);
printf("%sqyreq_type %s\n", spans_indent, query_type_str);
dec_indent();
}
@@ -737,11 +725,9 @@ spans_print_parm_query_rsp(objp)
printf("%sspans_parm_query_rsp\n", spans_indent);
inc_indent();
spans_print_atm_conn(&objp->qyrsp_conn);
- spans_query_type_str(&objp->qyrsp_type,
- query_type_str, sizeof(query_type_str));
+ spans_query_type_str(&objp->qyrsp_type, query_type_str);
printf("%sqyrsp_type %s\n", spans_indent, query_type_str);
- spans_state_str(&objp->qyrsp_state,
- state_type_str, sizeof(state_type_str));
+ spans_state_str(&objp->qyrsp_state, state_type_str);
printf("%sqyrsp_state %s\n", spans_indent, state_type_str);
printf("%sqyrsp_data 0x%x\n", spans_indent,
objp->qyrsp_data);
@@ -885,7 +871,7 @@ spans_print_msgbody(objp)
spans_parm_rclose_rsp *rcrsp_p;
spans_parm_rclose_cnf *rccnf_p;
- spans_msgtype_str(&objp->mb_type, msgtype_str, sizeof(msgtype_str));
+ spans_msgtype_str(&objp->mb_type, msgtype_str);
printf("%s: ", msgtype_str);
switch (objp->mb_type) {
case SPANS_STAT_REQ:
@@ -897,7 +883,7 @@ spans_print_msgbody(objp)
strncpy(daddr, spans_addr_print(&stind_p->stind_es_addr),
sizeof(daddr));
strncpy(saddr, spans_addr_print(&stind_p->stind_sw_addr),
- sizeof(saddr));
+ sizeof(daddr));
printf("sw_epoch=0x%lx, es_addr=%s, sw_addr=0x%s",
stind_p->stind_sw_epoch,
daddr, saddr);
@@ -947,8 +933,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&oprsp_p->oprsp_conn.con_src),
sizeof(saddr));
- spans_result_str(&oprsp_p->oprsp_result, result_str,
- sizeof(result_str));
+ spans_result_str(&oprsp_p->oprsp_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d, vp.vc=%d.%d",
result_str, daddr, saddr,
oprsp_p->oprsp_conn.con_dsap,
@@ -962,8 +947,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&opcnf_p->opcnf_conn.con_src),
sizeof(saddr));
- spans_result_str(&opcnf_p->opcnf_result, result_str,
- sizeof(result_str));
+ spans_result_str(&opcnf_p->opcnf_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d, vp.vc=%d.%d",
result_str, daddr, saddr,
opcnf_p->opcnf_conn.con_dsap,
@@ -999,8 +983,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&clrsp_p->clrsp_conn.con_src),
sizeof(saddr));
- spans_result_str(&clrsp_p->clrsp_result, result_str,
- sizeof(result_str));
+ spans_result_str(&clrsp_p->clrsp_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
clrsp_p->clrsp_conn.con_dsap,
@@ -1012,8 +995,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&clcnf_p->clcnf_conn.con_src),
sizeof(saddr));
- spans_result_str(&clcnf_p->clcnf_result, result_str,
- sizeof(result_str));
+ spans_result_str(&clcnf_p->clcnf_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
clcnf_p->clcnf_conn.con_dsap,
@@ -1047,8 +1029,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&rcrsp_p->rcrsp_conn.con_src),
sizeof(saddr));
- spans_result_str(&rcrsp_p->rcrsp_result, result_str,
- sizeof(result_str));
+ spans_result_str(&rcrsp_p->rcrsp_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
rcrsp_p->rcrsp_conn.con_dsap,
@@ -1060,8 +1041,7 @@ spans_print_msgbody(objp)
sizeof(daddr));
strncpy(saddr, spans_addr_print(&rccnf_p->rccnf_conn.con_src),
sizeof(saddr));
- spans_result_str(&rccnf_p->rccnf_result, result_str,
- sizeof(result_str));
+ spans_result_str(&rccnf_p->rccnf_result, result_str);
printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d",
result_str, daddr, saddr,
rccnf_p->rccnf_conn.con_dsap,
@@ -1075,9 +1055,7 @@ void
spans_print_msg(objp)
spans_msg *objp;
{
-#ifdef LONGPRINT
spans_indent = INIT_INDENT;
-#endif
spans_print_msgbody(&objp->sm_body);
}
diff --git a/sys/netatm/spans/spans_proto.c b/sys/netatm/spans/spans_proto.c
index 2cd2f72262424..b0e0f1e44c1e1 100644
--- a/sys/netatm/spans/spans_proto.c
+++ b/sys/netatm/spans/spans_proto.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_proto.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: spans_proto.c,v 1.1 1998/09/15 08:23:03 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_proto.c,v 1.1 1998/09/15 08:23:03 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_proto.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* Internal functions
*/
diff --git a/sys/netatm/spans/spans_subr.c b/sys/netatm/spans/spans_subr.c
index b2a418c454b5f..a6e720f811c44 100644
--- a/sys/netatm/spans/spans_subr.c
+++ b/sys/netatm/spans/spans_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_subr.c,v 1.2 1998/09/17 09:35:00 phk Exp $
+ * @(#) $Id: spans_subr.c,v 1.1 1998/09/15 08:23:04 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_subr.c,v 1.1 1998/09/15 08:23:04 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_subr.c,v 1.2 1998/09/17 09:35:00 phk Exp $");
-#endif
-
/*
* Open a SPANS VCC
diff --git a/sys/netatm/spans/spans_util.c b/sys/netatm/spans/spans_util.c
index 904f176d2d564..f3f0235264f62 100644
--- a/sys/netatm/spans/spans_util.c
+++ b/sys/netatm/spans/spans_util.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: spans_util.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: spans_util.c,v 1.1 1998/09/15 08:23:04 phk Exp $
*
*/
@@ -35,15 +35,15 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: spans_util.c,v 1.1 1998/09/15 08:23:04 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include "spans_xdr.h"
#include <netatm/spans/spans_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: spans_util.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
#ifdef NOTDEF
/* XXX -- Remove all SAP checks? */
diff --git a/sys/netatm/uni/Makefile b/sys/netatm/uni/Makefile
new file mode 100644
index 0000000000000..5b769b4f0a0bc
--- /dev/null
+++ b/sys/netatm/uni/Makefile
@@ -0,0 +1,93 @@
+#
+#
+# ===================================
+# HARP | Host ATM Research Platform
+# ===================================
+#
+#
+# This Host ATM Research Platform ("HARP") file (the "Software") is
+# made available by Network Computing Services, Inc. ("NetworkCS")
+# "AS IS". NetworkCS does not provide maintenance, improvements or
+# support of any kind.
+#
+# NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
+# INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
+# SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
+# In no event shall NetworkCS be responsible for any damages, including
+# but not limited to consequential damages, arising from or relating to
+# any use of the Software or related support.
+#
+# Copyright 1994-1998 Network Computing Services, Inc.
+#
+# Copies of this Software may be made, however, the above copyright
+# notice must be reproduced on all copies.
+#
+# @(#) $Id: Makefile,v 1.6 1998/08/26 23:29:17 mks Exp $
+#
+#
+
+#
+# ATM Forum UNI Support
+# ---------------------
+#
+# Source directory Makefile
+#
+#
+
+DEFS=
+
+UNI_HDRS= uni.h
+UNI_SRCS= uni_load.c
+UNI_OBJS= uni_load.o
+
+SIG_HDRS= unisig.h unisig_decode.h unisig_mbuf.h \
+ unisig_msg.h unisig_print.h unisig_var.h
+SIG_SRCS= unisig_decode.c unisig_encode.c unisig_if.c \
+ unisig_mbuf.c unisig_msg.c \
+ unisig_print.c unisig_proto.c \
+ unisig_sigmgr_state.c unisig_subr.c \
+ unisig_util.c unisig_vc_state.c
+SIG_OBJS= unisig_decode.o unisig_encode.o unisig_if.o \
+ unisig_mbuf.o unisig_msg.o \
+ unisig_print.o unisig_proto.o \
+ unisig_sigmgr_state.o unisig_subr.o \
+ unisig_util.o unisig_vc_state.o
+
+SAAL_HDRS= sscop.h sscop_misc.h sscop_pdu.h sscop_var.h \
+ sscf_uni.h sscf_uni_var.h
+SAAL_SRCS= sscop.c sscop_lower.c sscop_pdu.c sscop_sigaa.c \
+ sscop_sigcpcs.c sscop_subr.c sscop_timer.c sscop_upper.c \
+ qsaal1_sigaa.c qsaal1_sigcpcs.c qsaal1_subr.c \
+ q2110_sigaa.c q2110_sigcpcs.c q2110_subr.c \
+ sscf_uni.c sscf_uni_lower.c sscf_uni_upper.c
+SAAL_OBJS= sscop.o sscop_lower.o sscop_pdu.o sscop_sigaa.o \
+ sscop_sigcpcs.o sscop_subr.o sscop_timer.o sscop_upper.o \
+ qsaal1_sigaa.o qsaal1_sigcpcs.o qsaal1_subr.o \
+ q2110_sigaa.o q2110_sigcpcs.o q2110_subr.o \
+ sscf_uni.o sscf_uni_lower.o sscf_uni_upper.o
+
+IP_HDRS= uniip_var.h
+IP_SRCS= uniip.c uniarp.c uniarp_cache.c uniarp_input.c \
+ uniarp_output.c uniarp_timer.c uniarp_vcm.c
+IP_OBJS= uniip.o uniarp.o uniarp_cache.o uniarp_input.o \
+ uniarp_output.o uniarp_timer.o uniarp_vcm.o
+
+HDRS= $(UNI_HDRS) $(SIG_HDRS) $(SAAL_HDRS) $(IP_HDRS)
+SRCS= $(UNI_SRCS) $(SIG_SRCS) $(SAAL_SRCS) $(IP_SRCS)
+OBJS= $(UNI_OBJS) $(SIG_OBJS) $(SAAL_OBJS) $(IP_OBJS)
+MOD= uni_mod.o
+
+OBJDIR= ../../`../../config/mkobjname -d`/uni
+
+all $(OBJS) $(MOD) config install clean depend lint load unload:
+ @if [ -d $(OBJDIR) ]; then \
+ echo "cd $(OBJDIR); $(MAKE) $@"; \
+ cd $(OBJDIR); \
+ $(MAKE) $(MFLAGS) DEFS='$(DEFS)' HDRS='$(HDRS)' SRCS='$(SRCS)' OBJS='$(OBJS)' $@; \
+ exit $$?; \
+ else \
+ echo "Object directory \"$(OBJDIR)\" does not exist."; \
+ exit 1; \
+ fi
+
diff --git a/sys/netatm/uni/q2110_sigaa.c b/sys/netatm/uni/q2110_sigaa.c
index 381356f6c7e81..357df710c2948 100644
--- a/sys/netatm/uni/q2110_sigaa.c
+++ b/sys/netatm/uni/q2110_sigaa.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: q2110_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: q2110_sigaa.c,v 1.6 1998/08/26 23:29:18 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: q2110_sigaa.c,v 1.6 1998/08/26 23:29:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: q2110_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/q2110_sigcpcs.c b/sys/netatm/uni/q2110_sigcpcs.c
index 7752fd04278e4..0fa5555a7ce9a 100644
--- a/sys/netatm/uni/q2110_sigcpcs.c
+++ b/sys/netatm/uni/q2110_sigcpcs.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: q2110_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: q2110_sigcpcs.c,v 1.7 1998/08/26 23:29:18 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: q2110_sigcpcs.c,v 1.7 1998/08/26 23:29:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: q2110_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/q2110_subr.c b/sys/netatm/uni/q2110_subr.c
index 32f3833aa1342..4c6036b8de2b2 100644
--- a/sys/netatm/uni/q2110_subr.c
+++ b/sys/netatm/uni/q2110_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: q2110_subr.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: q2110_subr.c,v 1.1 1998/04/07 23:15:20 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: q2110_subr.c,v 1.1 1998/04/07 23:15:20 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: q2110_subr.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Conditionally Clear Transmission Queues
diff --git a/sys/netatm/uni/qsaal1_sigaa.c b/sys/netatm/uni/qsaal1_sigaa.c
index 1788794c5b001..f3b00973f1e07 100644
--- a/sys/netatm/uni/qsaal1_sigaa.c
+++ b/sys/netatm/uni/qsaal1_sigaa.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: qsaal1_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: qsaal1_sigaa.c,v 1.7 1998/08/26 23:29:18 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: qsaal1_sigaa.c,v 1.7 1998/08/26 23:29:18 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: qsaal1_sigaa.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/qsaal1_sigcpcs.c b/sys/netatm/uni/qsaal1_sigcpcs.c
index 203e483e6a03e..1d6216555bb03 100644
--- a/sys/netatm/uni/qsaal1_sigcpcs.c
+++ b/sys/netatm/uni/qsaal1_sigcpcs.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: qsaal1_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $
+ * @(#) $Id: qsaal1_sigcpcs.c,v 1.7 1998/04/07 23:21:03 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: qsaal1_sigcpcs.c,v 1.7 1998/04/07 23:21:03 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: qsaal1_sigcpcs.c,v 1.1 1998/09/15 08:23:05 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/qsaal1_subr.c b/sys/netatm/uni/qsaal1_subr.c
index 9ad2468dc52ac..ed4b43cb3758d 100644
--- a/sys/netatm/uni/qsaal1_subr.c
+++ b/sys/netatm/uni/qsaal1_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: qsaal1_subr.c,v 1.1 1998/09/15 08:23:06 phk Exp $
+ * @(#) $Id: qsaal1_subr.c,v 1.6 1998/04/07 23:21:17 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: qsaal1_subr.c,v 1.6 1998/04/07 23:21:17 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: qsaal1_subr.c,v 1.1 1998/09/15 08:23:06 phk Exp $");
-#endif
-
/*
* Re-establish a new SSCOP Connection
diff --git a/sys/netatm/uni/sscf_uni.c b/sys/netatm/uni/sscf_uni.c
index b73452442346c..05825808c52cf 100644
--- a/sys/netatm/uni/sscf_uni.c
+++ b/sys/netatm/uni/sscf_uni.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscf_uni.c,v 1.3 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: sscf_uni.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscf_uni.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/sscf_uni.h>
#include <netatm/uni/sscf_uni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscf_uni.c,v 1.3 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Global variables
@@ -310,7 +310,7 @@ sscf_uni_pdu_print(uvp, m, msg)
struct vccb *vcp;
vcp = uvp->uv_connvc->cvc_vcc;
- snprintf(buf, sizeof(buf), "sscf_uni %s: vcc=(%d,%d)\n",
+ sprintf(buf, "sscf_uni %s: vcc=(%d,%d)\n",
msg, vcp->vc_vpi, vcp->vc_vci);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/uni/sscf_uni_lower.c b/sys/netatm/uni/sscf_uni_lower.c
index 56db85fd7de94..9639d96fa32fa 100644
--- a/sys/netatm/uni/sscf_uni_lower.c
+++ b/sys/netatm/uni/sscf_uni_lower.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscf_uni_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscf_uni_lower.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscf_uni_lower.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/sscf_uni.h>
#include <netatm/uni/sscf_uni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscf_uni_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local variables
diff --git a/sys/netatm/uni/sscf_uni_upper.c b/sys/netatm/uni/sscf_uni_upper.c
index 24a41f555be3e..a979260ac0b38 100644
--- a/sys/netatm/uni/sscf_uni_upper.c
+++ b/sys/netatm/uni/sscf_uni_upper.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscf_uni_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscf_uni_upper.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscf_uni_upper.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/sscf_uni.h>
#include <netatm/uni/sscf_uni_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscf_uni_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* SSCF_UNI Upper Stack Command Handler
diff --git a/sys/netatm/uni/sscop.c b/sys/netatm/uni/sscop.c
index bfd37bdac07bb..d4a2dfb07085d 100644
--- a/sys/netatm/uni/sscop.c
+++ b/sys/netatm/uni/sscop.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop.c,v 1.1 1998/09/15 08:23:06 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop.c,v 1.1 1998/09/15 08:23:06 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Global variables
@@ -205,6 +205,7 @@ sscop_stop()
*/
atm_release_pool(&sscop_pool);
+done:
return (err);
}
diff --git a/sys/netatm/uni/sscop_lower.c b/sys/netatm/uni/sscop_lower.c
index 3810f91123fd2..536ed0386dd3e 100644
--- a/sys/netatm/uni/sscop_lower.c
+++ b/sys/netatm/uni/sscop_lower.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_lower.c,v 1.1 1998/09/15 08:23:07 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_lower.c,v 1.1 1998/09/15 08:23:07 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_lower.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local variables
diff --git a/sys/netatm/uni/sscop_pdu.c b/sys/netatm/uni/sscop_pdu.c
index 03562841d8caa..b9aec03400097 100644
--- a/sys/netatm/uni/sscop_pdu.c
+++ b/sys/netatm/uni/sscop_pdu.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_pdu.c,v 1.2 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: sscop_pdu.c,v 1.6 1998/04/07 23:21:36 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_pdu.c,v 1.6 1998/04/07 23:21:36 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_pdu.c,v 1.2 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Local functions
*/
@@ -1231,8 +1231,7 @@ sscop_pdu_print(sop, m, msg)
struct vccb *vcp;
vcp = sop->so_connvc->cvc_vcc;
- snprintf(buf, sizeof(buf),
- "sscop %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
+ sprintf(buf, "sscop %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/uni/sscop_sigaa.c b/sys/netatm/uni/sscop_sigaa.c
index 6753982161398..8f347ce5ebe1e 100644
--- a/sys/netatm/uni/sscop_sigaa.c
+++ b/sys/netatm/uni/sscop_sigaa.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_sigaa.c,v 1.1 1998/09/15 08:23:07 phk Exp $
+ * @(#) $Id: sscop_sigaa.c,v 1.1 1998/04/07 23:15:11 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_sigaa.c,v 1.1 1998/04/07 23:15:11 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_sigaa.c,v 1.1 1998/09/15 08:23:07 phk Exp $");
-#endif
-
/*
* SSCOP_ESTABLISH_REQ / SOS_IDLE Command Processor
diff --git a/sys/netatm/uni/sscop_sigcpcs.c b/sys/netatm/uni/sscop_sigcpcs.c
index 6b1c477bbb01d..a9bf504d99c48 100644
--- a/sys/netatm/uni/sscop_sigcpcs.c
+++ b/sys/netatm/uni/sscop_sigcpcs.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_sigcpcs.c,v 1.1 1998/09/15 08:23:08 phk Exp $
+ * @(#) $Id: sscop_sigcpcs.c,v 1.2 1998/07/24 20:18:09 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_sigcpcs.c,v 1.2 1998/07/24 20:18:09 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_sigcpcs.c,v 1.1 1998/09/15 08:23:08 phk Exp $");
-#endif
-
/*
* No-op Processor
diff --git a/sys/netatm/uni/sscop_subr.c b/sys/netatm/uni/sscop_subr.c
index 16ad1395a243a..88656adb098ec 100644
--- a/sys/netatm/uni/sscop_subr.c
+++ b/sys/netatm/uni/sscop_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_subr.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_subr.c,v 1.1 1998/09/15 08:23:08 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_subr.c,v 1.1 1998/09/15 08:23:08 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_subr.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/sscop_timer.c b/sys/netatm/uni/sscop_timer.c
index 087ae79e96cd9..c66525b9f08e2 100644
--- a/sys/netatm/uni/sscop_timer.c
+++ b/sys/netatm/uni/sscop_timer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_timer.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_timer.c,v 1.1 1998/09/15 08:23:08 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_timer.c,v 1.1 1998/09/15 08:23:08 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_timer.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/sscop_upper.c b/sys/netatm/uni/sscop_upper.c
index f2ad1bd95c5e9..162b48cbd1ac3 100644
--- a/sys/netatm/uni/sscop_upper.c
+++ b/sys/netatm/uni/sscop_upper.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: sscop_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $
+ * @(#) $Id: sscop_upper.c,v 1.1 1998/09/15 08:23:08 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: sscop_upper.c,v 1.1 1998/09/15 08:23:08 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/sscop_pdu.h>
#include <netatm/uni/sscop_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: sscop_upper.c,v 1.2 1998/09/17 09:35:01 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/uni_load.c b/sys/netatm/uni/uni_load.c
index 7be1eba01a0c2..23e7ff586bdb8 100644
--- a/sys/netatm/uni/uni_load.c
+++ b/sys/netatm/uni/uni_load.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uni_load.c,v 1.1 1998/09/15 08:23:09 phk Exp $
+ * @(#) $Id: uni_load.c,v 1.6 1997/05/06 22:20:43 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uni_load.c,v 1.6 1997/05/06 22:20:43 mks Exp $";
+#endif
+
#ifndef ATM_UNI_MODULE
#include "opt_atm.h"
#endif
@@ -43,10 +47,6 @@
#include <netatm/uni/uni.h>
-#ifndef lint
-__RCSID("@(#) $Id: uni_load.c,v 1.1 1998/09/15 08:23:09 phk Exp $");
-#endif
-
/*
* External functions
*/
diff --git a/sys/netatm/uni/uniarp.c b/sys/netatm/uni/uniarp.c
index 2d6006f802b3d..e0448a8a8c11c 100644
--- a/sys/netatm/uni/uniarp.c
+++ b/sys/netatm/uni/uniarp.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp.c,v 1.4 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: uniarp.c,v 1.1 1998/09/15 08:23:09 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp.c,v 1.1 1998/09/15 08:23:09 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp.c,v 1.4 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -225,6 +225,7 @@ void
uniarp_ipdact(uip)
struct uniip *uip;
{
+ struct ip_nif *inp = uip->uip_ipnif;
struct uniarp *uap, *unext;
int i;
@@ -1022,8 +1023,7 @@ uniarp_ioctl(code, data, arg1)
AF_INET;
SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr =
uap->ua_dstip.s_addr;
- (void) snprintf(aar.aap_intf,
- sizeof(aar.aap_intf), "%s%d",
+ (void) sprintf(aar.aap_intf, "%s%d",
nip->nif_if.if_name,
nip->nif_if.if_unit);
aar.aap_flags = uap->ua_flags;
@@ -1077,8 +1077,7 @@ uniarp_ioctl(code, data, arg1)
*/
SATOSIN(&aar.aap_arp_addr)->sin_family = AF_INET;
SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr = 0;
- (void) snprintf(aar.aap_intf,
- sizeof(aar.aap_intf), "%s%d",
+ (void) sprintf(aar.aap_intf, "%s%d",
nip->nif_if.if_name, nip->nif_if.if_unit);
aar.aap_flags = 0;
aar.aap_origin = uap->ua_origin;
@@ -1137,14 +1136,14 @@ updbuf:
* Get ARP server information
*/
aip = (struct atminfreq *)data;
- nip = (struct atm_nif *)arg1;
buf_addr = aip->air_buf_addr;
buf_len = aip->air_buf_len;
for (uip = uniip_head; uip; uip = uip->uip_next) {
- if (uip->uip_ipnif->inf_nif != nip)
+ if ((arg1 != NULL) &&
+ (uip->uip_ipnif->inf_nif != (struct atm_nif *)arg1))
continue;
/*
@@ -1158,8 +1157,8 @@ updbuf:
/*
* Fill in info to be returned
*/
- (void) snprintf(asr.asp_intf,
- sizeof(asr.asp_intf), "%s%d",
+ nip = uip->uip_ipnif->inf_nif;
+ (void) sprintf(asr.asp_intf, "%s%d",
nip->nif_if.if_name, nip->nif_if.if_unit);
asr.asp_state = uip->uip_arpstate;
if (uip->uip_arpstate == UIAS_SERVER_ACTIVE) {
diff --git a/sys/netatm/uni/uniarp_cache.c b/sys/netatm/uni/uniarp_cache.c
index 88a26a59c76b5..6c9537e722c67 100644
--- a/sys/netatm/uni/uniarp_cache.c
+++ b/sys/netatm/uni/uniarp_cache.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_cache.c,v 1.2 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: uniarp_cache.c,v 1.8 1998/08/26 23:29:20 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_cache.c,v 1.8 1998/08/26 23:29:20 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_cache.c,v 1.2 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Add data to the arp table cache
@@ -79,7 +79,6 @@ uniarp_cache_svc(uip, ip, atm, atmsub, origin)
#ifdef DIAGNOSTIC
strncpy(abuf, unisig_addr_print(atmsub), sizeof(abuf));
- abuf[sizeof(abuf) - 1] = 0;
ATM_DEBUG4("cache_svc: ip=%s, atm=(%s,%s), origin=%d\n",
inet_ntoa(*ip), unisig_addr_print(atm), abuf, origin);
#endif
@@ -157,7 +156,6 @@ uniarp_cache_svc(uip, ip, atm, atmsub, origin)
if (ipuap->ua_ivp != NULL) {
strncpy(abuf, unisig_addr_print(atmsub),
sizeof(abuf));
- abuf[sizeof(abuf) - 1] = 0;
log(LOG_WARNING,
"uniarp: duplicate IP address %s from %s,%s\n",
inet_ntoa(*ip), unisig_addr_print(atm),
@@ -187,7 +185,6 @@ uniarp_cache_svc(uip, ip, atm, atmsub, origin)
}
strncpy(abuf, unisig_addr_print(atmsub), sizeof(abuf));
- abuf[sizeof(abuf) - 1] = 0;
log(LOG_WARNING,
"uniarp: ATM address for %s changed to %s,%s\n",
inet_ntoa(*ip), unisig_addr_print(atm), abuf);
@@ -331,7 +328,6 @@ uniarp_cache_pvc(ivp, ip, atm, atmsub)
vci = ivp->iv_conn->co_connvc->cvc_vcc->vc_vci;
}
strncpy(buf, unisig_addr_print(atmsub), sizeof(buf));
- buf[sizeof(buf) - 1] = 0;
ATM_DEBUG5("cache_pvc: vcc=(%d,%d), ip=%s, atm=(%s,%s)\n",
vpi, vci, inet_ntoa(*ip), unisig_addr_print(atm), buf);
#endif
diff --git a/sys/netatm/uni/uniarp_input.c b/sys/netatm/uni/uniarp_input.c
index b621ac35c5410..cceeaa92c87f7 100644
--- a/sys/netatm/uni/uniarp_input.c
+++ b/sys/netatm/uni/uniarp_input.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_input.c,v 1.2 1998/10/31 20:07:00 phk Exp $
+ * @(#) $Id: uniarp_input.c,v 1.10 1998/07/13 00:04:32 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_input.c,v 1.10 1998/07/13 00:04:32 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_input.c,v 1.2 1998/10/31 20:07:00 phk Exp $");
-#endif
-
/*
* Local functions
@@ -735,6 +735,7 @@ proc_inarp_rsp(ivp, m)
struct atm_nif *nip;
struct siginst *sgp;
struct uniip *uip;
+ struct uniarp *uap;
struct in_addr myip;
int s = splnet();
@@ -846,8 +847,7 @@ uniarp_pdu_print(ivp, m, msg)
struct vccb *vcp;
vcp = ivp->iv_conn->co_connvc->cvc_vcc;
- snprintf(buf, sizeof(buf),
- "uniarp %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
+ sprintf(buf, "uniarp %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci);
atm_pdu_print(m, buf);
}
diff --git a/sys/netatm/uni/uniarp_output.c b/sys/netatm/uni/uniarp_output.c
index 4f7a16388d09e..81fab93219c74 100644
--- a/sys/netatm/uni/uniarp_output.c
+++ b/sys/netatm/uni/uniarp_output.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_output.c,v 1.1 1998/09/15 08:23:09 phk Exp $
+ * @(#) $Id: uniarp_output.c,v 1.7 1998/06/29 22:15:41 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_output.c,v 1.7 1998/06/29 22:15:41 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_output.c,v 1.1 1998/09/15 08:23:09 phk Exp $");
-#endif
-
/*
* Issue an ATMARP Request PDU
diff --git a/sys/netatm/uni/uniarp_timer.c b/sys/netatm/uni/uniarp_timer.c
index b65ca568cdd8e..1f002023e5449 100644
--- a/sys/netatm/uni/uniarp_timer.c
+++ b/sys/netatm/uni/uniarp_timer.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_timer.c,v 1.1 1998/09/15 08:23:10 phk Exp $
+ * @(#) $Id: uniarp_timer.c,v 1.8 1998/06/29 22:44:31 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_timer.c,v 1.8 1998/06/29 22:44:31 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_timer.c,v 1.1 1998/09/15 08:23:10 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/uniarp_vcm.c b/sys/netatm/uni/uniarp_vcm.c
index e2e9c2d289737..338d2b50264b3 100644
--- a/sys/netatm/uni/uniarp_vcm.c
+++ b/sys/netatm/uni/uniarp_vcm.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniarp_vcm.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: uniarp_vcm.c,v 1.1 1998/09/15 08:23:10 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniarp_vcm.c,v 1.1 1998/09/15 08:23:10 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniarp_vcm.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Local variables
diff --git a/sys/netatm/uni/uniip.c b/sys/netatm/uni/uniip.c
index dd7bc3e3f807d..0039585146713 100644
--- a/sys/netatm/uni/uniip.c
+++ b/sys/netatm/uni/uniip.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: uniip.c,v 1.1 1998/09/15 08:23:10 phk Exp $
+ * @(#) $Id: uniip.c,v 1.6 1998/05/18 19:18:42 mks Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: uniip.c,v 1.6 1998/05/18 19:18:42 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
#include <netatm/uni/uniip_var.h>
-#ifndef lint
-__RCSID("@(#) $Id: uniip.c,v 1.1 1998/09/15 08:23:10 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/unisig_decode.c b/sys/netatm/uni/unisig_decode.c
index 08fe4b728a7c4..d7d3cd4be92c8 100644
--- a/sys/netatm/uni/unisig_decode.c
+++ b/sys/netatm/uni/unisig_decode.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_decode.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_decode.c,v 1.1 1998/09/15 08:23:10 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_decode.c,v 1.1 1998/09/15 08:23:10 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_decode.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_decode.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
#define ALLOC_IE(ie) \
(ie) = (struct ie_generic *) atm_allocate(&unisig_iepool); \
if (!ie) \
diff --git a/sys/netatm/uni/unisig_encode.c b/sys/netatm/uni/unisig_encode.c
index 34a039aec1596..a142a33e43ab4 100644
--- a/sys/netatm/uni/unisig_encode.c
+++ b/sys/netatm/uni/unisig_encode.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_encode.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_encode.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_encode.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_decode.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_encode.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Local functions
diff --git a/sys/netatm/uni/unisig_if.c b/sys/netatm/uni/unisig_if.c
index 0401154fa8031..e52f650a35365 100644
--- a/sys/netatm/uni/unisig_if.c
+++ b/sys/netatm/uni/unisig_if.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_if.c,v 1.4 1998/12/04 22:54:53 archie Exp $
+ * @(#) $Id: unisig_if.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_if.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/ipatm/ipatm_var.h>
@@ -46,10 +50,6 @@
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_if.c,v 1.4 1998/12/04 22:54:53 archie Exp $");
-#endif
-
/*
* Global variables
@@ -863,7 +863,7 @@ unisig_ioctl(code, data, arg1)
/*
* Schedule VCC termination
*/
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
T_ATM_CAUSE_UNSPECIFIED_NORMAL);
err = unisig_abort((struct vccb *)uvp);
break;
@@ -894,8 +894,7 @@ unisig_ioctl(code, data, arg1)
/*
* Fill out the response struct for the VCC
*/
- (void) snprintf(rsp.avp_intf,
- sizeof(rsp.avp_intf), "%s%d",
+ (void) sprintf(rsp.avp_intf, "%s%d",
usp->us_pif->pif_name,
usp->us_pif->pif_unit);
rsp.avp_vpi = uvp->uv_vpi;
diff --git a/sys/netatm/uni/unisig_mbuf.c b/sys/netatm/uni/unisig_mbuf.c
index b96a636a4be8e..c64ee9a85fac7 100644
--- a/sys/netatm/uni/unisig_mbuf.c
+++ b/sys/netatm/uni/unisig_mbuf.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_mbuf.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_mbuf.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_mbuf.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_mbuf.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Initialize a unisig formatting structure
diff --git a/sys/netatm/uni/unisig_msg.c b/sys/netatm/uni/unisig_msg.c
index f52f46e8f446c..4e61cf48571d8 100644
--- a/sys/netatm/uni/unisig_msg.c
+++ b/sys/netatm/uni/unisig_msg.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_msg.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_msg.c,v 1.1 1998/09/15 08:23:11 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_msg.c,v 1.1 1998/09/15 08:23:11 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_print.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_msg.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Local functions
@@ -68,7 +68,8 @@ static int unisig_print_msg = 0;
*
* Arguments:
* iep pointer to a cause IE
- * aap pointer to attribute block
+ * msg pointer to message
+ * cause cause code for the error
*
* Returns:
* 0 message sent OK
diff --git a/sys/netatm/uni/unisig_print.c b/sys/netatm/uni/unisig_print.c
index 93133cad3d6e1..f335ce45a7b37 100644
--- a/sys/netatm/uni/unisig_print.c
+++ b/sys/netatm/uni/unisig_print.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_print.c,v 1.1 1998/09/15 08:23:12 phk Exp $
+ * @(#) $Id: unisig_print.c,v 1.9 1998/08/26 23:29:23 mks Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_print.c,v 1.9 1998/08/26 23:29:23 mks Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_msg.h>
#include <netatm/uni/unisig_print.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_print.c,v 1.1 1998/09/15 08:23:12 phk Exp $");
-#endif
-
/*
* Local declarations
diff --git a/sys/netatm/uni/unisig_proto.c b/sys/netatm/uni/unisig_proto.c
index 8a3daac6753a8..bbad9e64ff858 100644
--- a/sys/netatm/uni/unisig_proto.c
+++ b/sys/netatm/uni/unisig_proto.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_proto.c,v 1.2 1998/09/17 09:35:02 phk Exp $
+ * @(#) $Id: unisig_proto.c,v 1.1 1998/09/15 08:23:12 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_proto.c,v 1.1 1998/09/15 08:23:12 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -42,10 +46,6 @@
#include <netatm/uni/unisig_msg.h>
#include <netatm/uni/unisig_mbuf.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_proto.c,v 1.2 1998/09/17 09:35:02 phk Exp $");
-#endif
-
/*
* Process a UNISIG timeout
diff --git a/sys/netatm/uni/unisig_sigmgr_state.c b/sys/netatm/uni/unisig_sigmgr_state.c
index e2213bf2ec6ac..0439d1c758883 100644
--- a/sys/netatm/uni/unisig_sigmgr_state.c
+++ b/sys/netatm/uni/unisig_sigmgr_state.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_sigmgr_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_sigmgr_state.c,v 1.1 1998/09/15 08:23:12 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_sigmgr_state.c,v 1.1 1998/09/15 08:23:12 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/uni.h>
@@ -46,10 +50,6 @@
#include <netatm/uni/sscf_uni.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_sigmgr_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Local functions
@@ -817,6 +817,11 @@ unisig_sigmgr_act14(usp, m)
}
/*
+ * Set the signalling manager state
+ */
+ usp->us_state = UNISIG_DETACH;
+
+ /*
* Close the signalling channel
*/
if (usp->us_conn) {
@@ -844,14 +849,12 @@ unisig_sigmgr_act14(usp, m)
UNLINK((struct siginst *)usp, struct siginst,
smp->sm_prinst, si_next);
KM_FREE(usp, sizeof(struct unisig), M_DEVBUF);
- } else {
- /*
- * Otherwise, set new signalling manager state and
- * wait for protocol instance to be freed during
- * unisig_free processing for the last queued VCC
- */
- usp->us_state = UNISIG_DETACH;
}
+ /*
+ * Otherwise, wait for protocol instance to be freed
+ * during unisig_free processing for the last queued VCC
+ */
+
return (0);
}
diff --git a/sys/netatm/uni/unisig_subr.c b/sys/netatm/uni/unisig_subr.c
index 888cedcf99ab5..52326bc2bc460 100644
--- a/sys/netatm/uni/unisig_subr.c
+++ b/sys/netatm/uni/unisig_subr.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_subr.c,v 1.4 1998/10/31 20:08:03 phk Exp $
+ * @(#) $Id: unisig_subr.c,v 1.1 1998/09/15 08:23:12 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_subr.c,v 1.1 1998/09/15 08:23:12 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_subr.c,v 1.4 1998/10/31 20:08:03 phk Exp $");
-#endif
-
/*
* External variables
@@ -73,7 +73,7 @@ extern struct ie_epst ie_epst_absent;
/*
- * Set a User Location cause code in an ATM attribute block
+ * Set a cause code in an ATM attribute block
*
* Arguments:
* aap pointer to attribute block
@@ -84,13 +84,10 @@ extern struct ie_epst ie_epst_absent;
*
*/
void
-unisig_cause_attr_from_user(aap, cause)
+unisig_set_cause_attr(aap, cause)
Atm_attributes *aap;
int cause;
{
- if (cause == T_ATM_ABSENT)
- return;
-
/*
* Set the fields in the attribute block
*/
@@ -104,35 +101,6 @@ unisig_cause_attr_from_user(aap, cause)
/*
- * Set a cause code in an ATM attribute block from a Cause IE
- *
- * Arguments:
- * aap pointer to attribute block
- * iep pointer to Cause IE
- *
- * Returns:
- * none
- *
- */
-void
-unisig_cause_attr_from_ie(aap, iep)
- Atm_attributes *aap;
- struct ie_generic *iep;
-{
- /*
- * Set the fields in the attribute block
- */
- aap->cause.tag = T_ATM_PRESENT;
- aap->cause.v.coding_standard = iep->ie_coding;
- aap->cause.v.location = iep->ie_caus_loc;
- aap->cause.v.cause_value = iep->ie_caus_cause;
- KM_ZERO(aap->cause.v.diagnostics, sizeof(aap->cause.v.diagnostics));
- KM_COPY(iep->ie_caus_diagnostic, aap->cause.v.diagnostics,
- MIN(sizeof(aap->cause.v.diagnostics), iep->ie_caus_diag_len));
-}
-
-
-/*
* Open a UNI VCC
*
* Called when a user wants to open a VC. This function will construct
@@ -434,7 +402,7 @@ unisig_clear_vcc(usp, uvp, cause)
outstate == UNI_SSCF_RECOV ||
outstate == UNI_PVC_ACT_DOWN ||
outstate == UNI_PVC_ACTIVE) {
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, cause);
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr, cause);
atm_cm_cleared(uvp->uv_connvc);
}
@@ -1080,8 +1048,6 @@ unisig_set_attrs(usp, msg, ap)
ap->blli.v.layer_2_protocol.ID.simple_ID;
break;
case T_ATM_USER_ID:
- msg->msg_ie_blli->ie_blli_l2_id =
- UNI_IE_BLLI_L2P_USER;
msg->msg_ie_blli->ie_blli_l2_user_proto =
ap->blli.v.layer_2_protocol.ID.user_defined_ID;
break;
diff --git a/sys/netatm/uni/unisig_util.c b/sys/netatm/uni/unisig_util.c
index a3a2ab2ba3cbf..d7a64f6b17e5d 100644
--- a/sys/netatm/uni/unisig_util.c
+++ b/sys/netatm/uni/unisig_util.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_util.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_util.c,v 1.1 1998/09/15 08:23:13 phk Exp $
*
*/
@@ -35,16 +35,16 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_util.c,v 1.1 1998/09/15 08:23:13 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
#include <netatm/uni/unisig_var.h>
#include <netatm/uni/unisig_msg.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_util.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Free a UNISIG signalling message
@@ -303,8 +303,7 @@ unisig_addr_print(p)
* two-digit hex representation of the
* NSAP byte in the output buffer
*/
- snprintf(t_buff, sizeof(t_buff),
- "%x", *cp + 512);
+ sprintf(t_buff, "%x", *cp + 512);
strcpy(op, &t_buff[strlen(t_buff)-2]);
op++; op++;
cp++;
@@ -326,8 +325,7 @@ unisig_addr_print(p)
* Print the IA5 characters of the E.164 address
*/
for(i=0; i<p->address_length; i++) {
- snprintf(strbuff + strlen(strbuff),
- sizeof(strbuff) - strlen(strbuff), "%c",
+ sprintf(&strbuff[strlen(strbuff)], "%c",
((Atm_addr_e164 *)p->address)->aae_addr[i]);
}
break;
@@ -348,7 +346,7 @@ unisig_addr_print(p)
/*
* Print the address as two words xxxxx.yyyyyyyy
*/
- snprintf(strbuff, sizeof(strbuff), "%x.%x", u1.w, u2.w);
+ sprintf(strbuff, "%x.%x", u1.w, u2.w);
break;
case T_ATM_ABSENT:
diff --git a/sys/netatm/uni/unisig_var.h b/sys/netatm/uni/unisig_var.h
index b8d422930250a..1e3d01a7748bb 100644
--- a/sys/netatm/uni/unisig_var.h
+++ b/sys/netatm/uni/unisig_var.h
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_var.h,v 1.1 1998/09/15 08:23:13 phk Exp $
+ * @(#) $Id: unisig_var.h,v 1.12 1998/07/24 20:24:34 mks Exp $
*
*/
@@ -276,9 +276,7 @@ int unisig_sigmgr_state __P((struct unisig *, int,
KBuffer *));
/* unisig_subr.c */
-void unisig_cause_attr_from_user __P((Atm_attributes *, int));
-void unisig_cause_attr_from_ie __P((Atm_attributes *,
- struct ie_generic *));
+void unisig_set_cause_attr __P((Atm_attributes *, int));
int unisig_open_vcc __P((struct unisig *, Atm_connvc *));
int unisig_close_vcc __P((struct unisig *,
struct unisig_vccb *));
diff --git a/sys/netatm/uni/unisig_vc_state.c b/sys/netatm/uni/unisig_vc_state.c
index 84f995e9cf31b..e52515d3d798a 100644
--- a/sys/netatm/uni/unisig_vc_state.c
+++ b/sys/netatm/uni/unisig_vc_state.c
@@ -23,7 +23,7 @@
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
- * @(#) $Id: unisig_vc_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $
+ * @(#) $Id: unisig_vc_state.c,v 1.1 1998/09/15 08:23:13 phk Exp $
*
*/
@@ -35,6 +35,10 @@
*
*/
+#ifndef lint
+static char *RCSid = "@(#) $Id: unisig_vc_state.c,v 1.1 1998/09/15 08:23:13 phk Exp $";
+#endif
+
#include <netatm/kern_include.h>
#include <netatm/uni/unisig.h>
@@ -43,10 +47,6 @@
#include <netatm/uni/unisig_mbuf.h>
#include <netatm/uni/unisig_decode.h>
-#ifndef lint
-__RCSID("@(#) $Id: unisig_vc_state.c,v 1.3 1998/10/31 20:07:01 phk Exp $");
-#endif
-
/*
* Local functions
@@ -380,22 +380,13 @@ unisig_vc_act03(usp, uvp, msg)
struct unisig_vccb *uvp;
struct unisig_msg *msg;
{
- int rc, cause;
-
- /*
- * Set cause code
- */
- if ((msg != NULL) && (msg->msg_ie_caus != NULL)) {
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
- cause = T_ATM_ABSENT;
- } else
- cause = T_ATM_CAUSE_DESTINATION_OUT_OF_ORDER;
+ int rc;
/*
* Clear the VCCB
*/
- rc = unisig_clear_vcc(usp, uvp, cause);
+ rc = unisig_clear_vcc(usp, uvp,
+ T_ATM_CAUSE_DESTINATION_OUT_OF_ORDER);
return(rc);
}
@@ -822,11 +813,7 @@ unisig_vc_act07(usp, uvp, msg)
/*
* Notify the user
*/
- if ((msg != NULL) && (msg->msg_ie_caus != NULL))
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
- else
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
T_ATM_CAUSE_NORMAL_CALL_CLEARING);
atm_cm_cleared(uvp->uv_connvc);
@@ -900,6 +887,18 @@ unisig_vc_act08(usp, uvp, msg)
}
/*
+ * See if we can handle the specified encapsulation
+ */
+ if (msg->msg_ie_blli->ie_blli_l2_id != UNI_IE_BLLI_L2P_LLC &&
+ (msg->msg_ie_blli->ie_blli_l2_id != 0 ||
+ msg->msg_ie_blli->ie_blli_l3_id !=
+ UNI_IE_BLLI_L3P_ISO9577)) {
+ cause = UNI_IE_CAUS_UNAVAIL;
+ ATM_DEBUG0("unisig_vc_act08: bad encapsulation\n");
+ goto response08;
+ }
+
+ /*
* See if we recognize the specified AAL
*/
if (msg->msg_ie_aalp->ie_aalp_aal_type != UNI_IE_AALP_AT_AAL3 &&
@@ -1152,20 +1151,13 @@ unisig_vc_act11(usp, uvp, msg)
struct unisig_vccb *uvp;
struct unisig_msg *msg;
{
- int rc, cause;
-
- /*
- * Send generic cause code if one is not already set
- */
- if (uvp->uv_connvc->cvc_attr.cause.tag == T_ATM_PRESENT)
- cause = T_ATM_ABSENT;
- else
- cause = T_ATM_CAUSE_CALL_REJECTED;
+ int rc;
/*
* Send a RELEASE COMPLETE message
*/
- rc = unisig_send_release_complete(usp, uvp, msg, cause);
+ rc = unisig_send_release_complete(usp, uvp, msg,
+ UNI_IE_CAUS_REJECT);
/*
* Clear the call VCCB
@@ -1214,7 +1206,7 @@ unisig_vc_act12(usp, uvp, msg)
/*
* Send the RELEASE message
*/
- rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)NULL,
+ rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)0,
T_ATM_ABSENT);
return(rc);
@@ -1263,9 +1255,8 @@ unisig_vc_act13(usp, uvp, msg)
/*
* Notify the user that the call is now closed
*/
- if (msg->msg_ie_caus != NULL)
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
atm_cm_cleared(uvp->uv_connvc);
return(0);
@@ -1404,12 +1395,8 @@ unisig_vc_act15(usp, uvp, msg)
/*
* Notify the user that the call is cleared
*/
- if (msg->msg_ie_caus != NULL)
- unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr,
- msg->msg_ie_caus);
- else
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
- T_ATM_CAUSE_UNSPECIFIED_NORMAL);
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
atm_cm_cleared(uvp->uv_connvc);
return(rc);
@@ -1448,7 +1435,8 @@ unisig_vc_act16(usp, uvp, msg)
/*
* Clear the VCCB
*/
- rc = unisig_clear_vcc(usp, uvp, T_ATM_ABSENT);
+ rc = unisig_clear_vcc(usp, uvp,
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
return(rc);
}
@@ -1684,7 +1672,7 @@ unisig_vc_act21(usp, uvp, msg)
return(0);
}
rc = unisig_clear_vcc(usp, uvp,
- T_ATM_CAUSE_MESSAGE_INCOMPATIBLE_WITH_CALL_STATE);
+ T_ATM_CAUSE_NORMAL_CALL_CLEARING);
}
/*
@@ -1700,7 +1688,8 @@ unisig_vc_act21(usp, uvp, msg)
cause,
msg->msg_ie_caus->ie_caus_diagnostic[0]);
if (uvp) {
- (void)unisig_clear_vcc(usp, uvp, cause);
+ (void)unisig_clear_vcc(usp, uvp,
+ T_ATM_CAUSE_INVALID_INFO_ELEMENT_CONTENTS);
}
}
@@ -1969,10 +1958,8 @@ unisig_vc_act26(usp, uvp, msg)
/*
* Notify the user
*/
- if (uvp->uv_connvc->cvc_attr.cause.tag != T_ATM_PRESENT)
- unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr,
+ unisig_set_cause_attr(&uvp->uv_connvc->cvc_attr,
T_ATM_CAUSE_NORMAL_CALL_CLEARING);
-
atm_cm_cleared(uvp->uv_connvc);
return(0);
diff --git a/sys/netinet/fil.c b/sys/netinet/fil.c
index f91ee3dec08bd..d634bbb746550 100644
--- a/sys/netinet/fil.c
+++ b/sys/netinet/fil.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-1996 Darren Reed";
-static const char rcsid[] = "@(#)$Id: fil.c,v 1.3 1998/06/20 18:37:49 peter Exp $";
+static const char rcsid[] = "@(#)$Id: fil.c,v 1.2 1998/03/21 11:33:54 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -153,7 +153,7 @@ static int frflushlist __P((int, int, int *, frentry_t *, frentry_t **));
/*
* bit values for identifying presence of individual IP options
*/
-static struct optlist ipopts[20] = {
+struct optlist ipopts[20] = {
{ IPOPT_NOP, 0x000001 },
{ IPOPT_RR, 0x000002 },
{ IPOPT_ZSU, 0x000004 },
@@ -179,7 +179,7 @@ static struct optlist ipopts[20] = {
/*
* bit values for identifying presence of individual IP security options
*/
-static struct optlist secopt[8] = {
+struct optlist secopt[8] = {
{ IPSO_CLASS_RES4, 0x01 },
{ IPSO_CLASS_TOPS, 0x02 },
{ IPSO_CLASS_SECR, 0x04 },
@@ -1098,7 +1098,7 @@ nodata:
* SUCH DAMAGE.
*
* @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $Id: fil.c,v 1.3 1998/06/20 18:37:49 peter Exp $
+ * $Id: fil.c,v 1.2 1998/03/21 11:33:54 peter Exp $
*/
/*
* Copy data from an mbuf chain starting "off" bytes from the beginning,
diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h
index 7ccbe4b31ef2e..13b778e159ee1 100644
--- a/sys/netinet/icmp_var.h
+++ b/sys/netinet/icmp_var.h
@@ -31,16 +31,12 @@
* SUCH DAMAGE.
*
* @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
- * $Id: icmp_var.h,v 1.11 1998/12/04 03:49:18 dillon Exp $
+ * $Id: icmp_var.h,v 1.8 1997/08/25 16:29:25 wollman Exp $
*/
#ifndef _NETINET_ICMP_VAR_H_
#define _NETINET_ICMP_VAR_H_
-#ifdef KERNEL
-#include "opt_icmp_bandlim.h" /* for ICMP_BANDLIM */
-#endif
-
/*
* Variables related to this implementation
* of the internet control message protocol.
@@ -67,20 +63,12 @@ struct icmpstat {
*/
#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
#define ICMPCTL_STATS 2 /* statistics (read-only) */
-#define ICMPCTL_ICMPLIM 3
-#define ICMPCTL_MAXID 4
+#define ICMPCTL_MAXID 3
#define ICMPCTL_NAMES { \
{ 0, 0 }, \
{ "maskrepl", CTLTYPE_INT }, \
{ "stats", CTLTYPE_STRUCT }, \
- { "icmplim", CTLTYPE_INT }, \
}
-#ifdef KERNEL
-#ifdef ICMP_BANDLIM
-extern int badport_bandlim __P((int));
-#endif
-#endif
-
#endif
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 4f57f64b2badc..ac8d86db643a1 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_ether.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ether.c,v 1.51 1999/01/18 01:54:36 fenner Exp $
+ * $Id: if_ether.c,v 1.47 1998/06/12 03:48:14 julian Exp $
*/
/*
@@ -41,7 +41,6 @@
*/
#include "opt_inet.h"
-#include "opt_bdg.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -327,7 +326,7 @@ arpresolve(ac, rt, m, dst, desten, rt0)
register u_char *desten;
struct rtentry *rt0;
{
- register struct llinfo_arp *la = 0;
+ register struct llinfo_arp *la;
struct sockaddr_dl *sdl;
if (m->m_flags & M_BCAST) { /* broadcast */
@@ -340,7 +339,7 @@ arpresolve(ac, rt, m, dst, desten, rt0)
}
if (rt)
la = (struct llinfo_arp *)rt->rt_llinfo;
- if (la == 0) {
+ else {
la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0);
if (la)
rt = la->la_rt;
@@ -462,16 +461,7 @@ in_arpinput(m)
(void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
(void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next)
-#ifdef BRIDGE
- /*
- * For a bridge, we want to check the address irrespective
- * of the receive interface. (This will change slightly
- * when we have clusters of interfaces).
- */
- {
-#else
if (ia->ia_ifp == &ac->ac_if) {
-#endif
maybe_ia = ia;
if ((itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) ||
(isaddr.s_addr == ia->ia_addr.sin_addr.s_addr))
@@ -504,7 +494,6 @@ in_arpinput(m)
}
la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
-#ifndef BRIDGE /* the following is not an error when doing bridging */
if (rt->rt_ifp != &ac->ac_if) {
log(LOG_ERR, "arp: %s is on %s%d but got reply from %6D on %s%d\n",
inet_ntoa(isaddr),
@@ -513,7 +502,6 @@ in_arpinput(m)
ac->ac_if.if_name, ac->ac_if.if_unit);
goto reply;
}
-#endif
if (sdl->sdl_alen &&
bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
if (rt->rt_expire)
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index c1c90c0416428..8a4bd8577c6fe 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)igmp.c 8.1 (Berkeley) 7/19/93
- * $Id: igmp.c,v 1.26 1998/12/12 21:45:49 dillon Exp $
+ * $Id: igmp.c,v 1.24 1997/10/11 18:31:31 phk Exp $
*/
/*
@@ -69,7 +69,7 @@
#include <netinet/igmp.h>
#include <netinet/igmp_var.h>
-static MALLOC_DEFINE(M_IGMP, "igmp", "igmp state");
+static MALLOC_DEFINE(M_MRTABLE, "mrt", "multicast routing tables");
static struct router_info *
find_rti __P((struct ifnet *ifp));
@@ -133,7 +133,7 @@ find_rti(ifp)
}
rti = rti->rti_next;
}
- MALLOC(rti, struct router_info *, sizeof *rti, M_IGMP, M_NOWAIT);
+ MALLOC(rti, struct router_info *, sizeof *rti, M_MRTABLE, M_NOWAIT);
rti->rti_ifp = ifp;
rti->rti_type = IGMP_V2_ROUTER;
rti->rti_time = 0;
@@ -198,8 +198,6 @@ igmp_input(m, iphlen)
ip = mtod(m, struct ip *);
timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
- if (timer == 0)
- timer = 1;
rti = find_rti(ifp);
/*
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 9fe7095db7208..45121066d1fab 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.c 8.4 (Berkeley) 1/9/95
- * $Id: in.c,v 1.38 1998/06/07 17:12:13 dfr Exp $
+ * $Id: in.c,v 1.37 1997/10/12 20:25:23 phk Exp $
*/
#include <sys/param.h>
@@ -179,8 +179,6 @@ in_control(so, cmd, data, ifp, p)
case SIOCAIFADDR:
case SIOCDIFADDR:
- if (ifp == 0)
- return (EADDRNOTAVAIL);
if (ifra->ifra_addr.sin_family == AF_INET) {
for (oia = ia; ia; ia = ia->ia_link.tqe_next) {
if (ia->ia_ifp == ifp &&
@@ -205,7 +203,7 @@ in_control(so, cmd, data, ifp, p)
return error;
if (ifp == 0)
- return (EADDRNOTAVAIL);
+ panic("in_control");
if (ia == (struct in_ifaddr *)0) {
ia = (struct in_ifaddr *)
malloc(sizeof *ia, M_IFADDR, M_WAITOK);
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 1188bdea11d67..67e58515775b0 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
- * $Id: in.h,v 1.37 1998/08/23 03:07:14 wollman Exp $
+ * $Id: in.h,v 1.36 1998/07/06 03:20:12 julian Exp $
*/
#ifndef _NETINET_IN_H_
@@ -323,11 +323,6 @@ struct ip_opts {
#define IP_FW_GET 54 /* get entire firewall rule chain */
#define IP_NAT 55 /* set/get NAT opts */
-#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */
-#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */
-#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */
-#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */
-
/*
* Defaults and limits for options
*/
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index d604ad06a88b2..c8ac1c0ee2983 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
- * $Id: in_pcb.c,v 1.45 1998/09/17 18:42:16 fenner Exp $
+ * $Id: in_pcb.c,v 1.44 1998/05/15 20:11:32 wollman Exp $
*/
#include <sys/param.h>
@@ -688,7 +688,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
u_int lport_arg;
int wild_okay;
{
- register struct inpcb *inp;
+ register struct inpcb *inp, *match = NULL;
int matchwild = 3, wildcard;
u_short lport = lport_arg;
diff --git a/sys/netinet/ip_auth.c b/sys/netinet/ip_auth.c
index dab93b0ef0c2f..9996c8d1a5271 100644
--- a/sys/netinet/ip_auth.c
+++ b/sys/netinet/ip_auth.c
@@ -6,7 +6,7 @@
* to the original author and the contributors.
*/
#if !defined(lint)
-static const char rcsid[] = "@(#)$Id: ip_auth.c,v 1.5 1998/08/15 21:51:53 bde Exp $";
+static const char rcsid[] = "@(#)$Id: ip_auth.c,v 1.4 1998/06/20 18:37:50 peter Exp $";
#endif
#if defined(KERNEL) && !defined(_KERNEL)
@@ -117,10 +117,10 @@ int fr_authsize = FR_NUMAUTH;
int fr_authused = 0;
int fr_defaultauthage = 600;
fr_authstat_t fr_authstats;
-static frauth_t fr_auth[FR_NUMAUTH];
+frauth_t fr_auth[FR_NUMAUTH];
mb_t *fr_authpkts[FR_NUMAUTH];
-static int fr_authstart = 0, fr_authend = 0, fr_authnext = 0;
-static frauthent_t *fae_list = NULL;
+int fr_authstart = 0, fr_authend = 0, fr_authnext = 0;
+frauthent_t *fae_list = NULL;
frentry_t *ipauth = NULL;
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index b39948e9c66c7..87ae6715b5db4 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ip_divert.c,v 1.34 1998/07/06 09:06:58 julian Exp $
+ * $Id: ip_divert.c,v 1.33 1998/07/02 06:31:25 julian Exp $
*/
#include "opt_inet.h"
@@ -197,8 +197,8 @@ div_input(struct mbuf *m, int hlen)
/*
* Record the incoming interface name whenever we have one.
*/
- bzero(&divsrc.sin_zero, sizeof(divsrc.sin_zero));
if (m->m_pkthdr.rcvif) {
+ char name[32];
/*
* Hide the actual interface name in there in the
* sin_zero array. XXX This needs to be moved to a
@@ -217,9 +217,9 @@ div_input(struct mbuf *m, int hlen)
* this iface name will come along for the ride.
* (see div_output for the other half of this.)
*/
- snprintf(divsrc.sin_zero, sizeof(divsrc.sin_zero),
- "%s%d", m->m_pkthdr.rcvif->if_name,
- m->m_pkthdr.rcvif->if_unit);
+ sprintf(name, "%s%d",
+ m->m_pkthdr.rcvif->if_name, m->m_pkthdr.rcvif->if_unit);
+ strncpy(divsrc.sin_zero, name, 7);
}
/* Put packet on socket queue, if any */
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index e495b60450b04..31b4249954723 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -10,7 +10,7 @@
*
* This software is provided ``AS IS'' without any warranties of any kind.
*
- * $Id: ip_dummynet.c,v 1.6 1999/01/12 16:40:57 eivind Exp $
+ * $Id: ip_dummynet.c 1.2 1998/08/21 15:01:13 luigi Exp $
*/
/*
@@ -40,7 +40,6 @@
#include <sys/queue.h> /* XXX */
#include <sys/kernel.h>
#include <sys/socket.h>
-#include <sys/socketvar.h>
#include <sys/time.h>
#include <sys/sysctl.h>
#include <net/if.h>
@@ -51,7 +50,6 @@
#include <netinet/ip.h>
#include <netinet/ip_fw.h>
#include <netinet/ip_dummynet.h>
-#include <netinet/ip_var.h>
#ifdef BRIDGE
#include <netinet/if_ether.h> /* for struct arpcom */
@@ -70,13 +68,11 @@ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, calls, CTLFLAG_RD, &dn_calls, 0, "")
SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, idle, CTLFLAG_RD, &dn_idle, 0, "");
#endif
-static int ip_dn_ctl(struct sockopt *sopt);
+static int ip_dn_ctl(int optname, struct mbuf **mm);
-static void rt_unref(struct rtentry *);
-static void dummynet(void *);
+static void dummynet(void);
static void dn_restart(void);
static void dn_move(struct dn_pipe *pipe, int immediate);
-static void dummynet_flush(void);
/*
* the following is needed when deleting a pipe, because rules can
@@ -100,29 +96,19 @@ dn_restart()
/* if there any pipe that needs work, restart */
if (pipe->r.head || pipe->p.head || pipe->numbytes < 0 ) {
dn_idle = 0;
- timeout(dummynet, NULL, 1);
+ timeout(dummynet, (caddr_t)NULL, 1);
return ;
}
}
}
-static void
-rt_unref(struct rtentry *rt)
-{
- if (rt == NULL)
- return ;
- if (rt->rt_refcnt <= 0)
- printf("-- warning, refcnt now %d, decreasing\n", rt->rt_refcnt);
- RTFREE(rt);
-}
-
/*
* move packets from R-queue to P-queue
*/
static void
dn_move(struct dn_pipe *pipe, int immediate)
{
- struct dn_pkt *pkt;
+ struct dn_pkt *tmp, *pkt;
/*
* consistency check, should catch new pipes which are
@@ -130,7 +116,7 @@ dn_move(struct dn_pipe *pipe, int immediate)
*/
if ( pipe->p.head == NULL &&
pipe->ticks_from_last_insert != pipe->delay) {
- printf("Warning, empty pipe and delay %d (should be %d)\n",
+ printf("Warning, empty pipe and delay %d (should be %a)d\n",
pipe->ticks_from_last_insert, pipe->delay);
pipe->ticks_from_last_insert = pipe->delay;
}
@@ -180,8 +166,8 @@ dn_move(struct dn_pipe *pipe, int immediate)
/*** XXX just a sanity check */
if ( ( pkt == NULL && pipe->r_len != 0) ||
( pkt != NULL && pipe->r_len == 0) )
- printf("-- Warning, pipe head %p len %d\n",
- (void *)pkt, pipe->r_len);
+ printf("-- Warning, pipe head %x len %d\n",
+ pkt, pipe->r_len);
}
/*
@@ -216,7 +202,8 @@ dn_move(struct dn_pipe *pipe, int immediate)
(void)ip_output((struct mbuf *)pkt, (struct mbuf *)pkt->ifp,
&(pkt->ro), pkt->dn_hlen, NULL);
- rt_unref (tmp_rt) ;
+ if (tmp_rt)
+ tmp_rt->rt_refcnt--; /* XXX return a reference count */
}
break ;
case DN_TO_IP_IN :
@@ -239,9 +226,8 @@ dn_move(struct dn_pipe *pipe, int immediate)
* this is the periodic task that moves packets between the R-
* and the P- queue
*/
-/*ARGSUSED*/
void
-dummynet(void * __unused unused)
+dummynet()
{
struct dn_pipe *p ;
int s ;
@@ -321,7 +307,6 @@ dummynet_io(int pipe_nr, int dir,
m_freem(m);
return 0 ; /* XXX error */
}
- bzero(pkt, sizeof(*pkt) );
/* build and enqueue packet */
pkt->hdr.mh_type = MT_DUMMYNET ;
(struct ip_fw_chain *)pkt->hdr.mh_data = rule ;
@@ -368,14 +353,16 @@ purge_pipe(struct dn_pipe *pipe)
struct rtentry *tmp_rt ;
for (pkt = pipe->r.head ; pkt ; ) {
- rt_unref (tmp_rt = pkt->ro.ro_rt ) ;
+ if (tmp_rt = pkt->ro.ro_rt )
+ tmp_rt->rt_refcnt--; /* XXX return a reference count */
m_freem(pkt->dn_m);
n = pkt ;
pkt = (struct dn_pkt *)pkt->dn_next ;
free(n, M_IPFW) ;
}
for (pkt = pipe->p.head ; pkt ; ) {
- rt_unref (tmp_rt = pkt->ro.ro_rt ) ;
+ if (tmp_rt = pkt->ro.ro_rt )
+ tmp_rt->rt_refcnt--; /* XXX return a reference count */
m_freem(pkt->dn_m);
n = pkt ;
pkt = (struct dn_pkt *)pkt->dn_next ;
@@ -413,25 +400,18 @@ extern struct ip_fw_chain *ip_fw_default_rule ;
void
dn_rule_delete(void *r)
{
- struct dn_pipe *p ;
- int matches = 0 ;
- for ( p = all_pipes ; p ; p = p->next ) {
+ struct dn_pipe *q, *p = all_pipes ;
+
+ for ( p= all_pipes ; p ; p = p->next ) {
struct dn_pkt *x ;
for (x = p->r.head ; x ; x = (struct dn_pkt *)x->dn_next )
- if (x->hdr.mh_data == r) {
- matches++ ;
+ if (x->hdr.mh_data == r)
x->hdr.mh_data = (void *)ip_fw_default_rule ;
- }
for (x = p->p.head ; x ; x = (struct dn_pkt *)x->dn_next )
- if (x->hdr.mh_data == r) {
- matches++ ;
+ if (x->hdr.mh_data == r)
x->hdr.mh_data = (void *)ip_fw_default_rule ;
- }
}
- printf("dn_rule_delete, r %p, default %p%s, %d matches\n",
- (void *)r, (void *)ip_fw_default_rule,
- r == ip_fw_default_rule ? " AARGH!":"", matches);
}
/*
@@ -439,53 +419,51 @@ dn_rule_delete(void *r)
* (get, flush, config, del)
*/
static int
-ip_dn_ctl(struct sockopt *sopt)
+ip_dn_ctl(int optname, struct mbuf **mm)
{
- int error = 0 ;
- size_t size ;
- char *buf, *bp ;
- struct dn_pipe *p, tmp_pipe ;
-
- struct dn_pipe *x, *a, *b ;
-
- /* Disallow sets in really-really secure mode. */
- if (sopt->sopt_dir == SOPT_SET && securelevel >= 3)
- return (EPERM);
-
- switch (sopt->sopt_name) {
- default :
- panic("ip_dn_ctl -- unknown option");
-
- case IP_DUMMYNET_GET :
- for (p = all_pipes, size = 0 ; p ; p = p->next )
- size += sizeof( *p ) ;
- buf = malloc(size, M_TEMP, M_WAITOK);
- if (buf == 0) {
- error = ENOBUFS ;
- break ;
- }
- for (p = all_pipes, bp = buf ; p ; p = p->next ) {
- struct dn_pipe *q = (struct dn_pipe *)bp ;
-
- bcopy(p, bp, sizeof( *p ) );
+ struct mbuf *m ;
+ if (optname == IP_DUMMYNET_GET) {
+ struct dn_pipe *p = all_pipes ;
+ *mm = m = m_get(M_WAIT, MT_SOOPTS);
+ m->m_len = 0 ;
+ m->m_next = NULL ;
+ for (; p ; p = p->next ) {
+ struct dn_pipe *q = mtod(m,struct dn_pipe *) ;
+ memcpy( m->m_data, p, sizeof(*p) );
/*
* return bw and delay in bits/s and ms, respectively
*/
q->bandwidth *= (8*hz) ;
q->delay = (q->delay * 1000) / hz ;
- bp += sizeof( *p ) ;
+
+ m->m_len = sizeof(*p) ;
+ m->m_next = m_get(M_WAIT, MT_SOOPTS);
+ m = m->m_next ;
+ m->m_len = 0 ;
+ }
+ return 0 ;
}
- error = sooptcopyout(sopt, buf, size);
- FREE(buf, M_TEMP);
- break ;
- case IP_DUMMYNET_FLUSH :
+ if (securelevel > 2) { /* like in the firewall code... */
+ if (m) (void)m_free(m);
+ return (EPERM) ;
+ }
+ m = *mm ;
+ if (optname == IP_DUMMYNET_FLUSH) {
dummynet_flush() ;
- break ;
- case IP_DUMMYNET_CONFIGURE :
- p = &tmp_pipe ;
- error = sooptcopyin(sopt, p, sizeof *p, sizeof *p);
- if (error)
- break ;
+ if (m) (void)m_free(m);
+ return 0 ;
+ }
+ if (!m) /* need an argument for the following */
+ return (EINVAL);
+ if (optname == IP_DUMMYNET_CONFIGURE) {
+ struct dn_pipe *p = mtod(m,struct dn_pipe *) ;
+ struct dn_pipe *x, *a, *b ;
+ if (m->m_len != sizeof (*p) ) {
+ printf("dn_pipe Invalid length, %d instead of %d\n",
+ m->m_len, sizeof(*p) );
+ (void)m_free(m);
+ return (EINVAL);
+ }
/*
* The config program passes parameters as follows:
* bandwidth = bits/second (0 = no limits);
@@ -531,8 +509,7 @@ ip_dn_ctl(struct sockopt *sopt)
x = malloc(sizeof(struct dn_pipe), M_IPFW, M_DONTWAIT) ;
if (x == NULL) {
printf("ip_dummynet.c: sorry no memory\n");
- error = ENOSPC ;
- break ;
+ return (ENOSPC) ;
}
bzero(x, sizeof(*x) );
x->bandwidth = p->bandwidth ;
@@ -551,13 +528,12 @@ ip_dn_ctl(struct sockopt *sopt)
a->next = x ;
splx(s);
}
- break ;
-
- case IP_DUMMYNET_DEL :
- p = &tmp_pipe ;
- error = sooptcopyin(sopt, p, sizeof *p, sizeof *p);
- if (error)
- break ;
+ (void)m_free(m);
+ return 0 ;
+ }
+ if (optname == IP_DUMMYNET_DEL) {
+ struct dn_pipe *p = mtod(m,struct dn_pipe *) ;
+ struct dn_pipe *x, *a, *b ;
for (a = NULL , b = all_pipes ; b && b->pipe_nr < p->pipe_nr ;
a = b , b = b->next) ;
@@ -581,9 +557,8 @@ ip_dn_ctl(struct sockopt *sopt)
purge_pipe(b); /* remove pkts from here */
free(b, M_IPFW);
}
- break ;
}
- return error ;
+ return 0 ;
}
void
diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h
index f01406fdc6cff..33833fcaffb07 100644
--- a/sys/netinet/ip_dummynet.h
+++ b/sys/netinet/ip_dummynet.h
@@ -16,8 +16,6 @@
#ifndef _IP_DUMMYNET_H
#define _IP_DUMMYNET_H
-typedef int ip_dn_ctl_t __P((struct sockopt *)) ;
-extern ip_dn_ctl_t *ip_dn_ctl_ptr;
/*
* Definition of dummynet data structures.
* Dummynet handles a list of pipes, each one identified by a unique
@@ -87,20 +85,12 @@ struct dn_pipe { /* a pipe */
};
/*
- * The following is used to define a new mbuf type that is
- * prepended to the packet when it comes out of a pipe. The definition
- * ought to go in /sys/sys/mbuf.h but here it is less intrusive.
- */
-
-#define MT_DUMMYNET MT_CONTROL
-/*
* what to do of a packet when it comes out of a pipe
*/
#define DN_TO_IP_OUT 1
#define DN_TO_IP_IN 2
#define DN_TO_BDG_FWD 3
#ifdef KERNEL
-MALLOC_DECLARE(M_IPFW);
void ip_dn_init(void); /* called in ip_input.c */
void dn_rule_delete(void *r); /* used in ip_fw.c */
int dummynet_io(int pipe, int dir,
diff --git a/sys/netinet/ip_fil.c b/sys/netinet/ip_fil.c
index 6cbdac90533c5..1075316718d1f 100644
--- a/sys/netinet/ip_fil.c
+++ b/sys/netinet/ip_fil.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_fil.c,v 1.6 1998/08/15 21:51:53 bde Exp $";
+static const char rcsid[] = "@(#)$Id: ip_fil.c,v 1.5 1998/06/20 18:37:50 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -1110,12 +1110,12 @@ ip_t *ip;
# if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \
(defined(OpenBSD) && (OpenBSD >= 199603))
- snprintf(fname, sizeof(fname), "/tmp/%s", ifp->if_xname);
+ sprintf(fname, "/tmp/%s", ifp->if_xname);
if ((fp = fopen(fname, "a"))) {
fclose(fp);
}
# else
- snprintf(fname, sizeof(fname), "/tmp/%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit);
if ((fp = fopen(fname, "a"))) {
fwrite((char *)ip, ntohs(ip->ip_len), 1, fp);
fclose(fp);
@@ -1139,8 +1139,7 @@ char *name;
char ifname[32], *s;
for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) {
- (void) snprintf(ifname, sizeof(ifname),
- "%s%d", ifp->if_name, ifp->if_unit);
+ (void) sprintf(ifname, "%s%d", ifp->if_name, ifp->if_unit);
if (!strcmp(name, ifname))
return ifp;
}
@@ -1191,7 +1190,7 @@ void init_ifp()
(defined(OpenBSD) && (OpenBSD >= 199603))
for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) {
ifp->if_output = write_output;
- snprintf(fname, sizeof(fname), "/tmp/%s", ifp->if_xname);
+ sprintf(fname, "/tmp/%s", ifp->if_xname);
if ((fp = fopen(fname, "w")))
fclose(fp);
}
@@ -1199,8 +1198,7 @@ void init_ifp()
for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) {
ifp->if_output = write_output;
- snprintf(fname, sizeof(fname),
- "/tmp/%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit);
if ((fp = fopen(fname, "w")))
fclose(fp);
}
diff --git a/sys/netinet/ip_flow.c b/sys/netinet/ip_flow.c
index d4a2439ed547a..b9a000ce532b4 100644
--- a/sys/netinet/ip_flow.c
+++ b/sys/netinet/ip_flow.c
@@ -33,7 +33,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ip_flow.c,v 1.5 1998/06/21 14:53:29 bde Exp $
+ * $Id: ip_flow.c,v 1.4 1998/05/19 17:47:11 jdp Exp $
*/
#include <sys/param.h>
@@ -109,6 +109,7 @@ ipflow_fastforward(
struct ip *ip;
struct ipflow *ipf;
struct rtentry *rt;
+ u_int32_t sum;
int error;
/*
diff --git a/sys/netinet/ip_frag.c b/sys/netinet/ip_frag.c
index 7ad47f784b089..a379c67b66019 100644
--- a/sys/netinet/ip_frag.c
+++ b/sys/netinet/ip_frag.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_frag.c 1.11 3/24/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_frag.c,v 1.2 1998/03/21 11:34:06 peter Exp $";
+static const char rcsid[] = "@(#)$Id: ip_frag.c,v 1.1.1.5 1997/11/16 05:55:34 peter Exp $";
#endif
#if !defined(_KERNEL) && defined(KERNEL)
@@ -76,11 +76,11 @@ static const char rcsid[] = "@(#)$Id: ip_frag.c,v 1.2 1998/03/21 11:34:06 peter
#include "netinet/ip_state.h"
#include "netinet/ip_auth.h"
-static ipfr_t *ipfr_heads[IPFT_SIZE];
-static ipfr_t *ipfr_nattab[IPFT_SIZE];
-static ipfrstat_t ipfr_stats;
-static int ipfr_inuse = 0;
- int fr_ipfrttl = 120; /* 60 seconds */
+ipfr_t *ipfr_heads[IPFT_SIZE];
+ipfr_t *ipfr_nattab[IPFT_SIZE];
+ipfrstat_t ipfr_stats;
+int ipfr_inuse = 0,
+ fr_ipfrttl = 120; /* 60 seconds */
#ifdef _KERNEL
extern int ipfr_timer_id;
#endif
diff --git a/sys/netinet/ip_ftp_pxy.c b/sys/netinet/ip_ftp_pxy.c
index dd70c8124015e..1a66a9ba0c428 100644
--- a/sys/netinet/ip_ftp_pxy.c
+++ b/sys/netinet/ip_ftp_pxy.c
@@ -165,7 +165,7 @@ nat_t *nat;
a4 = a1 & 0xff;
a1 >>= 24;
olen = s - portbuf + 1;
- (void) snprintf(newbuf, sizeof(newbuf), "PORT %d,%d,%d,%d,%d,%d\r\n",
+ (void) sprintf(newbuf, "PORT %d,%d,%d,%d,%d,%d\r\n",
a1, a2, a3, a4, a5, a6);
nlen = strlen(newbuf);
inc = nlen - olen;
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 4bad5b66e3cc7..bf4beb4702b13 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -12,7 +12,7 @@
*
* This software is provided ``AS IS'' without any warranties of any kind.
*
- * $Id: ip_fw.c,v 1.102 1998/12/22 20:38:06 luigi Exp $
+ * $Id: ip_fw.c,v 1.96 1998/08/23 03:07:14 wollman Exp $
*/
/*
@@ -21,7 +21,6 @@
#if !defined(KLD_MODULE) && !defined(IPFIREWALL_MODULE)
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#include "opt_ipdivert.h"
#include "opt_inet.h"
#ifndef INET
@@ -44,25 +43,18 @@
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_fw.h>
-#ifdef DUMMYNET
-#include <net/route.h>
-#include <netinet/ip_dummynet.h>
-#endif
#include <netinet/tcp.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcpip.h>
#include <netinet/udp.h>
-#include <netinet/if_ether.h> /* XXX ethertype_ip */
-
static int fw_debug = 1;
#ifdef IPFIREWALL_VERBOSE
static int fw_verbose = 1;
#else
static int fw_verbose = 0;
#endif
-static int fw_one_pass = 0; /* XXX */
#ifdef IPFIREWALL_VERBOSE_LIMIT
static int fw_verbose_limit = IPFIREWALL_VERBOSE_LIMIT;
#else
@@ -71,14 +63,13 @@ static int fw_verbose_limit = 0;
#define IPFW_DEFAULT_RULE ((u_int)(u_short)~0)
-LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
+static LIST_HEAD (ip_fw_head, ip_fw_chain) ip_fw_chain;
-MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's");
+static MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's");
#ifdef SYSCTL_NODE
SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall");
SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, debug, CTLFLAG_RW, &fw_debug, 0, "");
-SYSCTL_INT(_net_inet_ip_fw, OID_AUTO,one_pass,CTLFLAG_RW, &fw_one_pass, 0, "");
SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose, CTLFLAG_RW, &fw_verbose, 0, "");
SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &fw_verbose_limit, 0, "");
#endif
@@ -109,11 +100,8 @@ static int icmptype_match __P((struct icmp * icmp, struct ip_fw * f));
static void ipfw_report __P((struct ip_fw *f, struct ip *ip,
struct ifnet *rif, struct ifnet *oif));
-static void flush_rule_ptrs(void);
-
static int ip_fw_chk __P((struct ip **pip, int hlen,
struct ifnet *oif, u_int16_t *cookie, struct mbuf **m,
- struct ip_fw_chain **flow_id,
struct sockaddr_in **next_hop));
static int ip_fw_ctl __P((struct sockopt *sopt));
@@ -291,7 +279,6 @@ static void
ipfw_report(struct ip_fw *f, struct ip *ip,
struct ifnet *rif, struct ifnet *oif)
{
- if (ip) {
static u_int64_t counter;
struct tcphdr *const tcp = (struct tcphdr *) ((u_int32_t *) ip+ ip->ip_hl);
struct udphdr *const udp = (struct udphdr *) ((u_int32_t *) ip+ ip->ip_hl);
@@ -332,11 +319,6 @@ ipfw_report(struct ip_fw *f, struct ip *ip,
case IP_FW_F_SKIPTO:
printf("SkipTo %d", f->fw_skipto_rule);
break;
-#ifdef DUMMYNET
- case IP_FW_F_PIPE:
- printf("Pipe %d", f->fw_skipto_rule);
- break;
-#endif
#ifdef IPFIREWALL_FORWARD
case IP_FW_F_FWD:
printf("Forward to ");
@@ -400,46 +382,16 @@ ipfw_report(struct ip_fw *f, struct ip *ip,
if (fw_verbose_limit != 0 && count == fw_verbose_limit)
printf("ipfw: limit reached on rule #%d\n",
f ? f->fw_number : -1);
- }
-}
-
-/*
- * given an ip_fw_chain *, lookup_next_rule will return a pointer
- * of the same type to the next one. This can be either the jump
- * target (for skipto instructions) or the next one in the chain (in
- * all other cases including a missing jump target).
- * Backward jumps are not allowed, so start looking from the next
- * rule...
- */
-static struct ip_fw_chain * lookup_next_rule(struct ip_fw_chain *me);
-
-static struct ip_fw_chain *
-lookup_next_rule(struct ip_fw_chain *me)
-{
- struct ip_fw_chain *chain ;
- int rule = me->rule->fw_skipto_rule ; /* guess... */
-
- if ( (me->rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_SKIPTO )
- for (chain = me->chain.le_next; chain ; chain = chain->chain.le_next )
- if (chain->rule->fw_number >= rule)
- return chain ;
- return me->chain.le_next ; /* failure or not a skipto */
}
/*
* Parameters:
*
- * pip Pointer to packet header (struct ip **)
- * bridge_ipfw extension: pip = NULL means a complete ethernet packet
- * including ethernet header in the mbuf. Other fields
- * are ignored/invalid.
- *
+ * ip Pointer to packet header (struct ip *)
* hlen Packet header length
* oif Outgoing interface, or NULL if packet is incoming
* *cookie Skip up to the first rule past this rule number;
* *m The packet; we set to NULL when/if we nuke it.
- * *flow_id pointer to the last matching rule (in/out)
- * *next_hop socket we are forwarding to (in/out).
*
* Return value:
*
@@ -452,58 +404,17 @@ lookup_next_rule(struct ip_fw_chain *me)
static int
ip_fw_chk(struct ip **pip, int hlen,
struct ifnet *oif, u_int16_t *cookie, struct mbuf **m,
- struct ip_fw_chain **flow_id,
struct sockaddr_in **next_hop)
{
struct ip_fw_chain *chain;
struct ip_fw *rule = NULL;
- struct ip *ip = NULL ;
+ struct ip *ip = *pip;
struct ifnet *const rif = (*m)->m_pkthdr.rcvif;
- u_short offset = 0 ;
+ u_short offset = (ip->ip_off & IP_OFFMASK);
u_short src_port, dst_port;
u_int16_t skipto = *cookie;
- if (pip) { /* normal ip packet */
- ip = *pip;
- offset = (ip->ip_off & IP_OFFMASK);
- } else { /* bridged or non-ip packet */
- struct ether_header *eh = mtod(*m, struct ether_header *);
- switch (ntohs(eh->ether_type)) {
- case ETHERTYPE_IP :
- if ((*m)->m_len<sizeof(struct ether_header) + sizeof(struct ip))
- goto non_ip ;
- ip = (struct ip *)(eh + 1 );
- if (ip->ip_v != IPVERSION)
- goto non_ip ;
- hlen = ip->ip_hl << 2;
- if (hlen < sizeof(struct ip)) /* minimum header length */
- goto non_ip ;
- if ((*m)->m_len < 14 + hlen + 14) {
- printf("-- m_len %d, need more...\n", (*m)->m_len);
- goto non_ip ;
- }
- offset = (ntohs(ip->ip_off) & IP_OFFMASK);
- break ;
- default :
-non_ip: ip = NULL ;
- break ;
- }
- }
-
- if (*flow_id) {
- if (fw_one_pass)
- return 0 ; /* accept if passed first test */
- /*
- * pkt has already been tagged. Look for the next rule
- * to restart processing
- */
- chain = LIST_NEXT( *flow_id, chain);
-
- if ( (chain = (*flow_id)->rule->next_rule_ptr) == NULL )
- chain = (*flow_id)->rule->next_rule_ptr =
- lookup_next_rule(*flow_id) ;
- if (! chain) goto dropit;
- } else {
+ *cookie = 0;
/*
* Go down the chain, looking for enlightment
* If we've been asked to start at a given rule immediatly, do so.
@@ -517,12 +428,8 @@ non_ip: ip = NULL ;
}
if (! chain) goto dropit;
}
- }
- *cookie = 0;
for (; chain; chain = LIST_NEXT(chain, chain)) {
- register struct ip_fw * f ;
-again:
- f = chain->rule;
+ register struct ip_fw *const f = chain->rule;
if (oif) {
/* Check direction outbound */
@@ -533,43 +440,9 @@ again:
if (!(f->fw_flg & IP_FW_F_IN))
continue;
}
- if (ip == NULL ) {
- /*
- * do relevant checks for non-ip packets:
- * after this, only goto got_match or continue
- */
- struct ether_header *eh = mtod(*m, struct ether_header *);
-
- /*
- * make default rule always match or we have a panic
- */
- if (f->fw_number == IPFW_DEFAULT_RULE)
- goto got_match ;
- /*
- * temporary hack:
- * udp from 0.0.0.0 means this rule applies.
- * 1 src port is match ether type
- * 2 src ports (interval) is match ether type
- * 3 src ports is match ether address
- */
- if ( f->fw_src.s_addr != 0 || f->fw_prot != IPPROTO_UDP)
- continue;
- switch (IP_FW_GETNSRCP(f)) {
- case 1: /* match one type */
- if ( /* ( (f->fw_flg & IP_FW_F_INVSRC) != 0) ^ */
- ( f->fw_uar.fw_pts[0] == ntohs(eh->ether_type) ) ) {
- printf("match!\n");
- goto got_match ;
- }
- break ;
- default:
- break ;
- }
- continue ;
- }
/* Fragments */
- if ((f->fw_flg & IP_FW_F_FRAG) && offset == 0 )
+ if ((f->fw_flg & IP_FW_F_FRAG) && !(ip->ip_off & IP_OFFMASK))
continue;
/* If src-addr doesn't match, not this rule. */
@@ -615,19 +488,14 @@ again:
if (ip->ip_p != f->fw_prot)
continue;
-#define PULLUP_TO(len) \
- do { \
- if ((*m)->m_len < (len) ) { \
- if ( (*m = m_pullup(*m, (len))) == 0) \
- goto bogusfrag; \
- ip = mtod(*m, struct ip *); \
- if (pip) { \
- *pip = ip ; \
- offset = (ip->ip_off & IP_OFFMASK); \
- } else \
- offset = (ntohs(ip->ip_off) & IP_OFFMASK); \
- } \
- } while (0)
+#define PULLUP_TO(len) do { \
+ if ((*m)->m_len < (len) \
+ && (*m = m_pullup(*m, (len))) == 0) { \
+ goto bogusfrag; \
+ } \
+ *pip = ip = mtod(*m, struct ip *); \
+ offset = (ip->ip_off & IP_OFFMASK); \
+ } while (0)
/* Protocol specific checks */
switch (ip->ip_p) {
@@ -710,12 +578,9 @@ bogusfrag:
}
got_match:
- *flow_id = chain ; /* XXX set flow id */
/* Update statistics */
f->fw_pcnt += 1;
- if (ip) {
- f->fw_bcnt += pip ? ip->ip_len : ntohs(ip->ip_len);
- }
+ f->fw_bcnt += ip->ip_len;
f->timestamp = time_second;
/* Log to console if desired */
@@ -728,11 +593,9 @@ got_match:
return(0);
case IP_FW_F_COUNT:
continue;
-#ifdef IPDIVERT
case IP_FW_F_DIVERT:
*cookie = f->fw_number;
return(f->fw_divert_port);
-#endif
case IP_FW_F_TEE:
/*
* XXX someday tee packet here, but beware that you
@@ -743,17 +606,17 @@ got_match:
* to write custom routine.
*/
continue;
- case IP_FW_F_SKIPTO: /* XXX check */
- if ( f->next_rule_ptr )
- chain = f->next_rule_ptr ;
- else
- chain = lookup_next_rule(chain) ;
- if (! chain) goto dropit;
- goto again ;
-#ifdef DUMMYNET
- case IP_FW_F_PIPE:
- return(f->fw_pipe_nr | 0x10000 );
+ case IP_FW_F_SKIPTO:
+#ifdef DIAGNOSTIC
+ while (LIST_NEXT(chain, chain)
+ && LIST_NEXT(chain, chain)->rule->fw_number
+ < f->fw_skipto_rule)
+#else
+ while (LIST_NEXT(chain, chain)->rule->fw_number
+ < f->fw_skipto_rule)
#endif
+ chain = LIST_NEXT(chain, chain);
+ continue;
#ifdef IPFIREWALL_FORWARD
case IP_FW_F_FWD:
/* Change the next-hop address for this packet.
@@ -793,7 +656,6 @@ got_match:
* - The packet is not a multicast or broadcast packet
*/
if ((rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_REJECT
- && ip
&& (ip->ip_p != IPPROTO_ICMP || is_icmp_query(ip))
&& !((*m)->m_flags & (M_BCAST|M_MCAST))
&& !IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
@@ -836,7 +698,7 @@ dropit:
/*
* Finally, drop the packet.
*/
- /* *cookie = 0; */ /* XXX is this necessary ? */
+ *cookie = 0;
if (*m) {
m_freem(*m);
*m = NULL;
@@ -844,22 +706,6 @@ dropit:
return(0);
}
-/*
- * when a rule is added/deleted, zero the direct pointers within
- * all firewall rules. These will be reconstructed on the fly
- * as packets are matched.
- * Must be called at splnet().
- */
-static void
-flush_rule_ptrs()
-{
- struct ip_fw_chain *fcp ;
-
- for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next) {
- fcp->rule->next_rule_ptr = NULL ;
- }
-}
-
static int
add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
{
@@ -881,8 +727,6 @@ add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
ftmp->fw_in_if.fu_via_if.name[FW_IFNLEN - 1] = '\0';
ftmp->fw_pcnt = 0L;
ftmp->fw_bcnt = 0L;
- ftmp->next_rule_ptr = NULL ;
- ftmp->pipe_ptr = NULL ;
fwc->rule = ftmp;
s = splnet();
@@ -919,7 +763,6 @@ add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
fcpl = fcp;
}
}
- flush_rule_ptrs();
splx(s);
return (0);
@@ -943,10 +786,6 @@ del_entry(struct ip_fw_head *chainptr, u_short number)
next = LIST_NEXT(fcp, chain);
LIST_REMOVE(fcp, chain);
-#ifdef DUMMYNET
- dn_rule_delete(fcp) ;
-#endif
- flush_rule_ptrs();
free(fcp->rule, M_IPFW);
free(fcp, M_IPFW);
fcp = next;
@@ -1102,7 +941,6 @@ check_ipfw_struct(struct ip_fw *frwl)
}
break;
case IP_FW_F_DIVERT: /* Diverting to port zero is invalid */
- case IP_FW_F_PIPE: /* piping through 0 is invalid */
case IP_FW_F_TEE:
if (frwl->fw_divert_port == 0) {
dprintf(("%s can't divert to port 0\n", err_prefix));
@@ -1211,15 +1049,12 @@ ip_fw_ctl(struct sockopt *sopt)
break;
default:
- printf("ip_fw_ctl invalid option %d\n", sopt->sopt_name);
- error = EINVAL ;
+ panic("ip_fw_ctl");
}
return (error);
}
-struct ip_fw_chain *ip_fw_default_rule ;
-
void
ip_fw_init(void)
{
@@ -1242,7 +1077,6 @@ ip_fw_init(void)
add_entry(&ip_fw_chain, &default_rule))
panic("ip_fw_init");
- ip_fw_default_rule = ip_fw_chain.lh_first ;
printf("IP packet filtering initialized, "
#ifdef IPDIVERT
"divert enabled, ");
@@ -1320,7 +1154,7 @@ ipfw_mod(struct lkm_table *lkmtp, int cmd, int ver)
}
#else
static int
-ipfw_modevent(module_t mod, int type, void *unused)
+ipfw_modevent(module_t mod, modeventtype_t type, void *unused)
{
int s;
@@ -1356,7 +1190,7 @@ ipfw_modevent(module_t mod, int type, void *unused)
return 0;
}
-static moduledata_t ipfwmod = {
+moduledata_t ipfwmod = {
"ipfw",
ipfw_modevent,
0
diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h
index a4cee76ed8e01..31e8366e82f85 100644
--- a/sys/netinet/ip_fw.h
+++ b/sys/netinet/ip_fw.h
@@ -11,7 +11,7 @@
*
* This software is provided ``AS IS'' without any warranties of any kind.
*
- * $Id: ip_fw.h,v 1.35 1998/09/02 19:14:01 phk Exp $
+ * $Id: ip_fw.h,v 1.34 1998/08/23 03:07:14 wollman Exp $
*/
#ifndef _IP_FW_H
@@ -35,7 +35,7 @@
union ip_fw_if {
struct in_addr fu_via_ip; /* Specified by IP address */
struct { /* Specified by interface name */
-#define FW_IFNLEN 10 /* need room ! was IFNAMSIZ */
+#define FW_IFNLEN IFNAMSIZ
char name[FW_IFNLEN];
short unit; /* -1 means match any unit */
} fu_via_if;
@@ -69,7 +69,6 @@ struct ip_fw {
union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */
union {
u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */
- u_short fu_pipe_nr; /* pipe number (option DUMMYNET) */
u_short fu_skipto_rule; /* SKIPTO command rule number */
u_short fu_reject_code; /* REJECT response code */
struct sockaddr_in fu_fwd_ip;
@@ -79,8 +78,6 @@ struct ip_fw {
/* in ports array (dst ports follow */
/* src ports; max of 10 ports in all; */
/* count of 0 means match all ports) */
- void *pipe_ptr; /* Pipe ptr in case of dummynet pipe */
- void *next_rule_ptr ; /* next rule in case of match */
};
#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f)
@@ -97,7 +94,6 @@ struct ip_fw {
#define fw_divert_port fw_un.fu_divert_port
#define fw_skipto_rule fw_un.fu_skipto_rule
#define fw_reject_code fw_un.fu_reject_code
-#define fw_pipe_nr fw_un.fu_pipe_nr
#define fw_fwd_ip fw_un.fu_fwd_ip
struct ip_fw_chain {
@@ -117,7 +113,6 @@ struct ip_fw_chain {
#define IP_FW_F_TEE 0x00000005 /* This is a tee rule */
#define IP_FW_F_SKIPTO 0x00000006 /* This is a skipto rule */
#define IP_FW_F_FWD 0x00000007 /* This is a "change forwarding address" rule */
-#define IP_FW_F_PIPE 0x00000008 /* This is a dummynet rule */
#define IP_FW_F_IN 0x00000100 /* Check inbound packets */
#define IP_FW_F_OUT 0x00000200 /* Check outbound packets */
@@ -193,7 +188,7 @@ void ip_fw_init __P((void));
struct ip;
struct sockopt;
typedef int ip_fw_chk_t __P((struct ip **, int, struct ifnet *, u_int16_t *,
- struct mbuf **, struct ip_fw_chain **, struct sockaddr_in **));
+ struct mbuf **, struct sockaddr_in **));
typedef int ip_fw_ctl_t __P((struct sockopt *));
extern ip_fw_chk_t *ip_fw_chk_ptr;
extern ip_fw_ctl_t *ip_fw_ctl_ptr;
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index d4eb5ca816dd8..186b8e676774a 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id: ip_icmp.c,v 1.32 1998/12/03 20:23:20 dillon Exp $
+ * $Id: ip_icmp.c,v 1.30 1998/05/26 11:34:30 dg Exp $
*/
#include <sys/param.h>
@@ -69,33 +69,10 @@ static int icmpmaskrepl = 0;
SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW,
&icmpmaskrepl, 0, "");
-#ifdef ICMP_BANDLIM
-
-/*
- * ICMP error-response bandwidth limiting sysctl. If not enabled, sysctl
- * variable content is -1 and read-only.
- */
-
-static int icmplim = 100;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW,
- &icmplim, 0, "");
-#else
-
-static int icmplim = -1;
-SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RD,
- &icmplim, 0, "");
-
-#endif
-
-/*
- * ICMP broadcast echo sysctl
- */
-
static int icmpbmcastecho = 0;
SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
0, "");
-
#ifdef ICMPPRINTFS
int icmpprintfs = 0;
#endif
@@ -727,69 +704,3 @@ ip_next_mtu(mtu, dir)
}
}
#endif
-
-#ifdef ICMP_BANDLIM
-
-/*
- * badport_bandlim() - check for ICMP bandwidth limit
- *
- * Return 0 if it is ok to send an ICMP error response, -1 if we have
- * hit our bandwidth limit and it is not ok.
- *
- * If icmplim is <= 0, the feature is disabled and 0 is returned.
- *
- * For now we separate the TCP and UDP subsystems w/ different 'which'
- * values. We may eventually remove this separation (and simplify the
- * code further).
- *
- * Note that the printing of the error message is delayed so we can
- * properly print the icmp error rate that the system was trying to do
- * (i.e. 22000/100 pps, etc...). This can cause long delays in printing
- * the 'final' error, but it doesn't make sense to solve the printing
- * delay with more complex code.
- */
-
-int
-badport_bandlim(int which)
-{
- static int lticks[2];
- static int lpackets[2];
- int dticks;
-
- /*
- * Return ok status if feature disabled or argument out of
- * ranage.
- */
-
- if (icmplim <= 0 || which >= 2 || which < 0)
- return(0);
- dticks = ticks - lticks[which];
-
- /*
- * reset stats when cumulative dt exceeds one second.
- */
-
- if ((unsigned int)dticks > hz) {
- if (lpackets[which] > icmplim) {
- printf("icmp-response bandwidth limit %d/%d pps\n",
- lpackets[which],
- icmplim
- );
- }
- lticks[which] = ticks;
- lpackets[which] = 0;
- }
-
- /*
- * bump packet count
- */
-
- if (++lpackets[which] > icmplim) {
- return(-1);
- }
- return(0);
-}
-
-#endif
-
-
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index d6cc0d532469c..18f9fe209edb1 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $Id: ip_input.c,v 1.110 1998/12/21 22:40:54 luigi Exp $
+ * $Id: ip_input.c,v 1.101 1998/09/10 08:56:40 dfr Exp $
* $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $
*/
@@ -39,7 +39,6 @@
#include "opt_bootp.h"
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#include "opt_ipdivert.h"
#include "opt_ipfilter.h"
@@ -48,7 +47,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
-#include <sys/malloc.h>
#include <sys/domain.h>
#include <sys/protosw.h>
#include <sys/socket.h>
@@ -78,10 +76,6 @@
#include <netinet/ip_fw.h>
#endif
-#ifdef DUMMYNET
-#include <netinet/ip_dummynet.h>
-#endif
-
int rsvp_on = 0;
static int ip_rsvp_on;
struct socket *ip_rsvpd;
@@ -155,10 +149,6 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW,
ip_fw_chk_t *ip_fw_chk_ptr;
ip_fw_ctl_t *ip_fw_ctl_ptr;
-#ifdef DUMMYNET
-ip_dn_ctl_t *ip_dn_ctl_ptr;
-#endif
-
/* IP Network Address Translation (NAT) hooks */
ip_nat_t *ip_nat_ptr;
ip_nat_ctl_t *ip_nat_ctl_ptr;
@@ -234,9 +224,6 @@ ip_init()
ip_id = time_second & 0xffff;
ipintrq.ifq_maxlen = ipqmaxlen;
-#ifdef DUMMYNET
- ip_dn_init();
-#endif
#ifdef IPNAT
ip_nat_init();
#endif
@@ -258,33 +245,10 @@ ip_input(struct mbuf *m)
{
struct ip *ip;
struct ipq *fp;
+ struct ipqent *ipqe;
struct in_ifaddr *ia;
int i, hlen, mff;
u_short sum;
-#ifndef IPDIVERT /* dummy variable for the firewall code to play with */
- u_short ip_divert_cookie = 0 ;
-#endif
-#ifdef COMPAT_IPFW
- struct ip_fw_chain *rule = NULL ;
-#endif
-
-#if defined(IPFIREWALL) && defined(DUMMYNET)
- /*
- * dummynet packet are prepended a vestigial mbuf with
- * m_type = MT_DUMMYNET and m_data pointing to the matching
- * rule.
- */
- if (m->m_type == MT_DUMMYNET) {
- struct mbuf *m0 = m ;
- rule = (struct ip_fw_chain *)(m->m_data) ;
- m = m->m_next ;
- free(m0, M_IPFW);
- ip = mtod(m, struct ip *);
- hlen = IP_VHL_HL(ip->ip_vhl) << 2;
- goto iphack ;
- } else
- rule = NULL ;
-#endif
#ifdef DIAGNOSTIC
if (m == NULL || (m->m_flags & M_PKTHDR) == 0)
@@ -373,14 +337,9 @@ tooshort:
* deals with it.
* - Firewall: deny/allow/divert
* - Xlate: translate packet's addr/port (NAT).
- * - Pipe: pass pkt through dummynet.
* - Wrap: fake packet's addr/port <unimpl.>
* - Encapsulate: put it in another IP and send out. <unimp.>
*/
-
-#if defined(IPFIREWALL) && defined(DUMMYNET)
-iphack:
-#endif
#if defined(IPFILTER) || defined(IPFILTER_LKM)
/*
* Check if we want to allow this packet to be processed.
@@ -396,6 +355,8 @@ iphack:
#endif
#ifdef COMPAT_IPFW
if (ip_fw_chk_ptr) {
+ u_int16_t port;
+
#ifdef IPFIREWALL_FORWARD
/*
* If we've been forwarded from the output side, then
@@ -404,41 +365,29 @@ iphack:
if (ip_fw_fwd_addr)
goto ours;
#endif /* IPFIREWALL_FORWARD */
- i = (*ip_fw_chk_ptr)(&ip, hlen, NULL, &ip_divert_cookie,
- &m, &rule, &ip_fw_fwd_addr);
- /*
- * see the comment in ip_output for the return values
- * produced by the firewall.
- */
- if (!m) /* packet discarded by firewall */
- return ;
- if (i == 0 && ip_fw_fwd_addr == NULL) /* common case */
- goto pass ;
-#ifdef DUMMYNET
- if (i & 0x10000) {
- /* send packet to the appropriate pipe */
- dummynet_io(i&0xffff,DN_TO_IP_IN,m,NULL,NULL,0, rule);
- return ;
- }
-#endif
#ifdef IPDIVERT
- if (i > 0 && i < 0x10000) {
+ port = (*ip_fw_chk_ptr)(&ip, hlen, NULL, &ip_divert_cookie,
+ &m, &ip_fw_fwd_addr);
+ if (port) {
/* Divert packet */
- frag_divert_port = i & 0xffff ;
+ frag_divert_port = port;
goto ours;
}
-#endif
-#ifdef IPFIREWALL_FORWARD
- if (i == 0 && ip_fw_fwd_addr != NULL)
- goto pass ;
-#endif
+#else /* !DIVERT */
/*
- * if we get here, the packet must be dropped
+ * If ipfw says divert, we have to just drop packet
+ * Use port as a dummy argument.
*/
+ port = 0;
+ if ((*ip_fw_chk_ptr)(&ip, hlen, NULL, &port,
+ &m, &ip_fw_fwd_addr)) {
m_freem(m);
+ m = NULL;
+ }
+#endif /* !DIVERT */
+ if (!m)
return;
}
-pass:
if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, m->m_pkthdr.rcvif, IP_NAT_IN))
return;
@@ -564,7 +513,7 @@ ours:
*/
if (ip->ip_off & (IP_MF | IP_OFFMASK | IP_RF)) {
if (m->m_flags & M_EXT) { /* XXX */
- if ((m = m_pullup(m, hlen)) == 0) {
+ if ((m = m_pullup(m, sizeof (struct ip))) == 0) {
ipstat.ips_toosmall++;
#ifdef IPDIVERT
frag_divert_port = 0;
@@ -762,13 +711,13 @@ ip_reass(m, fp, where)
fp->ipq_id = ip->ip_id;
fp->ipq_src = ip->ip_src;
fp->ipq_dst = ip->ip_dst;
- fp->ipq_frags = m;
- m->m_nextpkt = NULL;
+ fp->ipq_frags = 0;
#ifdef IPDIVERT
fp->ipq_divert = 0;
fp->ipq_div_cookie = 0;
#endif
- goto inserted;
+ q = 0;
+ goto insert;
}
#define GETIP(m) ((struct ip*)((m)->m_pkthdr.header))
@@ -783,8 +732,7 @@ ip_reass(m, fp, where)
/*
* If there is a preceding segment, it may provide some of
* our data already. If so, drop the data from the incoming
- * segment. If it provides all of our data, drop us, otherwise
- * stick new segment in the proper place.
+ * segment. If it provides all of our data, drop us.
*/
if (p) {
i = GETIP(p)->ip_off + GETIP(p)->ip_len - ip->ip_off;
@@ -795,11 +743,6 @@ ip_reass(m, fp, where)
ip->ip_off += i;
ip->ip_len -= i;
}
- m->m_nextpkt = p->m_nextpkt;
- p->m_nextpkt = m;
- } else {
- m->m_nextpkt = fp->ipq_frags;
- fp->ipq_frags = m;
}
/*
@@ -807,7 +750,7 @@ ip_reass(m, fp, where)
* if they are completely covered, dequeue them.
*/
for (; q != NULL && ip->ip_off + ip->ip_len > GETIP(q)->ip_off;
- q = nq) {
+ p = q, q = nq) {
i = (ip->ip_off + ip->ip_len) -
GETIP(q)->ip_off;
if (i < GETIP(q)->ip_len) {
@@ -817,11 +760,14 @@ ip_reass(m, fp, where)
break;
}
nq = q->m_nextpkt;
- m->m_nextpkt = nq;
+ if (p)
+ p->m_nextpkt = nq;
+ else
+ fp->ipq_frags = nq;
m_freem(q);
}
-inserted:
+insert:
#ifdef IPDIVERT
/*
@@ -836,8 +782,16 @@ inserted:
#endif
/*
- * Check for complete reassembly.
+ * Stick new segment in its place;
+ * check for complete reassembly.
*/
+ if (p == NULL) {
+ m->m_nextpkt = fp->ipq_frags;
+ fp->ipq_frags = m;
+ } else {
+ m->m_nextpkt = p->m_nextpkt;
+ p->m_nextpkt = m;
+ }
next = 0;
for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) {
if (GETIP(q)->ip_off != next)
@@ -1293,7 +1247,7 @@ ip_srcroute()
*(mtod(m, struct in_addr *)) = *p--;
#ifdef DIAGNOSTIC
if (ipprintfs)
- printf(" hops %lx", (u_long)ntohl(mtod(m, struct in_addr *)->s_addr));
+ printf(" hops %lx", ntohl(mtod(m, struct in_addr *)->s_addr));
#endif
/*
@@ -1313,7 +1267,7 @@ ip_srcroute()
while (p >= ip_srcrt.route) {
#ifdef DIAGNOSTIC
if (ipprintfs)
- printf(" %lx", (u_long)ntohl(q->s_addr));
+ printf(" %lx", ntohl(q->s_addr));
#endif
*q++ = *p--;
}
@@ -1323,7 +1277,7 @@ ip_srcroute()
*q = ip_srcrt.dst;
#ifdef DIAGNOSTIC
if (ipprintfs)
- printf(" %lx\n", (u_long)ntohl(q->s_addr));
+ printf(" %lx\n", ntohl(q->s_addr));
#endif
return (m);
}
diff --git a/sys/netinet/ip_log.c b/sys/netinet/ip_log.c
index 8a826ed2985cc..2d789154a46a5 100644
--- a/sys/netinet/ip_log.c
+++ b/sys/netinet/ip_log.c
@@ -5,7 +5,7 @@
* provided that this notice is preserved and due credit is given
* to the original author and the contributors.
*
- * $Id: ip_log.c,v 1.5 1998/11/26 18:54:52 eivind Exp $
+ * $Id: ip_log.c,v 1.3 1998/03/21 14:42:45 peter Exp $
*/
#include "opt_ipfilter.h"
@@ -122,8 +122,8 @@ extern kcondvar_t iplwait;
iplog_t **iplh[IPL_LOGMAX+1], *iplt[IPL_LOGMAX+1];
int iplused[IPL_LOGMAX+1];
-static u_long iplcrc[IPL_LOGMAX+1];
-static u_long iplcrcinit;
+u_long iplcrc[IPL_LOGMAX+1];
+u_long iplcrcinit;
#ifdef linux
static struct wait_queue *iplwait[IPL_LOGMAX+1];
#endif
@@ -135,6 +135,7 @@ static struct wait_queue *iplwait[IPL_LOGMAX+1];
*/
void ipflog_init()
{
+ struct timeval tv;
int i;
for (i = IPL_LOGMAX; i >= 0; i--) {
@@ -145,16 +146,12 @@ void ipflog_init()
# if defined(__FreeBSD__) && __FreeBSD_version >= 300000
read_random(&iplcrcinit, sizeof iplcrcinit);
# else
- {
- struct timeval tv;
-
#if BSD >= 199306 || defined(__FreeBSD__) || defined(__sgi)
- microtime(&tv);
+ microtime(&tv);
# else
- uniqtime(&tv);
+ uniqtime(&tv);
# endif
- iplcrcinit = tv.tv_sec ^ (tv.tv_usec << 8) ^ tv.tv_usec;
- }
+ iplcrcinit = tv.tv_sec ^ (tv.tv_usec << 8) ^ tv.tv_usec;
# endif
}
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 65bfecfaf0a94..3c11f82472744 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -9,14 +9,13 @@
* Modified by Bill Fenner, PARC, April 1995
*
* MROUTING Revision: 3.5
- * $Id: ip_mroute.c,v 1.52 1999/01/12 12:16:50 eivind Exp $
+ * $Id: ip_mroute.c,v 1.48 1998/08/17 01:05:24 bde Exp $
*/
#include "opt_mrouting.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@@ -64,6 +63,8 @@ extern int _mrt_ioctl __P((int req, caddr_t data, struct proc *p));
*/
struct socket *ip_mrouter = NULL;
+static u_int ip_mrtproto = 0;
+static struct mrtstat mrtstat;
u_int rsvpdebug = 0;
int
@@ -186,7 +187,7 @@ ip_rsvp_force_done(so)
#define same(a1, a2) \
(bcmp((caddr_t)(a1), (caddr_t)(a2), INSIZ) == 0)
-static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast routing tables");
+#define MT_MRTABLE MT_RTABLE /* since nothing else uses it */
/*
* Globals. All but ip_mrouter and ip_mrtproto could be static,
@@ -195,6 +196,8 @@ static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast routing tables");
#ifndef MROUTE_LKM
struct socket *ip_mrouter = NULL;
static struct mrtstat mrtstat;
+
+static int ip_mrtproto = IGMP_DVMRP; /* for netstat only */
#else /* MROUTE_LKM */
extern void X_ipip_input __P((struct mbuf *m, int iphlen));
extern struct mrtstat mrtstat;
@@ -204,7 +207,7 @@ static int ip_mrtproto;
#define NO_RTE_FOUND 0x1
#define RTE_FOUND 0x2
-static struct mfc *mfctable[MFCTBLSIZ];
+static struct mbuf *mfctable[MFCTBLSIZ];
static u_char nexpire[MFCTBLSIZ];
static struct vif viftable[MAXVIFS];
static u_int mrtdebug = 0; /* debug level */
@@ -322,17 +325,19 @@ static int pim_assert;
*/
#define MFCFIND(o, g, rt) { \
- register struct mfc *_rt = mfctable[MFCHASH(o,g)]; \
+ register struct mbuf *_mb_rt = mfctable[MFCHASH(o,g)]; \
+ register struct mfc *_rt = NULL; \
rt = NULL; \
++mrtstat.mrts_mfc_lookups; \
- while (_rt) { \
+ while (_mb_rt) { \
+ _rt = mtod(_mb_rt, struct mfc *); \
if ((_rt->mfc_origin.s_addr == o) && \
(_rt->mfc_mcastgrp.s_addr == g) && \
- (_rt->mfc_stall == NULL)) { \
+ (_mb_rt->m_act == NULL)) { \
rt = _rt; \
break; \
} \
- _rt = _rt->mfc_next; \
+ _mb_rt = _mb_rt->m_next; \
} \
if (rt == NULL) { \
++mrtstat.mrts_mfc_misses; \
@@ -424,7 +429,6 @@ X_ip_mrouter_set(so, sopt)
error = add_mfc(&mfc);
else
error = del_mfc(&mfc);
- break;
case MRT_ASSERT:
error = sooptcopyin(sopt, &optval, sizeof optval,
@@ -432,7 +436,6 @@ X_ip_mrouter_set(so, sopt)
if (error)
break;
set_assert(optval);
- break;
default:
error = EOPNOTSUPP;
@@ -553,6 +556,8 @@ ip_mrouter_init(so, version)
struct socket *so;
int version;
{
+ int *v;
+
if (mrtdebug)
log(LOG_DEBUG,"ip_mrouter_init: so_type = %d, pr_protocol = %d\n",
so->so_type, so->so_proto->pr_protocol);
@@ -590,7 +595,8 @@ X_ip_mrouter_done()
int i;
struct ifnet *ifp;
struct ifreq ifr;
- struct mfc *rt;
+ struct mbuf *mb_rt;
+ struct mbuf *m;
struct rtdetq *rte;
int s;
@@ -621,18 +627,18 @@ X_ip_mrouter_done()
* Free all multicast forwarding cache entries.
*/
for (i = 0; i < MFCTBLSIZ; i++) {
- for (rt = mfctable[i]; rt != NULL; ) {
- struct mfc *nr = rt->mfc_next;
-
- for (rte = rt->mfc_stall; rte != NULL; ) {
- struct rtdetq *n = rte->next;
-
- m_freem(rte->m);
- free(rte, M_MRTABLE);
- rte = n;
+ mb_rt = mfctable[i];
+ while (mb_rt) {
+ if (mb_rt->m_act != NULL) {
+ while (mb_rt->m_act) {
+ m = mb_rt->m_act;
+ mb_rt->m_act = m->m_act;
+ rte = mtod(m, struct rtdetq *);
+ m_freem(rte->m);
+ m_free(m);
+ }
}
- free(rt, M_MRTABLE);
- rt = nr;
+ mb_rt = m_free(mb_rt);
}
}
@@ -685,6 +691,7 @@ add_vif(vifcp)
static struct sockaddr_in sin = {sizeof sin, AF_INET};
struct ifaddr *ifa;
struct ifnet *ifp;
+ struct ifreq ifr;
int error, s;
struct tbf *v_tbf = tbftable + vifcp->vifc_vifi;
@@ -838,7 +845,9 @@ add_mfc(mfccp)
struct mfcctl *mfccp;
{
struct mfc *rt;
+ register struct mbuf *mb_rt;
u_long hash;
+ struct mbuf *mb_ntry;
struct rtdetq *rte;
register u_short nstl;
int s;
@@ -867,24 +876,25 @@ add_mfc(mfccp)
*/
s = splnet();
hash = MFCHASH(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr);
- for (rt = mfctable[hash], nstl = 0; rt; rt = rt->mfc_next) {
+ for (mb_rt = mfctable[hash], nstl = 0; mb_rt; mb_rt = mb_rt->m_next) {
+ rt = mtod(mb_rt, struct mfc *);
if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
(rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
- (rt->mfc_stall != NULL)) {
+ (mb_rt->m_act != NULL)) {
if (nstl++)
log(LOG_ERR, "add_mfc %s o %lx g %lx p %x dbx %p\n",
"multiple kernel entries",
(u_long)ntohl(mfccp->mfcc_origin.s_addr),
(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, (void *)rt->mfc_stall);
+ mfccp->mfcc_parent, (void *)mb_rt->m_act);
if (mrtdebug & DEBUG_MFC)
log(LOG_DEBUG,"add_mfc o %lx g %lx p %x dbg %p\n",
(u_long)ntohl(mfccp->mfcc_origin.s_addr),
(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
- mfccp->mfcc_parent, (void *)rt->mfc_stall);
+ mfccp->mfcc_parent, (void *)mb_rt->m_act);
rt->mfc_origin = mfccp->mfcc_origin;
rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
@@ -901,18 +911,19 @@ add_mfc(mfccp)
nexpire[hash]--;
/* free packets Qed at the end of this entry */
- for (rte = rt->mfc_stall; rte != NULL; ) {
- struct rtdetq *n = rte->next;
-
+ while (mb_rt->m_act) {
+ mb_ntry = mb_rt->m_act;
+ rte = mtod(mb_ntry, struct rtdetq *);
+/* #ifdef RSVP_ISI */
ip_mdq(rte->m, rte->ifp, rt, -1);
+/* #endif */
+ mb_rt->m_act = mb_ntry->m_act;
m_freem(rte->m);
#ifdef UPCALL_TIMING
collate(&(rte->t));
#endif /* UPCALL_TIMING */
- free(rte, M_MRTABLE);
- rte = n;
+ m_free(mb_ntry);
}
- rt->mfc_stall = NULL;
}
}
@@ -926,8 +937,9 @@ add_mfc(mfccp)
(u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr),
mfccp->mfcc_parent);
- for (rt = mfctable[hash]; rt != NULL; rt = rt->mfc_next) {
+ for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
+ rt = mtod(mb_rt, struct mfc *);
if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
(rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
@@ -946,14 +958,16 @@ add_mfc(mfccp)
rt->mfc_expire = 0;
}
}
- if (rt == NULL) {
+ if (mb_rt == NULL) {
/* no upcall, so make a new entry */
- rt = (struct mfc *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT);
- if (rt == NULL) {
+ MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
+ if (mb_rt == NULL) {
splx(s);
return ENOBUFS;
}
+ rt = mtod(mb_rt, struct mfc *);
+
/* insert new entry at head of hash chain */
rt->mfc_origin = mfccp->mfcc_origin;
rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
@@ -966,11 +980,11 @@ add_mfc(mfccp)
rt->mfc_wrong_if = 0;
rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
rt->mfc_expire = 0;
- rt->mfc_stall = NULL;
/* link into table */
- rt->mfc_next = mfctable[hash];
- mfctable[hash] = rt;
+ mb_rt->m_next = mfctable[hash];
+ mfctable[hash] = mb_rt;
+ mb_rt->m_act = NULL;
}
}
splx(s);
@@ -1013,7 +1027,8 @@ del_mfc(mfccp)
struct in_addr origin;
struct in_addr mcastgrp;
struct mfc *rt;
- struct mfc **nptr;
+ struct mbuf *mb_rt;
+ struct mbuf **nptr;
u_long hash;
int s;
@@ -1028,21 +1043,21 @@ del_mfc(mfccp)
s = splnet();
nptr = &mfctable[hash];
- while ((rt = *nptr) != NULL) {
+ while ((mb_rt = *nptr) != NULL) {
+ rt = mtod(mb_rt, struct mfc *);
if (origin.s_addr == rt->mfc_origin.s_addr &&
mcastgrp.s_addr == rt->mfc_mcastgrp.s_addr &&
- rt->mfc_stall == NULL)
+ mb_rt->m_act == NULL)
break;
- nptr = &rt->mfc_next;
+ nptr = &mb_rt->m_next;
}
- if (rt == NULL) {
+ if (mb_rt == NULL) {
splx(s);
return EADDRNOTAVAIL;
}
- *nptr = rt->mfc_next;
- free(rt, M_MRTABLE);
+ MFREE(mb_rt, *nptr);
splx(s);
@@ -1168,9 +1183,13 @@ X_ip_mforward(ip, ifp, m, imo)
* send message to routing daemon
*/
+ register struct mbuf *mb_rt;
+ register struct mbuf *mb_ntry;
register struct mbuf *mb0;
register struct rtdetq *rte;
+ register struct mbuf *rte_m;
register u_long hash;
+ register int npkts;
int hlen = ip->ip_hl << 2;
#ifdef UPCALL_TIMING
struct timeval tp;
@@ -1189,8 +1208,8 @@ X_ip_mforward(ip, ifp, m, imo)
* just going to fail anyway. Make sure to pullup the header so
* that other people can't step on it.
*/
- rte = (struct rtdetq *)malloc((sizeof *rte), M_MRTABLE, M_NOWAIT);
- if (rte == NULL) {
+ MGET(mb_ntry, M_DONTWAIT, MT_DATA);
+ if (mb_ntry == NULL) {
splx(s);
return ENOBUFS;
}
@@ -1198,28 +1217,29 @@ X_ip_mforward(ip, ifp, m, imo)
if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen))
mb0 = m_pullup(mb0, hlen);
if (mb0 == NULL) {
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
splx(s);
return ENOBUFS;
}
/* is there an upcall waiting for this packet? */
hash = MFCHASH(ip->ip_src.s_addr, ip->ip_dst.s_addr);
- for (rt = mfctable[hash]; rt; rt = rt->mfc_next) {
+ for (mb_rt = mfctable[hash]; mb_rt; mb_rt = mb_rt->m_next) {
+ rt = mtod(mb_rt, struct mfc *);
if ((ip->ip_src.s_addr == rt->mfc_origin.s_addr) &&
(ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) &&
- (rt->mfc_stall != NULL))
+ (mb_rt->m_act != NULL))
break;
}
- if (rt == NULL) {
+ if (mb_rt == NULL) {
int i;
struct igmpmsg *im;
/* no upcall, so make a new entry */
- rt = (struct mfc *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT);
- if (rt == NULL) {
- free(rte, M_MRTABLE);
+ MGET(mb_rt, M_DONTWAIT, MT_MRTABLE);
+ if (mb_rt == NULL) {
+ m_free(mb_ntry);
m_freem(mb0);
splx(s);
return ENOBUFS;
@@ -1227,9 +1247,9 @@ X_ip_mforward(ip, ifp, m, imo)
/* Make a copy of the header to send to the user level process */
mm = m_copy(mb0, 0, hlen);
if (mm == NULL) {
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
m_freem(mb0);
- free(rt, M_MRTABLE);
+ m_free(mb_rt);
splx(s);
return ENOBUFS;
}
@@ -1249,13 +1269,15 @@ X_ip_mforward(ip, ifp, m, imo)
if (socket_send(ip_mrouter, mm, &k_igmpsrc) < 0) {
log(LOG_WARNING, "ip_mforward: ip_mrouter socket queue full\n");
++mrtstat.mrts_upq_sockfull;
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
m_freem(mb0);
- free(rt, M_MRTABLE);
+ m_free(mb_rt);
splx(s);
return ENOBUFS;
}
+ rt = mtod(mb_rt, struct mfc *);
+
/* insert new entry at head of hash chain */
rt->mfc_origin.s_addr = ip->ip_src.s_addr;
rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
@@ -1266,36 +1288,36 @@ X_ip_mforward(ip, ifp, m, imo)
rt->mfc_parent = -1;
/* link into table */
- rt->mfc_next = mfctable[hash];
- mfctable[hash] = rt;
- rt->mfc_stall = rte;
+ mb_rt->m_next = mfctable[hash];
+ mfctable[hash] = mb_rt;
+ mb_rt->m_act = NULL;
+ rte_m = mb_rt;
} else {
/* determine if q has overflowed */
- int npkts = 0;
- struct rtdetq **p;
-
- for (p = &rt->mfc_stall; *p != NULL; p = &(*p)->next)
+ for (rte_m = mb_rt, npkts = 0; rte_m->m_act; rte_m = rte_m->m_act)
npkts++;
if (npkts > MAX_UPQ) {
mrtstat.mrts_upq_ovflw++;
- free(rte, M_MRTABLE);
+ m_free(mb_ntry);
m_freem(mb0);
splx(s);
return 0;
}
-
- /* Add this entry to the end of the queue */
- *p = rte;
}
+ mb_ntry->m_act = NULL;
+ rte = mtod(mb_ntry, struct rtdetq *);
+
rte->m = mb0;
rte->ifp = ifp;
#ifdef UPCALL_TIMING
rte->t = tp;
#endif
- rte->next = NULL;
+
+ /* Add this entry to the end of the queue */
+ rte_m->m_act = mb_ntry;
splx(s);
@@ -1314,8 +1336,9 @@ int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
static void
expire_upcalls(void *unused)
{
+ struct mbuf *mb_rt, *m, **nptr;
struct rtdetq *rte;
- struct mfc *mfc, **nptr;
+ struct mfc *mfc;
int i;
int s;
@@ -1324,13 +1347,15 @@ expire_upcalls(void *unused)
if (nexpire[i] == 0)
continue;
nptr = &mfctable[i];
- for (mfc = *nptr; mfc != NULL; mfc = *nptr) {
+ for (mb_rt = *nptr; mb_rt != NULL; mb_rt = *nptr) {
+ mfc = mtod(mb_rt, struct mfc *);
+
/*
* Skip real cache entries
* Make sure it wasn't marked to not expire (shouldn't happen)
* If it expires now
*/
- if (mfc->mfc_stall != NULL &&
+ if (mb_rt->m_act != NULL &&
mfc->mfc_expire != 0 &&
--mfc->mfc_expire == 0) {
if (mrtdebug & DEBUG_EXPIRE)
@@ -1341,20 +1366,20 @@ expire_upcalls(void *unused)
* drop all the packets
* free the mbuf with the pkt, if, timing info
*/
- for (rte = mfc->mfc_stall; rte; ) {
- struct rtdetq *n = rte->next;
-
+ while (mb_rt->m_act) {
+ m = mb_rt->m_act;
+ mb_rt->m_act = m->m_act;
+
+ rte = mtod(m, struct rtdetq *);
m_freem(rte->m);
- free(rte, M_MRTABLE);
- rte = n;
+ m_free(m);
}
++mrtstat.mrts_cache_cleanups;
nexpire[i]--;
- *nptr = mfc->mfc_next;
- free(mfc, M_MRTABLE);
+ MFREE(mb_rt, *nptr);
} else {
- nptr = &mfc->mfc_next;
+ nptr = &mb_rt->m_next;
}
}
}
@@ -1535,7 +1560,7 @@ phyint_send(ip, vifp, m)
if (mb_copy == NULL)
return;
- if (vifp->v_rate_limit == 0)
+ if (vifp->v_rate_limit <= 0)
tbf_send_packet(vifp, mb_copy);
else
tbf_control(vifp, mb_copy, mtod(mb_copy, struct ip *), ip->ip_len);
@@ -1596,7 +1621,7 @@ encap_send(ip, vifp, m)
ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
mb_copy->m_data -= sizeof(multicast_encap_iphdr);
- if (vifp->v_rate_limit == 0)
+ if (vifp->v_rate_limit <= 0)
tbf_send_packet(vifp, mb_copy);
else
tbf_control(vifp, mb_copy, ip, ip_copy->ip_len);
diff --git a/sys/netinet/ip_mroute.h b/sys/netinet/ip_mroute.h
index 0526bbb18f751..94ddeac0608a2 100644
--- a/sys/netinet/ip_mroute.h
+++ b/sys/netinet/ip_mroute.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
- * $Id: ip_mroute.h,v 1.14 1998/08/23 03:07:14 wollman Exp $
+ * $Id: ip_mroute.h,v 1.13 1997/02/22 09:41:35 peter Exp $
*/
#ifndef _NETINET_IP_MROUTE_H_
@@ -188,8 +188,6 @@ struct mfc {
u_long mfc_wrong_if; /* wrong if for src-grp */
int mfc_expire; /* time to clean entry up */
struct timeval mfc_last_assert; /* last time I sent an assert*/
- struct rtdetq *mfc_stall; /* q of packets awaiting mfc */
- struct mfc *mfc_next; /* next mfc entry */
};
/*
@@ -218,7 +216,6 @@ struct rtdetq {
#ifdef UPCALL_TIMING
struct timeval t; /* Timestamp */
#endif /* UPCALL_TIMING */
- struct rtdetq *next; /* Next in list of packets */
};
#define MFCTBLSIZ 256
diff --git a/sys/netinet/ip_nat.c b/sys/netinet/ip_nat.c
index 243c8bb191446..673e1f3a80b89 100644
--- a/sys/netinet/ip_nat.c
+++ b/sys/netinet/ip_nat.c
@@ -9,7 +9,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_nat.c,v 1.4 1998/08/15 21:51:53 bde Exp $";
+static const char rcsid[] = "@(#)$Id: ip_nat.c,v 1.3 1998/06/20 18:37:50 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -103,11 +103,11 @@ extern struct ifnet vpnif;
#undef SOCKADDR_IN
#define SOCKADDR_IN struct sockaddr_in
- nat_t *nat_table[2][NAT_SIZE], *nat_instances = NULL;
-static ipnat_t *nat_list = NULL;
+nat_t *nat_table[2][NAT_SIZE], *nat_instances = NULL;
+ipnat_t *nat_list = NULL;
u_long fr_defnatage = 1200, /* 10 minutes (600 seconds) */
fr_defnaticmpage = 6; /* 3 seconds */
-static natstat_t nat_stats;
+natstat_t nat_stats;
#if (SOLARIS || defined(__sgi)) && defined(_KERNEL)
extern kmutex_t ipf_nat;
#endif
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index a180e401b8de9..be7722885a651 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -31,19 +31,17 @@
* SUCH DAMAGE.
*
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id: ip_output.c,v 1.84 1998/12/14 18:09:13 luigi Exp $
+ * $Id: ip_output.c,v 1.81 1998/08/23 03:07:14 wollman Exp $
*/
#define _IP_VHL
#include "opt_ipfw.h"
-#include "opt_ipdn.h"
#include "opt_ipdivert.h"
#include "opt_ipfilter.h"
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
@@ -78,10 +76,6 @@ static MALLOC_DEFINE(M_IPMOPTS, "ip_moptions", "internet multicast options");
#include <netinet/ip_fw.h>
#endif
-#ifdef DUMMYNET
-#include <netinet/ip_dummynet.h>
-#endif
-
#ifdef IPFIREWALL_FORWARD_DEBUG
#define print_ip(a) printf("%ld.%ld.%ld.%ld",(ntohl(a.s_addr)>>24)&0xFF,\
(ntohl(a.s_addr)>>16)&0xFF,\
@@ -136,41 +130,6 @@ ip_output(m0, opt, ro, flags, imo)
int fwd_rewrite_src = 0;
#endif
-#ifndef IPDIVERT /* dummy variable for the firewall code to play with */
- u_short ip_divert_cookie = 0 ;
-#endif
-#ifdef COMPAT_IPFW
- struct ip_fw_chain *rule = NULL ;
-#endif
-
-#if defined(IPFIREWALL) && defined(DUMMYNET)
- /*
- * dummynet packet are prepended a vestigial mbuf with
- * m_type = MT_DUMMYNET and m_data pointing to the matching
- * rule.
- */
- if (m->m_type == MT_DUMMYNET) {
- struct mbuf *tmp_m = m ;
- /*
- * the packet was already tagged, so part of the
- * processing was already done, and we need to go down.
- * opt, flags and imo have already been used, and now
- * they are used to hold ifp and hlen and NULL, respectively.
- */
- rule = (struct ip_fw_chain *)(m->m_data) ;
- m = m->m_next ;
- free(tmp_m, M_IPFW);
- ip = mtod(m, struct ip *);
- dst = (struct sockaddr_in *)&ro->ro_dst;
- ifp = (struct ifnet *)opt;
- hlen = IP_VHL_HL(ip->ip_vhl) << 2 ;
- opt = NULL ;
- flags = 0 ; /* XXX is this correct ? */
- goto sendit;
- } else
- rule = NULL ;
-#endif
-
#ifdef DIAGNOSTIC
if ((m->m_flags & M_PKTHDR) == 0)
panic("ip_output no HDR");
@@ -434,52 +393,28 @@ sendit:
* Check with the firewall...
*/
if (ip_fw_chk_ptr) {
+#ifdef IPFIREWALL_FORWARD
struct sockaddr_in *old = dst;
-
- off = (*ip_fw_chk_ptr)(&ip,
- hlen, ifp, &ip_divert_cookie, &m, &rule, &dst);
- /*
- * On return we must do the following:
- * m == NULL -> drop the pkt
- * 1<=off<= 0xffff -> DIVERT
- * (off & 0x10000) -> send to a DUMMYNET pipe
- * dst != old -> IPFIREWALL_FORWARD
- * off==0, dst==old -> accept
- * If some of the above modules is not compiled in, then
- * we should't have to check the corresponding condition
- * (because the ipfw control socket should not accept
- * unsupported rules), but better play safe and drop
- * packets in case of doubt.
- */
- if (!m) { /* firewall said to reject */
- error = EACCES;
+#endif
+#ifdef IPDIVERT
+ ip_divert_port = (*ip_fw_chk_ptr)(&ip,
+ hlen, ifp, &ip_divert_cookie, &m, &dst);
+ if (ip_divert_port) { /* Divert packet */
+ (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
goto done;
}
- if (off == 0 && dst == old) /* common case */
- goto pass ;
-#ifdef DUMMYNET
- if (off & 0x10000) {
- /*
- * pass the pkt to dummynet. Need to include
- * pipe number, m, ifp, ro, hlen because these are
- * not recomputed in the next pass.
- * All other parameters have been already used and
- * so they are not needed anymore.
- * XXX note: if the ifp or ro entry are deleted
- * while a pkt is in dummynet, we are in trouble!
- */
- dummynet_io(off & 0xffff, DN_TO_IP_OUT, m,ifp,ro,hlen,rule);
+#else /* !IPDIVERT */
+ u_int16_t dummy = 0;
+ /* If ipfw says divert, we have to just drop packet */
+ if ((*ip_fw_chk_ptr)(&ip, hlen, ifp, &dummy, &m, &dst)) {
+ m_freem(m);
goto done;
}
-#endif
-#ifdef IPDIVERT
- if (off > 0 && off < 0x10000) { /* Divert packet */
- ip_divert_port = off & 0xffff ;
- (*inetsw[ip_protox[IPPROTO_DIVERT]].pr_input)(m, 0);
+#endif /* !IPDIVERT */
+ if (!m) {
+ error = EACCES;
goto done;
}
-#endif
-
#ifdef IPFIREWALL_FORWARD
/* Here we check dst to make sure it's directly reachable on the
* interface we previously thought it was.
@@ -490,7 +425,7 @@ sendit:
* such control is nigh impossible. So we do it here.
* And I'm babbling.
*/
- if (off == 0 && old != dst) {
+ if (old != dst) {
struct in_ifaddr *ia;
/* It's changed... */
@@ -579,20 +514,12 @@ sendit:
*/
if (fwd_rewrite_src)
ip->ip_src = IA_SIN(ia)->sin_addr;
- goto pass ;
}
#endif /* IPFIREWALL_FORWARD */
- /*
- * if we get here, none of the above matches, and
- * we have to drop the pkt
- */
- m_freem(m);
- error = EACCES; /* not sure this is the right error msg */
- goto done;
}
#endif /* COMPAT_IPFW */
-pass:
+
/*
* If small enough for interface, can just send directly.
*/
diff --git a/sys/netinet/ip_state.c b/sys/netinet/ip_state.c
index 5545b3daea0f6..98cc86295ade3 100644
--- a/sys/netinet/ip_state.c
+++ b/sys/netinet/ip_state.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_state.c 1.8 6/5/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_state.c,v 1.3 1998/06/20 18:37:51 peter Exp $";
+static const char rcsid[] = "@(#)$Id: ip_state.c,v 1.2 1998/03/21 11:34:27 peter Exp $";
#endif
#include "opt_ipfilter.h"
@@ -85,9 +85,9 @@ static const char rcsid[] = "@(#)$Id: ip_state.c,v 1.3 1998/06/20 18:37:51 peter
#define TCP_CLOSE (TH_FIN|TH_RST)
-static ipstate_t *ips_table[IPSTATE_SIZE];
-static int ips_num = 0;
-static ips_stat_t ips_stats;
+ipstate_t *ips_table[IPSTATE_SIZE];
+int ips_num = 0;
+ips_stat_t ips_stats;
#if (SOLARIS || defined(__sgi)) && defined(_KERNEL)
extern kmutex_t ipf_state;
#endif
diff --git a/sys/netinet/mlf_ipl.c b/sys/netinet/mlf_ipl.c
index 1ef9077e53d56..d3abe3e8faf01 100644
--- a/sys/netinet/mlf_ipl.c
+++ b/sys/netinet/mlf_ipl.c
@@ -81,8 +81,29 @@
extern int lkmenodev __P((void));
+static char *ipf_devfiles[] = { IPL_NAME, IPL_NAT, IPL_STATE, IPL_AUTH,
+ NULL };
+static int if_ipl_unload __P((struct lkm_table *, int));
+static int if_ipl_load __P((struct lkm_table *, int));
+static int if_ipl_remove __P((void));
int xxxinit __P((struct lkm_table *, int, int));
+
+struct cdevsw ipldevsw =
+{
+ iplopen, /* open */
+ iplclose, /* close */
+ iplread, /* read */
+ (void *)nullop, /* write */
+ iplioctl, /* ioctl */
+ (void *)nullop, /* stop */
+ (void *)nullop, /* reset */
+ (void *)NULL, /* tty */
+ (void *)nullop, /* select */
+ (void *)nullop, /* mmap */
+ NULL /* strategy */
+};
+
#ifdef SYSCTL_INT
SYSCTL_NODE(_net_inet, OID_AUTO, ipf, CTLFLAG_RW, 0, "IPF");
SYSCTL_INT(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &fr_flags, 0, "");
@@ -119,33 +140,19 @@ SYSCTL_INT(_net_inet_ipf, OID_AUTO, fr_defaultauthage, CTLFLAG_RW,
#endif
#ifdef DEVFS
-static void *ipf_devfs[IPL_LOGMAX + 1];
+void *ipf_devfs[IPL_LOGMAX + 1];
#endif
#if !defined(__FreeBSD_version) || (__FreeBSD_version < 220000)
int ipl_major = 0;
-static struct cdevsw ipldevsw =
-{
- iplopen, /* open */
- iplclose, /* close */
- iplread, /* read */
- (void *)nullop, /* write */
- iplioctl, /* ioctl */
- (void *)nullop, /* stop */
- (void *)nullop, /* reset */
- (void *)NULL, /* tty */
- (void *)nullop, /* select */
- (void *)nullop, /* mmap */
- NULL /* strategy */
-};
-
MOD_DEV(IPL_VERSION, LM_DT_CHAR, -1, &ipldevsw);
extern struct cdevsw cdevsw[];
extern int vd_unuseddev __P((void));
extern int nchrdev;
#else
+int ipl_major = CDEV_MAJOR;
static struct cdevsw ipl_cdevsw = {
iplopen, iplclose, iplread, nowrite, /* 79 */
@@ -159,13 +166,8 @@ static struct cdevsw ipl_cdevsw = {
static void ipl_drvinit __P((void *));
#ifdef ACTUALLY_LKM_NOT_KERNEL
-static int if_ipl_unload __P((struct lkm_table *, int));
-static int if_ipl_load __P((struct lkm_table *, int));
-static int if_ipl_remove __P((void));
-static int ipl_major = CDEV_MAJOR;
-
static int iplaction __P((struct lkm_table *, int));
-static char *ipf_devfiles[] = { IPL_NAME, IPL_NAT, IPL_STATE, IPL_AUTH, NULL };
+
static int iplaction(lkmtp, cmd)
struct lkm_table *lkmtp;
int cmd;
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 1dd361822dd28..ee05690cb94f5 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
- * $Id: raw_ip.c,v 1.55 1998/08/23 03:07:14 wollman Exp $
+ * $Id: raw_ip.c,v 1.54 1998/05/15 20:11:34 wollman Exp $
*/
#include <sys/param.h>
@@ -61,10 +61,6 @@
#include <netinet/ip_fw.h>
-#include "opt_ipdn.h"
-#ifdef DUMMYNET
-#include <netinet/ip_dummynet.h>
-#endif
#if !defined(COMPAT_IPFW) || COMPAT_IPFW == 1
#undef COMPAT_IPFW
#define COMPAT_IPFW 1
@@ -263,14 +259,6 @@ rip_ctloutput(so, sopt)
else
error = ip_nat_ctl_ptr(sopt);
break;
-#ifdef DUMMYNET
- case IP_DUMMYNET_GET:
- if (ip_dn_ctl_ptr == NULL)
- error = ENOPROTOOPT ;
- else
- error = ip_dn_ctl_ptr(sopt);
- break ;
-#endif /* DUMMYNET */
#endif /* COMPAT_IPFW */
case MRT_INIT:
@@ -320,16 +308,6 @@ rip_ctloutput(so, sopt)
else
error = ip_nat_ctl_ptr(sopt);
break;
-#ifdef DUMMYNET
- case IP_DUMMYNET_CONFIGURE:
- case IP_DUMMYNET_DEL:
- case IP_DUMMYNET_FLUSH:
- if (ip_dn_ctl_ptr == NULL)
- error = ENOPROTOOPT ;
- else
- error = ip_dn_ctl_ptr(sopt);
- break ;
-#endif
#endif /* COMPAT_IPFW */
case IP_RSVP_ON:
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 97d1983b00786..bb88d163986b8 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -31,10 +31,10 @@
* SUCH DAMAGE.
*
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id: tcp_input.c,v 1.81 1998/09/11 16:04:03 wollman Exp $
+ * $Id: tcp_input.c,v 1.80 1998/08/24 07:47:39 dfr Exp $
*/
-#include "opt_ipfw.h" /* for ipfw_fwd */
+#include "opt_ipfw.h" /* for ipfw_fwd */
#include "opt_tcpdebug.h"
#include <sys/param.h>
@@ -57,10 +57,8 @@
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <netinet/ip_icmp.h> /* for ICMP_BANDLIM */
#include <netinet/in_pcb.h>
#include <netinet/ip_var.h>
-#include <netinet/icmp_var.h> /* for ICMP_BANDLIM */
#include <netinet/tcp.h>
#include <netinet/tcp_fsm.h>
#include <netinet/tcp_seq.h>
@@ -399,10 +397,6 @@ findpcb:
buf, ntohs(ti->ti_dport), inet_ntoa(ti->ti_src),
ntohs(ti->ti_sport));
}
-#ifdef ICMP_BANDLIM
- if (badport_bandlim(1) < 0)
- goto drop;
-#endif
goto dropwithreset;
}
tp = intotcpcb(inp);
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 36f431ac6182c..a0ae43af0b4b0 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
- * $Id: tcp_output.c,v 1.31 1998/07/13 11:53:59 bde Exp $
+ * $Id: tcp_output.c,v 1.30 1998/05/24 18:41:04 fenner Exp $
*/
#include "opt_tcpdebug.h"
@@ -223,8 +223,7 @@ again:
if (len) {
if (len == tp->t_maxseg)
goto send;
- if (!(tp->t_flags & TF_MORETOCOME) &&
- (idle || tp->t_flags & TF_NODELAY) &&
+ if ((idle || tp->t_flags & TF_NODELAY) &&
(tp->t_flags & TF_NOPUSH) == 0 &&
len + off >= so->so_snd.sb_cc)
goto send;
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 12ca0258f12f5..c1c29e4524f88 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id: tcp_subr.c,v 1.48 1998/11/15 21:35:09 guido Exp $
+ * $Id: tcp_subr.c,v 1.46 1998/08/24 07:47:39 dfr Exp $
*/
#include "opt_compat.h"
@@ -209,8 +209,7 @@ tcp_respond(tp, ti, m, ack, seq, flags)
struct route sro;
if (tp) {
- if (!(flags & TH_RST))
- win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
+ win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
ro = &tp->t_inpcb->inp_route;
} else {
ro = &sro;
@@ -348,6 +347,7 @@ tcp_close(tp)
register struct mbuf *nq;
struct inpcb *inp = tp->t_inpcb;
struct socket *so = inp->inp_socket;
+ register struct mbuf *m;
register struct rtentry *rt;
int dosavessthresh;
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 66519cef45f85..ba0c01233636e 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
- * $Id: tcp_usrreq.c,v 1.39 1998/12/07 21:58:42 archie Exp $
+ * $Id: tcp_usrreq.c,v 1.37 1998/01/27 09:15:11 davidg Exp $
*/
#include "opt_tcpdebug.h"
@@ -368,13 +368,8 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
socantsendmore(so);
tp = tcp_usrclosed(tp);
}
- if (tp != NULL) {
- if (flags & PRUS_MORETOCOME)
- tp->t_flags |= TF_MORETOCOME;
+ if (tp != NULL)
error = tcp_output(tp);
- if (flags & PRUS_MORETOCOME)
- tp->t_flags &= ~TF_MORETOCOME;
- }
} else {
if (sbspace(&so->so_snd) < -512) {
m_freem(m);
@@ -580,6 +575,7 @@ tcp_ctloutput(so, sopt)
int error, opt, optval, s;
struct inpcb *inp;
struct tcpcb *tp;
+ struct mbuf *m;
error = 0;
s = splnet(); /* XXX */
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index db4f401a060d0..4e8d88c086fdf 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
- * $Id: tcp_var.h,v 1.48 1998/08/24 07:47:39 dfr Exp $
+ * $Id: tcp_var.h,v 1.47 1998/08/23 03:07:15 wollman Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@@ -54,23 +54,22 @@ struct tcpcb {
struct inpcb *t_inpcb; /* back pointer to internet pcb */
int t_state; /* state of this connection */
u_int t_flags;
-#define TF_ACKNOW 0x00001 /* ack peer immediately */
-#define TF_DELACK 0x00002 /* ack, but try to delay it */
-#define TF_NODELAY 0x00004 /* don't delay packets to coalesce */
-#define TF_NOOPT 0x00008 /* don't use tcp options */
-#define TF_SENTFIN 0x00010 /* have sent FIN */
-#define TF_REQ_SCALE 0x00020 /* have/will request window scaling */
-#define TF_RCVD_SCALE 0x00040 /* other side has requested scaling */
-#define TF_REQ_TSTMP 0x00080 /* have/will request timestamps */
-#define TF_RCVD_TSTMP 0x00100 /* a timestamp was received in SYN */
-#define TF_SACK_PERMIT 0x00200 /* other side said I could SACK */
-#define TF_NEEDSYN 0x00400 /* send SYN (implicit state) */
-#define TF_NEEDFIN 0x00800 /* send FIN (implicit state) */
-#define TF_NOPUSH 0x01000 /* don't push */
-#define TF_REQ_CC 0x02000 /* have/will request CC */
-#define TF_RCVD_CC 0x04000 /* a CC was received in SYN */
-#define TF_SENDCCNEW 0x08000 /* send CCnew instead of CC in SYN */
-#define TF_MORETOCOME 0x10000 /* More data to be appended to sock */
+#define TF_ACKNOW 0x0001 /* ack peer immediately */
+#define TF_DELACK 0x0002 /* ack, but try to delay it */
+#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */
+#define TF_NOOPT 0x0008 /* don't use tcp options */
+#define TF_SENTFIN 0x0010 /* have sent FIN */
+#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */
+#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */
+#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */
+#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */
+#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */
+#define TF_NEEDSYN 0x0400 /* send SYN (implicit state) */
+#define TF_NEEDFIN 0x0800 /* send FIN (implicit state) */
+#define TF_NOPUSH 0x1000 /* don't push */
+#define TF_REQ_CC 0x2000 /* have/will request CC */
+#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
+#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
int t_force; /* 1 if forcing out a byte */
tcp_seq snd_una; /* send unacknowledged */
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 3462c70908d3b..d5eae08ae4fd1 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
- * $Id: udp_usrreq.c,v 1.48 1998/08/24 07:47:39 dfr Exp $
+ * $Id: udp_usrreq.c,v 1.47 1998/05/15 20:11:35 wollman Exp $
*/
#include <sys/param.h>
@@ -57,7 +57,6 @@
#include <netinet/in_var.h>
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
-#include <netinet/icmp_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
@@ -297,10 +296,6 @@ udp_input(m, iphlen)
goto bad;
}
*ip = save_ip;
-#ifdef ICMP_BANDLIM
- if (badport_bandlim(0) < 0)
- goto bad;
-#endif
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
return;
}
@@ -696,4 +691,3 @@ struct pr_usrreqs udp_usrreqs = {
pru_rcvoob_notsupp, udp_send, pru_sense_null, udp_shutdown,
in_setsockaddr, sosend, soreceive, sopoll
};
-
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index 6fed4bf57957d..8aee42687512b 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)udp_var.h 8.1 (Berkeley) 6/10/93
- * $Id: udp_var.h,v 1.15 1998/05/15 20:11:36 wollman Exp $
+ * $Id: udp_var.h,v 1.14 1997/09/07 05:26:51 bde Exp $
*/
#ifndef _NETINET_UDP_VAR_H_
@@ -44,6 +44,8 @@ struct udpiphdr {
struct ipovly ui_i; /* overlaid ip structure */
struct udphdr ui_u; /* udp header */
};
+#define ui_next ui_i.ih_next
+#define ui_prev ui_i.ih_prev
#define ui_x1 ui_i.ih_x1
#define ui_pr ui_i.ih_pr
#define ui_len ui_i.ih_len
diff --git a/sys/netipx/ipx.c b/sys/netipx/ipx.c
index 59ccffee4e3b4..ab2f42aa48b34 100644
--- a/sys/netipx/ipx.c
+++ b/sys/netipx/ipx.c
@@ -33,7 +33,7 @@
*
* @(#)ipx.c
*
- * $Id: ipx.c,v 1.13 1998/12/04 22:54:54 archie Exp $
+ * $Id: ipx.c,v 1.11 1997/06/26 19:35:42 jhay Exp $
*/
#include <sys/param.h>
@@ -359,7 +359,7 @@ register struct ipx_addr *addr;
net = "*";
else {
q = work.x_net.c_net;
- snprintf(cnet, sizeof(cnet), "%x%x%x%x",
+ sprintf(cnet, "%x%x%x%x",
q[0], q[1], q[2], q[3]);
for (p = cnet; *p == '0' && p < cnet + 8; p++)
continue;
@@ -372,7 +372,7 @@ register struct ipx_addr *addr;
host = "*";
else {
q = work.x_host.c_host;
- snprintf(chost, sizeof(chost), "%x%x%x%x%x%x",
+ sprintf(chost, "%x%x%x%x%x%x",
q[0], q[1], q[2], q[3], q[4], q[5]);
for (p = chost; *p == '0' && p < chost + 12; p++)
continue;
@@ -382,9 +382,9 @@ register struct ipx_addr *addr;
if (port) {
if (strcmp(host, "*") == 0) {
host = "";
- snprintf(cport, sizeof(cport), "%x", port);
+ sprintf(cport, "%x", port);
} else
- snprintf(cport, sizeof(cport), ".%x", port);
+ sprintf(cport, ".%x", port);
} else
*cport = 0;
diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c
index 63e140646667a..58fb5e24e2647 100644
--- a/sys/netipx/ipx_usrreq.c
+++ b/sys/netipx/ipx_usrreq.c
@@ -33,7 +33,7 @@
*
* @(#)ipx_usrreq.c
*
- * $Id: ipx_usrreq.c,v 1.20 1998/08/23 03:07:15 wollman Exp $
+ * $Id: ipx_usrreq.c,v 1.19 1998/02/09 06:10:25 eivind Exp $
*/
#include "opt_ipx.h"
@@ -314,6 +314,7 @@ ipx_ctloutput(so, sopt)
struct socket *so;
struct sockopt *sopt;
{
+ register struct mbuf *m;
struct ipxpcb *ipxp = sotoipxpcb(so);
int mask, error, optval;
short soptval;
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index 13f336082c3bb..e37a2f89f1e3e 100644
--- a/sys/netipx/spx_usrreq.c
+++ b/sys/netipx/spx_usrreq.c
@@ -33,7 +33,7 @@
*
* @(#)spx_usrreq.h
*
- * $Id: spx_usrreq.c,v 1.21 1998/12/07 21:58:42 archie Exp $
+ * $Id: spx_usrreq.c,v 1.19 1998/05/01 18:30:02 bde Exp $
*/
#include <sys/param.h>
@@ -75,10 +75,12 @@ static struct spx_istat spx_istat;
static int spx_backoff[SPX_MAXRXTSHIFT+1] =
{ 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
+static void spx_abort(struct ipxpcb *ipxp);
static struct spxpcb *spx_close(struct spxpcb *cb);
static struct spxpcb *spx_disconnect(struct spxpcb *cb);
static struct spxpcb *spx_drop(struct spxpcb *cb, int errno);
static int spx_output(struct spxpcb *cb, struct mbuf *m0);
+static void spx_quench(struct ipxpcb *ipxp);
static int spx_reass(struct spxpcb *cb, struct spx *si);
static void spx_setpersist(struct spxpcb *cb);
static void spx_template(struct spxpcb *cb);
@@ -654,6 +656,19 @@ spx_ctlinput(cmd, arg_as_sa, dummy)
break;
}
}
+/*
+ * When a source quench is received, close congestion window
+ * to one packet. We will gradually open it again as we proceed.
+ */
+static void
+spx_quench(ipxp)
+ struct ipxpcb *ipxp;
+{
+ struct spxpcb *cb = ipxtospxpcb(ipxp);
+
+ if (cb != NULL)
+ cb->s_cwnd = CUNIT;
+}
#ifdef notdef
int
@@ -1143,6 +1158,7 @@ spx_ctloutput(so, sopt)
struct socket *so;
struct sockopt *sopt;
{
+ register struct mbuf *m;
struct ipxpcb *ipxp = sotoipxpcb(so);
register struct spxpcb *cb;
int mask, error;
@@ -1736,6 +1752,14 @@ spx_drop(cb, errno)
return (spx_close(cb));
}
+static void
+spx_abort(ipxp)
+ struct ipxpcb *ipxp;
+{
+
+ spx_close((struct spxpcb *)ipxp->ipxp_pcb);
+}
+
/*
* Fast timeout routine for processing delayed acks
*/
diff --git a/sys/netkey/key.c b/sys/netkey/key.c
index 0116b2a23ec35..debf1cb1c3138 100644
--- a/sys/netkey/key.c
+++ b/sys/netkey/key.c
@@ -164,6 +164,7 @@ extern struct sockaddr key_addr;
{ x += ROUNDUP(n); }
static int addrpart_equal __P((struct sockaddr *, struct sockaddr *));
+static int key_freetables __P((void));
static int key_gethashval __P((char *, int, int));
static int key_createkey __P((char *, u_int, struct sockaddr *,
struct sockaddr *, u_int32_t, u_int));
@@ -446,7 +447,6 @@ key_inittables()
return 0;
}
-#ifdef notyet
static int
key_freetables()
{
@@ -456,7 +456,6 @@ key_freetables()
key_acquirelist = NULL;
return 0;
}
-#endif
/*----------------------------------------------------------------------
* key_gethashval():
@@ -2255,27 +2254,24 @@ static int
my_addr(sa)
struct sockaddr *sa;
{
+ struct in6_ifaddr *i6a = 0;
+ struct in_ifaddr *ia = 0;
+
switch(sa->sa_family) {
#ifdef INET6
- case AF_INET6: {
- struct in6_ifaddr *i6a = 0;
-
- for (i6a = in6_ifaddr; i6a; i6a = i6a->ia_next) { /*XXX*/
- if (IN6_ARE_ADDR_EQUAL(&((struct sockaddr_in6 *)sa)->sin6_addr,
- &i6a->ia_addr.sin6_addr))
- return(1);
- }
+ case AF_INET6:
+ for (i6a = in6_ifaddr; i6a; i6a = i6a->ia_next) { /*XXX*/
+ if (IN6_ARE_ADDR_EQUAL(&((struct sockaddr_in6 *)sa)->sin6_addr,
+ &i6a->ia_addr.sin6_addr))
+ return(1);
}
break;
#endif /* INET6 */
- case AF_INET: {
- struct in_ifaddr *ia = 0;
-
- for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next) {
- if (((struct sockaddr_in *)sa)->sin_addr.s_addr ==
- ia->ia_addr.sin_addr.s_addr)
- return(1);
- }
+ case AF_INET:
+ for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next) {
+ if (((struct sockaddr_in *)sa)->sin_addr.s_addr ==
+ ia->ia_addr.sin_addr.s_addr)
+ return(1);
}
break;
}
@@ -2292,6 +2288,7 @@ key_output(m, so)
struct socket *so;
{
struct key_msghdr *km = 0;
+ caddr_t cp, cplimit;
int len;
int error = 0;
int dstfamily = 0;
diff --git a/sys/netkey/key_debug.c b/sys/netkey/key_debug.c
index a596c0c72a502..31f14cacea1ef 100644
--- a/sys/netkey/key_debug.c
+++ b/sys/netkey/key_debug.c
@@ -436,6 +436,7 @@ void dump_mchain(m)
void dump_tcpdump(m)
struct mbuf *m;
{
+ struct mbuf *walker;
int i, j, count;
for (i = count = 0; m && (i < 10); m = m->m_next, i++) {
diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c
index e7fca3d84b485..8bc971d636aab 100644
--- a/sys/netnatm/natm.c
+++ b/sys/netnatm/natm.c
@@ -144,6 +144,7 @@ natm_usr_connect(struct socket *so, struct sockaddr *nam, struct proc *p)
struct natmpcb *npcb;
struct sockaddr_natm *snatm;
struct atm_pseudoioctl api;
+ struct atm_pseudohdr *aph;
struct ifnet *ifp;
int error = 0;
int s2, s = SPLSOFTNET();
@@ -225,10 +226,13 @@ static int
natm_usr_disconnect(struct socket *so)
{
struct natmpcb *npcb;
+ struct sockaddr_natm *snatm;
struct atm_pseudoioctl api;
+ struct atm_pseudohdr *aph;
struct ifnet *ifp;
int error = 0;
int s2, s = SPLSOFTNET();
+ int proto = so->so_proto->pr_protocol;
npcb = (struct natmpcb *) so->so_pcb;
if (npcb == NULL) {
@@ -333,8 +337,8 @@ natm_usr_peeraddr(struct socket *so, struct sockaddr **nam)
bzero(snatm, sizeof(*snatm));
snatm->snatm_len = sizeof(*snatm);
snatm->snatm_family = AF_NATM;
- snprintf(snatm->snatm_if, sizeof(snatm->snatm_if),
- "%s%d", npcb->npcb_ifp->if_name, npcb->npcb_ifp->if_unit);
+ sprintf(snatm->snatm_if, "%s%d", npcb->npcb_ifp->if_name,
+ npcb->npcb_ifp->if_unit);
snatm->snatm_vci = npcb->npcb_vci;
snatm->snatm_vpi = npcb->npcb_vpi;
*nam = dup_sockaddr((struct sockaddr *)snatm, 0);
@@ -623,8 +627,8 @@ struct proc *p;
#if defined(__NetBSD__) || defined(__OpenBSD__)
bcopy(npcb->npcb_ifp->if_xname, snatm->snatm_if, sizeof(snatm->snatm_if));
#elif defined(__FreeBSD__)
- snprintf(snatm->snatm_if, sizeof(snatm->snatm_if),
- "%s%d", npcb->npcb_ifp->if_name, npcb->npcb_ifp->if_unit);
+ sprintf(snatm->snatm_if, "%s%d", npcb->npcb_ifp->if_name,
+ npcb->npcb_ifp->if_unit);
#endif
snatm->snatm_vci = npcb->npcb_vci;
snatm->snatm_vpi = npcb->npcb_vpi;
diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c
index 1efca259d5364..c66e384665401 100644
--- a/sys/nfs/bootp_subr.c
+++ b/sys/nfs/bootp_subr.c
@@ -1,4 +1,4 @@
-/* $Id: bootp_subr.c,v 1.17 1998/12/04 22:54:54 archie Exp $ */
+/* $Id: bootp_subr.c,v 1.14 1998/08/18 00:32:47 bde Exp $ */
/*
* Copyright (c) 1995 Gordon Ross, Adam Glass
@@ -262,11 +262,13 @@ bootpc_call(call,reply,procp)
{
struct socket *so;
struct sockaddr_in *sin, sa;
+ struct mbuf *m;
struct uio auio;
struct sockopt sopt;
struct iovec aio;
struct timeval tv;
int error, on, len, rcvflg, secs, timo;
+ u_int tport;
/*
* Create socket and set its recieve timeout.
@@ -343,7 +345,7 @@ bootpc_call(call,reply,procp)
error = sosend(so, (struct sockaddr *)sin, &auio, NULL,
NULL, 0, procp);
if (error) {
- printf("bootpc_call: sosend: %d state %08x\n", error, (int)so->so_state);
+ printf("bootpc_call: sosend: %d\n", error);
goto out;
}
@@ -728,7 +730,7 @@ bootpc_init(void)
struct socket *so;
int error;
int code,ncode,len;
- int j;
+ int i,j;
char *p;
unsigned int ip;
@@ -742,6 +744,7 @@ bootpc_init(void)
char lookup_path[24];
#define EALEN 6
+ unsigned char ea[EALEN];
struct ifaddr *ifa;
struct sockaddr_dl *sdl = NULL;
char *delim;
@@ -771,8 +774,7 @@ bootpc_init(void)
bzero(&ireq, sizeof(ireq));
for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link))
{
- snprintf(ireq.ifr_name, sizeof(ireq.ifr_name),
- "%s%d", ifp->if_name, ifp->if_unit);
+ sprintf(ireq.ifr_name, "%s%d", ifp->if_name, ifp->if_unit);
#ifdef BOOTP_WIRED_TO
if (strcmp(ireq.ifr_name, __XSTRING(BOOTP_WIRED_TO)) == 0)
break;
@@ -883,7 +885,7 @@ bootpc_init(void)
myaddr.sin_addr = reply.yiaddr;
ip = ntohl(myaddr.sin_addr.s_addr);
- snprintf(lookup_path, sizeof(lookup_path), "swap.%d.%d.%d.%d",
+ sprintf(lookup_path,"swap.%d.%d.%d.%d",
ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
printip("My ip address",myaddr.sin_addr);
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index c9737006f1d47..b8b97a4aa8602 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95
- * $Id: nfs_bio.c,v 1.64 1998/12/07 21:58:43 archie Exp $
+ * $Id: nfs_bio.c,v 1.61 1998/09/29 21:46:54 mckusick Exp $
*/
@@ -86,6 +86,7 @@ nfs_getpages(ap)
int i, error, nextoff, size, toff, npages, count;
struct uio uio;
struct iovec iov;
+ vm_page_t m;
vm_offset_t kva;
struct buf *bp;
struct vnode *vp;
@@ -197,6 +198,7 @@ nfs_putpages(ap)
{
struct uio uio;
struct iovec iov;
+ vm_page_t m;
vm_offset_t kva;
struct buf *bp;
int iomode, must_commit, i, error, npages, count;
@@ -277,8 +279,7 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
int getpages;
{
register struct nfsnode *np = VTONFS(vp);
- register int biosize, i;
- off_t diff;
+ register int biosize, diff, i;
struct buf *bp = 0, *rabp;
struct vattr vattr;
struct proc *p;
@@ -433,7 +434,7 @@ again:
bufsize = biosize;
if ((off_t)(lbn + 1) * biosize > np->n_size &&
(off_t)(lbn + 1) * biosize - np->n_size < biosize) {
- bufsize = np->n_size - (off_t)lbn * biosize;
+ bufsize = np->n_size - lbn * biosize;
bufsize = (bufsize + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
}
bp = nfs_getcacheblk(vp, lbn, bufsize, p);
@@ -755,11 +756,11 @@ again:
if (uio->uio_offset + n > np->n_size) {
np->n_size = uio->uio_offset + n;
np->n_flag |= NMODIFIED;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
}
bufsize = biosize;
- if ((off_t)(lbn + 1) * biosize > np->n_size) {
- bufsize = np->n_size - (off_t)lbn * biosize;
+ if ((lbn + 1) * biosize > np->n_size) {
+ bufsize = np->n_size - lbn * biosize;
bufsize = (bufsize + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
}
bp = nfs_getcacheblk(vp, lbn, bufsize, p);
@@ -771,8 +772,9 @@ again:
}
np->n_flag |= NMODIFIED;
- if ((off_t)bp->b_blkno * DEV_BSIZE + bp->b_dirtyend > np->n_size)
- bp->b_dirtyend = np->n_size - (off_t)bp->b_blkno * DEV_BSIZE;
+ if ((bp->b_blkno * DEV_BSIZE) + bp->b_dirtyend > np->n_size) {
+ bp->b_dirtyend = np->n_size - (bp->b_blkno * DEV_BSIZE);
+ }
/*
* If the new write will leave a contiguous dirty
@@ -903,10 +905,10 @@ nfs_getcacheblk(vp, bn, size, p)
} else
bp = getblk(vp, bn, size, 0, 0);
- if (vp->v_type == VREG) {
+ if( vp->v_type == VREG) {
int biosize;
biosize = mp->mnt_stat.f_iosize;
- bp->b_blkno = bn * (biosize / DEV_BSIZE);
+ bp->b_blkno = (bn * biosize) / DEV_BSIZE;
}
return (bp);
@@ -1216,13 +1218,13 @@ nfs_doio(bp, cr, p)
bp->b_error = error;
}
} else {
- if ((off_t)bp->b_blkno * DEV_BSIZE + bp->b_dirtyend > np->n_size)
- bp->b_dirtyend = np->n_size - (off_t)bp->b_blkno * DEV_BSIZE;
+ if (((bp->b_blkno * DEV_BSIZE) + bp->b_dirtyend) > np->n_size)
+ bp->b_dirtyend = np->n_size - (bp->b_blkno * DEV_BSIZE);
if (bp->b_dirtyend > bp->b_dirtyoff) {
io.iov_len = uiop->uio_resid = bp->b_dirtyend
- bp->b_dirtyoff;
- uiop->uio_offset = (off_t)bp->b_blkno * DEV_BSIZE
+ uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE
+ bp->b_dirtyoff;
io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
uiop->uio_rw = UIO_WRITE;
diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c
index ae6a14a2fc070..a9464dc7b265f 100644
--- a/sys/nfs/nfs_nqlease.c
+++ b/sys/nfs/nfs_nqlease.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_nqlease.c 8.9 (Berkeley) 5/20/95
- * $Id: nfs_nqlease.c,v 1.38 1998/09/05 15:17:33 bde Exp $
+ * $Id: nfs_nqlease.c,v 1.37 1998/05/31 20:08:52 peter Exp $
*/
@@ -1117,8 +1117,7 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, p)
}
} else if ((np->n_expiry - NQ_RENEWAL) < time_second) {
if ((np->n_flag & (NQNFSWRITE | NQNFSNONCACHE))
- == NQNFSWRITE &&
- !TAILQ_EMPTY(&vp->v_dirtyblkhd) &&
+ == NQNFSWRITE && vp->v_dirtyblkhd.lh_first &&
vget(vp, LK_EXCLUSIVE, p) == 0) {
nmp->nm_inprog = vp;
if (vpid == vp->v_id &&
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 346c4fc58c7c0..d701213545373 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95
- * $Id: nfs_serv.c,v 1.71 1998/12/08 23:11:24 eivind Exp $
+ * $Id: nfs_serv.c,v 1.68 1998/05/31 20:08:52 peter Exp $
*/
/*
@@ -1776,7 +1776,8 @@ out:
vrele(nd.ni_dvp);
else
vput(nd.ni_dvp);
- vput(vp);
+ if (vp != NULLVP);
+ vput(vp);
}
if (dirp && v3) {
diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp);
@@ -3121,7 +3122,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
for_ret = VOP_GETATTR(vp, &bfor, cred, procp);
if (vp->v_object &&
(vp->v_object->flags & OBJ_MIGHTBEDIRTY)) {
- vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC);
+ vm_object_page_clean(vp->v_object, 0, 0, TRUE);
}
error = VOP_FSYNC(vp, cred, MNT_WAIT, procp);
aft_ret = VOP_GETATTR(vp, &aft, cred, procp);
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 8c1b812af1651..11ac518995980 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_socket.c,v 1.48 1998/12/07 21:58:44 archie Exp $
+ * $Id: nfs_socket.c,v 1.45 1998/09/07 05:42:15 bde Exp $
*/
/*
@@ -191,6 +191,7 @@ nfs_connect(nmp, rep)
int s, error, rcvreserve, sndreserve;
struct sockaddr *saddr;
struct sockaddr_in *sin;
+ struct mbuf *m;
u_int16_t tport;
struct proc *p = &proc0; /* only used for socreate and sobind */
@@ -403,11 +404,11 @@ nfs_safedisconnect(nmp)
* For the client side:
* - return EINTR if the RPC is terminated, 0 otherwise
* - set R_MUSTRESEND if the send fails for any reason
- * - do any cleanup required by recoverable socket errors (?)
+ * - do any cleanup required by recoverable socket errors (???)
* For the server side:
* - return EINTR or ERESTART if interrupted by a signal
* - return EPIPE if a connection is lost for connection based sockets (TCP...)
- * - do any cleanup required by recoverable socket errors (?)
+ * - do any cleanup required by recoverable socket errors (???)
*/
int
nfs_send(so, nam, top, rep)
@@ -469,7 +470,7 @@ nfs_send(so, nam, top, rep)
log(LOG_INFO, "nfsd send error %d\n", error);
/*
- * Handle any recoverable (soft) socket errors here. (?)
+ * Handle any recoverable (soft) socket errors here. (???)
*/
if (error != EINTR && error != ERESTART &&
error != EWOULDBLOCK && error != EPIPE)
@@ -2231,9 +2232,7 @@ nfsrv_dorec(slp, nfsd, ndp)
nd->nd_dpos = mtod(m, caddr_t);
error = nfs_getreq(nd, nfsd, TRUE);
if (error) {
- if (nam) {
- FREE(nam, M_SONAME);
- }
+ FREE(nam, M_SONAME);
free((caddr_t)nd, M_NFSRVDESC);
return (error);
}
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index b3eec2408a2e9..346e9e6191996 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
- * $Id: nfs_subs.c,v 1.69 1998/12/14 18:54:03 dt Exp $
+ * $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $
*/
/*
@@ -208,8 +208,7 @@ static u_char nfsrv_v2errmap[ELAST] = {
NFSERR_NOTEMPTY, NFSERR_IO, NFSERR_IO, NFSERR_DQUOT, NFSERR_STALE,
NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO,
NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO,
- NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO,
- NFSERR_IO /* << Last is 86 */
+ NFSERR_IO, NFSERR_IO, NFSERR_IO /* << Last is 83 */
};
/*
@@ -651,6 +650,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
register int i;
struct mbuf *mreq, *mb2;
int siz, grpsiz, authsiz;
+ static u_int32_t base;
authsiz = nfsm_rndup(auth_len);
MGETHDR(mb, M_WAIT, MT_DATA);
@@ -1377,7 +1377,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
np->n_size = vap->va_size;
} else
np->n_size = vap->va_size;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
} else
np->n_size = vap->va_size;
}
@@ -1463,7 +1463,7 @@ nfs_getattrcache(vp, vaper)
np->n_size = vap->va_size;
} else
np->n_size = vap->va_size;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
} else
np->n_size = vap->va_size;
}
@@ -2129,8 +2129,8 @@ loop:
if (vp->v_mount != mp) /* Paranoia */
goto loop;
nvp = vp->v_mntvnodes.le_next;
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
== (B_DELWRI | B_NEEDCOMMIT))
bp->b_flags &= ~B_NEEDCOMMIT;
@@ -2177,7 +2177,7 @@ nfsrv_object_create(vp)
if (vp == NULL || vp->v_type != VREG)
return (1);
return (vfs_object_create(vp, curproc,
- curproc ? curproc->p_ucred : NULL));
+ curproc ? curproc->p_ucred : NULL, 1));
}
/*
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 8b85b9b22bd9d..abf3383e709d3 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_syscalls.c,v 1.43 1998/09/01 02:31:52 luoqi Exp $
+ * $Id: nfs_syscalls.c,v 1.42 1998/08/23 03:07:16 wollman Exp $
*/
#include <sys/param.h>
@@ -357,6 +357,7 @@ nfssvc_addsock(fp, mynam, p)
struct sockaddr *mynam;
struct proc *p;
{
+ register struct mbuf *m;
register int siz;
register struct nfssvc_sock *slp;
register struct socket *so;
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index cc4775b618669..23e30c00a9562 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.78 1998/10/31 15:31:26 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.76 1998/09/07 13:17:05 bde Exp $
*/
#include <sys/param.h>
@@ -486,7 +486,7 @@ nfs_mountroot(mp)
nd->root_args.fh = nd->root_fh;
nd->root_args.fhsize = nd->root_fhsize;
l = ntohl(nd->root_saddr.sin_addr.s_addr);
- snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s",
+ sprintf(buf,"%ld.%ld.%ld.%ld:%s",
(l >> 24) & 0xff, (l >> 16) & 0xff,
(l >> 8) & 0xff, (l >> 0) & 0xff,nd->root_hostnam);
printf("NFS ROOT: %s\n",buf);
@@ -512,7 +512,7 @@ nfs_mountroot(mp)
nd->swap_args.fh = nd->swap_fh;
nd->swap_args.fhsize = nd->swap_fhsize;
l = ntohl(nd->swap_saddr.sin_addr.s_addr);
- snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s",
+ sprintf(buf,"%ld.%ld.%ld.%ld:%s",
(l >> 24) & 0xff, (l >> 16) & 0xff,
(l >> 8) & 0xff, (l >> 0) & 0xff,nd->swap_hostnam);
printf("NFS SWAP: %s\n",buf);
@@ -1066,7 +1066,7 @@ loop:
*/
if (vp->v_mount != mp)
goto loop;
- if (VOP_ISLOCKED(vp) || TAILQ_EMPTY(&vp->v_dirtyblkhd) ||
+ if (VOP_ISLOCKED(vp) || vp->v_dirtyblkhd.lh_first == NULL ||
waitfor == MNT_LAZY)
continue;
if (vget(vp, LK_EXCLUSIVE, p))
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index c97267a42aee3..e4917c1d5616b 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.115 1998/12/25 10:34:27 dfr Exp $
+ * $Id: nfs_vnops.c,v 1.108 1998/09/29 23:29:48 mckusick Exp $
*/
@@ -60,7 +60,6 @@
#include <sys/fcntl.h>
#include <sys/lockf.h>
#include <sys/stat.h>
-#include <sys/sysctl.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -248,18 +247,6 @@ struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON];
int nfs_numasync = 0;
#define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1))
-static int nfsaccess_cache_timeout = 2;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
- &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
-
-static int nfsaccess_cache_hits;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD,
- &nfsaccess_cache_hits, 0, "NFS ACCESS cache hit count");
-
-static int nfsaccess_cache_fills;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_fills, CTLFLAG_RD,
- &nfsaccess_cache_fills, 0, "NFS ACCESS cache fill count");
-
/*
* nfs access vnode op.
* For nfs version 2, just return ok. File accesses may fail later.
@@ -282,9 +269,8 @@ nfs_access(ap)
caddr_t bpos, dpos, cp2;
int error = 0, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
- u_int32_t mode, rmode, wmode;
+ u_int32_t mode, rmode;
int v3 = NFS_ISV3(vp);
- struct nfsnode *np = VTONFS(vp);
/*
* Disallow write attempts on filesystems mounted read-only;
@@ -302,14 +288,18 @@ nfs_access(ap)
}
}
/*
- * For nfs v3, check to see if we have done this recently, and if
- * so return our cached result instead of making an ACCESS call.
- * If not, do an access rpc, otherwise you are stuck emulating
+ * For nfs v3, do an access rpc, otherwise you are stuck emulating
* ufs_access() locally using the vattr. This may not be correct,
* since the server may apply other access criteria such as
- * client uid-->server uid mapping that we do not know about.
+ * client uid-->server uid mapping that we do not know about, but
+ * this is better than just returning anything that is lying about
+ * in the cache.
*/
if (v3) {
+ nfsstats.rpccnt[NFSPROC_ACCESS]++;
+ nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
+ nfsm_fhtom(vp, v3);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (ap->a_mode & VREAD)
mode = NFSV3ACCESS_READ;
else
@@ -326,54 +316,21 @@ nfs_access(ap)
if (ap->a_mode & VEXEC)
mode |= NFSV3ACCESS_LOOKUP;
}
- /* XXX safety belt, only make blanket request if caching */
- if (nfsaccess_cache_timeout > 0) {
- wmode = NFSV3ACCESS_READ | NFSV3ACCESS_MODIFY |
- NFSV3ACCESS_EXTEND | NFSV3ACCESS_EXECUTE |
- NFSV3ACCESS_DELETE | NFSV3ACCESS_LOOKUP;
- } else {
- wmode = mode;
- }
-
- /*
- * Does our cached result allow us to give a definite yes to
- * this request?
- */
- if ((time_second < (np->n_modestamp + nfsaccess_cache_timeout)) &&
- (ap->a_cred->cr_uid == np->n_modeuid) &&
- ((np->n_mode & mode) == mode)) {
- nfsaccess_cache_hits++;
- } else {
+ *tl = txdr_unsigned(mode);
+ nfsm_request(vp, NFSPROC_ACCESS, ap->a_p, ap->a_cred);
+ nfsm_postop_attr(vp, attrflag);
+ if (!error) {
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
+ rmode = fxdr_unsigned(u_int32_t, *tl);
/*
- * Either a no, or a don't know. Go to the wire.
+ * The NFS V3 spec does not clarify whether or not
+ * the returned access bits can be a superset of
+ * the ones requested, so...
*/
- nfsstats.rpccnt[NFSPROC_ACCESS]++;
- nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
- nfsm_fhtom(vp, v3);
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
- *tl = txdr_unsigned(wmode);
- nfsm_request(vp, NFSPROC_ACCESS, ap->a_p, ap->a_cred);
- nfsm_postop_attr(vp, attrflag);
- if (!error) {
- nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
- rmode = fxdr_unsigned(u_int32_t, *tl);
- /*
- * The NFS V3 spec does not clarify whether or not
- * the returned access bits can be a superset of
- * the ones requested, so...
- */
- if ((rmode & mode) != mode) {
- error = EACCES;
- } else if (nfsaccess_cache_timeout > 0) {
- /* cache the result */
- nfsaccess_cache_fills++;
- np->n_mode = rmode;
- np->n_modeuid = ap->a_cred->cr_uid;
- np->n_modestamp = time_second;
- }
- }
- nfsm_reqdone;
+ if ((rmode & mode) != mode)
+ error = EACCES;
}
+ nfsm_reqdone;
return (error);
} else {
if (error = nfsspec_access(ap))
@@ -665,7 +622,7 @@ nfs_setattr(ap)
*/
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
- vnode_pager_setsize(vp, vap->va_size);
+ vnode_pager_setsize(vp, (u_long)vap->va_size);
if (np->n_flag & NMODIFIED) {
if (vap->va_size == 0)
error = nfs_vinvalbuf(vp, 0,
@@ -674,7 +631,7 @@ nfs_setattr(ap)
error = nfs_vinvalbuf(vp, V_SAVE,
ap->a_cred, ap->a_p, 1);
if (error) {
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
return (error);
}
}
@@ -690,7 +647,7 @@ nfs_setattr(ap)
error = nfs_setattrrpc(vp, vap, ap->a_cred, ap->a_p);
if (error && vap->va_size != VNOVAL) {
np->n_size = np->n_vattr.va_size = tsize;
- vnode_pager_setsize(vp, np->n_size);
+ vnode_pager_setsize(vp, (u_long)np->n_size);
}
return (error);
}
@@ -718,7 +675,64 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH(v3) + NFSX_SATTR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
- nfsm_v3attrbuild(vap, TRUE);
+ if (vap->va_mode != (mode_t)VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ *tl = txdr_unsigned(vap->va_mode);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_uid != (uid_t)VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ *tl = txdr_unsigned(vap->va_uid);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_gid != (gid_t)VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ *tl = txdr_unsigned(vap->va_gid);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_size != VNOVAL) {
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+ *tl++ = nfs_true;
+ txdr_hyper(&vap->va_size, tl);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = nfs_false;
+ }
+ if (vap->va_atime.tv_sec != VNOVAL) {
+ if (vap->va_atime.tv_sec != time_second) {
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+ *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
+ txdr_nfsv3time(&vap->va_atime, tl);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
+ }
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
+ }
+ if (vap->va_mtime.tv_sec != VNOVAL) {
+ if (vap->va_mtime.tv_sec != time_second) {
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+ *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
+ txdr_nfsv3time(&vap->va_mtime, tl);
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
+ }
+ } else {
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
+ }
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
@@ -1204,6 +1218,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
register struct vattr *vap;
{
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1235,9 +1250,10 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
*tl++ = vtonfsv3_type(vap->va_type);
- nfsm_v3attrbuild(vap, FALSE);
+ sp3 = (struct nfsv3_sattr *)tl;
+ nfsm_v3sattr(sp3, vap);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(major(vap->va_rdev));
@@ -1324,6 +1340,7 @@ nfs_create(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1356,18 +1373,20 @@ again:
if (v3) {
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (fmode & O_EXCL) {
- *tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
- nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
+ *tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
+ nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
#ifdef INET
- if (!TAILQ_EMPTY(&in_ifaddrhead))
- *tl++ = IA_SIN(in_ifaddrhead.tqh_first)->sin_addr.s_addr;
- else
+ if (!TAILQ_EMPTY(&in_ifaddrhead))
+ *tl++ = IA_SIN(in_ifaddrhead.tqh_first)->sin_addr.s_addr;
+ else
#endif
- *tl++ = create_verf;
- *tl = ++create_verf;
+ *tl++ = create_verf;
+ *tl = ++create_verf;
} else {
- *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
- nfsm_v3attrbuild(vap, FALSE);
+ *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
+ nfsm_build(tl, u_int32_t *, NFSX_V3SRVSATTR);
+ sp3 = (struct nfsv3_sattr *)tl;
+ nfsm_v3sattr(sp3, vap);
}
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
@@ -1586,7 +1605,6 @@ nfs_rename(ap)
cache_purge(tdvp);
cache_purge(fdvp);
}
-
out:
if (tdvp == tvp)
vrele(tdvp);
@@ -1741,6 +1759,7 @@ nfs_symlink(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1757,7 +1776,8 @@ nfs_symlink(ap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- nfsm_v3attrbuild(vap, FALSE);
+ nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
+ nfsm_v3sattr(sp3, vap);
}
nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN);
if (!v3) {
@@ -1806,6 +1826,7 @@ nfs_mkdir(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
+ register struct nfsv3_sattr *sp3;
register u_int32_t *tl;
register caddr_t cp;
register int32_t t1, t2;
@@ -1830,7 +1851,8 @@ nfs_mkdir(ap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN);
if (v3) {
- nfsm_v3attrbuild(vap, FALSE);
+ nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
+ nfsm_v3sattr(sp3, vap);
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode);
@@ -2733,8 +2755,8 @@ again:
* Count up how many buffers waiting for a commit.
*/
bveccount = 0;
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
== (B_DELWRI | B_NEEDCOMMIT))
bveccount++;
@@ -2760,8 +2782,8 @@ again:
bvec = bvec_on_stack;
bvecsize = NFS_COMMITBVECSIZ;
}
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if (bvecpos >= bvecsize)
break;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
@@ -2858,8 +2880,8 @@ again:
*/
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if (bp->b_flags & B_BUSY) {
if (waitfor != MNT_WAIT || passone)
continue;
@@ -2913,7 +2935,7 @@ loop:
}
}
}
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd) && commit) {
+ if (vp->v_dirtyblkhd.lh_first && commit) {
goto loop;
}
}
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index 3692b7b1375b3..75158edd074ca 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
- * $Id: nfsm_subs.h,v 1.21 1998/05/31 20:08:57 peter Exp $
+ * $Id: nfsm_subs.h,v 1.20 1998/05/31 19:00:19 peter Exp $
*/
@@ -235,68 +235,17 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(f) = ttattrf; \
} }
-/* If full is true, set all fields, otherwise just set mode and time fields */
-#define nfsm_v3attrbuild(a, full) \
- { if ((a)->va_mode != (mode_t)VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- *tl = txdr_unsigned((a)->va_mode); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((full) && (a)->va_uid != (uid_t)VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- *tl = txdr_unsigned((a)->va_uid); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((full) && (a)->va_gid != (gid_t)VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- *tl = txdr_unsigned((a)->va_gid); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((full) && (a)->va_size != VNOVAL) { \
- nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
- *tl++ = nfs_true; \
- txdr_hyper(&(a)->va_size, tl); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = nfs_false; \
- } \
- if ((a)->va_atime.tv_sec != VNOVAL) { \
- if ((a)->va_atime.tv_sec != time_second) { \
- nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
- *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
- txdr_nfsv3time(&(a)->va_atime, tl); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); \
- } \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); \
- } \
- if ((a)->va_mtime.tv_sec != VNOVAL) { \
- if ((a)->va_mtime.tv_sec != time_second) { \
- nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
- *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
- txdr_nfsv3time(&(a)->va_mtime, tl); \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); \
- } \
- } else { \
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
- *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); \
- } \
+#define nfsm_v3sattr(s, a) \
+ { (s)->sa_modetrue = nfs_true; \
+ (s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
+ (s)->sa_uidfalse = nfs_false; \
+ (s)->sa_gidfalse = nfs_false; \
+ (s)->sa_sizefalse = nfs_false; \
+ (s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
+ txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
+ (s)->sa_mtimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
+ txdr_nfsv3time(&(a)->va_mtime, &(s)->sa_mtime); \
}
-
#define nfsm_strsiz(s,m) \
{ nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h
index 49adeb21e5c7d..51f5d78648893 100644
--- a/sys/nfs/nfsnode.h
+++ b/sys/nfs/nfsnode.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsnode.h 8.9 (Berkeley) 5/14/95
- * $Id: nfsnode.h,v 1.27 1998/11/13 02:39:09 msmith Exp $
+ * $Id: nfsnode.h,v 1.25 1998/03/06 09:46:52 msmith Exp $
*/
@@ -93,9 +93,6 @@ struct nfsnode {
u_quad_t n_lrev; /* Modify rev for lease */
struct vattr n_vattr; /* Vnode attribute cache */
time_t n_attrstamp; /* Attr. cache timestamp */
- u_int32_t n_mode; /* ACCESS mode cache */
- uid_t n_modeuid; /* credentials having mode */
- time_t n_modestamp; /* mode cache timestamp */
time_t n_mtime; /* Prev modify time. */
time_t n_ctime; /* Prev create time. */
time_t n_expiry; /* Lease expiry time */
diff --git a/sys/pc98/boot/Makefile.inc b/sys/pc98/boot/Makefile.inc
index 88916943ec966..c02d4d7980f02 100644
--- a/sys/pc98/boot/Makefile.inc
+++ b/sys/pc98/boot/Makefile.inc
@@ -1,7 +1,5 @@
-# $Id: Makefile.inc,v 1.3 1998/03/14 02:33:54 kato Exp $
+# $Id: Makefile.inc,v 1.2 1998/03/14 02:29:24 kato Exp $
-BINDIR?= /usr/mdec
-CFLAGS+= -aout
.if exists(${.CURDIR}/../../../../include)
CFLAGS+= -nostdinc -I${.CURDIR}/../../../../include
.endif
diff --git a/sys/pc98/boot/biosboot/Makefile b/sys/pc98/boot/biosboot/Makefile
index 3a2640c950d35..cef96e0f6c150 100644
--- a/sys/pc98/boot/biosboot/Makefile
+++ b/sys/pc98/boot/biosboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.21 1999/01/03 05:03:46 kato Exp $
+# $Id: Makefile,v 1.18 1998/05/28 13:46:04 kato Exp $
#
PROG= boot
@@ -6,6 +6,7 @@ PROG= boot
SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S
SRCS+= probe_keyboard.c io.c disk.c sys.c
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-mno-486 \
@@ -15,8 +16,7 @@ CFLAGS+= ${CWARNFLAGS}
# By default, if a serial port is going to be used as console, use COM1
# (aka /dev/ttyd0).
-#BOOT_COMCONSOLE_PORT?=0x30
-BOOT_COMCONSOLE_PORT?=0x238
+BOOT_COMCONSOLE_PORT?=0x30
BOOT_COMCONSOLE_CLK?=16
BOOT_COMCONSOLE_MODE=0x0c
CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
@@ -24,8 +24,8 @@ CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
-DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE}
# feature not implemented
-BOOT_COMCONSOLE_SPEED?=9600
-CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
+# BOOT_COMCONSOLE_SPEED?=9600
+# CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
# Enable code to take the default boot string from a fixed location on the
# disk. See nextboot(8) and README.386BSD for more info.
@@ -64,8 +64,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
@@ -86,11 +86,19 @@ boot2: boot.nohdr
all: boot1 boot2
install:
- ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- boot1 boot2 ${DESTDIR}${BINDIR}/
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot1 ${DESTDIR}${BINDIR}/boot1
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
+ boot2 ${DESTDIR}${BINDIR}/boot2
+ for i in da fd wd od vn wfd ; do \
+ ( cd ${DESTDIR}${BINDIR} ; \
+ rm -f boot$${i} $${i}boot ; \
+ ln -s boot1 $${i}boot ; \
+ ln -s boot2 boot$${i} ; ) \
+ done
install-boothelp:
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
${.CURDIR}/boot.help ${DESTDIR}/
.include <bsd.kern.mk>
diff --git a/sys/pc98/boot/biosboot/README.serial b/sys/pc98/boot/biosboot/README.serial
index bf47e6c4a4701..5adbfa9412336 100644
--- a/sys/pc98/boot/biosboot/README.serial
+++ b/sys/pc98/boot/biosboot/README.serial
@@ -105,7 +105,7 @@ To boot FreeBSD in serial console mode, you must do the following:
higher priority console). This replaces the COMCONSOLE option.
Example:
- device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4
+ device sio0 at isa? port "IO_COM1" tty flags 0x10 irq 4 vector siointr
If the flags were not set, you need to run UserConfig (on a different
console) or recompile the kernel.
@@ -185,7 +185,7 @@ CAVEATS:
`flags' for the serial port you want to use. For example, if you
want to make COM2 the console:
- device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3
+ device sio1 at isa? port "IO_COM2" tty flags 0x10 irq 3 vector siointr
The console flags for the other serial ports should not be set.
o Recompile both the boot blocks and the kernel.
@@ -193,4 +193,4 @@ CAVEATS:
from the new kernel.
-$Id: README.serial,v 1.5 1998/04/07 15:33:47 kato Exp $
+$Id: README.serial,v 1.4 1997/06/09 13:44:03 kato Exp $
diff --git a/sys/pc98/boot/biosboot/serial.S b/sys/pc98/boot/biosboot/serial.S
index 2cc22465fe79d..ebf1c5e9c0c92 100644
--- a/sys/pc98/boot/biosboot/serial.S
+++ b/sys/pc98/boot/biosboot/serial.S
@@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:34:26 rpd
- * $Id: serial.S,v 1.7 1998/01/02 09:29:15 kato Exp $
+ * $Id: serial.S,v 1.6 1997/07/14 12:34:01 kato Exp $
*/
/*
@@ -65,16 +65,17 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
-#if COMCONSOLE == 0x238
-#include "../../../i386/boot/biosboot/serial.S"
-#else
/*
* modified for PC-98 by KATO T. of Nagoya University
*/
.file "serial.S"
+#ifdef PC98
+#include <pc98/pc98/sioreg.h>
+#else
#include <i386/isa/sioreg.h>
+#endif
#include "asm.h"
.text
@@ -198,4 +199,3 @@ ENTRY(init_serial)
outb %al, %dx
ret
-#endif
diff --git a/sys/pc98/boot/kzipboot/Makefile b/sys/pc98/boot/kzipboot/Makefile
index beb70a5e56ccb..f97824c40ed5b 100644
--- a/sys/pc98/boot/kzipboot/Makefile
+++ b/sys/pc98/boot/kzipboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 1998/05/28 13:48:40 kato Exp $
+# $Id: Makefile,v 1.5 1998/03/07 15:48:11 kato Exp $
PROG= kztail.o kzhead.o
BINMODE = 444 # target is a relocatable object
@@ -22,9 +22,9 @@ CFLAGS+= -DKZIP -DCOMCONSOLE=0x30
CFLAGS+= -DPC98
kztail.o: ${OBJS_KZTAIL}
- $(LD) -aout -r -x -o kztail.o $(OBJS_KZTAIL)
+ $(LD) -r -x -o kztail.o $(OBJS_KZTAIL)
kzhead.o: ${OBJS_KZHEAD}
- $(LD) -aout -r -x -o kzhead.o $(OBJS_KZHEAD)
+ $(LD) -r -x -o kzhead.o $(OBJS_KZHEAD)
.include <bsd.prog.mk>
diff --git a/sys/pc98/boot/kzipboot/malloc.c b/sys/pc98/boot/kzipboot/malloc.c
index 052e5e357dbbd..cf51be721a517 100644
--- a/sys/pc98/boot/kzipboot/malloc.c
+++ b/sys/pc98/boot/kzipboot/malloc.c
@@ -36,8 +36,9 @@
extern unsigned char *storage;
void *
-kzipmalloc(nbytes)
+malloc(nbytes, junk1, junk2) /* junk? not used */
size_t nbytes;
+ int junk1, junk2;
{
unsigned char *p = storage;
storage += nbytes;
@@ -50,7 +51,8 @@ kzipmalloc(nbytes)
}
void
-kzipfree(cp)
+free(cp, junk) /* junk not used */
void *cp;
+ int junk;
{
}
diff --git a/sys/pc98/boot/netboot/Makefile b/sys/pc98/boot/netboot/Makefile
index dad72fc3b15d4..37bfd672afab2 100644
--- a/sys/pc98/boot/netboot/Makefile
+++ b/sys/pc98/boot/netboot/Makefile
@@ -36,6 +36,7 @@ PROG= nb8390.com nb8390.rom
# Order is very important on the SRCS line for this prog
SRCS= start2.S main.c misc.c bootmenu.c rpc.c
+BINDIR= /usr/mdec
BINMODE= 555
CFLAGS= -O2 -DNFS -DROMSIZE=${ROMSIZE} -DRELOC=${RELOCADDR} -DASK_BOOT
CFLAGS+= -DPC98
@@ -47,12 +48,10 @@ CFLAGS+= -DPC98
NS8390= -DINCLUDE_EGY -DNE_BASE=0xd0
CLEANFILES+= netboot.com
CLEANFILES+= makerom start2.ro 3c509.o ns8390.o
-ROMLDFLAGS= ${LDFLAGS} -aout -N -T ${RELOCADDR} -e _start -nostdlib
+ROMLDFLAGS= ${LDFLAGS} -N -T ${RELOCADDR} -e _start -nostdlib
NOSHARED= YES
NOMAN=
-SIZE= size -aout
STRIP=
-STRIPCMD= strip -aout
ROMSIZE=16384
RELOCADDR=0x90000
@@ -73,27 +72,27 @@ makerom: makerom.c
nb8390.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} ns8390.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb3c509.rom: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET} ${OBJS:S/start2.o/start2.ro/} 3c509.o
- ${STRIPCMD} ${.TARGET}
- ${SIZE} ${.TARGET}
+ strip ${.TARGET}
+ size ${.TARGET}
${.OBJDIR}/makerom ${.TARGET}
nb8390.com: makerom start2.ro ${SRCS:N*.h:R:S/$/.o/g} ns8390.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} ns8390.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
nb3c509.com: start2.o ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
${LD} ${ROMLDFLAGS} -o ${.TARGET}.tmp ${OBJS} 3c509.o
- ${STRIPCMD} ${.TARGET}.tmp
- ${SIZE} ${.TARGET}.tmp
+ strip ${.TARGET}.tmp
+ size ${.TARGET}.tmp
dd ibs=32 skip=1 if=${.TARGET}.tmp of=${.TARGET}
rm -f ${.TARGET}.tmp
diff --git a/sys/pc98/boot/rawboot/Makefile b/sys/pc98/boot/rawboot/Makefile
index 7aafe0de65fd0..b549f42f07d87 100644
--- a/sys/pc98/boot/rawboot/Makefile
+++ b/sys/pc98/boot/rawboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/03/30 12:24:12 kato Exp $
+# $Id: Makefile,v 1.10 1998/03/14 02:30:01 kato Exp $
#
PROG= boot
@@ -9,6 +9,7 @@ SRCS+= probe_keyboard.c io.c disk.c sys.c
.PATH: ${.CURDIR}/../biosboot
+BINDIR= /usr/mdec
BINMODE= 444
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
-DPC98 \
@@ -68,8 +69,8 @@ BOOTSTACK= 0xFFF0
boot.strip: boot
cp -p boot boot.strip
- strip -aout boot.strip
- size -aout boot.strip
+ strip boot.strip
+ size boot.strip
boot.nohdr: boot.strip
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
diff --git a/sys/pc98/conf/GENERIC98 b/sys/pc98/conf/GENERIC98
index 87d05b6cdad8b..90ae50c81a556 100644
--- a/sys/pc98/conf/GENERIC98
+++ b/sys/pc98/conf/GENERIC98
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC98,v 1.62 1999/01/16 13:20:42 kato Exp $
+# $Id: GENERIC98,v 1.49 1998/10/11 15:00:24 kato Exp $
# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
@@ -41,7 +41,7 @@ options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
options EPSON_BOUNCEDMA #use bounce buufer for 15-16M
#options EPSON_MEMWIN #EPSON memory window support
options UCONSOLE #Allow users to grab the console
-#options "LINE30"
+options "LINE30"
options FAILSAFE #Be conservative
options USERCONFIG #boot -c editor
options VISUAL_USERCONFIG #visual boot -c editor
@@ -58,26 +58,18 @@ options COM_MULTIPORT
config kernel root on wd0
-# To make an SMP kernel, the next two are needed
-#options SMP # Symmetric MultiProcessor Kernel
-#options APIC_IO # Symmetric (APIC) I/O
-# Optionally these may need tweaked, (defaults shown):
-#options NCPU=2 # number of CPUs
-#options NBUS=4 # number of busses
-#options NAPIC=1 # number of IO APICs
-#options NINTR=24 # number of INTs
-
controller isa0
controller pci0
-controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
disk fd2 at fdc0 drive 2
disk fd3 at fdc0 drive 3
+tape ft0 at fdc0 drive 4
# options "CMD640" # work around CMD640 chip deficiency
-controller wdc0 at isa? port "IO_WD1" bio irq 9
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
disk wd0 at wdc0 drive 0
#disk wd1 at wdc0 drive 1
#disk wd2 at wdc0 drive 2
@@ -85,11 +77,12 @@ disk wd0 at wdc0 drive 0
options ATAPI # Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
-device acd0 #IDE CD-ROM
+device wcd0 #IDE CD-ROM
-# A single entry for any of these controllers (ncr, ahb, ahc) is
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
# for any number of installed devices.
controller ncr0
+#controller amd0
controller ahc0
controller isp0
@@ -100,19 +93,19 @@ controller isp0
options BS_TARG_SAFEMODE
# PC-9801-92
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0
+controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0 vector bsintr
# SC-98
-# controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x10000
+# controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x10000 vector bsintr
# HA-55BS2 and later
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x20000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x20000 vector bsintr
# ELECOM type
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x30000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x30000 vector bsintr
# SMIT
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 vector bsintr
# Logitec LHA-20x
-#controller bs0 at isa? port IO_SCSI bio irq 5 drq 3 flags 0x50000
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x50000 vector bsintr
-#controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000
+#controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000 vector aicintr
controller scbus0
@@ -126,17 +119,11 @@ device cd0 #Only need one of these, the code dynamically grows
controller matcd0 at isa? port? bio
-# keyboard driver
-device pckbd0 at isa? port IO_KBD tty irq 1
-#options KBD_INSTALL_CDEV
-
-device gdc0 at isa?
-
-#pseudo-device splash
-
-device sc0 at isa? tty
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+#options XSERVER # support for X server
-device npx0 at isa? port IO_NPX irq 8
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
#
# Laptop support (see LINT for more options)
@@ -148,36 +135,12 @@ device apm0 at isa? disable flags 0x31 # Advanced Power Management
#device pcic0 at card?
#device pcic1 at card?
-#
-# Serial Interface
-#
-# COM1
-device sio0 at isa? port "IO_COM1" tty irq 4
-# COM2 (2nd CCU)
-device sio1 at isa? port 0x238 tty irq 5 flags 0x12000000
-# PC-9861K, PC-9801-101, MDC-926Rs
-#device sio1 at isa? port "IO_COM2" tty irq 5 flags 0x01000000
-#device sio2 at isa? port "IO_COM3" tty irq 6 flags 0x02000000
-# PC-9801-120 (PnP off)
-#device sio1 at isa? port 0x8b0 tty irq 5 flags 0x11000000
-# MC-16550II, MC-RS98
-#device sio1 at isa? port 0xd2 tty irq 5 flags 0x14000101
-#device sio2 at isa? port 0x8d2 tty flags 0x14000101
-# RSB-2000, RSB-3000, B98-02
-#device sio1 at isa? port 0xb0 tty flags 0x15000101
-#device sio2 at isa? port 0xb1 tty flags 0x15000101
-# RSB-384
-#device sio1 at isa? port 0xb0 tty flags 0x16000000
-#device sio2 at isa? port 0xb1 tty flags 0x16000000
-# RSA-98III
-#device sio1 at isa? port 0x50e0 tty irq 5 flags 0x18000101
-#device sio2 at isa? port 0x51e0 tty flags 0x18000101
-# ESP98
-#options COM_ESP
-#device sio1 at isa? port 0x18b0 tty irq 5 flags 0x19000000
-
-device lpt0 at isa? port IO_LPT tty
-device mse0 at isa? port IO_MSE tty irq 13
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
+
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
# Order is important here due to intrusive probes, do *not* alphabetize
# this list of network interfaces until the probes have been fixed.
@@ -185,14 +148,9 @@ device mse0 at isa? port IO_MSE tty irq 13
# revision 1.20 of this file.
device de0
device fxp0
-device mx0
-device pn0
-device rl0
device tl0
device tx0
-device vr0
device vx0
-device wb0
#
# DP8390 NIC
@@ -210,30 +168,30 @@ device wb0
# fe0: RE1000/1000Plus
# fe1: C-NET(98)P2/C-NET(9N)E
#
-device ed0 at isa? port 0x00d0 net irq 6
-device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000
-device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000
-device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000
-device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000
-device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000
-device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000
-device ed6 at isa? port 0x0770 net irq 6 flags 0x800000
-device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000
-device ed8 at isa? port 0xa3d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000
-
-device ep0 at isa? port 0x40d0 net irq 3
-device fe0 at isa? port 0x00d0 net irq 3
-device fe1 at isa? port 0x73d0 net irq 5
-device lnc0 at isa? port 0x03d0 net irq 6
-device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
+device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
+device ed6 at isa? port 0x0770 net irq 6 flags 0x800000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
+device ed8 at isa? port 0xa3d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 vector edintr
+device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000 vector edintr
+
+device ep0 at isa? port 0x40d0 net irq 3 vector epintr
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device fe1 at isa? port 0x73d0 net irq 5 vector feintr
+device lnc0 at isa? port 0x03d0 net irq 6 vector lncintr
+device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
#controller snd0
-#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
#device sbxvi0 at isa? drq 3
#device sbmidi0 at isa? port 0x80d2
#device opl0 at isa? port 0x28d2
-#device pcm0 at isa? port 0xa460 irq 12
-#device mss0 at isa? port 0xf40 irq 12 drq 1
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
+#device mss0 at isa? port 0xf40 irq 12 drq 1 vector adintr
pseudo-device loop
pseudo-device ether
@@ -248,8 +206,3 @@ pseudo-device gzip # Exec gzipped a.out's
# the costs of each syscall.
options KTRACE #kernel tracing
-# The `bpfilter' pseudo-device enables the Berkeley Packet Filter. Be
-# aware of the legal and administrative consequences of enabling this
-# option. The number of devices determines the maximum number of
-# simultaneous BPF clients programs runnable.
-#pseudo-device bpfilter 4 #Berkeley packet filter
diff --git a/sys/pc98/conf/GENERICupgrade b/sys/pc98/conf/GENERICupgrade
new file mode 100644
index 0000000000000..f07a434b2e7bc
--- /dev/null
+++ b/sys/pc98/conf/GENERICupgrade
@@ -0,0 +1,204 @@
+#
+# GENERICupgrade (a copy of GENERIC98)
+#
+# This config file is used by the aout->elf transition build on systems
+# not running a 3.0-CURRENT kernel. Unless a kernel is built and installed
+# as part of the upgrade, the system will be hosed by the installation
+# of the 3.0 binaries and subsequent reboot. If the transition build is
+# being perfomed on a machine for which this config file is inappropriate,
+# it should be replaced with a suitable one prior to performing the upgrade.
+#
+# $Id: GENERICupgrade,v 1.3 1998/09/22 16:10:40 kato Exp $
+#
+
+# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
+
+machine "pc98"
+cpu "I386_CPU"
+cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident "GENERIC98"
+maxusers 32
+
+options "PC98" #PC98
+options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root device
+options FFS_ROOT #FFS usable as root device [keep this!]
+options NFS_ROOT #NFS usable as root device
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device
+options EPSON_BOUNCEDMA #use bounce buufer for 15-16M
+#options EPSON_MEMWIN #EPSON memory window support
+options UCONSOLE #Allow users to grab the console
+options "LINE30"
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+options SYSVSHM
+options SYSVSEM
+options SYSVMSG
+
+options COM_MULTIPORT
+
+#
+# IBM-PC HDD support
+#options COMPAT_ATDISK
+
+config kernel root on wd0
+
+controller isa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+disk fd2 at fdc0 drive 2
+disk fd3 at fdc0 drive 3
+tape ft0 at fdc0 drive 4
+
+# options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
+disk wd0 at wdc0 drive 0
+#disk wd1 at wdc0 drive 1
+#disk wd2 at wdc0 drive 2
+#disk wd3 at wdc0 drive 3
+
+options ATAPI # Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
+# for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahc0
+controller isp0
+
+#
+# WD33C93 SCSI card (55/92 like board)
+#
+
+options BS_TARG_SAFEMODE
+
+# PC-9801-92
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0 vector bsintr
+# SC-98
+# controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x10000 vector bsintr
+# HA-55BS2 and later
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x20000 vector bsintr
+# ELECOM type
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x30000 vector bsintr
+# SMIT
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 vector bsintr
+# Logitec LHA-20x
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x50000 vector bsintr
+
+#controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000 vector aicintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+controller matcd0 at isa? port? bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+#options XSERVER # support for X server
+
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
+
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+
+#
+# DP8390 NIC
+#
+# ed0: generic driver
+# ed1: LANEED LD-BDN
+# ed2: EGY-98
+# ed3: LGY-98
+# ed4: ICM-IF-2766/EN-2298-T
+# ed5: SIC-98
+# ed6: PC-9801-108
+# ed7: LA-98
+# ed8: C-NET(98)
+# ed9: C-NET(98)E/L
+# fe0: RE1000/1000Plus
+# fe1: C-NET(98)P2/C-NET(9N)E
+#
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
+device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
+device ed6 at isa? port 0x0770 net irq 6 flags 0x800000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
+device ed8 at isa? port 0xa3d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 vector edintr
+device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000 vector edintr
+
+device ep0 at isa? port 0x40d0 net irq 3 vector epintr
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device fe1 at isa? port 0x73d0 net irq 5 vector feintr
+device lnc0 at isa? port 0x03d0 net irq 6 vector lncintr
+device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
+
+#controller snd0
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
+#device sbxvi0 at isa? drq 3
+#device sbmidi0 at isa? port 0x80d2
+#device opl0 at isa? port 0x28d2
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
+#device mss0 at isa? port 0xf40 irq 12 drq 1 vector adintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
diff --git a/sys/pc98/conf/Makefile.pc98 b/sys/pc98/conf/Makefile.pc98
index 2af7819343922..f6ba1b258a01d 100644
--- a/sys/pc98/conf/Makefile.pc98
+++ b/sys/pc98/conf/Makefile.pc98
@@ -3,7 +3,7 @@
# Makefile.i386 -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
-# $Id: Makefile.pc98,v 1.51 1999/01/18 11:00:29 kato Exp $
+# $Id: Makefile.pc98,v 1.41 1998/10/05 08:57:17 kato Exp $
#
# Makefile for FreeBSD
#
@@ -19,9 +19,9 @@
#
# Which version of config(8) is required.
-%VERSREQ= 300009
+%VERSREQ= 300007
-KERNFORMAT?= elf
+KERNFORMAT?= aout
#STD8X16FONT?= iso
@@ -77,8 +77,8 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} $<
DRIVER_S= ${CC} -c -x ${ASM_CFLAGS} $<
PROFILE_C= ${CC} -c ${CFLAGS} $<
-GEN_CFILES= ${I386}/i386/genassym.c
-# setdef0.c and setdef1.c are intentionally
+GEN_CFILES= ${I386}/i386/genassym.c ${I386}/i386/gensetdefs.c
+# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally
# omitted from SYSTEM_CFILES. They include setdefs.h, a header which
# is generated from all of ${OBJS}. We don't want to have to compile
# everything just to do a make depend.
@@ -89,7 +89,14 @@ SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS}
SYMORDER_EXCLUDE=-x symbols.exclude
.endif
SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET}
-.if ${KERNFORMAT} == aout || ${KERNFORMAT} == aoutkld
+.if ${KERNFORMAT} == aout
+SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
+SYSTEM_LD= @${LD} -aout -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
+SYSTEM_LD_TAIL= @echo rearranging symbols; \
+ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \
+ size -aout ${.TARGET} ; chmod 755 ${.TARGET}
+.endif
+.if ${KERNFORMAT} == aoutkld
SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
SYSTEM_LD= @${LD} -aout -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @echo rearranging symbols; \
@@ -97,8 +104,9 @@ SYSTEM_LD_TAIL= @echo rearranging symbols; \
size -aout ${.TARGET} ; chmod 755 ${.TARGET}
.endif
.if ${KERNFORMAT} == elf
+# kld compatable export of symbols.
SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \
- setdef1.o hack.So
+ setdef1.o hack.so
SYSTEM_LD= @${LD} -elf -Bdynamic -T $S/i386/conf/kernel.script \
-export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
@@ -120,14 +128,9 @@ SYSTEM_DEP+= $S/i386/conf/kernel.script
%CLEAN
-.if !exists(.depend)
-${SYSTEM_OBJS}: ${BEFORE_DEPEND:M*.h}
-.endif
-
clean:
- rm -f *.o *.so *.So *.ko *.s eddep errs genassym gensetdefs \
- kernel linterrs makelinks param.c setdef[01].c setdefs.h \
- symbols.exclude symbols.sort tags \
+ rm -f *.o *.so *.ko *.s eddep errs genassym gensetdefs kernel linterrs \
+ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \
vers.c vnode_if.c vnode_if.h ${CLEAN}
#lint: /tmp param.c
@@ -151,21 +154,26 @@ locore.o: ${I386}/i386/locore.s assym.s
# This is a hack. BFD "optimizes" away dynamic mode if there are no
# dynamic references. We could probably do a '-Bforcedynamic' mode like
# in the a.out ld. For now, this works.
-hack.So: Makefile
+hack.so: Makefile
touch hack.c
- ${CC} -elf -shared -nostdlib hack.c -o hack.So
+ ${CC} -elf -shared -nostdlib hack.c -o hack.so
rm -f hack.c
.endif
-setdef0.o: setdef0.c setdefs.h
+setdef0.o: ${I386}/i386/setdef0.c setdefs.h
${NORMAL_C}
-setdef1.o: setdef1.c setdefs.h
+setdef1.o: ${I386}/i386/setdef1.c setdefs.h
${NORMAL_C}
-setdef0.c setdef1.c setdefs.h: ${OBJS}
- @echo generating linker set emulation glue for ELF
- @gensetdefs ${OBJS}
+setdefs.h: gensetdefs ${OBJS}
+ ./gensetdefs ${OBJS} >setdefs.h
+
+gensetdefs: gensetdefs.o
+ ${CC} ${GEN_CFLAGS} gensetdefs.o -o ${.TARGET}
+
+gensetdefs.o: ${I386}/i386/gensetdefs.c
+ ${CC} -c ${GEN_CFLAGS} ${I386}/i386/gensetdefs.c
# this rule stops ./assym.s in .depend from causing problems
./assym.s: assym.s
@@ -180,7 +188,7 @@ genassym.o: ${I386}/i386/genassym.c
genassym: genassym.o
${CC} ${GEN_CFLAGS} genassym.o -o ${.TARGET}
-${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
+${SYSTEM_OBJS} genassym.o gensetdefs.o vers.o: opt_global.h
# XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical.
depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND}
@@ -211,16 +219,6 @@ install:
echo "You must first build your kernel before trying to install." ; \
exit 1 ; \
fi
-.if ${KERNFORMAT} == "elf" && !defined(FORCE)
- @if [ -f /kernel -a "`file /kernel 2>/dev/null | grep ELF`" = "" ]; then \
- echo "WARNING: You are about to install an ELF kernel for the first time!" ; \
- echo "Please be sure you have upgraded your bootblocks and/or /boot/loader so" ; \
- echo "that you can boot it. Old bootblocks WILL NOT WORK! Please read:" ; \
- echo "http://www.freebsd.org/~peter/elfday.html for information." ; \
- echo "If you are satisfied you can boot an ELF kernel, type: make -DFORCE install" ; \
- exit 1 ; \
- fi
-.endif
.if exists(${DESTDIR}/kernel)
chflags noschg ${DESTDIR}/kernel
mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old
diff --git a/sys/pc98/conf/SMP-GENERIC98 b/sys/pc98/conf/SMP-GENERIC98
new file mode 100644
index 0000000000000..6b08d04497a94
--- /dev/null
+++ b/sys/pc98/conf/SMP-GENERIC98
@@ -0,0 +1,230 @@
+#
+# GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks
+#
+# For more information read the handbook part System Administration ->
+# Configuring the FreeBSD Kernel -> The Configuration File.
+# The handbook is available in /usr/share/doc/handbook or online as
+# latest version from the FreeBSD World Wide Web server
+# <URL:http://www.FreeBSD.ORG/>
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is present in the ./LINT configuration file. If you are
+# in doubt as to the purpose or necessity of a line, check first in LINT.
+#
+# $Id: SMP-GENERIC98,v 1.4 1998/09/19 13:36:13 kato Exp $
+
+# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
+
+machine "pc98"
+# SMP does NOT support 386/486 CPUs.
+#cpu "I386_CPU"
+#cpu "I486_CPU"
+cpu "I586_CPU"
+cpu "I686_CPU"
+ident "SMP-GENERIC98"
+maxusers 32
+
+# Create a SMP capable kernel (mandatory options):
+options SMP # Symmetric MultiProcessor Kernel
+options APIC_IO # Symmetric (APIC) I/O
+
+# Optional, these are the defaults:
+#options NCPU=2 # number of CPUs
+#options NBUS=4 # number of busses
+#options NAPIC=1 # number of IO APICs
+#options NINTR=24 # number of INTs
+
+options "PC98" #PC98
+# SMP shouldn't need x87 emulation, disable by default.
+#options MATH_EMULATE #Support for x87 emulation
+options INET #InterNETworking
+options FFS #Berkeley Fast Filesystem
+options NFS #Network Filesystem
+options MSDOSFS #MSDOS Filesystem
+options "CD9660" #ISO 9660 Filesystem
+options "CD9660_ROOT" #CD-ROM usable as root device
+options FFS_ROOT #FFS usable as root device [keep this!]
+options NFS_ROOT #NFS usable as root device
+options PROCFS #Process filesystem
+options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!]
+options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device
+options UCONSOLE #Allow users to grab the console
+options "LINE30"
+options FAILSAFE #Be conservative
+options USERCONFIG #boot -c editor
+options VISUAL_USERCONFIG #visual boot -c editor
+
+options SYSVSHM
+options SYSVSEM
+options SYSVMSG
+
+options COM_MULTIPORT
+
+#
+# IBM-PC HDD support
+#options COMPAT_ATDISK
+#
+# FreeBSD(98)-current is a *TEST VERSION*.
+# It is highly recomended to compile with following options, and to
+# record the panic messages and the result of trace command brefore
+# reporting a problem.
+options DDB
+options DIAGNOSTIC
+
+config kernel root on wd0
+
+controller isa0
+controller pci0
+
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
+disk fd0 at fdc0 drive 0
+disk fd1 at fdc0 drive 1
+disk fd2 at fdc0 drive 2
+disk fd3 at fdc0 drive 3
+# Unless you know very well what you're doing, leave ft0 at drive 2, or
+# remove the line entirely if you don't need it. Trying to configure
+# it on another unit might cause surprises, see PR kern/7176.
+tape ft0 at fdc0 drive 4
+
+# options "CMD640" # work around CMD640 chip deficiency
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
+disk wd0 at wdc0 drive 0
+#disk wd1 at wdc0 drive 1
+#disk wd2 at wdc0 drive 2
+#disk wd3 at wdc0 drive 3
+
+options ATAPI # Enable ATAPI support for IDE bus
+options ATAPI_STATIC #Don't do it as an LKM
+device wcd0 #IDE CD-ROM
+
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
+# for any number of installed devices.
+controller ncr0
+#controller amd0
+controller ahc0
+controller isp0
+
+
+#
+# SMP does not support bs driver: see /sys/i386/isa/bs/bsif.h
+#
+# WD33C93 SCSI card (55/92 like board)
+#
+
+options BS_TARG_SAFEMODE
+
+# PC-9801-92
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0 vector bsintr
+# SC-98
+# controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x10000 vector bsintr
+# HA-55BS2 and later
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x20000 vector bsintr
+# ELECOM type
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x30000 vector bsintr
+# SMIT
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 iomem 0xdd000 iosiz 0x1000 flags 0x40000 vector bsintr
+# Logitec LHA-20x
+#controller bs0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0x50000 vector bsintr
+
+controller aic0 at isa? port 0x1840 bio irq 5 flags 0x10000 vector aicintr
+
+controller scbus0
+
+device da0
+
+device sa0
+
+device pass0
+
+device cd0 #Only need one of these, the code dynamically grows
+
+controller matcd0 at isa? port? bio
+
+# syscons is the default console driver, resembling an SCO console
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
+#options XSERVER # support for X server
+
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
+
+#
+# Laptop support (see LINT for more options)
+#
+device apm0 at isa? disable flags 0x31 # Advanced Power Management
+
+# PCCARD (PCMCIA) support
+#controller card0
+#device pcic0 at card?
+#device pcic1 at card?
+
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
+
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
+
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device tl0
+device tx0
+device vx0
+device xl0
+
+#
+# DP8390 NIC
+#
+# ed0: generic driver
+# ed1: LANEED LD-BDN
+# ed2: EGY-98
+# ed3: LGY-98
+# ed4: ICM-IF-2766/EN-2298-T
+# ed5: SIC-98
+# ed6: PC-9801-108
+# ed7: LA-98
+# ed8: C-NET(98)
+# ed9: C-NET(98)E/L
+#
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x200000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x300000 vector edintr
+device ed3 at isa? port 0x00d0 net irq 6 flags 0x400000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x500000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x600000 vector edintr
+device ed6 at isa? port 0x0770 net irq 6 flags 0x800000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x900000 vector edintr
+device ed8 at isa? port 0x03d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0xa00000 vector edintr
+device ed9 at isa? port 0x03d0 net irq 6 flags 0xb00000 vector edintr
+
+device ep0 at isa? port 0x40d0 net irq 3 vector epintr
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device lnc0 at isa? port 0x03d0 net irq 6 vector lncintr
+device zp0 at isa? port 0x00d0 net irq 10 iomem 0xe0000 vector zpintr
+
+#controller snd0
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
+#device sbxvi0 at isa? drq 3
+#device sbmidi0 at isa? port 0x80d2
+#device opl0 at isa? port 0x28d2
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
+#device mss0 at isa? port 0xf40 irq 12 drq 1 vector adintr
+
+pseudo-device loop
+pseudo-device ether
+pseudo-device sl 1
+#pseudo-device ppp 1
+pseudo-device tun 1
+pseudo-device pty 16
+pseudo-device gzip # Exec gzipped a.out's
+
+# KTRACE enables the system-call tracing facility ktrace(2).
+# This adds 4 KB bloat to your kernel, and slightly increases
+# the costs of each syscall.
+options KTRACE #kernel tracing
+
+# This provides support for System V shared memory.
+#
+options SYSVSHM
diff --git a/sys/pc98/conf/devices.pc98 b/sys/pc98/conf/devices.pc98
index cc10d30cd9917..8b2641f04642c 100644
--- a/sys/pc98/conf/devices.pc98
+++ b/sys/pc98/conf/devices.pc98
@@ -1,6 +1,6 @@
# This file tells what major numbers the various possible swap devices have.
#
-# $Id: devices.pc98,v 1.6 1998/09/15 14:10:55 kato Exp $
+# $Id: devices.pc98,v 1.5 1998/02/18 12:33:34 kato Exp $
#
wd 0
wfd 1
@@ -13,5 +13,5 @@ mcd 7
vn 15
scd 16
pcd 17
-acd 19
+wcd 19
wst 24
diff --git a/sys/pc98/conf/files.pc98 b/sys/pc98/conf/files.pc98
index 1a5d72d84f6ab..7b2d2a07e48d3 100644
--- a/sys/pc98/conf/files.pc98
+++ b/sys/pc98/conf/files.pc98
@@ -3,7 +3,7 @@
#
# modified for PC-9801
#
-# $Id: files.pc98,v 1.80 1999/01/18 08:38:07 kato Exp $
+# $Id: files.pc98,v 1.71 1998/09/20 10:50:18 kato Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -26,11 +26,6 @@ font8x16.o optional std8x16font \
no-implicit-rule before-depend \
clean "${STD8X16FONT}-8x16 font8x16.c"
#
-dev/fb/fb.c optional fb device-driver
-dev/fb/fb.c optional gdc device-driver
-dev/fb/splash.c optional splash
-dev/kbd/kbd.c optional kbd device-driver
-dev/kbd/kbd.c optional pckbd device-driver
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
i386/eisa/dpt_eisa.c optional eisa dpt device-driver
@@ -76,7 +71,7 @@ i386/i386/simplelock.s optional smp
i386/i386/support.s standard
i386/i386/swtch.s standard
i386/i386/sys_machdep.c standard
-i386/i386/trap.c standard
+pc98/i386/trap.c standard
pc98/i386/userconfig.c optional userconfig
i386/i386/vm_machdep.c standard
i386/i386/vm86.c optional vm86
@@ -109,6 +104,8 @@ i386/isa/adv_isa.c optional adv device-driver
i386/isa/aha_isa.c optional aha device-driver
#i386/isa/aic6360.c optional aic device-driver
i386/isa/aic_isa.c optional aic device-driver
+i386/isa/alog.c optional alog device-driver
+i386/isa/b004.c optional bqu device-driver
i386/isa/bt_isa.c optional bt device-driver
pc98/pc98/clock.c standard
i386/isa/cronyx.c optional cx device-driver
@@ -120,6 +117,7 @@ pc98/pc98/atcompat_diskslice.c optional compat_atdisk
i386/isa/elink.c optional ep device-driver
i386/isa/elink.c optional ie device-driver
pc98/pc98/fd.c optional fd device-driver
+i386/isa/ft.c optional ft device-driver
i386/isa/gpib.c optional gp device-driver
i386/isa/asc.c optional asc device-driver
i386/isa/gsc.c optional gsc device-driver
@@ -127,14 +125,14 @@ i386/isa/if_ar.c optional ar device-driver
i386/isa/if_cs.c optional cs device-driver
i386/isa/if_cx.c optional cx device-driver
pc98/pc98/if_ed.c optional ed device-driver
+i386/isa/if_eg.c optional eg device-driver
i386/isa/if_el.c optional el device-driver
i386/isa/if_ep.c optional ep device-driver
i386/isa/if_ex.c optional ex device-driver
-i386/isa/if_fe.c optional fe device-driver
+pc98/pc98/if_fe.c optional fe device-driver
i386/isa/if_ie.c optional ie device-driver
i386/isa/if_le.c optional le device-driver
i386/isa/if_lnc.c optional lnc device-driver
-i386/isa/if_rdp.c optional rdp device-driver
i386/isa/if_sr.c optional sr device-driver
i386/isa/if_wl.c optional wl device-driver
i386/isa/if_ze.c optional ze device-driver
@@ -145,25 +143,27 @@ i386/isa/intr_machdep.c standard
pc98/pc98/pc98.c optional isa device-driver
i386/isa/istallion.c optional stli device-driver
i386/isa/joy.c optional joy device-driver
-pc98/pc98/pc98kbd.c optional pckbd device-driver
+i386/isa/kbdio.c optional psm device-driver
+i386/isa/kbdio.c optional sc device-driver
+i386/isa/kbdio.c optional vt device-driver
i386/isa/loran.c optional loran device-driver
pc98/pc98/lpt.c optional lpt device-driver
i386/isa/labpc.c optional labpc device-driver
i386/isa/mcd.c optional mcd device-driver
pc98/pc98/mse.c optional mse device-driver
+#i386/isa/ncr5380.c optional nca device-driver
pc98/pc98/npx.c mandatory npx device-driver
-pc98/pc98/pc98gdc.c optional gdc device-driver
pc98/pc98/pcaudio.c optional pca device-driver
i386/isa/matcd/matcd.c optional matcd device-driver
i386/isa/pcibus.c optional pci device-driver
i386/isa/pcicx.c optional ze device-driver
i386/isa/pcicx.c optional zp device-driver
-#i386/isa/pcvt/pcvt_drv.c optional vt device-driver
-#i386/isa/pcvt/pcvt_ext.c optional vt device-driver
-#i386/isa/pcvt/pcvt_kbd.c optional vt device-driver
-#i386/isa/pcvt/pcvt_out.c optional vt device-driver
-#i386/isa/pcvt/pcvt_sup.c optional vt device-driver
-#i386/isa/pcvt/pcvt_vtf.c optional vt device-driver
+i386/isa/pcvt/pcvt_drv.c optional vt device-driver
+i386/isa/pcvt/pcvt_ext.c optional vt device-driver
+i386/isa/pcvt/pcvt_kbd.c optional vt device-driver
+i386/isa/pcvt/pcvt_out.c optional vt device-driver
+i386/isa/pcvt/pcvt_sup.c optional vt device-driver
+i386/isa/pcvt/pcvt_vtf.c optional vt device-driver
i386/isa/pnp.c optional pnp device-driver
i386/isa/prof_machdep.c optional profiling-routine
i386/isa/ppc.c optional ppc device-driver
@@ -173,15 +173,17 @@ i386/isa/random_machdep.c standard
i386/isa/rc.c optional rc device-driver
i386/isa/rp.c optional rp device-driver
i386/isa/scd.c optional scd device-driver
+#i386/isa/seagate.c optional sea device-driver
i386/isa/si.c optional si device-driver
i386/isa/si2_z280.c optional si device-driver
i386/isa/si3_t225.c optional si device-driver
pc98/pc98/sio.c optional sio device-driver
-i386/isa/snd/sound.c optional pcm device-driver
-i386/isa/snd/dmabuf.c optional pcm device-driver
-i386/isa/snd/ad1848.c optional pcm device-driver
-i386/isa/snd/sb_dsp.c optional pcm device-driver
-i386/isa/snd/clones.c optional pcm device-driver
+#i386/isa/snd/sound.c optional pcm device-driver
+#i386/isa/snd/dmabuf.c optional pcm device-driver
+#i386/isa/snd/ad1848.c optional pcm device-driver
+#i386/isa/snd/sb_dsp.c optional pcm device-driver
+#i386/isa/snd/clones.c optional pcm device-driver
+i386/isa/sound/pcm86.c optional pcm device-driver
i386/isa/sound/dev_table.c optional snd device-driver
i386/isa/sound/soundcard.c optional snd device-driver
i386/isa/sound/sound_switch.c optional snd device-driver
@@ -247,17 +249,20 @@ i386/isa/spigot.c optional spigot device-driver
pc98/pc98/spkr.c optional speaker device-driver
i386/isa/stallion.c optional stl device-driver
pc98/pc98/syscons.c optional sc device-driver
-pc98/pc98/scvidctl.c optional sc device-driver
+#i386/isa/scvidctl.c optional sc device-driver
#i386/isa/scvesactl.c optional sc device-driver
#i386/isa/videoio.c optional sc device-driver
#i386/isa/vesa.c optional sc device-driver
i386/isa/tw.c optional tw device-driver
+#i386/isa/ultra14f.c optional uha device-driver
pc98/pc98/wd.c optional wdc device-driver
pc98/pc98/wd.c optional wd device-driver
i386/isa/atapi.c optional atapi device-driver
i386/isa/atapi-cd.c optional acd device-driver
+i386/isa/wcd.c optional wcd device-driver
i386/isa/wfd.c optional wfd device-driver
i386/isa/wst.c optional wst device-driver
+i386/isa/wd7000.c optional wds device-driver
i386/isa/wt.c optional wt device-driver
i386/linux/imgact_linux.c optional compat_linux
i386/linux/linux_dummy.c optional compat_linux
@@ -273,30 +278,6 @@ i386/linux/linux_stats.c optional compat_linux
i386/linux/linux_sysent.c optional compat_linux
i386/linux/linux_sysvec.c optional compat_linux
i386/linux/linux_util.c optional compat_linux
-i4b/layer1/i4b_isic.c optional isic device-driver
-i4b/layer1/i4b_isic_isa.c optional isic device-driver
-i4b/layer1/i4b_isic_pnp.c optional isic device-driver
-i4b/layer1/i4b_isic_pci.c optional isic device-driver
-i4b/layer1/i4b_isic_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_isac.c optional isic device-driver
-i4b/layer1/i4b_hscx.c optional isic device-driver
-i4b/layer1/i4b_l1.c optional isic device-driver
-i4b/layer1/i4b_l1fsm.c optional isic device-driver
-i4b/layer1/i4b_bchan.c optional isic device-driver
-i4b/layer1/i4b_tel_s08.c optional isic device-driver
-i4b/layer1/i4b_tel_s016.c optional isic device-driver
-i4b/layer1/i4b_tel_s0163.c optional isic device-driver
-i4b/layer1/i4b_tel_s0P.c optional isic device-driver
-i4b/layer1/i4b_ctx_s0P.c optional isic device-driver
-i4b/layer1/i4b_avm_a1.c optional isic device-driver
-i4b/layer1/i4b_avm_fritz_pcmcia.c optional isic device-driver
-i4b/layer1/i4b_usr_sti.c optional isic device-driver
-i4b/layer1/i4b_itk_ix1.c optional isic device-driver
-i4b/layer1/i4b_drn_ngo.c optional isic device-driver
-i4b/layer1/i4b_sws.c optional isic device-driver
-i4b/layer1/i4b_dynalink.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1i.c optional isic device-driver
-i4b/layer1/i4b_elsa_qs1p.c optional isic device-driver
libkern/bcd.c standard
libkern/divdi3.c standard
libkern/inet_ntoa.c standard
@@ -351,5 +332,4 @@ gnu/i386/fpemul/wm_sqrt.s optional gpl_math_emulate
gnu/i386/isa/dgb.c optional dgb device-driver
gnu/i386/isa/dgm.c optional dgm device-driver
gnu/i386/isa/sound/awe_wave.c optional awe device-driver
-pci/es1370.c optional pcm device-driver
#pci/ide_pci.c optional wd device-driver
diff --git a/sys/pc98/conf/majors.pc98 b/sys/pc98/conf/majors.pc98
index 90ffbefccbceb..2dce44c1a47f6 100644
--- a/sys/pc98/conf/majors.pc98
+++ b/sys/pc98/conf/majors.pc98
@@ -1,4 +1,4 @@
-$Id: majors.pc98,v 1.48 1999/01/16 11:36:28 kato Exp $
+$Id: majors.pc98,v 1.40 1998/09/15 14:10:56 kato Exp $
Hopefully, this list will one day be obsoleted by DEVFS, but for now
this is the current allocation of device major numbers.
@@ -32,7 +32,7 @@ blkdev name comments
16 scd Sony CDROM interface
17 matcd Matsushita/Panasonic/Creative(SB) CDROM interface
18 ata "device independent" ATA/IDE driver
-19 acdb ATAPI CDROM client of "ata"
+19 wcdb ATAPI CDROM client of "ata"
21 ccd concatenated disk
22 gd Geometry disk.
24 wstb ATAPI tape client of "ata"
@@ -40,9 +40,6 @@ blkdev name comments
26 sw VM internal swap device
27 myx Mylex RAID (ulf@alameda.net)
28 fla M-Systems DiskOnChip(r)
-29 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-100 ?? entries from 100-127 are reserved for local use
-127 ?? entries from 100-127 are reserved for local use
chrdev name comments
0 cn console
@@ -114,7 +111,7 @@ chrdev name comments
66 labpc National Instruments LabPC
67 meteor Matrox Meteor video capture
68 si Specialix SI/XIO (peter@freebsd.org)
-69 acd ATAPI CDROM client of "ata"
+69 wcd ATAPI CDROM client of "ata"
71 asc AmiScan driver
72 stl Stallion (cd1400 based) (gerg@stallion.oz.au)
73 ?? was qcam
@@ -128,9 +125,9 @@ chrdev name comments
81 rp RocketPort/Steve Gericke <steveg@comtrol.com>
82 ppi Generic Parallel I/O <Nicolas.Souchu@prism.uvsq.fr>
83 can CAN16-2 CAN-PC Interface
-84 dtfp Datum Time and Frequency processor (louie@UU.NET)
+84 ttxt Unitext teletext decoder (arg@arg1.demon.co.uk)
85 vesa VESA support device (j_mini@efn.org)
-86 alog Industrial Computer Source AIO8-P driver (deprecated)
+86 alog Industrial Computer Source AIO8-P driver
87 wfd ATAPI floppy client of "ata"
88 dpt DPT RAID Controller <shimon@i-connect.net>
89 pps Pulse-Per-Second timing interface
@@ -152,12 +149,3 @@ chrdev name comments
105 iic I2C bus generic i/o
106 smb System Management Bus generic i/o
107 3dfx 3Dfx driver (shocking@prth.pgs.com)
-108 usb Universal Serial Bus (nick.hibma@jrc.it)
-109 id Intelligent Disk [Array] (md@doc.ic.ac.uk)
-110 ses SCSI Environmental Services driver (mjacob@feral.com)
-111 ums USB Mouse (nick.hibma@jrc.it)
-112 kbd keyboard
-113 ulpt USB Printer (nick.hibma@jrc.it)
-114 ugen USB Generic device (nick.hibma@jrc.it)
-200 ?? entries from 200-255 are reserved for local use
-255 ?? entries from 200-255 are reserved for local use
diff --git a/sys/pc98/conf/options.pc98 b/sys/pc98/conf/options.pc98
index 22c264c07e3a1..d18cabcdd4f97 100644
--- a/sys/pc98/conf/options.pc98
+++ b/sys/pc98/conf/options.pc98
@@ -1,7 +1,5 @@
-# $Id: options.pc98,v 1.77 1999/01/04 08:09:15 kato Exp $
-
+# $Id: options.pc98,v 1.68 1998/09/28 08:23:26 kato Exp $
DISABLE_PSE
-IDE_DELAY
USER_LDT
MATH_EMULATE opt_math_emulate.h
GPL_MATH_EMULATE opt_math_emulate.h
@@ -26,13 +24,19 @@ BREAK_TO_DEBUGGER opt_comconsole.h
CONSPEED opt_comconsole.h
COM_ESP opt_sio.h
COM_MULTIPORT opt_sio.h
+DSI_SOFT_MODEM opt_sio.h
EXTRA_SIO opt_sio.h
I586_PMC_GUPROF opt_i586_guprof.h
WLCACHE opt_wavelan.h
WLDEBUG opt_wavelan.h
-# i386 SMP options
+# These two SMP options have dramatic implications all over the kernel
+SMP opt_global.h
APIC_IO opt_global.h
+
+# Standard SMP options
+NCPU opt_smp.h
+NBUS opt_smp.h
NAPIC opt_smp.h
NINTR opt_smp.h
@@ -56,7 +60,6 @@ CPU_UPGRADE_HW_CACHE opt_cpu.h
CPU_WT_ALLOC opt_cpu.h
CYRIX_CACHE_WORKS opt_cpu.h
CYRIX_CACHE_REALLY_WORKS opt_cpu.h
-NO_MEMORY_HOLE opt_cpu.h
# The CPU type affects the endian conversion functions all over the kernel.
I386_CPU opt_global.h
@@ -64,29 +67,27 @@ I486_CPU opt_global.h
I586_CPU opt_global.h
I686_CPU opt_global.h
+SC_SPLASH_SCREEN opt_syscons.h
MAXCONS opt_syscons.h
+SLOW_VGA opt_syscons.h
STD8X16FONT opt_syscons.h
SC_HISTORY_SIZE opt_syscons.h
SC_DISABLE_REBOOT opt_syscons.h
SC_MOUSE_CHAR opt_syscons.h
-
-FB_INSTALL_CDEV opt_fb.h
+SC_ALT_SEQACCESS opt_syscons.h
VESA opt_vesa.h
-GDC opt_gdc.h
-
PSM_HOOKAPM opt_psm.h
PSM_RESETAFTERSUSPEND opt_psm.h
PSM_DEBUG opt_psm.h
PCIC_RESUME_RESET opt_pcic.h
-KBD_INSTALL_CDEV opt_kbd.h
-KBD_MAXRETRY opt_kbd.h
-KBD_MAXWAIT opt_kbd.h
-KBD_RESETDELAY opt_kbd.h
-KBDIO_DEBUG opt_kbd.h
+KBD_RESETDELAY opt_kbdio.h
+KBD_MAXRETRY opt_kbdio.h
+KBD_MAXWAIT opt_kbdio.h
+KBDIO_DEBUG opt_kbdio.h
ATAPI opt_atapi.h
ATAPI_STATIC opt_atapi.h
@@ -95,13 +96,12 @@ CMD640 opt_wd.h
USERCONFIG opt_userconfig.h
VISUAL_USERCONFIG opt_userconfig.h
-INTRO_USERCONFIG opt_userconfig.h
+USERCONFIG_BOOT opt_userconfig.h
EISA_SLOTS opt_eisa.h
FDC_DEBUG opt_fdc.h
FDC_PRINT_BOGUS_CHIPTYPE opt_fdc.h
-FDC_YE opt_fdc.h
# pcvt(4) has a bunch of options
FAT_CURSOR opt_pcvt.h
@@ -125,42 +125,6 @@ GUS_IRQ opt_sound.h
# Video spigot
SPIGOT_UNSECURE opt_spigot.h
-# -------------------------------
-# isdn4bsd: passive ISA cards
-# -------------------------------
-TEL_S0_8 opt_i4b.h
-TEL_S0_16 opt_i4b.h
-TEL_S0_16_3 opt_i4b.h
-AVM_A1 opt_i4b.h
-USR_STI opt_i4b.h
-ITKIX1 opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive ISA PnP cards
-# -------------------------------
-CRTX_S0_P opt_i4b.h
-DRN_NGO opt_i4b.h
-TEL_S0_16_3_P opt_i4b.h
-SEDLBAUER opt_i4b.h
-DYNALINK opt_i4b.h
-ELSA_QS1ISA opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCI cards
-# -------------------------------
-ELSA_QS1PCI opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCMCIA cards
-# -------------------------------
-AVM_A1_PCMCIA opt_i4b.h
-# -------------------------------
-# isdn4bsd: misc options
-# -------------------------------
-# temporary workaround for SMP machines
-I4B_SMP_WORKAROUND opt_i4b.h
-# enable VJ compression code for ipr i/f
-IPR_VJ opt_i4b.h
-# -------------------------------
-# EOF
-# -------------------------------
# bs driver options
SCSI_BOUNCE_SIZE opt_bs.h
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 91095587ab6e9..7449379560cf8 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.104 1999/01/08 16:04:20 kato Exp $
+ * $Id: machdep.c,v 1.98 1998/10/09 12:36:25 kato Exp $
*/
#include "apm.h"
@@ -109,6 +109,9 @@
#include <net/netisr.h>
#endif
+#if NAPM > 0
+#include <machine/apm_bios.h>
+#endif
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/clock.h>
@@ -423,12 +426,6 @@ again:
*/
{
vm_offset_t mb_map_size;
- int xclusters;
-
- /* Allow override of NMBCLUSTERS from the kernel environment */
- if (getenv_int("kern.ipc.nmbclusters", &xclusters) &&
- xclusters > nmbclusters)
- nmbclusters = xclusters;
mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES;
mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE));
@@ -452,8 +449,14 @@ again:
}
#if defined(USERCONFIG)
- userconfig();
- cninit(); /* the preferred console may have changed */
+#if defined(USERCONFIG_BOOT)
+ if (1) {
+#else
+ if (boothowto & RB_CONFIG) {
+#endif
+ userconfig();
+ cninit(); /* the preferred console may have changed */
+ }
#endif
printf("avail memory = %d (%dK bytes)\n", ptoa(cnt.v_free_count),
@@ -545,11 +548,7 @@ sendsig(catcher, sig, mask, code)
* and the stack can not be grown. useracc will return FALSE
* if access is denied.
*/
-#ifdef VM_STACK
- if ((grow_stack (p, (int)fp) == FALSE) ||
-#else
if ((grow(p, (int)fp) == FALSE) ||
-#endif
(useracc((caddr_t)fp, sizeof(struct sigframe), B_WRITE) == FALSE)) {
/*
* Process has trashed its stack; give it an illegal
@@ -644,7 +643,7 @@ sendsig(catcher, sig, mask, code)
}
regs->tf_esp = (int)fp;
- regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
regs->tf_es = _udatasel;
@@ -808,6 +807,17 @@ cpu_halt(void)
}
/*
+ * Turn the power off.
+ */
+void
+cpu_power_down(void)
+{
+#if NAPM > 0
+ apm_power_off();
+#endif
+}
+
+/*
* Clear registers on exec
*/
void
@@ -1255,7 +1265,11 @@ init386(first)
setidt(11, &IDTVEC(missing), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(12, &IDTVEC(stk), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(13, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+#ifdef CPU_BUGGY_CYRIX
setidt(14, &IDTVEC(page), SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+#else
+ setidt(14, &IDTVEC(page), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
+#endif
setidt(15, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(16, &IDTVEC(fpu), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(17, &IDTVEC(align), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
@@ -1680,7 +1694,7 @@ f00f_hack(void *unused) {
if (!has_f00f_bug)
return;
- printf("Intel Pentium detected, installing workaround for F00F bug\n");
+ printf("Intel Pentium F00F detected, installing workaround\n");
r_idt.rd_limit = sizeof(idt) - 1;
diff --git a/sys/pc98/i386/trap.c b/sys/pc98/i386/trap.c
new file mode 100644
index 0000000000000..9ea5d8051d1fd
--- /dev/null
+++ b/sys/pc98/i386/trap.c
@@ -0,0 +1,1159 @@
+/*-
+ * Copyright (C) 1994, David Greenman
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the University of Utah, and William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
+ * $Id: trap.c,v 1.50 1998/04/29 09:45:38 kato Exp $
+ */
+
+/*
+ * 386 Trap and System call handling
+ */
+
+#include "opt_cpu.h"
+#include "opt_ddb.h"
+#include "opt_ktrace.h"
+#include "opt_trap.h"
+#include "opt_vm86.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/pioctl.h>
+#include <sys/kernel.h>
+#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
+#include <sys/syscall.h>
+#include <sys/sysent.h>
+#include <sys/uio.h>
+#include <sys/vmmeter.h>
+#ifdef KTRACE
+#include <sys/ktrace.h>
+#endif
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/vm_prot.h>
+#include <sys/lock.h>
+#include <vm/pmap.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_map.h>
+#include <vm/vm_page.h>
+#include <vm/vm_extern.h>
+
+#include <machine/cpu.h>
+#include <machine/ipl.h>
+#include <machine/md_var.h>
+#include <machine/pcb.h>
+#ifdef SMP
+#include <machine/smp.h>
+#endif
+#include <machine/tss.h>
+
+#include <i386/isa/intr_machdep.h>
+
+#ifdef POWERFAIL_NMI
+#include <sys/syslog.h>
+#include <machine/clock.h>
+#endif
+
+#ifdef VM86
+#include <machine/vm86.h>
+#endif
+
+#include "isa.h"
+#include "npx.h"
+
+extern struct i386tss common_tss;
+
+int (*pmath_emulate) __P((struct trapframe *));
+
+extern void trap __P((struct trapframe frame));
+extern int trapwrite __P((unsigned addr));
+extern void syscall __P((struct trapframe frame));
+
+#ifdef CPU_BUGGY_CYRIX
+static int trap_pfault __P((struct trapframe *, int, vm_offset_t));
+#else
+static int trap_pfault __P((struct trapframe *, int));
+#endif
+static void trap_fatal __P((struct trapframe *));
+void dblfault_handler __P((void));
+
+extern inthand_t IDTVEC(syscall);
+
+#define MAX_TRAP_MSG 28
+static char *trap_msg[] = {
+ "", /* 0 unused */
+ "privileged instruction fault", /* 1 T_PRIVINFLT */
+ "", /* 2 unused */
+ "breakpoint instruction fault", /* 3 T_BPTFLT */
+ "", /* 4 unused */
+ "", /* 5 unused */
+ "arithmetic trap", /* 6 T_ARITHTRAP */
+ "system forced exception", /* 7 T_ASTFLT */
+ "", /* 8 unused */
+ "general protection fault", /* 9 T_PROTFLT */
+ "trace trap", /* 10 T_TRCTRAP */
+ "", /* 11 unused */
+ "page fault", /* 12 T_PAGEFLT */
+ "", /* 13 unused */
+ "alignment fault", /* 14 T_ALIGNFLT */
+ "", /* 15 unused */
+ "", /* 16 unused */
+ "", /* 17 unused */
+ "integer divide fault", /* 18 T_DIVIDE */
+ "non-maskable interrupt trap", /* 19 T_NMI */
+ "overflow trap", /* 20 T_OFLOW */
+ "FPU bounds check fault", /* 21 T_BOUND */
+ "FPU device not available", /* 22 T_DNA */
+ "double fault", /* 23 T_DOUBLEFLT */
+ "FPU operand fetch fault", /* 24 T_FPOPFLT */
+ "invalid TSS fault", /* 25 T_TSSFLT */
+ "segment not present fault", /* 26 T_SEGNPFLT */
+ "stack fault", /* 27 T_STKFLT */
+ "machine check trap", /* 28 T_MCHK */
+};
+
+static __inline void userret __P((struct proc *p, struct trapframe *frame,
+ u_quad_t oticks));
+
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+extern struct gate_descriptor *t_idt;
+extern int has_f00f_bug;
+#endif
+
+static __inline void
+userret(p, frame, oticks)
+ struct proc *p;
+ struct trapframe *frame;
+ u_quad_t oticks;
+{
+ int sig, s;
+
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+
+#if 0
+ if (!want_resched &&
+ (p->p_priority <= p->p_usrpri) &&
+ (p->p_rtprio.type == RTP_PRIO_NORMAL)) {
+ int newpriority;
+ p->p_estcpu += 1;
+ newpriority = PUSER + p->p_estcpu / 4 + 2 * p->p_nice;
+ newpriority = min(newpriority, MAXPRI);
+ p->p_usrpri = newpriority;
+ }
+#endif
+
+ p->p_priority = p->p_usrpri;
+ if (want_resched) {
+ /*
+ * Since we are curproc, clock will normally just change
+ * our priority without moving us from one queue to another
+ * (since the running process is not on a queue.)
+ * If that happened after we setrunqueue ourselves but before we
+ * mi_switch()'ed, we might not be on the queue indicated by
+ * our priority.
+ */
+ s = splhigh();
+ setrunqueue(p);
+ p->p_stats->p_ru.ru_nivcsw++;
+ mi_switch();
+ splx(s);
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ }
+ /*
+ * Charge system time if profiling.
+ */
+ if (p->p_flag & P_PROFIL)
+ addupc_task(p, frame->tf_eip,
+ (u_int)(p->p_sticks - oticks) * psratio);
+
+ curpriority = p->p_priority;
+}
+
+/*
+ * Exception, fault, and trap interface to the FreeBSD kernel.
+ * This common code is called from assembly language IDT gate entry
+ * routines that prepare a suitable stack frame, and restore this
+ * frame after the exception has been processed.
+ */
+
+void
+trap(frame)
+ struct trapframe frame;
+{
+ struct proc *p = curproc;
+ u_quad_t sticks = 0;
+ int i = 0, ucode = 0, type, code;
+#ifdef DEBUG
+ u_long eva;
+#endif
+#ifdef CPU_BUGGY_CYRIX
+ vm_offset_t va;
+#endif
+
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+restart:
+#endif
+ type = frame.tf_trapno;
+ code = frame.tf_err;
+
+#ifdef CPU_BUGGY_CYRIX
+ /* XXX:
+ * CYRIX 486 CPU FIX.
+ * If you use cyrix cpu, you often encouter strange signal 11's?
+ * I think this is due to cyrix cpu bugs.
+ * In any way, the following trick is effective for the problem.
+ * As soon as possible, we must get the fault page address.
+ */
+ va = (vm_offset_t)(rcr2());
+ if( type == T_PAGEFLT && ( frame.tf_eflags & PSL_I ) )
+ asm("sti");
+#endif /* CPU_BUGGY_CYRIX */
+
+#ifdef VM86
+ if (in_vm86call) {
+ if (frame.tf_eflags & PSL_VM &&
+ (type == T_PROTFLT || type == T_STKFLT)) {
+ i = vm86_emulate((struct vm86frame *)&frame);
+ if (i != 0)
+ /*
+ * returns to original process
+ */
+ vm86_trap((struct vm86frame *)&frame);
+ return;
+ }
+ switch (type) {
+ /*
+ * these traps want either a process context, or
+ * assume a normal userspace trap.
+ */
+ case T_PROTFLT:
+ case T_SEGNPFLT:
+ trap_fatal(&frame);
+ return;
+ case T_TRCTRAP:
+ type = T_BPTFLT; /* kernel breakpoint */
+ /* FALL THROUGH */
+ }
+ goto kernel_trap; /* normal kernel trap handling */
+ }
+#endif
+
+ if ((ISPL(frame.tf_cs) == SEL_UPL) || (frame.tf_eflags & PSL_VM)) {
+ /* user trap */
+
+ sticks = p->p_sticks;
+ p->p_md.md_regs = &frame;
+
+ switch (type) {
+ case T_PRIVINFLT: /* privileged instruction fault */
+ ucode = type;
+ i = SIGILL;
+ break;
+
+ case T_BPTFLT: /* bpt instruction fault */
+ case T_TRCTRAP: /* trace trap */
+ frame.tf_eflags &= ~PSL_T;
+ i = SIGTRAP;
+ break;
+
+ case T_ARITHTRAP: /* arithmetic trap */
+ ucode = code;
+ i = SIGFPE;
+ break;
+
+ case T_ASTFLT: /* Allow process switch */
+ astoff();
+ cnt.v_soft++;
+ if (p->p_flag & P_OWEUPC) {
+ p->p_flag &= ~P_OWEUPC;
+ addupc_task(p, p->p_stats->p_prof.pr_addr,
+ p->p_stats->p_prof.pr_ticks);
+ }
+ goto out;
+
+ /*
+ * The following two traps can happen in
+ * vm86 mode, and, if so, we want to handle
+ * them specially.
+ */
+ case T_PROTFLT: /* general protection fault */
+ case T_STKFLT: /* stack fault */
+#ifdef VM86
+ if (frame.tf_eflags & PSL_VM) {
+ i = vm86_emulate((struct vm86frame *)&frame);
+ if (i == 0)
+ goto out;
+ break;
+ }
+#endif /* VM86 */
+ /* FALL THROUGH */
+
+ case T_SEGNPFLT: /* segment not present fault */
+ case T_TSSFLT: /* invalid TSS fault */
+ case T_DOUBLEFLT: /* double fault */
+ default:
+ ucode = code + BUS_SEGM_FAULT ;
+ i = SIGBUS;
+ break;
+
+ case T_PAGEFLT: /* page fault */
+#ifdef CPU_BUGGY_CYRIX
+ i = trap_pfault(&frame, TRUE, va);
+#else
+ i = trap_pfault(&frame, TRUE);
+#endif
+ if (i == -1)
+ return;
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+ if (i == -2)
+ goto restart;
+#endif
+ if (i == 0)
+ goto out;
+
+ ucode = T_PAGEFLT;
+ break;
+
+ case T_DIVIDE: /* integer divide fault */
+ ucode = FPE_INTDIV_TRAP;
+ i = SIGFPE;
+ break;
+
+#if NISA > 0
+ case T_NMI:
+#ifdef POWERFAIL_NMI
+ goto handle_powerfail;
+#else /* !POWERFAIL_NMI */
+#ifdef DDB
+ /* NMI can be hooked up to a pushbutton for debugging */
+ printf ("NMI ... going to debugger\n");
+ if (kdb_trap (type, 0, &frame))
+ return;
+#endif /* DDB */
+ /* machine/parity/power fail/"kitchen sink" faults */
+ if (isa_nmi(code) == 0) return;
+ panic("NMI indicates hardware failure");
+#endif /* POWERFAIL_NMI */
+#endif /* NISA > 0 */
+
+ case T_OFLOW: /* integer overflow fault */
+ ucode = FPE_INTOVF_TRAP;
+ i = SIGFPE;
+ break;
+
+ case T_BOUND: /* bounds check fault */
+ ucode = FPE_SUBRNG_TRAP;
+ i = SIGFPE;
+ break;
+
+ case T_DNA:
+#if NNPX > 0
+ /* if a transparent fault (due to context switch "late") */
+ if (npxdna())
+ return;
+#endif
+ if (!pmath_emulate) {
+ i = SIGFPE;
+ ucode = FPE_FPU_NP_TRAP;
+ break;
+ }
+ i = (*pmath_emulate)(&frame);
+ if (i == 0) {
+ if (!(frame.tf_eflags & PSL_T))
+ return;
+ frame.tf_eflags &= ~PSL_T;
+ i = SIGTRAP;
+ }
+ /* else ucode = emulator_only_knows() XXX */
+ break;
+
+ case T_FPOPFLT: /* FPU operand fetch fault */
+ ucode = T_FPOPFLT;
+ i = SIGILL;
+ break;
+ }
+ } else {
+#ifdef VM86
+kernel_trap:
+#endif
+ /* kernel trap */
+
+ switch (type) {
+ case T_PAGEFLT: /* page fault */
+#ifdef CPU_BUGGY_CYRIX
+ (void) trap_pfault(&frame, FALSE, va);
+#else
+ (void) trap_pfault(&frame, FALSE);
+#endif
+ return;
+
+ case T_DNA:
+#if NNPX > 0
+ /*
+ * The kernel is apparently using npx for copying.
+ * XXX this should be fatal unless the kernel has
+ * registered such use.
+ */
+ if (npxdna())
+ return;
+#endif
+ break;
+
+ case T_PROTFLT: /* general protection fault */
+ case T_SEGNPFLT: /* segment not present fault */
+ /*
+ * Invalid segment selectors and out of bounds
+ * %eip's and %esp's can be set up in user mode.
+ * This causes a fault in kernel mode when the
+ * kernel tries to return to user mode. We want
+ * to get this fault so that we can fix the
+ * problem here and not have to check all the
+ * selectors and pointers when the user changes
+ * them.
+ */
+#define MAYBE_DORETI_FAULT(where, whereto) \
+ do { \
+ if (frame.tf_eip == (int)where) { \
+ frame.tf_eip = (int)whereto; \
+ return; \
+ } \
+ } while (0)
+
+ if (intr_nesting_level == 0) {
+ /*
+ * Invalid %fs's and %gs's can be created using
+ * procfs or PT_SETREGS or by invalidating the
+ * underlying LDT entry. This causes a fault
+ * in kernel mode when the kernel attempts to
+ * switch contexts. Lose the bad context
+ * (XXX) so that we can continue, and generate
+ * a signal.
+ */
+ if (frame.tf_eip == (int)cpu_switch_load_fs) {
+ curpcb->pcb_fs = 0;
+ psignal(p, SIGBUS);
+ return;
+ }
+ if (frame.tf_eip == (int)cpu_switch_load_gs) {
+ curpcb->pcb_gs = 0;
+ psignal(p, SIGBUS);
+ return;
+ }
+ MAYBE_DORETI_FAULT(doreti_iret,
+ doreti_iret_fault);
+ MAYBE_DORETI_FAULT(doreti_popl_ds,
+ doreti_popl_ds_fault);
+ MAYBE_DORETI_FAULT(doreti_popl_es,
+ doreti_popl_es_fault);
+ if (curpcb && curpcb->pcb_onfault) {
+ frame.tf_eip = (int)curpcb->pcb_onfault;
+ return;
+ }
+ }
+ break;
+
+ case T_TSSFLT:
+ /*
+ * PSL_NT can be set in user mode and isn't cleared
+ * automatically when the kernel is entered. This
+ * causes a TSS fault when the kernel attempts to
+ * `iret' because the TSS link is uninitialized. We
+ * want to get this fault so that we can fix the
+ * problem here and not every time the kernel is
+ * entered.
+ */
+ if (frame.tf_eflags & PSL_NT) {
+ frame.tf_eflags &= ~PSL_NT;
+ return;
+ }
+ break;
+
+ case T_TRCTRAP: /* trace trap */
+ if (frame.tf_eip == (int)IDTVEC(syscall)) {
+ /*
+ * We've just entered system mode via the
+ * syscall lcall. Continue single stepping
+ * silently until the syscall handler has
+ * saved the flags.
+ */
+ return;
+ }
+ if (frame.tf_eip == (int)IDTVEC(syscall) + 1) {
+ /*
+ * The syscall handler has now saved the
+ * flags. Stop single stepping it.
+ */
+ frame.tf_eflags &= ~PSL_T;
+ return;
+ }
+ /*
+ * Fall through.
+ */
+ case T_BPTFLT:
+ /*
+ * If DDB is enabled, let it handle the debugger trap.
+ * Otherwise, debugger traps "can't happen".
+ */
+#ifdef DDB
+ if (kdb_trap (type, 0, &frame))
+ return;
+#endif
+ break;
+
+#if NISA > 0
+ case T_NMI:
+#ifdef POWERFAIL_NMI
+#ifndef TIMER_FREQ
+# define TIMER_FREQ 1193182
+#endif
+ handle_powerfail:
+ {
+ static unsigned lastalert = 0;
+
+ if(time_second - lastalert > 10)
+ {
+ log(LOG_WARNING, "NMI: power fail\n");
+ sysbeep(TIMER_FREQ/880, hz);
+ lastalert = time_second;
+ }
+ return;
+ }
+#else /* !POWERFAIL_NMI */
+#ifdef DDB
+ /* NMI can be hooked up to a pushbutton for debugging */
+ printf ("NMI ... going to debugger\n");
+ if (kdb_trap (type, 0, &frame))
+ return;
+#endif /* DDB */
+ /* machine/parity/power fail/"kitchen sink" faults */
+ if (isa_nmi(code) == 0) return;
+ /* FALL THROUGH */
+#endif /* POWERFAIL_NMI */
+#endif /* NISA > 0 */
+ }
+
+ trap_fatal(&frame);
+ return;
+ }
+
+ /* Translate fault for emulators (e.g. Linux) */
+ if (*p->p_sysent->sv_transtrap)
+ i = (*p->p_sysent->sv_transtrap)(i, type);
+
+ trapsignal(p, i, ucode);
+
+#ifdef DEBUG
+ eva = rcr2();
+ if (type <= MAX_TRAP_MSG) {
+ uprintf("fatal process exception: %s",
+ trap_msg[type]);
+ if ((type == T_PAGEFLT) || (type == T_PROTFLT))
+ uprintf(", fault VA = 0x%lx", eva);
+ uprintf("\n");
+ }
+#endif
+
+out:
+ userret(p, &frame, sticks);
+}
+
+#ifdef notyet
+/*
+ * This version doesn't allow a page fault to user space while
+ * in the kernel. The rest of the kernel needs to be made "safe"
+ * before this can be used. I think the only things remaining
+ * to be made safe are the iBCS2 code and the process tracing/
+ * debugging code.
+ */
+static int
+#ifdef CPU_BUGGY_CYRIX
+trap_pfault(frame, usermode,faultva)
+ struct trapframe *frame;
+ int usermode;
+ vm_offset_t faultva;
+#else
+trap_pfault(frame, usermode)
+ struct trapframe *frame;
+ int usermode;
+#endif
+{
+ vm_offset_t va;
+ struct vmspace *vm = NULL;
+ vm_map_t map = 0;
+ int rv = 0;
+ vm_prot_t ftype;
+ int eva;
+ struct proc *p = curproc;
+
+ if (frame->tf_err & PGEX_W)
+ ftype = VM_PROT_READ | VM_PROT_WRITE;
+ else
+ ftype = VM_PROT_READ;
+
+#ifdef CPU_BUGGY_CYRIX
+ eva = faultva;
+#else
+ eva = rcr2();
+#endif
+ va = trunc_page((vm_offset_t)eva);
+
+ if (va < VM_MIN_KERNEL_ADDRESS) {
+ vm_offset_t v;
+ vm_page_t mpte;
+
+ if (p == NULL ||
+ (!usermode && va < VM_MAXUSER_ADDRESS &&
+ (intr_nesting_level != 0 || curpcb == NULL ||
+ curpcb->pcb_onfault == NULL))) {
+ trap_fatal(frame);
+ return (-1);
+ }
+
+ /*
+ * This is a fault on non-kernel virtual memory.
+ * vm is initialized above to NULL. If curproc is NULL
+ * or curproc->p_vmspace is NULL the fault is fatal.
+ */
+ vm = p->p_vmspace;
+ if (vm == NULL)
+ goto nogo;
+
+ map = &vm->vm_map;
+
+ /*
+ * Keep swapout from messing with us during this
+ * critical time.
+ */
+ ++p->p_lock;
+
+ /*
+ * Grow the stack if necessary
+ */
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
+ if (!grow(p, va)) {
+ rv = KERN_FAILURE;
+ --p->p_lock;
+ goto nogo;
+ }
+ }
+
+ /* Fault in the user page: */
+ rv = vm_fault(map, va, ftype,
+ (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
+
+ --p->p_lock;
+ } else {
+ /*
+ * Don't allow user-mode faults in kernel address space.
+ */
+ if (usermode)
+ goto nogo;
+
+ /*
+ * Since we know that kernel virtual address addresses
+ * always have pte pages mapped, we just have to fault
+ * the page.
+ */
+ rv = vm_fault(kernel_map, va, ftype, FALSE);
+ }
+
+ if (rv == KERN_SUCCESS)
+ return (0);
+nogo:
+ if (!usermode) {
+ if (intr_nesting_level == 0 && curpcb && curpcb->pcb_onfault) {
+ frame->tf_eip = (int)curpcb->pcb_onfault;
+ return (0);
+ }
+ trap_fatal(frame);
+ return (-1);
+ }
+
+ /* kludge to pass faulting virtual address to sendsig */
+ frame->tf_err = eva;
+
+ return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
+}
+#endif
+
+int
+#ifdef CPU_BUGGY_CYRIX
+trap_pfault(frame, usermode,faultva)
+ struct trapframe *frame;
+ int usermode;
+ vm_offset_t faultva;
+#else
+trap_pfault(frame, usermode)
+ struct trapframe *frame;
+ int usermode;
+#endif
+{
+ vm_offset_t va;
+ struct vmspace *vm = NULL;
+ vm_map_t map = 0;
+ int rv = 0;
+ vm_prot_t ftype;
+ int eva;
+ struct proc *p = curproc;
+
+#ifdef CPU_BUGGY_CYRIX
+ eva = faultva;
+#else
+ eva = rcr2();
+#endif
+ va = trunc_page((vm_offset_t)eva);
+
+ if (va >= KERNBASE) {
+ /*
+ * Don't allow user-mode faults in kernel address space.
+ * An exception: if the faulting address is the invalid
+ * instruction entry in the IDT, then the Intel Pentium
+ * F00F bug workaround was triggered, and we need to
+ * treat it is as an illegal instruction, and not a page
+ * fault.
+ */
+#if defined(I586_CPU) && !defined(NO_F00F_HACK)
+ if ((eva == (unsigned int)&t_idt[6]) && has_f00f_bug) {
+ frame->tf_trapno = T_PRIVINFLT;
+ return -2;
+ }
+#endif
+ if (usermode)
+ goto nogo;
+
+ map = kernel_map;
+ } else {
+ /*
+ * This is a fault on non-kernel virtual memory.
+ * vm is initialized above to NULL. If curproc is NULL
+ * or curproc->p_vmspace is NULL the fault is fatal.
+ */
+ if (p != NULL)
+ vm = p->p_vmspace;
+
+ if (vm == NULL)
+ goto nogo;
+
+ map = &vm->vm_map;
+ }
+
+ if (frame->tf_err & PGEX_W)
+ ftype = VM_PROT_READ | VM_PROT_WRITE;
+ else
+ ftype = VM_PROT_READ;
+
+ if (map != kernel_map) {
+ /*
+ * Keep swapout from messing with us during this
+ * critical time.
+ */
+ ++p->p_lock;
+
+ /*
+ * Grow the stack if necessary
+ */
+ if ((caddr_t)va > vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
+ if (!grow(p, va)) {
+ rv = KERN_FAILURE;
+ --p->p_lock;
+ goto nogo;
+ }
+ }
+
+ /* Fault in the user page: */
+ rv = vm_fault(map, va, ftype,
+ (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
+
+ --p->p_lock;
+ } else {
+ /*
+ * Don't have to worry about process locking or stacks in the kernel.
+ */
+ rv = vm_fault(map, va, ftype, FALSE);
+ }
+
+ if (rv == KERN_SUCCESS)
+ return (0);
+nogo:
+ if (!usermode) {
+ if (intr_nesting_level == 0 && curpcb && curpcb->pcb_onfault) {
+ frame->tf_eip = (int)curpcb->pcb_onfault;
+ return (0);
+ }
+ trap_fatal(frame);
+ return (-1);
+ }
+
+ /* kludge to pass faulting virtual address to sendsig */
+ frame->tf_err = eva;
+
+ return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
+}
+
+static void
+trap_fatal(frame)
+ struct trapframe *frame;
+{
+ int code, type, eva, ss, esp;
+ struct soft_segment_descriptor softseg;
+
+ code = frame->tf_err;
+ type = frame->tf_trapno;
+ eva = rcr2();
+ sdtossd(&gdt[IDXSEL(frame->tf_cs & 0xffff)].sd, &softseg);
+
+ if (type <= MAX_TRAP_MSG)
+ printf("\n\nFatal trap %d: %s while in %s mode\n",
+ type, trap_msg[type],
+ frame->tf_eflags & PSL_VM ? "vm86" :
+ ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
+#ifdef SMP
+ /* three seperate prints in case of a trap on an unmapped page */
+ printf("mp_lock = %08x; ", mp_lock);
+ printf("cpuid = %d; ", cpuid);
+ printf("lapic.id = %08x\n", lapic.id);
+#endif
+ if (type == T_PAGEFLT) {
+ printf("fault virtual address = 0x%x\n", eva);
+ printf("fault code = %s %s, %s\n",
+ code & PGEX_U ? "user" : "supervisor",
+ code & PGEX_W ? "write" : "read",
+ code & PGEX_P ? "protection violation" : "page not present");
+ }
+ printf("instruction pointer = 0x%x:0x%x\n",
+ frame->tf_cs & 0xffff, frame->tf_eip);
+ if ((ISPL(frame->tf_cs) == SEL_UPL) || (frame->tf_eflags & PSL_VM)) {
+ ss = frame->tf_ss & 0xffff;
+ esp = frame->tf_esp;
+ } else {
+ ss = GSEL(GDATA_SEL, SEL_KPL);
+ esp = (int)&frame->tf_esp;
+ }
+ printf("stack pointer = 0x%x:0x%x\n", ss, esp);
+ printf("frame pointer = 0x%x:0x%x\n", ss, frame->tf_ebp);
+ printf("code segment = base 0x%x, limit 0x%x, type 0x%x\n",
+ softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type);
+ printf(" = DPL %d, pres %d, def32 %d, gran %d\n",
+ softseg.ssd_dpl, softseg.ssd_p, softseg.ssd_def32,
+ softseg.ssd_gran);
+ printf("processor eflags = ");
+ if (frame->tf_eflags & PSL_T)
+ printf("trace trap, ");
+ if (frame->tf_eflags & PSL_I)
+ printf("interrupt enabled, ");
+ if (frame->tf_eflags & PSL_NT)
+ printf("nested task, ");
+ if (frame->tf_eflags & PSL_RF)
+ printf("resume, ");
+ if (frame->tf_eflags & PSL_VM)
+ printf("vm86, ");
+ printf("IOPL = %d\n", (frame->tf_eflags & PSL_IOPL) >> 12);
+ printf("current process = ");
+ if (curproc) {
+ printf("%lu (%s)\n",
+ (u_long)curproc->p_pid, curproc->p_comm ?
+ curproc->p_comm : "");
+ } else {
+ printf("Idle\n");
+ }
+ printf("interrupt mask = ");
+ if ((cpl & net_imask) == net_imask)
+ printf("net ");
+ if ((cpl & tty_imask) == tty_imask)
+ printf("tty ");
+ if ((cpl & bio_imask) == bio_imask)
+ printf("bio ");
+ if ((cpl & cam_imask) == cam_imask)
+ printf("cam ");
+ if (cpl == 0)
+ printf("none");
+#ifdef SMP
+/**
+ * XXX FIXME:
+ * we probably SHOULD have stopped the other CPUs before now!
+ * another CPU COULD have been touching cpl at this moment...
+ */
+ printf(" <- SMP: XXX");
+#endif
+ printf("\n");
+
+#ifdef KDB
+ if (kdb_trap(&psl))
+ return;
+#endif
+#ifdef DDB
+ if (kdb_trap (type, 0, frame))
+ return;
+#endif
+ printf("trap number = %d\n", type);
+ if (type <= MAX_TRAP_MSG)
+ panic(trap_msg[type]);
+ else
+ panic("unknown/reserved trap");
+}
+
+/*
+ * Double fault handler. Called when a fault occurs while writing
+ * a frame for a trap/exception onto the stack. This usually occurs
+ * when the stack overflows (such is the case with infinite recursion,
+ * for example).
+ *
+ * XXX Note that the current PTD gets replaced by IdlePTD when the
+ * task switch occurs. This means that the stack that was active at
+ * the time of the double fault is not available at <kstack> unless
+ * the machine was idle when the double fault occurred. The downside
+ * of this is that "trace <ebp>" in ddb won't work.
+ */
+void
+dblfault_handler()
+{
+ printf("\nFatal double fault:\n");
+ printf("eip = 0x%x\n", common_tss.tss_eip);
+ printf("esp = 0x%x\n", common_tss.tss_esp);
+ printf("ebp = 0x%x\n", common_tss.tss_ebp);
+#ifdef SMP
+ /* three seperate prints in case of a trap on an unmapped page */
+ printf("mp_lock = %08x; ", mp_lock);
+ printf("cpuid = %d; ", cpuid);
+ printf("lapic.id = %08x\n", lapic.id);
+#endif
+ panic("double fault");
+}
+
+/*
+ * Compensate for 386 brain damage (missing URKR).
+ * This is a little simpler than the pagefault handler in trap() because
+ * it the page tables have already been faulted in and high addresses
+ * are thrown out early for other reasons.
+ */
+int trapwrite(addr)
+ unsigned addr;
+{
+ struct proc *p;
+ vm_offset_t va;
+ struct vmspace *vm;
+ int rv;
+
+ va = trunc_page((vm_offset_t)addr);
+ /*
+ * XXX - MAX is END. Changed > to >= for temp. fix.
+ */
+ if (va >= VM_MAXUSER_ADDRESS)
+ return (1);
+
+ p = curproc;
+ vm = p->p_vmspace;
+
+ ++p->p_lock;
+
+ if ((caddr_t)va >= vm->vm_maxsaddr
+ && (caddr_t)va < (caddr_t)USRSTACK) {
+ if (!grow(p, va)) {
+ --p->p_lock;
+ return (1);
+ }
+ }
+
+ /*
+ * fault the data page
+ */
+ rv = vm_fault(&vm->vm_map, va, VM_PROT_READ|VM_PROT_WRITE, VM_FAULT_DIRTY);
+
+ --p->p_lock;
+
+ if (rv != KERN_SUCCESS)
+ return 1;
+
+ return (0);
+}
+
+/*
+ * System call request from POSIX system call gate interface to kernel.
+ * Like trap(), argument is call by reference.
+ */
+void
+syscall(frame)
+ struct trapframe frame;
+{
+ caddr_t params;
+ int i;
+ struct sysent *callp;
+ struct proc *p = curproc;
+ u_quad_t sticks;
+ int error;
+ int args[8];
+ u_int code;
+
+#ifdef DIAGNOSTIC
+ if (ISPL(frame.tf_cs) != SEL_UPL)
+ panic("syscall");
+#endif
+ sticks = p->p_sticks;
+ p->p_md.md_regs = &frame;
+ params = (caddr_t)frame.tf_esp + sizeof(int);
+ code = frame.tf_eax;
+ if (p->p_sysent->sv_prepsyscall) {
+ (*p->p_sysent->sv_prepsyscall)(&frame, args, &code, &params);
+ } else {
+ /*
+ * Need to check if this is a 32 bit or 64 bit syscall.
+ */
+ if (code == SYS_syscall) {
+ /*
+ * Code is first argument, followed by actual args.
+ */
+ code = fuword(params);
+ params += sizeof(int);
+ } else if (code == SYS___syscall) {
+ /*
+ * Like syscall, but code is a quad, so as to maintain
+ * quad alignment for the rest of the arguments.
+ */
+ code = fuword(params);
+ params += sizeof(quad_t);
+ }
+ }
+
+ if (p->p_sysent->sv_mask)
+ code &= p->p_sysent->sv_mask;
+
+ if (code >= p->p_sysent->sv_size)
+ callp = &p->p_sysent->sv_table[0];
+ else
+ callp = &p->p_sysent->sv_table[code];
+
+ if (params && (i = callp->sy_narg * sizeof(int)) &&
+ (error = copyin(params, (caddr_t)args, (u_int)i))) {
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSCALL))
+ ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+#endif
+ goto bad;
+ }
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSCALL))
+ ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
+#endif
+ p->p_retval[0] = 0;
+ p->p_retval[1] = frame.tf_edx;
+
+ STOPEVENT(p, S_SCE, callp->sy_narg);
+
+ error = (*callp->sy_call)(p, args);
+
+ switch (error) {
+
+ case 0:
+ /*
+ * Reinitialize proc pointer `p' as it may be different
+ * if this is a child returning from fork syscall.
+ */
+ p = curproc;
+ frame.tf_eax = p->p_retval[0];
+ frame.tf_edx = p->p_retval[1];
+ frame.tf_eflags &= ~PSL_C;
+ break;
+
+ case ERESTART:
+ /*
+ * Reconstruct pc, assuming lcall $X,y is 7 bytes,
+ * int 0x80 is 2 bytes. We saved this in tf_err.
+ */
+ frame.tf_eip -= frame.tf_err;
+ break;
+
+ case EJUSTRETURN:
+ break;
+
+ default:
+bad:
+ if (p->p_sysent->sv_errsize)
+ if (error >= p->p_sysent->sv_errsize)
+ error = -1; /* XXX */
+ else
+ error = p->p_sysent->sv_errtbl[error];
+ frame.tf_eax = error;
+ frame.tf_eflags |= PSL_C;
+ break;
+ }
+
+ if ((frame.tf_eflags & PSL_T) && !(frame.tf_eflags & PSL_VM)) {
+ /* Traced syscall. */
+ frame.tf_eflags &= ~PSL_T;
+ trapsignal(p, SIGTRAP, 0);
+ }
+
+ userret(p, &frame, sticks);
+
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSRET))
+ ktrsysret(p->p_tracep, code, error, p->p_retval[0]);
+#endif
+
+ /*
+ * This works because errno is findable through the
+ * register set. If we ever support an emulation where this
+ * is not the case, this code will need to be revisited.
+ */
+ STOPEVENT(p, S_SCX, code);
+
+}
+
+/*
+ * Simplified back end of syscall(), used when returning from fork()
+ * directly into user mode.
+ */
+void
+fork_return(p, frame)
+ struct proc *p;
+ struct trapframe frame;
+{
+ frame.tf_eax = 0; /* Child returns zero */
+ frame.tf_eflags &= ~PSL_C; /* success */
+ frame.tf_edx = 1;
+
+ userret(p, &frame, 0);
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_SYSRET))
+ ktrsysret(p->p_tracep, SYS_fork, 0, 0);
+#endif
+}
diff --git a/sys/pc98/i386/userconfig.c b/sys/pc98/i386/userconfig.c
index 30fccbc4da75f..d291653b84199 100644
--- a/sys/pc98/i386/userconfig.c
+++ b/sys/pc98/i386/userconfig.c
@@ -46,7 +46,7 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
- ** $Id: userconfig.c,v 1.64 1999/01/16 11:39:08 kato Exp $
+ ** $Id: userconfig.c,v 1.56 1998/10/08 12:09:38 kato Exp $
**/
/**
@@ -117,8 +117,6 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/reboot.h>
-#include <sys/linker.h>
-#include <sys/sysctl.h>
#include <machine/cons.h>
#include <machine/md_var.h>
@@ -137,156 +135,36 @@ static MALLOC_DEFINE(M_DEVL, "isa_devlist", "isa_device lists in userconfig()");
static struct isa_device *isa_devlist; /* list read by dset to extract changes */
+#ifdef USERCONFIG_BOOT
+char userconfig_from_boot[512] = "";
static int userconfig_boot_parsing; /* set if we are reading from the boot instructions */
-#define putchar(x) cnputc(x)
-
-static int
-sysctl_machdep_uc_devlist SYSCTL_HANDLER_ARGS
-{
- struct isa_device *id;
- int error=0;
- char name[8];
-
- if(!req->oldptr) {
- /* Only sizing */
- id=isa_devlist;
- while(id) {
- error+=sizeof(struct isa_device)+8;
- id=id->id_next;
- }
- return(SYSCTL_OUT(req,0,error));
- } else {
- /* Output the data. The buffer is filled with consecutive
- * struct isa_device and char buf[8], containing the name
- * (not guaranteed to end with '\0').
- */
- id=isa_devlist;
- while(id) {
- error=sysctl_handle_opaque(oidp,id,
- sizeof(struct isa_device),req);
- if(error) return(error);
- strncpy(name,id->id_driver->name,8);
- error=sysctl_handle_opaque(oidp,name,
- 8,req);
- if(error) return(error);
- id=id->id_next;
- }
- return(0);
- }
-}
-
-SYSCTL_PROC( _machdep, OID_AUTO, uc_devlist, CTLFLAG_RD,
- 0, 0, sysctl_machdep_uc_devlist, "A",
- "List of ISA devices changed in UserConfig");
-
-/*
-** Obtain command input.
-**
-** Initially, input is read from a possibly-loaded script.
-** At the end of the script, or if no script is supplied,
-** behaviour is determined by the RB_CONFIG (-c) flag. If
-** the flag is set, user input is read from the console; if
-** unset, the 'quit' command is invoked and userconfig
-** will exit.
-**
-** Note that quit commands encountered in the script will be
-** ignored if the RB_CONFIG flag is supplied.
-*/
static int
getchar(void)
{
- static const char *asp;
- static int assize; /* use of int for -ve magic value */
- static int autocheck = 0;
- caddr_t autoentry, autoattr;
- int c = 0;
- static int intro = 0;
-
- /* Look for loaded userconfig script */
- if (autocheck == 0)
- {
- autocheck = 1;
- autoentry = preload_search_by_type("userconfig_script");
- if (autoentry != NULL)
- {
- /* We have one, get size and data */
- assize = 0;
- if ((autoattr = preload_search_info(autoentry, MODINFO_SIZE)) != NULL)
- assize = (size_t)*(u_int32_t *)autoattr;
- asp = NULL;
- if ((autoattr = preload_search_info(autoentry, MODINFO_ADDR)) != NULL)
- asp = *(const char **)autoattr;
- /* sanity check */
- if ((assize == 0) || (asp == NULL)) {
- assize = 0;
- asp = NULL;
- }
- }
- }
-
- if (assize > 0)
- {
- /* Consume character from loaded userconfig script, display */
- userconfig_boot_parsing = 1;
- c = *asp;
- asp++;
- assize--;
+ static char *next = userconfig_from_boot;
- } else if (assize == 0) {
-
-#ifdef INTRO_USERCONFIG
- if (intro == 0)
- {
- /*
- * We don't want intro if we just executed a
- * script (userconfig_boot_parsing==1), otherwise
- * we would always block here waiting for user input.
- */
- intro = 1;
- if (userconfig_boot_parsing == 0)
- {
- /* userconfig_boot_parsing will be set to 1 on next pass,
- * which will allow using 'intro' in the middle of other
- * userconfig_script commands.
- */
- c = 'i';
- asp = "ntro\n";
- assize = strlen(asp);
- } else {
- userconfig_boot_parsing = 0;
- assize=-1;
- }
-#else
- userconfig_boot_parsing = 0;
- if (!(boothowto & RB_CONFIG))
- {
- /* don't want to drop to interpreter */
- c = 'q';
- asp = "uit\n";
- assize = strlen(asp);
-#endif
- userconfig_boot_parsing = 0;
+ if (next == userconfig_from_boot) {
+ if (strncmp(next, "USERCONFIG\n", 11)) {
+ next++;
+ strcpy(next, "intro\n");
} else {
- /* Only display signon banner if we are about to go interactive */
- if (!intro)
- printf("\nFreeBSD Kernel Configuration Utility - Version 1.2\n"
- " Type \"help\" for help"
-#ifdef VISUAL_USERCONFIG
- " or \"visual\" to go to the visual\n"
- " configuration interface (requires MGA/VGA display or\n"
- " serial terminal capable of displaying ANSI graphics)"
-#endif
- ".\n");
- assize = -1;
+ next += 11;
}
+ }
+ if (*next) {
+ userconfig_boot_parsing = 1;
+ return (*next++);
+ } else {
+ userconfig_boot_parsing = 0;
+ return cngetc();
}
- if (assize < 0) {
- /* No script, read from the keyboard */
- c = cngetc();
- }
- return(c);
}
+#else /* !USERCONFIG_BOOT */
+#define getchar() cngetc()
+#endif /* USERCONFIG_BOOT */
+
+#define putchar(x) cnputc(x)
#ifndef FALSE
#define FALSE (0)
@@ -403,16 +281,10 @@ static DEV_INFO device_info[] = {
{"vx", "3COM 3C590/3C595 Ethernet adapters", 0, CLS_NETWORK},
{"ze", "IBM/National Semiconductor PCMCIA Ethernet adapter",0, CLS_NETWORK},
{"zp", "3COM PCMCIA Etherlink III Ethernet adapter", 0, CLS_NETWORK},
-{"ax", "ASIC AX88140A ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"de", "DEC DC21040 Ethernet adapter", FLG_FIXED, CLS_NETWORK},
{"fpa", "DEC DEFPA PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
-{"rl", "RealTek 8129/8139 ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"mx", "Macronix PMAC ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"pn", "Lite-On 82c168/82c169 PNIC adapter", FLG_FIXED, CLS_NETWORK},
-{"tl", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"vr", "VIA Rhine/Rhine II ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"wb", "Winbond W89C840F ethernet adapter", FLG_FIXED, CLS_NETWORK},
-{"xl", "3COM 3C90x PCI ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"tlc", "Texas Instruments ThunderLAN ethernet adapter", FLG_FIXED, CLS_NETWORK},
+{"xl", "3COM 3C90x PCI FDDI adapter", FLG_FIXED, CLS_NETWORK},
{"sio", "8250/16450/16550 Serial port", 0, CLS_COMMS},
{"cx", "Cronyx/Sigma multiport sync/async adapter",0, CLS_COMMS},
@@ -2081,17 +1953,15 @@ static void
helpscreen(void)
{
int topline = 0; /* where we are in the text */
- int c, delta = 1;
+ int line, c, delta = 1;
char prompt[80];
for (;;) /* loop until user quits */
{
- int line = 0;
-
/* display help text */
if (delta)
{
- clear(); /* remove everything else */
+ clear(); /* remove everything else */
for (line = topline;
(line < (topline + 24)) && (helptext[line]);
line++)
@@ -2531,7 +2401,7 @@ visuserconfig(void)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: userconfig.c,v 1.64 1999/01/16 11:39:08 kato Exp $
+ * $Id: userconfig.c,v 1.56 1998/10/08 12:09:38 kato Exp $
*/
#include "scbus.h"
@@ -2584,7 +2454,7 @@ static int set_device_enable(CmdParm *);
static int set_device_disable(CmdParm *);
static int quitfunc(CmdParm *);
static int helpfunc(CmdParm *);
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
static int introfunc(CmdParm *);
#endif
@@ -2622,12 +2492,10 @@ static CmdParm dev_parms[] = {
{ -1, {} },
};
-#if NPNP > 0
static CmdParm string_arg[] = {
{ PARM_STRING, {} },
{ -1, {} },
};
-#endif
#if NEISA > 0
static CmdParm int_arg[] = {
@@ -2647,7 +2515,7 @@ static Cmd CmdList[] = {
{ "ex", quitfunc, NULL }, /* exit (quit) */
{ "f", set_device_flags, int_parms }, /* flags dev mask */
{ "h", helpfunc, NULL }, /* help */
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
{ "intro", introfunc, NULL }, /* intro screen */
#endif
{ "iom", set_device_mem, addr_parms }, /* iomem dev addr */
@@ -2676,6 +2544,16 @@ userconfig(void)
int rval;
Cmd *cmd;
+ printf("\nFreeBSD Kernel Configuration Utility - Version 1.1\n"
+ " Type \"help\" for help"
+#ifdef VISUAL_USERCONFIG
+ " or \"visual\" to go to the visual\n"
+ " configuration interface (requires MGA/VGA display or\n"
+ " serial terminal capable of displaying ANSI graphics)"
+#endif
+ ".\n");
+
+
while (1) {
printf("config> ");
cngets(input, 80);
@@ -2989,6 +2867,7 @@ set_num_eisa_slots(CmdParm *parms)
static int
quitfunc(CmdParm *parms)
{
+#ifdef USERCONFIG_BOOT
/*
* If kernel config supplied, and we are parsing it, and -c also supplied,
* ignore a quit command, This provides a safety mechanism to allow
@@ -2996,6 +2875,7 @@ quitfunc(CmdParm *parms)
*/
if ((boothowto & RB_CONFIG) && userconfig_boot_parsing)
return 0;
+#endif
return 1;
}
@@ -3038,7 +2918,7 @@ helpfunc(CmdParm *parms)
return 0;
}
-#if defined(INTRO_USERCONFIG)
+#if defined(USERCONFIG_BOOT)
#if defined (VISUAL_USERCONFIG)
static void
@@ -3172,10 +3052,7 @@ introfunc(CmdParm *parms)
return visuserconfig();
else {
putxy(0, 1, "Type \"help\" for help or \"quit\" to exit.");
- /* enable quitfunc */
- userconfig_boot_parsing=0;
move (0, 3);
- boothowto |= RB_CONFIG; /* force -c */
return 0;
}
break;
@@ -3204,14 +3081,12 @@ lspnp ()
"mem 0x%x 0x%x 0x%x 0x%x";
char buf[256];
if (lineno >= 23) {
- if (!userconfig_boot_parsing) {
- printf("<More> ");
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ printf("<More> ");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0 || first)
@@ -3257,13 +3132,11 @@ lsdevtab(struct isa_device *dt)
if (lineno >= 23) {
printf("<More> ");
- if (!userconfig_boot_parsing) {
- if (getchar() == 'q') {
- printf("quit\n");
- return (1);
- }
- printf("\n");
+ if (getchar() == 'q') {
+ printf("quit\n");
+ return (1);
}
+ printf("\n");
lineno = 0;
}
if (lineno == 0) {
diff --git a/sys/pc98/pc98/atcompat_diskslice.c b/sys/pc98/pc98/atcompat_diskslice.c
index ad51bc05e3f63..c25afaf36e562 100644
--- a/sys/pc98/pc98/atcompat_diskslice.c
+++ b/sys/pc98/pc98/atcompat_diskslice.c
@@ -35,7 +35,7 @@
*
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: atcompat_diskslice.c,v 1.12 1998/08/10 16:55:54 kato Exp $
+ * $Id: atcompat_diskslice.c,v 1.11 1998/07/27 09:49:22 kato Exp $
*/
/*
@@ -423,7 +423,7 @@ atcompat_extended(dname, dev, strat, lp, ssp, ext_offset, ext_size,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c
index 1225f3157d4c9..20744f80f8c0e 100644
--- a/sys/pc98/pc98/clock.c
+++ b/sys/pc98/pc98/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.64 1998/10/23 13:13:43 kato Exp $
+ * $Id: clock.c,v 1.62 1998/10/13 02:33:21 kato Exp $
*/
/*
@@ -136,7 +136,7 @@ static void setup_8254_mixed_mode __P((void));
*/
#define TIMER0_MAX_FREQ 20000
-int adjkerntz; /* local offset from GMT in seconds */
+int adjkerntz; /* local offset from GMT in seconds */
int disable_rtc_set; /* disable resettodr() if != 0 */
u_int idelayed;
int statclock_disable;
@@ -151,7 +151,7 @@ u_int stat_imask = SWI_CLOCK_MASK;
u_int timer_freq = TIMER_FREQ;
int timer0_max_count;
u_int tsc_freq;
-int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
+int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
static int beeping = 0;
static u_int clk_imask = HWI_MASK | SWI_MASK;
@@ -198,7 +198,7 @@ static unsigned i8254_get_timecount __P((struct timecounter *tc));
static unsigned tsc_get_timecount __P((struct timecounter *tc));
static void set_timer_freq(u_int freq, int intr_freq);
-static struct timecounter tsc_timecounter = {
+static struct timecounter tsc_timecounter[3] = {
tsc_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -207,9 +207,9 @@ static struct timecounter tsc_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
- &tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
+ tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
-static struct timecounter i8254_timecounter = {
+static struct timecounter i8254_timecounter[3] = {
i8254_get_timecount, /* get_timecount */
0, /* no poll_pps */
~0u, /* counter_mask */
@@ -218,7 +218,7 @@ static struct timecounter i8254_timecounter = {
};
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
- &i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
+ i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
static void
clkintr(struct clockframe frame)
@@ -952,8 +952,8 @@ startrtclock()
}
set_timer_freq(timer_freq, hz);
- i8254_timecounter.tc_frequency = timer_freq;
- init_timecounter(&i8254_timecounter);
+ i8254_timecounter[0].tc_frequency = timer_freq;
+ init_timecounter(i8254_timecounter);
#ifndef CLK_USE_TSC_CALIBRATION
if (tsc_freq != 0) {
@@ -1002,8 +1002,8 @@ startrtclock()
#endif /* NAPM > 0 */
if (tsc_present && tsc_freq != 0) {
- tsc_timecounter.tc_frequency = tsc_freq;
- init_timecounter(&tsc_timecounter);
+ tsc_timecounter[0].tc_frequency = tsc_freq;
+ init_timecounter(tsc_timecounter);
}
#endif /* !defined(SMP) */
@@ -1070,8 +1070,8 @@ rtc_inb(void)
#endif /* PC-98 */
/*
- * Initialize the time of day register, based on the time base which is, e.g.
- * from a filesystem.
+ * Initialize the time of day register, based on the time base which is, e.g.
+ * from a filesystem.
*/
void
inittodr(time_t base)
@@ -1123,17 +1123,17 @@ inittodr(time_t base)
/* sec now contains the number of seconds, since Jan 1 1970,
in the local time zone */
#else /* IBM-PC */
- /* Look if we have a RTC present and the time is valid */
+ /* Look if we have a RTC present and the time is valid */
if (!(rtcin(RTC_STATUSD) & RTCSD_PWR))
goto wrong_time;
- /* wait for time update to complete */
- /* If RTCSA_TUP is zero, we have at least 244us before next update */
+ /* wait for time update to complete */
+ /* If RTCSA_TUP is zero, we have at least 244us before next update */
while (rtcin(RTC_STATUSA) & RTCSA_TUP);
days = 0;
#ifdef USE_RTC_CENTURY
- year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
+ year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
#else
year = readrtc(RTC_YEAR) + 1900;
if (year < 1970)
@@ -1141,21 +1141,21 @@ inittodr(time_t base)
#endif
if (year < 1970)
goto wrong_time;
- month = readrtc(RTC_MONTH);
- for (m = 1; m < month; m++)
- days += daysinmonth[m-1];
- if ((month > 2) && LEAPYEAR(year))
+ month = readrtc(RTC_MONTH);
+ for (m = 1; m < month; m++)
+ days += daysinmonth[m-1];
+ if ((month > 2) && LEAPYEAR(year))
days ++;
- days += readrtc(RTC_DAY) - 1;
+ days += readrtc(RTC_DAY) - 1;
yd = days;
for (y = 1970; y < year; y++)
- days += DAYSPERYEAR + LEAPYEAR(y);
+ days += DAYSPERYEAR + LEAPYEAR(y);
sec = ((( days * 24 +
readrtc(RTC_HRS)) * 60 +
readrtc(RTC_MIN)) * 60 +
readrtc(RTC_SEC));
- /* sec now contains the number of seconds, since Jan 1 1970,
- in the local time zone */
+ /* sec now contains the number of seconds, since Jan 1 1970,
+ in the local time zone */
#endif
sec += tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -1172,12 +1172,12 @@ inittodr(time_t base)
return;
wrong_time:
- printf("Invalid time in real time clock.\n");
- printf("Check and reset the date immediately!\n");
+ printf("Invalid time in real time clock.\n");
+ printf("Check and reset the date immediately!\n");
}
/*
- * Write system time back to RTC
+ * Write system time back to RTC
*/
void
resettodr()
@@ -1236,7 +1236,7 @@ resettodr()
/* Disable RTC updates and interrupts. */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in RTC */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
@@ -1244,7 +1244,7 @@ resettodr()
writertc(RTC_MIN, bin2bcd(tm%60)); tm /= 60; /* Write back Minutes */
writertc(RTC_HRS, bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
- /* We have now the days since 01-01-1970 in tm */
+ /* We have now the days since 01-01-1970 in tm */
writertc(RTC_WDAY, (tm+4)%7); /* Write back Weekday */
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
tm >= m;
@@ -1467,7 +1467,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
if (timer0_state != RELEASED)
return (EBUSY); /* too much trouble to handle */
set_timer_freq(freq, hz);
- i8254_timecounter.tc_frequency = freq;
+ i8254_timecounter[0].tc_frequency = freq;
}
return (error);
}
@@ -1487,7 +1487,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
if (error == 0 && req->newptr != NULL) {
tsc_freq = freq;
- tsc_timecounter.tc_frequency = tsc_freq;
+ tsc_timecounter[0].tc_frequency = tsc_freq;
}
return (error);
}
diff --git a/sys/pc98/pc98/diskslice_machdep.c b/sys/pc98/pc98/diskslice_machdep.c
index 5370462dcd066..e2688ffde2f60 100644
--- a/sys/pc98/pc98/diskslice_machdep.c
+++ b/sys/pc98/pc98/diskslice_machdep.c
@@ -35,7 +35,7 @@
*
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: diskslice_machdep.c,v 1.16 1998/08/10 16:55:54 kato Exp $
+ * $Id: diskslice_machdep.c,v 1.15 1998/07/27 09:49:23 kato Exp $
*/
/*
@@ -470,7 +470,7 @@ reread_mbr:
sp->ds_size = pc98_size;
sp->ds_type = dp->dp_mid;
sp->ds_subtype = dp->dp_sid;
- strncpy(sp->ds_name, dp->dp_name, sizeof(sp->ds_name));
+ strncpy(sp->ds_name, dp->dp_name, 16);
#else
sp->ds_offset = mbr_offset + dp->dp_start;
sp->ds_size = dp->dp_size;
@@ -580,7 +580,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sname = dsname(dname, dkunit(dev), WHOLE_DISK_SLICE,
RAW_PART, partname);
- snprintf(buf, sizeof(buf), "%s", sname);
+ strcpy(buf, sname);
if (strlen(buf) < sizeof buf - 11)
strcat(buf, "<extended>");
check_part(buf, dp, base_ext_offset, nsectors,
@@ -611,7 +611,7 @@ extended(dname, dev, strat, lp, ssp, ext_offset, ext_size, base_ext_offset,
sp->ds_size = pc98_size;
sp->ds_type = dp->dp_mid;
sp->ds_subtype = dp->dp_sid;
- strncpy(sp->ds_name, dp->dp_name, sizeof(sp->ds_name));
+ strncpy(sp->ds_name, dp->dp_name, 16);
#else
sp->ds_offset = ext_offset + dp->dp_start;
sp->ds_size = dp->dp_size;
diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c
index 90f230f5e8717..889c066e6e255 100644
--- a/sys/pc98/pc98/fd.c
+++ b/sys/pc98/pc98/fd.c
@@ -5,10 +5,6 @@
* This code is derived from software contributed to Berkeley by
* Don Ahn.
*
- * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)
- * aided by the Linux floppy driver modifications from David Bateman
- * (dbateman@eng.uts.edu.au).
- *
* Copyright (c) 1993, 1994 by
* jc@irbs.UUCP (John Capo)
* vak@zebub.msk.su (Serge Vakulenko)
@@ -47,10 +43,14 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.49 1999/01/16 11:40:02 kato Exp $
+ * $Id: fd.c,v 1.40 1998/09/15 14:07:08 kato Exp $
*
*/
+#include "ft.h"
+#if NFT < 1
+#undef NFDC
+#endif
#include "fd.h"
#include "opt_devfs.h"
#include "opt_fdc.h"
@@ -84,6 +84,10 @@
#endif
#include <i386/isa/fdc.h>
#include <machine/stdarg.h>
+#if NFT > 0
+#include <sys/ftape.h>
+#include <i386/isa/ftreg.h>
+#endif
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -93,10 +97,6 @@
/* configuration flags */
#define FDC_PRETEND_D0 (1 << 0) /* pretend drive 0 to be there */
-#ifdef FDC_YE
-#define FDC_IS_PCMCIA (1 << 1) /* if successful probe, then it's
- a PCMCIA device */
-#endif
/* internally used only, not really from CMOS: */
#define RTCFDT_144M_PRETENDED 0x1000
@@ -285,9 +285,15 @@ nrd_info(addr)
* fdsu is the floppy drive unit number on that controller. (sub-unit) *
\***********************************************************************/
-#ifdef FDC_YE
-#include "card.h"
-static int yeattach(struct isa_device *);
+#if NFT > 0
+int ftopen(dev_t, int);
+int ftintr(ftu_t ftu);
+int ftclose(dev_t, int);
+void ftstrategy(struct buf *);
+int ftioctl(dev_t, unsigned long, caddr_t, int, struct proc *);
+int ftdump(dev_t);
+int ftsize(dev_t);
+int ftattach(struct isa_device *, struct isa_device *, int);
#endif
/* autoconfig functions */
@@ -310,7 +316,6 @@ static int fd_in(fdcu_t, int *);
static void fdstart(fdcu_t);
static timeout_t fd_iotimeout;
static timeout_t fd_pseudointr;
-static ointhand2_t fdintr;
static int fdstate(fdcu_t, fdc_p);
static int retrier(fdcu_t);
static int fdformat(dev_t, struct fd_formb *, struct proc *);
@@ -333,9 +338,6 @@ static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
#define MOTORWAIT 10
#define IOTIMEDOUT 11
#define RESETCOMPLETE 12
-#ifdef FDC_YE
-#define PIOREAD 13
-#endif
#ifdef FDC_DEBUG
static char const * const fdstates[] =
@@ -353,9 +355,6 @@ static char const * const fdstates[] =
"MOTORWAIT",
"IOTIMEDOUT",
"RESETCOMPLETE",
-#ifdef FDC_YE
-"PIOREAD",
-#endif
};
/* CAUTION: fd_debug causes huge amounts of logging output */
@@ -367,91 +366,6 @@ static int volatile fd_debug = 0;
#define TRACE1(arg1, arg2)
#endif /* FDC_DEBUG */
-#ifdef FDC_YE
-#if NCARD > 0
-#include <sys/select.h>
-#include <sys/module.h>
-#include <pccard/cardinfo.h>
-#include <pccard/driver.h>
-#include <pccard/slot.h>
-
-/*
- * PC-Card (PCMCIA) specific code.
- */
-static int yeinit(struct pccard_devinfo *); /* init device */
-static void yeunload(struct pccard_devinfo *); /* Disable driver */
-static int yeintr(struct pccard_devinfo *); /* Interrupt handler */
-
-PCCARD_MODULE(fdc, yeinit, yeunload, yeintr, 0, bio_imask);
-
-/*
- * this is the secret PIO data port (offset from base)
- */
-#define FDC_YE_DATAPORT 6
-
-/*
- * Initialize the device - called from Slot manager.
- */
-static int yeinit(struct pccard_devinfo *devi)
-{
- fdc_p fdc = &fdc_data[devi->isahd.id_unit];
-
- /* validate unit number. */
- if (devi->isahd.id_unit >= NFDC)
- return(ENODEV);
- fdc->baseport = devi->isahd.id_iobase;
- /*
- * reset controller
- */
- outb(fdc->baseport+FDOUT, 0);
- DELAY(100);
- outb(fdc->baseport+FDOUT, FDO_FRST);
-
- /*
- * wire into system
- */
- if (yeattach(&devi->isahd) == 0)
- return(ENXIO);
-
- return(0);
-}
-
-/*
- * yeunload - unload the driver and clear the table.
- * XXX TODO:
- * This is usually called when the card is ejected, but
- * can be caused by a modunload of a controller driver.
- * The idea is to reset the driver's view of the device
- * and ensure that any driver entry points such as
- * read and write do not hang.
- */
-static void yeunload(struct pccard_devinfo *devi)
-{
- if (fd_data[devi->isahd.id_unit].type == NO_TYPE)
- return;
-
- /*
- * this prevents Fdopen() and fdstrategy() from attempting
- * to access unloaded controller
- */
- fd_data[devi->isahd.id_unit].type = NO_TYPE;
-
- printf("fdc%d: unload\n", devi->isahd.id_unit);
-}
-
-/*
- * yeintr - Shared interrupt called from
- * front end of PC-Card handler.
- */
-static int yeintr(struct pccard_devinfo *devi)
-{
- fdintr((fdcu_t)devi->isahd.id_unit);
- return(1);
-}
-#endif /* NCARD > 0 */
-#endif /* FDC_YE */
-
-
/* autoconfig structure */
struct isa_driver fdcdriver = {
@@ -490,7 +404,7 @@ fdc_err(fdcu_t fdcu, const char *s)
printf("fdc%d: %s", fdcu, s);
else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX)
printf("fdc%d: too many errors, not logging any more\n",
- fdcu);
+ fdcu);
}
return FD_FAILED;
@@ -520,7 +434,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (out_fdc(fdcu, va_arg(ap, int)) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %x failed at out byte %d of %d\n",
cmd, n + 1, n_out);
return fdc_err(fdcu, msg);
@@ -533,7 +447,7 @@ fd_cmd(fdcu_t fdcu, int n_out, ...)
if (fd_in(fdcu, ptr) < 0)
{
char msg[50];
- snprintf(msg, sizeof(msg),
+ sprintf(msg,
"cmd %02x failed at in byte %d of %d\n",
cmd, n + 1, n_in);
return fdc_err(fdcu, msg);
@@ -783,14 +697,6 @@ fdprobe(struct isa_device *dev)
{
return(0);
}
-#ifdef FDC_YE
- /*
- * don't succeed on probe; wait
- * for PCCARD subsystem to do it
- */
- if (dev->id_flags & FDC_IS_PCMCIA)
- return(0);
-#endif
return (IO_FDCSIZE);
}
@@ -806,6 +712,9 @@ fdattach(struct isa_device *dev)
fdc_p fdc = fdc_data + fdcu;
fd_p fd;
int fdsu, st0, st3, i;
+#if NFT > 0
+ int unithasfd;
+#endif
struct isa_device *fdup;
int ic_type = 0;
#ifdef DEVFS
@@ -814,7 +723,6 @@ fdattach(struct isa_device *dev)
int typesize;
#endif
- dev->id_ointr = fdintr;
fdc->fdcu = fdcu;
fdc->flags |= FDC_ATTACHED;
#ifdef PC98
@@ -845,7 +753,7 @@ fdattach(struct isa_device *dev)
continue;
fdu = fdup->id_unit;
fd = &fd_data[fdu];
- if (fdu >= (NFD))
+ if (fdu >= (NFD+NFT))
continue;
fdsu = fdup->id_physid;
/* look up what bios thinks we have */
@@ -901,11 +809,29 @@ fdattach(struct isa_device *dev)
#else
if ((fdt == RTCFDT_NONE)
#endif
+#if NFT > 0
+ || (fdsu >= DRVS_PER_CTLR)) {
+#else
) {
#ifdef PC98
fd->fdc = fdc;
#endif
fd->type = NO_TYPE;
+#endif
+#if NFT > 0
+ /* If BIOS says no floppy, or > 2nd device */
+ /* Probe for and attach a floppy tape. */
+ /* Tell FT if there was already a disk */
+ /* with this unit number found. */
+
+ unithasfd = 0;
+ if (fdu < NFD && fd->type != NO_TYPE)
+ unithasfd = 1;
+ if (ftattach(dev, fdup, unithasfd))
+ continue;
+ if (fdsu < DRVS_PER_CTLR)
+ fd->type = NO_TYPE;
+#endif
continue;
}
@@ -952,7 +878,7 @@ fdattach(struct isa_device *dev)
enable_fifo(fdc) == 0) {
printf("fdc%d: FIFO enabled", fdcu);
printf(", %d bytes threshold\n",
- fifo_threshold);
+ fifo_threshold);
}
}
if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
@@ -1141,10 +1067,10 @@ fdattach(struct isa_device *dev)
}
for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
+ fd->bdevs[1 + NUMDENS + i] = devfs_link(fd->bdevs[0],
"fd%d%c", fdu, 'a' + i);
fd->cdevs[1 + NUMDENS + i] =
- devfs_makelink(fd->cdevs[0],
+ devfs_link(fd->cdevs[0],
"rfd%d%c", fdu, 'a' + i);
}
#endif /* DEVFS */
@@ -1163,138 +1089,6 @@ fdattach(struct isa_device *dev)
-#ifdef FDC_YE
-/*
- * this is a subset of fdattach() optimized for the Y-E Data
- * PCMCIA floppy drive.
- */
-static int yeattach(struct isa_device *dev)
-{
- fdcu_t fdcu = dev->id_unit;
- fdc_p fdc = fdc_data + fdcu;
- fdsu_t fdsu = 0; /* assume 1 drive per YE controller */
- fdu_t fdu;
- fd_p fd;
- int st0, st3, i;
-#ifdef DEVFS
- int mynor;
- int typemynor;
- int typesize;
-#endif
- fdc->fdcu = fdcu;
- /*
- * the FDC_PCMCIA flag is used to to indicate special PIO is used
- * instead of DMA
- */
- fdc->flags = FDC_ATTACHED|FDC_PCMCIA;
- fdc->state = DEVIDLE;
- /* reset controller, turn motor off, clear fdout mirror reg */
- outb(fdc->baseport + FDOUT, ((fdc->fdout = 0)));
- bufq_init(&fdc->head);
- /*
- * assume 2 drives/ "normal" controller
- */
- fdu = fdcu * 2;
- if (fdu >= NFD) {
- printf("fdu %d >= NFD\n",fdu);
- return(0);
- };
- fd = &fd_data[fdu];
-
- set_motor(fdcu, fdsu, TURNON);
- DELAY(1000000); /* 1 sec */
- fdc->fdct = FDC_NE765;
-
- if ((fd_cmd(fdcu, 2, NE7CMD_SENSED, fdsu, 1, &st3) == 0) &&
- (st3 & NE7_ST3_T0)) {
- /* if at track 0, first seek inwards */
- /* seek some steps: */
- (void)fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0);
- DELAY(300000); /* ...wait a moment... */
- (void)fd_sense_int(fdc, 0, 0); /* make ctrlr happy */
- }
-
- /* If we're at track 0 first seek inwards. */
- if ((fd_sense_drive_status(fdc, &st3) == 0) && (st3 & NE7_ST3_T0)) {
- /* Seek some steps... */
- if (fd_cmd(fdcu, 3, NE7CMD_SEEK, fdsu, 10, 0) == 0) {
- /* ...wait a moment... */
- DELAY(300000);
- /* make ctrlr happy: */
- (void)fd_sense_int(fdc, 0, 0);
- }
- }
-
- for(i = 0; i < 2; i++) {
- /*
- * we must recalibrate twice, just in case the
- * heads have been beyond cylinder 76, since most
- * FDCs still barf when attempting to recalibrate
- * more than 77 steps
- */
- /* go back to 0: */
- if (fd_cmd(fdcu, 2, NE7CMD_RECAL, fdsu, 0) == 0) {
- /* a second being enough for full stroke seek*/
- DELAY(i == 0? 1000000: 300000);
-
- /* anything responding? */
- if (fd_sense_int(fdc, &st0, 0) == 0 &&
- (st0 & NE7_ST0_EC) == 0)
- break; /* already probed succesfully */
- }
- }
-
- set_motor(fdcu, fdsu, TURNOFF);
-
- if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */
- return(0);
-
- fd->track = FD_NO_TRACK;
- fd->fdc = fdc;
- fd->fdsu = fdsu;
- fd->options = 0;
- printf("fdc%d: 1.44MB 3.5in PCMCIA\n", fdcu);
- fd->type = FD_1440;
-
-#ifdef DEVFS
- mynor = fdcu << 6;
- fd->bdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_BLK,
- UID_ROOT, GID_OPERATOR, 0640,
- "fd%d", fdu);
- fd->cdevs[0] = devfs_add_devswf(&fd_cdevsw, mynor, DV_CHR,
- UID_ROOT, GID_OPERATOR, 0640,
- "rfd%d", fdu);
- /*
- * XXX this and the lookup in Fdopen() should be
- * data driven.
- */
- typemynor = mynor | FD_1440;
- typesize = fd_types[FD_1440 - 1].size / 2;
- /*
- * XXX all these conversions give bloated code and
- * confusing names.
- */
- if (typesize == 1476)
- typesize = 1480;
- if (typesize == 1722)
- typesize = 1720;
- fd->bdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_BLK, UID_ROOT, GID_OPERATOR,
- 0640, "fd%d.%d", fdu, typesize);
- fd->cdevs[FD_1440] = devfs_add_devswf(&fd_cdevsw, typemynor,
- DV_CHR, UID_ROOT, GID_OPERATOR,
- 0640,"rfd%d.%d", fdu, typesize);
- for (i = 0; i < MAXPARTITIONS; i++) {
- fd->bdevs[1 + NUMDENS + i] = devfs_makelink(fd->bdevs[0],
- "fd%d%c", fdu, 'a' + i);
- fd->cdevs[1 + NUMDENS + i] = devfs_makelink(fd->cdevs[0],
- "rfd%d%c", fdu, 'a' + i);
- }
-#endif /* DEVFS */
- return (1);
-}
-#endif
-
/****************************************************************************/
/* motor control stuff */
/* remember to not deselect the drive we're working on */
@@ -1532,6 +1326,11 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p)
int type = FDTYPE(minor(dev));
fdc_p fdc;
+#if NFT > 0
+ /* check for a tape open */
+ if (type & F_TAPE_TYPE)
+ return(ftopen(dev, flags));
+#endif
/* check bounds */
if (fdu >= NFD)
return(ENXIO);
@@ -1611,6 +1410,12 @@ fdclose(dev_t dev, int flags, int mode, struct proc *p)
{
fdu_t fdu = FDUNIT(minor(dev));
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ if (type & F_TAPE_TYPE)
+ return ftclose(dev, flags);
+#endif
fd_data[fdu].flags &= ~FD_OPEN;
fd_data[fdu].options &= ~FDOPT_NORETRY;
@@ -1648,18 +1453,21 @@ fdstrategy(struct buf *bp)
fd = &fd_data[fdu];
fdc = fd->fdc;
fdcu = fdc->fdcu;
-#ifdef FDC_YE
- if (fd->type == NO_TYPE) {
- bp->b_error = ENXIO;
+
+#if NFT > 0
+ if (FDTYPE(minor(bp->b_dev)) & F_TAPE_TYPE) {
+ /* ft tapes do not (yet) support strategy i/o */
+ bp->b_error = ENODEV;
bp->b_flags |= B_ERROR;
- /*
- * I _refuse_ to use a goto
- */
- biodone(bp);
- return;
- };
+ goto bad;
+ }
+ /* check for controller already busy with tape */
+ if (fdc->flags & FDC_TAPE_BUSY) {
+ bp->b_error = EBUSY;
+ bp->b_flags |= B_ERROR;
+ goto bad;
+ }
#endif
-
fdblk = 128 << (fd->ft->secsize);
if (!(bp->b_flags & B_FORMAT)) {
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
@@ -1797,46 +1605,21 @@ fd_pseudointr(void *arg1)
* keep calling the state machine until it returns a 0 *
* ALWAYS called at SPLBIO *
\***********************************************************************/
-static void
+void
fdintr(fdcu_t fdcu)
{
fdc_p fdc = fdc_data + fdcu;
+#if NFT > 0
+ fdu_t fdu = fdc->fdu;
+
+ if (fdc->flags & FDC_TAPE_BUSY)
+ (ftintr(fdu));
+ else
+#endif
while(fdstate(fdcu, fdc))
;
}
-#ifdef FDC_YE
-/*
- * magic pseudo-DMA initialization for YE FDC. Sets count and
- * direction
- */
-#define SET_BCDR(wr,cnt,port) outb(port,(((cnt)-1) & 0xff)); \
- outb(port+1,((wr ? 0x80 : 0) | ((((cnt)-1) >> 8) & 0x7f)))
-
-/*
- * fdcpio(): perform programmed IO read/write for YE PCMCIA floppy
- */
-static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
-{
- u_char *cptr = (u_char *)addr;
- fdc_p fdc = &fdc_data[fdcu];
- int io = fdc->baseport;
-
- if (flags & B_READ) {
- if (fdc->state != PIOREAD) {
- fdc->state = PIOREAD;
- return(0);
- };
- SET_BCDR(0,count,io);
- insb(io+FDC_YE_DATAPORT,cptr,count);
- } else {
- outsb(io+FDC_YE_DATAPORT,cptr,count);
- SET_BCDR(0,count,io);
- };
- return(1);
-}
-#endif /* FDC_YE */
-
/***********************************************************************\
* The controller state machine. *
* if it returns a non zero value, it should be called again immediatly *
@@ -1844,6 +1627,7 @@ static int fdcpio(fdcu_t fdcu, long flags, caddr_t addr, u_int count)
static int
fdstate(fdcu_t fdcu, fdc_p fdc)
{
+ struct subdev *sd;
int read, format, head, i, sec = 0, sectrac, st0, cyl, st3;
unsigned blknum = 0, b_cylinder = 0;
fdu_t fdu = fdc->fdu;
@@ -1852,15 +1636,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
struct fd_formb *finfo = NULL;
size_t fdblk;
- bp = fdc->bp;
- if (bp == NULL) {
- bp = bufq_first(&fdc->head);
- if (bp != NULL) {
- bufq_remove(&fdc->head, bp);
- fdc->bp = bp;
- }
- }
- if (bp == NULL) {
+ bp = bufq_first(&fdc->head);
+ if(!bp) {
/***********************************************\
* nothing left for this controller to do *
* Force into the IDLE state, *
@@ -2083,11 +1860,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
#ifdef EPSON_NRDISK
if (fdu != nrdu) {
#endif /* EPSON_NRDISK */
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmastart(bp->b_flags, bp->b_data+fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
sectrac = fd->ft->sectrac;
sec = blknum % (sectrac * fd->ft->heads);
head = sec / sectrac;
@@ -2128,12 +1902,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
if(format)
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- bp->b_bcount);
-#endif
/* formatting */
if(fd_cmd(fdcu, 6,
NE7CMD_FORMAT,
@@ -2154,24 +1922,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
}
else
{
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA) {
- /*
- * this seems to be necessary even when
- * reading data
- */
- SET_BCDR(1,fdblk,fdc->baseport);
-
- /*
- * perform the write pseudo-DMA before
- * the WRITE command is sent
- */
- if (!read)
- (void)fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,
- fdblk);
- }
-#endif
if (fd_cmd(fdcu, 9,
(read ? NE7CMD_READ : NE7CMD_WRITE),
head << 2 | fdu, /* head & unit */
@@ -2192,24 +1942,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
return(retrier(fdcu));
}
}
-#ifdef FDC_YE
- if (fdc->flags & FDC_PCMCIA)
- /*
- * if this is a read, then simply await interrupt
- * before performing PIO
- */
- if (read && !fdcpio(fdcu,bp->b_flags,
- bp->b_data+fd->skip,fdblk)) {
- fd->tohandle = timeout(fd_iotimeout,
- (caddr_t)fdcu, hz);
- return(0); /* will return later */
- };
-
- /*
- * write (or format) operation will fall through and
- * await completion interrupt
- */
-#endif
fdc->state = IOCOMPLETE;
fd->tohandle = timeout(fd_iotimeout, (caddr_t)fdcu, hz);
return(0); /* will return later */
@@ -2243,16 +1975,6 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
fdc->state = IOCOMPLETE;
}
#endif
-#ifdef FDC_YE
- case PIOREAD:
- /*
- * actually perform the PIO read. The IOCOMPLETE case
- * removes the timeout for us.
- */
- (void)fdcpio(fdcu,bp->b_flags,bp->b_data+fd->skip,fdblk);
- fdc->state = IOCOMPLETE;
- /* FALLTHROUGH */
-#endif
case IOCOMPLETE: /* IO DONE, post-analyze */
#ifdef EPSON_NRDISK
if (fdu != nrdu)
@@ -2279,11 +2001,8 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
#ifdef EPSON_NRDISK
if (fdu != nrdu) {
#endif /* EPSON_NRDISK */
-#ifdef FDC_YE
- if (!(fdc->flags & FDC_PCMCIA))
-#endif
- isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
- format ? bp->b_bcount : fdblk, fdc->dmachan);
+ isa_dmadone(bp->b_flags, bp->b_data + fd->skip,
+ format ? bp->b_bcount : fdblk, fdc->dmachan);
#ifdef EPSON_NRDISK
}
else nrd_LED_off();
@@ -2322,7 +2041,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
{
/* ALL DONE */
fd->skip = 0;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fd->device_stats,
bp->b_bcount - bp->b_resid,
@@ -2451,10 +2170,12 @@ static int
retrier(fdcu)
fdcu_t fdcu;
{
+ struct subdev *sd;
fdc_p fdc = fdc_data + fdcu;
register struct buf *bp;
+ int fdu;
- bp = fdc->bp;
+ bp = bufq_first(&fdc->head);
if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY)
goto fail;
@@ -2498,7 +2219,7 @@ retrier(fdcu)
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
bp->b_resid += bp->b_bcount - fdc->fd->skip;
- fdc->bp = NULL;
+ bufq_remove(&fdc->head, bp);
/* Tell devstat we have finished with the transaction */
devstat_end_transaction(&fdc->fd->device_stats,
@@ -2607,6 +2328,14 @@ fdioctl(dev, cmd, addr, flag, p)
char buffer[DEV_BSIZE];
int error = 0;
+#if NFT > 0
+ int type = FDTYPE(minor(dev));
+
+ /* check for a tape ioctl */
+ if (type & F_TAPE_TYPE)
+ return ftioctl(dev, cmd, addr, flag, p);
+#endif
+
fdblk = 128 << fd->ft->secsize;
#ifdef PC98
diff --git a/sys/pc98/pc98/if_ed.c b/sys/pc98/pc98/if_ed.c
index b34898e3e80e1..9b7f815e1d28f 100644
--- a/sys/pc98/pc98/if_ed.c
+++ b/sys/pc98/pc98/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.57 1998/12/31 03:23:39 kato Exp $
+ * $Id: if_ed.c,v 1.53 1998/10/08 17:04:58 kato Exp $
*/
/*
@@ -49,7 +49,6 @@
* MELCO LPC-TJ, LPC-TS, LGY-98, LGH-98, IND-SP, IND-SS, EGY-98
* PLANET SMART COM CREDITCARD/2000 PCMCIA, EN-2298
* Contec C-NET(98), C-NET(98)E, C-NET(98)L, C-NET(98)E-A, C-NET(98)L-A
- * SMC EtherEZ98
*
* Modified for FreeBSD(98) 2.2 by KATO T. of Nagoya University.
*
@@ -180,7 +179,6 @@ static int ed_attach __P((struct ed_softc *, int, int));
static int ed_attach_isa __P((struct isa_device *));
static void ed_init __P((void *));
-static ointhand2_t edintr;
static int ed_ioctl __P((struct ifnet *, u_long, caddr_t));
static int ed_probe __P((struct isa_device *));
static void ed_start __P((struct ifnet *));
@@ -241,7 +239,6 @@ static u_long ds_crc __P((u_char *ep));
#endif
#if NCARD > 0
#include <sys/select.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
@@ -252,7 +249,17 @@ static int edinit __P((struct pccard_devinfo *));
static void edunload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(ed, edinit, edunload, card_intr, 0, net_imask);
+static struct pccard_device ed_info = {
+ "ed",
+ edinit,
+ edunload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, ed_info);
/*
* Initialize the device - called from Slot manager.
@@ -349,16 +356,6 @@ static unsigned short ed_intr_mask[] = {
* Interrupt conversion table for 83C790
*/
static unsigned short ed_790_intr_mask[] = {
-#ifdef PC98
- 0,
- IRQ3,
- IRQ5,
- IRQ6,
- 0,
- IRQ9,
- IRQ12,
- IRQ13
-#else
0,
IRQ9,
IRQ3,
@@ -367,7 +364,6 @@ static unsigned short ed_790_intr_mask[] = {
IRQ10,
IRQ11,
IRQ15
-#endif
};
/*
@@ -2485,7 +2481,6 @@ ed_attach_isa(isa_dev)
struct ed_softc *sc = &ed_softc[unit];
int flags = isa_dev->id_flags;
- isa_dev->id_ointr = edintr;
return ed_attach(sc, unit, flags);
}
@@ -3322,7 +3317,7 @@ edintr_sc(sc)
}
}
-static void
+void
edintr(unit)
int unit;
{
@@ -4283,7 +4278,7 @@ edpnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = edintr;
+ dev->id_intr = edintr;
dev->id_drq = -1;
if (dev->id_driver == NULL) {
diff --git a/sys/pc98/pc98/if_ed98.h b/sys/pc98/pc98/if_ed98.h
index 19d07d08dd07d..6320064372731 100644
--- a/sys/pc98/pc98/if_ed98.h
+++ b/sys/pc98/pc98/if_ed98.h
@@ -26,7 +26,7 @@
*/
/*
- * PC-9801 specific definitions for DP8390/SMC8216 NICs.
+ * PC-9801 specific definitions for National Semiconductor DP8390 NIC.
*/
#ifndef __PC98_PC98_IF_ED98_H__
#define __PC98_PC98_IF_ED98_H__
@@ -47,22 +47,30 @@ static int pc98_set_register_unit __P((struct ed_softc *sc, int type, int iobase
/*
* Register offsets/total
*/
+#ifdef ED_NOVELL_NIC_OFFSET
#undef ED_NOVELL_NIC_OFFSET
+#endif
#define ED_NOVELL_NIC_OFFSET sc->edreg.nic_offset
+#ifdef ED_NOVELL_ASIC_OFFSET
#undef ED_NOVELL_ASIC_OFFSET
+#endif
#define ED_NOVELL_ASIC_OFFSET sc->edreg.asic_offset
/*
* Remote DMA data register; for reading or writing to the NIC mem
* via programmed I/O (offset from ASIC base).
*/
+#ifdef ED_NOVELL_DATA
#undef ED_NOVELL_DATA
+#endif
#define ED_NOVELL_DATA sc->edreg.data
/*
* Reset register; reading from this register causes a board reset.
*/
+#ifdef ED_NOVELL_RESET
#undef ED_NOVELL_RESET
+#endif
#define ED_NOVELL_RESET sc->edreg.reset
/*
@@ -82,20 +90,20 @@ static int pc98_set_register_unit __P((struct ed_softc *sc, int type, int iobase
* 0xa0 Contec C-NET(98).
* 0xb0 Contec C-NET(98)E/L.
*/
-#define ED_TYPE98_BASE 0x80
-
-#define ED_TYPE98_GENERIC 0x80
-#define ED_TYPE98_LPC 0x81
-#define ED_TYPE98_BDN 0x82
-#define ED_TYPE98_EGY 0x83
-#define ED_TYPE98_LGY 0x84
-#define ED_TYPE98_ICM 0x85
-#define ED_TYPE98_SIC 0x86
-#define ED_TYPE98_108 0x88
-#define ED_TYPE98_LA98 0x89
-#define ED_TYPE98_CNET98 0x8a
-#define ED_TYPE98_CNET98EL 0x8b
-#define ED_TYPE98_UE2212 0x8c
+#define ED_TYPE98_BASE 0x10
+
+#define ED_TYPE98_GENERIC 0x10
+#define ED_TYPE98_LPC 0x11
+#define ED_TYPE98_BDN 0x12
+#define ED_TYPE98_EGY 0x13
+#define ED_TYPE98_LGY 0x14
+#define ED_TYPE98_ICM 0x15
+#define ED_TYPE98_SIC 0x16
+#define ED_TYPE98_108 0x18
+#define ED_TYPE98_LA98 0x19
+#define ED_TYPE98_CNET98 0x1a
+#define ED_TYPE98_CNET98EL 0x1b
+#define ED_TYPE98_UE2212 0x1c
#define ED_TYPE98(x) (((x & 0xffff0000) >> 20) | ED_TYPE98_BASE)
#define ED_TYPE98SUB(x) ((x & 0xf0000) >> 16)
@@ -247,10 +255,14 @@ static int pc98_set_register_unit __P((struct ed_softc *sc, int type, int iobase
#define ED_P2_IMR sc->edreg.port[0x0f]
/* PCCARD */
+#ifdef ED_PC_MISC
#undef ED_PC_MISC
+#endif
#define ED_PC_MISC sc->edreg.pc_misc
+#ifdef ED_PC_RESET
#undef ED_PC_RESET
-#define ED_PC_RESET sc->edreg.pc_reset
+#endif
+#define ED_PC_RESET sc->edreg.pc_reset
/* LPC-T support */
#define LPCT_1d0_ON() \
@@ -385,9 +397,6 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
int nports;
sc->type = type;
- ED_PC_MISC = 0x18; /* dummy for NON-PCCard */
- ED_PC_RESET = 0x1f; /* same above */
-
switch (type) {
case ED_TYPE98_GENERIC:
sc->edreg.port = edp_generic;
@@ -395,6 +404,8 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
ED_NOVELL_ASIC_OFFSET = 0x0010;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x000f;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 32;
break;
@@ -404,24 +415,30 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
ED_NOVELL_ASIC_OFFSET = 0x0200;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x0100;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_EGY:
sc->edreg.port = edp_egy98;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0200;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x0100;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_ICM:
sc->edreg.port = edp_generic;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0100;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0x000f;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
@@ -429,8 +446,10 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
sc->edreg.port = edp_la98;
ED_NOVELL_NIC_OFFSET = 0x0000;
ED_NOVELL_ASIC_OFFSET = 0x0100;
- ED_NOVELL_DATA = 0x0000;
+ ED_NOVELL_DATA = 0;
ED_NOVELL_RESET = 0xc100;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 1;
break;
@@ -438,8 +457,10 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
sc->edreg.port = edp_sic98;
ED_NOVELL_NIC_OFFSET = 0x0000;
ED_NOVELL_ASIC_OFFSET = 0x2000;
- ED_NOVELL_DATA = 0; /* dummy */
- ED_NOVELL_RESET = 0; /* dummy */
+ ED_NOVELL_DATA = 0x00; /* dummy */
+ ED_NOVELL_RESET = 0x00;
+ ED_PC_MISC = 0x18; /* dummy */
+ ED_PC_RESET = 0x1f; /* dummy */
nports = 1;
break;
@@ -457,58 +478,47 @@ pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
case ED_TYPE98_108:
sc->edreg.port = edp_nec108;
adj = (iobase & 0xf000) / 2;
- ED_NOVELL_NIC_OFFSET = 0x0000;
- ED_NOVELL_ASIC_OFFSET = (0x0888 | adj) - iobase;
- ED_NOVELL_DATA = 0x0000;
- ED_NOVELL_RESET = 0x0002;
+ ED_NOVELL_NIC_OFFSET = 0;
+ ED_NOVELL_ASIC_OFFSET = (0x888 | adj) - iobase;
+ ED_NOVELL_DATA = 0;
+ ED_NOVELL_RESET = 2;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_LA98:
sc->edreg.port = edp_la98;
- ED_NOVELL_NIC_OFFSET = 0x0000;
- ED_NOVELL_ASIC_OFFSET = 0x0100;
+ ED_NOVELL_NIC_OFFSET = 0;
+ ED_NOVELL_ASIC_OFFSET = 0x100;
ED_NOVELL_DATA = 0x0000;
ED_NOVELL_RESET = 0xf000;
+ ED_PC_MISC = 0x18;
+ ED_PC_RESET = 0x1f;
nports = 1;
break;
case ED_TYPE98_CNET98EL:
sc->edreg.port = edp_generic;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0400;
ED_NOVELL_DATA = 0x000e;
- ED_NOVELL_RESET = 0; /* dummy */
+ ED_NOVELL_RESET = 0x0000; /* dummy */
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
case ED_TYPE98_CNET98:
sc->edreg.port = edp_cnet98;
- ED_NOVELL_NIC_OFFSET = 0x0000;
+ ED_NOVELL_NIC_OFFSET = 0;
ED_NOVELL_ASIC_OFFSET = 0x0400;
- ED_NOVELL_DATA = 0; /* dummy */
- ED_NOVELL_RESET = 0; /* dummy */
+ ED_NOVELL_DATA = 0x0000;
+ ED_NOVELL_RESET = 0x0000; /* dummy */
+ ED_PC_RESET = 0x1f;
nports = 16;
break;
}
return nports;
}
-/*
- * SMC EtherEZ98(SMC8498BTA)
- *
- * A sample of kernel conf is as follows.
- * #device ed0 at isa? port 0x10d0 net irq 6 iomem 0xc8000 vector edintr
- */
-#undef ED_WD_NIC_OFFSET
-#define ED_WD_NIC_OFFSET 0x100 /* I/O base offset to NIC */
-#undef ED_WD_ASIC_OFFSET
-#define ED_WD_ASIC_OFFSET 0 /* I/O base offset to ASIC */
-/*
- * XXX - The I/O address range is fragmented in the EtherEZ98;
- * it occupies 16*2 I/O addresses, by the way.
- */
-#undef ED_WD_IO_PORTS
-#define ED_WD_IO_PORTS 16 /* # of i/o addresses used */
-
#endif /* __PC98_PC98_IF_ED98_H__ */
diff --git a/sys/pc98/pc98/if_fe.c b/sys/pc98/pc98/if_fe.c
new file mode 100644
index 0000000000000..64b3091572cb9
--- /dev/null
+++ b/sys/pc98/pc98/if_fe.c
@@ -0,0 +1,3824 @@
+/*
+ * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
+ *
+ * This software may be used, modified, copied, distributed, and sold, in
+ * both source and binary form provided that the above copyright, these
+ * terms and the following disclaimer are retained. The name of the author
+ * and/or the contributor may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND THE CONTRIBUTOR ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE CONTRIBUTOR BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION.
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * $Id: if_fe.c,v 1.33 1998/10/08 17:06:32 kato Exp $
+ *
+ * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
+ * To be used with FreeBSD 2.x
+ * Contributed by M. Sekiguchi. <seki@sysrap.cs.fujitsu.co.jp>
+ *
+ * This version is intended to be a generic template for various
+ * MB86960A/MB86965A based Ethernet cards. It currently supports
+ * Fujitsu FMV-180 series for ISA and Allied-Telesis AT1700/RE2000
+ * series for ISA, as well as Fujitsu MBH10302 PC card.
+ * There are some currently-
+ * unused hooks embedded, which are primarily intended to support
+ * other types of Ethernet cards, but the author is not sure whether
+ * they are useful.
+ *
+ * This version also includes some alignments for
+ * RE1000/RE1000+/ME1500 support. It is incomplete, however, since the
+ * cards are not for AT-compatibles. (They are for PC98 bus -- a
+ * proprietary bus architecture available only in Japan.) Further
+ * work for PC98 version will be available as a part of FreeBSD(98)
+ * project.
+ *
+ * This software is a derivative work of if_ed.c version 1.56 by David
+ * Greenman available as a part of FreeBSD 2.0 RELEASE source distribution.
+ *
+ * The following lines are retained from the original if_ed.c:
+ *
+ * Copyright (C) 1993, David Greenman. This software may be used, modified,
+ * copied, distributed, and sold, in both source and binary form provided
+ * that the above copyright and these terms are retained. Under no
+ * circumstances is the author responsible for the proper functioning
+ * of this software, nor does the author assume any responsibility
+ * for damages incurred with its use.
+ */
+
+/*
+ * Modified for Allied-Telesis RE1000 series.
+ */
+
+
+/*
+ * TODO:
+ * o To support MBH10304 PC card. It is another MB8696x based
+ * PCMCIA Ethernet card by Fujitsu, which is not compatible with
+ * MBH10302.
+ * o To merge FreeBSD(98) efforts into a single source file.
+ * o To support ISA PnP auto configuration for FMV-183/184.
+ * o To reconsider mbuf usage.
+ * o To reconsider transmission buffer usage, including
+ * transmission buffer size (currently 4KB x 2) and pros-and-
+ * cons of multiple frame transmission.
+ * o To test IPX codes.
+ */
+
+#include "fe.h"
+#include "bpfilter.h"
+#include "opt_inet.h"
+#include "opt_ipx.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sockio.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/syslog.h>
+
+#include <net/if.h>
+#include <net/if_dl.h>
+
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
+/* IPX code is not tested. FIXME. */
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
+/* To be used with IPv6 package of INRIA. */
+#ifdef INET6
+/* IPv6 added by shin 96.2.6 */
+#include <netinet/if_ether6.h>
+#endif
+
+/* XNS code is not tested. FIXME. */
+#ifdef NS
+#include <netns/ns.h>
+#include <netns/ns_if.h>
+#endif
+
+#if NBPFILTER > 0
+#include <net/bpf.h>
+#endif
+
+#include <machine/clock.h>
+
+#include <i386/isa/isa_device.h>
+#include <i386/isa/icu.h>
+
+/* PCCARD suport */
+#include "card.h"
+#if NCARD > 0
+#include <sys/kernel.h>
+#include <sys/select.h>
+#include <pccard/cardinfo.h>
+#include <pccard/slot.h>
+#endif
+
+#include <i386/isa/ic/mb86960.h>
+#include <i386/isa/if_fereg.h>
+
+/*
+ * This version of fe is an ISA device driver.
+ * Override the following macro to adapt it to another bus.
+ * (E.g., PC98.)
+ */
+#define DEVICE struct isa_device
+
+/*
+ * Default settings for fe driver specific options.
+ * They can be set in config file by "options" statements.
+ */
+
+/*
+ * Debug control.
+ * 0: No debug at all. All debug specific codes are stripped off.
+ * 1: Silent. No debug messages are logged except emergent ones.
+ * 2: Brief. Lair events and/or important information are logged.
+ * 3: Detailed. Logs all information which *may* be useful for debugging.
+ * 4: Trace. All actions in the driver is logged. Super verbose.
+ */
+#ifndef FE_DEBUG
+#define FE_DEBUG 1
+#endif
+
+/*
+ * Transmit just one packet per a "send" command to 86960.
+ * This option is intended for performance test. An EXPERIMENTAL option.
+ */
+#ifndef FE_SINGLE_TRANSMISSION
+#define FE_SINGLE_TRANSMISSION 0
+#endif
+
+/*
+ * Device configuration flags.
+ */
+
+/* DLCR6 settings. */
+#define FE_FLAGS_DLCR6_VALUE 0x007F
+
+/* Force DLCR6 override. */
+#define FE_FLAGS_OVERRIDE_DLCR6 0x0080
+
+/* Shouldn't these be defined somewhere else such as isa_device.h? */
+#define NO_IOADDR (-1)
+#define NO_IRQ 0
+
+/*
+ * Data type for a multicast address filter on 8696x.
+ */
+struct fe_filter { u_char data [ FE_FILTER_LEN ]; };
+
+/*
+ * Special filter values.
+ */
+static struct fe_filter const fe_filter_nothing = { FE_FILTER_NOTHING };
+static struct fe_filter const fe_filter_all = { FE_FILTER_ALL };
+
+/* How many registers does an fe-supported adapter have at maximum? */
+#define MAXREGISTERS 32
+
+/*
+ * fe_softc: per line info and status
+ */
+static struct fe_softc {
+
+ /* Used by "common" codes. */
+ struct arpcom arpcom; /* Ethernet common */
+
+ /* Used by config codes. */
+
+ /* Set by probe() and not modified in later phases. */
+ char * typestr; /* printable name of the interface. */
+ u_short iobase; /* base I/O address of the adapter. */
+ u_short ioaddr [ MAXREGISTERS ]; /* I/O addresses of register. */
+ u_short txb_size; /* size of TX buffer, in bytes */
+ u_char proto_dlcr4; /* DLCR4 prototype. */
+ u_char proto_dlcr5; /* DLCR5 prototype. */
+ u_char proto_dlcr6; /* DLCR6 prototype. */
+ u_char proto_dlcr7; /* DLCR7 prototype. */
+ u_char proto_bmpr13; /* BMPR13 prototype. */
+ u_char proto_bmpr14; /* BMPR14 prototype. */
+
+ /* Vendor specific hooks. */
+ void ( * init )( struct fe_softc * ); /* Just before fe_init(). */
+ void ( * stop )( struct fe_softc * ); /* Just after fe_stop(). */
+
+ /* Transmission buffer management. */
+ u_short txb_free; /* free bytes in TX buffer */
+ u_char txb_count; /* number of packets in TX buffer */
+ u_char txb_sched; /* number of scheduled packets */
+
+ /* Excessive collision counter (see fe_tint() for details. */
+ u_char tx_excolls; /* # of excessive collisions. */
+
+ /* Multicast address filter management. */
+ u_char filter_change; /* MARs must be changed ASAP. */
+ struct fe_filter filter;/* new filter value. */
+
+} fe_softc[NFE];
+
+#define sc_if arpcom.ac_if
+#define sc_unit arpcom.ac_if.if_unit
+#define sc_enaddr arpcom.ac_enaddr
+
+/* Standard driver entry points. These can be static. */
+static int fe_probe ( struct isa_device * );
+static int fe_attach ( struct isa_device * );
+static void fe_init ( int );
+static int fe_ioctl ( struct ifnet *, u_long, caddr_t );
+static void fe_start ( struct ifnet * );
+static void fe_reset ( int );
+static void fe_watchdog ( struct ifnet * );
+
+/* Local functions. Order of declaration is confused. FIXME. */
+#ifdef PC98
+static int fe_probe_re1000 ( DEVICE *, struct fe_softc * );
+static int fe_probe_re1000p( DEVICE *, struct fe_softc * );
+static int fe_probe_cnet9ne ( DEVICE *, struct fe_softc * );
+static int fe_probe_cnet98p2( DEVICE *, struct fe_softc * );
+#else
+static int fe_probe_fmv ( DEVICE *, struct fe_softc * );
+static int fe_probe_ati ( DEVICE *, struct fe_softc * );
+static void fe_init_ati ( struct fe_softc * );
+#endif /* PC98 */
+static int fe_probe_gwy ( DEVICE *, struct fe_softc * );
+#if NCARD > 0
+static int fe_probe_mbh ( DEVICE *, struct fe_softc * );
+static void fe_init_mbh ( struct fe_softc * );
+static int fe_probe_tdk ( DEVICE *, struct fe_softc * );
+#endif
+static int fe_get_packet ( struct fe_softc *, u_short );
+static void fe_stop ( int );
+static void fe_tint ( struct fe_softc *, u_char );
+static void fe_rint ( struct fe_softc *, u_char );
+static void fe_xmit ( struct fe_softc * );
+static void fe_emptybuffer ( struct fe_softc * );
+static void fe_write_mbufs ( struct fe_softc *, struct mbuf * );
+static struct fe_filter
+ fe_mcaf ( struct fe_softc * );
+static int fe_hash ( u_char * );
+static void fe_setmode ( struct fe_softc * );
+static void fe_loadmar ( struct fe_softc * );
+#if FE_DEBUG >= 1
+static void fe_dump ( int, struct fe_softc *, char * );
+#endif
+
+/* Driver struct used in the config code. This must be public (external.) */
+struct isa_driver fedriver =
+{
+ fe_probe,
+ fe_attach,
+ "fe",
+ 1 /* It's safe to mark as "sensitive" */
+};
+
+/*
+ * Fe driver specific constants which relate to 86960/86965.
+ */
+
+/* Interrupt masks */
+#define FE_TMASK ( FE_D2_COLL16 | FE_D2_TXDONE )
+#define FE_RMASK ( FE_D3_OVRFLO | FE_D3_CRCERR \
+ | FE_D3_ALGERR | FE_D3_SRTPKT | FE_D3_PKTRDY )
+
+/* Maximum number of iterations for a receive interrupt. */
+#define FE_MAX_RECV_COUNT ( ( 65536 - 2048 * 2 ) / 64 )
+ /*
+ * Maximum size of SRAM is 65536,
+ * minimum size of transmission buffer in fe is 2x2KB,
+ * and minimum amount of received packet including headers
+ * added by the chip is 64 bytes.
+ * Hence FE_MAX_RECV_COUNT is the upper limit for number
+ * of packets in the receive buffer.
+ */
+
+/*
+ * Routines to access contiguous I/O ports.
+ */
+
+static void
+inblk ( struct fe_softc * sc, int offs, u_char * mem, int len )
+{
+ while ( --len >= 0 ) {
+ *mem++ = inb( sc->ioaddr[ offs++ ] );
+ }
+}
+
+static void
+outblk ( struct fe_softc * sc, int offs, u_char const * mem, int len )
+{
+ while ( --len >= 0 ) {
+ outb( sc->ioaddr[ offs++ ], *mem++ );
+ }
+}
+
+/* PCCARD Support */
+#if NCARD > 0
+/*
+ * PC-Card (PCMCIA) specific code.
+ */
+static int feinit ( struct pccard_devinfo * );
+static void feunload ( struct pccard_devinfo * );
+static int fe_card_intr ( struct pccard_devinfo * );
+
+static struct pccard_device fe_info = {
+ "fe",
+ feinit,
+ feunload,
+ fe_card_intr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* XXX - Should this also include tty_imask? */
+};
+
+DATA_SET(pccarddrv_set, fe_info);
+
+/*
+ * Initialize the device - called from Slot manager.
+ */
+static int
+feinit(struct pccard_devinfo *devi)
+{
+ struct fe_softc *sc;
+
+ /* validate unit number. */
+ if (devi->isahd.id_unit >= NFE)
+ return (ENODEV);
+ /*
+ * Probe the device. If a value is returned,
+ * the device was found at the location.
+ */
+#if FE_DEBUG >= 2
+ printf("Start Probe\n");
+#endif
+ /* Initialize "minimum" parts of our softc. */
+ sc = &fe_softc[devi->isahd.id_unit];
+ sc->sc_unit = devi->isahd.id_unit;
+ sc->iobase = devi->isahd.id_iobase;
+
+ /* Use Ethernet address got from CIS, if one is available. */
+ if ((devi->misc[0] & 0x03) == 0x00
+ && (devi->misc[0] | devi->misc[1] | devi->misc[2]) != 0) {
+ /* Yes, it looks like a valid Ether address. */
+ bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
+ } else {
+ /* Indicate we have no Ether address in CIS. */
+ bzero(sc->sc_enaddr, ETHER_ADDR_LEN);
+ }
+
+ /* Probe supported PC card models. */
+ if (fe_probe_tdk(&devi->isahd, sc) == 0 &&
+ fe_probe_mbh(&devi->isahd, sc) == 0)
+ return (ENXIO);
+#if FE_DEBUG >= 2
+ printf("Start attach\n");
+#endif
+ if (fe_attach(&devi->isahd) == 0)
+ return (ENXIO);
+
+ return (0);
+}
+
+/*
+ * feunload - unload the driver and clear the table.
+ * XXX TODO:
+ * This is usually called when the card is ejected, but
+ * can be caused by a modunload of a controller driver.
+ * The idea is to reset the driver's view of the device
+ * and ensure that any driver entry points such as
+ * read and write do not hang.
+ */
+static void
+feunload(struct pccard_devinfo *devi)
+{
+ struct fe_softc *sc = &fe_softc[devi->isahd.id_unit];
+ printf("fe%d: unload\n", devi->isahd.id_unit);
+ fe_stop(devi->isahd.id_unit);
+}
+
+/*
+ * fe_card_intr - Shared interrupt called from
+ * front end of PC-Card handler.
+ */
+static int
+fe_card_intr(struct pccard_devinfo *devi)
+{
+ feintr(devi->isahd.id_unit);
+ return (1);
+}
+#endif /* NCARD > 0 */
+
+
+/*
+ * Hardware probe routines.
+ */
+
+/* How and where to probe; to support automatic I/O address detection. */
+struct fe_probe_list
+{
+ int ( * probe ) ( DEVICE *, struct fe_softc * );
+ u_short const * addresses;
+};
+
+/* Lists of possible addresses. */
+#ifdef PC98
+static u_short const fe_re1000_addr [] =
+ { 0x0D0, 0x0D2, 0x0D4, 0x0D6, 0x0D8, 0x0DA, 0x0DC, 0x0DE,
+ 0x1D0, 0x1D2, 0x1D4, 0x1D6, 0x1D8, 0x1DA, 0x1DC, 0x1DE, 0 };
+static u_short const fe_re1000p_addr [] =
+ { 0x0D0, 0x0D2, 0x0D4, 0x0D8, 0x1D4, 0x1D6, 0x1D8, 0x1DA, 0 };
+static u_short const fe_cnet9ne_addr [] =
+ { 0x73D0, 0 };
+static u_short const fe_cnet98p2_addr [] =
+ { 0x03D0, 0x13D0, 0x23D0, 0x33D0, 0x43D0, 0x53D0, 0x63D0,
+ 0x73D0, 0x83D0, 0x93D0, 0xA3D0, 0xB3D0, 0xC3D0, 0xD3D0, 0 };
+#else
+static u_short const fe_fmv_addr [] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340, 0 };
+static u_short const fe_ati_addr [] =
+ { 0x240, 0x260, 0x280, 0x2A0, 0x300, 0x320, 0x340, 0x380, 0 };
+#endif
+
+static struct fe_probe_list const fe_probe_list [] =
+{
+#ifdef PC98
+ { fe_probe_re1000, fe_re1000_addr },
+ { fe_probe_re1000p, fe_re1000p_addr },
+ /* XXX: We must probe C-NET(98)P2 after C-NET(9N)E. */
+ { fe_probe_cnet9ne, fe_cnet9ne_addr },
+ { fe_probe_cnet98p2, fe_cnet98p2_addr },
+#else
+ { fe_probe_fmv, fe_fmv_addr },
+ { fe_probe_ati, fe_ati_addr },
+#endif
+ { fe_probe_gwy, NULL }, /* GWYs cannot be auto detected. */
+ { NULL, NULL }
+};
+
+
+/*
+ * Determine if the device is present
+ *
+ * on entry:
+ * a pointer to an isa_device struct
+ * on exit:
+ * zero if device not found
+ * or number of i/o addresses used (if found)
+ */
+
+static int
+fe_probe ( DEVICE * dev )
+{
+ struct fe_softc * sc;
+ int u;
+ int nports;
+ struct fe_probe_list const * list;
+ u_short const * addr;
+ u_short single [ 2 ];
+
+ /* Initialize "minimum" parts of our softc. */
+ sc = &fe_softc[ dev->id_unit ];
+ sc->sc_unit = dev->id_unit;
+
+ /* TODO: Should be in each probe routines */
+ sc->proto_bmpr14 = 0;
+
+ /* Probe each possibility, one at a time. */
+ for ( list = fe_probe_list; list->probe != NULL; list++ ) {
+
+ if ( dev->id_iobase != NO_IOADDR ) {
+ /* Probe one specific address. */
+ single[ 0 ] = dev->id_iobase;
+ single[ 1 ] = 0;
+ addr = single;
+ } else if ( list->addresses != NULL ) {
+ /* Auto detect. */
+ addr = list->addresses;
+ } else {
+ /* We need a list of addresses to do auto detect. */
+ continue;
+ }
+
+ /* Probe all possible addresses for the board. */
+ while ( *addr != 0 ) {
+
+ /* See if the address is already in use. */
+ for ( u = 0; u < NFE; u++ ) {
+ if ( fe_softc[u].iobase == *addr ) break;
+ }
+
+#if FE_DEBUG >= 3
+ if ( u == NFE ) {
+ log( LOG_INFO, "fe%d: probing %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else if ( u == sc->sc_unit ) {
+ log( LOG_INFO, "fe%d: re-probing %d at 0x%x?\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ } else {
+ log( LOG_INFO, "fe%d: skipping %d at 0x%x\n",
+ sc->sc_unit, list - fe_probe_list, *addr );
+ }
+#endif
+
+ /* Probe the address if it is free. */
+ if ( u == NFE || u == sc->sc_unit ) {
+
+ /* Probe an address. */
+ sc->iobase = *addr;
+ nports = list->probe( dev, sc );
+ if ( nports > 0 ) {
+ /* Found. */
+ dev->id_iobase = *addr;
+ return ( nports );
+ }
+ sc->iobase = 0;
+ }
+
+ /* Try next. */
+ addr++;
+ }
+ }
+
+ /* Probe failed. */
+ return ( 0 );
+}
+
+/*
+ * Check for specific bits in specific registers have specific values.
+ */
+struct fe_simple_probe_struct
+{
+ u_char port; /* Offset from the base I/O address. */
+ u_char mask; /* Bits to be checked. */
+ u_char bits; /* Values to be compared against. */
+};
+
+static int
+fe_simple_probe ( struct fe_softc const * sc,
+ struct fe_simple_probe_struct const * sp )
+{
+ struct fe_simple_probe_struct const * p;
+
+ for ( p = sp; p->mask != 0; p++ ) {
+#if FE_DEBUG >=2
+ printf("Probe Port:%x,Value:%x,Mask:%x.Bits:%x\n",
+ p->port,inb(sc->ioaddr[ p->port]),p->mask,p->bits);
+#endif
+ if ( ( inb( sc->ioaddr[ p->port ] ) & p->mask ) != p->bits )
+ {
+ return ( 0 );
+ }
+ }
+ return ( 1 );
+}
+
+/*
+ * Routines to read all bytes from the config EEPROM through MB86965A.
+ * I'm not sure what exactly I'm doing here... I was told just to follow
+ * the steps, and it worked. Could someone tell me why the following
+ * code works? (Or, why all similar codes I tried previously doesn't
+ * work.) FIXME.
+ */
+
+static void
+fe_strobe_eeprom ( u_short bmpr16 )
+{
+ /*
+ * We must guarantee 800ns (or more) interval to access slow
+ * EEPROMs. The following redundant code provides enough
+ * delay with ISA timing. (Even if the bus clock is "tuned.")
+ * Some modification will be needed on faster busses.
+ */
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
+ outb( bmpr16, FE_B16_SELECT | FE_B16_CLOCK );
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr16, FE_B16_SELECT );
+}
+
+static void
+fe_read_eeprom ( struct fe_softc * sc, u_char * data )
+{
+ u_short bmpr16 = sc->ioaddr[ FE_BMPR16 ];
+ u_short bmpr17 = sc->ioaddr[ FE_BMPR17 ];
+ u_char n, val, bit;
+
+ /* Read bytes from EEPROM; two bytes per an iteration. */
+ for ( n = 0; n < FE_EEPROM_SIZE / 2; n++ ) {
+
+ /* Reset the EEPROM interface. */
+ outb( bmpr16, 0x00 );
+ outb( bmpr17, 0x00 );
+
+ /* Start EEPROM access. */
+ outb( bmpr16, FE_B16_SELECT );
+ outb( bmpr17, FE_B17_DATA );
+ fe_strobe_eeprom( bmpr16 );
+
+ /* Pass the iteration count to the chip. */
+ val = 0x80 | n;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ outb( bmpr17, ( val & bit ) ? FE_B17_DATA : 0 );
+ fe_strobe_eeprom( bmpr16 );
+ }
+ outb( bmpr17, 0x00 );
+
+ /* Read a byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ fe_strobe_eeprom( bmpr16 );
+ if ( inb( bmpr17 ) & FE_B17_DATA ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+
+ /* Read one more byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ fe_strobe_eeprom( bmpr16 );
+ if ( inb( bmpr17 ) & FE_B17_DATA ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+ }
+
+ /* Reset the EEPROM interface, again. */
+ outb( bmpr16, 0x00 );
+ outb( bmpr17, 0x00 );
+
+#if FE_DEBUG >= 3
+ /* Report what we got. */
+ data -= FE_EEPROM_SIZE;
+ log( LOG_INFO, "fe%d: EEPROM:"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x\n",
+ sc->sc_unit,
+ data[ 0], data[ 1], data[ 2], data[ 3],
+ data[ 4], data[ 5], data[ 6], data[ 7],
+ data[ 8], data[ 9], data[10], data[11],
+ data[12], data[13], data[14], data[15],
+ data[16], data[17], data[18], data[19],
+ data[20], data[21], data[22], data[23],
+ data[24], data[25], data[26], data[27],
+ data[28], data[29], data[30], data[31] );
+#endif
+}
+
+/*
+ * Hardware (vendor) specific probe routines.
+ */
+
+#ifdef PC98
+/*
+ * Probe and initialization for Allied-Telesis RE1000 series.
+ */
+static int
+fe_probe_re1000 ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i, n;
+ int dlcr6, dlcr7;
+ u_char c = 0;
+
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ5, IRQ6, IRQ12 };
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for RE1000\n", sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + (i/2)*0x200 + (i%2);
+ }
+
+ /*
+ * RE1000 does not use 86965 EEPROM interface.
+ */
+ c ^= sc->sc_enaddr[0] = inb(sc->ioaddr[FE_RE1000_MAC0]);
+ c ^= sc->sc_enaddr[1] = inb(sc->ioaddr[FE_RE1000_MAC1]);
+ c ^= sc->sc_enaddr[2] = inb(sc->ioaddr[FE_RE1000_MAC2]);
+ c ^= sc->sc_enaddr[3] = inb(sc->ioaddr[FE_RE1000_MAC3]);
+ c ^= sc->sc_enaddr[4] = inb(sc->ioaddr[FE_RE1000_MAC4]);
+ c ^= sc->sc_enaddr[5] = inb(sc->ioaddr[FE_RE1000_MAC5]);
+ c ^= inb(sc->ioaddr[FE_RE1000_MACCHK]);
+ if (c != 0) return 0;
+
+ if ( sc->sc_enaddr[ 0 ] != 0x00
+ || sc->sc_enaddr[ 1 ] != 0x00
+ || sc->sc_enaddr[ 2 ] != 0xF4 ) return 0;
+
+ /*
+ * check interrupt configure
+ */
+ for (n=0; n<4; n++) {
+ if (isa_dev->id_irq == irqmap[n]) break;
+ }
+ if (n == 4) return 0;
+
+ /*
+ * set irq
+ */
+ c = inb(sc->ioaddr[FE_RE1000_IRQCONF]);
+ c &= (~ FE_RE1000_IRQCONF_IRQ);
+ c |= (1 << (n + FE_RE1000_IRQCONF_IRQSHIFT));
+ outb(sc->ioaddr[FE_RE1000_IRQCONF], c);
+
+ sc->typestr = "RE1000";
+
+ /*
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "RE1000 found" );
+#endif
+
+ /* Initialize 86965. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY(200);
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_re1000()" );
+#endif
+
+ /*
+ * That's all. RE1000 occupies 2*16 I/O addresses, by the way.
+ */
+ return 2; /* ??? */
+}
+
+/*
+ * Probe and initialization for Allied-Telesis RE1000Plus/ME1500 series.
+ */
+static int
+fe_probe_re1000p ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i, n, signature;
+ int dlcr6, dlcr7;
+ u_char eeprom [ FE_EEPROM_SIZE ];
+
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ5, IRQ6, IRQ12 };
+ static struct fe_simple_probe_struct const probe_signature1 [] = {
+ { FE_DLCR0, 0xBF, 0x00 },
+ { FE_DLCR2, 0xFF, 0x00 },
+ { FE_DLCR4, 0x0F, 0x06 },
+ { FE_DLCR6, 0x0F, 0x06 },
+ { 0 }
+ };
+ static struct fe_simple_probe_struct const probe_signature2 [] = {
+ { FE_DLCR1, 0xFF, 0x00 },
+ { FE_DLCR3, 0xFF, 0x00 },
+ { FE_DLCR5, 0xFF, 0x41 },
+ { 0 }
+ };
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x71, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR5, 0x80, 0x00 },
+ { 0 }
+ };
+ static struct fe_simple_probe_struct const vendor_code [] = {
+ { FE_DLCR8, 0xFF, 0x00 },
+ { FE_DLCR9, 0xFF, 0x00 },
+ { FE_DLCR10, 0xFF, 0xF4 },
+ { 0 }
+ };
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for RE1000Plus/ME1500\n", sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < 16; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + (i/2)*0x200 + (i%2);
+ }
+ for ( i = 16; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i*0x200 - 0x1000;
+ }
+
+ /* First, check the "signature" */
+ signature = 0;
+ if (fe_simple_probe(sc, probe_signature1)) {
+ outb(sc->ioaddr[FE_DLCR6], (inb(sc->ioaddr[FE_DLCR6]) & 0xCF) | 0x16);
+ if (fe_simple_probe(sc, probe_signature2))
+ signature = 1;
+ }
+
+ /*
+ * If the "signature" not detected, 86965 *might* be previously
+ * initialized. So, check the Ethernet address here.
+ *
+ * Allied-Telesis uses 00 00 F4 ?? ?? ??.
+ */
+ if (signature == 0) {
+ /* Simple check */
+ if (!fe_simple_probe(sc, probe_table)) return 0;
+
+ /* Disable DLC */
+ dlcr6 = inb(sc->ioaddr[FE_DLCR6]);
+ outb(sc->ioaddr[FE_DLCR6], dlcr6 | FE_D6_DLC_DISABLE);
+ /* Select register bank for DLCR */
+ dlcr7 = inb(sc->ioaddr[FE_DLCR7]);
+ outb(sc->ioaddr[FE_DLCR7], dlcr7 & 0xF3 | FE_D7_RBS_DLCR);
+
+ /* Check the Ethernet address */
+ if (!fe_simple_probe(sc, vendor_code)) return 0;
+
+ /* Restore configuration registers */
+ DELAY(200);
+ outb(sc->ioaddr[FE_DLCR6], dlcr6);
+ outb(sc->ioaddr[FE_DLCR7], dlcr7);
+ }
+
+ /*
+ * We are now almost sure we have an 86965 at the given
+ * address. So, read EEPROM through 86965. We have to write
+ * into LSI registers to read from EEPROM. I want to avoid it
+ * at this stage, but I cannot test the presense of the chip
+ * any further without reading EEPROM. FIXME.
+ */
+ fe_read_eeprom( sc, eeprom );
+
+ /* Make sure that config info in EEPROM and 86965 agree. */
+ if ( eeprom[ FE_EEPROM_CONF ] != inb( sc->ioaddr[FE_BMPR19] ) ) {
+ return 0;
+ }
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_ATI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ sc->typestr = "RE1000Plus/ME1500";
+
+ /*
+ * Read IRQ configuration.
+ */
+ n = (inb(sc->ioaddr[FE_BMPR19]) & FE_B19_IRQ ) >> FE_B19_IRQ_SHIFT;
+ isa_dev->id_irq = irqmap[n];
+
+ /*
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "RE1000Plus/ME1500 found" );
+#endif
+
+ /* Initialize 86965. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY(200);
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_re1000p()" );
+#endif
+
+ /*
+ * That's all. RE1000Plus/ME1500 occupies 2*16 I/O addresses, by the way.
+ */
+ return 2; /* ??? */
+}
+
+/*
+ * Probe and initialization for Contec C-NET(9N)E series.
+ */
+
+/* TODO: Should be in "if_fereg.h" */
+#define FE_CNET9NE_INTR 0x10 /* Interrupt Mask? */
+#define FE_CNET9NE_MAC0 0x11 /* Station(MAC) address */
+#define FE_CNET9NE_MAC1 0x13
+#define FE_CNET9NE_MAC2 0x15
+#define FE_CNET9NE_MAC3 0x17
+#define FE_CNET9NE_MAC4 0x19
+#define FE_CNET9NE_MAC5 0x1B
+
+/* TODO: Should be in "ic/mb86960.h" */
+#define FE_D7_ENDEC 0xC0 /* Encoder/Decoder mode(86960 only) */
+#define FE_D7_ENDEC_NORMAL_NICE 0x00 /* Normal NICE */
+#define FE_D7_ENDEC_NICE_MONITOR 0x40 /* NICE + Monitor */
+#define FE_D7_ENDEC_BYPASS 0x80 /* Encoder/Decoder Bypass */
+#define FE_D7_ENDEC_TEST 0xC0 /* Encoder/Decoder Test */
+
+static int
+fe_probe_cnet9ne ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i;
+ u_char c;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for C-NET(9N)E\n", sc->sc_unit, sc->iobase );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < 16; i++ ) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ for ( ; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[i] = sc->iobase + 0x400 - 16 + i;
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Get our station address from EEPROM. */
+ sc->sc_enaddr[0] = inb( sc->ioaddr[FE_CNET9NE_MAC0] );
+ sc->sc_enaddr[1] = inb( sc->ioaddr[FE_CNET9NE_MAC1] );
+ sc->sc_enaddr[2] = inb( sc->ioaddr[FE_CNET9NE_MAC2] );
+ sc->sc_enaddr[3] = inb( sc->ioaddr[FE_CNET9NE_MAC3] );
+ sc->sc_enaddr[4] = inb( sc->ioaddr[FE_CNET9NE_MAC4] );
+ sc->sc_enaddr[5] = inb( sc->ioaddr[FE_CNET9NE_MAC5] );
+
+#if 1
+ /*
+ * Check the Ethernet address here.
+ *
+ * Contec uses 00 80 4C ?? ?? ??.
+ */
+ if ( sc->sc_enaddr[0] != (u_char)0x00
+ || sc->sc_enaddr[1] != (u_char)0x80
+ || sc->sc_enaddr[2] != (u_char)0x4C ) {
+#else
+ /*
+ * Make sure we got a valid Ethernet address.
+ */
+ if ( ( sc->sc_enaddr[0] & 0x03 ) != 0x00 /* Multicast or Local address. */
+ || ( sc->sc_enaddr[0] | sc->sc_enaddr[1] | sc->sc_enaddr[2] ) == 0x00 ) {
+#endif
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: invalid MAC adrs(%x:%x:%x:%x:%x:%x)\n"
+ , sc->sc_unit
+ , (u_char)sc->sc_enaddr[0], (u_char)sc->sc_enaddr[1]
+ , (u_char)sc->sc_enaddr[2], (u_char)sc->sc_enaddr[3]
+ , (u_char)sc->sc_enaddr[4], (u_char)sc->sc_enaddr[5] );
+#endif
+ return 0;
+ }
+
+ /* See if C-NET(9N)E is on its address. */
+ if ( inb( sc->ioaddr[FE_DLCR6] ) == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR6] );
+#endif
+ return 0;
+ }
+
+ sc->typestr = "C-NET9NE";
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 64KB, word-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * Encoder/Decoder mode: Normal NICE.
+ *
+ * 86960 manual says that SRAM access-time can't be configured.
+ * (must be 1)
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = FE_D5_RMTRST; /* reserved bit(must be 1) */
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_64KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_WORD | FE_D6_SBW_WORD | FE_D6_SRAM;
+#ifndef CNET9NC
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_ENDEC_NORMAL_NICE;
+#else
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_ENDEC_BYPASS;
+#endif
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+ sc->proto_bmpr14 = 0;
+
+ sc->stop = sc->init = NULL;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "C-NET(9N)E found" );
+#endif
+
+ /* Initialize 86960. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+#if 1 /* XXX: Is this really necessary? FIXME. */
+ c = inb( sc->ioaddr[FE_DLCR1] );
+ if ( c == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR1] );
+#endif
+ return 0;
+ }
+ if ( ( c & FE_D1_PKTRDY ) == 0 ) {
+ outb( sc->ioaddr[FE_DLCR1], FE_D1_PKTRDY );
+ }
+#endif
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#ifndef CNET9NC
+ /* Enable interrupt? FIXME. */
+ outb( sc->ioaddr[FE_CNET9NE_INTR], 0x10 );
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_cnet9ne()" );
+#endif
+
+ /*
+ * XXX: The I/O address range is fragmented in the CNET(9N)E.
+ * "16" is the number of regs at iobase.
+ */
+ return 16;
+}
+
+/*
+ * Probe and initialization for Contec C-NET(98)P2 series.
+ */
+
+/*
+ * Routines to read all bytes from the config EEPROM through TDK 78Q8377A.
+ * I'm not sure what exactly I'm doing here... I was told just to follow
+ * the steps, and it worked. Could someone tell me why the following
+ * code works? FIXME.
+ */
+
+static void
+fe_strobe_eeprom_tdk ( u_short bmpr12 )
+{
+ outb( bmpr12, 0x10 );
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+ outb( bmpr12, 0x12 | 0x01 );
+ outb( bmpr12, 0x16 | 0x01 );
+ outb( bmpr12, 0x12 | 0x01 );
+ outb( bmpr12, 0x16 | 0x01 );
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+}
+
+static void
+fe_read_eeprom_tdk ( struct fe_softc * sc, u_char * data )
+{
+ u_short bmpr12 = sc->ioaddr[FE_DLCR12];
+ u_char n, val, bit;
+
+ outb( sc->ioaddr[FE_DLCR6], FE_D6_BBW_WORD | FE_D6_SBW_WORD
+ | FE_D6_DLC_DISABLE );
+ outb( sc->ioaddr[FE_DLCR7], FE_D7_BYTSWP_LH | FE_D7_RBS_BMPR
+ | FE_D7_RDYPNS | FE_D7_POWER_UP );
+
+ /* Read bytes from EEPROM; two bytes per an iteration. */
+ for ( n = 0; n < FE_EEPROM_SIZE / 2; n++ ) {
+
+ /* Start EEPROM access. */
+ fe_strobe_eeprom_tdk( bmpr12 );
+
+ /* Pass the iteration count to the chip. */
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ val = ( n & bit ) ? 0x01 : 0x00;
+ outb( bmpr12, 0x12 | val );
+ outb( bmpr12, 0x16 | val );
+ }
+
+ /* Read a byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+ if ( inb( bmpr12 ) & 0x01 ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+
+ /* Read one more byte. */
+ val = 0;
+ for ( bit = 0x80; bit != 0x00; bit >>= 1 ) {
+ outb( bmpr12, 0x12 );
+ outb( bmpr12, 0x16 );
+ if ( inb( bmpr12 ) & 0x01 ) {
+ val |= bit;
+ }
+ }
+ *data++ = val;
+
+ outb( bmpr12, 0x10 );
+ }
+
+ /* Reset the EEPROM interface. */
+ outb( bmpr12, 0x00 );
+
+#if FE_DEBUG >= 3
+ /* Report what we got. */
+ data -= FE_EEPROM_SIZE;
+ log( LOG_INFO, "fe%d: EEPROM:"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x -"
+ " %02x%02x%02x%02x %02x%02x%02x%02x\n",
+ sc->sc_unit,
+ data[ 0], data[ 1], data[ 2], data[ 3],
+ data[ 4], data[ 5], data[ 6], data[ 7],
+ data[ 8], data[ 9], data[10], data[11],
+ data[12], data[13], data[14], data[15],
+ data[16], data[17], data[18], data[19],
+ data[20], data[21], data[22], data[23],
+ data[24], data[25], data[26], data[27],
+ data[28], data[29], data[30], data[31] );
+#endif
+}
+
+/* TODO: Should be in "if_fereg.h" */
+#define FE_CNET98P2_EEP_IRQ (0x04 * 2 + 1) /* Irq */
+#define FE_CNET98P2_EEP_ADDR (0x08 * 2) /* Station(MAC) address */
+#define FE_CNET98P2_EEP_DUPLEX (0x0c * 2 + 1) /* Duplex mode */
+
+static int
+fe_probe_cnet98p2 ( DEVICE * isa_dev, struct fe_softc * sc )
+{
+ int i;
+ u_char duplex;
+ u_char eeprom[FE_EEPROM_SIZE];
+ static u_short const irqmap [] =
+ /* INT0 INT1 INT2 */
+ { NO_IRQ, NO_IRQ, NO_IRQ, IRQ3, NO_IRQ, IRQ5, IRQ6, NO_IRQ,
+ NO_IRQ, IRQ9, IRQ10, NO_IRQ, IRQ12, IRQ13, NO_IRQ, NO_IRQ };
+ /* INT3 INT4 INT5 INT6 */
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for C-NET(98)P2\n", sc->sc_unit, sc->iobase );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < 16; i++ ) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ /* Full unused slots with a safe address. */
+ for ( ; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[i] = sc->iobase;
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* See if C-NET(98)P2 is on its address. */
+ if ( inb( sc->ioaddr[FE_DLCR0] ) == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR0] );
+#endif
+ return 0;
+ }
+ if ( inb( sc->ioaddr[FE_DLCR6] ) == (u_char)0xff ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: inb(%x) returns 0xff\n"
+ , sc->sc_unit, sc->ioaddr[FE_DLCR6] );
+#endif
+ return 0;
+ }
+
+ /*
+ * We are now almost sure we have a 78Q8377 at the given
+ * address. So, read EEPROM through 78Q8377. We have to write
+ * into LSI registers to read from EEPROM. FIXME.
+ */
+ fe_read_eeprom_tdk( sc, eeprom );
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_CNET98P2_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+#if 1
+ /*
+ * Check the Ethernet address here.
+ *
+ * Contec uses 00 80 4C ?? ?? ??.
+ */
+ if ( sc->sc_enaddr[0] != (u_char)0x00
+ || sc->sc_enaddr[1] != (u_char)0x80
+ || sc->sc_enaddr[2] != (u_char)0x4C ) {
+#else
+ /*
+ * Make sure we got a valid Ethernet address.
+ */
+ if ( ( sc->sc_enaddr[0] & 0x03 ) != 0x00 /* Multicast or Local address. */
+ || ( sc->sc_enaddr[0] | sc->sc_enaddr[1] | sc->sc_enaddr[2] ) == 0x00 ) {
+#endif
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: invalid MAC adrs(%x:%x:%x:%x:%x:%x)\n"
+ , sc->sc_unit
+ , (u_char)sc->sc_enaddr[0], (u_char)sc->sc_enaddr[1]
+ , (u_char)sc->sc_enaddr[2], (u_char)sc->sc_enaddr[3]
+ , (u_char)sc->sc_enaddr[4], (u_char)sc->sc_enaddr[5] );
+#endif
+ return 0;
+ }
+
+ /*
+ * Get IRQ configuration from EEPROM.
+ */
+ isa_dev->id_irq = irqmap[ eeprom[FE_CNET98P2_EEP_IRQ] ];
+ if ( isa_dev->id_irq == NO_IRQ ) {
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: invalid irq configuration(%d)\n"
+ , sc->sc_unit, eeprom[FE_CNET98P2_EEP_IRQ] );
+#endif
+ return 0;
+ }
+
+ /*
+ * Get Duplex-mode configuration from EEPROM.
+ */
+ duplex = eeprom[FE_CNET98P2_EEP_DUPLEX] & FE_D4_DSC;
+ sc->typestr = ( duplex ? "CNET98P2(Full duplex)"
+ : "CNET98P2(Half duplex)" );
+
+ /*
+ * Program the 78Q8377 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * XXX: Should we add IDENT_NICE or IDENT_EC to DLCR7? FIXME.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL | duplex;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+ sc->proto_bmpr14 = FE_B14_FILTER;
+
+ sc->stop = sc->init = NULL;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "C-NET(98)P2 found" );
+#endif
+
+ /* Initialize 78Q8377. */
+ outb( sc->ioaddr[FE_DLCR6], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[FE_DLCR2], 0 );
+ outb( sc->ioaddr[FE_DLCR3], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_cnet98p2()" );
+#endif
+
+ /*
+ * That's all. C-NET(98)P2 occupies 16 I/O addresses, as always.
+ */
+ return 16;
+}
+#else
+/*
+ * Probe and initialization for Fujitsu FMV-180 series boards
+ */
+static int
+fe_probe_fmv ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i, n;
+
+ static u_short const baseaddr [ 8 ] =
+ { 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x300, 0x340 };
+ static u_short const irqmap [ 4 ] =
+ { IRQ3, IRQ7, IRQ10, IRQ15 };
+
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ /* { FE_DLCR5, 0x80, 0x00 }, Doesn't work. */
+
+ { FE_FMV0, 0x78, 0x50 }, /* ERRDY+PRRDY */
+ { FE_FMV1, 0xB0, 0x00 }, /* FMV-183/184 has 0x48 bits. */
+ { FE_FMV3, 0x7F, 0x00 },
+#if 1
+ /*
+ * Test *vendor* part of the station address for Fujitsu.
+ * The test will gain reliability of probe process, but
+ * it rejects FMV-180 clone boards manufactured by other vendors.
+ * We have to turn the test off when such cards are made available.
+ */
+ { FE_FMV4, 0xFF, 0x00 },
+ { FE_FMV5, 0xFF, 0x00 },
+ { FE_FMV6, 0xFF, 0x0E },
+#else
+ /*
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "no multicast" and "no local" even for
+ * unknown vendors.
+ */
+ { FE_FMV4, 0x03, 0x00 },
+#endif
+ { 0 }
+ };
+
+ /* "Hardware revision ID" */
+ int revision;
+
+ /*
+ * See if the specified address is possible for FMV-180 series.
+ */
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
+ }
+ if ( i == 8 ) return 0;
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /* Simple probe. */
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+
+ /* Check if our I/O address matches config info. on EEPROM. */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IOS )
+ >> FE_FMV2_IOS_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) {
+#if 0
+ /* May not work on some revisions of the cards... FIXME. */
+ return 0;
+#else
+ /* Just log the fact and see what happens... FIXME. */
+ log( LOG_WARNING, "fe%d: strange I/O config?\n", sc->sc_unit );
+#endif
+ }
+
+ /* Find the "hardware revision." */
+ revision = inb( sc->ioaddr[ FE_FMV1 ] ) & FE_FMV1_REV;
+
+ /* Determine the card type. */
+ sc->typestr = NULL;
+ switch ( inb( sc->ioaddr[ FE_FMV0 ] ) & FE_FMV0_MEDIA ) {
+ case 0:
+ /* No interface? This doesn't seem to be an FMV-180... */
+ return 0;
+ case FE_FMV0_MEDIUM_T:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-183";
+ break;
+ case 12:
+ sc->typestr = "FMV-183 (on-board)";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_T | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-181";
+ break;
+ case 1:
+ sc->typestr = "FMV-181A";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_2:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 2)";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 1)";
+ break;
+ }
+ break;
+ case FE_FMV0_MEDIUM_2 | FE_FMV0_MEDIUM_5:
+ switch ( revision ) {
+ case 0:
+ sc->typestr = "FMV-182";
+ break;
+ case 1:
+ sc->typestr = "FMV-182A";
+ break;
+ case 8:
+ sc->typestr = "FMV-184 (CSR = 3)";
+ break;
+ }
+ break;
+ }
+ if ( sc->typestr == NULL ) {
+ /* Unknown card type... Hope the driver works. */
+ sc->typestr = "unknown FMV-180 version";
+ log( LOG_WARNING, "fe%d: %s: %x-%x-%x-%x\n",
+ sc->sc_unit, sc->typestr,
+ inb( sc->ioaddr[ FE_FMV0 ] ),
+ inb( sc->ioaddr[ FE_FMV1 ] ),
+ inb( sc->ioaddr[ FE_FMV2 ] ),
+ inb( sc->ioaddr[ FE_FMV3 ] ) );
+ }
+
+ /*
+ * An FMV-180 has been proved.
+ * Determine which IRQ to be used.
+ *
+ * In this version, we give a priority to the kernel config file.
+ * If the EEPROM and config don't match, say it to the user for
+ * an attention.
+ */
+ n = ( inb( sc->ioaddr[ FE_FMV2 ] ) & FE_FMV2_IRS )
+ >> FE_FMV2_IRS_SHIFT;
+ if ( dev->id_irq == NO_IRQ ) {
+ /* Just use the probed value. */
+ dev->id_irq = irqmap[ n ];
+ } else if ( dev->id_irq != irqmap[ n ] ) {
+ /* Don't match. */
+ log( LOG_WARNING,
+ "fe%d: check IRQ in config; it may be incorrect\n",
+ sc->sc_unit );
+ }
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ inblk( sc, FE_FMV4, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+
+ /*
+ * Register values which (may) depend on board design.
+ *
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /*
+ * Minimum initialization of the hardware.
+ * We write into registers; hope I/O ports have no
+ * overlap with other boards.
+ */
+
+ /* Initialize ASIC. */
+ outb( sc->ioaddr[ FE_FMV3 ], 0 );
+ outb( sc->ioaddr[ FE_FMV10 ], 0 );
+
+ /* Initialize 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* "Refresh" hardware configuration. FIXME. */
+ outb( sc->ioaddr[ FE_FMV2 ], inb( sc->ioaddr[ FE_FMV2 ] ) );
+
+ /* Turn the "master interrupt control" flag of ASIC on. */
+ outb( sc->ioaddr[ FE_FMV3 ], FE_FMV3_IRQENB );
+
+ /*
+ * That's all. FMV-180 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
+}
+
+/*
+ * Probe and initialization for Allied-Telesis AT1700/RE2000 series.
+ */
+static int
+fe_probe_ati ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i, n;
+ u_char eeprom [ FE_EEPROM_SIZE ];
+ u_char save16, save17;
+
+ static u_short const baseaddr [ 8 ] =
+ { 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300 };
+ static u_short const irqmaps [ 4 ][ 4 ] =
+ {
+ { IRQ3, IRQ4, IRQ5, IRQ9 },
+ { IRQ10, IRQ11, IRQ12, IRQ15 },
+ { IRQ3, IRQ11, IRQ5, IRQ15 },
+ { IRQ10, IRQ11, IRQ14, IRQ15 },
+ };
+ static struct fe_simple_probe_struct const probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR5, 0x80, 0x00 },
+#if 0
+ { FE_BMPR16, 0x1B, 0x00 },
+ { FE_BMPR17, 0x7F, 0x00 },
+#endif
+ { 0 }
+ };
+
+ /* Assume we have 86965 and no need to restore these. */
+ save16 = 0;
+ save17 = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: probe (0x%x) for ATI\n",
+ sc->sc_unit, sc->iobase );
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /*
+ * See if the specified address is possible for MB86965A JLI mode.
+ */
+ for ( i = 0; i < 8; i++ ) {
+ if ( baseaddr[ i ] == sc->iobase ) break;
+ }
+ if ( i == 8 ) goto NOTFOUND;
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /*
+ * We should test if MB86965A is on the base address now.
+ * Unfortunately, it is very hard to probe it reliably, since
+ * we have no way to reset the chip under software control.
+ * On cold boot, we could check the "signature" bit patterns
+ * described in the Fujitsu document. On warm boot, however,
+ * we can predict almost nothing about register values.
+ */
+ if ( !fe_simple_probe( sc, probe_table ) ) goto NOTFOUND;
+
+ /* Check if our I/O address matches config info on 86965. */
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_ADDR )
+ >> FE_B19_ADDR_SHIFT;
+ if ( baseaddr[ n ] != sc->iobase ) goto NOTFOUND;
+
+ /*
+ * We are now almost sure we have an AT1700 at the given
+ * address. So, read EEPROM through 86965. We have to write
+ * into LSI registers to read from EEPROM. I want to avoid it
+ * at this stage, but I cannot test the presence of the chip
+ * any further without reading EEPROM. FIXME.
+ */
+ save16 = inb( sc->ioaddr[ FE_BMPR16 ] );
+ save17 = inb( sc->ioaddr[ FE_BMPR17 ] );
+ fe_read_eeprom( sc, eeprom );
+
+ /* Make sure the EEPROM is turned off. */
+ outb( sc->ioaddr[ FE_BMPR16 ], 0 );
+ outb( sc->ioaddr[ FE_BMPR17 ], 0 );
+
+ /* Make sure that config info in EEPROM and 86965 agree. */
+ if ( eeprom[ FE_EEPROM_CONF ] != inb( sc->ioaddr[ FE_BMPR19 ] ) ) {
+ goto NOTFOUND;
+ }
+
+ /*
+ * The following model identification codes are stolen from
+ * from the NetBSD port of the fe driver. My reviewers
+ * suggested minor revision.
+ */
+
+ /* Determine the card type. */
+ switch (eeprom[FE_ATI_EEP_MODEL]) {
+ case FE_ATI_MODEL_AT1700T:
+ sc->typestr = "AT-1700T/RE2001";
+ break;
+ case FE_ATI_MODEL_AT1700BT:
+ sc->typestr = "AT-1700BT/RE2003";
+ break;
+ case FE_ATI_MODEL_AT1700FT:
+ sc->typestr = "AT-1700FT/RE2009";
+ break;
+ case FE_ATI_MODEL_AT1700AT:
+ sc->typestr = "AT-1700AT/RE2005";
+ break;
+ default:
+ sc->typestr = "unknown AT-1700/RE2000 ?";
+ break;
+ }
+
+ /*
+ * Try to determine IRQ settings.
+ * Different models use different ranges of IRQs.
+ */
+ if ( dev->id_irq == NO_IRQ ) {
+ n = ( inb( sc->ioaddr[ FE_BMPR19 ] ) & FE_B19_IRQ )
+ >> FE_B19_IRQ_SHIFT;
+ switch ( eeprom[ FE_ATI_EEP_REVISION ] & 0xf0 ) {
+ case 0x30:
+ dev->id_irq = irqmaps[ 3 ][ n ];
+ break;
+ case 0x10:
+ case 0x50:
+ dev->id_irq = irqmaps[ 2 ][ n ];
+ break;
+ case 0x40:
+ case 0x60:
+ if ( eeprom[ FE_ATI_EEP_MAGIC ] & 0x04 ) {
+ dev->id_irq = irqmaps[ 1 ][ n ];
+ } else {
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ }
+ break;
+ default:
+ dev->id_irq = irqmaps[ 0 ][ n ];
+ break;
+ }
+ }
+
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ bcopy( eeprom + FE_ATI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+#if 1
+ /*
+ * This test doesn't work well for AT1700 look-alike by
+ * other vendors.
+ */
+ /* Make sure the vendor part is for Allied-Telesis. */
+ if ( sc->sc_enaddr[ 0 ] != 0x00
+ || sc->sc_enaddr[ 1 ] != 0x00
+ || sc->sc_enaddr[ 2 ] != 0xF4 ) return 0;
+
+#else
+ /* Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+#endif
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; /* FIXME */
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_EC;
+#if 0 /* XXXX Should we use this? FIXME. */
+ sc->proto_bmpr13 = eeprom[ FE_ATI_EEP_MEDIA ];
+#else
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "ATI found" );
+#endif
+
+ /* Setup hooks. This may solves a nasty bug. FIXME. */
+ sc->init = fe_init_ati;
+
+ /* Initialize 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of fe_probe_ati()" );
+#endif
+
+ /*
+ * That's all. AT1700 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
+
+ NOTFOUND:
+ /*
+ * We have no AT1700 at a given address.
+ * Restore BMPR16 and BMPR17 if we have destroyed them,
+ * hoping that the hardware on the address didn't get
+ * bad side effect.
+ */
+ if ( save16 != 0 | save17 != 0 ) {
+ outb( sc->ioaddr[ FE_BMPR16 ], save16 );
+ outb( sc->ioaddr[ FE_BMPR17 ], save17 );
+ }
+ return ( 0 );
+}
+
+/* ATI specific initialization routine. */
+static void
+fe_init_ati ( struct fe_softc * sc )
+{
+/*
+ * I've told that the following operation "Resets" the chip.
+ * Hope this solve a bug which hangs up the driver under
+ * heavy load... FIXME.
+ */
+
+ /* Minimal initialization of 86965. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* "Reset" by wrting into an undocument register location. */
+ outb( sc->ioaddr[ 0x1F ], 0 );
+
+ /* How long do we have to wait after the reset? FIXME. */
+ DELAY( 300 );
+}
+#endif /* PC98 */
+
+/*
+ * Probe and initialization for Gateway Communications' old cards.
+ */
+static int
+fe_probe_gwy ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i;
+
+ static struct fe_simple_probe_struct probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR7, 0xC0, 0x00 },
+ /*
+ * Test *vendor* part of the address for Gateway.
+ * This test is essential to identify Gateway's cards.
+ * We shuld define some symbolic names for the
+ * following offsets. FIXME.
+ */
+ { 0x18, 0xFF, 0x00 },
+ { 0x19, 0xFF, 0x00 },
+ { 0x1A, 0xFF, 0x61 },
+ { 0 }
+ };
+
+ /*
+ * We need explicit IRQ and supported address.
+ * I'm not sure which address and IRQ is possible for Gateway
+ * Ethernet family. The following accepts everything. FIXME.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /* See if the card is on its address. */
+ if ( !fe_simple_probe( sc, probe_table ) ) {
+ return 0;
+ }
+
+ /* Determine the card type. */
+ sc->typestr = "Gateway Ethernet w/ Fujitsu chipset";
+
+ /* Get our station address from EEPROM. */
+ inblk( sc, 0x18, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 16KB, 100ns, byte-wide access.
+ * Transmission buffer: 2KB x 2.
+ * System bus interface: 16 bits.
+ * Make sure to clear out ID bits in DLCR7
+ * (They actually are Encoder/Decoder control in NICE.)
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_16KB | FE_D6_TXBSIZ_2x2KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH;
+ sc->proto_bmpr13 = 0;
+
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* That's all. The card occupies 32 I/O addresses, as always. */
+ return 32;
+}
+
+#if NCARD > 0
+/*
+ * Probe and initialization for Fujitsu MBH10302 PCMCIA Ethernet interface.
+ * Note that this is for 10302 only; MBH10304 is handled by fe_probe_tdk().
+ */
+static int
+fe_probe_mbh ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i,type;
+
+ static struct fe_simple_probe_struct probe_table [] = {
+ { FE_DLCR0, 0x09, 0x00 },
+ { FE_DLCR2, 0x79, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ { FE_DLCR6, 0xFF, 0xB6 },
+ /*
+ * The following location has the first byte of the card's
+ * Ethernet (MAC) address.
+ * We can always verify the *first* 2 bits (in Ethernet
+ * bit order) are "global" and "unicast" for any vendors'.
+ */
+ { FE_MBH10, 0x03, 0x00 },
+
+ /* Just a gap? Seems reliable, anyway. */
+ { 0x12, 0xFF, 0x00 },
+ { 0x13, 0xFF, 0x00 },
+ { 0x14, 0xFF, 0x00 },
+ { 0x15, 0xFF, 0x00 },
+ { 0x16, 0xFF, 0x00 },
+ { 0x17, 0xFF, 0x00 },
+#if 0
+ { 0x18, 0xFF, 0xFF },
+ { 0x19, 0xFF, 0xFF },
+#endif
+
+ { 0 }
+ };
+
+ /*
+ * We need explicit IRQ and supported address.
+ */
+ if ( dev->id_irq == NO_IRQ || ( sc->iobase & ~0x3E0 ) != 0 ) {
+ return ( 0 );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "top of probe" );
+#endif
+
+ /* Setup an I/O address mapping table. */
+ for ( i = 0; i < MAXREGISTERS; i++ ) {
+ sc->ioaddr[ i ] = sc->iobase + i;
+ }
+
+ /*
+ * See if MBH10302 is on its address.
+ * I'm not sure the following probe code works. FIXME.
+ */
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+
+ /* Determine the card type. */
+ sc->typestr = "MBH10302 (PCMCIA)";
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* Get our station address from EEPROM. */
+ inblk( sc, FE_MBH10, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /* Make sure we got a valid station address. */
+ if ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) return 0;
+
+ /*
+ * Program the 86960 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /* Setup hooks. We need a special initialization procedure. */
+ sc->init = fe_init_mbh;
+
+ /*
+ * Minimum initialization.
+ */
+
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+#if 1 /* FIXME. */
+ /* Initialize system bus interface and encoder/decoder operation. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_DISABLE );
+#endif
+
+ /*
+ * That's all. MBH10302 occupies 32 I/O addresses, by the way.
+ */
+ return 32;
+}
+
+/* MBH specific initialization routine. */
+static void
+fe_init_mbh ( struct fe_softc * sc )
+{
+ /* Minimal initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /* Enable master interrupt flag. */
+ outb( sc->ioaddr[ FE_MBH0 ], FE_MBH0_MAGIC | FE_MBH0_INTR_ENABLE );
+}
+
+/*
+ * Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface.
+ * by MASUI Kenji <masui@cs.titech.ac.jp>
+ *
+ * (Contec uses TDK Ethenet chip -- hosokawa)
+ *
+ * This version of fe_probe_tdk has been rewrote to handle
+ * *generic* PC card implementation of Fujitsu MB8696x and compatibles.
+ * The name _tdk is just for a historical reason. <seki> :-)
+ */
+static int
+fe_probe_tdk ( DEVICE * dev, struct fe_softc * sc )
+{
+ int i;
+
+ static struct fe_simple_probe_struct probe_table [] = {
+ { FE_DLCR2, 0x70, 0x00 },
+ { FE_DLCR4, 0x08, 0x00 },
+ /* { FE_DLCR5, 0x80, 0x00 }, Does not work well. */
+ { 0 }
+ };
+
+ /* We need an IRQ. */
+ if ( dev->id_irq == NO_IRQ ) {
+ return ( 0 );
+ }
+
+ /* Generic driver needs Ethernet address taken from CIS. */
+ if (sc->arpcom.ac_enaddr[0] == 0
+ && sc->arpcom.ac_enaddr[1] == 0
+ && sc->arpcom.ac_enaddr[2] == 0) {
+ return 0;
+ }
+
+ /* Setup an I/O address mapping table; we need only 16 ports. */
+ for (i = 0; i < 16; i++) {
+ sc->ioaddr[i] = sc->iobase + i;
+ }
+ /* Fill unused slots with a safe address. */
+ for (i = 16; i < MAXREGISTERS; i++) {
+ sc->ioaddr[i] = sc->iobase;
+ }
+
+ /*
+ * See if C-NET(PC)C is on its address.
+ */
+
+ if ( !fe_simple_probe( sc, probe_table ) ) return 0;
+
+ /* Determine the card type. */
+ sc->typestr = "Generic MB8696x Ethernet (PCMCIA)";
+
+ /*
+ * Initialize constants in the per-line structure.
+ */
+
+ /* The station address *must*be* already in sc_enaddr;
+ Make sure we got a valid station address. */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x03 ) != 0x00
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) return 0;
+
+ /*
+ * Program the 86965 as follows:
+ * SRAM: 32KB, 100ns, byte-wide access.
+ * Transmission buffer: 4KB x 2.
+ * System bus interface: 16 bits.
+ * XXX: Should we remove IDENT_NICE from DLCR7? Or,
+ * even add IDENT_EC instead? FIXME.
+ */
+ sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL;
+ sc->proto_dlcr5 = 0;
+ sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB
+ | FE_D6_BBW_BYTE | FE_D6_SBW_WORD | FE_D6_SRAM_100ns;
+ sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
+ sc->proto_bmpr13 = FE_B13_TPTYPE_UTP | FE_B13_PORT_AUTO;
+
+ /* Minimul initialization of 86960. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Disable all interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0 );
+
+ /*
+ * That's all. C-NET(PC)C occupies 16 I/O addresses.
+ *
+ * Some PC cards (e.g., TDK and Contec) have 16 I/O addresses,
+ * while some others (e.g., Fujitsu) have 32. Fortunately,
+ * this generic driver never accesses latter 16 ports in 32
+ * ports cards. So, we can assume the *generic* PC cards
+ * always have 16 ports.
+ *
+ * Moreover, PC card probe is isolated from ISA probe, and PC
+ * card probe routine doesn't use "# of ports" returned by this
+ * function. 16 v.s. 32 is not important now.
+ */
+ return 16;
+}
+#endif /* NCARD > 0 */
+
+/*
+ * Install interface into kernel networking data structures
+ */
+static int
+fe_attach ( DEVICE * dev )
+{
+#if NCARD > 0
+ static int already_ifattach[NFE];
+#endif
+ struct fe_softc *sc = &fe_softc[dev->id_unit];
+
+ /*
+ * Initialize ifnet structure
+ */
+ sc->sc_if.if_softc = sc;
+ sc->sc_if.if_unit = sc->sc_unit;
+ sc->sc_if.if_name = "fe";
+ sc->sc_if.if_output = ether_output;
+ sc->sc_if.if_start = fe_start;
+ sc->sc_if.if_ioctl = fe_ioctl;
+ sc->sc_if.if_watchdog = fe_watchdog;
+
+ /*
+ * Set default interface flags.
+ */
+ sc->sc_if.if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+
+ /*
+ * Set maximum size of output queue, if it has not been set.
+ * It is done here as this driver may be started after the
+ * system initialization (i.e., the interface is PCMCIA.)
+ *
+ * I'm not sure this is really necessary, but, even if it is,
+ * it should be done somewhere else, e.g., in if_attach(),
+ * since it must be a common workaround for all network drivers.
+ * FIXME.
+ */
+ if ( sc->sc_if.if_snd.ifq_maxlen == 0 ) {
+ sc->sc_if.if_snd.ifq_maxlen = ifqmaxlen;
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "attach()" );
+#endif
+
+#if FE_SINGLE_TRANSMISSION
+ /* Override txb config to allocate minimum. */
+ sc->proto_dlcr6 &= ~FE_D6_TXBSIZ
+ sc->proto_dlcr6 |= FE_D6_TXBSIZ_2x2KB;
+#endif
+
+ /* Modify hardware config if it is requested. */
+ if ( dev->id_flags & FE_FLAGS_OVERRIDE_DLCR6 ) {
+ sc->proto_dlcr6 = dev->id_flags & FE_FLAGS_DLCR6_VALUE;
+ }
+
+ /* Find TX buffer size, based on the hardware dependent proto. */
+ switch ( sc->proto_dlcr6 & FE_D6_TXBSIZ ) {
+ case FE_D6_TXBSIZ_2x2KB: sc->txb_size = 2048; break;
+ case FE_D6_TXBSIZ_2x4KB: sc->txb_size = 4096; break;
+ case FE_D6_TXBSIZ_2x8KB: sc->txb_size = 8192; break;
+ default:
+ /* Oops, we can't work with single buffer configuration. */
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: strange TXBSIZ config; fixing\n",
+ sc->sc_unit );
+#endif
+ sc->proto_dlcr6 &= ~FE_D6_TXBSIZ;
+ sc->proto_dlcr6 |= FE_D6_TXBSIZ_2x2KB;
+ sc->txb_size = 2048;
+ break;
+ }
+
+ /* Attach and stop the interface. */
+#if NCARD > 0
+ if (already_ifattach[dev->id_unit] != 1) {
+ if_attach(&sc->sc_if);
+ already_ifattach[dev->id_unit] = 1;
+ }
+#else
+ if_attach(&sc->sc_if);
+#endif
+ fe_stop(sc->sc_unit); /* This changes the state to IDLE. */
+ ether_ifattach(&sc->sc_if);
+
+ /* Print additional info when attached. */
+ printf( "fe%d: address %6D, type %s\n", sc->sc_unit,
+ sc->sc_enaddr, ":" , sc->typestr );
+#if FE_DEBUG >= 3
+ {
+ int buf, txb, bbw, sbw, ram;
+
+ buf = txb = bbw = sbw = ram = -1;
+ switch ( sc->proto_dlcr6 & FE_D6_BUFSIZ ) {
+ case FE_D6_BUFSIZ_8KB: buf = 8; break;
+ case FE_D6_BUFSIZ_16KB: buf = 16; break;
+ case FE_D6_BUFSIZ_32KB: buf = 32; break;
+ case FE_D6_BUFSIZ_64KB: buf = 64; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_TXBSIZ ) {
+ case FE_D6_TXBSIZ_2x2KB: txb = 2; break;
+ case FE_D6_TXBSIZ_2x4KB: txb = 4; break;
+ case FE_D6_TXBSIZ_2x8KB: txb = 8; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_BBW ) {
+ case FE_D6_BBW_BYTE: bbw = 8; break;
+ case FE_D6_BBW_WORD: bbw = 16; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_SBW ) {
+ case FE_D6_SBW_BYTE: sbw = 8; break;
+ case FE_D6_SBW_WORD: sbw = 16; break;
+ }
+ switch ( sc->proto_dlcr6 & FE_D6_SRAM ) {
+ case FE_D6_SRAM_100ns: ram = 100; break;
+ case FE_D6_SRAM_150ns: ram = 150; break;
+ }
+ printf( "fe%d: SRAM %dKB %dbit %dns, TXB %dKBx2, %dbit I/O\n",
+ sc->sc_unit, buf, bbw, ram, txb, sbw );
+ }
+#endif
+
+#if NBPFILTER > 0
+ /* If BPF is in the kernel, call the attach for it. */
+ bpfattach( &sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
+#endif
+ return 1;
+}
+
+/*
+ * Reset interface.
+ */
+static void
+fe_reset ( int unit )
+{
+ /*
+ * Stop interface and re-initialize.
+ */
+ fe_stop(unit);
+ fe_init(unit);
+}
+
+/*
+ * Stop everything on the interface.
+ *
+ * All buffered packets, both transmitting and receiving,
+ * if any, will be lost by stopping the interface.
+ */
+static void
+fe_stop ( int unit )
+{
+ struct fe_softc *sc = &fe_softc[unit];
+ int s;
+
+ s = splimp();
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "stop()" );
+#endif
+
+ /* Disable interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0x00 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0x00 );
+
+ /* Stop interface hardware. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Clear all interrupt status. */
+ outb( sc->ioaddr[ FE_DLCR0 ], 0xFF );
+ outb( sc->ioaddr[ FE_DLCR1 ], 0xFF );
+
+ /* Put the chip in stand-by mode. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR7 ], sc->proto_dlcr7 | FE_D7_POWER_DOWN );
+ DELAY( 200 );
+
+ /* Reset transmitter variables and interface flags. */
+ sc->sc_if.if_flags &= ~( IFF_OACTIVE | IFF_RUNNING );
+ sc->sc_if.if_timer = 0;
+ sc->txb_free = sc->txb_size;
+ sc->txb_count = 0;
+ sc->txb_sched = 0;
+
+ /* MAR loading can be delayed. */
+ sc->filter_change = 0;
+
+ /* Update config status also. */
+
+ /* Call a hook. */
+ if ( sc->stop ) sc->stop( sc );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "end of stop()" );
+#endif
+
+ (void) splx(s);
+}
+
+/*
+ * Device timeout/watchdog routine. Entered if the device neglects to
+ * generate an interrupt after a transmit has been started on it.
+ */
+static void
+fe_watchdog ( struct ifnet *ifp )
+{
+ struct fe_softc *sc = (struct fe_softc *)ifp;
+
+#if FE_DEBUG >= 1
+ /* A "debug" message. */
+ log( LOG_ERR, "fe%d: transmission timeout (%d+%d)%s\n",
+ ifp->if_unit, sc->txb_sched, sc->txb_count,
+ ( ifp->if_flags & IFF_UP ) ? "" : " when down" );
+ if ( sc->sc_if.if_opackets == 0 && sc->sc_if.if_ipackets == 0 ) {
+ log( LOG_WARNING, "fe%d: wrong IRQ setting in config?\n",
+ ifp->if_unit );
+ }
+#endif
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /* Record how many packets are lost by this accident. */
+ ifp->if_oerrors += sc->txb_sched + sc->txb_count;
+
+ /* Put the interface into known initial state. */
+ if ( ifp->if_flags & IFF_UP ) {
+ fe_reset( ifp->if_unit );
+ } else {
+ fe_stop( ifp->if_unit );
+ }
+}
+
+/*
+ * Initialize device.
+ */
+static void
+fe_init ( int unit )
+{
+ struct fe_softc *sc = &fe_softc[unit];
+ int s;
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init()" );
+#endif
+
+ /* We need an address. */
+ if (TAILQ_EMPTY(&sc->sc_if.if_addrhead)) { /* XXX unlikely */
+#if FE_DEBUG >= 1
+ log( LOG_ERR, "fe%d: init() without any address\n",
+ sc->sc_unit );
+#endif
+ return;
+ }
+
+#if FE_DEBUG >= 1
+ /*
+ * Make sure we have a valid station address.
+ * The following test is applicable for any Ethernet interfaces.
+ * It can be done in somewhere common to all of them. FIXME.
+ */
+ if ( ( sc->sc_enaddr[ 0 ] & 0x01 ) != 0
+ || ( sc->sc_enaddr[ 0 ] == 0x00
+ && sc->sc_enaddr[ 1 ] == 0x00
+ && sc->sc_enaddr[ 2 ] == 0x00 ) ) {
+ log( LOG_ERR, "fe%d: invalid station address (%6D)\n",
+ sc->sc_unit, sc->sc_enaddr, ":" );
+ return;
+ }
+#endif
+
+ /* Start initializing 86960. */
+ s = splimp();
+
+ /* Call a hook. */
+ if ( sc->init ) sc->init( sc );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after init hook" );
+#endif
+
+ /*
+ * Make sure to disable the chip, also.
+ * This may also help re-programming the chip after
+ * hot insertion of PCMCIAs.
+ */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Power up the chip and select register bank for DLCRs. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_DLCR | FE_D7_POWER_UP );
+ DELAY( 200 );
+
+ /* Feed the station address. */
+ outblk( sc, FE_DLCR8, sc->sc_enaddr, ETHER_ADDR_LEN );
+
+ /* Clear multicast address filter to receive nothing. */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_MAR | FE_D7_POWER_UP );
+ outblk( sc, FE_MAR8, fe_filter_nothing.data, FE_FILTER_LEN );
+
+ /* Select the BMPR bank for runtime register access. */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_BMPR | FE_D7_POWER_UP );
+
+ /* Initialize registers. */
+ outb( sc->ioaddr[ FE_DLCR0 ], 0xFF ); /* Clear all bits. */
+ outb( sc->ioaddr[ FE_DLCR1 ], 0xFF ); /* ditto. */
+ outb( sc->ioaddr[ FE_DLCR2 ], 0x00 );
+ outb( sc->ioaddr[ FE_DLCR3 ], 0x00 );
+ outb( sc->ioaddr[ FE_DLCR4 ], sc->proto_dlcr4 );
+ outb( sc->ioaddr[ FE_DLCR5 ], sc->proto_dlcr5 );
+ outb( sc->ioaddr[ FE_BMPR10 ], 0x00 );
+ outb( sc->ioaddr[ FE_BMPR11 ], FE_B11_CTRL_SKIP | FE_B11_MODE1 );
+ outb( sc->ioaddr[ FE_BMPR12 ], 0x00 );
+ outb( sc->ioaddr[ FE_BMPR13 ], sc->proto_bmpr13 );
+ outb( sc->ioaddr[ FE_BMPR14 ], 0x00 );
+ outb( sc->ioaddr[ FE_BMPR15 ], 0x00 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just before enabling DLC" );
+#endif
+
+ /* Enable interrupts. */
+ outb( sc->ioaddr[ FE_DLCR2 ], FE_TMASK );
+ outb( sc->ioaddr[ FE_DLCR3 ], FE_RMASK );
+
+ /* Enable transmitter and receiver. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_ENABLE );
+ DELAY( 200 );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "just after enabling DLC" );
+#endif
+
+ /*
+ * Make sure to empty the receive buffer.
+ *
+ * This may be redundant, but *if* the receive buffer were full
+ * at this point, then the driver would hang. I have experienced
+ * some strange hang-up just after UP. I hope the following
+ * code solve the problem.
+ *
+ * I have changed the order of hardware initialization.
+ * I think the receive buffer cannot have any packets at this
+ * point in this version. The following code *must* be
+ * redundant now. FIXME.
+ *
+ * I've heard a rumore that on some PC card implementation of
+ * 8696x, the receive buffer can have some data at this point.
+ * The following message helps discovering the fact. FIXME.
+ */
+ if ( !( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) ) {
+ log( LOG_WARNING,
+ "fe%d: receive buffer has some data after reset\n",
+ sc->sc_unit );
+
+ fe_emptybuffer( sc );
+ }
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after ERB loop" );
+#endif
+
+ /* Do we need this here? Actually, no. I must be paranoia. */
+ outb( sc->ioaddr[ FE_DLCR0 ], 0xFF ); /* Clear all bits. */
+ outb( sc->ioaddr[ FE_DLCR1 ], 0xFF ); /* ditto. */
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after FIXME" );
+#endif
+ /* Set 'running' flag, because we are now running. */
+ sc->sc_if.if_flags |= IFF_RUNNING;
+
+ /*
+ * At this point, the interface is running properly,
+ * except that it receives *no* packets. we then call
+ * fe_setmode() to tell the chip what packets to be
+ * received, based on the if_flags and multicast group
+ * list. It completes the initialization process.
+ */
+ fe_setmode( sc );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "after setmode" );
+#endif
+
+ /* ...and attempt to start output queued packets. */
+ fe_start( &sc->sc_if );
+
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, "init() done" );
+#endif
+
+ (void) splx(s);
+}
+
+/*
+ * This routine actually starts the transmission on the interface
+ */
+static void
+fe_xmit ( struct fe_softc * sc )
+{
+ /*
+ * Set a timer just in case we never hear from the board again.
+ * We use longer timeout for multiple packet transmission.
+ * I'm not sure this timer value is appropriate. FIXME.
+ */
+ sc->sc_if.if_timer = 1 + sc->txb_count;
+
+ /* Update txb variables. */
+ sc->txb_sched = sc->txb_count;
+ sc->txb_count = 0;
+ sc->txb_free = sc->txb_size;
+ sc->tx_excolls = 0;
+
+ /* Start transmitter, passing packets in TX buffer. */
+ outb( sc->ioaddr[ FE_BMPR10 ], sc->txb_sched | FE_B10_START );
+}
+
+/*
+ * Start output on interface.
+ * We make two assumptions here:
+ * 1) that the current priority is set to splimp _before_ this code
+ * is called *and* is returned to the appropriate priority after
+ * return
+ * 2) that the IFF_OACTIVE flag is checked before this code is called
+ * (i.e. that the output part of the interface is idle)
+ */
+void
+fe_start ( struct ifnet *ifp )
+{
+ struct fe_softc *sc = ifp->if_softc;
+ struct mbuf *m;
+
+#if FE_DEBUG >= 1
+ /* Just a sanity check. */
+ if ( ( sc->txb_count == 0 ) != ( sc->txb_free == sc->txb_size ) ) {
+ /*
+ * Txb_count and txb_free co-works to manage the
+ * transmission buffer. Txb_count keeps track of the
+ * used potion of the buffer, while txb_free does unused
+ * potion. So, as long as the driver runs properly,
+ * txb_count is zero if and only if txb_free is same
+ * as txb_size (which represents whole buffer.)
+ */
+ log( LOG_ERR, "fe%d: inconsistent txb variables (%d, %d)\n",
+ sc->sc_unit, sc->txb_count, sc->txb_free );
+ /*
+ * So, what should I do, then?
+ *
+ * We now know txb_count and txb_free contradicts. We
+ * cannot, however, tell which is wrong. More
+ * over, we cannot peek 86960 transmission buffer or
+ * reset the transmission buffer. (In fact, we can
+ * reset the entire interface. I don't want to do it.)
+ *
+ * If txb_count is incorrect, leaving it as-is will cause
+ * sending of garbage after next interrupt. We have to
+ * avoid it. Hence, we reset the txb_count here. If
+ * txb_free was incorrect, resetting txb_count just loose
+ * some packets. We can live with it.
+ */
+ sc->txb_count = 0;
+ }
+#endif
+
+#if FE_DEBUG >= 1
+ /*
+ * First, see if there are buffered packets and an idle
+ * transmitter - should never happen at this point.
+ */
+ if ( ( sc->txb_count > 0 ) && ( sc->txb_sched == 0 ) ) {
+ log( LOG_ERR,
+ "fe%d: transmitter idle with %d buffered packets\n",
+ sc->sc_unit, sc->txb_count );
+ fe_xmit( sc );
+ }
+#endif
+
+ /*
+ * Stop accepting more transmission packets temporarily, when
+ * a filter change request is delayed. Updating the MARs on
+ * 86960 flushes the transmission buffer, so it is delayed
+ * until all buffered transmission packets have been sent
+ * out.
+ */
+ if ( sc->filter_change ) {
+ /*
+ * Filter change request is delayed only when the DLC is
+ * working. DLC soon raise an interrupt after finishing
+ * the work.
+ */
+ goto indicate_active;
+ }
+
+ for (;;) {
+
+ /*
+ * See if there is room to put another packet in the buffer.
+ * We *could* do better job by peeking the send queue to
+ * know the length of the next packet. Current version just
+ * tests against the worst case (i.e., longest packet). FIXME.
+ *
+ * When adding the packet-peek feature, don't forget adding a
+ * test on txb_count against QUEUEING_MAX.
+ * There is a little chance the packet count exceeds
+ * the limit. Assume transmission buffer is 8KB (2x8KB
+ * configuration) and an application sends a bunch of small
+ * (i.e., minimum packet sized) packets rapidly. An 8KB
+ * buffer can hold 130 blocks of 62 bytes long...
+ */
+ if ( sc->txb_free
+ < ETHER_MAX_LEN - ETHER_CRC_LEN + FE_DATA_LEN_LEN ) {
+ /* No room. */
+ goto indicate_active;
+ }
+
+#if FE_SINGLE_TRANSMISSION
+ if ( sc->txb_count > 0 ) {
+ /* Just one packet per a transmission buffer. */
+ goto indicate_active;
+ }
+#endif
+
+ /*
+ * Get the next mbuf chain for a packet to send.
+ */
+ IF_DEQUEUE( &sc->sc_if.if_snd, m );
+ if ( m == NULL ) {
+ /* No more packets to send. */
+ goto indicate_inactive;
+ }
+
+ /*
+ * Copy the mbuf chain into the transmission buffer.
+ * txb_* variables are updated as necessary.
+ */
+ fe_write_mbufs( sc, m );
+
+ /* Start transmitter if it's idle. */
+ if ( ( sc->txb_count > 0 ) && ( sc->txb_sched == 0 ) ) {
+ fe_xmit( sc );
+ }
+
+ /*
+ * Tap off here if there is a bpf listener,
+ * and the device is *not* in promiscuous mode.
+ * (86960 receives self-generated packets if
+ * and only if it is in "receive everything"
+ * mode.)
+ */
+#if NBPFILTER > 0
+ if ( sc->sc_if.if_bpf
+ && !( sc->sc_if.if_flags & IFF_PROMISC ) ) {
+ bpf_mtap( &sc->sc_if, m );
+ }
+#endif
+
+ m_freem( m );
+ }
+
+ indicate_inactive:
+ /*
+ * We are using the !OACTIVE flag to indicate to
+ * the outside world that we can accept an
+ * additional packet rather than that the
+ * transmitter is _actually_ active. Indeed, the
+ * transmitter may be active, but if we haven't
+ * filled all the buffers with data then we still
+ * want to accept more.
+ */
+ sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ return;
+
+ indicate_active:
+ /*
+ * The transmitter is active, and there are no room for
+ * more outgoing packets in the transmission buffer.
+ */
+ sc->sc_if.if_flags |= IFF_OACTIVE;
+ return;
+}
+
+/*
+ * Drop (skip) a packet from receive buffer in 86960 memory.
+ */
+static void
+fe_droppacket ( struct fe_softc * sc, int len )
+{
+ int i;
+
+ /*
+ * 86960 manual says that we have to read 8 bytes from the buffer
+ * before skip the packets and that there must be more than 8 bytes
+ * remaining in the buffer when issue a skip command.
+ * Remember, we have already read 4 bytes before come here.
+ */
+ if ( len > 12 ) {
+ /* Read 4 more bytes, and skip the rest of the packet. */
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ outb( sc->ioaddr[ FE_BMPR14 ], sc->proto_bmpr14 | FE_B14_SKIP );
+ } else {
+ /* We should not come here unless receiving RUNTs. */
+ for ( i = 0; i < len; i += 2 ) {
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ }
+ }
+}
+
+/*
+ * Empty receiving buffer.
+ */
+static void
+fe_emptybuffer ( struct fe_softc * sc )
+{
+ int i;
+ u_char saved_dlcr5;
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: emptying receive buffer\n", sc->sc_unit );
+#endif
+ /*
+ * Stop receiving packets, temporarily.
+ */
+ saved_dlcr5 = inb( sc->ioaddr[ FE_DLCR5 ] );
+ outb( sc->ioaddr[ FE_DLCR5 ], sc->proto_dlcr5 );
+ DELAY(1300);
+
+ /*
+ * When we come here, the receive buffer management should
+ * have been broken. So, we cannot use skip operation.
+ * Just discard everything in the buffer.
+ */
+ for (i = 0; i < 32768; i++) {
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
+ ( void )inw( sc->ioaddr[ FE_BMPR8 ] );
+ }
+
+ /*
+ * Double check.
+ */
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) {
+ log( LOG_ERR, "fe%d: could not empty receive buffer\n",
+ sc->sc_unit );
+ /* Hmm. What should I do if this happens? FIXME. */
+ }
+
+ /*
+ * Restart receiving packets.
+ */
+ outb( sc->ioaddr[ FE_DLCR5 ], saved_dlcr5 );
+}
+
+/*
+ * Transmission interrupt handler
+ * The control flow of this function looks silly. FIXME.
+ */
+static void
+fe_tint ( struct fe_softc * sc, u_char tstat )
+{
+ int left;
+ int col;
+
+ /*
+ * Handle "excessive collision" interrupt.
+ */
+ if ( tstat & FE_D0_COLL16 ) {
+
+ /*
+ * Find how many packets (including this collided one)
+ * are left unsent in transmission buffer.
+ */
+ left = inb( sc->ioaddr[ FE_BMPR10 ] );
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "fe%d: excessive collision (%d/%d)\n",
+ sc->sc_unit, left, sc->txb_sched );
+#endif
+#if FE_DEBUG >= 3
+ fe_dump( LOG_INFO, sc, NULL );
+#endif
+
+ /*
+ * Clear the collision flag (in 86960) here
+ * to avoid confusing statistics.
+ */
+ outb( sc->ioaddr[ FE_DLCR0 ], FE_D0_COLLID );
+
+ /*
+ * Restart transmitter, skipping the
+ * collided packet.
+ *
+ * We *must* skip the packet to keep network running
+ * properly. Excessive collision error is an
+ * indication of the network overload. If we
+ * tried sending the same packet after excessive
+ * collision, the network would be filled with
+ * out-of-time packets. Packets belonging
+ * to reliable transport (such as TCP) are resent
+ * by some upper layer.
+ */
+ outb( sc->ioaddr[ FE_BMPR11 ],
+ FE_B11_CTRL_SKIP | FE_B11_MODE1 );
+
+ /* Update statistics. */
+ sc->tx_excolls++;
+ }
+
+ /*
+ * Handle "transmission complete" interrupt.
+ */
+ if ( tstat & FE_D0_TXDONE ) {
+
+ /*
+ * Add in total number of collisions on last
+ * transmission. We also clear "collision occurred" flag
+ * here.
+ *
+ * 86960 has a design flaw on collision count on multiple
+ * packet transmission. When we send two or more packets
+ * with one start command (that's what we do when the
+ * transmission queue is crowded), 86960 informs us number
+ * of collisions occurred on the last packet on the
+ * transmission only. Number of collisions on previous
+ * packets are lost. I have told that the fact is clearly
+ * stated in the Fujitsu document.
+ *
+ * I considered not to mind it seriously. Collision
+ * count is not so important, anyway. Any comments? FIXME.
+ */
+
+ if ( inb( sc->ioaddr[ FE_DLCR0 ] ) & FE_D0_COLLID ) {
+
+ /* Clear collision flag. */
+ outb( sc->ioaddr[ FE_DLCR0 ], FE_D0_COLLID );
+
+ /* Extract collision count from 86960. */
+ col = inb( sc->ioaddr[ FE_DLCR4 ] );
+ col = ( col & FE_D4_COL ) >> FE_D4_COL_SHIFT;
+ if ( col == 0 ) {
+ /*
+ * Status register indicates collisions,
+ * while the collision count is zero.
+ * This can happen after multiple packet
+ * transmission, indicating that one or more
+ * previous packet(s) had been collided.
+ *
+ * Since the accurate number of collisions
+ * has been lost, we just guess it as 1;
+ * Am I too optimistic? FIXME.
+ */
+ col = 1;
+ }
+ sc->sc_if.if_collisions += col;
+#if FE_DEBUG >= 3
+ log( LOG_WARNING, "fe%d: %d collision(s) (%d)\n",
+ sc->sc_unit, col, sc->txb_sched );
+#endif
+ }
+
+ /*
+ * Update transmission statistics.
+ * Be sure to reflect number of excessive collisions.
+ */
+ sc->sc_if.if_opackets += sc->txb_sched - sc->tx_excolls;
+ sc->sc_if.if_oerrors += sc->tx_excolls;
+ sc->sc_if.if_collisions += sc->tx_excolls * 16;
+ sc->txb_sched = 0;
+
+ /*
+ * The transmitter is no more active.
+ * Reset output active flag and watchdog timer.
+ */
+ sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ sc->sc_if.if_timer = 0;
+
+ /*
+ * If more data is ready to transmit in the buffer, start
+ * transmitting them. Otherwise keep transmitter idle,
+ * even if more data is queued. This gives receive
+ * process a slight priority.
+ */
+ if ( sc->txb_count > 0 ) fe_xmit( sc );
+ }
+}
+
+/*
+ * Ethernet interface receiver interrupt.
+ */
+static void
+fe_rint ( struct fe_softc * sc, u_char rstat )
+{
+ u_short len;
+ u_char status;
+ int i;
+
+ /*
+ * Update statistics if this interrupt is caused by an error.
+ */
+ if ( rstat & ( FE_D1_OVRFLO | FE_D1_CRCERR
+ | FE_D1_ALGERR | FE_D1_SRTPKT ) ) {
+#if FE_DEBUG >= 2
+ log( LOG_WARNING,
+ "fe%d: receive error: %s%s%s%s(%02x)\n",
+ sc->sc_unit,
+ rstat & FE_D1_OVRFLO ? "OVR " : "",
+ rstat & FE_D1_CRCERR ? "CRC " : "",
+ rstat & FE_D1_ALGERR ? "ALG " : "",
+ rstat & FE_D1_SRTPKT ? "LEN " : "",
+ rstat );
+#endif
+ sc->sc_if.if_ierrors++;
+ }
+
+ /*
+ * MB86960 has a flag indicating "receive queue empty."
+ * We just loop, checking the flag, to pull out all received
+ * packets.
+ *
+ * We limit the number of iterations to avoid infinite-loop.
+ * The upper bound is set to unrealistic high value.
+ */
+ for (i = 0; i < FE_MAX_RECV_COUNT * 2; i++) {
+
+ /* Stop the iteration if 86960 indicates no packets. */
+ if ( inb( sc->ioaddr[ FE_DLCR5 ] ) & FE_D5_BUFEMP ) break;
+
+ /*
+ * Extract A receive status byte.
+ * As our 86960 is in 16 bit bus access mode, we have to
+ * use inw() to get the status byte. The significant
+ * value is returned in lower 8 bits.
+ */
+ status = ( u_char )inw( sc->ioaddr[ FE_BMPR8 ] );
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: receive status = %04x\n",
+ sc->sc_unit, status );
+#endif
+
+ /*
+ * Extract the packet length.
+ * It is a sum of a header (14 bytes) and a payload.
+ * CRC has been stripped off by the 86960.
+ */
+ len = inw( sc->ioaddr[ FE_BMPR8 ] );
+
+#if FE_DEBUG >= 1
+ /*
+ * If there was an error with the received packet, it
+ * must be an indication of out-of-sync on receive
+ * buffer, because we have programmed the 8696x to
+ * to discard errored packets, even when the interface
+ * is in promiscuous mode. We have to re-synchronize.
+ */
+ if (!(status & FE_RPH_GOOD)) {
+ log(LOG_ERR,
+ "fe%d: corrupted receive status byte (%02x)\n",
+ sc->arpcom.ac_if.if_unit, status);
+ sc->arpcom.ac_if.if_ierrors++;
+ fe_emptybuffer( sc );
+ break;
+ }
+#endif
+
+#if FE_DEBUG >= 1
+ /*
+ * MB86960 checks the packet length and drop big packet
+ * before passing it to us. There are no chance we can
+ * get big packets through it, even if they are actually
+ * sent over a line. Hence, if the length exceeds
+ * the specified limit, it means some serious failure,
+ * such as out-of-sync on receive buffer management.
+ *
+ * Same for short packets, since we have programmed
+ * 86960 to drop short packets.
+ */
+ if ( len > ETHER_MAX_LEN - ETHER_CRC_LEN
+ || len < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
+ log( LOG_WARNING,
+ "fe%d: received a %s packet? (%u bytes)\n",
+ sc->sc_unit,
+ len < ETHER_MIN_LEN - ETHER_CRC_LEN
+ ? "partial" : "big",
+ len );
+ sc->sc_if.if_ierrors++;
+ fe_emptybuffer( sc );
+ break;
+ }
+#endif
+
+ /*
+ * Go get a packet.
+ */
+ if ( fe_get_packet( sc, len ) < 0 ) {
+
+#if FE_DEBUG >= 2
+ log( LOG_WARNING, "%s%d: out of mbuf;"
+ " dropping a packet (%u bytes)\n",
+ sc->sc_unit, len );
+#endif
+
+ /* Skip a packet, updating statistics. */
+ sc->sc_if.if_ierrors++;
+ fe_droppacket( sc, len );
+
+ /*
+ * Try extracting other packets, although they will
+ * cause out-of-mbuf error again. This is required
+ * to keep receiver interrupt comming.
+ * (Earlier versions had a bug on this point.)
+ */
+ continue;
+ }
+
+ /* Successfully received a packet. Update stat. */
+ sc->sc_if.if_ipackets++;
+ }
+}
+
+/*
+ * Ethernet interface interrupt processor
+ */
+void
+feintr ( int unit )
+{
+ struct fe_softc *sc = &fe_softc[unit];
+ u_char tstat, rstat;
+
+ /*
+ * Loop until there are no more new interrupt conditions.
+ */
+ for (;;) {
+
+#if FE_DEBUG >= 4
+ fe_dump( LOG_INFO, sc, "intr()" );
+#endif
+
+ /*
+ * Get interrupt conditions, masking unneeded flags.
+ */
+ tstat = inb( sc->ioaddr[ FE_DLCR0 ] ) & FE_TMASK;
+ rstat = inb( sc->ioaddr[ FE_DLCR1 ] ) & FE_RMASK;
+
+#if FE_DEBUG >= 1
+ /* Test for a "dead-lock" condition. */
+ if ((rstat & FE_D1_PKTRDY) == 0
+ && (inb(sc->ioaddr[FE_DLCR5]) & FE_D5_BUFEMP) == 0
+ && (inb(sc->ioaddr[FE_DLCR1]) & FE_D1_PKTRDY) == 0) {
+ /*
+ * PKTRDY is off, while receive buffer is not empty.
+ * We did a double check to avoid a race condition...
+ * So, we should have missed an interrupt.
+ */
+ log(LOG_WARNING,
+ "fe%d: missed a receiver interrupt?\n",
+ sc->arpcom.ac_if.if_unit);
+ /* Simulate the missed interrupt condition. */
+ rstat |= FE_D1_PKTRDY;
+ }
+#endif
+
+ /* Stop processing if there are no interrupts to handle. */
+ if ( tstat == 0 && rstat == 0 ) break;
+
+ /*
+ * Reset the conditions we are acknowledging.
+ */
+ outb( sc->ioaddr[ FE_DLCR0 ], tstat );
+ outb( sc->ioaddr[ FE_DLCR1 ], rstat );
+
+ /*
+ * Handle transmitter interrupts. Handle these first because
+ * the receiver will reset the board under some conditions.
+ */
+ if ( tstat ) {
+ fe_tint( sc, tstat );
+ }
+
+ /*
+ * Handle receiver interrupts
+ */
+ if ( rstat ) {
+ fe_rint( sc, rstat );
+ }
+
+ /*
+ * Update the multicast address filter if it is
+ * needed and possible. We do it now, because
+ * we can make sure the transmission buffer is empty,
+ * and there is a good chance that the receive queue
+ * is empty. It will minimize the possibility of
+ * packet loss.
+ */
+ if ( sc->filter_change
+ && sc->txb_count == 0 && sc->txb_sched == 0 ) {
+ fe_loadmar(sc);
+ sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ }
+
+ /*
+ * If it looks like the transmitter can take more data,
+ * attempt to start output on the interface. This is done
+ * after handling the receiver interrupt to give the
+ * receive operation priority.
+ *
+ * BTW, I'm not sure in what case the OACTIVE is on at
+ * this point. Is the following test redundant?
+ *
+ * No. This routine polls for both transmitter and
+ * receiver interrupts. 86960 can raise a receiver
+ * interrupt when the transmission buffer is full.
+ */
+ if ( ( sc->sc_if.if_flags & IFF_OACTIVE ) == 0 ) {
+ fe_start( &sc->sc_if );
+ }
+
+ }
+}
+
+/*
+ * Process an ioctl request. This code needs some work - it looks
+ * pretty ugly.
+ */
+static int
+fe_ioctl ( struct ifnet * ifp, u_long command, caddr_t data )
+{
+ struct fe_softc *sc = ifp->if_softc;
+ int s, error = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: ioctl(%x)\n", sc->sc_unit, command );
+#endif
+
+ s = splimp();
+
+ switch (command) {
+
+ case SIOCSIFADDR:
+ {
+ struct ifaddr * ifa = ( struct ifaddr * )data;
+
+ sc->sc_if.if_flags |= IFF_UP;
+
+ switch (ifa->ifa_addr->sa_family) {
+#ifdef INET
+ case AF_INET:
+ fe_init( sc->sc_unit ); /* before arp_ifinit */
+ arp_ifinit( &sc->arpcom, ifa );
+ break;
+#endif
+#ifdef IPX
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_IPX:
+ {
+ register struct ipx_addr *ina
+ = &(IA_SIPX(ifa)->sipx_addr);
+
+ if (ipx_nullhost(*ina))
+ ina->x_host =
+ *(union ipx_host *) (sc->sc_enaddr); else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+#ifdef INET6
+ case AF_INET6:
+ /* IPV6 added by shin 96.2.6 */
+ fe_init(sc->sc_unit);
+ ndp6_ifinit(&sc->arpcom, ifa);
+ break;
+#endif
+#ifdef NS
+
+ /*
+ * XXX - This code is probably wrong
+ */
+ case AF_NS:
+ {
+ register struct ns_addr *ina
+ = &(IA_SNS(ifa)->sns_addr);
+
+ if (ns_nullhost(*ina))
+ ina->x_host =
+ *(union ns_host *) (sc->sc_enaddr);
+ else {
+ bcopy((caddr_t) ina->x_host.c_host,
+ (caddr_t) sc->sc_enaddr,
+ sizeof(sc->sc_enaddr));
+ }
+
+ /*
+ * Set new address
+ */
+ fe_init(sc->sc_unit);
+ break;
+ }
+#endif
+ default:
+ fe_init( sc->sc_unit );
+ break;
+ }
+ break;
+ }
+
+#ifdef SIOCGIFADDR
+ case SIOCGIFADDR:
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+ struct sockaddr * sa = ( struct sockaddr * )&ifr->ifr_data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)sa->sa_data, ETHER_ADDR_LEN);
+ break;
+ }
+#endif
+
+#ifdef SIOCGIFPHYSADDR
+ case SIOCGIFPHYSADDR:
+ {
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)sc->sc_enaddr,
+ (caddr_t)&ifr->ifr_data, ETHER_ADDR_LEN);
+ break;
+ }
+#endif
+
+#ifdef notdef
+#ifdef SIOCSIFPHYSADDR
+ case SIOCSIFPHYSADDR:
+ {
+ /*
+ * Set the physical (Ethernet) address of the interface.
+ * When and by whom is this command used? FIXME.
+ */
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ bcopy((caddr_t)&ifr->ifr_data,
+ (caddr_t)sc->sc_enaddr, ETHER_ADDR_LEN);
+ fe_setlinkaddr( sc );
+ break;
+ }
+#endif
+#endif /* notdef */
+
+#ifdef SIOCSIFFLAGS
+ case SIOCSIFFLAGS:
+ {
+ /*
+ * Switch interface state between "running" and
+ * "stopped", reflecting the UP flag.
+ */
+ if ( sc->sc_if.if_flags & IFF_UP ) {
+ if ( ( sc->sc_if.if_flags & IFF_RUNNING ) == 0 ) {
+ fe_init( sc->sc_unit );
+ }
+ } else {
+ if ( ( sc->sc_if.if_flags & IFF_RUNNING ) != 0 ) {
+ fe_stop( sc->sc_unit );
+ }
+ }
+
+ /*
+ * Promiscuous and/or multicast flags may have changed,
+ * so reprogram the multicast filter and/or receive mode.
+ */
+ fe_setmode( sc );
+
+#if FE_DEBUG >= 1
+ /* "ifconfig fe0 debug" to print register dump. */
+ if ( sc->sc_if.if_flags & IFF_DEBUG ) {
+ fe_dump( LOG_DEBUG, sc, "SIOCSIFFLAGS(DEBUG)" );
+ }
+#endif
+ break;
+ }
+#endif
+
+#ifdef SIOCADDMULTI
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ /*
+ * Multicast list has changed; set the hardware filter
+ * accordingly.
+ */
+ fe_setmode( sc );
+ error = 0;
+ break;
+#endif
+
+#ifdef SIOCSIFMTU
+ case SIOCSIFMTU:
+ {
+ /*
+ * Set the interface MTU.
+ */
+ struct ifreq * ifr = ( struct ifreq * )data;
+
+ if ( ifr->ifr_mtu > ETHERMTU ) {
+ error = EINVAL;
+ } else {
+ sc->sc_if.if_mtu = ifr->ifr_mtu;
+ }
+ break;
+ }
+#endif
+
+ default:
+ error = EINVAL;
+ }
+
+ (void) splx(s);
+ return (error);
+}
+
+/*
+ * Retrieve packet from receive buffer and send to the next level up via
+ * ether_input(). If there is a BPF listener, give a copy to BPF, too.
+ * Returns 0 if success, -1 if error (i.e., mbuf allocation failure).
+ */
+static int
+fe_get_packet ( struct fe_softc * sc, u_short len )
+{
+ struct ether_header *eh;
+ struct mbuf *m;
+
+ /*
+ * NFS wants the data be aligned to the word (4 byte)
+ * boundary. Ethernet header has 14 bytes. There is a
+ * 2-byte gap.
+ */
+#define NFS_MAGIC_OFFSET 2
+
+ /*
+ * This function assumes that an Ethernet packet fits in an
+ * mbuf (with a cluster attached when necessary.) On FreeBSD
+ * 2.0 for x86, which is the primary target of this driver, an
+ * mbuf cluster has 4096 bytes, and we are happy. On ancient
+ * BSDs, such as vanilla 4.3 for 386, a cluster size was 1024,
+ * however. If the following #error message were printed upon
+ * compile, you need to rewrite this function.
+ */
+#if ( MCLBYTES < ETHER_MAX_LEN - ETHER_CRC_LEN + NFS_MAGIC_OFFSET )
+#error "Too small MCLBYTES to use fe driver."
+#endif
+
+ /*
+ * Our strategy has one more problem. There is a policy on
+ * mbuf cluster allocation. It says that we must have at
+ * least MINCLSIZE (208 bytes on FreeBSD 2.0 for x86) to
+ * allocate a cluster. For a packet of a size between
+ * (MHLEN - 2) to (MINCLSIZE - 2), our code violates the rule...
+ * On the other hand, the current code is short, simple,
+ * and fast, however. It does no harmful thing, just waists
+ * some memory. Any comments? FIXME.
+ */
+
+ /* Allocate an mbuf with packet header info. */
+ MGETHDR(m, M_DONTWAIT, MT_DATA);
+ if ( m == NULL ) return -1;
+
+ /* Attach a cluster if this packet doesn't fit in a normal mbuf. */
+ if ( len > MHLEN - NFS_MAGIC_OFFSET ) {
+ MCLGET( m, M_DONTWAIT );
+ if ( !( m->m_flags & M_EXT ) ) {
+ m_freem( m );
+ return -1;
+ }
+ }
+
+ /* Initialize packet header info. */
+ m->m_pkthdr.rcvif = &sc->sc_if;
+ m->m_pkthdr.len = len;
+
+ /* Set the length of this packet. */
+ m->m_len = len;
+
+ /* The following silliness is to make NFS happy */
+ m->m_data += NFS_MAGIC_OFFSET;
+
+ /* Get a packet. */
+ insw( sc->ioaddr[ FE_BMPR8 ], m->m_data, ( len + 1 ) >> 1 );
+
+ /* Get (actually just point to) the header part. */
+ eh = mtod( m, struct ether_header *);
+
+#define ETHER_ADDR_IS_MULTICAST(A) (*(char *)(A) & 1)
+
+#if NBPFILTER > 0
+ /*
+ * Check if there's a BPF listener on this interface.
+ * If it is, hand off the raw packet to bpf.
+ */
+ if ( sc->sc_if.if_bpf ) {
+ bpf_mtap( &sc->sc_if, m );
+ }
+#endif
+
+ /*
+ * Make sure this packet is (or may be) directed to us.
+ * That is, the packet is either unicasted to our address,
+ * or broad/multi-casted. If any other packets are
+ * received, it is an indication of an error -- probably
+ * 86960 is in a wrong operation mode.
+ * Promiscuous mode is an exception. Under the mode, all
+ * packets on the media must be received. (We must have
+ * programmed the 86960 so.)
+ */
+
+ if ( ( sc->sc_if.if_flags & IFF_PROMISC )
+ && !ETHER_ADDR_IS_MULTICAST( eh->ether_dhost )
+ && bcmp( eh->ether_dhost, sc->sc_enaddr, ETHER_ADDR_LEN ) != 0 ) {
+ /*
+ * The packet was not for us. This is normal since
+ * we are now in promiscuous mode. Just drop the packet.
+ */
+ m_freem( m );
+ return 0;
+ }
+
+#if FE_DEBUG >= 3
+ if ( !ETHER_ADDR_IS_MULTICAST( eh->ether_dhost )
+ && bcmp( eh->ether_dhost, sc->sc_enaddr, ETHER_ADDR_LEN ) != 0 ) {
+ /*
+ * This packet was not for us. We can't be in promiscuous
+ * mode since the case was handled by above test.
+ * We found an error (of this driver.)
+ */
+ log( LOG_WARNING,
+ "fe%d: got an unwanted packet, dst = %6D\n",
+ sc->sc_unit, eh->ether_dhost , ":" );
+ m_freem( m );
+ return 0;
+ }
+#endif
+
+ /* Strip off the Ethernet header. */
+ m->m_pkthdr.len -= sizeof ( struct ether_header );
+ m->m_len -= sizeof ( struct ether_header );
+ m->m_data += sizeof ( struct ether_header );
+
+ /* Feed the packet to upper layer. */
+ ether_input( &sc->sc_if, eh, m );
+ return 0;
+}
+
+/*
+ * Write an mbuf chain to the transmission buffer memory using 16 bit PIO.
+ * Returns number of bytes actually written, including length word.
+ *
+ * If an mbuf chain is too long for an Ethernet frame, it is not sent.
+ * Packets shorter than Ethernet minimum are legal, and we pad them
+ * before sending out. An exception is "partial" packets which are
+ * shorter than mandatory Ethernet header.
+ */
+static void
+fe_write_mbufs ( struct fe_softc *sc, struct mbuf *m )
+{
+ u_short addr_bmpr8 = sc->ioaddr[ FE_BMPR8 ];
+ u_short length, len;
+ struct mbuf *mp;
+ u_char *data;
+ u_short savebyte; /* WARNING: Architecture dependent! */
+#define NO_PENDING_BYTE 0xFFFF
+
+ static u_char padding [ ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_HDR_LEN ];
+
+#if FE_DEBUG >= 1
+ /* First, count up the total number of bytes to copy */
+ length = 0;
+ for ( mp = m; mp != NULL; mp = mp->m_next ) {
+ length += mp->m_len;
+ }
+#else
+ /* Just use the length value in the packet header. */
+ length = m->m_pkthdr.len;
+#endif
+
+#if FE_DEBUG >= 2
+ /* Check if this matches the one in the packet header. */
+ if ( length != m->m_pkthdr.len ) {
+ log( LOG_WARNING, "fe%d: packet length mismatch? (%d/%d)\n",
+ sc->sc_unit, length, m->m_pkthdr.len );
+ }
+#endif
+
+#if FE_DEBUG >= 1
+ /*
+ * Should never send big packets. If such a packet is passed,
+ * it should be a bug of upper layer. We just ignore it.
+ * ... Partial (too short) packets, neither.
+ */
+ if ( length < ETHER_HDR_LEN
+ || length > ETHER_MAX_LEN - ETHER_CRC_LEN ) {
+ log( LOG_ERR,
+ "fe%d: got an out-of-spec packet (%u bytes) to send\n",
+ sc->sc_unit, length );
+ sc->sc_if.if_oerrors++;
+ return;
+ }
+#endif
+
+ /*
+ * Put the length word for this frame.
+ * Does 86960 accept odd length? -- Yes.
+ * Do we need to pad the length to minimum size by ourselves?
+ * -- Generally yes. But for (or will be) the last
+ * packet in the transmission buffer, we can skip the
+ * padding process. It may gain performance slightly. FIXME.
+ */
+ outw( addr_bmpr8, max( length, ETHER_MIN_LEN - ETHER_CRC_LEN ) );
+
+ /*
+ * Update buffer status now.
+ * Truncate the length up to an even number, since we use outw().
+ */
+ length = ( length + 1 ) & ~1;
+ sc->txb_free -= FE_DATA_LEN_LEN + max( length, ETHER_MIN_LEN - ETHER_CRC_LEN);
+ sc->txb_count++;
+
+ /*
+ * Transfer the data from mbuf chain to the transmission buffer.
+ * MB86960 seems to require that data be transferred as words, and
+ * only words. So that we require some extra code to patch
+ * over odd-length mbufs.
+ */
+ savebyte = NO_PENDING_BYTE;
+ for ( mp = m; mp != 0; mp = mp->m_next ) {
+
+ /* Ignore empty mbuf. */
+ len = mp->m_len;
+ if ( len == 0 ) continue;
+
+ /* Find the actual data to send. */
+ data = mtod(mp, caddr_t);
+
+ /* Finish the last byte. */
+ if ( savebyte != NO_PENDING_BYTE ) {
+ outw( addr_bmpr8, savebyte | ( *data << 8 ) );
+ data++;
+ len--;
+ savebyte = NO_PENDING_BYTE;
+ }
+
+ /* output contiguous words */
+ if (len > 1) {
+ outsw( addr_bmpr8, data, len >> 1);
+ data += len & ~1;
+ len &= 1;
+ }
+
+ /* Save a remaining byte, if there is one. */
+ if ( len > 0 ) {
+ savebyte = *data;
+ }
+ }
+
+ /* Spit the last byte, if the length is odd. */
+ if ( savebyte != NO_PENDING_BYTE ) {
+ outw( addr_bmpr8, savebyte );
+ }
+
+ /* Pad to the Ethernet minimum length, if the packet is too short. */
+ if ( length < ETHER_MIN_LEN - ETHER_CRC_LEN ) {
+ outsw( addr_bmpr8, padding, ( ETHER_MIN_LEN - ETHER_CRC_LEN - length ) >> 1);
+ }
+}
+
+/*
+ * Compute hash value for an Ethernet address
+ */
+static int
+fe_hash ( u_char * ep )
+{
+#define FE_HASH_MAGIC_NUMBER 0xEDB88320L
+
+ u_long hash = 0xFFFFFFFFL;
+ int i, j;
+ u_char b;
+ u_long m;
+
+ for ( i = ETHER_ADDR_LEN; --i >= 0; ) {
+ b = *ep++;
+ for ( j = 8; --j >= 0; ) {
+ m = hash;
+ hash >>= 1;
+ if ( ( m ^ b ) & 1 ) hash ^= FE_HASH_MAGIC_NUMBER;
+ b >>= 1;
+ }
+ }
+ return ( ( int )( hash >> 26 ) );
+}
+
+/*
+ * Compute the multicast address filter from the
+ * list of multicast addresses we need to listen to.
+ */
+static struct fe_filter
+fe_mcaf ( struct fe_softc *sc )
+{
+ int index;
+ struct fe_filter filter;
+ struct ifmultiaddr *ifma;
+
+ filter = fe_filter_nothing;
+ for (ifma = sc->arpcom.ac_if.if_multiaddrs.lh_first; ifma;
+ ifma = ifma->ifma_link.le_next) {
+ if (ifma->ifma_addr->sa_family != AF_LINK)
+ continue;
+ index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: hash(%6D) == %d\n",
+ sc->sc_unit, enm->enm_addrlo , ":", index );
+#endif
+
+ filter.data[index >> 3] |= 1 << (index & 7);
+ }
+ return ( filter );
+}
+
+/*
+ * Calculate a new "multicast packet filter" and put the 86960
+ * receiver in appropriate mode.
+ */
+static void
+fe_setmode ( struct fe_softc *sc )
+{
+ int flags = sc->sc_if.if_flags;
+
+ /*
+ * If the interface is not running, we postpone the update
+ * process for receive modes and multicast address filter
+ * until the interface is restarted. It reduces some
+ * complicated job on maintaining chip states. (Earlier versions
+ * of this driver had a bug on that point...)
+ *
+ * To complete the trick, fe_init() calls fe_setmode() after
+ * restarting the interface.
+ */
+ if ( !( flags & IFF_RUNNING ) ) return;
+
+ /*
+ * Promiscuous mode is handled separately.
+ */
+ if ( flags & IFF_PROMISC ) {
+ /*
+ * Program 86960 to receive all packets on the segment
+ * including those directed to other stations.
+ * Multicast filter stored in MARs are ignored
+ * under this setting, so we don't need to update it.
+ *
+ * Promiscuous mode in FreeBSD 2 is used solely by
+ * BPF, and BPF only listens to valid (no error) packets.
+ * So, we ignore erroneous ones even in this mode.
+ * (Older versions of fe driver mistook the point.)
+ */
+ outb( sc->ioaddr[ FE_DLCR5 ],
+ sc->proto_dlcr5 | FE_D5_AFM0 | FE_D5_AFM1 );
+ sc->filter_change = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: promiscuous mode\n", sc->sc_unit );
+#endif
+ return;
+ }
+
+ /*
+ * Turn the chip to the normal (non-promiscuous) mode.
+ */
+ outb( sc->ioaddr[ FE_DLCR5 ], sc->proto_dlcr5 | FE_D5_AFM1 );
+
+ /*
+ * Find the new multicast filter value.
+ * I'm not sure we have to handle modes other than MULTICAST.
+ * Who sets ALLMULTI? Who turns MULTICAST off? FIXME.
+ */
+ if ( flags & IFF_ALLMULTI ) {
+ sc->filter = fe_filter_all;
+ } else if ( flags & IFF_MULTICAST ) {
+ sc->filter = fe_mcaf( sc );
+ } else {
+ sc->filter = fe_filter_nothing;
+ }
+ sc->filter_change = 1;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter: [%8D]\n",
+ sc->sc_unit, sc->filter.data, " " );
+#endif
+
+ /*
+ * We have to update the multicast filter in the 86960, A.S.A.P.
+ *
+ * Note that the DLC (Data Link Control unit, i.e. transmitter
+ * and receiver) must be stopped when feeding the filter, and
+ * DLC trashes all packets in both transmission and receive
+ * buffers when stopped.
+ *
+ * ... Are the above sentences correct? I have to check the
+ * manual of the MB86960A. FIXME.
+ *
+ * To reduce the packet loss, we delay the filter update
+ * process until buffers are empty.
+ */
+ if ( sc->txb_sched == 0 && sc->txb_count == 0
+ && !( inb( sc->ioaddr[ FE_DLCR1 ] ) & FE_D1_PKTRDY ) ) {
+ /*
+ * Buffers are (apparently) empty. Load
+ * the new filter value into MARs now.
+ */
+ fe_loadmar(sc);
+ } else {
+ /*
+ * Buffers are not empty. Mark that we have to update
+ * the MARs. The new filter will be loaded by feintr()
+ * later.
+ */
+#if FE_DEBUG >= 4
+ log( LOG_INFO, "fe%d: filter change delayed\n", sc->sc_unit );
+#endif
+ }
+}
+
+/*
+ * Load a new multicast address filter into MARs.
+ *
+ * The caller must have splimp'ed before fe_loadmar.
+ * This function starts the DLC upon return. So it can be called only
+ * when the chip is working, i.e., from the driver's point of view, when
+ * a device is RUNNING. (I mistook the point in previous versions.)
+ */
+static void
+fe_loadmar ( struct fe_softc * sc )
+{
+ /* Stop the DLC (transmitter and receiver). */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_DISABLE );
+ DELAY( 200 );
+
+ /* Select register bank 1 for MARs. */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_MAR | FE_D7_POWER_UP );
+
+ /* Copy filter value into the registers. */
+ outblk( sc, FE_MAR8, sc->filter.data, FE_FILTER_LEN );
+
+ /* Restore the bank selection for BMPRs (i.e., runtime registers). */
+ outb( sc->ioaddr[ FE_DLCR7 ],
+ sc->proto_dlcr7 | FE_D7_RBS_BMPR | FE_D7_POWER_UP );
+
+ /* Restart the DLC. */
+ DELAY( 200 );
+ outb( sc->ioaddr[ FE_DLCR6 ], sc->proto_dlcr6 | FE_D6_DLC_ENABLE );
+ DELAY( 200 );
+
+ /* We have just updated the filter. */
+ sc->filter_change = 0;
+
+#if FE_DEBUG >= 3
+ log( LOG_INFO, "fe%d: address filter changed\n", sc->sc_unit );
+#endif
+}
+
+#if FE_DEBUG >= 1
+static void
+fe_dump ( int level, struct fe_softc * sc, char * message )
+{
+ log( level, "fe%d: %s,"
+ " DLCR = %02x %02x %02x %02x %02x %02x %02x %02x,"
+ " BMPR = xx xx %02x %02x %02x %02x %02x %02x,"
+ " asic = %02x %02x %02x %02x %02x %02x %02x %02x"
+ " + %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ sc->sc_unit, message ? message : "registers",
+ inb( sc->ioaddr[ FE_DLCR0 ] ), inb( sc->ioaddr[ FE_DLCR1 ] ),
+ inb( sc->ioaddr[ FE_DLCR2 ] ), inb( sc->ioaddr[ FE_DLCR3 ] ),
+ inb( sc->ioaddr[ FE_DLCR4 ] ), inb( sc->ioaddr[ FE_DLCR5 ] ),
+ inb( sc->ioaddr[ FE_DLCR6 ] ), inb( sc->ioaddr[ FE_DLCR7 ] ),
+ inb( sc->ioaddr[ FE_BMPR10 ] ), inb( sc->ioaddr[ FE_BMPR11 ] ),
+ inb( sc->ioaddr[ FE_BMPR12 ] ), inb( sc->ioaddr[ FE_BMPR13 ] ),
+ inb( sc->ioaddr[ FE_BMPR14 ] ), inb( sc->ioaddr[ FE_BMPR15 ] ),
+ inb( sc->ioaddr[ 0x10 ] ), inb( sc->ioaddr[ 0x11 ] ),
+ inb( sc->ioaddr[ 0x12 ] ), inb( sc->ioaddr[ 0x13 ] ),
+ inb( sc->ioaddr[ 0x14 ] ), inb( sc->ioaddr[ 0x15 ] ),
+ inb( sc->ioaddr[ 0x16 ] ), inb( sc->ioaddr[ 0x17 ] ),
+ inb( sc->ioaddr[ 0x18 ] ), inb( sc->ioaddr[ 0x19 ] ),
+ inb( sc->ioaddr[ 0x1A ] ), inb( sc->ioaddr[ 0x1B ] ),
+ inb( sc->ioaddr[ 0x1C ] ), inb( sc->ioaddr[ 0x1D ] ),
+ inb( sc->ioaddr[ 0x1E ] ), inb( sc->ioaddr[ 0x1F ] ) );
+}
+#endif
diff --git a/sys/pc98/pc98/lpt.c b/sys/pc98/pc98/lpt.c
index 856974f65f840..1fac3d86e58c4 100644
--- a/sys/pc98/pc98/lpt.c
+++ b/sys/pc98/pc98/lpt.c
@@ -46,7 +46,7 @@
* SUCH DAMAGE.
*
* from: unknown origin, 386BSD 0.1
- * $Id: lpt.c,v 1.23 1998/10/22 05:58:45 bde Exp $
+ * $Id: lpt.c,v 1.21 1998/06/17 16:33:14 kato Exp $
*/
/*
@@ -195,12 +195,9 @@
#ifndef DEBUG
-#define lprintf(args)
+#define lprintf (void)
#else
-#define lprintf(args) do { \
- if (lptflag) \
- printf args; \
- } while (0)
+#define lprintf if (lptflag) printf
static int volatile lptflag = 1;
#endif
@@ -272,7 +269,6 @@ static struct lpt_softc {
static timeout_t lptout;
static int lptprobe (struct isa_device *dvp);
static int lptattach (struct isa_device *isdp);
-static ointhand2_t lptintr;
#ifdef INET
@@ -328,8 +324,8 @@ lpt_port_test (int port, u_char data, u_char mask)
temp = inb(port) & mask;
}
while (temp != data && --timeout);
- lprintf(("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
- port, data, temp, timeout));
+ lprintf("Port 0x%x\tout=%x\tin=%x\ttout=%d\n",
+ port, data, temp, timeout);
return (temp == data);
}
@@ -441,7 +437,6 @@ lptattach(struct isa_device *isdp)
struct lpt_softc *sc;
int unit;
- isdp->id_ointr = lptintr;
unit = isdp->id_unit;
sc = lpt_sc + unit;
sc->sc_port = isdp->id_iobase;
@@ -457,7 +452,7 @@ lptattach(struct isa_device *isdp)
#endif
/* check if we can use interrupt */
- lprintf(("oldirq %x\n", sc->sc_irq));
+ lprintf("oldirq %x\n", sc->sc_irq);
if (isdp->id_irq) {
sc->sc_irq = LP_HAS_IRQ | LP_USE_IRQ | LP_ENABLE_IRQ;
printf("lpt%d: Interrupt-driven port\n", unit);
@@ -466,9 +461,9 @@ lptattach(struct isa_device *isdp)
#endif
} else {
sc->sc_irq = 0;
- lprintf(("lpt%d: Polled port\n", unit));
+ lprintf("lpt%d: Polled port\n", unit);
}
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
#ifdef DEVFS
/* XXX what to do about the flags in the minor number? */
@@ -506,7 +501,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
#endif
if (sc->sc_state) {
- lprintf(("lp: still open %x\n", sc->sc_state));
+ lprintf("lp: still open %x\n", sc->sc_state);
return(EBUSY);
} else
sc->sc_state |= INIT;
@@ -520,7 +515,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
}
s = spltty();
- lprintf(("lp flags 0x%x\n", sc->sc_flags));
+ lprintf("lp flags 0x%x\n", sc->sc_flags);
port = sc->sc_port;
/* set IRQ status according to ENABLE_IRQ flag */
@@ -548,7 +543,7 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
if (trys++ >= LPINITRDY*4) {
splx(s);
sc->sc_state = 0;
- lprintf(("status %x\n", inb(port+lpt_status)));
+ lprintf ("status %x\n", inb(port+lpt_status) );
return (EBUSY);
}
@@ -581,14 +576,14 @@ lptopen (dev_t dev, int flags, int fmt, struct proc *p)
splx(s);
/* only use timeout if using interrupt */
- lprintf(("irq %x\n", sc->sc_irq));
+ lprintf("irq %x\n", sc->sc_irq);
if (sc->sc_irq & LP_USE_IRQ) {
sc->sc_state |= TOUT;
timeout (lptout, (caddr_t)sc,
(sc->sc_backoff = hz/LPTOUTINITIAL));
}
- lprintf(("opened.\n"));
+ lprintf("opened.\n");
return(0);
}
@@ -598,7 +593,7 @@ lptout (void *arg)
struct lpt_softc *sc = arg;
int pl;
- lprintf(("T %x ", inb(sc->sc_port+lpt_status)));
+ lprintf ("T %x ", inb(sc->sc_port+lpt_status));
if (sc->sc_state & OPEN) {
sc->sc_backoff++;
if (sc->sc_backoff > hz/LPTOUTMAX)
@@ -657,7 +652,7 @@ lptclose(dev_t dev, int flags, int fmt, struct proc *p)
end_close:
sc->sc_state = 0;
sc->sc_xfercnt = 0;
- lprintf(("closed.\n"));
+ lprintf("closed.\n");
return(0);
}
@@ -676,7 +671,7 @@ pushbytes(struct lpt_softc * sc)
char ch;
int port = sc->sc_port;
- lprintf(("p"));
+ lprintf("p");
/* loop for every character .. */
while (sc->sc_xfercnt > 0) {
/* printer data */
@@ -754,16 +749,16 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
uiomove(sc->sc_cp, n, uio);
sc->sc_xfercnt = n ;
while ((sc->sc_xfercnt > 0)&&(sc->sc_irq & LP_USE_IRQ)) {
- lprintf(("i"));
+ lprintf("i");
/* if the printer is ready for a char, */
/* give it one */
if ((sc->sc_state & OBUSY) == 0){
- lprintf(("\nC %d. ", sc->sc_xfercnt));
+ lprintf("\nC %d. ", sc->sc_xfercnt);
pl = spltty();
lptintr(sc - lpt_sc);
(void) splx(pl);
}
- lprintf(("W "));
+ lprintf("W ");
if (sc->sc_state & OBUSY)
if ((err = tsleep ((caddr_t)sc,
LPPRI|PCATCH, "lpwrite", 0))) {
@@ -773,7 +768,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
}
/* check to see if we must do a polled write */
if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
- lprintf(("p"));
+ lprintf("p");
if((err = pushbytes(sc)))
return(err);
}
@@ -788,7 +783,7 @@ lptwrite(dev_t dev, struct uio * uio, int ioflag)
* do checking for interrupted write call.
*/
-static void
+void
lptintr(int unit)
{
struct lpt_softc *sc = lpt_sc + unit;
@@ -819,7 +814,7 @@ lptintr(int unit)
if (sc->sc_xfercnt) {
/* send char */
- /*lprintf(("%x ", *sc->sc_cp)); */
+ /*lprintf("%x ", *sc->sc_cp); */
outb(port+lpt_data, *sc->sc_cp++) ;
outb(port+lpt_control, sc->sc_control|LPC_STB);
/* DELAY(X) */
@@ -836,7 +831,7 @@ lptintr(int unit)
sc->sc_state &= ~OBUSY;
if(!(sc->sc_state & INTERRUPTED))
wakeup((caddr_t)sc);
- lprintf(("w "));
+ lprintf("w ");
return;
} else { /* check for error */
if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
@@ -845,7 +840,7 @@ lptintr(int unit)
/* lptout() will jump in and try to restart. */
}
#endif
- lprintf(("sts %x ", sts));
+ lprintf("sts %x ", sts);
}
static int
@@ -1032,7 +1027,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
break;
default:
- lprintf(("LP:ioctl(0x%lx)\n", cmd));
+ lprintf("LP:ioctl(0x%lx)\n", cmd);
return EINVAL;
}
return 0;
@@ -1129,7 +1124,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1178,7 +1173,7 @@ lpintr (int unit)
sc->sc_iferrs = 0;
if (IF_QFULL(&ipintrq)) {
- lprintf(("DROP"));
+ lprintf("DROP");
IF_DROP(&ipintrq);
goto done;
}
@@ -1200,7 +1195,7 @@ lpintr (int unit)
err:
outb(lpt_data_port, 0);
- lprintf(("R"));
+ lprintf("R");
sc->sc_if.if_ierrors++;
sc->sc_iferrs++;
@@ -1266,7 +1261,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (ifp->if_flags & IFF_LINK0) {
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1326,7 +1321,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
nend:
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1335,7 +1330,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (!(inb(lpt_stat_port) & CLPIP_SHAKE)) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
(void) splx(s);
@@ -1343,7 +1338,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
}
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("&"));
+ lprintf("&");
lptintr(ifp->if_unit);
}
@@ -1368,7 +1363,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
if (err) { /* if we didn't timeout... */
ifp->if_oerrors++;
- lprintf(("X"));
+ lprintf("X");
} else {
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -1396,7 +1391,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
m_freem(m);
if (inb(lpt_stat_port) & LPIP_SHAKE) {
- lprintf(("^"));
+ lprintf("^");
lptintr(ifp->if_unit);
}
diff --git a/sys/pc98/pc98/mse.c b/sys/pc98/pc98/mse.c
index e5bcc4439bf81..65a8aa5bc858a 100644
--- a/sys/pc98/pc98/mse.c
+++ b/sys/pc98/pc98/mse.c
@@ -11,7 +11,7 @@
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * $Id: mse.c,v 1.17 1998/06/08 08:55:44 kato Exp $
+ * $Id: mse.c,v 1.16 1998/01/24 02:54:38 eivind Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -88,7 +88,6 @@ static struct cdevsw mse_cdevsw =
mseioctl, nostop, nullreset, nodevtotty,/* mse */
msepoll, nommap, NULL, "mse", NULL, -1 };
-static ointhand2_t mseintr;
/*
* Software control structure for mouse. The sc_enablemouse(),
@@ -322,7 +321,6 @@ mseattach(idp)
}
#endif
- idp->id_ointr = mseintr;
sc->sc_port = idp->id_iobase;
sc->mode.accelfactor = (idp->id_flags & MSE_CONFIG_ACCEL) >> 4;
#ifdef DEVFS
@@ -612,7 +610,7 @@ msepoll(dev, events, p)
/*
* mseintr: update mouse status. sc_deltax and sc_deltay are accumulative.
*/
-static void
+void
mseintr(unit)
int unit;
{
diff --git a/sys/pc98/pc98/npx.c b/sys/pc98/pc98/npx.c
index 03077ddfb5659..504fd3cf506ed 100644
--- a/sys/pc98/pc98/npx.c
+++ b/sys/pc98/pc98/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.41 1998/12/17 08:41:34 kato Exp $
+ * $Id: npx.c,v 1.37 1998/05/04 07:33:32 kato Exp $
*/
#include "npx.h"
@@ -59,7 +59,9 @@
#include <machine/cputypes.h>
#include <machine/frame.h>
#include <machine/ipl.h>
+#ifndef SMP
#include <machine/md_var.h>
+#endif
#include <machine/pcb.h>
#include <machine/psl.h>
#ifndef SMP
@@ -89,7 +91,15 @@
#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2)
/* XXX - should be in header file. */
-ointhand2_t npxintr;
+extern void (*bcopy_vector) __P((const void *from, void *to, size_t len));
+extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len));
+extern int (*copyin_vector) __P((const void *udaddr, void *kaddr, size_t len));
+extern int (*copyout_vector) __P((const void *kaddr, void *udaddr, size_t len));
+
+void i586_bcopy __P((const void *from, void *to, size_t len));
+void i586_bzero __P((void *buf, size_t len));
+int i586_copyin __P((const void *udaddr, void *kaddr, size_t len));
+int i586_copyout __P((const void *kaddr, void *udaddr, size_t len));
#ifdef __GNUC__
@@ -140,17 +150,15 @@ SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint,
CTLFLAG_RD, &hw_float, 0,
"Floatingpoint instructions executed in hardware");
-#ifndef SMP
-static u_int npx0_imask = SWI_CLOCK_MASK;
-static struct gate_descriptor npx_idt_probeintr;
-static int npx_intrno;
-static volatile u_int npx_intrs_while_probing;
-static volatile u_int npx_traps_while_probing;
-#endif
+static u_int npx0_imask = SWI_CLOCK_MASK;
static bool_t npx_ex16;
static bool_t npx_exists;
+static struct gate_descriptor npx_idt_probeintr;
+static int npx_intrno;
+static volatile u_int npx_intrs_while_probing;
static bool_t npx_irq13;
+static volatile u_int npx_traps_while_probing;
#ifndef SMP
/*
@@ -270,10 +278,8 @@ static int
npxprobe1(dvp)
struct isa_device *dvp;
{
-#ifndef SMP
u_short control;
u_short status;
-#endif
/*
* Partially reset the coprocessor, if any. Some BIOS's don't reset
@@ -421,8 +427,6 @@ int
npxattach(dvp)
struct isa_device *dvp;
{
- dvp->id_ointr = npxintr;
-
/* The caller has printed "irq 13" for the npx_irq13 case. */
if (!npx_irq13) {
printf("npx%d: ", dvp->id_unit);
diff --git a/sys/pc98/pc98/pc98.c b/sys/pc98/pc98/pc98.c
index a3c9bc36c214d..185c34906674f 100644
--- a/sys/pc98/pc98/pc98.c
+++ b/sys/pc98/pc98/pc98.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: pc98.c,v 1.54 1998/10/22 05:58:45 bde Exp $
+ * $Id: pc98.c,v 1.52 1998/10/12 15:06:02 kato Exp $
*/
/*
@@ -535,7 +535,7 @@ config_isadev_c(isdp, mp, reconfig)
printf("%s%d", dp->name, isdp->id_unit);
if (id_alive != -1) {
if (isdp->id_iobase == -1)
- printf(" at");
+ printf(" at ?");
else {
printf(" at 0x%x", isdp->id_iobase);
if (isdp->id_iobase + id_alive - 1 !=
@@ -583,10 +583,7 @@ config_isadev_c(isdp, mp, reconfig)
isdp->id_alive = id_alive;
}
(*dp->attach)(isdp);
- if (isdp->id_irq != 0 && isdp->id_intr == NULL)
- printf("%s%d: irq with no handler\n",
- dp->name, isdp->id_unit);
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
#ifdef APIC_IO
/*
* Some motherboards use upper IRQs for traditional
@@ -623,7 +620,7 @@ config_isadev_c(isdp, mp, reconfig)
} else {
#if 0
/* This code has not been tested.... */
- if (isdp->id_irq != 0 && isdp->id_intr != NULL) {
+ if (isdp->id_irq) {
icu_unset(ffs(isdp->id_irq) - 1,
isdp->id_intr);
if (mp)
diff --git a/sys/pc98/pc98/pc98gdc.c b/sys/pc98/pc98/pc98gdc.c
deleted file mode 100644
index 076f9e7748826..0000000000000
--- a/sys/pc98/pc98/pc98gdc.c
+++ /dev/null
@@ -1,887 +0,0 @@
-/*
- * Copyright (c) 1999 FreeBSD(98) port team.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id$
- */
-
-#include "gdc.h"
-#include "opt_gdc.h"
-#include "opt_fb.h"
-#include "opt_syscons.h"
-
-#if NGDC > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bus.h>
-#include <sys/malloc.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <machine/console.h>
-#include <machine/md_var.h>
-#include <machine/pc/bios.h>
-
-#include <dev/fb/fbreg.h>
-
-#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_machdep.h>
-
-#include <i386/isa/isa_device.h>
-
-#define TEXT_GDC IO_GDC1 /* 0x60 */
-#define ROW 25
-#define COL 80
-
-#define DRIVER_NAME "gdc"
-
-/* cdev driver declaration */
-
-#define GDC_UNIT(dev) minor(dev)
-#define GDC_MKMINOR(unit) (unit)
-
-static int gdcprobe(struct isa_device *dev);
-static int gdc_attach(struct isa_device *dev);
-static void gdc_drvinit(void *unused);
-
-struct isa_driver gdcdriver = {
- gdcprobe,
- gdc_attach,
- DRIVER_NAME,
- 0,
-};
-
-typedef struct gdc_softc {
- video_adapter_t *adp;
-} gdc_softc_t;
-
-static int gdc_probe_unit(int unit, gdc_softc_t *sc, int flags);
-static int gdc_attach_unit(int unit, gdc_softc_t *sc, int flags);
-
-#define GDC_SOFTC(unit) (gdc_softc[unit])
-
-static gdc_softc_t *gdc_softc[NGDC];
-
-#if FB_INSTALL_CDEV
-
-static d_open_t gdcopen;
-static d_close_t gdcclose;
-static d_read_t gdcread;
-static d_ioctl_t gdcioctl;
-
-static struct cdevsw vga_cdevsw = {
- gdcopen, gdcclose, noread, nowrite, /* ?? */
- gdcioctl, nostop, nullreset, nodevtotty,
- seltrue, nommap, NULL, DRIVER_NAME,
- NULL, -1, nodump, nopsize,
-};
-
-#endif /* FB_INSTALL_CDEV */
-
-static int
-gdcprobe(struct isa_device *dev)
-{
- gdc_softc_t *sc;
- int error;
-
- if (dev->id_unit >= sizeof(gdc_softc)/sizeof(gdc_softc[0]))
- return 0;
- sc = gdc_softc[dev->id_unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return 0;
-
- error = gdc_probe_unit(dev->id_unit, sc, dev->id_flags);
- if (error) {
- gdc_softc[dev->id_unit] = NULL;
- free(sc, M_DEVBUF);
- return 0;
- }
-
- dev->id_iobase = sc->adp->va_io_base;
- dev->id_maddr = (caddr_t)BIOS_PADDRTOVADDR(sc->adp->va_mem_base);
- dev->id_msize = sc->adp->va_mem_size;
-
- return sc->adp->va_io_size;
-}
-
-static int
-gdc_attach(struct isa_device *dev)
-{
- gdc_softc_t *sc;
-
- if (dev->id_unit >= sizeof(gdc_softc)/sizeof(gdc_softc[0]))
- return 0;
- sc = gdc_softc[dev->id_unit];
- if (sc == NULL)
- return 0;
-
- return ((gdc_attach_unit(dev->id_unit, sc, dev->id_flags)) ? 0 : 1);
-}
-
-static int
-gdc_probe_unit(int unit, gdc_softc_t *sc, int flags)
-{
- video_switch_t *sw;
-
- bzero(sc, sizeof(*sc));
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return 0;
- return (*sw->probe)(unit, &sc->adp, NULL, flags);
-}
-
-static int
-gdc_attach_unit(int unit, gdc_softc_t *sc, int flags)
-{
- video_switch_t *sw;
- int error;
-
- sw = vid_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- error = (*sw->init)(unit, sc->adp, flags);
- if (error)
- return ENXIO;
-
-#ifdef FB_INSTALL_CDEV
- /* attach a virtual frame buffer device */
- error = fb_attach(makedev(0, GDC_MKMINOR(unit)), scp->adp,
- &vga_cdevsw);
- if (error)
- return error;
-#endif /* FB_INSTALL_CDEV */
-
- if (bootverbose)
- (*sw->diag)(sc->adp, bootverbose);
-
- return 0;
-}
-
-/* LOW-LEVEL */
-
-#include <machine/clock.h>
-
-#include <pc98/pc98/30line.h>
-
-#define TEXT_BUF_BASE 0x000a0000
-#define TEXT_BUF_SIZE 0x00008000
-#define GRAPHICS_BUF_BASE 0x000a8000
-#define GRAPHICS_BUF_SIZE 0x00040000
-#define VIDEO_BUF_BASE 0x000a0000
-#define VIDEO_BUF_SIZE 0x00048000
-
-#define probe_done(adp) ((adp)->va_flags & V_ADP_PROBED)
-#define init_done(adp) ((adp)->va_flags & V_ADP_INITIALIZED)
-#define config_done(adp) ((adp)->va_flags & V_ADP_REGISTERED)
-
-/*
- * NOTE: `va_window' should have a virtual address, but is initialized
- * with a physical address in the following table, they will be
- * converted at run-time.
- */
-static video_adapter_t adapter_init_value[] = {
- { 0,
- KD_PC98, "gdc", /* va_type, va_name */
- 0, 0, /* va_unit, va_minor */
- V_ADP_COLOR | V_ADP_MODECHANGE | V_ADP_BORDER,
- IO_GDC1, 16, TEXT_GDC, /* va_io*, XXX */
- VIDEO_BUF_BASE, VIDEO_BUF_SIZE, /* va_mem* */
- TEXT_BUF_BASE, TEXT_BUF_SIZE, TEXT_BUF_SIZE, /* va_window* */
- 0, 0, /* va_buffer, va_buffer_size */
- 0, M_PC98_80x25, 0, 0, /* va_*mode* */
- NULL },
-};
-
-static video_adapter_t biosadapter[1];
-
-/* video driver declarations */
-static int gdc_configure(int flags);
-static int gdc_nop(void);
-static vi_probe_t gdc_probe;
-static vi_init_t gdc_init;
-static vi_get_info_t gdc_get_info;
-static vi_query_mode_t gdc_query_mode;
-static vi_set_mode_t gdc_set_mode;
-static vi_set_border_t gdc_set_border;
-static vi_save_state_t gdc_save_state;
-static vi_load_state_t gdc_load_state;
-static vi_read_hw_cursor_t gdc_read_hw_cursor;
-static vi_set_hw_cursor_t gdc_set_hw_cursor;
-static vi_set_hw_cursor_shape_t gdc_set_hw_cursor_shape;
-static vi_mmap_t gdc_mmap;
-static vi_diag_t gdc_diag;
-
-static int gdc_err(video_adapter_t *adp, ...);
-
-static video_switch_t gdcvidsw = {
- gdc_probe,
- gdc_init,
- gdc_get_info,
- gdc_query_mode,
- gdc_set_mode,
- (vi_save_font_t *)gdc_err,
- (vi_load_font_t *)gdc_err,
- (vi_show_font_t *)gdc_err,
- (vi_save_palette_t *)gdc_err,
- (vi_load_palette_t *)gdc_err,
- gdc_set_border,
- gdc_save_state,
- gdc_load_state,
- (vi_set_win_org_t *)gdc_err,
- gdc_read_hw_cursor,
- gdc_set_hw_cursor,
- gdc_set_hw_cursor_shape,
- (vi_blank_display_t *)gdc_nop,
- gdc_mmap,
- gdc_diag,
-};
-
-VIDEO_DRIVER(gdc, gdcvidsw, gdc_configure);
-
-/* GDC BIOS standard video modes */
-#define EOT (-1)
-#define NA (-2)
-
-static video_info_t bios_vmode[] = {
- { M_PC98_80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1,
- TEXT_BUF_BASE, TEXT_BUF_SIZE, TEXT_BUF_SIZE, 0, 0 },
-#ifdef LINE30
- { M_PC98_80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1,
- TEXT_BUF_BASE, TEXT_BUF_SIZE, TEXT_BUF_SIZE, 0, 0 },
-#endif
- { EOT },
-};
-
-static int init_done = FALSE;
-
-/* local functions */
-static int map_gen_mode_num(int type, int color, int mode);
-static int probe_adapters(void);
-static void dump_buffer(u_char *buf, size_t len);
-
-#define prologue(adp, flag, err) \
- if (!init_done || !((adp)->va_flags & (flag))) \
- return (err)
-
-/* a backdoor for the console driver */
-static int
-gdc_configure(int flags)
-{
- probe_adapters();
- biosadapter[0].va_flags |= V_ADP_INITIALIZED;
- if (!config_done(&biosadapter[0])) {
- if (vid_register(&biosadapter[0]) < 0)
- return 1;
- biosadapter[0].va_flags |= V_ADP_REGISTERED;
- }
-
- return 1;
-}
-
-/* local subroutines */
-
-/* map a generic video mode to a known mode number */
-static int
-map_gen_mode_num(int type, int color, int mode)
-{
- static struct {
- int from;
- int to;
- } mode_map[] = {
- { M_TEXT_80x25, M_PC98_80x25, },
-#ifdef LINE30
- { M_TEXT_80x30, M_PC98_80x30, },
-#endif
- };
- int i;
-
- for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
- if (mode_map[i].from == mode)
- return mode_map[i].to;
- }
- return mode;
-}
-
-/* probe video adapters and return the number of detected adapters */
-static int
-probe_adapters(void)
-{
- video_info_t info;
-
- /* do this test only once */
- if (init_done)
- return 1;
- init_done = TRUE;
-
- biosadapter[0] = adapter_init_value[0];
- biosadapter[0].va_flags |= V_ADP_PROBED;
- biosadapter[0].va_mode =
- biosadapter[0].va_initial_mode = biosadapter[0].va_initial_bios_mode;
-
- master_gdc_wait_vsync();
- master_gdc_cmd(_GDC_START); /* text ON */
- gdc_wait_vsync();
- gdc_cmd(_GDC_STOP); /* graphics OFF */
-
- gdc_get_info(&biosadapter[0], biosadapter[0].va_initial_mode, &info);
- biosadapter[0].va_mode_flags = info.vi_flags;
- biosadapter[0].va_window = BIOS_PADDRTOVADDR(info.vi_window);
- biosadapter[0].va_window_size = info.vi_window_size;
- biosadapter[0].va_window_gran = info.vi_window_gran;
- biosadapter[0].va_buffer = 0;
- biosadapter[0].va_buffer_size = 0;
-
- return 1;
-}
-
-static void master_gdc_cmd(unsigned int cmd)
-{
- while ( (inb(IO_GDC1) & 2) != 0);
- outb(IO_GDC1+2, cmd);
-}
-
-static void master_gdc_prm(unsigned int pmtr)
-{
- while ( (inb(IO_GDC1) & 2) != 0);
- outb(IO_GDC1, pmtr);
-}
-
-static void master_gdc_word_prm(unsigned int wpmtr)
-{
- master_gdc_prm(wpmtr & 0x00ff);
- master_gdc_prm((wpmtr >> 8) & 0x00ff);
-}
-
-static void master_gdc_fifo_empty(void)
-{
- while ( (inb(IO_GDC1) & 4) == 0);
-}
-
-static void master_gdc_wait_vsync(void)
-{
- while ( (inb(IO_GDC1) & 0x20) != 0);
- while ( (inb(IO_GDC1) & 0x20) == 0);
-}
-
-static void gdc_cmd(unsigned int cmd)
-{
- while ( (inb(IO_GDC2) & 2) != 0);
- outb( IO_GDC2+2, cmd);
-}
-
-static void gdc_prm(unsigned int pmtr)
-{
- while ( (inb(IO_GDC2) & 2) != 0);
- outb( IO_GDC2, pmtr);
-}
-
-static void gdc_word_prm(unsigned int wpmtr)
-{
- gdc_prm(wpmtr & 0x00ff);
- gdc_prm((wpmtr >> 8) & 0x00ff);
-}
-
-static void gdc_fifo_empty(void)
-{
- while ( (inb(IO_GDC2) & 0x04) == 0);
-}
-
-static void gdc_wait_vsync(void)
-{
- while ( (inb(IO_GDC2) & 0x20) != 0);
- while ( (inb(IO_GDC2) & 0x20) == 0);
-}
-
-static int check_gdc_clock(void)
-{
- if ((inb(IO_SYSPORT) & 0x80) == 0){
- return _5MHZ;
- } else {
- return _2_5MHZ;
- }
-}
-
-static void initialize_gdc(unsigned int mode)
-{
- /* start 30line initialize */
- int m_mode,s_mode,gdc_clock;
- gdc_clock = check_gdc_clock();
-
- if (mode == T25_G400){
- m_mode = _25L;
- }else{
- m_mode = _30L;
- }
-
- s_mode = 2*mode+gdc_clock;
-
- gdc_INFO = m_mode;
-
- master_gdc_cmd(_GDC_RESET);
- master_gdc_cmd(_GDC_MASTER);
- gdc_cmd(_GDC_RESET);
- gdc_cmd(_GDC_SLAVE);
-
- /* GDC Master */
- master_gdc_cmd(_GDC_SYNC);
- master_gdc_prm(0x00); /* flush less */ /* text & graph */
- master_gdc_prm(master_param[m_mode][GDC_CR]);
- master_gdc_word_prm(((master_param[m_mode][GDC_HFP] << 10)
- + (master_param[m_mode][GDC_VS] << 5)
- + master_param[m_mode][GDC_HS]));
- master_gdc_prm(master_param[m_mode][GDC_HBP]);
- master_gdc_prm(master_param[m_mode][GDC_VFP]);
- master_gdc_word_prm(((master_param[m_mode][GDC_VBP] << 10)
- + (master_param[m_mode][GDC_LF])));
- master_gdc_fifo_empty();
- master_gdc_cmd(_GDC_PITCH);
- master_gdc_prm(MasterPCH);
- master_gdc_fifo_empty();
-
- /* GDC slave */
- gdc_cmd(_GDC_SYNC);
- gdc_prm(0x06);
- gdc_prm(slave_param[s_mode][GDC_CR]);
- gdc_word_prm((slave_param[s_mode][GDC_HFP] << 10)
- + (slave_param[s_mode][GDC_VS] << 5)
- + (slave_param[s_mode][GDC_HS]));
- gdc_prm(slave_param[s_mode][GDC_HBP]);
- gdc_prm(slave_param[s_mode][GDC_VFP]);
- gdc_word_prm((slave_param[s_mode][GDC_VBP] << 10)
- + (slave_param[s_mode][GDC_LF]));
- gdc_fifo_empty();
- gdc_cmd(_GDC_PITCH);
- gdc_prm(SlavePCH[gdc_clock]);
- gdc_fifo_empty();
-
- /* set Master GDC scroll param */
- master_gdc_wait_vsync();
- master_gdc_wait_vsync();
- master_gdc_wait_vsync();
- master_gdc_cmd(_GDC_SCROLL);
- master_gdc_word_prm(0);
- master_gdc_word_prm((master_param[m_mode][GDC_LF] << 4) | 0x0000);
- master_gdc_fifo_empty();
-
- /* set Slave GDC scroll param */
- gdc_wait_vsync();
- gdc_cmd(_GDC_SCROLL);
- gdc_word_prm(0);
- if (gdc_clock == _5MHZ){
- gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
- }else{
- gdc_word_prm(SlaveScrlLF[mode] << 4);
- }
- gdc_fifo_empty();
-
- gdc_word_prm(0);
- if (gdc_clock == _5MHZ){
- gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
- }else{
- gdc_word_prm(SlaveScrlLF[mode] << 4);
- }
- gdc_fifo_empty();
-
- /* sync start */
- gdc_cmd(_GDC_STOP);
-
- gdc_wait_vsync();
- gdc_wait_vsync();
- gdc_wait_vsync();
-
- master_gdc_cmd(_GDC_START);
-}
-
-/* entry points */
-
-static int
-gdc_nop(void)
-{
- return 0;
-}
-
-static int
-gdc_probe(int unit, video_adapter_t **adpp, void *arg, int flags)
-{
- probe_adapters();
- if (unit >= 1)
- return ENXIO;
-
- *adpp = &biosadapter[unit];
-
- return 0;
-}
-
-static int
-gdc_init(int unit, video_adapter_t *adp, int flags)
-{
- if ((unit >= 1) || (adp == NULL) || !probe_done(adp))
- return ENXIO;
-
- if (!init_done(adp)) {
- /* nothing to do really... */
- adp->va_flags |= V_ADP_INITIALIZED;
- }
-
- if (!config_done(adp)) {
- if (vid_register(adp) < 0)
- return ENXIO;
- adp->va_flags |= V_ADP_REGISTERED;
- }
-
- return 0;
-}
-
-/*
- * get_info():
- * Return the video_info structure of the requested video mode.
- */
-static int
-gdc_get_info(video_adapter_t *adp, int mode, video_info_t *info)
-{
- int i;
-
- if (!init_done)
- return 1;
-
- mode = map_gen_mode_num(adp->va_type, adp->va_flags & V_ADP_COLOR, mode);
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
- if (mode == bios_vmode[i].vi_mode) {
- *info = bios_vmode[i];
- return 0;
- }
- }
- return 1;
-}
-
-/*
- * query_mode():
- * Find a video mode matching the requested parameters.
- * Fields filled with 0 are considered "don't care" fields and
- * match any modes.
- */
-static int
-gdc_query_mode(video_adapter_t *adp, video_info_t *info)
-{
- video_info_t buf;
- int i;
-
- if (!init_done)
- return -1;
-
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
-
- if ((info->vi_width != 0)
- && (info->vi_width != bios_vmode[i].vi_width))
- continue;
- if ((info->vi_height != 0)
- && (info->vi_height != bios_vmode[i].vi_height))
- continue;
- if ((info->vi_cwidth != 0)
- && (info->vi_cwidth != bios_vmode[i].vi_cwidth))
- continue;
- if ((info->vi_cheight != 0)
- && (info->vi_cheight != bios_vmode[i].vi_cheight))
- continue;
- if ((info->vi_depth != 0)
- && (info->vi_depth != bios_vmode[i].vi_depth))
- continue;
- if ((info->vi_planes != 0)
- && (info->vi_planes != bios_vmode[i].vi_planes))
- continue;
- /* XXX: should check pixel format, memory model */
- if ((info->vi_flags != 0)
- && (info->vi_flags != bios_vmode[i].vi_flags))
- continue;
-
- /* verify if this mode is supported on this adapter */
- if (gdc_get_info(adp, bios_vmode[i].vi_mode, &buf))
- continue;
- return bios_vmode[i].vi_mode;
- }
- return -1;
-}
-
-/*
- * set_mode():
- * Change the video mode.
- */
-static int
-gdc_set_mode(video_adapter_t *adp, int mode)
-{
- video_info_t info;
-
- prologue(adp, V_ADP_MODECHANGE, 1);
-
- mode = map_gen_mode_num(adp->va_type,
- adp->va_flags & V_ADP_COLOR, mode);
- if (gdc_get_info(adp, mode, &info))
- return 1;
-
-#ifdef LINE30
- switch (scp->mode) {
- case M_PC98_80x25: /* VGA TEXT MODES */
- initialize_gdc(T25_G400);
- break;
- case M_PC98_80x30:
- initialize_gdc(T30_G400);
- break;
- default:
- break;
- }
-#endif
-
- adp->va_mode = mode;
- adp->va_mode_flags = info.vi_flags;
- adp->va_flags &= ~V_ADP_COLOR;
- adp->va_flags |=
- (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
-#if 0
- adp->va_crtc_addr =
- (adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
-#endif
- adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
- adp->va_window_size = info.vi_window_size;
- adp->va_window_gran = info.vi_window_gran;
- if (info.vi_buffer_size == 0) {
- adp->va_buffer = 0;
- adp->va_buffer_size = 0;
- } else {
- adp->va_buffer = BIOS_PADDRTOVADDR(info.vi_buffer);
- adp->va_buffer_size = info.vi_buffer_size;
- }
-
- /* move hardware cursor out of the way */
- (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
-
- return 0;
-}
-
-/*
- * set_border():
- * Change the border color.
- */
-static int
-gdc_set_border(video_adapter_t *adp, int color)
-{
- outb(0x6c, color << 4);
- return 0;
-}
-
-/*
- * save_state():
- * Read video card register values.
- */
-static int
-gdc_save_state(video_adapter_t *adp, void *p, size_t size)
-{
- return 1;
-}
-
-/*
- * load_state():
- * Set video card registers at once.
- */
-static int
-gdc_load_state(video_adapter_t *adp, void *p)
-{
- return 1;
-}
-
-/*
- * read_hw_cursor():
- * Read the position of the hardware text cursor.
- */
-static int
-gdc_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
-{
- video_info_t info;
- u_int16_t off;
- int s;
-
- if (!init_done)
- return 1;
-
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
- if (info.vi_flags & V_INFO_GRAPHICS)
- return 1;
-
- s = spltty();
- master_gdc_cmd(0xe0); /* _GDC_CSRR */
- while((inb(TEXT_GDC + 0) & 0x1) == 0) {} /* GDC wait */
- off = inb(TEXT_GDC + 2); /* EADl */
- off |= (inb(TEXT_GDC + 2) << 8); /* EADh */
- inb(TEXT_GDC + 2); /* dummy */
- inb(TEXT_GDC + 2); /* dummy */
- inb(TEXT_GDC + 2); /* dummy */
- splx(s);
-
- if (off >= ROW*COL)
- off = 0;
- *row = off / info.vi_width;
- *col = off % info.vi_width;
-
- return 0;
-}
-
-/*
- * set_hw_cursor():
- * Move the hardware text cursor. If col and row are both -1,
- * the cursor won't be shown.
- */
-static int
-gdc_set_hw_cursor(video_adapter_t *adp, int col, int row)
-{
- video_info_t info;
- u_int16_t off;
- int s;
-
- if (!init_done)
- return 1;
-
- if ((col == -1) && (row == -1)) {
- off = -1;
- } else {
- (*vidsw[adp->va_index]->get_info)(adp, adp->va_mode, &info);
- if (info.vi_flags & V_INFO_GRAPHICS)
- return 1;
- off = row*info.vi_width + col;
- }
-
- s = spltty();
- master_gdc_cmd(0x49); /* _GDC_CSRW */
- master_gdc_word_prm(off);
- splx(s);
-
- return 0;
-}
-
-/*
- * set_hw_cursor_shape():
- * Change the shape of the hardware text cursor. If the height is zero
- * or negative, the cursor won't be shown.
- */
-static int
-gdc_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
- int celsize, int blink)
-{
- int start;
- int end;
- int s;
-
- start = celsize - (base + height);
- end = celsize - base - 1;
- /*
- * muPD7220 GDC has anomaly that if end == celsize - 1 then start
- * must be 0, otherwise the cursor won't be correctly shown
- * in the first row in the screen. We shall set end to celsize - 2;
- * if end == celsize -1 && start > 0. XXX
- */
- if ((end == celsize - 1) && (start > 0))
- --end;
-
- s = spltty();
- master_gdc_cmd(0x4b); /* _GDC_CSRFORM */
- master_gdc_prm(((height > 0) ? 0x80 : 0) /* cursor on/off */
- | (celsize - 1) & 0x1f); /* cel size */
- master_gdc_word_prm(((end & 0x1f) << 11) /* end line */
- | (12 << 6) /* blink rate */
- | (blink ? 0x20 : 0) /* blink on/off */
- | (start & 0x1f)); /* start line */
- splx(s);
-
- return 1;
-}
-
-static void
-dump_buffer(u_char *buf, size_t len)
-{
- int i;
-
- for(i = 0; i < len;) {
- printf("%02x ", buf[i]);
- if ((++i % 16) == 0)
- printf("\n");
- }
-}
-
-/*
- * mmap():
- * Mmap frame buffer.
- */
-static int
-gdc_mmap(video_adapter_t *adp, vm_offset_t offset)
-{
- if (offset > 0x48000 - PAGE_SIZE)
- return -1;
- return i386_btop((VIDEO_BUF_BASE + offset));
-}
-
-/*
- * diag():
- * Print some information about the video adapter and video modes,
- * with requested level of details.
- */
-static int
-gdc_diag(video_adapter_t *adp, int level)
-{
- video_info_t info;
- int i;
-
- if (!init_done)
- return 1;
-
- fb_dump_adp_info(DRIVER_NAME, adp, level);
-
-#if FB_DEBUG > 1
- for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
- if (bios_vmode[i].vi_mode == NA)
- continue;
- if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
- continue;
- fb_dump_mode_info(DRIVER_NAME, adp, &bios_vmode[i], level);
- }
-#endif
-
- return 0;
-}
-
-static int
-gdc_err(video_adapter_t *adp, ...)
-{
- return 0;
-}
-
-#endif /* NGDC > 0 */
diff --git a/sys/pc98/pc98/pc98kbd.c b/sys/pc98/pc98/pc98kbd.c
deleted file mode 100644
index 668ae9d8ae43d..0000000000000
--- a/sys/pc98/pc98/pc98kbd.c
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*
- * Copyright (c) 1999 FreeBSD(98) port team.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer as
- * the first lines of this file unmodified.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: pc98kbd.c,v 1.3 1999/01/19 12:41:26 kato Exp $
- */
-
-#include "pckbd.h"
-#include "opt_kbd.h"
-#include "opt_devfs.h"
-
-#if NPCKBD > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/fcntl.h>
-#include <sys/bus.h>
-#include <sys/malloc.h>
-
-#include <machine/resource.h>
-
-#include <dev/kbd/kbdreg.h>
-
-#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_machdep.h>
-
-#ifdef __i386__
-#include <i386/isa/isa_device.h>
-#endif
-
-#define DRIVER_NAME "pckbd"
-
-/* device configuration flags */
-#define KB_CONF_FAIL_IF_NO_KBD (1 << 0) /* don't install if no kbd is found */
-
-/* some macros */
-#define PC98KBD_UNIT(dev) minor(dev)
-#define PC98KBD_MKMINOR(unit) (unit)
-
-/* cdev driver declaration */
-
-typedef struct pckbd_softc {
- short flags;
-#define PC98KBD_ATTACHED (1 << 0)
- keyboard_t *kbd;
-#ifdef KBD_INSTALL_CDEV
- genkbd_softc_t gensc;
-#endif
-} pckbd_softc_t;
-
-#define PC98KBD_SOFTC(unit) pckbd_softc[(unit)]
-
-static pckbd_softc_t *pckbd_softc[NPCKBD];
-
-static int pckbdprobe(struct isa_device *dev);
-static int pckbdattach(struct isa_device *dev);
-
-static ointhand2_t pckbd_isa_intr;
-
-/* driver declaration for isa_devtab_tty[] */
-struct isa_driver pckbddriver = {
- pckbdprobe,
- pckbdattach,
- DRIVER_NAME,
- 0,
-};
-
-static int pckbd_probe_unit(int unit, pckbd_softc_t *sc,
- int port, int irq, int flags);
-static int pckbd_attach_unit(int unit, pckbd_softc_t *sc);
-static timeout_t pckbd_timeout;
-
-#ifdef KBD_INSTALL_CDEV
-
-static d_open_t pckbdopen;
-static d_close_t pckbdclose;
-static d_read_t pckbdread;
-static d_ioctl_t pckbdioctl;
-static d_poll_t pckbdpoll;
-
-static struct cdevsw pckbd_cdevsw = {
- pckbdopen, pckbdclose, pckbdread, nowrite,
- pckbdioctl, nostop, nullreset, nodevtotty,
- pckbdpoll, nommap, NULL, DRIVER_NAME,
- NULL, -1,
-};
-
-#endif /* KBD_INSTALL_CDEV */
-
-static int
-pckbdprobe(struct isa_device *dev)
-{
- pckbd_softc_t *sc;
- int error;
-
- if (dev->id_unit >= sizeof(pckbd_softc)/sizeof(pckbd_softc[0]))
- return 0;
- sc = pckbd_softc[dev->id_unit];
- if (sc == NULL) {
- sc = pckbd_softc[dev->id_unit]
- = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL)
- return 0;
- bzero(sc, sizeof(*sc));
- }
-
- /* try to find a keyboard */
- error = pckbd_probe_unit(dev->id_unit, sc, dev->id_iobase,
- dev->id_irq, dev->id_flags);
- if (error)
- return 0;
-
- /* declare our interrupt handler */
- dev->id_ointr = pckbd_isa_intr;
-
- return IO_KBDSIZE;
-}
-
-static int
-pckbdattach(struct isa_device *dev)
-{
- pckbd_softc_t *sc;
-
- if (dev->id_unit >= sizeof(pckbd_softc)/sizeof(pckbd_softc[0]))
- return 0;
- sc = pckbd_softc[dev->id_unit];
- if (sc == NULL)
- return 0;
-
- return ((pckbd_attach_unit(dev->id_unit, sc)) ? 0 : 1);
-}
-
-static void
-pckbd_isa_intr(int unit)
-{
- keyboard_t *kbd;
-
- kbd = pckbd_softc[unit]->kbd;
- (*kbdsw[kbd->kb_index]->intr)(kbd);
-}
-
-static int
-pckbd_probe_unit(int unit, pckbd_softc_t *sc, int port, int irq, int flags)
-{
- keyboard_switch_t *sw;
- int args[2];
-
- if (sc->flags & PC98KBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- args[0] = port;
- args[1] = irq;
- return (*sw->probe)(unit, &sc->kbd, args, flags);
-}
-
-static int
-pckbd_attach_unit(int unit, pckbd_softc_t *sc)
-{
- keyboard_switch_t *sw;
- int error;
-
- if (sc->flags & PC98KBD_ATTACHED)
- return 0;
-
- sw = kbd_get_switch(DRIVER_NAME);
- if (sw == NULL)
- return ENXIO;
-
- /* reset, initialize and enable the device */
- error = (*sw->init)(sc->kbd);
- if (error)
- return ENXIO;
- (*sw->enable)(sc->kbd);
-
-#ifdef KBD_INSTALL_CDEV
- /* attach a virtual keyboard cdev */
- error = kbd_attach(makedev(0, PC98KBD_MKMINOR(unit)), sc->kbd,
- &pckbd_cdevsw);
- if (error)
- return error;
-#endif /* KBD_INSTALL_CDEV */
-
- /*
- * This is a kludge to compensate for lost keyboard interrupts.
- * A similar code used to be in syscons. See below. XXX
- */
- pckbd_timeout(sc->kbd);
-
- if (bootverbose)
- (*sw->diag)(sc->kbd, bootverbose);
-
- sc->flags |= PC98KBD_ATTACHED;
- return 0;
-}
-
-static void
-pckbd_timeout(void *arg)
-{
- keyboard_t *kbd;
- int s;
-
- /* The following comments are extracted from syscons.c (1.287) */
- /*
- * With release 2.1 of the Xaccel server, the keyboard is left
- * hanging pretty often. Apparently an interrupt from the
- * keyboard is lost, and I don't know why (yet).
- * This ugly hack calls scintr if input is ready for the keyboard
- * and conveniently hides the problem. XXX
- */
- /*
- * Try removing anything stuck in the keyboard controller; whether
- * it's a keyboard scan code or mouse data. `scintr()' doesn't
- * read the mouse data directly, but `kbdio' routines will, as a
- * side effect.
- */
- s = spltty();
- kbd = (keyboard_t *)arg;
- if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) {
- /*
- * We have seen the lock flag is not set. Let's reset
- * the flag early, otherwise the LED update routine fails
- * which may want the lock during the interrupt routine.
- */
- (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE);
- if ((*kbdsw[kbd->kb_index]->check_char)(kbd))
- (*kbdsw[kbd->kb_index]->intr)(kbd);
- }
- splx(s);
- timeout(pckbd_timeout, arg, hz/10);
-}
-
-/* cdev driver functions */
-
-#ifdef KBD_INSTALL_CDEV
-
-static int
-pckbdopen(dev_t dev, int flag, int mode, struct proc *p)
-{
- pckbd_softc_t *sc;
- int unit;
-
- unit = PC98KBD_UNIT(dev);
- if ((unit >= NPCKBD) || ((sc = PC98KBD_SOFTC(unit)) == NULL))
- return ENXIO;
- if (mode & (FWRITE | O_CREAT | O_APPEND | O_TRUNC))
- return ENODEV;
-
- /* FIXME: set the initial input mode (K_XLATE?) and lock state? */
- return genkbdopen(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-pckbdclose(dev_t dev, int flag, int mode, struct proc *p)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdclose(&sc->gensc, sc->kbd, flag, mode, p);
-}
-
-static int
-pckbdread(dev_t dev, struct uio *uio, int flag)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdread(&sc->gensc, sc->kbd, uio, flag);
-}
-
-static int
-pckbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *p)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdioctl(&sc->gensc, sc->kbd, cmd, arg, flag, p);
-}
-
-static int
-pckbdpoll(dev_t dev, int event, struct proc *p)
-{
- pckbd_softc_t *sc;
-
- sc = PC98KBD_SOFTC(PC98KBD_UNIT(dev));
- return genkbdpoll(&sc->gensc, sc->kbd, event, p);
-}
-
-#endif /* KBD_INSTALL_CDEV */
-
-/* LOW-LEVEL */
-
-#include <machine/limits.h>
-#include <machine/console.h>
-#include <machine/clock.h>
-
-#define PC98KBD_DEFAULT 0
-
-typedef caddr_t KBDC;
-
-typedef struct pckbd_state {
- KBDC kbdc; /* keyboard controller */
- int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */
- int ks_flags; /* flags */
-#define COMPOSE (1 << 0)
- int ks_state; /* shift/lock key state */
- int ks_accents; /* accent key index (> 0) */
- u_int ks_composed_char; /* composed char code (> 0) */
-} pckbd_state_t;
-
-/* keyboard driver declaration */
-static int pckbd_configure(int flags);
-static kbd_probe_t pckbd_probe;
-static kbd_init_t pckbd_init;
-static kbd_term_t pckbd_term;
-static kbd_intr_t pckbd_intr;
-static kbd_test_if_t pckbd_test_if;
-static kbd_enable_t pckbd_enable;
-static kbd_disable_t pckbd_disable;
-static kbd_read_t pckbd_read;
-static kbd_check_t pckbd_check;
-static kbd_read_char_t pckbd_read_char;
-static kbd_check_char_t pckbd_check_char;
-static kbd_ioctl_t pckbd_ioctl;
-static kbd_lock_t pckbd_lock;
-static kbd_clear_state_t pckbd_clear_state;
-static kbd_get_state_t pckbd_get_state;
-static kbd_set_state_t pckbd_set_state;
-
-keyboard_switch_t pckbdsw = {
- pckbd_probe,
- pckbd_init,
- pckbd_term,
- pckbd_intr,
- pckbd_test_if,
- pckbd_enable,
- pckbd_disable,
- pckbd_read,
- pckbd_check,
- pckbd_read_char,
- pckbd_check_char,
- pckbd_ioctl,
- pckbd_lock,
- pckbd_clear_state,
- pckbd_get_state,
- pckbd_set_state,
- genkbd_get_fkeystr,
- genkbd_diag,
-};
-
-KEYBOARD_DRIVER(pckbd, pckbdsw, pckbd_configure);
-
-struct kbdc_softc {
- int port; /* base port address */
- int lock; /* FIXME: XXX not quite a semaphore... */
-};
-
-/* local functions */
-static int probe_keyboard(KBDC kbdc, int flags);
-static int init_keyboard(KBDC kbdc, int *type, int flags);
-static KBDC kbdc_open(int port);
-static int kbdc_lock(KBDC kbdc, int lock);
-static int kbdc_data_ready(KBDC kbdc);
-static int read_kbd_data(KBDC kbdc);
-static int read_kbd_data_no_wait(KBDC kbdc);
-static int wait_for_kbd_data(struct kbdc_softc *kbdc);
-
-/* local variables */
-
-/* the initial key map, accent map and fkey strings */
-#include <dev/kbd/kbdtables.h>
-
-/* structures for the default keyboard */
-static keyboard_t default_kbd;
-static pckbd_state_t default_kbd_state;
-static keymap_t default_keymap;
-static accentmap_t default_accentmap;
-static fkeytab_t default_fkeytab[NUM_FKEYS];
-
-/*
- * The back door to the keyboard driver!
- * This function is called by the console driver, via the kbdio module,
- * to tickle keyboard drivers when the low-level console is being initialized.
- * Almost nothing in the kernel has been initialied yet. Try to probe
- * keyboards if possible.
- * NOTE: because of the way the low-level conole is initialized, this routine
- * may be called more than once!!
- */
-static int
-pckbd_configure(int flags)
-{
- keyboard_t *kbd;
- KBDC kbdc;
- int arg[2];
- struct isa_device *dev;
-
- /* XXX: a kludge to obtain the device configuration flags */
- dev = find_isadev(isa_devtab_tty, &pckbddriver, 0);
- if (dev != NULL)
- flags |= dev->id_flags;
-
- /* probe the default keyboard */
- arg[0] = -1;
- arg[1] = -1;
- if (pckbd_probe(PC98KBD_DEFAULT, &kbd, arg, flags))
- return 0;
-
- /* initialize it */
- kbdc = ((pckbd_state_t *)kbd->kb_data)->kbdc;
- if (!(flags & KB_CONF_PROBE_ONLY) && !KBD_IS_PROBED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, flags)
- && (flags & KB_CONF_FAIL_IF_NO_KBD))
- return 0;
- KBD_INIT_DONE(kbd);
- }
-
- /* and register */
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return 0;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 1; /* return the number of found keyboards */
-}
-
-/* low-level functions */
-
-/* initialize the keyboard_t structure and try to detect a keyboard */
-static int
-pckbd_probe(int unit, keyboard_t **kbdp, void *arg, int flags)
-{
- keyboard_t *kbd;
- pckbd_state_t *state;
- keymap_t *keymap;
- accentmap_t *accmap;
- fkeytab_t *fkeymap;
- int fkeymap_size;
- KBDC kbdc;
- int *data = (int *)arg;
-
- if (unit != PC98KBD_DEFAULT)
- return ENXIO;
-
- *kbdp = kbd = &default_kbd;
- if (KBD_IS_PROBED(kbd))
- return 0;
- state = &default_kbd_state;
- keymap = &default_keymap;
- accmap = &default_accentmap;
- fkeymap = default_fkeytab;
- fkeymap_size = sizeof(default_fkeytab)/sizeof(default_fkeytab[0]);
-
- state->kbdc = kbdc = kbdc_open(data[0]);
- if (kbdc == NULL)
- return ENXIO;
- kbd_init_struct(kbd, DRIVER_NAME, KB_OTHER, unit, flags, data[0],
- IO_KBDSIZE);
- bcopy(&key_map, keymap, sizeof(key_map));
- bcopy(&accent_map, accmap, sizeof(accent_map));
- bcopy(fkey_tab, fkeymap,
- imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab)));
- kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size);
- kbd->kb_data = (void *)state;
-
- if (probe_keyboard(kbdc, flags)) {
- if (flags & KB_CONF_FAIL_IF_NO_KBD)
- return ENXIO;
- } else {
- KBD_FOUND_DEVICE(kbd);
- }
- pckbd_clear_state(kbd);
- state->ks_mode = K_XLATE;
-
- KBD_PROBE_DONE(kbd);
- return 0;
-}
-
-/* reset and initialize the device */
-static int
-pckbd_init(keyboard_t *kbd)
-{
- KBDC kbdc;
-
- if ((kbd == NULL) || !KBD_IS_PROBED(kbd))
- return ENXIO; /* shouldn't happen */
- kbdc = ((pckbd_state_t *)kbd->kb_data)->kbdc;
- if (kbdc == NULL)
- return ENXIO; /* shouldn't happen */
-
- if (!KBD_IS_INITIALIZED(kbd)) {
- if (KBD_HAS_DEVICE(kbd)
- && init_keyboard(kbdc, &kbd->kb_type, kbd->kb_config)
- && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD))
- return ENXIO;
- pckbd_ioctl(kbd, KDSETLED,
- (caddr_t)&((pckbd_state_t *)(kbd->kb_data))->ks_state);
- KBD_INIT_DONE(kbd);
- }
- if (!KBD_IS_CONFIGURED(kbd)) {
- if (kbd_register(kbd) < 0)
- return ENXIO;
- KBD_CONFIG_DONE(kbd);
- }
-
- return 0;
-}
-
-/* finish using this keyboard */
-static int
-pckbd_term(keyboard_t *kbd)
-{
- kbd_unregister(kbd);
- return 0;
-}
-
-/* keyboard interrupt routine */
-static int
-pckbd_intr(keyboard_t *kbd)
-{
- int c;
-
- if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
- /* let the callback function to process the input */
- (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,
- kbd->kb_callback.kc_arg);
- } else {
- /* read and discard the input; no one is waiting for input */
- do {
- c = pckbd_read_char(kbd, FALSE);
- } while (c != NOKEY);
- }
- return 0;
-}
-
-/* test the interface to the device */
-static int
-pckbd_test_if(keyboard_t *kbd)
-{
- return 0;
-}
-
-/*
- * Enable the access to the device; until this function is called,
- * the client cannot read from the keyboard.
- */
-static int
-pckbd_enable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_ACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* disallow the access to the device */
-static int
-pckbd_disable(keyboard_t *kbd)
-{
- int s;
-
- s = spltty();
- KBD_DEACTIVATE(kbd);
- splx(s);
- return 0;
-}
-
-/* read one byte from the keyboard if it's allowed */
-static int
-pckbd_read(keyboard_t *kbd, int wait)
-{
- int c;
-
- if (wait)
- c = read_kbd_data(((pckbd_state_t *)kbd->kb_data)->kbdc);
- else
- c = read_kbd_data_no_wait(((pckbd_state_t *)kbd->kb_data)->kbdc);
- return (KBD_IS_ACTIVE(kbd) ? c : -1);
-}
-
-/* check if data is waiting */
-static int
-pckbd_check(keyboard_t *kbd)
-{
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- return kbdc_data_ready(((pckbd_state_t *)kbd->kb_data)->kbdc);
-}
-
-/* read char from the keyboard */
-static u_int
-pckbd_read_char(keyboard_t *kbd, int wait)
-{
- pckbd_state_t *state;
- u_int action;
- int scancode;
- int keycode;
-
- state = (pckbd_state_t *)kbd->kb_data;
-next_code:
- /* do we have a composed char to return? */
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0)) {
- action = state->ks_composed_char;
- state->ks_composed_char = 0;
- if (action > UCHAR_MAX)
- return ERRKEY;
- return action;
- }
-
- /* see if there is something in the keyboard port */
- if (wait) {
- do {
- scancode = read_kbd_data(state->kbdc);
- } while (scancode == -1);
- } else {
- scancode = read_kbd_data_no_wait(state->kbdc);
- if (scancode == -1)
- return NOKEY;
- }
-
- /* return the byte as is for the K_RAW mode */
- if (state->ks_mode == K_RAW)
- return scancode;
-
- /* translate the scan code into a keycode */
- keycode = scancode & 0x7F;
- switch(scancode) {
- case 0xF3: /* GRPH (compose key) released */
- if (state->ks_flags & COMPOSE) {
- state->ks_flags &= ~COMPOSE;
- if (state->ks_composed_char > UCHAR_MAX)
- state->ks_composed_char = 0;
- }
- break;
- case 0x73: /* GRPH (compose key) pressed */
- if (!(state->ks_flags & COMPOSE)) {
- state->ks_flags |= COMPOSE;
- state->ks_composed_char = 0;
- }
- break;
- }
-
- /* return the key code in the K_CODE mode */
- if (state->ks_mode == K_CODE)
- return (keycode | (scancode & 0x80));
-
- /* compose a character code */
- if (state->ks_flags & COMPOSE) {
- switch (scancode) {
- /* key pressed, process it */
- case 0x42: case 0x43: case 0x44: /* keypad 7,8,9 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x3B;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x46: case 0x47: case 0x48: /* keypad 4,5,6 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x42;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4A: case 0x4B: case 0x4C: /* keypad 1,2,3 */
- state->ks_composed_char *= 10;
- state->ks_composed_char += scancode - 0x49;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
- case 0x4E: /* keypad 0 */
- state->ks_composed_char *= 10;
- if (state->ks_composed_char > UCHAR_MAX)
- return ERRKEY;
- goto next_code;
-
- /* key released, no interest here */
- case 0xC2: case 0xC3: case 0xC4: /* keypad 7,8,9 */
- case 0xC6: case 0xC7: case 0xC8: /* keypad 4,5,6 */
- case 0xCA: case 0xCB: case 0xCC: /* keypad 1,2,3 */
- case 0xCE: /* keypad 0 */
- goto next_code;
-
- case 0x73: /* GRPH key */
- break;
-
- default:
- if (state->ks_composed_char > 0) {
- state->ks_flags &= ~COMPOSE;
- state->ks_composed_char = 0;
- return ERRKEY;
- }
- break;
- }
- }
-
- /* keycode to key action */
- action = genkbd_keyaction(kbd, keycode, scancode & 0x80,
- &state->ks_state, &state->ks_accents);
- if (action == NOKEY)
- goto next_code;
- else
- return action;
-}
-
-/* check if char is waiting */
-static int
-pckbd_check_char(keyboard_t *kbd)
-{
- pckbd_state_t *state;
-
- if (!KBD_IS_ACTIVE(kbd))
- return FALSE;
- state = (pckbd_state_t *)kbd->kb_data;
- if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0))
- return TRUE;
- return kbdc_data_ready(state->kbdc);
-}
-
-/* some useful control functions */
-static int
-pckbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
-{
- pckbd_state_t *state = kbd->kb_data;
- int s;
- int i;
-
- s = spltty();
- switch (cmd) {
-
- case KDGKBMODE: /* get keyboard mode */
- *(int *)arg = state->ks_mode;
- break;
- case KDSKBMODE: /* set keyboard mode */
- switch (*(int *)arg) {
- case K_XLATE:
- if (state->ks_mode != K_XLATE) {
- /* make lock key state and LED state match */
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= KBD_LED_VAL(kbd);
- }
- /* FALL THROUGH */
- case K_RAW:
- case K_CODE:
- if (state->ks_mode != *(int *)arg) {
- pckbd_clear_state(kbd);
- state->ks_mode = *(int *)arg;
- }
- break;
- default:
- splx(s);
- return EINVAL;
- }
- break;
-
- case KDGETLED: /* get keyboard LED */
- *(int *)arg = KBD_LED_VAL(kbd);
- break;
- case KDSETLED: /* set keyboard LED */
- /* NOTE: lock key state in ks_state won't be changed */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- i = *(int *)arg;
- /* replace CAPS LED with ALTGR LED for ALTGR keyboards */
- if (kbd->kb_keymap->n_keys > ALTGR_OFFSET) {
- if (i & ALKED)
- i |= CLKED;
- else
- i &= ~CLKED;
- }
- KBD_LED_VAL(kbd) = *(int *)arg;
- break;
-
- case KDGKBSTATE: /* get lock key state */
- *(int *)arg = state->ks_state & LOCK_MASK;
- break;
- case KDSKBSTATE: /* set lock key state */
- if (*(int *)arg & ~LOCK_MASK) {
- splx(s);
- return EINVAL;
- }
- state->ks_state &= ~LOCK_MASK;
- state->ks_state |= *(int *)arg;
- splx(s);
- /* set LEDs and quit */
- return pckbd_ioctl(kbd, KDSETLED, arg);
-
- case KDSETRAD: /* set keyboard repeat rate */
- break;
-
- case PIO_KEYMAP: /* set keyboard translation table */
- case PIO_KEYMAPENT: /* set keyboard translation table entry */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- state->ks_accents = 0;
- /* FALL THROUGH */
- default:
- splx(s);
- return genkbd_commonioctl(kbd, cmd, arg);
- }
-
- splx(s);
- return 0;
-}
-
-/* lock the access to the keyboard */
-static int
-pckbd_lock(keyboard_t *kbd, int lock)
-{
- return kbdc_lock(((pckbd_state_t *)kbd->kb_data)->kbdc, lock);
-}
-
-/* clear the internal state of the keyboard */
-static void
-pckbd_clear_state(keyboard_t *kbd)
-{
- pckbd_state_t *state;
-
- state = (pckbd_state_t *)kbd->kb_data;
- state->ks_flags = 0;
- state->ks_state &= LOCK_MASK; /* preserve locking key state */
- state->ks_accents = 0;
- state->ks_composed_char = 0;
-}
-
-/* save the internal state */
-static int
-pckbd_get_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len == 0)
- return sizeof(pckbd_state_t);
- if (len < sizeof(pckbd_state_t))
- return -1;
- bcopy(kbd->kb_data, buf, sizeof(pckbd_state_t));
- return 0;
-}
-
-/* set the internal state */
-static int
-pckbd_set_state(keyboard_t *kbd, void *buf, size_t len)
-{
- if (len < sizeof(pckbd_state_t))
- return ENOMEM;
- if (((pckbd_state_t *)kbd->kb_data)->kbdc
- != ((pckbd_state_t *)buf)->kbdc)
- return ENOMEM;
- bcopy(buf, kbd->kb_data, sizeof(pckbd_state_t));
- return 0;
-}
-
-/* local functions */
-
-static int
-probe_keyboard(KBDC kbdc, int flags)
-{
- return 0;
-}
-
-static int
-init_keyboard(KBDC kbdc, int *type, int flags)
-{
- *type = KB_OTHER;
- return 0;
-}
-
-/* keyboard I/O routines */
-
-/* retry count */
-#ifndef KBD_MAXRETRY
-#define KBD_MAXRETRY 3
-#endif
-
-/* timing parameters */
-#ifndef KBD_RESETDELAY
-#define KBD_RESETDELAY 200 /* wait 200msec after kbd/mouse reset */
-#endif
-#ifndef KBD_MAXWAIT
-#define KBD_MAXWAIT 5 /* wait 5 times at most after reset */
-#endif
-
-/* I/O recovery time */
-#define KBDC_DELAYTIME 37
-#define KBDD_DELAYTIME 37
-
-/* I/O ports */
-#define KBD_STATUS_PORT 2 /* status port, read */
-#define KBD_DATA_PORT 0 /* data port, read */
-
-/* status bits (KBD_STATUS_PORT) */
-#define KBDS_BUFFER_FULL 0x0002
-
-/* macros */
-
-#define kbdcp(p) ((struct kbdc_softc *)(p))
-
-/* local variables */
-
-static struct kbdc_softc kbdc_softc[NPCKBD] = { { 0 }, };
-
-/* associate a port number with a KBDC */
-
-static KBDC
-kbdc_open(int port)
-{
- if (port <= 0)
- port = IO_KBD;
-
- if (NPCKBD) {
- /* PC-98 has only one keyboard I/F */
- kbdc_softc[0].port = port;
- kbdc_softc[0].lock = FALSE;
- return (KBDC)&kbdc_softc[0];
- }
- return NULL; /* You didn't include sc driver in your config file */
-}
-
-/* set/reset polling lock */
-static int
-kbdc_lock(KBDC p, int lock)
-{
- int prevlock;
-
- prevlock = kbdcp(p)->lock;
- kbdcp(p)->lock = lock;
-
- return (prevlock != lock);
-}
-
-/* check if any data is waiting to be processed */
-static int
-kbdc_data_ready(KBDC p)
-{
- return (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL);
-}
-
-/* wait for data from the keyboard */
-static int
-wait_for_kbd_data(struct kbdc_softc *kbdc)
-{
- /* CPU will stay inside the loop for 200msec at most */
- int retry = 10000;
- int port = kbdc->port;
-
- while (!(inb(port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL)) {
- DELAY(KBDD_DELAYTIME);
- DELAY(KBDC_DELAYTIME);
- if (--retry < 0)
- return 0;
- }
- DELAY(KBDD_DELAYTIME);
- return 1;
-}
-
-/* read one byte from the keyboard */
-static int
-read_kbd_data(KBDC p)
-{
- if (!wait_for_kbd_data(kbdcp(p)))
- return -1; /* timeout */
- DELAY(KBDC_DELAYTIME);
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
-}
-
-/* read one byte from the keyboard, but return immediately if
- * no data is waiting
- */
-static int
-read_kbd_data_no_wait(KBDC p)
-{
- if (inb(kbdcp(p)->port + KBD_STATUS_PORT) & KBDS_BUFFER_FULL) {
- DELAY(KBDD_DELAYTIME);
- return inb(kbdcp(p)->port + KBD_DATA_PORT);
- }
- return -1; /* no data */
-}
-
-#endif /* NPCKBD > 0 */
diff --git a/sys/pc98/pc98/pcaudio.c b/sys/pc98/pc98/pcaudio.c
index 05ba0161b6aaa..abffc8c418efd 100644
--- a/sys/pc98/pc98/pcaudio.c
+++ b/sys/pc98/pc98/pcaudio.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcaudio.c,v 1.19 1998/12/14 08:58:56 kato Exp $
+ * $Id: pcaudio.c,v 1.43 1998/09/15 18:16:37 sos Exp $
*/
#include "pca.h"
@@ -52,6 +52,11 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#define DSP_ULAW_NOT_WANTED
+#include <i386/isa/sound/ulaw.h>
+#define LINEAR_ALAW_NOT_WANTED
+#include <i386/isa/sound/alaw.h>
+
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /* DEVFS */
@@ -84,44 +89,6 @@ static char buffer2[BUF_SIZE];
static char buffer3[BUF_SIZE];
static char volume_table[256];
-#define DSP_ULAW_NOT_WANTED
-#include <i386/isa/snd/ulaw.h>
-
-static unsigned char alaw_linear[] = {
- 45, 214, 122, 133, 0, 255, 107, 149,
- 86, 171, 126, 129, 0, 255, 117, 138,
- 13, 246, 120, 135, 0, 255, 99, 157,
- 70, 187, 124, 131, 0, 255, 113, 142,
- 61, 198, 123, 132, 0, 255, 111, 145,
- 94, 163, 127, 128, 0, 255, 119, 136,
- 29, 230, 121, 134, 0, 255, 103, 153,
- 78, 179, 125, 130, 0, 255, 115, 140,
- 37, 222, 122, 133, 0, 255, 105, 151,
- 82, 175, 126, 129, 0, 255, 116, 139,
- 5, 254, 120, 135, 0, 255, 97, 159,
- 66, 191, 124, 131, 0, 255, 112, 143,
- 53, 206, 123, 132, 0, 255, 109, 147,
- 90, 167, 127, 128, 0, 255, 118, 137,
- 21, 238, 121, 134, 0, 255, 101, 155,
- 74, 183, 125, 130, 0, 255, 114, 141,
- 49, 210, 123, 133, 0, 255, 108, 148,
- 88, 169, 127, 129, 0, 255, 118, 138,
- 17, 242, 121, 135, 0, 255, 100, 156,
- 72, 185, 125, 131, 0, 255, 114, 142,
- 64, 194, 124, 132, 0, 255, 112, 144,
- 96, 161, 128, 128, 1, 255, 120, 136,
- 33, 226, 122, 134, 0, 255, 104, 152,
- 80, 177, 126, 130, 0, 255, 116, 140,
- 41, 218, 122, 133, 0, 255, 106, 150,
- 84, 173, 126, 129, 0, 255, 117, 139,
- 9, 250, 120, 135, 0, 255, 98, 158,
- 68, 189, 124, 131, 0, 255, 113, 143,
- 57, 202, 123, 132, 0, 255, 110, 146,
- 92, 165, 127, 128, 0, 255, 119, 137,
- 25, 234, 121, 134, 0, 255, 102, 154,
- 76, 181, 125, 130, 0, 255, 115, 141,
-};
-
#ifdef DEVFS
static void *pca_devfs_token;
static void *pcac_devfs_token;
@@ -198,7 +165,7 @@ pca_init(void)
pca_status.buf[1] = (unsigned char *)&buffer2[0];
pca_status.buf[2] = (unsigned char *)&buffer3[0];
pca_status.buffer = pca_status.buf[0];
- pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[2] = 0;
+ pca_status.in_use[0] = pca_status.in_use[1] = pca_status.in_use[3] = 0;
pca_status.current = 0;
pca_status.sample_rate = SAMPLE_RATE;
pca_status.scale = (pca_status.sample_rate << 8) / INTERRUPT_RATE;
@@ -602,4 +569,5 @@ static void pca_drvinit(void *unused)
SYSINIT(pcadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,pca_drvinit,NULL)
+
#endif
diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c
index 97ac3ad3b384d..abce135c8193a 100644
--- a/sys/pc98/pc98/sio.c
+++ b/sys/pc98/pc98/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.75 1999/01/16 11:42:16 kato Exp $
+ * $Id: sio.c,v 1.66 1998/08/28 12:44:49 kato Exp $
*/
#include "opt_comconsole.h"
@@ -74,9 +74,9 @@
*
* 1) config
* options COM_MULTIPORT #if using MC16550II
- * device sio0 at nec? port 0x30 tty irq 4 #internal
- * device sio1 at nec? port 0xd2 tty irq 5 flags 0x101 #mc1
- * device sio2 at nec? port 0x8d2 tty flags 0x101 #mc2
+ * device sio0 at nec? port 0x30 tty irq 4 vector siointr #internal
+ * device sio1 at nec? port 0xd2 tty irq 5 flags 0x101 vector siointr #mc1
+ * device sio2 at nec? port 0x8d2 tty flags 0x101 vector siointr #mc2
* # ~~~~~iobase ~~multi port flag
* # ~ master device is sio1
* 2) device
@@ -103,36 +103,21 @@
* # options COM_MULTIPORT # support for MICROCORE MC16550II
* ... comment-out this line, which will conflict with B98_01.
* options "B98_01" # support for AIWA B98-01
- * device sio1 at nec? port 0x00d1 tty irq ?
- * device sio2 at nec? port 0x00d5 tty irq ?
+ * device sio1 at nec? port 0x00d1 tty irq ? vector siointr
+ * device sio2 at nec? port 0x00d5 tty irq ? vector siointr
* ... you can leave these lines `irq ?', irq will be autodetected.
*/
-/*
- * Modified by Y.Takahashi of Kogakuin University.
- */
-
#ifdef PC98
-#define COM_IF_INTERNAL 0x00
-#define COM_IF_PC9861K_1 0x01
-#define COM_IF_PC9861K_2 0x02
-#define COM_IF_IND_SS_1 0x03
-#define COM_IF_IND_SS_2 0x04
-#define COM_IF_PIO9032B_1 0x05
-#define COM_IF_PIO9032B_2 0x06
-#define COM_IF_B98_01_1 0x07
-#define COM_IF_B98_01_2 0x08
-#define COM_IF_END1 COM_IF_B98_01_2
-#define COM_IF_RSA98 0x10 /* same as COM_IF_NS16550 */
-#define COM_IF_NS16550 0x11
-#define COM_IF_SECOND_CCU 0x12 /* same as COM_IF_NS16550 */
-#define COM_IF_MC16550II 0x13
-#define COM_IF_MCRS98 0x14 /* same as COM_IF_MC16550II */
-#define COM_IF_RSB3000 0x15
-#define COM_IF_RSB384 0x16
-#define COM_IF_MODEM_CARD 0x17 /* same as COM_IF_NS16550 */
-#define COM_IF_RSA98III 0x18
-#define COM_IF_ESP98 0x19
-#define COM_IF_END2 COM_IF_ESP98
+#define MC16550 0
+#define COM_IF_INTERNAL 1
+#if 0
+#define COM_IF_PC9861K 2
+#define COM_IF_PIO9032B 3
+#endif
+#ifdef B98_01
+#undef COM_MULTIPORT /* COM_MULTIPORT will conflict with B98_01 */
+#define COM_IF_B98_01 4
+#endif /* B98_01 */
#endif /* PC98 */
#include <sys/param.h>
@@ -154,33 +139,28 @@
#include <machine/clock.h>
#include <machine/ipl.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#ifdef PC98
#include <pc98/pc98/pc98.h>
#include <pc98/pc98/pc98_machdep.h>
#include <i386/isa/icu.h>
+#include <i386/isa/isa_device.h>
+#include <pc98/pc98/sioreg.h>
#include <i386/isa/ic/i8251.h>
#else
#include <i386/isa/isa.h>
-#endif
#include <i386/isa/isa_device.h>
#include <i386/isa/sioreg.h>
+#endif
#include <i386/isa/intr_machdep.h>
#ifdef COM_ESP
#include <i386/isa/ic/esp.h>
#endif
#include <i386/isa/ic/ns16550.h>
-#ifdef PC98
-#include <i386/isa/ic/rsa.h>
-#endif
#include "card.h"
#if NCARD > 0
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
#endif
@@ -236,11 +216,9 @@
#define COM_IIR_TXRDYBUG(dev) ((dev)->id_flags & COM_C_IIR_TXRDYBUG)
#define COM_FIFOSIZE(dev) (((dev)->id_flags & 0xff000000) >> 24)
-#ifdef PC98
-#define com_emr com_msr /* Extension mode register for RSB-2000/3000 */
-#else
+#ifndef PC98
#define com_scr 7 /* scratch register for 16450-16550 (R/W) */
-#endif
+#endif /* !PC98 */
/*
* Input buffer watermarks.
@@ -369,9 +347,6 @@ struct com_s {
#endif
Port_t int_id_port;
Port_t iobase;
-#ifdef PC98
- Port_t rsabase; /* iobase address of a I/O-DATA RSA board */
-#endif
Port_t modem_ctl_port;
Port_t line_status_port;
Port_t modem_status_port;
@@ -401,18 +376,6 @@ struct com_s {
* Ping-pong input buffers. The extra factor of 2 in the sizes is
* to allow for an error byte for each input byte.
*/
-#ifdef PC98
- u_long CE_INPUT_OFFSET;
- u_char *ibuf1;
- u_char *ibuf2;
-
- /*
- * Data area for output buffers. Someday we should build the output
- * buffer queue without copying data.
- */
- u_char *obuf1;
- u_char *obuf2;
-#else
#define CE_INPUT_OFFSET RS_IBUFSIZE
u_char ibuf1[2 * RS_IBUFSIZE];
u_char ibuf2[2 * RS_IBUFSIZE];
@@ -423,7 +386,6 @@ struct com_s {
*/
u_char obuf1[256];
u_char obuf2[256];
-#endif
#ifdef DEVFS
void *devfs_token_ttyd;
void *devfs_token_ttyl;
@@ -442,7 +404,6 @@ static int sioattach __P((struct isa_device *dev));
static timeout_t siobusycheck;
static timeout_t siodtrwakeup;
static void comhardclose __P((struct com_s *com));
-static ointhand2_t siointr;
static void siointr1 __P((struct com_s *com));
static int commctl __P((struct com_s *com, int bits, int how));
static int comparam __P((struct tty *tp, struct termios *t));
@@ -454,6 +415,9 @@ static timeout_t comwakeup;
static void disc_optim __P((struct tty *tp, struct termios *t,
struct com_s *com));
+#ifdef DSI_SOFT_MODEM
+static int LoadSoftModem __P((int unit,int base_io, u_long size, u_char *ptr));
+#endif /* DSI_SOFT_MODEM */
static char driver_name[] = "sio";
@@ -503,9 +467,28 @@ struct siodev {
short if_type;
short irq;
Port_t cmd, sts, ctrl, mod;
-};
+ };
static int sysclock;
-
+static short port_table[5][3] = {
+ {0x30, 0xb1, 0xb9},
+ {0x32, 0xb3, 0xbb},
+ {0x32, 0xb3, 0xbb},
+ {0x33, 0xb0, 0xb2},
+ {0x35, 0xb0, 0xb2}
+ };
+#define PC98SIO_data_port(ch) port_table[0][ch]
+#define PC98SIO_cmd_port(ch) port_table[1][ch]
+#define PC98SIO_sts_port(ch) port_table[2][ch]
+#define PC98SIO_in_modem_port(ch) port_table[3][ch]
+#define PC98SIO_intr_ctrl_port(ch) port_table[4][ch]
+#ifdef COM_IF_PIO9032B
+#define IO_COM_PIO9032B_2 0x0b8
+#define IO_COM_PIO9032B_3 0x0ba
+#endif /* COM_IF_PIO9032B */
+#ifdef COM_IF_B98_01
+#define IO_COM_B98_01_2 0x0d1
+#define IO_COM_B98_01_3 0x0d5
+#endif /* COM_IF_B98_01 */
#define COM_INT_DISABLE {int previpri; previpri=spltty();
#define COM_INT_ENABLE splx(previpri);}
#define IEN_TxFLAG IEN_Tx
@@ -514,8 +497,8 @@ static int sysclock;
#define PC98_CHECK_MODEM_INTERVAL (hz/10)
#define DCD_OFF_TOLERANCE 2
#define DCD_ON_RECOGNITION 2
-#define IS_8251(if_type) (!(if_type & 0x10))
-#define COM1_EXT_CLOCK 0x40000
+#define IS_8251(type) (type != MC16550)
+#define IS_PC98IN(adr) (adr == 0x30)
static void commint __P((dev_t dev));
static void com_tiocm_set __P((struct com_s *com, int msr));
@@ -539,9 +522,9 @@ static void pc98_i8251_set_cmd __P((struct com_s *com, int x));
static void pc98_i8251_or_cmd __P((struct com_s *com, int x));
static void pc98_i8251_clear_cmd __P((struct com_s *com, int x));
static void pc98_i8251_clear_or_cmd __P((struct com_s *com, int clr, int x));
-static int pc98_check_if_type __P((struct isa_device *dev, struct siodev *iod));
+static int pc98_check_if_type __P((int iobase, struct siodev *iod));
static void pc98_check_sysclock __P((void));
-static int pc98_set_ioport __P((struct com_s *com, int id_flags));
+static int pc98_set_ioport __P((struct com_s *com, int io_base));
#define com_int_Tx_disable(com) \
pc98_disable_i8251_interrupt(com,IEN_Tx|IEN_TxEMP)
@@ -560,7 +543,7 @@ static int pc98_set_ioport __P((struct com_s *com, int id_flags));
#define com_send_break_off(com) \
pc98_i8251_clear_cmd(com,CMD8251_SBRK)
-static struct speedtab pc98speedtab[] = { /* internal RS232C interface */
+struct speedtab pc98speedtab[] = { /* internal RS232C interface */
0, 0,
50, 50,
75, 75,
@@ -574,23 +557,16 @@ static struct speedtab pc98speedtab[] = { /* internal RS232C interface */
9600, 9600,
19200, 19200,
38400, 38400,
- 51200, 51200,
76800, 76800,
20800, 20800,
- 31200, 31200,
41600, 41600,
+ 15600, 15600,
+ 31200, 31200,
62400, 62400,
-1, -1
};
-static struct speedtab pc98fast_speedtab[] = {
- 9600, 0x80 | COMBRD(9600),
- 19200, 0x80 | COMBRD(19200),
- 38400, 0x80 | COMBRD(38400),
- 57600, 0x80 | COMBRD(57600),
- 115200, 0x80 | COMBRD(115200),
- -1, -1
-};
-static struct speedtab comspeedtab_pio9032b[] = {
+#ifdef COM_IF_PIO9032B
+struct speedtab comspeedtab_pio9032b[] = {
300, 6,
600, 5,
1200, 4,
@@ -601,82 +577,26 @@ static struct speedtab comspeedtab_pio9032b[] = {
38400, 7,
-1, -1
};
-static struct speedtab comspeedtab_b98_01[] = {
- 75, 11,
- 150, 10,
- 300, 9,
- 600, 8,
- 1200, 7,
- 2400, 6,
- 4800, 5,
- 9600, 4,
- 19200, 3,
- 38400, 2,
- 76800, 1,
- 153600, 0,
- -1, -1
-};
-static struct speedtab comspeedtab_mc16550[] = {
- 300, 1536,
- 600, 768,
- 1200, 384,
- 2400, 192,
- 4800, 96,
- 9600, 48,
- 19200, 24,
- 38400, 12,
- 57600, 8,
- 115200, 4,
- 153600, 3,
- 230400, 2,
- 460800, 1,
+#endif
+
+#ifdef COM_IF_B98_01
+struct speedtab comspeedtab_b98_01[] = {
+ 0, 0,
+ 75, 15,
+ 150, 14,
+ 300, 13,
+ 600, 12,
+ 1200, 11,
+ 2400, 10,
+ 4800, 9,
+ 9600, 8,
+ 19200, 7,
+ 38400, 6,
+ 76800, 5,
+ 153600, 4,
-1, -1
};
-static struct speedtab comspeedtab_rsb384[] = {
- 300, 3840,
- 600, 1920,
- 1200, 960,
- 2400, 480,
- 4800, 240,
- 9600, 120,
- 19200, 60,
- 38400, 30,
- 57600, 20,
- 115200, 10,
- 128000, 9,
- 144000, 8,
- 192000, 6,
- 230400, 5,
- 288000, 4,
- 384000, 3,
- 576000, 2,
- 1152000, 1,
- -1, -1
-};
-static struct speedtab comspeedtab_rsa[] = {
- { 0, 0 },
- { 50, COMBRD_RSA(50) },
- { 75, COMBRD_RSA(75) },
- { 110, COMBRD_RSA(110) },
- { 134, COMBRD_RSA(134) },
- { 150, COMBRD_RSA(150) },
- { 200, COMBRD_RSA(200) },
- { 300, COMBRD_RSA(300) },
- { 600, COMBRD_RSA(600) },
- { 1200, COMBRD_RSA(1200) },
- { 1800, COMBRD_RSA(1800) },
- { 2400, COMBRD_RSA(2400) },
- { 4800, COMBRD_RSA(4800) },
- { 9600, COMBRD_RSA(9600) },
- { 19200, COMBRD_RSA(19200) },
- { 38400, COMBRD_RSA(38400) },
- { 57600, COMBRD_RSA(57600) },
- { 115200, COMBRD_RSA(115200) },
- { 230400, COMBRD_RSA(230400) },
- { 460800, COMBRD_RSA(460800) },
- { 921600, COMBRD_RSA(921600) },
- { -1, -1 }
-};
+#endif
#endif /* PC98 */
static struct speedtab comspeedtab[] = {
@@ -701,100 +621,10 @@ static struct speedtab comspeedtab[] = {
{ -1, -1 }
};
-#ifdef PC98
-struct {
- char *name;
- short port_table[7];
- short irr_mask;
- struct speedtab *speedtab;
- short check_irq;
-} if_8251_type[] = {
- /* COM_IF_INTERNAL */
- { " (internal)", {0x30, 0x32, 0x32, 0x33, 0x35, -1, -1},
- -1, pc98speedtab, 1 },
- /* COM_IF_PC9861K_1 */
- { " (PC9861K)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, -1, -1},
- 3, NULL, 1 },
- /* COM_IF_PC9861K_2 */
- { " (PC9861K)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, -1, -1},
- 3, NULL, 1 },
- /* COM_IF_IND_SS_1 */
- { " (IND-SS)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, 0xb3, -1},
- 3, comspeedtab_mc16550, 1 },
- /* COM_IF_IND_SS_2 */
- { " (IND-SS)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, 0xbb, -1},
- 3, comspeedtab_mc16550, 1 },
- /* COM_IF_PIO9032B_1 */
- { " (PIO9032B)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, 0xb8, -1},
- 7, comspeedtab_pio9032b, 1 },
- /* COM_IF_PIO9032B_2 */
- { " (PIO9032B)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, 0xba, -1},
- 7, comspeedtab_pio9032b, 1 },
- /* COM_IF_B98_01_1 */
- { " (B98-01)", {0xb1, 0xb3, 0xb3, 0xb0, 0xb0, 0xd1, 0xd3},
- 7, comspeedtab_b98_01, 0 },
- /* COM_IF_B98_01_2 */
- { " (B98-01)", {0xb9, 0xbb, 0xbb, 0xb2, 0xb2, 0xd5, 0xd7},
- 7, comspeedtab_b98_01, 0 },
-};
-#define PC98SIO_data_port(type) (if_8251_type[type].port_table[0])
-#define PC98SIO_cmd_port(type) (if_8251_type[type].port_table[1])
-#define PC98SIO_sts_port(type) (if_8251_type[type].port_table[2])
-#define PC98SIO_in_modem_port(type) (if_8251_type[type].port_table[3])
-#define PC98SIO_intr_ctrl_port(type) (if_8251_type[type].port_table[4])
-#define PC98SIO_baud_rate_port(type) (if_8251_type[type].port_table[5])
-#define PC98SIO_func_port(type) (if_8251_type[type].port_table[6])
-
-struct {
- char *name;
- short irr_read;
- short irr_write;
- short port_shift;
- short io_size;
- struct speedtab *speedtab;
-} if_16550a_type[] = {
- /* COM_IF_RSA98 */
- { " (RSA-98)", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_NS16550 */
- { "", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_SECOND_CCU */
- { "", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_MC16550II */
- { " (MC16550II)", -1, 0x1000, 8, 1, comspeedtab_mc16550 },
- /* COM_IF_MCRS98 */
- { " (MC-RS98)", -1, 0x1000, 8, 1, comspeedtab_mc16550 },
- /* COM_IF_RSB3000 */
- { " (RSB-3000)", 0xbf, -1, 1, 1, comspeedtab_rsb384 },
- /* COM_IF_RSB384 */
- { " (RSB-384)", 0xbf, -1, 1, 1, comspeedtab_rsb384 },
- /* COM_IF_MODEM_CARD */
- { "", -1, -1, 0, IO_COMSIZE, comspeedtab },
- /* COM_IF_RSA98III */
- { " (RSA-98III)", -1, -1, 0, 16, comspeedtab_rsa },
- /* COM_IF_ESP98 */
- { " (ESP98)", -1, -1, 1, 1, comspeedtab_mc16550 },
-};
-#endif /* PC98 */
-
#ifdef COM_ESP
-#ifdef PC98
-
-/* XXX configure this properly. */
-static Port_t likely_com_ports[] = { 0, 0xb0, 0xb1, 0 };
-static Port_t likely_esp_ports[] = { 0xc0d0, 0 };
-
-#define ESP98_CMD1 (ESP_CMD1 * 0x100)
-#define ESP98_CMD2 (ESP_CMD2 * 0x100)
-#define ESP98_STATUS1 (ESP_STATUS1 * 0x100)
-#define ESP98_STATUS2 (ESP_STATUS2 * 0x100)
-
-#else /* PC98 */
-
/* XXX configure this properly. */
static Port_t likely_com_ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, };
static Port_t likely_esp_ports[] = { 0x140, 0x180, 0x280, 0 };
-
-#endif /* PC98 */
#endif
/*
@@ -865,7 +695,17 @@ static int sioinit __P((struct pccard_devinfo *));
static void siounload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-PCCARD_MODULE(sio, sioinit, siounload, card_intr, 0, tty_imask);
+static struct pccard_device sio_info = {
+ driver_name,
+ sioinit,
+ siounload,
+ card_intr,
+ 0, /* Attributes - presently unused */
+ &tty_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
+DATA_SET(pccarddrv_set, sio_info);
/*
* Initialize the device - called from Slot manager.
@@ -932,9 +772,6 @@ siounload(struct pccard_devinfo *devi)
ttwwakeup(com->tp);
} else {
com_addr(com->unit) = NULL;
-#ifdef PC98
- bzero(com->ibuf1, com->CE_INPUT_OFFSET * 6);
-#endif
bzero(com, sizeof *com);
free(com,M_TTYS);
printf("sio%d: unload,gone\n", devi->isahd.id_unit);
@@ -977,9 +814,7 @@ sioprobe(dev)
int irqout=0;
int ret = 0;
int tmp;
- int port_shift = 0;
- struct siodev iod;
- Port_t rsabase = NULL;
+ struct siodev iod;
#endif
if (!already_init) {
@@ -990,26 +825,13 @@ sioprobe(dev)
* XXX the gate enable is elsewhere for some multiports.
*/
for (xdev = isa_devtab_tty; xdev->id_driver != NULL; xdev++)
+ if (xdev->id_driver == &siodriver && xdev->id_enabled)
#ifdef PC98
- if (xdev->id_driver == &siodriver && xdev->id_enabled) {
- tmp = (xdev->id_flags >> 24) & 0xff;
- if (IS_8251(tmp))
- outb((xdev->id_iobase & 0xff00) | PC98SIO_cmd_port(tmp & 0x0f), 0xf2);
- else
- if (tmp == COM_IF_RSA98III) {
- rsabase = xdev->id_iobase & 0xfff0;
-#if 0
- if (rsabase != xdev->id_iobase)
- return(0);
+ if (IS_PC98IN(xdev->id_iobase))
+ outb(xdev->id_iobase + 2, 0xf2);
+ else
#endif
- outb(xdev->id_iobase + 8 + (com_mcr << if_16550a_type[tmp & 0x0f].port_shift), 0);
- } else
- outb(xdev->id_iobase + (com_mcr << if_16550a_type[tmp & 0x0f].port_shift), 0);
- }
-#else
- if (xdev->id_driver == &siodriver && xdev->id_enabled)
outb(xdev->id_iobase + com_mcr, 0);
-#endif
already_init = TRUE;
}
@@ -1020,15 +842,14 @@ sioprobe(dev)
#ifdef PC98
DELAY(10);
-
/*
* If the port is i8251 UART (internal, B98_01)
*/
- if (pc98_check_if_type(dev, &iod) == -1)
- return 0;
- if (iod.irq > 0)
- dev->id_irq = 1 << iod.irq;
- if (IS_8251(iod.if_type)) {
+ if(pc98_check_if_type(dev->id_iobase, &iod) == -1)
+ return 0;
+ if(IS_8251(iod.if_type)){
+ if ( iod.irq > 0 )
+ dev->id_irq = (1 << iod.irq);
outb(iod.cmd, 0);
DELAY(10);
outb(iod.cmd, 0);
@@ -1044,20 +865,23 @@ sioprobe(dev)
if (( inb(iod.sts) & STS8251_TxEMP ) == 0 ) {
ret = 0;
}
- if (if_8251_type[iod.if_type & 0x0f].check_irq) {
- COM_INT_DISABLE
- tmp = ( inb( iod.ctrl ) & ~(IEN_Rx|IEN_TxEMP|IEN_Tx));
- outb( iod.ctrl, tmp|IEN_TxEMP );
- DELAY(10);
- ret = isa_irq_pending() ? 4 : 0;
- outb( iod.ctrl, tmp );
- COM_INT_ENABLE
- } else {
- /*
- * B98_01 doesn't activate TxEMP interrupt line
- * when being reset, so we can't check irq pending.
- */
- ret = 4;
+ switch (iod.if_type) {
+ case COM_IF_INTERNAL:
+ COM_INT_DISABLE
+ tmp = ( inb( iod.ctrl ) & ~(IEN_Rx|IEN_TxEMP|IEN_Tx));
+ outb( iod.ctrl, tmp|IEN_TxEMP );
+ DELAY(10);
+ ret = isa_irq_pending() ? 4 : 0;
+ outb( iod.ctrl, tmp );
+ COM_INT_ENABLE
+ break;
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ /* B98_01 doesn't activate TxEMP interrupt line
+ when being reset, so we can't check irq pending.*/
+ ret = 4;
+ break;
+#endif
}
if (epson_machine_id==0x20) { /* XXX */
ret = 4;
@@ -1075,22 +899,6 @@ sioprobe(dev)
*/
idev = dev;
mcr_image = MCR_IENABLE;
-#ifdef PC98
- if (iod.if_type == COM_IF_RSA98III) {
- mcr_image = 0;
- rsabase = idev->id_iobase & 0xfff0;
- if (rsabase != idev->id_iobase)
- return(0);
- outb(rsabase + rsa_msr, 0x04);
- outb(rsabase + rsa_frr, 0x00);
- if ((inb(rsabase + rsa_srr) & 0x36) != 0x36)
- return (0);
- outb(rsabase + rsa_ier, 0x00);
- outb(rsabase + rsa_frr, 0x00);
- outb(rsabase + rsa_tivsr, 0x00);
- outb(rsabase + rsa_tcr, 0x00);
- }
-#endif /* PC98 */
#ifdef COM_MULTIPORT
if (COM_ISMULTIPORT(dev)) {
idev = find_isadev(isa_devtab_tty, &siodriver,
@@ -1114,28 +922,18 @@ sioprobe(dev)
mcr_image = 0;
#ifdef PC98
- tmp = if_16550a_type[iod.if_type & 0x0f].irr_write;
- if (tmp != -1) {
- /* MC16550II */
- switch (idev->id_irq) {
- case IRQ3: irqout = 4; break;
- case IRQ5: irqout = 5; break;
- case IRQ6: irqout = 6; break;
- case IRQ12: irqout = 7; break;
- default:
- printf("sio%d: irq configuration error\n", dev->id_unit);
- return (0);
- }
- outb((dev->id_iobase & 0x00ff) | tmp, irqout);
+ switch(idev->id_irq){
+ case IRQ3: irqout = 4; break;
+ case IRQ5: irqout = 5; break;
+ case IRQ6: irqout = 6; break;
+ case IRQ12: irqout = 7; break;
+ default:
+ printf("sio%d: irq configuration error\n",dev->id_unit);
+ return (0);
}
- port_shift = if_16550a_type[iod.if_type & 0x0f].port_shift;
+ outb(dev->id_iobase+0x1000, irqout);
#endif
bzero(failures, sizeof failures);
-#ifdef PC98
- if (iod.if_type == COM_IF_RSA98III)
- iobase = dev->id_iobase + 8;
- else
-#endif
iobase = dev->id_iobase;
/*
@@ -1160,19 +958,10 @@ sioprobe(dev)
if (iobase == siocniobase)
DELAY((16 + 1) * 1000000 / (comdefaultrate / 10));
else {
-#ifdef PC98
- tmp = ttspeedtab(SIO_TEST_SPEED,
- if_16550a_type[iod.if_type & 0x0f].speedtab);
- outb(iobase + (com_cfcr << port_shift), CFCR_DLAB|CFCR_8BITS);
- outb(iobase + (com_dlbl << port_shift), tmp & 0xff);
- outb(iobase + (com_dlbh << port_shift), (tmp >> 8) & 0xff);
- outb(iobase + (com_cfcr << port_shift), CFCR_8BITS);
-#else
outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
outb(iobase + com_dlbl, COMBRD(SIO_TEST_SPEED) & 0xff);
outb(iobase + com_dlbh, (u_int) COMBRD(SIO_TEST_SPEED) >> 8);
outb(iobase + com_cfcr, CFCR_8BITS);
-#endif
DELAY((16 + 1) * 1000000 / (SIO_TEST_SPEED / 10));
}
@@ -1182,13 +971,8 @@ sioprobe(dev)
* guarantee an edge trigger if an interrupt can be generated.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), mcr_image);
- outb(iobase + (com_ier << port_shift), 0);
-#else
outb(iobase + com_mcr, mcr_image);
outb(iobase + com_ier, 0);
-#endif
DELAY(1000); /* XXX */
irqmap[0] = isa_irq_pending();
@@ -1197,11 +981,7 @@ sioprobe(dev)
* without annoying any external device.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), mcr_image | MCR_LOOPBACK);
-#else
outb(iobase + com_mcr, mcr_image | MCR_LOOPBACK);
-#endif
/*
* Attempt to generate an output interrupt. On 8250's, setting
@@ -1211,14 +991,7 @@ sioprobe(dev)
* current setting. On 16550A's, setting IER_ETXRDY only
* generates an interrupt when IER_ETXRDY is not already set.
*/
-#ifdef PC98
- outb(iobase + (com_ier << port_shift), IER_ETXRDY);
- if (iod.if_type == COM_IF_RSA98III) {
- outb(rsabase + rsa_ier, 0x04);
- }
-#else
outb(iobase + com_ier, IER_ETXRDY);
-#endif /* PC98 */
/*
* On some 16x50 incompatibles, setting IER_ETXRDY doesn't generate
@@ -1226,11 +999,7 @@ sioprobe(dev)
* output. Loopback may be broken on the same incompatibles but
* it's unlikely to do more than allow the null byte out.
*/
-#ifdef PC98
- outb(iobase + (com_data << port_shift), 0);
-#else
outb(iobase + com_data, 0);
-#endif
DELAY((1 + 2) * 1000000 / (SIO_TEST_SPEED / 10));
/*
@@ -1241,11 +1010,7 @@ sioprobe(dev)
* are disabled.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), mcr_image);
-#else
outb(iobase + com_mcr, mcr_image);
-#endif /* PC98 */
/*
* It's a definitly Serial PCMCIA(16550A), but still be required
@@ -1255,28 +1020,14 @@ sioprobe(dev)
/* Reading IIR register twice */
for ( fn = 0; fn < 2; fn ++ ) {
DELAY(10000);
-#ifdef PC98
- failures[6] = inb(iobase + (com_iir << port_shift));
-#else
failures[6] = inb(iobase + com_iir);
-#endif
}
/* Check IIR_TXRDY clear ? */
-#ifdef PC98
- result = if_16550a_type[iod.if_type & 0x0f].io_size;
-#else
result = IO_COMSIZE;
-#endif
if ( failures[6] & IIR_TXRDY ) {
/* Nop, Double check with clearing IER */
-#ifdef PC98
- outb(iobase + (com_ier << port_shift), 0);
- if (inb(iobase +
- (com_iir << port_shift)) & IIR_NOPEND) {
-#else
outb(iobase + com_ier, 0);
if ( inb(iobase + com_iir) & IIR_NOPEND ) {
-#endif
/* Ok. we're familia this gang */
dev->id_flags |= COM_C_IIR_TXRDYBUG; /* Set IIR_TXRDYBUG */
} else {
@@ -1287,11 +1038,7 @@ sioprobe(dev)
/* OK. this is well-known guys */
dev->id_flags &= ~COM_C_IIR_TXRDYBUG; /*Clear IIR_TXRDYBUG*/
}
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift), CFCR_8BITS);
-#else
outb(iobase + com_cfcr, CFCR_8BITS);
-#endif
enable_intr();
return (iobase == siocniobase ? IO_COMSIZE : result);
}
@@ -1305,37 +1052,15 @@ sioprobe(dev)
* o the interrupt goes away when the IIR in the UART is read.
*/
/* EXTRA DELAY? */
-#ifdef PC98
- failures[0] = inb(iobase + (com_cfcr << port_shift)) - CFCR_8BITS;
- failures[1] = inb(iobase + (com_ier << port_shift)) - IER_ETXRDY;
- failures[2] = inb(iobase + (com_mcr << port_shift)) - mcr_image;
-#else
failures[0] = inb(iobase + com_cfcr) - CFCR_8BITS;
failures[1] = inb(iobase + com_ier) - IER_ETXRDY;
failures[2] = inb(iobase + com_mcr) - mcr_image;
-#endif
DELAY(10000); /* Some internal modems need this time */
irqmap[1] = isa_irq_pending();
-#ifdef PC98
- failures[4] = (inb(iobase + (com_iir << port_shift)) & IIR_IMASK)
- - IIR_TXRDY;
- if (iod.if_type == COM_IF_RSA98III) {
- inb(rsabase + rsa_srr);
- }
-#else
failures[4] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_TXRDY;
-#endif
DELAY(1000); /* XXX */
irqmap[2] = isa_irq_pending();
-#ifdef PC98
- failures[6] = (inb(iobase + (com_iir << port_shift)) & IIR_IMASK)
- - IIR_NOPEND;
- if (iod.if_type == COM_IF_RSA98III) {
- inb(rsabase + rsa_srr);
- }
-#else
failures[6] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_NOPEND;
-#endif
/*
* Turn off all device interrupts and check that they go off properly.
@@ -1346,30 +1071,12 @@ sioprobe(dev)
* (On the system that this was first tested on, the input floats high
* and gives a (masked) interrupt as soon as the gate is closed.)
*/
-#ifdef PC98
- outb(iobase + (com_ier << port_shift), 0);
- outb(iobase + (com_cfcr << port_shift), CFCR_8BITS);
- failures[7] = inb(iobase + (com_ier << port_shift));
- if (iod.if_type == COM_IF_RSA98III) {
- outb(rsabase + rsa_ier, 0x00);
- }
-#else
outb(iobase + com_ier, 0);
outb(iobase + com_cfcr, CFCR_8BITS); /* dummy to avoid bus echo */
failures[7] = inb(iobase + com_ier);
-#endif
DELAY(1000); /* XXX */
irqmap[3] = isa_irq_pending();
-#ifdef PC98
- failures[9] = (inb(iobase + (com_iir << port_shift)) & IIR_IMASK)
- - IIR_NOPEND;
- if (iod.if_type == COM_IF_RSA98III) {
- inb(rsabase + rsa_srr);
- outb(rsabase + rsa_frr, 0x00);
- }
-#else
failures[9] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_NOPEND;
-#endif
enable_intr();
@@ -1382,18 +1089,10 @@ sioprobe(dev)
printf("sio%d: irq maps: %#x %#x %#x %#x\n",
dev->id_unit, irqmap[0], irqmap[1], irqmap[2], irqmap[3]);
-#ifdef PC98
- result = if_16550a_type[iod.if_type & 0x0f].io_size;
-#else
result = IO_COMSIZE;
-#endif
for (fn = 0; fn < sizeof failures; ++fn)
if (failures[fn]) {
-#ifdef PC98
- outb(iobase + (com_mcr << port_shift), 0);
-#else
outb(iobase + com_mcr, 0);
-#endif
result = 0;
if (bootverbose) {
printf("sio%d: probe failed test(s):",
@@ -1433,22 +1132,13 @@ espattach(isdp, com, esp_port)
*/
/* Get the dip-switch configuration */
-#ifdef PC98
- outb(esp_port + ESP98_CMD1, ESP_GETDIPS);
- dips = inb(esp_port + ESP98_STATUS1);
-#else
outb(esp_port + ESP_CMD1, ESP_GETDIPS);
dips = inb(esp_port + ESP_STATUS1);
-#endif
/*
* Bits 0,1 of dips say which COM port we are.
*/
-#ifdef PC98
- if ((com->iobase & 0xff) == likely_com_ports[dips & 0x03])
-#else
if (com->iobase == likely_com_ports[dips & 0x03])
-#endif
printf(" : ESP");
else {
printf(" esp_port has com %d\n", dips & 0x03);
@@ -1458,15 +1148,9 @@ espattach(isdp, com, esp_port)
/*
* Check for ESP version 2.0 or later: bits 4,5,6 = 010.
*/
-#ifdef PC98
- outb(esp_port + ESP98_CMD1, ESP_GETTEST);
- val = inb(esp_port + ESP98_STATUS1); /* clear reg 1 */
- val = inb(esp_port + ESP98_STATUS2);
-#else
outb(esp_port + ESP_CMD1, ESP_GETTEST);
val = inb(esp_port + ESP_STATUS1); /* clear reg 1 */
val = inb(esp_port + ESP_STATUS2);
-#endif
if ((val & 0x70) < 0x20) {
printf("-old (%o)", val & 0x70);
return (0);
@@ -1501,28 +1185,11 @@ sioattach(isdp)
Port_t iobase;
int s;
int unit;
-#ifdef PC98
- int port_shift = 0;
- u_long ibufsize;
-#endif
- isdp->id_ointr = siointr;
isdp->id_ri_flags |= RI_FAST;
-#ifdef PC98
- if (((isdp->id_flags >> 24) & 0xff) == COM_IF_RSA98III)
- iobase = isdp->id_iobase + 8;
- else
-#endif
iobase = isdp->id_iobase;
unit = isdp->id_unit;
-#ifndef PC98
com = malloc(sizeof *com, M_TTYS, M_NOWAIT);
-#else
- ibufsize = RS_IBUFSIZE;
- if (((isdp->id_flags >> 24) & 0xff) == COM_IF_RSA98III)
- ibufsize = 2048;
- com = malloc((sizeof *com) + ibufsize * 6, M_TTYS, M_NOWAIT);
-#endif
if (com == NULL)
return (0);
@@ -1539,14 +1206,6 @@ sioattach(isdp)
* device from sending before we are ready.
*/
bzero(com, sizeof *com);
-#ifdef PC98
- com->CE_INPUT_OFFSET = ibufsize;
- com->ibuf1 = (u_char *)com + (sizeof *com);
- com->ibuf2 = com->ibuf1 + (ibufsize * 2);
- com->obuf1 = com->ibuf2 + (ibufsize * 2);
- com->obuf2 = com->obuf1 + ibufsize;
- bzero(com->ibuf1, ibufsize * 6);
-#endif
com->unit = unit;
com->cfcr_image = CFCR_8BITS;
com->dtr_wait = 3 * hz;
@@ -1554,29 +1213,24 @@ sioattach(isdp)
com->no_irq = isdp->id_irq == 0;
com->tx_fifo_size = 1;
com->iptr = com->ibuf = com->ibuf1;
-#ifndef PC98
com->ibufend = com->ibuf1 + RS_IBUFSIZE;
com->ihighwater = com->ibuf1 + RS_IHIGHWATER;
-#else
- com->ibufend = com->ibuf1 + com->CE_INPUT_OFFSET;
- com->ihighwater = com->ibuf1 + (3 * com->CE_INPUT_OFFSET / 4);
-#endif
com->obufs[0].l_head = com->obuf1;
com->obufs[1].l_head = com->obuf2;
com->iobase = iobase;
#ifdef PC98
- if (pc98_set_ioport(com, isdp->id_flags) == -1) {
- com->pc98_if_type = (isdp->id_flags >> 24) & 0xff;
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
- com->data_port = iobase + (com_data << port_shift);
- com->int_id_port = iobase + (com_iir << port_shift);
- com->modem_ctl_port = iobase + (com_mcr << port_shift);
- com->mcr_image = inb(com->modem_ctl_port);
- com->line_status_port = iobase + (com_lsr << port_shift);
- com->modem_status_port = iobase + (com_msr << port_shift);
- com->intr_ctl_port = iobase + (com_ier << port_shift);
- }
+ if(pc98_set_ioport(com, iobase) == -1)
+ if((iobase & 0x0f0) == 0xd0) {
+ com->pc98_if_type = MC16550;
+ com->data_port = iobase + com_data;
+ com->int_id_port = iobase + com_iir;
+ com->modem_ctl_port = iobase + com_mcr;
+ com->mcr_image = inb(com->modem_ctl_port);
+ com->line_status_port = iobase + com_lsr;
+ com->modem_status_port = iobase + com_msr;
+ com->intr_ctl_port = iobase + com_ier;
+ }
#else /* not PC98 */
com->data_port = iobase + com_data;
com->int_id_port = iobase + com_iir;
@@ -1599,7 +1253,7 @@ sioattach(isdp)
com->it_in.c_lflag = 0;
if (unit == comconsole) {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
DELAY(100000);
#endif
com->it_in.c_iflag = TTYDEF_IFLAG;
@@ -1618,6 +1272,12 @@ sioattach(isdp)
/* attempt to determine UART type */
printf("sio%d: type", unit);
+#ifdef DSI_SOFT_MODEM
+ if((inb(iobase+7) ^ inb(iobase+7)) & 0x80) {
+ printf(" Digicom Systems, Inc. SoftModem");
+ goto determined_type;
+ }
+#endif /* DSI_SOFT_MODEM */
#ifndef PC98
#ifdef COM_MULTIPORT
@@ -1643,17 +1303,35 @@ sioattach(isdp)
}
#endif /* !PC98 */
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
- com_int_TxRx_disable( com );
- com_cflag_and_speed_set( com, com->it_in.c_cflag, comdefaultrate );
- com_tiocm_bic( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
- com_send_break_off( com );
- printf(" 8251%s", if_8251_type[com->pc98_if_type & 0x0f].name);
+ if(IS_8251(com->pc98_if_type)){
+ com_int_TxRx_disable( com );
+ com_cflag_and_speed_set( com, com->it_in.c_cflag,
+ comdefaultrate );
+ com_tiocm_bic( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
+ com_send_break_off( com );
+ switch(com->pc98_if_type){
+ case COM_IF_INTERNAL:
+ printf(" 8251 (internal)");
+ break;
+#ifdef COM_IF_PC9861K
+ case COM_IF_PC9861K:
+ printf(" 8251 (PC9861K)");
+ break;
+#endif
+#ifdef COM_IF_PIO9032B
+ case COM_IF_PIO9032B:
+ printf(" 8251 (PIO9032B)");
+ break;
+#endif
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ printf(" 8251 (B98_01)");
+ break;
+#endif
+ }
} else {
- outb(iobase + (com_fifo << port_shift), FIFO_ENABLE | FIFO_RX_HIGH);
-#else
- outb(iobase + com_fifo, FIFO_ENABLE | FIFO_RX_HIGH);
#endif /* PC98 */
+ outb(iobase + com_fifo, FIFO_ENABLE | FIFO_RX_HIGH);
DELAY(100);
com->st16650a = 0;
switch (inb(com->int_id_port) & IIR_FIFO_MASK) {
@@ -1671,10 +1349,6 @@ sioattach(isdp)
printf(" 16550A fifo disabled");
} else {
com->hasfifo = TRUE;
-#ifdef PC98
- com->tx_fifo_size = 0; /* XXX flag conflicts. */
- printf(" 16550A");
-#else
if (COM_ST16650A(isdp)) {
com->st16650a = 1;
com->tx_fifo_size = 32;
@@ -1683,21 +1357,8 @@ sioattach(isdp)
com->tx_fifo_size = COM_FIFOSIZE(isdp);
printf(" 16550A");
}
-#endif
- }
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- com->tx_fifo_size = 2048;
- com->rsabase = isdp->id_iobase;
- outb(com->rsabase + rsa_ier, 0x00);
- outb(com->rsabase + rsa_frr, 0x00);
}
-#endif
-
#ifdef COM_ESP
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_ESP98)
-#endif
for (espp = likely_esp_ports; *espp != 0; espp++)
if (espattach(isdp, com, *espp)) {
com->tx_fifo_size = 1024;
@@ -1715,17 +1376,6 @@ sioattach(isdp)
break;
}
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSB3000) {
- /* Set RSB-2000/3000 Extended Buffer mode. */
- u_char lcr;
- lcr = inb(iobase + (com_cfcr << port_shift));
- outb(iobase + (com_cfcr << port_shift), lcr | CFCR_DLAB);
- outb(iobase + (com_emr << port_shift), EMR_EXBUFF | EMR_EFMODE);
- outb(iobase + (com_cfcr << port_shift), lcr);
- }
-#endif
-
#ifdef COM_ESP
if (com->esp) {
/*
@@ -1735,53 +1385,23 @@ sioattach(isdp)
* bursts of input.
* XXX flow control should be set in comparam(), not here.
*/
-#ifdef PC98
- outb(com->esp_port + ESP98_CMD1, ESP_SETMODE);
- outb(com->esp_port + ESP98_CMD2, ESP_MODE_RTS | ESP_MODE_FIFO);
-#else
outb(com->esp_port + ESP_CMD1, ESP_SETMODE);
outb(com->esp_port + ESP_CMD2, ESP_MODE_RTS | ESP_MODE_FIFO);
-#endif
/* Set RTS/CTS flow control. */
-#ifdef PC98
- outb(com->esp_port + ESP98_CMD1, ESP_SETFLOWTYPE);
- outb(com->esp_port + ESP98_CMD2, ESP_FLOW_RTS);
- outb(com->esp_port + ESP98_CMD2, ESP_FLOW_CTS);
-#else
outb(com->esp_port + ESP_CMD1, ESP_SETFLOWTYPE);
outb(com->esp_port + ESP_CMD2, ESP_FLOW_RTS);
outb(com->esp_port + ESP_CMD2, ESP_FLOW_CTS);
-#endif
/* Set flow-control levels. */
-#ifdef PC98
- outb(com->esp_port + ESP98_CMD1, ESP_SETRXFLOW);
- outb(com->esp_port + ESP98_CMD2, HIBYTE(768));
- outb(com->esp_port + ESP98_CMD2, LOBYTE(768));
- outb(com->esp_port + ESP98_CMD2, HIBYTE(512));
- outb(com->esp_port + ESP98_CMD2, LOBYTE(512));
-#else
outb(com->esp_port + ESP_CMD1, ESP_SETRXFLOW);
outb(com->esp_port + ESP_CMD2, HIBYTE(768));
outb(com->esp_port + ESP_CMD2, LOBYTE(768));
outb(com->esp_port + ESP_CMD2, HIBYTE(512));
outb(com->esp_port + ESP_CMD2, LOBYTE(512));
-#endif
-
-#ifdef PC98
- /* Set UART clock prescaler. */
- outb(com->esp_port + ESP98_CMD1, ESP_SETCLOCK);
- outb(com->esp_port + ESP98_CMD2, 2); /* 4 times */
-#endif
}
#endif /* COM_ESP */
-#ifdef PC98
- printf("%s", if_16550a_type[com->pc98_if_type & 0x0f].name);
- outb(iobase + (com_fifo << port_shift), 0);
-#else
outb(iobase + com_fifo, 0);
-#endif
determined_type: ;
#ifdef COM_MULTIPORT
@@ -1793,7 +1413,7 @@ determined_type: ;
printf(")");
com->no_irq = find_isadev(isa_devtab_tty, &siodriver,
COM_MPMASTER(isdp))->id_irq == 0;
- }
+ }
#endif /* COM_MULTIPORT */
#ifdef PC98
}
@@ -1852,9 +1472,6 @@ sioopen(dev, flag, mode, p)
int s;
struct tty *tp;
int unit;
-#ifdef PC98
- int port_shift = 0;
-#endif
mynor = minor(dev);
unit = MINOR_TO_UNIT(mynor);
@@ -1870,11 +1487,6 @@ sioopen(dev, flag, mode, p)
tp = com->tp = &sio_tty[unit];
#endif
s = spltty();
-
-#ifdef PC98
- if (!IS_8251(com->pc98_if_type))
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
-#endif
/*
* We jump to this label after all non-interrupted sleeps to pick
* up any changes of the device state.
@@ -1928,15 +1540,11 @@ open_top:
tp->t_dev = dev;
tp->t_termios = mynor & CALLOUT_MASK
? com->it_out : com->it_in;
-#ifndef PC98
tp->t_ififosize = 2 * RS_IBUFSIZE;
-#else
- tp->t_ififosize = 2 * com->CE_INPUT_OFFSET;
-#endif
tp->t_ispeedwat = (speed_t)-1;
tp->t_ospeedwat = (speed_t)-1;
#ifdef PC98
- if (!IS_8251(com->pc98_if_type))
+ if(!IS_8251(com->pc98_if_type))
#endif
(void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
com->poll = com->no_irq;
@@ -1947,7 +1555,7 @@ open_top:
if (error != 0)
goto out;
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
com_tiocm_bis(com, TIOCM_DTR|TIOCM_RTS);
pc98_msrint_start(dev);
}
@@ -1969,17 +1577,9 @@ open_top:
* input.
*/
while (TRUE) {
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift),
- FIFO_RCV_RST | FIFO_XMT_RST
- | com->fifo_image);
- if (com->pc98_if_type == COM_IF_RSA98III)
- outb(com->rsabase + rsa_frr , 0x00);
-#else
outb(iobase + com_fifo,
FIFO_RCV_RST | FIFO_XMT_RST
| com->fifo_image);
-#endif
/*
* XXX the delays are for superstitious
* historical reasons. It must be less than
@@ -1992,19 +1592,9 @@ open_top:
* for about 85 usec instead of 100.
*/
DELAY(50);
-#ifndef PC98
if (!(inb(com->line_status_port) & LSR_RXRDY))
-#else
- if (com->pc98_if_type == COM_IF_RSA98III
- ? !(inb(com->rsabase + rsa_srr) & 0x08)
- : !(inb(com->line_status_port) & LSR_RXRDY))
-#endif
break;
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift), 0);
-#else
outb(iobase + com_fifo, 0);
-#endif
DELAY(50);
(void) inb(com->data_port);
}
@@ -2012,10 +1602,11 @@ open_top:
disable_intr();
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
- com_tiocm_bis(com, TIOCM_LE);
- com->pc98_prev_modem_status = pc98_get_modem_status(com);
- com_int_Rx_enable(com);
+ if(IS_8251(com->pc98_if_type)){
+ com_tiocm_bis(com, TIOCM_LE);
+ com->pc98_prev_modem_status =
+ pc98_get_modem_status(com);
+ com_int_Rx_enable(com);
} else {
#endif
(void) inb(com->line_status_port);
@@ -2030,12 +1621,6 @@ open_top:
| IER_ERLS | IER_EMSC);
}
#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- outb(com->rsabase + rsa_ier, 0x1d);
- outb(com->intr_ctl_port, IER_ERLS | IER_EMSC);
- }
-#endif
-#ifdef PC98
}
#endif
enable_intr();
@@ -2137,9 +1722,6 @@ comhardclose(com)
int s;
struct tty *tp;
int unit;
-#ifdef PC98
- int port_shift = 0;
-#endif
unit = com->unit;
iobase = com->iobase;
@@ -2149,32 +1731,22 @@ comhardclose(com)
com->do_timestamp = FALSE;
com->do_dcd_timestamp = FALSE;
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- com_send_break_off(com);
- else {
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
- outb(iobase + (com_cfcr << port_shift),
- com->cfcr_image &= ~CFCR_SBREAK);
- }
-#else
- outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
+ if(IS_8251(com->pc98_if_type))
+ com_send_break_off(com);
+ else
#endif
+ outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
{
#ifdef PC98
int tmp;
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_int_TxRx_disable(com);
else
- outb(iobase + (com_ier << port_shift), 0);
- if (com->pc98_if_type == COM_IF_RSA98III) {
- outb(com->rsabase + rsa_ier, 0x00);
- }
-#else
- outb(iobase + com_ier, 0);
#endif
+ outb(iobase + com_ier, 0);
tp = com->tp;
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = pc98_get_modem_status(com) & TIOCM_CAR;
else
tmp = com->prev_modem_status & MSR_DCD;
@@ -2196,8 +1768,8 @@ comhardclose(com)
&& !(com->it_in.c_cflag & CLOCAL)
|| !(tp->t_state & TS_ISOPEN)) {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- com_tiocm_bic(com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE);
+ if(IS_8251(com->pc98_if_type))
+ com_tiocm_bic(com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE);
else
#endif
(void)commctl(com, TIOCM_DTR, DMBIC);
@@ -2208,7 +1780,7 @@ comhardclose(com)
}
#ifdef PC98
else {
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bic(com, TIOCM_LE );
}
#endif
@@ -2219,11 +1791,7 @@ comhardclose(com)
* reboots. Some BIOSes fail to detect 16550s when the
* fifos are enabled.
*/
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift), 0);
-#else
outb(iobase + com_fifo, 0);
-#endif
}
com->active_out = FALSE;
wakeup(&com->active_out);
@@ -2329,7 +1897,7 @@ siodtrwakeup(chan)
wakeup(&com->dtr_wait);
}
-static void
+void
siointr(unit)
int unit;
{
@@ -2340,9 +1908,6 @@ siointr(unit)
#else /* COM_MULTIPORT */
struct com_s *com;
bool_t possibly_more_intrs;
-#ifdef PC98
- u_char rsa_buf_status;
-#endif
/*
* Loop until there is no activity on any port. This is necessary
@@ -2367,20 +1932,6 @@ siointr(unit)
siointr1(com);
} else
#endif /* PC98 */
-#ifdef PC98
- if (com != NULL
- && !com->gone
- && com->pc98_if_type == COM_IF_RSA98III) {
- rsa_buf_status = inb(com->rsabase + rsa_srr) & 0xc9;
- if ((rsa_buf_status & 0xc8)
- || !(rsa_buf_status & 0x01)) {
- siointr1(com);
- if(rsa_buf_status
- != (inb(com->rsabase + rsa_srr) & 0xc9))
- possibly_more_intrs = TRUE;
- }
- } else
-#endif
if (com != NULL
&& !com->gone
&& (inb(com->int_id_port) & IIR_IMASK)
@@ -2403,14 +1954,13 @@ siointr1(com)
u_char modem_status;
u_char *ioptr;
u_char recv_data;
+ u_char int_ident;
u_char int_ctl;
u_char int_ctl_new;
#ifdef PC98
u_char tmp=0;
- u_char rsa_buf_status = 0;
- int rsa_tx_fifo_size=0;
- recv_data=0;
+recv_data=0;
#endif /* PC98 */
int_ctl = inb(com->intr_ctl_port);
@@ -2433,38 +1983,19 @@ more_intr:
} else
#endif /* PC98 */
line_status = inb(com->line_status_port);
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III)
- rsa_buf_status = inb(com->rsabase + rsa_srr);
-#endif /* PC98 */
/* input event? (check first to help avoid overruns) */
-#ifndef PC98
while (line_status & LSR_RCV_MASK) {
-#else
- while ((line_status & LSR_RCV_MASK)
- || (com->pc98_if_type == COM_IF_RSA98III
- && (rsa_buf_status & 0x08))) {
-#endif /* PC98 */
/* break/unnattached error bits or real input? */
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
recv_data = inb(com->data_port);
- if (tmp & 0x78) {
+ if(tmp & 0x78){
pc98_i8251_or_cmd(com,CMD8251_ER);
recv_data = 0;
}
} else {
#endif /* PC98 */
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- if (!(rsa_buf_status & 0x08))
- recv_data = 0;
- else {
- recv_data = inb(com->data_port);
- }
- } else
-#endif
if (!(line_status & LSR_RXRDY))
recv_data = 0;
else
@@ -2521,16 +2052,12 @@ if (com->iptr - com->ibuf == 8)
setsofttty();
#endif
ioptr[0] = recv_data;
-#ifdef PC98
- ioptr[com->CE_INPUT_OFFSET] = line_status;
-#else
ioptr[CE_INPUT_OFFSET] = line_status;
-#endif
com->iptr = ++ioptr;
if (ioptr == com->ihighwater
&& com->state & CS_RTS_IFLOW)
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bic(com, TIOCM_RTS);
else
#endif
@@ -2545,20 +2072,16 @@ cont:
* jump from the top of the loop to here
*/
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
goto status_read;
else
#endif
line_status = inb(com->line_status_port) & 0x7F;
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III)
- rsa_buf_status = inb(com->rsabase + rsa_srr);
-#endif /* PC98 */
}
/* modem status change? (always check before doing output) */
#ifdef PC98
- if (!IS_8251(com->pc98_if_type)) {
+ if(!IS_8251(com->pc98_if_type)){
#endif
modem_status = inb(com->modem_status_port);
if (modem_status != com->last_modem_status) {
@@ -2593,30 +2116,13 @@ cont:
#endif
/* output queued and everything ready? */
-#ifndef PC98
if (line_status & LSR_TXRDY
&& com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
-#else
- if (((com->pc98_if_type == COM_IF_RSA98III)
- ? (rsa_buf_status & 0x02)
- : (line_status & LSR_TXRDY))
- && com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) {
-#endif
ioptr = com->obufq.l_head;
if (com->tx_fifo_size > 1) {
u_int ocount;
ocount = com->obufq.l_tail - ioptr;
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- rsa_buf_status = inb(com->rsabase + rsa_srr);
- rsa_tx_fifo_size = 1024;
- if (!(rsa_buf_status & 0x01))
- rsa_tx_fifo_size = 2048;
- if (ocount > rsa_tx_fifo_size)
- ocount = rsa_tx_fifo_size;
- } else
-#endif
if (ocount > com->tx_fifo_size)
ocount = com->tx_fifo_size;
com->bytes_out += ocount;
@@ -2628,8 +2134,8 @@ cont:
++com->bytes_out;
}
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- if (!(pc98_check_i8251_interrupt(com) & IEN_TxFLAG))
+ if(IS_8251(com->pc98_if_type))
+ if ( !(pc98_check_i8251_interrupt(com) & IEN_TxFLAG) )
com_int_Tx_enable(com);
#endif
com->obufq.l_head = ioptr;
@@ -2653,9 +2159,9 @@ cont:
}
com->state &= ~CS_BUSY;
#if defined(PC98)
- if (IS_8251(com->pc98_if_type))
- if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
- com_int_Tx_disable(com);
+ if(IS_8251(com->pc98_if_type))
+ if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
+ com_int_Tx_disable(com);
#endif
}
if (!(com->state & CS_ODONE)) {
@@ -2665,29 +2171,24 @@ cont:
}
}
if ( COM_IIR_TXRDYBUG(com) && (int_ctl != int_ctl_new)) {
- if (com->pc98_if_type == COM_IF_RSA98III) {
- int_ctl_new &= ~(IER_ETXRDY | IER_ERXRDY);
- outb(com->intr_ctl_port, int_ctl_new);
- outb(com->rsabase + rsa_ier, 0x1d);
- } else
outb(com->intr_ctl_port, int_ctl_new);
}
}
#ifdef PC98
else if (line_status & LSR_TXRDY) {
- if (IS_8251(com->pc98_if_type))
- if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
- com_int_Tx_disable(com);
+ if(IS_8251(com->pc98_if_type))
+ if ( pc98_check_i8251_interrupt(com) & IEN_TxFLAG )
+ com_int_Tx_disable(com);
}
- if (IS_8251(com->pc98_if_type))
- if ((tmp = inb(com->sts_port)) & STS8251_RxRDY)
- goto more_intr;
+ if(IS_8251(com->pc98_if_type))
+ if ((tmp = inb(com->sts_port)) & STS8251_RxRDY)
+ goto more_intr;
#endif
/* finished? */
#ifndef COM_MULTIPORT
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
return;
#endif
if ((inb(com->int_id_port) & IIR_IMASK) == IIR_NOPEND)
@@ -2749,6 +2250,34 @@ sioioctl(dev, cmd, data, flag, p)
case TIOCGWINSZ:
bzero(data, sizeof(struct winsize));
return (0);
+#ifdef DSI_SOFT_MODEM
+ /*
+ * Download micro-code to Digicom modem.
+ */
+ case TIOCDSIMICROCODE:
+ {
+ u_long l;
+ u_char *p,*pi;
+
+ pi = (u_char*)(*(caddr_t*)data);
+ error = copyin(pi,&l,sizeof l);
+ if(error)
+ {return error;};
+ pi += sizeof l;
+
+ p = malloc(l,M_TEMP,M_NOWAIT);
+ if(!p)
+ {return ENOBUFS;}
+ error = copyin(pi,p,l);
+ if(error)
+ {free(p,M_TEMP); return error;};
+ if(error = LoadSoftModem(
+ MINOR_TO_UNIT(mynor),iobase,l,p))
+ {free(p,M_TEMP); return error;}
+ free(p,M_TEMP);
+ return(0);
+ }
+#endif /* DSI_SOFT_MODEM */
default:
return (ENOTTY);
}
@@ -2796,7 +2325,7 @@ sioioctl(dev, cmd, data, flag, p)
return (error);
}
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
switch (cmd) {
case TIOCSBRK:
com_send_break_on( com );
@@ -2851,25 +2380,13 @@ sioioctl(dev, cmd, data, flag, p)
return (ENOTTY);
}
} else {
- int port_shift;
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
#endif
switch (cmd) {
case TIOCSBRK:
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift),
- com->cfcr_image |= CFCR_SBREAK);
-#else
outb(iobase + com_cfcr, com->cfcr_image |= CFCR_SBREAK);
-#endif
break;
case TIOCCBRK:
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift),
- com->cfcr_image &= ~CFCR_SBREAK);
-#else
outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
-#endif
break;
case TIOCSDTR:
(void)commctl(com, TIOCM_DTR, DMBIS);
@@ -2976,13 +2493,8 @@ repeat:
ibuf = com->ibuf2;
else
ibuf = com->ibuf1;
-#ifndef PC98
com->ibufend = ibuf + RS_IBUFSIZE;
com->ihighwater = ibuf + RS_IHIGHWATER;
-#else
- com->ibufend = ibuf + com->CE_INPUT_OFFSET;
- com->ihighwater = ibuf + (3 * com->CE_INPUT_OFFSET / 4);
-#endif
com->iptr = ibuf;
/*
@@ -2991,7 +2503,7 @@ repeat:
* there is room in the high-level buffer.
*/
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = com_tiocm_get(com) & TIOCM_RTS;
else
tmp = com->mcr_image & MCR_RTS;
@@ -3004,7 +2516,7 @@ repeat:
#endif
&& !(tp->t_state & TS_TBLOCK))
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bis(com, TIOCM_RTS);
else
#endif
@@ -3018,7 +2530,7 @@ repeat:
u_char delta_modem_status;
#ifdef PC98
- if (!IS_8251(com->pc98_if_type)) {
+ if(!IS_8251(com->pc98_if_type)){
#endif
disable_intr();
delta_modem_status = com->last_modem_status
@@ -3080,11 +2592,7 @@ repeat:
u_char line_status;
int recv_data;
-#ifndef PC98
line_status = (u_char) buf[CE_INPUT_OFFSET];
-#else
- line_status = (u_char) buf[com->CE_INPUT_OFFSET];
-#endif
recv_data = (u_char) *buf++;
if (line_status
& (LSR_BI | LSR_FE | LSR_OE | LSR_PE)) {
@@ -3118,14 +2626,14 @@ comparam(tp, t)
int divisor;
u_char dlbh;
u_char dlbl;
+ int error;
Port_t iobase;
int s;
int unit;
+ int txtimeout;
#ifdef PC98
Port_t tmp_port;
int tmp_flg;
- int port_shift = 0;
- u_char param = 0;
#endif
#ifdef PC98
@@ -3133,27 +2641,16 @@ comparam(tp, t)
unit = DEV_TO_UNIT(tp->t_dev);
com = com_addr(unit);
iobase = com->iobase;
- if (IS_8251(com->pc98_if_type)) {
- divisor = pc98_ttspeedtab(com, t->c_ospeed);
- } else {
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
-
- /* do historical conversions */
- if (t->c_ispeed == 0)
- t->c_ispeed = t->c_ospeed;
-
- /* check requested parameters */
- divisor = ttspeedtab(t->c_ospeed,
- if_16550a_type[com->pc98_if_type & 0x0f].speedtab);
- }
-#else
+ if(IS_8251(com->pc98_if_type)) {
+ divisor = pc98_ttspeedtab(com, t->c_ospeed);
+ } else
+#endif
/* do historical conversions */
if (t->c_ispeed == 0)
t->c_ispeed = t->c_ospeed;
/* check requested parameters */
divisor = ttspeedtab(t->c_ospeed, comspeedtab);
-#endif
if (divisor < 0 || divisor > 0 && t->c_ispeed != t->c_ospeed)
return (EINVAL);
@@ -3165,8 +2662,8 @@ comparam(tp, t)
#endif
s = spltty();
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
- if (divisor == 0)
+ if(IS_8251(com->pc98_if_type)){
+ if(divisor == 0)
com_tiocm_bic( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
else
com_tiocm_bis( com, TIOCM_DTR|TIOCM_RTS|TIOCM_LE );
@@ -3181,7 +2678,7 @@ comparam(tp, t)
#endif
cflag = t->c_cflag;
#ifdef PC98
- if (!IS_8251(com->pc98_if_type)) {
+ if(!IS_8251(com->pc98_if_type)){
#endif
switch (cflag & CSIZE) {
case CS5:
@@ -3225,29 +2722,80 @@ comparam(tp, t)
if (com->esp)
com->fifo_image |= FIFO_DMA_MODE;
#endif
-#ifdef PC98
- outb(iobase + (com_fifo << port_shift), com->fifo_image);
-#else
outb(iobase + com_fifo, com->fifo_image);
-#endif
}
+
+ /*
+ * Some UARTs lock up if the divisor latch registers are selected
+ * while the UART is doing output (they refuse to transmit anything
+ * more until given a hard reset). Fix this by stopping filling
+ * the device buffers and waiting for them to drain. Reading the
+ * line status port outside of siointr1() might lose some receiver
+ * error bits, but that is acceptable here.
+ */
#ifdef PC98
}
#endif
+ disable_intr();
+retry:
+ com->state &= ~CS_TTGO;
+ txtimeout = tp->t_timeout;
+ enable_intr();
+#ifdef PC98
+ if(IS_8251(com->pc98_if_type)){
+ tmp_port = com->sts_port;
+ tmp_flg = (STS8251_TxRDY|STS8251_TxEMP);
+ } else {
+ tmp_port = com->line_status_port;
+ tmp_flg = (LSR_TSRE|LSR_TXRDY);
+ }
+ while ((inb(tmp_port) & tmp_flg) != tmp_flg) {
+#else
+ while ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY)) {
+#endif
+ tp->t_state |= TS_SO_OCOMPLETE;
+ error = ttysleep(tp, TSA_OCOMPLETE(tp), TTIPRI | PCATCH,
+ "siotx", hz / 100);
+ if ( txtimeout != 0
+ && (!error || error == EAGAIN)
+ && (txtimeout -= hz / 100) <= 0
+ )
+ error = EIO;
+ if (com->gone)
+ error = ENODEV;
+ if (error != 0 && error != EAGAIN) {
+ if (!(tp->t_state & TS_TTSTOP)) {
+ disable_intr();
+ com->state |= CS_TTGO;
+ enable_intr();
+ }
+ splx(s);
+ return (error);
+ }
+ }
- disable_intr(); /* very important while com_data is hidden */
+ disable_intr(); /* very important while com_data is hidden */
+ /*
+ * XXX - clearing CS_TTGO is not sufficient to stop further output,
+ * because siopoll() calls comstart() which usually sets it again
+ * because TS_TTSTOP is clear. Setting TS_TTSTOP would not be
+ * sufficient, for similar reasons.
+ */
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- com_cflag_and_speed_set(com, cflag, t->c_ospeed);
- else {
+ if ((inb(tmp_port) & tmp_flg) != tmp_flg)
+#else
+ if ((inb(com->line_status_port) & (LSR_TSRE | LSR_TXRDY))
+ != (LSR_TSRE | LSR_TXRDY))
#endif
- if (divisor != 0) {
+ goto retry;
+
#ifdef PC98
- outb(iobase + (com_cfcr << port_shift), cfcr | CFCR_DLAB);
-#else
- outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
+ if(!IS_8251(com->pc98_if_type)){
#endif
+ if (divisor != 0) {
+ outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
/*
* Only set the divisor registers if they would change,
* since on some 16550 incompatibles (UMC8669F), setting
@@ -3255,29 +2803,20 @@ comparam(tp, t)
* data stops arriving.
*/
dlbl = divisor & 0xFF;
-#ifdef PC98
- if (inb(iobase + (com_dlbl << port_shift)) != dlbl)
- outb(iobase + (com_dlbl << port_shift), dlbl);
- dlbh = (u_int) divisor >> 8;
- if (inb(iobase + (com_dlbh << port_shift)) != dlbh)
- outb(iobase + (com_dlbh << port_shift), dlbh);
-#else
if (inb(iobase + com_dlbl) != dlbl)
outb(iobase + com_dlbl, dlbl);
dlbh = (u_int) divisor >> 8;
if (inb(iobase + com_dlbh) != dlbh)
outb(iobase + com_dlbh, dlbh);
-#endif
}
-#ifdef PC98
- }
- outb(iobase + (com_cfcr << port_shift), com->cfcr_image = cfcr);
-#else
outb(iobase + com_cfcr, com->cfcr_image = cfcr);
-#endif
+#ifdef PC98
+ } else
+ com_cflag_and_speed_set(com, cflag, t->c_ospeed);
+#endif
if (!(tp->t_state & TS_TTSTOP))
com->state |= CS_TTGO;
@@ -3300,7 +2839,7 @@ comparam(tp, t)
* on here, since comstart() won't do it later.
*/
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bis(com, TIOCM_RTS);
else
#endif
@@ -3319,26 +2858,14 @@ comparam(tp, t)
*/
com->state |= CS_ODEVREADY;
com->state &= ~CS_CTS_OFLOW;
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- param = inb(com->rsabase + rsa_msr);
- outb(com->rsabase + rsa_msr, param & 0x14);
- }
-#endif
if (cflag & CCTS_OFLOW) {
com->state |= CS_CTS_OFLOW;
#ifdef PC98
- if (IS_8251(com->pc98_if_type)) {
+ if(IS_8251(com->pc98_if_type)){
if (!(pc98_get_modem_status(com) & TIOCM_CTS))
com->state &= ~CS_ODEVREADY;
} else {
#endif
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- /* Set automatic flow control mode */
- outb(com->rsabase + rsa_msr, param | 0x08);
- } else
-#endif
if (!(com->last_modem_status & MSR_CTS))
com->state &= ~CS_ODEVREADY;
if (com->st16650a) {
@@ -3356,11 +2883,7 @@ comparam(tp, t)
}
-#ifdef PC98
- outb(iobase + (com_cfcr << port_shift), com->cfcr_image);
-#else
outb(iobase + com_cfcr, com->cfcr_image);
-#endif
/* XXX shouldn't call functions while intrs are disabled. */
@@ -3400,7 +2923,7 @@ comstart(tp)
com->state |= CS_TTGO;
if (tp->t_state & TS_TBLOCK) {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = com_tiocm_get(com) & TIOCM_RTS;
else
tmp = com->mcr_image & MCR_RTS;
@@ -3409,14 +2932,14 @@ comstart(tp)
if (com->mcr_image & MCR_RTS && com->state & CS_RTS_IFLOW)
#endif
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bic(com, TIOCM_RTS);
else
#endif
outb(com->modem_ctl_port, com->mcr_image &= ~MCR_RTS);
} else {
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
tmp = com_tiocm_get(com) & TIOCM_RTS;
else
tmp = com->mcr_image & MCR_RTS;
@@ -3427,7 +2950,7 @@ comstart(tp)
&& com->state & CS_RTS_IFLOW)
#endif
#ifdef PC98
- if (IS_8251(com->pc98_if_type))
+ if(IS_8251(com->pc98_if_type))
com_tiocm_bis(com, TIOCM_RTS);
else
#endif
@@ -3450,11 +2973,7 @@ comstart(tp)
if (!com->obufs[0].l_queued) {
com->obufs[0].l_tail
= com->obuf1 + q_to_b(&tp->t_outq, com->obuf1,
-#ifndef PC98
sizeof com->obuf1);
-#else
- com->CE_INPUT_OFFSET);
-#endif
com->obufs[0].l_next = NULL;
com->obufs[0].l_queued = TRUE;
disable_intr();
@@ -3474,11 +2993,7 @@ comstart(tp)
if (tp->t_outq.c_cc != 0 && !com->obufs[1].l_queued) {
com->obufs[1].l_tail
= com->obuf2 + q_to_b(&tp->t_outq, com->obuf2,
-#ifndef PC98
sizeof com->obuf2);
-#else
- com->CE_INPUT_OFFSET);
-#endif
com->obufs[1].l_next = NULL;
com->obufs[1].l_queued = TRUE;
disable_intr();
@@ -3515,18 +3030,10 @@ siostop(tp, rw)
int rw;
{
struct com_s *com;
-#ifdef PC98
- int port_shift = 0;
- int rsa98_tmp = 0;
-#endif
com = com_addr(DEV_TO_UNIT(tp->t_dev));
if (com->gone)
return;
-#ifdef PC98
- if (IS_8251(com->pc98_if_type))
- port_shift = if_16550a_type[com->pc98_if_type & 0x0f].port_shift;
-#endif
disable_intr();
if (rw & FWRITE) {
if (com->hasfifo)
@@ -3534,17 +3041,9 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
-#ifdef PC98
- outb(com->iobase + (com_fifo << port_shift),
- FIFO_XMT_RST | com->fifo_image);
- if (com->pc98_if_type == COM_IF_RSA98III)
- for(rsa98_tmp = 0; rsa98_tmp < 2048; rsa98_tmp++)
- outb(com->iobase + (com_fifo << port_shift),
- FIFO_XMT_RST | com->fifo_image);
-#else
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_XMT_RST | com->fifo_image);
-#endif
com->obufs[0].l_queued = FALSE;
com->obufs[1].l_queued = FALSE;
if (com->state & CS_ODONE)
@@ -3558,17 +3057,9 @@ siostop(tp, rw)
/* XXX avoid h/w bug. */
if (!com->esp)
#endif
-#ifdef PC98
- if (com->pc98_if_type == COM_IF_RSA98III) {
- for(rsa98_tmp = 0; rsa98_tmp < 2048; rsa98_tmp++)
- inb(com->data_port);
- }
- outb(com->iobase + (com_fifo << port_shift),
- FIFO_RCV_RST | com->fifo_image);
-#else
+ /* XXX does this flush everything? */
outb(com->iobase + com_fifo,
FIFO_RCV_RST | com->fifo_image);
-#endif
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
@@ -3815,18 +3306,6 @@ static void siocnclose __P((struct siocnstate *sp));
static void siocnopen __P((struct siocnstate *sp));
static void siocntxwait __P((void));
-/*
- * XXX: sciocnget() and sciocnputc() are not declared static, as they are
- * referred to from i386/i386/i386-gdbstub.c.
- */
-static cn_probe_t siocnprobe;
-static cn_init_t siocninit;
-static cn_checkc_t siocncheckc;
- cn_getc_t siocngetc;
- cn_putc_t siocnputc;
-
-CONS_DRIVER(sio, siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc);
-
static void
siocntxwait()
{
@@ -3948,7 +3427,7 @@ siocnclose(sp)
outb(iobase + com_ier, sp->ier);
}
-static void
+void
siocnprobe(cp)
struct consdev *cp;
{
@@ -4014,14 +3493,14 @@ siocnprobe(cp)
}
}
-static void
+void
siocninit(cp)
struct consdev *cp;
{
comconsole = DEV_TO_UNIT(cp->cn_dev);
}
-static int
+int
siocncheckc(dev)
dev_t dev;
{
@@ -4079,6 +3558,126 @@ siocnputc(dev, c)
splx(s);
}
+#ifdef DSI_SOFT_MODEM
+/*
+ * The magic code to download microcode to a "Connection 14.4+Fax"
+ * modem from Digicom Systems Inc. Very magic.
+ */
+
+#define DSI_ERROR(str) { ptr = str; goto error; }
+static int
+LoadSoftModem(int unit, int base_io, u_long size, u_char *ptr)
+{
+ int int_c,int_k;
+ int data_0188, data_0187;
+
+ /*
+ * First see if it is a DSI SoftModem
+ */
+ if(!((inb(base_io+7) ^ inb(base_io+7)) & 0x80))
+ return ENODEV;
+
+ data_0188 = inb(base_io+4);
+ data_0187 = inb(base_io+3);
+ outb(base_io+3,0x80);
+ outb(base_io+4,0x0C);
+ outb(base_io+0,0x31);
+ outb(base_io+1,0x8C);
+ outb(base_io+7,0x10);
+ outb(base_io+7,0x19);
+
+ if(0x18 != (inb(base_io+7) & 0x1A))
+ DSI_ERROR("dsp bus not granted");
+
+ if(0x01 != (inb(base_io+7) & 0x01)) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x01 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program mem not granted");
+ }
+
+ int_c = 0;
+
+ while(1) {
+ if(int_c >= 7 || size <= 0x1800)
+ break;
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+ int_c++;
+ }
+
+ if(size > 0x1800) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+
+ for(int_k = 0 ; int_k < 0x800; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+
+ size -= 0x1800;
+
+ while(size > 0x1800) {
+ for(int_k = 0 ; int_k < 0xC00; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ size -= 0x1800;
+ }
+
+ if(size < 0x1800) {
+ for(int_k=0;int_k<size/2;int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+
+ } else if (size > 0) {
+ if(int_c == 7) {
+ outb(base_io+7,0x18);
+ outb(base_io+7,0x19);
+ if(0x00 != (inb(base_io+7) & 0x01))
+ DSI_ERROR("program data not granted");
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,0);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ } else {
+ for(int_k = 0 ; int_k < size/3; int_k++) {
+ outb(base_io+0,*ptr++);
+ outb(base_io+1,*ptr++);
+ outb(base_io+2,*ptr++);
+ }
+ }
+ }
+ outb(base_io+7,0x11);
+ outb(base_io+7,3);
+
+ outb(base_io+4,data_0188 & 0xfb);
+
+ outb(base_io+3,data_0187);
+
+ return 0;
+error:
+ printf("sio%d: DSI SoftModem microcode load failed: <%s>\n",unit,ptr);
+ outb(base_io+7,0x00); \
+ outb(base_io+3,data_0187); \
+ outb(base_io+4,data_0188); \
+ return EIO;
+}
+#endif /* DSI_SOFT_MODEM */
/*
* support PnP cards if we are using 'em
@@ -4156,7 +3755,7 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
dev->id_iobase = d.port[0];
dev->id_irq = (1 << d.irq[0]);
- dev->id_ointr = siointr;
+ dev->id_intr = siointr;
dev->id_ri_flags = RI_FAST;
dev->id_drq = -1;
@@ -4173,7 +3772,6 @@ siopnp_attach(u_long csn, u_long vend_id, char *name, struct isa_device *dev)
printf("sio%d: probe failed\n", dev->id_unit);
}
#endif
-
#ifdef PC98
/*
* pc98 local function
@@ -4497,10 +4095,12 @@ com_cflag_and_speed_set( struct com_s *com, int cflag, int speed)
cfcr |= MOD8251_CLKX16;
if (epson_machine_id != 0x20) { /* XXX */
+ {
int tmp;
while (!((tmp = inb(com->sts_port)) & STS8251_TxEMP))
;
}
+ }
/* set baud rate from ospeed */
pc98_set_baud_rate( com, count );
@@ -4513,214 +4113,206 @@ com_cflag_and_speed_set( struct com_s *com, int cflag, int speed)
static int
pc98_ttspeedtab(struct com_s *com, int speed)
{
- int if_type, effect_sp, count = -1, mod;
-
- if_type = com->pc98_if_type & 0x0f;
-
- switch (com->pc98_if_type) {
- case COM_IF_INTERNAL:
- if (PC98SIO_baud_rate_port(if_type) != -1) {
- count = ttspeedtab(speed, if_8251_type[if_type].speedtab);
- if (count > 0) {
- count |= COM1_EXT_CLOCK;
- break;
- }
- }
-
- /* for *1CLK asynchronous! mode, TEFUTEFU */
- mod = (sysclock == 5) ? 2457600 : 1996800;
- effect_sp = ttspeedtab( speed, pc98speedtab );
- if ( effect_sp < 0 ) /* XXX */
- effect_sp = ttspeedtab( (speed - 1), pc98speedtab );
- if ( effect_sp <= 0 )
- return effect_sp;
- if ( effect_sp == speed )
- mod /= 16;
- if ( mod % effect_sp )
- return(-1);
- count = mod / effect_sp;
- if ( count > 65535 )
- return(-1);
- if ( effect_sp != speed )
- count |= 0x10000;
- break;
- case COM_IF_PC9861K_1:
- case COM_IF_PC9861K_2:
- count = 1;
- break;
- case COM_IF_IND_SS_1:
- case COM_IF_IND_SS_2:
- case COM_IF_PIO9032B_1:
- case COM_IF_PIO9032B_2:
- if ( speed == 0 ) return 0;
- count = ttspeedtab( speed, if_8251_type[if_type].speedtab );
- break;
- case COM_IF_B98_01_1:
- case COM_IF_B98_01_2:
- if ( speed == 0 ) return 0;
- count = ttspeedtab( speed, if_8251_type[if_type].speedtab );
-#ifdef B98_01_OLD
- if (count == 0 || count == 1) {
- count += 4;
- count |= 0x20000; /* x1 mode for 76800 and 153600 */
- }
+ int effect_sp, count=-1, mod;
+
+ switch ( com->pc98_if_type ) {
+ case COM_IF_INTERNAL:
+ /* for *1CLK asynchronous! mode , TEFUTEFU */
+ effect_sp = ttspeedtab( speed, pc98speedtab );
+ if ( effect_sp < 0 )
+ effect_sp = ttspeedtab( (speed-1), pc98speedtab );
+ if ( effect_sp <= 0 )
+ return effect_sp;
+ mod = (sysclock == 5 ? 2457600 : 1996800);
+ if ( effect_sp == speed )
+ mod /= 16;
+ count = mod / effect_sp;
+ if ( count > 65535 )
+ return(-1);
+ if ( effect_sp >= 2400 )
+ if ( !(sysclock != 5 &&
+ (effect_sp == 19200 || effect_sp == 38400)) )
+ if ( ( mod % effect_sp ) != 0 )
+ return(-1);
+ if ( effect_sp != speed )
+ count |= 0x10000;
+ break;
+#ifdef COM_IF_PC9861K
+ case COM_IF_PC9861K:
+ effect_sp = speed;
+ count = 1;
+ break;
+#endif
+#ifdef COM_IF_PIO9032B
+ case COM_IF_PIO9032B:
+ if ( speed == 0 ) return 0;
+ count = ttspeedtab( speed, comspeedtab_pio9032b );
+ if ( count < 0 ) return count;
+ effect_sp = speed;
+ break;
+#endif
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ effect_sp=speed;
+ count = ttspeedtab( speed, comspeedtab_b98_01 );
+ if ( count <= 3 )
+ return -1; /* invalid speed/count */
+ if ( count <= 5 )
+ count |= 0x10000; /* x1 mode for 76800 and 153600 */
+ else
+ count -= 4; /* x16 mode for slower */
+ break;
#endif
- break;
}
-
return count;
}
static void
-pc98_set_baud_rate( struct com_s *com, int count )
+pc98_set_baud_rate( struct com_s *com, int count)
{
- int if_type, io, s;
-
- if_type = com->pc98_if_type & 0x0f;
- io = com->iobase & 0xff00;
-
- switch (com->pc98_if_type) {
- case COM_IF_INTERNAL:
- if (PC98SIO_baud_rate_port(if_type) != -1) {
- if (count & COM1_EXT_CLOCK) {
- outb((Port_t)PC98SIO_baud_rate_port(if_type), count & 0xff);
- break;
- } else {
- outb((Port_t)PC98SIO_baud_rate_port(if_type), 0x09);
- }
- }
+ int s;
- if ( count < 0 ) {
- printf( "[ Illegal count : %d ]", count );
- return;
- } else if ( count == 0 )
- return;
- /* set i8253 */
- s = splclock();
- if (count != 3)
+ switch ( com->pc98_if_type ) {
+ case COM_IF_INTERNAL:
+ if ( count < 0 ) {
+ printf( "[ Illegal count : %d ]", count );
+ return;
+ } else if ( count == 0)
+ return;
+ /* set i8253 */
+ s = splclock();
outb( 0x77, 0xb6 );
- else
- outb( 0x77, 0xb4 );
- outb( 0x5f, 0);
- outb( 0x75, count & 0xff );
- outb( 0x5f, 0);
- outb( 0x75, (count >> 8) & 0xff );
- splx(s);
- break;
- case COM_IF_IND_SS_1:
- case COM_IF_IND_SS_2:
- outb(io | PC98SIO_intr_ctrl_port(if_type), 0);
- outb(io | PC98SIO_baud_rate_port(if_type), 0);
- outb(io | PC98SIO_baud_rate_port(if_type), 0xc0);
- outb(io | PC98SIO_baud_rate_port(if_type), (count >> 8) | 0x80);
- outb(io | PC98SIO_baud_rate_port(if_type), count & 0xff);
- break;
- case COM_IF_PIO9032B_1:
- case COM_IF_PIO9032B_2:
- outb(io | PC98SIO_baud_rate_port(if_type), count);
- break;
- case COM_IF_B98_01_1:
- case COM_IF_B98_01_2:
- outb(io | PC98SIO_baud_rate_port(if_type), count & 0x0f);
+ outb( 0x5f, 0);
+ outb( 0x75, count & 0xff );
+ outb( 0x5f, 0);
+ outb( 0x75, (count >> 8) & 0xff );
+ splx(s);
+ break;
+#if 0
+#ifdef COM_IF_PC9861K
+ case COM_IF_PC9861K:
+ break;
+ /* ext. RS232C board: speed is determined by DIP switch */
+#endif
+#endif /* 0 */
+#ifdef COM_IF_PIO9032B
+ case COM_IF_PIO9032B:
+ outb( com_addr[unit], count & 0x07 );
+ break;
+#endif
+#ifdef COM_IF_B98_01
+ case COM_IF_B98_01:
+ outb( com->iobase, count & 0x0f );
#ifdef B98_01_OLD
- /*
- * Some old B98_01 board should be controlled
- * in different way, but this hasn't been tested yet.
- */
- outb(io | PC98SIO_func_port(if_type),
- (count & 0x20000) ? 0xf0 : 0xf2);
+ /* some old board should be controlled in different way,
+ but this hasn't been tested yet.*/
+ outb( com->iobase+2, ( count & 0x10000 ) ? 0xf0 : 0xf2 );
+#endif
+ break;
#endif
- break;
}
}
static int
-pc98_check_if_type(struct isa_device *dev, struct siodev *iod)
+pc98_check_if_type( int iobase, struct siodev *iod)
{
- int irr, io, if_type, tmp;
+ int irr = 0, tmp = 0;
+ int ret = 0;
static short irq_tab[2][8] = {
{ 3, 5, 6, 9, 10, 12, 13, -1},
{ 3, 10, 12, 13, 5, 6, 9, -1}
};
-
- iod->if_type = if_type = (dev->id_flags >> 24) & 0xff;
- if ((if_type < 0 || if_type > COM_IF_END1) &&
- (if_type < 0x10 || if_type > COM_IF_END2))
- return(-1);
- if_type &= 0x0f;
iod->irq = 0;
- io = dev->id_iobase & 0xff00;
-
- if (IS_8251(iod->if_type)) {
- if (PC98SIO_func_port(if_type) != -1) {
- outb(io | PC98SIO_func_port(if_type), 0xf2);
- tmp = ttspeedtab(9600, if_8251_type[if_type].speedtab);
- if (tmp != -1 && PC98SIO_baud_rate_port(if_type) != -1)
- outb(io | PC98SIO_baud_rate_port(if_type), tmp);
- }
-
- iod->cmd = io | PC98SIO_cmd_port(if_type);
- iod->sts = io | PC98SIO_sts_port(if_type);
- iod->mod = io | PC98SIO_in_modem_port(if_type);
- iod->ctrl = io | PC98SIO_intr_ctrl_port(if_type);
-
- if (iod->if_type == COM_IF_INTERNAL) {
- iod->irq = 4;
-
- /* XXX check new internal port. */
- outb(0x138, 0);
- DELAY(10);
- for (tmp = 0; tmp < 100; tmp++) {
- if ((inb(0x138) & 1) == 0) {
- PC98SIO_baud_rate_port(if_type) = 0x13a;
- if_8251_type[if_type].name = " (internal fast)";
- if_8251_type[if_type].speedtab = pc98fast_speedtab;
+ switch ( iobase & 0xff ) {
+ case IO_COM1:
+ iod->if_type = COM_IF_INTERNAL;
+ ret = 0; iod->irq = 4; break;
+#ifdef COM_IF_PC9861K
+ case IO_COM2:
+ iod->if_type = COM_IF_PC9861K;
+ ret = 1; irr = 0; tmp = 3; break;
+ case IO_COM3:
+ iod->if_type = COM_IF_PC9861K;
+ ret = 2; irr = 1; tmp = 3; break;
+#endif
+#ifdef COM_IF_PIO9032B
+ case IO_COM_PIO9032B_2:
+ iod->if_type = COM_IF_PIO9032B;
+ ret = 1; irr = 0; tmp = 7; break;
+ case IO_COM_PIO9032B_3:
+ iod->if_type = COM_IF_PIO9032B;
+ ret = 2; irr = 1; tmp = 7; break;
+#endif
+#ifdef COM_IF_B98_01
+ case IO_COM_B98_01_2:
+ iod->if_type = COM_IF_B98_01;
+ ret = 1; irr = 0; tmp = 7;
+ outb(iobase + 2, 0xf2);
+ outb(iobase, 4);
+ break;
+ case IO_COM_B98_01_3:
+ iod->if_type = COM_IF_B98_01;
+ ret = 2; irr = 1; tmp = 7;
+ outb(iobase + 2, 0xf2);
+ outb(iobase , 4);
break;
- }
- DELAY(1);
- }
- } else {
- tmp = inb( iod->mod ) & if_8251_type[if_type].irr_mask;
- if ((dev->id_iobase & 0xff) == IO_COM2)
- iod->irq = irq_tab[0][tmp];
- else
- iod->irq = irq_tab[1][tmp];
- }
- } else {
- irr = if_16550a_type[if_type].irr_read;
-#ifdef COM_MULTIPORT
- if (!COM_ISMULTIPORT(dev) || dev->id_unit == COM_MPMASTER(dev))
#endif
- if (irr != -1) {
- tmp = inb(io | irr);
- if (dev->id_iobase & 0x01) /* XXX depend on RSB-384 */
- iod->irq = irq_tab[1][tmp >> 3];
- else
- iod->irq = irq_tab[0][tmp & 0x07];
- }
+ default:
+ if((iobase & 0x0f0) == 0xd0){
+ iod->if_type = MC16550;
+ return 0;
+ }
+ return -1;
}
- if ( iod->irq == -1 ) return -1;
+ iod->cmd = ( iobase & 0xff00 )|PC98SIO_cmd_port(ret);
+ iod->sts = ( iobase & 0xff00 )|PC98SIO_sts_port(ret);
+ iod->mod = ( iobase & 0xff00 )|PC98SIO_in_modem_port(ret);
+ iod->ctrl = ( iobase & 0xff00 )|PC98SIO_intr_ctrl_port(ret);
+
+ if ( iod->irq == 0 ) {
+ tmp &= inb( iod->mod );
+ iod->irq = irq_tab[irr][tmp];
+ if ( iod->irq == -1 ) return -1;
+ }
return 0;
}
static int
-pc98_set_ioport( struct com_s *com, int id_flags )
+pc98_set_ioport( struct com_s *com, int io_base )
{
- int io, if_type;
-
- if_type = (id_flags >> 24) & 0xff;
- if (IS_8251(if_type)) {
- pc98_check_sysclock();
- io = com->iobase & 0xff00;
- com->pc98_if_type = if_type;
- if_type &= 0x0f;
- com->data_port = io | PC98SIO_data_port(if_type);
- com->cmd_port = io | PC98SIO_cmd_port(if_type);
- com->sts_port = io | PC98SIO_sts_port(if_type);
- com->in_modem_port = io | PC98SIO_in_modem_port(if_type);
- com->intr_ctrl_port = io | PC98SIO_intr_ctrl_port(if_type);
- return 0;
+ int a, io, type;
+
+ switch ( io_base & 0xff ) {
+ case IO_COM1: a = 0; io = 0; type = COM_IF_INTERNAL;
+ pc98_check_sysclock(); break;
+#ifdef COM_IF_PC9861K
+ case IO_COM2: a = 1; io = 0; type = COM_IF_PC9861K; break;
+ case IO_COM3: a = 2; io = 0; type = COM_IF_PC9861K; break;
+#endif /* COM_IF_PC9861K */
+#ifdef COM_IF_PIO9032B
+ /* PIO9032B : I/O address is changeable */
+ case IO_COM_PIO9032B_2:
+ a = 1; io = io_base & 0xff00;
+ type = COM_IF_PIO9032B; break;
+ case IO_COM_PIO9032B_3:
+ a = 2; io = io_base & 0xff00;
+ type = COM_IF_PIO9032B; break;
+#endif /* COM_IF_PIO9032B */
+#ifdef COM_IF_B98_01
+ case IO_COM_B98_01_2:
+ a = 1; io = 0; type = COM_IF_B98_01; break;
+ case IO_COM_B98_01_3:
+ a = 2; io = 0; type = COM_IF_B98_01; break;
+#endif /* COM_IF_B98_01*/
+ default: /* i/o address not match */
+ return -1;
}
- return -1;
+ com->pc98_if_type = type;
+ com->data_port = io | PC98SIO_data_port(a);
+ com->cmd_port = io | PC98SIO_cmd_port(a);
+ com->sts_port = io | PC98SIO_sts_port(a);
+ com->in_modem_port = io | PC98SIO_in_modem_port(a);
+ com->intr_ctrl_port = io | PC98SIO_intr_ctrl_port(a);
+ return 0;
}
#endif /* PC98 defined */
diff --git a/sys/pc98/pc98/sioreg.h b/sys/pc98/pc98/sioreg.h
new file mode 100644
index 0000000000000..840df10841be1
--- /dev/null
+++ b/sys/pc98/pc98/sioreg.h
@@ -0,0 +1,119 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
+ * $Id: sioreg.h,v 1.6 1997/06/04 10:27:53 kato Exp $
+ */
+
+
+/* 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier) */
+#if defined(PC98)
+#define COMBRD(x) (7372800 / (16*(x)))
+#else
+#define COMBRD(x) (1843200 / (16*(x)))
+#endif
+
+/* interrupt enable register */
+#define IER_ERXRDY 0x1
+#define IER_ETXRDY 0x2
+#define IER_ERLS 0x4
+#define IER_EMSC 0x8
+
+/* interrupt identification register */
+#define IIR_IMASK 0xf
+#define IIR_RXTOUT 0xc
+#define IIR_RLS 0x6
+#define IIR_RXRDY 0x4
+#define IIR_TXRDY 0x2
+#define IIR_NOPEND 0x1
+#define IIR_MLSC 0x0
+#define IIR_FIFO_MASK 0xc0 /* set if FIFOs are enabled */
+
+/* fifo control register */
+#define FIFO_ENABLE 0x01
+#define FIFO_RCV_RST 0x02
+#define FIFO_XMT_RST 0x04
+#define FIFO_DMA_MODE 0x08
+#define FIFO_RX_LOW 0x00
+#define FIFO_RX_MEDL 0x40
+#define FIFO_RX_MEDH 0x80
+#define FIFO_RX_HIGH 0xc0
+
+/* character format control register */
+#define CFCR_DLAB 0x80
+#define CFCR_SBREAK 0x40
+#define CFCR_PZERO 0x30
+#define CFCR_PONE 0x20
+#define CFCR_PEVEN 0x10
+#define CFCR_PODD 0x00
+#define CFCR_PENAB 0x08
+#define CFCR_STOPB 0x04
+#define CFCR_8BITS 0x03
+#define CFCR_7BITS 0x02
+#define CFCR_6BITS 0x01
+#define CFCR_5BITS 0x00
+
+/* modem control register */
+#define MCR_LOOPBACK 0x10
+#define MCR_IENABLE 0x08
+#define MCR_DRS 0x04
+#define MCR_RTS 0x02
+#define MCR_DTR 0x01
+
+/* line status register */
+#define LSR_RCV_FIFO 0x80
+#define LSR_TSRE 0x40
+#define LSR_TXRDY 0x20
+#define LSR_BI 0x10
+#define LSR_FE 0x08
+#define LSR_PE 0x04
+#define LSR_OE 0x02
+#define LSR_RXRDY 0x01
+#define LSR_RCV_MASK 0x1f
+
+/* modem status register */
+#define MSR_DCD 0x80
+#define MSR_RI 0x40
+#define MSR_DSR 0x20
+#define MSR_CTS 0x10
+#define MSR_DDCD 0x08
+#define MSR_TERI 0x04
+#define MSR_DDSR 0x02
+#define MSR_DCTS 0x01
+
+/* speed to initialize to during chip tests */
+#define SIO_TEST_SPEED 9600
+
+/* default serial console speed if not set with sysctl or probed from boot */
+#ifndef CONSPEED
+#define CONSPEED 9600
+#endif
diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c
index bfce06877b621..e85a1b317454a 100644
--- a/sys/pc98/pc98/syscons.c
+++ b/sys/pc98/pc98/syscons.c
@@ -1,18 +1,18 @@
/*-
- * Copyright (c) 1992-1998 Sen Schmidt
+ * Copyright (c) 1992-1995 Sen Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer,
- * without modification, immediately at the beginning of the file.
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * derived from this software withough specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -25,16 +25,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.108 1999/01/18 14:48:34 kato Exp $
+ * $Id: syscons.c,v 1.100 1998/08/28 12:45:43 kato Exp $
*/
#include "sc.h"
-#include "splash.h"
#include "apm.h"
#include "opt_ddb.h"
#include "opt_devfs.h"
-#include "opt_vesa.h"
-#include "opt_vm86.h"
#include "opt_syscons.h"
#if NSC > 0
@@ -60,33 +57,36 @@
#include <machine/psl.h>
#include <machine/frame.h>
#include <machine/pc/display.h>
-#include <machine/pc/vesa.h>
#include <machine/apm_bios.h>
#include <machine/random.h>
+#include <machine/bootinfo.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
-#include <dev/kbd/kbdreg.h>
-#include <dev/fb/fbreg.h>
-#include <dev/fb/splashreg.h>
-
#ifdef PC98
#define KANJI
#include <pc98/pc98/pc98.h>
#include <pc98/pc98/pc98_machdep.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#include <i386/isa/kbdtables.h>
+#include <i386/isa/kbdio.h>
#include <pc98/pc98/syscons.h>
#else
-#include <dev/fb/vgareg.h>
-#include <dev/syscons/syscons.h>
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
+#include <i386/isa/kbdtables.h>
+#include <i386/isa/kbdio.h>
+#include <i386/isa/syscons.h>
#endif /* PC98 */
+#if defined(PC98) && defined(LINE30)
+#include <pc98/pc98/30line.h>
+#endif
+
#if !defined(MAXCONS)
#define MAXCONS 16
#endif
@@ -111,6 +111,11 @@
#define COLD 0
#define WARM 1
+#define VESA_MODE(x) ((x) >= M_VESA_BASE)
+
+#define MODE_MAP_SIZE (M_VGA_CG320 + 1)
+#define MODE_PARAM_SIZE 64
+
#define DEFAULT_BLANKTIME (5*60) /* 5 minutes */
#define MAX_BLANKTIME (7*24*60*60) /* 7 days!? */
@@ -131,6 +136,9 @@ typedef struct old_mouse_info {
} u;
} old_mouse_info_t;
+/* XXX use sc_bcopy where video memory is concerned */
+extern void generic_bcopy(const void *, void *, size_t);
+
static default_attr user_default = {
(FG_LIGHTGREY | BG_BLACK) << 8,
(FG_BLACK | BG_LIGHTGREY) << 8
@@ -159,7 +167,9 @@ static void *sc_console_devfs_token;
static scr_stat *new_scp, *old_scp;
static term_stat kernel_console;
static default_attr *current_default;
-static int sc_flags;
+static int flags = 0;
+static int sc_port = IO_KBD;
+static KBDC sc_kbdc = NULL;
static char init_done = COLD;
static u_short sc_buffer[ROW*COL];
static char shutdown_in_progress = FALSE;
@@ -168,38 +178,51 @@ static char switch_in_progress = FALSE;
static char write_in_progress = FALSE;
static char blink_in_progress = FALSE;
static int blinkrate = 0;
-static int adapter = -1;
-static int keyboard = -1;
-static keyboard_t *kbd;
+#ifndef PC98
+ u_int crtc_addr = MONO_BASE;
+#endif
+ char crtc_type = KD_MONO;
+ char crtc_vga = FALSE;
+static u_char shfts = 0, ctls = 0, alts = 0, agrs = 0, metas = 0;
+static u_char accents = 0;
+#ifdef PC98
+static u_char nlkcnt = 0, slkcnt = 0, alkcnt = 0;
+#else
+static u_char nlkcnt = 0, clkcnt = 0, slkcnt = 0, alkcnt = 0;
+#endif
+static const u_int n_fkey_tab = sizeof(fkey_tab) / sizeof(*fkey_tab);
static int delayed_next_scr = FALSE;
static long scrn_blank_time = 0; /* screen saver timeout value */
-static int scrn_blanked = FALSE; /* screen saver active flag */
+ int scrn_blanked = 0; /* screen saver active flag */
static long scrn_time_stamp;
static int saver_mode = CONS_LKM_SAVER; /* LKM/user saver */
static int run_scrn_saver = FALSE; /* should run the saver? */
static int scrn_idle = FALSE; /* about to run the saver */
-static int scrn_saver_failed;
u_char scr_map[256];
u_char scr_rmap[256];
-static int initial_video_mode; /* initial video mode # */
+ char *video_mode_ptr = NULL;
+static int bios_video_mode; /* video mode # set by BIOS */
int fonts_loaded = 0
#ifdef STD8X16FONT
| FONT_16
#endif
;
- u_char font_8[256*8];
- u_char font_14[256*14];
+ char font_8[256*8];
+ char font_14[256*14];
#ifdef STD8X16FONT
extern
#endif
- u_char font_16[256*16];
- u_char palette[256*3];
-static u_char *cut_buffer;
+ unsigned char font_16[256*16];
+ char palette[256*3];
+static char *mode_map[MODE_MAP_SIZE];
+static char vgaregs[MODE_PARAM_SIZE];
+static char vgaregs2[MODE_PARAM_SIZE];
+static int rows_offset = 1;
+static char *cut_buffer;
static int cut_buffer_size;
-static int mouse_level; /* sysmouse protocol level */
+static int mouse_level = 0; /* sysmouse protocol level */
static mousestatus_t mouse_status = { 0, 0, 0, 0, 0, 0 };
-#ifndef PC98
static u_short mouse_and_mask[16] = {
0xc000, 0xe000, 0xf000, 0xf800,
0xfc00, 0xfe00, 0xff00, 0xff80,
@@ -212,22 +235,17 @@ static u_short mouse_or_mask[16] = {
0x0c00, 0x0c00, 0x0600, 0x0600,
0x0000, 0x0000, 0x0000, 0x0000
};
-#endif
- int sc_history_size = SC_HISTORY_SIZE;
-static int extra_history_size =
+static int extra_history_size =
SC_MAX_HISTORY_SIZE - SC_HISTORY_SIZE * MAXCONS;
static void none_saver(int blank) { }
static void (*current_saver)(int blank) = none_saver;
- d_ioctl_t *sc_user_ioctl;
+static void (*default_saver)(int blank) = none_saver;
+int (*sc_user_ioctl)(dev_t dev, int cmd, caddr_t data,
+ int flag, struct proc *p) = NULL;
static int sticky_splash = FALSE;
-static struct {
- u_int8_t cursor_start;
- u_int8_t cursor_end;
- u_int8_t shift_state;
- } bios_value;
/* OS specific stuff */
#ifdef not_yet_done
@@ -243,92 +261,81 @@ static struct tty sccons[MAXCONS+2];
#endif
#define SC_MOUSE 128
#define SC_CONSOLE 255
-u_short *Crtat;
#ifdef PC98
-u_short *Atrat;
static u_char default_kanji = UJIS;
+u_short *Crtat;
+u_short *Atrat;
+#else
+#define MONO_BUF pa_to_va(0xB0000)
+#define CGA_BUF pa_to_va(0xB8000)
+u_short *Crtat;
#endif
static const int nsccons = MAXCONS+2;
#define WRAPHIST(scp, pointer, offset)\
- ((scp)->history + ((((pointer) - (scp)->history) + (scp)->history_size \
- + (offset)) % (scp)->history_size))
+ ((scp->history) + ((((pointer) - (scp->history)) + (scp->history_size)\
+ + (offset)) % (scp->history_size)))
#ifdef PC98
#define WRAPHIST_A(scp, pointer, offset)\
- ((scp->his_atr) + ((((pointer) - (scp->his_atr)) + (scp)->history_size \
- + (offset)) % (scp)->history_size))
+ ((scp->his_atr) + ((((pointer) - (scp->his_atr)) + (scp->history_size)\
+ + (offset)) % (scp->history_size)))
#endif
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
-/* some useful macros */
-#define kbd_read_char(kbd, wait) \
- (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait))
-#define kbd_check_char(kbd) \
- (*kbdsw[(kbd)->kb_index]->check_char)((kbd))
-#define kbd_enable(kbd) \
- (*kbdsw[(kbd)->kb_index]->enable)((kbd))
-#define kbd_disable(kbd) \
- (*kbdsw[(kbd)->kb_index]->disable)((kbd))
-#define kbd_lock(kbd, lockf) \
- (*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf))
-#define kbd_ioctl(kbd, cmd, arg) \
- (((kbd) == NULL) ? \
- ENODEV : (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg)))
-#define kbd_clear_state(kbd) \
- (*kbdsw[(kbd)->kb_index]->clear_state)((kbd))
-#define kbd_get_fkeystr(kbd, fkey, len) \
- (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len))
+/* this should really be in `rtc.h' */
+#define RTC_EQUIPMENT 0x14
/* prototypes */
static int scattach(struct isa_device *dev);
-static kbd_callback_func_t sckbdevent;
static int scparam(struct tty *tp, struct termios *t);
static int scprobe(struct isa_device *dev);
-static int scvidprobe(int unit, int flags, int cons);
-static int sckbdprobe(int unit, int flags, int cons);
+static int scvidprobe(int unit, int flags);
+static int sckbdprobe(int unit, int flags);
static void scstart(struct tty *tp);
static void scmousestart(struct tty *tp);
static void scinit(void);
static void scshutdown(int howto, void *arg);
-static u_int scgetc(keyboard_t *kbd, u_int flags);
+static void map_mode_table(char *map[], char *table, int max);
+static int map_mode_num(int mode);
+static char *get_mode_param(scr_stat *scp, int mode);
+static u_int scgetc(u_int flags);
#define SCGETC_CN 1
#define SCGETC_NONBLOCK 2
-static int sccngetch(int flags);
static void sccnupdate(scr_stat *scp);
+static scr_stat *get_scr_stat(dev_t dev);
static scr_stat *alloc_scp(void);
static void init_scp(scr_stat *scp);
-static void get_bios_values(void);
static void sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark);
static int get_scr_num(void);
static timeout_t scrn_timer;
static void scrn_update(scr_stat *scp, int show_cursor);
-#if NSPLASH > 0
-static int scsplash_callback(int);
-static void scsplash_saver(int show);
-static int add_scrn_saver(void (*this_saver)(int));
-static int remove_scrn_saver(void (*this_saver)(int));
-static int set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border);
-static int restore_scrn_saver_mode(scr_stat *scp, int changemode);
static void stop_scrn_saver(void (*saver)(int));
static int wait_scrn_saver_stop(void);
-#define scsplash_stick(stick) (sticky_splash = (stick))
-#else
-#define scsplash_stick(stick)
-#endif /* NSPLASH */
+static void clear_screen(scr_stat *scp);
static int switch_scr(scr_stat *scp, u_int next_scr);
static void exchange_scr(void);
+static void move_crsr(scr_stat *scp, int x, int y);
static void scan_esc(scr_stat *scp, u_char c);
-static void ansi_put(scr_stat *scp, u_char *buf, int len);
static void draw_cursor_image(scr_stat *scp);
static void remove_cursor_image(scr_stat *scp);
-static void move_crsr(scr_stat *scp, int x, int y);
+static void ansi_put(scr_stat *scp, u_char *buf, int len);
+static u_char *get_fstr(u_int c, u_int *len);
static void history_to_screen(scr_stat *scp);
static int history_up_line(scr_stat *scp);
static int history_down_line(scr_stat *scp);
static int mask2attr(struct term_stat *term);
-static int save_kbd_state(scr_stat *scp);
-static int update_kbd_state(int state, int mask);
-static int update_kbd_leds(int which);
+static void set_keyboard(int command, int data);
+static void update_leds(int which);
+static void set_vgaregs(char *modetable);
+static void read_vgaregs(char *buf);
+#define COMP_IDENTICAL 0
+#define COMP_SIMILAR 1
+#define COMP_DIFFERENT 2
+static int comp_vgaregs(u_char *buf1, u_char *buf2);
+static void dump_vgaregs(u_char *buf);
+#define PARAM_BUFSIZE 6
+static void set_font_mode(u_char *buf);
+static void set_normal_mode(u_char *buf);
static void set_destructive_cursor(scr_stat *scp);
static void set_mouse_pos(scr_stat *scp);
static int skip_spc_right(scr_stat *scp, u_short *p);
@@ -344,16 +351,16 @@ static void draw_mouse_image(scr_stat *scp);
static void remove_mouse_image(scr_stat *scp);
static void draw_cutmarking(scr_stat *scp);
static void remove_cutmarking(scr_stat *scp);
+static void save_palette(void);
static void do_bell(scr_stat *scp, int pitch, int duration);
static timeout_t blink_screen;
-
-static cn_probe_t sccnprobe;
-static cn_init_t sccninit;
-static cn_getc_t sccngetc;
-static cn_checkc_t sccncheckc;
-static cn_putc_t sccnputc;
-
-CONS_DRIVER(sc, sccnprobe, sccninit, sccngetc, sccncheckc, sccnputc);
+#ifdef SC_SPLASH_SCREEN
+static void scsplash_init(void);
+static void scsplash(int show);
+#define scsplash_stick(stick) (sticky_splash = (stick))
+#else
+#define scsplash_stick(stick)
+#endif
struct isa_driver scdriver = {
scprobe, scattach, "sc", 1
@@ -364,6 +371,7 @@ static d_close_t scclose;
static d_read_t scread;
static d_write_t scwrite;
static d_ioctl_t scioctl;
+static d_devtotty_t scdevtotty;
static d_mmap_t scmmap;
#define CDEV_MAJOR 12
@@ -412,27 +420,31 @@ at2pc98(unsigned int attr)
}
#endif
+/*
+ * These functions need to be before calls to them so they can be inlined.
+ */
static void
draw_cursor_image(scr_stat *scp)
{
+ u_short cursor_image, *ptr;
+ u_short prev_image;
#ifdef PC98
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, scp->xpos, scp->ypos);
+ int pos = scp->cursor_pos - scp->scr_buf;
+ while((inb(TEXT_GDC + 0) & 0x04) == 0) {}
+ outb(TEXT_GDC + 2, 0x49); /* CSRW */
+ outb(TEXT_GDC + 0, pos & 0xff); /* EADl */
+ outb(TEXT_GDC + 0, pos >> 8); /* EADh */
#else
- u_short cursor_image;
- u_short *ptr;
- u_short prev_image;
+ ptr = Crtat + (scp->cursor_pos - scp->scr_buf);
- if (ISPIXELSC(scp)) {
+ if (VESA_MODE(scp->mode)) {
sc_bcopy(scp, scp->scr_buf, scp->cursor_pos - scp->scr_buf,
scp->cursor_pos - scp->scr_buf, 1);
return;
}
- ptr = (u_short *)(scp->adp->va_window)
- + (scp->cursor_pos - scp->scr_buf);
-
/* do we have a destructive cursor ? */
- if (sc_flags & CHAR_CURSOR) {
+ if (flags & CHAR_CURSOR) {
prev_image = scp->cursor_saveunder;
cursor_image = *ptr & 0x00ff;
if (cursor_image == DEAD_CHAR)
@@ -443,7 +455,7 @@ draw_cursor_image(scr_stat *scp)
if (prev_image != cursor_image)
set_destructive_cursor(scp);
/* modify cursor_image */
- if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
+ if (!(flags & BLINK_CURSOR)||((flags & BLINK_CURSOR)&&(blinkrate & 4))){
/*
* When the mouse pointer is at the same position as the cursor,
* the cursor bitmap needs to be updated even if the char under
@@ -459,7 +471,7 @@ draw_cursor_image(scr_stat *scp)
} else {
cursor_image = (*(ptr) & 0x00ff) | *(scp->cursor_pos) & 0xff00;
scp->cursor_saveunder = cursor_image;
- if (!(sc_flags & BLINK_CURSOR)||((sc_flags & BLINK_CURSOR)&&(blinkrate & 4))){
+ if (!(flags & BLINK_CURSOR)||((flags & BLINK_CURSOR)&&(blinkrate & 4))){
if ((cursor_image & 0x7000) == 0x7000) {
cursor_image &= 0x8fff;
if(!(cursor_image & 0x0700))
@@ -479,13 +491,11 @@ static void
remove_cursor_image(scr_stat *scp)
{
#ifndef PC98
- if (ISPIXELSC(scp))
+ if (VESA_MODE(scp->mode))
sc_bcopy(scp, scp->scr_buf, scp->cursor_oldpos - scp->scr_buf,
- scp->cursor_oldpos - scp->scr_buf, 0);
+ scp->cursor_oldpos - scp->scr_buf, 0);
else
- *((u_short *)(scp->adp->va_window)
- + (scp->cursor_oldpos - scp->scr_buf))
- = scp->cursor_saveunder;
+ *(Crtat + (scp->cursor_oldpos - scp->scr_buf)) = scp->cursor_saveunder;
#endif
}
@@ -511,72 +521,303 @@ move_crsr(scr_stat *scp, int x, int y)
static int
scprobe(struct isa_device *dev)
{
- if (!scvidprobe(dev->id_unit, dev->id_flags, FALSE)) {
+ if (!scvidprobe(dev->id_unit, dev->id_flags)) {
if (bootverbose)
printf("sc%d: no video adapter is found.\n", dev->id_unit);
return (0);
}
- return ((sckbdprobe(dev->id_unit, dev->id_flags, FALSE)) ? -1 : 0);
+ sc_port = dev->id_iobase;
+ if (sckbdprobe(dev->id_unit, dev->id_flags))
+ return (IO_KBDSIZE);
+ else
+ return ((dev->id_flags & DETECT_KBD) ? 0 : IO_KBDSIZE);
}
/* probe video adapters, return TRUE if found */
static int
-scvidprobe(int unit, int flags, int cons)
+scvidprobe(int unit, int flags)
{
- video_adapter_t *adp;
+ /*
+ * XXX don't try to `printf' anything here, the console may not have
+ * been configured yet.
+ */
+ u_short volatile *cp;
+ u_short was;
+ u_int pa;
+ u_int segoff;
+
+ /* do this test only once */
+ if (init_done != COLD)
+ return (Crtat != 0);
/*
- * Access the video adapter driver through the back door!
- * Video adapter drivers need to be configured before syscons.
- * However, when syscons is being probed as the low-level console,
- * they have not been initialized yet. We force them to initialize
- * themselves here. XXX
+ * Finish defaulting crtc variables for a mono screen. Crtat is a
+ * bogus common variable so that it can be shared with pcvt, so it
+ * can't be statically initialized. XXX.
*/
- vid_configure(cons ? VIO_PROBE_ONLY : 0);
-
- /* allocate a frame buffer */
- if (adapter < 0) {
- adapter = vid_allocate("*", -1, (void *)&adapter);
- if (adapter < 0)
+#ifdef PC98
+ Crtat = (u_short *)TEXT_VRAM;
+ Atrat = (u_short *)TEXT_VRAM + ATTR_OFFSET;
+ crtc_type = KD_PC98;
+#else
+ Crtat = (u_short *)MONO_BUF;
+ crtc_type = KD_MONO;
+ /* If CGA memory seems to work, switch to color. */
+ cp = (u_short *)CGA_BUF;
+ was = *cp;
+ *cp = (u_short) 0xA55A;
+ bios_video_mode = *(u_char *)pa_to_va(0x449);
+ if (bootinfo.bi_vesa == 0x102) {
+ bios_video_mode = bootinfo.bi_vesa;
+ Crtat = (u_short *)pa_to_va(0xA0000);
+ crtc_addr = COLOR_BASE;
+ crtc_type = KD_VGA;
+ bzero(Crtat, 800*600/8);
+ } else if (*cp == 0xA55A) {
+ Crtat = (u_short *)CGA_BUF;
+ crtc_addr = COLOR_BASE;
+ crtc_type = KD_CGA;
+ } else {
+ cp = Crtat;
+ was = *cp;
+ *cp = (u_short) 0xA55A;
+ if (*cp != 0xA55A) {
+ /* no screen at all, bail out */
+ Crtat = 0;
return FALSE;
+ }
}
- adp = vid_get_adapter(adapter); /* shouldn't fail */
+ *cp = was;
- Crtat = (u_short *)adp->va_window;
-#ifdef PC98
- Atrat = Crtat + ATTR_OFFSET;
-#endif
- initial_video_mode = adp->va_initial_mode;
+ if (!VESA_MODE(bios_video_mode)) {
+ /*
+ * Check rtc and BIOS date area.
+ * XXX: don't use BIOSDATA_EQUIPMENT, it is not a dead copy
+ * of RTC_EQUIPMENT. The bit 4 and 5 of the ETC_EQUIPMENT are
+ * zeros for EGA and VGA. However, the EGA/VGA BIOS will set
+ * these bits in BIOSDATA_EQUIPMENT according to the monitor
+ * type detected.
+ */
+ switch ((rtcin(RTC_EQUIPMENT) >> 4) & 3) { /* bit 4 and 5 */
+ case 0: /* EGA/VGA, or nothing */
+ crtc_type = KD_EGA;
+ /* the color adapter may be in the 40x25 mode... XXX */
+ break;
+ case 1: /* CGA 40x25 */
+ /* switch to the 80x25 mode? XXX */
+ /* FALL THROUGH */
+ case 2: /* CGA 80x25 */
+ /* `crtc_type' has already been set... */
+ /* crtc_type = KD_CGA; */
+ break;
+ case 3: /* MDA */
+ /* `crtc_type' has already been set... */
+ /* crtc_type = KD_MONO; */
+ break;
+ }
+ /* is this a VGA or higher ? */
+ outb(crtc_addr, 7);
+ if (inb(crtc_addr) == 7) {
+
+ crtc_type = KD_VGA;
+ crtc_vga = TRUE;
+ read_vgaregs(vgaregs);
+
+ /* Get the BIOS video mode pointer */
+ segoff = *(u_int *)pa_to_va(0x4a8);
+ pa = ((segoff & 0xffff0000) >> 12) + (segoff & 0xffff);
+ if (ISMAPPED(pa, sizeof(u_int))) {
+ segoff = *(u_int *)pa_to_va(pa);
+ pa = ((segoff & 0xffff0000) >> 12) + (segoff & 0xffff);
+ if (ISMAPPED(pa, MODE_PARAM_SIZE))
+ video_mode_ptr = (char *)pa_to_va(pa);
+ }
+ }
+ }
+#endif /* PC98 */
return TRUE;
}
/* probe the keyboard, return TRUE if found */
static int
-sckbdprobe(int unit, int flags, int cons)
+sckbdprobe(int unit, int flags)
{
- /* access the keyboard driver through the backdoor! */
- kbd_configure(cons ? KB_CONF_PROBE_ONLY : 0);
+ int codeset;
+ int c = -1;
+ int m;
+ int res, id;
- /* allocate a keyboard and register the keyboard event handler */
- if (keyboard < 0) {
- keyboard = kbd_allocate("*", -1, (void *)&keyboard, sckbdevent, NULL);
- if (keyboard < 0)
- return FALSE;
+ sc_kbdc = kbdc_open(sc_port);
+#ifndef PC98
+ if (!kbdc_lock(sc_kbdc, TRUE)) {
+ /* driver error? */
+ printf("sc%d: unable to lock the controller.\n", unit);
+ return ((flags & DETECT_KBD) ? FALSE : TRUE);
+ }
+
+ /* discard anything left after UserConfig */
+ empty_both_buffers(sc_kbdc, 10);
+
+ /* save the current keyboard controller command byte */
+ m = kbdc_get_device_mask(sc_kbdc) & ~KBD_KBD_CONTROL_BITS;
+ c = get_controller_command_byte(sc_kbdc);
+ if (c == -1) {
+ /* CONTROLLER ERROR */
+ printf("sc%d: unable to get the current command byte value.\n", unit);
+ goto fail;
+ }
+ if (bootverbose)
+ printf("sc%d: the current keyboard controller command byte %04x\n",
+ unit, c);
+#if 0
+ /* override the keyboard lock switch */
+ c |= KBD_OVERRIDE_KBD_LOCK;
+#endif
+
+ /*
+ * The keyboard may have been screwed up by the boot block.
+ * We may just be able to recover from error by testing the controller
+ * and the keyboard port. The controller command byte needs to be saved
+ * before this recovery operation, as some controllers seem to set
+ * the command byte to particular values.
+ */
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+
+ /* enable the keyboard port, but disable the keyboard intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS,
+ KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * there is very little we can do...
+ */
+ printf("sc%d: unable to set the command byte.\n", unit);
+ goto fail;
+ }
+
+ /*
+ * Check if we have an XT keyboard before we attempt to reset it.
+ * The procedure assumes that the keyboard and the controller have
+ * been set up properly by BIOS and have not been messed up
+ * during the boot process.
+ */
+ codeset = -1;
+ if (flags & XT_KEYBD)
+ /* the user says there is a XT keyboard */
+ codeset = 1;
+#ifdef DETECT_XT_KEYBOARD
+ else if ((c & KBD_TRANSLATION) == 0) {
+ /* SET_SCANCODE_SET is not always supported; ignore error */
+ if (send_kbd_command_and_data(sc_kbdc, KBDC_SET_SCANCODE_SET, 0)
+ == KBD_ACK)
+ codeset = read_kbd_data(sc_kbdc);
+ }
+ if (bootverbose)
+ printf("sc%d: keyboard scancode set %d\n", unit, codeset);
+#endif /* DETECT_XT_KEYBOARD */
+
+ if (flags & KBD_NORESET) {
+ write_kbd_command(sc_kbdc, KBDC_ECHO);
+ if (read_kbd_data(sc_kbdc) != KBD_ECHO) {
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: failed to get response from the keyboard.\n",
+ unit);
+ goto fail;
+ }
+ } else {
+ /* reset keyboard hardware */
+ if (!reset_kbd(sc_kbdc)) {
+ /* KEYBOARD ERROR
+ * Keyboard reset may fail either because the keyboard doen't
+ * exist, or because the keyboard doesn't pass the self-test,
+ * or the keyboard controller on the motherboard and the keyboard
+ * somehow fail to shake hands. It is just possible, particularly
+ * in the last case, that the keyoard controller may be left
+ * in a hung state. test_controller() and test_kbd_port() appear
+ * to bring the keyboard controller back (I don't know why and
+ * how, though.)
+ */
+ empty_both_buffers(sc_kbdc, 10);
+ test_controller(sc_kbdc);
+ test_kbd_port(sc_kbdc);
+ /* We could disable the keyboard port and interrupt... but,
+ * the keyboard may still exist (see above).
+ */
+ if (bootverbose)
+ printf("sc%d: failed to reset the keyboard.\n", unit);
+ goto fail;
+ }
}
- kbd = kbd_get_keyboard(keyboard); /* shouldn't fail */
+ /*
+ * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
+ * such as those on the IBM ThinkPad laptop computers can be used
+ * with the standard console driver.
+ */
+ if (codeset == 1) {
+ if (send_kbd_command_and_data(
+ sc_kbdc, KBDC_SET_SCANCODE_SET, codeset) == KBD_ACK) {
+ /* XT kbd doesn't need scan code translation */
+ c &= ~KBD_TRANSLATION;
+ } else {
+ /* KEYBOARD ERROR
+ * The XT kbd isn't usable unless the proper scan code set
+ * is selected.
+ */
+ printf("sc%d: unable to set the XT keyboard mode.\n", unit);
+ goto fail;
+ }
+ }
+ /* enable the keyboard port and intr. */
+ if (!set_controller_command_byte(sc_kbdc,
+ KBD_KBD_CONTROL_BITS | KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK,
+ (c & (KBD_TRANSLATION | KBD_OVERRIDE_KBD_LOCK))
+ | KBD_ENABLE_KBD_PORT | KBD_ENABLE_KBD_INT)) {
+ /* CONTROLLER ERROR
+ * This is serious; we are left with the disabled keyboard intr.
+ */
+ printf("sc%d: unable to enable the keyboard port and intr.\n", unit);
+ goto fail;
+ }
+
+ /* Get the ID of the keyboard, if any */
+ empty_kbd_buffer(sc_kbdc, 5);
+ res = send_kbd_command(sc_kbdc, KBDC_SEND_DEV_ID);
+ if (res == KBD_ACK) {
+ /* 10ms delay */
+ DELAY(10000);
+ id = (read_kbd_data(sc_kbdc) << 8) | read_kbd_data(sc_kbdc);
+ if (bootverbose)
+ printf("sc%d: keyboard device ID: %04x\n", unit, id);
+ }
+
+ kbdc_set_device_mask(sc_kbdc, m | KBD_KBD_CONTROL_BITS),
+ kbdc_lock(sc_kbdc, FALSE);
+#endif /* !PC98 */
return TRUE;
+#ifndef PC98
+fail:
+ if (c != -1)
+ /* try to restore the command byte as before, if possible */
+ set_controller_command_byte(sc_kbdc, 0xff, c);
+ kbdc_set_device_mask(sc_kbdc,
+ (flags & DETECT_KBD) ? m : m | KBD_KBD_CONTROL_BITS);
+ kbdc_lock(sc_kbdc, FALSE);
+ return FALSE;
+#endif /* !PC98 */
}
#if NAPM > 0
static int
scresume(void *dummy)
{
- if (kbd != NULL)
- kbd_clear_state(kbd);
- return 0;
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ return 0;
}
#endif
@@ -584,85 +825,117 @@ static int
scattach(struct isa_device *dev)
{
scr_stat *scp;
-#if defined(VESA) && defined(VM86)
- video_info_t info;
-#endif
dev_t cdev = makedev(CDEV_MAJOR, 0);
+ char *p;
#ifdef DEVFS
int vc;
#endif
scinit();
+ flags = dev->id_flags;
+ if (crtc_type != KD_VGA || VESA_MODE(bios_video_mode))
+ flags &= ~CHAR_CURSOR;
+
scp = console[0];
- sc_flags = dev->id_flags;
- if (!ISFONTAVAIL(scp->adp->va_flags))
- sc_flags &= ~CHAR_CURSOR;
+
+ if (crtc_type == KD_VGA) {
+ cut_buffer_size = scp->xsize * scp->ysize + 1;
+ cut_buffer = (char *)malloc(cut_buffer_size, M_DEVBUF, M_NOWAIT);
+ if (cut_buffer != NULL)
+ cut_buffer[0] = '\0';
+ }
+
+ scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+#ifdef PC98
+ scp->atr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+#endif
/* copy temporary buffer to final buffer */
- scp->scr_buf = NULL;
+ bcopy(sc_buffer, scp->scr_buf, scp->xsize * scp->ysize * sizeof(u_short));
+
#ifdef PC98
- scp->atr_buf = NULL;
+ bcopy(Atrat, scp->atr_buf, scp->xsize * scp->ysize * sizeof(u_short));
#endif
- sc_alloc_scr_buffer(scp, FALSE, FALSE);
- bcopy(sc_buffer, scp->scr_buf, scp->xsize*scp->ysize*sizeof(u_short));
+ scp->cursor_pos = scp->cursor_oldpos =
+ scp->scr_buf + scp->xpos + scp->ypos * scp->xsize;
#ifdef PC98
- bcopy(Atrat, scp->atr_buf, scp->xsize*scp->ysize*sizeof(u_short));
+ scp->cursor_atr =
+ scp->atr_buf + scp->xpos + scp->ypos * scp->xsize;
#endif
-
- /* cut buffer is available only when the mouse pointer is used */
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, FALSE);
+ scp->mouse_pos = scp->mouse_oldpos =
+ scp->scr_buf + ((scp->mouse_ypos/scp->font_size)*scp->xsize +
+ scp->mouse_xpos/8);
/* initialize history buffer & pointers */
- sc_alloc_history_buffer(scp, sc_history_size, 0, FALSE);
-
-#if defined(VESA) && defined(VM86)
- if ((sc_flags & VESA800X600)
- && ((*vidsw[scp->ad]->get_info)(scp->adp, M_VESA_800x600, &info) == 0)) {
-#if NSPLASH > 0
- splash_term(scp->adp);
-#endif
- sc_set_graphics_mode(scp, NULL, M_VESA_800x600);
- sc_set_pixel_mode(scp, NULL, COL, ROW, 16);
- initial_video_mode = M_VESA_800x600;
-#if NSPLASH > 0
- /* put up the splash again! */
- splash_init(scp->adp, scsplash_callback);
+ scp->history_head = scp->history_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (scp->history_head != NULL)
+ bzero(scp->history_head, scp->history_size*sizeof(u_short));
+ scp->history = scp->history_head;
+#ifdef PC98
+ scp->his_atr_head = scp->his_atr_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (scp->his_atr_head != NULL)
+ bzero(scp->his_atr_head, scp->history_size*sizeof(u_short));
+ scp->his_atr = scp->his_atr_pos;
#endif
- }
-#endif /* VESA && VM86 */
/* initialize cursor stuff */
- if (!ISGRAPHSC(scp))
+ if (!(scp->status & UNKNOWN_MODE))
draw_cursor_image(scp);
/* get screen update going */
scrn_timer((void *)TRUE);
- /* set up the keyboard */
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode);
- update_kbd_state(scp->status, LOCK_MASK);
+ update_leds(scp->status);
- if (bootverbose) {
- printf("sc%d:", dev->id_unit);
- if (adapter >= 0)
- printf(" fb%d", adapter);
- if (keyboard >= 0)
- printf(" kbd%d", keyboard);
- printf("\n");
+#ifndef PC98
+ if ((crtc_type == KD_VGA) && bootverbose) {
+ printf("sc%d: BIOS video mode:%d\n", dev->id_unit, bios_video_mode);
+ printf("sc%d: VGA registers upon power-up\n", dev->id_unit);
+ dump_vgaregs(vgaregs);
+ printf("sc%d: video mode:%d\n", dev->id_unit, scp->mode);
+ printf("sc%d: VGA registers in BIOS for mode:%d\n",
+ dev->id_unit, scp->mode);
+ dump_vgaregs(vgaregs2);
+ p = get_mode_param(scp, scp->mode);
+ if (p != NULL) {
+ printf("sc%d: VGA registers to be used for mode:%d\n",
+ dev->id_unit, scp->mode);
+ dump_vgaregs(p);
+ }
+ printf("sc%d: rows_offset:%d\n", dev->id_unit, rows_offset);
}
+ if ((crtc_type == KD_VGA) && !VESA_MODE(bios_video_mode)
+ && (video_mode_ptr == NULL))
+ printf("sc%d: WARNING: video mode switching is only partially supported\n",
+ dev->id_unit);
+#endif
+
printf("sc%d: ", dev->id_unit);
- switch(scp->adp->va_type) {
+ switch(crtc_type) {
#ifdef PC98
case KD_PC98:
printf(" <text mode>");
break;
#else
case KD_VGA:
- printf("VGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
+ if (VESA_MODE(bios_video_mode))
+ printf("Graphics display (VESA mode = 0x%x)", bios_video_mode);
+ else if (crtc_addr == MONO_BASE)
+ printf("VGA mono");
+ else
+ printf("VGA color");
break;
case KD_EGA:
- printf("EGA %s", (scp->adp->va_flags & V_ADP_COLOR) ? "color" : "mono");
+ if (crtc_addr == MONO_BASE)
+ printf("EGA mono");
+ else
+ printf("EGA color");
break;
case KD_CGA:
printf("CGA");
@@ -670,11 +943,11 @@ scattach(struct isa_device *dev)
case KD_MONO:
case KD_HERCULES:
default:
- printf("MDA/Hercules");
+ printf("MDA/hercules");
break;
#endif /* PC98 */
}
- printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, sc_flags);
+ printf(" <%d virtual consoles, flags=0x%x>\n", MAXCONS, flags);
#if NAPM > 0
scp->r_hook.ah_fun = scresume;
@@ -720,8 +993,6 @@ int
scopen(dev_t dev, int flag, int mode, struct proc *p)
{
struct tty *tp = scdevtotty(dev);
- keyarg_t key;
- int s;
if (!tp)
return(ENXIO);
@@ -733,9 +1004,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
ttychars(tp);
/* Use the current setting of the <-- key as default VERASE. */
/* If the Delete key is preferable, an stty is necessary */
- key.keynum = 0x0e; /* how do we know this magic number... XXX */
- kbd_ioctl(kbd, GIO_KEYMAPENT, (caddr_t)&key);
- tp->t_cc[VERASE] = key.key.map[0];
+ tp->t_cc[VERASE] = key_map.key[0x0e].map[0];
tp->t_iflag = TTYDEF_IFLAG;
tp->t_oflag = TTYDEF_OFLAG;
tp->t_cflag = TTYDEF_CFLAG;
@@ -745,20 +1014,12 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
(*linesw[tp->t_line].l_modem)(tp, 1);
if (minor(dev) == SC_MOUSE)
mouse_level = 0; /* XXX */
- if (minor(dev) < MAXCONS && console[minor(dev)] && scrn_blanked) {
- s = spltty();
- sc_touch_scrn_saver();
- sc_clean_up(console[minor(dev)]);
- splx(s);
- }
}
else
if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
return(EBUSY);
if (minor(dev) < MAXCONS && !console[minor(dev)]) {
console[minor(dev)] = alloc_scp();
- if (ISGRAPHSC(console[minor(dev)]))
- sc_set_pixel_mode(console[minor(dev)], NULL, COL, ROW, 16);
}
if (minor(dev)<MAXCONS && !tp->t_winsize.ws_col && !tp->t_winsize.ws_row) {
tp->t_winsize.ws_col = console[minor(dev)]->xsize;
@@ -776,7 +1037,7 @@ scclose(dev_t dev, int flag, int mode, struct proc *p)
if (!tp)
return(ENXIO);
if (minor(dev) < MAXCONS) {
- scp = sc_get_scr_stat(tp->t_dev);
+ scp = get_scr_stat(tp->t_dev);
if (scp->status & SWITCH_WAIT_ACQ)
wakeup((caddr_t)&scp->smode);
#if not_yet_done
@@ -795,9 +1056,9 @@ scclose(dev_t dev, int flag, int mode, struct proc *p)
if (scp->history != NULL) {
free(scp->history, M_DEVBUF);
if (scp->history_size / scp->xsize
- > imax(sc_history_size, scp->ysize))
+ > imax(SC_HISTORY_SIZE, scp->ysize))
extra_history_size += scp->history_size / scp->xsize
- - imax(sc_history_size, scp->ysize);
+ - imax(SC_HISTORY_SIZE, scp->ysize);
}
free(scp, M_DEVBUF);
console[minor(dev)] = NULL;
@@ -835,53 +1096,38 @@ scwrite(dev_t dev, struct uio *uio, int flag)
return((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
-static int
-sckbdevent(keyboard_t *thiskbd, int event, void *arg)
+void
+scintr(int unit)
{
static struct tty *cur_tty;
- int c;
- size_t len;
+ int c, len;
u_char *cp;
- /* assert(thiskbd == kbd) */
-
- switch (event) {
- case KBDIO_KEYINPUT:
- break;
- case KBDIO_UNLOADING:
- kbd = NULL;
- kbd_release(thiskbd, (void *)&keyboard);
- return 0;
- default:
- return EINVAL;
- }
-
/*
* Loop while there is still input to get from the keyboard.
* I don't think this is nessesary, and it doesn't fix
* the Xaccel-2.1 keyboard hang, but it can't hurt. XXX
*/
- while ((c = scgetc(thiskbd, SCGETC_NONBLOCK)) != NOKEY) {
+ while ((c = scgetc(SCGETC_NONBLOCK)) != NOKEY) {
cur_tty = VIRTUAL_TTY(get_scr_num());
if (!(cur_tty->t_state & TS_ISOPEN))
if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN))
continue;
- switch (KEYFLAGS(c)) {
+ switch (c & 0xff00) {
case 0x0000: /* normal key */
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
break;
case FKEY: /* function key, return string */
- cp = kbd_get_fkeystr(thiskbd, KEYCHAR(c), &len);
- if (cp != NULL) {
+ if (cp = get_fstr((u_int)c, (u_int *)&len)) {
while (len-- > 0)
- (*linesw[cur_tty->t_line].l_rint)(*cp++, cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(*cp++ & 0xFF, cur_tty);
}
break;
case MKEY: /* meta is active, prepend ESC */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
- (*linesw[cur_tty->t_line].l_rint)(KEYCHAR(c), cur_tty);
+ (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty);
break;
case BKEY: /* backtab fixed sequence (esc [ Z) */
(*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty);
@@ -891,11 +1137,10 @@ sckbdevent(keyboard_t *thiskbd, int event, void *arg)
}
}
- if (cur_console->status & MOUSE_VISIBLE) {
- remove_mouse_image(cur_console);
+ if (cur_console->status & MOUSE_ENABLED) {
cur_console->status &= ~MOUSE_VISIBLE;
+ remove_mouse_image(cur_console);
}
- return 0;
}
static int
@@ -910,29 +1155,28 @@ scparam(struct tty *tp, struct termios *t)
int
scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
- u_int delta_ehs;
int error;
- int i;
+ u_int i;
struct tty *tp;
scr_stat *scp;
+ u_short *usp;
+#ifdef PC98
+ u_short *atr_usp;
+#endif
+ char *mp;
int s;
tp = scdevtotty(dev);
if (!tp)
return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
+ scp = get_scr_stat(tp->t_dev);
/* If there is a user_ioctl function call that first */
if (sc_user_ioctl) {
- error = (*sc_user_ioctl)(dev, cmd, data, flag, p);
- if (error != ENOIOCTL)
+ if (error = (*sc_user_ioctl)(dev, cmd, data, flag, p))
return error;
}
- error = sc_vid_ioctl(tp, cmd, data, flag, p);
- if (error != ENOIOCTL)
- return error;
-
switch (cmd) { /* process console hardware related ioctl's */
case GIO_ATTR: /* get current attributes */
@@ -940,7 +1184,22 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case GIO_COLOR: /* is this a color console ? */
- *(int *)data = (scp->adp->va_flags & V_ADP_COLOR) ? 1 : 0;
+#ifdef PC98
+ *(int*)data = 0;
+#else
+ if (crtc_addr == COLOR_BASE)
+ *(int*)data = 1;
+ else
+ *(int*)data = 0;
+#endif
+ return 0;
+
+ case CONS_CURRENT: /* get current adapter type */
+ *(int *)data = crtc_type;
+ return 0;
+
+ case CONS_GET: /* get current video mode */
+ *(int*)data = scp->mode;
return 0;
case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
@@ -954,38 +1213,36 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case CONS_CURSORTYPE: /* set cursor type blink/noblink */
if ((*(int*)data) & 0x01)
- sc_flags |= BLINK_CURSOR;
+ flags |= BLINK_CURSOR;
else
- sc_flags &= ~BLINK_CURSOR;
+ flags &= ~BLINK_CURSOR;
if ((*(int*)data) & 0x02) {
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA || VESA_MODE(bios_video_mode))
return ENXIO;
- sc_flags |= CHAR_CURSOR;
+ flags |= CHAR_CURSOR;
} else
- sc_flags &= ~CHAR_CURSOR;
+ flags &= ~CHAR_CURSOR;
/*
* The cursor shape is global property; all virtual consoles
* are affected. Update the cursor in the current console...
*/
- if (!ISGRAPHSC(cur_console)) {
- s = spltty();
+ if (!(cur_console->status & UNKNOWN_MODE)) {
remove_cursor_image(cur_console);
- if (sc_flags & CHAR_CURSOR)
+ if (flags & CHAR_CURSOR)
set_destructive_cursor(cur_console);
draw_cursor_image(cur_console);
- splx(s);
}
return 0;
case CONS_BELLTYPE: /* set bell type sound/visual */
if ((*(int *)data) & 0x01)
- sc_flags |= VISUAL_BELL;
+ flags |= VISUAL_BELL;
else
- sc_flags &= ~VISUAL_BELL;
+ flags &= ~VISUAL_BELL;
if ((*(int *)data) & 0x02)
- sc_flags |= QUIET_BELL;
+ flags |= QUIET_BELL;
else
- sc_flags &= ~QUIET_BELL;
+ flags &= ~QUIET_BELL;
return 0;
case CONS_HISTORY: /* set history size */
@@ -996,22 +1253,50 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
lines = imax(*(int *)data, scp->ysize);
lines0 = (scp->history != NULL) ?
scp->history_size / scp->xsize : scp->ysize;
- if (lines0 > imax(sc_history_size, scp->ysize))
- delta_ehs = lines0 - imax(sc_history_size, scp->ysize);
- else
- delta_ehs = 0;
/*
* syscons unconditionally allocates buffers upto SC_HISTORY_SIZE
* lines or scp->ysize lines, whichever is larger. A value
* greater than that is allowed, subject to extra_history_size.
*/
- if (lines > imax(sc_history_size, scp->ysize))
- if (lines - imax(sc_history_size, scp->ysize) >
- extra_history_size + delta_ehs)
- return EINVAL;
+ if (lines > imax(lines0, SC_HISTORY_SIZE) + extra_history_size)
+ return EINVAL;
if (cur_console->status & BUFFER_SAVED)
return EBUSY;
- sc_alloc_history_buffer(scp, lines, delta_ehs, TRUE);
+ usp = scp->history;
+ scp->history = NULL;
+ if (usp != NULL)
+ free(usp, M_DEVBUF);
+#ifdef PC98
+ atr_usp = scp->his_atr;
+ scp->his_atr = NULL;
+ if (atr_usp != NULL)
+ free(atr_usp, M_DEVBUF);
+#endif
+ scp->history_size = lines * scp->xsize;
+ /*
+ * extra_history_size +=
+ * (lines0 > imax(SC_HISTORY_SIZE, scp->ysize)) ?
+ * lines0 - imax(SC_HISTORY_SIZE, scp->ysize)) : 0;
+ * extra_history_size -=
+ * (lines > imax(SC_HISTORY_SIZE, scp->ysize)) ?
+ * lines - imax(SC_HISTORY_SIZE, scp->ysize)) : 0;
+ * lines0 >= ysize && lines >= ysize... Hey, the above can be
+ * reduced to the following...
+ */
+ extra_history_size +=
+ imax(lines0, SC_HISTORY_SIZE) - imax(lines, SC_HISTORY_SIZE);
+ usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(usp, scp->history_size * sizeof(u_short));
+ scp->history_head = scp->history_pos = usp;
+ scp->history = usp;
+#ifdef PC98
+ atr_usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(atr_usp, scp->history_size * sizeof(u_short));
+ scp->his_atr_head = scp->his_atr_pos = atr_usp;
+ scp->his_atr = atr_usp;
+#endif
return 0;
}
else
@@ -1021,8 +1306,9 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
case OLD_CONS_MOUSECTL:
{
/* MOUSE_BUTTON?DOWN -> MOUSE_MSC_BUTTON?UP */
- static int butmap[8] = {
- MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
+ static butmap[8] = {
+ MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON2UP
+ | MOUSE_MSC_BUTTON3UP,
MOUSE_MSC_BUTTON2UP | MOUSE_MSC_BUTTON3UP,
MOUSE_MSC_BUTTON1UP | MOUSE_MSC_BUTTON3UP,
MOUSE_MSC_BUTTON3UP,
@@ -1034,12 +1320,11 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
mouse_info_t *mouse = (mouse_info_t*)data;
mouse_info_t buf;
- /* FIXME: */
- if (!ISMOUSEAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA || VESA_MODE(bios_video_mode))
return ENODEV;
if (cmd == OLD_CONS_MOUSECTL) {
- static u_char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
+ static unsigned char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
old_mouse_info_t *old_mouse = (old_mouse_info_t *)data;
mouse = &buf;
@@ -1084,7 +1369,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case MOUSE_SHOW:
- if (ISTEXTSC(scp) && !(scp->status & MOUSE_ENABLED)) {
+ if (!(scp->status & MOUSE_ENABLED)) {
scp->status |= (MOUSE_ENABLED | MOUSE_VISIBLE);
scp->mouse_oldpos = scp->mouse_pos;
mark_all(scp);
@@ -1095,7 +1380,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
break;
case MOUSE_HIDE:
- if (ISTEXTSC(scp) && (scp->status & MOUSE_ENABLED)) {
+ if (scp->status & MOUSE_ENABLED) {
scp->status &= ~(MOUSE_ENABLED | MOUSE_VISIBLE);
mark_all(scp);
return 0;
@@ -1140,7 +1425,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (mouse_status.flags == 0)
return 0;
- if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
+ if (cur_console->status & MOUSE_ENABLED)
cur_console->status |= MOUSE_VISIBLE;
if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
@@ -1185,7 +1470,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
else if (mouse->operation == MOUSE_ACTION && cut_buffer != NULL) {
/* process button presses */
if ((cur_console->mouse_buttons ^ mouse->u.data.buttons) &&
- ISTEXTSC(cur_console)) {
+ !(cur_console->status & UNKNOWN_MODE)) {
cur_console->mouse_buttons = mouse->u.data.buttons;
if (cur_console->mouse_buttons & MOUSE_BUTTON1DOWN)
mouse_cut_start(cur_console);
@@ -1222,7 +1507,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (mouse_status.flags == 0)
return 0;
- if (ISTEXTSC(cur_console) && (cur_console->status & MOUSE_ENABLED))
+ if (cur_console->status & MOUSE_ENABLED)
cur_console->status |= MOUSE_VISIBLE;
if ((MOUSE_TTY)->t_state & TS_ISOPEN) {
@@ -1251,7 +1536,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
break;
}
- if (!ISTEXTSC(cur_console) || (cut_buffer == NULL))
+ if ((cur_console->status & UNKNOWN_MODE) || (cut_buffer == NULL))
break;
switch (mouse->u.event.id) {
@@ -1298,7 +1583,8 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return EINVAL;
}
/* make screensaver happy */
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
return 0;
}
@@ -1419,9 +1705,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
ptr->mv_grfc.fore = 0; /* not supported */
ptr->mv_grfc.back = 0; /* not supported */
ptr->mv_ovscan = scp->border;
- if (scp == cur_console)
- save_kbd_state(scp);
- ptr->mk_keylock = scp->status & LOCK_MASK;
+ ptr->mk_keylock = scp->status & LOCK_KEY_MASK;
return 0;
}
return EINVAL;
@@ -1432,43 +1716,18 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case CONS_IDLE: /* see if the screen has been idle */
- /*
- * When the screen is in the GRAPHICS_MODE or UNKNOWN_MODE,
- * the user process may have been writing something on the
- * screen and syscons is not aware of it. Declare the screen
- * is NOT idle if it is in one of these modes. But there is
- * an exception to it; if a screen saver is running in the
- * graphics mode in the current screen, we should say that the
- * screen has been idle.
- */
- *(int *)data = scrn_idle
- && (!ISGRAPHSC(cur_console)
- || (cur_console->status & SAVER_RUNNING));
+ *(int *)data = (scrn_idle && !(cur_console->status & UNKNOWN_MODE));
return 0;
case CONS_SAVERMODE: /* set saver mode */
switch(*(int *)data) {
case CONS_USR_SAVER:
- /* if a LKM screen saver is running, stop it first. */
- scsplash_stick(FALSE);
+ /* if a LKM screen saver is running, it will eventually stop... */
saver_mode = *(int *)data;
- s = spltty();
-#if NSPLASH > 0
- if ((error = wait_scrn_saver_stop())) {
- splx(s);
- return error;
- }
-#endif /* NSPLASH */
- scp->status |= SAVER_RUNNING;
scsplash_stick(TRUE);
- splx(s);
break;
case CONS_LKM_SAVER:
- s = spltty();
- if ((saver_mode == CONS_USR_SAVER) && (scp->status & SAVER_RUNNING))
- scp->status &= ~SAVER_RUNNING;
saver_mode = *(int *)data;
- splx(s);
break;
default:
return EINVAL;
@@ -1487,6 +1746,279 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
splx(s);
return 0;
+#ifdef PC98
+ case SW_PC98_80x25:
+ case SW_PC98_80x30: /* PC98 TEXT MODES */
+ if (!crtc_vga)
+ return ENXIO;
+ scp->xsize = 80;
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+ if (scp->history != NULL)
+ i = imax(scp->history_size / scp->xsize
+ - imax(SC_HISTORY_SIZE, scp->ysize), 0);
+ else
+ i = 0;
+ switch (cmd & 0xff) {
+ case M_PC98_80x25:
+ scp->ysize = 25;
+ break;
+#ifdef LINE30
+ case M_PC98_80x30:
+ scp->ysize = LINE30_ROW;
+ break;
+#endif
+ default:
+ return EINVAL;
+ }
+#else /* IBM-PC */
+ /* VGA TEXT MODES */
+ case SW_VGA_C40x25:
+ case SW_VGA_C80x25: case SW_VGA_M80x25:
+ case SW_VGA_C80x30: case SW_VGA_M80x30:
+ case SW_VGA_C80x50: case SW_VGA_M80x50:
+ case SW_VGA_C80x60: case SW_VGA_M80x60:
+ case SW_B40x25: case SW_C40x25:
+ case SW_B80x25: case SW_C80x25:
+ case SW_ENH_B40x25: case SW_ENH_C40x25:
+ case SW_ENH_B80x25: case SW_ENH_C80x25:
+ case SW_ENH_B80x43: case SW_ENH_C80x43:
+ case SW_EGAMONO80x25:
+
+ if (crtc_type != KD_VGA)
+ return ENODEV;
+ mp = get_mode_param(scp, cmd & 0xff);
+ if (mp == NULL)
+ return ENODEV;
+
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ if (scp->history != NULL)
+ i = imax(scp->history_size / scp->xsize
+ - imax(SC_HISTORY_SIZE, scp->ysize), 0);
+ else
+ i = 0;
+ switch (cmd & 0xff) {
+ case M_VGA_C80x60: case M_VGA_M80x60:
+ if (!(fonts_loaded & FONT_8)) {
+ splx(s);
+ return EINVAL;
+ }
+ /*
+ * This is a kludge to fend off scrn_update() while we
+ * muck around with scp. XXX
+ */
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 60;
+ scp->font_size = 8;
+ break;
+ case M_VGA_C80x50: case M_VGA_M80x50:
+ if (!(fonts_loaded & FONT_8)) {
+ splx(s);
+ return EINVAL;
+ }
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 50;
+ scp->font_size = 8;
+ break;
+ case M_ENH_B80x43: case M_ENH_C80x43:
+ if (!(fonts_loaded & FONT_8)) {
+ splx(s);
+ return EINVAL;
+ }
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 43;
+ scp->font_size = 8;
+ break;
+ case M_VGA_C80x30: case M_VGA_M80x30:
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = 80;
+ scp->ysize = 30;
+ scp->font_size = mp[2];
+ break;
+ case M_ENH_C40x25: case M_ENH_B40x25:
+ case M_ENH_C80x25: case M_ENH_B80x25:
+ case M_EGAMONO80x25:
+ if (!(fonts_loaded & FONT_14)) {
+ splx(s);
+ return EINVAL;
+ }
+ /* FALL THROUGH */
+ default:
+ if ((cmd & 0xff) > M_VGA_CG320) {
+ splx(s);
+ return EINVAL;
+ }
+ scp->status |= UNKNOWN_MODE;
+ scp->xsize = mp[0];
+ scp->ysize = mp[1] + rows_offset;
+ scp->font_size = mp[2];
+ break;
+ }
+#endif
+
+ scp->mode = cmd & 0xff;
+ scp->xpixel = scp->xsize * 8;
+ scp->ypixel = scp->ysize * scp->font_size;
+ free(scp->scr_buf, M_DEVBUF);
+ scp->scr_buf = (u_short *)
+ malloc(scp->xsize*scp->ysize*sizeof(u_short), M_DEVBUF, M_WAITOK);
+#ifdef PC98
+ free(scp->atr_buf, M_DEVBUF);
+ scp->atr_buf = (u_short *)
+ malloc(scp->xsize*scp->ysize*sizeof(u_short),M_DEVBUF, M_WAITOK);
+#endif
+ /* move the text cursor to the home position */
+ move_crsr(scp, 0, 0);
+ /* move the mouse cursor at the center of the screen */
+ scp->mouse_xpos = scp->xpixel / 2;
+ scp->mouse_ypos = scp->ypixel / 2;
+ scp->mouse_pos = scp->mouse_oldpos =
+ scp->scr_buf + (scp->mouse_ypos / scp->font_size) * scp->xsize
+ + scp->mouse_xpos / 8;
+ /* allocate a larger cut buffer if necessary */
+ if ((cut_buffer == NULL)
+ || (cut_buffer_size < scp->xsize * scp->ysize + 1)) {
+ if (cut_buffer != NULL)
+ free(cut_buffer, M_DEVBUF);
+ cut_buffer_size = scp->xsize * scp->ysize + 1;
+ cut_buffer = (char *)malloc(cut_buffer_size, M_DEVBUF, M_NOWAIT);
+ if (cut_buffer != NULL)
+ cut_buffer[0] = '\0';
+ }
+ splx(s);
+
+ usp = scp->history;
+ scp->history = NULL;
+ if (usp != NULL) {
+ free(usp, M_DEVBUF);
+ extra_history_size += i;
+ }
+#ifdef PC98
+ atr_usp = scp->his_atr;
+ scp->his_atr = NULL;
+ if (atr_usp != NULL)
+ free(atr_usp, M_DEVBUF);
+#endif
+ scp->history_size = imax(SC_HISTORY_SIZE, scp->ysize) * scp->xsize;
+ usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (usp != NULL)
+ bzero(usp, scp->history_size * sizeof(u_short));
+ scp->history_head = scp->history_pos = usp;
+ scp->history = usp;
+#ifdef PC98
+ atr_usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
+ M_DEVBUF, M_NOWAIT);
+ if (atr_usp != NULL)
+ bzero(atr_usp, scp->history_size * sizeof(u_short));
+ scp->his_atr_head = scp->his_atr_pos = atr_usp;
+ scp->his_atr = atr_usp;
+#endif
+ if (scp == cur_console)
+ set_mode(scp);
+ clear_screen(scp);
+ scp->status &= ~UNKNOWN_MODE;
+
+ if (tp->t_winsize.ws_col != scp->xsize
+ || tp->t_winsize.ws_row != scp->ysize) {
+ tp->t_winsize.ws_col = scp->xsize;
+ tp->t_winsize.ws_row = scp->ysize;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+ return 0;
+#ifndef PC98
+ /* GRAPHICS MODES */
+ case SW_BG320: case SW_BG640:
+ case SW_CG320: case SW_CG320_D: case SW_CG640_E:
+ case SW_CG640x350: case SW_ENH_CG640:
+ case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
+
+ if (crtc_type != KD_VGA)
+ return ENODEV;
+ mp = get_mode_param(scp, cmd & 0xff);
+ if (mp == NULL)
+ return ENODEV;
+
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE; /* graphics mode */
+ scp->mode = cmd & 0xFF;
+ scp->xpixel = mp[0] * 8;
+ scp->ypixel = (mp[1] + rows_offset) * mp[2];
+ scp->font_size = FONT_NONE;
+ /* move the mouse cursor at the center of the screen */
+ scp->mouse_xpos = scp->xpixel / 2;
+ scp->mouse_ypos = scp->ypixel / 2;
+ splx(s);
+
+ if (scp == cur_console)
+ set_mode(scp);
+ /* clear_graphics();*/
+
+ if (tp->t_winsize.ws_xpixel != scp->xpixel
+ || tp->t_winsize.ws_ypixel != scp->ypixel) {
+ tp->t_winsize.ws_xpixel = scp->xpixel;
+ tp->t_winsize.ws_ypixel = scp->ypixel;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+ return 0;
+
+ case SW_VGA_MODEX:
+ if (crtc_type != KD_VGA)
+ return ENODEV;
+ mp = get_mode_param(scp, cmd & 0xff);
+ if (mp == NULL)
+ return ENODEV;
+
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE; /* graphics mode */
+ scp->mode = cmd & 0xFF;
+ scp->xpixel = 320;
+ scp->ypixel = 240;
+ scp->font_size = FONT_NONE;
+ splx(s);
+
+ if (scp == cur_console)
+ set_mode(scp);
+ /* clear_graphics();*/
+ if (tp->t_winsize.ws_xpixel != scp->xpixel
+ || tp->t_winsize.ws_ypixel != scp->ypixel) {
+ tp->t_winsize.ws_xpixel = scp->xpixel;
+ tp->t_winsize.ws_ypixel = scp->ypixel;
+ pgsignal(tp->t_pgrp, SIGWINCH, 1);
+ }
+ return 0;
+#endif /* PC98 */
+
case VT_SETMODE: /* set screen switcher mode */
{
struct vt_mode *mode;
@@ -1509,7 +2041,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case VT_RELDISP: /* screen switcher ioctl */
- switch(*(int *)data) {
+ switch(*data) {
case VT_FALSE: /* user refuses to release screen, abort */
if (scp == old_scp && (scp->status & SWITCH_WAIT_REL)) {
old_scp->status &= ~SWITCH_WAIT_REL;
@@ -1549,40 +2081,32 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
for (i = 0; i < MAXCONS; i++) {
tp = VIRTUAL_TTY(i);
if (!(tp->t_state & TS_ISOPEN)) {
- *(int *)data = i + 1;
+ *data = i + 1;
return 0;
}
}
return EINVAL;
case VT_ACTIVATE: /* switch to screen *data */
- s = spltty();
- sc_clean_up(cur_console);
- splx(s);
- return switch_scr(scp, *(int *)data - 1);
+ return switch_scr(scp, (*data) - 1);
case VT_WAITACTIVE: /* wait for switch to occur */
- if (*(int *)data > MAXCONS || *(int *)data < 0)
+ if (*data > MAXCONS || *data < 0)
return EINVAL;
- s = spltty();
- error = sc_clean_up(cur_console);
- splx(s);
- if (error)
- return error;
- if (minor(dev) == *(int *)data - 1)
+ if (minor(dev) == (*data) - 1)
return 0;
- if (*(int *)data == 0) {
+ if (*data == 0) {
if (scp == cur_console)
return 0;
}
else
- scp = console[*(int *)data - 1];
+ scp = console[(*data) - 1];
while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH,
"waitvt", 0)) == ERESTART) ;
return error;
case VT_GETACTIVE:
- *(int *)data = get_scr_num()+1;
+ *data = get_scr_num()+1;
return 0;
case KDENABIO: /* allow io operations */
@@ -1598,37 +2122,126 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
p->p_md.md_regs->tf_eflags &= ~PSL_IOPL;
return 0;
- case KDSKBSTATE: /* set keyboard state (locks) */
- if (*(int *)data & ~LOCK_MASK)
+ case KDSETMODE: /* set current mode of this (virtual) console */
+ switch (*data) {
+ case KD_TEXT: /* switch to TEXT (known) mode */
+#ifndef PC98
+ /* restore fonts & palette ! */
+ if (crtc_type == KD_VGA) {
+ if (!VESA_MODE(scp->mode)) {
+#if 0
+ /*
+ * FONT KLUDGE
+ * Don't load fonts for now... XXX
+ */
+ if (fonts_loaded & FONT_8)
+ copy_font(LOAD, FONT_8, font_8);
+ if (fonts_loaded & FONT_14)
+ copy_font(LOAD, FONT_14, font_14);
+ if (fonts_loaded & FONT_16)
+ copy_font(LOAD, FONT_16, font_16);
+#endif
+ }
+ load_palette(palette);
+ }
+
+ /* move hardware cursor out of the way */
+ outb(crtc_addr, 14);
+ outb(crtc_addr + 1, 0xff);
+ outb(crtc_addr, 15);
+ outb(crtc_addr + 1, 0xff);
+
+ /* FALL THROUGH */
+#endif
+ case KD_TEXT1: /* switch to TEXT (known) mode */
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE;
+ splx(s);
+ /* no restore fonts & palette */
+#ifdef PC98
+ scp->status &= ~UNKNOWN_MODE;
+#else
+ if (crtc_type == KD_VGA)
+#endif
+ set_mode(scp);
+ scp->status &= ~UNKNOWN_MODE;
+ clear_screen(scp);
+ return 0;
+
+ case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
+ s = spltty();
+ if ((error = wait_scrn_saver_stop())) {
+ splx(s);
+ return error;
+ }
+ scp->status &= ~MOUSE_VISIBLE;
+ remove_cutmarking(scp);
+ scp->status |= UNKNOWN_MODE;
+#ifdef PC98
+ set_mode(scp);
+#endif
+ splx(s);
+ return 0;
+ default:
return EINVAL;
- scp->status &= ~LOCK_MASK;
- scp->status |= *(int *)data;
+ }
+ /* NOT REACHED */
+
+ case KDGETMODE: /* get current mode of this (virtual) console */
+ *data = (scp->status & UNKNOWN_MODE) ? KD_GRAPHICS : KD_TEXT;
+ return 0;
+
+ case KDSBORDER: /* set border color of this (virtual) console */
+ scp->border = *data;
if (scp == cur_console)
- update_kbd_state(scp->status, LOCK_MASK);
+ set_border(scp->border);
return 0;
+ case KDSKBSTATE: /* set keyboard state (locks) */
+ if (*data >= 0 && *data <= LOCK_KEY_MASK) {
+ scp->status &= ~LOCK_KEY_MASK;
+ scp->status |= *data;
+ if (scp == cur_console)
+ update_leds(scp->status);
+ return 0;
+ }
+ return EINVAL;
+
case KDGKBSTATE: /* get keyboard state (locks) */
- if (scp == cur_console)
- save_kbd_state(scp);
- *(int *)data = scp->status & LOCK_MASK;
+ *data = scp->status & LOCK_KEY_MASK;
return 0;
case KDSETRAD: /* set keyboard repeat & delay rates */
- if (*(int *)data & ~0x7f)
+#ifndef PC98
+ if (*data & 0x80)
return EINVAL;
- error = kbd_ioctl(kbd, KDSETRAD, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ if (sc_kbdc != NULL)
+ set_keyboard(KBDC_SET_TYPEMATIC, *data);
+#endif
+ return 0;
case KDSKBMODE: /* set keyboard mode */
- switch (*(int *)data) {
- case K_XLATE: /* switch to XLT ascii mode */
+ switch (*data) {
case K_RAW: /* switch to RAW scancode mode */
+ scp->status &= ~KBD_CODE_MODE;
+ scp->status |= KBD_RAW_MODE;
+ return 0;
+
case K_CODE: /* switch to CODE mode */
- scp->kbd_mode = *(int *)data;
- if (scp == cur_console)
- kbd_ioctl(kbd, cmd, data);
+ scp->status &= ~KBD_RAW_MODE;
+ scp->status |= KBD_CODE_MODE;
+ return 0;
+
+ case K_XLATE: /* switch to XLT ascii mode */
+ if (scp == cur_console && scp->status & KBD_RAW_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ scp->status &= ~(KBD_RAW_MODE | KBD_CODE_MODE);
return 0;
default:
return EINVAL;
@@ -1636,15 +2249,10 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/* NOT REACHED */
case KDGKBMODE: /* get keyboard mode */
- *(int *)data = scp->kbd_mode;
+ *data = (scp->status & KBD_RAW_MODE) ? K_RAW :
+ ((scp->status & KBD_CODE_MODE) ? K_CODE : K_XLATE);
return 0;
- case KDGKBINFO:
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
-
case KDMKTONE: /* sound the bell */
if (*(int*)data)
do_bell(scp, (*(int*)data)&0xffff,
@@ -1696,74 +2304,45 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return 0;
case KDGKBTYPE: /* get keyboard type */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL) {
- /* always return something? XXX */
- *(int *)data = 0;
- }
+ *data = 0; /* type not known (yet) */
return 0;
case KDSETLED: /* set keyboard LED status */
- if (*(int *)data & ~LED_MASK) /* FIXME: LOCK_MASK? */
- return EINVAL;
- scp->status &= ~LED_MASK;
- scp->status |= *(int *)data;
- if (scp == cur_console)
- update_kbd_leds(scp->status);
- return 0;
+ if (*data >= 0 && *data <= LED_MASK) {
+ scp->status &= ~LED_MASK;
+ scp->status |= *data;
+ if (scp == cur_console)
+ update_leds(scp->status);
+ return 0;
+ }
+ return EINVAL;
case KDGETLED: /* get keyboard LED status */
- if (scp == cur_console)
- save_kbd_state(scp);
- *(int *)data = scp->status & LED_MASK;
+ *data = scp->status & LED_MASK;
return 0;
- case CONS_SETKBD: /* set the new keyboard */
- {
- keyboard_t *newkbd;
-
- s = spltty();
- newkbd = kbd_get_keyboard(*(int *)data);
- if (newkbd == NULL) {
- splx(s);
- return EINVAL;
- }
- error = 0;
- if (kbd != newkbd) {
- i = kbd_allocate(newkbd->kb_name, newkbd->kb_unit,
- (void *)&keyboard, sckbdevent, NULL);
- /* i == newkbd->kb_index */
- if (i >= 0) {
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- kbd_release(kbd, (void *)&keyboard);
- }
- kbd = kbd_get_keyboard(i); /* kbd == newkbd */
- keyboard = i;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- update_kbd_state(cur_console->status, LOCK_MASK);
- } else {
- error = EPERM; /* XXX */
- }
- }
- splx(s);
- return error;
+ case GETFKEY: /* get functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(&fkey_tab[ptr->keynum].str, ptr->keydef,
+ fkey_tab[ptr->keynum].len);
+ ptr->flen = fkey_tab[ptr->keynum].len;
+ return 0;
}
+ else
+ return EINVAL;
- case CONS_RELKBD: /* release the current keyboard */
- s = spltty();
- error = 0;
- if (kbd != NULL) {
- save_kbd_state(cur_console);
- error = kbd_release(kbd, (void *)&keyboard);
- if (error == 0) {
- kbd = NULL;
- keyboard = -1;
- }
+ case SETFKEY: /* set functionkey string */
+ if (*(u_short*)data < n_fkey_tab) {
+ fkeyarg_t *ptr = (fkeyarg_t*)data;
+ bcopy(ptr->keydef, &fkey_tab[ptr->keynum].str,
+ min(ptr->flen, MAXFK));
+ fkey_tab[ptr->keynum].len = min(ptr->flen, MAXFK);
+ return 0;
}
- splx(s);
- return error;
-
+ else
+ return EINVAL;
+
case GIO_SCRNMAP: /* get output translation table */
bcopy(&scr_map, data, sizeof(scr_map));
return 0;
@@ -1774,19 +2353,36 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
scr_rmap[scr_map[i]] = i;
return 0;
- case GIO_KEYMAP: /* get keyboard translation table */
- case PIO_KEYMAP: /* set keyboard translation table */
- case GIO_DEADKEYMAP: /* get accent key translation table */
- case PIO_DEADKEYMAP: /* set accent key translation table */
- case GETFKEY: /* get function key string */
- case SETFKEY: /* set function key string */
- error = kbd_ioctl(kbd, cmd, data);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ case GIO_KEYMAP: /* get keyboard translation table */
+ bcopy(&key_map, data, sizeof(key_map));
+ return 0;
+
+ case PIO_KEYMAP: /* set keyboard translation table */
+ accents = 0;
+ bzero(&accent_map, sizeof(accent_map));
+ bcopy(data, &key_map, sizeof(key_map));
+ return 0;
+
+ case GIO_DEADKEYMAP: /* get accent key translation table */
+ bcopy(&accent_map, data, sizeof(accent_map));
+ return 0;
+ case PIO_DEADKEYMAP: /* set accent key translation table */
+ accents = 0;
+ bcopy(data, &accent_map, sizeof(accent_map));
+ return 0;
+
+#ifdef PC98
case PIO_FONT8x8: /* set 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ case GIO_FONT8x8: /* get 8x8 dot font */
+ case PIO_FONT8x14: /* set 8x14 dot font */
+ case GIO_FONT8x14: /* get 8x14 dot font */
+ case PIO_FONT8x16: /* set 8x16 dot font */
+ case GIO_FONT8x16: /* get 8x16 dot font */
+ return ENXIO;
+#else
+ case PIO_FONT8x8: /* set 8x8 dot font */
+ if (crtc_type != KD_VGA)
return ENXIO;
bcopy(data, font_8, 8*256);
fonts_loaded |= FONT_8;
@@ -1795,12 +2391,17 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* Always use the font page #0. XXX
* Don't load if the current font size is not 8x8.
*/
- if (ISTEXTSC(cur_console) && (cur_console->font_size < 14))
- copy_font(cur_console, LOAD, 8, font_8);
+ if (!VESA_MODE(cur_console->mode)
+ && !(cur_console->status & UNKNOWN_MODE)
+ && (cur_console->font_size < 14)) {
+ copy_font(LOAD, FONT_8, font_8);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ }
return 0;
case GIO_FONT8x8: /* get 8x8 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
if (fonts_loaded & FONT_8) {
bcopy(font_8, data, 8*256);
@@ -1810,7 +2411,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return ENXIO;
case PIO_FONT8x14: /* set 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
bcopy(data, font_14, 14*256);
fonts_loaded |= FONT_14;
@@ -1819,13 +2420,17 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* Always use the font page #0. XXX
* Don't load if the current font size is not 8x14.
*/
- if (ISTEXTSC(cur_console)
- && (cur_console->font_size >= 14) && (cur_console->font_size < 16))
- copy_font(cur_console, LOAD, 14, font_14);
+ if (!VESA_MODE(cur_console->mode)
+ && !(cur_console->status & UNKNOWN_MODE)
+ && (cur_console->font_size >= 14) && (cur_console->font_size < 16)) {
+ copy_font(LOAD, FONT_14, font_14);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ }
return 0;
case GIO_FONT8x14: /* get 8x14 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
if (fonts_loaded & FONT_14) {
bcopy(font_14, data, 14*256);
@@ -1835,7 +2440,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return ENXIO;
case PIO_FONT8x16: /* set 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
bcopy(data, font_16, 16*256);
fonts_loaded |= FONT_16;
@@ -1844,12 +2449,17 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
* Always use the font page #0. XXX
* Don't load if the current font size is not 8x16.
*/
- if (ISTEXTSC(cur_console) && (cur_console->font_size >= 16))
- copy_font(cur_console, LOAD, 16, font_16);
+ if (!VESA_MODE(cur_console->mode)
+ && !(cur_console->status & UNKNOWN_MODE)
+ && (cur_console->font_size >= 16)) {
+ copy_font(LOAD, FONT_16, font_16);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(cur_console);
+ }
return 0;
case GIO_FONT8x16: /* get 8x16 dot font */
- if (!ISFONTAVAIL(scp->adp->va_flags))
+ if (crtc_type != KD_VGA)
return ENXIO;
if (fonts_loaded & FONT_16) {
bcopy(font_16, data, 16*256);
@@ -1857,6 +2467,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
}
else
return ENXIO;
+#endif /* PC98 */
#ifdef PC98
case ADJUST_CLOCK: /* /dev/rtc for 98note resume */
@@ -1882,7 +2493,7 @@ scstart(struct tty *tp)
struct clist *rbp;
int s, len;
u_char buf[PCBURST];
- scr_stat *scp = sc_get_scr_stat(tp->t_dev);
+ scr_stat *scp = get_scr_stat(tp->t_dev);
if (scp->status & SLKED || blink_in_progress)
return; /* XXX who repeats the call when the above flags are cleared? */
@@ -1922,7 +2533,7 @@ scmousestart(struct tty *tp)
splx(s);
}
-static void
+void
sccnprobe(struct consdev *cp)
{
struct isa_device *dvp;
@@ -1936,59 +2547,35 @@ sccnprobe(struct consdev *cp)
return;
}
- if (!scvidprobe(dvp->id_unit, dvp->id_flags, TRUE)) {
+ if (!scvidprobe(dvp->id_unit, dvp->id_flags)) {
cp->cn_pri = CN_DEAD;
return;
}
- sckbdprobe(dvp->id_unit, dvp->id_flags, TRUE);
/* initialize required fields */
cp->cn_dev = makedev(CDEV_MAJOR, SC_CONSOLE);
cp->cn_pri = CN_INTERNAL;
+
+ sc_kbdc = kbdc_open(sc_port);
}
-static void
+void
sccninit(struct consdev *cp)
{
scinit();
}
-static void
+void
sccnputc(dev_t dev, int c)
{
u_char buf[1];
+ int s;
scr_stat *scp = console[0];
term_stat save = scp->term;
- u_short *p;
- int s;
- int i;
-
- if (scp == cur_console && scp->status & SLKED) {
- scp->status &= ~SLKED;
- update_kbd_state(scp->status, SLKED);
- if (cur_console->status & BUFFER_SAVED) {
- p = cur_console->history_save;
- for (i = 0; i < cur_console->ysize; ++i) {
- bcopy(p, cur_console->scr_buf + (cur_console->xsize*i),
- cur_console->xsize*sizeof(u_short));
- p += cur_console->xsize;
- if (p + cur_console->xsize
- > cur_console->history + cur_console->history_size)
- p = cur_console->history;
- }
- cur_console->status &= ~BUFFER_SAVED;
- cur_console->history_head = cur_console->history_save;
- cur_console->status |= CURSOR_ENABLED;
- mark_all(cur_console);
- }
-#if 1 /* XXX */
- scstart(VIRTUAL_TTY(get_scr_num()));
-#endif
- }
scp->term = kernel_console;
current_default = &kernel_default;
- if (scp == cur_console && !ISGRAPHSC(scp))
+ if (scp == cur_console && !(scp->status & UNKNOWN_MODE))
remove_cursor_image(scp);
buf[0] = c;
ansi_put(scp, buf, 1);
@@ -1996,71 +2583,43 @@ sccnputc(dev_t dev, int c)
current_default = &user_default;
scp->term = save;
- s = spltty(); /* block sckbdevent and scrn_timer */
+ s = spltty(); /* block scintr and scrn_timer */
sccnupdate(scp);
splx(s);
}
-static int
+int
sccngetc(dev_t dev)
{
- return sccngetch(0);
-}
-
-static int
-sccncheckc(dev_t dev)
-{
- return sccngetch(SCGETC_NONBLOCK);
-}
-
-static int
-sccngetch(int flags)
-{
- int cur_mode;
- int s = spltty(); /* block sckbdevent and scrn_timer while we poll */
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
int c;
/*
* Stop the screen saver and update the screen if necessary.
* What if we have been running in the screen saver code... XXX
*/
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
sccnupdate(cur_console);
- if (kbd == NULL) {
- splx(s);
- return -1;
- }
-
- /*
- * Make sure the keyboard is accessible even when the kbd device
- * driver is disabled.
- */
- kbd_enable(kbd);
+ c = scgetc(SCGETC_CN);
+ splx(s);
+ return(c);
+}
- /* we shall always use the keyboard in the XLATE mode here */
- cur_mode = cur_console->kbd_mode;
- cur_console->kbd_mode = K_XLATE;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
+int
+sccncheckc(dev_t dev)
+{
+ int s = spltty(); /* block scintr and scrn_timer while we poll */
+ int c;
- c = scgetc(kbd, SCGETC_CN | flags);
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ sccnupdate(cur_console);
- cur_console->kbd_mode = cur_mode;
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&cur_console->kbd_mode);
- kbd_disable(kbd);
+ c = scgetc(SCGETC_CN | SCGETC_NONBLOCK);
splx(s);
-
- switch (KEYFLAGS(c)) {
- case 0: /* normal char */
- return KEYCHAR(c);
- case FKEY: /* function key */
- return c; /* XXX */
- case NOKEY:
- case ERRKEY:
- default:
- return -1;
- }
- /* NOT REACHED */
+ return(c == NOKEY ? -1 : c); /* c == -1 can't happen */
}
static void
@@ -2071,28 +2630,25 @@ sccnupdate(scr_stat *scp)
if (font_loading_in_progress)
return;
- if (panicstr || shutdown_in_progress) {
- sc_touch_scrn_saver();
- } else if (scp != cur_console) {
- return;
+ if (panicstr) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
}
-
if (!run_scrn_saver)
scrn_idle = FALSE;
-#if NSPLASH > 0
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
+ if (scrn_blanked > 0)
stop_scrn_saver(current_saver);
-#endif /* NSPLASH */
+
if (scp != cur_console || blink_in_progress || switch_in_progress)
return;
- if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
+ if ((scp->status & UNKNOWN_MODE) == 0 && scrn_blanked <= 0)
scrn_update(scp, TRUE);
}
-scr_stat
-*sc_get_scr_stat(dev_t dev)
+static scr_stat
+*get_scr_stat(dev_t dev)
{
int unit = minor(dev);
@@ -2128,10 +2684,35 @@ scrn_timer(void *arg)
}
s = spltty();
+ /*
+ * With release 2.1 of the Xaccel server, the keyboard is left
+ * hanging pretty often. Apparently an interrupt from the
+ * keyboard is lost, and I don't know why (yet).
+ * This ugly hack calls scintr if input is ready for the keyboard
+ * and conveniently hides the problem. XXX
+ */
+ /* Try removing anything stuck in the keyboard controller; whether
+ * it's a keyboard scan code or mouse data. `scintr()' doesn't
+ * read the mouse data directly, but `kbdio' routines will, as a
+ * side effect.
+ */
+ if (kbdc_lock(sc_kbdc, TRUE)) {
+ /*
+ * We have seen the lock flag is not set. Let's reset the flag early;
+ * otherwise `update_led()' failes which may want the lock
+ * during `scintr()'.
+ */
+ kbdc_lock(sc_kbdc, FALSE);
+ if (kbdc_data_ready(sc_kbdc))
+ scintr(0);
+ }
+
/* should we stop the screen saver? */
getmicrouptime(&tv);
- if (panicstr || shutdown_in_progress)
- sc_touch_scrn_saver();
+ if (panicstr || shutdown_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
if (run_scrn_saver) {
scrn_idle = (tv.tv_sec > scrn_time_stamp + scrn_blank_time);
} else {
@@ -2140,11 +2721,10 @@ scrn_timer(void *arg)
if (scrn_blank_time > 0)
run_scrn_saver = TRUE;
}
-#if NSPLASH > 0
if ((saver_mode != CONS_LKM_SAVER) || !scrn_idle)
- if (scrn_blanked)
+ if (scrn_blanked > 0)
stop_scrn_saver(current_saver);
-#endif /* NSPLASH */
+
/* should we just return ? */
if (blink_in_progress || switch_in_progress) {
if (arg)
@@ -2155,12 +2735,12 @@ scrn_timer(void *arg)
/* Update the screen */
scp = cur_console;
- if (!ISGRAPHSC(scp) && !(scp->status & SAVER_RUNNING))
+ if ((scp->status & UNKNOWN_MODE) == 0 && scrn_blanked <= 0)
scrn_update(scp, TRUE);
/* should we activate the screen saver? */
if ((saver_mode == CONS_LKM_SAVER) && scrn_idle)
- if (!ISGRAPHSC(scp) || scrn_blanked)
+ if ((scp->status & UNKNOWN_MODE) == 0 || scrn_blanked > 0)
(*current_saver)(TRUE);
if (arg)
@@ -2228,7 +2808,7 @@ scrn_update(scr_stat *scp, int show_cursor)
draw_cursor_image(scp);
} else {
/* if its a blinking cursor, we may have to update it */
- if (sc_flags & BLINK_CURSOR)
+ if (flags & BLINK_CURSOR)
draw_cursor_image(scp);
}
}
@@ -2242,96 +2822,25 @@ scrn_update(scr_stat *scp, int show_cursor)
scp->start = scp->xsize*scp->ysize - 1;
}
-#if NSPLASH > 0
-
-static int
-scsplash_callback(int event)
-{
- int error;
-
- switch (event) {
- case SPLASH_INIT:
- scrn_saver_failed = FALSE;
- if (add_scrn_saver(scsplash_saver) == 0) {
- run_scrn_saver = TRUE;
- if (cold && !(boothowto & (RB_VERBOSE | RB_CONFIG))) {
- scsplash_stick(TRUE);
- (*current_saver)(TRUE);
- }
- }
- return 0;
-
- case SPLASH_TERM:
- if (current_saver == scsplash_saver) {
- scsplash_stick(FALSE);
- error = remove_scrn_saver(scsplash_saver);
- if (error)
- return error;
- }
- return 0;
-
- default:
- return EINVAL;
- }
-}
-
-static void
-scsplash_saver(int show)
-{
- static int busy = FALSE;
- scr_stat *scp;
-
- if (busy)
- return;
- busy = TRUE;
-
- scp = cur_console;
- if (show) {
- if (!scrn_saver_failed) {
- if (!scrn_blanked)
- set_scrn_saver_mode(scp, -1, NULL, 0);
- switch (splash(scp->adp, TRUE)) {
- case 0: /* succeeded */
- scrn_blanked = TRUE;
- break;
- case EAGAIN: /* try later */
- restore_scrn_saver_mode(scp, FALSE);
- break;
- default:
- scrn_saver_failed = TRUE;
- scsplash_stick(FALSE);
- printf("scsplash_saver(): failed to put up the image\n");
- restore_scrn_saver_mode(scp, TRUE);
- break;
- }
- }
- } else if (!sticky_splash) {
- if (scrn_blanked && (splash(scp->adp, FALSE) == 0)) {
- restore_scrn_saver_mode(scp, TRUE);
- scrn_blanked = FALSE;
- }
- }
- busy = FALSE;
-}
-
-static int
+int
add_scrn_saver(void (*this_saver)(int))
{
- int error;
-
- if (current_saver != none_saver) {
- error = remove_scrn_saver(current_saver);
- if (error)
- return error;
+#ifdef SC_SPLASH_SCREEN
+ if (current_saver == scsplash) {
+ scsplash_stick(FALSE);
+ stop_scrn_saver(scsplash);
}
+#endif
- run_scrn_saver = FALSE;
- saver_mode = CONS_LKM_SAVER;
+ if (current_saver != default_saver)
+ return EBUSY;
current_saver = this_saver;
+ saver_mode = CONS_LKM_SAVER;
+ run_scrn_saver = (scrn_blank_time > 0);
return 0;
}
-static int
+int
remove_scrn_saver(void (*this_saver)(int))
{
if (current_saver != this_saver)
@@ -2344,72 +2853,14 @@ remove_scrn_saver(void (*this_saver)(int))
* before stopping the current saver, rather than blocking by `splXX()'.
*/
current_saver = none_saver;
- if (scrn_blanked)
+ if (scrn_blanked > 0)
stop_scrn_saver(this_saver);
- return (scrn_blanked ? EBUSY : 0);
-}
+ if (scrn_blanked > 0)
+ return EBUSY; /* XXX */
-static int
-set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border)
-{
- int s;
-
- /* assert(scp == cur_console) */
- s = spltty();
- scp->splash_save_mode = scp->mode;
- scp->splash_save_status = scp->status & (GRAPHICS_MODE | PIXEL_MODE);
- scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE);
- scp->status |= (UNKNOWN_MODE | SAVER_RUNNING);
- splx(s);
- if (mode < 0)
- return 0;
- scp->mode = mode;
- if (set_mode(scp) == 0) {
- if (scp->adp->va_mode_flags & V_INFO_GRAPHICS)
- scp->status |= GRAPHICS_MODE;
- if (pal != NULL)
- load_palette(scp->adp, pal);
- set_border(scp, border);
- return 0;
- } else {
- s = spltty();
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- splx(s);
- return 1;
- }
-}
-
-static int
-restore_scrn_saver_mode(scr_stat *scp, int changemode)
-{
- int mode;
- int status;
- int s;
-
- /* assert(scp == cur_console) */
- s = spltty();
- mode = scp->mode;
- status = scp->status;
- scp->mode = scp->splash_save_mode;
- scp->status &= ~(UNKNOWN_MODE | SAVER_RUNNING);
- scp->status |= scp->splash_save_status;
- if (!changemode) {
- splx(s);
- return 0;
- }
- if (set_mode(scp) == 0) {
- load_palette(scp->adp, palette);
- splx(s);
- return 0;
- } else {
- scp->mode = mode;
- scp->status = status;
- splx(s);
- return 1;
- }
+ current_saver = default_saver;
+ return 0;
}
static void
@@ -2418,7 +2869,7 @@ stop_scrn_saver(void (*saver)(int))
(*saver)(FALSE);
run_scrn_saver = FALSE;
/* the screen saver may have chosen not to stop after all... */
- if (scrn_blanked)
+ if (scrn_blanked > 0)
return;
mark_all(cur_console);
@@ -2432,8 +2883,8 @@ wait_scrn_saver_stop(void)
{
int error = 0;
- while (scrn_blanked) {
- run_scrn_saver = FALSE;
+ run_scrn_saver = FALSE;
+ while (scrn_blanked > 0) {
error = tsleep((caddr_t)&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
run_scrn_saver = FALSE;
if (error != ERESTART)
@@ -2442,17 +2893,8 @@ wait_scrn_saver_stop(void)
return error;
}
-#endif /* NSPLASH */
-
-void
-sc_touch_scrn_saver(void)
-{
- scsplash_stick(FALSE);
- run_scrn_saver = FALSE;
-}
-
-void
-sc_clear_screen(scr_stat *scp)
+static void
+clear_screen(scr_stat *scp)
{
move_crsr(scp, 0, 0);
scp->cursor_oldpos = scp->cursor_pos;
@@ -2473,9 +2915,10 @@ static int
switch_scr(scr_stat *scp, u_int next_scr)
{
/* delay switch if actively updating screen */
- if (scrn_blanked || write_in_progress || blink_in_progress) {
+ if (scrn_blanked > 0 || write_in_progress || blink_in_progress) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
delayed_next_scr = next_scr+1;
- sc_touch_scrn_saver();
return 0;
}
@@ -2483,7 +2926,8 @@ switch_scr(scr_stat *scp, u_int next_scr)
switch_in_progress = FALSE;
if (next_scr >= MAXCONS || switch_in_progress ||
- (cur_console->smode.mode == VT_AUTO && ISGRAPHSC(cur_console))) {
+ (cur_console->smode.mode == VT_AUTO
+ && cur_console->status & UNKNOWN_MODE)) {
do_bell(scp, BELL_PITCH, BELL_DURATION);
return EINVAL;
}
@@ -2533,35 +2977,33 @@ switch_scr(scr_stat *scp, u_int next_scr)
static void
exchange_scr(void)
{
- /* save the current state of video and keyboard */
move_crsr(old_scp, old_scp->xpos, old_scp->ypos);
- if (old_scp->kbd_mode == K_XLATE)
- save_kbd_state(old_scp);
-
- /* set up the video for the new screen */
cur_console = new_scp;
#ifdef PC98
- if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp) || ISUNKNOWNSC(new_scp))
+ if (old_scp->mode != new_scp->mode || (old_scp->status & UNKNOWN_MODE) || (new_scp->status & UNKNOWN_MODE)){
#else
- if (old_scp->mode != new_scp->mode || ISUNKNOWNSC(old_scp))
+ if (old_scp->mode != new_scp->mode || (old_scp->status & UNKNOWN_MODE)){
+ if (crtc_type == KD_VGA)
#endif
- set_mode(new_scp);
+ set_mode(new_scp);
+ }
move_crsr(new_scp, new_scp->xpos, new_scp->ypos);
#ifndef PC98
- if (ISTEXTSC(new_scp) && (sc_flags & CHAR_CURSOR))
+ if (!(new_scp->status & UNKNOWN_MODE) && (flags & CHAR_CURSOR))
set_destructive_cursor(new_scp);
- if (ISGRAPHSC(old_scp))
- load_palette(new_scp->adp, palette);
-#endif
- set_border(new_scp, new_scp->border);
-
- /* set up the keyboard for the new screen */
- if (old_scp->kbd_mode != new_scp->kbd_mode)
- kbd_ioctl(kbd, KDSKBMODE, (caddr_t)&new_scp->kbd_mode);
- update_kbd_state(new_scp->status, LOCK_MASK);
-
+ if ((old_scp->status & UNKNOWN_MODE) && crtc_type == KD_VGA)
+ load_palette(palette);
+#endif
+ if (old_scp->status & KBD_RAW_MODE || new_scp->status & KBD_RAW_MODE ||
+ old_scp->status & KBD_CODE_MODE || new_scp->status & KBD_CODE_MODE)
+ shfts = ctls = alts = agrs = metas = accents = 0;
+ set_border(new_scp->border);
+ update_leds(new_scp->status);
delayed_next_scr = FALSE;
mark_all(new_scp);
+ if (new_scp->mode == 0x102) {
+ bzero(Crtat, 800*600/8);
+ }
}
static void
@@ -2578,36 +3020,36 @@ scan_esc(scr_stat *scp, u_char c)
if (scp->term.esc == 1) { /* seen ESC */
#ifdef KANJI
switch (scp->kanji_type) {
- case KTYPE_KANIN: /* Kanji Invoke sequence */
+ case 0x80:
switch (c) {
case 'B':
case '@':
- scp->kanji_type = KTYPE_7JIS;
+ scp->kanji_type = 0x20;
scp->term.esc = 0;
scp->kanji_1st_char = 0;
return;
default:
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
scp->term.esc = 0;
break;
}
break;
- case KTYPE_ASCIN: /* Ascii Invoke sequence */
+ case 0x40:
switch (c) {
case 'J':
case 'B':
case 'H':
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
scp->term.esc = 0;
scp->kanji_1st_char = 0;
return;
case 'I':
- scp->kanji_type = KTYPE_JKANA;
+ scp->kanji_type = 0x10;
scp->term.esc = 0;
scp->kanji_1st_char = 0;
return;
default:
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
scp->term.esc = 0;
break;
}
@@ -2637,8 +3079,8 @@ scan_esc(scr_stat *scp, u_char c)
return;
#ifdef KANJI
- case '$': /* Kanji Invoke sequence */
- scp->kanji_type = KTYPE_KANIN;
+ case '$': /* Kanji IN sequence */
+ scp->kanji_type = 0x80;
return;
#endif
@@ -2670,12 +3112,12 @@ scan_esc(scr_stat *scp, u_char c)
return;
#endif
case 'c': /* Clear screen & home */
- sc_clear_screen(scp);
+ clear_screen(scp);
break;
case '(': /* iso-2022: designate 94 character set to G0 */
#ifdef KANJI
- scp->kanji_type = KTYPE_ASCIN;
+ scp->kanji_type = 0x40;
#else
scp->term.esc = 5;
#endif
@@ -2772,7 +3214,7 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ mark_for_update(scp, scp->xsize * scp->ysize);
remove_cutmarking(scp);
break;
case 1: /* clear from beginning of display to cursor */
@@ -2835,10 +3277,10 @@ scan_esc(scr_stat *scp, u_char c)
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
mark_for_update(scp, scp->cursor_pos - scp->scr_buf +
- scp->xsize - 1 - scp->xpos);
+ scp->xsize - scp->xpos);
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf +
- scp->xsize - 1 - scp->xpos);
+ scp->xsize - scp->xpos);
#endif
break;
case 1: /* clear from beginning of line to cursor */
@@ -2874,7 +3316,7 @@ scan_esc(scr_stat *scp, u_char c)
scp->xsize);
#endif
mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, (scp->ypos + 1) * scp->xsize - 1);
+ mark_for_update(scp, (scp->ypos + 1) * scp->xsize);
break;
}
break;
@@ -2900,7 +3342,7 @@ scan_esc(scr_stat *scp, u_char c)
n * scp->xsize);
#endif
mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ mark_for_update(scp, scp->xsize * scp->ysize);
break;
case 'M': /* Delete n lines */
@@ -2926,7 +3368,7 @@ scan_esc(scr_stat *scp, u_char c)
n * scp->xsize);
#endif
mark_for_update(scp, scp->ypos * scp->xsize);
- mark_for_update(scp, scp->xsize * scp->ysize - 1);
+ mark_for_update(scp, scp->xsize * scp->ysize);
break;
case 'P': /* Delete n chars */
@@ -2952,9 +3394,9 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count);
#ifdef PC98
- mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count);
#endif
break;
@@ -2979,9 +3421,9 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n + count);
#ifdef PC98
- mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count - 1);
+ mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n + count);
#endif
break;
@@ -3051,9 +3493,9 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef PC98
mark_for_update(scp, scp->cursor_atr - scp->atr_buf);
#endif
- mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n - 1);
+ mark_for_update(scp, scp->cursor_pos - scp->scr_buf + n);
#ifdef PC98
- mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n - 1);
+ mark_for_update(scp, scp->cursor_atr - scp->atr_buf + n);
#endif
break;
@@ -3125,7 +3567,7 @@ scan_esc(scr_stat *scp, u_char c)
scp->term.cur_color =
(scp->term.cur_color&0xF000) | (ansi_col[(n-30)&7]<<8);
scp->term.cur_attr = mask2attr(&scp->term);
- break;
+ break;
case 40: case 41: /* set bg color */
case 42: case 43: case 44:
case 45: case 46: case 47:
@@ -3232,7 +3674,7 @@ scan_esc(scr_stat *scp, u_char c)
if (scp->term.num_param == 1) {
scp->border=scp->term.param[0] & 0xff;
if (scp == cur_console)
- set_border(cur_console, scp->border);
+ set_border(scp->border);
}
break;
@@ -3246,21 +3688,14 @@ scan_esc(scr_stat *scp, u_char c)
case 'C': /* set cursor type & shape */
if (scp->term.num_param == 1) {
if (scp->term.param[0] & 0x01)
- sc_flags |= BLINK_CURSOR;
+ flags |= BLINK_CURSOR;
else
- sc_flags &= ~BLINK_CURSOR;
-#ifdef PC98
- if (scp->term.param[0] & 0x02)
- sc_flags |= CHAR_CURSOR;
+ flags &= ~BLINK_CURSOR;
+ if ((scp->term.param[0] & 0x02) &&
+ crtc_type == KD_VGA && !VESA_MODE(bios_video_mode))
+ flags |= CHAR_CURSOR;
else
- sc_flags &= ~CHAR_CURSOR;
-#else /* PC98 */
- if ((scp->term.param[0] & 0x02)
- && ISFONTAVAIL(scp->adp->va_flags))
- sc_flags |= CHAR_CURSOR;
- else
- sc_flags &= ~CHAR_CURSOR;
-#endif /* PC98 */
+ flags &= ~CHAR_CURSOR;
}
else if (scp->term.num_param == 2) {
scp->cursor_start = scp->term.param[0] & 0x1F;
@@ -3270,13 +3705,11 @@ scan_esc(scr_stat *scp, u_char c)
* The cursor shape is global property; all virtual consoles
* are affected. Update the cursor in the current console...
*/
- if (!ISGRAPHSC(cur_console)) {
- i = spltty();
+ if (!(cur_console->status & UNKNOWN_MODE)) {
remove_cursor_image(cur_console);
- if (sc_flags & CHAR_CURSOR)
+ if (crtc_type == KD_VGA && (flags & CHAR_CURSOR))
set_destructive_cursor(cur_console);
draw_cursor_image(cur_console);
- splx(i);
}
break;
@@ -3339,114 +3772,103 @@ scan_esc(scr_stat *scp, u_char c)
#ifdef KANJI
static u_char iskanji1(u_char mode, u_char c)
{
- if ((mode == KTYPE_7JIS) && (c >= 0x21) && (c <= 0x7e)) {
+ if ((mode == 0x20) && (c >= 0x21) && (c <= 0x7e)) {
/* JIS */
- default_kanji = UJIS;
- return KTYPE_7JIS;
+ return 0x20;
}
- if ((mode == KTYPE_JKANA) && (c >= 0x21) && (c <= 0x5f)) {
+ if ((mode == 0x10) && (c >= 0x21) && (c <= 0x5f)) {
/* JIS HANKAKU */
- default_kanji = UJIS;
- return KTYPE_JKANA;
+ return 0x10;
}
-#if 1
- if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == UJIS)) {
- /* UJIS */
- return KTYPE_UJIS;
- }
-#endif
-
if ((c >= 0x81) && (c <= 0x9f) && (c != 0x8e)) {
/* SJIS */
default_kanji = SJIS;
- return KTYPE_SJIS;
+ return 2;
}
if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == SJIS)) {
- /* SJIS HANKAKU */
- return KTYPE_KANA;
+ /* Sjis HANKAKU */
+ return 1;
}
-#if 0
if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == UJIS)) {
/* UJIS */
- return KTYPE_UJIS;
+ return 4;
}
-#endif
if ((c >= 0xf0) && (c <= 0xfe)) {
/* UJIS */
default_kanji = UJIS;
- return KTYPE_UJIS;
+ return 4;
}
if ((c >= 0xe0) && (c <= 0xef)) {
/* SJIS or UJIS */
- return KTYPE_SUJIS;
+ return 6;
}
if (c == 0x8e) {
/* SJIS or UJIS HANKAKU */
- return KTYPE_SUKANA;
+ return 3;
}
- return KTYPE_ASCII;
+ return 0;
}
static u_char iskanji2(u_char mode, u_char c)
{
switch (mode) {
- case KTYPE_7JIS:
+ case 0x20:
if ((c >= 0x21) && (c <= 0x7e)) {
/* JIS */
- return KTYPE_7JIS;
+ return 0x20;
}
break;
- case KTYPE_SJIS:
+ case 2:
if ((c >= 0x40) && (c <= 0xfc) && (c != 0x7f)) {
/* SJIS */
- return KTYPE_SJIS;
+ return 2;
}
break;
- case KTYPE_UJIS:
+ case 4:
if ((c >= 0xa1) && (c <= 0xfe)) {
/* UJIS */
- return KTYPE_UJIS;
+ return 4;
}
break;
- case KTYPE_SUKANA:
+ case 3:
if ((c >= 0xa1) && (c <= 0xdf) && (default_kanji == UJIS)) {
/* UJIS HANKAKU */
- return KTYPE_KANA;
+ return 1;
}
if ((c >= 0x40) && (c <= 0xfc) && (c != 0x7f)) {
/* SJIS */
default_kanji = SJIS;
- return KTYPE_SJIS;
+ return 2;
}
break;
- case KTYPE_SUJIS:
+ case 6:
if ((c >= 0x40) && (c <= 0xa0) && (c != 0x7f)) {
/* SJIS */
default_kanji = SJIS;
- return KTYPE_SJIS;
+ return 2;
}
if ((c == 0xfd) || (c == 0xfe)) {
/* UJIS */
default_kanji = UJIS;
- return KTYPE_UJIS;
+ return 4;
}
if ((c >= 0xa1) && (c <= 0xfc)) {
if (default_kanji == SJIS)
- return KTYPE_SJIS;
+ return 2;
if (default_kanji == UJIS)
- return KTYPE_UJIS;
+ return 4;
}
break;
}
- return KTYPE_ASCII;
+ return 0;
}
/*
@@ -3467,7 +3889,7 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
low = (u_short) l;
switch (mode) {
- case KTYPE_SJIS: /* SHIFT JIS */
+ case 2: /* SHIFT JIS */
if (low >= 0xe0) {
low -= 0x40;
}
@@ -3475,7 +3897,7 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
if (high > 0x7f) {
high--;
}
- if (high > 0x9d) {
+ if (high >0x9d) {
low++;
high -= 0x9e - 0x21;
} else {
@@ -3485,8 +3907,8 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
low &= 0x7F;
tmp = ((high << 8) | low) - 0x20;
break;
- case KTYPE_7JIS: /* JIS */
- case KTYPE_UJIS: /* UJIS */
+ case 0x20: /* JIS */
+ case 4: /* HANKAKU? */
high &= 0x7F;
low &= 0x7F;
tmp = ((high << 8) | low) - 0x20;
@@ -3498,7 +3920,6 @@ static u_short kanji_convert(u_char mode, u_char h, u_char l)
/* keisen */
c = ((tmp & 0xff) << 8) | (tmp >> 8);
- /* 0x2821 .. 0x2840 */
if (0x0821 <= c && c <= 0x0840)
tmp = keiConv[c - 0x0821];
@@ -3525,9 +3946,7 @@ outloop:
len--;
}
else if (PRINTABLE(*ptr)) { /* Print only printables */
-#ifndef PC98
int cnt = len <= (scp->xsize-scp->xpos) ? len : (scp->xsize-scp->xpos);
-#endif
u_short cur_attr = scp->term.cur_attr;
u_short *cursor_pos = scp->cursor_pos;
#ifdef PC98
@@ -3536,7 +3955,7 @@ outloop:
#ifdef KANJI
if (scp->kanji_1st_char == 0) {
scp->kanji_type = iskanji1(scp->kanji_type, c);
- if (!IS_KTYPE_ASCII_or_HANKAKU(scp->kanji_type)) {
+ if (scp->kanji_type & 0xee) {
/* not Ascii & not HANKAKU */
scp->kanji_1st_char = c;
ptr++; len--;
@@ -3549,8 +3968,7 @@ outloop:
/* print kanji on TEXT VRAM */
kanji_code = kanji_convert(scp->kanji_type, c, scp->kanji_1st_char);
for (i=0; i<2; i++){
- /* *cursor_pos = (kanji_code | (i*0x80)); */
- *cursor_pos = kanji_code | ((i==0) ? 0x00 : 0x80);
+ *cursor_pos = (kanji_code | (i*0x80));
*cursor_atr = (at2pc98(cur_attr));
cursor_pos++;
cursor_atr++;
@@ -3559,7 +3977,7 @@ outloop:
scp->ypos++;
}
}
- KTYPE_MASK_CTRL(scp->kanji_type);
+ scp->kanji_type &= 0xF0;
scp->kanji_1st_char = 0;
ptr++; len--;
goto kanji_end;
@@ -3567,9 +3985,8 @@ outloop:
scp->kanji_1st_char = 0;
}
}
- if (IS_KTYPE_KANA(scp->kanji_type))
- c |= 0x80;
- KTYPE_MASK_CTRL(scp->kanji_type);
+ if ((scp->kanji_type & 0x11)) c |= 0x80;
+ scp->kanji_type &= 0xf0;
#endif /* KANJI */
*cursor_pos++ = (scr_map[c]);
*cursor_atr++ = at2pc98(cur_attr);
@@ -3675,7 +4092,7 @@ kanji_end:
break;
case 0x0c: /* form feed, clears screen */
- sc_clear_screen(scp);
+ clear_screen(scp);
break;
case 0x0d: /* return, return to pos 0 */
@@ -3694,20 +4111,6 @@ kanji_end:
scp->xpos = 0;
break;
-#ifdef PC98
- case 0x0e: /* ^N */
- scp->kanji_type = KTYPE_JKANA;
- scp->term.esc = 0;
- scp->kanji_1st_char = 0;
- break;
-
- case 0x0f: /* ^O */
- scp->kanji_type = KTYPE_ASCII;
- scp->term.esc = 0;
- scp->kanji_1st_char = 0;
- break;
-#endif
-
case 0x1b: /* start escape sequence */
scp->term.esc = 1;
scp->term.num_param = 0;
@@ -3718,7 +4121,7 @@ kanji_end:
/* do we have to scroll ?? */
if (scp->cursor_pos >= scp->scr_buf + scp->ysize * scp->xsize) {
remove_cutmarking(scp);
- if (scp->history != NULL) {
+ if (scp->history) {
bcopy(scp->scr_buf, scp->history_head,
scp->xsize * sizeof(u_short));
scp->history_head += scp->xsize;
@@ -3734,8 +4137,7 @@ kanji_end:
#endif
scp->history_head = scp->history;
#ifdef PC98
- scp->his_atr_head = scp->his_atr;
- }
+ scp->his_atr_head = scp->his_atr; }
#endif
}
bcopy(scp->scr_buf + scp->xsize, scp->scr_buf,
@@ -3772,30 +4174,66 @@ kanji_end:
static void
scinit(void)
{
- video_adapter_t *adp;
- int col;
- int row;
+ u_int hw_cursor;
u_int i;
if (init_done != COLD)
return;
init_done = WARM;
- get_bios_values();
-
#ifdef PC98
- if (pc98_machine_type & M_8M)
- BELL_PITCH = 1339;
- else
- BELL_PITCH = 1678;
-#endif
+ if (pc98_machine_type & M_8M) {
+ BELL_PITCH = 1339;
+ } else {
+ BELL_PITCH = 1678;
+ }
+ outb(0x62, 0xd);
+ outb(0xA2, 0xd);
+ /* Extract cursor location */
+ while((inb(TEXT_GDC + 0) & 0x04) == 0) {} /* GDC wait */
+ outb(TEXT_GDC + 2, 0xe0); /* CSRR */
+ while((inb(TEXT_GDC + 0) & 0x1) == 0) {} /* GDC wait */
+ hw_cursor = inb(TEXT_GDC + 2); /* EADl */
+ hw_cursor |= (inb(TEXT_GDC + 2) << 8); /* EADh */
+ inb(TEXT_GDC + 2); /* dummy */
+ inb(TEXT_GDC + 2); /* dummy */
+ inb(TEXT_GDC + 2); /* dummy */
+
+ if (hw_cursor >= ROW*COL) {
+ hw_cursor = 0;
+ }
+ crtc_vga = TRUE;
+#else /* IBM-PC */
+ /*
+ * Ensure a zero start address. This is mainly to recover after
+ * switching from pcvt using userconfig(). The registers are w/o
+ * for old hardware so it's too hard to relocate the active screen
+ * memory.
+ */
+ outb(crtc_addr, 12);
+ outb(crtc_addr + 1, 0);
+ outb(crtc_addr, 13);
+ outb(crtc_addr + 1, 0);
- /* extract the hardware cursor location and hide the cursor for now */
- adp = vid_get_adapter(adapter);
- (*vidsw[adapter]->read_hw_cursor)(adp, &col, &row);
-#ifndef PC98
- (*vidsw[adapter]->set_hw_cursor)(adp, -1, -1);
-#endif
+ /* extract cursor location */
+ outb(crtc_addr, 14);
+ hw_cursor = inb(crtc_addr + 1) << 8;
+ outb(crtc_addr, 15);
+ hw_cursor |= inb(crtc_addr + 1);
+
+ /*
+ * Validate cursor location. It may be off the screen. Then we must
+ * not use it for the initial buffer offset.
+ */
+ if (hw_cursor >= ROW * COL)
+ hw_cursor = (ROW - 1) * COL;
+
+ /* move hardware cursor out of the way */
+ outb(crtc_addr, 14);
+ outb(crtc_addr + 1, 0xff);
+ outb(crtc_addr, 15);
+ outb(crtc_addr + 1, 0xff);
+#endif /* PC98 */
/* set up the first console */
current_default = &user_default;
@@ -3803,27 +4241,57 @@ scinit(void)
init_scp(console[0]);
cur_console = console[0];
+#ifndef PC98
+ /* discard the video mode table if we are not familiar with it... */
+ if (video_mode_ptr) {
+ bzero(mode_map, sizeof(mode_map));
+ bcopy(video_mode_ptr + MODE_PARAM_SIZE*console[0]->mode,
+ vgaregs2, sizeof(vgaregs2));
+ switch (comp_vgaregs(vgaregs, video_mode_ptr
+ + MODE_PARAM_SIZE*console[0]->mode)) {
+ case COMP_IDENTICAL:
+ map_mode_table(mode_map, video_mode_ptr, M_VGA_CG320 + 1);
+ /*
+ * This is a kludge for Toshiba DynaBook SS433 whose BIOS video
+ * mode table entry has the actual # of rows at the offset 1;
+ * BIOSes from other manufacturers store the # of rows - 1 there.
+ * XXX
+ */
+ rows_offset = vgaregs[1] + 1
+ - video_mode_ptr[MODE_PARAM_SIZE*console[0]->mode + 1];
+ break;
+ case COMP_SIMILAR:
+ map_mode_table(mode_map, video_mode_ptr, M_VGA_CG320 + 1);
+ mode_map[console[0]->mode] = vgaregs;
+ rows_offset = vgaregs[1] + 1
+ - video_mode_ptr[MODE_PARAM_SIZE*console[0]->mode + 1];
+ vgaregs[1] -= rows_offset - 1;
+ break;
+ case COMP_DIFFERENT:
+ default:
+ video_mode_ptr = NULL;
+ mode_map[console[0]->mode] = vgaregs;
+ rows_offset = 1;
+ break;
+ }
+ }
+#endif
/* copy screen to temporary buffer */
- if (ISTEXTSC(console[0]))
- generic_bcopy((ushort *)(console[0]->adp->va_window), sc_buffer,
- console[0]->xsize * console[0]->ysize * sizeof(u_short));
+ if (!VESA_MODE(console[0]->mode))
+ generic_bcopy(Crtat, sc_buffer,
+ console[0]->xsize * console[0]->ysize * sizeof(u_short));
console[0]->scr_buf = console[0]->mouse_pos = console[0]->mouse_oldpos
= sc_buffer;
- if (col >= console[0]->xsize)
- col = 0;
- if (row >= console[0]->ysize)
- row = console[0]->ysize - 1;
- console[0]->xpos = col;
- console[0]->ypos = row;
- console[0]->cursor_pos = console[0]->cursor_oldpos =
- sc_buffer + row*console[0]->xsize + col;
-#ifndef PC98
- console[0]->cursor_saveunder = *console[0]->cursor_pos;
-#else
+ console[0]->cursor_pos = console[0]->cursor_oldpos = sc_buffer + hw_cursor;
+#ifdef PC98
console[0]->atr_buf = Atrat;
- console[0]->cursor_atr = Atrat + row*console[0]->xsize + col;
+ console[0]->cursor_atr = Atrat + hw_cursor;
+#else
+ console[0]->cursor_saveunder = *console[0]->cursor_pos;
#endif
+ console[0]->xpos = hw_cursor % COL;
+ console[0]->ypos = hw_cursor / COL;
for (i=1; i<MAXCONS; i++)
console[i] = NULL;
kernel_console.esc = 0;
@@ -3838,141 +4306,93 @@ scinit(void)
scr_map[i] = scr_rmap[i] = i;
}
#ifdef PC98
- scr_map[0x5c] = (u_char)0xfc; /* for backslash */
+ scr_map[0x5c] = (u_char)0xfc; /* for backslash */
#endif
- /* Save font and palette */
- if (ISFONTAVAIL(cur_console->adp->va_flags)) {
- if (fonts_loaded & FONT_16) {
- copy_font(cur_console, LOAD, 16, font_16);
- } else {
- copy_font(cur_console, SAVE, 16, font_16);
- fonts_loaded = FONT_16;
- set_destructive_cursor(cur_console);
+#ifndef PC98
+ /* Save font and palette if VGA */
+ if (crtc_type == KD_VGA) {
+ if (!VESA_MODE(bios_video_mode)) {
+ if (fonts_loaded & FONT_16) {
+ copy_font(LOAD, FONT_16, font_16);
+ } else {
+ copy_font(SAVE, FONT_16, font_16);
+ fonts_loaded = FONT_16;
+ }
+ set_destructive_cursor(console[0]);
}
- /*
- * FONT KLUDGE
- * Always use the font page #0. XXX
- */
- (*vidsw[cur_console->ad]->show_font)(cur_console->adp, 0);
+ save_palette();
}
- save_palette(cur_console->adp, palette);
-#if NSPLASH > 0
- /* we are ready to put up the splash image! */
- splash_init(cur_console->adp, scsplash_callback);
+#ifdef SC_SPLASH_SCREEN
+ /*
+ * If not booting verbosely, put up the splash.
+ * Note that the splash screen is not currently supported in
+ * the VESA mode.
+ */
+ if (!(boothowto & RB_VERBOSE) && !VESA_MODE(bios_video_mode))
+ scsplash_init();
+#endif
#endif
}
static void
scshutdown(int howto, void *arg)
{
- sc_touch_scrn_saver();
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
if (!cold && cur_console->smode.mode == VT_AUTO
&& console[0]->smode.mode == VT_AUTO)
switch_scr(cur_console, 0);
shutdown_in_progress = TRUE;
}
-int
-sc_clean_up(scr_stat *scp)
+static void
+map_mode_table(char *map[], char *table, int max)
{
- int error;
+ int i;
- sc_touch_scrn_saver();
-#if NSPLASH > 0
- if ((error = wait_scrn_saver_stop()))
- return error;
-#endif /* NSPLASH */
- scp->status &= ~MOUSE_VISIBLE;
- remove_cutmarking(scp);
- return 0;
+ for(i = 0; i < max; ++i)
+ map[i] = table + i*MODE_PARAM_SIZE;
+ for(; i < MODE_MAP_SIZE; ++i)
+ map[i] = NULL;
}
-void
-sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear)
+static int
+map_mode_num(int mode)
{
- if (scp->scr_buf)
- free(scp->scr_buf, M_DEVBUF);
- scp->scr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
-#ifdef PC98
- if (scp->atr_buf)
- free(scp->atr_buf, M_DEVBUF);
- scp->atr_buf = (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
-#endif
+ static struct {
+ int from;
+ int to;
+ } mode_map[] = {
+ { M_ENH_B80x43, M_ENH_B80x25 },
+ { M_ENH_C80x43, M_ENH_C80x25 },
+ { M_VGA_M80x30, M_VGA_M80x25 },
+ { M_VGA_C80x30, M_VGA_C80x25 },
+ { M_VGA_M80x50, M_VGA_M80x25 },
+ { M_VGA_C80x50, M_VGA_C80x25 },
+ { M_VGA_M80x60, M_VGA_M80x25 },
+ { M_VGA_C80x60, M_VGA_C80x25 },
+ { M_VGA_MODEX, M_VGA_CG320 },
+ };
+ int i;
- if (clear) {
- /* clear the screen and move the text cursor to the top-left position */
- sc_clear_screen(scp);
- } else {
- /* retain the current cursor position, but adjust pointers */
- move_crsr(scp, scp->xpos, scp->ypos);
- scp->cursor_oldpos = scp->cursor_pos;
+ for (i = 0; i < sizeof(mode_map)/sizeof(mode_map[0]); ++i) {
+ if (mode_map[i].from == mode)
+ return mode_map[i].to;
}
-
- /* move the mouse cursor at the center of the screen */
- sc_move_mouse(scp, scp->xpixel / 2, scp->ypixel / 2);
+ return mode;
}
-void
-sc_alloc_cut_buffer(scr_stat *scp, int wait)
+static char
+*get_mode_param(scr_stat *scp, int mode)
{
- if ((cut_buffer == NULL)
- || (cut_buffer_size < scp->xsize * scp->ysize + 1)) {
- if (cut_buffer != NULL)
- free(cut_buffer, M_DEVBUF);
- cut_buffer_size = scp->xsize * scp->ysize + 1;
- cut_buffer = (u_char *)malloc(cut_buffer_size,
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (cut_buffer != NULL)
- cut_buffer[0] = '\0';
- }
-}
-
-void
-sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait)
-{
- u_short *usp;
-#ifdef PC98
- u_short *atr_usp;
-#endif
-
- if (lines < scp->ysize)
- lines = scp->ysize;
-
- usp = scp->history;
- scp->history = NULL;
- if (usp != NULL) {
- free(usp, M_DEVBUF);
- if (extra > 0)
- extra_history_size += extra;
- }
-#ifdef PC98
- atr_usp = scp->his_atr;
- scp->his_atr = NULL;
- if (atr_usp != NULL)
- free(atr_usp, M_DEVBUF);
-#endif
-
- scp->history_size = lines * scp->xsize;
- if (lines > imax(sc_history_size, scp->ysize))
- extra_history_size -= lines - imax(sc_history_size, scp->ysize);
- usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (usp != NULL)
- bzero(usp, scp->history_size * sizeof(u_short));
- scp->history_head = scp->history_pos = usp;
- scp->history = usp;
-#ifdef PC98
- atr_usp = (u_short *)malloc(scp->history_size * sizeof(u_short),
- M_DEVBUF, (wait) ? M_WAITOK : M_NOWAIT);
- if (atr_usp != NULL)
- bzero(atr_usp, scp->history_size * sizeof(u_short));
- scp->his_atr_head = scp->his_atr_pos = atr_usp;
- scp->his_atr = atr_usp;
-#endif
+ if (mode >= MODE_MAP_SIZE)
+ mode = map_mode_num(mode);
+ if (mode < MODE_MAP_SIZE)
+ return mode_map[mode];
+ else
+ return NULL;
}
static scr_stat
@@ -3982,21 +4402,34 @@ static scr_stat
scp = (scr_stat *)malloc(sizeof(scr_stat), M_DEVBUF, M_WAITOK);
init_scp(scp);
- sc_alloc_scr_buffer(scp, TRUE, TRUE);
+ scp->scr_buf = scp->cursor_pos = scp->cursor_oldpos =
+ (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ scp->mouse_pos = scp->mouse_oldpos =
+ scp->scr_buf + ((scp->mouse_ypos/scp->font_size)*scp->xsize +
+ scp->mouse_xpos/8);
+ scp->history_head = scp->history_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(scp->history_head, scp->history_size*sizeof(u_short));
+ scp->history = scp->history_head;
#ifdef PC98
- sc_alloc_cut_buffer(scp, TRUE);
-#else /* PC98 */
- if (ISMOUSEAVAIL(scp->adp->va_flags))
- sc_alloc_cut_buffer(scp, TRUE);
-#endif /* PC98 */
- sc_alloc_history_buffer(scp, sc_history_size, 0, TRUE);
+ scp->atr_buf = scp->cursor_atr = scp->atr_buf =
+ (u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ scp->his_atr_head = scp->his_atr_pos =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(scp->his_atr_head, scp->history_size*sizeof(u_short));
+ scp->his_atr = scp->his_atr_head;
+#endif
/* SOS
#ifndef PC98
- if (scp->adp->va_flags & V_ADP_MODECHANGE)
+ if (crtc_type == KD_VGA && video_mode_ptr)
#endif
set_mode(scp);
*/
- sc_clear_screen(scp);
+ clear_screen(scp);
#ifndef PC98
scp->cursor_saveunder = *scp->cursor_pos;
#endif
@@ -4006,30 +4439,47 @@ static scr_stat
static void
init_scp(scr_stat *scp)
{
- video_info_t info;
-
- scp->ad = adapter;
- scp->adp = vid_get_adapter(scp->ad);
- (*vidsw[scp->ad]->get_info)(scp->adp, initial_video_mode, &info);
-
- scp->status = 0;
- scp->mode = initial_video_mode;
- scp->scr_buf = NULL;
- if (info.vi_flags & V_INFO_GRAPHICS) {
- scp->status |= GRAPHICS_MODE;
- scp->xpixel = info.vi_width;
- scp->ypixel = info.vi_height;
- scp->xsize = info.vi_width/8;
- scp->ysize = info.vi_height/info.vi_cheight;
- scp->font_size = FONT_NONE;
- } else {
- scp->xsize = info.vi_width;
- scp->ysize = info.vi_height;
- scp->xpixel = scp->xsize*8;
- scp->ypixel = scp->ysize*info.vi_cheight;
- scp->font_size = info.vi_cheight;
+#ifdef PC98
+ scp->mode = M_PC98_80x25;
+ scp->font_size = 16;
+#else
+ switch(crtc_type) {
+ case KD_VGA:
+ if (VESA_MODE(bios_video_mode))
+ scp->mode = bios_video_mode;
+ else if (crtc_addr == MONO_BASE)
+ scp->mode = M_VGA_M80x25;
+ else
+ scp->mode = M_VGA_C80x25;
+ else
+ scp->font_size = 16;
+ break;
+ case KD_CGA:
+ if (crtc_addr == MONO_BASE)
+ scp->mode = M_B80x25;
+ else
+ scp->mode = M_C80x25;
+ scp->font_size = 8;
+ break;
+ case KD_EGA:
+ scp->mode = M_B80x25;
+ else
+ scp->mode = M_C80x25;
+ scp->font_size = 14;
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+ default:
+ scp->mode = M_EGAMONO80x25;
+ scp->font_size = 14;
+ break;
}
- scp->xoff = scp->yoff = 0;
+ scp->initial_mode = scp->mode;
+#endif
+ scp->xsize = COL;
+ scp->ysize = ROW;
+ scp->xpixel = scp->xsize * 8;
+ scp->ypixel = scp->ysize * scp->font_size;
scp->xpos = scp->ypos = 0;
scp->saved_xpos = scp->saved_ypos = -1;
scp->start = scp->xsize * scp->ysize;
@@ -4041,21 +4491,28 @@ init_scp(scr_stat *scp)
current_default->std_color;
scp->term.rev_color = current_default->rev_color;
scp->border = BG_BLACK;
- scp->cursor_start = bios_value.cursor_start;
- scp->cursor_end = bios_value.cursor_end;
+#ifdef PC98
+ scp->cursor_start = 0;
+ scp->cursor_end = 0;
+#else
+ scp->cursor_start = *(char *)pa_to_va(0x461);
+ scp->cursor_end = *(char *)pa_to_va(0x460);
+#endif
scp->mouse_xpos = scp->xsize*8/2;
scp->mouse_ypos = scp->ysize*scp->font_size/2;
scp->mouse_cut_start = scp->mouse_cut_end = NULL;
scp->mouse_signal = 0;
scp->mouse_pid = 0;
scp->mouse_proc = NULL;
- scp->kbd_mode = K_XLATE;
scp->bell_pitch = BELL_PITCH;
scp->bell_duration = BELL_DURATION;
-#ifndef PC98
- scp->status |= (bios_value.shift_state & 0x20) ? NLKED : 0;
-#endif
+#ifdef PC98
+ scp->status = 0;
scp->status |= CURSOR_ENABLED;
+#else
+ scp->status = (*(char *)pa_to_va(0x417) & 0x20) ? NLKED : 0;
+ scp->status |= CURSOR_ENABLED;
+#endif
scp->pid = 0;
scp->proc = NULL;
scp->smode.mode = VT_AUTO;
@@ -4063,25 +4520,25 @@ init_scp(scr_stat *scp)
#ifdef PC98
scp->his_atr_head = scp->his_atr_pos = scp->his_atr = NULL;
#endif
- scp->history_size = imax(sc_history_size, scp->ysize) * scp->xsize;
+ scp->history_size = imax(SC_HISTORY_SIZE, scp->ysize) * scp->xsize;
#ifdef KANJI
scp->kanji_1st_char = 0;
- scp->kanji_type = KTYPE_ASCII;
+ scp->kanji_type = 0;
#endif
}
-static void
-get_bios_values(void)
+static u_char
+*get_fstr(u_int c, u_int *len)
{
-#ifdef PC98
- bios_value.cursor_start = 0;
- bios_value.cursor_end = 0;
- bios_value.shift_state = 0;
-#else /* !PC98 */
- bios_value.cursor_start = *(u_int8_t *)pa_to_va(0x461);
- bios_value.cursor_end = *(u_int8_t *)pa_to_va(0x460);
- bios_value.shift_state = *(u_int8_t *)pa_to_va(0x417);
-#endif
+ u_int i;
+
+ if (!(c & FKEY))
+ return(NULL);
+ i = (c & 0xFF) - F_FN;
+ if (i > n_fkey_tab)
+ return(NULL);
+ *len = fkey_tab[i].len;
+ return(fkey_tab[i].str);
}
static void
@@ -4144,46 +4601,151 @@ history_down_line(scr_stat *scp)
* return NOKEY if there is nothing there.
*/
static u_int
-scgetc(keyboard_t *kbd, u_int flags)
+scgetc(u_int flags)
{
- u_int c;
- int this_scr;
- int f;
- int i;
-
- if (kbd == NULL)
- return NOKEY;
+ struct key_t *key;
+ u_char scancode, keycode;
+ u_int state, action;
+ int c;
+ static u_char esc_flag = 0, compose = 0;
+ static u_int chr = 0;
next_code:
- /* I don't like this, but... XXX */
- if (flags & SCGETC_CN)
- sccnupdate(cur_console);
/* first see if there is something in the keyboard port */
- for (;;) {
- c = kbd_read_char(kbd, !(flags & SCGETC_NONBLOCK));
- if (c == ERRKEY) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
- } else if (c == NOKEY)
- return c;
- else
- break;
+ if (flags & SCGETC_NONBLOCK) {
+ c = read_kbd_data_no_wait(sc_kbdc);
+ if (c == -1)
+ return(NOKEY);
+ } else {
+ do {
+ c = read_kbd_data(sc_kbdc);
+ } while(c == -1);
}
+ scancode = (u_char)c;
/* make screensaver happy */
- if (!(c & RELKEY))
- sc_touch_scrn_saver();
+ if (!(scancode & 0x80)) {
+ scsplash_stick(FALSE);
+ run_scrn_saver = FALSE;
+ }
- if (!(flags & SCGETC_CN))
+ if (!(flags & SCGETC_CN)) {
/* do the /dev/random device a favour */
- add_keyboard_randomness(c);
+ add_keyboard_randomness(scancode);
+
+ if (cur_console->status & KBD_RAW_MODE)
+ return scancode;
+ }
+
+ keycode = scancode & 0x7F;
+ switch (esc_flag) {
+ case 0x00: /* normal scancode */
+ switch(scancode) {
+ case 0xB8: /* left alt (compose key) */
+ if (compose) {
+ compose = 0;
+ if (chr > 255) {
+ do_bell(cur_console,
+ BELL_PITCH, BELL_DURATION);
+ chr = 0;
+ }
+ }
+ break;
+ case 0x38:
+ if (!compose) {
+ compose = 1;
+ chr = 0;
+ }
+ break;
+ case 0xE0:
+ case 0xE1:
+ esc_flag = scancode;
+ goto next_code;
+ }
+ break;
+ case 0xE0: /* 0xE0 prefix */
+ esc_flag = 0;
+ switch (keycode) {
+ case 0x1C: /* right enter key */
+ keycode = 0x59;
+ break;
+ case 0x1D: /* right ctrl key */
+ keycode = 0x5A;
+ break;
+ case 0x35: /* keypad divide key */
+ keycode = 0x5B;
+ break;
+ case 0x37: /* print scrn key */
+ keycode = 0x5C;
+ break;
+ case 0x38: /* right alt key (alt gr) */
+ keycode = 0x5D;
+ break;
+ case 0x47: /* grey home key */
+ keycode = 0x5E;
+ break;
+ case 0x48: /* grey up arrow key */
+ keycode = 0x5F;
+ break;
+ case 0x49: /* grey page up key */
+ keycode = 0x60;
+ break;
+ case 0x4B: /* grey left arrow key */
+ keycode = 0x61;
+ break;
+ case 0x4D: /* grey right arrow key */
+ keycode = 0x62;
+ break;
+ case 0x4F: /* grey end key */
+ keycode = 0x63;
+ break;
+ case 0x50: /* grey down arrow key */
+ keycode = 0x64;
+ break;
+ case 0x51: /* grey page down key */
+ keycode = 0x65;
+ break;
+ case 0x52: /* grey insert key */
+ keycode = 0x66;
+ break;
+ case 0x53: /* grey delete key */
+ keycode = 0x67;
+ break;
- if (cur_console->kbd_mode != K_XLATE)
- return KEYCHAR(c);
+ /* the following 3 are only used on the MS "Natural" keyboard */
+ case 0x5b: /* left Window key */
+ keycode = 0x69;
+ break;
+ case 0x5c: /* right Window key */
+ keycode = 0x6a;
+ break;
+ case 0x5d: /* menu key */
+ keycode = 0x6b;
+ break;
+ default: /* ignore everything else */
+ goto next_code;
+ }
+ break;
+ case 0xE1: /* 0xE1 prefix */
+ esc_flag = 0;
+ if (keycode == 0x1D)
+ esc_flag = 0x1D;
+ goto next_code;
+ /* NOT REACHED */
+ case 0x1D: /* pause / break */
+ esc_flag = 0;
+ if (keycode != 0x45)
+ goto next_code;
+ keycode = 0x68;
+ break;
+ }
+
+ if (!(flags & SCGETC_CN) && (cur_console->status & KBD_CODE_MODE))
+ return (keycode | (scancode & 0x80));
/* if scroll-lock pressed allow history browsing */
- if (!ISGRAPHSC(cur_console) && cur_console->history
- && cur_console->status & SLKED) {
+ if (cur_console->history && cur_console->status & SLKED) {
+ int i;
cur_console->status &= ~CURSOR_ENABLED;
if (!(cur_console->status & BUFFER_SAVED)) {
@@ -4209,11 +4771,10 @@ next_code:
cur_console->history + cur_console->history_size)
#ifdef PC98
{
+#endif
cur_console->history_head=cur_console->history;
- cur_console->his_atr_head=cur_console->his_atr;
- }
-#else
- cur_console->history_head=cur_console->history;
+#ifdef PC98
+ cur_console->his_atr_head=cur_console->his_atr; }
#endif
}
cur_console->history_pos = cur_console->history_head;
@@ -4222,10 +4783,12 @@ next_code:
#endif
history_to_screen(cur_console);
}
- switch (c) {
- /* FIXME: key codes */
- case SPCLKEY | FKEY | F(49): /* home key */
- remove_cutmarking(cur_console);
+ switch (scancode) {
+#ifdef PC98
+ case 0x3E: /* home key */
+#else
+ case 0x47: /* home key */
+#endif
cur_console->history_pos = cur_console->history_head;
#ifdef PC98
cur_console->his_atr_pos = cur_console->his_atr_head;
@@ -4233,8 +4796,11 @@ next_code:
history_to_screen(cur_console);
goto next_code;
- case SPCLKEY | FKEY | F(57): /* end key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x3F: /* help key */
+#else
+ case 0x4F: /* end key */
+#endif
cur_console->history_pos =
WRAPHIST(cur_console, cur_console->history_head,
cur_console->xsize*cur_console->ysize);
@@ -4246,65 +4812,183 @@ next_code:
history_to_screen(cur_console);
goto next_code;
- case SPCLKEY | FKEY | F(50): /* up arrow key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x3A: /* up arrow key */
+#else
+ case 0x48: /* up arrow key */
+#endif
if (history_up_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
goto next_code;
- case SPCLKEY | FKEY | F(58): /* down arrow key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x3D: /* down arrow key */
+#else
+ case 0x50: /* down arrow key */
+#endif
if (history_down_line(cur_console))
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
goto next_code;
- case SPCLKEY | FKEY | F(51): /* page up key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x36: /* roll up key */
+#else
+ case 0x49: /* page up key */
+#endif
for (i=0; i<cur_console->ysize; i++)
if (history_up_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
break;
}
goto next_code;
- case SPCLKEY | FKEY | F(59): /* page down key */
- remove_cutmarking(cur_console);
+#ifdef PC98
+ case 0x37: /* roll down key */
+#else
+ case 0x51: /* page down key */
+#endif
for (i=0; i<cur_console->ysize; i++)
if (history_down_line(cur_console)) {
- if (!(flags & SCGETC_CN))
- do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
break;
}
goto next_code;
}
}
- /*
- * Process and consume special keys here. Return a plain char code
- * or a char code with the META flag or a function key code.
- */
- if (c & RELKEY) {
- /* key released */
- /* goto next_code */
+ if (compose) {
+ switch (scancode) {
+ /* key pressed process it */
+ case 0x47: case 0x48: case 0x49: /* keypad 7,8,9 */
+ chr = (scancode - 0x40) + chr*10;
+ goto next_code;
+ case 0x4B: case 0x4C: case 0x4D: /* keypad 4,5,6 */
+ chr = (scancode - 0x47) + chr*10;
+ goto next_code;
+ case 0x4F: case 0x50: case 0x51: /* keypad 1,2,3 */
+ chr = (scancode - 0x4E) + chr*10;
+ goto next_code;
+ case 0x52: /* keypad 0 */
+ chr *= 10;
+ goto next_code;
+
+ /* key release, no interest here */
+ case 0xC7: case 0xC8: case 0xC9: /* keypad 7,8,9 */
+ case 0xCB: case 0xCC: case 0xCD: /* keypad 4,5,6 */
+ case 0xCF: case 0xD0: case 0xD1: /* keypad 1,2,3 */
+ case 0xD2: /* keypad 0 */
+ goto next_code;
+
+ case 0x38: /* left alt key */
+ break;
+ default:
+ if (chr) {
+ compose = chr = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ break;
+ }
+ }
+
+ state = (shfts ? 1 : 0 ) | (2 * (ctls ? 1 : 0)) | (4 * (alts ? 1 : 0));
+ if ((!agrs && (cur_console->status & ALKED))
+ || (agrs && !(cur_console->status & ALKED)))
+ keycode += ALTGR_OFFSET;
+ key = &key_map.key[keycode];
+ if ( ((key->flgs & FLAG_LOCK_C) && (cur_console->status & CLKED))
+ || ((key->flgs & FLAG_LOCK_N) && (cur_console->status & NLKED)) )
+ state ^= 1;
+
+ /* Check for make/break */
+ action = key->map[state];
+ if (scancode & 0x80) { /* key released */
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
+ case LSH:
+ shfts &= ~1;
+ break;
+ case RSH:
+ shfts &= ~2;
+ break;
+ case LCTR:
+ ctls &= ~1;
+ break;
+ case RCTR:
+ ctls &= ~2;
+ break;
+ case LALT:
+ alts &= ~1;
+ break;
+ case RALT:
+ alts &= ~2;
+ break;
+ case NLK:
+ nlkcnt = 0;
+ break;
+ case CLK:
+#ifdef PC98
+ cur_console->status &= ~CLKED;
+ update_leds(cur_console->status);
+#else
+ clkcnt = 0;
+#endif
+ break;
+ case SLK:
+ slkcnt = 0;
+ break;
+ case ASH:
+ agrs = 0;
+ break;
+ case ALK:
+ alkcnt = 0;
+ break;
+ case META:
+ metas = 0;
+ break;
+ }
+ }
+ if (chr && !compose) {
+ action = chr;
+ chr = 0;
+ return(action);
+ }
} else {
/* key pressed */
- if (c & SPCLKEY) {
- c &= ~SPCLKEY;
- switch (KEYCHAR(c)) {
+ if (key->spcl & (0x80>>state)) {
+ switch (action) {
/* LOCKING KEYS */
- case NLK: case CLK: case ALK:
+ case NLK:
+ if (!nlkcnt) {
+ nlkcnt++;
+ if (cur_console->status & NLKED)
+ cur_console->status &= ~NLKED;
+ else
+ cur_console->status |= NLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case CLK:
+#ifdef PC98
+ cur_console->status |= CLKED;
+ update_leds(cur_console->status);
+#else
+ if (!clkcnt) {
+ clkcnt++;
+ if (cur_console->status & CLKED)
+ cur_console->status &= ~CLKED;
+ else
+ cur_console->status |= CLKED;
+ update_leds(cur_console->status);
+ }
+#endif
break;
case SLK:
- kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&f);
- if (f & SLKED) {
- cur_console->status |= SLKED;
- } else {
+ if (!slkcnt) {
+ slkcnt++;
if (cur_console->status & SLKED) {
cur_console->status &= ~SLKED;
- if (cur_console->status & BUFFER_SAVED) {
+ if (cur_console->status & BUFFER_SAVED){
int i;
u_short *ptr = cur_console->history_save;
#ifdef PC98
@@ -4328,12 +5012,11 @@ next_code:
cur_console->history +
cur_console->history_size)
#ifdef PC98
- {
- ptr = cur_console->history;
- ptr_a = cur_console->his_atr;
- }
-#else
+ {
+#endif
ptr = cur_console->history;
+#ifdef PC98
+ ptr_a = cur_console->his_atr; }
#endif
}
cur_console->status &= ~BUFFER_SAVED;
@@ -4346,64 +5029,73 @@ next_code:
}
scstart(VIRTUAL_TTY(get_scr_num()));
}
+ else
+ cur_console->status |= SLKED;
+ update_leds(cur_console->status);
+ }
+ break;
+ case ALK:
+ if (!alkcnt) {
+ alkcnt++;
+ if (cur_console->status & ALKED)
+ cur_console->status &= ~ALKED;
+ else
+ cur_console->status |= ALKED;
+ update_leds(cur_console->status);
}
break;
/* NON-LOCKING KEYS */
case NOP:
- case LSH: case RSH: case LCTR: case RCTR:
- case LALT: case RALT: case ASH: case META:
break;
-
- case BTAB:
- return c;
-
case SPSC:
/* force activatation/deactivation of the screen saver */
- if (!scrn_blanked) {
+ accents = 0;
+ if (scrn_blanked <= 0) {
run_scrn_saver = TRUE;
scrn_time_stamp -= scrn_blank_time;
}
-#if NSPLASH > 0
+#ifdef SC_SPLASH_SCREEN
if (cold) {
/*
* While devices are being probed, the screen saver need
* to be invoked explictly. XXX
*/
- if (scrn_blanked) {
+ if (scrn_blanked > 0) {
scsplash_stick(FALSE);
stop_scrn_saver(current_saver);
} else {
- if (!ISGRAPHSC(cur_console)) {
+ if ((cur_console->status & UNKNOWN_MODE) == 0) {
scsplash_stick(TRUE);
(*current_saver)(TRUE);
}
}
}
-#endif /* NSPLASH */
+#endif
break;
-
case RBT:
#ifndef SC_DISABLE_REBOOT
+ accents = 0;
shutdown_nice();
#endif
break;
-
-#if NAPM > 0
case SUSP:
+#if NAPM > 0
+ accents = 0;
apm_suspend(PMST_SUSPEND);
+#endif
break;
+
case STBY:
+#if NAPM > 0
+ accents = 0;
apm_suspend(PMST_STANDBY);
- break;
-#else
- case SUSP:
- case STBY:
- break;
#endif
+ break;
case DBG:
#ifdef DDB /* try to switch to console 0 */
+ accents = 0;
/*
* TRY to make sure the screen saver is stopped,
* and the screen is updated before switching to
@@ -4418,47 +5110,135 @@ next_code:
printf("No debugger in kernel\n");
#endif
break;
-
+ case LSH:
+ shfts |= 1;
+ break;
+ case RSH:
+ shfts |= 2;
+ break;
+ case LCTR:
+ ctls |= 1;
+ break;
+ case RCTR:
+ ctls |= 2;
+ break;
+ case LALT:
+ alts |= 1;
+ break;
+ case RALT:
+ alts |= 2;
+ break;
+ case ASH:
+ agrs = 1;
+ break;
+ case META:
+ metas = 1;
+ break;
case NEXT:
- this_scr = get_scr_num();
- for (i = this_scr + 1; i != this_scr; i = (i + 1)%MAXCONS) {
- struct tty *tp = VIRTUAL_TTY(i);
+ {
+ int next, this = get_scr_num();
+ accents = 0;
+ for (next = this+1; next != this; next = (next+1)%MAXCONS) {
+ struct tty *tp = VIRTUAL_TTY(next);
if (tp->t_state & TS_ISOPEN) {
- switch_scr(cur_console, i);
+ switch_scr(cur_console, next);
break;
}
}
+ }
break;
-
+ case BTAB:
+ accents = 0;
+ return(BKEY);
default:
- if (KEYCHAR(c) >= F_SCR && KEYCHAR(c) <= L_SCR) {
- switch_scr(cur_console, KEYCHAR(c) - F_SCR);
+ if (action >= F_ACC && action <= L_ACC) {
+ /* turn it into an index */
+ action -= F_ACC - 1;
+ if ((action > accent_map.n_accs)
+ || (accent_map.acc[action - 1].accchar == 0)) {
+ /*
+ * The index is out of range or pointing to an
+ * empty entry.
+ */
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ /*
+ * If the same accent key has been hit twice,
+ * produce the accent char itself.
+ */
+ if (action == accents) {
+ action = accent_map.acc[accents - 1].accchar;
+ accents = 0;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ /* remember the index and wait for the next key stroke */
+ accents = action;
break;
}
- /* assert(c & FKEY) */
- return c;
+ if (accents > 0) {
+ accents = 0;
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ }
+ if (action >= F_SCR && action <= L_SCR) {
+ switch_scr(cur_console, action - F_SCR);
+ break;
+ }
+ if (action >= F_FN && action <= L_FN)
+ action |= FKEY;
+ return(action);
}
- /* goto next_code */
- } else {
- /* regular keys (maybe MKEY is set) */
- return c;
}
- }
+ else {
+ if (accents) {
+ struct acc_t *acc;
+ int i;
+ acc = &accent_map.acc[accents - 1];
+ accents = 0;
+ /*
+ * If the accent key is followed by the space key,
+ * produce the accent char itself.
+ */
+ if (action == ' ') {
+ action = acc->accchar;
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ for (i = 0; i < NUM_ACCENTCHARS; ++i) {
+ if (acc->map[i][0] == 0) /* end of the map entry */
+ break;
+ if (acc->map[i][0] == action) {
+ action = acc->map[i][1];
+ if (metas)
+ action |= MKEY;
+ return (action);
+ }
+ }
+ do_bell(cur_console, BELL_PITCH, BELL_DURATION);
+ goto next_code;
+ }
+ if (metas)
+ action |= MKEY;
+ return(action);
+ }
+ }
goto next_code;
}
int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
+scmmap(dev_t dev, int offset, int nprot)
{
- struct tty *tp;
- struct scr_stat *scp;
-
- tp = scdevtotty(dev);
- if (!tp)
- return ENXIO;
- scp = sc_get_scr_stat(tp->t_dev);
- return (*vidsw[scp->ad]->mmap)(scp->adp, offset);
+#ifdef PC98
+ if (offset > 0x48000 - PAGE_SIZE)
+#else
+ if (offset > 0x20000 - PAGE_SIZE)
+#endif
+ return -1;
+ return i386_btop((VIDEOMEM + offset));
}
/*
@@ -4490,213 +5270,585 @@ mask2attr(struct term_stat *term)
return attr;
}
-static int
-save_kbd_state(scr_stat *scp)
+static void
+set_keyboard(int command, int data)
{
- int state;
- int error;
+#ifndef PC98
+ int s;
+
+ if (sc_kbdc == NULL)
+ return;
+
+ /* prevent the timeout routine from polling the keyboard */
+ if (!kbdc_lock(sc_kbdc, TRUE))
+ return;
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error == 0) {
- scp->status &= ~LOCK_MASK;
- scp->status |= state;
+ /* disable the keyboard and mouse interrupt */
+ s = spltty();
+#if 0
+ c = get_controller_command_byte(sc_kbdc);
+ if ((c == -1)
+ || !set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
+ | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
+ /* CONTROLLER ERROR */
+ kbdc_lock(sc_kbdc, FALSE);
+ splx(s);
+ return;
}
- return error;
-}
+ /*
+ * Now that the keyboard controller is told not to generate
+ * the keyboard and mouse interrupts, call `splx()' to allow
+ * the other tty interrupts. The clock interrupt may also occur,
+ * but the timeout routine (`scrn_timer()') will be blocked
+ * by the lock flag set via `kbdc_lock()'
+ */
+ splx(s);
+#endif
-static int
-update_kbd_state(int new_bits, int mask)
-{
- int state;
- int error;
+ if (send_kbd_command_and_data(sc_kbdc, command, data) != KBD_ACK)
+ send_kbd_command(sc_kbdc, KBDC_ENABLE_KBD);
- if (mask != LOCK_MASK) {
- error = kbd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- if (error)
- return error;
- state &= ~mask;
- state |= new_bits & mask;
- } else {
- state = new_bits & LOCK_MASK;
+#if 0
+ /* restore the interrupts */
+ if (!set_controller_command_byte(sc_kbdc,
+ kbdc_get_device_mask(sc_kbdc),
+ c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
+ /* CONTROLLER ERROR */
}
- error = kbd_ioctl(kbd, KDSKBSTATE, (caddr_t)&state);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+#else
+ splx(s);
+#endif
+ kbdc_lock(sc_kbdc, FALSE);
+#endif
}
-static int
-update_kbd_leds(int which)
+static void
+update_leds(int which)
{
- int error;
+#ifndef PC98
+ int s;
+ static u_char xlate_leds[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
- which &= LOCK_MASK;
- error = kbd_ioctl(kbd, KDSETLED, (caddr_t)&which);
- if (error == ENOIOCTL)
- error = ENODEV;
- return error;
+ /* replace CAPS led with ALTGR led for ALTGR keyboards */
+ if (key_map.n_keys > ALTGR_OFFSET) {
+ if (which & ALKED)
+ which |= CLKED;
+ else
+ which &= ~CLKED;
+ }
+
+ set_keyboard(KBDC_SET_LEDS, xlate_leds[which & LED_MASK]);
+#endif
}
-int
+void
set_mode(scr_stat *scp)
{
- video_info_t info;
-
- /* reject unsupported mode */
- if ((*vidsw[scp->ad]->get_info)(scp->adp, scp->mode, &info))
- return 1;
+ char special_modetable[MODE_PARAM_SIZE];
+ char *mp;
+ int s;
+ int i;
- /* if this vty is not currently showing, do nothing */
if (scp != cur_console)
- return 0;
+ return;
- /* setup video hardware for the given mode */
- (*vidsw[scp->ad]->set_mode)(scp->adp, scp->mode);
- Crtat = (u_short *)scp->adp->va_window;
+#ifndef PC98
+ /*
+ * even if mode switching is disabled, we can change back
+ * to the initial mode or the custom mode based on the initial
+ * mode if we have saved register values upon start-up.
+ */
+ mp = get_mode_param(scp, scp->mode);
+ if (mp == NULL)
+ return;
+ bcopy(mp, &special_modetable, sizeof(special_modetable));
+#endif
+ /* setup video hardware for the given mode */
#ifdef PC98
- if (scp->status & UNKNOWN_MODE) {
- while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
- outb(0x62, 0xc); /* text off */
- outb(0xA2, 0xd); /* graphics on */
- } else {
- while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
- outb(0x62, 0xd); /* text off */
- outb(0xA2, 0xc); /* graphics on */
- }
+#ifdef LINE30
+ switch (scp->mode) {
+ case M_PC98_80x25: /* VGA TEXT MODES */
+ initialize_gdc(T25_G400);
+ break;
+ case M_PC98_80x30:
+ initialize_gdc(T30_G400);
+ break;
+ default:
+ break;
+ }
#endif
-
- if (!(scp->status & GRAPHICS_MODE)) {
- /* load appropriate font */
- if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->adp->va_flags)) {
- if (scp->font_size < 14) {
- if (fonts_loaded & FONT_8)
- copy_font(scp, LOAD, 8, font_8);
- } else if (scp->font_size >= 16) {
- if (fonts_loaded & FONT_16)
- copy_font(scp, LOAD, 16, font_16);
- } else {
- if (fonts_loaded & FONT_14)
- copy_font(scp, LOAD, 14, font_14);
- }
- /*
- * FONT KLUDGE:
- * This is an interim kludge to display correct font.
- * Always use the font page #0 on the video plane 2.
- * Somehow we cannot show the font in other font pages on
- * some video cards... XXX
- */
- (*vidsw[scp->ad]->show_font)(scp->adp, 0);
+ if (scp->status & UNKNOWN_MODE) {
+ while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
+ outb(0x62, 0xc); /* text off */
+ outb(0xA2, 0xd); /* graphics on */
+ } else {
+ while (!(inb(0x60) & 0x20)) {} /* V-SYNC wait */
+ outb(0x62, 0xd); /* text on */
+ outb(0xA2, 0xc); /* graphics off */
}
+#else /* IBM-PC */
+ switch (scp->mode) {
+ case M_VGA_C80x60: case M_VGA_M80x60:
+ special_modetable[2] = 0x08;
+ special_modetable[19] = 0x47;
+ goto special_480l;
+
+ case M_VGA_C80x30: case M_VGA_M80x30:
+ special_modetable[19] = 0x4f;
+special_480l:
+ special_modetable[9] |= 0xc0;
+ special_modetable[16] = 0x08;
+ special_modetable[17] = 0x3e;
+ special_modetable[26] = 0xea;
+ special_modetable[28] = 0xdf;
+ special_modetable[31] = 0xe7;
+ special_modetable[32] = 0x04;
+ goto setup_mode;
+
+ case M_ENH_C80x43: case M_ENH_B80x43:
+ special_modetable[28] = 87;
+ goto special_80x50;
+
+ case M_VGA_C80x50: case M_VGA_M80x50:
+special_80x50:
+ special_modetable[2] = 8;
+ special_modetable[19] = 7;
+ goto setup_mode;
+
+ case M_VGA_C40x25: case M_VGA_C80x25:
+ case M_VGA_M80x25:
+ case M_B40x25: case M_C40x25:
+ case M_B80x25: case M_C80x25:
+ case M_ENH_B40x25: case M_ENH_C40x25:
+ case M_ENH_B80x25: case M_ENH_C80x25:
+ case M_EGAMONO80x25:
+
+setup_mode:
+ set_vgaregs(special_modetable);
+ scp->font_size = special_modetable[2];
+
+ /* set font type (size) */
+ if (scp->font_size < 14) {
+ if (fonts_loaded & FONT_8)
+ copy_font(LOAD, FONT_8, font_8);
+ i = 0x0a; /* font 2 */
+ } else if (scp->font_size >= 16) {
+ if (fonts_loaded & FONT_16)
+ copy_font(LOAD, FONT_16, font_16);
+ i = 0x00; /* font 0 */
+ } else {
+ if (fonts_loaded & FONT_14)
+ copy_font(LOAD, FONT_14, font_14);
+ i = 0x05; /* font 1 */
+ }
+ /*
+ * FONT KLUDGE:
+ * This is an interim kludge to display correct font.
+ * Always use the font page #0 on the video plane 2.
+ * Somehow we cannot show the font in other font pages on
+ * some video cards... XXX
+ */
+ i = 0x00;
+ s = splhigh();
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+ outb(TSIDX, 0x03); outb(TSREG, i);
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+ splx(s);
+ if (flags & CHAR_CURSOR)
+ set_destructive_cursor(scp);
mark_all(scp);
- }
+ break;
- if (scp->status & PIXEL_MODE)
- generic_bzero((u_char *)(scp->adp->va_window),
- scp->xpixel*scp->ypixel/8);
- set_border(scp, scp->border);
+ case M_VGA_MODEX:
+ /* "unchain" the VGA mode */
+ special_modetable[5-1+0x04] &= 0xf7;
+ special_modetable[5-1+0x04] |= 0x04;
+ /* turn off doubleword mode */
+ special_modetable[10+0x14] &= 0xbf;
+ /* turn off word adressing */
+ special_modetable[10+0x17] |= 0x40;
+ /* set logical screen width */
+ special_modetable[10+0x13] = 80;
+ /* set 240 lines */
+ special_modetable[10+0x11] = 0x2c;
+ special_modetable[10+0x06] = 0x0d;
+ special_modetable[10+0x07] = 0x3e;
+ special_modetable[10+0x10] = 0xea;
+ special_modetable[10+0x11] = 0xac;
+ special_modetable[10+0x12] = 0xdf;
+ special_modetable[10+0x15] = 0xe7;
+ special_modetable[10+0x16] = 0x06;
+ /* set vertical sync polarity to reflect aspect ratio */
+ special_modetable[9] = 0xe3;
+ goto setup_grmode;
+
+ case M_BG320: case M_CG320: case M_BG640:
+ case M_CG320_D: case M_CG640_E:
+ case M_CG640x350: case M_ENH_CG640:
+ case M_BG640x480: case M_CG640x480: case M_VGA_CG320:
+
+setup_grmode:
+ set_vgaregs(special_modetable);
+ scp->font_size = FONT_NONE;
+ break;
-#ifndef PC98
- /* move hardware cursor out of the way */
- (*vidsw[scp->ad]->set_hw_cursor)(scp->adp, -1, -1);
-#endif
+ default:
+ /* call user defined function XXX */
+ break;
+ }
+#endif /* PC98 */
- return 0;
+ /* set border color for this (virtual) console */
+ set_border(scp->border);
+ return;
}
void
-set_border(scr_stat *scp, int color)
+set_border(u_char color)
{
+ switch (crtc_type) {
+#ifdef PC98
+ case KD_PC98:
+ outb(0x6c, color << 4);
+ break;
+#else
+ case KD_EGA:
+ case KD_VGA:
+ inb(crtc_addr + 6); /* reset flip-flop */
+ outb(ATC, 0x31); outb(ATC, color);
+ break;
+ case KD_CGA:
+ outb(crtc_addr + 5, color & 0x0f); /* color select register */
+ break;
+ case KD_MONO:
+ case KD_HERCULES:
+#endif
+ default:
+ break;
+ }
+}
+
#ifndef PC98
- u_char *p;
- int xoff;
- int yoff;
- int xlen;
- int ylen;
+static void
+set_vgaregs(char *modetable)
+{
+ int i, s = splhigh();
+
+ outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
+ for (i=0; i<4; i++) { /* program sequencer */
+ outb(TSIDX, i+1);
+ outb(TSREG, modetable[i+5]);
+ }
+ outb(MISC, modetable[9]); /* set dot-clock */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
+ outb(crtc_addr, 0x11);
+ outb(crtc_addr+1, inb(crtc_addr+1) & 0x7F);
+ for (i=0; i<25; i++) { /* program crtc */
+ outb(crtc_addr, i);
+ if (i == 14 || i == 15) /* no hardware cursor */
+ outb(crtc_addr+1, 0xff);
+ else
+ outb(crtc_addr+1, modetable[i+10]);
+ }
+ inb(crtc_addr+6); /* reset flip-flop */
+ for (i=0; i<20; i++) { /* program attribute ctrl */
+ outb(ATC, i);
+ outb(ATC, modetable[i+35]);
+ }
+ for (i=0; i<9; i++) { /* program graph data ctrl */
+ outb(GDCIDX, i);
+ outb(GDCREG, modetable[i+55]);
+ }
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+ splx(s);
+}
+
+static void
+read_vgaregs(char *buf)
+{
+ int i, j;
+ int s;
+
+ bzero(buf, MODE_PARAM_SIZE);
+
+ s = splhigh();
+
+ outb(TSIDX, 0x00); outb(TSREG, 0x01); /* stop sequencer */
+ for (i=0, j=5; i<4; i++) {
+ outb(TSIDX, i+1);
+ buf[j++] = inb(TSREG);
+ }
+ buf[9] = inb(MISC + 10); /* dot-clock */
+ outb(TSIDX, 0x00); outb(TSREG, 0x03); /* start sequencer */
+
+ for (i=0, j=10; i<25; i++) { /* crtc */
+ outb(crtc_addr, i);
+ buf[j++] = inb(crtc_addr+1);
+ }
+ for (i=0, j=35; i<20; i++) { /* attribute ctrl */
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, i);
+ buf[j++] = inb(ATC + 1);
+ }
+ for (i=0, j=55; i<9; i++) { /* graph data ctrl */
+ outb(GDCIDX, i);
+ buf[j++] = inb(GDCREG);
+ }
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+ buf[0] = *(char *)pa_to_va(0x44a); /* COLS */
+ buf[1] = *(char *)pa_to_va(0x484); /* ROWS */
+ buf[2] = *(char *)pa_to_va(0x485); /* POINTS */
+ buf[3] = *(char *)pa_to_va(0x44c);
+ buf[4] = *(char *)pa_to_va(0x44d);
+
+ splx(s);
+}
+
+static int
+comp_vgaregs(u_char *buf1, u_char *buf2)
+{
+ static struct {
+ u_char mask;
+ } params[MODE_PARAM_SIZE] = {
+ 0xff, 0x00, 0xff, /* COLS, ROWS, POINTS */
+ 0xff, 0xff, /* page length */
+ 0xfe, 0xff, 0xff, 0xff, /* sequencer registers */
+ 0xf3, /* misc register */
+ 0xff, 0xff, 0xff, 0x7f, 0xff, /* CRTC */
+ 0xff, 0xff, 0xff, 0x7f, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0x7f, 0xff, 0xff,
+ 0x7f, 0xff, 0xff, 0xef, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, /* attribute controller registers */
+ 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xf0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, /* GDC register */
+ 0xff, 0xff, 0xff, 0xff,
+ };
+ int identical = TRUE;
int i;
- (*vidsw[scp->ad]->set_border)(scp->adp, color);
-
- if (scp->status & PIXEL_MODE) {
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
- outw(GDCIDX, (color << 8) | 0x00); /* set/reset */
- p = (u_char *)(scp->adp->va_window);
- xoff = scp->xoff;
- yoff = scp->yoff*scp->font_size;
- xlen = scp->xpixel/8;
- ylen = scp->ysize*scp->font_size;
- if (yoff > 0) {
- generic_bzero(p, xlen*yoff);
- generic_bzero(p + xlen*(yoff + ylen),
- xlen*scp->ypixel - xlen*(yoff + ylen));
- }
- if (xoff > 0) {
- for (i = 0; i < ylen; ++i) {
- generic_bzero(p + xlen*(yoff + i), xoff);
- generic_bzero(p + xlen*(yoff + i) + xoff + scp->xsize,
- xlen - xoff - scp->xsize);
- }
- }
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
+ for (i = 0; i < sizeof(params)/sizeof(params[0]); ++i) {
+ if (params[i].mask == 0) /* don't care */
+ continue;
+ if ((buf1[i] & params[i].mask) != (buf2[i] & params[i].mask))
+ return COMP_DIFFERENT;
+ if (buf1[i] != buf2[i])
+ identical = FALSE;
}
-#else /* PC98 */
- (*vidsw[scp->ad]->set_border)(scp->adp, color);
-#endif /* PC98 */
+ return (identical) ? COMP_IDENTICAL : COMP_SIMILAR;
+
+#if 0
+ for(i = 0; i < 20; ++i) {
+ if (*buf1++ != *buf2++)
+ return COMP_DIFFERENT;
+ }
+ buf1 += 2; /* skip the cursor shape */
+ buf2 += 2;
+ for(i = 22; i < 24; ++i) {
+ if (*buf1++ != *buf2++)
+ return COMP_DIFFERENT;
+ }
+ buf1 += 2; /* skip the cursor position */
+ buf2 += 2;
+ for(i = 26; i < MODE_PARAM_SIZE; ++i) {
+ if (*buf1++ != *buf2++)
+ return COMP_DIFFERENT;
+ }
+ return COMP_IDENTICAL;
+#endif
}
-void
-copy_font(scr_stat *scp, int operation, int font_size, u_char *buf)
+static void
+dump_vgaregs(u_char *buf)
{
- /*
- * FONT KLUDGE:
- * This is an interim kludge to display correct font.
- * Always use the font page #0 on the video plane 2.
- * Somehow we cannot show the font in other font pages on
- * some video cards... XXX
- */
+ int i;
+
+ for(i = 0; i < MODE_PARAM_SIZE;) {
+ printf("%02x ", buf[i]);
+ if ((++i % 16) == 0)
+ printf("\n");
+ }
+}
+
+static void
+set_font_mode(u_char *buf)
+{
+ int s = splhigh();
+
font_loading_in_progress = TRUE;
- if (operation == LOAD) {
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, buf, 0, 256);
- if (sc_flags & CHAR_CURSOR)
- set_destructive_cursor(scp);
- } else if (operation == SAVE) {
- (*vidsw[scp->ad]->save_font)(scp->adp, 0, font_size, buf, 0, 256);
+
+ /* save register values */
+ outb(TSIDX, 0x02); buf[0] = inb(TSREG);
+ outb(TSIDX, 0x04); buf[1] = inb(TSREG);
+ outb(GDCIDX, 0x04); buf[2] = inb(GDCREG);
+ outb(GDCIDX, 0x05); buf[3] = inb(GDCREG);
+ outb(GDCIDX, 0x06); buf[4] = inb(GDCREG);
+ inb(crtc_addr + 6);
+ outb(ATC, 0x10); buf[5] = inb(ATC + 1);
+
+ /* setup vga for loading fonts */
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x10); outb(ATC, buf[5] & ~0x01);
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+#if SLOW_VGA
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
+ outb(TSIDX, 0x02); outb(TSREG, 0x04);
+ outb(TSIDX, 0x04); outb(TSREG, 0x07);
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
+ outb(GDCIDX, 0x04); outb(GDCREG, 0x02);
+ outb(GDCIDX, 0x05); outb(GDCREG, 0x00);
+ outb(GDCIDX, 0x06); outb(GDCREG, 0x04);
+#else
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0100);
+#endif
+ outw(TSIDX, 0x0402);
+ outw(TSIDX, 0x0704);
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0300);
+#endif
+ outw(GDCIDX, 0x0204);
+ outw(GDCIDX, 0x0005);
+ outw(GDCIDX, 0x0406); /* addr = a0000, 64kb */
+#endif
+ splx(s);
+}
+
+static void
+set_normal_mode(u_char *buf)
+{
+ char *modetable;
+ int s = splhigh();
+
+ /* setup vga for normal operation mode again */
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x10); outb(ATC, buf[5]);
+ inb(crtc_addr+6); /* reset flip-flop */
+ outb(ATC, 0x20); /* enable palette */
+
+#if SLOW_VGA
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x01);
+#endif
+ outb(TSIDX, 0x02); outb(TSREG, buf[0]);
+ outb(TSIDX, 0x04); outb(TSREG, buf[1]);
+#ifndef SC_BAD_FLICKER
+ outb(TSIDX, 0x00); outb(TSREG, 0x03);
+#endif
+ outb(GDCIDX, 0x04); outb(GDCREG, buf[2]);
+ outb(GDCIDX, 0x05); outb(GDCREG, buf[3]);
+ if (crtc_addr == MONO_BASE) {
+ outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x08);
+ } else {
+ outb(GDCIDX, 0x06); outb(GDCREG,(buf[4] & 0x03) | 0x0c);
}
+#else
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0100);
+#endif
+ outw(TSIDX, 0x0002 | (buf[0] << 8));
+ outw(TSIDX, 0x0004 | (buf[1] << 8));
+#ifndef SC_BAD_FLICKER
+ outw(TSIDX, 0x0300);
+#endif
+ outw(GDCIDX, 0x0004 | (buf[2] << 8));
+ outw(GDCIDX, 0x0005 | (buf[3] << 8));
+ if (crtc_addr == MONO_BASE)
+ outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x08)<<8));
+ else
+ outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8));
+#endif
+
font_loading_in_progress = FALSE;
+ splx(s);
+}
+#endif
+
+void
+copy_font(int operation, int font_type, char* font_image)
+{
+#ifndef PC98
+ int ch, line, segment, fontsize;
+ u_char buf[PARAM_BUFSIZE];
+ u_char val;
+
+ switch (font_type) {
+ default:
+ case FONT_8:
+ segment = 0x8000;
+ fontsize = 8;
+ break;
+ case FONT_14:
+ segment = 0x4000;
+ fontsize = 14;
+ break;
+ case FONT_16:
+ segment = 0x0000;
+ fontsize = 16;
+ break;
+ }
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ */
+ segment = 0x0000;
+ outb(TSIDX, 0x01); val = inb(TSREG); /* disable screen */
+ outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
+ set_font_mode(buf);
+ for (ch=0; ch < 256; ch++)
+ for (line=0; line < fontsize; line++)
+ if (operation)
+ *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line) =
+ font_image[(ch*fontsize)+line];
+ else
+ font_image[(ch*fontsize)+line] =
+ *(char *)pa_to_va(VIDEOMEM+(segment)+(ch*32)+line);
+ set_normal_mode(buf);
+ outb(TSIDX, 0x01); outb(TSREG, val & 0xDF); /* enable screen */
+#endif
}
static void
set_destructive_cursor(scr_stat *scp)
{
#ifndef PC98
+ u_char buf[PARAM_BUFSIZE];
u_char cursor[32];
- u_char *font_buffer;
- int font_size;
- int crtc_addr;
+ caddr_t address;
int i;
-
- if (!ISFONTAVAIL(scp->adp->va_flags)
- || (scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
- return;
+ char *font_buffer;
if (scp->font_size < 14) {
font_buffer = font_8;
- font_size = 8;
- } else if (scp->font_size >= 16) {
+ address = (caddr_t)VIDEOMEM + 0x8000;
+ }
+ else if (scp->font_size >= 16) {
font_buffer = font_16;
- font_size = 16;
- } else {
+ address = (caddr_t)VIDEOMEM;
+ }
+ else {
font_buffer = font_14;
- font_size = 14;
+ address = (caddr_t)VIDEOMEM + 0x4000;
}
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ */
+ address = (caddr_t)VIDEOMEM;
if (scp->status & MOUSE_VISIBLE) {
if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR)
@@ -4719,24 +5871,14 @@ set_destructive_cursor(scr_stat *scp)
(scp->cursor_start >= scp->font_size && i == scp->font_size - 1))
cursor[i] |= 0xff;
#if 1
- crtc_addr = scp->adp->va_crtc_addr;
while (!(inb(crtc_addr+6) & 0x08)) /* wait for vertical retrace */ ;
#endif
- font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, font_size, cursor, DEAD_CHAR, 1);
- font_loading_in_progress = FALSE;
+ set_font_mode(buf);
+ generic_bcopy(cursor, (char *)pa_to_va(address) + DEAD_CHAR * 32, 32);
+ set_normal_mode(buf);
#endif
}
-void
-sc_move_mouse(scr_stat *scp, int x, int y)
-{
- scp->mouse_xpos = x;
- scp->mouse_ypos = y;
- scp->mouse_pos = scp->mouse_oldpos =
- scp->scr_buf + (y / scp->font_size) * scp->xsize + x / 8;
-}
-
static void
set_mouse_pos(scr_stat *scp)
{
@@ -4746,7 +5888,7 @@ set_mouse_pos(scr_stat *scp)
scp->mouse_xpos = 0;
if (scp->mouse_ypos < 0)
scp->mouse_ypos = 0;
- if (!ISTEXTSC(scp)) {
+ if (scp->status & UNKNOWN_MODE) {
if (scp->mouse_xpos > scp->xpixel-1)
scp->mouse_xpos = scp->xpixel-1;
if (scp->mouse_ypos > scp->ypixel-1)
@@ -4979,28 +6121,35 @@ draw_mouse_image(scr_stat *scp)
#ifdef PC98
*(Atrat + (scp->mouse_pos - scp->scr_buf)) ^= 0x4; /* reverse bit */
#else
+ caddr_t address;
+ int i;
+ char *font_buffer;
+ u_char buf[PARAM_BUFSIZE];
u_short buffer[32];
u_short xoffset, yoffset;
- u_short *crt_pos = (u_short *)(scp->adp->va_window)
- + (scp->mouse_pos - scp->scr_buf);
- u_char *font_buffer;
- int font_size;
- int crtc_addr;
- int i;
+ u_short *crt_pos = Crtat + (scp->mouse_pos - scp->scr_buf);
+ int font_size = scp->font_size;
- if (scp->font_size < 14) {
+ if (font_size < 14) {
font_buffer = font_8;
- font_size = 8;
- } else if (scp->font_size >= 16) {
+ address = (caddr_t)VIDEOMEM + 0x8000;
+ }
+ else if (font_size >= 16) {
font_buffer = font_16;
- font_size = 16;
- } else {
+ address = (caddr_t)VIDEOMEM;
+ }
+ else {
font_buffer = font_14;
- font_size = 14;
+ address = (caddr_t)VIDEOMEM + 0x4000;
}
+ /*
+ * FONT KLUDGE
+ * Always use the font page #0. XXX
+ */
+ address = (caddr_t)VIDEOMEM;
xoffset = scp->mouse_xpos % 8;
- yoffset = scp->mouse_ypos % scp->font_size;
+ yoffset = scp->mouse_ypos % font_size;
/* prepare mousepointer char's bitmaps */
bcopy(font_buffer + ((*(scp->mouse_pos) & 0xff) * font_size),
@@ -5029,19 +6178,15 @@ draw_mouse_image(scr_stat *scp)
scp->mouse_cursor[i+96] = buffer[i+font_size] & 0xff;
}
#endif
-
scp->mouse_oldpos = scp->mouse_pos;
#ifndef PC98
#if 1
/* wait for vertical retrace to avoid jitter on some videocards */
- crtc_addr = scp->adp->va_crtc_addr;
while (!(inb(crtc_addr+6) & 0x08)) /* idle */ ;
#endif
- font_loading_in_progress = TRUE;
- (*vidsw[scp->ad]->load_font)(scp->adp, 0, 32, scp->mouse_cursor,
- SC_MOUSE_CHAR, 4);
- font_loading_in_progress = FALSE;
-
+ set_font_mode(buf);
+ generic_bcopy(scp->mouse_cursor, (char *)pa_to_va(address) + SC_MOUSE_CHAR * 32, 128);
+ set_normal_mode(buf);
*(crt_pos) = (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR;
*(crt_pos+scp->xsize) =
(*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2);
@@ -5060,16 +6205,10 @@ draw_mouse_image(scr_stat *scp)
static void
remove_mouse_image(scr_stat *scp)
{
- u_short *crt_pos;
-
- if (!ISTEXTSC(scp))
- return;
-
#ifdef PC98
- crt_pos = Atrat + (scp->mouse_oldpos - scp->scr_buf);
+ u_short *crt_pos = Atrat + (scp->mouse_oldpos - scp->scr_buf);
#else
- crt_pos = (u_short *)(scp->adp->va_window)
- + (scp->mouse_oldpos - scp->scr_buf);
+ u_short *crt_pos = Crtat + (scp->mouse_oldpos - scp->scr_buf);
#endif
#ifdef PC98
@@ -5089,17 +6228,15 @@ remove_mouse_image(scr_stat *scp)
static void
draw_cutmarking(scr_stat *scp)
{
- u_short *crt_pos;
u_short *ptr;
u_short och, nch;
+ for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
#ifdef PC98
- crt_pos = Atrat;
+ nch = och = *(Atrat + (ptr - scp->scr_buf));
#else
- crt_pos = (u_short *)(scp->adp->va_window);
+ nch = och = *(Crtat + (ptr - scp->scr_buf));
#endif
- for (ptr=scp->scr_buf; ptr<=(scp->scr_buf+(scp->xsize*scp->ysize)); ptr++) {
- nch = och = *(crt_pos + (ptr - scp->scr_buf));
/* are we outside the selected area ? */
if ( ptr < (scp->mouse_cut_start > scp->mouse_cut_end ?
scp->mouse_cut_end : scp->mouse_cut_start) ||
@@ -5124,16 +6261,20 @@ draw_cutmarking(scr_stat *scp)
if (ptr != scp->cursor_pos)
nch = (och & 0x88ff) | (*ptr & 0x7000)>>4 | (*ptr & 0x0700)<<4;
else {
- if (sc_flags & CHAR_CURSOR)
+ if (flags & CHAR_CURSOR)
nch = (och & 0x88ff)|(*ptr & 0x7000)>>4|(*ptr & 0x0700)<<4;
else
- if (!(sc_flags & BLINK_CURSOR))
+ if (!(flags & BLINK_CURSOR))
nch = (och & 0xff) | (*ptr & 0xff00);
}
#endif
}
if (nch != och)
- *(crt_pos + (ptr - scp->scr_buf)) = nch;
+#ifdef PC98
+ *(Atrat + (ptr - scp->scr_buf)) = nch;
+#else
+ *(Crtat + (ptr - scp->scr_buf)) = nch;
+#endif
}
}
@@ -5146,15 +6287,43 @@ remove_cutmarking(scr_stat *scp)
}
static void
+save_palette(void)
+{
+#ifndef PC98
+ int i;
+
+ outb(PALRADR, 0x00);
+ for (i=0x00; i<0x300; i++)
+ palette[i] = inb(PALDATA);
+ inb(crtc_addr+6); /* reset flip/flop */
+#endif
+}
+
+void
+load_palette(char *palette)
+{
+#ifndef PC98
+ int i;
+
+ outb(PIXMASK, 0xFF); /* no pixelmask */
+ outb(PALWADR, 0x00);
+ for (i=0x00; i<0x300; i++)
+ outb(PALDATA, palette[i]);
+ inb(crtc_addr+6); /* reset flip/flop */
+ outb(ATC, 0x20); /* enable palette */
+#endif
+}
+
+static void
do_bell(scr_stat *scp, int pitch, int duration)
{
if (cold || shutdown_in_progress)
return;
- if (scp != cur_console && (sc_flags & QUIET_BELL))
+ if (scp != cur_console && (flags & QUIET_BELL))
return;
- if (sc_flags & VISUAL_BELL) {
+ if (flags & VISUAL_BELL) {
if (blink_in_progress)
return;
blink_in_progress = 4;
@@ -5173,7 +6342,7 @@ blink_screen(void *arg)
{
scr_stat *scp = arg;
- if (!ISTEXTSC(scp) || (blink_in_progress <= 1)) {
+ if ((scp->status & UNKNOWN_MODE) || (blink_in_progress <= 1)) {
blink_in_progress = FALSE;
mark_all(scp);
if (delayed_next_scr)
@@ -5183,26 +6352,22 @@ blink_screen(void *arg)
#ifdef PC98
if (blink_in_progress & 1){
fillw(scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
fillw(at2pc98(kernel_default.std_color),
Atrat, scp->xsize * scp->ysize);
} else {
fillw(scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
fillw(at2pc98(kernel_default.rev_color),
Atrat, scp->xsize * scp->ysize);
}
#else
if (blink_in_progress & 1)
fillw(kernel_default.std_color | scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
else
fillw(kernel_default.rev_color | scr_map[0x20],
- (u_short *)(scp->adp->va_window),
- scp->xsize * scp->ysize);
+ Crtat, scp->xsize * scp->ysize);
#endif
blink_in_progress--;
timeout(blink_screen, scp, hz / 10);
@@ -5212,105 +6377,225 @@ blink_screen(void *arg)
void
sc_bcopy(scr_stat *scp, u_short *p, int from, int to, int mark)
{
-#ifdef PC98
- if (ISTEXTSC(scp))
- generic_bcopy(p + from, (u_short *)(scp->adp->va_window) + from,
- (to - from + 1)*sizeof(u_short));
-#else /* PC98 */
- u_char *font;
- u_char volatile *d;
- u_char *e;
- u_char *f;
- int font_size;
- int line_length;
- int xsize;
- u_short bg;
- int i, j;
- u_char c;
+ if (!VESA_MODE(scp->mode)) {
+ generic_bcopy(p+from, Crtat+from, (to-from+1)*sizeof (u_short));
+ } else if (scp->mode == 0x102) {
+ u_char *d, *e;
+ int i,j;
- if (ISTEXTSC(scp)) {
- generic_bcopy(p + from, (u_short *)(scp->adp->va_window) + from,
- (to - from + 1)*sizeof(u_short));
- } else /* if ISPIXELSC(scp) */ {
if (mark)
- mark = 255;
- font_size = scp->font_size;
- if (font_size < 14)
- font = font_8;
- else if (font_size >= 16)
- font = font_16;
- else
- font = font_14;
- line_length = scp->xpixel/8;
- xsize = scp->xsize;
- d = (u_char *)(scp->adp->va_window)
- + scp->xoff + scp->yoff*font_size*line_length
- + (from%xsize) + font_size*line_length*(from/xsize);
-
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- bg = -1;
+ mark = 255;
+ d = (u_char *)Crtat;
+ d += 10 + 6*16*100 + (from%80) + 16*100*(from/80);
for (i = from ; i <= to ; i++) {
- /* set background color in EGA/VGA latch */
- if (bg != (p[i] & 0xf000)) {
- bg = (p[i] & 0xf000);
- outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
- outw(GDCIDX, 0xff08); /* bit mask */
- *d = 0;
- c = *d; /* set the background color in the latch */
- }
- /* foreground color */
- outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
- e = (u_char *)d;
- f = &font[(p[i] & 0x00ff)*font_size];
- for (j = 0 ; j < font_size; j++, f++) {
- outw(GDCIDX, ((*f^mark) << 8) | 0x08); /* bit mask */
- *e = 0;
- e += line_length;
+ e = d;
+ for (j = 0 ; j < 16; j++) {
+ *e = mark^font_16[(p[i]&0xff)*16+j];
+ e+=100;
}
d++;
- if ((i % xsize) == xsize - 1)
- d += scp->xoff*2 + (font_size - 1)*line_length;
+ if ((i % 80) == 79)
+ d += 20 + 15*100;
}
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
-
-#if 0 /* VGA only */
- outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
- outw(GDCIDX, 0x0003); /* data rotate/function select */
- outw(GDCIDX, 0x0f01); /* set/reset enable */
- outw(GDCIDX, 0xff08); /* bit mask */
- bg = -1;
- for (i = from ; i <= to ; i++) {
- /* set background color in EGA/VGA latch */
- if (bg != (p[i] & 0xf000)) {
- bg = (p[i] & 0xf000);
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, (bg >> 4) | 0x00); /* set/reset */
- *d = 0;
- c = *d; /* set the background color in the latch */
- outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
- }
- /* foreground color */
- outw(GDCIDX, (p[i] & 0x0f00) | 0x00); /* set/reset */
- e = (u_char *)d;
- f = &font[(p[i] & 0x00ff)*font_size];
- for (j = 0 ; j < font_size; j++, f++) {
- *e = *f^mark;
- e += line_length;
- }
- d++;
- if ((i % xsize) == xsize - 1)
- d += scp->xoff*2 + (font_size - 1)*line_length;
+ }
+}
+
+#ifdef SC_SPLASH_SCREEN
+
+static void
+scsplash_init(void)
+{
+#ifndef PC98
+ /*
+ * We currently assume the splash screen always use
+ * VGA_CG320 mode and abort installation if this mode is not
+ * supported with this video card. XXX
+ */
+ if (crtc_type != KD_VGA || get_mode_param(cur_console, M_VGA_CG320) == NULL)
+ return;
+#endif
+
+ if (splash_load() == 0 && add_scrn_saver(scsplash) == 0) {
+ default_saver = scsplash;
+ scrn_blank_time = DEFAULT_BLANKTIME;
+ run_scrn_saver = TRUE;
+ if (!(boothowto & RB_CONFIG)) {
+ scsplash_stick(TRUE);
+ scsplash(TRUE);
}
- outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
- outw(GDCIDX, 0x0000); /* set/reset */
- outw(GDCIDX, 0x0001); /* set/reset enable */
-#endif /* 0 */
}
-#endif /* PC98 */
}
+static void
+scsplash(int show)
+{
+ if (show)
+ splash(TRUE);
+ else if (!sticky_splash)
+ splash(FALSE);
+}
+
+#endif /* SC_SPLASH_SCREEN */
+
+#if defined(PC98) && defined(LINE30) /* 30line */
+
+static void master_gdc_cmd(unsigned int cmd)
+{
+ while ( (inb(0x60) & 2) != 0);
+ outb(0x62, cmd);
+}
+
+static void master_gdc_prm(unsigned int pmtr)
+{
+ while ( (inb(0x60) & 2) != 0);
+ outb(0x60, pmtr);
+}
+
+static void master_gdc_word_prm(unsigned int wpmtr)
+{
+ master_gdc_prm(wpmtr & 0x00ff);
+ master_gdc_prm((wpmtr >> 8) & 0x00ff);
+}
+
+static void master_gdc_fifo_empty(void)
+{
+ while ( (inb(0x60) & 4) == 0);
+}
+
+static void master_gdc_wait_vsync(void)
+{
+ while ( (inb(0x60) & 0x20) != 0);
+ while ( (inb(0x60) & 0x20) == 0);
+}
+
+static void gdc_cmd(unsigned int cmd)
+{
+ while ( (inb(0xa0) & 2) != 0);
+ outb( 0xa2, cmd);
+}
+
+static void gdc_prm(unsigned int pmtr)
+{
+ while ( (inb(0xa0) & 2) != 0);
+ outb( 0xa0, pmtr);
+}
+
+static void gdc_word_prm(unsigned int wpmtr)
+{
+ gdc_prm(wpmtr & 0x00ff);
+ gdc_prm((wpmtr >> 8) & 0x00ff);
+}
+
+static void gdc_fifo_empty(void)
+{
+ while ( (inb(0xa0) & 0x04) == 0);
+}
+
+static void gdc_wait_vsync(void)
+{
+ while ( (inb(0xa0) & 0x20) != 0);
+ while ( (inb(0xa0) & 0x20) == 0);
+}
+
+static int check_gdc_clock(void)
+{
+ if ((inb(0x31) & 0x80) == 0){
+ return _5MHZ;
+ } else {
+ return _2_5MHZ;
+ }
+}
+
+static void initialize_gdc(unsigned int mode)
+{
+ /* start 30line initialize */
+ int m_mode,s_mode,gdc_clock;
+ gdc_clock = check_gdc_clock();
+
+ if (mode == T25_G400){
+ m_mode = _25L;
+ }else{
+ m_mode = _30L;
+ }
+
+ s_mode = 2*mode+gdc_clock;
+
+ gdc_INFO = m_mode;
+
+ master_gdc_cmd(_GDC_RESET);
+ master_gdc_cmd(_GDC_MASTER);
+ gdc_cmd(_GDC_RESET);
+ gdc_cmd(_GDC_SLAVE);
+
+ /* GDC Master */
+ master_gdc_cmd(_GDC_SYNC);
+ master_gdc_prm(0x00); /* flush less */ /* text & graph */
+ master_gdc_prm(master_param[m_mode][GDC_CR]);
+ master_gdc_word_prm(((master_param[m_mode][GDC_HFP] << 10)
+ + (master_param[m_mode][GDC_VS] << 5)
+ + master_param[m_mode][GDC_HS]));
+ master_gdc_prm(master_param[m_mode][GDC_HBP]);
+ master_gdc_prm(master_param[m_mode][GDC_VFP]);
+ master_gdc_word_prm(((master_param[m_mode][GDC_VBP] << 10)
+ + (master_param[m_mode][GDC_LF])));
+ master_gdc_fifo_empty();
+ master_gdc_cmd(_GDC_PITCH);
+ master_gdc_prm(MasterPCH);
+ master_gdc_fifo_empty();
+
+ /* GDC slave */
+ gdc_cmd(_GDC_SYNC);
+ gdc_prm(0x06);
+ gdc_prm(slave_param[s_mode][GDC_CR]);
+ gdc_word_prm((slave_param[s_mode][GDC_HFP] << 10)
+ + (slave_param[s_mode][GDC_VS] << 5)
+ + (slave_param[s_mode][GDC_HS]));
+ gdc_prm(slave_param[s_mode][GDC_HBP]);
+ gdc_prm(slave_param[s_mode][GDC_VFP]);
+ gdc_word_prm((slave_param[s_mode][GDC_VBP] << 10)
+ + (slave_param[s_mode][GDC_LF]));
+ gdc_fifo_empty();
+ gdc_cmd(_GDC_PITCH);
+ gdc_prm(SlavePCH[gdc_clock]);
+ gdc_fifo_empty();
+
+ /* set Master GDC scroll param */
+ master_gdc_wait_vsync();
+ master_gdc_wait_vsync();
+ master_gdc_wait_vsync();
+ master_gdc_cmd(_GDC_SCROLL);
+ master_gdc_word_prm(0);
+ master_gdc_word_prm((master_param[m_mode][GDC_LF] << 4) | 0x0000);
+ master_gdc_fifo_empty();
+
+ /* set Slave GDC scroll param */
+ gdc_wait_vsync();
+ gdc_cmd(_GDC_SCROLL);
+ gdc_word_prm(0);
+ if (gdc_clock == _5MHZ){
+ gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
+ }else{
+ gdc_word_prm(SlaveScrlLF[mode] << 4);
+ }
+ gdc_fifo_empty();
+
+ gdc_word_prm(0);
+ if (gdc_clock == _5MHZ){
+ gdc_word_prm((SlaveScrlLF[mode] << 4) | 0x4000);
+ }else{
+ gdc_word_prm(SlaveScrlLF[mode] << 4);
+ }
+ gdc_fifo_empty();
+
+ /* sync start */
+ gdc_cmd(_GDC_STOP);
+
+ gdc_wait_vsync();
+ gdc_wait_vsync();
+ gdc_wait_vsync();
+
+ master_gdc_cmd(_GDC_START);
+}
+#endif /* 30 line */
+
#endif /* NSC */
diff --git a/sys/pc98/pc98/syscons.h b/sys/pc98/pc98/syscons.h
index a265d15277ae9..3d4b8d3ed00b8 100644
--- a/sys/pc98/pc98/syscons.h
+++ b/sys/pc98/pc98/syscons.h
@@ -1,18 +1,18 @@
/*-
- * Copyright (c) 1992-1998 Sen Schmidt
+ * Copyright (c) 1995 Sen Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer,
- * without modification, immediately at the beginning of the file.
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.27 1999/01/17 15:42:27 kato Exp $
+ * $Id: syscons.h,v 1.24 1998/08/03 10:50:57 kato Exp $
*/
#ifndef _PC98_PC98_SYSCONS_H_
@@ -38,13 +38,8 @@
#define pa_to_va(pa) (KERNBASE + (pa)) /* works if ISMAPPED(pa...) */
/* printable chars */
-#ifdef PC98
-#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0f && (ch) < 0x1b) \
- || (ch) < 0x07)
-#else
#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
|| (ch) < 0x07)
-#endif
/* macros for "intelligent" screen update */
#define mark_for_update(scp, x) {\
@@ -57,7 +52,11 @@
}
/* status flags */
+#define LOCK_KEY_MASK 0x0000F
+#define LED_MASK 0x00007
#define UNKNOWN_MODE 0x00010
+#define KBD_RAW_MODE 0x00020
+#define KBD_CODE_MODE 0x00040
#define SWITCH_WAIT_REL 0x00080
#define SWITCH_WAIT_ACQ 0x00100
#define BUFFER_SAVED 0x00200
@@ -66,22 +65,15 @@
#define MOUSE_MOVED 0x01000
#define MOUSE_CUTTING 0x02000
#define MOUSE_VISIBLE 0x04000
-#define GRAPHICS_MODE 0x08000
-#define PIXEL_MODE 0x10000
-#define SAVER_RUNNING 0x20000
/* configuration flags */
#define VISUAL_BELL 0x00001
#define BLINK_CURSOR 0x00002
#define CHAR_CURSOR 0x00004
-/* these options are now obsolete; use corresponding options for kbd driver */
-#if 0
#define DETECT_KBD 0x00008
#define XT_KEYBD 0x00010
#define KBD_NORESET 0x00020
-#endif
#define QUIET_BELL 0x00040
-#define VESA800X600 0x00080
/* attribute flags */
#define NORMAL_ATTR 0x00
@@ -92,6 +84,9 @@
#define FOREGROUND_CHANGED 0x10
#define BACKGROUND_CHANGED 0x20
+/* video hardware memory addresses */
+#define VIDEOMEM 0x000A0000
+
/* misc defines */
#define FALSE 0
#define TRUE 1
@@ -116,11 +111,24 @@ static unsigned int BELL_PITCH = 1678;
#define FONT_14 4
#define FONT_16 8
-#ifdef PC98
/* defines related to hardware addresses */
+#ifdef PC98
#define TEXT_GDC IO_GDC1 /* 0x60 */
#define TEXT_VRAM (KERNBASE+0xA0000)
#define ATTR_OFFSET 0x1000
+#else /* IBM */
+#define MONO_BASE 0x3B4 /* crt controller base mono */
+#define COLOR_BASE 0x3D4 /* crt controller base color */
+#define MISC 0x3C2 /* misc output register */
+#define ATC IO_VGA+0x00 /* attribute controller */
+#define TSIDX IO_VGA+0x04 /* timing sequencer idx */
+#define TSREG IO_VGA+0x05 /* timing sequencer data */
+#define PIXMASK IO_VGA+0x06 /* pixel write mask */
+#define PALRADR IO_VGA+0x07 /* palette read address */
+#define PALWADR IO_VGA+0x08 /* palette write address */
+#define PALDATA IO_VGA+0x09 /* palette data register */
+#define GDCIDX IO_VGA+0x0E /* graph data controller idx */
+#define GDCREG IO_VGA+0x0F /* graph data controller data */
#endif
/* special characters */
@@ -146,8 +154,6 @@ typedef struct term_stat {
} term_stat;
typedef struct scr_stat {
- int ad; /* video adapter index */
- video_adapter_t *adp; /* video adapter structure */
u_short *scr_buf; /* buffer when off screen */
#ifdef PC98
u_short *atr_buf; /* buffer when off screen */
@@ -161,14 +167,11 @@ typedef struct scr_stat {
int ysize; /* Y text size */
int xpixel; /* X graphics size */
int ypixel; /* Y graphics size */
- int xoff; /* X offset in pixel mode */
- int yoff; /* Y offset in pixel mode */
int font_size; /* fontsize in Y direction */
int start; /* modified area start */
int end; /* modified area end */
term_stat term; /* terminal emulation stuff */
int status; /* status (bitfield) */
- int kbd_mode; /* keyboard I/O mode */
u_short *cursor_pos; /* cursor buffer position */
u_short *cursor_oldpos; /* cursor old buffer position */
#ifndef PC98
@@ -192,6 +195,7 @@ typedef struct scr_stat {
u_short bell_duration;
u_short bell_pitch;
u_char border; /* border color */
+ int initial_mode; /* initial mode */
int mode; /* mode */
pid_t pid; /* pid of controlling proc */
struct proc *proc; /* proc* of controlling proc */
@@ -208,30 +212,14 @@ typedef struct scr_stat {
#endif
int history_size; /* size of history buffer */
struct apmhook r_hook; /* reconfiguration support */
- int splash_save_mode; /* saved mode for splash screen */
- int splash_save_status; /* saved status for splash screen */
+#ifdef SC_SPLASH_SCREEN
+ u_char splash_save_mode; /* saved mode for splash screen */
+#endif
#ifdef KANJI
u_char kanji_1st_char;
-#define KTYPE_ASCII 0
-#define KTYPE_KANA 1
-#define KTYPE_JKANA 0x10
-#define KTYPE_7JIS 0x20
-#define KTYPE_SJIS 2
-#define KTYPE_UJIS 4
-#define KTYPE_SUKANA 3
-#define KTYPE_SUJIS 6
-#define KTYPE_KANIN 0x80
-#define KTYPE_ASCIN 0x40
- u_char kanji_type; /* 0: Ascii code 1: HANKAKU */
- /* 2: Shift JIS 4: UJIS */
- /* 3: Shift JIS or UJIS HANKAKU */
- /* 6: Shift JIS or UJIS */
+ u_char kanji_type; /* 0: ASCII CODE 1: HANKAKU ? */
+ /* 2: SHIFT JIS 4: EUC */
/* 0x10: JIS HANKAKU 0x20: JIS */
- /* 0x80: Kanji Invoke sequence */
- /* 0x40: Ascii Invoke sequence */
-#define IS_KTYPE_ASCII_or_HANKAKU(A) (!((A) & 0xee))
-#define IS_KTYPE_KANA(A) ((A) & 0x11)
-#define KTYPE_MASK_CTRL(A) ((A) &= 0xF0)
#endif
} scr_stat;
@@ -240,56 +228,22 @@ typedef struct default_attr {
int rev_color; /* reverse hardware color */
} default_attr;
-
-#define ISTEXTSC(scp) (!((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE)))
-#define ISGRAPHSC(scp) (((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE)))
-#define ISPIXELSC(scp) (((scp)->status \
- & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE))\
- == PIXEL_MODE)
-#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
-
-#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
-#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
-#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
-
/* misc prototypes used by different syscons related LKM's */
-
-/* syscons.c */
-extern int (*sc_user_ioctl)(dev_t dev, u_long cmd, caddr_t data, int flag,
- struct proc *p);
-
-int set_mode(scr_stat *scp);
-scr_stat *sc_get_scr_stat(dev_t dev);
-
-void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image);
-void set_border(scr_stat *scp, int color);
-#define save_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->save_palette)((adp), (pal))
-#define load_palette(adp, pal) \
- (*vidsw[(adp)->va_index]->load_palette)((adp), (pal))
-
-void sc_touch_scrn_saver(void);
-void sc_clear_screen(scr_stat *scp);
-void sc_move_mouse(scr_stat *scp, int x, int y);
-int sc_clean_up(scr_stat *scp);
-void sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear);
-void sc_alloc_cut_buffer(scr_stat *scp, int wait);
-void sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait);
-struct tty *scdevtotty(dev_t dev);
-
-/* scvidctl.c */
-int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode,
- int xsize, int ysize, int fontsize);
-int sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode);
-int sc_set_pixel_mode(scr_stat *scp, struct tty *tp,
- int xsize, int ysize, int fontsize);
-int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
- struct proc *p);
+void set_border(u_char color);
+void set_mode(scr_stat *scp);
+void copy_font(int operation, int font_type, char* font_image);
+void load_palette(char *palette);
+int add_scrn_saver(void (*this)(int));
+int remove_scrn_saver(void (*this)(int));
+
+#ifdef SC_SPLASH_SCREEN
+void splash(int);
+int splash_load(void);
+int splash_unload(void);
+#endif
#ifdef PC98
unsigned int at2pc98(unsigned int attr);
#endif
-#endif /* !_PC98_PC98_SYSCONS_H_ */
+#endif /* !_I386_ISA_SYSCONS_H_ */
diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c
index eb6522bf8fb9f..90fc584ca2217 100644
--- a/sys/pc98/pc98/wd.c
+++ b/sys/pc98/pc98/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.70 1999/01/16 11:43:12 kato Exp $
+ * $Id: wd.c,v 1.63 1998/09/15 14:07:08 kato Exp $
*/
/* TODO:
@@ -67,8 +67,8 @@
#include "opt_atapi.h"
#include "opt_devfs.h"
#include "opt_hw_wdog.h"
-#include "opt_ide_delay.h"
#include "opt_wd.h"
+#include "pci.h"
#include <sys/param.h>
#include <sys/dkbad.h>
@@ -112,11 +112,7 @@
extern void wdstart(int ctrlr);
-#ifdef IDE_DELAY
-#define TIMEOUT IDE_DELAY
-#else
#define TIMEOUT 10000
-#endif
#define RETRIES 5 /* number of retries before giving up */
#define RECOVERYTIME 500000 /* usec for controller to recover after err */
#define MAXTRANSFER 255 /* max size of transfer in sectors */
@@ -337,16 +333,19 @@ wdprobe(struct isa_device *dvp)
du->dk_ctrlr = dvp->id_unit;
interface = du->dk_ctrlr / 2;
du->dk_interface = interface;
- du->dk_port = dvp->id_iobase;
- if (wddma[interface].wdd_candma != NULL) {
- du->dk_dmacookie =
- wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr,
- du->dk_unit);
- du->dk_altport =
- wddma[interface].wdd_altiobase(du->dk_dmacookie);
- }
- if (du->dk_altport == 0)
+#if !defined(DISABLE_PCI_IDE) && (NPCI > 0)
+ if (wddma[interface].wdd_candma) {
+ du->dk_dmacookie = wddma[interface].wdd_candma(dvp->id_iobase, du->dk_ctrlr);
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = wddma[interface].wdd_altiobase(du->dk_dmacookie);
+ } else {
+ du->dk_port = dvp->id_iobase;
du->dk_altport = du->dk_port + wd_ctlr;
+ }
+#else
+ du->dk_port = dvp->id_iobase;
+ du->dk_altport = du->dk_port + wd_ctlr;
+#endif
/* check if we have registers that work */
#ifdef PC98
@@ -367,11 +366,9 @@ wdprobe(struct isa_device *dvp)
}
}
du->dk_altport = du->dk_port + wd_ctlr;
-#if 0
if ((PC98_SYSTEM_PARAMETER(0x55d) & 3) == 0) {
goto nodevice;
}
-#endif
outb(0x432,(du->dk_unit)%2);
#else /* IBM-PC */
outb(du->dk_port + wd_sdh, WDSD_IBM); /* set unit 0 */
@@ -395,31 +392,11 @@ wdprobe(struct isa_device *dvp)
if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
inb(du->dk_port + wd_cyl_hi) == 0xeb)
goto reset_ok;
-#ifdef PC98
- du->dk_unit = 2;
-#else
du->dk_unit = 1;
-#endif
outb(du->dk_port + wd_sdh, WDSD_IBM | 0x10); /* slave */
if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
inb(du->dk_port + wd_cyl_hi) == 0xeb)
goto reset_ok;
-#ifdef PC98
- du->dk_unit = 1;
- outb(0x432,(du->dk_unit)%2);
- if (wdreset(du) == 0)
- goto reset_ok;
- /* test for ATAPI signature */
- outb(du->dk_port + wd_sdh, WDSD_IBM); /* master */
- if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
- inb(du->dk_port + wd_cyl_hi) == 0xeb)
- goto reset_ok;
- du->dk_unit = 3;
- outb(du->dk_port + wd_sdh, WDSD_IBM | 0x10); /* slave */
- if (inb(du->dk_port + wd_cyl_lo) == 0x14 &&
- inb(du->dk_port + wd_cyl_hi) == 0xeb)
- goto reset_ok;
-#endif
#endif
DELAY(RECOVERYTIME);
if (wdreset(du) != 0) {
@@ -509,8 +486,6 @@ wdattach(struct isa_device *dvp)
struct disk *du;
struct wdparams *wp;
- dvp->id_intr = wdintr;
-
if (dvp->id_unit >= NWDC)
return (0);
@@ -773,17 +748,17 @@ wdstrategy(register struct buf *bp)
/* queue transfer on drive, activate drive and controller if idle */
s = splbio();
+ bufqdisksort(&drive_queue[lunit], bp);
+
+ if (wdutab[lunit].b_active == 0)
+ wdustart(du); /* start drive */
+
/* Pick up changes made by readdisklabel(). */
if (du->dk_flags & DKFL_LABELLING && du->dk_state > RECAL) {
wdsleep(du->dk_ctrlr, "wdlab");
du->dk_state = WANTOPEN;
}
- bufqdisksort(&drive_queue[lunit], bp);
-
- if (wdutab[lunit].b_active == 0)
- wdustart(du); /* start drive */
-
#ifdef CMD640
if (wdtab[du->dk_ctrlr_cmd640].b_active == 0)
#else
@@ -1166,12 +1141,11 @@ wdstart(int ctrlr)
*/
void
-wdintr(void *unitnum)
+wdintr(int unit)
{
register struct disk *du;
register struct buf *bp;
int dmastat = 0; /* Shut up GCC */
- int unit = (int)unitnum;
#ifdef CMD640
int ctrlr_atapi;
@@ -1223,7 +1197,8 @@ wdintr(void *unitnum)
if (du->dk_flags & (DKFL_DMA|DKFL_USEDMA)) {
/* XXX SMP boxes sometimes generate an early intr. Why? */
if ((wddma[du->dk_interface].wdd_dmastatus(du->dk_dmacookie) & WDDS_INTERRUPT)
- != 0)
+ == 0)
+ return;
dmastat = wddma[du->dk_interface].wdd_dmadone(du->dk_dmacookie);
}
@@ -2097,8 +2072,7 @@ failed:
* check drive's DMA capability
*/
if (wddma[du->dk_interface].wdd_candma) {
- du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(
- du->dk_port, du->dk_ctrlr, du->dk_unit);
+ du->dk_dmacookie = wddma[du->dk_interface].wdd_candma(du->dk_port, du->dk_ctrlr);
/* does user want this? */
if ((du->cfg_flags & WDOPT_DMA) &&
/* have we got a DMA controller? */
@@ -2502,11 +2476,11 @@ static void
wderror(struct buf *bp, struct disk *du, char *mesg)
{
if (bp == NULL)
- printf("wd%d: %s", du->dk_lunit, mesg);
+ printf("wd%d: %s:\n", du->dk_lunit, mesg);
else
diskerr(bp, "wd", mesg, LOG_PRINTF, du->dk_skip,
dsgetlabel(bp->b_dev, du->dk_slices));
- printf(" (status %b error %b)\n",
+ printf("wd%d: status %b error %b\n", du->dk_lunit,
du->dk_status, WDCS_BITS, du->dk_error, WDERR_BITS);
}
diff --git a/sys/pccard/driver.h b/sys/pccard/driver.h
index bbb255eeac175..5e3a6937217fd 100644
--- a/sys/pccard/driver.h
+++ b/sys/pccard/driver.h
@@ -7,13 +7,16 @@
#ifndef _PCCARD_DRIVER_H_
#define _PCCARD_DRIVER_H_
+struct lkm_table;
struct pccard_device;
+extern struct linker_set pccarddrv_set;
void pccard_add_driver __P((struct pccard_device *));
#ifdef _I386_ISA_ISA_DEVICE_H_ /* XXX actually if inthand2_t is declared */
int pccard_alloc_intr __P((u_int imask, inthand2_t *hand, int unit,
u_int *maskp, u_int *pcic_imask));
#endif
+void pccard_configure __P((void));
void pccard_remove_driver __P((struct pccard_device *));
int pcic_probe __P((void)); /* XXX should be linker set */
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 6220a89cc582f..333b04e81435c 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pccard.c,v 1.67 1998/11/09 09:30:55 peter Exp $
+ * $Id: pccard.c,v 1.65 1998/09/08 18:09:51 brian Exp $
*/
#include "opt_devfs.h"
@@ -50,7 +50,6 @@
#include <i386/isa/isa_device.h>
#include <i386/isa/icu.h>
-#include <i386/isa/intr_machdep.h>
#include "apm.h"
#if NAPM > 0
@@ -99,9 +98,6 @@ static void remove_device(struct pccard_devinfo *);
static inthand2_t slot_irq_handler;
static void power_off_slot(void *);
-static void pccard_configure(void *);
-SYSINIT(pccard, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE + 1, pccard_configure, NULL);
-
#if NAPM > 0
/*
* For the APM stuff, the apmhook structure is kept
@@ -151,41 +147,24 @@ static struct cdevsw crd_cdevsw =
* Each controller indicates the number of slots
* that it sees, and these are mapped to a master
* slot number accessed via the character device entries.
- *
- * XXX this is a relic. Each controller has it's own probe
- * configuration hook. Printing a list of configured devices
- * with pccard support probably isn't all that useful.
*/
-static void
-pccard_configure(dummy)
- void *dummy;
+void
+pccard_configure(void)
{
- struct pccard_device **driver, *drv;
+ struct pccard_device **drivers, *drv;
- /* This isn't strictly correct, but works because of initialize order */
- driver = &drivers;
+#include "pcic.h"
+#if NPCIC > 0
+ pcic_probe();
+#endif
+
+ drivers = (struct pccard_device **)pccarddrv_set.ls_items;
printf("Initializing PC-card drivers:");
- while ((drv = *driver++))
+ while ((drv = *drivers++)) {
printf(" %s", drv->name);
- printf("\n");
-}
-
-int
-pccard_module_handler(module_t mod, int what, void *arg)
-{
- struct pccard_device *drv = (struct pccard_device *)arg;
-
- switch(what) {
- case MOD_LOAD:
pccard_add_driver(drv);
- break;
- case MOD_UNLOAD:
- pccard_remove_driver(drv);
- break;
- default:
- break;
}
- return 0;
+ printf("\n");
}
/*
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 943bbc03443aa..1384c5b29b99c 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -1,6 +1,6 @@
/*
* Intel PCIC or compatible Controller driver
- * May be built to make a loadable module.
+ * May be built using LKM to make a loadable module.
*-------------------------------------------------------------------------
*
* Copyright (c) 1995 Andrew McRae. All rights reserved.
@@ -36,7 +36,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/module.h>
#include <sys/select.h>
#include <sys/interrupt.h>
@@ -67,8 +66,9 @@ static void pcic_mapirq __P((struct slot *, int));
static timeout_t pcictimeout;
static struct callout_handle pcictimeout_ch
= CALLOUT_HANDLE_INITIALIZER(&pcictimeout_ch);
-static int pcic_modevent __P((module_t, int, void *));
-static int pcic_unload __P((void));
+#ifdef LKM
+static int pcic_handle __P((struct lkm_table *lkmtp, int cmd));
+#endif
static int pcic_memory(struct slot *, int);
static int pcic_io(struct slot *, int);
static u_int build_freelist(u_int);
@@ -161,6 +161,12 @@ putw(struct pcic_slot *sp, int reg, unsigned short word)
/*
* Loadable kernel module interface.
*/
+#ifdef LKM
+/*
+ * This defines the lkm_misc module use by modload
+ * to define the module name.
+ */
+MOD_MISC(pcic);
/*
* Module handler that processes loads and unloads.
@@ -168,56 +174,73 @@ putw(struct pcic_slot *sp, int reg, unsigned short word)
* is called to install the slots (if any).
*/
static int
-pcic_modevent(module_t mod, int what, void *arg)
+pcic_handle(struct lkm_table *lkmtp, int cmd)
{
int err = 0; /* default = success*/
- static int pcic_started = 0;
- switch (what) {
- case MOD_LOAD:
+ switch(cmd) {
+ case LKM_E_LOAD:
/*
- * Call the probe routine to find the slots. If
- * no slots exist, then don't bother loading the module.
- * XXX but this is not appropriate as a static module.
+ * Don't load twice! (lkmexists() is exported by kern_lkm.c)
*/
- if (pcic_probe())
- pcic_started = 1;
- break;
-
- case MOD_UNLOAD:
+ if (lkmexists(lkmtp))
+ return(EEXIST);
/*
- * Attempt to unload the slot driver.
+ * Call the probe routine to find the slots. If
+ * no slots exist, then don't bother loading the module.
*/
- if (pcic_started) {
- printf("Unloading PCIC driver\n");
- err = pcic_unload();
- pcic_started = 0;
- }
+ if (pcic_probe() == 0)
+ return(ENODEV);
+ break; /* Success*/
+ /*
+ * Attempt to unload the slot driver.
+ */
+ case LKM_E_UNLOAD:
+ printf("Unloading PCIC driver\n");
+ err = pcic_unload(lkmtp, cmd);
break; /* Success*/
- default: /* we only care about load/unload; ignore shutdown */
+ default: /* we only understand load/unload*/
+ err = EINVAL;
break;
}
return(err);
}
-static moduledata_t pcic_mod = {
- "pcic",
- pcic_modevent,
- 0
-};
-
-/* After configure() has run.. bring on the new bus system! */
-DECLARE_MODULE(pcic, pcic_mod, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE);
+/*
+ * External entry point; should generally match name of .o file. The
+ * arguments are always the same for all loaded modules. The "load",
+ * "unload", and "stat" functions in "DISPATCH" will be called under
+ * their respective circumstances unless their value is "lkm_nullcmd".
+ * If called, they are called with the same arguments (cmd is included to
+ * allow the use of a single function, ver is included for version
+ * matching between modules and the kernel loader for the modules).
+ *
+ * Since we expect to link in the kernel and add external symbols to
+ * the kernel symbol name space in a future version, generally all
+ * functions used in the implementation of a particular module should
+ * be static unless they are expected to be seen in other modules or
+ * to resolve unresolved symbols alread existing in the kernel (the
+ * second case is not likely to ever occur).
+ *
+ * The entry point should return 0 unless it is refusing load (in which
+ * case it should return an errno from errno.h).
+ */
+int
+pcic_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(pcic, lkmtp, cmd, ver,
+ pcic_handle, pcic_handle, lkm_nullcmd);
+}
/*
* pcic_unload - Called when unloading a LKM.
* Disables interrupts and resets PCIC.
*/
static int
-pcic_unload()
+pcic_unload(struct lkm_table *lkmtp, int cmd)
{
int slot;
struct pcic_slot *sp = pcic_slots;
@@ -234,6 +257,7 @@ pcic_unload()
return(0);
}
+#endif /* LKM */
#if 0
static void
@@ -525,7 +549,7 @@ printf("Map I/O 0x%x (size 0x%x) on Window %d\n", ip->start, ip->size, win);
int
pcic_probe(void)
{
- int slotnum, validslots = 0;
+ int slotnum, i, validslots = 0;
u_int free_irqs;
struct slot *slt;
struct pcic_slot *sp;
@@ -551,6 +575,9 @@ pcic_probe(void)
cinfo.irqs = free_irqs;
cinfo.imask = &pcic_imask;
+#ifdef LKM
+ bzero(pcic_slots, sizeof(pcic_slots));
+#endif
sp = pcic_slots;
for (slotnum = 0; slotnum < PCIC_MAX_SLOTS; slotnum++, sp++) {
/*
diff --git a/sys/pccard/skel.c b/sys/pccard/skel.c
index 6991ab81d8531..b26c69a3cdc6e 100644
--- a/sys/pccard/skel.c
+++ b/sys/pccard/skel.c
@@ -41,20 +41,100 @@
#include <sys/select.h>
#include <sys/kernel.h>
-#include <sys/module.h>
#include <pccard/cardinfo.h>
#include <pccard/driver.h>
#include <pccard/slot.h>
+/*
+ * This defines the lkm_misc module use by modload
+ * to define the module name.
+ */
+MOD_MISC(skel);
+
static int skelinit(struct pccard_devinfo *); /* init device */
static void skelunload(struct pccard_devinfo *); /* Disable driver */
static int skelintr(struct pccard_devinfo *); /* Interrupt handler */
-PCCARD_MODULE(skel, skelinit, skelunload, skelintr, 0, net_imask);
+static struct pccard_device skel_info = {
+ "skel",
+ skelinit,
+ skelunload,
+ skelintr,
+ 0, /* Attributes - presently unused */
+ &net_imask /* Interrupt mask for device */
+};
+
+DATA_SET(pccarddrv_set, skel_info);
static int opened; /* Rather minimal device state... */
/*
+ * Module handler that processes loads and unloads.
+ * Once the module is loaded, the add driver routine is called
+ * to register the driver.
+ * If an unload is requested the remove driver routine is
+ * called to deregister the driver before unloading.
+ */
+static int
+skel_handle(lkmtp, cmd)
+struct lkm_table *lkmtp;
+int cmd;
+{
+ int i;
+ struct lkm_misc *args = lkmtp->private.lkm_misc;
+ int err = 0; /* default = success*/
+
+ switch( cmd) {
+ case LKM_E_LOAD:
+/*
+ * Now register the driver
+ */
+ pccard_add_driver(&skel_info);
+ break; /* Success*/
+/*
+ * Attempt to deregister the driver.
+ */
+ case LKM_E_UNLOAD:
+ pccard_remove_driver(&skel_info);
+ break; /* Success*/
+
+ default: /* we only understand load/unload*/
+ err = EINVAL;
+ break;
+ }
+
+ return( err);
+}
+
+
+/*
+ * External entry point; should generally match name of .o file. The
+ * arguments are always the same for all loaded modules. The "load",
+ * "unload", and "stat" functions in "MOD_DISPATCH" will be called under
+ * their respective circumstances unless their value is "nosys". If
+ * called, they are called with the same arguments (cmd is included to
+ * allow the use of a single function, ver is included for version
+ * matching between modules and the kernel loader for the modules).
+ *
+ * Since we expect to link in the kernel and add external symbols to
+ * the kernel symbol name space in a future version, generally all
+ * functions used in the implementation of a particular module should
+ * be static unless they are expected to be seen in other modules or
+ * to resolve unresolved symbols alread existing in the kernel (the
+ * second case is not likely to ever occur).
+ *
+ * The entry point should return 0 unless it is refusing load (in which
+ * case it should return an errno from errno.h).
+ */
+int
+skel(lkmtp, cmd, ver)
+struct lkm_table *lkmtp;
+int cmd;
+int ver;
+{
+ MOD_DISPATCH(skel,lkmtp,cmd,ver,skel_handle,skel_handle,nosys)
+}
+/*
* Skeleton driver entry points for PCCARD configuration.
*/
/*
diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h
index 396b96770c9ad..94c7f6c3b9053 100644
--- a/sys/pccard/slot.h
+++ b/sys/pccard/slot.h
@@ -86,24 +86,6 @@ struct pccard_device {
struct pccard_device *next;
};
-int pccard_module_handler __P((module_t mod, int what, void *arg));
-
-#define PCCARD_MODULE(name, enable, disable, handler, attr, imask) \
-static struct pccard_device name ## _info = { \
- #name, \
- enable, \
- disable, \
- handler, \
- attr, \
- &imask \
-}; \
-static moduledata_t name ## _mod = { \
- "pccard_" #name, \
- pccard_module_handler, \
- &name ## _info \
-}; \
-DECLARE_MODULE(name, name ## _mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
-
/*
* Device structure for cards. Each card may have one
* or more pccard drivers attached to it; each driver is assumed
diff --git a/sys/pci/adv_pci.c b/sys/pci/adv_pci.c
index dd81e881d6868..2f9e4e1eb712e 100644
--- a/sys/pci/adv_pci.c
+++ b/sys/pci/adv_pci.c
@@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adv_pci.c,v 1.3 1998/12/14 06:32:54 dillon Exp $
+ * $Id$
*/
#include <pci.h>
@@ -76,16 +76,16 @@
#define ADV_PCI_MAX_DMA_ADDR (0xFFFFFFFFL)
#define ADV_PCI_MAX_DMA_COUNT (0xFFFFFFFFL)
-static const char* advpciprobe(pcici_t tag, pcidi_t type);
+static char* advpciprobe(pcici_t tag, pcidi_t type);
static void advpciattach(pcici_t config_id, int unit);
/*
* The overrun buffer shared amongst all PCI adapters.
*/
static u_int8_t* overrun_buf;
-static bus_dma_tag_t overrun_dmat;
-static bus_dmamap_t overrun_dmamap;
-static bus_addr_t overrun_physbase;
+bus_dma_tag_t overrun_dmat;
+bus_dmamap_t overrun_dmamap;
+bus_addr_t overrun_physbase;
static struct pci_device adv_pci_driver = {
"adv",
@@ -97,7 +97,7 @@ static struct pci_device adv_pci_driver = {
DATA_SET (pcidevice_set, adv_pci_driver);
-static const char*
+static char*
advpciprobe(pcici_t tag, pcidi_t type)
{
int rev = pci_conf_read(tag, PCI_CLASS_REG) & 0xff;
@@ -122,6 +122,7 @@ static void
advpciattach(pcici_t config_id, int unit)
{
u_int16_t io_port;
+ u_int16_t config_msw;
struct adv_softc *adv;
u_int32_t id;
u_int32_t command;
@@ -251,13 +252,9 @@ advpciattach(pcici_t config_id, int unit)
adv->max_dma_addr = ADV_PCI_MAX_DMA_ADDR;
#if CC_DISABLE_PCI_PARITY_INT
- {
- u_int16_t config_msw;
-
- config_msw = ADV_INW(adv, ADV_CONFIG_MSW);
- config_msw &= 0xFFC0;
- ADV_OUTW(adv, ADV_CONFIG_MSW, config_msw);
- }
+ config_msw = ADV_INW(adv, ADV_CONFIG_MSW);
+ config_msw &= 0xFFC0;
+ ADV_OUTW(adv, ADV_CONFIG_MSW, config_msw);
#endif
if (id == PCI_DEVICE_ID_ADVANSYS_1200A
diff --git a/sys/pci/adw_pci.c b/sys/pci/adw_pci.c
index b65037bdba6b8..2109b91d1b0f7 100644
--- a/sys/pci/adw_pci.c
+++ b/sys/pci/adw_pci.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: adw_pci.c,v 1.2 1998/12/07 21:58:45 archie Exp $
+ * $Id$
*/
#include <pci.h>
@@ -58,7 +58,7 @@
#define ADW_PCI_MAX_DMA_ADDR (0xFFFFFFFFUL)
#define ADW_PCI_MAX_DMA_COUNT (0xFFFFFFFFUL)
-static const char* adwpciprobe(pcici_t tag, pcidi_t type);
+static char* adwpciprobe(pcici_t tag, pcidi_t type);
static void adwpciattach(pcici_t config_id, int unit);
static struct pci_device adw_pci_driver = {
@@ -71,7 +71,7 @@ static struct pci_device adw_pci_driver = {
DATA_SET (pcidevice_set, adw_pci_driver);
-static const char*
+static char*
adwpciprobe(pcici_t tag, pcidi_t type)
{
switch (type) {
@@ -89,9 +89,7 @@ adwpciattach(pcici_t config_id, int unit)
u_int32_t id;
u_int32_t command;
vm_offset_t vaddr;
-#ifdef ADW_ALLOW_MEMIO
vm_offset_t paddr;
-#endif
u_int16_t io_port;
bus_space_tag_t tag;
bus_space_handle_t bsh;
diff --git a/sys/pci/ahc_pci.c b/sys/pci/ahc_pci.c
index e7d54f9132486..344658de7a13d 100644
--- a/sys/pci/ahc_pci.c
+++ b/sys/pci/ahc_pci.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahc_pci.c,v 1.4 1998/12/14 05:47:25 dillon Exp $
+ * $Id: ahc_pci.c,v 1.1 1998/09/15 07:25:33 gibbs Exp $
*/
#include <pci.h>
@@ -55,7 +55,6 @@
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_sim.h>
-#include <cam/cam_xpt_sim.h>
#include <cam/scsi/scsi_all.h>
@@ -139,7 +138,7 @@ static u_int8_t read_brdctl(struct ahc_softc *ahc);
static struct ahc_softc *first_398X;
-static const char* ahc_pci_probe(pcici_t tag, pcidi_t type);
+static char* ahc_pci_probe(pcici_t tag, pcidi_t type);
static void ahc_pci_attach(pcici_t config_id, int unit);
/* Exported for use in the ahc_intr routine */
@@ -155,7 +154,7 @@ static struct pci_device ahc_pci_driver = {
DATA_SET (pcidevice_set, ahc_pci_driver);
-static const char*
+static char*
ahc_pci_probe (pcici_t tag, pcidi_t type)
{
switch (type) {
@@ -1173,6 +1172,7 @@ void
ahc_pci_intr(struct ahc_softc *ahc)
{
u_int8_t status1;
+ pcici_t config_id;
status1 = pci_cfgread(ahc->pci_config_id, PCIR_STATUS + 1, /*bytes*/1);
diff --git a/sys/pci/brktree_reg.h b/sys/pci/brktree_reg.h
index b3f9efd48bf34..9ef9aae3e5448 100644
--- a/sys/pci/brktree_reg.h
+++ b/sys/pci/brktree_reg.h
@@ -28,7 +28,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: brktree_reg.h,v 1.22 1998/09/30 21:06:54 sos Exp $
+ * $Id$
*/
#ifndef PCI_LATENCY_TIMER
#define PCI_LATENCY_TIMER 0x0c /* pci timer register */
@@ -369,12 +369,6 @@ struct format_params {
int iform_xtsel;
};
-#ifdef __FreeBSD__
-struct bktr_i2c_softc {
- device_t iicbus;
- device_t smbus;
-};
-#endif
typedef struct bktr_clip bktr_clip_t;
/*
@@ -387,9 +381,6 @@ struct bktr_softc {
struct intrhand bktr_ih; /* interrupt vectoring */
#define pcici_t pci_devaddr_t
#endif
-#ifdef __FreeBSD__
- struct bktr_i2c_softc i2c_sc; /* bt848_i2c device */
-#endif
bt848_ptr_t base; /* Bt848 register physical address */
vm_offset_t phys_base; /* Bt848 register physical address */
pcici_t tag; /* PCI tag, for doing PCI commands */
diff --git a/sys/pci/brooktree848.c b/sys/pci/brooktree848.c
index 7ad19534854a0..2801499427dda 100644
--- a/sys/pci/brooktree848.c
+++ b/sys/pci/brooktree848.c
@@ -1,4 +1,4 @@
-/* $Id: brooktree848.c,v 1.60 1998/12/07 21:58:45 archie Exp $ */
+/* $Id$ */
/* BT848 Driver for Brooktree's Bt848 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@@ -353,13 +353,7 @@
#include <machine/ioctl_meteor.h>
#include <machine/ioctl_bt848.h> /* extensions to ioctl_meteor.h */
-#include <sys/bus.h>
#include <pci/brktree_reg.h>
-#include <pci/bt848_i2c.h>
-#include <dev/smbus/smbconf.h>
-#include <dev/iicbus/iiconf.h>
-#include "smbus_if.h"
-#include "iicbus_if.h"
#include <sys/sysctl.h>
static int bt848_card = -1;
static int bt848_tuner = -1;
@@ -438,7 +432,7 @@ static bktr_reg_t brooktree[ NBKTR ];
#define MINOR(x) ((x >> 4) & 0x0f)
#define ATTACH_ARGS pcici_t tag, int unit
-static const char* bktr_probe( pcici_t tag, pcidi_t type );
+static char* bktr_probe( pcici_t tag, pcidi_t type );
static void bktr_attach( ATTACH_ARGS );
static u_long bktr_count;
@@ -1123,11 +1117,10 @@ static int readEEProm( bktr_ptr_t bktr, int offset, int count,
#ifdef __FreeBSD__
-
/*
* the boot time probe routine.
*/
-static const char*
+static char*
bktr_probe( pcici_t tag, pcidi_t type )
{
switch (type) {
@@ -1146,6 +1139,8 @@ bktr_probe( pcici_t tag, pcidi_t type )
#endif /* __FreeBSD__ */
+
+
/*
* the attach routine.
*/
@@ -1178,9 +1173,6 @@ bktr_attach( ATTACH_ARGS )
fun = pci_conf_read(tag, 0x40);
pci_conf_write(tag, 0x40, fun | 1);
- /* XXX call bt848_i2c dependent attach() routine */
- if (bt848_i2c_attach(unit, bktr->base, &bktr->i2c_sc))
- printf("bktr%d: i2c_attach: can't attach\n", unit);
#ifdef BROOKTREE_IRQ /* from the configuration file */
old_irq = pci_conf_read(tag, PCI_INTERRUPT_REG);
@@ -1940,6 +1932,7 @@ bktr_ioctl( dev_t dev, ioctl_cmd_t cmd, caddr_t arg, int flag, struct proc* pr )
static int
video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
{
+ int tmp_int;
bt848_ptr_t bt848;
volatile u_char c_temp;
unsigned int temp;
@@ -1950,6 +1943,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, int cmd, caddr_t arg, struct proc* pr )
struct meteor_video *video;
struct bktr_capture_area *cap_area;
vm_offset_t buf;
+ struct format_params *fp;
int i;
char char_temp;
@@ -2998,7 +2992,7 @@ common_ioctl( bktr_ptr_t bktr, bt848_ptr_t bt848, int cmd, caddr_t arg )
*
*/
int
-bktr_mmap( dev_t dev, vm_offset_t offset, int nprot )
+bktr_mmap( dev_t dev, int offset, int nprot )
{
int unit;
bktr_ptr_t bktr;
@@ -4167,55 +4161,6 @@ static int oformat_meteor_to_bt( u_long format )
BT848_DATA_CTL_I2CSCL | \
BT848_DATA_CTL_I2CSDA)
-#if defined(__FreeBSD__)
-
-/*
- * The hardware interface is actually SMB commands
- */
-static int
-i2cWrite( bktr_ptr_t bktr, int addr, int byte1, int byte2 )
-{
- char cmd;
-
- if (bktr->id == BROOKTREE_848_ID ||
- bktr->id == BROOKTREE_849_ID)
- cmd = I2C_COMMAND;
- else
- cmd = I2C_COMMAND_878;
-
- if (byte2 != -1) {
- if (smbus_writew(bktr->i2c_sc.smbus, addr, cmd,
- (short)(((byte2 & 0xff) << 8) | (byte1 & 0xff))))
- return (-1);
- } else {
- if (smbus_writeb(bktr->i2c_sc.smbus, addr, cmd,
- (char)(byte1 & 0xff)))
- return (-1);
- }
-
- /* return OK */
- return( 0 );
-}
-
-static int
-i2cRead( bktr_ptr_t bktr, int addr )
-{
- char result;
- char cmd;
-
- if (bktr->id == BROOKTREE_848_ID ||
- bktr->id == BROOKTREE_849_ID)
- cmd = I2C_COMMAND;
- else
- cmd = I2C_COMMAND_878;
-
- if (smbus_readb(bktr->i2c_sc.smbus, addr, cmd, &result))
- return (-1);
-
- return ((int)result);
-}
-
-#else /* defined(__FreeBSD__) */
/*
*
@@ -4300,8 +4245,6 @@ i2cRead( bktr_ptr_t bktr, int addr )
return( (bt848->i2c_data_ctl >> 8) & 0xff );
}
-#endif /* !define(__FreeBSD__) */
-
#if defined( I2C_SOFTWARE_PROBE )
/*
@@ -4418,8 +4361,6 @@ readEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data )
return( 0 );
}
-#define ABSENT (-1)
-
/*
* get a signature of the card
* read all 128 possible i2c read addresses from 0x01 thru 0xff
@@ -4427,6 +4368,7 @@ readEEProm( bktr_ptr_t bktr, int offset, int count, u_char *data )
*
* XXX FIXME: use offset & count args
*/
+#define ABSENT (-1)
static int
signCard( bktr_ptr_t bktr, int offset, int count, u_char* sig )
{
@@ -4482,6 +4424,8 @@ static int locate_tuner_address( bktr_ptr_t bktr) {
if (i2cRead( bktr, 0xc7) != ABSENT) return 0xc6;
return -1; /* no tuner found */
}
+
+#undef ABSENT
/*
* determine the card brand/model
@@ -4489,11 +4433,12 @@ static int locate_tuner_address( bktr_ptr_t bktr) {
* can be used to select a specific device, regardless of the
* autodetection and i2c device checks.
*/
+#define ABSENT (-1)
static void
probeCard( bktr_ptr_t bktr, int verbose )
{
int card, i,j, card_found;
- int status;
+ int status, *test;
bt848_ptr_t bt848;
u_char probe_signature[128], *probe_temp;
int any_i2c_devices;
@@ -4735,6 +4680,7 @@ checkMSP:
checkEnd:
+checkPLL:
#if defined( BKTR_USE_PLL )
bktr->xtal_pll_mode = BT848_USE_PLL;
goto checkPLLEnd;
@@ -4745,9 +4691,7 @@ checkEnd:
if ((card == CARD_HAUPPAUGE) &&
(bktr->id==BROOKTREE_878_ID || bktr->id==BROOKTREE_879_ID) )
bktr->xtal_pll_mode = BT848_USE_PLL;
-#if defined( BKTR_USE_PLL )
checkPLLEnd:
-#endif
bktr->card.tuner_pllAddr = tuner_i2c_address;
diff --git a/sys/pci/bt848_i2c.c b/sys/pci/bt848_i2c.c
deleted file mode 100644
index 176d069a837fb..0000000000000
--- a/sys/pci/bt848_i2c.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*-
- * Copyright (c) 1998 Nicolas Souchu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: bt848_i2c.c,v 1.1 1998/10/31 11:26:38 nsouch Exp $
- *
- */
-
-/*
- * I2C support for the bti2c chipset.
- *
- * From brooktree848.c <fsmp@freefall.org>
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/buf.h>
-#include <sys/uio.h>
-#include <sys/malloc.h>
-
-#include <machine/clock.h>
-
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-#include <machine/ioctl_meteor.h>
-#include <machine/ioctl_bt848.h> /* extensions to ioctl_meteor.h */
-#include <pci/brktree_reg.h>
-
-#include <pci/bt848_i2c.h>
-
-#include <dev/iicbus/iiconf.h>
-#include <dev/iicbus/iicbus.h>
-
-#include <dev/smbus/smbconf.h>
-
-#include "iicbb_if.h"
-#include "smbus_if.h"
-
-#include "pci.h"
-#include "bktr.h"
-
-#if (NBKTR > 0 && NPCI > 0)
-
-#define I2C_DELAY 40
-
-#define BTI2C_DEBUG(x) if (bti2c_debug) (x)
-static int bti2c_debug = 0;
-
-struct bti2c_softc {
-
- bt848_ptr_t base;
-
- int iic_owned; /* 1 if we own the iicbus */
- int smb_owned; /* 1 if we own the smbbus */
-
- device_t smbus;
- device_t iicbus;
-};
-
-struct bt_data {
- bt848_ptr_t base;
-};
-struct bt_data btdata[NBKTR];
-
-static int bti2c_probe(device_t);
-static int bti2c_attach(device_t);
-static void bti2c_print_child(device_t, device_t);
-
-static int bti2c_iic_callback(device_t, int, caddr_t *);
-static void bti2c_iic_setlines(device_t, int, int);
-static int bti2c_iic_getdataline(device_t);
-static int bti2c_iic_reset(device_t, u_char, u_char, u_char *);
-
-static int bti2c_smb_callback(device_t, int, caddr_t *);
-static int bti2c_smb_writeb(device_t dev, u_char slave, char cmd, char byte);
-static int bti2c_smb_writew(device_t dev, u_char slave, char cmd, short word);
-static int bti2c_smb_readb(device_t dev, u_char slave, char cmd, char *byte);
-
-static devclass_t bti2c_devclass;
-
-static device_method_t bti2c_methods[] = {
- /* device interface */
- DEVMETHOD(device_probe, bti2c_probe),
- DEVMETHOD(device_attach, bti2c_attach),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, bti2c_print_child),
-
- /* iicbb interface */
- DEVMETHOD(iicbb_callback, bti2c_iic_callback),
- DEVMETHOD(iicbb_setlines, bti2c_iic_setlines),
- DEVMETHOD(iicbb_getdataline, bti2c_iic_getdataline),
- DEVMETHOD(iicbb_reset, bti2c_iic_reset),
-
- /* smbus interface */
- DEVMETHOD(smbus_callback, bti2c_smb_callback),
- DEVMETHOD(smbus_writeb, bti2c_smb_writeb),
- DEVMETHOD(smbus_writew, bti2c_smb_writew),
- DEVMETHOD(smbus_readb, bti2c_smb_readb),
-
- { 0, 0 }
-};
-
-static driver_t bti2c_driver = {
- "bti2c",
- bti2c_methods,
- DRIVER_TYPE_MISC,
- sizeof(struct bti2c_softc),
-};
-
-/*
- * Call this to pass the base address of the bktr device to the
- * bti2c_i2c layer and initialize all the I2C bus architecture
- */
-int
-bt848_i2c_attach(int unit, bt848_ptr_t base, struct bktr_i2c_softc *i2c_sc)
-{
- device_t interface;
- device_t bitbang;
-
- btdata[unit].base = base;
-
- /* XXX add the I2C interface to the root_bus until pcibus is ready */
- interface = device_add_child(root_bus, "bti2c", unit, NULL);
-
- /* add bit-banging generic code onto bti2c interface */
- bitbang = device_add_child(interface, "iicbb", -1, NULL);
-
- /* probe and attach the interface, we need it NOW
- * bit-banging code is also probed and attached */
- device_probe_and_attach(interface);
- device_probe_and_attach(bitbang);
-
- /* smb and i2c interfaces are available for the bt848 chip
- * connect bit-banging generic code to an iicbus */
- if ((i2c_sc->iicbus = iicbus_alloc_bus(bitbang)))
- device_probe_and_attach(i2c_sc->iicbus);
-
- /* hardware i2c is actually smb over the bti2c interface */
- if ((i2c_sc->smbus = smbus_alloc_bus(interface)))
- device_probe_and_attach(i2c_sc->smbus);
-
- return (0);
-};
-
-/*
- * Not a real probe, we know the device exists since the device has
- * been added after the successfull pci probe.
- */
-static int
-bti2c_probe(device_t dev)
-{
- device_set_desc(dev, "bt848 Hard/Soft I2C controller");
-
- return (0);
-}
-
-static int
-bti2c_attach(device_t dev)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
-
- /* XXX should use ivars with pcibus or pcibus methods to access
- * onboard memory */
- sc->base = btdata[device_get_unit(dev)].base;
-
- return (0);
-}
-
-static void
-bti2c_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
-static int
-bti2c_smb_callback(device_t dev, int index, caddr_t *data)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- int error = 0;
- int how;
-
- /* test each time if we already have/haven't the iicbus
- * to avoid deadlocks
- */
- switch (index) {
- case SMB_REQUEST_BUS:
- if (!sc->iic_owned) {
- /* request the iicbus */
- how = *(int *)data;
- error = iicbus_request_bus(sc->iicbus, dev, how);
- if (!error)
- sc->iic_owned = 1;
- }
- break;
-
- case SMB_RELEASE_BUS:
- if (sc->iic_owned) {
- /* release the iicbus */
- error = iicbus_release_bus(sc->iicbus, dev);
- if (!error)
- sc->iic_owned = 0;
- }
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-static int
-bti2c_iic_callback(device_t dev, int index, caddr_t *data)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- int error = 0;
- int how;
-
- /* test each time if we already have/haven't the smbus
- * to avoid deadlocks
- */
- switch (index) {
- case IIC_REQUEST_BUS:
- if (!sc->smb_owned) {
- /* request the smbus */
- how = *(int *)data;
- error = smbus_request_bus(sc->smbus, dev, how);
- if (!error)
- sc->smb_owned = 1;
- }
- break;
-
- case IIC_RELEASE_BUS:
- if (sc->smb_owned) {
- /* release the smbus */
- error = smbus_release_bus(sc->smbus, dev);
- if (!error)
- sc->smb_owned = 0;
- }
- break;
-
- default:
- error = EINVAL;
- }
-
- return (error);
-}
-
-static int
-bti2c_iic_reset(device_t dev, u_char speed, u_char addr, u_char * oldaddr)
-{
- if (oldaddr)
- *oldaddr = 0; /* XXX */
-
- return (IIC_ENOADDR);
-}
-
-static void
-bti2c_iic_setlines(device_t dev, int ctrl, int data)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- bt848_ptr_t bti2c;
-
- bti2c = sc->base;
-
- bti2c->i2c_data_ctl = (ctrl << 1) | data;
- DELAY(I2C_DELAY);
-
- return;
-}
-
-static int
-bti2c_iic_getdataline(device_t dev)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- bt848_ptr_t bti2c;
-
- bti2c = sc->base;
-
- return (bti2c->i2c_data_ctl & 0x1);
-}
-
-static int
-bti2c_write(bt848_ptr_t bti2c, u_long data)
-{
- u_long x;
-
- /* clear status bits */
- bti2c->int_stat = (BT848_INT_RACK | BT848_INT_I2CDONE);
-
- BTI2C_DEBUG(printf("w%lx", data));
-
- /* write the address and data */
- bti2c->i2c_data_ctl = data;
-
- /* wait for completion */
- for ( x = 0x7fffffff; x; --x ) { /* safety valve */
- if ( bti2c->int_stat & BT848_INT_I2CDONE )
- break;
- }
-
- /* check for ACK */
- if ( !x || !(bti2c->int_stat & BT848_INT_RACK) ) {
- BTI2C_DEBUG(printf("%c%c", (!x)?'+':'-',
- (!(bti2c->int_stat & BT848_INT_RACK))?'+':'-'));
- return (SMB_ENOACK);
- }
- BTI2C_DEBUG(printf("+"));
-
- /* return OK */
- return( 0 );
-}
-
-static int
-bti2c_smb_writeb(device_t dev, u_char slave, char cmd, char byte)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- u_long data;
-
- data = ((slave & 0xff) << 24) | ((byte & 0xff) << 16) | (u_char)cmd;
-
- return (bti2c_write(sc->base, data));
-}
-
-/*
- * byte1 becomes low byte of word
- * byte2 becomes high byte of word
- */
-static int
-bti2c_smb_writew(device_t dev, u_char slave, char cmd, short word)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- u_long data;
- char low, high;
-
- low = (char)(word & 0xff);
- high = (char)((word & 0xff00) >> 8);
-
- data = ((slave & 0xff) << 24) | ((low & 0xff) << 16) |
- ((high & 0xff) << 8) | BT848_DATA_CTL_I2CW3B | (u_char)cmd;
-
- return (bti2c_write(sc->base, data));
-}
-
-/*
- * The Bt878 and Bt879 differed on the treatment of i2c commands
- */
-static int
-bti2c_smb_readb(device_t dev, u_char slave, char cmd, char *byte)
-{
- struct bti2c_softc *sc = (struct bti2c_softc *)device_get_softc(dev);
- bt848_ptr_t bti2c;
- u_long x;
-
- bti2c = sc->base;
-
- /* clear status bits */
- bti2c->int_stat = (BT848_INT_RACK | BT848_INT_I2CDONE);
-
- bti2c->i2c_data_ctl = ((slave & 0xff) << 24) | (u_char)cmd;
-
- BTI2C_DEBUG(printf("r%lx/", (u_long)(((slave & 0xff) << 24) | (u_char)cmd)));
-
- /* wait for completion */
- for ( x = 0x7fffffff; x; --x ) { /* safety valve */
- if ( bti2c->int_stat & BT848_INT_I2CDONE )
- break;
- }
-
- /* check for ACK */
- if ( !x || !(bti2c->int_stat & BT848_INT_RACK) ) {
- BTI2C_DEBUG(printf("r%c%c", (!x)?'+':'-',
- (!(bti2c->int_stat & BT848_INT_RACK))?'+':'-'));
- return (SMB_ENOACK);
- }
-
- *byte = (char)((bti2c->i2c_data_ctl >> 8) & 0xff);
- BTI2C_DEBUG(printf("r%x+", *byte));
-
- return (0);
-}
-
-DRIVER_MODULE(bti2c, root, bti2c_driver, bti2c_devclass, 0, 0);
-#endif
diff --git a/sys/pci/bt_pci.c b/sys/pci/bt_pci.c
index 3c886d86a4622..028624592c29a 100644
--- a/sys/pci/bt_pci.c
+++ b/sys/pci/bt_pci.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt_pci.c,v 1.3 1998/11/10 06:45:14 gibbs Exp $
+ * $Id$
*/
#include "pci.h"
@@ -53,7 +53,7 @@
static int btpcideterminebusspace(pcici_t config_id, bus_space_tag_t* tagp,
bus_space_handle_t* bshp);
-static const char* bt_pci_probe(pcici_t tag, pcidi_t type);
+static char* bt_pci_probe(pcici_t tag, pcidi_t type);
static void bt_pci_attach(pcici_t config_id, int unit);
static struct pci_device bt_pci_driver = {
@@ -98,7 +98,7 @@ btpcideterminebusspace(pcici_t config_id, bus_space_tag_t* tagp,
return (0);
}
-static const char*
+static char*
bt_pci_probe (pcici_t config_id, pcidi_t type)
{
switch(type) {
@@ -110,6 +110,7 @@ bt_pci_probe (pcici_t config_id, pcidi_t type)
bus_space_handle_t bsh;
pci_info_data_t pci_info;
int error;
+ u_int8_t new_addr;
if (btpcideterminebusspace(config_id, &tag, &bsh) != 0)
break;
@@ -121,8 +122,7 @@ bt_pci_probe (pcici_t config_id, pcidi_t type)
/*
* Determine if an ISA compatible I/O port has been
* enabled. If so, record the port so it will not
- * be probed by our ISA probe. If the PCI I/O port
- * was not set to the compatibility port, disable it.
+ * be probed by our ISA probe, and disable the port.
*/
error = bt_cmd(bt, BOP_INQUIRE_PCI_INFO,
/*param*/NULL, /*paramlen*/0,
@@ -131,19 +131,14 @@ bt_pci_probe (pcici_t config_id, pcidi_t type)
if (error == 0
&& pci_info.io_port < BIO_DISABLED) {
bt_mark_probed_bio(pci_info.io_port);
- if (bsh != bt_iop_from_bio(pci_info.io_port)) {
- u_int8_t new_addr;
-
- new_addr = BIO_DISABLED;
- bt_cmd(bt, BOP_MODIFY_IO_ADDR,
- /*param*/&new_addr,
- /*paramlen*/1, /*reply_buf*/NULL,
- /*reply_len*/0,
- DEFAULT_CMD_TIMEOUT);
- }
}
+
+ new_addr = BIO_DISABLED;
+ bt_cmd(bt, BOP_MODIFY_IO_ADDR, /*param*/&new_addr,
+ /*paramlen*/1, /*reply_buf*/NULL, /*reply_len*/0,
+ DEFAULT_CMD_TIMEOUT);
bt_free(bt);
- return ("Buslogic Multi-Master SCSI Host Adapter");
+ return ("Buslogic Multimaster SCSI host adapter");
break;
}
default:
diff --git a/sys/pci/cy_pci.c b/sys/pci/cy_pci.c
index 7113155e7cb52..ae48965f69e69 100644
--- a/sys/pci/cy_pci.c
+++ b/sys/pci/cy_pci.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cy_pci.c,v 1.9 1999/01/11 23:43:54 bde Exp $
+ * $Id: cy_pci.c,v 1.5 1997/02/22 09:44:00 peter Exp $
*/
/*
@@ -34,11 +34,8 @@
#include "pci.h"
#if NPCI > 0
-#include "opt_cy_pci_fastintr.h"
-
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -47,7 +44,7 @@
#include <pci/cy_pcireg.h>
-static const char *cy_probe __P((pcici_t, pcidi_t));
+static char *cy_probe __P((pcici_t, pcidi_t));
static void cy_attach __P((pcici_t, int));
extern int cyattach_common(void *, int); /* Not exactly correct */
@@ -64,7 +61,7 @@ static struct pci_device cy_device = {
};
DATA_SET(pcidevice_set, cy_device);
-static const char *
+static char *
cy_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -85,7 +82,6 @@ cy_attach(config_id, unit)
void *vaddr;
u_int32_t ioport;
int adapter;
- u_char plx_ver;
ioport = (u_int32_t) pci_conf_read(config_id, CY_PCI_BASE_ADDR1) & ~0x3;
paddr = pci_conf_read(config_id, CY_PCI_BASE_ADDR2) & ~0xf;
@@ -115,37 +111,16 @@ cy_attach(config_id, unit)
* since the ISA driver must handle the interrupt anyway, we use
* the unit number as the token even for PCI.
*/
- if (
-#ifdef CY_PCI_FASTINTR
- !pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
- (void *)adapter, &tty_imask,
- INTR_EXCL | INTR_FAST) &&
-#endif
- !pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
- (void *)adapter, &tty_imask, 0)) {
+ if (!pci_map_int(config_id, (pci_inthand_t *)cyintr, (void *)adapter, &tty_imask)) {
printf("cy%d: couldn't map interrupt\n", unit);
goto fail;
}
-
/*
* Enable the "local" interrupt input to generate a
* PCI interrupt.
*/
- plx_ver = *((u_char *)vaddr + PLX_VER) & 0x0f;
- switch (plx_ver) {
- case PLX_9050:
- outw(ioport + CY_PLX_9050_ICS,
- inw(ioport + CY_PLX_9050_ICS) | CY_PLX_9050_ICS_IENABLE |
- CY_PLX_9050_ICS_LOCAL_IENABLE);
- break;
- case PLX_9060:
- case PLX_9080:
- default: /* Old board, use PLX_9060 values. */
- outw(ioport + CY_PLX_9060_ICS,
- inw(ioport + CY_PLX_9060_ICS) | CY_PLX_9060_ICS_IENABLE |
- CY_PLX_9060_ICS_LOCAL_IENABLE);
- break;
- }
+ outw(ioport + CY_PLX_ICS, inw(ioport + CY_PLX_ICS) |
+ CY_PLX_ICS_IENABLE | CY_PLX_ICS_LOCAL_IENABLE);
return;
diff --git a/sys/pci/cy_pcireg.h b/sys/pci/cy_pcireg.h
index cc3bb60eb0041..412622fe422e7 100644
--- a/sys/pci/cy_pcireg.h
+++ b/sys/pci/cy_pcireg.h
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cy_pcireg.h,v 1.4 1999/01/11 23:35:01 bde Exp $
+ * $Id$
*/
#define CY_VENDORID_CYCLADES 0x120e
@@ -35,15 +35,6 @@
#define CY_PCI_BASE_ADDR1 0x14
#define CY_PCI_BASE_ADDR2 0x18
-#define CY_PLX_9050_ICS 0x4c
-#define CY_PLX_9060_ICS 0x68
-#define CY_PLX_9050_ICS_IENABLE 0x040
-#define CY_PLX_9050_ICS_LOCAL_IENABLE 0x001
-#define CY_PLX_9060_ICS_IENABLE 0x100
-#define CY_PLX_9060_ICS_LOCAL_IENABLE 0x800
-
-/* Cyclom-Y Custom Register for PLX ID. */
-#define PLX_VER 0x3400
-#define PLX_9050 0x0b
-#define PLX_9060 0x0c
-#define PLX_9080 0x0d
+#define CY_PLX_ICS 0x68
+#define CY_PLX_ICS_IENABLE 0x100
+#define CY_PLX_ICS_LOCAL_IENABLE 0x800
diff --git a/sys/pci/dpt_pci.c b/sys/pci/dpt_pci.c
index 7bf0e26e3138e..7af9a2aece849 100644
--- a/sys/pci/dpt_pci.c
+++ b/sys/pci/dpt_pci.c
@@ -32,7 +32,7 @@
* dptpci.c: PCI Bus Attachment for DPT SCSI HBAs
*/
-#ident "$Id: dpt_pci.c,v 1.10 1998/12/07 21:58:46 archie Exp $"
+#ident "$Id: dpt_pci.c,v 1.8 1998/09/15 08:33:38 gibbs Exp $"
#include "opt_devfs.h"
#include "opt_dpt.h"
@@ -64,7 +64,7 @@
/* Function Prototypes */
-static const char *dpt_pci_probe(pcici_t tag, pcidi_t type);
+static char *dpt_pci_probe(pcici_t tag, pcidi_t type);
static void dpt_pci_attach(pcici_t config_id, int unit);
extern struct cdevsw dpt_cdevsw;
@@ -86,7 +86,7 @@ DATA_SET(pcidevice_set, dpt_pci_driver);
* because we do not know for sure how the two relate.
*/
-static const char *
+static char *
dpt_pci_probe(pcici_t tag, pcidi_t type)
{
u_int32_t class;
@@ -112,13 +112,14 @@ dpt_pci_attach(pcici_t config_id, int unit)
{
dpt_softc_t *dpt;
vm_offset_t vaddr;
-#ifdef DPT_ALLOW_MEMIO
vm_offset_t paddr;
-#endif
u_int16_t io_base;
bus_space_tag_t tag;
bus_space_handle_t bsh;
u_int32_t command;
+ u_int32_t data;
+ int result;
+ int ndx;
int s;
vaddr = NULL;
diff --git a/sys/pci/es1370.c b/sys/pci/es1370.c
deleted file mode 100644
index 7277e7ab14811..0000000000000
--- a/sys/pci/es1370.c
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*
- * Support the ENSONIQ AudioPCI board based on the ES1370 and Codec
- * AK4531.
- *
- * Copyright (c) 1998 by Joachim Kuebart. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgement:
- * This product includes software developed by Joachim Kuebart.
- *
- * 4. The name of the author may not be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id$
- */
-
-#include "pci.h"
-#include "pcm.h"
-
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/kernel.h>
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#include <pci/es1370_reg.h>
-#include <i386/isa/snd/sound.h>
-#include <i386/isa/snd/ulaw.h>
-
-#if NPCI != 0
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * #defines
- */
-
-#ifdef __alpha__
-#define IO_SPACE_MAPPING ALPHA_BUS_SPACE_IO
-#define MEM_SPACE_MAPPING ALPHA_BUS_SPACE_MEM
-#else /* not __alpha__ */
-#define IO_SPACE_MAPPING I386_BUS_SPACE_IO
-#define MEM_SPACE_MAPPING I386_BUS_SPACE_MEM
-#endif /* not __alpha__ */
-
-#define DMA_ALIGN_THRESHOLD 4
-#define DMA_ALIGN_MASK (~(DMA_ALIGN_THRESHOLD - 1))
-#define DMA_READ_THRESHOLD 0x200
-
-#define MEM_MAP_REG 0x14
-
-#define UNIT(minor) ((minor) >> 4)
-#define DEV(minor) ((minor) & 0xf)
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * PCI IDs of supported chips
- */
-
-#define ES1370_PCI_ID 0x50001274
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * device private data
- */
-
-struct es_info {
- bus_space_tag_t st;
- bus_space_handle_t sh;
-
- bus_dma_tag_t parent_dmat;
- bus_dmamap_t dmam_in, dmam_out;
-
- /* Contents of board's registers */
- u_long ctrl;
- u_long sctrl;
-};
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * prototypes
- */
-
-static void dma_wrintr(snddev_info *);
-static void dma_rdintr(snddev_info *);
-static int es_init(snddev_info *);
-static snd_callback_t es_callback;
-static d_open_t es_dsp_open;
-static d_close_t es_dsp_close;
-static d_ioctl_t es_dsp_ioctl;
-static d_read_t es_dsp_read;
-static d_write_t es_dsp_write;
-static void es_intr(void *);
-static int es_rdabort(snddev_info *);
-static void es_rd_map(void *, bus_dma_segment_t *, int, int);
-static int es_wrabort(snddev_info *);
-static void es_wr_map(void *, bus_dma_segment_t *, int, int);
-static char *es_pci_probe __P((pcici_t, pcidi_t));
-static void es_pci_attach __P((pcici_t, int));
-static int es_rd_dmaupdate(snddev_info *);
-static d_select_t es_select;
-static int es_wr_dmaupdate(snddev_info *);
-static int alloc_dmabuf(snddev_info *, int);
-static int write_codec(snddev_info *, u_char, u_char);
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * PCI driver and PCM driver method tables
- */
-
-static struct pci_device es_pci_driver = {
- "es",
- es_pci_probe,
- es_pci_attach,
- &nsnd,
- NULL
-};
-
-DATA_SET(pcidevice_set, es_pci_driver);
-
-static snddev_info es_op_desc = {
- "ENSONIQ AudioPCI",
-
- 0, /* type, apparently unused */
- NULL, /* ISA probe */
- NULL, /* ISA attach */
-
- es_dsp_open,
- es_dsp_close,
- es_dsp_read,
- es_dsp_write,
- es_dsp_ioctl,
- es_select,
-
- NULL, /* Interrupt Service Routine */
- es_callback,
-
- ES_BUFFSIZE,
-
- AFMT_FULLDUPLEX | AFMT_STEREO | AFMT_U8 | AFMT_S16_LE, /* brag :-) */
-};
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * The mixer interface
- */
-
-static const struct {
- unsigned volidx:4;
- unsigned left:4;
- unsigned right:4;
- unsigned stereo:1;
- unsigned recmask:13;
- unsigned avail:1;
-} mixtable[SOUND_MIXER_NRDEVICES] = {
- [SOUND_MIXER_VOLUME] = { 0, 0x0, 0x1, 1, 0x0000, 1 },
- [SOUND_MIXER_PCM] = { 1, 0x2, 0x3, 1, 0x0400, 1 },
- [SOUND_MIXER_SYNTH] = { 2, 0x4, 0x5, 1, 0x0060, 1 },
- [SOUND_MIXER_CD] = { 3, 0x6, 0x7, 1, 0x0006, 1 },
- [SOUND_MIXER_LINE] = { 4, 0x8, 0x9, 1, 0x0018, 1 },
- [SOUND_MIXER_LINE1] = { 5, 0xa, 0xb, 1, 0x1800, 1 },
- [SOUND_MIXER_LINE2] = { 6, 0xc, 0x0, 0, 0x0100, 1 },
- [SOUND_MIXER_LINE3] = { 7, 0xd, 0x0, 0, 0x0200, 1 },
- [SOUND_MIXER_MIC] = { 8, 0xe, 0x0, 0, 0x0001, 1 },
- [SOUND_MIXER_OGAIN] = { 9, 0xf, 0x0, 0, 0x0000, 1 } };
-
-static int
-mixer_ioctl(snddev_info *d, u_long cmd, caddr_t data, int fflag, struct proc *p)
-{
- int i, j, *val, ret = 0;
-
- val = (int *)data;
- i = cmd & 0xff;
-
- switch (cmd & IOC_DIRMASK) {
- case IOC_IN | IOC_OUT: /* _IOWR */
- switch (i) {
- case SOUND_MIXER_RECSRC:
- for (i = j = 0; i != SOUND_MIXER_NRDEVICES; i++)
- if ((*val & (1 << i)) != 0) {
- if (!mixtable[i].recmask)
- *val &= ~(1 << i);
- else
- j |= mixtable[i].recmask;
- }
- d->mix_recsrc = *val;
- write_codec(d, CODEC_LIMIX1, j & 0x55);
- write_codec(d, CODEC_RIMIX1, j & 0xaa);
- write_codec(d, CODEC_LIMIX2, (j >> 8) & 0x17);
- write_codec(d, CODEC_RIMIX2, (j >> 8) & 0x0f);
- write_codec(d, CODEC_OMIX1, 0x7f);
- write_codec(d, CODEC_OMIX2, 0x3f);
- break;
-
- default:
- if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].avail)
- ret = EINVAL;
- else {
- int l, r, rl, rr;
-
- l = *val & 0xff;
- if (l > 100)
- l = 100;
- if (mixtable[i].left == 0xf) {
- if (l < 2)
- rl = 0x80;
- else
- rl = 7 - (l - 2) / 14;
- } else {
- if (l < 10)
- rl = 0x80;
- else
- rl = 15 - (l - 10) / 6;
- }
- if (mixtable[i].stereo) {
- r = (*val >> 8) & 0xff;
- if (r > 100)
- r = 100;
- if (r < 10)
- rr = 0x80;
- else
- rr = 15 - (r - 10) / 6;
- write_codec(d, mixtable[i].right, rr);
- } else
- r = l;
- write_codec(d, mixtable[i].left, rl);
- *val = d->mix_levels[i] = ((u_int) r << 8) | l;
- }
- break;
- }
- break;
-
- default:
- ret = ENOSYS;
- break;
- }
-
- return (ret);
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * File operations
- */
-
-static int
-es_dsp_open(dev_t dev, int oflags, int devtype, struct proc *p)
-{
- int unit = UNIT(minor(dev));
- snddev_info *d = &pcm_info[unit];
-
- if (d->flags & SND_F_BUSY)
- return (EBUSY);
- d->flags = 0;
-
- d->dbuf_out.total = d->dbuf_out.prev_total =
- d->dbuf_in.total = d->dbuf_in.prev_total = 0;
-
- switch (DEV(minor(dev))) {
- case SND_DEV_DSP16:
- d->play_fmt = d->rec_fmt = AFMT_S16_LE;
- break;
-
- case SND_DEV_DSP:
- d->play_fmt = d->rec_fmt = AFMT_U8;
- break;
-
- case SND_DEV_AUDIO:
- d->play_fmt = d->rec_fmt = AFMT_MU_LAW;
- break;
-
- default:
- return (ENXIO);
- }
-
- if ((oflags & FREAD) == 0)
- d->rec_fmt = 0;
- else if ((oflags & FWRITE) == 0)
- d->play_fmt = 0;
-
- d->play_speed = d->rec_speed = DSP_DEFAULT_SPEED;
-
- d->flags |= SND_F_BUSY;
- if (oflags & O_NONBLOCK)
- d->flags |= SND_F_NBIO;
-
- ask_init(d);
-
- return (0);
-}
-
-static int
-es_dsp_close(dev_t dev, int cflags, int devtype, struct proc *p)
-{
- int unit = UNIT(minor(dev));
- snddev_info *d = &pcm_info[unit];
-
- d->flags &= ~SND_F_BUSY;
-
- es_rdabort(d);
-
- return (0);
-}
-
-static int
-es_dsp_read(dev_t dev, struct uio *buf, int flag)
-{
- int l, l1, limit, ret = 0, unit = UNIT(minor(dev));
- long s;
- snddev_info *d = &pcm_info[unit];
- snd_dbuf *b = &d->dbuf_in;
-
- if (d->flags & SND_F_READING) {
- /* This shouldn't happen and is actually silly */
- tsleep(&s, PZERO, "sndar", hz);
- return (EBUSY);
- }
- d->flags |= SND_F_READING;
-
- /*
- * XXX Check for SND_F_INIT. If set, wait for DMA to run empty and
- * re-initialize the board
- */
-
- if (buf->uio_resid - d->rec_blocksize > 0)
- limit = buf->uio_resid - d->rec_blocksize;
- else
- limit = 0;
-
- while ((l = buf->uio_resid) > limit) {
- s = spltty();
- es_rd_dmaupdate(d);
- if ((l = min(l, b->rl)) == 0) {
- int timeout;
- if (b->dl == 0)
- dma_rdintr(d);
- if (d->flags & SND_F_NBIO) {
- splx(s);
- break;
- }
- if (buf->uio_resid - limit > b->dl)
- timeout = hz;
- else
- timeout = 1;
- splx(s);
- switch (ret = tsleep((caddr_t)b, PRIBIO | PCATCH,
- "dsprd", timeout)) {
- case EINTR:
- es_rdabort(d);
- /* FALLTHROUGH */
-
- case ERESTART:
- break;
-
- default:
- continue;
- }
- break;
- }
- splx(s);
-
- if ((l1 = b->bufsize - b->rp) < l) {
- if (d->flags & SND_F_XLAT8) {
- translate_bytes(ulaw_dsp, b->buf + b->rp, l1);
- translate_bytes(ulaw_dsp, b->buf, l - l1);
- }
- uiomove(b->buf + b->rp, l1, buf);
- uiomove(b->buf, l - l1, buf);
- } else {
- if (d->flags & SND_F_XLAT8)
- translate_bytes(ulaw_dsp, b->buf + b->rp, l);
- uiomove(b->buf + b->rp, l, buf);
- }
-
- s = spltty();
- b->fl += l;
- b->rl -= l;
- b->rp = (b->rp + l) % b->bufsize;
- splx(s);
- }
-
- d->flags &= ~SND_F_READING;
-
- return (ret);
-}
-
-static int
-es_dsp_write(dev_t dev, struct uio *buf, int flag)
-{
- int l, l1, ret = 0, unit = UNIT(minor(dev));
- long s;
- snddev_info *d = &pcm_info[unit];
- snd_dbuf *b = &d->dbuf_out;
-
- if (d->flags & SND_F_WRITING) {
- /* This shouldn't happen and is actually silly */
- tsleep(&s, PZERO, "sndaw", hz);
- return (EBUSY);
- }
- d->flags |= SND_F_WRITING;
-
- /*
- * XXX Check for SND_F_INIT. If set, wait for DMA to run empty and
- * re-initialize the board
- */
-
- while ((l = buf->uio_resid) != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- if ((l = min(l, b->fl)) == 0) {
- int timeout;
- if (d->flags & SND_F_NBIO) {
- splx(s);
- break;
- }
- if (buf->uio_resid >= b->dl)
- timeout = hz;
- else
- timeout = 1;
- splx(s);
- switch (ret = tsleep((caddr_t)b, PRIBIO | PCATCH,
- "dspwr", timeout)) {
- case EINTR:
- es_wrabort(d);
- /* FALLTHROUGH */
-
- case ERESTART:
- break;
-
- default:
- continue;
- }
- break;
- }
- splx(s);
-
- if ((l1 = b->bufsize - b->fp) < l) {
- uiomove(b->buf + b->fp, l1, buf);
- uiomove(b->buf, l - l1, buf);
- if (d->flags & SND_F_XLAT8) {
- translate_bytes(ulaw_dsp, b->buf + b->fp, l1);
- translate_bytes(ulaw_dsp, b->buf, l - l1);
- }
- } else {
- uiomove(b->buf + b->fp, l, buf);
- if (d->flags & SND_F_XLAT8)
- translate_bytes(ulaw_dsp, b->buf + b->fp, l);
- }
-
- s = spltty();
- b->rl += l;
- b->fl -= l;
- b->fp = (b->fp + l) % b->bufsize;
- if (b->dl == 0)
- dma_wrintr(d);
- splx(s);
- }
-
- d->flags &= ~SND_F_WRITING;
-
- return (ret);
-}
-
-static int
-es_dsp_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
-{
- int ret = 0, unit = UNIT(minor(dev));
- snddev_info *d = &pcm_info[unit];
- long s;
-
- if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0))
- return mixer_ioctl(d, cmd, data, fflag, p);
-
- switch(cmd) {
- case AIONWRITE:
- if (d->dbuf_out.dl != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- splx(s);
- }
- *(int *)data = d->dbuf_out.fl;
- break;
-
- case FIONREAD:
- if (d->dbuf_in.dl != 0) {
- s = spltty();
- es_rd_dmaupdate(d);
- splx(s);
- }
- *(int *)data = d->dbuf_in.rl;
- break;
-
- case SNDCTL_DSP_GETISPACE:
- {
- audio_buf_info *a = (audio_buf_info *)data;
- snd_dbuf *b = &d->dbuf_in;
- if (b->dl != 0) {
- s = spltty();
- es_rd_dmaupdate(d);
- splx(s);
- }
- a->bytes = b->fl;
- a->fragments = b->fl / d->rec_blocksize;
- a->fragstotal = b->bufsize / d->rec_blocksize;
- a->fragsize = d->rec_blocksize;
- }
- break;
-
- case SNDCTL_DSP_GETOSPACE:
- {
- audio_buf_info *a = (audio_buf_info *)data;
- snd_dbuf *b = &d->dbuf_out;
- if (b->dl != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- splx(s);
- }
- a->bytes = b->fl;
- a->fragments = b->fl / d->rec_blocksize;
- a->fragstotal = b->bufsize / d->play_blocksize;
- a->fragsize = d->play_blocksize;
- }
- break;
-
- case SNDCTL_DSP_GETIPTR:
- {
- count_info *c = (count_info *)data;
- snd_dbuf *b = &d->dbuf_in;
- if (b->dl != 0) {
- s = spltty();
- es_rd_dmaupdate(d);
- splx(s);
- }
- c->bytes = b->total;
- c->blocks = (b->total - b->prev_total +
- d->rec_blocksize - 1) / d->rec_blocksize;
- c->ptr = b->fp;
- b->prev_total = b->total;
- }
- break;
-
- case SNDCTL_DSP_GETOPTR:
- {
- count_info *c = (count_info *)data;
- snd_dbuf *b = &d->dbuf_out;
- if (b->dl != 0) {
- s = spltty();
- es_wr_dmaupdate(d);
- splx(s);
- }
- c->bytes = b->total;
- c->blocks = (b->total - b->prev_total +
- d->play_blocksize - 1) / d->play_blocksize;
- c->ptr = b->rp;
- b->prev_total = b->total;
- }
- break;
-
- case AIOSTOP:
- case SNDCTL_DSP_RESET:
- case SNDCTL_DSP_SYNC:
- ret = EINVAL;
- break;
-
- default:
- ret = ENOSYS;
- break;
- }
- return (ret);
-}
-
-static int
-es_select(dev_t i_dev, int rw, struct proc * p)
-{
- return (ENOSYS);
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * The interrupt handler
- */
-
-static void
-es_intr (void *p)
-{
- snddev_info *d = (snddev_info *)p;
- struct es_info *es = (struct es_info *)d->device_data;
- unsigned intsrc, sctrl;
-
- intsrc = bus_space_read_4(es->st, es->sh, ES1370_REG_STATUS);
- if ((intsrc & STAT_INTR) == 0)
- return;
-
- sctrl = es->sctrl;
- if (intsrc & STAT_ADC)
- sctrl &= ~SCTRL_R1INTEN;
- if (intsrc & STAT_DAC1)
- sctrl &= ~SCTRL_P1INTEN;
- if (intsrc & STAT_DAC2) {
- sctrl &= ~SCTRL_P2INTEN;
- }
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL, sctrl);
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL,
- es->sctrl);
- if (intsrc & STAT_DAC2)
- dma_wrintr(d);
- if (intsrc & STAT_ADC)
- dma_rdintr(d);
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * DMA hassle
- */
-
-static int
-alloc_dmabuf(snddev_info *d, int rd)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- snd_dbuf *b = rd ? &d->dbuf_in : &d->dbuf_out;
- bus_dmamap_t *dmam = rd ? &es->dmam_in : &es->dmam_out;
-
- if (bus_dmamem_alloc(es->parent_dmat, (void **)&b->buf, BUS_DMA_NOWAIT,
- dmam) != 0 ||
- bus_dmamap_load(es->parent_dmat, *dmam, b->buf, d->bufsize,
- rd ? es_rd_map : es_wr_map, es, 0) != 0)
- return -1;
-
- b->rp = b->fp = b->dl = b->rl = 0;
- b->fl = b->bufsize = d->bufsize;
- return (0);
-}
-
-static int
-es_wr_dmaupdate(snddev_info *d)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- unsigned hwptr, delta;
-
- bus_space_write_4(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_DAC2_FRAMECNT >> 8);
- hwptr = (bus_space_read_4(es->st, es->sh,
- ES1370_REG_DAC2_FRAMECNT & 0xff) >> 14) & 0x3fffc;
- delta = (d->dbuf_out.bufsize + hwptr - d->dbuf_out.rp) %
- d->dbuf_out.bufsize;
- d->dbuf_out.rp = hwptr;
- d->dbuf_out.rl -= delta;
- d->dbuf_out.fl += delta;
- d->dbuf_out.total += delta;
-
- return delta;
-}
-
-static int
-es_rd_dmaupdate(snddev_info *d)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- unsigned hwptr, delta;
-
- bus_space_write_4(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_ADC_FRAMECNT >> 8);
- hwptr = (bus_space_read_4(es->st, es->sh,
- ES1370_REG_ADC_FRAMECNT & 0xff) >> 14) & 0x3fffc;
- delta = (d->dbuf_in.bufsize + hwptr - d->dbuf_in.fp) %
- d->dbuf_in.bufsize;
- d->dbuf_in.fp = hwptr;
- d->dbuf_in.rl += delta;
- d->dbuf_in.fl -= delta;
- d->dbuf_in.total += delta;
- return delta;
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * Hardware
- */
-
-static int
-es_callback(snddev_info *d, int reason)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- int rd = reason & SND_CB_RD;
-
- switch(reason & SND_CB_REASON_MASK) {
- case SND_CB_INIT:
- es->ctrl = (es->ctrl & ~CTRL_PCLKDIV) |
- (DAC2_SRTODIV(d->play_speed) << CTRL_SH_PCLKDIV);
- snd_set_blocksize(d);
-
- es->sctrl &= ~(SCTRL_R1FMT | SCTRL_P2FMT);
- d->flags &= ~SND_F_XLAT8;
- switch(d->play_fmt) {
- case 0:
- case AFMT_U8:
- break;
-
- case AFMT_S16_LE:
- es->sctrl |= SCTRL_P2SEB;
- break;
-
- case AFMT_MU_LAW:
- d->flags |= SND_F_XLAT8;
- break;
-
- default:
- return (-1);
- }
-
- switch(d->rec_fmt) {
- case 0:
- case AFMT_U8:
- break;
-
- case AFMT_S16_LE:
- es->sctrl |= SCTRL_R1SEB;
- break;
-
- case AFMT_MU_LAW:
- d->flags |= SND_F_XLAT8;
- break;
-
- default:
- return (-1);
- }
-
- if (d->flags & SND_F_STEREO)
- es->sctrl |= SCTRL_P2SMB | SCTRL_R1SMB;
-
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL,
- es->ctrl);
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL,
- es->sctrl);
- break;
-
- case SND_CB_START:
- if (rd) {
- es->ctrl |= CTRL_ADC_EN;
- es->sctrl = (es->sctrl & ~SCTRL_R1LOOPSEL) |
- SCTRL_R1INTEN;
- bus_space_write_4(es->st, es->sh, ES1370_REG_ADC_SCOUNT,
- d->dbuf_in.dl / d->dbuf_in.sample_size - 1);
- } else {
- es->ctrl |= CTRL_DAC2_EN;
- es->sctrl = (es->sctrl & ~(SCTRL_P2ENDINC |
- SCTRL_P2STINC | SCTRL_P2LOOPSEL | SCTRL_P2PAUSE |
- SCTRL_P2DACSEN)) | SCTRL_P2INTEN |
- (((d->play_fmt == AFMT_S16_LE) ? 2 : 1)
- << SCTRL_SH_P2ENDINC);
- bus_space_write_4(es->st, es->sh,
- ES1370_REG_DAC2_SCOUNT,
- d->dbuf_out.dl / d->dbuf_out.sample_size - 1);
- }
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL,
- es->sctrl);
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);
- break;
-
- case SND_CB_ABORT:
- case SND_CB_STOP:
- if (rd)
- es->ctrl &= ~CTRL_ADC_EN;
- else
- es->ctrl &= ~CTRL_DAC2_EN;
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);
- break;
-
- default:
- return (-1);
- }
- return (0);
-}
-
-static int
-write_codec(snddev_info *d, u_char i, u_char data)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- int wait = 100; /* 100 msec timeout */
-
- do {
- if ((bus_space_read_4(es->st, es->sh, ES1370_REG_STATUS) &
- STAT_CSTAT) == 0) {
- bus_space_write_2(es->st, es->sh, ES1370_REG_CODEC,
- ((u_short)i << CODEC_INDEX_SHIFT) | data);
- return (0);
- }
- DELAY(1000);
- /* tsleep(&wait, PZERO, "sndaw", hz / 1000); */
- } while (--wait);
- printf("pcm: write_codec timed out\n");
- return (-1);
-}
-
-static void
-es_wr_map(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
- struct es_info *es = (struct es_info *)arg;
-
- bus_space_write_1(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_DAC2_FRAMEADR >> 8);
- bus_space_write_4(es->st, es->sh, ES1370_REG_DAC2_FRAMEADR & 0xff,
- segs->ds_addr);
- bus_space_write_4(es->st, es->sh, ES1370_REG_DAC2_FRAMECNT & 0xff,
- (segs->ds_len >> 2) - 1);
-}
-
-static void
-es_rd_map(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
- struct es_info *es = (struct es_info *)arg;
-
- bus_space_write_1(es->st, es->sh, ES1370_REG_MEMPAGE,
- ES1370_REG_ADC_FRAMEADR >> 8);
- bus_space_write_4(es->st, es->sh, ES1370_REG_ADC_FRAMEADR & 0xff,
- segs->ds_addr);
- bus_space_write_4(es->st, es->sh, ES1370_REG_ADC_FRAMECNT & 0xff,
- (segs->ds_len >> 2) - 1);
-}
-
-static void
-dma_wrintr(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_out;
-
- /*
- * According to Linux driver:
- * dmaupdate()
- * Bei underrun error++
- * wake_up(dac2.wait)
- */
-
- if (b->dl != 0) {
- es_wr_dmaupdate(d);
- wakeup(b);
- }
-
- if (b->rl >= DMA_ALIGN_THRESHOLD &&
- !(d->flags & SND_F_ABORTING)) {
- int l = min(b->rl, d->play_blocksize);
- l &= DMA_ALIGN_MASK;
-
- if (l != b->dl) {
- if (b->dl != 0) {
- d->callback(d, SND_CB_WR | SND_CB_STOP);
- es_wr_dmaupdate(d);
- l = min(b->rl, d->play_blocksize);
- l &= DMA_ALIGN_MASK;
- }
- b->dl = l;
- d->callback(d, SND_CB_WR | SND_CB_START);
- }
- } else if (b->dl != 0) {
- b->dl = 0;
- d->callback(d, SND_CB_WR | SND_CB_STOP);
- es_wr_dmaupdate(d);
- }
-}
-
-static void
-dma_rdintr(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_in;
-
- if (b->dl != 0) {
- es_rd_dmaupdate(d);
- wakeup(b);
- }
-
- if (b->fl >= DMA_READ_THRESHOLD &&
- !(d->flags & SND_F_ABORTING)) {
- int l = min(b->fl, d->rec_blocksize);
- l &= DMA_ALIGN_MASK;
-
- if (l != b->dl) {
- if (b->dl != 0) {
- d->callback(d, SND_CB_RD | SND_CB_STOP);
- es_rd_dmaupdate(d);
- l = min(b->fl, d->rec_blocksize);
- l &= DMA_ALIGN_MASK;
- }
- b->dl = l;
- d->callback(d, SND_CB_RD | SND_CB_START);
- }
- } else {
- if (b->dl != 0) {
- b->dl = 0;
- d->callback(d, SND_CB_RD | SND_CB_STOP);
- es_rd_dmaupdate(d);
- }
- }
-}
-
-static int
-es_wrabort(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_out;
- long s;
- int missing;
-
- s = spltty();
- if (b->dl != 0) {
- wakeup(b);
- b->dl = 0;
- d->callback(d, SND_CB_WR | SND_CB_ABORT);
- }
- es_wr_dmaupdate(d);
- missing = b->rl;
- b->rl = 0;
- b->fp = b->rp;
- b->fl = b->bufsize;
- splx(s);
- return missing;
-}
-
-static int
-es_rdabort(snddev_info *d)
-{
- snd_dbuf *b = &d->dbuf_in;
- long s;
- int missing;
-
- s = spltty();
- if (b->dl != 0) {
- wakeup(b);
- b->dl = 0;
- d->callback(d, SND_CB_RD | SND_CB_ABORT);
- es_rd_dmaupdate(d);
- }
- missing = b->rl;
- b->rl = 0;
- b->fp = b->rp;
- b->fl = b->bufsize;
- splx(s);
- return missing;
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * Probe and attach the card
- */
-
-static int
-es_init(snddev_info *d)
-{
- struct es_info *es = (struct es_info *)d->device_data;
- u_int i;
-
- es->ctrl = CTRL_CDC_EN | CTRL_SERR_DIS |
- (DAC2_SRTODIV(DSP_DEFAULT_SPEED) << CTRL_SH_PCLKDIV);
- bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);
- es->sctrl = 0;
- bus_space_write_4(es->st, es->sh, ES1370_REG_SERIAL_CONTROL, es->sctrl);
- write_codec(d, CODEC_RES_PD, 3);/* No RST, PD */
- write_codec(d, CODEC_CSEL, 0); /* CODEC ADC and CODEC DAC use
- * {LR,B}CLK2 and run off the LRCLK2
- * PLL; program DAC_SYNC=0! */
- write_codec(d, CODEC_ADSEL, 0); /* Recording source is mixer */
- write_codec(d, CODEC_MGAIN, 0); /* MIC amp is 0db */
-
- i = SOUND_MASK_MIC;
- mixer_ioctl(d, SOUND_MIXER_WRITE_RECSRC, (caddr_t) &i, 0, NULL);
- i = 0;
- mixer_ioctl(d, SOUND_MIXER_WRITE_VOLUME, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_PCM, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_SYNTH, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_CD, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE1, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE2, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_LINE3, (caddr_t) &i, 0, NULL);
- mixer_ioctl(d, SOUND_MIXER_WRITE_MIC, (caddr_t) &i, 0, NULL);
-
- return (0);
-}
-
-static char *
-es_pci_probe(pcici_t tag, pcidi_t type)
-{
- if (type == ES1370_PCI_ID)
- return ("AudioPCI ES1370");
-
- return (NULL);
-}
-
-static void
-es_pci_attach(pcici_t config_id, int unit)
-{
- snddev_info *d;
- u_int32_t data;
- struct es_info *es;
- pci_port_t io_port;
- int i, mapped;
- vm_offset_t vaddr, paddr;
-
- if (unit > NPCM_MAX)
- return;
-
- d = &pcm_info[unit];
- *d = es_op_desc;
- if ((es = malloc(sizeof(*es), M_DEVBUF, M_NOWAIT)) == NULL) {
- printf("pcm%d: cannot allocate softc\n", unit);
- return;
- }
- bzero(es, sizeof(*es));
- d->device_data = es;
-
- vaddr = paddr = NULL;
- mapped = 0;
- data = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- if (mapped == 0 && (data & PCI_COMMAND_MEM_ENABLE)) {
- if (pci_map_mem(config_id, MEM_MAP_REG, &vaddr, &paddr)) {
- es->st = MEM_SPACE_MAPPING;
- es->sh = vaddr;
- mapped++;
- }
- }
- if (mapped == 0 && (data & PCI_COMMAND_IO_ENABLE)) {
- if (pci_map_port(config_id, PCI_MAP_REG_START, &io_port)) {
- es->st = IO_SPACE_MAPPING;
- es->sh = io_port;
- mapped++;
- }
- }
- if (mapped == 0) {
- printf("pcm%d: unable to map any ports\n", unit);
- free(es, M_DEVBUF);
- return;
- }
- printf("pcm%d: using %s space register mapping at %#x\n", unit,
- es->st == IO_SPACE_MAPPING ? "I/O" : "Memory", es->sh);
-
- d->io_base = es->sh;
- d->mix_devs = 0;
- for (i = 0; i != SOUND_MIXER_NRDEVICES; i++)
- if (mixtable[i].avail)
- d->mix_devs |= (1 << i);
- d->mix_rec_devs = 0;
- for (i = 0; i != SOUND_MIXER_NRDEVICES; i++)
- if (mixtable[i].recmask)
- d->mix_rec_devs |= (1 << i);
-
- if (es_init(d) == -1) {
- printf("pcm%d: unable to initialize the card\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
- if (pci_map_int(config_id, es_intr, d, &tty_imask) == 0) {
- printf("pcm%d: unable to map interrupt\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
- if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/2, /*boundary*/0,
- /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
- /*highaddr*/BUS_SPACE_MAXADDR,
- /*filter*/NULL, /*filterarg*/NULL,
- /*maxsize*/d->bufsize, /*nsegments*/1, /*maxsegz*/0x3ffff,
- /*flags*/0, &es->parent_dmat) != 0) {
- printf("pcm%d: unable to create dma tag\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
-
- if (alloc_dmabuf(d, 0) == -1 ||
- alloc_dmabuf(d, 1) == -1) {
- printf("pcm%d: unable to allocate dma buffers\n", unit);
- free(es, M_DEVBUF);
- d->io_base = 0;
- return;
- }
-
- pcminit(d, unit);
-
- return;
-}
-
-#endif /* NPCI != 0 */
diff --git a/sys/pci/es1370_reg.h b/sys/pci/es1370_reg.h
deleted file mode 100644
index 72546c61449a2..0000000000000
--- a/sys/pci/es1370_reg.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This supports the ENSONIQ AudioPCI board based on the ES1370.
- *
- * Copyright (c) 1998 Joachim Kuebart <joki@kuebart.stuttgart.netsurf.de>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice immediately at the beginning of the file, without modification,
- * this list of conditions, and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Absolutely no warranty of function or purpose is made by the author
- * Joachim Kuebart.
- * 4. Modifications may be freely made to this file if the above conditions
- * are met.
- *
- * $Id$
- */
-
-#ifndef _ES1370_REG_H
-#define _ES1370_REG_H
-
-#define ES1370_REG_CONTROL 0x00
-#define ES1370_REG_STATUS 0x04
-#define ES1370_REG_UART_DATA 0x08
-#define ES1370_REG_UART_STATUS 0x09
-#define ES1370_REG_UART_CONTROL 0x09
-#define ES1370_REG_UART_TEST 0x0a
-#define ES1370_REG_MEMPAGE 0x0c
-#define ES1370_REG_CODEC 0x10
-#define CODEC_INDEX_SHIFT 8
-#define ES1370_REG_SERIAL_CONTROL 0x20
-#define ES1370_REG_DAC1_SCOUNT 0x24
-#define ES1370_REG_DAC2_SCOUNT 0x28
-#define ES1370_REG_ADC_SCOUNT 0x2c
-
-#define ES1370_REG_DAC1_FRAMEADR 0xc30
-#define ES1370_REG_DAC1_FRAMECNT 0xc34
-#define ES1370_REG_DAC2_FRAMEADR 0xc38
-#define ES1370_REG_DAC2_FRAMECNT 0xc3c
-#define ES1370_REG_ADC_FRAMEADR 0xd30
-#define ES1370_REG_ADC_FRAMECNT 0xd34
-
-#define DAC2_SRTODIV(x) (((1411200 + (x) / 2) / (x) - 2) & 0x1fff)
-#define DAC2_DIVTOSR(x) (1411200 / ((x) + 2))
-
-#define CTRL_ADC_STOP 0x80000000 /* 1 = ADC stopped */
-#define CTRL_XCTL1 0x40000000 /* SERR pin if enabled */
-#define CTRL_OPEN 0x20000000 /* no function, can be read and
- * written */
-#define CTRL_PCLKDIV 0x1fff0000 /* ADC/DAC2 clock divider */
-#define CTRL_SH_PCLKDIV 16
-#define CTRL_MSFMTSEL 0x00008000 /* MPEG serial data fmt: 0 = Sony, 1
- * = I2S */
-#define CTRL_M_SBB 0x00004000 /* DAC2 clock: 0 = PCLKDIV, 1 = MPEG */
-#define CTRL_WTSRSEL 0x00003000 /* DAC1 clock freq: 0=5512, 1=11025,
- * 2=22050, 3=44100 */
-#define CTRL_SH_WTSRSEL 12
-#define CTRL_DAC_SYNC 0x00000800 /* 1 = DAC2 runs off DAC1 clock */
-#define CTRL_CCB_INTRM 0x00000400 /* 1 = CCB "voice" ints enabled */
-#define CTRL_M_CB 0x00000200 /* recording source: 0 = ADC, 1 =
- * MPEG */
-#define CTRL_XCTL0 0x00000100 /* 0 = Line in, 1 = Line out */
-#define CTRL_BREQ 0x00000080 /* 1 = test mode (internal mem test) */
-#define CTRL_DAC1_EN 0x00000040 /* enable DAC1 */
-#define CTRL_DAC2_EN 0x00000020 /* enable DAC2 */
-#define CTRL_ADC_EN 0x00000010 /* enable ADC */
-#define CTRL_UART_EN 0x00000008 /* enable MIDI uart */
-#define CTRL_JYSTK_EN 0x00000004 /* enable Joystick port (presumably
- * at address 0x200) */
-#define CTRL_CDC_EN 0x00000002 /* enable serial (CODEC) interface */
-#define CTRL_SERR_DIS 0x00000001 /* 1 = disable PCI SERR signal */
-
-#define SCTRL_P2ENDINC 0x00380000 /* */
-#define SCTRL_SH_P2ENDINC 19
-#define SCTRL_P2STINC 0x00070000 /* */
-#define SCTRL_SH_P2STINC 16
-#define SCTRL_R1LOOPSEL 0x00008000 /* 0 = loop mode */
-#define SCTRL_P2LOOPSEL 0x00004000 /* 0 = loop mode */
-#define SCTRL_P1LOOPSEL 0x00002000 /* 0 = loop mode */
-#define SCTRL_P2PAUSE 0x00001000 /* 1 = pause mode */
-#define SCTRL_P1PAUSE 0x00000800 /* 1 = pause mode */
-#define SCTRL_R1INTEN 0x00000400 /* enable interrupt */
-#define SCTRL_P2INTEN 0x00000200 /* enable interrupt */
-#define SCTRL_P1INTEN 0x00000100 /* enable interrupt */
-#define SCTRL_P1SCTRLD 0x00000080 /* reload sample count register for
- * DAC1 */
-#define SCTRL_P2DACSEN 0x00000040 /* 1 = DAC2 play back last sample
- * when disabled */
-#define SCTRL_R1SEB 0x00000020 /* 1 = 16bit */
-#define SCTRL_R1SMB 0x00000010 /* 1 = stereo */
-#define SCTRL_R1FMT 0x00000030 /* format mask */
-#define SCTRL_SH_R1FMT 4
-#define SCTRL_P2SEB 0x00000008 /* 1 = 16bit */
-#define SCTRL_P2SMB 0x00000004 /* 1 = stereo */
-#define SCTRL_P2FMT 0x0000000c /* format mask */
-#define SCTRL_SH_P2FMT 2
-#define SCTRL_P1SEB 0x00000002 /* 1 = 16bit */
-#define SCTRL_P1SMB 0x00000001 /* 1 = stereo */
-#define SCTRL_P1FMT 0x00000003 /* format mask */
-#define SCTRL_SH_P1FMT 0
-
-#define STAT_INTR 0x80000000 /* wired or of all interrupt bits */
-#define STAT_CSTAT 0x00000400 /* 1 = codec busy or codec write in
- * progress */
-#define STAT_CBUSY 0x00000200 /* 1 = codec busy */
-#define STAT_CWRIP 0x00000100 /* 1 = codec write in progress */
-#define STAT_VC 0x00000060 /* CCB int source, 0=DAC1, 1=DAC2,
- * 2=ADC, 3=undef */
-#define STAT_SH_VC 5
-#define STAT_MCCB 0x00000010 /* CCB int pending */
-#define STAT_UART 0x00000008 /* UART int pending */
-#define STAT_DAC1 0x00000004 /* DAC1 int pending */
-#define STAT_DAC2 0x00000002 /* DAC2 int pending */
-#define STAT_ADC 0x00000001 /* ADC int pending */
-
-#define CODEC_OMIX1 0x10
-#define CODEC_OMIX2 0x11
-#define CODEC_LIMIX1 0x12
-#define CODEC_RIMIX1 0x13
-#define CODEC_LIMIX2 0x14
-#define CODEC_RIMIX2 0x15
-#define CODEC_RES_PD 0x16
-#define CODEC_CSEL 0x17
-#define CODEC_ADSEL 0x18
-#define CODEC_MGAIN 0x19
-
-#define ES_BUFFSIZE 0x20000 /* We're PCI! Use a large buffer */
-
-#endif
diff --git a/sys/pci/ide_pci.c b/sys/pci/ide_pci.c
index 39c53a562b32c..68df969ff56bd 100644
--- a/sys/pci/ide_pci.c
+++ b/sys/pci/ide_pci.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ide_pci.c,v 1.27 1999/01/17 05:18:54 bde Exp $
+ * $Id: ide_pci.c,v 1.13 1998/07/11 07:45:52 bde Exp $
*/
#include "pci.h"
@@ -120,15 +120,6 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
void *wdinfo);
static void
-acer_status(struct ide_pci_cookie *cookie);
-
-static int
-acer_dmainit(struct ide_pci_cookie *cookie,
- struct wdparams *wp,
- int (*wdcmd)(int, void *),
- void *wdinfo);
-
-static void
intel_piix_dump_drive(char *ctlr,
int sitre,
int is_piix4,
@@ -159,7 +150,7 @@ mkcookie(int iobase_wd,
static void ide_pci_attach(pcici_t tag, int unit);
-static void *ide_pci_candma(int, int, int);
+static void *ide_pci_candma(int, int);
static int ide_pci_dmainit(void *,
struct wdparams *,
int (*)(int, void *),
@@ -276,14 +267,8 @@ generic_dmainit(struct ide_pci_cookie *cookie,
printf("ide_pci: generic_dmainit %04x:%d: warning, IDE controller timing not set\n",
cookie->iobase_wd,
cookie->unit);
- /* If we're here, then this controller is most likely not set
- for UDMA, even if the drive may be. Make the drive wise
- up. */
-
- if(!wdcmd(WDDMA_MDMA2, wdinfo))
- printf("generic_dmainit: could not set multiword DMA mode!\n");
return 1;
- }
+ }
#ifdef IDE_PCI_DEBUG
printf("pio_mode: %d, mwdma_mode(wp): %d, udma_mode(wp): %d\n",
pio_mode(wp), mwdma_mode(wp), udma_mode(wp));
@@ -404,7 +389,7 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
/* UDMA enable by SET FEATURES, DMA cycles, cycle time 2T */
mask = 0xe3000000 >> (unitno * 8);
- new = 0x40000000 >> (unitno * 8);
+ new = 0x80000000 >> (unitno * 8);
word50 &= ~mask;
word50 |= new;
@@ -418,10 +403,10 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
*/
/* Set UDMA mode 2 on drive */
if (bootverbose)
- printf("via_571_dmainit: setting ultra DMA mode 2\n");
+ printf("intel_piix_dmainit: setting ultra DMA mode 2\n");
r = wdcmd(WDDMA_UDMA2, wdinfo);
if (!r) {
- printf("via_571_dmainit: setting DMA mode failed\n");
+ printf("intel_piix_dmainit: setting DMA mode failed\n");
return 0;
}
@@ -437,10 +422,10 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
/* Set multiword DMA mode 2 on drive */
if (bootverbose)
- printf("via_571_dmainit: setting multiword DMA mode 2\n");
+ printf("intel_piix_dmainit: setting multiword DMA mode 2\n");
r = wdcmd(WDDMA_MDMA2, wdinfo);
if (!r) {
- printf("via_571_dmainit: setting DMA mode failed\n");
+ printf("intel_piix_dmainit: setting DMA mode failed\n");
return 0;
}
@@ -452,7 +437,8 @@ via_571_dmainit(struct ide_pci_cookie *cookie,
* enable prefetch/postwrite-- XXX may cause problems
* with CD-ROMs?
*/
- workword |= 0xc000 >> (cookie->ctlr * 2);
+ workword &= ~(3 << (cookie->ctlr * 2 + 12));
+ workword |= 3 << (cookie->ctlr * 2 + 12);
/* FIFO configurations-- equal split, threshold 1/2 */
workword &= 0x90ffffff;
@@ -495,175 +481,6 @@ static struct vendor_fns vs_via_571 =
via_571_status
};
-/* Cyrix Cx5530 Courtesy of Whistle Communications */
-
-/*
- * Verify that controller can handle a dma request for cp. Should
- * not affect any hardware or driver state.
- * Special version for 5530 that allows only transfers on 16 byte boundaries.(!)
- * (Yes the Cyrix 5530 can only UDMA to cache-line boundaries.(bleh!))
- * Luckily nearly all disk IO is to kernel bufers which are page alligned.
- * They may fix this in some other version of the chip, but it's in the latest
- * at this time (Jan 1999).
- */
-static int
-cyrix_5530_dmaverify(void *xcp, char *vaddr, u_long count, int dir)
-{
- int badfu;
-
- /*
- * check for nonaligned or odd-length Stuff
- */
- badfu = ((unsigned int)vaddr & 0xf) || (count & 0xf);
-#ifdef DIAGNOSTIC
- if (badfu) {
- printf("ide_pci: dmaverify odd vaddr or length, ");
- printf("vaddr = %p length = %08lx\n", (void *)vaddr, count);
- }
-#endif
- return (!badfu);
-}
-
-/*
- * XXX Unit number handling may be broken in the Cx5530 modules.
- * It has only been checked with a single drive.
- * 12MByte/Sec transfer rates were seen with Quantum Fireball drives
- * with negligable CPU usage.
- */
-static void
-cyrix_5530_status(struct ide_pci_cookie *cookie)
-{
- int iobase_wd;
- int ctlr, unit;
- int iobase_bm;
- pcici_t tag;
- pcidi_t type;
- u_long PIO_config;
- u_long DMA_config;
- int unitno;
-
- iobase_wd = cookie->iobase_wd;
- unit = cookie->unit;
- ctlr = cookie->ctlr;
- iobase_bm = cookie->iobase_bm;
- tag = cookie->tag;
- type = cookie->type;
-
- unitno = ctlr * 2 + unit;
-
- /* set some values the BIOS should have set */
- printf("Using 0x%x\n", cookie->iobase_bm);
- outl(iobase_bm + (unit * 0x10) + 0x20, 0x00040010);
- outl(iobase_bm + (unit * 0x10) + 0x24, 0x00911030);
- /* if ((ctlr == 0) && (unit == 0)) */ /* XXX */
- /* outb(iobase_bm + (unit * 0x10) + BMISTA_PORT, 0xe6);*/
-
- PIO_config = inl(iobase_bm + (unit * 0x10) + 0x20);
- DMA_config = inl(iobase_bm + (unit * 0x10) + 0x24);
-
-
- printf("cyrix_5530_status: %s:%u IDE PIO cfg: 0x%08lx\n",
- (ctlr ? "Secondary" : "Primary"), unit, PIO_config);
- printf("cyrix_5530_status: %s:%u IDE DMA cfg: 0x%08lx\n",
- (ctlr ? "Secondary" : "Primary"), unit, DMA_config);
-}
-
-/*
- * XXX timing values set here are only good for 30/33MHz buses; should deal
- * with slower ones too (BTW: you overclock-- you lose)
- */
-
-static int
-cyrix_5530_dmainit(struct ide_pci_cookie *cookie,
- struct wdparams *wp,
- int(*wdcmd)(int, void *),
- void *wdinfo)
-{
- int r;
- u_long pci_revision;
- int unitno;
- int iobase_bm;
- int unit;
-
- /*cookie->unit = 0; */ /* XXX */
- unit = cookie->unit;
- pci_revision = pci_conf_read(cookie->tag, PCI_CLASS_REG) &
- PCI_REVISION_MASK;
-
- unitno = cookie->ctlr * 2 + unit;
- iobase_bm = cookie->iobase_bm;
-
- printf("Setting using 0x%x\n", iobase_bm);
- if ((cookie->ctlr == 0) && (unit == 0)) /* XXX */
- outb(iobase_bm + (unit * 0x10) + BMISTA_PORT, 0xe6);
- outl(iobase_bm + (unit * 0x10) + 0x20, 0x00040010);
- outl(iobase_bm + (unit * 0x10) + 0x24, 0x00911030);
- /* If it's a UDMA drive on a '5530, set it up */
- /*
- * depending on what the drive can do,
- * set the correct modes,
- */
- printf("wd%d: mw=0x%x, pio=0x%x, pcirev=0x%lx, udma=0x%x\n",
- unitno,
- mwdma_mode(wp), pio_mode(wp),
- pci_revision, udma_mode(wp));
- if (/* pci_revision >= 1 && */ udma_mode(wp) >= 2) {
- /*outl(iobase_bm + 0x20 + (cookie->unit * 16), 0x00100010);*/
- outl(iobase_bm + 0x24 + (cookie->unit * 16), 0x00911030);
-
- /*
- * With the Cx5530, drive configuration should come *after* the
- * controller configuration, to make sure the controller sees
- * the command and does the right thing.
- */
- /* Set UDMA mode 2 on drive */
- if (bootverbose)
- printf("cyrix_5530_dmainit: setting ultra DMA mode 2\n");
- r = wdcmd(WDDMA_UDMA2, wdinfo);
- if (!r) {
- printf("cyrix_5530_dmainit: setting DMA mode failed\n");
- return 0;
- }
-
- if (bootverbose)
- cyrix_5530_status(cookie);
- return 1;
-
- }
-
- /* otherwise, try and program it for MW DMA mode 2 */
- else if (mwdma_mode(wp) >= 2 && pio_mode(wp) >= 4) {
-
- /* Set multiword DMA mode 2 on drive */
- if (bootverbose)
- printf("cyrix_5530_dmainit: setting multiword DMA mode 2\n");
- r = wdcmd(WDDMA_MDMA2, wdinfo);
- if (!r) {
- printf("cyrix_5530_dmainit: setting DMA mode failed\n");
- return 0;
- }
-
- /* Configure the controller appropriately for MWDMA mode 2 */
-
- /*outl(iobase_bm + 0x20 + (cookie->unit * 16), 0x00100010);*/
- outl(iobase_bm + 0x24 + (cookie->unit * 16), 0x00002020);
-
- if (bootverbose)
- cyrix_5530_status(cookie);
-
- return 1;
-
- }
- return 0;
-}
-
-
-static struct vendor_fns vs_cyrix_5530 =
-{
- cyrix_5530_dmainit,
- cyrix_5530_status
-};
-
static void
promise_status(struct ide_pci_cookie *cookie)
@@ -879,8 +696,8 @@ intel_piix_dmainit(struct ide_pci_cookie *cookie,
unitno = cookie->ctlr * 2 + cookie->unit;
- mask = (1 << unitno) + (3 << (16 + unitno * 4));
- new = (1 << unitno) + (2 << (16 + unitno * 4));
+ mask = 1 << unitno + 3 << (16 + unitno * 4);
+ new = 1 << unitno + 2 << (16 + unitno * 4);
pci_conf_write(cookie->tag, 0x48,
(pci_conf_read(cookie->tag, 0x48) & ~mask) | new);
@@ -1019,70 +836,6 @@ static struct vendor_fns vs_intel_piix =
intel_piix_status
};
-
-static void
-acer_status(struct ide_pci_cookie *cookie) {
- /* XXX does not do anything right now */
-}
-
-static int
-acer_dmainit(struct ide_pci_cookie *cookie,
- struct wdparams *wp,
- int(*wdcmd)(int, void *),
- void *wdinfo)
-{
- /* Acer Aladdin DMA setup code. UDMA looks to be sinfully easy to set
- on this thing - just one register. */
-
- u_long word54 = pci_conf_read(cookie->tag, 0x54);
-
- /* Set the default Acer FIFO settings (0x55 = 13-word depth and
- slave operation mode 1) */
-
- word54 |= 0x5555;
-
- /* Is this drive UDMA? Set it up if so... */
- if(udma_mode(wp) >= 2) {
- /* This is really easy to do. Just write 0xa (enable
- UDMA mode with 2T timing) into the word at the right
- places. */
- word54 |= (0xA << (16 + (cookie->ctlr * 8) + (cookie->unit * 4)));
-
- /* Now set the drive for UDMA2. */
- if(!wdcmd(WDDMA_UDMA2, wdinfo)) {
- printf("acer_dmainit: could not set UDMA2 mode on wdc%d:%d!\n", cookie->ctlr, cookie->unit);
- return 0;
- }
-
- /* Write the new config into the registers. I'm not
- sure if I'm doing this in the right order. */
-
- pci_conf_write(cookie->tag, 0x54, word54);
-
- } else if(mwdma_mode(wp) >= 2 && pio_mode(wp) >=4) {
-
-
- /* Otherwise, we're already set for regular DMA. */
-
- if(!wdcmd(WDDMA_MDMA2, wdinfo)) {
- printf("acer_dmainit: could not set MWDMA2 mode on wdc%d:%d!\n",
- cookie->ctlr, cookie->unit);
- return 0;
- }
- return 1;
- }
-
- return 0;
-}
-
-static struct vendor_fns vs_acer =
-{
- acer_dmainit,
- acer_status
-};
-
-
-
/* Generic SFF-8038i code-- all code below here, except for PCI probes,
* more or less conforms to the SFF-8038i spec as extended for PCI.
* There should be no code that goes beyond that feature set below.
@@ -1145,7 +898,7 @@ mkcookie(int iobase_wd,
return cp;
}
-static const char *
+static char *
ide_pci_probe(pcici_t tag, pcidi_t type)
{
u_long data;
@@ -1164,11 +917,7 @@ ide_pci_probe(pcici_t tag, pcidi_t type)
if (type == PROMISE_ULTRA33)
return ("Promise Ultra/33 IDE controller");
if (type == 0x05711106)
- return ("VIA 82C586x (Apollo) Bus-master IDE controller");
- if (type == 0x01021078)
- return ("Cyrix 5530 Bus-master IDE controller");
- if (type == 0x522910b9)
- return ("Acer Aladdin IV/V (M5229) Bus-master IDE controller");
+ return ("VIA 82C586x (Apollo) Bus-master IDE controller");
if (data & 0x8000)
return ("PCI IDE controller (busmaster capable)");
#ifndef CMD640
@@ -1186,7 +935,7 @@ ide_pci_probe(pcici_t tag, pcidi_t type)
static void
ide_pci_attach(pcici_t tag, int unit)
{
- u_long class = 0, cmd;
+ u_long class, cmd;
int bmista_1, bmista_2;
int iobase_wd_1, iobase_wd_2, iobase_bm_1, iobase_bm_2;
int altiobase_wd_1, altiobase_wd_2;
@@ -1232,13 +981,6 @@ ide_pci_attach(pcici_t tag, int unit)
vp = &vs_promise;
break;
- case 0x01021078: /* cyrix 5530 */
- printf("cyrix 5530\n");
- vp = &vs_cyrix_5530;
- break;
- case 0x522910B9: /* Acer Aladdin IV/V (M5229) */
- vp = &vs_acer;
- break;
default:
/* everybody else */
vp = &vs_generic;
@@ -1269,19 +1011,16 @@ ide_pci_attach(pcici_t tag, int unit)
}
iobase_bm_1 = pci_conf_read(tag, 0x20) & 0xfffc;
+ iobase_bm_2 = iobase_bm_1 + SFF8038_CTLR_1;
if (iobase_bm_1 == 0) {
- printf("ide_pci: BIOS has not configured busmaster"
- "I/O address,\n ide_pci: giving up\n");
+ printf("ide_pci: BIOS has not configured busmaster I/O address,\n\
+ide_pci: giving up\n");
return;
}
- iobase_bm_2 = iobase_bm_1 + SFF8038_CTLR_1;
wddma[unit].wdd_candma = ide_pci_candma;
wddma[unit].wdd_dmainit = ide_pci_dmainit;
- if (type == 0x01021078 /*CYRIX_5530*/)
- wddma[unit].wdd_dmaverify = cyrix_5530_dmaverify;
- else
- wddma[unit].wdd_dmaverify = ide_pci_dmaverify;
+ wddma[unit].wdd_dmaverify = ide_pci_dmaverify;
wddma[unit].wdd_dmaprep = ide_pci_dmasetup;
wddma[unit].wdd_dmastart = ide_pci_dmastart;
wddma[unit].wdd_dmadone = ide_pci_dmadone;
@@ -1331,7 +1070,7 @@ ide_pci_attach(pcici_t tag, int unit)
if (dvup->id_id == 0) {
iobase_wd_2 = 0;
break;
- }
+ }
}
if (dvup->id_unit == biotabunit + 2) {
@@ -1389,8 +1128,6 @@ ide_pci_attach(pcici_t tag, int unit)
if (bootverbose) {
vp->vendor_status(cookie);
- bmista_1 = inb(iobase_bm_1 + BMISTA_PORT);
- bmista_2 = inb(iobase_bm_2 + BMISTA_PORT);
printf("ide_pci: busmaster 0 status: %02x from port: %08x\n",
bmista_1, iobase_bm_1+BMISTA_PORT);
@@ -1401,7 +1138,9 @@ ide_pci_attach(pcici_t tag, int unit)
}
}
- if (iobase_wd_2 != 0) {
+ if (bmista_1 & BMISTA_SIMPLEX || bmista_2 & BMISTA_SIMPLEX) {
+ printf("ide_pci: controller is simplex, no DMA on secondary channel\n");
+ } else if (iobase_wd_2 != 0) {
cookie = mkcookie(iobase_wd_2,
ctlridx + 1,
0,
@@ -1423,8 +1162,6 @@ ide_pci_attach(pcici_t tag, int unit)
if (bootverbose) {
vp->vendor_status(cookie);
- bmista_1 = inb(iobase_bm_1 + BMISTA_PORT);
- bmista_2 = inb(iobase_bm_2 + BMISTA_PORT);
printf("ide_pci: busmaster 1 status: %02x from port: %08x\n",
bmista_2, iobase_bm_2+BMISTA_PORT);
@@ -1449,17 +1186,16 @@ static struct pci_device ide_pci_device = {
DATA_SET(pcidevice_set, ide_pci_device);
/*
- * Return a cookie if we may be able to do DMA on the specified
- * (iobase_wd, ctlr, unit).
+ * Return a cookie if we can do DMA on the specified (iobase_wd, unit).
*/
static void *
-ide_pci_candma(int iobase_wd, int ctlr, int unit)
+ide_pci_candma(int iobase_wd, int unit)
{
struct ide_pci_cookie *cp;
cp = softc.cookies.lh_first;
while(cp) {
- if (cp->ctlr == ctlr && cp->unit == unit &&
+ if (cp->ctlr == unit &&
((iobase_wd == 0) || (cp->iobase_wd == iobase_wd)))
break;
cp = cp->le.le_next;
@@ -1529,10 +1265,7 @@ ide_pci_dmasetup(void *xcp, char *vaddr, u_long vcount, int dir)
u_long prd_base, prd_count;
u_long nbase, ncount, nend;
int iobase_bm;
- u_long count;
-#ifdef DIAGNOSTIC
- u_long checkcount;
-#endif
+ u_long count, checkcount;
prd = cp->prd;
@@ -1568,22 +1301,10 @@ ide_pci_dmasetup(void *xcp, char *vaddr, u_long vcount, int dir)
* Coalesce if physically contiguous and not crossing
* 64k boundary.
*/
-#if 0
- /*
- * Aggregation is NOT an optimisation worth doing,
- * and the Cyrix UDMA controller screws itself
- * in some aggregated situations.
- * We might as well just assign each 4K page a DMA entry
- * as this doesn't really gain us anything to aggregate them.
- * This was basically copied from my agregation code in the aha
- * driver, but I doubt it helped much there either. [JRE]
- */
if ((prd_base + prd_count == nbase) &&
((((nend - 1) ^ prd_base) & ~0xffff) == 0)) {
prd_count += ncount;
- } else
-#endif
- {
+ } else {
prd[i].prd_base = prd_base;
prd[i].prd_count = (prd_count & 0xffff);
i++;
@@ -1670,10 +1391,11 @@ ide_pci_dmadone(void *xcp)
static int
ide_pci_status(void *xcp)
{
+ struct ide_pci_cookie *cp = xcp;
int iobase_bm, status, bmista;
status = 0;
- iobase_bm = ((struct ide_pci_cookie *)xcp)->iobase_bm;
+ iobase_bm = cp->iobase_bm;
bmista = inb(iobase_bm + BMISTA_PORT);
@@ -1683,6 +1405,7 @@ ide_pci_status(void *xcp)
status |= WDDS_ERROR;
if (bmista & BMISTA_DMA_ACTIVE)
status |= WDDS_ACTIVE;
+
return status;
}
diff --git a/sys/pci/if_ax.c b/sys/pci/if_ax.c
deleted file mode 100644
index 34f1e881b5bee..0000000000000
--- a/sys/pci/if_ax.c
+++ /dev/null
@@ -1,2175 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_ax.c,v 1.8 1999/01/16 20:33:34 wpaul Exp $
- */
-
-/*
- * ASIX AX88140A fast ethernet PCI NIC driver.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The ASIX Electronics AX88140A is still another DEC 21x4x clone. It's
- * a reasonably close copy of the tulip, except for the receiver filter
- * programming. Where the DEC chip has a special setup frame that
- * needs to be downloaded into the transmit DMA engine, the ASIX chip
- * has a less complicated setup frame which is written into one of
- * the registers.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define AX_USEIOSPACE
-
-/* #define AX_BACKGROUND_AUTONEG */
-
-#include <pci/if_axreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_ax.c,v 1.8 1999/01/16 20:33:34 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct ax_type ax_devs[] = {
- { AX_VENDORID, AX_DEVICEID_AX88140A,
- "ASIX AX88140A 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct ax_type ax_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long ax_count = 0;
-static const char *ax_probe __P((pcici_t, pcidi_t));
-static void ax_attach __P((pcici_t, int));
-
-static int ax_newbuf __P((struct ax_softc *,
- struct ax_chain_onefrag *));
-static int ax_encap __P((struct ax_softc *, struct ax_chain *,
- struct mbuf *));
-
-static void ax_rxeof __P((struct ax_softc *));
-static void ax_rxeoc __P((struct ax_softc *));
-static void ax_txeof __P((struct ax_softc *));
-static void ax_txeoc __P((struct ax_softc *));
-static void ax_intr __P((void *));
-static void ax_start __P((struct ifnet *));
-static int ax_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void ax_init __P((void *));
-static void ax_stop __P((struct ax_softc *));
-static void ax_watchdog __P((struct ifnet *));
-static void ax_shutdown __P((int, void *));
-static int ax_ifmedia_upd __P((struct ifnet *));
-static void ax_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void ax_delay __P((struct ax_softc *));
-static void ax_eeprom_idle __P((struct ax_softc *));
-static void ax_eeprom_putbyte __P((struct ax_softc *, int));
-static void ax_eeprom_getword __P((struct ax_softc *, int, u_int16_t *));
-static void ax_read_eeprom __P((struct ax_softc *, caddr_t, int,
- int, int));
-
-static void ax_mii_writebit __P((struct ax_softc *, int));
-static int ax_mii_readbit __P((struct ax_softc *));
-static void ax_mii_sync __P((struct ax_softc *));
-static void ax_mii_send __P((struct ax_softc *, u_int32_t, int));
-static int ax_mii_readreg __P((struct ax_softc *, struct ax_mii_frame *));
-static int ax_mii_writereg __P((struct ax_softc *, struct ax_mii_frame *));
-static u_int16_t ax_phy_readreg __P((struct ax_softc *, int));
-static void ax_phy_writereg __P((struct ax_softc *, int, int));
-
-static void ax_autoneg_xmit __P((struct ax_softc *));
-static void ax_autoneg_mii __P((struct ax_softc *, int, int));
-static void ax_setmode_mii __P((struct ax_softc *, int));
-static void ax_setmode __P((struct ax_softc *, int, int));
-static void ax_getmode_mii __P((struct ax_softc *));
-static void ax_setcfg __P((struct ax_softc *, int));
-static u_int32_t ax_calchash __P((caddr_t));
-static void ax_setmulti __P((struct ax_softc *));
-static void ax_reset __P((struct ax_softc *));
-static int ax_list_rx_init __P((struct ax_softc *));
-static int ax_list_tx_init __P((struct ax_softc *));
-
-#define AX_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define AX_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_4(sc, AX_SIO, \
- CSR_READ_4(sc, AX_SIO) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_4(sc, AX_SIO, \
- CSR_READ_4(sc, AX_SIO) & ~x)
-
-static void ax_delay(sc)
- struct ax_softc *sc;
-{
- int idx;
-
- for (idx = (300 / 33) + 1; idx > 0; idx--)
- CSR_READ_4(sc, AX_BUSCTL);
-}
-
-static void ax_eeprom_idle(sc)
- struct ax_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_EESEL);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_ROMCTL_READ);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CS);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
-
- for (i = 0; i < 25; i++) {
- AX_CLRBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
- }
-
- AX_CLRBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
- AX_CLRBIT(sc, AX_SIO, AX_SIO_EE_CS);
- ax_delay(sc);
- CSR_WRITE_4(sc, AX_SIO, 0x00000000);
-
- return;
-}
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void ax_eeprom_putbyte(sc, addr)
- struct ax_softc *sc;
- int addr;
-{
- register int d, i;
-
- d = addr | AX_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- SIO_SET(AX_SIO_EE_DATAIN);
- } else {
- SIO_CLR(AX_SIO_EE_DATAIN);
- }
- ax_delay(sc);
- SIO_SET(AX_SIO_EE_CLK);
- ax_delay(sc);
- SIO_CLR(AX_SIO_EE_CLK);
- ax_delay(sc);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void ax_eeprom_getword(sc, addr, dest)
- struct ax_softc *sc;
- int addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Force EEPROM to idle state. */
- ax_eeprom_idle(sc);
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_EESEL);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_ROMCTL_READ);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CS);
- ax_delay(sc);
- AX_SETBIT(sc, AX_SIO, AX_SIO_EE_CLK);
- ax_delay(sc);
-
- /*
- * Send address of word we want to read.
- */
- ax_eeprom_putbyte(sc, addr);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- SIO_SET(AX_SIO_EE_CLK);
- ax_delay(sc);
- if (CSR_READ_4(sc, AX_SIO) & AX_SIO_EE_DATAOUT)
- word |= i;
- ax_delay(sc);
- SIO_CLR(AX_SIO_EE_CLK);
- ax_delay(sc);
- }
-
- /* Turn off EEPROM access mode. */
- ax_eeprom_idle(sc);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void ax_read_eeprom(sc, dest, off, cnt, swap)
- struct ax_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- ax_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-/*
- * Write a bit to the MII bus.
- */
-static void ax_mii_writebit(sc, bit)
- struct ax_softc *sc;
- int bit;
-{
- if (bit)
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_WRITE|AX_SIO_MII_DATAOUT);
- else
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_WRITE);
-
- AX_SETBIT(sc, AX_SIO, AX_SIO_MII_CLK);
- AX_CLRBIT(sc, AX_SIO, AX_SIO_MII_CLK);
-
- return;
-}
-
-/*
- * Read a bit from the MII bus.
- */
-static int ax_mii_readbit(sc)
- struct ax_softc *sc;
-{
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_READ|AX_SIO_MII_DIR);
- CSR_READ_4(sc, AX_SIO);
- AX_SETBIT(sc, AX_SIO, AX_SIO_MII_CLK);
- AX_CLRBIT(sc, AX_SIO, AX_SIO_MII_CLK);
- if (CSR_READ_4(sc, AX_SIO) & AX_SIO_MII_DATAIN)
- return(1);
-
- return(0);
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void ax_mii_sync(sc)
- struct ax_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, AX_SIO, AX_SIO_ROMCTL_WRITE);
-
- for (i = 0; i < 32; i++)
- ax_mii_writebit(sc, 1);
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void ax_mii_send(sc, bits, cnt)
- struct ax_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1)
- ax_mii_writebit(sc, bits & i);
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int ax_mii_readreg(sc, frame)
- struct ax_softc *sc;
- struct ax_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = AX_MII_STARTDELIM;
- frame->mii_opcode = AX_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- /*
- * Sync the PHYs.
- */
- ax_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- ax_mii_send(sc, frame->mii_stdelim, 2);
- ax_mii_send(sc, frame->mii_opcode, 2);
- ax_mii_send(sc, frame->mii_phyaddr, 5);
- ax_mii_send(sc, frame->mii_regaddr, 5);
-
-#ifdef notdef
- /* Idle bit */
- ax_mii_writebit(sc, 1);
- ax_mii_writebit(sc, 0);
-#endif
-
- /* Check for ack */
- ack = ax_mii_readbit(sc);
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- ax_mii_readbit(sc);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- if (!ack) {
- if (ax_mii_readbit(sc))
- frame->mii_data |= i;
- }
- }
-
-fail:
-
- ax_mii_writebit(sc, 0);
- ax_mii_writebit(sc, 0);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int ax_mii_writereg(sc, frame)
- struct ax_softc *sc;
- struct ax_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = AX_MII_STARTDELIM;
- frame->mii_opcode = AX_MII_WRITEOP;
- frame->mii_turnaround = AX_MII_TURNAROUND;
-
- /*
- * Sync the PHYs.
- */
- ax_mii_sync(sc);
-
- ax_mii_send(sc, frame->mii_stdelim, 2);
- ax_mii_send(sc, frame->mii_opcode, 2);
- ax_mii_send(sc, frame->mii_phyaddr, 5);
- ax_mii_send(sc, frame->mii_regaddr, 5);
- ax_mii_send(sc, frame->mii_turnaround, 2);
- ax_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- ax_mii_writebit(sc, 0);
- ax_mii_writebit(sc, 0);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t ax_phy_readreg(sc, reg)
- struct ax_softc *sc;
- int reg;
-{
- struct ax_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->ax_phy_addr;
- frame.mii_regaddr = reg;
- ax_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void ax_phy_writereg(sc, reg, data)
- struct ax_softc *sc;
- int reg;
- int data;
-{
- struct ax_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->ax_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- ax_mii_writereg(sc, &frame);
-
- return;
-}
-
-/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
- */
-static u_int32_t ax_calchash(addr)
- caddr_t addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /* return the filter bit position */
- return((crc >> 26) & 0x0000003F);
-}
-
-static void ax_setmulti(sc)
- struct ax_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int32_t rxfilt;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_4(sc, AX_NETCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
- rxfilt |= AX_NETCFG_RX_ALLMULTI;
- CSR_WRITE_4(sc, AX_NETCFG, rxfilt);
- return;
- } else
- rxfilt &= ~AX_NETCFG_RX_ALLMULTI;
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR0);
- CSR_WRITE_4(sc, AX_FILTDATA, 0);
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR1);
- CSR_WRITE_4(sc, AX_FILTDATA, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = ax_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- }
-
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR0);
- CSR_WRITE_4(sc, AX_FILTDATA, hashes[0]);
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_MAR1);
- CSR_WRITE_4(sc, AX_FILTDATA, hashes[1]);
- CSR_WRITE_4(sc, AX_NETCFG, rxfilt);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void ax_autoneg_xmit(sc)
- struct ax_softc *sc;
-{
- u_int16_t phy_sts;
-
- ax_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(ax_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = ax_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- ax_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void ax_autoneg_mii(sc, flag, verbose)
- struct ax_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = ax_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("ax%d: autonegotiation not supported\n",
- sc->ax_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case AX_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- ax_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case AX_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise ax_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->ax_cdata.ax_tx_head != NULL) {
- sc->ax_want_auto = 1;
- return;
- }
- ax_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->ax_autoneg = 1;
- sc->ax_want_auto = 0;
- return;
- break;
- case AX_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->ax_autoneg = 0;
- break;
- default:
- printf("ax%d: invalid autoneg flag: %d\n", sc->ax_unit, flag);
- return;
- }
-
- if (ax_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("ax%d: autoneg complete, ", sc->ax_unit);
- phy_sts = ax_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("ax%d: autoneg not complete, ", sc->ax_unit);
- }
-
- media = ax_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (ax_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = ax_phy_readreg(sc, PHY_ANAR);
- ability = ax_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- ax_setcfg(sc, media);
- ax_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- ax_init(sc);
-
- if (sc->ax_tx_pend) {
- sc->ax_autoneg = 0;
- sc->ax_tx_pend = 0;
- ax_start(ifp);
- }
-
- return;
-}
-
-static void ax_getmode_mii(sc)
- struct ax_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = ax_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("ax%d: PHY status word: %x\n", sc->ax_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("ax%d: 10Mbps half-duplex mode supported\n",
- sc->ax_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("ax%d: 10Mbps full-duplex mode supported\n",
- sc->ax_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("ax%d: 100Mbps half-duplex mode supported\n",
- sc->ax_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("ax%d: 100Mbps full-duplex mode supported\n",
- sc->ax_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("ax%d: 100baseT4 mode supported\n", sc->ax_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("ax%d: forcing on autoneg support for BT4\n",
- sc->ax_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("ax%d: autoneg supported\n", sc->ax_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void ax_setmode_mii(sc, media)
- struct ax_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->ax_autoneg) {
- printf("ax%d: canceling autoneg session\n", sc->ax_unit);
- ifp->if_timer = sc->ax_autoneg = sc->ax_want_auto = 0;
- bmcr = ax_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- ax_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("ax%d: selecting MII, ", sc->ax_unit);
-
- bmcr = ax_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- ax_setcfg(sc, bmcr);
- ax_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * Set speed and duplex mode on internal transceiver.
- */
-static void ax_setmode(sc, media, verbose)
- struct ax_softc *sc;
- int media;
- int verbose;
-{
- struct ifnet *ifp;
- u_int32_t mode;
-
- ifp = &sc->arpcom.ac_if;
-
- if (verbose)
- printf("ax%d: selecting internal xcvr, ", sc->ax_unit);
-
- mode = CSR_READ_4(sc, AX_NETCFG);
-
- mode &= ~(AX_NETCFG_FULLDUPLEX|AX_NETCFG_PORTSEL|
- AX_NETCFG_PCS|AX_NETCFG_SCRAMBLER|AX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- if (verbose)
- printf("100Mbps/T4, half-duplex\n");
- mode |= AX_NETCFG_PORTSEL|AX_NETCFG_PCS|AX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- if (verbose)
- printf("100Mbps, ");
- mode |= AX_NETCFG_PORTSEL|AX_NETCFG_PCS|AX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- if (verbose)
- printf("10Mbps, ");
- mode &= ~AX_NETCFG_PORTSEL;
- mode |= AX_NETCFG_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- if (verbose)
- printf("full duplex\n");
- mode |= AX_NETCFG_FULLDUPLEX;
- } else {
- if (verbose)
- printf("half duplex\n");
- mode &= ~AX_NETCFG_FULLDUPLEX;
- }
-
- CSR_WRITE_4(sc, AX_NETCFG, mode);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void ax_setcfg(sc, bmcr)
- struct ax_softc *sc;
- int bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, AX_NETCFG) & (AX_NETCFG_TX_ON|AX_NETCFG_RX_ON)) {
- restart = 1;
- AX_CLRBIT(sc, AX_NETCFG, (AX_NETCFG_TX_ON|AX_NETCFG_RX_ON));
-
- for (i = 0; i < AX_TIMEOUT; i++) {
- DELAY(10);
- if (CSR_READ_4(sc, AX_ISR) & AX_ISR_TX_IDLE)
- break;
- }
-
- if (i == AX_TIMEOUT)
- printf("ax%d: failed to force tx and "
- "rx to idle state\n", sc->ax_unit);
-
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL)
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_SPEEDSEL);
- else
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_SPEEDSEL);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_FULLDUPLEX);
- else
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_FULLDUPLEX);
-
- if (restart)
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_TX_ON|AX_NETCFG_RX_ON);
-
- return;
-}
-
-static void ax_reset(sc)
- struct ax_softc *sc;
-{
- register int i;
-
- AX_SETBIT(sc, AX_BUSCTL, AX_BUSCTL_RESET);
-
- for (i = 0; i < AX_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, AX_BUSCTL) & AX_BUSCTL_RESET))
- break;
- }
-#ifdef notdef
- if (i == AX_TIMEOUT)
- printf("ax%d: reset never completed!\n", sc->ax_unit);
-#endif
- CSR_WRITE_4(sc, AX_BUSCTL, AX_BUSCTL_CONFIG);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
- return;
-}
-
-/*
- * Probe for an ASIX chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-ax_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct ax_type *t;
-
- t = ax_devs;
-
- while(t->ax_name != NULL) {
- if ((device_id & 0xFFFF) == t->ax_vid &&
- ((device_id >> 16) & 0xFFFF) == t->ax_did) {
- return(t->ax_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-ax_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef AX_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct ax_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct ax_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-
- s = splimp();
-
- sc = malloc(sizeof(struct ax_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("ax%d: no memory for softc struct!\n", unit);
- goto fail;
- }
- bzero(sc, sizeof(struct ax_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, AX_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, AX_PCI_PWRMGMTCTRL);
- if (command & AX_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, AX_PCI_LOIO);
- membase = pci_conf_read(config_id, AX_PCI_LOMEM);
- irq = pci_conf_read(config_id, AX_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("ax%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & AX_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, AX_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, AX_PCI_LOIO, iobase);
- pci_conf_write(config_id, AX_PCI_LOMEM, membase);
- pci_conf_write(config_id, AX_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef AX_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("ax%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, AX_PCI_LOIO,
- (u_short *)&(sc->ax_bhandle))) {
- printf ("ax%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->ax_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("ax%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, AX_PCI_LOMEM, &vbase, &pbase)) {
- printf ("ax%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->ax_btag = I386_BUS_SPACE_MEM;
- sc->ax_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, ax_intr, sc, &net_imask)) {
- printf("ax%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- ax_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- ax_read_eeprom(sc, (caddr_t)&eaddr, AX_EE_NODEADDR, 3, 0);
-
- /*
- * An ASIX chip was detected. Inform the world.
- */
- printf("ax%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->ax_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->ax_ldata_ptr = malloc(sizeof(struct ax_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->ax_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("ax%d: no memory for list buffers!\n", unit);
- goto fail;
- }
-
- sc->ax_ldata = (struct ax_list_data *)sc->ax_ldata_ptr;
- round = (unsigned int)sc->ax_ldata_ptr & 0xF;
- roundptr = sc->ax_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->ax_ldata = (struct ax_list_data *)roundptr;
- bzero(sc->ax_ldata, sizeof(struct ax_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "ax";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = ax_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = ax_start;
- ifp->if_watchdog = ax_watchdog;
- ifp->if_init = ax_init;
- ifp->if_baudrate = 10000000;
-
-
- if (bootverbose)
- printf("ax%d: probing for a PHY\n", sc->ax_unit);
- for (i = AX_PHYADDR_MIN; i < AX_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("ax%d: checking address: %d\n",
- sc->ax_unit, i);
- sc->ax_phy_addr = i;
- ax_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(ax_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = ax_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = ax_phy_readreg(sc, PHY_VENID);
- phy_did = ax_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("ax%d: found PHY at address %d, ",
- sc->ax_unit, sc->ax_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = ax_phys;
- while(p->ax_vid) {
- if (phy_vid == p->ax_vid &&
- (phy_did | 0x000F) == p->ax_did) {
- sc->ax_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->ax_pinfo == NULL)
- sc->ax_pinfo = &ax_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("ax%d: PHY type: %s\n",
- sc->ax_unit, sc->ax_pinfo->ax_name);
- } else {
-#ifdef DIAGNOSTIC
- printf("ax%d: MII without any phy!\n", sc->ax_unit);
-#endif
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, ax_ifmedia_upd, ax_ifmedia_sts);
-
- if (sc->ax_pinfo != NULL) {
- ax_getmode_mii(sc);
- ax_autoneg_mii(sc, AX_FLAG_FORCEDELAY, 1);
- } else {
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- }
-
- media = sc->ifmedia.ifm_media;
- ax_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(ax_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int ax_list_tx_init(sc)
- struct ax_softc *sc;
-{
- struct ax_chain_data *cd;
- struct ax_list_data *ld;
- int i;
-
- cd = &sc->ax_cdata;
- ld = sc->ax_ldata;
- for (i = 0; i < AX_TX_LIST_CNT; i++) {
- cd->ax_tx_chain[i].ax_ptr = &ld->ax_tx_list[i];
- if (i == (AX_TX_LIST_CNT - 1))
- cd->ax_tx_chain[i].ax_nextdesc =
- &cd->ax_tx_chain[0];
- else
- cd->ax_tx_chain[i].ax_nextdesc =
- &cd->ax_tx_chain[i + 1];
- }
-
- cd->ax_tx_free = &cd->ax_tx_chain[0];
- cd->ax_tx_tail = cd->ax_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int ax_list_rx_init(sc)
- struct ax_softc *sc;
-{
- struct ax_chain_data *cd;
- struct ax_list_data *ld;
- int i;
-
- cd = &sc->ax_cdata;
- ld = sc->ax_ldata;
-
- for (i = 0; i < AX_RX_LIST_CNT; i++) {
- cd->ax_rx_chain[i].ax_ptr =
- (struct ax_desc *)&ld->ax_rx_list[i];
- if (ax_newbuf(sc, &cd->ax_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (AX_RX_LIST_CNT - 1)) {
- cd->ax_rx_chain[i].ax_nextdesc =
- &cd->ax_rx_chain[0];
- ld->ax_rx_list[i].ax_next =
- vtophys(&ld->ax_rx_list[0]);
- } else {
- cd->ax_rx_chain[i].ax_nextdesc =
- &cd->ax_rx_chain[i + 1];
- ld->ax_rx_list[i].ax_next =
- vtophys(&ld->ax_rx_list[i + 1]);
- }
- }
-
- cd->ax_rx_head = &cd->ax_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int ax_newbuf(sc, c)
- struct ax_softc *sc;
- struct ax_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("ax%d: no memory for rx list -- packet dropped!\n",
- sc->ax_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("ax%d: no memory for rx list -- packet dropped!\n",
- sc->ax_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->ax_mbuf = m_new;
- c->ax_ptr->ax_status = AX_RXSTAT;
- c->ax_ptr->ax_data = vtophys(mtod(m_new, caddr_t));
- c->ax_ptr->ax_ctl = MCLBYTES - 1;
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void ax_rxeof(sc)
- struct ax_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct ax_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->ax_cdata.ax_rx_head->ax_ptr->ax_status) &
- AX_RXSTAT_OWN)) {
- cur_rx = sc->ax_cdata.ax_rx_head;
- sc->ax_cdata.ax_rx_head = cur_rx->ax_nextdesc;
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & AX_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- if (rxstat & AX_RXSTAT_COLLSEEN)
- ifp->if_collisions++;
- cur_rx->ax_ptr->ax_status = AX_RXSTAT;
- cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->ax_mbuf;
- total_len = AX_RXBYTES(cur_rx->ax_ptr->ax_status);
-
- total_len -= ETHER_CRC_LEN;
-
- if (total_len < MINCLSIZE) {
- m = m_devget(mtod(cur_rx->ax_mbuf, char *),
- total_len, 0, ifp, NULL);
- cur_rx->ax_ptr->ax_status = AX_RXSTAT;
- cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
- if (m == NULL) {
- ifp->if_ierrors++;
- continue;
- }
- } else {
- m = cur_rx->ax_mbuf;
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (ax_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->ax_ptr->ax_status = AX_RXSTAT;
- cur_rx->ax_ptr->ax_ctl = (MCLBYTES - 1);
- continue;
- }
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void ax_rxeoc(sc)
- struct ax_softc *sc;
-{
-
- ax_rxeof(sc);
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, AX_RXADDR, vtophys(sc->ax_cdata.ax_rx_head->ax_ptr));
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, AX_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void ax_txeof(sc)
- struct ax_softc *sc;
-{
- struct ax_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->ax_cdata.ax_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->ax_cdata.ax_tx_head->ax_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->ax_cdata.ax_tx_head;
- txstat = AX_TXSTATUS(cur_tx);
-
- if (txstat & AX_TXSTAT_OWN)
- break;
-
- if (txstat & AX_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & AX_TXSTAT_EXCESSCOLL)
- ifp->if_collisions++;
- if (txstat & AX_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & AX_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- m_freem(cur_tx->ax_mbuf);
- cur_tx->ax_mbuf = NULL;
-
- if (sc->ax_cdata.ax_tx_head == sc->ax_cdata.ax_tx_tail) {
- sc->ax_cdata.ax_tx_head = NULL;
- sc->ax_cdata.ax_tx_tail = NULL;
- break;
- }
-
- sc->ax_cdata.ax_tx_head = cur_tx->ax_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void ax_txeoc(sc)
- struct ax_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->ax_cdata.ax_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->ax_cdata.ax_tx_tail = NULL;
- if (sc->ax_want_auto)
- ax_autoneg_mii(sc, AX_FLAG_DELAYTIMEO, 1);
- }
-
- return;
-}
-
-static void ax_intr(arg)
- void *arg;
-{
- struct ax_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts */
- if (!(ifp->if_flags & IFF_UP)) {
- ax_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, AX_IMR, 0x00000000);
-
- for (;;) {
- status = CSR_READ_4(sc, AX_ISR);
- if (status)
- CSR_WRITE_4(sc, AX_ISR, status);
-
- if ((status & AX_INTRS) == 0)
- break;
-
- if ((status & AX_ISR_TX_OK) || (status & AX_ISR_TX_EARLY))
- ax_txeof(sc);
-
- if (status & AX_ISR_TX_NOBUF)
- ax_txeoc(sc);
-
- if (status & AX_ISR_TX_IDLE) {
- ax_txeof(sc);
- if (sc->ax_cdata.ax_tx_head != NULL) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_TX_ON);
- CSR_WRITE_4(sc, AX_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & AX_ISR_TX_UNDERRUN) {
- u_int32_t cfg;
- cfg = CSR_READ_4(sc, AX_NETCFG);
- if ((cfg & AX_NETCFG_TX_THRESH) == AX_TXTHRESH_160BYTES)
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_STORENFWD);
- else
- CSR_WRITE_4(sc, AX_NETCFG, cfg + 0x4000);
- }
-
- if (status & AX_ISR_RX_OK)
- ax_rxeof(sc);
-
- if ((status & AX_ISR_RX_WATDOGTIMEO)
- || (status & AX_ISR_RX_NOBUF))
- ax_rxeoc(sc);
-
- if (status & AX_ISR_BUS_ERR) {
- ax_reset(sc);
- ax_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, AX_IMR, AX_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- ax_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int ax_encap(sc, c, m_head)
- struct ax_softc *sc;
- struct ax_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- volatile struct ax_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == AX_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->ax_ptr->ax_frag[frag];
- f->ax_ctl = m->m_len;
- if (frag == 0) {
- f->ax_status = 0;
- f->ax_ctl |= AX_TXCTL_FIRSTFRAG;
- } else
- f->ax_status = AX_TXSTAT_OWN;
- f->ax_next = vtophys(&c->ax_ptr->ax_frag[frag + 1]);
- f->ax_data = vtophys(mtod(m, vm_offset_t));
- frag++;
- }
- }
-
- /*
- * Handle special case: we ran out of fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("ax%d: no memory for tx list", sc->ax_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("ax%d: no memory for tx list",
- sc->ax_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->ax_ptr->ax_frag[0];
- f->ax_status = 0;
- f->ax_data = vtophys(mtod(m_new, caddr_t));
- f->ax_ctl = total_len = m_new->m_len;
- f->ax_ctl |= AX_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
- c->ax_mbuf = m_head;
- c->ax_lastdesc = frag - 1;
- AX_TXCTL(c) |= AX_TXCTL_LASTFRAG|AX_TXCTL_FINT;
- c->ax_ptr->ax_frag[0].ax_ctl |= AX_TXCTL_FINT;
- AX_TXNEXT(c) = vtophys(&c->ax_nextdesc->ax_ptr->ax_frag[0]);
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void ax_start(ifp)
- struct ifnet *ifp;
-{
- struct ax_softc *sc;
- struct mbuf *m_head = NULL;
- struct ax_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->ax_autoneg) {
- sc->ax_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->ax_cdata.ax_tx_free->ax_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->ax_cdata.ax_tx_free;
-
- while(sc->ax_cdata.ax_tx_free->ax_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->ax_cdata.ax_tx_free;
- sc->ax_cdata.ax_tx_free = cur_tx->ax_nextdesc;
-
- /* Pack the data into the descriptor. */
- ax_encap(sc, cur_tx, m_head);
- if (cur_tx != start_tx)
- AX_TXOWN(cur_tx) = AX_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->ax_mbuf);
-#endif
- AX_TXOWN(cur_tx) = AX_TXSTAT_OWN;
- CSR_WRITE_4(sc, AX_TXSTART, 0xFFFFFFFF);
- }
-
- sc->ax_cdata.ax_tx_tail = cur_tx;
- if (sc->ax_cdata.ax_tx_head == NULL)
- sc->ax_cdata.ax_tx_head = start_tx;
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void ax_init(xsc)
- void *xsc;
-{
- struct ax_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->ax_autoneg)
- return;
-
- s = splimp();
-
- if (sc->ax_pinfo != NULL)
- phy_bmcr = ax_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- ax_stop(sc);
- ax_reset(sc);
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, AX_BUSCTL, AX_BUSCTL_CONFIG);
-
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_HEARTBEAT);
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_STORENFWD);
-
- if (sc->ax_pinfo != NULL) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_PORTSEL);
- ax_setcfg(sc, ax_phy_readreg(sc, PHY_BMCR));
- } else
- ax_setmode(sc, sc->ifmedia.ifm_media, 0);
-
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_TX_THRESH);
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(sc->ifmedia.ifm_media) == IFM_10_T)
- AX_SETBIT(sc, AX_NETCFG, AX_TXTHRESH_160BYTES);
- else
- AX_SETBIT(sc, AX_NETCFG, AX_TXTHRESH_72BYTES);
-
- /* Init our MAC address */
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_PAR0);
- CSR_WRITE_4(sc, AX_FILTDATA, *(u_int32_t *)(&sc->arpcom.ac_enaddr[0]));
- CSR_WRITE_4(sc, AX_FILTIDX, AX_FILTIDX_PAR1);
- CSR_WRITE_4(sc, AX_FILTDATA, *(u_int32_t *)(&sc->arpcom.ac_enaddr[4]));
-
- /* Init circular RX list. */
- if (ax_list_rx_init(sc) == ENOBUFS) {
- printf("ax%d: initialization failed: no "
- "memory for rx buffers\n", sc->ax_unit);
- ax_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- ax_list_tx_init(sc);
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_RX_PROMISC);
- } else {
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_RX_PROMISC);
- }
-
- /*
- * Set the capture broadcast bit to capture broadcast frames.
- */
- if (ifp->if_flags & IFF_BROADCAST) {
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_RX_BROAD);
- } else {
- AX_CLRBIT(sc, AX_NETCFG, AX_NETCFG_RX_BROAD);
- }
-
- /*
- * Load the multicast filter.
- */
- ax_setmulti(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, AX_RXADDR, vtophys(sc->ax_cdata.ax_rx_head->ax_ptr));
- CSR_WRITE_4(sc, AX_TXADDR, vtophys(&sc->ax_ldata->ax_tx_list[0]));
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, AX_IMR, AX_INTRS);
- CSR_WRITE_4(sc, AX_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- AX_SETBIT(sc, AX_NETCFG, AX_NETCFG_TX_ON|AX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, AX_RXSTART, 0xFFFFFFFF);
-
- /* Restore state of BMCR */
- if (sc->ax_pinfo != NULL)
- ax_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int ax_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct ax_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- ax_autoneg_mii(sc, AX_FLAG_SCHEDDELAY, 1);
- else {
- if (sc->ax_pinfo == NULL)
- ax_setmode(sc, ifm->ifm_media, 1);
- else
- ax_setmode_mii(sc, ifm->ifm_media);
- }
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void ax_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct ax_softc *sc;
- u_int16_t advert = 0, ability = 0;
- u_int32_t media = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (sc->ax_pinfo == NULL) {
- media = CSR_READ_4(sc, AX_NETCFG);
- if (media & AX_NETCFG_PORTSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (media & AX_NETCFG_FULLDUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- if (!(ax_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (ax_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (ax_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = ax_phy_readreg(sc, PHY_LPAR);
- advert = ax_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int ax_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct ax_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- ax_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- ax_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- ax_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void ax_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct ax_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->ax_autoneg) {
- ax_autoneg_mii(sc, AX_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("ax%d: watchdog timeout\n", sc->ax_unit);
-
- if (sc->ax_pinfo != NULL) {
- if (!(ax_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("ax%d: no carrier - transceiver "
- "cable problem?\n", sc->ax_unit);
- }
-
- ax_stop(sc);
- ax_reset(sc);
- ax_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- ax_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void ax_stop(sc)
- struct ax_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- AX_CLRBIT(sc, AX_NETCFG, (AX_NETCFG_RX_ON|AX_NETCFG_TX_ON));
- CSR_WRITE_4(sc, AX_IMR, 0x00000000);
- CSR_WRITE_4(sc, AX_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, AX_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < AX_RX_LIST_CNT; i++) {
- if (sc->ax_cdata.ax_rx_chain[i].ax_mbuf != NULL) {
- m_freem(sc->ax_cdata.ax_rx_chain[i].ax_mbuf);
- sc->ax_cdata.ax_rx_chain[i].ax_mbuf = NULL;
- }
- }
- bzero((char *)&sc->ax_ldata->ax_rx_list,
- sizeof(sc->ax_ldata->ax_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < AX_TX_LIST_CNT; i++) {
- if (sc->ax_cdata.ax_tx_chain[i].ax_mbuf != NULL) {
- m_freem(sc->ax_cdata.ax_tx_chain[i].ax_mbuf);
- sc->ax_cdata.ax_tx_chain[i].ax_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->ax_ldata->ax_tx_list,
- sizeof(sc->ax_ldata->ax_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void ax_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct ax_softc *sc = (struct ax_softc *)arg;
-
- ax_stop(sc);
-
- return;
-}
-
-static struct pci_device ax_device = {
- "ax",
- ax_probe,
- ax_attach,
- &ax_count,
- NULL
-};
-DATA_SET(pcidevice_set, ax_device);
diff --git a/sys/pci/if_axreg.h b/sys/pci/if_axreg.h
deleted file mode 100644
index 700c42ca9463f..0000000000000
--- a/sys/pci/if_axreg.h
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_axreg.h,v 1.4 1999/01/16 20:33:34 wpaul Exp $
- */
-
-/*
- * ASIX register definitions.
- */
-
-#define AX_BUSCTL 0x00 /* bus control */
-#define AX_TXSTART 0x08 /* tx start demand */
-#define AX_RXSTART 0x10 /* rx start demand */
-#define AX_RXADDR 0x18 /* rx descriptor list start addr */
-#define AX_TXADDR 0x20 /* tx descriptor list start addr */
-#define AX_ISR 0x28 /* interrupt status register */
-#define AX_NETCFG 0x30 /* network config register */
-#define AX_IMR 0x38 /* interrupt mask */
-#define AX_FRAMESDISCARDED 0x40 /* # of discarded frames */
-#define AX_SIO 0x48 /* MII and ROM/EEPROM access */
-#define AX_RESERVED 0x50
-#define AX_GENTIMER 0x58 /* general timer */
-#define AX_GENPORT 0x60 /* general purpose port */
-#define AX_FILTIDX 0x68 /* RX filter index */
-#define AX_FILTDATA 0x70 /* RX filter data */
-
-/*
- * Bus control bits.
- */
-#define AX_BUSCTL_RESET 0x00000001
-#define AX_BUSCTL_ARBITRATION 0x00000002
-#define AX_BUSCTL_BIGENDIAN 0x00000080
-#define AX_BUSCTL_BURSTLEN 0x00003F00
-#define AX_BUSCTL_BUF_BIGENDIAN 0x00100000
-#define AX_BISCTL_READMULTI 0x00200000
-
-#define AX_BURSTLEN_UNLIMIT 0x00000000
-#define AX_BURSTLEN_1LONG 0x00000100
-#define AX_BURSTLEN_2LONG 0x00000200
-#define AX_BURSTLEN_4LONG 0x00000400
-#define AX_BURSTLEN_8LONG 0x00000800
-#define AX_BURSTLEN_16LONG 0x00001000
-#define AX_BURSTLEN_32LONG 0x00002000
-
-#define AX_BUSCTL_CONFIG (AX_BUSCTL_ARBITRATION|AX_BURSTLEN_8LONG|AX_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define AX_ISR_TX_OK 0x00000001
-#define AX_ISR_TX_IDLE 0x00000002
-#define AX_ISR_TX_NOBUF 0x00000004
-#define AX_ISR_TX_JABBERTIMEO 0x00000008
-#define AX_ISR_TX_UNDERRUN 0x00000020
-#define AX_ISR_RX_OK 0x00000040
-#define AX_ISR_RX_NOBUF 0x00000080
-#define AX_ISR_RX_IDLE 0x00000100
-#define AX_ISR_RX_WATDOGTIMEO 0x00000200
-#define AX_ISR_TX_EARLY 0x00000400
-#define AX_ISR_TIMER_EXPIRED 0x00000800
-#define AX_ISR_BUS_ERR 0x00002000
-#define AX_ISR_ABNORMAL 0x00008000
-#define AX_ISR_NORMAL 0x00010000
-#define AX_ISR_RX_STATE 0x000E0000
-#define AX_ISR_TX_STATE 0x00700000
-#define AX_ISR_BUSERRTYPE 0x03800000
-
-#define AX_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define AX_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define AX_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define AX_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define AX_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define AX_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */
-#define AX_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define AX_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define AX_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define AX_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define AX_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define AX_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define AX_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define AX_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define AX_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define AX_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-/*
- * Network config bits.
- */
-#define AX_NETCFG_LINKSTAT_PCS 0x00000001
-#define AX_NETCFG_RX_ON 0x00000002
-#define AX_NETCFG_RX_BADFRAMES 0x00000008
-#define AX_NETCFG_RX_PROMISC 0x00000040
-#define AX_NETCFG_RX_ALLMULTI 0x00000080
-#define AX_NETCFG_RX_BROAD 0x00000100
-#define AX_NETCFG_FULLDUPLEX 0x00000200
-#define AX_NETCFG_LOOPBACK 0x00000C00
-#define AX_NETCFG_FORCECOLL 0x00001000
-#define AX_NETCFG_TX_ON 0x00002000
-#define AX_NETCFG_TX_THRESH 0x0000C000
-#define AX_NETCFG_PORTSEL 0x00040000 /* 0 == SRL, 1 == MII/SYM */
-#define AX_NETCFG_HEARTBEAT 0x00080000 /* 0 == ON, 1 == OFF */
-#define AX_NETCFG_STORENFWD 0x00200000
-#define AX_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10, 0 == 100 */
-#define AX_NETCFG_PCS 0x00800000
-#define AX_NETCFG_SCRAMBLER 0x01000000
-#define AX_NETCFG_RX_ALL 0x40000000
-
-#define AX_OPMODE_NORM 0x00000000
-#define AX_OPMODE_INTLOOP 0x00000400
-#define AX_OPMODE_EXTLOOP 0x00000800
-
-#define AX_TXTHRESH_72BYTES 0x00000000
-#define AX_TXTHRESH_96BYTES 0x00004000
-#define AX_TXTHRESH_128BYTES 0x00008000
-#define AX_TXTHRESH_160BYTES 0x0000C000
-
-/*
- * Interrupt mask bits.
- */
-#define AX_IMR_TX_OK 0x00000001
-#define AX_IMR_TX_IDLE 0x00000002
-#define AX_IMR_TX_NOBUF 0x00000004
-#define AX_IMR_TX_JABBERTIMEO 0x00000008
-#define AX_IMR_TX_UNDERRUN 0x00000020
-#define AX_IMR_RX_OK 0x00000040
-#define AX_IMR_RX_NOBUF 0x00000080
-#define AX_IMR_RX_IDLE 0x00000100
-#define AX_IMR_RX_WATDOGTIMEO 0x00000200
-#define AX_IMR_TX_EARLY 0x00000400
-#define AX_IMR_TIMER_EXPIRED 0x00000800
-#define AX_IMR_BUS_ERR 0x00002000
-#define AX_IMR_RX_EARLY 0x00004000
-#define AX_IMR_ABNORMAL 0x00008000
-#define AX_IMR_NORMAL 0x00010000
-
-#define AX_INTRS \
- (AX_IMR_RX_OK|AX_IMR_TX_OK|AX_IMR_RX_NOBUF|AX_IMR_RX_WATDOGTIMEO|\
- AX_IMR_TX_NOBUF|AX_IMR_TX_UNDERRUN|AX_IMR_BUS_ERR| \
- AX_IMR_ABNORMAL|AX_IMR_NORMAL|/*AX_IMR_TX_EARLY*/ \
- AX_IMR_TX_IDLE|AX_IMR_RX_IDLE)
-
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define AX_SIO_EE_CS 0x00000001 /* EEPROM chip select */
-#define AX_SIO_EE_CLK 0x00000002 /* EEPROM clock */
-#define AX_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */
-#define AX_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */
-#define AX_SIO_EESEL 0x00000800
-#define AX_SIO_ROMSEL 0x00001000
-#define AX_SIO_ROMCTL_WRITE 0x00002000
-#define AX_SIO_ROMCTL_READ 0x00004000
-#define AX_SIO_MII_CLK 0x00010000 /* MDIO clock */
-#define AX_SIO_MII_DATAOUT 0x00020000 /* MDIO data out */
-#define AX_SIO_MII_DIR 0x00040000 /* MDIO dir */
-#define AX_SIO_MII_DATAIN 0x00080000 /* MDIO data in */
-
-#define AX_EECMD_WRITE 0x140
-#define AX_EECMD_READ 0x180
-#define AX_EECMD_ERASE 0x1c0
-
-#define AX_EE_NODEADDR_OFFSET 0x70
-#define AX_EE_NODEADDR 10
-
-/*
- * General purpose timer register
- */
-#define AX_TIMER_VALUE 0x0000FFFF
-#define AX_TIMER_CONTINUOUS 0x00010000
-
-/*
- * RX Filter Index Register values
- */
-#define AX_FILTIDX_PAR0 0x00000000
-#define AX_FILTIDX_PAR1 0x00000001
-#define AX_FILTIDX_MAR0 0x00000002
-#define AX_FILTIDX_MAR1 0x00000003
-
-/*
- * ASIX TX/RX list structure.
- */
-
-struct ax_desc {
- volatile u_int32_t ax_status;
- volatile u_int32_t ax_ctl;
- volatile u_int32_t ax_ptr1;
- volatile u_int32_t ax_ptr2;
-};
-
-#define ax_data ax_ptr1
-#define ax_next ax_ptr2
-
-#define AX_RXSTAT_FIFOOFLOW 0x00000001
-#define AX_RXSTAT_CRCERR 0x00000002
-#define AX_RXSTAT_DRIBBLE 0x00000004
-#define AX_RXSTAT_WATCHDOG 0x00000010
-#define AX_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */
-#define AX_RXSTAT_COLLSEEN 0x00000040
-#define AX_RXSTAT_GIANT 0x00000080
-#define AX_RXSTAT_LASTFRAG 0x00000100
-#define AX_RXSTAT_FIRSTFRAG 0x00000200
-#define AX_RXSTAT_MULTICAST 0x00000400
-#define AX_RXSTAT_RUNT 0x00000800
-#define AX_RXSTAT_RXTYPE 0x00003000
-#define AX_RXSTAT_RXERR 0x00008000
-#define AX_RXSTAT_RXLEN 0x3FFF0000
-#define AX_RXSTAT_OWN 0x80000000
-
-#define AX_RXBYTES(x) ((x & AX_RXSTAT_RXLEN) >> 16)
-#define AX_RXSTAT (AX_RXSTAT_FIRSTFRAG|AX_RXSTAT_LASTFRAG|AX_RXSTAT_OWN)
-
-#define AX_RXCTL_BUFLEN1 0x00000FFF
-#define AX_RXCTL_BUFLEN2 0x00FFF000
-#define AX_RXCTL_RLAST 0x02000000
-
-#define AX_TXSTAT_DEFER 0x00000001
-#define AX_TXSTAT_UNDERRUN 0x00000002
-#define AX_TXSTAT_LINKFAIL 0x00000003
-#define AX_TXSTAT_COLLCNT 0x00000078
-#define AX_TXSTAT_SQE 0x00000080
-#define AX_TXSTAT_EXCESSCOLL 0x00000100
-#define AX_TXSTAT_LATECOLL 0x00000200
-#define AX_TXSTAT_NOCARRIER 0x00000400
-#define AX_TXSTAT_CARRLOST 0x00000800
-#define AX_TXSTAT_JABTIMEO 0x00004000
-#define AX_TXSTAT_ERRSUM 0x00008000
-#define AX_TXSTAT_OWN 0x80000000
-
-#define AX_TXCTL_BUFLEN1 0x000007FF
-#define AX_TXCTL_BUFLEN2 0x003FF800
-#define AX_TXCTL_PAD 0x00800000
-#define AX_TXCTL_TLAST 0x02000000
-#define AX_TXCTL_NOCRC 0x04000000
-#define AX_TXCTL_FIRSTFRAG 0x20000000
-#define AX_TXCTL_LASTFRAG 0x40000000
-#define AX_TXCTL_FINT 0x80000000
-
-#define AX_MAXFRAGS 16
-#define AX_RX_LIST_CNT 64
-#define AX_TX_LIST_CNT 64
-#define AX_MIN_FRAMELEN 60
-
-/*
- * A tx 'super descriptor' is actually 16 regular descriptors
- * back to back.
- */
-struct ax_txdesc {
- volatile struct ax_desc ax_frag[AX_MAXFRAGS];
-};
-
-#define AX_TXNEXT(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_next
-#define AX_TXSTATUS(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_status
-#define AX_TXCTL(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_ctl
-#define AX_TXDATA(x) x->ax_ptr->ax_frag[x->ax_lastdesc].ax_data
-
-#define AX_TXOWN(x) x->ax_ptr->ax_frag[0].ax_status
-
-#define AX_UNSENT 0x12341234
-
-struct ax_list_data {
- volatile struct ax_desc ax_rx_list[AX_RX_LIST_CNT];
- volatile struct ax_txdesc ax_tx_list[AX_TX_LIST_CNT];
-};
-
-struct ax_chain {
- volatile struct ax_txdesc *ax_ptr;
- struct mbuf *ax_mbuf;
- struct ax_chain *ax_nextdesc;
- u_int8_t ax_lastdesc;
-};
-
-struct ax_chain_onefrag {
- volatile struct ax_desc *ax_ptr;
- struct mbuf *ax_mbuf;
- struct ax_chain_onefrag *ax_nextdesc;
-};
-
-struct ax_chain_data {
- struct ax_chain_onefrag ax_rx_chain[AX_RX_LIST_CNT];
- struct ax_chain ax_tx_chain[AX_TX_LIST_CNT];
-
- struct ax_chain_onefrag *ax_rx_head;
-
- struct ax_chain *ax_tx_head;
- struct ax_chain *ax_tx_tail;
- struct ax_chain *ax_tx_free;
-};
-
-struct ax_type {
- u_int16_t ax_vid;
- u_int16_t ax_did;
- char *ax_name;
-};
-
-struct ax_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define AX_MII_STARTDELIM 0x01
-#define AX_MII_READOP 0x02
-#define AX_MII_WRITEOP 0x01
-#define AX_MII_TURNAROUND 0x02
-
-#define AX_FLAG_FORCEDELAY 1
-#define AX_FLAG_SCHEDDELAY 2
-#define AX_FLAG_DELAYTIMEO 3
-
-struct ax_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t ax_bhandle; /* bus space handle */
- bus_space_tag_t ax_btag; /* bus space tag */
- struct ax_type *ax_info; /* ASIX adapter info */
- struct ax_type *ax_pinfo; /* phy info */
- u_int8_t ax_unit; /* interface number */
- u_int8_t ax_type;
- u_int8_t ax_phy_addr; /* PHY address */
- u_int8_t ax_tx_pend; /* TX pending */
- u_int8_t ax_want_auto;
- u_int8_t ax_autoneg;
- caddr_t ax_ldata_ptr;
- struct ax_list_data *ax_ldata;
- struct ax_chain_data ax_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->ax_btag, sc->ax_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->ax_btag, sc->ax_bbhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->ax_btag, sc->ax_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->ax_btag, sc->ax_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->ax_btag, sc->ax_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->ax_btag, sc->ax_bhandle, reg)
-
-#define AX_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * ASIX PCI vendor ID
- */
-#define AX_VENDORID 0x125B
-
-/*
- * ASIX device IDs.
- */
-#define AX_DEVICEID_AX88140A 0x1400
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define AX_PCI_VENDOR_ID 0x00
-#define AX_PCI_DEVICE_ID 0x02
-#define AX_PCI_COMMAND 0x04
-#define AX_PCI_STATUS 0x06
-#define AX_PCI_REVID 0x08
-#define AX_PCI_CLASSCODE 0x09
-#define AX_PCI_LATENCY_TIMER 0x0D
-#define AX_PCI_HEADER_TYPE 0x0E
-#define AX_PCI_LOIO 0x10
-#define AX_PCI_LOMEM 0x14
-#define AX_PCI_BIOSROM 0x30
-#define AX_PCI_INTLINE 0x3C
-#define AX_PCI_INTPIN 0x3D
-#define AX_PCI_MINGNT 0x3E
-#define AX_PCI_MINLAT 0x0F
-#define AX_PCI_RESETOPT 0x48
-#define AX_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define AX_PCI_CAPID 0xDC /* 8 bits */
-#define AX_PCI_NEXTPTR 0xDD /* 8 bits */
-#define AX_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define AX_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define AX_PSTATE_MASK 0x0003
-#define AX_PSTATE_D0 0x0000
-#define AX_PSTATE_D1 0x0001
-#define AX_PSTATE_D2 0x0002
-#define AX_PSTATE_D3 0x0003
-#define AX_PME_EN 0x0010
-#define AX_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define AX_PHYADDR_MIN 0x00
-#define AX_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index 82354275e8660..8b74e4358aaf2 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/if_de.c
@@ -1,5 +1,5 @@
/* $NetBSD: if_de.c,v 1.80 1998/09/25 18:06:53 matt Exp $ */
-/* $Id: if_de.c,v 1.92 1998/12/14 05:47:26 dillon Exp $ */
+/* $Id: if_de.c,v 1.88 1998/10/13 09:05:57 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -39,6 +39,11 @@
*/
#define TULIP_HDR_DATA
+#ifdef __FreeBSD__
+#include "opt_inet.h"
+#include "opt_ipx.h"
+#endif
+
#ifdef __NetBSD__
#include "opt_inet.h"
#include "opt_ns.h"
@@ -57,21 +62,6 @@
#include <sys/device.h>
#endif
-#if defined(__FreeBSD__)
-/* In case somebody is trying to run this on an older 2.2 or 3.0 */
-#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
-#if __FreeBSD__ >= 3
-#define __FreeBSD_version 300000
-#else
-#define __FreeBSD_version 200000
-#endif
-#endif
-#if __FreeBSD_version >= 300000
-#include "opt_inet.h"
-#include "opt_ipx.h"
-#endif
-#endif
-
#if defined(__NetBSD__)
#include "rnd.h"
#if NRND > 0
@@ -123,6 +113,14 @@
#include <pci/dc21040reg.h>
#define DEVAR_INCLUDE "pci/if_devar.h"
#endif
+/* In case somebody is trying to run this on an older 2.2 or 3.0 */
+#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
+#if __FreeBSD__ >= 3
+#define __FreeBSD_version 300000
+#else
+#define __FreeBSD_version 200000
+#endif
+#endif
#endif /* __FreeBSD__ */
#if defined(__bsdi__)
@@ -2757,7 +2755,6 @@ static const struct {
{ tulip_identify_znyx_nic, { 0x00, 0xC0, 0x95 } },
{ tulip_identify_cogent_nic, { 0x00, 0x00, 0x92 } },
{ tulip_identify_asante_nic, { 0x00, 0x00, 0x94 } },
- { tulip_identify_cogent_nic, { 0x00, 0x00, 0xD1 } },
{ tulip_identify_accton_nic, { 0x00, 0x00, 0xE8 } },
{ NULL }
};
@@ -2861,7 +2858,7 @@ tulip_read_macaddr(
* Some folks don't use the standard ethernet rom format
* but instead just put the address in the first 6 bytes
* of the rom and let the rest be all 0xffs. (Can we say
- * ZNYX?) (well sometimes they put in a checksum so we'll
+ * ZNYX???) (well sometimes they put in a checksum so we'll
* start at 8).
*/
for (idx = 8; idx < 32; idx++) {
@@ -5310,7 +5307,7 @@ tulip_pci_shutdown(
}
#endif
-static const char*
+static char*
tulip_pci_probe(
pcici_t config_id,
pcidi_t device_id)
diff --git a/sys/pci/if_devar.h b/sys/pci/if_devar.h
index b0ec38445ca8a..1f4b577a80846 100644
--- a/sys/pci/if_devar.h
+++ b/sys/pci/if_devar.h
@@ -1,5 +1,5 @@
/* $NetBSD: if_devar.h,v 1.31 1998/09/29 22:40:52 matt Exp $ */
-/* $Id: if_devar.h,v 1.11 1998/10/14 08:31:27 peter Exp $ */
+/* $Id: if_devar.h,v 1.10 1998/10/13 09:05:58 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -62,16 +62,8 @@ typedef bus_addr_t tulip_csrptr_t;
#define TULIP_PCI_CSRSIZE 8
#define TULIP_PCI_CSROFFSET 0
-#if !defined(__FreeBSD__) || __FreeBSD_version < 300000
-typedef u_long uintptr_t;
-#endif
-
#if !defined(__NetBSD__)
-#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
typedef pci_port_t tulip_csrptr_t;
-#else
-typedef u_int16_t tulip_csrptr_t;
-#endif
#define TULIP_CSR_READ(sc, csr) (inl((sc)->tulip_csrs.csr))
#define TULIP_CSR_WRITE(sc, csr, val) outl((sc)->tulip_csrs.csr, val)
@@ -951,11 +943,7 @@ static void tulip_softintr(void);
#if defined(__FreeBSD__)
typedef void ifnet_ret_t;
-#if __FreeBSD_version >= 300000
typedef u_long ioctl_cmd_t;
-#else
-typedef int ioctl_cmd_t;
-#endif
#if defined(TULIP_HDR_DATA)
static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
diff --git a/sys/pci/if_ed_p.c b/sys/pci/if_ed_p.c
index e14a96c50abd7..d284ee6074e06 100644
--- a/sys/pci/if_ed_p.c
+++ b/sys/pci/if_ed_p.c
@@ -17,7 +17,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: if_ed_p.c,v 1.13 1998/03/17 10:54:23 danny Exp $
+ * $Id: if_ed_p.c,v 1.12 1998/02/27 22:29:36 se Exp $
*/
#include "pci.h"
@@ -51,7 +51,7 @@ static struct _pcsid
extern void *ed_attach_NE2000_pci __P((int, int));
-static const char* ed_pci_probe __P((pcici_t tag, pcidi_t type));
+static char* ed_pci_probe __P((pcici_t tag, pcidi_t type));
static void ed_pci_attach __P((pcici_t config_id, int unit));
static u_long ed_pci_count = NED;
@@ -66,7 +66,7 @@ static struct pci_device ed_pci_driver = {
DATA_SET (pcidevice_set, ed_pci_driver);
-static const char*
+static char*
ed_pci_probe (pcici_t tag, pcidi_t type)
{
struct _pcsid *ep =pci_ids;
diff --git a/sys/pci/if_en_pci.c b/sys/pci/if_en_pci.c
index 3414edc489be6..d1853b5748aab 100644
--- a/sys/pci/if_en_pci.c
+++ b/sys/pci/if_en_pci.c
@@ -50,6 +50,17 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
+#ifndef SHUTDOWN_PRE_SYNC
+/*
+ * device shutdown mechanism has been changed since 2.2-ALPHA.
+ * if SHUTDOWN_PRE_SYNC is defined in "sys/systm.h", use new one.
+ * otherwise, use old one.
+ * new: 2.2-ALPHA, 2.2-BETA, 2.2-GAMME, 2.2-RELEASE, 3.0
+ * old: 2.1.5, 2.1.6, 2.2-SNAP
+ * -- kjc
+ */
+#include <sys/devconf.h>
+#endif
#include <sys/malloc.h>
#include <sys/socket.h>
@@ -69,8 +80,12 @@
*/
static void en_pci_attach __P((pcici_t, int));
-static const char *en_pci_probe __P((pcici_t, pcidi_t));
+static char *en_pci_probe __P((pcici_t, pcidi_t));
+#ifdef SHUTDOWN_PRE_SYNC
static void en_pci_shutdown __P((int, void *));
+#else
+static int en_pci_shutdown __P((struct kern_devconf *, int));
+#endif
/*
* local structures
@@ -83,15 +98,8 @@ struct en_pci_softc {
/* PCI bus glue */
void *sc_ih; /* interrupt handle */
pci_chipset_tag_t en_pc; /* for PCI calls */
- pcici_t en_confid; /* config id */
-};
-#if !defined(MIDWAY_ENIONLY)
-static void eni_get_macaddr __P((struct en_pci_softc *));
-#endif
-#if !defined(MIDWAY_ADPONLY)
-static void adp_get_macaddr __P((struct en_pci_softc *));
-#endif
+};
/*
* pointers to softcs (we alloc)
@@ -111,7 +119,11 @@ static struct pci_device endevice = {
en_pci_probe,
en_pci_attach,
&en_pci_count,
+#ifdef SHUTDOWN_PRE_SYNC
NULL,
+#else
+ en_pci_shutdown,
+#endif
};
DATA_SET (pcidevice_set, endevice);
@@ -191,7 +203,7 @@ void *v;
* autoconfig stuff
*/
-static const char *en_pci_probe(config_id, device_id)
+static char *en_pci_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -247,10 +259,9 @@ int unit;
enpcis[unit] = scp; /* lock it in */
en_cd.cd_devs[unit] = sc; /* fake a cfdriver structure */
en_cd.cd_ndevs = NEN;
- snprintf(sc->sc_dev.dv_xname, sizeof(sc->sc_dev.dv_xname), "en%d", unit);
+ sprintf(sc->sc_dev.dv_xname, "en%d", unit);
sc->enif.if_unit = unit;
sc->enif.if_name = "en";
- scp->en_confid = config_id;
/*
* figure out if we are an adaptec card or not.
@@ -261,12 +272,14 @@ int unit;
device_id = pci_conf_read(config_id, PCI_ID_REG);
sc->is_adaptec = (PCI_VENDOR(device_id) == PCI_VENDOR_ADP) ? 1 : 0;
+#ifdef SHUTDOWN_PRE_SYNC
/*
* Add shutdown hook so that DMA is disabled prior to reboot. Not
* doing so could allow DMA to corrupt kernel memory during the
* reboot before the driver initializes.
*/
at_shutdown(en_pci_shutdown, scp, SHUTDOWN_POST_SYNC);
+#endif
if (!pci_map_int(config_id, en_intr, (void *) sc, &net_imask)) {
printf("%s: couldn't establish interrupt\n", sc->sc_dev.dv_xname);
@@ -280,7 +293,6 @@ int unit;
#if !defined(MIDWAY_ENIONLY)
if (sc->is_adaptec) {
- adp_get_macaddr(scp);
sc->en_busreset = adp_busreset;
adp_busreset(sc);
}
@@ -288,7 +300,6 @@ int unit;
#if !defined(MIDWAY_ADPONLY)
if (!sc->is_adaptec) {
- eni_get_macaddr(scp);
sc->en_busreset = NULL;
pci_conf_write(config_id, EN_TONGA, (TONGA_SWAP_DMA|TONGA_SWAP_WORD));
}
@@ -302,6 +313,7 @@ int unit;
}
+#ifdef SHUTDOWN_PRE_SYNC
static void
en_pci_shutdown(
int howto,
@@ -312,126 +324,22 @@ en_pci_shutdown(
en_reset(&psc->esc);
DELAY(10);
}
+#else /* !SHUTDOWN_PRE_SYNC */
+static int
+en_pci_shutdown(kdc, force)
-#if !defined(MIDWAY_ENIONLY)
-
-#if defined(sparc) || defined(__FreeBSD__)
-#define bus_space_read_1(t, h, o) \
- ((void)t, (*(volatile u_int8_t *)((h) + (o))))
-#endif
-
-static void
-adp_get_macaddr(scp)
- struct en_pci_softc *scp;
-{
- struct en_softc * sc = (struct en_softc *)scp;
- int lcv;
-
- for (lcv = 0; lcv < sizeof(sc->macaddr); lcv++)
- sc->macaddr[lcv] = bus_space_read_1(sc->en_memt, sc->en_base,
- MID_ADPMACOFF + lcv);
-}
-
-#endif /* MIDWAY_ENIONLY */
-
-#if !defined(MIDWAY_ADPONLY)
+struct kern_devconf *kdc;
+int force;
-/*
- * Read station (MAC) address from serial EEPROM.
- * derived from linux drivers/atm/eni.c by Werner Almesberger, EPFL LRC.
- */
-#define EN_PROM_MAGIC 0x0c
-#define EN_PROM_DATA 0x02
-#define EN_PROM_CLK 0x01
-#define EN_ESI 64
-
-static void
-eni_get_macaddr(scp)
- struct en_pci_softc *scp;
{
- struct en_softc * sc = (struct en_softc *)scp;
- pcici_t id = scp->en_confid;
- int i, j, address, status;
- u_int32_t data, t_data;
- u_int8_t tmp;
-
- t_data = pci_conf_read(id, EN_TONGA) & 0xffffff00;
-
- data = EN_PROM_MAGIC | EN_PROM_DATA | EN_PROM_CLK;
- pci_conf_write(id, EN_TONGA, data);
-
- for (i = 0; i < sizeof(sc->macaddr); i ++){
- /* start operation */
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data &= ~EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- /* send address with serial line */
- address = ((i + EN_ESI) << 1) + 1;
- for ( j = 7 ; j >= 0 ; j --){
- data = (address >> j) & 1 ? data | EN_PROM_DATA :
- data & ~EN_PROM_DATA;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- }
- /* get ack */
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data = pci_conf_read(id, EN_TONGA);
- status = data & EN_PROM_DATA;
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
-
- tmp = 0;
-
- for ( j = 7 ; j >= 0 ; j --){
- tmp <<= 1;
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data = pci_conf_read(id, EN_TONGA);
- if(data & EN_PROM_DATA) tmp |= 1;
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- }
- /* get ack */
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data = pci_conf_read(id, EN_TONGA);
- status = data & EN_PROM_DATA;
- data &= ~EN_PROM_CLK ;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA ;
- pci_conf_write(id, EN_TONGA, data);
-
- sc->macaddr[i] = tmp;
+ if (kdc->kdc_unit < NEN) {
+ struct en_pci_softc *psc = enpcis[kdc->kdc_unit];
+ if (psc) /* can it be null? */
+ en_reset(&psc->esc);
+ DELAY(10);
}
- /* stop operation */
- data &= ~EN_PROM_DATA;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_CLK;
- pci_conf_write(id, EN_TONGA, data);
- data |= EN_PROM_DATA;
- pci_conf_write(id, EN_TONGA, data);
- pci_conf_write(id, EN_TONGA, t_data);
+ dev_detach(kdc);
+ return(0);
}
-
-#endif /* !MIDWAY_ADPONLY */
-
+#endif /* !SHUTDOWN_PRE_SYNC */
#endif /* NEN > 0 && NPCI > 0 */
diff --git a/sys/pci/if_fpa.c b/sys/pci/if_fpa.c
index cff0be24ca845..8706f2a06d5c4 100644
--- a/sys/pci/if_fpa.c
+++ b/sys/pci/if_fpa.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_fpa.c,v 1.7 1998/02/20 13:11:53 bde Exp $
+ * $Id: if_fpa.c,v 1.6 1998/02/09 06:10:49 eivind Exp $
*
*/
@@ -135,7 +135,7 @@ static void pdq_pci_shutdown(int, void *);
* on both EISA and PCI boards, one must be careful in how defines the
* PDQ in the config file.
*/
-static const char *
+static char *
pdq_pci_probe(
pcici_t config_id,
pcidi_t device_id)
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c
index 1908cb6eff709..750e268c8abe3 100644
--- a/sys/pci/if_fxp.c
+++ b/sys/pci/if_fxp.c
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_fxp.c,v 1.58 1998/10/22 02:00:49 dg Exp $
+ * $Id: if_fxp.c,v 1.56 1998/10/10 19:26:40 dg Exp $
*/
/*
@@ -485,7 +485,7 @@ fxp_ether_ioctl(ifp, cmd, data)
#else /* __FreeBSD__ */
static u_long fxp_count;
-static const char *fxp_probe __P((pcici_t, pcidi_t));
+static char *fxp_probe __P((pcici_t, pcidi_t));
static void fxp_attach __P((pcici_t, int));
static void fxp_shutdown __P((int, void *));
@@ -502,7 +502,7 @@ DATA_SET(pcidevice_set, fxp_device);
/*
* Return identification string if this is device is ours.
*/
-static const char *
+static char *
fxp_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1072,7 +1072,6 @@ fxp_stats_update(arg)
struct fxp_softc *sc = arg;
struct ifnet *ifp = &sc->sc_if;
struct fxp_stats *sp = sc->fxp_stats;
- struct fxp_cb_tx *txp;
int s;
ifp->if_opackets += sp->tx_good;
@@ -1081,9 +1080,6 @@ fxp_stats_update(arg)
ifp->if_ipackets += sp->rx_good;
sc->rx_idle_secs = 0;
} else {
- /*
- * Receiver's been idle for another second.
- */
sc->rx_idle_secs++;
}
ifp->if_ierrors +=
@@ -1102,23 +1098,6 @@ fxp_stats_update(arg)
}
s = splimp();
/*
- * Release any xmit buffers that have completed DMA. This isn't
- * strictly necessary to do here, but it's advantagous for mbufs
- * with external storage to be released in a timely manner rather
- * than being defered for a potentially long time. This limits
- * the delay to a maximum of one second.
- */
- for (txp = sc->cbl_first; sc->tx_queued &&
- (txp->cb_status & FXP_CB_STATUS_C) != 0;
- txp = txp->next) {
- if (txp->mb_head != NULL) {
- m_freem(txp->mb_head);
- txp->mb_head = NULL;
- }
- sc->tx_queued--;
- }
- sc->cbl_first = txp;
- /*
* If we haven't received any packets in FXP_MAC_RX_IDLE seconds,
* then assume the receiver has locked up and attempt to clear
* the condition by reprogramming the multicast filter. This is
diff --git a/sys/pci/if_lnc_p.c b/sys/pci/if_lnc_p.c
index 27f2048d4377e..3cffcab8030a0 100644
--- a/sys/pci/if_lnc_p.c
+++ b/sys/pci/if_lnc_p.c
@@ -17,7 +17,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: if_lnc_p.c,v 1.6 1998/07/20 17:33:01 msmith Exp $
+ * $Id: if_lnc_p.c,v 1.5 1997/08/02 14:33:11 bde Exp $
*/
#include "pci.h"
@@ -36,7 +36,7 @@
extern void *lnc_attach_ne2100_pci __P((int unit, unsigned iobase));
-static const char* lnc_pci_probe __P((pcici_t tag, pcidi_t type));
+static char* lnc_pci_probe __P((pcici_t tag, pcidi_t type));
static void lnc_pci_attach __P((pcici_t config_id, int unit));
static u_long lnc_pci_count = NLNC;
@@ -51,7 +51,7 @@ static struct pci_device lnc_pci_driver = {
DATA_SET (pcidevice_set, lnc_pci_driver);
-static const char*
+static char*
lnc_pci_probe (pcici_t tag, pcidi_t type)
{
switch(type) {
diff --git a/sys/pci/if_mx.c b/sys/pci/if_mx.c
deleted file mode 100644
index 621c3c7d94f1f..0000000000000
--- a/sys/pci/if_mx.c
+++ /dev/null
@@ -1,2436 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_mx.c,v 1.33 1999/01/06 17:22:40 wpaul Exp $
- */
-
-/*
- * Macronix PMAC fast ethernet PCI NIC driver
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The Macronix 98713, 98715 and 98725 chips are still more tulip clones.
- * The 98713 has an internal transceiver and an MII bus for external PHYs.
- * The other two chips have only the internal transceiver. All have
- * support for built-in autonegotiation. Additionally, there are 98713A
- * and 98715A chips which support power management. The 98725 chip
- * supports power management as well.
- *
- * Datasheets for the Macronix parts can be obtained from www.macronix.com.
- * Note however that the datasheets do not describe the TX and RX
- * descriptor structures or the setup frame format(s). For this, you should
- * obtain a DEC 21x4x datasheet from developer.intel.com. The Macronix
- * chips look to be fairly straightforward tulip clones, except for
- * the NWAY support.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define MX_USEIOSPACE
-
-/* #define MX_BACKGROUND_AUTONEG */
-
-#include <pci/if_mxreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_mx.c,v 1.33 1999/01/06 17:22:40 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct mx_type mx_devs[] = {
- { MX_VENDORID, MX_DEVICEID_98713,
- "Macronix 98713 10/100BaseTX" },
- { MX_VENDORID, MX_DEVICEID_98713,
- "Macronix 98713A 10/100BaseTX" },
- { MX_VENDORID, MX_DEVICEID_987x5,
- "Macronix 98715/98715A 10/100BaseTX" },
- { MX_VENDORID, MX_DEVICEID_987x5,
- "Macronix 98725 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct mx_type mx_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long mx_count = 0;
-static const char *mx_probe __P((pcici_t, pcidi_t));
-static void mx_attach __P((pcici_t, int));
-
-static int mx_newbuf __P((struct mx_softc *,
- struct mx_chain_onefrag *));
-static int mx_encap __P((struct mx_softc *, struct mx_chain *,
- struct mbuf *));
-
-static void mx_rxeof __P((struct mx_softc *));
-static void mx_rxeoc __P((struct mx_softc *));
-static void mx_txeof __P((struct mx_softc *));
-static void mx_txeoc __P((struct mx_softc *));
-static void mx_intr __P((void *));
-static void mx_start __P((struct ifnet *));
-static int mx_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void mx_init __P((void *));
-static void mx_stop __P((struct mx_softc *));
-static void mx_watchdog __P((struct ifnet *));
-static void mx_shutdown __P((int, void *));
-static int mx_ifmedia_upd __P((struct ifnet *));
-static void mx_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void mx_delay __P((struct mx_softc *));
-static void mx_eeprom_idle __P((struct mx_softc *));
-static void mx_eeprom_putbyte __P((struct mx_softc *, u_int8_t));
-static void mx_eeprom_getword __P((struct mx_softc *, u_int8_t, u_int16_t *));
-static void mx_read_eeprom __P((struct mx_softc *, caddr_t, int,
- int, int));
-
-static void mx_mii_writebit __P((struct mx_softc *, int));
-static int mx_mii_readbit __P((struct mx_softc *));
-static void mx_mii_sync __P((struct mx_softc *));
-static void mx_mii_send __P((struct mx_softc *, u_int32_t, int));
-static int mx_mii_readreg __P((struct mx_softc *, struct mx_mii_frame *));
-static int mx_mii_writereg __P((struct mx_softc *, struct mx_mii_frame *));
-static u_int16_t mx_phy_readreg __P((struct mx_softc *, int));
-static void mx_phy_writereg __P((struct mx_softc *, u_int16_t, u_int16_t));
-
-static void mx_autoneg_xmit __P((struct mx_softc *));
-static void mx_autoneg_mii __P((struct mx_softc *, int, int));
-static void mx_autoneg __P((struct mx_softc *, int, int));
-static void mx_setmode_mii __P((struct mx_softc *, int));
-static void mx_setmode __P((struct mx_softc *, int, int));
-static void mx_getmode_mii __P((struct mx_softc *));
-static void mx_setcfg __P((struct mx_softc *, u_int16_t));
-static u_int32_t mx_calchash __P((u_int8_t *));
-static void mx_setfilt __P((struct mx_softc *));
-static void mx_reset __P((struct mx_softc *));
-static int mx_list_rx_init __P((struct mx_softc *));
-static int mx_list_tx_init __P((struct mx_softc *));
-
-#define MX_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define MX_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_4(sc, MX_SIO, \
- CSR_READ_4(sc, MX_SIO) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_4(sc, MX_SIO, \
- CSR_READ_4(sc, MX_SIO) & ~x)
-
-static void mx_delay(sc)
- struct mx_softc *sc;
-{
- int idx;
-
- for (idx = (300 / 33) + 1; idx > 0; idx--)
- CSR_READ_4(sc, MX_BUSCTL);
-}
-
-static void mx_eeprom_idle(sc)
- struct mx_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_EESEL);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_ROMCTL_READ);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CS);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
-
- for (i = 0; i < 25; i++) {
- MX_CLRBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
- }
-
- MX_CLRBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
- MX_CLRBIT(sc, MX_SIO, MX_SIO_EE_CS);
- mx_delay(sc);
- CSR_WRITE_4(sc, MX_SIO, 0x00000000);
-
- return;
-}
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void mx_eeprom_putbyte(sc, addr)
- struct mx_softc *sc;
- u_int8_t addr;
-{
- register int d, i;
-
- d = addr | MX_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- SIO_SET(MX_SIO_EE_DATAIN);
- } else {
- SIO_CLR(MX_SIO_EE_DATAIN);
- }
- mx_delay(sc);
- SIO_SET(MX_SIO_EE_CLK);
- mx_delay(sc);
- SIO_CLR(MX_SIO_EE_CLK);
- mx_delay(sc);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void mx_eeprom_getword(sc, addr, dest)
- struct mx_softc *sc;
- u_int8_t addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Force EEPROM to idle state. */
- mx_eeprom_idle(sc);
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_EESEL);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_ROMCTL_READ);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CS);
- mx_delay(sc);
- MX_SETBIT(sc, MX_SIO, MX_SIO_EE_CLK);
- mx_delay(sc);
-
- /*
- * Send address of word we want to read.
- */
- mx_eeprom_putbyte(sc, addr);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- SIO_SET(MX_SIO_EE_CLK);
- mx_delay(sc);
- if (CSR_READ_4(sc, MX_SIO) & MX_SIO_EE_DATAOUT)
- word |= i;
- mx_delay(sc);
- SIO_CLR(MX_SIO_EE_CLK);
- mx_delay(sc);
- }
-
- /* Turn off EEPROM access mode. */
- mx_eeprom_idle(sc);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void mx_read_eeprom(sc, dest, off, cnt, swap)
- struct mx_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- mx_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-/*
- * The following two routines are taken from the Macronix 98713
- * Application Notes pp.19-21.
- */
-/*
- * Write a bit to the MII bus.
- */
-static void mx_mii_writebit(sc, bit)
- struct mx_softc *sc;
- int bit;
-{
- if (bit)
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_WRITE|MX_SIO_MII_DATAOUT);
- else
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_WRITE);
-
- MX_SETBIT(sc, MX_SIO, MX_SIO_MII_CLK);
- MX_CLRBIT(sc, MX_SIO, MX_SIO_MII_CLK);
-
- return;
-}
-
-/*
- * Read a bit from the MII bus.
- */
-static int mx_mii_readbit(sc)
- struct mx_softc *sc;
-{
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_READ|MX_SIO_MII_DIR);
- CSR_READ_4(sc, MX_SIO);
- MX_SETBIT(sc, MX_SIO, MX_SIO_MII_CLK);
- MX_CLRBIT(sc, MX_SIO, MX_SIO_MII_CLK);
- if (CSR_READ_4(sc, MX_SIO) & MX_SIO_MII_DATAIN)
- return(1);
-
- return(0);
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void mx_mii_sync(sc)
- struct mx_softc *sc;
-{
- register int i;
-
- CSR_WRITE_4(sc, MX_SIO, MX_SIO_ROMCTL_WRITE);
-
- for (i = 0; i < 32; i++)
- mx_mii_writebit(sc, 1);
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void mx_mii_send(sc, bits, cnt)
- struct mx_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1)
- mx_mii_writebit(sc, bits & i);
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int mx_mii_readreg(sc, frame)
- struct mx_softc *sc;
- struct mx_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = MX_MII_STARTDELIM;
- frame->mii_opcode = MX_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- /*
- * Sync the PHYs.
- */
- mx_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- mx_mii_send(sc, frame->mii_stdelim, 2);
- mx_mii_send(sc, frame->mii_opcode, 2);
- mx_mii_send(sc, frame->mii_phyaddr, 5);
- mx_mii_send(sc, frame->mii_regaddr, 5);
-
-#ifdef notdef
- /* Idle bit */
- mx_mii_writebit(sc, 1);
- mx_mii_writebit(sc, 0);
-#endif
-
- /* Check for ack */
- ack = mx_mii_readbit(sc);
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- mx_mii_readbit(sc);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- if (!ack) {
- if (mx_mii_readbit(sc))
- frame->mii_data |= i;
- }
- }
-
-fail:
-
- mx_mii_writebit(sc, 0);
- mx_mii_writebit(sc, 0);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int mx_mii_writereg(sc, frame)
- struct mx_softc *sc;
- struct mx_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = MX_MII_STARTDELIM;
- frame->mii_opcode = MX_MII_WRITEOP;
- frame->mii_turnaround = MX_MII_TURNAROUND;
-
- /*
- * Sync the PHYs.
- */
- mx_mii_sync(sc);
-
- mx_mii_send(sc, frame->mii_stdelim, 2);
- mx_mii_send(sc, frame->mii_opcode, 2);
- mx_mii_send(sc, frame->mii_phyaddr, 5);
- mx_mii_send(sc, frame->mii_regaddr, 5);
- mx_mii_send(sc, frame->mii_turnaround, 2);
- mx_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- mx_mii_writebit(sc, 0);
- mx_mii_writebit(sc, 0);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t mx_phy_readreg(sc, reg)
- struct mx_softc *sc;
- int reg;
-{
- struct mx_mii_frame frame;
- u_int32_t cfg;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->mx_phy_addr;
- frame.mii_regaddr = reg;
- cfg = CSR_READ_4(sc, MX_NETCFG);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- mx_mii_readreg(sc, &frame);
- CSR_WRITE_4(sc, MX_NETCFG, cfg);
-
- return(frame.mii_data);
-}
-
-static void mx_phy_writereg(sc, reg, data)
- struct mx_softc *sc;
- u_int16_t reg;
- u_int16_t data;
-{
- struct mx_mii_frame frame;
- u_int32_t cfg;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->mx_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- cfg = CSR_READ_4(sc, MX_NETCFG);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- mx_mii_writereg(sc, &frame);
- CSR_WRITE_4(sc, MX_NETCFG, cfg);
-
- return;
-}
-
-#define MX_POLY 0xEDB88320
-#define MX_BITS 9
-
-static u_int32_t mx_calchash(addr)
- u_int8_t *addr;
-{
- u_int32_t idx, bit, data, crc;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (idx = 0; idx < 6; idx++) {
- for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1)
- crc = (crc >> 1) ^ (((crc ^ data) & 1) ? MX_POLY : 0);
- }
-
- return (crc & ((1 << MX_BITS) - 1));
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void mx_autoneg_xmit(sc)
- struct mx_softc *sc;
-{
- u_int16_t phy_sts;
-
- mx_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(mx_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = mx_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- mx_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void mx_autoneg_mii(sc, flag, verbose)
- struct mx_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = mx_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("mx%d: autonegotiation not supported\n",
- sc->mx_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case MX_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- mx_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case MX_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise mx_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->mx_cdata.mx_tx_head != NULL) {
- sc->mx_want_auto = 1;
- return;
- }
- mx_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->mx_autoneg = 1;
- sc->mx_want_auto = 0;
- return;
- break;
- case MX_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->mx_autoneg = 0;
- break;
- default:
- printf("mx%d: invalid autoneg flag: %d\n", sc->mx_unit, flag);
- return;
- }
-
- if (mx_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("mx%d: autoneg complete, ", sc->mx_unit);
- phy_sts = mx_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("mx%d: autoneg not complete, ", sc->mx_unit);
- }
-
- media = mx_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (mx_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = mx_phy_readreg(sc, PHY_ANAR);
- ability = mx_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- mx_setcfg(sc, media);
- mx_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- mx_init(sc);
-
- if (sc->mx_tx_pend) {
- sc->mx_autoneg = 0;
- sc->mx_tx_pend = 0;
- mx_start(ifp);
- }
-
- return;
-}
-
-/*
- * Invoke autoneg using internal NWAY.
- */
-static void mx_autoneg(sc, flag, verbose)
- struct mx_softc *sc;
- int flag;
- int verbose;
-{
- u_int32_t media, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- switch (flag) {
- case MX_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
- MX_SETBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- MX_SETBIT(sc, MX_10BTCTRL, MX_ASTAT_TXDISABLE);
- DELAY(5000000);
- break;
- case MX_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise mx_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->mx_cdata.mx_tx_head != NULL) {
- sc->mx_want_auto = 1;
- return;
- }
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL);
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
- MX_SETBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- MX_SETBIT(sc, MX_10BTCTRL, MX_ASTAT_TXDISABLE);
- ifp->if_timer = 5;
- sc->mx_autoneg = 1;
- sc->mx_want_auto = 0;
- return;
- break;
- case MX_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->mx_autoneg = 0;
- break;
- default:
- printf("mx%d: invalid autoneg flag: %d\n", sc->mx_unit, flag);
- return;
- }
-
- if ((CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_ANEGSTAT) ==
- MX_ASTAT_AUTONEGCMP) {
- if (verbose)
- printf("mx%d: autoneg complete, ", sc->mx_unit);
- } else {
- if (verbose)
- printf("mx%d: autoneg not complete, ", sc->mx_unit);
- }
-
- media = CSR_READ_4(sc, MX_NETCFG);
-
- /* Link is good. Report modes and set duplex mode. */
- if (!(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS10) ||
- !(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS100)) {
- if (verbose)
- printf("link status good ");
- ability = CSR_READ_4(sc, MX_NWAYSTAT);
- if (ability & MX_NWAY_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|
- MX_NETCFG_SCRAMBLER;
- media &= ~(MX_NETCFG_FULLDUPLEX|MX_NETCFG_SPEEDSEL);
- printf("(100baseT4)\n");
- } else if (ability & MX_NWAY_100BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|
- MX_NETCFG_SCRAMBLER;
- media |= MX_NETCFG_FULLDUPLEX;
- media &= ~MX_NETCFG_SPEEDSEL;
- printf("(full-duplex, 100Mbps)\n");
- } else if (ability & MX_NWAY_100BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|
- MX_NETCFG_SCRAMBLER;
- media &= ~(MX_NETCFG_FULLDUPLEX|MX_NETCFG_SPEEDSEL);
- printf("(half-duplex, 100Mbps)\n");
- } else if (ability & MX_NWAY_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~MX_NETCFG_PORTSEL;
- media |= (MX_NETCFG_FULLDUPLEX|MX_NETCFG_SPEEDSEL);
- printf("(full-duplex, 10Mbps)\n");
- } else {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~MX_NETCFG_PORTSEL;
- media &= ~MX_NETCFG_FULLDUPLEX;
- media |= MX_NETCFG_SPEEDSEL;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- CSR_WRITE_4(sc, MX_NETCFG, media);
- MX_CLRBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- mx_init(sc);
-
- if (sc->mx_tx_pend) {
- sc->mx_autoneg = 0;
- sc->mx_tx_pend = 0;
- mx_start(ifp);
- }
-
- return;
-}
-
-static void mx_getmode_mii(sc)
- struct mx_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = mx_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("mx%d: PHY status word: %x\n", sc->mx_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("mx%d: 10Mbps half-duplex mode supported\n",
- sc->mx_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("mx%d: 10Mbps full-duplex mode supported\n",
- sc->mx_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("mx%d: 100Mbps half-duplex mode supported\n",
- sc->mx_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("mx%d: 100Mbps full-duplex mode supported\n",
- sc->mx_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("mx%d: 100baseT4 mode supported\n", sc->mx_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("mx%d: forcing on autoneg support for BT4\n",
- sc->mx_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("mx%d: autoneg supported\n", sc->mx_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void mx_setmode_mii(sc, media)
- struct mx_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->mx_autoneg) {
- printf("mx%d: canceling autoneg session\n", sc->mx_unit);
- ifp->if_timer = sc->mx_autoneg = sc->mx_want_auto = 0;
- bmcr = mx_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- mx_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("mx%d: selecting MII, ", sc->mx_unit);
-
- bmcr = mx_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- mx_setcfg(sc, bmcr);
- mx_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * Set speed and duplex mode on internal transceiver.
- */
-static void mx_setmode(sc, media, verbose)
- struct mx_softc *sc;
- int media;
- int verbose;
-{
- struct ifnet *ifp;
- u_int32_t mode;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->mx_autoneg) {
- printf("mx%d: canceling autoneg session\n", sc->mx_unit);
- ifp->if_timer = sc->mx_autoneg = sc->mx_want_auto = 0;
- MX_CLRBIT(sc, MX_10BTCTRL, MX_TCTL_AUTONEGENBL);
- }
-
- if (verbose)
- printf("mx%d: selecting NWAY, ", sc->mx_unit);
-
- mode = CSR_READ_4(sc, MX_NETCFG);
-
- mode &= ~(MX_NETCFG_FULLDUPLEX|MX_NETCFG_PORTSEL|
- MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER|MX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- if (verbose)
- printf("100Mbps/T4, half-duplex\n");
- mode |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- if (verbose)
- printf("100Mbps, ");
- mode |= MX_NETCFG_PORTSEL|MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- if (verbose)
- printf("10Mbps, ");
- mode &= ~MX_NETCFG_PORTSEL;
- mode |= MX_NETCFG_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- if (verbose)
- printf("full duplex\n");
- mode |= MX_NETCFG_FULLDUPLEX;
- } else {
- if (verbose)
- printf("half duplex\n");
- mode &= ~MX_NETCFG_FULLDUPLEX;
- }
-
- CSR_WRITE_4(sc, MX_NETCFG, mode);
-
- return;
-}
-
-/*
- * Programming the receiver filter on the tulip/PMAC is gross. You
- * have to construct a special setup frame and download it to the
- * chip via the transmit DMA engine. This routine is also somewhat
- * gross, as the setup frame is sent synchronously rather than putting
- * on the transmit queue. The transmitter has to be stopped, then we
- * can download the frame and wait for the 'owned' bit to clear.
- *
- * We always program the chip using 'hash perfect' mode, i.e. one perfect
- * address (our node address) and a 512-bit hash filter for multicast
- * frames. We also sneak the broadcast address into the hash filter since
- * we need that too.
- */
-void mx_setfilt(sc)
- struct mx_softc *sc;
-{
- struct mx_desc *sframe;
- u_int32_t h, *sp;
- struct ifmultiaddr *ifma;
- struct ifnet *ifp;
- int i;
-
- ifp = &sc->arpcom.ac_if;
-
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON);
- MX_SETBIT(sc, MX_ISR, MX_ISR_TX_IDLE);
-
- sframe = &sc->mx_cdata.mx_sframe;
- sp = (u_int32_t *)&sc->mx_cdata.mx_sbuf;
- bzero((char *)sp, MX_SFRAME_LEN);
-
- sframe->mx_next = vtophys(&sc->mx_ldata->mx_tx_list[0]);
- sframe->mx_data = vtophys(&sc->mx_cdata.mx_sbuf);
- sframe->mx_ctl = MX_SFRAME_LEN | MX_TXCTL_TLINK |
- MX_TXCTL_SETUP | MX_FILTER_HASHPERF;
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_RX_PROMISC);
- else
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_RX_PROMISC);
-
- if (ifp->if_flags & IFF_ALLMULTI)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_RX_ALLMULTI);
-
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = mx_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- if (ifp->if_flags & IFF_BROADCAST) {
- h = mx_calchash(etherbroadcastaddr);
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- sp[39] = ((u_int16_t *)sc->arpcom.ac_enaddr)[0];
- sp[40] = ((u_int16_t *)sc->arpcom.ac_enaddr)[1];
- sp[41] = ((u_int16_t *)sc->arpcom.ac_enaddr)[2];
-
- CSR_WRITE_4(sc, MX_TXADDR, vtophys(sframe));
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON);
- sframe->mx_status = MX_TXSTAT_OWN;
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
-
- /*
- * Wait for chip to clear the 'own' bit.
- */
- for (i = 0; i < MX_TIMEOUT; i++) {
- DELAY(10);
- if (sframe->mx_status != MX_TXSTAT_OWN)
- break;
- }
-
- if (i == MX_TIMEOUT)
- printf("mx%d: failed to send setup frame\n", sc->mx_unit);
-
- MX_SETBIT(sc, MX_ISR, MX_ISR_TX_NOBUF|MX_ISR_TX_IDLE);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void mx_setcfg(sc, bmcr)
- struct mx_softc *sc;
- u_int16_t bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, MX_NETCFG) & (MX_NETCFG_TX_ON|MX_NETCFG_RX_ON)) {
- restart = 1;
- MX_CLRBIT(sc, MX_NETCFG, (MX_NETCFG_TX_ON|MX_NETCFG_RX_ON));
-
- for (i = 0; i < MX_TIMEOUT; i++) {
- DELAY(10);
- if (CSR_READ_4(sc, MX_ISR) & MX_ISR_TX_IDLE)
- break;
- }
-
- if (i == MX_TIMEOUT)
- printf("mx%d: failed to force tx and "
- "rx to idle state\n", sc->mx_unit);
-
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL) {
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_SPEEDSEL);
- if (sc->mx_phy_addr == 0) {
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_PORTSEL|
- MX_NETCFG_PCS|MX_NETCFG_SCRAMBLER);
- }
- } else
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_SPEEDSEL);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
- else
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_FULLDUPLEX);
-
- if (restart)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON|MX_NETCFG_RX_ON);
-
- return;
-}
-
-static void mx_reset(sc)
- struct mx_softc *sc;
-{
- register int i;
-
- MX_SETBIT(sc, MX_BUSCTL, MX_BUSCTL_RESET);
-
- for (i = 0; i < MX_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, MX_BUSCTL) & MX_BUSCTL_RESET))
- break;
- }
- if (i == MX_TIMEOUT)
- printf("mx%d: reset never completed!\n", sc->mx_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
- return;
-}
-
-/*
- * Probe for a Macronix PMAC chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- * We do a little bit of extra work to identify the exact type of
- * chip. The MX98713 and MX98713A have the same PCI vendor/device ID,
- * but different revision IDs. The same is true for 98715/98715A
- * chips and the 98725. This doesn't affect a whole lot, but it
- * lets us tell the user exactly what type of device they have
- * in the probe output.
- */
-static const char *
-mx_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct mx_type *t;
- u_int32_t rev;
-
- t = mx_devs;
-
- while(t->mx_name != NULL) {
- if ((device_id & 0xFFFF) == t->mx_vid &&
- ((device_id >> 16) & 0xFFFF) == t->mx_did) {
- /* Check the PCI revision */
- rev = pci_conf_read(config_id, MX_PCI_REVID) & 0xFF;
- if (t->mx_did == MX_DEVICEID_98713 &&
- rev >= MX_REVISION_98713A)
- t++;
- if (t->mx_did == MX_DEVICEID_987x5 &&
- rev >= MX_REVISION_98725)
- t++;
- return(t->mx_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-mx_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef MX_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct mx_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct mx_type *p;
- u_int16_t phy_vid, phy_did, phy_sts, mac_offset = 0;
- u_int32_t revision, pci_id;
-
- s = splimp();
-
- sc = malloc(sizeof(struct mx_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("mx%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct mx_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, MX_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, MX_PCI_PWRMGMTCTRL);
- if (command & MX_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, MX_PCI_LOIO);
- membase = pci_conf_read(config_id, MX_PCI_LOMEM);
- irq = pci_conf_read(config_id, MX_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("mx%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & MX_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, MX_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, MX_PCI_LOIO, iobase);
- pci_conf_write(config_id, MX_PCI_LOMEM, membase);
- pci_conf_write(config_id, MX_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef MX_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("mx%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, MX_PCI_LOIO,
- (u_short *)&(sc->mx_bhandle))) {
- printf ("mx%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->mx_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("mx%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, MX_PCI_LOMEM, &vbase, &pbase)) {
- printf ("mx%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->mx_btag = I386_BUS_SPACE_MEM;
- sc->mx_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, mx_intr, sc, &net_imask)) {
- printf("mx%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Need this info to decide on a chip type. */
- revision = pci_conf_read(config_id, MX_PCI_REVID) & 0x000000FF;
- pci_id = pci_conf_read(config_id, MX_PCI_VENDOR_ID) & 0x0000FFFF;
- pci_id = (pci_conf_read(config_id,MX_PCI_VENDOR_ID) >> 16) & 0x0000FFFF;
-
- if (pci_id == MX_DEVICEID_98713 && revision < MX_REVISION_98713A)
- sc->mx_type = MX_TYPE_98713;
- else if (pci_id == MX_DEVICEID_98713 && revision >= MX_REVISION_98713A)
- sc->mx_type = MX_TYPE_98713A;
- else
- sc->mx_type = MX_TYPE_987x5;
-
- /* Reset the adapter. */
- mx_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- mx_read_eeprom(sc, (caddr_t)&mac_offset,
- (MX_EE_NODEADDR_OFFSET / 2), 1, 0);
- mx_read_eeprom(sc, (caddr_t)&eaddr, (mac_offset / 2), 3, 0);
-
- /*
- * A PMAC chip was detected. Inform the world.
- */
- printf("mx%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->mx_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->mx_ldata_ptr = malloc(sizeof(struct mx_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->mx_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("mx%d: no memory for list buffers!\n", unit);
- return;
- }
-
- sc->mx_ldata = (struct mx_list_data *)sc->mx_ldata_ptr;
- round = (unsigned int)sc->mx_ldata_ptr & 0xF;
- roundptr = sc->mx_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- }
- break;
- }
- sc->mx_ldata = (struct mx_list_data *)roundptr;
- bzero(sc->mx_ldata, sizeof(struct mx_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "mx";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = mx_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = mx_start;
- ifp->if_watchdog = mx_watchdog;
- ifp->if_init = mx_init;
- ifp->if_baudrate = 10000000;
-
-
- if (sc->mx_type == MX_TYPE_98713) {
- if (bootverbose)
- printf("mx%d: probing for a PHY\n", sc->mx_unit);
- for (i = MX_PHYADDR_MIN; i < MX_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("mx%d: checking address: %d\n",
- sc->mx_unit, i);
- sc->mx_phy_addr = i;
- mx_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(mx_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = mx_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = mx_phy_readreg(sc, PHY_VENID);
- phy_did = mx_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("mx%d: found PHY at address %d, ",
- sc->mx_unit, sc->mx_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = mx_phys;
- while(p->mx_vid) {
- if (phy_vid == p->mx_vid &&
- (phy_did | 0x000F) == p->mx_did) {
- sc->mx_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->mx_pinfo == NULL)
- sc->mx_pinfo = &mx_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("mx%d: PHY type: %s\n",
- sc->mx_unit, sc->mx_pinfo->mx_name);
- } else {
-#ifdef DIAGNOSTIC
- printf("mx%d: MII without any phy!\n", sc->mx_unit);
-#endif
- }
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, mx_ifmedia_upd, mx_ifmedia_sts);
-
- if (sc->mx_type == MX_TYPE_98713 && sc->mx_pinfo != NULL) {
- mx_getmode_mii(sc);
- mx_autoneg_mii(sc, MX_FLAG_FORCEDELAY, 1);
- } else {
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- mx_autoneg(sc, MX_FLAG_FORCEDELAY, 1);
- }
-
- media = sc->ifmedia.ifm_media;
- mx_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(mx_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int mx_list_tx_init(sc)
- struct mx_softc *sc;
-{
- struct mx_chain_data *cd;
- struct mx_list_data *ld;
- int i;
-
- cd = &sc->mx_cdata;
- ld = sc->mx_ldata;
- for (i = 0; i < MX_TX_LIST_CNT; i++) {
- cd->mx_tx_chain[i].mx_ptr = &ld->mx_tx_list[i];
- if (i == (MX_TX_LIST_CNT - 1))
- cd->mx_tx_chain[i].mx_nextdesc =
- &cd->mx_tx_chain[0];
- else
- cd->mx_tx_chain[i].mx_nextdesc =
- &cd->mx_tx_chain[i + 1];
- }
-
- cd->mx_tx_free = &cd->mx_tx_chain[0];
- cd->mx_tx_tail = cd->mx_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int mx_list_rx_init(sc)
- struct mx_softc *sc;
-{
- struct mx_chain_data *cd;
- struct mx_list_data *ld;
- int i;
-
- cd = &sc->mx_cdata;
- ld = sc->mx_ldata;
-
- for (i = 0; i < MX_RX_LIST_CNT; i++) {
- cd->mx_rx_chain[i].mx_ptr =
- (struct mx_desc *)&ld->mx_rx_list[i];
- if (mx_newbuf(sc, &cd->mx_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (MX_RX_LIST_CNT - 1)) {
- cd->mx_rx_chain[i].mx_nextdesc = &cd->mx_rx_chain[0];
- ld->mx_rx_list[i].mx_next =
- vtophys(&ld->mx_rx_list[0]);
- } else {
- cd->mx_rx_chain[i].mx_nextdesc = &cd->mx_rx_chain[i + 1];
- ld->mx_rx_list[i].mx_next =
- vtophys(&ld->mx_rx_list[i + 1]);
- }
- }
-
- cd->mx_rx_head = &cd->mx_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int mx_newbuf(sc, c)
- struct mx_softc *sc;
- struct mx_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("mx%d: no memory for rx list -- packet dropped!\n",
- sc->mx_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("mx%d: no memory for rx list -- packet dropped!\n",
- sc->mx_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->mx_mbuf = m_new;
- c->mx_ptr->mx_status = MX_RXSTAT;
- c->mx_ptr->mx_data = vtophys(mtod(m_new, caddr_t));
- c->mx_ptr->mx_ctl = MX_RXCTL_RLINK | (MCLBYTES - 1);
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void mx_rxeof(sc)
- struct mx_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct mx_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->mx_cdata.mx_rx_head->mx_ptr->mx_status) &
- MX_RXSTAT_OWN)) {
- cur_rx = sc->mx_cdata.mx_rx_head;
- sc->mx_cdata.mx_rx_head = cur_rx->mx_nextdesc;
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & MX_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- if (rxstat & MX_RXSTAT_COLLSEEN)
- ifp->if_collisions++;
- cur_rx->mx_ptr->mx_status = MX_RXSTAT;
- cur_rx->mx_ptr->mx_ctl =
- MX_RXCTL_RLINK | (MCLBYTES - 1);
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->mx_mbuf;
- total_len = MX_RXBYTES(cur_rx->mx_ptr->mx_status);
-
- /*
- * XXX The Macronix chips includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (mx_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->mx_ptr->mx_status = MX_RXSTAT;
- cur_rx->mx_ptr->mx_ctl =
- MX_RXCTL_RLINK | (MCLBYTES - 1);
- continue;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void mx_rxeoc(sc)
- struct mx_softc *sc;
-{
-
- mx_rxeof(sc);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, MX_RXADDR, vtophys(sc->mx_cdata.mx_rx_head->mx_ptr));
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, MX_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void mx_txeof(sc)
- struct mx_softc *sc;
-{
- struct mx_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->mx_cdata.mx_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->mx_cdata.mx_tx_head->mx_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->mx_cdata.mx_tx_head;
- txstat = MX_TXSTATUS(cur_tx);
-
- if ((txstat & MX_TXSTAT_OWN) || txstat == MX_UNSENT)
- break;
-
- if (txstat & MX_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & MX_TXSTAT_EXCESSCOLL)
- ifp->if_collisions++;
- if (txstat & MX_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & MX_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- m_freem(cur_tx->mx_mbuf);
- cur_tx->mx_mbuf = NULL;
-
- if (sc->mx_cdata.mx_tx_head == sc->mx_cdata.mx_tx_tail) {
- sc->mx_cdata.mx_tx_head = NULL;
- sc->mx_cdata.mx_tx_tail = NULL;
- break;
- }
-
- sc->mx_cdata.mx_tx_head = cur_tx->mx_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void mx_txeoc(sc)
- struct mx_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->mx_cdata.mx_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->mx_cdata.mx_tx_tail = NULL;
- if (sc->mx_want_auto) {
- if (sc->mx_type == MX_TYPE_98713 &&
- sc->mx_pinfo != NULL)
- mx_autoneg_mii(sc, MX_FLAG_DELAYTIMEO, 1);
- else
- mx_autoneg(sc, MX_FLAG_DELAYTIMEO, 1);
- }
- } else {
- if (MX_TXOWN(sc->mx_cdata.mx_tx_head) == MX_UNSENT) {
- MX_TXOWN(sc->mx_cdata.mx_tx_head) = MX_TXSTAT_OWN;
- ifp->if_timer = 5;
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
- }
- }
-
- return;
-}
-
-static void mx_intr(arg)
- void *arg;
-{
- struct mx_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts */
- if (!(ifp->if_flags & IFF_UP)) {
- mx_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, MX_IMR, 0x00000000);
-
- for (;;) {
- status = CSR_READ_4(sc, MX_ISR);
- if (status)
- CSR_WRITE_4(sc, MX_ISR, status);
-
- if ((status & MX_INTRS) == 0)
- break;
-
- if (status & MX_ISR_TX_OK)
- mx_txeof(sc);
-
- if (status & MX_ISR_TX_NOBUF)
- mx_txeoc(sc);
-
- if (status & MX_ISR_TX_IDLE) {
- mx_txeof(sc);
- if (sc->mx_cdata.mx_tx_head != NULL) {
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON);
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & MX_ISR_TX_UNDERRUN) {
- u_int32_t cfg;
- cfg = CSR_READ_4(sc, MX_NETCFG);
- if ((cfg & MX_NETCFG_TX_THRESH) == MX_TXTHRESH_160BYTES)
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_STORENFWD);
- else
- CSR_WRITE_4(sc, MX_NETCFG, cfg + 0x4000);
- }
-
- if (status & MX_ISR_RX_OK)
- mx_rxeof(sc);
-
- if ((status & MX_ISR_RX_WATDOGTIMEO)
- || (status & MX_ISR_RX_NOBUF))
- mx_rxeoc(sc);
-
- if (status & MX_ISR_BUS_ERR) {
- mx_reset(sc);
- mx_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, MX_IMR, MX_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- mx_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int mx_encap(sc, c, m_head)
- struct mx_softc *sc;
- struct mx_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- volatile struct mx_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == MX_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->mx_ptr->mx_frag[frag];
- f->mx_ctl = MX_TXCTL_TLINK | m->m_len;
- if (frag == 0) {
- f->mx_status = 0;
- f->mx_ctl |= MX_TXCTL_FIRSTFRAG;
- } else
- f->mx_status = MX_TXSTAT_OWN;
- f->mx_next = vtophys(&c->mx_ptr->mx_frag[frag + 1]);
- f->mx_data = vtophys(mtod(m, vm_offset_t));
- frag++;
- }
- }
-
- /*
- * Handle special case: we ran out of fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("mx%d: no memory for tx list", sc->mx_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("mx%d: no memory for tx list",
- sc->mx_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->mx_ptr->mx_frag[0];
- f->mx_status = 0;
- f->mx_data = vtophys(mtod(m_new, caddr_t));
- f->mx_ctl = total_len = m_new->m_len;
- f->mx_ctl |= MX_TXCTL_TLINK|MX_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
-
- if (total_len < MX_MIN_FRAMELEN) {
- f = &c->mx_ptr->mx_frag[frag];
- f->mx_ctl = MX_MIN_FRAMELEN - total_len;
- f->mx_data = vtophys(&sc->mx_cdata.mx_pad);
- f->mx_ctl |= MX_TXCTL_TLINK;
- f->mx_status = MX_TXSTAT_OWN;
- frag++;
- }
-
- c->mx_mbuf = m_head;
- c->mx_lastdesc = frag - 1;
- MX_TXCTL(c) |= MX_TXCTL_LASTFRAG;
- MX_TXNEXT(c) = vtophys(&c->mx_nextdesc->mx_ptr->mx_frag[0]);
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void mx_start(ifp)
- struct ifnet *ifp;
-{
- struct mx_softc *sc;
- struct mbuf *m_head = NULL;
- struct mx_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->mx_autoneg) {
- sc->mx_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->mx_cdata.mx_tx_free->mx_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->mx_cdata.mx_tx_free;
-
- while(sc->mx_cdata.mx_tx_free->mx_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->mx_cdata.mx_tx_free;
- sc->mx_cdata.mx_tx_free = cur_tx->mx_nextdesc;
-
- /* Pack the data into the descriptor. */
- mx_encap(sc, cur_tx, m_head);
- if (cur_tx != start_tx)
- MX_TXOWN(cur_tx) = MX_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->mx_mbuf);
-#endif
- }
-
- /*
- * If there are no frames queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
- * Place the request for the upload interrupt
- * in the last descriptor in the chain. This way, if
- * we're chaining several packets at once, we'll only
- * get an interupt once for the whole chain rather than
- * once for each packet.
- */
- MX_TXCTL(cur_tx) |= MX_TXCTL_FINT;
- sc->mx_cdata.mx_tx_tail = cur_tx;
-
- if (sc->mx_cdata.mx_tx_head == NULL) {
- sc->mx_cdata.mx_tx_head = start_tx;
- MX_TXOWN(start_tx) = MX_TXSTAT_OWN;
- CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);
- } else {
- MX_TXOWN(start_tx) = MX_UNSENT;
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void mx_init(xsc)
- void *xsc;
-{
- struct mx_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->mx_autoneg)
- return;
-
- s = splimp();
-
- if (sc->mx_pinfo != NULL)
- phy_bmcr = mx_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- mx_stop(sc);
- mx_reset(sc);
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, MX_BUSCTL, MX_BUSCTL_CONFIG);
-
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_NO_RXCRC);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_HEARTBEAT);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_STORENFWD);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_TX_BACKOFF);
-
- /*
- * The app notes for the 98713 and 98715A say that
- * in order to have the chips operate properly, a magic
- * number must be written to CSR16. Macronix does not
- * document the meaning of these bits so there's no way
- * to know exactly what they mean. The 98713 has a magic
- * number all its own; the rest all use a different one.
- */
- MX_CLRBIT(sc, MX_MAGICPACKET, 0xFFFF0000);
- if (sc->mx_type == MX_TYPE_98713)
- MX_SETBIT(sc, MX_MAGICPACKET, MX_MAGIC_98713);
- else
- MX_SETBIT(sc, MX_MAGICPACKET, MX_MAGIC_98715);
-
- if (sc->mx_pinfo != NULL) {
- MX_SETBIT(sc, MX_WATCHDOG, MX_WDOG_JABBERDIS);
- mx_setcfg(sc, mx_phy_readreg(sc, PHY_BMCR));
- } else
- mx_setmode(sc, sc->ifmedia.ifm_media, 0);
-
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_TX_THRESH);
- MX_CLRBIT(sc, MX_NETCFG, MX_NETCFG_SPEEDSEL);
-
- if (IFM_SUBTYPE(sc->ifmedia.ifm_media) == IFM_10_T)
- MX_SETBIT(sc, MX_NETCFG, MX_TXTHRESH_160BYTES);
- else
- MX_SETBIT(sc, MX_NETCFG, MX_TXTHRESH_72BYTES);
-
- /* Init circular RX list. */
- if (mx_list_rx_init(sc) == ENOBUFS) {
- printf("mx%d: initialization failed: no "
- "memory for rx buffers\n", sc->mx_unit);
- mx_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- mx_list_tx_init(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, MX_RXADDR, vtophys(sc->mx_cdata.mx_rx_head->mx_ptr));
-
- /*
- * Load the RX/multicast filter.
- */
- mx_setfilt(sc);
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, MX_IMR, MX_INTRS);
- CSR_WRITE_4(sc, MX_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- MX_SETBIT(sc, MX_NETCFG, MX_NETCFG_TX_ON|MX_NETCFG_RX_ON);
- CSR_WRITE_4(sc, MX_RXSTART, 0xFFFFFFFF);
-
- /* Restore state of BMCR */
- if (sc->mx_pinfo != NULL)
- mx_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int mx_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct mx_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (sc->mx_type == MX_TYPE_98713 && sc->mx_pinfo != NULL) {
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- mx_autoneg_mii(sc, MX_FLAG_SCHEDDELAY, 1);
- else
- mx_setmode_mii(sc, ifm->ifm_media);
- } else {
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- mx_autoneg(sc, MX_FLAG_SCHEDDELAY, 1);
- else
- mx_setmode(sc, ifm->ifm_media, 1);
- }
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void mx_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct mx_softc *sc;
- u_int16_t advert = 0, ability = 0;
- u_int32_t media = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (sc->mx_type != MX_TYPE_98713 || sc->mx_pinfo == NULL) {
- media = CSR_READ_4(sc, MX_NETCFG);
- if (media & MX_NETCFG_PORTSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (media & MX_NETCFG_FULLDUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- if (!(mx_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (mx_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (mx_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = mx_phy_readreg(sc, PHY_LPAR);
- advert = mx_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int mx_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct mx_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- mx_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- mx_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- mx_init(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void mx_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct mx_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->mx_autoneg) {
- if (sc->mx_type == MX_TYPE_98713 && sc->mx_pinfo != NULL)
- mx_autoneg_mii(sc, MX_FLAG_DELAYTIMEO, 1);
- else
- mx_autoneg(sc, MX_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("mx%d: watchdog timeout\n", sc->mx_unit);
-
- if (sc->mx_pinfo == NULL) {
- if (!(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS10) ||
- !(CSR_READ_4(sc, MX_10BTSTAT) & MX_TSTAT_LS100))
- printf("mx%d: no carrier - transceiver "
- "cable problem?\n", sc->mx_unit);
- } else {
- if (!(mx_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("mx%d: no carrier - transceiver "
- "cable problem?\n", sc->mx_unit);
- }
-
- mx_stop(sc);
- mx_reset(sc);
- mx_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- mx_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void mx_stop(sc)
- struct mx_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- MX_CLRBIT(sc, MX_NETCFG, (MX_NETCFG_RX_ON|MX_NETCFG_TX_ON));
- CSR_WRITE_4(sc, MX_IMR, 0x00000000);
- CSR_WRITE_4(sc, MX_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, MX_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < MX_RX_LIST_CNT; i++) {
- if (sc->mx_cdata.mx_rx_chain[i].mx_mbuf != NULL) {
- m_freem(sc->mx_cdata.mx_rx_chain[i].mx_mbuf);
- sc->mx_cdata.mx_rx_chain[i].mx_mbuf = NULL;
- }
- }
- bzero((char *)&sc->mx_ldata->mx_rx_list,
- sizeof(sc->mx_ldata->mx_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < MX_TX_LIST_CNT; i++) {
- if (sc->mx_cdata.mx_tx_chain[i].mx_mbuf != NULL) {
- m_freem(sc->mx_cdata.mx_tx_chain[i].mx_mbuf);
- sc->mx_cdata.mx_tx_chain[i].mx_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->mx_ldata->mx_tx_list,
- sizeof(sc->mx_ldata->mx_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void mx_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct mx_softc *sc = (struct mx_softc *)arg;
-
- mx_stop(sc);
-
- return;
-}
-
-static struct pci_device mx_device = {
- "mx",
- mx_probe,
- mx_attach,
- &mx_count,
- NULL
-};
-DATA_SET(pcidevice_set, mx_device);
diff --git a/sys/pci/if_mxreg.h b/sys/pci/if_mxreg.h
deleted file mode 100644
index 8a6d0a85fe01f..0000000000000
--- a/sys/pci/if_mxreg.h
+++ /dev/null
@@ -1,697 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_mxreg.h,v 1.12 1998/12/04 21:34:33 wpaul Exp $
- */
-
-/*
- * Macronix register definitions.
- */
-
-#define MX_BUSCTL 0x00 /* bus control */
-#define MX_TXSTART 0x08 /* tx start demand */
-#define MX_RXSTART 0x10 /* rx start demand */
-#define MX_RXADDR 0x18 /* rx descriptor list start addr */
-#define MX_TXADDR 0x20 /* tx descriptor list start addr */
-#define MX_ISR 0x28 /* interrupt status register */
-#define MX_NETCFG 0x30 /* network config register */
-#define MX_IMR 0x38 /* interrupt mask */
-#define MX_FRAMESDISCARDED 0x40 /* # of discarded frames */
-#define MX_SIO 0x48 /* MII and ROM/EEPROM access */
-#define MX_RESERVED 0x50
-#define MX_TIMER 0x58 /* general timer */
-#define MX_10BTSTAT 0x60
-#define MX_SIARESET 0x68
-#define MX_10BTCTRL 0x70
-#define MX_WATCHDOG 0x78
-#define MX_MAGICPACKET 0x80
-#define MX_NWAYSTAT 0xA0
-
-/*
- * These are magic values that must be written into CSR16
- * (MX_MAGICPACKET) in order to put the chip into proper
- * operating mode. The magic numbers are documented in the
- * Macronix 98715 application notes.
- */
-#define MX_MAGIC_98713 0x0F370000
-#define MX_MAGIC_98713A 0x0B3C0000
-#define MX_MAGIC_98715 0x0B3C0000
-#define MX_MAGIC_98725 0x0B3C0000
-
-#define MX_REVISION_98713 0x00
-#define MX_REVISION_98713A 0x10
-#define MX_REVISION_98715 0x20
-#define MX_REVISION_98725 0x30
-
-/*
- * As far as the driver is concerned, there are two 'types' of
- * chips to be concerned with. One is a 98713 with an external
- * PHY on the MII. The other covers pretty much everything else,
- * since all the other Macronix chips have built-in transceivers.
- * This type setting governs what which mode selection routines
- * we use (MII or built-in). It also govers which of the 'magic'
- * numbers we write into CSR16.
- */
-#define MX_TYPE_98713 0x1
-#define MX_TYPE_98713A 0x2
-#define MX_TYPE_987x5 0x3
-
-/*
- * Bus control bits.
- */
-#define MX_BUSCTL_RESET 0x00000001
-#define MX_BUSCTL_ARBITRATION 0x00000002
-#define MX_BUSCTL_SKIPLEN 0x0000007C
-#define MX_BUSCTL_BUF_BIGENDIAN 0x00000080
-#define MX_BUSCTL_BURSTLEN 0x00003F00
-#define MX_BUSCTL_CACHEALIGN 0x0000C000
-#define MX_BUSCTL_XMITPOLL 0x00060000
-
-#define MX_SKIPLEN_1LONG 0x00000004
-#define MX_SKIPLEN_2LONG 0x00000008
-#define MX_SKIPLEN_3LONG 0x00000010
-#define MX_SKIPLEN_4LONG 0x00000020
-#define MX_SKIPLEN_5LONG 0x00000040
-
-#define MX_CACHEALIGN_8LONG 0x00004000
-#define MX_CACHEALIGN_16LONG 0x00008000
-#define MX_CACHEALIGN_32LONG 0x0000C000
-
-#define MX_BURSTLEN_USECA 0x00000000
-#define MX_BURSTLEN_1LONG 0x00000100
-#define MX_BURSTLEN_2LONG 0x00000200
-#define MX_BURSTLEN_4LONG 0x00000400
-#define MX_BURSTLEN_8LONG 0x00000800
-#define MX_BURSTLEN_16LONG 0x00001000
-#define MX_BURSTLEN_32LONG 0x00002000
-
-#define MX_TXPOLL_OFF 0x00000000
-#define MX_TXPOLL_200U 0x00020000
-#define MX_TXPOLL_800U 0x00040000
-#define MX_TXPOLL_1600U 0x00060000
-
-#define MX_BUSCTL_CONFIG (MX_BUSCTL_ARBITRATION|MX_CACHEALIGN_8LONG| \
- MX_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define MX_ISR_TX_OK 0x00000001
-#define MX_ISR_TX_IDLE 0x00000002
-#define MX_ISR_TX_NOBUF 0x00000004
-#define MX_ISR_TX_JABBERTIMEO 0x00000008
-#define MX_ISR_LINKGOOD 0x00000010
-#define MX_ISR_TX_UNDERRUN 0x00000020
-#define MX_ISR_RX_OK 0x00000040
-#define MX_ISR_RX_NOBUF 0x00000080
-#define MX_ISR_RX_READ 0x00000100
-#define MX_ISR_RX_WATDOGTIMEO 0x00000200
-#define MX_ISR_TX_EARLY 0x00000400
-#define MX_ISR_TIMER_EXPIRED 0x00000800
-#define MX_ISR_LINKFAIL 0x00001000
-#define MX_ISR_BUS_ERR 0x00002000
-#define MX_ISR_RX_EARLY 0x00004000
-#define MX_ISR_ABNORMAL 0x00008000
-#define MX_ISR_NORMAL 0x00010000
-#define MX_ISR_RX_STATE 0x000E0000
-#define MX_ISR_TX_STATE 0x00700000
-#define MX_ISR_BUSERRTYPE 0x03800000
-#define MX_ISR_100MBPSLINK 0x08000000
-#define MX_ISR_MAGICKPACK 0x10000000
-
-#define MX_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define MX_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define MX_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define MX_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define MX_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define MX_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */
-#define MX_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define MX_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define MX_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define MX_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define MX_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define MX_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define MX_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define MX_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define MX_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define MX_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-/*
- * Network config bits.
- */
-#define MX_NETCFG_RX_HASHPERF 0x00000001
-#define MX_NETCFG_RX_ON 0x00000002
-#define MX_NETCFG_RX_HASHONLY 0x00000004
-#define MX_NETCFG_RX_BADFRAMES 0x00000008
-#define MX_NETCFG_RX_INVFILT 0x00000010
-#define MX_NETCFG_BACKOFFCNT 0x00000020
-#define MX_NETCFG_RX_PROMISC 0x00000040
-#define MX_NETCFG_RX_ALLMULTI 0x00000080
-#define MX_NETCFG_FULLDUPLEX 0x00000200
-#define MX_NETCFG_LOOPBACK 0x00000C00
-#define MX_NETCFG_FORCECOLL 0x00001000
-#define MX_NETCFG_TX_ON 0x00002000
-#define MX_NETCFG_TX_THRESH 0x0000C000
-#define MX_NETCFG_TX_BACKOFF 0x00020000
-#define MX_NETCFG_PORTSEL 0x00040000 /* 0 == 10, 1 == 100 */
-#define MX_NETCFG_HEARTBEAT 0x00080000
-#define MX_NETCFG_STORENFWD 0x00200000
-#define MX_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10, 0 == 100 */
-#define MX_NETCFG_PCS 0x00800000
-#define MX_NETCFG_SCRAMBLER 0x01000000
-#define MX_NETCFG_NO_RXCRC 0x02000000
-
-#define MX_OPMODE_NORM 0x00000000
-#define MX_OPMODE_INTLOOP 0x00000400
-#define MX_OPMODE_EXTLOOP 0x00000800
-
-#define MX_TXTHRESH_72BYTES 0x00000000
-#define MX_TXTHRESH_96BYTES 0x00004000
-#define MX_TXTHRESH_128BYTES 0x00008000
-#define MX_TXTHRESH_160BYTES 0x0000C000
-
-
-/*
- * Interrupt mask bits.
- */
-#define MX_IMR_TX_OK 0x00000001
-#define MX_IMR_TX_IDLE 0x00000002
-#define MX_IMR_TX_NOBUF 0x00000004
-#define MX_IMR_TX_JABBERTIMEO 0x00000008
-#define MX_IMR_LINKGOOD 0x00000010
-#define MX_IMR_TX_UNDERRUN 0x00000020
-#define MX_IMR_RX_OK 0x00000040
-#define MX_IMR_RX_NOBUF 0x00000080
-#define MX_IMR_RX_READ 0x00000100
-#define MX_IMR_RX_WATDOGTIMEO 0x00000200
-#define MX_IMR_TX_EARLY 0x00000400
-#define MX_IMR_TIMER_EXPIRED 0x00000800
-#define MX_IMR_LINKFAIL 0x00001000
-#define MX_IMR_BUS_ERR 0x00002000
-#define MX_IMR_RX_EARLY 0x00004000
-#define MX_IMR_ABNORMAL 0x00008000
-#define MX_IMR_NORMAL 0x00010000
-#define MX_IMR_100MBPSLINK 0x08000000
-#define MX_IMR_MAGICKPACK 0x10000000
-
-#define MX_INTRS \
- (MX_IMR_RX_OK|MX_IMR_TX_OK|MX_IMR_RX_NOBUF|MX_IMR_RX_WATDOGTIMEO|\
- MX_IMR_TX_NOBUF|MX_IMR_TX_UNDERRUN|MX_IMR_BUS_ERR| \
- MX_IMR_ABNORMAL|MX_IMR_NORMAL/*|MX_IMR_TX_EARLY*/)
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define MX_SIO_EE_CS 0x00000001 /* EEPROM chip select */
-#define MX_SIO_EE_CLK 0x00000002 /* EEPROM clock */
-#define MX_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */
-#define MX_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */
-#define MX_SIO_ROMDATA4 0x00000010
-#define MX_SIO_ROMDATA5 0x00000020
-#define MX_SIO_ROMDATA6 0x00000040
-#define MX_SIO_ROMDATA7 0x00000080
-#define MX_SIO_EESEL 0x00000800
-#define MX_SIO_ROMSEL 0x00001000
-#define MX_SIO_ROMCTL_WRITE 0x00002000
-#define MX_SIO_ROMCTL_READ 0x00004000
-#define MX_SIO_MII_CLK 0x00010000 /* MDIO clock */
-#define MX_SIO_MII_DATAOUT 0x00020000 /* MDIO data out */
-#define MX_SIO_MII_DIR 0x00040000 /* MDIO dir */
-#define MX_SIO_MII_DATAIN 0x00080000 /* MDIO data in */
-
-#define MX_EECMD_WRITE 0x140
-#define MX_EECMD_READ 0x180
-#define MX_EECMD_ERASE 0x1c0
-
-#define MX_EE_NODEADDR_OFFSET 0x70
-#define MX_EE_NODEADDR 10
-
-/*
- * General purpose timer register
- */
-#define MX_TIMER_VALUE 0x0000FFFF
-#define MX_TIMER_CONTINUUS 0x00010000
-
-/*
- * 10baseT status register
- */
-#define MX_TSTAT_LS100 0x00000002 /* link status of 100baseTX */
-#define MX_TSTAT_LS10 0x00000004 /* link status of 10baseT */
-#define MX_TSTAT_AUTOPOLARITY 0x00000008
-#define MX_TSTAT_REMFAULT 0x00000800
-#define MX_TSTAT_ANEGSTAT 0x00007000
-#define MX_TSTAT_LP_CAN_NWAY 0x00008000 /* link partner supports NWAY */
-#define MX_TSTAT_LPCODEWORD 0xFFFF0000 /* link partner's code word */
-
-#define MX_ASTAT_DISABLE 0x00000000
-#define MX_ASTAT_TXDISABLE 0x00001000
-#define MX_ASTAT_ABDETECT 0x00002000
-#define MX_ASTAT_ACKDETECT 0x00003000
-#define MX_ASTAT_CMPACKDETECT 0x00004000
-#define MX_ASTAT_AUTONEGCMP 0x00005000
-#define MX_ASTAT_LINKCHECK 0x00006000
-
-/*
- * PHY reset register
- */
-#define MX_SIA_RESET_NWAY 0x00000001
-#define MX_SIA_RESET_100TX 0x00000002
-
-/*
- * 10baseT control register
- */
-#define MX_TCTL_LOOPBACK 0x00000002
-#define MX_TCTL_POWERDOWN 0x00000004
-#define MX_TCTL_HALFDUPLEX 0x00000040
-#define MX_TCTL_AUTONEGENBL 0x00000080
-#define MX_TCTL_RX_SQUELCH 0x00000100
-#define MX_TCTL_LINKTEST 0x00001000
-#define MX_TCTL_100BTXHALF 0x00010000
-#define MX_TCTL_100BTXFULL 0x00020000
-#define MX_TCTL_100BT4 0x00040000
-
-/*
- * Watchdog timer register
- */
-#define MX_WDOG_JABBERDIS 0x00000001
-#define MX_WDOG_HOSTUNJAB 0x00000002
-#define MX_WDOG_JABBERCLK 0x00000004
-#define MX_WDOG_RXWDOGDIS 0x00000010
-#define MX_WDOG_RXWDOGCLK 0x00000020
-#define MX_WDOG_MUSTBEZERO 0x00000100
-
-/*
- * Magic packet register
- */
-#define MX_MPACK_DISABLE 0x00400000
-
-/*
- * NWAY status register.
- */
-#define MX_NWAY_10BTHALF 0x08000000
-#define MX_NWAY_10BTFULL 0x10000000
-#define MX_NWAY_100BTHALF 0x20000000
-#define MX_NWAY_100BTFULL 0x40000000
-#define MX_NWAY_100BT4 0x80000000
-
-/*
- * Size of a setup frame.
- */
-#define MX_SFRAME_LEN 192
-
-/*
- * Macronix TX/RX list structure.
- */
-
-struct mx_desc {
- volatile u_int32_t mx_status;
- volatile u_int32_t mx_ctl;
- volatile u_int32_t mx_ptr1;
- volatile u_int32_t mx_ptr2;
-};
-
-#define mx_data mx_ptr1
-#define mx_next mx_ptr2
-
-#define MX_RXSTAT_FIFOOFLOW 0x00000001
-#define MX_RXSTAT_CRCERR 0x00000002
-#define MX_RXSTAT_DRIBBLE 0x00000004
-#define MX_RXSTAT_WATCHDOG 0x00000010
-#define MX_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */
-#define MX_RXSTAT_COLLSEEN 0x00000040
-#define MX_RXSTAT_GIANT 0x00000080
-#define MX_RXSTAT_LASTFRAG 0x00000100
-#define MX_RXSTAT_FIRSTFRAG 0x00000200
-#define MX_RXSTAT_MULTICAST 0x00000400
-#define MX_RXSTAT_RUNT 0x00000800
-#define MX_RXSTAT_RXTYPE 0x00003000
-#define MX_RXSTAT_RXERR 0x00008000
-#define MX_RXSTAT_RXLEN 0x3FFF0000
-#define MX_RXSTAT_OWN 0x80000000
-
-#define MX_RXBYTES(x) ((x & MX_RXSTAT_RXLEN) >> 16)
-#define MX_RXSTAT (MX_RXSTAT_FIRSTFRAG|MX_RXSTAT_LASTFRAG|MX_RXSTAT_OWN)
-
-#define MX_RXCTL_BUFLEN1 0x00000FFF
-#define MX_RXCTL_BUFLEN2 0x00FFF000
-#define MX_RXCTL_RLINK 0x01000000
-#define MX_RXCTL_RLAST 0x02000000
-
-#define MX_TXSTAT_DEFER 0x00000001
-#define MX_TXSTAT_UNDERRUN 0x00000002
-#define MX_TXSTAT_LINKFAIl 0x00000003
-#define MX_TXSTAT_COLLCNT 0x00000078
-#define MX_TXSTAT_SQE 0x00000080
-#define MX_TXSTAT_EXCESSCOLL 0x00000100
-#define MX_TXSTAT_LATECOLL 0x00000200
-#define MX_TXSTAT_NOCARRIER 0x00000400
-#define MX_TXSTAT_CARRLOST 0x00000800
-#define MX_TXSTAT_JABTIMEO 0x00004000
-#define MX_TXSTAT_ERRSUM 0x00008000
-#define MX_TXSTAT_OWN 0x80000000
-
-#define MX_TXCTL_BUFLEN1 0x000007FF
-#define MX_TXCTL_BUFLEN2 0x003FF800
-#define MX_TXCTL_FILTTYPE0 0x00400000
-#define MX_TXCTL_PAD 0x00800000
-#define MX_TXCTL_TLINK 0x01000000
-#define MX_TXCTL_TLAST 0x02000000
-#define MX_TXCTL_NOCRC 0x04000000
-#define MX_TXCTL_SETUP 0x08000000
-#define MX_TXCTL_FILTTYPE1 0x10000000
-#define MX_TXCTL_FIRSTFRAG 0x20000000
-#define MX_TXCTL_LASTFRAG 0x40000000
-#define MX_TXCTL_FINT 0x80000000
-
-#define MX_FILTER_PERFECT 0x00000000
-#define MX_FILTER_HASHPERF 0x00400000
-#define MX_FILTER_INVERSE 0x10000000
-#define MX_FILTER_HASHONLY 0x10400000
-
-#define MX_MAXFRAGS 16
-#define MX_RX_LIST_CNT 64
-#define MX_TX_LIST_CNT 64
-#define MX_MIN_FRAMELEN 60
-
-/*
- * A tx 'super descriptor' is actually 16 regular descriptors
- * back to back.
- */
-struct mx_txdesc {
- volatile struct mx_desc mx_frag[MX_MAXFRAGS];
-};
-
-#define MX_TXNEXT(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_next
-#define MX_TXSTATUS(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_status
-#define MX_TXCTL(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_ctl
-#define MX_TXDATA(x) x->mx_ptr->mx_frag[x->mx_lastdesc].mx_data
-
-#define MX_TXOWN(x) x->mx_ptr->mx_frag[0].mx_status
-
-#define MX_UNSENT 0x12341234
-
-struct mx_list_data {
- volatile struct mx_desc mx_rx_list[MX_RX_LIST_CNT];
- volatile struct mx_txdesc mx_tx_list[MX_TX_LIST_CNT];
-};
-
-struct mx_chain {
- volatile struct mx_txdesc *mx_ptr;
- struct mbuf *mx_mbuf;
- struct mx_chain *mx_nextdesc;
- u_int8_t mx_lastdesc;
-};
-
-struct mx_chain_onefrag {
- volatile struct mx_desc *mx_ptr;
- struct mbuf *mx_mbuf;
- struct mx_chain_onefrag *mx_nextdesc;
-};
-
-struct mx_chain_data {
- struct mx_desc mx_sframe;
- u_int32_t mx_sbuf[MX_SFRAME_LEN/sizeof(u_int32_t)];
- u_int8_t mx_pad[MX_MIN_FRAMELEN];
- struct mx_chain_onefrag mx_rx_chain[MX_RX_LIST_CNT];
- struct mx_chain mx_tx_chain[MX_TX_LIST_CNT];
-
- struct mx_chain_onefrag *mx_rx_head;
-
- struct mx_chain *mx_tx_head;
- struct mx_chain *mx_tx_tail;
- struct mx_chain *mx_tx_free;
-};
-
-struct mx_type {
- u_int16_t mx_vid;
- u_int16_t mx_did;
- char *mx_name;
-};
-
-struct mx_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define MX_MII_STARTDELIM 0x01
-#define MX_MII_READOP 0x02
-#define MX_MII_WRITEOP 0x01
-#define MX_MII_TURNAROUND 0x02
-
-#define MX_FLAG_FORCEDELAY 1
-#define MX_FLAG_SCHEDDELAY 2
-#define MX_FLAG_DELAYTIMEO 3
-
-struct mx_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t mx_bhandle; /* bus space handle */
- bus_space_tag_t mx_btag; /* bus space tag */
- struct mx_type *mx_info; /* Macronix adapter info */
- struct mx_type *mx_pinfo; /* phy info */
- u_int8_t mx_unit; /* interface number */
- u_int8_t mx_type;
- u_int8_t mx_phy_addr; /* PHY address */
- u_int8_t mx_tx_pend; /* TX pending */
- u_int8_t mx_want_auto;
- u_int8_t mx_autoneg;
- u_int8_t mx_singlebuf;
- caddr_t mx_ldata_ptr;
- struct mx_list_data *mx_ldata;
- struct mx_chain_data mx_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->mx_btag, sc->mx_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->mx_btag, sc->mx_bbhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->mx_btag, sc->mx_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->mx_btag, sc->mx_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->mx_btag, sc->mx_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->mx_btag, sc->mx_bhandle, reg)
-
-#define MX_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * Macronix PCI vendor ID
- */
-#define MX_VENDORID 0x10D9
-
-/*
- * Macronix PMAC device IDs.
- */
-#define MX_DEVICEID_98713 0x0512
-#define MX_DEVICEID_987x5 0x0531
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define MX_PCI_VENDOR_ID 0x00
-#define MX_PCI_DEVICE_ID 0x02
-#define MX_PCI_COMMAND 0x04
-#define MX_PCI_STATUS 0x06
-#define MX_PCI_REVID 0x08
-#define MX_PCI_CLASSCODE 0x09
-#define MX_PCI_LATENCY_TIMER 0x0D
-#define MX_PCI_HEADER_TYPE 0x0E
-#define MX_PCI_LOIO 0x10
-#define MX_PCI_LOMEM 0x14
-#define MX_PCI_BIOSROM 0x30
-#define MX_PCI_INTLINE 0x3C
-#define MX_PCI_INTPIN 0x3D
-#define MX_PCI_MINGNT 0x3E
-#define MX_PCI_MINLAT 0x0F
-#define MX_PCI_RESETOPT 0x48
-#define MX_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define MX_PCI_CAPID 0x44 /* 8 bits */
-#define MX_PCI_NEXTPTR 0x45 /* 8 bits */
-#define MX_PCI_PWRMGMTCAP 0x46 /* 16 bits */
-#define MX_PCI_PWRMGMTCTRL 0x48 /* 16 bits */
-
-#define MX_PSTATE_MASK 0x0003
-#define MX_PSTATE_D0 0x0000
-#define MX_PSTATE_D1 0x0001
-#define MX_PSTATE_D2 0x0002
-#define MX_PSTATE_D3 0x0003
-#define MX_PME_EN 0x0010
-#define MX_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define MX_PHYADDR_MIN 0x00
-#define MX_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_pn.c b/sys/pci/if_pn.c
deleted file mode 100644
index bc413c734a33c..0000000000000
--- a/sys/pci/if_pn.c
+++ /dev/null
@@ -1,1986 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_pn.c,v 1.36 1999/01/05 00:47:25 wpaul Exp $
- */
-
-/*
- * 82c168/82c169 PNIC fast ethernet PCI NIC driver
- *
- * Supports various network adapters based on the Lite-On PNIC
- * PCI network controller chip including the LinkSys LNE100TX.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The PNIC chip is a DEC tulip clone. This driver uses much of the
- * same code from the driver for the Winbond chip (which is also a
- * tulip clone) except for the MII, EEPROM and filter programming.
- *
- * Technically we could merge support for this chip into the 'de'
- * driver, but it's such a mess that I'm afraid to go near it.
- *
- * The PNIC appears to support both an external MII and an internal
- * transceiver. I think most 100Mbps implementations use a PHY attached
- * the the MII. The LinkSys board that I have uses a Myson MTD972
- * 100BaseTX PHY.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define PN_USEIOSPACE
-
-/* #define PN_BACKGROUND_AUTONEG */
-
-#define PN_PROMISC_BUG_WAR
-
-#include <pci/if_pnreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_pn.c,v 1.36 1999/01/05 00:47:25 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct pn_type pn_devs[] = {
- { PN_VENDORID, PN_DEVICEID_PNIC,
- "82c168/82c169 PNIC 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct pn_type pn_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long pn_count = 0;
-static const char *pn_probe __P((pcici_t, pcidi_t));
-static void pn_attach __P((pcici_t, int));
-
-static int pn_newbuf __P((struct pn_softc *,
- struct pn_chain_onefrag *));
-static int pn_encap __P((struct pn_softc *, struct pn_chain *,
- struct mbuf *));
-
-#ifdef PN_PROMISC_BUG_WAR
-static void pn_promisc_bug_war __P((struct pn_softc *,
- struct pn_chain_onefrag *));
-#endif
-static void pn_rxeof __P((struct pn_softc *));
-static void pn_rxeoc __P((struct pn_softc *));
-static void pn_txeof __P((struct pn_softc *));
-static void pn_txeoc __P((struct pn_softc *));
-static void pn_intr __P((void *));
-static void pn_start __P((struct ifnet *));
-static int pn_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void pn_init __P((void *));
-static void pn_stop __P((struct pn_softc *));
-static void pn_watchdog __P((struct ifnet *));
-static void pn_shutdown __P((int, void *));
-static int pn_ifmedia_upd __P((struct ifnet *));
-static void pn_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void pn_eeprom_getword __P((struct pn_softc *, u_int8_t, u_int16_t *));
-static void pn_read_eeprom __P((struct pn_softc *, caddr_t, int,
- int, int));
-static u_int16_t pn_phy_readreg __P((struct pn_softc *, int));
-static void pn_phy_writereg __P((struct pn_softc *, u_int16_t, u_int16_t));
-
-static void pn_autoneg_xmit __P((struct pn_softc *));
-static void pn_autoneg_mii __P((struct pn_softc *, int, int));
-static void pn_setmode_mii __P((struct pn_softc *, int));
-static void pn_getmode_mii __P((struct pn_softc *));
-static void pn_setcfg __P((struct pn_softc *, u_int16_t));
-static u_int32_t pn_calchash __P((u_int8_t *));
-static void pn_setfilt __P((struct pn_softc *));
-static void pn_reset __P((struct pn_softc *));
-static int pn_list_rx_init __P((struct pn_softc *));
-static int pn_list_tx_init __P((struct pn_softc *));
-
-#define PN_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define PN_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void pn_eeprom_getword(sc, addr, dest)
- struct pn_softc *sc;
- u_int8_t addr;
- u_int16_t *dest;
-{
- register int i;
- u_int32_t r;
-
- CSR_WRITE_4(sc, PN_SIOCTL, PN_EE_READ|addr);
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(1);
- r = CSR_READ_4(sc, PN_SIO);
- if (!(r & PN_SIO_BUSY)) {
- *dest = (u_int16_t)(r & 0x0000FFFF);
- return;
- }
- }
-
- return;
-
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void pn_read_eeprom(sc, dest, off, cnt, swap)
- struct pn_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- pn_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-static u_int16_t pn_phy_readreg(sc, reg)
- struct pn_softc *sc;
- int reg;
-{
- int i;
- u_int32_t rval;
-
- CSR_WRITE_4(sc, PN_MII,
- PN_MII_READ | (sc->pn_phy_addr << 23) | (reg << 18));
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(1);
- rval = CSR_READ_4(sc, PN_MII);
- if (!(rval & PN_MII_BUSY)) {
- if ((u_int16_t)(rval & 0x0000FFFF) == 0xFFFF)
- return(0);
- else
- return((u_int16_t)(rval & 0x0000FFFF));
- }
- }
-
- return(0);
-}
-
-static void pn_phy_writereg(sc, reg, data)
- struct pn_softc *sc;
- u_int16_t reg;
- u_int16_t data;
-{
- int i;
-
- CSR_WRITE_4(sc, PN_MII,
- PN_MII_WRITE | (sc->pn_phy_addr << 23) | (reg << 18) | data);
-
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- if (!(CSR_READ_4(sc, PN_MII) & PN_MII_BUSY))
- break;
- }
-
- return;
-}
-
-#define PN_POLY 0xEDB88320
-#define PN_BITS 9
-
-static u_int32_t pn_calchash(addr)
- u_int8_t *addr;
-{
- u_int32_t idx, bit, data, crc;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (idx = 0; idx < 6; idx++) {
- for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1)
- crc = (crc >> 1) ^ (((crc ^ data) & 1) ? PN_POLY : 0);
- }
-
- return (crc & ((1 << PN_BITS) - 1));
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void pn_autoneg_xmit(sc)
- struct pn_softc *sc;
-{
- u_int16_t phy_sts;
-
- pn_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(pn_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = pn_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- pn_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void pn_autoneg_mii(sc, flag, verbose)
- struct pn_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = pn_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("pn%d: autonegotiation not supported\n",
- sc->pn_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case PN_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- pn_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case PN_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise pn_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->pn_cdata.pn_tx_head != NULL) {
- sc->pn_want_auto = 1;
- return;
- }
- pn_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->pn_autoneg = 1;
- sc->pn_want_auto = 0;
- return;
- break;
- case PN_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->pn_autoneg = 0;
- break;
- default:
- printf("pn%d: invalid autoneg flag: %d\n", sc->pn_unit, flag);
- return;
- }
-
- if (pn_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("pn%d: autoneg complete, ", sc->pn_unit);
- phy_sts = pn_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("pn%d: autoneg not complete, ", sc->pn_unit);
- }
-
- media = pn_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (pn_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = pn_phy_readreg(sc, PHY_ANAR);
- ability = pn_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- pn_setcfg(sc, media);
- pn_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- pn_init(sc);
-
- if (sc->pn_tx_pend) {
- sc->pn_autoneg = 0;
- sc->pn_tx_pend = 0;
- pn_start(ifp);
- }
-
- return;
-}
-
-static void pn_getmode_mii(sc)
- struct pn_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = pn_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("pn%d: PHY status word: %x\n", sc->pn_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("pn%d: 10Mbps half-duplex mode supported\n",
- sc->pn_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("pn%d: 10Mbps full-duplex mode supported\n",
- sc->pn_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("pn%d: 100Mbps half-duplex mode supported\n",
- sc->pn_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("pn%d: 100Mbps full-duplex mode supported\n",
- sc->pn_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("pn%d: 100baseT4 mode supported\n", sc->pn_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("pn%d: forcing on autoneg support for BT4\n",
- sc->pn_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("pn%d: autoneg supported\n", sc->pn_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void pn_setmode_mii(sc, media)
- struct pn_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->pn_autoneg) {
- printf("pn%d: canceling autoneg session\n", sc->pn_unit);
- ifp->if_timer = sc->pn_autoneg = sc->pn_want_auto = 0;
- bmcr = pn_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- pn_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("pn%d: selecting MII, ", sc->pn_unit);
-
- bmcr = pn_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- pn_setcfg(sc, bmcr);
- pn_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * Programming the receiver filter on the tulip/PNIC is gross. You
- * have to construct a special setup frame and download it to the
- * chip via the transmit DMA engine. This routine is also somewhat
- * gross, as the setup frame is sent synchronously rather than putting
- * on the transmit queue. The transmitter has to be stopped, then we
- * can download the frame and wait for the 'owned' bit to clear.
- *
- * We always program the chip using 'hash perfect' mode, i.e. one perfect
- * address (our node address) and a 512-bit hash filter for multicast
- * frames. We also sneak the broadcast address into the hash filter since
- * we need that too.
- */
-void pn_setfilt(sc)
- struct pn_softc *sc;
-{
- struct pn_desc *sframe;
- u_int32_t h, *sp;
- struct ifmultiaddr *ifma;
- struct ifnet *ifp;
- int i;
-
- ifp = &sc->arpcom.ac_if;
-
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- PN_SETBIT(sc, PN_ISR, PN_ISR_TX_IDLE);
-
- sframe = &sc->pn_cdata.pn_sframe;
- sp = (u_int32_t *)&sc->pn_cdata.pn_sbuf;
- bzero((char *)sp, PN_SFRAME_LEN);
-
- sframe->pn_status = PN_TXSTAT_OWN;
- sframe->pn_next = vtophys(&sc->pn_ldata->pn_tx_list[0]);
- sframe->pn_data = vtophys(&sc->pn_cdata.pn_sbuf);
- sframe->pn_ctl = PN_SFRAME_LEN | PN_TXCTL_TLINK |
- PN_TXCTL_SETUP | PN_FILTER_HASHPERF;
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_RX_PROMISC);
- else
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_RX_PROMISC);
-
- if (ifp->if_flags & IFF_ALLMULTI)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_RX_ALLMULTI);
-
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = pn_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- if (ifp->if_flags & IFF_BROADCAST) {
- h = pn_calchash(etherbroadcastaddr);
- sp[h >> 4] |= 1 << (h & 0xF);
- }
-
- sp[39] = ((u_int16_t *)sc->arpcom.ac_enaddr)[0];
- sp[40] = ((u_int16_t *)sc->arpcom.ac_enaddr)[1];
- sp[41] = ((u_int16_t *)sc->arpcom.ac_enaddr)[2];
-
- CSR_WRITE_4(sc, PN_TXADDR, vtophys(sframe));
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
-
- /*
- * Wait for chip to clear the 'own' bit.
- */
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(10);
- if (sframe->pn_status != PN_TXSTAT_OWN)
- break;
- }
-
- if (i == PN_TIMEOUT)
- printf("pn%d: failed to send setup frame\n", sc->pn_unit);
-
- PN_SETBIT(sc, PN_ISR, PN_ISR_TX_NOBUF|PN_ISR_TX_IDLE);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void pn_setcfg(sc, bmcr)
- struct pn_softc *sc;
- u_int16_t bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, PN_NETCFG) & (PN_NETCFG_TX_ON|PN_NETCFG_RX_ON)) {
- restart = 1;
- PN_CLRBIT(sc, PN_NETCFG, (PN_NETCFG_TX_ON|PN_NETCFG_RX_ON));
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(10);
- if ((CSR_READ_4(sc, PN_ISR) & PN_ISR_TX_IDLE) &&
- (CSR_READ_4(sc, PN_ISR) & PN_ISR_RX_IDLE))
- break;
- }
-
- if (i == PN_TIMEOUT)
- printf("pn%d: failed to force tx and "
- "rx to idle state\n", sc->pn_unit);
-
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL)
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_SPEEDSEL);
- else
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_SPEEDSEL);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_FULLDUPLEX);
- else
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_FULLDUPLEX);
-
- if (restart)
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON|PN_NETCFG_RX_ON);
-
- return;
-}
-
-static void pn_reset(sc)
- struct pn_softc *sc;
-{
- register int i;
-
- PN_SETBIT(sc, PN_BUSCTL, PN_BUSCTL_RESET);
-
- for (i = 0; i < PN_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, PN_BUSCTL) & PN_BUSCTL_RESET))
- break;
- }
- if (i == PN_TIMEOUT)
- printf("pn%d: reset never completed!\n", sc->pn_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
- return;
-}
-
-/*
- * Probe for a Lite-On PNIC chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-pn_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct pn_type *t;
-
- t = pn_devs;
-
- while(t->pn_name != NULL) {
- if ((device_id & 0xFFFF) == t->pn_vid &&
- ((device_id >> 16) & 0xFFFF) == t->pn_did) {
- return(t->pn_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-pn_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef PN_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct pn_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct pn_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-#ifdef PN_PROMISC_BUG_WAR
- u_int32_t revision = 0;
-#endif
-
- s = splimp();
-
- sc = malloc(sizeof(struct pn_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("pn%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct pn_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, PN_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, PN_PCI_PWRMGMTCTRL);
- if (command & PN_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, PN_PCI_LOIO);
- membase = pci_conf_read(config_id, PN_PCI_LOMEM);
- irq = pci_conf_read(config_id, PN_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("pn%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & PN_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, PN_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, PN_PCI_LOIO, iobase);
- pci_conf_write(config_id, PN_PCI_LOMEM, membase);
- pci_conf_write(config_id, PN_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef PN_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("pn%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, PN_PCI_LOIO,
- (u_short *)&(sc->pn_bhandle))) {
- printf ("pn%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->pn_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("pn%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, PN_PCI_LOMEM, &vbase, &pbase)) {
- printf ("pn%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->pn_bhandle = vbase;
- sc->pn_btag = I386_BUS_SPACE_MEM;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, pn_intr, sc, &net_imask)) {
- printf("pn%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- pn_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- pn_read_eeprom(sc, (caddr_t)&eaddr, 0, 3, 1);
-
- /*
- * A PNIC chip was detected. Inform the world.
- */
- printf("pn%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->pn_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->pn_ldata_ptr = malloc(sizeof(struct pn_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->pn_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("pn%d: no memory for list buffers!\n", unit);
- goto fail;
- }
-
- sc->pn_ldata = (struct pn_list_data *)sc->pn_ldata_ptr;
- round = (unsigned int)sc->pn_ldata_ptr & 0xF;
- roundptr = sc->pn_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->pn_ldata = (struct pn_list_data *)roundptr;
- bzero(sc->pn_ldata, sizeof(struct pn_list_data));
-
-#ifdef PN_PROMISC_BUG_WAR
- revision = pci_conf_read(config_id, PN_PCI_REVISION) & 0x000000FF;
- if (revision == PN_169B_REV || revision == PN_169_REV) {
- sc->pn_promisc_war = 1;
- sc->pn_promisc_buf = malloc(PN_RXLEN * 5, M_DEVBUF, M_NOWAIT);
- if (sc->pn_promisc_buf == NULL) {
- printf("pn%d: no memory for workaround buffer\n", unit);
- goto fail;
- }
- } else {
- sc->pn_promisc_war = 0;
- }
-#endif
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "pn";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = pn_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = pn_start;
- ifp->if_watchdog = pn_watchdog;
- ifp->if_init = pn_init;
- ifp->if_baudrate = 10000000;
-
- if (bootverbose)
- printf("pn%d: probing for a PHY\n", sc->pn_unit);
- for (i = PN_PHYADDR_MIN; i < PN_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("pn%d: checking address: %d\n",
- sc->pn_unit, i);
- sc->pn_phy_addr = i;
- pn_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(pn_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = pn_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = pn_phy_readreg(sc, PHY_VENID);
- phy_did = pn_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("pn%d: found PHY at address %d, ",
- sc->pn_unit, sc->pn_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = pn_phys;
- while(p->pn_vid) {
- if (phy_vid == p->pn_vid &&
- (phy_did | 0x000F) == p->pn_did) {
- sc->pn_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->pn_pinfo == NULL)
- sc->pn_pinfo = &pn_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("pn%d: PHY type: %s\n",
- sc->pn_unit, sc->pn_pinfo->pn_name);
- } else {
- printf("pn%d: MII without any phy!\n", sc->pn_unit);
- goto fail;
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, pn_ifmedia_upd, pn_ifmedia_sts);
-
- pn_getmode_mii(sc);
- pn_autoneg_mii(sc, PN_FLAG_FORCEDELAY, 1);
- media = sc->ifmedia.ifm_media;
- pn_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(pn_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int pn_list_tx_init(sc)
- struct pn_softc *sc;
-{
- struct pn_chain_data *cd;
- struct pn_list_data *ld;
- int i;
-
- cd = &sc->pn_cdata;
- ld = sc->pn_ldata;
- for (i = 0; i < PN_TX_LIST_CNT; i++) {
- cd->pn_tx_chain[i].pn_ptr = &ld->pn_tx_list[i];
- if (i == (PN_TX_LIST_CNT - 1))
- cd->pn_tx_chain[i].pn_nextdesc =
- &cd->pn_tx_chain[0];
- else
- cd->pn_tx_chain[i].pn_nextdesc =
- &cd->pn_tx_chain[i + 1];
- }
-
- cd->pn_tx_free = &cd->pn_tx_chain[0];
- cd->pn_tx_tail = cd->pn_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int pn_list_rx_init(sc)
- struct pn_softc *sc;
-{
- struct pn_chain_data *cd;
- struct pn_list_data *ld;
- int i;
-
- cd = &sc->pn_cdata;
- ld = sc->pn_ldata;
-
- for (i = 0; i < PN_RX_LIST_CNT; i++) {
- cd->pn_rx_chain[i].pn_ptr =
- (struct pn_desc *)&ld->pn_rx_list[i];
- if (pn_newbuf(sc, &cd->pn_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (PN_RX_LIST_CNT - 1)) {
- cd->pn_rx_chain[i].pn_nextdesc = &cd->pn_rx_chain[0];
- ld->pn_rx_list[i].pn_next =
- vtophys(&ld->pn_rx_list[0]);
- } else {
- cd->pn_rx_chain[i].pn_nextdesc = &cd->pn_rx_chain[i + 1];
- ld->pn_rx_list[i].pn_next =
- vtophys(&ld->pn_rx_list[i + 1]);
- }
- }
-
- cd->pn_rx_head = &cd->pn_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int pn_newbuf(sc, c)
- struct pn_softc *sc;
- struct pn_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("pn%d: no memory for rx list -- packet dropped!\n",
- sc->pn_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("pn%d: no memory for rx list -- packet dropped!\n",
- sc->pn_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- /*
- * Zero the buffer. This is part of the workaround for the
- * promiscuous mode bug in the revision 33 PNIC chips.
- */
- bzero((char *)mtod(m_new, char *), MCLBYTES);
- m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
-
- c->pn_mbuf = m_new;
- c->pn_ptr->pn_status = PN_RXSTAT;
- c->pn_ptr->pn_data = vtophys(mtod(m_new, caddr_t));
- c->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
-
- return(0);
-}
-
-#ifdef PN_PROMISC_BUG_WAR
-/*
- * Grrrrr.
- * Revision 33 of the PNIC chip has a terrible bug in it that manifests
- * itself when you enable promiscuous mode. Sometimes instead of uploading
- * one complete frame, it uploads its entire FIFO memory. The frame we
- * want is at the end of this whole mess, but we never know exactly
- * how much data has been uploaded, so finding it can be hard.
- *
- * There is only one way to do it reliably, and it's disgusting.
- * Here's what we know:
- *
- * - We know there will always be somewhere between one and three extra
- * descriptors uploaded.
- *
- * - We know the desired received frame will always be at the end of the
- * total data upload.
- *
- * - We know the size of the desired received frame because it will be
- * provided in the length field of the status word in the last descriptor.
- *
- * Here's what we do:
- *
- * - When we allocate buffers for the receive ring, we bzero() them.
- * This means that we know that the buffer contents should be all
- * zeros, except for data uploaded by the chip.
- *
- * - We also force the PNIC chip to upload frames that include the
- * ethernet CRC at the end.
- *
- * - We gather all of the bogus frame data into a single buffer.
- *
- * - We then position a pointer at the end of this buffer and scan
- * backwards until we encounter the first non-zero byte of data.
- * This is the end of the received frame. We know we will encounter
- * some data at the end of the frame because the CRC will always be
- * there, so even if the sender transmits a packet of all zeros,
- * we won't be fooled.
- *
- * - We know the size of the actual received frame, so we subtract
- * that value from the current pointer location. This brings us
- * to the start of the actual received packet.
- *
- * - We copy this into an mbuf and pass it on, along with the actual
- * frame length.
- *
- * The performance hit is tremendous, but it beats dropping frames all
- * the time.
- */
-
-#define PN_WHOLEFRAME (PN_RXSTAT_FIRSTFRAG|PN_RXSTAT_LASTFRAG)
-static void pn_promisc_bug_war(sc, cur_rx)
- struct pn_softc *sc;
- struct pn_chain_onefrag *cur_rx;
-{
- struct pn_chain_onefrag *c;
- unsigned char *ptr;
- int total_len;
- u_int32_t rxstat = 0;
-
- c = sc->pn_promisc_bug_save;
- ptr = sc->pn_promisc_buf;
- bzero(ptr, sizeof(PN_RXLEN * 5));
-
- /* Copy all the bytes from the bogus buffers. */
- while ((c->pn_ptr->pn_status & PN_WHOLEFRAME) != PN_WHOLEFRAME) {
- rxstat = c->pn_ptr->pn_status;
- m_copydata(c->pn_mbuf, 0, PN_RXLEN, ptr);
- ptr += PN_RXLEN - 2; /* round down to 32-bit boundary */
- if (c == cur_rx)
- break;
- if (rxstat & PN_RXSTAT_LASTFRAG)
- break;
- c->pn_ptr->pn_status = PN_RXSTAT;
- c->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
- bzero((char *)mtod(c->pn_mbuf, char *), MCLBYTES);
- c = c->pn_nextdesc;
- }
-
-
- /* Find the length of the actual receive frame. */
- total_len = PN_RXBYTES(rxstat);
-
- /* Scan backwards until we hit a non-zero byte. */
- while(*ptr == 0x00) {
- ptr--;
- }
-
- if ((u_int32_t)(ptr) & 0x3)
- ptr -= 1;
-
- /* Now find the start of the frame. */
- ptr -= total_len;
- if (ptr < sc->pn_promisc_buf)
- ptr = sc->pn_promisc_buf;
-
- /*
- * Now copy the salvaged frame to the last mbuf and fake up
- * the status word to make it look like a successful
- * frame reception.
- */
- m_copyback(cur_rx->pn_mbuf, 0, total_len, ptr);
- cur_rx->pn_mbuf->m_len = c->pn_mbuf->m_pkthdr.len = MCLBYTES;
- cur_rx->pn_ptr->pn_status |= PN_RXSTAT_FIRSTFRAG;
-
- return;
-}
-#endif
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void pn_rxeof(sc)
- struct pn_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct pn_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->pn_cdata.pn_rx_head->pn_ptr->pn_status) &
- PN_RXSTAT_OWN)) {
- cur_rx = sc->pn_cdata.pn_rx_head;
- sc->pn_cdata.pn_rx_head = cur_rx->pn_nextdesc;
-
-#ifdef PN_PROMISC_BUG_WAR
- /*
- * XXX The PNIC seems to have a bug that manifests
- * when the promiscuous mode bit is set: we have to
- * watch for it and work around it.
- */
- if (sc->pn_promisc_war && ifp->if_flags & IFF_PROMISC) {
- if ((rxstat & PN_WHOLEFRAME) != PN_WHOLEFRAME) {
- if (rxstat & PN_RXSTAT_FIRSTFRAG)
- sc->pn_promisc_bug_save = cur_rx;
- if ((rxstat & PN_RXSTAT_LASTFRAG) == 0)
- continue;
- pn_promisc_bug_war(sc, cur_rx);
- rxstat = cur_rx->pn_ptr->pn_status;
- }
- }
-#endif
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & PN_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- if (rxstat & PN_RXSTAT_COLLSEEN)
- ifp->if_collisions++;
- cur_rx->pn_ptr->pn_status = PN_RXSTAT;
- cur_rx->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
- bzero((char *)mtod(cur_rx->pn_mbuf, char *), MCLBYTES);
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->pn_mbuf;
- total_len = PN_RXBYTES(cur_rx->pn_ptr->pn_status);
-
- /* Trim off the CRC. */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (pn_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->pn_ptr->pn_status = PN_RXSTAT;
- cur_rx->pn_ptr->pn_ctl = PN_RXCTL_RLINK | PN_RXLEN;
- bzero((char *)mtod(cur_rx->pn_mbuf, char *), MCLBYTES);
- continue;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void pn_rxeoc(sc)
- struct pn_softc *sc;
-{
-
- pn_rxeof(sc);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_RX_ON);
- CSR_WRITE_4(sc, PN_RXADDR, vtophys(sc->pn_cdata.pn_rx_head->pn_ptr));
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_RX_ON);
- CSR_WRITE_4(sc, PN_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void pn_txeof(sc)
- struct pn_softc *sc;
-{
- struct pn_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->pn_cdata.pn_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->pn_cdata.pn_tx_head->pn_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->pn_cdata.pn_tx_head;
- txstat = PN_TXSTATUS(cur_tx);
-
- if ((txstat & PN_TXSTAT_OWN) || txstat == PN_UNSENT)
- break;
-
- if (txstat & PN_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & PN_TXSTAT_EXCESSCOLL)
- ifp->if_collisions++;
- if (txstat & PN_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & PN_TXSTAT_COLLCNT) >> 3;
-
-
- ifp->if_opackets++;
- m_freem(cur_tx->pn_mbuf);
- cur_tx->pn_mbuf = NULL;
-
- if (sc->pn_cdata.pn_tx_head == sc->pn_cdata.pn_tx_tail) {
- sc->pn_cdata.pn_tx_head = NULL;
- sc->pn_cdata.pn_tx_tail = NULL;
- break;
- }
-
- sc->pn_cdata.pn_tx_head = cur_tx->pn_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void pn_txeoc(sc)
- struct pn_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->pn_cdata.pn_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->pn_cdata.pn_tx_tail = NULL;
- if (sc->pn_want_auto)
- pn_autoneg_mii(sc, PN_FLAG_SCHEDDELAY, 1);
- } else {
- if (PN_TXOWN(sc->pn_cdata.pn_tx_head) == PN_UNSENT) {
- PN_TXOWN(sc->pn_cdata.pn_tx_head) = PN_TXSTAT_OWN;
- ifp->if_timer = 5;
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- }
- }
-
- return;
-}
-
-static void pn_intr(arg)
- void *arg;
-{
- struct pn_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts. */
- if (!(ifp->if_flags & IFF_UP)) {
- pn_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, PN_IMR, 0x00000000);
-
- for (;;) {
- status = CSR_READ_4(sc, PN_ISR);
- if (status)
- CSR_WRITE_4(sc, PN_ISR, status);
-
- if ((status & PN_INTRS) == 0)
- break;
-
- if (status & PN_ISR_RX_OK)
- pn_rxeof(sc);
-
- if ((status & PN_ISR_RX_WATCHDOG) || (status & PN_ISR_RX_IDLE)
- || (status & PN_ISR_RX_NOBUF))
- pn_rxeoc(sc);
-
- if (status & PN_ISR_TX_OK)
- pn_txeof(sc);
-
- if (status & PN_ISR_TX_NOBUF)
- pn_txeoc(sc);
-
- if (status & PN_ISR_TX_IDLE) {
- pn_txeof(sc);
- if (sc->pn_cdata.pn_tx_head != NULL) {
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & PN_ISR_TX_UNDERRUN) {
- ifp->if_oerrors++;
- pn_txeof(sc);
- if (sc->pn_cdata.pn_tx_head != NULL) {
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON);
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & PN_ISR_BUS_ERR) {
- pn_reset(sc);
- pn_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, PN_IMR, PN_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- pn_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int pn_encap(sc, c, m_head)
- struct pn_softc *sc;
- struct pn_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- struct pn_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == PN_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->pn_ptr->pn_frag[frag];
- f->pn_ctl = PN_TXCTL_TLINK | m->m_len;
- if (frag == 0) {
- f->pn_ctl |= PN_TXCTL_FIRSTFRAG;
- f->pn_status = 0;
- } else
- f->pn_status = PN_TXSTAT_OWN;
- f->pn_data = vtophys(mtod(m, vm_offset_t));
- f->pn_next = vtophys(&c->pn_ptr->pn_frag[frag + 1]);
- frag++;
- }
- }
-
- /*
- * Handle special case: we used up all 16 fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("pn%d: no memory for tx list", sc->pn_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("pn%d: no memory for tx list",
- sc->pn_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->pn_ptr->pn_frag[0];
- f->pn_data = vtophys(mtod(m_new, caddr_t));
- f->pn_ctl = total_len = m_new->m_len;
- f->pn_ctl |= PN_TXCTL_TLINK|PN_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
-
- c->pn_mbuf = m_head;
- c->pn_lastdesc = frag - 1;
- PN_TXCTL(c) |= PN_TXCTL_LASTFRAG;
- PN_TXNEXT(c) = vtophys(&c->pn_nextdesc->pn_ptr->pn_frag[0]);
-
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void pn_start(ifp)
- struct ifnet *ifp;
-{
- struct pn_softc *sc;
- struct mbuf *m_head = NULL;
- struct pn_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->pn_autoneg) {
- sc->pn_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->pn_cdata.pn_tx_free->pn_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->pn_cdata.pn_tx_free;
-
- while(sc->pn_cdata.pn_tx_free->pn_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->pn_cdata.pn_tx_free;
- sc->pn_cdata.pn_tx_free = cur_tx->pn_nextdesc;
-
- /* Pack the data into the descriptor. */
- pn_encap(sc, cur_tx, m_head);
-
- if (cur_tx != start_tx)
- PN_TXOWN(cur_tx) = PN_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->pn_mbuf);
-#endif
- }
-
- /*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
- * Place the request for the upload interrupt
- * in the last descriptor in the chain. This way, if
- * we're chaining several packets at once, we'll only
- * get an interupt once for the whole chain rather than
- * once for each packet.
- */
- PN_TXCTL(cur_tx) |= PN_TXCTL_FINT;
- sc->pn_cdata.pn_tx_tail = cur_tx;
-
- if (sc->pn_cdata.pn_tx_head == NULL) {
- sc->pn_cdata.pn_tx_head = start_tx;
- PN_TXOWN(start_tx) = PN_TXSTAT_OWN;
- CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
- } else {
- PN_TXOWN(start_tx) = PN_UNSENT;
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void pn_init(xsc)
- void *xsc;
-{
- struct pn_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->pn_autoneg)
- return;
-
- s = splimp();
-
- if (sc->pn_pinfo != NULL)
- phy_bmcr = pn_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- pn_stop(sc);
- pn_reset(sc);
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, PN_BUSCTL, PN_BUSCTL_CONFIG);
-
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_IMMEDIATE);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_NO_RXCRC);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_HEARTBEAT);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_STORENFWD);
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_BACKOFF);
-
- PN_CLRBIT(sc, PN_NETCFG, PN_NETCFG_TX_THRESH);
- PN_SETBIT(sc, PN_NETCFG, PN_TXTHRESH_72BYTES);
-
- pn_setcfg(sc, pn_phy_readreg(sc, PHY_BMCR));
-
- if (sc->pn_pinfo != NULL) {
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_MIIENB);
- PN_SETBIT(sc, PN_ENDEC, PN_ENDEC_JABBERDIS);
- }
-
- /* Init circular RX list. */
- if (pn_list_rx_init(sc) == ENOBUFS) {
- printf("pn%d: initialization failed: no "
- "memory for rx buffers\n", sc->pn_unit);
- pn_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- pn_list_tx_init(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, PN_RXADDR, vtophys(sc->pn_cdata.pn_rx_head->pn_ptr));
-
- /*
- * Load the RX/multicast filter.
- */
- pn_setfilt(sc);
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, PN_IMR, PN_INTRS);
- CSR_WRITE_4(sc, PN_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- PN_SETBIT(sc, PN_NETCFG, PN_NETCFG_TX_ON|PN_NETCFG_RX_ON);
- CSR_WRITE_4(sc, PN_RXSTART, 0xFFFFFFFF);
-
- /* Restore state of BMCR */
- if (sc->pn_pinfo != NULL)
- pn_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int pn_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct pn_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- pn_autoneg_mii(sc, PN_FLAG_SCHEDDELAY, 1);
- else
- pn_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void pn_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct pn_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (!(pn_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (pn_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (pn_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = pn_phy_readreg(sc, PHY_LPAR);
- advert = pn_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int pn_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct pn_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- pn_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- pn_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- pn_init(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void pn_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct pn_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->pn_autoneg) {
- pn_autoneg_mii(sc, PN_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("pn%d: watchdog timeout\n", sc->pn_unit);
-
- if (!(pn_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("pn%d: no carrier - transceiver cable problem?\n",
- sc->pn_unit);
- pn_stop(sc);
- pn_reset(sc);
- pn_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- pn_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void pn_stop(sc)
- struct pn_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- PN_CLRBIT(sc, PN_NETCFG, (PN_NETCFG_RX_ON|PN_NETCFG_TX_ON));
- CSR_WRITE_4(sc, PN_IMR, 0x00000000);
- CSR_WRITE_4(sc, PN_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, PN_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < PN_RX_LIST_CNT; i++) {
- if (sc->pn_cdata.pn_rx_chain[i].pn_mbuf != NULL) {
- m_freem(sc->pn_cdata.pn_rx_chain[i].pn_mbuf);
- sc->pn_cdata.pn_rx_chain[i].pn_mbuf = NULL;
- }
- }
- bzero((char *)&sc->pn_ldata->pn_rx_list,
- sizeof(sc->pn_ldata->pn_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < PN_TX_LIST_CNT; i++) {
- if (sc->pn_cdata.pn_tx_chain[i].pn_mbuf != NULL) {
- m_freem(sc->pn_cdata.pn_tx_chain[i].pn_mbuf);
- sc->pn_cdata.pn_tx_chain[i].pn_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->pn_ldata->pn_tx_list,
- sizeof(sc->pn_ldata->pn_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void pn_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct pn_softc *sc = (struct pn_softc *)arg;
-
- pn_stop(sc);
-
- return;
-}
-
-static struct pci_device pn_device = {
- "pn",
- pn_probe,
- pn_attach,
- &pn_count,
- NULL
-};
-DATA_SET(pcidevice_set, pn_device);
diff --git a/sys/pci/if_pnreg.h b/sys/pci/if_pnreg.h
deleted file mode 100644
index e3644097985d6..0000000000000
--- a/sys/pci/if_pnreg.h
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_pnreg.h,v 1.16 1999/01/05 00:47:25 wpaul Exp $
- */
-
-/*
- * PNIC register definitions.
- */
-
-#define PN_BUSCTL 0x00 /* bus control */
-#define PN_TXSTART 0x08 /* tx start demand */
-#define PN_RXSTART 0x10 /* rx start demand */
-#define PN_RXADDR 0x18 /* rx descriptor list start addr */
-#define PN_TXADDR 0x20 /* tx descriptor list start addr */
-#define PN_ISR 0x28 /* interrupt status register */
-#define PN_NETCFG 0x30 /* network config register */
-#define PN_IMR 0x38 /* interrupt mask */
-#define PN_FRAMESDISCARDED 0x40 /* # of discarded frames */
-#define PN_SIO 0x48 /* MII and ROM/EEPROM access */
-#define PN_GEN 0x60 /* general purpose register */
-#define PN_ENDEC 0x78 /* ENDEC general register */
-#define PN_SIOPWR 0x90 /* serial eeprom power up */
-#define PN_SIOCTL 0x98 /* EEPROM control register */
-#define PN_MII 0xA0 /* MII access register */
-#define PN_NWAY 0xB8 /* Internal NWAY register */
-
-
-/*
- * Bus control bits.
- */
-#define PN_BUSCTL_RESET 0x00000001
-#define PN_BUSCTL_ARBITRATION 0x00000002
-#define PN_BUSCTL_SKIPLEN 0x0000007C
-#define PN_BUSCTL_BUF_BIGENDIAN 0x00000080
-#define PN_BUSCTL_BURSTLEN 0x00003F00
-#define PN_BUSCTL_CACHEALIGN 0x0000C000
-#define PN_BUSCTL_TXPOLL 0x000E0000
-
-#define PN_SKIPLEN_1LONG 0x00000004
-#define PN_SKIPLEN_2LONG 0x00000008
-#define PN_SKIPLEN_3LONG 0x00000010
-#define PN_SKIPLEN_4LONG 0x00000020
-#define PN_SKIPLEN_5LONG 0x00000040
-
-#define PN_CACHEALIGN_8LONG 0x00004000
-#define PN_CACHEALIGN_16LONG 0x00008000
-#define PN_CACHEALIGN_32LONG 0x0000C000
-
-#define PN_BURSTLEN_USECA 0x00000000
-#define PN_BURSTLEN_1LONG 0x00000100
-#define PN_BURSTLEN_2LONG 0x00000200
-#define PN_BURSTLEN_4LONG 0x00000400
-#define PN_BURSTLEN_8LONG 0x00000800
-#define PN_BURSTLEN_16LONG 0x00001000
-#define PN_BURSTLEN_32LONG 0x00002000
-
-#define PN_TXPOLL_OFF 0x00000000
-#define PN_TXPOLL_200U 0x00020000
-#define PN_TXPOLL_800U 0x00040000
-#define PN_TXPOLL_1600U 0x00060000
-#define PN_TXPOLL_12_8M 0x00080000
-#define PN_TXPOLL_25_6M 0x000A0000
-#define PN_TXPOLL_51_2M 0x000C0000
-#define PN_TXPOLL_102_4M 0x000E0000
-
-#define PN_BUSCTL_CONFIG \
- (PN_CACHEALIGN_8LONG|PN_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define PN_ISR_TX_OK 0x00000001 /* packet tx ok */
-#define PN_ISR_TX_IDLE 0x00000002 /* tx stopped */
-#define PN_ISR_TX_NOBUF 0x00000004 /* no tx buffer available */
-#define PN_ISR_TX_JABTIMEO 0x00000008 /* jabber timeout */
-#define PN_ISR_LINKPASS 0x00000010 /* link test pass */
-#define PN_ISR_TX_UNDERRUN 0x00000020 /* transmit underrun */
-#define PN_ISR_RX_OK 0x00000040 /* packet rx ok */
-#define PN_ISR_RX_NOBUF 0x00000080 /* rx buffer unavailable */
-#define PN_ISR_RX_IDLE 0x00000100 /* rx stopped */
-#define PN_ISR_RX_WATCHDOG 0x00000200 /* rx watchdog timeo */
-#define PN_ISR_TX_EARLY 0x00000400 /* rx watchdog timeo */
-#define PN_ISR_BUS_ERR 0x00002000
-#define PN_ISR_ABNORMAL 0x00008000
-#define PN_ISR_NORMAL 0x00010000
-#define PN_ISR_RX_STATE 0x000E0000
-#define PN_ISR_TX_STATE 0x00700000
-#define PN_ISR_BUSERRTYPE 0x03800000
-#define PN_ISR_TXABORT 0x04000000 /* tx abort */
-
-#define PN_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define PN_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define PN_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define PN_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define PN_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define PN_RXSTATE_CLOSE 0x000A0000 /* 101 - close rx desc */
-#define PN_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define PN_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define PN_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define PN_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define PN_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define PN_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define PN_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define PN_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define PN_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define PN_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-#define PN_BUSERR_PARITY 0x00000000
-#define PN_BUSERR_MASTABRT 0x00800000
-#define PN_BUSERR_TGTABRT 0x01000000
-#define PN_BUSERR_RSVD1 0x01800000
-#define PN_BUSERR_RSVD2 0x02000000
-
-/*
- * Network config bits.
- */
-#define PN_NETCFG_HASHPERF 0x00000001 /* 0 == perf, 1 == hash */
-#define PN_NETCFG_RX_ON 0x00000002
-#define PN_NETCFG_HASHONLY 0x00000004 /* 1 == allhash */
-#define PN_NETCFG_RX_PASSERR 0x00000008
-#define PN_NETCFG_INVERSFILT 0x00000010
-#define PN_NETCFG_BACKOFF 0x00000020
-#define PN_NETCFG_RX_PROMISC 0x00000040
-#define PN_NETCFG_RX_ALLMULTI 0x00000080
-#define PN_NETCFG_FLAKYOSC 0x00000100
-#define PN_NETCFG_FULLDUPLEX 0x00000200
-#define PN_NETCFG_OPERMODE 0x00000C00
-#define PN_NETCFG_FORCECOLL 0x00001000
-#define PN_NETCFG_TX_ON 0x00002000
-#define PN_NETCFG_TX_THRESH 0x0000C000
-#define PN_NETCFG_TX_BACKOFF 0x00020000
-#define PN_NETCFG_MIIENB 0x00040000 /* 1 == MII, 0 == internal */
-#define PN_NETCFG_HEARTBEAT 0x00080000 /* 1 == disabled */
-#define PN_NETCFG_TX_IMMEDIATE 0x00100000
-#define PN_NETCFG_STORENFWD 0x00200000
-#define PN_NETCFG_SPEEDSEL 0x00400000 /* 1 == 10Mbps 0 == 100Mbps */
-#define PN_NETCFG_PCS 0x00800000 /* 1 == 100baseTX */
-#define PN_NETCFG_NO_RXCRC 0x20000000
-#define PN_NETCFG_EXT_ENDEC 0x40000000 /* 1 == ext, 0 == int PHY */
-
-#define PN_OPMODE_NORM 0x00000000
-#define PN_OPMODE_INTLOOP 0x00000400
-#define PN_OPMODE_EXTLOOP 0x00000800
-
-#define PN_TXTHRESH_72BYTES 0x00000000
-#define PN_TXTHRESH_96BYTES 0x00004000
-#define PN_TXTHRESH_128BYTES 0x00008000
-#define PN_TXTHRESH_160BYTES 0x0000C000
-
-/*
- * Interrupt mask bits.
- */
-#define PN_IMR_TX_OK 0x00000001 /* packet tx ok */
-#define PN_IMR_TX_IDLE 0x00000002 /* tx stopped */
-#define PN_IMR_TX_NOBUF 0x00000004 /* no tx buffer available */
-#define PN_IMR_TX_JABTIMEO 0x00000008 /* jabber timeout */
-#define PN_IMR_LINKPASS 0x00000010 /* link test pass */
-#define PN_IMR_TX_UNDERRUN 0x00000020 /* transmit underrun */
-#define PN_IMR_RX_OK 0x00000040 /* packet rx ok */
-#define PN_IMR_RX_NOBUF 0x00000080 /* rx buffer unavailable */
-#define PN_IMR_RX_IDLE 0x00000100 /* rx stopped */
-#define PN_IMR_RX_WATCHDOG 0x00000200 /* rx watchdog timeo */
-#define PN_IMR_TX_EARLY 0x00000400 /* rx watchdog timeo */
-#define PN_IMR_BUS_ERR 0x00002000
-#define PN_IMR_ABNORMAL 0x00008000
-#define PN_IMR_NORMAL 0x00010000
-#define PN_ISR_TXABORT 0x04000000 /* tx abort */
-
-#define PN_INTRS \
- (PN_IMR_RX_OK|PN_IMR_TX_OK|PN_IMR_RX_NOBUF| \
- PN_IMR_TX_NOBUF|PN_IMR_TX_UNDERRUN|PN_IMR_BUS_ERR| \
- PN_IMR_ABNORMAL|PN_IMR_NORMAL)
-
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define PN_SIO_DATA 0x0000003F
-#define PN_SIO_OPCODE 0x00000300
-#define PN_SIO_BUSY 0x80000000
-
-/*
- * SIOCTL/EEPROM bits
- */
-#define PN_EE_READ 0x600
-
-/*
- * General purpose register bits.
- */
-#define PN_GEN_CTL 0x000000F0
-#define PN_GEN_100TX_LINK 0x00000008
-#define PN_GEN_BNC_ENB 0x00000004
-#define PN_GEN_100TX_LOOP 0x00000002 /* 1 == normal, 0 == loop */
-#define PN_GEN_SPEEDSEL 0x00000001 /* 1 == 100Mbps, 0 == 10Mbps */
-#define PN_GEN_MUSTBEONE 0x00000030
-
-/*
- * General ENDEC bits.
- */
-#define PN_ENDEC_JABBERDIS 0x000000001 /* 1 == disable, 0 == enable */
-
-/*
- * MII bits.
- */
-#define PN_MII_DATA 0x0000FFFF
-#define PN_MII_REGADDR 0x007C0000
-#define PN_MII_PHYADDR 0x0F800000
-#define PN_MII_OPCODE 0x30000000
-#define PN_MII_RESERVED 0x00020000
-#define PN_MII_BUSY 0x80000000
-
-#define PN_MII_READ 0x60020000 /* read PHY command */
-#define PN_MII_WRITE 0x50020000 /* write PHY command */
-
-/*
- * Internal PHY NWAY register bits.
- */
-#define PN_NWAY_RESET 0x00000001 /* reset */
-#define PN_NWAY_PDOWN 0x00000002 /* power down */
-#define PN_NWAY_BYPASS 0x00000004 /* bypass */
-#define PN_NWAY_AUILOWCUR 0x00000008 /* AUI low current */
-#define PN_NWAY_TPEXTEND 0x00000010 /* low squelch voltage */
-#define PN_NWAY_POLARITY 0x00000020 /* 0 == on, 1 == off */
-#define PN_NWAY_TP 0x00000040 /* 1 == tp, 0 == AUI */
-#define PN_NWAY_AUIVOLT 0x00000080 /* 1 == full, 0 == half */
-#define PN_NWAY_DUPLEX 0x00000100 /* 1 == full, 0 == half */
-#define PN_NWAY_LINKTEST 0x00000200 /* 1 == on, 0 == off */
-#define PN_NWAY_AUTODETECT 0x00000400 /* 1 == off, 0 == on */
-#define PN_NWAY_SPEEDSEL 0x00000800 /* 0 == 10, 1 == 100 */
-#define PN_NWAY_NWAY_ENB 0x00001000 /* 0 == off, 1 == on */
-#define PN_NWAY_CAP10HALF 0x00002000
-#define PN_NWAY_CAP10FULL 0x00004000
-#define PN_NWAY_CAP100FULL 0x00008000
-#define PN_NWAY_CAP100HALF 0x00010000
-#define PN_NWAY_CAP100T4 0x00020000
-#define PN_NWAY_AUTONEGRSTR 0x02000000
-#define PN_NWAY_REMFAULT 0x04000000
-#define PN_NWAY_LPAR10HALF 0x08000000
-#define PN_NWAY_LPAR10FULL 0x10000000
-#define PN_NWAY_LPAR100FULL 0x20000000
-#define PN_NWAY_LPAR100HALF 0x40000000
-#define PN_NWAY_LPAR100T4 0x80000000
-
-/*
- * Size of a setup frame.
- */
-#define PN_SFRAME_LEN 192
-
-/*
- * PNIC TX/RX list structure.
- */
-
-struct pn_desc {
- u_int32_t pn_status;
- u_int32_t pn_ctl;
- u_int32_t pn_ptr1;
- u_int32_t pn_ptr2;
-};
-
-#define pn_data pn_ptr1
-#define pn_next pn_ptr2
-
-
-#define RX_RXSTAT_FIFOOFLOW 0x00000001
-#define PN_RXSTAT_CRCERR 0x00000002
-#define PN_RXSTAT_DRIBBLE 0x00000004
-#define PN_RXSTAT_WATCHDOG 0x00000010
-#define PN_RXSTAT_FRAMETYPE 0x00000020 /* 0 == IEEE 802.3 */
-#define PN_RXSTAT_COLLSEEN 0x00000040
-#define PN_RXSTAT_GIANT 0x00000080
-#define PN_RXSTAT_LASTFRAG 0x00000100
-#define PN_RXSTAT_FIRSTFRAG 0x00000200
-#define PN_RXSTAT_MULTICAST 0x00000400
-#define PN_RXSTAT_RUNT 0x00000800
-#define PN_RXSTAT_RXTYPE 0x00003000
-#define PN_RXSTAT_RXERR 0x00008000
-#define PN_RXSTAT_RXLEN 0x7FFF0000
-#define PN_RXSTAT_OWN 0x80000000
-
-#define PN_RXBYTES(x) ((x & PN_RXSTAT_RXLEN) >> 16)
-#define PN_RXSTAT (PN_RXSTAT_FIRSTFRAG|PN_RXSTAT_LASTFRAG|PN_RXSTAT_OWN)
-
-#define PN_RXCTL_BUFLEN1 0x00000FFF
-#define PN_RXCTL_BUFLEN2 0x00FFF000
-#define PN_RXCTL_RLINK 0x01000000
-#define PN_RXCTL_RLAST 0x02000000
-
-#define PN_TXSTAT_DEFER 0x00000001
-#define PN_TXSTAT_UNDERRUN 0x00000002
-#define PN_TXSTAT_LINKFAIL 0x00000003
-#define PN_TXSTAT_COLLCNT 0x00000078
-#define PN_TXSTAT_SQE 0x00000080
-#define PN_TXSTAT_EXCESSCOLL 0x00000100
-#define PN_TXSTAT_LATECOLL 0x00000200
-#define PN_TXSTAT_NOCARRIER 0x00000400
-#define PN_TXSTAT_CARRLOST 0x00000800
-#define PN_TXSTAT_JABTIMEO 0x00004000
-#define PN_TXSTAT_ERRSUM 0x00008000
-#define PN_TXSTAT_OWN 0x80000000
-
-#define PN_TXCTL_BUFLEN1 0x000007FF
-#define PN_TXCTL_BUFLEN2 0x003FF800
-#define PN_TXCTL_FILTTYPE0 0x00400000
-#define PN_TXCTL_PAD 0x00800000
-#define PN_TXCTL_TLINK 0x01000000
-#define PN_TXCTL_TLAST 0x02000000
-#define PN_TXCTL_NOCRC 0x04000000
-#define PN_TXCTL_SETUP 0x08000000
-#define PN_TXCTL_FILTTYPE1 0x10000000
-#define PN_TXCTL_FIRSTFRAG 0x20000000
-#define PN_TXCTL_LASTFRAG 0x40000000
-#define PN_TXCTL_FINT 0x80000000
-
-#define PN_FILTER_PERFECT 0x00000000
-#define PN_FILTER_HASHPERF 0x00400000
-#define PN_FILTER_INVERSE 0x10000000
-#define PN_FILTER_HASHONLY 0x10400000
-
-#define PN_MAXFRAGS 16
-#define PN_RX_LIST_CNT 64
-#define PN_TX_LIST_CNT 64
-#define PN_MIN_FRAMELEN 60
-#define PN_FRAMELEN 1536
-#define PN_RXLEN 1518
-
-/*
- * A tx 'super descriptor' is actually 16 regular descriptors
- * back to back.
- */
-struct pn_txdesc {
- struct pn_desc pn_frag[PN_MAXFRAGS];
-};
-
-#define PN_TXNEXT(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_next
-#define PN_TXSTATUS(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_status
-#define PN_TXCTL(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_ctl
-#define PN_TXDATA(x) x->pn_ptr->pn_frag[x->pn_lastdesc].pn_data
-
-#define PN_TXOWN(x) x->pn_ptr->pn_frag[0].pn_status
-
-#define PN_UNSENT 0x12344321
-
-struct pn_list_data {
- struct pn_desc pn_rx_list[PN_RX_LIST_CNT];
- struct pn_txdesc pn_tx_list[PN_TX_LIST_CNT];
-};
-
-struct pn_chain {
- struct pn_txdesc *pn_ptr;
- struct mbuf *pn_mbuf;
- struct pn_chain *pn_nextdesc;
- u_int8_t pn_lastdesc;
-};
-
-struct pn_chain_onefrag {
- struct pn_desc *pn_ptr;
- struct mbuf *pn_mbuf;
- struct pn_chain_onefrag *pn_nextdesc;
-};
-
-struct pn_chain_data {
- struct pn_desc pn_sframe;
- u_int32_t pn_sbuf[PN_SFRAME_LEN/sizeof(u_int32_t)];
- struct pn_chain_onefrag pn_rx_chain[PN_RX_LIST_CNT];
- struct pn_chain pn_tx_chain[PN_TX_LIST_CNT];
-
- struct pn_chain_onefrag *pn_rx_head;
-
- struct pn_chain *pn_tx_head;
- struct pn_chain *pn_tx_tail;
- struct pn_chain *pn_tx_free;
-};
-
-struct pn_type {
- u_int16_t pn_vid;
- u_int16_t pn_did;
- char *pn_name;
-};
-
-struct pn_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define PN_MII_STARTDELIM 0x01
-#define PN_MII_READOP 0x02
-#define PN_MII_WRITEOP 0x01
-#define PN_MII_TURNAROUND 0x02
-
-#define PN_FLAG_FORCEDELAY 1
-#define PN_FLAG_SCHEDDELAY 2
-#define PN_FLAG_DELAYTIMEO 3
-
-struct pn_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t pn_bhandle; /* bus space handle */
- bus_space_tag_t pn_btag; /* bus space tag */
- struct pn_type *pn_info; /* PNIC adapter info */
- struct pn_type *pn_pinfo; /* phy info */
- u_int8_t pn_unit; /* interface number */
- u_int8_t pn_type;
- u_int8_t pn_phy_addr; /* PHY address */
- u_int8_t pn_tx_pend; /* TX pending */
- u_int8_t pn_want_auto;
- u_int8_t pn_autoneg;
- caddr_t pn_ldata_ptr;
-#ifdef PN_PROMISC_BUG_WAR
-#define PN_169_REV 32
-#define PN_169B_REV 33
- u_int8_t pn_promisc_war;
- struct pn_chain_onefrag *pn_promisc_bug_save;
- unsigned char *pn_promisc_buf;
-#endif
- struct pn_list_data *pn_ldata;
- struct pn_chain_data pn_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->pn_btag, sc->pn_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->pn_btag, sc->pn_bbhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->pn_btag, sc->pn_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->pn_btag, sc->pn_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->pn_btag, sc->pn_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->pn_btag, sc->pn_bhandle, reg)
-
-#define PN_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * Lite-On PNIC PCI vendor ID
- */
-#define PN_VENDORID 0x11AD
-
-/*
- * Lite-On PNIC PCI device ID.
- */
-#define PN_DEVICEID_PNIC 0x0002
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define PN_PCI_VENDOR_ID 0x00
-#define PN_PCI_DEVICE_ID 0x02
-#define PN_PCI_COMMAND 0x04
-#define PN_PCI_STATUS 0x06
-#define PN_PCI_REVISION 0x08
-#define PN_PCI_CLASSCODE 0x09
-#define PN_PCI_LATENCY_TIMER 0x0D
-#define PN_PCI_HEADER_TYPE 0x0E
-#define PN_PCI_LOIO 0x10
-#define PN_PCI_LOMEM 0x14
-#define PN_PCI_BIOSROM 0x30
-#define PN_PCI_INTLINE 0x3C
-#define PN_PCI_INTPIN 0x3D
-#define PN_PCI_MINGNT 0x3E
-#define PN_PCI_MINLAT 0x0F
-#define PN_PCI_RESETOPT 0x48
-#define PN_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define PN_PCI_CAPID 0xDC /* 8 bits */
-#define PN_PCI_NEXTPTR 0xDD /* 8 bits */
-#define PN_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define PN_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define PN_PSTATE_MASK 0x0003
-#define PN_PSTATE_D0 0x0000
-#define PN_PSTATE_D1 0x0002
-#define PN_PSTATE_D2 0x0002
-#define PN_PSTATE_D3 0x0003
-#define PN_PME_EN 0x0010
-#define PN_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define PN_PHYADDR_MIN 0x00
-#define PN_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
deleted file mode 100644
index 09a4a99b536b5..0000000000000
--- a/sys/pci/if_rl.c
+++ /dev/null
@@ -1,1992 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_rl.c,v 1.20 1999/01/16 20:46:24 wpaul Exp $
- */
-
-/*
- * RealTek 8129/8139 PCI NIC driver
- *
- * Supports several extremely cheap PCI 10/100 adapters based on
- * the RealTek chipset. Datasheets can be obtained from
- * www.realtek.com.tw.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The RealTek 8139 PCI NIC redefines the meaning of 'low end.' This is
- * probably the worst PCI ethernet controller ever made, with the possible
- * exception of the FEAST chip made by SMC. The 8139 supports bus-master
- * DMA, but it has a terrible interface that nullifies any performance
- * gains that bus-master DMA usually offers.
- *
- * For transmission, the chip offers a series of four TX descriptor
- * registers. Each transmit frame must be in a contiguous buffer, aligned
- * on a longword (32-bit) boundary. This means we almost always have to
- * do mbuf copies in order to transmit a frame, except in the unlikely
- * case where a) the packet fits into a single mbuf, and b) the packet
- * is 32-bit aligned within the mbuf's data area. The presence of only
- * four descriptor registers means that we can never have more than four
- * packets queued for transmission at any one time.
- *
- * Reception is not much better. The driver has to allocate a single large
- * buffer area (up to 64K in size) into which the chip will DMA received
- * frames. Because we don't know where within this region received packets
- * will begin or end, we have no choice but to copy data from the buffer
- * area into mbufs in order to pass the packets up to the higher protocol
- * levels.
- *
- * It's impossible given this rotten design to really achieve decent
- * performance at 100Mbps, unless you happen to have a 400Mhz PII or
- * some equally overmuscled CPU to drive it.
- *
- * On the bright side, the 8139 does have a built-in PHY, although
- * rather than using an MDIO serial interface like most other NICs, the
- * PHY registers are directly accessible through the 8139's register
- * space. The 8139 supports autonegotiation, as well as a 64-bit multicast
- * filter.
- *
- * The 8129 chip is an older version of the 8139 that uses an external PHY
- * chip. The 8129 has a serial MDIO interface for accessing the MII where
- * the 8139 lets you directly access the on-board PHY registers. We need
- * to select which interface to use depending on the chip type.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-/*
- * Default to using PIO access for this driver. On SMP systems,
- * there appear to be problems with memory mapped mode: it looks like
- * doing too many memory mapped access back to back in rapid succession
- * can hang the bus. I'm inclined to blame this on crummy design/construction
- * on the part of RealTek. Memory mapped mode does appear to work on
- * uniprocessor systems though.
- */
-#define RL_USEIOSPACE
-
-#include <pci/if_rlreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_rl.c,v 1.20 1999/01/16 20:46:24 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct rl_type rl_devs[] = {
- { RT_VENDORID, RT_DEVICEID_8129,
- "RealTek 8129 10/100BaseTX" },
- { RT_VENDORID, RT_DEVICEID_8139,
- "RealTek 8139 10/100BaseTX" },
- { ACCTON_VENDORID, ACCTON_DEVICEID_5030,
- "Accton MPX 5030/5038 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct rl_type rl_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long rl_count = 0;
-static const char *rl_probe __P((pcici_t, pcidi_t));
-static void rl_attach __P((pcici_t, int));
-
-static int rl_encap __P((struct rl_softc *, struct rl_chain *,
- struct mbuf * ));
-
-static void rl_rxeof __P((struct rl_softc *));
-static void rl_txeof __P((struct rl_softc *));
-static void rl_txeoc __P((struct rl_softc *));
-static void rl_intr __P((void *));
-static void rl_start __P((struct ifnet *));
-static int rl_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void rl_init __P((void *));
-static void rl_stop __P((struct rl_softc *));
-static void rl_watchdog __P((struct ifnet *));
-static void rl_shutdown __P((int, void *));
-static int rl_ifmedia_upd __P((struct ifnet *));
-static void rl_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void rl_eeprom_putbyte __P((struct rl_softc *, int));
-static void rl_eeprom_getword __P((struct rl_softc *, int, u_int16_t *));
-static void rl_read_eeprom __P((struct rl_softc *, caddr_t,
- int, int, int));
-static void rl_mii_sync __P((struct rl_softc *));
-static void rl_mii_send __P((struct rl_softc *, u_int32_t, int));
-static int rl_mii_readreg __P((struct rl_softc *, struct rl_mii_frame *));
-static int rl_mii_writereg __P((struct rl_softc *, struct rl_mii_frame *));
-
-static u_int16_t rl_phy_readreg __P((struct rl_softc *, int));
-static void rl_phy_writereg __P((struct rl_softc *, int, int));
-
-static void rl_autoneg_xmit __P((struct rl_softc *));
-static void rl_autoneg_mii __P((struct rl_softc *, int, int));
-static void rl_setmode_mii __P((struct rl_softc *, int));
-static void rl_getmode_mii __P((struct rl_softc *));
-static u_int8_t rl_calchash __P((caddr_t));
-static void rl_setmulti __P((struct rl_softc *));
-static void rl_reset __P((struct rl_softc *));
-static int rl_list_tx_init __P((struct rl_softc *));
-
-#define EE_SET(x) \
- CSR_WRITE_1(sc, RL_EECMD, \
- CSR_READ_1(sc, RL_EECMD) | x)
-
-#define EE_CLR(x) \
- CSR_WRITE_1(sc, RL_EECMD, \
- CSR_READ_1(sc, RL_EECMD) & ~x)
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void rl_eeprom_putbyte(sc, addr)
- struct rl_softc *sc;
- int addr;
-{
- register int d, i;
-
- d = addr | RL_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- EE_SET(RL_EE_DATAIN);
- } else {
- EE_CLR(RL_EE_DATAIN);
- }
- DELAY(100);
- EE_SET(RL_EE_CLK);
- DELAY(150);
- EE_CLR(RL_EE_CLK);
- DELAY(100);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void rl_eeprom_getword(sc, addr, dest)
- struct rl_softc *sc;
- int addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_PROGRAM|RL_EE_SEL);
-
- /*
- * Send address of word we want to read.
- */
- rl_eeprom_putbyte(sc, addr);
-
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_PROGRAM|RL_EE_SEL);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- EE_SET(RL_EE_CLK);
- DELAY(100);
- if (CSR_READ_1(sc, RL_EECMD) & RL_EE_DATAOUT)
- word |= i;
- EE_CLR(RL_EE_CLK);
- DELAY(100);
- }
-
- /* Turn off EEPROM access mode. */
- CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void rl_read_eeprom(sc, dest, off, cnt, swap)
- struct rl_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- rl_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-
-/*
- * MII access routines are provided for the 8129, which
- * doesn't have a built-in PHY. For the 8139, we fake things
- * up by diverting rl_phy_readreg()/rl_phy_writereg() to the
- * direct access PHY registers.
- */
-#define MII_SET(x) \
- CSR_WRITE_1(sc, RL_MII, \
- CSR_READ_1(sc, RL_MII) | x)
-
-#define MII_CLR(x) \
- CSR_WRITE_1(sc, RL_MII, \
- CSR_READ_1(sc, RL_MII) & ~x)
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void rl_mii_sync(sc)
- struct rl_softc *sc;
-{
- register int i;
-
- MII_SET(RL_MII_DIR|RL_MII_DATAOUT);
-
- for (i = 0; i < 32; i++) {
- MII_SET(RL_MII_CLK);
- DELAY(1);
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- }
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void rl_mii_send(sc, bits, cnt)
- struct rl_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- MII_CLR(RL_MII_CLK);
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
- if (bits & i) {
- MII_SET(RL_MII_DATAOUT);
- } else {
- MII_CLR(RL_MII_DATAOUT);
- }
- DELAY(1);
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- }
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int rl_mii_readreg(sc, frame)
- struct rl_softc *sc;
- struct rl_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = RL_MII_STARTDELIM;
- frame->mii_opcode = RL_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- CSR_WRITE_2(sc, RL_MII, 0);
-
- /*
- * Turn on data xmit.
- */
- MII_SET(RL_MII_DIR);
-
- rl_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- rl_mii_send(sc, frame->mii_stdelim, 2);
- rl_mii_send(sc, frame->mii_opcode, 2);
- rl_mii_send(sc, frame->mii_phyaddr, 5);
- rl_mii_send(sc, frame->mii_regaddr, 5);
-
- /* Idle bit */
- MII_CLR((RL_MII_CLK|RL_MII_DATAOUT));
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
-
- /* Turn off xmit. */
- MII_CLR(RL_MII_DIR);
-
- /* Check for ack */
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
- ack = CSR_READ_2(sc, RL_MII) & RL_MII_DATAIN;
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- if (!ack) {
- if (CSR_READ_2(sc, RL_MII) & RL_MII_DATAIN)
- frame->mii_data |= i;
- DELAY(1);
- }
- MII_SET(RL_MII_CLK);
- DELAY(1);
- }
-
-fail:
-
- MII_CLR(RL_MII_CLK);
- DELAY(1);
- MII_SET(RL_MII_CLK);
- DELAY(1);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int rl_mii_writereg(sc, frame)
- struct rl_softc *sc;
- struct rl_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = RL_MII_STARTDELIM;
- frame->mii_opcode = RL_MII_WRITEOP;
- frame->mii_turnaround = RL_MII_TURNAROUND;
-
- /*
- * Turn on data output.
- */
- MII_SET(RL_MII_DIR);
-
- rl_mii_sync(sc);
-
- rl_mii_send(sc, frame->mii_stdelim, 2);
- rl_mii_send(sc, frame->mii_opcode, 2);
- rl_mii_send(sc, frame->mii_phyaddr, 5);
- rl_mii_send(sc, frame->mii_regaddr, 5);
- rl_mii_send(sc, frame->mii_turnaround, 2);
- rl_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- MII_SET(RL_MII_CLK);
- DELAY(1);
- MII_CLR(RL_MII_CLK);
- DELAY(1);
-
- /*
- * Turn off xmit.
- */
- MII_CLR(RL_MII_DIR);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t rl_phy_readreg(sc, reg)
- struct rl_softc *sc;
- int reg;
-{
- struct rl_mii_frame frame;
- u_int16_t rval = 0;
- u_int16_t rl8139_reg = 0;
-
- if (sc->rl_type == RL_8139) {
- switch(reg) {
- case PHY_BMCR:
- rl8139_reg = RL_BMCR;
- break;
- case PHY_BMSR:
- rl8139_reg = RL_BMSR;
- break;
- case PHY_ANAR:
- rl8139_reg = RL_ANAR;
- break;
- case PHY_LPAR:
- rl8139_reg = RL_LPAR;
- break;
- default:
- printf("rl%d: bad phy register\n", sc->rl_unit);
- return(0);
- }
- rval = CSR_READ_2(sc, rl8139_reg);
- return(rval);
- }
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->rl_phy_addr;
- frame.mii_regaddr = reg;
- rl_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void rl_phy_writereg(sc, reg, data)
- struct rl_softc *sc;
- int reg;
- int data;
-{
- struct rl_mii_frame frame;
- u_int16_t rl8139_reg = 0;
-
- if (sc->rl_type == RL_8139) {
- switch(reg) {
- case PHY_BMCR:
- rl8139_reg = RL_BMCR;
- break;
- case PHY_BMSR:
- rl8139_reg = RL_BMSR;
- break;
- case PHY_ANAR:
- rl8139_reg = RL_ANAR;
- break;
- case PHY_LPAR:
- rl8139_reg = RL_LPAR;
- break;
- default:
- printf("rl%d: bad phy register\n", sc->rl_unit);
- return;
- }
- CSR_WRITE_2(sc, rl8139_reg, data);
- return;
- }
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->rl_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- rl_mii_writereg(sc, &frame);
-
- return;
-}
-
-/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
- */
-static u_int8_t rl_calchash(addr)
- caddr_t addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /* return the filter bit position */
- return(crc & 0x0000003F);
-}
-
-/*
- * Program the 64-bit multicast hash filter.
- */
-static void rl_setmulti(sc)
- struct rl_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int32_t rxfilt;
- int mcnt = 0;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_4(sc, RL_RXCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI) {
- rxfilt |= RL_RXCFG_RX_MULTI;
- CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
- CSR_WRITE_4(sc, RL_MAR0, 0xFFFFFFFF);
- CSR_WRITE_4(sc, RL_MAR4, 0xFFFFFFFF);
- return;
- }
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, RL_MAR0, 0);
- CSR_WRITE_4(sc, RL_MAR4, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = rl_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- mcnt++;
- }
-
- if (mcnt)
- rxfilt |= RL_RXCFG_RX_MULTI;
- else
- rxfilt &= ~RL_RXCFG_RX_MULTI;
-
- CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
- CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
- CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void rl_autoneg_xmit(sc)
- struct rl_softc *sc;
-{
- u_int16_t phy_sts;
-
- rl_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(rl_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = rl_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- rl_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY. Also used with the 8139 internal
- * transceiver.
- */
-static void rl_autoneg_mii(sc, flag, verbose)
- struct rl_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- /*
- * The 100baseT4 PHY sometimes has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = rl_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("rl%d: autonegotiation not supported\n",
- sc->rl_unit);
- return;
- }
-#endif
-
- switch (flag) {
- case RL_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- rl_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case RL_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise rl_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->rl_cdata.rl_tx_cnt) {
- sc->rl_want_auto = 1;
- return;
- }
- rl_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->rl_autoneg = 1;
- sc->rl_want_auto = 0;
- return;
- break;
- case RL_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->rl_autoneg = 0;
- break;
- default:
- printf("rl%d: invalid autoneg flag: %d\n", sc->rl_unit, flag);
- return;
- }
-
- if (rl_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("rl%d: autoneg complete, ", sc->rl_unit);
- phy_sts = rl_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("rl%d: autoneg not complete, ", sc->rl_unit);
- }
-
- media = rl_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (rl_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = rl_phy_readreg(sc, PHY_ANAR);
- ability = rl_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- /* Set ASIC's duplex mode to match the PHY. */
- rl_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- rl_init(sc);
-
- if (sc->rl_tx_pend) {
- sc->rl_autoneg = 0;
- sc->rl_tx_pend = 0;
- rl_start(ifp);
- }
-
- return;
-}
-
-static void rl_getmode_mii(sc)
- struct rl_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = rl_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("rl%d: PHY status word: %x\n", sc->rl_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("rl%d: 10Mbps half-duplex mode supported\n",
- sc->rl_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("rl%d: 10Mbps full-duplex mode supported\n",
- sc->rl_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("rl%d: 100Mbps half-duplex mode supported\n",
- sc->rl_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("rl%d: 100Mbps full-duplex mode supported\n",
- sc->rl_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("rl%d: 100baseT4 mode supported\n", sc->rl_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("rl%d: forcing on autoneg support for BT4\n",
- sc->rl_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("rl%d: autoneg supported\n", sc->rl_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void rl_setmode_mii(sc, media)
- struct rl_softc *sc;
- int media;
-{
- u_int16_t bmcr;
-
- printf("rl%d: selecting MII, ", sc->rl_unit);
-
- bmcr = rl_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- rl_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-static void rl_reset(sc)
- struct rl_softc *sc;
-{
- register int i;
-
- CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RESET);
-
- for (i = 0; i < RL_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_1(sc, RL_COMMAND) & RL_CMD_RESET))
- break;
- }
- if (i == RL_TIMEOUT)
- printf("rl%d: reset never completed!\n", sc->rl_unit);
-
- return;
-}
-
-/*
- * Probe for a RealTek 8129/8139 chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-rl_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct rl_type *t;
-
- t = rl_devs;
-
- while(t->rl_name != NULL) {
- if ((device_id & 0xFFFF) == t->rl_vid &&
- ((device_id >> 16) & 0xFFFF) == t->rl_did) {
- return(t->rl_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-rl_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef RL_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct rl_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- struct rl_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
- u_int16_t rl_did = 0;
-
- s = splimp();
-
- sc = malloc(sizeof(struct rl_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("rl%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct rl_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, RL_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, RL_PCI_PWRMGMTCTRL);
- if (command & RL_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, RL_PCI_LOIO);
- membase = pci_conf_read(config_id, RL_PCI_LOMEM);
- irq = pci_conf_read(config_id, RL_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("rl%d: chip is is in D%d power mode "
- "-- setting to D0\n", unit, command & RL_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, RL_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, RL_PCI_LOIO, iobase);
- pci_conf_write(config_id, RL_PCI_LOMEM, membase);
- pci_conf_write(config_id, RL_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef RL_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("rl%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, RL_PCI_LOIO,
- (u_int16_t *)&(sc->rl_bhandle))) {
- printf ("rl%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->rl_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("rl%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, RL_PCI_LOMEM, &vbase, &pbase)) {
- printf ("rl%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->rl_btag = I386_BUS_SPACE_MEM;
- sc->rl_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, rl_intr, sc, &net_imask)) {
- printf("rl%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- rl_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- rl_read_eeprom(sc, (caddr_t)&eaddr, RL_EE_EADDR, 3, 0);
-
- /*
- * A RealTek chip was detected. Inform the world.
- */
- printf("rl%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->rl_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- /*
- * Now read the exact device type from the EEPROM to find
- * out if it's an 8129 or 8139.
- */
- rl_read_eeprom(sc, (caddr_t)&rl_did, RL_EE_PCI_DID, 1, 0);
-
- if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030)
- sc->rl_type = RL_8139;
- else if (rl_did == RT_DEVICEID_8129)
- sc->rl_type = RL_8129;
- else {
- printf("rl%d: unknown device ID: %x\n", unit, rl_did);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- sc->rl_cdata.rl_rx_buf = contigmalloc(RL_RXBUFLEN + 16, M_DEVBUF,
- M_NOWAIT, 0x100000, 0xffffffff, PAGE_SIZE, 0);
-
- if (sc->rl_cdata.rl_rx_buf == NULL) {
- free(sc, M_DEVBUF);
- printf("rl%d: no memory for list buffers!\n", unit);
- goto fail;
- }
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "rl";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = rl_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = rl_start;
- ifp->if_watchdog = rl_watchdog;
- ifp->if_init = rl_init;
- ifp->if_baudrate = 10000000;
-
- if (sc->rl_type == RL_8129) {
- if (bootverbose)
- printf("rl%d: probing for a PHY\n", sc->rl_unit);
- for (i = RL_PHYADDR_MIN; i < RL_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("rl%d: checking address: %d\n",
- sc->rl_unit, i);
- sc->rl_phy_addr = i;
- rl_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(rl_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = rl_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = rl_phy_readreg(sc, PHY_VENID);
- phy_did = rl_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("rl%d: found PHY at address %d, ",
- sc->rl_unit, sc->rl_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = rl_phys;
- while(p->rl_vid) {
- if (phy_vid == p->rl_vid &&
- (phy_did | 0x000F) == p->rl_did) {
- sc->rl_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->rl_pinfo == NULL)
- sc->rl_pinfo = &rl_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("rl%d: PHY type: %s\n",
- sc->rl_unit, sc->rl_pinfo->rl_name);
- } else {
- printf("rl%d: MII without any phy!\n", sc->rl_unit);
- }
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, rl_ifmedia_upd, rl_ifmedia_sts);
-
- rl_getmode_mii(sc);
-
- /* Choose a default media. */
- media = IFM_ETHER|IFM_AUTO;
- ifmedia_set(&sc->ifmedia, media);
-
- rl_autoneg_mii(sc, RL_FLAG_FORCEDELAY, 1);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(rl_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int rl_list_tx_init(sc)
- struct rl_softc *sc;
-{
- struct rl_chain_data *cd;
- int i;
-
- cd = &sc->rl_cdata;
- for (i = 0; i < RL_TX_LIST_CNT; i++) {
- cd->rl_tx_chain[i].rl_desc = i * 4;
- CSR_WRITE_4(sc, RL_TXADDR0 + cd->rl_tx_chain[i].rl_desc, 0);
- CSR_WRITE_4(sc, RL_TXSTAT0 + cd->rl_tx_chain[i].rl_desc, 0);
- if (i == (RL_TX_LIST_CNT - 1))
- cd->rl_tx_chain[i].rl_next = &cd->rl_tx_chain[0];
- else
- cd->rl_tx_chain[i].rl_next = &cd->rl_tx_chain[i + 1];
- }
-
- sc->rl_cdata.rl_tx_cnt = 0;
- cd->rl_tx_cur = cd->rl_tx_free = &cd->rl_tx_chain[0];
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- *
- * You know there's something wrong with a PCI bus-master chip design
- * when you have to use m_devget().
- *
- * The receive operation is badly documented in the datasheet, so I'll
- * attempt to document it here. The driver provides a buffer area and
- * places its base address in the RX buffer start address register.
- * The chip then begins copying frames into the RX buffer. Each frame
- * is preceeded by a 32-bit RX status word which specifies the length
- * of the frame and certain other status bits. Each frame (starting with
- * the status word) is also 32-bit aligned. The frame length is in the
- * first 16 bits of the status word; the lower 15 bits correspond with
- * the 'rx status register' mentioned in the datasheet.
- */
-static void rl_rxeof(sc)
- struct rl_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- int total_len = 0;
- u_int32_t rxstat;
- caddr_t rxbufpos;
- int wrap = 0;
- u_int16_t cur_rx;
- u_int16_t limit;
- u_int16_t rx_bytes = 0, max_bytes;
-
- ifp = &sc->arpcom.ac_if;
-
- cur_rx = (CSR_READ_2(sc, RL_CURRXADDR) + 16) % RL_RXBUFLEN;
-
- /* Do not try to read past this point. */
- limit = CSR_READ_2(sc, RL_CURRXBUF) % RL_RXBUFLEN;
-
- if (limit < cur_rx)
- max_bytes = (RL_RXBUFLEN - cur_rx) + limit;
- else
- max_bytes = limit - cur_rx;
-
- while((CSR_READ_1(sc, RL_COMMAND) & RL_CMD_EMPTY_RXBUF) == 0) {
- rxbufpos = sc->rl_cdata.rl_rx_buf + cur_rx;
- rxstat = *(u_int32_t *)rxbufpos;
-
- /*
- * Here's a totally undocumented fact for you. When the
- * RealTek chip is in the process of copying a packet into
- * RAM for you, the length will be 0xfff0. If you spot a
- * packet header with this value, you need to stop. The
- * datasheet makes absolutely no mention of this and
- * RealTek should be shot for this.
- */
- if ((u_int16_t)(rxstat >> 16) == RL_RXSTAT_UNFINISHED)
- break;
-
- if (!(rxstat & RL_RXSTAT_RXOK)) {
- ifp->if_ierrors++;
- if (rxstat & (RL_RXSTAT_BADSYM|RL_RXSTAT_RUNT|
- RL_RXSTAT_GIANT|RL_RXSTAT_CRCERR|
- RL_RXSTAT_ALIGNERR)) {
- CSR_WRITE_2(sc, RL_COMMAND, RL_CMD_TX_ENB);
- CSR_WRITE_2(sc, RL_COMMAND, RL_CMD_TX_ENB|
- RL_CMD_RX_ENB);
- CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG);
- CSR_WRITE_4(sc, RL_RXADDR,
- vtophys(sc->rl_cdata.rl_rx_buf));
- CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16);
- cur_rx = 0;
- }
- break;
- }
-
- /* No errors; receive the packet. */
- total_len = rxstat >> 16;
- rx_bytes += total_len + 4;
-
- /*
- * XXX The RealTek chip includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Avoid trying to read more bytes than we know
- * the chip has prepared for us.
- */
- if (rx_bytes > max_bytes)
- break;
-
- rxbufpos = sc->rl_cdata.rl_rx_buf +
- ((cur_rx + sizeof(u_int32_t)) % RL_RXBUFLEN);
-
- if (rxbufpos == (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN))
- rxbufpos = sc->rl_cdata.rl_rx_buf;
-
- wrap = (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN) - rxbufpos;
-
- if (total_len > wrap) {
- m = m_devget(rxbufpos, wrap, 0, ifp, NULL);
- if (m == NULL) {
- ifp->if_ierrors++;
- printf("rl%d: out of mbufs, tried to "
- "copy %d bytes\n", sc->rl_unit, wrap);
- }
- else
- m_copyback(m, wrap, total_len - wrap,
- sc->rl_cdata.rl_rx_buf);
- cur_rx = (total_len - wrap + ETHER_CRC_LEN);
- } else {
- m = m_devget(rxbufpos, total_len, 0, ifp, NULL);
- if (m == NULL) {
- ifp->if_ierrors++;
- printf("rl%d: out of mbufs, tried to "
- "copy %d bytes\n", sc->rl_unit, total_len);
- }
- cur_rx += total_len + 4 + ETHER_CRC_LEN;
- }
-
- /*
- * Round up to 32-bit boundary.
- */
- cur_rx = (cur_rx + 3) & ~3;
- CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16);
-
- if (m == NULL)
- continue;
-
- eh = mtod(m, struct ether_header *);
- ifp->if_ipackets++;
-
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-static void rl_txeof(sc)
- struct rl_softc *sc;
-{
- struct rl_chain *cur_tx;
- struct ifnet *ifp;
- u_int32_t txstat;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been uploaded.
- */
- if (sc->rl_cdata.rl_tx_free == NULL)
- return;
-
- while(sc->rl_cdata.rl_tx_free->rl_mbuf != NULL) {
- cur_tx = sc->rl_cdata.rl_tx_free;
- txstat = CSR_READ_4(sc, RL_TXSTAT0 + cur_tx->rl_desc);
-
- if (!(txstat & RL_TXSTAT_TX_OK))
- break;
-
- if (txstat & RL_TXSTAT_COLLCNT)
- ifp->if_collisions +=
- (txstat & RL_TXSTAT_COLLCNT) >> 24;
-
- sc->rl_cdata.rl_tx_free = cur_tx->rl_next;
-
- sc->rl_cdata.rl_tx_cnt--;
- m_freem(cur_tx->rl_mbuf);
- cur_tx->rl_mbuf = NULL;
- ifp->if_opackets++;
- }
-
- if (!sc->rl_cdata.rl_tx_cnt) {
- ifp->if_flags &= ~IFF_OACTIVE;
- if (sc->rl_want_auto)
- rl_autoneg_mii(sc, RL_FLAG_SCHEDDELAY, 1);
- } else {
- if (ifp->if_snd.ifq_head != NULL)
- rl_start(ifp);
- }
-
- return;
-}
-
-/*
- * TX error handler.
- */
-static void rl_txeoc(sc)
- struct rl_softc *sc;
-{
- u_int32_t txstat;
- struct rl_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- if (sc->rl_cdata.rl_tx_free == NULL)
- return;
-
- while(sc->rl_cdata.rl_tx_free->rl_mbuf != NULL) {
- cur_tx = sc->rl_cdata.rl_tx_free;
- txstat = CSR_READ_4(sc, RL_TXSTAT0 + cur_tx->rl_desc);
-
- if (!(txstat & RL_TXSTAT_OWN))
- break;
-
- if (!(txstat & RL_TXSTAT_TX_OK)) {
- ifp->if_oerrors++;
- if (txstat & RL_TXSTAT_COLLCNT)
- ifp->if_collisions +=
- (txstat & RL_TXSTAT_COLLCNT) >> 24;
- CSR_WRITE_4(sc, RL_TXADDR0 + cur_tx->rl_desc,
- vtophys(mtod(cur_tx->rl_mbuf, caddr_t)));
- CSR_WRITE_4(sc, RL_TXSTAT0 + cur_tx->rl_desc,
- RL_TX_EARLYTHRESH |
- cur_tx->rl_mbuf->m_pkthdr.len);
- break;
- } else {
- if (txstat & RL_TXSTAT_COLLCNT)
- ifp->if_collisions +=
- (txstat & RL_TXSTAT_COLLCNT) >> 24;
- sc->rl_cdata.rl_tx_free = cur_tx->rl_next;
-
- sc->rl_cdata.rl_tx_cnt--;
- m_freem(cur_tx->rl_mbuf);
- cur_tx->rl_mbuf = NULL;
- ifp->if_opackets++;
- }
- }
-
- return;
-}
-
-static void rl_intr(arg)
- void *arg;
-{
- struct rl_softc *sc;
- struct ifnet *ifp;
- u_int16_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Disable interrupts. */
- CSR_WRITE_2(sc, RL_IMR, 0x0000);
-
- for (;;) {
-
- status = CSR_READ_2(sc, RL_ISR);
- if (status)
- CSR_WRITE_2(sc, RL_ISR, status);
-
- if ((status & RL_INTRS) == 0)
- break;
-
- if (status & RL_ISR_RX_OK)
- rl_rxeof(sc);
-
- if (status & RL_ISR_RX_ERR)
- rl_rxeof(sc);
-
- if (status & RL_ISR_TX_OK)
- rl_txeof(sc);
-
- if (status & RL_ISR_TX_ERR)
- rl_txeoc(sc);
-
- if (status & RL_ISR_SYSTEM_ERR) {
- rl_reset(sc);
- rl_init(sc);
- }
-
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- rl_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int rl_encap(sc, c, m_head)
- struct rl_softc *sc;
- struct rl_chain *c;
- struct mbuf *m_head;
-{
- struct mbuf *m;
- struct mbuf *m_new = NULL;
-
- /*
- * There are two possible encapsulation mechanisms
- * that we can use: an efficient one, and a very lossy
- * one. The efficient one only happens very rarely,
- * whereas the lossy one can and most likely will happen
- * all the time.
- * The efficient case happens if:
- * - the packet fits in a single mbuf
- * - the packet is 32-bit aligned within the mbuf data area
- * In this case, we can DMA from the mbuf directly.
- * The lossy case covers everything else. Bah.
- */
-
- m = m_head;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("rl%d: no memory for tx list", sc->rl_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("rl%d: no memory for tx list",
- sc->rl_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
-
- /* Pad frames to at least 60 bytes. */
- if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN) {
- m_head->m_pkthdr.len +=
- (RL_MIN_FRAMELEN - m_head->m_pkthdr.len);
- m_head->m_len = m_head->m_pkthdr.len;
- }
-
- c->rl_mbuf = m_head;
-
- return(0);
-}
-
-/*
- * Main transmit routine.
- */
-
-static void rl_start(ifp)
- struct ifnet *ifp;
-{
- struct rl_softc *sc;
- struct mbuf *m_head = NULL;
- struct rl_chain *cur_tx = NULL;
-
- sc = ifp->if_softc;
-
- if (sc->rl_autoneg) {
- sc->rl_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->rl_cdata.rl_tx_cur->rl_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- while(sc->rl_cdata.rl_tx_cur->rl_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->rl_cdata.rl_tx_cur;
- sc->rl_cdata.rl_tx_cur = cur_tx->rl_next;
- sc->rl_cdata.rl_tx_cnt++;
-
- /* Pack the data into the descriptor. */
- rl_encap(sc, cur_tx, m_head);
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->rl_mbuf);
-#endif
- /*
- * Transmit the frame.
- */
- CSR_WRITE_4(sc, RL_TXADDR0 + cur_tx->rl_desc,
- vtophys(mtod(cur_tx->rl_mbuf, caddr_t)));
- CSR_WRITE_4(sc, RL_TXSTAT0 + cur_tx->rl_desc,
- RL_TX_EARLYTHRESH | cur_tx->rl_mbuf->m_pkthdr.len);
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void rl_init(xsc)
- void *xsc;
-{
- struct rl_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- int s, i;
- u_int32_t rxcfg = 0;
- u_int16_t phy_bmcr = 0;
-
- if (sc->rl_autoneg)
- return;
-
- s = splimp();
-
- /*
- * XXX Hack for the 8139: the built-in autoneg logic's state
- * gets reset by rl_init() when we don't want it to. Try
- * to preserve it. (For 8129 cards with real external PHYs,
- * the BMCR register doesn't change, but this doesn't hurt.)
- */
- if (sc->rl_type == RL_8139)
- phy_bmcr = rl_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- rl_stop(sc);
-
- /* Init our MAC address */
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, RL_IDR0 + i, sc->arpcom.ac_enaddr[i]);
- }
-
- /* Init the RX buffer pointer register. */
- CSR_WRITE_4(sc, RL_RXADDR, vtophys(sc->rl_cdata.rl_rx_buf));
-
- /* Init TX descriptors. */
- rl_list_tx_init(sc);
-
- /*
- * Enable transmit and receive.
- */
- CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB);
-
- /*
- * Set the buffer size values.
- */
- CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG);
-
- /* Set the individual bit to receive frames for this host only. */
- rxcfg = CSR_READ_4(sc, RL_RXCFG);
- rxcfg |= RL_RXCFG_RX_INDIV;
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
- rxcfg |= RL_RXCFG_RX_ALLPHYS;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- } else {
- rxcfg &= ~RL_RXCFG_RX_ALLPHYS;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- }
-
- /*
- * Set capture broadcast bit to capture broadcast frames.
- */
- if (ifp->if_flags & IFF_BROADCAST) {
- rxcfg |= RL_RXCFG_RX_BROAD;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- } else {
- rxcfg &= ~RL_RXCFG_RX_BROAD;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- }
-
- /*
- * Program the multicast filter, if necessary.
- */
- rl_setmulti(sc);
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
-
- /* Start RX/TX process. */
- CSR_WRITE_4(sc, RL_MISSEDPKT, 0);
-
- /* Enable receiver and transmitter. */
- CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB);
-
- /* Restore state of BMCR */
- if (sc->rl_pinfo != NULL)
- rl_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int rl_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct rl_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- rl_autoneg_mii(sc, RL_FLAG_SCHEDDELAY, 1);
- else
- rl_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void rl_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct rl_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- if (!(rl_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (rl_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
-
- if (rl_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = rl_phy_readreg(sc, PHY_LPAR);
- advert = rl_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int rl_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct rl_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- rl_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- rl_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- rl_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void rl_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct rl_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->rl_autoneg) {
- rl_autoneg_mii(sc, RL_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- printf("rl%d: watchdog timeout\n", sc->rl_unit);
- ifp->if_oerrors++;
- if (!(rl_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("rl%d: no carrier - transceiver cable problem?\n",
- sc->rl_unit);
- rl_txeoc(sc);
- rl_txeof(sc);
- rl_rxeof(sc);
- rl_init(sc);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void rl_stop(sc)
- struct rl_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- CSR_WRITE_1(sc, RL_COMMAND, 0x00);
- CSR_WRITE_2(sc, RL_IMR, 0x0000);
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < RL_TX_LIST_CNT; i++) {
- if (sc->rl_cdata.rl_tx_chain[i].rl_mbuf != NULL) {
- m_freem(sc->rl_cdata.rl_tx_chain[i].rl_mbuf);
- sc->rl_cdata.rl_tx_chain[i].rl_mbuf = NULL;
- CSR_WRITE_4(sc, RL_TXADDR0 +
- sc->rl_cdata.rl_tx_chain[i].rl_desc, 0x00000000);
- }
- }
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void rl_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct rl_softc *sc = (struct rl_softc *)arg;
-
- rl_stop(sc);
-
- return;
-}
-
-
-static struct pci_device rl_device = {
- "rl",
- rl_probe,
- rl_attach,
- &rl_count,
- NULL
-};
-DATA_SET(pcidevice_set, rl_device);
diff --git a/sys/pci/if_rlreg.h b/sys/pci/if_rlreg.h
deleted file mode 100644
index 5263b5a820521..0000000000000
--- a/sys/pci/if_rlreg.h
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_rlreg.h,v 1.14 1998/12/07 00:16:44 wpaul Exp $
- */
-
-/*
- * RealTek 8129/8139 register offsets
- */
-#define RL_IDR0 0x0000 /* ID register 0 (station addr) */
-#define RL_IDR1 0x0001 /* Must use 32-bit accesses (?) */
-#define RL_IDR2 0x0002
-#define RL_IDR3 0x0003
-#define RL_IDR4 0x0004
-#define RL_IDR5 0x0005
- /* 0006-0007 reserved */
-#define RL_MAR0 0x0008 /* Multicast hash table */
-#define RL_MAR1 0x0009
-#define RL_MAR2 0x000A
-#define RL_MAR3 0x000B
-#define RL_MAR4 0x000C
-#define RL_MAR5 0x000D
-#define RL_MAR6 0x000E
-#define RL_MAR7 0x000F
-
-#define RL_TXSTAT0 0x0010 /* status of TX descriptor 0 */
-#define RL_TXSTAT1 0x0014 /* status of TX descriptor 1 */
-#define RL_TXSTAT2 0x0018 /* status of TX descriptor 2 */
-#define RL_TXSTAT3 0x001C /* status of TX descriptor 3 */
-
-#define RL_TXADDR0 0x0020 /* address of TX descriptor 0 */
-#define RL_TXADDR1 0x0024 /* address of TX descriptor 1 */
-#define RL_TXADDR2 0x0028 /* address of TX descriptor 2 */
-#define RL_TXADDR3 0x002C /* address of TX descriptor 3 */
-
-#define RL_RXADDR 0x0030 /* RX ring start address */
-#define RL_RX_EARLY_BYTES 0x0034 /* RX early byte count */
-#define RL_RX_EARLY_STAT 0x0036 /* RX early status */
-#define RL_COMMAND 0x0037 /* command register */
-#define RL_CURRXADDR 0x0038 /* current address of packet read */
-#define RL_CURRXBUF 0x003A /* current RX buffer address */
-#define RL_IMR 0x003C /* interrupt mask register */
-#define RL_ISR 0x003E /* interrupt status register */
-#define RL_TXCFG 0x0040 /* transmit config */
-#define RL_RXCFG 0x0044 /* receive config */
-#define RL_TIMERCNT 0x0048 /* timer count register */
-#define RL_MISSEDPKT 0x004C /* missed packet counter */
-#define RL_EECMD 0x0050 /* EEPROM command register */
-#define RL_CFG0 0x0051 /* config register #0 */
-#define RL_CFG1 0x0052 /* config register #1 */
- /* 0053-0057 reserved */
-#define RL_MEDIASTAT 0x0058 /* media status register (8139) */
- /* 0059-005A reserved */
-#define RL_MII 0x005A /* 8129 chip only */
-#define RL_HALTCLK 0x005B
-#define RL_MULTIINTR 0x005C /* multiple interrupt */
-#define RL_PCIREV 0x005E /* PCI revision value */
- /* 005F reserved */
-#define RL_TXSTAT_ALL 0x0060 /* TX status of all descriptors */
-
-/* Direct PHY access registers only available on 8139 */
-#define RL_BMCR 0x0062 /* PHY basic mode control */
-#define RL_BMSR 0x0064 /* PHY basic mode status */
-#define RL_ANAR 0x0066 /* PHY autoneg advert */
-#define RL_LPAR 0x0068 /* PHY link partner ability */
-#define RL_ANER 0x006A /* PHY autoneg expansion */
-
-#define RL_DISCCNT 0x006C /* disconnect counter */
-#define RL_FALSECAR 0x006E /* false carrier counter */
-#define RL_NWAYTST 0x0070 /* NWAY test register */
-#define RL_RX_ER 0x0072 /* RX_ER counter */
-#define RL_CSCFG 0x0074 /* CS configuration register */
-
-
-/*
- * TX config register bits
- */
-#define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */
-#define RL_TXCFG_MXDMA0 0x00000100 /* max DMA burst size */
-#define RL_TXCFG_MXDMA1 0x00000200
-#define RL_TXCFG_MXDMA2 0x00000400
-#define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */
-#define RL_TXCFG_LOOPBKTST0 0x00020000 /* loopback test */
-#define RL_TXCFG_LOOPBKTST1 0x00040000 /* loopback test */
-#define RL_TXCFG_IFG0 0x01000000 /* interframe gap */
-#define RL_TXCFG_IFG1 0x02000000 /* interframe gap */
-
-/*
- * Transmit descriptor status register bits.
- */
-#define RL_TXSTAT_LENMASK 0x00001FFF
-#define RL_TXSTAT_OWN 0x00002000
-#define RL_TXSTAT_TX_UNDERRUN 0x00004000
-#define RL_TXSTAT_TX_OK 0x00008000
-#define RL_TXSTAT_EARLY_THRESH 0x003F0000
-#define RL_TXSTAT_COLLCNT 0x0F000000
-#define RL_TXSTAT_CARR_HBEAT 0x10000000
-#define RL_TXSTAT_OUTOFWIN 0x20000000
-#define RL_TXSTAT_TXABRT 0x40000000
-#define RL_TXSTAT_CARRLOSS 0x80000000
-
-/*
- * Interrupt status register bits.
- */
-#define RL_ISR_RX_OK 0x0001
-#define RL_ISR_RX_ERR 0x0002
-#define RL_ISR_TX_OK 0x0004
-#define RL_ISR_TX_ERR 0x0008
-#define RL_ISR_RX_OVERRUN 0x0010
-#define RL_ISR_PKT_UNDERRUN 0x0020
-#define RL_ISR_FIFO_OFLOW 0x0040 /* 8139 only */
-#define RL_ISR_PCS_TIMEOUT 0x4000 /* 8129 only */
-#define RL_ISR_SYSTEM_ERR 0x8000
-
-#define RL_INTRS \
- (RL_ISR_TX_OK|RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \
- RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \
- RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR)
-
-/*
- * Media status register. (8139 only)
- */
-#define RL_MEDIASTAT_RXPAUSE 0x01
-#define RL_MEDIASTAT_TXPAUSE 0x02
-#define RL_MEDIASTAT_LINK 0x04
-#define RL_MEDIASTAT_SPEED10 0x08
-#define RL_MEDIASTAT_RXFLOWCTL 0x40 /* duplex mode */
-#define RL_MEDIASTAT_TXFLOWCTL 0x80 /* duplex mode */
-
-/*
- * Receive config register.
- */
-#define RL_RXCFG_RX_ALLPHYS 0x00000001 /* accept all nodes */
-#define RL_RXCFG_RX_INDIV 0x00000002 /* match filter */
-#define RL_RXCFG_RX_MULTI 0x00000004 /* accept all multicast */
-#define RL_RXCFG_RX_BROAD 0x00000008 /* accept all broadcast */
-#define RL_RXCFG_RX_RUNT 0x00000010
-#define RL_RXCFG_RX_ERRPKT 0x00000020
-#define RL_RXCFG_WRAP 0x00000080
-#define RL_RXCFG_MAXDMA (0x00000100|0x00000200|0x00000400)
-#define RL_RXCFG_BUFSZ (0x00000800|0x00001000)
-#define RL_RXCFG_FIFOTHRESH (0x00002000|0x00004000|0x00008000)
-#define RL_RXCFG_EARLYTHRESH (0x01000000|0x02000000|0x04000000)
-
-#define RL_RXBUF_8 0x00000000
-#define RL_RXBUF_16 0x00000800
-#define RL_RXBUF_32 0x00001000
-#define RL_RXBUF_64 (0x00001000|0x00000800)
-
-/*
- * Bits in RX status header (included with RX'ed packet
- * in ring buffer).
- */
-#define RL_RXSTAT_RXOK 0x00000001
-#define RL_RXSTAT_ALIGNERR 0x00000002
-#define RL_RXSTAT_CRCERR 0x00000004
-#define RL_RXSTAT_GIANT 0x00000008
-#define RL_RXSTAT_RUNT 0x00000010
-#define RL_RXSTAT_BADSYM 0x00000020
-#define RL_RXSTAT_BROAD 0x00002000
-#define RL_RXSTAT_INDIV 0x00004000
-#define RL_RXSTAT_MULTI 0x00008000
-#define RL_RXSTAT_LENMASK 0xFFFF0000
-
-#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */
-/*
- * Command register.
- */
-#define RL_CMD_EMPTY_RXBUF 0x0001
-#define RL_CMD_TX_ENB 0x0004
-#define RL_CMD_RX_ENB 0x0008
-#define RL_CMD_RESET 0x0010
-
-/*
- * EEPROM control register
- */
-#define RL_EE_DATAOUT 0x01 /* Data out */
-#define RL_EE_DATAIN 0x02 /* Data in */
-#define RL_EE_CLK 0x04 /* clock */
-#define RL_EE_SEL 0x08 /* chip select */
-#define RL_EE_MODE (0x40|0x80)
-
-#define RL_EEMODE_OFF 0x00
-#define RL_EEMODE_AUTOLOAD 0x40
-#define RL_EEMODE_PROGRAM 0x80
-#define RL_EEMODE_WRITECFG (0x80|0x40)
-
-/* 9346 EEPROM commands */
-#define RL_EECMD_WRITE 0x140
-#define RL_EECMD_READ 0x180
-#define RL_EECMD_ERASE 0x1c0
-
-#define RL_EE_ID 0x00
-#define RL_EE_PCI_VID 0x01
-#define RL_EE_PCI_DID 0x02
-/* Location of station address inside EEPROM */
-#define RL_EE_EADDR 0x07
-
-/*
- * MII register (8129 only)
- */
-#define RL_MII_CLK 0x01
-#define RL_MII_DATAIN 0x02
-#define RL_MII_DATAOUT 0x04
-#define RL_MII_DIR 0x80 /* 0 == input, 1 == output */
-
-/*
- * Config 0 register
- */
-#define RL_CFG0_ROM0 0x01
-#define RL_CFG0_ROM1 0x02
-#define RL_CFG0_ROM2 0x04
-#define RL_CFG0_PL0 0x08
-#define RL_CFG0_PL1 0x10
-#define RL_CFG0_10MBPS 0x20 /* 10 Mbps internal mode */
-#define RL_CFG0_PCS 0x40
-#define RL_CFG0_SCR 0x80
-
-/*
- * Config 1 register
- */
-#define RL_CFG1_PWRDWN 0x01
-#define RL_CFG1_SLEEP 0x02
-#define RL_CFG1_IOMAP 0x04
-#define RL_CFG1_MEMMAP 0x08
-#define RL_CFG1_RSVD 0x10
-#define RL_CFG1_DRVLOAD 0x20
-#define RL_CFG1_LED0 0x40
-#define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */
-#define RL_CFG1_LED1 0x80
-
-/*
- * The RealTek doesn't use a fragment-based descriptor mechanism.
- * Instead, there are only four register sets, each or which represents
- * one 'descriptor.' Basically, each TX descriptor is just a contiguous
- * packet buffer (32-bit aligned!) and we place the buffer addresses in
- * the registers so the chip knows where they are.
- *
- * We can sort of kludge together the same kind of buffer management
- * used in previous drivers, but we have to do buffer copies almost all
- * the time, so it doesn't really buy us much.
- *
- * For reception, there's just one large buffer where the chip stores
- * all received packets.
- */
-
-#define RL_RX_BUF_SZ RL_RXBUF_64
-#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13))
-#define RL_TX_LIST_CNT 4
-#define RL_MIN_FRAMELEN 60
-#define RL_TX_EARLYTHRESH 0x80000 /* 256 << 11 */
-#define RL_RX_FIFOTHRESH 0x8000 /* 4 << 13 */
-#define RL_RX_MAXDMA 0x00000400
-
-#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_BUF_SZ)
-
-struct rl_chain {
- char rl_desc; /* descriptor register idx */
- struct mbuf *rl_mbuf;
- struct rl_chain *rl_next;
-};
-
-struct rl_chain_data {
- u_int16_t cur_rx;
- caddr_t rl_rx_buf;
- struct rl_chain rl_tx_chain[RL_TX_LIST_CNT];
-
- int rl_tx_cnt;
- struct rl_chain *rl_tx_cur;
- struct rl_chain *rl_tx_free;
-};
-
-struct rl_type {
- u_int16_t rl_vid;
- u_int16_t rl_did;
- char *rl_name;
-};
-
-struct rl_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define RL_MII_STARTDELIM 0x01
-#define RL_MII_READOP 0x02
-#define RL_MII_WRITEOP 0x01
-#define RL_MII_TURNAROUND 0x02
-
-#define RL_FLAG_FORCEDELAY 1
-#define RL_FLAG_SCHEDDELAY 2
-#define RL_FLAG_DELAYTIMEO 3
-
-#define RL_8129 1
-#define RL_8139 2
-
-struct rl_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t rl_bhandle; /* bus space handle */
- bus_space_tag_t rl_btag; /* bus space tag */
- struct rl_type *rl_pinfo; /* phy info */
- u_int8_t rl_unit; /* interface number */
- u_int8_t rl_type;
- u_int8_t rl_phy_addr; /* PHY address */
- u_int8_t rl_tx_pend; /* TX pending */
- u_int8_t rl_want_auto;
- u_int8_t rl_autoneg;
- u_int8_t rl_stats_no_timeout;
- struct rl_chain_data rl_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->rl_btag, sc->rl_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->rl_btag, sc->rl_bhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->rl_btag, sc->rl_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->rl_btag, sc->rl_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->rl_btag, sc->rl_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->rl_btag, sc->rl_bhandle, reg)
-
-#define RL_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * RealTek PCI vendor ID
- */
-#define RT_VENDORID 0x10EC
-
-/*
- * Accton PCI vendor ID
- */
-#define ACCTON_VENDORID 0x1113
-
-/*
- * RealTek chip device IDs.
- */
-#define RT_DEVICEID_8129 0x8129
-#define RT_DEVICEID_8139 0x8139
-
-/*
- * Accton MPX 5030/5038 device ID.
- */
-#define ACCTON_DEVICEID_5030 0x1211
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers. Note: some are only available on
- * the 3c905B, in particular those that related to power management.
- */
-
-#define RL_PCI_VENDOR_ID 0x00
-#define RL_PCI_DEVICE_ID 0x02
-#define RL_PCI_COMMAND 0x04
-#define RL_PCI_STATUS 0x06
-#define RL_PCI_CLASSCODE 0x09
-#define RL_PCI_LATENCY_TIMER 0x0D
-#define RL_PCI_HEADER_TYPE 0x0E
-#define RL_PCI_LOIO 0x10
-#define RL_PCI_LOMEM 0x14
-#define RL_PCI_BIOSROM 0x30
-#define RL_PCI_INTLINE 0x3C
-#define RL_PCI_INTPIN 0x3D
-#define RL_PCI_MINGNT 0x3E
-#define RL_PCI_MINLAT 0x0F
-#define RL_PCI_RESETOPT 0x48
-#define RL_PCI_EEPROM_DATA 0x4C
-
-#define RL_PCI_CAPID 0xDC /* 8 bits */
-#define RL_PCI_NEXTPTR 0xDD /* 8 bits */
-#define RL_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define RL_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define RL_PSTATE_MASK 0x0003
-#define RL_PSTATE_D0 0x0000
-#define RL_PSTATE_D1 0x0002
-#define RL_PSTATE_D2 0x0002
-#define RL_PSTATE_D3 0x0003
-#define RL_PME_EN 0x0010
-#define RL_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define RL_PHYADDR_MIN 0x00
-#define RL_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_sr_p.c b/sys/pci/if_sr_p.c
index 41a5ec3f2cbdd..02a32e089f395 100644
--- a/sys/pci/if_sr_p.c
+++ b/sys/pci/if_sr_p.c
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_sr_p.c,v 1.6 1998/02/09 06:10:52 eivind Exp $
+ * $Id: if_sr_p.c,v 1.5 1997/09/02 20:06:27 bde Exp $
*/
#include "pci.h"
@@ -54,7 +54,7 @@ extern void *srattach_pci(int unit,
vm_offset_t sca_vaddr);
extern void srintr_hc(void *hc);
-static const char *sr_pci_probe(pcici_t tag, pcidi_t type);
+static char *sr_pci_probe(pcici_t tag, pcidi_t type);
static void sr_pci_attach(pcici_t config_id, int unit);
static u_long src_count = NSR;
@@ -69,7 +69,7 @@ static struct pci_device sr_pci_driver =
DATA_SET (pcidevice_set, sr_pci_driver);
-static const char *
+static char *
sr_pci_probe(pcici_t tag, pcidi_t type)
{
switch(type) {
diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c
index b202fb5de8db3..abf68c9e2b82c 100644
--- a/sys/pci/if_tl.c
+++ b/sys/pci/if_tl.c
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_tl.c,v 1.23 1998/12/14 06:32:56 dillon Exp $
+ * $Id: if_tl.c,v 1.17 1998/10/04 18:47:38 wpaul Exp $
*/
/*
@@ -216,9 +216,9 @@
#include <pci/if_tlreg.h>
-#if !defined(lint)
-static const char rcsid[] =
- "$Id: if_tl.c,v 1.23 1998/12/14 06:32:56 dillon Exp $";
+#ifndef lint
+static char rcsid[] =
+ "$Id: if_tl.c,v 1.17 1998/10/04 18:47:38 wpaul Exp $";
#endif
#ifdef TL_DEBUG
@@ -316,7 +316,7 @@ static struct tl_type tl_phys[] = {
static unsigned long tl_count;
-static const char *tl_probe __P((pcici_t, pcidi_t));
+static char *tl_probe __P((pcici_t, pcidi_t));
static void tl_attach __P((pcici_t, int));
static int tl_attach_phy __P((struct tl_softc *));
static int tl_intvec_rxeoc __P((void *, u_int32_t));
@@ -342,9 +342,9 @@ static void tl_shutdown __P((int, void *));
static int tl_ifmedia_upd __P((struct ifnet *));
static void tl_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-static u_int8_t tl_eeprom_putbyte __P((struct tl_softc *, int));
+static u_int8_t tl_eeprom_putbyte __P((struct tl_softc *, u_int8_t));
static u_int8_t tl_eeprom_getbyte __P((struct tl_softc *,
- int, u_int8_t *));
+ u_int8_t, u_int8_t *));
static int tl_read_eeprom __P((struct tl_softc *, caddr_t, int, int));
static void tl_mii_sync __P((struct tl_softc *));
@@ -352,57 +352,57 @@ static void tl_mii_send __P((struct tl_softc *, u_int32_t, int));
static int tl_mii_readreg __P((struct tl_softc *, struct tl_mii_frame *));
static int tl_mii_writereg __P((struct tl_softc *, struct tl_mii_frame *));
static u_int16_t tl_phy_readreg __P((struct tl_softc *, int));
-static void tl_phy_writereg __P((struct tl_softc *, int, int));
+static void tl_phy_writereg __P((struct tl_softc *, u_int16_t, u_int16_t));
static void tl_autoneg __P((struct tl_softc *, int, int));
static void tl_setmode __P((struct tl_softc *, int));
-static int tl_calchash __P((caddr_t));
+static int tl_calchash __P((unsigned char *));
static void tl_setmulti __P((struct tl_softc *));
-static void tl_setfilt __P((struct tl_softc *, caddr_t, int));
+static void tl_setfilt __P((struct tl_softc *, u_int8_t *, int));
static void tl_softreset __P((struct tl_softc *, int));
static void tl_hardreset __P((struct tl_softc *));
static int tl_list_rx_init __P((struct tl_softc *));
static int tl_list_tx_init __P((struct tl_softc *));
-static u_int8_t tl_dio_read8 __P((struct tl_softc *, int));
-static u_int16_t tl_dio_read16 __P((struct tl_softc *, int));
-static u_int32_t tl_dio_read32 __P((struct tl_softc *, int));
-static void tl_dio_write8 __P((struct tl_softc *, int, int));
-static void tl_dio_write16 __P((struct tl_softc *, int, int));
-static void tl_dio_write32 __P((struct tl_softc *, int, int));
-static void tl_dio_setbit __P((struct tl_softc *, int, int));
-static void tl_dio_clrbit __P((struct tl_softc *, int, int));
-static void tl_dio_setbit16 __P((struct tl_softc *, int, int));
-static void tl_dio_clrbit16 __P((struct tl_softc *, int, int));
+static u_int8_t tl_dio_read8 __P((struct tl_softc *, u_int8_t));
+static u_int16_t tl_dio_read16 __P((struct tl_softc *, u_int8_t));
+static u_int32_t tl_dio_read32 __P((struct tl_softc *, u_int8_t));
+static void tl_dio_write8 __P((struct tl_softc *, u_int8_t, u_int8_t));
+static void tl_dio_write16 __P((struct tl_softc *, u_int8_t, u_int16_t));
+static void tl_dio_write32 __P((struct tl_softc *, u_int8_t, u_int32_t));
+static void tl_dio_setbit __P((struct tl_softc *, u_int8_t, u_int8_t));
+static void tl_dio_clrbit __P((struct tl_softc *, u_int8_t, u_int8_t));
+static void tl_dio_setbit16 __P((struct tl_softc *, u_int8_t, u_int16_t));
+static void tl_dio_clrbit16 __P((struct tl_softc *, u_int8_t, u_int16_t));
static u_int8_t tl_dio_read8(sc, reg)
- struct tl_softc *sc;
- int reg;
+ struct tl_softc *sc;
+ u_int8_t reg;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
return(CSR_READ_1(sc, TL_DIO_DATA + (reg & 3)));
}
static u_int16_t tl_dio_read16(sc, reg)
- struct tl_softc *sc;
- int reg;
+ struct tl_softc *sc;
+ u_int8_t reg;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
return(CSR_READ_2(sc, TL_DIO_DATA + (reg & 3)));
}
static u_int32_t tl_dio_read32(sc, reg)
- struct tl_softc *sc;
- int reg;
+ struct tl_softc *sc;
+ u_int8_t reg;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
return(CSR_READ_4(sc, TL_DIO_DATA + (reg & 3)));
}
static void tl_dio_write8(sc, reg, val)
- struct tl_softc *sc;
- int reg;
- int val;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int8_t val;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
CSR_WRITE_1(sc, TL_DIO_DATA + (reg & 3), val);
@@ -410,9 +410,9 @@ static void tl_dio_write8(sc, reg, val)
}
static void tl_dio_write16(sc, reg, val)
- struct tl_softc *sc;
- int reg;
- int val;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int16_t val;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
CSR_WRITE_2(sc, TL_DIO_DATA + (reg & 3), val);
@@ -420,9 +420,9 @@ static void tl_dio_write16(sc, reg, val)
}
static void tl_dio_write32(sc, reg, val)
- struct tl_softc *sc;
- int reg;
- int val;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int32_t val;
{
CSR_WRITE_2(sc, TL_DIO_ADDR, reg);
CSR_WRITE_4(sc, TL_DIO_DATA + (reg & 3), val);
@@ -430,9 +430,9 @@ static void tl_dio_write32(sc, reg, val)
}
static void tl_dio_setbit(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int8_t bit;
{
u_int8_t f;
@@ -445,9 +445,9 @@ static void tl_dio_setbit(sc, reg, bit)
}
static void tl_dio_clrbit(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int8_t bit;
{
u_int8_t f;
@@ -460,9 +460,9 @@ static void tl_dio_clrbit(sc, reg, bit)
}
static void tl_dio_setbit16(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int16_t bit;
{
u_int16_t f;
@@ -475,9 +475,9 @@ static void tl_dio_setbit16(sc, reg, bit)
}
static void tl_dio_clrbit16(sc, reg, bit)
- struct tl_softc *sc;
- int reg;
- int bit;
+ struct tl_softc *sc;
+ u_int8_t reg;
+ u_int16_t bit;
{
u_int16_t f;
@@ -494,7 +494,7 @@ static void tl_dio_clrbit16(sc, reg, bit)
*/
static u_int8_t tl_eeprom_putbyte(sc, byte)
struct tl_softc *sc;
- int byte;
+ u_int8_t byte;
{
register int i, ack = 0;
@@ -538,7 +538,7 @@ static u_int8_t tl_eeprom_putbyte(sc, byte)
*/
static u_int8_t tl_eeprom_getbyte(sc, addr, dest)
struct tl_softc *sc;
- int addr;
+ u_int8_t addr;
u_int8_t *dest;
{
register int i;
@@ -827,8 +827,8 @@ static u_int16_t tl_phy_readreg(sc, reg)
static void tl_phy_writereg(sc, reg, data)
struct tl_softc *sc;
- int reg;
- int data;
+ u_int16_t reg;
+ u_int16_t data;
{
struct tl_mii_frame frame;
@@ -1145,7 +1145,7 @@ static void tl_setmode(sc, media)
* the folded 24-bit value is split into 6-bit portions and XOR'd.
*/
static int tl_calchash(addr)
- caddr_t addr;
+ unsigned char *addr;
{
int t;
@@ -1163,7 +1163,7 @@ static int tl_calchash(addr)
*/
static void tl_setfilt(sc, addr, slot)
struct tl_softc *sc;
- caddr_t addr;
+ u_int8_t *addr;
int slot;
{
int i;
@@ -1205,7 +1205,7 @@ static void tl_setmulti(sc)
/* First, zot all the existing filters. */
for (i = 1; i < 4; i++)
- tl_setfilt(sc, (caddr_t)&dummy, i);
+ tl_setfilt(sc, dummy, i);
tl_dio_write32(sc, TL_HASH1, 0);
tl_dio_write32(sc, TL_HASH2, 0);
@@ -1365,7 +1365,7 @@ static void tl_softreset(sc, internal)
* Probe for a ThunderLAN chip. Check the PCI vendor and device IDs
* against our list and return its name if we find a match.
*/
-static const char *
+static char *
tl_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1823,12 +1823,12 @@ static int tl_list_rx_init(sc)
cd = &sc->tl_cdata;
ld = sc->tl_ldata;
- for (i = 0; i < TL_RX_LIST_CNT; i++) {
+ for (i = 0; i < TL_TX_LIST_CNT; i++) {
cd->tl_rx_chain[i].tl_ptr =
(struct tl_list_onefrag *)&ld->tl_rx_list[i];
if (tl_newbuf(sc, &cd->tl_rx_chain[i]) == ENOBUFS)
return(ENOBUFS);
- if (i == (TL_RX_LIST_CNT - 1)) {
+ if (i == (TL_TX_LIST_CNT - 1)) {
cd->tl_rx_chain[i].tl_next = NULL;
ld->tl_rx_list[i].tlist_fptr = 0;
} else {
@@ -2129,7 +2129,7 @@ static int tl_intvec_adchk(xsc, type)
if (type)
printf("tl%d: adapter check: %x\n", sc->tl_unit,
- (unsigned int)CSR_READ_4(sc, TL_CH_PARM));
+ CSR_READ_4(sc, TL_CH_PARM));
#ifdef TL_DEBUG
evshow(sc);
#endif
@@ -2440,12 +2440,6 @@ static void tl_start(ifp)
}
/*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
* That's all we can stands, we can't stands no more.
* If there are no other transfers pending, then issue the
* TX GO command to the adapter to start things moving.
@@ -2475,7 +2469,7 @@ static void tl_start(ifp)
evset(sc, EV_START_Q);
#endif
sc->tl_cdata.tl_tx_tail->tl_next = start_tx;
- sc->tl_cdata.tl_tx_tail = cur_tx;
+ sc->tl_cdata.tl_tx_tail = start_tx;
}
/*
@@ -2527,7 +2521,7 @@ static void tl_init(xsc)
tl_dio_setbit(sc, TL_NETCMD, TL_CMD_NOBRX);
/* Init our MAC address */
- tl_setfilt(sc, (caddr_t)&sc->arpcom.ac_enaddr, 0);
+ tl_setfilt(sc, sc->arpcom.ac_enaddr, 0);
/* Init multicast filter, if needed. */
tl_setmulti(sc);
diff --git a/sys/pci/if_tlreg.h b/sys/pci/if_tlreg.h
index b8b3769f7bbf5..a9b80ea644159 100644
--- a/sys/pci/if_tlreg.h
+++ b/sys/pci/if_tlreg.h
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_tlreg.h,v 1.6 1998/09/23 05:08:54 wpaul Exp $
+ * $Id: if_tlreg.h,v 1.12 1998/09/17 21:16:31 wpaul Exp $
*/
@@ -49,8 +49,8 @@ struct tl_type {
*/
#define TL_MAXFRAGS 10
-#define TL_RX_LIST_CNT 20
-#define TL_TX_LIST_CNT 20
+#define TL_RX_LIST_CNT 10
+#define TL_TX_LIST_CNT 10
#define TL_MIN_FRAMELEN 64
struct tl_frag {
@@ -141,7 +141,7 @@ struct tl_softc {
/*
* Transmit interrupt threshold.
*/
-#define TX_THR 0x00000004
+#define TX_THR 0x00000001
#define TL_FLAG_FORCEDELAY 1
#define TL_FLAG_SCHEDDELAY 2
diff --git a/sys/pci/if_tx.c b/sys/pci/if_tx.c
index a79ebebf602c8..56a176ba8f74f 100644
--- a/sys/pci/if_tx.c
+++ b/sys/pci/if_tx.c
@@ -1,6 +1,3 @@
-/* $OpenBSD: if_tx.c,v 1.3 1998/10/10 04:30:09 jason Exp $ */
-/* $Id: if_tx.c,v 1.19 1998/12/09 01:12:18 eivind Exp $ */
-
/*-
* Copyright (c) 1997 Semen Ustimenko (semen@iclub.nsu.ru)
* All rights reserved.
@@ -26,27 +23,30 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * $Id: if_tx.c,v 1.14 1998/07/13 09:53:07 bde Exp $
*
*/
/*
* EtherPower II 10/100 Fast Ethernet (tx0)
* (aka SMC9432TX based on SMC83c170 EPIC chip)
- *
- * Thanks are going to Steve Bauer and Jason Wright.
*
- * todo:
+ * TODO:
+ * Deal with TX threshold (probably we should calculate it depending
+ * on processor speed, as did the MS-DOS driver).
* Deal with bus mastering, i.e. i realy don't know what to do with
* it and how it can improve performance.
* Implement FULL IFF_MULTICAST support.
- * Test, test and test again:-(
+ * Calculate optimal RX and TX rings size.
+ * Test, test and test again:-)
*
*/
-/* We should define compile time options before if_txvar.h included */
+/* We should define compile time options before smc83c170.h included */
/*#define EPIC_NOIFMEDIA 1*/
/*#define EPIC_USEIOSPACE 1*/
-#define EARLY_RX 1
+/*#define EARLY_RX 1*/
+/*#define EARLY_TX 1*/
/*#define EPIC_DEBUG 1*/
#if defined(EPIC_DEBUG)
@@ -67,65 +67,20 @@
} \
}
-#include "bpfilter.h"
#include "pci.h"
-
#if NPCI > 0
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
+#include <sys/socket.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
-#include <sys/socket.h>
#include <sys/sockio.h>
-
#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-
-#if !defined(SIOCSIFMEDIA) || defined(EPIC_NOIFMEDIA)
-#define EPIC_NOIFMEDIA 1
-#else
+#if defined(SIOCSIFMEDIA) && !defined(EPIC_NOIFMEDIA)
#include <net/if_media.h>
#endif
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#endif
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-#ifdef NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-#endif
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#include <net/bpfdesc.h>
-#endif
-
-#if defined(__OpenBSD__)
-#include <sys/ioctl.h>
-#include <sys/errno.h>
-#include <sys/device.h>
-
-#include <netinet/if_ether.h>
-
-#include <vm/vm.h>
-
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcidevs.h>
-
-#include <dev/pci/if_txvar.h>
-#else /* __FreeBSD__ */
#include <net/if_mib.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
@@ -134,492 +89,51 @@
#include <machine/clock.h>
#include <pci/pcivar.h>
-#include <pci/if_txvar.h>
-#endif
-
-#if defined(__FreeBSD__)
-#if __FreeBSD_version >= 300000
-#define EPIC_IFIOCTL_CMD_TYPE u_long
-#else
-#define EPIC_IFIOCTL_CMD_TYPE int
-#endif
-#define EPIC_INTR_RET_TYPE void
-#else /* __OpenBSD__ */
-#define EPIC_IFIOCTL_CMD_TYPE u_long
-#define EPIC_INTR_RET_TYPE int
-#endif
-
-static int epic_ifioctl __P((register struct ifnet *, EPIC_IFIOCTL_CMD_TYPE, caddr_t));
-static EPIC_INTR_RET_TYPE epic_intr __P((void *));
-static int epic_common_attach __P((epic_softc_t *));
-static void epic_ifstart __P((struct ifnet * const));
-static void epic_ifwatchdog __P((struct ifnet *));
-static int epic_init __P((epic_softc_t *));
-static void epic_stop __P((epic_softc_t *));
-static __inline void epic_rx_done __P((epic_softc_t *));
-static __inline void epic_tx_done __P((epic_softc_t *));
-static int epic_init_rings __P((epic_softc_t *));
-static void epic_free_rings __P((epic_softc_t *));
-static void epic_stop_activity __P((epic_softc_t *));
-static void epic_start_activity __P((epic_softc_t *));
-static void epic_set_rx_mode __P((epic_softc_t *));
-static void epic_set_tx_mode __P((epic_softc_t *));
-static void epic_set_mc_table __P((epic_softc_t *));
-static void epic_set_media_speed __P((epic_softc_t *));
-static void epic_init_phy __P((epic_softc_t *));
-static void epic_dump_state __P((epic_softc_t *));
-static int epic_autoneg __P((epic_softc_t *));
-static int epic_read_eeprom __P((epic_softc_t *,u_int16_t));
-static void epic_output_eepromw __P((epic_softc_t *, u_int16_t));
-static u_int16_t epic_input_eepromw __P((epic_softc_t *));
-static u_int8_t epic_eeprom_clock __P((epic_softc_t *,u_int8_t));
-static void epic_write_eepromreg __P((epic_softc_t *,u_int8_t));
-static u_int8_t epic_read_eepromreg __P((epic_softc_t *));
-static u_int16_t epic_read_phy_register __P((epic_softc_t *, u_int16_t));
-static void epic_write_phy_register __P((epic_softc_t *, u_int16_t, u_int16_t));
-
-#if !defined(EPIC_NOIFMEDIA)
-static int epic_ifmedia_change __P((struct ifnet *));
-static void epic_ifmedia_status __P((struct ifnet *, struct ifmediareq *));
-#endif
-
-/* -------------------------------------------------------------------------
- OS-specific part
- ------------------------------------------------------------------------- */
-
-#if defined(__OpenBSD__)
-/* -----------------------------OpenBSD------------------------------------- */
-
-static int epic_openbsd_probe __P((struct device *,void *,void *));
-static void epic_openbsd_attach __P((struct device *, struct device *, void *));
-static void epic_shutdown __P((void *));
-
-struct cfattach tx_ca = {
- sizeof(epic_softc_t), epic_openbsd_probe, epic_openbsd_attach
-};
-struct cfdriver tx_cd = {
- NULL,"tx",DV_IFNET
-};
-
-/* Synopsis: Check if device id corresponds with SMC83C170 id. */
-static int
-epic_openbsd_probe(
- struct device *parent,
- void *match,
- void *aux )
-{
- struct pci_attach_args *pa = aux;
- if( PCI_VENDOR(pa->pa_id) != SMC_VENDORID )
- return 0;
-
- if( PCI_PRODUCT(pa->pa_id) == CHIPID_83C170 )
- return 1;
-
- return 0;
-}
-
-static void
-epic_openbsd_attach(
- struct device *parent,
- struct device *self,
- void *aux )
-{
- epic_softc_t *sc = (epic_softc_t*)self;
- struct pci_attach_args *pa = aux;
- pci_chipset_tag_t pc = pa->pa_pc;
- pci_intr_handle_t ih;
- const char *intrstr = NULL;
- struct ifnet *ifp;
- bus_space_tag_t iot = pa->pa_iot;
- bus_addr_t iobase;
- bus_size_t iosize;
- int i;
-#if !defined(EPIC_NOIFMEDIA)
- int tmp;
-#endif
-
- if( pci_io_find(pc, pa->pa_tag, PCI_CBIO, &iobase, &iosize)) {
- printf(": can't find i/o space\n");
- return;
- }
- if( bus_space_map(iot, iobase, iosize, 0, &sc->sc_sh)) {
- printf(": can't map i/o space\n");
- return;
- }
- sc->sc_st = iot;
-
- ifp = &sc->sc_if;
- bcopy(sc->sc_dev.dv_xname, ifp->if_xname,IFNAMSIZ);
- ifp->if_softc = sc;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = epic_ifioctl;
- ifp->if_start = epic_ifstart;
- ifp->if_watchdog = epic_ifwatchdog;
-
- /* Do common attach procedure */
- if( epic_common_attach(sc) ) return;
-
- /* Map interrupt */
- if( pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,
- pa->pa_intrline, &ih)) {
- printf(": can't map interrupt\n");
- return;
- }
- intrstr = pci_intr_string(pc, ih);
- sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, epic_intr, sc,
- self->dv_xname);
-
- if( NULL == sc->sc_ih ) {
- printf(": can't establish interrupt");
- if( intrstr )printf(" at %s",intrstr);
- printf("\n");
- return;
- }
- printf(": %s",intrstr);
-
- /* Display some info */
- printf(" address %s",ether_sprintf(sc->sc_macaddr));
- /* Read current media config and display it too */
- i = PHY_READ_2( sc, DP83840_BMCR );
-#if !defined(EPIC_NOIFMEDIA)
- tmp = IFM_ETHER;
-#endif
- if( i & BMCR_AUTONEGOTIATION ){
- printf(", Auto-Neg ");
+#include <pci/smc83c170.h>
- /* To avoid bug in QS6612 read LPAR enstead of BMSR */
- i = PHY_READ_2( sc, DP83840_LPAR );
- if( i & (ANAR_100_TX|ANAR_100_TX_FD) ) printf("100Mbps");
- else printf("10Mbps");
- if( i & (ANAR_10_FD|ANAR_100_TX_FD) ) printf(" FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_AUTO;
-#endif
- } else {
-#if defined(EPIC_NOIFMEDIA)
- ifp->if_flags |= IFF_LINK0;
-#endif
- if( i & BMCR_100MBPS ) {
- printf(", 100Mbps");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_100_TX;
-#else
- ifp->if_flags |= IFF_LINK2;
-#endif
- } else {
- printf(", 10Mbps");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_10_T;
-#endif
- }
- if( i & BMCR_FULL_DUPLEX ) {
- printf(" FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_FDX;
-#else
- ifp->if_flags |= IFF_LINK1;
-#endif
- }
- }
-
- /* Init ifmedia interface */
-#if !defined(EPIC_NOIFMEDIA)
- ifmedia_init(&sc->ifmedia,0,epic_ifmedia_change,epic_ifmedia_status);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_AUTO,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_LOOP,0,NULL);
- ifmedia_set(&sc->ifmedia, tmp);
-#endif
-
- /* Attach os interface and bpf */
- if_attach(ifp);
- ether_ifattach(ifp);
+#include "bpfilter.h"
#if NBPFILTER > 0
- bpfattach(&sc->sc_if.if_bpf, ifp, DLT_EN10MB,
- sizeof(struct ether_header));
+#include <net/bpf.h>
#endif
- /* Set shutdown routine to stop DMA process */
- shutdownhook_establish(epic_shutdown, sc);
- printf("\n");
-}
-
-/* Simple call epic_stop() */
-static void
-epic_shutdown(
- void *sc)
-{
- epic_stop(sc);
-}
-
-#else /* __FreeBSD__ */
-/* -----------------------------FreeBSD------------------------------------- */
-
-static const char* epic_freebsd_probe __P((pcici_t, pcidi_t));
-static void epic_freebsd_attach __P((pcici_t, int));
-static void epic_shutdown __P((int, void *));
-
-/* Global variables */
+/*
+ * Global variables
+ */
static u_long epic_pci_count;
static struct pci_device txdevice = {
"tx",
- epic_freebsd_probe,
- epic_freebsd_attach,
+ epic_pci_probe,
+ epic_pci_attach,
&epic_pci_count,
NULL };
-/* Append this driver to pci drivers list */
-DATA_SET ( pcidevice_set, txdevice );
-
-/* Synopsis: Check if device id corresponds with SMC83C170 id. */
-static const char*
-epic_freebsd_probe(
- pcici_t config_id,
- pcidi_t device_id)
-{
- if( PCI_VENDORID(device_id) != SMC_VENDORID )
- return NULL;
-
- if( PCI_CHIPID(device_id) == CHIPID_83C170 )
- return "SMC 83c170";
-
- return NULL;
-}
-
/*
- * Do FreeBSD-specific attach routine, like map registers, alloc softc
- * structure and etc.
+ * Append this driver to pci drivers list
*/
-static void
-epic_freebsd_attach(
- pcici_t config_id,
- int unit)
-{
- struct ifnet *ifp;
- epic_softc_t *sc;
-#if defined(EPIC_USEIOSPACE)
- u_int32_t iobase;
-#else
- caddr_t pmembase;
-#endif
- int i,s,tmp;
-
- printf("tx%d",unit);
-
- /* Allocate memory for softc, hardware descriptors and frag lists */
- sc = (epic_softc_t *) malloc( sizeof(epic_softc_t), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) return;
-
- /* Preinitialize softc structure */
- bzero(sc, sizeof(epic_softc_t));
- sc->unit = unit;
-
- /* Fill ifnet structure */
- ifp = &sc->sc_if;
- ifp->if_unit = unit;
- ifp->if_name = "tx";
- ifp->if_softc = sc;
- ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST;
- ifp->if_ioctl = epic_ifioctl;
- ifp->if_start = epic_ifstart;
- ifp->if_watchdog = epic_ifwatchdog;
- ifp->if_init = (if_init_f_t*)epic_init;
- ifp->if_timer = 0;
- ifp->if_output = ether_output;
-
- /* Get iobase or membase */
-#if defined(EPIC_USEIOSPACE)
- if (!pci_map_port(config_id, PCI_CBIO,(u_short *) &(sc->iobase))) {
- printf(": cannot map port\n");
- free(sc, M_DEVBUF);
- return;
- }
-#else
- if (!pci_map_mem(config_id, PCI_CBMA,(vm_offset_t *) &(sc->csr),(vm_offset_t *) &pmembase)) {
- printf(": cannot map memory\n");
- free(sc, M_DEVBUF);
- return;
- }
-#endif
-
- if( epic_common_attach(sc) ) return;
-
- /* Display ethernet address ,... */
- printf(": address %02x:%02x:%02x:%02x:%02x:%02x,",
- sc->sc_macaddr[0],sc->sc_macaddr[1],sc->sc_macaddr[2],
- sc->sc_macaddr[3],sc->sc_macaddr[4],sc->sc_macaddr[5]);
-
- /* board type and ... */
- printf(" type ");
- for(i=0x2c;i<0x32;i++) {
- tmp = epic_read_eeprom( sc, i );
- if( ' ' == (u_int8_t)tmp ) break;
- printf("%c",(u_int8_t)tmp);
- tmp >>= 8;
- if( ' ' == (u_int8_t)tmp ) break;
- printf("%c",(u_int8_t)tmp);
- }
-
- /* Read current media config and display it too */
- i = PHY_READ_2( sc, DP83840_BMCR );
-#if !defined(EPIC_NOIFMEDIA)
- tmp = IFM_ETHER;
-#endif
- if( i & BMCR_AUTONEGOTIATION ){
- printf(", Auto-Neg ");
-
- /* To avoid bug in QS6612 read LPAR enstead of BMSR */
- i = PHY_READ_2( sc, DP83840_LPAR );
- if( i & (ANAR_100_TX|ANAR_100_TX_FD) ) printf("100Mbps ");
- else printf("10Mbps ");
- if( i & (ANAR_10_FD|ANAR_100_TX_FD) ) printf("FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_AUTO;
-#endif
- } else {
-#if defined(EPIC_NOIFMEDIA)
- ifp->if_flags |= IFF_LINK0;
-#endif
- if( i & BMCR_100MBPS ) {
- printf(", 100Mbps ");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_100_TX;
-#else
- ifp->if_flags |= IFF_LINK2;
-#endif
- } else {
- printf(", 10Mbps ");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_10_T;
-#endif
- }
- if( i & BMCR_FULL_DUPLEX ) {
- printf("FD");
-#if !defined(EPIC_NOIFMEDIA)
- tmp |= IFM_FDX;
-#else
- ifp->if_flags |= IFF_LINK1;
-#endif
- }
- }
-
- /* Init ifmedia interface */
-#if !defined(EPIC_NOIFMEDIA)
- ifmedia_init(&sc->ifmedia,0,epic_ifmedia_change,epic_ifmedia_status);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_LOOP,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_FDX,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_AUTO,0,NULL);
- ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_LOOP,0,NULL);
- ifmedia_set(&sc->ifmedia, tmp);
-#endif
-
- s = splimp();
-
- /* Map interrupt */
- if( !pci_map_int(config_id, epic_intr, (void*)sc, &net_imask) ) {
- printf(": couldn't map interrupt\n");
- free(sc, M_DEVBUF);
- return;
- }
-
- /* Set shut down routine to stop DMA processes on reboot */
- at_shutdown(epic_shutdown, sc, SHUTDOWN_POST_SYNC);
-
- /* Attach to if manager */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp,DLT_EN10MB, sizeof(struct ether_header));
-#endif
-
- splx(s);
-
- printf("\n");
-
- return;
-}
-
-static void
-epic_shutdown(
- int howto,
- void *sc)
-{
- epic_stop(sc);
-}
-
-#endif /* __OpenBSD__ */
-
-/* ------------------------------------------------------------------------
- OS-independing part
- ------------------------------------------------------------------------ */
+DATA_SET ( pcidevice_set, txdevice );
/*
- * This is if_ioctl handler.
+ * ifioctl function
+ *
+ * splimp() invoked here
*/
static int
epic_ifioctl __P((
register struct ifnet * ifp,
- EPIC_IFIOCTL_CMD_TYPE command,
- caddr_t data))
+ u_long command, caddr_t data))
{
epic_softc_t *sc = ifp->if_softc;
+ struct ifreq *ifr = (struct ifreq *) data;
int x, error = 0;
x = splimp();
switch (command) {
-#if defined(__FreeBSD__)
+
case SIOCSIFADDR:
case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
+ ether_ioctl(ifp, command, data);
break;
-#else /* __OpenBSD__ */
- case SIOCSIFADDR: {
- struct ifaddr *ifa = (struct ifaddr *)data;
-
- ifp->if_flags |= IFF_UP;
- switch(ifa->ifa_addr->sa_family) {
-#if INET
- case AF_INET:
- epic_stop(sc);
- epic_init(sc);
- arp_ifinit(&sc->arpcom,ifa);
- break;
-#endif /* __FreeBSD__ */
-#if NS
- case AF_NS: {
- register struct ns_addr * ina = &IA_SNS(ifa)->sns_addr;
-
- if( ns_nullhost(*ina) )
- ina->x_host =
- *(union ns_host *) LLADDR(ifp->if_sadl);
- else
- bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),
- ifp->if_addrlen);
-
- epic_stop(sc);
- epic_init(sc);
- break;
- }
-#endif
- default:
- epic_stop(sc);
- epic_init(sc);
- break;
- }
- }
-#endif
case SIOCSIFFLAGS:
/*
@@ -641,22 +155,24 @@ epic_ifioctl __P((
/* Handle IFF_PROMISC flag */
epic_set_rx_mode(sc);
-#if defined(EPIC_NOIFMEDIA)
+#if !defined(_NET_IF_MEDIA_H_)
/* Handle IFF_LINKx flags */
epic_set_media_speed(sc);
#endif
+
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
+
/* Update out multicast list */
#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
epic_set_mc_table(sc);
error = 0;
#else
error = (command == SIOCADDMULTI) ?
- ether_addmulti((struct ifreq *)data, &sc->arpcom) :
- ether_delmulti((struct ifreq *)data, &sc->arpcom);
+ ether_addmulti(ifr, &sc->epic_ac) :
+ ether_delmulti(ifr, &sc->epic_ac);
if (error == ENETRESET) {
epic_set_mc_table(sc);
@@ -665,11 +181,21 @@ epic_ifioctl __P((
#endif
break;
-#if !defined(EPIC_NOIFMEDIA)
+ case SIOCSIFMTU:
+ /*
+ * Set the interface MTU.
+ */
+ if (ifr->ifr_mtu > ETHERMTU) {
+ error = EINVAL;
+ } else {
+ ifp->if_mtu = ifr->ifr_mtu;
+ }
+ break;
+
+#if defined(_NET_IF_MEDIA_H_)
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
- error = ifmedia_ioctl(ifp, (struct ifreq *)data,
- &sc->ifmedia, command);
+ error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
break;
#endif
@@ -682,65 +208,9 @@ epic_ifioctl __P((
}
/*
- * OS-independed part of attach process. allocate memory for descriptors
- * and frag lists, wake up chip, read MAC address and PHY identyfier.
- * Return -1 on failure.
- */
-static int
-epic_common_attach(
- epic_softc_t *sc)
-{
- int i;
- caddr_t pool;
-
- i = sizeof(struct epic_frag_list)*TX_RING_SIZE +
- sizeof(struct epic_rx_desc)*RX_RING_SIZE +
- sizeof(struct epic_tx_desc)*TX_RING_SIZE + PAGE_SIZE,
- sc->pool = (epic_softc_t *) malloc( i, M_DEVBUF, M_NOWAIT);
-
- if (sc->pool == NULL) {
- printf(": can't allocate memory for buffers\n");
- return -1;
- }
- bzero(sc->pool, i);
-
- /* Align pool on PAGE_SIZE */
- pool = (caddr_t)sc->pool;
- pool = (caddr_t)((u_int32_t)(pool + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1));
-
- /* Distribute memory */
- sc->tx_flist = (void *)pool;
- pool += sizeof(struct epic_frag_list)*TX_RING_SIZE;
- sc->rx_desc = (void *)pool;
- pool += sizeof(struct epic_rx_desc)*RX_RING_SIZE;
- sc->tx_desc = (void *)pool;
-
- /* Bring the chip out of low-power mode. */
- CSR_WRITE_4( sc, GENCTL, 0x0000 );
-
- /* Magic?! If we don't set this bit the MII interface won't work. */
- CSR_WRITE_4( sc, TEST1, 0x0008 );
-
- /* Read mac address from EEPROM */
- for (i = 0; i < ETHER_ADDR_LEN / sizeof(u_int16_t); i++)
- ((u_int16_t *)sc->sc_macaddr)[i] = epic_read_eeprom(sc,i);
-
- /* Identify PHY */
- sc->phyid = PHY_READ_2(sc, DP83840_PHYIDR1 )<<6;
- sc->phyid|= (PHY_READ_2( sc, DP83840_PHYIDR2 )>>10)&0x3F;
- if( QS6612_OUI != sc->phyid )
- printf(": WARNING! PHY unknown (0x%x)",sc->phyid);
-
- sc->tx_threshold = TRANSMIT_THRESHOLD;
- sc->txcon = TXCON_DEFAULT;
-
- return 0;
-}
-
-/*
- * This is if_start handler. It takes mbufs from if_snd queue
- * and quque them for transmit, one by one, until TX ring become full
- * or quque become empty.
+ * ifstart function
+ *
+ * splimp() assumed to be done
*/
static void
epic_ifstart(struct ifnet * const ifp){
@@ -748,17 +218,19 @@ epic_ifstart(struct ifnet * const ifp){
struct epic_tx_buffer *buf;
struct epic_tx_desc *desc;
struct epic_frag_list *flist;
- struct mbuf *m0;
- register struct mbuf *m;
- register int i;
+ struct mbuf *m,*m0;
- /* If no link is established, simply free all mbufs in queue */
+#if defined(EPIC_DEBUG)
+ if( sc->epic_if.if_flags & IFF_DEBUG ) epic_dump_state(sc);
+#endif
+ /* If no link is established, */
+ /* simply free all mbufs in queue */
PHY_READ_2( sc, DP83840_BMSR );
if( !(BMSR_LINK_STATUS & PHY_READ_2( sc, DP83840_BMSR )) ){
- IF_DEQUEUE( &ifp->if_snd, m0 );
+ IF_DEQUEUE( &(sc->epic_if.if_snd), m0 );
while( m0 ) {
m_freem(m0);
- IF_DEQUEUE( &ifp->if_snd, m0 );
+ IF_DEQUEUE( &(sc->epic_if.if_snd), m0 );
}
return;
}
@@ -770,46 +242,44 @@ epic_ifstart(struct ifnet * const ifp){
flist = sc->tx_flist + sc->cur_tx;
/* Get next packet to send */
- IF_DEQUEUE( &ifp->if_snd, m0 );
+ IF_DEQUEUE( &(sc->epic_if.if_snd), m0 );
/* If nothing to send, return */
if( NULL == m0 ) return;
/* If descriptor is busy, set IFF_OACTIVE and exit */
if( desc->status & 0x8000 ) {
- dprintf((EPIC_FORMAT ": desc is busy in ifstart, up and down interface please\n",EPIC_ARGS(sc)));
+ dprintf(("\ntx%d: desc is busy in ifstart, up and down interface please",sc->unit));
break;
}
if( buf->mbuf ) {
- dprintf((EPIC_FORMAT ": mbuf not freed in ifstart, up and down interface plase\n",EPIC_ARGS(sc)));
+ dprintf(("\ntx%d: mbuf not freed in ifstart, up and down interface plase",sc->unit));
break;
}
/* Fill fragments list */
- for( m=m0, i=0;
- (NULL != m) && (i < EPIC_MAX_FRAGS);
- m = m->m_next, i++ ) {
- flist->frag[i].fraglen = m->m_len;
- flist->frag[i].fragaddr = vtophys( mtod(m, caddr_t) );
+ flist->numfrags = 0;
+ for(m=m0;(NULL!=m)&&(flist->numfrags<63);m=m->m_next) {
+ flist->frag[flist->numfrags].fraglen = m->m_len;
+ flist->frag[flist->numfrags].fragaddr = vtophys( mtod(m, caddr_t) );
+ flist->numfrags++;
}
- flist->numfrags = i;
- /* If packet was more than EPIC_MAX_FRAGS parts, */
+ /* If packet was more than 63 parts, */
/* recopy packet to new allocated mbuf cluster */
if( NULL != m ){
EPIC_MGETCLUSTER(m);
if( NULL == m ){
- printf(EPIC_FORMAT ": cannot allocate mbuf cluster\n",EPIC_ARGS(sc));
+ printf("\ntx%d: cannot allocate mbuf cluster",sc->unit);
m_freem(m0);
- ifp->if_oerrors++;
+ sc->epic_if.if_oerrors++;
continue;
}
m_copydata( m0, 0, m0->m_pkthdr.len, mtod(m,caddr_t) );
- flist->frag[0].fraglen =
- m->m_pkthdr.len = m->m_len = m0->m_pkthdr.len;
- m->m_pkthdr.rcvif = ifp;
+ flist->frag[0].fraglen = m->m_pkthdr.len = m->m_len = m0->m_pkthdr.len;
+ m->m_pkthdr.rcvif = &sc->epic_if;
flist->numfrags = 1;
flist->frag[0].fragaddr = vtophys( mtod(m, caddr_t) );
@@ -817,29 +287,40 @@ epic_ifstart(struct ifnet * const ifp){
m0 = m;
}
+ /* Save mbuf */
buf->mbuf = m0;
+
+ /* Packet queued successful */
sc->pending_txs++;
- sc->cur_tx = ( sc->cur_tx + 1 ) & TX_RING_MASK;
+
+ /* Switch to next descriptor */
+ sc->cur_tx = ( sc->cur_tx + 1 ) % TX_RING_SIZE;
+
+ /* Does not generate TXC */
desc->control = 0x01;
- desc->txlength =
- max(m0->m_pkthdr.len,ETHER_MIN_LEN-ETHER_CRC_LEN);
+
+ /* Packet should be at least ETHER_MIN_LEN */
+ desc->txlength = max(m0->m_pkthdr.len,ETHER_MIN_LEN-ETHER_CRC_LEN);
+
+ /* Pass ownership to the chip */
desc->status = 0x8000;
+
+ /* Trigger an immediate transmit demand. */
CSR_WRITE_4( sc, COMMAND, COMMAND_TXQUEUED );
+#if defined(EPIC_DEBUG)
+ if( sc->epic_if.if_flags & IFF_DEBUG ) epic_dump_state(sc);
+#endif
+
/* Set watchdog timer */
ifp->if_timer = 8;
#if NBPFILTER > 0
- if( ifp->if_bpf )
-#if defined(__FreeBSD__)
- bpf_mtap( ifp, m0 );
-#else /* __OpenBSD__ */
- bpf_mtap( ifp->if_bpf, m0 );
-#endif /* __FreeBSD__ */
+ if( ifp->if_bpf ) bpf_mtap( ifp, m0 );
#endif
}
- ifp->if_flags |= IFF_OACTIVE;
+ sc->epic_if.if_flags |= IFF_OACTIVE;
return;
@@ -853,25 +334,28 @@ static __inline void
epic_rx_done __P((
epic_softc_t *sc ))
{
+ int i = 0;
u_int16_t len;
struct epic_rx_buffer *buf;
struct epic_rx_desc *desc;
struct mbuf *m;
struct ether_header *eh;
- while( !(sc->rx_desc[sc->cur_rx].status & 0x8000) ) {
+ while( !(sc->rx_desc[sc->cur_rx].status & 0x8000) && \
+ i++ < RX_RING_SIZE ) {
+
buf = sc->rx_buffer + sc->cur_rx;
desc = sc->rx_desc + sc->cur_rx;
/* Switch to next descriptor */
- sc->cur_rx = (sc->cur_rx+1) & RX_RING_MASK;
+ sc->cur_rx = (sc->cur_rx+1) % RX_RING_SIZE;
/* Check for errors, this should happend */
/* only if SAVE_ERRORED_PACKETS is set, */
/* normaly rx errors generate RXE interrupt */
if( !(desc->status & 1) ) {
- dprintf((EPIC_FORMAT ": Rx error status: 0x%x\n",EPIC_ARGS(sc),desc->status));
- sc->sc_if.if_ierrors++;
+ dprintf(("\ntx%d: Rx error status: 0x%x",sc->unit,desc->status));
+ sc->epic_if.if_ierrors++;
desc->status = 0x8000;
continue;
}
@@ -883,10 +367,10 @@ epic_rx_done __P((
/* Try to get mbuf cluster */
EPIC_MGETCLUSTER( buf->mbuf );
if( NULL == buf->mbuf ) {
- printf(EPIC_FORMAT ": cannot allocate mbuf cluster\n",EPIC_ARGS(sc));
+ printf("\ntx%d: cannot allocate mbuf cluster",sc->unit);
buf->mbuf = m;
desc->status = 0x8000;
- sc->sc_if.if_ierrors++;
+ sc->epic_if.if_ierrors++;
continue;
}
@@ -896,21 +380,16 @@ epic_rx_done __P((
/* First mbuf in packet holds the ethernet and packet headers */
eh = mtod( m, struct ether_header * );
- m->m_pkthdr.rcvif = &(sc->sc_if);
+ m->m_pkthdr.rcvif = &(sc->epic_if);
m->m_pkthdr.len = m->m_len = len;
#if NBPFILTER > 0
/* Give mbuf to BPFILTER */
- if( sc->sc_if.if_bpf )
-#if defined(__FreeBSD__)
- bpf_mtap( &sc->sc_if, m );
-#else /* __OpenBSD__ */
- bpf_mtap( sc->sc_if.if_bpf, m );
-#endif /* __FreeBSD__ */
+ if( sc->epic_if.if_bpf ) bpf_mtap( &sc->epic_if, m );
/* Accept only our packets, broadcasts and multicasts */
if( (eh->ether_dhost[0] & 1) == 0 &&
- bcmp(eh->ether_dhost,sc->sc_macaddr,ETHER_ADDR_LEN)){
+ bcmp(eh->ether_dhost,sc->epic_ac.ac_enaddr,ETHER_ADDR_LEN)){
m_freem(m);
continue;
}
@@ -921,10 +400,10 @@ epic_rx_done __P((
m->m_data += sizeof( struct ether_header );
/* Give mbuf to OS */
- ether_input(&sc->sc_if, eh, m);
+ ether_input(&sc->epic_if, eh, m);
/* Successfuly received frame */
- sc->sc_if.if_ipackets++;
+ sc->epic_if.if_ipackets++;
}
return;
@@ -956,22 +435,22 @@ epic_tx_done __P((
/* Packet is transmitted. Switch to next and */
/* free mbuf */
sc->pending_txs--;
- sc->dirty_tx = (sc->dirty_tx + 1) & TX_RING_MASK;
+ sc->dirty_tx = (sc->dirty_tx + 1) % TX_RING_SIZE;
m_freem( buf->mbuf );
buf->mbuf = NULL;
/* Check for errors and collisions */
- if( status & 0x0001 ) sc->sc_if.if_opackets++;
- else sc->sc_if.if_oerrors++;
- sc->sc_if.if_collisions += (status >> 8) & 0x1F;
+ if( status & 0x0001 ) sc->epic_if.if_opackets++;
+ else sc->epic_if.if_oerrors++;
+ sc->epic_if.if_collisions += (status >> 8) & 0x1F;
#if defined(EPIC_DEBUG)
if( (status & 0x1001) == 0x1001 )
- dprintf((EPIC_FORMAT ": frame not transmitted due collisions\n",EPIC_ARGS(sc)));
+ dprintf(("\ntx%d: frame not transmitted due collisions",sc->unit));
#endif
}
if( sc->pending_txs < TX_RING_SIZE )
- sc->sc_if.if_flags &= ~IFF_OACTIVE;
+ sc->epic_if.if_flags &= ~IFF_OACTIVE;
}
/*
@@ -979,137 +458,122 @@ epic_tx_done __P((
*
* splimp() assumed to be done
*/
-static EPIC_INTR_RET_TYPE
-epic_intr (
+static void
+epic_intr_normal(
void *arg)
{
- epic_softc_t * sc = (epic_softc_t *) arg;
- int status,i=4;
-#if defined(__OpenBSD__)
- int claimed = 0;
-#endif
-
+ epic_softc_t * sc = (epic_softc_t *) arg;
+ int status,i=4;
- while( i-- && ((status = CSR_READ_4(sc, INTSTAT)) & INTSTAT_INT_ACTV) ){
-#if defined(__OpenBSD__)
- claimed = 1;
-#endif
+do {
+ status = CSR_READ_4( sc, INTSTAT );
CSR_WRITE_4( sc, INTSTAT, status );
if( status & (INTSTAT_RQE|INTSTAT_RCC|INTSTAT_OVW) ) {
- epic_rx_done( sc );
- if( status & (INTSTAT_RQE|INTSTAT_OVW) ){
+ epic_rx_done( sc );
+ if( status & (INTSTAT_RQE|INTSTAT_OVW) ){
#if defined(EPIC_DEBUG)
- if( status & INTSTAT_OVW )
- printf(EPIC_FORMAT ": RX buffer overflow\n",EPIC_ARGS(sc));
- if( status & INTSTAT_RQE )
- printf(EPIC_FORMAT ": RX FIFO overflow\n",EPIC_ARGS(sc));
- if( sc->sc_if.if_flags & IFF_DEBUG )
- epic_dump_state(sc);
+ if( status & INTSTAT_OVW )
+ printf("\ntx%d: Rx buffer overflowed",sc->unit);
+ if( status & INTSTAT_RQE )
+ printf("\ntx%d: Rx FIFO overflowed",sc->unit);
+ if( sc->epic_if.if_flags & IFF_DEBUG )
+ epic_dump_state(sc);
#endif
- if( !(CSR_READ_4( sc, COMMAND ) & COMMAND_RXQUEUED) )
- CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED );
- sc->sc_if.if_ierrors++;
- }
- }
+ if( !(CSR_READ_4( sc, COMMAND ) & COMMAND_RXQUEUED) )
+ CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED );
+ sc->epic_if.if_ierrors++;
+ }
+ }
- if( status & (INTSTAT_TXC|INTSTAT_TCC|INTSTAT_TQE) ) {
- epic_tx_done( sc );
- if(!(sc->sc_if.if_flags & IFF_OACTIVE) &&
- sc->sc_if.if_snd.ifq_head )
- epic_ifstart( &sc->sc_if );
+ if( status & (INTSTAT_TXC|INTSTAT_TCC|INTSTAT_TQE) ) {
+ epic_tx_done( sc );
+#if defined(EPIC_DEBUG)
+ if( (status & (INTSTAT_TQE | INTSTAT_TCC)) && (sc->pending_txs > 1) )
+ printf("\ntx%d: %d packets pending after TQE/TCC",sc->unit,sc->pending_txs);
+#endif
+ if( !(sc->epic_if.if_flags & IFF_OACTIVE) && sc->epic_if.if_snd.ifq_head )
+ epic_ifstart( &sc->epic_if );
}
- if( (status & INTSTAT_GP2) && (QS6612_OUI == sc->phyid) ) {
- u_int32_t phystatus = PHY_READ_2( sc, QS6612_INTSTAT );
+ if( (status & INTSTAT_GP2) && (QS6612_OUI == sc->phyid) ) {
+ u_int32_t phystatus;
+
+ phystatus = PHY_READ_2( sc, QS6612_INTSTAT );
- if( phystatus & INTSTAT_AN_COMPLETE ) {
- u_int32_t bmcr;
- if( epic_autoneg(sc) == EPIC_FULL_DUPLEX ) {
- bmcr = BMCR_FULL_DUPLEX | PHY_READ_2( sc, DP83840_BMCR );
- sc->txcon |= TXCON_FULL_DUPLEX;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ if( phystatus & INTSTAT_AN_COMPLETE ) {
+ u_int32_t bmcr;
+ if( epic_autoneg(sc) == EPIC_FULL_DUPLEX ) {
+ bmcr = BMCR_FULL_DUPLEX | PHY_READ_2( sc, DP83840_BMCR );
+ CSR_WRITE_4( sc, TXCON, TXCON_FULL_DUPLEX | TXCON_DEFAULT );
+ } else {
+ /* Default to half-duplex */
+ bmcr = ~BMCR_FULL_DUPLEX & PHY_READ_2( sc, DP83840_BMCR );
+ CSR_WRITE_4( sc, TXCON, TXCON_DEFAULT );
+ }
+
+ /* There is apparently QS6612 chip bug: */
+ /* BMCR_FULL_DUPLEX flag is not updated by */
+ /* autonegotiation process, so update it by hands */
+ /* so we can rely on it in epic_ifmedia_status() */
+ PHY_WRITE_2( sc, DP83840_BMCR, bmcr );
+ }
+
+ PHY_READ_2(sc, DP83840_BMSR);
+ if( !(PHY_READ_2(sc, DP83840_BMSR) & BMSR_LINK_STATUS) ) {
+ dprintf(("\ntx%d: WARNING! link down",sc->unit));
+ sc->flags |= EPIC_LINK_DOWN;
} else {
- /* Default to half-duplex */
- bmcr = ~BMCR_FULL_DUPLEX & PHY_READ_2( sc, DP83840_BMCR );
- sc->txcon &= ~TXCON_FULL_DUPLEX;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ dprintf(("\ntx%d: link up",sc->unit));
+ sc->flags &= ~EPIC_LINK_DOWN;
}
- /* There is apparently QS6612 chip bug: */
- /* BMCR_FULL_DUPLEX flag is not updated by */
- /* autonegotiation process, so update it by hands */
- /* so we can rely on it in epic_ifmedia_status() */
- PHY_WRITE_2( sc, DP83840_BMCR, bmcr );
- }
-
- PHY_READ_2(sc, DP83840_BMSR);
- if( !(PHY_READ_2(sc, DP83840_BMSR) & BMSR_LINK_STATUS) ) {
- dprintf((EPIC_FORMAT ": WARNING! link down\n",EPIC_ARGS(sc)));
- sc->flags |= EPIC_LINK_DOWN;
- } else {
- dprintf((EPIC_FORMAT ": link up\n",EPIC_ARGS(sc)));
- sc->flags &= ~EPIC_LINK_DOWN;
- }
-
- /* We should clear GP2 int again after we clear it on PHY */
- CSR_WRITE_4( sc, INTSTAT, INTSTAT_GP2 );
+ /* We should clear GP2 int again after we clear it on PHY */
+ CSR_WRITE_4( sc, INTSTAT, INTSTAT_GP2 );
}
/* Check for errors */
- if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|
- INTSTAT_APE|INTSTAT_DPE|INTSTAT_TXU|INTSTAT_RXE) ){
- if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|
- INTSTAT_APE|INTSTAT_DPE) ){
- printf(EPIC_FORMAT ": PCI fatal error occured (%s%s%s%s)\n",
- EPIC_ARGS(sc),
- (status&INTSTAT_PMA)?"PMA":"",
- (status&INTSTAT_PTA)?" PTA":"",
- (status&INTSTAT_APE)?" APE":"",
- (status&INTSTAT_DPE)?" DPE":""
- );
-
- epic_dump_state(sc);
+ if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|INTSTAT_APE|INTSTAT_DPE|INTSTAT_TXU|INTSTAT_RXE) ){
+ if( status & (INTSTAT_FATAL|INTSTAT_PMA|INTSTAT_PTA|INTSTAT_APE|INTSTAT_DPE) ){
+ printf("\ntx%d: PCI fatal error occured (%s%s%s%s)",
+ sc->unit,
+ (status&INTSTAT_PMA)?"PMA":"",
+ (status&INTSTAT_PTA)?" PTA":"",
+ (status&INTSTAT_APE)?" APE":"",
+ (status&INTSTAT_DPE)?" DPE":""
+ );
+
+ epic_dump_state(sc);
- epic_stop(sc);
- epic_init(sc);
+ epic_stop(sc);
+ epic_init(sc);
- break;
- }
-
- if (status & INTSTAT_RXE) {
- dprintf((EPIC_FORMAT ": CRC/Alignment error\n",EPIC_ARGS(sc)));
- sc->sc_if.if_ierrors++;
- }
-
- /* Tx FIFO underflow. Increase tx threshold, */
- /* if it grown above 2048, disable EARLY_TX */
- if (status & INTSTAT_TXU) {
- if( sc->tx_threshold > 0x800 ) {
- sc->txcon &= ~TXCON_EARLY_TRANSMIT_ENABLE;
- dprintf((EPIC_FORMAT ": TX underrun error, early tx disabled\n",EPIC_ARGS(sc)));
- } else {
- sc->tx_threshold += 0x40;
- dprintf((EPIC_FORMAT ": TX underrun error, tx threshold increased to %d\n",EPIC_ARGS(sc),sc->tx_threshold));
+ return;
}
- epic_stop_activity(sc);
- epic_set_tx_mode(sc);
- epic_start_activity(sc);
- sc->sc_if.if_oerrors++;
+ if (status & INTSTAT_RXE) {
+ dprintf(("\ntx%d: CRC/Alignment error",sc->unit));
+ sc->epic_if.if_ierrors++;
+ }
+
+ /* Tx FIFO underflow. Should not happend if */
+ /* we don't use early tx, handle it anyway */
+ if (status & INTSTAT_TXU) {
+ dprintf(("\ntx%d: Tx underrun error",sc->unit));
+ sc->epic_if.if_oerrors++;
- /* Restart the transmit process. */
- /* CSR_WRITE_4(sc, COMMAND, COMMAND_TXUGO|COMMAND_TXQUEUED); */
- }
+ /* Restart the transmit process. */
+ CSR_WRITE_4(sc, COMMAND, COMMAND_TXUGO | COMMAND_TXQUEUED);
+ }
}
- }
- /* If no packets are pending, thus no timeouts */
- if( sc->pending_txs == 0 ) sc->sc_if.if_timer = 0;
+} while( i-- && (CSR_READ_4(sc, INTSTAT) & INTSTAT_INT_ACTV) );
-#if defined(__OpenBSD__)
- return claimed;
-#endif
+ /* If no packets are pending, thus no timeouts */
+ if( sc->pending_txs == 0 )
+ sc->epic_if.if_timer = 0;
+
+ return;
}
/*
@@ -1128,8 +592,7 @@ epic_ifwatchdog __P((
x = splimp();
- printf(EPIC_FORMAT ": device timeout %d packets, ",
- EPIC_ARGS(sc),sc->pending_txs);
+ printf("\ntx%d: device timeout %d packets, ", sc->unit,sc->pending_txs);
/* Try to finish queued packets */
epic_tx_done( sc );
@@ -1137,35 +600,240 @@ epic_ifwatchdog __P((
/* If not successful */
if( sc->pending_txs > 0 ){
#if defined(EPIC_DEBUG)
- if( ifp->if_flags & IFF_DEBUG ) epic_dump_state(sc);
+ if( sc->epic_if.if_flags & IFF_DEBUG ) epic_dump_state(sc);
#endif
ifp->if_oerrors+=sc->pending_txs;
/* Reinitialize board */
- printf("reinitialization\n");
+ printf("reinitialization");
epic_stop(sc);
epic_init(sc);
} else
- printf("seems we can continue normaly\n");
+ printf("seems we can continue normaly");
/* Start output */
- if( ifp->if_snd.ifq_head ) epic_ifstart( ifp );
+ if( sc->epic_if.if_snd.ifq_head ) epic_ifstart(&sc->epic_if);
splx(x);
}
+/*
+ * Synopsis: Check if PCI id corresponds with board id.
+ */
+static char*
+epic_pci_probe(
+ pcici_t config_id,
+ pcidi_t device_id)
+{
+ if( PCI_VENDORID(device_id) != SMC_VENDORID )
+ return NULL;
+
+ if( PCI_CHIPID(device_id) == CHIPID_83C170 )
+ return "SMC 83c170";
+
+ return NULL;
+}
+
+/*
+ * Synopsis: Allocate memory for softc, descriptors and frag lists.
+ * Connect to interrupt, and get memory/io address of card registers.
+ * Preinitialize softc structure, attach to if manager, ifmedia manager
+ * and bpf. Read media configuration and etc.
+ *
+ * splimp() invoked here
+ */
+static void
+epic_pci_attach(
+ pcici_t config_id,
+ int unit)
+{
+ struct ifnet * ifp;
+ epic_softc_t *sc;
+#if defined(EPIC_USEIOSPACE)
+ u_int32_t iobase;
+#else
+ caddr_t pmembase;
+#endif
+ int i,k,s,tmp;
+ u_int32_t pool;
+
+ /* Allocate memory for softc, hardware descriptors and frag lists */
+ sc = (epic_softc_t *) malloc(
+ sizeof(epic_softc_t) +
+ sizeof(struct epic_frag_list)*TX_RING_SIZE +
+ sizeof(struct epic_rx_desc)*RX_RING_SIZE +
+ sizeof(struct epic_tx_desc)*TX_RING_SIZE + PAGE_SIZE,
+ M_DEVBUF, M_NOWAIT);
+
+ if (sc == NULL) return;
+
+ /* Align pool on PAGE_SIZE */
+ pool = ((u_int32_t)sc) + sizeof(epic_softc_t);
+ pool = (pool + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
+
+ /* Preinitialize softc structure */
+ bzero(sc, sizeof(epic_softc_t));
+ sc->unit = unit;
+
+ /* Fill ifnet structure */
+ ifp = &sc->epic_if;
+ ifp->if_unit = unit;
+ ifp->if_name = "tx";
+ ifp->if_softc = sc;
+ ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST;
+ ifp->if_ioctl = epic_ifioctl;
+ ifp->if_start = epic_ifstart;
+ ifp->if_watchdog = epic_ifwatchdog;
+ ifp->if_init = (if_init_f_t*)epic_init;
+ ifp->if_timer = 0;
+ ifp->if_output = ether_output;
+
+ /* Get iobase or membase */
+#if defined(EPIC_USEIOSPACE)
+ if (!pci_map_port(config_id, PCI_CBIO,(u_short *) &(sc->iobase))) {
+ printf("tx%d: cannot map port\n",unit);
+ free(sc, M_DEVBUF);
+ return;
+ }
+#else
+ if (!pci_map_mem(config_id, PCI_CBMA,(vm_offset_t *) &(sc->csr),(vm_offset_t *) &pmembase)) {
+ printf("tx%d: cannot map memory\n",unit);
+ free(sc, M_DEVBUF);
+ return;
+ }
+#endif
+
+ sc->tx_flist = (void *)pool;
+ pool += sizeof(struct epic_frag_list)*TX_RING_SIZE;
+ sc->rx_desc = (void *)pool;
+ pool += sizeof(struct epic_rx_desc)*RX_RING_SIZE;
+ sc->tx_desc = (void *)pool;
+
+ /* Bring the chip out of low-power mode. */
+ CSR_WRITE_4( sc, GENCTL, 0x0000 );
+
+ /* Magic?! If we don't set this bit the MII interface won't work. */
+ CSR_WRITE_4( sc, TEST1, 0x0008 );
+
+ /* Read mac address from EEPROM */
+ for (i = 0; i < ETHER_ADDR_LEN / sizeof(u_int16_t); i++)
+ ((u_int16_t *)sc->epic_macaddr)[i] = epic_read_eeprom(sc,i);
+
+ /* Display ethernet address ,... */
+ printf("tx%d: address %02x:%02x:%02x:%02x:%02x:%02x,",sc->unit,
+ sc->epic_macaddr[0],sc->epic_macaddr[1],sc->epic_macaddr[2],
+ sc->epic_macaddr[3],sc->epic_macaddr[4],sc->epic_macaddr[5]);
+
+ /* board type and ... */
+ printf(" type ");
+ for(i=0x2c;i<0x32;i++) {
+ tmp = epic_read_eeprom( sc, i );
+ if( ' ' == (u_int8_t)tmp ) break;
+ printf("%c",(u_int8_t)tmp);
+ tmp >>= 8;
+ if( ' ' == (u_int8_t)tmp ) break;
+ printf("%c",(u_int8_t)tmp);
+ }
+
+ /* Read current media config and display it too */
+ i = PHY_READ_2( sc, DP83840_BMCR );
+#if defined(_NET_IF_MEDIA_H_)
+ tmp = IFM_ETHER;
+#endif
+ if( i & BMCR_AUTONEGOTIATION ){
+ printf(", Auto-Neg ");
+
+ /* To avoid bug in QS6612 read LPAR enstead of BMSR */
+ i = PHY_READ_2( sc, DP83840_LPAR );
+ if( i & (ANAR_100_TX|ANAR_100_TX_FD) ) printf("100Mbps ");
+ else printf("10Mbps ");
+ if( i & (ANAR_10_FD|ANAR_100_TX_FD) ) printf("FD");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_AUTO;
+#endif
+ } else {
+#if !defined(_NET_IF_MEDIA_H_)
+ ifp->if_flags |= IFF_LINK0;
+#endif
+ if( i & BMCR_100MBPS ) {
+ printf(", 100Mbps ");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_100_TX;
+#else
+ ifp->if_flags |= IFF_LINK2;
+#endif
+ } else {
+ printf(", 10Mbps ");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_10_T;
+#endif
+ }
+ if( i & BMCR_FULL_DUPLEX ) {
+ printf("FD");
+#if defined(_NET_IF_MEDIA_H_)
+ tmp |= IFM_FDX;
+#else
+ ifp->if_flags |= IFF_LINK1;
+#endif
+ }
+ }
+
+ /* Init ifmedia interface */
+#if defined(SIOCSIFMEDIA) && !defined(EPIC_NOIFMEDIA)
+ ifmedia_init(&sc->ifmedia,0,epic_ifmedia_change,epic_ifmedia_status);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_LOOP,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_10_T|IFM_FDX,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_LOOP,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_100_TX|IFM_FDX,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_AUTO,0,NULL);
+ ifmedia_add(&sc->ifmedia,IFM_ETHER|IFM_LOOP,0,NULL);
+ ifmedia_set(&sc->ifmedia, tmp);
+#endif
+
+ /* Identify PHY */
+ sc->phyid = PHY_READ_2(sc, DP83840_PHYIDR1 )<<6;
+ sc->phyid|= (PHY_READ_2( sc, DP83840_PHYIDR2 )>>10)&0x3F;
+ if( QS6612_OUI != sc->phyid ) printf("tx%d: WARNING! phy unknown (0x%x), ",sc->unit,sc->phyid);
+
+ s = splimp();
+
+ /* Map interrupt */
+ if( !pci_map_int(config_id, epic_intr_normal, (void*)sc, &net_imask) ) {
+ printf("tx%d: couldn't map interrupt\n",unit);
+ free(sc, M_DEVBUF);
+ return;
+ }
+
+ /* Set shut down routine to stop DMA processes on reboot */
+ at_shutdown(epic_shutdown, sc, SHUTDOWN_POST_SYNC);
+
+ /* Attach to if manager */
+ if_attach(ifp);
+ ether_ifattach(ifp);
+
+#if NBPFILTER > 0
+ bpfattach(ifp,DLT_EN10MB, sizeof(struct ether_header));
+#endif
+
+ splx(s);
+
+ printf("\n");
+
+ return;
+}
+
#if defined(SIOCSIFMEDIA) && !defined(EPIC_NOIFMEDIA)
static int
epic_ifmedia_change __P((
struct ifnet * ifp))
{
- epic_softc_t *sc = (epic_softc_t *)(ifp->if_softc);
-
- if (IFM_TYPE(sc->ifmedia.ifm_media) != IFM_ETHER)
+ if (IFM_TYPE(((epic_softc_t *)(ifp->if_softc))->ifmedia.ifm_media) != IFM_ETHER)
return (EINVAL);
- epic_set_media_speed(sc);
+ epic_set_media_speed( ifp->if_softc );
return 0;
}
@@ -1176,8 +844,8 @@ epic_ifmedia_status __P((
struct ifmediareq *ifmr))
{
epic_softc_t *sc = ifp->if_softc;
- u_int32_t bmcr;
- u_int32_t bmsr;
+ u_int32_t bmcr;
+ u_int32_t bmsr;
bmcr = PHY_READ_2( sc, DP83840_BMCR );
@@ -1188,8 +856,7 @@ epic_ifmedia_status __P((
ifmr->ifm_status = IFM_AVALID;
if( !(bmsr & BMSR_LINK_STATUS) ) {
- ifmr->ifm_active |=
- (bmcr&BMCR_AUTONEGOTIATION)?IFM_AUTO:IFM_NONE;
+ ifmr->ifm_active |= (bmcr&BMCR_AUTONEGOTIATION)?IFM_AUTO:IFM_NONE;
return;
}
@@ -1209,8 +876,8 @@ static int
epic_init __P((
epic_softc_t * sc))
{
- struct ifnet *ifp = &sc->sc_if;
- int s;
+ struct ifnet *ifp = &sc->epic_if;
+ int i,s;
s = splimp();
@@ -1228,7 +895,7 @@ epic_init __P((
/* Initialize rings */
if( epic_init_rings( sc ) ) {
- printf(EPIC_FORMAT ": failed to init rings\n",EPIC_ARGS(sc));
+ printf("\ntx%d: failed to initialize rings",sc->unit);
splx(s);
return -1;
}
@@ -1238,12 +905,16 @@ epic_init __P((
CSR_WRITE_4( sc, PTCDAR, vtophys( sc->tx_desc ) );
/* Put node address to EPIC */
- CSR_WRITE_4( sc, LAN0, ((u_int16_t *)sc->sc_macaddr)[0] );
- CSR_WRITE_4( sc, LAN1, ((u_int16_t *)sc->sc_macaddr)[1] );
- CSR_WRITE_4( sc, LAN2, ((u_int16_t *)sc->sc_macaddr)[2] );
+ CSR_WRITE_4( sc, LAN0, ((u_int16_t *)sc->epic_macaddr)[0] );
+ CSR_WRITE_4( sc, LAN1, ((u_int16_t *)sc->epic_macaddr)[1] );
+ CSR_WRITE_4( sc, LAN2, ((u_int16_t *)sc->epic_macaddr)[2] );
+
+#if defined(EARLY_TX)
+ /* Set transmit threshold */
+ CSR_WRITE_4( sc, ETXTHR, TRANSMIT_THRESHOLD );
+#endif
- /* Set tx mode, includeing transmit threshold */
- epic_set_tx_mode(sc);
+ CSR_WRITE_4( sc, IPG, 0x1010 );
/* Compute and set RXCON. */
epic_set_rx_mode( sc );
@@ -1288,7 +959,7 @@ static void
epic_set_rx_mode(
epic_softc_t * sc)
{
- u_int32_t flags = sc->sc_if.if_flags;
+ u_int32_t flags = sc->epic_if.if_flags;
u_int32_t rxcon = RXCON_DEFAULT | RXCON_RECEIVE_MULTICAST_FRAMES | RXCON_RECEIVE_BROADCAST_FRAMES;
rxcon |= (flags & IFF_PROMISC)?RXCON_PROMISCUOUS_MODE:0;
@@ -1313,7 +984,7 @@ epic_init_phy __P((
if( !(PHY_READ_2( sc, DP83840_BMCR ) & BMCR_RESET) ) break;
if( PHY_READ_2( sc, DP83840_BMCR ) & BMCR_RESET )
- printf(EPIC_FORMAT ": WARNING! cannot reset PHY\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! cannot reset PHY",sc->unit);
switch( sc->phyid ){
case QS6612_OUI:
@@ -1340,7 +1011,7 @@ epic_set_media_speed __P((
{
u_int16_t media;
-#if !defined(EPIC_NOIFMEDIA)
+#if defined(_NET_IF_MEDIA_H_)
u_int32_t tgtmedia = sc->ifmedia.ifm_cur->ifm_media;
if( IFM_SUBTYPE(tgtmedia) != IFM_AUTO ){
@@ -1348,42 +1019,40 @@ epic_set_media_speed __P((
media = (IFM_SUBTYPE(tgtmedia)==IFM_100_TX) ? BMCR_100MBPS : 0;
media|= (tgtmedia&IFM_FDX) ? BMCR_FULL_DUPLEX : 0;
- sc->sc_if.if_baudrate =
+ sc->epic_if.if_baudrate =
(IFM_SUBTYPE(tgtmedia)==IFM_100_TX)?100000000:10000000;
PHY_WRITE_2( sc, DP83840_BMCR, media );
- if( tgtmedia & IFM_FDX ) sc->txcon |= TXCON_FULL_DUPLEX;
- else sc->txcon &= ~TXCON_FULL_DUPLEX;
- if( tgtmedia & IFM_LOOP ) sc->txcon |= TXCON_LOOPBACK_MODE_INT;
- else sc->txcon &= ~TXCON_LOOPBACK_MODE_INT;
+ media = TXCON_DEFAULT;
+ if( tgtmedia & IFM_FDX ) media |= TXCON_FULL_DUPLEX;
+ else if( tgtmedia & IFM_LOOP ) media |= TXCON_LOOPBACK_MODE_INT;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ CSR_WRITE_4( sc, TXCON, media );
}
-#else /* EPIC_NOIFMEDIA */
- struct ifnet *ifp = &sc->sc_if;
+#else
+ struct ifnet *ifp = &sc->epic_if;
if( ifp->if_flags & IFF_LINK0 ) {
/* Set mode */
media = (ifp->if_flags & IFF_LINK2) ? BMCR_100MBPS : 0;
media|= (ifp->if_flags & IFF_LINK1) ? BMCR_FULL_DUPLEX : 0;
- sc->sc_if.if_baudrate =
+ sc->epic_if.if_baudrate =
(ifp->if_flags & IFF_LINK2)?100000000:10000000;
PHY_WRITE_2( sc, DP83840_BMCR, media );
- if( ifp->if_flags & IFF_LINK2 ) sc->txcon |= TXCON_FULL_DUPLEX;
- else sc->txcon &= ~TXCON_FULL_DUPLEX;
+ media = TXCON_DEFAULT;
+ media |= (ifp->if_flags&IFF_LINK2)?TXCON_FULL_DUPLEX:0;
- CSR_WRITE_4( sc, TXCON, sc->txcon );
+ CSR_WRITE_4( sc, TXCON, media );
}
-#endif /* !EPIC_NOIFMEDIA */
+#endif
else {
- sc->sc_if.if_baudrate = 100000000;
+ sc->epic_if.if_baudrate = 100000000;
- sc->txcon &= ~TXCON_FULL_DUPLEX;
- CSR_WRITE_4(sc, TXCON, sc->txcon);
+ CSR_WRITE_4( sc, TXCON, TXCON_DEFAULT );
/* Set and restart autoneg */
PHY_WRITE_2( sc, DP83840_BMCR,
@@ -1397,10 +1066,8 @@ epic_set_media_speed __P((
*/
DELAY(3000000);
- if( epic_autoneg(sc) == EPIC_FULL_DUPLEX ) {
- sc->txcon |= TXCON_FULL_DUPLEX;
- CSR_WRITE_4(sc, TXCON, sc->txcon);
- }
+ if( epic_autoneg(sc) == EPIC_FULL_DUPLEX )
+ CSR_WRITE_4( sc, TXCON, TXCON_FULL_DUPLEX|TXCON_DEFAULT);
}
/* Else it will be done when GP2 int occured */
}
@@ -1418,6 +1085,7 @@ static int
epic_autoneg(
epic_softc_t * sc)
{
+ struct ifnet *ifp = &sc->epic_if;
u_int16_t media;
u_int16_t i;
@@ -1487,19 +1155,6 @@ epic_autoneg(
}
/*
- */
-static void
-epic_set_tx_mode (
- epic_softc_t *sc )
-{
-
- if( sc->txcon & TXCON_EARLY_TRANSMIT_ENABLE )
- CSR_WRITE_4( sc, ETXTHR, sc->tx_threshold );
-
- CSR_WRITE_4( sc, TXCON, sc->txcon );
-}
-
-/*
* Synopsis: This function should update multicast hash table.
* I suppose there is a bug in chips MC filter so this function
* only set it to receive all MC packets. The second problem is
@@ -1511,7 +1166,7 @@ static void
epic_set_mc_table (
epic_softc_t * sc)
{
- struct ifnet *ifp = &sc->sc_if;
+ struct ifnet *ifp = &sc->epic_if;
if( ifp->if_flags & IFF_MULTICAST ){
CSR_WRITE_4( sc, MC0, 0xFFFF );
@@ -1523,16 +1178,24 @@ epic_set_mc_table (
return;
}
+static void
+epic_shutdown(
+ int howto,
+ void *sc)
+{
+ epic_stop(sc);
+}
/*
- * Synopsis: Start receive process and transmit, if need
+ * Synopsis: Start receive process, should check that all internal chip
+ * pointers are set properly.
*/
static void
epic_start_activity __P((
epic_softc_t * sc))
{
/* Start rx process */
- CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED | COMMAND_START_RX | (sc->pending_txs?COMMAND_TXQUEUED:0));
+ CSR_WRITE_4( sc, COMMAND, COMMAND_RXQUEUED | COMMAND_START_RX );
}
/*
@@ -1543,56 +1206,43 @@ static void
epic_stop_activity __P((
epic_softc_t * sc))
{
- int i;
+ int i;
- /* Turn it to loopback mode */
- CSR_WRITE_4( sc, TXCON, TXCON_SLOT_TIME|TXCON_LOOPBACK_MODE_INT );
+ /* Stop Tx and Rx DMA */
+ CSR_WRITE_4( sc, COMMAND, COMMAND_STOP_RX | COMMAND_STOP_RDMA | COMMAND_STOP_TDMA);
- /* Stop Tx and Rx DMA */
- CSR_WRITE_4(sc,COMMAND,COMMAND_STOP_RX|COMMAND_STOP_RDMA|COMMAND_STOP_TDMA);
+ /* Wait only Rx DMA */
+ dprintf(("\ntx%d: waiting Rx DMA to stop",sc->unit));
+ for(i=0;i<0x100000;i++)
+ if( (CSR_READ_4(sc,INTSTAT)&INTSTAT_RXIDLE) == INTSTAT_RXIDLE ) break;
- /* Wait only Rx DMA */
- dprintf((EPIC_FORMAT ": waiting Rx DMA to stop\n",EPIC_ARGS(sc)));
- for(i=0;i<0x1000;i++) {
- if( (CSR_READ_4(sc,INTSTAT) & INTSTAT_RXIDLE) == INTSTAT_RXIDLE )
- break;
- DELAY(1);
- }
-
- if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_RXIDLE) )
- printf(EPIC_FORMAT ": can't stop RX DMA\n",EPIC_ARGS(sc));
-
- /* May need to queue one more packet if TQE */
- if( (CSR_READ_4( sc, INTSTAT ) & INTSTAT_TQE) &&
- !(CSR_READ_4( sc, INTSTAT ) & INTSTAT_TXIDLE) ){
- dprintf((EPIC_FORMAT ": queue last packet\n",EPIC_ARGS(sc)));
-
- sc->tx_desc[sc->cur_tx].bufaddr = vtophys( sc );
- sc->tx_desc[sc->cur_tx].buflength = ETHER_MIN_LEN-ETHER_CRC_LEN;
- sc->tx_desc[sc->cur_tx].control = 0x14;
- sc->tx_desc[sc->cur_tx].txlength = ETHER_MIN_LEN-ETHER_CRC_LEN;
- sc->tx_desc[sc->cur_tx].status = 0x8000;
- sc->cur_tx = (sc->cur_tx + 1) & TX_RING_MASK;
- sc->pending_txs++;
-
- CSR_WRITE_4( sc, COMMAND, COMMAND_TXQUEUED );
-
- dprintf((EPIC_FORMAT ": waiting Tx DMA to stop\n",EPIC_ARGS(sc)));
- /* Wait TX DMA to stop */
- for(i=0;i<0x1000;i++) {
- if( (CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) == INTSTAT_TXIDLE ) {
- sc->pending_txs--;
- break;
- }
- DELAY(1);
- }
+ if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_RXIDLE) )
+ printf("\ntx%d: can't stop RX DMA",sc->unit);
- if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) )
- printf(EPIC_FORMAT ": can't stop TX DMA\n",EPIC_ARGS(sc));
+ /* May need to queue one more packet if TQE */
+ if( (CSR_READ_4( sc, INTSTAT ) & INTSTAT_TQE) &&
+ !(CSR_READ_4( sc, INTSTAT ) & INTSTAT_TXIDLE) ){
+ dprintf(("\ntx%d: queue last packet",sc->unit));
- /* Restore old TX state */
- CSR_WRITE_4( sc, TXCON, sc->txcon );
- }
+ /* Turn it to loopback mode */
+ CSR_WRITE_4( sc, TXCON, TXCON_DEFAULT|TXCON_LOOPBACK_MODE_INT );
+
+ sc->tx_desc[sc->cur_tx].bufaddr = vtophys( sc );
+ sc->tx_desc[sc->cur_tx].buflength = ETHER_MIN_LEN-ETHER_CRC_LEN;
+ sc->tx_desc[sc->cur_tx].control = 0x14;
+ sc->tx_desc[sc->cur_tx].txlength = ETHER_MIN_LEN-ETHER_CRC_LEN;
+ sc->tx_desc[sc->cur_tx].status = 0x8000;
+
+ CSR_WRITE_4( sc, COMMAND, COMMAND_TXQUEUED );
+
+ dprintf(("\ntx%d: waiting Tx DMA to stop",sc->unit));
+ /* Wait TX DMA to stop */
+ for(i=0;i<0x100000;i++)
+ if( (CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) == INTSTAT_TXIDLE ) break;
+
+ if( !(CSR_READ_4(sc,INTSTAT)&INTSTAT_TXIDLE) )
+ printf("\ntx%d: can't stop TX DMA",sc->unit);
+ }
}
/*
@@ -1604,11 +1254,11 @@ static void
epic_stop __P((
epic_softc_t * sc))
{
- int s;
+ int i,s;
s = splimp();
- sc->sc_if.if_timer = 0;
+ sc->epic_if.if_timer = 0;
/* Disable interrupts */
CSR_WRITE_4( sc, INTMASK, 0 );
@@ -1619,13 +1269,13 @@ epic_stop __P((
/* Reset chip */
CSR_WRITE_4( sc, GENCTL, GENCTL_SOFT_RESET );
- DELAY(10);
+ DELAY(1);
/* Free memory allocated for rings */
epic_free_rings(sc);
/* Mark as stoped */
- sc->sc_if.if_flags &= ~IFF_RUNNING;
+ sc->epic_if.if_flags &= ~IFF_RUNNING;
splx(s);
return;
@@ -1673,6 +1323,7 @@ epic_free_rings __P((
static int
epic_init_rings(epic_softc_t * sc){
int i;
+ struct mbuf *m;
sc->cur_rx = sc->cur_tx = sc->dirty_tx = sc->pending_txs = 0;
@@ -1681,10 +1332,10 @@ epic_init_rings(epic_softc_t * sc){
struct epic_rx_desc *desc = sc->rx_desc + i;
desc->status = 0; /* Owned by driver */
- desc->next = vtophys( sc->rx_desc + ((i+1) & RX_RING_MASK) );
+ desc->next = vtophys( sc->rx_desc + ((i+1)%RX_RING_SIZE) );
if( (desc->next & 3) || ((desc->next & 0xFFF) + sizeof(struct epic_rx_desc) > 0x1000 ) )
- printf(EPIC_FORMAT ": WARNING! rx_desc is misbound or misaligned\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! rx_desc is misbound or misaligned",sc->unit);
EPIC_MGETCLUSTER( buf->mbuf );
if( NULL == buf->mbuf ) {
@@ -1703,15 +1354,15 @@ epic_init_rings(epic_softc_t * sc){
struct epic_tx_desc *desc = sc->tx_desc + i;
desc->status = 0;
- desc->next = vtophys( sc->tx_desc + ( (i+1) & TX_RING_MASK ) );
+ desc->next = vtophys( sc->tx_desc + ( (i+1)%TX_RING_SIZE ) );
if( (desc->next & 3) || ((desc->next & 0xFFF) + sizeof(struct epic_tx_desc) > 0x1000 ) )
- printf(EPIC_FORMAT ": WARNING! tx_desc is misbound or misaligned\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! tx_desc is misbound or misaligned",sc->unit);
buf->mbuf = NULL;
desc->bufaddr = vtophys( sc->tx_flist + i );
if( (desc->bufaddr & 3) || ((desc->bufaddr & 0xFFF) + sizeof(struct epic_frag_list) > 0x1000 ) )
- printf(EPIC_FORMAT ": WARNING! frag_list is misbound or misaligned\n",EPIC_ARGS(sc));
+ printf("\ntx%d: WARNING! frag_list is misbound or misaligned",sc->unit);
}
return 0;
@@ -1787,6 +1438,7 @@ epic_read_eeprom __P((
epic_softc_t *sc,
u_int16_t loc))
{
+ int i;
u_int16_t dataval;
u_int16_t read_cmd;
@@ -1843,13 +1495,14 @@ epic_dump_state __P((
int j;
struct epic_tx_desc *tdesc;
struct epic_rx_desc *rdesc;
- printf(EPIC_FORMAT ": cur_rx: %d, pending_txs: %d, dirty_tx: %d, cur_tx: %d\n", EPIC_ARGS(sc),sc->cur_rx,sc->pending_txs,sc->dirty_tx,sc->cur_tx);
- printf(EPIC_FORMAT ": COMMAND: 0x%08x, INTSTAT: 0x%08x\n",EPIC_ARGS(sc),CSR_READ_4(sc,COMMAND),CSR_READ_4(sc,INTSTAT));
- printf(EPIC_FORMAT ": PRCDAR: 0x%08x, PTCDAR: 0x%08x\n",EPIC_ARGS(sc),CSR_READ_4(sc,PRCDAR),CSR_READ_4(sc,PTCDAR));
- printf(EPIC_FORMAT ": dumping rx descriptors\n",EPIC_ARGS(sc));
+ printf("\ntx%d: cur_rx: %d, pending_txs: %d, dirty_tx: %d, cur_tx: %d",
+ sc->unit,sc->cur_rx,sc->pending_txs,sc->dirty_tx,sc->cur_tx);
+ printf("\ntx%d: COMMAND: 0x%08x, INTSTAT: 0x%08x",sc->unit,CSR_READ_4(sc,COMMAND),CSR_READ_4(sc,INTSTAT));
+ printf("\ntx%d: PRCDAR: 0x%08x, PTCDAR: 0x%08x",sc->unit,CSR_READ_4(sc,PRCDAR),CSR_READ_4(sc,PTCDAR));
+ printf("\ntx%d: dumping rx descriptors",sc->unit);
for(j=0;j<RX_RING_SIZE;j++){
rdesc = sc->rx_desc + j;
- printf("desc%d: %4d 0x%04x, 0x%08x, %4d, 0x%08x\n",
+ printf("\ndesc%d: %4d 0x%04x, 0x%08x, %4d, 0x%08x",
j,
rdesc->rxlength,rdesc->status,
rdesc->bufaddr,
@@ -1857,11 +1510,11 @@ epic_dump_state __P((
rdesc->next
);
}
- printf(EPIC_FORMAT ": dumping tx descriptors\n",EPIC_ARGS(sc));
+ printf("\ntx%d: dumping tx descriptors",sc->unit);
for(j=0;j<TX_RING_SIZE;j++){
tdesc = sc->tx_desc + j;
printf(
- "desc%d: %4d 0x%04x, 0x%08lx, 0x%04x %4u, 0x%08lx, mbuf: %p\n",
+ "\ndesc%d: %4d 0x%04x, 0x%08lx, 0x%04x %4u, 0x%08lx, mbuf: %p",
j,
tdesc->txlength,tdesc->status,
(u_long)tdesc->bufaddr,
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
deleted file mode 100644
index efed968177dcc..0000000000000
--- a/sys/pci/if_vr.c
+++ /dev/null
@@ -1,1957 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_vr.c,v 1.16 1999/01/10 18:06:10 wpaul Exp $
- */
-
-/*
- * VIA Rhine fast ethernet PCI NIC driver
- *
- * Supports various network adapters based on the VIA Rhine
- * and Rhine II PCI controllers, including the D-Link DFE530TX.
- * Datasheets are available at http://www.via.com.tw.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The VIA Rhine controllers are similar in some respects to the
- * the DEC tulip chips, except less complicated. The controller
- * uses an MII bus and an external physical layer interface. The
- * receiver has a one entry perfect filter and a 64-bit hash table
- * multicast filter. Transmit and receive descriptors are similar
- * to the tulip.
- *
- * The Rhine has a serious flaw in its transmit DMA mechanism:
- * transmit buffers must be longword aligned. Unfortunately,
- * FreeBSD doesn't guarantee that mbufs will be filled in starting
- * at longword boundaries, so we have to do a buffer copy before
- * transmission.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_pio.h>
-#include <machine/bus_memio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define VR_USEIOSPACE
-
-/* #define VR_BACKGROUND_AUTONEG */
-
-#include <pci/if_vrreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_vr.c,v 1.16 1999/01/10 18:06:10 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct vr_type vr_devs[] = {
- { VIA_VENDORID, VIA_DEVICEID_RHINE,
- "VIA VT3043 Rhine I 10/100BaseTX" },
- { VIA_VENDORID, VIA_DEVICEID_RHINE_II,
- "VIA VT86C100A Rhine II 10/100BaseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct vr_type vr_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long vr_count = 0;
-static const char *vr_probe __P((pcici_t, pcidi_t));
-static void vr_attach __P((pcici_t, int));
-
-static int vr_newbuf __P((struct vr_softc *,
- struct vr_chain_onefrag *));
-static int vr_encap __P((struct vr_softc *, struct vr_chain *,
- struct mbuf * ));
-
-static void vr_rxeof __P((struct vr_softc *));
-static void vr_rxeoc __P((struct vr_softc *));
-static void vr_txeof __P((struct vr_softc *));
-static void vr_txeoc __P((struct vr_softc *));
-static void vr_intr __P((void *));
-static void vr_start __P((struct ifnet *));
-static int vr_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void vr_init __P((void *));
-static void vr_stop __P((struct vr_softc *));
-static void vr_watchdog __P((struct ifnet *));
-static void vr_shutdown __P((int, void *));
-static int vr_ifmedia_upd __P((struct ifnet *));
-static void vr_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void vr_mii_sync __P((struct vr_softc *));
-static void vr_mii_send __P((struct vr_softc *, u_int32_t, int));
-static int vr_mii_readreg __P((struct vr_softc *, struct vr_mii_frame *));
-static int vr_mii_writereg __P((struct vr_softc *, struct vr_mii_frame *));
-static u_int16_t vr_phy_readreg __P((struct vr_softc *, int));
-static void vr_phy_writereg __P((struct vr_softc *, u_int16_t, u_int16_t));
-
-static void vr_autoneg_xmit __P((struct vr_softc *));
-static void vr_autoneg_mii __P((struct vr_softc *, int, int));
-static void vr_setmode_mii __P((struct vr_softc *, int));
-static void vr_getmode_mii __P((struct vr_softc *));
-static void vr_setcfg __P((struct vr_softc *, u_int16_t));
-static u_int8_t vr_calchash __P((u_int8_t *));
-static void vr_setmulti __P((struct vr_softc *));
-static void vr_reset __P((struct vr_softc *));
-static int vr_list_rx_init __P((struct vr_softc *));
-static int vr_list_tx_init __P((struct vr_softc *));
-
-#define VR_SETBIT(sc, reg, x) \
- CSR_WRITE_1(sc, reg, \
- CSR_READ_1(sc, reg) | x)
-
-#define VR_CLRBIT(sc, reg, x) \
- CSR_WRITE_1(sc, reg, \
- CSR_READ_1(sc, reg) & ~x)
-
-#define VR_SETBIT16(sc, reg, x) \
- CSR_WRITE_2(sc, reg, \
- CSR_READ_2(sc, reg) | x)
-
-#define VR_CLRBIT16(sc, reg, x) \
- CSR_WRITE_2(sc, reg, \
- CSR_READ_2(sc, reg) & ~x)
-
-#define VR_SETBIT32(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define VR_CLRBIT32(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_1(sc, VR_MIICMD, \
- CSR_READ_1(sc, VR_MIICMD) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_1(sc, VR_MIICMD, \
- CSR_READ_1(sc, VR_MIICMD) & ~x)
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void vr_mii_sync(sc)
- struct vr_softc *sc;
-{
- register int i;
-
- SIO_SET(VR_MIICMD_DIR|VR_MIICMD_DATAIN);
-
- for (i = 0; i < 32; i++) {
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- }
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void vr_mii_send(sc, bits, cnt)
- struct vr_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- SIO_CLR(VR_MIICMD_CLK);
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
- if (bits & i) {
- SIO_SET(VR_MIICMD_DATAIN);
- } else {
- SIO_CLR(VR_MIICMD_DATAIN);
- }
- DELAY(1);
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- }
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int vr_mii_readreg(sc, frame)
- struct vr_softc *sc;
- struct vr_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = VR_MII_STARTDELIM;
- frame->mii_opcode = VR_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- CSR_WRITE_1(sc, VR_MIICMD, 0);
- VR_SETBIT(sc, VR_MIICMD, VR_MIICMD_DIRECTPGM);
-
- /*
- * Turn on data xmit.
- */
- SIO_SET(VR_MIICMD_DIR);
-
- vr_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- vr_mii_send(sc, frame->mii_stdelim, 2);
- vr_mii_send(sc, frame->mii_opcode, 2);
- vr_mii_send(sc, frame->mii_phyaddr, 5);
- vr_mii_send(sc, frame->mii_regaddr, 5);
-
- /* Idle bit */
- SIO_CLR((VR_MIICMD_CLK|VR_MIICMD_DATAIN));
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
-
- /* Turn off xmit. */
- SIO_CLR(VR_MIICMD_DIR);
-
- /* Check for ack */
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- ack = CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT;
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- if (!ack) {
- if (CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT)
- frame->mii_data |= i;
- DELAY(1);
- }
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- }
-
-fail:
-
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int vr_mii_writereg(sc, frame)
- struct vr_softc *sc;
- struct vr_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
-
- CSR_WRITE_1(sc, VR_MIICMD, 0);
- VR_SETBIT(sc, VR_MIICMD, VR_MIICMD_DIRECTPGM);
-
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = VR_MII_STARTDELIM;
- frame->mii_opcode = VR_MII_WRITEOP;
- frame->mii_turnaround = VR_MII_TURNAROUND;
-
- /*
- * Turn on data output.
- */
- SIO_SET(VR_MIICMD_DIR);
-
- vr_mii_sync(sc);
-
- vr_mii_send(sc, frame->mii_stdelim, 2);
- vr_mii_send(sc, frame->mii_opcode, 2);
- vr_mii_send(sc, frame->mii_phyaddr, 5);
- vr_mii_send(sc, frame->mii_regaddr, 5);
- vr_mii_send(sc, frame->mii_turnaround, 2);
- vr_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- SIO_SET(VR_MIICMD_CLK);
- DELAY(1);
- SIO_CLR(VR_MIICMD_CLK);
- DELAY(1);
-
- /*
- * Turn off xmit.
- */
- SIO_CLR(VR_MIICMD_DIR);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t vr_phy_readreg(sc, reg)
- struct vr_softc *sc;
- int reg;
-{
- struct vr_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->vr_phy_addr;
- frame.mii_regaddr = reg;
- vr_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void vr_phy_writereg(sc, reg, data)
- struct vr_softc *sc;
- u_int16_t reg;
- u_int16_t data;
-{
- struct vr_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->vr_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- vr_mii_writereg(sc, &frame);
-
- return;
-}
-
-/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
- */
-static u_int8_t vr_calchash(addr)
- u_int8_t *addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /* return the filter bit position */
- return((crc >> 26) & 0x0000003F);
-}
-
-/*
- * Program the 64-bit multicast hash filter.
- */
-static void vr_setmulti(sc)
- struct vr_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int8_t rxfilt;
- int mcnt = 0;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_1(sc, VR_RXCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
- rxfilt |= VR_RXCFG_RX_MULTI;
- CSR_WRITE_1(sc, VR_RXCFG, rxfilt);
- CSR_WRITE_4(sc, VR_MAR0, 0xFFFFFFFF);
- CSR_WRITE_4(sc, VR_MAR1, 0xFFFFFFFF);
- return;
- }
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, VR_MAR0, 0);
- CSR_WRITE_4(sc, VR_MAR1, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = vr_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- mcnt++;
- }
-
- if (mcnt)
- rxfilt |= VR_RXCFG_RX_MULTI;
- else
- rxfilt &= ~VR_RXCFG_RX_MULTI;
-
- CSR_WRITE_4(sc, VR_MAR0, hashes[0]);
- CSR_WRITE_4(sc, VR_MAR1, hashes[1]);
- CSR_WRITE_1(sc, VR_RXCFG, rxfilt);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void vr_autoneg_xmit(sc)
- struct vr_softc *sc;
-{
- u_int16_t phy_sts;
-
- vr_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(vr_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = vr_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- vr_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void vr_autoneg_mii(sc, flag, verbose)
- struct vr_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = vr_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("vr%d: autonegotiation not supported\n",
- sc->vr_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case VR_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- vr_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case VR_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise vr_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->vr_cdata.vr_tx_head != NULL) {
- sc->vr_want_auto = 1;
- return;
- }
- vr_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->vr_autoneg = 1;
- sc->vr_want_auto = 0;
- return;
- break;
- case VR_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->vr_autoneg = 0;
- break;
- default:
- printf("vr%d: invalid autoneg flag: %d\n", sc->vr_unit, flag);
- return;
- }
-
- if (vr_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("vr%d: autoneg complete, ", sc->vr_unit);
- phy_sts = vr_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("vr%d: autoneg not complete, ", sc->vr_unit);
- }
-
- media = vr_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (vr_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = vr_phy_readreg(sc, PHY_ANAR);
- ability = vr_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- vr_setcfg(sc, media);
- vr_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- vr_init(sc);
-
- if (sc->vr_tx_pend) {
- sc->vr_autoneg = 0;
- sc->vr_tx_pend = 0;
- vr_start(ifp);
- }
-
- return;
-}
-
-static void vr_getmode_mii(sc)
- struct vr_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = vr_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("vr%d: PHY status word: %x\n", sc->vr_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("vr%d: 10Mbps half-duplex mode supported\n",
- sc->vr_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("vr%d: 10Mbps full-duplex mode supported\n",
- sc->vr_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("vr%d: 100Mbps half-duplex mode supported\n",
- sc->vr_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("vr%d: 100Mbps full-duplex mode supported\n",
- sc->vr_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("vr%d: 100baseT4 mode supported\n", sc->vr_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("vr%d: forcing on autoneg support for BT4\n",
- sc->vr_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("vr%d: autoneg supported\n", sc->vr_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void vr_setmode_mii(sc, media)
- struct vr_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->vr_autoneg) {
- printf("vr%d: canceling autoneg session\n", sc->vr_unit);
- ifp->if_timer = sc->vr_autoneg = sc->vr_want_auto = 0;
- bmcr = vr_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- vr_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("vr%d: selecting MII, ", sc->vr_unit);
-
- bmcr = vr_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- vr_setcfg(sc, bmcr);
- vr_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * In order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void vr_setcfg(sc, bmcr)
- struct vr_softc *sc;
- u_int16_t bmcr;
-{
- int restart = 0;
-
- if (CSR_READ_2(sc, VR_COMMAND) & (VR_CMD_TX_ON|VR_CMD_RX_ON)) {
- restart = 1;
- VR_CLRBIT16(sc, VR_COMMAND, (VR_CMD_TX_ON|VR_CMD_RX_ON));
- }
-
- if (bmcr & PHY_BMCR_DUPLEX)
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX);
- else
- VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX);
-
- if (restart)
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_RX_ON);
-
- return;
-}
-
-static void vr_reset(sc)
- struct vr_softc *sc;
-{
- register int i;
-
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RESET);
-
- for (i = 0; i < VR_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_2(sc, VR_COMMAND) & VR_CMD_RESET))
- break;
- }
- if (i == VR_TIMEOUT)
- printf("vr%d: reset never completed!\n", sc->vr_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
-
- return;
-}
-
-/*
- * Probe for a VIA Rhine chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-vr_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct vr_type *t;
-
- t = vr_devs;
-
- while(t->vr_name != NULL) {
- if ((device_id & 0xFFFF) == t->vr_vid &&
- ((device_id >> 16) & 0xFFFF) == t->vr_did) {
- return(t->vr_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-vr_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef VR_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct vr_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct vr_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-
- s = splimp();
-
- sc = malloc(sizeof(struct vr_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("vr%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct vr_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, VR_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, VR_PCI_PWRMGMTCTRL);
- if (command & VR_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, VR_PCI_LOIO);
- membase = pci_conf_read(config_id, VR_PCI_LOMEM);
- irq = pci_conf_read(config_id, VR_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("vr%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & VR_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, VR_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, VR_PCI_LOIO, iobase);
- pci_conf_write(config_id, VR_PCI_LOMEM, membase);
- pci_conf_write(config_id, VR_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef VR_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("vr%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, VR_PCI_LOIO,
- (u_int16_t *)(&sc->vr_bhandle))) {
- printf ("vr%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->vr_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("vr%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, VR_PCI_LOMEM, &vbase, &pbase)) {
- printf ("vr%d: couldn't map memory\n", unit);
- goto fail;
- }
-
- sc->vr_bhandle = vbase;
- sc->vr_btag = I386_BUS_SPACE_MEM;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, vr_intr, sc, &net_imask)) {
- printf("vr%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- vr_reset(sc);
-
- /*
- * Get station address. The way the Rhine chips work,
- * you're not allowed to directly access the EEPROM once
- * they've been programmed a special way. Consequently,
- * we need to read the node address from the PAR0 and PAR1
- * registers.
- */
- VR_SETBIT(sc, VR_EECSR, VR_EECSR_LOAD);
- DELAY(200);
- for (i = 0; i < ETHER_ADDR_LEN; i++)
- eaddr[i] = CSR_READ_1(sc, VR_PAR0 + i);
-
- /*
- * A Rhine chip was detected. Inform the world.
- */
- printf("vr%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->vr_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->vr_ldata_ptr = malloc(sizeof(struct vr_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->vr_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("vr%d: no memory for list buffers!\n", unit);
- return;
- }
-
- sc->vr_ldata = (struct vr_list_data *)sc->vr_ldata_ptr;
- round = (unsigned int)sc->vr_ldata_ptr & 0xF;
- roundptr = sc->vr_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->vr_ldata = (struct vr_list_data *)roundptr;
- bzero(sc->vr_ldata, sizeof(struct vr_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "vr";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = vr_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = vr_start;
- ifp->if_watchdog = vr_watchdog;
- ifp->if_init = vr_init;
- ifp->if_baudrate = 10000000;
-
- if (bootverbose)
- printf("vr%d: probing for a PHY\n", sc->vr_unit);
- for (i = VR_PHYADDR_MIN; i < VR_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("vr%d: checking address: %d\n",
- sc->vr_unit, i);
- sc->vr_phy_addr = i;
- vr_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(vr_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = vr_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = vr_phy_readreg(sc, PHY_VENID);
- phy_did = vr_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("vr%d: found PHY at address %d, ",
- sc->vr_unit, sc->vr_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = vr_phys;
- while(p->vr_vid) {
- if (phy_vid == p->vr_vid &&
- (phy_did | 0x000F) == p->vr_did) {
- sc->vr_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->vr_pinfo == NULL)
- sc->vr_pinfo = &vr_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("vr%d: PHY type: %s\n",
- sc->vr_unit, sc->vr_pinfo->vr_name);
- } else {
- printf("vr%d: MII without any phy!\n", sc->vr_unit);
- goto fail;
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, vr_ifmedia_upd, vr_ifmedia_sts);
-
- vr_getmode_mii(sc);
- vr_autoneg_mii(sc, VR_FLAG_FORCEDELAY, 1);
- media = sc->ifmedia.ifm_media;
- vr_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
-
- at_shutdown(vr_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int vr_list_tx_init(sc)
- struct vr_softc *sc;
-{
- struct vr_chain_data *cd;
- struct vr_list_data *ld;
- int i;
-
- cd = &sc->vr_cdata;
- ld = sc->vr_ldata;
- for (i = 0; i < VR_TX_LIST_CNT; i++) {
- cd->vr_tx_chain[i].vr_ptr = &ld->vr_tx_list[i];
- if (i == (VR_TX_LIST_CNT - 1))
- cd->vr_tx_chain[i].vr_nextdesc =
- &cd->vr_tx_chain[0];
- else
- cd->vr_tx_chain[i].vr_nextdesc =
- &cd->vr_tx_chain[i + 1];
- }
-
- cd->vr_tx_free = &cd->vr_tx_chain[0];
- cd->vr_tx_tail = cd->vr_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int vr_list_rx_init(sc)
- struct vr_softc *sc;
-{
- struct vr_chain_data *cd;
- struct vr_list_data *ld;
- int i;
-
- cd = &sc->vr_cdata;
- ld = sc->vr_ldata;
-
- for (i = 0; i < VR_RX_LIST_CNT; i++) {
- cd->vr_rx_chain[i].vr_ptr =
- (struct vr_desc *)&ld->vr_rx_list[i];
- if (vr_newbuf(sc, &cd->vr_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (VR_RX_LIST_CNT - 1)) {
- cd->vr_rx_chain[i].vr_nextdesc =
- &cd->vr_rx_chain[0];
- ld->vr_rx_list[i].vr_next =
- vtophys(&ld->vr_rx_list[0]);
- } else {
- cd->vr_rx_chain[i].vr_nextdesc =
- &cd->vr_rx_chain[i + 1];
- ld->vr_rx_list[i].vr_next =
- vtophys(&ld->vr_rx_list[i + 1]);
- }
- }
-
- cd->vr_rx_head = &cd->vr_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- * Note: the length fields are only 11 bits wide, which means the
- * largest size we can specify is 2047. This is important because
- * MCLBYTES is 2048, so we have to subtract one otherwise we'll
- * overflow the field and make a mess.
- */
-static int vr_newbuf(sc, c)
- struct vr_softc *sc;
- struct vr_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("vr%d: no memory for rx list -- packet dropped!\n",
- sc->vr_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("vr%d: no memory for rx list -- packet dropped!\n",
- sc->vr_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->vr_mbuf = m_new;
- c->vr_ptr->vr_status = VR_RXSTAT;
- c->vr_ptr->vr_data = vtophys(mtod(m_new, caddr_t));
- c->vr_ptr->vr_ctl = VR_RXCTL | VR_RXLEN;
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void vr_rxeof(sc)
- struct vr_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct vr_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->vr_cdata.vr_rx_head->vr_ptr->vr_status) &
- VR_RXSTAT_OWN)) {
- cur_rx = sc->vr_cdata.vr_rx_head;
- sc->vr_cdata.vr_rx_head = cur_rx->vr_nextdesc;
-
- /*
- * If an error occurs, update stats, clear the
- * status word and leave the mbuf cluster in place:
- * it should simply get re-used next time this descriptor
- * comes up in the ring.
- */
- if (rxstat & VR_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- printf("vr%d: rx error: ", sc->vr_unit);
- switch(rxstat & 0x000000FF) {
- case VR_RXSTAT_CRCERR:
- printf("crc error\n");
- break;
- case VR_RXSTAT_FRAMEALIGNERR:
- printf("frame alignment error\n");
- break;
- case VR_RXSTAT_FIFOOFLOW:
- printf("FIFO overflow\n");
- break;
- case VR_RXSTAT_GIANT:
- printf("received giant packet\n");
- break;
- case VR_RXSTAT_RUNT:
- printf("received runt packet\n");
- break;
- case VR_RXSTAT_BUSERR:
- printf("system bus error\n");
- break;
- case VR_RXSTAT_BUFFERR:
- printf("rx buffer error\n");
- break;
- default:
- printf("unknown rx error\n");
- break;
- }
- cur_rx->vr_ptr->vr_status = VR_RXSTAT;
- cur_rx->vr_ptr->vr_ctl = VR_RXCTL|VR_RXLEN;
- continue;
- }
-
- /* No errors; receive the packet. */
- m = cur_rx->vr_mbuf;
- total_len = VR_RXBYTES(cur_rx->vr_ptr->vr_status);
-
- /*
- * XXX The VIA Rhine chip includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (vr_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->vr_ptr->vr_status = VR_RXSTAT;
- cur_rx->vr_ptr->vr_ctl = VR_RXCTL|VR_RXLEN;
- continue;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void vr_rxeoc(sc)
- struct vr_softc *sc;
-{
-
- vr_rxeof(sc);
- VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
- CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_GO);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void vr_txeof(sc)
- struct vr_softc *sc;
-{
- struct vr_chain *cur_tx;
- struct ifnet *ifp;
- register struct mbuf *n;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- /* Sanity check. */
- if (sc->vr_cdata.vr_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->vr_cdata.vr_tx_head->vr_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->vr_cdata.vr_tx_head;
- txstat = cur_tx->vr_ptr->vr_status;
-
- if (txstat & VR_TXSTAT_OWN)
- break;
-
- if (txstat & VR_TXSTAT_ERRSUM) {
- ifp->if_oerrors++;
- if (txstat & VR_TXSTAT_DEFER)
- ifp->if_collisions++;
- if (txstat & VR_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions +=(txstat & VR_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- MFREE(cur_tx->vr_mbuf, n);
- cur_tx->vr_mbuf = NULL;
-
- if (sc->vr_cdata.vr_tx_head == sc->vr_cdata.vr_tx_tail) {
- sc->vr_cdata.vr_tx_head = NULL;
- sc->vr_cdata.vr_tx_tail = NULL;
- break;
- }
-
- sc->vr_cdata.vr_tx_head = cur_tx->vr_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void vr_txeoc(sc)
- struct vr_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->vr_cdata.vr_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->vr_cdata.vr_tx_tail = NULL;
- if (sc->vr_want_auto)
- vr_autoneg_mii(sc, VR_FLAG_SCHEDDELAY, 1);
- }
-
- return;
-}
-
-static void vr_intr(arg)
- void *arg;
-{
- struct vr_softc *sc;
- struct ifnet *ifp;
- u_int16_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- /* Supress unwanted interrupts. */
- if (!(ifp->if_flags & IFF_UP)) {
- vr_stop(sc);
- return;
- }
-
- /* Disable interrupts. */
- CSR_WRITE_2(sc, VR_IMR, 0x0000);
-
- for (;;) {
-
- status = CSR_READ_2(sc, VR_ISR);
- if (status)
- CSR_WRITE_2(sc, VR_ISR, status);
-
- if ((status & VR_INTRS) == 0)
- break;
-
- if (status & VR_ISR_RX_OK)
- vr_rxeof(sc);
-
- if ((status & VR_ISR_RX_ERR) || (status & VR_ISR_RX_NOBUF) ||
- (status & VR_ISR_RX_NOBUF) || (status & VR_ISR_RX_OFLOW) ||
- (status & VR_ISR_RX_DROPPED)) {
- vr_rxeof(sc);
- vr_rxeoc(sc);
- }
-
- if (status & VR_ISR_TX_OK) {
- vr_txeof(sc);
- vr_txeoc(sc);
- }
-
- if ((status & VR_ISR_TX_UNDERRUN)||(status & VR_ISR_TX_ABRT)){
- ifp->if_oerrors++;
- vr_txeof(sc);
- if (sc->vr_cdata.vr_tx_head != NULL) {
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON);
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_GO);
- }
- }
-
- if (status & VR_ISR_BUSERR) {
- vr_reset(sc);
- vr_init(sc);
- }
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_2(sc, VR_IMR, VR_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- vr_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int vr_encap(sc, c, m_head)
- struct vr_softc *sc;
- struct vr_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- struct vr_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- m = m_head;
- total_len = 0;
-
- /*
- * The VIA Rhine wants packet buffers to be longword
- * aligned, but very often our mbufs aren't. Rather than
- * waste time trying to decide when to copy and when not
- * to copy, just do it all the time.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("vr%d: no memory for tx list", sc->vr_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("vr%d: no memory for tx list",
- sc->vr_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- /*
- * The Rhine chip doesn't auto-pad, so we have to make
- * sure to pad short frames out to the minimum frame length
- * ourselves.
- */
- if (m_head->m_len < VR_MIN_FRAMELEN) {
- m_new->m_pkthdr.len += VR_MIN_FRAMELEN - m_new->m_len;
- m_new->m_len = m_new->m_pkthdr.len;
- }
- f = c->vr_ptr;
- f->vr_data = vtophys(mtod(m_new, caddr_t));
- f->vr_ctl = total_len = m_new->m_len;
- f->vr_ctl |= VR_TXCTL_TLINK|VR_TXCTL_FIRSTFRAG;
- f->vr_status = 0;
- frag = 1;
- }
-
- c->vr_mbuf = m_head;
- c->vr_ptr->vr_ctl |= VR_TXCTL_LASTFRAG|VR_TXCTL_FINT;
- c->vr_ptr->vr_next = vtophys(c->vr_nextdesc->vr_ptr);
-
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void vr_start(ifp)
- struct ifnet *ifp;
-{
- struct vr_softc *sc;
- struct mbuf *m_head = NULL;
- struct vr_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->vr_autoneg) {
- sc->vr_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->vr_cdata.vr_tx_free->vr_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->vr_cdata.vr_tx_free;
-
- while(sc->vr_cdata.vr_tx_free->vr_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->vr_cdata.vr_tx_free;
- sc->vr_cdata.vr_tx_free = cur_tx->vr_nextdesc;
-
- /* Pack the data into the descriptor. */
- vr_encap(sc, cur_tx, m_head);
-
- if (cur_tx != start_tx)
- VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->vr_mbuf);
-#endif
- VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_TX_GO);
- }
-
- /*
- * If there are no frames queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- sc->vr_cdata.vr_tx_tail = cur_tx;
-
- if (sc->vr_cdata.vr_tx_head == NULL)
- sc->vr_cdata.vr_tx_head = start_tx;
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void vr_init(xsc)
- void *xsc;
-{
- struct vr_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- u_int16_t phy_bmcr = 0;
- int s;
-
- if (sc->vr_autoneg)
- return;
-
- s = splimp();
-
- if (sc->vr_pinfo != NULL)
- phy_bmcr = vr_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- vr_stop(sc);
- vr_reset(sc);
-
- VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_THRESH);
- VR_SETBIT(sc, VR_RXCFG, VR_RXTHRESH_STORENFWD);
-
- VR_CLRBIT(sc, VR_TXCFG, VR_TXCFG_TX_THRESH);
- VR_SETBIT(sc, VR_TXCFG, VR_TXTHRESH_STORENFWD);
-
- /* Init circular RX list. */
- if (vr_list_rx_init(sc) == ENOBUFS) {
- printf("vr%d: initialization failed: no "
- "memory for rx buffers\n", sc->vr_unit);
- vr_stop(sc);
- (void)splx(s);
- return;
- }
-
- /*
- * Init tx descriptors.
- */
- vr_list_tx_init(sc);
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC)
- VR_SETBIT(sc, VR_RXCFG, VR_RXCFG_RX_PROMISC);
- else
- VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_PROMISC);
-
- /* Set capture broadcast bit to capture broadcast frames. */
- if (ifp->if_flags & IFF_BROADCAST)
- VR_SETBIT(sc, VR_RXCFG, VR_RXCFG_RX_BROAD);
- else
- VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_BROAD);
-
- /*
- * Program the multicast filter, if necessary.
- */
- vr_setmulti(sc);
-
- /*
- * Load the address of the RX list.
- */
- CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
-
- /* Enable receiver and transmitter. */
- CSR_WRITE_2(sc, VR_COMMAND, VR_CMD_TX_NOPOLL|VR_CMD_START|
- VR_CMD_TX_ON|VR_CMD_RX_ON|
- VR_CMD_RX_GO);
-
- vr_setcfg(sc, vr_phy_readreg(sc, PHY_BMCR));
-
- CSR_WRITE_4(sc, VR_TXADDR, vtophys(&sc->vr_ldata->vr_tx_list[0]));
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_2(sc, VR_ISR, 0xFFFF);
- CSR_WRITE_2(sc, VR_IMR, VR_INTRS);
-
- /* Restore state of BMCR */
- if (sc->vr_pinfo != NULL)
- vr_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int vr_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct vr_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- vr_autoneg_mii(sc, VR_FLAG_SCHEDDELAY, 1);
- else
- vr_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void vr_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct vr_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (!(vr_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (vr_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (vr_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = vr_phy_readreg(sc, PHY_LPAR);
- advert = vr_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int vr_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct vr_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- vr_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- vr_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- vr_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void vr_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct vr_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->vr_autoneg) {
- vr_autoneg_mii(sc, VR_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("vr%d: watchdog timeout\n", sc->vr_unit);
-
- if (!(vr_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("vr%d: no carrier - transceiver cable problem?\n",
- sc->vr_unit);
-
- vr_stop(sc);
- vr_reset(sc);
- vr_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- vr_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void vr_stop(sc)
- struct vr_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- VR_SETBIT16(sc, VR_COMMAND, VR_CMD_STOP);
- VR_CLRBIT16(sc, VR_COMMAND, (VR_CMD_RX_ON|VR_CMD_TX_ON));
- CSR_WRITE_2(sc, VR_IMR, 0x0000);
- CSR_WRITE_4(sc, VR_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, VR_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < VR_RX_LIST_CNT; i++) {
- if (sc->vr_cdata.vr_rx_chain[i].vr_mbuf != NULL) {
- m_freem(sc->vr_cdata.vr_rx_chain[i].vr_mbuf);
- sc->vr_cdata.vr_rx_chain[i].vr_mbuf = NULL;
- }
- }
- bzero((char *)&sc->vr_ldata->vr_rx_list,
- sizeof(sc->vr_ldata->vr_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < VR_TX_LIST_CNT; i++) {
- if (sc->vr_cdata.vr_tx_chain[i].vr_mbuf != NULL) {
- m_freem(sc->vr_cdata.vr_tx_chain[i].vr_mbuf);
- sc->vr_cdata.vr_tx_chain[i].vr_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->vr_ldata->vr_tx_list,
- sizeof(sc->vr_ldata->vr_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void vr_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct vr_softc *sc = (struct vr_softc *)arg;
-
- vr_stop(sc);
-
- return;
-}
-
-static struct pci_device vr_device = {
- "vr",
- vr_probe,
- vr_attach,
- &vr_count,
- NULL
-};
-DATA_SET(pcidevice_set, vr_device);
diff --git a/sys/pci/if_vrreg.h b/sys/pci/if_vrreg.h
deleted file mode 100644
index b44dcabd13164..0000000000000
--- a/sys/pci/if_vrreg.h
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_vrreg.h,v 1.9 1999/01/10 18:06:10 wpaul Exp $
- */
-
-/*
- * Rhine register definitions.
- */
-
-#define VR_PAR0 0x00 /* node address 0 to 4 */
-#define VR_PAR1 0x04 /* node address 2 to 6 */
-#define VR_RXCFG 0x06 /* receiver config register */
-#define VR_TXCFG 0x07 /* transmit config register */
-#define VR_COMMAND 0x08 /* command register */
-#define VR_ISR 0x0C /* interrupt/status register */
-#define VR_IMR 0x0E /* interrupt mask register */
-#define VR_MAR0 0x10 /* multicast hash 0 */
-#define VR_MAR1 0x14 /* multicast hash 1 */
-#define VR_RXADDR 0x18 /* rx descriptor list start addr */
-#define VR_TXADDR 0x1C /* tx descriptor list start addr */
-#define VR_CURRXDESC0 0x20
-#define VR_CURRXDESC1 0x24
-#define VR_CURRXDESC2 0x28
-#define VR_CURRXDESC3 0x2C
-#define VR_NEXTRXDESC0 0x30
-#define VR_NEXTRXDESC1 0x34
-#define VR_NEXTRXDESC2 0x38
-#define VR_NEXTRXDESC3 0x3C
-#define VR_CURTXDESC0 0x40
-#define VR_CURTXDESC1 0x44
-#define VR_CURTXDESC2 0x48
-#define VR_CURTXDESC3 0x4C
-#define VR_NEXTTXDESC0 0x50
-#define VR_NEXTTXDESC1 0x54
-#define VR_NEXTTXDESC2 0x58
-#define VR_NEXTTXDESC3 0x5C
-#define VR_CURRXDMA 0x60 /* current RX DMA address */
-#define VR_CURTXDMA 0x64 /* current TX DMA address */
-#define VR_TALLYCNT 0x68 /* tally counter test register */
-#define VR_PHYADDR 0x6C
-#define VR_MIISTAT 0x6D
-#define VR_BCR0 0x6E
-#define VR_BCR1 0x6F
-#define VR_MIICMD 0x70
-#define VR_MIIADDR 0x71
-#define VR_MIIDATA 0x72
-#define VR_EECSR 0x74
-#define VR_TEST 0x75
-#define VR_GPIO 0x76
-#define VR_CONFIG 0x78
-#define VR_MPA_CNT 0x7C
-#define VR_CRC_CNT 0x7E
-
-/*
- * RX config bits.
- */
-#define VR_RXCFG_RX_ERRPKTS 0x01
-#define VR_RXCFG_RX_RUNT 0x02
-#define VR_RXCFG_RX_MULTI 0x04
-#define VR_RXCFG_RX_BROAD 0x08
-#define VR_RXCFG_RX_PROMISC 0x10
-#define VR_RXCFG_RX_THRESH 0xE0
-
-#define VR_RXTHRESH_32BYTES 0x00
-#define VR_RXTHRESH_64BYTES 0x20
-#define VR_RXTHRESH_128BYTES 0x40
-#define VR_RXTHRESH_256BYTES 0x60
-#define VR_RXTHRESH_512BYTES 0x80
-#define VR_RXTHRESH_768BYTES 0xA0
-#define VR_RXTHRESH_1024BYTES 0xC0
-#define VR_RXTHRESH_STORENFWD 0xE0
-
-/*
- * TX config bits.
- */
-#define VR_TXCFG_RSVD0 0x01
-#define VR_TXCFG_LOOPBKMODE 0x06
-#define VR_TXCFG_BACKOFF 0x08
-#define VR_TXCFG_RSVD1 0x10
-#define VR_TXCFG_TX_THRESH 0xE0
-
-#define VR_TXTHRESH_32BYTES 0x00
-#define VR_TXTHRESH_64BYTES 0x20
-#define VR_TXTHRESH_128BYTES 0x40
-#define VR_TXTHRESH_256BYTES 0x60
-#define VR_TXTHRESH_512BYTES 0x80
-#define VR_TXTHRESH_768BYTES 0xA0
-#define VR_TXTHRESH_1024BYTES 0xC0
-#define VR_TXTHRESH_STORENFWD 0xE0
-
-/*
- * Command register bits.
- */
-#define VR_CMD_INIT 0x0001
-#define VR_CMD_START 0x0002
-#define VR_CMD_STOP 0x0004
-#define VR_CMD_RX_ON 0x0008
-#define VR_CMD_TX_ON 0x0010
-#define VR_CMD_TX_GO 0x0020
-#define VR_CMD_RX_GO 0x0040
-#define VR_CMD_RSVD 0x0080
-#define VR_CMD_RX_EARLY 0x0100
-#define VR_CMD_TX_EARLY 0x0200
-#define VR_CMD_FULLDUPLEX 0x0400
-#define VR_CMD_TX_NOPOLL 0x0800
-
-#define VR_CMD_RESET 0x8000
-
-/*
- * Interrupt status bits.
- */
-#define VR_ISR_RX_OK 0x0001 /* packet rx ok */
-#define VR_ISR_TX_OK 0x0002 /* packet tx ok */
-#define VR_ISR_RX_ERR 0x0004 /* packet rx with err */
-#define VR_ISR_TX_ABRT 0x0008 /* tx aborted due to excess colls */
-#define VR_ISR_TX_UNDERRUN 0x0010 /* tx buffer underflow */
-#define VR_ISR_RX_NOBUF 0x0020 /* no rx buffer available */
-#define VR_ISR_BUSERR 0x0040 /* PCI bus error */
-#define VR_ISR_STATSOFLOW 0x0080 /* stats counter oflow */
-#define VR_ISR_RX_EARLY 0x0100 /* rx early */
-#define VR_ISR_LINKSTAT 0x0200 /* MII status change */
-#define VR_ISR_RX_OFLOW 0x0400 /* rx FIFO overflow */
-#define VR_ISR_RX_DROPPED 0x0800
-#define VR_ISR_RX_NOBUF2 0x1000
-#define VR_ISR_TX_ABRT2 0x2000
-#define VR_ISR_LINKSTAT2 0x4000
-#define VR_ISR_MAGICPACKET 0x8000
-
-/*
- * Interrupt mask bits.
- */
-#define VR_IMR_RX_OK 0x0001 /* packet rx ok */
-#define VR_IMR_TX_OK 0x0002 /* packet tx ok */
-#define VR_IMR_RX_ERR 0x0004 /* packet rx with err */
-#define VR_IMR_TX_ABRT 0x0008 /* tx aborted due to excess colls */
-#define VR_IMR_TX_UNDERRUN 0x0010 /* tx buffer underflow */
-#define VR_IMR_RX_NOBUF 0x0020 /* no rx buffer available */
-#define VR_IMR_BUSERR 0x0040 /* PCI bus error */
-#define VR_IMR_STATSOFLOW 0x0080 /* stats counter oflow */
-#define VR_IMR_RX_EARLY 0x0100 /* rx early */
-#define VR_IMR_LINKSTAT 0x0200 /* MII status change */
-#define VR_IMR_RX_OFLOW 0x0400 /* rx FIFO overflow */
-#define VR_IMR_RX_DROPPED 0x0800
-#define VR_IMR_RX_NOBUF2 0x1000
-#define VR_IMR_TX_ABRT2 0x2000
-#define VR_IMR_LINKSTAT2 0x4000
-#define VR_IMR_MAGICPACKET 0x8000
-
-#define VR_INTRS \
- (VR_IMR_RX_OK|VR_IMR_TX_OK|VR_IMR_RX_NOBUF| \
- VR_IMR_TX_ABRT|VR_IMR_TX_UNDERRUN|VR_IMR_BUSERR| \
- VR_IMR_RX_ERR|VR_ISR_RX_DROPPED)
-
-/*
- * MII status register.
- */
-
-#define VR_MIISTAT_SPEED 0x01
-#define VR_MIISTAT_LINKFAULT 0x02
-#define VR_MIISTAT_MGTREADERR 0x04
-#define VR_MIISTAT_MIIERR 0x08
-#define VR_MIISTAT_PHYOPT 0x10
-#define VR_MIISTAT_MDC_SPEED 0x20
-#define VR_MIISTAT_RSVD 0x40
-#define VR_MIISTAT_GPIO1POLL 0x80
-
-/*
- * MII command register bits.
- */
-#define VR_MIICMD_CLK 0x01
-#define VR_MIICMD_DATAOUT 0x02
-#define VR_MIICMD_DATAIN 0x04
-#define VR_MIICMD_DIR 0x08
-#define VR_MIICMD_DIRECTPGM 0x10
-#define VR_MIICMD_WRITE_ENB 0x20
-#define VR_MIICMD_READ_ENB 0x40
-#define VR_MIICMD_AUTOPOLL 0x80
-
-/*
- * EEPROM control bits.
- */
-#define VR_EECSR_DATAIN 0x01 /* data out */
-#define VR_EECSR_DATAOUT 0x02 /* data in */
-#define VR_EECSR_CLK 0x04 /* clock */
-#define VR_EECSR_CS 0x08 /* chip select */
-#define VR_EECSR_DPM 0x10
-#define VR_EECSR_LOAD 0x20
-#define VR_EECSR_EMBP 0x40
-#define VR_EECSR_EEPR 0x80
-
-#define VR_EECMD_WRITE 0x140
-#define VR_EECMD_READ 0x180
-#define VR_EECMD_ERASE 0x1c0
-
-/*
- * Test register bits.
- */
-#define VR_TEST_TEST0 0x01
-#define VR_TEST_TEST1 0x02
-#define VR_TEST_TEST2 0x04
-#define VR_TEST_TSTUD 0x08
-#define VR_TEST_TSTOV 0x10
-#define VR_TEST_BKOFF 0x20
-#define VR_TEST_FCOL 0x40
-#define VR_TEST_HBDES 0x80
-
-/*
- * Config register bits.
- */
-#define VR_CFG_GPIO2OUTENB 0x00000001
-#define VR_CFG_GPIO2OUT 0x00000002 /* gen. purp. pin */
-#define VR_CFG_GPIO2IN 0x00000004 /* gen. purp. pin */
-#define VR_CFG_AUTOOPT 0x00000008 /* enable rx/tx autopoll */
-#define VR_CFG_MIIOPT 0x00000010
-#define VR_CFG_MMIENB 0x00000020 /* memory mapped mode enb */
-#define VR_CFG_JUMPER 0x00000040 /* PHY and oper. mode select */
-#define VR_CFG_EELOAD 0x00000080 /* enable EEPROM programming */
-#define VR_CFG_LATMENB 0x00000100 /* larency timer effect enb. */
-#define VR_CFG_MRREADWAIT 0x00000200
-#define VR_CFG_MRWRITEWAIT 0x00000400
-#define VR_CFG_RX_ARB 0x00000800
-#define VR_CFG_TX_ARB 0x00001000
-#define VR_CFG_READMULTI 0x00002000
-#define VR_CFG_TX_PACE 0x00004000
-#define VR_CFG_TX_QDIS 0x00008000
-#define VR_CFG_ROMSEL0 0x00010000
-#define VR_CFG_ROMSEL1 0x00020000
-#define VR_CFG_ROMSEL2 0x00040000
-#define VR_CFG_ROMTIMESEL 0x00080000
-#define VR_CFG_RSVD0 0x00100000
-#define VR_CFG_ROMDLY 0x00200000
-#define VR_CFG_ROMOPT 0x00400000
-#define VR_CFG_RSVD1 0x00800000
-#define VR_CFG_BACKOFFOPT 0x01000000
-#define VR_CFG_BACKOFFMOD 0x02000000
-#define VR_CFG_CAPEFFECT 0x04000000
-#define VR_CFG_BACKOFFRAND 0x08000000
-#define VR_CFG_MAGICKPACKET 0x10000000
-#define VR_CFG_PCIREADLINE 0x20000000
-#define VR_CFG_DIAG 0x40000000
-#define VR_CFG_GPIOEN 0x80000000
-
-/*
- * Rhine TX/RX list structure.
- */
-
-struct vr_desc {
- u_int32_t vr_status;
- u_int32_t vr_ctl;
- u_int32_t vr_ptr1;
- u_int32_t vr_ptr2;
-};
-
-#define vr_data vr_ptr1
-#define vr_next vr_ptr2
-
-
-#define VR_RXSTAT_RXERR 0x00000001
-#define VR_RXSTAT_CRCERR 0x00000002
-#define VR_RXSTAT_FRAMEALIGNERR 0x00000004
-#define VR_RXSTAT_FIFOOFLOW 0x00000008
-#define VR_RXSTAT_GIANT 0x00000010
-#define VR_RXSTAT_RUNT 0x00000020
-#define VR_RXSTAT_BUSERR 0x00000040
-#define VR_RXSTAT_BUFFERR 0x00000080
-#define VR_RXSTAT_LASTFRAG 0x00000100
-#define VR_RXSTAT_FIRSTFRAG 0x00000200
-#define VR_RXSTAT_RLINK 0x00000400
-#define VR_RXSTAT_RX_PHYS 0x00000800
-#define VR_RXSTAT_RX_BROAD 0x00001000
-#define VR_RXSTAT_RX_MULTI 0x00002000
-#define VR_RXSTAT_RX_OK 0x00004000
-#define VR_RXSTAT_RXLEN 0x07FF0000
-#define VR_RXSTAT_RXLEN_EXT 0x78000000
-#define VR_RXSTAT_OWN 0x80000000
-
-#define VR_RXBYTES(x) ((x & VR_RXSTAT_RXLEN) >> 16)
-#define VR_RXSTAT (VR_RXSTAT_FIRSTFRAG|VR_RXSTAT_LASTFRAG|VR_RXSTAT_OWN)
-
-#define VR_RXCTL_BUFLEN 0x000007FF
-#define VR_RXCTL_BUFLEN_EXT 0x00007800
-#define VR_RXCTL_CHAIN 0x00008000
-#define VR_RXCTL_RX_INTR 0x00800000
-
-#define VR_RXCTL (VR_RXCTL_CHAIN|VR_RXCTL_RX_INTR)
-
-#define VR_TXSTAT_DEFER 0x00000001
-#define VR_TXSTAT_UNDERRUN 0x00000002
-#define VR_TXSTAT_COLLCNT 0x00000078
-#define VR_TXSTAT_SQE 0x00000080
-#define VR_TXSTAT_ABRT 0x00000100
-#define VR_TXSTAT_LATECOLL 0x00000200
-#define VR_TXSTAT_CARRLOST 0x00000400
-#define VR_TXSTAT_BUSERR 0x00002000
-#define VR_TXSTAT_JABTIMEO 0x00004000
-#define VR_TXSTAT_ERRSUM 0x00008000
-#define VR_TXSTAT_OWN 0x80000000
-
-#define VR_TXCTL_BUFLEN 0x000007FF
-#define VR_TXCTL_BUFLEN_EXT 0x00007800
-#define VR_TXCTL_TLINK 0x00008000
-#define VR_TXCTL_FIRSTFRAG 0x00200000
-#define VR_TXCTL_LASTFRAG 0x00400000
-#define VR_TXCTL_FINT 0x00800000
-
-
-#define VR_MAXFRAGS 16
-#define VR_RX_LIST_CNT 64
-#define VR_TX_LIST_CNT 64
-#define VR_MIN_FRAMELEN 60
-#define VR_FRAMELEN 1536
-#define VR_RXLEN 1520
-
-#define VR_TXOWN(x) x->vr_ptr->vr_status
-
-struct vr_list_data {
- struct vr_desc vr_rx_list[VR_RX_LIST_CNT];
- struct vr_desc vr_tx_list[VR_TX_LIST_CNT];
-};
-
-struct vr_chain {
- struct vr_desc *vr_ptr;
- struct mbuf *vr_mbuf;
- struct vr_chain *vr_nextdesc;
-};
-
-struct vr_chain_onefrag {
- struct vr_desc *vr_ptr;
- struct mbuf *vr_mbuf;
- struct vr_chain_onefrag *vr_nextdesc;
-};
-
-struct vr_chain_data {
- struct vr_chain_onefrag vr_rx_chain[VR_RX_LIST_CNT];
- struct vr_chain vr_tx_chain[VR_TX_LIST_CNT];
-
- struct vr_chain_onefrag *vr_rx_head;
-
- struct vr_chain *vr_tx_head;
- struct vr_chain *vr_tx_tail;
- struct vr_chain *vr_tx_free;
-};
-
-struct vr_type {
- u_int16_t vr_vid;
- u_int16_t vr_did;
- char *vr_name;
-};
-
-struct vr_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define VR_MII_STARTDELIM 0x01
-#define VR_MII_READOP 0x02
-#define VR_MII_WRITEOP 0x01
-#define VR_MII_TURNAROUND 0x02
-
-#define VR_FLAG_FORCEDELAY 1
-#define VR_FLAG_SCHEDDELAY 2
-#define VR_FLAG_DELAYTIMEO 3
-
-struct vr_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t vr_bhandle; /* bus space handle */
- bus_space_tag_t vr_btag; /* bus space tag */
- struct vr_type *vr_info; /* Rhine adapter info */
- struct vr_type *vr_pinfo; /* phy info */
- u_int8_t vr_unit; /* interface number */
- u_int8_t vr_type;
- u_int8_t vr_phy_addr; /* PHY address */
- u_int8_t vr_tx_pend; /* TX pending */
- u_int8_t vr_want_auto;
- u_int8_t vr_autoneg;
- caddr_t vr_ldata_ptr;
- struct vr_list_data *vr_ldata;
- struct vr_chain_data vr_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->vr_btag, sc->vr_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->vr_btag, sc->vr_bhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->vr_btag, sc->vr_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->vr_btag, sc->vr_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->vr_btag, sc->vr_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->vr_btag, sc->vr_bhandle, reg)
-
-#define VR_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * VIA vendor ID
- */
-#define VIA_VENDORID 0x1106
-
-/*
- * VIA Rhine device IDs.
- */
-#define VIA_DEVICEID_RHINE 0x3043
-#define VIA_DEVICEID_RHINE_II 0x6100
-
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define VR_PCI_VENDOR_ID 0x00
-#define VR_PCI_DEVICE_ID 0x02
-#define VR_PCI_COMMAND 0x04
-#define VR_PCI_STATUS 0x06
-#define VR_PCI_CLASSCODE 0x09
-#define VR_PCI_LATENCY_TIMER 0x0D
-#define VR_PCI_HEADER_TYPE 0x0E
-#define VR_PCI_LOIO 0x10
-#define VR_PCI_LOMEM 0x14
-#define VR_PCI_BIOSROM 0x30
-#define VR_PCI_INTLINE 0x3C
-#define VR_PCI_INTPIN 0x3D
-#define VR_PCI_MINGNT 0x3E
-#define VR_PCI_MINLAT 0x0F
-#define VR_PCI_RESETOPT 0x48
-#define VR_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define VR_PCI_CAPID 0xDC /* 8 bits */
-#define VR_PCI_NEXTPTR 0xDD /* 8 bits */
-#define VR_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define VR_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define VR_PSTATE_MASK 0x0003
-#define VR_PSTATE_D0 0x0000
-#define VR_PSTATE_D1 0x0002
-#define VR_PSTATE_D2 0x0002
-#define VR_PSTATE_D3 0x0003
-#define VR_PME_EN 0x0010
-#define VR_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define VR_PHYADDR_MIN 0x00
-#define VR_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_vx_pci.c b/sys/pci/if_vx_pci.c
index ab02693e270d4..f4e98ac0a3ff6 100644
--- a/sys/pci/if_vx_pci.c
+++ b/sys/pci/if_vx_pci.c
@@ -47,7 +47,7 @@
#include <dev/vx/if_vxreg.h>
static void vx_pci_shutdown(int, void *);
-static const char *vx_pci_probe(pcici_t, pcidi_t);
+static char *vx_pci_probe(pcici_t, pcidi_t);
static void vx_pci_attach(pcici_t, int unit);
static void
@@ -59,7 +59,7 @@ vx_pci_shutdown(
vxfree(sc);
}
-static const char*
+static char*
vx_pci_probe(
pcici_t config_id,
pcidi_t device_id)
@@ -96,9 +96,7 @@ vx_pci_attach(
return;
}
- if ((sc = vxalloc(unit)) == NULL) {
- return;
- }
+ sc = vxalloc(unit);
sc->vx_io_addr = pci_conf_read(config_id, 0x10) & 0xffffffe0;
diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c
deleted file mode 100644
index 01cbc3c72c2d2..0000000000000
--- a/sys/pci/if_wb.c
+++ /dev/null
@@ -1,2151 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_wb.c,v 1.36 1999/01/16 05:28:52 wpaul Exp $
- */
-
-/*
- * Winbond fast ethernet PCI NIC driver
- *
- * Supports various cheap network adapters based on the Winbond W89C840F
- * fast ethernet controller chip. This includes adapters manufactured by
- * Winbond itself and some made by Linksys.
- *
- * Written by Bill Paul <wpaul@ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The Winbond W89C840F chip is a bus master; in some ways it resembles
- * a DEC 'tulip' chip, only not as complicated. Unfortunately, it has
- * one major difference which is that while the registers do many of
- * the same things as a tulip adapter, the offsets are different: where
- * tulip registers are typically spaced 8 bytes apart, the Winbond
- * registers are spaced 4 bytes apart. The receiver filter is also
- * programmed differently.
- *
- * Like the tulip, the Winbond chip uses small descriptors containing
- * a status word, a control word and 32-bit areas that can either be used
- * to point to two external data blocks, or to point to a single block
- * and another descriptor in a linked list. Descriptors can be grouped
- * together in blocks to form fixed length rings or can be chained
- * together in linked lists. A single packet may be spread out over
- * several descriptors if necessary.
- *
- * For the receive ring, this driver uses a linked list of descriptors,
- * each pointing to a single mbuf cluster buffer, which us large enough
- * to hold an entire packet. The link list is looped back to created a
- * closed ring.
- *
- * For transmission, the driver creates a linked list of 'super descriptors'
- * which each contain several individual descriptors linked toghether.
- * Each 'super descriptor' contains WB_MAXFRAGS descriptors, which we
- * abuse as fragment pointers. This allows us to use a buffer managment
- * scheme very similar to that used in the ThunderLAN and Etherlink XL
- * drivers.
- *
- * Autonegotiation is performed using the external PHY via the MII bus.
- * The sample boards I have all use a Davicom PHY.
- *
- * Note: the author of the Linux driver for the Winbond chip alludes
- * to some sort of flaw in the chip's design that seems to mandate some
- * drastic workaround which signigicantly impairs transmit performance.
- * I have no idea what he's on about: transmit performance with all
- * three of my test boards seems fine.
- */
-
-#include "bpfilter.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#if NBPFILTER > 0
-#include <net/bpf.h>
-#endif
-
-#include <vm/vm.h> /* for vtophys */
-#include <vm/pmap.h> /* for vtophys */
-#include <machine/clock.h> /* for DELAY */
-#include <machine/bus_memio.h>
-#include <machine/bus_pio.h>
-#include <machine/bus.h>
-
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-
-#define WB_USEIOSPACE
-
-/* #define WB_BACKGROUND_AUTONEG */
-
-#include <pci/if_wbreg.h>
-
-#ifndef lint
-static const char rcsid[] =
- "$Id: if_wb.c,v 1.36 1999/01/16 05:28:52 wpaul Exp $";
-#endif
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct wb_type wb_devs[] = {
- { WB_VENDORID, WB_DEVICEID_840F,
- "Winbond W89C840F 10/100BaseTX" },
- { CP_VENDORID, CP_DEVICEID_RL100,
- "Compex RL100-ATX 10/100baseTX" },
- { 0, 0, NULL }
-};
-
-/*
- * Various supported PHY vendors/types and their names. Note that
- * this driver will work with pretty much any MII-compliant PHY,
- * so failure to positively identify the chip is not a fatal error.
- */
-
-static struct wb_type wb_phys[] = {
- { TI_PHY_VENDORID, TI_PHY_10BT, "<TI ThunderLAN 10BT (internal)>" },
- { TI_PHY_VENDORID, TI_PHY_100VGPMI, "<TI TNETE211 100VG Any-LAN>" },
- { NS_PHY_VENDORID, NS_PHY_83840A, "<National Semiconductor DP83840A>"},
- { LEVEL1_PHY_VENDORID, LEVEL1_PHY_LXT970, "<Level 1 LXT970>" },
- { INTEL_PHY_VENDORID, INTEL_PHY_82555, "<Intel 82555>" },
- { SEEQ_PHY_VENDORID, SEEQ_PHY_80220, "<SEEQ 80220>" },
- { 0, 0, "<MII-compliant physical interface>" }
-};
-
-static unsigned long wb_count = 0;
-static const char *wb_probe __P((pcici_t, pcidi_t));
-static void wb_attach __P((pcici_t, int));
-
-static int wb_newbuf __P((struct wb_softc *,
- struct wb_chain_onefrag *));
-static int wb_encap __P((struct wb_softc *, struct wb_chain *,
- struct mbuf *));
-
-static void wb_rxeof __P((struct wb_softc *));
-static void wb_rxeoc __P((struct wb_softc *));
-static void wb_txeof __P((struct wb_softc *));
-static void wb_txeoc __P((struct wb_softc *));
-static void wb_intr __P((void *));
-static void wb_start __P((struct ifnet *));
-static int wb_ioctl __P((struct ifnet *, u_long, caddr_t));
-static void wb_init __P((void *));
-static void wb_stop __P((struct wb_softc *));
-static void wb_watchdog __P((struct ifnet *));
-static void wb_shutdown __P((int, void *));
-static int wb_ifmedia_upd __P((struct ifnet *));
-static void wb_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
-
-static void wb_eeprom_putbyte __P((struct wb_softc *, int));
-static void wb_eeprom_getword __P((struct wb_softc *, int, u_int16_t *));
-static void wb_read_eeprom __P((struct wb_softc *, caddr_t, int,
- int, int));
-static void wb_mii_sync __P((struct wb_softc *));
-static void wb_mii_send __P((struct wb_softc *, u_int32_t, int));
-static int wb_mii_readreg __P((struct wb_softc *, struct wb_mii_frame *));
-static int wb_mii_writereg __P((struct wb_softc *, struct wb_mii_frame *));
-static u_int16_t wb_phy_readreg __P((struct wb_softc *, int));
-static void wb_phy_writereg __P((struct wb_softc *, int, int));
-
-static void wb_autoneg_xmit __P((struct wb_softc *));
-static void wb_autoneg_mii __P((struct wb_softc *, int, int));
-static void wb_setmode_mii __P((struct wb_softc *, int));
-static void wb_getmode_mii __P((struct wb_softc *));
-static void wb_setcfg __P((struct wb_softc *, int));
-static u_int8_t wb_calchash __P((caddr_t));
-static void wb_setmulti __P((struct wb_softc *));
-static void wb_reset __P((struct wb_softc *));
-static int wb_list_rx_init __P((struct wb_softc *));
-static int wb_list_tx_init __P((struct wb_softc *));
-
-#define WB_SETBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) | x)
-
-#define WB_CLRBIT(sc, reg, x) \
- CSR_WRITE_4(sc, reg, \
- CSR_READ_4(sc, reg) & ~x)
-
-#define SIO_SET(x) \
- CSR_WRITE_4(sc, WB_SIO, \
- CSR_READ_4(sc, WB_SIO) | x)
-
-#define SIO_CLR(x) \
- CSR_WRITE_4(sc, WB_SIO, \
- CSR_READ_4(sc, WB_SIO) & ~x)
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void wb_eeprom_putbyte(sc, addr)
- struct wb_softc *sc;
- int addr;
-{
- register int d, i;
-
- d = addr | WB_EECMD_READ;
-
- /*
- * Feed in each bit and stobe the clock.
- */
- for (i = 0x400; i; i >>= 1) {
- if (d & i) {
- SIO_SET(WB_SIO_EE_DATAIN);
- } else {
- SIO_CLR(WB_SIO_EE_DATAIN);
- }
- DELAY(100);
- SIO_SET(WB_SIO_EE_CLK);
- DELAY(150);
- SIO_CLR(WB_SIO_EE_CLK);
- DELAY(100);
- }
-
- return;
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void wb_eeprom_getword(sc, addr, dest)
- struct wb_softc *sc;
- int addr;
- u_int16_t *dest;
-{
- register int i;
- u_int16_t word = 0;
-
- /* Enter EEPROM access mode. */
- CSR_WRITE_4(sc, WB_SIO, WB_SIO_EESEL|WB_SIO_EE_CS);
-
- /*
- * Send address of word we want to read.
- */
- wb_eeprom_putbyte(sc, addr);
-
- CSR_WRITE_4(sc, WB_SIO, WB_SIO_EESEL|WB_SIO_EE_CS);
-
- /*
- * Start reading bits from EEPROM.
- */
- for (i = 0x8000; i; i >>= 1) {
- SIO_SET(WB_SIO_EE_CLK);
- DELAY(100);
- if (CSR_READ_4(sc, WB_SIO) & WB_SIO_EE_DATAOUT)
- word |= i;
- SIO_CLR(WB_SIO_EE_CLK);
- DELAY(100);
- }
-
- /* Turn off EEPROM access mode. */
- CSR_WRITE_4(sc, WB_SIO, 0);
-
- *dest = word;
-
- return;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void wb_read_eeprom(sc, dest, off, cnt, swap)
- struct wb_softc *sc;
- caddr_t dest;
- int off;
- int cnt;
- int swap;
-{
- int i;
- u_int16_t word = 0, *ptr;
-
- for (i = 0; i < cnt; i++) {
- wb_eeprom_getword(sc, off + i, &word);
- ptr = (u_int16_t *)(dest + (i * 2));
- if (swap)
- *ptr = ntohs(word);
- else
- *ptr = word;
- }
-
- return;
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void wb_mii_sync(sc)
- struct wb_softc *sc;
-{
- register int i;
-
- SIO_SET(WB_SIO_MII_DIR|WB_SIO_MII_DATAIN);
-
- for (i = 0; i < 32; i++) {
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- }
-
- return;
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void wb_mii_send(sc, bits, cnt)
- struct wb_softc *sc;
- u_int32_t bits;
- int cnt;
-{
- int i;
-
- SIO_CLR(WB_SIO_MII_CLK);
-
- for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
- if (bits & i) {
- SIO_SET(WB_SIO_MII_DATAIN);
- } else {
- SIO_CLR(WB_SIO_MII_DATAIN);
- }
- DELAY(1);
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- }
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int wb_mii_readreg(sc, frame)
- struct wb_softc *sc;
- struct wb_mii_frame *frame;
-
-{
- int i, ack, s;
-
- s = splimp();
-
- /*
- * Set up frame for RX.
- */
- frame->mii_stdelim = WB_MII_STARTDELIM;
- frame->mii_opcode = WB_MII_READOP;
- frame->mii_turnaround = 0;
- frame->mii_data = 0;
-
- CSR_WRITE_4(sc, WB_SIO, 0);
-
- /*
- * Turn on data xmit.
- */
- SIO_SET(WB_SIO_MII_DIR);
-
- wb_mii_sync(sc);
-
- /*
- * Send command/address info.
- */
- wb_mii_send(sc, frame->mii_stdelim, 2);
- wb_mii_send(sc, frame->mii_opcode, 2);
- wb_mii_send(sc, frame->mii_phyaddr, 5);
- wb_mii_send(sc, frame->mii_regaddr, 5);
-
- /* Idle bit */
- SIO_CLR((WB_SIO_MII_CLK|WB_SIO_MII_DATAIN));
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
-
- /* Turn off xmit. */
- SIO_CLR(WB_SIO_MII_DIR);
- /* Check for ack */
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- ack = CSR_READ_4(sc, WB_SIO) & WB_SIO_MII_DATAOUT;
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
-
- /*
- * Now try reading data bits. If the ack failed, we still
- * need to clock through 16 cycles to keep the PHY(s) in sync.
- */
- if (ack) {
- for(i = 0; i < 16; i++) {
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- }
- goto fail;
- }
-
- for (i = 0x8000; i; i >>= 1) {
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- if (!ack) {
- if (CSR_READ_4(sc, WB_SIO) & WB_SIO_MII_DATAOUT)
- frame->mii_data |= i;
- DELAY(1);
- }
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- }
-
-fail:
-
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
-
- splx(s);
-
- if (ack)
- return(1);
- return(0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int wb_mii_writereg(sc, frame)
- struct wb_softc *sc;
- struct wb_mii_frame *frame;
-
-{
- int s;
-
- s = splimp();
- /*
- * Set up frame for TX.
- */
-
- frame->mii_stdelim = WB_MII_STARTDELIM;
- frame->mii_opcode = WB_MII_WRITEOP;
- frame->mii_turnaround = WB_MII_TURNAROUND;
-
- /*
- * Turn on data output.
- */
- SIO_SET(WB_SIO_MII_DIR);
-
- wb_mii_sync(sc);
-
- wb_mii_send(sc, frame->mii_stdelim, 2);
- wb_mii_send(sc, frame->mii_opcode, 2);
- wb_mii_send(sc, frame->mii_phyaddr, 5);
- wb_mii_send(sc, frame->mii_regaddr, 5);
- wb_mii_send(sc, frame->mii_turnaround, 2);
- wb_mii_send(sc, frame->mii_data, 16);
-
- /* Idle bit. */
- SIO_SET(WB_SIO_MII_CLK);
- DELAY(1);
- SIO_CLR(WB_SIO_MII_CLK);
- DELAY(1);
-
- /*
- * Turn off xmit.
- */
- SIO_CLR(WB_SIO_MII_DIR);
-
- splx(s);
-
- return(0);
-}
-
-static u_int16_t wb_phy_readreg(sc, reg)
- struct wb_softc *sc;
- int reg;
-{
- struct wb_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->wb_phy_addr;
- frame.mii_regaddr = reg;
- wb_mii_readreg(sc, &frame);
-
- return(frame.mii_data);
-}
-
-static void wb_phy_writereg(sc, reg, data)
- struct wb_softc *sc;
- int reg;
- int data;
-{
- struct wb_mii_frame frame;
-
- bzero((char *)&frame, sizeof(frame));
-
- frame.mii_phyaddr = sc->wb_phy_addr;
- frame.mii_regaddr = reg;
- frame.mii_data = data;
-
- wb_mii_writereg(sc, &frame);
-
- return;
-}
-
-static u_int8_t wb_calchash(addr)
- caddr_t addr;
-{
- u_int32_t crc, carry;
- int i, j;
- u_int8_t c;
-
- /* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (i = 0; i < 6; i++) {
- c = *(addr + i);
- for (j = 0; j < 8; j++) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (c & 0x01);
- crc <<= 1;
- c >>= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /*
- * return the filter bit position
- * Note: I arrived at the following nonsense
- * through experimentation. It's not the usual way to
- * generate the bit position but it's the only thing
- * I could come up with that works.
- */
- return(~(crc >> 26) & 0x0000003F);
-}
-
-/*
- * Program the 64-bit multicast hash filter.
- */
-static void wb_setmulti(sc)
- struct wb_softc *sc;
-{
- struct ifnet *ifp;
- int h = 0;
- u_int32_t hashes[2] = { 0, 0 };
- struct ifmultiaddr *ifma;
- u_int32_t rxfilt;
- int mcnt = 0;
-
- ifp = &sc->arpcom.ac_if;
-
- rxfilt = CSR_READ_4(sc, WB_NETCFG);
-
- if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
- rxfilt |= WB_NETCFG_RX_MULTI;
- CSR_WRITE_4(sc, WB_NETCFG, rxfilt);
- CSR_WRITE_4(sc, WB_MAR0, 0xFFFFFFFF);
- CSR_WRITE_4(sc, WB_MAR1, 0xFFFFFFFF);
- return;
- }
-
- /* first, zot all the existing hash bits */
- CSR_WRITE_4(sc, WB_MAR0, 0);
- CSR_WRITE_4(sc, WB_MAR1, 0);
-
- /* now program new ones */
- for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
- ifma = ifma->ifma_link.le_next) {
- if (ifma->ifma_addr->sa_family != AF_LINK)
- continue;
- h = wb_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
- mcnt++;
- }
-
- if (mcnt)
- rxfilt |= WB_NETCFG_RX_MULTI;
- else
- rxfilt &= ~WB_NETCFG_RX_MULTI;
-
- CSR_WRITE_4(sc, WB_MAR0, hashes[0]);
- CSR_WRITE_4(sc, WB_MAR1, hashes[1]);
- CSR_WRITE_4(sc, WB_NETCFG, rxfilt);
-
- return;
-}
-
-/*
- * Initiate an autonegotiation session.
- */
-static void wb_autoneg_xmit(sc)
- struct wb_softc *sc;
-{
- u_int16_t phy_sts;
-
- wb_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(wb_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
-
- phy_sts = wb_phy_readreg(sc, PHY_BMCR);
- phy_sts |= PHY_BMCR_AUTONEGENBL|PHY_BMCR_AUTONEGRSTR;
- wb_phy_writereg(sc, PHY_BMCR, phy_sts);
-
- return;
-}
-
-/*
- * Invoke autonegotiation on a PHY.
- */
-static void wb_autoneg_mii(sc, flag, verbose)
- struct wb_softc *sc;
- int flag;
- int verbose;
-{
- u_int16_t phy_sts = 0, media, advert, ability;
- struct ifnet *ifp;
- struct ifmedia *ifm;
-
- ifm = &sc->ifmedia;
- ifp = &sc->arpcom.ac_if;
-
- ifm->ifm_media = IFM_ETHER | IFM_AUTO;
-
- /*
- * The 100baseT4 PHY on the 3c905-T4 has the 'autoneg supported'
- * bit cleared in the status register, but has the 'autoneg enabled'
- * bit set in the control register. This is a contradiction, and
- * I'm not sure how to handle it. If you want to force an attempt
- * to autoneg for 100baseT4 PHYs, #define FORCE_AUTONEG_TFOUR
- * and see what happens.
- */
-#ifndef FORCE_AUTONEG_TFOUR
- /*
- * First, see if autoneg is supported. If not, there's
- * no point in continuing.
- */
- phy_sts = wb_phy_readreg(sc, PHY_BMSR);
- if (!(phy_sts & PHY_BMSR_CANAUTONEG)) {
- if (verbose)
- printf("wb%d: autonegotiation not supported\n",
- sc->wb_unit);
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- return;
- }
-#endif
-
- switch (flag) {
- case WB_FLAG_FORCEDELAY:
- /*
- * XXX Never use this option anywhere but in the probe
- * routine: making the kernel stop dead in its tracks
- * for three whole seconds after we've gone multi-user
- * is really bad manners.
- */
- wb_autoneg_xmit(sc);
- DELAY(5000000);
- break;
- case WB_FLAG_SCHEDDELAY:
- /*
- * Wait for the transmitter to go idle before starting
- * an autoneg session, otherwise wb_start() may clobber
- * our timeout, and we don't want to allow transmission
- * during an autoneg session since that can screw it up.
- */
- if (sc->wb_cdata.wb_tx_head != NULL) {
- sc->wb_want_auto = 1;
- return;
- }
- wb_autoneg_xmit(sc);
- ifp->if_timer = 5;
- sc->wb_autoneg = 1;
- sc->wb_want_auto = 0;
- return;
- break;
- case WB_FLAG_DELAYTIMEO:
- ifp->if_timer = 0;
- sc->wb_autoneg = 0;
- break;
- default:
- printf("wb%d: invalid autoneg flag: %d\n", sc->wb_unit, flag);
- return;
- }
-
- if (wb_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_AUTONEGCOMP) {
- if (verbose)
- printf("wb%d: autoneg complete, ", sc->wb_unit);
- phy_sts = wb_phy_readreg(sc, PHY_BMSR);
- } else {
- if (verbose)
- printf("wb%d: autoneg not complete, ", sc->wb_unit);
- }
-
- media = wb_phy_readreg(sc, PHY_BMCR);
-
- /* Link is good. Report modes and set duplex mode. */
- if (wb_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT) {
- if (verbose)
- printf("link status good ");
- advert = wb_phy_readreg(sc, PHY_ANAR);
- ability = wb_phy_readreg(sc, PHY_LPAR);
-
- if (advert & PHY_ANAR_100BT4 && ability & PHY_ANAR_100BT4) {
- ifm->ifm_media = IFM_ETHER|IFM_100_T4;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(100baseT4)\n");
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- media |= PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifm->ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- media |= PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 100Mbps)\n");
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media |= PHY_BMCR_DUPLEX;
- printf("(full-duplex, 10Mbps)\n");
- } else /* if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) */ {
- ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
- media &= ~PHY_BMCR_SPEEDSEL;
- media &= ~PHY_BMCR_DUPLEX;
- printf("(half-duplex, 10Mbps)\n");
- }
-
- media &= ~PHY_BMCR_AUTONEGENBL;
-
- /* Set ASIC's duplex mode to match the PHY. */
- wb_setcfg(sc, media);
- wb_phy_writereg(sc, PHY_BMCR, media);
- } else {
- if (verbose)
- printf("no carrier\n");
- }
-
- wb_init(sc);
-
- if (sc->wb_tx_pend) {
- sc->wb_autoneg = 0;
- sc->wb_tx_pend = 0;
- wb_start(ifp);
- }
-
- return;
-}
-
-static void wb_getmode_mii(sc)
- struct wb_softc *sc;
-{
- u_int16_t bmsr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- bmsr = wb_phy_readreg(sc, PHY_BMSR);
- if (bootverbose)
- printf("wb%d: PHY status word: %x\n", sc->wb_unit, bmsr);
-
- /* fallback */
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX;
-
- if (bmsr & PHY_BMSR_10BTHALF) {
- if (bootverbose)
- printf("wb%d: 10Mbps half-duplex mode supported\n",
- sc->wb_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_HDX, 0, NULL);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
- }
-
- if (bmsr & PHY_BMSR_10BTFULL) {
- if (bootverbose)
- printf("wb%d: 10Mbps full-duplex mode supported\n",
- sc->wb_unit);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXHALF) {
- if (bootverbose)
- printf("wb%d: 100Mbps half-duplex mode supported\n",
- sc->wb_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_HDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_HDX;
- }
-
- if (bmsr & PHY_BMSR_100BTXFULL) {
- if (bootverbose)
- printf("wb%d: 100Mbps full-duplex mode supported\n",
- sc->wb_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia,
- IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- }
-
- /* Some also support 100BaseT4. */
- if (bmsr & PHY_BMSR_100BT4) {
- if (bootverbose)
- printf("wb%d: 100baseT4 mode supported\n", sc->wb_unit);
- ifp->if_baudrate = 100000000;
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_T4, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_100_T4;
-#ifdef FORCE_AUTONEG_TFOUR
- if (bootverbose)
- printf("wb%d: forcing on autoneg support for BT4\n",
- sc->wb_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
-#endif
- }
-
- if (bmsr & PHY_BMSR_CANAUTONEG) {
- if (bootverbose)
- printf("wb%d: autoneg supported\n", sc->wb_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
- sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
- }
-
- return;
-}
-
-/*
- * Set speed and duplex mode.
- */
-static void wb_setmode_mii(sc, media)
- struct wb_softc *sc;
- int media;
-{
- u_int16_t bmcr;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /*
- * If an autoneg session is in progress, stop it.
- */
- if (sc->wb_autoneg) {
- printf("wb%d: canceling autoneg session\n", sc->wb_unit);
- ifp->if_timer = sc->wb_autoneg = sc->wb_want_auto = 0;
- bmcr = wb_phy_readreg(sc, PHY_BMCR);
- bmcr &= ~PHY_BMCR_AUTONEGENBL;
- wb_phy_writereg(sc, PHY_BMCR, bmcr);
- }
-
- printf("wb%d: selecting MII, ", sc->wb_unit);
-
- bmcr = wb_phy_readreg(sc, PHY_BMCR);
-
- bmcr &= ~(PHY_BMCR_AUTONEGENBL|PHY_BMCR_SPEEDSEL|
- PHY_BMCR_DUPLEX|PHY_BMCR_LOOPBK);
-
- if (IFM_SUBTYPE(media) == IFM_100_T4) {
- printf("100Mbps/T4, half-duplex\n");
- bmcr |= PHY_BMCR_SPEEDSEL;
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- if (IFM_SUBTYPE(media) == IFM_100_TX) {
- printf("100Mbps, ");
- bmcr |= PHY_BMCR_SPEEDSEL;
- }
-
- if (IFM_SUBTYPE(media) == IFM_10_T) {
- printf("10Mbps, ");
- bmcr &= ~PHY_BMCR_SPEEDSEL;
- }
-
- if ((media & IFM_GMASK) == IFM_FDX) {
- printf("full duplex\n");
- bmcr |= PHY_BMCR_DUPLEX;
- } else {
- printf("half duplex\n");
- bmcr &= ~PHY_BMCR_DUPLEX;
- }
-
- wb_setcfg(sc, bmcr);
- wb_phy_writereg(sc, PHY_BMCR, bmcr);
-
- return;
-}
-
-/*
- * The Winbond manual states that in order to fiddle with the
- * 'full-duplex' and '100Mbps' bits in the netconfig register, we
- * first have to put the transmit and/or receive logic in the idle state.
- */
-static void wb_setcfg(sc, bmcr)
- struct wb_softc *sc;
- int bmcr;
-{
- int i, restart = 0;
-
- if (CSR_READ_4(sc, WB_NETCFG) & (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON)) {
- restart = 1;
- WB_CLRBIT(sc, WB_NETCFG, (WB_NETCFG_TX_ON|WB_NETCFG_RX_ON));
-
- for (i = 0; i < WB_TIMEOUT; i++) {
- DELAY(10);
- if ((CSR_READ_4(sc, WB_ISR) & WB_ISR_TX_IDLE) &&
- (CSR_READ_4(sc, WB_ISR) & WB_ISR_RX_IDLE))
- break;
- }
-
- if (i == WB_TIMEOUT)
- printf("wb%d: failed to force tx and "
- "rx to idle state\n", sc->wb_unit);
- }
-
- if (bmcr & PHY_BMCR_SPEEDSEL)
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_100MBPS);
- else
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_100MBPS);
-
- if (bmcr & PHY_BMCR_DUPLEX)
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_FULLDUPLEX);
- else
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_FULLDUPLEX);
-
- if (restart)
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON|WB_NETCFG_RX_ON);
-
- return;
-}
-
-static void wb_reset(sc)
- struct wb_softc *sc;
-{
- register int i;
-
- WB_SETBIT(sc, WB_BUSCTL, WB_BUSCTL_RESET);
-
- for (i = 0; i < WB_TIMEOUT; i++) {
- DELAY(10);
- if (!(CSR_READ_4(sc, WB_BUSCTL) & WB_BUSCTL_RESET))
- break;
- }
- if (i == WB_TIMEOUT)
- printf("wb%d: reset never completed!\n", sc->wb_unit);
-
- /* Wait a little while for the chip to get its brains in order. */
- DELAY(1000);
-
- /* Reset the damn PHY too. */
- if (sc->wb_pinfo != NULL)
- wb_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
-
- return;
-}
-
-/*
- * Probe for a Winbond chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static const char *
-wb_probe(config_id, device_id)
- pcici_t config_id;
- pcidi_t device_id;
-{
- struct wb_type *t;
-
- t = wb_devs;
-
- while(t->wb_name != NULL) {
- if ((device_id & 0xFFFF) == t->wb_vid &&
- ((device_id >> 16) & 0xFFFF) == t->wb_did) {
- return(t->wb_name);
- }
- t++;
- }
-
- return(NULL);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static void
-wb_attach(config_id, unit)
- pcici_t config_id;
- int unit;
-{
- int s, i;
-#ifndef WB_USEIOSPACE
- vm_offset_t pbase, vbase;
-#endif
- u_char eaddr[ETHER_ADDR_LEN];
- u_int32_t command;
- struct wb_softc *sc;
- struct ifnet *ifp;
- int media = IFM_ETHER|IFM_100_TX|IFM_FDX;
- unsigned int round;
- caddr_t roundptr;
- struct wb_type *p;
- u_int16_t phy_vid, phy_did, phy_sts;
-
- s = splimp();
-
- sc = malloc(sizeof(struct wb_softc), M_DEVBUF, M_NOWAIT);
- if (sc == NULL) {
- printf("wb%d: no memory for softc struct!\n", unit);
- return;
- }
- bzero(sc, sizeof(struct wb_softc));
-
- /*
- * Handle power management nonsense.
- */
-
- command = pci_conf_read(config_id, WB_PCI_CAPID) & 0x000000FF;
- if (command == 0x01) {
-
- command = pci_conf_read(config_id, WB_PCI_PWRMGMTCTRL);
- if (command & WB_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_conf_read(config_id, WB_PCI_LOIO);
- membase = pci_conf_read(config_id, WB_PCI_LOMEM);
- irq = pci_conf_read(config_id, WB_PCI_INTLINE);
-
- /* Reset the power state. */
- printf("wb%d: chip is in D%d power mode "
- "-- setting to D0\n", unit, command & WB_PSTATE_MASK);
- command &= 0xFFFFFFFC;
- pci_conf_write(config_id, WB_PCI_PWRMGMTCTRL, command);
-
- /* Restore PCI config data. */
- pci_conf_write(config_id, WB_PCI_LOIO, iobase);
- pci_conf_write(config_id, WB_PCI_LOMEM, membase);
- pci_conf_write(config_id, WB_PCI_INTLINE, irq);
- }
- }
-
- /*
- * Map control/status registers.
- */
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
- command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
- pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, command);
- command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
-
-#ifdef WB_USEIOSPACE
- if (!(command & PCIM_CMD_PORTEN)) {
- printf("wb%d: failed to enable I/O ports!\n", unit);
- free(sc, M_DEVBUF);
- goto fail;
- }
-
- if (!pci_map_port(config_id, WB_PCI_LOIO,
- (u_int16_t *)&(sc->wb_bhandle))) {
- printf ("wb%d: couldn't map ports\n", unit);
- goto fail;
- }
- sc->wb_btag = I386_BUS_SPACE_IO;
-#else
- if (!(command & PCIM_CMD_MEMEN)) {
- printf("wb%d: failed to enable memory mapping!\n", unit);
- goto fail;
- }
-
- if (!pci_map_mem(config_id, WB_PCI_LOMEM, &vbase, &pbase)) {
- printf ("wb%d: couldn't map memory\n", unit);
- goto fail;
- }
- sc->csr = (volatile caddr_t)vbase;
- sc->wb_btag = I386_BUS_SPACE_MEM;
- sc->wb_bhandle = vbase;
-#endif
-
- /* Allocate interrupt */
- if (!pci_map_int(config_id, wb_intr, sc, &net_imask)) {
- printf("wb%d: couldn't map interrupt\n", unit);
- goto fail;
- }
-
- /* Reset the adapter. */
- wb_reset(sc);
-
- /*
- * Get station address from the EEPROM.
- */
- wb_read_eeprom(sc, (caddr_t)&eaddr, 0, 3, 0);
-
- /*
- * A Winbond chip was detected. Inform the world.
- */
- printf("wb%d: Ethernet address: %6D\n", unit, eaddr, ":");
-
- sc->wb_unit = unit;
- bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
- sc->wb_ldata_ptr = malloc(sizeof(struct wb_list_data) + 8,
- M_DEVBUF, M_NOWAIT);
- if (sc->wb_ldata_ptr == NULL) {
- free(sc, M_DEVBUF);
- printf("wb%d: no memory for list buffers!\n", unit);
- return;
- }
-
- sc->wb_ldata = (struct wb_list_data *)sc->wb_ldata_ptr;
- round = (unsigned int)sc->wb_ldata_ptr & 0xF;
- roundptr = sc->wb_ldata_ptr;
- for (i = 0; i < 8; i++) {
- if (round % 8) {
- round++;
- roundptr++;
- } else
- break;
- }
- sc->wb_ldata = (struct wb_list_data *)roundptr;
- bzero(sc->wb_ldata, sizeof(struct wb_list_data));
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_softc = sc;
- ifp->if_unit = unit;
- ifp->if_name = "wb";
- ifp->if_mtu = ETHERMTU;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
- ifp->if_ioctl = wb_ioctl;
- ifp->if_output = ether_output;
- ifp->if_start = wb_start;
- ifp->if_watchdog = wb_watchdog;
- ifp->if_init = wb_init;
- ifp->if_baudrate = 10000000;
-
- if (bootverbose)
- printf("wb%d: probing for a PHY\n", sc->wb_unit);
- for (i = WB_PHYADDR_MIN; i < WB_PHYADDR_MAX + 1; i++) {
- if (bootverbose)
- printf("wb%d: checking address: %d\n",
- sc->wb_unit, i);
- sc->wb_phy_addr = i;
- wb_phy_writereg(sc, PHY_BMCR, PHY_BMCR_RESET);
- DELAY(500);
- while(wb_phy_readreg(sc, PHY_BMCR)
- & PHY_BMCR_RESET);
- if ((phy_sts = wb_phy_readreg(sc, PHY_BMSR)))
- break;
- }
- if (phy_sts) {
- phy_vid = wb_phy_readreg(sc, PHY_VENID);
- phy_did = wb_phy_readreg(sc, PHY_DEVID);
- if (bootverbose)
- printf("wb%d: found PHY at address %d, ",
- sc->wb_unit, sc->wb_phy_addr);
- if (bootverbose)
- printf("vendor id: %x device id: %x\n",
- phy_vid, phy_did);
- p = wb_phys;
- while(p->wb_vid) {
- if (phy_vid == p->wb_vid &&
- (phy_did | 0x000F) == p->wb_did) {
- sc->wb_pinfo = p;
- break;
- }
- p++;
- }
- if (sc->wb_pinfo == NULL)
- sc->wb_pinfo = &wb_phys[PHY_UNKNOWN];
- if (bootverbose)
- printf("wb%d: PHY type: %s\n",
- sc->wb_unit, sc->wb_pinfo->wb_name);
- } else {
- printf("wb%d: MII without any phy!\n", sc->wb_unit);
- goto fail;
- }
-
- /*
- * Do ifmedia setup.
- */
- ifmedia_init(&sc->ifmedia, 0, wb_ifmedia_upd, wb_ifmedia_sts);
-
- wb_getmode_mii(sc);
- wb_autoneg_mii(sc, WB_FLAG_FORCEDELAY, 1);
- media = sc->ifmedia.ifm_media;
- wb_stop(sc);
-
- ifmedia_set(&sc->ifmedia, media);
-
- /*
- * Call MI attach routines.
- */
- if_attach(ifp);
- ether_ifattach(ifp);
-
-#if NBPFILTER > 0
- bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
- at_shutdown(wb_shutdown, sc, SHUTDOWN_POST_SYNC);
-
-fail:
- splx(s);
- return;
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int wb_list_tx_init(sc)
- struct wb_softc *sc;
-{
- struct wb_chain_data *cd;
- struct wb_list_data *ld;
- int i;
-
- cd = &sc->wb_cdata;
- ld = sc->wb_ldata;
-
- for (i = 0; i < WB_TX_LIST_CNT; i++) {
- cd->wb_tx_chain[i].wb_ptr = &ld->wb_tx_list[i];
- if (i == (WB_TX_LIST_CNT - 1)) {
- cd->wb_tx_chain[i].wb_nextdesc =
- &cd->wb_tx_chain[0];
- } else {
- cd->wb_tx_chain[i].wb_nextdesc =
- &cd->wb_tx_chain[i + 1];
- }
- }
-
- cd->wb_tx_free = &cd->wb_tx_chain[0];
- cd->wb_tx_tail = cd->wb_tx_head = NULL;
-
- return(0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int wb_list_rx_init(sc)
- struct wb_softc *sc;
-{
- struct wb_chain_data *cd;
- struct wb_list_data *ld;
- int i;
-
- cd = &sc->wb_cdata;
- ld = sc->wb_ldata;
-
- for (i = 0; i < WB_RX_LIST_CNT; i++) {
- cd->wb_rx_chain[i].wb_ptr =
- (struct wb_desc *)&ld->wb_rx_list[i];
- if (wb_newbuf(sc, &cd->wb_rx_chain[i]) == ENOBUFS)
- return(ENOBUFS);
- if (i == (WB_RX_LIST_CNT - 1)) {
- cd->wb_rx_chain[i].wb_nextdesc = &cd->wb_rx_chain[0];
- ld->wb_rx_list[i].wb_next =
- vtophys(&ld->wb_rx_list[0]);
- } else {
- cd->wb_rx_chain[i].wb_nextdesc =
- &cd->wb_rx_chain[i + 1];
- ld->wb_rx_list[i].wb_next =
- vtophys(&ld->wb_rx_list[i + 1]);
- }
- }
-
- cd->wb_rx_head = &cd->wb_rx_chain[0];
-
- return(0);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- */
-static int wb_newbuf(sc, c)
- struct wb_softc *sc;
- struct wb_chain_onefrag *c;
-{
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("wb%d: no memory for rx list -- packet dropped!\n",
- sc->wb_unit);
- return(ENOBUFS);
- }
-
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("wb%d: no memory for rx list -- packet dropped!\n",
- sc->wb_unit);
- m_freem(m_new);
- return(ENOBUFS);
- }
-
- c->wb_mbuf = m_new;
- c->wb_ptr->wb_data = vtophys(mtod(m_new, caddr_t));
- c->wb_ptr->wb_ctl = WB_RXCTL_RLINK | (MCLBYTES - 1);
- c->wb_ptr->wb_status = WB_RXSTAT;
-
- return(0);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void wb_rxeof(sc)
- struct wb_softc *sc;
-{
- struct ether_header *eh;
- struct mbuf *m;
- struct ifnet *ifp;
- struct wb_chain_onefrag *cur_rx;
- int total_len = 0;
- u_int32_t rxstat;
-
- ifp = &sc->arpcom.ac_if;
-
- while(!((rxstat = sc->wb_cdata.wb_rx_head->wb_ptr->wb_status) &
- WB_RXSTAT_OWN)) {
- cur_rx = sc->wb_cdata.wb_rx_head;
- sc->wb_cdata.wb_rx_head = cur_rx->wb_nextdesc;
-
- if ((rxstat & WB_RXSTAT_MIIERR)
- || WB_RXBYTES(cur_rx->wb_ptr->wb_status) == 0) {
- ifp->if_ierrors++;
- wb_reset(sc);
- printf("wb%x: receiver babbling: possible chip "
- "bug, forcing reset\n", sc->wb_unit);
- ifp->if_flags |= IFF_OACTIVE;
- ifp->if_timer = 2;
- return;
- }
-
- if (rxstat & WB_RXSTAT_RXERR) {
- ifp->if_ierrors++;
- cur_rx->wb_ptr->wb_ctl =
- WB_RXCTL_RLINK | (MCLBYTES - 1);
- cur_rx->wb_ptr->wb_status = WB_RXSTAT;
- continue;
- }
-
- /* No errors; receive the packet. */
- total_len = WB_RXBYTES(cur_rx->wb_ptr->wb_status);
-
- /*
- * XXX The Winbond chip includes the CRC with every
- * received frame, and there's no way to turn this
- * behavior off (at least, I can't find anything in
- * the manual that explains how to do it) so we have
- * to trim off the CRC manually.
- */
- total_len -= ETHER_CRC_LEN;
-
- if (total_len < MINCLSIZE) {
- m = m_devget(mtod(cur_rx->wb_mbuf, char *),
- total_len, 0, ifp, NULL);
- cur_rx->wb_ptr->wb_ctl =
- WB_RXCTL_RLINK | (MCLBYTES - 1);
- cur_rx->wb_ptr->wb_status = WB_RXSTAT;
- if (m == NULL) {
- ifp->if_ierrors++;
- continue;
- }
- } else {
- m = cur_rx->wb_mbuf;
- /*
- * Try to conjure up a new mbuf cluster. If that
- * fails, it means we have an out of memory condition and
- * should leave the buffer in place and continue. This will
- * result in a lost packet, but there's little else we
- * can do in this situation.
- */
- if (wb_newbuf(sc, cur_rx) == ENOBUFS) {
- ifp->if_ierrors++;
- cur_rx->wb_ptr->wb_ctl =
- WB_RXCTL_RLINK | (MCLBYTES - 1);
- cur_rx->wb_ptr->wb_status = WB_RXSTAT;
- continue;
- }
- m->m_pkthdr.rcvif = ifp;
- m->m_pkthdr.len = m->m_len = total_len;
- }
-
- ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
-
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet, but
- * don't pass it up to the ether_input() layer unless it's
- * a broadcast packet, multicast packet, matches our ethernet
- * address or the interface is in promiscuous mode.
- */
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m);
- if (ifp->if_flags & IFF_PROMISC &&
- (bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- ETHER_ADDR_LEN) &&
- (eh->ether_dhost[0] & 1) == 0)) {
- m_freem(m);
- continue;
- }
- }
-#endif
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
- ether_input(ifp, eh, m);
- }
-
- return;
-}
-
-void wb_rxeoc(sc)
- struct wb_softc *sc;
-{
- wb_rxeof(sc);
-
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- CSR_WRITE_4(sc, WB_RXADDR, vtophys(&sc->wb_ldata->wb_rx_list[0]));
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- if (CSR_READ_4(sc, WB_ISR) & WB_RXSTATE_SUSPEND)
- CSR_WRITE_4(sc, WB_RXSTART, 0xFFFFFFFF);
-
- return;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-static void wb_txeof(sc)
- struct wb_softc *sc;
-{
- struct wb_chain *cur_tx;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- /* Clear the timeout timer. */
- ifp->if_timer = 0;
-
- if (sc->wb_cdata.wb_tx_head == NULL)
- return;
-
- /*
- * Go through our tx list and free mbufs for those
- * frames that have been transmitted.
- */
- while(sc->wb_cdata.wb_tx_head->wb_mbuf != NULL) {
- u_int32_t txstat;
-
- cur_tx = sc->wb_cdata.wb_tx_head;
- txstat = WB_TXSTATUS(cur_tx);
-
- if ((txstat & WB_TXSTAT_OWN) || txstat == WB_UNSENT)
- break;
-
- if (txstat & WB_TXSTAT_TXERR) {
- ifp->if_oerrors++;
- if (txstat & WB_TXSTAT_ABORT)
- ifp->if_collisions++;
- if (txstat & WB_TXSTAT_LATECOLL)
- ifp->if_collisions++;
- }
-
- ifp->if_collisions += (txstat & WB_TXSTAT_COLLCNT) >> 3;
-
- ifp->if_opackets++;
- m_freem(cur_tx->wb_mbuf);
- cur_tx->wb_mbuf = NULL;
-
- if (sc->wb_cdata.wb_tx_head == sc->wb_cdata.wb_tx_tail) {
- sc->wb_cdata.wb_tx_head = NULL;
- sc->wb_cdata.wb_tx_tail = NULL;
- break;
- }
-
- sc->wb_cdata.wb_tx_head = cur_tx->wb_nextdesc;
- }
-
- return;
-}
-
-/*
- * TX 'end of channel' interrupt handler.
- */
-static void wb_txeoc(sc)
- struct wb_softc *sc;
-{
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
-
- ifp->if_timer = 0;
-
- if (sc->wb_cdata.wb_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
- sc->wb_cdata.wb_tx_tail = NULL;
- if (sc->wb_want_auto)
- wb_autoneg_mii(sc, WB_FLAG_SCHEDDELAY, 1);
- } else {
- if (WB_TXOWN(sc->wb_cdata.wb_tx_head) == WB_UNSENT) {
- WB_TXOWN(sc->wb_cdata.wb_tx_head) = WB_TXSTAT_OWN;
- ifp->if_timer = 5;
- CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF);
- }
- }
-
- return;
-}
-
-static void wb_intr(arg)
- void *arg;
-{
- struct wb_softc *sc;
- struct ifnet *ifp;
- u_int32_t status;
-
- sc = arg;
- ifp = &sc->arpcom.ac_if;
-
- if (!(ifp->if_flags & IFF_UP))
- return;
-
- /* Disable interrupts. */
- CSR_WRITE_4(sc, WB_IMR, 0x00000000);
-
- for (;;) {
-
- status = CSR_READ_4(sc, WB_ISR);
- if (status)
- CSR_WRITE_4(sc, WB_ISR, status);
-
- if ((status & WB_INTRS) == 0)
- break;
-
- if (status & WB_ISR_RX_OK)
- wb_rxeof(sc);
-
- if (status & WB_ISR_RX_IDLE)
- wb_rxeoc(sc);
-
- if ((status & WB_ISR_RX_NOBUF) || (status & WB_ISR_RX_ERR)) {
- ifp->if_ierrors++;
-#ifdef foo
- wb_stop(sc);
- wb_reset(sc);
- wb_init(sc);
-#endif
- }
-
- if (status & WB_ISR_TX_OK)
- wb_txeof(sc);
-
- if (status & WB_ISR_TX_NOBUF)
- wb_txeoc(sc);
-
- if (status & WB_ISR_TX_IDLE) {
- wb_txeof(sc);
- if (sc->wb_cdata.wb_tx_head != NULL) {
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF);
- }
- }
-
- if (status & WB_ISR_TX_UNDERRUN) {
- ifp->if_oerrors++;
- wb_txeof(sc);
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- /* Jack up TX threshold */
- sc->wb_txthresh += WB_TXTHRESH_CHUNK;
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_THRESH);
- WB_SETBIT(sc, WB_NETCFG, WB_TXTHRESH(sc->wb_txthresh));
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- }
-
- if (status & WB_ISR_BUS_ERR) {
- wb_reset(sc);
- wb_init(sc);
- }
-
- }
-
- /* Re-enable interrupts. */
- CSR_WRITE_4(sc, WB_IMR, WB_INTRS);
-
- if (ifp->if_snd.ifq_head != NULL) {
- wb_start(ifp);
- }
-
- return;
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int wb_encap(sc, c, m_head)
- struct wb_softc *sc;
- struct wb_chain *c;
- struct mbuf *m_head;
-{
- int frag = 0;
- struct wb_desc *f = NULL;
- int total_len;
- struct mbuf *m;
-
- /*
- * Start packing the mbufs in this chain into
- * the fragment pointers. Stop when we run out
- * of fragments or hit the end of the mbuf chain.
- */
- m = m_head;
- total_len = 0;
-
- for (m = m_head, frag = 0; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if (frag == WB_MAXFRAGS)
- break;
- total_len += m->m_len;
- f = &c->wb_ptr->wb_frag[frag];
- f->wb_ctl = WB_TXCTL_TLINK | m->m_len;
- if (frag == 0) {
- f->wb_ctl |= WB_TXCTL_FIRSTFRAG;
- f->wb_status = 0;
- } else
- f->wb_status = WB_TXSTAT_OWN;
- f->wb_next = vtophys(&c->wb_ptr->wb_frag[frag + 1]);
- f->wb_data = vtophys(mtod(m, vm_offset_t));
- frag++;
- }
- }
-
- /*
- * Handle special case: we used up all 16 fragments,
- * but we have more mbufs left in the chain. Copy the
- * data into an mbuf cluster. Note that we don't
- * bother clearing the values in the other fragment
- * pointers/counters; it wouldn't gain us anything,
- * and would waste cycles.
- */
- if (m != NULL) {
- struct mbuf *m_new = NULL;
-
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("wb%d: no memory for tx list", sc->wb_unit);
- return(1);
- }
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- printf("wb%d: no memory for tx list",
- sc->wb_unit);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len,
- mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
- m_head = m_new;
- f = &c->wb_ptr->wb_frag[0];
- f->wb_status = 0;
- f->wb_data = vtophys(mtod(m_new, caddr_t));
- f->wb_ctl = total_len = m_new->m_len;
- f->wb_ctl |= WB_TXCTL_TLINK|WB_TXCTL_FIRSTFRAG;
- frag = 1;
- }
-
- if (total_len < WB_MIN_FRAMELEN) {
- f = &c->wb_ptr->wb_frag[frag];
- f->wb_ctl = WB_MIN_FRAMELEN - total_len;
- f->wb_data = vtophys(&sc->wb_cdata.wb_pad);
- f->wb_ctl |= WB_TXCTL_TLINK;
- f->wb_status = WB_TXSTAT_OWN;
- frag++;
- }
-
- c->wb_mbuf = m_head;
- c->wb_lastdesc = frag - 1;
- WB_TXCTL(c) |= WB_TXCTL_LASTFRAG;
- WB_TXNEXT(c) = vtophys(&c->wb_nextdesc->wb_ptr->wb_frag[0]);
-
- return(0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void wb_start(ifp)
- struct ifnet *ifp;
-{
- struct wb_softc *sc;
- struct mbuf *m_head = NULL;
- struct wb_chain *cur_tx = NULL, *start_tx;
-
- sc = ifp->if_softc;
-
- if (sc->wb_autoneg) {
- sc->wb_tx_pend = 1;
- return;
- }
-
- /*
- * Check for an available queue slot. If there are none,
- * punt.
- */
- if (sc->wb_cdata.wb_tx_free->wb_mbuf != NULL) {
- ifp->if_flags |= IFF_OACTIVE;
- return;
- }
-
- start_tx = sc->wb_cdata.wb_tx_free;
-
- while(sc->wb_cdata.wb_tx_free->wb_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
- if (m_head == NULL)
- break;
-
- /* Pick a descriptor off the free list. */
- cur_tx = sc->wb_cdata.wb_tx_free;
- sc->wb_cdata.wb_tx_free = cur_tx->wb_nextdesc;
-
- /* Pack the data into the descriptor. */
- wb_encap(sc, cur_tx, m_head);
-
- if (cur_tx != start_tx)
- WB_TXOWN(cur_tx) = WB_TXSTAT_OWN;
-
-#if NBPFILTER > 0
- /*
- * If there's a BPF listener, bounce a copy of this frame
- * to him.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->wb_mbuf);
-#endif
- }
-
- /*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
- * Place the request for the upload interrupt
- * in the last descriptor in the chain. This way, if
- * we're chaining several packets at once, we'll only
- * get an interupt once for the whole chain rather than
- * once for each packet.
- */
- WB_TXCTL(cur_tx) |= WB_TXCTL_FINT;
- cur_tx->wb_ptr->wb_frag[0].wb_ctl |= WB_TXCTL_FINT;
- sc->wb_cdata.wb_tx_tail = cur_tx;
-
- if (sc->wb_cdata.wb_tx_head == NULL) {
- sc->wb_cdata.wb_tx_head = start_tx;
- WB_TXOWN(start_tx) = WB_TXSTAT_OWN;
- CSR_WRITE_4(sc, WB_TXSTART, 0xFFFFFFFF);
- } else {
- /*
- * We need to distinguish between the case where
- * the own bit is clear because the chip cleared it
- * and where the own bit is clear because we haven't
- * set it yet. The magic value WB_UNSET is just some
- * ramdomly chosen number which doesn't have the own
- * bit set. When we actually transmit the frame, the
- * status word will have _only_ the own bit set, so
- * the txeoc handler will be able to tell if it needs
- * to initiate another transmission to flush out pending
- * frames.
- */
- WB_TXOWN(start_tx) = WB_UNSENT;
- }
-
- /*
- * Set a timeout in case the chip goes out to lunch.
- */
- ifp->if_timer = 5;
-
- return;
-}
-
-static void wb_init(xsc)
- void *xsc;
-{
- struct wb_softc *sc = xsc;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- int s, i;
- u_int16_t phy_bmcr = 0;
-
- if (sc->wb_autoneg)
- return;
-
- s = splimp();
-
- if (sc->wb_pinfo != NULL)
- phy_bmcr = wb_phy_readreg(sc, PHY_BMCR);
-
- /*
- * Cancel pending I/O and free all RX/TX buffers.
- */
- wb_stop(sc);
- wb_reset(sc);
-
- sc->wb_txthresh = WB_TXTHRESH_INIT;
-
- /*
- * Set cache alignment and burst length.
- */
- CSR_WRITE_4(sc, WB_BUSCTL, WB_BUSCTL_CONFIG);
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_THRESH);
- WB_SETBIT(sc, WB_NETCFG, WB_TXTHRESH(sc->wb_txthresh));
-
- /* This doesn't tend to work too well at 100Mbps. */
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_EARLY_ON);
-
- wb_setcfg(sc, phy_bmcr);
-
- /* Init our MAC address */
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- CSR_WRITE_1(sc, WB_NODE0 + i, sc->arpcom.ac_enaddr[i]);
- }
-
- /* Init circular RX list. */
- if (wb_list_rx_init(sc) == ENOBUFS) {
- printf("wb%d: initialization failed: no "
- "memory for rx buffers\n", sc->wb_unit);
- wb_stop(sc);
- (void)splx(s);
- return;
- }
-
- /* Init TX descriptors. */
- wb_list_tx_init(sc);
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_ALLPHYS);
- } else {
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_ALLPHYS);
- }
-
- /*
- * Set capture broadcast bit to capture broadcast frames.
- */
- if (ifp->if_flags & IFF_BROADCAST) {
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_BROAD);
- } else {
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_BROAD);
- }
-
- /*
- * Program the multicast filter, if necessary.
- */
- wb_setmulti(sc);
-
- /*
- * Load the address of the RX list.
- */
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- CSR_WRITE_4(sc, WB_RXADDR, vtophys(&sc->wb_ldata->wb_rx_list[0]));
-
- /*
- * Enable interrupts.
- */
- CSR_WRITE_4(sc, WB_IMR, WB_INTRS);
- CSR_WRITE_4(sc, WB_ISR, 0xFFFFFFFF);
-
- /* Enable receiver and transmitter. */
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_RX_ON);
- CSR_WRITE_4(sc, WB_RXSTART, 0xFFFFFFFF);
-
- WB_CLRBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
- CSR_WRITE_4(sc, WB_TXADDR, vtophys(&sc->wb_ldata->wb_tx_list[0]));
- WB_SETBIT(sc, WB_NETCFG, WB_NETCFG_TX_ON);
-
- /* Restore state of BMCR */
- if (sc->wb_pinfo != NULL)
- wb_phy_writereg(sc, PHY_BMCR, phy_bmcr);
-
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
-
- (void)splx(s);
-
- return;
-}
-
-/*
- * Set media options.
- */
-static int wb_ifmedia_upd(ifp)
- struct ifnet *ifp;
-{
- struct wb_softc *sc;
- struct ifmedia *ifm;
-
- sc = ifp->if_softc;
- ifm = &sc->ifmedia;
-
- if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
- return(EINVAL);
-
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO)
- wb_autoneg_mii(sc, WB_FLAG_SCHEDDELAY, 1);
- else
- wb_setmode_mii(sc, ifm->ifm_media);
-
- return(0);
-}
-
-/*
- * Report current media status.
- */
-static void wb_ifmedia_sts(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
-{
- struct wb_softc *sc;
- u_int16_t advert = 0, ability = 0;
-
- sc = ifp->if_softc;
-
- ifmr->ifm_active = IFM_ETHER;
-
- if (!(wb_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_AUTONEGENBL)) {
- if (wb_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_SPEEDSEL)
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX;
- else
- ifmr->ifm_active = IFM_ETHER|IFM_10_T;
- if (wb_phy_readreg(sc, PHY_BMCR) & PHY_BMCR_DUPLEX)
- ifmr->ifm_active |= IFM_FDX;
- else
- ifmr->ifm_active |= IFM_HDX;
- return;
- }
-
- ability = wb_phy_readreg(sc, PHY_LPAR);
- advert = wb_phy_readreg(sc, PHY_ANAR);
- if (advert & PHY_ANAR_100BT4 &&
- ability & PHY_ANAR_100BT4) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_T4;
- } else if (advert & PHY_ANAR_100BTXFULL &&
- ability & PHY_ANAR_100BTXFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_FDX;
- } else if (advert & PHY_ANAR_100BTXHALF &&
- ability & PHY_ANAR_100BTXHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_100_TX|IFM_HDX;
- } else if (advert & PHY_ANAR_10BTFULL &&
- ability & PHY_ANAR_10BTFULL) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_FDX;
- } else if (advert & PHY_ANAR_10BTHALF &&
- ability & PHY_ANAR_10BTHALF) {
- ifmr->ifm_active = IFM_ETHER|IFM_10_T|IFM_HDX;
- }
-
- return;
-}
-
-static int wb_ioctl(ifp, command, data)
- struct ifnet *ifp;
- u_long command;
- caddr_t data;
-{
- struct wb_softc *sc = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *) data;
- int s, error = 0;
-
- s = splimp();
-
- switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP) {
- wb_init(sc);
- } else {
- if (ifp->if_flags & IFF_RUNNING)
- wb_stop(sc);
- }
- error = 0;
- break;
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- wb_setmulti(sc);
- error = 0;
- break;
- case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
- error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
- break;
- default:
- error = EINVAL;
- break;
- }
-
- (void)splx(s);
-
- return(error);
-}
-
-static void wb_watchdog(ifp)
- struct ifnet *ifp;
-{
- struct wb_softc *sc;
-
- sc = ifp->if_softc;
-
- if (sc->wb_autoneg) {
- wb_autoneg_mii(sc, WB_FLAG_DELAYTIMEO, 1);
- return;
- }
-
- ifp->if_oerrors++;
- printf("wb%d: watchdog timeout\n", sc->wb_unit);
-
- if (!(wb_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
- printf("wb%d: no carrier - transceiver cable problem?\n",
- sc->wb_unit);
-
- wb_stop(sc);
- wb_reset(sc);
- wb_init(sc);
-
- if (ifp->if_snd.ifq_head != NULL)
- wb_start(ifp);
-
- return;
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void wb_stop(sc)
- struct wb_softc *sc;
-{
- register int i;
- struct ifnet *ifp;
-
- ifp = &sc->arpcom.ac_if;
- ifp->if_timer = 0;
-
- WB_CLRBIT(sc, WB_NETCFG, (WB_NETCFG_RX_ON|WB_NETCFG_TX_ON));
- CSR_WRITE_4(sc, WB_IMR, 0x00000000);
- CSR_WRITE_4(sc, WB_TXADDR, 0x00000000);
- CSR_WRITE_4(sc, WB_RXADDR, 0x00000000);
-
- /*
- * Free data in the RX lists.
- */
- for (i = 0; i < WB_RX_LIST_CNT; i++) {
- if (sc->wb_cdata.wb_rx_chain[i].wb_mbuf != NULL) {
- m_freem(sc->wb_cdata.wb_rx_chain[i].wb_mbuf);
- sc->wb_cdata.wb_rx_chain[i].wb_mbuf = NULL;
- }
- }
- bzero((char *)&sc->wb_ldata->wb_rx_list,
- sizeof(sc->wb_ldata->wb_rx_list));
-
- /*
- * Free the TX list buffers.
- */
- for (i = 0; i < WB_TX_LIST_CNT; i++) {
- if (sc->wb_cdata.wb_tx_chain[i].wb_mbuf != NULL) {
- m_freem(sc->wb_cdata.wb_tx_chain[i].wb_mbuf);
- sc->wb_cdata.wb_tx_chain[i].wb_mbuf = NULL;
- }
- }
-
- bzero((char *)&sc->wb_ldata->wb_tx_list,
- sizeof(sc->wb_ldata->wb_tx_list));
-
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-
- return;
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void wb_shutdown(howto, arg)
- int howto;
- void *arg;
-{
- struct wb_softc *sc = (struct wb_softc *)arg;
-
- wb_stop(sc);
-
- return;
-}
-
-static struct pci_device wb_device = {
- "wb",
- wb_probe,
- wb_attach,
- &wb_count,
- NULL
-};
-DATA_SET(pcidevice_set, wb_device);
diff --git a/sys/pci/if_wbreg.h b/sys/pci/if_wbreg.h
deleted file mode 100644
index 17c55d8ce36e4..0000000000000
--- a/sys/pci/if_wbreg.h
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * Copyright (c) 1997, 1998
- * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: if_wbreg.h,v 1.12 1998/11/29 06:40:50 wpaul Exp wpaul $
- */
-
-/*
- * Winbond register definitions.
- */
-
-#define WB_BUSCTL 0x00 /* bus control */
-#define WB_TXSTART 0x04 /* tx start demand */
-#define WB_RXSTART 0x08 /* rx start demand */
-#define WB_RXADDR 0x0C /* rx descriptor list start addr */
-#define WB_TXADDR 0x10 /* tx descriptor list start addr */
-#define WB_ISR 0x14 /* interrupt status register */
-#define WB_NETCFG 0x18 /* network config register */
-#define WB_IMR 0x1C /* interrupt mask */
-#define WB_FRAMESDISCARDED 0x20 /* # of discarded frames */
-#define WB_SIO 0x24 /* MII and ROM/EEPROM access */
-#define WB_BOOTROMADDR 0x28
-#define WB_TIMER 0x2C /* general timer */
-#define WB_CURRXCTL 0x30 /* current RX descriptor */
-#define WB_CURRXBUF 0x34 /* current RX buffer */
-#define WB_MAR0 0x38 /* multicast filter 0 */
-#define WB_MAR1 0x3C /* multicast filter 1 */
-#define WB_NODE0 0x40 /* station address 0 */
-#define WB_NODE1 0x44 /* station address 1 */
-#define WB_BOOTROMSIZE 0x48 /* boot ROM size */
-#define WB_CURTXCTL 0x4C /* current TX descriptor */
-#define WB_CURTXBUF 0x50 /* current TX buffer */
-
-/*
- * Bus control bits.
- */
-#define WB_BUSCTL_RESET 0x00000001
-#define WB_BUSCTL_ARBITRATION 0x00000002
-#define WB_BUSCTL_SKIPLEN 0x0000007C
-#define WB_BUSCTL_BUF_BIGENDIAN 0x00000080
-#define WB_BUSCTL_BURSTLEN 0x00003F00
-#define WB_BUSCTL_CACHEALIGN 0x0000C000
-#define WB_BUSCTL_DES_BIGENDIAN 0x00100000
-#define WB_BUSCTL_WAIT 0x00200000
-
-#define WB_SKIPLEN_1LONG 0x00000004
-#define WB_SKIPLEN_2LONG 0x00000008
-#define WB_SKIPLEN_3LONG 0x00000010
-#define WB_SKIPLEN_4LONG 0x00000020
-#define WB_SKIPLEN_5LONG 0x00000040
-
-#define WB_CACHEALIGN_8LONG 0x00004000
-#define WB_CACHEALIGN_16LONG 0x00008000
-#define WB_CACHEALIGN_32LONG 0x0000C000
-
-#define WB_BURSTLEN_USECA 0x00000000
-#define WB_BURSTLEN_1LONG 0x00000100
-#define WB_BURSTLEN_2LONG 0x00000200
-#define WB_BURSTLEN_4LONG 0x00000400
-#define WB_BURSTLEN_8LONG 0x00000800
-#define WB_BURSTLEN_16LONG 0x00001000
-#define WB_BURSTLEN_32LONG 0x00002000
-
-#define WB_BUSCTL_CONFIG (WB_CACHEALIGN_8LONG|WB_SKIPLEN_3LONG| \
- WB_BURSTLEN_8LONG)
-
-/*
- * Interrupt status bits.
- */
-#define WB_ISR_TX_OK 0x00000001
-#define WB_ISR_TX_IDLE 0x00000002
-#define WB_ISR_TX_NOBUF 0x00000004
-#define WB_ISR_RX_EARLY 0x00000008
-#define WB_ISR_RX_ERR 0x00000010
-#define WB_ISR_TX_UNDERRUN 0x00000020
-#define WB_ISR_RX_OK 0x00000040
-#define WB_ISR_RX_NOBUF 0x00000080
-#define WB_ISR_RX_IDLE 0x00000100
-#define WB_ISR_TX_EARLY 0x00000400
-#define WB_ISR_TIMER_EXPIRED 0x00000800
-#define WB_ISR_BUS_ERR 0x00002000
-#define WB_ISR_ABNORMAL 0x00008000
-#define WB_ISR_NORMAL 0x00010000
-#define WB_ISR_RX_STATE 0x000E0000
-#define WB_ISR_TX_STATE 0x00700000
-#define WB_ISR_BUSERRTYPE 0x03800000
-
-/*
- * The RX_STATE and TX_STATE fields are not described anywhere in the
- * Winbond datasheet, however it appears that the Winbond chip is an
- * attempt at a DEC 'tulip' clone, hence the ISR register is identical
- * to that of the tulip chip and we can steal the bit definitions from
- * the tulip documentation.
- */
-#define WB_RXSTATE_STOPPED 0x00000000 /* 000 - Stopped */
-#define WB_RXSTATE_FETCH 0x00020000 /* 001 - Fetching descriptor */
-#define WB_RXSTATE_ENDCHECK 0x00040000 /* 010 - check for rx end */
-#define WB_RXSTATE_WAIT 0x00060000 /* 011 - waiting for packet */
-#define WB_RXSTATE_SUSPEND 0x00080000 /* 100 - suspend rx */
-#define WB_RXSTATE_CLOSE 0x000A0000 /* 101 - close tx desc */
-#define WB_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */
-#define WB_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */
-
-#define WB_TXSTATE_RESET 0x00000000 /* 000 - reset */
-#define WB_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */
-#define WB_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */
-#define WB_TXSTATE_READING 0x00300000 /* 011 - read and enqueue */
-#define WB_TXSTATE_RSVD 0x00400000 /* 100 - reserved */
-#define WB_TXSTATE_SETUP 0x00500000 /* 101 - setup packet */
-#define WB_TXSTATE_SUSPEND 0x00600000 /* 110 - suspend tx */
-#define WB_TXSTATE_CLOSE 0x00700000 /* 111 - close tx desc */
-
-/*
- * Network config bits.
- */
-#define WB_NETCFG_RX_ON 0x00000002
-#define WB_NETCFG_RX_ALLPHYS 0x00000008
-#define WB_NETCFG_RX_MULTI 0x00000010
-#define WB_NETCFG_RX_BROAD 0x00000020
-#define WB_NETCFG_RX_RUNT 0x00000040
-#define WB_NETCFG_RX_ERR 0x00000080
-#define WB_NETCFG_FULLDUPLEX 0x00000200
-#define WB_NETCFG_LOOPBACK 0x00000C00
-#define WB_NETCFG_TX_ON 0x00002000
-#define WB_NETCFG_TX_THRESH 0x001FC000
-#define WB_NETCFG_RX_EARLYTHRSH 0x1FE00000
-#define WB_NETCFG_100MBPS 0x20000000
-#define WB_NETCFG_TX_EARLY_ON 0x40000000
-#define WB_NETCFG_RX_EARLY_ON 0x80000000
-
-/*
- * The tx threshold can be adjusted in increments of 32 bytes.
- */
-#define WB_TXTHRESH(x) ((x >> 5) << 14)
-#define WB_TXTHRESH_CHUNK 32
-#define WB_TXTHRESH_INIT 0 /*72*/
-
-/*
- * Interrupt mask bits.
- */
-#define WB_IMR_TX_OK 0x00000001
-#define WB_IMR_TX_IDLE 0x00000002
-#define WB_IMR_TX_NOBUF 0x00000004
-#define WB_IMR_RX_EARLY 0x00000008
-#define WB_IMR_RX_ERR 0x00000010
-#define WB_IMR_TX_UNDERRUN 0x00000020
-#define WB_IMR_RX_OK 0x00000040
-#define WB_IMR_RX_NOBUF 0x00000080
-#define WB_IMR_RX_IDLE 0x00000100
-#define WB_IMR_TX_EARLY 0x00000400
-#define WB_IMR_TIMER_EXPIRED 0x00000800
-#define WB_IMR_BUS_ERR 0x00002000
-#define WB_IMR_ABNORMAL 0x00008000
-#define WB_IMR_NORMAL 0x00010000
-
-#define WB_INTRS \
- (WB_IMR_RX_OK|WB_IMR_TX_OK|WB_IMR_RX_NOBUF|WB_IMR_RX_ERR| \
- WB_IMR_TX_NOBUF|WB_IMR_TX_UNDERRUN|WB_IMR_BUS_ERR| \
- WB_IMR_ABNORMAL|WB_IMR_NORMAL|WB_IMR_TX_EARLY)
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define WB_SIO_EE_CS 0x00000001 /* EEPROM chip select */
-#define WB_SIO_EE_CLK 0x00000002 /* EEPROM clock */
-#define WB_SIO_EE_DATAIN 0x00000004 /* EEPROM data output */
-#define WB_SIO_EE_DATAOUT 0x00000008 /* EEPROM data input */
-#define WB_SIO_ROMDATA4 0x00000010
-#define WB_SIO_ROMDATA5 0x00000020
-#define WB_SIO_ROMDATA6 0x00000040
-#define WB_SIO_ROMDATA7 0x00000080
-#define WB_SIO_ROMCTL_WRITE 0x00000200
-#define WB_SIO_ROMCTL_READ 0x00000400
-#define WB_SIO_EESEL 0x00000800
-#define WB_SIO_MII_CLK 0x00010000 /* MDIO clock */
-#define WB_SIO_MII_DATAIN 0x00020000 /* MDIO data out */
-#define WB_SIO_MII_DIR 0x00040000 /* MDIO dir */
-#define WB_SIO_MII_DATAOUT 0x00080000 /* MDIO data in */
-
-#define WB_EECMD_WRITE 0x140
-#define WB_EECMD_READ 0x180
-#define WB_EECMD_ERASE 0x1c0
-
-/*
- * Winbond TX/RX descriptor structure.
- */
-
-struct wb_desc {
- u_int32_t wb_status;
- u_int32_t wb_ctl;
- u_int32_t wb_ptr1;
- u_int32_t wb_ptr2;
-};
-
-#define wb_data wb_ptr1
-#define wb_next wb_ptr2
-
-#define WB_RXSTAT_CRCERR 0x00000002
-#define WB_RXSTAT_DRIBBLE 0x00000004
-#define WB_RXSTAT_MIIERR 0x00000008
-#define WB_RXSTAT_LATEEVENT 0x00000040
-#define WB_RXSTAT_GIANT 0x00000080
-#define WB_RXSTAT_LASTFRAG 0x00000100
-#define WB_RXSTAT_FIRSTFRAG 0x00000200
-#define WB_RXSTAT_MULTICAST 0x00000400
-#define WB_RXSTAT_RUNT 0x00000800
-#define WB_RXSTAT_RXTYPE 0x00003000
-#define WB_RXSTAT_RXERR 0x00008000
-#define WB_RXSTAT_RXLEN 0x3FFF0000
-#define WB_RXSTAT_RXCMP 0x40000000
-#define WB_RXSTAT_OWN 0x80000000
-
-#define WB_RXBYTES(x) ((x & WB_RXSTAT_RXLEN) >> 16)
-#define WB_RXSTAT (WB_RXSTAT_FIRSTFRAG|WB_RXSTAT_LASTFRAG|WB_RXSTAT_OWN)
-
-#define WB_RXCTL_BUFLEN1 0x00000FFF
-#define WB_RXCTL_BUFLEN2 0x00FFF000
-#define WB_RXCTL_RLINK 0x01000000
-#define WB_RXCTL_RLAST 0x02000000
-
-#define WB_TXSTAT_DEFER 0x00000001
-#define WB_TXSTAT_UNDERRUN 0x00000002
-#define WB_TXSTAT_COLLCNT 0x00000078
-#define WB_TXSTAT_SQE 0x00000080
-#define WB_TXSTAT_ABORT 0x00000100
-#define WB_TXSTAT_LATECOLL 0x00000200
-#define WB_TXSTAT_NOCARRIER 0x00000400
-#define WB_TXSTAT_CARRLOST 0x00000800
-#define WB_TXSTAT_TXERR 0x00001000
-#define WB_TXSTAT_OWN 0x80000000
-
-#define WB_TXCTL_BUFLEN1 0x000007FF
-#define WB_TXCTL_BUFLEN2 0x003FF800
-#define WB_TXCTL_PAD 0x00800000
-#define WB_TXCTL_TLINK 0x01000000
-#define WB_TXCTL_TLAST 0x02000000
-#define WB_TXCTL_NOCRC 0x08000000
-#define WB_TXCTL_FIRSTFRAG 0x20000000
-#define WB_TXCTL_LASTFRAG 0x40000000
-#define WB_TXCTL_FINT 0x80000000
-
-#define WB_MAXFRAGS 16
-#define WB_RX_LIST_CNT 64
-#define WB_TX_LIST_CNT 64
-#define WB_MIN_FRAMELEN 60
-
-/*
- * A transmit 'super descriptor' is actually WB_MAXFRAGS regular
- * descriptors clumped together. The idea here is to emulate the
- * multi-fragment descriptor layout found in devices such as the
- * Texas Instruments ThunderLAN and 3Com boomerang and cylone chips.
- * The advantage to using this scheme is that it avoids buffer copies.
- * The disadvantage is that there's a certain amount of overhead due
- * to the fact that each 'fragment' is 16 bytes long. In my tests,
- * this limits top speed to about 10.5MB/sec. It should be more like
- * 11.5MB/sec. However, the upshot is that you can achieve better
- * results on slower machines: a Pentium 200 can pump out packets at
- * same speed as a PII 400.
- */
-struct wb_txdesc {
- struct wb_desc wb_frag[WB_MAXFRAGS];
-};
-
-#define WB_TXNEXT(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_next
-#define WB_TXSTATUS(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_status
-#define WB_TXCTL(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_ctl
-#define WB_TXDATA(x) x->wb_ptr->wb_frag[x->wb_lastdesc].wb_data
-
-#define WB_TXOWN(x) x->wb_ptr->wb_frag[0].wb_status
-
-#define WB_UNSENT 0x1234
-
-struct wb_list_data {
- struct wb_desc wb_rx_list[WB_RX_LIST_CNT];
- struct wb_txdesc wb_tx_list[WB_TX_LIST_CNT];
-};
-
-struct wb_chain {
- struct wb_txdesc *wb_ptr;
- struct mbuf *wb_mbuf;
- struct wb_chain *wb_nextdesc;
- u_int8_t wb_lastdesc;
-};
-
-struct wb_chain_onefrag {
- struct wb_desc *wb_ptr;
- struct mbuf *wb_mbuf;
- struct wb_chain_onefrag *wb_nextdesc;
- u_int8_t wb_rlast;
-};
-
-struct wb_chain_data {
- u_int8_t wb_pad[WB_MIN_FRAMELEN];
- struct wb_chain_onefrag wb_rx_chain[WB_RX_LIST_CNT];
- struct wb_chain wb_tx_chain[WB_TX_LIST_CNT];
-
- struct wb_chain_onefrag *wb_rx_head;
-
- struct wb_chain *wb_tx_head;
- struct wb_chain *wb_tx_tail;
- struct wb_chain *wb_tx_free;
-};
-
-struct wb_type {
- u_int16_t wb_vid;
- u_int16_t wb_did;
- char *wb_name;
-};
-
-struct wb_mii_frame {
- u_int8_t mii_stdelim;
- u_int8_t mii_opcode;
- u_int8_t mii_phyaddr;
- u_int8_t mii_regaddr;
- u_int8_t mii_turnaround;
- u_int16_t mii_data;
-};
-
-/*
- * MII constants
- */
-#define WB_MII_STARTDELIM 0x01
-#define WB_MII_READOP 0x02
-#define WB_MII_WRITEOP 0x01
-#define WB_MII_TURNAROUND 0x02
-
-#define WB_FLAG_FORCEDELAY 1
-#define WB_FLAG_SCHEDDELAY 2
-#define WB_FLAG_DELAYTIMEO 3
-
-struct wb_softc {
- struct arpcom arpcom; /* interface info */
- struct ifmedia ifmedia; /* media info */
- bus_space_handle_t wb_bhandle;
- bus_space_tag_t wb_btag;
- struct wb_type *wb_info; /* 3Com adapter info */
- struct wb_type *wb_pinfo; /* phy info */
- u_int8_t wb_unit; /* interface number */
- u_int8_t wb_type;
- u_int8_t wb_phy_addr; /* PHY address */
- u_int8_t wb_tx_pend; /* TX pending */
- u_int8_t wb_want_auto;
- u_int8_t wb_autoneg;
- u_int16_t wb_txthresh;
- caddr_t wb_ldata_ptr;
- struct wb_list_data *wb_ldata;
- struct wb_chain_data wb_cdata;
-};
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->wb_btag, sc->wb_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->wb_btag, sc->wb_bhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->wb_btag, sc->wb_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->wb_btag, sc->wb_bhandle, reg)
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->wb_btag, sc->wb_bhandle, reg)
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->wb_btag, sc->wb_bhandle, reg)
-
-#define WB_TIMEOUT 1000
-
-/*
- * General constants that are fun to know.
- *
- * Winbond PCI vendor ID
- */
-#define WB_VENDORID 0x1050
-
-/*
- * Winbond device IDs.
- */
-#define WB_DEVICEID_840F 0x0840
-
-/*
- * Compex vendor ID.
- */
-#define CP_VENDORID 0x11F6
-
-/*
- * Compex device IDs.
- */
-#define CP_DEVICEID_RL100 0x2011
-
-/*
- * Texas Instruments PHY identifiers
- */
-#define TI_PHY_VENDORID 0x4000
-#define TI_PHY_10BT 0x501F
-#define TI_PHY_100VGPMI 0x502F
-
-/*
- * These ID values are for the NS DP83840A 10/100 PHY
- */
-#define NS_PHY_VENDORID 0x2000
-#define NS_PHY_83840A 0x5C0F
-
-/*
- * Level 1 10/100 PHY
- */
-#define LEVEL1_PHY_VENDORID 0x7810
-#define LEVEL1_PHY_LXT970 0x000F
-
-/*
- * Intel 82555 10/100 PHY
- */
-#define INTEL_PHY_VENDORID 0x0A28
-#define INTEL_PHY_82555 0x015F
-
-/*
- * SEEQ 80220 10/100 PHY
- */
-#define SEEQ_PHY_VENDORID 0x0016
-#define SEEQ_PHY_80220 0xF83F
-
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers. Note: some are only available on
- * the 3c905B, in particular those that related to power management.
- */
-
-#define WB_PCI_VENDOR_ID 0x00
-#define WB_PCI_DEVICE_ID 0x02
-#define WB_PCI_COMMAND 0x04
-#define WB_PCI_STATUS 0x06
-#define WB_PCI_CLASSCODE 0x09
-#define WB_PCI_LATENCY_TIMER 0x0D
-#define WB_PCI_HEADER_TYPE 0x0E
-#define WB_PCI_LOIO 0x10
-#define WB_PCI_LOMEM 0x14
-#define WB_PCI_BIOSROM 0x30
-#define WB_PCI_INTLINE 0x3C
-#define WB_PCI_INTPIN 0x3D
-#define WB_PCI_MINGNT 0x3E
-#define WB_PCI_MINLAT 0x0F
-#define WB_PCI_RESETOPT 0x48
-#define WB_PCI_EEPROM_DATA 0x4C
-
-/* power management registers */
-#define WB_PCI_CAPID 0xDC /* 8 bits */
-#define WB_PCI_NEXTPTR 0xDD /* 8 bits */
-#define WB_PCI_PWRMGMTCAP 0xDE /* 16 bits */
-#define WB_PCI_PWRMGMTCTRL 0xE0 /* 16 bits */
-
-#define WB_PSTATE_MASK 0x0003
-#define WB_PSTATE_D0 0x0000
-#define WB_PSTATE_D1 0x0002
-#define WB_PSTATE_D2 0x0002
-#define WB_PSTATE_D3 0x0003
-#define WB_PME_EN 0x0010
-#define WB_PME_STATUS 0x8000
-
-#define PHY_UNKNOWN 6
-
-#define WB_PHYADDR_MIN 0x00
-#define WB_PHYADDR_MAX 0x1F
-
-#define PHY_BMCR 0x00
-#define PHY_BMSR 0x01
-#define PHY_VENID 0x02
-#define PHY_DEVID 0x03
-#define PHY_ANAR 0x04
-#define PHY_LPAR 0x05
-#define PHY_ANEXP 0x06
-
-#define PHY_ANAR_NEXTPAGE 0x8000
-#define PHY_ANAR_RSVD0 0x4000
-#define PHY_ANAR_TLRFLT 0x2000
-#define PHY_ANAR_RSVD1 0x1000
-#define PHY_ANAR_RSVD2 0x0800
-#define PHY_ANAR_RSVD3 0x0400
-#define PHY_ANAR_100BT4 0x0200
-#define PHY_ANAR_100BTXFULL 0x0100
-#define PHY_ANAR_100BTXHALF 0x0080
-#define PHY_ANAR_10BTFULL 0x0040
-#define PHY_ANAR_10BTHALF 0x0020
-#define PHY_ANAR_PROTO4 0x0010
-#define PHY_ANAR_PROTO3 0x0008
-#define PHY_ANAR_PROTO2 0x0004
-#define PHY_ANAR_PROTO1 0x0002
-#define PHY_ANAR_PROTO0 0x0001
-
-/*
- * These are the register definitions for the PHY (physical layer
- * interface chip).
- */
-/*
- * PHY BMCR Basic Mode Control Register
- */
-#define PHY_BMCR_RESET 0x8000
-#define PHY_BMCR_LOOPBK 0x4000
-#define PHY_BMCR_SPEEDSEL 0x2000
-#define PHY_BMCR_AUTONEGENBL 0x1000
-#define PHY_BMCR_RSVD0 0x0800 /* write as zero */
-#define PHY_BMCR_ISOLATE 0x0400
-#define PHY_BMCR_AUTONEGRSTR 0x0200
-#define PHY_BMCR_DUPLEX 0x0100
-#define PHY_BMCR_COLLTEST 0x0080
-#define PHY_BMCR_RSVD1 0x0040 /* write as zero, don't care */
-#define PHY_BMCR_RSVD2 0x0020 /* write as zero, don't care */
-#define PHY_BMCR_RSVD3 0x0010 /* write as zero, don't care */
-#define PHY_BMCR_RSVD4 0x0008 /* write as zero, don't care */
-#define PHY_BMCR_RSVD5 0x0004 /* write as zero, don't care */
-#define PHY_BMCR_RSVD6 0x0002 /* write as zero, don't care */
-#define PHY_BMCR_RSVD7 0x0001 /* write as zero, don't care */
-/*
- * RESET: 1 == software reset, 0 == normal operation
- * Resets status and control registers to default values.
- * Relatches all hardware config values.
- *
- * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
- *
- * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
- * Link speed is selected byt his bit or if auto-negotiation if bit
- * 12 (AUTONEGENBL) is set (in which case the value of this register
- * is ignored).
- *
- * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
- * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
- * determine speed and mode. Should be cleared and then set if PHY configured
- * for no autoneg on startup.
- *
- * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
- *
- * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
- *
- * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
- *
- * COLLTEST: 1 == collision test enabled, 0 == normal operation
- */
-
-/*
- * PHY, BMSR Basic Mode Status Register
- */
-#define PHY_BMSR_100BT4 0x8000
-#define PHY_BMSR_100BTXFULL 0x4000
-#define PHY_BMSR_100BTXHALF 0x2000
-#define PHY_BMSR_10BTFULL 0x1000
-#define PHY_BMSR_10BTHALF 0x0800
-#define PHY_BMSR_RSVD1 0x0400 /* write as zero, don't care */
-#define PHY_BMSR_RSVD2 0x0200 /* write as zero, don't care */
-#define PHY_BMSR_RSVD3 0x0100 /* write as zero, don't care */
-#define PHY_BMSR_RSVD4 0x0080 /* write as zero, don't care */
-#define PHY_BMSR_MFPRESUP 0x0040
-#define PHY_BMSR_AUTONEGCOMP 0x0020
-#define PHY_BMSR_REMFAULT 0x0010
-#define PHY_BMSR_CANAUTONEG 0x0008
-#define PHY_BMSR_LINKSTAT 0x0004
-#define PHY_BMSR_JABBER 0x0002
-#define PHY_BMSR_EXTENDED 0x0001
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 26c5284572404..aede51e4c831c 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_xl.c,v 1.21 1998/12/14 06:32:57 dillon Exp $
+ * $Id: if_xl.c,v 1.54 1998/09/25 17:43:57 wpaul Exp wpaul $
*/
/*
@@ -145,9 +145,9 @@
#include <pci/if_xlreg.h>
-#if !defined(lint)
-static const char rcsid[] =
- "$Id: if_xl.c,v 1.21 1998/12/14 06:32:57 dillon Exp $";
+#ifndef lint
+static char rcsid[] =
+ "$Id: if_xl.c,v 1.54 1998/09/25 17:43:57 wpaul Exp wpaul $";
#endif
/*
@@ -194,7 +194,7 @@ static struct xl_type xl_phys[] = {
};
static unsigned long xl_count = 0;
-static const char *xl_probe __P((pcici_t, pcidi_t));
+static char *xl_probe __P((pcici_t, pcidi_t));
static void xl_attach __P((pcici_t, int));
static int xl_newbuf __P((struct xl_softc *,
@@ -224,14 +224,14 @@ static void xl_mii_send __P((struct xl_softc *, u_int32_t, int));
static int xl_mii_readreg __P((struct xl_softc *, struct xl_mii_frame *));
static int xl_mii_writereg __P((struct xl_softc *, struct xl_mii_frame *));
static u_int16_t xl_phy_readreg __P((struct xl_softc *, int));
-static void xl_phy_writereg __P((struct xl_softc *, int, int));
+static void xl_phy_writereg __P((struct xl_softc *, u_int16_t, u_int16_t));
static void xl_autoneg_xmit __P((struct xl_softc *));
static void xl_autoneg_mii __P((struct xl_softc *, int, int));
static void xl_setmode_mii __P((struct xl_softc *, int));
static void xl_getmode_mii __P((struct xl_softc *));
static void xl_setmode __P((struct xl_softc *, int));
-static u_int8_t xl_calchash __P((caddr_t));
+static u_int8_t xl_calchash __P((u_int8_t *));
static void xl_setmulti __P((struct xl_softc *));
static void xl_setmulti_hash __P((struct xl_softc *));
static void xl_reset __P((struct xl_softc *));
@@ -502,8 +502,8 @@ static u_int16_t xl_phy_readreg(sc, reg)
static void xl_phy_writereg(sc, reg, data)
struct xl_softc *sc;
- int reg;
- int data;
+ u_int16_t reg;
+ u_int16_t data;
{
struct xl_mii_frame frame;
@@ -592,7 +592,7 @@ static int xl_read_eeprom(sc, dest, off, cnt, swap)
* On older cards, the upper 2 bits will be ignored. Grrrr....
*/
static u_int8_t xl_calchash(addr)
- caddr_t addr;
+ u_int8_t *addr;
{
u_int32_t crc, carry;
int i, j;
@@ -983,7 +983,7 @@ static void xl_getmode_mii(sc)
if (bootverbose)
printf("xl%d: forcing on autoneg support for BT4\n",
sc->xl_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
+ ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
#endif
}
@@ -1185,7 +1185,7 @@ static void xl_reset(sc)
* Probe for a 3Com Etherlink XL chip. Check the PCI vendor and device
* IDs against our list and return a device name if we find a match.
*/
-static const char *
+static char *
xl_probe(config_id, device_id)
pcici_t config_id;
pcidi_t device_id;
@@ -1444,7 +1444,7 @@ xl_attach(config_id, unit)
if (round % 8) {
round++;
roundptr++;
- } else
+ }
break;
}
sc->xl_ldata = (struct xl_list_data *)roundptr;
@@ -1932,6 +1932,8 @@ static void xl_txeof(sc)
cur_tx->xl_next = sc->xl_cdata.xl_tx_free;
sc->xl_cdata.xl_tx_free = cur_tx;
+ if (!cur_tx->xl_ptr->xl_next);
+ break;
}
if (sc->xl_cdata.xl_tx_head == NULL) {
@@ -1977,10 +1979,6 @@ static void xl_txeoc(sc)
* first generation 3c90X chips.
*/
CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8);
- if (sc->xl_type == XL_TYPE_905B) {
- CSR_WRITE_2(sc, XL_COMMAND,
- XL_CMD_SET_TX_RECLAIM|(XL_PACKET_SIZE >> 4));
- }
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_ENABLE);
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);
} else {
@@ -2259,12 +2257,6 @@ static void xl_start(ifp)
}
/*
- * If there are no packets queued, bail.
- */
- if (cur_tx == NULL)
- return;
-
- /*
* Place the request for the upload interrupt
* in the last descriptor in the chain. This way, if
* we're chaining several packets at once, we'll only
@@ -2286,7 +2278,6 @@ static void xl_start(ifp)
vtophys(start_tx->xl_ptr);
sc->xl_cdata.xl_tx_tail->xl_ptr->xl_status &=
~XL_TXSTAT_DL_INTR;
- sc->xl_cdata.xl_tx_tail = cur_tx;
} else {
sc->xl_cdata.xl_tx_head = start_tx;
sc->xl_cdata.xl_tx_tail = cur_tx;
@@ -2387,20 +2378,6 @@ static void xl_init(xsc)
*/
CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8);
- /*
- * If this is a 3c905B, also set the tx reclaim threshold.
- * This helps cut down on the number of tx reclaim errors
- * that could happen on a busy network. The chip multiplies
- * the register value by 16 to obtain the actual threshold
- * in bytes, so we divide by 16 when setting the value here.
- * The existing threshold value can be examined by reading
- * the register at offset 9 in window 5.
- */
- if (sc->xl_type == XL_TYPE_905B) {
- CSR_WRITE_2(sc, XL_COMMAND,
- XL_CMD_SET_TX_RECLAIM|(XL_PACKET_SIZE >> 4));
- }
-
/* Set RX filter bits. */
XL_SEL_WIN(5);
rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER);
diff --git a/sys/pci/if_xlreg.h b/sys/pci/if_xlreg.h
index c45914f57fbbe..b2604737c68f8 100644
--- a/sys/pci/if_xlreg.h
+++ b/sys/pci/if_xlreg.h
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_xlreg.h,v 1.19 1998/10/22 15:35:06 wpaul Exp $
+ * $Id: if_xlreg.h,v 1.16 1998/09/25 17:43:57 wpaul Exp wpaul $
*/
#define XL_EE_READ 0x0080 /* read, 5 bit address */
@@ -361,7 +361,6 @@
*/
#define XL_W5_STAT_ENB 0x0C
#define XL_W5_INTR_ENB 0x0A
-#define XL_W5_RECLAIM_THRESH 0x09 /* 3c905B only */
#define XL_W5_RX_FILTER 0x08
#define XL_W5_RX_EARLYTHRESH 0x06
#define XL_W5_TX_AVAILTHRESH 0x02
diff --git a/sys/pci/isp_pci.c b/sys/pci/isp_pci.c
index 84960d8f1e2dc..ae7842b2e079a 100644
--- a/sys/pci/isp_pci.c
+++ b/sys/pci/isp_pci.c
@@ -1,5 +1,4 @@
-/* $Id: isp_pci.c,v 1.12 1998/12/28 19:24:23 mjacob Exp $ */
-/* release_12_28_98_A+ */
+/* $FreeBSD$ */
/*
* PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
* FreeBSD Version.
@@ -79,7 +78,7 @@ static struct ispmdvec mdvec = {
ISP_CODE_LENGTH,
ISP_CODE_ORG,
ISP_CODE_VERSION,
- BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64,
+ BIU_BURST_ENABLE,
0
};
@@ -96,7 +95,7 @@ static struct ispmdvec mdvec_2100 = {
ISP2100_CODE_LENGTH,
ISP2100_CODE_ORG,
ISP2100_CODE_VERSION,
- 0, /* Irrelevant to the 2100 */
+ BIU_BURST_ENABLE,
0
};
@@ -129,7 +128,7 @@ static struct ispmdvec mdvec_2100 = {
#define MEM_MAP_REG 0x14
-static const char *isp_pci_probe __P((pcici_t tag, pcidi_t type));
+static char *isp_pci_probe __P((pcici_t tag, pcidi_t type));
static void isp_pci_attach __P((pcici_t config_d, int unit));
/* This distinguishing define is not right, but it does work */
@@ -196,8 +195,10 @@ struct pci_device isp_pci_driver = {
DATA_SET (pcidevice_set, isp_pci_driver);
-static const char *
-isp_pci_probe(pcici_t tag, pcidi_t type)
+static char *
+isp_pci_probe(tag, type)
+ pcici_t tag;
+ pcidi_t type;
{
static int oneshot = 1;
char *x;
@@ -223,7 +224,9 @@ isp_pci_probe(pcici_t tag, pcidi_t type)
static void
-isp_pci_attach(pcici_t config_id, int unit)
+isp_pci_attach(config_id, unit)
+ pcici_t config_id;
+ int unit;
{
int mapped;
pci_port_t io_port;
@@ -267,11 +270,7 @@ isp_pci_attach(pcici_t config_id, int unit)
pcs->pci_st == IO_SPACE_MAPPING? "I/O" : "Memory");
isp = &pcs->pci_isp;
-#if __FreeBSD_version >= 300006
- (void) snprintf(isp->isp_name, sizeof(isp->isp_name), "isp%d", unit);
-#else
(void) sprintf(isp->isp_name, "isp%d", unit);
-#endif
isp->isp_osinfo.unit = unit;
data = pci_conf_read(config_id, PCI_ID_REG);
@@ -288,7 +287,7 @@ isp_pci_attach(pcici_t config_id, int unit)
data = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG);
data |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN;
pci_conf_write(config_id, PCI_COMMAND_STATUS_REG, data);
-#if 0
+
/*
* Wierd- we need to clear the lsb in offset 0x30 to take the
* chip out of reset state.
@@ -296,7 +295,6 @@ isp_pci_attach(pcici_t config_id, int unit)
data = pci_conf_read(config_id, 0x30);
data &= ~1;
pci_conf_write(config_id, 0x30, data);
-#endif
ISP_UNLOCK(isp);
} else {
printf("%s: unknown dev (%x)- punting\n", isp->isp_name, data);
@@ -349,7 +347,9 @@ isp_pci_attach(pcici_t config_id, int unit)
#define PCI_BIU_REGS_OFF BIU_REGS_OFF
static u_int16_t
-isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
+isp_pci_rd_reg(isp, regoff)
+ struct ispsoftc *isp;
+ int regoff;
{
u_int16_t rv;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@@ -382,7 +382,10 @@ isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
}
static void
-isp_pci_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
+isp_pci_wr_reg(isp, regoff, val)
+ struct ispsoftc *isp;
+ int regoff;
+ u_int16_t val;
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
int offset, oldsxp = 0;
@@ -417,21 +420,33 @@ static void isp_map_result __P((void *, bus_dma_segment_t *, int, int));
static void isp_map_fcscrt __P((void *, bus_dma_segment_t *, int, int));
static void
-isp_map_rquest(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+isp_map_rquest(arg, segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *segs;
+ int nseg;
+ int error;
{
struct ispsoftc *isp = (struct ispsoftc *) arg;
isp->isp_rquest_dma = segs->ds_addr;
}
static void
-isp_map_result(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+isp_map_result(arg, segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *segs;
+ int nseg;
+ int error;
{
struct ispsoftc *isp = (struct ispsoftc *) arg;
isp->isp_result_dma = segs->ds_addr;
}
static void
-isp_map_fcscrt(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+isp_map_fcscrt(arg, segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *segs;
+ int nseg;
+ int error;
{
struct ispsoftc *isp = (struct ispsoftc *) arg;
fcparam *fcp = isp->isp_param;
@@ -439,7 +454,8 @@ isp_map_fcscrt(void *arg, bus_dma_segment_t *segs, int nseg, int error)
}
static int
-isp_pci_mbxdma(struct ispsoftc *isp)
+isp_pci_mbxdma(isp)
+ struct ispsoftc *isp;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
caddr_t base;
@@ -511,7 +527,11 @@ typedef struct {
#define MUSHERR_NOQENTRIES -2
static void
-dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
+dma2(arg, dm_segs, nseg, error)
+ void *arg;
+ bus_dma_segment_t *dm_segs;
+ int nseg;
+ int error;
{
mush_t *mp;
ISP_SCSI_XFER_T *ccb;
@@ -632,8 +652,12 @@ dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
}
static int
-isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb, ispreq_t *rq,
- u_int8_t *iptrp, u_int8_t optr)
+isp_pci_dmasetup(isp, ccb, rq, iptrp, optr)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *ccb;
+ ispreq_t *rq;
+ u_int8_t *iptrp;
+ u_int8_t optr;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
struct ccb_hdr *ccb_h;
@@ -721,8 +745,10 @@ isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb, ispreq_t *rq,
}
static void
-isp_pci_dmateardown(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb,
- u_int32_t handle)
+isp_pci_dmateardown(isp, ccb, handle)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *ccb;
+ u_int32_t handle;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
bus_dmamap_t *dp = &pci->dmaps[handle];
@@ -739,7 +765,8 @@ isp_pci_dmateardown(struct ispsoftc *isp, ISP_SCSI_XFER_T *ccb,
static int
-isp_pci_mbxdma(struct ispsoftc *isp)
+isp_pci_mbxdma(isp)
+ struct ispsoftc *isp;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
u_int32_t len;
@@ -785,8 +812,12 @@ isp_pci_mbxdma(struct ispsoftc *isp)
}
static int
-isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs,
- ispreq_t *rq, u_int8_t *iptrp, u_int8_t optr)
+isp_pci_dmasetup(isp, xs, rq, iptrp, optr)
+ struct ispsoftc *isp;
+ ISP_SCSI_XFER_T *xs;
+ ispreq_t *rq;
+ u_int8_t *iptrp;
+ u_int8_t optr;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
ispcontreq_t *crq;
@@ -911,14 +942,16 @@ isp_pci_dmasetup(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs,
#endif
static void
-isp_pci_reset1(struct ispsoftc *isp)
+isp_pci_reset1(isp)
+ struct ispsoftc *isp;
{
/* Make sure the BIOS is disabled */
isp_pci_wr_reg(isp, HCCR, PCI_HCCR_CMD_BIOS);
}
static void
-isp_pci_dumpregs(struct ispsoftc *isp)
+isp_pci_dumpregs(isp)
+ struct ispsoftc *isp;
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
printf("%s: PCI Status Command/Status=%lx\n", pci->pci_isp.isp_name,
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index f81578d9496e5..c65860beb084a 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -197,7 +197,7 @@ static meteor_reg_t meteor[NMETEOR];
#define METPRI (PZERO+8)|PCATCH
-static const char* met_probe (pcici_t tag, pcidi_t type);
+static char* met_probe (pcici_t tag, pcidi_t type);
static void met_attach(pcici_t tag, int unit);
static u_long met_count;
@@ -517,7 +517,7 @@ register int err = 0;
}
#undef i2c_print
-static const char *
+static char *
met_probe (pcici_t tag, pcidi_t type)
{
@@ -2054,7 +2054,7 @@ meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
}
int
-meteor_mmap(dev_t dev, vm_offset_t offset, int nprot)
+meteor_mmap(dev_t dev, int offset, int nprot)
{
int unit;
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c
index 79d8eaefe053a..37033226272c1 100644
--- a/sys/pci/ncr.c
+++ b/sys/pci/ncr.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: ncr.c,v 1.140 1998/12/14 05:47:27 dillon Exp $
+** $Id: ncr.c,v 1.136 1998/09/29 09:14:52 bde Exp $
**
** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family.
**
@@ -1333,6 +1333,7 @@ static void ncr_getsync (ncb_p np, u_char sfac, u_char *fakp,
u_char *scntl3p);
static void ncr_setsync (ncb_p np, nccb_p cp,u_char scntl3,u_char sxfer,
u_char period);
+static void ncr_settags (tcb_p tp, lcb_p lp, u_long usrtag);
static void ncr_setwide (ncb_p np, nccb_p cp, u_char wide, u_char ack);
static int ncr_show_msg (u_char * msg);
static int ncr_snooptest (ncb_p np);
@@ -1340,7 +1341,7 @@ static void ncr_action (struct cam_sim *sim, union ccb *ccb);
static void ncr_timeout (void *arg);
static void ncr_wakeup (ncb_p np, u_long code);
-static const char* ncr_probe (pcici_t tag, pcidi_t type);
+static char* ncr_probe (pcici_t tag, pcidi_t type);
static void ncr_attach (pcici_t tag, int unit);
#endif /* KERNEL */
@@ -1355,10 +1356,8 @@ static void ncr_attach (pcici_t tag, int unit);
*/
-#if !defined(lint)
-static const char ident[] =
- "\n$Id: ncr.c,v 1.140 1998/12/14 05:47:27 dillon Exp $\n";
-#endif
+static char ident[] =
+ "\n$Id: ncr.c,v 1.136 1998/09/29 09:14:52 bde Exp $\n";
static const u_long ncr_version = NCR_VERSION * 11
+ (u_long) sizeof (struct ncb) * 7
@@ -1411,7 +1410,7 @@ DATA_SET (pcidevice_set, ncr_device);
static char *ncr_name (ncb_p np)
{
static char name[10];
- snprintf(name, sizeof(name), "ncr%d", np->unit);
+ sprintf(name, "ncr%d", np->unit);
return (name);
}
@@ -3357,7 +3356,7 @@ static int ncr_chip_lookup(u_long device_id, u_char revision_id)
-static const char* ncr_probe (pcici_t tag, pcidi_t type)
+static char* ncr_probe (pcici_t tag, pcidi_t type)
{
u_char rev = pci_conf_read (tag, PCI_CLASS_REG) & 0xff;
int i;
@@ -5014,6 +5013,8 @@ ncr_setsync(ncb_p np, nccb_p cp, u_char scntl3, u_char sxfer, u_char period)
tp->tinfo.wval = scntl3;
if (sxfer & 0x1f) {
+ unsigned f10 = 100000 << tp->tinfo.current.width;
+ unsigned mb10 = (f10 + period_10ns/2) / period_10ns;
/*
** Disable extended Sreq/Sack filtering
*/
@@ -7115,7 +7116,7 @@ struct tekram_eeprom {
#define TKR_ADPT_ACTNEG 0x08
#define TKR_ADPT_NOSEEK 0x10
#define TKR_ADPT_MORLUN 0x20
- u_char delay; /* unit ? ( table ??? ) */
+ u_char delay; /* unit ? (table ???) */
u_char tags; /* use 4 times as many ... */
u_char filler[60];
};
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 73b8142a89c00..8d5fd193fe2eb 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci.c,v 1.92 1999/01/12 01:44:42 eivind Exp $
+ * $Id: pci.c,v 1.88 1998/09/15 22:05:37 gibbs Exp $
*
*/
@@ -148,10 +148,9 @@ pci_maprange(unsigned mapreg)
static pcimap *
pci_readmaps(pcicfgregs *cfg, int maxmaps)
{
- int i, j = 0;
+ int i;
pcimap *map;
int map64 = 0;
- int reg = PCIR_MAPS;
for (i = 0; i < maxmaps; i++) {
int reg = PCIR_MAPS + i*4;
@@ -161,48 +160,40 @@ pci_readmaps(pcicfgregs *cfg, int maxmaps)
base = pci_cfgread(cfg, reg, 4);
ln2range = pci_maprange(base);
- if (base == 0 || ln2range == 0 || base == 0xffffffff)
- continue; /* skip invalid entry */
- else {
- j++;
- if (ln2range > 32) {
- i++;
- j++;
- }
- }
+ if (base == 0 || ln2range == 0)
+ maxmaps = i;
+ else if (ln2range > 32)
+ i++;
}
- map = malloc(j * sizeof (pcimap), M_DEVBUF, M_WAITOK);
+ map = malloc(maxmaps * sizeof (pcimap), M_DEVBUF, M_WAITOK);
if (map != NULL) {
- bzero(map, sizeof(pcimap) * j);
- cfg->nummaps = j;
+ bzero(map, sizeof(pcimap) * maxmaps);
- for (i = 0, j = 0; i < maxmaps; i++, reg += 4) {
+ for (i = 0; i < maxmaps; i++) {
+ int reg = PCIR_MAPS + i*4;
u_int32_t base;
u_int32_t testval;
base = pci_cfgread(cfg, reg, 4);
if (map64 == 0) {
- if (base == 0 || base == 0xffffffff)
- continue; /* skip invalid entry */
pci_cfgwrite(cfg, reg, 0xffffffff, 4);
testval = pci_cfgread(cfg, reg, 4);
pci_cfgwrite(cfg, reg, base, 4);
- map[j].reg = reg;
- map[j].base = pci_mapbase(base);
- map[j].type = pci_maptype(base);
- map[j].ln2size = pci_mapsize(testval);
- map[j].ln2range = pci_maprange(testval);
- map64 = map[j].ln2range == 64;
+ map[i].base = pci_mapbase(base);
+ map[i].type = pci_maptype(base);
+ map[i].ln2size = pci_mapsize(testval);
+ map[i].ln2range = pci_maprange(testval);
+ map64 = map[i].ln2range == 64;
} else {
/* only fill in base, other fields are 0 */
- map[j].base = base;
+ map[i].base = base;
map64 = 0;
}
- j++;
}
+ cfg->nummaps = maxmaps;
}
return (map);
}
@@ -483,6 +474,14 @@ pci_addcfg(struct pci_devinfo *dinfo)
pci_drvattach(dinfo); /* XXX currently defined in pci_compat.c */
}
+/* return pointer to device that is a bridge to this bus */
+
+static pcicfgregs *
+pci_bridgeto(int bus)
+{
+ return (NULL); /* XXX not yet implemented */
+}
+
/* scan one PCI bus for devices */
static int
@@ -765,7 +764,7 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
*/
if ((error = useracc((caddr_t)cio->patterns,
cio->pat_buf_len, B_READ)) != 1){
- printf("pci_ioctl: pattern buffer %p, "
+ printf("pci_ioctl: pattern buffer %#p, "
"length %u isn't user accessible for"
" READ\n", cio->patterns,
cio->pat_buf_len);
@@ -801,7 +800,7 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
*/
if ((error = useracc((caddr_t)cio->matches, cio->match_buf_len,
B_WRITE)) != 1) {
- printf("pci_ioctl: match buffer %p, length %u "
+ printf("pci_ioctl: match buffer %#p, length %u "
"isn't user accessible for WRITE\n",
cio->matches, cio->match_buf_len);
error = EACCES;
diff --git a/sys/pci/pci_compat.c b/sys/pci/pci_compat.c
index 9f4c612b161fe..c08231820733d 100644
--- a/sys/pci/pci_compat.c
+++ b/sys/pci/pci_compat.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci_compat.c,v 1.19 1999/01/14 06:22:10 jdp Exp $
+ * $Id: pci_compat.c,v 1.11 1998/09/15 08:21:09 gibbs Exp $
*
*/
@@ -35,7 +35,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
-#include <sys/linker_set.h>
+#include <sys/kernel.h> /* for DATA_SET support */
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -48,10 +48,6 @@
#include <sys/drvresource.h>
#endif
-#ifdef APIC_IO
-#include <machine/smp.h>
-#endif
-
#ifdef PCI_COMPAT
/* ------------------------------------------------------------------------- */
@@ -59,16 +55,13 @@
static int
pci_mapno(pcicfgregs *cfg, int reg)
{
- int i, nummaps;
- pcimap *map;
-
- nummaps = cfg->nummaps;
- map = cfg->map;
-
- for (i = 0; i < nummaps; i++)
- if (map[i].reg == reg)
- return (i);
- return (-1);
+ int map = -1;
+ if ((reg & 0x03) == 0) {
+ map = (reg -0x10) / 4;
+ if (map < 0 || map >= cfg->nummaps)
+ map = -1;
+ }
+ return (map);
}
static int
@@ -175,10 +168,11 @@ int pci_map_mem(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
int
pci_map_dense(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
{
+ vm_offset_t dense;
+ int retval = 0;
+
if(pci_map_mem(cfg, reg, va, pa)){
#ifdef __alpha__
- vm_offset_t dense;
-
if(dense = pci_cvt_to_dense(*pa)){
*pa = dense;
*va = ALPHA_PHYS_TO_K0SEG(*pa);
@@ -195,10 +189,11 @@ pci_map_dense(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
int
pci_map_bwx(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
{
+ vm_offset_t bwx;
+ int retval = 0;
+
if(pci_map_mem(cfg, reg, va, pa)){
#ifdef __alpha__
- vm_offset_t bwx;
-
if(bwx = pci_cvt_to_bwx(*pa)){
*pa = bwx;
*va = ALPHA_PHYS_TO_K0SEG(*pa);
@@ -212,15 +207,9 @@ pci_map_bwx(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
return (0);
}
-int
-pci_map_int(pcici_t cfg, pci_inthand_t *handler, void *arg, intrmask_t *maskptr)
-{
- return (pci_map_int_right(cfg, handler, arg, maskptr, 0));
-}
int
-pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
- intrmask_t *maskptr, u_int flags)
+pci_map_int(pcici_t cfg, pci_inthand_t *func, void *arg, unsigned *maskptr)
{
int error;
#ifdef APIC_IO
@@ -231,8 +220,7 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
void *dev_instance = (void *)-1; /* XXX use cfg->devdata */
void *idesc;
- idesc = intr_create(dev_instance, irq, handler, arg, maskptr,
- flags);
+ idesc = intr_create(dev_instance, irq, func, arg, maskptr, 0);
error = intr_connect(idesc);
if (error != 0)
return 0;
@@ -265,8 +253,8 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
nextpin = next_apic_irq(irq);
while (nextpin >= 0) {
- idesc = intr_create(dev_instance, nextpin, handler,
- arg, maskptr, flags);
+ idesc = intr_create(dev_instance, nextpin, func, arg,
+ maskptr, 0);
error = intr_connect(idesc);
if (error != 0)
return 0;
@@ -355,9 +343,9 @@ pci_freeunit(pcicfgregs *cfg, char *name, int unit)
return (unit);
}
-static const char *drvname;
+static char *drvname;
-static const char*
+static char*
pci_probedrv(pcicfgregs *cfg, struct pci_device *dvp)
{
if (dvp && dvp->pd_probe) {
@@ -435,7 +423,6 @@ pci_drvattach(struct pci_devinfo *dinfo)
else
strncpy(dinfo->conf.pd_name, "????",
sizeof(dinfo->conf.pd_name));
- dinfo->conf.pd_name[sizeof(dinfo->conf.pd_name) - 1] = 0;
dinfo->conf.pd_unit = unit;
@@ -461,7 +448,7 @@ int pci_register_lkm (struct pci_device *dvp, int if_revision)
return (-1);
}
lkm = malloc (sizeof (*lkm), M_DEVBUF, M_WAITOK);
- if (lkm == NULL) {
+ if (lkm != NULL) {
return (-1);
}
diff --git a/sys/pci/pcic_p.c b/sys/pci/pcic_p.c
index fd8b40b2ceefc..4c667f223d0d3 100644
--- a/sys/pci/pcic_p.c
+++ b/sys/pci/pcic_p.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcic_p.c,v 1.6 1998/08/18 00:32:48 bde Exp $
+ * $Id: pcic_p.c,v 1.5 1998/02/07 20:41:20 nate Exp $
*/
#include "pci.h"
@@ -44,7 +44,7 @@
static u_long pcic_pci_count = 0;
-static const char *pcic_pci_probe(pcici_t, pcidi_t);
+static char *pcic_pci_probe(pcici_t, pcidi_t);
static void pcic_pci_attach(pcici_t, int);
static void pd6832_legacy_init(pcici_t tag, int unit);
@@ -63,7 +63,7 @@ DATA_SET(pcidevice_set, pcic_pci_driver);
* Return the ID string for the controller if the vendor/product id
* matches, NULL otherwise.
*/
-static const char *
+static char *
pcic_pci_probe(pcici_t tag, pcidi_t type)
{
switch (type) {
diff --git a/sys/pci/pcisupport.c b/sys/pci/pcisupport.c
index b502bbf7b8645..b78ac652d8b08 100644
--- a/sys/pci/pcisupport.c
+++ b/sys/pci/pcisupport.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcisupport.c,v 1.85 1998/12/23 14:28:37 foxfair Exp $
+** $Id: pcisupport.c,v 1.71 1998/07/07 05:00:09 bde Exp $
**
** Device driver for DEC/INTEL PCI chipsets.
**
@@ -42,7 +42,6 @@
*/
#include "opt_pci.h"
-#include "opt_smp.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,7 +62,7 @@
**---------------------------------------------------------
*/
-static const char* chipset_probe (pcici_t tag, pcidi_t type);
+static char* chipset_probe (pcici_t tag, pcidi_t type);
static void chipset_attach(pcici_t tag, int unit);
static u_long chipset_count;
@@ -103,12 +102,10 @@ generic_pci_bridge (pcici_t tag)
case 5: strcpy(tmpbuf, "PCI to PCMCIA"); break;
case 7: strcpy(tmpbuf, "PCI to CardBus"); break;
default:
- snprintf(tmpbuf, sizeof(tmpbuf),
- "PCI to 0x%x", classreg>>16 & 0xff);
+ sprintf(tmpbuf, "PCI to 0x%x", classreg>>16 & 0xff);
break;
}
- snprintf(tmpbuf+strlen(tmpbuf), sizeof(tmpbuf)-strlen(tmpbuf),
- " bridge (vendor=%04x device=%04x)",
+ sprintf(tmpbuf+strlen(tmpbuf), " bridge (vendor=%04x device=%04x)",
id & 0xffff, (id >> 16) & 0xffff);
descr = malloc (strlen(tmpbuf) +1, M_DEVBUF, M_WAITOK);
strcpy(descr, tmpbuf);
@@ -121,7 +118,6 @@ generic_pci_bridge (pcici_t tag)
* XXX Both fixbushigh_orion() and fixbushigh_i1225() are bogus in that way,
* that they store the highest bus number to scan in this device's config
* data, though it is about PCI buses attached to the CPU independently!
- * The same goes for fixbushigh_450nx.
*/
static void
@@ -141,68 +137,6 @@ fixbushigh_i1225(pcici_t tag)
tag->secondarybus = tag->subordinatebus = sublementarybus +1;
}
-
-/*
- * This reads the PCI config space for the 82451NX MIOC in the 450NX
- * chipset to determine the PCI bus configuration.
- *
- * Assuming the BIOS has set up the MIOC properly, this will correctly
- * report the number of PCI busses in the system.
- *
- * A small problem is that the Host to PCI bridge control is in the MIOC,
- * while the host-pci bridges are separate PCI devices. So it really
- * isn't easily possible to set up the subordinatebus mappings as the
- * 82454NX PCI expander bridges are probed, although that makes the
- * most sense.
- */
-static void
-fixbushigh_450nx(pcici_t tag)
-{
- int subordinatebus;
- unsigned long devmap;
-
- /*
- * Read the DEVMAP field, so we know which fields to check.
- * If the Host-PCI bridge isn't marked as present by the BIOS,
- * we have to assume it doesn't exist.
- * If this doesn't find all the PCI busses, complain to the
- * BIOS vendor. There is nothing more we can do.
- */
- devmap = pci_cfgread(tag, 0xd6, 2) & 0x3c;
- if (!devmap)
- panic("450NX MIOC: No host to PCI bridges marked present.\n");
- /*
- * Since the buses are configured in order, we just have to
- * find the highest bus, and use those numbers.
- */
- if (devmap & 0x20) { /* B1 */
- subordinatebus = pci_cfgread(tag, 0xd5, 1);
- } else if (devmap & 0x10) { /* A1 */
- subordinatebus = pci_cfgread(tag, 0xd4, 1);
- } else if (devmap & 0x8) { /* B0 */
- subordinatebus = pci_cfgread(tag, 0xd2, 1);
- } else /* if (devmap & 0x4) */ { /* A0 */
- subordinatebus = pci_cfgread(tag, 0xd1, 1);
- }
- if (subordinatebus == 255) {
- printf("fixbushigh_450nx: bogus highest PCI bus %d",
- subordinatebus);
-#ifdef NBUS
- subordinatebus = NBUS - 2;
-#else
- subordinatebus = 10;
-#endif
- printf(", reduced to %d\n", subordinatebus);
- }
-
- if (bootverbose)
- printf("fixbushigh_450nx: subordinatebus is %d\n",
- subordinatebus);
-
- tag->secondarybus = tag->subordinatebus = subordinatebus;
-}
-
-
static void
fixwsc_natoma(pcici_t tag)
{
@@ -225,7 +159,7 @@ fixwsc_natoma(pcici_t tag)
}
-static const char*
+static char*
chipset_probe (pcici_t tag, pcidi_t type)
{
unsigned rev;
@@ -246,6 +180,8 @@ chipset_probe (pcici_t tag, pcidi_t type)
return ("Intel 82424ZX (Saturn) cache DRAM controller");
case 0x04828086:
return ("Intel 82375EB PCI-EISA bridge");
+ case 0x04961039:
+ return ("SiS 85c496");
case 0x04a38086:
rev = (unsigned) pci_conf_read (tag, PCI_CLASS_REG) & 0xff;
if (rev == 16 || rev == 17)
@@ -264,14 +200,24 @@ chipset_probe (pcici_t tag, pcidi_t type)
return ("Intel 82437MX mobile PCI cache memory controller");
case 0x12508086:
return ("Intel 82439");
+ case 0x04061039:
+ return ("SiS 85c501");
+ case 0x00081039:
+ return ("SiS 85c503");
+ case 0x06011039:
+ return ("SiS 85c601");
case 0x70008086:
return ("Intel 82371SB PCI to ISA bridge");
+ case 0x70208086:
+ return ("Intel 82371SB USB host controller");
case 0x70308086:
return ("Intel 82437VX PCI cache memory controller");
case 0x71008086:
return ("Intel 82439TX System Controller (MTXC)");
case 0x71108086:
return ("Intel 82371AB PCI to ISA bridge");
+ case 0x71128086:
+ return ("Intel 82371AB USB host controller");
case 0x71138086:
return ("Intel 82371AB Power management controller");
case 0x71908086:
@@ -289,7 +235,6 @@ chipset_probe (pcici_t tag, pcidi_t type)
case 0x84c58086:
return ("Intel 82453KX/GX (Orion) PCI memory controller");
case 0x84ca8086:
- fixbushigh_450nx(tag);
return ("Intel 82451NX Memory and I/O Controller");
case 0x84cb8086:
return ("Intel 82454NX PCI Expander Bridge");
@@ -299,16 +244,6 @@ chipset_probe (pcici_t tag, pcidi_t type)
return ("DEC 21050 PCI-PCI bridge");
case 0x124b8086:
return ("Intel 82380FB mobile PCI to PCI bridge");
- /* SiS -- vendor 0x1039 */
- case 0x04961039:
- return ("SiS 85c496");
- case 0x04061039:
- return ("SiS 85c501");
- case 0x00081039:
- return ("SiS 85c503");
- case 0x06011039:
- return ("SiS 85c601");
-
/* VLSI -- vendor 0x1004 */
case 0x00051004:
return ("VLSI 82C592 Host to PCI bridge");
@@ -340,29 +275,10 @@ chipset_probe (pcici_t tag, pcidi_t type)
case 0x05971106:
return("VIA 82C597 (Apollo VP3) system controller");
/* XXX need info on the MVP3 -- any takers? */
+ case 0x30381106:
+ return("VIA 82C586B USB host controller");
case 0x30401106:
return("VIA 82C586B ACPI interface");
- /* XXX Here is MVP3, I got the datasheet but NO M/B to test it */
- /* totally. Please let me know if anything wrong. -F */
- case 0x05981106:
- return("VIA 82C598MVP (Apollo MVP3) host bridge");
- case 0x85981106:
- return("VIA 82C598MVP (Apollo MVP3) PCI-PCI bridge");
-
- /* AcerLabs -- vendor 0x10b9 */
- /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */
- /* id is '10b9" but the register always shows "10b9". -Foxfair */
- case 0x154110b9:
- return("AcerLabs M1541 (Aladdin-V) PCI host bridge");
- case 0x153310b9:
- return("AcerLabs M1533 portable PCI-ISA bridge");
- case 0x154310b9:
- return("AcerLabs M1543 desktop PCI-ISA bridge");
- case 0x524710b9:
- return("AcerLabs M5247 PCI-PCI(AGP Supported) bridge");
- case 0x524310b9:/* 5243 seems like 5247, need more info to divide*/
- return("AcerLabs M5243 PCI-PCI bridge");
-
/* NEC -- vendor 0x1033 */
case 0x00011033:
@@ -931,7 +847,7 @@ chipset_attach (pcici_t config_id, int unit)
**---------------------------------------------------------
*/
-static const char* vga_probe (pcici_t tag, pcidi_t type);
+static char* vga_probe (pcici_t tag, pcidi_t type);
static void vga_attach (pcici_t tag, int unit);
static u_long vga_count;
@@ -945,7 +861,7 @@ static struct pci_device vga_device = {
DATA_SET (pcidevice_set, vga_device);
-static const char* vga_probe (pcici_t tag, pcidi_t typea)
+static char* vga_probe (pcici_t tag, pcidi_t typea)
{
int data = pci_conf_read(tag, PCI_CLASS_REG);
u_int id = pci_conf_read(tag, PCI_ID_REG);
@@ -958,7 +874,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
vendor = "NeoMagic";
switch (id >> 16) {
case 0x0004:
- chip = "NM2160 laptop"; break;
+ chip = "NM3160 laptop"; break;
}
break;
case 0x102b:
@@ -970,7 +886,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
case 0x0519:
chip = "MGA 2064W"; break;
case 0x051a:
- chip = "MGA 1024SG/1064SG/1164SG"; break;
+ chip = "MGA 1024SG"; break;
case 0x051b:
chip = "MGA 2164W"; break;
}
@@ -1171,10 +1087,8 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
if (vendor && chip) {
char *buf;
int len;
-#if 0
int i;
int reqmapmem;
-#endif
if (type == 0) {
type = "SVGA controller";
@@ -1204,8 +1118,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
len = strlen(vendor) + strlen(chip) + strlen(type) + 4;
MALLOC(buf, char *, len, M_TEMP, M_NOWAIT);
- if (buf)
- sprintf(buf, "%s %s %s", vendor, chip, type);
+ sprintf(buf, "%s %s %s", vendor, chip, type);
return buf;
}
@@ -1224,14 +1137,8 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
if ((data & PCI_SUBCLASS_MASK)
== PCI_SUBCLASS_DISPLAY_VGA)
type = "VGA-compatible display device";
- else {
- /*
- * If it isn't a vga display device,
- * don't pretend we found one.
- */
+ else
type = "Display device";
- return 0;
- }
}
break;
@@ -1253,8 +1160,7 @@ static const char* vga_probe (pcici_t tag, pcidi_t typea)
len = strlen(vendor) + strlen(type) + 2 + 6 + 4 + 1;
MALLOC(buf, char *, len, M_TEMP, M_NOWAIT);
- if (buf)
- sprintf(buf, "%s model %04x %s", vendor, id >> 16, type);
+ sprintf(buf, "%s model %04x %s", vendor, id >> 16, type);
return buf;
}
return type;
@@ -1282,7 +1188,7 @@ static void vga_attach (pcici_t tag, int unit)
**---------------------------------------------------------
*/
-static const char* lkm_probe (pcici_t tag, pcidi_t type);
+static char* lkm_probe (pcici_t tag, pcidi_t type);
static void lkm_attach (pcici_t tag, int unit);
static u_long lkm_count;
@@ -1296,7 +1202,7 @@ static struct pci_device lkm_device = {
DATA_SET (pcidevice_set, lkm_device);
-static const char*
+static char*
lkm_probe (pcici_t tag, pcidi_t type)
{
/*
@@ -1317,7 +1223,7 @@ lkm_attach (pcici_t tag, int unit)
**---------------------------------------------------------
*/
-static const char* ign_probe (pcici_t tag, pcidi_t type);
+static char* ign_probe (pcici_t tag, pcidi_t type);
static void ign_attach (pcici_t tag, int unit);
static u_long ign_count;
@@ -1331,7 +1237,7 @@ static struct pci_device ign_device = {
DATA_SET (pcidevice_set, ign_device);
-static const char*
+static char*
ign_probe (pcici_t tag, pcidi_t type)
{
switch (type) {
diff --git a/sys/pci/pcivar.h b/sys/pci/pcivar.h
index 7843e3a6d656b..13e9991eefc31 100644
--- a/sys/pci/pcivar.h
+++ b/sys/pci/pcivar.h
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pcivar.h,v 1.24 1999/01/13 04:59:19 bde Exp $
+ * $Id: pcivar.h,v 1.21 1998/09/15 08:21:09 gibbs Exp $
*
*/
@@ -66,7 +66,7 @@ typedef struct {
#define PCI_MAPPORT 0x04 /* port map */
u_int8_t ln2size;
u_int8_t ln2range;
- u_int8_t reg; /* offset of map register in config space */
+/* u_int8_t dummy;*/
} pcimap;
/* config header information common to all header types */
@@ -199,7 +199,7 @@ extern int pci_mechanism;
struct pci_device {
char* pd_name;
- const char* (*pd_probe ) (pcici_t tag, pcidi_t type);
+ char* (*pd_probe ) (pcici_t tag, pcidi_t type);
void (*pd_attach) (pcici_t tag, int unit);
u_long *pd_count;
int (*pd_shutdown) (int, int);
@@ -223,10 +223,7 @@ int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa);
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
int pci_map_dense (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
int pci_map_bwx (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
-int pci_map_int (pcici_t tag, pci_inthand_t *handler, void *arg,
- intrmask_t *maskptr);
-int pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
- intrmask_t *maskptr, u_int flags);
+int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
int pci_unmap_int (pcici_t tag);
int pci_register_lkm (struct pci_device *dvp, int if_revision);
diff --git a/sys/pci/simos.c b/sys/pci/simos.c
index 85642b814b3f1..0be0397f52e2f 100644
--- a/sys/pci/simos.c
+++ b/sys/pci/simos.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: simos.c,v 1.2 1998/09/26 14:49:26 dfr Exp $
+ * $Id: simos.c,v 1.1 1998/06/10 10:57:14 dfr Exp $
*/
#include <sys/param.h>
@@ -70,7 +70,7 @@ struct simos_softc* simosp[10];
static u_long simos_unit;
-static const char *simos_probe __P((pcici_t tag, pcidi_t type));
+static char *simos_probe __P((pcici_t tag, pcidi_t type));
static void simos_attach __P((pcici_t config_d, int unit));
static void simos_action __P((struct cam_sim *sim, union ccb *ccb));
static void simos_poll __P((struct cam_sim *sim));
@@ -84,7 +84,7 @@ struct pci_device simos_driver = {
};
DATA_SET (pcidevice_set, simos_driver);
-static const char *
+static char *
simos_probe(pcici_t tag, pcidi_t type)
{
switch (type) {
diff --git a/sys/pci/if_txvar.h b/sys/pci/smc83c170.h
index efa282c247aaa..737eac398c6e4 100644
--- a/sys/pci/if_txvar.h
+++ b/sys/pci/smc83c170.h
@@ -1,6 +1,3 @@
-/* $OpenBSD: if_txvar.h,v 1.3 1998/10/10 04:30:09 jason Exp $ */
-/* $Id: if_txvar.h,v 1.3 1998/10/10 04:30:09 jason Exp $ */
-
/*-
* Copyright (c) 1997 Semen Ustimenko
* All rights reserved.
@@ -26,26 +23,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * $Id: smc83c170.h,v 1.14 1998/07/03 23:59:09 galv Exp $
*
*/
/*
* Configuration
*/
-#ifndef ETHER_MAX_LEN
-#define ETHER_MAX_LEN 1518
-#endif
-#ifndef ETHER_MIN_LEN
-#define ETHER_MIN_LEN 64
-#endif
-#ifndef ETHER_CRC_LEN
-#define ETHER_CRC_LEN 4
-#endif
-#define TX_RING_SIZE 16 /* Leave this a power of 2 */
-#define RX_RING_SIZE 16 /* And this too, to do not */
- /* confuse RX(TX)_RING_MASK */
-#define TX_RING_MASK (TX_RING_SIZE - 1)
-#define RX_RING_MASK (RX_RING_SIZE - 1)
+#define TX_RING_SIZE 8
+#define RX_RING_SIZE 8
#define EPIC_FULL_DUPLEX 1
#define EPIC_HALF_DUPLEX 0
#define ETHER_MAX_FRAME_LEN (ETHER_MAX_LEN + ETHER_CRC_LEN)
@@ -192,9 +178,12 @@
#define TXCON_FULL_DUPLEX 0x00000006
#define TXCON_SLOT_TIME 0x00000078
-#define TXCON_DEFAULT (TXCON_SLOT_TIME | TXCON_EARLY_TRANSMIT_ENABLE)
-#define TRANSMIT_THRESHOLD 0x80
-
+#if defined(EARLY_TX)
+ #define TXCON_DEFAULT (TXCON_SLOT_TIME | TXCON_EARLY_TRANSMIT_ENABLE)
+ #define TRANSMIT_THRESHOLD 0x40
+#else
+ #define TXCON_DEFAULT (TXCON_SLOT_TIME)
+#endif
#if defined(EARLY_RX)
#define RXCON_DEFAULT (RXCON_EARLY_RECEIVE_ENABLE | RXCON_SAVE_ERRORED_PACKETS)
#else
@@ -288,13 +277,12 @@ struct epic_rx_desc {
/* This structure defines EPIC's fragment list, maximum number of frags */
/* is 63. Let use maximum, becouse size of struct MUST be divisor of */
/* PAGE_SIZE, and sometimes come mbufs with more then 30 frags */
-#define EPIC_MAX_FRAGS 63
struct epic_frag_list {
volatile u_int32_t numfrags;
struct {
volatile u_int32_t fragaddr;
volatile u_int32_t fraglen;
- } frag[EPIC_MAX_FRAGS];
+ } frag[63];
volatile u_int32_t pad; /* align on 256 bytes */
};
@@ -314,22 +302,6 @@ struct epic_tx_buffer {
/* Driver status structure */
typedef struct {
-#if defined(__OpenBSD__)
- struct device sc_dev;
- void *sc_ih;
- bus_space_tag_t sc_st;
- bus_space_handle_t sc_sh;
-#else /* __FreeBSD__ */
-#if defined(EPIC_USEIOSPACE)
- u_int32_t iobase;
-#else
- caddr_t csr;
-#endif
-#endif
-#if !defined(EPIC_NOIFMEDIA)
- struct ifmedia ifmedia;
-#endif
- struct arpcom arpcom;
u_int32_t unit;
struct epic_rx_buffer rx_buffer[RX_RING_SIZE];
struct epic_tx_buffer tx_buffer[TX_RING_SIZE];
@@ -339,68 +311,79 @@ typedef struct {
struct epic_rx_desc *rx_desc;
struct epic_tx_desc *tx_desc;
struct epic_frag_list *tx_flist;
+#if defined(_NET_IF_MEDIA_H_)
+ struct ifmedia ifmedia;
+#endif
+ struct arpcom epic_ac;
u_int32_t flags;
- u_int32_t tx_threshold;
- u_int32_t txcon;
u_int32_t phyid;
u_int32_t cur_tx;
u_int32_t cur_rx;
u_int32_t dirty_tx;
u_int32_t pending_txs;
- void *pool;
+#if defined(EPIC_USEIOSPACE)
+ u_int32_t iobase;
+#else
+ caddr_t csr;
+#endif
} epic_softc_t;
-#if defined(__FreeBSD__)
-#define EPIC_FORMAT "tx%d"
-#define EPIC_ARGS(sc) (sc->unit)
-#define sc_if arpcom.ac_if
-#define sc_macaddr arpcom.ac_enaddr
+#define epic_if epic_ac.ac_if
+#define epic_macaddr epic_ac.ac_enaddr
#if defined(EPIC_USEIOSPACE)
-#define CSR_WRITE_4(sc,reg,val) \
- outl( (sc)->iobase + (u_int32_t)(reg), (val) )
-#define CSR_WRITE_2(sc,reg,val) \
- outw( (sc)->iobase + (u_int32_t)(reg), (val) )
-#define CSR_WRITE_1(sc,reg,val) \
- outb( (sc)->iobase + (u_int32_t)(reg), (val) )
-#define CSR_READ_4(sc,reg) \
- inl( (sc)->iobase + (u_int32_t)(reg) )
-#define CSR_READ_2(sc,reg) \
- inw( (sc)->iobase + (u_int32_t)(reg) )
-#define CSR_READ_1(sc,reg) \
- inb( (sc)->iobase + (u_int32_t)(reg) )
+ #define CSR_WRITE_4(sc,reg,val) outl( (sc)->iobase + (u_int32_t)(reg), (val) )
+ #define CSR_WRITE_2(sc,reg,val) outw( (sc)->iobase + (u_int32_t)(reg), (val) )
+ #define CSR_WRITE_1(sc,reg,val) outb( (sc)->iobase + (u_int32_t)(reg), (val) )
+ #define CSR_READ_4(sc,reg) inl( (sc)->iobase + (u_int32_t)(reg) )
+ #define CSR_READ_2(sc,reg) inw( (sc)->iobase + (u_int32_t)(reg) )
+ #define CSR_READ_1(sc,reg) inb( (sc)->iobase + (u_int32_t)(reg) )
#else
-#define CSR_WRITE_1(sc,reg,val) \
- ((*(u_int8_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int8_t)(val))
-#define CSR_WRITE_2(sc,reg,val) \
- ((*(u_int16_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int16_t)(val))
-#define CSR_WRITE_4(sc,reg,val) \
- ((*(u_int32_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int32_t)(val))
-#define CSR_READ_1(sc,reg) \
- (*(u_int8_t*)((sc)->csr + (u_int32_t)(reg)))
-#define CSR_READ_2(sc,reg) \
- (*(u_int16_t*)((sc)->csr + (u_int32_t)(reg)))
-#define CSR_READ_4(sc,reg) \
- (*(u_int32_t*)((sc)->csr + (u_int32_t)(reg)))
-#endif
-#else /* __OpenBSD__ */
-#define EPIC_FORMAT "%s"
-#define EPIC_ARGS(sc) (sc->sc_dev.dv_xname)
-#define sc_if arpcom.ac_if
-#define sc_macaddr arpcom.ac_enaddr
-#define CSR_WRITE_4(sc,reg,val) \
- bus_space_write_4( (sc)->sc_st, (sc)->sc_sh, (reg), (val) )
-#define CSR_WRITE_2(sc,reg,val) \
- bus_space_write_2( (sc)->sc_st, (sc)->sc_sh, (reg), (val) )
-#define CSR_WRITE_1(sc,reg,val) \
- bus_space_write_1( (sc)->sc_st, (sc)->sc_sh, (reg), (val) )
-#define CSR_READ_4(sc,reg) \
- bus_space_read_4( (sc)->sc_st, (sc)->sc_sh, (reg) )
-#define CSR_READ_2(sc,reg) \
- bus_space_read_2( (sc)->sc_st, (sc)->sc_sh, (reg) )
-#define CSR_READ_1(sc,reg) \
- bus_space_read_1( (sc)->sc_st, (sc)->sc_sh, (reg) )
+ #define CSR_WRITE_1(sc,reg,val) ((*(u_int8_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int8_t)(val))
+ #define CSR_WRITE_2(sc,reg,val) ((*(u_int16_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int16_t)(val))
+ #define CSR_WRITE_4(sc,reg,val) ((*(u_int32_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int32_t)(val))
+ #define CSR_READ_1(sc,reg) (*(u_int8_t*)((sc)->csr + (u_int32_t)(reg)))
+ #define CSR_READ_2(sc,reg) (*(u_int16_t*)((sc)->csr + (u_int32_t)(reg)))
+ #define CSR_READ_4(sc,reg) (*(u_int32_t*)((sc)->csr + (u_int32_t)(reg)))
#endif
-
#define PHY_READ_2(sc,reg) epic_read_phy_register(sc,reg)
#define PHY_WRITE_2(sc,reg,val) epic_write_phy_register(sc,reg,val)
+static char* epic_pci_probe __P((pcici_t, pcidi_t));
+
+/* Folowing functions calls splimp() */
+static int epic_ifioctl __P((register struct ifnet *, u_long, caddr_t));
+static void epic_ifstart __P((struct ifnet *));
+static void epic_ifwatchdog __P((struct ifnet *));
+static void epic_pci_attach __P((pcici_t, int));
+static int epic_init __P((epic_softc_t *));
+static void epic_stop __P((epic_softc_t *));
+
+static int epic_ifmedia_change __P((struct ifnet *));
+static void epic_ifmedia_status __P((struct ifnet *, struct ifmediareq *));
+
+/* Following functions doesn't call splimp() */
+static void epic_intr_normal __P((void *));
+static __inline void epic_rx_done __P((epic_softc_t *));
+static __inline void epic_tx_done __P((epic_softc_t *));
+static void epic_shutdown __P((int, void *));
+
+static int epic_init_rings __P((epic_softc_t *));
+static void epic_free_rings __P((epic_softc_t *));
+static void epic_stop_activity __P((epic_softc_t *));
+static void epic_start_activity __P((epic_softc_t *));
+static void epic_set_rx_mode __P((epic_softc_t *));
+static void epic_set_mc_table __P((epic_softc_t *));
+static void epic_set_media_speed __P((epic_softc_t *));
+static void epic_init_phy __P((epic_softc_t *));
+static void epic_dump_state __P((epic_softc_t *));
+static int epic_autoneg __P((epic_softc_t *));
+
+static int epic_read_eeprom __P((epic_softc_t *,u_int16_t));
+static void epic_output_eepromw __P((epic_softc_t *, u_int16_t));
+static u_int16_t epic_input_eepromw __P((epic_softc_t *));
+static u_int8_t epic_eeprom_clock __P((epic_softc_t *,u_int8_t));
+static void epic_write_eepromreg __P((epic_softc_t *,u_int8_t));
+static u_int8_t epic_read_eepromreg __P((epic_softc_t *));
+
+static u_int16_t epic_read_phy_register __P((epic_softc_t *, u_int16_t));
+static void epic_write_phy_register __P((epic_softc_t *, u_int16_t, u_int16_t));
diff --git a/sys/pci/tek390.c b/sys/pci/tek390.c
new file mode 100644
index 0000000000000..9be42e23bba14
--- /dev/null
+++ b/sys/pci/tek390.c
@@ -0,0 +1,1709 @@
+/***********************************************************************
+ * FILE NAME : TEK390.C *
+ * BY : C.L. Huang (ching@tekram.com.tw) *
+ * Description: Device Driver for Tekram DC-390(T) PCI SCSI *
+ * Bus Master Host Adapter *
+ * (C)Copyright 1995-1996 Tekram Technology Co., Ltd. *
+ ***********************************************************************/
+/***********************************************************************
+ * HISTORY: *
+ * *
+ * REV# DATE NAME DESCRIPTION *
+ * 1.00 07/02/96 CLH First release for RELEASE-2.1.0 *
+ * 1.01 08/20/96 CLH Update for RELEASE-2.1.5 *
+ * *
+ ***********************************************************************/
+
+/**************************************************************************
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ **************************************************************************/
+
+/**************************************************************************/
+/* Imported into FreeBSD source repository, and updated to compile under */
+/* FreeBSD-3.0-DEVELOPMENT, by Stefan Esser <se@FreeBSD.Org>, 1996-12-17 */
+/**************************************************************************/
+
+/* #define REL_2_1_0 */
+#define REL_2_1_5
+
+#define DC390_DEBUG
+
+#include <sys/param.h>
+
+/* XXX this doesn't actually compile unless KERNEL is defined. */
+#ifdef KERNEL
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/kernel.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#endif /* KERNEL */
+
+#include <pci/pcivar.h>
+#include <pci/pcireg.h>
+
+#include <scsi/scsiconf.h>
+
+#include <machine/clock.h>
+
+#include <pci/tek390.h>
+
+#define INT32 int32
+#define U_INT32 u_int32
+
+
+#define OutB(val, port) outb(port, val)
+#define OutW(val, port) outw(port, val)
+#define OutL(val, port) outl(port, val)
+
+#define PCI_DEVICE_ID_AMD53C974 0x20201022ul
+#define PCI_BASE_ADDR0 0x10
+
+
+#ifdef REL_2_1_0
+static int DC390_Interrupt (PACB pACB);
+#endif
+#ifdef REL_2_1_5
+static void DC390_Interrupt (PACB pACB);
+#endif
+static USHORT DC390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void DC390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void DC390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+
+static void SetXferRate( PACB pACB, PDCB pDCB );
+static void DC390_Disconnect( PACB pACB );
+static void DC390_Reselect( PACB pACB );
+static void SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void DoingSRB_Done( PACB pACB );
+static void DC390_ScsiRstDetect( PACB pACB );
+static void DC390_ResetSCSIBus( PACB pACB );
+static void RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void EnableMsgOut2( PACB pACB, PSRB pSRB );
+static void EnableMsgOut( PACB pACB, PSRB pSRB );
+static void DC390_InvalidCmd( PACB pACB );
+
+/*
+ * XXX No timeouts are scheduled in this driver as the timeout handler
+ * doesn't do anything yet!!!
+ */
+static void DC390_reset (PACB pACB);
+static PUCHAR phystovirt( PSRB pSRB, ULONG xferCnt );
+
+static void DC390_initDCB( PACB pACB, PDCB pDCB, PSCSICMD cmd );
+static void DC390_initSRB( PSRB psrb );
+static void DC390_linkSRB( PACB pACB );
+static void DC390_initACB( PACB pACB, ULONG io_port, UCHAR Irq,
+ USHORT index );
+static int DC390_initAdapter( PACB pACB, ULONG io_port, UCHAR Irq,
+ USHORT index, pcici_t config_id );
+void DC390_EnableCfg( USHORT mechnum, UCHAR regval );
+void DC390_DisableCfg( USHORT mechnum );
+UCHAR DC390_inByte( USHORT mechnum, UCHAR regval );
+USHORT DC390_inWord( USHORT mechnum, UCHAR regval );
+ULONG DC390_inDword(USHORT mechnum, UCHAR regval );
+void DC390_OutB(USHORT mechnum, UCHAR regval, UCHAR bval );
+static void DC390_EnDisableCE( UCHAR mode, USHORT mechnum, PUCHAR regval );
+static void DC390_EEpromOutDI( USHORT mechnum, PUCHAR regval, USHORT Carry );
+static UCHAR DC390_EEpromInDO( USHORT mechnum );
+static USHORT EEpromGetData1( USHORT mechnum );
+static void DC390_Prepare( USHORT mechnum, PUCHAR regval, UCHAR EEpromCmd );
+static void DC390_ReadEEprom( USHORT mechnum, USHORT index );
+static USHORT DC390_DefaultEEprom( USHORT mechnum, USHORT index );
+static USHORT DC390_CheckEEpromCheckSum( USHORT MechNum, USHORT index );
+static USHORT DC390_ToMech( USHORT Mechnum, pcici_t config_id );
+
+
+#ifdef KERNEL
+
+static char* trmamd_probe( pcici_t tag, pcidi_t type);
+static void trmamd_attach( pcici_t tag, int unit);
+
+#ifdef REL_2_1_0
+static int32 trmamd_scsi_cmd( struct scsi_xfer *sx);
+#endif
+
+#ifdef REL_2_1_5
+static int32_t trmamd_scsi_cmd( struct scsi_xfer *sx);
+#endif
+
+static void trmamd_min_phys( struct buf *pbuf);
+
+#ifdef REL_2_1_0
+static u_int32 trmamd_info( int unit );
+#endif
+
+#endif /* KERNEL */
+
+
+static u_long trmamd_count;
+
+static struct pci_device trmamd_device = {
+ "amd",
+ trmamd_probe,
+ trmamd_attach,
+ &trmamd_count,
+ NULL
+};
+
+DATA_SET (pcidevice_set, trmamd_device);
+
+
+
+static struct scsi_adapter trmamd_switch =
+{
+ trmamd_scsi_cmd,
+ trmamd_min_phys,
+ 0,
+ 0,
+#ifdef REL_2_1_0
+ trmamd_info,
+#endif
+#ifdef REL_2_1_5
+ 0,
+#endif
+ "amd",
+};
+
+static struct scsi_device trmamd_dev =
+{
+ NULL, /* Use default error handler */
+ NULL, /* have a queue, served by this */
+ NULL, /* have no async handler */
+ NULL, /* Use default 'done' routine */
+ "amd",
+};
+
+
+static PACB pACB0[MAX_ADAPTER_NUM]={0};
+static PACB pACB_start= NULL;
+static PACB pACB_current = NULL;
+static PDCB pPrevDCB = NULL;
+static USHORT adapterCnt = 0;
+static USHORT CurrSyncOffset = 0;
+static UCHAR CurrentID, CurrentLUN;
+
+static PVOID DC390_phase0[]={
+ DC390_DataOut_0,
+ DC390_DataIn_0,
+ DC390_Command_0,
+ DC390_Status_0,
+ DC390_Nop_0,
+ DC390_Nop_0,
+ DC390_MsgOut_0,
+ DC390_MsgIn_0,
+ DC390_Nop_1
+ };
+
+static PVOID DC390_phase1[]={
+ DC390_DataOutPhase,
+ DC390_DataInPhase,
+ DC390_CommandPhase,
+ DC390_StatusPhase,
+ DC390_Nop_0,
+ DC390_Nop_0,
+ DC390_MsgOutPhase,
+ DC390_MsgInPhase,
+ DC390_Nop_1,
+ };
+
+static UCHAR eepromBuf[MAX_ADAPTER_NUM][128];
+
+
+static UCHAR clock_period1[] = {4, 5, 6, 7 ,8, 10, 13, 20};
+
+static UCHAR baddevname1[2][28] ={
+ "SEAGATE ST3390N ??? 9546",
+ "HP C3323-300 4269"};
+
+#define BADDEVCNT 2
+
+
+/***********************************************************************
+ *
+ *
+ *
+ **********************************************************************/
+static PSRB
+GetSRB( PACB pACB )
+{
+ int flags;
+ PSRB pSRB;
+
+ flags = splbio();
+
+ pSRB = pACB->pFreeSRB;
+ if( pSRB )
+ {
+ pACB->pFreeSRB = pSRB->pNextSRB;
+ pSRB->pNextSRB = NULL;
+ }
+ splx(flags);
+ return( pSRB );
+}
+
+
+static void
+RewaitSRB0( PDCB pDCB, PSRB pSRB )
+{
+ PSRB psrb1;
+ int flags;
+
+ flags = splbio();
+
+ if( (psrb1 = pDCB->pWaitingSRB) )
+ {
+ pSRB->pNextSRB = psrb1;
+ pDCB->pWaitingSRB = pSRB;
+ }
+ else
+ {
+ pSRB->pNextSRB = NULL;
+ pDCB->pWaitingSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ }
+ splx(flags);
+}
+
+
+static void
+RewaitSRB( PDCB pDCB, PSRB pSRB )
+{
+ PSRB psrb1;
+ int flags;
+ UCHAR bval;
+
+ flags = splbio();
+
+ pDCB->GoingSRBCnt--;
+ psrb1 = pDCB->pGoingSRB;
+ if( pSRB == psrb1 )
+ {
+ pDCB->pGoingSRB = psrb1->pNextSRB;
+ }
+ else
+ {
+ while( pSRB != psrb1->pNextSRB )
+ psrb1 = psrb1->pNextSRB;
+ psrb1->pNextSRB = pSRB->pNextSRB;
+ if( pSRB == pDCB->pGoingLast )
+ pDCB->pGoingLast = psrb1;
+ }
+ if( (psrb1 = pDCB->pWaitingSRB) )
+ {
+ pSRB->pNextSRB = psrb1;
+ pDCB->pWaitingSRB = pSRB;
+ }
+ else
+ {
+ pSRB->pNextSRB = NULL;
+ pDCB->pWaitingSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ }
+
+ bval = pSRB->TagNumber;
+ pDCB->TagMask &= (~(1 << bval)); /* Free TAG number */
+ splx(flags);
+}
+
+
+static void
+DoWaitingSRB( PACB pACB )
+{
+ int flags;
+ PDCB ptr, ptr1;
+ PSRB pSRB;
+
+ flags = splbio();
+
+ if( !(pACB->pActiveDCB) && !(pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV) ) )
+ {
+ ptr = pACB->pDCBRunRobin;
+ if( !ptr )
+ {
+ ptr = pACB->pLinkDCB;
+ pACB->pDCBRunRobin = ptr;
+ }
+ ptr1 = ptr;
+ for( ;ptr1; )
+ {
+ pACB->pDCBRunRobin = ptr1->pNextDCB;
+ if( !( ptr1->MaxCommand > ptr1->GoingSRBCnt ) ||
+ !( pSRB = ptr1->pWaitingSRB ) )
+ {
+ if(pACB->pDCBRunRobin == ptr)
+ break;
+ ptr1 = ptr1->pNextDCB;
+ }
+ else
+ {
+ if( !DC390_StartSCSI(pACB, ptr1, pSRB) )
+ {
+ ptr1->GoingSRBCnt++;
+ if( ptr1->pWaitLast == pSRB )
+ {
+ ptr1->pWaitingSRB = NULL;
+ ptr1->pWaitLast = NULL;
+ }
+ else
+ {
+ ptr1->pWaitingSRB = pSRB->pNextSRB;
+ }
+ pSRB->pNextSRB = NULL;
+
+ if( ptr1->pGoingSRB )
+ ptr1->pGoingLast->pNextSRB = pSRB;
+ else
+ ptr1->pGoingSRB = pSRB;
+ ptr1->pGoingLast = pSRB;
+ }
+ break;
+ }
+ }
+ }
+ splx(flags);
+ return;
+}
+
+
+static void
+SRBwaiting( PDCB pDCB, PSRB pSRB)
+{
+ if( pDCB->pWaitingSRB )
+ {
+ pDCB->pWaitLast->pNextSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ pSRB->pNextSRB = NULL;
+ }
+ else
+ {
+ pDCB->pWaitingSRB = pSRB;
+ pDCB->pWaitLast = pSRB;
+ }
+}
+
+
+static void
+SendSRB( PSCSICMD pcmd, PACB pACB, PSRB pSRB )
+{
+ int flags;
+ PDCB pDCB;
+
+ flags = splbio();
+
+ pDCB = pSRB->pSRBDCB;
+ if( !(pDCB->MaxCommand > pDCB->GoingSRBCnt) || (pACB->pActiveDCB) ||
+ (pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV)) )
+ {
+ SRBwaiting(pDCB, pSRB);
+ goto SND_EXIT;
+ }
+
+ if( pDCB->pWaitingSRB )
+ {
+ SRBwaiting(pDCB, pSRB);
+/* pSRB = GetWaitingSRB(pDCB); */
+ pSRB = pDCB->pWaitingSRB;
+ pDCB->pWaitingSRB = pSRB->pNextSRB;
+ pSRB->pNextSRB = NULL;
+ }
+
+ if( !DC390_StartSCSI(pACB, pDCB, pSRB) )
+ {
+ pDCB->GoingSRBCnt++;
+ if( pDCB->pGoingSRB )
+ {
+ pDCB->pGoingLast->pNextSRB = pSRB;
+ pDCB->pGoingLast = pSRB;
+ }
+ else
+ {
+ pDCB->pGoingSRB = pSRB;
+ pDCB->pGoingLast = pSRB;
+ }
+ }
+ else
+ RewaitSRB0( pDCB, pSRB );
+
+SND_EXIT:
+ splx(flags);
+ return;
+}
+
+
+/***********************************************************************
+ * Function : static int32 dc390_scsi_cmd (struct scsi_xfer *cmd)
+ * Purpose : enqueues a SCSI command
+ ***********************************************************************/
+
+#ifdef REL_2_1_0
+int32
+#endif
+#ifdef REL_2_1_5
+int32_t
+#endif
+trmamd_scsi_cmd ( PSCSICMD cmd )
+{
+ USHORT ioport, i;
+ PSCSICMD pcmd;
+ PSCLINK plink;
+ PACB pACB;
+ PDCB pDCB;
+ PSRB pSRB;
+ int flags, cflags, unit, CurrPgVaddr;
+ ULONG sglen, pglen, datalen, CurrPgPaddr, NextPgPaddr;
+ PUCHAR ptr,ptr1;
+ PSEG psg;
+ UCHAR sgc, sstatus;
+
+ plink = cmd->sc_link;
+ unit = plink->adapter_unit;
+ pACB = pACB0[unit];
+ ioport = pACB->IOPortBase;
+
+#ifdef DC390_DEBUG0
+ printf("Cmd=%2x,ID=%d,LUN=%d,",cmd->cmd->opcode,
+ plink->target, plink->lun);
+#endif
+
+ if( pACB->scan_devices )
+ {
+ if( (plink->target > CurrentID) ||
+ (plink->target == CurrentID) && (plink->lun >= CurrentLUN) )
+ {
+ CurrentID = plink->target;
+ CurrentLUN = plink->lun;
+ }
+ else
+ {
+ pACB->scan_devices = 0;
+ pPrevDCB->pNextDCB = pACB->pLinkDCB;
+ }
+ }
+
+ if ( ( plink->target > pACB->max_id ) || ( plink->lun > pACB->max_lun ) )
+ {
+#ifdef DC390_DEBUG0
+ printf("DC390: Ignore target %d lun %d\n",
+ plink->target, plink->lun);
+#endif
+ cmd->error = XS_DRIVER_STUFFUP;
+ return( COMPLETE );
+ }
+
+ if( (pACB->scan_devices) && !(pACB->DCBmap[plink->target] & (1 << plink->lun)) )
+ {
+ if( pACB->DeviceCnt < MAX_DEVICES )
+ {
+ pACB->DCBmap[plink->target] |= (1 << plink->lun);
+ pDCB = pACB->pDCB_free;
+#ifdef DC390_DEBUG0
+ printf("pDCB=%8x,ID=%2x,", (UINT) pDCB, plink->target);
+#endif
+ DC390_initDCB( pACB, pDCB, cmd );
+ }
+ else /* ???? */
+ {
+#ifdef DC390_DEBUG0
+ printf("DC390: Ignore target %d lun %d\n",
+ plink->target, plink->lun);
+#endif
+ cmd->error = XS_DRIVER_STUFFUP;
+ return( COMPLETE );
+ }
+ }
+ else if( !(pACB->scan_devices) && !(pACB->DCBmap[plink->target] & (1 << plink->lun)) )
+ {
+#ifdef DC390_DEBUG0
+ printf("DC390: Ignore target %d lun %d\n",
+ plink->target, plink->lun);
+#endif
+ cmd->error = XS_DRIVER_STUFFUP;
+ return( COMPLETE );
+ }
+ else
+ {
+ pDCB = pACB->pLinkDCB;
+ while( (pDCB->UnitSCSIID != plink->target) ||
+ (pDCB->UnitSCSILUN != plink->lun) )
+ {
+ pDCB = pDCB->pNextDCB;
+ }
+#ifdef DC390_DEBUG0
+ printf("pDCB=%8x,ID=%2x,", (UINT) pDCB, plink->target);
+#endif
+ }
+
+ cflags = cmd->flags;
+ if(cflags & SCSI_RESET)
+ {
+ DC390_reset (pACB);
+ cmd->error = XS_NOERROR;
+ return(COMPLETE);
+ }
+
+ if( cflags & ITSDONE )
+ {
+ printf("DC390: Is it done?\n");
+ cmd->flags &= ~ITSDONE;
+ }
+ if( !(cflags & INUSE) )
+ {
+ printf("DC390: In Use?\n");
+ cmd->flags |= INUSE;
+ }
+
+ cmd->error = 0;
+ cmd->resid = 0;
+
+ flags = splbio();
+
+ pcmd = cmd;
+
+ pSRB = GetSRB( pACB );
+
+ if( !pSRB )
+ {
+ pcmd->error = XS_DRIVER_STUFFUP;
+ splx(flags);
+ return( TRY_AGAIN_LATER);
+ }
+
+/* BuildSRB(pSRB); */
+
+ pSRB->pSRBDCB = pDCB;
+ pSRB->pcmd = pcmd;
+ ptr = (PUCHAR) pSRB->CmdBlock;
+ ptr1 = (PUCHAR) pcmd->cmd;
+ pSRB->ScsiCmdLen = pcmd->cmdlen;
+ for(i=0; i< pcmd->cmdlen; i++)
+ {
+ *ptr = *ptr1;
+ ptr++;
+ ptr1++;
+ }
+ if( pcmd->datalen )
+ {
+ psg = (PSEG) &pSRB->SGsegment[0];
+ pSRB->pSegmentList = psg;
+ sgc = 0;
+
+ /* Set up the scatter gather list */
+ datalen = pcmd->datalen;
+ CurrPgVaddr = (int) pcmd->data;
+ CurrPgPaddr = vtophys(CurrPgVaddr);
+
+ while ((datalen) && (sgc < MAX_SG_ENTRY))
+ {
+ sglen = 0;
+ psg->SGXPtr = CurrPgPaddr;
+ NextPgPaddr = CurrPgPaddr;
+ while ((datalen) && (CurrPgPaddr == NextPgPaddr))
+ {
+ /*
+ * This page is contiguous (physically) with the the last,
+ * just extend the length
+ */
+
+ NextPgPaddr = (CurrPgPaddr & (~(PAGELEN - 1))) + PAGELEN;
+ pglen = NextPgPaddr - CurrPgPaddr;
+
+ if( datalen < pglen )
+ pglen = datalen;
+ sglen += pglen;
+ datalen -= pglen;
+ CurrPgVaddr = (CurrPgVaddr & (~(PAGELEN - 1))) + PAGELEN;
+ if( datalen )
+ CurrPgPaddr = vtophys(CurrPgVaddr);
+ }
+ /*
+ next page isn't contiguous, finish this segment
+ */
+ psg->SGXLen = sglen;
+ psg++;
+ sgc++;
+ }
+ pSRB->SGcount = sgc;
+
+ if (datalen)
+ {
+ printf("DC390: Out Of Segment Buffer!\n");
+ pSRB->pNextSRB = pACB->pFreeSRB;
+ pACB->pFreeSRB = pSRB;
+ pcmd->error = XS_DRIVER_STUFFUP;
+ splx(flags);
+ return (HAD_ERROR);
+ }
+ }
+ else
+ pSRB->SGcount = 0;
+
+ pSRB->SGIndex = 0;
+ pSRB->AdaptStatus = 0;
+ pSRB->TargetStatus = 0;
+ pSRB->MsgCnt = 0;
+ if( pDCB->DevType != SCSI_SEQACESS )
+ pSRB->RetryCnt = 1;
+ else
+ pSRB->RetryCnt = 0;
+ pSRB->SRBStatus = 0;
+ pSRB->SRBFlag = 0;
+ pSRB->SRBState = 0;
+ pSRB->TotalXferredLen = 0;
+ pSRB->SGPhysAddr = 0;
+ pSRB->SGToBeXferLen = 0;
+ pSRB->ScsiPhase = 0;
+ pSRB->EndMessage = 0;
+ splx(flags);
+
+ if( !(cflags & SCSI_NOMASK) )
+ {
+ flags = splbio();
+ SendSRB( pcmd, pACB, pSRB );
+ splx(flags);
+ return( SUCCESSFULLY_QUEUED);
+ }
+ else
+ {
+ SendSRB( pcmd, pACB, pSRB );
+ do
+ {
+ while(--pcmd->timeout)
+ {
+ DELAY(1000);
+ sstatus = inb( ioport+Scsi_Status );
+ if( sstatus & INTERRUPT )
+ break;
+ }
+ if( pcmd->timeout == 0 )
+ {
+ return(HAD_ERROR);
+ }
+ else
+ {
+ DC390_Interrupt( pACB );
+ }
+ }
+ while( !(pcmd->flags & ITSDONE) );
+ if( pcmd->error == XS_TIMEOUT)
+ return(HAD_ERROR);
+ else
+ return(COMPLETE);
+ }
+}
+
+
+void
+trmamd_min_phys( struct buf *bp )
+{
+ if (bp->b_bcount > ((MAX_SG_ENTRY - 1) * PAGELEN))
+ bp->b_bcount = ((MAX_SG_ENTRY - 1) * PAGELEN);
+}
+
+
+#ifdef REL_2_1_0
+u_int32
+trmamd_info( int unit )
+{
+ return (MAX_CMD_PER_LUN); /* outstanding requests at a time per device */
+}
+#endif
+
+
+static PUCHAR phystovirt( PSRB pSRB, ULONG xferCnt )
+{
+ int dataPtr;
+ PSCSICMD pcmd;
+ UCHAR i;
+ PSEG pseg;
+
+ pcmd = pSRB->pcmd;
+ dataPtr = (int) pcmd->data;
+ pseg = pSRB->SGsegment;
+ for(i=0; i < pSRB->SGIndex; i++)
+ {
+ dataPtr += (int) pseg->SGXLen;
+ pseg++;
+ }
+ dataPtr += (int) xferCnt;
+ return( (PUCHAR) dataPtr);
+}
+
+
+/***********************************************************************
+ * Function : int DC390_abort (SCSICMD *cmd)
+ *
+ * Purpose : Abort an errant SCSI command
+ *
+ * Inputs : cmd - command to abort
+ *
+ * Returns : 0 on success, -1 on failure.
+ ***********************************************************************/
+/*
+int
+DC390_abort (SCSICMD *cmd)
+{
+ int flags;
+ PACB pACB;
+ PDCB pDCB, pdcb;
+ PSRB pSRB, psrb;
+ USHORT count, i;
+ PSCSICMD pcmd, pcmd1;
+ int status;
+
+
+#ifdef DC390_DEBUG0
+ printf("DC390 : Abort Cmd.");
+#endif
+
+ flags = splbio();
+
+ pACB = (PACB) cmd->host->hostdata;
+ pDCB = pACB->pLinkDCB;
+ pdcb = pDCB;
+ while( (pDCB->UnitSCSIID != cmd->sc_link->target) ||
+ (pDCB->UnitSCSILUN != cmd->sc_link->lun) )
+ {
+ pDCB = pDCB->pNextDCB;
+ if( pDCB == pdcb )
+ goto NOT_RUN;
+ }
+
+
+ pSRB = pDCB->pWaitingSRB;
+ if( !pSRB )
+ goto ON_GOING;
+ if( pSRB->pcmd == cmd )
+ {
+ pDCB->pWaitingSRB = pSRB->pNextSRB;
+ goto IN_WAIT;
+ }
+ else
+ {
+ psrb = pSRB;
+ while( psrb->pNextSRB->pcmd != cmd )
+ {
+ psrb = psrb->pNextSRB;
+ if( !psrb )
+ goto ON_GOING;
+ }
+ pSRB = psrb->pNextSRB;
+ psrb->pNextSRB = pSRB->pNextSRB;
+ if( pSRB == pDCB->pWaitLast )
+ pDCB->pWaitLast = psrb;
+IN_WAIT:
+ pSRB->pNextSRB = pACB->pFreeSRB;
+ pACB->pFreeSRB = pSRB;
+ cmd->next = NULL;
+ status = SCSI_ABORT_SUCCESS;
+ goto ABO_X;
+ }
+
+ON_GOING:
+ pSRB = pDCB->pGoingSRB;
+ for( count = pDCB->GoingSRBCnt, i=0; i<count; i++)
+ {
+ if( pSRB->pcmd != cmd )
+ pSRB = pSRB->pNextSRB;
+ else
+ {
+ if( (pACB->pActiveDCB == pDCB) && (pDCB->pActiveSRB == pSRB) )
+ {
+ status = SCSI_ABORT_BUSY;
+ goto ABO_X;
+ }
+ else
+ {
+ status = SCSI_ABORT_SNOOZE;
+ goto ABO_X;
+ }
+ }
+ }
+
+NOT_RUN:
+ status = SCSI_ABORT_NOT_RUNNING;
+
+ABO_X:
+ cmd->error = XS_NOERROR;
+ scsi_done(cmd);
+ splx(flags);
+ return( status );
+}
+*/
+
+static void
+ResetDevParam( PACB pACB )
+{
+ PDCB pDCB, pdcb;
+
+ pDCB = pACB->pLinkDCB;
+ if( pDCB == NULL )
+ return;
+ pdcb = pDCB;
+ do
+ {
+ pDCB->SyncMode &= ~SYNC_NEGO_DONE;
+ pDCB->SyncPeriod = 0;
+ pDCB->SyncOffset = 0;
+ pDCB->CtrlR3 = FAST_CLK;
+ pDCB->CtrlR4 &= NEGATE_REQACKDATA;
+ pDCB->CtrlR4 |= EATER_25NS;
+ pDCB = pDCB->pNextDCB;
+ }
+ while( pdcb != pDCB );
+}
+
+
+static void
+RecoverSRB( PACB pACB )
+{
+ PDCB pDCB, pdcb;
+ PSRB psrb, psrb2;
+ USHORT cnt, i;
+
+ pDCB = pACB->pLinkDCB;
+ if( pDCB == NULL )
+ return;
+ pdcb = pDCB;
+ do
+ {
+ cnt = pdcb->GoingSRBCnt;
+ psrb = pdcb->pGoingSRB;
+ for (i=0; i<cnt; i++)
+ {
+ psrb2 = psrb;
+ psrb = psrb->pNextSRB;
+/* RewaitSRB( pDCB, psrb ); */
+ if( pdcb->pWaitingSRB )
+ {
+ psrb2->pNextSRB = pdcb->pWaitingSRB;
+ pdcb->pWaitingSRB = psrb2;
+ }
+ else
+ {
+ pdcb->pWaitingSRB = psrb2;
+ pdcb->pWaitLast = psrb2;
+ psrb2->pNextSRB = NULL;
+ }
+ }
+ pdcb->GoingSRBCnt = 0;
+ pdcb->pGoingSRB = NULL;
+ pdcb->TagMask = 0;
+ pdcb = pdcb->pNextDCB;
+ }
+ while( pdcb != pDCB );
+}
+
+
+/***********************************************************************
+ * Function : DC390_reset (PACB pACB)
+ *
+ * Purpose : perform a hard reset on the SCSI bus( and AMD chip).
+ *
+ * Inputs : cmd - command which caused the SCSI RESET
+ *
+ ***********************************************************************/
+
+static void
+DC390_reset (PACB pACB)
+{
+ USHORT ioport;
+ int flags;
+ UCHAR bval;
+ USHORT i;
+
+
+#ifdef DC390_DEBUG0
+ printf("DC390: RESET,");
+#endif
+
+ flags = splbio();
+
+ ioport = pACB->IOPortBase;
+ bval = inb(ioport+CtrlReg1);
+ bval |= DIS_INT_ON_SCSI_RST;
+ OutB(bval,ioport+CtrlReg1); /* disable interrupt */
+ DC390_ResetSCSIBus( pACB );
+ for( i=0; i<500; i++ )
+ DELAY(1000);
+ bval = inb(ioport+CtrlReg1);
+ bval &= ~DIS_INT_ON_SCSI_RST;
+ OutB(bval,ioport+CtrlReg1); /* re-enable interrupt */
+
+ bval = DMA_IDLE_CMD;
+ OutB(bval,ioport+DMA_Cmd);
+ bval = CLEAR_FIFO_CMD;
+ OutB(bval,ioport+ScsiCmd);
+
+ ResetDevParam( pACB );
+ DoingSRB_Done( pACB );
+ pACB->pActiveDCB = NULL;
+
+ pACB->ACBFlag = 0;
+ DoWaitingSRB( pACB );
+ splx(flags);
+ return;
+}
+
+
+#include <pci/scsiiom.c>
+
+
+/***********************************************************************
+ * Function : static void DC390_initDCB
+ *
+ * Purpose : initialize the internal structures for a given DCB
+ *
+ * Inputs : cmd - pointer to this scsi cmd request block structure
+ *
+ ***********************************************************************/
+static void
+DC390_initDCB( PACB pACB, PDCB pDCB, PSCSICMD cmd )
+{
+ PEEprom prom;
+ UCHAR bval;
+ USHORT index;
+ PSCLINK plink;
+
+ if( pACB->DeviceCnt == 0 )
+ {
+ pACB->pLinkDCB = pDCB;
+ pACB->pDCBRunRobin = pDCB;
+ pDCB->pNextDCB = pDCB;
+ pPrevDCB = pDCB;
+ }
+ else
+ pPrevDCB->pNextDCB = pDCB;
+
+ plink = cmd->sc_link;
+ pDCB->pDCBACB = pACB;
+ pDCB->UnitSCSIID = plink->target;
+ pDCB->UnitSCSILUN = plink->lun;
+ pDCB->pWaitingSRB = NULL;
+ pDCB->pGoingSRB = NULL;
+ pDCB->GoingSRBCnt = 0;
+ pDCB->pActiveSRB = NULL;
+ pDCB->TagMask = 0;
+ pDCB->MaxCommand = 1;
+ pDCB->AdaptIndex = pACB->AdapterIndex;
+ index = pACB->AdapterIndex;
+ pDCB->DCBFlag = 0;
+
+ prom = (PEEprom) &eepromBuf[index][plink->target << 2];
+ pDCB->DevMode = prom->EE_MODE1;
+ pDCB->AdpMode = eepromBuf[index][EE_MODE2];
+
+ if( pDCB->DevMode & EN_DISCONNECT_ )
+ bval = 0xC0;
+ else
+ bval = 0x80;
+ bval |= plink->lun;
+ pDCB->IdentifyMsg = bval;
+
+ pDCB->SyncMode = 0;
+ if( pDCB->DevMode & SYNC_NEGO_ )
+ {
+ if( !(plink->lun) || CurrSyncOffset )
+ pDCB->SyncMode = SYNC_ENABLE;
+ }
+
+ pDCB->SyncPeriod = 0;
+ pDCB->SyncOffset = 0;
+ pDCB->NegoPeriod = (clock_period1[prom->EE_SPEED] * 25) >> 2;
+
+ pDCB->CtrlR1 = pACB->AdaptSCSIID;
+ if( pDCB->DevMode & PARITY_CHK_ )
+ pDCB->CtrlR1 |= PARITY_ERR_REPO;
+
+ pDCB->CtrlR3 = FAST_CLK;
+
+ pDCB->CtrlR4 = EATER_25NS;
+ if( pDCB->AdpMode & ACTIVE_NEGATION)
+ pDCB->CtrlR4 |= NEGATE_REQACKDATA;
+}
+
+
+/***********************************************************************
+ * Function : static void DC390_initSRB
+ *
+ * Purpose : initialize the internal structures for a given SRB
+ *
+ * Inputs : psrb - pointer to this scsi request block structure
+ *
+ ***********************************************************************/
+static void
+DC390_initSRB( PSRB psrb )
+{
+ psrb->PhysSRB = vtophys( psrb );
+}
+
+
+static void
+DC390_linkSRB( PACB pACB )
+{
+ USHORT count, i;
+ PSRB psrb;
+
+ count = pACB->SRBCount;
+
+ for( i=0; i< count; i++)
+ {
+ if( i != count - 1)
+ pACB->SRB_array[i].pNextSRB = &pACB->SRB_array[i+1];
+ else
+ pACB->SRB_array[i].pNextSRB = NULL;
+ psrb = (PSRB) &pACB->SRB_array[i];
+ DC390_initSRB( psrb );
+ }
+}
+
+
+/***********************************************************************
+ * Function : static void DC390_initACB
+ *
+ * Purpose : initialize the internal structures for a given SCSI host
+ *
+ * Inputs : psh - pointer to this host adapter's structure
+ *
+ ***********************************************************************/
+static void
+DC390_initACB( PACB pACB, ULONG io_port, UCHAR Irq, USHORT index )
+{
+ USHORT i;
+
+
+ pACB->max_id = 7;
+ if( pACB->max_id == eepromBuf[index][EE_ADAPT_SCSI_ID] )
+ pACB->max_id--;
+ if( eepromBuf[index][EE_MODE2] & LUN_CHECK )
+ pACB->max_lun = 7;
+ else
+ pACB->max_lun = 0;
+
+ pACB->IOPortBase = (USHORT) io_port;
+ pACB->pLinkDCB = NULL;
+ pACB->pDCBRunRobin = NULL;
+ pACB->pActiveDCB = NULL;
+ pACB->pFreeSRB = pACB->SRB_array;
+ pACB->SRBCount = MAX_SRB_CNT;
+ pACB->AdapterIndex = index;
+ pACB->status = 0;
+ pACB->AdaptSCSIID = eepromBuf[index][EE_ADAPT_SCSI_ID];
+ pACB->HostID_Bit = (1 << pACB->AdaptSCSIID);
+ pACB->AdaptSCSILUN = 0;
+ pACB->DeviceCnt = 0;
+ pACB->IRQLevel = Irq;
+ pACB->TagMaxNum = (eepromBuf[index][EE_TAG_CMD_NUM]) << 2;
+ pACB->ACBFlag = 0;
+ pACB->scan_devices = 1;
+ pACB->Gmode2 = eepromBuf[index][EE_MODE2];
+ if( eepromBuf[index][EE_MODE2] & LUN_CHECK )
+ pACB->LUNchk = 1;
+ pACB->pDCB_free = &pACB->DCB_array[0];
+ DC390_linkSRB( pACB );
+ pACB->pTmpSRB = &pACB->TmpSRB;
+ DC390_initSRB( pACB->pTmpSRB );
+ for(i=0; i<MAX_SCSI_ID; i++)
+ pACB->DCBmap[i] = 0;
+
+ pACB->ScsiLink.adapter_unit = index;
+ pACB->ScsiLink.adapter_targ = pACB->AdaptSCSIID;
+ pACB->ScsiLink.fordriver = 0;
+ pACB->ScsiLink.opennings = 2;
+ pACB->ScsiLink.adapter = &trmamd_switch;
+ pACB->ScsiLink.device = &trmamd_dev;
+ pACB->ScsiLink.flags = 0;
+}
+
+
+/***********************************************************************
+ * Function : static int DC390_initAdapter
+ *
+ * Purpose : initialize the SCSI chip ctrl registers
+ *
+ * Inputs : psh - pointer to this host adapter's structure
+ *
+ ***********************************************************************/
+static int DC390_initAdapter( PACB pACB, ULONG io_port, UCHAR Irq,
+ USHORT index,
+ pcici_t config_id )
+{
+ USHORT ioport;
+ UCHAR bval;
+
+#ifdef CHECK_SHARE_INT
+ PACB pacb;
+ USHORT used_irq = 0;
+
+ pacb = pACB_start;
+ if( pacb != NULL )
+ {
+ for ( ; (pacb != (PACB) -1) ; )
+ {
+ if( pacb->IRQLevel == Irq )
+ {
+ used_irq = 1;
+ break;
+ }
+ else
+ pacb = pacb->pNextACB;
+ }
+ }
+
+ if( !used_irq )
+ {
+#endif
+ if( !pci_map_int (config_id, (PVOID)DC390_Interrupt, pACB, &bio_imask) )
+ {
+ if(bootverbose)
+ printf("DC390: register Interrupt handler error!\n");
+ return( -1 );
+ }
+
+#ifdef CHECK_SHARE_INT
+ }
+#endif
+
+ ioport = (USHORT) io_port;
+ bval = 153; /* 250ms selection timeout */
+ OutB(bval,ioport+Scsi_TimeOut);
+
+ bval = CLK_FREQ_40MHZ; /* Conversion factor = 0 , 40MHz clock */
+ OutB(bval,ioport+Clk_Factor);
+
+ bval = NOP_CMD; /* NOP cmd - clear command register */
+ OutB(bval,ioport+ScsiCmd);
+
+ bval = EN_FEATURE+EN_SCSI2_CMD; /* Enable Feature and SCSI-2 */
+ OutB(bval,ioport+CtrlReg2);
+
+ bval = FAST_CLK; /* fast clock */
+ OutB(bval,ioport+CtrlReg3);
+
+ bval = EATER_25NS;
+ if( eepromBuf[index][EE_MODE2] & ACTIVE_NEGATION )
+ bval |= NEGATE_REQACKDATA;
+ OutB(bval,ioport+CtrlReg4);
+
+ bval = DIS_INT_ON_SCSI_RST; /* Disable SCSI bus reset interrupt */
+ OutB(bval,ioport+CtrlReg1);
+
+ return(0);
+}
+
+
+#ifdef PCI_COMPAT
+static pcicfgregs *cfg;
+#define DC390_EnableCfg(a,b)
+#define DC390_DisableCfg(a)
+#define DC390_inByte(a,reg) pci_cfgread(cfg,reg,1)
+#define DC390_inWord(a,reg) pci_cfgread(cfg,reg,2)
+#define DC390_inDword(a,reg) pci_cfgread(cfg,reg,4)
+#define DC390_OutB(a,reg,val) pci_cfgwrite(cfg,reg,val,1)
+#else
+
+void
+DC390_EnableCfg( USHORT mechnum, UCHAR regval )
+{
+ ULONG wlval;
+
+ if(mechnum == 2)
+ {
+ OutB(mech2bus, PCI_CFG2_FORWARD_REG);
+ OutB(mech2CfgSPenR, PCI_CFG2_ENABLE_REG);
+ }
+ else
+ {
+ regval &= 0xFC;
+ wlval = mech1addr;
+ wlval |= (((ULONG)regval) & 0xff);
+ OutL(wlval, PCI_CFG1_ADDRESS_REG);
+ }
+}
+
+
+void
+DC390_DisableCfg( USHORT mechnum )
+{
+
+ if(mechnum == 2)
+ OutB(0, PCI_CFG2_ENABLE_REG);
+ else
+ OutL(0, PCI_CFG1_ADDRESS_REG);
+}
+
+
+UCHAR
+DC390_inByte( USHORT mechnum, UCHAR regval )
+{
+ UCHAR bval;
+ USHORT wval;
+ int flags;
+
+ flags = splbio();
+ DC390_EnableCfg( mechnum, regval );
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= ((USHORT) regval) & 0xff;
+ bval = inb(wval);
+ }
+ else
+ {
+ regval &= 3;
+ bval = inb(PCI_CFG1_DATA_REG | regval);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+ return(bval);
+}
+
+
+USHORT
+DC390_inWord( USHORT mechnum, UCHAR regval )
+{
+ USHORT wval;
+ int flags;
+
+ flags = splbio();
+ DC390_EnableCfg(mechnum,regval);
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= regval;
+ wval = inw(wval);
+ }
+ else
+ {
+ regval &= 3;
+ wval = inw(PCI_CFG1_DATA_REG | regval);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+ return(wval);
+}
+
+
+ULONG
+DC390_inDword(USHORT mechnum, UCHAR regval )
+{
+ ULONG wlval;
+ int flags;
+ USHORT wval;
+
+ flags = splbio();
+ DC390_EnableCfg(mechnum,regval);
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= regval;
+ wlval = inl(wval);
+ }
+ else
+ {
+ wlval = inl(PCI_CFG1_DATA_REG);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+ return(wlval);
+}
+
+
+void
+DC390_OutB(USHORT mechnum, UCHAR regval, UCHAR bval )
+{
+
+ USHORT wval;
+ int flags;
+
+ flags = splbio();
+ DC390_EnableCfg(mechnum,regval);
+ if(mechnum == 2)
+ {
+ wval = mech2Agent;
+ wval <<= 8;
+ wval |= regval;
+ OutB(bval, wval);
+ }
+ else
+ {
+ regval &= 3;
+ OutB(bval, PCI_CFG1_DATA_REG | regval);
+ }
+ DC390_DisableCfg(mechnum);
+ splx(flags);
+}
+
+#endif /PCI_COMPAT */
+
+static void
+DC390_EnDisableCE( UCHAR mode, USHORT mechnum, PUCHAR regval )
+{
+
+ UCHAR bval;
+
+ bval = 0;
+ if(mode == ENABLE_CE)
+ *regval = 0xc0;
+ else
+ *regval = 0x80;
+ DC390_OutB(mechnum,*regval,bval);
+ if(mode == DISABLE_CE)
+ DC390_OutB(mechnum,*regval,bval);
+ DELAY(160);
+}
+
+
+static void
+DC390_EEpromOutDI( USHORT mechnum, PUCHAR regval, USHORT Carry )
+{
+ UCHAR bval;
+
+ bval = 0;
+ if(Carry)
+ {
+ bval = 0x40;
+ *regval = 0x80;
+ DC390_OutB(mechnum,*regval,bval);
+ }
+ DELAY(160);
+ bval |= 0x80;
+ DC390_OutB(mechnum,*regval,bval);
+ DELAY(160);
+ bval = 0;
+ DC390_OutB(mechnum,*regval,bval);
+ DELAY(160);
+}
+
+
+static UCHAR
+DC390_EEpromInDO( USHORT mechnum )
+{
+ UCHAR bval,regval;
+
+ regval = 0x80;
+ bval = 0x80;
+ DC390_OutB(mechnum,regval,bval);
+ DELAY(160);
+ bval = 0x40;
+ DC390_OutB(mechnum,regval,bval);
+ DELAY(160);
+ regval = 0x0;
+ bval = DC390_inByte(mechnum,regval);
+ if(bval == 0x22)
+ return(1);
+ else
+ return(0);
+}
+
+
+static USHORT
+EEpromGetData1( USHORT mechnum )
+{
+ UCHAR i;
+ UCHAR carryFlag;
+ USHORT wval;
+
+ wval = 0;
+ for(i=0; i<16; i++)
+ {
+ wval <<= 1;
+ carryFlag = DC390_EEpromInDO(mechnum);
+ wval |= carryFlag;
+ }
+ return(wval);
+}
+
+
+static void
+DC390_Prepare( USHORT mechnum, PUCHAR regval, UCHAR EEpromCmd )
+{
+ UCHAR i,j;
+ USHORT carryFlag;
+
+ carryFlag = 1;
+ j = 0x80;
+ for(i=0; i<9; i++)
+ {
+ DC390_EEpromOutDI(mechnum,regval,carryFlag);
+ carryFlag = (EEpromCmd & j) ? 1 : 0;
+ j >>= 1;
+ }
+}
+
+
+static void
+DC390_ReadEEprom( USHORT mechnum, USHORT index )
+{
+ UCHAR regval,cmd;
+ PUSHORT ptr;
+ USHORT i;
+
+ ptr = (PUSHORT) &eepromBuf[index][0];
+ cmd = EEPROM_READ;
+ for(i=0; i<0x40; i++)
+ {
+ DC390_EnDisableCE(ENABLE_CE, mechnum, &regval);
+ DC390_Prepare(mechnum, &regval, cmd);
+ *ptr = EEpromGetData1(mechnum);
+ ptr++;
+ cmd++;
+ DC390_EnDisableCE(DISABLE_CE,mechnum,&regval);
+ }
+}
+
+
+static USHORT
+DC390_DefaultEEprom( USHORT mechnum, USHORT index )
+{
+ PUCHAR ptr;
+ USHORT i;
+
+ ptr = (PUCHAR) &eepromBuf[index][0];
+ bzero (ptr, sizeof eepromBuf[index]);
+ for(i=0; i<0x40; i++)
+ {
+ *ptr = (TAG_QUEUING_|EN_DISCONNECT_|SYNC_NEGO_|PARITY_CHK_);
+ ptr += 4;
+ }
+ eepromBuf[index][EE_ADAPT_SCSI_ID] = 7;
+ eepromBuf[index][EE_MODE2] = (LUN_CHECK|ACTIVE_NEGATION);
+ eepromBuf[index][EE_TAG_CMD_NUM] = 4;
+ return 0;
+}
+
+
+static USHORT
+DC390_CheckEEpromCheckSum( USHORT MechNum, USHORT index )
+{
+ USHORT wval, rc, *ptr;
+ UCHAR i;
+
+ DC390_ReadEEprom( MechNum, index );
+ wval = 0;
+ ptr = (PUSHORT) &eepromBuf[index][0];
+ for(i=0; i<128 ;i+=2, ptr++)
+ wval += *ptr;
+ if( wval == 0x1234 )
+ rc = 0;
+ else
+ rc = DC390_DefaultEEprom( MechNum, index);
+ return( rc );
+}
+
+
+static USHORT
+DC390_ToMech( USHORT Mechnum, pcici_t config_id )
+{
+
+#ifdef PCI_COMPAT
+ cfg = config_id;
+#else
+ if(Mechnum == 2)
+ {
+ mech2bus = config_id.cfg2.forward; /* Bus num */
+ mech2Agent = config_id.cfg2.port >> 8; /* Dev num */
+ mech2CfgSPenR = config_id.cfg2.enable; /* Fun num */
+ }
+ else /* use mech #1 method */
+ {
+ mech1addr = config_id.cfg1;
+ }
+#endif /* PCI_COMPAT */
+ return(0);
+}
+
+/***********************************************************************
+ * Function : static int DC390_init (struct Scsi_Host *host)
+ *
+ * Purpose : initialize the internal structures for a given SCSI host
+ *
+ * Inputs : host - pointer to this host adapter's structure/
+ *
+ * Preconditions : when this function is called, the chip_type
+ * field of the pACB structure MUST have been set.
+ ***********************************************************************/
+
+static int
+DC390_init( ULONG io_port, UCHAR Irq, USHORT index, USHORT MechNum,
+ pcici_t config_id)
+{
+ PACB pACB;
+
+ if( !DC390_CheckEEpromCheckSum( MechNum, index) )
+ {
+ pACB = (PACB) malloc (sizeof (struct _ACB), M_DEVBUF, M_WAITOK);
+ if( !pACB )
+ {
+ printf("DC390%d: cannot allocate ACB !\n", index);
+ return( -1 );
+ }
+ bzero (pACB, sizeof (struct _ACB));
+ DC390_initACB( pACB, io_port, Irq, index );
+ if( !DC390_initAdapter( pACB, io_port, Irq, index, config_id) )
+ {
+ if( !pACB_start )
+ {
+ pACB_start = pACB;
+ pACB_current = pACB;
+ pACB->pNextACB = (PACB) -1;
+ }
+ else
+ {
+ pACB_current->pNextACB = pACB;
+ pACB_current = pACB;
+ pACB->pNextACB = (PACB) -1;
+ }
+ pACB0[index] = pACB;
+
+#ifdef DC390_DEBUG0
+ printf("DC390: pACB = %8x, pDCB_array = %8x, pSRB_array = %8x\n",
+ (UINT) pACB, (UINT) pACB->DCB_array, (UINT) pACB->SRB_array);
+ printf("DC390: ACB size= %4x, DCB size= %4x, SRB size= %4x\n",
+ sizeof(DC390_ACB), sizeof(DC390_DCB), sizeof(DC390_SRB) );
+#endif
+
+ return( 0 );
+ }
+ else
+ {
+ free( pACB, M_DEVBUF);
+ return( -1 );
+ }
+ }
+ else
+ {
+ printf("DC390_init: EEPROM reading error!\n");
+ return( -1 );
+ }
+}
+
+
+
+void
+trmamd_attach (pcici_t config_id, int unit)
+{
+ struct scsibus_data *scbus;
+ UCHAR irq;
+ USHORT MechNum;
+ ULONG io_port, wlval;
+ PACB pACB = 0;
+ int flags;
+
+ if( unit >= MAX_ADAPTER_NUM )
+ return;
+
+ if( pACB0[unit] )
+ return;
+
+ CurrentID = 0;
+ CurrentLUN = 0;
+ MechNum = pci_mechanism;
+
+#ifdef DC390_DEBUG0
+ if(bootverbose)
+ printf("DC390: Mech=%2x,\n",(UCHAR) MechNum);
+#endif
+
+ if( !DC390_ToMech( MechNum, config_id ) )
+ {
+ wlval = DC390_inDword( MechNum, PCI_ID_REG);
+ if(wlval == PCI_DEVICE_ID_AMD53C974 )
+ {
+ io_port =DC390_inDword(MechNum,PCI_BASE_ADDR0) & 0xFFFE;
+ irq = DC390_inByte( MechNum, PCI_INTERRUPT_REG);
+#ifdef DC390_DEBUG0
+ if(bootverbose)
+ printf("DC390: IO_PORT=%4x,IRQ=%x,\n",(UINT) io_port, irq);
+#endif
+ if( !DC390_init( io_port, irq, (USHORT) unit, MechNum, config_id) )
+ {
+ adapterCnt++;
+ }
+ else
+ return;
+ }
+ }
+
+ pACB = pACB0[unit];
+
+/*
+ Now let the generic SCSI driver look for the SCSI devices on the bus
+*/
+
+ flags = splbio();
+
+ scbus = scsi_alloc_bus();
+ if(!scbus)
+ {
+ splx(flags);
+ return;
+ }
+ scbus->adapter_link = &pACB->ScsiLink;
+ scbus->maxtarg = pACB->max_id;
+
+#ifdef DC390_DEBUG
+ if(bootverbose)
+ printf("\nDC390: scanning for devices ...\n\n");
+#endif
+
+ scsi_attachdevs (scbus);
+ scbus = NULL; /* Upper-level SCSI code owns this now */
+
+#ifdef DC390_DEBUG
+ if(bootverbose)
+ printf("\n\nDC390: Attach devices return\n");
+#endif
+
+ splx(flags);
+}
+
+
+static char*
+trmamd_probe (pcici_t tag, pcidi_t type)
+{
+ if( type == PCI_DEVICE_ID_AMD53C974 )
+ return ("amd 53c974 scsi");
+ else
+ return (NULL);
+}
+
diff --git a/sys/pci/tek390.h b/sys/pci/tek390.h
new file mode 100644
index 0000000000000..c8de8cee0d1ab
--- /dev/null
+++ b/sys/pci/tek390.h
@@ -0,0 +1,667 @@
+/***********************************************************************
+;* File Name : TEK390.H *
+;* TEKRAM DC-390 PCI SCSI Bus Master Host Adapter *
+;* Device Driver *
+;***********************************************************************/
+
+#ifndef TEK390_H
+#define TEK390_H
+
+typedef unsigned char UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned long ULONG;
+typedef unsigned int UINT;
+
+typedef UCHAR *PUCHAR;
+typedef USHORT *PUSHORT;
+typedef ULONG *PULONG;
+typedef struct scsi_link *PSCLINK, SCSILINK;
+typedef struct scsi_xfer *PSCSICMD, SCSICMD;
+typedef void *PVOID;
+
+
+/*;-----------------------------------------------------------------------*/
+typedef struct _SyncMsg
+{
+UCHAR ExtendMsg;
+UCHAR ExtMsgLen;
+UCHAR SyncXferReq;
+UCHAR Period;
+UCHAR ReqOffset;
+} SyncMsg;
+/*;-----------------------------------------------------------------------*/
+typedef struct _Capacity
+{
+ULONG BlockCount;
+ULONG BlockLength;
+} Capacity;
+/*;-----------------------------------------------------------------------*/
+typedef struct _SGentry
+{
+ULONG SGXLen;
+ULONG SGXPtr;
+} SGentry, *PSEG;
+
+typedef struct _SGentry1
+{
+ULONG SGXPtr1;
+ULONG SGXLen1;
+} SGentry1, *PSEG1;
+
+
+#define MAX_ADAPTER_NUM 4
+#define MAX_SCSI_ID 8
+#define MAX_SG_ENTRY 33
+#define MAX_DEVICES 10
+#define MAX_CMD_QUEUE 20
+#define MAX_CMD_PER_LUN 6
+#define MAX_SRB_CNT MAX_CMD_PER_LUN*4
+#define PAGELEN 4096
+
+/*
+;-----------------------------------------------------------------------
+; SCSI Request Block
+;-----------------------------------------------------------------------
+*/
+struct _SRB
+{
+UCHAR CmdBlock[12];
+
+struct _SRB *pNextSRB;
+struct _DCB *pSRBDCB;
+PSCSICMD pcmd;
+PSEG pSegmentList;
+
+ULONG PhysSRB;
+ULONG TotalXferredLen;
+ULONG SGPhysAddr; /*;a segment starting address */
+ULONG SGToBeXferLen; /*; to be xfer length */
+ULONG Segment0[2];
+ULONG Segment1[2];
+
+SGentry SGsegment[MAX_SG_ENTRY];
+SGentry Segmentx; /* make a one entry of S/G list table */
+
+PUCHAR pMsgPtr;
+USHORT SRBState;
+USHORT Revxx2; /* ??? */
+
+UCHAR MsgInBuf[6];
+UCHAR MsgOutBuf[6];
+
+UCHAR AdaptStatus;
+UCHAR TargetStatus;
+UCHAR MsgCnt;
+UCHAR EndMessage;
+UCHAR TagNumber;
+UCHAR SGcount;
+UCHAR SGIndex;
+UCHAR IORBFlag; /*;81h-Reset, 2-retry */
+
+UCHAR SRBStatus;
+UCHAR RetryCnt;
+UCHAR SRBFlag; /*; b0-AutoReqSense,b6-Read,b7-write */
+ /*; b4-settimeout,b5-Residual valid */
+UCHAR ScsiCmdLen;
+UCHAR ScsiPhase;
+UCHAR Reserved3[3]; /*;for dword alignment */
+};
+
+typedef struct _SRB DC390_SRB, *PSRB;
+
+/*
+;-----------------------------------------------------------------------
+; Device Control Block
+;-----------------------------------------------------------------------
+*/
+struct _DCB
+{
+struct _DCB *pNextDCB;
+struct _ACB *pDCBACB;
+
+PSRB pWaitingSRB;
+PSRB pWaitLast;
+PSRB pGoingSRB;
+PSRB pGoingLast;
+PSRB pActiveSRB;
+USHORT GoingSRBCnt;
+USHORT WaitSRBCnt; /* ??? */
+
+ULONG TagMask;
+
+USHORT MaxCommand;
+USHORT AdaptIndex; /*; UnitInfo struc start */
+USHORT UnitIndex; /*; nth Unit on this card */
+UCHAR UnitSCSIID; /*; SCSI Target ID (SCSI Only) */
+UCHAR UnitSCSILUN; /*; SCSI Log. Unit (SCSI Only) */
+
+UCHAR IdentifyMsg;
+UCHAR CtrlR1;
+UCHAR CtrlR3;
+UCHAR CtrlR4;
+
+UCHAR InqDataBuf[8];
+UCHAR CapacityBuf[8];
+UCHAR DevMode;
+UCHAR AdpMode;
+UCHAR SyncMode; /*; 0:async mode */
+UCHAR NegoPeriod; /*;for nego. */
+UCHAR SyncPeriod; /*;for reg. */
+UCHAR SyncOffset; /*;for reg. and nego.(low nibble) */
+UCHAR UnitCtrlFlag;
+UCHAR DCBFlag;
+UCHAR DevType;
+UCHAR Reserved2[3]; /*;for dword alignment */
+};
+
+typedef struct _DCB DC390_DCB, *PDCB;
+/*
+;-----------------------------------------------------------------------
+; Adapter Control Block
+;-----------------------------------------------------------------------
+*/
+struct _ACB
+{
+ULONG PhysACB;
+struct _ACB *pNextACB;
+USHORT IOPortBase;
+USHORT Revxx1; /* ??? */
+
+PDCB pLinkDCB;
+PDCB pDCBRunRobin;
+PDCB pActiveDCB;
+PDCB pDCB_free;
+PSRB pFreeSRB;
+PSRB pTmpSRB;
+USHORT SRBCount;
+USHORT AdapterIndex; /*; nth Adapter this driver */
+USHORT max_id;
+USHORT max_lun;
+SCSILINK ScsiLink;
+
+UCHAR msgin123[4];
+UCHAR status;
+UCHAR AdaptSCSIID; /*; Adapter SCSI Target ID */
+UCHAR AdaptSCSILUN; /*; Adapter SCSI LUN */
+UCHAR DeviceCnt;
+UCHAR IRQLevel;
+UCHAR TagMaxNum;
+UCHAR ACBFlag;
+UCHAR Gmode2;
+UCHAR LUNchk;
+UCHAR scan_devices;
+UCHAR HostID_Bit;
+UCHAR Reserved1[1]; /*;for dword alignment */
+UCHAR DCBmap[MAX_SCSI_ID];
+DC390_DCB DCB_array[MAX_DEVICES]; /* +74h, Len=3E8 */
+DC390_SRB SRB_array[MAX_SRB_CNT]; /* +45Ch, Len= */
+DC390_SRB TmpSRB;
+};
+
+typedef struct _ACB DC390_ACB, *PACB;
+
+/*;-----------------------------------------------------------------------*/
+
+
+#define BIT31 0x80000000
+#define BIT30 0x40000000
+#define BIT29 0x20000000
+#define BIT28 0x10000000
+#define BIT27 0x08000000
+#define BIT26 0x04000000
+#define BIT25 0x02000000
+#define BIT24 0x01000000
+#define BIT23 0x00800000
+#define BIT22 0x00400000
+#define BIT21 0x00200000
+#define BIT20 0x00100000
+#define BIT19 0x00080000
+#define BIT18 0x00040000
+#define BIT17 0x00020000
+#define BIT16 0x00010000
+#define BIT15 0x00008000
+#define BIT14 0x00004000
+#define BIT13 0x00002000
+#define BIT12 0x00001000
+#define BIT11 0x00000800
+#define BIT10 0x00000400
+#define BIT9 0x00000200
+#define BIT8 0x00000100
+#define BIT7 0x00000080
+#define BIT6 0x00000040
+#define BIT5 0x00000020
+#define BIT4 0x00000010
+#define BIT3 0x00000008
+#define BIT2 0x00000004
+#define BIT1 0x00000002
+#define BIT0 0x00000001
+
+/*;---UnitCtrlFlag */
+#define UNIT_ALLOCATED BIT0
+#define UNIT_INFO_CHANGED BIT1
+#define FORMATING_MEDIA BIT2
+#define UNIT_RETRY BIT3
+
+/*;---UnitFlags */
+#define DASD_SUPPORT BIT0
+#define SCSI_SUPPORT BIT1
+#define ASPI_SUPPORT BIT2
+
+/*;----SRBState machine definition */
+#define SRB_FREE 0
+#define SRB_WAIT BIT0
+#define SRB_READY BIT1
+#define SRB_MSGOUT BIT2 /*;arbitration+msg_out 1st byte*/
+#define SRB_MSGIN BIT3
+#define SRB_MSGIN_MULTI BIT4
+#define SRB_COMMAND BIT5
+#define SRB_START_ BIT6 /*;arbitration+msg_out+command_out*/
+#define SRB_DISCONNECT BIT7
+#define SRB_DATA_XFER BIT8
+#define SRB_XFERPAD BIT9
+#define SRB_STATUS BIT10
+#define SRB_COMPLETED BIT11
+#define SRB_ABORT_SENT BIT12
+#define DO_SYNC_NEGO BIT13
+#define SRB_UNEXPECT_RESEL BIT14
+
+/*;---ACBFlag */
+#define RESET_DEV BIT0
+#define RESET_DETECT BIT1
+#define RESET_DONE BIT2
+
+/*;---DCBFlag */
+#define ABORT_DEV_ BIT0
+
+/*;---SRBstatus */
+#define SRB_OK BIT0
+#define ABORTION BIT1
+#define OVER_RUN BIT2
+#define UNDER_RUN BIT3
+#define PARITY_ERROR BIT4
+#define SRB_ERROR BIT5
+
+/*;---SRBFlag */
+#define DATAOUT BIT7
+#define DATAIN BIT6
+#define RESIDUAL_VALID BIT5
+#define ENABLE_TIMER BIT4
+#define RESET_DEV0 BIT2
+#define ABORT_DEV BIT1
+#define AUTO_REQSENSE BIT0
+
+/*;---Adapter status */
+#define H_STATUS_GOOD 0
+#define H_SEL_TIMEOUT 0x11
+#define H_OVER_UNDER_RUN 0x12
+#define H_UNEXP_BUS_FREE 0x13
+#define H_TARGET_PHASE_F 0x14
+#define H_INVALID_CCB_OP 0x16
+#define H_LINK_CCB_BAD 0x17
+#define H_BAD_TARGET_DIR 0x18
+#define H_DUPLICATE_CCB 0x19
+#define H_BAD_CCB_OR_SG 0x1A
+#define H_ABORT 0x0FF
+
+/*; SCSI Status byte codes*/
+#define SCSI_STAT_GOOD 0x0 /*; Good status */
+#define SCSI_STAT_CHECKCOND 0x02 /*; SCSI Check Condition */
+#define SCSI_STAT_CONDMET 0x04 /*; Condition Met */
+#define SCSI_STAT_BUSY 0x08 /*; Target busy status */
+#define SCSI_STAT_INTER 0x10 /*; Intermediate status */
+#define SCSI_STAT_INTERCONDMET 0x14 /*; Intermediate condition met */
+#define SCSI_STAT_RESCONFLICT 0x18 /*; Reservation conflict */
+#define SCSI_STAT_CMDTERM 0x22 /*; Command Terminated */
+#define SCSI_STAT_QUEUEFULL 0x28 /*; Queue Full */
+
+#define SCSI_STAT_UNEXP_BUS_F 0xFD /*; Unexpect Bus Free */
+#define SCSI_STAT_BUS_RST_DETECT 0xFE /*; Scsi Bus Reset detected */
+#define SCSI_STAT_SEL_TIMEOUT 0xFF /*; Selection Time out */
+
+/*;---Sync_Mode */
+#define SYNC_DISABLE 0
+#define SYNC_ENABLE BIT0
+#define SYNC_NEGO_DONE BIT1
+#define WIDE_ENABLE BIT2
+#define WIDE_NEGO_DONE BIT3
+#define EN_TAG_QUEUING BIT4
+#define EN_ATN_STOP BIT5
+
+#define SYNC_NEGO_OFFSET 15
+
+/*;---SCSI bus phase*/
+#define SCSI_DATA_OUT_ 0
+#define SCSI_DATA_IN_ 1
+#define SCSI_COMMAND 2
+#define SCSI_STATUS_ 3
+#define SCSI_NOP0 4
+#define SCSI_NOP1 5
+#define SCSI_MSG_OUT 6
+#define SCSI_MSG_IN 7
+
+/*;----SCSI MSG BYTE*/
+#define MSG_COMPLETE 0x00
+#define MSG_EXTENDED 0x01
+#define MSG_SAVE_PTR 0x02
+#define MSG_RESTORE_PTR 0x03
+#define MSG_DISCONNECT 0x04
+#define MSG_INITIATOR_ERROR 0x05
+#define MSG_ABORT 0x06
+#define MSG_REJECT_ 0x07
+#define MSG_NOP 0x08
+#define MSG_PARITY_ERROR 0x09
+#define MSG_LINK_CMD_COMPL 0x0A
+#define MSG_LINK_CMD_COMPL_FLG 0x0B
+#define MSG_BUS_RESET 0x0C
+#define MSG_ABORT_TAG 0x0D
+#define MSG_SIMPLE_QTAG 0x20
+#define MSG_HEAD_QTAG 0x21
+#define MSG_ORDER_QTAG 0x22
+#define MSG_IDENTIFY 0x80
+#define MSG_HOST_ID 0x0C0
+
+/*;----SCSI STATUS BYTE*/
+#define STATUS_GOOD 0x00
+#define CHECK_CONDITION_ 0x02
+#define STATUS_BUSY 0x08
+#define STATUS_INTERMEDIATE 0x10
+#define RESERVE_CONFLICT 0x18
+
+/* cmd->result */
+#define STATUS_MASK_ 0xFF
+#define MSG_MASK 0xFF00
+#define RETURN_MASK 0xFF0000
+
+/*
+** Inquiry Data format
+*/
+
+typedef struct _SCSIInqData { /* INQ */
+
+ UCHAR DevType; /* Periph Qualifier & Periph Dev Type*/
+ UCHAR RMB_TypeMod; /* rem media bit & Dev Type Modifier */
+ UCHAR Vers; /* ISO, ECMA, & ANSI versions */
+ UCHAR RDF; /* AEN, TRMIOP, & response data format*/
+ UCHAR AddLen; /* length of additional data */
+ UCHAR Res1; /* reserved */
+ UCHAR Res2; /* reserved */
+ UCHAR Flags; /* RelADr,Wbus32,Wbus16,Sync,etc. */
+ UCHAR VendorID[8]; /* Vendor Identification */
+ UCHAR ProductID[16]; /* Product Identification */
+ UCHAR ProductRev[4]; /* Product Revision */
+
+
+} SCSI_INQDATA, *PSCSI_INQDATA;
+
+
+/* Inquiry byte 0 masks */
+
+
+#define SCSI_DEVTYPE 0x1F /* Peripheral Device Type */
+#define SCSI_PERIPHQUAL 0xE0 /* Peripheral Qualifier */
+
+
+/* Inquiry byte 1 mask */
+
+#define SCSI_REMOVABLE_MEDIA 0x80 /* Removable Media bit (1=removable) */
+
+
+/* Peripheral Device Type definitions */
+
+#define SCSI_DASD 0x00 /* Direct-access Device */
+#define SCSI_SEQACESS 0x01 /* Sequential-access device */
+#define SCSI_PRINTER 0x02 /* Printer device */
+#define SCSI_PROCESSOR 0x03 /* Processor device */
+#define SCSI_WRITEONCE 0x04 /* Write-once device */
+#define SCSI_CDROM 0x05 /* CD-ROM device */
+#define SCSI_SCANNER 0x06 /* Scanner device */
+#define SCSI_OPTICAL 0x07 /* Optical memory device */
+#define SCSI_MEDCHGR 0x08 /* Medium changer device */
+#define SCSI_COMM 0x09 /* Communications device */
+#define SCSI_NODEV 0x1F /* Unknown or no device type */
+
+/*
+** Inquiry flag definitions (Inq data byte 7)
+*/
+
+#define SCSI_INQ_RELADR 0x80 /* device supports relative addressing*/
+#define SCSI_INQ_WBUS32 0x40 /* device supports 32 bit data xfers */
+#define SCSI_INQ_WBUS16 0x20 /* device supports 16 bit data xfers */
+#define SCSI_INQ_SYNC 0x10 /* device supports synchronous xfer */
+#define SCSI_INQ_LINKED 0x08 /* device supports linked commands */
+#define SCSI_INQ_CMDQUEUE 0x02 /* device supports command queueing */
+#define SCSI_INQ_SFTRE 0x01 /* device supports soft resets */
+
+
+/*
+;==========================================================
+; EEPROM byte offset
+;==========================================================
+*/
+typedef struct _EEprom
+{
+UCHAR EE_MODE1;
+UCHAR EE_SPEED;
+UCHAR xx1;
+UCHAR xx2;
+} EEprom, *PEEprom;
+
+#define EE_ADAPT_SCSI_ID 64
+#define EE_MODE2 65
+#define EE_DELAY 66
+#define EE_TAG_CMD_NUM 67
+
+/*; EE_MODE1 bits definition*/
+#define PARITY_CHK_ BIT0
+#define SYNC_NEGO_ BIT1
+#define EN_DISCONNECT_ BIT2
+#define SEND_START_ BIT3
+#define TAG_QUEUING_ BIT4
+
+/*; EE_MODE2 bits definition*/
+#define MORE2_DRV BIT0
+#define GREATER_1G BIT1
+#define RST_SCSI_BUS BIT2
+#define ACTIVE_NEGATION BIT3
+#define NO_SEEK BIT4
+#define LUN_CHECK BIT5
+
+#define ENABLE_CE 1
+#define DISABLE_CE 0
+#define EEPROM_READ 0x80
+
+/*
+;==========================================================
+; AMD 53C974 Registers bit Definition
+;==========================================================
+*/
+/*
+;====================
+; SCSI Register
+;====================
+*/
+
+/*; Command Reg.(+0CH) */
+#define DMA_COMMAND BIT7
+#define NOP_CMD 0
+#define CLEAR_FIFO_CMD 1
+#define RST_DEVICE_CMD 2
+#define RST_SCSI_BUS_CMD 3
+#define INFO_XFER_CMD 0x10
+#define INITIATOR_CMD_CMPLTE 0x11
+#define MSG_ACCEPTED_CMD 0x12
+#define XFER_PAD_BYTE 0x18
+#define SET_ATN_CMD 0x1A
+#define RESET_ATN_CMD 0x1B
+#define SELECT_W_ATN 0x42
+#define SEL_W_ATN_STOP 0x43
+#define EN_SEL_RESEL 0x44
+#define SEL_W_ATN2 0x46
+#define DATA_XFER_CMD INFO_XFER_CMD
+
+
+/*; SCSI Status Reg.(+10H) */
+#define INTERRUPT BIT7
+#define ILLEGAL_OP_ERR BIT6
+#define PARITY_ERR BIT5
+#define COUNT_2_ZERO BIT4
+#define GROUP_CODE_VALID BIT3
+#define SCSI_PHASE_MASK (BIT2+BIT1+BIT0)
+
+/*; Interrupt Status Reg.(+14H) */
+#define SCSI_RESET_ BIT7
+#define INVALID_CMD BIT6
+#define DISCONNECTED BIT5
+#define SERVICE_REQUEST BIT4
+#define SUCCESSFUL_OP BIT3
+#define RESELECTED BIT2
+#define SEL_ATTENTION BIT1
+#define SELECTED BIT0
+
+/*; Internal State Reg.(+18H) */
+#define SYNC_OFFSET_FLAG BIT3
+#define INTRN_STATE_MASK (BIT2+BIT1+BIT0)
+
+/*; Clock Factor Reg.(+24H) */
+#define CLK_FREQ_40MHZ 0
+#define CLK_FREQ_35MHZ (BIT2+BIT1+BIT0)
+#define CLK_FREQ_30MHZ (BIT2+BIT1)
+#define CLK_FREQ_25MHZ (BIT2+BIT0)
+#define CLK_FREQ_20MHZ BIT2
+#define CLK_FREQ_15MHZ (BIT1+BIT0)
+#define CLK_FREQ_10MHZ BIT1
+
+/*; Control Reg. 1(+20H) */
+#define EXTENDED_TIMING BIT7
+#define DIS_INT_ON_SCSI_RST BIT6
+#define PARITY_ERR_REPO BIT4
+#define SCSI_ID_ON_BUS (BIT2+BIT1+BIT0)
+
+/*; Control Reg. 2(+2CH) */
+#define EN_FEATURE BIT6
+#define EN_SCSI2_CMD BIT3
+
+/*; Control Reg. 3(+30H) */
+#define ID_MSG_CHECK BIT7
+#define EN_QTAG_MSG BIT6
+#define EN_GRP2_CMD BIT5
+#define FAST_SCSI BIT4 /* ;10MB/SEC */
+#define FAST_CLK BIT3 /* ;25 - 40 MHZ */
+
+/*; Control Reg. 4(+34H) */
+#define EATER_12NS 0
+#define EATER_25NS BIT7
+#define EATER_35NS BIT6
+#define EATER_0NS (BIT7+BIT6)
+#define NEGATE_REQACKDATA BIT2
+#define NEGATE_REQACK BIT3
+/*
+;====================
+; DMA Register
+;====================
+*/
+/*; DMA Command Reg.(+40H) */
+#define READ_DIRECTION BIT7
+#define WRITE_DIRECTION 0
+#define EN_DMA_INT BIT6
+#define MAP_TO_MDL BIT5
+#define DMA_DIAGNOSTIC BIT4
+#define DMA_IDLE_CMD 0
+#define DMA_BLAST_CMD BIT0
+#define DMA_ABORT_CMD BIT1
+#define DMA_START_CMD (BIT1+BIT0)
+
+/*; DMA Status Reg.(+54H) */
+#define PCI_MS_ABORT BIT6
+#define BLAST_COMPLETE BIT5
+#define SCSI_INTERRUPT BIT4
+#define DMA_XFER_DONE BIT3
+#define DMA_XFER_ABORT BIT2
+#define DMA_XFER_ERROR BIT1
+#define POWER_DOWN BIT0
+
+/*
+; DMA SCSI Bus and Ctrl.(+70H)
+;EN_INT_ON_PCI_ABORT
+*/
+
+/*
+;==========================================================
+; SCSI Chip register address offset
+;==========================================================
+*/
+#define CtcReg_Low 0x00
+#define CtcReg_Mid 0x04
+#define ScsiFifo 0x08
+#define ScsiCmd 0x0C
+#define Scsi_Status 0x10
+#define INT_Status 0x14
+#define Sync_Period 0x18
+#define Sync_Offset 0x1C
+#define CtrlReg1 0x20
+#define Clk_Factor 0x24
+#define CtrlReg2 0x2C
+#define CtrlReg3 0x30
+#define CtrlReg4 0x34
+#define CtcReg_High 0x38
+#define DMA_Cmd 0x40
+#define DMA_XferCnt 0x44
+#define DMA_XferAddr 0x48
+#define DMA_Wk_ByteCntr 0x4C
+#define DMA_Wk_AddrCntr 0x50
+#define DMA_Status 0x54
+#define DMA_MDL_Addr 0x58
+#define DMA_Wk_MDL_Cntr 0x5C
+#define DMA_ScsiBusCtrl 0x70
+
+#define StcReg_Low CtcReg_Low
+#define StcReg_Mid CtcReg_Mid
+#define Scsi_Dest_ID Scsi_Status
+#define Scsi_TimeOut INT_Status
+#define Intern_State Sync_Period
+#define Current_Fifo Sync_Offset
+#define StcReg_High CtcReg_High
+
+#define am_target Scsi_Status
+#define am_timeout INT_Status
+#define am_seq_step Sync_Period
+#define am_fifo_count Sync_Offset
+
+
+#define DC390_read8(address) \
+ inb(DC390_ioport + (address)))
+
+#define DC390_read16(address) \
+ inw(DC390_ioport + (address)))
+
+#define DC390_read32(address) \
+ inl(DC390_ioport + (address)))
+
+#define DC390_write8(address,value) \
+ outb((value), DC390_ioport + (address)))
+
+#define DC390_write16(address,value) \
+ outw((value), DC390_ioport + (address)))
+
+#define DC390_write32(address,value) \
+ outl((value), DC390_ioport + (address)))
+
+
+/* Configuration method #1 */
+#define PCI_CFG1_ADDRESS_REG 0xcf8
+#define PCI_CFG1_DATA_REG 0xcfc
+#define PCI_CFG1_ENABLE 0x80000000
+#define PCI_CFG1_TUPPLE(bus, device, function, register) \
+ (PCI_CFG1_ENABLE | (((bus) << 16) & 0xff0000) | \
+ (((device) << 11) & 0xf800) | (((function) << 8) & 0x700)| \
+ (((register) << 2) & 0xfc))
+
+/* Configuration method #2 */
+#define PCI_CFG2_ENABLE_REG 0xcf8
+#define PCI_CFG2_FORWARD_REG 0xcfa
+#define PCI_CFG2_ENABLE 0x0f0
+#define PCI_CFG2_TUPPLE(function) \
+ (PCI_CFG2_ENABLE | (((function) << 1) & 0xe))
+
+
+#endif /* TEK390_H */
diff --git a/sys/pci/wdc_p.c b/sys/pci/wdc_p.c
index f8ca641b72e2c..67d9de6171122 100644
--- a/sys/pci/wdc_p.c
+++ b/sys/pci/wdc_p.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: wdc_p.c,v 1.3 1997/08/02 14:33:14 bde Exp $
+ * $Id: wdc_p.c,v 1.2 1997/04/28 19:26:18 se Exp $
*/
/*
@@ -41,7 +41,7 @@
#define CMD640B_PCI_ID 0x06401095
-static const char* wdc_pci_probe __P((pcici_t tag, pcidi_t type));
+static char* wdc_pci_probe __P((pcici_t tag, pcidi_t type));
static void wdc_pci_attach __P((pcici_t config_id, int unit));
static u_long wdc_pci_count = 0;
@@ -56,7 +56,7 @@ static struct pci_device wdc_pci_driver = {
DATA_SET (pcidevice_set, wdc_pci_driver);
-static const char*
+static char*
wdc_pci_probe (pcici_t tag, pcidi_t type)
{
if (type == CMD640B_PCI_ID)
diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c
index 25a90a471d8f2..b46a3952dbcdd 100644
--- a/sys/pci/xrpu.c
+++ b/sys/pci/xrpu.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: xrpu.c,v 1.5 1998/12/14 06:32:58 dillon Exp $
+ * $Id: xrpu.c,v 1.1 1998/05/30 18:28:11 phk Exp $
*
* A very simple device driver for PCI cards based on Xilinx 6200 series
* FPGA/RPU devices. Current Functionality is to allow you to open and
@@ -17,199 +17,52 @@
*
*/
-#include "xrpu.h"
+#ifndef DEVFS
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/timepps.h>
#include <sys/devfsext.h>
-#include <sys/xrpuio.h>
#include <pci/pcireg.h>
#include <pci/pcivar.h>
-static const char* xrpu_probe (pcici_t tag, pcidi_t type);
+static char* xrpu_probe (pcici_t tag, pcidi_t type);
static void xrpu_attach (pcici_t tag, int unit);
static u_long xrpu_count;
-static void xrpu_poll_pps(struct timecounter *tc);
-
-/*
- * Device driver initialization stuff
- */
-
-static d_open_t xrpu_open;
-static d_close_t xrpu_close;
-static d_ioctl_t xrpu_ioctl;
-static d_mmap_t xrpu_mmap;
-
-#define CDEV_MAJOR 100
-static struct cdevsw xrpudevsw = {
- xrpu_open, xrpu_close, noread, nowrite,
- xrpu_ioctl, nullstop, noreset, nodevtotty,
- seltrue, xrpu_mmap, nostrategy, "xrpu",
- NULL, -1
-};
-
-static MALLOC_DEFINE(M_XRPU, "xrpu", "XRPU related");
-
-#define dev2unit(devt) (minor(devt) & 0xff)
-#define dev2pps(devt) ((minor(devt) >> 16)-1)
-
-static struct softc {
- pcici_t tag;
- enum { NORMAL, TIMECOUNTER } mode;
- vm_offset_t virbase, physbase;
- u_int *virbase62;
- struct timecounter tc;
- u_int *trigger, *latch, dummy;
- struct {
- pps_params_t params;
- pps_info_t info;
- int cap;
- u_int *assert, last_assert;
- u_int *clear, last_clear;
- } pps[XRPU_MAX_PPS];
-} *softc[NXRPU];
-
-static unsigned
-xrpu_get_timecount(struct timecounter *tc)
-{
- struct softc *sc = tc->tc_priv;
-
- sc->dummy += *sc->trigger;
- return (*sc->latch & tc->tc_counter_mask);
-}
-
-void
-xrpu_poll_pps(struct timecounter *tc)
-{
- struct softc *sc = tc->tc_priv;
- int i;
- unsigned count1, ppscount;
-
- for (i = 0; i < XRPU_MAX_PPS; i++) {
- if (sc->pps[i].assert) {
- ppscount = *(sc->pps[i].assert) & tc->tc_counter_mask;
- do {
- count1 = ppscount;
- ppscount = *(sc->pps[i].assert) & tc->tc_counter_mask;
- } while (ppscount != count1);
- if (ppscount != sc->pps[i].last_assert) {
- timecounter_timespec(ppscount, &sc->pps[i].info.assert_timestamp);
- if (sc->pps[i].params.mode & PPS_OFFSETASSERT) {
- timespecadd(&sc->pps[i].info.assert_timestamp,
- &sc->pps[i].params.assert_offset);
- if (sc->pps[i].info.assert_timestamp.tv_nsec < 0) {
- sc->pps[i].info.assert_timestamp.tv_nsec += 1000000000;
- sc->pps[i].info.assert_timestamp.tv_sec -= 1;
- }
- }
- sc->pps[i].info.assert_sequence++;
- sc->pps[i].last_assert = ppscount;
- }
- }
- if (sc->pps[i].clear) {
- ppscount = *(sc->pps[i].clear) & tc->tc_counter_mask;
- do {
- count1 = ppscount;
- ppscount = *(sc->pps[i].clear) & tc->tc_counter_mask;
- } while (ppscount != count1);
- if (ppscount != sc->pps[i].last_clear) {
- timecounter_timespec(ppscount, &sc->pps[i].info.clear_timestamp);
- if (sc->pps[i].params.mode & PPS_OFFSETASSERT) {
- timespecadd(&sc->pps[i].info.clear_timestamp,
- &sc->pps[i].params.clear_offset);
- if (sc->pps[i].info.clear_timestamp.tv_nsec < 0) {
- sc->pps[i].info.clear_timestamp.tv_nsec += 1000000000;
- sc->pps[i].info.clear_timestamp.tv_sec -= 1;
- }
- }
- sc->pps[i].info.clear_sequence++;
- sc->pps[i].last_clear = ppscount;
- }
- }
- }
-}
+static vm_offset_t virbase, physbase;
static int
-xrpu_open(dev_t dev, int flag, int mode, struct proc *p)
+xrpuopen(dev_t dev, int flag, int mode, struct proc *p)
{
return (0);
}
static int
-xrpu_close(dev_t dev, int flag, int mode, struct proc *p)
+xrpuclose(dev_t dev, int flag, int mode, struct proc *p)
{
return (0);
}
static int
-xrpu_mmap(dev_t dev, vm_offset_t offset, int nprot)
+xrpummap(dev_t dev, int offset, int nprot)
{
- struct softc *sc = softc[dev2unit(dev)];
if (offset >= 0x1000000)
return (-1);
- return (i386_btop(sc->physbase + offset));
+ return (i386_btop(physbase + offset));
}
-static int
-xrpu_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
-{
- struct softc *sc = softc[dev2unit(dev)];
- int i, error;
-
- if (sc->mode == TIMECOUNTER) {
- i = dev2pps(dev);
- if (i < 0 || i >= XRPU_MAX_PPS)
- return ENODEV;
- if (!sc->pps[i].cap)
- return ENODEV;
- error = std_pps_ioctl(cmd, arg, &sc->pps[i].params,
- &sc->pps[i].info, sc->pps[i].cap);
- return (error);
- }
-
- if (cmd == XRPU_IOC_TIMECOUNTING) {
- struct xrpu_timecounting *xt = (struct xrpu_timecounting *)arg;
-
- /* Name SHALL be zero terminated */
- xt->xt_name[sizeof xt->xt_name - 1] = '\0';
- i = strlen(xt->xt_name);
- sc->tc.tc_name = (char *)malloc(i + 1, M_XRPU, M_WAITOK);
- strcpy(sc->tc.tc_name, xt->xt_name);
- sc->tc.tc_frequency = xt->xt_frequency;
- sc->tc.tc_get_timecount = xrpu_get_timecount;
- sc->tc.tc_poll_pps = xrpu_poll_pps;
- sc->tc.tc_priv = sc;
- sc->tc.tc_counter_mask = xt->xt_mask;
- sc->trigger = sc->virbase62 + xt->xt_addr_trigger;
- sc->latch = sc->virbase62 + xt->xt_addr_latch;
+/*
+ * Device driver initialization stuff
+ */
- for (i = 0; i < XRPU_MAX_PPS; i++) {
- if (xt->xt_pps[i].xt_addr_assert == 0
- && xt->xt_pps[i].xt_addr_clear == 0)
- continue;
- devfs_add_devswf(&xrpudevsw, (i+1)<<16, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "xpps%d", i);
- /* DEVFS */
- if (xt->xt_pps[i].xt_addr_assert) {
- sc->pps[i].assert = sc->virbase62 + xt->xt_pps[i].xt_addr_assert;
- sc->pps[i].cap |= PPS_CAPTUREASSERT | PPS_OFFSETASSERT;
- }
- if (xt->xt_pps[i].xt_addr_clear) {
- sc->pps[i].clear = sc->virbase62 + xt->xt_pps[i].xt_addr_clear;
- sc->pps[i].cap |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR;
- }
- }
- sc->mode = TIMECOUNTER;
- init_timecounter(&sc->tc);
- return (0);
- }
- error = ENOTTY;
- return (error);
-}
+#define CDEV_MAJOR 100
+static struct cdevsw xrpudevsw = {
+ xrpuopen, xrpuclose, noread, nowrite,
+ noioctl, nullstop, noreset, nodevtotty,
+ seltrue, xrpummap, nostrategy, "xrpu",
+ NULL, -1
+};
/*
* PCI initialization stuff
@@ -225,15 +78,13 @@ static struct pci_device xrpu_device = {
DATA_SET (pcidevice_set, xrpu_device);
-static const char*
+static char*
xrpu_probe (pcici_t tag, pcidi_t typea)
{
- u_int id;
+ int data = pci_conf_read(tag, PCI_CLASS_REG);
+ u_int id = pci_conf_read(tag, PCI_ID_REG);
const char *vendor, *chip, *type;
- (void)pci_conf_read(tag, PCI_CLASS_REG);
- id = pci_conf_read(tag, PCI_ID_REG);
-
vendor = chip = type = 0;
if (id == 0x6216133e) {
@@ -245,27 +96,16 @@ xrpu_probe (pcici_t tag, pcidi_t typea)
static void
xrpu_attach (pcici_t tag, int unit)
{
- struct softc *sc;
- dev_t cdev = makedev(CDEV_MAJOR, unit);
-
- sc = (struct softc *)malloc(sizeof *sc, M_XRPU, M_WAITOK);
- softc[unit] = sc;
- bzero(sc, sizeof *sc);
-
- sc->tag = tag;
- sc->mode = NORMAL;
-
- pci_map_mem(tag, PCI_MAP_REG_START, &sc->virbase, &sc->physbase);
+ dev_t cdev = makedev(CDEV_MAJOR, 0);
- sc->virbase62 = (u_int *)(sc->virbase + 0x800000);
+ pci_map_mem(tag, PCI_MAP_REG_START, &virbase, &physbase);
- if (bootverbose)
- printf("Mapped physbase %#lx to virbase %#lx\n",
- (u_long)sc->physbase, (u_long)sc->virbase);
+ printf("Mapped physbase %#lx to virbase %#lx\n",
+ (u_long)physbase, (u_long)virbase);
- if (!unit)
- cdevsw_add(&cdev, &xrpudevsw, NULL);
+ cdevsw_add(&cdev, &xrpudevsw, NULL);
devfs_add_devswf(&xrpudevsw, 0, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
- "xrpu%d", unit);
+ "xrpu0");
}
+#endif /* DEVFS */
diff --git a/sys/sys/aio.h b/sys/sys/aio.h
index 53847c779f47d..321ff4bad7646 100644
--- a/sys/sys/aio.h
+++ b/sys/sys/aio.h
@@ -1,3 +1,6 @@
+#ifndef _AIO_H_
+#define _AIO_H_
+
/*
* Copyright (c) 1997 John S. Dyson. All rights reserved.
*
@@ -13,21 +16,17 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
- * $Id: aio.h,v 1.8 1998/04/12 03:09:43 dyson Exp $
+ * $Id: aio.h,v 1.7 1998/03/28 11:50:34 dufault Exp $
*/
-#ifndef _SYS_AIO_H_
-#define _SYS_AIO_H_
-
#include <sys/types.h>
#include <sys/signal.h>
-
/*
* Returned by aio_cancel:
* (Note that FreeBSD's aio is not cancellable -- yet.)
*/
#define AIO_CANCELED 0x1
-#define AIO_NOTCANCELED 0x2
+#define AIO_NOTCANCELED 0x2
#define AIO_ALLDONE 0x3
/*
@@ -80,7 +79,7 @@ struct __aiocb_private {
typedef struct aiocb {
int aio_fildes; /* File descriptor */
off_t aio_offset; /* File offset for I/O */
- volatile void *aio_buf; /* I/O buffer in process space */
+ volatile void *aio_buf; /* I/O buffer in process space */
size_t aio_nbytes; /* Number of bytes for I/O */
struct sigevent aio_sigevent; /* Signal to deliver */
int aio_lio_opcode; /* LIO opcode */
@@ -89,17 +88,15 @@ typedef struct aiocb {
} aiocb_t;
#ifndef KERNEL
-
-__BEGIN_DECLS
/*
* Asynchronously read from a file
*/
-int aio_read(struct aiocb *);
+int aio_read( struct aiocb *iocb);
/*
* Asynchronously write to file
*/
-int aio_write(struct aiocb *);
+int aio_write( struct aiocb *iocb);
/*
* List I/O Asynchronously/synchronously read/write to/from file
@@ -107,14 +104,15 @@ int aio_write(struct aiocb *);
* "acb_list" is an array of "nacb_listent" I/O control blocks.
* when all I/Os are complete, the optional signal "sig" is sent.
*/
-int lio_listio(int, struct aiocb * const [], int, struct sigevent *);
+int lio_listio( int lio_mode, struct aiocb * const acb_list[],
+ int nacb_listent, struct sigevent *sig);
/*
* Get completion status
* returns EINPROGRESS until I/O is complete.
* this routine does not block.
*/
-int aio_error(const struct aiocb *);
+int aio_error( const struct aiocb *iocb);
/*
* Finish up I/O, releasing I/O resources and returns the value
@@ -122,29 +120,28 @@ int aio_error(const struct aiocb *);
* This routine must be called once and only once for each
* I/O control block who has had I/O associated with it.
*/
-ssize_t aio_return(struct aiocb *);
+ssize_t aio_return( struct aiocb *iocb);
/*
* Cancel I/O -- implemented only to return AIO_NOTCANCELLED or
* AIO_ALLDONE. No cancellation operation will occur.
*/
-int aio_cancel(int, struct aiocb *);
+int aio_cancel( int fd, struct aiocb *iocb);
/*
* Suspend until all specified I/O or timeout is complete.
*/
-int aio_suspend(const struct aiocb * const[], int, const struct timespec *);
+int aio_suspend( const struct aiocb * const acb_list[], int nacb_listent,
+ const struct timespec *tm);
/*
* Retrieve the status of the specified I/O request.
*/
-int aio_error(const struct aiocb *);
-
-__END_DECLS
+int aio_error( const struct aiocb *aiocbp);
#else
-void aio_proc_rundown(struct proc *p);
+void aio_proc_rundown( struct proc *p);
#endif
diff --git a/sys/sys/alogio.h b/sys/sys/alogio.h
new file mode 100644
index 0000000000000..99fd74e8bd564
--- /dev/null
+++ b/sys/sys/alogio.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 1998 Scottibox
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Industrial Computer Source model AIO8-P
+ * 128 channel MUX capability via daisy chained AT-16P units
+ * alogio.h, definitions for alog ioctl(), last revised January 6 1998
+ * See http://www.scottibox.com
+ * http://www.indcompsrc.com/products/data/html/aio8g-p.html
+ * http://www.indcompsrc.com/products/data/html/at16-p.html
+ *
+ * Written by: Jamil J. Weatherbee <jamil@scottibox.com>
+ *
+ */
+
+#ifndef _SYS_ALOGIO_H_
+#define _SYS_ALOGIO_H_
+
+#ifndef KERNEL
+#include <sys/types.h>
+#endif
+#include <sys/ioccom.h>
+
+/* Note: By default A/D conversions are started when a channel is open */
+
+/* Halt clocked A/D conversion on an open channel */
+#define AD_STOP _IO('A', 100)
+/* Restart clocked A/D conversion on an open channel */
+#define AD_START _IO('A', 101)
+/* Get the number of entries the fifo for this channel will hold */
+#define AD_FIFOSIZE_GET _IOR('A', 102, int)
+/* Set the minimum number of entries a fifo must contain before it
+ * notifies a poll() or read() that is waiting for it to fill */
+#define AD_FIFO_TRIGGER_SET _IOW('A', 103, int)
+/* This gets the the fifo trigger setting */
+#define AD_FIFO_TRIGGER_GET _IOR('A', 104, int)
+
+#endif
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 191fdbcad2ffe..7e702a99434d0 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)buf.h 8.9 (Berkeley) 3/30/95
- * $Id: buf.h,v 1.60 1998/10/31 14:05:11 peter Exp $
+ * $Id: buf.h,v 1.58 1998/09/25 17:34:49 peter Exp $
*/
#ifndef _SYS_BUF_H_
@@ -44,6 +44,8 @@
#include <sys/queue.h>
+#define NOLIST ((struct buf *)0x87654321)
+
struct buf;
struct mount;
struct vnode;
@@ -81,14 +83,13 @@ struct iodone_chain {
*/
struct buf {
LIST_ENTRY(buf) b_hash; /* Hash chain. */
- TAILQ_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
+ LIST_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */
TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */
TAILQ_ENTRY(buf) b_act; /* Device driver queue when active. *new* */
struct proc *b_proc; /* Associated proc; NULL if kernel. */
long b_flags; /* B_* flags. */
unsigned short b_qindex; /* buffer queue index */
unsigned char b_usecount; /* buffer use count */
- unsigned char b_xflags; /* extra flags */
int b_error; /* Errno value. */
long b_bufsize; /* Allocated buffer size. */
long b_bcount; /* Valid bytes in buffer. */
@@ -169,12 +170,6 @@ struct buf {
"\17locked\16inval\15avail2\14error\13eintr\12done\11freebuf" \
"\10delwri\7call\6cache\5busy\4bad\3async\2needcommit\1age"
-/*
- * These flags are kept in b_xflags.
- */
-#define B_VNDIRTY 0x01 /* On vnode dirty list */
-#define B_VNCLEAN 0x02 /* On vnode clean list */
-
#define NOOFFSET (-1LL) /* No buffer offset calculated yet */
struct buf_queue_head {
@@ -184,20 +179,6 @@ struct buf_queue_head {
struct buf *switch_point;
};
-/*
- * This structure describes a clustered I/O. It is stored in the b_saveaddr
- * field of the buffer on which I/O is done. At I/O completion, cluster
- * callback uses the structure to parcel I/O's to individual buffers, and
- * then free's this structure.
- */
-struct cluster_save {
- long bs_bcount; /* Saved b_bcount. */
- long bs_bufsize; /* Saved b_bufsize. */
- void *bs_saveaddr; /* Saved b_addr. */
- int bs_nchildren; /* Number of associated buffers. */
- struct buf **bs_children; /* List of associated buffers. */
-};
-
static __inline void bufq_init __P((struct buf_queue_head *head));
static __inline void bufq_insert_tail __P((struct buf_queue_head *head,
@@ -236,8 +217,9 @@ bufq_remove(struct buf_queue_head *head, struct buf *bp)
head->insert_point = TAILQ_PREV(bp, buf_queue, b_act);
if (head->insert_point == NULL)
head->last_pblkno = 0;
- } else if (bp == TAILQ_FIRST(&head->queue))
+ } else if (bp == TAILQ_FIRST(&head->queue)) {
head->last_pblkno = bp->b_pblkno;
+ }
TAILQ_REMOVE(&head->queue, bp, b_act);
if (TAILQ_FIRST(&head->queue) == head->switch_point)
head->switch_point = NULL;
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index d0bd5647dbf3c..bccadd6302f04 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bus.h,v 1.7 1998/11/14 21:58:41 wollman Exp $
+ * $Id: bus.h,v 1.5 1998/07/22 08:35:48 dfr Exp $
*/
#ifndef _SYS_BUS_H_
@@ -43,20 +43,12 @@ typedef struct device_op_desc *device_op_desc_t;
typedef void driver_intr_t(void*);
-/*
- * We define this in terms of bits because some devices may belong
- * to multiple classes (and therefore need to be included in
- * multiple interrupt masks, which is what this really serves to
- * indicate. Buses which do interrupt remapping will want to
- * change their type to reflect what sort of devices are underneath.
- */
typedef enum driver_type {
- DRIVER_TYPE_TTY = 1,
- DRIVER_TYPE_BIO = 2,
- DRIVER_TYPE_NET = 4,
- DRIVER_TYPE_CAM = 8,
- DRIVER_TYPE_MISC = 16,
- DRIVER_TYPE_FAST = 128
+ DRIVER_TYPE_TTY,
+ DRIVER_TYPE_BIO,
+ DRIVER_TYPE_NET,
+ DRIVER_TYPE_MISC,
+ MAX_DRIVER_TYPE
} driver_type_t;
typedef int (*devop_t)(void);
@@ -71,7 +63,6 @@ struct driver {
device_method_t *methods; /* method table */
driver_type_t type;
size_t softc; /* size of device softc struct */
- void *priv; /* driver private data */
TAILQ_ENTRY(driver) link; /* list of devices on bus */
device_ops_t ops; /* compiled method table */
};
@@ -89,113 +80,76 @@ enum device_state {
*/
extern device_t root_bus;
extern devclass_t root_devclass;
-void root_bus_configure(void);
+void root_bus_configure(void);
/*
* Useful functions for implementing busses.
*/
-struct resource;
-
-int bus_generic_activate_resource(device_t dev, device_t child, int type,
- int rid, struct resource *r);
-struct resource *bus_generic_alloc_resource(device_t bus, device_t child,
- int type, int *rid,
- u_long start, u_long end,
- u_long count, u_int flags);
-int bus_generic_attach(device_t dev);
-int bus_generic_deactivate_resource(device_t dev, device_t child, int type,
- int rid, struct resource *r);
-int bus_generic_detach(device_t dev);
-void bus_generic_print_child(device_t dev, device_t child);
-int bus_generic_read_ivar(device_t dev, device_t child, int which,
- uintptr_t *result);
-int bus_generic_release_resource(device_t bus, device_t child,
- int type, int rid, struct resource *r);
-int bus_generic_resume(device_t dev);
-int bus_generic_setup_intr(device_t dev, device_t child,
- struct resource *irq,
- driver_intr_t *intr, void *arg, void **cookiep);
-int bus_generic_shutdown(device_t dev);
-int bus_generic_suspend(device_t dev);
-int bus_generic_teardown_intr(device_t dev, device_t child,
- struct resource *irq, void *cookie);
-int bus_generic_write_ivar(device_t dev, device_t child, int which,
- uintptr_t value);
-
-/*
- * Wrapper functions for the BUS_*_RESOURCE methods to make client code
- * a little simpler.
- */
-struct resource *bus_alloc_resource(device_t dev, int type, int *rid,
- u_long start, u_long end, u_long count,
- u_int flags);
-int bus_activate_resource(device_t dev, int type, int rid,
- struct resource *r);
-int bus_deactivate_resource(device_t dev, int type, int rid,
- struct resource *r);
-int bus_release_resource(device_t dev, int type, int rid,
- struct resource *r);
+int bus_generic_attach(device_t dev);
+int bus_generic_detach(device_t dev);
+int bus_generic_shutdown(device_t dev);
+void bus_generic_print_child(device_t dev, device_t child);
+int bus_generic_read_ivar(device_t dev, device_t child, int which, u_long *result);
+int bus_generic_write_ivar(device_t dev, device_t child, int which, u_long value);
+void *bus_generic_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
+int bus_generic_connect_intr(device_t dev, void *ih);
/*
* Access functions for device.
*/
-device_t device_add_child(device_t dev, const char *name, int unit,
- void *ivp);
-device_t device_add_child_after(device_t dev, device_t place,
- const char *name, int unit, void *ivp);
-void device_busy(device_t dev);
-int device_delete_child(device_t dev, device_t child);
-int device_detach(device_t dev);
-void device_disable(device_t dev);
-void device_enable(device_t dev);
-device_t device_find_child(device_t dev, const char *classname,
- int unit);
-const char *device_get_desc(device_t dev);
-devclass_t device_get_devclass(device_t dev);
-driver_t *device_get_driver(device_t dev);
-device_t device_get_parent(device_t dev);
-int device_get_children(device_t dev, device_t **listp, int *countp);
-void *device_get_ivars(device_t dev);
-const char *device_get_name(device_t dev);
-void *device_get_softc(device_t dev);
-device_state_t device_get_state(device_t dev);
-int device_get_unit(device_t dev);
-int device_is_enabled(device_t dev);
-int device_is_alive(device_t dev); /* did probe succeed? */
-void device_print_prettyname(device_t dev);
-void device_printf(device_t dev, const char *, ...) __printflike(2, 3);
-int device_probe_and_attach(device_t dev);
-void device_set_desc(device_t dev, const char* desc);
-int device_set_devclass(device_t dev, const char *classname);
-int device_set_driver(device_t dev, driver_t *driver);
-int device_shutdown(device_t dev);
-void device_unbusy(device_t dev);
+device_t device_get_parent(device_t dev);
+device_t device_add_child(device_t dev, const char *name,
+ int unit, void *ivars);
+device_t device_add_child_after(device_t dev, device_t place, const char *name,
+ int unit, void *ivars);
+device_t device_find_child(device_t dev, const char *classname, int unit);
+int device_delete_child(device_t dev, device_t child);
+driver_t *device_get_driver(device_t dev);
+devclass_t device_get_devclass(device_t dev);
+int device_set_devclass(device_t dev, const char *classname);
+int device_set_driver(device_t dev, driver_t *driver);
+void device_set_desc(device_t dev, const char* desc);
+const char* device_get_desc(device_t dev);
+const char* device_get_name(device_t dev);
+int device_get_unit(device_t dev);
+void *device_get_softc(device_t dev);
+void *device_get_ivars(device_t dev);
+device_state_t device_get_state(device_t dev);
+void device_enable(device_t dev);
+void device_disable(device_t dev);
+void device_busy(device_t dev);
+void device_unbusy(device_t dev);
+int device_is_enabled(device_t dev);
+int device_is_alive(device_t dev); /* did probe succeed? */
+int device_probe_and_attach(device_t dev);
+int device_detach(device_t dev);
+int device_shutdown(device_t dev);
/*
* Access functions for devclass.
*/
-int devclass_add_driver(devclass_t dc, driver_t *driver);
-int devclass_delete_driver(devclass_t dc, driver_t *driver);
-devclass_t devclass_find(const char *classname);
-driver_t *devclass_find_driver(devclass_t dc, const char *classname);
-const char *devclass_get_name(devclass_t dc);
-device_t devclass_get_device(devclass_t dc, int unit);
-void *devclass_get_softc(devclass_t dc, int unit);
-int devclass_get_devices(devclass_t dc, device_t **listp, int *countp);
-int devclass_get_maxunit(devclass_t dc);
+devclass_t devclass_find(const char *classname);
+int devclass_add_driver(devclass_t dc, driver_t *driver);
+int devclass_delete_driver(devclass_t dc, driver_t *driver);
+driver_t *devclass_find_driver(devclass_t dc, const char *classname);
+const char *devclass_get_name(devclass_t dc);
+device_t devclass_get_device(devclass_t dc, int unit);
+void *devclass_get_softc(devclass_t dc, int unit);
+int devclass_get_devices(devclass_t dc, device_t **devlistp, int *devcountp);
+int devclass_get_maxunit(devclass_t dc);
/*
* Access functions for device resources.
*/
-int resource_int_value(const char *name, int unit, char *resname,
- int *result);
-int resource_long_value(const char *name, int unit, char *resname,
- long *result);
-int resource_string_value(const char *name, int unit, char *resname,
- char **result);
-int resource_query_string(int i, char *resname, char *value);
-char *resource_query_name(int i);
-int resource_query_unit(int i);
+int resource_int_value(const char *name, int unit,
+ char *resname, int *result);
+int resource_long_value(const char *name, int unit,
+ char *resname, long *result);
+int resource_string_value(const char *name, int unit,
+ char *resname, char **result);
+int resource_query_string(int i, char *resname, char *value);
+char *resource_query_name(int i);
+int resource_query_unit(int i);
/*
* Shorthand for constructing method tables.
@@ -208,52 +162,28 @@ int resource_query_unit(int i);
#include "device_if.h"
#include "bus_if.h"
-struct module;
-
-int driver_module_handler(struct module *, int, void *);
+#ifdef _SYS_MODULE_H_
/*
* Module support for automatically adding drivers to busses.
*/
struct driver_module_data {
- int (*dmd_chainevh)(struct module *, int, void *);
- void *dmd_chainarg;
- const char *dmd_busname;
- driver_t **dmd_drivers;
- int dmd_ndrivers;
- devclass_t *dmd_devclass;
+ modeventhand_t chainevh;
+ void* chainarg;
+ const char* busname;
+ driver_t* driver;
+ devclass_t* devclass;
};
-#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \
- \
-static driver_t *name##_##busname##_driver_list[] = { &driver }; \
-static struct driver_module_data name##_##busname##_driver_mod = { \
- evh, arg, \
- #busname, \
- name##_##busname##_driver_list, \
- (sizeof name##_##busname##_driver_list) / \
- (sizeof name##_##busname##_driver_list[0]), \
- &devclass \
-}; \
- \
-static moduledata_t name##_##busname##_mod = { \
- #busname "/" #name, \
- driver_module_handler, \
- &name##_##busname##_driver_mod \
-}; \
-DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \
- SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
+int driver_module_handler(module_t, modeventtype_t, void*);
-#define MULTI_DRIVER_MODULE(name, busname, drivers, devclass, evh, arg) \
+#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \
\
-static driver_t name##_##busname##_driver_list[] = drivers; \
static struct driver_module_data name##_##busname##_driver_mod = { \
evh, arg, \
#busname, \
- name##_##busname##_driver_list, \
- (sizeof name##_##busname##_driver_list) / \
- (sizeof name##_##busname##_driver_list[0]), \
- &devclass \
+ &driver, \
+ &devclass, \
}; \
\
static moduledata_t name##_##busname##_mod = { \
@@ -274,15 +204,7 @@ static struct cdevsw_module_data name##_##busname##_cdevsw_mod = { \
DRIVER_MODULE(name, busname, driver, devclass, \
cdevsw_module_handler, &name##_##busname##_cdevsw_mod)
-#define BDEV_DRIVER_MODULE(name, busname, driver, devclass, \
- bmajor, cmajor, devsw, evh, arg) \
- \
-static struct bdevsw_module_data name##_##busname##_bdevsw_mod = { \
- evh, arg, makedev(bmajor, 0), makedev(cmajor, 0), &devsw \
-}; \
- \
-DRIVER_MODULE(name, busname, driver, devclass, \
- bdevsw_module_handler, &name##_##busname##_bdevsw_mod)
+#endif
#endif /* KERNEL */
diff --git a/sys/sys/bus_private.h b/sys/sys/bus_private.h
index 8dfa87c7a58d1..50fdf857066f0 100644
--- a/sys/sys/bus_private.h
+++ b/sys/sys/bus_private.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bus_private.h,v 1.3 1998/07/22 08:35:50 dfr Exp $
+ * $Id: bus_private.h,v 1.2 1998/06/14 13:46:10 dfr Exp $
*/
#ifndef _SYS_BUS_PRIVATE_H_
@@ -54,7 +54,7 @@ typedef enum {
RES_INT, RES_STRING, RES_LONG
} resource_type;
-struct config_resource {
+struct resource {
char *name;
resource_type type;
union {
@@ -68,7 +68,7 @@ struct config_device {
char *name; /* e.g. "lpt", "wdc" etc */
int unit;
int resource_count;
- struct config_resource *resources;
+ struct resource *resources;
};
/*
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 587e7d72ecac7..03ee5b4b71084 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
- * $Id: cdefs.h,v 1.23 1998/10/29 04:41:24 jdp Exp $
+ * $Id: cdefs.h,v 1.21 1998/08/24 06:17:01 bde Exp $
*/
#ifndef _SYS_CDEFS_H_
@@ -136,20 +136,15 @@
*/
#if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 7
#define __printflike(fmtarg, firstvararg)
+#define __printf0like(fmtarg, firstvararg)
#define __scanflike(fmtarg, firstvararg)
#else
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
-#define __scanflike(fmtarg, firstvararg) \
- __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
-#endif
-
-/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
-#if __FreeBSD_cc_version >= 300001
#define __printf0like(fmtarg, firstvararg) \
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
-#else
-#define __printf0like(fmtarg, firstvararg)
+#define __scanflike(fmtarg, firstvararg) \
+ __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#endif
#ifdef __GNUC__
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 1a00cb466a05b..80e4e36849741 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
- * $Id: conf.h,v 1.47 1998/11/10 21:45:18 dfr Exp $
+ * $Id: conf.h,v 1.44 1998/08/20 06:10:42 bde Exp $
*/
#ifndef _SYS_CONF_H_
@@ -66,7 +66,7 @@ typedef void d_stop_t __P((struct tty *tp, int rw));
typedef int d_reset_t __P((dev_t dev));
typedef struct tty *d_devtotty_t __P((dev_t dev));
typedef int d_poll_t __P((dev_t dev, int events, struct proc *p));
-typedef int d_mmap_t __P((dev_t dev, vm_offset_t offset, int nprot));
+typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
typedef int l_open_t __P((dev_t dev, struct tty *tp));
typedef int l_close_t __P((struct tty *tp, int flag));
@@ -199,26 +199,29 @@ d_close_t nullclose;
l_read_t l_noread;
l_write_t l_nowrite;
-struct module;
+/*
+ * XXX This is ugly.
+ */
+#ifdef _SYS_MODULE_H_
struct cdevsw_module_data {
- int (*chainevh)(struct module *, int, void *); /* next handler */
- void *chainarg; /* arg for next event handler */
- dev_t dev; /* device major to use */
- struct cdevsw *cdevsw; /* device functions */
+ modeventhand_t chainevh; /* next event handler in chain */
+ void* chainarg; /* arg for next event handler */
+ dev_t dev; /* device major to use */
+ struct cdevsw* cdevsw; /* device functions */
};
struct bdevsw_module_data {
- int (*chainevh)(struct module *, int, void *); /* next handler */
- void *chainarg; /* arg for next event handler */
- int bdev; /* device major to use */
- int cdev; /* device major to use */
- struct cdevsw *cdevsw; /* device functions */
+ modeventhand_t chainevh; /* next event handler in chain */
+ void* chainarg; /* arg for next event handler */
+ int bdev; /* device major to use */
+ int cdev; /* device major to use */
+ struct cdevsw* cdevsw; /* device functions */
};
#define CDEV_MODULE(name, major, devsw, evh, arg) \
static struct cdevsw_module_data name##_cdevsw_mod = { \
- evh, arg, major == NODEV ? NODEV : makedev(major, 0), &devsw \
+ evh, arg, makedev(major, 0), &devsw \
}; \
\
static moduledata_t name##_mod = { \
@@ -230,8 +233,7 @@ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+major)
#define BDEV_MODULE(name, bdev, cdev, devsw, evh, arg) \
static struct bdevsw_module_data name##_bdevsw_mod = { \
- evh, arg, mdev == NODEV ? NODEV : makedev(bdev, 0), \
- cdev == NODEV ? NODEV : makedev(cdev, 0), &devsw \
+ evh, arg, makedev(bdev, 0), makedev(cdev, 0), &devsw \
}; \
\
static moduledata_t name##_mod = { \
@@ -241,8 +243,10 @@ static moduledata_t name##_mod = { \
}; \
DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+cdev)
-int cdevsw_module_handler __P((struct module *mod, int what, void *arg));
-int bdevsw_module_handler __P((struct module *mod, int what, void *arg));
+int cdevsw_module_handler __P((module_t mod, modeventtype_t what, void* arg));
+int bdevsw_module_handler __P((module_t mod, modeventtype_t what, void* arg));
+
+#endif /* _SYS_MODULE_H_ */
int cdevsw_add __P((dev_t *descrip,struct cdevsw *new,struct cdevsw **old));
void cdevsw_add_generic __P((int bdev, int cdev, struct cdevsw *cdevsw));
diff --git a/sys/sys/copyright.h b/sys/sys/copyright.h
index f29bc7e0764b4..c5cb1caa7f900 100644
--- a/sys/sys/copyright.h
+++ b/sys/sys/copyright.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: copyright.h,v 1.4 1998/01/06 11:44:55 wosch Exp $
+ * $Id: copyright.h,v 1.3 1997/12/31 11:04:01 wosch Exp $
*/
@@ -30,7 +30,7 @@
/* FreeBSD */
#define COPYRIGHT_FreeBSD \
- "Copyright (c) 1992-1999 FreeBSD Inc.\n"
+ "Copyright (c) 1992-1998 FreeBSD Inc.\n"
/* Berkeley */
#define COPYRIGHT_UCB \
diff --git a/sys/sys/devfsext.h b/sys/sys/devfsext.h
index 425cbff00f9fd..3086fba4e92f4 100644
--- a/sys/sys/devfsext.h
+++ b/sys/sys/devfsext.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfsext.h,v 1.21 1998/07/13 06:45:16 bde Exp $
+ * $Id: devfsext.h,v 1.20 1998/04/28 00:10:52 julian Exp $
*/
#ifndef _SYS_DEVFSEXT_H_
@@ -43,7 +43,7 @@ void *devfs_add_devswf __P((void *devsw, int minor, int chrblk, uid_t uid,
* at the moment there is nothing you can do with it that you couldn't do
* with the original cookie. ( XXX this might be something I should change )
*/
-void *devfs_makelink __P((void *original, char *fmt, ...)) __printflike(2, 3);
+void *devfs_link __P((void *original, char *fmt, ...)) __printflike(2, 3);
/*
* Remove all instances of a device you have made. INCLUDING LINKS.
diff --git a/sys/sys/devicestat.h b/sys/sys/devicestat.h
index 8ffd04967c637..03d106a4f561c 100644
--- a/sys/sys/devicestat.h
+++ b/sys/sys/devicestat.h
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devicestat.h,v 1.2 1998/09/20 00:10:58 ken Exp $
+ * $Id: devicestat.h,v 1.1 1998/09/15 08:16:17 gibbs Exp $
*/
#ifndef _DEVICESTAT_H
@@ -182,7 +182,7 @@ struct devstat {
};
#ifdef KERNEL
-void devstat_add_entry(struct devstat *ds, const char *dev_name,
+void devstat_add_entry(struct devstat *ds, char *dev_name,
int unit_number, u_int32_t block_size,
devstat_support_flags flags,
devstat_type_flags device_type);
diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h
index 33b2d7f91865d..854ec380e42de 100644
--- a/sys/sys/dirent.h
+++ b/sys/sys/dirent.h
@@ -31,14 +31,12 @@
* SUCH DAMAGE.
*
* @(#)dirent.h 8.3 (Berkeley) 8/10/94
- * $Id: dirent.h,v 1.8 1997/04/10 13:54:19 bde Exp $
+ * $Id: dirent.h,v 1.7 1997/02/22 09:45:02 peter Exp $
*/
#ifndef _SYS_DIRENT_H_
#define _SYS_DIRENT_H_
-#include <machine/ansi.h>
-
/*
* The dirent structure defines the format of directory entries returned by
* the getdirentries(2) system call.
@@ -51,10 +49,10 @@
*/
struct dirent {
- __uint32_t d_fileno; /* file number of entry */
- __uint16_t d_reclen; /* length of this record */
- __uint8_t d_type; /* file type, see below */
- __uint8_t d_namlen; /* length of string in d_name */
+ u_int32_t d_fileno; /* file number of entry */
+ u_int16_t d_reclen; /* length of this record */
+ u_int8_t d_type; /* file type, see below */
+ u_int8_t d_namlen; /* length of string in d_name */
#ifdef _POSIX_SOURCE
char d_name[255 + 1]; /* name must be no longer than this */
#else
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index e2845a7807faa..dcdbeaa2a40bb 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)disklabel.h 8.2 (Berkeley) 7/10/94
- * $Id: disklabel.h,v 1.35 1998/08/24 08:45:37 dfr Exp $
+ * $Id: disklabel.h,v 1.34 1998/07/12 16:48:08 dfr Exp $
*/
#ifndef _SYS_DISKLABEL_H_
@@ -95,7 +95,7 @@ struct disklabel {
* the disklabel is read off the disk or in-core copy.
* d_boot0 and d_boot1 are the (optional) names of the
* primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
+ * as found in /usr/mdec. These are returned when using
* getdiskbyname(3) to retrieve the values from /etc/disktab.
*/
union {
diff --git a/sys/sys/domain.h b/sys/sys/domain.h
index b4d352a4eb7d3..e0b004c44553c 100644
--- a/sys/sys/domain.h
+++ b/sys/sys/domain.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)domain.h 8.1 (Berkeley) 6/2/93
- * $Id: domain.h,v 1.10 1997/11/18 06:48:43 bde Exp $
+ * $Id: domain.h,v 1.9 1997/02/22 09:45:09 peter Exp $
*/
#ifndef _SYS_DOMAIN_H_
@@ -66,7 +66,6 @@ struct domain {
#ifdef KERNEL
extern struct domain *domains;
extern struct domain localdomain;
-extern int net_add_domain(struct domain *dp);
#define DOMAIN_SET(name) \
DATA_SET(domain_set, name ## domain)
diff --git a/sys/sys/errno.h b/sys/sys/errno.h
index adf0eff0e773e..0430bfedf38c5 100644
--- a/sys/sys/errno.h
+++ b/sys/sys/errno.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)errno.h 8.5 (Berkeley) 1/21/94
- * $Id: errno.h,v 1.10 1998/04/30 09:38:03 jb Exp $
+ * $Id: errno.h,v 1.9 1998/04/13 17:45:00 sos Exp $
*/
#ifndef _SYS_ERRNO_H_
@@ -161,12 +161,9 @@ __END_DECLS
#define EFTYPE 79 /* Inappropriate file type or format */
#define EAUTH 80 /* Authentication error */
#define ENEEDAUTH 81 /* Need authenticator */
-#define EIDRM 82 /* Identifier removed */
-#define ENOMSG 83 /* No message of desired type */
-#define EOVERFLOW 84 /* Value to large to be stored in data type */
-#define ECANCELED 85 /* Operation canceled */
-#define EILSEQ 86 /* Illegal byte sequence */
-#define ELAST 86 /* Must be equal largest errno */
+#define EIDRM 82 /* Identifier removed */
+#define ENOMSG 83 /* No message of desired type */
+#define ELAST 83 /* Must be equal largest errno */
#endif /* _POSIX_SOURCE */
diff --git a/sys/sys/exec.h b/sys/sys/exec.h
index 2ed6112c3b246..3df1b15e977d6 100644
--- a/sys/sys/exec.h
+++ b/sys/sys/exec.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)exec.h 8.3 (Berkeley) 1/21/94
- * $Id: exec.h,v 1.20 1998/11/15 15:33:52 bde Exp $
+ * $Id: exec.h,v 1.18 1998/03/02 05:47:40 peter Exp $
*/
#ifndef _SYS_EXEC_H_
@@ -60,7 +60,8 @@ struct ps_strings {
/*
* Address of ps_strings structure (in user space).
*/
-#define PS_STRINGS (USRSTACK - sizeof(struct ps_strings))
+#define PS_STRINGS ((struct ps_strings *) \
+ (USRSTACK - sizeof(struct ps_strings)))
#define SPARE_USRSPACE 256
struct image_params;
@@ -84,7 +85,8 @@ int exec_unregister __P((const struct execsw *));
#ifndef LKM
#include <sys/module.h>
#define EXEC_SET(name, execsw_arg) \
- static int name ## _modevent(module_t mod, int type, void *data) \
+ static int name ## _modevent(module_t mod, modeventtype_t type, \
+ void *data) \
{ \
struct execsw *exec = (struct execsw *)data; \
int error = 0; \
diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h
index 92b5562ff91df..444c3ef139a76 100644
--- a/sys/sys/filedesc.h
+++ b/sys/sys/filedesc.h
@@ -31,14 +31,12 @@
* SUCH DAMAGE.
*
* @(#)filedesc.h 8.1 (Berkeley) 6/2/93
- * $Id: filedesc.h,v 1.14 1998/11/11 10:04:12 truckman Exp $
+ * $Id: filedesc.h,v 1.12 1997/10/12 20:25:57 phk Exp $
*/
#ifndef _SYS_FILEDESC_H_
#define _SYS_FILEDESC_H_
-#include <sys/queue.h>
-
/*
* This structure is used for the management of descriptors. It may be
* shared by multiple processes.
@@ -93,30 +91,6 @@ struct filedesc0 {
*/
#define OFILESIZE (sizeof(struct file *) + sizeof(char))
-/*
- * This structure that holds the information needed to send a SIGIO or
- * a SIGURG signal to a process or process group when new data arrives
- * on a device or socket. The structure is placed on an SLIST belonging
- * to the proc or pgrp so that the entire list may be revoked when the
- * process exits or the process group disappears.
- */
-struct sigio {
- union {
- struct proc *siu_proc; /* process to receive SIGIO/SIGURG */
- struct pgrp *siu_pgrp; /* process group to receive ... */
- } sio_u;
- SLIST_ENTRY(sigio) sio_pgsigio; /* sigio's for process or group */
- struct sigio **sio_myref; /* location of the pointer that holds
- * the reference to this structure */
- struct ucred *sio_ucred; /* current credentials */
- uid_t sio_ruid; /* real user id */
- pid_t sio_pgid; /* pgid for signals */
-};
-#define sio_proc sio_u.siu_proc
-#define sio_pgrp sio_u.siu_pgrp
-
-SLIST_HEAD(sigiolst, sigio);
-
#ifdef KERNEL
/*
* Kernel global variables and routines.
@@ -135,10 +109,6 @@ void fdcloseexec __P((struct proc *p));
int getvnode __P((struct filedesc *fdp, int fd, struct file **fpp));
int fdissequential __P((struct file *));
void fdsequential __P((struct file *, int));
-pid_t fgetown __P((struct sigio *));
-int fsetown __P((pid_t, struct sigio **));
-void funsetown __P((struct sigio *));
-void funsetownlst __P((struct sigiolst *));
#endif
#endif
diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h
index 04bafbadd31f9..8c3a787adc786 100644
--- a/sys/sys/imgact.h
+++ b/sys/sys/imgact.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact.h,v 1.17 1998/03/02 05:47:43 peter Exp $
+ * $Id: imgact.h,v 1.16 1998/01/11 21:34:43 dyson Exp $
*/
#ifndef _SYS_IMGACT_H_
@@ -53,7 +53,6 @@ struct image_params {
char interpreter_name[64]; /* name of the interpreter */
void *auxargs; /* ELF Auxinfo structure pointer */
struct vm_page *firstpage; /* first page that we mapped */
- char *fname; /* pointer to filename of executable (user space) */
};
#ifdef KERNEL
diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h
index d841a39c4b67f..d44e4aafed7a5 100644
--- a/sys/sys/imgact_elf.h
+++ b/sys/sys/imgact_elf.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.h,v 1.9 1998/09/14 05:36:51 jdp Exp $
+ * $Id: imgact_elf.h,v 1.8 1998/09/07 07:30:44 dfr Exp $
*/
#ifndef _SYS_IMGACT_ELF_H_
@@ -64,10 +64,10 @@ typedef struct {
#define MAX_BRANDS 8
-int elf_insert_brand_entry __P((Elf32_Brandinfo *entry));
-int elf_remove_brand_entry __P((Elf32_Brandinfo *entry));
+int elf_insert_brand_entry __P((Elf32_Brandinfo *entry));
+int elf_remove_brand_entry __P((Elf32_Brandinfo *entry));
-#else /* !(ELF_TARG_CLASS == ELFCLASS32) */
+#else
/*
* Structure used to pass infomation from the loader to the
@@ -94,14 +94,16 @@ typedef struct {
#define MAX_BRANDS 8
-int elf_insert_brand_entry __P((Elf64_Brandinfo *entry));
-int elf_remove_brand_entry __P((Elf64_Brandinfo *entry));
+int elf_insert_brand_entry __P((Elf64_Brandinfo *entry));
+int elf_remove_brand_entry __P((Elf64_Brandinfo *entry));
-#endif /* ELF_TARG_CLASS == ELFCLASS32 */
+#endif
struct proc;
-int elf_coredump __P((struct proc *));
+__BEGIN_DECLS
+int elf_coredump __P((struct proc *));
+__END_DECLS
#endif /* KERNEL */
diff --git a/sys/sys/inttypes.h b/sys/sys/inttypes.h
deleted file mode 100644
index 824786a65aa64..0000000000000
--- a/sys/sys/inttypes.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file is in the public domain.
- * $Id$
- */
-
-#ifndef _SYS_INTTYPES_H_
-#define _SYS_INTTYPES_H_
-
-#include <machine/ansi.h>
-
-typedef __int8_t int8_t;
-typedef __int16_t int16_t;
-typedef __int32_t int32_t;
-typedef __int64_t int64_t;
-
-typedef __uint8_t uint8_t;
-typedef __uint16_t uint16_t;
-typedef __uint32_t uint32_t;
-typedef __uint64_t uint64_t;
-
-typedef __intptr_t intptr_t;
-typedef __uintptr_t uintptr_t;
-
-#endif /* !_SYS_INTTYPES_H_ */
diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h
index ec58bd0394e28..00aa43010795f 100644
--- a/sys/sys/kernel.h
+++ b/sys/sys/kernel.h
@@ -39,14 +39,12 @@
* SUCH DAMAGE.
*
* @(#)kernel.h 8.3 (Berkeley) 1/21/94
- * $Id: kernel.h,v 1.48 1998/12/20 16:54:27 bde Exp $
+ * $Id: kernel.h,v 1.42 1998/10/09 23:03:27 peter Exp $
*/
#ifndef _SYS_KERNEL_H_
#define _SYS_KERNEL_H_
-#include <sys/linker_set.h>
-
#ifdef KERNEL
/* Global variables for the kernel. */
@@ -78,6 +76,56 @@ extern long timedelta;
#endif /* KERNEL */
/*
+ * The following macros are used to declare global sets of objects, which
+ * are collected by the linker into a `struct linker_set' as defined below.
+ * For ELF, this is done by constructing a separate segment for each set.
+ * For a.out, it is done automatically by the linker.
+ */
+#if defined(__ELF__)
+
+/*
+ * Alpha GAS needs an align before the section change. It seems to assume
+ * that after the .previous, it is aligned, so the following .align 3 is
+ * ignored. Since the previous instructions often contain strings, this is
+ * a problem.
+ */
+
+#ifdef __alpha__
+#define MAKE_SET(set, sym) \
+ __asm(".align 3"); \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".quad " #sym); \
+ __asm(".previous")
+#else
+#define MAKE_SET(set, sym) \
+ __asm(".section .set." #set ",\"aw\""); \
+ __asm(".long " #sym); \
+ __asm(".previous")
+#endif
+#define TEXT_SET(set, sym) MAKE_SET(set, sym)
+#define DATA_SET(set, sym) MAKE_SET(set, sym)
+#define BSS_SET(set, sym) MAKE_SET(set, sym)
+#define ABS_SET(set, sym) MAKE_SET(set, sym)
+
+#else
+
+/*
+ * NB: the constants defined below must match those defined in
+ * ld/ld.h. Since their calculation requires arithmetic, we
+ * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
+ */
+#define MAKE_SET(set, sym, type) \
+ static void const * const __set_##set##_sym_##sym = &sym; \
+ __asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
+#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
+#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
+#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
+#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
+
+#endif
+
+
+/*
* Enumerated types for known system startup interfaces.
*
* Startup occurs in ascending numeric order; the list entries are
@@ -199,18 +247,6 @@ struct sysinit {
SI_TYPE_DEFAULT \
}; \
DATA_SET(sysinit_set,uniquifier ## _sys_init);
-/*
- * Called on module unload: no special processing
- */
-#define SYSUNINIT(uniquifier, subsystem, order, func, ident) \
- static struct sysinit uniquifier ## _sys_uninit = { \
- subsystem, \
- order, \
- func, \
- ident, \
- SI_TYPE_DEFAULT \
- }; \
- DATA_SET(sysuninit_set,uniquifier ## _sys_uninit)
/*
* Call 'fork()' before calling '(*func)(ident)';
@@ -278,7 +314,8 @@ void sysinit_add __P((struct sysinit **set));
*/
#include <sys/module.h>
#define PSEUDO_SET(sym, name) \
- static int name ## _modevent(module_t mod, int type, void *data) \
+ static int name ## _modevent(module_t mod, modeventtype_t type, \
+ void *data) \
{ \
void (*initfunc)(void *) = (void (*)(void *))data; \
switch (type) { \
@@ -301,6 +338,12 @@ void sysinit_add __P((struct sysinit **set));
#endif /* PSEUDO_LKM */
+struct linker_set {
+ int ls_length;
+ const void *ls_items[1]; /* really ls_length of them,
+ * trailing NULL */
+};
+
extern struct linker_set execsw_set;
#endif /* !_SYS_KERNEL_H_*/
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index 52536ee98e2e7..45a62da29047e 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: linker.h,v 1.10 1998/11/04 15:20:58 peter Exp $
+ * $Id: linker.h,v 1.8 1998/10/09 23:07:27 peter Exp $
*/
#ifndef _SYS_LINKER_H_
@@ -133,11 +133,6 @@ struct linker_class {
extern linker_file_t linker_current_file;
/*
- * The "file" for the kernel.
- */
-extern linker_file_t linker_kernel_file;
-
-/*
* Add a new file class to the linker.
*/
int linker_add_class(const char* desc, void* priv,
@@ -264,14 +259,6 @@ struct kld_file_stat {
size_t size; /* size in bytes */
};
-struct kld_sym_lookup {
- int version; /* set to sizeof(struct kld_sym_lookup) */
- char *symname; /* Symbol name we are looking up */
- u_long symvalue;
- size_t symsize;
-};
-#define KLDSYM_LOOKUP 1
-
#ifndef KERNEL
#include <sys/cdefs.h>
@@ -283,7 +270,6 @@ int kldfind(const char* file);
int kldnext(int fileid);
int kldstat(int fileid, struct kld_file_stat* stat);
int kldfirstmod(int fileid);
-int kldsym(int _fileid, int _cmd, void *_data);
__END_DECLS
#endif
diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h
deleted file mode 100644
index 9824a6bc11e13..0000000000000
--- a/sys/sys/linker_set.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 1999 John D. Polstra
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-#ifndef _SYS_LINKER_SET_H_
-#define _SYS_LINKER_SET_H_
-
-/*
- * The following macros are used to declare global sets of objects, which
- * are collected by the linker into a `struct linker_set' as defined below.
- * For ELF, this is done by constructing a separate segment for each set.
- * For a.out, it is done automatically by the linker.
- */
-#ifdef __ELF__
-
-/*
- * Alpha GAS needs an align before the section change. It seems to assume
- * that after the .previous, it is aligned, so the following .align 3 is
- * ignored. Since the previous instructions often contain strings, this is
- * a problem.
- */
-
-#ifdef __alpha__
-#define MAKE_SET(set, sym) \
- static void const * const __set_##set##_sym_##sym = &sym; \
- __asm(".align 3"); \
- __asm(".section .set." #set ",\"aw\""); \
- __asm(".quad " #sym); \
- __asm(".previous")
-#else
-#define MAKE_SET(set, sym) \
- static void const * const __set_##set##_sym_##sym = &sym; \
- __asm(".section .set." #set ",\"aw\""); \
- __asm(".long " #sym); \
- __asm(".previous")
-#endif
-#define TEXT_SET(set, sym) MAKE_SET(set, sym)
-#define DATA_SET(set, sym) MAKE_SET(set, sym)
-#define BSS_SET(set, sym) MAKE_SET(set, sym)
-#define ABS_SET(set, sym) MAKE_SET(set, sym)
-
-#else
-
-/*
- * NB: the constants defined below must match those defined in
- * ld/ld.h. Since their calculation requires arithmetic, we
- * can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
- */
-#define MAKE_SET(set, sym, type) \
- static void const * const __set_##set##_sym_##sym = &sym; \
- __asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
-#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
-#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
-#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)
-#define ABS_SET(set, sym) MAKE_SET(set, sym, 21)
-
-#endif
-
-struct linker_set {
- int ls_length;
- const void *ls_items[1]; /* really ls_length of them,
- * trailing NULL */
-};
-
-#endif /* _SYS_LINKER_SET_H_ */
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index c9c287d120c67..18a9eddd17326 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)lock.h 8.12 (Berkeley) 5/19/95
- * $Id: lock.h,v 1.12 1999/01/02 11:34:56 bde Exp $
+ * $Id: lock.h,v 1.10 1997/09/21 04:24:02 dyson Exp $
*/
#ifndef _LOCK_H_
@@ -59,11 +59,6 @@ struct lock {
char *lk_wmesg; /* resource sleeping (for tsleep) */
int lk_timo; /* maximum sleep time (for tsleep) */
pid_t lk_lockholder; /* pid of exclusive lock holder */
-#ifdef DEBUG_LOCKS
- const char *lk_filename;
- const char *lk_lockername;
- int lk_lineno;
-#endif
};
/*
* Lock request types:
@@ -174,19 +169,8 @@ struct proc;
void lockinit __P((struct lock *, int prio, char *wmesg, int timo,
int flags));
-#ifdef DEBUG_LOCKS
-int debuglockmgr __P((struct lock *, u_int flags,
- struct simplelock *, struct proc *p,
- const char *,
- const char *,
- int));
-#define lockmgr(lockp, flags, slockp, proc) \
- debuglockmgr((lockp), (flags), (slockp), (proc), \
- "lockmgr", __FILE__, __LINE__)
-#else
int lockmgr __P((struct lock *, u_int flags,
struct simplelock *, struct proc *p));
-#endif
void lockmgr_printinfo __P((struct lock *));
int lockstatus __P((struct lock *));
@@ -200,7 +184,6 @@ void _simple_lock __P((struct simplelock *alp, const char *, int));
void simple_lock_init __P((struct simplelock *alp));
#else /* !SIMPLELOCK_DEBUG */
#if NCPUS == 1 /* no multiprocessor locking is necessary */
-#define NULL_SIMPLELOCKS
#define simple_lock_init(alp)
#define simple_lock(alp)
#define simple_lock_try(alp) (1) /* always succeeds */
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index d8e0cd8b74a24..a04c6881367f6 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $Id: malloc.h,v 1.37 1998/03/08 09:58:26 julian Exp $
+ * $Id: malloc.h,v 1.36 1997/12/27 09:42:03 bde Exp $
*/
#ifndef _SYS_MALLOC_H_
@@ -64,20 +64,15 @@ struct malloc_type {
u_short ks_mapblocks; /* number of times blocked for kernel map */
};
-#ifdef KERNEL
-
-void malloc_init __P((void *));
-void malloc_uninit __P((void *));
-
#define MALLOC_DEFINE(type, shortdesc, longdesc) \
struct malloc_type type[1] = { \
{ NULL, 0, 0, 0, 0, 0, 0, M_MAGIC, shortdesc, 0, 0 } \
}; \
- SYSINIT(type##_init, SI_SUB_KMEM, SI_ORDER_ANY, malloc_init, type); \
- SYSUNINIT(type##_uninit, SI_SUB_KMEM, SI_ORDER_ANY, malloc_uninit, type)
+ struct __hack
#define MALLOC_DECLARE(type) \
- extern struct malloc_type type[1]
+ extern struct malloc_type type[1]; \
+ struct __hack
#ifdef MALLOC_INSTANTIATE
#define MALLOC_MAKE_TYPE(type, shortdesc, longdesc) \
@@ -90,7 +85,6 @@ void malloc_uninit __P((void *));
MALLOC_MAKE_TYPE(M_CACHE, "namecache", "Dynamically allocated cache entries");
MALLOC_MAKE_TYPE(M_DEVBUF, "devbuf", "device driver memory");
MALLOC_MAKE_TYPE(M_TEMP, "temp", "misc temporary data buffers");
-#endif /* KERNEL */
/*
* Array of descriptors that describe the contents of each page
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 959b70b073e1f..8dcebae3128b8 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
- * $Id: mbuf.h,v 1.30 1998/11/05 14:28:25 dg Exp $
+ * $Id: mbuf.h,v 1.28 1998/08/23 03:07:17 wollman Exp $
*/
#ifndef _SYS_MBUF_H_
@@ -138,7 +138,7 @@ struct mbuf {
#define MT_HEADER 2 /* packet header */
/*efine MT_SOCKET 3*/ /* socket structure */
/*efine MT_PCB 4*/ /* protocol control block */
-/*efine MT_RTABLE 5*/ /* routing tables */
+#define MT_RTABLE 5 /* routing tables */
/*efine MT_HTABLE 6*/ /* IMP host tables */
/*efine MT_ATABLE 7*/ /* address resolution tables */
#define MT_SONAME 8 /* socket name */
@@ -390,7 +390,6 @@ extern char *mclrefcnt; /* cluster reference counts */
extern struct mbstat mbstat;
extern int nmbclusters;
extern int nmbufs;
-extern int nsfbufs;
extern struct mbuf *mmbfree;
extern union mcluster *mclfree;
extern int max_linkhdr; /* largest link-level header */
diff --git a/sys/sys/mman.h b/sys/sys/mman.h
index c6592436e7c44..1ef56690ac7ba 100644
--- a/sys/sys/mman.h
+++ b/sys/sys/mman.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mman.h 8.2 (Berkeley) 1/9/95
- * $Id: mman.h,v 1.23 1998/03/28 11:50:38 dufault Exp $
+ * $Id: mman.h,v 1.22 1998/03/08 17:25:33 dufault Exp $
*/
#ifndef _SYS_MMAN_H_
@@ -64,9 +64,6 @@
#define MAP_INHERIT 0x0080 /* region is retained after exec */
#define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */
#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */
-#ifdef VM_STACK
-#define MAP_STACK 0x0400 /* region grows down, like a stack */
-#endif
#ifdef _P1003_1B_VISIBLE
/*
diff --git a/sys/sys/module.h b/sys/sys/module.h
index efee3d127d380..0ec89336a3c39 100644
--- a/sys/sys/module.h
+++ b/sys/sys/module.h
@@ -23,44 +23,33 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: module.h,v 1.5 1998/11/14 21:58:41 wollman Exp $
+ * $Id: module.h,v 1.3 1998/06/10 10:57:29 dfr Exp $
*/
#ifndef _SYS_MODULE_H_
#define _SYS_MODULE_H_
-typedef enum modeventtype {
+typedef enum {
MOD_LOAD,
MOD_UNLOAD,
MOD_SHUTDOWN
} modeventtype_t;
-typedef struct module *module_t;
+struct module;
+typedef struct module *module_t;
-typedef int (*modeventhand_t)(module_t mod, int /*modeventtype_t*/ what,
- void *arg);
+typedef int (*modeventhand_t)(module_t mod, modeventtype_t what, void *arg);
/*
* Struct for registering modules statically via SYSINIT.
*/
typedef struct moduledata {
- char *name; /* module name */
- modeventhand_t evhand; /* event handler */
- void *priv; /* extra data */
- void *_file; /* private; used by linker */
+ char* name; /* module name */
+ modeventhand_t evhand; /* event handler */
+ void* priv; /* extra data */
+ void* _file; /* private; used by linker */
} moduledata_t;
-/*
- * A module can use this to report module specific data to
- * the user via kldstat(2).
- */
-typedef union modspecific {
- int intval;
- u_int uintval;
- long longval;
- u_long ulongval;
-} modspecific_t;
-
#ifdef KERNEL
#define DECLARE_MODULE(name, data, sub, order) \
@@ -77,7 +66,6 @@ void module_release(module_t mod);
int module_unload(module_t mod);
int module_getid(module_t mod);
module_t module_getfnext(module_t mod);
-void module_setspecific(module_t mod, modspecific_t *datap);
#ifdef MOD_DEBUG
@@ -104,7 +92,6 @@ struct module_stat {
char name[MAXMODNAME];
int refs;
int id;
- modspecific_t data;
};
#ifndef KERNEL
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 4013068d7d7e7..01686e6b6f9d4 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mount.h 8.21 (Berkeley) 5/20/95
- * $Id: mount.h,v 1.72 1998/11/10 09:04:09 peter Exp $
+ * $Id: mount.h,v 1.68 1998/09/15 11:44:44 phk Exp $
*/
#ifndef _SYS_MOUNT_H_
@@ -73,7 +73,7 @@ struct statfs {
long f_ffree; /* free file nodes in fs */
fsid_t f_fsid; /* file system id */
uid_t f_owner; /* user that mounted the filesystem */
- int f_type; /* type of filesystem */
+ int f_type; /* type of filesystem (see below) */
int f_flags; /* copy of mount exported flags */
long f_syncwrites; /* count of sync writes since mount */
long f_asyncwrites; /* count of async writes since mount */
@@ -342,35 +342,56 @@ struct vfsops {
}; \
extern struct linker_set MODVNOPS; \
MOD_VFS(fsname,&MODVNOPS,&_fs_vfsconf); \
- int \
- fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver); \
+ extern int \
+ fsname ## _mod __P((struct lkm_table *, int, int)); \
int \
fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \
MOD_DISPATCH(fsname, \
- lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); } \
- struct __hack
-
+ lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); }
#else
#include <sys/module.h>
-
#define VFS_SET(vfsops, fsname, flags) \
- static struct vfsconf fsname ## _vfsconf = { \
- &vfsops, \
- #fsname, \
- -1, \
- 0, \
- flags \
- }; \
- static moduledata_t fsname ## _mod = { \
- #fsname, \
- vfs_modevent, \
- & fsname ## _vfsconf \
- }; \
- DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE)
+ static struct vfsconf fsname ## _vfsconf = { \
+ &vfsops, \
+ #fsname, \
+ -1, \
+ 0, \
+ flags | VFCF_STATIC, \
+ }; \
+ static int fsname ## _modevent(module_t mod, modeventtype_t type, \
+ void *data) \
+ { \
+ struct vfsconf *vfc = (struct vfsconf *)data; \
+ int error = 0; \
+ switch (type) { \
+ case MOD_LOAD: \
+ /* printf(#fsname " module load\n"); */ \
+ error = vfs_register(vfc); \
+ if (error) \
+ printf(#fsname " register failed\n"); \
+ break; \
+ case MOD_UNLOAD: \
+ /* printf(#fsname " module unload\n"); */ \
+ error = vfs_register(vfc); \
+ if (error) \
+ printf(#fsname " register failed\n"); \
+ break; \
+ } \
+ return error; \
+ } \
+ static moduledata_t fsname ## _mod = { \
+ #fsname, \
+ fsname ## _modevent, \
+ & fsname ## _vfsconf \
+ }; \
+ DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE);
#endif /* VFS_LKM */
+#endif /* KERNEL */
+
+#ifdef KERNEL
#include <net/radix.h>
#define AF_MAX 31 /* XXX */
@@ -411,7 +432,6 @@ struct netcred *vfs_export_lookup /* lookup host in fs export list */
int vfs_allocate_syncvnode __P((struct mount *));
void vfs_getnewfsid __P((struct mount *));
struct mount *vfs_getvfs __P((fsid_t *)); /* return vfs given fsid */
-int vfs_modevent __P((module_t, int, void *));
int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */
int vfs_rootmountalloc __P((char *, char *, struct mount **));
void vfs_unbusy __P((struct mount *, struct proc *));
diff --git a/sys/sys/mtio.h b/sys/sys/mtio.h
index 2a7b53c86f093..d6aaf27abfd31 100644
--- a/sys/sys/mtio.h
+++ b/sys/sys/mtio.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mtio.h 8.1 (Berkeley) 6/2/93
- * $Id: mtio.h,v 1.14 1998/12/21 22:14:02 mjacob Exp $
+ * $Id: mtio.h,v 1.10 1997/02/22 09:45:37 peter Exp $
*/
#ifndef _SYS_MTIO_H_
@@ -73,7 +73,8 @@ struct mtop {
#define MTSETBSIZ 10
-/* Set density values for device. Sets the value for the opened mode only. */
+/* Set density values for device. They are defined in the SCSI II spec */
+/* and range from 0 to 0x17. Sets the value for the opened mode only */
#define MTSETDNSTY 11
@@ -81,14 +82,11 @@ struct mtop {
#define MTEOD 13 /* Space to EOM */
#define MTCOMP 14 /* select compression mode 0=off, 1=def */
#define MTRETENS 15 /* re-tension tape */
-#define MTWSS 16 /* write setmark(s) */
-#define MTFSS 17 /* forward space setmark */
-#define MTBSS 18 /* backward space setmark */
#define MT_COMP_ENABLE 0xffffffff
#define MT_COMP_DISABLED 0xfffffffe
#define MT_COMP_UNSUPP 0xfffffffd
-#endif /* __FreeBSD__ */
+#endif
/* structure for MTIOCGET - mag tape get status command */
@@ -122,39 +120,6 @@ struct mtget {
/* end not yet implemented */
};
-/* structure for MTIOCERRSTAT - tape get error status command */
-/* really only supported for SCSI tapes right now */
-struct scsi_tape_errors {
- /*
- * These are latched from the last command that had a SCSI
- * Check Condition noted for these operations. The act
- * of issuing an MTIOCERRSTAT unlatches and clears them.
- */
- u_int8_t io_sense[32]; /* Last Sense Data For Data I/O */
- u_int32_t io_resid; /* residual count from last Data I/O */
- u_int8_t io_cdb[16]; /* Command that Caused the Last Data Sense */
- u_int8_t ctl_sense[32]; /* Last Sense Data For Control I/O */
- u_int32_t ctl_resid; /* residual count from last Control I/O */
- u_int8_t ctl_cdb[16]; /* Command that Caused the Last Control Sense */
- /*
- * These are the read and write cumulative error counters.
- * (how to reset cumulative error counters is not yet defined).
- * (not implemented as yet but space is being reserved for them)
- */
- struct {
- u_int32_t retries; /* total # retries performed */
- u_int32_t corrected; /* total # corrections performed */
- u_int32_t processed; /* total # corrections succssful */
- u_int32_t failures; /* total # corrections/retries failed */
- u_int64_t nbytes; /* total # bytes processed */
- } werr, rderr;
-};
-
-union mterrstat {
- struct scsi_tape_errors scsi_errstat;
- char _reserved_padding[256];
-};
-
/*
* Constants for mt_type byte. These are the same
* for controllers compatible with the types listed.
@@ -183,20 +148,8 @@ union mterrstat {
/* mag tape io control commands */
#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
-/* these two do not appear to be used anywhere */
#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */
#define MTIOCEEOT _IO('m', 4) /* enable EOT error */
-/*
- * When more SCSI-3 SSC (streaming device) devices are out there
- * that support the full 32 byte type 2 structure, we'll have to
- * rethink these ioctls to support all the entities they haul into
- * the picture (64 bit blocks, logical file record numbers, etc..).
- */
-#define MTIOCRDSPOS _IOR('m', 5, u_int32_t) /* get logical blk addr */
-#define MTIOCRDHPOS _IOR('m', 6, u_int32_t) /* get hardware blk addr */
-#define MTIOCSLOCATE _IOW('m', 5, u_int32_t) /* seek to logical blk addr */
-#define MTIOCHLOCATE _IOW('m', 6, u_int32_t) /* seek to hardware blk addr */
-#define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /* get tape errors */
#ifndef KERNEL
#define DEFTAPE "/dev/nrsa0"
diff --git a/sys/sys/param.h b/sys/sys/param.h
index badddcacc77f9..7cee6231695df 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)param.h 8.3 (Berkeley) 4/4/95
- * $Id: param.h,v 1.37 1998/10/16 04:28:04 jkh Exp $
+ * $Id: param.h,v 1.36 1998/09/03 08:28:42 asami Exp $
*/
#ifndef _SYS_PARAM_H_
@@ -46,7 +46,7 @@
#define BSD4_3 1
#define BSD4_4 1
#undef __FreeBSD_version
-#define __FreeBSD_version 300006 /* Master, propagated to newvers */
+#define __FreeBSD_version 300005 /* Master, propagated to newvers */
#ifndef NULL
#define NULL 0
diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h
index 9b06500d75c21..7454cdf7a3bae 100644
--- a/sys/sys/pipe.h
+++ b/sys/sys/pipe.h
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: pipe.h,v 1.11 1998/11/11 10:04:12 truckman Exp $
+ * $Id: pipe.h,v 1.9 1997/04/09 16:53:45 bde Exp $
*/
#ifndef _SYS_PIPE_H_
@@ -102,7 +102,7 @@ struct pipe {
struct timespec pipe_atime; /* time of last access */
struct timespec pipe_mtime; /* time of last modify */
struct timespec pipe_ctime; /* time of status change */
- struct sigio *pipe_sigio; /* information for async I/O */
+ int pipe_pgid; /* process/group for async I/O */
struct pipe *pipe_peer; /* link with other direction */
u_int pipe_state; /* pipe status info */
int pipe_busy; /* busy flag, mostly to handle rundown sanely */
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 1b7d5ad157107..2a7a7a39f5b27 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)proc.h 8.15 (Berkeley) 5/19/95
- * $Id: proc.h,v 1.65 1998/12/31 13:23:16 bde Exp $
+ * $Id: proc.h,v 1.57 1998/04/04 13:26:14 phk Exp $
*/
#ifndef _SYS_PROC_H_
@@ -47,15 +47,11 @@
#include <sys/rtprio.h> /* For struct rtprio. */
#include <sys/select.h> /* For struct selinfo. */
#include <sys/signal.h>
-#ifdef COMPAT_LINUX_THREADS
-#include <sys/signalvar.h>
-#endif /* COMPAT_LINUX_THREADS */
#ifndef KERNEL
#include <sys/time.h> /* For structs itimerval, timeval. */
#endif
#include <sys/ucred.h>
#include <sys/queue.h>
-#include <sys/filedesc.h>
/*
* One structure allocated per session.
@@ -65,7 +61,6 @@ struct session {
struct proc *s_leader; /* Session leader. */
struct vnode *s_ttyvp; /* Vnode of controlling terminal. */
struct tty *s_ttyp; /* Controlling terminal. */
- pid_t s_sid; /* Session ID */
char s_login[roundup(MAXLOGNAME, sizeof(long))]; /* Setlogin() name. */
};
@@ -76,32 +71,10 @@ struct pgrp {
LIST_ENTRY(pgrp) pg_hash; /* Hash chain. */
LIST_HEAD(, proc) pg_members; /* Pointer to pgrp members. */
struct session *pg_session; /* Pointer to session. */
- struct sigiolst pg_sigiolst; /* List of sigio sources. */
pid_t pg_id; /* Pgrp id. */
int pg_jobc; /* # procs qualifying pgrp for job control */
};
-#ifdef COMPAT_LINUX_THREADS
-struct procsig {
-#define ps_begincopy ps_sigignore
- sigset_t ps_sigignore; /* Signals being ignored. */
- sigset_t ps_sigcatch; /* Signals being caught by user. */
- int ps_flag;
- struct sigacts *ps_sigacts;
-#define ps_endcopy ps_refcnt
- int ps_refcnt;
-};
-#endif /* COMPAT_LINUX_THREADS */
-
-/*
- * pasleep structure, used by asleep() syscall to hold requested priority
- * and timeout values for await().
- */
-struct pasleep {
- int as_priority; /* Async priority. */
- int as_timo; /* Async timeout. */
-};
-
/*
* Description of a process.
*
@@ -123,14 +96,7 @@ struct proc {
struct pstats *p_stats; /* Accounting/statistics (PROC ONLY). */
struct plimit *p_limit; /* Process limits. */
struct vm_object *p_upages_obj;/* Upages object */
-#ifndef COMPAT_LINUX_THREADS
struct sigacts *p_sigacts; /* Signal actions, state (PROC ONLY). */
-#else
- struct procsig *p_procsig;
-#define p_sigacts p_procsig->ps_sigacts
-#define p_sigignore p_procsig->ps_sigignore
-#define p_sigcatch p_procsig->ps_sigcatch
-#endif
#define p_ucred p_cred->pc_ucred
#define p_rlimit p_limit->pl_rlimit
@@ -194,13 +160,6 @@ struct proc {
unsigned char p_pfsflags; /* procfs flags */
char p_pad3[2]; /* padding for alignment */
register_t p_retval[2]; /* syscall aux returns */
- struct sigiolst p_sigiolst; /* list of sigio sources */
-#ifdef COMPAT_LINUX_THREADS
- int p_sigparent; /* signal to parent on exit */
- sigset_t p_oldsigmask; /* saved mask from before sigpause */
- int p_sig; /* for core dump/debugger XXX */
- u_long p_code; /* for core dump/debugger XXX */
-#endif /* COMPAT_LINUX_THREADS */
/* End area that is zeroed on creation. */
#define p_endzero p_startcopy
@@ -209,10 +168,9 @@ struct proc {
#define p_startcopy p_sigmask
sigset_t p_sigmask; /* Current signal mask. */
-#ifndef COMPAT_LINUX_THREADS
sigset_t p_sigignore; /* Signals being ignored. */
sigset_t p_sigcatch; /* Signals being caught by user. */
-#endif /* COMPAT_LINUX_THREADS */
+
u_char p_priority; /* Process priority. */
u_char p_usrpri; /* User-priority based on p_cpu and p_nice. */
char p_nice; /* Process "nice" value. */
@@ -237,7 +195,6 @@ struct proc {
int p_wakeup; /* thread id */
struct proc *p_peers;
struct proc *p_leader;
- struct pasleep p_asleep; /* Used by asleep()/await(). */
};
#define p_session p_pgrp->pg_session
@@ -310,8 +267,8 @@ MALLOC_DECLARE(M_SUBPROC);
* We use process IDs <= PID_MAX; PID_MAX + 1 must also fit in a pid_t,
* as it is used to represent "no process group".
*/
-#define PID_MAX 99999
-#define NO_PID 100000
+#define PID_MAX 30000
+#define NO_PID 30001
#define SESS_LEADER(p) ((p)->p_session->s_leader == (p))
#define SESSHOLD(s) ((s)->s_count++)
@@ -388,11 +345,7 @@ void wakeup_one __P((void *chan));
void cpu_exit __P((struct proc *)) __dead2;
void exit1 __P((struct proc *, int)) __dead2;
void cpu_fork __P((struct proc *, struct proc *));
-#ifndef COMPAT_LINUX_THREADS
int fork1 __P((struct proc *, int));
-#else
-int fork1 __P((struct proc *, int));
-#endif /* COMPAT_LINUX_THREADS */
int trace_req __P((struct proc *));
void cpu_wait __P((struct proc *));
int cpu_coredump __P((struct proc *, struct vnode *, struct ucred *));
diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h
index 99a1d92dd7319..f016fc0f1cf3b 100644
--- a/sys/sys/protosw.h
+++ b/sys/sys/protosw.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)protosw.h 8.1 (Berkeley) 6/2/93
- * $Id: protosw.h,v 1.25 1998/08/23 03:07:17 wollman Exp $
+ * $Id: protosw.h,v 1.24 1998/06/07 17:13:03 dfr Exp $
*/
#ifndef _SYS_PROTOSW_H_
@@ -203,7 +203,6 @@ struct pr_usrreqs {
struct proc *p));
#define PRUS_OOB 0x1
#define PRUS_EOF 0x2
-#define PRUS_MORETOCOME 0x4
int (*pru_sense) __P((struct socket *so, struct stat *sb));
int (*pru_shutdown) __P((struct socket *so));
int (*pru_sockaddr) __P((struct socket *so,
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index 87a62a0e77812..2ada73c74896f 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $Id: queue.h,v 1.23 1999/01/06 20:03:11 n_hibma Exp $
+ * $Id: queue.h,v 1.21 1998/05/12 03:55:25 gibbs Exp $
*/
#ifndef _SYS_QUEUE_H_
@@ -133,7 +133,7 @@ struct { \
(head)->slh_first = NULL; \
}
-#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
(elm)->field.sle_next = (slistelm)->field.sle_next; \
(slistelm)->field.sle_next = (elm); \
} while (0)
@@ -171,9 +171,6 @@ struct name { \
struct type **stqh_last;/* addr of last next element */ \
}
-#define STAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).stqh_first }
-
#define STAILQ_ENTRY(type) \
struct { \
struct type *stqe_next; /* next element */ \
@@ -218,12 +215,6 @@ struct { \
(head)->stqh_last = &(head)->stqh_first; \
} while (0)
-#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \
- if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-} while (0)
-
-
#define STAILQ_REMOVE(head, elm, type, field) do { \
if ((head)->stqh_first == (elm)) { \
STAILQ_REMOVE_HEAD(head, field); \
@@ -246,9 +237,6 @@ struct name { \
struct type *lh_first; /* first element */ \
}
-#define LIST_HEAD_INITIALIZER(head) \
- { NULL }
-
#define LIST_ENTRY(type) \
struct { \
struct type *le_next; /* next element */ \
diff --git a/sys/sys/rman.h b/sys/sys/rman.h
deleted file mode 100644
index 224d9edc692a5..0000000000000
--- a/sys/sys/rman.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 1998 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that both the above copyright notice and this
- * permission notice appear in all copies, that both the above
- * copyright notice and this permission notice appear in all
- * supporting documentation, and that the name of M.I.T. not be used
- * in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. M.I.T. makes
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
- * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
- * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-#ifndef _SYS_RMAN_H_
-#define _SYS_RMAN_H_ 1
-
-#ifndef KERNEL
-#include <sys/queue.h>
-#endif /* !KERNEL */
-
-/*
- * We use a linked list rather than a bitmap because we need to be able to
- * represent potentially huge objects (like all of a processor's physical
- * address space). That is also why the indices are defined to have type
- * `unsigned long' -- that being the largest integral type in Standard C.
- */
-CIRCLEQ_HEAD(resource_head, resource);
-struct resource {
- CIRCLEQ_ENTRY(resource) r_link;
- LIST_ENTRY(resource) r_sharelink;
- LIST_HEAD(, resource) *r_sharehead;
- u_long r_start; /* index of the first entry in this resource */
- u_long r_end; /* index of the last entry (inclusive) */
- u_int r_flags;
- void *r_virtual; /* virtual address of this resource */
- struct device *r_dev; /* device which has allocated this resource */
- struct rman *r_rm; /* resource manager from whence this came */
-};
-
-#define RF_ALLOCATED 0x0001 /* resource has been reserved */
-#define RF_ACTIVE 0x0002 /* resource allocation has been activated */
-#define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */
-#define RF_TIMESHARE 0x0008 /* resource permits time-division sharing */
-#define RF_WANTED 0x0010 /* somebody is waiting for this resource */
-#define RF_FIRSTSHARE 0x0020 /* first in sharing list */
-
-enum rman_type { RMAN_UNINIT = 0, RMAN_GAUGE, RMAN_ARRAY };
-
-struct rman {
- struct resource_head rm_list;
- struct simplelock *rm_slock; /* mutex used to protect rm_list */
- TAILQ_ENTRY(rman) rm_link; /* link in list of all rmans */
- u_long rm_start; /* index of globally first entry */
- u_long rm_end; /* index of globally last entry */
- enum rman_type rm_type; /* what type of resource this is */
- const char *rm_descr; /* text descripion of this resource */
-};
-TAILQ_HEAD(rman_head, rman);
-
-#ifdef KERNEL
-
-int rman_activate_resource(struct resource *r);
-int rman_await_resource(struct resource *r, int pri, int timo);
-int rman_deactivate_resource(struct resource *r);
-int rman_fini(struct rman *rm);
-int rman_init(struct rman *rm);
-int rman_manage_region(struct rman *rm, u_long start, u_long end);
-int rman_release_resource(struct resource *r);
-struct resource *rman_reserve_resource(struct rman *rm, u_long start,
- u_long end, u_long count,
- u_int flags, struct device *dev);
-
-#define rman_set_virtual(r,v) ((r)->r_virtual = (v))
-#define rman_get_virtual(r) ((r)->r_virtual)
-
-extern struct rman_head rman_head;
-#endif /* KERNEL */
-
-#endif /* !_SYS_RMAN_H_ */
diff --git a/sys/sys/sem.h b/sys/sys/sem.h
index b51fc24675277..a57e9b886a71d 100644
--- a/sys/sys/sem.h
+++ b/sys/sys/sem.h
@@ -1,4 +1,4 @@
-/* $Id: sem.h,v 1.17 1998/12/14 21:01:47 dillon Exp $ */
+/* $Id: sem.h,v 1.14 1998/05/31 04:09:09 steve Exp $ */
/* $NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $ */
/*
@@ -140,15 +140,8 @@ extern struct seminfo seminfo;
#define SEMOPM 100 /* max # of operations per semop call */
#endif
-/*
- * Due to the way semaphore memory is allocated, we have to ensure that
- * SEMUSZ is properly aligned.
- */
-
-#define SEM_ALIGN(bytes) (((bytes) + (sizeof(long) - 1)) & ~(sizeof(long) - 1))
-
/* actual size of an undo structure */
-#define SEMUSZ SEM_ALIGN(offsetof(struct sem_undo, un_ent[SEMUME]))
+#define SEMUSZ (sizeof(struct sem_undo)+sizeof(struct undo)*SEMUME)
extern struct semid_ds *sema; /* semaphore id pool */
extern struct sem *sem; /* semaphore pool */
@@ -157,7 +150,7 @@ extern int *semu; /* undo structure pool */
/*
* Macro to find a particular sem_undo vector
*/
-#define SEMU(ix) ((struct sem_undo *)(((intptr_t)semu)+ix * seminfo.semusz))
+#define SEMU(ix) ((struct sem_undo *)(((intptr_t)semu)+ix * SEMUSZ))
/*
* Process sem_undo vectors at proc exit.
diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
index 658c6cb29c782..3976a4fd2ea38 100644
--- a/sys/sys/signalvar.h
+++ b/sys/sys/signalvar.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)signalvar.h 8.6 (Berkeley) 2/19/95
- * $Id: signalvar.h,v 1.21 1998/12/19 02:55:34 julian Exp $
+ * $Id: signalvar.h,v 1.18 1998/03/28 10:33:23 bde Exp $
*/
#ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */
@@ -55,15 +55,11 @@ struct sigacts {
sigset_t ps_sigintr; /* signals that interrupt syscalls */
sigset_t ps_sigreset; /* signals that reset when caught */
sigset_t ps_signodefer; /* signals not masked while handled */
-#ifndef COMPAT_LINUX_THREADS
sigset_t ps_oldmask; /* saved mask from before sigpause */
-#endif /* COMPAT_LINUX_THREADS */
int ps_flags; /* signal flags, below */
struct sigaltstack ps_sigstk; /* sp & on stack state variable */
-#ifndef COMPAT_LINUX_THREADS
int ps_sig; /* for core dump/debugger XXX */
u_long ps_code; /* for core dump/debugger XXX */
-#endif /* COMPAT_LINUX_THREADS */
sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */
};
@@ -156,7 +152,6 @@ static int sigprop[NSIG + 1] = {
#ifdef KERNEL
struct pgrp;
struct proc;
-struct sigio;
extern int sugid_coredump; /* Sysctl variable kern.sugid_coredump */
@@ -168,16 +163,13 @@ char *expand_name __P((const char*, int, int));
void gsignal __P((int pgid, int sig));
int issignal __P((struct proc *p));
void killproc __P((struct proc *p, char *why));
-void pgsigio __P((struct sigio *, int signum, int checkctty));
void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty));
void postsig __P((int sig));
void psignal __P((struct proc *p, int sig));
void sigexit __P((struct proc *p, int signum));
void siginit __P((struct proc *p));
void trapsignal __P((struct proc *p, int sig, u_long code));
-#ifdef COMPAT_LINUX_THREADS
-void check_sigacts (void);
-#endif
+
/*
* Machine-dependent functions:
*/
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index b7da75a1c5152..3c3d311c09263 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $Id: socket.h,v 1.26 1998/09/15 11:44:44 phk Exp $
+ * $Id: socket.h,v 1.25 1998/09/12 21:14:25 wollman Exp $
*/
#ifndef _SYS_SOCKET_H_
@@ -363,16 +363,6 @@ struct omsghdr {
#define SHUT_WR 1 /* shut down the writing side */
#define SHUT_RDWR 2 /* shut down both sides */
-/*
- * sendfile(2) header/trailer struct
- */
-struct sf_hdtr {
- struct iovec *headers; /* pointer to an array of header struct iovec's */
- int hdr_cnt; /* number of header iovec's */
- struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
- int trl_cnt; /* number of trailer iovec's */
-};
-
#ifndef KERNEL
#include <sys/cdefs.h>
@@ -392,7 +382,6 @@ ssize_t send __P((int, const void *, size_t, int));
ssize_t sendto __P((int, const void *,
size_t, int, const struct sockaddr *, int));
ssize_t sendmsg __P((int, const struct msghdr *, int));
-int sendfile __P((int, int, off_t, size_t, struct sf_hdtr *, off_t *, int));
int setsockopt __P((int, int, int, const void *, int));
int shutdown __P((int, int));
int socket __P((int, int, int));
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 4f9c07acfa0b5..86c17edcf0fc5 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)socketvar.h 8.3 (Berkeley) 2/19/95
- * $Id: socketvar.h,v 1.31 1998/11/11 10:04:13 truckman Exp $
+ * $Id: socketvar.h,v 1.28 1998/06/07 17:13:03 dfr Exp $
*/
#ifndef _SYS_SOCKETVAR_H_
@@ -77,8 +77,7 @@ struct socket {
short so_qlimit; /* max number queued connections */
short so_timeo; /* connection timeout */
u_short so_error; /* error affecting connection */
- struct sigio *so_sigio; /* information for async I/O or
- out of band data (SIGURG) */
+ pid_t so_pgid; /* pgid for signals */
u_long so_oobmark; /* chars to oob mark */
/*
* Variables for socket buffering.
@@ -257,13 +256,6 @@ struct sockopt {
struct proc *sopt_p; /* calling process or null if kernel */
};
-struct sf_buf {
- SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */
- int refcnt; /* reference count */
- struct vm_page *m; /* currently mapped page */
- vm_offset_t kva; /* va of mapping */
-};
-
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_PCB);
MALLOC_DECLARE(M_SONAME);
diff --git a/sys/sys/syscall-hide.h b/sys/sys/syscall-hide.h
index 814bfecbd0c12..dd8fab9ef3d3a 100644
--- a/sys/sys/syscall-hide.h
+++ b/sys/sys/syscall-hide.h
@@ -2,7 +2,7 @@
* System call hiders.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
HIDE_POSIX(fork)
@@ -247,5 +247,3 @@ HIDE_POSIX(sched_get_priority_max)
HIDE_POSIX(sched_get_priority_min)
HIDE_POSIX(sched_rr_get_interval)
HIDE_BSD(utrace)
-HIDE_BSD(sendfile)
-HIDE_BSD(kldsym)
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index 464ea91cb7ba8..ae58e240707d7 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
#define SYS_syscall 0
@@ -253,6 +253,4 @@
#define SYS_sched_get_priority_min 333
#define SYS_sched_rr_get_interval 334
#define SYS_utrace 335
-#define SYS_sendfile 336
-#define SYS_kldsym 337
-#define SYS_MAXSYSCALL 338
+#define SYS_MAXSYSCALL 336
diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk
index 581290a0f350c..5d5bd0f03da23 100644
--- a/sys/sys/syscall.mk
+++ b/sys/sys/syscall.mk
@@ -1,6 +1,6 @@
# FreeBSD system call names.
# DO NOT EDIT-- this file is automatically generated.
-# created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+# created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
MIASM = \
syscall.o \
exit.o \
@@ -208,6 +208,4 @@ MIASM = \
sched_get_priority_max.o \
sched_get_priority_min.o \
sched_rr_get_interval.o \
- utrace.o \
- sendfile.o \
- kldsym.o
+ utrace.o
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 89cf9c08adcca..9e7df739f3442 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
- * $Id: sysctl.h,v 1.68 1998/12/27 18:03:29 dfr Exp $
+ * $Id: sysctl.h,v 1.64 1998/09/05 14:13:35 bde Exp $
*/
#ifndef _SYS_SYSCTL_H_
@@ -78,7 +78,6 @@ struct ctlname {
#define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR)
#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */
#define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */
-#define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */
/*
* USE THIS instead of a hardwired number from the categories below
@@ -156,10 +155,15 @@ int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
ptr, val, sysctl_handle_int, "I", descr)
-/* Oid for a long. The pointer must be non NULL. */
-#define SYSCTL_LONG(parent, nbr, name, access, ptr, descr) \
+/* Oid for a long. If ptr is NULL, val is returned. */
+#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
- ptr, 0, sysctl_handle_long, "L", descr)
+ ptr, val, sysctl_handle_long, "L", descr)
+
+/* Oid for an intptr_t. If ptr is NULL, val is returned. */
+#define SYSCTL_INTPTR(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
+ ptr, val, sysctl_handle_intptr, "P", descr)
/* Oid for an opaque object. Specified by a pointer and a length. */
#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 9bfc9788eca0b..114fe35817dbc 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sysent.h,v 1.19 1998/09/14 05:36:51 jdp Exp $
+ * $Id: sysent.h,v 1.18 1998/06/07 17:13:03 dfr Exp $
*/
#ifndef _SYS_SYSENT_H_
@@ -76,36 +76,6 @@ struct sysentvec {
#ifdef KERNEL
extern struct sysentvec aout_sysvec;
extern struct sysent sysent[];
-
-#define NO_SYSCALL (-1)
-
-struct module;
-
-struct syscall_module_data {
- int (*chainevh)(struct module *, int, void *); /* next handler */
- void *chainarg; /* arg for next event handler */
- int *offset; /* offset into sysent */
- struct sysent *new_sysent; /* new sysent */
- struct sysent old_sysent; /* old sysent */
-};
-
-#define SYSCALL_MODULE(name, offset, new_sysent, evh, arg) \
-static struct syscall_module_data name##_syscall_mod = { \
- evh, arg, offset, new_sysent \
-}; \
- \
-static moduledata_t name##_mod = { \
- #name, \
- syscall_module_handler, \
- &name##_syscall_mod \
-}; \
-DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
-
-int syscall_register __P((int *offset, struct sysent *new_sysent,
- struct sysent *old_sysent));
-int syscall_deregister __P((int *offset, struct sysent *old_sysent));
-int syscall_module_handler __P((struct module *mod, int what, void *arg));
-
-#endif /* KERNEL */
+#endif
#endif /* !_SYS_SYSENT_H_ */
diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h
index 71f949229aaaa..40ee5bd83b8db 100644
--- a/sys/sys/sysproto.h
+++ b/sys/sys/sysproto.h
@@ -2,7 +2,7 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from Id: syscalls.master,v 1.55 1998/11/11 12:45:14 peter Exp
+ * created from Id: syscalls.master,v 1.53 1998/08/24 08:29:52 dfr Exp
*/
#ifndef _SYS_SYSPROTO_H_
@@ -879,20 +879,6 @@ struct utrace_args {
caddr_t addr; char addr_[PAD_(caddr_t)];
size_t len; char len_[PAD_(size_t)];
};
-struct sendfile_args {
- int fd; char fd_[PAD_(int)];
- int s; char s_[PAD_(int)];
- off_t offset; char offset_[PAD_(off_t)];
- size_t nbytes; char nbytes_[PAD_(size_t)];
- struct sf_hdtr * hdtr; char hdtr_[PAD_(struct sf_hdtr *)];
- off_t * sbytes; char sbytes_[PAD_(off_t *)];
- int flags; char flags_[PAD_(int)];
-};
-struct kldsym_args {
- int fileid; char fileid_[PAD_(int)];
- int cmd; char cmd_[PAD_(int)];
- void * data; char data_[PAD_(void *)];
-};
int nosys __P((struct proc *, struct nosys_args *));
void exit __P((struct proc *, struct rexit_args *)) __dead2;
int fork __P((struct proc *, struct fork_args *));
@@ -1098,8 +1084,6 @@ int sched_get_priority_max __P((struct proc *, struct sched_get_priority_max_arg
int sched_get_priority_min __P((struct proc *, struct sched_get_priority_min_args *));
int sched_rr_get_interval __P((struct proc *, struct sched_rr_get_interval_args *));
int utrace __P((struct proc *, struct utrace_args *));
-int sendfile __P((struct proc *, struct sendfile_args *));
-int kldsym __P((struct proc *, struct kldsym_args *));
#ifdef COMPAT_43
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index c0cc60cab34f2..2b3236ad5f9ad 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)systm.h 8.7 (Berkeley) 3/29/95
- * $Id: systm.h,v 1.83 1999/01/15 00:03:39 msmith Exp $
+ * $Id: systm.h,v 1.76 1998/09/15 10:07:26 gibbs Exp $
*/
#ifndef _SYS_SYSTM_H_
@@ -76,12 +76,6 @@ extern struct vnode *swapdev_vp;/* vnode for swap device */
extern int boothowto; /* reboot flags, from console subsystem */
extern int bootverbose; /* nonzero to print verbose messages */
-#ifdef INVARIANTS /* The option is always available */
-#define KASSERT(exp,msg) do { if (!(exp)) panic msg; } while (0)
-#else
-#define KASSERT(exp,msg)
-#endif
-
/*
* General function declarations.
*/
@@ -113,17 +107,11 @@ int kvprintf __P((char const *, void (*)(int, void*), void *, int,
void log __P((int, const char *, ...)) __printflike(2, 3);
void logwakeup __P((void));
int printf __P((const char *, ...)) __printflike(1, 2);
-int snprintf __P((char *, size_t, const char *, ...)) __printflike(3, 4);
int sprintf __P((char *buf, const char *, ...)) __printflike(2, 3);
void uprintf __P((const char *, ...)) __printflike(1, 2);
void vprintf __P((const char *, _BSD_VA_LIST_)) __printflike(1, 0);
-int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_)) __printflike(3, 0);
int vsprintf __P((char *buf, const char *, _BSD_VA_LIST_)) __printflike(2, 0);
void ttyprintf __P((struct tty *, const char *, ...)) __printflike(2, 3);
-int sscanf __P((const char *, char const *, ...));
-int vsscanf __P((const char *, char const *, _BSD_VA_LIST_));
-u_quad_t strtouq __P((const char *, char **, int));
-quad_t strtoq __P((const char *, char **, int base));
void bcopy __P((const void *from, void *to, size_t len));
void ovbcopy __P((const void *from, void *to, size_t len));
@@ -163,7 +151,6 @@ void setstatclockrate __P((int hzrate));
void hardpps __P((struct timeval *tvp, long usec));
char *getenv __P((char *name));
-int getenv_int __P((char *name, int *data));
extern char *kern_envp;
#ifdef APM_FIXUP_CALLTODO
@@ -280,14 +267,10 @@ int rm_at_fork __P((forklist_fn function));
#define SHUTDOWN_PRE_SYNC 0
#define SHUTDOWN_POST_SYNC 1
#define SHUTDOWN_FINAL 2
-#define SHUTDOWN_PRI_FIRST 0
-#define SHUTDOWN_PRI_DEFAULT 10000
-#define SHUTDOWN_PRI_LAST 20000
typedef void (*bootlist_fn) __P((int, void *));
int at_shutdown __P((bootlist_fn function, void *arg, int position));
-int at_shutdown_pri __P((bootlist_fn function, void *arg, int position, int pri));
int rm_at_shutdown __P((bootlist_fn function, void *arg));
/*
@@ -306,8 +289,6 @@ extern watchdog_tickle_fn wdog_tickler;
* less often.
*/
int tsleep __P((void *chan, int pri, const char *wmesg, int timo));
-int asleep __P((void *chan, int pri, const char *wmesg, int timo));
-int await __P((int pri, int timo));
void wakeup __P((void *chan));
#endif /* !_SYS_SYSTM_H_ */
diff --git a/sys/sys/time.h b/sys/sys/time.h
index b6b7d288e8e90..e17de0474fa20 100644
--- a/sys/sys/time.h
+++ b/sys/sys/time.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
- * $Id: time.h,v 1.34 1998/10/23 10:42:42 phk Exp $
+ * $Id: time.h,v 1.32 1998/06/07 20:36:55 phk Exp $
*/
#ifndef _SYS_TIME_H_
@@ -56,16 +56,14 @@ struct timespec {
};
#endif
-#define TIMEVAL_TO_TIMESPEC(tv, ts) \
- do { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
- } while (0)
-#define TIMESPEC_TO_TIMEVAL(tv, ts) \
- do { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
- } while (0)
+#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+}
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+}
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
@@ -141,6 +139,7 @@ struct timecounter {
char *tc_name;
void *tc_priv;
/* These fields will be managed by the generic code. */
+ int tc_cost;
int32_t tc_adjustment;
u_int32_t tc_scale_micro;
u_int32_t tc_scale_nano_i;
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 1e1a094df9190..d3dd4df6bbf38 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.h 8.6 (Berkeley) 1/21/94
- * $Id: tty.h,v 1.43 1998/11/11 10:04:13 truckman Exp $
+ * $Id: tty.h,v 1.41 1998/03/07 15:36:25 bde Exp $
*/
#ifndef _SYS_TTY_H_
@@ -79,7 +79,6 @@ struct tty {
int t_timeout; /* Timeout for ttywait() */
struct pgrp *t_pgrp; /* Foreground process group. */
struct session *t_session; /* Enclosing session. */
- struct sigio *t_sigio; /* Information for async I/O. */
struct selinfo t_rsel; /* Tty read/oob select. */
struct selinfo t_wsel; /* Tty write select. */
struct termios t_termios; /* Termios state. */
diff --git a/sys/sys/ttycom.h b/sys/sys/ttycom.h
index a181b77daa5e0..f2e491bc507b0 100644
--- a/sys/sys/ttycom.h
+++ b/sys/sys/ttycom.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ttycom.h 8.1 (Berkeley) 3/28/94
- * $Id: ttycom.h,v 1.12 1997/02/22 09:46:14 peter Exp $
+ * $Id$
*/
#ifndef _SYS_TTYCOM_H_
@@ -130,6 +130,8 @@ struct winsize {
* of last DCd rise */
#define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */
#define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */
+#define TIOCDSIMICROCODE _IO('t', 85) /* download microcode to
+ * DSI Softmodem */
#define TTYDISC 0 /* termios tty line discipline */
#define TABLDISC 3 /* tablet discipline */
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 93f8698e67866..085825bee890c 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)types.h 8.6 (Berkeley) 2/19/95
- * $Id: types.h,v 1.25 1998/06/07 17:13:05 dfr Exp $
+ * $Id: types.h,v 1.24 1998/02/24 02:11:39 bde Exp $
*/
#ifndef _SYS_TYPES_H_
@@ -45,7 +45,7 @@
#include <sys/cdefs.h>
/* Machine type dependent parameters. */
-#include <sys/inttypes.h> /* includes <machine/ansi.h> */
+#include <machine/ansi.h>
#include <machine/types.h>
#ifndef _POSIX_SOURCE
@@ -57,11 +57,6 @@ typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
#endif
-typedef __uint8_t u_int8_t;
-typedef __uint16_t u_int16_t;
-typedef __uint32_t u_int32_t;
-typedef __uint64_t u_int64_t;
-
typedef u_int64_t u_quad_t; /* quads */
typedef int64_t quad_t;
typedef quad_t * qaddr_t;
@@ -84,12 +79,10 @@ typedef int64_t segsz_t; /* segment size */
typedef int32_t segsz_t; /* segment size */
#endif
typedef int32_t swblk_t; /* swap offset */
-typedef int32_t ufs_daddr_t;
typedef u_int32_t uid_t; /* user id */
#ifdef KERNEL
typedef int boolean_t;
-typedef u_int64_t uoff_t;
typedef struct vm_page *vm_page_t;
#endif
@@ -136,6 +129,21 @@ typedef _BSD_TIMER_T_ timer_t;
#undef _BSD_TIMER_T_
#endif
+#ifdef _BSD_UINT8_T_
+typedef _BSD_UINT8_T_ uint8_t;
+#undef _BSD_UINT8_T_
+#endif
+
+#ifdef _BSD_UINT16_T_
+typedef _BSD_UINT16_T_ uint16_t;
+#undef _BSD_UINT16_T_
+#endif
+
+#ifdef _BSD_UINT32_T_
+typedef _BSD_UINT32_T_ uint32_t;
+#undef _BSD_UINT32_T_
+#endif
+
#ifndef _POSIX_SOURCE
#define NBBY 8 /* number of bits in a byte */
diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h
index d6216039f6b92..b96572d6f8e10 100644
--- a/sys/sys/unistd.h
+++ b/sys/sys/unistd.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)unistd.h 8.2 (Berkeley) 1/7/94
- * $Id: unistd.h,v 1.18 1998/12/19 02:55:34 julian Exp $
+ * $Id: unistd.h,v 1.16 1998/03/08 17:25:38 dufault Exp $
*/
#ifndef _SYS_UNISTD_H_
@@ -186,8 +186,6 @@
#define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */
#define RFCFDG (1<<12) /* zero fd table */
#define RFTHREAD (1<<13) /* enable kernel thread support */
-#define RFSIGSHARE (1<<14) /* share signal handlers */
-#define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */
#define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */
#endif /* !_POSIX_SOURCE */
diff --git a/sys/sys/user.h b/sys/sys/user.h
index 2f8e393f09344..9a34940977b25 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)user.h 8.2 (Berkeley) 9/23/93
- * $Id: user.h,v 1.18 1999/01/07 21:23:47 julian Exp $
+ * $Id: user.h,v 1.15 1998/03/28 10:33:24 bde Exp $
*/
#ifndef _SYS_USER_H_
@@ -69,9 +69,6 @@ struct kinfo_proc {
struct session *e_sess; /* session pointer */
struct pcred e_pcred; /* process credentials */
struct ucred e_ucred; /* current credentials */
-#ifdef COMPAT_LINUX_THREADS
- struct procsig e_procsig; /* shared signal structure */
-#endif
struct vmspace e_vm; /* address space */
pid_t e_ppid; /* parent process id */
pid_t e_pgid; /* process group id */
@@ -104,8 +101,10 @@ void fill_eproc __P((struct proc *, struct eproc *));
struct user {
struct pcb u_pcb;
+
struct sigacts u_sigacts; /* p_sigacts points here (use it!) */
struct pstats u_stats; /* p_stats points here (use it!) */
+
/*
* Remaining fields only for core dump and/or ptrace--
* not valid at other times!
@@ -128,13 +127,8 @@ struct user {
#define U_tsize u_kproc.kp_eproc.e_vm.vm_tsize
#define U_dsize u_kproc.kp_eproc.e_vm.vm_dsize
#define U_ssize u_kproc.kp_eproc.e_vm.vm_ssize
-#ifndef COMPAT_LINUX_THREADS
#define U_sig u_sigacts.ps_sig
#define U_code u_sigacts.ps_code
-#else
-#define U_sig u_kproc.kp_proc.p_sig
-#define U_code u_kproc.kp_proc.p_code
-#endif /* COMPAT_LINUX_THREADS */
#ifndef KERNEL
#define u_ar0 U_ar0
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index f5c54b11c5337..5567a3a5e0796 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
- * $Id: vnode.h,v 1.79 1999/01/05 18:50:01 eivind Exp $
+ * $Id: vnode.h,v 1.74 1998/09/11 18:50:16 rvb Exp $
*/
#ifndef _SYS_VNODE_H_
@@ -69,7 +69,7 @@ enum vtagtype {
* Each underlying filesystem allocates its own private area and hangs
* it from v_data. If non-null, this area is freed in getnewvnode().
*/
-TAILQ_HEAD(buflists, buf);
+LIST_HEAD(buflists, buf);
typedef int vop_t __P((void *));
struct namecache;
@@ -125,10 +125,6 @@ struct vnode {
short vpi_events; /* what they are looking for */
short vpi_revents; /* what has happened */
} v_pollinfo;
-#ifdef DEBUG_LOCKS
- const char *filename; /* Source file doing locking */
- int line; /* Line number doing locking */
-#endif
};
#define v_mountedhere v_un.vu_mountedhere
#define v_socket v_un.vu_socket
@@ -246,6 +242,7 @@ extern int vttoif_tab[];
#define WRITECLOSE 0x0004 /* vflush: only close writable files */
#define DOCLOSE 0x0008 /* vclean: close active files */
#define V_SAVE 0x0001 /* vinvalbuf: sync file first */
+#define V_SAVEMETA 0x0002 /* vinvalbuf: leave indirect blocks */
#define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */
#define VREF(vp) vref(vp)
@@ -263,8 +260,7 @@ extern int vttoif_tab[];
#define VNODEOP_SET(f) DATA_SET(MODVNOPS,f)
#else
#define VNODEOP_SET(f) \
- SYSINIT(f##init, SI_SUB_VFS, SI_ORDER_SECOND, vfs_add_vnodeops, &f); \
- SYSUNINIT(f##uninit, SI_SUB_VFS, SI_ORDER_SECOND, vfs_rm_vnodeops, &f);
+ SYSINIT(f##init, SI_SUB_VFS, SI_ORDER_SECOND, vfs_mod_opv_init, &f);
#endif
/*
@@ -492,8 +488,8 @@ void vattr_null __P((struct vattr *vap));
int vcount __P((struct vnode *vp));
void vdrop __P((struct vnode *));
int vfinddev __P((dev_t dev, enum vtype type, struct vnode **vpp));
-void vfs_add_vnodeops __P((void *));
-void vfs_rm_vnodeops __P((void *));
+void vfs_opv_init __P((struct vnodeopv_desc *opv));
+void vfs_mod_opv_init __P((void *handle));
int vflush __P((struct mount *mp, struct vnode *skipvp, int flags));
int vget __P((struct vnode *vp, int lockflag, struct proc *p));
void vgone __P((struct vnode *vp));
@@ -509,11 +505,6 @@ int vrecycle __P((struct vnode *vp, struct simplelock *inter_lkp,
int vn_close __P((struct vnode *vp,
int flags, struct ucred *cred, struct proc *p));
int vn_lock __P((struct vnode *vp, int flags, struct proc *p));
-#ifdef DEBUG_LOCKS
-int debug_vn_lock __P((struct vnode *vp, int flags, struct proc *p,
- const char *filename, int line));
-#define vn_lock(vp,flags,p) debug_vn_lock(vp,flags,p,__FILE__,__LINE__)
-#endif
int vn_open __P((struct nameidata *ndp, int fmode, int cmode));
void vn_pollevent __P((struct vnode *vp, int events));
void vn_pollgone __P((struct vnode *vp));
@@ -525,7 +516,7 @@ int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p));
void vn_syncer_add_to_worklist __P((struct vnode *vp, int delay));
int vfs_cache_lookup __P((struct vop_lookup_args *ap));
int vfs_object_create __P((struct vnode *vp, struct proc *p,
- struct ucred *cred));
+ struct ucred *cred, int waslocked));
int vn_writechk __P((struct vnode *vp));
int vop_stdbwrite __P((struct vop_bwrite_args *ap));
int vop_stdislocked __P((struct vop_islocked_args *));
@@ -545,7 +536,6 @@ int vop_einval __P((struct vop_generic_args *ap));
int vop_enotty __P((struct vop_generic_args *ap));
int vop_defaultop __P((struct vop_generic_args *ap));
int vop_null __P((struct vop_generic_args *ap));
-int vop_panic __P((struct vop_generic_args *ap));
struct vnode *
checkalias __P((struct vnode *vp, dev_t nvp_rdev, struct mount *mp));
diff --git a/sys/sys/xrpuio.h b/sys/sys/xrpuio.h
deleted file mode 100644
index a5eca5631e112..0000000000000
--- a/sys/sys/xrpuio.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * ----------------------------------------------------------------------------
- * "THE BEER-WARE LICENSE" (Revision 42):
- * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
- * ----------------------------------------------------------------------------
- *
- * $Id$
- *
- */
-
-#ifndef _SYS_XRPUIO_H_
-#define _SYS_XRPUIO_H_
-
-#include <sys/ioccom.h>
-
-#define XRPU_MAX_PPS 16
-struct xrpu_timecounting {
-
- /* The timecounter itself */
- u_int xt_addr_trigger;
- u_int xt_addr_latch;
- unsigned xt_mask;
- u_int32_t xt_frequency;
- char xt_name[16];
-
- /* The PPS latches */
- struct {
- u_int xt_addr_assert;
- u_int xt_addr_clear;
- } xt_pps[XRPU_MAX_PPS];
-};
-
-#define XRPU_IOC_TIMECOUNTING _IOW('6', 1, struct xrpu_timecounting)
-
-#endif /* _SYS_XRPUIO_H_ */
diff --git a/sys/ufs/ffs/README b/sys/ufs/ffs/README
deleted file mode 100644
index 8a7433b61e9eb..0000000000000
--- a/sys/ufs/ffs/README
+++ /dev/null
@@ -1,320 +0,0 @@
-Introduction
-
-This package constitutes the alpha distribution of the soft update
-code updates for the fast filesystem.
-
-For More information on what Soft Updates is, see:
-http://www.ece.cmu.edu/~ganger/papers/CSE-TR-254-95/
-
-Status
-
-My `filesystem torture tests' (described below) run for days without
-a hitch (no panic's, hangs, filesystem corruption, or memory leaks).
-However, I have had several panic's reported to me by folks that
-are field testing the code which I have not yet been able to
-reproduce or fix. Although these panic's are rare and do not cause
-filesystem corruption, the code should only be put into production
-on systems where the system administrator is aware that it is being
-run, and knows how to turn it off if problems arise. Thus, you may
-hand out this code to others, but please ensure that this status
-message is included with any distributions. Please also include
-the file ffs_softdep.stub.c in any distributions so that folks that
-cannot abide by the need to redistribute source will not be left
-with a kernel that will not link. It will resolve all the calls
-into the soft update code and simply ignores the request to enable
-them. Thus you will be able to ensure that your other hooks have
-not broken anything and that your kernel is softdep-ready for those
-that wish to use them. Please report problems back to me with
-kernel backtraces of panics if possible. This is massively complex
-code, and people only have to have their filesystems hosed once or
-twice to avoid future changes like the plague. I want to find and
-fix as many bugs as soon as possible so as to get the code rock
-solid before it gets widely released. Please report any bugs that
-you uncover to mckusick@mckusick.com.
-
-Performance
-
-Running the Andrew Benchmarks yields the following raw data:
-
- Phase Normal Softdep What it does
- 1 3s <1s Creating directories
- 2 8s 4s Copying files
- 3 6s 6s Recursive directory stats
- 4 8s 9s Scanning each file
- 5 25s 25s Compilation
-
- Normal: 19.9u 29.2s 0:52.8 135+630io
- Softdep: 20.3u 28.5s 0:47.8 103+363io
-
-Another interesting datapoint are my `filesystem torture tests'.
-They consist of 1000 runs of the andrew benchmarks, 1000 copy and
-removes of /etc with randomly selected pauses of 0-60 seconds
-between each copy and remove, and 500 find from / with randomly
-selected pauses of 100 seconds between each run). The run of the
-torture test compares as follows:
-
-With soft updates: writes: 6 sync, 1,113,686 async; run time 19hr, 50min
-Normal filesystem: writes: 1,459,147 sync, 487,031 async; run time 27hr, 15min
-
-The upshot is 42% less I/O and 28% shorter running time.
-
-Another interesting test point is a full MAKEDEV. Because it runs
-as a shell script, it becomes mostly limited by the execution speed
-of the machine on which it runs. Here are the numbers:
-
-With soft updates:
-
- labrat# time ./MAKEDEV std
- 2.2u 32.6s 0:34.82 100.0% 0+0k 11+36io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Without soft updates:
-
- labrat# time ./MAKEDEV std
- 2.0u 40.5s 0:42.53 100.0% 0+0k 11+1221io 0pf+0w
-
- labrat# ls | wc
- 522 522 3317
-
-Of course, some of the system time is being pushed
-to the syncer process, but that is a different story.
-
-To show a benchmark designed to highlight the soft update code
-consider a tar of zero-sized files and an rm -rf of a directory tree
-that has at least 50 files or so at each level. Running a test with
-a directory tree containing 28 directories holding 202 empty files
-produces the following numbers:
-
-With soft updates:
-tar: 0.0u 0.5s 0:00.65 76.9% 0+0k 0+44io 0pf+0w (0 sync, 33 async writes)
-rm: 0.0u 0.2s 0:00.20 100.0% 0+0k 0+37io 0pf+0w (0 sync, 72 async writes)
-
-Normal filesystem:
-tar: 0.0u 1.1s 0:07.27 16.5% 0+0k 60+586io 0pf+0w (523 sync, 0 async writes)
-rm: 0.0u 0.5s 0:01.84 29.3% 0+0k 0+318io 0pf+0w (258 sync, 65 async writes)
-
-The large reduction in writes is because inodes are clustered, so
-most of a block gets allocated, then the whole block is written
-out once rather than having the same block written once for each
-inode allocated from it. Similarly each directory block is written
-once rather than once for each new directory entry. Effectively
-what the update code is doing is allocating a bunch of inodes
-and directory entries without writing anything, then ensuring that
-the block containing the inodes is written first followed by the
-directory block that references them. If there were data in the
-files it would further ensure that the data blocks were written
-before their inodes claimed them.
-
-Copyright Restrictions
-
-Please familiarize yourself with the copyright restrictions
-contained at the top of either the sys/ufs/ffs/softdep.h or
-sys/ufs/ffs/ffs_softdep.c file. The key provision is similar
-to the one used by the DB 2.0 package and goes as follows:
-
- Redistributions in any form must be accompanied by information
- on how to obtain complete source code for any accompanying
- software that uses the this software. This source code must
- either be included in the distribution or be available for
- no more than the cost of distribution plus a nominal fee,
- and must be freely redistributable under reasonable
- conditions. For an executable file, complete source code
- means the source code for all modules it contains. It does
- not mean source code for modules or files that typically
- accompany the operating system on which the executable file
- runs, e.g., standard library modules or system header files.
-
-The idea is to allow those of you freely redistributing your source
-to use it while retaining for myself the right to peddle it for
-money to the commercial UNIX vendors. Note that I have included a
-stub file ffs_softdep.c.stub that is freely redistributable so that
-you can put in all the necessary hooks to run the full soft updates
-code, but still allow vendors that want to maintain proprietary
-source to have a working system. I do plan to release the code with
-a `Berkeley style' copyright once I have peddled it around to the
-commercial vendors. If you have concerns about this copyright,
-feel free to contact me with them and we can try to resolve any
-difficulties.
-
-Soft Dependency Operation
-
-The soft update implementation does NOT require ANY changes
-to the on-disk format of your filesystems. Furthermore it is
-not used by default for any filesystems. It must be enabled on
-a filesystem by filesystem basis by running tunefs to set a
-bit in the superblock indicating that the filesystem should be
-managed using soft updates. If you wish to stop using
-soft updates due to performance or reliability reasons,
-you can simply run tunefs on it again to turn off the bit and
-revert to normal operation. The additional dynamic memory load
-placed on the kernel malloc arena is approximately equal to
-the amount of memory used by vnodes plus inodes (for a system
-with 1000 vnodes, the additional peak memory load is about 300K).
-
-Kernel Changes
-
-There are two new changes to the kernel functionality that are not
-contained in in the soft update files. The first is a `trickle
-sync' facility running in the kernel as process 3. This trickle
-sync process replaces the traditional `update' program (which should
-be commented out of the /etc/rc startup script). When a vnode is
-first written it is placed 30 seconds down on the trickle sync
-queue. If it still exists and has dirty data when it reaches the
-top of the queue, it is sync'ed. This approach evens out the load
-on the underlying I/O system and avoids writing short-lived files.
-The papers on trickle-sync tend to favor aging based on buffers
-rather than files. However, I sync on file age rather than buffer
-age because the data structures are much smaller as there are
-typically far fewer files than buffers. Although this can make the
-I/O spikey when a big file times out, it is still much better than
-the wholesale sync's that were happening before. It also adapts
-much better to the soft update code where I want to control
-aging to improve performance (inodes age in 10 seconds, directories
-in 15 seconds, files in 30 seconds). This ensures that most
-dependencies are gone (e.g., inodes are written when directory
-entries want to go to disk) reducing the amount of rollback that
-is needed.
-
-The other main kernel change is to split the vnode freelist into
-two separate lists. One for vnodes that are still being used to
-identify buffers and the other for those vnodes no longer identifying
-any buffers. The latter list is used by getnewvnode in preference
-to the former.
-
-Packaging of Kernel Changes
-
-The sys subdirectory contains the changes and additions to the
-kernel. My goal in writing this code was to minimize the changes
-that need to be made to the kernel. Thus, most of the new code
-is contained in the two new files softdep.h and ffs_softdep.c.
-The rest of the kernel changes are simply inserting hooks to
-call into these two new files. Although there has been some
-structural reorganization of the filesystem code to accommodate
-gathering the information required by the soft update code,
-the actual ordering of filesystem operations when soft updates
-are disabled is unchanged.
-
-The kernel changes are packaged as a set of diffs. As I am
-doing my development in BSD/OS, the diffs are relative to the
-BSD/OS versions of the files. Because BSD/OS recently had
-4.4BSD-Lite2 merged into it, the Lite2 files are a good starting
-point for figuring out the changes. There are 40 files that
-require change plus the two new files. Most of these files have
-only a few lines of changes in them. However, four files have
-fairly extensive changes: kern/vfs_subr.c, ufs/ufs/ufs_lookup.c,
-ufs/ufs/ufs_vnops.c, and ufs/ffs/ffs_alloc.c. For these four
-files, I have provided the original Lite2 version, the Lite2
-version with the diffs merged in, and the diffs between the
-BSD/OS and merged version. Even so, I expect that there will
-be some difficulty in doing the merge; I am certainly willing
-to assist in helping get the code merged into your system.
-
-Packaging of Utility Changes
-
-The utilities subdirectory contains the changes and additions
-to the utilities. There are diffs to three utilities enclosed:
-
- tunefs - add a flag to enable and disable soft updates
-
- mount - print out whether soft updates are enabled and
- also statistics on number of sync and async writes
-
- fsck - tighter checks on acceptable errors and a slightly
- different policy for what to put in lost+found on
- filesystems using soft updates
-
-In addition you should recompile vmstat so as to get reports
-on the 13 new memory types used by the soft update code.
-It is not necessary to use the new version of fsck, however it
-would aid in my debugging if you do. Also, because of the time
-lag between deleting a directory entry and the inode it
-references, you will find a lot more files showing up in your
-lost+found if you do not use the new version. Note that the
-new version checks for the soft update flag in the superblock
-and only uses the new algorithms if it is set. So, it will run
-unchanged on the filesystems that are not using soft updates.
-
-Operation
-
-Once you have booted a kernel that incorporates the soft update
-code and installed the updated utilities, do the following:
-
-1) Comment out the update program in /etc/rc.
-
-2) Run `tunefs -n enable' on one or more test filesystems.
-
-3) Mount these filesystems and then type `mount' to ensure that
- they have been enabled for soft updates.
-
-4) Copy the test directory to a softdep filesystem, chdir into
- it and run `./doit'. You may want to check out each of the
- three subtests individually first: doit1 - andrew benchmarks,
- doit2 - copy and removal of /etc, doit3 - find from /.
-
-====
-Additional notes from Feb 13
-
-hen removing huge directories of files, it is possible to get
-the incore state arbitrarily far ahead of the disk. Maintaining
-all the associated depedency information can exhaust the kernel
-malloc arena. To avoid this senario, I have put some limits on
-the soft update code so that it will not be allowed to rampage
-through all of the kernel memory. I enclose below the relevant
-patches to vnode.h and vfs_subr.c (which allow the soft update
-code to speed up the filesystem syncer process). I have also
-included the diffs for ffs_softdep.c. I hope to make a pass over
-ffs_softdep.c to isolate the differences with my standard version
-so that these diffs are less painful to incorporate.
-
-Since I know you like to play with tuning, I have put the relevant
-knobs on sysctl debug variables. The tuning knobs can be viewed
-with `sysctl debug' and set with `sysctl -w debug.<name>=value'.
-The knobs are as follows:
-
- debug.max_softdeps - limit on any given resource
- debug.tickdelay - ticks to delay before allocating
- debug.max_limit_hit - number of times tickdelay imposed
- debug.rush_requests - number of rush requests to filesystem syncer
-
-The max_softdeps limit is derived from vnodesdesired which in
-turn is sized based on the amount of memory on the machine.
-When the limit is hit, a process requesting a resource first
-tries to speed up the filesystem syncer process. Such a
-request is recorded as a rush_request. After syncdelay / 2
-unserviced rush requests (typically 15) are in the filesystem
-syncers queue (i.e., it is more than 15 seconds behind in its
-work), the process requesting the memory is put to sleep for
-tickdelay seconds. Such a delay is recorded in max_limit_hit.
-Following this delay it is granted its memory without further
-delay. I have tried the following experiments in which I
-delete an MH directory containing 16,703 files:
-
-Run # 1 2 3
-
-max_softdeps 4496 4496 4496
-tickdelay 100 == 1 sec 20 == 0.2 sec 2 == 0.02 sec
-max_limit_hit 16 == 16 sec 27 == 5.4 sec 203 == 4.1 sec
-rush_requests 147 102 93
-run time 57 sec 46 sec 45 sec
-I/O's 781 859 936
-
-When run with no limits, it completes in 40 seconds. So, the
-time spent in delay is directly added to the bottom line.
-Shortening the tick delay does cut down the total running time,
-but at the expense of generating more total I/O operations
-due to the rush orders being sent to the filesystem syncer.
-Although the number of rush orders decreases with a shorter
-tick delay, there are more requests in each order, hence the
-increase in I/O count. Also, although the I/O count does rise
-with a shorter delay, it is still at least an order of magnitude
-less than without soft updates. Anyway, you may want to play
-around with these value to see what works best and to see if
-you can get an insight into how best to tune them. If you get
-out of memory panic's, then you have max_softdeps set too high.
-The max_limit_hit and rush_requests show be reset to zero
-before each run. The minimum legal value for tickdelay is 2
-(if you set it below that, the code will use 2).
-
-
diff --git a/sys/ufs/ffs/README.softupdates b/sys/ufs/ffs/README.softupdates
index 96e2df11b2e35..d9c9f763382e2 100644
--- a/sys/ufs/ffs/README.softupdates
+++ b/sys/ufs/ffs/README.softupdates
@@ -13,10 +13,6 @@ read the copyrights in the sources and the README file in
that you are acting legally. The stub file provided here is only enough
to allow the system to function without this option being turned on.
-WARNING: RE-DISTRIBUTING A KERNEL WITH SOFTUPDATES COMPILED IN WITHOUT
-DISTRIBUTING THE SOURCE TO THE _ENTIRE_ KERNEL IS NOT PERMITTED. See the
-copyright on the soft update files, or ../../../contrib/sys/softupdates/README
-
Once you're running a kernel with soft update support, you need to enable
it for whichever filesystems you wish to run with the soft update policy.
This is done with the -n option to tunefs(8) on the UNMOUNTED filesystems,
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 2794e32be0884..bd127db179f1e 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95
- * $Id: ffs_alloc.c,v 1.55 1999/01/06 17:04:33 bde Exp $
+ * $Id: ffs_alloc.c,v 1.52 1998/09/05 14:13:12 phk Exp $
*/
#include "opt_quota.h"
@@ -42,13 +42,13 @@
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/mount.h>
-#include <sys/kernel.h>
+#ifdef notyet
#include <sys/sysctl.h>
+#endif
#include <sys/syslog.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
-#include <ufs/ufs/ufs_extern.h>
#include <ufs/ufs/ufsmount.h>
#include <ufs/ffs/fs.h>
@@ -65,8 +65,10 @@ static int ffs_checkblk __P((struct inode *, ufs_daddr_t, long));
#endif
static void ffs_clusteracct __P((struct fs *, struct cg *, ufs_daddr_t,
int));
+#ifdef notyet
static ufs_daddr_t ffs_clusteralloc __P((struct inode *, int, ufs_daddr_t,
int));
+#endif
static ino_t ffs_dirpref __P((struct fs *));
static ufs_daddr_t ffs_fragextend __P((struct inode *, int, long, int, int));
static void ffs_fserr __P((struct fs *, u_int, char *));
@@ -321,6 +323,7 @@ nospace:
return (ENOSPC);
}
+#ifdef notyet
SYSCTL_NODE(_vfs, OID_AUTO, ffs, CTLFLAG_RW, 0, "FFS filesystem");
/*
@@ -343,8 +346,7 @@ SYSCTL_INT(_vfs_ffs, FFS_ASYNCFREE, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, ""
static int doreallocblks = 1;
SYSCTL_INT(_vfs_ffs, FFS_REALLOCBLKS, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "");
-#ifdef DEBUG
-static volatile int prtrealloc = 0;
+static int prtrealloc = 0;
#endif
int
@@ -354,6 +356,9 @@ ffs_reallocblks(ap)
struct cluster_save *a_buflist;
} */ *ap;
{
+#if !defined (not_yes)
+ return (ENOSPC);
+#else
struct fs *fs;
struct inode *ip;
struct vnode *vp;
@@ -363,6 +368,7 @@ ffs_reallocblks(ap)
ufs_daddr_t start_lbn, end_lbn, soff, newblk, blkno;
struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
int i, len, start_lvl, end_lvl, pref, ssize;
+ struct timeval tv;
if (doreallocblks == 0)
return (ENOSPC);
@@ -502,8 +508,10 @@ ffs_reallocblks(ap)
bwrite(sbp);
} else {
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- if (!doasyncfree)
- UFS_UPDATE(vp, 1);
+ if (!doasyncfree) {
+ gettime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, 1);
+ }
}
if (ssize < len)
if (doasyncfree)
@@ -545,6 +553,7 @@ fail:
if (sbap != &ip->i_db[0])
brelse(sbp);
return (ENOSPC);
+#endif
}
/*
@@ -1078,6 +1087,7 @@ gotit:
return (blkno);
}
+#ifdef notyet
/*
* Determine whether a cluster can be allocated.
*
@@ -1186,6 +1196,7 @@ fail:
brelse(bp);
return (0);
}
+#endif
/*
* Determine whether an inode can be allocated.
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 938899a81248e..0cb97ee837075 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95
- * $Id: ffs_extern.h,v 1.24 1998/03/23 14:12:37 bde Exp $
+ * $Id: ffs_extern.h,v 1.23 1998/03/08 09:58:50 julian Exp $
*/
#ifndef _UFS_FFS_EXTERN_H
@@ -94,7 +94,7 @@ int ffs_statfs __P((struct mount *, struct statfs *, struct proc *));
int ffs_sync __P((struct mount *, int, struct ucred *, struct proc *));
int ffs_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
int ffs_unmount __P((struct mount *, int, struct proc *));
-int ffs_update __P((struct vnode *, int));
+int ffs_update __P((struct vnode *, struct timeval *, struct timeval *, int));
int ffs_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int ffs_vfree __P((struct vnode *, ino_t, int));
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index b474bc5413a33..d990b2f8b899c 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95
- * $Id: ffs_inode.c,v 1.51 1999/01/06 18:18:06 bde Exp $
+ * $Id: ffs_inode.c,v 1.46 1998/07/04 20:45:38 julian Exp $
*/
#include "opt_quota.h"
@@ -70,8 +70,10 @@ static int ffs_indirtrunc __P((struct inode *, ufs_daddr_t, ufs_daddr_t,
* set, then wait for the write to complete.
*/
int
-ffs_update(vp, waitfor)
+ffs_update(vp, access, modify, waitfor)
struct vnode *vp;
+ struct timeval *access;
+ struct timeval *modify;
int waitfor;
{
register struct fs *fs;
@@ -79,10 +81,12 @@ ffs_update(vp, waitfor)
struct inode *ip;
int error;
- ufs_itimes(vp);
ip = VTOI(vp);
- if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0)
+ if (((ip->i_flag &
+ (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) &&
+ (waitfor != MNT_WAIT))
return (0);
+ ufs_itimes(vp);
ip->i_flag &= ~(IN_LAZYMOD | IN_MODIFIED);
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (0);
@@ -140,7 +144,8 @@ ffs_truncate(vp, length, flags, cred, p)
register struct fs *fs;
struct buf *bp;
int offset, size, level;
- long count, nblocks, blocksreleased = 0;
+ long count, nblocks, vflags, blocksreleased = 0;
+ struct timeval tv;
register int i;
int aflags, error, allerror;
off_t osize;
@@ -153,6 +158,7 @@ ffs_truncate(vp, length, flags, cred, p)
return (EINVAL);
if (length > fs->fs_maxfilesize)
return (EFBIG);
+ getmicrotime(&tv);
if (ovp->v_type == VLNK &&
(oip->i_size < ovp->v_mount->mnt_maxsymlinklen || oip->i_din.di_blocks == 0)) {
#ifdef DIAGNOSTIC
@@ -162,11 +168,11 @@ ffs_truncate(vp, length, flags, cred, p)
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
if (oip->i_size == length) {
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 0));
+ return (UFS_UPDATE(ovp, &tv, &tv, 0));
}
#ifdef QUOTA
error = getinoquota(oip);
@@ -195,7 +201,7 @@ ffs_truncate(vp, length, flags, cred, p)
softdep_setup_freeblocks(oip, length);
vinvalbuf(ovp, 0, cred, p, 0, 0);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (ffs_update(ovp, 0));
+ return (ffs_update(ovp, &tv, &tv, 0));
}
}
osize = oip->i_size;
@@ -223,7 +229,7 @@ ffs_truncate(vp, length, flags, cred, p)
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
/*
* Shorten the size of the file. If the file is not being
@@ -287,7 +293,7 @@ ffs_truncate(vp, length, flags, cred, p)
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- allerror = UFS_UPDATE(ovp, ((length > 0) ? 0 : 1));
+ allerror = UFS_UPDATE(ovp, &tv, &tv, ((length > 0) ? 0 : 1));
/*
* Having written the new inode to disk, save its new configuration
@@ -381,8 +387,7 @@ done:
if (newblks[i] != oip->i_db[i])
panic("ffs_truncate2");
if (length == 0 &&
- (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) ||
- !TAILQ_EMPTY(&ovp->v_cleanblkhd)))
+ (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first))
panic("ffs_truncate3");
#endif /* DIAGNOSTIC */
/*
diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c
index 5052b89f8a8c6..36537180788b0 100644
--- a/sys/ufs/ffs/ffs_subr.c
+++ b/sys/ufs/ffs/ffs_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_subr.c 8.5 (Berkeley) 3/21/95
- * $Id: ffs_subr.c,v 1.22 1998/11/29 03:12:06 bde Exp $
+ * $Id: ffs_subr.c,v 1.20 1998/03/08 09:58:59 julian Exp $
*/
#include <sys/param.h>
@@ -53,7 +53,7 @@
#include <ufs/ffs/ffs_extern.h>
#ifdef DDB
-void ffs_checkoverlap __P((struct buf *, struct inode *));
+static void ffs_checkoverlap __P((struct buf *, struct inode *));
#endif
/*
@@ -128,7 +128,7 @@ ffs_fragacct(fs, fragmap, fraglist, cnt)
}
#ifdef DDB
-void
+static void
ffs_checkoverlap(bp, ip)
struct buf *bp;
struct inode *ip;
@@ -144,8 +144,8 @@ ffs_checkoverlap(bp, ip)
if (ep == bp || (ep->b_flags & B_INVAL) ||
ep->b_vp == NULLVP)
continue;
- if (VOP_BMAP(ep->b_vp, (ufs_daddr_t)0, &vp, (ufs_daddr_t *)NULL,
- (int *)NULL, (int *)NULL))
+ if (VOP_BMAP(ep->b_vp, (ufs_daddr_t)0, &vp, (ufs_daddr_t)0,
+ NULL, NULL))
continue;
if (vp != ip->i_devvp)
continue;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 2973703da4053..d06fee679c59b 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
- * $Id: ffs_vfsops.c,v 1.94 1999/01/05 18:50:03 eivind Exp $
+ * $Id: ffs_vfsops.c,v 1.87 1998/09/14 19:56:41 sos Exp $
*/
#include "opt_quota.h"
@@ -290,8 +290,7 @@ ffs_mount( mp, path, data, ndp, p)
err = ENOTBLK;
goto error_2;
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
err = ENXIO;
goto error_2;
}
@@ -453,16 +452,15 @@ ffs_reload(mp, cred, p)
panic("ffs_reload: dirty1");
dev = devvp->v_rdev;
-
/*
* Only VMIO the backing device if the backing device is a real
- * block device. See ffs_mountmfs() for more details.
+ * block device. This excludes the original MFS implementation.
+ * Note that it is optional that the backing device be VMIOed. This
+ * increases the opportunity for metadata caching.
*/
- if (devvp->v_tag != VT_MFS && devvp->v_type == VBLK) {
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- vfs_object_create(devvp, p, p->p_ucred);
+ if ((devvp->v_type == VBLK) && (major(dev) < nblkdev)) {
simple_lock(&devvp->v_interlock);
- VOP_UNLOCK(devvp, LK_INTERLOCK, p);
+ vfs_object_create(devvp, p, p->p_ucred, 0);
}
/*
@@ -578,10 +576,12 @@ ffs_mountfs(devvp, mp, p, malloctype)
register struct ufsmount *ump;
struct buf *bp;
register struct fs *fs;
+ struct cg *cgp;
dev_t dev;
struct partinfo dpart;
+ struct csum cstotal;
caddr_t base, space;
- int error, i, blks, size, ronly;
+ int error, i, cyl, blks, size, ronly;
int32_t *lp;
struct ucred *cred;
u_int64_t maxfilesize; /* XXX */
@@ -615,13 +615,12 @@ ffs_mountfs(devvp, mp, p, malloctype)
* Note that it is optional that the backing device be VMIOed. This
* increases the opportunity for metadata caching.
*/
- if (devvp->v_tag != VT_MFS && devvp->v_type == VBLK) {
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
- vfs_object_create(devvp, p, p->p_ucred);
+ if ((devvp->v_type == VBLK) && (major(dev) < nblkdev)) {
simple_lock(&devvp->v_interlock);
- VOP_UNLOCK(devvp, LK_INTERLOCK, p);
+ vfs_object_create(devvp, p, p->p_ucred, 0);
}
+
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p);
if (error)
@@ -951,6 +950,7 @@ ffs_sync(mp, waitfor, cred, p)
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct fs *fs;
+ struct timeval tv;
int error, allerror = 0;
fs = ump->um_fs;
@@ -975,7 +975,7 @@ loop:
ip = VTOI(vp);
if ((vp->v_type == VNON) || ((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) &&
- (TAILQ_EMPTY(&vp->v_dirtyblkhd) || (waitfor == MNT_LAZY))) {
+ ((vp->v_dirtyblkhd.lh_first == NULL) || (waitfor == MNT_LAZY))) {
simple_unlock(&vp->v_interlock);
continue;
}
@@ -997,8 +997,9 @@ loop:
} else {
simple_unlock(&mntvnode_slock);
simple_unlock(&vp->v_interlock);
- /* UFS_UPDATE(vp, waitfor == MNT_WAIT); */
- UFS_UPDATE(vp, 0);
+ getmicrotime(&tv);
+ /* UFS_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */
+ UFS_UPDATE(vp, &tv, &tv, 0);
simple_lock(&mntvnode_slock);
}
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 1823c0f0af136..093c625fa8787 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95
- * $Id: ffs_vnops.c,v 1.53 1998/10/31 15:31:27 peter Exp $
+ * $Id: ffs_vnops.c,v 1.51 1998/09/07 11:50:19 bde Exp $
*/
#include <sys/param.h>
@@ -122,6 +122,7 @@ ffs_fsync(ap)
{
struct vnode *vp = ap->a_vp;
struct buf *bp;
+ struct timeval tv;
struct buf *nbp;
int s, error, passes, skipmeta;
daddr_t lbn;
@@ -145,8 +146,8 @@ ffs_fsync(ap)
loop:
s = splbio();
loop2:
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
/*
* First time through on a synchronous call,
* or if it's already scheduled, skip to the next
@@ -227,7 +228,7 @@ loop2:
return (error);
s = splbio();
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
/*
* Block devices associated with filesystems may
* have new I/O requests posted for them even if
@@ -247,5 +248,6 @@ loop2:
}
}
splx(s);
- return (UFS_UPDATE(vp, ap->a_waitfor == MNT_WAIT));
+ getmicrotime(&tv);
+ return (UFS_UPDATE(vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c
index 1ea0804e1b0d1..01bf24d0e9f3c 100644
--- a/sys/ufs/mfs/mfs_vfsops.c
+++ b/sys/ufs/mfs/mfs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95
- * $Id: mfs_vfsops.c,v 1.52 1998/12/07 21:58:49 archie Exp $
+ * $Id: mfs_vfsops.c,v 1.50 1998/10/10 08:12:24 jkh Exp $
*/
@@ -103,7 +103,7 @@ VFS_SET(mfs_vfsops, mfs, 0);
#ifdef MFS_ROOT_SIZE
/* Image was already written into mfs_root */
static u_char mfs_root[MFS_ROOT_SIZE*1024] = "MFS Filesystem goes here";
-static u_char end_mfs_root[] __unused = "MFS Filesystem had better STOP here";
+static u_char end_mfs_root[] = "MFS Filesystem had better STOP here";
#endif
u_char *
@@ -391,16 +391,6 @@ mfs_start(mp, flags, p)
register int gotsig = 0;
base = mfsp->mfs_baseoff;
-
- /*
- * Must set P_SYSTEM to prevent system from trying to kill
- * this process. What happens is that the process is unkillable,
- * and the swapper loops trying to continuously kill it. Nor
- * can we swap out this process - not unless you want a deadlock,
- * anyway.
- */
- curproc->p_flag |= P_SYSTEM;
-
while (mfsp->mfs_active) {
while (bp = bufq_first(&mfsp->buf_queue)) {
bufq_remove(&mfsp->buf_queue, bp);
diff --git a/sys/alpha/include/sysarch.h b/sys/ufs/mfs/mfsiom.h
index e0e0a6b9b6178..d0a0b608a2783 100644
--- a/sys/alpha/include/sysarch.h
+++ b/sys/ufs/mfs/mfsiom.h
@@ -1,6 +1,6 @@
-/*-
- * Copyright (c) 1993 The Regents of the University of California.
- * All rights reserved.
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,27 +30,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sysarch.h,v 1.1 1998/11/17 10:40:07 dfr Exp $
- */
-
-/*
- * Architecture specific syscalls (alpha)
+ * @(#)mfsiom.h 8.1 (Berkeley) 6/11/93
+ * $Id$
*/
-#ifndef _MACHINE_SYSARCH_H_
-#define _MACHINE_SYSARCH_H_
-
-#define ALPHA_SETHAE 0
-#define ALPHA_GET_FPMASK 1
-#define ALPHA_SET_FPMASK 2
-
-#ifndef KERNEL
-#include <sys/cdefs.h>
-union descriptor;
+#ifndef _UFS_MFS_MFSIOM_H_
+#define _UFS_MFS_MFSIOM_H_
-__BEGIN_DECLS
-int alpha_sethae __P((u_int64_t));
-__END_DECLS
-#endif /* !KERNEL */
+#define MFS_MAPREG (MAXPHYS/PAGE_SIZE + 2) /* Kernel mapping pte's */
+#define MFS_MAPSIZE 10 /* Size of alloc map for pte's */
-#endif /* !_MACHINE_SYSARCH_H_ */
+#endif
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 8d23b7e9200d7..86638856d8726 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
- * $Id: ufs_bmap.c,v 1.23 1998/10/26 08:53:13 bde Exp $
+ * $Id: ufs_bmap.c,v 1.21 1998/07/04 20:45:39 julian Exp $
*/
#include <sys/param.h>
@@ -149,8 +149,9 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*/
devvp = ip->i_devvp;
- if (devvp != NULL && devvp->v_tag != VT_MFS &&
- devvp->v_type == VBLK) {
+ if (devvp && devvp->v_type == VBLK &&
+ (devvp->v_rdev != NODEV) &&
+ (major(devvp->v_rdev) < nblkdev)) {
if (bdevsw[major(devvp->v_rdev)]->d_maxio > MAXPHYS) {
maxrun = MAXPHYS;
vp->v_maxio = MAXPHYS;
diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c
index 33f1d2ac1b680..8a2de14988368 100644
--- a/sys/ufs/ufs/ufs_disksubr.c
+++ b/sys/ufs/ufs/ufs_disksubr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
- * $Id: ufs_disksubr.c,v 1.38 1998/10/17 07:49:04 bde Exp $
+ * $Id: ufs_disksubr.c,v 1.37 1998/10/16 10:14:21 jkh Exp $
*/
#include <sys/param.h>
@@ -371,7 +371,7 @@ diskerr(bp, dname, what, pri, blkdone, lp)
daddr_t sn;
if (pri != LOG_PRINTF) {
- log(pri, "%s", "");
+ log(pri, "");
pr = addlog;
} else
pr = printf;
diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c
index 853c739e408bd..a51ff4e16db25 100644
--- a/sys/ufs/ufs/ufs_ihash.c
+++ b/sys/ufs/ufs/ufs_ihash.c
@@ -31,12 +31,11 @@
* SUCH DAMAGE.
*
* @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95
- * $Id: ufs_ihash.c,v 1.17 1998/11/10 09:16:27 peter Exp $
+ * $Id: ufs_ihash.c,v 1.15 1998/02/06 12:14:17 eivind Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/vnode.h>
#include <sys/malloc.h>
@@ -53,9 +52,7 @@ static MALLOC_DEFINE(M_UFSIHASH, "UFS ihash", "UFS Inode hash tables");
static LIST_HEAD(ihashhead, inode) *ihashtbl;
static u_long ihash; /* size of hash table - 1 */
#define INOHASH(device, inum) (&ihashtbl[((device) + (inum)) & ihash])
-#ifndef NULL_SIMPLELOCKS
static struct simplelock ufs_ihash_slock;
-#endif
/*
* Initialize inode hash table.
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c
index 1f4e0b1af8d78..be4d2bb4f18b1 100644
--- a/sys/ufs/ufs/ufs_inode.c
+++ b/sys/ufs/ufs/ufs_inode.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_inode.c 8.9 (Berkeley) 5/14/95
- * $Id: ufs_inode.c,v 1.23 1998/07/03 22:17:02 bde Exp $
+ * $Id: ufs_inode.c,v 1.22 1998/03/30 09:56:16 phk Exp $
*/
#include "opt_quota.h"
@@ -66,6 +66,7 @@ ufs_inactive(ap)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
struct proc *p = ap->a_p;
+ struct timeval tv;
int mode, error = 0;
if (prtactive && vp->v_usecount != 0)
@@ -88,8 +89,10 @@ ufs_inactive(ap)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
UFS_VFREE(vp, ip->i_number, mode);
}
- if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE))
- UFS_UPDATE(vp, 0);
+ if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) {
+ getmicrotime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, 0);
+ }
out:
VOP_UNLOCK(vp, 0, p);
/*
@@ -113,6 +116,7 @@ ufs_reclaim(ap)
{
register struct inode *ip;
register struct vnode *vp = ap->a_vp;
+ struct timeval tv;
#ifdef QUOTA
int i;
#endif
@@ -122,7 +126,8 @@ ufs_reclaim(ap)
ip = VTOI(vp);
if (ip->i_flag & IN_LAZYMOD) {
ip->i_flag |= IN_MODIFIED;
- UFS_UPDATE(vp, 0);
+ getmicrotime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, 0);
}
/*
* Remove the inode from its hash chain.
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index bd5e96f0e03e8..936be19cb5efb 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_lookup.c 8.15 (Berkeley) 6/16/95
- * $Id: ufs_lookup.c,v 1.25 1998/07/11 07:46:07 bde Exp $
+ * $Id: ufs_lookup.c,v 1.24 1998/04/15 12:27:31 bde Exp $
*/
#include <sys/param.h>
@@ -670,6 +670,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
struct direct *ep, *nep;
int error, ret, blkoff, loc, spacefree, flags;
char *dirbuf;
+ struct timeval tv;
p = curproc; /* XXX */
cr = p->p_ucred;
@@ -721,7 +722,8 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp)
} else {
error = VOP_BWRITE(bp);
}
- ret = UFS_UPDATE(dvp, !DOINGSOFTDEP(dvp));
+ getmicrotime(&tv);
+ ret = UFS_UPDATE(dvp, &tv, &tv, !DOINGSOFTDEP(dvp));
if (error == 0)
return (ret);
return (error);
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 99c35c7b57118..c833cdf81ee3e 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -34,12 +34,11 @@
* SUCH DAMAGE.
*
* @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95
- * $Id: ufs_quota.c,v 1.24 1998/07/15 02:32:34 bde Exp $
+ * $Id: ufs_quota.c,v 1.23 1998/06/21 14:53:40 bde Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/namei.h>
#include <sys/malloc.h>
#include <sys/fcntl.h>
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index 026d348696dec..2f5b7f3863b50 100644
--- a/sys/ufs/ufs/ufs_readwrite.c
+++ b/sys/ufs/ufs/ufs_readwrite.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95
- * $Id: ufs_readwrite.c,v 1.54 1998/12/15 03:29:52 julian Exp $
+ * $Id: ufs_readwrite.c,v 1.52 1998/09/07 11:50:19 bde Exp $
*/
#define BLKSIZE(a, b, c) blksize(a, b, c)
@@ -107,35 +107,17 @@ READ(ap)
if (object)
vm_object_reference(object);
#if 1
- /*
- * If IO optimisation is turned on,
- * and we are NOT a VM based IO request,
- * (i.e. not headed for the buffer cache)
- * but there IS a vm object associated with it.
- */
if ((ioflag & IO_VMIO) == 0 && (vfs_ioopt > 1) && object) {
int nread, toread;
-
toread = uio->uio_resid;
if (toread > bytesinfile)
toread = bytesinfile;
if (toread >= PAGE_SIZE) {
- /*
- * Then if it's at least a page in size, try
- * get the data from the object using vm tricks
- */
error = uioread(toread, uio, object, &nread);
if ((uio->uio_resid == 0) || (error != 0)) {
- /*
- * If we finished or there was an error
- * then finish up.
- */
if (!(vp->v_mount->mnt_flag & MNT_NOATIME))
ip->i_flag |= IN_ACCESS;
if (object)
- /*
- * This I don't understand
- */
vm_object_vndeallocate(object);
return error;
}
@@ -143,29 +125,15 @@ READ(ap)
}
#endif
- /*
- * Ok so we couldn't do it all in one vm trick...
- * so cycle around trying smaller bites..
- */
for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) {
if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0)
break;
#if 1
if ((ioflag & IO_VMIO) == 0 && (vfs_ioopt > 1) && object) {
- /*
- * Obviously we didn't finish above, but we
- * didn't get an error either. Try the same trick again.
- * but this time we are looping.
- */
int nread, toread;
toread = uio->uio_resid;
if (toread > bytesinfile)
toread = bytesinfile;
-
- /*
- * Once again, if there isn't enough for a
- * whole page, don't try optimising.
- */
if (toread >= PAGE_SIZE) {
error = uioread(toread, uio, object, &nread);
if ((uio->uio_resid == 0) || (error != 0)) {
@@ -175,11 +143,6 @@ READ(ap)
vm_object_vndeallocate(object);
return error;
}
- /*
- * To get here we didnt't finish or err.
- * If we did get some data,
- * loop to try another bite.
- */
if (nread > 0) {
continue;
}
@@ -191,68 +154,29 @@ READ(ap)
nextlbn = lbn + 1;
size = BLKSIZE(fs, ip, lbn);
blkoffset = blkoff(fs, uio->uio_offset);
-
- /*
- * The amount we want to transfer in this iteration is
- * one FS block less the amount of the data before
- * our startpoint (duh!)
- */
- xfersize = fs->fs_bsize - blkoffset;
- /*
- * But if we actually want less than the block,
- * or the file doesn't have a whole block more of data,
- * then use the lesser number.
- */
+ xfersize = fs->fs_bsize - blkoffset;
if (uio->uio_resid < xfersize)
xfersize = uio->uio_resid;
if (bytesinfile < xfersize)
xfersize = bytesinfile;
if (lblktosize(fs, nextlbn) >= ip->i_size)
- /*
- * Don't do readahead if this is the end of the file.
- */
error = bread(vp, lbn, size, NOCRED, &bp);
else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0)
- /*
- * Otherwise if we are allowed to cluster,
- * grab as much as we can.
- *
- * XXX This may not be a win if we are not
- * doing sequential access.
- */
error = cluster_read(vp, ip->i_size, lbn,
size, NOCRED, uio->uio_resid, seqcount, &bp);
else if (lbn - 1 == vp->v_lastr) {
- /*
- * If we are NOT allowed to cluster, then
- * if we appear to be acting sequentially,
- * fire off a request for a readahead
- * as well as a read. Note that the 4th and 5th
- * arguments point to arrays of the size specified in
- * the 6th argument.
- */
int nextsize = BLKSIZE(fs, ip, nextlbn);
error = breadn(vp, lbn,
size, &nextlbn, &nextsize, 1, NOCRED, &bp);
} else
- /*
- * Failing all of the above, just read what the
- * user asked for. Interestingly, the same as
- * the first option above.
- */
error = bread(vp, lbn, size, NOCRED, &bp);
if (error) {
brelse(bp);
bp = NULL;
break;
}
-
- /*
- * Remember where we read so we can see latter if we start
- * acting sequential.
- */
vp->v_lastr = lbn;
/*
@@ -270,22 +194,13 @@ READ(ap)
}
if (vfs_ioopt && object &&
- (bp->b_flags & B_VMIO) &&
- ((blkoffset & PAGE_MASK) == 0) &&
- ((xfersize & PAGE_MASK) == 0)) {
- /*
- * If VFS IO optimisation is turned on,
- * and it's an exact page multiple
- * And a normal VM based op,
- * then use uiomiveco()
- */
+ (bp->b_flags & B_VMIO) &&
+ ((blkoffset & PAGE_MASK) == 0) &&
+ ((xfersize & PAGE_MASK) == 0)) {
error =
uiomoveco((char *)bp->b_data + blkoffset,
(int)xfersize, uio, object);
} else {
- /*
- * otherwise use the general form
- */
error =
uiomove((char *)bp->b_data + blkoffset,
(int)xfersize, uio);
@@ -296,30 +211,13 @@ READ(ap)
if ((ioflag & IO_VMIO) &&
(LIST_FIRST(&bp->b_dep) == NULL)) {
- /*
- * If there are no dependencies, and
- * it's VMIO, then we don't need the buf,
- * mark it available for freeing. The VM has the data.
- */
bp->b_flags |= B_RELBUF;
brelse(bp);
} else {
- /*
- * Otherwise let whoever
- * made the request take care of
- * freeing it. We just queue
- * it onto another list.
- */
bqrelse(bp);
}
}
- /*
- * This can only happen in the case of an error
- * because the loop above resets bp to NULL on each iteration
- * and on normal completion has not set a new value into it.
- * so it must have come from a 'break' statement
- */
if (bp != NULL) {
if ((ioflag & IO_VMIO) &&
(LIST_FIRST(&bp->b_dep) == NULL)) {
@@ -358,6 +256,7 @@ WRITE(ap)
ufs_daddr_t lbn;
off_t osize;
int blkoffset, error, extended, flags, ioflag, resid, size, xfersize;
+ struct timeval tv;
vm_object_t object;
extended = 0;
@@ -492,8 +391,10 @@ WRITE(ap)
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
- } else if (resid > uio->uio_resid && (ioflag & IO_SYNC))
- error = UFS_UPDATE(vp, 1);
+ } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) {
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
+ }
if (!error)
VN_POLLEVENT(vp, POLLWRITE | (extended ? POLLEXTEND : 0));
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index 1ee2d38cf7fa4..3ae27dec53175 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -36,13 +36,12 @@
* SUCH DAMAGE.
*
* @(#)ufs_vfsops.c 8.8 (Berkeley) 5/20/95
- * $Id: ufs_vfsops.c,v 1.11 1997/10/12 20:26:27 phk Exp $
+ * $Id: ufs_vfsops.c,v 1.10 1997/08/16 19:16:27 wollman Exp $
*/
#include "opt_quota.h"
#include <sys/param.h>
-#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/malloc.h>
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 101008513ac99..11592f981d1af 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
- * $Id: ufs_vnops.c,v 1.103 1998/12/24 09:45:10 bde Exp $
+ * $Id: ufs_vnops.c,v 1.99 1998/08/12 21:42:54 msmith Exp $
*/
#include "opt_quota.h"
@@ -506,11 +506,12 @@ ufs_setattr(ap)
if (vap->va_mtime.tv_sec != VNOVAL)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
ufs_itimes(vp);
- if (vap->va_atime.tv_sec != VNOVAL)
- ip->i_atime = vap->va_atime.tv_sec;
if (vap->va_mtime.tv_sec != VNOVAL)
+ ip->i_atime = vap->va_atime.tv_sec;
+ if (vap->va_atime.tv_sec != VNOVAL)
ip->i_mtime = vap->va_mtime.tv_sec;
- error = UFS_UPDATE(vp, 0);
+ error = UFS_UPDATE(vp, (struct timeval *)0,
+ (struct timeval *)0, 0);
if (error)
return (error);
}
@@ -720,6 +721,7 @@ ufs_link(ap)
struct componentname *cnp = ap->a_cnp;
struct proc *p = cnp->cn_proc;
struct inode *ip;
+ struct timeval tv;
struct direct newdir;
int error;
@@ -752,7 +754,8 @@ ufs_link(ap)
ip->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(vp))
softdep_increase_linkcnt(ip);
- error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp));
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, !DOINGSOFTDEP(vp));
if (!error) {
ufs_makedirentry(ip, cnp, &newdir);
error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL);
@@ -876,6 +879,7 @@ ufs_rename(ap)
struct proc *p = fcnp->cn_proc;
struct inode *ip, *xp, *dp;
struct direct newdir;
+ struct timeval tv;
int doingdirectory = 0, oldparent = 0, newparent = 0;
int error = 0;
@@ -1015,7 +1019,8 @@ abortit:
ip->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(fvp))
softdep_increase_linkcnt(ip);
- if (error = UFS_UPDATE(fvp, !DOINGSOFTDEP(fvp))) {
+ getmicrotime(&tv);
+ if (error = UFS_UPDATE(fvp, &tv, &tv, !DOINGSOFTDEP(fvp))) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
@@ -1079,7 +1084,7 @@ abortit:
dp->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(tdvp))
softdep_increase_linkcnt(dp);
- error = UFS_UPDATE(tdvp, !DOINGSOFTDEP(tdvp));
+ error = UFS_UPDATE(tdvp, &tv, &tv, !DOINGSOFTDEP(tdvp));
if (error)
goto bad;
}
@@ -1090,7 +1095,7 @@ abortit:
dp->i_effnlink--;
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
- (void)UFS_UPDATE(tdvp, 1);
+ (void)UFS_UPDATE(tdvp, &tv, &tv, 1);
}
goto bad;
}
@@ -1270,6 +1275,7 @@ ufs_mkdir(ap)
struct buf *bp;
struct dirtemplate dirtemplate, *dtp;
struct direct newdir;
+ struct timeval tv;
int error, dmode;
long blkoff;
@@ -1372,7 +1378,8 @@ ufs_mkdir(ap)
dp->i_flag |= IN_CHANGE;
if (DOINGSOFTDEP(dvp))
softdep_increase_linkcnt(dp);
- error = UFS_UPDATE(tvp, !DOINGSOFTDEP(dvp));
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(dvp));
if (error)
goto bad;
@@ -1408,7 +1415,7 @@ ufs_mkdir(ap)
blkoff += DIRBLKSIZ;
}
}
- if ((error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp))) != 0) {
+ if ((error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(tvp))) != 0) {
(void)VOP_BWRITE(bp);
goto bad;
}
@@ -1605,9 +1612,9 @@ ufs_readdir(ap)
off = uio->uio_offset;
count = uio->uio_resid;
/* Make sure we don't return partial entries. */
- if (count <= ((uio->uio_offset + count) & (DIRBLKSIZ -1)))
- return (EINVAL);
count -= (uio->uio_offset + count) & (DIRBLKSIZ -1);
+ if (count <= 0)
+ return (EINVAL);
lost = uio->uio_resid - count;
uio->uio_resid = count;
uio->uio_iov->iov_len = count;
@@ -1803,19 +1810,13 @@ ufsspec_read(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(spec_vnodeop_p, VOFFSET(vop_read), ap);
- /*
- * The inode may have been revoked during the call, so it must not
- * be accessed blindly here or in the other wrapper functions.
- */
- ip = VTOI(ap->a_vp);
- if (ip != NULL && (uio->uio_resid != resid || error == 0 && resid != 0))
- ip->i_flag |= IN_ACCESS;
+ if (uio->uio_resid != resid)
+ VTOI(ap->a_vp)->i_flag |= IN_ACCESS;
return (error);
}
@@ -1832,14 +1833,12 @@ ufsspec_write(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(spec_vnodeop_p, VOFFSET(vop_write), ap);
- ip = VTOI(ap->a_vp);
- if (ip != NULL && (uio->uio_resid != resid || error == 0 && resid != 0))
+ if (uio->uio_resid != resid)
VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
return (error);
}
@@ -1880,15 +1879,13 @@ ufsfifo_read(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(fifo_vnodeop_p, VOFFSET(vop_read), ap);
- ip = VTOI(ap->a_vp);
- if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && ip != NULL &&
- (uio->uio_resid != resid || error == 0 && resid != 0))
+ if (uio->uio_resid != resid &&
+ (ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0)
VTOI(ap->a_vp)->i_flag |= IN_ACCESS;
return (error);
}
@@ -1906,14 +1903,12 @@ ufsfifo_write(ap)
} */ *ap;
{
int error, resid;
- struct inode *ip;
struct uio *uio;
uio = ap->a_uio;
resid = uio->uio_resid;
error = VOCALL(fifo_vnodeop_p, VOFFSET(vop_write), ap);
- ip = VTOI(ap->a_vp);
- if (ip != NULL && (uio->uio_resid != resid || error == 0 && resid != 0))
+ if (uio->uio_resid != resid)
VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
return (error);
}
@@ -2067,6 +2062,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
{
register struct inode *ip, *pdir;
struct direct newdir;
+ struct timeval tv;
struct vnode *tvp;
int error;
@@ -2160,7 +2156,8 @@ ufs_makeinode(mode, dvp, vpp, cnp)
/*
* Make sure inode goes to disk before directory entry.
*/
- error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp));
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(tvp));
if (error)
goto bad;
ufs_makedirentry(ip, cnp, &newdir);
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index 70652b58f9ba3..c62b736034f5f 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufsmount.h 8.6 (Berkeley) 3/30/95
- * $Id: ufsmount.h,v 1.13 1998/01/30 11:34:06 phk Exp $
+ * $Id: ufsmount.h,v 1.12 1997/10/16 20:32:40 phk Exp $
*/
#ifndef _UFS_UFS_UFSMOUNT_H_
@@ -97,14 +97,14 @@ struct ufsmount {
struct malloc_type *um_malloctype; /* The inodes malloctype */
int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **));
int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
- int (*um_update) __P((struct vnode *, int));
+ int (*um_update) __P((struct vnode *, struct timeval *, struct timeval *, int));
int (*um_valloc) __P((struct vnode *, int, struct ucred *, struct vnode **));
int (*um_vfree) __P((struct vnode *, ino_t, int));
};
#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd)
#define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee)
-#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb)
+#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd)
#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd)
#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index a200b9c2a8dbc..3783be4368930 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)device_pager.c 8.1 (Berkeley) 6/11/93
- * $Id: device_pager.c,v 1.36 1998/12/07 21:58:50 archie Exp $
+ * $Id: device_pager.c,v 1.31 1998/07/15 02:32:35 bde Exp $
*/
#include <sys/param.h>
@@ -50,7 +50,6 @@
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
-#include <vm/vm_zone.h>
static void dev_pager_init __P((void));
static vm_object_t dev_pager_alloc __P((void *, vm_ooffset_t, vm_prot_t,
@@ -65,8 +64,8 @@ static boolean_t dev_pager_haspage __P((vm_object_t, vm_pindex_t, int *,
/* list of device pager objects */
static struct pagerlst dev_pager_object_list;
-static vm_zone_t fakepg_zone;
-static struct vm_zone fakepg_zone_store;
+/* list of available vm_page_t's */
+static TAILQ_HEAD(, vm_page) dev_pager_fakelist;
static vm_page_t dev_pager_getfake __P((vm_offset_t));
static void dev_pager_putfake __P((vm_page_t));
@@ -87,8 +86,7 @@ static void
dev_pager_init()
{
TAILQ_INIT(&dev_pager_object_list);
- fakepg_zone = &fakepg_zone_store;
- zinitna(fakepg_zone, NULL, "DP fakepg", sizeof(struct vm_page), 0, 0, 2);
+ TAILQ_INIT(&dev_pager_fakelist);
}
static vm_object_t
@@ -97,8 +95,7 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo
dev_t dev;
d_mmap_t *mapfunc;
vm_object_t object;
- unsigned int npages;
- vm_offset_t off;
+ unsigned int npages, off;
/*
* Make sure this device can be mapped.
@@ -207,8 +204,11 @@ dev_pager_getpages(object, m, count, reqpage)
if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop)
panic("dev_pager_getpage: no map function");
- paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (vm_offset_t) offset << PAGE_SHIFT, prot));
- KASSERT(paddr != -1,("dev_pager_getpage: map function returns error"));
+ paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (int) offset << PAGE_SHIFT, prot));
+#ifdef DIAGNOSTIC
+ if (paddr == -1)
+ panic("dev_pager_getpage: map function returns error");
+#endif
/*
* Replace the passed in reqpage page with our own fake page and free up the
* all of the original pages.
@@ -255,15 +255,23 @@ dev_pager_getfake(paddr)
vm_offset_t paddr;
{
vm_page_t m;
-
- m = zalloc(fakepg_zone);
+ int i;
+
+ if (TAILQ_FIRST(&dev_pager_fakelist) == NULL) {
+ m = (vm_page_t) malloc(PAGE_SIZE * 2, M_VMPGDATA, M_WAITOK);
+ for (i = (PAGE_SIZE * 2) / sizeof(*m); i > 0; i--) {
+ TAILQ_INSERT_TAIL(&dev_pager_fakelist, m, pageq);
+ m++;
+ }
+ }
+ m = TAILQ_FIRST(&dev_pager_fakelist);
+ TAILQ_REMOVE(&dev_pager_fakelist, m, pageq);
m->flags = PG_BUSY | PG_FICTITIOUS;
m->valid = VM_PAGE_BITS_ALL;
m->dirty = 0;
m->busy = 0;
m->queue = PQ_NONE;
- m->object = NULL;
m->wire_count = 1;
m->hold_count = 0;
@@ -278,5 +286,5 @@ dev_pager_putfake(m)
{
if (!(m->flags & PG_FICTITIOUS))
panic("dev_pager_putfake: bad page");
- zfree(fakepg_zone, m);
+ TAILQ_INSERT_TAIL(&dev_pager_fakelist, m, pageq);
}
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 16911684c9988..6c58e0fff287f 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -39,7 +39,7 @@
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
*
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
- * $Id: swap_pager.c,v 1.106 1999/01/08 17:31:23 eivind Exp $
+ * $Id: swap_pager.c,v 1.101 1998/09/04 08:06:56 dfr Exp $
*/
/*
@@ -81,6 +81,7 @@
static int nswiodone;
int swap_pager_full;
extern int vm_swap_size;
+static int suggest_more_swap = 0;
static int no_swap_space = 1;
static int max_pageout_cluster;
struct rlisthdr swaplist;
@@ -397,6 +398,11 @@ swap_pager_getswapspace(object, amount, rtval)
unsigned location;
vm_swap_size -= amount;
+ if (!suggest_more_swap && (vm_swap_size < btodb(cnt.v_page_count * PAGE_SIZE))) {
+ printf("swap_pager: suggest more swap space: %d MB\n",
+ (2 * cnt.v_page_count * (PAGE_SIZE / 1024)) / 1000);
+ suggest_more_swap = 1;
+ }
if (!rlist_alloc(&swaplist, amount, &location)) {
vm_swap_size += amount;
@@ -1122,6 +1128,22 @@ swap_pager_getpages(object, m, count, reqpage)
}
m[reqpage]->object->last_read = m[count-1]->pindex;
+
+ /*
+ * If we're out of swap space, then attempt to free
+ * some whenever multiple pages are brought in. We
+ * must set the dirty bits so that the page contents
+ * will be preserved.
+ */
+ if (SWAPLOW ||
+ (vm_swap_size < btodb((cnt.v_page_count - cnt.v_wire_count)) * PAGE_SIZE)) {
+ for (i = 0; i < count; i++) {
+ m[i]->dirty = VM_PAGE_BITS_ALL;
+ }
+ swap_pager_freespace(object,
+ m[0]->pindex + paging_offset, count);
+ }
+
} else {
swap_pager_ridpages(m, count, reqpage);
}
@@ -1297,7 +1319,7 @@ swap_pager_putpages(object, m, count, sync, rtvals)
swb[i]->swb_locked--;
}
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
for (i = firstidx; i < lastidx; i++) {
if (reqaddr[i] == SWB_EMPTY) {
printf("I/O to empty block???? -- pindex: %d, i: %d\n",
@@ -1348,9 +1370,11 @@ swap_pager_putpages(object, m, count, sync, rtvals)
}
spc = TAILQ_FIRST(&swap_pager_free);
- KASSERT(spc != NULL,
- ("swap_pager_putpages: free queue is empty, %d expected\n",
- swap_pager_free_count));
+#if defined(DIAGNOSTIC)
+ if (spc == NULL)
+ panic("swap_pager_putpages: free queue is empty, %d expected\n",
+ swap_pager_free_count);
+#endif
TAILQ_REMOVE(&swap_pager_free, spc, spc_list);
swap_pager_free_count--;
@@ -1358,7 +1382,7 @@ swap_pager_putpages(object, m, count, sync, rtvals)
bp = spc->spc_bp;
bzero(bp, sizeof *bp);
bp->b_spc = spc;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
bp->b_data = (caddr_t) kva;
} else {
spc = NULL;
@@ -1511,14 +1535,12 @@ swap_pager_putpages(object, m, count, sync, rtvals)
}
}
- if (spc != NULL) {
- if (bp->b_rcred != NOCRED)
- crfree(bp->b_rcred);
- if (bp->b_wcred != NOCRED)
- crfree(bp->b_wcred);
- spc_free(spc);
- } else
- relpbuf(bp);
+ if (bp->b_rcred != NOCRED)
+ crfree(bp->b_rcred);
+ if (bp->b_wcred != NOCRED)
+ crfree(bp->b_wcred);
+
+ spc_free(spc);
if (swap_pager_free_pending)
swap_pager_sync();
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
index ca5a53e9f1868..34deba7d0f78d 100644
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_extern.h 8.2 (Berkeley) 1/12/94
- * $Id: vm_extern.h,v 1.38 1998/06/07 17:13:09 dfr Exp $
+ * $Id: vm_extern.h,v 1.37 1998/01/22 17:30:32 dyson Exp $
*/
#ifndef _VM_EXTERN_H_
@@ -61,11 +61,7 @@ int swapon __P((struct proc *, void *, int *));
#endif
void faultin __P((struct proc *p));
-#ifndef VM_STACK
int grow __P((struct proc *, size_t));
-#else
-int grow_stack __P((struct proc *, size_t));
-#endif
int kernacc __P((caddr_t, int, int));
vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t));
vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t));
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index e3d64f92108d2..898ba8c9166e6 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -66,7 +66,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_fault.c,v 1.92 1999/01/08 17:31:24 eivind Exp $
+ * $Id: vm_fault.c,v 1.87 1998/08/24 08:39:37 dfr Exp $
*/
/*
@@ -183,6 +183,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, int fault_flags)
vm_page_t marray[VM_FAULT_READ];
int hardfault;
int faultcount;
+ struct proc *p = curproc; /* XXX */
struct faultstate fs;
cnt.v_vm_faults++; /* needs lock XXX */
@@ -275,7 +276,7 @@ RetryFault:;
fs.m = vm_page_lookup(fs.object, fs.pindex);
if (fs.m != NULL) {
- int queue, s;
+ int queue;
/*
* If the page is being brought in, wait for it and
* then retry.
@@ -283,6 +284,8 @@ RetryFault:;
if ((fs.m->flags & PG_BUSY) ||
(fs.m->busy &&
(fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL)) {
+ int s;
+
unlock_things(&fs);
s = splvm();
if ((fs.m->flags & PG_BUSY) ||
@@ -298,9 +301,7 @@ RetryFault:;
}
queue = fs.m->queue;
- s = splvm();
vm_page_unqueue_nowakeup(fs.m);
- splx(s);
/*
* Mark page busy for other processes, and the pagedaemon.
@@ -527,8 +528,11 @@ readrest:
vm_object_pip_add(fs.object, 1);
}
}
- KASSERT((fs.m->flags & PG_BUSY) != 0,
- ("vm_fault: not busy after main loop"));
+
+#if defined(DIAGNOSTIC)
+ if ((fs.m->flags & PG_BUSY) == 0)
+ panic("vm_fault: not busy after main loop");
+#endif
/*
* PAGE HAS BEEN FOUND. [Loop invariant still holds -- the object lock
@@ -735,7 +739,7 @@ readrest:
if (wired)
vm_page_wire(fs.m);
else
- vm_page_unwire(fs.m, 1);
+ vm_page_unwire(fs.m);
} else {
vm_page_activate(fs.m);
}
@@ -867,7 +871,7 @@ vm_fault_unwire(map, start, end)
pa = pmap_extract(pmap, va);
if (pa != (vm_offset_t) 0) {
pmap_change_wiring(pmap, va, FALSE);
- vm_page_unwire(PHYS_TO_VM_PAGE(pa), 1);
+ vm_page_unwire(PHYS_TO_VM_PAGE(pa));
}
}
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index ec844dbba2460..e73862d9fa9c2 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -59,7 +59,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_glue.c,v 1.79 1998/12/19 08:23:31 julian Exp $
+ * $Id: vm_glue.c,v 1.76 1998/09/29 17:33:59 abial Exp $
*/
#include "opt_rlimit.h"
@@ -229,7 +229,6 @@ vm_fork(p1, p2, flags)
up = p2->p_addr;
-#ifndef COMPAT_LINUX_THREADS
/*
* p_stats and p_sigacts currently point at fields in the user struct
* but not at &u, instead at p_addr. Copy p_sigacts and parts of
@@ -238,23 +237,6 @@ vm_fork(p1, p2, flags)
p2->p_stats = &up->u_stats;
p2->p_sigacts = &up->u_sigacts;
up->u_sigacts = *p1->p_sigacts;
-#else
- /*
- * p_stats currently points at fields in the user struct
- * but not at &u, instead at p_addr. Copy parts of
- * p_stats; zero the rest of p_stats (statistics).
- *
- * If procsig->ps_refcnt is 1 and p2->p_sigacts is NULL we dont' need
- * to share sigacts, so we use the up->u_sigacts.
- */
- p2->p_stats = &up->u_stats;
- if (p2->p_sigacts == NULL) {
- if (p2->p_procsig->ps_refcnt != 1)
- printf ("PID:%d NULL sigacts with refcnt not 1!\n",p2->p_pid);
- p2->p_sigacts = &up->u_sigacts;
- up->u_sigacts = *p1->p_sigacts;
- }
-#endif /* COMPAT_LINUX_THREADS */
bzero(&up->u_stats.pstat_startzero,
(unsigned) ((caddr_t) &up->u_stats.pstat_endzero -
(caddr_t) &up->u_stats.pstat_startzero));
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 829548a2250d3..7dbad01728f54 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.c,v 1.138 1998/10/25 17:44:58 phk Exp $
+ * $Id: vm_map.c,v 1.136 1998/10/01 20:46:41 jdp Exp $
*/
/*
@@ -75,9 +75,6 @@
#include <sys/vmmeter.h>
#include <sys/mman.h>
#include <sys/vnode.h>
-#ifdef VM_STACK
-#include <sys/resourcevar.h>
-#endif
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -95,6 +92,8 @@
#include <vm/swap_pager.h>
#include <vm/vm_zone.h>
+static MALLOC_DEFINE(M_VMMAP, "VM map", "VM map structures");
+
/*
* Virtual memory maps provide for the mapping, protection,
* and sharing of virtual memory objects. In addition,
@@ -541,10 +540,6 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
new_entry->eflags = protoeflags;
new_entry->object.vm_object = object;
new_entry->offset = offset;
-#ifdef VM_STACK
- new_entry->avail_ssize = 0;
-#endif
-
if (object) {
if ((object->ref_count > 1) || (object->shadow_count != 0)) {
vm_object_clear_flag(object, OBJ_ONEMAPPING);
@@ -577,204 +572,6 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
return (KERN_SUCCESS);
}
-#ifdef VM_STACK
-int
-vm_map_stack (vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
- vm_prot_t prot, vm_prot_t max, int cow)
-{
- vm_map_entry_t prev_entry;
- vm_map_entry_t new_stack_entry;
- vm_size_t init_ssize;
- int rv;
-
- if (VM_MIN_ADDRESS > 0 && addrbos < VM_MIN_ADDRESS)
- return (KERN_NO_SPACE);
-
- if (max_ssize < SGROWSIZ)
- init_ssize = max_ssize;
- else
- init_ssize = SGROWSIZ;
-
- vm_map_lock(map);
-
- /* If addr is already mapped, no go */
- if (vm_map_lookup_entry(map, addrbos, &prev_entry)) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* If we can't accomodate max_ssize in the current mapping,
- * no go. However, we need to be aware that subsequent user
- * mappings might map into the space we have reserved for
- * stack, and currently this space is not protected.
- *
- * Hopefully we will at least detect this condition
- * when we try to grow the stack.
- */
- if ((prev_entry->next != &map->header) &&
- (prev_entry->next->start < addrbos + max_ssize)) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* We initially map a stack of only init_ssize. We will
- * grow as needed later. Since this is to be a grow
- * down stack, we map at the top of the range.
- *
- * Note: we would normally expect prot and max to be
- * VM_PROT_ALL, and cow to be 0. Possibly we should
- * eliminate these as input parameters, and just
- * pass these values here in the insert call.
- */
- rv = vm_map_insert(map, NULL, 0, addrbos + max_ssize - init_ssize,
- addrbos + max_ssize, prot, max, cow);
-
- /* Now set the avail_ssize amount */
- if (rv == KERN_SUCCESS){
- new_stack_entry = prev_entry->next;
- if (new_stack_entry->end != addrbos + max_ssize ||
- new_stack_entry->start != addrbos + max_ssize - init_ssize)
- panic ("Bad entry start/end for new stack entry");
- else
- new_stack_entry->avail_ssize = max_ssize - init_ssize;
- }
-
- vm_map_unlock(map);
- return (rv);
-}
-
-/* Attempts to grow a vm stack entry. Returns KERN_SUCCESS if the
- * desired address is already mapped, or if we successfully grow
- * the stack. Also returns KERN_SUCCESS if addr is outside the
- * stack range (this is strange, but preserves compatibility with
- * the grow function in vm_machdep.c).
- */
-int
-vm_map_growstack (struct proc *p, vm_offset_t addr)
-{
- vm_map_entry_t prev_entry;
- vm_map_entry_t stack_entry;
- vm_map_entry_t new_stack_entry;
- struct vmspace *vm = p->p_vmspace;
- vm_map_t map = &vm->vm_map;
- vm_offset_t end;
- int grow_amount;
- int rv;
- int is_procstack = 0;
-
- vm_map_lock(map);
-
- /* If addr is already in the entry range, no need to grow.*/
- if (vm_map_lookup_entry(map, addr, &prev_entry)) {
- vm_map_unlock(map);
- return (KERN_SUCCESS);
- }
-
- if ((stack_entry = prev_entry->next) == &map->header) {
- vm_map_unlock(map);
- return (KERN_SUCCESS);
- }
- if (prev_entry == &map->header)
- end = stack_entry->start - stack_entry->avail_ssize;
- else
- end = prev_entry->end;
-
- /* This next test mimics the old grow function in vm_machdep.c.
- * It really doesn't quite make sense, but we do it anyway
- * for compatibility.
- *
- * If not growable stack, return success. This signals the
- * caller to proceed as he would normally with normal vm.
- */
- if (stack_entry->avail_ssize < 1 ||
- addr >= stack_entry->start ||
- addr < stack_entry->start - stack_entry->avail_ssize) {
- vm_map_unlock(map);
- return (KERN_SUCCESS);
- }
-
- /* Find the minimum grow amount */
- grow_amount = roundup (stack_entry->start - addr, PAGE_SIZE);
- if (grow_amount > stack_entry->avail_ssize) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* If there is no longer enough space between the entries
- * nogo, and adjust the available space. Note: this
- * should only happen if the user has mapped into the
- * stack area after the stack was created, and is
- * probably an error.
- *
- * This also effectively destroys any guard page the user
- * might have intended by limiting the stack size.
- */
- if (grow_amount > stack_entry->start - end) {
- stack_entry->avail_ssize = stack_entry->start - end;
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- if (addr >= (vm_offset_t)vm->vm_maxsaddr)
- is_procstack = 1;
-
- /* If this is the main process stack, see if we're over the
- * stack limit.
- */
- if (is_procstack && (vm->vm_ssize + grow_amount >
- p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
- vm_map_unlock(map);
- return (KERN_NO_SPACE);
- }
-
- /* Round up the grow amount modulo SGROWSIZ */
- grow_amount = roundup (grow_amount, SGROWSIZ);
- if (grow_amount > stack_entry->avail_ssize) {
- grow_amount = stack_entry->avail_ssize;
- }
- if (is_procstack && (vm->vm_ssize + grow_amount >
- p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
- grow_amount = p->p_rlimit[RLIMIT_STACK].rlim_cur -
- vm->vm_ssize;
- }
-
- /* Get the preliminary new entry start value */
- addr = stack_entry->start - grow_amount;
-
- /* If this puts us into the previous entry, cut back our growth
- * to the available space. Also, see the note above.
- */
- if (addr < end) {
- stack_entry->avail_ssize = stack_entry->start - end;
- addr = end;
- }
-
- rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start,
- stack_entry->protection,
- stack_entry->max_protection,
- 0);
-
- /* Adjust the available stack space by the amount we grew. */
- if (rv == KERN_SUCCESS) {
- new_stack_entry = prev_entry->next;
- if (new_stack_entry->end != stack_entry->start ||
- new_stack_entry->start != addr)
- panic ("Bad stack grow start/end in new stack entry");
- else {
- new_stack_entry->avail_ssize = stack_entry->avail_ssize -
- (new_stack_entry->end -
- new_stack_entry->start);
- vm->vm_ssize += new_stack_entry->end -
- new_stack_entry->start;
- }
- }
-
- vm_map_unlock(map);
- return (rv);
-
-}
-#endif
-
/*
* Find sufficient space for `length' bytes in the given map, starting at
* `start'. The map must be locked. Returns 0 on success, 1 on no space.
@@ -2957,9 +2754,9 @@ vm_freeze_copyopts(object, froma, toa)
vm_object_t object;
vm_pindex_t froma, toa;
{
- int rv;
- vm_object_t robject;
- vm_pindex_t idx;
+ int s, rv;
+ vm_object_t robject, robjectn;
+ vm_pindex_t idx, from, to;
if ((object == NULL) ||
((object->flags & OBJ_OPT) == 0))
@@ -2987,10 +2784,12 @@ vm_freeze_copyopts(object, froma, toa)
for (idx = 0; idx < robject->size; idx++) {
+m_outretry:
m_out = vm_page_grab(robject, idx,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if (m_out->valid == 0) {
+m_inretry:
m_in = vm_page_grab(object, bo_pindex + idx,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if (m_in->valid == 0) {
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index 4d61a3f8efbab..b7c6cd571b017 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.h,v 1.32 1998/01/22 17:30:38 dyson Exp $
+ * $Id: vm_map.h,v 1.31 1998/01/17 09:16:52 dyson Exp $
*/
/*
@@ -102,9 +102,6 @@ struct vm_map_entry {
struct vm_map_entry *next; /* next entry */
vm_offset_t start; /* start address */
vm_offset_t end; /* end address */
-#ifdef VM_STACK
- vm_offset_t avail_ssize; /* amt can grow if this is a stack */
-#endif
union vm_map_object object; /* object I point to */
vm_ooffset_t offset; /* offset into object */
u_char eflags; /* map entry flags */
@@ -338,10 +335,6 @@ void vm_map_simplify_entry __P((vm_map_t, vm_map_entry_t));
void vm_init2 __P((void));
int vm_uiomove __P((vm_map_t, vm_object_t, off_t, int, vm_offset_t, int *));
void vm_freeze_copyopts __P((vm_object_t, vm_pindex_t, vm_pindex_t));
-#ifdef VM_STACK
-int vm_map_stack __P((vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int));
-int vm_map_growstack __P((struct proc *p, vm_offset_t addr));
-#endif
#endif
#endif /* _VM_MAP_ */
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 5bc74bde8e944..4879535c73de0 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_meter.c 8.4 (Berkeley) 1/4/94
- * $Id: vm_meter.c,v 1.26 1998/08/24 08:39:37 dfr Exp $
+ * $Id: vm_meter.c,v 1.25 1998/03/30 09:56:49 phk Exp $
*/
#include <sys/param.h>
@@ -42,8 +42,6 @@
#include <sys/vmmeter.h>
#include <vm/vm.h>
-#include <vm/vm_prot.h>
-#include <vm/vm_page.h>
#include <vm/vm_extern.h>
#include <vm/vm_param.h>
#include <sys/lock.h>
@@ -217,103 +215,3 @@ vmtotal SYSCTL_HANDLER_ARGS
SYSCTL_PROC(_vm, VM_METER, vmmeter, CTLTYPE_OPAQUE|CTLFLAG_RD,
0, sizeof(struct vmtotal), vmtotal, "S,vmtotal", "");
-SYSCTL_NODE(_vm, OID_AUTO, stats, CTLFLAG_RW, 0, "VM meter stats");
-SYSCTL_NODE(_vm_stats, OID_AUTO, sys, CTLFLAG_RW, 0, "VM meter sys stats");
-SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, "VM meter vm stats");
-SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_swtch, CTLFLAG_RD, &cnt.v_swtch, 0, "Context switches");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_trap, CTLFLAG_RD, &cnt.v_trap, 0, "Traps");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_syscall, CTLFLAG_RD, &cnt.v_syscall, 0, "Syscalls");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_intr, CTLFLAG_RD, &cnt.v_intr, 0, "HW intr");
-SYSCTL_INT(_vm_stats_sys, OID_AUTO,
- v_soft, CTLFLAG_RD, &cnt.v_soft, 0, "SW intr");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vm_faults, CTLFLAG_RD, &cnt.v_vm_faults, 0, "VM faults");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cow_faults, CTLFLAG_RD, &cnt.v_cow_faults, 0, "COW faults");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cow_optim, CTLFLAG_RD, &cnt.v_cow_optim, 0, "Optimized COW faults");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_zfod, CTLFLAG_RD, &cnt.v_zfod, 0, "Zero fill");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_ozfod, CTLFLAG_RD, &cnt.v_ozfod, 0, "Optimized zero fill");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swapin, CTLFLAG_RD, &cnt.v_swapin, 0, "Swapin operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swapout, CTLFLAG_RD, &cnt.v_swapout, 0, "Swapout operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swappgsin, CTLFLAG_RD, &cnt.v_swappgsin, 0, "Swapin pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_swappgsout, CTLFLAG_RD, &cnt.v_swappgsout, 0, "Swapout pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodein, CTLFLAG_RD, &cnt.v_vnodein, 0, "Vnodein operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodeout, CTLFLAG_RD, &cnt.v_vnodeout, 0, "Vnodeout operations");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodepgsin, CTLFLAG_RD, &cnt.v_vnodepgsin, 0, "Vnodein pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_vnodepgsout, CTLFLAG_RD, &cnt.v_vnodepgsout, 0, "Vnodeout pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_intrans, CTLFLAG_RD, &cnt.v_intrans, 0, "In transit page blocking");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_reactivated, CTLFLAG_RD, &cnt.v_reactivated, 0, "Reactivated pages");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pdwakeups, CTLFLAG_RD, &cnt.v_pdwakeups, 0, "Pagedaemon wakeups");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pdpages, CTLFLAG_RD, &cnt.v_pdpages, 0, "Pagedaemon page scans");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_dfree, CTLFLAG_RD, &cnt.v_dfree, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pfree, CTLFLAG_RD, &cnt.v_pfree, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_tfree, CTLFLAG_RD, &cnt.v_tfree, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_page_size, CTLFLAG_RD, &cnt.v_page_size, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_page_count, CTLFLAG_RD, &cnt.v_page_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_reserved, CTLFLAG_RD, &cnt.v_free_reserved, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_target, CTLFLAG_RD, &cnt.v_free_target, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_min, CTLFLAG_RD, &cnt.v_free_min, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_free_count, CTLFLAG_RD, &cnt.v_free_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_wire_count, CTLFLAG_RD, &cnt.v_wire_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_active_count, CTLFLAG_RD, &cnt.v_active_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_inactive_target, CTLFLAG_RD, &cnt.v_inactive_target, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_inactive_count, CTLFLAG_RD, &cnt.v_inactive_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cache_count, CTLFLAG_RD, &cnt.v_cache_count, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cache_min, CTLFLAG_RD, &cnt.v_cache_min, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_cache_max, CTLFLAG_RD, &cnt.v_cache_max, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_pageout_free_min, CTLFLAG_RD, &cnt.v_pageout_free_min, 0, "");
-SYSCTL_INT(_vm_stats_vm, OID_AUTO,
- v_interrupt_free_min, CTLFLAG_RD, &cnt.v_interrupt_free_min, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- zero_page_count, CTLFLAG_RD, &vm_page_zero_count, 0, "");
-#if 0
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- page_mask, CTLFLAG_RD, &page_mask, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- page_shift, CTLFLAG_RD, &page_shift, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- first_page, CTLFLAG_RD, &first_page, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- last_page, CTLFLAG_RD, &last_page, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- vm_page_bucket_count, CTLFLAG_RD, &vm_page_bucket_count, 0, "");
-SYSCTL_INT(_vm_stats_misc, OID_AUTO,
- vm_page_hash_mask, CTLFLAG_RD, &vm_page_hash_mask, 0, "");
-#endif
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index ba36e41fc6327..6ea214a735268 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -38,7 +38,7 @@
* from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$
*
* @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94
- * $Id: vm_mmap.c,v 1.85 1998/12/09 20:22:21 dt Exp $
+ * $Id: vm_mmap.c,v 1.83 1998/09/04 08:06:57 dfr Exp $
*/
/*
@@ -173,19 +173,11 @@ mmap(p, uap)
pos = uap->pos;
/* make sure mapping fits into numeric range etc */
- if ((ssize_t) uap->len < 0 ||
+ if ((pos + size > (vm_offset_t)-PAGE_SIZE) ||
+ (ssize_t) uap->len < 0 ||
((flags & MAP_ANON) && uap->fd != -1))
return (EINVAL);
-#ifdef VM_STACK
- if (flags & MAP_STACK) {
- if ((uap->fd != -1) ||
- ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE)))
- return (EINVAL);
- flags |= MAP_ANON;
- pos = 0;
- }
-#endif
/*
* Align the file position to a page boundary,
* and save its page offset component.
@@ -1025,12 +1017,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
*addr = pmap_addr_hint(object, *addr, size);
}
-#ifdef VM_STACK
- if (flags & MAP_STACK)
- rv = vm_map_stack (map, *addr, size, prot,
- maxprot, docow);
- else
-#endif
rv = vm_map_find(map, object, foff, addr, size, fitit,
prot, maxprot, docow);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index a1477f222822b..f419e2f51282b 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.137 1999/01/08 17:31:26 eivind Exp $
+ * $Id: vm_object.c,v 1.128 1998/09/04 08:06:57 dfr Exp $
*/
/*
@@ -91,6 +91,7 @@
#include <vm/vm_zone.h>
static void vm_object_qcollapse __P((vm_object_t object));
+static void vm_object_dispose __P((vm_object_t));
/*
* Virtual memory objects maintain the actual data
@@ -119,9 +120,7 @@ static void vm_object_qcollapse __P((vm_object_t object));
*/
struct object_q vm_object_list;
-#ifndef NULL_SIMPLELOCKS
static struct simplelock vm_object_list_lock;
-#endif
static long vm_object_count; /* count of all objects */
vm_object_t kernel_object;
vm_object_t kmem_object;
@@ -242,8 +241,10 @@ vm_object_reference(object)
if (object == NULL)
return;
- KASSERT(!(object->flags & OBJ_DEAD),
- ("vm_object_reference: attempting to reference dead obj"));
+#if defined(DIAGNOSTIC)
+ if (object->flags & OBJ_DEAD)
+ panic("vm_object_reference: attempting to reference dead obj");
+#endif
object->ref_count++;
if (object->type == OBJT_VNODE) {
@@ -260,11 +261,11 @@ vm_object_vndeallocate(object)
vm_object_t object;
{
struct vnode *vp = (struct vnode *) object->handle;
-
- KASSERT(object->type == OBJT_VNODE,
- ("vm_object_vndeallocate: not a vnode object"));
- KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp"));
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
+ if (object->type != OBJT_VNODE)
+ panic("vm_object_vndeallocate: not a vnode object");
+ if (vp == NULL)
+ panic("vm_object_vndeallocate: missing vp");
if (object->ref_count == 0) {
vprint("vm_object_vndeallocate", vp);
panic("vm_object_vndeallocate: bad object reference count");
@@ -294,6 +295,7 @@ void
vm_object_deallocate(object)
vm_object_t object;
{
+ int s;
vm_object_t temp;
while (object != NULL) {
@@ -326,10 +328,12 @@ vm_object_deallocate(object)
vm_object_t robject;
robject = TAILQ_FIRST(&object->shadow_head);
- KASSERT(robject != NULL,
- ("vm_object_deallocate: ref_count: %d, shadow_count: %d",
- object->ref_count,
- object->shadow_count));
+#if defined(DIAGNOSTIC)
+ if (robject == NULL)
+ panic("vm_object_deallocate: ref_count: %d,"
+ " shadow_count: %d",
+ object->ref_count, object->shadow_count);
+#endif
if ((robject->handle == NULL) &&
(robject->type == OBJT_DEFAULT ||
robject->type == OBJT_SWAP)) {
@@ -414,8 +418,10 @@ vm_object_terminate(object)
*/
vm_object_pip_wait(object, "objtrm");
- KASSERT(!object->paging_in_progress,
- ("vm_object_terminate: pageout in progress"));
+#if defined(DIAGNOSTIC)
+ if (object->paging_in_progress != 0)
+ panic("vm_object_terminate: pageout in progress");
+#endif
/*
* Clean and free the pages, as appropriate. All references to the
@@ -436,51 +442,58 @@ vm_object_terminate(object)
vp = (struct vnode *) object->handle;
vinvalbuf(vp, V_SAVE, NOCRED, NULL, 0, 0);
+
+ /*
+ * Let the pager know object is dead.
+ */
+ vm_pager_deallocate(object);
+
}
- if (object->ref_count != 0)
- panic("vm_object_terminate: object with references, ref_count=%d", object->ref_count);
+ if ((object->type != OBJT_VNODE) && (object->ref_count == 0)) {
- /*
- * Now free any remaining pages. For internal objects, this also
- * removes them from paging queues. Don't free wired pages, just
- * remove them from the object.
- */
- s = splvm();
- while ((p = TAILQ_FIRST(&object->memq)) != NULL) {
+ /*
+ * Now free the pages. For internal objects, this also removes them
+ * from paging queues.
+ */
+ while ((p = TAILQ_FIRST(&object->memq)) != NULL) {
#if !defined(MAX_PERF)
- if (p->busy || (p->flags & PG_BUSY))
- printf("vm_object_terminate: freeing busy page\n");
+ if (p->busy || (p->flags & PG_BUSY))
+ printf("vm_object_terminate: freeing busy page\n");
#endif
- if (p->wire_count == 0) {
vm_page_busy(p);
vm_page_free(p);
cnt.v_pfree++;
- } else {
- vm_page_busy(p);
- vm_page_remove(p);
}
- }
- splx(s);
-
- /*
- * Let the pager know object is dead.
- */
- vm_pager_deallocate(object);
+ /*
+ * Let the pager know object is dead.
+ */
+ vm_pager_deallocate(object);
- /*
- * Remove the object from the global object list.
- */
- simple_lock(&vm_object_list_lock);
- TAILQ_REMOVE(&vm_object_list, object, object_list);
- simple_unlock(&vm_object_list_lock);
+ }
- wakeup(object);
+ if ((object->ref_count == 0) && (object->resident_page_count == 0))
+ vm_object_dispose(object);
+}
- /*
- * Free the space for the object.
- */
- zfree(obj_zone, object);
+/*
+ * vm_object_dispose
+ *
+ * Dispose the object.
+ */
+static void
+vm_object_dispose(object)
+ vm_object_t object;
+{
+ simple_lock(&vm_object_list_lock);
+ TAILQ_REMOVE(&vm_object_list, object, object_list);
+ vm_object_count--;
+ simple_unlock(&vm_object_list_lock);
+ /*
+ * Free the space for the object.
+ */
+ zfree(obj_zone, object);
+ wakeup(object);
}
/*
@@ -516,6 +529,7 @@ vm_object_page_clean(object, start, end, flags)
vm_page_t mab[vm_pageout_page_count];
vm_page_t ma[vm_pageout_page_count];
int curgeneration;
+ struct proc *pproc = curproc; /* XXX */
if (object->type != OBJT_VNODE ||
(object->flags & OBJ_MIGHTBEDIRTY) == 0)
@@ -771,6 +785,7 @@ vm_object_madvise(object, pindex, count, advise)
int count;
int advise;
{
+ int s;
vm_pindex_t end, tpindex;
vm_object_t tobject;
vm_page_t m;
@@ -1292,7 +1307,7 @@ vm_object_page_remove(object, start, end, clean_only)
{
register vm_page_t p, next;
unsigned int size;
- int all;
+ int s, all;
if (object == NULL)
return;
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index c953559da6685..46f192389e6f7 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
- * $Id: vm_page.c,v 1.115 1999/01/08 17:31:27 eivind Exp $
+ * $Id: vm_page.c,v 1.106 1998/08/24 08:39:38 dfr Exp $
*/
/*
@@ -352,7 +352,6 @@ vm_page_startup(starta, enda, vaddr)
* Distributes the object/offset key pair among hash buckets.
*
* NOTE: This macro depends on vm_page_bucket_count being a power of 2.
- * This routine may not block.
*/
static __inline int
vm_page_hash(object, pindex)
@@ -365,15 +364,10 @@ vm_page_hash(object, pindex)
/*
* vm_page_insert: [ internal use only ]
*
- * Inserts the given mem entry into the object and object list.
- *
- * The pagetables are not updated but will presumably fault the page
- * in if necessary, or if a kernel page the caller will at some point
- * enter the page into the kernel's pmap. We are not allowed to block
- * here so we *can't* do this anyway.
+ * Inserts the given mem entry into the object/object-page
+ * table and object list.
*
* The object and page must be locked, and must be splhigh.
- * This routine may not block.
*/
void
@@ -384,8 +378,10 @@ vm_page_insert(m, object, pindex)
{
register struct pglist *bucket;
- if (m->object != NULL)
+#if !defined(MAX_PERF)
+ if (m->flags & PG_TABLED)
panic("vm_page_insert: already inserted");
+#endif
/*
* Record the object/offset pair in this page
@@ -407,6 +403,7 @@ vm_page_insert(m, object, pindex)
*/
TAILQ_INSERT_TAIL(&object->memq, m, listq);
+ vm_page_flag_set(m, PG_TABLED);
m->object->page_hint = m;
m->object->generation++;
@@ -431,9 +428,6 @@ vm_page_insert(m, object, pindex)
* table and the object page list.
*
* The object and page must be locked, and at splhigh.
- * This routine may not block.
- *
- * I do not think the underlying pmap entry (if any) is removed here.
*/
void
@@ -443,7 +437,7 @@ vm_page_remove(m)
register struct pglist *bucket;
vm_object_t object;
- if (m->object == NULL)
+ if (!(m->flags & PG_TABLED))
return;
#if !defined(MAX_PERF)
@@ -488,8 +482,9 @@ vm_page_remove(m)
object->resident_page_count--;
object->generation++;
-
m->object = NULL;
+
+ vm_page_flag_clear(m, PG_TABLED);
}
/*
@@ -499,7 +494,6 @@ vm_page_remove(m)
* pair specified; if none is found, NULL is returned.
*
* The object must be locked. No side effects.
- * This routine may not block.
*/
vm_page_t
@@ -510,6 +504,7 @@ vm_page_lookup(object, pindex)
register vm_page_t m;
register struct pglist *bucket;
int generation;
+ int s;
/*
* Search the hash table for this object/offset pair
@@ -542,11 +537,7 @@ retry:
* current object to the specified target object/offset.
*
* The object must be locked.
- * This routine may not block.
- *
- * Note: this routine will raise itself to splvm(), the caller need not.
*/
-
void
vm_page_rename(m, new_object, new_pindex)
register vm_page_t m;
@@ -562,14 +553,8 @@ vm_page_rename(m, new_object, new_pindex)
}
/*
- * vm_page_unqueue_nowakeup:
- *
- * vm_page_unqueue() without any wakeup
- *
- * This routine must be called at splhigh().
- * This routine may not block.
+ * vm_page_unqueue without any wakeup
*/
-
void
vm_page_unqueue_nowakeup(m)
vm_page_t m;
@@ -590,14 +575,8 @@ vm_page_unqueue_nowakeup(m)
}
/*
- * vm_page_unqueue:
- *
- * Remove a page from its queue.
- *
- * This routine must be called at splhigh().
- * This routine may not block.
+ * vm_page_unqueue must be called at splhigh();
*/
-
void
vm_page_unqueue(m)
vm_page_t m;
@@ -621,12 +600,7 @@ vm_page_unqueue(m)
}
/*
- * vm_page_list_find:
- *
- * Find a page on the specified queue with color optimization.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a page on the specified queue with color optimization.
*/
vm_page_t
vm_page_list_find(basequeue, index)
@@ -680,12 +654,7 @@ vm_page_list_find(basequeue, index)
}
/*
- * vm_page_select:
- *
- * Find a page on the specified queue with color optimization.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a page on the specified queue with color optimization.
*/
vm_page_t
vm_page_select(object, pindex, basequeue)
@@ -706,14 +675,9 @@ vm_page_select(object, pindex, basequeue)
}
/*
- * vm_page_select_cache:
- *
- * Find a page on the cache queue with color optimization. As pages
- * might be found, but not applicable, they are deactivated. This
- * keeps us from using potentially busy cached pages.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a page on the cache queue with color optimization. As pages
+ * might be found, but not applicable, they are deactivated. This
+ * keeps us from using potentially busy cached pages.
*/
vm_page_t
vm_page_select_cache(object, pindex)
@@ -741,14 +705,8 @@ vm_page_select_cache(object, pindex)
}
/*
- * vm_page_select_free:
- *
- * Find a free or zero page, with specified preference.
- *
- * This routine must be called at splvm().
- * This routine may not block.
+ * Find a free or zero page, with specified preference.
*/
-
static vm_page_t
vm_page_select_free(object, pindex, prefqueue)
vm_object_t object;
@@ -852,11 +810,6 @@ vm_page_select_free(object, pindex, prefqueue)
* VM_ALLOC_ZERO zero page
*
* Object must be locked.
- * This routine may not block.
- *
- * Additional special handling is required when called from an
- * interrupt (VM_ALLOC_INTERRUPT). We are not allowed to mess with
- * the page cache in this case.
*/
vm_page_t
vm_page_alloc(object, pindex, page_req)
@@ -870,8 +823,11 @@ vm_page_alloc(object, pindex, page_req)
int queue, qtype;
int s;
- KASSERT(!vm_page_lookup(object, pindex),
- ("vm_page_alloc: page already allocated"));
+#ifdef DIAGNOSTIC
+ m = vm_page_lookup(object, pindex);
+ if (m)
+ panic("vm_page_alloc: page already allocated");
+#endif
if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT)) {
page_req = VM_ALLOC_SYSTEM;
@@ -884,7 +840,10 @@ vm_page_alloc(object, pindex, page_req)
case VM_ALLOC_NORMAL:
if (cnt.v_free_count >= cnt.v_free_reserved) {
m = vm_page_select_free(object, pindex, PQ_FREE);
- KASSERT(m != NULL, ("vm_page_alloc(NORMAL): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(NORMAL): missing page on free queue\n");
+#endif
} else {
m = vm_page_select_cache(object, pindex);
if (m == NULL) {
@@ -903,7 +862,10 @@ vm_page_alloc(object, pindex, page_req)
case VM_ALLOC_ZERO:
if (cnt.v_free_count >= cnt.v_free_reserved) {
m = vm_page_select_free(object, pindex, PQ_ZERO);
- KASSERT(m != NULL, ("vm_page_alloc(ZERO): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(ZERO): missing page on free queue\n");
+#endif
} else {
m = vm_page_select_cache(object, pindex);
if (m == NULL) {
@@ -924,7 +886,10 @@ vm_page_alloc(object, pindex, page_req)
((cnt.v_cache_count == 0) &&
(cnt.v_free_count >= cnt.v_interrupt_free_min))) {
m = vm_page_select_free(object, pindex, PQ_FREE);
- KASSERT(m != NULL, ("vm_page_alloc(SYSTEM): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(SYSTEM): missing page on free queue\n");
+#endif
} else {
m = vm_page_select_cache(object, pindex);
if (m == NULL) {
@@ -943,7 +908,10 @@ vm_page_alloc(object, pindex, page_req)
case VM_ALLOC_INTERRUPT:
if (cnt.v_free_count > 0) {
m = vm_page_select_free(object, pindex, PQ_FREE);
- KASSERT(m != NULL, ("vm_page_alloc(INTERRUPT): missing page on free queue\n"));
+#if defined(DIAGNOSTIC)
+ if (m == NULL)
+ panic("vm_page_alloc(INTERRUPT): missing page on free queue\n");
+#endif
} else {
splx(s);
vm_pageout_deficit++;
@@ -986,13 +954,7 @@ vm_page_alloc(object, pindex, page_req)
m->dirty = 0;
m->queue = PQ_NONE;
- /*
- * vm_page_insert() is safe prior to the splx(). Note also that
- * inserting a page here does not insert it into the pmap (which
- * could cause us to block allocating memory). We cannot block
- * anywhere.
- */
-
+ /* XXX before splx until vm_page_insert is safe */
vm_page_insert(m, object, pindex);
/*
@@ -1022,12 +984,6 @@ vm_page_alloc(object, pindex, page_req)
return (m);
}
-/*
- * vm_wait: (also see VM_WAIT macro)
- *
- * Block until free pages are available for allocation
- */
-
void
vm_wait()
{
@@ -1047,14 +1003,9 @@ vm_wait()
splx(s);
}
-/*
- * vm_page_sleep:
- *
- * Block until page is no longer busy.
- */
-
int
vm_page_sleep(vm_page_t m, char *msg, char *busy) {
+ vm_object_t object = m->object;
int slept = 0;
if ((busy && *busy) || (m->flags & PG_BUSY)) {
int s;
@@ -1075,13 +1026,14 @@ vm_page_sleep(vm_page_t m, char *msg, char *busy) {
* Put the specified page on the active list (if appropriate).
*
* The page queues must be locked.
- * This routine may not block.
*/
void
vm_page_activate(m)
register vm_page_t m;
{
int s;
+ vm_page_t np;
+ vm_object_t object;
s = splvm();
if (m->queue != PQ_ACTIVE) {
@@ -1107,9 +1059,7 @@ vm_page_activate(m)
}
/*
- * helper routine for vm_page_free and vm_page_free_zero.
- *
- * This routine may not block.
+ * helper routine for vm_page_free and vm_page_free_zero
*/
static int
vm_page_freechk_and_unqueue(m)
@@ -1149,7 +1099,6 @@ vm_page_freechk_and_unqueue(m)
m->wire_count, m->pindex);
}
#endif
- printf("vm_page_free: freeing wired page\n");
m->wire_count = 0;
if (m->object)
m->object->wire_count--;
@@ -1176,9 +1125,7 @@ vm_page_freechk_and_unqueue(m)
}
/*
- * helper routine for vm_page_free and vm_page_free_zero.
- *
- * This routine may not block.
+ * helper routine for vm_page_free and vm_page_free_zero
*/
static __inline void
vm_page_free_wakeup()
@@ -1211,7 +1158,6 @@ vm_page_free_wakeup()
* disassociating it with any VM object.
*
* Object and page must be locked prior to entry.
- * This routine may not block.
*/
void
vm_page_free(m)
@@ -1284,7 +1230,6 @@ vm_page_free_zero(m)
* as necessary.
*
* The page queues must be locked.
- * This routine may not block.
*/
void
vm_page_wire(m)
@@ -1292,16 +1237,16 @@ vm_page_wire(m)
{
int s;
- s = splvm();
if (m->wire_count == 0) {
+ s = splvm();
vm_page_unqueue(m);
+ splx(s);
cnt.v_wire_count++;
if (m->object)
m->object->wire_count++;
}
- m->wire_count++;
- splx(s);
(*vm_page_queues[PQ_NONE].lcnt)++;
+ m->wire_count++;
vm_page_flag_set(m, PG_MAPPED);
}
@@ -1312,12 +1257,10 @@ vm_page_wire(m)
* enabling it to be paged again.
*
* The page queues must be locked.
- * This routine may not block.
*/
void
-vm_page_unwire(m, activate)
+vm_page_unwire(m)
register vm_page_t m;
- int activate;
{
int s;
@@ -1329,17 +1272,10 @@ vm_page_unwire(m, activate)
if (m->object)
m->object->wire_count--;
cnt.v_wire_count--;
- if (activate) {
- TAILQ_INSERT_TAIL(&vm_page_queue_active, m, pageq);
- m->queue = PQ_ACTIVE;
- (*vm_page_queues[PQ_ACTIVE].lcnt)++;
- cnt.v_active_count++;
- } else {
- TAILQ_INSERT_TAIL(&vm_page_queue_inactive, m, pageq);
- m->queue = PQ_INACTIVE;
- (*vm_page_queues[PQ_INACTIVE].lcnt)++;
- cnt.v_inactive_count++;
- }
+ TAILQ_INSERT_TAIL(&vm_page_queue_active, m, pageq);
+ m->queue = PQ_ACTIVE;
+ (*vm_page_queues[PQ_ACTIVE].lcnt)++;
+ cnt.v_active_count++;
}
} else {
#if !defined(MAX_PERF)
@@ -1351,9 +1287,13 @@ vm_page_unwire(m, activate)
/*
- * Move the specified page to the inactive queue.
+ * vm_page_deactivate:
+ *
+ * Returns the given page to the inactive list,
+ * indicating that no physical maps have access
+ * to this page. [Used by the physical mapping system.]
*
- * This routine may not block.
+ * The page queues must be locked.
*/
void
vm_page_deactivate(m)
@@ -1362,7 +1302,11 @@ vm_page_deactivate(m)
int s;
/*
- * Ignore if already inactive.
+ * Only move active pages -- ignore locked or already inactive ones.
+ *
+ * XXX: sometimes we get pages which aren't wired down or on any queue -
+ * we need to put them on the inactive queue also, otherwise we lose
+ * track of them. Paul Mackerras (paulus@cs.anu.edu.au) 9-Jan-93.
*/
if (m->queue == PQ_INACTIVE)
return;
@@ -1383,8 +1327,7 @@ vm_page_deactivate(m)
/*
* vm_page_cache
*
- * Put the specified page onto the page cache queue (if appropriate).
- * This routine may not block.
+ * Put the specified page onto the page cache queue (if appropriate).
*/
void
vm_page_cache(m)
@@ -1422,8 +1365,6 @@ vm_page_cache(m)
* Grab a page, waiting until we are waken up due to the page
* changing state. We keep on waiting, if the page continues
* to be in the object. If the page doesn't exist, allocate it.
- *
- * This routine may block.
*/
vm_page_t
vm_page_grab(object, pindex, allocflags)
@@ -1471,7 +1412,7 @@ retrylookup:
/*
* mapping function for valid bits or for dirty bits in
- * a page. May not block.
+ * a page
*/
__inline int
vm_page_bits(int base, int size)
@@ -1493,7 +1434,7 @@ vm_page_bits(int base, int size)
}
/*
- * set a page valid and clean. May not block.
+ * set a page valid and clean
*/
void
vm_page_set_validclean(m, base, size)
@@ -1509,7 +1450,7 @@ vm_page_set_validclean(m, base, size)
}
/*
- * set a page (partially) invalid. May not block.
+ * set a page (partially) invalid
*/
void
vm_page_set_invalid(m, base, size)
@@ -1526,7 +1467,7 @@ vm_page_set_invalid(m, base, size)
}
/*
- * is (partial) page valid? May not block.
+ * is (partial) page valid?
*/
int
vm_page_is_valid(m, base, size)
@@ -1542,10 +1483,6 @@ vm_page_is_valid(m, base, size)
return 0;
}
-/*
- * update dirty bits from pmap/mmu. May not block.
- */
-
void
vm_page_test_dirty(m)
vm_page_t m;
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 3149391d91277..32c83410f73f1 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_page.h,v 1.48 1998/10/28 13:37:02 dg Exp $
+ * $Id: vm_page.h,v 1.45 1998/09/01 17:12:19 wollman Exp $
*/
/*
@@ -203,6 +203,7 @@ extern struct vpgqueues {
*/
#define PG_BUSY 0x01 /* page is in transit (O) */
#define PG_WANTED 0x02 /* someone is waiting for page (O) */
+#define PG_TABLED 0x04 /* page is in an object (O) */
#define PG_FICTITIOUS 0x08 /* physical page doesn't exist (O) */
#define PG_WRITEABLE 0x10 /* page is mapped writeable */
#define PG_MAPPED 0x20 /* page is mapped */
@@ -361,7 +362,7 @@ vm_page_t vm_page_lookup __P((vm_object_t, vm_pindex_t));
void vm_page_remove __P((vm_page_t));
void vm_page_rename __P((vm_page_t, vm_object_t, vm_pindex_t));
vm_offset_t vm_page_startup __P((vm_offset_t, vm_offset_t, vm_offset_t));
-void vm_page_unwire __P((vm_page_t, int));
+void vm_page_unwire __P((vm_page_t));
void vm_page_wire __P((vm_page_t));
void vm_page_unqueue __P((vm_page_t));
void vm_page_unqueue_nowakeup __P((vm_page_t));
@@ -391,8 +392,12 @@ vm_page_hold(vm_page_t mem)
static __inline void
vm_page_unhold(vm_page_t mem)
{
+#ifdef DIAGNOSTIC
+ if (--mem->hold_count < 0)
+ panic("vm_page_unhold: hold count < 0!!!");
+#else
--mem->hold_count;
- KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!"));
+#endif
}
static __inline void
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 606981f819e46..a9e9cfbe1df5a 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -65,7 +65,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pageout.c,v 1.128 1998/10/25 17:44:59 phk Exp $
+ * $Id: vm_pageout.c,v 1.126 1998/09/04 08:06:57 dfr Exp $
*/
/*
@@ -155,19 +155,19 @@ static int vm_swap_idle_enabled=0;
#endif
SYSCTL_INT(_vm, VM_PAGEOUT_ALGORITHM, pageout_algorithm,
- CTLFLAG_RW, &vm_pageout_algorithm_lru, 0, "LRU page mgmt");
+ CTLFLAG_RW, &vm_pageout_algorithm_lru, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_stats_max,
- CTLFLAG_RW, &vm_pageout_stats_max, 0, "Max pageout stats scan length");
+ CTLFLAG_RW, &vm_pageout_stats_max, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_full_stats_interval,
- CTLFLAG_RW, &vm_pageout_full_stats_interval, 0, "Interval for full stats scan");
+ CTLFLAG_RW, &vm_pageout_full_stats_interval, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_stats_interval,
- CTLFLAG_RW, &vm_pageout_stats_interval, 0, "Interval for partial stats scan");
+ CTLFLAG_RW, &vm_pageout_stats_interval, 0, "");
SYSCTL_INT(_vm, OID_AUTO, pageout_stats_free_max,
- CTLFLAG_RW, &vm_pageout_stats_free_max, 0, "Not implemented");
+ CTLFLAG_RW, &vm_pageout_stats_free_max, 0, "");
#if defined(NO_SWAPPING)
SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled,
@@ -176,19 +176,19 @@ SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled,
CTLFLAG_RD, &vm_swap_idle_enabled, 0, "");
#else
SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled,
- CTLFLAG_RW, &vm_swap_enabled, 0, "Enable entire process swapout");
+ CTLFLAG_RW, &vm_swap_enabled, 0, "");
SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled,
- CTLFLAG_RW, &vm_swap_idle_enabled, 0, "Allow swapout on idle criteria");
+ CTLFLAG_RW, &vm_swap_idle_enabled, 0, "");
#endif
SYSCTL_INT(_vm, OID_AUTO, defer_swapspace_pageouts,
- CTLFLAG_RW, &defer_swap_pageouts, 0, "Give preference to dirty pages in mem");
+ CTLFLAG_RW, &defer_swap_pageouts, 0, "");
SYSCTL_INT(_vm, OID_AUTO, disable_swapspace_pageouts,
- CTLFLAG_RW, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages");
+ CTLFLAG_RW, &disable_swap_pageouts, 0, "");
SYSCTL_INT(_vm, OID_AUTO, max_page_launder,
- CTLFLAG_RW, &max_page_launder, 0, "Maximum number of pages to clean per pass");
+ CTLFLAG_RW, &max_page_launder, 0, "");
#define VM_PAGEOUT_PAGE_COUNT 16
@@ -1221,6 +1221,7 @@ vm_pageout()
* The pageout daemon is never done, so loop forever.
*/
while (TRUE) {
+ int inactive_target;
int error;
int s = splvm();
if (!vm_pages_needed ||
@@ -1274,6 +1275,7 @@ vm_req_vmdaemon()
static void
vm_daemon()
{
+ vm_object_t object;
struct proc *p;
while (TRUE) {
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index 18df05d88e665..21267e00fb19b 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pager.c,v 1.39 1998/10/31 15:31:29 peter Exp $
+ * $Id: vm_pager.c,v 1.37 1998/03/16 01:56:01 dyson Exp $
*/
/*
@@ -71,7 +71,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/ucred.h>
#include <sys/malloc.h>
@@ -214,7 +213,7 @@ vm_pager_bufferinit()
for (i = 0; i < nswbuf; i++, bp++) {
TAILQ_INSERT_HEAD(&bswlist, bp, b_freelist);
bp->b_rcred = bp->b_wcred = NOCRED;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
}
swapbkva = kmem_alloc_pageable(pager_map, nswbuf * MAXPHYS);
@@ -337,7 +336,7 @@ initpbuf(struct buf *bp) {
bp->b_data = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva;
bp->b_kvabase = bp->b_data;
bp->b_kvasize = MAXPHYS;
- bp->b_xflags = 0;
+ bp->b_vnbufs.le_next = NOLIST;
}
/*
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index bfcebdc028c9d..10488d9a21845 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_swap.c 8.5 (Berkeley) 2/17/94
- * $Id: vm_swap.c,v 1.56 1998/07/04 22:30:26 julian Exp $
+ * $Id: vm_swap.c,v 1.55 1998/07/04 20:45:42 julian Exp $
*/
#include "opt_devfs.h"
@@ -203,8 +203,8 @@ swapon(p, uap)
switch (vp->v_type) {
case VBLK:
- dev = vp->v_rdev;
- if (major(dev) >= nblkdev || bdevsw[major(dev)] == NULL) {
+ dev = (dev_t) vp->v_rdev;
+ if (major(dev) >= nblkdev) {
error = ENXIO;
break;
}
@@ -264,11 +264,14 @@ swaponvp(p, vp, dev, nblks)
}
return EINVAL;
found:
+ if (dev != NODEV && (major(dev) >= nblkdev))
+ return (ENXIO);
+
error = VOP_OPEN(vp, FREAD | FWRITE, p->p_ucred, p);
if (error)
return (error);
- if (nblks == 0 && dev != NODEV && (bdevsw[major(dev)]->d_psize == 0 ||
+ if (nblks == 0 && (bdevsw[major(dev)]->d_psize == 0 ||
(nblks = (*bdevsw[major(dev)]->d_psize) (dev)) == -1)) {
(void) VOP_CLOSE(vp, FREAD | FWRITE, p->p_ucred, p);
return (ENXIO);
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c
index 0d684a74d3216..11a7ae0797086 100644
--- a/sys/vm/vm_zone.c
+++ b/sys/vm/vm_zone.c
@@ -11,7 +11,7 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
- * $Id: vm_zone.c,v 1.25 1999/01/08 17:31:29 eivind Exp $
+ * $Id: vm_zone.c,v 1.21 1998/04/25 04:50:01 dyson Exp $
*/
#include <sys/param.h>
@@ -194,7 +194,7 @@ zbootinit(vm_zone_t z, char *name, int size, void *item, int nitems)
z->zitems = NULL;
for (i = 0; i < nitems; i++) {
((void **) item)[0] = z->zitems;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
((void **) item)[1] = (void *) ZENTRY_FREE;
#endif
z->zitems = item;
@@ -357,7 +357,7 @@ _zget(vm_zone_t z)
nitems -= 1;
for (i = 0; i < nitems; i++) {
((void **) item)[0] = z->zitems;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
((void **) item)[1] = (void *) ZENTRY_FREE;
#endif
z->zitems = item;
@@ -367,7 +367,7 @@ _zget(vm_zone_t z)
} else if (z->zfreecnt > 0) {
item = z->zitems;
z->zitems = ((void **) item)[0];
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (((void **) item)[1] != (void *) ZENTRY_FREE)
zerror(ZONE_ERROR_NOTFREE);
((void **) item)[1] = 0;
@@ -388,8 +388,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS
char tmpbuf[128];
char tmpname[14];
- snprintf(tmpbuf, sizeof(tmpbuf),
- "\nITEM SIZE LIMIT USED FREE REQUESTS\n");
+ sprintf(tmpbuf, "\nITEM SIZE LIMIT USED FREE REQUESTS\n");
error = SYSCTL_OUT(req, tmpbuf, strlen(tmpbuf));
if (error)
return (error);
@@ -414,7 +413,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS
tmpbuf[0] = '\n';
}
- snprintf(tmpbuf + offset, sizeof(tmpbuf) - offset,
+ sprintf(tmpbuf + offset,
"%s %6.6u, %8.8u, %6.6u, %6.6u, %8.8u\n",
tmpname, curzone->zsize, curzone->zmax,
(curzone->ztotal - curzone->zfreecnt),
@@ -432,7 +431,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS
return (0);
}
-#ifdef INVARIANT_SUPPORT
+#if defined(DIAGNOSTIC)
void
zerror(int error)
{
@@ -460,8 +459,8 @@ SYSCTL_OID(_vm, OID_AUTO, zone, CTLTYPE_STRING|CTLFLAG_RD, \
NULL, 0, sysctl_vm_zone, "A", "Zone Info");
SYSCTL_INT(_vm, OID_AUTO, zone_kmem_pages,
- CTLFLAG_RD, &zone_kmem_pages, 0, "Number of interrupt safe pages allocated by zone");
+ CTLFLAG_RD, &zone_kmem_pages, 0, "");
SYSCTL_INT(_vm, OID_AUTO, zone_kmem_kvaspace,
- CTLFLAG_RD, &zone_kmem_kvaspace, 0, "KVA space allocated by zone");
+ CTLFLAG_RD, &zone_kmem_kvaspace, 0, "");
SYSCTL_INT(_vm, OID_AUTO, zone_kern_pages,
- CTLFLAG_RD, &zone_kern_pages, 0, "Number of non-interrupt safe pages allocated by zone");
+ CTLFLAG_RD, &zone_kern_pages, 0, "");
diff --git a/sys/vm/vm_zone.h b/sys/vm/vm_zone.h
index 8fe91d1e1aaf0..55c54d37f4f0e 100644
--- a/sys/vm/vm_zone.h
+++ b/sys/vm/vm_zone.h
@@ -11,10 +11,10 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
- * $Id: vm_zone.h,v 1.11 1999/01/08 17:31:30 eivind Exp $
+ * $Id: vm_zone.c,v 1.20 1998/04/15 17:47:40 bde Exp $
*/
-#ifndef _SYS_ZONE_H
+#if !defined(_SYS_ZONE_H)
#define _SYS_ZONE_H
@@ -76,7 +76,7 @@ _zalloc(vm_zone_t z)
{
void *item;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (z == 0)
zerror(ZONE_ERROR_INVALID);
#endif
@@ -86,7 +86,7 @@ _zalloc(vm_zone_t z)
item = z->zitems;
z->zitems = ((void **) item)[0];
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (((void **) item)[1] != (void *) ZENTRY_FREE)
zerror(ZONE_ERROR_NOTFREE);
((void **) item)[1] = 0;
@@ -101,7 +101,7 @@ static __inline__ void
_zfree(vm_zone_t z, void *item)
{
((void **) item)[0] = z->zitems;
-#ifdef INVARIANTS
+#if defined(DIAGNOSTIC)
if (((void **) item)[1] == (void *) ZENTRY_FREE)
zerror(ZONE_ERROR_ALREADYFREE);
((void **) item)[1] = (void *) ZENTRY_FREE;
@@ -123,7 +123,7 @@ zalloc(vm_zone_t z)
static __inline__ void
zfree(vm_zone_t z, void *item)
{
-#ifdef SMP
+#if defined(SMP)
zfreei(z, item);
#else
_zfree(z, item);
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index fba7e2fbec270..23affb7cce1da 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
- * $Id: vnode_pager.c,v 1.100 1998/10/13 08:24:44 dg Exp $
+ * $Id: vnode_pager.c,v 1.99 1998/09/28 23:58:10 rvb Exp $
*/
/*
@@ -489,7 +489,7 @@ vnode_pager_input_old(object, m)
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
auio.uio_resid = size;
- auio.uio_procp = curproc;
+ auio.uio_procp = (struct proc *) 0;
error = VOP_READ(object->handle, &auio, 0, curproc->p_ucred);
if (!error) {